PageSourceSearch

https://app.figenai.com/build/assets/app-DAT5xt4Z.js

js figenai.com collected 2026-10-09 22:55:02 UTC 2,023,318 bytes, 1,413 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DAqS4csD.js","assets/index-SEIRr1-_.js","assets/ai-response-animation-CqvATfSy.js","assets/index-CiLHBlJG.js","assets/index-DvG2c2S7.js","assets/index-CaCUF82R.js","assets/index-bPKdmMxd.js","assets/index-DKRu8N1Q.js","assets/index-C6N7D62z.js","assets/index-7zpdcj_1.js","assets/index-0Kd400uD.js","assets/index-DCPaS6T1.js","assets/index-KpMPVkJh.js","assets/index-VAv27RLr.js","assets/index-qBm-vpDv.js","assets/index-B5eDR8Hh.js","assets/index-Dh8XOGAw.js","assets/index-CH1yAIyp.js","assets/index-D0vR2Vjd.js","assets/index-DLXmCBIE.js","assets/dockerfile-BU1Ap__c.js","assets/simple-mode-CKxFYdZi.js","assets/factor-BPndPnYX.js","assets/nsis-ClDXqMnM.js","assets/pug-BmUsPMDj.js","assets/javascript-iSgyE4tI.js","assets/index-0pY9vS3C.js","assets/index-CwZwT3_E.js","assets/dagre-6UL2VRFP-Bktqv8BI.js","assets/graph-C2QCx_D9.js","assets/_baseUniq-3M8aNuqe.js","assets/layout-D4j_61LQ.js","assets/_basePickBy-B3QNcmAg.js","assets/clone-Vzxcp1my.js","assets/cose-bilkent-S5V4N54A-DZ2P_XuW.js","assets/cytoscape.esm-CyJtwmzi.js","assets/c4Diagram-YG6GDRKO-DPpkOeZj.js","assets/chunk-TZMSLE5B-BLjbKCHp.js","assets/flowDiagram-NV44I4VS-C0ej3jNn.js","assets/chunk-FMBD7UC4-DPBPJ34G.js","assets/chunk-55IACEB6-CsHzw90l.js","assets/chunk-QN33PNHL-KDonUwa3.js","assets/channel-CDGEENwF.js","assets/erDiagram-Q2GNP2WA-C0ahC3th.js","assets/gitGraphDiagram-NY62KEGX-DsjWZ6x7.js","assets/chunk-4BX2VUAB-DniS-uvv.js","assets/chunk-QZHKN3VN-CZCvKJG1.js","assets/treemap-KMMF4GRG-C-nTRvPH.js","assets/ganttDiagram-LVOFAZNH-B3vHhhd_.js","assets/linear-CTNY0aSC.js","assets/init-Gi6I4Gst.js","assets/defaultLocale-C4B-KCzX.js","assets/infoDiagram-ER5ION4S-_pt6W9aq.js","assets/pieDiagram-ADFJNKIX-CF9MlHxn.js","assets/arc-CHhy8m9Y.js","assets/ordinal-Cboi1Yqb.js","assets/quadrantDiagram-AYHSOK5B-DLMR4q8P.js","assets/xychartDiagram-PRI3JC2R-BSVDBaZF.js","assets/requirementDiagram-UZGBJVZJ-B1eX7-K3.js","assets/sequenceDiagram-WL72ISMW-DWeiiBgm.js","assets/classDiagram-2ON5EDUG-DKG3HXGe.js","assets/chunk-B4BG7PRW-CDSn7kJU.js","assets/classDiagram-v2-WZHVMYZB-DKG3HXGe.js","assets/stateDiagram-FKZM4ZOC-DH4wndlI.js","assets/chunk-DI55MBZ5-C0QrBDvf.js","assets/stateDiagram-v2-4FDKWEC3-TsHybPtB.js","assets/journeyDiagram-XKPGCS4Q-BFC4BXTc.js","assets/timeline-definition-IT6M3QCI-BGUGHo_t.js","assets/mindmap-definition-VGOIOE7T-6OlLdD-A.js","assets/kanban-definition-3W4ZIXB7-BwEO7lCF.js","assets/sankeyDiagram-TZEHDZUN-DeFe9P43.js","assets/diagram-S2PKOQOG-CMXEwnxL.js","assets/diagram-QEK2KX5R-DC8YLwPF.js","assets/blockDiagram-VD42YOAC-4R2RCh9E.js","assets/architectureDiagram-VXUJARFQ-CQRW3dfl.js","assets/diagram-PSM6KHXK-B9IcYbAy.js","assets/pptx-export-Cd42YgqY.js"])))=>i.map(i=>d[i]);
2var OJ=Object.defineProperty;var E_=t=>{throw TypeError(t)};var LJ=(t,e,r)=>e in t?OJ(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var er=(t,e,r)=>LJ(t,typeof e!="symbol"?e+"":e,r),E4=(t,e,r)=>e.has(t)||E_("Cannot "+r);var V=(t,e,r)=>(E4(t,e,"read from private field"),r?r.call(t):e.get(t)),we=(t,e,r)=>e.has(t)?E_("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),ie=(t,e,r,n)=>(E4(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),ly=(t,e,r)=>(E4(t,e,"access private method"),r);import"./ai-response-animation-CqvATfSy.js";const DJ="modulepreload",IJ=function(t){return"/build/"+t},O_={},J=function(e,r,n){let i=Promise.resolve();if(r&&r.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=Promise.allSettled(r.map(l=>{if(l=IJ(l),l in O_)return;O_[l]=!0;const c=l.endsWith(".css"),h=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${h}`))return;const u=document.createElement("link");if(u.rel=c?"stylesheet":DJ,c||(u.as="script"),u.crossOrigin="",u.href=l,a&&u.setAttribute("nonce",a),document.head.appendChild(u),c)return new Promise((d,f)=>{u.addEventListener("load",d),u.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${l}`)))})}))}function s(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return i.then(o=>{for(const a of o||[])a.status==="rejected"&&s(a.reason);return e().catch(s)})};function SB(t,e){return function(){return t.apply(e,arguments)}}const{toString:BJ}=Object.prototype,{getPrototypeOf:T6}=Object,Tv=(t=>e=>{const r=BJ.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),fo=t=>(t=t.toLowerCase(),e=>Tv(e)===t),_v=t=>e=>typeof e===t,{isArray:Wf}=Array,$m=_v("undefined");function RJ(t){return t!==null&&!$m(t)&&t.constructor!==null&&!$m(t.constructor)&&rs(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const TB=fo("ArrayBuffer");function PJ(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&TB(t.buffer),e}const NJ=_v("string"),rs=_v("function"),_B=_v("number"),Mv=t=>t!==null&&typeof t=="object",FJ=t=>t===!0||t===!1,x2=t=>{if(Tv(t)!=="object")return!1;const e=T6(t);
2return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},$J=fo("Date"),zJ=fo("File"),HJ=fo("Blob"),qJ=fo("FileList"),VJ=t=>Mv(t)&&rs(t.pipe),WJ=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||rs(t.append)&&((e=Tv(t))==="formdata"||e==="object"&&rs(t.toString)&&t.toString()==="[object FormData]"))},jJ=fo("URLSearchParams"),[UJ,GJ,KJ,YJ]=["ReadableStream","Request","Response","Headers"].map(fo),XJ=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function d1(t,e,{allOwnKeys:r=!1}={}){if(t===null||typeof t>"u")return;let n,i;if(typeof t!="object"&&(t=[t]),Wf(t))for(n=0,i=t.length;n<i;n++)e.call(null,t[n],n,t);else{const s=r?Object.getOwnPropertyNames(t):Object.keys(t),o=s.length;let a;for(n=0;n<o;n++)a=s[n],e.call(null,t[a],a,t)}}function MB(t,e){e=e.toLowerCase();const r=Object.keys(t);let n=r.length,i;for(;n-- >0;)if(i=r[n],e===i.toLowerCase())return i;return null}const dh=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,AB=t=>!$m(t)&&t!==dh;function Uk(){const{caseless:t}=AB(this)&&this||{},e={},r=(n,i)=>{const s=t&&MB(e,i)||i;x2(e[s])&&x2(n)?e[s]=Uk(e[s],n):x2(n)?e[s]=Uk({},n):Wf(n)?e[s]=n.slice():e[s]=n};for(let n=0,i=arguments.length;n<i;n++)arguments[n]&&d1(arguments[n],r);return e}const JJ=(t,e,r,{allOwnKeys:n}={})=>(d1(e,(i,s)=>{r&&rs(i)?t[s]=SB(i,r):t[s]=i},{allOwnKeys:n}),t),ZJ=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),QJ=(t,e,r,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},eZ=(t,e,r,n)=>{let i,s,o;const a={};if(e=e||{},t==null)return e;do{for(i=Object.getOwnPropertyNames(t),s=i.length;s-- >0;)o=i[s],(!n||n(o,t,e))&&!a[o]&&(e[o]=t[o],a[o]=!0);t=r!==!1&&T6(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},tZ=(t,e,r)=>{t=String(t),(r===void 0||r>t.length)&&(r=t.length),r-=e.length;const n=t.indexOf(e,r);return n!==-1&&n===r},rZ=t=>{if(!t)return null;if(Wf(t))return t;let e=t.length;if(!_B(e))return null;const r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},nZ=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&T6(Uint8Array)),iZ=(t,e)=>{const n=(t&&t[Symbol.iterator]).call(t);let i;for(;(i=n.next())&&!i.done;){const s=i.value;e.call(t,s[0],s[1])}},sZ=(t,e)=>{let r;const n=[];for(;(r=t.exec(e))!==null;)n.push(r);return n},oZ=fo("HTMLFormElement"),aZ=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,i){return n.toUpperCase()+i}),L_=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),lZ=fo("RegExp"),EB=(t,e)=>{const r=Object.getOwnPropertyDescriptors(t),n={};d1(r,(i,s)=>{let o;(o=e(i,s,t))!==!1&&(n[s]=o||i)}),Object.defineProperties(t,n)},cZ=t=>{EB(t,(e,r)=>{if(rs(t)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=t[r];if(rs(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},hZ=(t,e)=>{const r={},n=i=>{i.forEach(s=>{r[s]=!0})};return Wf(t)?n(t):n(String(t).split(e)),r},uZ=()=>{},dZ=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e,O4="abcdefghijklmnopqrstuvwxyz",D_="0123456789",OB={DIGIT:D_,ALPHA:O4,ALPHA_DIGIT:O4+O4.toUpperCase()+D_},fZ=(t=16,e=OB.ALPHA_DIGIT)=>{let r="";const{length:n}=e;for(;t--;)r+=e[Math.random()*n|0];return r};function pZ(t){return!!(t&&rs(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const mZ=t=>{const e=new Array(10),r=(n,i)=>{if(Mv(n)){if(e.indexOf(n)>=0)return;if(!("toJSON"in n)){e[i]=n;const s=Wf(n)?[]:{};return d1(n,(o,a)=>{const l=r(o,i+1);!$m(l)&&(s[a]=l)}),e[i]=void 0,s}}return n};return r(t,0)},gZ=fo("AsyncFunction"),yZ=t=>t&&(Mv(t)||rs(t))&&rs(t.then)&&rs(t.catch),LB=((t,e)=>t?setImmediate:e?((r,n)=>(dh.addEventListener("message",({source:i,data:s})=>{i===dh&&s===r&&n.length&&n.shift()()},!1),i=>{n.push(i),dh.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",rs(dh.postMessage)),bZ=typeof queueMicrotask<"u"?queueMicrotask.bind(dh):typeof process<"u"&&process.nextTick||LB,re={isArray:Wf,isArrayBuffer:TB,isBuffer:RJ,isFormData:WJ,isArrayBufferView:PJ,isString:NJ,isNumber:_B,isBoolean:FJ,isObject:Mv,isPlainObject:x2,isReadableStream:UJ,isRequest:GJ,isResponse:KJ,isHeaders:YJ,isUndefined:$m,isDate:$J,isFile:zJ,isBlob:HJ,isRegExp:lZ,isFunction:rs,isStream:VJ,isURLSearchParams:jJ,isTypedArray:nZ,isFileList:qJ,forEach:d1,merge:Uk,extend:JJ,trim:XJ,stripBOM:ZJ,inherits:QJ,toFlatObject:eZ,kindOf:Tv,kindOfTest:fo,endsWith:tZ,toArray:rZ,forEachEntry:iZ,matchAll:sZ,isHTMLForm:oZ,hasOwnProperty:L_,hasOwnProp:L_,reduceDescriptors:EB,freezeMethods:cZ,toObjectSet:hZ,toCamelCase:aZ,noop:uZ,toFiniteNumber:dZ,findKey:MB,global:dh,isContextDefined:AB,ALPHABET:OB,generateString:fZ,isSpecCompliantForm:pZ,toJSONObject:mZ,isAsyncFn:gZ,isThenable:yZ,setImmediate:LB,asap:bZ};function St(t,e,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i,this.status=i.status?i.status:null)}re.inherits(St,Error,{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:re.toJSONObject(this.config),code:this.code,status:this.status}}});const DB=St.prototype,IB={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","E
2RR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{IB[t]={value:t}});Object.defineProperties(St,IB);Object.defineProperty(DB,"isAxiosError",{value:!0});St.from=(t,e,r,n,i,s)=>{const o=Object.create(DB);return re.toFlatObject(t,o,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),St.call(o,t.message,e,r,n,i),o.cause=t,o.name=t.name,s&&Object.assign(o,s),o};const xZ=null;function Gk(t){return re.isPlainObject(t)||re.isArray(t)}function BB(t){return re.endsWith(t,"[]")?t.slice(0,-2):t}function I_(t,e,r){return t?t.concat(e).map(function(i,s){return i=BB(i),!r&&s?"["+i+"]":i}).join(r?".":""):e}function vZ(t){return re.isArray(t)&&!t.some(Gk)}const wZ=re.toFlatObject(re,{},null,function(e){return/^is[A-Z]/.test(e)});function Av(t,e,r){if(!re.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,r=re.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,g){return!re.isUndefined(g[m])});const n=r.metaTokens,i=r.visitor||h,s=r.dots,o=r.indexes,l=(r.Blob||typeof Blob<"u"&&Blob)&&re.isSpecCompliantForm(e);if(!re.isFunction(i))throw new TypeError("visitor must be a function");function c(p){if(p===null)return"";if(re.isDate(p))return p.toISOString();if(!l&&re.isBlob(p))throw new St("Blob is not supported. Use a Buffer instead.");return re.isArrayBuffer(p)||re.isTypedArray(p)?l&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function h(p,m,g){let y=p;if(p&&!g&&typeof p=="object"){if(re.endsWith(m,"{}"))m=n?m:m.slice(0,-2),p=JSON.stringify(p);else if(re.isArray(p)&&vZ(p)||(re.isFileList(p)||re.endsWith(m,"[]"))&&(y=re.toArray(p)))return m=BB(m),y.forEach(function(x,S){!(re.isUndefined(x)||x===null)&&e.append(o===!0?I_([m],S,s):o===null?m:m+"[]",c(x))}),!1}return Gk(p)?!0:(e.append(I_(g,m,s),c(p)),!1)}const u=[],d=Object.assign(wZ,{defaultVisitor:h,convertValue:c,isVisitable:Gk});function f(p,m){if(!re.isUndefined(p)){if(u.indexOf(p)!==-1)throw Error("Circular reference detected in "+m.join("."));u.push(p),re.forEach(p,function(y,b){(!(re.isUndefined(y)||y===null)&&i.call(e,y,re.isString(b)?b.trim():b,m,d))===!0&&f(y,m?m.concat(b):[b])}),u.pop()}}if(!re.isObject(t))throw new TypeError("data must be an object");return f(t),e}
vendor: 5,273 bytes, lines 2-3
2function B_(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function _6(t,e){this._pairs=[],t&&Av(t,this,e)}const RB=_6.prototype;RB.append=function(e,r){this._pairs.push([e,r])};RB.toString=function(e){const r=e?function(n){return e.call(this,n,B_)}:B_;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};function kZ(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function PB(t,e,r){if(!e)return t;const n=r&&r.encode||kZ,i=r&&r.serialize;let s;if(i?s=i(e,r):s=re.isURLSearchParams(e)?e.toString():new _6(e,r).toString(n),s){const o=t.indexOf("#");o!==-1&&(t=t.slice(0,o)),t+=(t.indexOf("?")===-1?"?":"&")+s}return t}class R_{constructor(){this.handlers=[]}use(e,r,n){return this.handlers.push({fulfilled:e,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){re.forEach(this.handlers,function(n){n!==null&&e(n)})}}const NB={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},CZ=typeof URLSearchParams<"u"?URLSearchParams:_6,SZ=typeof FormData<"u"?FormData:null,TZ=typeof Blob<"u"?Blob:null,_Z={isBrowser:!0,classes:{URLSearchParams:CZ,FormData:SZ,Blob:TZ},protocols:["http","https","file","blob","url","data"]},M6=typeof window<"u"&&typeof document<"u",Kk=typeof navigator=="object"&&navigator||void 0,MZ=M6&&(!Kk||["ReactNative","NativeScript","NS"].indexOf(Kk.product)<0),AZ=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",EZ=M6&&window.location.href||"http://localhost",OZ=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:M6,hasStandardBrowserEnv:MZ,hasStandardBrowserWebWorkerEnv:AZ,navigator:Kk,origin:EZ},Symbol.toStringTag,{value:"Module"})),Li={...OZ,..._Z};function LZ(t,e){return Av(t,new Li.classes.URLSearchParams,Object.assign({visitor:function(r,n,i,s){return Li.isNode&&re.isBuffer(r)?(this.append(n,r.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},e))}function DZ(t){return re.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function IZ(t){const e={},r=Object.keys(t);let n;const i=r.length;let s;for(n=0;n<i;n++)s=r[n],e[s]=t[s];return e}function FB(t){function e(r,n,i,s){let o=r[s++];if(o==="__proto__")return!0;const a=Number.isFinite(+o),l=s>=r.length;return o=!o&&re.isArray(i)?i.length:o,l?(re.hasOwnProp(i,o)?i[o]=[i[o],n]:i[o]=n,!a):((!i[o]||!re.isObject(i[o]))&&(i[o]=[]),e(r,n,i[o],s)&&re.isArray(i[o])&&(i[o]=IZ(i[o])),!a)}if(re.isFormData(t)&&re.isFunction(t.entries)){const r={};return re.forEachEntry(t,(n,i)=>{e(DZ(n),i,r,0)}),r}return null}function BZ(t,e,r){if(re.isString(t))try{return(e||JSON.parse)(t),re.trim(t)}catch(n){if(n.name!=="SyntaxError")throw n}return(0,JSON.stringify)(t)}const f1={transitional:NB,adapter:["xhr","http","fetch"],transformRequest:[function(e,r){const n=r.getContentType()||"",i=n.indexOf("application/json")>-1,s=re.isObject(e);if(s&&re.isHTMLForm(e)&&(e=new FormData(e)),re.isFormData(e))return i?JSON.stringify(FB(e)):e;if(re.isArrayBuffer(e)||re.isBuffer(e)||re.isStream(e)||re.isFile(e)||re.isBlob(e)||re.isReadableStream(e))return e;if(re.isArrayBufferView(e))return e.buffer;if(re.isURLSearchParams(e))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return LZ(e,this.formSerializer).toString();if((a=re.isFileList(e))||n.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return Av(a?{"files[]":e}:e,l&&new l,this.formSerializer)}}return s||i?(r.setContentType("application/json",!1),BZ(e)):e}],transformResponse:[function(e){const r=this.transitional||f1.transitional,n=r&&r.forcedJSONParsing,i=this.responseType==="json";if(re.isResponse(e)||re.isReadableStream(e))return e;if(e&&re.isString(e)&&(n&&!this.responseType||i)){const o=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(a){if(o)throw a.name==="SyntaxError"?St.from(a,St.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Li.classes.FormData,Blob:Li.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};re.forEach(["delete","get","head","post","put","patch"],t=>{f1.headers[t]={}});const RZ=re.toObjectSet(["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"]),PZ=t=>{const e={};let r,n,i;return t&&t.split(`
3`).forEach(function(o){i=o.indexOf(":"),r=o.substring(0,i).trim().toLowerCase(),n=o.substring(i+1).trim(),!(!r||e[r]&&RZ[r])&&(r==="set-cookie"?e[r]?e[r].push(n):e[r]=[n]:e[r]=e[r]?e[r]+", "+n:n)}),e},P_=Symbol("internals");function O0(t){return t&&String(t).trim().toLowerCase()}
vendor: 2,746 bytes, lines 3-4
3function v2(t){return t===!1||t==null?t:re.isArray(t)?t.map(v2):String(t)}function NZ(t){const e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(t);)e[n[1]]=n[2];return e}const FZ=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function L4(t,e,r,n,i){if(re.isFunction(n))return n.call(this,e,r);if(i&&(e=r),!!re.isString(e)){if(re.isString(n))return e.indexOf(n)!==-1;if(re.isRegExp(n))return n.test(e)}}function $Z(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,r,n)=>r.toUpperCase()+n)}function zZ(t,e){const r=re.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(t,n+r,{value:function(i,s,o){return this[n].call(this,e,i,s,o)},configurable:!0})})}class Di{constructor(e){e&&this.set(e)}set(e,r,n){const i=this;function s(a,l,c){const h=O0(l);if(!h)throw new Error("header name must be a non-empty string");const u=re.findKey(i,h);(!u||i[u]===void 0||c===!0||c===void 0&&i[u]!==!1)&&(i[u||l]=v2(a))}const o=(a,l)=>re.forEach(a,(c,h)=>s(c,h,l));if(re.isPlainObject(e)||e instanceof this.constructor)o(e,r);else if(re.isString(e)&&(e=e.trim())&&!FZ(e))o(PZ(e),r);else if(re.isHeaders(e))for(const[a,l]of e.entries())s(l,a,n);else e!=null&&s(r,e,n);return this}get(e,r){if(e=O0(e),e){const n=re.findKey(this,e);if(n){const i=this[n];if(!r)return i;if(r===!0)return NZ(i);if(re.isFunction(r))return r.call(this,i,n);if(re.isRegExp(r))return r.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,r){if(e=O0(e),e){const n=re.findKey(this,e);return!!(n&&this[n]!==void 0&&(!r||L4(this,this[n],n,r)))}return!1}delete(e,r){const n=this;let i=!1;function s(o){if(o=O0(o),o){const a=re.findKey(n,o);a&&(!r||L4(n,n[a],a,r))&&(delete n[a],i=!0)}}return re.isArray(e)?e.forEach(s):s(e),i}clear(e){const r=Object.keys(this);let n=r.length,i=!1;for(;n--;){const s=r[n];(!e||L4(this,this[s],s,e,!0))&&(delete this[s],i=!0)}return i}normalize(e){const r=this,n={};return re.forEach(this,(i,s)=>{const o=re.findKey(n,s);if(o){r[o]=v2(i),delete r[s];return}const a=e?$Z(s):String(s).trim();a!==s&&delete r[s],r[a]=v2(i),n[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const r=Object.create(null);return re.forEach(this,(n,i)=>{n!=null&&n!==!1&&(r[i]=e&&re.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,r])=>e+": "+r).join(`
4`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...r){const n=new this(e);return r.forEach(i=>n.set(i)),n}static accessor(e){const n=(this[P_]=this[P_]={accessors:{}}).accessors,i=this.prototype;function s(o){const a=O0(o);
4n[a]||(zZ(i,o),n[a]=!0)}return re.isArray(e)?e.forEach(s):s(e),this}}Di.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);re.reduceDescriptors(Di.prototype,({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(n){this[r]=n}}});re.freezeMethods(Di);function D4(t,e){const r=this||f1,n=e||r,i=Di.from(n.headers);let s=n.data;return re.forEach(t,function(a){s=a.call(r,s,i.normalize(),e?e.status:void 0)}),i.normalize(),s}function $B(t){return!!(t&&t.__CANCEL__)}function jf(t,e,r){St.call(this,t??"canceled",St.ERR_CANCELED,e,r),this.name="CanceledError"}re.inherits(jf,St,{__CANCEL__:!0});function zB(t,e,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?t(r):e(new St("Request failed with status code "+r.status,[St.ERR_BAD_REQUEST,St.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function HZ(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function qZ(t,e){t=t||10;const r=new Array(t),n=new Array(t);let i=0,s=0,o;return e=e!==void 0?e:1e3,function(l){const c=Date.now(),h=n[s];o||(o=c),r[i]=l,n[i]=c;let u=s,d=0;for(;u!==i;)d+=r[u++],u=u%t;if(i=(i+1)%t,i===s&&(s=(s+1)%t),c-o<e)return;const f=h&&c-h;return f?Math.round(d*1e3/f):void 0}}function VZ(t,e){let r=0,n=1e3/e,i,s;const o=(c,h=Date.now())=>{r=h,i=null,s&&(clearTimeout(s),s=null),t.apply(null,c)};return[(...c)=>{const h=Date.now(),u=h-r;u>=n?o(c,h):(i=c,s||(s=setTimeout(()=>{s=null,o(i)},n-u)))},()=>i&&o(i)]}const $b=(t,e,r=3)=>{let n=0;const i=qZ(50,250);return VZ(s=>{const o=s.loaded,a=s.lengthComputable?s.total:void 0,l=o-n,c=i(l),h=o<=a;n=o;const u={loaded:o,total:a,progress:a?o/a:void 0,bytes:l,rate:c||void 0,estimated:c&&a&&h?(a-o)/c:void 0,event:s,lengthComputable:a!=null,[e?"download":"upload"]:!0};t(u)},r)},N_=(t,e)=>{const r=t!=null;return[n=>e[0]({lengthComputable:r,total:t,loaded:n}),e[1]]},F_=t=>(...e)=>re.asap(()=>t(...e)),WZ=Li.hasStandardBrowserEnv?function(){const e=Li.navigator&&/(msie|trident)/i.test(Li.navigator.userAgent),r=document.createElement("a");let n;function i(s){let o=s;return e&&(r.setAttribute("href",o),o=r.href),r.setAttribute("href",o),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return n=i(window.location.href),function(o){const a=re.isString(o)?i(o):o;return a.protocol===n.protocol&&a.host===n.host}}():function(){return function(){return!0}}(),jZ=Li.hasStandardBrowserEnv?{write(t,e,r,n,i,s){const o=[t+"="+encodeURIComponent(e)];re.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),re.isString(n)&&o.push("path="+n),re.isString(i)&&o.push("domain="+i),s===!0&&o.push("secure"),document.cookie=o.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function UZ(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function GZ(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function HB(t,e){return t&&!UZ(e)?GZ(t,e):e}const $_=t=>t instanceof Di?{...t}:t;function Zh(t,e){e=e||{};const r={};function n(c,h,u){return re.isPlainObject(c)&&re.isPlainObject(h)?re.merge.call({caseless:u},c,h):re.isPlainObject(h)?re.merge({},h):re.isArray(h)?h.slice():h}function i(c,h,u){if(re.isUndefined(h)){if(!re.isUndefined(c))return n(void 0,c,u)}else return n(c,h,u)}function s(c,h){if(!re.isUndefined(h))return n(void 0,h)}function o(c,h){if(re.isUndefined(h)){if(!re.isUndefined(c))return n(void 0,c)}else return n(void 0,h)}function a(c,h,u){if(u in e)return n(c,h);if(u in t)return n(void 0,c)}const l={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBo
4dyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(c,h)=>i($_(c),$_(h),!0)};return re.forEach(Object.keys(Object.assign({},t,e)),function(h){const u=l[h]||i,d=u(t[h],e[h],h);re.isUndefined(d)&&u!==a||(r[h]=d)}),r}const qB=t=>{const e=Zh({},t);let{data:r,withXSRFToken:n,xsrfHeaderName:i,xsrfCookieName:s,headers:o,auth:a}=e;e.headers=o=Di.from(o),e.url=PB(HB(e.baseURL,e.url),t.params,t.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let l;if(re.isFormData(r)){if(Li.hasStandardBrowserEnv||Li.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((l=o.getContentType())!==!1){const[c,...h]=l?l.split(";").map(u=>u.trim()).filter(Boolean):[];o.setContentType([c||"multipart/form-data",...h].join("; "))}}if(Li.hasStandardBrowserEnv&&(n&&re.isFunction(n)&&(n=n(e)),n||n!==!1&&WZ(e.url))){const c=i&&s&&jZ.read(s);c&&o.set(i,c)}return e},KZ=typeof XMLHttpRequest<"u",YZ=KZ&&function(t){return new Promise(function(r,n){const i=qB(t);let s=i.data;const o=Di.from(i.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:c}=i,h,u,d,f,p;function m(){f&&f(),p&&p(),i.cancelToken&&i.cancelToken.unsubscribe(h),i.signal&&i.signal.removeEventListener("abort",h)}let g=new XMLHttpRequest;g.open(i.method.toUpperCase(),i.url,!0),g.timeout=i.timeout;function y(){if(!g)return;const x=Di.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders()),k={data:!a||a==="text"||a==="json"?g.responseText:g.response,status:g.status,statusText:g.statusText,headers:x,config:t,request:g};zB(function(_){r(_),m()},function(_){n(_),m()},k),g=null}"onloadend"in g?g.onloadend=y:g.onreadystatechange=function(){!g||g.readyState!==4||g.status===0&&!(g.responseURL&&g.responseURL.indexOf("file:")===0)||setTimeout(y)},g.onabort=function(){g&&(n(new St("Request aborted",St.ECONNABORTED,t,g)),g=null)},g.onerror=function(){n(new St("Network Error",St.ERR_NETWORK,t,g)),g=null},g.ontimeout=function(){let S=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const k=i.transitional||NB;i.timeoutErrorMessage&&(S=i.timeoutErrorMessage),n(new St(S,k.clarifyTimeoutError?St.ETIMEDOUT:St.ECONNABORTED,t,g)),g=null},s===void 0&&o.setContentType(null),"setRequestHeader"in g&&re.forEach(o.toJSON(),function(S,k){g.setRequestHeader(k,S)}),re.isUndefined(i.withCredentials)||(g.withCredentials=!!i.withCredentials),a&&a!=="json"&&(g.responseType=i.responseType),c&&([d,p]=$b(c,!0),g.addEventListener("progress",d)),l&&g.upload&&([u,f]=$b(l),g.upload.addEventListener("progress",u),g.upload.addEventListener("loadend",f)),(i.cancelToken||i.signal)&&(h=x=>{g&&(n(!x||x.type?new jf(null,t,g):x),g.abort(),g=null)},i.cancelToken&&i.cancelToken.subscribe(h),i.signal&&(i.signal.aborted?h():i.signal.addEventListener("abort",h)));const b=HZ(i.url);if(b&&Li.protocols.indexOf(b)===-1){n(new St("Unsupported protocol "+b+":",St.ERR_BAD_REQUEST,t));return}g.send(s||null)})},XZ=(t,e)=>{const{length:r}=t=t?t.filter(Boolean):[];if(e||r){let n=new AbortController,i;const s=function(c){if(!i){i=!0,a();const h=c instanceof Error?c:this.reason;n.abort(h instanceof St?h:new jf(h instanceof Error?h.message:h))}};let o=e&&setTimeout(()=>{o=null,s(new St(`timeout ${e} of ms exceeded`,St.ETIMEDOUT))},e);const a=()=>{t&&(o&&clearTimeout(o),o=null,t.forEach(c=>{c.unsubscribe?c.unsubscribe(s):c.removeEventListener("abort",s)}),t=null)};t.forEach(c=>c.addEventListener("abort",s));const{signal:l}=n;return l.unsubscribe=()=>re.asap(a),l}},JZ=function*(t,e){let r=t.byteLength;if(r<e){yield t;return}let n=0,i;for(;n<r;)i=n+e,yield t.slice(n,i),n=i},ZZ=async function*(t,e){for await(const r of QZ(t))yield*JZ(r,e)},QZ=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:r,value:n}=await e.read();if(r)break;yield n}}finally{await e.cancel()}},z_=(t,e,r,n)=>{const i=ZZ(t,e);let s=0,o,a=l=>{o||(o=!0,n&&n(l))};return new ReadableStream({async pull(l){try{const{done:c,value:h}=await i.next();if(c){a(),l.close();return}let u=h.byteLength;if(r){let d=s+=u;r(d)}l.enqueue(new Uint8Array(h))}catch(c){throw a(c),c}},cancel(l){return a(l),i.return()}},{highWaterMark:2})},Ev=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",VB=Ev&&typeof ReadableStream=="function",eQ=Ev&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),WB=(t,...e)=>{try{return!!t(...e)}catch{return!1}},tQ=VB&&WB(()=>{let t=!1;
4const e=new Request(Li.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),H_=64*1024,Yk=VB&&WB(()=>re.isReadableStream(new Response("").body)),zb={stream:Yk&&(t=>t.body)};Ev&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!zb[e]&&(zb[e]=re.isFunction(t[e])?r=>r[e]():(r,n)=>{throw new St(`Response type '${e}' is not supported`,St.ERR_NOT_SUPPORT,n)})})})(new Response);const rQ=async t=>{if(t==null)return 0;if(re.isBlob(t))return t.size;if(re.isSpecCompliantForm(t))return(await new Request(Li.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(re.isArrayBufferView(t)||re.isArrayBuffer(t))return t.byteLength;if(re.isURLSearchParams(t)&&(t=t+""),re.isString(t))return(await eQ(t)).byteLength},nQ=async(t,e)=>{const r=re.toFiniteNumber(t.getContentLength());return r??rQ(e)},iQ=Ev&&(async t=>{let{url:e,method:r,data:n,signal:i,cancelToken:s,timeout:o,onDownloadProgress:a,onUploadProgress:l,responseType:c,headers:h,withCredentials:u="same-origin",fetchOptions:d}=qB(t);c=c?(c+"").toLowerCase():"text";let f=XZ([i,s&&s.toAbortSignal()],o),p;const m=f&&f.unsubscribe&&(()=>{f.unsubscribe()});let g;try{if(l&&tQ&&r!=="get"&&r!=="head"&&(g=await nQ(h,n))!==0){let k=new Request(e,{method:"POST",body:n,duplex:"half"}),w;if(re.isFormData(n)&&(w=k.headers.get("content-type"))&&h.setContentType(w),k.body){const[_,L]=N_(g,$b(F_(l)));n=z_(k.body,H_,_,L)}}re.isString(u)||(u=u?"include":"omit");const y="credentials"in Request.prototype;p=new Request(e,{...d,signal:f,method:r.toUpperCase(),headers:h.normalize().toJSON(),body:n,duplex:"half",credentials:y?u:void 0});let b=await fetch(p);const x=Yk&&(c==="stream"||c==="response");if(Yk&&(a||x&&m)){const k={};["status","statusText","headers"].forEach(B=>{k[B]=b[B]});const w=re.toFiniteNumber(b.headers.get("content-length")),[_,L]=a&&N_(w,$b(F_(a),!0))||[];b=new Response(z_(b.body,H_,_,()=>{L&&L(),m&&m()}),k)}c=c||"text";let S=await zb[re.findKey(zb,c)||"text"](b,t);return!x&&m&&m(),await new Promise((k,w)=>{zB(k,w,{data:S,headers:Di.from(b.headers),status:b.status,statusText:b.statusText,config:t,request:p})})}catch(y){throw m&&m(),y&&y.name==="TypeError"&&/fetch/i.test(y.message)?Object.assign(new St("Network Error",St.ERR_NETWORK,t,p),{cause:y.cause||y}):St.from(y,y&&y.code,t,p)}}),Xk={http:xZ,xhr:YZ,fetch:iQ};re.forEach(Xk,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const q_=t=>`- ${t}`,sQ=t=>re.isFunction(t)||t===null||t===!1,jB={getAdapter:t=>{t=re.isArray(t)?t:[t];const{length:e}=t;let r,n;const i={};for(let s=0;s<e;s++){r=t[s];let o;if(n=r,!sQ(r)&&(n=Xk[(o=String(r)).toLowerCase()],n===void 0))throw new St(`Unknown adapter '${o}'`);if(n)break;i[o||"#"+s]=n}if(!n){const s=Object.entries(i).map(([a,l])=>`adapter ${a} `+(l===!1?"is not supported by the environment":"is not available in the build"));let o=e?s.length>1?`since :
5`+s.map(q_).join(`
6`):" "+q_(s[0]):"as no adapter specified";throw new St("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return n},adapters:Xk};function I4(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new jf(null,t)}function V_(t){return I4(t),t.headers=Di.from(t.headers),t.data=D4.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),jB.getAdapter(t.adapter||f1.adapter)(t).then(function(n){return I4(t),n.data=D4.call(t,t.transformResponse,n),n.headers=Di.from(n.headers),n},function(n){return $B(n)||(I4(t),n&&n.response&&(n.response.data=D4.call(t,t.transformResponse,n.response),n.response.headers=Di.from(n.response.headers))),Promise.reject(n)})}const UB="1.7.7",A6={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{A6[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}});const W_={};A6.transitional=function(e,r,n){function i(s,o){return"[Axios v"+UB+"] Transitional option '"+s+"'"+o+(n?". "+n:"")}return(s,o,a)=>
6{if(e===!1)throw new St(i(o," has been removed"+(r?" in "+r:"")),St.ERR_DEPRECATED);return r&&!W_[o]&&(W_[o]=!0,console.warn(i(o," has been deprecated since v"+r+" and will be removed in the near future"))),e?e(s,o,a):!0}};function oQ(t,e,r){if(typeof t!="object")throw new St("options must be an object",St.ERR_BAD_OPTION_VALUE);const n=Object.keys(t);let i=n.length;for(;i-- >0;){const s=n[i],o=e[s];if(o){const a=t[s],l=a===void 0||o(a,s,t);if(l!==!0)throw new St("option "+s+" must be "+l,St.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new St("Unknown option "+s,St.ERR_BAD_OPTION)}}const Jk={assertOptions:oQ,validators:A6},Sl=Jk.validators;class Fh{constructor(e){this.defaults=e,this.interceptors={request:new R_,response:new R_}}async request(e,r){try{return await this._request(e,r)}catch(n){if(n instanceof Error){let i;Error.captureStackTrace?Error.captureStackTrace(i={}):i=new Error;const s=i.stack?i.stack.replace(/^.+\n/,""):"";try{n.stack?s&&!String(n.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(n.stack+=`
7`+s):n.stack=s}catch{}}throw n}}_request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=Zh(this.defaults,r);const{transitional:n,paramsSerializer:i,headers:s}=r;n!==void 0&&Jk.assertOptions(n,{silentJSONParsing:Sl.transitional(Sl.boolean),forcedJSONParsing:Sl.transitional(Sl.boolean),clarifyTimeoutError:Sl.transitional(Sl.boolean)},!1),i!=null&&(re.isFunction(i)?r.paramsSerializer={serialize:i}:Jk.assertOptions(i,{encode:Sl.function,serialize:Sl.function},!0)),r.method=(r.method||this.defaults.method||"get").toLowerCase();let o=s&&re.merge(s.common,s[r.method]);s&&re.forEach(["delete","get","head","post","put","patch","common"],p=>{delete s[p]}),r.headers=Di.concat(o,s);const a=[];let l=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(r)===!1||(l=l&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const c=[];this.interceptors.response.forEach(function(m){c.push(m.fulfilled,m.rejected)});let h,u=0,d;if(!l){const p=[V_.bind(this),void 0];for(p.unshift.apply(p,a),p.push.apply(p,c),d=p.length,h=Promise.resolve(r);u<d;)h=h.then(p[u++],p[u++]);return h}d=a.length;let f=r;for(u=0;
vendor: 1,947 bytes, line 7
7u<d;){const p=a[u++],m=a[u++];try{f=p(f)}catch(g){m.call(this,g);break}}try{h=V_.call(this,f)}catch(p){return Promise.reject(p)}for(u=0,d=c.length;u<d;)h=h.then(c[u++],c[u++]);return h}getUri(e){e=Zh(this.defaults,e);const r=HB(e.baseURL,e.url);return PB(r,e.params,e.paramsSerializer)}}re.forEach(["delete","get","head","options"],function(e){Fh.prototype[e]=function(r,n){return this.request(Zh(n||{},{method:e,url:r,data:(n||{}).data}))}});re.forEach(["post","put","patch"],function(e){function r(n){return function(s,o,a){return this.request(Zh(a||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:s,data:o}))}}Fh.prototype[e]=r(),Fh.prototype[e+"Form"]=r(!0)});class E6{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(s){r=s});const n=this;this.promise.then(i=>{if(!n._listeners)return;let s=n._listeners.length;for(;s-- >0;)n._listeners[s](i);n._listeners=null}),this.promise.then=i=>{let s;const o=new Promise(a=>{n.subscribe(a),s=a}).then(i);return o.cancel=function(){n.unsubscribe(s)},o},e(function(s,o,a){n.reason||(n.reason=new jf(s,o,a),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const e=new AbortController,r=n=>{e.abort(n)};return this.subscribe(r),e.signal.unsubscribe=()=>this.unsubscribe(r),e.signal}static source(){let e;return{token:new E6(function(i){e=i}),cancel:e}}}function aQ(t){return function(r){return t.apply(null,r)}}function lQ(t){return re.isObject(t)&&t.isAxiosError===!0}const Zk={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,Parti
7alContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Zk).forEach(([t,e])=>{Zk[e]=t});function GB(t){const e=new Fh(t),r=SB(Fh.prototype.request,e);return re.extend(r,Fh.prototype,e,{allOwnKeys:!0}),re.extend(r,e,null,{allOwnKeys:!0}),r.create=function(i){return GB(Zh(t,i))},r}const Gr=GB(f1);Gr.Axios=Fh;Gr.CanceledError=jf;Gr.CancelToken=E6;Gr.isCancel=$B;Gr.VERSION=UB;Gr.toFormData=Av;Gr.AxiosError=St;Gr.Cancel=Gr.CanceledError;Gr.all=function(e){return Promise.all(e)};Gr.spread=aQ;Gr.isAxiosError=lQ;Gr.mergeConfig=Zh;Gr.AxiosHeaders=Di;Gr.formToJSON=t=>FB(re.isHTMLForm(t)?new FormData(t):t);Gr.getAdapter=jB.getAdapter;Gr.HttpStatusCode=Zk;Gr.default=Gr;window.axios=Gr;window.axios.defaults.headers.common["X-Requested-With"]="XMLHttpRequest";const KB=new Map;let L0=!1;function cQ(t,e=200){let r=null;return function(...n){clearTimeout(r),r=setTimeout(()=>t.apply(this,n),e)}}function j_(){document.querySelectorAll(".mathjax-block, .mathjax-inline").forEach(function(t){t.id&&KB.set(t.id,{latex:t.getAttribute("data-latex"),processed:t.getAttribute("data-processed")==="true",html:t.innerHTML,isBlock:t.classList.contains("mathjax-block")})})}function Qk(){if(L0)return;const t=document.querySelectorAll(".mathjax-block, .mathjax-inline");if(Array.from(t).filter(n=>!(n.getAttribute("data-processed")==="true"||n.querySelector(".MathJax, mjx-container"))).length===0)return;L0=!0,j_();const r=document.documentElement.classList.contains("dark");if(document.querySelectorAll(".mathjax-block, .mathjax-inline").forEach(function(n){if(n.getAttribute("data-processed")==="true")return;if(n.id){const s=KB.get(n.id);if(s&&s.processed){n.innerHTML=s.html,n.setAttribute("data-processed","true");return}}const i=n.getAttribute("data-latex");if(i)try{let s=i;const o=document.createElement("div");o.innerHTML=s,s=o.textContent||o.innerText||"",s=s.replace(/\s+/g," ").trim(),s=s.replace(/€/g,"\\text{€}"),s=s.replace(/\$/g,"\\text{\\$}"),s=s.replace(/£/g,"\\text{£}"),s=s.replace(/¥/g,"\\text{¥}"),n.classList.contains("mathjax-block")?n.innerHTML="$$"+s+"$$":n.innerHTML="$"+s+"$",n.setAttribute("data-processed","true"),r&&n.setAttribute("data-dark-mode","true")}catch(s){console.error("Error processing LaTeX formula:",s),n.innerHTML='<span style="color: red;">Error: '+s.message+"</span>"}}),window.MathJax&&typeof window.MathJax.typeset=="function")try{window.MathJax.typeset(),setTimeout(function(){j_(),r&&document.querySelectorAll(".MathJax, .mjx-math, .mjx-mrow, .mjx-char").forEach(function(n){n.style.color="rgba(255, 255, 255, 0.9)"}),L0=!1},500)}catch(n){console.error("MathJax typeset error:",n),L0=!1}else L0=!1}function hQ(){if(window.MathJax)setTimeout(Qk,100);else{window.MathJax={tex:{inlineMath:[["$","$"],["\\(","\\)"]],displayMath:[["$$","$$"],["\\[","\\]"]],processEscapes:!0,processEnvironments:!0,packages:{"[+]":["ams","noerrors","physics"]}},options:{skipHtmlTags:["script","noscript","style","textarea","pre","code"],ignoreHtmlClass:"tex2jax_ignore",processHtmlClass:"tex2jax_process"},startup:{ready:function(){MathJax.startup.defaultReady(),setTimeout(Qk,100)}},chtml:{scale:1,minScale:.5,mtextInheritFont:!1,merrorInheritFont:!0,adaptiveCSS:!0},menuSettings:{zoom:"None",CTRL:!1,ALT:!1,CMD:!1,Shift:!1},MathMenu:{delay:0,showRenderer:!1,showLocale:!1,showMathPlayer:!1,showFontMenu:!1,settings:{zoom:"None",CTRL:!1,ALT:!1,CMD:!1,Shift:!1},enabled:!1}};const t=document.createElement("script");t.src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js",t.async=!0,t.id="MathJax-script",t.onload=function(){window.MathJax&&window.MathJax.startup&&window.MathJax.startup.promise.then(function(){window.MathJax.Menu&&(window.MathJax.Menu.menu.disabled=!0),document.addEventListener("contextmenu",function(e){if(e.target.closest(".MathJax")||e.target.closest(".latex-formula"))return e.preventDefault(),!1},!0)})},document.head.appendChild(t)}}const YB=cQ(Qk,300);document.addEventListener("DOMContentLoaded",hQ);document.addEventListener("livewire:navigated",YB);document.addEventListener("livewire:init",()=>{Livewire.hook("morph.updated",({el:t})=>{(t.matches&&t.matches(".mathjax-block:not([data-processed]), .mathjax-inline:not([data-processed])")||t.querySelector&&t.querySelector(".mathjax-block:not([data-processed]), .mathjax-inline:not([data-processed])"))&&YB()})});window.sideMenuComponent=function(){return{openMenu:window.innerWidth>=1024,isCollapsed:!0,isHovering:!1,mouseInside:!1,hoverTimeout:null,rightMenuWidth:33,isDashboard:window.location.pathname==="/",isRelationPage:window.location.pathname.includes("/relations/"),hasProcessingRelations:!1,hasUnreadCompletedRelations:!1,get showExpanded(){return!this.isCollapsed||this.isHovering},init(){this.$el.dataset.hasProcessingRelations&&(this.hasProcessingRelations=this.$el.dataset.hasProcessingRelations==="true"),this.$el.dataset.hasUnreadCompletedRelations&&(this.hasUnreadCompletedRelations=this.$el.dataset.hasUnreadCompletedRelations==="true");const t=localStorage.getItem("rightMenuWidth");t&&(this.rightMenuWidth=parseFloat(t));const e=localStorage.getItem("leftMenuCollapsed");e!==null&&(this.isCollapsed=e==="true"),this.isDashboard&&(this.isCollapsed=!1),window.innerWidth<1024&&(this.openMenu=!1),window.addEventListener("rightMenuResize",r=>{r.detail&&r.detail.width&&(this.rightMenuWidth=r.detail.width,window.innerWidth>=1024&&(this.openMenu=!0))}),this.$nextTick(()=>{window.dispatchEvent(new CustomEvent("leftMenuToggle",{detail:{isOpen:this.openMenu,isCollapsed:this.isCollapsed}})),window.dispatchEvent(new CustomEvent("leftMenuCollapse",{detail:{isCollapsed:this.isCollapsed}}))}),this.$watch("openMenu",r=>{window.dispatchEvent(new CustomEvent("leftMenuToggle",{detail:{isOpen:r,isCollapsed:this.isCollapsed}}))}),this.$watch("isCollapsed",r=>{window.dispatchEvent(new CustomEvent("leftMenuCollapse",{detail:{isCollapsed:r}})),window.dispatchEvent(new CustomEvent("leftMenuToggle",{detail:{isOpen:this.openMenu,isCollapsed:r}}))}),window.addEventListener("popstate",()=>{this.isDashboard=window.location.pathname==="/",this.isRelationPage=window.location.pathname.includes("/relations/"),this.isDashboard&&(this.isCollapsed=!1),window.innerWidth<1024&&(this.openMenu=!1),this.isHovering=!1}),document.addEventListener("livewire:navigated",()=>{this.$nextTick(()=>{this.isDashboard=window.location.pathname==="/",this.isRelationPage=window.location.pathname.includes("/relations/"),this.isDashboard&&(this.isCollapsed=!1),window.innerWidth<1024&&(this.openMenu=!1),this.isHovering=!1})}),window.addEventListener("leftMenuCommand",r=>{r.detail&&(typeof r.detail.isOpen<"u"&&(this.openMenu=r.detail.isOpen),typeof r.detail.isCollapsed<"u"&&(this.isCollapsed=r.detail.isCollapsed))})},handleMouseEnter(){!this.isCollapsed||window.innerWidth<1024||(clearTimeout(this.hoverTimeout),this.mouseInside=!0,this.isHovering=!0)},handleMouseLeave(){this.mouseInside=!1,this.isCollapsed&&(this.hoverTimeout=setTimeout(()=>{this.isHovering=!1},300))},toggleCollapse(){this.isCollapsed=!this.isCollapsed,this.isCollapsed&&this.mouseInside?this.isHovering=!0:this.isHovering=!1,localStorage.setItem("leftMenuCollapsed",this.isCollapsed.toString()),window.dispatchEvent(new CustomEvent("leftMenuCollapse",{detail:{isCollapsed:this.isCollapsed}}))},markAllAsSeenAndNavigate(t){t.preventDefault(),this.hasUnreadCompletedRelations&&(this.$wire.markAllRelationsAsSeen(),this.hasUnreadCompletedRelations=!1),window.location.href="/"}}};window.setExampleQuestion=function(t){const e=document.getElementById("prompt");if(e){e.value=t;const r=new Event("input",{bubbles:!0});e.dispatchEvent(r),e.focus()}};window.rightMenuComponent=function(){return{menuWidth:33,isResizing:!1,startX:0,startWidth:0,minWidth:20,maxWidth:50,init(){const t=localStorage.getItem("rightMenuWidth");t&&(this.menuWidth=parseFloat(t)),window.innerWidth<1024?(this.$wire.showRightMenu=!1,setTimeout(()=>{window.innerWidth<1024&&this.$wire.showRightMenu&&(this.$wire.showRightMenu=!1)},100)):this.$wire.showRightMenu=!0,window.addEventListener("resize",()=>{window.innerWidth<1024&&(this.$wire.showRightMenu=!1)}),this.$wire.$watch("showRightMenu",e=>{window.dispatchEvent(new CustomEvent("rightMenuChanged",{detail:{showRightMenu:this.$wire.showRightMenu}}))})},startResize(t){this.isResizing=!0,this.startX=t.clientX,this.startWidth=this.menuWidth,document.body.style.userSelect="none",document.body.style.cursor="ew-resize",document.addEventListener("mousemove",this.handleMouseMove.bind(this)),document.addEventListener("mouseup",this.stopResize.bind(this))},handleMouseMove(t){if(!this.isResizing)return;const e=window.innerWidth,n=(this.startX-t.clientX)/e*100,i=this.startWidth+n;this.menuWidth=Math.max(this.minWidth,Math.min(this.maxWidth,i)),window.dispatchEvent(new CustomEvent("rightMenuResize",{detail:{width:this.menuWidth}}))},stopResize(){this.isResizing&&(this.isResizing=!1,document.body.style.userSelect="",document.body.style.cursor="",localStorage.setItem("rightMenuWidth",this.menuWidth.toString()),document.removeEventListener("mousemove",this.handleMouseMove.bind(this)),document.removeEventListener("mouseup",this.stopResize.bind(this)))}}};window.navigationChatTabs=function(){return{activePanel:"navigation",init(){this.$wire&&this.$wire.chatHistory&&this.$wire.chatHistory.length>0&&(this.activePanel="chat")},togglePanel(t){this.activePanel===t?this.activePanel=t==="navigation"?"chat":"navigation":this.activePanel=t}}};window.chatComponent=function(t=!1,e=!0){return{messages:[],newMessage:"",isTyping:!1,isGenerating:t,showFicheIntegrationButton:e,updateTimer:null,ficheUpdated:!1,modifiedMessages:new Set,init(){Array.isArray(this.messages)||(this.messages=[]),this.loadMessagesFromLivewire(),this.isGenerating=!!(this.$wire.isProcessing||this.$wire.isShowingStreaming),this.ficheUpdated=!!this.$wire.ficheUpdatedFromChat,this.$watch("$wire.chatHistory",n=>{n&&Array.isArray(n)&&(this.messages=n.map(i=>({role:i.role||"user",content:String(i.content||""),content_html:i.content_html||null,timestamp:i.timestamp||new Date().toISOString(),applied_to_fiche:!!i.applied_to_fiche})),this.isTyping=!1,this.scrollToBottom(),this.$nextTick(()=>this.updateToggleButtonLabels&&this.updateToggleButtonLabels()))}),this.$watch("$wire.ficheUpdatedFromChat",n=>{this.ficheUpdated=!!n,this.updateToggleButtonLabels&&this.updateToggleButtonLabels()});const r=()=>{this.updateTimer&&clearTimeout(this.updateTimer),this.updateTimer=setTimeout(()=>{const n=this.$wire.isProcessing||this.$wire.isShowingStreaming;this.isGenerating!==n&&(this.isGenerating=n)},50)};this.$watch("$wire.isProcessing",r),this.$watch("$wire.isShowingStreaming",r),Livewire.on("chat-history-cleared",()=>{this.messages=[],this.isTyping=!1,this.ficheUpdated=!1,this.removeAllUpdateBadges&&this.removeAllUpdateBadges()}),this.$nextTick(()=>{const n=this.$refs.messagesContainer;n&&(n.__chatDelegationBound||(n.__chatDelegationBound=!0,n.addEventListener("click",i=>{const s=i.target.closest('[data-action="update-fiche"], [wire\\:click="updateFicheFromChat"]');
7if(s){i.preventDefault();const a=s.matches('[data-action="update-fiche"]')?s:s.closest('[data-action="update-fiche"]'),l=a?a.querySelector('[data-role="toggle-update-label"]'):null,c=a?parseInt(a.getAttribute("data-message-index")||"-1",10):-1,h=d=>{if(!a)return;a.disabled=!0,a.classList.add("opacity-75","cursor-not-allowed");const f=a.querySelector("svg");f&&(f.dataset.prevDisplay=f.style.display||"",f.style.display="none");let p=a.querySelector('[data-role="loading-spinner"]');p||(p=document.createElement("div"),p.setAttribute("data-role","loading-spinner"),p.className="animate-spin w-4 h-4 mr-2 border-2 border-gray-400 border-t-transparent rounded-full",a.insertBefore(p,a.firstChild)),l&&d&&(l.textContent=d)},u=()=>{if(!a)return;a.disabled=!1,a.classList.remove("opacity-75","cursor-not-allowed");const d=a.querySelector('[data-role="loading-spinner"]');d&&d.remove();const f=a.querySelector("svg");f&&(f.style.display=f.dataset.prevDisplay||"",delete f.dataset.prevDisplay)};this.modifiedMessages.has(c)?(h("Annulation..."),c>=0?this.$wire.undoMessageModifications(c).then(()=>{this.modifiedMessages.delete(c),this.updateToggleButtonLabels&&this.updateToggleButtonLabels(),this.addCancelledBadge&&this.addCancelledBadge(c)}).finally(()=>u()):this.$wire.undoChatModifications().then(()=>{this.updateToggleButtonLabels&&this.updateToggleButtonLabels(),this.removeAllUpdateBadges&&this.removeAllUpdateBadges()}).finally(()=>u())):this.isGenerating||(h("Mise à jour..."),c>=0?this.$wire.updateFicheFromChatForMessage(c).then(()=>{this.modifiedMessages.add(c),this.addUpdatedBadge&&this.addUpdatedBadge(c),this.updateToggleButtonLabels&&this.updateToggleButtonLabels()}).finally(()=>u()):this.$wire.updateFicheFromChat().then(()=>{this.updateToggleButtonLabels&&this.updateToggleButtonLabels()}).finally(()=>u()));return}if(i.target.closest('[data-action="undo-chat-modifications"], [wire\\:click="undoChatModifications"]')){i.preventDefault(),this.$wire.undoChatModifications();return}})))})},loadMessagesFromLivewire(){const r=this.$wire.chatHistory;r&&Array.isArray(r)&&(this.messages=r.map(n=>({role:n.role||"user",content:String(n.content||""),content_html:n.content_html||null,timestamp:n.timestamp||new Date().toISOString(),applied_to_fiche:!!n.applied_to_fiche})),this.$nextTick(()=>this.updateToggleButtonLabels&&this.updateToggleButtonLabels()))},sendMessage(){if(!this.newMessage||!this.newMessage.trim()||this.isTyping||this.isGenerating)return;const r=this.newMessage.trim();this.newMessage="",this.isTyping=!0,this.messages.push({role:"user",content:r,timestamp:new Date().toISOString()}),this.scrollToBottom(),this.$wire.sendChatMessage(r).then(()=>{this.isTyping=!1}).catch(n=>{this.isTyping=!1,console.error("Erreur envoi message:",n)})},scrollToBottom(){this.$nextTick(()=>{const r=this.$refs.messagesContainer;r&&(r.scrollTop=r.scrollHeight)})},formatMessage(r,n,i,s){(!r||typeof r>"u")&&(r=""),(!n||typeof n>"u")&&(n="user"),(!i||typeof i>"u")&&(i={});const o=typeof s=="number"&&!isNaN(s)?s:Array.isArray(this.messages)?this.messages.indexOf(i):-1;if(n==="user")return this.escapeHtml(r)||"";{let a="";if(console.log("🔍 DEBUG formatMessage:",{hasMessage:!!i,hasContentHtml:!!(i&&i.content_html),contentHtmlLength:i&&i.content_html?i.content_html.length:0,contentHtmlPreview:i&&i.content_html?i.content_html.substring(0,100):"N/A",contentLength:r?r.length:0,role:n}),i&&i.content_html?(console.log("✅ Utilisation de content_html"),a=i.content_html||""):(console.log("❌ Fallback vers markdownToHtml"),a=this.markdownToHtml(r)||""),n==="assistant"&&this.showFicheIntegrationButton){const c=!!(i&&i.applied_to_fiche)||this.modifiedMessages.has(o),u=`
8                    <div class="mt-4 pt-3 border-t border-gray-200 not-prose">
9                        <button
10                            data-action="update-fiche"
11                            data-role="toggle-update-btn"
12                            data-message-index="${o}"
13                            class="inline-flex items-center gap-2 px-4 py-1.5 rounded-full bg-white text-gray-700 border border-gray-300 shadow-sm hover:bg-gray-50 hover:shadow-md active:bg-gray-100 transition-all duration-200"
14                        >
15                            ${c?'<svg class="w-3.5 h-3.5 mr-2 text-gray-600" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M11 15l-3-3m0 0l3-3m-3 3h8M3 12a9 9 0 1118 0 9 9 0 01-18 0z" /></svg>':'<svg class="w-3.5 h-3.5 mr-2 text-gray-600" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" /></svg>'}
16                            <span data-role="toggle-update-label">${c?"Annuler les modifications":"Intégrer ces informations à la fiche"}</span>
17                        </button>
18                    </div>
19                    `;a+=u}return a}},updateToggleButtonLabels(){const r=this.$refs.messagesContainer;if(!r)return;const n=r.querySelectorAll('[data-action="update-fiche"]');n.forEach(i=>{const s=parseInt(i.getAttribute("data-message-index")||"-1",10),o=s>=0&&this.messages[s]?this.messages[s]:null,a=!!(o&&o.applied_to_fiche),l=i.querySelector('[data-role="toggle-update-label"]');l&&(l.textContent=a||this.modifiedMessages.has(s)?"Annuler les modifications":"Intégrer ces informations à la fiche")}),n.forEach(i=>{const s=parseInt(i.getAttribute("data-message-index")||"-1",10),o=i.querySelector("svg");if(!o)return;const a=s>=0&&this.messages[s]?this.messages[s]:null;!!(a&&a.applied_to_fiche)||this.modifiedMessages.has(s)?o.outerHTML='<svg class="w-3.5 h-3.5 mr-2 text-gray-600" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M11 15l-3-3m0 0l3-3m-3 3h8M3 12a9 9 0 1118 0 9 9 0 01-18 0z" /></svg>':o.outerHTML='<svg class="w-3.5 h-3.5 mr-2 text-gray-600" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" /></svg>'})},addUpdatedBadge(r){},addCancelledBadge(r){const n=this.$refs.messagesContainer;if(!n)return;let i=n.querySelector(`[data-action="update-fiche"][data-message-index="${r}"]`),s=i?i.closest(".chat-content"):null;if(!s){const a=n.querySelectorAll(".chat-content");s=a&&a[r]?a[r]:null}if(!s)return;let o=s.querySelector(".chat-updated-badge-holder");o||(o=document.createElement("div"),o.className="chat-updated-badge-holder flex justify-end mt-2",s.appendChild(o)),o.innerHTML='<span class="text-xs text-orange-600 italic opacity-75">Modifications annulées</span>'},removeAllUpdateBadges(){const r=this.$refs.messagesContainer;r&&r.querySelectorAll(".chat-updated-badge-holder").forEach(n=>n.remove())},escapeHtml(r){if(!r||typeof r>"u")return"";const n={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};return String(r).replace(/[&<>"']/g,i=>n[i])},markdownToHtml(r){if(!r||typeof r>"u")return"";const i=this.escapeHtml(r).split(`
20`);let s=[],o=!1,a=!1,l=[],c=0;for(;c<i.length;){const h=i[c],u=h.match(/^(#{1,6})\s+(.*)$/);if(u){o?(s.push("<ol>"+l.join("")+"</ol>"),o=!1,l=[]):a&&(s.push("<ul>"+l.join("")+"</ul>"),a=!1,l=[]);const p=u[1].length,m=this.processInlineMarkdown(u[2]);s.push(`<h${p}>${m}</h${p}>`),c++;continue}const d=h.match(/^(\d+)\.\s+(.*)$/),f=h.match(/^\s*[-*+]\s+(.*)$/);if(d){const p=parseInt(d[1]);(!o||p===1)&&(a&&(s.push("<ul>"+l.join("")+"</ul>"),a=!1,l=[]),o&&p===1&&(s.push("<ol>"+l.join("")+"</ol>"),l=[]),o=!0);let m=d[2];m=this.processInlineMarkdown(m);let g=[],y=c+1;for(;y<i.length;){const x=i[y];if(x.trim()===""){y++;continue}if(x.match(/^\d+\.\s+/))break;if(x.match(/^\s+/)||x.match(/^\s*[-*+]\s+/)){const S=x.match(/^\s*[-*+]\s+(.*)$/);S?g.push("<li>"+this.processInlineMarkdown(S[1])+"</li>"):g.push(this.processInlineMarkdown(x.trim())),y++}else break}let b=m;if(g.length>0){const x=g.filter(k=>k.startsWith("<li>")),S=g.filter(k=>!k.startsWith("<li>"));S.length>0&&(b+="<br>"+S.join("<br>")),x.length>0&&(b+="<ul>"+x.join("")+"</ul>")}l.push("<li>"+b+"</li>"),c=y-1}else if(f&&!o){if(o){c++;continue}a||(a=!0,l=[]);let p=f[1];p=this.processInlineMarkdown(p),l.push("<li>"+p+"</li>")}else o?(s.push("<ol>"+l.join("")+"</ol>"),o=!1,l=[]):a&&(s.push("<ul>"+l.join("")+"</ul>"),a=!1,l=[]),h.trim()&&s.push("<p>"+this.processInlineMarkdown(h)+"</p>");c++}return o?s.push("<ol>"+l.join("")+"</ol>"):a&&s.push("<ul>"+l.join("")+"</ul>"),s.join("")},processInlineMarkdown(r){return r=r.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>"),r=r.replace(/(?:^|\s)\*([^\*]+)\*(?:\s|$)/g," <em>$1</em> "),r=r.replace(/`(.+?)`/g,"<code>$1</code>"),r=r.replace(/\[([^\]]+)\]\(([^\)]+)\)/g,""),r=r.replace(/\[ref\.\s*:\s*[^\]]*\]/g,""),r}}};window.ficheUpdateButton=function(){return{isUpdating:!1,isUpdated:!1,init(){this.$watch("$wire.ficheUpdatedFromChat",t=>{this.isUpdated=!!t}),this.isUpdated=!!this.$wire.ficheUpdatedFromChat},updateFiche(){this.isUpdating||this.isUpdated||(this.isUpdating=!0,this.$wire.updateFicheFromChat().then(()=>{this.isUpdating=!1,this.isUpdated=!0}).catch(t=>{this.isUpdating=!1,console.error("Erreur mise à jour fiche:",t)}))},getButtonHTML(){if(this.isUpdated)return"";const t=this.isUpdating?"disabled":"",e=this.isUpdating?"opacity-75 curs
20or-not-allowed":"hover:from-[#23407a] hover:to-[#1c295b] hover:shadow-lg transform hover:scale-105",r=this.isUpdating?'<div class="animate-spin w-4 h-4 mr-2 border-2 border-white border-t-transparent rounded-full"></div>':'<svg class="w-4 h-4 mr-2" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" /></svg>',n=this.isUpdating?"Mise à jour":"Mettre à jour la fiche";return`
21                <div class="mt-4 pt-3 border-t border-gray-300">
22                    <button 
23                        onclick="ficheUpdateButton().updateFiche()"
24                        ${t}
25                        class="inline-flex items-center px-4 py-2.5 bg-gradient-to-r from-[#1f3463] to-[#162249] text-white text-sm font-semibold rounded-lg transition-all duration-200 shadow-md ${e}"
26                        style="border: 2px solid #1f3463;"
27                    >
28                        ${r}
29                        ${n}
30                    </button>
31                    <p class="text-xs text-gray-600 mt-2 font-medium">Cette conversation contient des informations importantes pour votre fiche</p>
32                </div>
33            `}}};var XB=typeof global=="object"&&global&&global.Object===Object&&global,uQ=typeof self=="object"&&self&&self.Object===Object&&self,po=XB||uQ||Function("return this")(),Hb=po.Symbol,JB=Object.prototype,dQ=JB.hasOwnProperty,fQ=JB.toString,D0=Hb?Hb.toStringTag:void 0;function pQ(t){var e=dQ.call(t,D0),r=t[D0];try{t[D0]=void 0;var n=!0}catch{}var i=fQ.call(t);return n&&(e?t[D0]=r:delete t[D0]),i}var mQ=Object.prototype,gQ=mQ.toString;function yQ(t){return gQ.call(t)}var bQ="[object Null]",xQ="[object Undefined]",U_=Hb?Hb.toStringTag:void 0;function Cu(t){return t==null?t===void 0?xQ:bQ:U_&&U_ in Object(t)?pQ(t):yQ(t)}function Uf(t){return t!=null&&typeof t=="object"}var vQ="[object Symbol]";function wQ(t){return typeof t=="symbol"||Uf(t)&&Cu(t)==vQ}var qb=Array.isArray,kQ=/\s/;function CQ(t){for(var e=t.length;e--&&kQ.test(t.charAt(e)););return e}var SQ=/^\s+/;function TQ(t){return t&&t.slice(0,CQ(t)+1).replace(SQ,"")}function as(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var G_=NaN,_Q=/^[-+]0x[0-9a-f]+$/i,MQ=/^0b[01]+$/i,AQ=/^0o[0-7]+$/i,EQ=parseInt;function K_(t){if(typeof t=="number")return t;if(wQ(t))return G_;if(as(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=as(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=TQ(t);var r=MQ.test(t);return r||AQ.test(t)?EQ(t.slice(2),r?2:8):_Q.test(t)?G_:+t}function ZB(t){return t}var OQ="[object AsyncFunction]",LQ="[object Function]",DQ="[object GeneratorFunction]",IQ="[object Proxy]";function O6(t){if(!as(t))return!1;var e=Cu(t);return e==LQ||e==DQ||e==OQ||e==IQ}var B4=po["__core-js_shared__"],Y_=function(){var t=/[^.]+$/.exec(B4&&B4.keys&&B4.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function BQ(t){return!!Y_&&Y_ in t}var RQ=Function.prototype,PQ=RQ.toString;function Su(t){if(t!=null){try{return PQ.call(t)}catch{}try{return t+""}catch{}}return""}var NQ=/[\\^$.*+?()[\]{}|]/g,FQ=/^\[object .+?Constructor\]$/,$Q=Function.prototype,zQ=Object.prototype,HQ=$Q.toString,qQ=zQ.hasOwnProperty,VQ=RegExp("^"+HQ.call(qQ).replace(NQ,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function WQ(t){if(!as(t)||BQ(t))return!1;var e=O6(t)?VQ:FQ;return e.test(Su(t))}function jQ(t,e){return t==null?void 0:t[e]}function Tu(t,e){var r=jQ(t,e);return WQ(r)?r:void 0}var e3=Tu(po,"WeakMap"),X_=Object.create,UQ=function(){function t(){}return function(e){if(!as(e))return{};if(X_)return X_(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();function QB(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function GQ(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var KQ=800,YQ=16,XQ=Date.now;function JQ(t){var e=0,r=0;return function(){var n=XQ(),i=YQ-(n-r);if(r=n,i>0){if(++e>=KQ)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function ZQ(t){return function(){return t}}var Vb=function(){try{var t=Tu(Object,"defineProperty");return t({},"",{}),t}catch{}}(),QQ=Vb?function(t,e){return Vb(t,"toString",{configurable:!0,enumerable:!1,value:ZQ(e),writable:!0})}:ZB,eee=JQ(QQ),tee=9007199254740991,ree=/^(?:0|[1-9]\d*)$/;function eR(t,e){var r=typeof t;return e=e??tee,!!e&&(r=="number"||r!="symbol"&&ree.test(t))&&t>-1&&t%1==0&&t<e}function L6(t,e,r){e=="__proto__"&&Vb?Vb(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function Ov(t,e){return t===e||t!==t&&e!==e}var nee=Object.prototype,iee=nee.hasOwnProperty;function see(t,e,r){var n=t[e];(!(iee.call(t,e)&&Ov(n,r))||r===void 0&&!(e in t))&&L6(t,e,r)}function oee(t,e,r,n){var i=!r;r||(r={});for(var s=-1,o=e.length;++s<o;){var a=e[s],l=void 0;l===void 0&&(l=t[a]),i?L6(r,a,l):see(r,a,l)}return r}var J_=Math.max;function aee(t,e,r){return e=J_(e===void 0?t.length-1:e,0),function(){for(var n=arguments,i=-1,s=J_(n.length-e,0),o=Array(s);++i<s;)o[i]=n[e+i];i=-1;for(var a=Array(e+1);++i<e;)a[i]=n[i];return a[e]=r(o),QB(t,this,a)}}function tR(t,e){return eee(aee(t,e,ZB),t+"")}var lee=9007199254740991;function rR(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=lee}function Lv(t){return t!=null&&rR(t.length)&&!O6(t)}function cee(t,e,r){if(!as(r))return!1;var n=typeof e;return(n=="number"?Lv(r)&&eR(e,r.length):n=="string"&&e in r)?Ov(r[e],t):!1}function nR(t){return tR(function(e,r){var n=-1,i=r.length,s=i>1?r[i-1]:void 0,o=i>2?r[2]:void 0;for(s=t.length>
vendor: 4,180 bytes, line 33
333&&typeof s=="function"?(i--,s):void 0,o&&cee(r[0],r[1],o)&&(s=i<3?void 0:s,i=1),e=Object(e);++n<i;){var a=r[n];a&&t(e,a,n,s)}return e})}var hee=Object.prototype;function Dv(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||hee;return t===r}function uee(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var dee="[object Arguments]";function Z_(t){return Uf(t)&&Cu(t)==dee}var iR=Object.prototype,fee=iR.hasOwnProperty,pee=iR.propertyIsEnumerable,Wb=Z_(function(){return arguments}())?Z_:function(t){return Uf(t)&&fee.call(t,"callee")&&!pee.call(t,"callee")};function mee(){return!1}var sR=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Q_=sR&&typeof module=="object"&&module&&!module.nodeType&&module,gee=Q_&&Q_.exports===sR,eM=gee?po.Buffer:void 0,yee=eM?eM.isBuffer:void 0,D6=yee||mee,bee="[object Arguments]",xee="[object Array]",vee="[object Boolean]",wee="[object Date]",kee="[object Error]",Cee="[object Function]",See="[object Map]",Tee="[object Number]",_ee="[object Object]",Mee="[object RegExp]",Aee="[object Set]",Eee="[object String]",Oee="[object WeakMap]",Lee="[object ArrayBuffer]",Dee="[object DataView]",Iee="[object Float32Array]",Bee="[object Float64Array]",Ree="[object Int8Array]",Pee="[object Int16Array]",Nee="[object Int32Array]",Fee="[object Uint8Array]",$ee="[object Uint8ClampedArray]",zee="[object Uint16Array]",Hee="[object Uint32Array]",yr={};yr[Iee]=yr[Bee]=yr[Ree]=yr[Pee]=yr[Nee]=yr[Fee]=yr[$ee]=yr[zee]=yr[Hee]=!0;yr[bee]=yr[xee]=yr[Lee]=yr[vee]=yr[Dee]=yr[wee]=yr[kee]=yr[Cee]=yr[See]=yr[Tee]=yr[_ee]=yr[Mee]=yr[Aee]=yr[Eee]=yr[Oee]=!1;function qee(t){return Uf(t)&&rR(t.length)&&!!yr[Cu(t)]}function Vee(t){return function(e){return t(e)}}var oR=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Jp=oR&&typeof module=="object"&&module&&!module.nodeType&&module,Wee=Jp&&Jp.exports===oR,R4=Wee&&XB.process,tM=function(){try{var t=Jp&&Jp.require&&Jp.require("util").types;return t||R4&&R4.binding&&R4.binding("util")}catch{}}(),rM=tM&&tM.isTypedArray,I6=rM?Vee(rM):qee,jee=Object.prototype,Uee=jee.hasOwnProperty;function Gee(t,e){var r=qb(t),n=!r&&Wb(t),i=!r&&!n&&D6(t),s=!r&&!n&&!i&&I6(t),o=r||n||i||s,a=o?uee(t.length,String):[],l=a.length;for(var c in t)(e||Uee.call(t,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||eR(c,l)))&&a.push(c);return a}function aR(t,e){return function(r){return t(e(r))}}var Kee=aR(Object.keys,Object),Yee=Object.prototype,Xee=Yee.hasOwnProperty;function Jee(t){if(!Dv(t))return Kee(t);var e=[];for(var r in Object(t))Xee.call(t,r)&&r!="constructor"&&e.push(r);return e}function Zee(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var Qee=Object.prototype,ete=Qee.hasOwnProperty;function tte(t){if(!as(t))return Zee(t);var e=Dv(t),r=[];for(var n in t)n=="constructor"&&(e||!ete.call(t,n))||r.push(n);return r}function lR(t){return Lv(t)?Gee(t,!0):tte(t)}var zm=Tu(Object,"create");function rte(){this.__data__=zm?zm(null):{},this.size=0}function nte(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var ite="__lodash_hash_undefined__",ste=Object.prototype,ote=ste.hasOwnProperty;function ate(t){var e=this.__data__;if(zm){var r=e[t];return r===ite?void 0:r}return ote.call(e,t)?e[t]:void 0}var lte=Object.prototype,cte=lte.hasOwnProperty;function hte(t){var e=this.__data__;return zm?e[t]!==void 0:cte.call(e,t)}var ute="__lodash_hash_undefined__";function dte(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=zm&&e===void 0?ute:e,this}function Qh(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Qh.prototype.clear=rte;Qh.prototype.delete=nte;Qh.prototype.get=ate;Qh.prototype.has=hte;Qh.prototype.set=dte;function fte(){this.__data__=[],this.size=0}function Iv(t,e){for(var r=t.length;r--;)if(Ov(t[r][0],e))return r;return-1}var pte=Array.prototype,mte=pte.splice;function gte(t){var e=this.__data__,r=Iv(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():mte.call(e,r,1),--this.size,!0}function yte(t){var e=this.__data__,r=Iv(e,t);return r<0?void 0:e[r][1]}function bte(t){return Iv(this.__data__,t)>-1}
vendor: 5,221 bytes, line 33
33function xte(t,e){var r=this.__data__,n=Iv(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function pl(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}pl.prototype.clear=fte;pl.prototype.delete=gte;pl.prototype.get=yte;pl.prototype.has=bte;pl.prototype.set=xte;var Hm=Tu(po,"Map");function vte(){this.size=0,this.__data__={hash:new Qh,map:new(Hm||pl),string:new Qh}}function wte(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Bv(t,e){var r=t.__data__;return wte(e)?r[typeof e=="string"?"string":"hash"]:r.map}function kte(t){var e=Bv(this,t).delete(t);return this.size-=e?1:0,e}function Cte(t){return Bv(this,t).get(t)}function Ste(t){return Bv(this,t).has(t)}function Tte(t,e){var r=Bv(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function Ac(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Ac.prototype.clear=vte;Ac.prototype.delete=kte;Ac.prototype.get=Cte;Ac.prototype.has=Ste;Ac.prototype.set=Tte;var _te="Expected a function";function p1(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(_te);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],s=r.cache;if(s.has(i))return s.get(i);var o=t.apply(this,n);return r.cache=s.set(i,o)||s,o};return r.cache=new(p1.Cache||Ac),r}p1.Cache=Ac;var cR=aR(Object.getPrototypeOf,Object),Mte="[object Object]",Ate=Function.prototype,Ete=Object.prototype,hR=Ate.toString,Ote=Ete.hasOwnProperty,Lte=hR.call(Object);function Dte(t){if(!Uf(t)||Cu(t)!=Mte)return!1;var e=cR(t);if(e===null)return!0;var r=Ote.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&hR.call(r)==Lte}function Ite(){this.__data__=new pl,this.size=0}function Bte(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function Rte(t){return this.__data__.get(t)}function Pte(t){return this.__data__.has(t)}var Nte=200;function Fte(t,e){var r=this.__data__;if(r instanceof pl){var n=r.__data__;if(!Hm||n.length<Nte-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Ac(n)}return r.set(t,e),this.size=r.size,this}function Gf(t){var e=this.__data__=new pl(t);this.size=e.size}Gf.prototype.clear=Ite;Gf.prototype.delete=Bte;Gf.prototype.get=Rte;Gf.prototype.has=Pte;Gf.prototype.set=Fte;var uR=typeof exports=="object"&&exports&&!exports.nodeType&&exports,nM=uR&&typeof module=="object"&&module&&!module.nodeType&&module,$te=nM&&nM.exports===uR,iM=$te?po.Buffer:void 0,sM=iM?iM.allocUnsafe:void 0;function zte(t,e){if(e)return t.slice();var r=t.length,n=sM?sM(r):new t.constructor(r);return t.copy(n),n}var t3=Tu(po,"DataView"),r3=Tu(po,"Promise"),n3=Tu(po,"Set"),oM="[object Map]",Hte="[object Object]",aM="[object Promise]",lM="[object Set]",cM="[object WeakMap]",hM="[object DataView]",qte=Su(t3),Vte=Su(Hm),Wte=Su(r3),jte=Su(n3),Ute=Su(e3),eh=Cu;(t3&&eh(new t3(new ArrayBuffer(1)))!=hM||Hm&&eh(new Hm)!=oM||r3&&eh(r3.resolve())!=aM||n3&&eh(new n3)!=lM||e3&&eh(new e3)!=cM)&&(eh=function(t){var e=Cu(t),r=e==Hte?t.constructor:void 0,n=r?Su(r):"";if(n)switch(n){case qte:return hM;case Vte:return oM;case Wte:return aM;case jte:return lM;case Ute:return cM}return e});var uM=po.Uint8Array;function Gte(t){var e=new t.constructor(t.byteLength);return new uM(e).set(new uM(t)),e}function Kte(t,e){var r=e?Gte(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function Yte(t){return typeof t.constructor=="function"&&!Dv(t)?UQ(cR(t)):{}}function Xte(t){return function(e,r,n){for(var i=-1,s=Object(e),o=n(e),a=o.length;a--;){var l=o[++i];if(r(s[l],l,s)===!1)break}return e}}var Jte=Xte(),P4=function(){return po.Date.now()},Zte="Expected a function",Qte=Math.max,ere=Math.min;function Rv(t,e,r){var n,i,s,o,a,l,c=0,h=!1,u=!1,d=!0;if(typeof t!="function")throw new TypeError(Zte);e=K_(e)||0,as(r)&&(h=!!r.leading,u="maxWait"in r,s=u?Qte(K_(r.maxWait)||0,e):s,d="trailing"in r?!!r.trailing:d);function f(w){var _=n,L=i;return n=i=void 0,c=w,o=t.apply(L,_),o}function p(w){return c=w,a=setTimeout(y,e),h?f(w):o}function m(w){var _=w-l,L=w-c,B=e-_;return u?ere(B,s-L):B}function g(w){var _=w-l,L=w-c;return l===void 0||_>=e||_<0||u&&L>=s}function y(){var w=P4();if(g(w))return b(w);a=setTimeout(y,m(w))}function b(w){return a=void 0,d&&n?f(w):(n=i=void 0,o)}function x(){a!==void 0&&clearTimeout(a),c=0,n=l=i=a=void 0}function S(){return a===void 0?o:b(P4())}function k(){var w=P4(),_=g(w);if(n=arguments,i=this,l=w,_){if(a===void 0)return p(l);if(u)return clearTimeout(a),a=setTimeout(y,e),f(l)}return a===void 0&&(a=setTimeout(y,e)),o}return k.cancel=x,k.flush=S,k}function i3(t,e,r){(r!==void 0&&!Ov(t[e],r)||r===void 0&&!(e in t))&&L6(t,e,r)}function tre(t){return Uf(t)&&Lv(t)}function s3(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function rre(t){return oee(t,lR(t))}function nre(t,e,r,n,i,s,o){var a=s3(t,r),l=s3(e,r),c=o.get(l);if(c){i3(t,r,c);return}var h=s?s(a,l,r+"",t,e,o):void 0,u=h===void 0;if(u){var d=qb(l),f=!d&&D6(l),p=!d&&!f&&I6(l);h=l,d||f||p?qb(a)?h=a:tre(a)?h=GQ(a):f?(u=!1,h=zte(l,!0)):p?(u=!1,h=Kte(l,!0)):h=[]:Dte(l)||Wb(l)?(h=a,Wb(a)?h=rre(a):(!as(a)||O6(a))&&(h=Yte
33(l))):u=!1}u&&(o.set(l,h),i(h,l,n,s,o),o.delete(l)),i3(t,r,h)}function Pv(t,e,r,n,i){t!==e&&Jte(e,function(s,o){if(i||(i=new Gf),as(s))nre(t,e,o,r,Pv,n,i);else{var a=n?n(s3(t,o),s,o+"",t,e,i):void 0;a===void 0&&(a=s),i3(t,o,a)}},lR)}function dR(t,e,r,n,i,s){return as(t)&&as(e)&&(s.set(e,t),Pv(t,e,void 0,dR,s),s.delete(e)),t}var ire=nR(function(t,e,r,n){Pv(t,e,r,n)}),sre=tR(function(t){return t.push(void 0,dR),QB(ire,void 0,t)}),ore="[object Map]",are="[object Set]",lre=Object.prototype,cre=lre.hasOwnProperty;function dM(t){if(t==null)return!0;if(Lv(t)&&(qb(t)||typeof t=="string"||typeof t.splice=="function"||D6(t)||I6(t)||Wb(t)))return!t.length;var e=eh(t);if(e==ore||e==are)return!t.size;if(Dv(t))return!Jee(t).length;for(var r in t)if(cre.call(t,r))return!1;return!0}var hre=nR(function(t,e,r){Pv(t,e,r)}),ure="Expected a function";function Nv(t,e,r){var n=!0,i=!0;if(typeof t!="function")throw new TypeError(ure);return as(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),Rv(t,e,{leading:n,maxWait:e,trailing:i})}const dre=1024;let fre=0,ws=class{constructor(e,r){this.from=e,this.to=r}};class Lt{constructor(e={}){this.id=fre++,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=ls.match(e)),r=>{let n=e(r);return n===void 0?null:[this,n]}}}Lt.closedBy=new Lt({deserialize:t=>t.split(" ")});Lt.openedBy=new Lt({deserialize:t=>t.split(" ")});Lt.group=new Lt({deserialize:t=>t.split(" ")});Lt.isolate=new Lt({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});Lt.contextHash=new Lt({perNode:!0});Lt.lookAhead=new Lt({perNode:!0});Lt.mounted=new Lt({perNode:!0});class qm{constructor(e,r,n){this.tree=e,this.overlay=r,this.parser=n}static get(e){return e&&e.props&&e.props[Lt.mounted.id]}}const pre=Object.create(null);let ls=class fR{constructor(e,r,n,i=0){this.name=e,this.props=r,this.id=n,this.flags=i}static define(e){let r=e.props&&e.props.length?Object.create(null):pre,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new fR(e.name||"",r,e.id,n);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(i)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");r[s[0].id]=s[1]}}return i}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 r=this.prop(Lt.group);return r?r.indexOf(e)>-1:!1}return this.id==e}static match(e){let r=Object.create(null);for(let n in e)for(let i of n.split(" "))r[i]=e[n];return n=>{for(let i=n.prop(Lt.group),s=-1;s<(i?i.length:0);s++){let o=r[s<0?n.name:i[s]];if(o)return o}}}};ls.none=new ls("",Object.create(null),0,8);class B6{constructor(e){this.types=e;for(let r=0;r<e.length;r++)if(e[r].id!=r)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let r=[];for(let n of this.types){let i=null;for(let s of e){let o=s(n);o&&(i||(i=Object.assign({},n.props)),i[o[0].id]=o[1])}r.push(i?new ls(n.name,i,n.id,n.flags):n)}return new B6(r)}}const cy=new WeakMap,fM=new WeakMap;var Or;(function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays"})(Or||(Or={}));class pr{constructor(e,r,n,i,s){if(this.type=e,this.children=r,this.positions=n,this.length=i,this.props=null,s&&s.length){this.props=Object.create(null);for(let[o,a]of s)this.props[typeof o=="number"?o:o.id]=a}}toString(){let e=qm.get(this);if(e&&!e.overlay)return e.tree.toString();let r="";for(let n of this.children){let i=n.toString();i&&(r&&(r+=","),r+=i)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(r.length?"("+r+")":""):r}cursor(e=0){return new jb(this.topNode,e)}
vendor: 74,026 bytes, lines 33-38
33cursorAt(e,r=0,n=0){let i=cy.get(this)||this.topNode,s=new jb(i);return s.moveTo(e,r),cy.set(this,s._tree),s}get topNode(){return new Fn(this,0,0,null)}resolve(e,r=0){let n=Vm(cy.get(this)||this.topNode,e,r,!1);return cy.set(this,n),n}resolveInner(e,r=0){let n=Vm(fM.get(this)||this.topNode,e,r,!0);return fM.set(this,n),n}resolveStack(e,r=0){return yre(this,e,r)}iterate(e){let{enter:r,leave:n,from:i=0,to:s=this.length}=e,o=e.mode||0,a=(o&Or.IncludeAnonymous)>0;for(let l=this.cursor(o|Or.IncludeAnonymous);;){let c=!1;if(l.from<=s&&l.to>=i&&(!a&&l.type.isAnonymous||r(l)!==!1)){if(l.firstChild())continue;c=!0}for(;c&&n&&(a||!l.type.isAnonymous)&&n(l),!l.nextSibling();){if(!l.parent())return;c=!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 r in this.props)e.push([+r,this.props[r]]);return e}balance(e={}){return this.children.length<=8?this:N6(ls.none,this.children,this.positions,0,this.children.length,0,this.length,(r,n,i)=>new pr(this.type,r,n,i,this.propValues),e.makeTree||((r,n,i)=>new pr(ls.none,r,n,i)))}static build(e){return bre(e)}}pr.empty=new pr(ls.none,[],[],0);class R6{constructor(e,r){this.buffer=e,this.index=r}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 R6(this.buffer,this.index)}}class uc{constructor(e,r,n){this.buffer=e,this.length=r,this.set=n}get type(){return ls.none}toString(){let e=[];for(let r=0;r<this.buffer.length;)e.push(this.childString(r)),r=this.buffer[r+3];return e.join(",")}childString(e){let r=this.buffer[e],n=this.buffer[e+3],i=this.set.types[r],s=i.name;if(/\W/.test(s)&&!i.isError&&(s=JSON.stringify(s)),e+=4,n==e)return s;let o=[];for(;e<n;)o.push(this.childString(e)),e=this.buffer[e+3];return s+"("+o.join(",")+")"}findChild(e,r,n,i,s){let{buffer:o}=this,a=-1;for(let l=e;l!=r&&!(pR(s,i,o[l+1],o[l+2])&&(a=l,n>0));l=o[l+3]);return a}slice(e,r,n){let i=this.buffer,s=new Uint16Array(r-e),o=0;for(let a=e,l=0;a<r;){s[l++]=i[a++],s[l++]=i[a++]-n;let c=s[l++]=i[a++]-n;s[l++]=i[a++]-e,o=Math.max(o,c)}return new uc(s,o,this.set)}}function pR(t,e,r,n){switch(t){case-2:return r<e;case-1:return n>=e&&r<e;case 0:return r<e&&n>e;case 1:return r<=e&&n>e;case 2:return n>e;case 4:return!0}}function Vm(t,e,r,n){for(var i;t.from==t.to||(r<1?t.from>=e:t.from>e)||(r>-1?t.to<=e:t.to<e);){let o=!n&&t instanceof Fn&&t.index<0?null:t.parent;if(!o)return t;t=o}let s=n?0:Or.IgnoreOverlays;if(n)for(let o=t,a=o.parent;a;o=a,a=o.parent)o instanceof Fn&&o.index<0&&((i=a.enter(e,r,s))===null||i===void 0?void 0:i.from)!=o.from&&(t=a);for(;;){let o=t.enter(e,r,s);if(!o)return t;t=o}}class mR{cursor(e=0){return new jb(this,e)}getChild(e,r=null,n=null){let i=pM(this,e,r,n);return i.length?i[0]:null}getChildren(e,r=null,n=null){return pM(this,e,r,n)}resolve(e,r=0){return Vm(this,e,r,!1)}resolveInner(e,r=0){return Vm(this,e,r,!0)}matchContext(e){return o3(this.parent,e)}enterUnfinishedNodesBefore(e){let r=this.childBefore(e),n=this;for(;r;){let i=r.lastChild;if(!i||i.to!=r.to)break;i.type.isError&&i.from==i.to?(n=r,r=i.prevSibling):r=i}return n}get node(){return this}get next(){return this.parent}}class Fn extends mR{constructor(e,r,n,i){super(),this._tree=e,this.from=r,this.index=n,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,r,n,i,s=0){for(let o=this;;){for(let{children:a,positions:l}=o._tree,c=r>0?a.length:-1;e!=c;e+=r){let h=a[e],u=l[e]+o.from;if(pR(i,n,u,u+h.length)){if(h instanceof uc){if(s&Or.ExcludeBuffers)continue;let d=h.findChild(0,h.buffer.length,r,n-u,i);if(d>-1)return new Ho(new mre(o,h,e,u),null,d)}else if(s&Or.IncludeAnonymous||!h.type.isAnonymous||P6(h)){let d;if(!(s&Or.IgnoreMounts)&&(d=qm.get(h))&&!d.overlay)return new Fn(d.tree,u,e,o);let f=new Fn(h,u,e,o);return s&Or.IncludeAnonymous||!f.type.isAnonymous?f:f.nextChild(r<0?h.children.length-1:0,r,n,i)}}}if(s&Or.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+r:e=r<0?-1:o._parent._tree.children.length,o=o._parent,!o))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,r,n=0){let i;if(!(n&Or.IgnoreOverlays)&&(i=qm.get(this._tree))&&i.overlay){let s=e-this.from;for(let{from:o,to:a}of i.overlay)if((r>0?o<=s:o<s)&&(r<0?a>=s:a>s))return new Fn(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,r,n)}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 pM(t,e,r,n){let i=t.cursor(),s=[];if(!i.firstChild())return s;if(r!=null){for(let o=!1;!o;)if(o=i.type.is(r),!i.nextSibling())return s}for(;;){if(n!=null&&i.type.is(n))return s;if(i.type.is(e)&&s.push(i.node),!i.nextSibling())return n==null?s:[]}}function o3(t,e,r=e.length-1){for(let n=t;r>=0;n=n.parent){if(!n)return!1;if(!n.type.isAnonymous){if(e[r]&&e[r]!=n.name)return!1;r--}}return!0}class mre{constructor(e,r,n,i){this.parent=e,this.buffer=r,this.index=n,this.start=i}}class Ho extends mR{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,r,n){super(),this.context=e,this._parent=r,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,r,n){let{buffer:i}=this.context,s=i.findChild(this.index+4,i.buffer[this.index+3],e,r-this.context.start,n);return s<0?null:new Ho(this.context,this,s)}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,r,n=0){if(n&Or.ExcludeBuffers)return null;let{buffer:i}=this.context,s=i.findChild(this.index+4,i.buffer[this.index+3],r>0?1:-1,e-this.context.start,r);return s<0?null:new Ho(this.context,this,s)}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,r=e.buffer[this.index+3];return r<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new Ho(this.context,this._parent,r):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,r=this._parent?this._parent.index+4:0;return this.index==r?this.externalSibling(-1):new Ho(this.context,this._parent,e.findChild(r,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],r=[],{buffer:n}=this.context,i=this.index+4,s=n.buffer[this.index+3];if(s>i){let o=n.buffer[this.index+1];e.push(n.slice(i,s,o)),r.push(0)}return new pr(this.type,e,r,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function gR(t){if(!t.length)return null;let e=0,r=t[0];for(let s=1;s<t.length;s++){let o=t[s];(o.from>r.from||o.to<r.to)&&(r=o,e=s)}let n=r instanceof Fn&&r.index<0?null:r.parent,i=t.slice();return n?i[e]=n:i.splice(e,1),new gre(i,r)}class gre{constructor(e,r){this.heads=e,this.node=r}get next(){return gR(this.heads)}}function yre(t,e,r){let n=t.resolveInner(e,r),i=null;for(let s=n instanceof Fn?n:n.context.parent;s;s=s.parent)if(s.index<0){let o=s.parent;(i||(i=[n])).push(o.resolve(e,r)),s=o}else{let o=qm.get(s.tree);if(o&&o.overlay&&o.overlay[0].from<=e&&o.overlay[o.overlay.length-1].to>=e){let a=new Fn(o.tree,o.overlay[0].from+s.from,-1,s);(i||(i=[n])).push(Vm(a,e,r,!1))}}return i?gR(i):n}class jb{get name(){return this.type.name}constructor(e,r=0){if(this.mode=r,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof Fn)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let n=e._parent;n;n=n._parent)this.stack.unshift(n.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,r){this.index=e;let{start:n,buffer:i}=this.buffer;return this.type=r||i.set.types[i.buffer[e]],this.from=n+i.buffer[e+1],this.to=n+i.buffer[e+2],!0}yield(e){return e?e instanceof Fn?(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,r,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,r,n,this.mode));let{buffer:i}=this.buffer,s=i.findChild(this.index+4,i.buffer[this.index+3],e,r-this.buffer.start,n);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}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,r,n=this.mode){return this.buffer?n&Or.ExcludeBuffers?!1:this.enterChild(1,e,r):this.yield(this._tree.enter(e,r,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Or.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Or.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:r}=this.buffer,n=this.stack.length-1;if(e<0){let i=n<0?0:this.stack[n]+4;if(this.index!=i)return this.yieldBuf(r.findChild(i,this.index,-1,0,4))}else{let i=r.buffer[this.index+3];if(i<(n<0?r.buffer.length:r.buffer[this.stack[n]+3]))return this.yieldBuf(i)}return n<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 r,n,{buffer:i}=this;if(i){if(e>0){if(this.index<i.buffer.buffer.length)return!1}else for(let s=0;s<this.index;s++)if(i.buffer.buffer[s+3]<this.index)return!1;({index:r,parent:n}=i)}else({index:r,_parent:n}=this._tree);for(;n;{index:r,_parent:n}=n)if(r>-1)for(let s=r+e,o=e<0?-1:n._tree.children.length;s!=o;s+=e){let a=n._tree.children[s];if(this.mode&Or.IncludeAnonymous||a instanceof uc||!a.type.isAnonymous||P6(a))return!1}return!0}move(e,r){if(r&&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,r=0){for(;(this.from==this.to||(r<1?this.from>=e:this.from>e)||(r>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,r););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,r=null,n=0;if(e&&e.context==this.buffer)e:for(let i=this.index,s=this.stack.length;s>=0;){for(let o=e;o;o=o._parent)if(o.index==i){if(i==this.index)return o;r=o,n=s+1;break e}i=this.stack[--s]}for(let i=n;i<this.stack.length;i++)r=new Ho(this.buffer,r,this.stack[i]);return this.bufferNode=new Ho(this.buffer,r,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,r){for(let n=0;;){let i=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){n++;continue}this.type.isAnonymous||(i=!0)}for(;;){if(i&&r&&r(this),i=this.type.isAnonymous,!n)return;if(this.nextSibling())break;this.parent(),n--,i=!0}}}matchContext(e){if(!this.buffer)return o3(this.node.parent,e);let{buffer:r}=this.buffer,{types:n}=r.set;for(let i=e.length-1,s=this.stack.length-1;i>=0;s--){if(s<0)return o3(this._tree,e,i);let o=n[r.buffer[this.stack[s]]];if(!o.isAnonymous){if(e[i]&&e[i]!=o.name)return!1;i--}}return!0}}function P6(t){return t.children.some(e=>e instanceof uc||!e.type.isAnonymous||P6(e))}function bre(t){var e;let{buffer:r,nodeSet:n,maxBufferLength:i=dre,reused:s=[],minRepeatType:o=n.types.length}=t,a=Array.isArray(r)?new R6(r,r.length):r,l=n.types,c=0,h=0;function u(k,w,_,L,B,E){let{id:D,start:N,end:K,size:z}=a,$=h,H=c;for(;z<0;)if(a.next(),z==-1){let fe=s[D];_.push(fe),L.push(N-k);return}else if(z==-3){c=D;return}else if(z==-4){h=D;return}else throw new RangeError(`Unrecognized record size: ${z}`);let j=l[D],q,ne,O=N-k;if(K-N<=i&&(ne=g(a.pos-w,B))){let fe=new Uint16Array(ne.size-ne.skip),Te=a.pos-ne.size,I=fe.length;for(;a.pos>Te;)I=y(ne.start,fe,I);q=new uc(fe,K-ne.start,n),O=ne.start-k}else{let fe=a.pos-z;a.next();let Te=[],I=[],tt=D>=o?D:-1,qe=0,Oe=K;for(;a.pos>fe;)tt>=0&&a.id==tt&&a.size>=0?(a.end<=Oe-i&&(p(Te,I,N,qe,a.end,Oe,tt,$,H),qe=Te.length,Oe=a.end),a.next()):E>2500?d(N,fe,Te,I):u(N,fe,Te,I,tt,E+1);if(tt>=0&&qe>0&&qe<Te.length&&p(Te,I,N,qe,N,Oe,tt,$,H),Te.reverse(),I.reverse(),tt>-1&&qe>0){let Ze=f(j,H);q=N6(j,Te,I,0,Te.length,0,K-N,Ze,Ze)}else q=m(j,Te,I,K-N,$-K,H)}_.push(q),L.push(O)}function d(k,w,_,L){let B=[],E=0,D=-1;for(;a.pos>w;){let{id:N,start:K,end:z,size:$}=a;if($>4)a.next();else{if(D>-1&&K<D)break;D<0&&(D=z-i),B.push(N,K,z),E++,a.next()}}if(E){let N=new Uint16Array(E*4),K=B[B.length-2];for(let z=B.length-3,$=0;z>=0;z-=3)N[$++]=B[z],N[$++]=B[z+1]-K,N[$++]=B[z+2]-K,N[$++]=$;_.push(new uc(N,B[2]-K,n)),L.push(K-k)}}function f(k,w){return(_,L,B)=>{let E=0,D=_.length-1,N,K;if(D>=0&&(N=_[D])instanceof pr){if(!D&&N.type==k&&N.length==B)return N;(K=N.prop(Lt.lookAhead))&&(E=L[D]+N.length+K)}return m(k,_,L,B,E,w)}}function p(k,w,_,L,B,E,D,N,K){let z=[],$=[];for(;k.length>L;)z.push(k.pop()),$.push(w.pop()+_-B);k.push(m(n.types[D],z,$,E-B,N-E,K)),w.push(B-_)}function m(k,w,_,L,B,E,D){if(E){let N=[Lt.contextHash,E];D=D?[N].concat(D):[N]}if(B>25){let N=[Lt.lookAhead,B];D=D?[N].concat(D):[N]}return new pr(k,w,_,L,D)}function g(k,w){let _=a.fork(),L=0,B=0,E=0,D=_.end-i,N={size:0,start:0,skip:0};e:for(let K=_.pos-k;_.pos>K;){let z=_.size;if(_.id==w&&z>=0){N.size=L,N.start=B,N.skip=E,E+=4,L+=4,_.next();continue}let $=_.pos-z;if(z<0||$<K||_.start<D)break;let H=_.id>=o?4:0,j=_.start;for(_.next();_.pos>$;){if(_.size<0)if(_.size==-3)H+=4;else break e;else _.id>=o&&(H+=4);_.next()}B=j,L+=z,E+=H}return(w<0||L==k)&&(N.size=L,N.start=B,N.skip=E),N.size>4?N:void 0}function y(k,w,_){let{id:L,start:B,end:E,size:D}=a;if(a.next(),D>=0&&L<o){let N=_;if(D>4){let K=a.pos-(D-4);for(;a.pos>K;)_=y(k,w,_)}w[--_]=N,w[--_]=E-k,w[--_]=B-k,w[--_]=L}else D==-3?c=L:D==-4&&(h=L);return _}let b=[],x=[];for(;a.pos>0;)u(t.start||0,t.bufferStart||0,b,x,-1,0);let S=(e=t.length)!==null&&e!==void 0?e:b.length?x[0]+b[0].length:0;return new pr(l[t.topID],b.reverse(),x.reverse(),S)}const mM=new WeakMap;function w2(t,e){if(!t.isAnonymous||e instanceof uc||e.type!=t)return 1;let r=mM.get(e);if(r==null){r=1;for(let n of e.children){if(n.type!=t||!(n instanceof pr)){r=1;break}r+=w2(t,n)}mM.set(e,r)}return r}function N6(t,e,r,n,i,s,o,a,l){let c=0;for(let p=n;p<i;p++)c+=w2(t,e[p]);let h=Math.ceil(c*1.5/8),u=[],d=[];function f(p,m,g,y,b){for(let x=g;x<y;){let S=x,k=m[x],w=w2(t,p[x]);for(x++;x<y;x++){let _=w2(t,p[x]);if(w+_>=h)break;w+=_}if(x==S+1){if(w>h){let _=p[S];f(_.children,_.positions,0,_.children.length,m[S]+b);continue}u.push(p[S])}else{let _=m[x-1]+p[x-1].length-k;u.push(N6(t,p,m,S,x,k,_,null,l))}d.push(k+b-s)}}return f(e,r,n,i,0),(a||l)(u,d,o)}class iDe{constructor(){this.map=new WeakMap}setBuffer(e,r,n){let i=this.map.get(e);i||this.map.set(e,i=new Map),i.set(r,n)}getBuffer(e,r){let n=this.map.get(e);return n&&n.get(r)}set(e,r){e instanceof Ho?this.setBuffer(e.context.buffer,e.index,r):e instanceof Fn&&this.map.set(e.tree,r)}get(e){return e instanceof Ho?this.getBuffer(e.context.buffer,e.index):e instanceof Fn?this.map.get(e.tree):void 0}cursorSet(e,r){e.buffer?this.setBuffer(e.buffer.buffer,e.index,r):this.map.set(e.tree,r)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Ka{constructor(e,r,n,i,s=!1,o=!1){this.from=e,this.to=r,this.tree=n,this.offset=i,this.open=(s?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,r=[],n=!1){let i=[new Ka(0,e.length,e,0,!1,n)];for(let s of r)s.to>e.length&&i.push(s);return i}static applyChanges(e,r,n=128){if(!r.length)return e;let i=[],s=1,o=e.length?e[0]:null;for(let a=0,l=0,c=0;;a++){let h=a<r.length?r[a]:null,u=h?h.fromA:1e9;if(u-l>=n)for(;o&&o.from<u;){let d=o;if(l>=d.from||u<=d.to||c){let f=Math.max(d.from,l)-c,p=Math.min(d.to,u)-c;d=f>=p?null:new Ka(f,p,d.tree,d.offset+c,a>0,!!h)}if(d&&i.push(d),o.to>u)break;o=s<e.length?e[s++]:null}if(!h)break;l=h.toA,c=h.toA-h.toB}return i}}let yR=class{startParse(e,r,n){return typeof e=="string"&&(e=new xre(e)),n=n?n.length?n.map(i=>new ws(i.from,i.to)):[new ws(0,0)]:[new ws(0,e.length)],this.createParse(e,r||[],n)}parse(e,r,n){let i=this.startParse(e,r,n);for(;;){let s=i.advance();if(s)return s}}};class xre{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,r){return this.string.slice(e,r)}}function oDe(t){return(e,r,n,i)=>new wre(e,t,r,n,i)}class gM{constructor(e,r,n,i,s){this.parser=e,this.parse=r,this.overlay=n,this.target=i,this.from=s}}function yM(t){if(!t.length||t.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(t))}class vre{constructor(e,r,n,i,s,o,a){this.parser=e,this.predicate=r,this.mounts=n,this.index=i,this.start=s,this.target=o,this.prev=a,this.depth=0,this.ranges=[]}}const a3=new Lt({perNode:!0});class wre{constructor(e,r,n,i,s){this.nest=r,this.input=n,this.fragments=i,this.ranges=s,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let n=this.baseParse.advance();if(!n)return null;if(this.baseParse=null,this.baseTree=n,this.startInner(),this.stoppedAt!=null)for(let i of this.inner)i.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let n=this.baseTree;return this.stoppedAt!=null&&(n=new pr(n.type,n.children,n.positions,n.length,n.propValues.concat([[a3,this.stoppedAt]]))),n}let e=this.inner[this.innerDone],r=e.parse.advance();if(r){this.innerDone++;let n=Object.assign(Object.create(null),e.target.props);n[Lt.mounted.id]=new qm(r,e.overlay,e.parser),e.target.props=n}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let r=this.innerDone;r<this.inner.length;r++)this.inner[r].from<e&&(e=Math.min(e,this.inner[r].parse.parsedPos));return e}stopAt(e){if(this.stoppedAt=e,this.baseParse)this.baseParse.stopAt(e);else for(let r=this.innerDone;r<this.inner.length;r++)this.inner[r].parse.stopAt(e)}startInner(){let e=new Sre(this.fragments),r=null,n=null,i=new jb(new Fn(this.baseTree,this.ranges[0].from,0,null),Or.IncludeAnonymous|Or.IgnoreMounts);e:for(let s,o;;){let a=!0,l;if(this.stoppedAt!=null&&i.from>=this.stoppedAt)a=!1;else if(e.hasNode(i)){if(r){let c=r.mounts.find(h=>h.frag.from<=i.from&&h.frag.to>=i.to&&h.mount.overlay);if(c)for(let h of c.mount.overlay){let u=h.from+c.pos,d=h.to+c.pos;u>=i.from&&d<=i.to&&!r.ranges.some(f=>f.from<d&&f.to>u)&&r.ranges.push({from:u,to:d})}}a=!1}else if(n&&(o=kre(n.ranges,i.from,i.to)))a=o!=2;else if(!i.type.isAnonymous&&(s=this.nest(i,this.input))&&(i.from<i.to||!s.overlay)){i.tree||Cre(i);let c=e.findMounts(i.from,s.parser);if(typeof s.overlay=="function")r=new vre(s.parser,s.overlay,c,this.inner.length,i.from,i.tree,r);else{let h=vM(this.ranges,s.overlay||(i.from<i.to?[new ws(i.from,i.to)]:[]));h.length&&yM(h),(h.length||!s.overlay)&&this.inner.push(new gM(s.parser,h.length?s.parser.startParse(this.input,wM(c,h),h):s.parser.startParse(""),s.overlay?s.overlay.map(u=>new ws(u.from-i.from,u.to-i.from)):null,i.tree,h.length?h[0].from:i.from)),s.overlay?h.length&&(n={ranges:h,depth:0,prev:n}):a=!1}}else if(r&&(l=r.predicate(i))&&(l===!0&&(l=new ws(i.from,i.to)),l.from<l.to)){let c=r.ranges.length-1;c>=0&&r.ranges[c].to==l.from?r.ranges[c]={from:r.ranges[c].from,to:l.to}:r.ranges.push(l)}if(a&&i.firstChild())r&&r.depth++,n&&n.depth++;else for(;!i.nextSibling();){if(!i.parent())break e;if(r&&!--r.depth){let c=vM(this.ranges,r.ranges);c.length&&(yM(c),this.inner.splice(r.index,0,new gM(r.parser,r.parser.startParse(this.input,wM(r.mounts,c),c),r.ranges.map(h=>new ws(h.from-r.start,h.to-r.start)),r.target,c[0].from))),r=r.prev}n&&!--n.depth&&(n=n.prev)}}}}function kre(t,e,r){for(let n of t){if(n.from>=r)break;if(n.to>e)return n.from<=e&&n.to>=r?2:1}return 0}function bM(t,e,r,n,i,s){if(e<r){let o=t.buffer[e+1];n.push(t.slice(e,r,o)),i.push(o-s)}}function Cre(t){let{node:e}=t,r=[],n=e.context.buffer;do r.push(t.index),t.parent();while(!t.tree);let i=t.tree,s=i.children.indexOf(n),o=i.children[s],a=o.buffer,l=[s];function c(h,u,d,f,p,m){let g=r[m],y=[],b=[];bM(o,h,g,y,b,f);let x=a[g+1],S=a[g+2];l.push(y.length);let k=m?c(g+4,a[g+3],o.set.types[a[g]],x,S-x,m-1):e.toTree();return y.push(k),b.push(x-f),bM(o,a[g+3],u,y,b,f),new pr(d,y,b,p)}i.children[s]=c(0,a.length,ls.none,0,o.length,r.length-1);for(let h of l){let u=t.tree.children[h],d=t.tree.positions[h];t.yield(new Fn(u,d+t.from,h,t._tree))}}class xM{constructor(e,r){this.offset=r,this.done=!1,this.cursor=e.cursor(Or.IncludeAnonymous|Or.IgnoreMounts)}moveTo(e){let{cursor:r}=this,n=e-this.offset;for(;!this.done&&r.from<n;)r.to>=e&&r.enter(n,1,Or.IgnoreOverlays|Or.ExcludeBuffers)||r.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 r=this.cursor.tree;;){if(r==e.tree)return!0;if(r.children.length&&r.positions[0]==0&&r.children[0]instanceof pr)r=r.children[0];else break}return!1}}class Sre{constructor(e){var r;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let n=this.curFrag=e[0];this.curTo=(r=n.tree.prop(a3))!==null&&r!==void 0?r:n.to,this.inner=new xM(n.tree,-n.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 r=this.curFrag=this.fragments[this.fragI];this.curTo=(e=r.tree.prop(a3))!==null&&e!==void 0?e:r.to,this.inner=new xM(r.tree,-r.offset)}}findMounts(e,r){var n;let i=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let s=this.inner.cursor.node;s;s=s.parent){let o=(n=s.tree)===null||n===void 0?void 0:n.prop(Lt.mounted);if(o&&o.parser==r)for(let a=this.fragI;a<this.fragments.length;a++){let l=this.fragments[a];if(l.from>=s.to)break;l.tree==this.curFrag.tree&&i.push({frag:l,pos:s.from-l.offset,mount:o})}}}return i}}function vM(t,e){let r=null,n=e;for(let i=1,s=0;i<t.length;i++){let o=t[i-1].to,a=t[i].from;for(;s<n.length;s++){let l=n[s];if(l.from>=a)break;l.to<=o||(r||(n=r=e.slice()),l.from<o?(r[s]=new ws(l.from,o),l.to>a&&r.splice(s+1,0,new ws(a,l.to))):l.to>a?r[s--]=new ws(a,l.to):r.splice(s--,1))}}return n}function Tre(t,e,r,n){let i=0,s=0,o=!1,a=!1,l=-1e9,c=[];for(;;){let h=i==t.length?1e9:o?t[i].to:t[i].from,u=s==e.length?1e9:a?e[s].to:e[s].from;if(o!=a){let d=Math.max(l,r),f=Math.min(h,u,n);d<f&&c.push(new ws(d,f))}if(l=Math.min(h,u),l==1e9)break;h==l&&(o?(o=!1,i++):o=!0),u==l&&(a?(a=!1,s++):a=!0)}return c}function wM(t,e){let r=[];for(let{pos:n,mount:i,frag:s}of t){let o=n+(i.overlay?i.overlay[0].from:0),a=o+i.tree.length,l=Math.max(s.from,o),c=Math.min(s.to,a);if(i.overlay){let h=i.overlay.map(d=>new ws(d.from+n,d.to+n)),u=Tre(e,h,l,c);for(let d=0,f=l;;d++){let p=d==u.length,m=p?c:u[d].from;if(m>f&&r.push(new Ka(f,m,i.tree,-o,s.from>=f||s.openStart,s.to<=m||s.openEnd)),p)break;f=u[d].to}}else r.push(new Ka(l,c,i.tree,-o,s.from>=o||s.openStart,s.to<=a||s.openEnd))}return r}let l3=[],bR=[];(()=>{let t="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(e=>e?parseInt(e,36):1);for(let e=0,r=0;e<t.length;e++)(e%2?bR:l3).push(r=r+t[e])})();function _re(t){if(t<768)return!1;for(let e=0,r=l3.length;;){let n=e+r>>1;if(t<l3[n])r=n;else if(t>=bR[n])e=n+1;else return!0;if(e==r)return!1}}function kM(t){return t>=127462&&t<=127487}const CM=8205;function Mre(t,e,r=!0,n=!0){return(r?xR:Are)(t,e,n)}function xR(t,e,r){if(e==t.length)return e;e&&vR(t.charCodeAt(e))&&wR(t.charCodeAt(e-1))&&e--;let n=N4(t,e);for(e+=SM(n);e<t.length;){let i=N4(t,e);if(n==CM||i==CM||r&&_re(i))e+=SM(i),n=i;else if(kM(i)){let s=0,o=e-2;for(;o>=0&&kM(N4(t,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function Are(t,e,r){for(;e>0;){let n=xR(t,e-2,r);if(n<e)return n;e--}return 0}function N4(t,e){let r=t.charCodeAt(e);if(!wR(r)||e+1==t.length)return r;let n=t.charCodeAt(e+1);return vR(n)?(r-55296<<10)+(n-56320)+65536:r}function vR(t){return t>=56320&&t<57344}function wR(t){return t>=55296&&t<56320}function SM(t){return t<65536?1:2}let Wt=class kR{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,r,n){[e,r]=gf(this,e,r);let i=[];return this.decompose(0,e,i,2),n.length&&n.decompose(0,n.length,i,3),this.decompose(r,this.length,i,1),k2.from(i,this.length-(r-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,r=this.length){[e,r]=gf(this,e,r);let n=[];return this.decompose(e,r,n,0),k2.from(n,r-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let r=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),i=new Zp(this),s=new Zp(e);for(let o=r,a=r;;){if(i.next(o),s.next(o),o=0,i.lineBreak!=s.lineBreak||i.done!=s.done||i.value!=s.value)return!1;if(a+=i.value.length,i.done||a>=n)return!0}}iter(e=1){return new Zp(this,e)}iterRange(e,r=this.length){return new CR(this,e,r)}iterLines(e,r){let n;if(e==null)n=this.iter();else{r==null&&(r=this.lines+1);let i=this.line(e).from;n=this.iterRange(i,Math.max(i,r==this.lines+1?this.length:r<=1?0:this.line(r-1).to))}return new SR(n)}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]?kR.empty:e.length<=32?new Nr(e):k2.from(Nr.split(e,[]))}};class Nr extends Wt{constructor(e,r=Ere(e)){super(),this.text=e,this.length=r}get lines(){return this.text.length}get children(){return null}lineInner(e,r,n,i){for(let s=0;;s++){let o=this.text[s],a=i+o.length;if((r?n:a)>=e)return new Ore(i,a,n,o);i=a+1,n++}}decompose(e,r,n,i){let s=e<=0&&r>=this.length?this:new Nr(TM(this.text,e,r),Math.min(r,this.length)-Math.max(0,e));if(i&1){let o=n.pop(),a=C2(s.text,o.text.slice(),0,s.length);if(a.length<=32)n.push(new Nr(a,o.length+s.length));else{let l=a.length>>1;n.push(new Nr(a.slice(0,l)),new Nr(a.slice(l)))}}else n.push(s)}replace(e,r,n){if(!(n instanceof Nr))return super.replace(e,r,n);[e,r]=gf(this,e,r);let i=C2(this.text,C2(n.text,TM(this.text,0,e)),r),s=this.length+n.length-(r-e);return i.length<=32?new Nr(i,s):k2.from(Nr.split(i,[]),s)}sliceString(e,r=this.length,n=`
34`){[e,r]=gf(this,e,r);let i="";for(let s=0,o=0;s<=r&&o<this.text.length;o++){let a=this.text[o],l=s+a.length;s>e&&o&&(i+=n),e<l&&r>s&&(i+=a.slice(Math.max(0,e-s),r-s)),s=l+1}return i}flatten(e){for(let r of this.text)e.push(r)}scanIdentical(){return 0}static split(e,r){let n=[],i=-1;for(let s of e)n.push(s),i+=s.length+1,n.length==32&&(r.push(new Nr(n,i)),n=[],i=-1);return i>-1&&r.push(new Nr(n,i)),r}}let k2=class Ku extends Wt{constructor(e,r){super(),this.children=e,this.length=r,this.lines=0;for(let n of e)this.lines+=n.lines}lineInner(e,r,n,i){for(let s=0;;s++){let o=this.children[s],a=i+o.length,l=n+o.lines-1;if((r?l:a)>=e)return o.lineInner(e,r,n,i);i=a+1,n=l+1}}decompose(e,r,n,i){for(let s=0,o=0;o<=r&&s<this.children.length;s++){let a=this.children[s],l=o+a.length;if(e<=l&&r>=o){let c=i&((o<=e?1:0)|(l>=r?2:0));o>=e&&l<=r&&!c?n.push(a):a.decompose(e-o,r-o,n,c)}o=l+1}}replace(e,r,n){if([e,r]=gf(this,e,r),n.lines<this.lines)for(let i=0,s=0;i<this.children.length;i++){let o=this.children[i],a=s+o.length;if(e>=s&&r<=a){let l=o.replace(e-s,r-s,n),c=this.lines-o.lines+l.lines;if(l.lines<c>>4&&l.lines>c>>6){let h=this.children.slice();return h[i]=l,new Ku(h,this.length-(r-e)+n.length)}return super.replace(s,a,l)}s=a+1}return super.replace(e,r,n)}sliceString(e,r=this.length,n=`
35`){[e,r]=gf(this,e,r);let i="";for(let s=0,o=0;s<this.children.length&&o<=r;s++){let a=this.children[s],l=o+a.length;o>e&&s&&(i+=n),e<l&&r>o&&(i+=a.sliceString(e-o,r-o,n)),o=l+1}return i}flatten(e){for(let r of this.children)r.flatten(e)}scanIdentical(e,r){if(!(e instanceof Ku))return 0;let n=0,[i,s,o,a]=r>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=r,s+=r){if(i==o||s==a)return n;let l=this.children[i],c=e.children[s];if(l!=c)return n+l.scanIdentical(c,r);n+=l.length+1}}static from(e,r=e.reduce((n,i)=>n+i.length+1,-1)){let n=0;for(let f of e)n+=f.lines;if(n<32){let f=[];for(let p of e)p.flatten(f);return new Nr(f,r)}let i=Math.max(32,n>>5),s=i<<1,o=i>>1,a=[],l=0,c=-1,h=[];function u(f){let p;if(f.lines>s&&f instanceof Ku)for(let m of f.children)u(m);else f.lines>o&&(l>o||!l)?(d(),a.push(f)):f instanceof Nr&&l&&(p=h[h.length-1])instanceof Nr&&f.lines+p.lines<=32?(l+=f.lines,c+=f.length+1,h[h.length-1]=new Nr(p.text.concat(f.text),p.length+1+f.length)):(l+f.lines>i&&d(),l+=f.lines,c+=f.length+1,h.push(f))}function d(){l!=0&&(a.push(h.length==1?h[0]:Ku.from(h,c)),c=-1,l=h.length=0)}for(let f of e)u(f);return d(),a.length==1?a[0]:new Ku(a,r)}};Wt.empty=new Nr([""],0);function Ere(t){let e=-1;for(let r of t)e+=r.length+1;return e}function C2(t,e,r=0,n=1e9){for(let i=0,s=0,o=!0;s<t.length&&i<=n;s++){let a=t[s],l=i+a.length;l>=r&&(l>n&&(a=a.slice(0,n-i)),i<r&&(a=a.slice(r-i)),o?(e[e.length-1]+=a,o=!1):e.push(a)),i=l+1}return e}function TM(t,e,r){return C2(t,[""],e,r)}class Zp{constructor(e,r=1){this.dir=r,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[r>0?1:(e instanceof Nr?e.text.length:e.children.length)<<1]}nextInner(e,r){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,i=this.nodes[n],s=this.offsets[n],o=s>>1,a=i instanceof Nr?i.text.length:i.children.length;if(o==(r>0?a:0)){if(n==0)return this.done=!0,this.value="",this;r>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(r>0?0:1)){if(this.offsets[n]+=r,e==0)return this.lineBreak=!0,this.value=`
36`,this;e--}else if(i instanceof Nr){let l=i.text[o+(r<0?-1:0)];if(this.offsets[n]+=r,l.length>Math.max(0,e))return this.value=e==0?l:r>0?l.slice(e):l.slice(0,l.length-e),this;e-=l.length}else{let l=i.children[o+(r<0?-1:0)];e>l.length?(e-=l.length,this.offsets[n]+=r):(r<0&&this.offsets[n]--,this.nodes.push(l),this.offsets.push(r>0?1:(l instanceof Nr?l.text.length:l.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class CR{constructor(e,r,n){this.value="",this.done=!1,this.cursor=new Zp(e,r>n?-1:1),this.pos=r>n?e.length:0,this.from=Math.min(r,n),this.to=Math.max(r,n)}nextInner(e,r){if(r<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,r<0?this.pos-this.to:this.from-this.pos);let n=r<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*r,this.value=i.length<=n?i:r<0?i.slice(i.length-n):i.slice(0,n),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 SR{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:r,lineBreak:n,value:i}=this.inner.next(e);return r&&this.afterBreak?(this.value="",this.afterBreak=!1):r?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Wt.prototype[Symbol.iterator]=function(){return this.iter()},Zp.prototype[Symbol.iterator]=CR.prototype[Symbol.iterator]=SR.prototype[Symbol.iterator]=function(){return this});class Ore{constructor(e,r,n,i){this.from=e,this.to=r,this.number=n,this.text=i}get length(){return this.to-this.from}}function gf(t,e,r){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,r))]}function Tn(t,e,r=!0,n=!0){return Mre(t,e,r,n)}function Lre(t){return t>=56320&&t<57344}function Dre(t){return t>=55296&&t<56320}function ki(t,e){let r=t.charCodeAt(e);if(!Dre(r)||e+1==t.length)return r;let n=t.charCodeAt(e+1);return Lre(n)?(r-55296<<10)+(n-56320)+65536:r}function F6(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function Fo(t){return t<65536?1:2}const c3=/\r\n?|\n/;var Sn=function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t}(Sn||(Sn={}));class Go{constructor(e){this.sections=e}get length(){let e=0;for(let r=0;r<this.sections.length;r+=2)e+=this.sections[r];return e}get newLength(){let e=0;for(let r=0;r<this.sections.length;r+=2){let n=this.sections[r+1];e+=n<0?this.sections[r]:n}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let r=0,n=0,i=0;r<this.sections.length;){let s=this.sections[r++],o=this.sections[r++];o<0?(e(n,i,s),i+=s):i+=o,n+=s}}iterChangedRanges(e,r=!1){h3(this,e,r)}get invertedDesc(){let e=[];for(let r=0;r<this.sections.length;){let n=this.sections[r++],i=this.sections[r++];i<0?e.push(n,i):e.push(i,n)}return new Go(e)}composeDesc(e){return this.empty?e:e.empty?this:TR(this,e)}mapDesc(e,r=!1){return e.empty?this:u3(this,e,r)}mapPos(e,r=-1,n=Sn.Simple){let i=0,s=0;for(let o=0;o<this.sections.length;){let a=this.sections[o++],l=this.sections[o++],c=i+a;if(l<0){if(c>e)return s+(e-i);s+=a}else{if(n!=Sn.Simple&&c>=e&&(n==Sn.TrackDel&&i<e&&c>e||n==Sn.TrackBefore&&i<e||n==Sn.TrackAfter&&c>e))return null;if(c>e||c==e&&r<0&&!a)return e==i||r<0?s:s+l;s+=l}i=c}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return s}touchesRange(e,r=e){for(let n=0,i=0;n<this.sections.length&&i<=r;){let s=this.sections[n++],o=this.sections[n++],a=i+s;if(o>=0&&i<=r&&a>=e)return i<e&&a>r?"cover":!0;i=a}return!1}toString(){let e="";for(let r=0;r<this.sections.length;){let n=this.sections[r++],i=this.sections[r++];e+=(e?" ":"")+n+(i>=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(r=>typeof r!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Go(e)}static create(e){return new Go(e)}}class Zr extends Go{constructor(e,r){super(e),this.inserted=r}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return h3(this,(r,n,i,s,o)=>e=e.replace(i,i+(n-r),o),!1),e}mapDesc(e,r=!1){return u3(this,e,r,!0)}invert(e){let r=this.sections.slice(),n=[];for(let i=0,s=0;i<r.length;i+=2){let o=r[i],a=r[i+1];if(a>=0){r[i]=a,r[i+1]=o;let l=i>>1;for(;n.length<l;)n.push(Wt.empty);n.push(o?e.slice(s,s+o):Wt.empty)}s+=o}return new Zr(r,n)}compose(e){return this.empty?e:e.empty?this:TR(this,e,!0)}map(e,r=!1){return e.empty?this:u3(this,e,r,!0)}iterChanges(e,r=!1){h3(this,e,r)}get desc(){return Go.create(this.sections)}filter(e){let r=[],n=[],i=[],s=new Wm(this);e:for(let o=0,a=0;;){let l=o==e.length?1e9:e[o++];for(;a<l||a==l&&s.len==0;){if(s.done)break e;let h=Math.min(s.len,l-a);Bn(i,h,-1);let u=s.ins==-1?-1:s.off==0?s.ins:0;Bn(r,h,u),u>0&&Xl(n,r,s.text),s.forward(h),a+=h}let c=e[o++];for(;a<c;){if(s.done)break e;let h=Math.min(s.len,c-a);Bn(r,h,-1),Bn(i,h,s.ins==-1?-1:s.off==0?s.ins:0),s.forward(h),a+=h}}return{changes:new Zr(r,n),filtered:Go.create(i)}}toJSON(){let e=[];for(let r=0;r<this.sections.length;r+=2){let n=this.sections[r],i=this.sections[r+1];i<0?e.push(n):i==0?e.push([n]):e.push([n].concat(this.inserted[r>>1].toJSON()))}return e}static of(e,r,n){let i=[],s=[],o=0,a=null;function l(h=!1){if(!h&&!i.length)return;o<r&&Bn(i,r-o,-1);let u=new Zr(i,s);a=a?a.compose(u.map(a)):u,i=[],s=[],o=0}function c(h){if(Array.isArray(h))for(let u of h)c(u);else if(h instanceof Zr){if(h.length!=r)throw new RangeError(`Mismatched change set length (got ${h.length}, expected ${r})`);l(),a=a?a.compose(h.map(a)):h}else{let{from:u,to:d=u,insert:f}=h;if(u>d||u<0||d>r)throw new RangeError(`Invalid change range ${u} to ${d} (in doc of length ${r})`);let p=f?typeof f=="string"?Wt.of(f.split(n||c3)):f:Wt.empty,m=p.length;if(u==d&&m==0)return;u<o&&l(),u>o&&Bn(i,u-o,-1),Bn(i,d-u,m),Xl(s,i,p),o=d}}return c(e),l(!a),a}static empty(e){return new Zr(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let r=[],n=[];for(let i=0;i<e.length;i++){let s=e[i];if(typeof s=="number")r.push(s,-1);else{if(!Array.isArray(s)||typeof s[0]!="number"||s.some((o,a)=>a&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)r.push(s[0],0);else{for(;n.length<i;)n.push(Wt.empty);n[i]=Wt.of(s.slice(1)),r.push(s[0],n[i].length)}}}return new Zr(r,n)}static createSet(e,r){return new Zr(e,r)}}function Bn(t,e,r,n=!1){if(e==0&&r<=0)return;let i=t.length-2;i>=0&&r<=0&&r==t[i+1]?t[i]+=e:i>=0&&e==0&&t[i]==0?t[i+1]+=r:n?(t[i]+=e,t[i+1]+=r):t.push(e,r)}function Xl(t,e,r){if(r.length==0)return;let n=e.length-2>>1;if(n<t.length)t[t.length-1]=t[t.length-1].append(r);else{for(;t.length<n;)t.push(Wt.empty);t.push(r)}}function h3(t,e,r){let n=t.inserted;for(let i=0,s=0,o=0;o<t.sections.length;){let a=t.sections[o++],l=t.sections[o++];if(l<0)i+=a,s+=a;else{let c=i,h=s,u=Wt.empty;for(;c+=a,h+=l,l&&n&&(u=u.append(n[o-2>>1])),!(r||o==t.sections.length||t.sections[o+1]<0);)a=t.sections[o++],l=t.sections[o++];e(i,c,s,h,u),i=c,s=h}}}function u3(t,e,r,n=!1){let i=[],s=n?[]:null,o=new Wm(t),a=new Wm(e);for(let l=-1;;){if(o.done&&a.len||a.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&a.ins==-1){let c=Math.min(o.len,a.len);Bn(i,c,-1),o.forward(c),a.forward(c)}else if(a.ins>=0&&(o.ins<0||l==o.i||o.off==0&&(a.len<o.len||a.len==o.len&&!r))){let c=a.len;for(Bn(i,a.ins,-1);c;){let h=Math.min(o.len,c);o.ins>=0&&l<o.i&&o.len<=h&&(Bn(i,0,o.ins),s&&Xl(s,i,o.text),l=o.i),o.forward(h),c-=h}a.next()}else if(o.ins>=0){let c=0,h=o.len;for(;h;)if(a.ins==-1){let u=Math.min(h,a.len);c+=u,h-=u,a.forward(u)}else if(a.ins==0&&a.len<h)h-=a.len,a.next();else break;Bn(i,c,l<o.i?o.ins:0),s&&l<o.i&&Xl(s,i,o.text),l=o.i,o.forward(o.len-h)}else{if(o.done&&a.done)return s?Zr.createSet(i,s):Go.create(i);throw new Error("Mismatched change set lengths")}}}function TR(t,e,r=!1){let n=[],i=r?[]:null,s=new Wm(t),o=new Wm(e);for(let a=!1;;){if(s.done&&o.done)return i?Zr.createSet(n,i):Go.create(n);if(s.ins==0)Bn(n,s.len,0,a),s.next();else if(o.len==0&&!o.done)Bn(n,0,o.ins,a),i&&Xl(i,n,o.text),o.next();else{if(s.done||o.done)throw new Error("Mismatched change set lengths");{let l=Math.min(s.len2,o.len),c=n.length;if(s.ins==-1){let h=o.ins==-1?-1:o.off?0:o.ins;Bn(n,l,h,a),i&&h&&Xl(i,n,o.text)}else o.ins==-1?(Bn(n,s.off?0:s.len,l,a),i&&Xl(i,n,s.textBit(l))):(Bn(n,s.off?0:s.len,o.off?0:o.ins,a),i&&!o.off&&Xl(i,n,o.text));a=(s.ins>l||o.ins>=0&&o.len>l)&&(a||n.length>c),s.forward2(l),o.forward(l)}}}}class Wm{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,r=this.i-2>>1;return r>=e.length?Wt.empty:e[r]}textBit(e){let{inserted:r}=this.set,n=this.i-2>>1;return n>=r.length&&!e?Wt.empty:r[n].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)}}let hy=class d3{constructor(e,r,n){this.from=e,this.to=r,this.flags=n}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,r=-1){let n,i;return this.empty?n=i=e.mapPos(this.from,r):(n=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),n==this.from&&i==this.to?this:new d3(n,i,this.flags)}extend(e,r=e){if(e<=this.anchor&&r>=this.anchor)return ce.range(e,r);let n=Math.abs(e-this.anchor)>Math.abs(r-this.anchor)?e:r;return ce.range(this.anchor,n)}eq(e,r=!1){return this.anchor==e.anchor&&this.head==e.head&&(!r||!this.empty||this.assoc==e.assoc)}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 ce.range(e.anchor,e.head)}static create(e,r,n){return new d3(e,r,n)}};class ce{constructor(e,r){this.ranges=e,this.mainIndex=r}map(e,r=-1){return e.empty?this:ce.create(this.ranges.map(n=>n.map(e,r)),this.mainIndex)}eq(e,r=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;n<this.ranges.length;n++)if(!this.ranges[n].eq(e.ranges[n],r))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new ce([this.main],0)}addRange(e,r=!0){return ce.create([e].concat(this.ranges),r?0:this.mainIndex+1)}replaceRange(e,r=this.mainIndex){let n=this.ranges.slice();return n[r]=e,ce.create(n,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 ce(e.ranges.map(r=>hy.fromJSON(r)),e.main)}static single(e,r=e){return new ce([ce.range(e,r)],0)}static create(e,r=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let n=0,i=0;i<e.length;i++){let s=e[i];if(s.empty?s.from<=n:s.from<n)return ce.normalized(e.slice(),r);n=s.to}return new ce(e,r)}static cursor(e,r=0,n,i){return hy.create(e,e,(r==0?0:r<0?8:16)|(n==null?7:Math.min(6,n))|(i??16777215)<<6)}static range(e,r,n,i){let s=(n??16777215)<<6|(i==null?7:Math.min(6,i));return r<e?hy.create(r,e,48|s):hy.create(e,r,(r>e?8:0)|s)}static normalized(e,r=0){let n=e[r];e.sort((i,s)=>i.from-s.from),r=e.indexOf(n);for(let i=1;i<e.length;i++){let s=e[i],o=e[i-1];if(s.empty?s.from<=o.to:s.from<o.to){let a=o.from,l=Math.max(s.to,o.to);i<=r&&r--,e.splice(--i,2,s.anchor>s.head?ce.range(l,a):ce.range(a,l))}}return new ce(e,r)}}function _R(t,e){for(let r of t.ranges)if(r.to>e)throw new RangeError("Selection points outside of document")}let $6=0;class Ne{constructor(e,r,n,i,s){this.combine=e,this.compareInput=r,this.compare=n,this.isStatic=i,this.id=$6++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new Ne(e.combine||(r=>r),e.compareInput||((r,n)=>r===n),e.compare||(e.combine?(r,n)=>r===n:z6),!!e.static,e.enables)}of(e){return new S2([],this,0,e)}compute(e,r){if(this.isStatic)throw new Error("Can't compute a static facet");return new S2(e,this,1,r)}computeN(e,r){if(this.isStatic)throw new Error("Can't compute a static facet");return new S2(e,this,2,r)}from(e,r){return r||(r=n=>n),this.compute([e],n=>r(n.field(e)))}}function z6(t,e){return t==e||t.length==e.length&&t.every((r,n)=>r===e[n])}class S2{constructor(e,r,n,i){this.dependencies=e,this.facet=r,this.type=n,this.value=i,this.id=$6++}dynamicSlot(e){var r;let n=this.value,i=this.facet.compareInput,s=this.id,o=e[s]>>1,a=this.type==2,l=!1,c=!1,h=[];for(let u of this.dependencies)u=="doc"?l=!0:u=="selection"?c=!0:((r=e[u.id])!==null&&r!==void 0?r:1)&1||h.push(e[u.id]);return{create(u){return u.values[o]=n(u),1},update(u,d){if(l&&d.docChanged||c&&(d.docChanged||d.selection)||f3(u,h)){let f=n(u);if(a?!_M(f,u.values[o],i):!i(f,u.values[o]))return u.values[o]=f,1}return 0},reconfigure:(u,d)=>{let f,p=d.config.address[s];if(p!=null){let m=Ub(d,p);if(this.dependencies.every(g=>g instanceof Ne?d.facet(g)===u.facet(g):g instanceof fn?d.field(g,!1)==u.field(g,!1):!0)||(a?_M(f=n(u),m,i):i(f=n(u),m)))return u.values[o]=m,0}else f=n(u);return u.values[o]=f,1}}}}function _M(t,e,r){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!r(t[n],e[n]))return!1;return!0}function f3(t,e){let r=!1;for(let n of e)Qp(t,n)&1&&(r=!0);return r}function Ire(t,e,r){let n=r.map(l=>t[l.id]),i=r.map(l=>l.type),s=n.filter(l=>!(l&1)),o=t[e.id]>>1;function a(l){let c=[];for(let h=0;h<n.length;h++){let u=Ub(l,n[h]);if(i[h]==2)for(let d of u)c.push(d);else c.push(u)}return e.combine(c)}return{create(l){for(let c of n)Qp(l,c);return l.values[o]=a(l),1},update(l,c){if(!f3(l,s))return 0;let h=a(l);return e.compare(h,l.values[o])?0:(l.values[o]=h,1)},reconfigure(l,c){let h=f3(l,n),u=c.config.facets[e.id],d=c.facet(e);if(u&&!h&&z6(r,u))return l.values[o]=d,0;let f=a(l);return e.compare(f,d)?(l.values[o]=d,0):(l.values[o]=f,1)}}}const uy=Ne.define({static:!0});class fn{constructor(e,r,n,i,s){this.id=e,this.createF=r,this.updateF=n,this.compareF=i,this.spec=s,this.provides=void 0}static define(e){let r=new fn($6++,e.create,e.update,e.compare||((n,i)=>n===i),e);return e.provide&&(r.provides=e.provide(r)),r}create(e){let r=e.facet(uy).find(n=>n.field==this);return((r==null?void 0:r.create)||this.createF)(e)}slot(e){let r=e[this.id]>>1;return{create:n=>(n.values[r]=this.create(n),1),update:(n,i)=>{let s=n.values[r],o=this.updateF(s,i);return this.compareF(s,o)?0:(n.values[r]=o,1)},reconfigure:(n,i)=>{let s=n.facet(uy),o=i.facet(uy),a;return(a=s.find(l=>l.field==this))&&a!=o.find(l=>l.field==this)?(n.values[r]=a.create(n),1):i.config.address[this.id]!=null?(n.values[r]=i.field(this),0):(n.values[r]=this.create(n),1)}}}init(e){return[this,uy.of({field:this,create:e})]}get extension(){return this}}const ch={lowest:4,low:3,default:2,high:1,highest:0};function I0(t){return e=>new MR(e,t)}const Ec={highest:I0(ch.highest),high:I0(ch.high),default:I0(ch.default),low:I0(ch.low),lowest:I0(ch.lowest)};class MR{constructor(e,r){this.inner=e,this.prec=r}}class yf{of(e){return new p3(this,e)}reconfigure(e){return yf.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class p3{constructor(e,r){this.compartment=e,this.inner=r}}let MM=class AR{constructor(e,r,n,i,s,o){for(this.base=e,this.compartments=r,this.dynamicSlots=n,this.address=i,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(e){let r=this.address[e.id];return r==null?e.default:this.staticValues[r>>1]}static resolve(e,r,n){let i=[],s=Object.create(null),o=new Map;for(let d of Bre(e,r,o))d instanceof fn?i.push(d):(s[d.facet.id]||(s[d.facet.id]=[])).push(d);let a=Object.create(null),l=[],c=[];for(let d of i)a[d.id]=c.length<<1,c.push(f=>d.slot(f));let h=n==null?void 0:n.config.facets;for(let d in s){let f=s[d],p=f[0].facet,m=h&&h[d]||[];if(f.every(g=>g.type==0))if(a[p.id]=l.length<<1|1,z6(m,f))l.push(n.facet(p));else{let g=p.combine(f.map(y=>y.value));l.push(n&&p.compare(g,n.facet(p))?n.facet(p):g)}else{for(let g of f)g.type==0?(a[g.id]=l.length<<1|1,l.push(g.value)):(a[g.id]=c.length<<1,c.push(y=>g.dynamicSlot(y)));a[p.id]=c.length<<1,c.push(g=>Ire(g,p,f))}}let u=c.map(d=>d(a));return new AR(e,o,u,a,l,s)}};function Bre(t,e,r){let n=[[],[],[],[],[]],i=new Map;function s(o,a){let l=i.get(o);if(l!=null){if(l<=a)return;let c=n[l].indexOf(o);c>-1&&n[l].splice(c,1),o instanceof p3&&r.delete(o.compartment)}if(i.set(o,a),Array.isArray(o))for(let c of o)s(c,a);else if(o instanceof p3){if(r.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=e.get(o.compartment)||o.inner;r.set(o.compartment,c),s(c,a)}else if(o instanceof MR)s(o.inner,o.prec);else if(o instanceof fn)n[a].push(o),o.provides&&s(o.provides,a);else if(o instanceof S2)n[a].push(o),o.facet.extensions&&s(o.facet.extensions,ch.default);else{let c=o.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(c,a)}}return s(t,ch.default),n.reduce((o,a)=>o.concat(a))}function Qp(t,e){if(e&1)return 2;let r=e>>1,n=t.status[r];if(n==4)throw new Error("Cyclic dependency between fields and/or facets");if(n&2)return n;t.status[r]=4;let i=t.computeSlot(t,t.config.dynamicSlots[r]);return t.status[r]=2|i}function Ub(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const ER=Ne.define(),m3=Ne.define({combine:t=>t.some(e=>e),static:!0}),OR=Ne.define({combine:t=>t.length?t[0]:void 0,static:!0}),LR=Ne.define(),DR=Ne.define(),IR=Ne.define(),BR=Ne.define({combine:t=>t.length?t[0]:!1});class ml{constructor(e,r){this.type=e,this.value=r}static define(){return new Rre}}class Rre{of(e){return new ml(this,e)}}class Pre{constructor(e){this.map=e}of(e){return new kt(this,e)}}class kt{constructor(e,r){this.type=e,this.value=r}map(e){let r=this.type.map(this.value,e);return r===void 0?void 0:r==this.value?this:new kt(this.type,r)}is(e){return this.type==e}static define(e={}){return new Pre(e.map||(r=>r))}static mapEffects(e,r){if(!e.length)return e;let n=[];for(let i of e){let s=i.map(r);s&&n.push(s)}return n}}kt.reconfigure=kt.define();kt.appendConfig=kt.define();let oi=class rp{constructor(e,r,n,i,s,o){this.startState=e,this.changes=r,this.selection=n,this.effects=i,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,n&&_R(n,r.newLength),s.some(a=>a.type==rp.time)||(this.annotations=s.concat(rp.time.of(Date.now())))}static create(e,r,n,i,s,o){return new rp(e,r,n,i,s,o)}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 r of this.annotations)if(r.type==e)return r.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let r=this.annotation(rp.userEvent);return!!(r&&(r==e||r.length>e.length&&r.slice(0,e.length)==e&&r[e.length]=="."))}};oi.time=ml.define();oi.userEvent=ml.define();oi.addToHistory=ml.define();oi.remote=ml.define();function Nre(t,e){let r=[];for(let n=0,i=0;;){let s,o;if(n<t.length&&(i==e.length||e[i]>=t[n]))s=t[n++],o=t[n++];else if(i<e.length)s=e[i++],o=e[i++];else return r;!r.length||r[r.length-1]<s?r.push(s,o):r[r.length-1]<o&&(r[r.length-1]=o)}}function RR(t,e,r){var n;let i,s,o;return r?(i=e.changes,s=Zr.empty(e.changes.length),o=t.changes.compose(e.changes)):(i=e.changes.map(t.changes),s=t.changes.mapDesc(e.changes,!0),o=t.changes.compose(i)),{changes:o,selection:e.selection?e.selection.map(s):(n=t.selection)===null||n===void 0?void 0:n.map(i),effects:kt.mapEffects(t.effects,i).concat(kt.mapEffects(e.effects,s)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function g3(t,e,r){let n=e.selection,i=md(e.annotations);return e.userEvent&&(i=i.concat(oi.userEvent.of(e.userEvent))),{changes:e.changes instanceof Zr?e.changes:Zr.of(e.changes||[],r,t.facet(OR)),selection:n&&(n instanceof ce?n:ce.single(n.anchor,n.head)),effects:md(e.effects),annotations:i,scrollIntoView:!!e.scrollIntoView}}function PR(t,e,r){let n=g3(t,e.length?e[0]:{},t.doc.length);e.length&&e[0].filter===!1&&(r=!1);for(let s=1;s<e.length;s++){e[s].filter===!1&&(r=!1);let o=!!e[s].sequential;n=RR(n,g3(t,e[s],o?n.changes.newLength:t.doc.length),o)}let i=oi.create(t,n.changes,n.selection,n.effects,n.annotations,n.scrollIntoView);return $re(r?Fre(i):i)}function Fre(t){let e=t.startState,r=!0;for(let i of e.facet(LR)){let s=i(t);if(s===!1){r=!1;break}Array.isArray(s)&&(r=r===!0?s:Nre(r,s))}if(r!==!0){let i,s;if(r===!1)s=t.changes.invertedDesc,i=Zr.empty(e.doc.length);else{let o=t.changes.filter(r);i=o.changes,s=o.filtered.mapDesc(o.changes).invertedDesc}t=oi.create(e,i,t.selection&&t.selection.map(s),kt.mapEffects(t.effects,s),t.annotations,t.scrollIntoView)}let n=e.facet(DR);for(let i=n.length-1;i>=0;i--){let s=n[i](t);s instanceof oi?t=s:Array.isArray(s)&&s.length==1&&s[0]instanceof oi?t=s[0]:t=PR(e,md(s),!1)}return t}function $re(t){let e=t.startState,r=e.facet(IR),n=t;for(let i=r.length-1;i>=0;i--){let s=r[i](t);s&&Object.keys(s).length&&(n=RR(n,g3(e,s,t.changes.newLength),!0))}return n==t?t:oi.create(e,t.changes,t.selection,n.effects,n.annotations,n.scrollIntoView)}const zre=[];function md(t){return t==null?zre:Array.isArray(t)?t:[t]}var Sr=function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t}(Sr||(Sr={}));const Hre=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let y3;try{y3=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function qre(t){if(y3)return y3.test(t);for(let e=0;e<t.length;e++){let r=t[e];if(/\w/.test(r)||r>"€"&&(r.toUpperCase()!=r.toLowerCase()||Hre.test(r)))return!0}return!1}function Vre(t){return e=>{if(!/\S/.test(e))return Sr.Space;if(qre(e))return Sr.Word;for(let r=0;r<t.length;r++)if(e.indexOf(t[r])>-1)return Sr.Word;return Sr.Other}}let Tr=class zs{constructor(e,r,n,i,s,o){this.config=e,this.doc=r,this.selection=n,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let a=0;a<this.config.dynamicSlots.length;a++)Qp(this,a<<1);this.computeSlot=null}field(e,r=!0){let n=this.config.address[e.id];if(n==null){if(r)throw new RangeError("Field is not present in this state");return}return Qp(this,n),Ub(this,n)}update(...e){return PR(this,e,!0)}applyTransaction(e){let r=this.config,{base:n,compartments:i}=r;for(let a of e.effects)a.is(yf.reconfigure)?(r&&(i=new Map,r.compartments.forEach((l,c)=>i.set(c,l)),r=null),i.set(a.value.compartment,a.value.extension)):a.is(kt.reconfigure)?(r=null,n=a.value):a.is(kt.appendConfig)&&(r=null,n=md(n).concat(a.value));let s;r?s=e.startState.values.slice():(r=MM.resolve(n,i,this),s=new zs(r,this.doc,this.selection,r.dynamicSlots.map(()=>null),(l,c)=>c.reconfigure(l,this),null).values);let o=e.startState.facet(m3)?e.newSelection:e.newSelection.asSingle();new zs(r,e.newDoc,o,s,(a,l)=>l.update(a,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:e},range:ce.cursor(r.from+e.length)}))}changeByRange(e){let r=this.selection,n=e(r.ranges[0]),i=this.changes(n.changes),s=[n.range],o=md(n.effects);for(let a=1;a<r.ranges.length;a++){let l=e(r.ranges[a]),c=this.changes(l.changes),h=c.map(i);for(let d=0;d<a;d++)s[d]=s[d].map(h);let u=i.mapDesc(c,!0);s.push(l.range.map(u)),i=i.compose(h),o=kt.mapEffects(o,h).concat(kt.mapEffects(md(l.effects),u))}return{changes:i,selection:ce.create(s,r.mainIndex),effects:o}}changes(e=[]){return e instanceof Zr?e:Zr.of(e,this.doc.length,this.facet(zs.lineSeparator))}toText(e){return Wt.of(e.split(this.facet(zs.lineSeparator)||c3))}sliceDoc(e=0,r=this.doc.length){return this.doc.sliceString(e,r,this.lineBreak)}facet(e){let r=this.config.address[e.id];return r==null?e.default:(Qp(this,r),Ub(this,r))}toJSON(e){let r={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let n in e){let i=e[n];i instanceof fn&&this.config.address[i.id]!=null&&(r[n]=i.spec.toJSON(this.field(e[n]),this))}return r}static fromJSON(e,r={},n){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let i=[];if(n){for(let s in n)if(Object.prototype.hasOwnProperty.call(e,s)){let o=n[s],a=e[s];i.push(o.init(l=>o.spec.fromJSON(a,l)))}}return zs.create({doc:e.doc,selection:ce.fromJSON(e.selection),extensions:r.extensions?i.concat([r.extensions]):i})}static create(e={}){let r=MM.resolve(e.extensions||[],new Map),n=e.doc instanceof Wt?e.doc:Wt.of((e.doc||"").split(r.staticFacet(zs.lineSeparator)||c3)),i=e.selection?e.selection instanceof ce?e.selection:ce.single(e.selection.anchor,e.selection.head):ce.single(0);return _R(i,n.length),r.staticFacet(m3)||(i=i.asSingle()),new zs(r,n,i,r.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(zs.tabSize)}get lineBreak(){return this.facet(zs.lineSeparator)||`
37`}get readOnly(){return this.facet(BR)}phrase(e,...r){for(let n of this.facet(zs.phrases))if(Object.prototype.hasOwnProperty.call(n,e)){e=n[e];break}return r.length&&(e=e.replace(/\$(\$|\d*)/g,(n,i)=>{if(i=="$")return"$";let s=+(i||1);return!s||s>r.length?n:r[s-1]})),e}languageDataAt(e,r,n=-1){let i=[];for(let s of this.facet(ER))for(let o of s(this,r,n))Object.prototype.hasOwnProperty.call(o,e)&&i.push(o[e]);return i}charCategorizer(e){return Vre(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:r,from:n,length:i}=this.doc.lineAt(e),s=this.charCategorizer(e),o=e-n,a=e-n;for(;o>0;){let l=Tn(r,o,!1);if(s(r.slice(l,o))!=Sr.Word)break;o=l}for(;a<i;){let l=Tn(r,a);if(s(r.slice(a,l))!=Sr.Word)break;a=l}return o==a?null:ce.range(o+n,a+n)}};Tr.allowMultipleSelections=m3;Tr.tabSize=Ne.define({combine:t=>t.length?t[0]:4});Tr.lineSeparator=OR;Tr.readOnly=BR;Tr.phrases=Ne.define({compare(t,e){let r=Object.keys(t),n=Object.keys(e);return r.length==n.length&&r.every(i=>t[i]==e[i])}});Tr.languageData=ER;Tr.changeFilter=LR;Tr.transactionFilter=DR;Tr.transactionExtender=IR;yf.reconfigure=kt.define();function oa(t,e,r={}){let n={};for(let i of t)for(let s of Object.keys(i)){let o=i[s],a=n[s];if(a===void 0)n[s]=o;else if(!(a===o||o===void 0))if(Object.hasOwnProperty.call(r,s))n[s]=r[s](a,o);else throw new Error("Config merge conflict for field "+s)}for(let i in e)n[i]===void 0&&(n[i]=e[i]);return n}class eu{eq(e){return this==e}range(e,r=e){return jm.create(e,r,this)}}eu.prototype.startSide=eu.prototype.endSide=0;eu.prototype.point=!1;eu.prototype.mapMode=Sn.TrackDel;class jm{constructor(e,r,n){this.from=e,this.to=r,this.value=n}static create(e,r,n){return new jm(e,r,n)}}function b3(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class H6{constructor(e,r,n,i){this.from=e,this.to=r,this.value=n,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,r,n,i=0){let s=n?this.to:this.from;for(let o=i,a=s.length;;){if(o==a)return o;let l=o+a>>1,c=s[l]-e||(n?this.value[l].endSide:this.value[l].startSide)-r;if(l==o)return c>=0?o:a;c>=0?a=l:o=l+1}}between(e,r,n,i){for(let s=this.findIndex(r,-1e9,!0),o=this.findIndex(n,1e9,!1,s);s<o;s++)if(i(this.from[s]+e,this.to[s]+e,this.value[s])===!1)return!1}map(e,r){let n=[],i=[],s=[],o=-1,a=-1;for(let l=0;l<this.value.length;l++){let c=this.value[l],h=this.from[l]+e,u=this.to[l]+e,d,f;if(h==u){let p=r.mapPos(h,c.startSide,c.mapMode);if(p==null||(d=f=p,c.startSide!=c.endSide&&(f=r.mapPos(h,c.endSide),f<d)))continue}else if(d=r.mapPos(h,c.startSide),f=r.mapPos(u,c.endSide),d>f||d==f&&c.startSide>0&&c.endSide<=0)continue;(f-d||c.endSide-c.startSide)<0||(o<0&&(o=d),c.point&&(a=Math.max(a,f-d)),n.push(c),i.push(d-o),s.push(f-o))}return{mapped:n.length?new H6(i,s,n,a):null,pos:o}}}class Ht{constructor(e,r,n,i){this.chunkPos=e,this.chunk=r,this.nextLayer=n,this.maxPoint=i}static create(e,r,n,i){return new Ht(e,r,n,i)}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 r of this.chunk)e+=r.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:r=[],sort:n=!1,filterFrom:i=0,filterTo:s=this.length}=e,o=e.filter;if(r.length==0&&!o)return this;if(n&&(r=r.slice().sort(b3)),this.isEmpty)return r.length?Ht.of(r):this;let a=new NR(this,null,-1).goto(0),l=0,c=[],h=new rl;for(;a.value||l<r.length;)if(l<r.length&&(a.from-r[l].from||a.startSide-r[l].value.startSide)>=0){let u=r[l++];h.addInner(u.from,u.to,u.value)||c.push(u)}else a.rangeIndex==1&&a.chunkIndex<this.chunk.length&&(l==r.length||this.chunkEnd(a.chunkIndex)<r[l].from)&&(!o||i>this.chunkEnd(a.chunkIndex)||s<this.chunkPos[a.chunkIndex])&&h.addChunk(this.chunkPos[a.chunkIndex],this.chunk[a.chunkIndex])?a.nextChunk():((!o||i>a.to||s<a.from||o(a.from,a.to,a.value))&&(h.addInner(a.from,a.to,a.value)||c.push(jm.create(a.from,a.to,a.value))),a.next());return h.finishInner(this.nextLayer.isEmpty&&!c.length?Ht.empty:this.nextLayer.update({add:c,filter:o,filterFrom:i,filterTo:s}))}map(e){if(e.empty||this.isEmpty)return this;let r=[],n=[],i=-1;for(let o=0;o<this.chunk.length;o++){let a=this.chunkPos[o],l=this.chunk[o],c=e.touchesRange(a,a+l.length);if(c===!1)i=Math.max(i,l.maxPoint),r.push(l),n.push(e.mapPos(a));else if(c===!0){let{mapped:h,pos:u}=l.map(a,e);h&&(i=Math.max(i,h.maxPoint),r.push(h),n.push(u))}}let s=this.nextLayer.map(e);return r.length==0?s:new Ht(n,r,s||Ht.empty,i)}between(e,r,n){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let s=this.chunkPos[i],o=this.chunk[i];if(r>=s&&e<=s+o.length&&o.between(s,e-s,r-s,n)===!1)return}this.nextLayer.between(e,r,n)}}iter(e=0){return Um.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,r=0){return Um.from(e).goto(r)}static compare(e,r,n,i,s=-1){let o=e.filter(u=>u.maxPoint>0||!u.isEmpty&&u.maxPoint>=s),a=r.filter(u=>u.maxPoint>0||!u.isEmpty&&u.maxPoint>=s),l=AM(o,a,n),c=new B0(o,l,s),h=new B0(a,l,s);n.iterGaps((u,d,f)=>EM(c,u,h,d,f,i)),n.empty&&n.length==0&&EM(c,0,h,0,0,i)}static eq(e,r,n=0,i){i==null&&(i=999999999);let s=e.filter(h=>!h.isEmpty&&r.indexOf(h)<0),o=r.filter(h=>!h.isEmpty&&e.indexOf(h)<0);if(s.length!=o.length)return!1;if(!s.length)return!0;let a=AM(s,o),l=new B0(s,a,0).goto(n),c=new B0(o,a,0).goto(n);for(;;){if(l.to!=c.to||!x3(l.active,c.active)||l.point&&(!c.point||!l.point.eq(c.point)))return!1;if(l.to>i)return!0;l.next(),c.next()}}static spans(e,r,n,i,s=-1){let o=new B0(e,null,s).goto(r),a=r,l=o.openStart;for(;;){let c=Math.min(o.to,n);if(o.point){let h=o.activeForPoint(o.to),u=o.pointFrom<r?h.length+1:o.point.startSide<0?h.length:Math.min(h.length,l);i.point(a,c,o.point,h,u,o.pointRank),l=Math.min(o.openEnd(c),h.length)}else c>a&&(i.span(a,c,o.active,l),l=o.openEnd(c));if(o.to>n)return l+(o.point&&o.to>n?1:0);a=o.to,o.next()}}static of(e,r=!1){let n=new rl;for(let i of e instanceof jm?[e]:r?Wre(e):e)n.add(i.from,i.to,i.value);return n.finish()}static join(e){if(!e.length)return Ht.empty;let r=e[e.length-1];for(let n=e.length-2;n>=0;n--)for(let i=e[n];i!=Ht.empty;i=i.nextLayer)r=new Ht(i.chunkPos,i.chunk,r,Math.max(i.maxPoint,r.maxPoint));return r}}Ht.empty=new Ht([],[],null,-1);function Wre(t){if(t.length>1)for(let e=t[0],r=1;r<t.length;r++){let n=t[r];if(b3(e,n)>0)return t.slice().sort(b3);e=n}return t}Ht.empty.nextLayer=Ht.empty;class rl{finishChunk(e){this.chunks.push(new H6(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,r,n){this.addInner(e,r,n)||(this.nextLayer||(this.nextLayer=new rl)).add(e,r,n)}addInner(e,r,n){let i=e-this.lastTo||n.startSide-this.last.endSide;if(i<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return i<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(r-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=r,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,r-e)),!0)}addChunk(e,r){if((e-this.lastTo||r.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,r.maxPoint),this.chunks.push(r),this.chunkPos.push(e);let n=r.value.length-1;return this.last=r.value[n],this.lastFrom=r.from[n]+e,this.lastTo=r.to[n]+e,!0}finish(){return this.finishInner(Ht.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let r=Ht.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,r}}function AM(t,e,r){let n=new Map;for(let s of t)for(let o=0;o<s.chunk.length;o++)s.chunk[o].maxPoint<=0&&n.set(s.chunk[o],s.chunkPos[o]);let i=new Set;for(let s of e)for(let o=0;o<s.chunk.length;o++){let a=n.get(s.chunk[o]);a!=null&&(r?r.mapPos(a):a)==s.chunkPos[o]&&!(r!=null&&r.touchesRange(a,a+s.chunk[o].length))&&i.add(s.chunk[o])}return i}class NR{constructor(e,r,n,i=0){this.layer=e,this.skip=r,this.minPoint=n,this.rank=i}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,r=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,r,!1),this}gotoInner(e,r,n){for(;this.chunkIndex<this.layer.chunk.length;){let i=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(i)||this.layer.chunkEnd(this.chunkIndex)<e||i.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}if(this.chunkIndex<this.layer.chunk.length){let i=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],r,!0);(!n||this.rangeIndex<i)&&this.setRangeIndex(i)}this.next()}forward(e,r){(this.to-e||this.endSide-r)<0&&this.gotoInner(e,r,!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],r=this.layer.chunk[this.chunkIndex],n=e+r.from[this.rangeIndex];if(this.from=n,this.to=e+r.to[this.rangeIndex],this.value=r.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 Um{constructor(e){this.heap=e}static from(e,r=null,n=-1){let i=[];for(let s=0;s<e.length;s++)for(let o=e[s];!o.isEmpty;o=o.nextLayer)o.maxPoint>=n&&i.push(new NR(o,r,n,s));return i.length==1?i[0]:new Um(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,r=-1e9){for(let n of this.heap)n.goto(e,r);for(let n=this.heap.length>>1;n>=0;n--)F4(this.heap,n);return this.next(),this}forward(e,r){for(let n of this.heap)n.forward(e,r);for(let n=this.heap.length>>1;n>=0;n--)F4(this.heap,n);(this.to-e||this.value.endSide-r)<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(),F4(this.heap,0)}}}function F4(t,e){for(let r=t[e];;){let n=(e<<1)+1;if(n>=t.length)break;let i=t[n];if(n+1<t.length&&i.compare(t[n+1])>=0&&(i=t[n+1],n++),r.compare(i)<0)break;t[n]=r,t[e]=i,e=n}}class B0{constructor(e,r,n){this.minPoint=n,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=Um.from(e,r,n)}goto(e,r=-1e9){return this.cursor.goto(e,r),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=r,this.openStart=-1,this.next(),this}forward(e,r){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-r)<0;)this.removeActive(this.minActive);this.cursor.forward(e,r)}removeActive(e){dy(this.active,e),dy(this.activeTo,e),dy(this.activeRank,e),this.minActive=OM(this.active,this.activeTo)}addActive(e){let r=0,{value:n,to:i,rank:s}=this.cursor;for(;r<this.activeRank.length&&(s-this.activeRank[r]||i-this.activeTo[r])>0;)r++;fy(this.active,r,n),fy(this.activeTo,r,i),fy(this.activeRank,r,s),e&&fy(e,r,this.cursor.from),this.minActive=OM(this.active,this.activeTo)}next(){let e=this.to,r=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),n&&dy(n,i)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(n),this.cursor.next();else if(r&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=s,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=s.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(n){this.openStart=0;for(let i=n.length-1;i>=0&&n[i]<e;i--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let r=[];for(let n=this.active.length-1;n>=0&&!(this.activeRank[n]<this.pointRank);n--)(this.activeTo[n]>e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&r.push(this.active[n]);return r.reverse()}openEnd(e){let r=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)r++;return r}}function EM(t,e,r,n,i,s){t.goto(e),r.goto(n);let o=n+i,a=n,l=n-e;for(;;){let c=t.to+l-r.to,h=c||t.endSide-r.endSide,u=h<0?t.to+l:r.to,d=Math.min(u,o);if(t.point||r.point?t.point&&r.point&&(t.point==r.point||t.point.eq(r.point))&&x3(t.activeForPoint(t.to),r.activeForPoint(r.to))||s.comparePoint(a,d,t.point,r.point):d>a&&!x3(t.active,r.active)&&s.compareRange(a,d,t.active,r.active),u>o)break;(c||t.openEnd!=r.openEnd)&&s.boundChange&&s.boundChange(u),a=u,h<=0&&t.next(),h>=0&&r.next()}}function x3(t,e){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!=e[r]&&!t[r].eq(e[r]))return!1;return!0}function dy(t,e){for(let r=e,n=t.length-1;r<n;r++)t[r]=t[r+1];t.pop()}function fy(t,e,r){for(let n=t.length-1;n>=e;n--)t[n+1]=t[n];t[e]=r}function OM(t,e){let r=-1,n=1e9;for(let i=0;i<e.length;i++)(e[i]-n||t[i].endSide-t[r].endSide)<0&&(r=i,n=e[i]);return r}function Kf(t,e,r=t.length){let n=0;for(let i=0;i<r&&i<t.length;)t.charCodeAt(i)==9?(n+=e-n%e,i++):(n++,i=Tn(t,i));return n}function v3(t,e,r,n){for(let i=0,s=0;;){if(s>=e)return i;if(i==t.length)break;s+=t.charCodeAt(i)==9?r-s%r:1,i=Tn(t,i)}return n===!0?-1:t.length}const w3="ͼ",LM=typeof Symbol>"u"?"__"+w3:Symbol.for(w3),k3=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),DM=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class dc{constructor(e,r){this.rules=[];let{finish:n}=r||{};function i(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function s(o,a,l,c){let h=[],u=/^@(\w+)\b/.exec(o[0]),d=u&&u[1]=="keyframes";if(u&&a==null)return l.push(o[0]+";");for(let f in a){let p=a[f];if(/&/.test(f))s(f.split(/,\s*/).map(m=>o.map(g=>m.replace(/&/,g))).reduce((m,g)=>m.concat(g)),p,l);else if(p&&typeof p=="object"){if(!u)throw new RangeError("The value of a property ("+f+") should be a primitive value.");s(i(f),p,h,d)}else p!=null&&h.push(f.replace(/_.*/,"").replace(/[A-Z]/g,m=>"-"+m.toLowerCase())+": "+p+";")}(h.length||d)&&l.push((n&&!u&&!c?o.map(n):o).join(", ")+" {"+h.join(" ")+"}")}for(let o in e)s(i(o),e[o],this.rules)}getRules(){return this.rules.join(`
38`)}static newName(){let e=DM[LM]||1;return DM[LM]=e+1,w3+e.toString(36)}static mount(e,r,n){let i=e[k3],s=n&&n.nonce;i?s&&i.setNonce(s):i=new jre(e,s),i.mount(Array.isArray(r)?r:[r],e)}}let IM=new Map;
38class jre{constructor(e,r){let n=e.ownerDocument||e,i=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let s=IM.get(n);if(s)return e[k3]=s;this.sheet=new i.CSSStyleSheet,IM.set(n,this)}else this.styleTag=n.createElement("style"),r&&this.styleTag.setAttribute("nonce",r);this.modules=[],e[k3]=this}mount(e,r){let n=this.sheet,i=0,s=0;for(let o=0;o<e.length;o++){let a=e[o],l=this.modules.indexOf(a);if(l<s&&l>-1&&(this.modules.splice(l,1),s--,l=-1),l==-1){if(this.modules.splice(s++,0,a),n)for(let c=0;c<a.rules.length;c++)n.insertRule(a.rules[c],i++)}else{for(;s<l;)i+=this.modules[s++].rules.length;i+=a.rules.length,s++}}if(n)r.adoptedStyleSheets.indexOf(this.sheet)<0&&(r.adoptedStyleSheets=[this.sheet,...r.adoptedStyleSheets]);else{let o="";for(let l=0;l<this.modules.length;l++)o+=this.modules[l].getRules()+`
39`;this.styleTag.textContent=o;let a=r.head||r;this.styleTag.parentNode!=a&&a.insertBefore(this.styleTag,a.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var nl={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:"'"},Gm={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Ure=typeof navigator<"u"&&/Mac/.test(navigator.platform),Gre=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var wn=0;wn<10;wn++)nl[48+wn]=nl[96+wn]=String(wn);for(var wn=1;wn<=24;wn++)nl[wn+111]="F"+wn;for(var wn=65;wn<=90;wn++)nl[wn]=String.fromCharCode(wn+32),Gm[wn]=String.fromCharCode(wn);for(var $4 in nl)Gm.hasOwnProperty($4)||(Gm[$4]=nl[$4]);function FR(t){var e=Ure&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||Gre&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",r=!e&&t.key||(t.shiftKey?Gm:nl)[t.keyCode]||t.key||"Unidentified";return r=="Esc"&&(r="Escape"),r=="Del"&&(r="Delete"),r=="Left"&&(r="ArrowLeft"),r=="Up"&&(r="ArrowUp"),r=="Right"&&(r="ArrowRight"),r=="Down"&&(r="ArrowDown"),r}function ir(){var t=arguments[0];typeof t=="string"&&(t=document.createElement(t));var e=1,r=arguments[1];if(r&&typeof r=="object"&&r.nodeType==null&&!Array.isArray(r)){for(var n in r)if(Object.prototype.hasOwnProperty.call(r,n)){var i=r[n];typeof i=="string"?t.setAttribute(n,i):i!=null&&(t[n]=i)}e++}for(;e<arguments.length;e++)$R(t,arguments[e]);return t}function $R(t,e){if(typeof e=="string")t.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)t.appendChild(e);else if(Array.isArray(e))for(var r=0;r<e.length;r++)$R(t,e[r]);else throw new RangeError("Unsupported child node: "+e)}function Km(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function C3(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function T2(t,e){if(!e.anchorNode)return!1;try{return C3(t,e.anchorNode)}catch{return!1}}function Ym(t){return t.nodeType==3?ru(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function em(t,e,r,n){return r?BM(t,e,r,n,-1)||BM(t,e,r,n,1):!1}function tu(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function Gb(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function BM(t,e,r,n,i){for(;;){if(t==r&&e==n)return!0;if(e==(i<0?0:Zo(t))){if(t.nodeName=="DIV")return!1;let s=t.parentNode;if(!s||s.nodeType!=1)return!1;e=tu(t)+(i<0?0:1),t=s}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=i<0?Zo(t):0}else return!1}}function Zo(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Fv(t,e){let r=e?t.left:t.right;return{left:r,right:r,top:t.top,bottom:t.bottom}}
vendor: 21,918 bytes, line 39
39function Kre(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function zR(t,e){let r=e.width/t.offsetWidth,n=e.height/t.offsetHeight;return(r>.995&&r<1.005||!isFinite(r)||Math.abs(e.width-t.offsetWidth)<1)&&(r=1),(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.height-t.offsetHeight)<1)&&(n=1),{scaleX:r,scaleY:n}}function Yre(t,e,r,n,i,s,o,a){let l=t.ownerDocument,c=l.defaultView||window;for(let h=t,u=!1;h&&!u;)if(h.nodeType==1){let d,f=h==l.body,p=1,m=1;if(f)d=Kre(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(h).position)&&(u=!0),h.scrollHeight<=h.clientHeight&&h.scrollWidth<=h.clientWidth){h=h.assignedSlot||h.parentNode;continue}let b=h.getBoundingClientRect();({scaleX:p,scaleY:m}=zR(h,b)),d={left:b.left,right:b.left+h.clientWidth*p,top:b.top,bottom:b.top+h.clientHeight*m}}let g=0,y=0;if(i=="nearest")e.top<d.top?(y=e.top-(d.top+o),r>0&&e.bottom>d.bottom+y&&(y=e.bottom-d.bottom+o)):e.bottom>d.bottom&&(y=e.bottom-d.bottom+o,r<0&&e.top-y<d.top&&(y=e.top-(d.top+o)));else{let b=e.bottom-e.top,x=d.bottom-d.top;y=(i=="center"&&b<=x?e.top+b/2-x/2:i=="start"||i=="center"&&r<0?e.top-o:e.bottom-x+o)-d.top}if(n=="nearest"?e.left<d.left?(g=e.left-(d.left+s),r>0&&e.right>d.right+g&&(g=e.right-d.right+s)):e.right>d.right&&(g=e.right-d.right+s,r<0&&e.left<d.left+g&&(g=e.left-(d.left+s))):g=(n=="center"?e.left+(e.right-e.left)/2-(d.right-d.left)/2:n=="start"==a?e.left-s:e.right-(d.right-d.left)+s)-d.left,g||y)if(f)c.scrollBy(g,y);else{let b=0,x=0;if(y){let S=h.scrollTop;h.scrollTop+=y/m,x=(h.scrollTop-S)*m}if(g){let S=h.scrollLeft;h.scrollLeft+=g/p,b=(h.scrollLeft-S)*p}e={left:e.left-b,top:e.top-x,right:e.right-b,bottom:e.bottom-x},b&&Math.abs(b-g)<1&&(n="nearest"),x&&Math.abs(x-y)<1&&(i="nearest")}if(f)break;(e.top<d.top||e.bottom>d.bottom||e.left<d.left||e.right>d.right)&&(e={left:Math.max(e.left,d.left),right:Math.min(e.right,d.right),top:Math.max(e.top,d.top),bottom:Math.min(e.bottom,d.bottom)}),h=h.assignedSlot||h.parentNode}else if(h.nodeType==11)h=h.host;else break}function Xre(t){let e=t.ownerDocument,r,n;for(let i=t.parentNode;i&&!(i==e.body||r&&n);)if(i.nodeType==1)!n&&i.scrollHeight>i.clientHeight&&(n=i),!r&&i.scrollWidth>i.clientWidth&&(r=i),i=i.assignedSlot||i.parentNode;else if(i.nodeType==11)i=i.host;else break;return{x:r,y:n}}class Jre{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:r,focusNode:n}=e;this.set(r,Math.min(e.anchorOffset,r?Zo(r):0),n,Math.min(e.focusOffset,n?Zo(n):0))}set(e,r,n,i){this.anchorNode=e,this.anchorOffset=r,this.focusNode=n,this.focusOffset=i}}let Hu=null;function HR(t){if(t.setActive)return t.setActive();if(Hu)return t.focus(Hu);let e=[];for(let r=t;r&&(e.push(r,r.scrollTop,r.scrollLeft),r!=r.ownerDocument);r=r.parentNode);if(t.focus(Hu==null?{get preventScroll(){return Hu={preventScroll:!0},!0}}:void 0),!Hu){Hu=!1;for(let r=0;r<e.length;){let n=e[r++],i=e[r++],s=e[r++];n.scrollTop!=i&&(n.scrollTop=i),n.scrollLeft!=s&&(n.scrollLeft=s)}}}let RM;function ru(t,e,r=e){let n=RM||(RM=document.createRange());return n.setEnd(t,r),n.setStart(t,e),n}function gd(t,e,r,n){let i={key:e,code:e,keyCode:r,which:r,cancelable:!0};n&&({altKey:i.altKey,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,metaKey:i.metaKey}=n);let s=new KeyboardEvent("keydown",i);s.synthetic=!0,t.dispatchEvent(s);let o=new KeyboardEvent("keyup",i);return o.synthetic=!0,t.dispatchEvent(o),s.defaultPrevented||o.defaultPrevented}function Zre(t){for(;t;){if(t&&(t.nodeType==9||t.nodeType==11&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}function qR(t){for(;t.attributes.length;)t.removeAttributeNode(t.attributes[0])}function Qre(t,e){let r=e.focusNode,n=e.focusOffset;if(!r||e.anchorNode!=r||e.anchorOffset!=n)return!1;for(n=Math.min(n,Zo(r));;)if(n){if(r.nodeType!=1)return!1;let i=r.childNodes[n-1];i.contentEditable=="false"?n--:(r=i,n=Zo(r))}else{if(r==t)return!0;n=tu(r),r=r.parentNode}}function VR(t){return t.scrollTop>Math.max(1,t.scrollHeight-t.clientHeight-4)}function WR(t,e){for(let r=t,n=e;;){if(r.nodeType==3&&n>0)return{node:r,offset:n};if(r.nodeType==1&&n>0){if(r.contentEditable=="false")return null;r=r.childNodes[n-1],n=Zo(r)}else if(r.parentNode&&!Gb(r))n=tu(r),r=r.parentNode;else return null}}function jR(t,e){for(let r=t,n=e;;){if(r.nodeType==3&&n<r.nodeValue.length)return{node:r,offset:n};if(r.nodeType==1&&n<r.childNodes.length){if(r.contentEditable=="false")return null;r=r.childNodes[n],n=0}else if(r.parentNode&&!Gb(r))n=tu(r)+1,r=r.parentNode;else return null}}class Pn{constructor(e,r,n=!0){this.node=e,this.offset=r,this.precise=n}static before(e,r){return new Pn(e.parentNode,tu(e),r)}static after(e,r){return new Pn(e.parentNode,tu(e)+1,r)}}const q6=[];class ar{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 r=this.posAtStart;for(let n of this.children){if(n==e)return r;r+=n.length+n.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}sync(e,r){if(this.flags&2){let n=this.dom,i=null,s;for(let o of this.children){if(o.flags&7){if(!o.dom&&(s=i?i.nextSibling:n.firstChild)){let a=ar.get(s);(!a||!a.parent&&a.canReuseDOM(o))&&o.reuseDOM(s)}o.sync(e,r),o.flags&=-8}if(s=i?i.nextSibling:n.firstChild,r&&!r.written&&r.node==n&&s!=o.dom&&(r.written=!0),o.dom.parentNode==n)for(;s&&s!=o.dom;)s=PM(s);else n.insertBefore(o.dom,s);i=o.dom}for(s=i?i.nextSibling:n.firstChild,s&&r&&r.node==n&&(r.written=!0);s;)s=PM(s)}else if(this.flags&1)for(let n of this.children)n.flags&7&&(n.sync(e,r),n.flags&=-8)}reuseDOM(e){}localPosFromDOM(e,r){let n;if(e==this.dom)n=this.dom.childNodes[r];else{let i=Zo(e)==0?0:r==0?-1:1;for(;;){let s=e.parentNode;if(s==this.dom)break;i==0&&s.firstChild!=s.lastChild&&(e==s.firstChild?i=-1:i=1),e=s}i<0?n=e:n=e.nextSibling}if(n==this.dom.firstChild)return 0;for(;n&&!ar.get(n);)n=n.nextSibling;if(!n)return this.length;for(let i=0,s=0;;i++){let o=this.children[i];if(o.dom==n)return s;s+=o.length+o.breakAfter}}domBoundsAround(e,r,n=0){let i=-1,s=-1,o=-1,a=-1;for(let l=0,c=n,h=n;l<this.children.length;l++){let u=this.children[l],d=c+u.length;if(c<e&&d>r)return u.domBoundsAround(e,r,c);if(d>=e&&i==-1&&(i=l,s=c),c>r&&u.dom.parentNode==this.dom){o=l,a=h;break}h=d,c=d+u.breakAfter}return{from:s,to:a<0?n+this.length:a,startDOM:(i?this.children[i-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o<this.children.length&&o>=0?this.children[o].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let r=this.parent;r;r=r.parent){if(e&&(r.flags|=2),r.flags&1)return;r.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 r=e.parent;if(!r)return e;e=r}}replaceChildren(e,r,n=q6){this.markDirty();for(let i=e;i<r;i++){let s=this.children[i];s.parent==this&&n.indexOf(s)<0&&s.destroy()}n.length<250?this.children.splice(e,r-e,...n):this.children=[].concat(this.children.slice(0,e),n,this.children.slice(r));for(let i=0;i<n.length;i++)n[i].setParent(this)}ignoreMutation(e){return!1}ignoreEvent(e){return!1}childCursor(e=this.length){return new UR(this.children,e,this.children.length)}childPos(e,r=1){return this.childCursor().findPos(e,r)}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,r,n,i,s,o){return!1}become(e){return!1}canReuseDOM(e){return e.constructor==this.constructor&&!((this.flags|e.flags)&8)}getSide(){return 0}destroy(){for(let e of this.children)e.parent==this&&e.destroy();this.parent=null}}ar.prototype.breakAfter=0;function PM(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class UR{constructor(e,r,n){this.children=e,this.pos=r,this.i=n,this.off=0}findPos(e,r=1){for(;;){if(e>this.pos||e==this.pos&&(r>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let n=this.children[--this.i];this.pos-=n.length+n.breakAfter}}}function GR(t,e,r,n,i,s,o,a,l){let{children:c}=t,h=c.length?c[e]:null,u=s.length?s[s.length-1]:null,d=u?u.breakAfter:o;if(!(e==n&&h&&!o&&!d&&s.length<2&&h.merge(r,i,s.length?u:null,r==0,a,l))){if(n<c.length){let f=c[n];f&&(i<f.length||f.breakAfter&&(u!=null&&u.breakAfter))?(e==n&&(f=f.split(i),i=0),!d&&u&&f.merge(0,i,u,!0,0,l)?s[s.length-1]=f:((i||f.children.length&&!f.children[0].length)&&f.merge(0,i,null,!1,0,l),s.push(f))):f!=null&&f.breakAfter&&(u?u.breakAfter=1:o=1),n++}for(h&&(h.breakAfter=o,r>0&&(!o&&s.length&&h.merge(r,h.length,s[0],!1,a,0)?h.breakAfter=s.shift().breakAfter:(r<h.length||h.children.length&&h.children[h.children.length-1].length==0)&&h.merge(r,h.length,null,!1,a,0),e++));e<n&&s.length;)if(c[n-1].become(s[s.length-1]))n--,s.pop(),l=s.length?0:a;else if(c[e].become(s[0]))e++,s.shift(),a=s.length?0:l;else break;!s.length&&e&&n<c.length&&!c[e-1].breakAfter&&c[n].merge(0,0,c[e-1],!1,a,l)&&e--,(e<n||s.length)&&t.replaceChildren(e,n,s)}}function KR(t,e,r,n,i,s){let o=t.childCursor(),{i:a,off:l}=o.findPos(r,1),{i:c,off:h}=o.findPos(e,-1),u=e-r;for(let d of n)u+=d.length;t.length+=u,GR(t,c,h,a,l,n,0,i,s)}let Ci=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},S3=typeof document<"u"?document:{documentElement:{style:{}}};const T3=/Edge\/(\d+)/.exec(Ci.userAgent),YR=/MSIE \d/.test(Ci.userAgent),_3=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ci.userAgent),$v=!!(YR||_3||T3),NM=!$v&&/gecko\/(\d+)/i.test(Ci.userAgent),z4=!$v&&/Chrome\/(\d+)/.exec(Ci.userAgent),FM="webkitFontSmoothing"in S3.documentElement.style,XR=!$v&&/Apple Computer/.test(Ci.vendor),$M=XR&&(/Mobile\/\w+/.test(Ci.userAgent)||Ci.maxTouchPoints>2);var Pe={mac:$M||/Mac/.test(Ci.platform),windows:/Win/.test(Ci.platform),linux:/Linux|X11/.test(Ci.platform),ie:$v,ie_version:YR?S3.documentMode||6:_3?+_3[1]:T3?+T3[1]:0,gecko:NM,gecko_version:NM?+(/Firefox\/(\d+)/.exec(Ci.userAgent)||[0,0])[1]:0,chrome:!!z4,chrome_version:z4?+z4[1]:0,ios:$M,android:/Android\b/.test(Ci.userAgent),webkit:FM,safari:XR,webkit_version:FM?+(/\bAppleWebKit\/(\d+)/.exec(Ci.userAgent)||[0,0])[1]:0,tabSize:S3.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const ene=256;class oo extends ar{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,r){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(r&&r.node==this.dom&&(r.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,r,n){return this.flags&8||n&&(!(n instanceof oo)||this.length-(r-e)+n.length>ene||n.flags&8)?!1:(this.text=this.text.slice(0,e)+(n?n.text:"")+this.text.slice(r),this.markDirty(),!0)}split(e){let r=new oo(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),r.flags|=this.flags&8,r}localPosFromDOM(e,r){return e==this.dom?r:r?this.text.length:0}domAtPos(e){return new Pn(this.dom,e)}domBoundsAround(e,r,n){return{from:n,to:n+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,r){return tne(this.dom,e,r)}}class il extends ar{constructor(e,r=[],n=0){super(),this.mark=e,this.children=r,this.length=n;for(let i of r)i.setParent(this)}setAttrs(e){if(qR(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let r in this.mark.attrs)e.setAttribute(r,this.mark.attrs[r]);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,r){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,r)}merge(e,r,n,i,s,o){return n&&(!(n instanceof il&&n.mark.eq(this.mark))||e&&s<=0||r<this.length&&o<=0)?!1:(KR(this,e,r,n?n.children.slice():[],s-1,o-1),this.markDirty(),!0)}split(e){let r=[],n=0,i=-1,s=0;for(let a of this.children){let l=n+a.length;l>e&&r.push(n<e?a.split(e-n):a),i<0&&n>=e&&(i=s),n=l,s++}let o=this.length-e;return this.length=e,i>-1&&(this.children.length=i,this.markDirty()),new il(this.mark,r,o)}domAtPos(e){return JR(this,e)}coordsAt(e,r){return QR(this,e,r)}}function tne(t,e,r){let n=t.nodeValue.length;e>n&&(e=n);let i=e,s=e,o=0;e==0&&r<0||e==n&&r>=0?Pe.chrome||Pe.gecko||(e?(i--,o=1):s<n&&(s++,o=-1)):r<0?i--:s<n&&s++;let a=ru(t,i,s).getClientRects();if(!a.length)return null;let l=a[(o?o<0:r>=0)?0:a.length-1];return Pe.safari&&!o&&l.width==0&&(l=Array.prototype.find.call(a,c=>c.width)||l),o?Fv(l,o<0):l||null}class Jl extends ar{static create(e,r,n){return new Jl(e,r,n)}constructor(e,r,n){super(),this.widget=e,this.length=r,this.side=n,this.prevWidget=null}split(e){let r=Jl.create(this.widget,this.length-e,this.side);return this.length-=e,r}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.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,r,n,i,s,o){return n&&(!(n instanceof Jl)||!this.widget.compare(n.widget)||e>0&&s<=0||r<this.length&&o<=0)?!1:(this.length=e+(n?n.length:0)+(this.length-r),!0)}become(e){return e instanceof Jl&&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 Wt.empty;let e=this;for(;e.parent;)e=e.parent;let{view:r}=e,n=r&&r.state.doc,i=this.posAtStart;return n?n.slice(i,i+this.length):Wt.empty}domAtPos(e){return(this.length?e==0:this.side>0)?Pn.before(this.dom):Pn.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,r){let n=this.widget.coordsAt(this.dom,e,r);if(n)return n;let i=this.dom.getClientRects(),s=null;if(!i.length)return null;let o=this.side?this.side<0:e>0;for(let a=o?i.length-1:0;s=i[a],!(e>0?a==0:a==i.length-1||s.top<s.bottom);a+=o?-1:1);return Fv(s,!o)}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 bf extends ar{constructor(e){super(),this.side=e}get length(){return 0}merge(){return!1}become(e){return e instanceof bf&&e.side==this.side}split(){return new bf(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?Pn.before(this.dom):Pn.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return Wt.empty}get isHidden(){return!0}}oo.prototype.children=Jl.prototype.children=bf.prototype.children=q6;function JR(t,e){let r=t.dom,{children:n}=t,i=0;for(let s=0;i<n.length;i++){let o=n[i],a=s+o.length;if(!(a==s&&o.getSide()<=0)){if(e>s&&e<a&&o.dom.parentNode==r)return o.domAtPos(e-s);if(e<=s)break;s=a}}for(let s=i;s>0;s--){let o=n[s-1];if(o.dom.parentNode==r)return o.domAtPos(o.length)}for(let s=i;s<n.length;s++){let o=n[s];if(o.dom.parentNode==r)return o.domAtPos(0)}return new Pn(r,0)}function ZR(t,e,r){let n,{children:i}=t;r>0&&e instanceof il&&i.length&&(n=i[i.length-1])instanceof il&&n.mark.eq(e.mark)?ZR(n,e.children[0],r-1):(i.push(e),e.setParent(t)),t.length+=e.length}function QR(t,e,r){let n=null,i=-1,s=null,o=-1;function a(c,h){for(let u=0,d=0;u<c.children.length&&d<=h;u++){let f=c.children[u],p=d+f.length;p>=h&&(f.children.length?a(f,h-d):(!s||s.isHidden&&(r>0||nne(s,f)))&&(p>h||d==p&&f.getSide()>0)?(s=f,o=h-d):(d<h||d==p&&f.getSide()<0&&!f.isHidden)&&(n=f,i=h-d)),d=p}}a(t,e);let l=(r<0?n:s)||n||s;return l?l.coordsAt(Math.max(0,l==n?i:o),r):rne(t)}function rne(t){let e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();let r=Ym(e);return r[r.length-1]||null}function nne(t,e){let r=t.coordsAt(0,1),n=e.coordsAt(0,1);return r&&n&&n.top<r.bottom}function M3(t,e){for(let r in t)r=="class"&&e.class?e.class+=" "+t.class:r=="style"&&e.style?e.style+=";"+t.style:e[r]=t[r];return e}const zM=Object.create(null);function Kb(t,e,r){if(t==e)return!0;t||(t=zM),e||(e=zM);let n=Object.keys(t),i=Object.keys(e);if(n.length-(r&&n.indexOf(r)>-1?1:0)!=i.length-(r&&i.indexOf(r)>-1?1:0))return!1;for(let s of n)if(s!=r&&(i.indexOf(s)==-1||t[s]!==e[s]))return!1;return!0}function A3(t,e,r){let n=!1;if(e)for(let i in e)r&&i in r||(n=!0,i=="style"?t.style.cssText="":t.removeAttribute(i));if(r)for(let i in r)e&&e[i]==r[i]||(n=!0,i=="style"?t.style.cssText=r[i]:t.setAttribute(i,r[i]));return n}function ine(t){let e=Object.create(null);for(let r=0;r<t.attributes.length;r++){let n=t.attributes[r];e[n.name]=n.value}return e}let gl=class{eq(e){return!1}updateDOM(e,r){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,r,n){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}};var ai=function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t}(ai||(ai={}));let st=class extends eu{constructor(e,r,n,i){super(),this.startSide=e,this.endSide=r,this.widget=n,this.spec=i}get heightRelevant(){return!1}static mark(e){return new m1(e)}static widget(e){let r=Math.max(-1e4,Math.min(1e4,e.side||0)),n=!!e.block;return r+=n&&!e.inlineOrder?r>0?3e8:-4e8:r>0?1e8:-1e8,new fc(e,r,r,n,e.widget||null,!1)}static replace(e){let r=!!e.block,n,i;if(e.isBlockGap)n=-5e8,i=4e8;else{let{start:s,end:o}=eP(e,r);n=(s?r?-3e8:-1:5e8)-1,i=(o?r?2e8:1:-6e8)+1}return new fc(e,n,i,r,e.widget||null,!0)}static line(e){return new g1(e)}static set(e,r=!1){return Ht.of(e,r)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}};st.none=Ht.empty;class m1 extends st{constructor(e){let{start:r,end:n}=eP(e);super(r?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var r,n;return this==e||e instanceof m1&&this.tagName==e.tagName&&(this.class||((r=this.attrs)===null||r===void 0?void 0:r.class))==(e.class||((n=e.attrs)===null||n===void 0?void 0:n.class))&&Kb(this.attrs,e.attrs,"class")}range(e,r=e){if(e>=r)throw new RangeError("Mark decorations may not be empty");return super.range(e,r)}}m1.prototype.point=!1;class g1 extends st{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof g1&&this.spec.class==e.spec.class&&Kb(this.spec.attributes,e.spec.attributes)}range(e,r=e){if(r!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,r)}}g1.prototype.mapMode=Sn.TrackBefore;g1.prototype.point=!0;class fc extends st{constructor(e,r,n,i,s,o){super(r,n,s,e),this.block=i,this.isReplace=o,this.mapMode=i?r<=0?Sn.TrackBefore:Sn.TrackAfter:Sn.TrackDel}get type(){return this.startSide!=this.endSide?ai.WidgetRange:this.startSide<=0?ai.WidgetBefore:ai.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof fc&&sne(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,r=e){if(this.isReplace&&(e>r||e==r&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&r!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,r)}}fc.prototype.point=!0;function eP(t,e=!1){let{inclusiveStart:r,inclusiveEnd:n}=t;return r==null&&(r=t.inclusive),n==null&&(n=t.inclusive),{start:r??e,end:n??e}}function sne(t,e){return t==e||!!(t&&e&&t.compare(e))}function _2(t,e,r,n=0){let i=r.length-1;i>=0&&r[i]+n>=t?r[i]=Math.max(r[i],e):r.push(t,e)}class Vr extends ar{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,r,n,i,s,o){if(n){if(!(n instanceof Vr))return!1;this.dom||n.transferDOM(this)}return i&&this.setDeco(n?n.attrs:null),KR(this,e,r,n?n.children.slice():[],s,o),!0}split(e){let r=new Vr;if(r.breakAfter=this.breakAfter,this.length==0)return r;let{i:n,off:i}=this.childPos(e);i&&(r.append(this.children[n].split(i),0),this.children[n].merge(i,this.children[n].length,null,!1,0,0),n++);for(let s=n;s<this.children.length;s++)r.append(this.children[s],0);for(;n>0&&this.children[n-1].length==0;)this.children[--n].destroy();return this.children.length=n,this.markDirty(),this.length=e,r}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){Kb(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,r){ZR(this,e,r)}addLineDeco(e){let r=e.spec.attributes,n=e.spec.class;r&&(this.attrs=M3(r,this.attrs||{})),n&&(this.attrs=M3({class:n},this.attrs||{}))}domAtPos(e){return JR(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,r){var n;this.dom?this.flags&4&&(qR(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="
39cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(A3(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,r);let i=this.dom.lastChild;for(;i&&ar.get(i)instanceof il;)i=i.lastChild;if(!i||!this.length||i.nodeName!="BR"&&((n=ar.get(i))===null||n===void 0?void 0:n.isEditable)==!1&&(!Pe.ios||!this.children.some(s=>s instanceof oo))){let s=document.createElement("BR");s.cmIgnore=!0,this.dom.appendChild(s)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,r;for(let n of this.children){if(!(n instanceof oo)||/[^ -~]/.test(n.text))return null;let i=Ym(n.dom);if(i.length!=1)return null;e+=i[0].width,r=i[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:r}:null}coordsAt(e,r){let n=QR(this,e,r);if(!this.children.length&&n&&this.parent){let{heightOracle:i}=this.parent.view.viewState,s=n.bottom-n.top;if(Math.abs(s-i.lineHeight)<2&&i.textHeight<s){let o=(s-i.textHeight)/2;return{top:n.top+o,bottom:n.bottom-o,left:n.left,right:n.left}}}return n}become(e){return e instanceof Vr&&this.children.length==0&&e.children.length==0&&Kb(this.attrs,e.attrs)&&this.breakAfter==e.breakAfter}covers(){return!0}static find(e,r){for(let n=0,i=0;n<e.children.length;n++){let s=e.children[n],o=i+s.length;if(o>=r){if(s instanceof Vr)return s;if(o>r)break}i=o+s.breakAfter}return null}}class Ya extends ar{constructor(e,r,n){super(),this.widget=e,this.length=r,this.deco=n,this.breakAfter=0,this.prevWidget=null}merge(e,r,n,i,s,o){return n&&(!(n instanceof Ya)||!this.widget.compare(n.widget)||e>0&&s<=0||r<this.length&&o<=0)?!1:(this.length=e+(n?n.length:0)+(this.length-r),!0)}domAtPos(e){return e==0?Pn.before(this.dom):Pn.after(this.dom,e==this.length)}split(e){let r=this.length-e;this.length=e;let n=new Ya(this.widget,r,this.deco);return n.breakAfter=this.breakAfter,n}get children(){return q6}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.widget.editable||(this.dom.contentEditable="false"))}get overrideDOMText(){return this.parent?this.parent.view.state.doc.slice(this.posAtStart,this.posAtEnd):Wt.empty}domBoundsAround(){return null}become(e){return e instanceof Ya&&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,r){let n=this.widget.coordsAt(this.dom,e,r);return n||(this.widget instanceof E3?null:Fv(this.dom.getBoundingClientRect(),this.length?e==0:r<=0))}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}covers(e){let{startSide:r,endSide:n}=this.deco;return r==n?!1:e<0?r<0:n>0}}class E3 extends gl{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class tm{constructor(e,r,n,i){this.doc=e,this.pos=r,this.end=n,this.disallowBlockEffectsFor=i,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=r}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 Ya&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new Vr),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(py(new bf(-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,!this.posCovered()&&!(e&&this.content.length&&this.content[this.content.length-1]instanceof Ya)&&this.getLine()}buildText(e,r,n){for(;e>0;){if(this.textOff==this.text.length){let{value:s,lineBreak:o,done:a}=this.cursor.next(this.skip);if(this.skip=0,a)throw new Error("Ran out of text content when drawing inline views");if(o){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=s,this.textOff=0}let i=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(r.slice(r.length-n)),this.getLine().append(py(new oo(this.text.slice(this.textOff,this.textOff+i)),r),n),this.atCursorPos=!0,this.textOff+=i,e-=i,n=0}}span(e,r,n,i){this.buildText(r-e,n,i),this.pos=r,this.openStart<0&&(this.openStart=i)}point(e,r,n,i,s,o){if(this.disallowBlockEffectsFor[o]&&n instanceof fc){if(n.block)throw new RangeError("Block decorations may not be specified via plugins");
vendor: 17,655 bytes, line 39
39if(r>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let a=r-e;if(n instanceof fc)if(n.block)n.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new Ya(n.widget||xf.block,a,n));else{let l=Jl.create(n.widget||xf.inline,a,a?0:n.startSide),c=this.atCursorPos&&!l.isEditable&&s<=i.length&&(e<r||n.startSide>0),h=!l.isEditable&&(e<r||s>i.length||n.startSide<=0),u=this.getLine();this.pendingBuffer==2&&!c&&!l.isEditable&&(this.pendingBuffer=0),this.flushBuffer(i),c&&(u.append(py(new bf(1),i),s),s=i.length+Math.max(0,s-i.length)),u.append(py(l,i),s),this.atCursorPos=h,this.pendingBuffer=h?e<r||s>i.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=i.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(n);a&&(this.textOff+a<=this.text.length?this.textOff+=a:(this.skip+=a-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=r),this.openStart<0&&(this.openStart=s)}static build(e,r,n,i,s){let o=new tm(e,r,n,s);return o.openEnd=Ht.spans(i,r,n,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}}function py(t,e){for(let r of e)t=new il(r,[t],t.length);return t}class xf extends gl{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}}xf.inline=new xf("span");xf.block=new xf("div");var vr=function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t}(vr||(vr={}));const nu=vr.LTR,V6=vr.RTL;function tP(t){let e=[];for(let r=0;r<t.length;r++)e.push(1<<+t[r]);return e}const one=tP("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),ane=tP("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),O3=Object.create(null),ko=[];for(let t of["()","[]","{}"]){let e=t.charCodeAt(0),r=t.charCodeAt(1);O3[e]=r,O3[r]=-e}function rP(t){return t<=247?one[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?ane[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1}const lne=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class Zl{get dir(){return this.level%2?V6:nu}constructor(e,r,n){this.from=e,this.to=r,this.level=n}side(e,r){return this.dir==r==e?this.to:this.from}forward(e,r){return e==(this.dir==r)}static find(e,r,n,i){let s=-1;for(let o=0;o<e.length;o++){let a=e[o];if(a.from<=r&&a.to>=r){if(a.level==n)return o;(s<0||(i!=0?i<0?a.from<r:a.to>r:e[s].level>a.level))&&(s=o)}}if(s<0)throw new RangeError("Index out of range");return s}}function nP(t,e){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++){let n=t[r],i=e[r];if(n.from!=i.from||n.to!=i.to||n.direction!=i.direction||!nP(n.inner,i.inner))return!1}return!0}const sr=[];function cne(t,e,r,n,i){for(let s=0;s<=n.length;s++){let o=s?n[s-1].to:e,a=s<n.length?n[s].from:r,l=s?256:i;for(let c=o,h=l,u=l;c<a;c++){let d=rP(t.charCodeAt(c));d==512?d=h:d==8&&u==4&&(d=16),sr[c]=d==4?2:d,d&7&&(u=d),h=d}for(let c=o,h=l,u=l;c<a;c++){let d=sr[c];if(d==128)c<a-1&&h==sr[c+1]&&h&24?d=sr[c]=h:sr[c]=256;else if(d==64){let f=c+1;for(;f<a&&sr[f]==64;)f++;let p=c&&h==8||f<r&&sr[f]==8?u==1?1:8:256;for(let m=c;m<f;m++)sr[m]=p;c=f-1}else d==8&&u==1&&(sr[c]=1);h=d,d&7&&(u=d)}}}function hne(t,e,r,n,i){let s=i==1?2:1;for(let o=0,a=0,l=0;o<=n.length;o++){let c=o?n[o-1].to:e,h=o<n.length?n[o].from:r;for(let u=c,d,f,p;u<h;u++)if(f=O3[d=t.charCodeAt(u)])if(f<0){for(let m=a-3;m>=0;m-=3)if(ko[m+1]==-f){let g=ko[m+2],y=g&2?i:g&4?g&1?s:i:0;y&&(sr[u]=sr[ko[m]]=y),a=m;break}}else{if(ko.length==189)break;ko[a++]=u,ko[a++]=d,ko[a++]=l}else if((p=sr[u])==2||p==1){let m=p==i;l=m?0:1;for(let g=a-3;g>=0;g-=3){let y=ko[g+2];if(y&2)break;if(m)ko[g+2]|=2;else{if(y&4)break;ko[g+2]|=4}}}}}function une(t,e,r,n){for(let i=0,s=n;i<=r.length;i++){let o=i?r[i-1].to:t,a=i<r.length?r[i].from:e;for(let l=o;l<a;){let c=sr[l];if(c==256){let h=l+1;for(;;)if(h==a){if(i==r.length)break;h=r[i++].to,a=i<r.length?r[i].from:e}else if(sr[h]==256)h++;else break;let u=s==1,d=(h<e?sr[h]:n)==1,f=u==d?u?1:2:n;for(let p=h,m=i,g=m?r[m-1].to:t;p>l;)p==g&&(p=r[--m].from,g=m?r[m-1].to:t),sr[--p]=f;l=h}else s=c,l++}}}function L3(t,e,r,n,i,s,o){let a=n%2?2:1;if(n%2==i%2)for(let l=e,c=0;l<r;){let h=!0,u=!1;if(c==s.length||l<s[c].from){let m=sr[l];m!=a&&(h=!1,u=m==16)}let d=!h&&a==1?[]:null,f=h?n:n+1,p=l;e:for(;;)if(c<s.length&&p==s[c].from){if(u)break e;let m=s[c];if(!h)for(let g=m.to,y=c+1;;){if(g==r)break e;if(y<s.length&&s[y].from==g)g=s[y++].to;else{if(sr[g]==a)break e;break}}if(c++,d)d.push(m);else{m.from>l&&o.push(new Zl(l,m.from,f));let g=m.direction==nu!=!(f%2);D3(t,g?n+1:n,i,m.inner,m.from,m.to,o),l=m.to}p=m.to}else{if(p==r||(h?sr[p]!=a:sr[p]==a))break;p++}d?L3(t,l,p,n+1,i,d,o):l<p&&o.push(new Zl(l,p,f)),l=p}else for(let l=r,c=s.length;l>e;){let h=!0,u=!1;if(!c||l>s[c-1].to){let m=sr[l-1];m!=a&&(h=!1,u=m==16)}let d=!h&&a==1?[]:null,f=h?n:n+1,p=l;e:for(;;)if(c&&p==s[c-1].to){if(u)break e;let m=s[--c];if(!h)for(let g=m.from,y=c;;){if(g==e)break e;if(y&&s[y-1].to==g)g=s[--y].from;else{if(sr[g-1]==a)break e;break}}if(d)d.push(m);else{m.to<l&&o.push(new Zl(m.to,l,f));let g=m.direction==nu!=!(f%2);D3(t,g?n+1:n,i,m.inner,m.from,m.to,o),l=m.from}p=m.from}else{if(p==e||(h?sr[p-1]!=a:sr[p-1]==a))break;p--}d?L3(t,p,l,n+1,i,d,o):p<l&&o.push(new Zl(p,l,f)),l=p}}function D3(t,e,r,n,i,s,o){let a=e%2?2:1;cne(t,i,s,n,a),hne(t,i,s,n,a),une(i,s,n,a),L3(t,i,s,e,r,n,o)}function dne(t,e,r){if(!t)return[new Zl(0,0,e==V6?1:0)];if(e==nu&&!r.length&&!lne.test(t))return iP(t.length);if(r.length)for(;t.length>sr.length;)sr[sr.length]=256;let n=[],i=e==nu?0:1;return D3(t,i,i,r,0,t.length,n),n}function iP(t){return[new Zl(0,t,0)]}let sP="";function fne(t,e,r,n,i){var s;let o=n.head-t.from,a=Zl.find(e,o,(s=n.bidiLevel)!==null&&s!==void 0?s:-1,n.assoc),l=e[a],c=l.side(i,r);if(o==c){let d=a+=i?1:-1;if(d<0||d>=e.length)return null;l=e[a=d],o=l.side(!i,r),c=l.side(i,r)}let h=Tn(t.text,o,l.forward(i,r));(h<l.from||h>l.to)&&(h=c),sP=t.text.slice(Math.min(o,h),Math.max(o,h));let u=a==(i?e.length-1:0)?null:e[a+(i?1:-1)];return u&&h==c&&u.level+(i?0:1)<l.level?ce.cursor(u.side(!i,r)+t.from,u.forward(i,r)?1:-1,u.level):ce.cursor(h+t.from,l.forward(i,r)?-1:1,l.level)}function pne(t,e,r){for(let n=e;n<r;n++){let i=rP(t.charCodeAt(n));if(i==1)return nu;if(i==2||i==4)return V6}return nu}const oP=Ne.define(),aP=Ne.define(),lP=Ne.define(),cP=Ne.define(),I3=Ne.define(),hP=Ne.define(),uP=Ne.define(),W6=Ne.define(),j6=Ne.define(),dP=Ne.define({combine:t=>t.some(e=>e)}),fP=Ne.define({combine:t=>t.some(e=>e)}),pP=Ne.define();class yd{constructor(e,r="nearest",n="nearest",i=5,s=5,o=!1){this.range=e,this.y=r,this.x=n,this.yMargin=i,this.xMargin=s,this.isSnapshot=o}map(e){return e.empty?this:new yd(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new yd(ce.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const my=kt.define({map:(t,e)=>t.map(e)}),mP=kt.define();function Mi(t,e,r){let n=t.facet(cP);n.length?n[0](e):window.onerror&&window.onerror(String(e),r,void 0,void 0,e)||(r?console.error(r+":",e):console.error(e))}const qa=Ne.define({combine:t=>t.length?t[0]:!0});let mne=0;const ud=Ne.define({combine(t){return t.filter((e,r)=>{for(let n=0;n<r;n++)if(t[n].plugin==e.plugin)return!1;return!0})}});class Kr{constructor(e,r,n,i,s){this.id=e,this.create=r,this.domEventHandlers=n,this.domEventObservers=i,this.baseExtensions=s(this),this.extension=this.baseExtensions.concat(ud.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(ud.of({plugin:this,arg:e}))}static define(e,r){const{eventHandlers:n,eventObservers:i,provide:s,decorations:o}=r||{};return new Kr(mne++,e,n,i,a=>{let l=[];return o&&l.push(Xm.of(c=>{let h=c.plugin(a);return h?o(h):st.none})),s&&l.push(s(a)),l})}static fromClass(e,r){return Kr.define((n,i)=>new e(n,i),r)}}class H4{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let r=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(r)}catch(n){if(Mi(r.state,n,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(r){Mi(e.state,r,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var r;if(!((r=this.value)===null||r===void 0)&&r.destroy)try{this.value.destroy()}catch(n){Mi(e.state,n,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const gP=Ne.define(),U6=Ne.define(),Xm=Ne.define(),yP=Ne.define(),zv=Ne.define(),bP=Ne.define();function HM(t,e){let r=t.state.facet(bP);if(!r.length)return r;let n=r.map(s=>s instanceof Function?s(t):s),i=[];return Ht.spans(n,e.from,e.to,{point(){},span(s,o,a,l){let c=s-e.from,h=o-e.from,u=i;for(let d=a.length-1;d>=0;d--,l--){let f=a[d].spec.bidiIsolate,p;if(f==null&&(f=pne(e.text,c,h)),l>0&&u.length&&(p=u[u.length-1]).to==c&&p.direction==f)p.to=h,u=p.inner;else{let m={from:c,to:h,direction:f,inner:[]};u.push(m),u=m.inner}}}}),i}const xP=Ne.define();function G6(t){let e=0,r=0,n=0,i=0;for(let s of t.state.facet(xP)){let o=s(t);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(r=Math.max(r,o.right)),o.top!=null&&(n=Math.max(n,o.top)),o.bottom!=null&&(i=Math.max(i,o.bottom)))}return{left:e,right:r,top:n,bottom:i}}const np=Ne.define();class _s{constructor(e,r,n,i){this.fromA=e,this.toA=r,this.fromB=n,this.toB=i}join(e){return new _s(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 r=e.length,n=this;for(;r>0;r--){let i=e[r-1];if(!(i.fromA>n.toA)){if(i.toA<n.fromA)break;n=n.join(i),e.splice(r-1,1)}}return e.splice(r,0,n),e}static extendWithRanges(e,r){if(r.length==0)return e;let n=[];for(let i=0,s=0,o=0,a=0;;i++){let l=i==e.length?null:e[i],c=o-a,h=l?l.fromB:1e9;for(;s<r.length&&r[s]<h;){let u=r[s],d=r[s+1],f=Math.max(a,u),p=Math.min(h,d);if(f<=p&&new _s(f+c,p+c,f,p).addToSet(n),d>h)break;s+=2}if(!l)return n;new _s(l.fromA,l.toA,l.fromB,l.toB).addToSet(n),o=l.toA,a=l.toB}}}class Yb{constructor(e,r,n){this.view=e,this.state=r,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=Zr.empty(this.startState.doc.length);for(let s of n)this.changes=this.changes.compose(s.changes);let i=[];this.changes.iterChangedRanges((s,o,a,l)=>i.push(new _s(s,o,a,l))),this.changedRanges=i}static create(e,r,n){return new Yb(e,r,n)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>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}}class qM extends ar{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=st.none,this.lastCompositionAfterCursor=!1,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 Vr],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new _s(0,0,0,e.state.doc.length)],0,null)}update(e){var r;let n=e.changedRanges;this.minWidth>0&&n.length&&(n.every(({fromA:c,toA:h})=>h<this.minWidthFrom||c>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),this.updateEditContextFormatting(e);let i=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((r=this.domChanged)===null||r===void 0)&&r.newSel?i=this.domChanged.newSel.head:!kne(e.changes,this.hasComposition)&&!e.selectionSet&&(i=e.state.selection.main.head));let s=i>-1?yne(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:c,to:h}=this.hasComposition;n=new _s(c,h,e.changes.mapPos(c,-1),e.changes.mapPos(h,1)).addToSet(n.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(Pe.ie||Pe.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,a=this.updateDeco(),l=vne(o,a,e.changes);return n=_s.extendWithRanges(n,l),!(this.flags&7)&&n.length==0?!1:(this.updateInner(n,e.startState.doc.length,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,r,n){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,r,n);let{observer:i}=this.view;i.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let o=Pe.chrome||Pe.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,o),this.flags&=-8,o&&(o.written||i.selectionRange.focusNode!=o.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(o=>o.flags&=-9);let s=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let o of this.children)o instanceof Ya&&o.widget instanceof E3&&s.push(o.dom);i.updateGaps(s)}updateChildren(e,r,n){let i=n?n.range.addToSet(e.slice()):e,s=this.childCursor(r);for(let o=i.length-1;;o--){let a=o>=0?i[o]:null;if(!a)break;let{fromA:l,toA:c,fromB:h,toB:u}=a,d,f,p,m;if(n&&n.range.fromB<u&&n.range.toB>h){let S=tm.build(this.view.state.doc,h,n.range.fromB,this.decorations,this.dynamicDecorationMap),k=tm.build(this.view.state.doc,n.range.toB,u,this.decorations,this.dynamicDecorationMap);f=S.breakAtStart,p=S.openStart,m=k.openEnd;let w=this.compositionView(n);k.breakAtStart?w.breakAfter=1:k.content.length&&w.merge(w.length,w.length,k.content[0],!1,k.openStart,0)&&(w.breakAfter=k.content[0].breakAfter,k.content.shift()),S.content.length&&w.merge(0,0,S.content[S.content.length-1],!0,0,S.openEnd)&&S.content.pop(),d=S.content.concat(w).concat(k.content)}else({content:d,breakAtStart:f,openStart:p,openEnd:m}=tm.build(this.view.state.doc,h,u,this.decorations,this.dynamicDecorationMap));let{i:g,off:y}=s.findPos(c,1),{i:b,off:x}=s.findPos(l,-1);GR(this,b,x,g,y,d,f,p,m)}n&&this.fixCompositionDOM(n)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let r of e.transactions)for(let n of r.effects)n.is(mP)&&(this.editContextFormatting=n.value)}compositionView(e){let r=new oo(e.text.nodeValue);r.flags|=8;for(let{deco:i}of e.marks)r=new il(i,[r],r.length);let n=new Vr;return n.append(r,0),n}fixCompositionDOM(e){let r=(s,o)=>{o.flags|=8|(o.children.some(l=>l.flags&7)?1:0),this.markedForComposition.add(o);let a=ar.get(s);a&&a!=o&&(a.dom=null),o.setDOM(s)},n=this.childPos(e.range.fromB,1),i=this.children[n.i];r(e.line,i);for(let s=e.marks.length-1;s>=-1;s--)n=i.childPos(n.off,1),i=i.children[n.i],r(s>=0?e.marks[s].node:e.text,i)}updateSelection(e=!1,r=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let n=this.view.root.activeElement,i=n==this.dom,s=!i&&!(this.view.state.facet(qa)||this.dom.tabIndex>-1)&&T2(this.dom,this.view.observer.selectionRange)&&!(n&&this.dom.contains(n));if(!(i||r||s))return;let o=this.forceSelection;this.forceSelection=!1;let a=this.view.state.selection.main,l=this.moveToLine(this.domAtPos(a.anchor)),c=a.empty?l:this.moveToLine(this.domAtPos(a.head));if(Pe.gecko&&a.empty&&!this.hasComposition&&gne(l)){let u=document.createTextNode("");this.view.observer.ignore(()=>l.node.insertBefore(u,l.node.childNodes[l.offset]||null)),l=c=new Pn(u,0),o=!0}let h=this.view.observer.selectionRange;(o||!h.focusNode||(!em(l.node,l.offset,h.anchorNode,h.anchorOffset)||!em(c.node,c.offset,h.focusNode,h.focusOffset))&&!this.suppressWidgetCursorChange(h,a))&&(this.view.observer.ignore(()=>{Pe.android&&Pe.chrome&&this.dom.contains(h.focusNode)&&wne(h.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let u=Km(this.view.root);if(u)if(a.empty){if(Pe.gecko){let d=bne(l.node,l.offset);if(d&&d!=3){let f=(d==1?WR:jR)(l.node,l.offset);f&&(l=new Pn(f.node,f.offset))}}u.collapse(l.node,l.offset),a.bidiLevel!=null&&u.caretBidiLevel!==void 0&&(u.caretBidiLevel=a.bidiLevel)}else if(u.extend){u.collapse(l.node,l.offset);try{u.extend(c.node,c.offset)}catch{}}else{let d=document.createRange();a.anchor>a.head&&([l,c]=[c,l]),d.setEnd(c.node,c.offset),d.setStart(l.node,l.offset),u.removeAllRanges(),u.addRange(d)}s&&this.view.root.activeElement==this.dom&&(this.dom.blur(),n&&n.focus())}),this.view.observer.setSelectionRange(l,c)),this.impreciseAnchor=l.precise?null:new Pn(h.anchorNode,h.anchorOffset),this.impreciseHead=c.precise?null:new Pn(h.focusNode,h.focusOffset)}suppressWidgetCursorChange(e,r){return this.hasComposition&&r.empty&&em(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==r.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}
vendor: 5,207 bytes, line 39
39=this,r=e.state.selection.main,n=Km(e.root),{anchorNode:i,anchorOffset:s}=e.observer.selectionRange;if(!n||!r.empty||!r.assoc||!n.modify)return;let o=Vr.find(this,r.head);if(!o)return;let a=o.posAtStart;if(r.head==a||r.head==a+o.length)return;let l=this.coordsAt(r.head,-1),c=this.coordsAt(r.head,1);if(!l||!c||l.bottom>c.top)return;let h=this.domAtPos(r.head+r.assoc);n.collapse(h.node,h.offset),n.modify("move",r.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let u=e.observer.selectionRange;e.docView.posFromDOM(u.anchorNode,u.anchorOffset)!=r.from&&n.collapse(i,s)}moveToLine(e){let r=this.dom,n;if(e.node!=r)return e;for(let i=e.offset;!n&&i<r.childNodes.length;i++){let s=ar.get(r.childNodes[i]);s instanceof Vr&&(n=s.domAtPos(0))}for(let i=e.offset-1;!n&&i>=0;i--){let s=ar.get(r.childNodes[i]);s instanceof Vr&&(n=s.domAtPos(s.length))}return n?new Pn(n.node,n.offset,!0):e}nearest(e){for(let r=e;r;){let n=ar.get(r);if(n&&n.rootView==this)return n;r=r.parentNode}return null}posFromDOM(e,r){let n=this.nearest(e);if(!n)throw new RangeError("Trying to find position for a DOM position outside of the document");return n.localPosFromDOM(e,r)+n.posAtStart}domAtPos(e){let{i:r,off:n}=this.childCursor().findPos(e,-1);for(;r<this.children.length-1;){let i=this.children[r];if(n<i.length||i instanceof Vr)break;r++,n=0}return this.children[r].domAtPos(n)}coordsAt(e,r){let n=null,i=0;for(let s=this.length,o=this.children.length-1;o>=0;o--){let a=this.children[o],l=s-a.breakAfter,c=l-a.length;if(l<e)break;if(c<=e&&(c<e||a.covers(-1))&&(l>e||a.covers(1))&&(!n||a instanceof Vr&&!(n instanceof Vr&&r>=0)))n=a,i=c;else if(n&&c==e&&l==e&&a instanceof Ya&&Math.abs(r)<2){if(a.deco.startSide<0)break;o&&(n=null)}s=c}return n?n.coordsAt(e-i,r):null}coordsForChar(e){let{i:r,off:n}=this.childPos(e,1),i=this.children[r];if(!(i instanceof Vr))return null;for(;i.children.length;){let{i:a,off:l}=i.childPos(n,1);for(;;a++){if(a==i.children.length)return null;if((i=i.children[a]).length)break}n=l}if(!(i instanceof oo))return null;let s=Tn(i.text,n);if(s==n)return null;let o=ru(i.dom,n,s).getClientRects();for(let a=0;a<o.length;a++){let l=o[a];if(a==o.length-1||l.top<l.bottom&&l.left<l.right)return l}return null}measureVisibleLineHeights(e){let r=[],{from:n,to:i}=e,s=this.view.contentDOM.clientWidth,o=s>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,l=this.view.textDirection==vr.LTR;for(let c=0,h=0;h<this.children.length;h++){let u=this.children[h],d=c+u.length;if(d>i)break;if(c>=n){let f=u.dom.getBoundingClientRect();if(r.push(f.height),o){let p=u.dom.lastChild,m=p?Ym(p):[];if(m.length){let g=m[m.length-1],y=l?g.right-f.left:f.right-g.left;y>a&&(a=y,this.minWidth=s,this.minWidthFrom=c,this.minWidthTo=d)}}}c=d+u.breakAfter}return r}textDirectionAt(e){let{i:r}=this.childPos(e,1);return getComputedStyle(this.children[r].dom).direction=="rtl"?vr.RTL:vr.LTR}measureTextSize(){for(let s of this.children)if(s instanceof Vr){let o=s.measureTextSize();if(o)return o}let e=document.createElement("div"),r,n,i;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 s=Ym(e.firstChild)[0];r=e.getBoundingClientRect().height,n=s?s.width/27:7,i=s?s.height:r,e.remove()}),{lineHeight:r,charWidth:n,textHeight:i}}childCursor(e=this.length){let r=this.children.length;return r&&(e-=this.children[--r].length),new UR(this.children,e,r)}computeBlockGapDeco(){let e=[],r=this.view.viewState;for(let n=0,i=0;;i++){let s=i==r.viewports.length?null:r.viewports[i],o=s?s.from-1:this.length;if(o>n){let a=(r.lineBlockAt(o).bottom-r.lineBlockAt(n).top)/this.view.scaleY;e.push(st.replace({widget:new E3(a),block:!0,inclusive:!0,isBlockGap:!0}).range(n,o))}if(!s)break;n=s.to+1}return st.set(e)}updateDeco(){let e=1,r=this.view.state.facet(Xm).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),n=!1,i=this.view.state.facet(yP).map((s,o)=>{let a=typeof s=="function";return a&&(n=!0),a?s(this.view):s});for(i.length&&(this.dynamicDecorationMap[e++]=n,r.push(Ht.join(i))),this.decorations=[this.editContextFormatting,...r,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;return this.decorations}scrollIntoView(e){if(e.isSnapshot){let c=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=c.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let c of this.view.state.facet(pP))try{if(c(this.view,e.range,e))return!0}catch(h){Mi(this.view.state,h,"scroll handler")}let{range:r}=e,n=this.coordsAt(r.head,r.empty?r.assoc:r.head>r.anchor?-1:1),i;if(!n)return;!r.empty&&(i=this.coordsAt(r.anchor,r.anchor>r.head?-1:1))&&(n={left:Math.min(n.left,i.left),top:Math.min(n.top,i.top),right:Math.max(n.right,i.right),bottom:Math.max(n.bottom,i.bottom)});let s=G6(this.view),o={left:n.left-s.left,top:n.top-s.top,right:n.right+s.right,bottom:n.bottom+s.bottom},{offsetWidth:a,offsetHeight:l}=this.view.scrollDOM;Yre(this.view.scrollDOM,o,r.head<r.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,a),-a),Math.max(Math.min(e.yM
vendor: 59,231 bytes, lines 39-41
39argin,l),-l),this.view.textDirection==vr.LTR)}}function gne(t){return t.node.nodeType==1&&t.node.firstChild&&(t.offset==0||t.node.childNodes[t.offset-1].contentEditable=="false")&&(t.offset==t.node.childNodes.length||t.node.childNodes[t.offset].contentEditable=="false")}function vP(t,e){let r=t.observer.selectionRange;if(!r.focusNode)return null;let n=WR(r.focusNode,r.focusOffset),i=jR(r.focusNode,r.focusOffset),s=n||i;if(i&&n&&i.node!=n.node){let a=ar.get(i.node);if(!a||a instanceof oo&&a.text!=i.node.nodeValue)s=i;else if(t.docView.lastCompositionAfterCursor){let l=ar.get(n.node);!l||l instanceof oo&&l.text!=n.node.nodeValue||(s=i)}}if(t.docView.lastCompositionAfterCursor=s!=n,!s)return null;let o=e-s.offset;return{from:o,to:o+s.node.nodeValue.length,node:s.node}}function yne(t,e,r){let n=vP(t,r);if(!n)return null;let{node:i,from:s,to:o}=n,a=i.nodeValue;if(/[\n\r]/.test(a)||t.state.doc.sliceString(n.from,n.to)!=a)return null;let l=e.invertedDesc,c=new _s(l.mapPos(s),l.mapPos(o),s,o),h=[];for(let u=i.parentNode;;u=u.parentNode){let d=ar.get(u);if(d instanceof il)h.push({node:u,deco:d.mark});else{if(d instanceof Vr||u.nodeName=="DIV"&&u.parentNode==t.contentDOM)return{range:c,text:i,marks:h,line:u};if(u!=t.contentDOM)h.push({node:u,deco:new m1({inclusive:!0,attributes:ine(u),tagName:u.tagName.toLowerCase()})});else return null}}}function bne(t,e){return t.nodeType!=1?0:(e&&t.childNodes[e-1].contentEditable=="false"?1:0)|(e<t.childNodes.length&&t.childNodes[e].contentEditable=="false"?2:0)}let xne=class{constructor(){this.changes=[]}compareRange(e,r){_2(e,r,this.changes)}comparePoint(e,r){_2(e,r,this.changes)}boundChange(e){_2(e,e,this.changes)}};function vne(t,e,r){let n=new xne;return Ht.compare(t,e,r,n),n.changes}function wne(t,e){for(let r=t;r&&r!=e;r=r.assignedSlot||r.parentNode)if(r.nodeType==1&&r.contentEditable=="false")return!0;return!1}function kne(t,e){let r=!1;return e&&t.iterChangedRanges((n,i)=>{n<e.to&&i>e.from&&(r=!0)}),r}function Cne(t,e,r=1){let n=t.charCategorizer(e),i=t.doc.lineAt(e),s=e-i.from;if(i.length==0)return ce.cursor(e);s==0?r=1:s==i.length&&(r=-1);let o=s,a=s;r<0?o=Tn(i.text,s,!1):a=Tn(i.text,s);let l=n(i.text.slice(o,a));for(;o>0;){let c=Tn(i.text,o,!1);if(n(i.text.slice(c,o))!=l)break;o=c}for(;a<i.length;){let c=Tn(i.text,a);if(n(i.text.slice(a,c))!=l)break;a=c}return ce.range(o+i.from,a+i.from)}function Sne(t,e){return e.left>t?e.left-t:Math.max(0,t-e.right)}function Tne(t,e){return e.top>t?e.top-t:Math.max(0,t-e.bottom)}function q4(t,e){return t.top<e.bottom-1&&t.bottom>e.top+1}function VM(t,e){return e<t.top?{top:e,left:t.left,right:t.right,bottom:t.bottom}:t}function WM(t,e){return e>t.bottom?{top:t.top,left:t.left,right:t.right,bottom:e}:t}function B3(t,e,r){let n,i,s,o,a=!1,l,c,h,u;for(let p=t.firstChild;p;p=p.nextSibling){let m=Ym(p);for(let g=0;g<m.length;g++){let y=m[g];i&&q4(i,y)&&(y=VM(WM(y,i.bottom),i.top));let b=Sne(e,y),x=Tne(r,y);if(b==0&&x==0)return p.nodeType==3?jM(p,e,r):B3(p,e,r);(!n||o>x||o==x&&s>b)&&(n=p,i=y,s=b,o=x,a=b?e<y.left?g>0:g<m.length-1:!0),b==0?r>y.bottom&&(!h||h.bottom<y.bottom)?(l=p,h=y):r<y.top&&(!u||u.top>y.top)&&(c=p,u=y):h&&q4(h,y)?h=WM(h,y.bottom):u&&q4(u,y)&&(u=VM(u,y.top))}}if(h&&h.bottom>=r?(n=l,i=h):u&&u.top<=r&&(n=c,i=u),!n)return{node:t,offset:0};let d=Math.max(i.left,Math.min(i.right,e));if(n.nodeType==3)return jM(n,d,r);if(a&&n.contentEditable!="false")return B3(n,d,r);let f=Array.prototype.indexOf.call(t.childNodes,n)+(e>=(i.left+i.right)/2?1:0);return{node:t,offset:f}}function jM(t,e,r){let n=t.nodeValue.length,i=-1,s=1e9,o=0;for(let a=0;a<n;a++){let l=ru(t,a,a+1).getClientRects();for(let c=0;c<l.length;c++){let h=l[c];if(h.top==h.bottom)continue;o||(o=e-h.left);let u=(h.top>r?h.top-r:r-h.bottom)-1;if(h.left-1<=e&&h.right+1>=e&&u<s){let d=e>=(h.left+h.right)/2,f=d;if((Pe.chrome||Pe.gecko)&&ru(t,a).getBoundingClientRect().left==h.right&&(f=!d),u<=0)return{node:t,offset:a+(f?1:0)};i=a+(f?1:0),s=u}}}return{node:t,offset:i>-1?i:o>0?t.nodeValue.length:0}}function wP(t,e,r,n=-1){var i,s;let o=t.contentDOM.getBoundingClientRect(),a=o.top+t.viewState.paddingTop,l,{docHeight:c}=t.viewState,{x:h,y:u}=e,d=u-a;if(d<0)return 0;if(d>c)return t.state.doc.length;for(let S=t.viewState.heightOracle.textHeight/2,k=!1;l=t.elementAtHeight(d),l.type!=ai.Text;)for(;d=n>0?l.bottom+S:l.top-S,!(d>=0&&d<=c);){if(k)return r?null:0;k=!0,n=-n}u=a+d;let f=l.from;if(f<t.viewport.from)return t.viewport.from==0?0:r?null:UM(t,o,l,h,u);if(f>t.viewport.to)return t.viewport.to==t.state.doc.length?t.state.doc.length:r?null:UM(t,o,l,h,u);let p=t.dom.ownerDocument,m=t.root.elementFromPoint?t.root:p,g=m.elementFromPoint(h,u);g&&!t.contentDOM.contains(g)&&(g=null),g||(h=Math.max(o.left+1,Math.min(o.right-1,h)),g=m.elementFromPoint(h,u),g&&!t.contentDOM.contains(g)&&(g=null));let y,b=-1;if(g&&((i=t.docView.nearest(g))===null||i===void 0?void 0:i.isEditable)!=!1){if(p.caretPositionFromPoint){let S=p.caretPositionFromPoint(h,u);S&&({offsetNode:y,offset:b}=S)}else if(p.caretRangeFromPoint){let S=p.caretRangeFromPoint(h,u);S&&({startContainer:y,startOffset:b}=S,(!t.contentDOM.contains(y)||Pe.safari&&_ne(y,b,h)||Pe.chrome&&Mne(y,b,h))&&(y=void 0))}y&&(b=Math.min(Zo(y),b))}if(!y||!t.docView.dom.contains(y)){let S=Vr.find(t.docView,f);if(!S)return d>l.top+l.height/2?l.to:l.from;({node:y,offset:b}=B3(S.dom,h,u))}let x=t.docView.nearest(y);if(!x)return null;if(x.isWidget&&((s=x.dom)===null||s===void 0?void 0:s.nodeType)==1){let S=x.dom.getBoundingClientRect();return e.y<S.top||e.y<=S.bottom&&e.x<=(S.left+S.right)/2?x.posAtStart:x.posAtEnd}else return x.localPosFromDOM(y,b)+x.posAtStart}function UM(t,e,r,n,i){let s=Math.round((n-e.left)*t.defaultCharacterWidth);if(t.lineWrapping&&r.height>t.defaultLineHeight*1.5){let a=t.viewState.heightOracle.textHeight,l=Math.floor((i-r.top-(t.defaultLineHeight-a)*.5)/a);s+=l*t.viewState.heightOracle.lineLength}let o=t.state.sliceDoc(r.from,r.to);return r.from+v3(o,s,t.state.tabSize)}function _ne(t,e,r){let n,i=t;if(t.nodeType!=3||e!=(n=t.nodeValue.length))return!1;for(;;){let s=i.nextSibling;if(s){if(s.nodeName=="BR")break;return!1}else{let o=i.parentNode;if(!o||o.nodeName=="DIV")break;i=o}}return ru(t,n-1,n).getBoundingClientRect().right>r}function Mne(t,e,r){if(e!=0)return!1;for(let i=t;;){let s=i.parentNode;if(!s||s.nodeType!=1||s.firstChild!=i)return!1;if(s.classList.contains("cm-line"))break;i=s}let n=t.nodeType==1?t.getBoundingClientRect():ru(t,0,Math.max(t.nodeValue.length,1)).getBoundingClientRect();return r-n.left>5}function R3(t,e,r){let n=t.lineBlockAt(e);if(Array.isArray(n.type)){let i;for(let s of n.type){if(s.from>e)break;if(!(s.to<e)){if(s.from<e&&s.to>e)return s;(!i||s.type==ai.Text&&(i.type!=s.type||(r<0?s.from<e:s.to>e)))&&(i=s)}}return i||n}return n}function Ane(t,e,r,n){let i=R3(t,e.head,e.assoc||-1),s=!n||i.type!=ai.Text||!(t.lineWrapping||i.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>i.from?e.head-1:e.head);if(s){let o=t.dom.getBoundingClientRect(),a=t.textDirectionAt(i.from),l=t.posAtCoords({x:r==(a==vr.LTR)?o.right-1:o.left+1,y:(s.top+s.bottom)/2});if(l!=null)return ce.cursor(l,r?-1:1)}return ce.cursor(r?i.to:i.from,r?-1:1)}function GM(t,e,r,n){let i=t.state.doc.lineAt(e.head),s=t.bidiSpans(i),o=t.textDirectionAt(i.from);for(let a=e,l=null;;){let c=fne(i,s,o,a,r),h=sP;if(!c){if(i.number==(r?t.state.doc.lines:1))return a;h=`
40`,i=t.state.doc.line(i.number+(r?1:-1)),s=t.bidiSpans(i),c=t.visualLineSide(i,!r)}if(l){if(!l(h))return a}else{if(!n)return c;l=n(h)}a=c}}function Ene(t,e,r){let n=t.state.charCategorizer(e),i=n(r);return s=>{let o=n(s);return i==Sr.Space&&(i=o),i==o}}function One(t,e,r,n){let i=e.head,s=r?1:-1;if(i==(r?t.state.doc.length:0))return ce.cursor(i,e.assoc);let o=e.goalColumn,a,l=t.contentDOM.getBoundingClientRect(),c=t.coordsAtPos(i,e.assoc||-1),h=t.documentTop;if(c)o==null&&(o=c.left-l.left),a=s<0?c.top:c.bottom;else{let f=t.viewState.lineBlockAt(i);o==null&&(o=Math.min(l.right-l.left,t.defaultCharacterWidth*(i-f.from))),a=(s<0?f.top:f.bottom)+h}let u=l.left+o,d=n??t.viewState.heightOracle.textHeight>>1;for(let f=0;;f+=10){let p=a+(d+f)*s,m=wP(t,{x:u,y:p},!1,s);if(p<l.top||p>l.bottom||(s<0?m<i:m>i)){let g=t.docView.coordsForChar(m),y=!g||p<g.top?-1:1;return ce.cursor(m,y,void 0,o)}}}function M2(t,e,r){for(;;){let n=0;for(let i of t)i.between(e-1,e+1,(s,o,a)=>{if(e>s&&e<o){let l=n||r||(e-s<o-e?-1:1);e=l<0?s:o,n=l}});if(!n)return e}}function kP(t,e){let r=null;for(let n=0;n<e.ranges.length;n++){let i=e.ranges[n],s=null;if(i.empty){let o=M2(t,i.from,0);o!=i.from&&(s=ce.cursor(o,-1))}else{let o=M2(t,i.from,-1),a=M2(t,i.to,1);(o!=i.from||a!=i.to)&&(s=ce.range(i.from==i.anchor?o:a,i.from==i.head?o:a))}s&&(r||(r=e.ranges.slice()),r[n]=s)}return r?ce.create(r,e.mainIndex):e}function V4(t,e,r){let n=M2(t.state.facet(zv).map(i=>i(t)),r.from,e.head>r.from?-1:1);return n==r.from?r:ce.cursor(n,n<r.from?1:-1)}const ip="ï¿¿";class Lne{constructor(e,r){this.points=e,this.text="",this.lineSeparator=r.facet(Tr.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=ip}readRange(e,r){if(!e)return this;let n=e.parentNode;for(let i=e;;){this.findPointBefore(n,i);let s=this.text.length;this.readNode(i);let o=i.nextSibling;if(o==r)break;let a=ar.get(i),l=ar.get(o);(a&&l?a.breakAfter:(a?a.breakAfter:Gb(i))||Gb(o)&&(i.nodeName!="BR"||i.cmIgnore)&&this.text.length>s)&&this.lineBreak(),i=o}return this.findPointBefore(n,r),this}readTextNode(e){let r=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,r.length));for(let n=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,o=1,a;if(this.lineSeparator?(s=r.indexOf(this.lineSeparator,n),o=this.lineSeparator.length):(a=i.exec(r))&&(s=a.index,o=a[0].length),this.append(r.slice(n,s<0?r.length:s)),s<0)break;if(this.lineBreak(),o>1)for(let l of this.points)l.node==e&&l.pos>this.text.length&&(l.pos-=o-1);n=s+o}}readNode(e){if(e.cmIgnore)return;let r=ar.get(e),n=r&&r.overrideDOMText;if(n!=null){this.findPointInside(e,n.length);for(let i=n.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.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,r){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==r&&(n.pos=this.text.length)}findPointInside(e,r){for(let n of this.points)(e.nodeType==3?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(Dne(e,n.node,n.offset)?r:0))}}function Dne(t,e,r){for(;;){if(!e||r<Zo(e))return!1;if(e==t)return!0;r=tu(e)+1,e=e.parentNode}}class KM{constructor(e,r){this.node=e,this.offset=r,this.pos=-1}}class Ine{constructor(e,r,n,i){this.typeOver=i,this.bounds=null,this.text="",this.domChanged=r>-1;let{impreciseHead:s,impreciseAnchor:o}=e.docView;if(e.state.readOnly&&r>-1)this.newSel=null;else if(r>-1&&(this.bounds=e.docView.domBoundsAround(r,n,0))){let a=s||o?[]:Pne(e),l=new Lne(a,e.state);l.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=l.text,this.newSel=Nne(a,this.bounds.from)}else{let a=e.observer.selectionRange,l=s&&s.node==a.focusNode&&s.offset==a.focusOffset||!C3(e.contentDOM,a.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(a.focusNode,a.focusOffset),c=o&&o.node==a.anchorNode&&o.offset==a.anchorOffset||!C3(e.contentDOM,a.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(a.anchorNode,a.anchorOffset),h=e.viewport;if((Pe.ios||Pe.chrome)&&e.state.selection.main.empty&&l!=c&&(h.from>0||h.to<e.state.doc.length)){let u=Math.min(l,c),d=Math.max(l,c),f=h.from-u,p=h.to-d;(f==0||f==1||u==0)&&(p==0||p==-1||d==e.state.doc.length)&&(l=0,c=e.state.doc.length)}this.newSel=ce.single(c,l)}}}function CP(t,e){let r,{newSel:n}=e,i=t.state.selection.main,s=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:a}=e.bounds,l=i.from,c=null;(s===8||Pe.android&&e.text.length<a-o)&&(l=i.to,c="end");let h=Rne(t.state.doc.sliceString(o,a,ip),e.text,l-o,c);h&&(Pe.chrome&&s==13&&h.toB==h.from+2&&e.text.slice(h.from,h.toB)==ip+ip&&h.toB--,r={from:o+h.from,to:o+h.toA,insert:Wt.of(e.text.slice(h.from,h.toB).split(ip))})}else n&&(!t.hasFocus&&t.state.facet(qa)||n.main.eq(i))&&(n=null);if(!r&&!n)return!1;if(!r&&e.typeOver&&!i.empty&&n&&n.main.empty?r={from:i.from,to:i.to,insert:t.state.doc.slice(i.from,i.to)}:(Pe.mac||Pe.android)&&r&&r.from==r.to&&r.from==i.head-1&&/^\. ?$/.test(r.insert.toString())&&t.contentDOM.getAttribute("autocorrect")=="off"?(n&&r.insert.length==2&&(n=ce.single(n.main.anchor-1,n.main.head-1)),r={from:r.from,to:r.to,insert:Wt.of([r.insert.toString().replace("."," ")])}):r&&r.from>=i.from&&r.to<=i.to&&(r.from!=i.from||r.to!=i.to)&&i.to-i.from-(r.to-r.from)<=4?r={from:i.from,to:i.to,insert:t.state.doc.slice(i.from,r.from).append(r.insert).append(t.state.doc.slice(r.to,i.to))}:Pe.chrome&&r&&r.from==r.to&&r.from==i.head&&r.insert.toString()==`
41 `&&t.lineWrapping&&(n&&(n=ce.single(n.main.anchor-1,n.main.head-1)),r={from:i.from,to:i.to,insert:Wt.of([" "])}),r)return K6(t,r,n,s);if(n&&!n.main.eq(i)){let o=!1,a="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(o=!0),a=t.inputState.lastSelectionOrigin,a=="select.pointer"&&(n=kP(t.state.facet(zv).map(l=>l(t)),n))),t.dispatch({selection:n,scrollIntoView:o,userEvent:a}),!0}else return!1}function K6(t,e,r,n=-1){if(Pe.ios&&t.inputState.flushIOSKey(e))return!0;let i=t.state.selection.main;if(Pe.android&&(e.to==i.to&&(e.from==i.from||e.from==i.from-1&&t.state.sliceDoc(e.from,i.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&gd(t.contentDOM,"Enter",13)||(e.from==i.from-1&&e.to==i.to&&e.insert.length==0||n==8&&e.insert.length<e.to-e.from&&e.to>i.head)&&gd(t.contentDOM,"Backspace",8)||e.from==i.from&&e.to==i.to+1&&e.insert.length==0&&gd(t.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let o,a=()=>o||(o=Bne(t,e,r));return t.state.facet(hP).some(l=>l(t,e.from,e.to,s,a))||t.dispatch(a()),!0}function Bne(t,e,r){let n,i=t.state,s=i.selection.main;if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!r||r.main.empty&&r.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let a=s.from<e.from?i.sliceDoc(s.from,e.from):"",l=s.to>e.to?i.sliceDoc(e.to,s.to):"";n=i.replaceSelection(t.state.toText(a+e.insert.sliceString(0,void 0,t.state.lineBreak)+l))}else{let a=i.changes(e),l=r&&r.main.to<=a.newLength?r.main:void 0;if(i.selection.ranges.length>1&&t.inputState.composing>=0&&e.to<=s.to&&e.to>=s.to-10){let c=t.state.sliceDoc(e.from,e.to),h,u=r&&vP(t,r.main.head);if(u){let p=e.insert.length-(e.to-e.from);h={from:u.from,to:u.to-p}}else h=t.state.doc.lineAt(s.head);let d=s.to-e.to,f=s.to-s.from;n=i.changeByRange(p=>{if(p.from==s.from&&p.to==s.to)return{changes:a,range:l||p.map(a)};let m=p.to-d,g=m-c.length;if(p.to-p.from!=f||t.state.sliceDoc(g,m)!=c||p.to>=h.from&&p.from<=h.to)return{range:p};let y=i.changes({from:g,to:m,insert:e.insert}),b=p.to-s.to;return{changes:y,range:l?ce.range(Math.max(0,l.anchor+b),Math.max(0,l.head+b)):p.map(y)}})}else n={changes:a,selection:l&&i.selection.replaceRange(l)}}let o="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,o+=".compose",t.inputState.compositionFirstChange&&(o+=".start",t.inputState.compositionFirstChange=!1)),i.update(n,{userEvent:o,scrollIntoView:!0})}function Rne(t,e,r,n){let i=Math.min(t.length,e.length),s=0;for(;s<i&&t.charCodeAt(s)==e.charCodeAt(s);)s++;if(s==i&&t.length==e.length)return null;let o=t.length,a=e.length;for(;o>0&&a>0&&t.charCodeAt(o-1)==e.charCodeAt(a-1);)o--,a--;if(n=="end"){let l=Math.max(0,s-Math.min(o,a));r-=o+l-s}if(o<s&&t.length<e.length){let l=r<=s&&r>=o?s-r:0;s-=l,a=s+(a-o),o=s}else if(a<s){let l=r<=s&&r>=a?s-r:0;s-=l,o=s+(o-a),a=s}return{from:s,toA:o,toB:a}}function Pne(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:r,anchorOffset:n,focusNode:i,focusOffset:s}=t.observer.selectionRange;return r&&(e.push(new KM(r,n)),(i!=r||s!=n)&&e.push(new KM(i,s))),e}function Nne(t,e){if(t.length==0)return null;let r=t[0].pos,n=t.length==2?t[1].pos:r;return r>-1&&n>-1?ce.single(r+e,n+e):null}let Fne=class{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.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=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.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,Pe.safari&&e.contentDOM.addEventListener("input",()=>null),Pe.gecko&&eie(e.contentDOM.ownerDocument)}handleEvent(e){!Une(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,r){let n=this.handlers[e];if(n){for(let i of n.observers)i(this.view,r);for(let i of n.handlers){if(r.defaultPrevented)break;if(i(this.view,r)){r.preventDefault();break}}}}ensureHandlers(e){let r=$ne(e),n=this.handlers,i=this.view.contentDOM;for(let s in r)if(s!="scroll"){let o=!r[s].handlers.length,a=n[s];a&&o!=!a.handlers.length&&(i.removeEventListener(s,this.handleEvent),a=null),a||i.addEventListener(s,this.handleEvent,{passive:o})}for(let s in n)s!="scroll"&&!r[s]&&i.removeEventListener(s,this.handleEvent);this.handlers=r}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&TP.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),Pe.android&&Pe.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let r;return Pe.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((r=SP.find(n=>n.keyCode==e.keyCode))&&!e.ctrlKey||zne.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=r||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let r=this.pendingIOSKey;return!r||r.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,gd(this.view.contentDOM,r.key,r.keyCode,r instanceof KeyboardEvent?r:void 0))}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:Pe.safari&&!Pe.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.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}};function YM(t,e){return(r,n)=>{try{return e.call(t,n,r)}catch(i){Mi(r.state,i)}}}function $ne(t){let e=Object.create(null);function r(n){return e[n]||(e[n]={observers:[],handlers:[]})}for(let n of t){let i=n.spec,s=i&&i.plugin.domEventHandlers,o=i&&i.plugin.domEventObservers;if(s)for(let a in s){let l=s[a];l&&r(a).handlers.push(YM(n.value,l))}if(o)for(let a in o){let l=o[a];l&&r(a).observers.push(YM(n.value,l))}}for(let n in ao)r(n).handlers.push(ao[n]);for(let n in Os)r(n).observers.push(Os[n]);return e}const SP=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],zne="dthko",TP=[16,17,18,20,91,92,224,225],gy=6;function yy(t){return Math.max(0,t)*.7+8}function Hne(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class qne{constructor(e,r,n,i){this.view=e,this.startEvent=r,this.style=n,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=r,this.scrollParents=Xre(e.contentDOM),this.atoms=e.state.facet(zv).map(o=>o(e));let s=e.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=r.shiftKey,this.multiple=e.state.facet(Tr.allowMultipleSelections)&&Vne(e,r),this.dragging=jne(e,r)&&AP(r)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&Hne(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let r=0,n=0,i=0,s=0,o=this.view.win.innerWidth,a=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:a}=this.scrollParents.y.getBoundingClientRect());let l=G6(this.view);e.clientX-l.left<=i+gy?r=-yy(i-e.clientX):e.clientX+l.right>=o-gy&&(r=yy(e.clientX-o)),e.clientY-l.top<=s+gy?n=-yy(s-e.clientY):e.clientY+l.bottom>=a-gy&&(n=yy(e.clientY-a)),this.setScrollSpeed(r,n)}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=this.view.inputState.draggedContent=null}setScrollSpeed(e,r){this.scrollSpeed={x:e,y:r},e||r?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:r}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),r&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=r,r=0),(e||r)&&this.view.win.scrollBy(e,r),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:r}=this,n=kP(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!n.eq(r.state.selection,this.dragging===!1))&&this.view.dispatch({selection:n,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(r=>r.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function Vne(t,e){let r=t.state.facet(oP);return r.length?r[0](e):Pe.mac?e.metaKey:e.ctrlKey}function Wne(t,e){let r=t.state.facet(aP);return r.length?r[0](e):Pe.mac?!e.altKey:!e.ctrlKey}function jne(t,e){let{main:r}=t.state.selection;if(r.empty)return!1;let n=Km(t.root);if(!n||n.rangeCount==0)return!0;let i=n.getRangeAt(0).getClientRects();for(let s=0;s<i.length;s++){let o=i[s];if(o.left<=e.clientX&&o.right>=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function Une(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let r=e.target,n;r!=t.contentDOM;r=r.parentNode)if(!r||r.nodeType==11||(n=ar.get(r))&&n.ignoreEvent(e))return!1;return!0}const ao=Object.create(null),Os=Object.create(null),_P=Pe.ie&&Pe.ie_version<15||Pe.ios&&Pe.webkit_version<604;function Gne(t){let e=t.dom.parentNode;if(!e)return;let r=e.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout(()=>{t.focus(),r.remove(),MP(t,r.value)},50)}function Hv(t,e,r){for(let n of t.facet(e))r=n(r,t);return r}function MP(t,e){e=Hv(t.state,W6,e);let{state:r}=t,n,i=1,s=r.toText(e),o=s.lines==r.selection.ranges.length;if(P3!=null&&r.selection.ranges.every(l=>l.empty)&&P3==s.toString()){let l=-1;n=r.changeByRange(c=>{let h=r.doc.lineAt(c.from);if(h.from==l)return{range:c};l=h.from;let u=r.toText((o?s.line(i++).text:e)+r.lineBreak);return{changes:{from:h.from,insert:u},range:ce.cursor(c.from+u.length)}})}else o?n=r.changeByRange(l=>{let c=s.line(i++);return{changes:{from:l.from,to:l.to,insert:c.text},range:ce.cursor(l.from+c.length)}}):n=r.replaceSelection(s);t.dispatch(n,{userEvent:"input.paste",scrollIntoView:!0})}Os.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft};ao.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);Os.touchstart=(t,e)=>{t.inputState.lastTouchTime=Date.now(),t.inputState.setSelectionOrigin("select.pointer")};Os.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};ao.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let r=null;for(let n of t.state.facet(lP))if(r=n(t,e),r)break;if(!r&&e.button==0&&(r=Xne(t,e)),r){let n=!t.hasFocus;t.inputState.startMouseSelection(new qne(t,e,r,n)),n&&t.observer.ignore(()=>{HR(t.contentDOM);let s=t.root.activeElement;s&&!s.contains(t.contentDOM)&&s.blur()});let i=t.inputState.mouseSelection;if(i)return i.start(e),i.dragging===!1}else t.inputState.setSelectionOrigin("select.pointer");return!1};function XM(t,e,r,n){if(n==1)return ce.cursor(e,r);if(n==2)return Cne(t.state,e,r);{let i=Vr.find(t.docView,e),s=t.state.doc.lineAt(i?i.posAtEnd:e),o=i?i.posAtStart:s.from,a=i?i.posAtEnd:s.to;return a<t.state.doc.length&&a==s.to&&a++,ce.range(o,a)}}let JM=(t,e,r)=>e>=r.top&&e<=r.bottom&&t>=r.left&&t<=r.right;function Kne(t,e,r,n){let i=Vr.find(t.docView,e);if(!i)return 1;let s=e-i.posAtStart;if(s==0)return 1;if(s==i.length)return-1;let o=i.coordsAt(s,-1);if(o&&JM(r,n,o))return-1;let a=i.coordsAt(s,1);return a&&JM(r,n,a)?1:o&&o.bottom>=n?-1:1}function ZM(t,e){let r=t.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:r,bias:Kne(t,r,e.clientX,e.clientY)}}const Yne=Pe.ie&&Pe.ie_version<=11;let QM=null,eA=0,tA=0;function AP(t){if(!Yne)return t.detail;let e=QM,r=tA;return QM=t,tA=Date.now(),eA=!e||r>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(eA+1)%3:1}function Xne(t,e){let r=ZM(t,e),n=AP(e),i=t.state.selection;return{update(s){s.docChanged&&(r.pos=s.changes.mapPos(r.pos),i=i.map(s.changes))},get(s,o,a){let l=ZM(t,s),c,h=XM(t,l.pos,l.bias,n);if(r.pos!=l.pos&&!o){let u=XM(t,r.pos,r.bias,n),d=Math.min(u.from,h.from),f=Math.max(u.to,h.to);h=d<h.from?ce.range(d,f):ce.range(f,d)}return o?i.replaceRange(i.main.extend(h.from,h.to)):a&&n==1&&i.ranges.length>1&&(c=Jne(i,l.pos))?c:a?i.addRange(h):ce.create([h])}}}function Jne(t,e){for(let r=0;r<t.ranges.length;r++){let{from:n,to:i}=t.ranges[r];if(n<=e&&i>=e)return ce.create(t.ranges.slice(0,r).concat(t.ranges.slice(r+1)),t.mainIndex==r?0:t.mainIndex-(t.mainIndex>r?1:0))}return null}ao.dragstart=(t,e)=>{let{selection:{main:r}}=t.state;if(e.target.draggable){let i=t.docView.nearest(e.target);if(i&&i.isWidget){let s=i.posAtStart,o=s+i.length;(s>=r.to||o<=r.from)&&(r=ce.range(s,o))}}let{inputState:n}=t;return n.mouseSelection&&(n.mouseSelection.dragging=!0),n.draggedContent=r,e.dataTransfer&&(e.dataTransfer.setData("Text",Hv(t.state,j6,t.state.sliceDoc(r.from,r.to))),e.dataTransfer.effectAllowed="copyMove"),!1};ao.dragend=t=>(t.inputState.draggedContent=null,!1);function rA(t,e,r,n){if(r=Hv(t.state,W6,r),!r)return;let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=t.inputState,o=n&&s&&Wne(t,e)?{from:s.from,to:s.to}:null,a={from:i,insert:r},l=t.state.changes(o?[o,a]:a);t.focus(),t.dispatch({changes:l,selection:{anchor:l.mapPos(i,-1),head:l.mapPos(i,1)},userEvent:o?"move.drop":"input.drop"}),t.inputState.draggedContent=null}ao.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let r=e.dataTransfer.files;if(r&&r.length){let n=Array(r.length),i=0,s=()=>{++i==r.length&&rA(t,e,n.filter(o=>o!=null).join(t.state.lineBreak),!1)};for(let o=0;o<r.length;o++){let a=new FileReader;a.onerror=s,a.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(a.result)||(n[o]=a.result),s()},a.readAsText(r[o])}return!0}else{let n=e.dataTransfer.getData("Text");if(n)return rA(t,e,n,!0),!0}return!1};ao.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let r=_P?null:e.clipboardData;return r?(MP(t,r.getData("text/plain")||r.getData("text/uri-list")),!0):(Gne(t),!1)};function Zne(t,e){let r=t.dom.parentNode;if(!r)return;let n=r.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.value=e,n.focus(),n.selectionEnd=e.length,n.selectionStart=0,setTimeout(()=>{n.remove(),t.focus()},50)}function Qne(t){let e=[],r=[],n=!1;for(let i of t.selection.ranges)i.empty||(e.push(t.sliceDoc(i.from,i.to)),r.push(i));if(!e.length){let i=-1;for(let{from:s}of t.selection.ranges){let o=t.doc.lineAt(s);o.number>i&&(e.push(o.text),r.push({from:o.from,to:Math.min(t.doc.length,o.to+1)})),i=o.number}n=!0}return{text:Hv(t,j6,e.join(t.lineBreak)),ranges:r,linewise:n}}let P3=null;ao.copy=ao.cut=(t,e)=>{let{text:r,ranges:n,linewise:i}=Qne(t.state);if(!r&&!i)return!1;P3=i?r:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:n,scrollIntoView:!0,userEvent:"delete.cut"});let s=_P?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",r),!0):(Zne(t,r),!1)};const EP=ml.define();function OP(t,e){let r=[];for(let n of t.facet(uP)){let i=n(t,e);i&&r.push(i)}return r.length?t.update({effects:r,annotations:EP.of(!0)}):null}function LP(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let r=OP(t.state,e);r?t.dispatch(r):t.update([])}},10)}Os.focus=t=>{t.inputState.lastFocusTime=Date.now(),!t.scrollDOM.scrollTop&&(t.inputState.lastScrollTop||t.inputState.lastScrollLeft)&&(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),LP(t)};Os.blur=t=>{t.observer.clearSelectionRange(),LP(t)};Os.compositionstart=Os.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};Os.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,Pe.chrome&&Pe.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};Os.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};ao.beforeinput=(t,e)=>{var r,n;if(e.inputType=="insertReplacementText"&&t.observer.editContext){let s=(r=e.dataTransfer)===null||r===void 0?void 0:r.getData("text/plain"),o=e.getTargetRanges();if(s&&o.length){let a=o[0],l=t.posAtDOM(a.startContainer,a.startOffset),c=t.posAtDOM(a.endContainer,a.endOffset);return K6(t,{from:l,to:c,insert:t.state.toText(s)},null),!0}}let i;if(Pe.chrome&&Pe.android&&(i=SP.find(s=>s.inputType==e.inputType))&&(t.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let s=((n=window.visualViewport)===null||n===void 0?void 0:n.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>s+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return Pe.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),Pe.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>Os.compositionend(t,e),20),!1};const nA=new Set;function eie(t){nA.has(t)||(nA.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const iA=["pre-wrap","normal","pre-line","break-spaces"];let vf=!1;function sA(){vf=!1}class tie{constructor(e){this.lineWrapping=e,this.doc=Wt.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,r){let n=this.doc.lineAt(r).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((r-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return iA.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let r=!1;for(let n=0;n<e.length;n++){let i=e[n];i<0?n++:this.heightSamples[Math.floor(i*10)]||(r=!0,this.heightSamples[Math.floor(i*10)]=!0)}return r}refresh(e,r,n,i,s,o){let a=iA.indexOf(e)>-1,l=Math.round(r)!=Math.round(this.lineHeight)||this.lineWrapping!=a;if(this.lineWrapping=a,this.lineHeight=r,this.charWidth=n,this.textHeight=i,this.lineLength=s,l){this.heightSamples={};for(let c=0;c<o.length;c++){let h=o[c];h<0?c++:this.heightSamples[Math.floor(h*10)]=!0}}return l}}class rie{constructor(e,r){this.from=e,this.heights=r,this.index=0}get more(){return this.index<this.heights.length}}class $o{constructor(e,r,n,i,s){this.from=e,this.length=r,this.top=n,this.height=i,this._content=s}get type(){return typeof this._content=="number"?ai.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 fc?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let r=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new $o(this.from,this.length+e.length,this.top,this.height+e.height,r)}}var xr=function(t){return t[t.ByPos=0]="ByPos",t[t.ByHeight=1]="ByHeight",t[t.ByPosNoHeight=2]="ByPosNoHeight",t}(xr||(xr={}));const A2=.001;class li{constructor(e,r,n=2){this.length=e,this.height=r,this.flags=n}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>A2&&(vf=!0),this.height=e)}replace(e,r,n){return li.of(n)}decomposeLeft(e,r){r.push(this)}decomposeRight(e,r){r.push(this)}applyChanges(e,r,n,i){let s=this,o=n.doc;for(let a=i.length-1;a>=0;a--){let{fromA:l,toA:c,fromB:h,toB:u}=i[a],d=s.lineAt(l,xr.ByPosNoHeight,n.setDoc(r),0,0),f=d.to>=c?d:s.lineAt(c,xr.ByPosNoHeight,n,0,0);for(u+=f.to-c,c=f.to;a>0&&d.from<=i[a-1].toA;)l=i[a-1].fromA,h=i[a-1].fromB,a--,l<d.from&&(d=s.lineAt(l,xr.ByPosNoHeight,n,0,0));h+=d.from-l,l=d.from;let p=Y6.build(n.setDoc(o),e,h,u);s=Xb(s,s.replace(l,c,p))}return s.updateHeight(n,0)}static empty(){return new Yi(0,0)}static of(e){if(e.length==1)return e[0];let r=0,n=e.length,i=0,s=0;for(;;)if(r==n)if(i>s*2){let a=e[r-1];a.break?e.splice(--r,1,a.left,null,a.right):e.splice(--r,1,a.left,a.right),n+=1+a.break,i-=a.size}else if(s>i*2){let a=e[n];a.break?e.splice(n,1,a.left,null,a.right):e.splice(n,1,a.left,a.right),n+=2+a.break,s-=a.size}else break;else if(i<s){let a=e[r++];a&&(i+=a.size)}else{let a=e[--n];a&&(s+=a.size)}let o=0;return e[r-1]==null?(o=1,r--):e[r]==null&&(o=1,n++),new nie(li.of(e.slice(0,r)),o,li.of(e.slice(n)))}}function Xb(t,e){return t==e?t:(t.constructor!=e.constructor&&(vf=!0),e)}li.prototype.size=1;class DP extends li{constructor(e,r,n){super(e,r),this.deco=n}blockAt(e,r,n,i){return new $o(i,this.length,n,this.height,this.deco||0)}lineAt(e,r,n,i,s){return this.blockAt(0,n,i,s)}forEachLine(e,r,n,i,s,o){e<=s+this.length&&r>=s&&o(this.blockAt(0,n,i,s))}updateHeight(e,r=0,n=!1,i){return i&&i.from<=r&&i.more&&this.setHeight(i.heights[i.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Yi extends DP{constructor(e,r){super(e,r,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,r,n,i){return new $o(i,this.length,n,this.height,this.breaks)}replace(e,r,n){let i=n[0];return n.length==1&&(i instanceof Yi||i instanceof vn&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof vn?i=new Yi(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):li.of(n)}updateHeight(e,r=0,n=!1,i){return i&&i.from<=r&&i.more?this.setHeight(i.heights[i.index++]):(n||this.outdated)&&this.setHeight(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 vn extends li{constructor(e){super(e,0)}heightMetrics(e,r){let n=e.doc.lineAt(r).number,i=e.doc.lineAt(r+this.length).number,s=i-n+1,o,a=0;if(e.lineWrapping){let l=Math.min(this.height,e.lineHeight*s);o=l/s,this.length>s+1&&(a=(this.height-l)/(this.length-s-1))}else o=this.height/s;return{firstLine:n,lastLine:i,perLine:o,perChar:a}}blockAt(e,r,n,i){let{firstLine:s,lastLine:o,perLine:a,perChar:l}=this.heightMetrics(r,i);if(r.lineWrapping){let c=i+(e<r.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length)),h=r.doc.lineAt(c),u=a+h.length*l,d=Math.max(n,e-u/2);return new $o(h.from,h.length,d,u,0)}else{let c=Math.max(0,Math.min(o-s,Math.floor((e-n)/a))),{from:h,length:u}=r.doc.line(s+c);return new $o(h,u,n+a*c,a,0)}}lineAt(e,r,n,i,s){if(r==xr.ByHeight)return this.blockAt(e,n,i,s);if(r==xr.ByPosNoHeight){let{from:f,to:p}=n.doc.lineAt(e);return new $o(f,p-f,0,0,0)}let{firstLine:o,perLine:a,perChar:l}=this.heightMetrics(n,s),c=n.doc.lineAt(e),h=a+c.length*l,u=c.number-o,d=i+a*u+l*(c.from-s-u);return new $o(c.from,c.length,Math.max(i,Math.min(d,i+this.height-h)),h,0)}forEachLine(e,r,n,i,s,o){e=Math.max(e,s),r=Math.min(r,s+this.length);let{firstLine:a,perLine:l,perChar:c}=this.heightMetrics(n,s);for(let h=e,u=i;h<=r;){let d=n.doc.lineAt(h);if(h==e){let p=d.number-a;u+=l*p+c*(e-s-p)}let f=l+c*d.length;o(new $o(d.from,d.length,u,f,0)),u+=f,h=d.to+1}}replace(e,r,n){let i=this.length-r;if(i>0){let s=n[n.length-1];s instanceof vn?n[n.length-1]=new vn(s.length+i):n.push(null,new vn(i-1))}if(e>0){let s=n[0];s instanceof vn?n[0]=new vn(e+s.length):n.unshift(new vn(e-1),null)}return li.of(n)}decomposeLeft(e,r){r.push(new vn(e-1),null)}decomposeRight(e,r){r.push(null,new vn(this.length-e-1))}updateHeight(e,r=0,n=!1,i){let s=r+this.length;if(i&&i.from<=r+this.length&&i.more){let o=[],a=Math.max(r,i.from),l=-1;for(i.from>r&&o.push(new vn(i.from-r-1).updateHeight(e,r));a<=s&&i.more;){let h=e.doc.lineAt(a).length;o.length&&o.push(null);let u=i.heights[i.index++];l==-1?l=u:Math.abs(u-l)>=A2&&(l=-2);let d=new Yi(h,u);d.outdated=!1,o.push(d),a+=h+1}a<=s&&o.push(null,new vn(s-a).updateHeight(e,a));let c=li.of(o);return(l<0||Math.abs(c.height-this.height)>=A2||Math.abs(l-this.heightMetrics(e,r).perLine)>=A2)&&(vf=!0),Xb(this,c)}else(n||this.outdated)&&(this.setHeight(e.heightForGap(r,r+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class nie extends li{constructor(e,r,n){super(e.length+r+n.length,e.height+n.height,r|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return this.flags&1}blockAt(e,r,n,i){let s=n+this.left.height;return e<s?this.left.blockAt(e,r,n,i):this.right.blockAt(e,r,s,i+this.left.length+this.break)}lineAt(e,r,n,i,s){let o=i+this.left.height,a=s+this.left.length+this.break,l=r==xr.ByHeight?e<o:e<a,c=l?this.left.lineAt(e,r,n,i,s):this.right.lineAt(e,r,n,o,a);if(this.break||(l?c.to<a:c.from>a))return c;let h=r==xr.ByPosNoHeight?xr.ByPosNoHeight:xr.ByPos;return l?c.join(this.right.lineAt(a,h,n,o,a)):this.left.lineAt(a,h,n,i,s).join(c)}forEachLine(e,r,n,i,s,o){let a=i+this.left.height,l=s+this.left.length+this.break;if(this.break)e<l&&this.left.forEachLine(e,r,n,i,s,o),r>=l&&this.right.forEachLine(e,r,n,a,l,o);else{let c=this.lineAt(l,xr.ByPos,n,i,s);e<c.from&&this.left.forEachLine(e,c.from-1,n,i,s,o),c.to>=e&&c.from<=r&&o(c),r>c.to&&this.right.forEachLine(c.to+1,r,n,a,l,o)}}replace(e,r,n){let i=this.left.length+this.break;if(r<i)return this.balanced(this.left.replace(e,r,n),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-i,r-i,n));let s=[];e>0&&this.decomposeLeft(e,s);let o=s.length;for(let a of n)s.push(a);if(e>0&&oA(s,o-1),r<this.length){let a=s.length;this.decomposeRight(r,s),oA(s,a)}return li.of(s)}decomposeLeft(e,r){let n=this.left.length;if(e<=n)return this.left.decomposeLeft(e,r);r.push(this.left),this.break&&(n++,e>=n&&r.push(null)),e>n&&this.right.decomposeLeft(e-n,r)}decomposeRight(e,r){let n=this.left.length,i=n+this.break;if(e>=i)return this.right.decomposeRight(e-i,r);e<n&&this.left.decomposeRight(e,r),this.break&&e<i&&r.push(null),r.push(this.right)}balanced(e,r){return e.size>2*r.size||r.size>2*e.size?li.of(this.break?[e,null,r]:[e,r]):(this.left=Xb(this.left,e),this.right=Xb(this.right,r),this.setHeight(e.height+r.height),this.outdated=e.outdated||r.outdated,this.size=e.size+r.size,this.length=e.length+this.break+r.length,this)}updateHeight(e,r=0,n=!1,i){let{left:s,right:o}=this,a=r+s.length+this.break,l=null;return i&&i.from<=r+s.length&&i.more?l=s=s.updateHeight(e,r,n,i):s.updateHeight(e,r,n),i&&i.from<=a+o.length&&i.more?l=o=o.updateHeight(e,a,n,i):o.updateHeight(e,a,n),l?this.balanced(s,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function oA(t,e){let r,n;t[e]==null&&(r=t[e-1])instanceof vn&&(n=t[e+1])instanceof vn&&t.splice(e-1,3,new vn(r.length+1+n.length))}const iie=5;class Y6{constructor(e,r){this.pos=e,this.oracle=r,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,r){if(this.lineStart>-1){let n=Math.min(r,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof Yi?i.length+=n-this.pos:(n>this.pos||!this.isCovered)&&this.nodes.push(new Yi(n-this.pos,-1)),this.writtenTo=n,r>n&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=r}point(e,r,n){if(e<r||n.heightRelevant){let i=n.widget?n.widget.estimatedHeight:0,s=n.widget?n.widget.lineBreaks:0;i<0&&(i=this.oracle.lineHeight);let o=r-e;n.block?this.addBlock(new DP(o,i,n)):(o||s||i>=iie)&&this.addLineDeco(i,s,o)}else r>e&&this.span(e,r);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:r}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=r,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 Yi(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,r){let n=new vn(r-e);return this.oracle.doc.lineAt(e).to==r&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Yi)return e;let r=new Yi(0,-1);return this.nodes.push(r),r}addBlock(e){this.enterLine();let r=e.deco;r&&r.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,r&&r.endSide>0&&(this.covering=e)}addLineDeco(e,r,n){let i=this.ensureLine();i.length+=n,i.collapsed+=n,i.widgetHeight=Math.max(i.widgetHeight,e),i.breaks+=r,this.writtenTo=this.pos=this.pos+n}finish(e){let r=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(r instanceof Yi)&&!this.isCovered?this.nodes.push(new Yi(0,-1)):(this.writtenTo<this.pos||r==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let n=e;for(let i of this.nodes)i instanceof Yi&&i.updateHeight(this.oracle,n),n+=i?i.length:1;return this.nodes}static build(e,r,n,i){let s=new Y6(n,e);return Ht.spans(r,n,i,s,0),s.finish(n)}}function sie(t,e,r){let n=new oie;return Ht.compare(t,e,r,n,0),n.changes}class oie{constructor(){this.changes=[]}compareRange(){}comparePoint(e,r,n,i){(e<r||n&&n.heightRelevant||i&&i.heightRelevant)&&_2(e,r,this.changes,5)}}function aie(t,e){let r=t.getBoundingClientRect(),n=t.ownerDocument,i=n.defaultView||window,s=Math.max(0,r.left),o=Math.min(i.innerWidth,r.right),a=Math.max(0,r.top),l=Math.min(i.innerHeight,r.bottom);for(let c=t.parentNode;c&&c!=n.body;)if(c.nodeType==1){let h=c,u=window.getComputedStyle(h);if((h.scrollHeight>h.clientHeight||h.scrollWidth>h.clientWidth)&&u.overflow!="visible"){let d=h.getBoundingClientRect();s=Math.max(s,d.left),o=Math.min(o,d.right),a=Math.max(a,d.top),l=Math.min(c==t.parentNode?i.innerHeight:l,d.bottom)}c=u.position=="absolute"||u.position=="fixed"?h.offsetParent:h.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:s-r.left,right:Math.max(s,o)-r.left,top:a-(r.top+e),bottom:Math.max(a,l)-(r.top+e)}}function lie(t){let e=t.getBoundingClientRect(),r=t.ownerDocument.defaultView||window;return e.left<r.innerWidth&&e.right>0&&e.top<r.innerHeight&&e.bottom>0}function cie(t,e){let r=t.getBoundingClientRect();return{left:0,right:r.right-r.left,top:e,bottom:r.bottom-(r.top+e)}}class W4{constructor(e,r,n,i){this.from=e,this.to=r,this.size=n,this.displaySize=i}static same(e,r){if(e.length!=r.length)return!1;for(let n=0;n<e.length;n++){let i=e[n],s=r[n];if(i.from!=s.from||i.to!=s.to||i.size!=s.size)return!1}return!0}draw(e,r){return st.replace({widget:new hie(this.displaySize*(r?e.scaleY:e.scaleX),r)}).range(this.from,this.to)}}class hie extends gl{constructor(e,r){super(),this.size=e,this.vertical=r}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 aA{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=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=lA,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=vr.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let r=e.facet(U6).some(n=>typeof n!="function"&&n.class=="cm-lineWrapping");this.heightOracle=new tie(r),this.stateDeco=e.facet(Xm).filter(n=>typeof n!="function"),this.heightMap=li.empty().applyChanges(this.stateDeco,Wt.empty,this.heightOracle.setDoc(e.doc),[new _s(0,0,0,e.doc.length)]);for(let n=0;n<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());n++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=st.set(this.lineGaps.map(n=>n.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:r}=this.state.selection;for(let n=0;n<=1;n++){let i=n?r.head:r.anchor;if(!e.some(({from:s,to:o})=>i>=s&&i<=o)){let{from:s,to:o}=this.lineBlockAt(i);e.push(new by(s,o))}}return this.viewports=e.sort((n,i)=>n.from-i.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?lA:new X6(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(sp(e,this.scaler))})}update(e,r=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=this.state.facet(Xm).filter(h=>typeof h!="function");let i=e.changedRanges,s=_s.extendWithRanges(i,sie(n,this.stateDeco,e?e.changes:Zr.empty(this.state.doc.length))),o=this.heightMap.height,a=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);sA(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=o||vf)&&(e.flags|=2),a?(this.scrollAnchorPos=e.changes.mapPos(a.from,-1),this.scrollAnchorHeight=a.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let l=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(r&&(r.range.head<l.from||r.range.head>l.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,r));let c=l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,e.flags|=this.updateForViewport(),(c||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),r&&(this.scrollTarget=r),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(fP)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let r=e.contentDOM,n=window.getComputedStyle(r),i=this.heightOracle,s=n.whiteSpace;this.defaultTextDirection=n.direction=="rtl"?vr.RTL:vr.LTR;let o=this.heightOracle.mustRefreshForWrapping(s),a=r.getBoundingClientRect(),l=o||this.mustMeasureContent||this.contentDOMHeight!=a.height;this.contentDOMHeight=a.height,this.mustMeasureContent=!1;let c=0,h=0;if(a.width&&a.height){let{scaleX:S,scaleY:k}=zR(r,a);(S>.005&&Math.abs(this.scaleX-S)>.005||k>.005&&Math.abs(this.scaleY-k)>.005)&&(this.scaleX=S,this.scaleY=k,c|=16,o=l=!0)}let u=(parseInt(n.paddingTop)||0)*this.scaleY,d=(parseInt(n.paddingBottom)||0)*this.scaleY;(this.paddingTop!=u||this.paddingBottom!=d)&&(this.paddingTop=u,this.paddingBottom=d,c|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(i.lineWrapping&&(l=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=16);let f=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=f&&(this.scrollAnchorHeight=-1,this.scrollTop=f),this.scrolledToBottom=VR(e.scrollDOM);let p=(this.printing?cie:aie)(r,this.paddingTop),m=p.top-this.pixelViewport.top,g=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let y=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(y!=this.inView&&(this.inView=y,y&&(l=!0)),!this.inView&&!this.scrollTarget&&!lie(e.dom))return 0;let b=a.width;if((this.contentDOMWidth!=b||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=a.width,this.editorHeight=e.scrollDOM.clientHeight,c|=16),l){let S=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(S)&&(o=!0),o||i.lineWrapping&&Math.abs(b-this.contentDOMWidth)>i.charWidth){let{lineHeight:k,charWidth:w,textHeight:_}=e.docView.measureTextSize();o=k>0&&i.refresh(s,k,w,_,Math.max(5,b/w),S),o&&(e.docView.minWidth=0,c|=16)}m>0&&g>0?h=Math.max(m,g):m<0&&g<0&&(h=Math.min(m,g)),sA();for(let k of this.viewports){let w=k.from==this.viewport.from?S:e.docView.measureVisibleLineHeights(k);this.heightMap=(o?li.empty().applyChanges(this.stateDeco,Wt.empty,this.heightOracle,[new _s(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,o,new rie(k.from,w))}vf&&(c|=2)}let x=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return x&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(h,this.scrollTarget),c|=this.updateForViewport()),(c&2||x)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,r){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),i=this.heightMap,s=this.heightOracle,{visibleTop:o,visibleBottom:a}=this,l=new by(i.lineAt(o-n*1e3,xr.ByHeight,s,0,0).from,i.lineAt(a+(1-n)*1e3,xr.ByHeight,s,0,0).to);if(r){let{head:c}=r.range;if(c<l.from||c>l.to){let h=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),u=i.lineAt(c,xr.ByPos,s,0,0),d;r.y=="center"?d=(u.top+u.bottom)/2-h/2:r.y=="start"||r.y=="nearest"&&c<l.from?d=u.top:d=u.bottom-h,l=new by(i.lineAt(d-1e3/2,xr.ByHeight,s,0,0).from,i.lineAt(d+h+1e3/2,xr.ByHeight,s,0,0).to)}}return l}mapViewport(e,r){let n=r.mapPos(e.from,-1),i=r.mapPos(e.to,1);return new by(this.heightMap.lineAt(n,xr.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(i,xr.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:r},n=0){if(!this.inView)return!0;let{top:i}=this.heightMap.lineAt(e,xr.ByPos,this.heightOracle,0,0),{bottom:s}=this.heightMap.lineAt(r,xr.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:a}=this;return(e==0||i<=o-Math.max(10,Math.min(-n,250)))&&(r==this.state.doc.length||s>=a+Math.max(10,Math.min(n,250)))&&i>o-2*1e3&&s<a+2*1e3}mapLineGaps(e,r){if(!e.length||r.empty)return e;let n=[];for(let i of e)r.touchesRange(i.from,i.to)||n.push(new W4(r.mapPos(i.from),r.mapPos(i.to),i.size,i.displaySize));return n}ensureLineGaps(e,r){let n=this.heightOracle.lineWrapping,i=n?1e4:2e3,s=i>>1,o=i<<1;if(this.defaultTextDirection!=vr.LTR&&!n)return[];let a=[],l=(h,u,d,f)=>{if(u-h<s)return;let p=this.state.selection.main,m=[p.from];p.empty||m.push(p.to);for(let y of m)if(y>h&&y<u){l(h,y-10,d,f),l(y+10,u,d,f);return}let g=die(e,y=>y.from>=d.from&&y.to<=d.to&&Math.abs(y.from-h)<s&&Math.abs(y.to-u)<s&&!m.some(b=>y.from<b&&y.to>b));if(!g){if(u<d.to&&r&&n&&r.visibleRanges.some(x=>x.from<=u&&x.to>=u)){let x=r.moveToLineBoundary(ce.cursor(u),!1,!0).head;x>h&&(u=x)}let y=this.gapSize(d,h,u,f),b=n||y<2e6?y:2e6;g=new W4(h,u,y,b)}a.push(g)},c=h=>{if(h.length<o||h.type!=ai.Text)return;let u=uie(h.from,h.to,this.stateDeco);if(u.total<o)return;let d=this.scrollTarget?this.scrollTarget.range.head:null,f,p;if(n){let m=i/this.heightOracle.lineLength*this.heightOracle.lineHeight,g,y;if(d!=null){let b=vy(u,d),x=((this.visibleBottom-this.visibleTop)/2+m)/h.height;g=b-x,y=b+x}else g=(this.visibleTop-h.top-m)/h.height,y=(this.visibleBottom-h.top+m)/h.height;f=xy(u,g),p=xy(u,y)}else{let m=u.total*this.heightOracle.charWidth,g=i*this.heightOracle.charWidth,y=0;if(m>2e6)for(let w of e)w.from>=h.from&&w.from<h.to&&w.size!=w.displaySize&&w.from*this.heightOracle.charWidth+y<this.pixelViewport.left&&(y=w.size-w.displaySize);let b=this.pixelViewport.left+y,x=this.pixelViewport.right+y,S,k;if(d!=null){let w=vy(u,d),_=((x-b)/2+g)/m;S=w-_,k=w+_}else S=(b-g)/m,k=(x+g)/m;f=xy(u,S),p=xy(u,k)}f>h.from&&l(h.from,f,h,u),p<h.to&&l(p,h.to,h,u)};for(let h of this.viewportLines)Array.isArray(h.type)?h.type.forEach(c):c(h);return a}gapSize(e,r,n,i){let s=vy(i,n)-vy(i,r);return this.heightOracle.lineWrapping?e.height*s:i.total*this.heightOracle.charWidth*s}updateLineGaps(e){W4.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=st.set(e.map(r=>r.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let r=this.stateDeco;this.lineGaps.length&&(r=r.concat(this.lineGapDeco));let n=[];Ht.spans(r,this.viewport.from,this.viewport.to,{span(s,o){n.push({from:s,to:o})},point(){}},20);let i=0;if(n.length!=this.visibleRanges.length)i=12;else for(let s=0;s<n.length&&!(i&8);s++){let o=this.visibleRanges[s],a=n[s];(o.from!=a.from||o.to!=a.to)&&(i|=4,e&&e.mapPos(o.from,-1)==a.from&&e.mapPos(o.to,1)==a.to||(i|=8))}return this.visibleRanges=n,i}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(r=>r.from<=e&&r.to>=e)||sp(this.heightMap.lineAt(e,xr.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(r=>r.top<=e&&r.bottom>=e)||sp(this.heightMap.lineAt(this.scaler.fromDOM(e),xr.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let r=this.lineBlockAtHeight(e+8);return r.from>=this.viewport.from||this.viewportLines[0].top-e>200?r:this.viewportLines[0]}elementAtHeight(e){return sp(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 by{constructor(e,r){this.from=e,this.to=r}}function uie(t,e,r){let n=[],i=t,s=0;return Ht.spans(r,t,e,{span(){},point(o,a){o>i&&(n.push({from:i,to:o}),s+=o-i),i=a}},20),i<e&&(n.push({from:i,to:e}),s+=e-i),{total:s,ranges:n}}function xy({total:t,ranges:e},r){if(r<=0)return e[0].from;if(r>=1)return e[e.length-1].to;let n=Math.floor(t*r);for(let i=0;;i++){let{from:s,to:o}=e[i],a=o-s;if(n<=a)return s+n;n-=a}}function vy(t,e){let r=0;for(let{from:n,to:i}of t.ranges){if(e<=i){r+=e-n;break}r+=i-n}return r/t.total}function die(t,e){for(let r of t)if(e(r))return r}const lA={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};class X6{constructor(e,r,n){let i=0,s=0,o=0;this.viewports=n.map(({from:a,to:l})=>{let c=r.lineAt(a,xr.ByPos,e,0,0).top,h=r.lineAt(l,xr.ByPos,e,0,0).bottom;return i+=h-c,{from:a,to:l,top:c,bottom:h,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(r.height-i);for(let a of this.viewports)a.domTop=o+(a.top-s)*this.scale,o=a.domBottom=a.domTop+(a.bottom-a.top),s=a.bottom}toDOM(e){for(let r=0,n=0,i=0;;r++){let s=r<this.viewports.length?this.viewports[r]:null;if(!s||e<s.top)return i+(e-n)*this.scale;if(e<=s.bottom)return s.domTop+(e-s.top);n=s.bottom,i=s.domBottom}}fromDOM(e){for(let r=0,n=0,i=0;;r++){let s=r<this.viewports.length?this.viewports[r]:null;if(!s||e<s.domTop)return n+(e-i)/this.scale;if(e<=s.domBottom)return s.top+(e-s.domTop);n=s.bottom,i=s.domBottom}}eq(e){return e instanceof X6?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((r,n)=>r.from==e.viewports[n].from&&r.to==e.viewports[n].to):!1}}function sp(t,e){if(e.scale==1)return t;let r=e.toDOM(t.top),n=e.toDOM(t.bottom);return new $o(t.from,t.length,r,n-r,Array.isArray(t._content)?t._content.map(i=>sp(i,e)):t._content)}const wy=Ne.define({combine:t=>t.join(" ")}),N3=Ne.define({combine:t=>t.indexOf(!0)>-1}),F3=dc.newName(),IP=dc.newName(),BP=dc.newName(),RP={"&light":"."+IP,"&dark":"."+BP};function $3(t,e,r){return new dc(e,{finish(n){return/&/.test(n)?n.replace(/&\w*/,i=>{if(i=="&")return t;if(!r||!r[i])throw new RangeError(`Unsupported selector: ${i}`);return r[i]}):t+" "+n}})}const fie=$3("."+F3,{"&":{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,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",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"}}
vendor: 5,444 bytes, line 41
41,"&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:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&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",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&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,zIndex:300},"&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-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".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",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".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"}},RP),pie={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},j4=Pe.ie&&Pe.ie_version<=11;let mie=class{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new Jre,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.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(r=>{for(let n of r)this.queue.push(n);(Pe.ie&&Pe.ie_version<=11||Pe.ios&&e.composing)&&r.some(n=>n.type=="childList"&&n.removedNodes.length||n.type=="characterData"&&n.oldValue.length>n.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&Pe.android&&e.constructor.EDIT_CONTEXT!==!1&&!(Pe.chrome&&Pe.chrome_version<126)&&(this.editContext=new yie(e),e.state.facet(qa)&&(e.contentDOM.editContext=this.editContext.editContext)),j4&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.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),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=ne
vendor: 14,474 bytes, lines 41-42
41w ResizeObserver(()=>{var r;((r=this.view.docView)===null||r===void 0?void 0:r.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(r=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),r.length>0&&r[r.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(r=>{r.length>0&&r[r.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.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(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((r,n)=>r!=e[n]))){this.gapIntersection.disconnect();for(let r of e)this.gapIntersection.observe(r);this.gaps=e}}onSelectionChange(e){let r=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,i=this.selectionRange;if(n.state.facet(qa)?n.root.activeElement!=this.dom:!T2(this.dom,i))return;let s=i.anchorNode&&n.docView.nearest(i.anchorNode);if(s&&s.ignoreEvent(e)){r||(this.selectionChanged=!1);return}(Pe.ie&&Pe.ie_version<=11||Pe.android&&Pe.chrome)&&!n.state.selection.main.empty&&i.focusNode&&em(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,r=Km(e.root);if(!r)return!1;let n=Pe.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&gie(this.view,r)||r;if(!n||this.selectionRange.eq(n))return!1;let i=T2(this.dom,n);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&Qre(this.dom,n)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(n),i&&(this.selectionChanged=!0),!0)}setSelectionRange(e,r){this.selectionRange.set(e.node,e.offset,r.node,r.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,r=null;for(let n=this.dom;n;)if(n.nodeType==1)!r&&e<this.scrollTargets.length&&this.scrollTargets[e]==n?e++:r||(r=this.scrollTargets.slice(0,e)),r&&r.push(n),n=n.assignedSlot||n.parentNode;else if(n.nodeType==11)n=n.host;else break;if(e<this.scrollTargets.length&&!r&&(r=this.scrollTargets.slice(0,e)),r){for(let n of this.scrollTargets)n.removeEventListener("scroll",this.onScroll);for(let n of this.scrollTargets=r)n.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,pie),j4&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),j4&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,r){var n;if(!this.delayedAndroidKey){let i=()=>{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&gd(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(i)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:r,force:this.lastChange<Date.now()-50||!!(!((n=this.delayedAndroidKey)===null||n===void 0)&&n.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 r=-1,n=-1,i=!1;for(let s of e){let o=this.readMutation(s);o&&(o.typeOver&&(i=!0),r==-1?{from:r,to:n}=o:(r=Math.min(o.from,r),n=Math.max(o.to,n)))}return{from:r,to:n,typeOver:i}}readChange(){let{from:e,to:r,typeOver:n}=this.processRecords(),i=this.selectionChanged&&T2(this.dom,this.selectionRange);if(e<0&&!i)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new Ine(this.view,e,r,n);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let r=this.readChange();if(!r)return this.view.requestMeasure(),!1;let n=this.view.state,i=CP(this.view,r);return this.view.state==n&&(r.domChanged||r.newSel&&!r.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),i}readMutation(e){let r=this.view.docView.nearest(e.target);if(!r||r.ignoreMutation(e))return null;if(r.markDirty(e.type=="attributes"),e.type=="attributes"&&(r.flags|=4),e.type=="childList"){let n=cA(r,e.previousSibling||e.target.previousSibling,-1),i=cA(r,e.nextSibling||e.target.nextSibling,1);return{from:n?r.posAfter(n):r.posAtStart,to:i?r.posBefore(i):r.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:r.posAtStart,to:r.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),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):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),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(qa)!=e.state.facet(qa)&&(e.view.contentDOM.editContext=e.state.facet(qa)?this.editContext.editContext:null))}destroy(){var e,r,n;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(r=this.gapIntersection)===null||r===void 0||r.disconnect(),(n=this.resizeScroll)===null||n===void 0||n.disconnect();for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}};function cA(t,e,r){for(;e;){let n=ar.get(e);if(n&&n.parent==t)return n;let i=e.parentNode;e=i!=t.dom?i:r>0?e.nextSibling:e.previousSibling}return null}function hA(t,e){let r=e.startContainer,n=e.startOffset,i=e.endContainer,s=e.endOffset,o=t.docView.domAtPos(t.state.selection.main.anchor);return em(o.node,o.offset,i,s)&&([r,n,i,s]=[i,s,r,n]),{anchorNode:r,anchorOffset:n,focusNode:i,focusOffset:s}}function gie(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return hA(t,i)}let r=null;function n(i){i.preventDefault(),i.stopImmediatePropagation(),r=i.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",n,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",n,!0),r?hA(t,r):null}class yie{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let r=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=n=>{let i=e.state.selection.main,{anchor:s,head:o}=i,a=this.toEditorPos(n.updateRangeStart),l=this.toEditorPos(n.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:n.updateRangeStart,editorBase:a,drifted:!1});let c={from:a,to:l,insert:Wt.of(n.text.split(`
42`))};if(c.from==this.from&&s<this.from?c.from=s:c.to==this.to&&s>this.to&&(c.to=s),c.from==c.to&&!c.insert.length){let h=ce.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd));h.main.eq(i)||e.dispatch({selection:h,userEvent:"select"});return}if((Pe.mac||Pe.android)&&c.from==o-1&&/^\. ?$/.test(n.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(c={from:a,to:l,insert:Wt.of([n.text.replace("."," ")])}),this.pendingContextChange=c,!e.state.readOnly){let h=this.to-this.from+(c.to-c.from+c.insert.length);K6(e,c,ce.single(this.toEditorPos(n.selectionStart,h),this.toEditorPos(n.selectionEnd,h)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state))},this.handlers.characterboundsupdate=n=>{let i=[],s=null;for(let o=this.toEditorPos(n.rangeStart),a=this.toEditorPos(n.rangeEnd);o<a;o++){let l=e.coordsForChar(o);s=l&&new DOMRect(l.left,l.top,l.right-l.left,l.bottom-l.top)||s||new DOMRect,i.push(s)}r.updateCharacterBounds(n.rangeStart,i)},this.handlers.textformatupdate=n=>{let i=[];for(let s of n.getTextFormats()){let o=s.underlineStyle,a=s.underlineThickness;if(o!="None"&&a!="None"){let l=this.toEditorPos(s.rangeStart),c=this.toEditorPos(s.rangeEnd);if(l<c){let h=`text-decoration: underline ${o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${a=="Thin"?1:2}px`;i.push(st.mark({attributes:{style:h}}).range(l,c))}}}e.dispatch({effects:mP.of(st.set(i))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:n}=this.composing;this.composing=null,n&&this.reset(e.state)}};for(let n in this.handlers)r.addEventListener(n,this.handlers[n]);this.measureReq={read:n=>{this.editContext.updateControlBounds(n.contentDOM.getBoundingClientRect());let i=Km(n.root);i&&i.rangeCount&&this.editContext.updateSelectionBounds(i.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let r=0,n=!1,i=this.pendingContextChange;return e.changes.iterChanges((s,o,a,l,c)=>{if(n)return;let h=c.length-(o-s);if(i&&o>=i.to)if(i.from==s&&i.to==o&&i.insert.eq(c)){i=this.pendingContextChange=null,r+=h,this.to+=h;return}else i=null,this.revertPending(e.state);if(s+=r,o+=r,o<=this.from)this.from+=h,this.to+=h;else if(s<this.to){if(s<this.from||o>this.to||this.to-this.from+c.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),c.toString()),this.to+=h}r+=h}),i&&!n&&this.revertPending(e.state),!n}update(e){let r=this.pendingContextChange,n=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(n.from,n.to)&&e.transactions.some(i=>!i.isUserEvent("input.type")&&i.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||r)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:r}=e.selection.main;this.from=Math.max(0,r-1e4),this.to=Math.min(e.doc.length,r+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let r=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(r.from),this.toContextPos(r.from+r.insert.length),e.doc.sliceString(r.from,r.to))}setSelection(e){let{main:r}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,r.anchor))),i=this.toContextPos(r.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=i)&&this.editContext.updateSelection(n,i)}rangeIsValid(e){let{head:r}=e.selection.main;return!(this.from>0&&r-this.from<500||this.to<e.doc.length&&this.to-r<500||this.to-this.from>1e4*3)}toEditorPos(e,r=this.to-this.from){e=Math.min(e,r);let n=this.composing;return n&&n.drifted?n.editorBase+(e-n.contextBase):e+this.from}toContextPos(e){let r=this.composing;return r&&r.drifted?r.contextBase+(e-r.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}let ze=class z3{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&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var r;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="
42cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:n}=e;this.dispatchTransactions=e.dispatchTransactions||n&&(i=>i.forEach(s=>n(s,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=e.root||Zre(e.parent)||document,this.viewState=new aA(e.state||Tr.create(e)),e.scrollTo&&e.scrollTo.is(my)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(ud).map(i=>new H4(i));for(let i of this.plugins)i.update(this);this.observer=new mie(this),this.inputState=new Fne(this),this.inputState.ensureHandlers(this.plugins),this.docView=new qM(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((r=document.fonts)===null||r===void 0)&&r.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...e){let r=e.length==1&&e[0]instanceof oi?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(r,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let r=!1,n=!1,i,s=this.state;for(let d of e){if(d.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=d.state}if(this.destroyed){this.viewState.state=s;return}let o=this.hasFocus,a=0,l=null;e.some(d=>d.annotation(EP))?(this.inputState.notifiedFocused=o,a=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,l=OP(s,o),l||(a=1));let c=this.observer.delayedAndroidKey,h=null;if(c?(this.observer.clearDelayedAndroidKey(),h=this.observer.readChange(),(h&&!this.state.doc.eq(s.doc)||
vendor: 19,021 bytes, line 42
42!this.state.selection.eq(s.selection))&&(h=null)):this.observer.clear(),s.facet(Tr.phrases)!=this.state.facet(Tr.phrases))return this.setState(s);i=Yb.create(this,s,e),i.flags|=a;let u=this.viewState.scrollTarget;try{this.updateState=2;for(let d of e){if(u&&(u=u.map(d.changes)),d.scrollIntoView){let{main:f}=d.state.selection;u=new yd(f.empty?f:ce.cursor(f.head,f.head>f.anchor?-1:1))}for(let f of d.effects)f.is(my)&&(u=f.value.clip(this.state))}this.viewState.update(i,u),this.bidiCache=Jb.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),r=this.docView.update(i),this.state.facet(np)!=this.styleModules&&this.mountStyles(),n=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(r,e.some(d=>d.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(wy)!=i.state.facet(wy)&&(this.viewState.mustMeasureContent=!0),(r||n||u||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),r&&this.docViewUpdate(),!i.empty)for(let d of this.state.facet(I3))try{d(i)}catch(f){Mi(this.state,f,"update listener")}(l||h)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),h&&!CP(this,h)&&c.force&&gd(this.contentDOM,c.key,c.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 r=this.hasFocus;try{for(let n of this.plugins)n.destroy(this);this.viewState=new aA(e),this.plugins=e.facet(ud).map(n=>new H4(n)),this.pluginMap.clear();for(let n of this.plugins)n.update(this);this.docView.destroy(),this.docView=new qM(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}r&&this.focus(),this.requestMeasure()}updatePlugins(e){let r=e.startState.facet(ud),n=e.state.facet(ud);if(r!=n){let i=[];for(let s of n){let o=r.indexOf(s);if(o<0)i.push(new H4(s));else{let a=this.plugins[o];a.mustUpdate=e,i.push(a)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let i of this.plugins)i.mustUpdate=e;for(let i=0;i<this.plugins.length;i++)this.plugins[i].update(this);r!=n&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let r=e.value;if(r&&r.docViewUpdate)try{r.docViewUpdate(this)}catch(n){Mi(this.state,n,"doc view update listener")}}}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 r=null,n=this.scrollDOM,i=n.scrollTop*this.scaleY,{scrollAnchorPos:s,scrollAnchorHeight:o}=this.viewState;Math.abs(i-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let a=0;;a++){if(o<0)if(VR(n))s=-1,o=this.viewState.heightMap.height;else{let f=this.viewState.scrollAnchorAt(i);s=f.from,o=f.top}this.updateState=1;let l=this.viewState.measure(this);if(!l&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(a>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];l&4||([this.measureRequests,c]=[c,this.measureRequests]);let h=c.map(f=>{try{return f.read(this)}catch(p){return Mi(this.state,p),uA}}),u=Yb.create(this,this.state,[]),d=!1;u.flags|=l,r?r.flags|=l:r=u,this.updateState=2,u.empty||(this.updatePlugins(u),this.inputState.update(u),this.updateAttrs(),d=this.docView.update(u),d&&this.docViewUpdate());for(let f=0;f<c.length;f++)if(h[f]!=uA)try{let p=c[f];p.write&&p.write(h[f],this)}catch(p){Mi(this.state,p)}if(d&&this.docView.updateSelection(!0),!u.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,o=-1;continue}else{let p=(s<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(s).top)-o;if(p>1||p<-1){i=i+p,n.scrollTop=i/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(r&&!r.empty)for(let a of this.state.facet(I3))a(r)}get themeClasses(){return F3+" "+(this.state.facet(N3)?BP:IP)+" "+this.state.facet(wy)}updateAttrs(){let e=dA(this,gP,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),r={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(qa)?"true":"false",class:"cm-content",style:`${Pe.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(r["aria-readonly"]="true"),dA(this,U6,r);let n=this.observer.ignore(()=>{let i=A3(this.contentDOM,this.contentAttrs,r),s=A3(this.dom,this.editorAttrs,e);return i||s});return this.editorAttrs=e,this.contentAttrs=r,n}showAnnouncements(e){let r=!0;for(let n of e)for(let i of n.effects)if(i.is(z3.announce)){r&&(this.announceDOM.textContent=""),r=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=i.value}}mountStyles(){this.styleModules=this.state.facet(np);let e=this.state.facet(z3.cspNonce);dc.mount(this.root,this.styleModules.concat(fie).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 r=0;r<this.measureRequests.length;r++)if(this.measureRequests[r].key===e.key){this.measureRequests[r]=e;return}}this.measureRequests.push(e)}}plugin(e){let r=this.pluginMap.get(e);return(r===void 0||r&&r.plugin!=e)&&this.pluginMap.set(e,r=this.plugins.find(n=>n.plugin==e)||null),r&&r.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,r,n){return V4(this,e,GM(this,e,r,n))}moveByGroup(e,r){return V4(this,e,GM(this,e,r,n=>Ene(this,e.head,n)))}visualLineSide(e,r){let n=this.bidiSpans(e),i=this.textDirectionAt(e.from),s=n[r?n.length-1:0];return ce.cursor(s.side(r,i)+e.from,s.forward(!r,i)?1:-1)}moveToLineBoundary(e,r,n=!0){return Ane(this,e,r,n)}moveVertically(e,r,n){return V4(this,e,One(this,e,r,n))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,r=0){return this.docView.posFromDOM(e,r)}posAtCoords(e,r=!0){return this.readMeasured(),wP(this,e,r)}coordsAtPos(e,r=1){this.readMeasured();let n=this.docView.coordsAt(e,r);if(!n||n.left==n.right)return n;let i=this.state.doc.lineAt(e),s=this.bidiSpans(i),o=s[Zl.find(s,e-i.from,-1,r)];return Fv(n,o.dir==vr.LTR==r>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(dP)||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>bie)return iP(e.length);let r=this.textDirectionAt(e.from),n;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==r&&(s.fresh||nP(s.isolates,n=HM(this,e))))return s.order;n||(n=HM(this,e));let i=dne(e.text,r,n);return this.bidiCache.push(new Jb(e.from,e.to,r,n,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||Pe.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{HR(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(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,r={}){return my.of(new yd(typeof e=="number"?ce.cursor(e):e,r.y,r.x,r.yMargin,r.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:r}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return my.of(new yd(ce.cursor(n.from),"start","start",n.top-e,r,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return Kr.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Kr.define(()=>({}),{eventObservers:e})}static theme(e,r){let n=dc.newName(),i=[wy.of(n),np.of($3(`.${n}`,e))];return r&&r.dark&&i.push(N3.of(!0)),i}static baseTheme(e){return Ec.lowest(np.of($3("."+F3,e,RP)))}static findFromDOM(e){var r;let n=e.querySelector(".cm-content"),i=n&&ar.get(n)||ar.get(e);return((r=i==null?void 0:i.rootView)===null||r===void 0?void 0:r.view)||null}};ze.styleModule=np;ze.inputHandler=hP;ze.clipboardInputFilter=W6;ze.clipboardOutputFilter=j6;ze.scrollHandler=pP;ze.focusChangeEffect=uP;ze.perLineTextDirection=dP;ze.exceptionSink=cP;ze.updateListener=I3;ze.editable=qa;ze.mouseSelectionStyle=lP;ze.dragMovesSelection=aP;ze.clickAddsSelectionRange=oP;ze.decorations=Xm;ze.outerDecorations=yP;ze.atomicRanges=zv;ze.bidiIsolatedRanges=bP;ze.scrollMargins=xP;ze.darkTheme=N3;ze.cspNonce=Ne.define({combine:t=>t.length?t[0]:""});ze.contentAttributes=U6;ze.editorAttributes=gP;ze.lineWrapping=ze.contentAttributes.of({class:"cm-lineWrapping"});ze.announce=kt.define();const bie=4096,uA={};class Jb{constructor(e,r,n,i,s,o){this.from=e,this.to=r,this.dir=n,this.isolates=i,this.fresh=s,this.order=o}static update(e,r){if(r.empty&&!e.some(s=>s.fresh))return e;let n=[],i=e.length?e[e.length-1].dir:vr.LTR;for(let s=Math.max(0,e.length-10);s<e.length;s++){let o=e[s];o.dir==i&&!r.touchesRange(o.from,o.to)&&n.push(new Jb(r.mapPos(o.from,1),r.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return n}}function dA(t,e,r){for(let n=t.state.facet(e),i=n.length-1;i>=0;i--){let s=n[i],o=typeof s=="function"?s(t):s;o&&M3(o,r)}return r}const xie=Pe.mac?"mac":Pe.windows?"win":Pe.linux?"linux":"key";function vie(t,e){const r=t.split(/-(?!$)/);let n=r[r.length-1];n=="Space"&&(n=" ");let i,s,o,a;for(let l=0;l<r.length-1;++l){const c=r[l];if(/^(cmd|meta|m)$/i.test(c))a=!0;else if(/^a(lt)?$/i.test(c))i=!0;else if(/^(c|ctrl|control)$/i.test(c))s=!0;else if(/^s(hift)?$/i.test(c))o=!0;else if(/^mod$/i.test(c))e=="mac"?a=!0:s=!0;else throw new Error("Unrecognized modifier name: "+c)}return i&&(n="Alt-"+n),s&&(n="Ctrl-"+n),a&&(n="Meta-"+n),o&&(n="Shift-"+n),n}function ky(t,e,r){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),r!==!1&&e.shiftKey&&(t="Shift-"+t),t}const wie=Ec.default(ze.domEventHandlers({keydown(t,e){return NP(PP(e.state),t,e,"editor")}})),Yf=Ne.define({enables:wie}),fA=new WeakMap;function PP(t){let e=t.facet(Yf),r=fA.get(e);return r||fA.set(e,r=Sie(e.reduce((n,i)=>n.concat(i),[]))),r}function kie(t,e,r){return NP(PP(t.state),e,t,r)}let Vl=null;const Cie=4e3;function Sie(t,e=xie){let r=Object.create(null),n=Object.create(null),i=(o,a)=>{let l=n[o];if(l==null)n[o]=a;else if(l!=a)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},s=(o,a,l,c,h)=>{var u,d;let f=r[o]||(r[o]=Object.create(null)),p=a.split(/ (?!$)/).map(y=>vie(y,e));for(let y=1;y<p.length;y++){let b=p.slice(0,y).join(" ");i(b,!0),f[b]||(f[b]={preventDefault:!0,stopPropagation:!1,run:[x=>{let S=Vl={view:x,prefix:b,scope:o};return setTimeout(()=>{Vl==S&&(Vl=null)},Cie),!0}]})}let m=p.join(" ");i(m,!1);let g=f[m]||(f[m]={preventDefault:!1,stopPropagation:!1,run:((d=(u=f._any)===null||u===void 0?void 0:u.run)===null||d===void 0?void 0:d.slice())||[]});l&&g.run.push(l),c&&(g.preventDefault=!0),h&&(g.stopPropagation=!0)};for(let o of t){let a=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let c of a){let h=r[c]||(r[c]=Object.create(null));h._any||(h._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:u}=o;for(let d in h)h[d].run.push(f=>u(f,H3))}let l=o[e]||o.key;if(l)for(let c of a)s(c,l,o.run,o.preventDefault,o.stopPropagation),o.shift&&s(c,"Shift-"+l,o.shift,o.preventDefault,o.stopPropagation)}return r}let H3=null;function NP(t,e,r,n){H3=e;let i=FR(e),s=ki(i,0),o=Fo(s)==i.length&&i!=" ",a="",l=!1,c=!1,h=!1;Vl&&Vl.view==r&&Vl.scope==n&&(a=Vl.prefix+" ",TP.indexOf(e.keyCode)<0&&(c=!0,Vl=null));let u=new Set,d=g=>{if(g){for(let y of g.run)if(!u.has(y)&&(u.add(y),y(r)))return g.stopPropagation&&(h=!0),!0;g.preventDefault&&(g.stopPropagation&&(h=!0),c=!0)}return!1},f=t[n],p,m;return f&&(d(f[a+ky(i,e,!o)])?l=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(Pe.windows&&e.ctrlKey&&e.altKey)&&!(Pe.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(p=nl[e.keyCode])&&p!=i?(d(f[a+ky(p,e,!0)])||e.shiftKey&&(m=Gm[e.keyCode])!=i&&m!=p&&d(f[a+ky(m,e,!1)]))&&(l=!0):o&&e.shiftKey&&d(f[a+ky(i,e,!0)])&&(l=!0),!l&&d(f._any)&&(l=!0)),c&&(l=!0),l&&h&&e.stopPropagation(),H3=null,l}class y1{constructor(e,r,n,i,s){this.className=e,this.left=r,this.top=n,this.width=i,this.height=s}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,r){return r.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,r,n){if(n.empty){let i=e.coordsAtPos(n.head,n.assoc||1);if(!i)return[];let s=FP(e);return[new y1(r,i.left-s.left,i.top-s.top,null,i.bottom-i.top)]}else return Tie(e,r,n)}}function FP(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==vr.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function pA(t,e,r,n){let i=t.coordsAtPos(e,r*2);if(!i)return n;let s=t.dom.getBoundingClientRect(),o=(i.top+i.bottom)/2,a=t.posAtCoords({x:s.left+1,y:o}),l=t.posAtCoords({x:s.right-1,y:o});return a==null||l==null?n:{from:Math.max(n.from,Math.min(a,l)),to:Math.min(n.to,Math.max(a,l))}}function Tie(t,e,r){if(r.to<=t.viewport.from||r.from>=t.viewport.to)return[];let n=Math.max(r.from,t.viewport.from),i=Math.min(r.to,t.viewport.to),s=t.textDirection==vr.LTR,o=t.contentDOM,a=o.getBoundingClientRect(),l=FP(t),c=o.querySelector(".cm-line"),h=c&&window.getComputedStyle(c),u=a.left+(h?parseInt(h.paddingLeft)+Math.min(0,parseInt(h.textIndent)):0),d=a.right-(h?parseInt(h.paddingRight):0),f=R3(t,n,1),p=R3(t,i,-1),m=f.type==ai.Text?f:null,g=p.type==ai.Text?p:null;if(m&&(t.lineWrapping||f.widgetLineBreaks)&&(m=pA(t,n,1,m)),g&&(t.lineWrapping||p.widgetLineBreaks)&&(g=pA(t,i,-1,g)),m&&g&&m.from==g.from&&m.to==g.to)return b(x(r.from,r.to,m));{let k=m?x(r.from,null,m):S(f,!1),w=g?x(null,r.to,g):S(p,!0),_=[];return(m||f).to<(g||p).from-(m&&g?1:0)||f.widgetLineBreaks>1&&k.bottom+t.defaultLineHeight/2<w.top?_.push(y(u,k.bottom,d,w.top)):k.bottom<w.top&&t.elementAtHeight((k.bottom+w.top)/2).type==ai.Text&&(k.bottom=w.top=(k.bottom+w.top)/2),b(k).concat(_).concat(b(w))}function y(k,w,_,L){return new y1(e,k-l.left,w-l.top,_-k,L-w)}function b({top:k,bottom:w,horizontal:_}){let L=[];for(let B=0;B<_.length;B+=2)L.push(y(_[B],k,_[B+1],w));return L}function x(k,w,_){let L=1e9,B=-1e9,E=[];function D(z,$,H,j,q){let ne=t.coordsAtPos(z,z==_.to?-2:2),O=t.coordsAtPos(H,H==_.from?2:-2);!ne||!O||(L=Math.min(ne.top,O.top,L),B=Math.max(ne.bottom,O.bottom,B),q==vr.LTR?E.push(s&&$?u:ne.left,s&&j?d:O.right):E.push(!s&&j?u:O.left,!s&&$?d:ne.right))}let N=k??_.from,K=w??_.to;for(let z of t.visibleRanges)if(z.to>N&&z.from<K)for(let $=Math.max(z.from,N),H=Math.min(z.to,K);;){let j=t.state.doc.lineAt($);for(let q of t.bidiSpans(j)){let ne=q.from+j.from,O=q.to+j.from;if(ne>=H)break;O>$&&D(Math.max(ne,$),k==null&&ne<=N,Math.min(O,H),w==null&&O>=K,q.dir)}if($=j.to+1,$>=H)break}return E.length==0&&D(N,k==null,K,w==null,t.textDirection),{top:L,bottom:B,horizontal:E}}function S(k,w){let _=a.top+(w?k.top:k.bottom);return{top:_,bottom:_,horizontal:[]}}}function _ie(t,e){return t.constructor==e.constructor&&t.eq(e)}class Mie{constructor(e,r){this.view=e,this.layer=r,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"),r.above&&this.dom.classList.add("cm-layer-above"),r.class&&this.dom.classList.add(r.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),r.mount&&r.mount(this.dom,e)}update(e){e.startState.facet(E2)!=e.state.facet(E2)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let r=0,n=e.facet(E2);for(;r<n.length&&n[r]!=this.layer;)r++;this.dom.style.zIndex=String((this.layer.above?150:-1)-r)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:r}=this.view;(e!=this.scaleX||r!=this.scaleY)&&(this.scaleX=e,this.scaleY=r,this.dom.style.transform=`scale(${1/e}, ${1/r})`)}draw(e){if(e.length!=this.drawn.length||e.some((r,n)=>!_ie(r,this.drawn[n]))){let r=this.dom.firstChild,n=0;for(let i of e)i.update&&r&&i.constructor&&this.drawn[n].constructor&&i.update(r,this.drawn[n])?(r=r.nextSibling,n++):this.dom.insertBefore(i.draw(),r);for(;r;){let i=r.nextSibling;r.remove(),r=i}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const E2=Ne.define();function $P(t){return[Kr.define(e=>new Mie(e,t)),E2.of(t)]}const Jm=Ne.define({combine(t){return oa(t,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,r)=>
42Math.min(e,r),drawRangeCursor:(e,r)=>e||r})}});function zP(t={}){return[Jm.of(t),Aie,Eie,Oie,fP.of(!0)]}function HP(t){return t.startState.facet(Jm)!=t.state.facet(Jm)}const Aie=$P({above:!0,markers(t){let{state:e}=t,r=e.facet(Jm),n=[];for(let i of e.selection.ranges){let s=i==e.selection.main;if(i.empty||r.drawRangeCursor){let o=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",a=i.empty?i:ce.cursor(i.head,i.head>i.anchor?-1:1);for(let l of y1.forRange(t,o,a))n.push(l)}}return n},update(t,e){t.transactions.some(n=>n.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let r=HP(t);return r&&mA(t.state,e),t.docChanged||t.selectionSet||r},mount(t,e){mA(e.state,t)},class:"cm-cursorLayer"});function mA(t,e){e.style.animationDuration=t.facet(Jm).cursorBlinkRate+"ms"}const Eie=$P({above:!1,markers(t){return t.state.selection.ranges.map(e=>e.empty?[]:y1.forRange(t,"cm-selectionBackground",e)).reduce((e,r)=>e.concat(r))},update(t,e){return t.docChanged||t.selectionSet||t.viewportChanged||HP(t)},class:"cm-selectionLayer"}),Oie=Ec.highest(ze.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),qP=kt.define({map(t,e){return t==null?null:e.mapPos(t)}}),op=fn.define({create(){return null},update(t,e){return t!=null&&(t=e.changes.mapPos(t)),e.effects.reduce((r,n)=>n.is(qP)?n.value:r,t)}}),Lie=Kr.fromClass(class{constructor(t){this.view=t,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(t){var e;let r=t.state.field(op);r==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"),(t.startState.field(op)!=r||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:t}=this,e=t.state.field(op),r=e!=null&&t.coordsAtPos(e);if(!r)return null;let n=t.scrollDOM.getBoundingClientRect();return{left:r.left-n.left+t.scrollDOM.scrollLeft*t.scaleX,top:r.top-n.top+t.scrollDOM.scrollTop*t.scaleY,height:r.bottom-r.top}}drawCursor(t){if(this.cursor){let{scaleX:e,scaleY:r}=this.view;t?(this.cursor.style.left=t.left/e+"px",this.cursor.style.top=t.top/r+"px",this.cursor.style.height=t.height/r+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(t){this.view.state.field(op)!=t&&this.view.dispatch({effects:qP.of(t)})}},{eventObservers:{dragover(t){this.setDropPos(this.view.posAtCoords({x:t.clientX,y:t.clientY}))},dragleave(t){(t.target==this.view.contentDOM||!this.view.contentDOM.contains(t.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function Die(){return[op,Lie]}function gA(t,e,r,n,i){e.lastIndex=0;for(let s=t.iterRange(r,n),o=r,a;!s.next().done;o+=s.value.length)if(!s.lineBreak)for(;a=e.exec(s.value);)i(o+a.index,a)}function Iie(t,e){let r=t.visibleRanges;if(r.length==1&&r[0].from==t.viewport.from&&r[0].to==t.viewport.to)return r;let n=[];for(let{from:i,to:s}of r)i=Math.max(t.state.doc.lineAt(i).from,i-e),s=Math.min(t.state.doc.lineAt(s).to,s+e),n.length&&n[n.length-1].to>=i?n[n.length-1].to=s:n.push({from:i,to:s});return n}class Bie{constructor(e){const{regexp:r,decoration:n,decorate:i,boundary:s,maxLength:o=1e3}=e;if(!r.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=r,i)this.addMatch=(a,l,c,h)=>i(h,c,c+a[0].length,a,l);else if(typeof n=="function")this.addMatch=(a,l,c,h)=>{let u=n(a,l,c);u&&h(c,c+a[0].length,u)};else if(n)this.addMatch=(a,l,c,h)=>h(c,c+a[0].length,n);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=s,this.maxLength=o}createDeco(e){let r=new rl,n=r.add.bind(r);for(let{from:i,to:s}of Iie(e,this.maxLength))gA(e.state.doc,this.regexp,i,s,(o,a)=>this.addMatch(a,e,o,n));return r.finish()}updateDeco(e,r){let n=1e9,i=-1;return e.docChanged&&e.changes.iterChanges((s,o,a,l)=>{l>=e.view.viewport.from&&a<=e.view.viewport.to&&(n=Math.min(a,n),i=Math.max(l,i))}),e.viewportMoved||i-n>1e3?this.createDeco(e.view):i>-1?this.updateRange(e.view,r.map(e.changes),n,i):r}updateRange(e,r,n,i){for(let s of e.visibleRanges){let o=Math.max(s.from,n),a=Math.min(s.to,i);if(a>=o){let l=e.state.doc.lineAt(o),c=l.to<a?e.state.doc.lineAt(a):l,h=Math.max(s.from,l.from),u=Math.min(s.to,c.to);if(this.boundary){for(;o>l.from;o--)if(this.boundary.test(l.text[o-1-l.from])){h=o;break}for(;a<c.to;a++)if(this.boundary.test(c.text[a-c.from])){u=a;break}}let d=[],f,p=(m,g,y)=>d.push(y.range(m,g));if(l==c)for(this.regexp.lastIndex=h-l.from;(f=this.regexp.exec(l.text))&&f.index<u-l.from;)this.addMatch(f,e,f.index+l.from,p);else gA(e.state.doc,this.regexp,h,u,(m,g)=>this.addMatch(g,e,m,p));r=r.update({filterFrom:h,filterTo:u,filter:(m,g)=>m<h||g>u,add:d})}}return r}}const q3=/x/.unicode!=null?"gu":"g",Rie=new RegExp(`[\0-\b
43-��-Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,q3),Pie={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 U4=null;function Nie(){var t;if(U4==null&&typeof document<"u"&&document.body){let e=document.body.style;U4=((t=e.tabSize)!==null&&t!==void 0?t:e.MozTabSize)!=null}return U4||!1}const O2=Ne.define({combine(t){let e=oa(t,{render:null,specialChars:Rie,addSpecialChars:null});return(e.replaceTabs=!Nie())&&(e.specialChars=new RegExp("	|"+e.specialChars.source,q3)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,q3)),e}});function Fie(t={}){return[O2.of(t),$ie()]}let yA=null;function $ie(){return yA||(yA=Kr.fromClass(class{constructor(t){this.view=t,this.decorations=st.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(O2)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new Bie({regexp:t.specialChars,decoration:(e,r,n)=>{let{doc:i}=r.state,s=ki(e[0],0);if(s==9){let o=i.lineAt(n),a=r.state.tabSize,l=Kf(o.text,a,n-o.from);return st.replace({widget:new Vie((a-l%a)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=st.replace({widget:new qie(t,s)}
vendor: 21,294 bytes, line 43
43))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(O2);t.startState.facet(O2)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(t.view)):this.decorations=this.decorator.updateDeco(t,this.decorations)}},{decorations:t=>t.decorations}))}const zie="•";function Hie(t){return t>=32?zie:t==10?"␤":String.fromCharCode(9216+t)}class qie extends gl{constructor(e,r){super(),this.options=e,this.code=r}eq(e){return e.code==this.code}toDOM(e){let r=Hie(this.code),n=e.state.phrase("Control character")+" "+(Pie[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,n,r);if(i)return i;let s=document.createElement("span");return s.textContent=r,s.title=n,s.setAttribute("aria-label",n),s.className="cm-specialChar",s}ignoreEvent(){return!1}}class Vie extends gl{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 Wie(){return Uie}const jie=st.line({class:"cm-activeLine"}),Uie=Kr.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=-1,r=[];for(let n of t.state.selection.ranges){let i=t.lineBlockAt(n.head);i.from>e&&(r.push(jie.range(i.from)),e=i.from)}return st.set(r)}},{decorations:t=>t.decorations}),V3=2e3;function Gie(t,e,r){let n=Math.min(e.line,r.line),i=Math.max(e.line,r.line),s=[];if(e.off>V3||r.off>V3||e.col<0||r.col<0){let o=Math.min(e.off,r.off),a=Math.max(e.off,r.off);for(let l=n;l<=i;l++){let c=t.doc.line(l);c.length<=a&&s.push(ce.range(c.from+o,c.to+a))}}else{let o=Math.min(e.col,r.col),a=Math.max(e.col,r.col);for(let l=n;l<=i;l++){let c=t.doc.line(l),h=v3(c.text,o,t.tabSize,!0);if(h<0)s.push(ce.cursor(c.to));else{let u=v3(c.text,a,t.tabSize);s.push(ce.range(c.from+h,c.from+u))}}}return s}function Kie(t,e){let r=t.coordsAtPos(t.viewport.from);return r?Math.round(Math.abs((r.left-e)/t.defaultCharacterWidth)):-1}function bA(t,e){let r=t.posAtCoords({x:e.clientX,y:e.clientY},!1),n=t.state.doc.lineAt(r),i=r-n.from,s=i>V3?-1:i==n.length?Kie(t,e.clientX):Kf(n.text,t.state.tabSize,r-n.from);return{line:n.number,col:s,off:i}}function Yie(t,e){let r=bA(t,e),n=t.state.selection;return r?{update(i){if(i.docChanged){let s=i.changes.mapPos(i.startState.doc.line(r.line).from),o=i.state.doc.lineAt(s);r={line:o.number,col:r.col,off:Math.min(r.off,o.length)},n=n.map(i.changes)}},get(i,s,o){let a=bA(t,i);if(!a)return n;let l=Gie(t.state,r,a);return l.length?o?ce.create(l.concat(n.ranges)):ce.create(l):n}}:null}function Xie(t){let e=r=>r.altKey&&r.button==0;return ze.mouseSelectionStyle.of((r,n)=>e(n)?Yie(r,n):null)}const Jie={Alt:[18,t=>!!t.altKey],Control:[17,t=>!!t.ctrlKey],Shift:[16,t=>!!t.shiftKey],Meta:[91,t=>!!t.metaKey]},Zie={style:"cursor: crosshair"};function Qie(t={}){let[e,r]=Jie[t.key||"Alt"],n=Kr.fromClass(class{constructor(i){this.view=i,this.isDown=!1}set(i){this.isDown!=i&&(this.isDown=i,this.view.update([]))}},{eventObservers:{keydown(i){this.set(i.keyCode==e||r(i))},keyup(i){(i.keyCode==e||!r(i))&&this.set(!1)},mousemove(i){this.set(r(i))}}});return[n,ze.contentAttributes.of(i=>{var s;return!((s=i.plugin(n))===null||s===void 0)&&s.isDown?Zie:null})]}const R0="-10000px";class VP{constructor(e,r,n,i){this.facet=r,this.createTooltipView=n,this.removeTooltipView=i,this.input=e.state.facet(r),this.tooltips=this.input.filter(o=>o);let s=null;this.tooltipViews=this.tooltips.map(o=>s=n(o,s))}update(e,r){var n;let i=e.state.facet(this.facet),s=i.filter(l=>l);if(i===this.input){for(let l of this.tooltipViews)l.update&&l.update(e);return!1}let o=[],a=r?[]:null;for(let l=0;l<s.length;l++){let c=s[l],h=-1;if(c){for(let u=0;u<this.tooltips.length;u++){let d=this.tooltips[u];d&&d.create==c.create&&(h=u)}if(h<0)o[l]=this.createTooltipView(c,l?o[l-1]:null),a&&(a[l]=!!c.above);else{let u=o[l]=this.tooltipViews[h];a&&(a[l]=r[h]),u.update&&u.update(e)}}}for(let l of this.tooltipViews)o.indexOf(l)<0&&(this.removeTooltipView(l),(n=l.destroy)===null||n===void 0||n.call(l));return r&&(a.forEach((l,c)=>r[c]=l),r.length=a.length),this.input=i,this.tooltips=s,this.tooltipViews=o,!0}}function ese(t){let e=t.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const G4=Ne.define({combine:t=>{var e,r,n;return{position:Pe.ios?"absolute":((e=t.find(i=>i.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((r=t.find(i=>i.parent))===null||r===void 0?void 0:r.parent)||null,tooltipSpace:((n=t.find(i=>i.tooltipSpace))===null||n===void 0?void 0:n.tooltipSpace)||ese}}}),xA=new WeakMap,J6=Kr.fromClass(class{constructor(t){this.view=t,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=t.state.facet(G4);this.position=e.position,this.parent=e.parent,this.classes=t.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new VP(t,Z6,(r,n)=>this.createTooltip(r,n),r=>{this.resizeObserver&&this.resizeObserver.unobserve(r.dom),r.dom.remove()}),this.above=this.manager.tooltips.map(r=>!!r.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(r=>{Date.now()>this.lastTransaction-50&&r.length>0&&r[r.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),t.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 t of this.manager.tooltipViews)this.intersectionObserver.observe(t.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(t){t.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(t,this.above);e&&this.observeIntersection();let r=e||t.geometryChanged,n=t.state.facet(G4);if(n.position!=this.position&&!this.madeAbsolute){this.position=n.position;for(let i of this.manager.tooltipViews)i.dom.style.position=this.position;r=!0}if(n.parent!=this.parent){this.parent&&this.container.remove(),this.parent=n.parent,this.createContainer();for(let i of this.manager.tooltipViews)this.container.appendChild(i.dom);r=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);r&&this.maybeMeasure()}createTooltip(t,e){let r=t.create(this.view),n=e?e.dom:null;if(r.dom.classList.add("cm-tooltip"),t.arrow&&!r.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let i=document.createElement("div");i.className="cm-tooltip-arrow",r.dom.appendChild(i)}return r.dom.style.position=this.position,r.dom.style.top=R0,r.dom.style.left="0px",this.container.insertBefore(r.dom,n),r.mount&&r.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(r.dom),r}destroy(){var t,e,r;this.view.win.removeEventListener("resize",this.measureSoon);for(let n of this.manager.tooltipViews)n.dom.remove(),(t=n.destroy)===null||t===void 0||t.call(n);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(r=this.intersectionObserver)===null||r===void 0||r.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let t=1,e=1,r=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:s}=this.manager.tooltipViews[0];if(Pe.gecko)r=s.offsetParent!=this.container.ownerDocument.body;else if(s.style.top==R0&&s.style.left=="0px"){let o=s.getBoundingClientRect();r=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}}if(r||this.position=="absolute")if(this.parent){let s=this.parent.getBoundingClientRect();s.width&&s.height&&(t=s.width/this.parent.offsetWidth,e=s.height/this.parent.offsetHeight)}else({scaleX:t,scaleY:e}=this.view.viewState);let n=this.view.scrollDOM.getBoundingClientRect(),i=G6(this.view);return{visible:{left:n.left+i.left,top:n.top+i.top,right:n.right-i.right,bottom:n.bottom-i.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((s,o)=>{let a=this.manager.tooltipViews[o];return a.getCoords?a.getCoords(s.pos):this.view.coordsAtPos(s.pos)}),size:this.manager.tooltipViews.map(({dom:s})=>s.getBoundingClientRect()),space:this.view.state.facet(G4).tooltipSpace(this.view),scaleX:t,scaleY:e,makeAbsolute:r}}writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let a of this.manager.tooltipViews)a.dom.style.position="absolute"}let{visible:r,space:n,scaleX:i,scaleY:s}=t,o=[];for(let a=0;a<this.manager.tooltips.length;a++){let l=this.manager.tooltips[a],c=this.manager.tooltipViews[a],{dom:h}=c,u=t.pos[a],d=t.size[a];if(!u||l.clip!==!1&&(u.bottom<=Math.max(r.top,n.top)||u.top>=Math.min(r.bottom,n.bottom)||u.right<Math.max(r.left,n.left)-.1||u.left>Math.min(r.right,n.right)+.1)){h.style.top=R0;continue}let f=l.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,p=f?7:0,m=d.right-d.left,g=(e=xA.get(c))!==null&&e!==void 0?e:d.bottom-d.top,y=c.offset||rse,b=this.view.textDirection==vr.LTR,x=d.width>n.right-n.left?b?n.left:n.right-d.width:b?Math.max(n.left,Math.min(u.left-(f?14:0)+y.x,n.right-m)):Math.min(Math.max(n.left,u.left-m+(f?14:0)-y.x),n.right-m),S=this.above[a];!l.strictSide&&(S?u.top-g-p-y.y<n.top:u.bottom+g+p+y.y>n.bottom)&&S==n.bottom-u.bottom>u.top-n.top&&(S=this.above[a]=!S);let k=(S?u.top-n.top:n.bottom-u.bottom)-p;if(k<g&&c.resize!==!1){if(k<this.view.defaultLineHeight){h.style.top=R0;continue}xA.set(c,g),h.style.height=(g=k)/s+"px"}else h.style.height&&(h.style.height="");let w=S?u.top-g-p-y.y:u.bottom+p+y.y,_=x+m;if(c.overlap!==!0)for(let L of o)L.left<_&&L.right>x&&L.top<w+g&&L.bottom>w&&(w=S?L.top-g-2-p:L.bottom+p+2);if(this.position=="absolute"?(h.style.top=(w-t.parent.top)/s+"px",vA(h,(x-t.parent.left)/i)):(h.style.top=w/s+"px",vA(h,x/i)),f){let L=u.left+(b?y.x:-y.x)-(x+14-7);f.style.left=L/i+"px"}c.overlap!==!0&&o.push({left:x,top:w,right:_,bottom:w+g}),h.classList.toggle("cm-tooltip-above",S),h.classList.toggle("cm-tooltip-below",!S),c.positioned&&c.positioned(t.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 t of this.manager.tooltipViews)t.dom.style.top=R0}},{eventObservers:{scroll(){this.maybeMeasure()}}});function vA(t,e){let r=parseInt(t.style.left,10);(isNaN(r)||Math.abs(e-r)>1)&&(t.style.left=e+"px")}const tse=ze.baseTheme({".cm-tooltip":{zIndex:500,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:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),rse={x:0,y:0},Z6=Ne.define({enables:[J6,tse]}),Zb=Ne.define({combine:t=>t.reduce((e,r)=>e.concat(r),[])});class qv{static create(e){return new qv(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new VP(e,Zb,(r,n)=>this.createHostedView(r,n),r=>r.dom.remove())}createHostedView(e,r){let n=e.create(this.view);return n.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(n.dom,r?r.dom.nextSibling:this.dom.firstChild),this.mounted&&n.mount&&n.mount(this.view),n}mount(e){for(let r of this.manager.tooltipViews)r.mount&&r.mount(e);this.mounted=!0}positioned(e){for(let r of this.manager.tooltipViews)r.positioned&&r.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let r of this.manager.tooltipViews)(e=r.destroy)===null||e===void 0||e.call(r)}passProp(e){let r;for(let n of this.manager.tooltipViews){let i=n[e];if(i!==void 0){if(r===void 0)r=i;else if(r!==i)return}}return r}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const nse=Z6.compute([Zb],t=>{let e=t.facet(Zb);return e.length===0?null:{pos:Math.min(...e.map(r=>r.pos)),end:Math.max(...e.map(r=>{var n;return(n=r.end)!==null&&n!==void 0?n:r.pos})),create:qv.create,above:e[0].above,arrow:e.some(r=>r.arrow)}});class ise{constructor(e,r,n,i,s){this.view=e,this.source=r,this.field=n,this.setHover=i,this.hoverTime=s,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.length)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:r}=this,n=e.docView.nearest(r.target);if(!n)return;let i,s=1;if(n instanceof Jl)i=n.posAtStart;else{if(i=e.posAtCoords(r),i==null)return;let a=e.coordsAtPos(i);if(!a||r.y<a.top||r.y>a.bottom||r.x<a.left-e.defaultCharacterWidth||r.x>a.right+e.defaultCharacterWidth)return;let l=e.bidiSpans(e.state.doc.lineAt(i)).find(h=>h.from<=i&&h.to>=i),c=l&&l.dir==vr.RTL?-1:1;s=r.x<a.left?-c:c}let o=this.source(e,i,s);if(o!=null&&o.then){let a=this.pending={pos:i};o.then(l=>{this.pending==a&&(this.pending=null,l&&!(Array.isArray(l)&&!l.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(l)?l:[l])}))},l=>Mi(e.state,l,"hover tooltip"))}else o&&!(Array.isArray(o)&&!o.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(o)?o:[o])})}get tooltip(){let e=this.view.plugin(J6),r=e?e.manager.tooltips.findIndex(n=>n.create==qv.create):-1;return r>-1?e.manager.tooltipViews[r]:null}mousemove(e){var r,n;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{active:i,tooltip:s}=this;if(i.length&&s&&!sse(s.dom,e)||this.pending){let{pos:o}=i[0]||this.pending,a=(n=(r=i[0])===null||r===void 0?void 0:r.end)!==null&&n!==void 0?n:o;(o==a?this.view.posAtCoords(this.lastMove)!=o:!ose(this.view,o,a,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:r}=this;if(r.length){let{tooltip:n}=this;n&&n.dom.contains(e.relatedTarget)?this.watchTooltipLeave(n.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let r=n=>{e.removeEventListener("mouseleave",r),this.active.length&&!this.view.dom.contains(n.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",r)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const Cy=4;function sse(t,e){let{left:r,right:n,top:i,bottom:s}=t.getBoundingClientRect(),o;if(o=t.querySelector(".cm-tooltip-arrow")){let a=o.getBoundingClientRect();i=Math.min(a.top,i),s=Math.max(a.bottom,s)}return e.clientX>=r-Cy&&e.clientX<=n+Cy&&e.clientY>=i-Cy&&e.clientY<=s+Cy}function ose(t,e,r,n,i,s){let o=t.scrollDOM.getBoundingClientRect(),a=t.documentTop+t.documentPadding.top+t.contentHeight;if(o.left>n||o.right<n||o.top>i||Math.min(o.bottom,a)<i)return!1;let l=t.posAtCoords({x:n,y:i},!1);return l>=e&&l<=r}function ase(t,e={}){let r=kt.define(),n=fn.define({create(){return[]},update(i,s){if(i.length&&(e.hideOnChange&&(s.docChanged||s.selection)?i=[]:e.hideOn&&(i=i.filter(o=>!e.hideOn(s,o))),s.docChanged)){let o=[];for(let a of i){let l=s.changes.mapPos(a.pos,-1,Sn.TrackDel);if(l!=null){let c=Object.assign(Object.create(null),a);c.pos=l,c.end!=null&&(c.end=s.changes.mapPos(c.end)),o.push(c)}}i=o}for(let o of s.effects)o.is(r)&&(i=o.value),o.is(lse)&&(i=[]);return i},provide:i=>Zb.from(i)});return{active:n,extension:[n,Kr.define(i=>new ise(i,t,n,r,e.hoverTime||300)),nse]}}function WP(t,e){let r=t.plugin(J6);if(!r)return null;let n=r.manager.tooltips.indexOf(e);return n<0?null:r.manager.tooltipViews[n]}const lse=kt.define(),wA=Ne.define({combine(t){let e,r;for(let n of t)e=e||n.topContainer,r=r||n.bottomContainer;return{topContainer:e,bottomContainer:r}}});function Zm(t,e){let r=t.plugin(jP),n=r?r.specs.indexOf(e):-1;return n>-1?r.panels[n]:null}const jP=Kr.fromClass(class{constructor(t){this.input=t.state.facet(Qm),this.specs=this.input.filter(r=>r),this.panels=this.specs.map(r=>r(t));let e=t.state.facet(wA);this.top=new Sy(t,!0,e.topContainer),this.bottom=new Sy(t,!1,e.bottomContainer),this.top.sync(this.panels.filter(r=>r.top)),this.bottom.sync(this.panels.filter(r=>!r.top));for(let r of this.panels)r.dom.classList.add("cm-panel"),r.mount&&r.mount()}update(t){let e=t.state.facet(wA);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new Sy(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new Sy(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let r=t.state.facet(Qm);if(r!=this.input){let n=r.filter(l=>l),i=[],s=[],o=[],a=[];for(let l of n){let c=this.specs.indexOf(l),h;c<0?(h=l(t.view),a.push(h)):(h=this.panels[c],h.update&&h.update(t)),i.push(h),(h.top?s:o).push(h)}this.specs=n,this.panels=i,this.top.sync(s),this.bottom.sync(o);for(let l of a)l.dom.classList.add("cm-panel"),l.mount&&l.mount()}else for(let n of this.panels)n.update&&n.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>ze.scrollMargins.of(e=>{let r=e.plugin(t);return r&&{top:r.top.scrollMargin(),bottom:r.bottom.scrollMargin()}})});class Sy{constructor(e,r,n){this.view=e,this.top=r,this.container=n,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let r of this.panels)r.destroy&&e.indexOf(r)<0&&r.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 r=this.container||this.view.dom;r.insertBefore(this.dom,this.top?r.firstChild:null)}let e=this.dom.firstChild;for(let r of this.panels)if(r.dom.parentNode==this.dom){for(;e!=r.dom;)e=kA(e);e=e.nextSibling}else this.dom.insertBefore(r.dom,e);for(;e;)e=kA(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 kA(t){let e=t.nextSibling;return t.remove(),e}const Qm=Ne.define({enables:jP});class sl extends eu{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}sl.prototype.elementClass="";sl.prototype.toDOM=void 0;sl.prototype.mapMode=Sn.TrackBefore;sl.prototype.startSide=sl.prototype.endSide=-1;sl.prototype.point=!0;const L2=Ne.define(),cse=Ne.define(),hse={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Ht.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},rm=Ne.define();function use(t){return[UP(),rm.of({...hse,...t})]}const CA=Ne.define({combine:t=>t.some(e=>e)});function UP(t){return[dse]}const dse=Kr.fromClass(class{constructor(t){this.view=t,this.domAfter=null,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="
43cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(rm).map(e=>new TA(t,e)),this.fixed=!t.state.facet(CA);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(t){if(this.updateGutters(t)){let e=this.prevViewport,r=t.view.viewport,n=Math.min(e.to,r.to)-Math.max(e.from,r.from);this.syncGutters(n<(r.to-r.from)*.8)}if(t.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(CA)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let r=Ht.iter(this.view.state.facet(L2),this.view.viewport.from),n=[],i=this.gutters.map(s=>new fse(s,this.view.viewport,-this.view.documentPadding.top));for(let s of this.view.viewportLineBlocks)if(n.length&&(n=[]),Array.isArray(s.type)){let o=!0;for(let a of s.type)if(a.type==ai.Text&&o){W3(r,n,a.from);for(let l of i)l.line(this.view,a,n);o=!1}else if(a.widget)for(let l of i)l.widget(this.view,a)}else if(s.type==ai.Text){W3(r,n,s.from);for(let o of i)o.line(this.view,s,n)}else if(s.widget)for(let o of i)o.widget(this.view,s);for(let s of i)s.finish();t&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(t){let e=t.startState.facet(rm),r=t.state.facet(rm),n=t.docChanged||t.heightChanged||t.viewportChanged||!Ht.eq(t.startState.facet(L2),t.state.facet(L2),t.view.viewport.from,t.view.viewport.to);if(e==r)for(let i of this.gutters)i.update(t)&&(n=!0);else{n=!0;let i=[];for(let s of r){let o=e.indexOf(s);o<0?i.push(new TA(this.view,s)):(this.gutters[o].update(t),i.push(this.gutters[o]))}for(let s of this.gutters)s.dom.remove(),i.indexOf(s)<0&&s.destroy();for(let s of i)s.config.side=="after"?this.getDOMAfter().appendChild(s.dom):this.dom.appendChild(s.dom);this.gutters=i}return n}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:t=>ze.scrollMargins.of(e=>{let r=e.plugin(t);if(!r||r.gutters.length==0||!r.fixed)return null;let n=r.dom.offsetWidth*e.scaleX,i=r.domAfter?r.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==vr.LTR?{left:n,right:i}:{right:n,left:i}})});function SA(t){return Array.isArray(t)?t:[t]}function W3(t,e,r){for(;t.value&&t.from<=r;)t.from==r&&e.push(t.value),t.next()}class fse{constructor(e,r,n){this.gutter=e,this.height=n,this.i=0,this.cursor=Ht.iter(e.markers,r.from)}addElement(e,r,n){let{gutter:i}=this,s=(r.top-this.height)/e.scaleY,o=r.height/e.scaleY;if(this.i==i.elements.length){let a=new GP(e,o,s,n);i.elements.push(a),i.dom.appendChild(a.dom)}else i.elements[this.i].update(e,o,s,n);this.height=r.bottom,this.i++}line(e,r,n){let i=[];W3(this.cursor,i,r.from),n.length&&(i=i.concat(n));let s=this.gutter.config.lineMarker(e,r,i);s&&i.unshift(s);let o=this.gutter;i.length==0&&!o.config.renderEmptyElements||this.addElement(e,r,i)}widget(e,r){let n=this.gutter.config.widgetMarker(e,r.widget,r),i=n?[n]:null;for(let s of e.state.facet(cse)){let o=s(e,r.widget,r);o&&(i||(i=[])).push(o)}i&&this.addElement(e,r,i)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let r=e.elements.pop();e.dom.removeChild(r.dom),r.destroy()}}}class TA{constructor(e,r){this.view=e,this.config=r,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="
43cm-gutter"+(this.config.class?" "+this.config.class:"");for(let n in r.domEventHandlers)this.dom.addEventListener(n,i=>{let s=i.target,o;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let l=s.getBoundingClientRect();o=(l.top+l.bottom)/2}else o=i.clientY;let a=e.lineBlockAtHeight(o-e.documentTop);r.domEventHandlers[n](e,a,i)&&i.preventDefault()});this.markers=SA(r.markers(e)),r.initialSpacer&&(this.spacer=new GP(e,0,0,[r.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let r=this.markers;if(this.markers=SA(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let i=this.config.updateSpacer(this.spacer.markers[0],e);i!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[i])}let n=e.view.viewport;return!Ht.eq(this.markers,r,n.from,n.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class GP{constructor(e,r,n,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,r,n,i)}update(e,r,n,i){this.height!=r&&(this.height=r,this.dom.style.height=r+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),pse(this.markers,i)||this.setMarkers(e,i)}setMarkers(e,r){let n="cm-gutterElement",i=this.dom.firstChild;for(let s=0,o=0;;){let a=o,l=s<r.length?r[s++]:null,c=!1;if(l){let h=l.elementClass;h&&(n+=" "+h);for(let u=o;u<this.markers.length;u++)if(this.markers[u].compare(l)){a=u,c=!0;break}}else a=this.markers.length;for(;o<a;){let h=this.markers[o++];if(h.toDOM){h.destroy(i);let u=i.nextSibling;i.remove(),i=u}}if(!l)break;l.toDOM&&(c?i=i.nextSibling:this.dom.insertBefore(l.toDOM(e),i)),c&&o++}this.dom.className=n,this.markers=r}destroy(){this.setMarkers(null,[])}}function pse(t,e){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!t[r].compare(e[r]))return!1;return!0}const mse=Ne.define(),gse=Ne.define(),dd=Ne.define({combine(t){return oa(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,r){let n=Object.assign({},e);for(let i in r){let s=n[i],o=r[i];n[i]=s?(a,l,c)=>s(a,l,c)||o(a,l,c):o}return n}})}});class K4 extends sl{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function Y4(t,e){return t.state.facet(dd).formatNumber(e,t.state)}const yse=rm.compute([dd],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(mse)},lineMarker(e,r,n){return n.some(i=>i.toDOM)?null:new K4(Y4(e,e.state.doc.lineAt(r.from).number))},widgetMarker:(e,r,n)=>{for(let i of e.state.facet(gse)){let s=i(e,r,n);if(s)return s}return null},lineMarkerChange:e=>e.startState.facet(dd)!=e.state.facet(dd),initialSpacer(e){return new K4(Y4(e,_A(e.state.doc.lines)))},updateSpacer(e,r){let n=Y4(r.view,_A(r.view.state.doc.lines));return n==e.number?e:new K4(n)},domEventHandlers:t.facet(dd).domEventHandlers,side:"before"}));function bse(t={}){return[dd.of(t),UP(),yse]}function _A(t){let e=9;for(;e<t;)e=e*10+9;return e}const xse=new class extends sl{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},vse=L2.compute(["selection"],t=>{let e=[],r=-1;for(let n of t.selection.ranges){let i=t.doc.lineAt(n.head).from;i>r&&(r=i,e.push(xse.range(i)))}return Ht.of(e)});function wse(){return vse}let kse=0;class bs{constructor(e,r,n,i){this.name=e,this.set=r,this.base=n,this.modified=i,this.id=kse++}toString(){let{name:e}=this;for(let r of this.modified)r.name&&(e=`${r.name}(${e})`);return e}static define(e,r){let n=typeof e=="string"?e:"?";if(e instanceof bs&&(r=e),r!=null&&r.base)throw new Error("Can not derive from a modified tag");let i=new bs(n,[],null,[]);if(i.set.push(i),r)for(let s of r.set)i.set.push(s);return i}static defineModifier(e){let r=new Qb(e);return n=>n.modified.indexOf(r)>-1?n:Qb.get(n.base||n,n.modified.concat(r).sort((i,s)=>i.id-s.id))}}let Cse=0;class Qb{constructor(e){this.name=e,this.instances=[],this.id=Cse++}static get(e,r){if(!r.length)return e;let n=r[0].instances.find(a=>a.base==e&&Sse(r,a.modified));if(n)return n;let i=[],s=new bs(e.name,i,e,r);for(let a of r)a.instances.push(s);let o=Tse(r);for(let a of e.set)if(!a.modified.length)for(let l of o)i.push(Qb.get(a,l));return s}}function Sse(t,e){return t.length==e.length&&t.every((r,n)=>r==e[n])}function Tse(t){let e=[[]];for(let r=0;r<t.length;r++)for(let n=0,i=e.length;n<i;n++)e.push(e[n].concat(t[r]));return e.sort((r,n)=>n.length-r.length)}function _se(t){let e=Object.create(null);for(let r in t){let n=t[r];Array.isArray(n)||(n=[n]);for(let i of r.split(" "))if(i){let s=[],o=2,a=i;for(let u=0;;){if(a=="..."&&u>0&&u+3==i.length){o=1;break}let d=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!d)throw new RangeError("Invalid path: "+i);if(s.push(d[0]=="*"?"":d[0][0]=='"'?JSON.parse(d[0]):d[0]),u+=d[0].length,u==i.length)break;let f=i[u++];if(u==i.length&&f=="!"){o=0;break}if(f!="/")throw new RangeError("Invalid path: "+i);a=i.slice(u)}let l=s.length-1,c=s[l];if(!c)throw new RangeError("Invalid path: "+i);let h=new ex(n,o,l>0?s.slice(0,l):null);e[c]=h.sort(e[c])}}return KP.add(e)}const KP=new Lt;class ex{constructor(e,r,n,i){this.tags=e,this.mode=r,this.context=n,this.next=i}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}}ex.empty=new ex([],2,null);function YP(t,e){let r=Object.create(null);for(let s of t)if(!Array.isArray(s.tag))r[s.tag.id]=s.class;else for(let o of s.tag)r[o.id]=s.class;let{scope:n,all:i=null}=e||{};return{style:s=>{let o=i;for(let a of s)for(let l of a.set){let c=r[l.id];if(c){o=o?o+" "+c:c;break}}return o},scope:n}}function Mse(t,e){let r=null;for(let n of t){let i=n.style(e);
vendor: 26,116 bytes, line 43
43i&&(r=r?r+" "+i:i)}return r}function Ase(t,e,r,n=0,i=t.length){let s=new Ese(n,Array.isArray(e)?e:[e],r);s.highlightRange(t.cursor(),n,i,"",s.highlighters),s.flush(i)}class Ese{constructor(e,r,n){this.at=e,this.highlighters=r,this.span=n,this.class=""}startSpan(e,r){r!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=r)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,r,n,i,s){let{type:o,from:a,to:l}=e;if(a>=n||l<=r)return;o.isTop&&(s=this.highlighters.filter(f=>!f.scope||f.scope(o)));let c=i,h=Ose(e)||ex.empty,u=Mse(s,h.tags);if(u&&(c&&(c+=" "),c+=u,h.mode==1&&(i+=(i?" ":"")+u)),this.startSpan(Math.max(r,a),c),h.opaque)return;let d=e.tree&&e.tree.prop(Lt.mounted);if(d&&d.overlay){let f=e.node.enter(d.overlay[0].from+a,1),p=this.highlighters.filter(g=>!g.scope||g.scope(d.tree.type)),m=e.firstChild();for(let g=0,y=a;;g++){let b=g<d.overlay.length?d.overlay[g]:null,x=b?b.from+a:l,S=Math.max(r,y),k=Math.min(n,x);if(S<k&&m)for(;e.from<k&&(this.highlightRange(e,S,k,i,s),this.startSpan(Math.min(k,e.to),c),!(e.to>=x||!e.nextSibling())););if(!b||x>n)break;y=b.to+a,y>r&&(this.highlightRange(f.cursor(),Math.max(r,b.from+a),Math.min(n,y),"",p),this.startSpan(Math.min(n,y),c))}m&&e.parent()}else if(e.firstChild()){d&&(i="");do if(!(e.to<=r)){if(e.from>=n)break;this.highlightRange(e,r,n,i,s),this.startSpan(Math.min(n,e.to),c)}while(e.nextSibling());e.parent()}}}function Ose(t){let e=t.type.prop(KP);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const Ae=bs.define,Ty=Ae(),Rl=Ae(),MA=Ae(Rl),AA=Ae(Rl),Pl=Ae(),_y=Ae(Pl),X4=Ae(Pl),Mo=Ae(),qc=Ae(Mo),Co=Ae(),So=Ae(),j3=Ae(),P0=Ae(j3),My=Ae(),se={comment:Ty,lineComment:Ae(Ty),blockComment:Ae(Ty),docComment:Ae(Ty),name:Rl,variableName:Ae(Rl),typeName:MA,tagName:Ae(MA),propertyName:AA,attributeName:Ae(AA),className:Ae(Rl),labelName:Ae(Rl),namespace:Ae(Rl),macroName:Ae(Rl),literal:Pl,string:_y,docString:Ae(_y),character:Ae(_y),attributeValue:Ae(_y),number:X4,integer:Ae(X4),float:Ae(X4),bool:Ae(Pl),regexp:Ae(Pl),escape:Ae(Pl),color:Ae(Pl),url:Ae(Pl),keyword:Co,self:Ae(Co),null:Ae(Co),atom:Ae(Co),unit:Ae(Co),modifier:Ae(Co),operatorKeyword:Ae(Co),controlKeyword:Ae(Co),definitionKeyword:Ae(Co),moduleKeyword:Ae(Co),operator:So,derefOperator:Ae(So),arithmeticOperator:Ae(So),logicOperator:Ae(So),bitwiseOperator:Ae(So),compareOperator:Ae(So),updateOperator:Ae(So),definitionOperator:Ae(So),typeOperator:Ae(So),controlOperator:Ae(So),punctuation:j3,separator:Ae(j3),bracket:P0,angleBracket:Ae(P0),squareBracket:Ae(P0),paren:Ae(P0),brace:Ae(P0),content:Mo,heading:qc,heading1:Ae(qc),heading2:Ae(qc),heading3:Ae(qc),heading4:Ae(qc),heading5:Ae(qc),heading6:Ae(qc),contentSeparator:Ae(Mo),list:Ae(Mo),quote:Ae(Mo),emphasis:Ae(Mo),strong:Ae(Mo),link:Ae(Mo),monospace:Ae(Mo),strikethrough:Ae(Mo),inserted:Ae(),deleted:Ae(),changed:Ae(),invalid:Ae(),meta:My,documentMeta:Ae(My),annotation:Ae(My),processingInstruction:Ae(My),definition:bs.defineModifier("definition"),constant:bs.defineModifier("constant"),function:bs.defineModifier("function"),standard:bs.defineModifier("standard"),local:bs.defineModifier("local"),special:bs.defineModifier("special")};for(let t in se){let e=se[t];e instanceof bs&&(e.name=t)}YP([{tag:se.link,class:"tok-link"},{tag:se.heading,class:"tok-heading"},{tag:se.emphasis,class:"tok-emphasis"},{tag:se.strong,class:"tok-strong"},{tag:se.keyword,class:"tok-keyword"},{tag:se.atom,class:"tok-atom"},{tag:se.bool,class:"tok-bool"},{tag:se.url,class:"tok-url"},{tag:se.labelName,class:"tok-labelName"},{tag:se.inserted,class:"tok-inserted"},{tag:se.deleted,class:"tok-deleted"},{tag:se.literal,class:"tok-literal"},{tag:se.string,class:"tok-string"},{tag:se.number,class:"tok-number"},{tag:[se.regexp,se.escape,se.special(se.string)],class:"tok-string2"},{tag:se.variableName,class:"tok-variableName"},{tag:se.local(se.variableName),class:"tok-variableName tok-local"},{tag:se.definition(se.variableName),class:"tok-variableName tok-definition"},{tag:se.special(se.variableName),class:"tok-variableName2"},{tag:se.definition(se.propertyName),class:"tok-propertyName tok-definition"},{tag:se.typeName,class:"tok-typeName"},{tag:se.namespace,class:"tok-namespace"},{tag:se.className,class:"tok-className"},{tag:se.macroName,class:"tok-macroName"},{tag:se.propertyName,class:"tok-propertyName"},{tag:se.operator,class:"tok-operator"},{tag:se.comment,class:"tok-comment"},{tag:se.meta,class:"tok-meta"},{tag:se.invalid,class:"tok-invalid"},{tag:se.punctuation,class:"tok-punctuation"}]);var J4;const fh=new Lt;function XP(t){return Ne.define({combine:t?e=>e.concat(t):void 0})}const Lse=new Lt;class ks{constructor(e,r,n=[],i=""){this.data=e,this.name=i,Tr.prototype.hasOwnProperty("tree")||Object.defineProperty(Tr.prototype,"tree",{get(){return _n(this)}}),this.parser=r,this.extension=[pc.of(this),Tr.languageData.of((s,o,a)=>{let l=EA(s,o,a),c=l.type.prop(fh);if(!c)return[];let h=s.facet(c),u=l.type.prop(Lse);if(u){let d=l.resolve(o-l.from,a);for(let f of u)if(f.test(d,s)){let p=s.facet(f.facet);return f.type=="replace"?p:p.concat(h)}}return h})].concat(n)}isActiveAt(e,r,n=-1){return EA(e,r,n).type.prop(fh)==this.data}findRegions(e){let r=e.facet(pc);if((r==null?void 0:r.data)==this.data)return[{from:0,to:e.doc.length}];if(!r||!r.allowsNesting)return[];let n=[],i=(s,o)=>{if(s.prop(fh)==this.data){n.push({from:o,to:o+s.length});return}let a=s.prop(Lt.mounted);if(a){if(a.tree.prop(fh)==this.data){if(a.overlay)for(let l of a.overlay)n.push({from:l.from+o,to:l.to+o});else n.push({from:o,to:o+s.length});return}else if(a.overlay){let l=n.length;if(i(a.tree,a.overlay[0].from+o),n.length>l)return}}for(let l=0;l<s.children.length;l++){let c=s.children[l];c instanceof pr&&i(c,s.positions[l]+o)}};return i(_n(e),0),n}get allowsNesting(){return!0}}ks.setState=kt.define();function EA(t,e,r){let n=t.facet(pc),i=_n(t).topNode;if(!n||n.allowsNesting)for(let s=i;s;s=s.enter(e,r,Or.ExcludeBuffers))s.type.isTop&&(i=s);return i}class U3 extends ks{constructor(e,r,n){super(e,r,[],n),this.parser=r}static define(e){let r=XP(e.languageData);return new U3(r,e.parser.configure({props:[fh.add(n=>n.isTop?r:void 0)]}),e.name)}configure(e,r){return new U3(this.data,this.parser.configure(e),r||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function _n(t){let e=t.field(ks.state,!1);return e?e.tree:pr.empty}class Dse{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,r){let n=this.cursorPos-this.string.length;return e<n||r>=this.cursorPos?this.doc.sliceString(e,r):this.string.slice(e-n,r-n)}}let N0=null,G3=class K3{constructor(e,r,n=[],i,s,o,a,l){this.parser=e,this.state=r,this.fragments=n,this.tree=i,this.treeLen=s,this.viewport=o,this.skipped=a,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(e,r,n){return new K3(e,r,[],pr.empty,0,n,[],null)}startParse(){return this.parser.startParse(new Dse(this.state.doc),this.fragments)}work(e,r){return r!=null&&r>=this.state.doc.length&&(r=void 0),this.tree!=pr.empty&&this.isDone(r??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var n;if(typeof e=="number"){let i=Date.now()+e;e=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),r!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>r)&&r<this.state.doc.length&&this.parse.stopAt(r);;){let i=this.parse.advance();if(i)if(this.fragments=this.withoutTempSkipped(Ka.addTree(i,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(n=this.parse.stoppedAt)!==null&&n!==void 0?n:this.state.doc.length,this.tree=i,this.parse=null,this.treeLen<(r??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,r;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(r=this.parse.advance()););}),this.treeLen=e,this.tree=r,this.fragments=this.withoutTempSkipped(Ka.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let r=N0;N0=this;try{return e()}finally{N0=r}}withoutTempSkipped(e){for(let r;r=this.tempSkipped.pop();)e=OA(e,r.from,r.to);return e}changes(e,r){let{fragments:n,tree:i,treeLen:s,viewport:o,skipped:a}=this;if(this.takeTree(),!e.empty){let l=[];if(e.iterChangedRanges((c,h,u,d)=>l.push({fromA:c,toA:h,fromB:u,toB:d})),n=Ka.applyChanges(n,l),i=pr.empty,s=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){a=[];for(let c of this.skipped){let h=e.mapPos(c.from,1),u=e.mapPos(c.to,-1);h<u&&a.push({from:h,to:u})}}}return new K3(this.parser,r,n,i,s,o,a,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let r=this.skipped.length;for(let n=0;n<this.skipped.length;n++){let{from:i,to:s}=this.skipped[n];i<e.to&&s>e.from&&(this.fragments=OA(this.fragments,i,s),this.skipped.splice(n--,1))}return this.skipped.length>=r?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,r){this.skipped.push({from:e,to:r})}static getSkippingParser(e){return new class extends yR{createParse(r,n,i){let s=i[0].from,o=i[i.length-1].to;return{parsedPos:s,advance(){let l=N0;if(l){for(let c of i)l.tempSkipped.push(c);e&&(l.scheduleOn=l.scheduleOn?Promise.all([l.scheduleOn,e]):e)}return this.parsedPos=o,new pr(ls.none,[],[],o-s)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let r=this.fragments;return this.treeLen>=e&&r.length&&r[0].from==0&&r[0].to>=e}static get(){return N0}};function OA(t,e,r){return Ka.applyChanges(t,[{fromA:e,toA:r,fromB:e,toB:r}])}class wf{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let r=this.context.changes(e.changes,e.state),n=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),r.viewport.to);return r.work(20,n)||r.takeTree(),new wf(r)}static init(e){let r=Math.min(3e3,e.doc.length),n=G3.create(e.facet(pc).parser,e,{from:0,to:r});return n.work(20,r)||n.takeTree(),new wf(n)}}ks.state=fn.define({create:wf.init,update(t,e){for(let r of e.effects)if(r.is(ks.setState))return r.value;return e.startState.facet(pc)!=e.state.facet(pc)?wf.init(e.state):t.apply(e)}});let JP=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(JP=t=>{let e=-1,r=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(r):cancelIdleCallback(e)});const Z4=typeof navigator<"u"&&(!((J4=navigator.scheduling)===null||J4===void 0)&&J4.isInputPending)?()=>navigator.scheduling.isInputPending():null,Ise=Kr.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 r=this.view.state.field(ks.state).context;(r.updateViewport(e.view.viewport)||this.view.viewport.to>r.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(r)}scheduleWork(){if(this.working)return;let{state:e}=this.view,r=e.field(ks.state);(r.tree!=r.context.tree||!r.context.isDone(e.doc.length))&&(this.working=JP(this.work))}work(e){this.working=null;let r=Date.now();if(this.chunkEnd<r&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=r+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:n,viewport:{to:i}}=this.view,s=n.field(ks.state);if(s.tree==s.context.tree&&s.context.isDone(i+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,e&&!Z4?Math.max(25,e.timeRemaining()-5):1e9),a=s.context.treeLen<i&&n.doc.length>i+1e3,l=s.context.work(()=>Z4&&Z4()||Date.now()>o,i+(a?0:1e5));this.chunkBudget-=Date.now()-r,(l||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:ks.setState.of(new wf(s.context))})),this.chunkBudget>0&&!(l&&!a)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(r=>Mi(this.view.state,r)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),pc=Ne.define({combine(t){return t.length?t[0]:null},enables:t=>[ks.state,Ise,ze.contentAttributes.compute([t],e=>{let r=e.facet(t);return r&&r.name?{"data-language":r.name}:{}})]});class Bse{constructor(e,r=[]){this.language=e,this.support=r,this.extension=[e,r]}}class Q{constructor(e,r,n,i,s,o=void 0){this.name=e,this.alias=r,this.extensions=n,this.filename=i,this.loadFunc=s,this.support=o,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:r,support:n}=e;if(!r){if(!n)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");r=()=>Promise.resolve(n)}return new Q(e.name,(e.alias||[]).concat(e.name).map(i=>i.toLowerCase()),e.extensions||[],e.filename,r,n)}static matchFilename(e,r){for(let i of e)if(i.filename&&i.filename.test(r))return i;let n=/\.([^.]+)$/.exec(r);if(n){for(let i of e)if(i.extensions.indexOf(n[1])>-1)return i}return null}static matchLanguageName(e,r,n=!0){r=r.toLowerCase();for(let i of e)if(i.alias.some(s=>s==r))return i;if(n)for(let i of e)for(let s of i.alias){let o=r.indexOf(s);if(o>-1&&(s.length>2||!/\w/.test(r[o-1])&&!/\w/.test(r[o+s.length])))return i}return null}}const Rse=Ne.define(),Vv=Ne.define({combine:t=>{if(!t.length)return"  ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(r=>r!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function iu(t){let e=t.facet(Vv);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function eg(t,e){let r="",n=t.tabSize,i=t.facet(Vv)[0];if(i=="	"){for(;e>=n;)r+="	",e-=n;i=" "}for(let s=0;s<e;s++)r+=i;return r}function Q6(t,e){t instanceof Tr&&(t=new Wv(t));for(let n of t.state.facet(Rse)){let i=n(t,e);if(i!==void 0)return i}let r=_n(t.state);return r.length>=e?Pse(t,r,e):null}class Wv{constructor(e,r={}){this.state=e,this.options=r,this.unit=iu(e)}lineAt(e,r=1){let n=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:s}=this.options;return i!=null&&i>=n.from&&i<=n.to?s&&i==e?{text:"",from:e}:(r<0?i<e:i<=e)?{text:n.text.slice(i-n.from),from:i}:{text:n.text.slice(0,i-n.from),from:n.from}:n}textAfterPos(e,r=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:n,from:i}=this.lineAt(e,r);return n.slice(e-i,Math.min(n.length,e+100-i))}column(e,r=1){let{text:n,from:i}=this.lineAt(e,r),s=this.countColumn(n,e-i),o=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return o>-1&&(s+=o-this.countColumn(n,n.search(/\S|$/))),s}countColumn(e,r=e.length){return Kf(e,this.state.tabSize,r)}lineIndent(e,r=1){let{text:n,from:i}=this.lineAt(e,r),s=this.options.overrideIndentation;if(s){let o=s(i);if(o>-1)return o}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const ZP=new Lt;function Pse(t,e,r){let n=e.resolveStack(r),i=e.resolveInner(r,-1).resolve(r,0).enterUnfinishedNodesBefore(r);if(i!=n.node){let s=[];for(let o=i;o&&!(o.from<n.node.from||o.to>n.node.to||o.from==n.node.from&&o.type==n.node.type);o=o.parent)s.push(o);for(let o=s.length-1;o>=0;o--)n={node:s[o],next:n}}return QP(n,t,r)}function QP(t,e,r){for(let n=t;n;n=n.next){let i=Fse(n.node);if(i)return i(e7.create(e,r,n))}return 0}function Nse(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function Fse(t){let e=t.type.prop(ZP);if(e)return e;let r=t.firstChild,n;if(r&&(n=r.type.prop(Lt.closedBy))){let i=t.lastChild,s=i&&n.indexOf(i.name)>-1;return o=>eN(o,!0,1,void 0,s&&!Nse(o)?i.from:void 0)}return t.parent==null?$se:null}function $se(){return 0}class e7 extends Wv{constructor(e,r,n){super(e.state,e.options),this.base=e,this.pos=r,this.context=n}get node(){return this.context.node}static create(e,r,n){return new e7(e,r,n)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let r=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(r.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(zse(n,e))break;r=this.state.doc.lineAt(n.from)}return this.lineIndent(r.from)}continue(){return QP(this.context.next,this.base,this.pos)}}function zse(t,e){for(let r=e;r;r=r.parent)if(t==r)return!0;return!1}function Hse(t){let e=t.node,r=e.childAfter(e.from),n=e.lastChild;if(!r)return null;let i=t.options.simulateBreak,s=t.state.doc.lineAt(r.from),o=i==null||i<=s.from?s.to:Math.min(s.to,i);for(let a=r.to;;){let l=e.childAfter(a);if(!l||l==n)return null;if(!l.type.isSkipped){if(l.from>=o)return null;let c=/^ */.exec(s.text.slice(r.to-s.from))[0].length;return{from:r.from,to:r.to+c}}a=l.to}}function fDe({closing:t,align:e=!0,units:r=1}){return n=>eN(n,e,r,t)}function eN(t,e,r,n,i){let s=t.textAfter,o=s.match(/^\s*/)[0].length,a=n&&s.slice(o,o+n.length)==n||i==t.pos+o,l=e?Hse(t):null;return l?a?t.column(l.from):t.column(l.to):t.baseIndent+(a?0:t.unit*r)}const pDe=t=>t.baseIndent;function mDe({except:t,units:e=1}={}){return r=>{let n=t&&t.test(r.textAfter);return r.baseIndent+(n?0:e*r.unit)}}const qse=200;function Vse(){return Tr.transactionFilter.of(t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let r=t.newDoc,{head:n}=t.newSelection.main,i=r.lineAt(n);if(n>i.from+qse)return t;let s=r.sliceString(i.from,n);if(!e.some(c=>c.test(s)))return t;let{state:o}=t,a=-1,l=[];for(let{head:c}of o.selection.ranges){let h=o.doc.lineAt(c);if(h.from==a)continue;a=h.from;let u=Q6(o,h.from);if(u==null)continue;let d=/^\s*/.exec(h.text)[0],f=eg(o,u);d!=f&&l.push({from:h.from,to:h.from+d.length,insert:f})}return l.length?[t,{changes:l,sequential:!0}]:t})}const Wse=Ne.define(),jse=new Lt;function gDe(t){let e=t.firstChild,r=t.lastChild;return e&&e.to<r.from?{from:e.to,to:r.type.isError?t.to:r.from}:null}function Use(t,e,r){let n=_n(t);if(n.length<r)return null;let i=n.resolveStack(r,1),s=null;for(let o=i;o;o=o.next){let a=o.node;if(a.to<=r||a.from>r)continue;if(s&&a.from<e)break;let l=a.type.prop(jse);if(l&&(a.to<n.length-50||n.length==t.doc.length||!Gse(a))){let c=l(a,t);c&&c.from<=r&&c.from>=e&&c.to>r&&(s=c)}}return s}function Gse(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function tx(t,e,r){for(let n of t.facet(Wse)){let i=n(t,e,r);if(i)return i}return Use(t,e,r)}function tN(t,e){let r=e.mapPos(t.from,1),n=e.mapPos(t.to,-1);return r>=n?void 0:{from:r,to:n}}const jv=kt.define({map:tN}),b1=kt.define({map:tN});function rN(t){let e=[];for(let{head:r}of t.state.selection.ranges)e.some(n=>n.from<=r&&n.to>=r)||e.push(t.lineBlockAt(r));return e}const su=fn.define({create(){return st.none},update(t,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((r,n)=>t=LA(t,r,n)),t=t.map(e.changes);for(let r of e.effects)if(r.is(jv)&&!Kse(t,r.value.from,r.value.to)){let{preparePlaceholder:n}=e.state.facet(sN),i=n?st.replace({widget:new toe(n(e.state,r.value))}):DA;t=t.update({add:[i.range(r.value.from,r.value.to)]})}else r.is(b1)&&(t=t.update({filter:(n,i)=>r.value.from!=n||r.value.to!=i,filterFrom:r.value.from,filterTo:r.value.to}));return e.selection&&(t=LA(t,e.selection.main.head)),t},provide:t=>ze.decorations.from(t),toJSON(t,e){let r=[];return t.between(0,e.doc.length,(n,i)=>{r.push(n,i)}),r},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let r=0;r<t.length;){let n=t[r++],i=t[r++];if(typeof n!="number"||typeof i!="number")throw new RangeError("Invalid JSON for fold state");e.push(DA.range(n,i))}return st.set(e,!0)}});function LA(t,e,r=e){let n=!1;return t.between(e,r,(i,s)=>{i<r&&s>e&&(n=!0)}),n?t.update({filterFrom:e,filterTo:r,filter:(i,s)=>i>=r||s<=e}):t}function rx(t,e,r){var n;let i=null;return(n=t.field(su,!1))===null||n===void 0||n.between(e,r,(s,o)=>{(!i||i.from>s)&&(i={from:s,to:o})}),i}function Kse(t,e,r){let n=!1;return t.between(e,e,(i,s)=>{i==e&&s==r&&(n=!0)}),n}function nN(t,e){return t.field(su,!1)?e:e.concat(kt.appendConfig.of(oN()))}const Yse=t=>{for(let e of rN(t)){let r=tx(t.state,e.from,e.to);if(r)return t.dispatch({effects:nN(t.state,[jv.of(r),iN(t,r)])}),!0}return!1},Xse=t=>{if(!t.state.field(su,!1))return!1;let e=[];for(let r of rN(t)){let n=rx(t.state,r.from,r.to);n&&e.push(b1.of(n),iN(t,n,!1))}return e.length&&t.dispatch({effects:e}),e.length>0};function iN(t,e,r=!0){let n=t.state.doc.lineAt(e.from).number,i=t.state.doc.lineAt(e.to).number;return ze.announce.of(`${t.state.phrase(r?"Folded lines":"Unfolded lines")} ${n} ${t.state.phrase("to")} ${i}.`)}const Jse=t=>{let{state:e}=t,r=[];for(let n=0;n<e.doc.length;){let i=t.lineBlockAt(n),s=tx(e,i.from,i.to);s&&r.push(jv.of(s)),n=(s?t.lineBlockAt(s.to):i).to+1}return r.length&&t.dispatch({effects:nN(t.state,r)}),!!r.length},Zse=t=>{let e=t.state.field(su,!1);if(!e||!e.size)return!1;let r=[];return e.between(0,t.state.doc.length,(n,i)=>{r.push(b1.of({from:n,to:i}))}),t.dispatch({effects:r}),!0},Qse=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:Yse},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:Xse},{key:"Ctrl-Alt-[",run:Jse},{key:"Ctrl-Alt-]",run:Zse}],eoe={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},sN=Ne.define({combine(t){return oa(t,eoe)}});function oN(t){return[su,ioe]}function aN(t,e){let{state:r}=t,n=r.facet(sN),i=o=>{let a=t.lineBlockAt(t.posAtDOM(o.target)),l=rx(t.state,a.from,a.to);l&&t.dispatch({effects:b1.of(l)}),o.preventDefault()};if(n.placeholderDOM)return n.placeholderDOM(t,i,e);let s=document.createElement("span");return s.textContent=n.placeholderText,s.setAttribute("aria-label",r.phrase("folded code")),s.title=r.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=i,s}const DA=st.replace({widget:new class extends gl{toDOM(t){return aN(t,null)}}});class toe extends gl{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return aN(e,this.value)}}const roe={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class Q4 extends sl{constructor(e,r){super(),this.config=e,this.open=r}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let r=document.createElement("span");return r.textContent=this.open?this.config.openText:this.config.closedText,r.title=e.state.phrase(this.open?"Fold line":"Unfold line"),r}}function noe(t={}){let e={...roe,...t},r=new Q4(e,!0),n=new Q4(e,!1),i=Kr.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(pc)!=o.state.facet(pc)||o.startState.field(su,!1)!=o.state.field(su,!1)||_n(o.startState)!=_n(o.state)||e.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let a=new rl;for(let l of o.viewportLineBlocks){let c=rx(o.state,l.from,l.to)?n:tx(o.state,l.from,l.to)?r:null;c&&a.add(l.from,l.from,c)}return a.finish()}}),{domEventHandlers:s}=e;return[i,use({class:"cm-foldGutter",markers(o){var a;return((a=o.plugin(i))===null||a===void 0?void 0:a.markers)||Ht.empty},initialSpacer(){return new Q4(e,!1)},domEventHandlers:{...s,click:(o,a,l)=>{if(s.click&&s.click(o,a,l))return!0;let c=rx(o.state,a.from,a.to);if(c)return o.dispatch({effects:b1.of(c)}),!0;let h=tx(o.state,a.from,a.to);return h?(o.dispatch({effects:jv.of(h)}),!0):!1}}}),oN()]}const ioe=ze.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 x1{constructor(e,r){this.specs=e;let n;function i(a){let l=dc.newName();return(n||(n=Object.create(null)))["."+l]=a,l}const s=typeof r.all=="string"?r.all:r.all?i(r.all):void 0,o=r.scope;this.scope=o instanceof ks?a=>a.prop(fh)==o.data:o?a=>a==o:void 0,this.style=YP(e.map(a=>({tag:a.tag,class:a.class||i(Object.assign({},a,{tag:null}))})),{all:s}).style,this.module=n?new dc(n):null,this.themeType=r.themeType}static define(e,r){return new x1(e,r||{})}}const Y3=Ne.define(),lN=Ne.define({combine(t){return t.length?[t[0]]:null}});function e5(t){let e=t.facet(Y3);return e.length?e:t.facet(lN)}function cN(t,e){let r=[ooe],n;return t instanceof x1&&(t.module&&r.push(ze.styleModule.of(t.module)),n=t.themeType),e!=null&&e.fallback?r.push(lN.of(t)):n?r.push(Y3.computeN([ze.darkTheme],i=>i.facet(ze.darkTheme)==(n=="dark")?[t]:[])):r.push(Y3.of(t)),r}class soe{constructor(e){this.markCache=Object.create(null),this.tree=_n(e.state),this.decorations=this.buildDeco(e,e5(e.state)),this.decoratedTo=e.viewport.to}update(e){let r=_n(e.state),n=e5(e.state),i=n!=e5(e.startState),{viewport:s}=e.view,o=e.changes.mapPos(this.decoratedTo,1);r.length<s.to&&!i&&r.type==this.tree.type&&o>=s.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(r!=this.tree||e.viewportChanged||i)&&(this.tree=r,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=s.to)}buildDeco(e,r){if(!r||!this.tree.length)return st.none;let n=new rl;for(let{from:i,to:s}of e.visibleRanges)Ase(this.tree,r,(o,a,l)=>{n.add(o,a,this.markCache[l]||(this.markCache[l]=st.mark({class:l})))},i,s);return n.finish()}}const ooe=Ec.high(Kr.fromClass(soe,{decorations:t=>t.decorations})),aoe=x1.define([{tag:se.meta,color:"#404740"},{tag:se.link,textDecoration:"underline"},{tag:se.heading,textDecoration:"underline",fontWeight:"bold"},{tag:se.emphasis,fontStyle:"italic"},{tag:se.strong,fontWeight:"bold"},{tag:se.strikethrough,textDecoration:"line-through"}
43,{tag:se.keyword,color:"#708"},{tag:[se.atom,se.bool,se.url,se.contentSeparator,se.labelName],color:"#219"},{tag:[se.literal,se.inserted],color:"#164"},{tag:[se.string,se.deleted],color:"#a11"},{tag:[se.regexp,se.escape,se.special(se.string)],color:"#e40"},{tag:se.definition(se.variableName),color:"#00f"},{tag:se.local(se.variableName),color:"#30a"},{tag:[se.typeName,se.namespace],color:"#085"},{tag:se.className,color:"#167"},{tag:[se.special(se.variableName),se.macroName],color:"#256"},{tag:se.definition(se.propertyName),color:"#00c"},{tag:se.comment,color:"#940"},{tag:se.invalid,color:"#f00"}]),loe=ze.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),hN=1e4,uN="()[]{}",dN=Ne.define({combine(t){return oa(t,{afterCursor:!0,brackets:uN,maxScanDistance:hN,renderMatch:uoe})}}),coe=st.mark({class:"cm-matchingBracket"}),hoe=st.mark({class:"cm-nonmatchingBracket"});function uoe(t){let e=[],r=t.matched?coe:hoe;return e.push(r.range(t.start.from,t.start.to)),t.end&&e.push(r.range(t.end.from,t.end.to)),e}const doe=fn.define({create(){return st.none},update(t,e){if(!e.docChanged&&!e.selection)return t;let r=[],n=e.state.facet(dN);for(let i of e.state.selection.ranges){if(!i.empty)continue;let s=qo(e.state,i.head,-1,n)||i.head>0&&qo(e.state,i.head-1,1,n)||n.afterCursor&&(qo(e.state,i.head,1,n)||i.head<e.state.doc.length&&qo(e.state,i.head+1,-1,n));s&&(r=r.concat(n.renderMatch(s,e.state)))}return st.set(r,!0)},provide:t=>ze.decorations.from(t)}),foe=[doe,loe];function poe(t={}){return[dN.of(t),foe]}const moe=new Lt;function X3(t,e,r){let n=t.prop(e<0?Lt.openedBy:Lt.closedBy);if(n)return n;if(t.name.length==1){let i=r.indexOf(t.name);if(i>-1&&i%2==(e<0?1:0))return[r[i+e]]}return null}function J3(t){let e=t.type.prop(moe);return e?e(t.node):t}function qo(t,e,r,n={}){let i=n.maxScanDistance||hN,s=n.brackets||uN,o=_n(t),a=o.resolveInner(e,r);for(let l=a;l;l=l.parent){let c=X3(l.type,r,s);if(c&&l.from<l.to){let h=J3(l);if(h&&(r>0?e>=h.from&&e<h.to:e>h.from&&e<=h.to))return goe(t,e,r,l,h,c,s)}}return yoe(t,e,r,o,a.type,i,s)}function goe(t,e,r,n,i,s,o){let a=n.parent,l={from:i.from,to:i.to},c=0,h=a==null?void 0:a.cursor();if(h&&(r<0?h.childBefore(n.from):h.childAfter(n.to)))do if(r<0?h.to<=n.from:h.from>=n.to){if(c==0&&s.indexOf(h.type.name)>-1&&h.from<h.to){let u=J3(h);return{start:l,end:u?{from:u.from,to:u.to}:void 0,matched:!0}}else if(X3(h.type,r,o))c++;else if(X3(h.type,-r,o)){if(c==0){let u=J3(h);return{start:l,end:u&&u.from<u.to?{from:u.from,to:u.to}:void 0,matched:!1}}c--}}while(r<0?h.prevSibling():h.nextSibling());return{start:l,matched:!1}}function yoe(t,e,r,n,i,s,o){let a=r<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),l=o.indexOf(a);if(l<0||l%2==0!=r>0)return null;let c={from:r<0?e-1:e,to:r>0?e+1:e},h=t.doc.iterRange(e,r>0?t.doc.length:0),u=0;for(let d=0;!h.next().done&&d<=s;){let f=h.value;r<0&&(d+=f.length);let p=e+d*r;for(let m=r>0?0:f.length-1,g=r>0?f.length:-1;m!=g;m+=r){let y=o.indexOf(f[m]);if(!(y<0||n.resolveInner(p+m,1).type!=i))if(y%2==0==r>0)u++;else{if(u==1)return{start:c,end:{from:p+m,to:p+m+1},matched:y>>1==l>>1};u--}}r>0&&(d+=f.length)}return h.done?{start:c,matched:!1}:null}function IA(t,e,r,n=0,i=0){e==null&&(e=t.search(/[^\s\u00a0]/),e==-1&&(e=t.length));let s=i;for(let o=n;o<e;o++)t.charCodeAt(o)==9?s+=r-s%r:s++;return s}class fN{constructor(e,r,n,i){this.string=e,this.tabSize=r,this.indentUnit=n,this.overrideIndent=i,this.pos=0,this.start=0,this.lastColumnPos=0,this.lastColumnValue=0}eol(){return this.pos>=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)}eat(e){let r=this.string.charAt(this.pos),n;if(typeof e=="string"?n=r==e:n=r&&(e instanceof RegExp?e.test(r):e(r)),n)return++this.pos,r}eatWhile(e){let r=this.pos;for(;this.eat(e););return this.pos>r}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let r=this.string.indexOf(e,this.pos);if(r>-1)return this.pos=r,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPos<this.start&&(this.lastColumnValue=IA(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue}indentation(){var e;return(e=this.overrideIndent)!==null&&e!==void 0?e:IA(this.string,null,this.tabSize)}match(e,r,n){if(typeof e=="string"){let i=o=>n?o.toLowerCase():o,s=this.string.substr(this.pos,e.length);return i(s)==i(e)?(r!==!1&&(this.pos+=e.length),!0):null}else{let i=this.string.slice(this.pos).match(e);return i&&i.index>
vendor: 4,835 bytes, lines 43-45
430?null:(i&&r!==!1&&(this.pos+=i[0].length),i)}}current(){return this.string.slice(this.start,this.pos)}}function boe(t){return{name:t.name||"",token:t.token,blankLine:t.blankLine||(()=>{}),startState:t.startState||(()=>!0),copyState:t.copyState||xoe,indent:t.indent||(()=>null),languageData:t.languageData||{},tokenTable:t.tokenTable||n7,mergeTokens:t.mergeTokens!==!1}}function xoe(t){if(typeof t!="object")return t;let e={};for(let r in t){let n=t[r];e[r]=n instanceof Array?n.slice():n}return e}const BA=new WeakMap;class t7 extends ks{constructor(e){let r=XP(e.languageData),n=boe(e),i,s=new class extends yR{createParse(o,a,l){return new woe(i,o,a,l)}};super(r,s,[],e.name),this.topNode=Soe(r,this),i=this,this.streamParser=n,this.stateAfter=new Lt({perNode:!0}),this.tokenTable=e.tokenTable?new yN(n.tokenTable):Coe}static define(e){return new t7(e)}getIndent(e){let r,{overrideIndentation:n}=e.options;n&&(r=BA.get(e.state),r!=null&&r<e.pos-1e4&&(r=void 0));let i=r7(this,e.node.tree,e.node.from,e.node.from,r??e.pos),s,o;if(i?(o=i.state,s=i.pos+1):(o=this.streamParser.startState(e.unit),s=e.node.from),e.pos-s>1e4)return null;for(;s<e.pos;){let l=e.state.doc.lineAt(s),c=Math.min(e.pos,l.to);if(l.length){let h=n?n(l.from):-1,u=new fN(l.text,e.state.tabSize,e.unit,h<0?void 0:h);for(;u.pos<c-l.from;)mN(this.streamParser.token,u,o)}else this.streamParser.blankLine(o,e.unit);if(c==e.pos)break;s=l.to+1}let a=e.lineAt(e.pos);return n&&r==null&&BA.set(e.state,a.from),this.streamParser.indent(o,/^\s*(.*)/.exec(a.text)[1],e)}get allowsNesting(){return!1}}function r7(t,e,r,n,i){let s=r>=n&&r+e.length<=i&&e.prop(t.stateAfter);if(s)return{state:t.streamParser.copyState(s),pos:r+e.length};for(let o=e.children.length-1;o>=0;o--){let a=e.children[o],l=r+e.positions[o],c=a instanceof pr&&l<i&&r7(t,a,l,n,i);if(c)return c}return null}function pN(t,e,r,n,i){if(i&&r<=0&&n>=e.length)return e;!i&&r==0&&e.type==t.topNode&&(i=!0);for(let s=e.children.length-1;s>=0;s--){let o=e.positions[s],a=e.children[s],l;if(o<n&&a instanceof pr){if(!(l=pN(t,a,r-o,n-o,i)))break;return i?new pr(e.type,e.children.slice(0,s).concat(l),e.positions.slice(0,s+1),o+l.length):l}}return null}function voe(t,e,r,n,i){for(let s of e){let o=s.from+(s.openStart?25:0),a=s.to-(s.openEnd?25:0),l=o<=r&&a>r&&r7(t,s.tree,0-s.offset,r,a),c;if(l&&l.pos<=n&&(c=pN(t,s.tree,r+s.offset,l.pos+s.offset,!1)))return{state:l.state,tree:c}}return{state:t.streamParser.startState(i?iu(i):4),tree:pr.empty}}class woe{constructor(e,r,n,i){this.lang=e,this.input=r,this.fragments=n,this.ranges=i,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=i[i.length-1].to;let s=G3.get(),o=i[0].from,{state:a,tree:l}=voe(e,n,o,this.to,s==null?void 0:s.state);this.state=a,this.parsedPos=this.chunkStart=o+l.length;for(let c=0;c<l.children.length;c++)this.chunks.push(l.children[c]),this.chunkPos.push(l.positions[c]);s&&this.parsedPos<s.viewport.from-1e5&&i.some(c=>c.from<=s.viewport.from&&c.to>=s.viewport.from)&&(this.state=this.lang.streamParser.startState(iu(s.state)),s.skipUntilInView(this.parsedPos,s.viewport.from),this.parsedPos=s.viewport.from),this.moveRangeIndex()}advance(){let e=G3.get(),r=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),n=Math.min(r,this.chunkStart+512);for(e&&(n=Math.min(n,e.viewport.to));this.parsedPos<n;)this.parseLine(e);return this.chunkStart<this.parsedPos&&this.finishChunk(),this.parsedPos>=r?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,r),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let r=this.input.chunk(e);if(this.input.lineChunks)r==`
44`&&(r="");else{let n=r.indexOf(`
45`);n>-1&&(r=r.slice(0,n))}return e+r.length<=this.to?r:r.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,r=this.lineAfter(e),n=e+r.length;for(let i=this.rangeIndex;;){let s=this.ranges[i].to;if(s>=n||(r=r.slice(0,s-(n-r.length)),i++,i==this.ranges.length))break;let o=this.ranges[i].from,a=this.lineAfter(o);r+=a,n=o+a.length}return{line:r,end:n}}skipGapsTo(e,r,n){for(;;){let i=this.ranges[this.rangeIndex].to,s=e+r;if(n>0?i>s:i>=s)break;let o=this.ranges[++this.rangeIndex].from;r+=o-i}return r}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(e,r,n,i){let s=4;if(this.ranges.length>1){i=this.skipGapsTo(r,i,1),r+=i;let a=this.chunk.length;i=this.skipGapsTo(n,i,-1),n+=i,s+=this.chunk.length-a}let o=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&s==4&&o>=0&&this.chunk[o]==e&&this.chunk[o+2]==r?this.chunk[o+2]=n:this.chunk.push(e,r,n,s),i}parseLine(e){let{line:r,end:n}=this.nextLine(),i=0,{streamParser:s}=this.lang,o=new fN(r,e?e.state.tabSize:4,e?iu(e.state):2);if(o.eol())s.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let a=mN(s.token,o,this.state);
45if(a&&(i=this.emitToken(this.lang.tokenTable.resolve(a),this.parsedPos+o.start,this.parsedPos+o.pos,i)),o.start>1e4)break}this.parsedPos=n,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let e=pr.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:koe,topID:0,maxBufferLength:512,reused:this.chunkReused});e=new pr(e.type,e.children,e.positions,e.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(e),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new pr(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}}function mN(t,e,r){e.start=e.pos;for(let n=0;n<10;n++){let i=t(e,r);if(e.pos>e.start)return i}throw new Error("Stream parser failed to advance stream.")}const n7=Object.create(null),tg=[ls.none],koe=new B6(tg),RA=[],PA=Object.create(null),gN=Object.create(null);for(let[t,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"]])gN[t]=bN(n7,e);class yN{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),gN)}resolve(e){return e?this.table[e]||(this.table[e]=bN(this.extra,e)):0}}const Coe=new yN(n7);function t5(t,e){RA.indexOf(t)>-1||(RA.push(t),console.warn(e))}function bN(t,e){let r=[];for(let a of e.split(" ")){let l=[];for(let c of a.split(".")){let h=t[c]||se[c];h?typeof h=="function"?l.length?l=l.map(h):t5(c,`Modifier ${c} used at start of tag`):l.length?t5(c,`Tag ${c} used as modifier`):l=Array.isArray(h)?h:[h]:t5(c,`Unknown highlighting tag ${c}`)}for(let c of l)r.push(c)}if(!r.length)return 0;let n=e.replace(/ /g,"_"),i=n+" "+r.map(a=>a.id),s=PA[i];if(s)return s.id;let o=PA[i]=ls.define({id:tg.length,name:n,props:[_se({[n]:r})]});return tg.push(o),o.id}function Soe(t,e){let r=ls.define({id:tg.length,name:"Document",props:[fh.add(()=>t),ZP.add(()=>n=>e.getIndent(n))],top:!0});return tg.push(r),r}vr.RTL,vr.LTR;function ue(t){return new Bse(t7.define(t))}function Tl(t){return J(()=>import("./index-DAqS4csD.js"),__vite__mapDeps([0,1,2])).then(e=>e.sql({dialect:e[t]}))}const Toe=[Q.of({name:"C",extensions:["c","h","ino"],load(){return J(()=>import("./index-CiLHBlJG.js"),__vite__mapDeps([3,1,2])).then(t=>t.cpp())}}),Q.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return J(()=>import("./index-CiLHBlJG.js"),__vite__mapDeps([3,1,2])).then(t=>t.cpp())}}),Q.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return Tl("Cassandra")}}),Q.of({name:"CSS",extensions:["css"],load(){return J(()=>import("./index-DvG2c2S7.js"),__vite__mapDeps([4,1,2])).then(t=>t.css())}}),Q.of({name:"Go",extensions:["go"],load(){return J(()=>import("./index-CaCUF82R.js"),__vite__mapDeps([5,1,2])).then(t=>t.go())}}),Q.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return J(()=>import("./index-bPKdmMxd.js"),__vite__mapDeps([6,1,4,2,7])).then(t=>t.html())}}),Q.of({name:"Java",extensions:["java"],load(){return J(()=>import("./index-C6N7D62z.js"),__vite__mapDeps([8,1,2])).then(t=>t.java())}}),Q.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return J(()=>import("./index-DKRu8N1Q.js"),__vite__mapDeps([7,1,2])).then(t=>t.javascript())}}),Q.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return J(()=>import("./index-7zpdcj_1.js"),__vite__mapDeps([9,1,2])).then(t=>t.json())}}),Q.of({name:"JSX",extensions:["jsx"],load(){return J(()=>import("./index-DKRu8N1Q.js"),__vite__mapDeps([7,1,2])).then(t=>t.javascript({jsx:!0}))}}),Q.of({name:"LESS",extensions:["less"],load(){return J(()=>import("./index-0Kd400uD.js"),__vite__mapDeps([10,4,1,2])).then(t=>t.less())}}),Q.of({name:"Liquid",extensions:["liquid"],load(){return J(()=>import("./index-DCPaS6T1.js"),__vite__mapDeps([11,6,1,4,2,7])).then(t=>t.liquid())}}),Q.of({name:"MariaDB SQL",load(){return Tl("MariaSQL")}}),Q.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return J(()=>import("./index-KpMPVkJh.js"),__vite__mapDeps([12,6,1,4,2,7])).then(t=>t.markdown())}}),Q.of({name:"MS SQL",load(){return Tl("MSSQL")}}),Q.of({name:"MySQL",load(){return Tl("MySQL")}}),Q.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return J(()=>import("./index-VAv27RLr.js"),__vite__mapDeps([13,1,6,4,2,7])).then(t=>t.php())}}),Q.of({name:"PLSQL",extensions:["pls"],load(){return Tl("PLSQL")}}),Q.of({name:"PostgreSQL",load(){return Tl("PostgreSQL")}}),Q.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return J(()=>import("./index-qBm-vpDv.js"),__vite__mapDeps([14,1,2])).then(t=>t.python())}}),Q.of({name:"Rust",extensions:["rs"],load(){return J(()=>import("./index-B5eDR8Hh.js"),__vite__mapDeps([15,1,2])).then(t=>t.rust())}}),Q.of({name:"Sass",extensions:["sass"],load(){return J(()=>import("./index-Dh8XOGAw.js"),__vite__mapDeps([16,1,4,2])).then(t=>t.sass({indented:!0}))}}),Q.of({name:"SCSS",extensions:["scss"],load(){return J(()=>import("./index-Dh8XOGAw.js"),__vite__mapDeps([16,1,4,2])).then(t=>t.sass())}}),Q.of({name:"SQL",extensions:["sql"],load(){return Tl("StandardSQL")}}),Q.of({name:"SQLite",load(){return Tl("SQLite")}}),Q.of({name:"TSX",extensions:["tsx"],load(){return J(()=>import("./index-DKRu8N1Q.js"),__vite__mapDeps([7,1,2])).then(t=>
45t.javascript({jsx:!0,typescript:!0}))}}),Q.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return J(()=>import("./index-DKRu8N1Q.js"),__vite__mapDeps([7,1,2])).then(t=>t.javascript({typescript:!0}))}}),Q.of({name:"WebAssembly",extensions:["wat","wast"],load(){return J(()=>import("./index-CH1yAIyp.js"),__vite__mapDeps([17,1,2])).then(t=>t.wast())}}),Q.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return J(()=>import("./index-D0vR2Vjd.js"),__vite__mapDeps([18,1,2])).then(t=>t.xml())}}),Q.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return J(()=>import("./index-DLXmCBIE.js"),__vite__mapDeps([19,1,2])).then(t=>t.yaml())}}),Q.of({name:"APL",extensions:["dyalog","apl"],load(){return J(()=>import("./apl-B4CMkyY2.js"),[]).then(t=>ue(t.apl))}}),Q.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return J(()=>import("./asciiarmor-Df11BRmG.js"),[]).then(t=>ue(t.asciiArmor))}}),Q.of({name:"ASN.1",extensions:["asn","asn1"],load(){return J(()=>import("./asn1-CGOzndHr.js"),[]).then(t=>ue(t.asn1({})))}}),Q.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return J(()=>import("./asterisk-B-8jnY81.js"),[]).then(t=>ue(t.asterisk))}}),Q.of({name:"Brainfuck",extensions:["b","bf"],load(){return J(()=>import("./brainfuck-C4LP7Hcl.js"),[]).then(t=>ue(t.brainfuck))}}),Q.of({name:"Cobol",extensions:["cob","cpy"],load(){return J(()=>import("./cobol-XrqhtCFE.js"),[]).then(t=>ue(t.cobol))}}),Q.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return J(()=>import("./clike-wD8xDpL-.js"),[]).then(t=>ue(t.csharp))}}),Q.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return J(()=>import("./clojure-BMjYHr_A.js"),[]).then(t=>ue(t.clojure))}}),Q.of({name:"ClojureScript",extensions:["cljs"],load(){return J(()=>import("./clojure-BMjYHr_A.js"),[]).then(t=>ue(t.clojure))}}),Q.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return J(()=>import("./css-BnMrqG3P.js"),[]).then(t=>ue(t.gss))}}),Q.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return J(()=>import("./cmake-BQqOBYOt.js"),[]).then(t=>ue(t.cmake))}}),Q.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return J(()=>import("./coffeescript-S37ZYGWr.js"),[]).then(t=>ue(t.coffeeScript))}}),Q.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return J(()=>import("./commonlisp-DBKNyK5s.js"),[]).then(t=>ue(t.commonLisp))}}),Q.of({name:"Cypher",extensions:["cyp","cypher"],load(){return J(()=>import("./cypher-C_CwsFkJ.js"),[]).then(t=>ue(t.cypher))}}),Q.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return J(()=>import("./python-BuPzkPfP.js"),[]).then(t=>ue(t.cython))}}),Q.of({name:"Crystal",extensions:["cr"],load(){return J(()=>import("./crystal-SjHAIU92.js"),[]).then(t=>ue(t.crystal))}}),Q.of({name:"D",extensions:["d"],load(){return J(()=>import("./d-pRatUO7H.js"),[]).then(t=>ue(t.d))}}),Q.of({name:"Dart",extensions:["dart"],load(){return J(()=>import("./clike-wD8xDpL-.js"),[]).then(t=>ue(t.dart))}}),Q.of({name:"diff",extensions:["diff","patch"],load(){return J(()=>import("./diff-DbItnlRl.js"),[]).then(t=>ue(t.diff))}}),Q.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return J(()=>import("./dockerfile-BU1Ap__c.js"),__vite__mapDeps([20,21])).then(t=>ue(t.dockerFile))}}),Q.of({name:"DTD",extensions:["dtd"],load(){return J(()=>import("./dtd-DF_7sFjM.js"),[]).then(t=>ue(t.dtd))}}),Q.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return J(()=>import("./dylan-DwRh75JA.js"),[]).then(t=>ue(t.dylan))}}),Q.of({name:"EBNF",load(){return J(()=>import("./ebnf-CDyGwa7X.js"),[]).then(t=>ue(t.ebnf))}}),Q.of({name:"ECL",extensions:["ecl"],load(){return J(()=>import("./ecl-Cabwm37j.js"),[]).then(t=>ue(t.ecl))}}),Q.of({name:"edn",extensions:["edn"],load(){return J(()=>import("./clojure-BMjYHr_A.js"),[]).then(t=>ue(t.clojure))}}),Q.of({name:"Eiffel",extensions:["e"],load(){return J(()=>import("./eiffel-CnydiIhH.js"),[]).then(t=>ue(t.eiffel))}}),Q.of({name:"Elm",extensions:["elm"],load(){return J(()=>import("./elm-vLlmbW-K.js"),[]).then(t=>ue(t.elm))}}),Q.of({name:"Erlang",extensions:["erl"],load(){return J(()=>import("./erlang-BNw1qcRV.js"),[]).then(t=>ue(t.erlang))}}),Q.of({name:"Esper",load(){return J(()=>import("./sql-C4g8LzGK.js"),[]).then(t=>ue(t.esper))}}),Q.of({name:"Factor",extensions:["factor"],load(){return J(()=>import("./factor-BPndPnYX.js"),__vite__mapDeps([22,21])).then(t=>ue(t.factor))}}),Q.of({name:"FCL",load(){return J(()=>import("./fcl-Kvtd6kyn.js"),[]).then(t=>ue(t.fcl))}}),Q.of({name:"Forth",extensions:["forth","fth","4th"],load(){return J(()=>import("./forth-Ffai-XNe.js"),[]).then(t=>ue(t.forth))}}),Q.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return J(()=>import("./fortran-DYz_wnZ1.js"),[]).then(t=>ue(t.fortran))}}),Q.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return J(()=>import("./mllike-C_8OmSiT.js"),[]).then(t=>ue(t.fSharp))}}),Q.of({name:"Gas",extensions:["s"],load(){return J(()=>import("./gas-Bneqetm1.js"),[]).then(t=>ue(t.gas))}}),Q.of({name:"Gherkin",extensions:["feature"],load(){return J(()=>import("./gherkin-heZmZLOM.js"),[]).then(t=>ue(t.gherkin))}}),Q.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return J(()=>import("./groovy-D9Dt4D0W.js"),[]).then(t=>ue(t.groovy))}}),Q.of({name:"Haskell",extensions:["hs"],load(){return J(()=>
45import("./haskell-BWDZoCOh.js"),[]).then(t=>ue(t.haskell))}}),Q.of({name:"Haxe",extensions:["hx"],load(){return J(()=>import("./haxe-pv4rovob.js"),[]).then(t=>ue(t.haxe))}}),Q.of({name:"HXML",extensions:["hxml"],load(){return J(()=>import("./haxe-pv4rovob.js"),[]).then(t=>ue(t.hxml))}}),Q.of({name:"HTTP",load(){return J(()=>import("./http-DBlCnlav.js"),[]).then(t=>ue(t.http))}}),Q.of({name:"IDL",extensions:["pro"],load(){return J(()=>import("./idl-BEugSyMb.js"),[]).then(t=>ue(t.idl))}}),Q.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return J(()=>import("./javascript-iSgyE4tI.js"),[]).then(t=>ue(t.jsonld))}}),Q.of({name:"Jinja2",extensions:["j2","jinja","jinja2"],load(){return J(()=>import("./jinja2-C4DGRd-O.js"),[]).then(t=>ue(t.jinja2))}}),Q.of({name:"Julia",extensions:["jl"],load(){return J(()=>import("./julia-DuME0IfC.js"),[]).then(t=>ue(t.julia))}}),Q.of({name:"Kotlin",extensions:["kt","kts"],load(){return J(()=>import("./clike-wD8xDpL-.js"),[]).then(t=>ue(t.kotlin))}}),Q.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return J(()=>import("./livescript-k3uCVVjK.js"),[]).then(t=>ue(t.liveScript))}}),Q.of({name:"Lua",extensions:["lua"],load(){return J(()=>import("./lua-BgMRiT3U.js"),[]).then(t=>ue(t.lua))}}),Q.of({name:"mIRC",extensions:["mrc"],load(){return J(()=>import("./mirc-CjQqDB4T.js"),[]).then(t=>ue(t.mirc))}}),Q.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return J(()=>import("./mathematica-DTrFuWx2.js"),[]).then(t=>ue(t.mathematica))}}),Q.of({name:"Modelica",extensions:["mo"],load(){return J(()=>import("./modelica-Dc1JOy9r.js"),[]).then(t=>ue(t.modelica))}}),Q.of({name:"MUMPS",extensions:["mps"],load(){return J(()=>import("./mumps-BT43cFF4.js"),[]).then(t=>ue(t.mumps))}}),Q.of({name:"Mbox",extensions:["mbox"],load(){return J(()=>import("./mbox-CNhZ1qSd.js"),[]).then(t=>ue(t.mbox))}}),Q.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return J(()=>import("./nginx-DdIZxoE0.js"),[]).then(t=>ue(t.nginx))}}),Q.of({name:"NSIS",extensions:["nsh","nsi"],load(){return J(()=>import("./nsis-ClDXqMnM.js"),__vite__mapDeps([23,21])).then(t=>ue(t.nsis))}}),Q.of({name:"NTriples",extensions:["nt","nq"],load(){return J(()=>import("./ntriples-BfvgReVJ.js"),[]).then(t=>ue(t.ntriples))}}),Q.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return J(()=>import("./clike-wD8xDpL-.js"),[]).then(t=>ue(t.objectiveC))}}),Q.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return J(()=>import("./clike-wD8xDpL-.js"),[]).then(t=>ue(t.objectiveCpp))}}),Q.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return J(()=>import("./mllike-C_8OmSiT.js"),[]).then(t=>ue(t.oCaml))}}),Q.of({name:"Octave",extensions:["m"],load(){return J(()=>import("./octave-Ck1zUtKM.js"),[]).then(t=>ue(t.octave))}}),Q.of({name:"Oz",extensions:["oz"],load(){return J(()=>import("./oz-BzwKVEFT.js"),[]).then(t=>ue(t.oz))}}),Q.of({name:"Pascal",extensions:["p","pas"],load(){return J(()=>import("./pascal--L3eBynH.js"),[]).then(t=>ue(t.pascal))}}),Q.of({name:"Perl",extensions:["pl","pm"],load(){return J(()=>import("./perl-CdXCOZ3F.js"),[]).then(t=>ue(t.perl))}}),Q.of({name:"Pig",extensions:["pig"],load(){return J(()=>import("./pig-CevX1Tat.js"),[]).then(t=>ue(t.pig))}}),Q.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return J(()=>import("./powershell-CFHJl5sT.js"),[]).then(t=>ue(t.powerShell))}}),Q.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return J(()=>import("./properties-C78fOPTZ.js"),[]).then(t=>ue(t.properties))}}),Q.of({name:"ProtoBuf",extensions:["proto"],load(){return J(()=>import("./protobuf-ChK-085T.js"),[]).then(t=>ue(t.protobuf))}}),Q.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return J(()=>import("./pug-BmUsPMDj.js"),__vite__mapDeps([24,25])).then(t=>ue(t.pug))}}),Q.of({name:"Puppet",extensions:["pp"],load(){return J(()=>import("./puppet-DMA9R1ak.js"),[]).then(t=>ue(t.puppet))}}),Q.of({name:"Q",extensions:["q"],load(){return J(()=>import("./q-ZnEupP5q.js"),[]).then(t=>ue(t.q))}}),Q.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return J(()=>import("./r-DUYO_cvP.js"),[]).then(t=>ue(t.r))}}),Q.of({name:"RPM Changes",load(){return J(()=>import("./rpm-CTu-6PCP.js"),[]).then(t=>ue(t.rpmChanges))}}),Q.of({name:"RPM Spec",extensions:["spec"],load(){return J(()=>import("./rpm-CTu-6PCP.js"),[]).then(t=>ue(t.rpmSpec))}}),Q.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return J(()=>import("./ruby-B2Rjki9n.js"),[]).then(t=>ue(t.ruby))}}),Q.of({name:"SAS",extensions:["sas"],load(){return J(()=>import("./sas-B4kiWyti.js"),[]).then(t=>ue(t.sas))}}),Q.of({name:"Scala",extensions:["scala"],load(){return J(()=>import("./clike-wD8xDpL-.js"),[]).then(t=>ue(t.scala))}}),Q.of({name:"Scheme",extensions:["scm","ss"],load(){return J(()=>import("./scheme-C41bIUwD.js"),[]).then(t=>ue(t.scheme))}}
45),Q.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return J(()=>import("./shell-CjFT_Tl9.js"),[]).then(t=>ue(t.shell))}}),Q.of({name:"Sieve",extensions:["siv","sieve"],load(){return J(()=>import("./sieve-C3Gn_uJK.js"),[]).then(t=>ue(t.sieve))}}),Q.of({name:"Smalltalk",extensions:["st"],load(){return J(()=>import("./smalltalk-CnHTOXQT.js"),[]).then(t=>ue(t.smalltalk))}}),Q.of({name:"Solr",load(){return J(()=>import("./solr-DehyRSwq.js"),[]).then(t=>ue(t.solr))}}),Q.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return J(()=>import("./mllike-C_8OmSiT.js"),[]).then(t=>ue(t.sml))}}),Q.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return J(()=>import("./sparql-DkYu6x3z.js"),[]).then(t=>ue(t.sparql))}}),Q.of({name:"Spreadsheet",alias:["excel","formula"],load(){return J(()=>import("./spreadsheet-BCZA_wO0.js"),[]).then(t=>ue(t.spreadsheet))}}),Q.of({name:"Squirrel",extensions:["nut"],load(){return J(()=>import("./clike-wD8xDpL-.js"),[]).then(t=>ue(t.squirrel))}}),Q.of({name:"Stylus",extensions:["styl"],load(){return J(()=>import("./stylus-B533Al4x.js"),[]).then(t=>ue(t.stylus))}}),Q.of({name:"Swift",extensions:["swift"],load(){return J(()=>import("./swift-BzpIVaGY.js"),[]).then(t=>ue(t.swift))}}),Q.of({name:"sTeX",load(){return J(()=>import("./stex-C3f8Ysf7.js"),[]).then(t=>ue(t.stex))}}),Q.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return J(()=>import("./stex-C3f8Ysf7.js"),[]).then(t=>ue(t.stex))}}),Q.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return J(()=>import("./verilog-C6RDOZhf.js"),[]).then(t=>ue(t.verilog))}}),Q.of({name:"Tcl",extensions:["tcl"],load(){return J(()=>import("./tcl-DVfN8rqt.js"),[]).then(t=>ue(t.tcl))}}),Q.of({name:"Textile",extensions:["textile"],load(){return J(()=>import("./textile-CnDTJFAw.js"),[]).then(t=>ue(t.textile))}}),Q.of({name:"TiddlyWiki",load(){return J(()=>import("./tiddlywiki-DO-Gjzrf.js"),[]).then(t=>ue(t.tiddlyWiki))}}),Q.of({name:"Tiki wiki",load(){return J(()=>import("./tiki-DGYXhP31.js"),[]).then(t=>ue(t.tiki))}}),Q.of({name:"TOML",extensions:["toml"],load(){return J(()=>import("./toml-BXUEaScT.js"),[]).then(t=>ue(t.toml))}}),Q.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return J(()=>import("./troff-wAsdV37c.js"),[]).then(t=>ue(t.troff))}}),Q.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return J(()=>import("./ttcn-CiGrtVSZ.js"),[]).then(t=>ue(t.ttcn))}}),Q.of({name:"TTCN_CFG",extensions:["cfg"],load(){return J(()=>import("./ttcn-cfg-BIkV9KBc.js"),[]).then(t=>ue(t.ttcnCfg))}}),Q.of({name:"Turtle",extensions:["ttl"],load(){return J(()=>import("./turtle-B1tBg_DP.js"),[]).then(t=>ue(t.turtle))}}),Q.of({name:"Web IDL",extensions:["webidl"],load(){return J(()=>import("./webidl-ZXfAyPTL.js"),[]).then(t=>ue(t.webIDL))}}),Q.of({name:"VB.NET",extensions:["vb"],load(){return J(()=>import("./vb-CmGdzxic.js"),[]).then(t=>ue(t.vb))}}),Q.of({name:"VBScript",extensions:["vbs"],load(){return J(()=>import("./vbscript-BuJXcnF6.js"),[]).then(t=>ue(t.vbScript))}}),Q.of({name:"Velocity",extensions:["vtl"],load(){return J(()=>import("./velocity-D8B20fx6.js"),[]).then(t=>ue(t.velocity))}}),Q.of({name:"Verilog",extensions:["v"],load(){return J(()=>import("./verilog-C6RDOZhf.js"),[]).then(t=>ue(t.verilog))}}),Q.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return J(()=>import("./vhdl-lSbBsy5d.js"),[]).then(t=>ue(t.vhdl))}}),Q.of({name:"XQuery",extensions:["xy","xquery"],load(){return J(()=>import("./xquery-CQfU5ijd.js"),[]).then(t=>ue(t.xQuery))}}),Q.of({name:"Yacas",extensions:["ys"],load(){return J(()=>import("./yacas-BJ4BC0dw.js"),[]).then(t=>ue(t.yacas))}}),Q.of({name:"Z80",extensions:["z80"],load(){return J(()=>import("./z80-Hz9HOZM7.js"),[]).then(t=>ue(t.z80))}}),Q.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return J(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(t=>ue(t.mscgen))}}),Q.of({name:"Xù",extensions:["xu"],load(){return J(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(t=>ue(t.xu))}}),Q.of({name:"MsGenny",extensions:["msgenny"],load(){return J(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(t=>ue(t.msgenny))}}),Q.of({name:"Vue",extensions:["vue"],load(){return J(()=>import("./index-0pY9vS3C.js"),__vite__mapDeps([26,6,1,4,2,7])).then(t=>t.vue())}}),Q.of({name:"Angular Template",load(){return J(()=>import("./index-CwZwT3_E.js"),__vite__mapDeps([27,6,1,4,2,7])).then(t=>t.angular())}})],_oe="#e5c07b",NA="#e06c75",Moe="#56b6c2",Aoe="#ffffff",D2="#abb2bf",Z3="#7d8799",Eoe="#61afef",Ooe="#98c379",FA="#d19a66",Loe="#c678dd",Doe="#21252b",$A="#2c313a",zA="#282c34",r5="#353a42",Ioe="#3E4451",HA="#528bff",Boe=ze.theme({"&":{color:D2,backgroundColor:zA},".cm-content":{caretColor:HA},".cm-cursor, .cm-dropCursor":{borderLeftColor:HA},"&.cm-focused > .cm-scroller >
45 .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:Ioe},".cm-panels":{backgroundColor:Doe,color:D2},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:zA,color:Z3,border:"none"},".cm-activeLineGutter":{backgroundColor:$A},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:r5},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:r5,borderBottomColor:r5},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:$A,color:D2}}},{dark:!0}),Roe=x1.define([{tag:se.keyword,color:Loe},{tag:[se.name,se.deleted,se.character,se.propertyName,se.macroName],color:NA},{tag:[se.function(se.variableName),se.labelName],color:Eoe},{tag:[se.color,se.constant(se.name),se.standard(se.name)],color:FA},{tag:[se.definition(se.name),se.separator],color:D2},{tag:[se.typeName,se.className,se.number,se.changed,se.annotation,se.modifier,se.self,se.namespace],color:_oe},{tag:[se.operator,se.operatorKeyword,se.url,se.escape,se.regexp,se.link,se.special(se.string)],color:Moe},{tag:[se.meta,se.comment],color:Z3},{tag:se.strong,fontWeight:"bold"},{tag:se.emphasis,fontStyle:"italic"},{tag:se.strikethrough,textDecoration:"line-through"},{tag:se.link,color:Z3,textDecoration:"underline"},{tag:se.heading,fontWeight:"bold",color:NA},{tag:[se.atom,se.bool,se.special(se.variableName)],color:FA},{tag:[se.processingInstruction,se.string,se.inserted],color:Ooe},{tag:se.invalid,color:Aoe}]),Poe=[Boe,cN(Roe)];function bn(t){this.content=t}bn.prototype={constructor:bn,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,r){var n=r&&r!=t?this.remove(r):this,i=n.find(t),s=n.content.slice();return i==-1?s.push(r||t,e):(s[i+1]=e,r&&(s[i]=r)),new bn(s)},remove:function(t){var e=this.find(t);if(e==-1)return this;var r=this.content.slice();return r.splice(e,2),new bn(r)},addToStart:function(t,e){return new bn([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var r=this.remove(t).content.slice();return r.push(t,e),new bn(r)},addBefore:function(t,e,r){var n=this.remove(e),i=n.content.slice(),s=n.find(t);return i.splice(s==-1?i.length:s,0,e,r),new bn(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=bn.from(t),t.size?new bn(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=bn.from(t),t.size?new bn(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=bn.from(t);for(var r=0;r<t.content.length;r+=2)e=e.remove(t.content[r]);return e},toObject:function(){var t={};return this.forEach(function(e,r){t[e]=r}),t},get size(){return this.content.length>>1}};bn.from=function(t){if(t instanceof bn)return t;var e=[];if(t)for(var r in t)e.push(r,t[r]);return new bn(e)};function xN(t,e,r){for(let n=0;;n++){if(n==t.childCount||n==e.childCount)return t.childCount==e.childCount?null:r;let i=t.child(n),s=e.child(n);if(i==s){r+=i.nodeSize;continue}if(!i.sameMarkup(s))return r;if(i.isText&&i.text!=s.text){for(let o=0;i.text[o]==s.text[o];o++)r++;return r}if(i.content.size||s.content.size){let o=xN(i.content,s.content,r+1);if(o!=null)return o}r+=i.nodeSize}}function vN(t,e,r,n){for(let i=t.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:r,b:n};let o=t.child(--i),a=e.child(--s),l=o.nodeSize;if(o==a){r-=l,n-=l;continue}if(!o.sameMarkup(a))return{a:r,b:n};if(o.isText&&o.text!=a.text){let c=0,h=Math.min(o.text.length,a.text.length);for(;c<h&&o.text[o.text.length-c-1]==a.text[a.text.length-c-1];)c++,r--,n--;return{a:r,b:n}}if(o.content.size||a.content.size){let c=vN(o.content,a.content,r-1,n-1);if(c)return c}r-=l,n-=l}}let Se=class Xn{constructor(e,r){if(this.content=e,this.size=r||0,r==null)for(let n=0;n<e.length;n++)this.size+=e[n].nodeSize}nodesBetween(e,r,n,i=0,s){for(let o=0,a=0;a<r;o++){let l=this.content[o],c=a+l.nodeSize;if(c>e&&n(l,i+a,s||null,o)!==!1&&l.content.size){let h=a+1;l.nodesBetween(Math.max(0,e-h),Math.min(l.content.size,r-h),n,i+h)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}
vendor: 4,171 bytes, line 45
45textBetween(e,r,n,i){let s="",o=!0;return this.nodesBetween(e,r,(a,l)=>{let c=a.isText?a.text.slice(Math.max(e,l)-l,r-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&n&&(o?o=!1:s+=n),s+=c},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let r=this.lastChild,n=e.firstChild,i=this.content.slice(),s=0;for(r.isText&&r.sameMarkup(n)&&(i[i.length-1]=r.withText(r.text+n.text),s=1);s<e.content.length;s++)i.push(e.content[s]);return new Xn(i,this.size+e.size)}cut(e,r=this.size){if(e==0&&r==this.size)return this;let n=[],i=0;if(r>e)for(let s=0,o=0;o<r;s++){let a=this.content[s],l=o+a.nodeSize;l>e&&((o<e||l>r)&&(a.isText?a=a.cut(Math.max(0,e-o),Math.min(a.text.length,r-o)):a=a.cut(Math.max(0,e-o-1),Math.min(a.content.size,r-o-1))),n.push(a),i+=a.nodeSize),o=l}return new Xn(n,i)}cutByIndex(e,r){return e==r?Xn.empty:e==0&&r==this.content.length?this:new Xn(this.content.slice(e,r))}replaceChild(e,r){let n=this.content[e];if(n==r)return this;let i=this.content.slice(),s=this.size+r.nodeSize-n.nodeSize;return i[e]=r,new Xn(i,s)}addToStart(e){return new Xn([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Xn(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let r=0;r<this.content.length;r++)if(!this.content[r].eq(e.content[r]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let r=this.content[e];if(!r)throw new RangeError("Index "+e+" out of range for "+this);return r}maybeChild(e){return this.content[e]||null}forEach(e){for(let r=0,n=0;r<this.content.length;r++){let i=this.content[r];e(i,n,r),n+=i.nodeSize}}findDiffStart(e,r=0){return xN(this,e,r)}findDiffEnd(e,r=this.size,n=e.size){return vN(this,e,r,n)}findIndex(e){if(e==0)return Ay(0,e);if(e==this.size)return Ay(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,n=0;;r++){let i=this.child(r),s=n+i.nodeSize;if(s>=e)return s==e?Ay(r+1,s):Ay(r,n);n=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,r){if(!r)return Xn.empty;if(!Array.isArray(r))throw new RangeError("Invalid input for Fragment.fromJSON");return new Xn(r.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Xn.empty;let r,n=0;for(let i=0;i<e.length;i++){let s=e[i];n+=s.nodeSize,i&&s.isText&&e[i-1].sameMarkup(s)?(r||(r=e.slice(0,i)),r[r.length-1]=s.withText(r[r.length-1].text+s.text)):r&&r.push(s)}return new Xn(r||e,n)}static from(e){if(!e)return Xn.empty;if(e instanceof Xn)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new Xn([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}};Se.empty=new Se([],0);const n5={index:0,offset:0};function Ay(t,e){return n5.index=t,n5.offset=e,n5}function nx(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let r=Array.isArray(t);if(Array.isArray(e)!=r)return!1;if(r){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!nx(t[n],e[n]))return!1}else{for(let n in t)if(!(n in e)||!nx(t[n],e[n]))return!1;for(let n in e)if(!(n in t))return!1}return!0}class At{constructor(e,r){this.type=e,this.attrs=r}addToSet(e){let r,n=!1;for(let i=0;i<e.length;i++){let s=e[i];if(this.eq(s))return e;if(this.type.excludes(s.type))r||(r=e.slice(0,i));else{if(s.type.excludes(this.type))return e;!n&&s.type.rank>this.type.rank&&(r||(r=e.slice(0,i)),r.push(this),n=!0),r&&r.push(s)}}return r||(r=e.slice()),n||r.push(this),r}removeFromSet(e){for(let r=0;r<e.length;r++)if(this.eq(e[r]))return e.slice(0,r).concat(e.slice(r+1));return e}isInSet(e){for(let r=0;r<e.length;r++)if(this.eq(e[r]))return!0;return!1}eq(e){return this==e||this.type==e.type&&nx(this.attrs,e.attrs)}
vendor: 7,137 bytes, line 45
45toJSON(){let e={type:this.type.name};for(let r in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,r){if(!r)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[r.type];if(!n)throw new RangeError(`There is no mark type ${r.type} in this schema`);let i=n.create(r.attrs);return n.checkAttrs(i.attrs),i}static sameSet(e,r){if(e==r)return!0;if(e.length!=r.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(r[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return At.none;if(e instanceof At)return[e];let r=e.slice();return r.sort((n,i)=>n.type.rank-i.type.rank),r}}At.none=[];class ix extends Error{}let Ie=class Yu{constructor(e,r,n){this.content=e,this.openStart=r,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,r){let n=kN(this.content,e+this.openStart,r);return n&&new Yu(n,this.openStart,this.openEnd)}removeBetween(e,r){return new Yu(wN(this.content,e+this.openStart,r+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,r){if(!r)return Yu.empty;let n=r.openStart||0,i=r.openEnd||0;if(typeof n!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Yu(Se.fromJSON(e,r.content),n,i)}static maxOpen(e,r=!0){let n=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(r||!s.type.spec.isolating);s=s.firstChild)n++;for(let s=e.lastChild;s&&!s.isLeaf&&(r||!s.type.spec.isolating);s=s.lastChild)i++;return new Yu(e,n,i)}};Ie.empty=new Ie(Se.empty,0,0);function wN(t,e,r){let{index:n,offset:i}=t.findIndex(e),s=t.maybeChild(n),{index:o,offset:a}=t.findIndex(r);if(i==e||s.isText){if(a!=r&&!t.child(o).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(r))}if(n!=o)throw new RangeError("Removing non-flat range");return t.replaceChild(n,s.copy(wN(s.content,e-i-1,r-i-1)))}function kN(t,e,r,n){let{index:i,offset:s}=t.findIndex(e),o=t.maybeChild(i);if(s==e||o.isText)return t.cut(0,e).append(r).append(t.cut(e));let a=kN(o.content,e-s-1,r);return a&&t.replaceChild(i,o.copy(a))}function Noe(t,e,r){if(r.openStart>t.depth)throw new ix("Inserted content deeper than insertion position");if(t.depth-r.openStart!=e.depth-r.openEnd)throw new ix("Inconsistent open depths");return CN(t,e,r,0)}function CN(t,e,r,n){let i=t.index(n),s=t.node(n);if(i==e.index(n)&&n<t.depth-r.openStart){let o=CN(t,e,r,n+1);return s.copy(s.content.replaceChild(i,o))}else if(r.content.size)if(!r.openStart&&!r.openEnd&&t.depth==n&&e.depth==n){let o=t.parent,a=o.content;return zh(o,a.cut(0,t.parentOffset).append(r.content).append(a.cut(e.parentOffset)))}else{let{start:o,end:a}=Foe(r,t);return zh(s,TN(t,o,a,e,n))}else return zh(s,sx(t,e,n))}function SN(t,e){if(!e.type.compatibleContent(t.type))throw new ix("Cannot join "+e.type.name+" onto "+t.type.name)}function Q3(t,e,r){let n=t.node(r);return SN(n,e.node(r)),n}function $h(t,e){let r=e.length-1;r>=0&&t.isText&&t.sameMarkup(e[r])?e[r]=t.withText(e[r].text+t.text):e.push(t)}function nm(t,e,r,n){let i=(e||t).node(r),s=0,o=e?e.index(r):i.childCount;t&&(s=t.index(r),t.depth>r?s++:t.textOffset&&($h(t.nodeAfter,n),s++));for(let a=s;a<o;a++)$h(i.child(a),n);e&&e.depth==r&&e.textOffset&&$h(e.nodeBefore,n)}function zh(t,e){return t.type.checkContent(e),t.copy(e)}function TN(t,e,r,n,i){let s=t.depth>i&&Q3(t,e,i+1),o=n.depth>i&&Q3(r,n,i+1),a=[];return nm(null,t,i,a),s&&o&&e.index(i)==r.index(i)?(SN(s,o),$h(zh(s,TN(t,e,r,n,i+1)),a)):(s&&$h(zh(s,sx(t,e,i+1)),a),nm(e,r,i,a),o&&$h(zh(o,sx(r,n,i+1)),a)),nm(n,null,i,a),new Se(a)}function sx(t,e,r){let n=[];if(nm(null,t,r,n),t.depth>r){let i=Q3(t,e,r+1);$h(zh(i,sx(t,e,r+1)),n)}return nm(e,null,r,n),new Se(n)}function Foe(t,e){let r=e.depth-t.openStart,i=e.node(r).copy(t.content);for(let s=r-1;s>=0;s--)i=e.node(s).copy(Se.from(i));return{start:i.resolveNoCache(t.openStart+r),end:i.resolveNoCache(i.content.size-t.openEnd-r)}}class rg{constructor(e,r,n){this.pos=e,this.path=r,this.parentOffset=n,this.depth=r.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,r=this.index(this.depth);if(r==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],i=e.child(r);return n?e.child(r).cut(n):i}get nodeBefore(){let e=this.index(this.depth),r=this.pos-this.path[this.path.length-1];return r?this.parent.child(e).cut(0,r):e==0?null:this.parent.child(e-1)}posAtIndex(e,r){r=this.resolveDepth(r);let n=this.path[r*3],i=r==0?0:this.path[r*3-1]+1;for(let s=0;s<e;s++)i+=n.child(s).nodeSize;return i}marks(){let e=this.parent,r=this.index();if(e.content.size==0)return At.none;if(this.textOffset)return e.child(r).marks;let n=e.maybeChild(r-1),i=e.maybeChild(r);if(!n){let a=n;n=i,i=a}let s=n.marks;for(var o=0;o<s.length;o++)s[o].type.spec.inclusive===!1&&(!i||!s[o].isInSet(i.marks))&&(s=s[o--].removeFromSet(s));return s}marksAcross(e){let r=this.parent.maybeChild(this.index());if(!r||!r.isInline)return null;let n=r.marks,i=e.parent.maybeChild(e.index());for(var s=0;s<n.length;s++)n[s].type.spec.inclusive===!1&&(!i||!n[s].isInSet(i.marks))&&(n=n[s--].removeFromSet(n));return n}sharedDepth(e){for(let r=this.depth;r>0;r--)if(this.start(r)<=e&&this.end(r)>=e)return r;return 0}blockRange(e=this,r){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!r||r(this.node(n))))return new _N(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let r=1;r<=this.depth;r++)e+=(e?"/":"")+this.node(r).type.name+"_"+this.index(r-1);return e+":"+this.parentOffset}static resolve(e,r){if(!(r>=0&&r<=e.content.size))throw new RangeError("Position "+r+" out of range");let n=[],i=0,s=r;for(let o=e;;){let{index:a,offset:l}=o.content.findIndex(s),c=s-l;if(n.push(o,a,i+l),!c||(o=o.child(a),o.isText))break;s=c-1,i+=l+1}return new rg(r,n,s)}
vendor: 8,272 bytes, lines 45-46
45static resolveCached(e,r){let n=qA.get(e);if(n)for(let s=0;s<n.elts.length;s++){let o=n.elts[s];if(o.pos==r)return o}else qA.set(e,n=new $oe);let i=n.elts[n.i]=rg.resolve(e,r);return n.i=(n.i+1)%zoe,i}}class $oe{constructor(){this.elts=[],this.i=0}}const zoe=12,qA=new WeakMap;class _N{constructor(e,r,n){this.$from=e,this.$to=r,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const Hoe=Object.create(null);let Xa=class eC{constructor(e,r,n,i=At.none){this.type=e,this.attrs=r,this.marks=i,this.content=n||Se.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,r,n,i=0){this.content.nodesBetween(e,r,n,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,r,n,i){return this.content.textBetween(e,r,n,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,r,n){return this.type==e&&nx(this.attrs,r||e.defaultAttrs||Hoe)&&At.sameSet(this.marks,n||At.none)}copy(e=null){return e==this.content?this:new eC(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new eC(this.type,this.attrs,this.content,e)}cut(e,r=this.content.size){return e==0&&r==this.content.size?this:this.copy(this.content.cut(e,r))}slice(e,r=this.content.size,n=!1){if(e==r)return Ie.empty;let i=this.resolve(e),s=this.resolve(r),o=n?0:i.sharedDepth(r),a=i.start(o),c=i.node(o).content.cut(i.pos-a,s.pos-a);return new Ie(c,i.depth-o,s.depth-o)}replace(e,r,n){return Noe(this.resolve(e),this.resolve(r),n)}nodeAt(e){for(let r=this;;){let{index:n,offset:i}=r.content.findIndex(e);if(r=r.maybeChild(n),!r)return null;if(i==e||r.isText)return r;e-=i+1}}childAfter(e){let{index:r,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(r),index:r,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:r,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(r),index:r,offset:n};let i=this.content.child(r-1);return{node:i,index:r-1,offset:n-i.nodeSize}}resolve(e){return rg.resolveCached(this,e)}resolveNoCache(e){return rg.resolve(this,e)}rangeHasMark(e,r,n){let i=!1;return r>e&&this.nodesBetween(e,r,s=>(n.isInSet(s.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),MN(this.marks,e)}contentMatchAt(e){let r=this.type.contentMatch.matchFragment(this.content,0,e);if(!r)throw new Error("Called contentMatchAt on a node with invalid content");return r}canReplace(e,r,n=Se.empty,i=0,s=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,i,s),a=o&&o.matchFragment(this.content,r);if(!a||!a.validEnd)return!1;for(let l=i;l<s;l++)if(!this.type.allowsMarks(n.child(l).marks))return!1;return!0}canReplaceWith(e,r,n,i){if(i&&!this.type.allowsMarks(i))return!1;let s=this.contentMatchAt(e).matchType(n),o=s&&s.matchFragment(this.content,r);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=At.none;for(let r=0;r<this.marks.length;r++){let n=this.marks[r];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!At.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(r=>r.type.name)}`);this.content.forEach(r=>r.check())}toJSON(){let e={type:this.type.name};for(let r in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(r=>r.toJSON())),e}static fromJSON(e,r){if(!r)throw new RangeError("Invalid input for Node.fromJSON");let n;if(r.marks){if(!Array.isArray(r.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=r.marks.map(e.markFromJSON)}if(r.type=="text"){if(typeof r.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(r.text,n)}let i=Se.fromJSON(e,r.content),s=e.nodeType(r.type).create(r.attrs,i,n);return s.type.checkAttrs(s.attrs),s}};Xa.prototype.text=void 0;let qoe=class tC extends Xa{constructor(e,r,n,i){if(super(e,r,null,i),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):MN(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,r){return this.text.slice(e,r)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new tC(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new tC(this.type,this.attrs,e,this.marks)}cut(e=0,r=this.text.length){return e==0&&r==this.text.length?this:this.withText(this.text.slice(e,r))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function MN(t,e){for(let r=t.length-1;r>=0;r--)e=t[r].type.name+"("+e+")";return e}class ou{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,r){let n=new Voe(e,r);if(n.next==null)return ou.empty;let i=AN(n);n.next&&n.err("Unexpected trailing text");let s=Xoe(Yoe(i));return Joe(s,n),s}matchType(e){for(let r=0;r<this.next.length;r++)if(this.next[r].type==e)return this.next[r].next;return null}matchFragment(e,r=0,n=e.childCount){let i=this;for(let s=r;i&&s<n;s++)i=i.matchType(e.child(s).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:r}=this.next[e];if(!(r.isText||r.hasRequiredAttrs()))return r}return null}compatible(e){for(let r=0;r<this.next.length;r++)for(let n=0;n<e.next.length;n++)if(this.next[r].type==e.next[n].type)return!0;return!1}fillBefore(e,r=!1,n=0){let i=[this];function s(o,a){let l=o.matchFragment(e,n);if(l&&(!r||l.validEnd))return Se.from(a.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:h,next:u}=o.next[c];if(!(h.isText||h.hasRequiredAttrs())&&i.indexOf(u)==-1){i.push(u);let d=s(u,a.concat(h));if(d)return d}}return null}return s(this,[])}findWrapping(e){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==e)return this.wrapCache[n+1];let r=this.computeWrapping(e);return this.wrapCache.push(e,r),r}computeWrapping(e){let r=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let i=n.shift(),s=i.match;if(s.matchType(e)){let o=[];for(let a=i;a.type;a=a.via)o.push(a.type);return o.reverse()}for(let o=0;o<s.next.length;o++){let{type:a,next:l}=s.next[o];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in r)&&(!i.type||l.validEnd)&&(n.push({match:a.contentMatch,type:a,via:i}),r[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function r(n){e.push(n);for(let i=0;i<n.next.length;i++)e.indexOf(n.next[i].next)==-1&&r(n.next[i].next)}return r(this),e.map((n,i)=>{let s=i+(n.validEnd?"*":" ")+" ";for(let o=0;o<n.next.length;o++)s+=(o?", ":"")+n.next[o].type.name+"->"+e.indexOf(n.next[o].next);return s}).join(`
46`)}}ou.empty=new ou(!0);class Voe{constructor(e,r){this.string=e,this.nodeTypes=r,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?
vendor: 9,786 bytes, line 46
46=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function AN(t){let e=[];do e.push(Woe(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Woe(t){let e=[];do e.push(joe(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function joe(t){let e=Koe(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=Uoe(t,e);else break;return e}function VA(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function Uoe(t,e){let r=VA(t),n=r;return t.eat(",")&&(t.next!="}"?n=VA(t):n=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:r,max:n,expr:e}}function Goe(t,e){let r=t.nodeTypes,n=r[e];if(n)return[n];let i=[];for(let s in r){let o=r[s];o.isInGroup(e)&&i.push(o)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function Koe(t){if(t.eat("(")){let e=AN(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=Goe(t,t.next).map(r=>(t.inline==null?t.inline=r.isInline:t.inline!=r.isInline&&t.err("Mixing inline and block content"),{type:"name",value:r}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function Yoe(t){let e=[[]];return i(s(t,0),r()),e;function r(){return e.push([])-1}function n(o,a,l){let c={term:l,to:a};return e[o].push(c),c}function i(o,a){o.forEach(l=>l.to=a)}function s(o,a){if(o.type=="choice")return o.exprs.reduce((l,c)=>l.concat(s(c,a)),[]);if(o.type=="seq")for(let l=0;;l++){let c=s(o.exprs[l],a);if(l==o.exprs.length-1)return c;i(c,a=r())}else if(o.type=="star"){let l=r();return n(a,l),i(s(o.expr,l),l),[n(l)]}else if(o.type=="plus"){let l=r();return i(s(o.expr,a),l),i(s(o.expr,l),l),[n(l)]}else{if(o.type=="opt")return[n(a)].concat(s(o.expr,a));if(o.type=="range"){let l=a;for(let c=0;c<o.min;c++){let h=r();i(s(o.expr,l),h),l=h}if(o.max==-1)i(s(o.expr,l),l);else for(let c=o.min;c<o.max;c++){let h=r();n(l,h),i(s(o.expr,l),h),l=h}return[n(l)]}else{if(o.type=="name")return[n(a,void 0,o.value)];throw new Error("Unknown expr type")}}}}function EN(t,e){return e-t}function WA(t,e){let r=[];return n(e),r.sort(EN);function n(i){let s=t[i];if(s.length==1&&!s[0].term)return n(s[0].to);r.push(i);for(let o=0;o<s.length;o++){let{term:a,to:l}=s[o];!a&&r.indexOf(l)==-1&&n(l)}}}function Xoe(t){let e=Object.create(null);return r(WA(t,0));function r(n){let i=[];n.forEach(o=>{t[o].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let h=0;h<i.length;h++)i[h][0]==a&&(c=i[h][1]);WA(t,l).forEach(h=>{c||i.push([a,c=[]]),c.indexOf(h)==-1&&c.push(h)})})});let s=e[n.join(",")]=new ou(n.indexOf(t.length-1)>-1);for(let o=0;o<i.length;o++){let a=i[o][1].sort(EN);s.next.push({type:i[o][0],next:e[a.join(",")]||r(a)})}return s}}function Joe(t,e){for(let r=0,n=[t];r<n.length;r++){let i=n[r],s=!i.validEnd,o=[];for(let a=0;a<i.next.length;a++){let{type:l,next:c}=i.next[a];o.push(l.name),s&&!(l.isText||l.hasRequiredAttrs())&&(s=!1),n.indexOf(c)==-1&&n.push(c)}s&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function ON(t){let e=Object.create(null);for(let r in t){let n=t[r];if(!n.hasDefault)return null;e[r]=n.default}return e}function LN(t,e){let r=Object.create(null);for(let n in t){let i=e&&e[n];if(i===void 0){let s=t[n];if(s.hasDefault)i=s.default;else throw new RangeError("No value supplied for attribute "+n)}r[n]=i}return r}function DN(t,e,r,n){for(let i in e)if(!(i in t))throw new RangeError(`Unsupported attribute ${i} for ${r} of type ${i}`);for(let i in t){let s=t[i];s.validate&&s.validate(e[i])}}function IN(t,e){let r=Object.create(null);if(e)for(let n in e)r[n]=new Qoe(t,n,e[n]);return r}let ox=class BN{constructor(e,r,n){this.name=e,this.schema=r,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=IN(e,n.attrs),this.defaultAttrs=ON(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==ou.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:LN(this.attrs,e)}create(e=null,r,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Xa(this,this.computeAttrs(e),Se.from(r),At.setFrom(n))}createChecked(e=null,r,n){return r=Se.from(r),this.checkContent(r),new Xa(this,this.computeAttrs(e),r,At.setFrom(n))}createAndFill(e=null,r,n){if(e=this.computeAttrs(e),r=Se.from(r),r.size){let o=this.contentMatch.fillBefore(r);if(!o)return null;r=o.append(r)}let i=this.contentMatch.matchFragment(r),s=i&&i.fillBefore(Se.empty,!0);return s?new Xa(this,e,r.append(s),At.setFrom(n)):null}validContent(e){let r=this.contentMatch.matchFragment(e);if(!r||!r.validEnd)return!1;for(let n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){DN(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let r=0;r<e.length;r++)if(!this.allowsMarkType(e[r].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let r;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?r&&r.push(e[n]):r||(r=e.slice(0,n));return r?r.length?r:At.none:e}static compile(e,r){let n=Object.create(null);e.forEach((s,o)=>n[s]=new BN(s,r,o));let i=r.spec.topNode||"doc";if(!n[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let s in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}};function Zoe(t,e,r){let n=r.split("|");return i=>{let s=i===null?"null":typeof i;if(n.indexOf(s)<0)throw new RangeError(`Expected value of type ${n} for attribute ${e} on type ${t}, got ${s}`)}}class Qoe{constructor(e,r,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate=typeof n.validate=="string"?Zoe(e,r,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class Uv{constructor(e,r,n,i){this.name=e,this.rank=r,this.schema=n,this.spec=i,this.attrs=IN(e,i.attrs),this.excluded=null;let s=ON(this.attrs);this.instance=s?new At(this,s):null}create(e=null){return!e&&this.instance?this.instance:new At(this,LN(this.attrs,e))}static compile(e,r){let n=Object.create(null),i=0;return e.forEach((s,o)=>n[s]=new Uv(s,i++,r,o)),n}removeFromSet(e){for(var r=0;r<e.length;r++)e[r].type==this&&(e=e.slice(0,r).concat(e.slice(r+1)),r--);return e}isInSet(e){for(let r=0;r<e.length;r++)if(e[r].type==this)return e[r]}checkAttrs(e){DN(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class RN{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let r=this.spec={};for(let i in e)r[i]=e[i];r.nodes=bn.from(e.nodes),r.marks=bn.from(e.marks||{}),this.nodes=ox.compile(this.spec.nodes,this),this.marks=Uv.compile(this.spec.marks,this);let n=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let s=this.nodes[i],o=s.spec.content||"",a=s.spec.marks;if(s.contentMatch=n[o]||(n[o]=ou.parse(o,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=a=="_"?null:a?jA(this,a.split(" ")):a==""||!s.inlineContent?[]:null}for(let i in this.marks){let s=this.marks[i],o=s.spec.excludes;s.excluded=o==null?[s]:o==""?[]:jA(this,o.split(" "))}this.nodeFromJSON=i=>Xa.fromJSON(this,i),this.markFromJSON=i=>At.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,r=null,n,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof ox){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(r,n,i)}text(e,r){let n=this.nodes.text;return new qoe(n,n.defaultAttrs,e,At.setFrom(r))}mark(e,r){return typeof e=="string"&&(e=this.marks[e]),e.create(r)}nodeType(e){let r=this.nodes[e];if(!r)throw new RangeError("Unknown node type: "+e);return r}}function jA(t,e){let r=[];for(let n=0;n<e.length;n++){let i=e[n],s=t.marks[i],o=s;if(s)r.push(s);else for(let a in t.marks){let l=t.marks[a];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&r.push(o=l)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[n]+"'")}return r}function eae(t){return t.tag!=null}function tae(t){return t.style!=null}class au{constructor(e,r){this.schema=e,this.rules=r,this.tags=[],this.styles=[];let n=this.matchedStyles=[];r.forEach(i=>
vendor: 9,656 bytes, lines 46-48
46{if(eae(i))this.tags.push(i);else if(tae(i)){let s=/[^=]*/.exec(i.style)[0];n.indexOf(s)<0&&n.push(s),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let s=e.nodes[i.node];return s.contentMatch.matchType(s)})}parse(e,r={}){let n=new GA(this,r,!1);return n.addAll(e,At.none,r.from,r.to),n.finish()}parseSlice(e,r={}){let n=new GA(this,r,!0);return n.addAll(e,At.none,r.from,r.to),Ie.maxOpen(n.finish())}matchTag(e,r,n){for(let i=n?this.tags.indexOf(n)+1:0;i<this.tags.length;i++){let s=this.tags[i];if(iae(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||r.matchesContext(s.context))){if(s.getAttrs){let o=s.getAttrs(e);if(o===!1)continue;s.attrs=o||void 0}return s}}}matchStyle(e,r,n,i){for(let s=i?this.styles.indexOf(i)+1:0;s<this.styles.length;s++){let o=this.styles[s],a=o.style;if(!(a.indexOf(e)!=0||o.context&&!n.matchesContext(o.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=r))){if(o.getAttrs){let l=o.getAttrs(r);if(l===!1)continue;o.attrs=l||void 0}return o}}}static schemaRules(e){let r=[];function n(i){let s=i.priority==null?50:i.priority,o=0;for(;o<r.length;o++){let a=r[o];if((a.priority==null?50:a.priority)<s)break}r.splice(o,0,i)}for(let i in e.marks){let s=e.marks[i].spec.parseDOM;s&&s.forEach(o=>{n(o=KA(o)),o.mark||o.ignore||o.clearMark||(o.mark=i)})}for(let i in e.nodes){let s=e.nodes[i].spec.parseDOM;s&&s.forEach(o=>{n(o=KA(o)),o.node||o.ignore||o.mark||(o.node=i)})}return r}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new au(e,au.schemaRules(e)))}}const PN={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},rae={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},NN={ol:!0,ul:!0},ng=1,rC=2,im=4;function UA(t,e,r){return e!=null?(e?ng:0)|(e==="full"?rC:0):t&&t.whitespace=="pre"?ng|rC:r&~im}class Ey{constructor(e,r,n,i,s,o){this.type=e,this.attrs=r,this.marks=n,this.solid=i,this.options=o,this.content=[],this.activeMarks=At.none,this.match=s||(o&im?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let r=this.type.contentMatch.fillBefore(Se.from(e));if(r)this.match=this.type.contentMatch.matchFragment(r);else{let n=this.type.contentMatch,i;return(i=n.findWrapping(e.type))?(this.match=n,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&ng)){let n=this.content[this.content.length-1],i;if(n&&n.isText&&(i=/[ \t\r\n\u000c]+$/.exec(n.text))){let s=n;n.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-i[0].length))}}let r=Se.from(this.content);return!e&&this.match&&(r=r.append(this.match.fillBefore(Se.empty,!0))),this.type?this.type.create(this.attrs,r,this.marks):r}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!PN.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class GA{constructor(e,r,n){this.parser=e,this.options=r,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let i=r.topNode,s,o=UA(null,r.preserveWhitespace,0)|(n?im:0);i?s=new Ey(i.type,i.attrs,At.none,!0,r.topMatch||i.type.contentMatch,o):n?s=new Ey(null,null,At.none,!0,null,o):s=new Ey(e.schema.topNodeType,null,At.none,!0,null,o),this.nodes=[s],this.find=r.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,r){e.nodeType==3?this.addTextNode(e,r):e.nodeType==1&&this.addElement(e,r)}addTextNode(e,r){let n=e.nodeValue,i=this.top,s=i.options&rC?"full":this.localPreserveWS||(i.options&ng)>0;if(s==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(s)s!=="full"?n=n.replace(/\r?\n|\r/g," "):n=n.replace(/\r\n?/g,`
47`);else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let o=i.content[i.content.length-1],a=e.previousSibling;(!o||a&&a.nodeName=="BR"||o.isText&&/[ \t\r\n\u000c]$/.test(o.text))&&(n=n.slice(1))}n&&this.insertNode(this.parser.schema.text(n),r,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,r,n){let i=this.localPreserveWS,s=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),a;NN.hasOwnProperty(o)&&this.parser.normalizeLists&&nae(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,n));e:if(l?l.ignore:rae.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,r);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let c,h=this.needsBlock;if(PN.hasOwnProperty(o))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),c=!0,s.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,r);break e}let u=l&&l.skip?r:this.readStyles(e,r);u&&this.addAll(e,u),c&&this.sync(s),this.needsBlock=h}else{let c=this.readStyles(e,r);c&&this.addElementByRule(e,l,c,l.consuming===!1?a:void 0)}this.localPreserveWS=i}leafFallback(e,r){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
48`),r)}ignoreFallback(e,r){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),r,!0)}readStyles(e,r){let n=e.style;if(n&&n.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let s=this.parser.matchedStyles[i],o=n.getPropertyValue(s);if(o)for(let a=void 0;;){let l=this.parser.matchStyle(s,o,this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?r=r.filter(c=>!l.clearMark(c)):r=r.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return r}addElementByRule(e,r,n,i){let s,o;if(r.node)if(o=this.parser.schema.nodes[r.node],o.isLeaf)this.insertNode(o.create(r.attrs),n,e.nodeName=="BR")||this.leafFallback(e,n);else{let l=this.enter(o,r.attrs||null,n,r.preserveWhitespace);l&&(s=!0,n=l)}else{let l=this.parser.schema.marks[r.mark];n=n.concat(l.create(r.attrs))}let a=this.top;if(o&&o.isLeaf)this.findInside(e);else if(i)this.addElement(e,n,i);else if(r.getContent)this.findInside(e),r.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,n,!1));else{let l=e;typeof r.contentElement=="string"?l=e.querySelector(r.contentElement):typeof r.contentElement=="function"?l=r.contentElement(e):r.contentElement&&(l=r.contentElement),this.findAround(e,l,!0),this.addAll(l,n),this.findAround(e,l,!1)}s&&this.sync(a)&&this.open--}addAll(e,r,n,i){let s=n||0;for(let o=n?e.childNodes[n]:e.firstChild,a=i==null?null:e.childNodes[i];o!=a;o=o.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(o,r);this.findAtPoint(e,s)}findPlace(e,r,n){let i,s;for(let o=this.open,a=0;o>=0;o--){let l=this.nodes[o],c=l.findWrapping(e);if(c&&(!i||i.length>c.length+a)&&(i=c,s=l,!c.length))break;if(l.solid){if(n)break;a+=2}}if(!i)return null;this.sync(s);for(let o=0;o<i.length;o++)r=this.enterInner(i[o],null,r,!1);return r}insertNode(e,r,n){if(e.isInline&&this.needsBlock&&!this.top.type){let s=this.textblockFromContext();s&&(r=this.enterInner(s,null,r))}let i=this.findPlace(e,r,n);if(i){this.closeExtra();let s=this.top;s.match&&(s.match=s.match.matchType(e.type));let o=At.none;for(let a of i.concat(e.marks))(s.type?s.type.allowsMarkType(a.type):YA(a.type,e.type))&&(o=a.addToSet(o));return s.content.push(e.mark(o)),!0}return!1}enter(e,r,n,i){let s=this.findPlace(e.create(r),n,!1);return s&&(s=this.enterInner(e,r,n,!0,i)),s}enterInner(e,r,n,i=!1,s){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let a=UA(e,s,o.options);o.options&im&&o.content.length==0&&(a|=im);let l=At.none;return n=n.filter(c=>(o.type?o.type.allowsMarkType(c.type):YA(c.type,e))?(l=c.addToSet(l),!1):!0),this.nodes.push(new Ey(e,r,l,i,null,a)),this.open++,n}closeExtra(e=!1){let r=this.nodes.length-1;if(r>this.open){for(;r>this.open;r--)this.nodes[r-1].content.push(this.nodes[r].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let r=this.open;r>=0;r--){if(this.nodes[r]==e)return this.open=r,!0;this.localPreserveWS&&(this.nodes[r].options|=ng)}return!1}get currentPos(){this.closeExtra();let e=0;for(let r=this.open;r>=0;r--){let n=this.nodes[r].content;for(let i=n.length-1;i>=0;i--)e+=n[i].nodeSize;r&&e++}return e}findAtPoint(e,r){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==r&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&(this.find[r].pos=this.currentPos)}findAround(e,r,n){if(e!=r&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&r.compareDocumentPosition(this.find[i].node)&(n?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&(this.find[r].pos=this.currentPos-(e.nodeValue.length-this.find[r].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let r=e.split("/"),n=this.options.context,i=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),s=-(n?n.depth+1:0)+(i?0:1),o=(a,l)=>{for(;a>=0;a--){let c=r[a];if(c==""){if(a==r.length-1||a==0)continue;for(;l>=s;l--)if(o(a-1,l))return!0;return!1}else{let h=l>
vendor: 4,579 bytes, line 48
480||l==0&&i?this.nodes[l].type:n&&l>=s?n.node(l-s).type:null;if(!h||h.name!=c&&!h.isInGroup(c))return!1;l--}}return!0};return o(r.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let r=e.depth;r>=0;r--){let n=e.node(r).contentMatchAt(e.indexAfter(r)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let r in this.parser.schema.nodes){let n=this.parser.schema.nodes[r];if(n.isTextblock&&n.defaultAttrs)return n}}}function nae(t){for(let e=t.firstChild,r=null;e;e=e.nextSibling){let n=e.nodeType==1?e.nodeName.toLowerCase():null;n&&NN.hasOwnProperty(n)&&r?(r.appendChild(e),e=r):n=="li"?r=e:n&&(r=null)}}function iae(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function KA(t){let e={};for(let r in t)e[r]=t[r];return e}function YA(t,e){let r=e.schema.nodes;for(let n in r){let i=r[n];if(!i.allowsMarkType(t))continue;let s=[],o=a=>{s.push(a);for(let l=0;l<a.edgeCount;l++){let{type:c,next:h}=a.edge(l);if(c==e||s.indexOf(h)<0&&o(h))return!0}};if(o(i.contentMatch))return!0}}class _u{constructor(e,r){this.nodes=e,this.marks=r}serializeFragment(e,r={},n){n||(n=i5(r).createDocumentFragment());let i=n,s=[];return e.forEach(o=>{if(s.length||o.marks.length){let a=0,l=0;for(;a<s.length&&l<o.marks.length;){let c=o.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(s[a][0])||c.type.spec.spanning===!1)break;a++,l++}for(;a<s.length;)i=s.pop()[1];for(;l<o.marks.length;){let c=o.marks[l++],h=this.serializeMark(c,o.isInline,r);h&&(s.push([c,i]),i.appendChild(h.dom),i=h.contentDOM||h.dom)}}i.appendChild(this.serializeNodeInner(o,r))}),n}serializeNodeInner(e,r){let{dom:n,contentDOM:i}=I2(i5(r),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,r,i)}return n}serializeNode(e,r={}){let n=this.serializeNodeInner(e,r);for(let i=e.marks.length-1;i>=0;i--){let s=this.serializeMark(e.marks[i],e.isInline,r);s&&((s.contentDOM||s.dom).appendChild(n),n=s.dom)}return n}serializeMark(e,r,n={}){let i=this.marks[e.type.name];return i&&I2(i5(n),i(e,r),null,e.attrs)}static renderSpec(e,r,n=null,i){return I2(e,r,n,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new _u(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let r=XA(e.nodes);return r.text||(r.text=n=>n.text),r}static marksFromSchema(e){return XA(e.marks)}}function XA(t){let e={};for(let r in t){let n=t[r].spec.toDOM;n&&(e[r]=n)}return e}function i5(t){return t.document||window.document}const JA=new WeakMap;function sae(t){let e=JA.get(t);return e===void 0&&JA.set(t,e=oae(t)),e}function oae(t){let e=null;function r(n){if(n&&typeof n=="object")if(Array.isArray(n))if(typeof n[0]=="string")e||(e=[]),e.push(n);else for(let i=0;i<n.length;i++)r(n[i]);else for(let i in n)r(n[i])}return r(t),e}function I2(t,e,r,n){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let i=e[0],s;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(n&&(s=sae(n))&&s.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=i.indexOf(" ");o>0&&(r=i.slice(0,o),i=i.slice(o+1));let a,l=r?t.createElementNS(r,i):t.createElement(i),c=e[1],h=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){h=2;for(let u in c)if(c[u]!=null){let d=u.indexOf(" ");d>0?l.setAttributeNS(u.slice(0,d),u.slice(d+1),c[u]):u=="style"&&l.style?l.style.cssText=c[u]:l.setAttribute(u,c[u])}}for(let u=h;u<e.length;u++){let d=e[u];if(d===0){if(u<e.length-1||u>h)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:f,contentDOM:p}=I2(t,d,r,n);if(l.appendChild(f),p){if(a)throw new RangeError("Multiple content holes");a=p}}}return{dom:l,contentDOM:a}}const FN=65535,$N=Math.pow(2,16);function aae(t,e){return t+e*$N}function ZA(t){return t&FN}function lae(t){return(t-(t&FN))/$N}const zN=1,HN=2,B2=4,qN=8;class nC{constructor(e,r,n){this.pos=e,this.delInfo=r,this.recover=n}get deleted(){return(this.delInfo&qN)>0}get deletedBefore(){return(this.delInfo&(zN|B2))>0}get deletedAfter(){return(this.delInfo&(HN|B2))>0}get deletedAcross(){return(this.delInfo&B2)>0}}class Zi{constructor(e,r=!1){if(this.ranges=e,this.inverted=r,!e.length&&Zi.empty)return Zi.empty}recover(e){let r=0,n=ZA(e);if(!this.inverted)for(let i=0;i<n;
vendor: 11,102 bytes, line 48
48i++)r+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[n*3]+r+lae(e)}mapResult(e,r=1){return this._map(e,r,!1)}map(e,r=1){return this._map(e,r,!0)}_map(e,r,n){let i=0,s=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?i:0);if(l>e)break;let c=this.ranges[a+s],h=this.ranges[a+o],u=l+c;if(e<=u){let d=c?e==l?-1:e==u?1:r:r,f=l+i+(d<0?0:h);if(n)return f;let p=e==(r<0?l:u)?null:aae(a/3,e-l),m=e==l?HN:e==u?zN:B2;return(r<0?e!=l:e!=u)&&(m|=qN),new nC(f,m,p)}i+=h-c}return n?e+i:new nC(e+i,0,null)}touches(e,r){let n=0,i=ZA(r),s=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?n:0);if(l>e)break;let c=this.ranges[a+s],h=l+c;if(e<=h&&a==i*3)return!0;n+=this.ranges[a+o]-c}return!1}forEach(e){let r=this.inverted?2:1,n=this.inverted?1:2;for(let i=0,s=0;i<this.ranges.length;i+=3){let o=this.ranges[i],a=o-(this.inverted?s:0),l=o+(this.inverted?0:s),c=this.ranges[i+r],h=this.ranges[i+n];e(a,a+c,l,l+h),s+=h-c}}invert(){return new Zi(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Zi.empty:new Zi(e<0?[0,-e,0]:[0,0,e])}}Zi.empty=new Zi([]);class ig{constructor(e,r,n=0,i=e?e.length:0){this.mirror=r,this.from=n,this.to=i,this._maps=e||[],this.ownData=!(e||r)}get maps(){return this._maps}slice(e=0,r=this.maps.length){return new ig(this._maps,this.mirror,e,r)}appendMap(e,r){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),r!=null&&this.setMirror(this._maps.length-1,r)}appendMapping(e){for(let r=0,n=this._maps.length;r<e._maps.length;r++){let i=e.getMirror(r);this.appendMap(e._maps[r],i!=null&&i<r?n+i:void 0)}}getMirror(e){if(this.mirror){for(let r=0;r<this.mirror.length;r++)if(this.mirror[r]==e)return this.mirror[r+(r%2?-1:1)]}}setMirror(e,r){this.mirror||(this.mirror=[]),this.mirror.push(e,r)}appendMappingInverted(e){for(let r=e.maps.length-1,n=this._maps.length+e._maps.length;r>=0;r--){let i=e.getMirror(r);this.appendMap(e._maps[r].invert(),i!=null&&i>r?n-i-1:void 0)}}invert(){let e=new ig;return e.appendMappingInverted(this),e}map(e,r=1){if(this.mirror)return this._map(e,r,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,r);return e}mapResult(e,r=1){return this._map(e,r,!1)}_map(e,r,n){let i=0;for(let s=this.from;s<this.to;s++){let o=this._maps[s],a=o.mapResult(e,r);if(a.recover!=null){let l=this.getMirror(s);if(l!=null&&l>s&&l<this.to){s=l,e=this._maps[l].recover(a.recover);continue}}i|=a.delInfo,e=a.pos}return n?e:new nC(e,i,null)}}const s5=Object.create(null);let Wn=class{getMap(){return Zi.empty}merge(e){return null}static fromJSON(e,r){if(!r||!r.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=s5[r.stepType];if(!n)throw new RangeError(`No step type ${r.stepType} defined`);return n.fromJSON(e,r)}static jsonID(e,r){if(e in s5)throw new RangeError("Duplicate use of step JSON ID "+e);return s5[e]=r,r.prototype.jsonID=e,r}};class jr{constructor(e,r){this.doc=e,this.failed=r}static ok(e){return new jr(e,null)}static fail(e){return new jr(null,e)}static fromReplace(e,r,n,i){try{return jr.ok(e.replace(r,n,i))}catch(s){if(s instanceof ix)return jr.fail(s.message);throw s}}}function i7(t,e,r){let n=[];for(let i=0;i<t.childCount;i++){let s=t.child(i);s.content.size&&(s=s.copy(i7(s.content,e,s))),s.isInline&&(s=e(s,r,i)),n.push(s)}return Se.fromArray(n)}class Wa extends Wn{constructor(e,r,n){super(),this.from=e,this.to=r,this.mark=n}apply(e){let r=e.slice(this.from,this.to),n=e.resolve(this.from),i=n.node(n.sharedDepth(this.to)),s=new Ie(i7(r.content,(o,a)=>!o.isAtom||!a.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),r.openStart,r.openEnd);return jr.fromReplace(e,this.from,this.to,s)}invert(){return new Vo(this.from,this.to,this.mark)}map(e){let r=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return r.deleted&&n.deleted||r.pos>=n.pos?null:new Wa(r.pos,n.pos,this.mark)}merge(e){return e instanceof Wa&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Wa(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Wa(r.from,r.to,e.markFromJSON(r.mark))}}Wn.jsonID("addMark",Wa);class Vo extends Wn{constructor(e,r,n){super(),this.from=e,this.to=r,this.mark=n}apply(e){let r=e.slice(this.from,this.to),n=new Ie(i7(r.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),r.openStart,r.openEnd);return jr.fromReplace(e,this.from,this.to,n)}invert(){return new Wa(this.from,this.to,this.mark)}map(e){let r=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return r.deleted&&n.deleted||r.pos>=n.pos?null:new Vo(r.pos,n.pos,this.mark)}merge(e){return e instanceof Vo&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Vo(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Vo(r.from,r.to,e.markFromJSON(r.mark))}}Wn.jsonID("removeMark",Vo);class Ql extends Wn{constructor(e,r){super(),this.pos=e,this.mark=r}apply(e){let r=e.nodeAt(this.pos);if(!r)return jr.fail("No node at mark step's position");let n=r.type.create(r.attrs,null,this.mark.addToSet(r.marks));return jr.fromReplace(e,this.pos,this.pos+1,new Ie(Se.from(n),0,r.isLeaf?0:1))}invert(e){let r=e.nodeAt(this.pos);if(r){let n=this.mark.addToSet(r.marks);if(n.length==r.marks.length){for(let i=0;i<r.marks.length;i++)if(!r.marks[i].isInSet(n))return new Ql(this.pos,r.marks[i]);return new Ql(this.pos,this.mark)}}return new lu(this.pos,this.mark)}map(e){let r=e.mapResult(this.pos,1);return r.deletedAfter?null:new Ql(r.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,r){if(typeof r.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Ql(r.pos,e.markFromJSON(r.mark))}}Wn.jsonID("addNodeMark",Ql);class lu extends Wn{constructor(e,r){super(),this.pos=e,this.mark=r}apply(e){let r=e.nodeAt(this.pos);if(!r)return jr.fail("No node at mark step's position");let n=r.type.create(r.attrs,null,this.mark.removeFromSet(r.marks));return jr.fromReplace(e,this.pos,this.pos+1,new Ie(Se.from(n),0,r.isLeaf?0:1))}invert(e){let r=e.nodeAt(this.pos);return!r||!this.mark.isInSet(r.marks)?this:new Ql(this.pos,this.mark)}map(e){let r=e.mapResult(this.pos,1);return r.deletedAfter?null:new lu(r.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,r){if(typeof r.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new lu(r.pos,e.markFromJSON(r.mark))}}Wn.jsonID("removeNodeMark",lu);class ln extends Wn{constructor(e,r,n,i=!1){super(),this.from=e,this.to=r,this.slice=n,this.structure=i}apply(e){return this.structure&&iC(e,this.from,this.to)?jr.fail("Structure replace would overwrite content"):jr.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Zi([this.from,this.to-this.from,this.slice.size])}invert(e){return new ln(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let r=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return r.deletedAcross&&n.deletedAcross?null:new ln(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof ln)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let r=this.slice.size+e.slice.size==0?Ie.empty:new Ie(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new ln(this.from,this.to+(e.to-e.from),r,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let r=this.slice.size+e.slice.size==0?Ie.empty:new Ie(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new ln(e.from,this.to,r,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new ln(r.from,r.to,Ie.fromJSON(e,r.slice),!!r.structure)}}Wn.jsonID("replace",ln);class $n extends Wn{constructor(e,r,n,i,s,o,a=!1){super(),this.from=e,this.to=r,this.gapFrom=n,this.gapTo=i,this.slice=s,this.insert=o,this.structure=a}apply(e){if(this.structure&&(iC(e,this.from,this.gapFrom)||iC(e,this.gapTo,this.to)))return jr.fail("Structure gap-replace would overwrite content");let r=e.slice(this.gapFrom,this.gapTo);if(r.openStart||r.openEnd)return jr.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,r.content);return n?jr.fromReplace(e,this.from,this.to,n):jr.fail("Content does not fit in gap")}getMap(){return new Zi([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let r=this.gapTo-this.gapFrom;return new $n(this.from,this.from+this.slice.size+r,this.from+this.insert,this.from+this.insert+r,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let r=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),i=this.from==this.gapFrom?r.pos:e.map(this.gapFrom,-1),s=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return r.deletedAcross&&n.deletedAcross||i<r.pos||s>n.pos?null:new $n(r.pos,n.pos,i,s,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,r){if(typeof r.from!="number"||typeof r.to!="number"||typeof r.gapFrom!="number"||typeof r.gapTo!="number"||typeof r.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new $n(r.from,r.to,r.gapFrom,r.gapTo,Ie.fromJSON(e,r.slice),r.insert,!!r.structure)}}Wn.jsonID("replaceAround",$n);function iC(t,e,r){let n=t.resolve(e),i=r-e,s=n.depth;for(;i>0&&s>0&&n.indexAfter(s)==n.node(s).childCount;)s--,i--;if(i>0){let o=n.node(s).maybeChild(n.indexAfter(s));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}function cae(t,e,r,n){let i=[],s=[],o,a;t.doc.nodesBetween(e,r,(l,c,h)=>{if(!l.isInline)return;let u=l.marks;if(!n.isInSet(u)&&h.type.allowsMarkType(n.type)){let d=Math.max(c,e),f=Math.min(c+l.nodeSize,r),p=n.addToSet(u);for(let m=0;m<u.length;m++)u[m].isInSet(p)||(o&&o.to==d&&o.mark.eq(u[m])?o.to=f:i.push(o=new Vo(d,f,u[m])));a&&a.to==d?a.to=f:s.push(a=new Wa(d,f,n))}}
vendor: 18,176 bytes, lines 48-49
48),i.forEach(l=>t.step(l)),s.forEach(l=>t.step(l))}function hae(t,e,r,n){let i=[],s=0;t.doc.nodesBetween(e,r,(o,a)=>{if(!o.isInline)return;s++;let l=null;if(n instanceof Uv){let c=o.marks,h;for(;h=n.isInSet(c);)(l||(l=[])).push(h),c=h.removeFromSet(c)}else n?n.isInSet(o.marks)&&(l=[n]):l=o.marks;if(l&&l.length){let c=Math.min(a+o.nodeSize,r);for(let h=0;h<l.length;h++){let u=l[h],d;for(let f=0;f<i.length;f++){let p=i[f];p.step==s-1&&u.eq(i[f].style)&&(d=p)}d?(d.to=c,d.step=s):i.push({style:u,from:Math.max(a,e),to:c,step:s})}}}),i.forEach(o=>t.step(new Vo(o.from,o.to,o.style)))}function s7(t,e,r,n=r.contentMatch,i=!0){let s=t.doc.nodeAt(e),o=[],a=e+1;for(let l=0;l<s.childCount;l++){let c=s.child(l),h=a+c.nodeSize,u=n.matchType(c.type);if(!u)o.push(new ln(a,h,Ie.empty));else{n=u;for(let d=0;d<c.marks.length;d++)r.allowsMarkType(c.marks[d].type)||t.step(new Vo(a,h,c.marks[d]));if(i&&c.isText&&r.whitespace!="pre"){let d,f=/\r?\n|\r/g,p;for(;d=f.exec(c.text);)p||(p=new Ie(Se.from(r.schema.text(" ",r.allowedMarks(c.marks))),0,0)),o.push(new ln(a+d.index,a+d.index+d[0].length,p))}}a=h}if(!n.validEnd){let l=n.fillBefore(Se.empty,!0);t.replace(a,a,new Ie(l,0,0))}for(let l=o.length-1;l>=0;l--)t.step(o[l])}function uae(t,e,r){return(e==0||t.canReplace(e,t.childCount))&&(r==t.childCount||t.canReplace(0,r))}function Gv(t){let r=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth;;--n){let i=t.$from.node(n),s=t.$from.index(n),o=t.$to.indexAfter(n);if(n<t.depth&&i.canReplace(s,o,r))return n;if(n==0||i.type.spec.isolating||!uae(i,s,o))break}return null}function dae(t,e,r){let{$from:n,$to:i,depth:s}=e,o=n.before(s+1),a=i.after(s+1),l=o,c=a,h=Se.empty,u=0;for(let p=s,m=!1;p>r;p--)m||n.index(p)>0?(m=!0,h=Se.from(n.node(p).copy(h)),u++):l--;let d=Se.empty,f=0;for(let p=s,m=!1;p>r;p--)m||i.after(p+1)<i.end(p)?(m=!0,d=Se.from(i.node(p).copy(d)),f++):c++;t.step(new $n(l,c,o,a,new Ie(h.append(d),u,f),h.size-u,!0))}function o7(t,e,r=null,n=t){let i=fae(t,e),s=i&&pae(n,e);return s?i.map(QA).concat({type:e,attrs:r}).concat(s.map(QA)):null}function QA(t){return{type:t,attrs:null}}function fae(t,e){let{parent:r,startIndex:n,endIndex:i}=t,s=r.contentMatchAt(n).findWrapping(e);if(!s)return null;let o=s.length?s[0]:e;return r.canReplaceWith(n,i,o)?s:null}function pae(t,e){let{parent:r,startIndex:n,endIndex:i}=t,s=r.child(n),o=e.contentMatch.findWrapping(s.type);if(!o)return null;let l=(o.length?o[o.length-1]:e).contentMatch;for(let c=n;l&&c<i;c++)l=l.matchType(r.child(c).type);return!l||!l.validEnd?null:o}function mae(t,e,r){let n=Se.empty;for(let o=r.length-1;o>=0;o--){if(n.size){let a=r[o].type.contentMatch.matchFragment(n);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}n=Se.from(r[o].type.create(r[o].attrs,n))}let i=e.start,s=e.end;t.step(new $n(i,s,i,s,new Ie(n,0,0),r.length,!0))}function gae(t,e,r,n,i){if(!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=t.steps.length;t.doc.nodesBetween(e,r,(o,a)=>{let l=typeof i=="function"?i(o):i;if(o.isTextblock&&!o.hasMarkup(n,l)&&yae(t.doc,t.mapping.slice(s).map(a),n)){let c=null;if(n.schema.linebreakReplacement){let f=n.whitespace=="pre",p=!!n.contentMatch.matchType(n.schema.linebreakReplacement);f&&!p?c=!1:!f&&p&&(c=!0)}c===!1&&WN(t,o,a,s),s7(t,t.mapping.slice(s).map(a,1),n,void 0,c===null);let h=t.mapping.slice(s),u=h.map(a,1),d=h.map(a+o.nodeSize,1);return t.step(new $n(u,d,u+1,d-1,new Ie(Se.from(n.create(l,null,o.marks)),0,0),1,!0)),c===!0&&VN(t,o,a,s),!1}})}function VN(t,e,r,n){e.forEach((i,s)=>{if(i.isText){let o,a=/\r?\n|\r/g;for(;o=a.exec(i.text);){let l=t.mapping.slice(n).map(r+1+s+o.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function WN(t,e,r,n){e.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let o=t.mapping.slice(n).map(r+1+s);t.replaceWith(o,o+1,e.type.schema.text(`
49`))}})}function yae(t,e,r){let n=t.resolve(e),i=n.index();return n.parent.canReplaceWith(i,i+1,r)}function bae(t,e,r,n,i){let s=t.doc.nodeAt(e);if(!s)throw new RangeError("No node at given position");r||(r=s.type);let o=r.create(n,null,i||s.marks);if(s.isLeaf)return t.replaceWith(e,e+s.nodeSize,o);if(!r.validContent(s.content))throw new RangeError("Invalid content for node type "+r.name);t.step(new $n(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new Ie(Se.from(o),0,0),1,!0))}function sm(t,e,r=1,n){let i=t.resolve(e),s=i.depth-r,o=n&&n[n.length-1]||i.parent;if(s<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,h=r-2;c>s;c--,h--){let u=i.node(c),d=i.index(c);if(u.type.spec.isolating)return!1;let f=u.content.cutByIndex(d,u.childCount),p=n&&n[h+1];p&&(f=f.replaceChild(0,p.type.create(p.attrs)));let m=n&&n[h]||u;if(!u.canReplace(d+1,u.childCount)||!m.type.validContent(f))return!1}let a=i.indexAfter(s),l=n&&n[0];return i.node(s).canReplaceWith(a,a,l?l.type:i.node(s+1).type)}function xae(t,e,r=1,n){let i=t.doc.resolve(e),s=Se.empty,o=Se.empty;for(let a=i.depth,l=i.depth-r,c=r-1;a>l;a--,c--){s=Se.from(i.node(a).copy(s));let h=n&&n[c];o=Se.from(h?h.type.create(h.attrs,o):i.node(a).copy(o))}t.step(new ln(e,e,new Ie(s.append(o),r,r),!0))}function Kv(t,e){let r=t.resolve(e),n=r.index();return wae(r.nodeBefore,r.nodeAfter)&&r.parent.canReplace(n,n+1)}function vae(t,e){e.content.size||t.type.compatibleContent(e.type);let r=t.contentMatchAt(t.childCount),{linebreakReplacement:n}=t.type.schema;for(let i=0;i<e.childCount;i++){let s=e.child(i),o=s.type==n?t.type.schema.nodes.text:s.type;if(r=r.matchType(o),!r||!t.type.allowsMarks(s.marks))return!1}return r.validEnd}function wae(t,e){return!!(t&&e&&!t.isLeaf&&vae(t,e))}function kae(t,e,r){let n=null,{linebreakReplacement:i}=t.doc.type.schema,s=t.doc.resolve(e-r),o=s.node().type;if(i&&o.inlineContent){let h=o.whitespace=="pre",u=!!o.contentMatch.matchType(i);h&&!u?n=!1:!h&&u&&(n=!0)}let a=t.steps.length;if(n===!1){let h=t.doc.resolve(e+r);WN(t,h.node(),h.before(),a)}o.inlineContent&&s7(t,e+r-1,o,s.node().contentMatchAt(s.index()),n==null);let l=t.mapping.slice(a),c=l.map(e-r);if(t.step(new ln(c,l.map(e+r,-1),Ie.empty,!0)),n===!0){let h=t.doc.resolve(c);VN(t,h.node(),h.before(),t.steps.length)}return t}function Cae(t,e,r){let n=t.resolve(e);if(n.parent.canReplaceWith(n.index(),n.index(),r))return e;if(n.parentOffset==0)for(let i=n.depth-1;i>=0;i--){let s=n.index(i);if(n.node(i).canReplaceWith(s,s,r))return n.before(i+1);if(s>0)return null}if(n.parentOffset==n.parent.content.size)for(let i=n.depth-1;i>=0;i--){let s=n.indexAfter(i);if(n.node(i).canReplaceWith(s,s,r))return n.after(i+1);if(s<n.node(i).childCount)return null}return null}function jN(t,e,r){let n=t.resolve(e);if(!r.content.size)return e;let i=r.content;for(let s=0;s<r.openStart;s++)i=i.firstChild.content;for(let s=1;s<=(r.openStart==0&&r.size?2:1);s++)for(let o=n.depth;o>=0;o--){let a=o==n.depth?0:n.pos<=(n.start(o+1)+n.end(o+1))/2?-1:1,l=n.index(o)+(a>0?1:0),c=n.node(o),h=!1;if(s==1)h=c.canReplace(l,l,i);else{let u=c.contentMatchAt(l).findWrapping(i.firstChild.type);h=u&&c.canReplaceWith(l,l,u[0])}if(h)return a==0?n.pos:a<0?n.before(o+1):n.after(o+1)}return null}function Yv(t,e,r=e,n=Ie.empty){if(e==r&&!n.size)return null;let i=t.resolve(e),s=t.resolve(r);return UN(i,s,n)?new ln(e,r,n):new Sae(i,s,n).fit()}function UN(t,e,r){return!r.openStart&&!r.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),r.content)}class Sae{constructor(e,r,n){this.$from=e,this.$to=r,this.unplaced=n,this.frontier=[],this.placed=Se.empty;for(let i=0;i<=e.depth;i++){let s=e.node(i);this.frontier.push({type:s.type,match:s.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=Se.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),r=this.placed.size-this.depth-this.$from.depth,n=this.$from,i=this.close(e<0?this.$to:n.doc.resolve(e));if(!i)return null;let s=this.placed,o=n.depth,a=i.depth;for(;o&&a&&s.childCount==1;)s=s.firstChild.content,o--,a--;let l=new Ie(s,o,a);return e>-1?new $n(n.pos,e,this.$to.pos,this.$to.end(),l,r):l.size||n.pos!=this.$to.pos?new ln(n.pos,i.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let r=this.unplaced.content,n=0,i=this.unplaced.openEnd;n<e;n++){let s=r.firstChild;if(r.childCount>1&&(i=0),s.type.spec.isolating&&i<=n){e=n;break}r=s.content}for(let r=1;r<=2;r++)for(let n=r==1?e:this.unplaced.openStart;n>=0;n--){let i,s=null;n?(s=o5(this.unplaced.content,n-1).firstChild,i=s.content):i=this.unplaced.content;let o=i.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:c}=this.frontier[a],h,u=null;if(r==1&&(o?c.matchType(o.type)||(u=c.fillBefore(Se.from(o),!1)):s&&l.compatibleContent(s.type)))return{sliceDepth:n,frontierDepth:a,parent:s,inject:u};if(r==2&&o&&(h=c.findWrapping(o.type)))return{sliceDepth:n,frontierDepth:a,parent:s,wrap:h};if(s&&c.matchType(s.type))break}}}openMore(){let{content:e,openStart:r,openEnd:n}=this.unplaced,i=o5(e,r);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new Ie(e,r+1,Math.max(n,i.size+r>=e.size-n?r+1:0)),!0)}dropNode(){let{content:e,openStart:r,openEnd:n}=this.unplaced,i=o5(e,r);if(i.childCount<=1&&r>0){let s=e.size-r<=r+i.size;this.unplaced=new Ie(ap(e,r-1,1),r-1,s?r-1:n)}else this.unplaced=new Ie(ap(e,r,1),r,n)}placeNodes({sliceDepth:e,frontierDepth:r,parent:n,inject:i,wrap:s}){for(;this.depth>r;)this.closeFrontierNode();if(s)for(let m=0;m<s.length;m++)this.openFrontierNode(s[m]);let o=this.unplaced,a=n?n.content:o.content,l=o.openStart-e,c=0,h=[],{match:u,type:d}=this.frontier[r];if(i){for(let m=0;m<i.childCount;m++)h.push(i.child(m));u=u.matchFragment(i)}let f=a.size+e-(o.content.size-o.openEnd);for(;c<a.childCount;){let m=a.child(c),g=u.matchType(m.type);if(!g)break;c++,(c>1||l==0||m.content.size)&&(u=g,h.push(GN(m.mark(d.allowedMarks(m.marks)),c==1?l:0,c==a.childCount?f:-1)))}let p=c==a.childCount;p||(f=-1),this.placed=lp(this.placed,r,Se.from(h)),this.frontier[r].match=u,p&&f<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,g=a;m<f;m++){let y=g.lastChild;this.frontier.push({type:y.type,match:y.contentMatchAt(y.childCount)}),g=y.content}this.unplaced=p?e==0?Ie.empty:new Ie(ap(o.content,e-1,1),e-1,f<0?o.openEnd:e-1):new Ie(ap(o.content,e,c),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],r;if(!e.type.isTextblock||!a5(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(r=this.findCloseLevel(this.$to))&&r.depth==this.depth)return-1;let{depth:n}=this.$to,i=this.$to.after(n);for(;n>1&&i==this.$to.end(--n);)++i;return i}findCloseLevel(e){e:for(let r=Math.min(this.depth,e.depth);r>=0;r--){let{match:n,type:i}=this.frontier[r],s=r<e.depth&&e.end(r+1)==e.pos+(e.depth-(r+1)),o=a5(e,r,i,n,s);if(o){for(let a=r-1;a>=0;a--){let{match:l,type:c}=this.frontier[a],h=a5(e,a,c,l,!0);if(!h||h.childCount)continue e}return{depth:r,fit:o,move:s?e.doc.resolve(e.after(r+1)):e}}}}close(e){let r=this.findCloseLevel(e);if(!r)return null;for(;this.depth>r.depth;)this.closeFrontierNode();r.fit.childCount&&(this.placed=lp(this.placed,r.depth,r.fit)),e=r.move;for(let n=r.depth+1;n<=e.depth;n++){let i=e.node(n),s=i.type.contentMatch.fillBefore(i.content,!0,e.index(n));this.openFrontierNode(i.type,i.attrs,s)}return e}openFrontierNode(e,r=null,n){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=lp(this.placed,this.depth,Se.from(e.create(r,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let r=this.frontier.pop().match.fillBefore(Se.empty,!0);r.childCount&&(this.placed=lp(this.placed,this.frontier.length,r))}}function ap(t,e,r){return e==0?t.cutByIndex(r,t.childCount):t.replaceChild(0,t.firstChild.copy(ap(t.firstChild.content,e-1,r)))}function lp(t,e,r){return e==0?t.append(r):t.replaceChild(t.childCount-1,t.lastChild.copy(lp(t.lastChild.content,e-1,r)))}function o5(t,e){for(let r=0;r<e;r++)t=t.firstChild.content;return t}function GN(t,e,r){if(e<=0)return t;let n=t.content;return e>1&&(n=n.replaceChild(0,GN(n.firstChild,e-1,n.childCount==1?r-1:0))),e>0&&(n=t.type.contentMatch.fillBefore(n).append(n),r<=0&&(n=n.append(t.type.contentMatch.matchFragment(n).fillBefore(Se.empty,!0)))),t.copy(n)}function a5(t,e,r,n,i){let s=t.node(e),o=i?t.indexAfter(e):t.index(e);if(o==s.childCount&&!r.compatibleContent(s.type))return null;let a=n.fillBefore(s.content,!0,o);return a&&!Tae(r,s.content,o)?a:null}function Tae(t,e,r){for(let n=r;n<e.childCount;n++)if(!t.allowsMarks(e.child(n).marks))return!0;return!1}function _ae(t){return t.spec.defining||t.spec.definingForContent}function Mae(t,e,r,n){if(!n.size)return t.deleteRange(e,r);let i=t.doc.resolve(e),s=t.doc.resolve(r);if(UN(i,s,n))return t.step(new ln(e,r,n));let o=YN(i,t.doc.resolve(r));o[o.length-1]==0&&o.pop();let a=-(i.depth+1);o.unshift(a);for(let d=i.depth,f=i.pos-1;d>0;d--,f--){let p=i.node(d).type.spec;if(p.defining||p.definingAsContext||p.isolating)break;o.indexOf(d)>-1?a=d:i.before(d)==f&&o.splice(1,0,-d)}let l=o.indexOf(a),c=[],h=n.openStart;for(let d=n.content,f=0;;f++){let p=d.firstChild;if(c.push(p),f==n.openStart)break;d=p.content}for(let d=h-1;d>=0;d--){let f=c[d],p=_ae(f.type);if(p&&!f.sameMarkup(i.node(Math.abs(a)-1)))h=d;else if(p||!f.type.isTextblock)break}for(let d=n.openStart;d>=0;d--){let f=(d+h+1)%(n.openStart+1),p=c[f];if(p)for(let m=0;m<o.length;m++){let g=o[(m+l)%o.length],y=!0;g<0&&(y=!1,g=-g);let b=i.node(g-1),x=i.index(g-1);if(b.canReplaceWith(x,x,p.type,p.marks))return t.replace(i.before(g),y?s.after(g):r,new Ie(KN(n.content,0,n.openStart,f),f,n.openEnd))}}let u=t.steps.length;for(let d=o.length-1;d>=0&&(t.replace(e,r,n),!(t.steps.length>u));d--){let f=o[d];f<0||(e=i.before(f),r=s.after(f))}}function KN(t,e,r,n,i){if(e<r){let s=t.firstChild;t=t.replaceChild(0,s.copy(KN(s.content,e+1,r,n,s)))}if(e>n){let s=i.contentMatchAt(0),o=s.fillBefore(t).append(t);t=o.append(s.matchFragment(o).fillBefore(Se.empty,!0))}return t}function Aae(t,e,r,n){if(!n.isInline&&e==r&&t.doc.resolve(e).parent.content.size){let i=Cae(t.doc,e,n.type);i!=null&&(e=r=i)}t.replaceRange(e,r,new Ie(Se.from(n),0,0))}function Eae(t,e,r){let n=t.doc.resolve(e),i=t.doc.resolve(r),s=YN(n,i);for(let o=0;o<s.length;o++){let a=s[o],l=o==s.length-1;if(l&&a==0||n.node(a).type.contentMatch.validEnd)return t.delete(n.start(a),i.end(a));if(a>0&&(l||n.node(a-1).canReplace(n.index(a-1),i.indexAfter(a-1))))return t.delete(n.before(a),i.after(a))}for(let o=1;o<=n.depth&&o<=i.depth;o++)if(e-n.start(o)==n.depth-o&&r>n.end(o)&&i.end(o)-r!=i.depth-o&&n.start(o-1)==i.start(o-1)&&n.node(o-1).canReplace(n.index(o-1),i.index(o-1)))return t.delete(n.before(o),r);t.delete(e,r)}function YN(t,e){let r=[],n=Math.min(t.depth,e.depth);for(let i=n;i>=0;i--){let s=t.start(i);if(s<t.pos-(t.depth-i)||e.end(i)>e.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(s==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==s-1)&&r.push(i)}return r}class bd extends Wn{constructor(e,r,n){super(),this.pos=e,this.attr=r,this.value=n}apply(e){let r=e.nodeAt(this.pos);if(!r)return jr.fail("No node at attribute step's position");let n=Object.create(null);for(let s in r.attrs)n[s]=r.attrs[s];n[this.attr]=this.value;let i=r.type.create(n,null,r.marks);return jr.fromReplace(e,this.pos,this.pos+1,new Ie(Se.from(i),0,r.isLeaf?0:1))}getMap(){return Zi.empty}invert(e){return new bd(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let r=e.mapResult(this.pos,1);return r.deletedAfter?null:new bd(r.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,r){if(typeof r.pos!="number"||typeof r.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new bd(r.pos,r.attr,r.value)}}Wn.jsonID("attr",bd);class sg extends Wn{constructor(e,r){super(),this.attr=e,this.value=r}apply(e){let r=Object.create(null);for(let i in e.attrs)r[i]=e.attrs[i];r[this.attr]=this.value;let n=e.type.create(r,e.content,e.marks);return jr.ok(n)}getMap(){return Zi.empty}invert(e){return new sg(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,r){if(typeof r.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new sg(r.attr,r.value)}}Wn.jsonID("docAttr",sg);let kf=class extends Error{};kf=function t(e){let r=Error.call(this,e);return r.__proto__=t.prototype,r};kf.prototype=Object.create(Error.prototype);kf.prototype.constructor=kf;kf.prototype.name="TransformError";let XN=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new ig}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let r=this.maybeStep(e);if(r.failed)throw new kf(r.failed);return this}maybeStep(e){let r=e.apply(this.doc);return r.failed||this.addStep(e,r.doc),r}get docChanged(){return this.steps.length>0}addStep(e,r){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=r}replace(e,r=e,n=Ie.empty){let i=Yv(this.doc,e,r,n);return i&&this.step(i),this}replaceWith(e,r,n){return this.replace(e,r,new Ie(Se.from(n),0,0))}delete(e,r){return this.replace(e,r,Ie.empty)}insert(e,r){return this.replaceWith(e,e,r)}replaceRange(e,r,n){return Mae(this,e,r,n),this}replaceRangeWith(e,r,n){return Aae(this,e,r,n),this}deleteRange(e,r){return Eae(this,e,r),this}lift(e,r){return dae(this,e,r),this}join(e,r=1){return kae(this,e,r),this}wrap(e,r){return mae(this,e,r),this}setBlockType(e,r=e,n,i=null){return gae(this,e,r,n,i),this}setNodeMarkup(e,r,n=null,i){return bae(this,e,r,n,i),this}setNodeAttribute(e,r,n){return this.step(new bd(e,r,n)),this}setDocAttribute(e,r){return this.step(new sg(e,r)),this}addNodeMark(e,r){return this.step(new Ql(e,r)),this}
vendor: 2,762 bytes, line 49
49removeNodeMark(e,r){let n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(r instanceof At)r.isInSet(n.marks)&&this.step(new lu(e,r));else{let i=n.marks,s,o=[];for(;s=r.isInSet(i);)o.push(new lu(e,s)),i=s.removeFromSet(i);for(let a=o.length-1;a>=0;a--)this.step(o[a])}return this}split(e,r=1,n){return xae(this,e,r,n),this}addMark(e,r,n){return cae(this,e,r,n),this}removeMark(e,r,n){return hae(this,e,r,n),this}clearIncompatible(e,r,n){return s7(this,e,r,n),this}};const l5=Object.create(null);let gt=class{constructor(e,r,n){this.$anchor=e,this.$head=r,this.ranges=n||[new JN(e.min(r),e.max(r))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let r=0;r<e.length;r++)if(e[r].$from.pos!=e[r].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,r=Ie.empty){let n=r.content.lastChild,i=null;for(let a=0;a<r.openEnd;a++)i=n,n=n.lastChild;let s=e.steps.length,o=this.ranges;for(let a=0;a<o.length;a++){let{$from:l,$to:c}=o[a],h=e.mapping.slice(s);e.replaceRange(h.map(l.pos),h.map(c.pos),a?Ie.empty:r),a==0&&rE(e,s,(n?n.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,r){let n=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:o,$to:a}=i[s],l=e.mapping.slice(n),c=l.map(o.pos),h=l.map(a.pos);s?e.deleteRange(c,h):(e.replaceRangeWith(c,h,r),rE(e,n,r.isInline?-1:1))}}static findFrom(e,r,n=!1){let i=e.parent.inlineContent?new Je(e):Xu(e.node(0),e.parent,e.pos,e.index(),r,n);if(i)return i;for(let s=e.depth-1;s>=0;s--){let o=r<0?Xu(e.node(0),e.node(s),e.before(s+1),e.index(s),r,n):Xu(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,r,n);if(o)return o}return null}static near(e,r=1){return this.findFrom(e,r)||this.findFrom(e,-r)||new Ii(e.node(0))}static atStart(e){return Xu(e,e,0,0,1)||new Ii(e)}static atEnd(e){return Xu(e,e,e.content.size,e.childCount,-1)||new Ii(e)}static fromJSON(e,r){if(!r||!r.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=l5[r.type];if(!n)throw new RangeError(`No selection type ${r.type} defined`);return n.fromJSON(e,r)}static jsonID(e,r){if(e in l5)throw new RangeError("Duplicate use of selection JSON ID "+e);return l5[e]=r,r.prototype.jsonID=e,r}getBookmark(){return Je.between(this.$anchor,this.$head).getBookmark()}};gt.prototype.visible=!0;class JN{constructor(e,r){this.$from=e,this.$to=r}}let eE=!1;function tE(t){!eE&&!t.parent.inlineContent&&(eE=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Je extends gt{constructor(e,r=e){tE(e),tE(r),super(e,r)}
vendor: 5,592 bytes, line 49
49get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,r){let n=e.resolve(r.map(this.head));if(!n.parent.inlineContent)return gt.near(n);let i=e.resolve(r.map(this.anchor));return new Je(i.parent.inlineContent?i:n,n)}replace(e,r=Ie.empty){if(super.replace(e,r),r==Ie.empty){let n=this.$from.marksAcross(this.$to);n&&e.ensureMarks(n)}}eq(e){return e instanceof Je&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Xv(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,r){if(typeof r.anchor!="number"||typeof r.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Je(e.resolve(r.anchor),e.resolve(r.head))}static create(e,r,n=r){let i=e.resolve(r);return new this(i,n==r?i:e.resolve(n))}static between(e,r,n){let i=e.pos-r.pos;if((!n||i)&&(n=i>=0?1:-1),!r.parent.inlineContent){let s=gt.findFrom(r,n,!0)||gt.findFrom(r,-n,!0);if(s)r=s.$head;else return gt.near(r,n)}return e.parent.inlineContent||(i==0?e=r:(e=(gt.findFrom(e,-n,!0)||gt.findFrom(e,n,!0)).$anchor,e.pos<r.pos!=i<0&&(e=r))),new Je(e,r)}}gt.jsonID("text",Je);class Xv{constructor(e,r){this.anchor=e,this.head=r}map(e){return new Xv(e.map(this.anchor),e.map(this.head))}resolve(e){return Je.between(e.resolve(this.anchor),e.resolve(this.head))}}class lt extends gt{constructor(e){let r=e.nodeAfter,n=e.node(0).resolve(e.pos+r.nodeSize);super(e,n),this.node=r}map(e,r){let{deleted:n,pos:i}=r.mapResult(this.anchor),s=e.resolve(i);return n?gt.near(s):new lt(s)}content(){return new Ie(Se.from(this.node),0,0)}eq(e){return e instanceof lt&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new a7(this.anchor)}static fromJSON(e,r){if(typeof r.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new lt(e.resolve(r.anchor))}static create(e,r){return new lt(e.resolve(r))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}lt.prototype.visible=!1;gt.jsonID("node",lt);class a7{constructor(e){this.anchor=e}map(e){let{deleted:r,pos:n}=e.mapResult(this.anchor);return r?new Xv(n,n):new a7(n)}resolve(e){let r=e.resolve(this.anchor),n=r.nodeAfter;return n&&lt.isSelectable(n)?new lt(r):gt.near(r)}}class Ii extends gt{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,r=Ie.empty){if(r==Ie.empty){e.delete(0,e.doc.content.size);let n=gt.atStart(e.doc);n.eq(e.selection)||e.setSelection(n)}else super.replace(e,r)}toJSON(){return{type:"all"}}static fromJSON(e){return new Ii(e)}map(e){return new Ii(e)}eq(e){return e instanceof Ii}getBookmark(){return Oae}}gt.jsonID("all",Ii);const Oae={map(){return this},resolve(t){return new Ii(t)}};function Xu(t,e,r,n,i,s=!1){if(e.inlineContent)return Je.create(t,r);for(let o=n-(i>0?0:1);i>0?o<e.childCount:o>=0;o+=i){let a=e.child(o);if(a.isAtom){if(!s&&lt.isSelectable(a))return lt.create(t,r-(i<0?a.nodeSize:0))}else{let l=Xu(t,a,r+i,i<0?a.childCount:0,i,s);if(l)return l}r+=a.nodeSize*i}return null}function rE(t,e,r){let n=t.steps.length-1;if(n<e)return;let i=t.steps[n];if(!(i instanceof ln||i instanceof $n))return;let s=t.mapping.maps[n],o;s.forEach((a,l,c,h)=>{o==null&&(o=h)}),t.setSelection(gt.near(t.doc.resolve(o),r))}const nE=1,Oy=2,iE=4;class Lae extends XN{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|nE)&~Oy,this.storedMarks=null,this}get selectionSet(){return(this.updated&nE)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Oy,this}ensureMarks(e){return At.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Oy)>0}addStep(e,r){super.addStep(e,r),this.updated=this.updated&~Oy,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,r=!0){let n=this.selection;return r&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||At.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,r,n){let i=this.doc.type.schema;if(r==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(n==null&&(n=r),n=n??r,!e)return this.deleteRange(r,n);let s=this.storedMarks;if(!s){let o=this.doc.resolve(r);s=n==r?o.marks():o.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(r,n,i.text(e,s)),this.selection.empty||this.setSelection(gt.near(this.selection.$to)),this}}setMeta(e,r){return this.meta[typeof e=="string"?e:e.key]=r,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=iE,this}get scrolledIntoView(){return(this.updated&iE)>0}}function sE(t,e){return!e||!t?t:t.bind(e)}
vendor: 4,468 bytes, line 49
49class cp{constructor(e,r,n){this.name=e,this.init=sE(r.init,n),this.apply=sE(r.apply,n)}}const Dae=[new cp("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new cp("selection",{init(t,e){return t.selection||gt.atStart(e.doc)},apply(t){return t.selection}}),new cp("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,r,n){return n.selection.$cursor?t.storedMarks:null}}),new cp("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class c5{constructor(e,r){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Dae.slice(),r&&r.forEach(n=>{if(this.pluginsByKey[n.key])throw new RangeError("Adding different instances of a keyed plugin ("+n.key+")");this.plugins.push(n),this.pluginsByKey[n.key]=n,n.spec.state&&this.fields.push(new cp(n.key,n.spec.state,n))})}}class ph{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,r=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=r){let i=this.config.plugins[n];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let r=[e],n=this.applyInner(e),i=null;for(;;){let s=!1;for(let o=0;o<this.config.plugins.length;o++){let a=this.config.plugins[o];if(a.spec.appendTransaction){let l=i?i[o].n:0,c=i?i[o].state:this,h=l<r.length&&a.spec.appendTransaction.call(a,l?r.slice(l):r,c,n);if(h&&n.filterTransaction(h,o)){if(h.setMeta("appendedTransaction",e),!i){i=[];for(let u=0;u<this.config.plugins.length;u++)i.push(u<o?{state:n,n:r.length}:{state:this,n:0})}r.push(h),n=n.applyInner(h),s=!0}i&&(i[o]={state:n,n:r.length})}}if(!s)return{state:n,transactions:r}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let r=new ph(this.config),n=this.config.fields;for(let i=0;i<n.length;i++){let s=n[i];r[s.name]=s.apply(e,this[s.name],this,r)}return r}get tr(){return new Lae(this)}static create(e){let r=new c5(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new ph(r);for(let i=0;i<r.fields.length;i++)n[r.fields[i].name]=r.fields[i].init(e,n);return n}reconfigure(e){let r=new c5(this.schema,e.plugins),n=r.fields,i=new ph(r);for(let s=0;s<n.length;s++){let o=n[s].name;i[o]=this.hasOwnProperty(o)?this[o]:n[s].init(e,i)}return i}toJSON(e){let r={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(r.storedMarks=this.storedMarks.map(n=>n.toJSON())),e&&typeof e=="object")for(let n in e){if(n=="doc"||n=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[n],s=i.spec.state;s&&s.toJSON&&(r[n]=s.toJSON.call(i,this[i.key]))}return r}static fromJSON(e,r,n){if(!r)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new c5(e.schema,e.plugins),s=new ph(i);return i.fields.forEach(o=>{if(o.name=="doc")s.doc=Xa.fromJSON(e.schema,r.doc);else if(o.name=="selection")s.selection=gt.fromJSON(s.doc,r.selection);else if(o.name=="storedMarks")r.storedMarks&&(s.storedMarks=r.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let a in n){let l=n[a],c=l.spec.state;if(l.key==o.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(r,a)){s[o.name]=c.fromJSON.call(l,e,r[a],s);return}}s[o.name]=o.init(e,s)}}),s}}function ZN(t,e,r){for(let n in t){let i=t[n];i instanceof Function?i=i.bind(e):n=="handleDOMEvents"&&(i=ZN(i,e,{})),r[n]=i}return r}class _r{constructor(e){this.spec=e,this.props={},e.props&&ZN(e.props,this,this.props),this.key=e.key?e.key.key:QN("plugin")}getState(e){return e[this.key]}}const h5=Object.create(null);function QN(t){return t in h5?t+"$"+ ++h5[t]:(h5[t]=0,t+"$")}class Dr{constructor(e="key"){this.key=QN(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}class Ri{constructor(e,r,n={}){this.match=e,this.match=e,this.handler=typeof r=="string"?Iae(r):r,this.undoable=n.undoable!==!1,this.inCode=n.inCode||!1,this.inCodeMark=n.inCodeMark!==!1}}function Iae(t){return function(e,r,n,i){let s=t;if(r[1]){let o=r[0].lastIndexOf(r[1]);s+=r[0].slice(o+r[1].length),n+=o;let a=n-i;a>0&&(s=r[0].slice(o-a,o)+s,n=i)}return e.tr.insertText(s,n,i)}}const Bae=(t,e)=>{let r=t.plugins;for(let n=0;n<r.length;n++){let i=r[n],s;
49if(i.spec.isInputRules&&(s=i.getState(t))){if(e){let o=t.tr,a=s.transform;for(let l=a.steps.length-1;l>=0;l--)o.step(a.steps[l].invert(a.docs[l]));if(s.text){let l=o.doc.resolve(s.from).marks();o.replaceWith(s.from,s.to,t.schema.text(s.text,l))}else o.delete(s.from,s.to);e(o)}return!0}}return!1};new Ri(/--$/,"—",{inCodeMark:!1});new Ri(/\.\.\.$/,"…",{inCodeMark:!1});new Ri(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“",{inCodeMark:!1});new Ri(/"$/,"”",{inCodeMark:!1});new Ri(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘",{inCodeMark:!1});new Ri(/'$/,"’",{inCodeMark:!1});function l7(t,e,r=null,n){return new Ri(t,(i,s,o,a)=>{let l=r instanceof Function?r(s):r,c=i.tr.delete(o,a),h=c.doc.resolve(o),u=h.blockRange(),d=u&&o7(u,e,l);if(!d)return null;c.wrap(u,d);let f=c.doc.resolve(o-1).nodeBefore;return f&&f.type==e&&Kv(c.doc,o-1)&&(!n||n(s,f))&&c.join(o-1),c})}function c7(t,e,r=null){return new Ri(t,(n,i,s,o)=>{let a=n.doc.resolve(s),l=r instanceof Function?r(i):r;return a.node(-1).canReplaceWith(a.index(-1),a.indexAfter(-1),e)?n.tr.delete(s,o).setBlockType(s,s,e,l):null})}var Pi=(t=>(t.docTypeError="docTypeError",t.contextNotFound="contextNotFound",t.timerNotFound="timerNotFound",t.ctxCallOutOfScope="ctxCallOutOfScope",t.createNodeInParserFail="createNodeInParserFail",t.stackOverFlow="stackOverFlow",t.parserMatchError="parserMatchError",t.serializerMatchError="serializerMatchError",t.getAtomFromSchemaFail="getAtomFromSchemaFail",t.expectDomTypeError="expectDomTypeError",t.callCommandBeforeEditorView="callCommandBeforeEditorView",t.missingRootElement="missingRootElement",t.missingNodeInSchema="missingNodeInSchema",t.missingMarkInSchema="missingMarkInSchema",t.ctxNotBind="ctxNotBind",t.missingYjsDoc="missingYjsDoc",t))(Pi||{});class hs extends Error{constructor(e,r){super(r),this.name="MilkdownError",this.code=e}}const Rae=(t,e)=>typeof e=="function"?"[Function]":e,Jv=t=>JSON.stringify(t,Rae);function Pae(t){return new hs(Pi.docTypeError,`Doc type error, unsupported type: ${Jv(t)}`)}function Nae(t){return new hs(Pi.contextNotFound,`Context "${t}" not found, do you forget to inject it?`)}function Fae(t){return new hs(Pi.timerNotFound,`Timer "${t}" not found, do you forget to record it?`)}function Zv(){return new hs(Pi.ctxCallOutOfScope,"Should not call a context out of the plugin.")}function $ae(t,e,r){const i=`Cannot create node for ${"name"in t?t.name:t}`,s=h=>{if(h==null)return"null";if(Array.isArray(h))return`[${h.map(s).join(", ")}]`;if(typeof h=="object")return"toJSON"in h&&typeof h.toJSON=="function"?JSON.stringify(h.toJSON()):"spec"in h?JSON.stringify(h.spec):JSON.stringify(h);if(typeof h=="string"||typeof h=="number"||typeof h=="boolean")return JSON.stringify(h);if(typeof h=="function")return`[Function: ${h.name||"anonymous"}]`;try{return String(h)}catch{return"[Unserializable]"}},o=["[Description]",i],a=["[Attributes]",e],l=["[Content]",(r??[]).map(h=>h?typeof h=="object"&&"type"in h?`${h}`:s(h):"null")],c=[o,a,l].reduce((h,[u,d])=>{const f=`${u}: ${s(d)}.`;return h.concat(f)},[]);return new hs(Pi.createNodeInParserFail,c.join(`
50`))}function eF(){return new hs(Pi.stackOverFlow,"Stack over flow, cannot pop on an empty stack.")}function zae(t){return new hs(Pi.parserMatchError,`Cannot match target parser for node: ${Jv(t)}.`)}function Hae(t){return new hs(Pi.serializerMatchError,`Cannot match target serializer for node: ${Jv(t)}.`)}function qae(t,e){return new hs(Pi.getAtomFromSchemaFail,`Cannot get ${t}: ${e} from schema.`)}function mo(t){return new hs(Pi.expectDomTypeError,`Expect to be a dom, but get: ${Jv(t)}.`)}function u5(){return new hs(Pi.callCommandBeforeEditorView,"You're trying to call a command before editor view initialized, make sure to get commandManager from ctx after editor view has been initialized")}function Vae(t){return new hs(Pi.missingNodeInSchema,`Missing node in schema, milkdown cannot find "${t}" in schema.`)}function Wae(t){return new hs(Pi.missingMarkInSchema,`Missing mark in schema, milkdown cannot find "${t}" in schema.`)}const mc=typeof navigator<"u"?navigator:null,oE=typeof document<"u"?document:null,Oc=mc&&mc.userAgent||"",sC=/Edge\/(\d+)/.exec(Oc),tF=/MSIE \d/.exec(Oc),oC=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Oc),Qv=!!(tF||oC||sC),jae=tF?document.documentMode:oC?+oC[1]:sC?+sC[1]:0,rF=!Qv&&/gecko\/(\d+)/i.test(Oc),Uae=rF&&+(/Firefox\/(\d+)/.exec(Oc)||[0,0])[1],aC=!Qv&&/Chrome\/(\d+)/.exec(Oc),Gae=!!aC,Kae=aC?+aC[1]:0,nF=!Qv&&!!mc&&/Apple Computer/.test(mc.vendor),iF=nF&&(/Mobile\/\w+/.test(Oc)||!!mc&&mc.maxTouchPoints>2),Yae=iF||(mc?/Mac/.test(mc.platform):!1),Xae=/Android \d/.test(Oc),sF=!!oE&&"webkitFontSmoothing"in oE.documentElement.style,Jae=sF?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;var Ly=Object.freeze({__proto__:null,android:Xae,chrome:Gae,chrome_version:Kae,gecko:rF,gecko_version:Uae,ie:Qv,ie_version:jae,ios:iF,mac:Yae,safari:nF,webkit:sF,webkit_version:Jae});function d5(t,e,r,n,i,s){if(t.composing)return!1;const o=t.state,a=o.doc.resolve(e);if(a.parent.type.spec.code)return!1;const l=a.parent.textBetween(Math.max(0,a.parentOffset-500),a.parentOffset,void 0,"")+n;for(let c of i){const h=c,u=h.match.exec(l),d=u&&u[0]&&h.handler(o,u,e-(u[0].length-n.length),r);if(d)return h.undoable!==!1&&d.setMeta(s,{transform:d,from:e,to:r,text:n}
50),t.dispatch(d),!0}return!1}const Zae=new Dr("MILKDOWN_CUSTOM_INPUTRULES");function Qae({rules:t}){const e=new _r({key:Zae,isInputRules:!0,state:{init(){return null},apply(r,n){const i=r.getMeta(this);return i||(r.selectionSet||r.docChanged?null:n)}},props:{handleTextInput(r,n,i,s){return d5(r,n,i,s,t,e)},handleDOMEvents:{compositionend:r=>(setTimeout(()=>{const{$cursor:n}=r.state.selection;n&&d5(r,n.pos,n.pos,"",t,e)}),!1)},handleKeyDown(r,n){if(n.key!=="Enter")return!1;const{$cursor:i}=r.state.selection;return i?d5(r,i.pos,i.pos,`
51`,t,e):!1}}});return e}function v1(t,e,r={}){return new Ri(t,(n,i,s,o)=>{var a,l,c,h;const{tr:u}=n,d=i.length;let f=i[d-1],p=i[0],m=[],g=o;const y={group:f,fullMatch:p,start:s,end:o},b=(a=r.updateCaptured)==null?void 0:a.call(r,y);if(Object.assign(y,b),{group:f,fullMatch:p,start:s,end:o}=y,p===null||(f==null?void 0:f.trim())==="")return null;if(f){const x=p.search(/\S/),S=s+p.indexOf(f),k=S+f.length;m=(l=u.storedMarks)!=null?l:[],k<o&&u.delete(k,o),S>s&&u.delete(s+x,S),g=s+x+f.length;const w=(c=r.getAttr)==null?void 0:c.call(r,i);u.addMark(s,g,e.create(w)),u.setStoredMarks(m),(h=r.beforeDispatch)==null||h.call(r,{match:i,start:s,end:o,tr:u})}return u})}function ele(t,e,r={}){return new Ri(t,(n,i,s,o)=>{var a,l,c;const{tr:h}=n;let u=i[1],d=i[0];const f={group:u,fullMatch:d,start:s,end:o},p=(a=r.updateCaptured)==null?void 0:a.call(r,f);if(Object.assign(f,p),{group:u,fullMatch:d,start:s,end:o}=f,d===null||!u||u.trim()==="")return null;const m=(l=r.getAttr)==null?void 0:l.call(r,i),g=e.createAndFill(m);return g&&(h.replaceRangeWith(e.isBlock?h.doc.resolve(s).before():s,o,g),(c=r.beforeDispatch)==null||c.call(r,{match:[d,u??""],start:s,end:o,tr:h})),h})}var tle=Object.defineProperty,rle=Object.defineProperties,nle=Object.getOwnPropertyDescriptors,aE=Object.getOwnPropertySymbols,ile=Object.prototype.hasOwnProperty,sle=Object.prototype.propertyIsEnumerable,lE=(t,e,r)=>e in t?tle(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ole=(t,e)=>{for(var r in e||(e={}))ile.call(e,r)&&lE(t,r,e[r]);if(aE)for(var r of aE(e))sle.call(e,r)&&lE(t,r,e[r]);return t},ale=(t,e)=>rle(t,nle(e));function cE(t=0,e=0,r=0){return Math.min(Math.max(t,e),r)}function ew(t,e,r){const i=t.state.doc.content.size,s=cE(e,0,i),o=cE(r,0,i),a=t.coordsAtPos(s),l=t.coordsAtPos(o,-1),c=Math.min(a.top,l.top),h=Math.max(a.bottom,l.bottom),u=Math.min(a.left,l.left),d=Math.max(a.right,l.right),f=d-u,p=h-c,y={top:c,bottom:h,left:u,right:d,width:f,height:p,x:u,y:c};return ale(ole({},y),{toJSON:()=>y})}function oF(t){return Object.assign(Object.create(t),t).setTime(Date.now())}function lle(t,e){return Array.isArray(t)&&t.includes(e.type)||e.type===t}function cle(t){if(t.content.childCount===1){const e=t.content.firstChild;if((e==null?void 0:e.type.name)==="text"&&e.marks.length===0)return e;if((e==null?void 0:e.type.name)==="paragraph"&&e.childCount===1){const r=e.firstChild;if((r==null?void 0:r.type.name)==="text"&&r.marks.length===0)return r}}return!1}function Ko(t){return e=>{for(let r=e.depth;r>0;r-=1){const n=e.node(r);if(t(n)){const i=e.before(r),s=e.after(r);return{from:i,to:s,node:n}}}}}function hle(t,e){return Ko(r=>r.type===e)(t)}function ule(t,e){const r=e.nodes[t];if(!r)throw qae("node",t);return r}function h7(t){return e=>{for(let r=e.depth;r>0;r--){const n=e.node(r);if(t(n))return{pos:r>0?e.before(r):0,start:e.start(r),depth:r,node:n}}}}function dle(t){return e=>h7(t)(e.$from)}function fle(t,e){if(!(t instanceof lt))return;const{node:r,$from:n}=t;if(lle(e,r))return{node:r,pos:n.pos,start:n.start(n.depth),depth:n.depth}}const aF=(t,e)=>{const{selection:r,doc:n}=t;if(r instanceof lt)return{hasNode:r.node.type===e,pos:r.from,target:r.node};const{from:i,to:s}=r;let o=!1,a=-1,l=null;return n.nodesBetween(i,s,(c,h)=>l?!1:c.type===e?(o=!0,a=h,l=c,!1):!0),{hasNode:o,pos:a,target:l}};class lF{constructor(){this.sliceMap=new Map,this.get=e=>{const r=typeof e=="string"?[...this.sliceMap.values()].find(n=>n.type.name===e):this.sliceMap.get(e.id);if(!r){const n=typeof e=="string"?e:e.name;throw Nae(n)}return r},this.remove=e=>{const r=typeof e=="string"?[...this.sliceMap.values()].find(n=>n.type.name===e):this.sliceMap.get(e.id);r&&this.sliceMap.delete(r.type.id)},this.has=e=>typeof e=="string"?[...this.sliceMap.values()].some(r=>r.type.name===e):this.sliceMap.has(e.id)}}var Vs,Ra,Id;class ple{constructor(e,r,n){we(this,Vs);we(this,Ra);we(this,Id);ie(this,Vs,[]),ie(this,Id,()=>
51{V(this,Vs).forEach(i=>i(V(this,Ra)))}),this.set=i=>{ie(this,Ra,i),V(this,Id).call(this)},this.get=()=>V(this,Ra),this.update=i=>{ie(this,Ra,i(V(this,Ra))),V(this,Id).call(this)},this.type=n,ie(this,Ra,r),e.set(n.id,this)}on(e){return V(this,Vs).push(e),()=>{ie(this,Vs,V(this,Vs).filter(r=>r!==e))}}once(e){const r=this.on(n=>{e(n),r()});return r}off(e){ie(this,Vs,V(this,Vs).filter(r=>r!==e))}offAll(){ie(this,Vs,[])}}Vs=new WeakMap,Ra=new WeakMap,Id=new WeakMap;class mle{constructor(e,r){this.id=Symbol(`Context-${r}`),this.name=r,this._defaultValue=e,this._typeInfo=()=>{throw Zv()}}create(e,r=this._defaultValue){return new ple(e,r,this)}}const Rt=(t,e)=>new mle(t,e);var zg,Hg,qg,Th,Bd,Gl,Rd,Pd,Nd;class gle{constructor(e,r,n){we(this,zg);we(this,Hg);we(this,qg);we(this,Th);we(this,Bd);we(this,Gl);we(this,Rd);we(this,Pd);we(this,Nd);ie(this,Th,new Set),ie(this,Bd,new Set),ie(this,Gl,new Map),ie(this,Rd,new Map),this.read=()=>({metadata:V(this,zg),injectedSlices:[...V(this,Th)].map(i=>({name:typeof i=="string"?i:i.name,value:V(this,Pd).call(this,i)})),consumedSlices:[...V(this,Bd)].map(i=>({name:typeof i=="string"?i:i.name,value:V(this,Pd).call(this,i)})),recordedTimers:[...V(this,Gl)].map(([i,{duration:s}])=>({name:i.name,duration:s,status:V(this,Nd).call(this,i)})),waitTimers:[...V(this,Rd)].map(([i,{duration:s}])=>({name:i.name,duration:s,status:V(this,Nd).call(this,i)}))}),this.onRecord=i=>{V(this,Gl).set(i,{start:Date.now(),duration:0})},this.onClear=i=>{V(this,Gl).delete(i)},this.onDone=i=>{const s=V(this,Gl).get(i);s&&(s.duration=Date.now()-s.start)},this.onWait=(i,s)=>{const o=Date.now();s.finally(()=>{V(this,Rd).set(i,{duration:Date.now()-o})}).catch(console.error)},this.onInject=i=>{V(this,Th).add(i)},this.onRemove=i=>{V(this,Th).delete(i)},this.onUse=i=>{V(this,Bd).add(i)},ie(this,Pd,i=>V(this,Hg).get(i).get()),ie(this,Nd,i=>V(this,qg).get(i).status),ie(this,Hg,e),ie(this,qg,r),ie(this,zg,n)}}zg=new WeakMap,Hg=new WeakMap,qg=new WeakMap,Th=new WeakMap,Bd=new WeakMap,Gl=new WeakMap,Rd=new WeakMap,Pd=new WeakMap,Nd=new WeakMap;var Pa,Na,Vg,ms;const x_=class x_{constructor(e,r,n){we(this,Pa);we(this,Na);we(this,Vg);we(this,ms);this.produce=i=>i&&Object.keys(i).length?new x_(V(this,Pa),V(this,Na),{...i}):this,this.inject=(i,s)=>{var a;const o=i.create(V(this,Pa).sliceMap);return s!=null&&o.set(s),(a=V(this,ms))==null||a.onInject(i),this},this.remove=i=>{var s;return V(this,Pa).remove(i),(s=V(this,ms))==null||s.onRemove(i),this},this.record=i=>{var s;return i.create(V(this,Na).store),(s=V(this,ms))==null||s.onRecord(i),this},this.clearTimer=i=>{var s;return V(this,Na).remove(i),(s=V(this,ms))==null||s.onClear(i),this},this.isInjected=i=>V(this,Pa).has(i),this.isRecorded=i=>V(this,Na).has(i),this.use=i=>{var s;return(s=V(this,ms))==null||s.onUse(i),V(this,Pa).get(i)},this.get=i=>this.use(i).get(),this.set=(i,s)=>this.use(i).set(s),this.update=(i,s)=>this.use(i).update(s),this.timer=i=>V(this,Na).get(i),this.done=i=>{var s;this.timer(i).done(),(s=V(this,ms))==null||s.onDone(i)},this.wait=i=>{var o;const s=this.timer(i).start();return(o=V(this,ms))==null||o.onWait(i,s),s},this.waitTimers=async i=>{await Promise.all(this.get(i).map(s=>this.wait(s)))},ie(this,Pa,e),ie(this,Na,r),ie(this,Vg,n),n&&ie(this,ms,new gle(e,r,n))}get meta(){return V(this,Vg)}get inspector(){return V(this,ms)}};Pa=new WeakMap,Na=new WeakMap,Vg=new WeakMap,ms=new WeakMap;let lC=x_;class yle{constructor(){this.store=new Map,this.get=e=>{const r=this.store.get(e.id);if(!r)throw Fae(e.name);return r},this.remove=e=>{this.store.delete(e.id)},this.has=e=>this.store.has(e.id)}}var Fd,Kl,$d,Fa,zd,Wg,CB;let ble=(CB=class{constructor(e,r){we(this,Fd);we(this,Kl);we(this,$d);we(this,Fa);we(this,zd);we(this,Wg);ie(this,Fd,null),ie(this,Kl,null),ie(this,Fa,"pending"),this.start=()=>(V(this,Fd)??ie(this,Fd,new Promise((n,i)=>{ie(this,Kl,s=>{s instanceof CustomEvent&&s.detail.id===V(this,$d)&&(ie(this,Fa,"resolved"),V(this,zd).call(this),s.stopImmediatePropagation(),n())}),V(this,Wg).call(this,()=>{V(this,Fa)==="pending"&&ie(this,Fa,"rejected"),V(this,zd).call(this),i(new Error(`Timing ${this.type.name} timeout.`))}),ie(this,Fa,"pending"),addEventListener(this.type.name,V(this,Kl))})),V(this,Fd)),this.done=()=>
51{const n=new CustomEvent(this.type.name,{detail:{id:V(this,$d)}});dispatchEvent(n)},ie(this,zd,()=>{V(this,Kl)&&removeEventListener(this.type.name,V(this,Kl))}),ie(this,Wg,n=>{setTimeout(()=>{n()},this.type.timeout)}),ie(this,$d,Symbol(r.name)),this.type=r,e.set(r.id,this)}get status(){return V(this,Fa)}},Fd=new WeakMap,Kl=new WeakMap,$d=new WeakMap,Fa=new WeakMap,zd=new WeakMap,Wg=new WeakMap,CB);class xle{constructor(e,r=3e3){this.create=n=>new ble(n,this),this.id=Symbol(`Timer-${e}`),this.name=e,this.timeout=r}}const yl=(t,e=3e3)=>new xle(t,e),vle={};function u7(t,e){const r=vle,n=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,i=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return cF(t,n,i)}function cF(t,e,r){if(wle(t)){if("value"in t)return t.type==="html"&&!r?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return hE(t.children,e,r)}return Array.isArray(t)?hE(t,e,r):""}function hE(t,e,r){const n=[];let i=-1;for(;++i<t.length;)n[i]=cF(t[i],e,r);return n.join("")}function wle(t){return!!(t&&typeof t=="object")}const uE=document.createElement("i");function d7(t){const e="&"+t+";";uE.innerHTML=e;const r=uE.textContent;return r.charCodeAt(r.length-1)===59&&t!=="semi"||r===e?!1:r}function ns(t,e,r,n){const i=t.length;let s=0,o;if(e<0?e=-e>i?0:i+e:e=e>i?i:e,r=r>0?r:0,n.length<1e4)o=Array.from(n),o.unshift(e,r),t.splice(...o);else for(r&&t.splice(e,r);s<n.length;)o=n.slice(s,s+1e4),o.unshift(e,0),t.splice(...o),s+=1e4,e+=1e4}function xs(t,e){return t.length>0?(ns(t,t.length,0,e),t):e}const dE={}.hasOwnProperty;function hF(t){const e={};let r=-1;for(;++r<t.length;)kle(e,t[r]);return e}function kle(t,e){let r;for(r in e){const i=(dE.call(t,r)?t[r]:void 0)||(t[r]={}),s=e[r];let o;if(s)for(o in s){dE.call(i,o)||(i[o]=[]);const a=s[o];Cle(i[o],Array.isArray(a)?a:a?[a]:[])}}}function Cle(t,e){let r=-1;const n=[];for(;++r<e.length;)(e[r].add==="after"?t:n).push(e[r]);ns(t,0,0,n)}function uF(t,e){const r=Number.parseInt(t,e);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"�":String.fromCodePoint(r)}function Qs(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ei=Lc(/[A-Za-z]/),Ai=Lc(/[\dA-Za-z]/),Sle=Lc(/[#-'*+\--9=?A-Z^-~]/);function ax(t){return t!==null&&(t<32||t===127)}const cC=Lc(/\d/),Tle=Lc(/[\dA-Fa-f]/),_le=Lc(/[!-/:-@[-`{-~]/);function Qe(t){return t!==null&&t<-2}function lr(t){return t!==null&&(t<0||t===32)}function It(t){return t===-2||t===-1||t===32}const tw=Lc(new RegExp("\\p{P}|\\p{S}","u")),cu=Lc(/\s/);function Lc(t){return e;function e(r){return r!==null&&r>-1&&t.test(String.fromCharCode(r))}}function Ot(t,e,r,n){const i=n?n-1:Number.POSITIVE_INFINITY;let s=0;return o;function o(l){return It(l)?(t.enter(r),a(l)):e(l)}function a(l){return It(l)&&s++<i?(t.consume(l),a):(t.exit(r),e(l))}}const Mle={tokenize:Ale};function Ale(t){const e=t.attempt(this.parser.constructs.contentInitial,n,i);let r;return e;function n(a){if(a===null){t.consume(a);return}return t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),Ot(t,e,"linePrefix")}function i(a){return t.enter("paragraph"),s(a)}function s(a){const l=t.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=l),r=l,o(a)}function o(a){if(a===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(a);return}return Qe(a)?(t.consume(a),t.exit("chunkText"),s):(t.consume(a),o)}}const Ele={tokenize:Ole},fE={tokenize:Lle};function Ole(t){const e=this,r=[];let n=0,i,s,o;return a;function a(x){if(n<r.length){const S=r[n];return e.containerState=S[1],t.attempt(S[0].continuation,l,c)(x)}return c(x)}function l(x){if(n++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,i&&b();const S=e.events.length;let k=S,w;for(;k--;)if(e.events[k][0]==="exit"&&e.events[k][1].type==="chunkFlow"){w=e.events[k][1].end;break}y(n);let _=S;for(;_<e.events.length;)e.events[_][1].end={...w},_++;return ns(e.events,k+1,0,e.events.slice(S)),e.events.length=_,c(x)}return a(x)}
vendor: 8,848 bytes, line 51
51function c(x){if(n===r.length){if(!i)return d(x);if(i.currentConstruct&&i.currentConstruct.concrete)return p(x);e.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(fE,h,u)(x)}function h(x){return i&&b(),y(n),d(x)}function u(x){return e.parser.lazy[e.now().line]=n!==r.length,o=e.now().offset,p(x)}function d(x){return e.containerState={},t.attempt(fE,f,p)(x)}function f(x){return n++,r.push([e.currentConstruct,e.containerState]),d(x)}function p(x){if(x===null){i&&b(),y(0),t.consume(x);return}return i=i||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),m(x)}function m(x){if(x===null){g(t.exit("chunkFlow"),!0),y(0),t.consume(x);return}return Qe(x)?(t.consume(x),g(t.exit("chunkFlow")),n=0,e.interrupt=void 0,a):(t.consume(x),m)}function g(x,S){const k=e.sliceStream(x);if(S&&k.push(null),x.previous=s,s&&(s.next=x),s=x,i.defineSkip(x.start),i.write(k),e.parser.lazy[x.start.line]){let w=i.events.length;for(;w--;)if(i.events[w][1].start.offset<o&&(!i.events[w][1].end||i.events[w][1].end.offset>o))return;const _=e.events.length;let L=_,B,E;for(;L--;)if(e.events[L][0]==="exit"&&e.events[L][1].type==="chunkFlow"){if(B){E=e.events[L][1].end;break}B=!0}for(y(n),w=_;w<e.events.length;)e.events[w][1].end={...E},w++;ns(e.events,L+1,0,e.events.slice(_)),e.events.length=w}}function y(x){let S=r.length;for(;S-- >x;){const k=r[S];e.containerState=k[1],k[0].exit.call(e,t)}r.length=x}function b(){i.write([null]),s=void 0,i=void 0,e.containerState._closeFlow=void 0}}function Lle(t,e,r){return Ot(t,t.attempt(this.parser.constructs.document,e,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Cf(t){if(t===null||lr(t)||cu(t))return 1;if(tw(t))return 2}function rw(t,e,r){const n=[];let i=-1;for(;++i<t.length;){const s=t[i].resolveAll;s&&!n.includes(s)&&(e=s(e,r),n.push(s))}return e}const hC={name:"attention",resolveAll:Dle,tokenize:Ile};function Dle(t,e){let r=-1,n,i,s,o,a,l,c,h;for(;++r<t.length;)if(t[r][0]==="enter"&&t[r][1].type==="attentionSequence"&&t[r][1]._close){for(n=r;n--;)if(t[n][0]==="exit"&&t[n][1].type==="attentionSequence"&&t[n][1]._open&&e.sliceSerialize(t[n][1]).charCodeAt(0)===e.sliceSerialize(t[r][1]).charCodeAt(0)){if((t[n][1]._close||t[r][1]._open)&&(t[r][1].end.offset-t[r][1].start.offset)%3&&!((t[n][1].end.offset-t[n][1].start.offset+t[r][1].end.offset-t[r][1].start.offset)%3))continue;l=t[n][1].end.offset-t[n][1].start.offset>1&&t[r][1].end.offset-t[r][1].start.offset>1?2:1;const u={...t[n][1].end},d={...t[r][1].start};pE(u,-l),pE(d,l),o={type:l>1?"strongSequence":"emphasisSequence",start:u,end:{...t[n][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...t[r][1].start},end:d},s={type:l>1?"strongText":"emphasisText",start:{...t[n][1].end},end:{...t[r][1].start}},i={type:l>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},t[n][1].end={...o.start},t[r][1].start={...a.end},c=[],t[n][1].end.offset-t[n][1].start.offset&&(c=xs(c,[["enter",t[n][1],e],["exit",t[n][1],e]])),c=xs(c,[["enter",i,e],["enter",o,e],["exit",o,e],["enter",s,e]]),c=xs(c,rw(e.parser.constructs.insideSpan.null,t.slice(n+1,r),e)),c=xs(c,[["exit",s,e],["enter",a,e],["exit",a,e],["exit",i,e]]),t[r][1].end.offset-t[r][1].start.offset?(h=2,c=xs(c,[["enter",t[r][1],e],["exit",t[r][1],e]])):h=0,ns(t,n-1,r-n+3,c),r=n+c.length-h-2;break}}for(r=-1;++r<t.length;)t[r][1].type==="attentionSequence"&&(t[r][1].type="data");return t}function Ile(t,e){const r=this.parser.constructs.attentionMarkers.null,n=this.previous,i=Cf(n);let s;return o;function o(l){return s=l,t.enter("attentionSequence"),a(l)}function a(l){if(l===s)return t.consume(l),a;const c=t.exit("attentionSequence"),h=Cf(l),u=!h||h===2&&i||r.includes(l),d=!i||i===2&&h||r.includes(n);return c._open=!!(s===42?u:u&&(i||!d)),c._close=!!(s===42?d:d&&(h||!u)),e(l)}}function pE(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const Ble={name:"autolink",tokenize:Rle};function Rle(t,e,r){let n=0;return i;function i(f){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(f),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),s}function s(f){return ei(f)?(t.consume(f),o):f===64?r(f):c(f)}function o(f){return f===43||f===45||f===46||Ai(f)?(n=1,a(f)):c(f)}function a(f){return f===58?(t.consume(f),n=0,l):(f===43||f===45||f===46||Ai(f))&&n++<32?(t.consume(f),a):(n=0,c(f))}function l(f){return f===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(f),t.exit("autolinkMarker"),t.exit("autolink"),e):f===null||f===32||f===60||ax(f)?r(f):(t.consume(f),l)}function c(f){return f===64?(t.consume(f),h):Sle(f)?(t.consume(f),c):r(f)}function h(f){return Ai(f)?u(f):r(f)}function u(f){return f===46?(t.consume(f),n=0,h):f===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(f),t.exit("autolinkMarker"),t.exit("autolink"),e):d(f)}function d(f){if((f===45||Ai(f))&&n++<63){const p=f===45?d:u;return t.consume(f),p}return r(f)}}const w1={partial:!0,tokenize:Ple};function Ple(t,e,r){return n;function n(s){return It(s)?Ot(t,i,"linePrefix")(s):i(s)}function i(s){return s===null||Qe(s)?e(s):r(s)}}const dF={continuation:{tokenize:Fle},exit:$le,name:"blockQuote",tokenize:Nle};function Nle(t,e,r){const n=this;return i;function i(o){if(o===62){const a=n.containerState;return a.open||(t.enter("blockQuote",{_container:!0}),a.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(o),t.exit("blockQuoteMarker"),s}return r(o)}function s(o){return It(o)?(t.enter("blockQuotePrefixWhitespace"),t.consume(o),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(o))}}function Fle(t,e,r){const n=this;return i;function i(o){return It(o)?Ot(t,s,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):s(o)}function s(o){return t.attempt(dF,e,r)(o)}}function $le(t){t.exit("blockQuote")}const fF={name:"characterEscape",tokenize:zle};function zle(t,e,r){return n;function n(s){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(s),t.exit("escapeMarker"),i}function i(s){return _le(s)?(t.enter("characterEscapeValue"),t.consume(s),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):r(s)}}const pF={name:"characterReference",tokenize:Hle};function Hle(t,e,r){const n=this;let i=0,s,o;return a;function a(u){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(u),t.exit("characterReferenceMarker"),l}function l(u){return u===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(u),t.exit("characterReferenceMarkerNumeric"),c):(t.enter("characterReferenceValue"),s=31,o=Ai,h(u))}function c(u){return u===88||u===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(u),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),s=6,o=Tle,h):(t.enter("characterReferenceValue"),s=7,o=cC,h(u))}function h(u){if(u===59&&i){const d=t.exit("characterReferenceValue");return o===Ai&&!d7(n.sliceSerialize(d))?r(u):(t.enter("characterReferenceMarker"),t.consume(u),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return o(u)&&i++<s?(t.consume(u),h):r(u)}}const mE={partial:!0,tokenize:Vle},gE={concrete:!0,name:"codeFenced",tokenize:qle};function qle(t,e,r){const n=this,i={partial:!0,tokenize:k};let s=0,o=0,a;return l;function l(w){return c(w)}function c(w){const _=n.events[n.events.length-1];return s=_&&_[1].type==="linePrefix"?_[2].sliceSerialize(_[1],!0).length:0,a=w,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),h(w)}function h(w){return w===a?(o++,t.consume(w),h):o<3?r(w):(t.exit("codeFencedFenceSequence"),It(w)?Ot(t,u,"whitespace")(w):u(w))}function u(w){return w===null||Qe(w)?(t.exit("codeFencedFence"),n.interrupt?e(w):t.check(mE,m,S)(w)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),d(w))}function d(w){return w===null||Qe(w)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),u(w)):It(w)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),Ot(t,f,"whitespace")(w)):w===96&&w===a?r(w):(t.consume(w),d)}function f(w){return w===null||Qe(w)?u(w):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),p(w))}function p(w){return w===null||Qe(w)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),u(w)):w===96&&w===a?r(w):(t.consume(w),p)}function m(w){return t.attempt(i,S,g)(w)}function g(w){return t.enter("lineEnding"),t.consume(w),t.exit("lineEnding"),y}function y(w){return s>0&&It(w)?Ot(t,b,"linePrefix",s+1)(w):b(w)}function b(w){return w===null||Qe(w)?t.check(mE,m,S)(w):(t.enter("codeFlowValue"),x(w))}function x(w){return w===null||Qe(w)?(t.exit("codeFlowValue"),b(w)):(t.consume(w),x)}function S(w){return t.exit("codeFenced"),e(w)}function k(w,_,L){let B=0;return E;
vendor: 5,892 bytes, line 51
51function E($){return w.enter("lineEnding"),w.consume($),w.exit("lineEnding"),D}function D($){return w.enter("codeFencedFence"),It($)?Ot(w,N,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):N($)}function N($){return $===a?(w.enter("codeFencedFenceSequence"),K($)):L($)}function K($){return $===a?(B++,w.consume($),K):B>=o?(w.exit("codeFencedFenceSequence"),It($)?Ot(w,z,"whitespace")($):z($)):L($)}function z($){return $===null||Qe($)?(w.exit("codeFencedFence"),_($)):L($)}}}function Vle(t,e,r){const n=this;return i;function i(o){return o===null?r(o):(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),s)}function s(o){return n.parser.lazy[n.now().line]?r(o):e(o)}}const f5={name:"codeIndented",tokenize:jle},Wle={partial:!0,tokenize:Ule};function jle(t,e,r){const n=this;return i;function i(c){return t.enter("codeIndented"),Ot(t,s,"linePrefix",5)(c)}function s(c){const h=n.events[n.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?o(c):r(c)}function o(c){return c===null?l(c):Qe(c)?t.attempt(Wle,o,l)(c):(t.enter("codeFlowValue"),a(c))}function a(c){return c===null||Qe(c)?(t.exit("codeFlowValue"),o(c)):(t.consume(c),a)}function l(c){return t.exit("codeIndented"),e(c)}}function Ule(t,e,r){const n=this;return i;function i(o){return n.parser.lazy[n.now().line]?r(o):Qe(o)?(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),i):Ot(t,s,"linePrefix",5)(o)}function s(o){const a=n.events[n.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(o):Qe(o)?i(o):r(o)}}const Gle={name:"codeText",previous:Yle,resolve:Kle,tokenize:Xle};function Kle(t){let e=t.length-4,r=3,n,i;if((t[r][1].type==="lineEnding"||t[r][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(n=r;++n<e;)if(t[n][1].type==="codeTextData"){t[r][1].type="codeTextPadding",t[e][1].type="codeTextPadding",r+=2,e-=2;break}}for(n=r-1,e++;++n<=e;)i===void 0?n!==e&&t[n][1].type!=="lineEnding"&&(i=n):(n===e||t[n][1].type==="lineEnding")&&(t[i][1].type="codeTextData",n!==i+2&&(t[i][1].end=t[n-1][1].end,t.splice(i+2,n-i-2),e-=n-i-2,n=i+2),i=void 0);return t}function Yle(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Xle(t,e,r){let n=0,i,s;return o;function o(u){return t.enter("codeText"),t.enter("codeTextSequence"),a(u)}function a(u){return u===96?(t.consume(u),n++,a):(t.exit("codeTextSequence"),l(u))}function l(u){return u===null?r(u):u===32?(t.enter("space"),t.consume(u),t.exit("space"),l):u===96?(s=t.enter("codeTextSequence"),i=0,h(u)):Qe(u)?(t.enter("lineEnding"),t.consume(u),t.exit("lineEnding"),l):(t.enter("codeTextData"),c(u))}function c(u){return u===null||u===32||u===96||Qe(u)?(t.exit("codeTextData"),l(u)):(t.consume(u),c)}function h(u){return u===96?(t.consume(u),i++,h):i===n?(t.exit("codeTextSequence"),t.exit("codeText"),e(u)):(s.type="codeTextData",c(u))}}class Jle{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,r){const n=r??Number.POSITIVE_INFINITY;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,r,n){const i=r||0;this.setCursor(Math.trunc(e));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return n&&F0(this.left,n),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),F0(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),F0(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const r=this.left.splice(e,Number.POSITIVE_INFINITY);F0(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);F0(this.left,r.reverse())}}}function F0(t,e){let r=0;if(e.length<1e4)t.push(...e);else for(;r<e.length;)t.push(...e.slice(r,r+1e4)),r+=1e4}function mF(t){const e={};let r=-1,n,i,s,o,a,l,c;const h=new Jle(t);for(;++r<h.length;){for(;r in e;)r=e[r];if(n=h.get(r),r&&n[1].type==="chunkFlow"&&h.get(r-1)[1].type==="listItemPrefix"&&(l=n[1]._tokenizer.events,s=0,s<l.length&&l[s][1].type==="lineEndingBlank"&&(s+=2),s<l.length&&l[s][1].type==="content"))for(;++s<l.length&&l[s][1].type!=="content";)l[s][1].type==="chunkText"&&(l[s][1]._isInFirstContentOfListItem=!0,s++);if(n[0]==="enter")n[1].contentType&&(Object.assign(e,Zle(h,r)),r=e[r],c=!0);else if(n[1]._container){for(s=r,i=void 0;s--;)if(o=h.get(s),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(h.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=s);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(n[1].end={...h.get(i)[1].start},a=h.slice(i,r),a.unshift(n),h.splice(i,r-i+1,a))}}return ns(t,0,Number.POSITIVE_INFINITY,h.slice(0)),!c}function Zle(t,e){const r=t.get(e)[1],n=t.get(e)[2];let i=e-1;const s=[];let o=r._tokenizer;o||(o=n.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const a=o.events,l=[],c={};let h,u,d=-1,f=r,p=0,m=0;const g=[m];for(;f;){for(;t.get(++i)[1]!==f;);s.push(i),f._tokenizer||(h=n.sliceStream(f),f.next||h.push(null),u&&o.defineSki
vendor: 22,904 bytes, line 51
51p(f.start),f._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(h),f._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),u=f,f=f.next}for(f=r;++d<a.length;)a[d][0]==="exit"&&a[d-1][0]==="enter"&&a[d][1].type===a[d-1][1].type&&a[d][1].start.line!==a[d][1].end.line&&(m=d+1,g.push(m),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(o.events=[],f?(f._tokenizer=void 0,f.previous=void 0):g.pop(),d=g.length;d--;){const y=a.slice(g[d],g[d+1]),b=s.pop();l.push([b,b+y.length-1]),t.splice(b,2,y)}for(l.reverse(),d=-1;++d<l.length;)c[p+l[d][0]]=p+l[d][1],p+=l[d][1]-l[d][0]-1;return c}const Qle={resolve:tce,tokenize:rce},ece={partial:!0,tokenize:nce};function tce(t){return mF(t),t}function rce(t,e){let r;return n;function n(a){return t.enter("content"),r=t.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?s(a):Qe(a)?t.check(ece,o,s)(a):(t.consume(a),i)}function s(a){return t.exit("chunkContent"),t.exit("content"),e(a)}function o(a){return t.consume(a),t.exit("chunkContent"),r.next=t.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,i}}function nce(t,e,r){const n=this;return i;function i(o){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),Ot(t,s,"linePrefix")}function s(o){if(o===null||Qe(o))return r(o);const a=n.events[n.events.length-1];return!n.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(o):t.interrupt(n.parser.constructs.flow,r,e)(o)}}function gF(t,e,r,n,i,s,o,a,l){const c=l||Number.POSITIVE_INFINITY;let h=0;return u;function u(y){return y===60?(t.enter(n),t.enter(i),t.enter(s),t.consume(y),t.exit(s),d):y===null||y===32||y===41||ax(y)?r(y):(t.enter(n),t.enter(o),t.enter(a),t.enter("chunkString",{contentType:"string"}),m(y))}function d(y){return y===62?(t.enter(s),t.consume(y),t.exit(s),t.exit(i),t.exit(n),e):(t.enter(a),t.enter("chunkString",{contentType:"string"}),f(y))}function f(y){return y===62?(t.exit("chunkString"),t.exit(a),d(y)):y===null||y===60||Qe(y)?r(y):(t.consume(y),y===92?p:f)}function p(y){return y===60||y===62||y===92?(t.consume(y),f):f(y)}function m(y){return!h&&(y===null||y===41||lr(y))?(t.exit("chunkString"),t.exit(a),t.exit(o),t.exit(n),e(y)):h<c&&y===40?(t.consume(y),h++,m):y===41?(t.consume(y),h--,m):y===null||y===32||y===40||ax(y)?r(y):(t.consume(y),y===92?g:m)}function g(y){return y===40||y===41||y===92?(t.consume(y),m):m(y)}}function yF(t,e,r,n,i,s){const o=this;let a=0,l;return c;function c(f){return t.enter(n),t.enter(i),t.consume(f),t.exit(i),t.enter(s),h}function h(f){return a>999||f===null||f===91||f===93&&!l||f===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?r(f):f===93?(t.exit(s),t.enter(i),t.consume(f),t.exit(i),t.exit(n),e):Qe(f)?(t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),h):(t.enter("chunkString",{contentType:"string"}),u(f))}function u(f){return f===null||f===91||f===93||Qe(f)||a++>999?(t.exit("chunkString"),h(f)):(t.consume(f),l||(l=!It(f)),f===92?d:u)}function d(f){return f===91||f===92||f===93?(t.consume(f),a++,u):u(f)}}function bF(t,e,r,n,i,s){let o;return a;function a(d){return d===34||d===39||d===40?(t.enter(n),t.enter(i),t.consume(d),t.exit(i),o=d===40?41:d,l):r(d)}function l(d){return d===o?(t.enter(i),t.consume(d),t.exit(i),t.exit(n),e):(t.enter(s),c(d))}function c(d){return d===o?(t.exit(s),l(o)):d===null?r(d):Qe(d)?(t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),Ot(t,c,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),h(d))}function h(d){return d===o||d===null||Qe(d)?(t.exit("chunkString"),c(d)):(t.consume(d),d===92?u:h)}function u(d){return d===o||d===92?(t.consume(d),h):h(d)}}function om(t,e){let r;return n;function n(i){return Qe(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),r=!0,n):It(i)?Ot(t,n,r?"linePrefix":"lineSuffix")(i):e(i)}}const ice={name:"definition",tokenize:oce},sce={partial:!0,tokenize:ace};function oce(t,e,r){const n=this;let i;return s;function s(f){return t.enter("definition"),o(f)}function o(f){return yF.call(n,t,a,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function a(f){return i=Qs(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)),f===58?(t.enter("definitionMarker"),t.consume(f),t.exit("definitionMarker"),l):r(f)}function l(f){return lr(f)?om(t,c)(f):c(f)}function c(f){return gF(t,h,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function h(f){return t.attempt(sce,u,u)(f)}function u(f){return It(f)?Ot(t,d,"whitespace")(f):d(f)}function d(f){return f===null||Qe(f)?(t.exit("definition"),n.parser.defined.push(i),e(f)):r(f)}}function ace(t,e,r){return n;function n(a){return lr(a)?om(t,i)(a):r(a)}function i(a){return bF(t,s,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function s(a){return It(a)?Ot(t,o,"whitespace")(a):o(a)}function o(a){return a===null||Qe(a)?e(a):r(a)}}const lce={name:"hardBreakEscape",tokenize:cce};function cce(t,e,r){return n;function n(s){return t.enter("hardBreakEscape"),t.consume(s),i}function i(s){return Qe(s)?(t.exit("hardBreakEscape"),e(s)):r(s)}}const hce={name:"headingAtx",resolve:uce,tokenize:dce};function uce(t,e){let r=t.length-2,n=3,i,s;return t[n][1].type==="whitespace"&&(n+=2),r-2>n&&t[r][1].type==="whitespace"&&(r-=2),t[r][1].type==="atxHeadingSequence"&&(n===r-1||r-4>n&&t[r-2][1].type==="whitespace")&&(r-=n+1===r?2:4),r>n&&(i={type:"atxHeadingText",start:t[n][1].start,end:t[r][1].end},s={type:"chunkText",start:t[n][1].start,end:t[r][1].end,contentType:"text"},ns(t,n,r-n+1,[["enter",i,e],["enter",s,e],["exit",s,e],["exit",i,e]])),t}function dce(t,e,r){let n=0;return i;function i(h){return t.enter("atxHeading"),s(h)}function s(h){return t.enter("atxHeadingSequence"),o(h)}function o(h){return h===35&&n++<6?(t.consume(h),o):h===null||lr(h)?(t.exit("atxHeadingSequence"),a(h)):r(h)}function a(h){return h===35?(t.enter("atxHeadingSequence"),l(h)):h===null||Qe(h)?(t.exit("atxHeading"),e(h)):It(h)?Ot(t,a,"whitespace")(h):(t.enter("atxHeadingText"),c(h))}function l(h){return h===35?(t.consume(h),l):(t.exit("atxHeadingSequence"),a(h))}function c(h){return h===null||h===35||lr(h)?(t.exit("atxHeadingText"),a(h)):(t.consume(h),c)}}const fce=["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","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],yE=["pre","script","style","textarea"],pce={concrete:!0,name:"htmlFlow",resolveTo:yce,tokenize:bce},mce={partial:!0,tokenize:vce},gce={partial:!0,tokenize:xce};function yce(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function bce(t,e,r){const n=this;let i,s,o,a,l;return c;function c(I){return h(I)}function h(I){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(I),u}function u(I){return I===33?(t.consume(I),d):I===47?(t.consume(I),s=!0,m):I===63?(t.consume(I),i=3,n.interrupt?e:O):ei(I)?(t.consume(I),o=String.fromCharCode(I),g):r(I)}function d(I){return I===45?(t.consume(I),i=2,f):I===91?(t.consume(I),i=5,a=0,p):ei(I)?(t.consume(I),i=4,n.interrupt?e:O):r(I)}function f(I){return I===45?(t.consume(I),n.interrupt?e:O):r(I)}function p(I){const tt="CDATA[";return I===tt.charCodeAt(a++)?(t.consume(I),a===tt.length?n.interrupt?e:N:p):r(I)}function m(I){return ei(I)?(t.consume(I),o=String.fromCharCode(I),g):r(I)}function g(I){if(I===null||I===47||I===62||lr(I)){const tt=I===47,qe=o.toLowerCase();return!tt&&!s&&yE.includes(qe)?(i=1,n.interrupt?e(I):N(I)):fce.includes(o.toLowerCase())?(i=6,tt?(t.consume(I),y):n.interrupt?e(I):N(I)):(i=7,n.interrupt&&!n.parser.lazy[n.now().line]?r(I):s?b(I):x(I))}return I===45||Ai(I)?(t.consume(I),o+=String.fromCharCode(I),g):r(I)}function y(I){return I===62?(t.consume(I),n.interrupt?e:N):r(I)}function b(I){return It(I)?(t.consume(I),b):E(I)}function x(I){return I===47?(t.consume(I),E):I===58||I===95||ei(I)?(t.consume(I),S):It(I)?(t.consume(I),x):E(I)}function S(I){return I===45||I===46||I===58||I===95||Ai(I)?(t.consume(I),S):k(I)}function k(I){return I===61?(t.consume(I),w):It(I)?(t.consume(I),k):x(I)}function w(I){return I===null||I===60||I===61||I===62||I===96?r(I):I===34||I===39?(t.consume(I),l=I,_):It(I)?(t.consume(I),w):L(I)}function _(I){return I===l?(t.consume(I),l=null,B):I===null||Qe(I)?r(I):(t.consume(I),_)}function L(I){return I===null||I===34||I===39||I===47||I===60||I===61||I===62||I===96||lr(I)?k(I):(t.consume(I),L)}function B(I){return I===47||I===62||It(I)?x(I):r(I)}function E(I){return I===62?(t.consume(I),D):r(I)}function D(I){return I===null||Qe(I)?N(I):It(I)?(t.consume(I),D):r(I)}function N(I){return I===45&&i===2?(t.consume(I),H):I===60&&i===1?(t.consume(I),j):I===62&&i===4?(t.consume(I),fe):I===63&&i===3?(t.consume(I),O):I===93&&i===5?(t.consume(I),ne):Qe(I)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(mce,Te,K)(I)):I===null||Qe(I)?(t.exit("htmlFlowData"),K(I)):(t.consume(I),N)}function K(I){return t.check(gce,z,Te)(I)}function z(I){return t.enter("lineEnding"),t.consume(I),t.exit("lineEnding"),$}function $(I){return I===null||Qe(I)?K(I):(t.enter("htmlFlowData"),N(I))}function H(I){return I===45?(t.consume(I),O):N(I)}function j(I){return I===47?(t.consume(I),o="",q):N(I)}function q(I){if(I===62){const tt=o.toLowerCase();return yE.includes(tt)?(t.consume(I),fe):N(I)}return ei(I)&&o.length<8?(t.consume(I),o+=String.fromCharCode(I),q):N(I)}function ne(I){return I===93?(t.consume(I),O):N(I)}function O(I){return I===62?(t.consume(I),fe):I===45&&i===2?(t.consume(I),O):N(I)}function fe(I){return I===null||Qe(I)?(t.exit("htmlFlowData"),Te(I)):(t.consume(I),fe)}function Te(I){return t.exit("htmlFlow"),e(I)}}function xce(t,e,r){const n=this;return i;function i(o){return Qe(o)?(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),s):r(o)}function s(o){return n.parser.lazy[n.now().line]?r(o):e(o)}}function vce(t,e,r){return n;function n(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(w1,e,r)}}const wce={name:"htmlText",tokenize:kce};function kce(t,e,r){const n=this;let i,s,o;return a;function a(O){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(O),l}function l(O){return O===33?(t.consume(O),c):O===47?(t.consume(O),k):O===63?(t.consume(O),x):ei(O)?(t.consume(O),L):r(O)}function c(O){return O===45?(t.consume(O),h):O===91?(t.consume(O),s=0,p):ei(O)?(t.consume(O),b):r(O)}function h(O){return O===45?(t.consume(O),f):r(O)}function u(O){return O===null?r(O):O===45?(t.consume(O),d):Qe(O)?(o=u,j(O)):(t.consume(O),u)}function d(O){return O===45?(t.consume(O),f):u(O)}function f(O){return O===62?H(O):O===45?d(O):u(O)}function p(O){const fe="CDATA[";return O===fe.charCodeAt(s++)?(t.consume(O),s===fe.length?m:p):r(O)}function m(O){return O===null?r(O):O===93?(t.consume(O),g):Qe(O)?(o=m,j(O)):(t.consume(O),m)}function g(O){return O===93?(t.consume(O),y):m(O)}function y(O){return O===62?H(O):O===93?(t.consume(O),y):m(O)}function b(O){return O===null||O===62?H(O):Qe(O)?(o=b,j(O)):(t.consume(O),b)}function x(O){return O===null?r(O):O===63?(t.consume(O),S):Qe(O)?(o=x,j(O)):(t.consume(O),x)}function S(O){return O===62?H(O):x(O)}function k(O){return ei(O)?(t.consume(O),w):r(O)}function w(O){return O===45||Ai(O)?(t.consume(O),w):_(O)}function _(O){return Qe(O)?(o=_,j(O)):It(O)?(t.consume(O),_):H(O)}function L(O){return O===45||Ai(O)?(t.consume(O),L):O===47||O===62||lr(O)?B(O):r(O)}function B(O){return O===47?(t.consume(O),H):O===58||O===95||ei(O)?(t.consume(O),E):Qe(O)?(o=B,j(O)):It(O)?(t.consume(O),B):H(O)}function E(O){return O===45||O===46||O===58||O===95||Ai(O)?(t.consume(O),E):D(O)}function D(O){return O===61?(t.consume(O),N):Qe(O)?(o=D,j(O)):It(O)?(t.consume(O),D):B(O)}function N(O){return O===null||O===60||O===61||O===62||O===96?r(O):O===34||O===39?(t.consume(O),i=O,K):Qe(O)?(o=N,j(O)):It(O)?(t.consume(O),N):(t.consume(O),z)}function K(O){return O===i?(t.consume(O),i=void 0,$):O===null?r(O):Qe(O)?(o=K,j(O)):(t.consume(O),K)}function z(O){return O===null||O===34||O===39||O===60||O===61||O===96?r(O):O===47||O===62||lr(O)?B(O):(t.consume(O),z)}function $(O){return O===47||O===62||lr(O)?B(O):r(O)}function H(O){return O===62?(t.consume(O),t.exit("htmlTextData"),t.exit("htmlText"),e):r(O)}function j(O){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(O),t.exit("lineEnding"),q}function q(O){return It(O)?Ot(t,ne,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):ne(O)}function ne(O){return t.enter("htmlTextData"),o(O)}}const f7={name:"labelEnd",resolveAll:_ce,resolveTo:Mce,tokenize:Ace},Cce={tokenize:Ece},Sce={tokenize:Oce},Tce={tokenize:Lce};function _ce(t){let e=-1;const r=[];for(;++e<t.length;){const n=t[e][1];if(r.push(t[e]),n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd"){const i=n.type==="labelImage"?4:2;n.type="data",e+=i}}return t.length!==r.length&&ns(t,0,t.length,r),t}function Mce(t,e){let r=t.length,n=0,i,s,o,a;for(;r--;)if(i=t[r][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;t[r][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(t[r][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=r,i.type!=="labelLink")){n=2;break}}else i.type==="labelEnd"&&(o=r);const l={type:t[s][1].type==="labelLink"?"link":"image",start:{...t[s][1].start},end:{...t[t.length-1][1].end}},c={type:"label",start:{...t[s][1].start},end:{...t[o][1].end}},h={type:"labelText",start:{...t[s+n+2][1].end},end:{...t[o-2][1].start}};return a=[["enter",l,e],["enter",c,e]],a=xs(a,t.slice(s+1,s+n+3)),a=xs(a,[["enter",h,e]]),a=xs(a,rw(e.parser.constructs.insideSpan.null,t.slice(s+n+4,o-3),e)),a=xs(a,[["exit",h,e],t[o-2],t[o-1],["exit",c,e]]),a=xs(a,t.slice(o+1)),a=xs(a,[["exit",l,e]]),ns(t,s,t.length,a),t}function Ace(t,e,r){const n=this;let i=n.events.length,s,o;for(;i--;)if((n.events[i][1].type==="labelImage"||n.events[i][1].type==="labelLink")&&!n.events[i][1]._balanced){s=n.events[i][1];break}return a;function a(d){return s?s._inactive?u(d):(o=n.parser.defined.includes(Qs(n.sliceSerialize({start:s.end,end:n.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(d),t.exit("labelMarker"),t.exit("labelEnd"),l):r(d)}function l(d){return d===40?t.attempt(Cce,h,o?h:u)(d):d===91?t.attempt(Sce,h,o?c:u)(d):o?h(d):u(d)}function c(d){return t.attempt(Tce,h,u)(d)}function h(d){return e(d)}function u(d){return s._balanced=!0,r(d)}}function Ece(t,e,r){return n;function n(u){return t.enter("resource"),t.enter("resourceMarker"),t.consume(u),t.exit("resourceMarker"),i}function i(u){return lr(u)?om(t,s)(u):s(u)}function s(u){return u===41?h(u):gF(t,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(u)}function o(u){return lr(u)?om(t,l)(u):h(u)}function a(u){return r(u)}function l(u){return u===34||u===39||u===40?bF(t,c,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(u):h(u)}function c(u){return lr(u)?om(t,h)(u):h(u)}function h(u){return u===41?(t.enter("resourceMarker"),t.consume(u),t.exit("resourceMarker"),t.exit("resource"),e):r(u)}}function Oce(t,e,r){const n=this;return i;function i(a){return yF.call(n,t,s,o,"reference","referenceMarker","referenceString")(a)}function s(a){return n.parser.defined.includes(Qs(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)))?e(a):r(a)}function o(a){return r(a)}}function Lce(t,e,r){return n;function n(s){return t.enter("reference"),t.enter("referenceMarker"),t.consume(s),t.exit("referenceMarker"),i}function i(s){return s===93?(t.enter("referenceMarker"),t.consume(s),t.exit("referenceMarker"),t.exit("reference"),e):r(s)}}const Dce={name:"labelStartImage",resolveAll:f7.resolveAll,tokenize:Ice};function Ice(t,e,r){const n=this;return i;function i(a){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(a),t.exit("labelImageMarker"),s}function s(a){return a===91?(t.enter("labelMarker"),t.consume(a),t.exit("labelMarker"),t.exit("labelImage"),o):r(a)}function o(a){return a===94&&"_hiddenFootnoteSupport"in n.parser.constructs?r(a):e(a)}}const Bce={name:"labelStartLink",resolveAll:f7.resolveAll,tokenize:Rce};function Rce(t,e,r){const n=this;return i;function i(o){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(o),t.exit("labelMarker"),t.exit("labelLink"),s}function s(o){return o===94&&"_hiddenFootnoteSupport"in n.parser.constructs?r(o):e(o)}}const p5={name:"lineEnding",tokenize:Pce};function Pce(t,e){return r;function r(n){return t.enter("lineEnding"),t.consume(n),t.exit("lineEnding"),Ot(t,e,"linePrefix")}}const R2={name:"thematicBreak",tokenize:Nce};function Nce(t,e,r){let n=0,i;return s;function s(c){return t.enter("thematicBreak"),o(c)}function o(c){return i=c,a(c)}function a(c){return c===i?(t.enter("thematicBreakSequence"),l(c)):n>=3&&(c===null||Qe(c))?(t.exit("thematicBreak"),e(c)):r(c)}function l(c){return c===i?(t.consume(c),n++,l):(t.exit("thematicBreakSequence"),It(c)?Ot(t,a,"whitespace")(c):a(c))}}const gi={continuation:{tokenize:Hce},exit:Vce,name:"list",tokenize:zce},Fce={partial:!0,tokenize:Wce},$ce={partial:!0,tokenize:qce};function zce(t,e,r){const n=this,i=n.events[n.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return a;function a(f){const p=n.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!n.containerState.marker||f===n.containerState.marker:cC(f)){if(n.containerState.type||(n.containerState.type=p,t.enter(p,{_container:!0})),p==="listUnordered")return t.enter("listItemPrefix"),f===42||f===45?t.check(R2,r,c)(f):c(f);if(!n.interrupt||f===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),l(f)}return r(f)}function l(f){return cC(f)&&++o<10?(t.consume(f),l):(!n.interrupt||o<2)&&(n.containerState.marker?f===n.containerState.marker:f===41||f===46)?(t.exit("listItemValue"),c(f)):r(f)}function c(f){return t.enter("listItemMarker"),t.consume(f),t.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||f,t.check(w1,n.interrupt?r:h,t.attempt(Fce,d,u))}function h(f){return n.containerState.initialBlankLine=!0,s++,d(f)}function u(f){return It(f)?(t.enter("listItemPrefixWhitespace"),t.consume(f),t.exit("listItemPrefixWhitespace"),d):r(f)}function d(f){return n.containerState.size=s+n.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(f)}}function Hce(t,e,r){const n=this;return n.containerState._closeFlow=void 0,t.check(w1,i,s);function i(a){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,Ot(t,e,"listItemIndent",n.containerState.size+1)(a)}function s(a){return n.containerState.furtherBlankLines||!It(a)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,o(a)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,t.attempt($ce,e,o)(a))}function o(a){return n.containerState._closeFlow=!0,n.interrupt=void 0,Ot(t,t.attempt(gi,e,r),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function qce(t,e,r){const n=this;return Ot(t,i,"listItemIndent",n.containerState.size+1);function i(s){const o=n.events[n.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===n.containerState.size?e(s):r(s)}}function Vce(t){t.exit(this.containerState.type)}function Wce(t,e,r){const n=this;return Ot(t,i,"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const o=n.events[n.events.length-1];return!It(s)&&o&&o[1].type==="listItemPrefixWhitespace"?e(s):r(s)}}const bE={name:"setextUnderline",resolveTo:jce,tokenize:Uce};function jce(t,e){let r=t.length,n,i,s;for(;r--;)if(t[r][0]==="enter"){if(t[r][1].type==="content"){n=r;break}t[r][1].type==="paragraph"&&(i=r)}else t[r][1].type==="content"&&t.splice(r,1),!s&&t[r][1].type==="definition"&&(s=r);const o={type:"setextHeading",start:{...t[n][1].start},end:{...t[t.length-1][1].end}};return t[i][1].type="setextHeadingText",s?(t.splice(i,0,["enter",o,e]),t.splice(s+1,0,["exit",t[n][1],e]),t[n][1].end={...t[s][1].end}):t[n][1]=o,t.push(["exit",o,e]),t}function Uce(t,e,r){const n=this;let i;return s;function s(c){let h=n.events.length,u;for(;h--;)if(n.events[h][1].type!=="lineEnding"&&n.events[h][1].type!=="linePrefix"&&n.events[h][1].type!=="content"){u=n.events[h][1].type==="paragraph";break}return!n.parser.lazy[n.now().line]&&(n.interrupt||u)?(t.enter("setextHeadingLine"),i=c,o(c)):r(c)}function o(c){return t.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===i?(t.consume(c),a):(t.exit("setextHeadingLineSequence"),It(c)?Ot(t,l,"lineSuffix")(c):l(c))}function l(c){return c===null||Qe(c)?(t.exit("setextHeadingLine"),e(c)):r(c)}}const Gce={tokenize:Kce};function Kce(t){const e=this,r=t.attempt(w1,n,t.attempt(this.parser.constructs.flowInitial,i,Ot(t,t.attempt(this.parser.constructs.flow,i,t.attempt(Qle,i)),"linePrefix")));return r;function n(s){if(s===null){t.consume(s);return}return t.enter("lineEndingBlank"),t.consume(s),t.exit("lineEndingBlank"),e.currentConstruct=void 0,r}function i(s){if(s===null){t.consume(s);return}return t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),e.currentConstruct=void 0,r}}const Yce={resolveAll:vF()},Xce=xF("string"),Jce=xF("text");function xF(t){return{resolveAll:vF(t==="text"?Zce:void 0),tokenize:e};function e(r){const n=this,i=this.parser.constructs[t],s=r.attempt(i,o,a);return o;function o(h){return c(h)?s(h):a(h)}function a(h){if(h===null){r.consume(h);return}return r.enter("data"),r.consume(h),l}function l(h){return c(h)?(r.exit("data"),s(h)):(r.consume(h),l)}function c(h){if(h===null)return!0;const u=i[h];let d=-1;if(u)for(;++d<u.length;){const f=u[d];if(!f.previous||f.previous.call(n,n.previous))return!0}return!1}}}function vF(t){return e;function e(r,n){let i=-1,s;for(;++i<=r.length;)s===void 0?r[i]&&r[i][1].type==="data"&&(s=i,i++):(!r[i]||r[i][1].type!=="data")&&(i!==s+2&&(r[s][1].end=r[i-1][1].end,r.splice(s+2,i-s-2),i=s+2),s=void 0);return t?t(r,n):r}}function Zce(t,e){let r=0;for(;++r<=t.length;)if((r===t.length||t[r][1].type==="lineEnding")&&t[r-1][1].type==="data"){const n=t[r-1][1],i=e.sliceStream(n);let s=i.length,o=-1,a=0,l;for(;s--;){const c=i[s];if(typeof c=="string"){for(o=c.length;
vendor: 5,208 bytes, lines 51-53
51c.charCodeAt(o-1)===32;)a++,o--;if(o)break;o=-1}else if(c===-2)l=!0,a++;else if(c!==-1){s++;break}}if(e._contentTypeTextTrailing&&r===t.length&&(a=0),a){const c={type:r===t.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?o:n.start._bufferIndex+o,_index:n.start._index+s,line:n.end.line,column:n.end.column-a,offset:n.end.offset-a},end:{...n.end}};n.end={...c.start},n.start.offset===n.end.offset?Object.assign(n,c):(t.splice(r,0,["enter",c,e],["exit",c,e]),r+=2)}r++}return t}const Qce={42:gi,43:gi,45:gi,48:gi,49:gi,50:gi,51:gi,52:gi,53:gi,54:gi,55:gi,56:gi,57:gi,62:dF},ehe={91:ice},the={[-2]:f5,[-1]:f5,32:f5},rhe={35:hce,42:R2,45:[bE,R2],60:pce,61:bE,95:R2,96:gE,126:gE},nhe={38:pF,92:fF},ihe={[-5]:p5,[-4]:p5,[-3]:p5,33:Dce,38:pF,42:hC,60:[Ble,wce],91:Bce,92:[lce,fF],93:f7,95:hC,96:Gle},she={null:[hC,Yce]},ohe={null:[42,95]},ahe={null:[]},lhe=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:ohe,contentInitial:ehe,disable:ahe,document:Qce,flow:rhe,flowInitial:the,insideSpan:she,string:nhe,text:ihe},Symbol.toStringTag,{value:"Module"}));function che(t,e,r){let n={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0};const i={},s=[];let o=[],a=[];const l={attempt:_(k),check:_(w),consume:b,enter:x,exit:S,interrupt:_(w,{interrupt:!0})},c={code:null,containerState:{},defineSkip:m,events:[],now:p,parser:t,previous:null,sliceSerialize:d,sliceStream:f,write:u};let h=e.tokenize.call(c,l);return e.resolveAll&&s.push(e),c;function u(D){return o=xs(o,D),g(),o[o.length-1]!==null?[]:(L(e,0),c.events=rw(s,c.events,c),c.events)}function d(D,N){return uhe(f(D),N)}function f(D){return hhe(o,D)}function p(){const{_bufferIndex:D,_index:N,line:K,column:z,offset:$}=n;return{_bufferIndex:D,_index:N,line:K,column:z,offset:$}}function m(D){i[D.line]=D.column,E()}function g(){let D;for(;n._index<o.length;){const N=o[n._index];if(typeof N=="string")for(D=n._index,n._bufferIndex<0&&(n._bufferIndex=0);n._index===D&&n._bufferIndex<N.length;)y(N.charCodeAt(n._bufferIndex));else y(N)}}function y(D){h=h(D)}function b(D){Qe(D)?(n.line++,n.column=1,n.offset+=D===-3?2:1,E()):D!==-1&&(n.column++,n.offset++),n._bufferIndex<0?n._index++:(n._bufferIndex++,n._bufferIndex===o[n._index].length&&(n._bufferIndex=-1,n._index++)),c.previous=D}function x(D,N){const K=N||{};return K.type=D,K.start=p(),c.events.push(["enter",K,c]),a.push(K),K}function S(D){const N=a.pop();return N.end=p(),c.events.push(["exit",N,c]),N}function k(D,N){L(D,N.from)}function w(D,N){N.restore()}function _(D,N){return K;function K(z,$,H){let j,q,ne,O;return Array.isArray(z)?Te(z):"tokenize"in z?Te([z]):fe(z);function fe(Oe){return Ze;function Ze(vt){const Ct=vt!==null&&Oe[vt],wt=vt!==null&&Oe.null,zt=[...Array.isArray(Ct)?Ct:Ct?[Ct]:[],...Array.isArray(wt)?wt:wt?[wt]:[]];return Te(zt)(vt)}}function Te(Oe){return j=Oe,q=0,Oe.length===0?H:I(Oe[q])}function I(Oe){return Ze;function Ze(vt){return O=B(),ne=Oe,Oe.partial||(c.currentConstruct=Oe),Oe.name&&c.parser.constructs.disable.null.includes(Oe.name)?qe():Oe.tokenize.call(N?Object.assign(Object.create(c),N):c,l,tt,qe)(vt)}}function tt(Oe){return D(ne,O),$}function qe(Oe){return O.restore(),++q<j.length?I(j[q]):H}}}function L(D,N){D.resolveAll&&!s.includes(D)&&s.push(D),D.resolve&&ns(c.events,N,c.events.length-N,D.resolve(c.events.slice(N),c)),D.resolveTo&&(c.events=D.resolveTo(c.events,c))}function B(){const D=p(),N=c.previous,K=c.currentConstruct,z=c.events.length,$=Array.from(a);return{from:z,restore:H};function H(){n=D,c.previous=N,c.currentConstruct=K,c.events.length=z,a=$,E()}}function E(){n.line in i&&n.column<2&&(n.column=i[n.line],n.offset+=i[n.line]-1)}}function hhe(t,e){const r=e.start._index,n=e.start._bufferIndex,i=e.end._index,s=e.end._bufferIndex;let o;if(r===i)o=[t[r].slice(n,s)];else{if(o=t.slice(r,i),n>-1){const a=o[0];typeof a=="string"?o[0]=a.slice(n):o.shift()}s>0&&o.push(t[i].slice(0,s))}return o}function uhe(t,e){let r=-1;const n=[];let i;for(;++r<t.length;){const s=t[r];let o;if(typeof s=="string")o=s;else switch(s){case-5:{o="\r";break}case-4:{o=`
52`;break}case-3:{o=`\r
53`;break}case-2:{o=e?" ":"	";break}case-1:{if(!e&&i)continue;o=" ";break}default:o=String.fromCharCode(s)}i=s===-2,n.push(o)}return n.join("")}function dhe(t){const n={constructs:hF([lhe,...(t||{}).extensions||[]]),content:i(Mle),defined:[],document:i(Ele),flow:i(Gce),lazy:{},string:i(Xce),text:i(Jce)};return n;function i(s){return o;function o(a){return che(n,s,a)}}}function fhe(t){for(;!mF(t););return t}const xE=/[\0\t\n\r]/g;function phe(){let t=1,e="",r=!0,n;return i;function i(s,o,a){const l=[];let c,h,u,d,f;for(s=e+(typeof s=="string"?s.toString():new TextDecoder(o||void 0).decode(s)),u=0,e="",r&&(s.charCodeAt(0)===65279&&u++,r=void 0);u<s.length;){if(xE.lastIndex=u,c=xE.exec(s),d=c&&c.index!==void 0?c.index:s.length,f=s.charCodeAt(d),!c){e=s.slice(u);break}if(f===10&&u===d&&n)l.push(-3),n=void 0;else switch(n&&(l.push(-5),n=void 0),u<d&&(l.push(s.slice(u,d)),t+=d-u),f){case 0:{l.push(65533),t++;break}case 9:{for(h=Math.ceil(t/4)*4,l.push(-2);t++<h;)l.push(-1);break}case 10:{l.push(-4),t=1;break}default:n=!0,t=1}u=d+1}return a&&(n&&l.push(-5),e&&l.push(e),l.push(null)),l}}
vendor: 9,157 bytes, line 53
53const mhe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function wF(t){return t.replace(mhe,ghe)}function ghe(t,e,r){if(e)return e;if(r.charCodeAt(0)===35){const i=r.charCodeAt(1),s=i===120||i===88;return uF(r.slice(s?2:1),s?16:10)}return d7(r)||t}function am(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?vE(t.position):"start"in t||"end"in t?vE(t):"line"in t||"column"in t?uC(t):""}function uC(t){return wE(t&&t.line)+":"+wE(t&&t.column)}function vE(t){return uC(t&&t.start)+"-"+uC(t&&t.end)}function wE(t){return t&&typeof t=="number"?t:1}const kF={}.hasOwnProperty;function yhe(t,e,r){return typeof e!="string"&&(r=e,e=void 0),bhe(r)(fhe(dhe(r).document().write(phe()(t,e,!0))))}function bhe(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(ke),autolinkProtocol:B,autolinkEmail:B,atxHeading:s(ee),blockQuote:s(wt),characterEscape:B,characterReference:B,codeFenced:s(zt),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:s(zt,o),codeText:s(gr,o),codeTextData:B,data:B,codeFlowValue:B,definition:s(R),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:s(W),hardBreakEscape:s(pe),hardBreakTrailing:s(pe),htmlFlow:s(le,o),htmlFlowData:B,htmlText:s(le,o),htmlTextData:B,image:s(he),label:o,link:s(ke),listItem:s(ve),listItemValue:d,listOrdered:s(Ce,u),listUnordered:s(Ce),paragraph:s(ge),reference:I,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:s(ee),strong:s(Ye),thematicBreak:s(Fe)},exit:{atxHeading:l(),atxHeadingSequence:k,autolink:l(),autolinkEmail:Ct,autolinkProtocol:vt,blockQuote:l(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:qe,characterReferenceMarkerNumeric:qe,characterReferenceValue:Oe,characterReference:Ze,codeFenced:l(g),codeFencedFence:m,codeFencedFenceInfo:f,codeFencedFenceMeta:p,codeFlowValue:E,codeIndented:l(y),codeText:l($),codeTextData:E,data:E,definition:l(),definitionDestinationString:S,definitionLabelString:b,definitionTitleString:x,emphasis:l(),hardBreakEscape:l(N),hardBreakTrailing:l(N),htmlFlow:l(K),htmlFlowData:E,htmlText:l(z),htmlTextData:E,image:l(j),label:ne,labelText:q,lineEnding:D,link:l(H),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:tt,resourceDestinationString:O,resourceTitleString:fe,resource:Te,setextHeading:l(L),setextHeadingLineSequence:_,setextHeadingText:w,strong:l(),thematicBreak:l()}};CF(e,(t||{}).mdastExtensions||[]);const r={};return n;function n(Y){let oe={type:"root",children:[]};const Le={stack:[oe],tokenStack:[],config:e,enter:a,exit:c,buffer:o,resume:h,data:r},Be=[];let ft=-1;for(;++ft<Y.length;)if(Y[ft][1].type==="listOrdered"||Y[ft][1].type==="listUnordered")if(Y[ft][0]==="enter")Be.push(ft);else{const Pt=Be.pop();ft=i(Y,Pt,ft)}for(ft=-1;++ft<Y.length;){const Pt=e[Y[ft][0]];kF.call(Pt,Y[ft][1].type)&&Pt[Y[ft][1].type].call(Object.assign({sliceSerialize:Y[ft][2].sliceSerialize},Le),Y[ft][1])}if(Le.tokenStack.length>0){const Pt=Le.tokenStack[Le.tokenStack.length-1];(Pt[1]||kE).call(Le,void 0,Pt[0])}for(oe.position={start:_l(Y.length>0?Y[0][1].start:{line:1,column:1,offset:0}),end:_l(Y.length>0?Y[Y.length-2][1].end:{line:1,column:1,offset:0})},ft=-1;++ft<e.transforms.length;)oe=e.transforms[ft](oe)||oe;return oe}function i(Y,oe,Le){let Be=oe-1,ft=-1,Pt=!1,rr,Ut,wr,sn;for(;++Be<=Le;){const Nt=Y[Be];switch(Nt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Nt[0]==="enter"?ft++:ft--,sn=void 0;break}case"lineEndingBlank":{Nt[0]==="enter"&&(rr&&!sn&&!ft&&!wr&&(wr=Be),sn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:sn=void 0}if(!ft&&Nt[0]==="enter"&&Nt[1].type==="listItemPrefix"||ft===-1&&Nt[0]==="exit"&&(Nt[1].type==="listUnordered"||Nt[1].type==="listOrdered")){if(rr){let kr=Be;for(Ut=void 0;kr--;){const pn=Y[kr];if(pn[1].type==="lineEnding"||pn[1].type==="lineEndingBlank"){if(pn[0]==="exit")continue;Ut&&(Y[Ut][1].type="lineEndingBlank",Pt=!0),pn[1].type="lineEnding",Ut=kr}else if(!(pn[1].type==="linePrefix"||pn[1].type==="blockQuotePrefix"||pn[1].type==="blockQuotePrefixWhitespace"||pn[1].type==="blockQuoteMarker"||pn[1].type==="listItemIndent"))break}wr&&(!Ut||wr<Ut)&&(rr._spread=!0),rr.end=Object.assign({},Ut?Y[Ut][1].start:Nt[1].end),Y.splice(Ut||Be,0,["exit",rr,Nt[2]]),Be++,Le++}if(Nt[1].type==="listItemPrefix"){const kr={type:"listItem",_spread:!1,start:Object.assign({},Nt[1].start),end:void 0};rr=kr,Y.splice(Be,0,["enter",kr,Nt[2]]),Be++,Le++,wr=void 0,sn=!0}}}return Y[oe][1]._spread=Pt,Le}function s(Y,oe){return Le;function Le(Be){a.call(this,Y(Be),Be),oe&&oe.call(this,Be)}}function o(){this.stack.push({type:"fragment",children:[]})}function a(Y,oe,Le){this.stack[this.stack.length-1].children.push(Y),this.stack.push(Y),this.tokenStack.push([oe,Le||void 0]),Y.position={start:_l(oe.start),end:void 0}}function l(Y){return oe;function oe(Le){Y&&Y.call(this,Le),c.call(this,Le)}}function c(Y,oe){const Le=this.stack.pop(),Be=this.tokenStack.pop();if(Be)Be[0].type!==Y.type&&(oe?oe.call(this,Y,Be[0]):(Be[1]||kE).call(this,Y,Be[0]));else throw new Error("Cannot close `"+Y.type+"` ("+am({start:Y.start,end:Y.end})+"): it’s not open");Le.position.end=_l(Y.end)}function h(){return u7(this.stack.pop())}function u(){this.data.expectingFirstListItemValue=!0}function d(Y){if(this.data.expectingFirstListItemValue){const oe=this.stack[this.stack.length-2];oe.start=Number.parseInt(this.sliceSerialize(Y),10),this.data.expectingFirstListItemValue=void 0}}function f(){const Y=this.resume(),oe=this.stack[this.stack.length-1];oe.lang=Y}function p(){const Y=this.resume(),oe=this.stack[this.stack.length-1];oe.meta=Y}function m(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){const Y=this.resume(),oe=this.stack[this.stack.length-1];oe.value=Y.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const Y=this.resume(),oe=this.stack[this.stack.length-1];oe.value=Y.replace(/(\r?\n|\r)$/g,"")}function b(Y){const oe=this.resume(),Le=this.stack[this.stack.length-1];Le.label=oe,Le.identifier=Qs(this.sliceSerialize(Y)).toLowerCase()}function x(){const Y=this.resume(),oe=this.stack[this.stack.length-1];oe.title=Y}function S(){const Y=this.resume(),oe=this.stack[this.stack.length-1];oe.url=Y}function k(Y){const oe=this.stack[this.stack.length-1];if(!oe.depth){const Le=this.sliceSerialize(Y).length;oe.depth=Le}}function w(){this.data.setextHeadingSlurpLineEnding=!0}function _(Y){const oe=this.stack[this.stack.length-1];oe.depth=this.sliceSerialize(Y).codePointAt(0)===61?1:2}function L(){this.data.setextHeadingSlurpLineEnding=void 0}function B(Y){const Le=this.stack[this.stack.length-1].children;let Be=Le[Le.length-1];(!Be||Be.type!=="text")&&(Be=_e(),Be.position={start:_l(Y.start),end:void 0},Le.push(Be)),this.stack.push(Be)}function E(Y){const oe=this.stack.pop();oe.value+=this.sliceSerialize(Y),oe.position.end=_l(Y.end)}function D(Y){const oe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Le=oe.children[oe.children.length-1];Le.position.end=_l(Y.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(oe.type)&&(B.call(this,Y),E.call(this,Y))}function N(){this.data.atHardBreak=!0}function K(){const Y=this.resume(),oe=this.stack[this.stack.length-1];oe.value=Y}function z(){const Y=this.resume(),oe=this.stack[this.stack.length-1];oe.value=Y}function $(){const Y=this.resume(),oe=this.stack[this.stack.length-1];oe.value=Y}function H(){const Y=this.stack[this.stack.length-1];if(this.data.inReference){const oe=this.data.referenceType||"shortcut";Y.type+="Reference",Y.referenceType=oe,delete Y.url,delete Y.title}else delete Y.identifier,delete Y.label;this.data.referenceType=void 0}function j(){const Y=this.stack[this.stack.length-1];if(this.data.inReference){const oe=this.data.referenceType||"shortcut";Y.type+="Reference",Y.referenceType=oe,delete Y.url,delete Y.title}else delete Y.identifier,delete Y.label;this.data.referenceType=void 0}function q(Y){const oe=this.sliceSerialize(Y),Le=this.stack[this.stack.length-2];Le.label=wF(oe),Le.identifier=Qs(oe).toLowerCase()}function ne(){const Y=this.stack[this.stack.length-1],oe=this.resume(),Le=this.stack[this.stack.length-1];if(this.data.inReference=!0,Le.type==="link"){const Be=Y.children;Le.children=Be}else Le.alt=oe}function O(){const Y=this.resume(),oe=this.stack[this.stack.length-1];oe.url=Y}function fe(){const Y=this.resume(),oe=this.stack[this.stack.length-1];oe.title=Y}function Te(){this.data.inReference=void 0}function I(){this.data.referenceType="collapsed"}function tt(Y){const oe=this.resume(),Le=this.stack[this.stack.length-1];Le.label=oe,Le.identifier=Qs(this.sliceSerialize(Y)).toLowerCase(),this.data.referenceType="full"}function qe(Y){this.data.characterReferenceType=Y.type}function Oe(Y){const oe=this.sliceSerialize(Y),Le=this.data.characterReferenceType;let Be;Le?(Be=uF(oe,Le==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Be=d7(oe);
53const ft=this.stack[this.stack.length-1];ft.value+=Be}function Ze(Y){const oe=this.stack.pop();oe.position.end=_l(Y.end)}function vt(Y){E.call(this,Y);const oe=this.stack[this.stack.length-1];oe.url=this.sliceSerialize(Y)}function Ct(Y){E.call(this,Y);const oe=this.stack[this.stack.length-1];oe.url="mailto:"+this.sliceSerialize(Y)}function wt(){return{type:"blockquote",children:[]}}function zt(){return{type:"code",lang:null,meta:null,value:""}}function gr(){return{type:"inlineCode",value:""}}function R(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function W(){return{type:"emphasis",children:[]}}function ee(){return{type:"heading",depth:0,children:[]}}function pe(){return{type:"break"}}function le(){return{type:"html",value:""}}function he(){return{type:"image",title:null,url:"",alt:null}}function ke(){return{type:"link",title:null,url:"",children:[]}}function Ce(Y){return{type:"list",ordered:Y.type==="listOrdered",start:null,spread:Y._spread,children:[]}}function ve(Y){return{type:"listItem",spread:Y._spread,checked:null,children:[]}}function ge(){return{type:"paragraph",children:[]}}function Ye(){return{type:"strong",children:[]}}function _e(){return{type:"text",value:""}}function Fe(){return{type:"thematicBreak"}}}function _l(t){return{line:t.line,column:t.column,offset:t.offset}}function CF(t,e){let r=-1;for(;++r<e.length;){const n=e[r];Array.isArray(n)?CF(t,n):xhe(t,n)}}function xhe(t,e){let r;for(r in e)if(kF.call(e,r))switch(r){case"canContainEols":{const n=e[r];n&&t[r].push(...n);break}case"transforms":{const n=e[r];n&&t[r].push(...n);break}case"enter":case"exit":{const n=e[r];n&&Object.assign(t[r],n);break}}}function kE(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+am({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+am({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+am({start:e.start,end:e.end})+") is still open")}function dC(t){const e=this;e.parser=r;function r(n){return yhe(n,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}const CE={}.hasOwnProperty;function vhe(t,e){const r=e||{};function n(i,...s){let o=n.invalid;const a=n.handlers;if(i&&CE.call(i,t)){const l=String(i[t]);o=CE.call(a,l)?a[l]:n.unknown}if(o)return o.call(this,i,...s)}return n.handlers=r.handlers||{},n.invalid=r.invalid,n.unknown=r.unknown,n}const whe={}.hasOwnProperty;function SF(t,e){let r=-1,n;if(e.extensions)for(;++r<e.extensions.length;)SF(t,e.extensions[r]);for(n in e)if(whe.call(e,n))switch(n){case"extensions":break;case"unsafe":{SE(t[n],e[n]);break}case"join":{SE(t[n],e[n]);break}case"handlers":{khe(t[n],e[n]);break}default:t.options[n]=e[n]}return t}function SE(t,e){e&&t.push(...e)}function khe(t,e){e&&Object.assign(t,e)}function Che(t,e,r,n){const i=r.enter("blockquote"),s=r.createTracker(n);s.move("> "),s.shift(2);const o=r.indentLines(r.containerFlow(t,s.current()),She);return i(),o}function She(t,e,r){return">"+(r?"":" ")+t}function TF(t,e){return TE(t,e.inConstruct,!0)&&!TE(t,e.notInConstruct,!1)}function TE(t,e,r){if(typeof e=="string"&&(e=[e]),!e||e.length===0)return r;let n=-1;for(;++n<e.length;)if(t.includes(e[n]))return!0;return!1}function _E(t,e,r,n){let i=-1;for(;++i<r.unsafe.length;)if(r.unsafe[i].character===`
54`&&TF(r.stack,r.unsafe[i]))return/[ \t]/.test(n.before)?"":" ";return`\\
55`}function _F(t,e){const r=String(t);let n=r.indexOf(e),i=n,s=0,o=0;if(typeof e!="string")throw new TypeError("Expected substring");for(;n!==-1;)n===i?++s>o&&(o=s):s=1,i=n+e.length,n=r.indexOf(e,i);return o}function fC(t,e){return!!(e.options.fences===!1&&t.value&&!t.lang&&/[^ \r\n]/.test(t.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(t.value))}function The(t){const e=t.options.fence||"`";if(e!=="`"&&e!=="~")throw new Error("Cannot serialize code with `"+e+"` for `options.fence`, expected `` ` `` or `~`");return e}function _he(t,e,r,n){const i=The(r),s=t.value||"",o=i==="`"?"GraveAccent":"Tilde";if(fC(t,r)){const u=r.enter("codeIndented"),d=r.indentLines(s,Mhe);return u(),d}const a=r.createTracker(n),l=i.repeat(Math.max(_F(s,i)+1,3)),c=r.enter("co
vendor: 6,574 bytes, lines 55-64
55deFenced");let h=a.move(l);if(t.lang){const u=r.enter(`codeFencedLang${o}`);h+=a.move(r.safe(t.lang,{before:h,after:" ",encode:["`"],...a.current()})),u()}if(t.lang&&t.meta){const u=r.enter(`codeFencedMeta${o}`);h+=a.move(" "),h+=a.move(r.safe(t.meta,{before:h,after:`
56`,encode:["`"],...a.current()})),u()}return h+=a.move(`
57`),s&&(h+=a.move(s+`
58`)),h+=a.move(l),c(),h}function Mhe(t,e,r){return(r?"":"    ")+t}function p7(t){const e=t.options.quote||'"';if(e!=='"'&&e!=="'")throw new Error("Cannot serialize title with `"+e+"` for `options.quote`, expected `\"`, or `'`");return e}function Ahe(t,e,r,n){const i=p7(r),s=i==='"'?"Quote":"Apostrophe",o=r.enter("definition");let a=r.enter("label");const l=r.createTracker(n);let c=l.move("[");return c+=l.move(r.safe(r.associationId(t),{before:c,after:"]",...l.current()})),c+=l.move("]: "),a(),!t.url||/[\0- \u007F]/.test(t.url)?(a=r.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(r.safe(t.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=r.enter("destinationRaw"),c+=l.move(r.safe(t.url,{before:c,after:t.title?" ":`
59`,...l.current()}))),a(),t.title&&(a=r.enter(`title${s}`),c+=l.move(" "+i),c+=l.move(r.safe(t.title,{before:c,after:i,...l.current()})),c+=l.move(i),a()),o(),c}function Ehe(t){const e=t.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}function gc(t){return"&#x"+t.toString(16).toUpperCase()+";"}function lx(t,e,r){const n=Cf(t),i=Cf(e);return n===void 0?i===void 0?r==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:n===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}MF.peek=Ohe;function MF(t,e,r,n){const i=Ehe(r),s=r.enter("emphasis"),o=r.createTracker(n),a=o.move(i);let l=o.move(r.containerPhrasing(t,{after:i,before:a,...o.current()}));const c=l.charCodeAt(0),h=lx(n.before.charCodeAt(n.before.length-1),c,i);h.inside&&(l=gc(c)+l.slice(1));const u=l.charCodeAt(l.length-1),d=lx(n.after.charCodeAt(0),u,i);d.inside&&(l=l.slice(0,-1)+gc(u));const f=o.move(i);return s(),r.attentionEncodeSurroundingInfo={after:d.outside,before:h.outside},a+l+f}function Ohe(t,e,r){return r.options.emphasis||"*"}const nw=function(t){if(t==null)return Bhe;if(typeof t=="function")return iw(t);if(typeof t=="object")return Array.isArray(t)?Lhe(t):Dhe(t);if(typeof t=="string")return Ihe(t);throw new Error("Expected function, string, or object as test")};function Lhe(t){const e=[];let r=-1;for(;++r<t.length;)e[r]=nw(t[r]);return iw(n);function n(...i){let s=-1;for(;++s<e.length;)if(e[s].apply(this,i))return!0;return!1}}function Dhe(t){const e=t;return iw(r);function r(n){const i=n;let s;for(s in t)if(i[s]!==e[s])return!1;return!0}}function Ihe(t){return iw(e);function e(r){return r&&r.type===t}}function iw(t){return e;function e(r,n,i){return!!(Rhe(r)&&t.call(this,r,typeof n=="number"?n:void 0,i||void 0))}}function Bhe(){return!0}function Rhe(t){return t!==null&&typeof t=="object"&&"type"in t}const AF=[],Phe=!0,pC=!1,mC="skip";function m7(t,e,r,n){let i;typeof e=="function"&&typeof r!="function"?(n=r,r=e):i=e;const s=nw(i),o=n?-1:1;a(t,void 0,[])();function a(l,c,h){const u=l&&typeof l=="object"?l:{};if(typeof u.type=="string"){const f=typeof u.tagName=="string"?u.tagName:typeof u.name=="string"?u.name:void 0;Object.defineProperty(d,"name",{value:"node ("+(l.type+(f?"<"+f+">":""))+")"})}return d;function d(){let f=AF,p,m,g;if((!e||s(l,c,h[h.length-1]||void 0))&&(f=Nhe(r(l,h)),f[0]===pC))return f;if("children"in l&&l.children){const y=l;if(y.children&&f[0]!==mC)for(m=(n?y.children.length:-1)+o,g=h.concat(y);m>-1&&m<y.children.length;){const b=y.children[m];if(p=a(b,m,g)(),p[0]===pC)return p;m=typeof p[1]=="number"?p[1]:m+o}}return f}}}function Nhe(t){return Array.isArray(t)?t:typeof t=="number"?[Phe,t]:t==null?AF:[t]}function Dc(t,e,r,n){let i,s,o;typeof e=="function"&&typeof r!="function"?(s=void 0,o=e,i=r):(s=e,o=r,i=n),m7(t,s,a,i);function a(l,c){const h=c[c.length-1],u=h?h.children.indexOf(l):void 0;return o(l,u,h)}}function EF(t,e){let r=!1;return Dc(t,function(n){if("value"in n&&/\r?\n|\r/.test(n.value)||n.type==="break")return r=!0,pC}),!!((!t.depth||t.depth<3)&&u7(t)&&(e.options.setext||r))}function Fhe(t,e,r,n){const i=Math.max(Math.min(6,t.depth||1),1),s=r.createTracker(n);if(EF(t,r)){const h=r.enter("headingSetext"),u=r.enter("phrasing"),d=r.containerPhrasing(t,{...s.current(),before:`
60`,after:`
61`});return u(),h(),d+`
62`+(i===1?"=":"-").repeat(d.length-(Math.max(d.lastIndexOf("\r"),d.lastIndexOf(`
63`))+1))}const o="#".repeat(i),a=r.enter("headingAtx"),l=r.enter("phrasing");s.move(o+" ");let c=r.containerPhrasing(t,{before:"# ",after:`
64`,...s.current()});return/^[\t ]/.test(c)&&(c=gc(c.charCodeAt(0))+c.slice(1)),c=c?o+" "+c:o,r.options.closeAtx&&(c+=" "+o),l(),a(),c}OF.peek=$he;function OF(t){return t.value||""}function $he(){return"<"}LF.peek=zhe;function LF(t,e,r,n){const i=p7(r),s=i==='"'?"Quote":"Apostrophe",o=r.enter("image");let a=r.enter("label");const l=r.createTracker(n);let c=l.move("![");return c+=l.move(r.safe(t.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),a(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(a=r.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(r.safe(t.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=r.enter("destinationRaw"),c+=l.move(r.safe(t.url,{before:c,after:t.title?" ":")",...l.current()}))),a(),t.title&&(a=r.enter(`title${s}`),c+=l.move(" "+i),c+=l.move(r.safe(t.title,{before:c,after:i,...l.current()})),c+=l.move(i),a()),c+=l.move(")"),o(),c}function zhe(){return"!"}DF.peek=Hhe;function DF(t,e,r,n){const i=t.referenceType,s=r.enter("imageReference");let o=r.enter("label");const a=r.createTracker(n);let l=a.move("![");const c=r.safe(t.alt,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),o();const h=r.stack;r.stack=[],o=r.enter("reference");const u=r.safe(r.associationId(t),{before:l,after:"]",...a.current()});return o(),r.stack=h,s(),i==="full"||!c||c!==u?l+=a.move(u+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function Hhe(){return"!"}IF.peek=qhe;function IF(t,e,r){let n=t.value||"",i="`",s=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(n);)i+="`";for(/[^ \r\n]/.test(n)&&(/^[ \r\n]/.test(n)&&/[ \r\n]$/.test(n)||/^`|`$/.test(n))&&(n=" "+n+" ");++s<r.unsafe.length;){const o=r.unsafe[s],a=r.compilePattern(o);let l;if(o.atBreak)for(;l=a.exec(n);){let c=l.index;
vendor: 5,484 bytes, line 64
64n.charCodeAt(c)===10&&n.charCodeAt(c-1)===13&&c--,n=n.slice(0,c)+" "+n.slice(l.index+1)}}return i+n+i}function qhe(){return"`"}function BF(t,e){const r=u7(t);return!!(!e.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(r===t.url||"mailto:"+r===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}RF.peek=Vhe;function RF(t,e,r,n){const i=p7(r),s=i==='"'?"Quote":"Apostrophe",o=r.createTracker(n);let a,l;if(BF(t,r)){const h=r.stack;r.stack=[],a=r.enter("autolink");let u=o.move("<");return u+=o.move(r.containerPhrasing(t,{before:u,after:">",...o.current()})),u+=o.move(">"),a(),r.stack=h,u}a=r.enter("link"),l=r.enter("label");let c=o.move("[");return c+=o.move(r.containerPhrasing(t,{before:c,after:"](",...o.current()})),c+=o.move("]("),l(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(l=r.enter("destinationLiteral"),c+=o.move("<"),c+=o.move(r.safe(t.url,{before:c,after:">",...o.current()})),c+=o.move(">")):(l=r.enter("destinationRaw"),c+=o.move(r.safe(t.url,{before:c,after:t.title?" ":")",...o.current()}))),l(),t.title&&(l=r.enter(`title${s}`),c+=o.move(" "+i),c+=o.move(r.safe(t.title,{before:c,after:i,...o.current()})),c+=o.move(i),l()),c+=o.move(")"),a(),c}function Vhe(t,e,r){return BF(t,r)?"<":"["}PF.peek=Whe;function PF(t,e,r,n){const i=t.referenceType,s=r.enter("linkReference");let o=r.enter("label");const a=r.createTracker(n);let l=a.move("[");const c=r.containerPhrasing(t,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),o();const h=r.stack;r.stack=[],o=r.enter("reference");const u=r.safe(r.associationId(t),{before:l,after:"]",...a.current()});return o(),r.stack=h,s(),i==="full"||!c||c!==u?l+=a.move(u+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function Whe(){return"["}function g7(t){const e=t.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function jhe(t){const e=g7(t),r=t.options.bulletOther;if(!r)return e==="*"?"-":"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(r===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+r+"`) to be different");return r}function Uhe(t){const e=t.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function NF(t){const e=t.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function Ghe(t,e,r,n){const i=r.enter("list"),s=r.bulletCurrent;let o=t.ordered?Uhe(r):g7(r);const a=t.ordered?o==="."?")":".":jhe(r);let l=e&&r.bulletLastUsed?o===r.bulletLastUsed:!1;if(!t.ordered){const h=t.children?t.children[0]:void 0;if((o==="*"||o==="-")&&h&&(!h.children||!h.children[0])&&r.stack[r.stack.length-1]==="list"&&r.stack[r.stack.length-2]==="listItem"&&r.stack[r.stack.length-3]==="list"&&r.stack[r.stack.length-4]==="listItem"&&r.indexStack[r.indexStack.length-1]===0&&r.indexStack[r.indexStack.length-2]===0&&r.indexStack[r.indexStack.length-3]===0&&(l=!0),NF(r)===o&&h){let u=-1;for(;++u<t.children.length;){const d=t.children[u];if(d&&d.type==="listItem"&&d.children&&d.children[0]&&d.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(o=a),r.bulletCurrent=o;const c=r.containerFlow(t,n);return r.bulletLastUsed=o,r.bulletCurrent=s,i(),c}function Khe(t){const e=t.options.listItemIndent||"one";if(e!=="tab"&&e!=="one"&&e!=="mixed")throw new Error("Cannot serialize items with `"+e+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return e}function Yhe(t,e,r,n){const i=Khe(r);let s=r.bulletCurrent||g7(r);e&&e.type==="list"&&e.ordered&&(s=(typeof e.start=="number"&&e.start>-1?e.start:1)+(r.options.incrementListMarker===!1?0:e.children.indexOf(t))+s);let o=s.length+1;(i==="tab"||i==="mixed"&&(e&&e.type==="list"&&e.spread||t.spread))&&(o=Math.ceil(o/4)*4);const a=r.createTracker(n);a.move(s+" ".repeat(o-s.length)),a.shift(o);const l=r.enter("listItem"),c=r.indentLines(r.containerFlow(t,a.current()),h);return l(),c;function h(u,d,f){return d?(f?"":" ".repeat(o))+u:(f?s:s+" ".repeat(o-s.length))+u}}function Xhe(t,e,r,n){const i=r.enter("paragraph"),s=r.enter("phrasing"),o=r.containerPhrasing(t,n);return s(),i(),o}const Jhe=nw(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Zhe(t,e,r,n){return(t.children.some(function(o){return Jhe(o)})?r.containerPhrasing:r.containerFlow).call(r,t,n)}function Qhe(t){const e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}FF.peek=eue;function FF(t,e,r,n){const i=Qhe(r),s=r.enter("strong"),o=r.createTracker(n),a=o.move(i+i);let l=o.move(r.containerPhrasing(t,{after:i,before:a,...o.current()}));const c=l.charCodeAt(0),h=lx(n.before.charCodeAt(n.before.length-1),c,i);h.inside&&(l=gc(c)+l.slice(1));const u=l.charCodeAt(l.length-1),d=lx(n.after.charCodeAt(0),u,i);d.inside&&(l=l.slice(0,-1)+gc(u));const f=o.move(i+i);return s(),r.attentionEncodeSurroundingInfo={after:d.outside,before:h.outside},a+l+f}function eue(t,e,r){return r.options.strong||"*"}
64function tue(t,e,r,n){return r.safe(t.value,n)}function rue(t){const e=t.options.ruleRepetition||3;if(e<3)throw new Error("Cannot serialize rules with repetition `"+e+"` for `options.ruleRepetition`, expected `3` or more");return e}function nue(t,e,r){const n=(NF(r)+(r.options.ruleSpaces?" ":"")).repeat(rue(r));return r.options.ruleSpaces?n.slice(0,-1):n}const y7={blockquote:Che,break:_E,code:_he,definition:Ahe,emphasis:MF,hardBreak:_E,heading:Fhe,html:OF,image:LF,imageReference:DF,inlineCode:IF,link:RF,linkReference:PF,list:Ghe,listItem:Yhe,paragraph:Xhe,root:Zhe,strong:FF,text:tue,thematicBreak:nue},iue=[sue];function sue(t,e,r,n){if(e.type==="code"&&fC(e,n)&&(t.type==="list"||t.type===e.type&&fC(t,n)))return!1;if("spread"in r&&typeof r.spread=="boolean")return t.type==="paragraph"&&(t.type===e.type||e.type==="definition"||e.type==="heading"&&EF(e,n))?void 0:r.spread?1:0}const Vc=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],oue=[{character:"	",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"	",before:"[\\r\\n]",inConstruct:"phrasing"},{character:"	",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"\r",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:`
65`,inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"!",after:"\\[",inConstruct:"phrasing",notInConstruct:Vc},{character:'"',inConstruct:"titleQuote"},{atBreak:!0,character:"#"},{character:"#",inConstruct:"headingAtx",after:`(?:[\r
66]|$)`},{character:"&",after:"[#A-Za-z]",inConstruct:"phrasing"},{character:"'",inConstruct:"titleApostrophe"},{character:"(",inConstruct:"destinationRaw"},{before:"\\]",character:"(",inConstruct:"phrasing",notInConstruct:Vc},{atBreak:!0,before:"\\d+",character:")"},{character:")",inConstruct:"destinationRaw"},{atBreak:!0,character:"*",after:`(?:[ 	\r
67*])`},{character:"*",inConstruct:"phrasing",notInConstruct:Vc},{atBreak:!0,character:"+",after:`(?:[ 	\r
68])`},{atBreak:!0,character:"-",after:`(?:[ 	\r
69-])`},{atBreak:!0,before:"\\d+",character:".",after:`(?:[ 	\r
70]|$)`},{atBreak:!0,character:"<",after:"[!/?A-Za-z]"},{character:"<",after:"[!/?A-Za-z]",inConstruct:"phrasing",notInConstruct:Vc},{character:"<",inConstruct:"destinationLiteral"},{atBreak:!0,character:"="},{atBreak:!0,character:">"},{character:">",inConstruct:"destinationLiteral"},{atBreak:!0,character:"["},{character:"[",inConstruct:"phrasing",notInConstruct:Vc},{character:"[",inConstruct:["label","reference"]},{character:"\\",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"]",inConstruct:["label","reference"]},{atBreak:!0,character:"_"},{character:"_",inConstruct:"phrasing",notInConstruct:Vc},{atBreak:!0,character:"`"},{character:"`",inConstruct:["codeFencedLangGraveAccent","codeFencedMetaGraveAccent"]},{character:"`",inConstruct:"phrasing",notInConstruct:Vc},{atBreak:!0,character:"~"}];function aue(t){return t.label||!t.identifier?t.label||"":wF(t.identifier)}function lue(t){if(!t._compiled){const e=(t.atBreak?"[\\r\\n][\\t ]*":"")+(t.before?"(?:"+t.before+")":"");t._compiled=new RegExp((e?"("+e+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(t.character)?"\\":"")+t.character+(t.after?"(?:"+t.after+")":""),"g")}return t._compiled}function cue(t,e,r){const n=e.indexStack,i=t.children||[],s=[];let o=-1,a=r.before,l;n.push(-1);let c=e.createTracker(r);for(;++o<i.length;){const h=i[o];let u;if(n[n.length-1]=o,o+1<i.length){let p=e.handle.handlers[i[o+1].type];p&&p.peek&&(p=p.peek),u=p?p(i[o+1],t,e,{before:"",after:"",...c.current()}).charAt(0):""}else u=r.after;s.length>0&&(a==="\r"||a===`
71`)&&h.type==="html"&&(s[s.length-1]=s[s.length-1].replace(/(\r?\n|\r)$/," "),a=" ",c=e.createTracker(r),c.move(s.join("")));let d=e.handle(h,t,e,{...c.current(),after:u,before:a});l&&l===d.slice(0,1)&&(d=gc(l.charCodeAt(0))+d.slice(1));const f=e.attentionEncodeSurroundingInfo;e.attentionEncodeSurroundingInfo=void 0,l=void 0,f&&(s.length>0&&f.before&&a===s[s.length-1].slice(-1)&&(s[s.length-1]=s[s.length-1].slice(0,-1)+gc(a.charCo
71deAt(0))),f.after&&(l=u)),c.move(d),s.push(d),a=d.slice(-1)}return n.pop(),s.join("")}function hue(t,e,r){const n=e.indexStack,i=t.children||[],s=e.createTracker(r),o=[];let a=-1;for(n.push(-1);++a<i.length;){const l=i[a];n[n.length-1]=a,o.push(s.move(e.handle(l,t,e,{before:`
72`,after:`
73`,...s.current()}))),l.type!=="list"&&(e.bulletLastUsed=void 0),a<i.length-1&&o.push(s.move(uue(l,i[a+1],t,e)))}return n.pop(),o.join("")}function uue(t,e,r,n){let i=n.join.length;for(;i--;){const s=n.join[i](t,e,r,n);if(s===!0||s===1)break;if(typeof s=="number")return`
74`.repeat(1+s);if(s===!1)return`
75
76<!---->
77
78`}return`
79
80`}const due=/\r?\n|\r/g;function fue(t,e){const r=[];let n=0,i=0,s;for(;s=due.exec(t);)o(t.slice(n,s.index)),r.push(s[0]),n=s.index+s[0].length,i++;return o(t.slice(n)),r.join("");function o(a){r.push(e(a,i,!a))}}function pue(t,e,r){const n=(r.before||"")+(e||"")+(r.after||""),i=[],s=[],o={};let a=-1;for(;++a<t.unsafe.length;){const h=t.unsafe[a];if(!TF(t.stack,h))continue;const u=t.compilePattern(h);let d;for(;d=u.exec(n);){const f="before"in h||!!h.atBreak,p="after"in h,m=d.index+(f?d[1].length:0);i.includes(m)?(o[m].before&&!f&&(o[m].before=!1),o[m].after&&!p&&(o[m].after=!1)):(i.push(m),o[m]={before:f,after:p})}}i.sort(mue);let l=r.before?r.before.length:0;const c=n.length-(r.after?r.after.length:0);for(a=-1;++a<i.length;){const h=i[a];h<l||h>=c||h+1<c&&i[a+1]===h+1&&o[h].after&&!o[h+1].before&&!o[h+1].after||i[a-1]===h-1&&o[h].before&&!o[h-1].before&&!o[h-1].after||(l!==h&&s.push(ME(n.slice(l,h),"\\")),l=h,/[!-/:-@[-`{-~]/.test(n.charAt(h))&&(!r.encode||!r.encode.includes(n.charAt(h)))?s.push("\\"):(s.push(gc(n.charCodeAt(h))),l++))}return s.push(ME(n.slice(l,c),r.after)),s.join("")}function mue(t,e){return t-e}function ME(t,e){const r=/\\(?=[!-/:-@[-`{-~])/g,n=[],i=[],s=t+e;let o=-1,a=0,l;for(;l=r.exec(s);)n.push(l.index);for(;++o<n.length;)a!==n[o]&&i.push(t.slice(a,n[o])),i.push("\\"),a=n[o];return i.push(t.slice(a)),i.join("")}function gue(t){const e=t||{},r=e.now||{};let n=e.lineShift||0,i=r.line||1,s=r.column||1;return{move:l,current:o,shift:a};function o(){return{now:{line:i,column:s},lineShift:n}}function a(c){n+=c}function l(c){const h=c||"",u=h.split(/\r?\n|\r/g),d=u[u.length-1];return i+=u.length-1,s=u.length===1?s+d.length:1+d.length+n,h}}function yue(t,e){const r=e||{},n={associationId:aue,containerPhrasing:wue,containerFlow:kue,createTracker:gue,compilePattern:lue,enter:s,handlers:{...y7},handle:void 0,indentLines:fue,indexStack:[],join:[...iue],options:{},safe:Cue,stack:[],unsafe:[...oue]};SF(n,r),n.options.tightDefinitions&&n.join.push(vue),n.handle=vhe("type",{invalid:bue,unknown:xue,handlers:n.handlers});let i=n.handle(t,void 0,n,{before:`
81`,after:`
82`,now:{line:1,column:1},lineShift:0});return i&&i.charCodeAt(i.length-1)!==10&&i.charCodeAt(i.length-1)!==13&&(i+=`
83`),i;function s(o){return n.stack.push(o),a;function a(){n.stack.pop()}}}function bue(t){throw new Error("Cannot handle value `"+t+"`, expected node")}function xue(t){const e=t;throw new Error("Cannot handle unknown node `"+e.type+"`")}function vue(t,e){if(t.type==="definition"&&t.type===e.type)return 0}function wue(t,e){return cue(t,this,e)}function kue(t,e){return hue(t,this,e)}function Cue(t,e){return pue(this,t,e)}function gC(t){const e=this;e.compiler=r;function r(n){return yue(n,{...e.data("settings"),...t,extensions:e.data("toMarkdownExtensions")||[]})}}function AE(t){if(t)throw t}var Sue=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function $F(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var P2=Object.prototype.hasOwnProperty,zF=Object.prototype.toString,EE=Object.defineProperty,OE=Object.getOwnPropertyDescriptor,LE=function(e){return typeof Array.isArray=="function"?Array.isArray(e):zF.call(e)==="[object Array]"},DE=function(e){if(!e||zF.call(e)!=="[object Object]")return!1;var r=P2.call(e,"constructor"),n=e.constructor&&e.constructor.prototype&&P2.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!n)return!1;var i;for(i in e);return typeof i>"u"||P2.call(e,i)},IE=function(e,r){EE&&r.name==="__proto__"?EE(e,r.name,{enumerable:!0,configurable:!0,value:r.newValue,writable:!0}):e[r.name]=r.newValue},BE=function(e,r){if(r==="__proto__")if(P2.call(e,r)){if(OE)return OE(e,r).value}else return;return e[r]},Tue=function t(){var e,r,n,i,s,o,a=arguments[0],l=1,c=arguments.length,h=!1;for(typeof a=="boolean"&&(h=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});l<c;++l)if(e=arguments[l],e!=null)for(r in e)n=BE(a,r),i=BE(e,r),a!==i&&(h&&i&&(DE(i)||(s=LE(i)))?(s?(s=!1,o=n&&LE(n)?n:[]):o=n&&DE(n)?n:{},IE(a,{name:r,newValue:t(h,o,i)})):typeof i<"u"&&IE(a,{name:r,newValue:i}));return a};const m5=$F(Tue);function yC(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);
vendor: 5,843 bytes, line 83
83return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function _ue(){const t=[],e={run:r,use:n};return e;function r(...i){let s=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);a(null,...i);function a(l,...c){const h=t[++s];let u=-1;if(l){o(l);return}for(;++u<i.length;)(c[u]===null||c[u]===void 0)&&(c[u]=i[u]);i=c,h?Mue(h,a)(...c):o(null,...c)}}function n(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return t.push(i),e}}function Mue(t,e){let r;return n;function n(...o){const a=t.length>o.length;let l;a&&o.push(i);try{l=t.apply(this,o)}catch(c){const h=c;if(a&&r)throw h;return i(h)}a||(l&&l.then&&typeof l.then=="function"?l.then(s,i):l instanceof Error?i(l):s(l))}function i(o,...a){r||(r=!0,e(o,...a))}function s(o){i(null,o)}}class Ni extends Error{constructor(e,r,n){super(),typeof r=="string"&&(n=r,r=void 0);let i="",s={},o=!1;if(r&&("line"in r&&"column"in r?s={place:r}:"start"in r&&"end"in r?s={place:r}:"type"in r?s={ancestors:[r],place:r.position}:s={...r}),typeof e=="string"?i=e:!s.cause&&e&&(o=!0,i=e.message,s.cause=e),!s.ruleId&&!s.source&&typeof n=="string"){const l=n.indexOf(":");l===-1?s.ruleId=n:(s.source=n.slice(0,l),s.ruleId=n.slice(l+1))}if(!s.place&&s.ancestors&&s.ancestors){const l=s.ancestors[s.ancestors.length-1];l&&(s.place=l.position)}const a=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=am(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Ni.prototype.file="";Ni.prototype.name="";Ni.prototype.reason="";Ni.prototype.message="";Ni.prototype.stack="";Ni.prototype.column=void 0;Ni.prototype.line=void 0;Ni.prototype.ancestors=void 0;Ni.prototype.cause=void 0;Ni.prototype.fatal=void 0;Ni.prototype.place=void 0;Ni.prototype.ruleId=void 0;Ni.prototype.source=void 0;const Do={basename:Aue,dirname:Eue,extname:Oue,join:Lue,sep:"/"};function Aue(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');k1(t);let r=0,n=-1,i=t.length,s;if(e===void 0||e.length===0||e.length>t.length){for(;i--;)if(t.codePointAt(i)===47){if(s){r=i+1;break}}else n<0&&(s=!0,n=i+1);return n<0?"":t.slice(r,n)}if(e===t)return"";let o=-1,a=e.length-1;for(;i--;)if(t.codePointAt(i)===47){if(s){r=i+1;break}}else o<0&&(s=!0,o=i+1),a>-1&&(t.codePointAt(i)===e.codePointAt(a--)?a<0&&(n=i):(a=-1,n=o));return r===n?n=o:n<0&&(n=t.length),t.slice(r,n)}function Eue(t){if(k1(t),t.length===0)return".";let e=-1,r=t.length,n;for(;--r;)if(t.codePointAt(r)===47){if(n){e=r;break}}else n||(n=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function Oue(t){k1(t);let e=t.length,r=-1,n=0,i=-1,s=0,o;for(;e--;){const a=t.codePointAt(e);if(a===47){if(o){n=e+1;break}continue}r<0&&(o=!0,r=e+1),a===46?i<0?i=e:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||r<0||s===0||s===1&&i===r-1&&i===n+1?"":t.slice(i,r)}function Lue(...t){let e=-1,r;for(;++e<t.length;)k1(t[e]),t[e]&&(r=r===void 0?t[e]:r+"/"+t[e]);return r===void 0?".":Due(r)}function Due(t){k1(t);const e=t.codePointAt(0)===47;let r=Iue(t,!e);return r.length===0&&!e&&(r="."),r.length>0&&t.codePointAt(t.length-1)===47&&(r+="/"),e?"/"+r:r}function Iue(t,e){let r="",n=0,i=-1,s=0,o=-1,a,l;for(;++o<=t.length;){if(o<t.length)a=t.codePointAt(o);else{if(a===47)break;a=47}if(a===47){if(!(i===o-1||s===1))if(i!==o-1&&s===2){if(r.length<2||n!==2||r.codePointAt(r.length-1)!==46||r.codePointAt(r.length-2)!==46){if(r.length>2){if(l=r.lastIndexOf("/"),l!==r.length-1){l<0?(r="",n=0):(r=r.slice(0,l),n=r.length-1-r.lastIndexOf("/")),i=o,s=0;continue}}else if(r.length>0){r="",n=0,i=o,s=0;continue}}e&&(r=r.length>0?r+"/..":"..",n=2)}else r.length>0?r+="/"+t.slice(i+1,o):r=t.slice(i+1,o),n=o-i-1;i=o,s=0}else a===46&&s>-1?s++:s=-1}return r}function k1(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const Bue={cwd:Rue};function Rue(){return"/"}function bC(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function Pue(t){if(typeof t=="string")t=new URL(t);else if(!bC(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return Nue(t)}function Nue(t){if(t.hostname!==""){const n=new TypeError('File URL host must be "localhost" or empty on darwin');throw n.code="ERR_INVALID_FILE_URL_HOST",n}const e=t.pathname;let r=-1;for(;++r<e.length;)if(e.codePointAt(r)===37&&e.codePointAt(r+1)===50){const n=e.codePointAt(r+2);if(n===70||n===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(e)}const g5=["history","path","basename","stem","extname","dirname"];class Fue{constructor(e){let r;e?bC(e)?r={path:e}:typeof e=="string"||$ue(e)?r={value:e}:r=e:r={},this.cwd="cwd"in r?"":Bue.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<g5.length;){const s=g5[n];s in r&&r[s]!==void 0&&r[s]!==null&&(this[s]=s==="history"?[...r[s]]:r[s])}let i;for(i in r)g5.includes(i)||(this[i]=r[i])}get basename(){return typeof this.path=="string"?Do.basename(this.path):void 0}
83set basename(e){b5(e,"basename"),y5(e,"basename"),this.path=Do.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?Do.dirname(this.path):void 0}set dirname(e){RE(this.basename,"dirname"),this.path=Do.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?Do.extname(this.path):void 0}set extname(e){if(y5(e,"extname"),RE(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Do.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){bC(e)&&(e=Pue(e)),b5(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?Do.basename(this.path,this.extname):void 0}set stem(e){b5(e,"stem"),y5(e,"stem"),this.path=Do.join(this.dirname||"",e+(this.extname||""))}fail(e,r,n){const i=this.message(e,r,n);throw i.fatal=!0,i}info(e,r,n){const i=this.message(e,r,n);return i.fatal=void 0,i}message(e,r,n){const i=new Ni(e,r,n);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function y5(t,e){if(t&&t.includes(Do.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+Do.sep+"`")}function b5(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function RE(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}function $ue(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const zue=function(t){const n=this.constructor.prototype,i=n[t],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,n),s},Hue={}.hasOwnProperty;class b7 extends zue{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=_ue()}copy(){const e=new b7;let r=-1;for(;++r<this.attachers.length;){const n=this.attachers[r];e.use(...n)}return e.data(m5(!0,{},this.namespace)),e}data(e,r){return typeof e=="string"?arguments.length===2?(w5("data",this.frozen),this.namespace[e]=r,this):Hue.call(this.namespace,e)&&this.namespace[e]||void 0:e?(w5("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[r,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);const i=r.call(e,...n);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const r=Dy(e),n=this.parser||this.Parser;return x5("parse",n),n(String(r),r)}process(e,r){const n=this;return this.freeze(),x5("process",this.parser||this.Parser),v5("process",this.compiler||this.Compiler),r?i(void 0,r):new Promise(i);function i(s,o){const a=Dy(e),l=n.parse(a);n.run(l,a,function(h,u,d){if(h||!u||!d)return c(h);const f=u,p=n.stringify(f,d);Vue(p)?d.value=p:d.result=p,c(h,d)});function c(h,u){h||!u?o(h):s?s(u):r(void 0,u)}}}processSync(e){let r=!1,n;return this.freeze(),x5("processSync",this.parser||this.Parser),v5("processSync",this.compiler||this.Compiler),this.process(e,i),NE("processSync","process",r),n;function i(s,o){r=!0,AE(s),n=o}}run(e,r,n){PE(e),this.freeze();const i=this.transformers;return!n&&typeof r=="function"&&(n=r,r=void 0),n?s(void 0,n):new Promise(s);function s(o,a){const l=Dy(r);i.run(e,l,c);function c(h,u,d){const f=u||e;h?a(h):o?o(f):n(void 0,f,d)}}}runSync(e,r){let n=!1,i;return this.run(e,r,s),NE("runSync","run",n),i;function s(o,a){AE(o),i=a,n=!0}}stringify(e,r){this.freeze();const n=Dy(r),i=this.compiler||this.Compiler;return v5("stringify",i),PE(e),i(e,n)}use(e,...r){const n=this.attachers,i=this.namespace;if(w5("use",this.frozen),e!=null)if(typeof e=="function")l(e,r);else if(typeof e=="object")Array.isArray(e)?a(e):o(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function s(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[h,...u]=c;l(h,u)}else o(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function o(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(c.plugins),c.settings&&(i.settings=m5(!0,i.settings,c.settings))}function a(c){let h=-1;if(c!=null)if(Array.isArray(c))for(;++h<c.length;){const u=c[h];s(u)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,h){let u=-1,d=-1;for(;++u<n.length;)if(n[u][0]===c){d=u;break}if(d===-1)n.push([c,...h]);else if(h.length>0){let[f,...p]=h;const m=n[d][1];yC(m)&&yC(f)&&(f=m5(!0,m,f)),n[d]=[c,f,...p]}}}}const xC=new b7().freeze();function x5(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function v5(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function w5(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function PE(t){if(!yC(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function NE(t,e,r){if(!r)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function Dy(t){return que(t)?t:new Fue(t)}function que(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function Vue(t){return typeof t=="string"||Wue(t)}function Wue(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}var HF=t=>{throw TypeError(t)},qF=(t,e,r)=>e.has(t)||HF("Cannot "+r),Et=(t,e,r)=>(qF(t,e,"read from private field"),r?r.call(t):e.get(t)),qr=(t,e,r)=>e.has(t)?HF("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),br=(t,e,r,n)=>(qF(t,e,"write to private field"),e.set(t,r),r),Ao,hp,N2,F2,$2,up,dp,Sa,fp,z2,H2,pp,q2,mp,V2,W2,Ju,th,j2,gp;class VF{}class WF{constructor(){this.elements=[],this.size=()=>this.elements.length,this.top=()=>this.elements.at(-1),this.push=e=>{var r;(r=this.top())==null||r.push(e)},this.open=e=>{this.elements.push(e)},this.close=()=>{const e=this.elements.pop();if(!e)throw eF();return e}}}class x7 extends VF{constructor(e,r,n){super(),this.type=e,this.content=r,this.attrs=n}push(e,...r){this.content.push(e,...r)}pop(){return this.content.pop()}static create(e,r,n){return new x7(e,r,n)}}const vC=class extends WF{constructor(e){super(),qr(this,Ao),qr(this,hp),qr(this,N2),qr(this,F2),qr(this,$2),qr(this,up),qr(this,dp),br(this,Ao,At.none),br(this,hp,r=>r.isText),br(this,N2,(r,n)=>{if(Et(this,hp).call(this,r)&&Et(this,hp).call(this,n)&&At.sameSet(r.marks,n.marks))return this.schema.text(r.text+n.text,r.marks)}),br(this,F2,r=>{const n=Object.values({...this.schema.nodes,...this.schema.marks}).find(i=>i.spec.parseMarkdown.match(r));if(!n)throw zae(r);return n}),br(this,$2,r=>{const n=Et(this,F2).call(this,r);
83n.spec.parseMarkdown.runner(this,r,n)}),this.injectRoot=(r,n,i)=>(this.openNode(n,i),this.next(r.children),this),this.openNode=(r,n)=>(this.open(x7.create(r,[],n)),this),br(this,up,()=>{br(this,Ao,At.none);const r=this.close();return Et(this,dp).call(this,r.type,r.attrs,r.content)}),this.closeNode=()=>{try{Et(this,up).call(this)}catch(r){console.error(r)}return this},br(this,dp,(r,n,i)=>{const s=r.createAndFill(n,i,Et(this,Ao));if(!s)throw $ae(r,n,i);return this.push(s),s}),this.addNode=(r,n,i)=>{try{Et(this,dp).call(this,r,n,i)}catch(s){console.error(s)}return this},this.openMark=(r,n)=>{const i=r.create(n);return br(this,Ao,i.addToSet(Et(this,Ao))),this},this.closeMark=r=>(br(this,Ao,r.removeFromSet(Et(this,Ao))),this),this.addText=r=>{try{const n=this.top();if(!n)throw eF();const i=n.pop(),s=this.schema.text(r,Et(this,Ao));if(!i)return n.push(s),this;const o=Et(this,N2).call(this,i,s);return o?(n.push(o),this):(n.push(i,s),this)}catch(n){return console.error(n),this}},this.build=()=>{let r;do r=Et(this,up).call(this);while(this.size());return r},this.next=(r=[])=>([r].flat().forEach(n=>Et(this,$2).call(this,n)),this),this.toDoc=()=>this.build(),this.run=(r,n)=>{const i=r.runSync(r.parse(n),n);return this.next(i),this},this.schema=e}};Ao=new WeakMap;hp=new WeakMap;N2=new WeakMap;F2=new WeakMap;$2=new WeakMap;up=new WeakMap;dp=new WeakMap;vC.create=(t,e)=>{const r=new vC(t);return n=>(r.run(e,n),r.toDoc())};let jue=vC;const wC=class extends VF{constructor(e,r,n,i={}){super(),this.type=e,this.children=r,this.value=n,this.props=i,this.push=(s,...o)=>{this.children||(this.children=[]),this.children.push(s,...o)},this.pop=()=>{var s;return(s=this.children)==null?void 0:s.pop()}}};wC.create=(t,e,r,n={})=>new wC(t,e,r,n);let FE=wC;const Uue=t=>Object.prototype.hasOwnProperty.call(t,"size"),kC=class extends WF{constructor(e){super(),qr(this,Sa),qr(this,fp),qr(this,z2),qr(this,H2),qr(this,pp),qr(this,q2),qr(this,mp),qr(this,V2),qr(this,W2),qr(this,Ju),qr(this,th),qr(this,j2),qr(this,gp),br(this,Sa,At.none),br(this,fp,r=>{const n=Object.values({...this.schema.nodes,...this.schema.marks}).find(i=>i.spec.toMarkdown.match(r));if(!n)throw Hae(r.type);return n}),br(this,z2,r=>Et(this,fp).call(this,r).spec.toMarkdown.runner(this,r)),br(this,H2,(r,n)=>Et(this,fp).call(this,r).spec.toMarkdown.runner(this,r,n)),br(this,pp,r=>{const{marks:n}=r,i=a=>a.type.spec.priority??50;[...n].sort((a,l)=>i(a)-i(l)).every(a=>!Et(this,H2).call(this,a,r))&&Et(this,z2).call(this,r),n.forEach(a=>Et(this,gp).call(this,a))}),br(this,q2,(r,n)=>{var l;if(r.type===n||((l=r.children)==null?void 0:l.length)!==1)return r;const i=c=>{var u;if(c.type===n)return c;if(((u=c.children)==null?void 0:u.length)!==1)return null;const[h]=c.children;return h?i(h):null},s=i(r);if(!s)return r;const o=s.children?[...s.children]:void 0,a={...r,children:o};return a.children=o,s.children=[a],s}),br(this,mp,r=>{const{children:n}=r;return n&&(r.children=n.reduce((i,s,o)=>{if(o===0)return[s];const a=i.at(-1);if(a&&a.isMark&&s.isMark){s=Et(this,q2).call(this,s,a.type);const{children:l,...c}=s,{children:h,...u}=a;if(s.type===a.type&&l&&h&&JSON.stringify(c)===JSON.stringify(u)){const d={...u,children:[...h,...l]};return i.slice(0,-1).concat(Et(this,mp).call(this,d))}}return i.concat(s)},[])),r}),br(this,V2,r=>{const n={...r.props,type:r.type};return r.children&&(n.children=r.children),r.value&&(n.value=r.value),n}),this.openNode=(r,n,i)=>(this.open(FE.create(r,void 0,n,i)),this),br(this,W2,(r,n)=>{let i="",s="";const o=r.children;let a=-1,l=-1;const c=u=>{u&&u.forEach((d,f)=>
83{d.type==="text"&&d.value&&(a<0&&(a=f),l=f)})};if(o){c(o);const u=o==null?void 0:o[l],d=o==null?void 0:o[a];if(u&&u.value.endsWith(" ")){const f=u.value,p=f.trimEnd();s=f.slice(p.length),u.value=p}if(d&&d.value.startsWith(" ")){const f=d.value,p=f.trimStart();i=f.slice(0,f.length-p.length),d.value=p}}i.length&&Et(this,th).call(this,"text",void 0,i);const h=n();return s.length&&Et(this,th).call(this,"text",void 0,s),h}),br(this,Ju,(r=!1)=>{const n=this.close(),i=()=>Et(this,th).call(this,n.type,n.children,n.value,n.props);return r?Et(this,W2).call(this,n,i):i()}),this.closeNode=()=>(Et(this,Ju).call(this),this),br(this,th,(r,n,i,s)=>{const o=FE.create(r,n,i,s),a=Et(this,mp).call(this,Et(this,V2).call(this,o));return this.push(a),a}),this.addNode=(r,n,i,s)=>(Et(this,th).call(this,r,n,i,s),this),br(this,j2,(r,n,i,s)=>r.isInSet(Et(this,Sa))?this:(br(this,Sa,r.addToSet(Et(this,Sa))),this.openNode(n,i,{...s,isMark:!0}))),br(this,gp,r=>{r.isInSet(Et(this,Sa))&&(br(this,Sa,r.type.removeFromSet(Et(this,Sa))),Et(this,Ju).call(this,!0))}),this.withMark=(r,n,i,s)=>(Et(this,j2).call(this,r,n,i,s),this),this.closeMark=r=>(Et(this,gp).call(this,r),this),this.build=()=>{let r=null;do r=Et(this,Ju).call(this);while(this.size());return r},this.next=r=>Uue(r)?(r.forEach(n=>{Et(this,pp).call(this,n)}),this):(Et(this,pp).call(this,r),this),this.toString=r=>r.stringify(this.build()),this.run=r=>(this.next(r),this),this.schema=e}};Sa=new WeakMap;fp=new WeakMap;z2=new WeakMap;H2=new WeakMap;pp=new WeakMap;q2=new WeakMap;mp=new WeakMap;V2=new WeakMap;W2=new WeakMap;Ju=new WeakMap;th=new WeakMap;j2=new WeakMap;gp=new WeakMap;kC.create=(t,e)=>{const r=new kC(t);return n=>(r.run(n),r.toString(e))};let Gue=kC;const v7=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function jF(t,e){let{$cursor:r}=t.selection;return!r||(e?!e.endOfTextblock("backward",t):r.parentOffset>0)?null:r}const UF=(t,e,r)=>{let n=jF(t,r);if(!n)return!1;let i=w7(n);if(!i){let o=n.blockRange(),a=o&&Gv(o);return a==null?!1:(e&&e(t.tr.lift(o,a).scrollIntoView()),!0)}let s=i.nodeBefore;if(XF(t,i,e,-1))return!0;if(n.parent.content.size==0&&(Sf(s,"end")||lt.isSelectable(s)))for(let o=n.depth;;o--){let a=Yv(t.doc,n.before(o),n.after(o),Ie.empty);if(a&&a.slice.size<a.to-a.from){if(e){let l=t.tr.step(a);l.setSelection(Sf(s,"end")?gt.findFrom(l.doc.resolve(l.mapping.map(i.pos,-1)),-1):lt.create(l.doc,i.pos-s.nodeSize)),e(l.scrollIntoView())}return!0}if(o==1||n.node(o-1).childCount>1)break}return s.isAtom&&i.depth==n.depth-1?(e&&e(t.tr.delete(i.pos-s.nodeSize,i.pos).scrollIntoView()),!0):!1},Kue=(t,e,r)=>{let n=jF(t,r);if(!n)return!1;let i=w7(n);return i?Yue(t,i,e):!1};function Yue(t,e,r){let n=e.nodeBefore,i=n,s=e.pos-1;for(;!i.isTextblock;s--){if(i.type.spec.isolating)return!1;let h=i.lastChild;if(!h)return!1;i=h}let o=e.nodeAfter,a=o,l=e.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let h=a.firstChild;if(!h)return!1;a=h}let c=Yv(t.doc,s,l,Ie.empty);if(!c||c.from!=s||c instanceof ln&&c.slice.size>=l-s)return!1;if(r){let h=t.tr.step(c);h.setSelection(Je.create(h.doc,s)),r(h.scrollIntoView())}return!0}function Sf(t,e,r=!1){for(let n=t;n;n=e=="start"?n.firstChild:n.lastChild){if(n.isTextblock)return!0;if(r&&n.childCount!=1)return!1}return!1}const GF=(t,e,r)=>{let{$head:n,empty:i}=t.selection,s=n;if(!i)return!1;if(n.parent.isTextblock){if(r?!r.endOfTextblock("backward",t):n.parentOffset>0)return!1;s=w7(n)}let o=s&&s.nodeBefore;return!o||!lt.isSelectable(o)?!1:(e&&e(t.tr.setSelection(lt.create(t.doc,s.pos-o.nodeSize)).scrollIntoView()),!0)};function w7(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function Xue(t,e){let{$cursor:r}=t.selection;return!r||(e?!e.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)?null:r}const Jue=(t,e,r)=>{let n=Xue(t,r);if(!n)return!1;let i=KF(n);if(!i)return!1;let s=i.nodeAfter;if(XF(t,i,e,1))return!0;if(n.parent.content.size==0&&(Sf(s,"start")||lt.isSelectable(s))){let o=Yv(t.doc,n.before(),n.after(),Ie.empty);if(o&&o.slice.size<o.to-o.from){if(e){let a=t.tr.step(o);a.setSelection(Sf(s,"start")?gt.findFrom(a.doc.resolve(a.mapping.map(i.pos)),1):lt.create(a.doc,a.mapping.map(i.pos))),e(a.scrollIntoView())}return!0}}return s.isAtom&&i.depth==n.depth-1?(e&&e(t.tr.delete(i.pos,i.pos+s.nodeSize).scrollIntoView()),!0):!1},Zue=(t,e,r)=>{let{$head:n,empty:i}=t.selection,s=n;if(!i)return!1;if(n.parent.isTextblock){if(r?!r.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)return!1;s=KF(n)}let o=s&&s.nodeAfter;
vendor: 5,223 bytes, lines 83-84
83return!o||!lt.isSelectable(o)?!1:(e&&e(t.tr.setSelection(lt.create(t.doc,s.pos)).scrollIntoView()),!0)};function KF(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let r=t.node(e);if(t.index(e)+1<r.childCount)return t.doc.resolve(t.after(e+1));if(r.type.spec.isolating)break}return null}const Que=(t,e)=>{let{$head:r,$anchor:n}=t.selection;return!r.parent.type.spec.code||!r.sameParent(n)?!1:(e&&e(t.tr.insertText(`
84`).scrollIntoView()),!0)};function k7(t){for(let e=0;e<t.edgeCount;e++){let{type:r}=t.edge(e);if(r.isTextblock&&!r.hasRequiredAttrs())return r}return null}const YF=(t,e)=>{let{$head:r,$anchor:n}=t.selection;if(!r.parent.type.spec.code||!r.sameParent(n))return!1;let i=r.node(-1),s=r.indexAfter(-1),o=k7(i.contentMatchAt(s));if(!o||!i.canReplaceWith(s,s,o))return!1;if(e){let a=r.after(),l=t.tr.replaceWith(a,a,o.createAndFill());l.setSelection(gt.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},ede=(t,e)=>{let r=t.selection,{$from:n,$to:i}=r;if(r instanceof Ii||n.parent.inlineContent||i.parent.inlineContent)return!1;let s=k7(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let o=(!n.parentOffset&&i.index()<i.parent.childCount?n:i).pos,a=t.tr.insert(o,s.createAndFill());a.setSelection(Je.create(a.doc,o+1)),e(a.scrollIntoView())}return!0},tde=(t,e)=>{let{$cursor:r}=t.selection;if(!r||r.parent.content.size)return!1;if(r.depth>1&&r.after()!=r.end(-1)){let s=r.before();if(sm(t.doc,s))return e&&e(t.tr.split(s).scrollIntoView()),!0}let n=r.blockRange(),i=n&&Gv(n);return i==null?!1:(e&&e(t.tr.lift(n,i).scrollIntoView()),!0)};function rde(t){return(e,r)=>{let{$from:n,$to:i}=e.selection;if(e.selection instanceof lt&&e.selection.node.isBlock)return!n.parentOffset||!sm(e.doc,n.pos)?!1:(r&&r(e.tr.split(n.pos).scrollIntoView()),!0);if(!n.depth)return!1;let s=[],o,a,l=!1,c=!1;for(let f=n.depth;;f--)if(n.node(f).isBlock){l=n.end(f)==n.pos+(n.depth-f),c=n.start(f)==n.pos-(n.depth-f),a=k7(n.node(f-1).contentMatchAt(n.indexAfter(f-1))),s.unshift(l&&a?{type:a}:null),o=f;break}else{if(f==1)return!1;s.unshift(null)}let h=e.tr;(e.selection instanceof Je||e.selection instanceof Ii)&&h.deleteSelection();let u=h.mapping.map(n.pos),d=sm(h.doc,u,s.length,s);if(d||(s[0]=a?{type:a}:null,d=sm(h.doc,u,s.length,s)),!d)return!1;if(h.split(u,s.length,s),!l&&c&&n.node(o).type!=a){let f=h.mapping.map(n.before(o)),p=h.doc.resolve(f);a&&n.node(o-1).canReplaceWith(p.index(),p.index()+1,a)&&h.setNodeMarkup(h.mapping.map(n.before(o)),a)}return r&&r(h.scrollIntoView()),!0}}const nde=rde(),ide=(t,e)=>(e&&e(t.tr.setSelection(new Ii(t.doc))),!0);function sde(t,e,r){let n=e.nodeBefore,i=e.nodeAfter,s=e.index();return!n||!i||!n.type.compatibleContent(i.type)?!1:!n.content.size&&e.parent.canReplace(s-1,s)?(r&&r(t.tr.delete(e.pos-n.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(s,s+1)||!(i.isTextblock||Kv(t.doc,e.pos))?!1:(r&&r(t.tr.join(e.pos).scrollIntoView()),!0)}function XF(t,e,r,n){let i=e.nodeBefore,s=e.nodeAfter,o,a,l=i.type.spec.isolating||s.type.spec.isolating;if(!l&&sde(t,e,r))return!0;let c=!l&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(o=(a=i.contentMatchAt(i.childCount)).findWrapping(s.type))&&a.matchType(o[0]||s.type).validEnd){if(r){let f=e.pos+s.nodeSize,p=Se.empty;for(let y=o.length-1;y>=0;y--)p=Se.from(o[y].create(null,p));p=Se.from(i.copy(p));let m=t.tr.step(new $n(e.pos-1,f,e.pos,f,new Ie(p,1,0),o.length,!0)),g=m.doc.resolve(f+2*o.length);g.nodeAfter&&g.nodeAfter.type==i.type&&Kv(m.doc,g.pos)&&m.join(g.pos),r(m.scrollIntoView())}return!0}let h=s.type.spec.isolating||n>0&&l?null:gt.findFrom(e,1),u=h&&h.$from.blockRange(h.$to),d=u&&Gv(u);if(d!=null&&d>=e.depth)return r&&r(t.tr.lift(u,d).scrollIntoView()),!0;if(c&&Sf(s,"start",!0)&&Sf(i,"end")){let f=i,p=[];for(;p.push(f),!f.isTextblock;)f=f.lastChild;let m=s,g=1;for(;!m.isTextblock;m=m.firstChild)g++;if(f.canReplace(f.childCount,f.childCount,m.content)){if(r){let y=Se.empty;for(let x=p.length-1;x>=0;x--)y=Se.from(p[x].copy(y));let b=t.tr.step(new $n(e.pos-p.length,e.pos+s.nodeSize,e.pos+g,e.pos+s.nodeSize-g,new Ie(y,p.length,0),0,!0));r(b.scrollIntoView())}return!0}}return!1}function JF(t){return function(e,r){let n=e.selection,i=t<0?n.$from:n.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return i.node(s).isTextblock?(r&&r(e.tr.setSelection(Je.create(e.doc,t<0?i.start(s):i.end(s)))),!0):!1}}const ode=JF(-1),ade=JF(1);function C7(t,e=null){return function(r,n){let{$from:i,$to:s}=r.selection,o=i.blockRange(s),a=o&&o7(o,t,e);return a?(n&&n(r.tr.wrap(o,a).scrollIntoView()),!0):!1}}function og(t,e=null){return function(r,n){let i=!1;for(let s=0;s<r.selection.ranges.length&&!i;s++){let{$from:{pos:o},$to:{pos:a}}=r.selection.ranges[s];r.doc.nodesBetween(o,a,(l,c)=>{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)i=!0;else{let h=r.doc.resolve(c),u=h.index();i=h.parent.canReplaceWith(u,u+1,t)}})}if(!i)return!1;if(n){let s=r.tr;for(let o=0;o<r.selection.ranges.length;o++){let{$from:{pos:a},$to:{pos:l}}=r.selection.ranges[o];s.setBlockType(a,l,t,e)}n(s.scrollIntoView())}return!0}}function lde(t,e,r,n){for(let i=0;i<e.length;i++){let{$from:s,$to:o}=e[i],a=s.depth==0?t.inlineContent&&t.type.allowsMarkType(r):!1;
vendor: 4,199 bytes, line 84
84if(t.nodesBetween(s.pos,o.pos,(l,c)=>{if(a||!n)return!1;a=l.inlineContent&&l.type.allowsMarkType(r)}),a)return!0}return!1}function sw(t,e=null,r){let n=r!==!1;return function(i,s){let{empty:o,$cursor:a,ranges:l}=i.selection;if(o&&!a||!lde(i.doc,l,t,n))return!1;if(s)if(a)t.isInSet(i.storedMarks||a.marks())?s(i.tr.removeStoredMark(t)):s(i.tr.addStoredMark(t.create(e)));else{let c,h=i.tr;c=!l.some(u=>i.doc.rangeHasMark(u.$from.pos,u.$to.pos,t));for(let u=0;u<l.length;u++){let{$from:d,$to:f}=l[u];if(!c)h.removeMark(d.pos,f.pos,t);else{let p=d.pos,m=f.pos,g=d.nodeAfter,y=f.nodeBefore,b=g&&g.isText?/^\s*/.exec(g.text)[0].length:0,x=y&&y.isText?/\s*$/.exec(y.text)[0].length:0;p+b<m&&(p+=b,m-=x),h.addMark(p,m,t.create(e))}}s(h.scrollIntoView())}return!0}}function Xf(...t){return function(e,r,n){for(let i=0;i<t.length;i++)if(t[i](e,r,n))return!0;return!1}}let k5=Xf(v7,UF,GF),$E=Xf(v7,Jue,Zue);const Ia={Enter:Xf(Que,ede,tde,nde),"Mod-Enter":YF,Backspace:k5,"Mod-Backspace":k5,"Shift-Backspace":k5,Delete:$E,"Mod-Delete":$E,"Mod-a":ide},ZF={"Ctrl-h":Ia.Backspace,"Alt-Backspace":Ia["Mod-Backspace"],"Ctrl-d":Ia.Delete,"Ctrl-Alt-Backspace":Ia["Mod-Delete"],"Alt-Delete":Ia["Mod-Delete"],"Alt-d":Ia["Mod-Delete"],"Ctrl-a":ode,"Ctrl-e":ade};for(let t in Ia)ZF[t]=Ia[t];const cde=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform?os.platform()=="darwin":!1,hde=cde?ZF:Ia,ude=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),dde=typeof navigator<"u"&&/Win/.test(navigator.platform);function fde(t){let e=t.split(/-(?!$)/),r=e[e.length-1];r=="Space"&&(r=" ");let n,i,s,o;for(let a=0;a<e.length-1;a++){let l=e[a];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))n=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))s=!0;else if(/^mod$/i.test(l))ude?o=!0:i=!0;else throw new Error("Unrecognized modifier name: "+l)}return n&&(r="Alt-"+r),i&&(r="Ctrl-"+r),o&&(r="Meta-"+r),s&&(r="Shift-"+r),r}function pde(t){let e=Object.create(null);for(let r in t)e[fde(r)]=t[r];return e}function C5(t,e,r=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),r&&e.shiftKey&&(t="Shift-"+t),t}function QF(t){return new _r({props:{handleKeyDown:S7(t)}})}function S7(t){let e=pde(t);return function(r,n){let i=FR(n),s,o=e[C5(i,n)];if(o&&o(r.state,r.dispatch,r))return!0;if(i.length==1&&i!=" "){if(n.shiftKey){let a=e[C5(i,n,!1)];if(a&&a(r.state,r.dispatch,r))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(dde&&n.ctrlKey&&n.altKey)&&(s=nl[n.keyCode])&&s!=i){let a=e[C5(s,n)];if(a&&a(r.state,r.dispatch,r))return!0}}return!1}}const kn=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Tf=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let CC=null;const La=function(t,e,r){let n=CC||(CC=document.createRange());return n.setEnd(t,r??t.nodeValue.length),n.setStart(t,e||0),n},mde=function(){CC=null},hu=function(t,e,r,n){return r&&(zE(t,e,r,n,-1)||zE(t,e,r,n,1))},gde=/^(img|br|input|textarea|hr)$/i;function zE(t,e,r,n,i){for(var s;;){if(t==r&&e==n)return!0;if(e==(i<0?0:vs(t))){let o=t.parentNode;if(!o||o.nodeType!=1||C1(t)||gde.test(t.nodeName)||t.contentEditable=="false")return!1;e=kn(t)+(i<0?0:1),t=o}else if(t.nodeType==1){let o=t.childNodes[e+(i<0?-1:0)];if(o.nodeType==1&&o.contentEditable=="false")if(!((s=o.pmViewDesc)===null||s===void 0)&&s.ignoreForSelection)e+=i;else return!1;else t=o,e=i<0?vs(t):0}else return!1}}function vs(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function yde(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=vs(t)}else if(t.parentNode&&!C1(t))e=kn(t),t=t.parentNode;else return null}}function bde(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!C1(t))e=kn(t)+1,t=t.parentNode;else return null}}function xde(t,e,r){for(let n=e==0,i=e==vs(t);n||i;){if(t==r)return!0;let s=kn(t);if(t=t.parentNode,!t)return!1;n=n&&s==0,i=i&&s==vs(t)}}function C1(t){let e;for(let r=t;
vendor: 15,893 bytes, lines 84-85
84r&&!(e=r.pmViewDesc);r=r.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const ow=function(t){return t.focusNode&&hu(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function hh(t,e){let r=document.createEvent("Event");return r.initEvent("keydown",!0,!0),r.keyCode=t,r.key=r.code=e,r}function vde(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function wde(t,e,r){if(t.caretPositionFromPoint)try{let n=t.caretPositionFromPoint(e,r);if(n)return{node:n.offsetNode,offset:Math.min(vs(n.offsetNode),n.offset)}}catch{}if(t.caretRangeFromPoint){let n=t.caretRangeFromPoint(e,r);if(n)return{node:n.startContainer,offset:Math.min(vs(n.startContainer),n.startOffset)}}}const Qo=typeof navigator<"u"?navigator:null,HE=typeof document<"u"?document:null,Ic=Qo&&Qo.userAgent||"",SC=/Edge\/(\d+)/.exec(Ic),e$=/MSIE \d/.exec(Ic),TC=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ic),Bi=!!(e$||TC||SC),sc=e$?document.documentMode:TC?+TC[1]:SC?+SC[1]:0,lo=!Bi&&/gecko\/(\d+)/i.test(Ic);lo&&+(/Firefox\/(\d+)/.exec(Ic)||[0,0])[1];const _C=!Bi&&/Chrome\/(\d+)/.exec(Ic),Nn=!!_C,t$=_C?+_C[1]:0,ci=!Bi&&!!Qo&&/Apple Computer/.test(Qo.vendor),_f=ci&&(/Mobile\/\w+/.test(Ic)||!!Qo&&Qo.maxTouchPoints>2),ys=_f||(Qo?/Mac/.test(Qo.platform):!1),kde=Qo?/Win/.test(Qo.platform):!1,ja=/Android \d/.test(Ic),S1=!!HE&&"webkitFontSmoothing"in HE.documentElement.style,Cde=S1?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Sde(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function ba(t,e){return typeof t=="number"?t:t[e]}function Tde(t){let e=t.getBoundingClientRect(),r=e.width/t.offsetWidth||1,n=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*r,top:e.top,bottom:e.top+t.clientHeight*n}}function qE(t,e,r){let n=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,s=t.dom.ownerDocument;for(let o=r||t.dom;o;){if(o.nodeType!=1){o=Tf(o);continue}let a=o,l=a==s.body,c=l?Sde(s):Tde(a),h=0,u=0;if(e.top<c.top+ba(n,"top")?u=-(c.top-e.top+ba(i,"top")):e.bottom>c.bottom-ba(n,"bottom")&&(u=e.bottom-e.top>c.bottom-c.top?e.top+ba(i,"top")-c.top:e.bottom-c.bottom+ba(i,"bottom")),e.left<c.left+ba(n,"left")?h=-(c.left-e.left+ba(i,"left")):e.right>c.right-ba(n,"right")&&(h=e.right-c.right+ba(i,"right")),h||u)if(l)s.defaultView.scrollBy(h,u);else{let f=a.scrollLeft,p=a.scrollTop;u&&(a.scrollTop+=u),h&&(a.scrollLeft+=h);let m=a.scrollLeft-f,g=a.scrollTop-p;e={left:e.left-m,top:e.top-g,right:e.right-m,bottom:e.bottom-g}}let d=l?"fixed":getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(d))break;o=d=="absolute"?o.offsetParent:Tf(o)}}function _de(t){let e=t.dom.getBoundingClientRect(),r=Math.max(0,e.top),n,i;for(let s=(e.left+e.right)/2,o=r+1;o<Math.min(innerHeight,e.bottom);o+=5){let a=t.root.elementFromPoint(s,o);if(!a||a==t.dom||!t.dom.contains(a))continue;let l=a.getBoundingClientRect();if(l.top>=r-20){n=a,i=l.top;break}}return{refDOM:n,refTop:i,stack:r$(t.dom)}}function r$(t){let e=[],r=t.ownerDocument;for(let n=t;n&&(e.push({dom:n,top:n.scrollTop,left:n.scrollLeft}),t!=r);n=Tf(n));return e}function Mde({refDOM:t,refTop:e,stack:r}){let n=t?t.getBoundingClientRect().top:0;n$(r,n==0?0:n-e)}function n$(t,e){for(let r=0;r<t.length;r++){let{dom:n,top:i,left:s}=t[r];n.scrollTop!=i+e&&(n.scrollTop=i+e),n.scrollLeft!=s&&(n.scrollLeft=s)}}let qu=null;function Ade(t){if(t.setActive)return t.setActive();if(qu)return t.focus(qu);let e=r$(t);t.focus(qu==null?{get preventScroll(){return qu={preventScroll:!0},!0}}:void 0),qu||(qu=!1,n$(e,0))}function i$(t,e){let r,n=2e8,i,s=0,o=e.top,a=e.top,l,c;for(let h=t.firstChild,u=0;h;h=h.nextSibling,u++){let d;if(h.nodeType==1)d=h.getClientRects();else if(h.nodeType==3)d=La(h).getClientRects();else continue;for(let f=0;f<d.length;f++){let p=d[f];if(p.top<=o&&p.bottom>=a){o=Math.max(p.bottom,o),a=Math.min(p.top,a);let m=p.left>e.left?p.left-e.left:p.right<e.left?e.left-p.right:0;if(m<n){r=h,n=m,i=m&&r.nodeType==3?{left:p.right<e.left?p.right:p.left,top:e.top}:e,h.nodeType==1&&m&&(s=u+(e.left>=(p.left+p.right)/2?1:0));continue}}else p.top>e.top&&!l&&p.left<=e.left&&p.right>=e.left&&(l=h,c={left:Math.max(p.left,Math.min(p.right,e.left)),top:p.top});!r&&(e.left>=p.right&&e.top>=p.top||e.left>=p.left&&e.top>=p.bottom)&&(s=u+1)}}return!r&&l&&(r=l,i=c,n=0),r&&r.nodeType==3?Ede(r,i):!r||n&&r.nodeType==1?{node:t,offset:s}:i$(r,i)}function Ede(t,e){let r=t.nodeValue.length,n=document.createRange();for(let i=0;i<r;i++){n.setEnd(t,i+1),n.setStart(t,i);let s=Ol(n,1);if(s.top!=s.bottom&&T7(e,s))return{node:t,offset:i+(e.left>=(s.left+s.right)/2?1:0)}}return{node:t,offset:0}}function T7(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function Ode(t,e){let r=t.parentNode;return r&&/^li$/i.test(r.nodeName)&&e.left<t.getBoundingClientRect().left?r:t}function Lde(t,e,r){let{node:n,offset:i}=i$(e,r),s=-1;if(n.nodeType==1&&!n.firstChild){let o=n.getBoundingClientRect();s=o.left!=o.right&&r.left>(o.left+o.right)/2?1:-1}return t.docView.posFromDOM(n,i,s)}function Dde(t,e,r,n){let i=-1;for(let s=e,o=!1;s!=t.dom;){let a=t.docView.nearestDesc(s,!0),l;if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((l=a.dom.getBoundingClientRect()).width||l.height)&&(a.node.isBlock&&a.parent&&(!o&&l.left>n.left||l.top>n.top?i=a.posBefore:(!o&&l.right<n.left||l.bottom<n.top)&&(i=a.posAfter),o=!0),!a.contentDOM&&i<0&&!a.node.isText))return(a.node.isBlock?n.top<(l.top+l.bottom)/2:n.left<(l.left+l.right)/2)?a.posBefore:a.posAfter;s=a.dom.parentNode}return i>-1?i:t.docView.posFromDOM(e,r,-1)}function s$(t,e,r){let n=t.childNodes.length;if(n&&r.top<r.bottom)for(let i=Math.max(0,Math.min(n-1,Math.floor(n*(e.top-r.top)/(r.bottom-r.top))-2)),s=i;;){let o=t.childNodes[s];if(o.nodeType==1){let a=o.getClientRects();for(let l=0;l<a.length;l++){let c=a[l];if(T7(e,c))return s$(o,e,c)}}if((s=(s+1)%n)==i)break}return t}function Ide(t,e){let r=t.dom.ownerDocument,n,i=0,s=wde(r,e.left,e.top);s&&({node:n,offset:i}=s);let o=(t.root.elementFromPoint?t.root:r).elementFromPoint(e.left,e.top),a;if(!o||!t.dom.contains(o.nodeType!=1?o.parentNode:o)){let c=t.dom.getBoundingClientRect();if(!T7(e,c)||(o=s$(t.dom,e,c),!o))return null}if(ci)for(let c=o;n&&c;c=Tf(c))c.draggable&&(n=void 0);if(o=Ode(o,e),n){if(lo&&n.nodeType==1&&(i=Math.min(i,n.childNodes.length),i<n.childNodes.length)){let h=n.childNodes[i],u;h.nodeName=="IMG"&&(u=h.getBoundingClientRect()).right<=e.left&&u.bottom>e.top&&i++}let c;S1&&i&&n.nodeType==1&&(c=n.childNodes[i-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&i--,n==t.dom&&i==n.childNodes.length-1&&n.lastChild.nodeType==1&&e.top>n.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(i==0||n.nodeType!=1||n.childNodes[i-1].nodeName!="BR")&&(a=Dde(t,n,i,e))}a==null&&(a=Lde(t,o,e));let l=t.docView.nearestDesc(o,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function VE(t){return t.top<t.bottom||t.left<t.right}function Ol(t,e){let r=t.getClientRects();if(r.length){let n=r[e<0?0:r.length-1];if(VE(n))return n}return Array.prototype.find.call(r,VE)||t.getBoundingClientRect()}const Bde=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function o$(t,e,r){let{node:n,offset:i,atom:s}=t.docView.domFromPos(e,r<0?-1:1),o=S1||lo;if(n.nodeType==3)if(o&&(Bde.test(n.nodeValue)||(r<0?!i:i==n.nodeValue.length))){let l=Ol(La(n,i,i),r);if(lo&&i&&/\s/.test(n.nodeValue[i-1])&&i<n.nodeValue.length){let c=Ol(La(n,i-1,i-1),-1);if(c.top==l.top){let h=Ol(La(n,i,i+1),-1);if(h.top!=l.top)return $0(h,h.left<c.left)}}return l}else{let l=i,c=i,h=r<0?1:-1;return r<0&&!i?(c++,h=-1):r>=0&&i==n.nodeValue.length?(l--,h=1):r<0?l--:c++,$0(Ol(La(n,l,c),h),h<0)}if(!t.state.doc.resolve(e-(s||0)).parent.inlineContent){if(s==null&&i&&(r<0||i==vs(n))){let l=n.childNodes[i-1];if(l.nodeType==1)return S5(l.getBoundingClientRect(),!1)}if(s==null&&i<vs(n)){let l=n.childNodes[i];if(l.nodeType==1)return S5(l.getBoundingClientRect(),!0)}return S5(n.getBoundingClientRect(),r>=0)}if(s==null&&i&&(r<0||i==vs(n))){let l=n.childNodes[i-1],c=l.nodeType==3?La(l,vs(l)-(o?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return $0(Ol(c,1),!1)}if(s==null&&i<vs(n)){let l=n.childNodes[i];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let c=l?l.nodeType==3?La(l,0,o?0:1):l.nodeType==1?l:null:null;if(c)return $0(Ol(c,-1),!0)}return $0(Ol(n.nodeType==3?La(n):n,-r),r>=0)}function $0(t,e){if(t.width==0)return t;let r=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:r,right:r}}function S5(t,e){if(t.height==0)return t;let r=e?t.top:t.bottom;return{top:r,bottom:r,left:t.left,right:t.right}}function a$(t,e,r){let n=t.state,i=t.root.activeElement;n!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return r()}finally{n!=e&&t.updateState(n),i!=t.dom&&i&&i.focus()}}function Rde(t,e,r){let n=e.selection,i=r=="up"?n.$from:n.$to;return a$(t,e,()=>{let{node:s}=t.docView.domFromPos(i.pos,r=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(s,!0);if(!a)break;if(a.node.isBlock){s=a.contentDOM||a.dom;break}s=a.dom.parentNode}let o=o$(t,i.pos,1);for(let a=s.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=La(a,0,a.nodeValue.length).getClientRects();else continue;for(let c=0;c<l.length;c++){let h=l[c];if(h.bottom>h.top+1&&(r=="up"?o.top-h.top>(h.bottom-o.top)*2:h.bottom-o.bottom>(o.bottom-h.top)*2))return!1}}return!0})}const Pde=/[\u0590-\u08ac]/;function Nde(t,e,r){let{$head:n}=e.selection;if(!n.parent.isTextblock)return!1;let i=n.parentOffset,s=!i,o=i==n.parent.content.size,a=t.domSelection();return a?!Pde.test(n.parent.textContent)||!a.modify?r=="left"||r=="backward"?s:o:a$(t,e,()=>{let{focusNode:l,focusOffset:c,anchorNode:h,anchorOffset:u}=t.domSelectionRange(),d=a.caretBidiLevel;a.modify("move",r,"character");let f=n.depth?t.docView.domAfterPos(n.before()):t.dom,{focusNode:p,focusOffset:m}=t.domSelectionRange(),g=p&&!f.contains(p.nodeType==1?p:p.parentNode)||l==p&&c==m;try{a.collapse(h,u),l&&(l!=h||c!=u)&&a.extend&&a.extend(l,c)}catch{}return d!=null&&(a.caretBidiLevel=d),g}):n.pos==n.start()||n.pos==n.end()}let WE=null,jE=null,UE=!1;function Fde(t,e,r){return WE==e&&jE==r?UE:(WE=e,jE=r,UE=r=="up"||r=="down"?Rde(t,e,r):Nde(t,e,r))}const Ms=0,GE=1,mh=2,ea=3;class T1{constructor(e,r,n,i){this.parent=e,this.children=r,this.dom=n,this.contentDOM=i,this.dirty=Ms,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,r,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let r=0;r<this.children.length;r++)e+=this.children[r].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let r=0,n=this.posAtStart;;r++){let i=this.children[r];if(i==e)return n;n+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,r,n){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(n<0){let s,o;if(e==this.contentDOM)s=e.childNodes[r-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.previousSibling}for(;s&&!((o=s.pmViewDesc)&&o.parent==this);)s=s.previousSibling;return s?this.posBeforeChild(o)+o.size:this.posAtStart}else{let s,o;if(e==this.contentDOM)s=e.childNodes[r];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.nextSibling}for(;s&&!((o=s.pmViewDesc)&&o.parent==this);)s=s.nextSibling;return s?this.posBeforeChild(o):this.posAtEnd}let i;if(e==this.dom&&this.contentDOM)i=r>kn(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(r==0)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!1;break}if(s.previousSibling)break}if(i==null&&r==e.childNodes.length)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!0;break}if(s.nextSibling)break}}return i??n>0?this.posAtEnd:this.posAtStart}nearestDesc(e,r=!1){for(let n=!0,i=e;i;i=i.parentNode){let s=this.getDesc(i),o;if(s&&(!r||s.node))if(n&&(o=s.nodeDOM)&&!(o.nodeType==1?o.contains(e.nodeType==1?e:e.parentNode):o==e))n=!1;else return s}}getDesc(e){let r=e.pmViewDesc;for(let n=r;n;n=n.parent)if(n==this)return r}posFromDOM(e,r,n){for(let i=e;i;i=i.parentNode){let s=this.getDesc(i);if(s)return s.localPosFromDOM(e,r,n)}return-1}descAt(e){for(let r=0,n=0;r<this.children.length;r++){let i=this.children[r],s=n+i.size;if(n==e&&s!=n){for(;!i.border&&i.children.length;)for(let o=0;o<i.children.length;o++){let a=i.children[o];if(a.size){i=a;break}}return i}if(e<s)return i.descAt(e-n-i.border);n=s}}domFromPos(e,r){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,i=0;for(let s=0;n<this.children.length;n++){let o=this.children[n],a=s+o.size;if(a>e||o instanceof c$){i=e-s;break}s=a}if(i)return this.children[n].domFromPos(i-this.children[n].border,r);for(let s;n&&!(s=this.children[n-1]).size&&s instanceof l$&&s.side>=0;n--);if(r<=0){let s,o=!0;for(;s=n?this.children[n-1]:null,!(!s||s.dom.parentNode==this.contentDOM);n--,o=!1);return s&&r&&o&&!s.border&&!s.domAtom?s.domFromPos(s.size,r):{node:this.contentDOM,offset:s?kn(s.dom)+1:0}}else{let s,o=!0;for(;s=n<this.children.length?this.children[n]:null,!(!s||s.dom.parentNode==this.contentDOM);n++,o=!1);return s&&o&&!s.border&&!s.domAtom?s.domFromPos(0,r):{node:this.contentDOM,offset:s?kn(s.dom):this.contentDOM.childNodes.length}}}parseRange(e,r,n=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:r,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,s=-1;for(let o=n,a=0;;a++){let l=this.children[a],c=o+l.size;if(i==-1&&e<=c){let h=o+l.border;if(e>=h&&r<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,r,h);e=o;for(let u=a;u>0;u--){let d=this.children[u-1];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(1)){i=kn(d.dom)+1;break}e-=d.size}i==-1&&(i=0)}if(i>-1&&(c>r||a==this.children.length-1)){r=c;for(let h=a+1;h<this.children.length;h++){let u=this.children[h];if(u.size&&u.dom.parentNode==this.contentDOM&&!u.emptyChildAt(-1)){s=kn(u.dom);break}r+=u.size}s==-1&&(s=this.contentDOM.childNodes.length);break}o=c}return{node:this.contentDOM,from:e,to:r,fromOffset:i,toOffset:s}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let r=this.children[e<0?0:this.children.length-1];return r.size==0||r.emptyChildAt(e)}domAfterPos(e){let{node:r,offset:n}=this.domFromPos(e,0);if(r.nodeType!=1||n==r.childNodes.length)throw new RangeError("No node after pos "+e);return r.childNodes[n]}setSelection(e,r,n,i=!1){let s=Math.min(e,r),o=Math.max(e,r);for(let f=0,p=0;f<this.children.length;f++){let m=this.children[f],g=p+m.size;if(s>p&&o<g)return m.setSelection(e-p-m.border,r-p-m.border,n,i);p=g}let a=this.domFromPos(e,e?-1:1),l=r==e?a:this.domFromPos(r,r?-1:1),c=n.root.getSelection(),h=n.domSelectionRange(),u=!1;if((lo||ci)&&e==r){let{node:f,offset:p}=a;if(f.nodeType==3){if(u=!!(p&&f.nodeValue[p-1]==`
85`),u&&p==f.nodeValue.length)for(let m=f,g;m;m=m.parentNode){if(g=m.nextSibling){g.nodeName=="BR"&&(a=l={node:g.parentNode,offset:kn(g)+1});break}let y=m.pmViewDesc;if(y&&y.node&&y.node.isBlock)break}}else{let m=f.childNodes[p-1];u=m&&(m.nodeName=="BR"||m.contentEditable=="false")}}if(lo&&h.focusNode&&h.focusNode!=l.node&&h.focusNode.nodeType==1){let f=h.focusNode.childNodes[h.focusOffset];f&&f.contentEditable=="false"&&(i=!0)}
vendor: 4,181 bytes, line 85
85if(!(i||u&&ci)&&hu(a.node,a.offset,h.anchorNode,h.anchorOffset)&&hu(l.node,l.offset,h.focusNode,h.focusOffset))return;let d=!1;if((c.extend||e==r)&&!u){c.collapse(a.node,a.offset);try{e!=r&&c.extend(l.node,l.offset),d=!0}catch{}}if(!d){if(e>r){let p=a;a=l,l=p}let f=document.createRange();f.setEnd(l.node,l.offset),f.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(f)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,r){for(let n=0,i=0;i<this.children.length;i++){let s=this.children[i],o=n+s.size;if(n==o?e<=o&&r>=n:e<o&&r>n){let a=n+s.border,l=o-s.border;if(e>=a&&r<=l){this.dirty=e==n||r==o?mh:GE,e==a&&r==l&&(s.contentLost||s.dom.parentNode!=this.contentDOM)?s.dirty=ea:s.markDirty(e-a,r-a);return}else s.dirty=s.dom==s.contentDOM&&s.dom.parentNode==this.contentDOM&&!s.children.length?mh:ea}n=o}this.dirty=mh}markParentsDirty(){let e=1;for(let r=this.parent;r;r=r.parent,e++){let n=e==1?mh:GE;r.dirty<n&&(r.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class l$ extends T1{constructor(e,r,n,i){let s,o=r.type.toDOM;if(typeof o=="function"&&(o=o(n,()=>{if(!s)return i;if(s.parent)return s.parent.posBeforeChild(s)})),!r.type.spec.raw){if(o.nodeType!=1){let a=document.createElement("span");a.appendChild(o),o=a}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=r,this.widget=r,s=this}matchesWidget(e){return this.dirty==Ms&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let r=this.widget.spec.stopEvent;return r?r(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class $de extends T1{constructor(e,r,n,i){super(e,[],r,null),this.textDOM=n,this.text=i}get size(){return this.text.length}localPosFromDOM(e,r){return e!=this.textDOM?this.posAtStart+(r?this.size:0):this.posAtStart+r}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class uu extends T1{constructor(e,r,n,i,s){super(e,[],n,i),this.mark=r,this.spec=s}static create(e,r,n,i){let s=i.nodeViews[r.type.name],o=s&&s(r,i,n);return(!o||!o.dom)&&(o=_u.renderSpec(document,r.type.spec.toDOM(r,n),null,r.attrs)),new uu(e,r,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&ea||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=ea&&this.mark.eq(e)}markDirty(e,r){if(super.markDirty(e,r),this.dirty!=Ms){let n=this.parent;for(;!n.node;)n=n.parent;n.dirty<this.dirty&&(n.dirty=this.dirty),this.dirty=Ms}}slice(e,r,n){let i=uu.create(this.parent,this.mark,!0,n),s=this.children,o=this.size;r<o&&(s=AC(s,r,o,n)),e>0&&(s=AC(s,0,e,n));for(let a=0;a<s.length;a++)s[a].parent=i;return i.children=s,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class oc extends T1{constructor(e,r,n,i,s,o,a,l,c){super(e,[],s,o),this.node=r,this.outerDeco=n,this.innerDeco=i,this.nodeDOM=a}static create(e,r,n,i,s,o){let a=s.nodeViews[r.type.name],l,c=a&&a(r,s,()=>{if(!l)return o;if(l.parent)return l.parent.posBeforeChild(l)},n,i),h=c&&c.dom,u=c&&c.contentDOM;if(r.isText){if(!h)h=document.createTextNode(r.text);else if(h.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else h||({dom:h,contentDOM:u}=_u.renderSpec(document,r.type.spec.toDOM(r),null,r.attrs));!u&&!r.isText&&h.nodeName!="BR"&&(h.hasAttribute("contenteditable")||(h.contentEditable="false"),r.type.spec.draggable&&(h.draggable=!0));let d=h;return h=d$(h,n,r),c?l=new zde(e,r,n,i,h,u||null,d,c,s,o+1):r.isText?new aw(e,r,n,i,h,d,s):new oc(e,r,n,i,h,u||null,d,s,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;
vendor: 26,321 bytes, lines 85-88
85let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let r=this.children.length-1;r>=0;r--){let n=this.children[r];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>Se.empty)}return e}matchesNode(e,r,n){return this.dirty==Ms&&e.eq(this.node)&&cx(r,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,r){let n=this.node.inlineContent,i=r,s=e.composing?this.localCompositionInfo(e,r):null,o=s&&s.pos>-1?s:null,a=s&&s.pos<0,l=new qde(this,o&&o.node,e);jde(this.node,this.innerDeco,(c,h,u)=>{c.spec.marks?l.syncToMarks(c.spec.marks,n,e):c.type.side>=0&&!u&&l.syncToMarks(h==this.node.childCount?At.none:this.node.child(h).marks,n,e),l.placeWidget(c,e,i)},(c,h,u,d)=>{l.syncToMarks(c.marks,n,e);let f;l.findNodeMatch(c,h,u,d)||a&&e.state.selection.from>i&&e.state.selection.to<i+c.nodeSize&&(f=l.findIndexWithChild(s.node))>-1&&l.updateNodeAt(c,h,u,f,e)||l.updateNextNode(c,h,u,e,d,i)||l.addNode(c,h,u,e,i),i+=c.nodeSize}),l.syncToMarks([],n,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==mh)&&(o&&this.protectLocalComposition(e,o),h$(this.contentDOM,this.children,e),_f&&Ude(this.dom))}localCompositionInfo(e,r){let{from:n,to:i}=e.state.selection;if(!(e.state.selection instanceof Je)||n<r||i>r+this.node.content.size)return null;let s=e.input.compositionNode;if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let o=s.nodeValue,a=Gde(this.node.content,o,n-r,i-r);return a<0?null:{node:s,pos:a,text:o}}else return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:r,pos:n,text:i}){if(this.getDesc(r))return;let s=r;for(;s.parentNode!=this.contentDOM;s=s.parentNode){for(;s.previousSibling;)s.parentNode.removeChild(s.previousSibling);for(;s.nextSibling;)s.parentNode.removeChild(s.nextSibling);s.pmViewDesc&&(s.pmViewDesc=void 0)}let o=new $de(this,s,r,i);e.input.compositionNodes.push(o),this.children=AC(this.children,n,n+i.length,e,o)}update(e,r,n,i){return this.dirty==ea||!e.sameMarkup(this.node)?!1:(this.updateInner(e,r,n,i),!0)}updateInner(e,r,n,i){this.updateOuterDeco(r),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=Ms}updateOuterDeco(e){if(cx(e,this.outerDeco))return;let r=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=u$(this.dom,this.nodeDOM,MC(this.outerDeco,this.node,r),MC(e,this.node,r)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function KE(t,e,r,n,i){d$(n,e,t);let s=new oc(void 0,t,e,r,n,n,n,i,0);return s.contentDOM&&s.updateChildren(i,0),s}class aw extends oc{constructor(e,r,n,i,s,o,a){super(e,r,n,i,s,null,o,a,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,r,n,i){return this.dirty==ea||this.dirty!=Ms&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(r),(this.dirty!=Ms||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=Ms,!0)}inParent(){let e=this.parent.contentDOM;for(let r=this.nodeDOM;r;r=r.parentNode)if(r==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,r,n){return e==this.nodeDOM?this.posAtStart+Math.min(r,this.node.text.length):super.localPosFromDOM(e,r,n)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,r,n){let i=this.node.cut(e,r),s=document.createTextNode(i.text);return new aw(this.parent,i,this.outerDeco,this.innerDeco,s,s,n)}markDirty(e,r){super.markDirty(e,r),this.dom!=this.nodeDOM&&(e==0||r==this.nodeDOM.nodeValue.length)&&(this.dirty=ea)}get domAtom(){return!1}isText(e){return this.node.text==e}}class c$ extends T1{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Ms&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class zde extends oc{constructor(e,r,n,i,s,o,a,l,c,h){super(e,r,n,i,s,o,a,c,h),this.spec=l}update(e,r,n,i){if(this.dirty==ea)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let s=this.spec.update(e,r,n);return s&&this.updateInner(e,r,n,i),s}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,r,n,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,r,n,i){this.spec.setSelection?this.spec.setSelection(e,r,n.root):super.setSelection(e,r,n,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function h$(t,e,r){let n=t.firstChild,i=!1;for(let s=0;s<e.length;s++){let o=e[s],a=o.dom;if(a.parentNode==t){for(;a!=n;)n=YE(n),i=!0;n=n.nextSibling}else i=!0,t.insertBefore(a,n);if(o instanceof uu){let l=n?n.previousSibling:t.lastChild;h$(o.contentDOM,o.children,r),n=l?l.nextSibling:t.firstChild}}for(;n;)n=YE(n),i=!0;i&&r.trackWrites==t&&(r.trackWrites=null)}const lm=function(t){t&&(this.nodeName=t)};lm.prototype=Object.create(null);const gh=[new lm];function MC(t,e,r){if(t.length==0)return gh;let n=r?gh[0]:new lm,i=[n];for(let s=0;s<t.length;s++){let o=t[s].type.attrs;if(o){o.nodeName&&i.push(n=new lm(o.nodeName));for(let a in o){let l=o[a];l!=null&&(r&&i.length==1&&i.push(n=new lm(e.isInline?"span":"div")),a=="class"?n.class=(n.class?n.class+" ":"")+l:a=="style"?n.style=(n.style?n.style+";":"")+l:a!="nodeName"&&(n[a]=l))}}}return i}function u$(t,e,r,n){if(r==gh&&n==gh)return e;let i=e;for(let s=0;s<n.length;s++){let o=n[s],a=r[s];if(s){let l;a&&a.nodeName==o.nodeName&&i!=t&&(l=i.parentNode)&&l.nodeName.toLowerCase()==o.nodeName||(l=document.createElement(o.nodeName),l.pmIsDeco=!0,l.appendChild(i),a=gh[0]),i=l}Hde(i,a||gh[0],o)}return i}function Hde(t,e,r){for(let n in e)n!="class"&&n!="style"&&n!="nodeName"&&!(n in r)&&t.removeAttribute(n);for(let n in r)n!="class"&&n!="style"&&n!="nodeName"&&r[n]!=e[n]&&t.setAttribute(n,r[n]);if(e.class!=r.class){let n=e.class?e.class.split(" ").filter(Boolean):[],i=r.class?r.class.split(" ").filter(Boolean):[];for(let s=0;s<n.length;s++)i.indexOf(n[s])==-1&&t.classList.remove(n[s]);for(let s=0;s<i.length;s++)n.indexOf(i[s])==-1&&t.classList.add(i[s]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=r.style){if(e.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=n.exec(e.style);)t.style.removeProperty(i[1])}r.style&&(t.style.cssText+=r.style)}}function d$(t,e,r){return u$(t,t,gh,MC(e,r,t.nodeType!=1))}function cx(t,e){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!t[r].type.eq(e[r].type))return!1;return!0}function YE(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class qde{constructor(e,r,n){this.lock=r,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=Vde(e.node.content,e)}destroyBetween(e,r){if(e!=r){for(let n=e;n<r;n++)this.top.children[n].destroy();this.top.children.splice(e,r-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,r,n){let i=0,s=this.stack.length>>1,o=Math.min(s,e.length);for(;i<o&&(i==s-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<s;)this.destroyRest(),this.top.dirty=Ms,this.index=this.stack.pop(),this.top=this.stack.pop(),s--;for(;s<e.length;){this.stack.push(this.top,this.index+1);let a=-1;for(let l=this.index;l<Math.min(this.index+3,this.top.children.length);l++){let c=this.top.children[l];if(c.matchesMark(e[s])&&!this.isLocked(c.dom)){a=l;break}}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=uu.create(this.top,e[s],r,n);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,s++}}findNodeMatch(e,r,n,i){let s=-1,o;if(i>=this.preMatch.index&&(o=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&o.matchesNode(e,r,n))s=this.top.children.indexOf(o,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a<l;a++){let c=this.top.children[a];if(c.matchesNode(e,r,n)&&!this.preMatch.matched.has(c)){s=a;break}}return s<0?!1:(this.destroyBetween(this.index,s),this.index++,!0)}updateNodeAt(e,r,n,i,s){let o=this.top.children[i];return o.dirty==ea&&o.dom==o.contentDOM&&(o.dirty=mh),o.update(e,r,n,s)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(e){for(;;){let r=e.parentNode;if(!r)return-1;if(r==this.top.contentDOM){let n=e.pmViewDesc;if(n){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==n)return i}return-1}e=r}}updateNextNode(e,r,n,i,s,o){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof oc){let c=this.preMatch.matched.get(l);if(c!=null&&c!=s)return!1;let h=l.dom,u,d=this.isLocked(h)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=ea&&cx(r,l.outerDeco));if(!d&&l.update(e,r,n,i))return this.destroyBetween(this.index,a),l.dom!=h&&(this.changed=!0),this.index++,!0;if(!d&&(u=this.recreateWrapper(l,e,r,n,i,o)))return this.destroyBetween(this.index,a),this.top.children[this.index]=u,u.contentDOM&&(u.dirty=mh,u.updateChildren(i,o+1),u.dirty=Ms),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,r,n,i,s,o){if(e.dirty||r.isAtom||!e.children.length||!e.node.content.eq(r.content)||!cx(n,e.outerDeco)||!i.eq(e.innerDeco))return null;let a=oc.create(this.top,r,n,i,s,o);if(a.contentDOM){a.children=e.children,e.children=[];for(let l of a.children)l.parent=a}return e.destroy(),a}addNode(e,r,n,i,s){let o=oc.create(this.top,e,r,n,i,s);o.contentDOM&&o.updateChildren(i,s+1),this.top.children.splice(this.index++,0,o),this.changed=!0}placeWidget(e,r,n){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(e)&&(e==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let s=new l$(this.top,e,r,n);this.top.children.splice(this.index++,0,s),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],r=this.top;for(;e instanceof uu;)r=e,e=r.children[r.children.length-1];(!e||!(e instanceof aw)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((ci||Nn)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",r),this.addHackNode("BR",this.top))}addHackNode(e,r){if(r==this.top&&this.index<r.children.length&&r.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);e=="IMG"&&(n.className="ProseMirror-separator",n.alt=""),e=="BR"&&(n.className="ProseMirror-trailingBreak");let i=new c$(this.top,[],n,null);r!=this.top?r.children.push(i):r.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function Vde(t,e){let r=e,n=r.children.length,i=t.childCount,s=new Map,o=[];e:for(;i>0;){let a;for(;;)if(n){let c=r.children[n-1];if(c instanceof uu)r=c,n=c.children.length;else{a=c,n--;break}}else{if(r==e)break e;n=r.parent.children.indexOf(r),r=r.parent}let l=a.node;if(l){if(l!=t.child(i-1))break;--i,s.set(a,i),o.push(a)}}return{index:i,matched:s,matches:o.reverse()}}function Wde(t,e){return t.type.side-e.type.side}function jde(t,e,r,n){let i=e.locals(t),s=0;if(i.length==0){for(let c=0;c<t.childCount;c++){let h=t.child(c);n(h,i,e.forChild(s,h),c),s+=h.nodeSize}return}let o=0,a=[],l=null;for(let c=0;;){let h,u;for(;o<i.length&&i[o].to==s;){let g=i[o++];g.widget&&(h?(u||(u=[h])).push(g):h=g)}if(h)if(u){u.sort(Wde);for(let g=0;g<u.length;g++)r(u[g],c,!!l)}else r(h,c,!!l);let d,f;if(l)f=-1,d=l,l=null;else if(c<t.childCount)f=c,d=t.child(c++);else break;for(let g=0;g<a.length;g++)a[g].to<=s&&a.splice(g--,1);for(;o<i.length&&i[o].from<=s&&i[o].to>s;)a.push(i[o++]);let p=s+d.nodeSize;if(d.isText){let g=p;o<i.length&&i[o].from<g&&(g=i[o].from);for(let y=0;y<a.length;y++)a[y].to<g&&(g=a[y].to);g<p&&(l=d.cut(g-s),d=d.cut(0,g-s),p=g,f=-1)}else for(;o<i.length&&i[o].to<p;)o++;let m=d.isInline&&!d.isLeaf?a.filter(g=>!g.inline):a.slice();n(d,m,e.forChild(s,d),f),s=p}}function Ude(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function Gde(t,e,r,n){for(let i=0,s=0;i<t.childCount&&s<=n;){let o=t.child(i++),a=s;if(s+=o.nodeSize,!o.isText)continue;let l=o.text;for(;i<t.childCount;){let c=t.child(i++);if(s+=c.nodeSize,!c.isText)break;l+=c.text}if(s>=r){if(s>=n&&l.slice(n-e.length-a,n-a)==e)return n-e.length;let c=a<n?l.lastIndexOf(e,n-a-1):-1;if(c>=0&&c+e.length+a>=r)return a+c;if(r==n&&l.length>=n+e.length-a&&l.slice(n-a,n-a+e.length)==e)return n}}return-1}function AC(t,e,r,n,i){let s=[];for(let o=0,a=0;o<t.length;o++){let l=t[o],c=a,h=a+=l.size;c>=r||h<=e?s.push(l):(c<e&&s.push(l.slice(0,e-c,n)),i&&(s.push(i),i=void 0),h>r&&s.push(l.slice(r-c,l.size,n)))}return s}function _7(t,e=null){let r=t.domSelectionRange(),n=t.state.doc;if(!r.focusNode)return null;let i=t.docView.nearestDesc(r.focusNode),s=i&&i.size==0,o=t.docView.posFromDOM(r.focusNode,r.focusOffset,1);if(o<0)return null;let a=n.resolve(o),l,c;if(ow(r)){for(l=o;i&&!i.node;)i=i.parent;let u=i.node;if(i&&u.isAtom&&lt.isSelectable(u)&&i.parent&&!(u.isInline&&xde(r.focusNode,r.focusOffset,i.dom))){let d=i.posBefore;c=new lt(o==d?a:n.resolve(d))}}else{if(r instanceof t.dom.ownerDocument.defaultView.Selection&&r.rangeCount>1){let u=o,d=o;for(let f=0;f<r.rangeCount;f++){let p=r.getRangeAt(f);u=Math.min(u,t.docView.posFromDOM(p.startContainer,p.startOffset,1)),d=Math.max(d,t.docView.posFromDOM(p.endContainer,p.endOffset,-1))}if(u<0)return null;[l,o]=d==t.state.selection.anchor?[d,u]:[u,d],a=n.resolve(o)}else l=t.docView.posFromDOM(r.anchorNode,r.anchorOffset,1);if(l<0)return null}let h=n.resolve(l);if(!c){let u=e=="pointer"||t.state.selection.head<a.pos&&!s?1:-1;c=M7(t,h,a,u)}return c}function f$(t){return t.editable?t.hasFocus():m$(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Ja(t,e=!1){let r=t.state.selection;if(p$(t,r),!!f$(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&Nn){let n=t.domSelectionRange(),i=t.domObserver.currentSelection;if(n.anchorNode&&i.anchorNode&&hu(n.anchorNode,n.anchorOffset,i.anchorNode,i.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)Yde(t);else{let{anchor:n,head:i}=r,s,o;XE&&!(r instanceof Je)&&(r.$from.parent.inlineContent||(s=JE(t,r.from)),!r.empty&&!r.$from.parent.inlineContent&&(o=JE(t,r.to))),t.docView.setSelection(n,i,t,e),XE&&(s&&ZE(s),o&&ZE(o)),r.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&Kde(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const XE=ci||Nn&&t$<63;function JE(t,e){let{node:r,offset:n}=t.docView.domFromPos(e,0),i=n<r.childNodes.length?r.childNodes[n]:null,s=n?r.childNodes[n-1]:null;if(ci&&i&&i.contentEditable=="false")return T5(i);if((!i||i.contentEditable=="false")&&(!s||s.contentEditable=="false")){if(i)return T5(i);if(s)return T5(s)}}function T5(t){return t.contentEditable="true",ci&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function ZE(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function Kde(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let r=t.domSelectionRange(),n=r.anchorNode,i=r.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(r.anchorNode!=n||r.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!f$(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function Yde(t){let e=t.domSelection(),r=document.createRange();if(!e)return;let n=t.cursorWrapper.dom,i=n.nodeName=="IMG";i?r.setStart(n.parentNode,kn(n)+1):r.setStart(n,0),r.collapse(!0),e.removeAllRanges(),e.addRange(r),!i&&!t.state.selection.visible&&Bi&&sc<=11&&(n.disabled=!0,n.disabled=!1)}function p$(t,e){if(e instanceof lt){let r=t.docView.descAt(e.from);r!=t.lastSelectedViewDesc&&(QE(t),r&&r.selectNode(),t.lastSelectedViewDesc=r)}else QE(t)}function QE(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function M7(t,e,r,n){return t.someProp("createSelectionBetween",i=>i(t,e,r))||Je.between(e,r,n)}function eO(t){return t.editable&&!t.hasFocus()?!1:m$(t)}function m$(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function Xde(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),r=t.domSelectionRange();return hu(e.node,e.offset,r.anchorNode,r.anchorOffset)}function EC(t,e){let{$anchor:r,$head:n}=t.selection,i=e>0?r.max(n):r.min(n),s=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return s&&gt.findFrom(s,e)}function Nl(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function tO(t,e,r){let n=t.state.selection;if(n instanceof Je)if(r.indexOf("s")>-1){let{$head:i}=n,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;let o=t.state.doc.resolve(i.pos+s.nodeSize*(e<0?-1:1));return Nl(t,new Je(n.$anchor,o))}else if(n.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=EC(t.state,e);return i&&i instanceof lt?Nl(t,i):!1}else if(!(ys&&r.indexOf("m")>-1)){let i=n.$head,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,o;if(!s||s.isText)return!1;let a=e<0?i.pos-s.nodeSize:i.pos;return s.isAtom||(o=t.docView.descAt(a))&&!o.contentDOM?lt.isSelectable(s)?Nl(t,new lt(e<0?t.state.doc.resolve(i.pos-s.nodeSize):i)):S1?Nl(t,new Je(t.state.doc.resolve(e<0?a:a+s.nodeSize))):!1:!1}}else return!1;else{if(n instanceof lt&&n.node.isInline)return Nl(t,new Je(e>0?n.$to:n.$from));{let i=EC(t.state,e);return i?Nl(t,i):!1}}}function hx(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function cm(t,e){let r=t.pmViewDesc;return r&&r.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function Vu(t,e){return e<0?Jde(t):Zde(t)}function Jde(t){let e=t.domSelectionRange(),r=e.focusNode,n=e.focusOffset;if(!r)return;let i,s,o=!1;for(lo&&r.nodeType==1&&n<hx(r)&&cm(r.childNodes[n],-1)&&(o=!0);;)if(n>0){if(r.nodeType!=1)break;{let a=r.childNodes[n-1];if(cm(a,-1))i=r,s=--n;else if(a.nodeType==3)r=a,n=r.nodeValue.length;else break}}else{if(g$(r))break;{let a=r.previousSibling;for(;a&&cm(a,-1);)i=r.parentNode,s=kn(a),a=a.previousSibling;if(a)r=a,n=hx(r);else{if(r=r.parentNode,r==t.dom)break;n=0}}}o?OC(t,r,n):i&&OC(t,i,s)}function Zde(t){let e=t.domSelectionRange(),r=e.focusNode,n=e.focusOffset;if(!r)return;let i=hx(r),s,o;for(;;)if(n<i){if(r.nodeType!=1)break;let a=r.childNodes[n];if(cm(a,1))s=r,o=++n;else break}else{if(g$(r))break;{let a=r.nextSibling;for(;a&&cm(a,1);)s=a.parentNode,o=kn(a)+1,a=a.nextSibling;if(a)r=a,n=0,i=hx(r);else{if(r=r.parentNode,r==t.dom)break;n=i=0}}}s&&OC(t,s,o)}function g$(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function Qde(t,e){for(;t&&e==t.childNodes.length&&!C1(t);)e=kn(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let r=t.childNodes[e];if(r.nodeType==3)return r;if(r.nodeType==1&&r.contentEditable=="false")break;t=r,e=0}}function efe(t,e){for(;t&&!e&&!C1(t);)e=kn(t),t=t.parentNode;for(;t&&e;){let r=t.childNodes[e-1];if(r.nodeType==3)return r;if(r.nodeType==1&&r.contentEditable=="false")break;t=r,e=t.childNodes.length}}function OC(t,e,r){if(e.nodeType!=3){let s,o;(o=Qde(e,r))?(e=o,r=0):(s=efe(e,r))&&(e=s,r=s.nodeValue.length)}let n=t.domSelection();if(!n)return;if(ow(n)){let s=document.createRange();s.setEnd(e,r),s.setStart(e,r),n.removeAllRanges(),n.addRange(s)}else n.extend&&n.extend(e,r);t.domObserver.setCurSelection();let{state:i}=t;setTimeout(()=>{t.state==i&&Ja(t)},50)}function rO(t,e){let r=t.state.doc.resolve(e);if(!(Nn||kde)&&r.parent.inlineContent){let i=t.coordsAtPos(e);if(e>r.start()){let s=t.coordsAtPos(e-1),o=(s.top+s.bottom)/2;if(o>i.top&&o<i.bottom&&Math.abs(s.left-i.left)>1)return s.left<i.left?"ltr":"rtl"}if(e<r.end()){let s=t.coordsAtPos(e+1),o=(s.top+s.bottom)/2;if(o>i.top&&o<i.bottom&&Math.abs(s.left-i.left)>1)return s.left>i.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function nO(t,e,r){let n=t.state.selection;if(n instanceof Je&&!n.empty||r.indexOf("s")>-1||ys&&r.indexOf("m")>-1)return!1;let{$from:i,$to:s}=n;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let o=EC(t.state,e);if(o&&o instanceof lt)return Nl(t,o)}if(!i.parent.inlineContent){let o=e<0?i:s,a=n instanceof Ii?gt.near(o,e):gt.findFrom(o,e);return a?Nl(t,a):!1}return!1}function iO(t,e){if(!(t.state.selection instanceof Je))return!0;let{$head:r,$anchor:n,empty:i}=t.state.selection;if(!r.sameParent(n))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let s=!r.textOffset&&(e<0?r.nodeBefore:r.nodeAfter);if(s&&!s.isText){let o=t.state.tr;return e<0?o.delete(r.pos-s.nodeSize,r.pos):o.delete(r.pos,r.pos+s.nodeSize),t.dispatch(o),!0}return!1}function sO(t,e,r){t.domObserver.stop(),e.contentEditable=r,t.domObserver.start()}function tfe(t){if(!ci||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:r}=t.domSelectionRange();if(e&&e.nodeType==1&&r==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let n=e.firstChild;sO(t,n,"true"),setTimeout(()=>sO(t,n,"false"),20)}return!1}function rfe(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function nfe(t,e){let r=e.keyCode,n=rfe(e);if(r==8||ys&&r==72&&n=="c")return iO(t,-1)||Vu(t,-1);if(r==46&&!e.shiftKey||ys&&r==68&&n=="c")return iO(t,1)||Vu(t,1);if(r==13||r==27)return!0;if(r==37||ys&&r==66&&n=="c"){let i=r==37?rO(t,t.state.selection.from)=="ltr"?-1:1:-1;return tO(t,i,n)||Vu(t,i)}else if(r==39||ys&&r==70&&n=="c"){let i=r==39?rO(t,t.state.selection.from)=="ltr"?1:-1:1;return tO(t,i,n)||Vu(t,i)}else{if(r==38||ys&&r==80&&n=="c")return nO(t,-1,n)||Vu(t,-1);if(r==40||ys&&r==78&&n=="c")return tfe(t)||nO(t,1,n)||Vu(t,1);if(n==(ys?"m":"c")&&(r==66||r==73||r==89||r==90))return!0}return!1}function A7(t,e){t.someProp("transformCopied",f=>{e=f(e,t)});let r=[],{content:n,openStart:i,openEnd:s}=e;for(;i>1&&s>1&&n.childCount==1&&n.firstChild.childCount==1;){i--,s--;let f=n.firstChild;r.push(f.type.name,f.attrs!=f.type.defaultAttrs?f.attrs:null),n=f.content}let o=t.someProp("clipboardSerializer")||_u.fromSchema(t.state.schema),a=k$(),l=a.createElement("div");l.appendChild(o.serializeFragment(n,{document:a}));let c=l.firstChild,h,u=0;for(;c&&c.nodeType==1&&(h=w$[c.nodeName.toLowerCase()]);){for(let f=h.length-1;f>=0;f--){let p=a.createElement(h[f]);for(;l.firstChild;)p.appendChild(l.firstChild);l.appendChild(p),u++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${i} ${s}${u?` -${u}`:""} ${JSON.stringify(r)}`);let d=t.someProp("clipboardTextSerializer",f=>f(e,t))||e.content.textBetween(0,e.content.size,`
86
87`);return{dom:l,text:d,slice:e}}function y$(t,e,r,n,i){let s=i.parent.type.spec.code,o,a;if(!r&&!e)return null;let l=e&&(n||s||!r);if(l){if(t.someProp("transformPastedText",d=>{e=d(e,s||n,t)}),s)return e?new Ie(Se.from(t.state.schema.text(e.replace(/\r\n?/g,`
88`))),0,0):Ie.empty;let u=t.someProp("clipboardTextParser",d=>d(e,i,n,t));if(u)a=u;else{let d=i.marks(),{schema:f}=t.state,p=_u.fromSchema(f);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(m=>{let g=o.appendChild(document.createElement("p"));m&&g.appendChild(p.serializeNode(f.text(m,d)))})}}else t.someProp("transformPastedHTML",u=>{r=u(r,t)}),o=afe(r),S1&&lfe(o);let c=o&&o.querySelector("[data-pm-slice]"),h=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(h&&h[3])for(let u=+h[3];u>0;u--){let d=o.firstChild;for(;d&&d.nodeType!=1;)d=d.nextSibling;if(!d)break;o=d}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||au.fromSchema(t.state.schema)).parseSlice(o,{preserveWhitespace:!!(l||h),context:i,ruleFromNode(d){return d.nodeName=="BR"&&!d.nextSibling&&d.parentNode&&!ife.test(d.parentNode.nodeName)?{ignore:!0}:null}})),h)a=cfe(oO(a,+h[1],+h[2]),h[4]);else if(a=Ie.maxOpen(sfe(a.content,i),!0),a.openStart||a.openEnd){let u=0,d=0;for(let f=a.content.firstChild;u<a.openStart&&!f.type.spec.isolating;u++,f=f.firstChild);for(let f=a.content.lastChild;d<a.openEnd&&!f.type.spec.isolating;d++,f=f.lastChild);a=oO(a,u,d)}return t.someProp("transformPasted",u=>{a=u(a,t)}),a}const ife=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function sfe(t,e){if(t.childCount<2)return t;for(let r=e.depth;r>=0;r--){let i=e.node(r).contentMatchAt(e.index(r)),s,o=[];if(t.forEach(a=>{if(!o)return;let l=i.findWrapping(a.type),c;if(!l)return o=null;if(c=o.length&&s.length&&x$(l,s,a,o[o.length-1],0))o[o.length-1]=c;else{o.length&&(o[o.length-1]=v$(o[o.length-1],s.length));let h=b$(a,l);o.push(h),i=i.matchType(h.type),s=l}}),o)return Se.from(o)}return t}function b$(t,e,r=0){for(let n=e.length-1;n>=r;n--)t=e[n].create(null,Se.from(t));return t}function x$(t,e,r,n,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let s=x$
vendor: 5,374 bytes, line 88
88(t,e,r,n.lastChild,i+1);if(s)return n.copy(n.content.replaceChild(n.childCount-1,s));if(n.contentMatchAt(n.childCount).matchType(i==t.length-1?r.type:t[i+1]))return n.copy(n.content.append(Se.from(b$(r,t,i+1))))}}function v$(t,e){if(e==0)return t;let r=t.content.replaceChild(t.childCount-1,v$(t.lastChild,e-1)),n=t.contentMatchAt(t.childCount).fillBefore(Se.empty,!0);return t.copy(r.append(n))}function LC(t,e,r,n,i,s){let o=e<0?t.firstChild:t.lastChild,a=o.content;return t.childCount>1&&(s=0),i<n-1&&(a=LC(a,e,r,n,i+1,s)),i>=r&&(a=e<0?o.contentMatchAt(0).fillBefore(a,s<=i).append(a):a.append(o.contentMatchAt(o.childCount).fillBefore(Se.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,o.copy(a))}function oO(t,e,r){return e<t.openStart&&(t=new Ie(LC(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),r<t.openEnd&&(t=new Ie(LC(t.content,1,r,t.openEnd,0,0),t.openStart,r)),t}const w$={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let aO=null;function k$(){return aO||(aO=document.implementation.createHTMLDocument("title"))}let _5=null;function ofe(t){let e=window.trustedTypes;return e?(_5||(_5=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:r=>r})),_5.createHTML(t)):t}function afe(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let r=k$().createElement("div"),n=/<([a-z][^>\s]+)/i.exec(t),i;if((i=n&&w$[n[1].toLowerCase()])&&(t=i.map(s=>"<"+s+">").join("")+t+i.map(s=>"</"+s+">").reverse().join("")),r.innerHTML=ofe(t),i)for(let s=0;s<i.length;s++)r=r.querySelector(i[s])||r;return r}function lfe(t){let e=t.querySelectorAll(Nn?"span:not([class]):not([style])":"span.Apple-converted-space");for(let r=0;r<e.length;r++){let n=e[r];n.childNodes.length==1&&n.textContent==" "&&n.parentNode&&n.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),n)}}function cfe(t,e){if(!t.size)return t;let r=t.content.firstChild.type.schema,n;try{n=JSON.parse(e)}catch{return t}let{content:i,openStart:s,openEnd:o}=t;for(let a=n.length-2;a>=0;a-=2){let l=r.nodes[n[a]];if(!l||l.hasRequiredAttrs())break;i=Se.from(l.create(n[a+1],i)),s++,o++}return new Ie(i,s,o)}const hi={},ui={},hfe={touchstart:!0,touchmove:!0};class ufe{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function dfe(t){for(let e in hi){let r=hi[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=n=>{pfe(t,n)&&!E7(t,n)&&(t.editable||!(n.type in ui))&&r(t,n)},hfe[e]?{passive:!0}:void 0)}ci&&t.dom.addEventListener("input",()=>null),DC(t)}function ec(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function ffe(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function DC(t){t.someProp("handleDOMEvents",e=>{for(let r in e)t.input.eventHandlers[r]||t.dom.addEventListener(r,t.input.eventHandlers[r]=n=>E7(t,n))})}function E7(t,e){return t.someProp("handleDOMEvents",r=>{let n=r[e.type];return n?n(t,e)||e.defaultPrevented:!1})}function pfe(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let r=e.target;r!=t.dom;r=r.parentNode)if(!r||r.nodeType==11||r.pmViewDesc&&r.pmViewDesc.stopEvent(e))return!1;return!0}function mfe(t,e){!E7(t,e)&&hi[e.type]&&(t.editable||!(e.type in ui))&&hi[e.type](t,e)}ui.keydown=(t,e)=>{let r=e;if(t.input.shiftKey=r.keyCode==16||r.shiftKey,!S$(t,r)&&(t.input.lastKeyCode=r.keyCode,t.input.lastKeyCodeTime=Date.now(),!(ja&&Nn&&r.keyCode==13)))if(r.keyCode!=229&&t.domObserver.forceFlush(),_f&&r.keyCode==13&&!r.ctrlKey&&!r.altKey&&!r.metaKey){let n=Date.now();t.input.lastIOSEnter=n,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==n&&(t.someProp("handleKeyDown",i=>i(t,hh(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",n=>n(t,r))||nfe(t,r)?r.preventDefault():ec(t,"key")};ui.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};ui.keypress=(t,e)=>{let r=e;if(S$(t,r)||!r.charCode||r.ctrlKey&&!r.altKey||ys&&r.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,r))){r.preventDefault();return}let n=t.state.selection;if(!(n instanceof Je)||!n.$from.sameParent(n.$to)){let i=String.fromCharCode(r.charCode),s=()=>t.state.tr.insertText(i).scrollIntoView();!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",o=>o(t,n.$from.pos,n.$to.pos,i,s))&&t.dispatch(s()),r.preventDefault()}};function lw(t){return{left:t.clientX,top:t.clientY}}function gfe(t,e){let r=e.x-t.clientX,n=e.y-t.clientY;return r*r+n*n<100}function O7(t,e,r,n,i){if(n==-1)return!1;let s=t.state.doc.resolve(n);for(let o=s.depth+1;o>0;o--)if(t.someProp(e,a=>o>s.depth?a(t,r,s.nodeAfter,s.before(o),i,!0):a(t,r,s.node(o),s.before(o),i,!1)))return!0;return!1}
vendor: 29,219 bytes, line 88
88function xd(t,e,r){if(t.focused||t.focus(),t.state.selection.eq(e))return;let n=t.state.tr.setSelection(e);n.setMeta("pointer",!0),t.dispatch(n)}function yfe(t,e){if(e==-1)return!1;let r=t.state.doc.resolve(e),n=r.nodeAfter;return n&&n.isAtom&&lt.isSelectable(n)?(xd(t,new lt(r)),!0):!1}function bfe(t,e){if(e==-1)return!1;let r=t.state.selection,n,i;r instanceof lt&&(n=r.node);let s=t.state.doc.resolve(e);for(let o=s.depth+1;o>0;o--){let a=o>s.depth?s.nodeAfter:s.node(o);if(lt.isSelectable(a)){n&&r.$from.depth>0&&o>=r.$from.depth&&s.before(r.$from.depth+1)==r.$from.pos?i=s.before(r.$from.depth):i=s.before(o);break}}return i!=null?(xd(t,lt.create(t.state.doc,i)),!0):!1}function xfe(t,e,r,n,i){return O7(t,"handleClickOn",e,r,n)||t.someProp("handleClick",s=>s(t,e,n))||(i?bfe(t,r):yfe(t,r))}function vfe(t,e,r,n){return O7(t,"handleDoubleClickOn",e,r,n)||t.someProp("handleDoubleClick",i=>i(t,e,n))}function wfe(t,e,r,n){return O7(t,"handleTripleClickOn",e,r,n)||t.someProp("handleTripleClick",i=>i(t,e,n))||kfe(t,r,n)}function kfe(t,e,r){if(r.button!=0)return!1;let n=t.state.doc;if(e==-1)return n.inlineContent?(xd(t,Je.create(n,0,n.content.size)),!0):!1;let i=n.resolve(e);for(let s=i.depth+1;s>0;s--){let o=s>i.depth?i.nodeAfter:i.node(s),a=i.before(s);if(o.inlineContent)xd(t,Je.create(n,a+1,a+1+o.content.size));else if(lt.isSelectable(o))xd(t,lt.create(n,a));else continue;return!0}}function L7(t){return ux(t)}const C$=ys?"metaKey":"ctrlKey";hi.mousedown=(t,e)=>{let r=e;t.input.shiftKey=r.shiftKey;let n=L7(t),i=Date.now(),s="singleClick";i-t.input.lastClick.time<500&&gfe(r,t.input.lastClick)&&!r[C$]&&t.input.lastClick.button==r.button&&(t.input.lastClick.type=="singleClick"?s="doubleClick":t.input.lastClick.type=="doubleClick"&&(s="tripleClick")),t.input.lastClick={time:i,x:r.clientX,y:r.clientY,type:s,button:r.button};let o=t.posAtCoords(lw(r));o&&(s=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new Cfe(t,o,r,!!n)):(s=="doubleClick"?vfe:wfe)(t,o.pos,o.inside,r)?r.preventDefault():ec(t,"pointer"))};class Cfe{constructor(e,r,n,i){this.view=e,this.pos=r,this.event=n,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[C$],this.allowDefault=n.shiftKey;let s,o;if(r.inside>-1)s=e.state.doc.nodeAt(r.inside),o=r.inside;else{let h=e.state.doc.resolve(r.pos);s=h.parent,o=h.depth?h.before():0}const a=i?null:n.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l&&l.dom.nodeType==1?l.dom:null;let{selection:c}=e.state;(n.button==0&&s.type.spec.draggable&&s.type.spec.selectable!==!1||c instanceof lt&&c.from<=o&&c.to>o)&&(this.mightDrag={node:s,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&lo&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),ec(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Ja(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let r=this.pos;this.view.state.doc!=this.startDoc&&(r=this.view.posAtCoords(lw(e))),this.updateAllowDefault(e),this.allowDefault||!r?ec(this.view,"pointer"):xfe(this.view,r.pos,r.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||ci&&this.mightDrag&&!this.mightDrag.node.isAtom||Nn&&!this.view.state.selection.visible&&Math.min(Math.abs(r.pos-this.view.state.selection.from),Math.abs(r.pos-this.view.state.selection.to))<=2)?(xd(this.view,gt.near(this.view.state.doc.resolve(r.pos))),e.preventDefault()):ec(this.view,"pointer")}move(e){this.updateAllowDefault(e),ec(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}hi.touchstart=t=>{t.input.lastTouch=Date.now(),L7(t),ec(t,"pointer")};hi.touchmove=t=>{t.input.lastTouch=Date.now(),ec(t,"pointer")};hi.contextmenu=t=>L7(t);function S$(t,e){return t.composing?!0:ci&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const Sfe=ja?5e3:-1;ui.compositionstart=ui.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,r=e.selection.$to;if(e.selection instanceof Je&&(e.storedMarks||!r.textOffset&&r.parentOffset&&r.nodeBefore.marks.some(n=>n.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||r.marks(),ux(t,!0),t.markCursor=null;else if(ux(t,!e.selection.empty),lo&&e.selection.empty&&r.parentOffset&&!r.textOffset&&r.nodeBefore.marks.length){let n=t.domSelectionRange();for(let i=n.focusNode,s=n.focusOffset;i&&i.nodeType==1&&s!=0;){let o=s<0?i.lastChild:i.childNodes[s-1];if(!o)break;if(o.nodeType==3){let a=t.domSelection();a&&a.collapse(o,o.nodeValue.length);break}else i=o,s=-1}}t.input.composing=!0}T$(t,Sfe)};ui.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,T$(t,20))};function T$(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>ux(t),e))}function _$(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=_fe());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function Tfe(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let r=yde(e.focusNode,e.focusOffset),n=bde(e.focusNode,e.focusOffset);if(r&&n&&r!=n){let i=n.pmViewDesc,s=t.domObserver.lastChangedTextNode;if(r==s||n==s)return s;if(!i||!i.isText(n.nodeValue))return n;if(t.input.compositionNode==n){let o=r.pmViewDesc;if(!(!o||!o.isText(r.nodeValue)))return n}}return r||n}function _fe(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function ux(t,e=!1){if(!(ja&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),_$(t),e||t.docView&&t.docView.dirty){let r=_7(t),n=t.state.selection;return r&&!r.eq(n)?t.dispatch(t.state.tr.setSelection(r)):(t.markCursor||e)&&!n.$from.node(n.$from.sharedDepth(n.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function Mfe(t,e){if(!t.dom.parentNode)return;let r=t.dom.parentNode.appendChild(document.createElement("div"));r.appendChild(e),r.style.cssText="position: fixed; left: -10000px; top: 10px";let n=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),n.removeAllRanges(),n.addRange(i),setTimeout(()=>{r.parentNode&&r.parentNode.removeChild(r),t.focus()},50)}const ag=Bi&&sc<15||_f&&Cde<604;hi.copy=ui.cut=(t,e)=>{let r=e,n=t.state.selection,i=r.type=="cut";if(n.empty)return;let s=ag?null:r.clipboardData,o=n.content(),{dom:a,text:l}=A7(t,o);s?(r.preventDefault(),s.clearData(),s.setData("text/html",a.innerHTML),s.setData("text/plain",l)):Mfe(t,a),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function Afe(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function Efe(t,e){if(!t.dom.parentNode)return;let r=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,n=t.dom.parentNode.appendChild(document.createElement(r?"textarea":"div"));r||(n.contentEditable="true"),n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus();let i=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),n.parentNode&&n.parentNode.removeChild(n),r?lg(t,n.value,null,i,e):lg(t,n.textContent,n.innerHTML,i,e)},50)}function lg(t,e,r,n,i){let s=y$(t,e,r,n,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,i,s||Ie.empty)))return!0;if(!s)return!1;let o=Afe(s),a=o?t.state.tr.replaceSelectionWith(o,n):t.state.tr.replaceSelection(s);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function M$(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let r=t.getData("text/uri-list");return r?r.replace(/\r?\n/g," "):""}ui.paste=(t,e)=>{let r=e;if(t.composing&&!ja)return;let n=ag?null:r.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;n&&lg(t,M$(n),n.getData("text/html"),i,r)?r.preventDefault():Efe(t,r)};class A${constructor(e,r,n){this.slice=e,this.move=r,this.node=n}}const Ofe=ys?"altKey":"ctrlKey";function E$(t,e){let r=t.someProp("dragCopies",n=>!n(e));return r??!e[Ofe]}hi.dragstart=(t,e)=>{let r=e,n=t.input.mouseDown;if(n&&n.done(),!r.dataTransfer)return;let i=t.state.selection,s=i.empty?null:t.posAtCoords(lw(r)),o;if(!(s&&s.pos>=i.from&&s.pos<=(i instanceof lt?i.to-1:i.to))){if(n&&n.mightDrag)o=lt.create(t.state.doc,n.mightDrag.pos);else if(r.target&&r.target.nodeType==1){let u=t.docView.nearestDesc(r.target,!0);u&&u.node.type.spec.draggable&&u!=t.docView&&(o=lt.create(t.state.doc,u.posBefore))}}let a=(o||t.state.selection).content(),{dom:l,text:c,slice:h}=A7(t,a);(!r.dataTransfer.files.length||!Nn||t$>120)&&r.dataTransfer.clearData(),r.dataTransfer.setData(ag?"Text":"text/html",l.innerHTML),r.dataTransfer.effectAllowed="copyMove",ag||r.dataTransfer.setData("text/plain",c),t.dragging=new A$(h,E$(t,r),o)};hi.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};ui.dragover=ui.dragenter=(t,e)=>e.preventDefault();ui.drop=(t,e)=>{let r=e,n=t.dragging;if(t.dragging=null,!r.dataTransfer)return;let i=t.posAtCoords(lw(r));if(!i)return;let s=t.state.doc.resolve(i.pos),o=n&&n.slice;o?t.someProp("transformPasted",p=>{o=p(o,t)}):o=y$(t,M$(r.dataTransfer),ag?null:r.dataTransfer.getData("text/html"),!1,s);let a=!!(n&&E$(t,r));if(t.someProp("handleDrop",p=>p(t,r,o||Ie.empty,a))){r.preventDefault();return}if(!o)return;r.preventDefault();let l=o?jN(t.state.doc,s.pos,o):s.pos;l==null&&(l=s.pos);let c=t.state.tr;if(a){let{node:p}=n;p?p.replace(c):c.deleteSelection()}let h=c.mapping.map(l),u=o.openStart==0&&o.openEnd==0&&o.content.childCount==1,d=c.doc;if(u?c.replaceRangeWith(h,h,o.content.firstChild):c.replaceRange(h,h,o),c.doc.eq(d))return;let f=c.doc.resolve(h);if(u&&lt.isSelectable(o.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(o.content.firstChild))c.setSelection(new lt(f));else{let p=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((m,g,y,b)=>p=b),c.setSelection(M7(t,f,c.doc.resolve(p)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))};hi.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Ja(t)},20))};hi.blur=(t,e)=>{let r=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),r.relatedTarget&&t.dom.contains(r.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};hi.beforeinput=(t,e)=>{if(Nn&&ja&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:n}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=n||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",s=>s(t,hh(8,"Backspace")))))return;let{$cursor:i}=t.state.selection;i&&i.pos>0&&t.dispatch(t.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let t in ui)hi[t]=ui[t];function cg(t,e){if(t==e)return!0;for(let r in t)if(t[r]!==e[r])return!1;for(let r in e)if(!(r in t))return!1;return!0}class dx{constructor(e,r){this.toDOM=e,this.spec=r||Hh,this.side=this.spec.side||0}map(e,r,n,i){let{pos:s,deleted:o}=e.mapResult(r.from+i,this.side<0?-1:1);return o?null:new Ur(s-n,s-n,this)}valid(){return!0}eq(e){return this==e||e instanceof dx&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&cg(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class ac{constructor(e,r){this.attrs=e,this.spec=r||Hh}map(e,r,n,i){let s=e.map(r.from+i,this.spec.inclusiveStart?-1:1)-n,o=e.map(r.to+i,this.spec.inclusiveEnd?1:-1)-n;return s>=o?null:new Ur(s,o,this)}valid(e,r){return r.from<r.to}eq(e){return this==e||e instanceof ac&&cg(this.attrs,e.attrs)&&cg(this.spec,e.spec)}static is(e){return e.type instanceof ac}destroy(){}}class D7{constructor(e,r){this.attrs=e,this.spec=r||Hh}map(e,r,n,i){let s=e.mapResult(r.from+i,1);if(s.deleted)return null;let o=e.mapResult(r.to+i,-1);return o.deleted||o.pos<=s.pos?null:new Ur(s.pos-n,o.pos-n,this)}valid(e,r){let{index:n,offset:i}=e.content.findIndex(r.from),s;return i==r.from&&!(s=e.child(n)).isText&&i+s.nodeSize==r.to}eq(e){return this==e||e instanceof D7&&cg(this.attrs,e.attrs)&&cg(this.spec,e.spec)}destroy(){}}class Ur{constructor(e,r,n){this.from=e,this.to=r,this.type=n}copy(e,r){return new Ur(e,r,this.type)}eq(e,r=0){return this.type.eq(e.type)&&this.from+r==e.from&&this.to+r==e.to}map(e,r,n){return this.type.map(e,this,r,n)}static widget(e,r,n){return new Ur(e,e,new dx(r,n))}static inline(e,r,n,i){return new Ur(e,r,new ac(n,i))}static node(e,r,n,i){return new Ur(e,r,new D7(n,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof ac}get widget(){return this.type instanceof dx}}const Zu=[],Hh={};class or{constructor(e,r){this.local=e.length?e:Zu,this.children=r.length?r:Zu}static create(e,r){return r.length?fx(r,e,0,Hh):In}find(e,r,n){let i=[];return this.findInner(e??0,r??1e9,i,0,n),i}findInner(e,r,n,i,s){for(let o=0;o<this.local.length;o++){let a=this.local[o];a.from<=r&&a.to>=e&&(!s||s(a.spec))&&n.push(a.copy(a.from+i,a.to+i))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<r&&this.children[o+1]>e){let a=this.children[o]+1;this.children[o+2].findInner(e-a,r-a,n,i+a,s)}}map(e,r,n){return this==In||e.maps.length==0?this:this.mapInner(e,r,0,0,n||Hh)}mapInner(e,r,n,i,s){let o;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(e,n,i);l&&l.type.valid(r,l)?(o||(o=[])).push(l):s.onRemove&&s.onRemove(this.local[a].spec)}return this.children.length?Lfe(this.children,o||[],e,r,n,i,s):o?new or(o.sort(qh),Zu):In}add(e,r){return r.length?this==In?or.create(e,r):this.addInner(e,r,0):this}addInner(e,r,n){let i,s=0;e.forEach((a,l)=>{let c=l+n,h;if(h=L$(r,a,c)){for(i||(i=this.children.slice());s<i.length&&i[s]<l;)s+=3;i[s]==l?i[s+2]=i[s+2].addInner(a,h,c+1):i.splice(s,0,l,l+a.nodeSize,fx(h,a,c+1,Hh)),s+=3}});let o=O$(s?D$(r):r,-n);for(let a=0;a<o.length;a++)o[a].type.valid(e,o[a])||o.splice(a--,1);return new or(o.length?this.local.concat(o).sort(qh):this.local,i||this.children)}remove(e){return e.length==0||this==In?this:this.removeInner(e,0)}removeInner(e,r){let n=this.children,i=this.local;for(let s=0;s<n.length;s+=3){let o,a=n[s]+r,l=n[s+1]+r;for(let h=0,u;h<e.length;h++)(u=e[h])&&u.from>a&&u.to<l&&(e[h]=null,(o||(o=[])).push(u));if(!o)continue;n==this.children&&(n=this.children.slice());let c=n[s+2].removeInner(o,a+1);c!=In?n[s+2]=c:(n.splice(s,3),s-=3)}if(i.length){for(let s=0,o;s<e.length;s++)if(o=e[s])for(let a=0;a<i.length;a++)i[a].eq(o,r)&&(i==this.local&&(i=this.local.slice()),i.splice(a--,1))}return n==this.children&&i==this.local?this:i.length||n.length?new or(i,n):In}forChild(e,r){if(this==In)return this;if(r.isLeaf)return or.empty;let n,i;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(n=this.children[a+2]);break}let s=e+1,o=s+r.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<o&&l.to>s&&l.type instanceof ac){let c=Math.max(s,l.from)-s,h=Math.min(o,l.to)-s;c<h&&(i||(i=[])).push(l.copy(c,h))}}if(i){let a=new or(i.sort(qh),Zu);return n?new Wl([a,n]):a}return n||In}eq(e){if(this==e)return!0;if(!(e instanceof or)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let r=0;r<this.local.length;r++)if(!this.local[r].eq(e.local[r]))return!1;for(let r=0;r<this.children.length;r+=3)if(this.children[r]!=e.children[r]||this.children[r+1]!=e.children[r+1]||!this.children[r+2].eq(e.children[r+2]))return!1;return!0}locals(e){return I7(this.localsInner(e))}localsInner(e){if(this==In)return Zu;if(e.inlineContent||!this.local.some(ac.is))return this.local;let r=[];for(let n=0;n<this.local.length;n++)this.local[n].type instanceof ac||r.push(this.local[n]);return r}forEachSet(e){e(this)}}or.empty=new or([],[]);or.removeOverlap=I7;const In=or.empty;class Wl{constructor(e){this.members=e}map(e,r){const n=this.members.map(i=>i.map(e,r,Hh));return Wl.from(n)}forChild(e,r){if(r.isLeaf)return or.empty;let n=[];for(let i=0;i<this.members.length;i++){let s=this.members[i].forChild(e,r);s!=In&&(s instanceof Wl?n=n.concat(s.members):n.push(s))}return Wl.from(n)}eq(e){if(!(e instanceof Wl)||e.members.length!=this.members.length)return!1;for(let r=0;r<this.members.length;r++)if(!this.members[r].eq(e.members[r]))return!1;return!0}locals(e){let r,n=!0;for(let i=0;i<this.members.length;i++){let s=this.members[i].localsInner(e);if(s.length)if(!r)r=s;else{n&&(r=r.slice(),n=!1);for(let o=0;o<s.length;o++)r.push(s[o])}}return r?I7(n?r:r.sort(qh)):Zu}static from(e){switch(e.length){case 0:return In;case 1:return e[0];default:return new Wl(e.every(r=>r instanceof or)?e:e.reduce((r,n)=>r.concat(n instanceof or?n:n.members),[]))}}forEachSet(e){for(let r=0;r<this.members.length;r++)this.members[r].forEachSet(e)}}function Lfe(t,e,r,n,i,s,o){let a=t.slice();for(let c=0,h=s;c<r.maps.length;c++){let u=0;r.maps[c].forEach((d,f,p,m)=>{let g=m-p-(f-d);for(let y=0;y<a.length;y+=3){let b=a[y+1];if(b<0||d>b+h-u)continue;let x=a[y]+h-u;f>=x?a[y+1]=d<=x?-2:-1:d>=h&&g&&(a[y]+=g,a[y+1]+=g)}u+=g}),h=r.maps[c].map(h,-1)}let l=!1;for(let c=0;c<a.length;c+=3)if(a[c+1]<0){if(a[c+1]==-2){l=!0,a[c+1]=-1;continue}let h=r.map(t[c]+s),u=h-i;if(u<0||u>=n.content.size){l=!0;continue}let d=r.map(t[c+1]+s,-1),f=d-i,{index:p,offset:m}=n.content.findIndex(u),g=n.maybeChild(p);if(g&&m==u&&m+g.nodeSize==f){let y=a[c+2].mapInner(r,g,h+1,t[c]+s+1,o);y!=In?(a[c]=u,a[c+1]=f,a[c+2]=y):(a[c+1]=-2,l=!0)}else l=!0}if(l){let c=Dfe(a,t,e,r,i,s,o),h=fx(c,n,0,o);e=h.local;for(let u=0;u<a.length;u+=3)a[u+1]<0&&(a.splice(u,3),u-=3);for(let u=0,d=0;u<h.children.length;u+=3){let f=h.children[u];for(;d<a.length&&a[d]<f;)d+=3;a.splice(d,0,h.children[u],h.children[u+1],h.children[u+2])}}return new or(e.sort(qh),a)}function O$(t,e){if(!e||!t.length)return t;let r=[];for(let n=0;n<t.length;n++){let i=t[n];r.push(new Ur(i.from+e,i.to+e,i.type))}return r}function Dfe(t,e,r,n,i,s,o){function a(l,c){for(let h=0;h<l.local.length;h++){let u=l.local[h].map(n,i,c);u?r.push(u):o.onRemove&&o.onRemove(l.local[h].spec)}for(let h=0;h<l.children.length;h+=3)a(l.children[h+2],l.children[h]+c+1)}for(let l=0;l<t.length;l+=3)t[l+1]==-1&&a(t[l+2],e[l]+s+1);return r}function L$(t,e,r){if(e.isLeaf)return null;let n=r+e.nodeSize,i=null;for(let s=0,o;s<t.length;s++)(o=t[s])&&o.from>r&&o.to<n&&((i||(i=[])).push(o),t[s]=null);return i}function D$(t){let e=[];for(let r=0;r<t.length;r++)t[r]!=null&&e.push(t[r]);return e}function fx(t,e,r,n){let i=[],s=!1;e.forEach((a,l)=>{let c=L$(t,a,l+r);if(c){s=!0;let h=fx(c,a,r+l+1,n);h!=In&&i.push(l,l+a.nodeSize,h)}});let o=O$(s?D$(t):t,-r).sort(qh);for(let a=0;a<o.length;a++)o[a].type.valid(e,o[a])||(n.onRemove&&n.onRemove(o[a].spec),o.splice(a--,1));return o.length||i.length?new or(o,i):In}function qh(t,e){return t.from-e.from||t.to-e.to}function I7(t){let e=t;for(let r=0;r<e.length-1;r++){let n=e[r];if(n.from!=n.to)for(let i=r+1;i<e.length;i++){let s=e[i];if(s.from==n.from){s.to!=n.to&&(e==t&&(e=t.slice()),e[i]=s.copy(s.from,n.to),lO(e,i+1,s.copy(n.to,s.to)));continue}else{s.from<n.to&&(e==t&&(e=t.slice()),e[r]=n.copy(n.from,s.from),lO(e,i,n.copy(s.from,n.to)));break}}}return e}function lO(t,e,r){for(;e<t.length&&qh(r,t[e])>0;)e++;t.splice(e,0,r)}function M5(t){let e=[];return t.someProp("decorations",r=>{let n=r(t.state);n&&n!=In&&e.push(n)}),t.cursorWrapper&&e.push(or.create(t.state.doc,[t.cursorWrapper.deco])),Wl.from(e)}const Ife={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Bfe=Bi&&sc<=11;class Rfe{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class Pfe{constructor(e,r){this.view=e,this.handleDOMChange=r,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Rfe,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(n=>{for(let i=0;i<n.length;i++)this.queue.push(n[i]);Bi&&sc<=11&&n.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),Bfe&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Ife)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let r=0;r<e.length;r++)this.queue.push(e[r]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(eO(this.view)){if(this.suppressingSelectionUpdates)return Ja(this.view);if(Bi&&sc<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&hu(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let r=new Set,n;for(let s=e.focusNode;s;s=Tf(s))r.add(s);for(let s=e.anchorNode;s;s=Tf(s))if(r.has(s)){n=s;break}let i=n&&this.view.docView.nearestDesc(n);if(i&&i.ignoreMutation({type:"selection",target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let r=this.pendingRecords();r.length&&(this.queue=[]);let n=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&eO(e)&&!this.ignoreSelectionChange(n),s=-1,o=-1,a=!1,l=[];if(e.editable)for(let h=0;h<r.length;h++){let u=this.registerMutation(r[h],l);u&&(s=s<0?u.from:Math.min(u.from,s),o=o<0?u.to:Math.max(u.to,o),u.typeOver&&(a=!0))}if(lo&&l.length){let h=l.filter(u=>u.nodeName=="BR");if(h.length==2){let[u,d]=h;u.parentNode&&u.parentNode.parentNode==d.parentNode?d.remove():u.remove()}else{let{focusNode:u}=this.currentSelection;for(let d of h){let f=d.parentNode;f&&f.nodeName=="LI"&&(!u||$fe(e,u)!=f)&&d.remove()}}}let c=null;s<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&ow(n)&&(c=_7(e))&&c.eq(gt.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Ja(e),this.currentSelection.set(n),e.scrollToSelection()):(s>-1||i)&&(s>-1&&(e.docView.markDirty(s,o),Nfe(e)),this.handleDOMChange(s,o,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||Ja(e),this.currentSelection.set(n))}registerMutation(e,r){if(r.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(n==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!n||n.ignoreMutation(e))return null;if(e.type=="childList"){for(let h=0;h<e.addedNodes.length;h++){let u=e.addedNodes[h];r.push(u),u.nodeType==3&&(this.lastChangedTextNode=u)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let i=e.previousSibling,s=e.nextSibling;if(Bi&&sc<=11&&e.addedNodes.length)for(let h=0;h<e.addedNodes.length;h++){let{previousSibling:u,nextSibling:d}=e.addedNodes[h];(!u||Array.prototype.indexOf.call(e.addedNodes,u)<0)&&(i=u),(!d||Array.prototype.indexOf.call(e.addedNodes,d)<0)&&(s=d)}let o=i&&i.parentNode==e.target?kn(i)+1:0,a=n.localPosFromDOM(e.target,o,-1),l=s&&s.parentNode==e.target?kn(s):e.target.childNodes.length,c=n.localPosFromDOM(e.target,l,1);return{from:a,to:c}}else return e.type=="attributes"?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let cO=new WeakMap,hO=!1;function Nfe(t){if(!cO.has(t)&&(cO.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=lo,hO)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),hO=!0}}function uO(t,e){let r=e.startContainer,n=e.startOffset,i=e.endContainer,s=e.endOffset,o=t.domAtPos(t.state.selection.anchor);return hu(o.node,o.offset,i,s)&&([r,n,i,s]=[i,s,r,n]),{anchorNode:r,anchorOffset:n,focusNode:i,focusOffset:s}}function Ffe(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return uO(t,i)}let r;function n(i){i.preventDefault(),i.stopImmediatePropagation(),r=i.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",n,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",n,!0),r?uO(t,r):null}function $fe(t,e){for(let r=e.parentNode;r&&r!=t.dom;r=r.parentNode){let n=t.docView.nearestDesc(r,!0);if(n&&n.node.isBlock)return r}return null}function zfe(t,e,r){let{node:n,fromOffset:i,toOffset:s,from:o,to:a}=t.docView.parseRange(e,r),l=t.domSelectionRange(),c,h=l.anchorNode;if(h&&t.dom.contains(h.nodeType==1?h:h.parentNode)&&(c=[{node:h,offset:l.anchorOffset}],ow(l)||c.push({node:l.focusNode,offset:l.focusOffset})),Nn&&t.input.lastKeyCode===8)for(let g=s;g>i;g--){let y=n.childNodes[g-1],b=y.pmViewDesc;if(y.nodeName=="BR"&&!b){s=g;break}if(!b||b.size)break}let u=t.state.doc,d=t.someProp("domParser")||au.fromSchema(t.state.schema),f=u.resolve(o),p=null,m=d.parse(n,{topNode:f.parent,topMatch:f.parent.contentMatchAt(f.index()),topOpen:!0,from:i,to:s,preserveWhitespace:f.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:Hfe,context:f});if(c&&c[0].pos!=null){let g=c[0].pos,y=c[1]&&c[1].pos;y==null&&(y=g),p={anchor:g+o,head:y+o}}return{doc:m,sel:p,from:o,to:a}}function Hfe(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(ci&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let r=document.createElement("div");return r.appendChild(document.createElement("li")),{skip:r}}else if(t.parentNode.lastChild==t||ci&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const qfe=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function Vfe(t,e,r,n,i){let s=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let L=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,B=_7(t,L);if(B&&!t.state.selection.eq(B)){if(Nn&&ja&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",D=>D(t,hh(13,"Enter"))))return;let E=t.state.tr.setSelection(B);L=="pointer"?E.setMeta("pointer",!0):L=="key"&&E.scrollIntoView(),s&&E.setMeta("composition",s),t.dis
vendor: 4,095 bytes, line 88
88patch(E)}return}let o=t.state.doc.resolve(e),a=o.sharedDepth(r);e=o.before(a+1),r=t.state.doc.resolve(r).after(a+1);let l=t.state.selection,c=zfe(t,e,r),h=t.state.doc,u=h.slice(c.from,c.to),d,f;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(d=t.state.selection.to,f="end"):(d=t.state.selection.from,f="start"),t.input.lastKeyCode=null;let p=Ufe(u.content,c.doc.content,c.from,d,f);if(p&&t.input.domChangeCount++,(_f&&t.input.lastIOSEnter>Date.now()-225||ja)&&i.some(L=>L.nodeType==1&&!qfe.test(L.nodeName))&&(!p||p.endA>=p.endB)&&t.someProp("handleKeyDown",L=>L(t,hh(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!p)if(n&&l instanceof Je&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))p={start:l.from,endA:l.to,endB:l.to};else{if(c.sel){let L=dO(t,t.state.doc,c.sel);if(L&&!L.eq(t.state.selection)){let B=t.state.tr.setSelection(L);s&&B.setMeta("composition",s),t.dispatch(B)}}return}t.state.selection.from<t.state.selection.to&&p.start==p.endB&&t.state.selection instanceof Je&&(p.start>t.state.selection.from&&p.start<=t.state.selection.from+2&&t.state.selection.from>=c.from?p.start=t.state.selection.from:p.endA<t.state.selection.to&&p.endA>=t.state.selection.to-2&&t.state.selection.to<=c.to&&(p.endB+=t.state.selection.to-p.endA,p.endA=t.state.selection.to)),Bi&&sc<=11&&p.endB==p.start+1&&p.endA==p.start&&p.start>c.from&&c.doc.textBetween(p.start-c.from-1,p.start-c.from+1)=="  "&&(p.start--,p.endA--,p.endB--);let m=c.doc.resolveNoCache(p.start-c.from),g=c.doc.resolveNoCache(p.endB-c.from),y=h.resolve(p.start),b=m.sameParent(g)&&m.parent.inlineContent&&y.end()>=p.endA,x;if((_f&&t.input.lastIOSEnter>Date.now()-225&&(!b||i.some(L=>L.nodeName=="DIV"||L.nodeName=="P"))||!b&&m.pos<c.doc.content.size&&(!m.sameParent(g)||!m.parent.inlineContent)&&!/\S/.test(c.doc.textBetween(m.pos,g.pos,"",""))&&(x=gt.findFrom(c.doc.resolve(m.pos+1),1,!0))&&x.head>m.pos)&&t.someProp("handleKeyDown",L=>L(t,hh(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>p.start&&jfe(h,p.start,p.endA,m,g)&&t.someProp("handleKeyDown",L=>L(t,hh(8,"Backspace")))){ja&&Nn&&t.domObserver.suppressSelectionUpdates();return}Nn&&p.endB==p.start&&(t.input.lastChromeDelete=Date.now()),ja&&!b&&m.start()!=g.start()&&g.parentOffset==0&&m.depth==g.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==p.endA&&(p.endB-=2,g=c.doc.resolveNoCache(p.endB-c.from),setTimeout(()=>{t.someProp("handleKeyDown",function(L){return L(t,hh(13,"Enter"))})},20));let S=p.start,k=p.endA,w=L=>{let B=L||t.state.tr.replace(S,k,c.doc.slice(p.start-c.from,p.endB-c.from));if(c.sel){let E=dO(t,B.doc,c.sel);E&&!(Nn&&t.composing&&E.empty&&(p.start!=p.endB||t.input.lastChromeDelete<Date.now()-100)&&(E.head==S||E.head==B.mapping.map(k)-1)||Bi&&E.empty&&E.head==S)&&B.setSelection(E)}return s&&B.setMeta("composition",s),B.scrollIntoView()},_;if(b){if(m.pos==g.pos){Bi&&sc<=11&&m.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Ja(t),20));let L=w(t.state.tr.delete(S,k)),B=h.resolve(p.start).marksAcross(h.resolve(p.endA));B&&L.ensureMarks(B),t.dispatch(L)}else if(p.endA==p.endB&&(_=Wfe(m.parent.content.cut(m.parentOffset,g.parentOffset),y.parent.content.cut(y.parentOffset,p.endA-y.start())))){let L=w(t.state.tr);_.type=="add"?L.addMark(S,k,_.mark):L.removeMark(S,k,_.mark),t.dispatch(L)}else if(m.parent.child(m.index()).isText&&m.index()==g.index()-(g.textOffset?0:1)){let L=m.parent.textBetween(m.parentOffset,g.parentOffset),B=()=>w(t.state.tr.insertText(L,S,k));t.someProp("handleTextInput",E=>E(t,S,k,L,B))||t.dispatch(B())}}else t.dispatch(w())}function dO(t,e,r){return Math.max(r.anchor,r.head)>e.content.size?null:M7(t,e.resolve(r.anchor),e.resolve(r.head))}function Wfe(t,e){let r=t.firstChild.marks,n=e.firstChild.marks,i=r,s=n,o,a,l;for(let h=0;h<n.length;h++)i=n[h].removeFromSet(i);for(let h=0;h<r.length;h++)s=r[h].removeFromSet(s);if(i.length==1&&s.length==0)a=i[0],o="add",l=h=>h.mark(a.addToSet(h.marks));else if(i.length==0&&s.length==1)a=s[0],o="remove",l=h=>h.mark(a.removeFromSet(h.marks));else return null;
vendor: 5,291 bytes, line 88
88let c=[];for(let h=0;h<e.childCount;h++)c.push(l(e.child(h)));if(Se.from(c).eq(t))return{mark:a,type:o}}function jfe(t,e,r,n,i){if(r-e<=i.pos-n.pos||A5(n,!0,!1)<i.pos)return!1;let s=t.resolve(e);if(!n.parent.isTextblock){let a=s.nodeAfter;return a!=null&&r==e+a.nodeSize}if(s.parentOffset<s.parent.content.size||!s.parent.isTextblock)return!1;let o=t.resolve(A5(s,!0,!0));return!o.parent.isTextblock||o.pos>r||A5(o,!0,!1)<r?!1:n.parent.content.cut(n.parentOffset).eq(o.parent.content)}function A5(t,e,r){let n=t.depth,i=e?t.end():t.pos;for(;n>0&&(e||t.indexAfter(n)==t.node(n).childCount);)n--,i++,e=!1;if(r){let s=t.node(n).maybeChild(t.indexAfter(n));for(;s&&!s.isLeaf;)s=s.firstChild,i++}return i}function Ufe(t,e,r,n,i){let s=t.findDiffStart(e,r);if(s==null)return null;let{a:o,b:a}=t.findDiffEnd(e,r+t.size,r+e.size);if(i=="end"){let l=Math.max(0,s-Math.min(o,a));n-=o+l-s}if(o<s&&t.size<e.size){let l=n<=s&&n>=o?s-n:0;s-=l,s&&s<e.size&&fO(e.textBetween(s-1,s+1))&&(s+=l?1:-1),a=s+(a-o),o=s}else if(a<s){let l=n<=s&&n>=a?s-n:0;s-=l,s&&s<t.size&&fO(t.textBetween(s-1,s+1))&&(s+=l?1:-1),o=s+(o-a),a=s}return{start:s,endA:o,endB:a}}function fO(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),r=t.charCodeAt(1);return e>=56320&&e<=57343&&r>=55296&&r<=56319}class B7{constructor(e,r){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new ufe,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=r,this.state=r.state,this.directPlugins=r.plugins||[],this.directPlugins.forEach(bO),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=gO(this),mO(this),this.nodeViews=yO(this),this.docView=KE(this.state.doc,pO(this),M5(this),this.dom,this),this.domObserver=new Pfe(this,(n,i,s,o)=>Vfe(this,n,i,s,o)),this.domObserver.start(),dfe(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let r in e)this._props[r]=e[r];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&DC(this);let r=this._props;this._props=e,e.plugins&&(e.plugins.forEach(bO),this.directPlugins=e.plugins),this.updateStateInner(e.state,r)}setProps(e){let r={};for(let n in this._props)r[n]=this._props[n];r.state=this.state;for(let n in e)r[n]=e[n];this.update(r)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,r){var n;let i=this.state,s=!1,o=!1;e.storedMarks&&this.composing&&(_$(this),o=!0),this.state=e;let a=i.plugins!=e.plugins||this._props.plugins!=r.plugins;if(a||this._props.plugins!=r.plugins||this._props.nodeViews!=r.nodeViews){let f=yO(this);Kfe(f,this.nodeViews)&&(this.nodeViews=f,s=!0)}(a||r.handleDOMEvents!=this._props.handleDOMEvents)&&DC(this),this.editable=gO(this),mO(this);let l=M5(this),c=pO(this),h=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",u=s||!this.docView.matchesNode(e.doc,c,l);(u||!e.selection.eq(i.selection))&&(o=!0);let d=h=="preserve"&&o&&this.dom.style.overflowAnchor==null&&_de(this);if(o){this.domObserver.stop();let f=u&&(Bi||Nn)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&Gfe(i.selection,e.selection);if(u){let p=Nn?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Tfe(this)),(s||!this.docView.update(e.doc,c,l,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=KE(e.doc,c,l,this.dom,this)),p&&!this.trackWrites&&(f=!0)}f||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&Xde(this))?Ja(this,f):(p$(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((n=this.dragging)===null||n===void 0)&&n.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),h=="reset"?this.dom.scrollTop=0:h=="to selection"?this.scrollToSelection():d&&Mde(d)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",r=>r(this)))if(this.state.selection instanceof lt){let r=this.docView.domAfterPos(this.state.selection.from);r.nodeType==1&&qE(this,r.getBoundingClientRect(),e)}else qE(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let r=0;r<this.directPlugins.length;r++){let n=this.directPlugins[r];n.spec.view&&this.pluginViews.push(n.spec.view(this))}for(let r=0;r<this.state.plugins.length;r++){let n=this.state.plugins[r];n.spec.view&&this.pluginViews.push(n.spec.view(this))}}else for(let r=0;r<this.pluginViews.length;r++){let n=this.pluginViews[r];n.update&&n.update(this,e)}}updateDraggedNode(e,r){let n=e.node,i=-1;if(this.state.doc.nodeAt(n.from)==n.node)i=n.from;
88else{let s=n.from+(this.state.doc.content.size-r.doc.content.size);(s>0&&this.state.doc.nodeAt(s))==n.node&&(i=s)}this.dragging=new A$(e.slice,e.move,i<0?void 0:lt.create(this.state.doc,i))}someProp(e,r){let n=this._props&&this._props[e],i;if(n!=null&&(i=r?r(n):n))return i;for(let o=0;o<this.directPlugins.length;o++){let a=this.directPlugins[o].props[e];if(a!=null&&(i=r?r(a):a))return i}let s=this.state.plugins;if(s)for(let o=0;o<s.length;o++){let a=s[o].props[e];if(a!=null&&(i=r?r(a):a))return i}}hasFocus(){if(Bi){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&Ade(this.dom),Ja(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let r=this.dom.parentNode;r;r=r.parentNode)if(r.nodeType==9||r.nodeType==11&&r.host)return r.getSelection||(Object.getPrototypeOf(r).getSelection=()=>r.ownerDocument.getSelection()),this._root=r}return e||document}updateRoot(){this._root=null}posAtCoords(e){return Ide(this,e)}coordsAtPos(e,r=1){return o$(this,e,r)}domAtPos(e,r=0){return this.docView.domFromPos(e,r)}nodeDOM(e){let r=this.docView.descAt(e);return r?r.nodeDOM:null}posAtDOM(e,r,n=-1){let i=this.docView.posFromDOM(e,r,n);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,r){return Fde(this,r||this.state,e)}pasteHTML(e,r){return lg(this,"",e,!1,r||new ClipboardEvent("paste"))}pasteText(e,r){return lg(this,e,null,!0,r||new ClipboardEvent("paste"))}serializeForClipboard(e){return A7(this,e)}destroy(){this.docView&&(ffe(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],M5(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,mde())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return mfe(this,e)}domSelectionRange(){let e=this.domSelection();return e?ci&&this.root.nodeType===11&&vde(this.dom.ownerDocument)==this.dom&&Ffe(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}B7.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function pO(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",r=>{if(typeof r=="function"&&(r=r(t.state)),r)for(let n in r)n=="class"?e.class+=" "+r[n]:n=="style"?e.style=(e.style?e.style+";":"")+r[n]:!e[n]&&n!="contenteditable"&&n!="nodeName"&&(e[n]=String(r[n]))}),e.translate||(e.translate="no"),[Ur.node(0,t.state.doc.content.size,e)]}function mO(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:Ur.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function gO(t){return!t.someProp("editable",e=>e(t.state)===!1)}function Gfe(t,e){let r=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(r)!=e.$anchor.start(r)}function yO(t){let e=Object.create(null);function r(n){for(let i in n)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=n[i])}return t.someProp("nodeViews",r),t.someProp("markViews",r),e}function Kfe(t,e){let r=0,n=0;for(let i in t){if(t[i]!=e[i])return!0;r++}for(let i in e)n++;return r!=n}function bO(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}function Bc(t,e){return t.meta={package:"@milkdown/core",group:"System",...e},t}const I$={text:(t,e,r,n)=>{const i=t.value;return/^[^*_\\]*\s+$/.test(i)?i:r.safe(i,{...n,encode:[]})},strong:(t,e,r,n)=>{const i=t.marker||r.options.strong||"*",s=r.enter("strong"),o=r.createTracker(n);let a=o.move(i+i);return a+=o.move(r.containerPhrasing(t,{before:a,after:i,...o.current()})),a+=o.move(i+i),s(),a},emphasis:(t,e,r,n)=>{const i=t.marker||r.options.emphasis||"*",s=r.enter("emphasis"),o=r.createTracker(n);let a=o.move(i);return a+=o.move(r.containerPhrasing(t,{before:a,after:i,...o.current()})),a+=o.move(i),s(),a}},fr=Rt({},"editorView"),yp=Rt({},"editorState"),E5=Rt([],"initTimer"),IC=Rt({},"editor"),hg=Rt([],"inputRules"),yc=Rt([],"prosePlugins"),ug=Rt([],"remarkPlugins"),dg=Rt([],"nodeView"),fg=Rt([],"markView"),Vh=Rt(xC().use(dC).use(gC),"remark"),hm=
88Rt({handlers:I$,encode:[]},"remarkStringifyOptions"),U2=yl("ConfigReady");function Yfe(t){const e=r=>(r.record(U2),async()=>(await t(r),r.done(U2),()=>{r.clearTimer(U2)}));return Bc(e,{displayName:"Config"}),e}const Wh=yl("InitReady");function Xfe(t){const e=r=>(r.inject(IC,t).inject(yc,[]).inject(ug,[]).inject(hg,[]).inject(dg,[]).inject(fg,[]).inject(hm,{handlers:I$,encode:[]}).inject(Vh,xC().use(dC).use(gC)).inject(E5,[U2]).record(Wh),async()=>{await r.waitTimers(E5);const n=r.get(hm);return r.set(Vh,xC().use(dC).use(gC,n)),r.done(Wh),()=>{r.remove(IC).remove(yc).remove(ug).remove(hg).remove(dg).remove(fg).remove(hm).remove(Vh).remove(E5).clearTimer(Wh)}});return Bc(e,{displayName:"Init"}),e}const As=yl("SchemaReady"),O5=Rt([],"schemaTimer"),Yo=Rt({},"schema"),um=Rt([],"nodes"),dm=Rt([],"marks");function xO(t){var e;return{...t,parseDOM:(e=t.parseDOM)==null?void 0:e.map(r=>({priority:t.priority,...r}))}}const B$=t=>(t.inject(Yo,{}).inject(um,[]).inject(dm,[]).inject(O5,[Wh]).record(As),async()=>{await t.waitTimers(O5);const e=t.get(Vh),n=t.get(ug).reduce((a,l)=>a.use(l.plugin,l.options),e);t.set(Vh,n);const i=Object.fromEntries(t.get(um).map(([a,l])=>[a,xO(l)])),s=Object.fromEntries(t.get(dm).map(([a,l])=>[a,xO(l)])),o=new RN({nodes:i,marks:s});return t.set(Yo,o),t.done(As),()=>{t.remove(Yo).remove(um).remove(dm).remove(O5).clearTimer(As)}});Bc(B$,{displayName:"Schema"});var _h,gs;class R${constructor(){we(this,_h);we(this,gs);ie(this,_h,new lF),ie(this,gs,null),this.setCtx=e=>{ie(this,gs,e)},this.chain=()=>{if(V(this,gs)==null)throw u5();const e=V(this,gs),r=[],n=this.get.bind(this),i={run:()=>{const o=Xf(...r),a=e.get(fr);return o(a.state,a.dispatch,a)},inline:o=>(r.push(o),i),pipe:s.bind(this)};function s(o,a){const l=n(o);return r.push(l(a)),i}return i}}get ctx(){return V(this,gs)}create(e,r){const n=e.create(V(this,_h).sliceMap);return n.set(r),n}get(e){return V(this,_h).get(e).get()}remove(e){return V(this,_h).remove(e)}call(e,r){if(V(this,gs)==null)throw u5();const i=this.get(e)(r),s=V(this,gs).get(fr);return i(s.state,s.dispatch,s)}inline(e){if(V(this,gs)==null)throw u5();const r=V(this,gs).get(fr);return e(r.state,r.dispatch,r)}}_h=new WeakMap,gs=new WeakMap;function Jfe(t="cmdKey"){return Rt(()=>()=>!1,t)}const He=Rt(new R$,"commands"),L5=Rt([As],"commandsTimer"),fm=yl("CommandsReady"),P$=t=>{const e=new R$;return e.setCtx(t),t.inject(He,e).inject(L5,[As]).record(fm),async()=>(await t.waitTimers(L5),t.done(fm),()=>{t.remove(He).remove(L5).clearTimer(fm)})};Bc(P$,{displayName:"Commands"});function Zfe(t){const e=Xf(Bae,v7,Kue,GF);return t.Backspace=e,t}var Mh,yi;class N${constructor(){we(this,Mh);we(this,yi);ie(this,Mh,null),ie(this,yi,[]),this.setCtx=e=>{ie(this,Mh,e)},this.add=e=>(V(this,yi).push(e),()=>{ie(this,yi,V(this,yi).filter(r=>r!==e))}),this.addObjectKeymap=e=>{const r=[];return Object.entries(e).forEach(([n,i])=>{if(typeof i=="function"){const s={key:n,onRun:()=>i};V(this,yi).push(s),r.push(()=>{ie(this,yi,V(this,yi).filter(o=>o!==s))})}else V(this,yi).push(i),r.push(()=>{ie(this,yi,V(this,yi).filter(s=>s!==i))})}),()=>{r.forEach(n=>n())}},this.addBaseKeymap=()=>{const e=Zfe(hde);return this.addObjectKeymap(e)},this.build=()=>{const e={};return V(this,yi).forEach(n=>{e[n.key]=[...e[n.key]||[],n]}),Object.fromEntries(Object.entries(e).map(([n,i])=>{const s=i.sort((a,l)=>(l.priority??50)-(a.priority??50));return[n,(a,l,c)=>{const h=V(this,Mh);if(h==null)throw Zv();const u=s.map(f=>f.onRun(h));return Xf(...u)(a,l,c)}]}))}}get ctx(){return V(this,Mh)}}Mh=new WeakMap,yi=new WeakMap;const px=Rt(new N$,"keymap"),D5=Rt([As],"keymapTimer"),pm=yl("KeymapReady"),Qfe=t=>{const e=new N$;return e.setCtx(t),t.inject(px,e).inject(D5,[As]).record(pm),async()=>(await t.waitTimers(D5),t.done(pm),()=>{t.remove(px).remove(D5).clearTimer(pm)})},G2=yl("ParserReady"),F$=()=>{throw Zv()},mm=Rt(F$,"parser"),I5=Rt([],"parserTimer"),$$=t=>(t.inject(mm,F$).inject(I5,[As]).record(G2),async()=>{await t.waitTimers(I5);const e=t.get(Vh),r=t.get(Yo);return t.set(mm,jue.create(r,e)),t.done(G2),()=>{t.remove(mm).remove(I5).clearTimer(G2)}});Bc($$,{displayName:"Parser"});const gm=yl("SerializerReady"),B5=Rt([],"serializerTimer"),z$=()=>{throw Zv()},vd=Rt(z$,"serializer"),H$=t=>(t.inject(vd,z$).inject(B5,[As]).record(gm),async()=>{await t.waitTimers(B5);const e=t.get(Vh),r=t.get(Yo);return t.set(vd,Gue.create(r,e)),t.done(gm),()=>{t.remove(vd).remove(B5).clearTimer(gm)}});Bc(H$,{displayName:"Serializer"});const K2=Rt("","defaultValue"),R5=Rt(t=>t,"stateOptions"),P5=Rt([],"editorStateTimer"),Y2=yl("EditorStateReady");function e0e(t,e,r){if(typeof t=="string")return e(t);if(t.type==="html")return au.fromSchema(r).parse(t.dom);if(t.type==="json")return Xa.fromJSON(r,t.value);throw Pae(t)}const t0e=new Dr("MILKDOWN_STATE_TRACKER"),q$=t=>(t.inject(K2,"").inject(yp,{}).inject(R5,e=>e).inject(P5,[G2,gm,fm,pm]).record(Y2),async()=>{await t.waitTimers(P5);const e=t.get(Yo),r=t.get(mm),n=t.get(hg),i=t.get(R5),s=t.get(yc),o=t.get(K2),a=e0e(o,r,e),l=t.get(px),c=l.addBaseKeymap(),h=[...s,new _r({key:t0e,state:{init:()=>{},apply:(f,p,m,g)=>{t.set(yp,g)}}}),Qae({rules:n}),QF(l.build())];t.set(yc,h);const u=i({schema:e,doc:a,plugins:h}),d=ph.create(u);return t.set(yp,d),t.done(Y2),()=>{c(),t.remove(K2).remove(yp).remove(R5).remove(P5).clearTimer(Y2)}});Bc(q$,{displayName:"EditorState"});const X2=yl("EditorViewReady"),N5=Rt([],"editorViewTimer"),ym=Rt({},"editorViewOptions"),J2=Rt(null,"root"),BC=Rt(null,"rootDOM"),RC=Rt({},"rootAttrs");function r0e(t,e){const r=document.createElement("div");r.className="milkdown",t.appendChild(r),e.set(BC,r);const n=e.get(RC);
88return Object.entries(n).forEach(([i,s])=>r.setAttribute(i,s)),r}function n0e(t){t.classList.add("editor"),t.setAttribute("role","textbox")}const i0e=new Dr("MILKDOWN_VIEW_CLEAR"),V$=t=>(t.inject(J2,document.body).inject(fr,{}).inject(ym,{}).inject(BC,null).inject(RC,{}).inject(N5,[Y2]).record(X2),async()=>{await t.wait(Wh);const e=t.get(J2)||document.body,r=typeof e=="string"?document.querySelector(e):e;t.update(yc,l=>[new _r({key:i0e,view:c=>{const h=r?r0e(r,t):void 0;return(()=>{if(h&&r){const d=c.dom;r.replaceChild(h,d),h.appendChild(d)}})(),{destroy:()=>{h!=null&&h.parentNode&&(h==null||h.parentNode.replaceChild(c.dom,h)),h==null||h.remove()}}}}),...l]),await t.waitTimers(N5);const n=t.get(yp),i=t.get(ym),s=Object.fromEntries(t.get(dg)),o=Object.fromEntries(t.get(fg)),a=new B7(r,{state:n,nodeViews:s,markViews:o,...i});return n0e(a.dom),t.set(fr,a),t.done(X2),()=>{a==null||a.destroy(),t.remove(J2).remove(fr).remove(ym).remove(BC).remove(RC).remove(N5).clearTimer(X2)}});Bc(V$,{displayName:"EditorView"});var mx=(t=>(t.Idle="Idle",t.OnCreate="OnCreate",t.Created="Created",t.OnDestroy="OnDestroy",t.Destroyed="Destroyed",t))(mx||{}),Ah,Ki,$a,Hd,jg,Ug,bi,za,Eh,Gg,Oh,qd,Kg,Yl,Vd;const v_=class v_{constructor(){we(this,Ah);we(this,Ki);we(this,$a);we(this,Hd);we(this,jg);we(this,Ug);we(this,bi);we(this,za);we(this,Eh);we(this,Gg);we(this,Oh);we(this,qd);we(this,Kg);we(this,Yl);we(this,Vd);ie(this,Ah,!1),ie(this,Ki,"Idle"),ie(this,$a,[]),ie(this,Hd,()=>{}),ie(this,jg,new lF),ie(this,Ug,new yle),ie(this,bi,new Map),ie(this,za,new Map),ie(this,Eh,new lC(V(this,jg),V(this,Ug))),ie(this,Gg,()=>{const e=Yfe(async n=>{await Promise.all(V(this,$a).map(i=>i(n)))}),r=[B$,$$,H$,P$,Qfe,q$,V$,Xfe(this),e];V(this,Oh).call(this,r,V(this,za))}),ie(this,Oh,(e,r)=>{e.forEach(n=>{const i=V(this,Eh).produce(V(this,Ah)?n.meta:void 0),s=n(i);r.set(n,{ctx:i,handler:s,cleanup:void 0})})}),ie(this,qd,(e,r=!1)=>Promise.all([e].flat().map(n=>{const i=V(this,bi).get(n),s=i==null?void 0:i.cleanup;return r?V(this,bi).delete(n):V(this,bi).set(n,{ctx:void 0,handler:void 0,cleanup:void 0}),typeof s=="function"?s():s}))),ie(this,Kg,async()=>{await Promise.all([...V(this,za).entries()].map(([e,{cleanup:r}])=>typeof r=="function"?r():r)),V(this,za).clear()}),ie(this,Yl,e=>{ie(this,Ki,e),V(this,Hd).call(this,e)}),ie(this,Vd,e=>[...e.entries()].map(async([r,n])=>{const{ctx:i,handler:s}=n;if(!s)return;const o=await s();e.set(r,{ctx:i,handler:s,cleanup:o})})),this.enableInspector=(e=!0)=>(ie(this,Ah,e),this),this.onStatusChange=e=>(ie(this,Hd,e),this),this.config=e=>(V(this,$a).push(e),this),this.removeConfig=e=>(ie(this,$a,V(this,$a).filter(r=>r!==e)),this),this.use=e=>{const r=[e].flat();return r.flat().forEach(n=>{V(this,bi).set(n,{ctx:void 0,handler:void 0,cleanup:void 0})}),V(this,Ki)==="Created"&&V(this,Oh).call(this,r,V(this,bi)),this},this.remove=async e=>V(this,Ki)==="OnCreate"?(console.warn("[Milkdown]: You are trying to remove plugins when the editor is creating, this is not recommended, please check your code."),new Promise(r=>{setTimeout(()=>{r(this.remove(e))},50)})):(await V(this,qd).call(this,[e].flat(),!0),this),this.create=async()=>V(this,Ki)==="OnCreate"?this:(V(this,Ki)==="Created"&&await this.destroy(),V(this,Yl).call(this,"OnCreate"),V(this,Gg).call(this),V(this,Oh).call(this,[...V(this,bi).keys()],V(this,bi)),await Promise.all([V(this,Vd).call(this,V(this,za)),V(this,Vd).call(this,V(this,bi))].flat()),V(this,Yl).call(this,"Created"),this),this.destroy=async(e=!1)=>V(this,Ki)==="Destroyed"||V(this,Ki)==="OnDestroy"?this:V(this,Ki)==="OnCreate"?new Promise(r=>{setTimeout(()=>{r(this.destroy(e))},50)}):(e&&ie(this,$a,[]),V(this,Yl).call(this,"OnDestroy"),await V(this,qd).call(this,[...V(this,bi).keys()],e),await V(this,Kg).call(this),V(this,Yl).call(this,"Destroyed"),this),this.action=e=>e(V(this,Eh)),this.inspect=()=>V(this,Ah)?[...V(this,za).values(),...V(this,bi).values()].map(({ctx:e})=>{var r;return(r=e==null?void 0:e.inspector)==null?void 0:r.read()}).filter(e=>!!e):(console.warn("[Milkdown]: You are trying to collect inspection when inspector is disabled, please enable inspector by `editor.enableInspector()` first."),[])}static make(){return new v_}get ctx(){return V(this,Eh)}get status(){return V(this,Ki)}};Ah=new WeakMap,Ki=new WeakMap,$a=new WeakMap,Hd=new WeakMap,jg=new WeakMap,Ug=new WeakMap,bi=new WeakMap,za=new WeakMap,Eh=new WeakMap,Gg=new WeakMap,Oh=new WeakMap,qd=new WeakMap,Kg=new WeakMap,Yl=new WeakMap,Vd=new WeakMap;let PC=v_;function yt(t,e){const r=Jfe(t),n=i=>async()=>{n.key=r,await i.wait(fm);const s=e(i);return i.get(He).create(r,s),n.run=o=>i.get(He).call(t,o),()=>{i.get(He).remove(r)}};return n}function jn(t){const e=r=>async()=>{await r.wait(As);const n=t(r);return r.update(hg,i=>[...i,n]),e.inputRule=n,()=>{r.update(hg,i=>i.filter(s=>s!==n))}};return e}function s0e(t,e){const r=n=>async()=>{const i=e(n);return n.update(dm,s=>[...s.filter(o=>o[0]!==t),[t,i]]),r.id=t,r.schema=i,()=>{n.update(dm,s=>s.filter(([o])=>o!==t))}};return r.type=n=>{const i=n.get(Yo).marks[t];if(!i)throw Wae(t);return i},r}function R7(t,e){const r=n=>async()=>{const i=e(n);return n.update(um,s=>[...s.filter(o=>o[0]!==t),[t,i]]),r.id=t,r.schema=i,()=>{n.update(um,s=>s.filter(([o])=>o!==t))}};return r.type=n=>{const i=n.get(Yo).nodes[t];
88if(!i)throw Vae(t);return i},r}function nn(t){let e;const r=n=>async()=>(await n.wait(As),e=t(n),n.update(yc,i=>[...i,e]),()=>{n.update(yc,i=>i.filter(s=>s!==e))});return r.plugin=()=>e,r.key=()=>e.spec.key,r}function W$(t){const e=r=>async()=>{await r.wait(pm);const n=r.get(px),i=t(r),s=n.addObjectKeymap(i);return e.keymap=i,()=>{s()}};return e}function _1(t,e){const r=n=>async()=>{await n.wait(As);const i=e(n);return t.type(n)instanceof ox?n.update(dg,s=>[...s,[t.id,i]]):n.update(fg,s=>[...s,[t.id,i]]),r.view=i,r.type=t,()=>{t.type(n)instanceof ox?n.update(dg,s=>s.filter(o=>o[0]!==t.id)):n.update(fg,s=>s.filter(o=>o[0]!==t.id))}};return r}function tr(t,e){const r=Rt(t,e),n=i=>(i.inject(r),()=>()=>{i.remove(r)});return n.key=r,n}function Hr(t,e){const r=tr(e,t),n=R7(t,s=>s.get(r.key)(s)),i=[r,n];return i.id=n.id,i.node=n,i.type=s=>n.type(s),i.ctx=r,i.key=r.key,i.extendSchema=s=>{const o=s(e);return Hr(t,o)},i}function Jf(t,e){const r=tr(e,t),n=s0e(t,s=>s.get(r.key)(s)),i=[r,n];return i.id=n.id,i.mark=n,i.type=s=>n.type(s),i.ctx=r,i.key=r.key,i.extendSchema=s=>{const o=s(e);return Jf(t,o)},i}function Fi(t,e){const r=Object.fromEntries(Object.entries(e).map(([o,{shortcuts:a,priority:l}])=>[o,{shortcuts:a,priority:l}])),n=tr(r,`${t}Keymap`),i=W$(o=>{const a=o.get(n.key),l=Object.entries(e).flatMap(([c,{command:h}])=>{const u=a[c],d=[u.shortcuts].flat(),f=u.priority;return d.map(p=>[p,{key:p,onRun:h,priority:f}])});return Object.fromEntries(l)}),s=[n,i];return s.ctx=n,s.shortcuts=i,s.key=n.key,s.keymap=i.keymap,s}const go=(t,e=()=>({}))=>tr(e,`${t}Attr`),M1=(t,e=()=>({}))=>tr(e,`${t}Attr`);function aa(t,e,r){const n=tr({},t),i=o=>async()=>{await o.wait(Wh);const l={plugin:e(o),options:o.get(n.key)};return o.update(ug,c=>[...c,l]),()=>{o.update(ug,c=>c.filter(h=>h!==l))}},s=[n,i];return s.id=t,s.plugin=i,s.options=n,s}function o0e(t){return e=>{const r=e.get(fr);return e.get(Yo),e.get(vd)(r.state.doc)}}const NC=Math.min,wd=Math.max,gx=Math.round,Xo=t=>({x:t,y:t}),a0e={left:"right",right:"left",bottom:"top",top:"bottom"},l0e={start:"end",end:"start"};function vO(t,e,r){return wd(t,NC(e,r))}function cw(t,e){return typeof t=="function"?t(e):t}function du(t){return t.split("-")[0]}function hw(t){return t.split("-")[1]}function j$(t){return t==="x"?"y":"x"}function U$(t){return t==="y"?"height":"width"}const c0e=new Set(["top","bottom"]);function tc(t){return c0e.has(du(t))?"y":"x"}function G$(t){return j$(tc(t))}function h0e(t,e,r){r===void 0&&(r=!1);const n=hw(t),i=G$(t),s=U$(i);let o=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=yx(o)),[o,yx(o)]}function u0e(t){const e=yx(t);return[FC(t),e,FC(e)]}function FC(t){return t.replace(/start|end/g,e=>l0e[e])}const wO=["left","right"],kO=["right","left"],d0e=["top","bottom"],f0e=["bottom","top"];function p0e(t,e,r){switch(t){case"top":case"bottom":return r?e?kO:wO:e?wO:kO;case"left":case"right":return e?d0e:f0e;default:return[]}}function m0e(t,e,r,n){const i=hw(t);let s=p0e(du(t),r==="start",n);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(FC)))),s}function yx(t){return t.replace(/left|right|bottom|top/g,e=>a0e[e])}function g0e(t){return{top:0,right:0,bottom:0,left:0,...t}}function y0e(t){return typeof t!="number"?g0e(t):{top:t,right:t,bottom:t,left:t}}function bx(t){const{x:e,y:r,width:n,height:i}=t;return{width:n,height:i,top:r,left:e,right:e+n,bottom:r+i,x:e,y:r}}function CO(t,e,r){let{reference:n,floating:i}=t;const s=tc(e),o=G$(e),a=U$(o),l=du(e),c=s==="y",h=n.x+n.width/2-i.width/2,u=n.y+n.height/2-i.height/2,d=n[a]/2-i[a]/2;let f;switch(l){case"top":f={x:h,y:n.y-i.height};break;case"bottom":f={x:h,y:n.y+n.height};break;case"right":f={x:n.x+n.width,y:u};break;case"left":f={x:n.x-i.width,y:u};break;default:f={x:n.x,y:n.y}}switch(hw(e)){case"start":f[o]-=d*(r&&c?-1:1);break;case"end":f[o]+=d*(r&&c?-1:1);break}return f}const b0e=async(t,e,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:s=[],platform:o}=r,a=s.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(e));let c=await o.getElementRects({reference:t,floating:e,strategy:i}
vendor: 7,515 bytes, line 88
88),{x:h,y:u}=CO(c,n,l),d=n,f={},p=0;for(let m=0;m<a.length;m++){const{name:g,fn:y}=a[m],{x:b,y:x,data:S,reset:k}=await y({x:h,y:u,initialPlacement:n,placement:d,strategy:i,middlewareData:f,rects:c,platform:o,elements:{reference:t,floating:e}});h=b??h,u=x??u,f={...f,[g]:{...f[g],...S}},k&&p<=50&&(p++,typeof k=="object"&&(k.placement&&(d=k.placement),k.rects&&(c=k.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:i}):k.rects),{x:h,y:u}=CO(c,d,l)),m=-1)}return{x:h,y:u,placement:d,strategy:i,middlewareData:f}};async function K$(t,e){var r;e===void 0&&(e={});const{x:n,y:i,platform:s,rects:o,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:u="floating",altBoundary:d=!1,padding:f=0}=cw(e,t),p=y0e(f),g=a[d?u==="floating"?"reference":"floating":u],y=bx(await s.getClippingRect({element:(r=await(s.isElement==null?void 0:s.isElement(g)))==null||r?g:g.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:h,strategy:l})),b=u==="floating"?{x:n,y:i,width:o.floating.width,height:o.floating.height}:o.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),S=await(s.isElement==null?void 0:s.isElement(x))?await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1}:{x:1,y:1},k=bx(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:x,strategy:l}):b);return{top:(y.top-k.top+p.top)/S.y,bottom:(k.bottom-y.bottom+p.bottom)/S.y,left:(y.left-k.left+p.left)/S.x,right:(k.right-y.right+p.right)/S.x}}const x0e=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var r,n;const{placement:i,middlewareData:s,rects:o,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:h=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...g}=cw(t,e);if((r=s.arrow)!=null&&r.alignmentOffset)return{};const y=du(i),b=tc(a),x=du(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(c.floating)),k=d||(x||!m?[yx(a)]:u0e(a)),w=p!=="none";!d&&w&&k.push(...m0e(a,m,p,S));const _=[a,...k],L=await K$(e,g),B=[];let E=((n=s.flip)==null?void 0:n.overflows)||[];if(h&&B.push(L[y]),u){const z=h0e(i,o,S);B.push(L[z[0]],L[z[1]])}if(E=[...E,{placement:i,overflows:B}],!B.every(z=>z<=0)){var D,N;const z=(((D=s.flip)==null?void 0:D.index)||0)+1,$=_[z];if($&&(!(u==="alignment"?b!==tc($):!1)||E.every(q=>q.overflows[0]>0&&tc(q.placement)===b)))return{data:{index:z,overflows:E},reset:{placement:$}};let H=(N=E.filter(j=>j.overflows[0]<=0).sort((j,q)=>j.overflows[1]-q.overflows[1])[0])==null?void 0:N.placement;if(!H)switch(f){case"bestFit":{var K;const j=(K=E.filter(q=>{if(w){const ne=tc(q.placement);return ne===b||ne==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(ne=>ne>0).reduce((ne,O)=>ne+O,0)]).sort((q,ne)=>q[1]-ne[1])[0])==null?void 0:K[0];j&&(H=j);break}case"initialPlacement":H=a;break}if(i!==H)return{reset:{placement:H}}}return{}}}},v0e=new Set(["left","top"]);async function w0e(t,e){const{placement:r,platform:n,elements:i}=t,s=await(n.isRTL==null?void 0:n.isRTL(i.floating)),o=du(r),a=hw(r),l=tc(r)==="y",c=v0e.has(o)?-1:1,h=s&&l?-1:1,u=cw(e,t);let{mainAxis:d,crossAxis:f,alignmentAxis:p}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&typeof p=="number"&&(f=a==="end"?p*-1:p),l?{x:f*h,y:d*c}:{x:d*c,y:f*h}}const k0e=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var r,n;const{x:i,y:s,placement:o,middlewareData:a}=e,l=await w0e(e,t);return o===((r=a.offset)==null?void 0:r.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:o}}}}},C0e=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:r,y:n,placement:i}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:g=>{let{x:y,y:b}=g;return{x:y,y:b}}},...l}=cw(t,e),c={x:r,y:n},h=await K$(e,l),u=tc(du(i)),d=j$(u);let f=c[d],p=c[u];if(s){const g=d==="y"?"top":"left",y=d==="y"?"bottom":"right",b=f+h[g],x=f-h[y];f=vO(b,f,x)}if(o){const g=u==="y"?"top":"left",y=u==="y"?"bottom":"right",b=p+h[g],x=p-h[y];p=vO(b,p,x)}const m=a.fn({...e,[d]:f,[u]:p});return{...m,data:{x:m.x-r,y:m.y-n,enabled:{[d]:s,[u]:o}}}}}};function uw(){return typeof window<"u"}function Zf(t){return Y$(t)?(t.nodeName||"").toLowerCase():"#document"}function is(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function bl(t){var e;return(e=(Y$(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Y$(t){return uw()?t instanceof Node||t instanceof is(t).Node:!1}function co(t){return uw()?t instanceof Element||t instanceof is(t).Element:!1}function ta(t){return uw()?t instanceof HTMLElement||t instanceof is(t).HTMLElement:!1}function SO(t){return!uw()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof is(t).ShadowRoot}const S0e=new Set(["inline","contents"]);function A1(t){const{overflow:e,overflowX:r,overflowY:n,display:i}=ho(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&!S0e.has(i)}const T0e=new Set(["table","td","th"]);function _0e(t){return T0e.has(Zf(t))}const M0e=[":popover-open",":modal"];function dw(t){return M0e.some(e=>{try{return t.matches(e)}catch{return!1}})}const A0e=["transform","translate","scale","rotate","perspective"],E0e=["transform","translate","scale","rotate","perspective","filter"],O0e=["paint","layout","strict","content"];function P7(t){const e=N7(),r=co(t)?ho(t):t;return A0e.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!e&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!e&&(r.filter?r.filter!=="none":!1)||E0e.some(n=>(r.willChange||"").includes(n))||O0e.some(n=>(r.contain||"").includes(n))}function L0e(t){let e=bc(t);for(;ta(e)&&!Mf(e);){if(P7(e))return e;if(dw(e))return null;e=bc(e)}return null}function N7(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const D0e=new Set(["html","body","#document"]);function Mf(t){return D0e.has(Zf(t))}function ho(t){return is(t).getComputedStyle(t)}function fw(t){return co(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function bc(t){if(Zf(t)==="html")return t;const e=t.assignedSlot||t.parentNode||SO(t)&&t.host||bl(t);return SO(e)?e.host:e}function X$(t){const e=bc(t);return Mf(e)?t.ownerDocument?t.ownerDocument.body:t.body:ta(e)&&A1(e)?e:X$(e)}function $C(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);const i=X$(t),s=i===((n=t.ownerDocument)==null?void 0:n.body),o=is(i);if(s){const a=zC(o);return e.concat(o,o.visualViewport||[],A1(i)?i:[],a&&r?$C(a):[])}return e.concat(i,$C(i,[],r))}function zC(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function J$(t){const e=ho(t);let r=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const i=ta(t),s=i?t.offsetWidth:r,o=i?t.offsetHeight:n,a=gx(r)!==s||gx(n)!==o;return a&&(r=s,n=o),{width:r,height:n,$:a}}function Z$(t){return co(t)?t:t.contextElement}function kd(t){const e=Z$(t);if(!ta(e))return Xo(1);const r=e.getBoundingClientRect(),{width:n,height:i,$:s}=J$(e);let o=(s?gx(r.width):r.width)/n,a=(s?gx(r.height):r.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const I0e=Xo(0);function Q$(t){const e=is(t);return!N7()||!e.visualViewport?I0e:{x:e.visualVie
88wport.offsetLeft,y:e.visualViewport.offsetTop}}function B0e(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==is(t)?!1:e}function pg(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);const i=t.getBoundingClientRect(),s=Z$(t);let o=Xo(1);e&&(n?co(n)&&(o=kd(n)):o=kd(t));const a=B0e(s,r,n)?Q$(s):Xo(0);let l=(i.left+a.x)/o.x,c=(i.top+a.y)/o.y,h=i.width/o.x,u=i.height/o.y;if(s){const d=is(s),f=n&&co(n)?is(n):n;let p=d,m=zC(p);for(;m&&n&&f!==p;){const g=kd(m),y=m.getBoundingClientRect(),b=ho(m),x=y.left+(m.clientLeft+parseFloat(b.paddingLeft))*g.x,S=y.top+(m.clientTop+parseFloat(b.paddingTop))*g.y;l*=g.x,c*=g.y,h*=g.x,u*=g.y,l+=x,c+=S,p=is(m),m=zC(p)}}return bx({width:h,height:u,x:l,y:c})}function F7(t,e){const r=fw(t).scrollLeft;return e?e.left+r:pg(bl(t)).left+r}function ez(t,e,r){r===void 0&&(r=!1);const n=t.getBoundingClientRect(),i=n.left+e.scrollLeft-(r?0:F7(t,n)),s=n.top+e.scrollTop;return{x:i,y:s}}function R0e(t){let{elements:e,rect:r,offsetParent:n,strategy:i}=t;const s=i==="fixed",o=bl(n),a=e?dw(e.floating):!1;if(n===o||a&&s)return r;let l={scrollLeft:0,scrollTop:0},c=Xo(1);const h=Xo(0),u=ta(n);if((u||!u&&!s)&&((Zf(n)!=="body"||A1(o))&&(l=fw(n)),ta(n))){const f=pg(n);c=kd(n),h.x=f.x+n.clientLeft,h.y=f.y+n.clientTop}const d=o&&!u&&!s?ez(o,l,!0):Xo(0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+h.x+d.x,y:r.y*c.y-l.scrollTop*c.y+h.y+d.y}}function P0e(t){return Array.from(t.getClientRects())}function N0e(t){const e=bl(t),r=fw(t),n=t.ownerDocument.body,i=wd(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=wd(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+F7(t);const a=-r.scrollTop;return ho(n).direction==="rtl"&&(o+=wd(e.clientWidth,n.clientWidth)-i),{width:i,height:s,x:o,y:a}}function F0e(t,e){const r=is(t),n=bl(t),i=r.visualViewport;let s=n.clientWidth,o=n.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;const c=N7();(!c||c&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:s,height:o,x:a,y:l}}const $0e=new Set(["absolute","fixed"]);function z0e(t,e){const r=pg(t,!0,e==="fixed"),n=r.top+t.clientTop,i=r.left+t.clientLeft,s=ta(t)?kd(t):Xo(1),o=t.clientWidth*s.x,a=t.clientHeight*s.y,l=i*s.x,c=n*s.y;return{width:o,height:a,x:l,y:c}}function TO(t,e,r){let n;if(e==="viewport")n=F0e(t,r);else if(e==="document")n=N0e(bl(t));else if(co(e))n=z0e(e,r);else{const i=Q$(t);n={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return bx(n)}function tz(t,e){const r=bc(t);return r===e||!co(r)||Mf(r)?!1:ho(r).position==="fixed"||tz(r,e)}function H0e(t,e){const r=e.get(t);if(r)return r;let n=$C(t,[],!1).filter(a=>co(a)&&Zf(a)!=="body"),i=null;const s=ho(t).position==="fixed";let o=s?bc(t):t;for(;co(o)&&!Mf(o);){const a=ho(o),l=P7(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&$0e.has(i.position)||A1(o)&&!l&&tz(t,o))?n=n.filter(h=>h!==o):i=a,o=bc(o)}return e.set(t,n),n}function q0e(t){let{element:e,boundary:r,rootBoundary:n,strategy:i}=t;const o=[...r==="clippingAncestors"?dw(e)?[]:H0e(e,this._c):[].concat(r),n],a=o[0],l=o.reduce((c,h)=>{const u=TO(e,h,i);return c.top=wd(u.top,c.top),c.right=NC(u.right,c.right),c.bottom=NC(u.bottom,c.bottom),c.left=wd(u.left,c.left),c},TO(e,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function V0e(t){const{width:e,height:r}=J$(t);return{width:e,height:r}}function W0e(t,e,r){const n=ta(e),i=bl(e),s=r==="fixed",o=pg(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const l=Xo(0);function c(){l.x=F7(i)}if(n||!n&&!s)if((Zf(e)!=="body"||A1(i))&&(a=fw(e)),n){const f=pg(e,!0,s,e);l.x=f.x+e.clientLeft,l.y=f.y+e.clientTop}else i&&c();s&&!n&&i&&c();const h=i&&!n&&!s?ez(i,a):Xo(0),u=o.left+a.scrollLeft-l.x-h.x,d=o.top+a.scrollTop-l.y-h.y;return{x:u,y:d,width:o.width,height:o.height}}function F5(t){return ho(t).position==="static"}function _O(t,e){if(!ta(t)||ho(t).position==="fixed")return null;if(e)return e(t);let r=t.offsetParent;return bl(t)===r&&(r=r.ownerDocument.body),r}function rz(t,e){const r=is(t);if(dw(t))return r;if(!ta(t)){let i=bc(t);for(;i&&!Mf(i);){if(co(i)&&!F5(i))return i;i=bc(i)}return r}let n=_O(t,e);for(;n&&_0e(n)&&F5(n);)n=_O(n,e);return n&&Mf(n)&&F5(n)&&!P7(n)?r:n||L0e(t)||r}const j0e=async function(t){const e=this.getOffsetParent||rz,r=this.getDimensions,n=await r(t.floating);return{reference:W0e(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function U0e(t){return ho(t).direction==="rtl"}const G0e={convertOffsetParentRelativeRectToViewportRelativeRect:R0e,getDocumentElement:bl,getClippingRect:q0e,getOffsetParent:rz,getElementRects:j0e,getClientRects:P0e,getDimensions:V0e,getScale:kd,isElement:co,isRTL:U0e},xc=k0e,MO=C0e,xx=x0e,uo=(t,e,r)=>{const n=new Map,i={platform:G0e,...r},s={...i.platform,_c:n};return b0e(t,e,{...i,platform:s})};function E1(t,e){return Object.assign(t,{meta:{package:"@milkdown/plugin-block",...e}}),t}const K0e=t=>!Ko(r=>r.type.name==="table")(t),pw=tr({filterNodes:K0e},"blockConfig");E1(pw,{displayName:"Ctx<blockConfig>"});function Y0e(t,e,r){var i;if(!t.dom.parentElement)return null;try{const s=(i=t.posAtCoords({left:e.x,top:e.y}))==null?void 0:i.inside;if(s==null||s<0)return null;let o=t.state.doc.resolve(s),a=t.state.doc.nodeAt(s),l=t.nodeDOM(s);const c=u=>{const d=o.depth>
88=1&&o.index(o.depth)===0;if(!(u||d))return;const p=o.before(o.depth);a=t.state.doc.nodeAt(p),l=t.nodeDOM(p),o=t.state.doc.resolve(p),r(o,a)||c(!0)},h=r(o,a);return c(!h),!l||!a?null:{node:a,$pos:o,el:l}}catch{return null}}const AO=Ly.ie&&Ly.ie_version<15||Ly.ios&&Ly.webkit_version<604,EO=20;var Wd,Yg,Lh,Ws,jd,js,Ga,nz,bp,Dh,Ih,Xg,Ud,Gd,Kd,Jg,Bh;class X0e{constructor(){we(this,Ga);we(this,Wd);we(this,Yg);we(this,Lh);we(this,Ws);we(this,jd);we(this,js);we(this,Dh);we(this,Ih);we(this,Xg);we(this,Ud);we(this,Gd);we(this,Kd);we(this,Jg);we(this,Bh);ie(this,Yg,()=>{if(!V(this,Ws))return null;const e=V(this,Ws),r=V(this,Ga,bp);if(r&&lt.isSelectable(e.node)){const n=lt.create(r.state.doc,e.$pos.pos);return r.dispatch(r.state.tr.setSelection(n)),r.focus(),ie(this,Lh,n),n}return null}),ie(this,Lh,null),ie(this,Ws,null),ie(this,jd,void 0),ie(this,js,!1),ie(this,Ih,()=>{var e;(e=V(this,Dh))==null||e.call(this,{type:"hide"}),ie(this,Ws,null)}),ie(this,Xg,e=>{var r;ie(this,Ws,e),(r=V(this,Dh))==null||r.call(this,{type:"show",active:e})}),this.bind=(e,r)=>{ie(this,Wd,e),ie(this,Dh,r)},this.addEvent=e=>{e.addEventListener("mousedown",V(this,Ud)),e.addEventListener("mouseup",V(this,Gd)),e.addEventListener("dragstart",V(this,Kd))},this.removeEvent=e=>{e.removeEventListener("mousedown",V(this,Ud)),e.removeEventListener("mouseup",V(this,Gd)),e.removeEventListener("dragstart",V(this,Kd))},this.unBind=()=>{ie(this,Dh,void 0)},ie(this,Ud,()=>{var e;ie(this,jd,(e=V(this,Ws))==null?void 0:e.el.getBoundingClientRect()),V(this,Yg).call(this)}),ie(this,Gd,()=>{if(!V(this,js)){requestAnimationFrame(()=>{var e;V(this,jd)&&((e=V(this,Ga,bp))==null||e.focus())});return}ie(this,js,!1),ie(this,Lh,null)}),ie(this,Kd,e=>{var i;ie(this,js,!0);const r=V(this,Ga,bp);if(!r)return;r.dom.dataset.dragging="true";const n=V(this,Lh);if(e.dataTransfer&&n){const s=n.content();e.dataTransfer.effectAllowed="copyMove";const{dom:o,text:a}=r.serializeForClipboard(s);e.dataTransfer.clearData(),e.dataTransfer.setData(AO?"Text":"text/html",o.innerHTML),AO||e.dataTransfer.setData("text/plain",a);const l=(i=V(this,Ws))==null?void 0:i.el;l&&e.dataTransfer.setDragImage(l,0,0),r.dragging={slice:s,move:!0}}}),this.keydownCallback=e=>(V(this,Ih).call(this),ie(this,js,!1),e.dom.dataset.dragging="false",!1),ie(this,Jg,Nv((e,r)=>{if(!e.editable)return;const n=e.dom.getBoundingClientRect(),i=n.left+n.width/2;if(!(e.root.elementFromPoint(i,r.clientY)instanceof Element)){V(this,Ih).call(this);return}const o=V(this,Ga,nz);if(!o)return;const a=Y0e(e,{x:i,y:r.clientY},o);if(!a){V(this,Ih).call(this);return}V(this,Xg).call(this,a)},200)),this.mousemoveCallback=(e,r)=>(e.composing||!e.editable||V(this,Jg).call(this,e,r),!1),this.dragoverCallback=(e,r)=>{var n;if(V(this,js)){const i=(n=V(this,Ga,bp))==null?void 0:n.dom.parentElement;if(!i)return!1;const s=i.scrollHeight>i.clientHeight,o=i.getBoundingClientRect();if(s){if(i.scrollTop>0&&Math.abs(r.y-o.y)<EO){const c=i.scrollTop>10?i.scrollTop-10:0;return i.scrollTop=c,!1}const a=Math.round(e.dom.getBoundingClientRect().height);if(Math.round(i.scrollTop+o.height)<a&&Math.abs(r.y-(o.height+o.y))<EO){const c=i.scrollTop+10;return i.scrollTop=c,!1}}}return!1},this.dragenterCallback=e=>{e.dragging&&(ie(this,js,!0),e.dom.dataset.dragging="true")},this.dragleaveCallback=(e,r)=>{const n=r.clientX,i=r.clientY;(n<0||i<0||n>window.innerWidth||i>window.innerHeight)&&(ie(this,Ws,null),V(this,Bh).call(this,e))},this.dropCallback=e=>(V(this,Bh).call(this,e),!1),this.dragendCallback=e=>{V(this,Bh).call(this,e)},ie(this,Bh,e=>{ie(this,js,!1),e.dom.dataset.dragging="false"})}}Wd=new WeakMap,Yg=new WeakMap,Lh=new WeakMap,Ws=new WeakMap,jd=new WeakMap,js=new WeakMap,Ga=new WeakSet,nz=function(){var e;try{return(e=V(this,Wd))==null?void 0:e.get(pw.key).filterNodes}catch{return}},bp=function(){var e;return(e=V(this,Wd))==null?void 0:e.get(fr)},Dh=new WeakMap,Ih=new WeakMap,Xg=new WeakMap,Ud=new WeakMap,Gd=new WeakMap,Kd=new WeakMap,Jg=new WeakMap,Bh=new WeakMap;const $7=tr(()=>new X0e,"blockService"),mw=tr({},"blockServiceInstance");E1($7,{displayName:"Ctx<blockService>"});E1(mw,{displayName:"Ctx<blockServiceInstance>"});const gw=tr({},"blockSpec");E1(gw,{displayName:"Ctx<blockSpec>"});const z7=nn(t=>{const e=new Dr("MILKDOWN_BLOCK"),n=t.get($7.key)();t.set(mw.key,n);const i=t.get(gw.key);return new _r({key:e,...i,props:{...i.props,handleDOMEvents:{drop:s=>n.dropCallback(s),pointermove:(s,o)=>n.mousemoveCallback(s,o),keydown:s=>n.keydownCallback(s),dragover:(s,o)=>n.dragoverCallback(s,o),dragleave:(s,o)=>n.dragleaveCallback(s,o),dragenter:s=>n.dragenterCallback(s),dragend:s=>n.dragendCallback(s)}}})});E1(z7,{displayName:"Prose<block>"});var xi,Ha,Rh,Ph,Zg,Yd,Qg,e1,Xd,Jd,Zd,kv,iz;
88class J0e{constructor(e){we(this,kv);we(this,xi);we(this,Ha);we(this,Rh);we(this,Ph);we(this,Zg);we(this,Yd);we(this,Qg);we(this,e1);we(this,Xd);we(this,Jd);we(this,Zd);ie(this,Ph,null),ie(this,Yd,!1),this.update=()=>{requestAnimationFrame(()=>{if(!V(this,Yd))try{ly(this,kv,iz).call(this),ie(this,Yd,!0)}catch{}})},this.destroy=()=>{var r,n;(r=V(this,Rh))==null||r.unBind(),(n=V(this,Rh))==null||n.removeEvent(V(this,xi)),V(this,xi).remove()},this.show=r=>{const n=r.el,i=V(this,Ha).get(fr).dom,s={ctx:V(this,Ha),active:r,editorDom:i,blockDom:V(this,xi)},o={contextElement:n,getBoundingClientRect:()=>V(this,Jd)?V(this,Jd).call(this,s):n.getBoundingClientRect()},a=[xx()];if(V(this,Xd)){const l=V(this,Xd).call(this,s),c=xc(l);a.push(c)}uo(o,V(this,xi),{placement:V(this,Zd)?V(this,Zd).call(this,s):"left",middleware:[...a,...V(this,Qg)],...V(this,e1)}).then(({x:l,y:c})=>{Object.assign(V(this,xi).style,{left:`${l}px`,top:`${c}px`}),V(this,xi).dataset.show="true"}).catch(console.error)},this.hide=()=>{V(this,xi).dataset.show="false"},ie(this,Ha,e.ctx),ie(this,xi,e.content),ie(this,Xd,e.getOffset),ie(this,Jd,e.getPosition),ie(this,Zd,e.getPlacement),ie(this,Qg,e.middleware??[]),ie(this,e1,e.floatingUIOptions??{}),ie(this,Zg,e.root),this.hide()}get active(){return V(this,Ph)}}xi=new WeakMap,Ha=new WeakMap,Rh=new WeakMap,Ph=new WeakMap,Zg=new WeakMap,Yd=new WeakMap,Qg=new WeakMap,e1=new WeakMap,Xd=new WeakMap,Jd=new WeakMap,Zd=new WeakMap,kv=new WeakSet,iz=function(){const e=V(this,Ha).get(fr);(V(this,Zg)??e.dom.parentElement??document.body).appendChild(V(this,xi));const n=V(this,Ha).get(mw.key);n.bind(V(this,Ha),i=>{i.type==="hide"?(this.hide(),ie(this,Ph,null)):i.type==="show"&&(this.show(i.active),ie(this,Ph,i.active))}),ie(this,Rh,n),V(this,Rh).addEvent(V(this,xi)),V(this,xi).draggable=!0};const yw=[gw,pw,$7,mw,z7];yw.key=gw.key;yw.pluginKey=z7.key;function Z0e(t,e){return function(r,n){let{$from:i,$to:s,node:o}=r.selection;if(o&&o.isBlock||i.depth<2||!i.sameParent(s))return!1;let a=i.node(-1);if(a.type!=t)return!1;if(i.parent.content.size==0&&i.node(-1).childCount==i.indexAfter(-1)){if(i.depth==3||i.node(-3).type!=t||i.index(-2)!=i.node(-2).childCount-1)return!1;if(n){let u=Se.empty,d=i.index(-1)?1:i.index(-2)?2:3;for(let y=i.depth-d;y>=i.depth-3;y--)u=Se.from(i.node(y).copy(u));let f=i.indexAfter(-1)<i.node(-2).childCount?1:i.indexAfter(-2)<i.node(-3).childCount?2:3;u=u.append(Se.from(t.createAndFill()));let p=i.before(i.depth-(d-1)),m=r.tr.replace(p,i.after(-f),new Ie(u,4-d,0)),g=-1;m.doc.nodesBetween(p,m.doc.content.size,(y,b)=>{if(g>-1)return!1;y.isTextblock&&y.content.size==0&&(g=b+1)}),g>-1&&m.setSelection(gt.near(m.doc.resolve(g))),n(m.scrollIntoView())}return!0}let l=s.pos==i.end()?a.contentMatchAt(0).defaultType:null,c=r.tr.delete(i.pos,s.pos),h=l?[null,{type:l}]:void 0;return sm(c.doc,i.pos,2,h)?(n&&n(c.split(i.pos,2,h).scrollIntoView()),!0):!1}}function Q0e(t){return function(e,r){let{$from:n,$to:i}=e.selection,s=n.blockRange(i,o=>o.childCount>0&&o.firstChild.type==t);return s?r?n.node(s.depth-1).type==t?epe(e,r,t,s):tpe(e,r,s):!0:!1}}function epe(t,e,r,n){let i=t.tr,s=n.end,o=n.$to.end(n.depth);s<o&&(i.step(new $n(s-1,o,s,o,new Ie(Se.from(r.create(null,n.parent.copy())),1,0),1,!0)),n=new _N(i.doc.resolve(n.$from.pos),i.doc.resolve(o),n.depth));const a=Gv(n);if(a==null)return!1;i.lift(n,a);let l=i.doc.resolve(i.mapping.map(s,-1)-1);return Kv(i.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&i.join(l.pos),e(i.scrollIntoView()),!0}function tpe(t,e,r){let n=t.tr,i=r.parent;for(let f=r.end,p=r.endIndex-1,m=r.startIndex;p>m;p--)f-=i.child(p).nodeSize,n.delete(f-1,f+1);let s=n.doc.resolve(r.start),o=s.nodeAfter;if(n.mapping.map(r.end)!=r.start+s.nodeAfter.nodeSize)return!1;let a=r.startIndex==0,l=r.endIndex==i.childCount,c=s.node(-1),h=s.index(-1);if(!c.canReplace(h+(a?0:1),h+1,o.content.append(l?Se.empty:Se.from(i))))return!1;let u=s.pos,d=u+o.nodeSize;return n.step(new $n(u-(a?1:0),d+(l?1:0),u+1,d-1,new Ie((a?Se.empty:Se.from(i.copy(Se.empty))).append(l?Se.empty:Se.from(i.copy(Se.empty))),a?0:1,l?0:1),a?0:1)),e(n.scrollIntoView()),!0}function rpe(t){return function(e,r){let{$from:n,$to:i}=e.selection,s=n.blockRange(i,c=>c.childCount>0&&c.firstChild.type==t);if(!s)return!1;let o=s.startIndex;if(o==0)return!1;let a=s.parent,l=a.child(o-1);if(l.type!=t)return!1;if(r){let c=l.lastChild&&l.lastChild.type==a.type,h=Se.from(c?t.create():null),u=new Ie(Se.from(t.create(null,Se.from(a.type.create(null,h)))),c?3:1,0),d=s.start,f=s.end;r(e.tr.step(new $n(d-(c?3:1),f,d,f,u,1,!0)).scrollIntoView())}return!0}}function npe(t){const e=new Map;if(!t||!t.type)throw new Error("mdast-util-definitions expected node");return Dc(t,"definition",function(n){const i=OO(n.identifier);i&&!e.get(i)&&e.set(i,n)}),r;function r(n){const i=OO(n);return e.get(i)}}function OO(t){return String(t||"").toUpperCase()}function ipe(){return function(t){const e=npe(t);Dc(t,function(r,n,i){if(r.type==="definition"&&i!==void 0&&typeof n=="number")return i.children.splice(n,1),[mC,n];if(r.type==="imageReference"||r.type==="linkReference"){const s=e(r.
88identifier);if(s&&i&&typeof n=="number")return i.children[n]=r.type==="imageReference"?{type:"image",url:s.url,title:s.title,alt:r.alt}:{type:"link",url:s.url,title:s.title,children:r.children},[mC,n]}})}}function sz(t,e){var i;if(!(e.childCount>=1&&((i=e.lastChild)==null?void 0:i.type.name)==="hardbreak")){t.next(e.content);return}const n=[];e.content.forEach((s,o,a)=>{a!==e.childCount-1&&n.push(s)}),t.next(Se.fromArray(n))}function ae(t,e){return Object.assign(t,{meta:{package:"@milkdown/preset-commonmark",...e}}),t}const H7=M1("emphasis");ae(H7,{displayName:"Attr<emphasis>",group:"Emphasis"});const Mu=Jf("emphasis",t=>({attrs:{marker:{default:t.get(hm).emphasis||"*",validate:"string"}},parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style",getAttrs:e=>e==="italic"}],toDOM:e=>["em",t.get(H7.key)(e)],parseMarkdown:{match:e=>e.type==="emphasis",runner:(e,r,n)=>{e.openMark(n,{marker:r.marker}),e.next(r.children),e.closeMark(n)}},toMarkdown:{match:e=>e.type.name==="emphasis",runner:(e,r)=>{e.withMark(r,"emphasis",void 0,{marker:r.attrs.marker})}}}));ae(Mu.mark,{displayName:"MarkSchema<emphasis>",group:"Emphasis"});ae(Mu.ctx,{displayName:"MarkSchemaCtx<emphasis>",group:"Emphasis"});const bw=yt("ToggleEmphasis",t=>()=>sw(Mu.type(t)));ae(bw,{displayName:"Command<toggleEmphasisCommand>",group:"Emphasis"});const oz=jn(t=>v1(/(?:^|[^*])\*([^*]+)\*$/,Mu.type(t),{getAttr:()=>({marker:"*"}),updateCaptured:({fullMatch:e,start:r})=>e.startsWith("*")?{}:{fullMatch:e.slice(1),start:r+1}}));ae(oz,{displayName:"InputRule<emphasis>|Star",group:"Emphasis"});const az=jn(t=>v1(/\b_(?![_\s])(.*?[^_\s])_\b/,Mu.type(t),{getAttr:()=>({marker:"_"}),updateCaptured:({fullMatch:e,start:r})=>e.startsWith("_")?{}:{fullMatch:e.slice(1),start:r+1}}));ae(az,{displayName:"InputRule<emphasis>|Underscore",group:"Emphasis"});const q7=Fi("emphasisKeymap",{ToggleEmphasis:{shortcuts:"Mod-i",command:t=>{const e=t.get(He);return()=>e.call(bw.key)}}});ae(q7.ctx,{displayName:"KeymapCtx<emphasis>",group:"Emphasis"});ae(q7.shortcuts,{displayName:"Keymap<emphasis>",group:"Emphasis"});const V7=M1("strong");ae(V7,{displayName:"Attr<strong>",group:"Strong"});const Qf=Jf("strong",t=>({attrs:{marker:{default:t.get(hm).strong||"*",validate:"string"}},parseDOM:[{tag:"b",getAttrs:e=>e.style.fontWeight!="normal"&&null},{tag:"strong"},{style:"font-style",getAttrs:e=>e==="bold"},{style:"font-weight=400",clearMark:e=>e.type.name=="strong"},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}],toDOM:e=>["strong",t.get(V7.key)(e)],parseMarkdown:{match:e=>e.type==="strong",runner:(e,r,n)=>{e.openMark(n,{marker:r.marker}),e.next(r.children),e.closeMark(n)}},toMarkdown:{match:e=>e.type.name==="strong",runner:(e,r)=>{e.withMark(r,"strong",void 0,{marker:r.attrs.marker})}}}));ae(Qf.mark,{displayName:"MarkSchema<strong>",group:"Strong"});ae(Qf.ctx,{displayName:"MarkSchemaCtx<strong>",group:"Strong"});const xw=yt("ToggleStrong",t=>()=>sw(Qf.type(t)));ae(xw,{displayName:"Command<toggleStrongCommand>",group:"Strong"});const lz=jn(t=>v1(new RegExp("(?<![\\w:/])(?:\\*\\*|__)([^*_]+?)(?:\\*\\*|__)(?![\\w/])$"),Qf.type(t),{getAttr:e=>({marker:e[0].startsWith("*")?"*":"_"})}));ae(lz,{displayName:"InputRule<strong>",group:"Strong"});const W7=Fi("strongKeymap",{ToggleBold:{shortcuts:["Mod-b"],command:t=>{const e=t.get(He);return()=>e.call(xw.key)}}});ae(W7.ctx,{displayName:"KeymapCtx<strong>",group:"Strong"});ae(W7.shortcuts,{displayName:"Keymap<strong>",group:"Strong"});const j7=M1("inlineCode");ae(j7,{displayName:"Attr<inlineCode>",group:"InlineCode"});const Ua=Jf("inlineCode",t=>({priority:100,code:!0,parseDOM:[{tag:"code"}],toDOM:e=>["code",t.get(j7.key)(e)],parseMarkdown:{match:e=>e.type==="inlineCode",runner:(e,r,n)=>{e.openMark(n),e.addText(r.value),e.closeMark(n)}},toMarkdown:{match:e=>e.type.name==="inlineCode",runner:(e,r,n)=>{e.withMark(r,"inlineCode",n.text||"")}}}));ae(Ua.mark,{displayName:"MarkSchema<inlineCode>",group:"InlineCode"});ae(Ua.ctx,{displayName:"MarkSchemaCtx<inlineCode>",group:"InlineCode"});const vw=yt("ToggleInlineCode",t=>()=>(e,r)=>{const{selection:n,tr:i}=e;if(n.empty)return!1;const{from:s,to:o}=n;return e.doc.rangeHasMark(s,o,Ua.type(t))?(r==null||r(i.removeMark(s,o,Ua.type(t))),!0):(Object.keys(e.schema.marks).filter(c=>c!==Ua.type.name).map(c=>
88e.schema.marks[c]).forEach(c=>{i.removeMark(s,o,c)}),r==null||r(i.addMark(s,o,Ua.type(t).create())),!0)});ae(vw,{displayName:"Command<toggleInlineCodeCommand>",group:"InlineCode"});const cz=jn(t=>v1(/(?:`)([^`]+)(?:`)$/,Ua.type(t)));ae(cz,{displayName:"InputRule<inlineCodeInputRule>",group:"InlineCode"});const U7=Fi("inlineCodeKeymap",{ToggleInlineCode:{shortcuts:"Mod-e",command:t=>{const e=t.get(He);return()=>e.call(vw.key)}}});ae(U7.ctx,{displayName:"KeymapCtx<inlineCode>",group:"InlineCode"});ae(U7.shortcuts,{displayName:"Keymap<inlineCode>",group:"InlineCode"});const G7=M1("link");ae(G7,{displayName:"Attr<link>",group:"Link"});const eo=Jf("link",t=>({attrs:{href:{validate:"string"},title:{default:null,validate:"string|null"}},parseDOM:[{tag:"a[href]",getAttrs:e=>{if(!(e instanceof HTMLElement))throw mo(e);return{href:e.getAttribute("href"),title:e.getAttribute("title")}}}],toDOM:e=>["a",{...t.get(G7.key)(e),...e.attrs}],parseMarkdown:{match:e=>e.type==="link",runner:(e,r,n)=>{const i=r.url,s=r.title;e.openMark(n,{href:i,title:s}),e.next(r.children),e.closeMark(n)}},toMarkdown:{match:e=>e.type.name==="link",runner:(e,r)=>{e.withMark(r,"link",void 0,{title:r.attrs.title,url:r.attrs.href})}}}));ae(eo.mark,{displayName:"MarkSchema<link>",group:"Link"});const hz=yt("ToggleLink",t=>(e={})=>sw(eo.type(t),e));ae(hz,{displayName:"Command<toggleLinkCommand>",group:"Link"});const uz=yt("UpdateLink",t=>(e={})=>(r,n)=>{if(!n)return!1;let i,s=-1;const{selection:o}=r,{from:a,to:l}=o;if(r.doc.nodesBetween(a,a===l?l+1:l,(p,m)=>{if(eo.type(t).isInSet(p.marks))return i=p,s=m,!1}),!i)return!1;const c=i.marks.find(({type:p})=>p===eo.type(t));if(!c)return!1;const h=s,u=s+i.nodeSize,{tr:d}=r,f=eo.type(t).create({...c.attrs,...e});return f?(n(d.removeMark(h,u,c).addMark(h,u,f).setSelection(new Je(d.selection.$anchor)).scrollIntoView()),!0):!1});ae(uz,{displayName:"Command<updateLinkCommand>",group:"Link"});const dz=R7("doc",()=>({content:"block+",parseMarkdown:{match:({type:t})=>t==="root",runner:(t,e,r)=>{t.injectRoot(e,r)}},toMarkdown:{match:t=>t.type.name==="doc",runner:(t,e)=>{t.openNode("root"),t.next(e.content)}}}));ae(dz,{displayName:"NodeSchema<doc>",group:"Doc"});function spe(t){return m7(t,e=>{var r;return e.type==="html"&&["<br />","<br>","<br >","<br/>"].includes((r=e.value)==null?void 0:r.trim())},(e,r)=>{if(!r.length)return;const n=r[r.length-1];if(!n)return;const i=n.children.indexOf(e);i!==-1&&n.children.splice(i,1)},!0)}const ww=aa("remark-preserve-empty-line",()=>()=>spe);ae(ww.plugin,{displayName:"Remark<remarkPreserveEmptyLine>",group:"Remark"});ae(ww.options,{displayName:"RemarkConfig<remarkPreserveEmptyLine>",group:"Remark"});const K7=go("paragraph");ae(K7,{displayName:"Attr<paragraph>",group:"Paragraph"});const la=Hr("paragraph",t=>({content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM:e=>["p",t.get(K7.key)(e),0],parseMarkdown:{match:e=>e.type==="paragraph",runner:(e,r,n)=>{e.openNode(n),r.children?e.next(r.children):e.addText(r.value||""),e.closeNode()}},toMarkdown:{match:e=>e.type.name==="paragraph",runner:(e,r)=>{var s;const i=(s=t.get(fr).state)==null?void 0:s.doc.lastChild;e.openNode("paragraph"),(!r.content||r.content.size===0)&&r!==i&&ope(t)?e.addNode("html",void 0,"<br />"):sz(e,r),e.closeNode()}}}));function ope(t){let e=!1;try{t.get(ww.id),e=!0}catch{e=!1}return e}ae(la.node,{displayName:"NodeSchema<paragraph>",group:"Paragraph"});ae(la.ctx,{displayName:"NodeSchemaCtx<paragraph>",group:"Paragraph"});const Y7=yt("TurnIntoText",t=>()=>og(la.type(t)));ae(Y7,{displayName:"Command<turnIntoTextCommand>",group:"Paragraph"});const X7=Fi("paragraphKeymap",{TurnIntoText:{shortcuts:"Mod-Alt-0",command:t=>{const e=t.get(He);return()=>e.call(Y7.key)}}});ae(X7.ctx,{displayName:"KeymapCtx<paragraph>",group:"Paragraph"});ae(X7.shortcuts,{displayName:"Keymap<paragraph>",group:"Paragraph"});const ape=Array(6).fill(0).map((t,e)=>e+1);function lpe(t){return t.textContent.toLowerCase().trim().replace(/\s+/g,"-")}const kw=tr(lpe,"headingIdGenerator");ae(kw,{displayName:"Ctx<HeadingIdGenerator>",group:"Heading"});const Cw=go("heading");ae(Cw,{displayName:"Attr<heading>",group:"Heading"});const Ji=Hr("heading",t=>{const e=t.get(kw.key);return{content:"inline*",group:"block",defining:!0,attrs:{id:{default:"",validate:"string"},level:{default:1,validate:"number"}},parseDOM:ape.map(r=>({tag:`h${r}`,getAttrs:n=>{if(!(n instanceof HTMLElement))throw mo(n);return{level:r,id:n.id}}})),toDOM:r=>[`h${r.attrs.level}`,{...t.get(Cw.key)(r),id:r.attrs.id||e(r)},0],parseMarkdown:{match:({type:r})=>r==="heading",runner:(r,n,i)=>{const s=n.depth;r.openNode(i,{level:s}),r.next(n.children),r.closeNode()}},toMarkdown:{match:r=>r.type.name==="heading",runner:(r,n)=>{r.openNode("heading",void 0,{depth:n.attrs.level}),sz(r,n),r.closeNode()}}}});ae(Ji.node,{displayName:"NodeSchema<heading>",group:"Heading"});ae(Ji.ctx,{displayName:"NodeSchemaCtx<heading>",group:"Heading"});const fz=jn(t=>c7(/^(?<hashes>#+)\s$/,Ji.type(t),e=>{var o,a;
88const r=((a=(o=e.groups)==null?void 0:o.hashes)==null?void 0:a.length)||0,n=t.get(fr),{$from:i}=n.state.selection,s=i.node();if(s.type.name==="heading"){let l=Number(s.attrs.level)+Number(r);return l>6&&(l=6),{level:l}}return{level:r}}));ae(fz,{displayName:"InputRule<wrapInHeadingInputRule>",group:"Heading"});const Fl=yt("WrapInHeading",t=>e=>(e??(e=1),e<1?og(la.type(t)):og(Ji.type(t),{level:e})));ae(Fl,{displayName:"Command<wrapInHeadingCommand>",group:"Heading"});const J7=yt("DowngradeHeading",t=>()=>(e,r,n)=>{const{$from:i}=e.selection,s=i.node();if(s.type!==Ji.type(t)||!e.selection.empty||i.parentOffset!==0)return!1;const o=s.attrs.level-1;return o?(r==null||r(e.tr.setNodeMarkup(e.selection.$from.before(),void 0,{...s.attrs,level:o})),!0):og(la.type(t))(e,r,n)});ae(J7,{displayName:"Command<downgradeHeadingCommand>",group:"Heading"});const Z7=Fi("headingKeymap",{TurnIntoH1:{shortcuts:"Mod-Alt-1",command:t=>{const e=t.get(He);return()=>e.call(Fl.key,1)}},TurnIntoH2:{shortcuts:"Mod-Alt-2",command:t=>{const e=t.get(He);return()=>e.call(Fl.key,2)}},TurnIntoH3:{shortcuts:"Mod-Alt-3",command:t=>{const e=t.get(He);return()=>e.call(Fl.key,3)}},TurnIntoH4:{shortcuts:"Mod-Alt-4",command:t=>{const e=t.get(He);return()=>e.call(Fl.key,4)}},TurnIntoH5:{shortcuts:"Mod-Alt-5",command:t=>{const e=t.get(He);return()=>e.call(Fl.key,5)}},TurnIntoH6:{shortcuts:"Mod-Alt-6",command:t=>{const e=t.get(He);return()=>e.call(Fl.key,6)}},DowngradeHeading:{shortcuts:["Delete","Backspace"],command:t=>{const e=t.get(He);return()=>e.call(J7.key)}}});ae(Z7.ctx,{displayName:"KeymapCtx<heading>",group:"Heading"});ae(Z7.shortcuts,{displayName:"Keymap<heading>",group:"Heading"});const Q7=go("blockquote");ae(Q7,{displayName:"Attr<blockquote>",group:"Blockquote"});const e0=Hr("blockquote",t=>({content:"block+",group:"block",defining:!0,parseDOM:[{tag:"blockquote"}],toDOM:e=>["blockquote",t.get(Q7.key)(e),0],parseMarkdown:{match:({type:e})=>e==="blockquote",runner:(e,r,n)=>{e.openNode(n).next(r.children).closeNode()}},toMarkdown:{match:e=>e.type.name==="blockquote",runner:(e,r)=>{e.openNode("blockquote").next(r.content).closeNode()}}}));ae(e0.node,{displayName:"NodeSchema<blockquote>",group:"Blockquote"});ae(e0.ctx,{displayName:"NodeSchemaCtx<blockquote>",group:"Blockquote"});const pz=jn(t=>l7(/^\s*>\s$/,e0.type(t)));ae(pz,{displayName:"InputRule<wrapInBlockquoteInputRule>",group:"Blockquote"});const e8=yt("WrapInBlockquote",t=>()=>C7(e0.type(t)));ae(e8,{displayName:"Command<wrapInBlockquoteCommand>",group:"Blockquote"});const t8=Fi("blockquoteKeymap",{WrapInBlockquote:{shortcuts:"Mod-Shift-b",command:t=>{const e=t.get(He);return()=>e.call(e8.key)}}});ae(t8.ctx,{displayName:"KeymapCtx<blockquote>",group:"Blockquote"});ae(t8.shortcuts,{displayName:"Keymap<blockquote>",group:"Blockquote"});const r8=go("codeBlock",()=>({pre:{},code:{}}));ae(r8,{displayName:"Attr<codeBlock>",group:"CodeBlock"});const ra=Hr("code_block",t=>({content:"text*",group:"block",marks:"",defining:!0,code:!0,attrs:{language:{default:"",validate:"string"}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:e=>{if(!(e instanceof HTMLElement))throw mo(e);return{language:e.dataset.language}}}],toDOM:e=>{const r=t.get(r8.key)(e),n=e.attrs.language,i=n&&n.length>0?{"data-language":n}:void 0;return["pre",{...r.pre,...i},["code",r.code,0]]},parseMarkdown:{match:({type:e})=>e==="code",runner:(e,r,n)=>{const i=r.lang??"",s=r.value;e.openNode(n,{language:i}),s&&e.addText(s),e.closeNode()}},toMarkdown:{match:e=>e.type.name==="code_block",runner:(e,r)=>{var n;e.addNode("code",void 0,((n=r.content.firstChild)==null?void 0:n.text)||"",{lang:r.attrs.language})}}}));ae(ra.node,{displayName:"NodeSchema<codeBlock>",group:"CodeBlock"});ae(ra.ctx,{displayName:"NodeSchemaCtx<codeBlock>",group:"CodeBlock"});const mz=jn(t=>c7(/^```(?<language>[a-z]*)?[\s\n]$/,ra.type(t),e=>{var r;return{language:((r=e.groups)==null?void 0:r.language)??""}}));ae(mz,{displayName:"InputRule<createCodeBlockInputRule>",group:"CodeBlock"});const n8=yt("CreateCodeBlock",t=>(e="")=>og(ra.type(t),{language:e}));ae(n8,{displayName:"Command<createCodeBlockCommand>",group:"CodeBlock"});
88const cpe=yt("UpdateCodeBlockLanguage",()=>({pos:t,language:e}={pos:-1,language:""})=>(r,n)=>t>=0?(n==null||n(r.tr.setNodeAttribute(t,"language",e)),!0):!1);ae(cpe,{displayName:"Command<updateCodeBlockLanguageCommand>",group:"CodeBlock"});const i8=Fi("codeBlockKeymap",{CreateCodeBlock:{shortcuts:"Mod-Alt-c",command:t=>{const e=t.get(He);return()=>e.call(n8.key)}}});ae(i8.ctx,{displayName:"KeymapCtx<codeBlock>",group:"CodeBlock"});ae(i8.shortcuts,{displayName:"Keymap<codeBlock>",group:"CodeBlock"});const s8=go("image");ae(s8,{displayName:"Attr<image>",group:"Image"});const Au=Hr("image",t=>({inline:!0,group:"inline",selectable:!0,draggable:!0,marks:"",atom:!0,defining:!0,isolating:!0,attrs:{src:{default:"",validate:"string"},alt:{default:"",validate:"string"},title:{default:"",validate:"string"}},parseDOM:[{tag:"img[src]",getAttrs:e=>{if(!(e instanceof HTMLElement))throw mo(e);return{src:e.getAttribute("src")||"",alt:e.getAttribute("alt")||"",title:e.getAttribute("title")||e.getAttribute("alt")||""}}}],toDOM:e=>["img",{...t.get(s8.key)(e),...e.attrs}],parseMarkdown:{match:({type:e})=>e==="image",runner:(e,r,n)=>{const i=r.url,s=r.alt,o=r.title;e.addNode(n,{src:i,alt:s,title:o})}},toMarkdown:{match:e=>e.type.name==="image",runner:(e,r)=>{e.addNode("image",void 0,void 0,{title:r.attrs.title,url:r.attrs.src,alt:r.attrs.alt})}}}));ae(Au.node,{displayName:"NodeSchema<image>",group:"Image"});ae(Au.ctx,{displayName:"NodeSchemaCtx<image>",group:"Image"});const gz=yt("InsertImage",t=>(e={})=>(r,n)=>{if(!n)return!0;const{src:i="",alt:s="",title:o=""}=e,a=Au.type(t).create({src:i,alt:s,title:o});return a&&n(r.tr.replaceSelectionWith(a).scrollIntoView()),!0});ae(gz,{displayName:"Command<insertImageCommand>",group:"Image"});const yz=yt("UpdateImage",t=>(e={})=>(r,n)=>{const i=fle(r.selection,Au.type(t));if(!i)return!1;const{node:s,pos:o}=i,a={...s.attrs},{src:l,alt:c,title:h}=e;return l!==void 0&&(a.src=l),c!==void 0&&(a.alt=c),h!==void 0&&(a.title=h),n==null||n(r.tr.setNodeMarkup(o,void 0,a).scrollIntoView()),!0});ae(yz,{displayName:"Command<updateImageCommand>",group:"Image"});const hpe=jn(t=>new Ri(/!\[(?<alt>.*?)]\((?<filename>.*?)\s*(?="|\))"?(?<title>[^"]+)?"?\)/,(e,r,n,i)=>{const[s,o,a="",l]=r;return s?e.tr.replaceWith(n,i,Au.type(t).create({src:a,alt:o,title:l})):null}));ae(hpe,{displayName:"InputRule<insertImageInputRule>",group:"Image"});const vx=go("hardbreak",t=>({"data-type":"hardbreak","data-is-inline":t.attrs.isInline}));ae(vx,{displayName:"Attr<hardbreak>",group:"Hardbreak"});const jh=Hr("hardbreak",t=>({inline:!0,group:"inline",attrs:{isInline:{default:!1,validate:"boolean"}},selectable:!1,parseDOM:[{tag:"br"},{tag:'span[data-type="hardbreak"]',getAttrs:()=>({isInline:!0})}],toDOM:e=>e.attrs.isInline?["span",t.get(vx.key)(e)," "]:["br",t.get(vx.key)(e)],parseMarkdown:{match:({type:e})=>e==="break",runner:(e,r,n)=>{var i;e.addNode(n,{isInline:!!((i=r.data)!=null&&i.isInline)})}},leafText:()=>`
89`,toMarkdown:{match:e=>e.type.name==="hardbreak",runner:(e,r)=>{r.attrs.isInline?e.addNode("text",void 0,`
90`):e.addNode("break")}}}));ae(jh.node,{displayName:"NodeSchema<hardbreak>",group:"Hardbreak"});ae(jh.ctx,{displayName:"NodeSchemaCtx<hardbreak>",group:"Hardbreak"});const o8=yt("InsertHardbreak",t=>()=>(e,r)=>{var s;const{selection:n,tr:i}=e;if(!(n instanceof Je))return!1;if(n.empty){const o=n.$from.node();if(o.childCount>0&&((s=o.lastChild)==null?void 0:s.type.name)==="hardbreak")return r==null||r(i.replaceRangeWith(n.to-1,n.to,e.schema.node("paragraph")).setSelection(gt.near(i.doc.resolve(n.to))).scrollIntoView()),!0}return r==null||r(i.setMeta("hardbreak",!0).replaceSelectionWith(jh.type(t).create()).scrollIntoView()),!0});ae(o8,{displayName:"Command<insertHardbreakCommand>",group:"Hardbreak"});const a8=Fi("hardbreakKeymap",{InsertHardbreak:{shortcuts:"Shift-Enter",command:t=>{const e=t.get(He);return()=>e.call(o8.key)}}});ae(a8.ctx,{displayName:"KeymapCtx<hardbreak>",group:"Hardbreak"});ae(a8.shortcuts,{displayName:"Keymap<hardbreak>",group:"Hardbreak"});const l8=go("hr");ae(l8,{displayName:"Attr<hr>",group:"Hr"});
90const t0=Hr("hr",t=>({group:"block",parseDOM:[{tag:"hr"}],toDOM:e=>["hr",t.get(l8.key)(e)],parseMarkdown:{match:({type:e})=>e==="thematicBreak",runner:(e,r,n)=>{e.addNode(n)}},toMarkdown:{match:e=>e.type.name==="hr",runner:e=>{e.addNode("thematicBreak")}}}));ae(t0.node,{displayName:"NodeSchema<hr>",group:"Hr"});ae(t0.ctx,{displayName:"NodeSchemaCtx<hr>",group:"Hr"});const bz=jn(t=>new Ri(/^(?:---|___\s|\*\*\*\s)$/,(e,r,n,i)=>{const{tr:s}=e;return r[0]&&s.replaceWith(n-1,i,t0.type(t).create()),s}));ae(bz,{displayName:"InputRule<insertHrInputRule>",group:"Hr"});const xz=yt("InsertHr",t=>()=>(e,r)=>{if(!r)return!0;const n=la.node.type(t).create(),{tr:i,selection:s}=e,{from:o}=s,a=t0.type(t).create();if(!a)return!0;const l=i.replaceSelectionWith(a).insert(o,n),c=gt.findFrom(l.doc.resolve(o),1,!0);return c&&r(l.setSelection(c).scrollIntoView()),!0});ae(xz,{displayName:"Command<insertHrCommand>",group:"Hr"});const c8=go("bulletList");ae(c8,{displayName:"Attr<bulletList>",group:"BulletList"});const Eu=Hr("bullet_list",t=>({content:"listItem+",group:"block",attrs:{spread:{default:!1,validate:"boolean"}},parseDOM:[{tag:"ul",getAttrs:e=>{if(!(e instanceof HTMLElement))throw mo(e);return{spread:e.dataset.spread==="true"}}}],toDOM:e=>["ul",{...t.get(c8.key)(e),"data-spread":e.attrs.spread},0],parseMarkdown:{match:({type:e,ordered:r})=>e==="list"&&!r,runner:(e,r,n)=>{const i=r.spread!=null?`${r.spread}`:"false";e.openNode(n,{spread:i}).next(r.children).closeNode()}},toMarkdown:{match:e=>e.type.name==="bullet_list",runner:(e,r)=>{e.openNode("list",void 0,{ordered:!1,spread:r.attrs.spread}).next(r.content).closeNode()}}}));ae(Eu.node,{displayName:"NodeSchema<bulletList>",group:"BulletList"});ae(Eu.ctx,{displayName:"NodeSchemaCtx<bulletList>",group:"BulletList"});const vz=jn(t=>l7(/^\s*([-+*])\s$/,Eu.type(t)));ae(vz,{displayName:"InputRule<wrapInBulletListInputRule>",group:"BulletList"});const h8=yt("WrapInBulletList",t=>()=>C7(Eu.type(t)));ae(h8,{displayName:"Command<wrapInBulletListCommand>",group:"BulletList"});const u8=Fi("bulletListKeymap",{WrapInBulletList:{shortcuts:"Mod-Alt-8",command:t=>{const e=t.get(He);return()=>e.call(h8.key)}}});ae(u8.ctx,{displayName:"KeymapCtx<bulletListKeymap>",group:"BulletList"});ae(u8.shortcuts,{displayName:"Keymap<bulletListKeymap>",group:"BulletList"});const d8=go("orderedList");ae(d8,{displayName:"Attr<orderedList>",group:"OrderedList"});const Ou=Hr("ordered_list",t=>({content:"listItem+",group:"block",attrs:{order:{default:1,validate:"number"},spread:{default:!1,validate:"boolean"}},parseDOM:[{tag:"ol",getAttrs:e=>{if(!(e instanceof HTMLElement))throw mo(e);return{spread:e.dataset.spread,order:e.hasAttribute("start")?Number(e.getAttribute("start")):1}}}],toDOM:e=>["ol",{...t.get(d8.key)(e),...e.attrs.order===1?{}:e.attrs.order,"data-spread":e.attrs.spread},0],parseMarkdown:{match:({type:e,ordered:r})=>e==="list"&&!!r,runner:(e,r,n)=>{const i=r.spread!=null?`${r.spread}`:"true";e.openNode(n,{spread:i}).next(r.children).closeNode()}},toMarkdown:{match:e=>e.type.name==="ordered_list",runner:(e,r)=>{e.openNode("list",void 0,{ordered:!0,start:1,spread:r.attrs.spread==="true"}),e.next(r.content),e.closeNode()}}}));ae(Ou.node,{displayName:"NodeSchema<orderedList>",group:"OrderedList"});ae(Ou.ctx,{displayName:"NodeSchemaCtx<orderedList>",group:"OrderedList"});const wz=jn(t=>l7(/^\s*(\d+)\.\s$/,Ou.type(t),e=>({order:Number(e[1])}),(e,r)=>r.childCount+r.attrs.order===Number(e[1])));ae(wz,{displayName:"InputRule<wrapInOrderedListInputRule>",group:"OrderedList"});const f8=yt("WrapInOrderedList",t=>()=>C7(Ou.type(t)));ae(f8,{displayName:"Command<wrapInOrderedListCommand>",group:"OrderedList"});const p8=Fi("orderedListKeymap",{WrapInOrderedList:{shortcuts:"Mod-Alt-7",command:t=>{const e=t.get(He);return()=>e.call(f8.key)}}});ae(p8.ctx,{displayName:"KeymapCtx<orderedList>",group:"OrderedList"});ae(p8.shortcuts,{displayName:"Keymap<orderedList>",group:"OrderedList"});const m8=go("listItem");ae(m8,{displayName:"Attr<listItem>",group:"ListItem"});const yo=Hr("list_item",t=>({group:"listItem",content:"paragraph block*",attrs:{label:{default:"•",validate:"string"},listType:{default:"bullet",validate:"string"},spread:{default:!0,validate:"boolean"}},defining:!0,parseDOM:[{tag:"li",getAttrs:e=>{if(!(e instanceof HTMLElement))throw mo(e);return{label:e.dataset.label,listType:e.dataset.listType,spread:e.dataset.spread==="true"}}}],toDOM:e=>["li",{...t.get(m8.key)(e),"data-label":e.attrs.label,"data-list-type":e.attrs.listType,"data-spread":e.attrs.spread},0],parseMarkdown:{match:({type:e})=>e==="listItem",runner:(e,r,n)=>{const i=r.label!=null?`${r.label}.`:"•",s=r.label!=null?"ordered":"bullet",o=r.spread!=null?`${r.spread}`:"true";e.openNode(n,{label:i,listType:s,spread:o}),e.next(r.children),e.closeNode()}},toMarkdown:{match:e=>
90e.type.name==="list_item",runner:(e,r)=>{e.openNode("listItem",void 0,{spread:r.attrs.spread}),e.next(r.content),e.closeNode()}}}));ae(yo.node,{displayName:"NodeSchema<listItem>",group:"ListItem"});ae(yo.ctx,{displayName:"NodeSchemaCtx<listItem>",group:"ListItem"});const g8=yt("SinkListItem",t=>()=>rpe(yo.type(t)));ae(g8,{displayName:"Command<sinkListItemCommand>",group:"ListItem"});const y8=yt("LiftListItem",t=>()=>Q0e(yo.type(t)));ae(y8,{displayName:"Command<liftListItemCommand>",group:"ListItem"});const b8=yt("SplitListItem",t=>()=>Z0e(yo.type(t)));ae(b8,{displayName:"Command<splitListItemCommand>",group:"ListItem"});function upe(t){return(e,r,n)=>{const{selection:i}=e;if(!(i instanceof Je))return!1;const{empty:s,$from:o}=i;return!s||o.parentOffset!==0||o.node(-1).type!==yo.type(t)?!1:UF(e,r,n)}}const x8=yt("LiftFirstListItem",t=>()=>upe(t));ae(x8,{displayName:"Command<liftFirstListItemCommand>",group:"ListItem"});const v8=Fi("listItemKeymap",{NextListItem:{shortcuts:"Enter",command:t=>{const e=t.get(He);return()=>e.call(b8.key)}},SinkListItem:{shortcuts:["Tab","Mod-]"],command:t=>{const e=t.get(He);return()=>e.call(g8.key)}},LiftListItem:{shortcuts:["Shift-Tab","Mod-["],command:t=>{const e=t.get(He);return()=>e.call(y8.key)}},LiftFirstListItem:{shortcuts:["Backspace","Delete"],command:t=>{const e=t.get(He);return()=>e.call(x8.key)}}});ae(v8.ctx,{displayName:"KeymapCtx<listItem>",group:"ListItem"});ae(v8.shortcuts,{displayName:"Keymap<listItem>",group:"ListItem"});const kz=R7("text",()=>({group:"inline",parseMarkdown:{match:({type:t})=>t==="text",runner:(t,e)=>{t.addText(e.value)}},toMarkdown:{match:t=>t.type.name==="text",runner:(t,e)=>{t.addNode("text",void 0,e.text)}}}));ae(kz,{displayName:"NodeSchema<text>",group:"Text"});const w8=go("html");ae(w8,{displayName:"Attr<html>",group:"Html"});const k8=Hr("html",t=>({atom:!0,group:"inline",inline:!0,attrs:{value:{default:"",validate:"string"}},toDOM:e=>{const r=document.createElement("span"),n={...t.get(w8.key)(e),"data-value":e.attrs.value,"data-type":"html"};return r.textContent=e.attrs.value,["span",n,e.attrs.value]},parseDOM:[{tag:'span[data-type="html"]',getAttrs:e=>({value:e.dataset.value??""})}],parseMarkdown:{match:({type:e})=>e==="html",runner:(e,r,n)=>{e.addNode(n,{value:r.value})}},toMarkdown:{match:e=>e.type.name==="html",runner:(e,r)=>{e.addNode("html",void 0,r.attrs.value)}}}));ae(k8.node,{displayName:"NodeSchema<html>",group:"Html"});ae(k8.ctx,{displayName:"NodeSchemaCtx<html>",group:"Html"});const dpe=[dz,K7,la,kw,Cw,Ji,vx,jh,Q7,e0,r8,ra,l8,t0,s8,Au,c8,Eu,d8,Ou,m8,yo,H7,Mu,V7,Qf,j7,Ua,G7,eo,w8,k8,kz].flat(),fpe=[pz,vz,wz,mz,bz,fz].flat(),ppe=[oz,az,cz,lz],Qu=yt("IsMarkSelected",()=>t=>e=>{if(!t)return!1;const{doc:r,selection:n}=e;return r.rangeHasMark(n.from,n.to,t)}),Cz=yt("IsNoteSelected",()=>t=>e=>t?aF(e,t).hasNode:!1),gn=yt("ClearTextInCurrentBlock",()=>()=>(t,e)=>{let r=t.tr;const{$from:n,$to:i}=r.selection,{pos:s}=n,{pos:o}=i,a=s-n.node().content.size;return a<0?!1:(r=r.deleteRange(a,o),e==null||e(r),!0)}),Ta=yt("SetBlockType",()=>t=>(e,r)=>{const{nodeType:n,attrs:i=null}=t??{};if(!n)return!1;const s=e.tr,{from:o,to:a}=s.selection;try{s.setBlockType(o,a,n,i)}catch{return!1}return r==null||r(s),!0}),xp=yt("WrapInBlockType",()=>t=>(e,r)=>{const{nodeType:n,attrs:i=null}=t??{};if(!n)return!1;let s=e.tr;try{const{$from:o,$to:a}=s.selection,l=o.blockRange(a),c=l&&o7(l,n,i);if(!c)return!1;s=s.wrap(l,c)}catch{return!1}return r==null||r(s),!0}),vp=yt("AddBlockType",()=>t=>(e,r)=>{const{nodeType:n,attrs:i=null}=t??{};if(!n)return!1;const s=e.tr;try{const o=n instanceof Xa?n:n.createAndFill(i);if(!o)return!1;s.replaceSelectionWith(o)}catch{return!1}return r==null||r(s),!0}),Sz=yt("SelectTextNearPos",()=>t=>(e,r)=>{const{pos:n}=t??{};if(n==null)return!1;const i=(o,a,l)=>Math.min(Math.max(o,a),l),s=e.tr;try{const o=e.doc.resolve(i(n,0,e.doc.content.size));s.setSelection(Je.near(o))}catch{return!1}return r==null||r(s.scrollIntoView()),!0}),mpe=[Y7,e8,Fl,J7,n8,o8,xz,gz,yz,f8,h8,g8,b8,y8,x8,bw,vw,xw,hz,uz,Qu,Cz,gn,Ta,xp,vp,Sz],gpe=[t8,i8,a8,Z7,v8,p8,u8,X7,q7,U7,W7].flat(),C8=aa("remarkAddOrderInList",()=>()=>t=>{Dc(t,"list",e=>
90{if(e.ordered){const r=e.start??1;e.children.forEach((n,i)=>{n.label=i+r})}})});ae(C8.plugin,{displayName:"Remark<remarkAddOrderInListPlugin>",group:"Remark"});ae(C8.options,{displayName:"RemarkConfig<remarkAddOrderInListPlugin>",group:"Remark"});const S8=aa("remarkLineBreak",()=>()=>t=>{const e=/[\t ]*(?:\r?\n|\r)/g;Dc(t,"text",(r,n,i)=>{if(!r.value||typeof r.value!="string")return;const s=[];let o=0;e.lastIndex=0;let a=e.exec(r.value);for(;a;){const c=a.index;o!==c&&s.push({type:"text",value:r.value.slice(o,c)}),s.push({type:"break",data:{isInline:!0}}),o=c+a[0].length,a=e.exec(r.value)}if(s.length>0&&i&&typeof n=="number")return o<r.value.length&&s.push({type:"text",value:r.value.slice(o)}),i.children.splice(n,1,...s),n+s.length})});ae(S8.plugin,{displayName:"Remark<remarkLineBreak>",group:"Remark"});ae(S8.options,{displayName:"RemarkConfig<remarkLineBreak>",group:"Remark"});const T8=aa("remarkInlineLink",()=>ipe);ae(T8.plugin,{displayName:"Remark<remarkInlineLinkPlugin>",group:"Remark"});ae(T8.options,{displayName:"RemarkConfig<remarkInlineLinkPlugin>",group:"Remark"});const ype=t=>!!t.children,bpe=t=>t.type==="html";function xpe(t,e){return r(t,0,null)[0];function r(n,i,s){if(ype(n)){const o=[];for(let a=0,l=n.children.length;a<l;a++){const c=n.children[a];if(c){const h=r(c,a,n);if(h)for(let u=0,d=h.length;u<d;u++){const f=h[u];f&&o.push(f)}}}n.children=o}return e(n,i,s)}}const vpe=["root","blockquote","listItem"],_8=aa("remarkHTMLTransformer",()=>()=>t=>{xpe(t,(e,r,n)=>bpe(e)?(n&&vpe.includes(n.type)&&(e.children=[{...e}],delete e.value,e.type="paragraph"),[e]):[e])});ae(_8.plugin,{displayName:"Remark<remarkHtmlTransformer>",group:"Remark"});ae(_8.options,{displayName:"RemarkConfig<remarkHtmlTransformer>",group:"Remark"});const M8=aa("remarkMarker",()=>()=>(t,e)=>{const r=n=>e.value.charAt(n.position.start.offset);Dc(t,n=>["strong","emphasis"].includes(n.type),n=>{n.marker=r(n)})});ae(M8.plugin,{displayName:"Remark<remarkMarker>",group:"Remark"});ae(M8.options,{displayName:"RemarkConfig<remarkMarker>",group:"Remark"});const Tz=nn(()=>{let t=!1;const e=new Dr("MILKDOWN_INLINE_NODES_CURSOR"),r=new _r({key:e,state:{init(){return!1},apply(n){if(!n.selection.empty)return!1;const i=n.selection.$from,s=i.nodeBefore,o=i.nodeAfter;return!!(s&&o&&s.isInline&&!s.isText&&o.isInline&&!o.isText)}},props:{handleDOMEvents:{compositionend:(n,i)=>t?(t=!1,requestAnimationFrame(()=>{if(r.getState(n.state)){const o=n.state.selection.from;i.preventDefault(),n.dispatch(n.state.tr.insertText(i.data||"",o))}}),!0):!1,compositionstart:n=>(r.getState(n.state)&&(t=!0),!1),beforeinput:(n,i)=>{if(r.getState(n.state)&&i instanceof InputEvent&&i.data&&!t){const o=n.state.selection.from;return i.preventDefault(),n.dispatch(n.state.tr.insertText(i.data||"",o)),!0}return!1}},decorations(n){if(r.getState(n)){const o=n.selection.$from.pos,a=document.createElement("span"),l=Ur.widget(o,a,{side:-1}),c=document.createElement("span"),h=Ur.widget(o,c);return setTimeout(()=>{a.contentEditable="true",c.contentEditable="true"}),or.create(n.doc,[l,h])}return or.empty}}});return r});ae(Tz,{displayName:"Prose<inlineNodesCursorPlugin>",group:"Prose"});const _z=nn(t=>new _r({key:new Dr("MILKDOWN_HARDBREAK_MARKS"),appendTransaction:(e,r,n)=>{if(!e.length)return;const[i]=e;if(!i)return;const[s]=i.steps;if(i.getMeta("hardbreak")){if(!(s instanceof ln))return;const{from:l}=s;return n.tr.setNodeMarkup(l,jh.type(t),void 0,[])}if(s instanceof Wa){let l=n.tr;const{from:c,to:h}=s;return n.doc.nodesBetween(c,h,(u,d)=>{u.type===jh.type(t)&&(l=l.setNodeMarkup(d,jh.type(t),void 0,[]))}),l}}}));ae(_z,{displayName:"Prose<hardbreakClearMarkPlugin>",group:"Prose"});const A8=tr(["table","code_block"],"hardbreakFilterNodes");ae(A8,{displayName:"Ctx<hardbreakFilterNodes>",group:"Prose"});const Mz=nn(t=>{const e=t.get(A8.key);return new _r({key:new Dr("MILKDOWN_HARDBREAK_FILTER"),filterTransaction:(r,n)=>{const i=r.getMeta("hardbreak"),[s]=r.steps;if(i&&s){const{from:o}=s,a=n.doc.resolve(o);let l=a.depth,c=!0;for(;l>0;)e.includes(a.node(l).type.name)&&(c=!1),l--;return c}return!0}})});ae(Mz,{displayName:"Prose<hardbreakFilterPlugin>",group:"Prose"});const Az=nn(t=>{const e=new Dr("MILKDOWN_HEADING_ID"),r=n=>{if(n.composing)return;const i=t.get(kw.key),s=n.state.tr.setMeta("addToHistory",!1);let o=!1;const a={};n.state.doc.descendants((l,c)=>{if(l.type===Ji.type(t)){if(l.textContent.trim().length===0)return;const h=l.attrs;let u=i(l);a[u]?(a[u]+=1,u+=`-#${a[u]}`):a[u]=1,h.id!==u&&(o=!0,s.setMeta(e,!0).setNodeMarkup(c,void 0,{...h,id:u}))}}),o&&n.dispatch(s)};return new _r({key:e,view:n=>(r(n),{update:(i,s)=>{i.state.doc.eq(s.doc)||r(i)}})})});ae(Az,{displayName:"Prose<syncHeadingIdPlugin>",group:"Prose"});const Ez=nn(t=>{const e=(r,n,i)=>{if(!i.selection||r.some(u=>u.getMeta("addToHistory")===!1||!u.isGeneric))return null;const s=Ou.type(t),o=Eu.type(t),a=yo.type(t),l=(u,d)=>{let f=!1;const p=`${d+1}.`;return u.label!==p&&(u.label=p,f=!0),f};let c=i.tr,h=!1;return i.doc.descendants((u,d,f,p)=>
90{if(u.type===o){const m=u.maybeChild(0);(m==null?void 0:m.type)===a&&m.attrs.listType==="ordered"&&(h=!0,c.setNodeMarkup(d,s,{spread:"true"}),u.descendants((g,y,b,x)=>{if(g.type===a){const S={...g.attrs};l(S,x)&&(c=c.setNodeMarkup(y,void 0,S))}return!1}))}else if(u.type===a&&(f==null?void 0:f.type)===s){const m={...u.attrs};let g=!1;m.listType!=="ordered"&&(m.listType="ordered",g=!0),(f==null?void 0:f.maybeChild(0))&&(g=l(m,p)),g&&(c=c.setNodeMarkup(d,void 0,m),h=!0)}}),h?c.setMeta("addToHistory",!1):null};return new _r({key:new Dr("MILKDOWN_KEEP_LIST_ORDER"),appendTransaction:e})});ae(Ez,{displayName:"Prose<syncListOrderPlugin>",group:"Prose"});const wpe=[_z,A8,Mz,Tz,C8,T8,S8,_8,M8,ww,Az,Ez].flat(),Oz=[dpe,fpe,ppe,mpe,gpe,wpe].flat();/**
91* @vue/shared v3.5.18
92* (c) 2018-present Yuxi (Evan) You and Vue contributors
93* @license MIT
94**//*! #__NO_SIDE_EFFECTS__ */function E8(t){const e=Object.create(null);for(const r of t.split(","))e[r]=1;return r=>r in e}const dr={},bm=[],to=()=>{},kpe=()=>!1,Sw=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),O8=t=>t.startsWith("onUpdate:"),un=Object.assign,L8=(t,e)=>{const r=t.indexOf(e);r>-1&&t.splice(r,1)},Cpe=Object.prototype.hasOwnProperty,Xt=(t,e)=>Cpe.call(t,e),Tt=Array.isArray,xm=t=>Tw(t)==="[object Map]",Spe=t=>Tw(t)==="[object Set]",Mt=t=>typeof t=="function",dn=t=>typeof t=="string",r0=t=>typeof t=="symbol",zr=t=>t!==null&&typeof t=="object",Lz=t=>(zr(t)||Mt(t))&&Mt(t.then)&&Mt(t.catch),Tpe=Object.prototype.toString,Tw=t=>Tpe.call(t),_pe=t=>Tw(t).slice(8,-1),Mpe=t=>Tw(t)==="[object Object]",D8=t=>dn(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,vm=E8(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),_w=t=>{const e=Object.create(null);return r=>e[r]||(e[r]=t(r))},Ape=/-(\w)/g,vc=_w(t=>t.replace(Ape,(e,r)=>r?r.toUpperCase():"")),Epe=/\B([A-Z])/g,Lu=_w(t=>t.replace(Epe,"-$1").toLowerCase()),Dz=_w(t=>t.charAt(0).toUpperCase()+t.slice(1)),$5=_w(t=>t?`on${Dz(t)}`:""),lc=(t,e)=>!Object.is(t,e),z5=(t,...e)=>{for(let r=0;r<t.length;r++)t[r](...e)},mg=(t,e,r,n=!1)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:n,value:r})},Ope=t=>{const e=parseFloat(t);return isNaN(e)?t:e};let LO;const Uh=()=>LO||(LO=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function I8(t){if(Tt(t)){const e={};for(let r=0;r<t.length;r++){const n=t[r],i=dn(n)?Bpe(n):I8(n);if(i)for(const s in i)e[s]=i[s]}return e}else if(dn(t)||zr(t))return t}const Lpe=/;(?![^(]*\))/g,Dpe=/:([^]+)/,Ipe=/\/\*[^]*?\*\//g;function Bpe(t){const e={};return t.replace(Ipe,"").split(Lpe).forEach(r=>{if(r){const n=r.split(Dpe);n.length>1&&(e[n[0].trim()]=n[1].trim())}}),e}function B8(t){let e="";if(dn(t))e=t;else if(Tt(t))for(let r=0;r<t.length;r++){const n=B8(t[r]);n&&(e+=n+" ")}else if(zr(t))for(const r in t)t[r]&&(e+=r+" ");return e.trim()}const Rpe="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Ppe=E8(Rpe);function Iz(t){return!!t||t===""}/**
95* @vue/reactivity v3.5.18
96* (c) 2018-present Yuxi (Evan) You and Vue contributors
97* @license MIT
vendor: 15,091 bytes, line 98
98**/let vi;class Npe{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=vi,!e&&vi&&(this.index=(vi.scopes||(vi.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,r;if(this.scopes)for(e=0,r=this.scopes.length;e<r;e++)this.scopes[e].pause();for(e=0,r=this.effects.length;e<r;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,r;if(this.scopes)for(e=0,r=this.scopes.length;e<r;e++)this.scopes[e].resume();for(e=0,r=this.effects.length;e<r;e++)this.effects[e].resume()}}run(e){if(this._active){const r=vi;try{return vi=this,e()}finally{vi=r}}}on(){++this._on===1&&(this.prevScope=vi,vi=this)}off(){this._on>0&&--this._on===0&&(vi=this.prevScope,this.prevScope=void 0)}stop(e){if(this._active){this._active=!1;let r,n;for(r=0,n=this.effects.length;r<n;r++)this.effects[r].stop();for(this.effects.length=0,r=0,n=this.cleanups.length;r<n;r++)this.cleanups[r]();if(this.cleanups.length=0,this.scopes){for(r=0,n=this.scopes.length;r<n;r++)this.scopes[r].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){const i=this.parent.scopes.pop();i&&i!==this&&(this.parent.scopes[this.index]=i,i.index=this.index)}this.parent=void 0}}}function Fpe(){return vi}let ur;const H5=new WeakSet;class Bz{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,vi&&vi.active&&vi.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,H5.has(this)&&(H5.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Pz(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,DO(this),Nz(this);const e=ur,r=ro;ur=this,ro=!0;try{return this.fn()}finally{Fz(this),ur=e,ro=r,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)N8(e);this.deps=this.depsTail=void 0,DO(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?H5.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){HC(this)&&this.run()}get dirty(){return HC(this)}}let Rz=0,wm,km;function Pz(t,e=!1){if(t.flags|=8,e){t.next=km,km=t;return}t.next=wm,wm=t}function R8(){Rz++}function P8(){if(--Rz>0)return;if(km){let e=km;for(km=void 0;e;){const r=e.next;e.next=void 0,e.flags&=-9,e=r}}let t;for(;wm;){let e=wm;for(wm=void 0;e;){const r=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(n){t||(t=n)}e=r}}if(t)throw t}function Nz(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function Fz(t){let e,r=t.depsTail,n=r;for(;n;){const i=n.prevDep;n.version===-1?(n===r&&(r=i),N8(n),$pe(n)):e=n,n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0,n=i}t.deps=e,t.depsTail=r}function HC(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&($z(e.dep.computed)||e.dep.version!==e.version))return!0;return!!t._dirty}function $z(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===gg)||(t.globalVersion=gg,!t.isSSR&&t.flags&128&&(!t.deps&&!t._dirty||!HC(t))))return;t.flags|=2;const e=t.dep,r=ur,n=ro;ur=t,ro=!0;try{Nz(t);const i=t.fn(t._value);(e.version===0||lc(i,t._value))&&(t.flags|=128,t._value=i,e.version++)}catch(i){throw e.version++,i}finally{ur=r,ro=n,Fz(t),t.flags&=-3}}function N8(t,e=!1){const{dep:r,prevSub:n,nextSub:i}=t;if(n&&(n.nextSub=i,t.prevSub=void 0),i&&(i.prevSub=n,t.nextSub=void 0),r.subs===t&&(r.subs=n,!n&&r.computed)){r.computed.flags&=-5;for(let s=r.computed.deps;s;s=s.nextDep)N8(s,!0)}!e&&!--r.sc&&r.map&&r.map.delete(r.key)}function $pe(t){const{prevDep:e,nextDep:r}=t;e&&(e.nextDep=r,t.prevDep=void 0),r&&(r.prevDep=e,t.nextDep=void 0)}let ro=!0;const zz=[];function ol(){zz.push(ro),ro=!1}function al(){const t=zz.pop();ro=t===void 0?!0:t}function DO(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const r=ur;ur=void 0;try{e()}finally{ur=r}}}let gg=0;class zpe{constructor(e,r){this.sub=e,this.dep=r,this.version=r.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class F8{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!ur||!ro||ur===this.computed)return;let r=this.activeLink;if(r===void 0||r.sub!==ur)r=this.activeLink=new zpe(ur,this),ur.deps?(r.prevDep=ur.depsTail,ur.depsTail.nextDep=r,ur.depsTail=r):ur.deps=ur.depsTail=r,Hz(r);else if(r.version===-1&&(r.version=this.version,r.nextDep)){const n=r.nextDep;n.prevDep=r.prevDep,r.prevDep&&(r.prevDep.nextDep=n),r.prevDep=ur.depsTail,r.nextDep=void 0,ur.depsTail.nextDep=r,ur.depsTail=r,ur.deps===r&&(ur.deps=n)}return r}trigger(e){this.version++,gg++,this.notify(e)}notify(e){R8();try{for(let r=this.subs;r;r=r.prevSub)r.sub.notify()&&r.sub.dep.notify()}finally{P8()}}}function Hz(t){if(t.dep.sc++,t.sub.flags&4){const e=t.dep.computed;if(e&&!t.dep.subs){e.flags|=20;for(let n=e.deps;n;n=n.nextDep)Hz(n)}const r=t.dep.subs;r!==t&&(t.prevSub=r,r&&(r.nextSub=t)),t.dep.subs=t}}const qC=new WeakMap,Gh=Symbol(""),VC=Symbol(""),yg=Symbol("");function Rn(t,e,r){if(ro&&ur){let n=qC.get(t);n||qC.set(t,n=new Map);let i=n.get(r);i||(n.set(r,i=new F8),i.map=n,i.key=r),i.track()}}function Va(t,e,r,n,i,s){const o=qC.get(t);if(!o){gg++;return}const a=l=>{l&&l.trigger()};if(R8(),e==="clear")o.forEach(a);else{const l=Tt(t),c=l&&D8(r);if(l&&r==="length"){const h=Number(n);o.forEach((u,d)=>{(d==="length"||d===yg||!r0(d)&&d>=h)&&a(u)})}else switch((r!==void 0||o.has(void 0))&&a(o.get(r)),c&&a(o.get(yg)),e){case"add":l?c&&a(o.get("length")):(a(o.get(Gh)),xm(t)&&a(o.get(VC)));break;case"delete":l||(a(o.get(Gh)),xm(t)&&a(o.get(VC)));break;case"set":xm(t)&&a(o.get(Gh));break}}P8()}function Wu(t){const e=Yt(t);return e===t?e:(Rn(e,"iterate",yg),no(t)?e:e.map(Zn))}function $8(t){return Rn(t=Yt(t),"iterate",yg),t}const Hpe={__proto__:null,[Symbol.iterator](){return q5(this,Symbol.iterator,Zn)},concat(...t){return Wu(this).concat(...t.map(e=>Tt(e)?Wu(e):e))},entries(){return q5(this,"entries",t=>(t[1]=Zn(t[1]),t))},every(t,e){return xa(this,"every",t,e,void 0,arguments)},filter(t,e){return xa(this,"filter",t,e,r=>r.map(Zn),arguments)},find(t,e){return xa(this,"find",t,e,Zn,arguments)},findIndex(t,e){return xa(this,"findIndex",t,e,void 0,arguments)},findLast(t,e){return xa(this,"findLast",t,e,Zn,arguments)},findLastIndex(t,e){return xa(this,"findLastIndex",t,e,void 0,arguments)},forEach(t,e){return xa(this,"forEach",t,e,void 0,arguments)},includes(...t){return V5(this,"includes",t)},indexOf(...t){return V5(this,"indexOf",t)},join(t){return Wu(this).join(t)},lastIndexOf(...t){return V5(this,"lastIndexOf",t)},map(t,e){return xa(this,"map",t,e,void 0,arguments)},pop(){return z0(this,"pop")},push(...t){return z0(this,"push",t)},reduce(t,...e){return IO(this,"reduce",t,e)},reduceRight(t,...e){return IO(this,"reduceRight",t,e)},shift(){return z0(this,"shift")},some(t,e){return xa(this,"some",t,e,void 0,arguments)},splice(...t){return z0(this,"splice",t)},toReversed(){return Wu(this).toReversed()},toSorted(t){return Wu(this).toSorted(t)},toSpliced(...t){return Wu(this).toSpliced(...t)},unshift(...t){return z0(this,"unshift",t)},values(){return q5(this,"values",Zn)}};function q5(t,e,r){const n=$8(t),i=n[e]();return n!==t&&!no(t)&&(i._next=i.next,i.next=()=>{const s=i._next();return s.value&&(s.value=r(s.value)),s}),i}const qpe=Array.prototype;function xa(t,e,r,n,i,s){const o=$8(t),a=o!==t&&!no(t),l=o[e];if(l!==qpe[e]){const u=l.apply(t,s);return a?Zn(u):u}let c=r;o!==t&&(a?c=function(u,d){return r.call(this,Zn(u),d,t)}:r.length>2&&(c=function(u,d){return r.call(this,u,d,t)}));const h=l.call(o,c,n);return a&&i?i(h):h}function IO(t,e,r,n){const i=$8(t);let s=r;return i!==t&&(no(t)?r.length>3&&(s=function(o,a,l){return r.call(this,o,a,l,t)}):s=function(o,a,l){return r.call(this,o,Zn(a),l,t)}),i[e](s,...n)}function V5(t,e,r){const n=Yt(t);Rn(n,"iterate",yg);const i=n[e](...r);return(i===-1||i===!1)&&V8(r[0])?(r[0]=Yt(r[0]),n[e](...r)):i}function z0(t,e,r=[]){ol(),R8();const n=Yt(t)[e].apply(t,r);return P8(),al(),n}const Vpe=E8("__proto__,__v_isRef,__isVue"),qz=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(r0));function Wpe(t){r0(t)||(t=String(t));const e=Yt(this);return Rn(e,"has",t),e.hasOwnProperty(t)}class Vz{constructor(e=!1,r=!1){this._isReadonly=e,this._isShallow=r}get(e,r,n){if(r==="__v_skip")return e.__v_skip;const i=this._isReadonly,s=this._isShallow;if(r==="__v_isReactive")return!i;if(r==="__v_isReadonly")return i;if(r==="__v_isShallow")return s;if(r==="__v_raw")return n===(i?s?eme:Gz:s?Uz:jz).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;const o=Tt(e);if(!i){let l;if(o&&(l=Hpe[r]))return l;if(r==="hasOwnProperty")return Wpe}const a=Reflect.get(e,r,zn(e)?e:n);return(r0(r)?qz.has(r):Vpe(r))||(i||Rn(e,"get",r),s)?a:zn(a)?o&&D8(r)?a:a.value:zr(a)?i?Kz(a):H8(a):a}}class Wz extends Vz{constructor(e=!1){super(!1,e)}set(e,r,n,i){let s=e[r];if(!this._isShallow){const l=fu(s);if(!no(n)&&!fu(n)&&(s=Yt(s),n=Yt(n)),!Tt(e)&&zn(s)&&!zn(n))return l?!1:(s.value=n,!0)}const o=Tt(e)&&D8(r)?Number(r)<e.length:Xt(e,r),a=Reflect.set(e,r,n,zn(e)?e:i);return e===Yt(i)&&(o?lc(n,s)&&Va(e,"set",r,n):Va(e,"add",r,n)),a}deleteProperty(e,r){const n=Xt(e,r);e[r];const i=Reflect.deleteProperty(e,r);return i&&n&&Va(e,"delete",r,void 0),i}has(e,r){const n=Reflect.has(e,r);return(!r0(r)||!qz.has(r))&&Rn(e,"has",r),n}ownKeys(e){return Rn(e,"iterate",Tt(e)?"length":Gh),Reflect.ownKeys(e)}}class jpe extends Vz{constructor(e=!1){super(!0,e)}set(e,r){return!0}deleteProperty(e,r){return!0}}const Upe=new Wz,Gpe=new jpe,Kpe=new Wz(!0);const WC=t=>t,Iy=t=>Reflect.getPrototypeOf(t);function Ype(t,e,r){return function(...n){const i=this.__v_raw,s=Yt(i),o=xm(s),a=t==="entries"||t===Symbol.iterator&&o,l=t==="keys"&&o,c=i[t](...n),h=r?WC:e?jC:Zn;return!e&&Rn(s,"iterate",l?VC:Gh),{next(){const{value:u,done:d}=c.next();return d?{value:u,done:d}:{value:a?[h(u[0]),h(u[1])]:h(u),done:d}},[Symbol.iterator](){return this}}}}function By(t){return function(...e){return t==="delete"?!1:t==="clear"?void 0:this}}function Xpe(t,e){const r={get(i){const s=this.__v_raw,o=Yt(s),a=Yt(i);t||(lc(i,a)&&Rn(o,"get",i),Rn(o,"get",a));const{has:l}=Iy(o),c=e?WC:t?jC:Zn;if(l.call(o,i))return c(s.get(i));if(l.call(o,a))return c(s.get(a));s!==o&&s.get(i)},get size(){const i=this.__v_raw;return!t&&Rn(Yt(i),"iterate",Gh),Reflect.get(i,"size",i)},has(i){const s=this.__v_raw,o=Yt(s),a=Yt(i);return t||(lc(i,a)&&Rn(o,"has",i),Rn(o,"has",a)),i===a?s.has(i):s.has(i)||s.has(a)},forEach(i,s){const o=this,a=o.__v_raw,l=Yt(a),c=e?WC:t?jC:Zn;return!t&&Rn(l,"iterate",Gh),a.forEach((h,u)=>i.call(s,c(h),c(u),o))}};return un(r,t?{add:By("add"),set:By("set"),delete:By("delete"),clear:By("clear")}:{add(i){!e&&!no(i)&&!fu(i)&&(i=Yt(i));const s=Yt(this);return Iy(s).has.call(s,i)||(s.add(i),Va(s,"add",i,i)),this},set(i,s){!e&&!no(s)&&!fu(s)&&(s=Yt(s));const o=Yt(this),{has:a,get:l}=Iy(o);let c=a.call(o,i);c||(i=Yt(i),c=a.call(o,i));const h=l.call(o,i);return o.set(i,s),c?lc(s,h)&&Va(o,"set",i,s):Va(o,"add",i,s),this},delete(i){const s=Yt(this),{has:o,get:a}=Iy(s);let l=o.call(s,i);l||(i=Yt(i),l=o.call(s,i)),a&&a.call(s,i);const c=s.delete(i);return l&&Va(s,"delete",i,void 0),c},clear(){const i=Yt(this),s=i.size!==0,o=i.clear();return s&&Va(i,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(i=>{r[i]=Ype(i,t,e)}),r}function z8(t,e){const r=Xpe(t,e);return(n,i,s)=>i==="__v_isReactive"?!t:i==="__v_isReadonly"?t:i==="__v_raw"?n:Reflect.get(Xt(r,i)&&i in n?r:n,i,s)}const Jpe={get:z8(!1,!1)},Zpe={get:z8(!1,!0)},Qpe={get:z8(!0,!1)};const jz=new WeakMap,Uz=new WeakMap,Gz=new WeakMap,eme=new WeakMap;function tme(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function rme(t){return t.__v_skip||!Object.isExtensible(t)?0:tme(_pe(t))}function H8(t){return fu(t)?t:q8(t,!1,Upe,Jpe,jz)}function nme(t){return q8(t,!1,Kpe,Zpe,Uz)}function Kz(t){return q8(t,!0,Gpe,Qpe,Gz)}function q8(t,e,r,n,i){if(!zr(t)||t.__v_raw&&!(e&&t.__v_isReactive))return t;const s=rme(t);if(s===0)return t;const o=i.get(t);if(o)return o;const a=new Proxy(t,s===2?n:r);return i.set(t,a),a}function Cm(t){return fu(t)?Cm(t.__v_raw):!!(t&&t.__v_isReactive)}function fu(t){return!!(t&&t.__v_isReadonly)}function no(t){return!!(t&&t.__v_isShallow)}function V8(t){return t?!!t.__v_raw:!1}function Yt(t){const e=t&&t.__v_raw;return e?Yt(e):t}function ime(t){return!Xt(t,"__v_skip")&&Object.isExtensible(t)&&mg(t,"__v_skip",!0),t}const Zn=t=>zr(t)?H8(t):t,jC=t=>zr(t)?Kz(t):t;function zn(t){return t?t.__v_isRef===!0:!1}function We(t){return Yz(t,!1)}function wx(t){return Yz(t,!0)}function Yz(t,e){return zn(t)?t:new sme(t,e)}class sme{constructor(e,r){this.dep=new F8,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=r?e:Yt(e),this._value=r?e:Zn(e),this.__v_isShallow=r}get value(){return this.dep.track(),this._value}set value(e){const r=this._rawValue,n=this.__v_isShallow||no(e)||fu(e);e=n?e:Yt(e),lc(e,r)&&(this._rawValue=e,this._value=n?e:Zn(e),this.dep.trigger())}}function ome(t){return zn(t)?t.value:t}const ame={get:(t,e,r)=>e==="__v_raw"?t:ome(Reflect.get(t,e,r)),set:(t,e,r,n)=>{const i=t[e];return zn(i)&&!zn(r)?(i.value=r,!0):Reflect.set(t,e,r,n)}};function Xz(t){return Cm(t)?t:new Proxy(t,ame)}class lme{constructor(e,r,n){this.fn=e,this.setter=r,this._value=void 0,this.dep=new F8(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=gg-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!r,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&ur!==this)return Pz(this,!0),!0}get value(){const e=this.dep.track();return $z(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function cme(t,e,r=!1){let n,i;return Mt(t)?n=t:(n=t.get,i=t.set),new lme(n,i,r)}const Ry={},kx=new WeakMap;let rh;function hme(t,e=!1,r=rh){if(r){let n=kx.get(r);n||kx.set(r,n=[]),n.push(t)}}function ume(t,e,r=dr){const{immediate:n,deep:i,once:s,scheduler:o,augmentJob:a,call:l}=r,c=S=>i?S:no(S)||i===!1||i===0?jl(S,1):jl(S);let h,u,d,f,p=!1,m=!1;if(zn(t)?(u=()=>t.value,p=no(t)):Cm(t)?(u=()=>c(t),p=!0):Tt(t)?(m=!0,p=t.some(S=>Cm(S)||no(S)),u=()=>t.map(S=>{if(zn(S))return S.value;if(Cm(S))return c(S);if(Mt(S))return l?l(S,2):S()})):Mt(t)?e?u=l?()=>l(t,2):t:u=()=>{if(d){ol();try{d()}finally{al()}}const S=rh;rh=h;try{return l?l(t,3,[f]):t(f)}finally{rh=S}}:u=to,e&&i){const S=u,k=i===!0?1/0:i;u=()=>jl(S(),k)}const g=Fpe(),y=()=>{h.stop(),g&&g.active&&L8(g.effects,h)};if(s&&e){const S=e;e=(...k)=>{S(...k),y()}}let b=m?new Array(t.length).fill(Ry):Ry;const x=S=>{if(!(!(h.flags&1)||!h.dirty&&!S))if(e){const k=h.run();if(i||p||(m?k.some((w,_)=>lc(w,b[_])):lc(k,b))){d&&d();const w=rh;rh=h;try{const _=[k,b===Ry?void 0:m&&b[0]===Ry?[]:b,f];b=k,l?l(e,3,_):e(..._)}finally{rh=w}}}else h.run()};
98return a&&a(x),h=new Bz(u),h.scheduler=o?()=>o(x,!1):x,f=S=>hme(S,!1,h),d=h.onStop=()=>{const S=kx.get(h);if(S){if(l)l(S,4);else for(const k of S)k();kx.delete(h)}},e?n?x(!0):b=h.run():o?o(x.bind(null,!0),!0):h.run(),y.pause=h.pause.bind(h),y.resume=h.resume.bind(h),y.stop=y,y}function jl(t,e=1/0,r){if(e<=0||!zr(t)||t.__v_skip||(r=r||new Set,r.has(t)))return t;if(r.add(t),e--,zn(t))jl(t.value,e,r);else if(Tt(t))for(let n=0;n<t.length;n++)jl(t[n],e,r);else if(Spe(t)||xm(t))t.forEach(n=>{jl(n,e,r)});else if(Mpe(t)){for(const n in t)jl(t[n],e,r);for(const n of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,n)&&jl(t[n],e,r)}return t}/**
99* @vue/runtime-core v3.5.18
100* (c) 2018-present Yuxi (Evan) You and Vue contributors
101* @license MIT
102**/function O1(t,e,r,n){try{return n?t(...n):t()}catch(i){Mw(i,e,r)}}function na(t,e,r,n){if(Mt(t)){const i=O1(t,e,r,n);return i&&Lz(i)&&i.catch(s=>{Mw(s,e,r)}),i}if(Tt(t)){const i=[];for(let s=0;s<t.length;s++)i.push(na(t[s],e,r,n));return i}}function Mw(t,e,r,n=!0){const i=e?e.vnode:null,{errorHandler:s,throwUnhandledErrorInProduction:o}=e&&e.appContext.config||dr;if(e){let a=e.parent;const l=e.proxy,c=`https://vuejs.org/error-reference/#runtime-${r}`;for(;a;){const h=a.ec;if(h){for(let u=0;u<h.length;u++)if(h[u](t,l,c)===!1)return}a=a.parent}if(s){ol(),O1(s,null,10,[t,l,c]),al();return}}dme(t,r,i,n,o)}function dme(t,e,r,n=!0,i=!1){if(i)throw t;console.error(t)}const Qn=[];let Io=-1;const Cd=[];let $l=null,ed=0;const Jz=Promise.resolve();let Cx=null;function fme(t){const e=Cx||Jz;return t?e.then(this?t.bind(this):t):e}function pme(t){let e=Io+1,r=Qn.length;for(;e<r;){const n=e+r>>>1,i=Qn[n],s=bg(i);s<t||s===t&&i.flags&2?e=n+1:r=n}return e}function W8(t){if(!(t.flags&1)){const e=bg(t),r=Qn[Qn.length-1];!r||!(t.flags&2)&&e>=bg(r)?Qn.push(t):Qn.splice(pme(e),0,t),t.flags|=1,Zz()}}function Zz(){Cx||(Cx=Jz.then(eH))}function mme(t){Tt(t)?Cd.push(...t):$l&&t.id===-1?$l.splice(ed+1,0,t):t.flags&1||(Cd.push(t),t.flags|=1),Zz()}function BO(t,e,r=Io+1){for(;r<Qn.length;r++){const n=Qn[r];if(n&&n.flags&2){if(t&&n.id!==t.uid)continue;Qn.splice(r,1),r--,n.flags&4&&(n.flags&=-2),n(),n.flags&4||(n.flags&=-2)}}}function Qz(t){if(Cd.length){const e=[...new Set(Cd)].sort((r,n)=>bg(r)-bg(n));if(Cd.length=0,$l){$l.push(...e);return}for($l=e,ed=0;ed<$l.length;ed++){const r=$l[ed];r.flags&4&&(r.flags&=-2),r.flags&8||r(),r.flags&=-2}$l=null,ed=0}}const bg=t=>t.id==null?t.flags&2?-1:1/0:t.id;function eH(t){try{for(Io=0;Io<Qn.length;Io++){const e=Qn[Io];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),O1(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;Io<Qn.length;Io++){const e=Qn[Io];e&&(e.flags&=-2)}Io=-1,Qn.length=0,Qz(),Cx=null,(Qn.length||Cd.length)&&eH()}}let zo,wp=[],UC=!1;function Aw(t,...e){zo?zo.emit(t,...e):UC||wp.push({event:t,args:e})}function tH(t,e){var r,n;zo=t,zo?(zo.enabled=!0,wp.forEach(({event:i,args:s})=>zo.emit(i,...s)),wp=[]):typeof window<"u"&&window.HTMLElement&&!((n=(r=window.navigator)==null?void 0:r.userAgent)!=null&&n.includes("jsdom"))?((e.__VUE_DEVTOOLS_HOOK_REPLAY__=e.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(s=>{tH(s,e)}),setTimeout(()=>{zo||(e.__VUE_DEVTOOLS_HOOK_REPLAY__=null,UC=!0,wp=[])},3e3)):(UC=!0,wp=[])}function gme(t,e){Aw("app:init",t,e,{Fragment:Cn,Text:I1,Comment:pu,Static:Q2})}function yme(t){Aw("app:unmount",t)}const bme=j8("component:added"),rH=j8("component:updated"),xme=j8("component:removed"),vme=t=>{zo&&typeof zo.cleanupBuffer=="function"&&!zo.cleanupBuffer(t)&&xme(t)};/*! #__NO_SIDE_EFFECTS__ */function j8(t){return e=>{Aw(t,e.appContext.app,e.uid,e.parent?e.parent.uid:void 0,e)}}function wme(t,e,r){Aw("component:emit",t.appContext.app,t,e,r)}let Wo=null,nH=null;function Sx(t){const e=Wo;return Wo=t,nH=t&&t.type.__scopeId||null,e}function kme(t,e=Wo,r){if(!e||t._n)return t;const n=(...i)=>{n._d&&qO(-1);const s=Sx(e);let o;try{o=t(...i)}finally{Sx(s),n._d&&qO(1)}return __VUE_PROD_DEVTOOLS__&&rH(e),o};return n._n=!0,n._c=!0,n._d=!0,n}function Wc(t,e,r,n){const i=t.dirs,s=e&&e.dirs;for(let o=0;o<i.length;o++){const a=i[o];s&&(a.oldValue=s[o].value);let l=a.dir[n];l&&(ol(),na(l,r,8,[t.el,a,t,e]),al())}}const Cme=Symbol("_vte"),Sme=t=>t.__isTeleport;function U8(t,e){t.shapeFlag&6&&t.component?(t.transition=e,U8(t.component.subTree,e)):t.shapeFlag&128?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}/*! #__NO_SIDE_EFFECTS__ */function En(t,e){return Mt(t)?un({name:t.name},e,{setup:t}):t}function iH(t){t.ids=[t.ids[0]+t.ids[2]+++"-",0,0]}function Sm(t,e,r,n,i=!1){if(Tt(t)){t.forEach((p,m)=>Sm(p,e&&(Tt(e)?e[m]:e),r,n,i));return}if(Tm(n)&&!i){n.shapeFlag&512&&n.type.__asyncResolved&&n.component.subTree.component&&Sm(t,e,r,n.component.subTree);return}
102const s=n.shapeFlag&4?Q8(n.component):n.el,o=i?null:s,{i:a,r:l}=t,c=e&&e.r,h=a.refs===dr?a.refs={}:a.refs,u=a.setupState,d=Yt(u),f=u===dr?()=>!1:p=>Xt(d,p);if(c!=null&&c!==l&&(dn(c)?(h[c]=null,f(c)&&(u[c]=null)):zn(c)&&(c.value=null)),Mt(l))O1(l,a,12,[o,h]);else{const p=dn(l),m=zn(l);if(p||m){const g=()=>{if(t.f){const y=p?f(l)?u[l]:h[l]:l.value;i?Tt(y)&&L8(y,s):Tt(y)?y.includes(s)||y.push(s):p?(h[l]=[s],f(l)&&(u[l]=h[l])):(l.value=[s],t.k&&(h[t.k]=l.value))}else p?(h[l]=o,f(l)&&(u[l]=o)):m&&(l.value=o,t.k&&(h[t.k]=o))};o?(g.id=-1,Gi(g,r)):g()}}}Uh().requestIdleCallback;Uh().cancelIdleCallback;const Tm=t=>!!t.type.__asyncLoader,sH=t=>t.type.__isKeepAlive;function Tme(t,e){oH(t,"a",e)}function _me(t,e){oH(t,"da",e)}function oH(t,e,r=ti){const n=t.__wdc||(t.__wdc=()=>{let i=r;for(;i;){if(i.isDeactivated)return;i=i.parent}return t()});if(Ew(e,n,r),r){let i=r.parent;for(;i&&i.parent;)sH(i.parent.vnode)&&Mme(n,e,r,i),i=i.parent}}function Mme(t,e,r,n){const i=Ew(e,t,n,!0);D1(()=>{L8(n[e],i)},r)}function Ew(t,e,r=ti,n=!1){if(r){const i=r[t]||(r[t]=[]),s=e.__weh||(e.__weh=(...o)=>{ol();const a=B1(r),l=na(e,r,t,o);return a(),al(),l});return n?i.unshift(s):i.push(s),s}}const xl=t=>(e,r=ti)=>{(!xg||t==="sp")&&Ew(t,(...n)=>e(...n),r)},Ame=xl("bm"),L1=xl("m"),Eme=xl("bu"),Ome=xl("u"),Lme=xl("bum"),D1=xl("um"),Dme=xl("sp"),Ime=xl("rtg"),Bme=xl("rtc");function Rme(t,e=ti){Ew("ec",t,e)}const Pme=Symbol.for("v-ndc"),GC=t=>t?CH(t)?Q8(t):GC(t.parent):null,_m=un(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>GC(t.parent),$root:t=>GC(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>__VUE_OPTIONS_API__?G8(t):t.type,$forceUpdate:t=>t.f||(t.f=()=>{W8(t.update)}),$nextTick:t=>t.n||(t.n=fme.bind(t.proxy)),$watch:t=>__VUE_OPTIONS_API__?sge.bind(t):to}),W5=(t,e)=>t!==dr&&!t.__isScriptSetup&&Xt(t,e),Nme={get({_:t},e){if(e==="__v_skip")return!0;const{ctx:r,setupState:n,data:i,props:s,accessCache:o,type:a,appContext:l}=t;let c;if(e[0]!=="$"){const f=o[e];if(f!==void 0)switch(f){case 1:return n[e];case 2:return i[e];case 4:return r[e];case 3:return s[e]}else{if(W5(n,e))return o[e]=1,n[e];if(i!==dr&&Xt(i,e))return o[e]=2,i[e];if((c=t.propsOptions[0])&&Xt(c,e))return o[e]=3,s[e];if(r!==dr&&Xt(r,e))return o[e]=4,r[e];(!__VUE_OPTIONS_API__||KC)&&(o[e]=0)}}const h=_m[e];let u,d;if(h)return e==="$attrs"&&Rn(t.attrs,"get",""),h(t);if((u=a.__cssModules)&&(u=u[e]))return u;if(r!==dr&&Xt(r,e))return o[e]=4,r[e];if(d=l.config.globalProperties,Xt(d,e))return d[e]},set({_:t},e,r){const{data:n,setupState:i,ctx:s}=t;return W5(i,e)?(i[e]=r,!0):n!==dr&&Xt(n,e)?(n[e]=r,!0):Xt(t.props,e)||e[0]==="$"&&e.slice(1)in t?!1:(s[e]=r,!0)},has({_:{data:t,setupState:e,accessCache:r,ctx:n,appContext:i,propsOptions:s}},o){let a;return!!r[o]||t!==dr&&Xt(t,o)||W5(e,o)||(a=s[0])&&Xt(a,o)||Xt(n,o)||Xt(_m,o)||Xt(i.config.globalProperties,o)},defineProperty(t,e,r){return r.get!=null?t._.accessCache[e]=0:Xt(r,"value")&&this.set(t,e,r.value,null),Reflect.defineProperty(t,e,r)}};function RO(t){return Tt(t)?t.reduce((e,r)=>(e[r]=null,e),{}):t}let KC=!0;function Fme(t){const e=G8(t),r=t.proxy,n=t.ctx;KC=!1,e.beforeCreate&&PO(e.beforeCreate,t,"bc");const{data:i,computed:s,methods:o,watch:a,provide:l,inject:c,created:h,beforeMount:u,mounted:d,beforeUpdate:f,updated:p,activated:m,deactivated:g,beforeDestroy:y,beforeUnmount:b,destroyed:x,unmounted:S,render:k,renderTracked:w,renderTriggered:_,errorCaptured:L,serverPrefetch:B,expose:E,inheritAttrs:D,components:N,directives:K,filters:z}=e;if(c&&$me(c,n,null),o)for(const j in o){const q=o[j];Mt(q)&&(n[j]=q.bind(r))}if(i){const j=i.call(r,r);zr(j)&&(t.data=H8(j))}if(KC=!0,s)for(const j in s){const q=s[j],ne=Mt(q)?q.bind(r,r):Mt(q.get)?q.get.bind(r,r):to,O=!Mt(q)&&Mt(q.set)?q.set.bind(r):to,fe=mu({get:ne,set:O});Object.defineProperty(n,j,{enumerable:!0,configurable:!0,get:()=>fe.value,set:Te=>fe.value=Te})}if(a)for(const j in a)aH(a[j],n,r,j);if(l){const j=Mt(l)?l.call(r):l;Reflect.ownKeys(j).forEach(q=>{jme(q,j[q])})}h&&PO(h,t,"c");function H(j,q){Tt(q)?q.forEach(ne=>j(ne.bind(r))):q&&j(q.bind(r))}if(H(Ame,u),H(L1,d),H(Eme,f),H(Ome,p),H(Tme,m),H(_me,g),H(Rme,L),H(Bme,w),H(Ime,_),H(Lme,b),H(D1,S),H(Dme,B),Tt(E))if(E.length){const j=t.exposed||(t.exposed={});
vendor: 8,730 bytes, line 102
102E.forEach(q=>{Object.defineProperty(j,q,{get:()=>r[q],set:ne=>r[q]=ne,enumerable:!0})})}else t.exposed||(t.exposed={});k&&t.render===to&&(t.render=k),D!=null&&(t.inheritAttrs=D),N&&(t.components=N),K&&(t.directives=K),B&&iH(t)}function $me(t,e,r=to){Tt(t)&&(t=YC(t));for(const n in t){const i=t[n];let s;zr(i)?"default"in i?s=Z2(i.from||n,i.default,!0):s=Z2(i.from||n):s=Z2(i),zn(s)?Object.defineProperty(e,n,{enumerable:!0,configurable:!0,get:()=>s.value,set:o=>s.value=o}):e[n]=s}}function PO(t,e,r){na(Tt(t)?t.map(n=>n.bind(e.proxy)):t.bind(e.proxy),e,r)}function aH(t,e,r,n){let i=n.includes(".")?xH(r,n):()=>r[n];if(dn(t)){const s=e[t];Mt(s)&&Td(i,s)}else if(Mt(t))Td(i,t.bind(r));else if(zr(t))if(Tt(t))t.forEach(s=>aH(s,e,r,n));else{const s=Mt(t.handler)?t.handler.bind(r):e[t.handler];Mt(s)&&Td(i,s,t)}}function G8(t){const e=t.type,{mixins:r,extends:n}=e,{mixins:i,optionsCache:s,config:{optionMergeStrategies:o}}=t.appContext,a=s.get(e);let l;return a?l=a:!i.length&&!r&&!n?l=e:(l={},i.length&&i.forEach(c=>Tx(l,c,o,!0)),Tx(l,e,o)),zr(e)&&s.set(e,l),l}function Tx(t,e,r,n=!1){const{mixins:i,extends:s}=e;s&&Tx(t,s,r,!0),i&&i.forEach(o=>Tx(t,o,r,!0));for(const o in e)if(!(n&&o==="expose")){const a=zme[o]||r&&r[o];t[o]=a?a(t[o],e[o]):e[o]}return t}const zme={data:NO,props:FO,emits:FO,methods:kp,computed:kp,beforeCreate:Jn,created:Jn,beforeMount:Jn,mounted:Jn,beforeUpdate:Jn,updated:Jn,beforeDestroy:Jn,beforeUnmount:Jn,destroyed:Jn,unmounted:Jn,activated:Jn,deactivated:Jn,errorCaptured:Jn,serverPrefetch:Jn,components:kp,directives:kp,watch:qme,provide:NO,inject:Hme};function NO(t,e){return e?t?function(){return un(Mt(t)?t.call(this,this):t,Mt(e)?e.call(this,this):e)}:e:t}function Hme(t,e){return kp(YC(t),YC(e))}function YC(t){if(Tt(t)){const e={};for(let r=0;r<t.length;r++)e[t[r]]=t[r];return e}return t}function Jn(t,e){return t?[...new Set([].concat(t,e))]:e}function kp(t,e){return t?un(Object.create(null),t,e):e}function FO(t,e){return t?Tt(t)&&Tt(e)?[...new Set([...t,...e])]:un(Object.create(null),RO(t),RO(e??{})):e}function qme(t,e){if(!t)return e;if(!e)return t;const r=un(Object.create(null),t);for(const n in e)r[n]=Jn(t[n],e[n]);return r}function lH(){return{app:null,config:{isNativeTag:kpe,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let Vme=0;function Wme(t,e){return function(n,i=null){Mt(n)||(n=un({},n)),i!=null&&!zr(i)&&(i=null);const s=lH(),o=new WeakSet,a=[];let l=!1;const c=s.app={_uid:Vme++,_component:n,_props:i,_container:null,_context:s,_instance:null,version:UO,get config(){return s.config},set config(h){},use(h,...u){return o.has(h)||(h&&Mt(h.install)?(o.add(h),h.install(c,...u)):Mt(h)&&(o.add(h),h(c,...u))),c},mixin(h){return __VUE_OPTIONS_API__&&(s.mixins.includes(h)||s.mixins.push(h)),c},component(h,u){return u?(s.components[h]=u,c):s.components[h]},directive(h,u){return u?(s.directives[h]=u,c):s.directives[h]},mount(h,u,d){if(!l){const f=c._ceVNode||Zs(n,i);return f.appContext=s,d===!0?d="svg":d===!1&&(d=void 0),u&&e?e(f,h):t(f,h,d),l=!0,c._container=h,h.__vue_app__=c,__VUE_PROD_DEVTOOLS__&&(c._instance=f.component,gme(c,UO)),Q8(f.component)}},onUnmount(h){a.push(h)},unmount(){l&&(na(a,c._instance,16),t(null,c._container),__VUE_PROD_DEVTOOLS__&&(c._instance=null,yme(c)),delete c._container.__vue_app__)},provide(h,u){return s.provides[h]=u,c},runWithContext(h){const u=Sd;Sd=c;try{return h()}finally{Sd=u}}};return c}}let Sd=null;function jme(t,e){if(ti){let r=ti.provides;const n=ti.parent&&ti.parent.provides;n===r&&(r=ti.provides=Object.create(n)),r[t]=e}}function Z2(t,e,r=!1){const n=wge();if(n||Sd){let i=Sd?Sd._context.provides:n?n.parent==null||n.ce?n.vnode.appContext&&n.vnode.appContext.provides:n.parent.provides:void 0;if(i&&t in i)return i[t];if(arguments.length>1)return r&&Mt(e)?e.call(n&&n.proxy):e}}const cH={},hH=()=>Object.create(cH),uH=t=>Object.getPrototypeOf(t)===cH;function Ume(t,e,r,n=!1){const i={},s=hH();t.propsDefaults=Object.create(null),dH(t,e,i,s);for(const o in t.propsOptions[0])o in i||(i[o]=void 0);r?t.props=n?i:nme(i):t.type.props?t.props=i:t.props=s,t.attrs=s}function Gme(t,e,r,n){const{props:i,attrs:s,vnode:{patchFlag:o}}=t,a=Yt(i),[l]=t.propsOptions;let c=!1;if((n||o>0)&&!(o&16)){if(o&8){const h=t.vnode.dynamicProps;for(let u=0;u<h.length;u++){let d=h[u];if(Ow(t.emitsOptions,d))continue;const f=e[d];if(l)if(Xt(s,d))f!==s[d]&&(s[d]=f,c=!0);else{const p=vc(d);i[p]=XC(l,a,p,f,t,!1)}else f!==s[d]&&(s[d]=f,c=!0)}}}else{dH(t,e,i,s)&&(c=!0);let h;for(const u in a)(!e||!Xt(e,u)&&((h=Lu(u))===u||!Xt(e,h)))&&(l?r&&(r[u]!==void 0||r[h]!==void 0)&&(i[u]=XC(l,a,u,void 0,t,!0)):delete i[u]);if(s!==a)for(const u in s)(!e||!Xt(e,u))&&(delete s[u],c=!0)}c&&Va(t.attrs,"set","")}function dH(t,e,r,n){const[i,s]=t.propsOptions;let o=!1,a;if(e)for(let l in e){if(vm(l))continue;const c=e[l];let h;i&&Xt(i,h=vc(l))?!s||!s.includes(h)?r[h]=c:(a||(a={}))[h]=c:Ow(t.emitsOptions,l)||(!(l in n)||c!==n[l])&&(n[l]=c,o=!0)}if(s){const l=Yt(r),c=a||dr;for(let h=0;h<s.length;h++){const u=s[h];r[u]=XC(i,l,u,c[u],t,!Xt(c,u))}}return o}function XC(t,e,r,n,i,s){const o=t[r];if(o!=null){const a=Xt(o,"default");if(a&&n===void 0){const l=o.default;if(o.type!==Function&&!o.skipFactory&&Mt(l)){const{propsDefaults:c}=i;if(r in c)n=c[r];else{const h=B1(i);n=c[r]=l.call(null,e),h()}}else n=l;i.ce&&i.ce._setProp(r,n)}o[0]&&(s&&!a?n=!1:o[1]&&(n===""||n===Lu(r))&&(n=!0))}return n}const Kme=new WeakMap;function fH(t,e,r=!1){const n=__VUE_OPTIONS_API__&&r?Kme:e.propsCache,i=n.get(t);if(i)return i;const s=t.props,o={},a=[];let l=!1;if(__VUE_OPTIONS_API__&&!Mt(t)){const h=u=>{l=!0;const[d,f]=fH(u,e,!0);un(o,d),f&&a.push(...f)};!r&&e.mixins.length&&e.mixins.forEach(h),t.extends&&h(t.extends),t.mixins&&t.mixins.forEach(h)}if(!s&&!l)return zr(t)&&n.set(t,bm),bm;if(Tt(s))for(let h=0;h<s.length;h++){const u=vc(s[h]);$O(u)&&(o[u]=dr)}else if(s)for(const h in s){const u=vc(h);if($O(u)){const d=s[h],f=o[u]=Tt(d)||Mt(d)?{type:d}:un({},d),p=f.type;let m=!1,g=!0;if(Tt(p))for(let y=0;y<p.length;++y){const b=p[y],x=Mt(b)&&b.name;if(x==="Boolean"){m=!0;break}else x==="String"&&(g=!1)}else m=Mt(p)&&p.name==="Boolean";f[0]=m,f[1]=g,(m||Xt(f,"default"))&&a.push(u)}}const c=[o,a];return zr(t)&&n.set(t,c),c}function $O(t){return t[0]!=="$"&&!vm(t)}const K8=t=>t==="_"||t==="__"||t==="_ctx"||t==="$stable",Y8=t=>Tt(t)?t.map(Po):[Po(t)],Yme=(t,e,r)=>{if(e._n)return e;const n=kme((...i)=>Y8(e(...i)),r);return n._c=!1,n},pH=(t,e,r)=>{const n=t._ctx;for(const i in t){if(K8(i))continue;const s=t[i];if(Mt(s))e[i]=Yme(i,s,n);else if(s!=null){const o=Y8(s);e[i]=()=>o}}},mH=(t,e)=>{const r=Y8(e);t.slots.default=()=>r},gH=(t,e,r)=>{for(const n in e)(r||!K8(n))&&(t[n]=e[n])},Xme=(t,e,r)=>{const n=t.slots=hH();if(t.vnode.shapeFlag&32){const i=e.__;i&&mg(n,"__",i,!0);const s=e._;s?(gH(n,e,r),r&&mg(n,"_",s,!0)):pH(e,n)}else e&&mH(t,e)},Jme=(t,e,r)=>{const{vnode:n,slots:i}=t;let s=!0,o=dr;if(n.shapeFlag&32){const a=e._;a?r&&a===1?s=!1:gH(i,e,r):(s=!e.$stable,pH(e,i)),o=e}else e&&(mH(t,e),o={default:1});if(s)for(const a in i)!K8(a)&&o[a]==null&&delete i[a]};function Zme(){typeof __VUE_OPTIONS_API__!="boolean"&&(Uh().__VUE_OPTIONS_API__=!0),typeof __VUE_PROD_DEVTOOLS__!="boolean"&&(Uh().__VUE_PROD_DEVTOOLS__=!1),typeof __VUE_PROD_HYDRATION_MISMATCH_DETAILS__!="boolean"&&(Uh().__VUE_PROD_HYDRATION_MISMATCH_DETAILS__=!1)}const Gi=dge;function Qme(t){return ege(t)}function ege(t,e){Zme();const r=Uh();r.__VUE__=!0,__VUE_PROD_DEVTOOLS__&&tH(r.__VUE_DEVTOOLS_GLOBAL_HOOK__,r);const{insert:n,remove:i,patchProp:s,createElement:o,createText:a,createComment:l,setText:c,setElementText:h,parentNode:u,nextSibling:d,setScopeId:f=to,insertStaticContent:p}=t,m=(R,W,ee,pe=null,le=null,he=null,ke=void 0,Ce=null,ve=!!W.dynamicChildren)=>{if(R===W)return;R&&!H0(R,W)&&(pe=Ze(R),Te(R,le,he,!0),R=null),W.patchFlag===-2&&(ve=!1,W.dynamicChildren=null);const{type:ge,ref:Ye,shapeFlag:_e}=W;switch(ge){case I1:g(R,W,ee,pe);break;case pu:y(R,W,ee,pe);break;case Q2:R==null&&b(W,ee,pe,ke);break;case Cn:N(R,W,ee,pe,le,he,ke,Ce,ve);break;default:_e&1?k(R,W,ee,pe,le,he,ke,Ce,ve):_e&6?K(R,W,ee,pe,le,he,ke,Ce,ve):(_e&64||_e&128)&&ge.process(R,W,ee,pe,le,he,ke,Ce,ve,wt)}Ye!=null&&le?Sm(Ye,R&&R.ref,he,W||R,!W):Ye==null&&R&&R.ref!=null&&Sm(R.ref,null,he,R,!0)},g=(R,W,ee,pe)=>{if(R==null)n(W.el=a(W.children),ee,pe);else{const le=W.el=R.el;W.children!==R.children&&c(le,W.children)}},y=(R,W,ee,pe)=>{R==null?n(W.el=l(W.children||""),ee,pe):W.el=R.el},b=(R,W,ee,pe)=>{[R.el,R.anchor]=p(R.children,W,ee,pe,R.el,R.anchor)},x=({el:R,anchor:W},ee,pe)=>{let le;
vendor: 3,568 bytes, line 102
102for(;R&&R!==W;)le=d(R),n(R,ee,pe),R=le;n(W,ee,pe)},S=({el:R,anchor:W})=>{let ee;for(;R&&R!==W;)ee=d(R),i(R),R=ee;i(W)},k=(R,W,ee,pe,le,he,ke,Ce,ve)=>{W.type==="svg"?ke="svg":W.type==="math"&&(ke="mathml"),R==null?w(W,ee,pe,le,he,ke,Ce,ve):B(R,W,le,he,ke,Ce,ve)},w=(R,W,ee,pe,le,he,ke,Ce)=>{let ve,ge;const{props:Ye,shapeFlag:_e,transition:Fe,dirs:Y}=R;if(ve=R.el=o(R.type,he,Ye&&Ye.is,Ye),_e&8?h(ve,R.children):_e&16&&L(R.children,ve,null,pe,le,j5(R,he),ke,Ce),Y&&Wc(R,null,pe,"created"),_(ve,R,R.scopeId,ke,pe),Ye){for(const Le in Ye)Le!=="value"&&!vm(Le)&&s(ve,Le,null,Ye[Le],he,pe);"value"in Ye&&s(ve,"value",null,Ye.value,he),(ge=Ye.onVnodeBeforeMount)&&To(ge,pe,R)}__VUE_PROD_DEVTOOLS__&&(mg(ve,"__vnode",R,!0),mg(ve,"__vueParentComponent",pe,!0)),Y&&Wc(R,null,pe,"beforeMount");const oe=tge(le,Fe);oe&&Fe.beforeEnter(ve),n(ve,W,ee),((ge=Ye&&Ye.onVnodeMounted)||oe||Y)&&Gi(()=>{ge&&To(ge,pe,R),oe&&Fe.enter(ve),Y&&Wc(R,null,pe,"mounted")},le)},_=(R,W,ee,pe,le)=>{if(ee&&f(R,ee),pe)for(let he=0;he<pe.length;he++)f(R,pe[he]);if(le){let he=le.subTree;if(W===he||wH(he.type)&&(he.ssContent===W||he.ssFallback===W)){const ke=le.vnode;_(R,ke,ke.scopeId,ke.slotScopeIds,le.parent)}}},L=(R,W,ee,pe,le,he,ke,Ce,ve=0)=>{for(let ge=ve;ge<R.length;ge++){const Ye=R[ge]=Ce?zl(R[ge]):Po(R[ge]);m(null,Ye,W,ee,pe,le,he,ke,Ce)}},B=(R,W,ee,pe,le,he,ke)=>{const Ce=W.el=R.el;__VUE_PROD_DEVTOOLS__&&(Ce.__vnode=W);let{patchFlag:ve,dynamicChildren:ge,dirs:Ye}=W;ve|=R.patchFlag&16;const _e=R.props||dr,Fe=W.props||dr;let Y;if(ee&&jc(ee,!1),(Y=Fe.onVnodeBeforeUpdate)&&To(Y,ee,W,R),Ye&&Wc(W,R,ee,"beforeUpdate"),ee&&jc(ee,!0),(_e.innerHTML&&Fe.innerHTML==null||_e.textContent&&Fe.textContent==null)&&h(Ce,""),ge?E(R.dynamicChildren,ge,Ce,ee,pe,j5(W,le),he):ke||q(R,W,Ce,null,ee,pe,j5(W,le),he,!1),ve>0){if(ve&16)D(Ce,_e,Fe,ee,le);else if(ve&2&&_e.class!==Fe.class&&s(Ce,"class",null,Fe.class,le),ve&4&&s(Ce,"style",_e.style,Fe.style,le),ve&8){const oe=W.dynamicProps;for(let Le=0;Le<oe.length;Le++){const Be=oe[Le],ft=_e[Be],Pt=Fe[Be];(Pt!==ft||Be==="value")&&s(Ce,Be,ft,Pt,le,ee)}}ve&1&&R.children!==W.children&&h(Ce,W.children)}else!ke&&ge==null&&D(Ce,_e,Fe,ee,le);((Y=Fe.onVnodeUpdated)||Ye)&&Gi(()=>{Y&&To(Y,ee,W,R),Ye&&Wc(W,R,ee,"updated")},pe)},E=(R,W,ee,pe,le,he,ke)=>{for(let Ce=0;Ce<W.length;Ce++){const ve=R[Ce],ge=W[Ce],Ye=ve.el&&(ve.type===Cn||!H0(ve,ge)||ve.shapeFlag&198)?u(ve.el):ee;m(ve,ge,Ye,null,pe,le,he,ke,!0)}},D=(R,W,ee,pe,le)=>{if(W!==ee){if(W!==dr)for(const he in W)!vm(he)&&!(he in ee)&&s(R,he,W[he],null,le,pe);for(const he in ee){if(vm(he))continue;const ke=ee[he],Ce=W[he];ke!==Ce&&he!=="value"&&s(R,he,Ce,ke,le,pe)}"value"in ee&&s(R,"value",W.value,ee.value,le)}},N=(R,W,ee,pe,le,he,ke,Ce,ve)=>{const ge=W.el=R?R.el:a(""),Ye=W.anchor=R?R.anchor:a("");let{patchFlag:_e,dynamicChildren:Fe,slotScopeIds:Y}=W;Y&&(Ce=Ce?Ce.concat(Y):Y),R==null?(n(ge,ee,pe),n(Ye,ee,pe),L(W.children||[],ee,Ye,le,he,ke,Ce,ve)):_e>0&&_e&64&&Fe&&R.dynamicChildren?(E(R.dynamicChildren,Fe,ee,le,he,ke,Ce),(W.key!=null||le&&W===le.subTree)&&yH(R,W,!0)):q(R,W,ee,Ye,le,he,ke,Ce,ve)},K=(R,W,ee,pe,le,he,ke,Ce,ve)=>{W.slotScopeIds=Ce,R==null?W.shapeFlag&512?le.ctx.activate(W,ee,pe,ke,ve):z(W,ee,pe,le,he,ke,ve):$(R,W,ve)},z=(R,W,ee,pe,le,he,ke)=>{const Ce=R.component=vge(R,pe,le);if(sH(R)&&(Ce.ctx.renderer=wt),kge(Ce,!1,ke),Ce.asyncDep){if(le&&le.registerDep(Ce,H,ke),!R.el){const ve=Ce.subTree=Zs(pu);y(null,ve,W,ee),R.placeholder=ve.el}}else H(Ce,R,W,ee,le,he,ke)},$=(R,W,ee)=>{const pe=W.component=R.component;if(hge(R,W,ee))if(pe.asyncDep&&!pe.asyncResolved){j(pe,W,ee);return}
vendor: 9,513 bytes, line 102
102else pe.next=W,pe.update();else W.el=R.el,pe.vnode=W},H=(R,W,ee,pe,le,he,ke)=>{const Ce=()=>{if(R.isMounted){let{next:_e,bu:Fe,u:Y,parent:oe,vnode:Le}=R;{const Ut=bH(R);if(Ut){_e&&(_e.el=Le.el,j(R,_e,ke)),Ut.asyncDep.then(()=>{R.isUnmounted||Ce()});return}}let Be=_e,ft;jc(R,!1),_e?(_e.el=Le.el,j(R,_e,ke)):_e=Le,Fe&&z5(Fe),(ft=_e.props&&_e.props.onVnodeBeforeUpdate)&&To(ft,oe,_e,Le),jc(R,!0);const Pt=U5(R),rr=R.subTree;R.subTree=Pt,m(rr,Pt,u(rr.el),Ze(rr),R,le,he),_e.el=Pt.el,Be===null&&uge(R,Pt.el),Y&&Gi(Y,le),(ft=_e.props&&_e.props.onVnodeUpdated)&&Gi(()=>To(ft,oe,_e,Le),le),__VUE_PROD_DEVTOOLS__&&rH(R)}else{let _e;const{el:Fe,props:Y}=W,{bm:oe,m:Le,parent:Be,root:ft,type:Pt}=R,rr=Tm(W);if(jc(R,!1),oe&&z5(oe),!rr&&(_e=Y&&Y.onVnodeBeforeMount)&&To(_e,Be,W),jc(R,!0),Fe&&gr){const Ut=()=>{R.subTree=U5(R),gr(Fe,R.subTree,R,le,null)};rr&&Pt.__asyncHydrate?Pt.__asyncHydrate(Fe,R,Ut):Ut()}else{ft.ce&&ft.ce._def.shadowRoot!==!1&&ft.ce._injectChildStyle(Pt);const Ut=R.subTree=U5(R);m(null,Ut,ee,pe,R,le,he),W.el=Ut.el}if(Le&&Gi(Le,le),!rr&&(_e=Y&&Y.onVnodeMounted)){const Ut=W;Gi(()=>To(_e,Be,Ut),le)}(W.shapeFlag&256||Be&&Tm(Be.vnode)&&Be.vnode.shapeFlag&256)&&R.a&&Gi(R.a,le),R.isMounted=!0,__VUE_PROD_DEVTOOLS__&&bme(R),W=ee=pe=null}};R.scope.on();const ve=R.effect=new Bz(Ce);R.scope.off();const ge=R.update=ve.run.bind(ve),Ye=R.job=ve.runIfDirty.bind(ve);Ye.i=R,Ye.id=R.uid,ve.scheduler=()=>W8(Ye),jc(R,!0),ge()},j=(R,W,ee)=>{W.component=R;const pe=R.vnode.props;R.vnode=W,R.next=null,Gme(R,W.props,pe,ee),Jme(R,W.children,ee),ol(),BO(R),al()},q=(R,W,ee,pe,le,he,ke,Ce,ve=!1)=>{const ge=R&&R.children,Ye=R?R.shapeFlag:0,_e=W.children,{patchFlag:Fe,shapeFlag:Y}=W;if(Fe>0){if(Fe&128){O(ge,_e,ee,pe,le,he,ke,Ce,ve);return}else if(Fe&256){ne(ge,_e,ee,pe,le,he,ke,Ce,ve);return}}Y&8?(Ye&16&&Oe(ge,le,he),_e!==ge&&h(ee,_e)):Ye&16?Y&16?O(ge,_e,ee,pe,le,he,ke,Ce,ve):Oe(ge,le,he,!0):(Ye&8&&h(ee,""),Y&16&&L(_e,ee,pe,le,he,ke,Ce,ve))},ne=(R,W,ee,pe,le,he,ke,Ce,ve)=>{R=R||bm,W=W||bm;const ge=R.length,Ye=W.length,_e=Math.min(ge,Ye);let Fe;for(Fe=0;Fe<_e;Fe++){const Y=W[Fe]=ve?zl(W[Fe]):Po(W[Fe]);m(R[Fe],Y,ee,null,le,he,ke,Ce,ve)}ge>Ye?Oe(R,le,he,!0,!1,_e):L(W,ee,pe,le,he,ke,Ce,ve,_e)},O=(R,W,ee,pe,le,he,ke,Ce,ve)=>{let ge=0;const Ye=W.length;let _e=R.length-1,Fe=Ye-1;for(;ge<=_e&&ge<=Fe;){const Y=R[ge],oe=W[ge]=ve?zl(W[ge]):Po(W[ge]);if(H0(Y,oe))m(Y,oe,ee,null,le,he,ke,Ce,ve);else break;ge++}for(;ge<=_e&&ge<=Fe;){const Y=R[_e],oe=W[Fe]=ve?zl(W[Fe]):Po(W[Fe]);if(H0(Y,oe))m(Y,oe,ee,null,le,he,ke,Ce,ve);else break;_e--,Fe--}if(ge>_e){if(ge<=Fe){const Y=Fe+1,oe=Y<Ye?W[Y].el:pe;for(;ge<=Fe;)m(null,W[ge]=ve?zl(W[ge]):Po(W[ge]),ee,oe,le,he,ke,Ce,ve),ge++}}else if(ge>Fe)for(;ge<=_e;)Te(R[ge],le,he,!0),ge++;else{const Y=ge,oe=ge,Le=new Map;for(ge=oe;ge<=Fe;ge++){const Nt=W[ge]=ve?zl(W[ge]):Po(W[ge]);Nt.key!=null&&Le.set(Nt.key,ge)}let Be,ft=0;const Pt=Fe-oe+1;let rr=!1,Ut=0;const wr=new Array(Pt);for(ge=0;ge<Pt;ge++)wr[ge]=0;for(ge=Y;ge<=_e;ge++){const Nt=R[ge];if(ft>=Pt){Te(Nt,le,he,!0);continue}let kr;if(Nt.key!=null)kr=Le.get(Nt.key);else for(Be=oe;Be<=Fe;Be++)if(wr[Be-oe]===0&&H0(Nt,W[Be])){kr=Be;break}kr===void 0?Te(Nt,le,he,!0):(wr[kr-oe]=ge+1,kr>=Ut?Ut=kr:rr=!0,m(Nt,W[kr],ee,null,le,he,ke,Ce,ve),ft++)}const sn=rr?rge(wr):bm;for(Be=sn.length-1,ge=Pt-1;ge>=0;ge--){const Nt=oe+ge,kr=W[Nt],pn=W[Nt+1],wo=Nt+1<Ye?pn.el||pn.placeholder:pe;wr[ge]===0?m(null,kr,ee,wo,le,he,ke,Ce,ve):rr&&(Be<0||ge!==sn[Be]?fe(kr,ee,wo,2):Be--)}}},fe=(R,W,ee,pe,le=null)=>{const{el:he,type:ke,transition:Ce,children:ve,shapeFlag:ge}=R;if(ge&6){fe(R.component.subTree,W,ee,pe);return}if(ge&128){R.suspense.move(W,ee,pe);return}if(ge&64){ke.move(R,W,ee,wt);return}if(ke===Cn){n(he,W,ee);for(let _e=0;_e<ve.length;_e++)fe(ve[_e],W,ee,pe);n(R.anchor,W,ee);return}if(ke===Q2){x(R,W,ee);return}if(pe!==2&&ge&1&&Ce)if(pe===0)Ce.beforeEnter(he),n(he,W,ee),Gi(()=>Ce.enter(he),le);else{const{leave:_e,delayLeave:Fe,afterLeave:Y}=Ce,oe=()=>{R.ctx.isUnmounted?i(he):n(he,W,ee)},Le=()=>{_e(he,()=>{oe(),Y&&Y()})};Fe?Fe(he,oe,Le):Le()}else n(he,W,ee)},Te=(R,W,ee,pe=!1,le=!1)=>{const{type:he,props:ke,ref:Ce,children:ve,dynamicChildren:ge,shapeFlag:Ye,patchFlag:_e,dirs:Fe,cacheIndex:Y}=R;if(_e===-2&&(le=!1),Ce!=null&&(ol(),Sm(Ce,null,ee,R,!0),al()),Y!=null&&(W.renderCache[Y]=void 0),Ye&256){W.ctx.deactivate(R);return}const oe=Ye&1&&Fe,Le=!Tm(R);let Be;if(Le&&(Be=ke&&ke.onVnodeBeforeUnmount)&&To(Be,W,R),Ye&6)qe(R.component,ee,pe);else{if(Ye&128){R.suspense.unmount(ee,pe);return}oe&&Wc(R,null,W,"beforeUnmount"),Ye&64?R.type.remove(R,W,ee,wt,pe):ge&&!ge.hasOnce&&(he!==Cn||_e>0&&_e&64)?Oe(ge,W,ee,!1,!0):(he===Cn&&_e&384||!le&&Ye&16)&&Oe(ve,W,ee),pe&&I(R)}(Le&&(Be=ke&&ke.onVnodeUnmounted)||oe)&&Gi(()=>{Be&&To(Be,W,R),oe&&Wc(R,null,W,"unmounted")},ee)},I=R=>{const{type:W,el:ee,anchor:pe,transition:le}=R;if(W===Cn){tt(ee,pe);return}if(W===Q2){S(R);return}const he=()=>{i(ee),le&&!le.persisted&&le.afterLeave&&le.afterLeave()};if(R.shapeFlag&1&&le&&!le.persisted){const{leave:ke,delayLeave:Ce}=le,ve=()=>ke(ee,he);Ce?Ce(R.el,he,ve):ve()}else he()},tt=(R,W)=>{let ee;for(;R!==W;)ee=d(R),i(R),R=ee;i(W)},qe=(R,W,ee)=>{const{bum:pe,scope:le,job:he,subTree:ke,um:Ce,m:ve,a:ge,parent:Ye,slots:{__:_e}}=R;zO(ve),zO(ge),pe&&z5(pe),Ye&&Tt(_e)&&_e.forEach(Fe=>{Ye.renderCache[Fe]=void 0}),le.stop(),he&&(he.flags|=8,Te(ke,R,W,ee)),Ce&&Gi(Ce,W),Gi(()=>{R.isUnmounted=!0},W),W&&W.pendingBranch&&!W.isUnmounted&&R.asyncDep&&!R.asyncResolved&&R.suspenseId===W.pendingId&&(W.deps--,W.deps===0&&W.resolve()),__VUE_PROD_DEVTOOLS__&&vme(R)},Oe=(R,W,ee,pe=!1,le=!1,he=0)=>{for(let ke=he;ke<R.length;ke++)Te(R[ke],W,ee,pe,le)},Ze=R=>{if(R.shapeFlag&6)return Ze(R.component.subTree);if(R.shapeFlag&128)return R.suspense.next();const W=d(R.anchor||R.el),ee=W&&W[Cme];return ee?d(ee):W};let vt=!1;const Ct=(R,W,ee)=>{R==null?W._vnode&&Te(W._vnode,null,null,!0):m(W._vnode||null,R,W,null,null,null,ee),W._vnode=R,vt||(vt=!0,BO(),Qz(),vt=!1)},wt={p:m,um:Te,m:fe,r:I,mt:z,mc:L,pc:q,pbc:E,n:Ze,o:t};let zt,gr;return{render:Ct,hydrate:zt,createApp:Wme(Ct,zt)}}function j5({type:t,props:e},r){return r==="svg"&&t==="foreignObject"||r==="mathml"&&t==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:r}function jc({effect:t,job:e},r){r?(t.flags|=32,e.flags|=4):(t.flags&=-33,e.flags&=-5)}function tge(t,e){return(!t||t&&!t.pendingBranch)&&e&&!e.persisted}function yH(t,e,r=!1){const n=t.children,i=e.children;if(Tt(n)&&Tt(i))for(let s=0;s<n.length;s++){const o=n[s];let a=i[s];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=i[s]=zl(i[s]),a.el=o.el),!r&&a.patchFlag!==-2&&yH(o,a)),a.type===I1&&(a.el=o.el),a.type===pu&&!a.el&&(a.el=o.el)}}function rge(t){const e=t.slice(),r=[0];let n,i,s,o,a;const l=t.length;for(n=0;n<l;n++){const c=t[n];if(c!==0){if(i=r[r.length-1],t[i]<c){e[n]=i,r.push(n);continue}for(s=0,o=r.length-1;s<o;)a=s+o>>1,t[r[a]]<c?s=a+1:o=a;c<t[r[s]]&&(s>0&&(e[n]=r[s-1]),r[s]=n)}}for(s=r.length,o=r[s-1];s-- >0;)r[s]=o,o=e[o];return r}function bH(t){const e=t.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:bH(e)}function zO(t){if(t)for(let e=0;e<t.length;e++)t[e].flags|=8}const nge=Symbol.for("v-scx"),ige=()=>Z2(nge);function n0(t,e){return X8(t,null,e)}function Td(t,e,r){return X8(t,e,r)}function X8(t,e,r=dr){const{immediate:n,deep:i,flush:s,once:o}=r,a=un({},r),l=e&&n||!e&&s!=="post";let c;if(xg){if(s==="sync"){const f=ige();c=f.__watcherHandles||(f.__watcherHandles=[])}else if(!l){const f=()=>{};return f.stop=to,f.resume=to,f.pause=to,f}}const h=ti;a.call=(f,p,m)=>na(f,h,p,m);let u=!1;s==="post"?a.scheduler=f=>{Gi(f,h&&h.suspense)}:s!=="sync"&&(u=!0,a.scheduler=(f,p)=>{p?f():W8(f)}),a.augmentJob=f=>{e&&(f.flags|=4),u&&(f.flags|=2,h&&(f.id=h.uid,f.i=h))};const d=ume(t,e,a);return xg&&(c?c.push(d):l&&d()),d}function sge(t,e,r){const n=this.proxy,i=dn(t)?t.includes(".")?xH(n,t):()=>n[t]:t.bind(n,n);let s;Mt(e)?s=e:(s=e.handler,r=e);const o=B1(this),a=X8(i,s.bind(n),r);return o(),a}function xH(t,e){const r=e.split(".");return()=>{let n=t;for(let i=0;i<r.length&&n;i++)n=n[r[i]];return n}}const oge=(t,e)=>e==="modelValue"||e==="model-value"?t.modelModifiers:t[`${e}Modifiers`]||t[`${vc(e)}Modifiers`]||t[`${Lu(e)}Modifiers`];function age(t,e,...r){if(t.isUnmounted)return;const n=t.vnode.props||dr;let i=r;const s=e.startsWith("update:"),o=s&&oge(n,e.slice(7));o&&(o.trim&&(i=r.map(h=>dn(h)?h.trim():h)),o.number&&(i=r.map(Ope))),__VUE_PROD_DEVTOOLS__&&wme(t,e,i);let a,l=n[a=$5(e)]||n[a=$5(vc(e))];!l&&s&&(l=n[a=$5(Lu(e))]),l&&na(l,t,6,i);const c=n[a+"Once"];if(c){if(!t.emitted)t.emitted={};else if(t.emitted[a])return;t.emitted[a]=!0,na(c,t,6,i)}}function vH(t,e,r=!1){const n=e.emitsCache,i=n.get(t);if(i!==void 0)return i;const s=t.emits;let o={},a=!1;if(__VUE_OPTIONS_API__&&!Mt(t)){const l=c=>{const h=vH(c,e,!0);h&&(a=!0,un(o,h))};!r&&e.mixins.length&&e.mixins.forEach(l),t.extends&&l(t.extends),t.mixins&&t.mixins.forEach(l)}return!s&&!a?(zr(t)&&n.set(t,null),null):(Tt(s)?s.forEach(l=>o[l]=null):un(o,s),zr(t)&&n.set(t,o),o)}function Ow(t,e){return!t||!Sw(e)?!1:(e=e.slice(2).replace(/Once$/,""),Xt(t,e[0].toLowerCase()+e.slice(1))||Xt(t,Lu(e))||Xt(t,e))}function U5(t){const{type:e,vnode:r,proxy:n,withProxy:i,propsOptions:[s],slots:o,attrs:a,emit:l,render:c,renderCache:h,props:u,data:d,setupState:f,ctx:p,inheritAttrs:m}=t,g=Sx(t);let y,b;try{if(r.shapeFlag&4){const S=i||n,k=S;y=Po(c.call(k,S,h,u,f,d,p)),b=a}else{const S=e;y=Po(S.length>1?S(u,{attrs:a,slots:o,emit:l}):S(u,null)),b=e.props?a:lge(a)}}catch(S){Mw(S,t,1),y=Zs(pu)}let x=y;
vendor: 5,381 bytes, line 102
102if(b&&m!==!1){const S=Object.keys(b),{shapeFlag:k}=x;S.length&&k&7&&(s&&S.some(O8)&&(b=cge(b,s)),x=Af(x,b,!1,!0))}return r.dirs&&(x=Af(x,null,!1,!0),x.dirs=x.dirs?x.dirs.concat(r.dirs):r.dirs),r.transition&&U8(x,r.transition),y=x,Sx(g),y}const lge=t=>{let e;for(const r in t)(r==="class"||r==="style"||Sw(r))&&((e||(e={}))[r]=t[r]);return e},cge=(t,e)=>{const r={};for(const n in t)(!O8(n)||!(n.slice(9)in e))&&(r[n]=t[n]);return r};function hge(t,e,r){const{props:n,children:i,component:s}=t,{props:o,children:a,patchFlag:l}=e,c=s.emitsOptions;if(e.dirs||e.transition)return!0;if(r&&l>=0){if(l&1024)return!0;if(l&16)return n?HO(n,o,c):!!o;if(l&8){const h=e.dynamicProps;for(let u=0;u<h.length;u++){const d=h[u];if(o[d]!==n[d]&&!Ow(c,d))return!0}}}else return(i||a)&&(!a||!a.$stable)?!0:n===o?!1:n?o?HO(n,o,c):!0:!!o;return!1}function HO(t,e,r){const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!0;for(let i=0;i<n.length;i++){const s=n[i];if(e[s]!==t[s]&&!Ow(r,s))return!0}return!1}function uge({vnode:t,parent:e},r){for(;e;){const n=e.subTree;if(n.suspense&&n.suspense.activeBranch===t&&(n.el=t.el),n===t)(t=e.vnode).el=r,e=e.parent;else break}}const wH=t=>t.__isSuspense;function dge(t,e){e&&e.pendingBranch?Tt(t)?e.effects.push(...t):e.effects.push(t):mme(t)}const Cn=Symbol.for("v-fgt"),I1=Symbol.for("v-txt"),pu=Symbol.for("v-cmt"),Q2=Symbol.for("v-stc");let rc=null,J8=1;function qO(t,e=!1){J8+=t,t<0&&rc&&e&&(rc.hasOnce=!0)}function _x(t){return t?t.__v_isVNode===!0:!1}function H0(t,e){return t.type===e.type&&t.key===e.key}const kH=({key:t})=>t??null,eb=({ref:t,ref_key:e,ref_for:r})=>(typeof t=="number"&&(t=""+t),t!=null?dn(t)||zn(t)||Mt(t)?{i:Wo,r:t,k:e,f:!!r}:t:null);function fge(t,e=null,r=null,n=0,i=null,s=t===Cn?0:1,o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&kH(e),ref:e&&eb(e),scopeId:nH,slotScopeIds:null,children:r,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:s,patchFlag:n,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:Wo};return a?(Z8(l,r),s&128&&t.normalize(l)):r&&(l.shapeFlag|=dn(r)?8:16),J8>0&&!o&&rc&&(l.patchFlag>0||s&6)&&l.patchFlag!==32&&rc.push(l),l}const Zs=pge;function pge(t,e=null,r=null,n=0,i=null,s=!1){if((!t||t===Pme)&&(t=pu),_x(t)){const a=Af(t,e,!0);return r&&Z8(a,r),J8>0&&!s&&rc&&(a.shapeFlag&6?rc[rc.indexOf(t)]=a:rc.push(a)),a.patchFlag=-2,a}if(_ge(t)&&(t=t.__vccOpts),e){e=mge(e);let{class:a,style:l}=e;a&&!dn(a)&&(e.class=B8(a)),zr(l)&&(V8(l)&&!Tt(l)&&(l=un({},l)),e.style=I8(l))}const o=dn(t)?1:wH(t)?128:Sme(t)?64:zr(t)?4:Mt(t)?2:0;return fge(t,e,r,n,i,o,s,!0)}function mge(t){return t?V8(t)||uH(t)?un({},t):t:null}function Af(t,e,r=!1,n=!1){const{props:i,ref:s,patchFlag:o,children:a,transition:l}=t,c=e?yge(i||{},e):i,h={__v_isVNode:!0,__v_skip:!0,type:t.type,props:c,key:c&&kH(c),ref:e&&e.ref?r&&s?Tt(s)?s.concat(eb(e)):[s,eb(e)]:eb(e):s,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:a,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==Cn?o===-1?16:o|16:o,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:l,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&Af(t.ssContent),ssFallback:t.ssFallback&&Af(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return l&&n&&U8(h,l.clone(h)),h}function gge(t=" ",e=0){return Zs(I1,null,t,e)}function Po(t){return t==null||typeof t=="boolean"?Zs(pu):Tt(t)?Zs(Cn,null,t.slice()):_x(t)?zl(t):Zs(I1,null,String(t))}function zl(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:Af(t)}function Z8(t,e){let r=0;const{shapeFlag:n}=t;if(e==null)e=null;else if(Tt(e))r=16;else if(typeof e=="object")if(n&65){const i=e.default;i&&(i._c&&(i._d=!1),Z8(t,i()),i._c&&(i._d=!0));return}else{r=32;const i=e._;!i&&!uH(e)?e._ctx=Wo:i===3&&Wo&&(Wo.slots._===1?e._=1:(e._=2,t.patchFlag|=1024))}else Mt(e)?(e={default:e,_ctx:Wo},r=32):(e=String(e),n&64?(r=16,e=[gge(e)]):r=8);t.children=e,t.shapeFlag|=r}function yge(...t){const e={};for(let r=0;r<t.length;r++){const n=t[r];for(const i in n)if(i==="class")e.class!==n.class&&(e.class=B8([e.class,n.class]));else if(i==="style")e.style=I8([e.style,n.style]);else if(Sw(i)){const s=e[i],o=n[i];o&&s!==o&&!(Tt(s)&&s.includes(o))&&(e[i]=s?[].concat(s,o):o)}else i!==""&&(e[i]=n[i])}return e}function To(t,e,r,n=null){na(t,e,7,[r,n])}const bge=lH();let xge=0;function vge(t,e,r){const n=t.type,i=(e?e.appContext:t.appContext)||bge,s={uid:xge++,vnode:t,type:n,parent:e,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Npe(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:e?e.provides:Object.create(i.provides),ids:e?e.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:fH(n,i),emitsOptions:vH(n,i),emit:null,emitted:null,propsDefaults:dr,inheritAttrs:n.inheritAttrs,ctx:dr,data:dr,props:dr,attrs:dr,slots:dr,refs:dr,setupState:dr,setupContext:null,suspense:r,suspenseId:r?r.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,
vendor: 2,302 bytes, lines 102-105
102sp:null};return s.ctx={_:s},s.root=e?e.root:s,s.emit=age.bind(null,s),t.ce&&t.ce(s),s}let ti=null;const wge=()=>ti||Wo;let Mx,JC;{const t=Uh(),e=(r,n)=>{let i;return(i=t[r])||(i=t[r]=[]),i.push(n),s=>{i.length>1?i.forEach(o=>o(s)):i[0](s)}};Mx=e("__VUE_INSTANCE_SETTERS__",r=>ti=r),JC=e("__VUE_SSR_SETTERS__",r=>xg=r)}const B1=t=>{const e=ti;return Mx(t),t.scope.on(),()=>{t.scope.off(),Mx(e)}},VO=()=>{ti&&ti.scope.off(),Mx(null)};function CH(t){return t.vnode.shapeFlag&4}let xg=!1;function kge(t,e=!1,r=!1){e&&JC(e);const{props:n,children:i}=t.vnode,s=CH(t);Ume(t,n,s,e),Xme(t,i,r||e);const o=s?Cge(t,e):void 0;return e&&JC(!1),o}function Cge(t,e){const r=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,Nme);const{setup:n}=r;if(n){ol();const i=t.setupContext=n.length>1?Tge(t):null,s=B1(t),o=O1(n,t,0,[t.props,i]),a=Lz(o);if(al(),s(),(a||t.sp)&&!Tm(t)&&iH(t),a){if(o.then(VO,VO),e)return o.then(l=>{WO(t,l,e)}).catch(l=>{Mw(l,t,0)});t.asyncDep=o}else WO(t,o,e)}else SH(t,e)}function WO(t,e,r){Mt(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:zr(e)&&(__VUE_PROD_DEVTOOLS__&&(t.devtoolsRawSetupState=e),t.setupState=Xz(e)),SH(t,r)}let jO;function SH(t,e,r){const n=t.type;if(!t.render){if(!e&&jO&&!n.render){const i=n.template||__VUE_OPTIONS_API__&&G8(t).template;if(i){const{isCustomElement:s,compilerOptions:o}=t.appContext.config,{delimiters:a,compilerOptions:l}=n,c=un(un({isCustomElement:s,delimiters:a},o),l);n.render=jO(i,c)}}t.render=n.render||to}if(__VUE_OPTIONS_API__){const i=B1(t);ol();try{Fme(t)}finally{al(),i()}}}const Sge={get(t,e){return Rn(t,"get",""),t[e]}};function Tge(t){const e=r=>{t.exposed=r||{}};return{attrs:new Proxy(t.attrs,Sge),slots:t.slots,emit:t.emit,expose:e}}function Q8(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(Xz(ime(t.exposed)),{get(e,r){if(r in e)return e[r];if(r in _m)return _m[r](t)},has(e,r){return r in e||r in _m}})):t.proxy}function _ge(t){return Mt(t)&&"__vccOpts"in t}const mu=(t,e)=>cme(t,e,xg);function te(t,e,r){const n=arguments.length;return n===2?zr(e)&&!Tt(e)?_x(e)?Zs(t,null,[e]):Zs(t,e):Zs(t,null,e):(n>3?r=Array.prototype.slice.call(arguments,2):n===3&&_x(r)&&(r=[r]),Zs(t,e,r))}const UO="3.5.18";/**
103* @vue/runtime-dom v3.5.18
104* (c) 2018-present Yuxi (Evan) You and Vue contributors
105* @license MIT
106**/let ZC;const GO=typeof window<"u"&&window.trustedTypes;if(GO)try{ZC=GO.createPolicy("vue",{createHTML:t=>t})}catch{}const TH=ZC?t=>ZC.createHTML(t):t=>t,Mge="http://www.w3.org/2000/svg",Age="http://www.w3.org/1998/Math/MathML",Da=typeof document<"u"?document:null,KO=Da&&Da.createElement("template"),Ege={insert:(t,e,r)=>{e.insertBefore(t,r||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,r,n)=>{const i=e==="svg"?Da.createElementNS(Mge,t):e==="mathml"?Da.createElementNS(Age,t):r?Da.createElement(t,{is:r}):Da.createElement(t);return t==="select"&&n&&n.multiple!=null&&i.setAttribute("multiple",n.multiple),i},createText:t=>Da.createTextNode(t),createComment:t=>Da.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>Da.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,r,n,i,s){const o=r?r.previousSibling:e.lastChild;if(i&&(i===s||i.nextSibling))for(;e.insertBefore(i.cloneNode(!0),r),!(i===s||!(i=i.nextSibling)););else{KO.innerHTML=TH(n==="svg"?`<svg>${t}</svg>`:n==="mathml"?`<math>${t}</math>`:t);const a=KO.content;if(n==="svg"||n==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}e.insertBefore(a,r)}return[o?o.nextSibling:e.firstChild,r?r.previousSibling:e.lastChild]}},Oge=Symbol("_vtc");function Lge(t,e,r){const n=t[Oge];n&&(e=(e?[e,...n]:[...n]).join(" ")),e==null?t.removeAttribute("class"):r?t.setAttribute("class",e):t.className=e}const YO=Symbol("_vod"),Dge=Symbol("_vsh"),Ige=Symbol(""),Bge=/(^|;)\s*display\s*:/;function Rge(t,e,r){const n=t.style,i=dn(r);let s=!1;if(r&&!i){if(e)if(dn(e))for(const o of e.split(";")){const a=o.slice(0,o.indexOf(":")).trim();r[a]==null&&tb(n,a,"")}else for(const o in e)r[o]==null&&tb(n,o,"");for(const o in r)o==="display"&&(s=!0),tb(n,o,r[o])}else if(i){if(e!==r){const o=n[Ige];o&&(r+=";"+o),n.cssText=r,s=Bge.test(r)}}else e&&t.removeAttribute("style");YO in t&&(t[YO]=s?n.display:"",t[Dge]&&(n.display="none"))}const XO=/\s*!important$/;function tb(t,e,r){if(Tt(r))r.forEach(n=>tb(t,e,n));else if(r==null&&(r=""),e.startsWith("--"))t.setProperty(e,r);else{const n=Pge(t,e);XO.test(r)?t.setProperty(Lu(n),r.replace(XO,""),"important"):t[n]=r}}const JO=["Webkit","Moz","ms"],G5={};function Pge(t,e){const r=G5[e];if(r)return r;let n=vc(e);if(n!=="filter"&&n in t)return G5[e]=n;n=Dz(n);for(let i=0;i<JO.length;i++){const s=JO[i]+n;if(s in t)return G5[e]=s}return e}const ZO="http://www.w3.org/1999/xlink";function QO(t,e,r,n,i,s=Ppe(e)){n&&e.startsWith("xlink:")?r==null?t.removeAttributeNS(ZO,e.slice(6,e.length)):t.setAttributeNS(ZO,e,r):r==null||s&&!Iz(r)?t.removeAttribute(e):t.setAttribute(e,s?"":r0(r)?String(r):r)}function eL(t,e,r,n,i){if(e==="innerHTML"||e==="textContent"){r!=null&&(t[e]=e==="innerHTML"?TH(r):r);return}const s=t.tagName;if(e==="value"&&s!=="PROGRESS"&&!s.includes("-")){const a=s==="OPTION"?t.getAttribute("value")||"":t.value,l=r==null?t.type==="checkbox"?"on":"":String(r);(a!==l||!("_value"in t))&&(t.value=l),r==null&&t.removeAttribute(e),t._value=r;return}let o=!1;if(r===""||r==null){const a=typeof t[e];a==="boolean"?r=Iz(r):r==null&&a==="string"?(r="",o=!0):a==="number"&&(r=0,o=!0)}try{t[e]=r}catch{}o&&t.removeAttribute(i||e)}function Nge(t,e,r,n){t.addEventListener(e,r,n)}function Fge(t,e,r,n){t.removeEventListener(e,r,n)}const tL=Symbol("_vei");function $ge(t,e,r,n,i=null){const s=t[tL]||(t[tL]={}),o=s[e];if(n&&o)o.value=n;else{const[a,l]=zge(e);if(n){const c=s[e]=Vge(n,i);Nge(t,a,c,l)}else o&&(Fge(t,a,o,l),s[e]=void 0)}}const rL=/(?:Once|Passive|Capture)$/;function zge(t){let e;if(rL.test(t)){e={};let n;for(;n=t.match(rL);)t=t.slice(0,t.length-n[0].length),e[n[0].toLowerCase()]=!0}return[t[2]===":"?t.slice(3):Lu(t.slice(2)),e]}let K5=0;const Hge=Promise.resolve(),qge=()=>K5||(Hge.then(()=>K5=0),K5=Date.now());function Vge(t,e){const r=n=>{if(!n._vts)n._vts=Date.now();else if(n._vts<=r.attached)return;na(Wge(n,r.value),e,5,[n])};return r.value=t,r.attached=qge(),r}function Wge(t,e){if(Tt(e)){const r=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{r.call(t),t._stopped=!0},e.map(n=>i=>!i._stopped&&n&&n(i))}else return e}const nL=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,jge=(t,e,r,n,i,s)=>{const o=i==="svg";e==="class"?Lge(t,n,o):e==="style"?Rge(t,r,n):Sw(e)?O8(e)||$ge(t,e,r,n,s):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):Uge(t,e,n,o))?(eL(t,e,n),!t.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&QO(t,e,n,o,s,e!=="value")):t._isVueCE&&(/[A-Z]/.test(e)||!
106dn(n))?eL(t,vc(e),n,s,e):(e==="true-value"?t._trueValue=n:e==="false-value"&&(t._falseValue=n),QO(t,e,n,o))};function Uge(t,e,r,n){if(n)return!!(e==="innerHTML"||e==="textContent"||e in t&&nL(e)&&Mt(r));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="autocorrect"||e==="form"||e==="list"&&t.tagName==="INPUT"||e==="type"&&t.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const i=t.tagName;if(i==="IMG"||i==="VIDEO"||i==="CANVAS"||i==="SOURCE")return!1}return nL(e)&&dn(r)?!1:e in t}const Gge=un({patchProp:jge},Ege);let iL;function Kge(){return iL||(iL=Qme(Gge))}const bo=(...t)=>{const e=Kge().createApp(...t),{mount:r}=e;return e.mount=n=>{const i=Xge(n);if(!i)return;const s=e._component;!Mt(s)&&!s.render&&!s.template&&(s.template=i.innerHTML),i.nodeType===1&&(i.textContent="");const o=r(i,!1,Yge(i));return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),o},e};function Yge(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function Xge(t){return dn(t)?document.querySelector(t):t}function Jge(t){const e=tr({},`${t}_SLASH_SPEC`),r=nn(i=>{const s=i.get(e.key);return new _r({key:new Dr(`${t}_SLASH`),...s})}),n=[e,r];return n.key=e.key,n.pluginKey=r.key,e.meta={package:"@milkdown/plugin-slash",displayName:`Ctx<slashSpec>|${t}`},r.meta={package:"@milkdown/plugin-slash",displayName:`Prose<slash>|${t}`},n}var Qd,t1,r1,n1,i1,Nh,s1,ef,o1,a1,Cv,_H;class Zge{constructor(e){we(this,Cv);we(this,Qd);we(this,t1);we(this,r1);we(this,n1);we(this,i1);we(this,Nh);we(this,s1);we(this,ef);we(this,o1);we(this,a1);ie(this,Qd,!1),this.onShow=()=>{},this.onHide=()=>{},ie(this,a1,(r,n)=>{const{state:i,composing:s}=r,{selection:o,doc:a}=i,{ranges:l}=o,c=Math.min(...l.map(f=>f.$from.pos)),h=Math.max(...l.map(f=>f.$to.pos)),u=n&&n.doc.eq(a)&&n.selection.eq(o);if(V(this,Qd)||((V(this,n1)??r.dom.parentElement??document.body).appendChild(this.element),ie(this,Qd,!0)),s||u)return;if(!V(this,s1).call(this,r,n)){this.hide();return}uo({getBoundingClientRect:()=>ew(r,c,h)},this.element,{placement:"bottom-start",middleware:[xx(),xc(V(this,o1)),...V(this,t1)],...V(this,r1)}).then(({x:f,y:p})=>{Object.assign(this.element.style,{left:`${f}px`,top:`${p}px`})}).catch(console.error),this.show()}),this.update=(r,n)=>{V(this,ef).call(this,r,n)},this.getContent=(r,n=i=>i.type.name==="paragraph")=>{const{selection:i}=r.state,{empty:s,$from:o}=i,a=r.state.selection instanceof Je;if(typeof document>"u")return;const l=this.element.contains(document.activeElement),c=!r.hasFocus()&&!l,h=!r.editable,d=!dle(n)(r.state.selection);if(!(c||h||!s||!a||d))return o.parent.textBetween(Math.max(0,o.parentOffset-500),o.parentOffset,void 0,"")},this.destroy=()=>{V(this,ef).cancel()},this.show=()=>{this.element.dataset.show="true",this.onShow()},this.hide=()=>{this.element.dataset.show="false",this.onHide()},this.element=e.content,ie(this,i1,e.debounce??200),ie(this,s1,e.shouldShow??ly(this,Cv,_H)),ie(this,Nh,e.trigger??"/"),ie(this,o1,e.offset),ie(this,t1,e.middleware??[]),ie(this,r1,e.floatingUIOptions??{}),ie(this,n1,e.root),ie(this,ef,Rv(V(this,a1),V(this,i1)))}}Qd=new WeakMap,t1=new WeakMap,r1=new WeakMap,n1=new WeakMap,i1=new WeakMap,Nh=new WeakMap,s1=new WeakMap,ef=new WeakMap,o1=new WeakMap,a1=new WeakMap,Cv=new WeakSet,_H=function(e){const r=this.getContent(e);if(!r)return!1;const n=r.at(-1);return n?Array.isArray(V(this,Nh))?V(this,Nh).includes(n):V(this,Nh)===n:!1};function MH(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(r=MH(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function Mn(){for(var t,e,r=0,n="",i=arguments.length;r<i;r++)(t=arguments[r])&&(e=MH(t))&&(n&&(n+=" "),n+=e);return n}/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */const{entries:AH,setPrototypeOf:sL,isFrozen:Qge,getPrototypeOf:e1e,getOwnPropertyDescriptor:t1e}=Object;let{freeze:di,seal:Ls,create:EH}=Object,{apply:QC,construct:eS}=typeof Reflect<"u"&&Reflect;di||(di=function(e){return e});Ls||(Ls=function(e){return e});QC||(QC=function(e,r,n){return e.apply(r,n)});eS||(eS=function(e,r){return new e(...r)});const Py=fi(Array.prototype.forEach),r1e=fi(Array.prototype.lastIndexOf),oL=fi(Array.prototype.pop),q0=fi(Array.prototype.push),n1e=fi(Array.prototype.splice),rb=fi(String.prototype.toLowerCase),Y5=fi(String.prototype.toString),aL=fi(String.prototype.match),V0=fi(String.prototype.replace),i1e=fi(String.prototype.indexOf),s1e=fi(String.prototype.trim),qs=fi(Object.prototype.hasOwnProperty),Kn=fi(RegExp.prototype.test),W0=o1e(TypeError);function fi(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return QC(t,e,n)}}function o1e(t){return function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return eS(t,r)}}function Dt(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:rb;sL&&sL(t,null);let n=e.length;for(;n--;){let i=e[n];if(typeof i=="string"){const s=r(i);s!==i&&(Qge(e)||(e[n]=s),i=s)}t[i]=!0}return t}function a1e(t){for(let e=0;e<t.length;e++)qs(t,e)||(t[e]=null);return t}function _a(t){const e=EH(null);for(const[r,n]of AH(t))qs(t,r)&&(Array.isArray(n)?e[r]=a1e(n):n&&typeof n=="object"&&n.constructor===Object?e[r]=_a(n):e[r]=n);return e}function j0(t,e){for(;t!==null;){const n=t1e(t,e);if(n){if(n.get)return fi(n.get);if(typeof n.value=="function")return fi(n.value)}t=e1e(t)}function r(){return null}return r}const lL=di(["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"]),X5=di(["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"]),J5=di(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),l1e=di(["animate","color-profile","cursor","discard","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"]),Z5=di(["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","mprescripts"]),c1e=di(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),cL=di(["#text"]),hL=di(["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","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","
106spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Q5=di(["accent-height","accumulate","additive","alignment-baseline","amplitude","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","exponent","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","intercept","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","slope","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","tablevalues","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"]),uL=di(["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"]),Ny=di(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),h1e=Ls(/\{\{[\w\W]*|[\w\W]*\}\}/gm),u1e=Ls(/<%[\w\W]*|[\w\W]*%>/gm),d1e=Ls(/\$\{[\w\W]*/gm),f1e=Ls(/^data-[\-\w.\u00B7-\uFFFF]+$/),p1e=Ls(/^aria-[\-\w]+$/),OH=Ls(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),m1e=Ls(/^(?:\w+script|data):/i),g1e=Ls(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),LH=Ls(/^html$/i),y1e=Ls(/^[a-z][.\w]*(-[.\w]+)+$/i);var dL=Object.freeze({__proto__:null,ARIA_ATTR:p1e,ATTR_WHITESPACE:g1e,CUSTOM_ELEMENT:y1e,DATA_ATTR:f1e,DOCTYPE_NAME:LH,ERB_EXPR:u1e,IS_ALLOWED_URI:OH,IS_SCRIPT_OR_DATA:m1e,MUSTACHE_EXPR:h1e,TMPLIT_EXPR:d1e});const U0={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},b1e=function(){return typeof window>"u"?null:window},x1e=function(e,r){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;
vendor: 6,206 bytes, line 106
106const i="data-tt-policy-suffix";r&&r.hasAttribute(i)&&(n=r.getAttribute(i));const s="dompurify"+(n?"#"+n:"");try{return e.createPolicy(s,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},fL=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function DH(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:b1e();const e=et=>DH(et);if(e.version="3.2.6",e.removed=[],!t||!t.document||t.document.nodeType!==U0.document||!t.Element)return e.isSupported=!1,e;let{document:r}=t;const n=r,i=n.currentScript,{DocumentFragment:s,HTMLTemplateElement:o,Node:a,Element:l,NodeFilter:c,NamedNodeMap:h=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:u,DOMParser:d,trustedTypes:f}=t,p=l.prototype,m=j0(p,"cloneNode"),g=j0(p,"remove"),y=j0(p,"nextSibling"),b=j0(p,"childNodes"),x=j0(p,"parentNode");if(typeof o=="function"){const et=r.createElement("template");et.content&&et.content.ownerDocument&&(r=et.content.ownerDocument)}let S,k="";const{implementation:w,createNodeIterator:_,createDocumentFragment:L,getElementsByTagName:B}=r,{importNode:E}=n;let D=fL();e.isSupported=typeof AH=="function"&&typeof x=="function"&&w&&w.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:N,ERB_EXPR:K,TMPLIT_EXPR:z,DATA_ATTR:$,ARIA_ATTR:H,IS_SCRIPT_OR_DATA:j,ATTR_WHITESPACE:q,CUSTOM_ELEMENT:ne}=dL;let{IS_ALLOWED_URI:O}=dL,fe=null;const Te=Dt({},[...lL,...X5,...J5,...Z5,...cL]);let I=null;const tt=Dt({},[...hL,...Q5,...uL,...Ny]);let qe=Object.seal(EH(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}})),Oe=null,Ze=null,vt=!0,Ct=!0,wt=!1,zt=!0,gr=!1,R=!0,W=!1,ee=!1,pe=!1,le=!1,he=!1,ke=!1,Ce=!0,ve=!1;const ge="user-content-";let Ye=!0,_e=!1,Fe={},Y=null;const oe=Dt({},["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"]);let Le=null;const Be=Dt({},["audio","video","img","source","image","track"]);let ft=null;const Pt=Dt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),rr="http://www.w3.org/1998/Math/MathML",Ut="http://www.w3.org/2000/svg",wr="http://www.w3.org/1999/xhtml";let sn=wr,Nt=!1,kr=null;const pn=Dt({},[rr,Ut,wr],Y5);let wo=Dt({},["mi","mo","mn","ms","mtext"]),Hc=Dt({},["annotation-xml"]);const ry=Dt({},["title","style","font","a","script"]);let kl=null;const ny=["application/xhtml+xml","text/html"],iy="text/html";let Pr=null,ga=null;const sy=r.createElement("form"),g0=function(G){return G instanceof RegExp||G instanceof Function},Nu=function(){let G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(ga&&ga===G)){if((!G||typeof G!="object")&&(G={}),G=_a(G),kl=ny.indexOf(G.PARSER_MEDIA_TYPE)===-1?iy:G.PARSER_MEDIA_TYPE,Pr=kl==="application/xhtml+xml"?Y5:rb,fe=qs(G,"ALLOWED_TAGS")?Dt({},G.ALLOWED_TAGS,Pr):Te,I=qs(G,"ALLOWED_ATTR")?Dt({},G.ALLOWED_ATTR,Pr):tt,kr=qs(G,"ALLOWED_NAMESPACES")?Dt({},G.ALLOWED_NAMESPACES,Y5):pn,ft=qs(G,"ADD_URI_SAFE_ATTR")?Dt(_a(Pt),G.ADD_URI_SAFE_ATTR,Pr):Pt,Le=qs(G,"ADD_DATA_URI_TAGS")?Dt(_a(Be),G.ADD_DATA_URI_TAGS,Pr):Be,Y=qs(G,"FORBID_CONTENTS")?Dt({},G.FORBID_CONTENTS,Pr):oe,Oe=qs(G,"FORBID_TAGS")?Dt({},G.FORBID_TAGS,Pr):_a({}),Ze=qs(G,"FORBID_ATTR")?Dt({},G.FORBID_ATTR,Pr):_a({}),Fe=qs(G,"USE_PROFILES")?G.USE_PROFILES:!1,vt=G.ALLOW_ARIA_ATTR!==!1,Ct=G.ALLOW_DATA_ATTR!==!1,wt=G.ALLOW_UNKNOWN_PROTOCOLS||!1,zt=G.ALLOW_SELF_CLOSE_IN_ATTR!==!1,gr=G.SAFE_FOR_TEMPLATES||!1,R=G.SAFE_FOR_XML!==!1,W=G.WHOLE_DOCUMENT||!1,le=G.RETURN_DOM||!1,he=G.RETURN_DOM_FRAGMENT||!1,ke=G.RETURN_TRUSTED_TYPE||!1,pe=G.FORCE_BODY||!1,Ce=G.SANITIZE_DOM!==!1,ve=G.SANITIZE_NAMED_PROPS||!1,Ye=G.KEEP_CONTENT!==!1,_e=G.IN_PLACE||!1,O=G.ALLOWED_URI_REGEXP||OH,sn=G.NAMESPACE||wr,wo=G.MATHML_TEXT_INTEGRATION_POINTS||wo,Hc=G.HTML_INTEGRATION_POINTS||Hc,qe=G.CUSTOM_ELEMENT_HANDLING||{},G.CUSTOM_ELEMENT_HANDLING&&g0(G.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(qe.tagNameCheck=G.CUSTOM_ELEMENT_HANDLING.tagNameCheck),G.CUSTOM_ELEMENT_HANDLING&&g0(G.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(qe.attributeNameCheck=G.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),G.CUSTOM_ELEMENT_HANDLING&&typeof G.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(qe.allowCustomizedBuiltInElements=G.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),gr&&(Ct=!1),he&&(le=!0),Fe&&(fe=Dt({},cL),I=[],Fe.html===!0&&(Dt(fe,lL),Dt(I,hL)),Fe.svg===!0&&(Dt(fe,X5),Dt(I,Q5),Dt(I,Ny)),Fe.svgFilters===!0&&(Dt(fe,J5),Dt(I,Q5),Dt(I,Ny)),Fe.mathMl===!0&&(Dt(fe,Z5),Dt(I,uL),Dt(I,Ny))),G.ADD_TAGS&&(fe===Te&&(fe=_a(fe)),Dt(fe,G.ADD_TAGS,Pr)),G.ADD_ATTR&&(I===tt&&(I=_a(I)),Dt(I,G.ADD_ATTR,Pr)),G.ADD_URI_SAFE_ATTR&&Dt(ft,G.ADD_URI_SAFE_ATTR,Pr),G.FORBID_CONTENTS&&(Y===oe&&(Y=_a(Y)),Dt(Y,G.FORBID_CONTENTS,Pr)),Ye&&(fe["#text"]=!0),W&&Dt(fe,["html","head","body"]),fe.table&&(Dt(fe,["tbody"]),delete Oe.tbody),G.TRUSTED_TYPES_POLICY){if(typeof G.TRUSTED_TYPES_POLICY.createHTML!="function")throw W0('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof G.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw W0('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');S=G.TRUSTED_TYPES_POLICY,k=S.createHTML("")}else S===void 0&&(S=x1e(f,i)),S!==null&&typeof k=="string"&&(k=S.createHTML(""));di&&di(G),ga=G}},y0=Dt({},[...X5,...J5,...l1e]),b0=Dt({},[...Z5,...c1e]),oy=function(G){let xe=x(G);(!xe||!xe.tagName)&&(xe={namespaceURI:sn,tagName:"template"});const Ue=rb(G.tagName),nr=rb(xe.tagName);return kr[G.namespaceURI]?G.namespaceURI===Ut?xe.namespaceURI===wr?Ue==="svg":xe.namespaceURI===rr?Ue==="svg"&&(nr==="annotation-xml"||wo[nr]):!!y0[Ue]:G.namespaceURI===rr?xe.namespaceURI===wr?Ue==="math":
106xe.namespaceURI===Ut?Ue==="math"&&Hc[nr]:!!b0[Ue]:G.namespaceURI===wr?xe.namespaceURI===Ut&&!Hc[nr]||xe.namespaceURI===rr&&!wo[nr]?!1:!b0[Ue]&&(ry[Ue]||!y0[Ue]):!!(kl==="application/xhtml+xml"&&kr[G.namespaceURI]):!1},zi=function(G){q0(e.removed,{element:G});try{x(G).removeChild(G)}catch{g(G)}},ya=function(G,xe){try{q0(e.removed,{attribute:xe.getAttributeNode(G),from:xe})}catch{q0(e.removed,{attribute:null,from:xe})}if(xe.removeAttribute(G),G==="is")if(le||he)try{zi(xe)}catch{}else try{xe.setAttribute(G,"")}catch{}},x0=function(G){let xe=null,Ue=null;if(pe)G="<remove></remove>"+G;else{const Ir=aL(G,/^[\r\n\t ]+/);Ue=Ir&&Ir[0]}kl==="application/xhtml+xml"&&sn===wr&&(G='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+G+"</body></html>");const nr=S?S.createHTML(G):G;if(sn===wr)try{xe=new d().parseFromString(nr,kl)}catch{}if(!xe||!xe.documentElement){xe=w.createDocument(sn,"template",null);try{xe.documentElement.innerHTML=Nt?k:nr}catch{}}const Xr=xe.body||xe.documentElement;return G&&Ue&&Xr.insertBefore(r.createTextNode(Ue),Xr.childNodes[0]||null),sn===wr?B.call(xe,W?"html":"body")[0]:W?xe.documentElement:Xr},v0=function(G){return _.call(G.ownerDocument||G,G,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Fu=function(G){return G instanceof u&&(typeof G.nodeName!="string"||typeof G.textContent!="string"||typeof G.removeChild!="function"||!(G.attributes instanceof h)||typeof G.removeAttribute!="function"||typeof G.setAttribute!="function"||typeof G.namespaceURI!="string"||typeof G.insertBefore!="function"||typeof G.hasChildNodes!="function")},w0=function(G){return typeof a=="function"&&G instanceof a};function ds(et,G,xe){Py(et,Ue=>{Ue.call(e,G,xe,ga)})}const k0=function(G){let xe=null;if(ds(D.beforeSanitizeElements,G,null),Fu(G))return zi(G),!0;const Ue=Pr(G.nodeName);if(ds(D.uponSanitizeElement,G,{tagName:Ue,allowedTags:fe}),R&&G.hasChildNodes()&&!w0(G.firstElementChild)&&Kn(/<[/\w!]/g,G.innerHTML)&&Kn(/<[/\w!]/g,G.textContent)||G.nodeType===U0.progressingInstruction||R&&G.nodeType===U0.comment&&Kn(/<[/\w]/g,G.data))return zi(G),!0;if(!fe[Ue]||Oe[Ue]){if(!Oe[Ue]&&S0(Ue)&&(qe.tagNameCheck instanceof RegExp&&Kn(qe.tagNameCheck,Ue)||qe.tagNameCheck instanceof Function&&qe.tagNameCheck(Ue)))return!1;if(Ye&&!Y[Ue]){const nr=x(G)||G.parentNode,Xr=b(G)||G.childNodes;if(Xr&&nr){const Ir=Xr.length;for(let mn=Ir-1;mn>=0;--mn){const fs=m(Xr[mn],!0);fs.__removalCount=(G.__removalCount||0)+1,nr.insertBefore(fs,y(G))}}}return zi(G),!0}return G instanceof l&&!oy(G)||(Ue==="noscript"||Ue==="noembed"||Ue==="noframes")&&Kn(/<\/no(script|embed|frames)/i,G.innerHTML)?(zi(G),!0):(gr&&G.nodeType===U0.text&&(xe=G.textContent,Py([N,K,z],nr=>{xe=V0(xe,nr," ")}),G.textContent!==xe&&(q0(e.removed,{element:G.cloneNode()}),G.textContent=xe)),ds(D.afterSanitizeElements,G,null),!1)},C0=function(G,xe,Ue){if(Ce&&(xe==="id"||xe==="name")&&(Ue in r||Ue in sy))return!1;if(!(Ct&&!Ze[xe]&&Kn($,xe))){if(!(vt&&Kn(H,xe))){if(!I[xe]||Ze[xe]){if(!(S0(G)&&(qe.tagNameCheck instanceof RegExp&&Kn(qe.tagNameCheck,G)||qe.tagNameCheck instanceof Function&&qe.tagNameCheck(G))&&(qe.attributeNameCheck instanceof RegExp&&Kn(qe.attributeNameCheck,xe)||qe.attributeNameCheck instanceof Function&&qe.attributeNameCheck(xe))||xe==="is"&&qe.allowCustomizedBuiltInElements&&(qe.tagNameCheck instanceof RegExp&&Kn(qe.tagNameCheck,Ue)||qe.tagNameCheck instanceof Function&&qe.tagNameCheck(Ue))))return!1}else if(!ft[xe]){if(!Kn(O,V0(Ue,q,""))){if(!((xe==="src"||xe==="xlink:href"||xe==="href")&&G!=="script"&&i1e(Ue,"data:")===0&&Le[G])){if(!(wt&&!Kn(j,V0(Ue,q,"")))){if(Ue)return!1}}}}}}return!0},S0=function(G){return G!=="annotation-xml"&&aL(G,ne)},T0=function(G){ds(D.beforeSanitizeAttributes,G,null);const{attributes:xe}=G;if(!xe||Fu(G))return;const Ue={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:I,forceKeepAttr:void 0};let nr=xe.length;for(;nr--;){const Xr=xe[nr],{name:Ir,namespaceURI:mn,value:fs}=Xr,Cl=Pr(Ir),$u=fs;let Jr=Ir==="value"?$u:s1e($u);if(Ue.attrName=Cl,Ue.attrValue=Jr,Ue.keepAttr=!0,Ue.forceKeepAttr=void 0,ds(D.uponSanitizeAttribute,G,Ue),Jr=Ue.attrValue,ve&&(Cl==="id"||Cl==="name")&&(ya(Ir,G),Jr=ge+Jr),R&&Kn(/((--!?|])>)|<\/(style|title)/i,Jr)){ya(Ir,G);continue}if(Ue.forceKeepAttr)continue;if(!Ue.keepAttr){ya(Ir,G);continue}if(!zt&&Kn(/\/>/i,Jr)){ya(Ir,G);continue}gr&&Py([N,K,z],M0=>{Jr=V0(Jr,M0," ")});const _0=Pr(G.nodeName);if(!C0(_0,Cl,Jr)){ya(Ir,G);continue}if(S&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!mn)switch(f.getAttributeType(_0,Cl)){case"TrustedHTML":{Jr=S.createHTML(Jr);break}case"TrustedScriptURL":{Jr=S.createScriptURL(Jr);break}}if(Jr!==$u)try{mn?G.setAttributeNS(mn,Ir,Jr):G.setAttribute(Ir,Jr),Fu(G)?zi(G):oL(e.removed)}catch{ya(Ir,G)}}ds(D.afterSanitizeAttributes,G,null)},ay=function et(G){let xe=null;const Ue=v0(G);for(ds(D.beforeSanitizeShadowDOM,G,null);xe=Ue.nextNode();)ds(D.uponSanitizeShadowNode,xe,null),k0(xe),T0(xe),xe.content instanceof s&&et(xe.content);ds(D.afterSanitizeShadowDOM,G,null)};return e.sanitize=function(et){let G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},xe=null,Ue=null,nr=null,Xr=null;if(Nt=!et,Nt&&(et="<!-->"),typeof et!="string"&&!w0(et))if(typeof et.toString=="function"){if(et=et.toString(),typeof et!="string")throw W0("dirty is not a string, aborting")}else throw W0("toString is not a function");if(!e.isSupported)return et;if(ee||Nu(G),e.removed=[],typeof et=="string"&&(_e=!1),_e){if(et.nodeName){const fs=Pr(et.nodeName);if(!fe[fs]||Oe[fs])throw W0("root node is forbidden and cannot be sanitized in-place")}}else if(et instanceof a)xe=x0("<!---->"),Ue=xe.ownerDocument.importNode(et,!0),Ue.nodeType===U0.element&&Ue.nodeName==="BODY"||Ue.nodeName==="HTML"?xe=Ue:xe.appendChild(Ue);else{if(!le&&!gr&&!W&&et.indexOf("<")===-1)return S&&ke?S.createHTML(et):et;if(xe=x0(et),!xe)return le?null:ke?k:""}xe&&pe&&zi(xe.firstChild);const Ir=v0(_e?et:xe);for(;nr=Ir.nextNode();)k0(nr),T0(nr),nr.content instanceof s&&ay(nr.content);if(_e)return et;if(le){if(he)for(Xr=L.call(xe.ownerDocument);xe.firstChild;)Xr.appendChild(xe.firstChild);else Xr=xe;return(I.shadowroot||I.shadowrootmode)&&(Xr=E.call(n,Xr,!0)),Xr}let mn=W?xe.outerHTML:xe.innerHTML;return W&&fe["!doctype"]&&xe.ownerDocument&&xe.ownerDocument.doctype&&xe.ownerDocument.doctype.name&&Kn(LH,xe.ownerDocument.doctype.name)&&(mn="<!DOCTYPE "+xe.ownerDocument.doctype.name+`>
107`+mn),gr&&Py([N,K,z],fs=>{mn=V0(mn,fs," ")}),S&&ke?S.createHTML(mn):mn},e.setConfig=function(){let et=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Nu(et),ee=!0},e.clearConfig=function(){ga=null,ee=!1},e.isValidAttribute=function(et,G,xe){ga||Nu({});const Ue=Pr(et),nr=Pr(G);return C0(Ue,nr,xe)},e.addHook=function(et,G){typeof G=="function"&&q0(D[et],G)},e.removeHook=function(et,G){if(G!==void 0){const xe=r1e(D[et],G);return xe===-1?void 0:n1e(D[et],xe,1)[0]}return oL(D[et])},e.removeHooks=function(et){D[et]=[]},e.removeAllHooks=function(){D=fL()},e}var An=DH();function Ef({icon:t,class:e,onClick:r}){return te("span",{class:Mn("milkdown-icon",e),onPointerdown:r,ref:n=>{n&&t&&(n.innerHTML=An.sanitize(t.trim()))}})}Ef.props={icon:{type:String,required:!1},class:{type:String,required:!1},onClick:{type:Function,required:!1}};let v1e=t=>crypto.getRandomValues(new Uint8Array(t)),w1e=(t,e,r)=>{let n=(2<<Math.log2(t.length-1))-1,i=-~(1.6*n*e/t.length);return(s=e)=>{let o="";for(;;){let a=r(i),l=i|0;for(;l--;)if(o+=t[a[l]&n]||"",o.length>=s)return o}}},IH=(t,e=21)=>w1e(t,e|0,v1e);var k1e=Object.defineProperty,pL=Object.getOwnPropertySymbols,C1e=Object.prototype.hasOwnProperty,S1e=Object.prototype.propertyIsEnumerable,mL=(t,e,r)=>e in t?k1e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,T1e=(t,e)=>{for(var r in e||(e={}))C1e.call(e,r)&&mL(t,r,e[r]);if(pL)for(var r of pL(e))S1e.call(e,r)&&mL(t,r,e[r]);return t};function R1(t,e){return Object.assign(t,{meta:T1e({package:"@milkdown/components"},e)}),t}const _1e={imageIcon:"🌌",captionIcon:"💬",uploadButton:"Upload file",confirmButton:"Confirm ⏎",uploadPlaceholderText:"or paste the image link ...",captionPlaceholderText:"Image caption",onUpload:t=>Promise.resolve(URL.createObjectURL(t))},Lw=tr(_1e,"imageBlockConfigCtx");R1(Lw,{displayName:"Config<image-block>",group:"ImageBlock"});function M1e(t){return Dc(t,"paragraph",(e,r,n)=>{var i,s;if(((i=e.children)==null?void 0:i.length)!==1)return;const o=(s=e.children)==null?void 0:s[0];if(!o||o.type!=="image")return;const{url:a,alt:l,title:c}=o,h={type:"image-block",url:a,alt:l,title:c};n.children.splice(r,1,h)})}const e9=aa("remark-image-block",()=>()=>M1e);R1(e9.plugin,{displayName:"Remark<remarkImageBlock>",group:"ImageBlock"});R1(e9.options,{displayName:"RemarkConfig<remarkImageBlock>",group:"ImageBlock"});var A1e=Object.defineProperty,gL=Object.getOwnPropertySymbols,E1e=Object.prototype.hasOwnProperty,O1e=Object.prototype.propertyIsEnumerable,yL=(t,e,r)=>e in t?A1e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,L1e=(t,e)=>{for(var r in e||(e={}))E1e.call(e,r)&&yL(t,r,e[r]);if(gL)for(var r of gL(e))O1e.call(e,r)&&yL(t,r,e[r]);return t};const tS="image-block",Dw=Hr("image-block",()=>({inline:!1,group:"block",selectable:!0,draggable:!0,isolating:!0,marks:"",atom:!0,priority:100,attrs:{src:{default:"",validate:"string"},caption:{default:"",validate:"string"},ratio:{default:1,validate:"number"}},parseDOM:[{tag:`img[data-type="${tS}"]`,getAttrs:t=>{var e;if(!(t instanceof HTMLElement))throw mo(t);return{src:t.getAttribute("src")||"",caption:t.getAttribute("caption")||"",ratio:Number((e=t.getAttribute("ratio"))!=null?e:1)}}}],toDOM:t=>["img",L1e({"data-type":tS},t.attrs)],parseMarkdown:{match:({type:t})=>t==="image-block",runner:(t,e,r)=>{const n=e.url,i=e.title;
107let s=Number(e.alt||1);(Number.isNaN(s)||s===0)&&(s=1),t.addNode(r,{src:n,caption:i,ratio:s})}},toMarkdown:{match:t=>t.type.name==="image-block",runner:(t,e)=>{t.openNode("paragraph"),t.addNode("image",void 0,void 0,{title:e.attrs.caption,url:e.attrs.src,alt:`${Number.parseFloat(e.attrs.ratio).toFixed(2)}`}),t.closeNode()}}}));R1(Dw.node,{displayName:"NodeSchema<image-block>",group:"ImageBlock"});function Mm({icon:t,class:e,onClick:r}){return te("span",{class:Mn("milkdown-icon",e),onPointerdown:r,ref:n=>{n&&t&&(n.innerHTML=An.sanitize(t.trim()))}})}Mm.props={icon:{type:String,required:!1},class:{type:String,required:!1},onClick:{type:Function,required:!1}};const D1e=IH("abcdefg",8),I1e=En({props:{src:{type:Object,required:!0},selected:{type:Object,required:!0},readonly:{type:Object,required:!0},setLink:{type:Function,required:!0},imageIcon:{type:String,required:!1},uploadButton:{type:String,required:!1},confirmButton:{type:String,required:!1},uploadPlaceholderText:{type:String,required:!1},onUpload:{type:Function,required:!0}},setup({readonly:t,src:e,setLink:r,onUpload:n,imageIcon:i,uploadButton:s,confirmButton:o,uploadPlaceholderText:a,className:l}){var c,h;const u=We(!1),d=We(),f=We((c=e.value)!=null?c:""),p=We(D1e()),m=We(((h=e.value)==null?void 0:h.length)!==0),g=S=>{const w=S.target.value;m.value=w.length!==0,f.value=w},y=S=>{var k,w;S.key==="Enter"&&r((w=(k=d.value)==null?void 0:k.value)!=null?w:"")},b=()=>{var S,k;r((k=(S=d.value)==null?void 0:S.value)!=null?k:"")},x=S=>{var k;const w=(k=S.target.files)==null?void 0:k[0];w&&n(w).then(_=>{_&&(r(_),m.value=!0)}).catch(_=>{console.error("An error occurred while uploading image"),console.error(_)})};return()=>te("div",{class:Mn("image-edit",l)},te(Mm,{icon:i,class:"image-icon"}),te("div",{class:Mn("link-importer",u.value&&"focus")},te("input",{ref:d,draggable:"true",onDragstart:S=>{S.preventDefault(),S.stopPropagation()},disabled:t.value,class:"link-input-area",value:f.value,onInput:g,onKeydown:y,onFocus:()=>u.value=!0,onBlur:()=>u.value=!1}),!m.value&&te("div",{class:"placeholder"},te("input",{disabled:t.value,class:"hidden",id:p.value,type:"file",accept:"image/*",onChange:x}),te("label",{class:"uploader",for:p.value},te(Mm,{icon:s})),te("span",{class:"text",onClick:()=>{var S;return(S=d.value)==null?void 0:S.focus()}},a))),f.value&&te("div",{class:"confirm",onClick:()=>b()},te(Mm,{icon:o})))}}),B1e=En({props:{src:{type:Object,required:!0},caption:{type:Object,required:!0},ratio:{type:Object,required:!0},selected:{type:Object,required:!0},readonly:{type:Object,required:!0},setAttr:{type:Function,required:!0},config:{type:Object,required:!0}},setup({src:t,caption:e,ratio:r,readonly:n,setAttr:i,config:s}){var o;const a=We(),l=We(),c=We(!!((o=e.value)!=null&&o.length)),h=We(0),u=()=>{var b;const x=a.value;if(!x)return;const S=x.closest(".milkdown-image-block");if(!S)return;const k=S.getBoundingClientRect().width;if(!k)return;const w=x.height,_=x.width,L=_<k?w:k*(w/_),B=(L*((b=r.value)!=null?b:1)).toFixed(2);x.dataset.origin=L.toFixed(2),x.dataset.height=B,x.style.height=`${B}px`},d=b=>{b.preventDefault(),b.stopPropagation(),!n.value&&(c.value=!c.value)},f=b=>{const S=b.target.value;h.value&&window.clearTimeout(h.value),h.value=window.setTimeout(()=>{i("caption",S)},1e3)},p=b=>{const S=b.target.value;h.value&&(window.clearTimeout(h.value),h.value=0),i("caption",S)},m=b=>{b.preventDefault();const x=a.value;if(!x)return;const S=x.getBoundingClientRect().top,k=b.clientY-S,w=Number(k<100?100:k).toFixed(2);x.dataset.height=w,x.style.height=`${w}px`},g=()=>{window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",g);const b=a.value;if(!b)return;const x=Number(b.dataset.origin),S=Number(b.dataset.height),k=Number.parseFloat(Number(S/x).toFixed(2));Number.isNaN(k)||i("ratio",k)},y=b=>{n.value||(b.preventDefault(),b.stopPropagation(),window.addEventListener("pointermove",m),window.addEventListener("pointerup",g))};return()=>te(Cn,null,te("div",{class:"image-wrapper"},te("div",{class:"operation"},te("div",{class:"operation-item",onPointerdown:d},te(Mm,{icon:s.captionIcon}))),te("img",{ref:a,"data-type":tS,onLoad:u,src:t.value,alt:e.value}),te("div",{ref:l,class:"image-resize-handle",onPointerdown:y})),c.value&&te("input",{draggable:"true",onDragstart:b=>{b.preventDefault(),b.stopPropagation()},class:"caption-input",placeholder:s==null?void 0:s.captionPlaceholderText,onInput:f,onBlur:p,value:e.value}))}});var R1e=Object.defineProperty,bL=Object.getOwnPropertySymbols,P1e=Object.prototype.hasOwnProperty,N1e=Object.prototype.propertyIsEnumerable,xL=(t,e,r)=>e in t?R1e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,F1e=(t,e)=>{for(var r in e||(e={}))P1e.call(e,r)&&xL(t,r,e[r]);if(bL)for(var r of bL(e))N1e.call(e,r)&&xL(t,r,e[r]);return t};const $1e=En({props:{src:{type:Object,required:!0},caption:{type:Object,required:!0},ratio:{type:Object,required:!0},selected:{type:Object,required:!0},readonly:{type:Object,required:!0},setAttr:{type:Function,required:!0},config:{type:Object,required:!0}},setup(t){const{src:e}=t;return()=>{var r;return(r=e.value)!=null&&r.length?te(B1e,F1e({},t)):te(I1e,{src:t.src,selected:t.selected,readonly:t.readonly,setLink:n=>t.setAttr("src",n),imageIcon:t.config.imageIcon,uploadButton:t.config.uploadButton,confirmButton:t.config.confirmButton,uploadPlaceholderText:t.config.uploadPlaceholderText,onUpload:t.config.onUpload})}}}),BH=_1(Dw.node,t=>(e,r,n)=>{const i=We(e.attrs.src),s=We(e.attrs.caption),o=We(e.attrs.ratio),a=We(!1),l=We(!r.editable),c=(g,y)=>{if(!r.editable)return;const b=n();b!=null&&r.dispatch(r.state.tr.setNodeAttribute(b,g,g==="src"?An.sanitize(y):y))},h=t.get(Lw.key),u=bo($1e,{src:i,caption:s,ratio:o,selected:a,readonly:l,setAttr:c,config:h}),d=document.createElement("div");d.className="milkdown-image-block",u.mount(d);const f=n0(()=>{a.value?d.classList.add("selected"):d.classList.remove("selected")}),p=h.proxyDomURL,m=g=>{if(!p)i.value=g.attrs.src;else{const y=p(g.attrs.src);typeof y=="string"?i.value=y:y.then(b=>{i.value=b}).catch(console.error)}o.value=g.attrs.ratio,s.value=g.attrs.caption,l.value=!r.editable};return m(e),{dom:d,update:g=>g.type!==e.type?!1:(m(g),!0),stopEvent:g=>g.target instanceof HTMLInputElement,selectNode:()=>{a.value=!0},deselectNode:()=>{a.value=!1},destroy:()=>{f(),u.unmount(),d.remove()}}});R1(BH,{displayName:"NodeView<image-block>",group:"ImageBlock"});const z1e=[e9,Dw,BH,Lw].flat();var rS,nS;if(typeof WeakMap<"u"){let t=new WeakMap;rS=e=>t.get(e),nS=(e,r)=>(t.set(e,r),r)}else{const t=[];let r=0;rS=n=>{for(let i=0;i<t.length;i+=2)if(t[i]==n)return t[i+1]},nS=(n,i)=>(r==10&&(r=0),t[r++]=n,t[r++]=i)}var Jt=class{constructor(t,e,r,n){this.width=t,this.height=e,this.map=r,this.problems=n}findCell(t){for(let e=0;e<this.map.length;e++){const r=this.map[e];if(r!=t)continue;const n=e%this.width,i=e/this.width|0;let s=n+1,o=i+1;for(let a=1;s<this.width&&this.map[e+a]==r;a++)s++;for(let a=1;o<this.height&&this.map[e+this.width*a]==r;a++)o++;return{left:n,top:i,right:s,bottom:o}}throw new RangeError(`No cell with offset ${t} found`)}colCount(t){for(let e=0;e<this.map.length;e++)if(this.map[e]==t)return e%this.width;throw new RangeError(`No cell with offset ${t} found`)}nextCell(t,e,r){const{left:n,right:i,top:s,bottom:o}=this.findCell(t);return e=="horiz"?(r<0?n==0:i==this.width)?null:this.map[s*this.width+(r<0?n-1:i)]:(r<0?s==0:o==this.height)?null:this.map[n+this.width*(r<0?s-1:o)]}rectBetween(t,e){const{left:r,right:n,top:i,bottom:s}=this.findCell(t),{left:o,right:a,top:l,bottom:c}=this.findCell(e);return{left:Math.min(r,o),top:Math.min(i,l),right:Math.max(n,a),bottom:Math.max(s,c)}}cellsInRect(t){const e=[],r={};for(let n=t.top;n<t.bottom;n++)for(let i=t.left;i<t.right;i++){const s=n*this.width+i,o=this.map[s];r[o]||(r[o]=!0,!(i==t.left&&i&&this.map[s-1]==o||n==t.top&&n&&this.map[s-this.width]==o)&&e.push(o))}return e}positionAt(t,e,r){for(let n=0,i=0;;n++){const s=i+r.child(n).nodeSize;if(n==t){let o=e+t*this.width;const a=(t+1)*this.width;for(;o<a&&this.map[o]<i;)o++;return o==a?s-1:this.map[o]}i=s}}static get(t){return rS(t)||nS(t,H1e(t))}};function H1e(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);const e=q1e(t),r=t.childCount,n=[];let i=0,s=null;const o=[];for(let c=0,h=e*r;c<h;c++)n[c]=0;for(let c=0,h=0;c<r;c++){const u=t.child(c);h++;for(let p=0;;p++){for(;i<n.length&&n[i]!=0;)i++;if(p==u.childCount)break;const m=u.child(p),{colspan:g,rowspan:y,colwidth:b}=m.attrs;for(let x=0;x<y;x++){if(x+c>=r){(s||(s=[])).push({type:"overlong_rowspan",pos:h,n:y-x});break}const S=i+x*e;for(let k=0;k<g;k++){n[S+k]==0?n[S+k]=h:(s||(s=[])).push({type:"collision",row:c,pos:h,n:g-k});const w=b&&b[k];
107if(w){const _=(S+k)%e*2,L=o[_];L==null||L!=w&&o[_+1]==1?(o[_]=w,o[_+1]=1):L==w&&o[_+1]++}}}i+=g,h+=m.nodeSize}const d=(c+1)*e;let f=0;for(;i<d;)n[i++]==0&&f++;f&&(s||(s=[])).push({type:"missing",row:c,n:f}),h++}(e===0||r===0)&&(s||(s=[])).push({type:"zero_sized"});const a=new Jt(e,r,n,s);let l=!1;for(let c=0;!l&&c<o.length;c+=2)o[c]!=null&&o[c+1]<r&&(l=!0);return l&&V1e(a,o,t),a}function q1e(t){let e=-1,r=!1;for(let n=0;n<t.childCount;n++){const i=t.child(n);let s=0;if(r)for(let o=0;o<n;o++){const a=t.child(o);for(let l=0;l<a.childCount;l++){const c=a.child(l);o+c.attrs.rowspan>n&&(s+=c.attrs.colspan)}}for(let o=0;o<i.childCount;o++){const a=i.child(o);s+=a.attrs.colspan,a.attrs.rowspan>1&&(r=!0)}e==-1?e=s:e!=s&&(e=Math.max(e,s))}return e}function V1e(t,e,r){t.problems||(t.problems=[]);const n={};for(let i=0;i<t.map.length;i++){const s=t.map[i];if(n[s])continue;n[s]=!0;const o=r.nodeAt(s);if(!o)throw new RangeError(`No cell with offset ${s} found`);let a=null;const l=o.attrs;for(let c=0;c<l.colspan;c++){const h=(i+c)%t.width,u=e[h*2];u!=null&&(!l.colwidth||l.colwidth[c]!=u)&&((a||(a=W1e(l)))[c]=u)}a&&t.problems.unshift({type:"colwidth mismatch",pos:s,colwidth:a})}}function W1e(t){if(t.colwidth)return t.colwidth.slice();const e=[];for(let r=0;r<t.colspan;r++)e.push(0);return e}function vL(t,e){if(typeof t=="string")return{};const r=t.getAttribute("data-colwidth"),n=r&&/^\d+(,\d+)*$/.test(r)?r.split(",").map(o=>Number(o)):null,i=Number(t.getAttribute("colspan")||1),s={colspan:i,rowspan:Number(t.getAttribute("rowspan")||1),colwidth:n&&n.length==i?n:null};for(const o in e){const a=e[o].getFromDOM,l=a&&a(t);l!=null&&(s[o]=l)}return s}function wL(t,e){const r={};t.attrs.colspan!=1&&(r.colspan=t.attrs.colspan),t.attrs.rowspan!=1&&(r.rowspan=t.attrs.rowspan),t.attrs.colwidth&&(r["data-colwidth"]=t.attrs.colwidth.join(","));for(const n in e){const i=e[n].setDOMAttr;i&&i(t.attrs[n],r)}return r}function j1e(t){if(t!==null){if(!Array.isArray(t))throw new TypeError("colwidth must be null or an array");for(const e of t)if(typeof e!="number")throw new TypeError("colwidth must be null or an array of numbers")}}function U1e(t){const e=t.cellAttributes||{},r={colspan:{default:1,validate:"number"},rowspan:{default:1,validate:"number"},colwidth:{default:null,validate:j1e}};for(const n in e)r[n]={default:e[n].default,validate:e[n].validate};return{table:{content:"table_row+",tableRole:"table",isolating:!0,group:t.tableGroup,parseDOM:[{tag:"table"}],toDOM(){return["table",["tbody",0]]}},table_row:{content:"(table_cell | table_header)*",tableRole:"row",parseDOM:[{tag:"tr"}],toDOM(){return["tr",0]}},table_cell:{content:t.cellContent,attrs:r,tableRole:"cell",isolating:!0,parseDOM:[{tag:"td",getAttrs:n=>vL(n,e)}],toDOM(n){return["td",wL(n,e),0]}},table_header:{content:t.cellContent,attrs:r,tableRole:"header_cell",isolating:!0,parseDOM:[{tag:"th",getAttrs:n=>vL(n,e)}],toDOM(n){return["th",wL(n,e),0]}}}}function Ds(t){let e=t.cached.tableNodeTypes;if(!e){e=t.cached.tableNodeTypes={};for(const r in t.nodes){const n=t.nodes[r],i=n.spec.tableRole;i&&(e[i]=n)}}return e}var Ul=new Dr("selectingCells");function P1(t){for(let e=t.depth-1;e>0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}function Ns(t){const e=t.selection.$head;for(let r=e.depth;r>0;r--)if(e.node(r).type.spec.tableRole=="row")return!0;return!1}function Iw(t){const e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;const r=P1(e.$head)||G1e(e.$head);if(r)return r;throw new RangeError(`No cell found around position ${e.head}`)}function G1e(t){for(let e=t.nodeAfter,r=t.pos;e;e=e.firstChild,r++){const n=e.type.spec.tableRole;if(n=="cell"||n=="header_cell")return t.doc.resolve(r)}for(let e=t.nodeBefore,r=t.pos;e;e=e.lastChild,r--){const n=e.type.spec.tableRole;if(n=="cell"||n=="header_cell")return t.doc.resolve(r-e.nodeSize)}}function iS(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function K1e(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function t9(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function RH(t,e,r){const n=t.node(-1),i=Jt.get(n),s=t.start(-1),o=i.nextCell(t.pos-s,e,r);return o==null?null:t.node(0).resolve(s+o)}function gu(t,e,r=1){const n={...t,colspan:t.colspan-r};return n.colwidth&&(n.colwidth=n.colwidth.slice(),n.colwidth.splice(e,r),n.colwidth.some(i=>i>0)||(n.colwidth=null)),n}function Y1e(t,e,r=1){const n={...t,colspan:t.colspan+r};if(n.colwidth){n.colwidth=n.colwidth.slice();for(let i=0;i<r;i++)n.colwidth.splice(e,0,0)}return n}function X1e(t,e,r){const n=Ds(e.type.schema).header_cell;for(let i=0;i<t.height;i++)if(e.nodeAt(t.map[r+i*t.width]).type!=n)return!1;return!0}var cr=class Ma extends gt{constructor(e,r=e){const n=e.node(-1),i=Jt.get(n),s=e.start(-1),o=i.rectBetween(e.pos-s,r.pos-s),a=e.node(0),l=i.cellsInRect(o).filter(h=>h!=r.pos-s);l.unshift(r.pos-s);const c=l.map(h=>{const u=n.nodeAt(h);if(!u)throw RangeError(`No cell with offset ${h} found`);const d=s+h+1;return new JN(a.resolve(d),a.resolve(d+u.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=r}map(e,r){const n=e.resolve(r.map(this.$anchorCell.pos)),i=e.resolve(r.map(this.$headCell.pos));if(iS(n)&&iS(i)&&t9(n,i)){const s=this.$anchorCell.node(-1)!=n.node(-1);return s&&this.isRowSelection()?Ma.rowSelection(n,i):s&&this.isColSelection()?Ma.colSelection(n,i):new Ma(n,i)}return Je.between(n,i)}content(){const e=this.$anchorCell.node(-1),r=Jt.get(e),n=this.$anchorCell.start(-1),i=r.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),s={},o=[];for(let l=i.top;l<i.bottom;l++){const c=[];for(let h=l*r.width+i.left,u=i.left;u<i.right;u++,h++){const d=r.map[h];if(s[d])continue;s[d]=!0;const f=r.findCell(d);let p=e.nodeAt(d);if(!p)throw RangeError(`No cell with offset ${d} found`);const m=i.left-f.left,g=f.right-i.right;if(m>0||g>0){let y=p.attrs;if(m>0&&(y=gu(y,0,m)),g>0&&(y=gu(y,y.colspan-g,g)),f.left<i.left){if(p=p.type.createAndFill(y),!p)throw RangeError(`Could not create cell with attrs ${JSON.stringify(y)}`)}else p=p.type.create(y,p.content)}if(f.top<i.top||f.bottom>i.bottom){const y={...p.attrs,rowspan:Math.min(f.bottom,i.bottom)-Math.max(f.top,i.top)};f.top<i.top?p=p.type.createAndFill(y):p=p.type.create(y,p.content)}c.push(p)}o.push(e.child(l).copy(Se.from(c)))}const a=this.isColSelection()&&this.isRowSelection()?e:o;return new Ie(Se.from(a),1,1)}replace(e,r=Ie.empty){const n=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){const{$from:a,$to:l}=i[o],c=e.mapping.slice(n);e.replace(c.map(a.pos),c.map(l.pos),o?Ie.empty:r)}const s=gt.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);s&&e.setSelection(s)}replaceWith(e,r){this.replace(e,new Ie(Se.from(r),0,0))}forEachCell(e){const r=this.$anchorCell.node(-1),n=Jt.get(r),i=this.$anchorCell.start(-1),s=n.cells
107InRect(n.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i));for(let o=0;o<s.length;o++)e(r.nodeAt(s[o]),i+s[o])}isColSelection(){const e=this.$anchorCell.index(-1),r=this.$headCell.index(-1);if(Math.min(e,r)>0)return!1;const n=e+this.$anchorCell.nodeAfter.attrs.rowspan,i=r+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,i)==this.$headCell.node(-1).childCount}static colSelection(e,r=e){const n=e.node(-1),i=Jt.get(n),s=e.start(-1),o=i.findCell(e.pos-s),a=i.findCell(r.pos-s),l=e.node(0);return o.top<=a.top?(o.top>0&&(e=l.resolve(s+i.map[o.left])),a.bottom<i.height&&(r=l.resolve(s+i.map[i.width*(i.height-1)+a.right-1]))):(a.top>0&&(r=l.resolve(s+i.map[a.left])),o.bottom<i.height&&(e=l.resolve(s+i.map[i.width*(i.height-1)+o.right-1]))),new Ma(e,r)}isRowSelection(){const e=this.$anchorCell.node(-1),r=Jt.get(e),n=this.$anchorCell.start(-1),i=r.colCount(this.$anchorCell.pos-n),s=r.colCount(this.$headCell.pos-n);if(Math.min(i,s)>0)return!1;const o=i+this.$anchorCell.nodeAfter.attrs.colspan,a=s+this.$headCell.nodeAfter.attrs.colspan;return Math.max(o,a)==r.width}eq(e){return e instanceof Ma&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,r=e){const n=e.node(-1),i=Jt.get(n),s=e.start(-1),o=i.findCell(e.pos-s),a=i.findCell(r.pos-s),l=e.node(0);return o.left<=a.left?(o.left>0&&(e=l.resolve(s+i.map[o.top*i.width])),a.right<i.width&&(r=l.resolve(s+i.map[i.width*(a.top+1)-1]))):(a.left>0&&(r=l.resolve(s+i.map[a.top*i.width])),o.right<i.width&&(e=l.resolve(s+i.map[i.width*(o.top+1)-1]))),new Ma(e,r)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,r){return new Ma(e.resolve(r.anchor),e.resolve(r.head))}static create(e,r,n=r){return new Ma(e.resolve(r),e.resolve(n))}getBookmark(){return new J1e(this.$anchorCell.pos,this.$headCell.pos)}};cr.prototype.visible=!1;gt.jsonID("cell",cr);var J1e=class PH{constructor(e,r){this.anchor=e,this.head=r}map(e){return new PH(e.map(this.anchor),e.map(this.head))}resolve(e){const r=e.resolve(this.anchor),n=e.resolve(this.head);return r.parent.type.spec.tableRole=="row"&&n.parent.type.spec.tableRole=="row"&&r.index()<r.parent.childCount&&n.index()<n.parent.childCount&&t9(r,n)?new cr(r,n):gt.near(n,1)}};function Z1e(t){if(!(t.selection instanceof cr))return null;const e=[];return t.selection.forEachCell((r,n)=>{e.push(Ur.node(n,n+r.nodeSize,{class:"selectedCell"}))}),or.create(t.doc,e)}function Q1e({$from:t,$to:e}){if(t.pos==e.pos||t.pos<e.pos-6)return!1;let r=t.pos,n=e.pos,i=t.depth;for(;i>=0&&!(t.after(i+1)<t.end(i));i--,r++);for(let s=e.depth;s>=0&&!(e.before(s+1)>e.start(s));s--,n--);return r==n&&/row|table/.test(t.node(i).type.spec.tableRole)}function eye({$from:t,$to:e}){let r,n;for(let i=t.depth;i>0;i--){const s=t.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){r=s;break}}for(let i=e.depth;i>0;i--){const s=e.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){n=s;break}}return r!==n&&e.parentOffset===0}function tye(t,e,r){const n=(e||t).selection,i=(e||t).doc;let s,o;if(n instanceof lt&&(o=n.node.type.spec.tableRole)){if(o=="cell"||o=="header_cell")s=cr.create(i,n.from);else if(o=="row"){const a=i.resolve(n.from+1);s=cr.rowSelection(a,a)}else if(!r){const a=Jt.get(n.node),l=n.from+1,c=l+a.map[a.width*a.height-1];s=cr.create(i,l+1,c)}}else n instanceof Je&&Q1e(n)?s=Je.create(i,n.from):n instanceof Je&&eye(n)&&(s=Je.create(i,n.$from.start(),n.$from.end()));return s&&(e||(e=t.tr)).setSelection(s),e}var rye=new Dr("fix-tables");function NH(t,e,r,n){const i=t.childCount,s=e.childCount;e:for(let o=0,a=0;o<s;o++){const l=e.child(o);for(let c=a,h=Math.min(i,o+3);c<h;c++)if(t.child(c)==l){a=c+1,r+=l.nodeSize;continue e}n(l,r),a<i&&t.child(a).sameMarkup(l)?NH(t.child(a),l,r+1,n):l.nodesBetween(0,l.content.size,n,r+1),r+=l.nodeSize}}function nye(t,e){let r;const n=(i,s)=>{i.type.spec.tableRole=="table"&&(r=iye(t,i,s,r))};return e?e.doc!=t.doc&&NH(e.doc,t.doc,0,n):t.doc.descendants(n),r}function iye(t,e,r,n){const i=Jt.get(e);if(!i.problems)return n;n||(n=t.tr);const s=[];for(let l=0;l<i.height;l++)s.push(0);for(let l=0;l<i.problems.length;l++){const c=i.problems[l];if(c.type=="collision"){const h=e.nodeAt(c.pos);if(!h)continue;const u=h.attrs;for(let d=0;d<u.rowspan;d++)s[c.row+d]+=c.n;n.setNodeMarkup(n.mapping.map(r+1+c.pos),null,gu(u,u.colspan-c.n,c.n))}else if(c.type=="missing")s[c.row]+=c.n;else if(c.type=="overlong_rowspan"){const h=e.nodeAt(c.pos);if(!h)continue;n.setNodeMarkup(n.mapping.map(r+1+c.pos),null,{...h.attrs,rowspan:h.attrs.rowspan-c.n})}else if(c.type=="colwidth mismatch"){const h=e.nodeAt(c.pos);if(!h)continue;n.setNodeMarkup(n.mapping.map(r+1+c.pos),null,{...h.attrs,colwidth:c.colwidth})}else if(c.type=="zero_sized"){const h=n.mapping.map(r);n.delete(h,h+e.nodeSize)}}let o,a;for(let l=0;l<s.length;l++)s[l]&&(o==null&&(o=l),a=l);for(let l=0,c=r+1;l<i.height;l++){const h=e.child(l),u=c+h.nodeSize,d=s[l];if(d>0){let f="cell";h.firstChild&&(f=h.firstChild.type.spec.tableRole);const p=[];for(let g=0;g<d;g++){const y=Ds(t.schema)[f].createAndFill();y&&p.push(y)}const m=(l==0||o==l-1)&&a==l?c+1:u-1;n.insert(n.mapping.map(m),p)}c=u}return n.setMeta(rye,{fixTables:!0})}
107function Rc(t){const e=t.selection,r=Iw(t),n=r.node(-1),i=r.start(-1),s=Jt.get(n);return{...e instanceof cr?s.rectBetween(e.$anchorCell.pos-i,e.$headCell.pos-i):s.findCell(r.pos-i),tableStart:i,map:s,table:n}}function FH(t,{map:e,tableStart:r,table:n},i){let s=i>0?-1:0;X1e(e,n,i+s)&&(s=i==0||i==e.width?null:0);for(let o=0;o<e.height;o++){const a=o*e.width+i;if(i>0&&i<e.width&&e.map[a-1]==e.map[a]){const l=e.map[a],c=n.nodeAt(l);t.setNodeMarkup(t.mapping.map(r+l),null,Y1e(c.attrs,i-e.colCount(l))),o+=c.attrs.rowspan-1}else{const l=s==null?Ds(n.type.schema).cell:n.nodeAt(e.map[a+s]).type,c=e.positionAt(o,i,n);t.insert(t.mapping.map(r+c),l.createAndFill())}}return t}function sye(t,e){if(!Ns(t))return!1;if(e){const r=Rc(t);e(FH(t.tr,r,r.left))}return!0}function oye(t,e){if(!Ns(t))return!1;if(e){const r=Rc(t);e(FH(t.tr,r,r.right))}return!0}function aye(t,{map:e,table:r,tableStart:n},i){const s=t.mapping.maps.length;for(let o=0;o<e.height;){const a=o*e.width+i,l=e.map[a],c=r.nodeAt(l),h=c.attrs;if(i>0&&e.map[a-1]==l||i<e.width-1&&e.map[a+1]==l)t.setNodeMarkup(t.mapping.slice(s).map(n+l),null,gu(h,i-e.colCount(l)));else{const u=t.mapping.slice(s).map(n+l);t.delete(u,u+c.nodeSize)}o+=h.rowspan}
107}function lye(t,e){if(!Ns(t))return!1;if(e){const r=Rc(t),n=t.tr;if(r.left==0&&r.right==r.map.width)return!1;for(let i=r.right-1;aye(n,r,i),i!=r.left;i--){const s=r.tableStart?n.doc.nodeAt(r.tableStart-1):n.doc;if(!s)throw RangeError("No table found");r.table=s,r.map=Jt.get(s)}e(n)}return!0}function cye(t,{map:e,table:r,tableStart:n},i){let s=0;for(let c=0;c<i;c++)s+=r.child(c).nodeSize;const o=s+r.child(i).nodeSize,a=t.mapping.maps.length;t.delete(s+n,o+n);const l=new Set;for(let c=0,h=i*e.width;c<e.width;c++,h++){const u=e.map[h];if(!l.has(u)){if(l.add(u),i>0&&u==e.map[h-e.width]){const d=r.nodeAt(u).attrs;t.setNodeMarkup(t.mapping.slice(a).map(u+n),null,{...d,rowspan:d.rowspan-1}),c+=d.colspan-1}else if(i<e.height&&u==e.map[h+e.width]){const d=r.nodeAt(u),f=d.attrs,p=d.type.create({...f,rowspan:d.attrs.rowspan-1},d.content),m=e.positionAt(i+1,c,r);t.insert(t.mapping.slice(a).map(n+m),p),c+=f.colspan-1}}}}function hye(t,e){if(!Ns(t))return!1;if(e){const r=Rc(t),n=t.tr;if(r.top==0&&r.bottom==r.map.height)return!1;for(let i=r.bottom-1;cye(n,r,i),i!=r.top;i--){const s=r.tableStart?n.doc.nodeAt(r.tableStart-1):n.doc;if(!s)throw RangeError("No table found");r.table=s,r.map=Jt.get(r.table)}e(n)}return!0}function uye(t,e){return function(r,n){if(!Ns(r))return!1;const i=Iw(r);if(i.nodeAfter.attrs[t]===e)return!1;if(n){const s=r.tr;r.selection instanceof cr?r.selection.forEachCell((o,a)=>{o.attrs[t]!==e&&s.setNodeMarkup(a,null,{...o.attrs,[t]:e})}):s.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[t]:e}),n(s)}return!0}}function dye(t){return function(e,r){if(!Ns(e))return!1;if(r){const n=Ds(e.schema),i=Rc(e),s=e.tr,o=i.map.cellsInRect(t=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:t=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),a=o.map(l=>i.table.nodeAt(l));for(let l=0;l<o.length;l++)a[l].type==n.header_cell&&s.setNodeMarkup(i.tableStart+o[l],n.cell,a[l].attrs);if(s.steps.length==0)for(let l=0;l<o.length;l++)s.setNodeMarkup(i.tableStart+o[l],n.header_cell,a[l].attrs);r(s)}return!0}}function kL(t,e,r){const n=e.map.cellsInRect({left:0,top:0,right:t=="row"?e.map.width:1,bottom:t=="column"?e.map.height:1});for(let i=0;i<n.length;i++){const s=e.table.nodeAt(n[i]);if(s&&s.type!==r.header_cell)return!1}return!0}function r9(t,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?dye(t):function(r,n){if(!Ns(r))return!1;if(n){const i=Ds(r.schema),s=Rc(r),o=r.tr,a=kL("row",s,i),l=kL("column",s,i),h=(t==="column"?a:t==="row"?l:!1)?1:0,u=t=="column"?{left:0,top:h,right:1,bottom:s.map.height}:t=="row"?{left:h,top:0,right:s.map.width,bottom:1}:s,d=t=="column"?l?i.cell:i.header_cell:t=="row"?a?i.cell:i.header_cell:i.cell;s.map.cellsInRect(u).forEach(f=>{const p=f+s.tableStart,m=o.doc.nodeAt(p);m&&o.setNodeMarkup(p,d,m.attrs)}),n(o)}return!0}}r9("row",{useDeprecatedLogic:!0});r9("column",{useDeprecatedLogic:!0});r9("cell",{useDeprecatedLogic:!0});function fye(t,e){if(e<0){const r=t.nodeBefore;if(r)return t.pos-r.nodeSize;for(let n=t.index(-1)-1,i=t.before();n>=0;n--){const s=t.node(-1).child(n),o=s.lastChild;if(o)return i-1-o.nodeSize;i-=s.nodeSize}}else{if(t.index()<t.parent.childCount-1)return t.pos+t.nodeAfter.nodeSize;const r=t.node(-1);for(let n=t.indexAfter(-1),i=t.after();n<r.childCount;n++){const s=r.child(n);if(s.childCount)return i+1;i+=s.nodeSize}}return null}function $H(t){return function(e,r){if(!Ns(e))return!1;const n=fye(Iw(e),t);if(n==null)return!1;if(r){const i=e.doc.resolve(n);r(e.tr.setSelection(Je.between(i,K1e(i))).scrollIntoView())}return!0}}function pye(t,e){const r=t.selection.$anchor;for(let n=r.depth;n>0;n--)if(r.node(n).type.spec.tableRole=="table")return e&&e(t.tr.delete(r.before(n),r.after(n)).scrollIntoView()),!0;return!1}function Fy(t,e){const r=t.selection;if(!(r instanceof cr))return!1;if(e){const n=t.tr,i=Ds(t.schema).cell.createAndFill().content;r.forEachCell((s,o)=>{s.content.eq(i)||n.replace(n.mapping.map(o+1),n.mapping.map(o+s.nodeSize-1),new Ie(i,0,0))}),n.docChanged&&e(n)}return!0}function mye(t){if(!t.size)return null;let{content:e,openStart:r,openEnd:n}=t;for(;e.childCount==1&&(r>0&&n>0||e.child(0).type.spec.tableRole=="table");)r--,n--,e=e.child(0).content;const i=e.child(0),s=i.type.spec.tableRole,o=i.type.schema,a=[];if(s=="row")for(let l=0;l<e.childCount;l++){let c=e.child(l).content;const h=l?0:Math.max(0,r-1),u=l<e.childCount-1?0:Math.max(0,n-1);(h||u)&&(c=sS(Ds(o).row,new Ie(c,h,u)).content),a.push(c)}else if(s=="cell"||s=="header_cell")a.push(r||n?sS(Ds(o).row,new Ie(e,r,n)).content:e);else return null;return gye(o,a)}function gye(t,e){const r=[];for(let i=0;i<e.length;i++){const s=e[i];for(let o=s.childCount-1;o>=0;o--){const{rowspan:a,colspan:l}=s.child(o).attrs;for(let c=i;c<i+a;c++)r[c]=(r[c]||0)+l}}let n=0;for(let i=0;i<r.length;i++)n=Math.max(n,r[i]);for(let i=0;i<r.length;i++)if(i>
107=e.length&&e.push(Se.empty),r[i]<n){const s=Ds(t).cell.createAndFill(),o=[];for(let a=r[i];a<n;a++)o.push(s);e[i]=e[i].append(Se.from(o))}return{height:e.length,width:n,rows:e}}function sS(t,e){const r=t.createAndFill();return new XN(r).replace(0,r.content.size,e).doc}function yye({width:t,height:e,rows:r},n,i){if(t!=n){const s=[],o=[];for(let a=0;a<r.length;a++){const l=r[a],c=[];for(let h=s[a]||0,u=0;h<n;u++){let d=l.child(u%l.childCount);h+d.attrs.colspan>n&&(d=d.type.createChecked(gu(d.attrs,d.attrs.colspan,h+d.attrs.colspan-n),d.content)),c.push(d),h+=d.attrs.colspan;for(let f=1;f<d.attrs.rowspan;f++)s[a+f]=(s[a+f]||0)+d.attrs.colspan}o.push(Se.from(c))}r=o,t=n}if(e!=i){const s=[];for(let o=0,a=0;o<i;o++,a++){const l=[],c=r[a%e];for(let h=0;h<c.childCount;h++){let u=c.child(h);o+u.attrs.rowspan>i&&(u=u.type.create({...u.attrs,rowspan:Math.max(1,i-u.attrs.rowspan)},u.content)),l.push(u)}s.push(Se.from(l))}r=s,e=i}return{width:t,height:e,rows:r}}function bye(t,e,r,n,i,s,o){const a=t.doc.type.schema,l=Ds(a);let c,h;if(i>e.width)for(let u=0,d=0;u<e.height;u++){const f=r.child(u);d+=f.nodeSize;const p=[];let m;f.lastChild==null||f.lastChild.type==l.cell?m=c||(c=l.cell.createAndFill()):m=h||(h=l.header_cell.createAndFill());for(let g=e.width;g<i;g++)p.push(m);t.insert(t.mapping.slice(o).map(d-1+n),p)}if(s>e.height){const u=[];for(let p=0,m=(e.height-1)*e.width;p<Math.max(e.width,i);p++){const g=p>=e.width?!1:r.nodeAt(e.map[m+p]).type==l.header_cell;u.push(g?h||(h=l.header_cell.createAndFill()):c||(c=l.cell.createAndFill()))}const d=l.row.create(null,Se.from(u)),f=[];for(let p=e.height;p<s;p++)f.push(d);t.insert(t.mapping.slice(o).map(n+r.nodeSize-2),f)}return!!(c||h)}function CL(t,e,r,n,i,s,o,a){if(o==0||o==e.height)return!1;let l=!1;for(let c=i;c<s;c++){const h=o*e.width+c,u=e.map[h];if(e.map[h-e.width]==u){l=!0;const d=r.nodeAt(u),{top:f,left:p}=e.findCell(u);t.setNodeMarkup(t.mapping.slice(a).map(u+n),null,{...d.attrs,rowspan:o-f}),t.insert(t.mapping.slice(a).map(e.positionAt(o,p,r)),d.type.createAndFill({...d.attrs,rowspan:f+d.attrs.rowspan-o})),c+=d.attrs.colspan-1}}return l}function SL(t,e,r,n,i,s,o,a){if(o==0||o==e.width)return!1;let l=!1;for(let c=i;c<s;c++){const h=c*e.width+o,u=e.map[h];if(e.map[h-1]==u){l=!0;const d=r.nodeAt(u),f=e.colCount(u),p=t.mapping.slice(a).map(u+n);t.setNodeMarkup(p,null,gu(d.attrs,o-f,d.attrs.colspan-(o-f))),t.insert(p+d.nodeSize,d.type.createAndFill(gu(d.attrs,0,o-f))),c+=d.attrs.rowspan-1}}return l}function TL(t,e,r,n,i){let s=r?t.doc.nodeAt(r-1):t.doc;if(!s)throw new Error("No table found");let o=Jt.get(s);const{top:a,left:l}=n,c=l+i.width,h=a+i.height,u=t.tr;let d=0;function f(){if(s=r?u.doc.nodeAt(r-1):u.doc,!s)throw new Error("No table found");o=Jt.get(s),d=u.mapping.maps.length}bye(u,o,s,r,c,h,d)&&f(),CL(u,o,s,r,l,c,a,d)&&f(),CL(u,o,s,r,l,c,h,d)&&f(),SL(u,o,s,r,a,h,l,d)&&f(),SL(u,o,s,r,a,h,c,d)&&f();for(let p=a;p<h;p++){const m=o.positionAt(p,l,s),g=o.positionAt(p,c,s);u.replace(u.mapping.slice(d).map(m+r),u.mapping.slice(d).map(g+r),new Ie(i.rows[p-a],0,0))}f(),u.setSelection(new cr(u.doc.resolve(r+o.positionAt(a,l,s)),u.doc.resolve(r+o.positionAt(h-1,c-1,s)))),e(u)}var xye=S7({ArrowLeft:$y("horiz",-1),ArrowRight:$y("horiz",1),ArrowUp:$y("vert",-1),ArrowDown:$y("vert",1),"Shift-ArrowLeft":zy("horiz",-1),"Shift-ArrowRight":zy("horiz",1),"Shift-ArrowUp":zy("vert",-1),"Shift-ArrowDown":zy("vert",1),Backspace:Fy,"Mod-Backspace":Fy,Delete:Fy,"Mod-Delete":Fy});function nb(t,e,r){return r.eq(t.selection)?!1:(e&&e(t.tr.setSelection(r).scrollIntoView()),!0)}function $y(t,e){return(r,n,i)=>{if(!i)return!1;const s=r.selection;if(s instanceof cr)return nb(r,n,gt.near(s.$headCell,e));if(t!="horiz"&&!s.empty)return!1;const o=zH(i,t,e);if(o==null)return!1;if(t=="horiz")return nb(r,n,gt.near(r.doc.resolve(s.head+e),e));{const a=r.doc.resolve(o),l=RH(a,t,e);let c;return l?c=gt.near(l,1):e<0?c=gt.near(r.doc.resolve(a.before(-1)),-1):c=gt.near(r.doc.resolve(a.after(-1)),1),nb(r,n,c)}}}function zy(t,e){return(r,n,i)=>{if(!i)return!1;const s=r.selection;let o;if(s instanceof cr)o=s;else{const l=zH(i,t,e);if(l==null)return!1;o=new cr(r.doc.resolve(l))}const a=RH(o.$headCell,t,e);
107return a?nb(r,n,new cr(o.$anchorCell,a)):!1}}function vye(t,e){const r=t.state.doc,n=P1(r.resolve(e));return n?(t.dispatch(t.state.tr.setSelection(new cr(n))),!0):!1}function wye(t,e,r){if(!Ns(t.state))return!1;let n=mye(r);const i=t.state.selection;if(i instanceof cr){n||(n={width:1,height:1,rows:[Se.from(sS(Ds(t.state.schema).cell,r))]});const s=i.$anchorCell.node(-1),o=i.$anchorCell.start(-1),a=Jt.get(s).rectBetween(i.$anchorCell.pos-o,i.$headCell.pos-o);return n=yye(n,a.right-a.left,a.bottom-a.top),TL(t.state,t.dispatch,o,a,n),!0}else if(n){const s=Iw(t.state),o=s.start(-1);return TL(t.state,t.dispatch,o,Jt.get(s.node(-1)).findCell(s.pos-o),n),!0}else return!1}function kye(t,e){var r;if(e.ctrlKey||e.metaKey)return;const n=_L(t,e.target);let i;if(e.shiftKey&&t.state.selection instanceof cr)s(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&n&&(i=P1(t.state.selection.$anchor))!=null&&((r=ek(t,e))==null?void 0:r.pos)!=i.pos)s(i,e),e.preventDefault();else if(!n)return;function s(l,c){let h=ek(t,c);const u=Ul.getState(t.state)==null;if(!h||!t9(l,h))if(u)h=l;else return;const d=new cr(l,h);if(u||!t.state.selection.eq(d)){const f=t.state.tr.setSelection(d);u&&f.setMeta(Ul,l.pos),t.dispatch(f)}}function o(){t.root.removeEventListener("mouseup",o),t.root.removeEventListener("dragstart",o),t.root.removeEventListener("mousemove",a),Ul.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(Ul,-1))}function a(l){const c=l,h=Ul.getState(t.state);let u;if(h!=null)u=t.state.doc.resolve(h);else if(_L(t,c.target)!=n&&(u=ek(t,e),!u))return o();u&&s(u,c)}t.root.addEventListener("mouseup",o),t.root.addEventListener("dragstart",o),t.root.addEventListener("mousemove",a)}function zH(t,e,r){if(!(t.state.selection instanceof Je))return null;const{$head:n}=t.state.selection;for(let i=n.depth-1;i>=0;i--){const s=n.node(i);if((r<0?n.index(i):n.indexAfter(i))!=(r<0?0:s.childCount))return null;if(s.type.spec.tableRole=="cell"||s.type.spec.tableRole=="header_cell"){const a=n.before(i),l=e=="vert"?r>0?"down":"up":r>0?"right":"left";return t.endOfTextblock(l)?a:null}}return null}function _L(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function ek(t,e){const r=t.posAtCoords({left:e.clientX,top:e.clientY});return r&&r?P1(t.state.doc.resolve(r.pos)):null}var Cye=class{constructor(t,e){this.node=t,this.defaultCellMinWidth=e,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${e}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),oS(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!=this.node.type?!1:(this.node=t,oS(t,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(t){return t.type=="attributes"&&(t.target==this.table||this.colgroup.contains(t.target))}};function oS(t,e,r,n,i,s){var o;let a=0,l=!0,c=e.firstChild;const h=t.firstChild;if(h){for(let u=0,d=0;u<h.childCount;u++){const{colspan:f,colwidth:p}=h.child(u).attrs;for(let m=0;m<f;m++,d++){const g=i==d?s:p&&p[m],y=g?g+"px":"";if(a+=g||n,g||(l=!1),c)c.style.width!=y&&(c.style.width=y),c=c.nextSibling;else{const b=document.createElement("col");b.style.width=y,e.appendChild(b)}}}for(;c;){const u=c.nextSibling;(o=c.parentNode)==null||o.removeChild(c),c=u}l?(r.style.width=a+"px",r.style.minWidth=""):(r.style.width="",r.style.minWidth=a+"px")}}var Qi=new Dr("tableColumnResizing");function Sye({handleWidth:t=5,cellMinWidth:e=25,defaultCellMinWidth:r=100,View:n=Cye,lastColumnResizable:i=!0}={}){const s=new _r({key:Qi,state:{init(o,a){var l,c;const h=(c=(l=s.spec)==null?void 0:l.props)==null?void 0:c.nodeViews,u=Ds(a.schema).table.name;return n&&h&&(h[u]=(d,f)=>new n(d,r,f)),new Tye(-1,!1)},apply(o,a){return a.apply(o)}},props:{attributes:o=>{const a=Qi.getState(o);return a&&a.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(o,a)=>{_ye(o,a,t,i)},mouseleave:o=>{Mye(o)},mousedown:(o,a)=>{Aye(o,a,e,r)}},decorations:o=>{const a=Qi.getState(o);if(a&&a.activeHandle>-1)return Iye(o,a.activeHandle)},nodeViews:{}}});return s}var Tye=class ib{constructor(e,r){this.activeHandle=e,this.dragging=r}apply(e){const r=this,n=e.getMeta(Qi);if(n&&n.setHandle!=null)return new ib(n.setHandle,!1);if(n&&n.setDragging!==void 0)return new ib(r.activeHandle,n.setDragging);if(r.activeHandle>-1&&e.docChanged){let i=e.mapping.map(r.activeHandle,-1);
107return iS(e.doc.resolve(i))||(i=-1),new ib(i,r.dragging)}return r}};function _ye(t,e,r,n){if(!t.editable)return;const i=Qi.getState(t.state);if(i&&!i.dragging){const s=Oye(e.target);let o=-1;if(s){const{left:a,right:l}=s.getBoundingClientRect();e.clientX-a<=r?o=ML(t,e,"left",r):l-e.clientX<=r&&(o=ML(t,e,"right",r))}if(o!=i.activeHandle){if(!n&&o!==-1){const a=t.state.doc.resolve(o),l=a.node(-1),c=Jt.get(l),h=a.start(-1);if(c.colCount(a.pos-h)+a.nodeAfter.attrs.colspan-1==c.width-1)return}HH(t,o)}}}function Mye(t){if(!t.editable)return;const e=Qi.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&HH(t,-1)}function Aye(t,e,r,n){var i;if(!t.editable)return!1;const s=(i=t.dom.ownerDocument.defaultView)!=null?i:window,o=Qi.getState(t.state);if(!o||o.activeHandle==-1||o.dragging)return!1;const a=t.state.doc.nodeAt(o.activeHandle),l=Eye(t,o.activeHandle,a.attrs);t.dispatch(t.state.tr.setMeta(Qi,{setDragging:{startX:e.clientX,startWidth:l}}));function c(u){s.removeEventListener("mouseup",c),s.removeEventListener("mousemove",h);const d=Qi.getState(t.state);d!=null&&d.dragging&&(Lye(t,d.activeHandle,AL(d.dragging,u,r)),t.dispatch(t.state.tr.setMeta(Qi,{setDragging:null})))}function h(u){if(!u.which)return c(u);const d=Qi.getState(t.state);if(d&&d.dragging){const f=AL(d.dragging,u,r);EL(t,d.activeHandle,f,n)}}return EL(t,o.activeHandle,l,n),s.addEventListener("mouseup",c),s.addEventListener("mousemove",h),e.preventDefault(),!0}function Eye(t,e,{colspan:r,colwidth:n}){const i=n&&n[n.length-1];if(i)return i;const s=t.domAtPos(e);let a=s.node.childNodes[s.offset].offsetWidth,l=r;if(n)for(let c=0;c<r;c++)n[c]&&(a-=n[c],l--);return a/l}function Oye(t){for(;t&&t.nodeName!="TD"&&t.nodeName!="TH";)t=t.classList&&t.classList.contains("ProseMirror")?null:t.parentNode;return t}function ML(t,e,r,n){const i=r=="right"?-n:n,s=t.posAtCoords({left:e.clientX+i,top:e.clientY});if(!s)return-1;const{pos:o}=s,a=P1(t.state.doc.resolve(o));if(!a)return-1;if(r=="right")return a.pos;const l=Jt.get(a.node(-1)),c=a.start(-1),h=l.map.indexOf(a.pos-c);return h%l.width==0?-1:c+l.map[h-1]}function AL(t,e,r){const n=e.clientX-t.startX;return Math.max(r,t.startWidth+n)}function HH(t,e){t.dispatch(t.state.tr.setMeta(Qi,{setHandle:e}))}function Lye(t,e,r){const n=t.state.doc.resolve(e),i=n.node(-1),s=Jt.get(i),o=n.start(-1),a=s.colCount(n.pos-o)+n.nodeAfter.attrs.colspan-1,l=t.state.tr;for(let c=0;c<s.height;c++){const h=c*s.width+a;if(c&&s.map[h]==s.map[h-s.width])continue;const u=s.map[h],d=i.nodeAt(u).attrs,f=d.colspan==1?0:a-s.colCount(u);if(d.colwidth&&d.colwidth[f]==r)continue;const p=d.colwidth?d.colwidth.slice():Dye(d.colspan);p[f]=r,l.setNodeMarkup(o+u,null,{...d,colwidth:p})}l.docChanged&&t.dispatch(l)}function EL(t,e,r,n){const i=t.state.doc.resolve(e),s=i.node(-1),o=i.start(-1),a=Jt.get(s).colCount(i.pos-o)+i.nodeAfter.attrs.colspan-1;let l=t.domAtPos(i.start(-1)).node;for(;l&&l.nodeName!="TABLE";)l=l.parentNode;l&&oS(s,l.firstChild,l,n,a,r)}function Dye(t){return Array(t).fill(0)}function Iye(t,e){var r;const n=[],i=t.doc.resolve(e),s=i.node(-1);if(!s)return or.empty;const o=Jt.get(s),a=i.start(-1),l=o.colCount(i.pos-a)+i.nodeAfter.attrs.colspan-1;for(let c=0;c<o.height;c++){const h=l+c*o.width;if((l==o.width-1||o.map[h]!=o.map[h+1])&&(c==0||o.map[h]!=o.map[h-o.width])){const u=o.map[h],d=a+u+s.nodeAt(u).nodeSize-1,f=document.createElement("div");f.className="column-resize-handle",(r=Qi.getState(t))!=null&&r.dragging&&n.push(Ur.node(a+u,a+u+s.nodeAt(u).nodeSize,{class:"column-resize-dragging"})),n.push(Ur.widget(d,f))}}return or.create(t.doc,n)}function Bye({allowTableNodeSelection:t=!1}={}){return new _r({key:Ul,state:{init(){return null},apply(e,r){const n=e.getMeta(Ul);if(n!=null)return n==-1?null:n;if(r==null||!e.docChanged)return r;const{deleted:i,pos:s}=e.mapping.mapResult(r);return i?null:s}},props:{decorations:Z1e,handleDOMEvents:{mousedown:kye},createSelectionBetween(e){return Ul.getState(e.state)!=null?e.state.selection:null},handleTripleClick:vye,handleKeyDown:xye,handlePaste:wye},appendTransaction(e,r,n){return tye(n,nye(n,r),t)}})}var Ax=typeof navigator<"u"?navigator:null,n9=Ax&&Ax.userAgent||"",Rye=/Edge\/(\d+)/.exec(n9),Pye=/MSIE \d/.exec(n9),Nye=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(n9),Fye=!!(Pye||Nye||Rye),$ye=!Fye&&!!Ax&&/Apple Computer/.test(Ax.vendor),qH=new Dr("safari-ime-span"),aS=!1,zye={key:qH,props:{decorations:Hye,handleDOMEvents:{compositionstart:()=>{aS=!0},compositionend:()=>{aS=!1}}}};function Hye(t){const{$from:e,$to:r,to:n}=t.selection;if(aS&&e.sameParent(r)){const i=Ur.widget(n,qye,{ignoreSelection:!0,key:"safari-ime-span"});return or.create(t.doc,[i])}}function qye(t){const e=t.dom.ownerDocument.createElement("span");return e.className="ProseMirror-safari-ime-span",e}var Vye=new _r($ye?zye:{key:qH});function OL(t,e){const r=String(t);if(typeof e!="string")throw new TypeError("Expected character");let n=0,i=r.indexOf(e);for(;i!==-1;)n++,i=r.indexOf(e,i+e.length);return n}function Wye(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function jye(t,e,r){const i=nw((r||{}).ignore||[]),s=Uye(e);let o=-1;for(;++o<s.length;)m7(t,"text",a);function a(c,h){let u=-1,d;for(;++u<h.length;){const f=h[u],p=d?d.children:void 0;if(i(f,p?p.indexOf(f):void 0,d))return;d=f}if(d)return l(c,h)}function l(c,h){const u=h[h.length-1],d=s[o][0],f=s[o][1];let p=0;const g=u.children.indexOf(c);let y=!1,b=[];d.lastIndex=0;let x=d.exec(c.value);for(;x;){const S=x.index,k={index:x.index,input:x.input,stack:[...h,c]};let w=f(...x,k);if(typeof w=="string"&&(w=w.length>0?{type:"text",value:w}:void 0),w===!1?d.lastIndex=S+1:(p!==S&&b.push({type:"text",value:c.value.slice(p,S)}),Array.isArray(w)?b.push(...w):w&&b.push(w),p=S+x[0].length,y=!0),!d.global)break;x=d.exec(c.value)}return y?(p<c.value.length&&b.push({type:"text",value:c.value.slice(p)}),u.children.splice(g,1,...b)):b=[c],g+b.length}}function Uye(t){const e=[];
vendor: 9,727 bytes, lines 107-111
107if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");const r=!t[0]||Array.isArray(t[0])?t:[t];let n=-1;for(;++n<r.length;){const i=r[n];e.push([Gye(i[0]),Kye(i[1])])}return e}function Gye(t){return typeof t=="string"?new RegExp(Wye(t),"g"):t}function Kye(t){return typeof t=="function"?t:function(){return t}}const tk="phrasing",rk=["autolink","link","image","label"];function Yye(){return{transforms:[r2e],enter:{literalAutolink:Jye,literalAutolinkEmail:nk,literalAutolinkHttp:nk,literalAutolinkWww:nk},exit:{literalAutolink:t2e,literalAutolinkEmail:e2e,literalAutolinkHttp:Zye,literalAutolinkWww:Qye}}}function Xye(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:tk,notInConstruct:rk},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:tk,notInConstruct:rk},{character:":",before:"[ps]",after:"\\/",inConstruct:tk,notInConstruct:rk}]}}function Jye(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function nk(t){this.config.enter.autolinkProtocol.call(this,t)}function Zye(t){this.config.exit.autolinkProtocol.call(this,t)}function Qye(t){this.config.exit.data.call(this,t);const e=this.stack[this.stack.length-1];e.type,e.url="http://"+this.sliceSerialize(t)}function e2e(t){this.config.exit.autolinkEmail.call(this,t)}function t2e(t){this.exit(t)}function r2e(t){jye(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,n2e],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),i2e]],{ignore:["link","linkReference"]})}function n2e(t,e,r,n,i){let s="";if(!VH(i)||(/^w/i.test(e)&&(r=e+r,e="",s="http://"),!s2e(r)))return!1;const o=o2e(r+n);if(!o[0])return!1;const a={type:"link",title:null,url:s+e+o[0],children:[{type:"text",value:e+o[0]}]};return o[1]?[a,{type:"text",value:o[1]}]:a}function i2e(t,e,r,n){return!VH(n,!0)||/[-\d_]$/.test(r)?!1:{type:"link",title:null,url:"mailto:"+e+"@"+r,children:[{type:"text",value:e+"@"+r}]}}function s2e(t){const e=t.split(".");return!(e.length<2||e[e.length-1]&&(/_/.test(e[e.length-1])||!/[a-zA-Z\d]/.test(e[e.length-1]))||e[e.length-2]&&(/_/.test(e[e.length-2])||!/[a-zA-Z\d]/.test(e[e.length-2])))}function o2e(t){const e=/[!"&'),.:;<>?\]}]+$/.exec(t);if(!e)return[t,void 0];t=t.slice(0,e.index);let r=e[0],n=r.indexOf(")");const i=OL(t,"(");let s=OL(t,")");for(;n!==-1&&i>s;)t+=r.slice(0,n+1),r=r.slice(n+1),n=r.indexOf(")"),s++;return[t,r]}function VH(t,e){const r=t.input.charCodeAt(t.index-1);return(t.index===0||cu(r)||tw(r))&&(!e||r!==47)}WH.peek=m2e;function a2e(){this.buffer()}function l2e(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function c2e(){this.buffer()}function h2e(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function u2e(t){const e=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=Qs(this.sliceSerialize(t)).toLowerCase(),r.label=e}function d2e(t){this.exit(t)}function f2e(t){const e=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=Qs(this.sliceSerialize(t)).toLowerCase(),r.label=e}function p2e(t){this.exit(t)}function m2e(){return"["}function WH(t,e,r,n){const i=r.createTracker(n);let s=i.move("[^");const o=r.enter("footnoteReference"),a=r.enter("reference");return s+=i.move(r.safe(r.associationId(t),{after:"]",before:s})),a(),o(),s+=i.move("]"),s}function g2e(){return{enter:{gfmFootnoteCallString:a2e,gfmFootnoteCall:l2e,gfmFootnoteDefinitionLabelString:c2e,gfmFootnoteDefinition:h2e},exit:{gfmFootnoteCallString:u2e,gfmFootnoteCall:d2e,gfmFootnoteDefinitionLabelString:f2e,gfmFootnoteDefinition:p2e}}}function y2e(t){let e=!1;return t&&t.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:r,footnoteReference:WH},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function r(n,i,s,o){const a=s.createTracker(o);let l=a.move("[^");const c=s.enter("footnoteDefinition"),h=s.enter("label");return l+=a.move(s.safe(s.associationId(n),{before:l,after:"]"})),h(),l+=a.move("]:"),n.children&&n.children.length>0&&(a.shift(4),l+=a.move((e?`
108`:" ")+s.indentLines(s.containerFlow(n,a.current()),e?jH:b2e))),c(),l}}function b2e(t,e,r){return e===0?t:jH(t,e,r)}function jH(t,e,r){return(r?"":"    ")+t}const x2e=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];UH.peek=S2e;function v2e(){return{canContainEols:["delete"],enter:{strikethrough:k2e},exit:{strikethrough:C2e}}}function w2e(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:x2e}],handlers:{delete:UH}}}function k2e(t){this.enter({type:"delete",children:[]},t)}function C2e(t){this.exit(t)}function UH(t,e,r,n){const i=r.createTracker(n),s=r.enter("strikethrough");let o=i.move("~~");return o+=r.containerPhrasing(t,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),s(),o}function S2e(){return"~"}function T2e(t){return t.length}function _2e(t,e){const r=e||{},n=(r.align||[]).concat(),i=r.stringLength||T2e,s=[],o=[],a=[],l=[];let c=0,h=-1;for(;++h<t.length;){const m=[],g=[];let y=-1;for(t[h].length>c&&(c=t[h].length);++y<t[h].length;){const b=M2e(t[h][y]);if(r.alignDelimiters!==!1){const x=i(b);g[y]=x,(l[y]===void 0||x>l[y])&&(l[y]=x)}m.push(b)}o[h]=m,a[h]=g}let u=-1;if(typeof n=="object"&&"length"in n)for(;++u<c;)s[u]=LL(n[u]);else{const m=LL(n);for(;++u<c;)s[u]=m}u=-1;const d=[],f=[];for(;++u<c;){const m=s[u];let g="",y="";m===99?(g=":",y=":"):m===108?g=":":m===114&&(y=":");let b=r.alignDelimiters===!1?1:Math.max(1,l[u]-g.length-y.length);const x=g+"-".repeat(b)+y;r.alignDelimiters!==!1&&(b=g.length+b+y.length,b>l[u]&&(l[u]=b),f[u]=b),d[u]=x}o.splice(1,0,d),a.splice(1,0,f),h=-1;const p=[];for(;++h<o.length;){const m=o[h],g=a[h];u=-1;const y=[];for(;++u<c;){const b=m[u]||"";let x="",S="";if(r.alignDelimiters!==!1){const k=l[u]-(g[u]||0),w=s[u];w===114?x=" ".repeat(k):w===99?k%2?(x=" ".repeat(k/2+.5),S=" ".repeat(k/2-.5)):(x=" ".repeat(k/2),S=x):S=" ".repeat(k)}r.delimiterStart!==!1&&!u&&y.push("|"),r.padding!==!1&&!(r.alignDelimiters===!1&&b==="")&&(r.delimiterStart!==!1||u)&&y.push(" "),r.alignDelimiters!==!1&&y.push(x),y.push(b),r.alignDelimiters!==!1&&y.push(S),r.padding!==!1&&y.push(" "),(r.delimiterEnd!==!1||u!==c-1)&&y.push("|")}p.push(r.delimiterEnd===!1?y.join("").replace(/ +$/,""):y.join(""))}return p.join(`
109`)}function M2e(t){return t==null?"":String(t)}function LL(t){const e=typeof t=="string"?t.codePointAt(0):0;return e===67||e===99?99:e===76||e===108?108:e===82||e===114?114:0}function A2e(){return{enter:{table:E2e,tableData:DL,tableHeader:DL,tableRow:L2e},exit:{codeText:D2e,table:O2e,tableData:ik,tableHeader:ik,tableRow:ik}}}function E2e(t){const e=t._align;this.enter({type:"table",align:e.map(function(r){return r==="none"?null:r}),children:[]},t),this.data.inTable=!0}function O2e(t){this.exit(t),this.data.inTable=void 0}function L2e(t){this.enter({type:"tableRow",children:[]},t)}function ik(t){this.exit(t)}function DL(t){this.enter({type:"tableCell",children:[]},t)}function D2e(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,I2e));const r=this.stack[this.stack.length-1];r.type,r.value=e,this.exit(t)}function I2e(t,e){return e==="|"?e:t}function B2e(t){const e=t||{},r=e.tableCellPadding,n=e.tablePipeAlign,i=e.stringLength,s=r?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
110`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[	 :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:d,table:o,tableCell:l,tableRow:a}};function o(f,p,m,g){return c(h(f,m,g),f.align)}function a(f,p,m,g){const y=u(f,m,g),b=c([y]);return b.slice(0,b.indexOf(`
111`))}function l(f,p,m,g){const y=m.enter("tableCell"),b=m.enter("phrasing"),x=m.containerPhrasing(f,{...g,before:s,after:s});return b(),y(),x}function c(f,p){return _2e(f,{align:p,alignDelimiters:n,padding:r,stringLength:i})}function h(f,p,m){const g=f.children;let y=-1;const b=[],x=p.enter("table");for(;++y<g.length;)b[y]=u(g[y],p,m);return x(),b}function u(f,p,m){const g=f.children;let y=-1;const b=[],x=p.enter("tableRow");for(;++y<g.length;)b[y]=l(g[y],f,p,m);return x(),b}function d(f,p,m){let g=y7.inlineCode(f,p,m);return m.stack.includes("tableCell")&&(g=g.replace(/\|/g,"\\$&")),g}}function R2e(){return{exit:{taskListCheckValueChecked:IL,taskListCheckValueUnchecked:IL,paragraph:N2e}}}function P2e(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:F2e}}}function IL(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function N2e(t){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const r=this.stack[this.stack.length-1];r.type;const n=r.children[0];if(n&&n.type==="text"){const i=e.children;let s=-1,o;for(;++s<i.length;){const a=i[s];if(a.type==="paragraph"){o=a;break}}o===r&&(n.value=n.value.slice(1),n.value.length===0?r.children.shift():r.position&&n.position&&typeof n.position.start.offset=="number"&&(n.position.start.column++,n.position.start.offset++,r.position.start=Object.assign({},n.position.start)))}}this.exit(t)}function F2e(t,e,r,n){const i=t.children[0],s=typeof t.checked=="boolean"&&i&&i.type==="paragraph",o="["+(t.checked?"x":" ")+"] ",a=r.createTracker(n);s&&a.move(o);let l=y7.listItem(t,e,r,{...n,...a.current()});return s&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),l;function c(h){return h+o}}function $2e(){return[Yye(),g2e(),v2e(),A2e(),R2e()]}function z2e(t){return{extensions:[Xye(),y2e(t),w2e(),B2e(t),P2e()]}}const H2e={tokenize:G2e,partial:!0},GH={tokenize:K2e,partial:!0},KH={tokenize:Y2e,partial:!0},YH={tokenize:X2e,partial:!0},q2e={tokenize:J2e,partial:!0}
vendor: 9,139 bytes, line 111
111,XH={name:"wwwAutolink",tokenize:j2e,previous:ZH},JH={name:"protocolAutolink",tokenize:U2e,previous:QH},vl={name:"emailAutolink",tokenize:W2e,previous:eq},ca={};function V2e(){return{text:ca}}let Uc=48;for(;Uc<123;)ca[Uc]=vl,Uc++,Uc===58?Uc=65:Uc===91&&(Uc=97);ca[43]=vl;ca[45]=vl;ca[46]=vl;ca[95]=vl;ca[72]=[vl,JH];ca[104]=[vl,JH];ca[87]=[vl,XH];ca[119]=[vl,XH];function W2e(t,e,r){const n=this;let i,s;return o;function o(u){return!lS(u)||!eq.call(n,n.previous)||i9(n.events)?r(u):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),a(u))}function a(u){return lS(u)?(t.consume(u),a):u===64?(t.consume(u),l):r(u)}function l(u){return u===46?t.check(q2e,h,c)(u):u===45||u===95||Ai(u)?(s=!0,t.consume(u),l):h(u)}function c(u){return t.consume(u),i=!0,l}function h(u){return s&&i&&ei(n.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(u)):r(u)}}function j2e(t,e,r){const n=this;return i;function i(o){return o!==87&&o!==119||!ZH.call(n,n.previous)||i9(n.events)?r(o):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(H2e,t.attempt(GH,t.attempt(KH,s),r),r)(o))}function s(o){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(o)}}function U2e(t,e,r){const n=this;let i="",s=!1;return o;function o(u){return(u===72||u===104)&&QH.call(n,n.previous)&&!i9(n.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),i+=String.fromCodePoint(u),t.consume(u),a):r(u)}function a(u){if(ei(u)&&i.length<5)return i+=String.fromCodePoint(u),t.consume(u),a;if(u===58){const d=i.toLowerCase();if(d==="http"||d==="https")return t.consume(u),l}return r(u)}function l(u){return u===47?(t.consume(u),s?c:(s=!0,l)):r(u)}function c(u){return u===null||ax(u)||lr(u)||cu(u)||tw(u)?r(u):t.attempt(GH,t.attempt(KH,h),r)(u)}function h(u){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(u)}}function G2e(t,e,r){let n=0;return i;function i(o){return(o===87||o===119)&&n<3?(n++,t.consume(o),i):o===46&&n===3?(t.consume(o),s):r(o)}function s(o){return o===null?r(o):e(o)}}function K2e(t,e,r){let n,i,s;return o;function o(c){return c===46||c===95?t.check(YH,l,a)(c):c===null||lr(c)||cu(c)||c!==45&&tw(c)?l(c):(s=!0,t.consume(c),o)}function a(c){return c===95?n=!0:(i=n,n=void 0),t.consume(c),o}function l(c){return i||n||!s?r(c):e(c)}}function Y2e(t,e){let r=0,n=0;return i;function i(o){return o===40?(r++,t.consume(o),i):o===41&&n<r?s(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?t.check(YH,e,s)(o):o===null||lr(o)||cu(o)?e(o):(t.consume(o),i)}function s(o){return o===41&&n++,t.consume(o),i}}function X2e(t,e,r){return n;function n(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(t.consume(a),n):a===38?(t.consume(a),s):a===93?(t.consume(a),i):a===60||a===null||lr(a)||cu(a)?e(a):r(a)}function i(a){return a===null||a===40||a===91||lr(a)||cu(a)?e(a):n(a)}function s(a){return ei(a)?o(a):r(a)}function o(a){return a===59?(t.consume(a),n):ei(a)?(t.consume(a),o):r(a)}}function J2e(t,e,r){return n;function n(s){return t.consume(s),i}function i(s){return Ai(s)?r(s):e(s)}}function ZH(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||lr(t)}function QH(t){return!ei(t)}function eq(t){return!(t===47||lS(t))}function lS(t){return t===43||t===45||t===46||t===95||Ai(t)}function i9(t){let e=t.length,r=!1;for(;e--;){const n=t[e][1];if((n.type==="labelLink"||n.type==="labelImage")&&!n._balanced){r=!0;break}if(n._gfmAutolinkLiteralWalkedInto){r=!1;break}}return t.length>0&&!r&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}const Z2e={tokenize:obe,partial:!0};function Q2e(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:nbe,continuation:{tokenize:ibe},exit:sbe}},text:{91:{name:"gfmFootnoteCall",tokenize:rbe},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:ebe,resolveTo:tbe}}}}function ebe(t,e,r){const n=this;let i=n.events.length;const s=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]);let o;for(;i--;){const l=n.events[i][1];if(l.type==="labelImage"){o=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return a;function a(l){if(!o||!o._balanced)return r(l);const c=Qs(n.sliceSerialize({start:o.end,end:n.now()}));return c.codePointAt(0)!==94||!s.includes(c.slice(1))?r(l):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(l),t.exit("gfmFootnoteCallLabelMarker"),e(l))}}function tbe(t,e){let r=t.length;for(;r--;)if(t[r][1].type==="labelImage"&&t[r][0]==="enter"){t[r][1];break}t[r+1][1].type="data",t[r+3][1].type="gfmFootnoteCallLabelMarker";const n={type:"gfmFootnoteCall",start:Object.assign({},t[r+3][1].start),end:Object.assign({},t[t.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},t[r+3][1].end),end:Object.assign({},t[r+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},t[t.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},a=[t[r+1],t[r+2],["enter",n,e],t[r+3],t[r+4],["enter",i,e],["exit",i,e],["enter",s,e],["enter",o,e],["exit",o,e],["exit",s,e],t[t.length-2],t[t.length-1],["exit",n,e]];return t.splice(r,t.length-r+1,...a),t}function rbe(t,e,r){const n=this,i=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]);let s=0,o;return a;function a(u){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(u),t.exit("gfmFootnoteCallLabelMarker"),l}function l(u){return u!==94?r(u):(t.enter("gfmFootnoteCallMarker"),t.consume(u),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",c)}function c(u){if(s>999||u===93&&!o||u===null||u===91||lr(u))return r(u);if(u===93){t.exit("chunkString");const d=t.exit("gfmFootnoteCallString");return i.includes(Qs(n.sliceSerialize(d)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(u),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):r(u)}return lr(u)||(o=!0),s++,t.consume(u),u===92?h:c}function h(u){return u===91||u===92||u===93?(t.consume(u),s++,c):c(u)}}function nbe(t,e,r){const n=this,i=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]);let s,o=0,a;return l;function l(p){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(p),t.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(p){return p===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(p),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",h):r(p)}function h(p){if(o>999||p===93&&!a||p===null||p===91||lr(p))return r(p);if(p===93){t.exit("chunkString");const m=t.exit("gfmFootnoteDefinitionLabelString");return s=Qs(n.sliceSerialize(m)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(p),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),d}return lr(p)||(a=!0),o++,t.consume(p),p===92?u:h}function u(p){return p===91||p===92||p===93?(t.consume(p),o++,h):h(p)}function d(p){return p===58?(t.enter("definitionMarker"),t.consume(p),t.exit("definitionMarker"),i.includes(s)||i.push(s),Ot(t,f,"gfmFootnoteDefinitionWhitespace")):r(p)}function f(p){return e(p)}}function ibe(t,e,r){return t.check(w1,e,t.attempt(Z2e,e,r))}function sbe(t){t.exit("gfmFootnoteDefinition")}function obe(t,e,r){const n=this;return Ot(t,i,"gfmFootnoteDefinitionIndent",5);function i(s){const o=n.events[n.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?e(s):r(s)}}function abe(t){let r=(t||{}).singleTilde;const n={name:"strikethrough",tokenize:s,resolveAll:i};return r==null&&(r=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function i(o,a){let l=-1;for(;++l<o.length;)if(o[l][0]==="enter"&&o[l][1].type==="strikethroughSequenceTemporary"&&o[l][1]._close){let c=l;for(;c--;)if(o[c][0]==="exit"&&o[c][1].type==="strikethroughSequenceTemporary"&&o[c][1]._open&&o[l][1].end.offset-o[l][1].start.offset===o[c][1].end.offset-o[c][1].start.offset){o[l][1].type="strikethroughSequence",o[c][1].type="strikethroughSequence";const h={type:"strikethrough",start:Object.assign({},o[c][1].start),end:Object.assign({},o[l][1].end)},u={type:"strikethroughText",start:Object.assign({},o[c][1].end),end:Object.assign({},o[l][1].start)},d=[["enter",h,a],["enter",o[c][1],a],["exit",o[c][1],a],["enter",u,a]],f=a.parser.constructs.insideSpan.null;f&&ns(d,d.length,0,rw(f,o.slice(c+1,l),a)),ns(d,d.length,0,[["exit",u,a],["enter",o[l][1],a],["exit",o[l][1],a],["exit",h,a]]),ns(o,c-1,l-c+3,d),l=c+d.length-2;break}}for(l=-1;++l<o.length;)o[l][1].type==="strikethroughSequenceTemporary"&&(o[l][1].type="data");return o}function s(o,a,l){const c=this.previous,h=this.events;let u=0;return d;function d(p){return c===126&&h[h.length-1][1].type!=="characterEscape"?l(p):(o.enter("strikethroughSequenceTemporary"),f(p))}function f(p){const m=Cf(c);if(p===126)return u>
vendor: 4,198 bytes, line 111
1111?l(p):(o.consume(p),u++,f);if(u<2&&!r)return l(p);const g=o.exit("strikethroughSequenceTemporary"),y=Cf(p);return g._open=!y||y===2&&!!m,g._close=!m||m===2&&!!y,a(p)}}}class lbe{constructor(){this.map=[]}add(e,r,n){cbe(this,e,r,n)}consume(e){if(this.map.sort(function(s,o){return s[0]-o[0]}),this.map.length===0)return;let r=this.map.length;const n=[];for(;r>0;)r-=1,n.push(e.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),e.length=this.map[r][0];n.push(e.slice()),e.length=0;let i=n.pop();for(;i;){for(const s of i)e.push(s);i=n.pop()}this.map.length=0}}function cbe(t,e,r,n){let i=0;if(!(r===0&&n.length===0)){for(;i<t.map.length;){if(t.map[i][0]===e){t.map[i][1]+=r,t.map[i][2].push(...n);return}i+=1}t.map.push([e,r,n])}}function hbe(t,e){let r=!1;const n=[];for(;e<t.length;){const i=t[e];if(r){if(i[0]==="enter")i[1].type==="tableContent"&&n.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){const s=n.length-1;n[s]=n[s]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(r=!0);e+=1}return n}function ube(){return{flow:{null:{name:"table",tokenize:dbe,resolveAll:fbe}}}}function dbe(t,e,r){const n=this;let i=0,s=0,o;return a;function a(E){let D=n.events.length-1;for(;D>-1;){const z=n.events[D][1].type;if(z==="lineEnding"||z==="linePrefix")D--;else break}const N=D>-1?n.events[D][1].type:null,K=N==="tableHead"||N==="tableRow"?w:l;return K===w&&n.parser.lazy[n.now().line]?r(E):K(E)}function l(E){return t.enter("tableHead"),t.enter("tableRow"),c(E)}function c(E){return E===124||(o=!0,s+=1),h(E)}function h(E){return E===null?r(E):Qe(E)?s>1?(s=0,n.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(E),t.exit("lineEnding"),f):r(E):It(E)?Ot(t,h,"whitespace")(E):(s+=1,o&&(o=!1,i+=1),E===124?(t.enter("tableCellDivider"),t.consume(E),t.exit("tableCellDivider"),o=!0,h):(t.enter("data"),u(E)))}function u(E){return E===null||E===124||lr(E)?(t.exit("data"),h(E)):(t.consume(E),E===92?d:u)}function d(E){return E===92||E===124?(t.consume(E),u):u(E)}function f(E){return n.interrupt=!1,n.parser.lazy[n.now().line]?r(E):(t.enter("tableDelimiterRow"),o=!1,It(E)?Ot(t,p,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(E):p(E))}function p(E){return E===45||E===58?g(E):E===124?(o=!0,t.enter("tableCellDivider"),t.consume(E),t.exit("tableCellDivider"),m):k(E)}function m(E){return It(E)?Ot(t,g,"whitespace")(E):g(E)}function g(E){return E===58?(s+=1,o=!0,t.enter("tableDelimiterMarker"),t.consume(E),t.exit("tableDelimiterMarker"),y):E===45?(s+=1,y(E)):E===null||Qe(E)?S(E):k(E)}function y(E){return E===45?(t.enter("tableDelimiterFiller"),b(E)):k(E)}function b(E){return E===45?(t.consume(E),b):E===58?(o=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(E),t.exit("tableDelimiterMarker"),x):(t.exit("tableDelimiterFiller"),x(E))}function x(E){return It(E)?Ot(t,S,"whitespace")(E):S(E)}function S(E){return E===124?p(E):E===null||Qe(E)?!o||i!==s?k(E):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(E)):k(E)}function k(E){return r(E)}function w(E){return t.enter("tableRow"),_(E)}function _(E){return E===124?(t.enter("tableCellDivider"),t.consume(E),t.exit("tableCellDivider"),_):E===null||Qe(E)?(t.exit("tableRow"),e(E)):It(E)?Ot(t,_,"whitespace")(E):(t.enter("data"),L(E))}function L(E){return E===null||E===124||lr(E)?(t.exit("data"),_(E)):(t.consume(E),E===92?B:L)}function B(E){return E===92||E===124?(t.consume(E),L):L(E)}}function fbe(t,e){let r=-1,n=!0,i=0,s=[0,0,0,0],o=[0,0,0,0],a=!1,l=0,c,h,u;const d=new lbe;for(;++r<t.length;){const f=t[r],p=f[1];f[0]==="enter"?p.type==="tableHead"?(a=!1,l!==0&&(BL(d,e,l,c,h),h=void 0,l=0),c={type:"table",start:Object.assign({},p.start),end:Object.assign({},p.end)},d.add(r,0,[["enter",c,e]])):p.type==="tableRow"||p.type==="tableDelimiterRow"?(n=!0,u=void 0,s=[0,0,0,0],o=[0,r+1,0,0],a&&(a=!1,h={type:"tableBody",start:Object.assign({},p.start),end:Object.assign({},p.end)},d.add(r,0,[["enter",h,e]])),i=p.type==="tableDelimiterRow"?2:h?3:1):i&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.t
111ype==="tableDelimiterFiller")?(n=!1,o[2]===0&&(s[1]!==0&&(o[0]=o[1],u=Hy(d,e,s,i,void 0,u),s=[0,0,0,0]),o[2]=r)):p.type==="tableCellDivider"&&(n?n=!1:(s[1]!==0&&(o[0]=o[1],u=Hy(d,e,s,i,void 0,u)),s=o,o=[s[1],r,0,0])):p.type==="tableHead"?(a=!0,l=r):p.type==="tableRow"||p.type==="tableDelimiterRow"?(l=r,s[1]!==0?(o[0]=o[1],u=Hy(d,e,s,i,r,u)):o[1]!==0&&(u=Hy(d,e,o,i,r,u)),i=0):i&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")&&(o[3]=r)}for(l!==0&&BL(d,e,l,c,h),d.consume(e.events),r=-1;++r<e.events.length;){const f=e.events[r];f[0]==="enter"&&f[1].type==="table"&&(f[1]._align=hbe(e.events,r))}return t}function Hy(t,e,r,n,i,s){const o=n===1?"tableHeader":n===2?"tableDelimiter":"tableData",a="tableContent";r[0]!==0&&(s.end=Object.assign({},td(e.events,r[0])),t.add(r[0],0,[["exit",s,e]]));const l=td(e.events,r[1]);if(s={type:o,start:Object.assign({},l),end:Object.assign({},l)},t.add(r[1],0,[["enter",s,e]]),r[2]!==0){const c=td(e.events,r[2]),h=td(e.events,r[3]),u={type:a,start:Object.assign({},c),end:Object.assign({},h)};if(t.add(r[2],0,[["enter",u,e]]),n!==2){const d=e.events[r[2]],f=e.events[r[3]];if(d[1].end=Object.assign({},f[1].end),d[1].type="chunkText",d[1].contentType="text",r[3]>r[2]+1){const p=r[2]+1,m=r[3]-r[2]-1;t.add(p,m,[])}}t.add(r[3]+1,0,[["exit",u,e]])}return i!==void 0&&(s.end=Object.assign({},td(e.events,i)),t.add(i,0,[["exit",s,e]]),s=void 0),s}function BL(t,e,r,n,i){const s=[],o=td(e.events,r);i&&(i.end=Object.assign({},o),s.push(["exit",i,e])),n.end=Object.assign({},o),s.push(["exit",n,e]),t.add(r+1,0,s)}function td(t,e){const r=t[e],n=r[0]==="enter"?"start":"end";return r[1][n]}const pbe={name:"tasklistCheck",tokenize:gbe};function mbe(){return{text:{91:pbe}}}function gbe(t,e,r){const n=this;return i;function i(l){return n.previous!==null||!n._gfmTasklistFirstContentOfListItem?r(l):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(l),t.exit("taskListCheckMarker"),s)}function s(l){return lr(l)?(t.enter("taskListCheckValueUnchecked"),t.consume(l),t.exit("taskListCheckValueUnchecked"),o):l===88||l===120?(t.enter("taskListCheckValueChecked"),t.consume(l),t.exit("taskListCheckValueChecked"),o):r(l)}function o(l){return l===93?(t.enter("taskListCheckMarker"),t.consume(l),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),a):r(l)}function a(l){return Qe(l)?e(l):It(l)?t.check({tokenize:ybe},e,r)(l):r(l)}}function ybe(t,e,r){return Ot(t,n,"whitespace");function n(i){return i===null?r(i):e(i)}}function bbe(t){return hF([V2e(),Q2e(),abe(t),ube(),mbe()])}const xbe={};function vbe(t){const e=this,r=t||xbe,n=e.data(),i=n.micromarkExtensions||(n.micromarkExtensions=[]),s=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),o=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);i.push(bbe(r)),s.push($2e()),o.push(z2e(r))}function bt(t,e){return Object.assign(t,{meta:{package:"@milkdown/preset-gfm",...e}}),t}const s9=M1("strike_through");bt(s9,{displayName:"Attr<strikethrough>",group:"Strikethrough"});const i0=Jf("strike_through",t=>({parseDOM:[{tag:"del"},{style:"text-decoration",getAttrs:e=>e==="line-through"}],toDOM:e=>["del",t.get(s9.key)(e)],parseMarkdown:{match:e=>e.type==="delete",runner:(e,r,n)=>{e.openMark(n),e.next(r.children),e.closeMark(n)}},toMarkdown:{match:e=>e.type.name==="strike_through",runner:(e,r)=>{e.withMark(r,"delete")}}}));bt(i0.mark,{displayName:"MarkSchema<strikethrough>",group:"Strikethrough"});bt(i0.ctx,{displayName:"MarkSchemaCtx<strikethrough>",group:"Strikethrough"});const Bw=yt("ToggleStrikeThrough",t=>()=>sw(i0.type(t)));bt(Bw,{displayName:"Command<ToggleStrikethrough>",group:"Strikethrough"});const tq=jn(t=>v1(new RegExp("(?<![\\w:/])(~{1,2})(.+?)\\1(?!\\w|\\/)"),i0.type(t)));bt(tq,{displayName:"InputRule<strikethrough>",group:"Strikethrough"});const o9=Fi("strikeThroughKeymap",{ToggleStrikethrough:{shortcuts:"Mod-Alt-x",command:t=>{const e=t.get(He);return()=>e.call(Bw.key)}}});bt(o9.ctx,{displayName:"KeymapCtx<strikethrough>",group:"Strikethrough"});bt(o9.shortcuts,{displayName:"Keymap<strikethrough>",group:"Strikethrough"});const N1=U1e({tableGroup:"block",cellContent:"paragraph",cellAttributes:{alignment:{default:"left",getFromDOM:t=>t.style.textAlign||"left",setDOMAttr:(t,e)=>{e.style=`text-align: ${t||"left"}`}}}}),Du=Hr("table",()=>({...N1.table,content:"table_header_row table_row+",disableDropCursor:!0,parseMarkdown:{match:t=>t.type==="table",runner:(t,e,r)=>{const n=e.align,i=e.children.map((s,o)=>({...s,align:n,isHeader:o===0}));t.openNode(r),t.next(i),t.closeNode()}},toMarkdown:{match:t=>t.type.name==="table",runner:(t,e)=>{var i;const r=(i=e.content.firstChild)==null?void 0:i.content;if(!r)return;const n=[];r.forEach(s=>
111{n.push(s.attrs.alignment)}),t.openNode("table",void 0,{align:n}),t.next(e.content),t.closeNode()}}}));bt(Du.node,{displayName:"NodeSchema<table>",group:"Table"});bt(Du.ctx,{displayName:"NodeSchemaCtx<table>",group:"Table"});const Rw=Hr("table_header_row",()=>({...N1.table_row,disableDropCursor:!0,content:"(table_header)*",parseDOM:[{tag:"tr[data-is-header]"}],toDOM(){return["tr",{"data-is-header":!0},0]},parseMarkdown:{match:t=>!!(t.type==="tableRow"&&t.isHeader),runner:(t,e,r)=>{const n=e.align,i=e.children.map((s,o)=>({...s,align:n[o],isHeader:e.isHeader}));t.openNode(r),t.next(i),t.closeNode()}},toMarkdown:{match:t=>t.type.name==="table_header_row",runner:(t,e)=>{t.openNode("tableRow",void 0,{isHeader:!0}),t.next(e.content),t.closeNode()}}}));bt(Rw.node,{displayName:"NodeSchema<tableHeaderRow>",group:"Table"});bt(Rw.ctx,{displayName:"NodeSchemaCtx<tableHeaderRow>",group:"Table"});const F1=Hr("table_row",()=>({...N1.table_row,disableDropCursor:!0,content:"(table_cell)*",parseMarkdown:{match:t=>t.type==="tableRow",runner:(t,e,r)=>{const n=e.align,i=e.children.map((s,o)=>({...s,align:n[o]}));t.openNode(r),t.next(i),t.closeNode()}},toMarkdown:{match:t=>t.type.name==="table_row",runner:(t,e)=>{e.content.size!==0&&(t.openNode("tableRow"),t.next(e.content),t.closeNode())}}}));bt(F1.node,{displayName:"NodeSchema<tableRow>",group:"Table"});bt(F1.ctx,{displayName:"NodeSchemaCtx<tableRow>",group:"Table"});const $1=Hr("table_cell",()=>({...N1.table_cell,disableDropCursor:!0,parseMarkdown:{match:t=>t.type==="tableCell"&&!t.isHeader,runner:(t,e,r)=>{const n=e.align;t.openNode(r,{alignment:n}).openNode(t.schema.nodes.paragraph).next(e.children).closeNode().closeNode()}},toMarkdown:{match:t=>t.type.name==="table_cell",runner:(t,e)=>{t.openNode("tableCell").next(e.content).closeNode()}}}));bt($1.node,{displayName:"NodeSchema<tableCell>",group:"Table"});bt($1.ctx,{displayName:"NodeSchemaCtx<tableCell>",group:"Table"});const Pw=Hr("table_header",()=>({...N1.table_header,disableDropCursor:!0,parseMarkdown:{match:t=>t.type==="tableCell"&&!!t.isHeader,runner:(t,e,r)=>{const n=e.align;t.openNode(r,{alignment:n}),t.openNode(t.schema.nodes.paragraph),t.next(e.children),t.closeNode(),t.closeNode()}},toMarkdown:{match:t=>t.type.name==="table_header",runner:(t,e)=>{t.openNode("tableCell"),t.next(e.content),t.closeNode()}}}));bt(Pw.node,{displayName:"NodeSchema<tableHeader>",group:"Table"});bt(Pw.ctx,{displayName:"NodeSchemaCtx<tableHeader>",group:"Table"});function a9(t,e=3,r=3){const n=Array(r).fill(0).map(()=>$1.type(t).createAndFill()),i=Array(r).fill(0).map(()=>Pw.type(t).createAndFill()),s=Array(e).fill(0).map((o,a)=>a===0?Rw.type(t).create(null,i):F1.type(t).create(null,n));return Du.type(t).create(null,s)}function s0(t){return h7(e=>e.type.spec.tableRole==="table")(t)}function rd(t,e){const r=s0(e.$from);if(!r)return;const n=Jt.get(r.node);return(Array.isArray(t)?t:[t]).filter(s=>s>=0&&s<=n.width-1).flatMap(s=>n.cellsInRect({left:s,right:s+1,top:0,bottom:n.height}).map(a=>{const l=r.node.nodeAt(a),c=a+r.start;return{pos:c,start:c+1,node:l,depth:r.depth+2}}))}function nd(t,e){const r=s0(e.$from);if(!r)return;const n=Jt.get(r.node);return(Array.isArray(t)?t:[t]).filter(s=>s>=0&&s<=n.height-1).flatMap(s=>n.cellsInRect({left:0,right:n.width,top:s,bottom:s+1}).map(a=>{const l=r.node.nodeAt(a),c=a+r.start;return{pos:c,start:c+1,node:l,depth:r.depth+2}}))}function rq(t){return(e,r)=>n=>{r=r??n.selection.from;const i=n.doc.resolve(r),s=h7(l=>l.type.name==="table")(i),o=s?{node:s.node,from:s.start}:void 0,a=t==="row";if(o){const l=Jt.get(o.node);if(e>=0&&e<(a?l.height:l.width)){const c=l.positionAt(a?e:l.height-1,a?l.width-1:e,o.node),h=n.doc.resolve(o.from+c),u=a?cr.rowSelection:cr.colSelection,d=l.positionAt(a?e:0,a?0:e,o.node),f=n.doc.resolve(o.from+d);return oF(n.setSelection(u(h,f)))}}return n}}const wbe=rq("row"),kbe=rq("col");function nq(t,e,{map:r,tableStart:n,table:i},s){const o=Array(s).fill(0).reduce((l,c,h)=>l+i.child(h).nodeSize,n),a=Array(r.width).fill(0).map((l,c)=>{const h=i.nodeAt(r.map[c]);return $1.type(t).createAndFill({alignment:h==null?void 0:h.attrs.al
111ignment})});return e.insert(o,F1.type(t).create(null,a)),e}function iq(t,e){const r=[],n=Jt.get(t);for(let s=0;s<n.height;s++){const o=t.child(s),a=[];for(let l=0;l<n.width;l++){if(!e[s][l])continue;const c=n.map[s*n.width+l],h=e[s][l],d=t.nodeAt(c).type.createChecked(Object.assign({},h.attrs),h.content,h.marks);a.push(d)}r.push(o.type.createChecked(o.attrs,a,o.marks))}return t.type.createChecked(t.attrs,r,t.marks)}function sq(t){const e=Jt.get(t),r=[],n=e.height,i=e.width;for(let s=0;s<n;s++){const o=[];for(let a=0;a<i;a++){let l=s*i+a,c=e.map[l];if(s>0){const h=l-i,u=e.map[h];if(c===u){o.push(null);continue}}if(a>0){const h=l-1,u=e.map[h];if(c===u){o.push(null);continue}}c?o.push(t.nodeAt(c)):o.push(null)}r.push(o)}return r}function RL(t,e,r=e){let n=e,i=r;for(let u=e;u>=0;u--){const d=nd(u,t.selection);d&&d.forEach(f=>{const p=f.node.attrs.rowspan+u-1;p>=n&&(n=u),p>i&&(i=p)})}for(let u=e;u<=i;u++){const d=nd(u,t.selection);d&&d.forEach(f=>{const p=f.node.attrs.rowspan+u-1;f.node.attrs.rowspan>1&&p>i&&(i=p)})}const s=[];for(let u=n;u<=i;u++){const d=nd(u,t.selection);d&&d.length>0&&s.push(u)}n=s[0],i=s[s.length-1];const o=nd(n,t.selection),a=rd(0,t.selection);if(!o||!a)return;const l=t.doc.resolve(o[o.length-1].pos);let c;for(let u=i;u>=n;u--){const d=nd(u,t.selection);if(d&&d.length>0){for(let f=a.length-1;f>=0;f--)if(a[f].pos===d[0].pos){c=d[0];break}if(c)break}}if(!c)return;const h=t.doc.resolve(c.pos);return{$anchor:l,$head:h,indexes:s}}function oq(t,e,r,n){const i=e[0]>r[0]?-1:1,s=t.splice(e[0],e.length),o=s.length%2===0?1:0;let a;return a=i===-1?r[0]:r[r.length-1]-o,t.splice(a,0,...s),t}function Cbe(t){var b,x;const{tr:e,origin:r,target:n,select:i,pos:s}=t,o=e.doc.resolve(s),a=s0(o);if(!a)return!1;const l=(b=RL(e,r))==null?void 0:b.indexes,c=(x=RL(e,n))==null?void 0:x.indexes;if(!l||!c||l.includes(n))return!1;const h=Sbe(a.node,l,c);if(e.replaceWith(a.pos,a.pos+a.node.nodeSize,h),!i)return!0;const u=Jt.get(h),d=a.start,f=n,p=u.positionAt(f,u.width-1,h),m=e.doc.resolve(d+p),g=u.positionAt(f,0,h),y=e.doc.resolve(d+g);return e.setSelection(cr.rowSelection(m,y)),!0}function Sbe(t,e,r,n){let i=sq(t);return i=oq(i,e,r),iq(t,i)}function PL(t,e,r=e){let n=e,i=r;for(let u=e;u>=0;u--){const d=rd(u,t.selection);d&&d.forEach(f=>{const p=f.node.attrs.colspan+u-1;p>=n&&(n=u),p>i&&(i=p)})}for(let u=e;u<=i;u++){const d=rd(u,t.selection);d&&d.forEach(f=>{const p=f.node.attrs.colspan+u-1;f.node.attrs.colspan>1&&p>i&&(i=p)})}const s=[];for(let u=n;u<=i;u++){const d=rd(u,t.selection);d&&d.length>0&&s.push(u)}n=s[0],i=s[s.length-1];const o=rd(n,t.selection),a=nd(0,t.selection);if(!o||!a)return;const l=t.doc.resolve(o[o.length-1].pos);let c;for(let u=i;u>=n;u--){const d=rd(u,t.selection);if(d&&d.length>0){for(let f=a.length-1;f>=0;f--)if(a[f].pos===d[0].pos){c=d[0];break}if(c)break}}if(!c)return;const h=t.doc.resolve(c.pos);return{$anchor:l,$head:h,indexes:s}}function NL(t){return t[0].map((e,r)=>t.map(n=>n[r]))}function Tbe(t){var b,x;const{tr:e,origin:r,target:n,select:i,pos:s}=t,o=e.doc.resolve(s),a=s0(o);if(!a)return!1;const l=(b=PL(e,r))==null?void 0:b.indexes,c=(x=PL(e,n))==null?void 0:x.indexes;if(!l||!c||l.includes(n))return!1;const h=_be(a.node,l,c);if(e.replaceWith(a.pos,a.pos+a.node.nodeSize,h),!i)return!0;const u=Jt.get(h),d=a.start,f=n,p=u.positionAt(u.height-1,f,h),m=e.doc.resolve(d+p),g=u.positionAt(0,f,h),y=e.doc.resolve(d+g);return e.setSelection(cr.colSelection(m,y)),!0}function _be(t,e,r,n){let i=NL(sq(t));return i=oq(i,e,r),i=NL(i),iq(t,i)}function Mbe(t){const e=s0(t.$from);if(!e)return;const r=Jt.get(e.node);return r.cellsInRect({left:0,right:r.width,top:0,bottom:r.height}).map(i=>{const s=e.node.nodeAt(i),o=i+e.start;return{pos:o,start:o+1,node:s}})}function Abe(t){const e=Mbe(t.selection);if(e&&e[0]){const r=t.doc.resolve(e[0].pos),n=e[e.length-1];if(n){const i=t.doc.resolve(n.pos);return oF(t.setSelection(new cr(i,r)))}}return t}const l9=yt("GoToPrevTableCell",()=>()=>$H(-1));bt(l9,{displayName:"Command<goToPrevTableCellCommand>",group:"Table"});const c9=yt("GoToNextTableCell",()=>()=>$H(1));bt(c9,{displayName:"Command<goToNextTableCellCommand>",group:"Table"});const h9=yt("ExitTable",t=>()=>(e,r)=>{if(!Ns(e))return!1;const{$head:n}=e.selection,i=hle(n,Du.type(t));if(!i)return!1;const{to:s}=i,o=e.tr.replaceWith(s,s,la.type(t).createAndFill());return o.setSelection(gt.near(o.doc.resolve(s),1)).scrollIntoView(),r==null||r(o),!0});bt(h9,{displayName:"Command<breakTableCommand>",group:"Table"});const aq=yt("InsertTable",t=>({row:e,col:r}={})=>(n,i)=>{const{selection:s,tr:o}=n,{from:a}=s,l=a9(t,e,r),c=o.replaceSelectionWith(l),h=gt.findFrom(c.doc.resolve(a),1,!0);return h&&c.setSelection(h),i==null||i(c),!0});bt(aq,{displayName:"Command<insertTableCommand>",group:"Table"});const u9=yt("MoveRow",()=>({from:t,to:e,pos:r}={})=>(n,i)=>{const{tr:s}=n;return Cbe({tr:s,origin:t??0,target:e??0,pos:r??n.selection.from,select:!0})?(i==null||i(s),!0):!1});bt(u9,{displayName:"Command<moveRowCommand>",group:"Table"});const d9=yt("MoveCol",()=>({from:t,to:e,pos:r}={})=>(n,i)=>{const{tr:s}=n;return Tbe({tr:s,origin:t??0,target:e??0,pos:r??n.selection.from,select:!0})?(i==null||i(s),!0):!1});bt(d9,{displayName:"Command<moveColCommand>",group:"Table"});const yh=yt("SelectRow",()=>(t={index:0})=>(e,r)=>{const{tr:n}=e;return!!(r==null?void 0:r(wbe(t.index,t.pos)(n)))});bt(yh,{displayName:"Command<selectRowCommand>",group:"Table"});const bh=yt("SelectCol",()=>(t={index:0})=>(e,r)=>{const{tr:n}=e;return!!(r==null?void 0:r(kbe(t.index,t.pos)(n)))});bt(bh,{displayName:"Command<selectColCommand>",group:"Table"});const lq=yt("SelectTable",()=>()=>(t,e)=>{const{tr:r}=t;return!!(e==null?void 0:e(Abe(r)))});bt(lq,{displayName:"Command<selectTableCommand>",group:"Table"});const f9=yt("DeleteSelectedCells",()=>()=>(t,e)=>{const{selection:r}=t;if(!(r instanceof cr))return!1;const n=r.isRowSelection(),i=r.isColSelection();return n&&i?pye(t,e):i?lye(t,e):hye(t,e)});bt(f9,{displayName:"Command<deleteSelectedCellsCommand>",group:"Table"});const p9=yt("AddColBefore",()=>()=>sye);bt(p9,{displayName:"Command<addColBeforeCommand>",group:"Table"});const m9=yt("AddColAfter",()=>()=>oye);bt(m9,{displayName:"Command<addColAfterCommand>",group:"Table"});const g9=yt("AddRowBefore",t=>()=>(e,r)=>{if(!Ns(e))return!1;if(r){const n=Rc(e);r(nq(t,e.tr,n,n.top))}return!0});bt(g9,{displayName:"Command<addRowBeforeCommand>",group:"Table"});const y9=yt("AddRowAfter",t=>()=>(e,r)=>{if(!Ns(e))return!1;if(r){const n=Rc(e);r(nq(t,e.tr,n,n.bottom))}return!0});bt(y9,{displayName:"Command<addRowAfterCommand>",group:"Table"});const b9=yt("SetAlign",()=>(t="left")=>uye("alignment",t));bt(b9,{displayName:"Command<setAlignCommand>",group:"Table"});const cq=jn(t=>new Ri(/^\|(?<col>\d+)[xX](?<row>\d+)\|\s$/,(e,r,n,i)=>{var c,h;const s=e.doc.resolve(n);if(!s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),Du.type(t)))return null;const o=Math.max(Number(((c=r.groups)==null?void 0:c.row)??0),2),a=a9(t,o,Number((h=r.groups)==null?void 0:h.col)),l=e.tr.replaceRangeWith(n,i,a);return l.setSelection(Je.create(l.doc,n+3)).scrollIntoView()}));bt(cq,{displayName:"InputRule<insertTableInputRule>",group:"Table"});const x9=Fi("tableKeymap",{NextCell:{priority:100,shortcuts:["Mod-]","Tab"],command:t=>{const e=t.get(He);return()=>e.call(c9.key)}},PrevCell:{shortcuts:["Mod-[","Shift-Tab"],command:t=>{const e=t.get(He);return()=>e.call(l9.key)}},ExitTable:{shortcuts:["Mod-Enter","Enter"],command:t=>{const e=t.get(He);return()=>e.call(h9.key)}}});bt(x9.ctx,{displayName:"KeymapCtx<table>",group:"Table"});bt(x9.shortcuts,{displayName:"Keymap<table>",group:"Table"});const sk="footnote_definition",FL="footnoteDefinition",v9=Hr("footnote_definition",()=>({group:"block",content:"block+",defining:!0,attrs:{label:{default:"",validate:"string"}},parseDOM:[{tag:`dl[data-type="${sk}"]`,getAttrs:t=>{if(!(t instanceof HTMLElement))throw mo(t);return{label:t.dataset.label}},contentElement:"dd"}],toDOM:t=>{const e=t.attrs.label;return["dl",{"data-label":e,"data-type":sk},["dt",e],["dd",0]]},parseMarkdown:{match:({type:t})=>t===FL,runner:(t,e,r)=>{t.openNode(r,{label:e.label}).next(e.children).closeNode()}},toMarkdown:{match:t=>t.type.name===sk,runner:(t,e)=>{t.openNode(FL,void 0,{label:e.attrs.label,identifier:e.attrs.label}).next(e.content).closeNode()}}}));bt(v9.ctx,{displayName:"NodeSchemaCtx<footnodeDef>",group:"footnote"});bt(v9.node,{displayName:"NodeSchema<footnodeDef>",group:"footnote"});const ok="footnote_reference",w9=Hr("footnote_reference",()=>({group:"inline",inline:!0,atom:!0,attrs:{label:{default:"",validate:"string"}},parseDOM:[{tag:`sup[data-type="${ok}"]`,getAttrs:t=>{if(!(t instanceof HTMLElement))throw mo(t);return{label:t.dataset.label}}}],toDOM:t=>{const e=t.attrs.label;return["sup",{"data-label":e,"data-type":ok},e]},parseMarkdown:{match:({type:t})=>t==="footnoteReference",runner:(t,e,r)=>{t.addNode(r,{label:e.label})}},toMarkdown:{match:t=>t.type.name===ok,runner:(t,e)=>{t.addNode("footnoteReference",void 0,void 0,{label:e.attrs.label,identifier:e.attrs.label})}}}));bt(w9.ctx,{displayName:"NodeSchemaCtx<footnodeRef>",group:"footnote"});bt(w9.node,{displayName:"NodeSchema<footnodeRef>",group:"footnote"});const k9=yo.extendSchema(t=>e=>{const r=t(e);return{...r,attrs:{...r.attrs,checked:{default:null,validate:"boolean|null"}},parseDOM:[{tag:'li[data-item-type="task"]',getAttrs:n=>{if(!(n instanceof HTMLElement))throw mo(n);return{label:n.dataset.label,listType:n.dataset.listType,spread:n.dataset.spread,checked:n.dataset.checked?n.dataset.checked==="true":null}}},...(r==null?void 0:r.parseDOM)||[]],toDOM:n=>r.toDOM&&n.attrs.checked==null?r.toDOM(n):["li",{"data-item-type":"task","data-label":n.attrs.label,"data-list-type":n.attrs.listType,"data-spread":n.attrs.spread,"data-checked":n.attrs.checked},0],parseMarkdown:{match:({type:n})=>n==="listItem",runner:(n,i,s)=>{if(i.checked==null){r.parseMarkdown.runner(n,i,s);return}const o=i.label!=null?`${i.label}.`:"•",a=i.checked!=null?!!i.checked:null,l=i.label!=null?"ordered":"bullet",c=i.spread!=null?`${i.spread}`:"true";n.openNode(s,{label:o,listType:l,spread:c,checked:a}),n.next(i.children),n.closeNode()}},toMarkdown:{match:n=>n.type.name==="list_item",runner:(n,i)=>{if(i.attrs.checked==null){r.toMarkdown.runner(n,i);return}const s=i.attrs.label,o=i.attrs.listType,a=i.attrs.spread==="true",l=i.attrs.checked;n.openNode("listItem",void 0,{label:s,listType:o,spread:a,checked:l}),n.next(i.content),n.closeNode()}}}});bt(k9.node,{displayName:"NodeSchema<taskListItem>",group:"ListItem"});bt(k9.ctx,{displayName:"NodeSchemaCtx<taskListItem>",group:"ListItem"});const hq=jn(()=>new Ri(/^\[(?<checked>\s|x)\]\s$/,(t,e,r,n)=>{var h;const i=t.doc.resolve(r);let s=0,o=i.node(s);for(;o&&o.type.name!=="list_item";)s--,o=i.node(s);if(!o||o.attrs.checked!=null)return null;const a=((h=e.groups)==null?void 0:h.checked)==="x",l=i.before(s),c=t.tr;return c.deleteRange(r,n).setNodeMarkup(l,void 0,{...o.attrs,checked:a}),c}));bt(hq,{displayName:"InputRule<wrapInTaskListInputRule>",group:"ListItem"});const Ebe=[o9,x9].flat(),Obe=[cq,hq],Lbe=[tq],uq=nn(()=>Vye);bt(uq,{displayName:"Prose<autoInsertSpanPlugin>",group:"Prose"});const Dbe=nn(()=>Sye({}));bt(Dbe,{displayName:"Prose<columnResizingPlugin>",group:"Prose"});const dq=nn(()=>Bye({allowTableNodeSelection:!0}
vendor: 18,500 bytes, line 111
111));bt(dq,{displayName:"Prose<tableEditingPlugin>",group:"Prose"});const C9=aa("remarkGFM",()=>vbe);bt(C9.plugin,{displayName:"Remark<remarkGFMPlugin>",group:"Remark"});bt(C9.options,{displayName:"RemarkConfig<remarkGFMPlugin>",group:"Remark"});const Ibe=new Dr("MILKDOWN_KEEP_TABLE_ALIGN_PLUGIN");function Bbe(t,e){let r=0;return e.forEach((n,i,s)=>{n===t&&(r=s)}),r}const fq=nn(()=>new _r({key:Ibe,appendTransaction:(t,e,r)=>{let n;const i=(s,o)=>{if(n||(n=r.tr),s.type.name!=="table_cell")return;const a=r.doc.resolve(o),l=a.node(a.depth),h=a.node(a.depth-1).firstChild;if(!h)return;const u=Bbe(s,l),d=h.maybeChild(u);if(!d)return;const f=d.attrs.alignment,p=s.attrs.alignment;f!==p&&n.setNodeMarkup(o,void 0,{...s.attrs,alignment:f})};return e.doc!==r.doc&&r.doc.descendants(i),n}}));bt(fq,{displayName:"Prose<keepTableAlignPlugin>",group:"Prose"});const Rbe=[fq,uq,C9,dq].flat(),Pbe=[k9,Du,Rw,F1,Pw,$1,v9,w9,s9,i0].flat(),Nbe=[c9,l9,h9,aq,u9,d9,yh,bh,lq,f9,g9,y9,p9,m9,b9,Bw],Fbe=[Pbe,Obe,Lbe,Ebe,Nbe,Rbe].flat(),$be=t=>{let{state:e}=t,r=e.doc.lineAt(e.selection.main.from),n=T9(t.state,r.from);return n.line?zbe(t):n.block?qbe(t):!1};function S9(t,e){return({state:r,dispatch:n})=>{if(r.readOnly)return!1;let i=t(e,r);return i?(n(r.update(i)),!0):!1}}const zbe=S9(jbe,0),Hbe=S9(pq,0),qbe=S9((t,e)=>pq(t,e,Wbe(e)),0);function T9(t,e){let r=t.languageDataAt("commentTokens",e,1);return r.length?r[0]:{}}const G0=50;function Vbe(t,{open:e,close:r},n,i){let s=t.sliceDoc(n-G0,n),o=t.sliceDoc(i,i+G0),a=/\s*$/.exec(s)[0].length,l=/^\s*/.exec(o)[0].length,c=s.length-a;if(s.slice(c-e.length,c)==e&&o.slice(l,l+r.length)==r)return{open:{pos:n-a,margin:a&&1},close:{pos:i+l,margin:l&&1}};let h,u;i-n<=2*G0?h=u=t.sliceDoc(n,i):(h=t.sliceDoc(n,n+G0),u=t.sliceDoc(i-G0,i));let d=/^\s*/.exec(h)[0].length,f=/\s*$/.exec(u)[0].length,p=u.length-f-r.length;return h.slice(d,d+e.length)==e&&u.slice(p,p+r.length)==r?{open:{pos:n+d+e.length,margin:/\s/.test(h.charAt(d+e.length))?1:0},close:{pos:i-f-r.length,margin:/\s/.test(u.charAt(p-1))?1:0}}:null}function Wbe(t){let e=[];for(let r of t.selection.ranges){let n=t.doc.lineAt(r.from),i=r.to<=n.to?n:t.doc.lineAt(r.to);i.from>n.from&&i.from==r.to&&(i=r.to==n.to+1?n:t.doc.lineAt(r.to-1));let s=e.length-1;s>=0&&e[s].to>n.from?e[s].to=i.to:e.push({from:n.from+/^\s*/.exec(n.text)[0].length,to:i.to})}return e}function pq(t,e,r=e.selection.ranges){let n=r.map(s=>T9(e,s.from).block);if(!n.every(s=>s))return null;let i=r.map((s,o)=>Vbe(e,n[o],s.from,s.to));if(t!=2&&!i.every(s=>s))return{changes:e.changes(r.map((s,o)=>i[o]?[]:[{from:s.from,insert:n[o].open+" "},{from:s.to,insert:" "+n[o].close}]))};if(t!=1&&i.some(s=>s)){let s=[];for(let o=0,a;o<i.length;o++)if(a=i[o]){let l=n[o],{open:c,close:h}=a;s.push({from:c.pos-l.open.length,to:c.pos+c.margin},{from:h.pos-h.margin,to:h.pos+l.close.length})}return{changes:s}}return null}function jbe(t,e,r=e.selection.ranges){let n=[],i=-1;for(let{from:s,to:o}of r){let a=n.length,l=1e9,c=T9(e,s).line;if(c){for(let h=s;h<=o;){let u=e.doc.lineAt(h);if(u.from>i&&(s==o||o>u.from)){i=u.from;let d=/^\s*/.exec(u.text)[0].length,f=d==u.length,p=u.text.slice(d,d+c.length)==c?d:-1;d<u.text.length&&d<l&&(l=d),n.push({line:u,comment:p,token:c,indent:d,empty:f,single:!1})}h=u.to+1}if(l<1e9)for(let h=a;h<n.length;h++)n[h].indent<n[h].line.text.length&&(n[h].indent=l);n.length==a+1&&(n[a].single=!0)}}if(t!=2&&n.some(s=>s.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:a,token:l,indent:c,empty:h,single:u}of n)(u||!h)&&s.push({from:a.from+c,insert:l+" "});let o=e.changes(s);return{changes:o,selection:e.selection.map(o,1)}}else if(t!=1&&n.some(s=>s.comment>=0)){let s=[];for(let{line:o,comment:a,token:l}of n)if(a>=0){let c=o.from+a,h=c+l.length;o.text[h-o.from]==" "&&h++,s.push({from:c,to:h})}return{changes:s}}return null}const cS=ml.define(),Ube=ml.define(),Gbe=Ne.define(),mq=Ne.define({combine(t){return oa(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,r)=>r},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,r)=>(n,i)=>e(n,i)||r(n,i)})}}),gq=fn.define({create(){return Am.empty},update(t,e){let r=e.state.facet(mq),n=e.annotation(cS);if(n){let l=Ei.fromTransaction(e,n.selection),c=n.side,h=c==0?t.undone:t.done;return l?h=Ex(h,h.length,r.minDepth,l):h=xq(h,e.startState.selection),new Am(c==0?n.rest:h,c==0?h:n.rest)}let i=e.annotation(Ube);if((i=="full"||i=="before")&&(t=t.isolate()),e.annotation(oi.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let s=Ei.fromTransaction(e),o=e.annotation(oi.time),a=e.annotation(oi.userEvent);return s?t=t.addChanges(s,o,a,r,e):e.selection&&(t=t.addSelection(e.startState.selection,o,a,r.newGroupDelay)),(i=="full"||i=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new Am(t.done.map(Ei.fromJSON),t.undone.map(Ei.fromJSON))}});function Kbe(t={}){return[gq,mq.of(t),ze.domEventHandlers({beforeinput(e,r){let n=e.inputType=="historyUndo"?yq:e.inputType=="historyRedo"?hS:null;return n?(e.preventDefault(),n(r)):!1}})]}function Nw(t,e){return function({state:r,dispatch:n}){if(!e&&r.readOnly)return!1;let i=r.field(gq,!1);if(!i)return!1;let s=i.pop(t,r,e);return s?(n(s),!0):!1}}const yq=Nw(0,!1),hS=Nw(1,!1),Ybe=Nw(0,!0),Xbe=Nw(1,!0);class Ei{constructor(e,r,n,i,s){this.changes=e,this.effects=r,this.mapped=n,this.startSelection=i,this.selectionsAfter=s}setSelAfter(e){return new Ei(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,r,n;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(r=this.mapped)===null||r===void 0?void 0:r.toJSON(),startSelection:(n=this.startSelection)===null||n===void 0?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(e){return new Ei(e.changes&&Zr.fromJSON(e.changes),[],e.mapped&&Go.fromJSON(e.mapped),e.startSelection&&ce.fromJSON(e.startSelection),e.selectionsAfter.map(ce.fromJSON))}static fromTransaction(e,r){let n=Cs;for(let i of e.startState.facet(Gbe)){let s=i(e);s.length&&(n=n.concat(s))}return!n.length&&e.changes.empty?null:new Ei(e.changes.invert(e.startState.doc),n,void 0,r||e.startState.selection,Cs)}static selection(e){return new Ei(void 0,Cs,void 0,void 0,e)}}function Ex(t,e,r,n){let i=e+1>r+20?e-r-1:0,s=t.slice(i,e);return s.push(n),s}function Jbe(t,e){let r=[],n=!1;return t.iterChangedRanges((i,s)=>r.push(i,s)),e.iterChangedRanges((i,s,o,a)=>{for(let l=0;l<r.length;){let c=r[l++],h=r[l++];a>=c&&o<=h&&(n=!0)}}),n}function Zbe(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((r,n)=>r.empty!=e.ranges[n].empty).length===0}function bq(t,e){return t.length?e.length?t.concat(e):t:e}const Cs=[],Qbe=200;function xq(t,e){if(t.length){let r=t[t.length-1],n=r.selectionsAfter.slice(Math.max(0,r.selectionsAfter.length-Qbe));return n.length&&n[n.length-1].eq(e)?t:(n.push(e),Ex(t,t.length-1,1e9,r.setSelAfter(n)))}else return[Ei.selection([e])]}function exe(t){let e=t[t.length-1],r=t.slice();return r[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),r}function ak(t,e){if(!t.length)return t;let r=t.length,n=Cs;for(;r;){let i=txe(t[r-1],e,n);if(i.changes&&!i.changes.empty||i.effects.length){let s=t.slice(0,r);return s[r-1]=i,s}else e=i.mapped,r--,n=i.selectionsAfter}return n.length?[Ei.selection(n)]:Cs}function txe(t,e,r){let n=bq(t.selectionsAfter.length?t.selectionsAfter.map(a=>a.map(e)):Cs,r);if(!t.changes)return Ei.selection(n);let i=t.changes.map(e),s=e.mapDesc(t.changes,!0),o=t.mapped?t.mapped.composeDesc(s):s;return new Ei(i,kt.mapEffects(t.effects,e),o,t.startSelection.map(s),n)}const rxe=/^(input\.type|delete)($|\.)/;let Am=class Cp{constructor(e,r,n=0,i=void 0){this.done=e,this.undone=r,this.prevTime=n,this.prevUserEvent=i}isolate(){return this.prevTime?new Cp(this.done,this.undone):this}addChanges(e,r,n,i,s){let o=this.done,a=o[o.length-1];return a&&a.changes&&!a.changes.empty&&e.changes&&(!n||rxe.test(n))&&(!a.selectionsAfter.length&&r-this.prevTime<i.newGroupDelay&&i.joinToEvent(s,Jbe(a.changes,e.changes))||n=="input.type.compose")?o=Ex(o,o.length-1,i.minDepth,new Ei(e.changes.compose(a.changes),bq(kt.mapEffects(e.effects,a.changes),a.effects),a.mapped,a.startSelection,Cs)):o=Ex(o,o.length,i.minDepth,e),new Cp(o,Cs,r,n)}addSelection(e,r,n,i){let s=this.done.length?this.done[this.done.length-1].selectionsAfter:Cs;return s.length>0&&r-this.prevTime<i&&n==this.prevUserEvent&&n&&/^select($|\.)/.test(n)&&Zbe(s[s.length-1],e)?this:new Cp(xq(this.done,e),this.undone,r,n)}addMapping(e){return new Cp(ak(this.done,e),ak(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,r,n){let i=e==0?this.done:this.undone;if(i.length==0)return null;let s=i[i.length-1],o=s.selectionsAfter[0]||r.selection;if(n&&s.selectionsAfter.length)return r.update({selection:s.selectionsAfter[s.selectionsAfter.length-1],annotations:cS.of({side:e,rest:exe(i),selection:o}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(s.changes){let a=i.length==1?Cs:i.slice(0,i.length-1);return s.mapped&&(a=ak(a,s.mapped)),r.update({changes:s.changes,selection:s.startSelection,effects:s.effects,annotations:cS.of({side:e,rest:a,selection:o}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}};Am.empty=new Am(Cs,Cs);const nxe=[{key:"Mod-z",run:yq,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:hS,preventDefault:!0},{linux:"Ctrl-Shift-z",run:hS,preventDefault:!0},{key:"Mod-u",run:Ybe,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:Xbe,preventDefault:!0}];function o0(t,e){return ce.create(t.ranges.map(e),t.mainIndex)}function ha(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function xo({state:t,dispatch:e},r){let n=o0(t.selection,r);return n.eq(t.selection,!0)?!1:(e(ha(t,n)),!0)}function Fw(t,e){return ce.cursor(e?t.to:t.from)}function vq(t,e){return xo(t,r=>r.empty?t.moveByChar(r,e):Fw(r,e))}function Un(t){return t.textDirectionAt(t.state.selection.main.head)==vr.LTR}const wq=t=>vq(t,!Un(t)),kq=t=>vq(t,Un(t));function Cq(t,e){return xo(t,r=>r.empty?t.moveByGroup(r,e):Fw(r,e))}const ixe=t=>Cq(t,!Un(t)),sxe=t=>Cq(t,Un(t));function oxe(t,e,r){if(e.type.prop(r))return!0;let n=e.to-e.from;return n&&(n>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function $w(t,e,r){let n=_n(t).resolveInner(e.head),i=r?Lt.closedBy:Lt.openedBy;for(let l=e.head;;){let c=r?n.childAfter(l):n.childBefore(l);if(!c)break;oxe(t,c,i)?n=c:l=r?c.to:c.from}let s=n.type.prop(i),o,a;return s&&(o=r?qo(t,n.from,1):qo(t,n.to,-1))&&o.matched?a=r?o.end.to:o.end.from:a=r?n.to:n.from,ce.cursor(a,r?-1:1)}const axe=t=>xo(t,e=>$w(t.state,e,!Un(t))),lxe=t=>xo(t,e=>$w(t.state,e,Un(t)));function Sq(t,e){return xo(t,r=>{if(!r.empty)return Fw(r,e);let n=t.moveVertically(r,e);return n.head!=r.head?n:t.moveToLineBoundary(r,e)})}const Tq=t=>Sq(t,!1),_q=t=>Sq(t,!0);function Mq(t){let e=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,r=0,n=0,i;if(e){for(let s of t.state.facet(ze.scrollMargins)){let o=s(t);o!=null&&o.top&&(r=Math.max(o==null?void 0:o.top,r)),o!=null&&o.bottom&&(n=Math.max(o==null?void 0:o.bottom,n))}i=t.scrollDOM.clientHeight-r-n}else i=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:r,marginBottom:n,selfScroll:e,height:Math.max(t.defaultLineHeight,i-5)}}function Aq(t,e){let r=Mq(t),{state:n}=t,i=o0(n.selection,o=>o.empty?t.moveVertically(o,e,r.height):Fw(o,e));if(i.eq(n.selection))return!1;let s;if(r.selfScroll){let o=t.coordsAtPos(n.selection.main.head),a=t.scrollDOM.getBoundingClientRect(),l=a.top+r.marginTop,c=a.bottom-r.marginBottom;o&&o.top>l&&o.bottom<c&&(s=ze.scrollIntoView(i.main.head,{y:"start",yMargin:o.top-l}))}return t.dispatch(ha(n,i),{effects:s}),!0}const $L=t=>Aq(t,!1),uS=t=>Aq(t,!0);function Pc(t,e,r){let n=t.lineBlockAt(e.head),i=t.moveToLineBoundary(e,r);if(i.head==e.head&&i.head!=(r?n.to:n.from)&&(i=t.moveToLineBoundary(e,r,!1)),!r&&i.head==n.from&&n.length){let s=/^\s*/.exec(t.state.sliceDoc(n.from,Math.min(n.from+100,n.to)))[0].length;s&&e.head!=n.from+s&&(i=ce.cursor(n.from+s))}return i}const cxe=t=>xo(t,e=>Pc(t,e,!0)),hxe=t=>xo(t,e=>Pc(t,e,!1)),uxe=t=>xo(t,e=>Pc(t,e,!Un(t))),dxe=t=>xo(t,e=>Pc(t,e,Un(t))),fxe=t=>xo(t,e=>ce.cursor(t.lineBlockAt(e.head).from,1)),pxe=t=>xo(t,e=>ce.cursor(t.lineBlockAt(e.head).to,-1));function mxe(t,e,r){let n=!1,i=o0(t.selection,s=>{let o=qo(t,s.head,-1)||qo(t,s.head,1)||s.head>0&&qo(t,s.head-1,1)||s.head<t.doc.length&&qo(t,s.head+1,-1);if(!o||!o.end)return s;n=!0;let a=o.start.from==s.head?o.end.to:o.end.from;return ce.cursor(a)});return n?(e(ha(t,i)),!0):!1}const gxe=({state:t,dispatch:e})=>mxe(t,e);function Fs(t,e){let r=o0(t.state.selection,n=>{let i=e(n);return ce.range(n.anchor,i.head,i.goalColumn,i.bidiLevel||void 0)});return r.eq(t.state.selection)?!1:(t.dispatch(ha(t.state,r)),!0)}function Eq(t,e){return Fs(t,r=>t.moveByChar(r,e))}const Oq=t=>Eq(t,!Un(t)),Lq=t=>Eq(t,Un(t));function Dq(t,e){return Fs(t,r=>t.moveByGroup(r,e))}const yxe=t=>Dq(t,!Un(t)),bxe=t=>Dq(t,Un(t)),xxe=t=>Fs(t,e=>$w(t.state,e,!Un(t))),vxe=t=>Fs(t,e=>$w(t.state,e,Un(t)));function Iq(t,e){return Fs(t,r=>t.moveVertically(r,e))}const Bq=t=>Iq(t,!1),Rq=t=>Iq(t,!0);function Pq(t,e){return Fs(t,r=>t.moveVertically(r,e,Mq(t).height))}const zL=t=>Pq(t,!1),HL=t=>Pq(t,!0),wxe=t=>Fs(t,e=>Pc(t,e,!0)),kxe=t=>Fs(t,e=>Pc(t,e,!1)),Cxe=t=>Fs(t,e=>Pc(t,e,!Un(t))),Sxe=t=>Fs(t,e=>Pc(t,e,Un(t))),Txe=t=>Fs(t,e=>ce.cursor(t.lineBlockAt(e.head).from)),_xe=t=>Fs(t,e=>ce.cursor(t.lineBlockAt(e.head).to)),qL=({state:t,dispatch:e})=>(e(ha(t,{anchor:0})),!0),VL=({state:t,dispatch:e})=>(e(ha(t,{anchor:t.doc.length})),!0),WL=({state:t,dispatch:e})=>(e(ha(t,{anchor:t.selection.main.anchor,head:0})),!0),jL=({state:t,dispatch:e})=>(e(ha(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),Mxe=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),Axe=({state:t,dispatch:e})=>{let r=zw(t).map(({from:n,to:i})=>ce.range(n,Math.min(i+1,t.doc.length)));return e(t.update({selection:ce.create(r),userEvent:"select"})),!0},Exe=({state:t,dispatch:e})=>{let r=o0(t.selection,n=>{let i=_n(t),s=i.resolveStack(n.from,1);if(n.empty){let o=i.resolveStack(n.from,-1);o.node.from>=s.node.from&&o.node.to<=s.node.to&&(s=o)}for(let o=s;o;o=o.next){let{node:a}=o;if((a.from<n.from&&a.to>=n.to||a.to>n.to&&a.from<=n.from)&&o.next)return ce.range(a.to,a.from)}return n});return r.eq(t.selection)?!1:(e(ha(t,r)),!0)},Oxe=({state:t,dispatch:e})=>{let r=t.selection,n=null;return r.ranges.length>1?n=ce.create([r.main]):r.main.empty||(n=ce.create([ce.cursor(r.main.head)])),n?(e(ha(t,n)),!0):!1};function z1(t,e){if(t.state.readOnly)return!1;let r="delete.selection",{state:n}=t,i=n.changeByRange(s=>{let{from:o,to:a}=s;if(o==a){let l=e(s);l<o?(r="delete.backward",l=qy(t,l,!1)):l>o&&(r="delete.forward",l=qy(t,l,!0)),o=Math.min(o,l),a=Math.max(a,l)}else o=qy(t,o,!1),a=qy(t,a,!0);return o==a?{range:s}:{changes:{from:o,to:a},range:ce.cursor(o,o<s.head?-1:1)}});return i.changes.empty?!1:(t.dispatch(n.update(i,{scrollIntoView:!0,userEvent:r,effects:r=="delete.selection"?ze.announce.of(n.phrase("Selection deleted")):void 0})),!0)}function qy(t,e,r){if(t instanceof ze)for(let n of t.state.facet(ze.atomicRanges).map(i=>i(t)))n.between(e,e,(i,s)=>{i<e&&s>e&&(e=r?s:i)});return e}const Nq=(t,e,r)=>z1(t,n=>{let i=n.from,{state:s}=t,o=s.doc.lineAt(i),a,l;if(r&&!e&&i>o.from&&i<o.from+200&&!/[^ \t]/.test(a=o.text.slice(0,i-o.from))){if(a[a.length-1]=="	")return i-1;let c=Kf(a,s.tabSize),h=c%iu(s)||iu(s);for(let u=0;u<h&&a[a.length-1-u]==" ";u++)i--;l=i}else l=Tn(o.text,i-o.from,e,e)+o.from,l==i&&o.number!=(e?s.doc.lines:1)?l+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(o.text.slice(l-o.from,i-o.from))&&(l=Tn(o.text,l-o.from,!1,!1)+o.from);return l}),dS=t=>Nq(t,!1,!0),Fq=t=>Nq(t,!0,!1),$q=(t,e)=>z1(t,r=>{let n=r.head,{state:i}=t,s=i.doc.lineAt(n),o=i.charCategorizer(n);for(let a=null;;){if(n==(e?s.to:s.from)){n==r.head&&s.number!=(e?i.doc.lines:1)&&(n+=e?1:-1);break}let l=Tn(s.text,n-s.from,e)+s.from,c=s.text.slice(Math.min(n,l)-s.from,Math.max(n,l)-s.from),h=o(c);if(a!=null&&h!=a)break;(c!=" "||n!=r.head)&&(a=h),n=l}return n}),zq=t=>$q(t,!1),Lxe=t=>$q(t,!0),Dxe=t=>z1(t,e=>{let r=t.lineBlockAt(e.head).to;return e.head<r?r:Math.min(t.state.doc.length,e.head+1)}),Ixe=t=>z1(t,e=>{let r=t.moveToLineBoundary(e,!1).head;return e.head>r?r:Math.max(0,e.head-1)}),Bxe=t=>z1(t,e=>{let r=t.moveToLineBoundary(e,!0).head;return e.head<r?r:Math.min(t.state.doc.length,e.head+1)}),Rxe=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let r=t.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:Wt.of(["",""])},range:ce.cursor(n.from)}));return e(t.update(r,{scrollIntoView:!0,userEvent:"input"})),!0},Pxe=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let r=t.changeByRange(n=>{if(!n.empty||n.from==0||n.from==t.doc.length)return{range:n};let i=n.from,s=t.doc.lineAt(i),o=i==s.from?i-1:Tn(s.text,i-s.from,!1)+s.from,a=i==s.to?i+1:Tn(s.text,i-s.from,!0)+s.from;return{changes:{from:o,to:a,insert:t.doc.slice(i,a).append(t.doc.slice(o,i))},range:ce.cursor(a)}});return r.changes.empty?!1:(e(t.update(r,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function zw(t){let e=[],r=-1;for(let n of t.selection.ranges){let i=t.doc.lineAt(n.from),s=t.doc.lineAt(n.to);if(!n.empty&&n.to==s.from&&(s=t.doc.lineAt(n.to-1)),r>=i.number){let o=e[e.length-1];o.to=s.to,o.ranges.push(n)}else e.push({from:i.from,to:s.to,ranges:[n]});r=s.number+1}return e}function Hq(t,e,r){if(t.readOnly)return!1;let n=[],i=[];for(let s of zw(t)){if(r?s.to==t.doc.length:s.from==0)continue;let o=t.doc.lineAt(r?s.to+1:s.from-1),a=o.length+1;if(r){n.push({from:s.to,to:o.to},{from:s.from,insert:o.text+t.lineBreak});for(let l of s.ranges)i.push(ce.range(Math.min(t.doc.length,l.anchor+a),Math.min(t.doc.length,l.head+a)))}else{n.push({from:o.from,to:s.from},{from:s.to,insert:t.lineBreak+o.text});for(let l of s.ranges)i.push(ce.range(l.anchor-a,l.head-a))}}return n.length?(e(t.update({changes:n,scrollIntoView:!0,selection:ce.create(i,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const Nxe=({state:t,dispatch:e})=>Hq(t,e,!1),Fxe=({state:t,dispatch:e})=>Hq(t,e,!0);function qq(t,e,r){if(t.readOnly)return!1;let n=[];for(let i of zw(t))r?n.push({from:i.from,insert:t.doc.slice(i.from,i.to)+t.lineBreak}):n.push({from:i.to,insert:t.lineBreak+t.doc.slice(i.from,i.to)});return e(t.update({changes:n,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const $xe=({state:t,dispatch:e})=>
111qq(t,e,!1),zxe=({state:t,dispatch:e})=>qq(t,e,!0),Hxe=t=>{if(t.state.readOnly)return!1;let{state:e}=t,r=e.changes(zw(e).map(({from:i,to:s})=>(i>0?i--:s<e.doc.length&&s++,{from:i,to:s}))),n=o0(e.selection,i=>{let s;if(t.lineWrapping){let o=t.lineBlockAt(i.head),a=t.coordsAtPos(i.head,i.assoc||1);a&&(s=o.bottom+t.documentTop-a.bottom+t.defaultLineHeight/2)}return t.moveVertically(i,!0,s)}).map(r);return t.dispatch({changes:r,selection:n,scrollIntoView:!0,userEvent:"delete.line"}),!0};function qxe(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let r=_n(t).resolveInner(e),n=r.childBefore(e),i=r.childAfter(e),s;return n&&i&&n.to<=e&&i.from>=e&&(s=n.type.prop(Lt.closedBy))&&s.indexOf(i.name)>-1&&t.doc.lineAt(n.to).from==t.doc.lineAt(i.from).from&&!/\S/.test(t.sliceDoc(n.to,i.from))?{from:n.to,to:i.from}:null}const UL=Vq(!1),Vxe=Vq(!0);function Vq(t){return({state:e,dispatch:r})=>{if(e.readOnly)return!1;let n=e.changeByRange(i=>{let{from:s,to:o}=i,a=e.doc.lineAt(s),l=!t&&s==o&&qxe(e,s);t&&(s=o=(o<=a.to?a:e.doc.lineAt(o)).to);let c=new Wv(e,{simulateBreak:s,simulateDoubleBreak:!!l}),h=Q6(c,s);for(h==null&&(h=Kf(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));o<a.to&&/\s/.test(a.text[o-a.from]);)o++;l?{from:s,to:o}=l:s>a.from&&s<a.from+100&&!/\S/.test(a.text.slice(0,s))&&(s=a.from);let u=["",eg(e,h)];return l&&u.push(eg(e,c.lineIndent(a.from,-1))),{changes:{from:s,to:o,insert:Wt.of(u)},range:ce.cursor(s+1+u[1].length)}});return r(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0}}function _9(t,e){let r=-1;return t.changeByRange(n=>{let i=[];for(let o=n.from;o<=n.to;){let a=t.doc.lineAt(o);a.number>r&&(n.empty||n.to>a.from)&&(e(a,i,n),r=a.number),o=a.to+1}let s=t.changes(i);return{changes:i,range:ce.range(s.mapPos(n.anchor,1),s.mapPos(n.head,1))}})}const Wxe=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let r=Object.create(null),n=new Wv(t,{overrideIndentation:s=>{let o=r[s];return o??-1}}),i=_9(t,(s,o,a)=>{let l=Q6(n,s.from);if(l==null)return;/\S/.test(s.text)||(l=0);let c=/^\s*/.exec(s.text)[0],h=eg(t,l);(c!=h||a.from<s.from+c.length)&&(r[s.from]=l,o.push({from:s.from,to:s.from+c.length,insert:h}))});return i.changes.empty||e(t.update(i,{userEvent:"indent"})),!0},Wq=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(_9(t,(r,n)=>{n.push({from:r.from,insert:t.facet(Vv)})}),{userEvent:"input.indent"})),!0),jq=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(_9(t,(r,n)=>{let i=/^\s*/.exec(r.text)[0];if(!i)return;let s=Kf(i,t.tabSize),o=0,a=eg(t,Math.max(0,s-iu(t)));for(;o<i.length&&o<a.length&&i.charCodeAt(o)==a.charCodeAt(o);)o++;n.push({from:r.from+o,to:r.from+i.length,insert:a.slice(o)})}),{userEvent:"delete.dedent"})),!0),jxe=t=>(t.setTabFocusMode(),!0),Uxe=[{key:"Ctrl-b",run:wq,shift:Oq,preventDefault:!0},{key:"Ctrl-f",run:kq,shift:Lq},{key:"Ctrl-p",run:Tq,shift:Bq},{key:"Ctrl-n",run:_q,shift:Rq},{key:"Ctrl-a",run:fxe,shift:Txe},{key:"Ctrl-e",run:pxe,shift:_xe},{key:"Ctrl-d",run:Fq},{key:"Ctrl-h",run:dS},{key:"Ctrl-k",run:Dxe},{key:"Ctrl-Alt-h",run:zq},{key:"Ctrl-o",run:Rxe},{key:"Ctrl-t",run:Pxe},{key:"Ctrl-v",run:uS}],Gxe=[{key:"ArrowLeft",run:wq,shift:Oq,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:ixe,shift:yxe,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:uxe,shift:Cxe,preventDefault:!0},{key:"ArrowRight",run:kq,shift:Lq,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:sxe,shift:bxe,preventDefault:!0},{mac:"Cmd-ArrowRight",run:dxe,shift:Sxe,preventDefault:!0},{key:"ArrowUp",run:Tq,shift:Bq,preventDefault:!0},{mac:"Cmd-ArrowUp",run:qL,shift:WL},{mac:"Ctrl-ArrowUp",run:$L,shift:zL},{key:"ArrowDown",run:_q,shift:Rq,preventDefault:!0},{mac:"Cmd-ArrowDown",run:VL,shift:jL},{mac:"Ctrl-ArrowDown",run:uS,shift:HL},{key:"PageUp",run:$L,shift:zL},{key:"PageDown",run:uS,shift:HL},{key:"Home",run:hxe,shift:kxe,preventDefault:!0},{key:"Mod-Home",run:qL,shift:WL},{key:"End",run:cxe,shift:wxe,preventDefault:!0},{key:"Mod-End",run:VL,shift:jL},{key:"Enter",run:UL,shift:UL},{key:"Mod-a",run:Mxe},{key:"Backspace",run:dS,shift:dS},{key:"Delete",run:Fq},{key:"Mod-Backspace",mac:"Alt-Backspace",run:zq},{key:"Mod-Delete",mac:"Alt-Delete",run:Lxe},{mac:"Mod-Backspace",run:Ixe},{mac:"Mod-Delete",run:Bxe}].concat(Uxe.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),Uq=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:axe,shift:xxe},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:lxe,shift:vxe},{key:"Alt-ArrowUp",run:Nxe},{key:"Shift-Alt-ArrowUp",run:$xe},{key:"Alt-ArrowDown",run:Fxe},{key:"Shift-Alt-ArrowDown",run:zxe},{key:"Escape",run:Oxe},{key:"Mod-Enter",run:Vxe},{key:"Alt-l",mac:"Ctrl-l",run:Axe},{key:"Mod-i",run:Exe,preventDefault:!0},{key:"Mod-[",run:jq},{key:"Mod-]",run:Wq},{key:"Mod-Alt-\\",run:Wxe},{key:"Shift-Mod-k",run:Hxe},{key:"Shift-Mod-\\",run:gxe},{key:"Mod-/",run:$be},{key:"Alt-A",run:Hbe},{key:"Ctrl-m",mac:"Shift-Alt-m",run:jxe}].concat(Gxe),Kxe={key:"Tab",run:Wq,shift:jq};var Ox=200,hn=function(){};hn.prototype.append=function(e){return e.length?(e=hn.from(e),!this.length&&e||e.length<Ox&&this.leafAppend(e)||this.length<Ox&&e.leafPrepend(this)||this.appendInner(e)):this};hn.prototype.prepend=function(e){return e.length?hn.from(e).append(this):this};hn.prototype.appendInner=function(e){return new Yxe(this,e)};hn.prototype.slice=function(e,r){return e===void 0&&(e=0),r===void 0&&(r=this.length),e>=r?hn.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,r))};hn.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};hn.prototype.forEach=function(e,r,n){r===void 0&&(r=0),n===void 0&&(n=this.length),r<=n?this.forEachInner(e,r,n,0):this.forEachInvertedInner(e,r,n,0)};hn.prototype.map=function(e,r,n){r===void 0&&(r=0),n===void 0&&(n=this.length);var i=[];return this.forEach(function(s,o){return i.push(e(s,o))},r,n),i};hn.from=function(e){return e instanceof hn?e:e&&e.length?new Gq(e):hn.empty};var Gq=function(t){function e(n){t.call(this),this.values=n}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,s){return i==0&&s==this.length?this:new e(this.values.slice(i,s))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,s,o,a){for(var l=s;l<o;l++)if(i(this.values[l],a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(i,s,o,a){for(var l=s-1;l>=o;l--)if(i(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Ox)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Ox)return new e(i.flatten().concat(this.values))},r.length.get=function(){return this.values.length},r.depth.get=function(){return 0},Object.defineProperties(e.prototype,r),e}(hn);hn.empty=new Gq([]);var Yxe=function(t){function e(r,n){t.call(this),this.left=r,this.right=n,this.length=r.length+n.length,this.depth=Math.max(r.depth,n.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(n){return n<this.left.length?this.left.get(n):this.right.get(n-this.left.length)},e.prototype.forEachInner=function(n,i,s,o){var a=this.left.length;if(i<a&&this.left.forEachInner(n,i,Math.min(s,a),o)===!1||s>a&&this.right.forEachInner(n,Math.max(i-a,0),Math.min(this.length,s)-a,o+a)===!1)return!1},e.prototype.forEachInvertedInner=function(n,i,s,o){var a=this.left.length;if(i>a&&this.right.forEachInvertedInner(n,i-a,Math.max(s,a)-a,o+a)===!1||s<a&&this.left.forEachInvertedInner(n,Math.min(i,a),s,o)===!1)return!1}
vendor: 4,834 bytes, line 111
111,e.prototype.sliceInner=function(n,i){if(n==0&&i==this.length)return this;var s=this.left.length;return i<=s?this.left.slice(n,i):n>=s?this.right.slice(n-s,i-s):this.left.slice(n,s).append(this.right.slice(0,i-s))},e.prototype.leafAppend=function(n){var i=this.right.leafAppend(n);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(n){var i=this.left.leafPrepend(n);if(i)return new e(i,this.right)},e.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new e(this.left,new e(this.right,n)):new e(this,n)},e}(hn);const Xxe=500;class Ys{constructor(e,r){this.items=e,this.eventCount=r}popEvent(e,r){if(this.eventCount==0)return null;let n=this.items.length;for(;;n--)if(this.items.get(n-1).selection){--n;break}let i,s;r&&(i=this.remapping(n,this.items.length),s=i.maps.length);let o=e.tr,a,l,c=[],h=[];return this.items.forEach((u,d)=>{if(!u.step){i||(i=this.remapping(n,d+1),s=i.maps.length),s--,h.push(u);return}if(i){h.push(new Bo(u.map));let f=u.step.map(i.slice(s)),p;f&&o.maybeStep(f).doc&&(p=o.mapping.maps[o.mapping.maps.length-1],c.push(new Bo(p,void 0,void 0,c.length+h.length))),s--,p&&i.appendMap(p,s)}else o.maybeStep(u.step);if(u.selection)return a=i?u.selection.map(i.slice(s)):u.selection,l=new Ys(this.items.slice(0,n).append(h.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:o,selection:a}}addTransform(e,r,n,i){let s=[],o=this.eventCount,a=this.items,l=!i&&a.length?a.get(a.length-1):null;for(let h=0;h<e.steps.length;h++){let u=e.steps[h].invert(e.docs[h]),d=new Bo(e.mapping.maps[h],u,r),f;(f=l&&l.merge(d))&&(d=f,h?s.pop():a=a.slice(0,a.length-1)),s.push(d),r&&(o++,r=void 0),i||(l=d)}let c=o-n.depth;return c>Zxe&&(a=Jxe(a,c),o-=c),new Ys(a.append(s),o)}remapping(e,r){let n=new ig;return this.items.forEach((i,s)=>{let o=i.mirrorOffset!=null&&s-i.mirrorOffset>=e?n.maps.length-i.mirrorOffset:void 0;n.appendMap(i.map,o)},e,r),n}addMaps(e){return this.eventCount==0?this:new Ys(this.items.append(e.map(r=>new Bo(r))),this.eventCount)}rebased(e,r){if(!this.eventCount)return this;let n=[],i=Math.max(0,this.items.length-r),s=e.mapping,o=e.steps.length,a=this.eventCount;this.items.forEach(d=>{d.selection&&a--},i);let l=r;this.items.forEach(d=>{let f=s.getMirror(--l);if(f==null)return;o=Math.min(o,f);let p=s.maps[f];if(d.step){let m=e.steps[f].invert(e.docs[f]),g=d.selection&&d.selection.map(s.slice(l+1,f));g&&a++,n.push(new Bo(p,m,g))}else n.push(new Bo(p))},i);let c=[];for(let d=r;d<o;d++)c.push(new Bo(s.maps[d]));let h=this.items.slice(0,i).append(c).append(n),u=new Ys(h,a);return u.emptyItemCount()>Xxe&&(u=u.compress(this.items.length-n.length)),u}emptyItemCount(){let e=0;return this.items.forEach(r=>{r.step||e++}),e}compress(e=this.items.length){let r=this.remapping(0,e),n=r.maps.length,i=[],s=0;return this.items.forEach((o,a)=>{if(a>=e)i.push(o),o.selection&&s++;else if(o.step){let l=o.step.map(r.slice(n)),c=l&&l.getMap();if(n--,c&&r.appendMap(c,n),l){let h=o.selection&&o.selection.map(r.slice(n));h&&s++;let u=new Bo(c.invert(),l,h),d,f=i.length-1;(d=i.length&&i[f].merge(u))?i[f]=d:i.push(u)}}else o.map&&n--},this.items.length,0),new Ys(hn.from(i.reverse()),s)}}Ys.empty=new Ys(hn.empty,0);function Jxe(t,e){let r;return t.forEach((n,i)=>{if(n.selection&&e--==0)return r=i,!1}),t.slice(r)}class Bo{constructor(e,r,n,i){this.map=e,this.step=r,this.selection=n,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let r=e.step.merge(this.step);if(r)return new Bo(r.getMap().invert(),r,this.selection)}}}class Hl{constructor(e,r,n,i,s){this.done=e,this.undone=r,this.prevRanges=n,this.prevTime=i,this.prevComposition=s}}const Zxe=20;function Qxe(t,e,r,n){let i=r.getMeta(Kh),s;if(i)return i.historyState;r.getMeta(rve)&&(t=new Hl(t.done,t.undone,null,0,-1));let o=r.getMeta("appendedTransaction");if(r.steps.length==0)return t;if(o&&o.getMeta(Kh))return o.getMeta(Kh).redo?new Hl(t.done.addTransform(r,void 0,n,sb(e)),t.undone,GL(r.mapping.maps),t.prevTime,t.prevComposition):new Hl(t.done,t.undone.addTransform(r,void 0,n,sb(e)),null,t.prevTime,t.prevComposition);if(r.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let a=r.getMeta("composition"),l=t.prevTime==0||!o&&t.prevComposition!=a&&(t.prevTime<(r.time||0)-n.newGroupDelay||!eve(r,t.prevRanges)),c=o?lk(t.prevRanges,r.mapping):GL(r.mapping.maps);return new Hl(t.done.addTransform(r,l?e.selection.getBookmark():void 0,n,sb(e)),Ys.empty,c,r.time,a??t.prevComposition)}else return(s=r.getMeta("rebased"))?new Hl(t.done.rebased(r,s),t.undone.rebased(r,s),lk(t.prevRanges,r.mapping),t.prevTime,t.prevComposition):new Hl(t.done.addMaps(r.mapping.maps),t.undone.addMaps(r.mapping.maps),lk(t.prevRanges,r.mapping),t.prevTime,t.prevComposition)}function eve(t,e){if(!e)return!1;if(!t.docChanged)return!0;let r=!1;
111return t.mapping.maps[0].forEach((n,i)=>{for(let s=0;s<e.length;s+=2)n<=e[s+1]&&i>=e[s]&&(r=!0)}),r}function GL(t){let e=[];for(let r=t.length-1;r>=0&&e.length==0;r--)t[r].forEach((n,i,s,o)=>e.push(s,o));return e}function lk(t,e){if(!t)return null;let r=[];for(let n=0;n<t.length;n+=2){let i=e.map(t[n],1),s=e.map(t[n+1],-1);i<=s&&r.push(i,s)}return r}function tve(t,e,r){let n=sb(e),i=Kh.get(e).spec.config,s=(r?t.undone:t.done).popEvent(e,n);if(!s)return null;let o=s.selection.resolve(s.transform.doc),a=(r?t.done:t.undone).addTransform(s.transform,e.selection.getBookmark(),i,n),l=new Hl(r?a:s.remaining,r?s.remaining:a,null,0,-1);return s.transform.setSelection(o).setMeta(Kh,{redo:r,historyState:l})}let ck=!1,KL=null;function sb(t){let e=t.plugins;if(KL!=e){ck=!1,KL=e;for(let r=0;r<e.length;r++)if(e[r].spec.historyPreserveItems){ck=!0;break}}return ck}const Kh=new Dr("history"),rve=new Dr("closeHistory");function nve(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new _r({key:Kh,state:{init(){return new Hl(Ys.empty,Ys.empty,null,0,-1)},apply(e,r,n){return Qxe(r,n,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,r){let n=r.inputType,i=n=="historyUndo"?Hw:n=="historyRedo"?Of:null;return i?(r.preventDefault(),i(e.state,e.dispatch)):!1}}}})}function Kq(t,e){return(r,n)=>{let i=Kh.getState(r);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(n){let s=tve(i,r,t);s&&n(e?s.scrollIntoView():s)}return!0}}const Hw=Kq(!1,!0),Of=Kq(!0,!0);var ive=Object.defineProperty,YL=Object.getOwnPropertySymbols,sve=Object.prototype.hasOwnProperty,ove=Object.prototype.propertyIsEnumerable,XL=(t,e,r)=>e in t?ive(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ave=(t,e)=>{for(var r in e||(e={}))sve.call(e,r)&&XL(t,r,e[r]);if(YL)for(var r of YL(e))ove.call(e,r)&&XL(t,r,e[r]);return t};function Yq(t,e){return Object.assign(t,{meta:ave({package:"@milkdown/components"},e)}),t}const lve={extensions:[],languages:[],expandIcon:"⬇",searchIcon:"🔍",clearSearchIcon:"⌫",searchPlaceholder:"Search language",noResultText:"No result",copyText:"Copy",copyIcon:"📋",onCopy:()=>{},renderLanguage:t=>t,renderPreview:()=>null,previewToggleButton:t=>t?"Edit":"Hide",previewLabel:"Preview"},H1=tr(lve,"codeBlockConfigCtx");Yq(H1,{displayName:"Config<code-block>",group:"CodeBlock"});class cve{constructor(e){this.languages=e,this.map={},e.forEach(r=>{r.alias.forEach(n=>{this.map[n]=r})})}getAll(){return this.languages.map(e=>({name:e.name,alias:e.alias}))}load(e){const n=this.map[e.toLowerCase()];return n?n.support?Promise.resolve(n.support):n.load():Promise.resolve(void 0)}}function _d({icon:t,class:e,onClick:r}){return te("span",{class:Mn("milkdown-icon",e),onPointerdown:r,ref:n=>{n&&t&&(n.innerHTML=An.sanitize(t.trim()))}})}_d.props={icon:{type:String,required:!1},class:{type:String,required:!1},onClick:{type:Function,required:!1}};var hve=(t,e,r)=>new Promise((n,i)=>{var s=l=>{try{a(r.next(l))}catch(c){i(c)}},o=l=>{try{a(r.throw(l))}catch(c){i(c)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(s,o);a((r=r.apply(t,e)).next())});function uve(t){return hve(this,null,function*(){try{return navigator.clipboard.writeText(t)}catch{const r=document.createElement("textarea"),n=document.activeElement;r.value=t,r.setAttribute("readonly",""),r.style.contain="strict",r.style.position="absolute",r.style.left="-9999px",r.style.fontSize="12pt";const i=document.getSelection(),s=i?i.rangeCount>0&&i.getRangeAt(0):null;document.body.appendChild(r),r.select(),r.selectionStart=0,r.selectionEnd=t.length,document.execCommand("copy"),document.body.removeChild(r),s&&(i.removeAllRanges(),i.addRange(s)),n&&n.focus()}})}const dve=En({props:{copyText:{type:String,required:!0},copyIcon:{type:String,required:!0},onCopy:{type:Function,required:!0},text:{type:String,required:!0}},setup(t){const e=()=>{uve(t.text).then(()=>t.onCopy(t.text)).catch(console.error)};return()=>te(Cn,null,te("button",{type:"button",class:"copy-button",onClick:e},te(_d,{icon:t.copyIcon}),t.copyText))}}),fve=En({props:{language:{type:Object,required:!0},getReadOnly:{type:Function,required:!0},config:{type:Object,required:!0},getAllLanguages:{type:Function,required:!0},setLanguage:{type:Function,required:!0}},setup({language:t,config:e,setLanguage:r,getAllLanguages:n,getReadOnly:i}
111){const s=We(),o=We(!1),a=We(),l=We(),c=We("");Td([o,s,l],()=>{c.value="";const m=s.value,g=l.value;!m||!g||uo(m,g,{placement:"bottom-start"}).then(({x:y,y:b})=>{Object.assign(g.style,{left:`${y}px`,top:`${b}px`})}).catch(console.error)});const h=m=>{if(m.preventDefault(),m.stopPropagation(),i())return;const g=!o.value;o.value=g,g&&setTimeout(()=>{var y;return(y=a.value)==null?void 0:y.focus()},0)},u=m=>{const g=m.target;c.value=g.value},d=m=>{m.key==="Escape"&&(c.value="")},f=mu(()=>{var m;if(!o.value)return[];const g=(m=n())!=null?m:[],y=g.find(x=>x.name.toLowerCase()===t.value.toLowerCase()),b=g.filter(x=>{const S=c.value.toLowerCase();return(x.name.toLowerCase().includes(S)||x.alias.some(k=>k.toLowerCase().includes(S)))&&x!==y});return b.length===0?[]:y?[y,...b]:b}),p=m=>{const g=m.target;if(s.value&&s.value.contains(g))return;const y=l.value,b=s.value;!b||!y||b.dataset.expanded==="true"&&(y.contains(g)||(o.value=!1))};return L1(()=>{window.addEventListener("click",p)}),D1(()=>{window.removeEventListener("click",p)}),()=>te(Cn,null,te("button",{type:"button",ref:s,class:"language-button",onClick:h,"data-expanded":String(o.value)},t.value||"Text",te("div",{class:"expand-icon"},te(_d,{icon:e.expandIcon}))),te("div",{ref:l,class:"language-picker"},o.value?te("div",{class:"list-wrapper"},te("div",{class:"search-box"},te("div",{class:"search-icon"},te(_d,{icon:e.searchIcon})),te("input",{ref:a,class:"search-input",placeholder:e.searchPlaceholder,value:c.value,onInput:u,onKeydown:d}),te("div",{class:Mn("clear-icon",c.value.length===0&&"hidden"),onMousedown:m=>{m.preventDefault(),c.value=""}},te(_d,{icon:e.clearSearchIcon}))),te("ul",{class:"language-list",role:"listbox",onKeydown:m=>{if(m.key==="Enter"){const g=document.activeElement;g instanceof HTMLElement&&g.dataset.language&&r(g.dataset.language)}}},f.value.length?f.value.map(m=>te("li",{role:"listitem",tabindex:"0",class:"language-list-item","aria-selected":m.name.toLowerCase()===t.value.toLowerCase(),"data-language":m.name,onClick:()=>{r(m.name),o.value=!1}},e.renderLanguage(m.name,m.name.toLowerCase()===t.value.toLowerCase()))):te("li",{class:"language-list-item no-result"},e.noResultText))):null))}}),pve=En({props:{text:{type:Object,required:!0},language:{type:Object,required:!0},config:{type:Object,required:!0},previewOnlyMode:{type:Object,required:!0},preview:{type:Object,required:!0}},setup(t){const{previewOnlyMode:e,config:r,preview:n}=t,i=We();return n0(()=>{const s=i.value;if(!s)return;for(;s.firstChild;)s.removeChild(s.firstChild);const o=n.value;(typeof o=="string"||o instanceof Element)&&(s.innerHTML=An.sanitize(o))}),()=>n.value?te("div",{class:"preview-panel"},!e.value&&te(Cn,null,te("div",{class:"preview-divider"}),te("div",{class:Mn("preview-label",e&&"hidden")},r.previewLabel)),te("div",{ref:i,class:"preview"})):null}}),mve=En({props:{text:{type:Object,required:!0},selected:{type:Object,required:!0},getReadOnly:{type:Function,required:!0},codemirror:{type:Object,required:!0},language:{type:Object,required:!0},getAllLanguages:{type:Function,required:!0},setLanguage:{type:Function,required:!0},config:{type:Object,required:!0}},setup(t){const e=We(!1),r=We();L1(()=>{for(var s;(s=r.value)!=null&&s.firstChild;)r.value.removeChild(r.value.firstChild);r.value&&r.value.appendChild(t.codemirror.dom)});const n=mu(()=>{const s=t.text.value,o=t.language.value;return t.config.renderPreview(o,s)}),i=()=>{};return()=>{var s;return te(Cn,null,te("div",{class:"tools"},te(fve,{language:t.language,config:t.config,setLanguage:t.setLanguage,getAllLanguages:t.getAllLanguages,getReadOnly:t.getReadOnly}),te("div",{class:"tools-button-group"},te(dve,{copyIcon:t.config.copyIcon,copyText:t.config.copyText,onCopy:(s=t.config.onCopy)!=null?s:i,text:t.text.value}),n.value?te("button",{class:"preview-toggle-button",onClick:()=>e.value=!e.value},te(_d,{icon:t.config.previewToggleButton(e.value)})):null)),te("div",{ref:r,class:Mn("codemirror-host",n.value&&e.value&&"hidden")}),te(pve,{text:t.text,language:t.language,config:t.config,previewOnlyMode:e,preview:n}))}}});class gve{constructor(e,r,n,i,s){this.node=e,this.view=r,this.getPos=n,this.loader=i,this.config=s,this.selected=We(!1),this.language=We(""),this.text=We(""),this.updating=!1,this.languageName="",this.forwardUpdate=o=>{var a;if(this.updating||!this.cm.hasFocus)return;let l=((a=this.getPos())!=null?a:0)+1;const{main:c}=o.state.selection,h=l+c.from,u=l+c.to,d=this.view.state.selection;if(o.docChanged||d.from!==h||d.to!==u){const f=this.view.state.tr;o.changes.iterChanges((p,m,g,y,b)=>{b.length?f.replaceWith(l+p,l+m,this.view.state.schema.text(b.toString())):f.delete(l+p,l+m),l+=y-g-(m-p)}),f.setSelection(Je.create(f.doc,h,u)),this.view.dispatch(f)}},this.createApp=()=>bo(mve,{text:this.text,selected:this.selected,codemirror:this.cm,language:this.language,getAllLanguages:this.getAllLanguages,getReadOnly:()=>!this.view.editable,setLanguage:this.setLanguage,config:this.config}),this.codeMirrorKeymap=()=>{const o=this.view;return[{key:"ArrowUp",run:()=>this.maybeEscape("line",-1)},{key:"ArrowLeft",run:()=>this.maybeEscape("char",-1)},{key:"ArrowDown",run:()=>this.maybeEscape("line",1)},{key:"ArrowRight",run:()=>this.maybeEscape("char",1)},{key:"Mod-Enter",run:()=>YF(o.state,o.dispatch)?(o.focus(),!0):!1},{key:"Mod-z",run:()=>Hw(o.state,o.dispatch)},{key:"Shift-Mod-z",run:()=>Of(o.state,o.dispatch)},{key:"Mod-y",run:()=>Of(o.state,o.dispatch)},{key:"Backspace",run:()=>{var a;const l=this.cm.state.selection.ranges;if(l.length>1)return!1;const c=l[0];if(c&&(!c.empty||c.anchor>0)||this.cm.state.doc.lines>=2)return!1;const h=this.view.state,u=(a=this.getPos())!=null?a:0,d=h.tr.replaceWith(u,u+this.node.nodeSize,h.schema.nodes.paragraph.createChecked({},this.node.content));return d.setSelection(Je.near(d.doc.resolve(u))),this.view.dispatch(d),this.view.focus(),!0}}]},this.maybeEscape=(o,a)=>{var l;const{state:c}=this.cm;let h=c.selection.main;if(!h.empty||(o==="line"&&(h=c.doc.lineAt(h.head)),a<0?h.from>0:h.to<c.doc.length))return!1;const u=((l=this.getPos())!=null?l:0)+(a<0?0:this.node.nodeSize),d=Je.near(this.view.state.doc.resolve(u),a),f=this.view.state.tr.setSelection(d).scrollIntoView();return this.view.dispatch(f),this.view.focus(),!0},this.setLanguage=o=>{var a;this.view.dispatch(this.view.state.tr.setNodeAttribute((a=this.getPos())!=null?a:0,"language",o))},this.getAllLanguages=()=>this.loader.getAll(),this.languageConf=new yf,this.readOnlyConf=new yf,this.cm=new ze({doc:this.node.textContent,root:this.view.root,extensions:[this.readOnlyConf.of(Tr.readOnly.of(!this.view.editable)),zP(),Yf.of(this.codeMirrorKeymap()),this.languageConf.of([]),Tr.changeFilter.of(()=>this.view.editable),...s.extensions,ze.updateListener.of(this.forwardUpdate)]}),this.app=this.createApp(),this.dom=this.createDom(this.app),this.disposeSelectedWatcher=n0(()=>{this.selected.value?this.dom.classList.add("selected"):this.dom.classList.remove("selected")}),this.updateLanguage()}createDom(e){const r=document.createElement("div");return r.className="milkdown-code-block",this.text.value=this.node.textContent,e.mount(r),r}updateLanguage(){const e=this.node.attrs.language;if(e===this.languageName)return;this.language.value=e,this.loader.load(e??"").then(n=>
111{n&&(this.cm.dispatch({effects:this.languageConf.reconfigure(n)}),this.languageName=e)}).catch(console.error)}setSelection(e,r){this.cm.dom.isConnected&&(this.cm.focus(),this.updating=!0,this.cm.dispatch({selection:{anchor:e,head:r}}),this.updating=!1)}update(e){if(e.type!==this.node.type)return!1;if(this.updating)return!0;this.node=e,this.text.value=e.textContent,this.updateLanguage(),this.view.editable===this.cm.state.readOnly&&this.cm.dispatch({effects:this.readOnlyConf.reconfigure(Tr.readOnly.of(!this.view.editable))});const r=yve(this.cm.state.doc.toString(),e.textContent);return r&&(this.updating=!0,this.cm.dispatch({changes:{from:r.from,to:r.to,insert:r.text},scrollIntoView:!0}),this.updating=!1),!0}selectNode(){this.selected.value=!0,this.cm.focus()}deselectNode(){this.selected.value=!1}stopEvent(){return!0}destroy(){this.app.unmount(),this.cm.destroy(),this.disposeSelectedWatcher()}}function yve(t,e){if(t===e)return null;let r=0,n=t.length,i=e.length;for(;r<n&&t.charCodeAt(r)===e.charCodeAt(r);)++r;for(;n>r&&i>r&&t.charCodeAt(n-1)===e.charCodeAt(i-1);)n--,i--;return{from:r,to:n,text:e.slice(r,i)}}const Xq=_1(ra.node,t=>{const e=t.get(H1.key),r=new cve(e.languages);return(n,i,s)=>new gve(n,i,s,r,e)});Yq(Xq,{displayName:"NodeView<code-block>",group:"CodeBlock"});const bve=[Xq,H1],JL=typeof String.prototype.normalize=="function"?t=>t.normalize("NFKD"):t=>t;class Lf{constructor(e,r,n=0,i=e.length,s,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,i),this.bufferStart=n,this.normalize=s?a=>s(JL(a)):JL,this.query=this.normalize(r)}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 ki(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 r=F6(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=Fo(e);let i=this.normalize(r);if(i.length)for(let s=0,o=n;;s++){let a=i.charCodeAt(s),l=this.match(a,o,this.bufferPos+this.bufferStart);if(s==i.length-1){if(l)return this.value=l,this;break}o==n&&s<r.length&&r.charCodeAt(s)==a&&o++}}}match(e,r,n){let i=null;for(let s=0;s<this.matches.length;s+=2){let o=this.matches[s],a=!1;this.query.charCodeAt(o)==e&&(o==this.query.length-1?i={from:this.matches[s+1],to:n}:(this.matches[s]++,a=!0)),a||(this.matches.splice(s,2),s-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?i={from:r,to:n}:this.matches.push(1,r)),i&&this.test&&!this.test(i.from,i.to,this.buffer,this.bufferStart)&&(i=null),i}}typeof Symbol<"u"&&(Lf.prototype[Symbol.iterator]=function(){return this});const Jq={from:-1,to:-1,match:/.*/.exec("")},M9="gm"+(/x/.unicode==null?"":"u");class Zq{constructor(e,r,n,i=0,s=e.length){if(this.text=e,this.to=s,this.curLine="",this.done=!1,this.value=Jq,/\\[sWDnr]|\n|\r|\[\^/.test(r))return new Qq(e,r,n,i,s);this.re=new RegExp(r,M9+(n!=null&&n.ignoreCase?"i":"")),this.test=n==null?void 0:n.test,this.iter=e.iter();let o=e.lineAt(i);this.curLineStart=o.from,this.matchPos=Lx(e,i),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 r=this.matchPos<=this.to&&this.re.exec(this.curLine);if(r){let n=this.curLineStart+r.index,i=n+r[0].length;if(this.matchPos=Lx(this.text,i+(n==i?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<i||n>this.value.to)&&(!this.test||this.test(n,i,r)))return this.value={from:n,to:i,match:r},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 hk=new WeakMap;class Md{constructor(e,r){this.from=e,this.text=r}get to(){return this.from+this.text.length}static get(e,r,n){let i=hk.get(e);if(!i||i.from>=n||i.to<=r){let a=new Md(r,e.sliceString(r,n));return hk.set(e,a),a}if(i.from==r&&i.to==n)return i;let{text:s,from:o}=i;return o>r&&(s=e.sliceString(r,o)+s,o=r),i.to<n&&(s+=e.sliceString(i.to,n)),hk.set(e,new Md(o,s)
111),new Md(r,s.slice(r-o,n-o))}}class Qq{constructor(e,r,n,i,s){this.text=e,this.to=s,this.done=!1,this.value=Jq,this.matchPos=Lx(e,i),this.re=new RegExp(r,M9+(n!=null&&n.ignoreCase?"i":"")),this.test=n==null?void 0:n.test,this.flat=Md.get(e,i,this.chunkEnd(i+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,r=this.re.exec(this.flat.text);if(r&&!r[0]&&r.index==e&&(this.re.lastIndex=e+1,r=this.re.exec(this.flat.text)),r){let n=this.flat.from+r.index,i=n+r[0].length;if((this.flat.to>=this.to||r.index+r[0].length<=this.flat.text.length-10)&&(!this.test||this.test(n,i,r)))return this.value={from:n,to:i,match:r},this.matchPos=Lx(this.text,i+(n==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Md.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(Zq.prototype[Symbol.iterator]=Qq.prototype[Symbol.iterator]=function(){return this});function xve(t){try{return new RegExp(t,M9),!0}catch{return!1}}function Lx(t,e){if(e>=t.length)return e;let r=t.lineAt(e),n;for(;e<r.to&&(n=r.text.charCodeAt(e-r.from))>=56320&&n<57344;)e++;return e}function fS(t){let e=String(t.state.doc.lineAt(t.state.selection.main.head).number),r=ir("input",{class:"cm-textfield",name:"line",value:e}),n=ir("form",{class:"cm-gotoLine",onkeydown:s=>{s.keyCode==27?(s.preventDefault(),t.dispatch({effects:Em.of(!1)}),t.focus()):s.keyCode==13&&(s.preventDefault(),i())},onsubmit:s=>{s.preventDefault(),i()}},ir("label",t.state.phrase("Go to line"),": ",r)," ",ir("button",{class:"cm-button",type:"submit"},t.state.phrase("go")),ir("button",{name:"close",onclick:()=>{t.dispatch({effects:Em.of(!1)}),t.focus()},"aria-label":t.state.phrase("close"),type:"button"},["×"]));function i(){let s=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(r.value);if(!s)return;let{state:o}=t,a=o.doc.lineAt(o.selection.main.head),[,l,c,h,u]=s,d=h?+h.slice(1):0,f=c?+c:a.number;if(c&&u){let g=f/100;l&&(g=g*(l=="-"?-1:1)+a.number/o.doc.lines),f=Math.round(o.doc.lines*g)}else c&&l&&(f=f*(l=="-"?-1:1)+a.number);let p=o.doc.line(Math.max(1,Math.min(o.doc.lines,f))),m=ce.cursor(p.from+Math.max(0,Math.min(d,p.length)));t.dispatch({effects:[Em.of(!1),ze.scrollIntoView(m.from,{y:"center"})],selection:m}),t.focus()}return{dom:n}}const Em=kt.define(),ZL=fn.define({create(){return!0},update(t,e){for(let r of e.effects)r.is(Em)&&(t=r.value);return t},provide:t=>Qm.from(t,e=>e?fS:null)}),vve=t=>{let e=Zm(t,fS);if(!e){let r=[Em.of(!0)];t.state.field(ZL,!1)==null&&r.push(kt.appendConfig.of([ZL,wve])),t.dispatch({effects:r}),e=Zm(t,fS)}return e&&e.dom.querySelector("input").select(),!0},wve=ze.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px",position:"relative","& label":{fontSize:"80%"},"& [name=close]":{position:"absolute",top:"0",bottom:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:"0"}}}),kve={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Cve=Ne.define({combine(t){return oa(t,kve,{highlightWordAroundCursor:(e,r)=>e||r,minSelectionLength:Math.min,maxMatches:Math.min})}});function Sve(t){return[Eve,Ave]}const Tve=st.mark({class:"cm-selectionMatch"}),_ve=st.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function QL(t,e,r,n){return(r==0||t(e.sliceDoc(r-1,r))!=Sr.Word)&&(n==e.doc.length||t(e.sliceDoc(n,n+1))!=Sr.Word)}function Mve(t,e,r,n){return t(e.sliceDoc(r,r+1))==Sr.Word&&t(e.sliceDoc(n-1,n))==Sr.Word}const Ave=Kr.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet(Cve),{state:r}=t,n=r.selection;if(n.ranges.length>1)return st.none;let i=n.main,s,o=null;if(i.empty){if(!e.highlightWordAroundCursor)return st.none;let l=r.wordAt(i.head);if(!l)return st.none;o=r.charCategorizer(i.head),s=r.sliceDoc(l.from,l.to)}else{let l=i.to-i.from;if(l<e.minSelectionLength||l>200)return st.none;if(e.wholeWords){if(s=r.sliceDoc(i.from,i.to),o=r.charCategorizer(i.head),!(QL(o,r,i.from,i.to)&&Mve(o,r,i.from,i.to))
111)return st.none}else if(s=r.sliceDoc(i.from,i.to),!s)return st.none}let a=[];for(let l of t.visibleRanges){let c=new Lf(r.doc,s,l.from,l.to);for(;!c.next().done;){let{from:h,to:u}=c.value;if((!o||QL(o,r,h,u))&&(i.empty&&h<=i.from&&u>=i.to?a.push(_ve.range(h,u)):(h>=i.to||u<=i.from)&&a.push(Tve.range(h,u)),a.length>e.maxMatches))return st.none}}return st.set(a)}},{decorations:t=>t.decorations}),Eve=ze.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),Ove=({state:t,dispatch:e})=>{let{selection:r}=t,n=ce.create(r.ranges.map(i=>t.wordAt(i.head)||ce.cursor(i.head)),r.mainIndex);return n.eq(r)?!1:(e(t.update({selection:n})),!0)};function Lve(t,e){let{main:r,ranges:n}=t.selection,i=t.wordAt(r.head),s=i&&i.from==r.from&&i.to==r.to;for(let o=!1,a=new Lf(t.doc,e,n[n.length-1].to);;)if(a.next(),a.done){if(o)return null;a=new Lf(t.doc,e,0,Math.max(0,n[n.length-1].from-1)),o=!0}else{if(o&&n.some(l=>l.from==a.value.from))continue;if(s){let l=t.wordAt(a.value.from);if(!l||l.from!=a.value.from||l.to!=a.value.to)continue}return a.value}}const Dve=({state:t,dispatch:e})=>{let{ranges:r}=t.selection;if(r.some(s=>s.from===s.to))return Ove({state:t,dispatch:e});let n=t.sliceDoc(r[0].from,r[0].to);if(t.selection.ranges.some(s=>t.sliceDoc(s.from,s.to)!=n))return!1;let i=Lve(t,n);return i?(e(t.update({selection:t.selection.addRange(ce.range(i.from,i.to),!1),effects:ze.scrollIntoView(i.to)})),!0):!1},a0=Ne.define({combine(t){return oa(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new Wve(e),scrollToMatch:e=>ze.scrollIntoView(e)})}});class eV{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||xve(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(r,n)=>n=="n"?`
112`:n=="r"?"\r":n=="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 Pve(this):new Bve(this)}getCursor(e,r=0,n){let i=e.doc?e:Tr.create({doc:e});return n==null&&(n=i.doc.length),this.regexp?sd(this,i,r,n):id(this,i,r,n)}}class tV{constructor(e){this.spec=e}}function id(t,e,r,n){return new Lf(e.doc,t.unquoted,r,n,t.caseSensitive?void 0:i=>i.toLowerCase(),t.wholeWord?Ive(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function Ive(t,e){return(r,n,i,s)=>((s>r||s+i.length<n)&&(s=Math.max(0,r-2),i=t.sliceString(s,Math.min(t.length,n+2))),(e(Dx(i,r-s))!=Sr.Word||e(Ix(i,r-s))!=Sr.Word)&&(e(Ix(i,n-s))!=Sr.Word||e(Dx(i,n-s))!=Sr.Word))}class Bve extends tV{constructor(e){super(e)}nextMatch(e,r,n){let i=id(this.spec,e,n,e.doc.length).nextOverlapping();if(i.done){let s=Math.min(e.doc.length,r+this.spec.unquoted.length);i=id(this.spec,e,0,s).nextOverlapping()}return i.done||i.value.from==r&&i.value.to==n?null:i.value}prevMatchInRange(e,r,n){for(let i=n;;){let s=Math.max(r,i-1e4-this.spec.unquoted.length),o=id(this.spec,e,s,i),a=null;for(;!o.nextOverlapping().done;)a=o.value;if(a)return a;if(s==r)return null;i-=1e4}}prevMatch(e,r,n){let i=this.prevMatchInRange(e,0,r);return i||(i=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length)),i&&(i.from!=r||i.to!=n)?i:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,r){let n=id(this.spec,e,0,e.doc.length),i=[];for(;!n.next().done;){if(i.length>=r)return null;i.push(n.value)}return i}highlight(e,r,n,i){let s=id(this.spec,e,Math.max(0,r-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!s.next().done;)i(s.value.from,s.value.to)}}function sd(t,e,r,n){return new Zq(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:t.wholeWord?Rve(e.charCategorizer(e.selection.main.head)):void 0},r,n)}function Dx(t,e){return t.slice(Tn(t,e,!1),e)}function Ix(t,e){return t.slice(e,Tn(t,e))}function Rve(t){return(e,r,n)=>!n[0].length||(t(Dx(n.input,n.index))!=Sr.Word||t(Ix(n.input,n.index))!=Sr.Word)&&(t(Ix(n.input,n.index+n[0].length))!=Sr.Word||t(Dx(n.input,n.index+n[0].length))!=Sr.Word)}class Pve extends tV{nextMatch(e,r,n){let i=sd(this.spec,e,n,e.doc.length).next();return i.done&&(i=sd(this.spec,e,0,r).next()),i.done?null:i.value}prevMatchInRange(e,r,n){for(let i=1;;i++){let s=Math.max(r,n-i*1e4),o=sd(this.spec,e,s,n),a=null;for(;!o.next().done;)a=o.value;if(a&&(s==r||a.from>s+10))return a;
vendor: 4,871 bytes, line 112
112if(s==r)return null}}prevMatch(e,r,n){return this.prevMatchInRange(e,0,r)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(r,n)=>{if(n=="&")return e.match[0];if(n=="$")return"$";for(let i=n.length;i>0;i--){let s=+n.slice(0,i);if(s>0&&s<e.match.length)return e.match[s]+n.slice(i)}return r})}matchAll(e,r){let n=sd(this.spec,e,0,e.doc.length),i=[];for(;!n.next().done;){if(i.length>=r)return null;i.push(n.value)}return i}highlight(e,r,n,i){let s=sd(this.spec,e,Math.max(0,r-250),Math.min(n+250,e.doc.length));for(;!s.next().done;)i(s.value.from,s.value.to)}}const vg=kt.define(),A9=kt.define(),cc=fn.define({create(t){return new uk(pS(t).create(),null)},update(t,e){for(let r of e.effects)r.is(vg)?t=new uk(r.value.create(),t.panel):r.is(A9)&&(t=new uk(t.query,r.value?E9:null));return t},provide:t=>Qm.from(t,e=>e.panel)});class uk{constructor(e,r){this.query=e,this.panel=r}}const Nve=st.mark({class:"cm-searchMatch"}),Fve=st.mark({class:"cm-searchMatch cm-searchMatch-selected"}),$ve=Kr.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(cc))}update(t){let e=t.state.field(cc);(e!=t.startState.field(cc)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return st.none;let{view:r}=this,n=new rl;for(let i=0,s=r.visibleRanges,o=s.length;i<o;i++){let{from:a,to:l}=s[i];for(;i<o-1&&l>s[i+1].from-2*250;)l=s[++i].to;t.highlight(r.state,a,l,(c,h)=>{let u=r.state.selection.ranges.some(d=>d.from==c&&d.to==h);n.add(c,h,u?Fve:Nve)})}return n.finish()}},{decorations:t=>t.decorations});function q1(t){return e=>{let r=e.state.field(cc,!1);return r&&r.query.spec.valid?t(e,r):iV(e)}}const Bx=q1((t,{query:e})=>{let{to:r}=t.state.selection.main,n=e.nextMatch(t.state,r,r);if(!n)return!1;let i=ce.single(n.from,n.to),s=t.state.facet(a0);return t.dispatch({selection:i,effects:[O9(t,n),s.scrollToMatch(i.main,t)],userEvent:"select.search"}),nV(t),!0}),Rx=q1((t,{query:e})=>{let{state:r}=t,{from:n}=r.selection.main,i=e.prevMatch(r,n,n);if(!i)return!1;let s=ce.single(i.from,i.to),o=t.state.facet(a0);return t.dispatch({selection:s,effects:[O9(t,i),o.scrollToMatch(s.main,t)],userEvent:"select.search"}),nV(t),!0}),zve=q1((t,{query:e})=>{let r=e.matchAll(t.state,1e3);return!r||!r.length?!1:(t.dispatch({selection:ce.create(r.map(n=>ce.range(n.from,n.to))),userEvent:"select.search.matches"}),!0)}),Hve=({state:t,dispatch:e})=>{let r=t.selection;if(r.ranges.length>1||r.main.empty)return!1;let{from:n,to:i}=r.main,s=[],o=0;for(let a=new Lf(t.doc,t.sliceDoc(n,i));!a.next().done;){if(s.length>1e3)return!1;a.value.from==n&&(o=s.length),s.push(ce.range(a.value.from,a.value.to))}return e(t.update({selection:ce.create(s,o),userEvent:"select.search.matches"})),!0},eD=q1((t,{query:e})=>{let{state:r}=t,{from:n,to:i}=r.selection.main;if(r.readOnly)return!1;let s=e.nextMatch(r,n,n);if(!s)return!1;let o=s,a=[],l,c,h=[];o.from==n&&o.to==i&&(c=r.toText(e.getReplacement(o)),a.push({from:o.from,to:o.to,insert:c}),o=e.nextMatch(r,o.from,o.to),h.push(ze.announce.of(r.phrase("replaced match on line $",r.doc.lineAt(n).number)+".")));let u=t.state.changes(a);return o&&(l=ce.single(o.from,o.to).map(u),h.push(O9(t,o)),h.push(r.facet(a0).scrollToMatch(l.main,t))),t.dispatch({changes:u,selection:l,effects:h,userEvent:"input.replace"}),!0}),qve=q1((t,{query:e})=>{if(t.state.readOnly)return!1;let r=e.matchAll(t.state,1e9).map(i=>{let{from:s,to:o}=i;return{from:s,to:o,insert:e.getReplacement(i)}});if(!r.length)return!1;let n=t.state.phrase("replaced $ matches",r.length)+".";return t.dispatch({changes:r,effects:ze.announce.of(n),userEvent:"input.replace.all"}),!0});function E9(t){return t.state.facet(a0).createPanel(t)}function pS(t,e){var r,n,i,s,o;let a=t.selection.main,l=a.empty||a.to>a.from+100?"":t.sliceDoc(a.from,a.to);if(e&&!l)return e;let c=t.facet(a0);return new eV({search:((r=e==null?void 0:e.literal)!==null&&r!==void 0?r:c.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:(n=e==null?void 0:e.caseSensitive)!==null&&n!==void 0?n:c.caseSensitive,literal:(i=e==null?void 0:e.literal)!==null&&i!==void 0?i:c.literal,regexp:(s=e==null?void 0:e.regexp)!==null&&s!==void 0?s:c.regexp,wholeWord:(o=e==null?void 0:e.wholeWord)!==null&&o!==void 0?o:c.wholeWord})}function rV(t){let e=Zm(t,E9);return e&&e.dom.querySelector("[main-field]")}function nV(t){let e=rV(t);e&&e==t.root.activeElement&&e.select()}const iV=t=>{let e=t.state.field(cc,!1);if(e&&e.panel){let r=rV(t);if(r&&r!=t.root.activeElement){let n=pS(t.state,e.query.spec);n.valid&&t.dispatch({effects:vg.of(n)}),r.focus(),r.select()}}else t.dispatch({effects:[A9.of(!0),e?vg.of(pS(t.state,e.query.spec)):kt.appendConfig.of(Uve)]});return!0},sV=t=>{let e=t.state.field(cc,!1);if(!e||!e.panel)return!1;let r=Zm(t,E9);
112return r&&r.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:A9.of(!1)}),!0},Vve=[{key:"Mod-f",run:iV,scope:"editor search-panel"},{key:"F3",run:Bx,shift:Rx,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Bx,shift:Rx,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:sV,scope:"editor search-panel"},{key:"Mod-Shift-l",run:Hve},{key:"Mod-Alt-g",run:vve},{key:"Mod-d",run:Dve,preventDefault:!0}];class Wve{constructor(e){this.view=e;let r=this.query=e.state.field(cc).query.spec;this.commit=this.commit.bind(this),this.searchField=ir("input",{value:r.search,placeholder:Hi(e,"Find"),"aria-label":Hi(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=ir("input",{value:r.replace,placeholder:Hi(e,"Replace"),"aria-label":Hi(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=ir("input",{type:"checkbox",name:"case",form:"",checked:r.caseSensitive,onchange:this.commit}),this.reField=ir("input",{type:"checkbox",name:"re",form:"",checked:r.regexp,onchange:this.commit}),this.wordField=ir("input",{type:"checkbox",name:"word",form:"",checked:r.wholeWord,onchange:this.commit});function n(i,s,o){return ir("button",{class:"cm-button",name:i,onclick:s,type:"button"},o)}this.dom=ir("div",{onkeydown:i=>this.keydown(i),class:"cm-search"},[this.searchField,n("next",()=>Bx(e),[Hi(e,"next")]),n("prev",()=>Rx(e),[Hi(e,"previous")]),n("select",()=>zve(e),[Hi(e,"all")]),ir("label",null,[this.caseField,Hi(e,"match case")]),ir("label",null,[this.reField,Hi(e,"regexp")]),ir("label",null,[this.wordField,Hi(e,"by word")]),...e.state.readOnly?[]:[ir("br"),this.replaceField,n("replace",()=>eD(e),[Hi(e,"replace")]),n("replaceAll",()=>qve(e),[Hi(e,"replace all")])],ir("button",{name:"close",onclick:()=>sV(e),"aria-label":Hi(e,"close"),type:"button"},["×"])])}commit(){let e=new eV({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:vg.of(e)}))}keydown(e){kie(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Rx:Bx)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),eD(this.view))}update(e){for(let r of e.transactions)for(let n of r.effects)n.is(vg)&&!n.value.eq(this.query)&&this.setQuery(n.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(a0).top}}function Hi(t,e){return t.state.phrase(e)}const Vy=30,Wy=/[\s\.,:;?!]/;function O9(t,{from:e,to:r}){let n=t.state.doc.lineAt(e),i=t.state.doc.lineAt(r).to,s=Math.max(n.from,e-Vy),o=Math.min(i,r+Vy),a=t.state.sliceDoc(s,o);if(s!=n.from){for(let l=0;l<Vy;l++)if(!Wy.test(a[l+1])&&Wy.test(a[l])){a=a.slice(l);break}}if(o!=i){for(let l=a.length-1;l>a.length-Vy;l--)if(!Wy.test(a[l-1])&&Wy.test(a[l])){a=a.slice(0,l);break}}return ze.announce.of(`${t.state.phrase("current match")}. ${a} ${t.state.phrase("on line")} ${n.number}.`)}const jve=ze.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"}}),Uve=[cc,Ec.low($ve),jve];class oV{constructor(e,r,n,i){this.state=e,this.pos=r,this.explicit=n,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let r=_n(this.state).resolveInner(this.pos,-1);for(;r&&e.indexOf(r.name)<0;)r=r.parent;return r?{from:r.from,to:this.pos,text:this.state.sliceDoc(r.from,this.pos),type:r.type}:null}matchBefore(e){let r=this.state.doc.lineAt(this.pos),n=Math.max(r.from,this.pos-250),i=r.text.slice(n-r.from,this.pos-r.from),s=i.search(aV(e,!1));return s<0?null:{from:n+s,to:this.pos,text:i.slice(s)}}get aborted(){return this.abortListeners==null}addEventListener(e,r,n){e=="abort"&&this.abortListeners&&(this.abortListeners.push(r),n&&n.onDocChange&&(this.abortOnDocChange=!0))}}function tD(t){let e=Object.keys(t).join(""),r=/\w/.test(e);return r&&(e=e.replace(/\w/g,"")),`[${r?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function Gve(t){let e=Object.create(null),r=Object.create(null);for(let{label:i}of t){e[i[0]]=!0;for(let s=1;s<i.length;s++)r[i[s]]=!0}let n=tD(e)+tD(r)+"*$";return[new RegExp("^"+n),new RegExp(n)]}function Kve(t){let e=t.map(i=>typeof i=="string"?{label:i}:i),[r,n]=e.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:Gve(e);return i=>{let s=i.matchBefore(n);return s||i.explicit?{from:s?s.from:i.pos,options:e,validFor:r}:null}}function SDe(t,e){return r=>{for(let n=_n(r.state).resolveInner(r.pos,-1);n;n=n.parent){if(t.indexOf(n.name)>-1)return null;if(n.type.isTop)break}return e(r)}}class rD{constructor(e,r,n,i){this.completion=e,this.source=r,this.match=n,this.score=i}}function Yh(t){return t.selection.main.from}function aV(t,e){var r;let{source:n}=t,i=e&&n[0]!="^",s=n[n.length-1]!="$";return!i&&!s?t:new RegExp(`${i?"^":""}(?:${n})${s?"$":""}`,(r=t.flags)!==null&&r!==void 0?r:t.ignoreCase?"i":"")}const L9=ml.define();function Yve(t,e,r,n){let{main:i}=t.selection,s=r-i.from,o=n-i.from;return{...t.changeByRange(a=>{if(a!=i&&r!=n&&t.sliceDoc(a.from+s,a.from+o)!=t.sliceDoc(r,n))return{range:a};let l=t.toText(e);return{changes:{from:a.from+s,to:n==i.from?a.to:a.from+o,insert:l}
vendor: 4,337 bytes, line 112
112,range:ce.cursor(a.from+s+l.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const nD=new WeakMap;function Xve(t){if(!Array.isArray(t))return t;let e=nD.get(t);return e||nD.set(t,e=Kve(t)),e}const Px=kt.define(),wg=kt.define();class Jve{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let r=0;r<e.length;){let n=ki(e,r),i=Fo(n);this.chars.push(n);let s=e.slice(r,r+i),o=s.toUpperCase();this.folded.push(ki(o==s?s.toLowerCase():o,0)),r+=i}this.astral=e.length!=this.chars.length}ret(e,r){return this.score=e,this.matched=r,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:r,folded:n,any:i,precise:s,byWord:o}=this;if(r.length==1){let b=ki(e,0),x=Fo(b),S=x==e.length?0:-100;if(b!=r[0])if(b==n[0])S+=-200;else return null;return this.ret(S,[0,x])}let a=e.indexOf(this.pattern);if(a==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let l=r.length,c=0;if(a<0){for(let b=0,x=Math.min(e.length,200);b<x&&c<l;){let S=ki(e,b);(S==r[c]||S==n[c])&&(i[c++]=b),b+=Fo(S)}if(c<l)return null}let h=0,u=0,d=!1,f=0,p=-1,m=-1,g=/[a-z]/.test(e),y=!0;for(let b=0,x=Math.min(e.length,200),S=0;b<x&&u<l;){let k=ki(e,b);a<0&&(h<l&&k==r[h]&&(s[h++]=b),f<l&&(k==r[f]||k==n[f]?(f==0&&(p=b),m=b+1,f++):f=0));let w,_=k<255?k>=48&&k<=57||k>=97&&k<=122?2:k>=65&&k<=90?1:0:(w=F6(k))!=w.toLowerCase()?1:w!=w.toUpperCase()?2:0;(!b||_==1&&g||S==0&&_!=0)&&(r[u]==k||n[u]==k&&(d=!0)?o[u++]=b:o.length&&(y=!1)),S=_,b+=Fo(k)}return u==l&&o[0]==0&&y?this.result(-100+(d?-200:0),o,e):f==l&&p==0?this.ret(-200-e.length+(m==e.length?0:-100),[0,m]):a>-1?this.ret(-700-e.length,[a,a+this.pattern.length]):f==l?this.ret(-900-e.length,[p,m]):u==l?this.result(-100+(d?-200:0)+-700+(y?0:-1100),o,e):r.length==2?null:this.result((i[0]?-700:0)+-200+-1100,i,e)}result(e,r,n){let i=[],s=0;for(let o of r){let a=o+(this.astral?Fo(ki(n,o)):1);s&&i[s-1]==o?i[s-1]=a:(i[s++]=o,i[s++]=a)}return this.ret(e-n.length,i)}}class Zve{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let r=e.slice(0,this.pattern.length),n=r==this.pattern?0:r.toLowerCase()==this.folded?-200:null;return n==null?null:(this.matched=[0,r.length],this.score=n+(e.length==this.pattern.length?0:-100),this)}}const cn=Ne.define({combine(t){return oa(t,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:Qve,filterStrict:!1,compareCompletions:(e,r)=>e.label.localeCompare(r.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,r)=>e&&r,closeOnBlur:(e,r)=>e&&r,icons:(e,r)=>e&&r,tooltipClass:(e,r)=>n=>iD(e(n),r(n)),optionClass:(e,r)=>n=>iD(e(n),r(n)),addToOptions:(e,r)=>e.concat(r),filterStrict:(e,r)=>e||r})}});function iD(t,e){return t?e?t+" "+e:t:e}function Qve(t,e,r,n,i,s){let o=t.textDirection==vr.RTL,a=o,l=!1,c="top",h,u,d=e.left-i.left,f=i.right-e.right,p=n.right-n.left,m=n.bottom-n.top;if(a&&d<Math.min(p,f)?a=!1:!a&&f<Math.min(p,d)&&(a=!0),p<=(a?d:f))h=Math.max(i.top,Math.min(r.top,i.bottom-m))-e.top,u=Math.min(400,a?d:f);else{l=!0,u=Math.min(400,(o?e.right:i.right-e.left)-30);let b=i.bottom-e.bottom;b>=m||b>e.top?h=r.bottom-e.top:(c="bottom",h=e.bottom-r.top)}let g=(e.bottom-e.top)/s.offsetHeight,y=(e.right-e.left)/s.offsetWidth;return{style:`${c}: ${h/g}px; max-width: ${u/y}px`,class:"cm-completionInfo-"+(l?o?"left-narrow":"right-narrow":a?"left":"right")}}function ewe(t){let e=t.addToOptions.slice();return t.icons&&e.push({render(r){let n=document.createElement("div");return n.classList.add("cm-completionIcon"),r.type&&n.classList.add(...r.type.split(/\s+/g).map(i=>"cm-completionIcon-"+i)),n.setAttribute("aria-hidden","true"),n},position:20}),e.push({render(r,n,i,s){let o=document.createElement("span");o.className="cm-completionLabel";let a=r.displayLabel||r.label,l=0;for(let c=0;c<s.length;){let h=s[c++],u=s[c++];h>l&&o.appendChild(document.createTextNode(a.slice(l,h)));let d=o.appendChild(document.createElement("span"));d.appendChild(document.createTextNode(a.slice(h,u))),d.className="
112cm-completionMatchedText",l=u}return l<a.length&&o.appendChild(document.createTextNode(a.slice(l))),o},position:50},{render(r){if(!r.detail)return null;let n=document.createElement("span");return n.className="cm-completionDetail",n.textContent=r.detail,n},position:80}),e.sort((r,n)=>r.position-n.position).map(r=>r.render)}function dk(t,e,r){if(t<=r)return{from:0,to:t};if(e<0&&(e=0),e<=t>>1){let i=Math.floor(e/r);return{from:i*r,to:(i+1)*r}}let n=Math.floor((t-e)/r);return{from:t-(n+1)*r,to:t-n*r}}class twe{constructor(e,r,n){this.view=e,this.stateField=r,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:l=>this.placeInfo(l),key:this},this.space=null,this.currentClass="";let i=e.state.field(r),{options:s,selected:o}=i.open,a=e.state.facet(cn);this.optionContent=ewe(a),this.optionClass=a.optionClass,this.tooltipClass=a.tooltipClass,this.range=dk(s.length,o,a.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",l=>{let{options:c}=e.state.field(r).open;for(let h=l.target,u;h&&h!=this.dom;h=h.parentNode)if(h.nodeName=="LI"&&(u=/-(\d+)$/.exec(h.id))&&+u[1]<c.length){this.applyCompletion(e,c[+u[1]]),l.preventDefault();return}}),this.dom.addEventListener("focusout",l=>{let c=e.state.field(this.stateField,!1);c&&c.tooltip&&e.state.facet(cn).closeOnBlur&&l.relatedTarget!=e.contentDOM&&e.dispatch({effects:wg.of(null)})}),this.showOptions(s,i.id)}mount(){this.updateSel()}showOptions(e,r){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,r,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var r;let n=e.state.field(this.stateField),i=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),n!=i){let{options:s,selected:o,disabled:a}=n.open;(!i.open||i.open.options!=s)&&(this.range=dk(s.length,o,e.state.facet(cn).maxRenderedOptions),this.showOptions(s,n.id)),this.updateSel(),a!=((r=i.open)===null||r===void 0?void 0:r.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!a)}}updateTooltipClass(e){let r=this.tooltipClass(e);if(r!=this.currentClass){for(let n of this.currentClass.split(" "))n&&this.dom.classList.remove(n);for(let n of r.split(" "))n&&this.dom.classList.add(n);this.currentClass=r}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),r=e.open;if((r.selected>-1&&r.selected<this.range.from||r.selected>=this.range.to)&&(this.range=dk(r.options.length,r.selected,this.view.state.facet(cn).maxRenderedOptions),this.showOptions(r.options,e.id)),this.updateSelectedOption(r.selected)){this.destroyInfo();
vendor: 35,401 bytes, line 112
112let{completion:n}=r.options[r.selected],{info:i}=n;if(!i)return;let s=typeof i=="string"?document.createTextNode(i):i(n);if(!s)return;"then"in s?s.then(o=>{o&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(o,n)}).catch(o=>Mi(this.view.state,o,"completion info")):this.addInfoPane(s,n)}}addInfoPane(e,r){this.destroyInfo();let n=this.info=document.createElement("div");if(n.className="cm-tooltip cm-completionInfo",e.nodeType!=null)n.appendChild(e),this.infoDestroy=null;else{let{dom:i,destroy:s}=e;n.appendChild(i),this.infoDestroy=s||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let r=null;for(let n=this.list.firstChild,i=this.range.from;n;n=n.nextSibling,i++)n.nodeName!="LI"||!n.id?i--:i==e?n.hasAttribute("aria-selected")||(n.setAttribute("aria-selected","true"),r=n):n.hasAttribute("aria-selected")&&n.removeAttribute("aria-selected");return r&&nwe(this.list,r),r}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let r=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),i=e.getBoundingClientRect(),s=this.space;if(!s){let o=this.dom.ownerDocument.documentElement;s={left:0,top:0,right:o.clientWidth,bottom:o.clientHeight}}return i.top>Math.min(s.bottom,r.bottom)-10||i.bottom<Math.max(s.top,r.top)+10?null:this.view.state.facet(cn).positionInfo(this.view,r,i,n,s,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,r,n){const i=document.createElement("ul");i.id=r,i.setAttribute("role","listbox"),i.setAttribute("aria-expanded","true"),i.setAttribute("aria-label",this.view.state.phrase("Completions")),i.addEventListener("mousedown",o=>{o.target==i&&o.preventDefault()});let s=null;for(let o=n.from;o<n.to;o++){let{completion:a,match:l}=e[o],{section:c}=a;if(c){let d=typeof c=="string"?c:c.name;if(d!=s&&(o>n.from||n.from==0))if(s=d,typeof c!="string"&&c.header)i.appendChild(c.header(c));else{let f=i.appendChild(document.createElement("completion-section"));f.textContent=d}}const h=i.appendChild(document.createElement("li"));h.id=r+"-"+o,h.setAttribute("role","option");let u=this.optionClass(a);u&&(h.className=u);for(let d of this.optionContent){let f=d(a,this.view.state,this.view,l);f&&h.appendChild(f)}}return n.from&&i.classList.add("cm-completionListIncompleteTop"),n.to<e.length&&i.classList.add("cm-completionListIncompleteBottom"),i}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function rwe(t,e){return r=>new twe(r,t,e)}function nwe(t,e){let r=t.getBoundingClientRect(),n=e.getBoundingClientRect(),i=r.height/t.offsetHeight;n.top<r.top?t.scrollTop-=(r.top-n.top)/i:n.bottom>r.bottom&&(t.scrollTop+=(n.bottom-r.bottom)/i)}function sD(t){return(t.boost||0)*100+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}function iwe(t,e){let r=[],n=null,i=c=>{r.push(c);let{section:h}=c.completion;if(h){n||(n=[]);let u=typeof h=="string"?h:h.name;n.some(d=>d.name==u)||n.push(typeof h=="string"?{name:u}:h)}},s=e.facet(cn);for(let c of t)if(c.hasResult()){let h=c.result.getMatch;if(c.result.filter===!1)for(let u of c.result.options)i(new rD(u,c.source,h?h(u):[],1e9-r.length));else{let u=e.sliceDoc(c.from,c.to),d,f=s.filterStrict?new Zve(u):new Jve(u);for(let p of c.result.options)if(d=f.match(p.label)){let m=p.displayLabel?h?h(p,d.matched):[]:d.matched;i(new rD(p,c.source,m,d.score+(p.boost||0)))}}}if(n){let c=Object.create(null),h=0,u=(d,f)=>{var p,m;return((p=d.rank)!==null&&p!==void 0?p:1e9)-((m=f.rank)!==null&&m!==void 0?m:1e9)||(d.name<f.name?-1:1)};for(let d of n.sort(u))h-=1e5,c[d.name]=h;for(let d of r){let{section:f}=d.completion;f&&(d.score+=c[typeof f=="string"?f:f.name])}}let o=[],a=null,l=s.compareCompletions;for(let c of r.sort((h,u)=>u.score-h.score||l(h.completion,u.completion))){let h=c.completion;!a||a.label!=h.label||a.detail!=h.detail||a.type!=null&&h.type!=null&&a.type!=h.type||a.apply!=h.apply||a.boost!=h.boost?o.push(c):sD(c.completion)>sD(a)&&(o[o.length-1]=c),a=c.completion}return o}class fd{constructor(e,r,n,i,s,o){this.options=e,this.attrs=r,this.tooltip=n,this.timestamp=i,this.selected=s,this.disabled=o}setSelected(e,r){return e==this.selected||e>=this.options.length?this:new fd(this.options,oD(r,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,r,n,i,s,o){if(i&&!o&&e.some(c=>c.isPending))return i.setDisabled();let a=iwe(e,r);if(!a.length)return i&&e.some(c=>c.isPending)?i.setDisabled():null;let l=r.facet(cn).selectOnOpen?0:-1;if(i&&i.selected!=l&&i.selected!=-1){let c=i.options[i.selected].completion;for(let h=0;h<a.length;h++)if(a[h].completion==c){l=h;break}}return new fd(a,oD(n,l),{pos:e.reduce((c,h)=>h.hasResult()?Math.min(c,h.from):c,1e8),create:hwe,above:s.aboveCursor},i?i.timestamp:Date.now(),l,!1)}map(e){return new fd(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new fd(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class Nx{constructor(e,r,n){this.active=e,this.id=r,this.open=n}static start(){return new Nx(lwe,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:r}=e,n=r.facet(cn),s=(n.override||r.languageDataAt("autocomplete",Yh(r)).map(Xve)).map(l=>(this.active.find(h=>h.source==l)||new Ss(l,this.active.some(h=>h.state!=0)?1:0)).update(e,n));s.length==this.active.length&&s.every((l,c)=>l==this.active[c])&&(s=this.active);let o=this.open,a=e.effects.some(l=>l.is(D9));o&&e.docChanged&&(o=o.map(e.changes)),e.selection||s.some(l=>l.hasResult()&&e.changes.touchesRange(l.from,l.to))||!swe(s,this.active)||a?o=fd.build(s,r,this.id,o,n,a):o&&o.disabled&&!s.some(l=>l.isPending)&&(o=null),!o&&s.every(l=>!l.isPending)&&s.some(l=>l.hasResult())&&(s=s.map(l=>l.hasResult()?new Ss(l.source,0):l));for(let l of e.effects)l.is(cV)&&(o=o&&o.setSelected(l.value,this.id));return s==this.active&&o==this.open?this:new Nx(s,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?owe:awe}}function swe(t,e){if(t==e)return!0;for(let r=0,n=0;;){for(;r<t.length&&!t[r].hasResult();)r++;for(;n<e.length&&!e[n].hasResult();)n++;let i=r==t.length,s=n==e.length;if(i||s)return i==s;if(t[r++].result!=e[n++].result)return!1}}const owe={"aria-autocomplete":"list"},awe={};function oD(t,e){let r={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":t};return e>-1&&(r["aria-activedescendant"]=t+"-"+e),r}const lwe=[];function lV(t,e){if(t.isUserEvent("input.complete")){let n=t.annotation(L9);if(n&&e.activateOnCompletion(n))return 12}let r=t.isUserEvent("input.type");return r&&e.activateOnTyping?5:r?1:t.isUserEvent("delete.backward")?2:t.selection?8:t.docChanged?16:0}class Ss{constructor(e,r,n=!1){this.source=e,this.state=r,this.explicit=n}hasResult(){return!1}get isPending(){return this.state==1}update(e,r){let n=lV(e,r),i=this;(n&8||n&16&&this.touches(e))&&(i=new Ss(i.source,0)),n&4&&i.state==0&&(i=new Ss(this.source,1)),i=i.updateFor(e,n);for(let s of e.effects)if(s.is(Px))i=new Ss(i.source,1,s.value);else if(s.is(wg))i=new Ss(i.source,0);else if(s.is(D9))for(let o of s.value)o.source==i.source&&(i=o);return i}updateFor(e,r){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(Yh(e.state))}}class Ad extends Ss{constructor(e,r,n,i,s,o){super(e,3,r),this.limit=n,this.result=i,this.from=s,this.to=o}hasResult(){return!0}updateFor(e,r){var n;if(!(r&3))return this.map(e.changes);let i=this.result;i.map&&!e.changes.empty&&(i=i.map(i,e.changes));let s=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),a=Yh(e.state);if(a>o||!i||r&2&&(Yh(e.startState)==this.from||a<this.limit))return new Ss(this.source,r&4?1:0);let l=e.changes.mapPos(this.limit);return cwe(i.validFor,e.state,s,o)?new Ad(this.source,this.explicit,l,i,s,o):i.update&&(i=i.update(i,s,o,new oV(e.state,a,!1)))?new Ad(this.source,this.explicit,l,i,i.from,(n=i.to)!==null&&n!==void 0?n:Yh(e.state)):new Ss(this.source,1,this.explicit)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new Ad(this.source,this.explicit,e.mapPos(this.limit),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new Ss(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}function cwe(t,e,r,n){if(!t)return!1;let i=e.sliceDoc(r,n);return typeof t=="function"?t(i,r,n,e):aV(t,!0).test(i)}const D9=kt.define({map(t,e){return t.map(r=>r.map(e))}}),cV=kt.define(),Si=fn.define({create(){return Nx.start()},update(t,e){return t.update(e)},provide:t=>[Z6.from(t,e=>e.tooltip),ze.contentAttributes.from(t,e=>e.attrs)]});function I9(t,e){const r=e.completion.apply||e.completion.label;let n=t.state.field(Si).active.find(i=>i.source==e.source);return n instanceof Ad?(typeof r=="string"?t.dispatch({...Yve(t.state,r,n.from,n.to),annotations:L9.of(e.completion)}):r(t,e.completion,n.from,n.to),!0):!1}const hwe=rwe(Si,I9);function jy(t,e="option"){return r=>{let n=r.state.field(Si,!1);if(!n||!n.open||n.open.disabled||Date.now()-n.open.timestamp<r.state.facet(cn).interactionDelay)return!1;let i=1,s;e=="page"&&(s=WP(r,n.open.tooltip))&&(i=Math.max(2,Math.floor(s.dom.offsetHeight/s.dom.querySelector("li").offsetHeight)-1));let{length:o}=n.open.options,a=n.open.selected>-1?n.open.selected+i*(t?1:-1):t?0:o-1;return a<0?a=e=="page"?0:o-1:a>=o&&(a=e=="page"?o-1:0),r.dispatch({effects:cV.of(a)}),!0}}const uwe=t=>{let e=t.state.field(Si,!1);return t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<t.state.facet(cn).interactionDelay?!1:I9(t,e.open.options[e.open.selected])},fk=t=>t.state.field(Si,!1)?(t.dispatch({effects:Px.of(!0)}),!0):!1,dwe=t=>{let e=t.state.field(Si,!1);return!e||!e.active.some(r=>r.state!=0)?!1:(t.dispatch({effects:wg.of(null)}),!0)};class fwe{constructor(e,r){this.active=e,this.context=r,this.time=Date.now(),this.updates=[],this.done=void 0}}const pwe=50,mwe=1e3,gwe=Kr.fromClass(class{constructor(t){this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of t.state.field(Si).active)e.isPending&&this.startQuery(e)}update(t){let e=t.state.field(Si),r=t.state.facet(cn);if(!t.selectionSet&&!t.docChanged&&t.startState.field(Si)==e)return;let n=t.transactions.some(s=>{let o=lV(s,r);return o&8||(s.selection||s.docChanged)&&!(o&3)});for(let s=0;s<this.running.length;s++){let o=this.running[s];if(n||o.context.abortOnDocChange&&t.docChanged||o.updates.length+t.transactions.length>pwe&&Date.now()-o.time>mwe){for(let a of o.context.abortListeners)try{a()}catch(l){Mi(this.view.state,l)}o.context.abortListeners=null,this.running.splice(s--,1)}else o.updates.push(...t.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),t.transactions.some(s=>s.effects.some(o=>o.is(Px)))&&(this.pendingStart=!0);let i=this.pendingStart?50:r.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(s=>s.isPending&&!this.running.some(o=>o.active.source==s.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let s of t.transactions)s.isUserEvent("input.type")?this.composing=2:this.composing==2&&s.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:t}=this.view,e=t.field(Si);for(let r of e.active)r.isPending&&!this.running.some(n=>n.active.source==r.source)&&this.startQuery(r);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(cn).updateSyncTime))}startQuery(t){let{state:e}=this.view,r=Yh(e),n=new oV(e,r,t.explicit,this.view),i=new fwe(t,n);this.running.push(i),Promise.resolve(t.source(n)).then(s=>{i.context.aborted||(i.done=s||null,this.scheduleAccept())},s=>{this.view.dispatch({effects:wg.of(null)}),Mi(this.view.state,s)})}scheduleAccept(){this.running.every(t=>t.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(cn).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],r=this.view.state.facet(cn),n=this.view.state.field(Si);for(let i=0;i<this.running.length;i++){let s=this.running[i];if(s.done===void 0)continue;if(this.running.splice(i--,1),s.done){let a=Yh(s.updates.length?s.updates[0].startState:this.view.state),l=Math.min(a,s.done.from+(s.active.explicit?0:1)),c=new Ad(s.active.source,s.active.explicit,l,s.done,s.done.from,(t=s.done.to)!==null&&t!==void 0?t:a);for(let h of s.updates)c=c.update(h,r);if(c.hasResult()){e.push(c);continue}}let o=n.active.find(a=>a.source==s.active.source);if(o&&o.isPending)if(s.done==null){let a=new Ss(s.active.source,0);for(let l of s.updates)a=a.update(l,r);a.isPending||e.push(a)}else this.startQuery(o)}(e.length||n.open&&n.open.disabled)&&this.view.dispatch({effects:D9.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field(Si,!1);if(e&&e.tooltip&&this.view.state.facet(cn).closeOnBlur){let r=e.open&&WP(this.view,e.open.tooltip);(!r||!r.dom.contains(t.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:wg.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:Px.of(!1)}),20),this.composing=0}}}),ywe=typeof navigator=="object"&&/Win/.test(navigator.platform),bwe=Ec.highest(ze.domEventHandlers({keydown(t,e){let r=e.state.field(Si,!1);if(!r||!r.open||r.open.disabled||r.open.selected<0||t.key.length>1||t.ctrlKey&&!(ywe&&t.altKey)||t.metaKey)return!1;let n=r.open.options[r.open.selected],i=r.active.find(o=>o.source==n.source),s=n.completion.commitCharacters||i.result.commitCharacters;return s&&s.indexOf(t.key)>-1&&I9(e,n),!1}})),hV=ze.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:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&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:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class xwe{constructor(e,r,n,i){this.field=e,this.line=r,this.from=n,this.to=i}}class B9{constructor(e,r,n){this.field=e,this.from=r,this.to=n}map(e){let r=e.mapPos(this.from,-1,Sn.TrackDel),n=e.mapPos(this.to,1,Sn.TrackDel);return r==null||n==null?null:new B9(this.field,r,n)}}class R9{constructor(e,r){this.lines=e,this.fieldPositions=r}instantiate(e,r){let n=[],i=[r],s=e.doc.lineAt(r),o=/^\s*/.exec(s.text)[0];for(let l of this.lines){if(n.length){let c=o,h=/^\t*/.exec(l)[0].length;for(let u=0;u<h;u++)c+=e.facet(Vv);i.push(r+c.length-h),l=c+l.slice(h)}n.push(l),r+=l.length+1}let a=this.fieldPositions.map(l=>new B9(l.field,i[l.line]+l.from,i[l.line]+l.to));return{text:n,ranges:a}}static parse(e){let r=[],n=[],i=[],s;for(let o of e.split(/\r\n?|\n/)){for(;s=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(o);){let a=s[1]?+s[1]:null,l=s[2]||s[3]||"",c=-1,h=l.replace(/\\[{}]/g,u=>u[1]);for(let u=0;u<r.length;u++)(a!=null?r[u].seq==a:h&&r[u].name==h)&&(c=u);if(c<0){let u=0;for(;u<r.length&&(a==null||r[u].seq!=null&&r[u].seq<a);)u++;r.splice(u,0,{seq:a,name:h}),c=u;for(let d of i)d.field>=c&&d.field++}for(let u of i)if(u.line==n.length&&u.from>s.index){let d=s[2]?3+(s[1]||"").length:2;u.from-=d,u.to-=d}i.push(new xwe(c,n.length,s.index,s.index+h.length)),o=o.slice(0,s.index)+l+o.slice(s.index+s[0].length)}o=o.replace(/\\([{}])/g,(a,l,c)=>{for(let h of i)h.line==n.length&&h.from>c&&(h.from--,h.to--);return l}),n.push(o)}return new R9(n,i)}}let vwe=st.widget({widget:new class extends gl{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),wwe=st.mark({class:"cm-snippetField"});class l0{constructor(e,r){this.ranges=e,this.active=r,this.deco=st.set(e.map(n=>(n.from==n.to?vwe:wwe).range(n.from,n.to)),!0)}map(e){let r=[];for(let n of this.ranges){let i=n.map(e);if(!i)return null;r.push(i)}return new l0(r,this.active)}selectionInsideField(e){return e.ranges.every(r=>this.ranges.some(n=>n.field==this.active&&n.from<=r.from&&n.to>=r.to))}}const V1=kt.define({map(t,e){return t&&t.map(e)}}),kwe=kt.define(),kg=fn.define({create(){return null},update(t,e){for(let r of e.effects){if(r.is(V1))return r.value;if(r.is(kwe)&&t)return new l0(t.ranges,r.value)}return t&&e.docChanged&&(t=t.map(e.changes)),t&&e.selection&&!t.selectionInsideField(e.selection)&&(t=null),t},provide:t=>ze.decorations.from(t,e=>e?e.deco:st.none)});function P9(t,e){return ce.create(t.filter(r=>r.field==e).map(r=>ce.range(r.from,r.to)))}function Cwe(t){let e=R9.parse(t);return(r,n,i,s)=>{let{text:o,ranges:a}=e.instantiate(r.state,i),{main:l}=r.state.selection,c={changes:{from:i,to:s==l.from?l.to:s,insert:Wt.of(o)},scrollIntoView:!0,annotations:n?[L9.of(n),oi.userEvent.of("input.complete")]:void 0};if(a.length&&(c.selection=P9(a,0)),a.some(h=>h.field>0)){let h=new l0(a,0),u=c.effects=[V1.of(h)];r.state.field(kg,!1)===void 0&&u.push(kt.appendConfig.of([kg,Awe,Ewe,hV]))}r.dispatch(r.state.update(c))}}function uV(t){return({state:e,dispatch:r})=>{let n=e.field(kg,!1);if(!n||t<0&&n.active==0)return!1;let i=n.active+t,s=t>0&&!n.ranges.some(o=>o.field==i+t);return r(e.update({selection:P9(n.ranges,i),effects:V1.of(s?null:new l0(n.ranges,i)),scrollIntoView:!0})),!0}}const Swe=({state:t,dispatch:e})=>t.field(kg,!1)?(e(t.update({effects:V1.of(null)})),!0):!1,Twe=uV(1),_we=uV(-1),Mwe=[{key:"Tab",run:Twe,shift:_we},{key:"Escape",run:Swe}],aD=Ne.define({combine(t){return t.length?t[0]:Mwe}}),Awe=Ec.highest(Yf.compute([aD],t=>t.facet(aD)));function TDe(t,e){return{...e,apply:Cwe(t)}}const Ewe=ze.domEventHandlers({mousedown(t,e){let r=e.state.field(kg,!1),n;if(!r||(n=e.posAtCoords({x:t.clientX,y:t.clientY}))==null)return!1;let i=r.ranges.find(s=>s.from<=n&&s.to>=n);return!i||i.field==r.active?!1:(e.dispatch({selection:P9(r.ranges,i.field),effects:V1.of(r.ranges.some(s=>s.field>i.field)?new l0(r.ranges,i.field):null),scrollIntoView:!0}),!0)}}),Cg={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},xh=kt.define({map(t,e){let r=e.mapPos(t,-1,Sn.TrackAfter);return r??void 0}}),N9=new class extends eu{};N9.startSide=1;N9.endSide=-1;const dV=fn.define({create(){return Ht.empty},update(t,e){if(t=t.map(e.changes),e.selection){let r=e.state.doc.lineAt(e.selection.main.head);t=t.update({filter:n=>n>=r.from&&n<=r.to})}for(let r of e.effects)r.is(xh)&&(t=t.update({add:[N9.range(r.value,r.value+1)]}));return t}});function Owe(){return[Dwe,dV]}const pk="()[]{}<>«»»«[]{}";function fV(t){for(let e=0;e<pk.length;e+=2)if(pk.charCodeAt(e)==t)return pk.charAt(e+1);return F6(t<128?t:t+1)}function pV(t,e){return t.languageDataAt("closeBrackets",e)[0]||Cg}const Lwe=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),Dwe=ze.inputHandler.of((t,e,r,n)=>{if((Lwe?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let i=t.state.selection.main;if(n.length>2||n.length==2&&Fo(ki(n,0))==1||e!=i.from||r!=i.to)return!1;let s=Rwe(t.state,n);return s?(t.dispatch(s),!0):!1}),Iwe=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=pV(t,t.selection.main.head).brackets||Cg.brackets,i=null,s=t.changeByRange(o=>{if(o.empty){let a=Pwe(t.doc,o.head);for(let l of n)if(l==a&&qw(t.doc,o.head)==fV(ki(l,0)))return{changes:{from:o.head-l.length,to:o.head+l.length},range:ce.cursor(o.head-l.length)}}return{range:i=o}});return i||e(t.update(s,{scrollIntoView:!0,userEvent:"delete.backward"})),!i},Bwe=[{key:"Backspace",run:Iwe}];function Rwe(t,e){let r=pV(t,t.selection.main.head),n=r.brackets||Cg.brackets;for(let i of n){let s=fV(ki(i,0));if(e==i)return s==i?$we(t,i,n.indexOf(i+i+i)>-1,r):Nwe(t,i,s,r.before||Cg.before);if(e==s&&mV(t,t.selection.main.from))return Fwe(t,i,s)}return null}function mV(t,e){let r=!1;return t.field(dV).between(0,t.doc.length,n=>{n==e&&(r=!0)}),r}function qw(t,e){let r=t.sliceString(e,e+2);return r.slice(0,Fo(ki(r,0)))}function Pwe(t,e){let r=t.sliceString(e-2,e);return Fo(ki(r,0))==r.length?r:r.slice(1)}function Nwe(t,e,r,n){let i=null,s=t.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:r,from:o.to}],effects:xh.of(o.to+e.length),range:ce.range(o.anchor+e.length,o.head+e.length)};let a=qw(t.doc,o.head);return!a||/\s/.test(a)||n.indexOf(a)>-1?{changes:{insert:e+r,from:o.head},effects:xh.of(o.head+e.length),range:ce.cursor(o.head+e.length)}:{range:i=o}});return i?null:t.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function Fwe(t,e,r){let n=null,i=t.changeByRange(s=>s.empty&&qw(t.doc,s.head)==r?{changes:{from:s.head,to:s.head+r.length,insert:r},range:ce.cursor(s.head+r.length)}:n={range:s});return n?null:t.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function $we(t,e,r,n){let i=n.stringPrefixes||Cg.stringPrefixes,s=null,o=t.changeByRange(a=>{if(!a.empty)return{changes:[{insert:e,from:a.from},{insert:e,from:a.to}],effects:xh.of(a.to+e.length),range:ce.range(a.anchor+e.length,a.head+e.length)};let l=a.head,c=qw(t.doc,l),h;if(c==e){if(lD(t,l))return{changes:{insert:e+e,from:l},effects:xh.of(l+e.length),range:ce.cursor(l+e.length)};if(mV(t,l)){let d=r&&t.sliceDoc(l,l+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:l,to:l+d.length,insert:d},range:ce.cursor(l+d.length)}}}else{if(r&&t.sliceDoc(l-2*e.length,l)==e+e&&(h=cD(t,l-2*e.length,i))>-1&&lD(t,h))return{changes:{insert:e+e+e+e,from:l},effects:xh.of(l+e.length),range:ce.cursor(l+e.length)};if(t.charCategorizer(l)(c)!=Sr.Word&&cD(t,l,i)>-1&&!zwe(t,l,e,i))return{changes:{insert:e+e,from:l},effects:xh.of(l+e.length),range:ce.cursor(l+e.length)}}return{range:s=a}});return s?null:t.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function lD(t,e){let r=_n(t).resolveInner(e+1);return r.parent&&r.from==e}function zwe(t,e,r,n){let i=_n(t).resolveInner(e,-1),s=n.reduce((o,a)=>Math.max(o,a.length),0);for(let o=0;o<5;o++){let a=t.sliceDoc(i.from,Math.min(i.to,i.from+r.length+s)),l=a.indexOf(r);if(!l||l>-1&&n.indexOf(a.slice(0,l))>-1){let h=i.firstChild;for(;h&&h.from==i.from&&h.to-h.from>r.length+l;){if(t.sliceDoc(h.to-r.length,h.to)==r)return!1;h=h.firstChild}return!0}let c=i.to==e&&i.parent;if(!c)break;i=c}return!1}function cD(t,e,r){let n=t.charCategorizer(e);if(n(t.sliceDoc(e-1,e))!=Sr.Word)return e;for(let i of r){let s=e-i.length;if(t.sliceDoc(s,e)==i&&n(t.sliceDoc(s-1,s))!=Sr.Word)return s}return-1}function Hwe(t={}){return[bwe,Si,cn.of(t),gwe,qwe,hV]}const gV=[{key:"Ctrl-Space",run:fk},{mac:"Alt-`",run:fk},{mac:"Alt-i",run:fk},{key:"Escape",run:dwe},{key:"ArrowDown",run:jy(!0)},{key:"ArrowUp",run:jy(!1)},{key:"PageDown",run:jy(!0,"page")},{key:"PageUp",run:jy(!1,"page")},{key:"Enter",run:uwe}],qwe=Ec.highest(Yf.computeN([cn],t=>t.facet(cn).defaultKeymap?[gV]:[]));class hD{constructor(e,r,n){this.from=e,this.to=r,this.diagnostic=n}}class uh{constructor(e,r,n){this.diagnostics=e,this.panel=r,this.selected=n}static init(e,r,n){let i=n.facet(Sg).markerFilter;i&&(e=i(e,n));let s=e.slice().sort((h,u)=>h.from-u.from||h.to-u.to),o=new rl,a=[],l=0;for(let h=0;;){let u=h==s.length?null:s[h];if(!u&&!a.length)break;let d,f;for(a.length?(d=l,f=a.reduce((m,g)=>Math.min(m,g.to),u&&u.from>d?u.from:1e8)):(d=u.from,f=u.to,a.push(u),h++);h<s.length;){let m=s[h];if(m.from==d&&(m.to>m.from||m.to==d))a.push(m),h++,f=Math.min(m.to,f);else{f=Math.min(m.from,f);break}}let p=t4e(a);if(a.some(m=>m.from==m.to||m.from==m.to-1&&n.doc.lineAt(m.from).to==m.from))o.add(d,d,st.widget({widget:new Jwe(p),diagnostics:a.slice()}));else{let m=a.reduce((g,y)=>y.markClass?g+" "+y.markClass:g,"");o.add(d,f,st.mark({class:"cm-lintRange cm-lintRange-"+p+m,diagnostics:a.slice(),inclusiveEnd:a.some(g=>g.to>f)}))}l=f;for(let m=0;m<a.length;m++)a[m].to<=l&&a.splice(m--,1)}let c=o.finish();return new uh(c,r,Df(c))}}function Df(t,e=null,r=0){let n=null;return t.between(r,1e9,(i,s,{spec:o})=>{if(!(e&&o.diagnostics.indexOf(e)<0))if(!n)n=new hD(i,s,e||o.diagnostics[0]);else{if(o.diagnostics.indexOf(n.diagnostic)<0)return!1;n=new hD(n.from,s,n.diagnostic)}}),n}function Vwe(t,e){let r=e.pos,n=e.end||r,i=t.state.facet(Sg).hideOn(t,r,n);if(i!=null)return i;let s=t.startState.doc.lineAt(e.pos);return!!(t.effects.some(o=>o.is(yV))||t.changes.touchesRange(s.from,Math.max(s.to,n)))}function Wwe(t,e){return t.field(ts,!1)?e:e.concat(kt.appendConfig.of(r4e))}const yV=kt.define(),F9=kt.define(),bV=kt.define(),ts=fn.define({create(){return new uh(st.none,null,null)},update(t,e){if(e.docChanged&&t.diagnostics.size){let r=t.diagnostics.map(e.changes),n=null,i=t.panel;if(t.selected){let s=e.changes.mapPos(t.selected.from,1);n=Df(r,t.selected.diagnostic,s)||Df(r,null,s)}!r.size&&i&&e.state.facet(Sg).autoPanel&&(i=null),t=new uh(r,i,n)}for(let r of e.effects)if(r.is(yV)){let n=e.state.facet(Sg).autoPanel?r.value.length?Tg.open:null:t.panel;t=uh.init(r.value,n,e.state)}else r.is(F9)?t=new uh(t.diagnostics,r.value?Tg.open:null,t.selected):r.is(bV)&&(t=new uh(t.diagnostics,t.panel,r.value));return t},provide:t=>[Qm.from(t,e=>e.panel),ze.decorations.from(t,e=>e.diagnostics)]}),jwe=st.mark({class:"cm-lintRange cm-lintRange-active"});function Uwe(t,e,r){let{diagnostics:n}=t.state.field(ts),i,s=-1,o=-1;n.between(e-(r<0?1:0),e+(r>0?1:0),(l,c,{spec:h})=>{if(e>=l&&e<=c&&(l==c||(e>l||r>0)&&(e<c||r<0)))return i=h.diagnostics,s=l,o=c,!1});let a=t.state.facet(Sg).tooltipFilter;return i&&a&&(i=a(i,t.state)),i?{pos:s,end:o,above:t.state.doc.lineAt(s).to<o,create(){return{dom:Gwe(t,i)}}}:null}function Gwe(t,e){return ir("ul",{class:"cm-tooltip-lint"},e.map(r=>vV(t,r,!1)))}const Kwe=t=>{let e=t.state.field(ts,!1);(!e||!e.panel)&&t.dispatch({effects:Wwe(t.state,[F9.of(!0)])});let r=Zm(t,Tg.open);return r&&r.dom.querySelector(".cm-panel-lint ul").focus(),!0},uD=t=>{let e=t.state.field(ts,!1);return!e||!e.panel?!1:(t.dispatch({effects:F9.of(!1)}),!0)},Ywe=t=>{let e=t.state.field(ts,!1);if(!e)return!1;let r=t.state.selection.main,n=e.diagnostics.iter(r.to+1);return!n.value&&(n=e.diagnostics.iter(0),!n.value||n.from==r.from&&n.to==r.to)?!1:(t.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0}),!0)},Xwe=[{key:"Mod-Shift-m",run:Kwe,preventDefault:!0},{key:"F8",run:Ywe}],Sg=Ne.define({combine(t){return Object.assign({sources:t.map(e=>e.source).filter(e=>e!=null)},oa(t.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{needsRefresh:(e,r)=>e?r?n=>e(n)||r(n):e:r}))}});function xV(t){let e=[];if(t)e:for(let{name:r}of t){for(let n=0;n<r.length;n++){let i=r[n];if(/[a-zA-Z]/.test(i)&&!e.some(s=>s.toLowerCase()==i.toLowerCase())){e.push(i);continue e}}e.push("")}return e}function vV(t,e,r){var n;let i=r?xV(e.actions):[];return ir("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},ir("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(t):e.message),(n=e.actions)===null||n===void 0?void 0:n.map((s,o)=>{let a=!1,l=d=>{if(d.preventDefault(),a)return;a=!0;let f=Df(t.state.field(ts).diagnostics,e);f&&s.apply(t,f.from,f.to)},{name:c}=s,h=i[o]?c.indexOf(i[o]):-1,u=h<0?c:[c.slice(0,h),ir("u",c.slice(h,h+1)),c.slice(h+1)];return ir("button",{type:"button",class:"cm-diagnosticAction",onclick:l,onmousedown:l,"aria-label":` Action: ${c}${h<0?"":` (access key "${i[o]})"`}.`},u)}),e.source&&ir("div",{class:"cm-diagnosticSource"},e.source))}class Jwe extends gl{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return ir("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class dD{constructor(e,r){this.diagnostic=r,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=vV(e,r,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class Tg{constructor(e){this.view=e,this.items=[];let r=i=>{if(i.keyCode==27)uD(this.view),this.view.focus();else if(i.keyCode==38||i.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(i.keyCode==40||i.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(i.keyCode==36)this.moveSelection(0);else if(i.keyCode==35)this.moveSelection(this.items.length-1);else if(i.keyCode==13)this.view.focus();else if(i.keyCode>=65&&i.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:s}=this.items[this.selectedIndex],o=xV(s.actions);for(let a=0;a<o.length;a++)if(o[a].toUpperCase().charCodeAt(0)==i.keyCode){let l=Df(this.view.state.field(ts).diagnostics,s);l&&s.actions[a].apply(e,l.from,l.to)}}else return;i.preventDefault()},n=i=>{for(let s=0;s<this.items.length;s++)this.items[s].dom.contains(i.target)&&this.moveSelection(s)};this.list=ir("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:r,onclick:n}),this.dom=ir("div",{class:"cm-panel-lint"},this.list,ir("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>uD(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(ts).selected;if(!e)return-1;for(let r=0;r<this.items.length;r++)if(this.items[r].diagnostic==e.diagnostic)return r;return-1}update(){let{diagnostics:e,selected:r}=this.view.state.field(ts),n=0,i=!1,s=null,o=new Set;for(e.between(0,this.view.state.doc.length,(a,l,{spec:c})=>{for(let h of c.diagnostics){if(o.has(h))continue;o.add(h);let u=-1,d;for(let f=n;f<this.items.length;f++)if(this.items[f].diagnostic==h){u=f;break}u<0?(d=new dD(this.view,h),this.items.splice(n,0,d),i=!0):(d=this.items[u],u>n&&(this.items.splice(n,u-n),i=!0)),r&&d.diagnostic==r.diagnostic?d.dom.hasAttribute("aria-selected")||(d.dom.setAttribute("aria-selected","true"),s=d):d.dom.hasAttribute("aria-selected")&&d.dom.removeAttribute("aria-selected"),n++}});n<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)i=!0,this.items.pop();this.items.length==0&&(this.items.push(new dD(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),i=!0),s?(this.list.setAttribute("aria-activedescendant",s.id),this.view.requestMeasure({key:this,read:()=>({sel:s.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:a,panel:l})=>{let c=l.height/this.list.offsetHeight;a.top<l.top?this.list.scrollTop-=(l.top-a.top)/c:a.bottom>l.bottom&&(this.list.scrollTop+=(a.bottom-l.bottom)/c)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),i&&this.sync()}sync(){let e=this.list.firstChild;function r(){let n=e;e=n.nextSibling,n.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)r();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)r()}moveSelection(e){if(this.selectedIndex<0)return;let r=this.view.state.field(ts),n=Df(r.diagnostics,this.items[e].diagnostic);n&&this.view.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0,effects:bV.of(n)})}static open(e){return new Tg(e)}}function Zwe(t,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${e}>${encodeURIComponent(t)}</svg>')`}function Uy(t){return Zwe(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${t}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const Qwe=ze.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:Uy("#d11")},".cm-lintRange-warning":{backgroundImage:Uy("orange")},".cm-lintRange-info":{backgroundImage:Uy("#999")},".cm-lintRange-hint":{backgroundImage:Uy("#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}}});
112function e4e(t){return t=="error"?4:t=="warning"?3:t=="info"?2:1}function t4e(t){let e="hint",r=1;for(let n of t){let i=e4e(n.severity);i>r&&(r=i,e=n.severity)}return e}const r4e=[ts,ze.decorations.compute([ts],t=>{let{selected:e,panel:r}=t.field(ts);return!e||!r||e.from==e.to?st.none:st.set([jwe.range(e.from,e.to)])}),ase(Uwe,{hideOn:Vwe}),Qwe],n4e=[bse(),wse(),Fie(),Kbe(),noe(),zP(),Die(),Tr.allowMultipleSelections.of(!0),Vse(),cN(aoe,{fallback:!0}),poe(),Owe(),Hwe(),Xie(),Qie(),Wie(),Sve(),Yf.of([...Bwe,...Uq,...Vve,...nxe,...Qse,...gV,...Xwe])];function i4e(t={}){return new _r({view(e){return new s4e(e,t)}})}class s4e{constructor(e,r){var n;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(n=r.width)!==null&&n!==void 0?n:1,this.color=r.color===!1?void 0:r.color||"black",this.class=r.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let s=o=>{this[i](o)};return e.dom.addEventListener(i,s),{name:i,handler:s}})}destroy(){this.handlers.forEach(({name:e,handler:r})=>this.editorView.dom.removeEventListener(e,r))}update(e,r){this.cursorPos!=null&&r.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),r=!e.parent.inlineContent,n,i=this.editorView.dom,s=i.getBoundingClientRect(),o=s.width/i.offsetWidth,a=s.height/i.offsetHeight;if(r){let u=e.nodeBefore,d=e.nodeAfter;if(u||d){let f=this.editorView.nodeDOM(this.cursorPos-(u?u.nodeSize:0));if(f){let p=f.getBoundingClientRect(),m=u?p.bottom:p.top;u&&d&&(m=(m+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let g=this.width/2*a;n={left:p.left,right:p.right,top:m-g,bottom:m+g}}}}if(!n){let u=this.editorView.coordsAtPos(this.cursorPos),d=this.width/2*o;n={left:u.left-d,right:u.left+d,top:u.top,bottom:u.bottom}}let l=this.editorView.dom.offsetParent;this.element||(this.element=l.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",r),this.element.classList.toggle("prosemirror-dropcursor-inline",!r);let c,h;if(!l||l==document.body&&getComputedStyle(l).position=="static")c=-pageXOffset,h=-pageYOffset;else{let u=l.getBoundingClientRect(),d=u.width/l.offsetWidth,f=u.height/l.offsetHeight;c=u.left-l.scrollLeft*d,h=u.top-l.scrollTop*f}this.element.style.left=(n.left-c)/o+"px",this.element.style.top=(n.top-h)/a+"px",this.element.style.width=(n.right-n.left)/o+"px",this.element.style.height=(n.bottom-n.top)/a+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let r=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=r&&r.inside>=0&&this.editorView.state.doc.nodeAt(r.inside),i=n&&n.type.spec.disableDropCursor,s=typeof i=="function"?i(this.editorView,r,e):i;if(r&&!s){let o=r.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=jN(this.editorView.state.doc,o,this.editorView.dragging.slice);a!=null&&(o=a)}this.setCursor(o),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class Rr extends gt{constructor(e){super(e,e)}map(e,r){let n=e.resolve(r.map(this.head));return Rr.valid(n)?new Rr(n):gt.near(n)}content(){return Ie.empty}eq(e){return e instanceof Rr&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,r){if(typeof r.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Rr(e.resolve(r.pos))}getBookmark(){return new $9(this.anchor)}static valid(e){let r=e.parent;if(r.isTextblock||!o4e(e)||!a4e(e))return!1;let n=r.type.spec.allowGapCursor;if(n!=null)return n;let i=r.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,r,n=!1){e:for(;;){if(!n&&Rr.valid(e))return e;let i=e.pos,s=null;for(let o=e.depth;;o--){let a=e.node(o);if(r>
vendor: 1,333 bytes, line 112
1120?e.indexAfter(o)<a.childCount:e.index(o)>0){s=a.child(r>0?e.indexAfter(o):e.index(o)-1);break}else if(o==0)return null;i+=r;let l=e.doc.resolve(i);if(Rr.valid(l))return l}for(;;){let o=r>0?s.firstChild:s.lastChild;if(!o){if(s.isAtom&&!s.isText&&!lt.isSelectable(s)){e=e.doc.resolve(i+s.nodeSize*r),n=!1;continue e}break}s=o,i+=r;let a=e.doc.resolve(i);if(Rr.valid(a))return a}return null}}}Rr.prototype.visible=!1;Rr.findFrom=Rr.findGapCursorFrom;gt.jsonID("gapcursor",Rr);class $9{constructor(e){this.pos=e}map(e){return new $9(e.map(this.pos))}resolve(e){let r=e.resolve(this.pos);return Rr.valid(r)?new Rr(r):gt.near(r)}}function o4e(t){for(let e=t.depth;e>=0;e--){let r=t.index(e),n=t.node(e);if(r==0){if(n.type.spec.isolating)return!0;continue}for(let i=n.child(r-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function a4e(t){for(let e=t.depth;e>=0;e--){let r=t.indexAfter(e),n=t.node(e);if(r==n.childCount){if(n.type.spec.isolating)return!0;continue}for(let i=n.child(r);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function l4e(){return new _r({props:{decorations:d4e,createSelectionBetween(t,e,r){return e.pos==r.pos&&Rr.valid(r)?new Rr(r):null}
112,handleClick:h4e,handleKeyDown:c4e,handleDOMEvents:{beforeinput:u4e}}})}const c4e=S7({ArrowLeft:Gy("horiz",-1),ArrowRight:Gy("horiz",1),ArrowUp:Gy("vert",-1),ArrowDown:Gy("vert",1)});function Gy(t,e){const r=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(n,i,s){let o=n.selection,a=e>0?o.$to:o.$from,l=o.empty;if(o instanceof Je){if(!s.endOfTextblock(r)||a.depth==0)return!1;l=!1,a=n.doc.resolve(e>0?a.after():a.before())}let c=Rr.findGapCursorFrom(a,e,l);return c?(i&&i(n.tr.setSelection(new Rr(c))),!0):!1}}function h4e(t,e,r){if(!t||!t.editable)return!1;let n=t.state.doc.resolve(e);if(!Rr.valid(n))return!1;let i=t.posAtCoords({left:r.clientX,top:r.clientY});return i&&i.inside>-1&&lt.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new Rr(n))),!0)}function u4e(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof Rr))return!1;let{$from:r}=t.state.selection,n=r.parent.contentMatchAt(r.index()).findWrapping(t.state.schema.nodes.text);if(!n)return!1;let i=Se.empty;for(let o=n.length-1;o>=0;o--)i=Se.from(n[o].createAndFill(null,i));let s=t.state.tr.replace(r.pos,r.pos,new Ie(i,0,0));return s.setSelection(Je.near(s.doc.resolve(r.pos+1))),t.dispatch(s),!1}function d4e(t){if(!(t.selection instanceof Rr))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",or.create(t.doc,[Ur.widget(t.selection.head,e,{key:"gapcursor"})])}function z9(t,e){return Object.assign(t,{meta:{package:"@milkdown/plugin-cursor",...e}}),t}const Vw=tr({},"dropCursorConfig");z9(Vw,{displayName:"Ctx<dropCursor>"});const wV=nn(t=>i4e(t.get(Vw.key)));z9(wV,{displayName:"Prose<dropCursor>"});const kV=nn(()=>l4e());z9(kV,{displayName:"Prose<gapCursor>"});const f4e=[Vw,wV,kV];function p4e(t){var e;const r=(e=void 0)!=null?e:!1;let n=typeof document>"u"?null:document.createElement("div");return new _r({key:m4e,view:i=>{r!==!0&&x4e(i.state.schema,r||[]);const s=i.dom.ownerDocument;n=n||document.createElement("div");const o=n,a=()=>{y4e(i,o)};let l;return window.ResizeObserver&&(l=new window.ResizeObserver(()=>a()),l.observe(i.dom)),s.addEventListener("selectionchange",a),{update:()=>{a()},destroy:()=>{s.removeEventListener("selectionchange",a),l&&l.unobserve(i.dom)}}},props:{handleKeyDown:(i,s)=>{var o;const{selection:a}=i.state;if(s.altKey||s.ctrlKey||s.metaKey||s.shiftKey||s.isComposing||!["ArrowLeft","ArrowRight"].includes(s.key)||!mS(a)||!a.empty)return!1;const l=a.$head,[c,h]=CV(l),u=i.state.storedMarks||l.marks();if(c&&h&&!At.sameSet(c,h)){if(s.key==="ArrowLeft"&&!At.sameSet(c,u))return i.dispatch(i.state.tr.setStoredMarks(c)),!0;if(s.key==="ArrowRight"&&!At.sameSet(h,u))return i.dispatch(i.state.tr.setStoredMarks(h)),!0}return s.key==="ArrowLeft"&&l.textOffset===1?(i.dispatch(i.state.tr.setSelection(Je.create(i.state.doc,l.pos-1)).setStoredMarks(l.marks())),!0):s.key==="ArrowRight"&&l.textOffset+1===((o=l.parent.maybeChild(l.index()))==null?void 0:o.nodeSize)?(i.dispatch(i.state.tr.setSelection(Je.create(i.state.doc,l.pos+1)).setStoredMarks(l.marks())),!0):!1},decorations:i=>{if(!(!n||!mS(i.selection)||!i.selection.empty))return or.create(i.doc,[Ur.widget(0,n,{key:"prosemirror-virtual-cursor"})])},attributes:{class:"virtual-cursor-enabled"}}})}var m4e=new Dr("prosemirror-virtual-cursor");function g4e(t,e){var r;const n=window.getSelection();if(!n||!n.rangeCount)return null;const i=(r=n==null?void 0:n.getRangeAt(0))==null?void 0:r.cloneRange();if(!i)return null;i.collapse(e);const s=i.getClientRects(),o=s!=null&&s.length?s[s.length-1]:null;return o!=null&&o.height?o:t.coordsAtPos(t.state.selection.head)}function CV(t){const e=t.index(),r=t.parent.maybeChild(e);let n=t.textOffset?r:null;return!n&&e>0&&(n=t.parent.maybeChild(e-1)),[n==null?void 0:n.marks,r==null?void 0:r.marks]}function mS(t){return t&&typeof t=="object"&&"$cursor"in t}function y4e(t,e){if(!t||!t.dom||t.isDestroyed||!e)return;const{state:r,dom:n}=t,{selection:i}=r;if(!mS(i))return;const s=g4e(t,i.$head===i.$from);if(!s)return e;const o=n.getBoundingClientRect();let a="prosemirror-virtual-cursor";const l=r.selection.$head,[c,h]=CV(l),u=r.storedMarks||l.marks();i.$cursor&&c&&h&&u&&!At.sameSet(c,h)&&(At.sameSet(c,u)?a+=" prosemirror-virtual-cursor-left":At.sameSet(h,u)&&(a+=" prosemirror-virtual-cursor-right")),e.className=a,b4e(e,"prosemirror-virtual-cursor-animation"),e.style.height=`${s.bottom-s.top}px`,e.style.left=`${s.left-o.left}px`,e.style.top=`${s.top-o.top}px`}function b4e(t,e){t.classList.remove(e),t.offsetWidth,t.classList.add(e)}function x4e(t,e){for(const[r,n]of Object.entries(t.marks))n.spec.inclusive===!1&&!e.includes(r)&&console.warn(`[prosemirror-virtual-cursor] Virtual cursor does not work well with marks that have inclusive set to false. Please consider removing the inclusive option from the "${r}" mark or adding it to the "skipWarning" option.`)}var v4e=Object.defineProperty,fD=Object.getOwnPropertySymbols,w4e=Object.prototype.hasOwnProperty,k4e=Object.prototype.propertyIsEnumerable,pD=(t,e,r)=>e in t?v4e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,C4e=(t,e)=>{for(var r in e||(e={}))w4e.call(e,r)&&pD(t,r,e[r]);if(fD)for(var r of fD(e))k4e.call(e,r)&&pD(t,r,e[r]);return t};function SV(t,e){return Object.assign(t,{meta:C4e({package:"@milkdown/components"},e)}),t}const S4e={imageIcon:"🌌",uploadButton:"Upload",confirmButton:"⏎",uploadPlaceholderText:"/Paste",onUpload:t=>Promise.resolve(URL.createObjectURL(t))},Ww=tr(S4e,"inlineImageConfigCtx");SV(Ww,{displayName:"Config<image-inline>",group:"ImageInline"});function ob({icon:t,class:e,onClick:r}){return te("span",{class:Mn("milkdown-icon",e),onPointerdown:r,ref:n=>{n&&t&&(n.innerHTML=An.sanitize(t.trim()))}})}ob.props={icon:{type:String,required:!1},class:{type:String,required:!1},onClick:{type:Function,required:!1}};const T4e=IH("abcdefg",8),_4e=En({props:{src:{type:Object,required:!0},selected:{type:Object,required:!0},readonly:{type:Object,required:!0},setLink:{type:Function,required:!0},imageIcon:{type:String,required:!1},uploadButton:{type:String,required:!1},confirmButton:{type:String,required:!1},uploadPlaceholderText:{type:String,required:!1},onUpload:{type:Function,required:!0}},setup({readonly:t,src:e,setLink:r,onUpload:n,imageIcon:i,uploadButton:s,confirmButton:o,uploadPlaceholderText:a,className:l}){var c,h;const u=We(!1),d=We(),f=We((c=e.value)!=null?c:""),p=We(T4e()),m=We(((h=e.value)==null?void 0:h.length)!==0),g=S=>{const w=S.target.value;m.value=w.length!==0,f.value=w},y=S=>{var k,w;S.key==="Enter"&&r((w=(k=d.value)==null?void 0:k.value)!=null?w:"")},b=()=>{var S,k;r((k=(S=d.value)==null?void 0:S.value)!=null?k:"")},x=S=>{var k;const w=(k=S.target.files)==null?void 0:k[0];w&&n(w).then(_=>{_&&(r(_),m.value=!0)}).catch(_=>{console.error("An error occurred while uploading image"),console.error(_)})};return()=>te("div",{class:Mn("image-edit",l)}
112,te(ob,{icon:i,class:"image-icon"}),te("div",{class:Mn("link-importer",u.value&&"focus")},te("input",{ref:d,draggable:"true",onDragstart:S=>{S.preventDefault(),S.stopPropagation()},disabled:t.value,class:"link-input-area",value:f.value,onInput:g,onKeydown:y,onFocus:()=>u.value=!0,onBlur:()=>u.value=!1}),!m.value&&te("div",{class:"placeholder"},te("input",{disabled:t.value,class:"hidden",id:p.value,type:"file",accept:"image/*",onChange:x}),te("label",{class:"uploader",for:p.value},te(ob,{icon:s})),te("span",{class:"text",onClick:()=>{var S;return(S=d.value)==null?void 0:S.focus()}},a))),f.value&&te("div",{class:"confirm",onClick:()=>b()},te(ob,{icon:o})))}}),M4e=En({props:{src:{type:Object,required:!0},alt:{type:Object,required:!0},title:{type:Object,required:!0},selected:{type:Object,required:!0},readonly:{type:Object,required:!0},setAttr:{type:Function,required:!0},config:{type:Object,required:!0}},setup(t){const{src:e,alt:r,title:n}=t;return()=>{var i;return(i=e.value)!=null&&i.length?te("img",{class:"image-inline",src:e.value,alt:r.value,title:n.value}):te(_4e,{src:t.src,selected:t.selected,readonly:t.readonly,setLink:s=>t.setAttr("src",s),imageIcon:t.config.imageIcon,uploadButton:t.config.uploadButton,confirmButton:t.config.confirmButton,uploadPlaceholderText:t.config.uploadPlaceholderText,onUpload:t.config.onUpload,className:"empty-image-inline"})}}}),TV=_1(Au.node,t=>(e,r,n)=>{const i=We(e.attrs.src),s=We(e.attrs.alt),o=We(e.attrs.title),a=We(!1),l=We(!r.editable),c=(g,y)=>{if(!r.editable)return;const b=n();b!=null&&r.dispatch(r.state.tr.setNodeAttribute(b,g,g==="src"?An.sanitize(y):y))},h=t.get(Ww.key),u=bo(M4e,{src:i,alt:s,title:o,selected:a,readonly:l,setAttr:c,config:h}),d=document.createElement("span");d.className="milkdown-image-inline",u.mount(d);const f=n0(()=>{a.value?d.classList.add("selected"):d.classList.remove("selected")}),p=h.proxyDomURL,m=g=>{if(!p)i.value=g.attrs.src;else{const y=p(g.attrs.src);typeof y=="string"?i.value=y:y.then(b=>{i.value=b}).catch(console.error)}s.value=g.attrs.alt,o.value=g.attrs.title};return m(e),{dom:d,update:g=>g.type!==e.type?!1:(m(g),!0),stopEvent:g=>g.target instanceof HTMLInputElement,selectNode:()=>{a.value=!0},deselectNode:()=>{a.value=!1},destroy:()=>{f(),u.unmount(),d.remove()}}});SV(TV,{displayName:"NodeView<image-inline>",group:"ImageInline"});const A4e=[Ww,TV];class Xi{constructor(e,r,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=r,this.end=n}static range(e,r){return r?!e||!e.loc||!r.loc||e.loc.lexer!==r.loc.lexer?null:new Xi(e.loc.lexer,e.loc.start,r.loc.end):e&&e.loc}}class Es{constructor(e,r){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=r}range(e,r){return new Es(r,Xi.range(this,e))}}class be{constructor(e,r){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var n="KaTeX parse error: "+e,i,s,o=r&&r.loc;if(o&&o.start<=o.end){var a=o.lexer.input;i=o.start,s=o.end,i===a.length?n+=" at end of input: ":n+=" at position "+(i+1)+": ";var l=a.slice(i,s).replace(/[^]/g,"$&̲"),c;i>15?c="…"+a.slice(i-15,i):c=a.slice(0,i);var h;s+15<a.length?h=a.slice(s,s+15)+"…":h=a.slice(s),n+=c+l+h}var u=new Error(n);return u.name="ParseError",u.__proto__=be.prototype,u.position=i,i!=null&&s!=null&&(u.length=s-i),u.rawMessage=e,u}}be.prototype.__proto__=Error.prototype;var E4e=function(e,r){return e.indexOf(r)!==-1},O4e=function(e,r){return e===void 0?r:e},L4e=/([A-Z])/g,D4e=function(e){return e.replace(L4e,"-$1").toLowerCase()},I4e={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},B4e=/[&><"']/g;function R4e(t){return String(t).replace(B4e,e=>I4e[e])}var _V=function t(e){return e.type==="ordgroup"||e.type==="color"?e.body.length===1?t(e.body[0]):e:e.type==="font"?t(e.body):e},P4e=function(e){var r=_V(e);return r.type==="mathord"||r.type==="textord"||r.type==="atom"},N4e=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e},F4e=function(e){var r=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(e);return r?r[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(r[1])?null:r[1].toLowerCase():"_relative"},ot={contains:E4e,deflt:O4e,escape:R4e,hyphenate:D4e,getBaseElem:_V,isCharacterBox:P4e,protocolFromUrl:F4e},Om={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:t=>"#"+t},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(t,e)=>(e.push(t),e)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:t=>Math.max(0,t),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:t=>Math.max(0,t),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:t=>Math.max(0,t),cli:"-e, --max-expand <n>",cliProcessor:t=>t==="Infinity"?1/0:parseInt(t)},globalGroup:{type:"boolean",cli:!1}};function $4e(t){if(t.default)return t.default;var e=t.type,r=Array.isArray(e)?e[0]:e;if(typeof r!="string")return r.enum[0];switch(r){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}class H9{constructor(e){this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{};for(var r in Om)if(Om.hasOwnProperty(r)){var n=Om[r];this[r]=e[r]!==void 0?n.processor?n.processor(e[r]):e[r]:$4e(n)}}reportNonstrict(e,r,n){var i=this.strict;if(typeof i=="function"&&(i=i(e,r,n)),!(!i||i==="ignore")){if(i===!0||i==="error")throw new be("LaTeX-incompatible input and strict mode is set to 'error': "+(r+" ["+e+"]"),n);i==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(r+" ["+e+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+r+" ["+e+"]"))}}useStrictBehavior(e,r,n){var i=this.strict;if(typeof i=="function")try{i=i(e,r,n)}catch{i="error"}return!i||i==="ignore"?!1:i===!0||i==="error"?!0:i==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(r+" ["+e+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+r+" ["+e+"]")),!1)}isTrusted(e){if(e.url&&!e.protocol){var r=ot.protocolFromUrl(e.url);if(r==null)return!1;e.protocol=r}var n=typeof this.trust=="function"?this.trust(e):this.trust;return!!n}}class Ml{constructor(e,r,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=r,this.cramped=n}sup(){return No[z4e[this.id]]}sub(){return No[H4e[this.id]]}fracNum(){return No[q4e[this.id]]}fracDen(){return No[V4e[this.id]]}cramp(){return No[W4e[this.id]]}text(){return No[j4e[this.id]]}isTight(){return this.size>=2}}var q9=0,Fx=1,Ed=2,Za=3,_g=4,Ts=5,If=6,ri=7,No=[new Ml(q9,0,!1),new Ml(Fx,0,!0),new Ml(Ed,1,!1),new Ml(Za,1,!0),new Ml(_g,2,!1),new Ml(Ts,2,!0),new Ml(If,3,!1),new Ml(ri,3,!0)],z4e=[_g,Ts,_g,Ts,If,ri,If,ri],H4e=[Ts,Ts,Ts,Ts,ri,ri,ri,ri],q4e=[Ed,Za,_g,Ts,If,ri,If,ri],V4e=[Za,Za,Ts,Ts,ri,ri,ri,ri],W4e=[Fx,Fx,Za,Za,Ts,Ts,ri,ri],j4e=[q9,Fx,Ed,Za,Ed,Za,Ed,Za],ut={DISPLAY:No[q9],TEXT:No[Ed],SCRIPT:No[_g],SCRIPTSCRIPT:No[If]},gS=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function U4e(t){for(var e=0;e<gS.length;e++)for(var r=gS[e],n=0;n<r.blocks.length;n++){var i=r.blocks[n];if(t>=i[0]&&t<=i[1])return r.name}return null}var ab=[];
vendor: 4,413 bytes, lines 112-163
112gS.forEach(t=>t.blocks.forEach(e=>ab.push(...e)));function MV(t){for(var e=0;e<ab.length;e+=2)if(t>=ab[e]&&t<=ab[e+1])return!0;return!1}var ju=80,G4e=function(e,r){return"M95,"+(622+e+r)+`
113c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
114c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
115c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
116s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
117c69,-144,104.5,-217.7,106.5,-221
118l`+e/2.075+" -"+e+`
119c5.3,-9.3,12,-14,20,-14
120H400000v`+(40+e)+`H845.2724
121s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
122c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
123M`+(834+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},K4e=function(e,r){return"M263,"+(601+e+r)+`c0.7,0,18,39.7,52,119
124c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
125c340,-704.7,510.7,-1060.3,512,-1067
126l`+e/2.084+" -"+e+`
127c4.7,-7.3,11,-11,19,-11
128H40000v`+(40+e)+`H1012.3
129s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
130c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
131s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
132c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
133M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},Y4e=function(e,r){return"M983 "+(10+e+r)+`
134l`+e/3.13+" -"+e+`
135c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+`
136H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
137s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744
138c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
139c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
140c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
141c53.7,-170.3,84.5,-266.8,92.5,-289.5z
142M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},X4e=function(e,r){return"M424,"+(2398+e+r)+`
143c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
144c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
145s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
146s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
147l`+e/4.223+" -"+e+`c4,-6.7,10,-10,18,-10 H400000
148v`+(40+e)+`H1014.6
149s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
150c-2,6,-10,9,-24,9
151c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+" "+r+`
152h400000v`+(40+e)+"h-400000z"},J4e=function(e,r){return"M473,"+(2713+e+r)+`
153c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+" -"+e+`
154c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`H1017.7
155s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
156c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
157c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
158s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
159606zM`+(1001+e)+" "+r+"h400000v"+(40+e)+"H1017.7z"},Z4e=function(e){var r=e/2;return"M400000 "+e+" H0 L"+r+" 0 l65 45 L145 "+(e-80)+" H400000z"},Q4e=function(e,r,n){var i=n-54-r-e;return"M702 "+(e+r)+"H400000"+(40+e)+`
160H742v`+i+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
161h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
162c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
163219 661 l218 661zM702 `+r+"H400000v"+(40+e)+"H742z"},e5e=function(e,r,n){r=1e3*r;var i="";switch(e){case"sqrtMain":i=G4e(r,ju);break;case"sqrtSize1":i=K4e(r,ju);break;case"sqrtSize2":i=Y4e(r,ju);break;case"sqrtSize3":i=X4e(r,ju);break;case"sqrtSize4":i=J4e(r,ju);break;case"sqrtTall":i=Q4e(r,ju,n)}return i},t5e=function(e,r){switch(e){case"⎜":return"M291 0 H417 V"+r+" H291z M291 0 H417 V"+r+" H291z";case"∣":return"M145 0 H188 V"+r+" H145z M145 0 H188 V"+r+" H145z";case"∥":return"M145 0 H188 V"+r+" H145z M145 0 H188 V"+r+" H145z"+("M367 0 H410 V"+r+" H367z M367 0 H410 V"+r+" H367z");case"⎟":return"M457 0 H583 V"+r+" H457z M457 0 H583 V"+r+" H457z";case"⎢":return"M319 0 H403 V"+r+" H319z M319 0 H403 V"+r+" H319z";case"⎥":return"M263 0 H347 V"+r+" H263z M263 0 H347 V"+r+" H263z";case"⎪":return"M384 0 H504 V"+r+" H384z M384 0 H504 V"+r+" H384z";case"⏐":return"M312 0 H355 V"+r+" H312z M312 0 H355 V"+r+" H312z";case"‖":return"M257 0 H300 V"+r+" H257z M257 0 H300 V"+r+" H257z"+("M478 0 H521 V"+r+" H478z M478 0 H521 V"+r+" H478z");default:return""}},mD
vendor: 15,381 bytes, lines 163-338
163={doubleleftarrow:`M262 157
164l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
165 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
166 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
167c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
168 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
169-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
170-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
171m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
172-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
173 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
174-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
175-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
176-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
177c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
178-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
179 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
180-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
181c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
182 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
183 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
184 l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
185-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
186 5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
187 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
188 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
189-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
190H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
191 435 0h399565z`,leftgroupunder:`M400000 262
192H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
193 435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
194-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
195-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
196-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
197 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
198-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
199-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
200m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
201 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
202 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
203-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
204 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
205-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
206v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
207-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
208-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
209 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:`M40 281 V428 H0 V94 H40 V241 H400000 v40z
210M40 281 V428 H0 V94 H40 V241 H400000 v40z`,leftmapsto:`M40 281 V448H0V74H40V241H400000v40z
211M40 281 V448H0V74H40V241H400000v40z`,leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
212-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
213c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
214 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:`M0 50 h400000 v40H0z m0 194h40000v40H0z
215M0 50 h400000 v40H0z m0 194h40000v40H0z`,midbrace:`M200428 334
216c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
217-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
218 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
219 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
220c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
221 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
222 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
223-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
224-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
225m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
22660.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
227-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
228m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
229c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
230-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
231m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
23285.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
233-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
234m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
235c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
236-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
237 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
238 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
239-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
240-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
241 151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
242-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
243s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
244c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
245 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
246-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
247 3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
248 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
249-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
250-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
251 69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
252-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
253 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
254m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
255 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
256-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
257-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
258 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
259 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
260-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
261m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
262 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
263-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
264 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z
265M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`,rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
266 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
267-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
268-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
269 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
270-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
271-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
272-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
273 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
274c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
275 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
276 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
277-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
278 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
279-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
280 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
281 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
282-68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
283-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
284 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
285c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
286 181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
287-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
288 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
289 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
290 -338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
291-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
292 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
293 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
294 -175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
2953.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
29610.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
297-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
298-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
299H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
300c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
301c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
302-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
303-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
304-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
305-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
306-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
307-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
308-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
309c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
310c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
311s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
312121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
313s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
314c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
315M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
316-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
31713.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
318-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
319-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
320-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
321151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
322c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
323c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
324c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
325c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
326M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
327c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
328-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
329c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
330M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
331c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
3321c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
333-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
334M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
335c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
336-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
337c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
338M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},
vendor: 3,204 bytes, lines 338-366
338r5e=function(e,r){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+r+` v1759 h347 v-84
339H403z M403 1759 V0 H319 V1759 v`+r+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+r+` v1759 H0 v84 H347z
340M347 1759 V0 H263 V1759 v`+r+" v1759 h84z";case"vert":return"M145 15 v585 v"+r+` v585 c2.667,10,9.667,15,21,15
341c10,0,16.667,-5,20,-15 v-585 v`+-r+` v-585 c-2.667,-10,-9.667,-15,-21,-15
342c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+r+" v585 h43z";case"doublevert":return"M145 15 v585 v"+r+` v585 c2.667,10,9.667,15,21,15
343c10,0,16.667,-5,20,-15 v-585 v`+-r+` v-585 c-2.667,-10,-9.667,-15,-21,-15
344c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+r+` v585 h43z
345M367 15 v585 v`+r+` v585 c2.667,10,9.667,15,21,15
346c10,0,16.667,-5,20,-15 v-585 v`+-r+` v-585 c-2.667,-10,-9.667,-15,-21,-15
347c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+r+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+r+` v1715 h263 v84 H319z
348MM319 602 V0 H403 V602 v`+r+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+r+` v1799 H0 v-84 H319z
349MM319 602 V0 H403 V602 v`+r+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+r+` v602 h84z
350M403 1759 V0 H319 V1759 v`+r+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+r+` v602 h84z
351M347 1759 V0 h-84 V1759 v`+r+" v602 h84z";case"lparen":return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1
352c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,
353-36,557 l0,`+(r+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
354949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9
355c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,
356-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
357l0,-`+(r+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
358-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case"rparen":return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,
35963,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
360c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(r+9)+`
361c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664
362c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11
363c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17
364c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
365l0,-`+(r+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
366-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};class W1{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return ot.contains(this.classes,e)}toNode(){for(var e=document.createDocumentFragment(),r=0;r<this.children.length;r++)e.appendChild(this.children[r].toNode());return e}toMarkup(){for(var e="",r=0;r<this.children.length;r++)e+=this.children[r].toMarkup();return e}toText(){var e=r=>r.toText();return this.children.map(e).join("")}}var jo
vendor: 57,629 bytes, line 366
366={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},
vendor: 12,527 bytes, line 366
366Ky={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},gD={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function AV(t,e){jo[t]=e}function V9(t,e,r){if(!jo[e])throw new Error("Font metrics not found for font: "+e+".");var n=t.charCodeAt(0),i=jo[e][n];if(!i&&t[0]in gD&&(n=gD[t[0]].charCodeAt(0),i=jo[e][n]),!i&&r==="text"&&MV(n)&&(i=jo[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var mk={};function n5e(t){var e;if(t>=5?e=0:t>=3?e=1:e=2,!mk[e]){var r=mk[e]={cssEmPerMu:Ky.quad[e]/18};for(var n in Ky)Ky.hasOwnProperty(n)&&(r[n]=Ky[n][e])}return mk[e]}var i5e=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],yD=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],bD=function(e,r){return r.size<2?e:i5e[e-1][r.size-1]};class Ba{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||Ba.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=yD[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var r={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var n in e)e.hasOwnProperty(n)&&(r[n]=e[n]);return new Ba(r)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:bD(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:yD[e-1]})}havingBaseStyle(e){e=e||this.style.text();var r=bD(Ba.BASESIZE,e);return this.size===r&&this.textSize===Ba.BASESIZE&&this.style===e?this:this.extend({style:e,size:r})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==Ba.BASESIZE?["sizing","reset-size"+this.size,"size"+Ba.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=n5e(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Ba.BASESIZE=6;var yS={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},s5e={ex:!0,em:!0,mu:!0},EV=function(e){return typeof e!="string"&&(e=e.unit),e in yS||e in s5e||e==="ex"},Lr=function(e,r){var n;if(e.unit in yS)n=yS[e.unit]/r.fontMetrics().ptPerEm/r.sizeMultiplier;else if(e.unit==="mu")n=r.fontMetrics().cssEmPerMu;else{var i;if(r.style.isTight()?i=r.havingStyle(r.style.text()):i=r,e.unit==="ex")n=i.fontMetrics().xHeight;else if(e.unit==="em")n=i.fontMetrics().quad;else throw new be("Invalid unit: '"+e.unit+"'");i!==r&&(n*=i.sizeMultiplier/r.sizeMultiplier)}return Math.min(e.number*n,r.maxSize)},Me=function(e){return+e.toFixed(4)+"em"},wc=function(e){return e.filter(r=>r).join(" ")},OV=function(e,r,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},r){r.style.isTight()&&this.classes.push("mtight");var i=r.getColor();i&&(this.style.color=i)}},LV=function(e){var r=document.createElement(e);r.className=wc(this.classes);for(var n in this.style)this.style.hasOwnProperty(n)&&(r.style[n]=this.style[n]);for(var i in this.attributes)this.attributes.hasOwnProperty(i)&&r.setAttribute(i,this.attributes[i]);for(var s=0;s<this.children.length;s++)r.appendChild(this.children[s].toNode());return r},o5e=/[\s"'>/=\x00-\x1f]/,DV=function(e){var r="<"+e;this.classes.length&&(r+=' class="'+ot.escape(wc(this.classes))+'"');var n="";for(var i in this.style)this.style.hasOwnProperty(i)&&(n+=ot.hyphenate(i)+":"+this.style[i]+";");n&&(r+=' style="'+ot.escape(n)+'"');for(var s in this.attributes)if(this.attributes.hasOwnProperty(s)){if(o5e.test(s))throw new be("Invalid attribute name '"+s+"'");r+=" "+s+'="'+ot.escape(this.attributes[s])+'"'}r+=">";for(var o=0;o<this.children.length;o++)r+=this.children[o].toMarkup();return r+="</"+e+">",r};class j1{constructor(e,r,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,OV.call(this,e,n,i),this.children=r||[]}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return ot.contains(this.classes,e)}toNode(){return LV.call(this,"span")}toMarkup(){return DV.call(this,"span")}}class W9{constructor(e,r,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,OV.call(this,r,i),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return ot.contains(this.classes,e)}toNode(){return LV.call(this,"a")}toMarkup(){return DV.call(this,"a")}}class a5e{constructor(e,r,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=r,this.src=e,this.classes=["mord"],this.style=n}hasClass(e){return ot.contains(this.classes,e)}toNode(){var e=document.createElement("img");e.src=this.src,e.alt=this.alt,e.className="mord";for(var r in this.style)this.style.hasOwnProperty(r)&&(e.style[r]=this.style[r]);return e}toMarkup(){var e='<img src="'+ot.escape(this.src)+'"'+(' alt="'+ot.escape(this.alt)+'"'),r="";for(var n in this.style)this.style.hasOwnProperty(n)&&(r+=ot.hyphenate(n)+":"+this.style[n]+";");return r&&(e+=' style="'+ot.escape(r)+'"'),e+="'/>",e}}var l5e={î:"ı̂",ï:"ı̈",í:"ı́",ì:"ı̀"};class Is{constructor(e,r,n,i,s,o,a,l){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=r||0,this.depth=n||0,this.italic=i||0,this.skew=s||0,this.width=o||0,this.classes=a||[],this.style=l||{},this.maxFontSize=0;var c=U4e(this.text.charCodeAt(0));c&&this.classes.push(c+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=l5e[this.text])}hasClass(e){return ot.contains(this.classes,e)}toNode(){var e=document.createTextNode(this.text),r=null;this.italic>0&&(r=document.createElement("span"),r.style.marginRight=Me(this.italic)),this.classes.length>0&&(r=r||document.createElement("span"),r.className=wc(this.classes));for(var n in this.style)this.style.hasOwnProperty(n)&&(r=r||document.createElement("span"),r.style[n]=this.style[n]);return r?(r.appendChild(e),r):e}toMarkup(){var e=!1,r="<span";this.classes.length&&(e=!0,r+=' class="',r+=ot.escape(wc(this.classes)),r+='"');var n="";this.italic>0&&(n+="margin-right:"+this.italic+"em;");for(var i in this.style)this.style.hasOwnProperty(i)&&(n+=ot.hyphenate(i)+":"+this.style[i]+";");n&&(e=!0,r+=' style="'+ot.escape(n)+'"');var s=ot.escape(this.text);return e?(r+=">",r+=s,r+="</span>",r):s}}class ll{constructor(e,r){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=r||{}}toNode(){var e="http://www.w3.org/2000/svg",r=document.createElementNS(e,"svg");for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&r.setAttribute(n,this.attributes[n]);for(var i=0;i<this.children.length;i++)r.appendChild(this.children[i].toNode());return r}toMarkup(){var e='<svg xmlns="http://www.w3.org/2000/svg"';for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&(e+=" "+r+'="'+ot.escape(this.attributes[r])+'"');e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+="</svg>",e}}class kc{constructor(e,r){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=r}toNode(){var e="http://www.w3.org/2000/svg",r=document.createElementNS(e,"path");return this.alternate?r.setAttribute("d",this.alternate):r.setAttribute("d",mD[this.pathName]),r}toMarkup(){return this.alternate?'<path d="'+ot.escape(this.alternate)+'"/>':'<path d="'+ot.escape(mD[this.pathName])+'"/>'}}class bS{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e="http://www.w3.org/2000/svg",r=document.createElementNS(e,"line");for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&r.setAttribute(n,this.attributes[n]);return r}toMarkup(){var e="<line";for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&(e+=" "+r+'="'+ot.escape(this.attributes[r])+'"');return e+="/>",e}}function xD(t){if(t instanceof Is)return t;throw new Error("Expected symbolNode but got "+String(t)+".")}function c5e(t){if(t instanceof j1)return t;throw new Error("Expected span<HtmlDomNode> but got "+String(t)+".")}var h5e={bin:1,close:1,inner:1,open:1,punct:1,rel:1},u5e={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},mr={math:{},text:{}};function v(t,e,r,n,i,s){mr[t][i]={font:e,group:r,replace:n},s&&n&&(mr[t][n]=mr[t][i])}var T="math",me="text",M="main",P="ams",Mr="accent-token",$e="bin",pi="close",c0="inner",ht="mathord",Yr="op-token",us="open",jw="punct",F="rel",wl="spacing",U="textord";v(T,M,F,"≡","\\equiv",!0);v(T,M,F,"≺","\\prec",!0);v(T,M,F,"≻","\\succ",!0);v(T,M,F,"∼","\\sim",!0);v(T,M,F,"⊥","\\perp");v(T,M,F,"⪯","\\preceq",!0);v(T,M,F,"⪰","\\succeq",!0);v(T,M,F,"≃","\\simeq",!0);v(T,M,F,"∣","\\mid",!0);v(T,M,F,"≪","\\ll",!0);v(T,M,F,"≫","\\gg",!0);v(T,M,F,"≍","\\asymp",!0);v(T,M,F,"∥","\\parallel");v(T,M,F,"⋈","\\bowtie",!0);v(T,M,F,"⌣","\\smile",!0);v(T,M,F,"⊑","\\sqsubseteq",!0);v(T,M,F,"⊒","\\sqsupseteq",!0);v(T,M,F,"≐","\\doteq",!0);v(T,M,F,"⌢","\\frown",!0);v(T,M,F,"∋","\\ni",!0);v(T,M,F,"∝","\\propto",!0);v(T,M,F,"⊢","\\vdash",!0);v(T,M,F,"⊣","\\dashv",!0);v(T,M,F,"∋","\\owns");v(T,M,jw,".","\\ldotp");v(T,M,jw,"⋅","\\cdotp");v(T,M,U,"#","\\#");v(me,M,U,"#","\\#");v(T,M,U,"&","\\&");v(me,M,U,"&","\\&");v(T,M,U,"ℵ","\\aleph",!0);v(T,M,U,"∀","\\forall",!0);v(T,M,U,"ℏ","\\hbar",!0);v(T,M,U,"∃","\\exists",!0);v(T,M,U,"∇","\\nabla",!0);v(T,M,U,"♭","\\flat",!0);v(T,M,U,"ℓ","\\ell",!0);v(T,M,U,"♮","\\natural",!0);v(T,M,U,"♣","\\clubsuit",!0);v(T,M,U,"℘","\\wp",!0);v(T,M,U,"♯","\\sharp",!0);v(T,M,U,"♢","\\diamondsuit",!0);v(T,M,U,"ℜ","\\Re",!0);v(T,M,U,"♡","\\heartsuit",!0);v(T,M,U,"ℑ","\\Im",!0);v(T,M,U,"♠","\\spadesuit",!0);v(T,M,U,"§","\\S",!0);v(me,M,U,"§","\\S");v(T,M,U,"¶","\\P",!0);v(me,M,U,"¶","\\P");v(T,M,U,"†","\\dag");
366v(me,M,U,"†","\\dag");v(me,M,U,"†","\\textdagger");v(T,M,U,"‡","\\ddag");v(me,M,U,"‡","\\ddag");v(me,M,U,"‡","\\textdaggerdbl");v(T,M,pi,"⎱","\\rmoustache",!0);v(T,M,us,"⎰","\\lmoustache",!0);v(T,M,pi,"⟯","\\rgroup",!0);v(T,M,us,"⟮","\\lgroup",!0);v(T,M,$e,"∓","\\mp",!0);v(T,M,$e,"⊖","\\ominus",!0);v(T,M,$e,"⊎","\\uplus",!0);v(T,M,$e,"⊓","\\sqcap",!0);v(T,M,$e,"∗","\\ast");v(T,M,$e,"⊔","\\sqcup",!0);v(T,M,$e,"◯","\\bigcirc",!0);v(T,M,$e,"∙","\\bullet",!0);v(T,M,$e,"‡","\\ddagger");v(T,M,$e,"≀","\\wr",!0);v(T,M,$e,"⨿","\\amalg");v(T,M,$e,"&","\\And");v(T,M,F,"⟵","\\longleftarrow",!0);v(T,M,F,"⇐","\\Leftarrow",!0);v(T,M,F,"⟸","\\Longleftarrow",!0);v(T,M,F,"⟶","\\longrightarrow",!0);v(T,M,F,"⇒","\\Rightarrow",!0);v(T,M,F,"⟹","\\Longrightarrow",!0);v(T,M,F,"↔","\\leftrightarrow",!0);v(T,M,F,"⟷","\\longleftrightarrow",!0);v(T,M,F,"⇔","\\Leftrightarrow",!0);v(T,M,F,"⟺","\\Longleftrightarrow",!0);v(T,M,F,"↦","\\mapsto",!0);v(T,M,F,"⟼","\\longmapsto",!0);v(T,M,F,"↗","\\nearrow",!0);v(T,M,F,"↩","\\hookleftarrow",!0);v(T,M,F,"↪","\\hookrightarrow",!0);v(T,M,F,"↘","\\searrow",!0);v(T,M,F,"↼","\\leftharpoonup",!0);v(T,M,F,"⇀","\\rightharpoonup",!0);v(T,M,F,"↙","\\swarrow",!0);v(T,M,F,"↽","\\leftharpoondown",!0);v(T,M,F,"⇁","\\rightharpoondown",!0);v(T,M,F,"↖","\\nwarrow",!0);v(T,M,F,"⇌","\\rightleftharpoons",!0);v(T,P,F,"≮","\\nless",!0);v(T,P,F,"","\\@nleqslant");v(T,P,F,"","\\@nleqq");v(T,P,F,"⪇","\\lneq",!0);v(T,P,F,"≨","\\lneqq",!0);v(T,P,F,"","\\@lvertneqq");v(T,P,F,"⋦","\\lnsim",!0);v(T,P,F,"⪉","\\lnapprox",!0);v(T,P,F,"⊀","\\nprec",!0);v(T,P,F,"⋠","\\npreceq",!0);v(T,P,F,"⋨","\\precnsim",!0);v(T,P,F,"⪹","\\precnapprox",!0);v(T,P,F,"≁","\\nsim",!0);v(T,P,F,"","\\@nshortmid");v(T,P,F,"∤","\\nmid",!0);v(T,P,F,"⊬","\\nvdash",!0);v(T,P,F,"⊭","\\nvDash",!0);v(T,P,F,"⋪","\\ntriangleleft");v(T,P,F,"⋬","\\ntrianglelefteq",!0);v(T,P,F,"⊊","\\subsetneq",!0);v(T,P,F,"","\\@varsubsetneq");v(T,P,F,"⫋","\\subsetneqq",!0);v(T,P,F,"","\\@varsubsetneqq");v(T,P,F,"≯","\\ngtr",!0);v(T,P,F,"","\\@ngeqslant");v(T,P,F,"","\\@ngeqq");v(T,P,F,"⪈","\\gneq",!0);v(T,P,F,"≩","\\gneqq",!0);v(T,P,F,"","\\@gvertneqq");v(T,P,F,"⋧","\\gnsim",!0);v(T,P,F,"⪊","\\gnapprox",!0);v(T,P,F,"⊁","\\nsucc",!0);v(T,P,F,"⋡","\\nsucceq",!0);v(T,P,F,"⋩","\\succnsim",!0);v(T,P,F,"⪺","\\succnapprox",!0);v(T,P,F,"≆","\\ncong",!0);v(T,P,F,"","\\@nshortparallel");v(T,P,F,"∦","\\nparallel",!0);v(T,P,F,"⊯","\\nVDash",!0);v(T,P,F,"⋫","\\ntriangleright");v(T,P,F,"⋭","\\ntrianglerighteq",!0);v(T,P,F,"","\\@nsupseteqq");v(T,P,F,"⊋","\\supsetneq",!0);v(T,P,F,"","\\@varsupsetneq");v(T,P,F,"⫌","\\supsetneqq",!0);v(T,P,F,"","\\@varsupsetneqq");v(T,P,F,"⊮","\\nVdash",!0);v(T,P,F,"⪵","\\precneqq",!0);v(T,P,F,"⪶","\\succneqq",!0);v(T,P,F,"","\\@nsubseteqq");v(T,P,$e,"⊴","\\unlhd");v(T,P,$e,"⊵","\\unrhd");v(T,P,F,"↚","\\nleftarrow",!0);v(T,P,F,"↛","\\nrightarrow",!0);v(T,P,F,"⇍","\\nLeftarrow",!0);v(T,P,F,"⇏","\\nRightarrow",!0);v(T,P,F,"↮","\\nleftrightarrow",!0);v(T,P,F,"⇎","\\nLeftrightarrow",!0);v(T,P,F,"△","\\vartriangle");v(T,P,U,"ℏ","\\hslash");v(T,P,U,"▽","\\triangledown");v(T,P,U,"◊","\\lozenge");v(T,P,U,"Ⓢ","\\circledS");v(T,P,U,"®","\\circledR");v(me,P,U,"®","\\circledR");v(T,P,U,"∡","\\measuredangle",!0);v(T,P,U,"∄","\\nexists");v(T,P,U,"℧","\\mho");v(T,P,U,"Ⅎ","\\Finv",!0);v(T,P,U,"⅁","\\Game",!0);v(T,P,U,"‵","\\backprime");v(T,P,U,"▲","\\blacktriangle");v(T,P,U,"▼","\\blacktriangledown");v(T,P,U,"■","\\blacksquare");v(T,P,U,"⧫","\\blacklozenge");v(T,P,U,"★","\\bigstar");v(T,P,U,"∢","\\sphericalangle",!0);v(T,P,U,"∁","\\complement",!0);v(T,P,U,"ð","\\eth",!0);v(me,M,U,"ð","ð");v(T,P,U,"╱","\\diagup");v(T,P,U,"╲","\\diagdown");v(T,P,U,"□","\\square");v(T,P,U,"□","\\Box");v(T,P,U,"◊","\\Diamond");v(T,P,U,"¥","\\yen",!0);v(me,P,U,"¥","\\yen",!0);v(T,P,U,"✓","\\checkmark",!0);v(me,P,U,"✓","\\checkmark");v(T,P,U,"ℶ","\\beth",!0);v(T,P,U,"ℸ","\\daleth",!0);v(T,P,U,"ℷ","\\gimel",!0);v(T,P,U,"ϝ","\\digamma",!0);v(T,P,U,"ϰ","\\varkappa");v(T,P,us,"┌","\\@ulcorner",!0);v(T,P,pi,"┐","\\@urcorner",!0);
366v(T,P,us,"└","\\@llcorner",!0);v(T,P,pi,"┘","\\@lrcorner",!0);v(T,P,F,"≦","\\leqq",!0);v(T,P,F,"⩽","\\leqslant",!0);v(T,P,F,"⪕","\\eqslantless",!0);v(T,P,F,"≲","\\lesssim",!0);v(T,P,F,"⪅","\\lessapprox",!0);v(T,P,F,"≊","\\approxeq",!0);v(T,P,$e,"⋖","\\lessdot");v(T,P,F,"⋘","\\lll",!0);v(T,P,F,"≶","\\lessgtr",!0);v(T,P,F,"⋚","\\lesseqgtr",!0);v(T,P,F,"⪋","\\lesseqqgtr",!0);v(T,P,F,"≑","\\doteqdot");v(T,P,F,"≓","\\risingdotseq",!0);v(T,P,F,"≒","\\fallingdotseq",!0);v(T,P,F,"∽","\\backsim",!0);v(T,P,F,"⋍","\\backsimeq",!0);v(T,P,F,"⫅","\\subseteqq",!0);v(T,P,F,"⋐","\\Subset",!0);v(T,P,F,"⊏","\\sqsubset",!0);v(T,P,F,"≼","\\preccurlyeq",!0);v(T,P,F,"⋞","\\curlyeqprec",!0);v(T,P,F,"≾","\\precsim",!0);v(T,P,F,"⪷","\\precapprox",!0);v(T,P,F,"⊲","\\vartriangleleft");v(T,P,F,"⊴","\\trianglelefteq");v(T,P,F,"⊨","\\vDash",!0);v(T,P,F,"⊪","\\Vvdash",!0);v(T,P,F,"⌣","\\smallsmile");v(T,P,F,"⌢","\\smallfrown");v(T,P,F,"≏","\\bumpeq",!0);v(T,P,F,"≎","\\Bumpeq",!0);v(T,P,F,"≧","\\geqq",!0);v(T,P,F,"⩾","\\geqslant",!0);v(T,P,F,"⪖","\\eqslantgtr",!0);v(T,P,F,"≳","\\gtrsim",!0);v(T,P,F,"⪆","\\gtrapprox",!0);v(T,P,$e,"⋗","\\gtrdot");v(T,P,F,"⋙","\\ggg",!0);v(T,P,F,"≷","\\gtrless",!0);v(T,P,F,"⋛","\\gtreqless",!0);v(T,P,F,"⪌","\\gtreqqless",!0);v(T,P,F,"≖","\\eqcirc",!0);v(T,P,F,"≗","\\circeq",!0);v(T,P,F,"≜","\\triangleq",!0);v(T,P,F,"∼","\\thicksim");v(T,P,F,"≈","\\thickapprox");v(T,P,F,"⫆","\\supseteqq",!0);v(T,P,F,"⋑","\\Supset",!0);v(T,P,F,"⊐","\\sqsupset",!0);v(T,P,F,"≽","\\succcurlyeq",!0);v(T,P,F,"⋟","\\curlyeqsucc",!0);v(T,P,F,"≿","\\succsim",!0);v(T,P,F,"⪸","\\succapprox",!0);v(T,P,F,"⊳","\\vartriangleright");v(T,P,F,"⊵","\\trianglerighteq");v(T,P,F,"⊩","\\Vdash",!0);v(T,P,F,"∣","\\shortmid");v(T,P,F,"∥","\\shortparallel");v(T,P,F,"≬","\\between",!0);v(T,P,F,"⋔","\\pitchfork",!0);v(T,P,F,"∝","\\varpropto");v(T,P,F,"◀","\\blacktriangleleft");v(T,P,F,"∴","\\therefore",!0);v(T,P,F,"∍","\\backepsilon");v(T,P,F,"▶","\\blacktriangleright");v(T,P,F,"∵","\\because",!0);v(T,P,F,"⋘","\\llless");v(T,P,F,"⋙","\\gggtr");v(T,P,$e,"⊲","\\lhd");v(T,P,$e,"⊳","\\rhd");v(T,P,F,"≂","\\eqsim",!0);v(T,M,F,"⋈","\\Join");v(T,P,F,"≑","\\Doteq",!0);v(T,P,$e,"∔","\\dotplus",!0);v(T,P,$e,"∖","\\smallsetminus");v(T,P,$e,"⋒","\\Cap",!0);v(T,P,$e,"⋓","\\Cup",!0);v(T,P,$e,"⩞","\\doublebarwedge",!0);v(T,P,$e,"⊟","\\boxminus",!0);v(T,P,$e,"⊞","\\boxplus",!0);v(T,P,$e,"⋇","\\divideontimes",!0);v(T,P,$e,"⋉","\\ltimes",!0);v(T,P,$e,"⋊","\\rtimes",!0);v(T,P,$e,"⋋","\\leftthreetimes",!0);v(T,P,$e,"⋌","\\rightthreetimes",!0);v(T,P,$e,"⋏","\\curlywedge",!0);v(T,P,$e,"⋎","\\curlyvee",!0);v(T,P,$e,"⊝","\\circleddash",!0);v(T,P,$e,"⊛","\\circledast",!0);v(T,P,$e,"⋅","\\centerdot");v(T,P,$e,"⊺","\\intercal",!0);v(T,P,$e,"⋒","\\doublecap");v(T,P,$e,"⋓","\\doublecup");v(T,P,$e,"⊠","\\boxtimes",!0);v(T,P,F,"⇢","\\dashrightarrow",!0);v(T,P,F,"⇠","\\dashleftarrow",!0);v(T,P,F,"⇇","\\leftleftarrows",!0);v(T,P,F,"⇆","\\leftrightarrows",!0);v(T,P,F,"⇚","\\Lleftarrow",!0);v(T,P,F,"↞","\\twoheadleftarrow",!0);v(T,P,F,"↢","\\leftarrowtail",!0);v(T,P,F,"↫","\\looparrowleft",!0);v(T,P,F,"⇋","\\leftrightharpoons",!0);v(T,P,F,"↶","\\curvearrowleft",!0);v(T,P,F,"↺","\\circlearrowleft",!0);v(T,P,F,"↰","\\Lsh",!0);v(T,P,F,"⇈","\\upuparrows",!0);v(T,P,F,"↿","\\upharpoonleft",!0);v(T,P,F,"⇃","\\downharpoonleft",!0);v(T,M,F,"⊶","\\origof",!0);v(T,M,F,"⊷","\\imageof",!0);v(T,P,F,"⊸","\\multimap",!0);v(T,P,F,"↭","\\leftrightsquigarrow",!0);v(T,P,F,"⇉","\\rightrightarrows",!0);v(T,P,F,"⇄","\\rightleftarrows",!0);v(T,P,F,"↠","\\twoheadrightarrow",!0);v(T,P,F,"↣","\\rightarrowtail",!0);v(T,P,F,"↬","\\looparrowright",!0);v(T,P,F,"↷","\\curvearrowright",!0);v(T,P,F,"↻","\\circlearrowright",!0);v(T,P,F,"↱","\\Rsh",!0);v(T,P,F,"⇊","\\downdownarrows",!0);v(T,P,F,"↾","\\upharpoonright",!0);v(T,P,F,"⇂","\\downharpoonright",!0);v(T,P,F,"⇝","\\rightsquigarrow",!0);v(T,P,F,"⇝","\\leadsto");v(T,P,F,"⇛","\\Rrightarrow",!0);v(T,P,F,"↾","\\restriction");v(T,M,U,"‘","`");v(T,M,U,"$","\\$");v(me,M,U,"$","\\$");v(me,M,U,"$","\\textdollar");
366v(T,M,U,"%","\\%");v(me,M,U,"%","\\%");v(T,M,U,"_","\\_");v(me,M,U,"_","\\_");v(me,M,U,"_","\\textunderscore");v(T,M,U,"∠","\\angle",!0);v(T,M,U,"∞","\\infty",!0);v(T,M,U,"′","\\prime");v(T,M,U,"△","\\triangle");v(T,M,U,"Γ","\\Gamma",!0);v(T,M,U,"Δ","\\Delta",!0);v(T,M,U,"Θ","\\Theta",!0);v(T,M,U,"Λ","\\Lambda",!0);v(T,M,U,"Ξ","\\Xi",!0);v(T,M,U,"Π","\\Pi",!0);v(T,M,U,"Σ","\\Sigma",!0);v(T,M,U,"Υ","\\Upsilon",!0);v(T,M,U,"Φ","\\Phi",!0);v(T,M,U,"Ψ","\\Psi",!0);v(T,M,U,"Ω","\\Omega",!0);v(T,M,U,"A","Α");v(T,M,U,"B","Β");v(T,M,U,"E","Ε");v(T,M,U,"Z","Ζ");v(T,M,U,"H","Η");v(T,M,U,"I","Ι");v(T,M,U,"K","Κ");v(T,M,U,"M","Μ");v(T,M,U,"N","Ν");v(T,M,U,"O","Ο");v(T,M,U,"P","Ρ");v(T,M,U,"T","Τ");v(T,M,U,"X","Χ");v(T,M,U,"¬","\\neg",!0);v(T,M,U,"¬","\\lnot");v(T,M,U,"⊤","\\top");v(T,M,U,"⊥","\\bot");v(T,M,U,"∅","\\emptyset");v(T,P,U,"∅","\\varnothing");v(T,M,ht,"α","\\alpha",!0);v(T,M,ht,"β","\\beta",!0);v(T,M,ht,"γ","\\gamma",!0);v(T,M,ht,"δ","\\delta",!0);v(T,M,ht,"ϵ","\\epsilon",!0);v(T,M,ht,"ζ","\\zeta",!0);v(T,M,ht,"η","\\eta",!0);v(T,M,ht,"θ","\\theta",!0);v(T,M,ht,"ι","\\iota",!0);v(T,M,ht,"κ","\\kappa",!0);v(T,M,ht,"λ","\\lambda",!0);v(T,M,ht,"μ","\\mu",!0);v(T,M,ht,"ν","\\nu",!0);v(T,M,ht,"ξ","\\xi",!0);v(T,M,ht,"ο","\\omicron",!0);v(T,M,ht,"π","\\pi",!0);v(T,M,ht,"ρ","\\rho",!0);v(T,M,ht,"σ","\\sigma",!0);v(T,M,ht,"τ","\\tau",!0);v(T,M,ht,"υ","\\upsilon",!0);v(T,M,ht,"ϕ","\\phi",!0);v(T,M,ht,"χ","\\chi",!0);v(T,M,ht,"ψ","\\psi",!0);v(T,M,ht,"ω","\\omega",!0);v(T,M,ht,"ε","\\varepsilon",!0);v(T,M,ht,"ϑ","\\vartheta",!0);v(T,M,ht,"ϖ","\\varpi",!0);v(T,M,ht,"ϱ","\\varrho",!0);v(T,M,ht,"ς","\\varsigma",!0);v(T,M,ht,"φ","\\varphi",!0);v(T,M,$e,"∗","*",!0);v(T,M,$e,"+","+");v(T,M,$e,"−","-",!0);v(T,M,$e,"⋅","\\cdot",!0);v(T,M,$e,"∘","\\circ",!0);v(T,M,$e,"÷","\\div",!0);v(T,M,$e,"±","\\pm",!0);v(T,M,$e,"×","\\times",!0);v(T,M,$e,"∩","\\cap",!0);v(T,M,$e,"∪","\\cup",!0);v(T,M,$e,"∖","\\setminus",!0);v(T,M,$e,"∧","\\land");v(T,M,$e,"∨","\\lor");v(T,M,$e,"∧","\\wedge",!0);v(T,M,$e,"∨","\\vee",!0);v(T,M,U,"√","\\surd");v(T,M,us,"⟨","\\langle",!0);v(T,M,us,"∣","\\lvert");v(T,M,us,"∥","\\lVert");v(T,M,pi,"?","?");v(T,M,pi,"!","!");v(T,M,pi,"⟩","\\rangle",!0);v(T,M,pi,"∣","\\rvert");v(T,M,pi,"∥","\\rVert");v(T,M,F,"=","=");v(T,M,F,":",":");v(T,M,F,"≈","\\approx",!0);v(T,M,F,"≅","\\cong",!0);v(T,M,F,"≥","\\ge");v(T,M,F,"≥","\\geq",!0);v(T,M,F,"←","\\gets");v(T,M,F,">","\\gt",!0);v(T,M,F,"∈","\\in",!0);v(T,M,F,"","\\@not");v(T,M,F,"⊂","\\subset",!0);v(T,M,F,"⊃","\\supset",!0);v(T,M,F,"⊆","\\subseteq",!0);v(T,M,F,"⊇","\\supseteq",!0);v(T,P,F,"⊈","\\nsubseteq",!0);v(T,P,F,"⊉","\\nsupseteq",!0);v(T,M,F,"⊨","\\models");v(T,M,F,"←","\\leftarrow",!0);v(T,M,F,"≤","\\le");v(T,M,F,"≤","\\leq",!0);v(T,M,F,"<","\\lt",!0);v(T,M,F,"→","\\rightarrow",!0);v(T,M,F,"→","\\to");v(T,P,F,"≱","\\ngeq",!0);v(T,P,F,"≰","\\nleq",!0);v(T,M,wl," ","\\ ");v(T,M,wl," ","\\space");v(T,M,wl," ","\\nobreakspace");v(me,M,wl," ","\\ ");v(me,M,wl," "," ");v(me,M,wl," ","\\space");v(me,M,wl," ","\\nobreakspace");v(T,M,wl,null,"\\nobreak");v(T,M,wl,null,"\\allowbreak");v(T,M,jw,",",",");v(T,M,jw,";",";");v(T,P,$e,"⊼","\\barwedge",!0);v(T,P,$e,"⊻","\\veebar",!0);v(T,M,$e,"⊙","\\odot",!0);v(T,M,$e,"⊕","\\oplus",!0);v(T,M,$e,"⊗","\\otimes",!0);v(T,M,U,"∂","\\partial",!0);v(T,M,$e,"⊘","\\oslash",!0);v(T,P,$e,"⊚","\\circledcirc",!0);v(T,P,$e,"⊡","\\boxdot",!0);
vendor: 4,795 bytes, line 366
366v(T,M,$e,"△","\\bigtriangleup");v(T,M,$e,"▽","\\bigtriangledown");v(T,M,$e,"†","\\dagger");v(T,M,$e,"⋄","\\diamond");v(T,M,$e,"⋆","\\star");v(T,M,$e,"◃","\\triangleleft");v(T,M,$e,"▹","\\triangleright");v(T,M,us,"{","\\{");v(me,M,U,"{","\\{");v(me,M,U,"{","\\textbraceleft");v(T,M,pi,"}","\\}");v(me,M,U,"}","\\}");v(me,M,U,"}","\\textbraceright");v(T,M,us,"{","\\lbrace");v(T,M,pi,"}","\\rbrace");v(T,M,us,"[","\\lbrack",!0);v(me,M,U,"[","\\lbrack",!0);v(T,M,pi,"]","\\rbrack",!0);v(me,M,U,"]","\\rbrack",!0);v(T,M,us,"(","\\lparen",!0);v(T,M,pi,")","\\rparen",!0);v(me,M,U,"<","\\textless",!0);v(me,M,U,">","\\textgreater",!0);v(T,M,us,"⌊","\\lfloor",!0);v(T,M,pi,"⌋","\\rfloor",!0);v(T,M,us,"⌈","\\lceil",!0);v(T,M,pi,"⌉","\\rceil",!0);v(T,M,U,"\\","\\backslash");v(T,M,U,"∣","|");v(T,M,U,"∣","\\vert");v(me,M,U,"|","\\textbar",!0);v(T,M,U,"∥","\\|");v(T,M,U,"∥","\\Vert");v(me,M,U,"∥","\\textbardbl");v(me,M,U,"~","\\textasciitilde");v(me,M,U,"\\","\\textbackslash");v(me,M,U,"^","\\textasciicircum");v(T,M,F,"↑","\\uparrow",!0);v(T,M,F,"⇑","\\Uparrow",!0);v(T,M,F,"↓","\\downarrow",!0);v(T,M,F,"⇓","\\Downarrow",!0);v(T,M,F,"↕","\\updownarrow",!0);v(T,M,F,"⇕","\\Updownarrow",!0);v(T,M,Yr,"∐","\\coprod");v(T,M,Yr,"⋁","\\bigvee");v(T,M,Yr,"⋀","\\bigwedge");v(T,M,Yr,"⨄","\\biguplus");v(T,M,Yr,"⋂","\\bigcap");v(T,M,Yr,"⋃","\\bigcup");v(T,M,Yr,"∫","\\int");v(T,M,Yr,"∫","\\intop");v(T,M,Yr,"∬","\\iint");v(T,M,Yr,"∭","\\iiint");v(T,M,Yr,"∏","\\prod");v(T,M,Yr,"∑","\\sum");v(T,M,Yr,"⨂","\\bigotimes");v(T,M,Yr,"⨁","\\bigoplus");v(T,M,Yr,"⨀","\\bigodot");v(T,M,Yr,"∮","\\oint");v(T,M,Yr,"∯","\\oiint");v(T,M,Yr,"∰","\\oiiint");v(T,M,Yr,"⨆","\\bigsqcup");v(T,M,Yr,"∫","\\smallint");v(me,M,c0,"…","\\textellipsis");v(T,M,c0,"…","\\mathellipsis");v(me,M,c0,"…","\\ldots",!0);v(T,M,c0,"…","\\ldots",!0);v(T,M,c0,"⋯","\\@cdots",!0);v(T,M,c0,"⋱","\\ddots",!0);v(T,M,U,"⋮","\\varvdots");v(me,M,U,"⋮","\\varvdots");v(T,M,Mr,"ˊ","\\acute");v(T,M,Mr,"ˋ","\\grave");v(T,M,Mr,"¨","\\ddot");v(T,M,Mr,"~","\\tilde");v(T,M,Mr,"ˉ","\\bar");v(T,M,Mr,"˘","\\breve");v(T,M,Mr,"ˇ","\\check");v(T,M,Mr,"^","\\hat");v(T,M,Mr,"⃗","\\vec");v(T,M,Mr,"˙","\\dot");v(T,M,Mr,"˚","\\mathring");v(T,M,ht,"","\\@imath");v(T,M,ht,"","\\@jmath");v(T,M,U,"ı","ı");v(T,M,U,"ȷ","ȷ");v(me,M,U,"ı","\\i",!0);v(me,M,U,"ȷ","\\j",!0);v(me,M,U,"ß","\\ss",!0);v(me,M,U,"æ","\\ae",!0);v(me,M,U,"œ","\\oe",!0);v(me,M,U,"ø","\\o",!0);v(me,M,U,"Æ","\\AE",!0);v(me,M,U,"Œ","\\OE",!0);v(me,M,U,"Ø","\\O",!0);v(me,M,Mr,"ˊ","\\'");v(me,M,Mr,"ˋ","\\`");v(me,M,Mr,"ˆ","\\^");v(me,M,Mr,"˜","\\~");v(me,M,Mr,"ˉ","\\=");v(me,M,Mr,"˘","\\u");v(me,M,Mr,"˙","\\.");v(me,M,Mr,"¸","\\c");v(me,M,Mr,"˚","\\r");v(me,M,Mr,"ˇ","\\v");v(me,M,Mr,"¨",'\\"');v(me,M,Mr,"˝","\\H");v(me,M,Mr,"◯","\\textcircled");var IV={"--":!0,"---":!0,"``":!0,"''":!0};v(me,M,U,"–","--",!0);v(me,M,U,"–","\\textendash");v(me,M,U,"—","---",!0);v(me,M,U,"—","\\textemdash");v(me,M,U,"‘","`",!0);v(me,M,U,"‘","\\textquoteleft");v(me,M,U,"’","'",!0);v(me,M,U,"’","\\textquoteright");v(me,M,U,"“","``",!0);v(me,M,U,"“","\\textquotedblleft");v(me,M,U,"”","''",!0);v(me,M,U,"”","\\textquotedblright");v(T,M,U,"°","\\degree",!0);v(me,M,U,"°","\\degree");v(me,M,U,"°","\\textdegree",!0);v(T,M,U,"£","\\pounds");v(T,M,U,"£","\\mathsterling",!0);v(me,M,U,"£","\\pounds");v(me,M,U,"£","\\textsterling",!0);v(T,P,U,"✠","\\maltese");v(me,P,U,"✠","\\maltese");var vD='0123456789/@."';for(var gk=0;gk<vD.length;gk++){var wD=vD.charAt(gk);v(T,M,U,wD,wD)}var kD='0123456789!@*()-=+";:?/.,';for(var yk=0;yk<kD.length;yk++){var CD=kD.charAt(yk);v(me,M,U,CD,CD)}var $x="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(var bk=0;bk<$x.length;bk++){var Yy=$x.charAt(bk);v(T,M,ht,Yy,Yy),v(me,M,U,Yy,Yy)}v(T,P,U,"C","ℂ");v(me,P,U,"C","ℂ");v(T,P,U,"H","ℍ");v(me,P,U,"H","ℍ");v(T,P,U,"N","ℕ");v(me,P,U,"N","ℕ");v(T,P,U,"P","ℙ");v(me,P,U,"P","ℙ");v(T,P,U,"Q","ℚ");v(me,P,U,"Q","ℚ");v(T,P,U,"R","ℝ");v(me,P,U,"R","ℝ");v(T,P,U,"Z","ℤ");v(me,P,U,"Z","ℤ");v(T,M,ht,"h","ℎ");v(me,M,ht,"h","ℎ");var mt="";for(var Yn=0;Yn<$x.length;Yn++){var Br=$x.charAt(Yn);mt=String.fromCharCode(55349,56320+Yn),v(T,M,ht,Br,mt),v(me,M,U,Br,mt),mt=String.fromCharCode(55349,56372+Yn),v(T,M,ht,Br,mt),v(me,M,U,Br,mt),mt=String.fromCharCode(55349,56424+Yn),v(T,M,ht,Br,mt),v(me,M,U,Br,mt),mt=String.fromCharCode(55349,56580+Yn),v(T,M,ht,Br,mt),v(me,M,U,Br,mt),mt=String.fromCharCode(55349,56684+Yn),v(T,M,ht,Br,mt),v(me,M,U,Br,mt),mt=String.fromCharCode(55349,56736+Yn),v(T,M,ht,Br,mt),v(me,M,U,Br,mt),mt=String.fromCharCode(55349,56788+Yn),v(T,M,ht,Br,mt),v(me,M,U,Br,mt),mt=String.fromCharCode(55349,56840+Yn
vendor: 5,952 bytes, line 366
366),v(T,M,ht,Br,mt),v(me,M,U,Br,mt),mt=String.fromCharCode(55349,56944+Yn),v(T,M,ht,Br,mt),v(me,M,U,Br,mt),Yn<26&&(mt=String.fromCharCode(55349,56632+Yn),v(T,M,ht,Br,mt),v(me,M,U,Br,mt),mt=String.fromCharCode(55349,56476+Yn),v(T,M,ht,Br,mt),v(me,M,U,Br,mt))}mt="𝕜";v(T,M,ht,"k",mt);v(me,M,U,"k",mt);for(var Gc=0;Gc<10;Gc++){var Al=Gc.toString();mt=String.fromCharCode(55349,57294+Gc),v(T,M,ht,Al,mt),v(me,M,U,Al,mt),mt=String.fromCharCode(55349,57314+Gc),v(T,M,ht,Al,mt),v(me,M,U,Al,mt),mt=String.fromCharCode(55349,57324+Gc),v(T,M,ht,Al,mt),v(me,M,U,Al,mt),mt=String.fromCharCode(55349,57334+Gc),v(T,M,ht,Al,mt),v(me,M,U,Al,mt)}var xS="ÐÞþ";for(var xk=0;xk<xS.length;xk++){var Xy=xS.charAt(xk);v(T,M,ht,Xy,Xy),v(me,M,U,Xy,Xy)}var Jy=[["mathbf","textbf","Main-Bold"],["mathbf","textbf","Main-Bold"],["mathnormal","textit","Math-Italic"],["mathnormal","textit","Math-Italic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["mathscr","textscr","Script-Regular"],["","",""],["","",""],["","",""],["mathfrak","textfrak","Fraktur-Regular"],["mathfrak","textfrak","Fraktur-Regular"],["mathbb","textbb","AMS-Regular"],["mathbb","textbb","AMS-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathitsf","textitsf","SansSerif-Italic"],["mathitsf","textitsf","SansSerif-Italic"],["","",""],["","",""],["mathtt","texttt","Typewriter-Regular"],["mathtt","texttt","Typewriter-Regular"]],SD=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],d5e=function(e,r){var n=e.charCodeAt(0),i=e.charCodeAt(1),s=(n-55296)*1024+(i-56320)+65536,o=r==="math"?0:1;if(119808<=s&&s<120484){var a=Math.floor((s-119808)/26);return[Jy[a][2],Jy[a][o]]}else if(120782<=s&&s<=120831){var l=Math.floor((s-120782)/10);return[SD[l][2],SD[l][o]]}else{if(s===120485||s===120486)return[Jy[0][2],Jy[0][o]];if(120486<s&&s<120782)return["",""];throw new be("Unsupported character: "+e)}},Uw=function(e,r,n){return mr[n][e]&&mr[n][e].replace&&(e=mr[n][e].replace),{value:e,metrics:V9(e,r,n)}},Us=function(e,r,n,i,s){var o=Uw(e,r,n),a=o.metrics;e=o.value;var l;if(a){var c=a.italic;(n==="text"||i&&i.font==="mathit")&&(c=0),l=new Is(e,a.height,a.depth,c,a.skew,a.width,s)}else typeof console<"u"&&console.warn("No character metrics "+("for '"+e+"' in style '"+r+"' and mode '"+n+"'")),l=new Is(e,0,0,0,0,0,s);if(i){l.maxFontSize=i.sizeMultiplier,i.style.isTight()&&l.classes.push("mtight");var h=i.getColor();h&&(l.style.color=h)}return l},f5e=function(e,r,n,i){return i===void 0&&(i=[]),n.font==="boldsymbol"&&Uw(e,"Main-Bold",r).metrics?Us(e,"Main-Bold",r,n,i.concat(["mathbf"])):e==="\\"||mr[r][e].font==="main"?Us(e,"Main-Regular",r,n,i):Us(e,"AMS-Regular",r,n,i.concat(["amsrm"]))},p5e=function(e,r,n,i,s){return s!=="textord"&&Uw(e,"Math-BoldItalic",r).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}},m5e=function(e,r,n){var i=e.mode,s=e.text,o=["mord"],a=i==="math"||i==="text"&&r.font,l=a?r.font:r.fontFamily,c="",h="";if(s.charCodeAt(0)===55349&&([c,h]=d5e(s,i)),c.length>0)return Us(s,c,i,r,o.concat(h));if(l){var u,d;if(l==="boldsymbol"){var f=p5e(s,i,r,o,n);u=f.fontName,d=[f.fontClass]}else a?(u=PV[l].fontName,d=[l]):(u=Zy(l,r.fontWeight,r.fontShape),d=[l,r.fontWeight,r.fontShape]);if(Uw(s,u,i).metrics)return Us(s,u,i,r,o.concat(d));if(IV.hasOwnProperty(s)&&u.slice(0,10)==="Typewriter"){for(var p=[],m=0;m<s.length;m++)p.push(Us(s[m],u,i,r,o.concat(d)));return RV(p)}}if(n==="mathord")return Us(s,"Math-Italic",i,r,o.concat(["mathnormal"]));if(n==="textord"){var g=mr[i][s]&&mr[i][s].font;if(g==="ams"){var y=Zy("amsrm",r.fontWeight,r.fontShape);return Us(s,y,i,r,o.concat("amsrm",r.fontWeight,r.fontShape))}else if(g==="main"||!g){var b=Zy("textrm",r.fontWeight,r.fontShape);return Us(s,b,i,r,o.concat(r.fontWeight,r.fontShape))}else{var x=Zy(g,r.fontWeight,r.fontShape);return Us(s,x,i,r,o.concat(x,r.fontWeight,r.fontShape))}}else throw new Error("unexpected type: "+n+" in makeOrd")},g5e=(t,e)=>{if(wc(t.classes)!==wc(e.classes)||t.skew!==e.skew||t.maxFontSize!==e.maxFontSize)return!1;if(t.classes.length===1){var r=t.classes[0];if(r==="mbin"||r==="mord")return!1}for(var n in t.style)if(t.style.hasOwnProperty(n)&&t.style[n]!==e.style[n])return!1;for(var i in e.style)if(e.style.hasOwnProperty(i)&&t.style[i]!==e.style[i])return!1;return!0},y5e=t=>{for(var e=0;e<t.length-1;e++){var r=t[e],n=t[e+1];r instanceof Is&&n instanceof Is&&g5e(r,n)&&(r.text+=n.text,r.height=Math.max(r.height,n.height),r.depth=Math.max(r.depth,n.depth),r.italic=n.italic,t.splice(e+1,1),e--)}return t},j9=function(e){for(var r=0,n=0,i=0,s=0;s<e.children.length;s++){var o=e.children[s];o.height>r&&(r=o.height),o.depth>n&&(n=o.depth),o.maxFontSize>i&&(i=o.maxFontSize)}e.height=r,e.depth=n,e.maxFontSize=i},wi=function(e,r,n,i){var s=new j1(e,r,n,i);return j9(s),s},BV=(t,e,r,n)=>new j1(t,e,r,n),b5e=function(e,r,n){var i=wi([e],[],r);return i.height=Math.max(n||r.fontMetrics().defaultRuleThickness,r.minRuleThickness),i.style.borderBottomWidth=Me(i.height),i.maxFontSize=1,i},x5e=function(e,r,n,i){var s=new W9(e,r,n,i);return j9(s),s},RV=function(e){var r=new W1(e);return j9(r),r},v5e=function(e,r){return e instanceof W1?wi([],[e],r):e},w5e=function(e){if(e.positionType==="individualShift"){for(var r=e.children,n=[r[0]],i=-r[0].shift-r[0].elem.depth,s=i,o=1;o<r.length;o++){var a=-r[o].shift-s-r[o].elem.depth,l=a-(r[o-1].elem.height+r[o-1].elem.depth);s=s+a,n.push({type:"kern",size:l}),n.push(r[o])}return{children:n,depth:i}}var c;if(e.positionType==="top"){for(var h=e.positionData,u=0;u<e.children.length;u++){var d=e.children[u];
vendor: 5,009 bytes, line 366
366h-=d.type==="kern"?d.size:d.elem.height+d.elem.depth}c=h}else if(e.positionType==="bottom")c=-e.positionData;else{var f=e.children[0];if(f.type!=="elem")throw new Error('First child must have type "elem".');if(e.positionType==="shift")c=-f.elem.depth-e.positionData;else if(e.positionType==="firstBaseline")c=-f.elem.depth;else throw new Error("Invalid positionType "+e.positionType+".")}return{children:e.children,depth:c}},k5e=function(e,r){for(var{children:n,depth:i}=w5e(e),s=0,o=0;o<n.length;o++){var a=n[o];if(a.type==="elem"){var l=a.elem;s=Math.max(s,l.maxFontSize,l.height)}}s+=2;var c=wi(["pstrut"],[]);c.style.height=Me(s);for(var h=[],u=i,d=i,f=i,p=0;p<n.length;p++){var m=n[p];if(m.type==="kern")f+=m.size;else{var g=m.elem,y=m.wrapperClasses||[],b=m.wrapperStyle||{},x=wi(y,[c,g],void 0,b);x.style.top=Me(-s-f-g.depth),m.marginLeft&&(x.style.marginLeft=m.marginLeft),m.marginRight&&(x.style.marginRight=m.marginRight),h.push(x),f+=g.height+g.depth}u=Math.min(u,f),d=Math.max(d,f)}var S=wi(["vlist"],h);S.style.height=Me(d);var k;if(u<0){var w=wi([],[]),_=wi(["vlist"],[w]);_.style.height=Me(-u);var L=wi(["vlist-s"],[new Is("​")]);k=[wi(["vlist-r"],[S,L]),wi(["vlist-r"],[_])]}else k=[wi(["vlist-r"],[S])];var B=wi(["vlist-t"],k);return k.length===2&&B.classes.push("vlist-t2"),B.height=d,B.depth=-u,B},C5e=(t,e)=>{var r=wi(["mspace"],[],e),n=Lr(t,e);return r.style.marginRight=Me(n),r},Zy=function(e,r,n){var i="";switch(e){case"amsrm":i="AMS";break;case"textrm":i="Main";break;case"textsf":i="SansSerif";break;case"texttt":i="Typewriter";break;default:i=e}var s;return r==="textbf"&&n==="textit"?s="BoldItalic":r==="textbf"?s="Bold":r==="textit"?s="Italic":s="Regular",i+"-"+s},PV={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},NV={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},S5e=function(e,r){var[n,i,s]=NV[e],o=new kc(n),a=new ll([o],{width:Me(i),height:Me(s),style:"width:"+Me(i),viewBox:"0 0 "+1e3*i+" "+1e3*s,preserveAspectRatio:"xMinYMin"}),l=BV(["overlay"],[a],r);return l.height=s,l.style.height=Me(s),l.style.width=Me(i),l},Z={fontMap:PV,makeSymbol:Us,mathsym:f5e,makeSpan:wi,makeSvgSpan:BV,makeLineSpan:b5e,makeAnchor:x5e,makeFragment:RV,wrapFragment:v5e,makeVList:k5e,makeOrd:m5e,makeGlue:C5e,staticSvg:S5e,svgData:NV,tryCombineChars:y5e},Er={number:3,unit:"mu"},Kc={number:4,unit:"mu"},va={number:5,unit:"mu"},T5e={mord:{mop:Er,mbin:Kc,mrel:va,minner:Er},mop:{mord:Er,mop:Er,mrel:va,minner:Er},mbin:{mord:Kc,mop:Kc,mopen:Kc,minner:Kc},mrel:{mord:va,mop:va,mopen:va,minner:va},mopen:{},mclose:{mop:Er,mbin:Kc,mrel:va,minner:Er},mpunct:{mord:Er,mop:Er,mrel:va,mopen:Er,mclose:Er,mpunct:Er,minner:Er},minner:{mord:Er,mop:Er,mbin:Kc,mrel:va,mopen:Er,mpunct:Er,minner:Er}},_5e={mord:{mop:Er},mop:{mord:Er,mop:Er},mbin:{},mrel:{},mopen:{},mclose:{mop:Er},mpunct:{},minner:{mop:Er}},FV={},zx={},Hx={};function De(t){for(var{type:e,names:r,props:n,handler:i,htmlBuilder:s,mathmlBuilder:o}=t,a={type:e,numArgs:n.numArgs,argTypes:n.argTypes,allowedInArgument:!!n.allowedInArgument,allowedInText:!!n.allowedInText,allowedInMath:n.allowedInMath===void 0?!0:n.allowedInMath,numOptionalArgs:n.numOptionalArgs||0,infix:!!n.infix,primitive:!!n.primitive,handler:i},l=0;l<r.length;++l)FV[r[l]]=a;e&&(s&&(zx[e]=s),o&&(Hx[e]=o))}function Iu(t){var{type:e,htmlBuilder:r,mathmlBuilder:n}=t;De({type:e,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:r,mathmlBuilder:n})}var qx=function(e){return e.type==="ordgroup"&&e.body.length===1?e.body[0]:e},$r=function(e){return e.type==="ordgroup"?e.body:[e]},cl=Z.makeSpan,M5e=["leftmost","mbin","mopen","mrel","mop","mpunct"],A5e=["rightmost","mrel","mclose","mpunct"],E5e={display:ut.DISPLAY,text:ut.TEXT,script:ut.SCRIPT,scriptscript:ut.SCRIPTSCRIPT},O5e={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},tn=function(e,r,n,i){i===void 0&&(i=[null,null]);for(var s=[],o=0;o<e.length;o++){var a=qt(e[o],r);if(a instanceof W1){var l=a.children;s.push(...l)}else s.push(a)}if(Z.tryCombineChars(s),!n)return s;var c=r;if(e.length===1){var h=e[0];h.type==="sizing"?c=r.havingSize(h.size):h.type==="styling"&&(c=r.havingStyle(E5e[h.style]))}var u=cl([i[0]||"leftmost"],[],r),d=cl([i[1]||"rightmost"],[],r),f=n==="root";
vendor: 9,267 bytes, line 366
366return TD(s,(p,m)=>{var g=m.classes[0],y=p.classes[0];g==="mbin"&&ot.contains(A5e,y)?m.classes[0]="mord":y==="mbin"&&ot.contains(M5e,g)&&(p.classes[0]="mord")},{node:u},d,f),TD(s,(p,m)=>{var g=vS(m),y=vS(p),b=g&&y?p.hasClass("mtight")?_5e[g][y]:T5e[g][y]:null;if(b)return Z.makeGlue(b,c)},{node:u},d,f),s},TD=function t(e,r,n,i,s){i&&e.push(i);for(var o=0;o<e.length;o++){var a=e[o],l=$V(a);if(l){t(l.children,r,n,null,s);continue}var c=!a.hasClass("mspace");if(c){var h=r(a,n.node);h&&(n.insertAfter?n.insertAfter(h):(e.unshift(h),o++))}c?n.node=a:s&&a.hasClass("newline")&&(n.node=cl(["leftmost"])),n.insertAfter=(u=>d=>{e.splice(u+1,0,d),o++})(o)}i&&e.pop()},$V=function(e){return e instanceof W1||e instanceof W9||e instanceof j1&&e.hasClass("enclosing")?e:null},L5e=function t(e,r){var n=$V(e);if(n){var i=n.children;if(i.length){if(r==="right")return t(i[i.length-1],"right");if(r==="left")return t(i[0],"left")}}return e},vS=function(e,r){return e?(r&&(e=L5e(e,r)),O5e[e.classes[0]]||null):null},Mg=function(e,r){var n=["nulldelimiter"].concat(e.baseSizingClasses());return cl(r.concat(n))},qt=function(e,r,n){if(!e)return cl();if(zx[e.type]){var i=zx[e.type](e,r);if(n&&r.size!==n.size){i=cl(r.sizingClasses(n),[i],r);var s=r.sizeMultiplier/n.sizeMultiplier;i.height*=s,i.depth*=s}return i}else throw new be("Got group of unknown type: '"+e.type+"'")};function Qy(t,e){var r=cl(["base"],t,e),n=cl(["strut"]);return n.style.height=Me(r.height+r.depth),r.depth&&(n.style.verticalAlign=Me(-r.depth)),r.children.unshift(n),r}function wS(t,e){var r=null;t.length===1&&t[0].type==="tag"&&(r=t[0].tag,t=t[0].body);var n=tn(t,e,"root"),i;n.length===2&&n[1].hasClass("tag")&&(i=n.pop());for(var s=[],o=[],a=0;a<n.length;a++)if(o.push(n[a]),n[a].hasClass("mbin")||n[a].hasClass("mrel")||n[a].hasClass("allowbreak")){for(var l=!1;a<n.length-1&&n[a+1].hasClass("mspace")&&!n[a+1].hasClass("newline");)a++,o.push(n[a]),n[a].hasClass("nobreak")&&(l=!0);l||(s.push(Qy(o,e)),o=[])}else n[a].hasClass("newline")&&(o.pop(),o.length>0&&(s.push(Qy(o,e)),o=[]),s.push(n[a]));o.length>0&&s.push(Qy(o,e));var c;r?(c=Qy(tn(r,e,!0)),c.classes=["tag"],s.push(c)):i&&s.push(i);var h=cl(["katex-html"],s);if(h.setAttribute("aria-hidden","true"),c){var u=c.children[0];u.style.height=Me(h.height+h.depth),h.depth&&(u.style.verticalAlign=Me(-h.depth))}return h}function zV(t){return new W1(t)}class es{constructor(e,r,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=r||[],this.classes=n||[]}setAttribute(e,r){this.attributes[e]=r}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&e.setAttribute(r,this.attributes[r]);this.classes.length>0&&(e.className=wc(this.classes));for(var n=0;n<this.children.length;n++)if(this.children[n]instanceof Uo&&this.children[n+1]instanceof Uo){for(var i=this.children[n].toText()+this.children[++n].toText();this.children[n+1]instanceof Uo;)i+=this.children[++n].toText();e.appendChild(new Uo(i).toNode())}else e.appendChild(this.children[n].toNode());return e}toMarkup(){var e="<"+this.type;for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&(e+=" "+r+'="',e+=ot.escape(this.attributes[r]),e+='"');this.classes.length>0&&(e+=' class ="'+ot.escape(wc(this.classes))+'"'),e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+="</"+this.type+">",e}toText(){return this.children.map(e=>e.toText()).join("")}}class Uo{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return ot.escape(this.toText())}toText(){return this.text}}class D5e{constructor(e){this.width=void 0,this.character=void 0,this.width=e,e>=.05555&&e<=.05556?this.character=" ":e>=.1666&&e<=.1667?this.character=" ":e>=.2222&&e<=.2223?this.character=" ":e>=.2777&&e<=.2778?this.character="  ":e>=-.05556&&e<=-.05555?this.character=" ⁣":e>=-.1667&&e<=-.1666?this.character=" ⁣":e>=-.2223&&e<=-.2222?this.character=" ⁣":e>=-.2778&&e<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",Me(this.width)),e}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+Me(this.width)+'"/>'}toText(){return this.character?this.character:" "}}var ye={MathNode:es,TextNode:Uo,SpaceNode:D5e,newDocumentFragment:zV},Bs=function(e,r,n){return mr[r][e]&&mr[r][e].replace&&e.charCodeAt(0)!==55349&&!(IV.hasOwnProperty(e)&&n&&(n.fontFamily&&n.fontFamily.slice(4,6)==="tt"||n.font&&n.font.slice(4,6)==="tt"))&&(e=mr[r][e].replace),new ye.TextNode(e)},U9=function(e){return e.length===1?e[0]:new ye.MathNode("mrow",e)},G9=function(e,r){if(r.fontFamily==="texttt")return"monospace";if(r.fontFamily==="textsf")return r.fontShape==="textit"&&r.fontWeight==="textbf"?"sans-serif-bold-italic":r.fontShape==="textit"?"sans-serif-italic":r.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(r.fontShape==="textit"&&r.fontWeight==="textbf")return"bold-italic";if(r.fontShape==="textit")return"italic";if(r.fontWeight==="textbf")return"bold";var n=r.font;if(!n||n==="mathnormal")return null;var i=e.mode;if(n==="mathit")return"italic";if(n==="boldsymbol")return e.type==="textord"?"bold":"bold-italic";if(n==="mathbf")return"bold";if(n==="mathbb")return"double-struck";if(n==="mathsfit")return"sans-serif-italic";if(n==="mathfrak")return"fraktur";if(n==="mathscr"||n==="mathcal")return"script";if(n==="mathsf")return"sans-serif";if(n==="mathtt")return"monospace";var s=e.text;if(ot.contains(["\\imath","\\jmath"],s))return null;mr[i][s]&&mr[i][s].replace&&(s=mr[i][s].replace);var o=Z.fontMap[n].fontName;return V9(s,o,i)?Z.fontMap[n].variant:null};function vk(t){if(!t)return!1;if(t.type==="mi"&&t.children.length===1){var e=t.children[0];return e instanceof Uo&&e.text==="."}else if(t.type==="mo"&&t.children.length===1&&t.getAttribute("separator")==="true"&&t.getAttribute("lspace")==="0em"&&t.getAttribute("rspace")==="0em"){var r=t.children[0];return r instanceof Uo&&r.text===","}else return!1}var $i=function(e,r,n){if(e.length===1){var i=hr(e[0],r);return n&&i instanceof es&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var s=[],o,a=0;a<e.length;a++){var l=hr(e[a],r);if(l instanceof es&&o instanceof es){if(l.type==="mtext"&&o.type==="mtext"&&l.getAttribute("mathvariant")===o.getAttribute("mathvariant")){o.children.push(...l.children);continue}else if(l.type==="mn"&&o.type==="mn"){o.children.push(...l.children);continue}else if(vk(l)&&o.type==="mn"){o.children.push(...l.children);continue}else if(l.type==="mn"&&vk(o))l.children=[...o.children,...l.children],s.pop();else if((l.type==="msup"||l.type==="msub")&&l.children.length>=1&&(o.type==="mn"||vk(o))){var c=l.children[0];c instanceof es&&c.type==="mn"&&(c.children=[...o.children,...c.children],s.pop())}else if(o.type==="mi"&&o.children.length===1){var h=o.children[0];if(h instanceof Uo&&h.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var u=l.children[0];u instanceof Uo&&u.text.length>0&&(u.text=u.text.slice(0,1)+"̸"+u.text.slice(1),s.pop())}}}s.push(l),o=l}return s},Cc=function(e,r,n){return U9($i(e,r,n))},hr=function(e,r){if(!e)return new ye.MathNode("mrow");if(Hx[e.type]){var n=Hx[e.type](e,r);return n}else throw new be("Got group of unknown type: '"+e.type+"'")};function _D(t,e,r,n,i){var s=$i(t,r),o;s.length===1&&s[0]instanceof es&&ot.contains(["mrow","mtable"],s[0].type)?o=s[0]:o=new ye.MathNode("mrow",s);var a=new ye.MathNode("annotation",[new ye.TextNode(e)]);a.setAttribute("encoding","application/x-tex");var l=new ye.MathNode("semantics",[o,a]),c=new ye.MathNode("math",[l]);c.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),n&&c.setAttribute("display","block");var h=i?"katex":"katex-mathml";return Z.makeSpan([h],[c])}var HV=function(e){return new Ba({style:e.displayMode?ut.DISPLAY:ut.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},qV=function(e,r){if(r.displayMode){var n=["katex-display"];r.leqno&&n.push("leqno"),r.fleqn&&n.push("fleqn"),e=Z.makeSpan(n,[e])}return e},I5e=function(e,r,n){var i=HV(n),s;if(n.output==="mathml")return _D(e,r,i,n.displayMode,!0);if(n.output==="html"){var o=wS(e,i);s=Z.makeSpan(["katex"],[o])}else{var a=_D(e,r,i,n.displayMode,!1),l=wS(e,i);s=Z.makeSpan(["katex"],[a,l])}return qV(s,n)},B5e=function(e,r,n){var i=HV(n),s=wS(e,i),o=Z.makeSpan(["katex"],[s]);return qV(o,n)},R5e={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xma
vendor: 78,599 bytes, lines 366-367
366psto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},P5e=function(e){var r=new ye.MathNode("mo",[new ye.TextNode(R5e[e.replace(/^\\/,"")])]);return r.setAttribute("stretchy","true"),r},N5e={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},F5e=function(e){return e.type==="ordgroup"?e.body.length:1},$5e=function(e,r){function n(){var a=4e5,l=e.label.slice(1);if(ot.contains(["widehat","widecheck","widetilde","utilde"],l)){var c=e,h=F5e(c.base),u,d,f;if(h>5)l==="widehat"||l==="widecheck"?(u=420,a=2364,f=.42,d=l+"4"):(u=312,a=2340,f=.34,d="tilde4");else{var p=[1,1,2,2,3,3][h];l==="widehat"||l==="widecheck"?(a=[0,1062,2364,2364,2364][p],u=[0,239,300,360,420][p],f=[0,.24,.3,.3,.36,.42][p],d=l+p):(a=[0,600,1033,2339,2340][p],u=[0,260,286,306,312][p],f=[0,.26,.286,.3,.306,.34][p],d="tilde"+p)}var m=new kc(d),g=new ll([m],{width:"100%",height:Me(f),viewBox:"0 0 "+a+" "+u,preserveAspectRatio:"none"});return{span:Z.makeSvgSpan([],[g],r),minWidth:0,height:f}}else{var y=[],b=N5e[l],[x,S,k]=b,w=k/1e3,_=x.length,L,B;if(_===1){var E=b[3];L=["hide-tail"],B=[E]}else if(_===2)L=["halfarrow-left","halfarrow-right"],B=["xMinYMin","xMaxYMin"];else if(_===3)L=["brace-left","brace-center","brace-right"],B=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support
367                    `+_+" children.");for(var D=0;D<_;D++){var N=new kc(x[D]),K=new ll([N],{width:"400em",height:Me(w),viewBox:"0 0 "+a+" "+k,preserveAspectRatio:B[D]+" slice"}),z=Z.makeSvgSpan([L[D]],[K],r);if(_===1)return{span:z,minWidth:S,height:w};z.style.height=Me(w),y.push(z)}return{span:Z.makeSpan(["stretchy"],y,r),minWidth:S,height:w}}}var{span:i,minWidth:s,height:o}=n();return i.height=o,i.style.height=Me(o),s>0&&(i.style.minWidth=Me(s)),i},z5e=function(e,r,n,i,s){var o,a=e.height+e.depth+n+i;if(/fbox|color|angl/.test(r)){if(o=Z.makeSpan(["stretchy",r],[],s),r==="fbox"){var l=s.color&&s.getColor();l&&(o.style.borderColor=l)}}else{var c=[];/^[bx]cancel$/.test(r)&&c.push(new bS({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(r)&&c.push(new bS({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var h=new ll(c,{width:"100%",height:Me(a)});o=Z.makeSvgSpan([],[h],s)}return o.height=a,o.style.height=Me(a),o},hl={encloseSpan:z5e,mathMLnode:P5e,svgSpan:$5e};function _t(t,e){if(!t||t.type!==e)throw new Error("Expected node of type "+e+", but got "+(t?"node of type "+t.type:String(t)));return t}function K9(t){var e=Gw(t);if(!e)throw new Error("Expected node of symbol group type, but got "+(t?"node of type "+t.type:String(t)));return e}function Gw(t){return t&&(t.type==="atom"||u5e.hasOwnProperty(t.type))?t:null}var Y9=(t,e)=>{var r,n,i;t&&t.type==="supsub"?(n=_t(t.base,"accent"),r=n.base,t.base=r,i=c5e(qt(t,e)),t.base=n):(n=_t(t,"accent"),r=n.base);var s=qt(r,e.havingCrampedStyle()),o=n.isShifty&&ot.isCharacterBox(r),a=0;if(o){var l=ot.getBaseElem(r),c=qt(l,e.havingCrampedStyle());a=xD(c).skew}var h=n.label==="\\c",u=h?s.height+s.depth:Math.min(s.height,e.fontMetrics().xHeight),d;if(n.isStretchy)d=hl.svgSpan(n,e),d=Z.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"elem",elem:d,wrapperClasses:["svg-align"],wrapperStyle:a>0?{width:"calc(100% - "+Me(2*a)+")",marginLeft:Me(2*a)}:void 0}]},e);else{var f,p;n.label==="\\vec"?(f=Z.staticSvg("vec",e),p=Z.svgData.vec[1]):(f=Z.makeOrd({mode:n.mode,text:n.label},e,"textord"),f=xD(f),f.italic=0,p=f.width,h&&(u+=f.depth)),d=Z.makeSpan(["accent-body"],[f]);var m=n.label==="\\textcircled";m&&(d.classes.push("accent-full"),u=s.height);var g=a;m||(g-=p/2),d.style.left=Me(g),n.label==="\\textcircled"&&(d.style.top=".2em"),d=Z.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:-u},{type:"elem",elem:d}]},e)}var y=Z.makeSpan(["mord","accent"],[d],e);return i?(i.children[0]=y,i.height=Math.max(y.height,i.height),i.classes[0]="mord",i):y},VV=(t,e)=>{var r=t.isStretchy?hl.mathMLnode(t.label):new ye.MathNode("mo",[Bs(t.label,t.mode)]),n=new ye.MathNode("mover",[hr(t.base,e),r]);return n.setAttribute("accent","true"),n},H5e=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(t=>"\\"+t).join("|"));De({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(t,e)=>{var r=qx(e[0]),n=!H5e.test(t.funcName),i=!n||t.funcName==="\\widehat"||t.funcName==="\\widetilde"||t.funcName==="\\widecheck";return{type:"accent",mode:t.parser.mode,label:t.funcName,isStretchy:n,isShifty:i,base:r}},htmlBuilder:Y9,mathmlBuilder:VV});De({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(t,e)=>{var r=e[0],n=t.parser.mode;return n==="math"&&(t.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+t.funcName+" works only in text mode"),n="text"),{type:"accent",mode:n,label:t.funcName,isStretchy:!1,isShifty:!0,base:r}},htmlBuilder:Y9,mathmlBuilder:VV});De({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"accentUnder",mode:r.mode,label:n,base:i}},htmlBuilder:(t,e)=>{var r=qt(t.base,e),n=hl.svgSpan(t,e),i=t.label==="\\utilde"?.12:0,s=Z.makeVList({positionType:"top",positionData:r.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:r}]},e);return Z.makeSpan(["mord","accentunder"],[s],e)},mathmlBuilder:(t,e)=>{var r=hl.mathMLnode(t.label),n=new ye.MathNode("munder",[hr(t.base,e),r]);return n.setAttribute("accentunder","true"),n}});var e2=t=>{var e=new ye.MathNode("mpadded",t?[t]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};De({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,r){var{parser:n,funcName:i}=t;return{type:"xArrow",mode:n.mode,label:i,body:e[0],below:r[0]}},htmlBuilder(t,e){var r=e.style,n=e.havingStyle(r.sup()),i=Z.wrapFragment(qt(t.body,n,e),e),s=t.label.slice(0,2)==="\\x"?"x":"cd";i.classes.push(s+"-arrow-pad");var o;t.below&&(n=e.havingStyle(r.sub()),o=Z.wrapFragment(qt(t.below,n,e),e),o.classes.push(s+"-arrow-pad"));var a=hl.svgSpan(t,e),l=-e.fontMetrics().axisHeight+.5*a.height,c=-e.fontMetrics().axisHeight-.5*a.height-.111;(i.depth>.25||t.label==="\\xleftequilibrium")&&(c-=i.depth);var h;if(o){var u=-e.fontMetrics().axisHeight+o.height+.5*a.height+.111;h=Z.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:c},{type:"elem",elem:a,shift:l},{type:"elem",elem:o,shift:u}]},e)}else h=Z.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:c},{type:"elem",elem:a,shift:l}]},e);return h.children[0].children[0].children[1].classes.push("svg-align"),Z.makeSpan(["mrel","x-arrow"],[h],e)},mathmlBuilder(t,e){var r=hl.mathMLnode(t.label);r.setAttribute("minsize",t.label.charAt(0)==="x"?"1.75em":"3.0em");var n;if(t.body){var i=e2(hr(t.body,e));if(t.below){var s=e2(hr(t.below,e));n=new ye.MathNode("munderover",[r,s,i])}else n=new ye.MathNode("mover",[r,i])}else if(t.below){var o=e2(hr(t.below,e));n=new ye.MathNode("munder",[r,o])}else n=e2(),n=new ye.MathNode("mover",[r,n]);return n}});var q5e=Z.makeSpan;function WV(t,e){var r=tn(t.body,e,!0);return q5e([t.mclass],r,e)}function jV(t,e){var r,n=$i(t.body,e);return t.mclass==="minner"?r=new ye.MathNode("mpadded",n):t.mclass==="mord"?t.isCharacterBox?(r=n[0],r.type="mi"):r=new ye.MathNode("mi",n):(t.isCharacterBox?(r=n[0],r.type="mo"):r=new ye.MathNode("mo",n),t.mclass==="mbin"?(r.attributes.lspace="0.22em",r.attributes.rspace="0.22em"):t.mclass==="mpunct"?(r.attributes.lspace="0em",r.attributes.rspace="0.17em"):t.mclass==="mopen"||t.mclass==="mclose"?(r.attributes.lspace="0em",r.attributes.rspace="0em"):t.mclass==="minner"&&(r.attributes.lspace="0.0556em",r.attributes.width="+0.1111em")),r}De({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"mclass",mode:r.mode,mclass:"m"+n.slice(5),body:$r(i),isCharacterBox:ot.isCharacterBox(i)}},htmlBuilder:WV,mathmlBuilder:jV});var Kw=t=>{var e=t.type==="ordgroup"&&t.body.length?t.body[0]:t;return e.type==="atom"&&(e.family==="bin"||e.family==="rel")?"m"+e.family:"mord"};De({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(t,e){var{parser:r}=t;return{type:"mclass",mode:r.mode,mclass:Kw(e[0]),body:$r(e[1]),isCharacterBox:ot.isCharacterBox(e[1])}}});De({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(t,e){var{parser:r,funcName:n}=t,i=e[1],s=e[0],o;n!=="\\stackrel"?o=Kw(i):o="mrel";var a={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:n!=="\\stackrel",body:$r(i)},l={type:"supsub",mode:s.mode,base:a,sup:n==="\\underset"?null:s,sub:n==="\\underset"?s:null};return{type:"mclass",mode:r.mode,mclass:o,body:[l],isCharacterBox:ot.isCharacterBox(l)}},htmlBuilder:WV,mathmlBuilder:jV});De({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"pmb",mode:r.mode,mclass:Kw(e[0]),body:$r(e[0])}},htmlBuilder(t,e){var r=tn(t.body,e,!0),n=Z.makeSpan([t.mclass],r,e);return n.style.textShadow="0.02em 0.01em 0.04px",n},mathmlBuilder(t,e){var r=$i(t.body,e),n=new ye.MathNode("mstyle",r);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});var V5e={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},MD=()=>({type:"styling",body:[],mode:"math",style:"display"}),AD=t=>t.type==="textord"&&t.text==="@",W5e=(t,e)=>(t.type==="mathord"||t.type==="atom")&&t.text===e;function j5e(t,e,r){var n=V5e[t];switch(n){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return r.callFunction(n,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":{var i=r.callFunction("\\\\cdleft",[e[0]],[]),s={type:"atom",text:n,mode:"math",family:"rel"},o=r.callFunction("\\Big",[s],[]),a=r.callFunction("\\\\cdright",[e[1]],[]),l={type:"ordgroup",mode:"math",body:[i,o,a]};return r.callFunction("\\\\cdparent",[l],[])}case"\\\\cdlongequal":return r.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var c={type:"textord",text:"\\Vert",mode:"math"};return r.callFunction("\\Big",[c],[])}default:return{type:"textord",text:" ",mode:"math"}}}function U5e(t){var e=[];for(t.gullet.beginGroup(),t.gullet.macros.set("\\cr","\\\\\\relax"),t.gullet.beginGroup();;){e.push(t.parseExpression(!1,"\\\\")),t.gullet.endGroup(),t.gullet.beginGroup();var r=t.fetch().text;if(r==="&"||r==="\\\\")t.consume();else if(r==="\\end"){e[e.length-1].length===0&&e.pop();break}else throw new be("Expected \\\\ or \\cr or \\end",t.nextToken)}for(var n=[],i=[n],s=0;s<e.length;s++){for(var o=e[s],a=MD(),l=0;l<o.length;l++)if(!AD(o[l]))a.body.push(o[l]);else{n.push(a),l+=1;var c=K9(o[l]).text,h=new Array(2);if(h[0]={type:"ordgroup",mode:"math",body:[]},h[1]={type:"ordgroup",mode:"math",body:[]},!("=|.".indexOf(c)>-1))if("<>AV".indexOf(c)>-1)for(var u=0;u<2;u++){for(var d=!0,f=l+1;f<o.length;f++){if(W5e(o[f],c)){d=!1,l=f;break}if(AD(o[f]))throw new be("Missing a "+c+" character to complete a CD arrow.",o[f]);h[u].body.push(o[f])}if(d)throw new be("Missing a "+c+" character to complete a CD arrow.",o[l])}else throw new be('Expected one of "<>AV=|." after @',o[l]);var p=j5e(c,h,t),m={type:"styling",body:[p],mode:"math",style:"display"};n.push(m),a=MD()}s%2===0?n.push(a):n.shift(),n=[],i.push(n)}t.gullet.endGroup(),t.gullet.endGroup();var g=new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:g,colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}De({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t;return{type:"cdlabel",mode:r.mode,side:n.slice(4),label:e[0]}},htmlBuilder(t,e){var r=e.havingStyle(e.style.sup()),n=Z.wrapFragment(qt(t.label,r,e),e);return n.classes.push("cd-label-"+t.side),n.style.bottom=Me(.8-n.depth),n.height=0,n.depth=0,n},mathmlBuilder(t,e){var r=new ye.MathNode("mrow",[hr(t.label,e)]);return r=new ye.MathNode("mpadded",[r]),r.setAttribute("width","0"),t.side==="left"&&r.setAttribute("lspace","-1width"),r.setAttribute("voffset","0.7em"),r=new ye.MathNode("mstyle",[r]),r.setAttribute("displaystyle","false"),r.setAttribute("scriptlevel","1"),r}});De({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(t,e){var{parser:r}=t;return{type:"cdlabelparent",mode:r.mode,fragment:e[0]}},htmlBuilder(t,e){var r=Z.wrapFragment(qt(t.fragment,e),e);return r.classes.push("cd-vert-arrow"),r},mathmlBuilder(t,e){return new ye.MathNode("mrow",[hr(t.fragment,e)])}});De({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(t,e){for(var{parser:r}=t,n=_t(e[0],"ordgroup"),i=n.body,s="",o=0;o<i.length;o++){var a=_t(i[o],"textord");s+=a.text}var l=parseInt(s),c;if(isNaN(l))throw new be("\\@char has non-numeric argument "+s);if(l<0||l>=1114111)throw new be("\\@char with invalid code point "+s);return l<=65535?c=String.fromCharCode(l):(l-=65536,c=String.fromCharCode((l>>10)+55296,(l&1023)+56320)),{type:"textord",mode:r.mode,text:c}}});var UV=(t,e)=>{var r=tn(t.body,e.withColor(t.color),!1);return Z.makeFragment(r)},GV=(t,e)=>{var r=$i(t.body,e.withColor(t.color)),n=new ye.MathNode("mstyle",r);return n.setAttribute("mathcolor",t.color),n};De({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(t,e){var{parser:r}=t,n=_t(e[0],"color-token").color,i=e[1];return{type:"color",mode:r.mode,color:n,body:$r(i)}},htmlBuilder:UV,mathmlBuilder:GV});De({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(t,e){var{parser:r,breakOnTokenText:n}=t,i=_t(e[0],"color-token").color;r.gullet.macros.set("\\current@color",i);var s=r.parseExpression(!0,n);return{type:"color",mode:r.mode,color:i,body:s}},htmlBuilder:UV,mathmlBuilder:GV});De({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(t,e,r){var{parser:n}=t,i=n.gullet.future().text==="["?n.parseSizeGroup(!0):null,s=!n.settings.displayMode||!n.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:n.mode,newLine:s,size:i&&_t(i,"size").value}},htmlBuilder(t,e){var r=Z.makeSpan(["mspace"],[],e);return t.newLine&&(r.classes.push("newline"),t.size&&(r.style.marginTop=Me(Lr(t.size,e)))),r},mathmlBuilder(t,e){var r=new ye.MathNode("mspace");return t.newLine&&(r.setAttribute("linebreak","newline"),t.size&&r.setAttribute("height",Me(Lr(t.size,e)))),r}});var kS={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},KV=t=>{var e=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new be("Expected a control sequence",t);return e},G5e=t=>{var e=t.gullet.popToken();return e.text==="="&&(e=t.gullet.popToken(),e.text===" "&&(e=t.gullet.popToken())),e},YV=(t,e,r,n)=>{var i=t.gullet.macros.get(r.text);i==null&&(r.noexpand=!0,i={tokens:[r],numArgs:0,unexpandable:!t.gullet.isExpandable(r.text)}),t.gullet.macros.set(e,i,n)};De({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(t){var{parser:e,funcName:r}=t;e.consumeSpaces();var n=e.fetch();if(kS[n.text])return(r==="\\global"||r==="\\\\globallong")&&(n.text=kS[n.text]),_t(e.parseFunction(),"internal");throw new be("Invalid token after macro prefix",n)}});De({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=e.gullet.popToken(),i=n.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new be("Expected a control sequence",n);for(var s=0,o,a=[[]];e.gullet.future().text!=="{";)if(n=e.gullet.popToken(),n.text==="#"){if(e.gullet.future().text==="{"){o=e.gullet.future(),a[s].push("{");break}if(n=e.gullet.popToken(),!/^[1-9]$/.test(n.text))throw new be('Invalid argument number "'+n.text+'"');if(parseInt(n.text)!==s+1)throw new be('Argument number "'+n.text+'" out of order');s++,a.push([])}else{if(n.text==="EOF")throw new be("Expected a macro definition");a[s].push(n.text)}var{tokens:l}=e.gullet.consumeArg();return o&&l.unshift(o),(r==="\\edef"||r==="\\xdef")&&(l=e.gullet.expandTokens(l),l.reverse()),e.gullet.macros.set(i,{tokens:l,numArgs:s,delimiters:a},r===kS[r]),{type:"internal",mode:e.mode}}});De({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=KV(e.gullet.popToken());e.gullet.consumeSpaces();var i=G5e(e);return YV(e,n,i,r==="\\\\globallet"),{type:"internal",mode:e.mode}}});De({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=KV(e.gullet.popToken()),i=e.gullet.popToken(),s=e.gullet.popToken();return YV(e,n,s,r==="\\\\globalfuture"),e.gullet.pushToken(s),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});var Sp=function(e,r,n){var i=mr.math[e]&&mr.math[e].replace,s=V9(i||e,r,n);if(!s)throw new Error("Unsupported symbol "+e+" and font size "+r+".");return s},X9=function(e,r,n,i){var s=n.havingBaseStyle(r),o=Z.makeSpan(i.concat(s.sizingClasses(n)),[e],n),a=s.sizeMultiplier/n.sizeMultiplier;return o.height*=a,o.depth*=a,o.maxFontSize=s.sizeMultiplier,o},XV=function(e,r,n){var i=r.havingBaseStyle(n),s=(1-r.sizeMultiplier/i.sizeMultiplier)*r.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=Me(s),e.height-=s,e.depth+=s},K5e=function(e,r,n,i,s,o){var a=Z.makeSymbol(e,"Main-Regular",s,i),l=X9(a,r,i,o);return n&&XV(l,i,r),l},Y5e=function(e,r,n,i){return Z.makeSymbol(e,"Size"+r+"-Regular",n,i)},JV=function(e,r,n,i,s,o){var a=Y5e(e,r,s,i),l=X9(Z.makeSpan(["delimsizing","size"+r],[a],i),ut.TEXT,i,o);return n&&XV(l,i,ut.TEXT),l},wk=function(e,r,n){var i;r==="Size1-Regular"?i="delim-size1":i="delim-size4";var s=Z.makeSpan(["delimsizinginner",i],[Z.makeSpan([],[Z.makeSymbol(e,r,n)])]);return{type:"elem",elem:s}},kk=function(e,r,n){var i=jo["Size4-Regular"][e.charCodeAt(0)]?jo["Size4-Regular"][e.charCodeAt(0)][4]:jo["Size1-Regular"][e.charCodeAt(0)][4],s=new kc("inner",t5e(e,Math.round(1e3*r))),o=new ll([s],{width:Me(i),height:Me(r),style:"width:"+Me(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*r),preserveAspectRatio:"xMinYMin"}),a=Z.makeSvgSpan([],[o],n);return a.height=r,a.style.height=Me(r),a.style.width=Me(i),{type:"elem",elem:a}},CS=.008,t2={type:"kern",size:-1*CS},X5e=["|","\\lvert","\\rvert","\\vert"],J5e=["\\|","\\lVert","\\rVert","\\Vert"],ZV=function(e,r,n,i,s,o){var a,l,c,h,u="",d=0;a=c=h=e,l=null;var f="Size1-Regular";e==="\\uparrow"?c=h="⏐":e==="\\Uparrow"?c=h="‖":e==="\\downarrow"?a=c="⏐":e==="\\Downarrow"?a=c="‖":e==="\\updownarrow"?(a="\\uparrow",c="⏐",h="\\downarrow"):e==="\\Updownarrow"?(a="\\Uparrow",c="‖",h="\\Downarrow"):ot.contains(X5e,e)?(c="∣",u="vert",d=333):ot.contains(J5e,e)?(c="∥",u="doublevert",d=556):e==="["||e==="\\lbrack"?(a="⎡",c="⎢",h="⎣",f="Size4-Regular",u="lbrack",d=667):e==="]"||e==="\\rbrack"?(a="⎤",c="⎥",h="⎦",f="Size4-Regular",u="rbrack",d=667):e==="\\lfloor"||e==="⌊"?(c=a="⎢",h="⎣",f="Size4-Regular",u="lfloor",d=667):e==="\\lceil"||e==="⌈"?(a="⎡",c=h="⎢",f="Size4-Regular",u="lceil",d=667):e==="\\rfloor"||e==="⌋"?(c=a="⎥",h="⎦",f="Size4-Regular",u="rfloor",d=667):e==="\\rceil"||e==="⌉"?(a="⎤",c=h="⎥",f="Size4-Regular",u="rceil",d=667):e==="("||e==="\\lparen"?(a="⎛",c="⎜",h="⎝",f="Size4-Regular",u="lparen",d=875):e===")"||e==="\\rparen"?(a="⎞",c="⎟",h="⎠",f="Size4-Regular",u="rparen",d=875):e==="\\{"||e==="\\lbrace"?(a="⎧",l="⎨",h="⎩",c="⎪",f="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(a="⎫",l="⎬",h="⎭",c="⎪",f="Size4-Regular"):e==="\\lgroup"||e==="⟮"?(a="⎧",h="⎩",c="⎪",f="Size4-Regular"):e==="\\rgroup"||e==="⟯"?(a="⎫",h="⎭",c="⎪",f="Size4-Regular"):e==="\\lmoustache"||e==="⎰"?(a="⎧",h="⎭",c="⎪",f="Size4-Regular"):(e==="\\rmoustache"||e==="⎱")&&(a="⎫",h="⎩",c="⎪",f="Size4-Regular");var p=Sp(a,f,s),m=p.height+p.depth,g=Sp(c,f,s),y=g.height+g.depth,b=Sp(h,f,s),x=b.height+b.depth,S=0,k=1;if(l!==null){var w=Sp(l,f,s);S=w.height+w.depth,k=2}var _=m+x+S,L=Math.max(0,Math.ceil((r-_)/(k*y))),B=_+L*k*y,E=i.fontMetrics().axisHeight;n&&(E*=i.sizeMultiplier);var D=B/2-E,N=[];if(u.length>0){var K=B-m-x,z=Math.round(B*1e3),$=r5e(u,Math.round(K*1e3)),H=new kc(u,$),j=(d/1e3).toFixed(3)+"em",q=(z/1e3).toFixed(3)+"em",ne=new ll([H],{width:j,height:q,viewBox:"0 0 "+d+" "+z}),O=Z.makeSvgSpan([],[ne],i);O.height=z/1e3,O.style.width=j,O.style.height=q,N.push({type:"elem",elem:O})}else{if(N.push(wk(h,f,s)),N.push(t2),l===null){var fe=B-m-x+2*CS;N.push(kk(c,fe,i))}else{var Te=(B-m-x-S)/2+2*CS;N.push(kk(c,Te,i)),N.push(t2),N.push(wk(l,f,s)),N.push(t2),N.push(kk(c,Te,i))}N.push(t2),N.push(wk(a,f,s))}var I=i.havingBaseStyle(ut.TEXT),tt=Z.makeVList({positionType:"bottom",positionData:D,children:N},I);return X9(Z.makeSpan(["delimsizing","mult"],[tt],I),ut.TEXT,i,o)},Ck=80,Sk=.08,Tk=function(e,r,n,i,s){var o=e5e(e,i,n),a=new kc(e,o),l=new ll([a],{width:"400em",height:Me(r),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return Z.makeSvgSpan(["hide-tail"],[l],s)},Z5e=function(e,r){var n=r.havingBaseSizing(),i=rW("\\surd",e*n.sizeMultiplier,tW,n),s=n.sizeMultiplier,o=Math.max(0,r.minRuleThickness-r.fontMetrics().sqrtRuleThickness),a,l=0,c=0,h=0,u;return i.type==="small"?(h=1e3+1e3*o+Ck,e<1?s=1:e<1.4&&(s=.7),l=(1+o+Sk)/s,c=(1+o)/s,a=Tk("sqrtMain",l,h,o,r),a.style.minWidth="0.853em",u=.833/s):i.type==="large"?(h=(1e3+Ck)*Lm[i.size],c=(Lm[i.size]+o)/s,l=(Lm[i.size]+o+Sk)/s,a=Tk("sqrtSize"+i.size,l,h,o,r),a.style.minWidth="1.02em",u=1/s):(l=e+o+Sk,c=e+o,h=Math.floor(1e3*e+o)+Ck,a=Tk("sqrtTall",l,h,o,r),a.style.minWidth="0.742em",u=1.056),a.height=c,a.style.height=Me(l),{span:a,advanceWidth:u,ruleWidth:(r.fontMetrics().sqrtRuleThickness+o)*s}},QV=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],Q5e=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],eW=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],Lm=[0,1.2,1.8,2.4,3],eke=function(e,r,n,i,s){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),ot.contains(QV,e)||ot.contains(eW,e))return JV(e,r,!1,n,i,s);if(ot.contains(Q5e,e))return ZV(e,Lm[r],!1,n,i,s);throw new be("Illegal delimiter: '"+e+"'")},tke=[{type:"small",style:ut.SCRIPTSCRIPT},{type:"small",style:ut.SCRIPT},{type:"small",style:ut.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],rke=[{type:"small",style:ut.SCRIPTSCRIPT},{type:"small",style:ut.SCRIPT},{type:"small",style:ut.TEXT},{type:"stack"}],tW=[{type:"small",style:ut.SCRIPTSCRIPT},{type:"small",style:ut.SCRIPT},{type:"small",style:ut.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],nke=function(e){if(e.type==="small")return"Main-Regular";if(e.type==="large")return"Size"+e.size+"-Regular";if(e.type==="stack")return"Size4-Regular";throw new Error("Add support for delim type '"+e.type+"' here.")},rW=function(e,r,n,i){for(var s=Math.min(2,3-i.style.size),o=s;o<n.length&&n[o].type!=="stack";o++){var a=Sp(e,nke(n[o]),"math"),l=a.height+a.depth;if(n[o].type==="small"){var c=i.havingBaseStyle(n[o].style);l*=c.sizeMultiplier}if(l>r)return n[o]}return n[n.length-1]},nW=function(e,r,n,i,s,o){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var a;ot.contains(eW,e)?a=tke:ot.contains(QV,e)?a=tW:a=rke;var l=rW(e,r,a,i);return l.type==="small"?K5e(e,l.style,n,i,s,o):l.type==="large"?JV(e,l.size,n,i,s,o):ZV(e,r,n,i,s,o)},ike=function(e,r,n,i,s,o){var a=i.fontMetrics().axisHeight*i.sizeMultiplier,l=901,c=5/i.fontMetrics().ptPerEm,h=Math.max(r-a,n+a),u=Math.max(h/500*l,2*h-c);return nW(e,u,!0,i,s,o)},Qa={sqrtImage:Z5e,sizedDelim:eke,sizeToMaxHeight:Lm,customSizedDelim:nW,leftRightDelim:ike},ED={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},ske=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function Yw(t,e){var r=Gw(t);if(r&&ot.contains(ske,r.text))return r;throw r?new be("Invalid delimiter '"+r.text+"' after '"+e.funcName+"'",t):new be("Invalid delimiter type '"+t.type+"'",t)}De({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(t,e)=>{var r=Yw(e[0],t);return{type:"delimsizing",mode:t.parser.mode,size:ED[t.funcName].size,mclass:ED[t.funcName].mclass,delim:r.text}},htmlBuilder:(t,e)=>t.delim==="."?Z.makeSpan([t.mclass]):Qa.sizedDelim(t.delim,t.size,e,t.mode,[t.mclass]),mathmlBuilder:t=>{var e=[];t.delim!=="."&&e.push(Bs(t.delim,t.mode));var r=new ye.MathNode("mo",e);t.mclass==="mopen"||t.mclass==="mclose"?r.setAttribute("fence","true"):r.setAttribute("fence","false"),r.setAttribute("stretchy","true");var n=Me(Qa.sizeToMaxHeight[t.size]);return r.setAttribute("minsize",n),r.setAttribute("maxsize",n),r}});function OD(t){if(!t.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}De({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=t.parser.gullet.macros.get("\\current@color");if(r&&typeof r!="string")throw new be("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:t.parser.mode,delim:Yw(e[0],t).text,color:r}}});De({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=Yw(e[0],t),n=t.parser;++n.leftrightDepth;var i=n.parseExpression(!1);--n.leftrightDepth,n.expect("\\right",!1);var s=_t(n.parseFunction(),"leftright-right");return{type:"leftright",mode:n.mode,body:i,left:r.text,right:s.delim,rightColor:s.color}},htmlBuilder:(t,e)=>{OD(t);for(var r=tn(t.body,e,!0,["mopen","mclose"]),n=0,i=0,s=!1,o=0;o<r.length;o++)r[o].isMiddle?s=!0:(n=Math.max(r[o].height,n),i=Math.max(r[o].depth,i));n*=e.sizeMultiplier,i*=e.sizeMultiplier;var a;if(t.left==="."?a=Mg(e,["mopen"]):a=Qa.leftRightDelim(t.left,n,i,e,t.mode,["mopen"]),r.unshift(a),s)for(var l=1;l<r.length;l++){var c=r[l],h=c.isMiddle;h&&(r[l]=Qa.leftRightDelim(h.delim,n,i,h.options,t.mode,[]))}var u;if(t.right===".")u=Mg(e,["mclose"]);else{var d=t.rightColor?e.withColor(t.rightColor):e;u=Qa.leftRightDelim(t.right,n,i,d,t.mode,["mclose"])}return r.push(u),Z.makeSpan(["minner"],r,e)},mathmlBuilder:(t,e)=>{OD(t);var r=$i(t.body,e);if(t.left!=="."){var n=new ye.MathNode("mo",[Bs(t.left,t.mode)]);n.setAttribute("fence","true"),r.unshift(n)}if(t.right!=="."){var i=new ye.MathNode("mo",[Bs(t.right,t.mode)]);i.setAttribute("fence","true"),t.rightColor&&i.setAttribute("mathcolor",t.rightColor),r.push(i)}return U9(r)}});De({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=Yw(e[0],t);if(!t.parser.leftrightDepth)throw new be("\\middle without preceding \\left",r);return{type:"middle",mode:t.parser.mode,delim:r.text}},htmlBuilder:(t,e)=>{var r;if(t.delim===".")r=Mg(e,[]);else{r=Qa.sizedDelim(t.delim,1,e,t.mode,[]);var n={delim:t.delim,options:e};r.isMiddle=n}return r},mathmlBuilder:(t,e)=>{var r=t.delim==="\\vert"||t.delim==="|"?Bs("|","text"):Bs(t.delim,t.mode),n=new ye.MathNode("mo",[r]);return n.setAttribute("fence","true"),n.setAttribute("lspace","0.05em"),n.setAttribute("rspace","0.05em"),n}});var J9=(t,e)=>{var r=Z.wrapFragment(qt(t.body,e),e),n=t.label.slice(1),i=e.sizeMultiplier,s,o=0,a=ot.isCharacterBox(t.body);if(n==="sout")s=Z.makeSpan(["stretchy","sout"]),s.height=e.fontMetrics().defaultRuleThickness/i,o=-.5*e.fontMetrics().xHeight;else if(n==="phase"){var l=Lr({number:.6,unit:"pt"},e),c=Lr({number:.35,unit:"ex"},e),h=e.havingBaseSizing();i=i/h.sizeMultiplier;var u=r.height+r.depth+l+c;r.style.paddingLeft=Me(u/2+l);var d=Math.floor(1e3*u*i),f=Z4e(d),p=new ll([new kc("phase",f)],{width:"400em",height:Me(d/1e3),viewBox:"0 0 400000 "+d,preserveAspectRatio:"xMinYMin slice"});s=Z.makeSvgSpan(["hide-tail"],[p],e),s.style.height=Me(u),o=r.depth+l+c}else{/cancel/.test(n)?a||r.classes.push("cancel-pad"):n==="angl"?r.classes.push("anglpad"):r.classes.push("boxpad");var m=0,g=0,y=0;/box/.test(n)?(y=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),m=e.fontMetrics().fboxsep+(n==="colorbox"?0:y),g=m):n==="angl"?(y=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness),m=4*y,g=Math.max(0,.25-r.depth)):(m=a?.2:0,g=m),s=hl.encloseSpan(r,n,m,g,e),/fbox|boxed|fcolorbox/.test(n)?(s.style.borderStyle="solid",s.style.borderWidth=Me(y)):n==="angl"&&y!==.049&&(s.style.borderTopWidth=Me(y),s.style.borderRightWidth=Me(y)),o=r.depth+g,t.backgroundColor&&(s.style.backgroundColor=t.backgroundColor,t.borderColor&&(s.style.borderColor=t.borderColor))}var b;if(t.backgroundColor)b=Z.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:o},{type:"elem",elem:r,shift:0}]},e);else{var x=/cancel|phase/.test(n)?["svg-align"]:[];b=Z.makeVList({positionType:"individualShift",children:[{type:"elem",elem:r,shift:0},{type:"elem",elem:s,shift:o,wrapperClasses:x}]},e)}return/cancel/.test(n)&&(b.height=r.height,b.depth=r.depth),/cancel/.test(n)&&!a?Z.makeSpan(["mord","cancel-lap"],[b],e):Z.makeSpan(["mord"],[b],e)},Z9=(t,e)=>{var r=0,n=new ye.MathNode(t.label.indexOf("colorbox")>-1?"mpadded":"menclose",[hr(t.body,e)]);switch(t.label){case"\\cancel":n.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":n.setAttribute("notation","downdiagonalstrike");break;case"\\phase":n.setAttribute("notation","phasorangle");break;case"\\sout":n.setAttribute("notation","horizontalstrike");break;case"\\fbox":n.setAttribute("notation","box");break;case"\\angl":n.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(r=e.fontMetrics().fboxsep*e.fontMetrics().ptPerEm,n.setAttribute("width","+"+2*r+"pt"),n.setAttribute("height","+"+2*r+"pt"),n.setAttribute("lspace",r+"pt"),n.setAttribute("voffset",r+"pt"),t.label==="\\fcolorbox"){var i=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness);n.setAttribute("style","border: "+i+"em solid "+String(t.borderColor))}break;case"\\xcancel":n.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return t.backgroundColor&&n.setAttribute("mathbackground",t.backgroundColor),n};De({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(t,e,r){var{parser:n,funcName:i}=t,s=_t(e[0],"color-token").color,o=e[1];return{type:"enclose",mode:n.mode,label:i,backgroundColor:s,body:o}},htmlBuilder:J9,mathmlBuilder:Z9});De({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(t,e,r){var{parser:n,funcName:i}=t,s=_t(e[0],"color-token").color,o=_t(e[1],"color-token").color,a=e[2];return{type:"enclose",mode:n.mode,label:i,backgroundColor:o,borderColor:s,body:a}},htmlBuilder:J9,mathmlBuilder:Z9});De({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"enclose",mode:r.mode,label:"\\fbox",body:e[0]}}});De({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"enclose",mode:r.mode,label:n,body:i}},htmlBuilder:J9,mathmlBuilder:Z9});De({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(t,e){var{parser:r}=t;return{type:"enclose",mode:r.mode,label:"\\angl",body:e[0]}}});var iW={};function ua(t){for(var{type:e,names:r,props:n,handler:i,htmlBuilder:s,mathmlBuilder:o}=t,a={type:e,numArgs:n.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},l=0;l<r.length;++l)iW[r[l]]=a;s&&(zx[e]=s),o&&(Hx[e]=o)}var sW={};function A(t,e){sW[t]=e}function LD(t){var e=[];t.consumeSpaces();var r=t.fetch().text;for(r==="\\relax"&&(t.consume(),t.consumeSpaces(),r=t.fetch().text);r==="\\hline"||r==="\\hdashline";)t.consume(),e.push(r==="\\hdashline"),t.consumeSpaces(),r=t.fetch().text;return e}var Xw=t=>{var e=t.parser.settings;if(!e.displayMode)throw new be("{"+t.envName+"} can be used only in display mode.")};function Q9(t){if(t.indexOf("ed")===-1)return t.indexOf("*")===-1}function Nc(t,e,r){var{hskipBeforeAndAfter:n,addJot:i,cols:s,arraystretch:o,colSeparationType:a,autoTag:l,singleRow:c,emptySingleRow:h,maxNumCols:u,leqno:d}=e;if(t.gullet.beginGroup(),c||t.gullet.macros.set("\\cr","\\\\\\relax"),!o){var f=t.gullet.expandMacroAsText("\\arraystretch");if(f==null)o=1;else if(o=parseFloat(f),!o||o<0)throw new be("Invalid \\arraystretch: "+f)}t.gullet.beginGroup();var p=[],m=[p],g=[],y=[],b=l!=null?[]:void 0;function x(){l&&t.gullet.macros.set("\\@eqnsw","1",!0)}function S(){b&&(t.gullet.macros.get("\\df@tag")?(b.push(t.subparse([new Es("\\df@tag")])),t.gullet.macros.set("\\df@tag",void 0,!0)):b.push(!!l&&t.gullet.macros.get("\\@eqnsw")==="1"))}for(x(),y.push(LD(t));;){var k=t.parseExpression(!1,c?"\\end":"\\\\");t.gullet.endGroup(),t.gullet.beginGroup(),k={type:"ordgroup",mode:t.mode,body:k},r&&(k={type:"styling",mode:t.mode,style:r,body:[k]}),p.push(k);var w=t.fetch().text;if(w==="&"){if(u&&p.length===u){if(c||a)throw new be("Too many tab characters: &",t.nextToken);t.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}t.consume()}else if(w==="\\end"){S(),p.length===1&&k.type==="styling"&&k.body[0].body.length===0&&(m.length>1||!h)&&m.pop(),y.length<m.length+1&&y.push([]);break}else if(w==="\\\\"){t.consume();var _=void 0;t.gullet.future().text!==" "&&(_=t.parseSizeGroup(!0)),g.push(_?_.value:null),S(),y.push(LD(t)),p=[],m.push(p),x()}else throw new be("Expected & or \\\\ or \\cr or \\end",t.nextToken)}return t.gullet.endGroup(),t.gullet.endGroup(),{type:"array",mode:t.mode,addJot:i,arraystretch:o,body:m,cols:s,rowGaps:g,hskipBeforeAndAfter:n,hLinesBeforeRow:y,colSeparationType:a,tags:b,leqno:d}}function eT(t){return t.slice(0,1)==="d"?"display":"text"}var da=function(e,r){var n,i,s=e.body.length,o=e.hLinesBeforeRow,a=0,l=new Array(s),c=[],h=Math.max(r.fontMetrics().arrayRuleWidth,r.minRuleThickness),u=1/r.fontMetrics().ptPerEm,d=5*u;if(e.colSeparationType&&e.colSeparationType==="small"){var f=r.havingStyle(ut.SCRIPT).sizeMultiplier;d=.2778*(f/r.sizeMultiplier)}var p=e.colSeparationType==="CD"?Lr({number:3,unit:"ex"},r):12*u,m=3*u,g=e.arraystretch*p,y=.7*g,b=.3*g,x=0;function S(he){for(var ke=0;ke<he.length;++ke)ke>0&&(x+=.25),c.push({pos:x,isDashed:he[ke]})}for(S(o[0]),n=0;n<e.body.length;++n){var k=e.body[n],w=y,_=b;a<k.length&&(a=k.length);var L=new Array(k.length);for(i=0;i<k.length;++i){var B=qt(k[i],r);_<B.depth&&(_=B.depth),w<B.height&&(w=B.height),L[i]=B}var E=e.rowGaps[n],D=0;E&&(D=Lr(E,r),D>0&&(D+=b,_<D&&(_=D),D=0)),e.addJot&&(_+=m),L.height=w,L.depth=_,x+=w,L.pos=x,x+=_+D,l[n]=L,S(o[n+1])}var N=x/2+r.fontMetrics().axisHeight,K=e.cols||[],z=[],$,H,j=[];if(e.tags&&e.tags.some(he=>he))for(n=0;n<s;++n){var q=l[n],ne=q.pos-N,O=e.tags[n],fe=void 0;O===!0?fe=Z.makeSpan(["eqn-num"],[],r):O===!1?fe=Z.makeSpan([],[],r):fe=Z.makeSpan([],tn(O,r,!0),r),fe.depth=q.depth,fe.height=q.height,j.push({type:"elem",elem:fe,shift:ne})}for(i=0,H=0;i<a||H<K.length;++i,++H){for(var Te=K[H]||{},I=!0;Te.type==="separator";){if(I||($=Z.makeSpan(["arraycolsep"],[]),$.style.width=Me(r.fontMetrics().doubleRuleSep),z.push($)),Te.separator==="|"||Te.separator===":"){var tt=Te.separator==="|"?"solid":"dashed",qe=Z.makeSpan(["vertical-separator"],[],r);qe.style.height=Me(x),qe.style.borderRightWidth=Me(h),qe.style.borderRightStyle=tt,qe.style.margin="0 "+Me(-h/2);var Oe=x-N;Oe&&(qe.style.verticalAlign=Me(-Oe)),z.push(qe)}else throw new be("Invalid separator type: "+Te.separator);H++,Te=K[H]||{},I=!1}if(!(i>=a)){var Ze=void 0;(i>0||e.hskipBeforeAndAfter)&&(Ze=ot.deflt(Te.pregap,d),Ze!==0&&($=Z.makeSpan(["arraycolsep"],[]),$.style.width=Me(Ze),z.push($)));var vt=[];for(n=0;n<s;++n){var Ct=l[n],wt=Ct[i];if(wt){var zt=Ct.pos-N;wt.depth=Ct.depth,wt.height=Ct.height,vt.push({type:"elem",elem:wt,shift:zt})}}vt=Z.makeVList({positionType:"individualShift",children:vt},r),vt=Z.makeSpan(["col-align-"+(Te.align||"c")],[vt]),z.push(vt),(i<a-1||e.hskipBeforeAndAfter)&&(Ze=ot.deflt(Te.postgap,d),Ze!==0&&($=Z.makeSpan(["arraycolsep"],[]),$.style.width=Me(Ze),z.push($)))}}if(l=Z.makeSpan(["mtable"],z),c.length>0){for(var gr=Z.makeLineSpan("hline",r,h),R=Z.makeLineSpan("hdashline",r,h),W=[{type:"elem",elem:l,shift:0}];c.length>0;){var ee=c.pop(),pe=ee.pos-N;ee.isDashed?W.push({type:"elem",elem:R,shift:pe}):W.push({type:"elem",elem:gr,shift:pe})}l=Z.makeVList({positionType:"individualShift",children:W},r)}if(j.length===0)return Z.makeSpan(["mord"],[l],r);var le=Z.makeVList({positionType:"individualShift",children:j},r);return le=Z.makeSpan(["tag"],[le],r),Z.makeFragment([l,le])},oke={c:"center ",l:"left ",r:"right "},fa=function(e,r){for(var n=[],i=new ye.MathNode("mtd",[],["mtr-glue"]),s=new ye.MathNode("mtd",[],["mml-eqn-num"]),o=0;o<e.body.length;o++){for(var a=e.body[o],l=[],c=0;c<a.length;c++)l.push(new ye.MathNode("mtd",[hr(a[c],r)]));e.tags&&e.tags[o]&&(l.unshift(i),l.push(i),e.leqno?l.unshift(s):l.push(s)),n.push(new ye.MathNode("mtr",l))}var h=new ye.MathNode("mtable",n),u=e.arraystretch===.5?.1:.16+e.arraystretch-1+(e.addJot?.09:0);h.setAttribute("rowspacing",Me(u));var d="",f="";if(e.cols&&e.cols.length>0){var p=e.cols,m="",g=!1,y=0,b=p.length;p[0].type==="separator"&&(d+="top ",y=1),p[p.length-1].type==="separator"&&(d+="bottom ",b-=1);for(var x=y;x<b;x++)p[x].type==="align"?(f+=oke[p[x].align],g&&(m+="none "),g=!0):p[x].type==="separator"&&g&&(m+=p[x].separator==="|"?"solid ":"dashed ",g=!1);h.setAttribute("columnalign",f.trim()),/[sd]/.test(m)&&h.setAttribute("columnlines",m.trim())}if(e.colSeparationType==="align"){for(var S=e.cols||[],k="",w=1;w<S.length;w++)k+=w%2?"0em ":"1em ";h.setAttribute("columnspacing",k.trim())}else e.colSeparationType==="alignat"||e.colSeparationType==="gather"?h.setAttribute("columnspacing","0em"):e.colSeparationType==="small"?h.setAttribute("columnspacing","0.2778em"):e.colSeparationType==="CD"?h.setAttribute("columnspacing","0.5em"):h.setAttribute("columnspacing","1em");var _="",L=e.hLinesBeforeRow;d+=L[0].length>0?"left ":"",d+=L[L.length-1].length>0?"right ":"";for(var B=1;B<L.length-1;B++)_+=L[B].length===0?"none ":L[B][0]?"dashed ":"solid ";return/[sd]/.test(_)&&h.setAttribute("rowlines",_.trim()),d!==""&&(h=new ye.MathNode("menclose",[h]),h.setAttribute("notation",d.trim())),e.arraystretch&&e.arraystretch<1&&(h=new ye.MathNode("mstyle",[h]),h.setAttribute("scriptlevel","1")),h},oW=function(e,r){e.envName.indexOf("ed")===-1&&Xw(e);var n=[],i=e.envName.indexOf("at")>-1?"alignat":"align",s=e.envName==="split",o=Nc(e.parser,{cols:n,addJot:!0,autoTag:s?void 0:Q9(e.envName),emptySingleRow:!0,colSeparationType:i,maxNumCols:s?2:void 0,leqno:e.parser.settings.leqno},"display"),a,l=0,c={type:"ordgroup",mode:e.mode,body:[]};if(r[0]&&r[0].type==="ordgroup"){for(var h="",u=0;u<r[0].body.length;u++){var d=_t(r[0].body[u],"textord");h+=d.text}a=Number(h),l=a*2}var f=!l;o.body.forEach(function(y){for(var b=1;b<y.length;b+=2){var x=_t(y[b],"styling"),S=_t(x.body[0],"ordgroup");S.body.unshift(c)}if(f)l<y.length&&(l=y.length);else{var k=y.length/2;if(a<k)throw new be("Too many math in a row: "+("expected "+a+", but got "+k),y[0])}});for(var p=0;p<l;++p){var m="r",g=0;p%2===1?m="l":p>0&&f&&(g=1),n[p]={type:"align",align:m,pregap:g,postgap:0}}return o.colSeparationType=f?"align":"alignat",o};ua({type:"array",names:["array","darray"],props:{numArgs:1},handler(t,e){var r=Gw(e[0]),n=r?[e[0]]:_t(e[0],"ordgroup").body,i=n.map(function(o){var a=K9(o),l=a.text;if("lcr".indexOf(l)!==-1)return{type:"align",align:l};if(l==="|")return{type:"separator",separator:"|"};if(l===":")return{type:"separator",separator:":"};throw new be("Unknown column alignment: "+l,o)}),s={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return Nc(t.parser,s,eT(t.envName))},htmlBuilder:da,mathmlBuilder:fa});ua({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(t){var e={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[t.envName.replace("*","")],r="c",n={hskipBeforeAndAfter:!1,cols:[{type:"align",align:r}]};if(t.envName.charAt(t.envName.length-1)==="*"){var i=t.parser;if(i.consumeSpaces(),i.fetch().text==="["){if(i.consume(),i.consumeSpaces(),r=i.fetch().text,"lcr".indexOf(r)===-1)throw new be("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),n.cols=[{type:"align",align:r}]}}var s=Nc(t.parser,n,eT(t.envName)),o=Math.max(0,...s.body.map(a=>a.length));return s.cols=new Array(o).fill({type:"align",align:r}),e?{type:"leftright",mode:t.mode,body:[s],left:e[0],right:e[1],rightColor:void 0}:s},htmlBuilder:da,mathmlBuilder:fa});ua({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(t){var e={arraystretch:.5},r=Nc(t.parser,e,"script");return r.colSeparationType="small",r},htmlBuilder:da,mathmlBuilder:fa});ua({type:"array",names:["subarray"],props:{numArgs:1},handler(t,e){var r=Gw(e[0]),n=r?[e[0]]:_t(e[0],"ordgroup").body,i=n.map(function(o){var a=K9(o),l=a.text;if("lc".indexOf(l)!==-1)return{type:"align",align:l};throw new be("Unknown column alignment: "+l,o)});if(i.length>1)throw new be("{subarray} can contain only one column");var s={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5};if(s=Nc(t.parser,s,"script"),s.body.length>0&&s.body[0].length>1)throw new be("{subarray} can contain only one column");return s},htmlBuilder:da,mathmlBuilder:fa});ua({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(t){var e={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},r=Nc(t.parser,e,eT(t.envName));return{type:"leftright",mode:t.mode,body:[r],left:t.envName.indexOf("r")>-1?".":"\\{",right:t.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:da,mathmlBuilder:fa});ua({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:oW,htmlBuilder:da,mathmlBuilder:fa});ua({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(t){ot.contains(["gather","gather*"],t.envName)&&Xw(t);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:Q9(t.envName),emptySingleRow:!0,leqno:t.parser.settings.leqno};return Nc(t.parser,e,"display")},htmlBuilder:da,mathmlBuilder:fa});ua({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:oW,htmlBuilder:da,mathmlBuilder:fa});ua({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(t){Xw(t);var e={autoTag:Q9(t.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:t.parser.settings.leqno};return Nc(t.parser,e,"display")},htmlBuilder:da,mathmlBuilder:fa});ua({type:"array",names:["CD"],props:{numArgs:0},handler(t){return Xw(t),U5e(t.parser)},htmlBuilder:da,mathmlBuilder:fa});A("\\nonumber","\\gdef\\@eqnsw{0}");A("\\notag","\\nonumber");De({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(t,e){throw new be(t.funcName+" valid only within array environment")}});var DD=iW;De({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];if(i.type!=="ordgroup")throw new be("Invalid environment name",i);for(var s="",o=0;o<i.body.length;++o)s+=_t(i.body[o],"textord").text;if(n==="\\begin"){if(!DD.hasOwnProperty(s))throw new be("No such environment: "+s,i);var a=DD[s],{args:l,optArgs:c}=r.parseArguments("\\begin{"+s+"}",a),h={mode:r.mode,envName:s,parser:r},u=a.handler(h,l,c);r.expect("\\end",!1);var d=r.nextToken,f=_t(r.parseFunction(),"environment");if(f.name!==s)throw new be("Mismatch: \\begin{"+s+"} matched by \\end{"+f.name+"}",d);return u}return{type:"environment",mode:r.mode,name:s,nameGroup:i}}});var aW=(t,e)=>{var r=t.font,n=e.withFont(r);return qt(t.body,n)},lW=(t,e)=>{var r=t.font,n=e.withFont(r);return hr(t.body,n)},ID={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};De({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=qx(e[0]),s=n;return s in ID&&(s=ID[s]),{type:"font",mode:r.mode,font:s.slice(1),body:i}},htmlBuilder:aW,mathmlBuilder:lW});De({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(t,e)=>{var{parser:r}=t,n=e[0],i=ot.isCharacterBox(n);return{type:"mclass",mode:r.mode,mclass:Kw(n),body:[{type:"font",mode:r.mode,font:"boldsymbol",body:n}],isCharacterBox:i}}});De({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{parser:r,funcName:n,breakOnTokenText:i}=t,{mode:s}=r,o=r.parseExpression(!0,i),a="math"+n.slice(1);return{type:"font",mode:s,font:a,body:{type:"ordgroup",mode:r.mode,body:o}}},htmlBuilder:aW,mathmlBuilder:lW});var cW=(t,e)=>{var r=e;return t==="display"?r=r.id>=ut.SCRIPT.id?r.text():ut.DISPLAY:t==="text"&&r.size===ut.DISPLAY.size?r=ut.TEXT:t==="script"?r=ut.SCRIPT:t==="scriptscript"&&(r=ut.SCRIPTSCRIPT),r},tT=(t,e)=>{var r=cW(t.size,e.style),n=r.fracNum(),i=r.fracDen(),s;s=e.havingStyle(n);var o=qt(t.numer,s,e);if(t.continued){var a=8.5/e.fontMetrics().ptPerEm,l=3.5/e.fontMetrics().ptPerEm;o.height=o.height<a?a:o.height,o.depth=o.depth<l?l:o.depth}s=e.havingStyle(i);var c=qt(t.denom,s,e),h,u,d;t.hasBarLine?(t.barSize?(u=Lr(t.barSize,e),h=Z.makeLineSpan("frac-line",e,u)):h=Z.makeLineSpan("frac-line",e),u=h.height,d=h.height):(h=null,u=0,d=e.fontMetrics().defaultRuleThickness);var f,p,m;r.size===ut.DISPLAY.size||t.size==="display"?(f=e.fontMetrics().num1,u>0?p=3*d:p=7*d,m=e.fontMetrics().denom1):(u>0?(f=e.fontMetrics().num2,p=d):(f=e.fontMetrics().num3,p=3*d),m=e.fontMetrics().denom2);var g;if(h){var b=e.fontMetrics().axisHeight;f-o.depth-(b+.5*u)<p&&(f+=p-(f-o.depth-(b+.5*u))),b-.5*u-(c.height-m)<p&&(m+=p-(b-.5*u-(c.height-m)));var x=-(b-.5*u);g=Z.makeVList({positionType:"individualShift",children:[{type:"elem",elem:c,shift:m},{type:"elem",elem:h,shift:x},{type:"elem",elem:o,shift:-f}]},e)}else{var y=f-o.depth-(c.height-m);y<p&&(f+=.5*(p-y),m+=.5*(p-y)),g=Z.makeVList({positionType:"individualShift",children:[{type:"elem",elem:c,shift:m},{type:"elem",elem:o,shift:-f}]},e)}s=e.havingStyle(r),g.height*=s.sizeMultiplier/e.sizeMultiplier,g.depth*=s.sizeMultiplier/e.sizeMultiplier;var S;r.size===ut.DISPLAY.size?S=e.fontMetrics().delim1:r.size===ut.SCRIPTSCRIPT.size?S=e.havingStyle(ut.SCRIPT).fontMetrics().delim2:S=e.fontMetrics().delim2;var k,w;return t.leftDelim==null?k=Mg(e,["mopen"]):k=Qa.customSizedDelim(t.leftDelim,S,!0,e.havingStyle(r),t.mode,["mopen"]),t.continued?w=Z.makeSpan([]):t.rightDelim==null?w=Mg(e,["mclose"]):w=Qa.customSizedDelim(t.rightDelim,S,!0,e.havingStyle(r),t.mode,["mclose"]),Z.makeSpan(["mord"].concat(s.sizingClasses(e)),[k,Z.makeSpan(["mfrac"],[g]),w],e)},rT=(t,e)=>{var r=new ye.MathNode("mfrac",[hr(t.numer,e),hr(t.denom,e)]);if(!t.hasBarLine)r.setAttribute("linethickness","0px");else if(t.barSize){var n=Lr(t.barSize,e);r.setAttribute("linethickness",Me(n))}var i=cW(t.size,e.style);if(i.size!==e.style.size){r=new ye.MathNode("mstyle",[r]);var s=i.size===ut.DISPLAY.size?"true":"false";r.setAttribute("displaystyle",s),r.setAttribute("scriptlevel","0")}if(t.leftDelim!=null||t.rightDelim!=null){var o=[];if(t.leftDelim!=null){var a=new ye.MathNode("mo",[new ye.TextNode(t.leftDelim.replace("\\",""))]);a.setAttribute("fence","true"),o.push(a)}if(o.push(r),t.rightDelim!=null){var l=new ye.MathNode("mo",[new ye.TextNode(t.rightDelim.replace("\\",""))]);l.setAttribute("fence","true"),o.push(l)}return U9(o)}return r};De({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0],s=e[1],o,a=null,l=null,c="auto";switch(n){case"\\dfrac":case"\\frac":case"\\tfrac":o=!0;break;case"\\\\atopfrac":o=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":o=!1,a="(",l=")";break;case"\\\\bracefrac":o=!1,a="\\{",l="\\}";break;case"\\\\brackfrac":o=!1,a="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}switch(n){case"\\dfrac":case"\\dbinom":c="display";break;case"\\tfrac":case"\\tbinom":c="text";break}return{type:"genfrac",mode:r.mode,continued:!1,numer:i,denom:s,hasBarLine:o,leftDelim:a,rightDelim:l,size:c,barSize:null}},htmlBuilder:tT,mathmlBuilder:rT});De({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0],s=e[1];return{type:"genfrac",mode:r.mode,continued:!0,numer:i,denom:s,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}});De({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(t){var{parser:e,funcName:r,token:n}=t,i;switch(r){case"\\over":i="\\frac";break;case"\\choose":i="\\binom";break;case"\\atop":i="\\\\atopfrac";break;case"\\brace":i="\\\\bracefrac";break;case"\\brack":i="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:e.mode,replaceWith:i,token:n}}});var BD=["display","text","script","scriptscript"],RD=function(e){var r=null;return e.length>0&&(r=e,r=r==="."?null:r),r};De({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(t,e){var{parser:r}=t,n=e[4],i=e[5],s=qx(e[0]),o=s.type==="atom"&&s.family==="open"?RD(s.text):null,a=qx(e[1]),l=a.type==="atom"&&a.family==="close"?RD(a.text):null,c=_t(e[2],"size"),h,u=null;c.isBlank?h=!0:(u=c.value,h=u.number>0);var d="auto",f=e[3];if(f.type==="ordgroup"){if(f.body.length>0){var p=_t(f.body[0],"textord");d=BD[Number(p.text)]}}else f=_t(f,"textord"),d=BD[Number(f.text)];return{type:"genfrac",mode:r.mode,numer:n,denom:i,continued:!1,hasBarLine:h,barSize:u,leftDelim:o,rightDelim:l,size:d}},htmlBuilder:tT,mathmlBuilder:rT});De({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(t,e){var{parser:r,funcName:n,token:i}=t;return{type:"infix",mode:r.mode,replaceWith:"\\\\abovefrac",size:_t(e[0],"size").value,token:i}}});De({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0],s=N4e(_t(e[1],"infix").size),o=e[2],a=s.number>0;return{type:"genfrac",mode:r.mode,numer:i,denom:o,continued:!1,hasBarLine:a,barSize:s,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:tT,mathmlBuilder:rT});var hW=(t,e)=>{var r=e.style,n,i;t.type==="supsub"?(n=t.sup?qt(t.sup,e.havingStyle(r.sup()),e):qt(t.sub,e.havingStyle(r.sub()),e),i=_t(t.base,"horizBrace")):i=_t(t,"horizBrace");var s=qt(i.base,e.havingBaseStyle(ut.DISPLAY)),o=hl.svgSpan(i,e),a;if(i.isOver?(a=Z.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:o}]},e),a.children[0].children[0].children[1].classes.push("svg-align")):(a=Z.makeVList({positionType:"bottom",positionData:s.depth+.1+o.height,children:[{type:"elem",elem:o},{type:"kern",size:.1},{type:"elem",elem:s}]},e),a.children[0].children[0].children[0].classes.push("svg-align")),n){var l=Z.makeSpan(["mord",i.isOver?"mover":"munder"],[a],e);i.isOver?a=Z.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]},e):a=Z.makeVList({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]},e)}return Z.makeSpan(["mord",i.isOver?"mover":"munder"],[a],e)},ake=(t,e)=>{var r=hl.mathMLnode(t.label);return new ye.MathNode(t.isOver?"mover":"munder",[hr(t.base,e),r])};De({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t;return{type:"horizBrace",mode:r.mode,label:n,isOver:/^\\over/.test(n),base:e[0]}},htmlBuilder:hW,mathmlBuilder:ake});De({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[1],i=_t(e[0],"url").url;return r.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:r.mode,href:i,body:$r(n)}:r.formatUnsupportedCmd("\\href")},htmlBuilder:(t,e)=>{var r=tn(t.body,e,!1);return Z.makeAnchor(t.href,[],r,e)},mathmlBuilder:(t,e)=>{var r=Cc(t.body,e);return r instanceof es||(r=new es("mrow",[r])),r.setAttribute("href",t.href),r}});De({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=_t(e[0],"url").url;if(!r.settings.isTrusted({command:"\\url",url:n}))return r.formatUnsupportedCmd("\\url");for(var i=[],s=0;s<n.length;s++){var o=n[s];o==="~"&&(o="\\textasciitilde"),i.push({type:"textord",mode:"text",text:o})}var a={type:"text",mode:r.mode,font:"\\texttt",body:i};return{type:"href",mode:r.mode,href:n,body:$r(a)}}});De({type:"hbox",names:["\\hbox"],props:{numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0},handler(t,e){var{parser:r}=t;return{type:"hbox",mode:r.mode,body:$r(e[0])}},htmlBuilder(t,e){var r=tn(t.body,e,!1);return Z.makeFragment(r)},mathmlBuilder(t,e){return new ye.MathNode("mrow",$i(t.body,e))}});De({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:(t,e)=>{var{parser:r,funcName:n,token:i}=t,s=_t(e[0],"raw").string,o=e[1];r.settings.strict&&r.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var a,l={};switch(n){case"\\htmlClass":l.class=s,a={command:"\\htmlClass",class:s};break;case"\\htmlId":l.id=s,a={command:"\\htmlId",id:s};break;case"\\htmlStyle":l.style=s,a={command:"\\htmlStyle",style:s};break;case"\\htmlData":{for(var c=s.split(","),h=0;h<c.length;h++){var u=c[h].split("=");if(u.length!==2)throw new be("Error parsing key-value for \\htmlData");l["data-"+u[0].trim()]=u[1].trim()}a={command:"\\htmlData",attributes:l};break}default:throw new Error("Unrecognized html command")}return r.settings.isTrusted(a)?{type:"html",mode:r.mode,attributes:l,body:$r(o)}:r.formatUnsupportedCmd(n)},htmlBuilder:(t,e)=>{var r=tn(t.body,e,!1),n=["enclosing"];t.attributes.class&&n.push(...t.attributes.class.trim().split(/\s+/));var i=Z.makeSpan(n,r,e);for(var s in t.attributes)s!=="class"&&t.attributes.hasOwnProperty(s)&&i.setAttribute(s,t.attributes[s]);return i},mathmlBuilder:(t,e)=>Cc(t.body,e)});De({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t;return{type:"htmlmathml",mode:r.mode,html:$r(e[0]),mathml:$r(e[1])}},htmlBuilder:(t,e)=>{var r=tn(t.html,e,!1);return Z.makeFragment(r)},mathmlBuilder:(t,e)=>Cc(t.mathml,e)});var _k=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!r)throw new be("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(r[1]+r[2]),unit:r[3]};if(!EV(n))throw new be("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};De({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(t,e,r)=>{var{parser:n}=t,i={number:0,unit:"em"},s={number:.9,unit:"em"},o={number:0,unit:"em"},a="";if(r[0])for(var l=_t(r[0],"raw").string,c=l.split(","),h=0;h<c.length;h++){var u=c[h].split("=");if(u.length===2){var d=u[1].trim();switch(u[0].trim()){case"alt":a=d;break;case"width":i=_k(d);break;case"height":s=_k(d);break;case"totalheight":o=_k(d);break;default:throw new be("Invalid key: '"+u[0]+"' in \\includegraphics.")}}}var f=_t(e[0],"url").url;return a===""&&(a=f,a=a.replace(/^.*[\\/]/,""),a=a.substring(0,a.lastIndexOf("."))),n.settings.isTrusted({command:"\\includegraphics",url:f})?{type:"includegraphics",mode:n.mode,alt:a,width:i,height:s,totalheight:o,src:f}:n.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(t,e)=>{var r=Lr(t.height,e),n=0;t.totalheight.number>0&&(n=Lr(t.totalheight,e)-r);var i=0;t.width.number>0&&(i=Lr(t.width,e));var s={height:Me(r+n)};i>0&&(s.width=Me(i)),n>0&&(s.verticalAlign=Me(-n));var o=new a5e(t.src,t.alt,s);return o.height=r,o.depth=n,o},mathmlBuilder:(t,e)=>{var r=new ye.MathNode("mglyph",[]);r.setAttribute("alt",t.alt);var n=Lr(t.height,e),i=0;if(t.totalheight.number>0&&(i=Lr(t.totalheight,e)-n,r.setAttribute("valign",Me(-i))),r.setAttribute("height",Me(n+i)),t.width.number>0){var s=Lr(t.width,e);r.setAttribute("width",Me(s))}return r.setAttribute("src",t.src),r}});De({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t,i=_t(e[0],"size");if(r.settings.strict){var s=n[1]==="m",o=i.value.unit==="mu";s?(o||r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" supports only mu units, "+("not "+i.value.unit+" units")),r.mode!=="math"&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" works only in math mode")):o&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" doesn't support mu units")}return{type:"kern",mode:r.mode,dimension:i.value}},htmlBuilder(t,e){return Z.makeGlue(t.dimension,e)},mathmlBuilder(t,e){var r=Lr(t.dimension,e);return new ye.SpaceNode(r)}});De({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"lap",mode:r.mode,alignment:n.slice(5),body:i}},htmlBuilder:(t,e)=>{var r;t.alignment==="clap"?(r=Z.makeSpan([],[qt(t.body,e)]),r=Z.makeSpan(["inner"],[r],e)):r=Z.makeSpan(["inner"],[qt(t.body,e)]);var n=Z.makeSpan(["fix"],[]),i=Z.makeSpan([t.alignment],[r,n],e),s=Z.makeSpan(["strut"]);return s.style.height=Me(i.height+i.depth),i.depth&&(s.style.verticalAlign=Me(-i.depth)),i.children.unshift(s),i=Z.makeSpan(["thinbox"],[i],e),Z.makeSpan(["mord","vbox"],[i],e)},mathmlBuilder:(t,e)=>{var r=new ye.MathNode("mpadded",[hr(t.body,e)]);if(t.alignment!=="rlap"){var n=t.alignment==="llap"?"-1":"-0.5";r.setAttribute("lspace",n+"width")}return r.setAttribute("width","0px"),r}});De({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){var{funcName:r,parser:n}=t,i=n.mode;n.switchMode("math");var s=r==="\\("?"\\)":"$",o=n.parseExpression(!1,s);return n.expect(s),n.switchMode(i),{type:"styling",mode:n.mode,style:"text",body:o}}});De({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){throw new be("Mismatched "+t.funcName)}});var PD=(t,e)=>{switch(e.style.size){case ut.DISPLAY.size:return t.display;case ut.TEXT.size:return t.text;case ut.SCRIPT.size:return t.script;case ut.SCRIPTSCRIPT.size:return t.scriptscript;default:return t.text}};De({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(t,e)=>{var{parser:r}=t;return{type:"mathchoice",mode:r.mode,display:$r(e[0]),text:$r(e[1]),script:$r(e[2]),scriptscript:$r(e[3])}},htmlBuilder:(t,e)=>{var r=PD(t,e),n=tn(r,e,!1);return Z.makeFragment(n)},mathmlBuilder:(t,e)=>{var r=PD(t,e);return Cc(r,e)}});var uW=(t,e,r,n,i,s,o)=>{t=Z.makeSpan([],[t]);var a=r&&ot.isCharacterBox(r),l,c;if(e){var h=qt(e,n.havingStyle(i.sup()),n);c={elem:h,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-h.depth)}}if(r){var u=qt(r,n.havingStyle(i.sub()),n);l={elem:u,kern:Math.max(n.fontMetrics().bigOpSpacing2,n.fontMetrics().bigOpSpacing4-u.height)}}var d;if(c&&l){var f=n.fontMetrics().bigOpSpacing5+l.elem.height+l.elem.depth+l.kern+t.depth+o;d=Z.makeVList({positionType:"bottom",positionData:f,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:Me(-s)},{type:"kern",size:l.kern},{type:"elem",elem:t},{type:"kern",size:c.kern},{type:"elem",elem:c.elem,marginLeft:Me(s)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]},n)}else if(l){var p=t.height-o;d=Z.makeVList({positionType:"top",positionData:p,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:Me(-s)},{type:"kern",size:l.kern},{type:"elem",elem:t}]},n)}else if(c){var m=t.depth+o;d=Z.makeVList({positionType:"bottom",positionData:m,children:[{type:"elem",elem:t},{type:"kern",size:c.kern},{type:"elem",elem:c.elem,marginLeft:Me(s)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]},n)}else return t;var g=[d];if(l&&s!==0&&!a){var y=Z.makeSpan(["mspace"],[],n);y.style.marginRight=Me(s),g.unshift(y)}return Z.makeSpan(["mop","op-limits"],g,n)},dW=["\\smallint"],h0=(t,e)=>{var r,n,i=!1,s;t.type==="supsub"?(r=t.sup,n=t.sub,s=_t(t.base,"op"),i=!0):s=_t(t,"op");var o=e.style,a=!1;o.size===ut.DISPLAY.size&&s.symbol&&!ot.contains(dW,s.name)&&(a=!0);var l;if(s.symbol){var c=a?"Size2-Regular":"Size1-Regular",h="";if((s.name==="\\oiint"||s.name==="\\oiiint")&&(h=s.name.slice(1),s.name=h==="oiint"?"\\iint":"\\iiint"),l=Z.makeSymbol(s.name,c,"math",e,["mop","op-symbol",a?"large-op":"small-op"]),h.length>0){var u=l.italic,d=Z.staticSvg(h+"Size"+(a?"2":"1"),e);l=Z.makeVList({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:d,shift:a?.08:0}]},e),s.name="\\"+h,l.classes.unshift("mop"),l.italic=u}}else if(s.body){var f=tn(s.body,e,!0);f.length===1&&f[0]instanceof Is?(l=f[0],l.classes[0]="mop"):l=Z.makeSpan(["mop"],f,e)}else{for(var p=[],m=1;m<s.name.length;m++)p.push(Z.mathsym(s.name[m],s.mode,e));l=Z.makeSpan(["mop"],p,e)}var g=0,y=0;return(l instanceof Is||s.name==="\\oiint"||s.name==="\\oiiint")&&!s.suppressBaseShift&&(g=(l.height-l.depth)/2-e.fontMetrics().axisHeight,y=l.italic),i?uW(l,r,n,e,o,y,g):(g&&(l.style.position="relative",l.style.top=Me(g)),l)},U1=(t,e)=>{var r;if(t.symbol)r=new es("mo",[Bs(t.name,t.mode)]),ot.contains(dW,t.name)&&r.setAttribute("largeop","false");else if(t.body)r=new es("mo",$i(t.body,e));else{r=new es("mi",[new Uo(t.name.slice(1))]);var n=new es("mo",[Bs("⁡","text")]);t.parentIsSupSub?r=new es("mrow",[r,n]):r=zV([r,n])}return r},lke={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};De({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=n;return i.length===1&&(i=lke[i]),{type:"op",mode:r.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:h0,mathmlBuilder:U1});De({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"op",mode:r.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:$r(n)}},htmlBuilder:h0,mathmlBuilder:U1});var cke={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};De({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(t){var{parser:e,funcName:r}=t;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:h0,mathmlBuilder:U1});De({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(t){var{parser:e,funcName:r}=t;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:h0,mathmlBuilder:U1});De({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0},handler(t){var{parser:e,funcName:r}=t,n=r;return n.length===1&&(n=cke[n]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:h0,mathmlBuilder:U1});var fW=(t,e)=>{var r,n,i=!1,s;t.type==="supsub"?(r=t.sup,n=t.sub,s=_t(t.base,"operatorname"),i=!0):s=_t(t,"operatorname");var o;if(s.body.length>0){for(var a=s.body.map(u=>{var d=u.text;return typeof d=="string"?{type:"textord",mode:u.mode,text:d}:u}),l=tn(a,e.withFont("mathrm"),!0),c=0;c<l.length;c++){var h=l[c];h instanceof Is&&(h.text=h.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}o=Z.makeSpan(["mop"],l,e)}else o=Z.makeSpan(["mop"],[],e);return i?uW(o,r,n,e,e.style,0,0):o},hke=(t,e)=>{for(var r=$i(t.body,e.withFont("mathrm")),n=!0,i=0;i<r.length;i++){var s=r[i];if(!(s instanceof ye.SpaceNode))if(s instanceof ye.MathNode)switch(s.type){case"mi":case"mn":case"ms":case"mspace":case"mtext":break;case"mo":{var o=s.children[0];s.children.length===1&&o instanceof ye.TextNode?o.text=o.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):n=!1;break}default:n=!1}else n=!1}if(n){var a=r.map(h=>h.toText()).join("");r=[new ye.TextNode(a)]}var l=new ye.MathNode("mi",r);l.setAttribute("mathvariant","normal");var c=new ye.MathNode("mo",[Bs("⁡","text")]);return t.parentIsSupSub?new ye.MathNode("mrow",[l,c]):ye.newDocumentFragment([l,c])};De({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"operatorname",mode:r.mode,body:$r(i),alwaysHandleSupSub:n==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:fW,mathmlBuilder:hke});A("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");Iu({type:"ordgroup",htmlBuilder(t,e){return t.semisimple?Z.makeFragment(tn(t.body,e,!1)):Z.makeSpan(["mord"],tn(t.body,e,!0),e)},mathmlBuilder(t,e){return Cc(t.body,e,!0)}});De({type:"overline",names:["\\overline"],props:{numArgs:1},handler(t,e){var{parser:r}=t,n=e[0];return{type:"overline",mode:r.mode,body:n}},htmlBuilder(t,e){var r=qt(t.body,e.havingCrampedStyle()),n=Z.makeLineSpan("overline-line",e),i=e.fontMetrics().defaultRuleThickness,s=Z.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n},{type:"kern",size:i}]},e);return Z.makeSpan(["mord","overline"],[s],e)},mathmlBuilder(t,e){var r=new ye.MathNode("mo",[new ye.TextNode("‾")]);r.setAttribute("stretchy","true");var n=new ye.MathNode("mover",[hr(t.body,e),r]);return n.setAttribute("accent","true"),n}});De({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"phantom",mode:r.mode,body:$r(n)}},htmlBuilder:(t,e)=>{var r=tn(t.body,e.withPhantom(),!1);return Z.makeFragment(r)},mathmlBuilder:(t,e)=>{var r=$i(t.body,e);return new ye.MathNode("mphantom",r)}});De({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"hphantom",mode:r.mode,body:n}},htmlBuilder:(t,e)=>{var r=Z.makeSpan([],[qt(t.body,e.withPhantom())]);if(r.height=0,r.depth=0,r.children)for(var n=0;n<r.children.length;n++)r.children[n].height=0,r.children[n].depth=0;return r=Z.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:r}]},e),Z.makeSpan(["mord"],[r],e)},mathmlBuilder:(t,e)=>{var r=$i($r(t.body),e),n=new ye.MathNode("mphantom",r),i=new ye.MathNode("mpadded",[n]);return i.setAttribute("height","0px"),i.setAttribute("depth","0px"),i}});De({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"vphantom",mode:r.mode,body:n}},htmlBuilder:(t,e)=>{var r=Z.makeSpan(["inner"],[qt(t.body,e.withPhantom())]),n=Z.makeSpan(["fix"],[]);return Z.makeSpan(["mord","rlap"],[r,n],e)},mathmlBuilder:(t,e)=>{var r=$i($r(t.body),e),n=new ye.MathNode("mphantom",r),i=new ye.MathNode("mpadded",[n]);return i.setAttribute("width","0px"),i}});De({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(t,e){var{parser:r}=t,n=_t(e[0],"size").value,i=e[1];return{type:"raisebox",mode:r.mode,dy:n,body:i}},htmlBuilder(t,e){var r=qt(t.body,e),n=Lr(t.dy,e);return Z.makeVList({positionType:"shift",positionData:-n,children:[{type:"elem",elem:r}]},e)},mathmlBuilder(t,e){var r=new ye.MathNode("mpadded",[hr(t.body,e)]),n=t.dy.number+t.dy.unit;return r.setAttribute("voffset",n),r}});De({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(t){var{parser:e}=t;return{type:"internal",mode:e.mode}}});De({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(t,e,r){var{parser:n}=t,i=r[0],s=_t(e[0],"size"),o=_t(e[1],"size");return{type:"rule",mode:n.mode,shift:i&&_t(i,"size").value,width:s.value,height:o.value}},htmlBuilder(t,e){var r=Z.makeSpan(["mord","rule"],[],e),n=Lr(t.width,e),i=Lr(t.height,e),s=t.shift?Lr(t.shift,e):0;return r.style.borderRightWidth=Me(n),r.style.borderTopWidth=Me(i),r.style.bottom=Me(s),r.width=n,r.height=i+s,r.depth=-s,r.maxFontSize=i*1.125*e.sizeMultiplier,r},mathmlBuilder(t,e){var r=Lr(t.width,e),n=Lr(t.height,e),i=t.shift?Lr(t.shift,e):0,s=e.color&&e.getColor()||"black",o=new ye.MathNode("mspace");o.setAttribute("mathbackground",s),o.setAttribute("width",Me(r)),o.setAttribute("height",Me(n));var a=new ye.MathNode("mpadded",[o]);return i>=0?a.setAttribute("height",Me(i)):(a.setAttribute("height",Me(i)),a.setAttribute("depth",Me(-i))),a.setAttribute("voffset",Me(i)),a}});function pW(t,e,r){for(var n=tn(t,e,!1),i=e.sizeMultiplier/r.sizeMultiplier,s=0;s<n.length;s++){var o=n[s].classes.indexOf("sizing");o<0?Array.prototype.push.apply(n[s].classes,e.sizingClasses(r)):n[s].classes[o+1]==="reset-size"+e.size&&(n[s].classes[o+1]="reset-size"+r.size),n[s].height*=i,n[s].depth*=i}return Z.makeFragment(n)}var ND=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],uke=(t,e)=>{var r=e.havingSize(t.size);return pW(t.body,r,e)};De({type:"sizing",names:ND,props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{breakOnTokenText:r,funcName:n,parser:i}=t,s=i.parseExpression(!1,r);return{type:"sizing",mode:i.mode,size:ND.indexOf(n)+1,body:s}},htmlBuilder:uke,mathmlBuilder:(t,e)=>{var r=e.havingSize(t.size),n=$i(t.body,r),i=new ye.MathNode("mstyle",n);return i.setAttribute("mathsize",Me(r.sizeMultiplier)),i}});De({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(t,e,r)=>{var{parser:n}=t,i=!1,s=!1,o=r[0]&&_t(r[0],"ordgroup");if(o)for(var a="",l=0;l<o.body.length;++l){var c=o.body[l];if(a=c.text,a==="t")i=!0;else if(a==="b")s=!0;else{i=!1,s=!1;break}}else i=!0,s=!0;var h=e[0];return{type:"smash",mode:n.mode,body:h,smashHeight:i,smashDepth:s}},htmlBuilder:(t,e)=>{var r=Z.makeSpan([],[qt(t.body,e)]);if(!t.smashHeight&&!t.smashDepth)return r;if(t.smashHeight&&(r.height=0,r.children))for(var n=0;n<r.children.length;n++)r.children[n].height=0;if(t.smashDepth&&(r.depth=0,r.children))for(var i=0;i<r.children.length;i++)r.children[i].depth=0;var s=Z.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:r}]},e);return Z.makeSpan(["mord"],[s],e)},mathmlBuilder:(t,e)=>{var r=new ye.MathNode("mpadded",[hr(t.body,e)]);return t.smashHeight&&r.setAttribute("height","0px"),t.smashDepth&&r.setAttribute("depth","0px"),r}});De({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,r){var{parser:n}=t,i=r[0],s=e[0];return{type:"sqrt",mode:n.mode,body:s,index:i}},htmlBuilder(t,e){var r=qt(t.body,e.havingCrampedStyle());r.height===0&&(r.height=e.fontMetrics().xHeight),r=Z.wrapFragment(r,e);var n=e.fontMetrics(),i=n.defaultRuleThickness,s=i;e.style.id<ut.TEXT.id&&(s=e.fontMetrics().xHeight);var o=i+s/4,a=r.height+r.depth+o+i,{span:l,ruleWidth:c,advanceWidth:h}=Qa.sqrtImage(a,e),u=l.height-c;u>r.height+r.depth+o&&(o=(o+u-r.height-r.depth)/2);var d=l.height-r.height-o-c;r.style.paddingLeft=Me(h);var f=Z.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:-(r.height+d)},{type:"elem",elem:l},{type:"kern",size:c}]},e);if(t.index){var p=e.havingStyle(ut.SCRIPTSCRIPT),m=qt(t.index,p,e),g=.6*(f.height-f.depth),y=Z.makeVList({positionType:"shift",positionData:-g,children:[{type:"elem",elem:m}]},e),b=Z.makeSpan(["root"],[y]);return Z.makeSpan(["mord","sqrt"],[b,f],e)}else return Z.makeSpan(["mord","sqrt"],[f],e)},mathmlBuilder(t,e){var{body:r,index:n}=t;return n?new ye.MathNode("mroot",[hr(r,e),hr(n,e)]):new ye.MathNode("msqrt",[hr(r,e)])}});var FD={display:ut.DISPLAY,text:ut.TEXT,script:ut.SCRIPT,scriptscript:ut.SCRIPTSCRIPT};De({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t,e){var{breakOnTokenText:r,funcName:n,parser:i}=t,s=i.parseExpression(!0,r),o=n.slice(1,n.length-5);return{type:"styling",mode:i.mode,style:o,body:s}},htmlBuilder(t,e){var r=FD[t.style],n=e.havingStyle(r).withFont("");return pW(t.body,n,e)},mathmlBuilder(t,e){var r=FD[t.style],n=e.havingStyle(r),i=$i(t.body,n),s=new ye.MathNode("mstyle",i),o={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]}
vendor: 12,579 bytes, lines 367-371
367,a=o[t.style];return s.setAttribute("scriptlevel",a[0]),s.setAttribute("displaystyle",a[1]),s}});var dke=function(e,r){var n=e.base;if(n)if(n.type==="op"){var i=n.limits&&(r.style.size===ut.DISPLAY.size||n.alwaysHandleSupSub);return i?h0:null}else if(n.type==="operatorname"){var s=n.alwaysHandleSupSub&&(r.style.size===ut.DISPLAY.size||n.limits);return s?fW:null}else{if(n.type==="accent")return ot.isCharacterBox(n.base)?Y9:null;if(n.type==="horizBrace"){var o=!e.sub;return o===n.isOver?hW:null}else return null}else return null};Iu({type:"supsub",htmlBuilder(t,e){var r=dke(t,e);if(r)return r(t,e);var{base:n,sup:i,sub:s}=t,o=qt(n,e),a,l,c=e.fontMetrics(),h=0,u=0,d=n&&ot.isCharacterBox(n);if(i){var f=e.havingStyle(e.style.sup());a=qt(i,f,e),d||(h=o.height-f.fontMetrics().supDrop*f.sizeMultiplier/e.sizeMultiplier)}if(s){var p=e.havingStyle(e.style.sub());l=qt(s,p,e),d||(u=o.depth+p.fontMetrics().subDrop*p.sizeMultiplier/e.sizeMultiplier)}var m;e.style===ut.DISPLAY?m=c.sup1:e.style.cramped?m=c.sup3:m=c.sup2;var g=e.sizeMultiplier,y=Me(.5/c.ptPerEm/g),b=null;if(l){var x=t.base&&t.base.type==="op"&&t.base.name&&(t.base.name==="\\oiint"||t.base.name==="\\oiiint");(o instanceof Is||x)&&(b=Me(-o.italic))}var S;if(a&&l){h=Math.max(h,m,a.depth+.25*c.xHeight),u=Math.max(u,c.sub2);var k=c.defaultRuleThickness,w=4*k;if(h-a.depth-(l.height-u)<w){u=w-(h-a.depth)+l.height;var _=.8*c.xHeight-(h-a.depth);_>0&&(h+=_,u-=_)}var L=[{type:"elem",elem:l,shift:u,marginRight:y,marginLeft:b},{type:"elem",elem:a,shift:-h,marginRight:y}];S=Z.makeVList({positionType:"individualShift",children:L},e)}else if(l){u=Math.max(u,c.sub1,l.height-.8*c.xHeight);var B=[{type:"elem",elem:l,marginLeft:b,marginRight:y}];S=Z.makeVList({positionType:"shift",positionData:u,children:B},e)}else if(a)h=Math.max(h,m,a.depth+.25*c.xHeight),S=Z.makeVList({positionType:"shift",positionData:-h,children:[{type:"elem",elem:a,marginRight:y}]},e);else throw new Error("supsub must have either sup or sub.");var E=vS(o,"right")||"mord";return Z.makeSpan([E],[o,Z.makeSpan(["msupsub"],[S])],e)},mathmlBuilder(t,e){var r=!1,n,i;t.base&&t.base.type==="horizBrace"&&(i=!!t.sup,i===t.base.isOver&&(r=!0,n=t.base.isOver)),t.base&&(t.base.type==="op"||t.base.type==="operatorname")&&(t.base.parentIsSupSub=!0);var s=[hr(t.base,e)];t.sub&&s.push(hr(t.sub,e)),t.sup&&s.push(hr(t.sup,e));var o;if(r)o=n?"mover":"munder";else if(t.sub)if(t.sup){var c=t.base;c&&c.type==="op"&&c.limits&&e.style===ut.DISPLAY||c&&c.type==="operatorname"&&c.alwaysHandleSupSub&&(e.style===ut.DISPLAY||c.limits)?o="munderover":o="msubsup"}else{var l=t.base;l&&l.type==="op"&&l.limits&&(e.style===ut.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||e.style===ut.DISPLAY)?o="munder":o="msub"}else{var a=t.base;a&&a.type==="op"&&a.limits&&(e.style===ut.DISPLAY||a.alwaysHandleSupSub)||a&&a.type==="operatorname"&&a.alwaysHandleSupSub&&(a.limits||e.style===ut.DISPLAY)?o="mover":o="msup"}return new ye.MathNode(o,s)}});Iu({type:"atom",htmlBuilder(t,e){return Z.mathsym(t.text,t.mode,e,["m"+t.family])},mathmlBuilder(t,e){var r=new ye.MathNode("mo",[Bs(t.text,t.mode)]);if(t.family==="bin"){var n=G9(t,e);n==="bold-italic"&&r.setAttribute("mathvariant",n)}else t.family==="punct"?r.setAttribute("separator","true"):(t.family==="open"||t.family==="close")&&r.setAttribute("stretchy","false");return r}});var mW={mi:"italic",mn:"normal",mtext:"normal"};Iu({type:"mathord",htmlBuilder(t,e){return Z.makeOrd(t,e,"mathord")},mathmlBuilder(t,e){var r=new ye.MathNode("mi",[Bs(t.text,t.mode,e)]),n=G9(t,e)||"italic";return n!==mW[r.type]&&r.setAttribute("mathvariant",n),r}});Iu({type:"textord",htmlBuilder(t,e){return Z.makeOrd(t,e,"textord")},mathmlBuilder(t,e){var r=Bs(t.text,t.mode,e),n=G9(t,e)||"normal",i;return t.mode==="text"?i=new ye.MathNode("mtext",[r]):/[0-9]/.test(t.text)?i=new ye.MathNode("mn",[r]):t.text==="\\prime"?i=new ye.MathNode("mo",[r]):i=new ye.MathNode("mi",[r]),n!==mW[i.type]&&i.setAttribute("mathvariant",n),i}});var Mk={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Ak={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Iu({type:"spacing",htmlBuilder(t,e){if(Ak.hasOwnProperty(t.text)){var r=Ak[t.text].className||"";if(t.mode==="text"){var n=Z.makeOrd(t,e,"textord");return n.classes.push(r),n}else return Z.makeSpan(["mspace",r],[Z.mathsym(t.text,t.mode,e)],e)}else{if(Mk.hasOwnProperty(t.text))return Z.makeSpan(["mspace",Mk[t.text]],[],e);throw new be('Unknown type of space "'+t.text+'"')}},mathmlBuilder(t,e){var r;if(Ak.hasOwnProperty(t.text))r=new ye.MathNode("mtext",[new ye.TextNode(" ")]);else{if(Mk.hasOwnProperty(t.text))return new ye.MathNode("mspace");throw new be('Unknown type of space "'+t.text+'"')}return r}});var $D=()=>{var t=new ye.MathNode("mtd",[]);return t.setAttribute("width","50%"),t};Iu({type:"tag",mathmlBuilder(t,e){var r=new ye.MathNode("mtable",[new ye.MathNode("mtr",[$D(),new ye.MathNode("mtd",[Cc(t.body,e)]),$D(),new ye.MathNode("mtd",[Cc(t.tag,e)])])]);return r.setAttribute("width","100%"),r}});var zD={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},HD={"\\textbf":"textbf","\\textmd":"textmd"},fke={"\\textit":"textit","\\textup":"textup"},qD=(t,e)=>{var r=t.font;if(r){if(zD[r])return e.withTextFontFamily(zD[r]);if(HD[r])return e.withTextFontWeight(HD[r]);if(r==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(fke[r])};De({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"text",mode:r.mode,body:$r(i),font:n}},htmlBuilder(t,e){var r=qD(t,e),n=tn(t.body,r,!0);return Z.makeSpan(["mord","text"],n,r)},mathmlBuilder(t,e){var r=qD(t,e);return Cc(t.body,r)}});De({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"underline",mode:r.mode,body:e[0]}},htmlBuilder(t,e){var r=qt(t.body,e),n=Z.makeLineSpan("underline-line",e),i=e.fontMetrics().defaultRuleThickness,s=Z.makeVList({positionType:"top",positionData:r.height,children:[{type:"kern",size:i},{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r}]},e);return Z.makeSpan(["mord","underline"],[s],e)},mathmlBuilder(t,e){var r=new ye.MathNode("mo",[new ye.TextNode("‾")]);r.setAttribute("stretchy","true");var n=new ye.MathNode("munder",[hr(t.body,e),r]);return n.setAttribute("accentunder","true"),n}});De({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(t,e){var{parser:r}=t;return{type:"vcenter",mode:r.mode,body:e[0]}},htmlBuilder(t,e){var r=qt(t.body,e),n=e.fontMetrics().axisHeight,i=.5*(r.height-n-(r.depth+n));return Z.makeVList({positionType:"shift",positionData:i,children:[{type:"elem",elem:r}]},e)},mathmlBuilder(t,e){return new ye.MathNode("mpadded",[hr(t.body,e)],["vcenter"])}});De({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(t,e,r){throw new be("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(t,e){for(var r=VD(t),n=[],i=e.havingStyle(e.style.text()),s=0;s<r.length;s++){var o=r[s];o==="~"&&(o="\\textasciitilde"),n.push(Z.makeSymbol(o,"Typewriter-Regular",t.mode,i,["mord","texttt"]))}return Z.makeSpan(["mord","text"].concat(i.sizingClasses(e)),Z.tryCombineChars(n),i)},mathmlBuilder(t,e){var r=new ye.TextNode(VD(t)),n=new ye.MathNode("mtext",[r]);return n.setAttribute("mathvariant","monospace"),n}});var VD=t=>t.body.replace(/ /g,t.star?"␣":" "),nc=FV,gW=`[ \r
368	]`,pke="\\\\[a-zA-Z@]+",mke="\\\\[^\uD800-\uDFFF]",gke="("+pke+")"+gW+"*",yke=`\\\\(
369|[ \r	]+
370?)[ \r	]*`,SS="[̀-ͯ]",bke=new RegExp(SS+"+$"),xke="("+gW+"+)|"+(yke+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(SS+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(SS+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+gke)+("|"+mke+")");class WD{constructor(e,r){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=r,this.tokenRegex=new RegExp(xke,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,r){this.catcodes[e]=r}lex(){var e=this.input,r=this.tokenRegex.lastIndex;if(r===e.length)return new Es("EOF",new Xi(this,r,r));var n=this.tokenRegex.exec(e);if(n===null||n.index!==r)throw new be("Unexpected character: '"+e[r]+"'",new Es(e[r],new Xi(this,r,r+1)));var i=n[6]||n[3]||(n[2]?"\\ ":" ");if(this.catcodes[i]===14){var s=e.indexOf(`
371`,this.tokenRegex.lastIndex);return s===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=s+1,this.lex()}return new Es(i,new Xi(this,r,this.tokenRegex.lastIndex))}}class vke{constructor(e,r){e===void 0&&(e={}),r===void 0&&(r={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=r,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new be("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var r in e)e.hasOwnProperty(r)&&(e[r]==null?delete this.current[r]:this.current[r]=e[r])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,r,n){if(n===void 0&&(n=!1),n){for(var i=0;i<this.undefStack.length;i++)delete this.undefStack[i][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=r)}else{var s=this.undefStack[this.undefStack.length-1];s&&!s.hasOwnProperty(e)&&(s[e]=this.current[e])}r==null?delete this.current[e]:this.current[e]=r}}var wke=sW;A("\\noexpand",function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});A("\\expandafter",function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}});A("\\@firstoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[0],numArgs:0}});A("\\@secondoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[1],numArgs:0}});A("\\@ifnextchar",function(t){var e=t.consumeArgs(3);t.consumeSpaces();var r=t.future();return e[0].length===1&&e[0][0].text===r.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}});A("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");A("\\TextOrMath",function(t){var e=t.consumeArgs(2);return t.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var jD={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};A("\\char",function(t){var e=t.popToken(),r,n="";if(e.text==="'")r=8,e=t.popToken();else if(e.text==='"')r=16,e=t.popToken();else if(e.text==="`")if(e=t.popToken(),e.text[0]==="\\")n=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new be("\\char` missing argument");n=e.text.charCodeAt(0)}else r=10;if(r){if(n=jD[e.text],n==null||n>=r)throw new be("Invalid base-"+r+" digit "+e.text);for(var i;(i=jD[t.future().text])!=null&&i<r;)n*=r,n+=i,t.popToken()}return"\\@char{"+n+"}"});var nT=(t,e,r,n)=>{var i=t.consumeArg().tokens;if(i.length!==1)throw new be("\\newcommand's first argument must be a macro name");var s=i[0].text,o=t.isDefined(s);if(o&&!e)throw new be("\\newcommand{"+s+"} attempting to redefine "+(s+"; use \\renewcommand"));if(!o&&!r)throw new be("\\renewcommand{"+s+"} when command "+s+" does not yet exist; use \\newcommand");var a=0;if(i=t.consumeArg().tokens,i.length===1&&i[0].text==="["){for(var l="",c=t.expandNextToken();c.text!=="]"&&c.text!=="EOF";)l+=c.text,c=t.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new be("Invalid number of arguments: "+l);a=parseInt(l),i=t.consumeArg().tokens}return o&&n||t.macros.set(s,{tokens:i,numArgs:a}),""};A("\\newcommand",t=>nT(t,!1,!0,!1));A("\\renewcommand",t=>nT(t,!0,!1,!1));A("\\providecommand",t=>nT(t,!0,!0,!0));A("\\message",t=>{var e=t.consumeArgs(1)[0];return console.log(e.reverse().map(r=>r.text).join("")),""});A("\\errmessage",t=>{var e=t.consumeArgs(1)[0];return console.error(e.reverse().map(r=>r.text).join("")),""});A("\\show",t=>{var e=t.popToken(),r=e.text;return console.log(e,t.macros.get(r),nc[r],mr.math[r],mr.text[r]),""});A("\\bgroup","{");A("\\egroup","}");
vendor: 6,574 bytes, line 371
371A("~","\\nobreakspace");A("\\lq","`");A("\\rq","'");A("\\aa","\\r a");A("\\AA","\\r A");A("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");A("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");A("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");A("ℬ","\\mathscr{B}");A("ℰ","\\mathscr{E}");A("ℱ","\\mathscr{F}");A("ℋ","\\mathscr{H}");A("ℐ","\\mathscr{I}");A("ℒ","\\mathscr{L}");A("ℳ","\\mathscr{M}");A("ℛ","\\mathscr{R}");A("ℭ","\\mathfrak{C}");A("ℌ","\\mathfrak{H}");A("ℨ","\\mathfrak{Z}");A("\\Bbbk","\\Bbb{k}");A("·","\\cdotp");A("\\llap","\\mathllap{\\textrm{#1}}");A("\\rlap","\\mathrlap{\\textrm{#1}}");A("\\clap","\\mathclap{\\textrm{#1}}");A("\\mathstrut","\\vphantom{(}");A("\\underbar","\\underline{\\text{#1}}");A("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}');A("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");A("\\ne","\\neq");A("≠","\\neq");A("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");A("∉","\\notin");A("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");A("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");A("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");A("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");A("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");A("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");A("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");A("⟂","\\perp");A("‼","\\mathclose{!\\mkern-0.8mu!}");A("∌","\\notni");A("⌜","\\ulcorner");A("⌝","\\urcorner");A("⌞","\\llcorner");A("⌟","\\lrcorner");A("©","\\copyright");A("®","\\textregistered");A("️","\\textregistered");A("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');A("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');A("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');A("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');A("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");A("⋮","\\vdots");A("\\varGamma","\\mathit{\\Gamma}");A("\\varDelta","\\mathit{\\Delta}");A("\\varTheta","\\mathit{\\Theta}");A("\\varLambda","\\mathit{\\Lambda}");A("\\varXi","\\mathit{\\Xi}");A("\\varPi","\\mathit{\\Pi}");A("\\varSigma","\\mathit{\\Sigma}");A("\\varUpsilon","\\mathit{\\Upsilon}");A("\\varPhi","\\mathit{\\Phi}");A("\\varPsi","\\mathit{\\Psi}");A("\\varOmega","\\mathit{\\Omega}");A("\\substack","\\begin{subarray}{c}#1\\end{subarray}");A("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");A("\\boxed","\\fbox{$\\displaystyle{#1}$}");A("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");A("\\implies","\\DOTSB\\;\\Longrightarrow\\;");A("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");A("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");A("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var UD={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};A("\\dots",function(t){var e="\\dotso",r=t.expandAfterFuture().text;return r in UD?e=UD[r]:(r.slice(0,4)==="\\not"||r in mr.math&&ot.contains(["bin","rel"],mr.math[r].group))&&(e="\\dotsb"),e});var iT={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};A("\\dotso",function(t){var e=t.future().text;return e in iT?"\\ldots\\,":"\\ldots"});A("\\dotsc",function(t){var e=t.future().text;return e in iT&&e!==","?"\\ldots\\,":"\\ldots"});A("\\cdots",function(t){var e=t.future().text;return e in iT?"\\@cdots\\,":"\\@cdots"});A("\\dotsb","\\cdots");A("\\dotsm","\\cdots");A("\\dotsi","\\!\\cdots");A("\\dotsx","\\ldots\\,");A("\\DOTSI","\\relax");A("\\DOTSB","\\relax");A("\\DOTSX","\\relax");A("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");A("\\,","\\tmspace+{3mu}{.1667em}");A("\\thinspace","\\,");A("\\>","\\mskip{4mu}");A("\\:","\\tmspace+{4mu}{.2222em}");A("\\medspace","\\:");A("\\;","\\tmspace+{5mu}{.2777em}");A("\\thickspace","\\;");A("\\!","\\tmspace-{3mu}{.1667em}");A("\\negthinspace","\\!");A("\\negmedspace","\\tmspace-{4mu}{.2222em}");A("\\negthickspace","\\tmspace-{5mu}{.277em}");A("\\enspace","\\kern.5em ");A("\\enskip","\\hskip.5em\\relax");A("\\quad","\\hskip1em\\relax");A("\\qquad","\\hskip2em\\relax");A("\\tag","\\@ifstar\\tag@literal\\tag@paren");A("\\tag@paren","\\tag@literal{({#1})}");A("\\tag@literal",t=>{if(t.macros.get("\\df@tag"))throw new be("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});A("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");A("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");A("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");A("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");A("\\newline","\\\\\\relax");A("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var yW=Me(jo["Main-Regular"][84][1]-.7*jo["Main-Regular"][65][1]);A("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+yW+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");A("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+yW+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");
371A("\\hspace","\\@ifstar\\@hspacer\\@hspace");A("\\@hspace","\\hskip #1\\relax");A("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");A("\\ordinarycolon",":");A("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");A("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');A("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');A("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');A("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');A("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');A("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');A("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');A("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');A("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');A("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');A("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');A("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');A("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');A("∷","\\dblcolon");A("∹","\\eqcolon");A("≔","\\coloneqq");A("≕","\\eqqcolon");A("⩴","\\Coloneqq");A("\\ratio","\\vcentcolon");A("\\coloncolon","\\dblcolon");A("\\colonequals","\\coloneqq");A("\\coloncolonequals","\\Coloneqq");A("\\equalscolon","\\eqqcolon");A("\\equalscoloncolon","\\Eqqcolon");A("\\colonminus","\\coloneq");A("\\coloncolonminus","\\Coloneq");A("\\minuscolon","\\eqcolon");A("\\minuscoloncolon","\\Eqcolon");A("\\coloncolonapprox","\\Colonapprox");A("\\coloncolonsim","\\Colonsim");A("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");A("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");A("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");A("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");A("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");A("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");A("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");A("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");A("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");A("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");A("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");A("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");A("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");A("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");A("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");A("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");A("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");A("\\nleqq","\\html@mathml{\\@nleqq}{≰}");A("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");A("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");A("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");A("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");A("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");A("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");A("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");A("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");A("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");A("\\imath","\\html@mathml{\\@imath}{ı}");A("\\jmath","\\html@mathml{\\@jmath}{ȷ}");A("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");A("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");A("⟦","\\llbracket");A("⟧","\\rrbracket");A("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}
371{\\mathopen{\\char`⦃}}");A("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");A("⦃","\\lBrace");A("⦄","\\rBrace");A("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");A("⦵","\\minuso");A("\\darr","\\downarrow");A("\\dArr","\\Downarrow");A("\\Darr","\\Downarrow");A("\\lang","\\langle");A("\\rang","\\rangle");A("\\uarr","\\uparrow");A("\\uArr","\\Uparrow");A("\\Uarr","\\Uparrow");A("\\N","\\mathbb{N}");A("\\R","\\mathbb{R}");A("\\Z","\\mathbb{Z}");A("\\alef","\\aleph");A("\\alefsym","\\aleph");A("\\Alpha","\\mathrm{A}");A("\\Beta","\\mathrm{B}");A("\\bull","\\bullet");A("\\Chi","\\mathrm{X}");A("\\clubs","\\clubsuit");A("\\cnums","\\mathbb{C}");A("\\Complex","\\mathbb{C}");A("\\Dagger","\\ddagger");A("\\diamonds","\\diamondsuit");A("\\empty","\\emptyset");A("\\Epsilon","\\mathrm{E}");A("\\Eta","\\mathrm{H}");A("\\exist","\\exists");A("\\harr","\\leftrightarrow");A("\\hArr","\\Leftrightarrow");A("\\Harr","\\Leftrightarrow");A("\\hearts","\\heartsuit");A("\\image","\\Im");A("\\infin","\\infty");A("\\Iota","\\mathrm{I}");A("\\isin","\\in");A("\\Kappa","\\mathrm{K}");A("\\larr","\\leftarrow");A("\\lArr","\\Leftarrow");A("\\Larr","\\Leftarrow");A("\\lrarr","\\leftrightarrow");A("\\lrArr","\\Leftrightarrow");A("\\Lrarr","\\Leftrightarrow");A("\\Mu","\\mathrm{M}");A("\\natnums","\\mathbb{N}");A("\\Nu","\\mathrm{N}");A("\\Omicron","\\mathrm{O}");A("\\plusmn","\\pm");A("\\rarr","\\rightarrow");A("\\rArr","\\Rightarrow");A("\\Rarr","\\Rightarrow");A("\\real","\\Re");A("\\reals","\\mathbb{R}");A("\\Reals","\\mathbb{R}");A("\\Rho","\\mathrm{P}");A("\\sdot","\\cdot");A("\\sect","\\S");A("\\spades","\\spadesuit");A("\\sub","\\subset");A("\\sube","\\subseteq");A("\\supe","\\supseteq");A("\\Tau","\\mathrm{T}");A("\\thetasym","\\vartheta");A("\\weierp","\\wp");A("\\Zeta","\\mathrm{Z}");A("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");A("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");A("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");A("\\bra","\\mathinner{\\langle{#1}|}");A("\\ket","\\mathinner{|{#1}\\rangle}");A("\\braket","\\mathinner{\\langle{#1}\\rangle}");A("\\Bra","\\left\\langle#1\\right|");A("\\Ket","\\left|#1\\right\\rangle");var bW=t=>e=>{var r=e.consumeArg().tokens,n=e.consumeArg().tokens,i=e.consumeArg().tokens,s=e.consumeArg().tokens,o=e.macros.get("|"),a=e.macros.get("\\|");e.macros.beginGroup();var l=u=>d=>{t&&(d.macros.set("|",o),i.length&&d.macros.set("\\|",a));var f=u;if(!u&&i.length){var p=d.future();p.text==="|"&&(d.popToken(),f=!0)}return{tokens:f?i:n,numArgs:0}};e.macros.set("|",l(!1)),i.length&&e.macros.set("\\|",l(!0));var c=e.consumeArg().tokens,h=e.expandTokens([...s,...c,...r]);return e.macros.endGroup(),{tokens:h.reverse(),numArgs:0}};A("\\bra@ket",bW(!1));A("\\bra@set",bW(!0));A("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");A("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");A("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");A("\\angln","{\\angl n}");A("\\blue","\\textcolor{##6495ed}{#1}");A("\\orange","\\textcolor{##ffa500}{#1}");A("\\pink","\\textcolor{##ff00af}{#1}");A("\\red","\\textcolor{##df0030}{#1}");A("\\green","\\textcolor{##28ae7b}{#1}");A("\\gray","\\textcolor{gray}{#1}");A("\\purple","\\textcolor{##9d38bd}{#1}");A("\\blueA","\\textcolor{##ccfaff}{#1}");A("\\blueB","\\textcolor{##80f6ff}{#1}");A("\\blueC","\\textcolor{##63d9ea}{#1}");A("\\blueD","\\textcolor{##11accd}{#1}");A("\\blueE","\\textcolor{##0c7f99}{#1}");A("\\tealA","\\textcolor{##94fff5}{#1}");A("\\tealB","\\textcolor{##26edd5}{#1}");A("\\tealC","\\textcolor{##01d1c1}{#1}");A("\\tealD","\\textcolor{##01a995}{#1}");A("\\tealE","\\textcolor{##208170}{#1}");A("\\greenA","\\textcolor{##b6ffb0}{#1}");A("\\greenB","\\textcolor{##8af281}{#1}");A("\\greenC","\\textcolor{##74cf70}{#1}");A("\\greenD","\\textcolor{##1fab54}{#1}");A("\\greenE","\\textcolor{##0d923f}{#1}");A("\\goldA","\\textcolor{##ffd0a9}{#1}");A("\\goldB","\\textcolor{##ffbb71}{#1}");A("\\goldC","\\textcolor{##ff9c39}{#1}");A("\\goldD","\\textcolor{##e07d10}{#1}");A("\\goldE","\\textcolor{##a75a05}{#1}");A("\\redA","\\textcolor{##fca9a9}{#1}");A("\\redB","\\textcolor{##ff8482}{#1}");A("\\redC","\\textcolor{##f9685d}{#1}");A("\\redD","\\textcolor{##e84d39}{#1}");
vendor: 5,462 bytes, line 371
371A("\\redE","\\textcolor{##bc2612}{#1}");A("\\maroonA","\\textcolor{##ffbde0}{#1}");A("\\maroonB","\\textcolor{##ff92c6}{#1}");A("\\maroonC","\\textcolor{##ed5fa6}{#1}");A("\\maroonD","\\textcolor{##ca337c}{#1}");A("\\maroonE","\\textcolor{##9e034e}{#1}");A("\\purpleA","\\textcolor{##ddd7ff}{#1}");A("\\purpleB","\\textcolor{##c6b9fc}{#1}");A("\\purpleC","\\textcolor{##aa87ff}{#1}");A("\\purpleD","\\textcolor{##7854ab}{#1}");A("\\purpleE","\\textcolor{##543b78}{#1}");A("\\mintA","\\textcolor{##f5f9e8}{#1}");A("\\mintB","\\textcolor{##edf2df}{#1}");A("\\mintC","\\textcolor{##e0e5cc}{#1}");A("\\grayA","\\textcolor{##f6f7f7}{#1}");A("\\grayB","\\textcolor{##f0f1f2}{#1}");A("\\grayC","\\textcolor{##e3e5e6}{#1}");A("\\grayD","\\textcolor{##d6d8da}{#1}");A("\\grayE","\\textcolor{##babec2}{#1}");A("\\grayF","\\textcolor{##888d93}{#1}");A("\\grayG","\\textcolor{##626569}{#1}");A("\\grayH","\\textcolor{##3b3e40}{#1}");A("\\grayI","\\textcolor{##21242c}{#1}");A("\\kaBlue","\\textcolor{##314453}{#1}");A("\\kaGreen","\\textcolor{##71B307}{#1}");var xW={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class kke{constructor(e,r,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=r,this.expansionCount=0,this.feed(e),this.macros=new vke(wke,r.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new WD(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var r,n,i;if(e){if(this.consumeSpaces(),this.future().text!=="[")return null;r=this.popToken(),{tokens:i,end:n}=this.consumeArg(["]"])}else({tokens:i,start:r,end:n}=this.consumeArg());return this.pushToken(new Es("EOF",n.loc)),this.pushTokens(i),r.range(n,"")}consumeSpaces(){for(;;){var e=this.future();if(e.text===" ")this.stack.pop();else break}}consumeArg(e){var r=[],n=e&&e.length>0;n||this.consumeSpaces();var i=this.future(),s,o=0,a=0;do{if(s=this.popToken(),r.push(s),s.text==="{")++o;else if(s.text==="}"){if(--o,o===-1)throw new be("Extra }",s)}else if(s.text==="EOF")throw new be("Unexpected end of input in a macro argument, expected '"+(e&&n?e[a]:"}")+"'",s);if(e&&n)if((o===0||o===1&&e[a]==="{")&&s.text===e[a]){if(++a,a===e.length){r.splice(-a,a);break}}else a=0}while(o!==0||n);return i.text==="{"&&r[r.length-1].text==="}"&&(r.pop(),r.shift()),r.reverse(),{tokens:r,start:i,end:s}}consumeArgs(e,r){if(r){if(r.length!==e+1)throw new be("The length of delimiters doesn't match the number of args!");for(var n=r[0],i=0;i<n.length;i++){var s=this.popToken();if(n[i]!==s.text)throw new be("Use of the macro doesn't match its definition",s)}}for(var o=[],a=0;a<e;a++)o.push(this.consumeArg(r&&r[a+1]).tokens);return o}countExpansion(e){if(this.expansionCount+=e,this.expansionCount>this.settings.maxExpand)throw new be("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var r=this.popToken(),n=r.text,i=r.noexpand?null:this._getExpansion(n);if(i==null||e&&i.unexpandable){if(e&&i==null&&n[0]==="\\"&&!this.isDefined(n))throw new be("Undefined control sequence: "+n);return this.pushToken(r),!1}this.countExpansion(1);var s=i.tokens,o=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){s=s.slice();for(var a=s.length-1;a>=0;--a){var l=s[a];if(l.text==="#"){if(a===0)throw new be("Incomplete placeholder at end of macro body",l);if(l=s[--a],l.text==="#")s.splice(a+1,1);else if(/^[1-9]$/.test(l.text))s.splice(a,2,...o[+l.text-1]);else throw new be("Not a valid argument number",l)}}}return this.pushTokens(s),s.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}throw new Error}expandMacro(e){return this.macros.has(e)?this.expandTokens([new Es(e)]):void 0}expandTokens(e){var r=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(this.expandOnce(!0)===!1){var i=this.stack.pop();i.treatAsRelax&&(i.noexpand=!1,i.treatAsRelax=!1),r.push(i)}return this.countExpansion(r.length),r}expandMacroAsText(e){var r=this.expandMacro(e);return r&&r.map(n=>n.text).join("")}_getExpansion(e){var r=this.macros.get(e);if(r==null)return r;if(e.length===1){var n=this.lexer.catcodes[e];if(n!=null&&n!==13)return}var i=typeof r=="function"?r(this):r;if(typeof i=="string"){var s=0;if(i.indexOf("#")!==-1)for(var o=i.replace(/##/g,"");o.indexOf("#"+(s+1))!==-1;)++s;for(var a=new WD(i,this.settings),l=[],c=a.lex();c.text!=="EOF";)l.push(c),c=a.lex();l.reverse();var h={tokens:l,numArgs:s};return h}return i}isDefined(e){return this.macros.has(e)||nc.hasOwnProperty(e)||mr.math.hasOwnProperty(e)||mr.text.hasOwnProperty(e)||xW.hasOwnProperty(e)}isExpandable(e){var r=this.macros.get(e);return r!=null?typeof r=="string"||typeof r=="function"||!r.unexpandable:nc.hasOwnProperty(e)&&!nc[e].primitive}}var GD=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,r2=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","â
371‚‘":"e","ₕ":"h","áµ¢":"i","â±¼":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","áµ£":"r","ₛ":"s","ₜ":"t","ᵤ":"u","áµ¥":"v","ₓ":"x","ᵦ":"β","áµ§":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","á´¬":"A","á´®":"B","á´°":"D","á´±":"E","á´³":"G","á´´":"H","á´µ":"I","á´¶":"J","á´·":"K","á´¸":"L","á´¹":"M","á´º":"N","á´¼":"O","á´¾":"P","á´¿":"R","ᵀ":"T","ᵁ":"U","â±½":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","á¶ ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",Ë¡:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",Ë¢:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",Ê·:"w",Ë£:"x",ʸ:"y","á¶»":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","áµ ":"ϕ","ᵡ":"χ","á¶¿":"θ"}),Ek={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},KD={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",Ç¡:"ǡ",Ã¥:"å",Ç»:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",È©:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",Ä¡:"ġ",Ä£:"ģ",ḧ:"ḧ",ȟ:"ȟ",Ä¥:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",Ä©:"ĩ",Ä«:"ī",Ä­:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",Ç©:"ǩ",Ä·:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",È«:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",È­:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",á¹¥:"ṥ",Å¡:"š",á¹§:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",Å¥:"ť",ṫ:"ṫ",Å£:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",Å©:"ũ",á¹¹:"ṹ",Å«:"ū",á¹»:"ṻ",Å­:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",á¹½:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",Å·:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ç :"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ç´:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ä :"Ġ",Ä¢:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ä´:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ä»:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",È®:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Å :"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",á¹ :"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Å¢:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Å®:"Ů",Ű:"Ű",á¹¼:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Å´:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ
vendor: 11,074 bytes, lines 371-372
371:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class Jw{constructor(e,r){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new kke(e,r,this.mode),this.settings=r,this.leftrightDepth=0}expect(e,r){if(r===void 0&&(r=!0),this.fetch().text!==e)throw new be("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());r&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var r=this.nextToken;this.consume(),this.gullet.pushToken(new Es("}")),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect("}"),this.nextToken=r,n}parseExpression(e,r){for(var n=[];;){this.mode==="math"&&this.consumeSpaces();var i=this.fetch();if(Jw.endOfExpression.indexOf(i.text)!==-1||r&&i.text===r||e&&nc[i.text]&&nc[i.text].infix)break;var s=this.parseAtom(r);if(s){if(s.type==="internal")continue}else break;n.push(s)}return this.mode==="text"&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(e){for(var r=-1,n,i=0;i<e.length;i++)if(e[i].type==="infix"){if(r!==-1)throw new be("only one infix operator per group",e[i].token);r=i,n=e[i].replaceWith}if(r!==-1&&n){var s,o,a=e.slice(0,r),l=e.slice(r+1);a.length===1&&a[0].type==="ordgroup"?s=a[0]:s={type:"ordgroup",mode:this.mode,body:a},l.length===1&&l[0].type==="ordgroup"?o=l[0]:o={type:"ordgroup",mode:this.mode,body:l};var c;return n==="\\\\abovefrac"?c=this.callFunction(n,[s,e[r],o],[]):c=this.callFunction(n,[s,o],[]),[c]}else return e}handleSupSubscript(e){var r=this.fetch(),n=r.text;this.consume(),this.consumeSpaces();var i;do{var s;i=this.parseGroup(e)}while(((s=i)==null?void 0:s.type)==="internal");if(!i)throw new be("Expected group after '"+n+"'",r);return i}formatUnsupportedCmd(e){for(var r=[],n=0;n<e.length;n++)r.push({type:"textord",mode:"text",text:e[n]});var i={type:"text",mode:this.mode,body:r},s={type:"color",mode:this.mode,color:this.settings.errorColor,body:[i]};return s}parseAtom(e){var r=this.parseGroup("atom",e);if((r==null?void 0:r.type)==="internal"||this.mode==="text")return r;for(var n,i;;){this.consumeSpaces();var s=this.fetch();if(s.text==="\\limits"||s.text==="\\nolimits"){if(r&&r.type==="op"){var o=s.text==="\\limits";r.limits=o,r.alwaysHandleSupSub=!0}else if(r&&r.type==="operatorname")r.alwaysHandleSupSub&&(r.limits=s.text==="\\limits");else throw new be("Limit controls must follow a math operator",s);this.consume()}else if(s.text==="^"){if(n)throw new be("Double superscript",s);n=this.handleSupSubscript("superscript")}else if(s.text==="_"){if(i)throw new be("Double subscript",s);i=this.handleSupSubscript("subscript")}else if(s.text==="'"){if(n)throw new be("Double superscript",s);var a={type:"textord",mode:this.mode,text:"\\prime"},l=[a];for(this.consume();this.fetch().text==="'";)l.push(a),this.consume();this.fetch().text==="^"&&l.push(this.handleSupSubscript("superscript")),n={type:"ordgroup",mode:this.mode,body:l}}else if(r2[s.text]){var c=GD.test(s.text),h=[];for(h.push(new Es(r2[s.text])),this.consume();;){var u=this.fetch().text;if(!r2[u]||GD.test(u)!==c)break;h.unshift(new Es(r2[u])),this.consume()}var d=this.subparse(h);c?i={type:"ordgroup",mode:"math",body:d}:n={type:"ordgroup",mode:"math",body:d}}else break}return n||i?{type:"supsub",mode:this.mode,base:r,sup:n,sub:i}:r}parseFunction(e,r){var n=this.fetch(),i=n.text,s=nc[i];if(!s)return null;if(this.consume(),r&&r!=="atom"&&!s.allowedInArgument)throw new be("Got function '"+i+"' with no arguments"+(r?" as "+r:""),n);if(this.mode==="text"&&!s.allowedInText)throw new be("Can't use function '"+i+"' in text mode",n);if(this.mode==="math"&&s.allowedInMath===!1)throw new be("Can't use function '"+i+"' in math mode",n);var{args:o,optArgs:a}=this.parseArguments(i,s);return this.callFunction(i,o,a,n,e)}callFunction(e,r,n,i,s){var o={funcName:e,parser:this,token:i,breakOnTokenText:s},a=nc[e];if(a&&a.handler)return a.handler(o,r,n);throw new be("No function handler for "+e)}parseArguments(e,r){var n=r.numArgs+r.numOptionalArgs;if(n===0)return{args:[],optArgs:[]};for(var i=[],s=[],o=0;o<n;o++){var a=r.argTypes&&r.argTypes[o],l=o<r.numOptionalArgs;(r.primitive&&a==null||r.type==="sqrt"&&o===1&&s[0]==null)&&(a="primitive");var c=this.parseGroupOfType("argument to '"+e+"'",a,l);if(l)s.push(c);else if(c!=null)i.push(c);else throw new be("Null argument, please report this as a bug")}return{args:i,optArgs:s}}parseGroupOfType(e,r,n){switch(r){case"color":return this.parseColorGroup(n);case"size":return this.parseSizeGroup(n);case"url":return this.parseUrlGroup(n);case"math":case"text":return this.parseArgumentGroup(n,r);case"hbox":{var i=this.parseArgumentGroup(n,"text");return i!=null?{type:"styling",mode:i.mode,body:[i],style:"text"}:null}case"raw":{var s=this.parseStringGroup("raw",n);return s!=null?{type:"raw",mode:"text",string:s.text}:null}case"primitive":{if(n)throw new be("A primitive argument cannot be optional");var o=this.parseGroup(e);if(o==null)throw new be("Expected group as "+e,this.fetch());return o}case"original":case null:case void 0:return this.parseArgumentGroup(n);default:throw new be("Unknown group type as "+e,this.fetch())}}consumeSpaces(){for(;this.fetch().text===" ";)this.consume()}parseStringGroup(e,r){var n=this.gullet.scanArgument(r);if(n==null)return null;for(var i="",s;(s=this.fetch()).text!=="EOF";)i+=s.text,this.consume();return this.consume(),n.text=i,n}parseRegexGroup(e,r){for(var n=this.fetch(),i=n,s="",o;(o=this.fetch()).text!=="EOF"&&e.test(s+o.text);)i=o,s+=i.text,this.consume();if(s==="")throw new be("Invalid "+r+": '"+n.text+"'",n);return n.range(i,s)}parseColorGroup(e){var r=this.parseStringGroup("color",e);if(r==null)return null;var n=/^(#[a-f0-9]{3}|#?[a-f0-9]{6}|[a-z]+)$/i.exec(r.text);if(!n)throw new be("Invalid color: '"+r.text+"'",r);var i=n[0];return/^[0-9a-f]{6}$/i.test(i)&&(i="#"+i),{type:"color-token",mode:this.mode,color:i}}parseSizeGroup(e){var r,n=!1;if(this.gullet.consumeSpaces(),!e&&this.gullet.future().text!=="{"?r=this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size"):r=this.parseStringGroup("size",e),!r)return null;!e&&r.text.length===0&&(r.text="0pt",n=!0);var i=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(r.text);if(!i)throw new be("Invalid size: '"+r.text+"'",r);var s={number:+(i[1]+i[2]),unit:i[3]};if(!EV(s))throw new be("Invalid unit: '"+s.unit+"'",r);return{type:"size",mode:this.mode,value:s,isBlank:n}}parseUrlGroup(e){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var r=this.parseStringGroup("url",e);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),r==null)return null;var n=r.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:n}}parseArgumentGroup(e,r){var n=this.gullet.scanArgument(e);if(n==null)return null;var i=this.mode;r&&this.switchMode(r),this.gullet.beginGroup();var s=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var o={type:"ordgroup",mode:this.mode,loc:n.loc,body:s};return r&&this.switchMode(i),o}parseGroup(e,r){var n=this.fetch(),i=n.text,s;if(i==="{"||i==="\\begingroup"){this.consume();var o=i==="{"?"}":"\\endgroup";this.gullet.beginGroup();var a=this.parseExpression(!1,o),l=this.fetch();this.expect(o),this.gullet.endGroup(),s={type:"ordgroup",mode:this.mode,loc:Xi.range(n,l),body:a,semisimple:i==="\\begingroup"||void 0}}else if(s=this.parseFunction(r,e)||this.parseSymbol(),s==null&&i[0]==="\\"&&!xW.hasOwnProperty(i)){if(this.settings.throwOnError)throw new be("Undefined control sequence: "+i,n);s=this.formatUnsupportedCmd(i),this.consume()}return s}formLigatures(e){for(var r=e.length-1,n=0;n<r;++n){var i=e[n],s=i.text;s==="-"&&e[n+1].text==="-"&&(n+1<r&&e[n+2].text==="-"?(e.splice(n,3,{type:"textord",mode:"text",loc:Xi.range(i,e[n+2]),text:"---"}),r-=2):(e.splice(n,2,{type:"textord",mode:"text",loc:Xi.range(i,e[n+1]),text:"--"}),r-=1)),(s==="'"||s==="`")&&e[n+1].text===s&&(e.splice(n,2,{type:"textord",mode:"text",loc:Xi.range(i,e[n+1]),text:s+s}),r-=1)}}parseSymbol(){var e=this.fetch(),r=e.text;if(/^\\verb[^a-zA-Z]/.test(r)){this.consume();var n=r.slice(5),i=n.charAt(0)==="*";if(i&&(n=n.slice(1)),n.length<2||n.charAt(0)!==n.slice(-1))throw new be(`\\verb assertion failed --
372                    please report what input caused this bug`);return n=n.slice(1,-1),{type:"verb",mode:"text",body:n,star:i}}KD.hasOwnProperty(r[0])&&!mr[this.mode][r[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+r[0]+'" used in math mode',e),r=KD[r[0]]+r.slice(1));var s=bke.exec(r);s&&(r=r.substring(0,s.index),r==="i"?r="ı":r==="j"&&(r="ȷ"));var o;if(mr[this.mode][r]){this.settings.strict&&this.mode==="math"&&xS.indexOf(r)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+r[0]+'" used in math mode',e);var a=mr[this.mode][r].group,l=Xi.range(e),c;if(h5e.hasOwnProperty(a)){var h=a;c={type:"atom",mode:this.mode,family:h,loc:l,text:r}}else c={type:a,mode:this.mode,loc:l,text:r};o=c}else if(r.charCodeAt(0)>=128)this.settings.strict&&(MV(r.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+r[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+r[0]+'"'+(" ("+r.charCodeAt(0)+")"),e)),o={type:"textord",mode:"text",loc:Xi.range(e),text:r};else return null;if(this.consume(),s)for(var u=0;u<s[0].length;u++){var d=s[0][u];if(!Ek[d])throw new be("Unknown accent ' "+d+"'",e);var f=Ek[d][this.mode]||Ek[d].text;if(!f)throw new be("Accent "+d+" unsupported in "+this.mode+" mode",e);o={type:"accent",mode:this.mode,loc:Xi.range(e),label:f,isStretchy:!1,isShifty:!0,base:o}}return o}}Jw.endOfExpression=["}","\\endgroup","\\end","\\right","&"];var sT=function(e,r){if(!(typeof e=="string"||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var n=new Jw(e,r);delete n.gullet.macros.current["\\df@tag"];var i=n.parse();if(delete n.gullet.macros.current["\\current@color"],delete n.gullet.macros.current["\\color"],n.gullet.macros.get("\\df@tag")){if(!r.displayMode)throw new be("\\tag works only in display equations");
372i=[{type:"tag",mode:"text",body:i,tag:n.subparse([new Es("\\df@tag")])}]}return i},oT=function(e,r,n){r.textContent="";var i=Zw(e,n).toNode();r.appendChild(i)};typeof document<"u"&&document.compatMode!=="CSS1Compat"&&(typeof console<"u"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),oT=function(){throw new be("KaTeX doesn't work in quirks mode.")});var vW=function(e,r){var n=Zw(e,r).toMarkup();return n},wW=function(e,r){var n=new H9(r);return sT(e,n)},kW=function(e,r,n){if(n.throwOnError||!(e instanceof be))throw e;var i=Z.makeSpan(["katex-error"],[new Is(r)]);return i.setAttribute("title",e.toString()),i.setAttribute("style","color:"+n.errorColor),i},Zw=function(e,r){var n=new H9(r);try{var i=sT(e,n);return I5e(i,e,n)}catch(s){return kW(s,e,n)}},CW=function(e,r){var n=new H9(r);try{var i=sT(e,n);return B5e(i,e,n)}catch(s){return kW(s,e,n)}},SW="0.16.22",TW={Span:j1,Anchor:W9,SymbolNode:Is,SvgNode:ll,PathNode:kc,LineNode:bS},aT={version:SW,render:oT,renderToString:vW,ParseError:be,SETTINGS_SCHEMA:Om,__parse:wW,__renderToDomTree:Zw,__renderToHTMLTree:CW,__setFontMetrics:AV,__defineSymbol:v,__defineFunction:De,__defineMacro:A,__domTree:TW};const Cke=Object.freeze(Object.defineProperty({__proto__:null,ParseError:be,SETTINGS_SCHEMA:Om,__defineFunction:De,__defineMacro:A,__defineSymbol:v,__domTree:TW,__parse:wW,__renderToDomTree:Zw,__renderToHTMLTree:CW,__setFontMetrics:AV,default:aT,get render(){return oT},renderToString:vW,version:SW},Symbol.toStringTag,{value:"Module"}));var l1,c1,tf,rf,h1,nf,sf,of,af,u1,Sv,_W;class Qw{constructor(e){we(this,Sv);we(this,l1);we(this,c1);we(this,tf);we(this,rf);we(this,h1);we(this,nf);we(this,sf);we(this,of);we(this,af);we(this,u1);ie(this,nf,!1),this.onShow=()=>{},this.onHide=()=>{},ie(this,u1,(r,n)=>{const{state:i,composing:s}=r,{selection:o,doc:a}=i,{ranges:l}=o,c=Math.min(...l.map(f=>f.$from.pos)),h=Math.max(...l.map(f=>f.$to.pos)),u=n&&n.doc.eq(a)&&n.selection.eq(o);if(V(this,nf)||((V(this,h1)??r.dom.parentElement??document.body).appendChild(this.element),ie(this,nf,!0)),s||u)return;if(!V(this,c1).call(this,r,n)){this.hide();return}uo({getBoundingClientRect:()=>ew(r,c,h)},this.element,{placement:V(this,rf).placement??"top",middleware:[xx(),xc(V(this,sf)),MO(V(this,of)),...V(this,tf)]}).then(({x:f,y:p})=>{Object.assign(this.element.style,{left:`${f}px`,top:`${p}px`})}).catch(console.error),this.show()}),this.update=(r,n)=>{V(this,af).call(this,r,n)},this.destroy=()=>{V(this,af).cancel()},this.show=r=>{this.element.dataset.show="true",r&&uo(r,this.element,{placement:"top",middleware:[xx(),xc(V(this,sf)),MO(V(this,of)),...V(this,tf)],...V(this,rf)}).then(({x:n,y:i})=>{Object.assign(this.element.style,{left:`${n}px`,top:`${i}px`})}).catch(console.error),this.onShow()},this.hide=()=>{this.element.dataset.show!=="false"&&(this.element.dataset.show="false",this.onHide())},this.element=e.content,ie(this,l1,e.debounce??200),ie(this,c1,e.shouldShow??ly(this,Sv,_W)),ie(this,sf,e.offset),ie(this,of,e.shift),ie(this,tf,e.middleware??[]),ie(this,rf,e.floatingUIOptions??{}),ie(this,h1,e.root),this.element.dataset.show="false",ie(this,af,Nv(V(this,u1),V(this,l1)))}}l1=new WeakMap,c1=new WeakMap,tf=new WeakMap,rf=new WeakMap,h1=new WeakMap,nf=new WeakMap,sf=new WeakMap,of=new WeakMap,af=new WeakMap,u1=new WeakMap,Sv=new WeakSet,_W=function(e){const{doc:r,selection:n}=e.state,{empty:i,from:s,to:o}=n,a=!r.textBetween(s,o).length&&e.state.selection instanceof Je,l=this.element.contains(document.activeElement),c=!e.hasFocus()&&!l,h=!e.editable;return!(c||i||a||h)};function e4(t){const e=tr({},`${t}_TOOLTIP_SPEC`),r=nn(i=>{const s=i.get(e.key);return new _r({key:new Dr(`${t}_TOOLTIP`),...s})}),n=[e,r];return n.key=e.key,n.pluginKey=r.key,e.meta={package:"@milkdown/plugin-tooltip",displayName:`Ctx<tooltipSpec>|${t}`},r.meta={package:"@milkdown/plugin-tooltip",displayName:`Prose<tooltip>|${t}`},n}function Ske(){return{enter:{mathFlow:t,mathFlowFenceMeta:e,mathText:s},exit:{mathFlow:i,mathFlowFence:n,mathFlowFenceMeta:r,mathFlowValue:a,mathText:o,mathTextData:a}};function t(l){const c={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[c]}},l)}function e(){this.buffer()}function r(){const l=this.resume(),c=this.stack[this.stack.length-1];c.type,c.meta=l}function n(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(l){const c=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),h=this.stack[this.stack.length-1];h.type,this.exit(l),h.value=c;const u=h.data.hChildren[0];u.type,u.tagName,u.children.push({type:"text",value:c}),this.data.mathFlowInside=void 0}function s(l){this.enter({type:"inlineMath",value:"",data:{hName:"
372code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},l),this.buffer()}function o(l){const c=this.resume(),h=this.stack[this.stack.length-1];h.type,this.exit(l),h.value=c,h.data.hChildren.push({type:"text",value:c})}function a(l){this.config.enter.data.call(this,l),this.config.exit.data.call(this,l)}}function Tke(t){let e=(t||{}).singleDollarTextMath;return e==null&&(e=!0),n.peek=i,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:`
373`,inConstruct:"mathFlowMeta"},{character:"$",after:e?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:r,inlineMath:n}};function r(s,o,a,l){const c=s.value||"",h=a.createTracker(l),u="$".repeat(Math.max(_F(c,"$")+1,2)),d=a.enter("mathFlow");let f=h.move(u);if(s.meta){const p=a.enter("mathFlowMeta");f+=h.move(a.safe(s.meta,{after:`
374`,before:f,encode:["$"],...h.current()})),p()}return f+=h.move(`
375`),c&&(f+=h.move(c+`
376`)),f+=h.move(u),d(),f}function n(s,o,a){let l=s.value||"",c=1;for(e||c++;new RegExp("(^|[^$])"+"\\$".repeat(c)+"([^$]|$)").test(l);)c++;const h="$".repeat(c);/[^ \r\n]/.test(l)&&(/^[ \r\n]/.test(l)&&/[ \r\n]$/.test(l)||/^\$|\$$/.test(l))&&(l=" "+l+" ");let u=-1;for(;++u<a.unsafe.length;){const d=a.unsafe[u];if(!d.atBreak)continue;const f=a.compilePattern(d);let p;for(;p=f.exec(l);){let m=p.index;l.codePointAt(m)===10&&l.codePointAt(m-1)===13&&m--,l=l.slice(0,m)+" "+l.slice(p.index+1)}}return h+l+h}function i(){return"$"}}const _ke={tokenize:Mke,concrete:!0,name:"mathFlow"},YD={tokenize:Ake,partial:!0};function Mke(t,e,r){const n=this,i=n.events[n.events.length-1],s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0;let o=0;return a;function a(b){return t.enter("mathFlow"),t.enter("mathFlowFence"),t.enter("mathFlowFenceSequence"),l(b)}function l(b){return b===36?(t.consume(b),o++,l):o<2?r(b):(t.exit("mathFlowFenceSequence"),Ot(t,c,"whitespace")(b))}function c(b){return b===null||Qe(b)?u(b):(t.enter("mathFlowFenceMeta"),t.enter("chunkString",{contentType:"string"}),h(b))}function h(b){return b===null||Qe(b)?(t.exit("chunkString"),t.exit("mathFlowFenceMeta"),u(b)):b===36?r(b):(t.consume(b),h)}function u(b){return t.exit("mathFlowFence"),n.interrupt?e(b):t.attempt(YD,d,g)(b)}function d(b){return t.attempt({tokenize:y,partial:!0},g,f)(b)}function f(b){return(s?Ot(t,p,"linePrefix",s+1):p)(b)}function p(b){return b===null?g(b):Qe(b)?t.attempt(YD,d,g)(b):(t.enter("mathFlowValue"),m(b))}function m(b){return b===null||Qe(b)?(t.exit("mathFlowValue"),p(b)):(t.consume(b),m)}function g(b){return t.exit("mathFlow"),e(b)}function y(b,x,S){let k=0;return Ot(b,w,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function w(B){return b.enter("mathFlowFence"),b.enter("mathFlowFenceSequence"),_(B)}function _(B){return B===36?(k++,b.consume(B),_):k<o?S(B):(b.exit("mathFlowFenceSequence"),Ot(b,L,"whitespace")(B))}function L(B){return B===null||Qe(B)?(b.exit("mathFlowFence"),x(B)):S(B)}}}function Ake(t,e,r){const n=this;return i;function i(o){return o===null?e(o):(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),s)}function s(o){return n.parser.lazy[n.now().line]?r(o):e(o)}}function Eke(t){let r=(t||{}).singleDollarTextMath;return r==null&&(r=!0),{tokenize:n,resolve:Oke,previous:Lke,name:"mathText"};function n(i,s,o){let a=0,l,c;return h;function h(m){return i.enter("mathText"),i.enter("mathTextSequence"),u(m)}function u(m){return m===36?(i.consume(m),a++,u):a<2&&!r?o(m):(i.exit("mathTextSequence"),d(m))}function d(m){return m===null?o(m):m===36?(c=i.enter("mathTextSequence"),l=0,p(m)):m===32?(i.enter("space"),i.consume(m),i.exit("space"),d):Qe(m)?(i.enter("lineEnding"),i.consume(m),i.exit("lineEnding"),d):(i.enter("mathTextData"),f(m))}function f(m){return m===null||m===32||m===36||Qe(m)?(i.exit("mathTextData"),d(m)):(i.consume(m),f)}function p(m){return m===36?(i.consume(m),l++,p):l===a?(i.exit("mathTextSequence"),i.exit("mathText"),s(m)):(c.type="mathTextData",f(m))}}}function Oke(t){let e=t.length-4,r=3,n,i;if((t[r][1].type==="lineEnding"||t[r][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(n=r;++n<e;)if(t[n][1].type==="mathTextData"){t[e][1].type="mathTextPadding",t[r][1].type="mathTextPadding",r+=2,e-=2;break}}for(n=r-1,e++;++n<=e;)i===void 0?n!==e&&t[n][1].type!=="lineEnding"&&(i=n):(n===e||t[n][1].type==="lineEnding")&&(t[i][1].type="mathTextData",n!==i+2&&(t[i][1].end=t[n-1][1].end,t.splice(i+2,n-i-2),e-=n-i-2,n=i+2),i=void 0);return t}function Lke(t){return t!==36||this.events[this.events.length-1][1].type==="characterEscape"}function Dke(t){return{flow:{36:_ke},text:{36:Eke(t)}}}const Ike={};function Bke(t){const e=this,r=t||Ike,n=e.data(),i=n.micromarkExtensions||(n.micromarkExtensions=[]),s=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),o=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);i.push(Dke(r)),s.push(Ske()),o.push(Tke(r))}var Rke=Object.defineProperty,XD=Object.getOwnPropertySymbols,Pke=Object.prototype.hasOwnProperty,Nke=Object.prototype.propertyIsEnumerable,JD=(t,e,r)=>e in t?Rke(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Fke=(t,e)=>{for(var r in e||(e={}))Pke.call(e,r)&&JD(t,r,e[r]);if(XD)for(var r of XD(e))Nke.call(e,r)&&JD(t,r,e[r]);return t};function Bu(t,e){return Object.assign(t,{meta:Fke({package:"@milkdown/components"},e)}),t}var $ke=Object.defineProperty,ZD=Object.getOwnPropertySymbols,zke=Object.prototype.hasOwnProperty,Hke=Object.prototype.propertyIsEnumerable,QD=(t,e,r)=>e in t?$ke(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,lT=(t,e)=>{for(var r in e||(e={}))zke.call(e,r)&&QD(t,r,e[r]);if(ZD)for(var r of ZD(e))Hke.call(e,r)&&QD(t,r,e[r]);return t};const qke={mode:"preview"},ul=tr(lT({},qke),"linkTooltipStateCtx");Bu(ul,{displayName:"State<link-tooltip>",group:"LinkTooltip"});const Vke={addLink:()=>{},editLink:()=>{},removeLink:()=>{}},Bf=tr(lT({},Vke),"linkTooltipAPICtx");
376Bu(ul,{displayName:"API<link-tooltip>",group:"LinkTooltip"});const Wke={linkIcon:"🔗",editButton:"✎",removeButton:"⌫",confirmButton:"Confirm ⏎",onCopyLink:()=>{},inputPlaceholder:"Paste link..."},Rf=tr(lT({},Wke),"linkTooltipConfigCtx");Bu(ul,{displayName:"Config<link-tooltip>",group:"LinkTooltip"});const MW=yt("ToggleLink",t=>()=>e=>{const{doc:r,selection:n}=e,i=eo.type(t);return r.rangeHasMark(n.from,n.to,i)?(t.get(Bf.key).removeLink(n.from,n.to),!0):(t.get(Bf.key).addLink(n.from,n.to),!0)}),G1=e4("LINK_PREVIEW");Bu(G1[0],{displayName:"PreviewTooltipSpec<link-tooltip>",group:"LinkTooltip"});Bu(G1[1],{displayName:"PreviewTooltipPlugin<link-tooltip>",group:"LinkTooltip"});const t4=e4("LINK_EDIT");Bu(t4[0],{displayName:"EditTooltipSpec<link-tooltip>",group:"LinkTooltip"});Bu(t4[1],{displayName:"EditTooltipPlugin<link-tooltip>",group:"LinkTooltip"});function Dm({icon:t,class:e,onClick:r}){return te("span",{class:Mn("milkdown-icon",e),onPointerdown:r,ref:n=>{n&&t&&(n.innerHTML=An.sanitize(t.trim()))}})}Dm.props={icon:{type:String,required:!1},class:{type:String,required:!1},onClick:{type:Function,required:!1}};const jke=En({props:{config:{type:Object,required:!0},src:{type:Object,required:!0},onConfirm:{type:Function,required:!0},onCancel:{type:Function,required:!0}},setup({config:t,src:e,onConfirm:r,onCancel:n}){const i=We(e);Td(e,a=>{i.value=a});const s=()=>{r(i.value)},o=a=>{a.stopPropagation(),a.key==="Enter"&&(a.preventDefault(),s()),a.key==="Escape"&&(a.preventDefault(),n())};return()=>te("div",{class:"link-edit"},te("input",{class:"input-area",placeholder:t.value.inputPlaceholder,onKeydown:o,onInput:a=>{i.value=a.target.value},value:i.value}),i.value?te(Dm,{class:"button confirm",icon:t.value.confirmButton,onClick:s}):null)}});var Uke=Object.defineProperty,Gke=Object.defineProperties,Kke=Object.getOwnPropertyDescriptors,eI=Object.getOwnPropertySymbols,Yke=Object.prototype.hasOwnProperty,Xke=Object.prototype.propertyIsEnumerable,AW=t=>{throw TypeError(t)},tI=(t,e,r)=>e in t?Uke(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,n2=(t,e)=>{for(var r in e||(e={}))Yke.call(e,r)&&tI(t,r,e[r]);if(eI)for(var r of eI(e))Xke.call(e,r)&&tI(t,r,e[r]);return t},rI=(t,e)=>Gke(t,Kke(e)),EW=(t,e,r)=>e.has(t)||AW("Cannot "+r),Ar=(t,e,r)=>(EW(t,e,"read from private field"),r?r.call(t):e.get(t)),wa=(t,e,r)=>e.has(t)?AW("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),Yc=(t,e,r,n)=>(EW(t,e,"write to private field"),e.set(t,r),r),Tp,Ll,Dl,lb,_p,cb,nh,TS,hb;const nI={from:-1,to:-1,mark:null};class Jke{constructor(e,r){this.ctx=e,wa(this,Tp),wa(this,Ll),wa(this,Dl,n2({},nI)),wa(this,lb),wa(this,_p),wa(this,cb,We("")),wa(this,nh,()=>{Ar(this,Ll).hide(),this.ctx.update(ul.key,s=>rI(n2({},s),{mode:"preview"})),Yc(this,Dl,n2({},nI))}),wa(this,TS,s=>{const o=this.ctx.get(fr),{from:a,to:l,mark:c}=Ar(this,Dl),h=eo.type(this.ctx),u=An.sanitize(s);if(c&&c.attrs.href===u){Ar(this,nh).call(this);return}const d=o.state.tr;c&&d.removeMark(a,l,c),d.addMark(a,l,h.create({href:u})),o.dispatch(d),Ar(this,nh).call(this)}),wa(this,hb,(s,o,a)=>{const l=this.ctx.get(Rf.key);Ar(this,_p).value=l,Ar(this,cb).value=s,this.ctx.update(ul.key,h=>rI(n2({},h),{mode:"edit"}));const c=this.ctx.get(fr);c.dispatch(c.state.tr.setSelection(Je.create(c.state.doc,o,a))),Ar(this,Ll).show({getBoundingClientRect:()=>ew(c,o,a)}),requestAnimationFrame(()=>{var h;(h=Ar(this,Tp).querySelector("input"))==null||h.focus()})}),this.update=s=>{const{state:o}=s,{selection:a}=o;if(!(a instanceof Je))return;const{from:l,to:c}=a;l===Ar(this,Dl).from&&c===Ar(this,Dl).to||Ar(this,nh).call(this)},this.destroy=()=>{Ar(this,lb).unmount(),Ar(this,Ll).destroy(),Ar(this,Tp).remove()},this.addLink=(s,o)=>{Yc(this,Dl,{from:s,to:o,mark:null}),Ar(this,hb).call(this,"",s,o)},this.editLink=(s,o,a)=>{Yc(this,Dl,{from:o,to:a,mark:s}),Ar(this,hb).call(this,s.attrs.href,o,a)},this.removeLink=(s,o)=>{const a=this.ctx.get(fr),l=a.state.tr;l.removeMark(s,o,eo.type(this.ctx)),a.dispatch(l),Ar(this,nh).call(this)},Yc(this,_p,We(this.ctx.get(Rf.key)));const n=document.createElement("div");n.className="milkdown-link-edit";const i=bo(jke,{config:Ar(this,_p),src:Ar(this,cb),onConfirm:Ar(this,TS),onCancel:Ar(this,nh)});i.mount(n),Yc(this,lb,i),Yc(this,Tp,n),Yc(this,Ll,new Qw({content:n,debounce:0,shouldShow:()=>!1})),Ar(this,Ll).onHide=()=>{requestAnimationFrame(()=>{r.dom.focus({preventScroll:!0})})},Ar(this,Ll).update(r)}}Tp=new WeakMap;Ll=new WeakMap;Dl=new WeakMap;lb=new WeakMap;_p=new WeakMap;cb=new WeakMap;nh=new WeakMap;TS=new WeakMap;hb=new WeakMap;var Zke=Object.defineProperty,Qke=Object.defineProperties,e3e=Object.getOwnPropertyDescriptors,iI=Object.getOwnPropertySymbols,t3e=Object.prototype.hasOwnProperty,r3e=Object.prototype.propertyIsEnumerable,sI=(t,e,r)=>e in t?Zke(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,n3e=(t,e)=>{for(var r in e||(e={}))t3e.call(e,r)&&sI(t,r,e[r]);if(iI)for(var r of iI(e))r3e.call(e,r)&&sI(t,r,e[r]);return t},i3e=(t,e)=>Qke(t,e3e(e));function s3e(t){let e;t.update(Bf.key,r=>i3e(n3e({},r),{addLink:(n,i)=>{e==null||e.addLink(n,i)},editLink:(n,i,s)=>{e==null||e.editLink(n,i,s)},removeLink:(n,i)=>{e==null||e.removeLink(n,i)}})),t.set(t4.key,{view:r=>(e=new Jke(t,r),e)})}function o3e(t,e,r,n,i){let s={start:-1,end:-1};
376return r.nodesBetween(n,i,(o,a)=>{if(s.start>-1)return!1;s.start===-1&&t.isInSet(o.marks)&&e===o&&(s={start:a,end:a+Math.max(o.textContent.length,1)})}),s}function a3e(t,e,r){const n=e.posAtCoords({left:r.clientX,top:r.clientY});if(!n)return;const{pos:i}=n,s=e.state.doc.nodeAt(i);if(!s)return;const o=s.marks.find(l=>l.type===eo.mark.type(t));if(!(!o||!G1.pluginKey()))return{show:!0,pos:i,node:s,mark:o}}const l3e=En({props:{config:{type:Object,required:!0},src:{type:Object,required:!0},onEdit:{type:Object,required:!0},onRemove:{type:Object,required:!0}},setup({config:t,src:e,onEdit:r,onRemove:n}){const i=a=>{a.preventDefault(),a.stopPropagation(),r.value()},s=a=>{a.preventDefault(),a.stopPropagation(),n.value()},o=a=>{a.preventDefault();const l=e.value;navigator.clipboard&&l&&navigator.clipboard.writeText(l).then(()=>{t.value.onCopyLink(l)}).catch(c=>console.error(c))};return()=>te("div",{class:"link-preview"},te(Dm,{class:"button link-icon",icon:t.value.linkIcon,onClick:o}),te("a",{href:e.value,target:"_blank",class:"link-display"},e.value),te(Dm,{class:"button link-edit-button",icon:t.value.editButton,onClick:i}),te(Dm,{class:"button link-remove-button",icon:t.value.removeButton,onClick:s}))}});var OW=t=>{throw TypeError(t)},LW=(t,e,r)=>e.has(t)||OW("Cannot "+r),Ft=(t,e,r)=>(LW(t,e,"read from private field"),r?r.call(t):e.get(t)),qi=(t,e,r)=>e.has(t)?OW("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),Xc=(t,e,r,n)=>(LW(t,e,"write to private field"),e.set(t,r),r),ih,Hs,Mp,Ap,ub,db,fb,Ep,Op,pb,mb,gb,Lp;class c3e{constructor(e,r){this.ctx=e,qi(this,ih),qi(this,Hs),qi(this,Mp,this.ctx.use(ul.key)),qi(this,Ap),qi(this,ub,We("")),qi(this,db,We(()=>{})),qi(this,fb,We(()=>{})),qi(this,Ep),qi(this,Op,!1),qi(this,pb,({mode:n})=>{n==="edit"&&Ft(this,Lp).call(this)}),qi(this,mb,()=>{Xc(this,Op,!0)}),qi(this,gb,()=>{Xc(this,Op,!1)}),qi(this,Lp,()=>{Ft(this,Hs).hide(),Ft(this,Hs).element.removeEventListener("mouseenter",Ft(this,mb)),Ft(this,Hs).element.removeEventListener("mouseleave",Ft(this,gb))}),this.show=(n,i,s,o)=>{Ft(this,Ap).value=this.ctx.get(Rf.key),Ft(this,ub).value=n.attrs.href,Ft(this,db).value=()=>{this.ctx.get(Bf.key).editLink(n,i,s)},Ft(this,fb).value=()=>{this.ctx.get(Bf.key).removeLink(i,s),Ft(this,Lp).call(this)},Ft(this,Hs).show({getBoundingClientRect:()=>o}),Ft(this,Hs).element.addEventListener("mouseenter",Ft(this,mb)),Ft(this,Hs).element.addEventListener("mouseleave",Ft(this,gb))},this.hide=()=>{Ft(this,Op)||Ft(this,Lp).call(this)},this.update=()=>{},this.destroy=()=>{Ft(this,Ep).unmount(),Ft(this,Mp).off(Ft(this,pb)),Ft(this,Hs).destroy(),Ft(this,ih).remove()},Xc(this,Ap,We(this.ctx.get(Rf.key))),Xc(this,Ep,bo(l3e,{config:Ft(this,Ap),src:Ft(this,ub),onEdit:Ft(this,db),onRemove:Ft(this,fb)})),Xc(this,ih,document.createElement("div")),Ft(this,ih).className="milkdown-link-preview",Ft(this,Ep).mount(Ft(this,ih)),Xc(this,Hs,new Qw({debounce:0,content:Ft(this,ih),shouldShow:()=>!1})),Ft(this,Hs).update(r),Xc(this,Mp,e.use(ul.key)),Ft(this,Mp).on(Ft(this,pb))}}ih=new WeakMap;Hs=new WeakMap;Mp=new WeakMap;Ap=new WeakMap;ub=new WeakMap;db=new WeakMap;fb=new WeakMap;Ep=new WeakMap;Op=new WeakMap;pb=new WeakMap;mb=new WeakMap;gb=new WeakMap;Lp=new WeakMap;function h3e(t){let e;const n=Rv((s,o)=>{if(!e||!s.hasFocus()||t.get(ul.key).mode==="edit")return;const l=a3e(t,s,o);if(l){const c=s.state.doc.resolve(l.pos),h=o3e(l.mark,l.node,s.state.doc,c.before(),c.after()),u=h.start,d=h.end;e.show(l.mark,u,d,ew(s,u,d));return}e.hide()},50),i=()=>{setTimeout(()=>{e==null||e.hide()},50)};t.set(G1.key,{props:{handleDOMEvents:{mousemove:n,mouseleave:i}},view:s=>(e=new c3e(t,s),e)})}function u3e(t){h3e(t),s3e(t)}const d3e=[ul,Bf,Rf,G1,t4,MW].flat();var f3e=Object.defineProperty,oI=Object.getOwnPropertySymbols,p3e=Object.prototype.hasOwnProperty,m3e=Object.prototype.propertyIsEnumerable,aI=(t,e,r)=>e in t?f3e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,g3e=(t,e)=>{for(var r in e||(e={}))p3e.call(e,r)&&aI(t,r,e[r]);if(oI)for(var r of oI(e))m3e.call(e,r)&&aI(t,r,e[r]);return t};function DW(t,e){return Object.assign(t,{meta:g3e({package:"@milkdown/components"},e)}),t}const y3e={renderLabel:({label:t,listType:e,checked:r})=>r==null?e==="bullet"?"⦿":t:r?"☑":"□"},r4=tr(y3e,"listItemBlockConfigCtx");DW(r4,{displayName:"Config<list-item-block>",group:"ListItemBlock"});function IW({icon:t,class:e,onClick:r}){return te("span",{class:Mn("milkdown-icon",e),onPointerdown:r,ref:n=>{n&&t&&(n.innerHTML=An.sanitize(t.trim()))}})}
376IW.props={icon:{type:String,required:!1},class:{type:String,required:!1},onClick:{type:Function,required:!1}};const b3e=En({props:{label:{type:Object,required:!0},checked:{type:Object,required:!0},listType:{type:Object,required:!0},config:{type:Object,required:!0},readonly:{type:Object,required:!0},selected:{type:Object,required:!0},setAttr:{type:Function,required:!0},onMount:{type:Function,required:!0}},setup({label:t,checked:e,listType:r,config:n,readonly:i,setAttr:s,onMount:o,selected:a}){const l=d=>{d!=null&&d instanceof Element&&o(d)},c=d=>{d.stopPropagation(),d.preventDefault(),e.value!=null&&s("checked",!e.value)},h=mu(()=>n.renderLabel({label:t.value,listType:r.value,checked:e.value,readonly:i.value})),u=mu(()=>e.value==null?r.value==="bullet"?"bullet":"ordered":e.value?"checked":"unchecked");return()=>te("li",{class:Mn("list-item",a.value&&"ProseMirror-selectednode")},te("div",{class:"label-wrapper",onPointerdown:c,contenteditable:!1},te(IW,{class:Mn("label",i.value&&"readonly",u.value),icon:h.value})),te("div",{class:"children",ref:l}))}}),BW=_1(yo.node,t=>(e,r,n)=>{const i=document.createElement("div");i.className="milkdown-list-item-block";const s=document.createElement("div");s.setAttribute("data-content-dom","true"),s.classList.add("content-dom");const o=We(e.attrs.label),a=We(e.attrs.checked),l=We(e.attrs.listType),c=We(!r.editable),h=t.get(r4.key),u=We(!1),d=(x,S)=>{if(!r.editable)return;const k=n();k!=null&&(r.hasFocus()||r.focus(),r.dispatch(r.state.tr.setNodeAttribute(k,x,S)))},f=n0(()=>{u.value?i.classList.add("selected"):i.classList.remove("selected")});let p=0;const g=bo(b3e,{label:o,checked:a,listType:l,readonly:c,config:h,selected:u,setAttr:d,onMount:x=>{const{anchor:S,head:k}=r.state.selection;x.appendChild(s);const w=r.state.doc.resolve(S),_=r.state.doc.resolve(k);p=requestAnimationFrame(()=>{if(cancelAnimationFrame(p),!w.doc.eq(r.state.doc))return;const L=new Je(w,_);r.dispatch(r.state.tr.setSelection(L))})}});g.mount(i);const y=x=>{l.value=x.attrs.listType,o.value=x.attrs.label,a.value=x.attrs.checked,c.value=!r.editable};y(e);let b=e;return{dom:i,contentDOM:s,update:x=>x.type!==e.type?!1:(x.sameMarkup(b)&&x.content.eq(b.content)||(b=x,y(x)),!0),ignoreMutation:x=>!i||!s?!0:x.type==="selection"?!1:s===x.target&&x.type==="attributes"?!0:!s.contains(x.target),selectNode:()=>{u.value=!0},deselectNode:()=>{u.value=!1},destroy:()=>{f(),g.unmount(),i.remove(),s.remove()}}});DW(BW,{displayName:"NodeView<list-item-block>",group:"ListItemBlock"});const x3e=[r4,BW];var v3e=Object.defineProperty,lI=Object.getOwnPropertySymbols,w3e=Object.prototype.hasOwnProperty,k3e=Object.prototype.propertyIsEnumerable,cI=(t,e,r)=>e in t?v3e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,C3e=(t,e)=>{for(var r in e||(e={}))w3e.call(e,r)&&cI(t,r,e[r]);if(lI)for(var r of lI(e))k3e.call(e,r)&&cI(t,r,e[r]);return t};function RW(t,e){return Object.assign(t,{meta:C3e({package:"@milkdown/components"},e)}),t}var S3e=Object.defineProperty,hI=Object.getOwnPropertySymbols,T3e=Object.prototype.hasOwnProperty,_3e=Object.prototype.propertyIsEnumerable,uI=(t,e,r)=>e in t?S3e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,M3e=(t,e)=>{for(var r in e||(e={}))T3e.call(e,r)&&uI(t,r,e[r]);if(hI)for(var r of hI(e))_3e.call(e,r)&&uI(t,r,e[r]);return t};const A3e={renderButton:t=>{switch(t){case"add_row":return"+";case"add_col":return"+";case"delete_row":return"-";case"delete_col":return"-";case"align_col_left":return"left";case"align_col_center":return"center";case"align_col_right":return"right";case"col_drag_handle":return"=";case"row_drag_handle":return"="}}},n4=tr(M3e({},A3e),"tableBlockConfigCtx");RW(n4,{displayName:"Config<table-block>",group:"TableBlock"});function Eo({icon:t,class:e,onClick:r}){return te("span",{class:Mn("milkdown-icon",e),onPointerdown:r,ref:n=>{n&&t&&(n.innerHTML=An.sanitize(t.trim()))}})}Eo.props={icon:{type:String,required:!1},class:{type:String,required:!1},onClick:{type:Function,required:!1}};function PW(t){const{dragPreviewRef:e,tableWrapperRef:r,contentWrapperRef:n,yLineHandleRef:i,xLineHandleRef:s,colHandleRef:o,rowHandleRef:a}=t,l=e.value;if(!l)return;const c=r.value;if(!c)return;const h=n.value;if(!h)return;const u=h.querySelector("tbody");if(!u)return;const d=l.querySelector("tbody");if(!d)return;const f=i.value;if(!f)return;const p=s.value;if(!p)return;const m=o.value;if(!m)return;const g=a.value;return g?{preview:l,wrapper:c,content:h,contentRoot:u,previewRoot:d,yHandle:f,xHandle:p,colHandle:m,rowHandle:g}:void 0}function NW(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function FW(t,e,r,n,i){const{width:s,height:o}=n.querySelector("tbody").getBoundingClientRect();if(t==="y"){const l=n.querySelectorAll("tr")[i];if(!l)return;r.appendChild(l.cloneNode(!0));const c=l.getBoundingClientRect().height;
376Object.assign(e.style,{width:`${s}px`,height:`${c}px`}),e.dataset.show="true";return}if(t==="x"){const a=n.querySelectorAll("tr");let l;Array.from(a).forEach(c=>{const h=c.children[i];if(!h)return;l===void 0&&(l=h.getBoundingClientRect().width);const u=h.parentElement.cloneNode(!1),d=h.cloneNode(!0);u.appendChild(d),r.appendChild(u)}),Object.assign(e.style,{width:`${l}px`,height:`${o}px`}),e.dataset.show="true";return}}function E3e(t,e){return r=>{zW(t,r,e,n=>{$W("y",r,n,t);const{preview:i,content:s,previewRoot:o}=n;NW(o);const{hoverIndex:a}=t,[l]=a.value;FW("y",i,o,s,l)})}}function O3e(t,e){return r=>{zW(t,r,e,n=>{$W("x",r,n,t);const{preview:i,content:s,previewRoot:o}=n,{hoverIndex:a}=t,[l,c]=a.value;NW(o),FW("x",i,o,s,c)})}}function $W(t,e,r,n){const{xHandle:i,yHandle:s,colHandle:o,rowHandle:a,preview:l}=r;i.dataset.displayType=t==="y"?"indicator":"none",s.dataset.displayType=t==="x"?"indicator":"none",t==="y"?(o.dataset.show="false",dI(a)):(a.dataset.show="false",dI(o));const{hoverIndex:c,dragInfo:h}=n,[u,d]=c.value;h.value={startCoords:[e.clientX,e.clientY],startIndex:t==="y"?u:d,endIndex:t==="y"?u:d,type:t==="y"?"row":"col"},l.dataset.direction=t==="y"?"vertical":"horizontal"}function zW(t,e,r,n){const i=r==null?void 0:r.get(fr);if(!(i!=null&&i.editable))return;e.stopPropagation(),e.dataTransfer&&(e.dataTransfer.effectAllowed="move");const s=PW(t);s&&requestAnimationFrame(()=>{n(s)})}function dI(t){var e;(e=t.querySelector(".button-group"))==null||e.setAttribute("data-show","false")}function _S(t,e){for(let r=0;r<t.childCount;r++)if(t.child(r)===e)return r;return-1}function L3e(t,e){var r,n,i;if(e)try{const s=e.posAtCoords({left:t.clientX,top:t.clientY});if(!s)return;const o=s==null?void 0:s.inside;if(o==null||o<0)return;const a=e.state.doc.resolve(o),l=e.state.doc.nodeAt(o);if(!l)return;const c=["table_cell","table_header"],h=["table_row","table_header_row"],u=c.includes(l.type.n
376ame)?l:(r=Ko(g=>c.includes(g.type.name))(a))==null?void 0:r.node,d=(n=Ko(g=>h.includes(g.type.name))(a))==null?void 0:n.node,f=(i=Ko(g=>g.type.name==="table")(a))==null?void 0:i.node;if(!u||!d||!f)return;const p=_S(d,u);return[_S(f,d),p]}catch{return}}function i4(t,[e,r]){const n=t.value;if(!n)return;const i=n.querySelectorAll("tr"),s=i[e];if(!s)return;const o=i[0];if(!o)return;const a=o.children[r];if(!a)return;const l=s.children[r];if(l)return{row:s,col:l,headerCol:a}}function D3e(t,e,r){if(!r||!e)return;const{selection:n}=e.state;if(!(n instanceof cr))return;const{$from:i}=n,s=s0(i);if(!(!s||s.node!==r)){if(n.isColSelection()){const{$head:o}=n,a=o.index(o.depth-1);cT({refs:t,index:[0,a],before:l=>{var c;(c=l.querySelector(".button-group"))==null||c.setAttribute("data-show","true")}});return}if(n.isRowSelection()){const{$head:o}=n,a=Ko(c=>c.type.name==="table_row"||c.type.name==="table_header_row")(o);if(!a)return;const l=_S(s.node,a.node);hT({refs:t,index:[l,0],before:c=>{var h;l>0&&((h=c.querySelector(".button-group"))==null||h.setAttribute("data-show","true"))}})}}}function cT({refs:t,index:e,before:r,after:n}){const{contentWrapperRef:i,colHandleRef:s,hoverIndex:o}=t,a=s.value;if(!a)return;o.value=e;const l=i4(i,e);if(!l)return;const{headerCol:c}=l;a.dataset.show="true",r&&r(a),uo(c,a,{placement:"top"}).then(({x:h,y:u})=>{Object.assign(a.style,{left:`${h}px`,top:`${u}px`}),n&&n(a)}).catch(console.error)}function hT({refs:t,index:e,before:r,after:n}){const{contentWrapperRef:i,rowHandleRef:s,hoverIndex:o}=t,a=s.value;if(!a)return;o.value=e;const l=i4(i,e);if(!l)return;const{row:c}=l;a.dataset.show="true",r&&r(a),uo(c,a,{placement:"left"}).then(({x:h,y:u})=>{Object.assign(a.style,{left:`${h}px`,top:`${u}px`}),n&&n(a)}).catch(console.error)}function HW(t,e,r){const n=r==="x"?"left":"top",i=r==="x"?"right":"bottom",s=t.length-1,o=t.findIndex((l,c)=>{const h=l.getBoundingClientRect(),u=h[n],d=h[i];return u<=e&&e<=d||c===s&&e>d||c===0&&e<u}),a=t[o];return a?[a,o]:void 0}function I3e(t,e){const r=t.querySelector("tr");if(!r)return;const n=Array.from(r.children);return HW(n,e,"x")}function B3e(t,e){const r=Array.from(t.querySelectorAll("tr"));return HW(r,e,"y")}function R3e(t){return Nv(e=>{const r=PW(t);if(!r)return;const{preview:n,content:i,contentRoot:s,xHandle:o,yHandle:a}=r,{dragInfo:l,hoverIndex:c}=t;if(n.dataset.show==="false")return;const h=i4(t.contentWrapperRef,c.value);if(!h||!s.querySelector("tr"))return;const d=l.value;if(!d||!s.offsetParent)return;const f=s.offsetParent.offsetTop,p=s.offsetParent.offsetLeft;if(d.type==="col"){const m=h.col.getBoundingClientRect().width,{left:g,width:y}=s.getBoundingClientRect(),b=p-g,x=e.clientX+b-m/2,[S]=d.startCoords,k=S<e.clientX?"right":"left";n.style.top=`${f}px`;const w=x<g+b-20?g+b-20:x>g+y+b-m+20?g+y+b-m+20:x;n.style.left=`${w}px`;const _=I3e(s,e.clientX);if(_){const[L,B]=_,E=a.getBoundingClientRect().width,D=i.getBoundingClientRect();d.endIndex=B,uo(L,a,{placement:k==="left"?"left":"right",middleware:[xc(k==="left"?-1*E:0)]}).then(({x:N})=>{a.dataset.show="true",Object.assign(a.style,{height:`${D.height}px`,left:`${N}px`,top:`${f}px`})}).catch(console.error)}}else if(d.type==="row"){const m=h.row.getBoundingClientRect().height,{top:g,height:y}=s.getBoundingClientRect(),b=f-g,x=e.clientY+b-m/2,[S,k]=d.startCoords,w=k<e.clientY?"down":"up",_=x<g+b-20?g+b-20:x>g+y+b-m+20?g+y+b-m+20:x;n.style.top=`${_}px`,n.style.left=`${p}px`;const L=B3e(s,e.clientY);if(L){const[B,E]=L,D=o.getBoundingClientRect().height,N=i.getBoundingClientRect();d.endIndex=E,uo(B,o,{placement:w==="up"?"top":"bottom",middleware:[xc(w==="up"?-1*D:0)]}).then(({y:K})=>{o.dataset.show="true",Object.assign(o.style,{width:`${N.width}px`,top:`${K}px`})}).catch(console.error)}}},20)}function P3e(t,e,r){const{dragPreviewRef:n,yLineHandleRef:i,xLineHandleRef:s,dragInfo:o}=t,a=E3e(t,e),l=O3e(t,e),c=()=>{const d=n.value;if(!d||d.dataset.show==="false")return;const f=d==null?void 0:d.querySelector("tbody");for(;f!=null&&f.firstChild;)f==null||f.removeChild(f.firstChild);d&&(d.dataset.show="false")},h=()=>{var d;const f=n.value;if(!f)return;const p=i.value;if(!p)return;const m=s.value;if(!m)return;const g=o.value;if(!g||!e||f.dataset.show==="false"||!t.colHandleRef.value||!t.rowHandleRef.value||(p.dataset.show="false",m.dataset.show="false",g.startIndex===g.endIndex))return;const x=e.get(He),S={from:g.startIndex,to:g.endIndex,pos:((d=r==null?void 0:r())!=null?d:0)+1};if(g.type==="col"){x.call(bh.key,{pos:S.pos,index:g.startIndex}
376),x.call(d9.key,S);const k=[0,g.endIndex];cT({refs:t,index:k})}else{x.call(yh.key,{pos:S.pos,index:g.startIndex}),x.call(u9.key,S);const k=[g.endIndex,0];hT({refs:t,index:k})}requestAnimationFrame(()=>{e.get(fr).focus()})},u=R3e(t);return L1(()=>{window.addEventListener("dragover",u),window.addEventListener("dragend",c),window.addEventListener("drop",h)}),D1(()=>{window.removeEventListener("dragover",u),window.removeEventListener("dragend",c),window.removeEventListener("drop",h)}),{dragRow:a,dragCol:l}}function N3e(t,e,r){const{xLineHandleRef:n,contentWrapperRef:i,colHandleRef:s,rowHandleRef:o,hoverIndex:a,lineHoverIndex:l}=t;return{onAddRow:()=>{var m,g,y;if(!e)return;const b=n.value;if(!b)return;const[x]=l.value;if(x<0||!e.get(fr).editable)return;const S=Array.from((g=(m=i.value)==null?void 0:m.querySelectorAll("tr"))!=null?g:[]),k=e.get(He),w=((y=r==null?void 0:r())!=null?y:0)+1;S.length===x?(k.call(yh.key,{pos:w,index:x-1}),k.call(y9.key)):(k.call(yh.key,{pos:w,index:x}),k.call(g9.key)),k.call(yh.key,{pos:w,index:x}),b.dataset.show="false"},onAddCol:()=>{var m,g,y,b;if(!e||!n.value)return;const[S,k]=l.value;if(k<0||!e.get(fr).editable)return;const w=Array.from((y=(g=(m=i.value)==null?void 0:m.querySelector("tr"))==null?void 0:g.children)!=null?y:[]),_=e.get(He),L=((b=r==null?void 0:r())!=null?b:0)+1;w.length===k?(_.call(bh.key,{pos:L,index:k-1}),_.call(m9.key)):(_.call(bh.key,{pos:L,index:k}),_.call(p9.key)),_.call(bh.key,{pos:L,index:k})},selectCol:()=>{var m,g;if(!e)return;const[y,b]=a.value,x=e.get(He),S=((m=r==null?void 0:r())!=null?m:0)+1;x.call(bh.key,{pos:S,index:b});const k=(g=s.value)==null?void 0:g.querySelector(".button-group");k&&(k.dataset.show=k.dataset.show==="true"?"false":"true")},selectRow:()=>{var m,g;if(!e)return;const[y,b]=a.value,x=e.get(He),S=((m=r==null?void 0:r())!=null?m:0)+1;x.call(yh.key,{pos:S,index:y});const k=(g=o.value)==null?void 0:g.querySelector(".button-group");k&&y>0&&(k.dataset.show=k.dataset.show==="true"?"false":"true")},deleteSelected:m=>{if(!e||!e.get(fr).editable)return;m.preventDefault(),m.stopPropagation(),e.get(He).call(f9.key),requestAnimationFrame(()=>{e.get(fr).focus()})},onAlign:m=>g=>{if(!e||!e.get(fr).editable)return;g.preventDefault(),g.stopPropagation(),e.get(He).call(b9.key,m),requestAnimationFrame(()=>{e.get(fr).focus()})}}}function F3e(t,e){return Nv(r=>{if(!(e!=null&&e.editable))return;const{contentWrapperRef:n,yLineHandleRef:i,xLineHandleRef:s,colHandleRef:o,rowHandleRef:a,hoverIndex:l,lineHoverIndex:c}=t,h=i.value;if(!h)return;const u=s.value;if(!u)return;const d=n.value;if(!d)return;const f=a.value;if(!f)return;const p=o.value;if(!p)return;const m=L3e(r,e);if(!m)return;const g=i4(n,m);if(!g)return;const[y,b]=m,x=g.col.getBoundingClientRect(),S=Math.abs(r.clientX-x.left)<8,k=Math.abs(x.right-r.clientX)<8,w=Math.abs(r.clientY-x.top)<8,_=Math.abs(x.bottom-r.clientY)<8,L=S||k||w||_,B=f.querySelector(".button-group"),E=p.querySelector(".button-group");if(B&&(B.dataset.show="false"),E&&(E.dataset.show="false"),L){const D=d.getBoundingClientRect();f.dataset.show="false",p.dataset.show="false",u.dataset.displayType="tool",h.dataset.displayType="tool";const N=h.getBoundingClientRect().width,K=u.getBoundingClientRect().height;S||k?(c.value[1]=S?b:b+1,uo(g.col,h,{placement:S?"left":"right",middleware:[xc(S?-1*N:0)]}).then(({x:z})=>{h.dataset.show="true",Object.assign(h.style,{height:`${D.height}px`,left:`${z}px`})}).catch(console.error)):h.dataset.show="false",m[0]!==0&&(w||_)?(c.value[0]=w?y:y+1,uo(g.row,u,{placement:w?"top":"bottom",middleware:[xc(w?-1*K:0)]}).then(({y:z})=>{u.dataset.show="true",Object.assign(u.style,{width:`${D.width}px`,top:`${z}px`})}).catch(console.error)):u.dataset.show="false";return}c.value=[-1,-1],h.dataset.show="false",u.dataset.show="false",f.dataset.show="true",p.dataset.show="true",hT({refs:t,index:m}),cT({refs:t,index:m}),l.value=m},20)}function $3e(t){return()=>{const{rowHandleRef:e,colHandleRef:r,yLineHandleRef:n,xLineHandleRef:i}=t;setTimeout(()=>{const s=e.value;if(!s)return;const o=r.value;if(!o)return;const a=n.value;if(!a)return;const l=i.value;l&&(s.dataset.show="false",o.dataset.show="false",a.dataset.show="false",l.dataset.show="false")},200)}}function z3e(t,e){const r=F3e(t,e),n=$3e(t);return{pointerMove:r,pointerLeave:n}}const H3e=En({props:{view:{type:Object,required:!0},ctx:{type:Object,required:!0},getPos:{type:Function,required:!0},config:{type:Object,required:!0},onMount:{type:Function,required:!0},node:{type:Object,required:!0}},setup({view:t,node:e,ctx:r,getPos:n,config:i,onMount:s}){const o=We(),a=N=>{N!=null&&(N instanceof HTMLElement?(o.value=N,s(N)):o.value=void 0)}
376,l=We(),c=We(),h=We(),u=We(),d=We(),f=We(),p=We([0,0]),m=We([-1,-1]),g=We(),y={dragPreviewRef:f,tableWrapperRef:d,contentWrapperRef:o,yLineHandleRef:u,xLineHandleRef:h,colHandleRef:l,rowHandleRef:c,hoverIndex:p,lineHoverIndex:m,dragInfo:g},{pointerLeave:b,pointerMove:x}=z3e(y,t),{dragRow:S,dragCol:k}=P3e(y,r,n),{onAddRow:w,onAddCol:_,selectCol:L,selectRow:B,deleteSelected:E,onAlign:D}=N3e(y,r,n);return L1(()=>{requestAnimationFrame(()=>{t.editable&&D3e(y,t,e.value)})}),()=>te("div",{onDragstart:N=>N.preventDefault(),onDragover:N=>N.preventDefault(),onDragleave:N=>N.preventDefault(),onPointermove:x,onPointerleave:b},te("button",{type:"button","data-show":"false",contenteditable:"false",draggable:"true","data-role":"col-drag-handle",class:"handle cell-handle",onDragstart:k,onClick:L,onPointerdown:N=>N.stopPropagation(),onPointermove:N=>N.stopPropagation(),ref:l},te(Eo,{icon:i.renderButton("col_drag_handle")}),te("div",{"data-show":"false",class:"button-group",onPointermove:N=>N.stopPropagation()},te("button",{type:"button",onPointerdown:D("left")},te(Eo,{icon:i.renderButton("align_col_left")})),te("button",{type:"button",onPointerdown:D("center")},te(Eo,{icon:i.renderButton("align_col_center")})),te("button",{type:"button",onPointerdown:D("right")},te(Eo,{icon:i.renderButton("align_col_right")})),te("button",{type:"button",onPointerdown:E},te(Eo,{icon:i.renderButton("delete_col")})))),te("button",{type:"button","data-show":"false",contenteditable:"false",draggable:"true","data-role":"row-drag-handle",class:"handle cell-handle",onDragstart:S,onClick:B,onPointerdown:N=>N.stopPropagation(),onPointermove:N=>N.stopPropagation(),ref:c},te(Eo,{icon:i.renderButton("row_drag_handle")}),te("div",{"data-show":"false",class:"button-group",onPointermove:N=>N.stopPropagation()},te("button",{type:"button",onPointerdown:E},te(Eo,{icon:i.renderButton("delete_row")})))),te("div",{class:"table-wrapper",ref:d},te("div",{"data-show":"false",class:"drag-preview","data-direction":"vertical",ref:f},te("table",null,te("tbody",null))),te("div",{"data-show":"false",contenteditable:"false","data-display-type":"tool","data-role":"x-line-drag-handle",class:"handle line-handle",onPointermove:N=>N.stopPropagation(),ref:h},te("button",{type:"button",onClick:w,class:"add-button"},te(Eo,{icon:i.renderButton("add_row")}))),te("div",{"data-show":"false",contenteditable:"false","data-display-type":"tool","data-role":"y-line-drag-handle",class:"handle line-handle",onPointermove:N=>N.stopPropagation(),ref:u},te("button",{type:"button",onClick:_,class:"add-button"},te(Eo,{icon:i.renderButton("add_col")}))),te("table",{ref:a,class:"children"})))}});var qW=t=>{throw TypeError(t)},q3e=(t,e,r)=>e.has(t)||qW("Cannot "+r),V3e=(t,e,r)=>e.has(t)?qW("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),W3e=(t,e,r)=>(q3e(t,e,"access private method"),r),MS,VW;class j3e{constructor(e,r,n,i){this.ctx=e,this.node=r,this.view=n,this.getPos=i,V3e(this,MS);const s=document.createElement("div");s.className="milkdown-table-block";const o=document.createElement("tbody");this.contentDOM=o,o.setAttribute("data-content-dom","true"),o.classList.add("content-dom"),this.nodeRef=wx(r);const a=bo(H3e,{view:n,ctx:e,getPos:i,config:e.get(n4.key),onMount:l=>{l.appendChild(o)},node:this.nodeRef});a.mount(s),this.app=a,this.dom=s}update(e){return e.type!==this.node.type||e.sameMarkup(this.node)&&e.content.eq(this.node.content)?!1:(this.node=e,this.nodeRef.value=e,!0)}stopEvent(e){if(e.type==="drop"||e.type.startsWith("drag"))return!0;if(e.type==="mousedown"||e.type==="pointerdown"){if(e.target instanceof Element&&e.target.closest("button"))return!0;const r=e.target;if(r instanceof HTMLElement&&(r.closest("th")||r.closest("td"))){const n=e;return W3e(this,MS,VW).call(this,n)}}return!1}ignoreMutation(e){return!this.dom||!this.contentDOM?!0:e.type==="selection"?!1:this.contentDOM===e.target&&e.type==="attributes"?!0:!this.contentDOM.contains(e.target)}destroy(){this.app.unmount(),this.dom.remove(),this.contentDOM.remove()}}MS=new WeakSet;VW=function(t){const e=this.view;if(!e.editable)return!1;const{state:r,dispatch:n}=e,i=e.posAtCoords({left:t.clientX,top:t.clientY});if(!i)return!1;const s=r.doc.resolve(i.inside),o=Ko(c=>c.type.name==="table_cell"||c.type.name==="table_header")(s);if(!o)return!1;if(r.selection instanceof Je){const c=Ko(h=>h.type.name==="table_cell"||h.type.name==="table_header")(r.selection.$from);if((c==null?void 0:c.node)===o.node)return!1}const{from:a}=o,l=lt.create(r.doc,a+1);return r.selection.eq(l)?!1:(r.selection instanceof cr?setTimeout(()=>{n(r.tr.setSelection(l).scrollIntoView())},20):requestAnimationFrame(()=>{n(r.tr.setSelection(l).scrollIntoView())}),!0)};const WW=_1(Du.node,t=>(e,r,n)=>new j3e(t,e,r,n));RW(WW,{displayName:"NodeView<table-block>",group:"TableBlock"});const U3e=[n4,WW];function AS(t){if(!t)return!1;if(Array.isArray(t))return t.length>1?!1:AS(t[0]);const e=t.content;return e?AS(e):t.type==="text"}const jW=nn(t=>{const e=t.get(Yo);t.update(ym,i=>({...i,editable:i.editable??(()=>!0)}));const r=new Dr("MILKDOWN_CLIPBOARD");return new _r({key:r,props:{handlePaste:(i,s)=>{var y,b;const o=t.get(mm),a=(b=(y=i.props).editable)==null?void 0:b.call(y,i.state),{clipboardData:l}=s;if(!a||!l||i.state.selection.$from.node().type.spec.code)return!1;const h=l.getData("text/plain"),u=l.getData("vscode-editor-data");if(u){const x=JSON.parse(u),S=x==null?void 0:x.mode;if(h&&S){const{tr:k}=i.state,w=ule("code_block",e);return k.replaceSelectionWith(w.create({language:S})).setSelection(Je.near(k.doc.resolve(Math.max(0,k.selection.from-2)))).insertText(h.replace(/\r\n?/g,`
377`)),i.dispatch(k),!0}}const d=l.getData("text/html");if(d.length===0&&h.length===0)return!1;const f=au.fromSchema(e);let p;if(d.length===0){const x=o(h);
377if(!x||typeof x=="string")return!1;p=_u.fromSchema(e).serializeFragment(x.content)}else{const x=document.createElement("template");x.innerHTML=d,p=x.content.cloneNode(!0),x.remove()}const m=f.parseSlice(p),g=cle(m);return g?(i.dispatch(i.state.tr.replaceSelectionWith(g,!0)),!0):(i.dispatch(i.state.tr.replaceSelection(m)),!0)},clipboardTextSerializer:i=>{const s=t.get(vd);if(AS(i.content.toJSON()))return i.content.textBetween(0,i.content.size,`
378
379`);const a=e.topNodeType.createAndFill(void 0,i.content);return a?s(a):""}}})});jW.meta={displayName:"Prose<clipboard>",package:"@milkdown/plugin-clipboard"};function u0(t,e){return Object.assign(t,{meta:{package:"@milkdown/plugin-history",...e}}),t}const uT=yt("Undo",()=>()=>Hw);u0(uT,{displayName:"Command<undo>"});const dT=yt("Redo",()=>()=>Of);u0(dT,{displayName:"Command<redo>"});const fT=tr({},"historyProviderConfig");u0(fT,{displayName:"Ctx<historyProviderConfig>"});const UW=nn(t=>nve(t.get(fT.key)));u0(UW,{displayName:"Ctx<historyProviderPlugin>"});const pT=Fi("historyKeymap",{Undo:{shortcuts:"Mod-z",command:t=>{const e=t.get(He);return()=>e.call(uT.key)}},Redo:{shortcuts:["Mod-y","Shift-Mod-z"],command:t=>{const e=t.get(He);return()=>e.call(dT.key)}}});u0(pT.ctx,{displayName:"KeymapCtx<history>"});u0(pT.shortcuts,{displayName:"Keymap<history>"});const G3e=[fT,UW,pT,uT,dT].flat();function K3e(t,e){const{doc:r,selection:n}=t;if(!r||!n||!(n instanceof Je||n instanceof Ii))return t;const{to:i}=n,s=e.type==="space"?Array(e.size).fill(" ").join(""):"	";return t.insertText(s,i)}const s4=tr({type:"space",size:2},"indentConfig");s4.meta={package:"@milkdown/plugin-indent",displayName:"Ctx<indentConfig>"};const GW=W$(t=>({Tab:(e,r)=>{const n=t.get(s4.key),{tr:i}=e,s=K3e(i,n);return s.docChanged?(r==null||r(s),!0):!1}}));GW.meta={package:"@milkdown/plugin-indent",displayName:"Shortcut<indent>"};const Y3e=[s4,GW];class KW{constructor(){this.beforeMountedListeners=[],this.mountedListeners=[],this.updatedListeners=[],this.selectionUpdatedListeners=[],this.markdownUpdatedListeners=[],this.blurListeners=[],this.focusListeners=[],this.destroyListeners=[],this.beforeMount=e=>(this.beforeMountedListeners.push(e),this),this.mounted=e=>(this.mountedListeners.push(e),this),this.updated=e=>(this.updatedListeners.push(e),this)}get listeners(){return{beforeMount:this.beforeMountedListeners,mounted:this.mountedListeners,updated:this.updatedListeners,markdownUpdated:this.markdownUpdatedListeners,blur:this.blurListeners,focus:this.focusListeners,destroy:this.destroyListeners,selectionUpdated:this.selectionUpdatedListeners}}markdownUpdated(e){return this.markdownUpdatedListeners.push(e),this}blur(e){return this.blurListeners.push(e),this}focus(e){return this.focusListeners.push(e),this}destroy(e){return this.destroyListeners.push(e),this}selectionUpdated(e){return this.selectionUpdatedListeners.push(e),this}}const Vx=Rt(new KW,"listener"),X3e=new Dr("MILKDOWN_LISTENER"),YW=t=>(t.inject(Vx,new KW),async()=>{await t.wait(Wh);const e=t.get(Vx),{listeners:r}=e;r.beforeMount.forEach(l=>l(t)),await t.wait(gm);const n=t.get(vd);let i=null,s=null,o=null;const a=new _r({key:X3e,view:()=>({destroy:()=>{r.destroy.forEach(l=>l(t))}}),props:{handleDOMEvents:{focus:()=>(r.focus.forEach(l=>l(t)),!1),blur:()=>(r.blur.forEach(l=>l(t)),!1)}},state:{init:(l,c)=>{i=c.doc,s=n(c.doc)},apply:l=>{const c=l.selection;return(!o&&c||o&&!c.eq(o))&&(r.selectionUpdated.forEach(u=>{u(t,c,o)}),o=c),!l.docChanged||l.getMeta("addToHistory")===!1?void 0:Rv(()=>{const{doc:u}=l;if(r.updated.length>0&&i&&!i.eq(u)&&r.updated.forEach(d=>{d(t,u,i)}),r.markdownUpdated.length>0&&i&&!i.eq(u)){const d=n(u);r.markdownUpdated.forEach(f=>{f(t,d,s)}),s=d}i=u},200)()}}});t.update(yc,l=>l.concat(a)),await t.wait(X2),r.mounted.forEach(l=>l(t))});YW.meta={package:"@milkdown/plugin-listener",displayName:"Listener"};const mT=tr({shouldAppend:t=>!(!t||["heading","paragraph"].includes(t.type.name)),getNode:t=>t.schema.nodes.paragraph.create()},"trailingConfig");mT.meta={package:"@milkdown/plugin-trailing",displayName:"Ctx<trailingConfig>"};const XW=nn(t=>{const e=new Dr("MILKDOWN_TRAILING"),{shouldAppend:r,getNode:n}=t.get(mT.key),i=new _r({key:e,state:{init:(s,o)=>{const a=o.tr.doc.lastChild;return r(a,o)},apply:(s,o,a,l)=>{if(!s.docChanged)return o;const c=s.doc.lastChild;return r(c,l)}},appendTransaction:(s,o,a)=>{const{doc:l,tr:c}=a,h=n==null?void 0:n(a),u=i.getState(a),d=l.content.size;if(!(!u||!h))return c.insert(d,h)}});return i});XW.meta={package:"@milkdown/plugin-trailing",displayName:"Prose<trailing>"};const J3e=[mT,XW];var Vt=(t=>(t.CodeMirror="code-mirror",t.ListItem="list-item",t.LinkTooltip="link-tooltip",t.Cursor="cursor",t.ImageBlock="image-block",t.BlockEdit="block-edit",t.Toolbar="toolbar",t.Placeholder="placeholder",t.Table="table",t.Latex="latex",t))(Vt||{});const Z3e={cursor:!0,"list-item":!0,"link-tooltip":!0,"image-block":!0,"block-edit":!0,placeholder:!0,toolbar:!0,"code-mirror":!0,table:!0,latex:!0},Q3e=`
380  <svg
381    xmlns="http://www.w3.org/2000/svg"
382    width="24"
383    height="24"
384    viewBox="0 0 24 24"
385  >
386    <path
387      d="M4.25 20.5C4.0375 20.5 3.85942 20.4281 3.71575 20.2843C3.57192 20.1404 3.5 19.9622 3.5 19.7498C3.5 19.5371 3.57192 19.359 3.71575 19.2155C3.85942 19.0718 4.0375 19 4.25 19H19.75C19.9625 19 20.1406 19.0719 20.2843 19.2158C20.4281 19.3596 20.5 19.5378 20.5 19.7502C20.5 19.9629 20.4281 20.141 20.2843 20.2845C20.1406 20.4282 19.9625 20.5 19.75 20.5H4.25ZM8.25 16.625C8.0375 16.625 7.85942 16.5531 7.71575 16.4093C7.57192 16.2654 7.5 16.0872 7.5 15.8748C7.5 15.6621 7.57192 15.484 7.71575 15.3405C7.85942 15.1968 8.0375 15.125 8.25 15.125H15.75C15.9625 15.125 16.1406 15.1969 16.2843 15.3408C16.4281 15.4846 16.5 15.6628 16.5 15.8753C16.5 16.0879 16.4281 16.266 16.2843 16.4095C16.1406 16.5532 15.9625 16.625 15.75 16.625H8.25ZM4.25 12.75C4.0375 12.75 3.85942 12.6781 3.71575 12.5343C3.57192 12.3904 3.5 12.2122 3.5 11.9998C3.5 11.7871 3.57192 11.609 3.71575 11.4655C3.85942 11.3218 4.0375 11.25 4.25 11.25H19.75C19.9625 11.25 20.1406 11.3219 20.2843 11.4658C20.4281 11.6096 20.5 11.7878 20.5 12.0003C20.5 12.2129 20.4281 12.391 20.2843 12.5345C20.1406 12.6782 19.9625 12.75 19.75 12.75H4.25ZM8.25 8.875C8.0375 8.875 7.85942 8.80308 7.71575 8.65925C7.57192 8.51542 7.5 8.33725 7.5 8.12475C7.5 7.91208 7.57192 7.734 7.71575 7.5905C7.85942 7.44683 8.0375 7.375 8.25 7.375H15.75C15.9625 7.375 16.1406 7.44692 16.2843 7.59075C16.4281 7.73458 16.5 7.91275 16.5 8.12525C16.5 8.33792 16.4281 8.516 16.2843 8.6595C16.1406 8.80317 15.9625 8.875 15.75 8.875H8.25ZM4.25 5C4.0375 5 3.85942 4.92808 3.71575 4.78425C3.57192 4.64042 3.5 4.46225 3.5 4.24975C3.5 4.03708 3.57192 3.859 3.71575 3.7155C3.85942 3.57183 4.0375 3.5 4.25 3.5H19.75C19.9625 3.5 20.1406 3.57192 20.2843 3.71575C20.4281 3.85958 20.5 4.03775 20.5 4.25025C20.5 4.46292 20.4281 4.641 20.2843 4.7845C20.1406 4.92817 19.9625 5 19.75 5H4.25Z"
388    />
389  </svg>
390`,eCe=`
391  <svg
392    xmlns="http://www.w3.org/2000/svg"
393    width="24"
394    height="24"
395    viewBox="0 0 24 24"
396  >
397    <path
398      d="M4.25 20.5C4.0375 20.5 3.85942 20.4281 3.71575 20.2843C3.57192 20.1404 3.5 19.9622 3.5 19.7498C3.5 19.5371 3.57192 19.359 3.71575 19.2155C3.85942 19.0718 4.0375 19 4.25 19H19.75C19.9625 19 20.1406 19.0719 20.2843 19.2158C20.4281 19.3596 20.5 19.5378 20.5 19.7502C20.5 19.9629 20.4281 20.141 20.2843 20.2845C20.1406 20.4282 19.9625 20.5 19.75 20.5H4.25ZM4.25 16.625C4.0375 16.625 3.85942 16.5531 3.71575 16.4093C3.57192 16.2654 3.5 16.0872 3.5 15.8748C3.5 15.6621 3.57192 15.484 3.71575 15.3405C3.85942 15.1968 4.0375 15.125 4.25 15.125H13.75C13.9625 15.125 14.1406 15.1969 14.2843 15.3408C14.4281 15.4846 14.5 15.6628 14.5 15.8753C14.5 16.0879 14.4281 16.266 14.2843 16.4095C14.1406 16.5532 13.9625 16.625 13.75 16.625H4.25ZM4.25 12.75C4.0375 12.75 3.85942 12.6781 3.71575 12.5343C3.57192 12.3904 3.5 12.2122 3.5 11.9998C3.5 11.7871 3.57192 11.609 3.71575 11.4655C3.85942 11.3218 4.0375 11.25 4.25 11.25H19.75C19.9625 11.25 20.1406 11.3219 20.2843 11.4658C20.4281 11.6096 20.5 11.7878 20.5 12.0003C20.5 12.2129 20.4281 12.391 20.2843 12.5345C20.1406 12.6782 19.9625 12.75 19.75 12.75H4.25ZM4.25 8.875C4.0375 8.875 3.85942 8.80308 3.71575 8.65925C3.57192 8.51542 3.5 8.33725 3.5 8.12475C3.5 7.91208 3.57192 7.734 3.71575 7.5905C3.85942 7.44683 4.0375 7.375 4.25 7.375H13.75C13.9625 7.375 14.1406 7.44692 14.2843 7.59075C14.4281 7.73458 14.5 7.91275 14.5 8.12525C14.5 8.33792 14.4281 8.516 14.2843 8.6595C14.1406 8.80317 13.9625 8.875 13.75 8.875H4.25ZM4.25 5C4.0375 5 3.85942 4.92808 3.71575 4.78425C3.57192 4.64042 3.5 4.46225 3.5 4.24975C3.5 4.03708 3.57192 3.859 3.71575 3.7155C3.85942 3.57183 4.0375 3.5 4.25 3.5H19.75C19.9625 3.5 20.1406 3.57192 20.2843 3.71575C20.4281 3.85958 20.5 4.03775 20.5 4.25025C20.5 4.46292 20.4281 4.641 20.2843 4.7845C20.1406 4.92817 19.9625 5 19.75 5H4.25Z"
399    />
400  </svg>
401`,tCe=`
402  <svg
403    xmlns="http://www.w3.org/2000/svg"
404    width="24"
405    height="24"
406    viewBox="0 0 24 24"
407  >
408    <path
409      d="M4.25 5C4.0375 5 3.85942 4.92808 3.71575 4.78425C3.57192 4.64042 3.5 4.46225 3.5 4.24975C3.5 4.03708 3.57192 3.859 3.71575 3.7155C3.85942 3.57183 4.0375 3.5 4.25 3.5H19.75C19.9625 3.5 20.1406 3.57192 20.2843 3.71575C20.4281 3.85958 20.5 4.03775 20.5 4.25025C20.5 4.46292 20.4281 4.641 20.2843 4.7845C20.1406 4.92817 19.9625 5 19.75 5H4.25ZM10.25 8.875C10.0375 8.875 9.85942 8.80308 9.71575 8.65925C9.57192 8.51542 9.5 8.33725 9.5 8.12475C9.5 7.91208 9.57192 7.734 9.71575 7.5905C9.85942 7.44683 10.0375 7.375 10.25 7.375H19.75C19.9625 7.375 20.1406 7.44692 20.2843 7.59075C20.4281 7.73458 20.5 7.91275 20.5 8.12525C20.5 8.33792 20.4281 8.516 20.2843 8.6595C20.1406 8.80317 19.9625 8.875 19.75 8.875H10.25ZM4.25 12.75C4.0375 12.75 3.85942 12.6781 3.71575 12.5343C3.57192 12.3904 3.5 12.2122 3.5 11.9998C3.5 11.7871 3.57192 11.609 3.71575 11.4655C3.85942 11.3218 4.0375 11.25 4.25 11.25H19.75C19.9625 11.25 20.1406 11.3219 20.2843 11.4658C20.4281 11.6096 20.5 11.7878 20.5 12.0003C20.5 12.2129 20.428
4091 12.391 20.2843 12.5345C20.1406 12.6782 19.9625 12.75 19.75 12.75H4.25ZM10.25 16.625C10.0375 16.625 9.85942 16.5531 9.71575 16.4093C9.57192 16.2654 9.5 16.0872 9.5 15.8748C9.5 15.6621 9.57192 15.484 9.71575 15.3405C9.85942 15.1968 10.0375 15.125 10.25 15.125H19.75C19.9625 15.125 20.1406 15.1969 20.2843 15.3408C20.4281 15.4846 20.5 15.6628 20.5 15.8753C20.5 16.0879 20.4281 16.266 20.2843 16.4095C20.1406 16.5532 19.9625 16.625 19.75 16.625H10.25ZM4.25 20.5C4.0375 20.5 3.85942 20.4281 3.71575 20.2843C3.57192 20.1404 3.5 19.9622 3.5 19.7498C3.5 19.5371 3.57192 19.359 3.71575 19.2155C3.85942 19.0718 4.0375 19 4.25 19H19.75C19.9625 19 20.1406 19.0719 20.2843 19.2158C20.4281 19.3596 20.5 19.5378 20.5 19.7502C20.5 19.9629 20.4281 20.141 20.2843 20.2845C20.1406 20.4282 19.9625 20.5 19.75 20.5H4.25Z"
410    />
411  </svg>
412`,rCe=`
413  <svg
414    xmlns="http://www.w3.org/2000/svg"
415    width="24"
416    height="24"
417    viewBox="0 0 24 24"
418  >
419    <path
420      d="M8.85758 18.625C8.4358 18.625 8.07715 18.4772 7.78163 18.1817C7.48613 17.8862 7.33838 17.5275 7.33838 17.1058V6.8942C7.33838 6.47242 7.48613 6.11377 7.78163 5.81825C8.07715 5.52275 8.4358 5.375 8.85758 5.375H12.1999C13.2191 5.375 14.1406 5.69231 14.9643 6.32693C15.788 6.96154 16.1999 7.81603 16.1999 8.89038C16.1999 9.63779 16.0194 10.2471 15.6585 10.7183C15.2976 11.1894 14.9088 11.5314 14.4922 11.7442C15.005 11.9211 15.4947 12.2708 15.9614 12.7933C16.428 13.3157 16.6614 14.0192 16.6614 14.9038C16.6614 16.182 16.1902 17.1217 15.2479 17.723C14.3056 18.3243 13.3563 18.625 12.3999 18.625H8.85758ZM9.4883 16.6327H12.3191C13.1063 16.6327 13.6627 16.4141 13.9884 15.9769C14.314 15.5397 14.4768 15.1205 14.4768 14.7192C14.4768 14.3179 14.314 13.8987 13.9884 13.4615C13.6627 13.0243 13.0909 12.8057 12.273 12.8057H9.4883V16.6327ZM9.4883 10.875H12.0826C12.6903 10.875 13.172 10.7013 13.5278 10.3539C13.8836 10.0064 14.0615 9.59037 14.0615 9.10575C14.0615 8.59035 13.8733 8.16918 13.497 7.84225C13.1207 7.51533 12.6595 7.35188 12.1133 7.35188H9.4883V10.875Z"
421    />
422  </svg>
423`,nCe=`
424  <svg
425    xmlns="http://www.w3.org/2000/svg"
426    width="24"
427    height="24"
428    viewBox="0 0 24 24"
429  >
430    <g clip-path="url(#clip0_952_6527)">
431      <circle cx="12" cy="12" r="3" />
432    </g>
433    <defs>
434      <clipPath id="clip0_952_6527">
435        <rect width="24" height="24" />
436      </clipPath>
437    </defs>
438  </svg>
439`,iCe=`
440  <svg
441    xmlns="http://www.w3.org/2000/svg"
442    width="24"
443    height="24"
444    viewBox="0 0 24 24"
445  >
446    <g clip-path="url(#clip0_977_8070)">
447      <path
448        d="M4 10.5C3.17 10.5 2.5 11.17 2.5 12C2.5 12.83 3.17 13.5 4 13.5C4.83 13.5 5.5 12.83 5.5 12C5.5 11.17 4.83 10.5 4 10.5ZM4 4.5C3.17 4.5 2.5 5.17 2.5 6C2.5 6.83 3.17 7.5 4 7.5C4.83 7.5 5.5 6.83 5.5 6C5.5 5.17 4.83 4.5 4 4.5ZM4 16.5C3.17 16.5 2.5 17.18 2.5 18C2.5 18.82 3.18 19.5 4 19.5C4.82 19.5 5.5 18.82 5.5 18C5.5 17.18 4.83 16.5 4 16.5ZM8 19H20C20.55 19 21 18.55 21 18C21 17.45 20.55 17 20 17H8C7.45 17 7 17.45 7 18C7 18.55 7.45 19 8 19ZM8 13H20C20.55 13 21 12.55 21 12C21 11.45 20.55 11 20 11H8C7.45 11 7 11.45 7 12C7 12.55 7.45 13 8 13ZM7 6C7 6.55 7.45 7 8 7H20C20.55 7 21 6.55 21 6C21 5.45 20.55 5 20 5H8C7.45 5 7 5.45 7 6Z"
449      />
450    </g>
451    <defs>
452      <clipPath id="clip0_977_8070">
453        <rect width="24" height="24" />
454      </clipPath>
455    </defs>
456  </svg>
457`,sCe=`
458  <svg
459    xmlns="http://www.w3.org/2000/svg"
460    width="32"
461    height="32"
462    viewBox="0 0 24 24"
463  >
464    <path
465      fill="currentColor"
466      d="M9 22a1 1 0 0 1-1-1v-3H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-6.1l-3.7 3.71c-.2.19-.45.29-.7.29zm1-6v3.08L13.08 16H20V4H4v12z"
467    />
468  </svg>
469`,oCe=`
470  <svg
471    xmlns="http://www.w3.org/2000/svg"
472    width="24"
473    height="24"
474    viewBox="0 0 24 24"
475  >
476    <g clip-path="url(#clip0_1803_1151)">
477      <path
478        d="M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM10.71 16.29C10.32 16.68 9.69 16.68 9.3 16.29L5.71 12.7C5.32 12.31 5.32 11.68 5.71 11.29C6.1 10.9 6.73 10.9 7.12 11.29L10 14.17L16.88 7.29C17.27 6.9 17.9 6.9 18.29 7.29C18.68 7.68 18.68 8.31 18.29 8.7L10.71 16.29Z"
479      />
480    </g>
481    <defs>
482      <clipPath id="clip0_1803_1151">
483        <rect width="24" height="24" />
484      </clipPath>
485    </defs>
486  </svg>
487`,aCe=`
488  <svg
489    xmlns="http://www.w3.org/2000/svg"
490    width="24"
491    height="24"
492    viewBox="0 0 24 24"
493  >
494    <g clip-path="url(#clip0_1803_535)">
495      <path
496        d="M18 19H6C5.45 19 5 18.55 5 18V6C5 5.45 5.45 5 6 5H18C18.55 5 19 5.45 19 6V18C19 18.55 18.55 19 18 19ZM19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3Z"
497      />
498    </g>
499    <defs>
500      <clipPath id="clip0_1803_535">
501        <rect width="24" height="24" />
502      </clipPath>
503    </defs>
504  </svg>
505`,JW=`
506  <svg
507    xmlns="http://www.w3.org/2000/svg"
508    fill="none"
509    viewBox="0 0 24 24"
510    stroke-width="1.5"
511    stroke="currentColor"
512    class="w-6 h-6"
513  >
514    <path
515      stroke-linecap="round"
516      stroke-linejoin="round"
517      d="M19.5 8.25l-7.5 7.5-7.5-7.5"
518    />
519  </svg>
520`,ZW=`
521  <svg
522    xmlns="http://www.w3.org/2000/svg"
523    width="24"
524    height="24"
525    viewBox="0 0 24 24"
526  >
527    <g clip-path="url(#clip0_1098_15553)">
528      <path
529        d="M18.3007 5.70973C17.9107 5.31973 17.2807 5.31973 16.8907 5.70973L12.0007 10.5897L7.1107 5.69973C6.7207 5.30973 6.0907 5.30973 5.7007 5.69973C5.3107 6.08973 5.3107 6.71973 5.7007 7.10973L10.5907 11.9997L5.7007 16.8897C5.3107 17.2797 5.3107 17.9097 5.7007 18.2997C6.0907 18.6897 6.7207 18.6897 7.1107 18.2997L12.0007 13.4097L16.8907 18.2997C17.2807 18.6897 17.9107 18.6897 18.3007 18.2997C18.6907 17.9097 18.6907 17.2797 18.3007 16.8897L13.4107 11.9997L18.3007 7.10973C18.6807 6.72973 18.6807 6.08973 18.3007 5.70973Z"
530      />
531    </g>
532    <defs>
533      <clipPath id="clip0_1098_15553">
534        <rect width="24" height="24" />
535      </clipPath>
536    </defs>
537  </svg>
538`,QW=`
539  <svg
540    xmlns="http://www.w3.org/2000/svg"
541    width="24"
542    height="24"
543    viewBox="0 0 24 24"
544  >
545    <g clip-path="url(#clip0_977_8081)">
546      <path
547        d="M9.4 16.6L4.8 12L9.4 7.4L8 6L2 12L8 18L9.4 16.6ZM14.6 16.6L19.2 12L14.6 7.4L16 6L22 12L16 18L14.6 16.6Z"
548      />
549    </g>
550    <defs>
551      <clipPath id="clip0_977_8081">
552        <rect width="24" height="24" />
553      </clipPath>
554    </defs>
555  </svg>
556`,gT=`
557  <svg
558    xmlns="http://www.w3.org/2000/svg"
559    width="24"
560    height="24"
561    viewBox="0 0 24 24"
562    fill="none"
563  >
564    <g clip-path="url(#clip0_1013_1606)">
565      <path
566        d="M9.00012 16.1998L5.50012 12.6998C5.11012 12.3098 4.49012 12.3098 4.10012 12.6998C3.71012 13.0898 3.71012 13.7098 4.10012 14.0998L8.29012 18.2898C8.68012 18.6798 9.31012 18.6798 9.70012 18.2898L20.3001 7.69982C20.6901 7.30982 20.6901 6.68982 20.3001 6.29982C19.9101 5.90982 19.2901 5.90982 18.9001 6.29982L9.00012 16.1998Z"
567        fill="#817567"
568      />
569    </g>
570    <defs>
571      <clipPath id="clip0_1013_1606">
572        <rect width="24" height="24" />
573      </clipPath>
574    </defs>
575  </svg>
576`,ej=`
577  <svg
578    xmlns="http://www.w3.org/2000/svg"
579    height="24px"
580    viewBox="0 -960 960 960"
581    width="24px"
582    fill="none"
583  >
584    <path
585      d="M360-240q-33 0-56.5-23.5T280-320v-480q0-33 23.5-56.5T360-880h360q33 0 56.5 23.5T800-800v480q0 33-23.5 56.5T720-240H360Zm0-80h360v-480H360v480ZM200-80q-33 0-56.5-23.5T120-160v-560h80v560h440v80H200Zm160-240v-480 480Z"
586    />
587  </svg>
588`,lCe=`
589  <svg
590    xmlns="http://www.w3.org/2000/svg"
591    width="24"
592    height="24"
593    viewBox="0 0 24 24"
594  >
595    <g clip-path="url(#clip0_977_7900)">
596      <path
597        fill-rule="evenodd"
598        clip-rule="evenodd"
599        d="M19 13H5C4.45 13 4 12.55 4 12C4 11.45 4.45 11 5 11H19C19.55 11 20 11.45 20 12C20 12.55 19.55 13 19 13Z"
600      />
601    </g>
602    <defs>
603      <clipPath id="clip0_977_7900">
604        <rect width="24" height="24" />
605      </clipPath>
606    </defs>
607  </svg>
608`,fI=`
609  <svg
610    xmlns="http://www.w3.org/2000/svg"
611    width="16"
612    height="16"
613    viewBox="0 0 16 16"
614  >
615    <path
616      d="M3.5 9.83366C3.35833 9.83366 3.23961 9.78571 3.14383 9.68983C3.04794 9.59394 3 9.47516 3 9.33349C3 9.19171 3.04794 9.07299 3.14383 8.97733C3.23961 8.88155 3.35833 8.83366 3.5 8.83366H12.5C12.6417 8.83366 12.7604 8.8816 12.8562 8.97749C12.9521 9.07338 13 9.19216 13 9.33383C13 9.4756 12.9521 9.59433 12.8562 9.68999C12.7604 9.78577 12.6417 9.83366 12.5 9.83366H3.5ZM3.5 7.16699C3.35833 7.16699 3.23961 7.11905 3.14383 7.02316C3.04794 6.92727 3 6.80849 3 6.66683C3 6.5250
6165 3.04794 6.40633 3.14383 6.31066C3.23961 6.21488 3.35833 6.16699 3.5 6.16699H12.5C12.6417 6.16699 12.7604 6.21494 12.8562 6.31083C12.9521 6.40671 13 6.52549 13 6.66716C13 6.80894 12.9521 6.92766 12.8562 7.02333C12.7604 7.1191 12.6417 7.16699 12.5 7.16699H3.5Z"
617    />
618  </svg>
619`,yT=`
620  <svg
621    xmlns="http://www.w3.org/2000/svg"
622    width="24"
623    height="24"
624    viewBox="0 0 24 24"
625  >
626    <g clip-path="url(#clip0_1013_1585)">
627      <path
628        d="M14.06 9.02L14.98 9.94L5.92 19H5V18.08L14.06 9.02ZM17.66 3C17.41 3 17.15 3.1 16.96 3.29L15.13 5.12L18.88 8.87L20.71 7.04C21.1 6.65 21.1 6.02 20.71 5.63L18.37 3.29C18.17 3.09 17.92 3 17.66 3ZM14.06 6.19L3 17.25V21H6.75L17.81 9.94L14.06 6.19Z"
629      />
630    </g>
631    <defs>
632      <clipPath id="clip0_1013_1585">
633        <rect width="24" height="24" />
634      </clipPath>
635    </defs>
636  </svg>
637`,cCe=`
638  <svg
639    xmlns="http://www.w3.org/2000/svg"
640    width="24"
641    height="24"
642    viewBox="0 0 24 24"
643  >
644    <g clip-path="url(#clip0_992_5553)">
645      <path
646        d="M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM19 19H5V5H19V19ZM12 17H14V7H10V9H12V17Z"
647      />
648    </g>
649    <defs>
650      <clipPath id="clip0_992_5553">
651        <rect width="24" height="24" />
652      </clipPath>
653    </defs>
654  </svg>
655`,hCe=`
656  <svg
657    xmlns="http://www.w3.org/2000/svg"
658    width="24"
659    height="24"
660    viewBox="0 0 24 24"
661  >
662    <g clip-path="url(#clip0_992_5559)">
663      <path
664        d="M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM19 19H5V5H19V19ZM15 15H11V13H13C14.1 13 15 12.11 15 11V9C15 7.89 14.1 7 13 7H9V9H13V11H11C9.9 11 9 11.89 9 13V17H15V15Z"
665      />
666    </g>
667    <defs>
668      <clipPath id="clip0_992_5559">
669        <rect width="24" height="24" />
670      </clipPath>
671    </defs>
672  </svg>
673`,uCe=`
674  <svg
675    xmlns="http://www.w3.org/2000/svg"
676    width="24"
677    height="24"
678    viewBox="0 0 24 24"
679  >
680    <g clip-path="url(#clip0_992_5565)">
681      <path
682        d="M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM19 19H5V5H19V19ZM15 15V13.5C15 12.67 14.33 12 13.5 12C14.33 12 15 11.33 15 10.5V9C15 7.89 14.1 7 13 7H9V9H13V11H11V13H13V15H9V17H13C14.1 17 15 16.11 15 15Z"
683      />
684    </g>
685    <defs>
686      <clipPath id="clip0_992_5565">
687        <rect width="24" height="24" />
688      </clipPath>
689    </defs>
690  </svg>
691`,dCe=`
692  <svg
693    xmlns="http://www.w3.org/2000/svg"
694    width="24"
695    height="24"
696    viewBox="0 0 24 24"
697  >
698    <g clip-path="url(#clip0_977_7757)">
699      <path
700        d="M19.04 3H5.04004C3.94004 3 3.04004 3.9 3.04004 5V19C3.04004 20.1 3.94004 21 5.04004 21H19.04C20.14 21 21.04 20.1 21.04 19V5C21.04 3.9 20.14 3 19.04 3ZM19.04 19H5.04004V5H19.04V19ZM13.04 17H15.04V7H13.04V11H11.04V7H9.04004V13H13.04V17Z"
701      />
702    </g>
703    <defs>
704      <clipPath id="clip0_977_7757">
705        <rect width="24" height="24" />
706      </clipPath>
707    </defs>
708  </svg>
709`,fCe=`
710  <svg
711    xmlns="http://www.w3.org/2000/svg"
712    width="24"
713    height="24"
714    viewBox="0 0 24 24"
715  >
716    <g clip-path="url(#clip0_977_7760)">
717      <path
718        d="M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM19 19H5V5H19V19ZM15 15V13C15 11.89 14.1 11 13 11H11V9H15V7H9V13H13V15H9V17H13C14.1 17 15 16.11 15 15Z"
719      />
720    </g>
721    <defs>
722      <clipPath id="clip0_977_7760">
723        <rect width="24" height="24" />
724      </clipPath>
725    </defs>
726  </svg>
727`,pCe=`
728  <svg
729    xmlns="http://www.w3.org/2000/svg"
730    width="24"
731    height="24"
732    viewBox="0 0 24 24"
733  >
734    <g clip-path="url(#clip0_977_7763)">
735      <path
736        d="M11 17H13C14.1 17 15 16.11 15 15V13C15 11.89 14.1 11 13 11H11V9H15V7H11C9.9 7 9 7.89 9 9V15C9 16.11 9.9 17 11 17ZM11 13H13V15H11V13ZM19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM19 19H5V5H19V19Z"
737      />
738    </g>
739    <defs>
740      <clipPath id="clip0_977_7763">
741        <rect width="24" height="24" />
742      </clipPath>
743    </defs>
744  </svg>
745`,ES=`
746  <svg
747    xmlns="http://www.w3.org/2000/svg"
748    width="24"
749    height="24"
750    viewBox="0 0 24 24"
751  >
752    <g clip-path="url(#clip0_977_8075)">
753      <path
754        d="M19 5V19H5V5H19ZM19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM14.14 11.86L11.14 15.73L9 13.14L6 17H18L14.14 11.86Z"
755      />
756    </g>
757    <defs>
758      <clipPath id="clip0_977_8075">
759        <rect width="24" height="24" />
760      </clipPath>
761    </defs>
762  </svg>
763`,mCe=`
764  <svg
765    xmlns="http://www.w3.org/2000/svg"
766    width="24"
767    height="24"
768    viewBox="0 0 24 24"
769  >
770    <path
771      d="M6.29811 18.625C6.04505 18.625 5.83115 18.5375 5.65641 18.3626C5.48166 18.1877 5.39429 17.9736 5.39429 17.7203C5.39429 17.467 5.48166 17.2532 5.65641 17.0788C5.83115 16.9045 6.04505 16.8173 6.29811 16.8173H9.21159L12.452 7.18265H9.53851C9.28545 7.18265 9.07155 7.0952 8.89681 6.9203C8.72206 6.7454 8.63469 6.5313 8.63469 6.278C8.63469 6.02472 8.72206 5.81089 8.89681 5.63652C9.07155 5.46217 9.28545 5.375 9.53851 5.375H16.8847C17.1377 5.375 17.3516 5.46245 17.5264 5.63735C17.7011 5.81225 17.7885 6.02634 17.7885 6.27962C17.7885 6.53293 17.7011 6.74676 17.5264 6.92113C17.3516 7.09548 17.1377 7.18265 16.8847 7.18265H14.2789L11.0385 16.8173H13.6443C13.8973 16.8173 14.1112 16.9048 14.286 17.0797C14.4607 17.2546 14.5481 17.4687 14.5481 17.722C14.5481 17.9752 14.4607 18.1891 14.286 18.3634C14.1112 18.5378 13.8973 18.625 13.6443 18.625H6.29811Z"
772    />
773  </svg>
774`,gCe=`
775  <svg
776    xmlns="http://www.w3.org/2000/svg"
777    width="24"
778    height="24"
779    viewBox="0 0 24 24"
780  >
781    <path
782      d="M17.0385 19.5003V16.5388H14.0769V15.0388H17.0385V12.0773H18.5384V15.0388H21.5V16.5388H18.5384V19.5003H17.0385ZM10.8077 16.5388H7.03845C5.78282 16.5388 4.7125 16.0963 3.8275 15.2114C2.9425 14.3266 2.5 13.2564 2.5 12.0009C2.5 10.7454 2.9425 9.67504 3.8275 8.78979C4.7125 7.90454 5.78282 7.46191 7.03845 7.46191H10.8077V8.96186H7.03845C6.1987 8.96186 5.48235 9.25834 4.8894 9.85129C4.29645 10.4442 3.99998 11.1606 3.99998 12.0003C3.99998 12.8401 4.29645 13.5564 4.8894 14.1494C5.48235 14.7423 6.1987 15.0388 7.03845 15.0388H10.8077V16.5388ZM8.25 12.7503V11.2504H15.75V12.7503H8.25ZM21.5 12.0003H20C20 11.1606 19.7035 10.4442 19.1106 9.85129C18.5176 9.25834 17.8013 8.96186 16.9615 8.96186H13.1923V7.46191H16.9615C18.2171 7.46191 19.2875 7.90441 20.1725 8.78939C21.0575 9.67439 21.5 10.7447 21.5 12.0003Z"
783    />
784  </svg>
785`,yCe=`
786  <svg
787    xmlns="http://www.w3.org/2000/svg"
788    width="24"
789    height="24"
790    viewBox="0 0 24 24"
791  >
792    <g clip-path="url(#clip0_971_7680)">
793      <path
794        d="M11 18C11 19.1 10.1 20 9 20C7.9 20 7 19.1 7 18C7 16.9 7.9 16 9 16C10.1 16 11 16.9 11 18ZM9 10C7.9 10 7 10.9 7 12C7 13.1 7.9 14 9 14C10.1 14 11 13.1 11 12C11 10.9 10.1 10 9 10ZM9 4C7.9 4 7 4.9 7 6C7 7.1 7.9 8 9 8C10.1 8 11 7.1 11 6C11 4.9 10.1 4 9 4ZM15 8C16.1 8 17 7.1 17 6C17 4.9 16.1 4 15 4C13.9 4 13 4.9 13 6C13 7.1 13.9 8 15 8ZM15 10C13.9 10 13 10.9 13 12C13 13.1 13.9 14 15 14C16.1 14 17 13.1 17 12C17 10.9 16.1 10 15 10ZM15 16C13.9 16 13 16.9 13 18C13 19.1 13.9 20 15 20C16.1 20 17 19.1 17 18C17 16.9 16.1 16 15 16Z"
795      />
796    </g>
797    <defs>
798      <clipPath id="clip0_971_7680">
799        <rect width="24" height="24" />
800      </clipPath>
801    </defs>
802  </svg>
803`,bCe=`
804  <svg
805    xmlns="http://www.w3.org/2000/svg"
806    width="24"
807    height="24"
808    viewBox="0 0 24 24"
809  >
810    <g clip-path="url(#clip0_977_8067)">
811      <path
812        d="M8 7H20C20.55 7 21 6.55 21 6C21 5.45 20.55 5 20 5H8C7.45 5 7 5.45 7 6C7 6.55 7.45 7 8 7ZM20 17H8C7.45 17 7 17.45 7 18C7 18.55 7.45 19 8 19H20C20.55 19 21 18.55 21 18C21 17.45 20.55 17 20 17ZM20 11H8C7.45 11 7 11.45 7 12C7 12.55 7.45 13 8 13H20C20.55 13 21 12.55 21 12C21 11.45 20.55 11 20 11ZM4.5 16H2.5C2.22 16 2 16.22 2 16.5C2 16.78 2.22 17 2.5 17H4V17.5H3.5C3.22 17.5 3 17.72 3 18C3 18.28 3.22 18.5 3.5 18.5H4V19H2.5C2.22 19 2 19.22 2 19.5C2 19.78 2.22 20 2.5 20H4.5C4.78 20 5 19.78 5 19.5V16.5C5 16.22 4.78 16 4.5 16ZM2.5 5H3V7.5C3 7.78 3.22 8 3.5 8C3.78 8 4 7.78 4 7.5V4.5C4 4.22 3.78 4 3.5 4H2.5C2.22 4 2 4.22 2 4.5C2 4.78 2.22 5 2.5 5ZM4.5 10H2.5C2.22 10 2 10.22 2 10.5C2 10.78 2.22 11 2.5 11H3.8L2.12 12.96C2.04 13.05 2 13.17 2 13.28V13.5C2 13.78 2.22 14 2.5 14H4.5C4.78 14 5 13.78 5 13.5C5 13.22 4.78 13 4.5 13H3.2L4.88 11.04C4.96 10.95 5 10.83 5 10.72V10.5C5 10.22 4.78 10 4.5 10Z"
813      />
814    </g>
815    <defs>
816      <clipPath id="clip0_977_8067">
817        <rect width="24" height="24" />
818      </clipPath>
819    </defs>
820  </svg>
821`,OS=`
822  <svg
823    xmlns="http://www.w3.org/2000/svg"
824    width="24"
825    height="24"
826    viewBox="0 0 24 24"
827  >
828    <g clip-path="url(#clip0_971_7676)">
829      <path
830        d="M18 13H13V18C13 18.55 12.55 19 12 19C11.45 19 11 18.55 11 18V13H6C5.45 13 5 12.55 5 12C5 11.45 5.45 11 6 11H11V6C11 5.45 11.45 5 12 5C12.55 5 13 5.45 13 6V11H18C18.55 11 19 11.45 19 12C19 12.55 18.55 13 18 13Z"
831      />
832    </g>
833    <defs>
834      <clipPath id="clip0_971_7676">
835        <rect width="24" height="24" />
836      </clipPath>
837    </defs>
838  </svg>
839`,xCe=`
840  <svg
841    xmlns="http://www.w3.org/2000/svg"
842    width="24"
843    height="24"
844    viewBox="0 0 24 24"
845  >
846    <g clip-path="url(#clip0_977_7897)">
847      <path
848        d="M7.17 17C7.68 17 8.15 16.71 8.37 16.26L9.79 13.42C9.93 13.14 10 12.84 10 12.53V8C10 7.45 9.55 7 9 7H5C4.45 7 4 7.45 4 8V12C4 12.55 4.45 13 5 13H7L5.97 15.06C5.52 15.95 6.17 17 7.17 17ZM17.17 17C17.68 17 18.15 16.71 18.37 16.26L19.79 13.42C19.93 13.14 20 12.84 20 12.53V8C20 7.45 19.55 7 19 7H15C14.45 7 14 7.45 14 8V12C14 12.55 14.45 13 15 13H17L15.97 15.06C15.52 15.95 16.17 17 17.17 17Z"
849      />
850    </g>
851    <defs>
852      <clipPath id="clip0_977_7897">
853        <rect width="24" height="24" />
854      </clipPath>
855    </defs>
856  </svg>
857`,LS=`
858  <svg
859    xmlns="http://www.w3.org/2000/svg"
860    width="24"
861    height="24"
862    viewBox="0 0 24 24"
863  >
864    <path
865      d="M7.30775 20.4997C6.81058 20.4997 6.385 20.3227 6.031 19.9687C5.677 19.6147 5.5 19.1892 5.5 18.692V5.99973H5.25C5.0375 5.99973 4.85942 5.92782 4.71575 5.78398C4.57192 5.64015 4.5 5.46198 4.5 5.24948C4.5 5.03682 4.57192 4.85873 4.71575 4.71523C4.85942 4.57157 5.0375 4.49973 5.25 4.49973H9C9 4.2549 9.08625 4.04624 9.25875 3.87374C9.43108 3.7014 9.63967 3.61523 9.8845 3.61523H14.1155C14.3603 3.61523 14.5689 3.7014 14.7413 3.87374C14.9138 4.04624 15 4.2549 15 4.49973H18.75C18.9625 4.49973 19.1406 4.57165 19.2843 4.71548C19.4281 4.85932 19.5 5.03748 19.5 5.24998C19.5 5.46265 19.4281 5.64073 19.2843 5.78423C19.1406 5.9279 18.9625 5.99973 18.75 5.99973H18.5V18.692C18.5 19.1892 
86518.323 19.6147 17.969 19.9687C17.615 20.3227 17.1894 20.4997 16.6923 20.4997H7.30775ZM17 5.99973H7V18.692C7 18.7818 7.02883 18.8556 7.0865 18.9132C7.14417 18.9709 7.21792 18.9997 7.30775 18.9997H16.6923C16.7821 18.9997 16.8558 18.9709 16.9135 18.9132C16.9712 18.8556 17 18.7818 17 18.692V5.99973ZM10.1543 16.9997C10.3668 16.9997 10.5448 16.9279 10.6885 16.7842C10.832 16.6404 10.9037 16.4622 10.9037 16.2497V8.74973C10.9037 8.53723 10.8318 8.35907 10.688 8.21523C10.5443 8.07157 10.3662 7.99973 10.1535 7.99973C9.941 7.99973 9.76292 8.07157 9.61925 8.21523C9.47575 8.35907 9.404 8.53723 9.404 8.74973V16.2497C9.404 16.4622 9.47583 16.6404 9.6195 16.7842C9.76333 16.9279 9.94158 16.9997 10.1543 16.9997ZM13.8465 16.9997C14.059 16.9997 14.2371 16.9279 14.3807 16.7842C14.5243 16.6404 14.596 16.4622 14.596 16.2497V8.74973C14.596 8.53723 14.5242 8.35907 14.3805 8.21523C14.2367 8.07157 14.0584 7.99973 13.8458 7.99973C13.6333 7.99973 13.4552 8.07157 13.3115 8.21523C13.168 8.35907 13.0962 8.53723 13.0962 8.74973V16.2497C13.0962 16.4622 13.1682 16.6404 13.312 16.7842C13.4557 16.9279 13.6338 16.9997 13.8465 16.9997Z"
866    />
867  </svg>
868`,tj=`
869  <svg
870    xmlns="http://www.w3.org/2000/svg"
871    fill="none"
872    viewBox="0 0 24 24"
873    stroke-width="1.5"
874    stroke="currentColor"
875    class="w-6 h-6"
876  >
877    <path
878      stroke-linecap="round"
879      stroke-linejoin="round"
880      d="M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z"
881    />
882  </svg>
883`,vCe=`
884  <svg
885    xmlns="http://www.w3.org/2000/svg"
886    width="24"
887    height="24"
888    viewBox="0 0 24 24"
889  >
890    <path
891      d="M3.25 13.7404C3.0375 13.7404 2.85938 13.6684 2.71563 13.5246C2.57188 13.3808 2.5 13.2026 2.5 12.99C2.5 12.7774 2.57188 12.5993 2.71563 12.4558C2.85938 12.3122 3.0375 12.2404 3.25 12.2404H20.75C20.9625 12.2404 21.1406 12.3123 21.2843 12.4561C21.4281 12.5999 21.5 12.7781 21.5 12.9907C21.5 13.2033 21.4281 13.3814 21.2843 13.525C21.1406 13.6686 20.9625 13.7404 20.75 13.7404H3.25ZM10.9423 10.2596V6.62495H6.5673C6.2735 6.62495 6.02377 6.52201 5.8181 6.31613C5.61245 6.11026 5.50963 5.86027 5.50963 5.56615C5.50963 5.27205 5.61245 5.02083 5.8181 4.8125C6.02377 4.60417 6.2735 4.5 6.5673 4.5H17.4423C17.7361 4.5 17.9858 4.60294 18.1915 4.80883C18.3971 5.01471 18.5 5.2647 18.5 5.5588C18.5 5.85292 18.3971 6.10413 18.1915 6.31245C17.9858 6.52078 17.7361 6.62495 17.4423 6.62495H13.0673V10.2596H10.9423ZM10.9423 15.7211H13.0673V18.4423C13.0673 18.7361 12.9643 18.9858 12.7584 19.1915C12.5526 19.3971 12.3026 19.5 12.0085 19.5C11.7144 19.5 11.4631 19.3962 11.2548 19.1887C11.0465 18.9811 10.9423 18.7291 10.9423 18.4327V15.7211Z"
892    />
893  </svg>
894`,wCe=`
895  <svg
896    xmlns="http://www.w3.org/2000/svg"
897    width="24"
898    height="24"
899    viewBox="0 0 24 24"
900  >
901    <g clip-path="url(#clip0_977_8078)">
902      <path
903        d="M20 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H20C21.1 21 22 20.1 22 19V5C22 3.9 21.1 3 20 3ZM20 5V8H5V5H20ZM15 19H10V10H15V19ZM5 10H8V19H5V10ZM17 19V10H20V19H17Z"
904      />
905    </g>
906    <defs>
907      <clipPath id="clip0_977_8078">
908        <rect width="24" height="24" />
909      </clipPath>
910    </defs>
911  </svg>
912`,kCe=`
913  <svg
914    xmlns="http://www.w3.org/2000/svg"
915    width="24"
916    height="24"
917    viewBox="0 0 24 24"
918  >
919    <g clip-path="url(#clip0_992_5547)">
920      <path
921        d="M5 5.5C5 6.33 5.67 7 6.5 7H10.5V17.5C10.5 18.33 11.17 19 12 19C12.83 19 13.5 18.33 13.5 17.5V7H17.5C18.33 7 19 6.33 19 5.5C19 4.67 18.33 4 17.5 4H6.5C5.67 4 5 4.67 5 5.5Z"
922      />
923    </g>
924    <defs>
925      <clipPath id="clip0_992_5547">
926        <rect width="24" height="24" />
927      </clipPath>
928    </defs>
929  </svg>
930`,CCe=`
931  <svg
932    xmlns="http://www.w3.org/2000/svg"
933    width="24"
934    height="24"
935    viewBox="0 0 24 24"
936  >
937    <path
938      d="M5.66936 16.3389L9.39244 12.6158C9.54115 12.4671 9.71679 12.3937 9.91936 12.3957C10.1219 12.3976 10.2975 12.4761 10.4463 12.6312C10.5847 12.7823 10.654 12.9585 10.654 13.1599C10.654 13.3613 10.5847 13.5363 10.4463 13.6851L6.32704 17.8197C6.14627 18.0004 5.93538 18.0908 5.69436 18.0908C5.45333 18.0908 5.24243 18.0004 5.06166 17.8197L3.01744 15.7754C2.87899 15.637 2.81136 15.4629 2.81456 15.2533C2.81776 15.0437 2.88859 14.8697 3.02706 14.7312C3.16551 14.5928 3.34008 14.5235 3.55076 14.5235C3.76144 14.5235 3.93494 14.5928 4.07126 14.7312L5.66936 16.3389ZM5.66936 8.72359L9.39244 5.
93800049C9.54115 4.85177 9.71679 4.77838 9.91936 4.78031C10.1219 4.78223 10.2975 4.86075 10.4463 5.01586C10.5847 5.16691 10.654 5.34314 10.654 5.54454C10.654 5.74592 10.5847 5.92097 10.4463 6.06969L6.32704 10.2043C6.14627 10.3851 5.93538 10.4755 5.69436 10.4755C5.45333 10.4755 5.24243 10.3851 5.06166 10.2043L3.01744 8.16009C2.87899 8.02162 2.81136 7.84759 2.81456 7.63799C2.81776 7.42837 2.88859 7.25433 3.02706 7.11586C3.16551 6.97741 3.34008 6.90819 3.55076 6.90819C3.76144 6.90819 3.93494 6.97741 4.07126 7.11586L5.66936 8.72359ZM13.7597 16.5581C13.5472 16.5581 13.3691 16.4862 13.2253 16.3424C13.0816 16.1986 13.0097 16.0204 13.0097 15.8078C13.0097 15.5952 13.0816 15.4171 13.2253 15.2735C13.3691 15.13 13.5472 15.0582 13.7597 15.0582H20.7597C20.9722 15.0582 21.1503 15.1301 21.2941 15.2739C21.4378 15.4177 21.5097 15.5959 21.5097 15.8085C21.5097 16.0211 21.4378 16.1992 21.2941 16.3427C21.1503 16.4863 20.9722 16.5581 20.7597 16.5581H13.7597ZM13.7597 8.94276C13.5472 8.94276 13.3691 8.87085 13.2253 8.72704C13.0816 8.58324 13.0097 8.40504 13.0097 8.19244C13.0097 7.97985 13.0816 7.80177 13.2253 7.65819C13.3691 7.5146 13.5472 7.44281 13.7597 7.44281H20.7597C20.9722 7.44281 21.1503 7.51471 21.2941 7.65851C21.4378 7.80233 21.5097 7.98053 21.5097 8.19311C21.5097 8.40571 21.4378 8.5838 21.2941 8.72739C21.1503 8.87097 20.9722 8.94276 20.7597 8.94276H13.7597Z"
939    />
940  </svg>
941`,rj=`
942  <svg
943    xmlns="http://www.w3.org/2000/svg"
944    width="32"
945    height="32"
946    viewBox="0 0 24 24"
947  >
948    <path
949      fill="currentColor"
950      d="M7 19v-.808L13.096 12L7 5.808V5h10v1.25H9.102L14.727 12l-5.625 5.77H17V19z"
951    />
952  </svg>
953`,nj=`
954  <svg
955    xmlns="http://www.w3.org/2000/svg"
956    height="24px"
957    viewBox="0 -960 960 960"
958    width="24px"
959  >
960    <path
961      d="m644-428-58-58q9-47-27-88t-93-32l-58-58q17-8 34.5-12t37.5-4q75 0 127.5 52.5T660-500q0 20-4 37.5T644-428Zm128 126-58-56q38-29 67.5-63.5T832-500q-50-101-143.5-160.5T480-720q-29 0-57 4t-55 12l-62-62q41-17 84-25.5t90-8.5q151 0 269 83.5T920-500q-23 59-60.5 109.5T772-302Zm20 246L624-222q-35 11-70.5 16.5T480-200q-151 0-269-83.5T40-500q21-53 53-98.5t73-81.5L56-792l56-56 736 736-56 56ZM222-624q-29 26-53 57t-41 67q50 101 143.5 160.5T480-280q20 0 39-2.5t39-5.5l-36-38q-11 3-21 4.5t-21 1.5q-75 0-127.5-52.5T300-500q0-11 1.5-21t4.5-21l-84-82Zm319 93Zm-151 75Z"
962    />
963  </svg>
964`,SCe={[Vt.CodeMirror]:{theme:Poe,languages:Toe,expandIcon:JW,searchIcon:tj,clearSearchIcon:ZW,searchPlaceholder:"Search language",noResultText:"No result",previewToggleIcon:t=>t?yT:nj}},TCe=Rt([],"FeaturesCtx"),_Ce=Rt({},"CrepeCtx");function MCe(t){return t.get("CrepeCtx")}function o4(t){return t.use("FeaturesCtx")}function pa(t){return e=>{o4(e).update(r=>r.includes(t)?r:[...r,t])}}function ij(t){return t.$from.parent.type.name==="code_block"}function sj(t){var e;const r=(e=t.$from.node(t.$from.depth-1))==null?void 0:e.type;return(r==null?void 0:r.name)==="list_item"}var oj=t=>{throw TypeError(t)},aj=(t,e,r)=>e.has(t)||oj("Cannot "+r),K0=(t,e,r)=>(aj(t,e,"read from private field"),r?r.call(t):e.get(t)),pI=(t,e,r)=>e.has(t)?oj("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),ACe=(t,e,r,n)=>(aj(t,e,"write to private field"),e.set(t,r),r),od,yb;class lj{constructor(){pI(this,od,[]),this.clear=()=>(ACe(this,od,[]),this),pI(this,yb,e=>{const r={group:e,addItem:(n,i)=>{const s={...i,key:n};return e.items.push(s),r},clear:()=>(e.items=[],r)};return r}),this.addGroup=(e,r)=>{const i={key:e,label:r,items:[]};return K0(this,od).push(i),K0(this,yb).call(this,i)},this.getGroup=e=>{const r=K0(this,od).find(n=>n.key===e);if(!r)throw new Error(`Group with key ${e} not found`);return K0(this,yb).call(this,r)},this.build=()=>K0(this,od)}}od=new WeakMap;yb=new WeakMap;function ECe(t,e,r){var n,i,s,o,a,l,c,h,u,d,f,p,m,g,y,b,x,S,k,w,_,L,B,E,D,N,K,z,$,H,j,q,ne,O,fe,Te,I,tt,qe,Oe,Ze,vt,Ct,wt,zt,gr,R,W,ee,pe,le,he,ke,Ce,ve,ge,Ye,_e,Fe,Y,oe,Le,Be,ft,Pt,rr,Ut,wr,sn,Nt,kr,pn,wo,Hc,ry,kl,ny,iy,Pr,ga,sy,g0,Nu,y0,b0,oy,zi,ya,x0,v0,Fu,w0,ds,k0,C0,S0,T0,ay,et,G,xe,Ue,nr,Xr,Ir,mn,fs,Cl,$u,Jr,_0,M0,w_,k_,C_,S_,T_,__,M_;const zu=r&&o4(r).get(),_J=zu==null?void 0:zu.includes(Vt.Latex),MJ=zu==null?void 0:zu.includes(Vt.ImageBlock),AJ=zu==null?void 0:zu.includes(Vt.Table),A0=new lj;if((e==null?void 0:e.textGroup)!==null){const Kt=A0.addGroup("text",(i=(n=e==null?void 0:e.textGroup)==null?void 0:n.label)!=null?i:"Text");((s=e==null?void 0:e.textGroup)==null?void 0:s.text)!==null&&Kt.addItem("text",{label:(l=(a=(o=e==null?void 0:e.textGroup)==null?void 0:o.text)==null?void 0:a.label)!=null?l:"Text",icon:(u=(h=(c=e==null?void 0:e.textGroup)==null?void 0:c.text)==null?void 0:h.icon)!=null?u:kCe,onRun:nt=>{const at=nt.get(He),Gt=la.type(nt);at.call(gn.key),at.call(Ta.key,{nodeType:Gt})}}),((d=e==null?void 0:e.textGroup)==null?void 0:d.h1)!==null&&Kt.addItem("h1",{label:(m=(p=(f=e==null?void 0:e.textGroup)==null?void 0:f.h1)==null?void 0:p.label)!=null?m:"Heading 1",icon:(b=(y=(g=e==null?void 0:e.textGroup)==null?void 0:g.h1)==null?void 0:y.icon)!=null?b:cCe,onRun:nt=>{const at=nt.get(He),Gt=Ji.type(nt);at.call(gn.key),at.call(Ta.key,{nodeType:Gt,attrs:{level:1}})}}),((x=e==null?void 0:e.textGroup)==null?void 0:x.h2)!==null&&Kt.addItem("h2",{label:(w=(k=(S=e==null?void 0:e.textGroup)==null?void 0:S.h2)==null?void 0:k.label)!=null?w:"Heading 2",icon:(B=(L=(_=e==null?void 0:e.textGroup)==null?void 0:_.h2)==null?void 0:L.icon)!=null?B:hCe,onRun:nt=>{const at=nt.get(He),Gt=Ji.type(nt);at.call(gn.key),at.call(Ta.key,{nodeType:Gt,attrs:{level:2}})}}),((E=e==null?void 0:e.textGroup)==null?void 0:E.h3)!==null&&Kt.addItem("h3",{label:(K=(N=(D=e==null?void 0:e.textGroup)==null?void 0:D.h3)==null?void 0:N.label)!=null?K:"Heading 3",icon:(H=($=(z=e==null?void 0:e.textGroup)==null?void 0:z.h3)==null?void 0:$.icon)!=null?H:uCe,onRun:nt=>{const at=nt.get(He),Gt=Ji.type(nt);at.call(gn.key),at.call(Ta.key,{nodeType:Gt,attrs:{level:3}})}}),((j=e==null?void 0:e.textGroup)==null?void 0:j.h4)!==null&&Kt.addItem("h4",{label:(O=(ne=(q=e==null?void 0:e.textGroup)==null?void 0:q.h4)==null?void 0:ne.label)!=null?O:"Heading 4",icon:(I=(Te=(fe=e==null?void 0:e.textGroup)==null?void 0:fe.h4)==null?void 0:Te.icon)!=null?I:dCe,onRun:nt=>{const at=nt.get(He),Gt=Ji.type(nt);at.call(gn.key),at.call(Ta.key,{nodeType:Gt,attrs:{level:4}})}}),((tt=e==null?void 0:e.textGroup)==null?void 0:tt.h5)!==null&&Kt.addItem("h5",{label:(Ze=(Oe=(qe=e==null?void 0:e.textGroup)==null?void 0:qe.h5)==null?void 0:Oe.label)!=null?Ze:"Heading 5",icon:(wt=(Ct=(vt=e==null?void 0:e.textGroup)==null?void 0:vt.h5)==null?void 0:Ct.icon)!=null?wt:fCe,onRun:nt=>{const at=nt.get(He),Gt=Ji.type(nt);at.call(gn.key),at.call(Ta.key,{nodeType:Gt,attrs:{level:5}})}}),((zt=e==null?void 0:e.textGroup)==null?void 0:zt.h6)!==null&&Kt.addItem("h6",{label:(W=(R=(gr
964=e==null?void 0:e.textGroup)==null?void 0:gr.h6)==null?void 0:R.label)!=null?W:"Heading 6",icon:(le=(pe=(ee=e==null?void 0:e.textGroup)==null?void 0:ee.h6)==null?void 0:pe.icon)!=null?le:pCe,onRun:nt=>{const at=nt.get(He),Gt=Ji.type(nt);at.call(gn.key),at.call(Ta.key,{nodeType:Gt,attrs:{level:6}})}}),((he=e==null?void 0:e.textGroup)==null?void 0:he.quote)!==null&&Kt.addItem("quote",{label:(ve=(Ce=(ke=e==null?void 0:e.textGroup)==null?void 0:ke.quote)==null?void 0:Ce.label)!=null?ve:"Quote",icon:(_e=(Ye=(ge=e==null?void 0:e.textGroup)==null?void 0:ge.quote)==null?void 0:Ye.icon)!=null?_e:xCe,onRun:nt=>{const at=nt.get(He),Gt=e0.type(nt);at.call(gn.key),at.call(xp.key,{nodeType:Gt})}}),((Fe=e==null?void 0:e.textGroup)==null?void 0:Fe.divider)!==null&&Kt.addItem("divider",{label:(Le=(oe=(Y=e==null?void 0:e.textGroup)==null?void 0:Y.divider)==null?void 0:oe.label)!=null?Le:"Divider",icon:(Pt=(ft=(Be=e==null?void 0:e.textGroup)==null?void 0:Be.divider)==null?void 0:ft.icon)!=null?Pt:lCe,onRun:nt=>{const at=nt.get(He),Gt=t0.type(nt);at.call(gn.key),at.call(vp.key,{nodeType:Gt})}})}if((e==null?void 0:e.listGroup)!==null){const Kt=A0.addGroup("list",(Ut=(rr=e==null?void 0:e.listGroup)==null?void 0:rr.label)!=null?Ut:"List");((wr=e==null?void 0:e.listGroup)==null?void 0:wr.bulletList)!==null&&Kt.addItem("bullet-list",{label:(kr=(Nt=(sn=e==null?void 0:e.listGroup)==null?void 0:sn.bulletList)==null?void 0:Nt.label)!=null?kr:"Bullet List",icon:(Hc=(wo=(pn=e==null?void 0:e.listGroup)==null?void 0:pn.bulletList)==null?void 0:wo.icon)!=null?Hc:iCe,onRun:nt=>{const at=nt.get(He),Gt=Eu.type(nt);at.call(gn.key),at.call(xp.key,{nodeType:Gt})}}),((ry=e==null?void 0:e.listGroup)==null?void 0:ry.orderedList)!==null&&Kt.addItem("ordered-list",{label:(iy=(ny=(kl=e==null?void 0:e.listGroup)==null?void 0:kl.orderedList)==null?void 0:ny.label)!=null?iy:"Ordered List",icon:(sy=(ga=(Pr=e==null?void 0:e.listGroup)==null?void 0:Pr.orderedList)==null?void 0:ga.icon)!=null?sy:bCe,onRun:nt=>{const at=nt.get(He),Gt=Ou.type(nt);at.call(gn.key),at.call(xp.key,{nodeType:Gt})}}),((g0=e==null?void 0:e.listGroup)==null?void 0:g0.taskList)!==null&&Kt.addItem("task-list",{label:(b0=(y0=(Nu=e==null?void 0:e.listGroup)==null?void 0:Nu.taskList)==null?void 0:y0.label)!=null?b0:"Task List",icon:(ya=(zi=(oy=e==null?void 0:e.listGroup)==null?void 0:oy.taskList)==null?void 0:zi.icon)!=null?ya:CCe,onRun:nt=>{const at=nt.get(He),Gt=yo.type(nt);at.call(gn.key),at.call(xp.key,{nodeType:Gt,attrs:{checked:!1}})}})}if((e==null?void 0:e.advancedGroup)!==null){const Kt=A0.addGroup("advanced",(v0=(x0=e==null?void 0:e.advancedGroup)==null?void 0:x0.label)!=null?v0:"Advanced");((Fu=e==null?void 0:e.advancedGroup)==null?void 0:Fu.image)!==null&&MJ&&Kt.addItem("image",{label:(k0=(ds=(w0=e==null?void 0:e.advancedGroup)==null?void 0:w0.image)==null?void 0:ds.label)!=null?k0:"Image",icon:(T0=(S0=(C0=e==null?void 0:e.advancedGroup)==null?void 0:C0.image)==null?void 0:S0.icon)!=null?T0:ES,onRun:nt=>{const at=nt.get(He),Gt=Dw.type(nt);at.call(gn.key),at.call(vp.key,{nodeType:Gt})}}),((ay=e==null?void 0:e.advancedGroup)==null?void 0:ay.codeBlock)!==null&&Kt.addItem("code",{label:(xe=(G=(et=e==null?void 0:e.advancedGroup)==null?void 0:et.codeBlock)==null?void 0:G.label)!=null?xe:"Code",icon:(Xr=(nr=(Ue=e==null?void 0:e.advancedGroup)==null?void 0:Ue.codeBlock)==null?void 0:nr.icon)!=null?Xr:QW,onRun:nt=>{const at=nt.get(He),Gt=ra.type(nt);at.call(gn.key),at.call(Ta.key,{nodeType:Gt})}}),((Ir=e==null?void 0:e.advancedGroup)==null?void 0:Ir.table)!==null&&AJ&&Kt.addItem("table",{label:(Cl=(fs=(mn=e==null?void 0:e.advancedGroup)==null?void 0:mn.table)==null?void 0:fs.label)!=null?Cl:"Table",icon:(_0=(Jr=($u=e==null?void 0:e.advancedGroup)==null?void 0:$u.table)==null?void 0:Jr.icon)!=null?_0:wCe,onRun:nt=>{const at=nt.get(He),Gt=nt.get(fr);at.call(gn.key);const{from:EJ}=Gt.state.selection;at.call(vp.key,{nodeType:a9(nt,3,3)}),at.call(Sz.key,{pos:EJ})}}),((M0=e==null?void 0:e.advancedGroup)==null?void 0:M0.math)!==null&&_J&&Kt.addItem("math",{label:(C_=(k_=(w_=e==null?void 0:e.advancedGroup)==null?void 0:w_.math)==null?void 0:k_.label)!=null?C_:"Math",icon:(__=(T_=(S_=e==null?void 0:e.advancedGroup)==null?void 0:S_.math)==null?void 0:T_.icon)!=null?__:rj,onRun:nt=>{const at=nt.get(He),Gt=ra.type(nt);at.call(gn.key),at.call(vp.key,{nodeType:Gt,attrs:{language:"LaTex"}})}})}(M_=e==null?void 0:e.buildMenu)==null||M_.call(e,A0);let E0=A0.build();t&&(E0=E0.map(Kt=>{const nt=Kt.items.filter(at=>at.label.toLowerCase().includes(t.toLowerCase()));return{...Kt,items:nt}}).filter(Kt=>Kt.items.length>0));const A_=E0.flatMap(Kt=>Kt.items);return A_.forEach((Kt,nt)=>{Object.assign(Kt,{index:nt})}),E0.reduce((Kt,nt)=>{const at=Kt+nt.items.length;return Object.assign(nt,{range:[Kt,at]}),at},0),{groups:E0,size:A_.length}}const OCe=En({props:{ctx:{type:Object,required:!0},show:{type:Object,required:!0},filter:{type:Object,required:!0},hide:{type:Function,required:!0},config:{type:Object,required:!1}},setup({ctx:t,show:e,filter:r,hide:n,config:i}){const s=We(),o=mu(()=>ECe(r.value,i,t)),a=We(0),l=We({x:-999,y:-999}),c=m=>{const{x:g,y}=m;l.value={x:g,y}};Td([o,e],()=>{const{size:m}=o.value;m===0&&e.value?n():a.value>=m&&(a.value=0)});const h=(m,g)=>{const y=a.value,b=typeof m=="function"?m(y):m;g==null||g(b),a.value=b},u=m=>{var g,y;const b=(g=s.value)==null?void 0:g.querySelector(`[data-index="${m}"]`),x=(y=s.value)==null?void 0:y.querySelector(".menu-groups");!b||!x||(x.scrollTop=b.offsetTop-x.offsetTop)},d=m=>{const g=o.value.groups.flatMap(y=>y.items).at(m);g&&t&&g.onRun(t),n()},f=m=>{const{size:g,groups:y}=o.value;if(m.key==="Escape"){m.preventDefault(),n==null||n();return}if(m.key==="ArrowDown")return m.preventDefault(),h(b=>b<g-1?b+1:b,u);if(m.key==="ArrowUp")return m.preventDefault(),h(b=>b<=0?b:b-1,u);if(m.key==="ArrowLeft")return m.preventDefault(),h(b=>{const x=y.find(k=>k.range[0]<=b&&k.range[1]>b);if(!x)return b;const S=y[y.indexOf(x)-1];return S?S.range[1]-1:b},u);if(m.key==="ArrowRight")return m.preventDefault(),h(b=>{const x=y.find(k=>k.range[0]<=b&&k.range[1]>b);if(!x)return b;const S=y[y.indexOf(x)+1];return S?S.range[0]:b},u);m.key==="Enter"&&(m.preventDefault(),d(a.value))},p=m=>g=>{const y=l.value;if(!y)return;const{x:b,y:x}=g;b===y.x&&x===y.y||h(m)};return n0(()=>{e.value?window.addEventListener("keydown",f,{capture:!0}):window.removeEventListener("keydown",f,{capture:!0})}),D1(()=>{window.removeEventListener("keydown",f,{capture:!0})}),()=>te("div",{ref:s,onPointerdown:m=>m.preventDefault()},te("nav",{class:"tab-group"},te("ul",null,o.value.groups.map(m=>te("li",{key:m.key,onPointerdown:()=>h(m.range[0],u),class:a.value>=m.range[0]&&a.value<m.range[1]?"selected":""},m.label)))),te("div",{class:"menu-groups",onPointermove:c},o.value.groups.map(m=>te("div",{key:m.key,class:"menu-group"},te("h6",null,m.label),te("ul",null,m.items.map(g=>te("li",{key:g.key,"data-index":g.index,class:a.value===g.index?"hover":"",onPointerenter:p(g.index),onPointerdown:()=>{var y,b;(b=(y=s.value)==null?void 0:y.querySelector(`[data-index="${g.index}"]`))==null||b.classList.add("active")},onPointerup:()=>{var y,b;(b=(y=s.value)==null?void 0:y.querySelector(`[data-index="${g.index}"]`))==null||b.classList.remove("active"),d(g.index)}},te(Ef,{icon:g.icon}),te("span",null,g.label))))))))}});var cj=t=>{throw TypeError(t)},hj=(t,e,r)=>e.has(t)||cj("Cannot "+r),$s=(t,e,r)=>(hj(t,e,"read from private field"),r?r.call(t):e.get(t)),Y0=(t,e,r)=>e.has(t)?cj("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),Jc=(t,e,r,n)=>(hj(t,e,"write to private field"),e.set(t,r),r),Dp,bb,xb,Aa,ad;const uj=Jge("CREPE_MENU"),bT=tr({show:()=>{},hide:()=>{}},"menuAPICtx");function LCe(t,e){t.set(uj.key,{view:r=>new DCe(t,r,e)})}class DCe{constructor(e,r,n){Y0(this,Dp),Y0(this,bb),Y0(this,xb),Y0(this,Aa),Y0(this,ad,null),this.update=h=>{$s(this,Aa).update(h)},this.show=h=>{Jc(this,ad,h),$s(this,xb).value="",$s(this,Aa).show()},this.hide=()=>{Jc(this,ad,null),$s(this,Aa).hide()},this.destroy=()=>{$s(this,Aa).destroy(),$s(this,bb).unmount(),$s(this,Dp).remove()};const i=document.createElement("div");i.classList.add("milkdown-slash-menu");const s=We(!1),o=We("");Jc(this,xb,o);const a=this.hide,l=bo(OCe,{ctx:e,config:n,show:s,filter:o,hide:a});Jc(this,bb,l),l.mount(i),Jc(this,Dp,i);const c=this;Jc(this,Aa,new Zge({content:$s(this,Dp),debounce:20,shouldShow(h){if(ij(h.state.selection)||sj(h.state.selection))return!1;const u=this.getContent(h,f=>["paragraph","heading"].includes(f.type.name));if(u==null||!ICe(h.state.selection))return!1;const d=$s(c,ad);if(o.value=u.startsWith("/")?u.slice(1):u,typeof d=="number"){const f=h.state.doc.nodeSize-2,p=Math.min(d,f);return h.state.doc.resolve(p).node()!==h.state.doc.resolve(h.state.selection.from).node()?(Jc(c,ad,null),!1):!0}return!!u.startsWith("/")},offset:10})),$s(this,Aa).onShow=()=>{s.value=!0},$s(this,Aa).onHide=()=>{s.value=!1},this.update(r),e.set(bT.key,{show:h=>this.show(h),hide:()=>this.hide()})}}Dp=new WeakMap;bb=new WeakMap;xb=new WeakMap;Aa=new WeakMap;ad=new WeakMap;function ICe(t){if(!(t instanceof Je))return!1;const{$head:e}=t,r=e.parent;return e.parentOffset===r.content.size}const BCe=En({props:{onAdd:{type:Function,required:!0},addIcon:{type:String,required:!0},handleIcon:{type:String,required:!0}}
964,setup(t){const e=We();return()=>te(Cn,null,te("div",{ref:e,class:"operation-item",onPointerdown:r=>{var n;r.preventDefault(),r.stopPropagation(),(n=e.value)==null||n.classList.add("active")},onPointerup:r=>{var n;r.preventDefault(),r.stopPropagation(),(n=e.value)==null||n.classList.remove("active"),t.onAdd()}},te(Ef,{icon:t.addIcon})),te("div",{class:"operation-item"},te(Ef,{icon:t.handleIcon})))}});var dj=t=>{throw TypeError(t)},fj=(t,e,r)=>e.has(t)||dj("Cannot "+r),Zc=(t,e,r)=>(fj(t,e,"read from private field"),r?r.call(t):e.get(t)),i2=(t,e,r)=>e.has(t)?dj("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),s2=(t,e,r,n)=>(fj(t,e,"write to private field"),e.set(t,r),r),vb,sh,wb,kb;class RCe{constructor(e,r){i2(this,vb),i2(this,sh),i2(this,wb),i2(this,kb),this.update=()=>{Zc(this,sh).update()},this.destroy=()=>{Zc(this,sh).destroy(),Zc(this,vb).remove(),Zc(this,wb).unmount()},this.onAdd=()=>{const c=Zc(this,kb),h=c.get(fr);h.hasFocus()||h.focus();const{state:u,dispatch:d}=h,f=Zc(this,sh).active;if(!f)return;const m=f.$pos.pos+f.node.nodeSize;let g=u.tr.insert(m,la.type(c).create());g=g.setSelection(Je.near(g.doc.resolve(m))),d(g.scrollIntoView()),Zc(this,sh).hide(),c.get(bT.key).show(g.selection.from)};var n,i,s;s2(this,kb,e);const o=document.createElement("div");o.classList.add("milkdown-block-handle");const a=bo(BCe,{onAdd:this.onAdd,addIcon:(n=r==null?void 0:r.handleAddIcon)!=null?n:OS,handleIcon:(i=r==null?void 0:r.handleDragIcon)!=null?i:yCe});a.mount(o),s2(this,wb,a),s2(this,vb,o);const l=(s=r==null?void 0:r.blockHandle)!=null?s:{};s2(this,sh,new J0e({ctx:e,content:o,getOffset:()=>16,getPlacement:({active:c,blockDom:h})=>{if(c.node.type.name==="heading")return"left";let u=0;c.node.descendants(S=>{u+=S.childCount});const d=c.el,f=d.getBoundingClientRect(),p=h.getBoundingClientRect(),m=window.getComputedStyle(d),g=Number.parseInt(m.paddingTop,10)||0,y=Number.parseInt(m.paddingBottom,10)||0,b=f.height-g-y,x=p.height;return u>2||x<b?"left-start":"left"},...l})),this.update()}}vb=new WeakMap;sh=new WeakMap;wb=new WeakMap;kb=new WeakMap;function PCe(t,e){t.set(pw.key,{filterNodes:r=>!Ko(i=>["table","blockquote","math_inline"].includes(i.type.name))(r)}),t.set(yw.key,{view:()=>new RCe(t,e)})}const NCe=(t,e)=>{t.config(pa(Vt.BlockEdit)).config(r=>PCe(r,e)).config(r=>LCe(r,e)).use(bT).use(yw).use(uj)},FCe=(t,e={})=>{t.config(pa(Vt.CodeMirror)).config(r=>{const{languages:n=[],theme:i}=e,s=[Yf.of(Uq.concat(Kxe)),n4e];i&&s.push(i),e.extensions&&s.push(...e.extensions),r.update(H1.key,o=>({extensions:s,languages:n,expandIcon:e.expandIcon||JW,searchIcon:e.searchIcon||tj,clearSearchIcon:e.clearSearchIcon||ZW,searchPlaceholder:e.searchPlaceholder||"Search language",copyText:e.copyText||"Copy",copyIcon:e.copyIcon||ej,onCopy:e.onCopy||(()=>{}),noResultText:e.noResultText||"No result",renderLanguage:e.renderLanguage||o.renderLanguage,renderPreview:e.renderPreview||o.renderPreview,previewToggleButton:a=>{var l,c;const h=((l=e.previewToggleIcon)==null?void 0:l.call(e,a))||(a?yT:nj),u=((c=e.previewToggleText)==null?void 0:c.call(e,a))||(a?"Edit":"Hide");return[h,u].map(d=>d.trim()).join(" ")},previewLabel:e.previewLabel||o.previewLabel}))}).use(bve)},$Ce=(t,e)=>{if(t.config(pa(Vt.Cursor)).config(n=>{n.update(Vw.key,()=>{var i,s;return{class:"crepe-drop-cursor",width:(i=e==null?void 0:e.width)!=null?i:4,color:(s=e==null?void 0:e.color)!=null?s:!1}})}).use(f4e),(e==null?void 0:e.virtual)===!1)return;const r=p4e();t.use(nn(()=>r))},zCe=(t,e)=>{t.config(pa(Vt.ImageBlock)).config(r=>{r.update(Ww.key,n=>{var i,s,o,a,l,c;return{uploadButton:(i=e==null?void 0:e.inlineUploadButton)!=null?i:"Upload",imageIcon:(s=e==null?void 0:e.inlineImageIcon)!=null?s:ES,confirmButton:(o=e==null?void 0:e.inlineConfirmButton)!=null?o:gT,uploadPlaceholderText:(a=e==null?void 0:e.inlineUploadPlaceholderText)!=null?a:"or paste link",onUpload:(c=(l=e==null?void 0:e.inlineOnUpload)!=null?l:e==null?void 0:e.onUpload)!=null?c:n.onUpload,proxyDomURL:e==null?void 0:e.proxyDomURL}}),r.update(Lw.key,n=>{var i,s,o,a,l,c,h,u;return{uploadButton:(i=e==null?void 0:e.blockUploadButton)!=null?i:"Upload file",imageIcon:(s=e==null?void 0:e.blockImageIcon)!=null?s:ES,captionIcon:(o=e==null?void 0:e.blockCaptionIcon)!=null?o:sCe,confirmButton:(a=e==null?void 0:e.blockConfirmButton)!=null?a:"Confirm",captionPlaceholderText:(l=e==null?void 0:e.blockCaptionPlaceholderText)!=null?l:"Write Image Caption",uploadPlaceholderText:(c=e==null?void 0:e.blockUploadPlaceholderText)!=null?c:"or paste link",onUpload:(u=(h=e==null?void 0:e.blockOnUpload)!=null?h:e==null?void 0:e.onUpload)!=null?u:n.onUpload,proxyDomURL:e==null?void 0:e.proxyDomURL}})}).use(z1e).use(A4e)},HCe=ra.extendSchema(t=>e=>{const r=t(e);return{...r,toMarkdown:{match:r.toMarkdown.match,runner:(n,i)=>{var s,o;if(((s=i.attrs.language)!=null?s:"").toLowerCase()==="latex")n.addNode("math",void 0,((o=i.content.firstChild)==null?void 0:o.text)||"");else return r.toMarkdown.runner(n,i)}}}}),Ip="math_inline",Ag=Hr(Ip,()=>({group:"inline",inline:!0,draggable:!0,atom:!0,attrs:{value:{default:""}},parseDOM:[{tag:`span[data-type="${Ip}"]`,getAttrs:t=>{var e;return{value:(e=t.dataset.value)!=null?e:""}}
964}],toDOM:t=>{const e=t.attrs.value,r=document.createElement("span");return r.dataset.type=Ip,r.dataset.value=e,aT.render(e,r,{throwOnError:!1}),r},parseMarkdown:{match:t=>t.type==="inlineMath",runner:(t,e,r)=>{t.addNode(r,{value:e.value})}},toMarkdown:{match:t=>t.type.name===Ip,runner:(t,e)=>{t.addNode("inlineMath",void 0,e.attrs.value)}}})),pj=yt("ToggleLatex",t=>()=>(e,r)=>{const{hasNode:n,pos:i,target:s}=aF(e,Ag.type(t)),{selection:o,doc:a,tr:l}=e;if(!n){const f=a.textBetween(o.from,o.to);let p=l.replaceSelectionWith(Ag.type(t).create({value:f}));return r&&r(p.setSelection(lt.create(p.doc,o.from))),!0}const{from:c,to:h}=o;if(!s||i<0)return!1;let u=l.delete(i,i+1);const d=s.attrs.value;return u=u.insertText(d,i),r&&r(u.setSelection(Je.create(u.doc,c,h+d.length-1))),!0}),mI=e4("INLINE_LATEX"),qCe=En({props:{config:{type:Object,required:!0},innerView:{type:Object,required:!0},updateValue:{type:Object,required:!0}},setup(t){const e=n=>{if(!(!n||!(n instanceof HTMLElement))){for(;n.firstChild;)n.removeChild(n.firstChild);t.innerView.value&&n.appendChild(t.innerView.value.dom)}},r=n=>{n.preventDefault(),t.updateValue.value()};return()=>te("div",{class:"container"},t.innerView&&te("div",{ref:e}),te("button",{onPointerdown:r},te(Ef,{icon:t.config.inlineEditConfirm})))}});var mj=t=>{throw TypeError(t)},gj=(t,e,r)=>e.has(t)||mj("Cannot "+r),on=(t,e,r)=>(gj(t,e,"read from private field"),r?r.call(t):e.get(t)),El=(t,e,r)=>e.has(t)?mj("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),o2=(t,e,r,n)=>(gj(t,e,"write to private field"),e.set(t,r),r),Bp,ld,Cb,oh,Rp,Pp,DS,IS;class VCe{constructor(e,r,n){this.ctx=e,El(this,Bp),El(this,ld),El(this,Cb),El(this,oh,wx(null)),El(this,Rp,wx(()=>{})),El(this,Pp),El(this,DS,()=>{on(this,oh).value&&(on(this,oh).value.destroy(),on(this,oh).value=null)}),El(this,IS,s=>{const a=(()=>{const{selection:l,schema:c}=s.state;if(l.empty||!(l instanceof lt))return!1;const h=l.node;if(h.type.name!==Ip)return!1;const u=l.from,d=c.nodes.paragraph.create(null,c.text(h.attrs.value)),f=new B7(on(this,Cb),{state:ph.create({doc:d,schema:new RN({nodes:{doc:{content:"block+"},paragraph:{content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM(){return["p",0]}},text:{group:"inline"}}}),plugins:[QF({"Mod-z":Hw,"Mod-Z":Of,"Mod-y":Of,Enter:()=>(on(this,Rp).value(),!0)})]})});return on(this,oh).value=f,on(this,Rp).value=()=>{const{tr:p}=s.state;p.setNodeAttribute(u,"value",f.state.doc.textContent),s.dispatch(p),requestAnimationFrame(()=>{s.focus()})},!0})();return a||on(this,DS).call(this),a}),this.update=(s,o)=>{on(this,ld).update(s,o)},this.destroy=()=>{on(this,Pp).unmount(),on(this,ld).destroy(),on(this,Bp).remove()};const i=document.createElement("div");i.className="milkdown-latex-inline-edit",o2(this,Bp,i),o2(this,Pp,bo(qCe,{config:n,innerView:on(this,oh),updateValue:on(this,Rp)})),on(this,Pp).mount(i),o2(this,ld,new Qw({debounce:0,content:on(this,Bp),shouldShow:on(this,IS),offset:10,floatingUIOptions:{placement:"bottom"}})),on(this,ld).update(r),o2(this,Cb,document.createElement("div"))}}Bp=new WeakMap;ld=new WeakMap;Cb=new WeakMap;oh=new WeakMap;Rp=new WeakMap;Pp=new WeakMap;DS=new WeakMap;IS=new WeakMap;const WCe=jn(t=>ele(/(?:\$)([^$]+)(?:\$)$/,Ag.type(t),{getAttr:e=>{var r;return{value:(r=e[1])!=null?r:""}}})),jCe=jn(t=>c7(/^\$\$[\s\n]$/,ra.type(t),()=>({language:"LaTeX"}))),UCe=aa("remarkMath",()=>Bke);function GCe(t){return Dc(t,"math",(e,r,n)=>{const{value:i}=e,s={type:"code",lang:"LaTeX",value:i};n.children.splice(r,1,s)})}const KCe=aa("remarkMathBlock",()=>()=>GCe),YCe=(t,e)=>{t.config(pa(Vt.Latex)).config(r=>{if(!o4(r).get().includes(Vt.CodeMirror))throw new Error("You need to enable CodeMirror to use LaTeX feature");r.update(H1.key,s=>({...s,renderPreview:(o,a)=>{if(o.toLowerCase()==="latex"&&a.length>0)return XCe(a,e==null?void 0:e.katexOptions);const l=s.renderPreview;return l(o,a)}})),r.set(mI.key,{view:s=>{var o;return new VCe(r,s,{inlineEditConfirm:(o=e==null?void 0:e.inlineEditConfirm)!=null?o:gT,...e})}})}).use(UCe).use(KCe).use(Ag).use(mI).use(WCe).use(jCe).use(HCe).use(pj)};function XCe(t,e){return aT.renderToString(t,{...e,throwOnError:!1,displayMode:!0})}const JCe=(t,e)=>{t.config(pa(Vt.LinkTooltip)).config(u3e).config(r=>{r.update(Rf.key,n=>{var i,s,o,a,l,c;return{...n,linkIcon:(i=e==null?void 0:e.linkIcon)!=null?i:ej,editButton:(s=e==null?void 0:e.editButton)!=null?s:yT,removeButton:(o=e==null?void 0:e.removeButton)!=null?o:LS,confirmButton:(a=e==null?void 0:e.confirmButton)!=null?a:gT,inputPlaceholder:(l=e==null?void 0:e.inputPlaceholder)!=null?l:"Paste link...",onCopyLink:(c=e==null?void 0:e.onCopyLink)!=null?c:()=>{}}})}).use(d3e)};function ZCe(t,e){t.set(r4.key,{renderLabel:({label:r,listType:n,checked:i})=>{var s,o,a;return i==null?n==="bullet"?(s=e==null?void 0:e.bulletIcon)!=null?s:nCe:r:i?(o=e==null?void 0:e.checkBoxCheckedIcon)!=null?o:oCe:(a=e==null?void 0:e.checkBoxUncheckedIcon)!=null?a:aCe}})}const QCe=(t,e)=>{t.config(pa(Vt.ListItem)).config(r=>ZCe(r,e)).use(x3e)};function eSe(t){var e;return t.childCount<=1&&!((e=t.firstChild)!=null&&e.content.size)}function tSe(t,e){const{selection:r}=t;if(!r.empty)return null;const n=r.$anchor,i=n.parent;if(i.content.size>0||Ko(a=>a.type.name==="table")(n))return null;const o=n.before();return Ur.node(o,o+i.nodeSize,{class:"crepe-placeholder","data-placeholder":e})}const BS=tr({text:"Please enter...",mode:"block"},"placeholderConfigCtx"),rSe=nn(t=>new _r({key:new Dr("CREPE_PLACEHOLDER"),props:{decorations:e=>{var r;if(MCe(t).readonly)return null;const i=t.get(BS.key);if(i.mode==="doc"&&!eSe(e.doc)||ij(e.selection)||sj(e.selection))return null;const s=(r=i.text)!=null?r:"Please enter...",o=tSe(e,s);return o?or.create(e.doc,[o]):null}}})),nSe=(t,e)=>{t.config(pa(Vt.Placeholder)).config(r=>{e&&r.update(BS.key,n=>({...n,...e}))}).use(rSe).use(BS)},iSe=(t,e)=>{t.config(pa(Vt.Table)).config(r=>{r.update(n4.key,n=>({...n,renderButton:i=>
964{var s,o,a,l,c,h,u,d,f;switch(i){case"add_row":return(s=e==null?void 0:e.addRowIcon)!=null?s:OS;case"add_col":return(o=e==null?void 0:e.addColIcon)!=null?o:OS;case"delete_row":return(a=e==null?void 0:e.deleteRowIcon)!=null?a:LS;case"delete_col":return(l=e==null?void 0:e.deleteColIcon)!=null?l:LS;case"align_col_left":return(c=e==null?void 0:e.alignLeftIcon)!=null?c:eCe;case"align_col_center":return(h=e==null?void 0:e.alignCenterIcon)!=null?h:Q3e;case"align_col_right":return(u=e==null?void 0:e.alignRightIcon)!=null?u:tCe;case"col_drag_handle":return(d=e==null?void 0:e.colDragHandleIcon)!=null?d:fI;case"row_drag_handle":return(f=e==null?void 0:e.rowDragHandleIcon)!=null?f:fI}}}))}).use(U3e)};function sSe(t,e){var r,n,i,s,o,a,l;const c=new lj;c.addGroup("formatting","Formatting").addItem("bold",{icon:(r=t==null?void 0:t.boldIcon)!=null?r:rCe,active:f=>f.get(He).call(Qu.key,Qf.type(f)),onRun:f=>{f.get(He).call(xw.key)}}).addItem("italic",{icon:(n=t==null?void 0:t.italicIcon)!=null?n:mCe,active:f=>f.get(He).call(Qu.key,Mu.type(f)),onRun:f=>{f.get(He).call(bw.key)}}).addItem("strikethrough",{icon:(i=t==null?void 0:t.strikethroughIcon)!=null?i:vCe,active:f=>f.get(He).call(Qu.key,i0.type(f)),onRun:f=>{f.get(He).call(Bw.key)}});const h=c.addGroup("function","Function");h.addItem("code",{icon:(s=t==null?void 0:t.codeIcon)!=null?s:QW,active:f=>f.get(He).call(Qu.key,Ua.type(f)),onRun:f=>{f.get(He).call(vw.key)}});const u=e&&o4(e).get();return(u==null?void 0:u.includes(Vt.Latex))&&h.addItem("latex",{icon:(o=t==null?void 0:t.latexIcon)!=null?o:rj,active:f=>f.get(He).call(Cz.key,Ag.type(f)),onRun:f=>{f.get(He).call(pj.key)}}),h.addItem("link",{icon:(a=t==null?void 0:t.linkIcon)!=null?a:gCe,active:f=>f.get(He).call(Qu.key,eo.type(f)),onRun:f=>{f.get(He).call(MW.key)}}),(l=t==null?void 0:t.buildToolbar)==null||l.call(t,c),c.build()}const oSe=En({props:{ctx:{type:Object,required:!0},hide:{type:Function,required:!0},show:{type:Object,required:!0},selection:{type:Object,required:!0},config:{type:Object,required:!1}},setup(t){const{ctx:e,config:r}=t,n=o=>a=>{a.preventDefault(),e&&o(e)};function i(o){return t.selection.value,e.get(IC).status!==mx.Created?!1:o(e)}const s=mu(()=>sSe(r,e));return()=>te(Cn,null,s.value.map(o=>o.items.map(a=>te("button",{type:"button",class:Mn("toolbar-item",e&&i(a.active)&&"active"),onPointerdown:n(a.onRun)},te(Ef,{icon:a.icon})))).reduce((o,a,l)=>(l===0?o.push(...a):o.push(te("div",{class:"divider"}),...a),o),[]))}});var yj=t=>{throw TypeError(t)},bj=(t,e,r)=>e.has(t)||yj("Cannot "+r),Vi=(t,e,r)=>(bj(t,e,"read from private field"),r?r.call(t):e.get(t)),X0=(t,e,r)=>e.has(t)?yj("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),a2=(t,e,r,n)=>(bj(t,e,"write to private field"),e.set(t,r),r),Il,Np,Sb,Fp,$p;const gI=e4("CREPE_TOOLBAR");class aSe{constructor(e,r,n){X0(this,Il),X0(this,Np),X0(this,Sb),X0(this,Fp),X0(this,$p,We(!1)),this.update=(o,a)=>{Vi(this,Il).update(o,a),Vi(this,Fp).value=o.state.selection},this.destroy=()=>{Vi(this,Il).destroy(),Vi(this,Sb).unmount(),Vi(this,Np).remove()},this.hide=()=>{Vi(this,Il).hide()};const i=document.createElement("div");i.className="milkdown-toolbar",a2(this,Fp,wx(r.state.selection));const s=bo(oSe,{ctx:e,hide:this.hide,config:n,selection:Vi(this,Fp),show:Vi(this,$p)});s.mount(i),a2(this,Np,i),a2(this,Sb,s),a2(this,Il,new Qw({content:Vi(this,Np),debounce:20,offset:10,shouldShow(o){const{doc:a,selection:l}=o.state,{empty:c,from:h,to:u}=l,d=!a.textBetween(h,u).length&&l instanceof Je,f=!(l instanceof Je),p=o.dom.getRootNode().activeElement,m=i.contains(p),g=!o.hasFocus()&&!m,y=!o.editable;return!(g||f||c||d||y)}})),Vi(this,Il).onShow=()=>{Vi(this,$p).value=!0},Vi(this,Il).onHide=()=>{Vi(this,$p).value=!1},this.update(r)}}Il=new WeakMap;Np=new WeakMap;Sb=new WeakMap;Fp=new WeakMap;$p=new WeakMap;const lSe=(t,e)=>{t.config(pa(Vt.Toolbar)).config(r=>{r.set(gI.key,{view:n=>new aSe(r,n,e)})}).use(gI)};function cSe(t,e,r){switch(t){case Vt.CodeMirror:return FCe(e,r);case Vt.ListItem:return QCe(e,r);case Vt.LinkTooltip:return JCe(e,r);case Vt.ImageBlock:return zCe(e,r);case Vt.Cursor:return $Ce(e,r);case Vt.BlockEdit:return NCe(e,r);case Vt.Placeholder:return nSe(e,r);case Vt.Toolbar:return lSe(e,r);case Vt.Table:return iSe(e,r);case Vt.Latex:return YCe(e,r)}}var xj=t=>{throw TypeError(t)},vj=(t,e,r)=>e.has(t)||xj("Cannot "+r),Wi=(t,e,r)=>(vj(t,e,"read from private field"),r?r.call(t):e.get(t)),Ok=(t,e,r)=>e.has(t)?xj("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),Lk=(t,e,r,n)=>(vj(t,e,"write to private field"),e.set(t,r),r),Ui,Tb,zp;class hSe{constructor({root:e,defaultValue:r=""}={}){Ok(this,Ui),Ok(this,Tb),Ok(this,zp,!0),this.addFeature=(i,s)=>(i(Wi(this,Ui),s),this),this.create=()=>Wi(this,Ui).create(),this.destroy=()=>Wi(this,Ui).destroy(),this.setReadonly=i=>(Lk(this,zp,!i),Wi(this,Ui).action(s=>{Wi(this,Ui).status===mx.Created&&s.get(fr).setProps({editable:()=>!i})}),this),this.getMarkdown=()=>Wi(this,Ui).action(o0e()),this.on=i=>Wi(this,Ui).status!==mx.Created?(Wi(this,Ui).config(s=>{const o=s.get(Vx);i(o)}),this):(Wi(this,Ui).action(s=>{const o=s.get(Vx);i(o)}),this);var n;Lk(this,Tb,(n=typeof e=="string"?document.querySelector(e):e)!=null?n:document.body),Lk(this,Ui,PC.make().config(i=>{i.inject(_Ce,this),i.inject(TCe,[])}).config(i=>{i.set(J2,Wi(this,Tb)),i.set(K2,r),i.set(ym,{editable:()=>Wi(this,zp)}),i.update(s4.key,s=>({...s,size:4}))}).use(Oz).use(YW).use(G3e).use(Y3e).use(J3e).use(jW).use(Fbe))}get editor(){return Wi(this,Ui)}get readonly(){return!Wi(this,zp)}}Ui=new WeakMap;Tb=new WeakMap;zp=new WeakMap;class wj extends hSe{constructor({features:e={},featureConfigs:r={},...n}={}){super(n);const i=sre(r,SCe);Object.entries({...Z3e,...e}).filter(([,o])=>o).map(([o])=>
964o).forEach(o=>{const a=i[o];cSe(o,this.editor,a)})}}wj.Feature=Vt;window.addEventListener("error",t=>{if(t.message&&t.message.includes("Selection passed to setSelection must point at the current document"))return t.preventDefault(),console.warn("Milkdown selection error suppressed (does not affect functionality)"),!0});window.milkDownEditorComponent=function(t,e,r=null,n=!1){let i=null;return{showEditor:!1,currentMarkdown:"",crepe:null,elementId:t,uploadUrl:e,content:"",isWireMode:!1,wireModelName:r,startInEdit:n,showAutoSave:!1,autoSaveTime:"",toggleButtonText:"",customSaveConfig:null,initEditor:async function(s=null){try{if(s!=null?(this.content=this.tokenizeMermaid(s),this.content=s,this.isWireMode=!0):this.content=this.$el.dataset.content||"",this.customSaveConfig=JSON.parse(this.$el.getAttribute("data-custom-save-config")),this.toggleButtonText=trans("Editer le contenu"),await this.init(),this.startInEdit){this.showEditor=!0,i&&requestAnimationFrame(()=>{try{i.setReadonly(!1)}catch(a){console.warn("Milkdown setReadonly error in startInEdit (can be safely ignored):",a.message)}}),this.toggleButtonText=trans("Le mode d'édition");const o=document.getElementById(this.elementId);o&&o.getBoundingClientRect().bottom<0&&(o.scrollIntoView({behavior:"smooth",block:"start"}),window.scrollBy({top:-100,behavior:"smooth"}))}setInterval(()=>this.handleButtonPosition(),500),window.addEventListener("refreshMilkDown",o=>{o.detail&&typeof o.detail.isRefresh<"u"&&this.init(o.detail.content)}),window.addEventListener("milkdownQuitEditing",()=>{this.toggleEditMode()}),window.addEventListener("milkdownEditing",()=>{this.toggleEditMode()})}catch(o){console.warn("Milkdown initEditor error (can be safely ignored):",o.message)}},toggleEditMode:function(){if(!i){console.warn("Milkdown editor not yet initialized, attempting to initialize..."),this.init().then(()=>{this.toggleEditMode()});return}this.showEditor=!this.showEditor,requestAnimationFrame(()=>{try{if(this.showEditor){i.setReadonly(!1),this.toggleButtonText=trans("Le mode d'édition");const s=document.getElementById(this.elementId);if(!s)return;s.getBoundingClientRect().bottom<0&&(s.scrollIntoView({behavior:"smooth",block:"start"}),window.scrollBy({top:-100,behavior:"smooth"}))}else this.forceSave(),i.setReadonly(!0),this.toggleButtonText=trans("Editer le contenu")}catch(s){console.warn("Milkdown setReadonly error (can be safely ignored):",s.message)}})},forceSave:function(){if(!i)return;const s=i.getMarkdown();if(this.wireModelName)this.$wire.set(this.wireModelName,s);else if(this.customSaveConfig){const o=new FormData;o.append(this.customSaveConfig.field,s),o.append("_method","PUT"),axios.post(this.customSaveConfig.url,o,{}).then(a=>{}).catch(a=>{console.error(a)})}},init:async function(s=null){i&&(await i.destroy(),i=null),s&&(this.content=this.tokenizeMermaid(s));const o=this.decodeHtmlEntities(this.content).replace(/\r\n/g,`
965`);let l=this.dedent(o).replace(/[ \t]+$/gm,"").replace(/^\n+/,"").replace(/\n+$/,"");if((!l||l.trim()==="")&&(l=" "),i=new wj({root:`#${this.elementId}`,defaultValue:l,featureConfigs:{[Vt.Placeholder]:{text:trans("Commencez à écrire...")},[Vt.ImageBlock]:{onUpload:async c=>{const h=new FormData;h.append("image",c);try{const u=await fetch(this.uploadUrl,{headers:{"X-CSRF-TOKEN":document.querySelector('meta[name="csrf-token"]').content},method:"POST",body:h});if(!u.ok)throw new Error("Server upload failed");return(await u.json()).data.url}catch(u){return console.error("Upload failed:",u),"**Upload Failed:**"}}},[Vt.Toolbar]:{buildToolbar:c=>{const h=c.getGroup("function");if(h){const u=h.group.items;h.group.items=u.filter(d=>d.key!=="latex"&&d.key!=="code")}}},[Vt.BlockEdit]:{blockHandle:{getPlacement:()=>"left-end"},textGroup:{label:trans("Texte"),text:{label:trans("Texte")},h1:{label:trans("Titre 1")},h2:{label:trans("Titre 2")},h3:{label:trans("Titre 3")},h4:{label:trans("Titre 4")},h5:{label:trans("Titre 5")},h6:{label:trans("Titre 6")},quote:{label:trans("Citation")},divider:{label:trans("Diviseur")}},listGroup:{label:trans("Liste"),bulletList:{label:trans("Liste à puces")},orderedList:{label:trans("Liste ordonnée")},taskList:{label:trans("Liste des tâches")}},advancedGroup:{label:trans("Avancée"),math:null,codeBlock:null,image:{label:trans("Image")},table:{label:trans("Tableau")}}}}}),i.editor.use(Oz),i.editor.config(c=>
965{c.set(Cw.key,h=>{const d=h.textContent.toLowerCase().replace(/\s+/g,"-").replace(/[^\w-]+/g,"");return h.attrs.id=`section-${d}`,{"data-level":h.attrs.level,class:"scroll-mt-[64px]"}})}),i){try{await i.create()}catch(h){console.warn("Milkdown create error (can be safely ignored):",h.message)}await new Promise(h=>{requestAnimationFrame(()=>{try{i.setReadonly(!0)}catch(u){console.warn("Milkdown setReadonly error during init (can be safely ignored):",u.message)}h()})});let c=!1;i.on(h=>{const u=this.debounce(d=>{if(this.wireModelName){this.$wire.set(this.wireModelName,d),this.showAutoSave=!0;const f=moment().format("DD/MM/YYYY HH:mm");this.autoSaveTime=f,setTimeout(()=>this.showAutoSave=!1,2e3)}else{const f=new FormData;f.append(this.customSaveConfig.field,d),f.append("_method","PUT"),this.showAutoSave=!0;const p=moment().format("DD/MM/YYYY HH:mm");this.autoSaveTime=p,setTimeout(()=>this.showAutoSave=!1,2e3),axios.post(this.customSaveConfig.url,f,{}).then(m=>{}).catch(m=>{console.error(m)})}},1e3);h.markdownUpdated((d,f)=>{if(!c){c=!0;return}u(f)})})}},handleButtonPosition:function(){const s=this.$refs.bar;this.$refs.sentinel;const o=this.$refs.wrapper;!s||!o||window.addEventListener("resize",()=>{if(s&&s.dataset&&s.dataset.fixed==="true"){const a=o.getBoundingClientRect();s.style.left=a.left+"px",s.style.width=a.width+"px"}})},decodeHtmlEntities:function(s){const o=document.createElement("textarea");return o.innerHTML=s,o.value},dedent:function(s){s.startsWith(`
966`)&&(s=s.slice(1));const o=s.split(`
967`);let a=1/0;for(const l of o){if(l.trim()==="")continue;const c=l.match(/^(\s+)/);if(a=Math.min(a,c?c[1].length:0),a===0)break}return!isFinite(a)||a===0?o.join(`
968`):o.map(l=>l.startsWith(" ".repeat(a))?l.slice(a):l).join(`
969`)},getMarkdown:async function(){const s=i.getMarkdown();this.wireModelName?(this.$wire.set(this.wireModelName,s),console.log(s)):console.log(i.getMarkdown())},tokenizeMermaid:function(s){return s.replace(/```\s*mermaid\s*([\s\S]*?)\s*```/g,(a,l)=>{const c=this.prepareMermaidCode(l);return`![1.00](${"https://mermaid.ink/svg/"+this.encodeMermaid(c)})`})}
969,prepareMermaidCode:function(s){s=s.replace(/\\n/g,"<br/>"),s=s.replace(/(\w+)\(([^)]+)\)<br>([^-\s]+)/g,(a,l,c,h)=>`${l}(${c}<br>${h})`);const o={é:"e",è:"e",ê:"e",ë:"e",à:"a",â:"a",ä:"a",ù:"u",û:"u",ü:"u",ô:"o",ö:"o",î:"i",ï:"i",ç:"c",É:"E",È:"E",Ê:"E",Ë:"E",À:"A",Â:"A",Ä:"A",Ù:"U",Û:"U",Ü:"U",Ô:"O",Ö:"O",Î:"I",Ï:"I",Ç:"C","≥":">=","≤":"<=","•":"-","–":"-","—":"-","…":"..."};return s=s.replace(/[\u00C0-\u017F≥≤•–—…]/g,a=>o[a]||a),s=s.replace(/[\u2018\u2019]/g,"'").replace(/[\u201C\u201D]/g,'"'),s=s.replace(/\\"|"/g,""),s=s.replace(/\{([^}]*\?[^}]*)\}/g,(a,l)=>"{"+l.replace(/\?/g,"")+"}"),s=s.replace(/([A-Za-z0-9_-]+)\[(.*?)\]/g,(a,l,c)=>(c=c.trim().replace(/^"|"$/g,""),c=c.replace(/[()]/g,"-"),c=c.replace(/--+/g,"-"),c=c.replace(/^-+|-+$/g,""),`${l}[${c}]`)),s=s.replace(/([A-Za-z0-9_-]+)\(([^)]+)\)/g,(a,l,c)=>`${l}[${c}]`),s=s.replace(/\|([^|]+)\|/g,(a,l)=>(l=l.replace(/[()]/g,"-"),l=l.replace(/--+/g,"-"),l=l.replace(/^[-\s]+|[-\s]+$/g,""),`|${l}|`)),s=s.replace(/_/g,"-"),s=s.split(`
970`).map(a=>a.replace(/\s{2,}/g," ")).join(`
971`),s},encodeMermaid:function(s){return btoa(unescape(encodeURIComponent(s))).replace(/[\n\r\t ]/g,"")},debounce:function(s,o,a=!1){let l;return function(){const c=this,h=arguments,u=function(){l=null,a||s.apply(c,h)};clearTimeout(l),l=setTimeout(u,o)}}}};window.audioRecordComponent=function(t,e,r){return{formType:r,chunkDurationSeconds:60,chunkToleranceSeconds:15,MIN_RECORDING_TIME_MS:60*1e3,MAX_RECORDING_TIME_MS:75*1e3,MAX_MEETING_TIME:(60*60+30*60)*1e3,MEETING_TYPE_TEMPLATE:null,MEETING_TYPE_FREE:null,silentSampleCount:0,volumeHistory:[],VOLUME_HISTORY_SIZE:10,isPaused:!1,isStopping:!1,mediaRecorder:null,currentAudioStream:null,audioChunks:[],silenceTimer:null,maxTimeTimeout:null,recordingStartTime:null,sessionStartTime:null,totalRecordingTime:0,chunkStartTime:null,timeUpdateInterval:null,pauseStartTime:null,audioContext:null,analyser:null,source:null,startButtonDisabled:!1,pauseButtonDisabled:!0,stopButtonDisabled:!0,uploadUrl:t,summaryUrl:e,meetingSession:null,meetingId:null,previousPrompt:null,currentPrompt:null,pauseText:trans("PAUSE"),meetingTemplates:{},manualOverrides:{},clientMeetingTypeId:null,pendingClientFormData:null,meetingFormDataHtml:"",transcriptHtml:"",startTime:null,stopTime:null,currentFormData:null,meetingBlocks:{sujets_abordes:{label:"Sujets abordés",isActive:!1,content:"",items:[],hasOverflow:!1},points_cles:{label:"Points clés",isActive:!1,content:"",items:[],hasOverflow:!1},points_attention:{label:"Points d'attention",isActive:!1,content:"",items:[],hasOverflow:!1},prochaines_etapes:{label:"Prochaines étapes",isActive:!1,content:"",items:[],hasOverflow:!1}},libreBlockMapping:{"Sujets abordés":"sujets_abordes","Points clés":"points_cles","Points d'attention":"points_attention","Prochaines étapes":"prochaines_etapes"},audioStatus:"Prêt à enregistrer",selectedMeetingType:"",meetingTemplate:null,meetingEnd:!1,meetingDuration:0,currentView:"structured",isSummarizing:!1,summaryHtml:"",clientList:null,selectedClient:null,clientName:trans("[Inconnue]"),newClient:{first_name:"",last_name:"",email:""},clientStoreUrl:"",toasts:[],menuWidth:20,isResizing:!1,startX:0,startWidth:0,minWidth:20,maxWidth:50,rightMenuWidth:20,showRightMenu:!1,recorderRealtime:null,transcript:"",audioContextReal:null,processorReal:null,audioSourceReal:null,highPassFilter:null,lowPassFilter:null,compressor:null,micGain:null,displayGain:null,ephemeralEndpoint:"",meetingUpdateUrl:"",transcriptMobileHtml:"",showEditForm:!1,meetingFormDataMobileHtml:"",editFormDataGroup:{},groupLayout:"1col",editFormDataMobileHtml:"",currentSelectedSection:null,meetingCreateUrl:"",meetingShowPageUrl:"",isShowPage:!1,isAutoStart:!1,mobileAudioStatusText:trans("PRÊT"),removeFormDataPropertyFields:{},micStream:null,displayStream:null,micSource:null,displaySource:null,mixer:null,currentSectionDataSelectedOnMobile:{},extractClientInfoUrl:"",clientInfos:{},clientEnumColumns:{},formErrors:{},destroyMeetingUrl:"",createMeetingUrl:"",showCancelMeetingPopup:!1,showStopMeetingConfirm:!1,meetingTitlePlaceholder:"",meetingTemplateEnums:{},currentMeetingTemplateEnums:{},crepeForms:{},meetingReportUrl:"",clientShowUrl:"",renewInterval:null,widgetQuestions:[],widgetState:localStorage.getItem("widgetState")||"minimized",widgetIndex:0,dismissedQuestions:[],recordingType:{title:"",type:"",participants:"",context:""},recordingTypeDebug:"",meetingTitle:"",currentEditingField:null,showWizard:!1,wizardSelection:null,wizardSelectedClient:null,wizardClientSearchQuery:"",wizardNewClient:{first_name:"",last_name:""},wizardCreatingClient:!1,returnClientId:null,recordingTime:"00:00:00",debugInfo:{processedChunks:0,totalChunks:0,lastChunkStatus:null,lastChunkSizeMb:null,lastChunkDurationS:null,failedChunks:[],silenceChunks:0,nextChunkIn:null},normalizeRecordingType(n){const i={title:"",type:"",participants:"",context:""};return!n||typeof n!="object"?{...i}:{...i,...n}},init(){this.meetingId=this.$refs.meetingId.value,this.isPaused=!1,this.totalRecordingTime=0,this.previousPrompt="",this.clientList=JSON.parse(this.$el.getAttribute("data-client-list")),this.meetingTemplates=JSON.parse(this.$el.getAttribute("data-meeting-templates"));const n=this.$el.getAttribute("data-client-meeting-type-id"),i=parseInt(n,10);this.clientMeetingTypeId=Number.isNaN(i)?null:i,this.currentFormData=JSON.parse(this.$el.getAttribute("data-form-data")),this.manualOverrides={};const s=this.$el.getAttribute("data-manual-overrides");try{const f=s?JSON.parse(s)||{}:{};this.applyIncomingManualOverrides(f)}catch{}this.currentFormData=this.withManualOverrides(this.currentFormData||{}),this.removeFormDataPropertyFields=JSON.parse(this.$el.getAttribute("data-removed-data")),this.transcript=this.$el.getAttribute("data-labeled-script")+`
972`,this.summaryHtml=this.$el.getAttribute("data-summary-html"),this.ephemeralEndpoint=this.$el.getAttribute("data-ephemeral-endpoint"),this.meetingUpdateUrl=this.$el.getAttribute("data-meeting-update-url"),this.chunkDurationSeconds=parseInt(this.$el.getAttribute("data-chunk-duration-seconds")||"60",10),this.chunkToleranceSeconds=parseInt(this.$el.getAttribute("data-chunk-tolerance-seconds")||"60",10),this.MIN_RECORDING_TIME_MS=this.chunkDurationSeconds*1e3,this.MAX_RECORDING_TIME_MS=(this.chunkDurationSeconds+this.chunkToleranceSeconds)*1e3,this.meetingCreateUrl=this.$el.getAttribute("data-meeting-create-url"),this.meetingShowPageUrl=this.$el.getAttribute("data-meeting-show-page-url"),this.isShowPage=this.$el.getAttribute("data-is-show-
972page");const o=(this.$el.getAttribute("data-is-auto-start")||"").toString().toLowerCase();this.isAutoStart=["1","true","yes","on"].includes(o),this.selectedMeetingType=this.$el.getAttribute("data-selected-meeting"),this.extractClientInfoUrl=this.$el.getAttribute("data-extract-client-info-url"),this.clientEnumColumns=JSON.parse(this.$el.getAttribute("data-client-enum-columns")),this.destroyMeetingUrl=this.$el.getAttribute("data-destroy-meeting-url"),this.createMeetingUrl=this.$el.getAttribute("data-create-meeting-url"),this.meetingTemplateEnums=JSON.parse(this.$el.getAttribute("data-meeting-template-enums")),this.meetingReportUrl=this.$el.getAttribute("data-meeting-report-url"),this.clientShowUrl=this.$el.getAttribute("data-client-show-url"),this.dismissedQuestions=JSON.parse(this.$el.getAttribute("data-dismissed-questions")||"[]");let a=null;const l=this.$el.getAttribute("data-recording-type");if(l)try{a=JSON.parse(l)}catch{}this.recordingType=this.normalizeRecordingType(a),this.meetingTitle=this.$el.getAttribute("data-meeting-title")||"",this.$nextTick(()=>{const f=this.clientMeetingTypeId!==null&&!Number.isNaN(this.clientMeetingTypeId)&&parseInt(this.selectedMeetingType,10)===this.clientMeetingTypeId;this.updateRecordingTypeButtonStyles(f?"client":"libre")});const c=JSON.parse(this.$el.getAttribute("data-questions")||"[]");if(Array.isArray(c)&&c.length>0){this.widgetQuestions=c.filter(p=>{const m=p.toLowerCase().trim();return!this.dismissedQuestions.some(g=>g.toLowerCase().trim()===m)});const f=localStorage.getItem("widgetState");this.widgetQuestions.length>0&&f!=="minimized"&&(this.widgetState=f||"preview")}this.$watch("widgetState",f=>{localStorage.setItem("widgetState",f)}),this.selectedMeetingType?this.meetingTitlePlaceholder=trans("Enregistrement en cours"):this.meetingTitlePlaceholder=trans("Nouvel enregistrement"),this.formType=="edit"&&(this.meetingEnd=!0),this.formType==="create"&&!this.isShowPage&&!this.isAutoStart&&(this.showWizard=!0),setTimeout(()=>{this.totalRecordingTime=this.$el.getAttribute("data-meeting-duration")*1e3,this.updateTimeDisplays()},100),this.isAutoStart&&this.startRecording();const h=Object.entries(this.currentFormData).sort(([,f],[,p])=>f.__priority-p.__priority);this.currentFormData=Object.fromEntries(h),this.currentMeetingTemplateEnums=this.meetingTemplateEnums[this.selectedMeetingType],this.renderForm(this.currentFormData),this.renderTranscription(this.transcript),(this.selectedMeetingType==5||this.selectedMeetingType===""||this.selectedMeetingType===null)&&this.currentFormData&&Object.keys(this.currentFormData).length>0&&(this.parseMeetingBlocks(this.currentFormData),this.startButtonDisabled=!0,this.pauseButtonDisabled=!1,this.isAutoStart?(this.isPaused=!1,this.pauseText=trans("PAUSE")):(this.isPaused=!0,this.pauseText=trans("REPRENDRE"))),this.transcript&&this.transcript.trim().length>1&&(this.startButtonDisabled=!0,this.pauseButtonDisabled=!1,this.isAutoStart?(this.isPaused=!1,this.pauseText=trans("PAUSE")):(this.isPaused=!0,this.pauseText=trans("REPRENDRE"))),this.clientStoreUrl=this.$el.getAttribute("data-client-store-url");const u=new URLSearchParams(window.location.search);this.returnClientId=u.get("return_client"),this.returnClientId?(this.selectedClient=this.returnClientId,this.selectedMeetingType=this.clientMeetingTypeId||1,this.clientList&&this.clientList[this.returnClientId]&&(this.clientName=this.clientList[this.returnClientId])):this.selectedClient=this.$el.getAttribute("data-selected-client"),this.selectedClient?this.clientName=this.clientList[this.selectedClient]:this.clientName=trans("[Inconnue]"),this.handleFormEvents(),window.addEventListener("storage",f=>{f.key==="rightMenuWidth"&&f.newValue&&(this.rightMenuWidth=parseFloat(f.newValue))}),window.addEventListener("rightMenuResize",f=>{f.detail&&f.detail.width&&(this.rightMenuWidth=f.detail.width)}),window.innerWidth<1024?(this.showRightMenu=!1,setTimeout(()=>{window.innerWidth<1024&&this.showRightMenu&&(this.showRightMenu=!1)},100)):this.showRightMenu=!0;const d=new Swiper(".mySwiper",{pagination:{el:".custom-swiper-pagination",clickable:!0}});d.on("slideChange",()=>{const f=d.slides[d.activeIndex],p=f.getAttribute("data-title"),m=f.getAttribute("data-sub-title");this.$refs.mobileTitle.textContent=p,this.$refs.mobileSubTitle.textContent=m}),window.addEventListener("beforeunload",f=>{this.startButtonDisabled&&(f.preventDefault(),f.returnValue="")}
972),this.$el.addEventListener("click",f=>{const p=f.target.closest(".add-dynamic-field-btn");if(p){const m=p.getAttribute("data-section");this.handleAddDynamicField(p,m)}})},formatBlockItem(n){let i=n;i=i.replace(/\(([^)]+)\)/g,'<span class="text-gray-500 italic text-xs">($1)</span>');const s=i.indexOf(":");if(s>0&&s<50){const o=i.substring(0,s),a=i.substring(s);i=`<span class="font-semibold text-gray-900">${o}</span>${a}`}return i},parseMeetingBlocks(n){if(!n)return;const i=this.libreBlockMapping;Object.keys(i).forEach(s=>{const o=i[s],a=n[s];if(a){if(this.meetingBlocks[o].isActive=a.__is_active!==!1,a.text===null)return;const l=a.text||"";if(this.meetingBlocks[o].content=l,l){const c=l.split(`
973`).map(h=>h.trim()).filter(h=>h.startsWith("•")).map(h=>{const u=h.replace(/^•\s*/,"");return this.formatBlockItem(u)});this.meetingBlocks[o].items=c}else this.meetingBlocks[o].items=[]}})},mergeLibreFormData(n,i={}){if(!n||typeof n!="object")return i||{};const s={...i||{}};return Object.entries(n).forEach(([o,a])=>{if(!a||typeof a!="object"){s[o]=a;return}const l=s[o]??{},c={...l,...a};Object.prototype.hasOwnProperty.call(this.libreBlockMapping,o)&&Object.prototype.hasOwnProperty.call(a,"text")&&a.text===null&&(c.text=(l==null?void 0:l.text)??""),s[o]=c}),s},addToast(n,i){const s=Date.now();this.toasts.push({id:s,type:n,message:i}),setTimeout(()=>{this.removeToast(s)},3e3)},removeToast(n){this.toasts=this.toasts.filter(i=>i.id!==n)},selectRecordingType:function(n){const i=document.getElementById("recordingTypeSlider"),s=document.getElementById("recordingTypeLibre"),o=document.getElementById("recordingTypeClient"),a=document.getElementById("recordingTypeSliderMobile"),l=document.getElementById("recordingTypeLibreMobile"),c=document.getElementById("recordingTypeClientMobile");if(n==="libre")i.style.left="4px",i.style.background="linear-gradient(135deg, rgba(168,85,247,0.8), rgba(147,51,234,0.9))",i.style.boxShadow="0 2px 8px rgba(168,85,247,0.4), inset 0 1px 0 rgba(255,255,255,0.2)",s.style.color="white",s.style.textShadow="0 1px 2px rgba(0,0,0,0.5)",o.style.color="rgba(255,255,255,0.6)",o.style.textShadow="none",a.style.left="4px",a.style.background="linear-gradient(135deg, rgba(168,85,247,0.8), rgba(147,51,234,0.9))",a.style.boxShadow="0 2px 8px rgba(168,85,247,0.4), inset 0 1px 0 rgba(255,255,255,0.2)",l.style.color="white",l.style.textShadow="0 1px 2px rgba(0,0,0,0.5)",c.style.color="rgb(31, 41, 55)",c.style.textShadow="none",this.meetingTitlePlaceholder=trans("Nouvel enregistrement"),this.selectedMeetingType="",this.meetingTemplate="",this.currentFormData={},this.currentMeetingTemplateEnums={},this.renderForm(this.currentFormData);else{const h=o.getAttribute("data-client-active-id");i.style.left="calc(50% + 0px)",i.style.background="linear-gradient(135deg, rgba(59,130,246,0.8), rgba(37,99,235,0.9))",i.style.boxShadow="0 2px 8px rgba(59,130,246,0.4), inset 0 1px 0 rgba(255,255,255,0.2)",o.style.color="white",o.style.textShadow="0 1px 2px rgba(0,0,0,0.5)",s.style.color="rgba(255,255,255,0.6)",s.style.textShadow="none",a.style.left="calc(50% + 0px)",a.style.background="linear-gradient(135deg, rgba(59,130,246,0.8), rgba(37,99,235,0.9))",a.style.boxShadow="0 2px 8px rgba(59,130,246,0.4), inset 0 1px 0 rgba(255,255,255,0.2)",c.style.color="white",c.style.textShadow="0 1px 2px rgba(0,0,0,0.5)",l.style.color="rgb(31, 41, 55)",l.style.textShadow="none",this.meetingTitlePlaceholder=trans("Enregistrement en cours"),this.currentFormData=this.meetingTemplates[h],this.currentMeetingTemplateEnums=this.meetingTemplateEnums[h],this.selectedMeetingType=h;const u=Object.entries(this.currentFormData).sort(([,d],[,f])=>d.__priority-f.__priority);this.currentFormData=Object.fromEntries(u),this.renderForm(this.currentFormData)}},updateRecordingTypeButtonStyles:function(n){const i=document.getElementById("recordingTypeSlider"),s=document.getElementById("recordingTypeLibre"),o=document.getElementById("recordingTypeClient"),a=document.getElementById("recordingTypeSliderMobile"),l=document.getElementById("recordingTypeLibreMobile"),c=document.getElementById("recordingTypeClientMobile");!i||!s||!a||!l||(n==="libre"?(i.style.left="4px",i.style.background="linear-gradient(135deg, rgba(168,85,247,0.8), rgba(147,51,234,0.9))",i.style.boxShadow="0 2px 8px rgba(168,85,247,0.4), inset 0 1px 0 rgba(255,255,255,0.2)",s.style.color="white",s.style.textShadow="0 1px 2px rgba(0,0,0,0.5)",o&&(o.style.color="rgba(255,255,255,0.6)",o.style.textShadow="none"),a.style.left="4px",a.style.background="linear-gradient(135deg, rgba(168,85,247,0.8), rgba(147,51,234,0.9))",a.style.boxShadow="0 2px 8px rgba(168,85,247,0.4), inset 0 1px 0 rgba(255,255,255,0.2)",l.style.color="white",l.style.textShadow="0 1px 2px rgba(0,0,0,0.5)",c&&(c.style.color="rgb(31, 41, 55)",c.style.textShadow="none")):(i.style.left="calc(50% + 0px)",i.style.background="linear-gradient(135deg, rgba(59,130,246,0.8), rgba(37,99,235,0.9))",i.style.boxShadow="0 2px 8px rgba(59,130,246,0.4), inset 0 1px 0 rgba(255,255,255,0.2)",o&&(o.style.color="white",o.style.textShadow="0 1px 2px rgba(0,0,0,0.5)"),s.style.color="rgba(255,255,255,0.6)",s.style.textShadow="none",a.style.left="calc(50% + 0px)",a.style.background="linear-gradient(135deg, rgba(59,130,246,0.8), rgba(37,99,235,0.9))",a.style.boxShadow="0 2px 8px rgba(59,130,246,0.4), inset 0 1px 0 rgba(255,255,255,0.2)",c&&(c.style.color="white",c.style.textShadow="0 1px 2px rgba(0,0,0,0.5)"),l.style.color="rgb(31, 41, 55)",l.style.textShadow="none"))},selectWizardOption(n){this.wizardSelection=n,n!=="existing_client"&&(this.wizardSelectedClient=null,this.wizardClientSearchQuery=""),n!=="new_client"&&(this.wizardNewClient={first_name:"",last_name:""})},get filteredWizardClients(){if(!this.wizardClientSearchQuery||this.wizardClientSearchQuery.length<1)return Object.entries(this.clientList||{}).slice(0,10);const n=this.wizardClientSearchQuery.toLowerCase();return Object.entries(this.clientList||{}).filter(([i,s])=>s.toLowerCase().includes(n)).slice(0,10)},selectWizardClient(n,i){this.wizardSelectedClient=n,this.wizardClientSearchQuery=i},resetWizard(){this.wizardSelection=null,this.wizardSelectedClient=null,this.wizardClientSearchQuery="",this.wizardNewClient={first_name:"",last_name:""},this.wizardCreatingClient=!1},generateUUID(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){const i=Math.random()*16|0;return(n==="x"?i:i&3|8).toString(16)})},async confirmWizardSelection(){var n,i,s,o,a,l,c;if(this.wizardSelection==="libre"){this.showWizard=!1,this.selectRecordingType("libre");return}if(this.wizardSelection==="new_client"){if(!this.wizardNewClient.first_name||!this.wizardNewClient.last_name){this.addToast(trans("Veuillez renseigner le prénom et le nom du client"),"error");return}this.wizardCreatingClient=!0;try{const h=await axios.post(this.clientStoreUrl,{first_name:this.wizardNewClient.first_name,last_name:this.wizardNewClient.last_name});if(!((n=h.data)!=null&&n.success)||!((s=(i=h.data)==null?void 0:i.data)!=null&&s.id))throw new Error(trans("Erreur lors de la création du client"));const u=h.data.data.id,d=this.generateUUID(),f=new FormData;f.append("meeting_id",d),f.append("client_id",u),f.append("meeting_type",this.clientMeetingTypeId||1),await axios.post(this.meetingCreateUrl,f);const p=this.clientShowUrl.replace("#ID#",u);window.location.href=`${p}?recording=true&meeting=${d}`}catch(h){console.error("Error creating client/meeting:",h),this.addToast(((a=(o=h.response)==null?void 0:o.data)==null?void 0:a.message)||trans("Erreur lors de la création"),"error"),this.wizardCreatingClient=!1}return}if(this.wizardSelection==="existing_client"){if(!this.wizardSelectedClient){this.addToast(trans("Veuillez sélectionner un client"),"error");return}this.wizardCreatingClient=!0;try{const h=this.generateUUID(),u=new FormData;u.append("meeting_id",h),u.append("client_id",this.wizardSelectedClient),u.append("meeting_type",this.clientMeetingTypeId||1),await axios.post(this.meetingCreateUrl,u);const d=this.clientShowUrl.replace("#ID#",this.wizardSelectedClient);window.location.href=`${d}?recording=true&meeting=${h}`}catch(h){console.error("Error creating meeting:",h),this.addToast(((c=(l=h.response)==null?void 0:l.data)==null?void 0:c.message)||trans("Erreur lors de la création de la réunion"),"error"),this.wizardCreatingClient=!1}return}},formatTime(n){return this.meetingDuration=Math.floor(n/1e3),moment.utc(n).format("HH:mm:ss")},updateTimeDisplays(){const n=Date.now();let i=this.totalRecordingTime;this.sessionStartTime&&!this.isPaused&&!this.isStopping&&(i+=n-this.sessionStartTime),this.recordingTime=this.formatTime(i),this.$refs.totalTimeDisplay&&(this.$refs.totalTimeDisplay.textContent=this.recordingTime,this.$refs.totalTimeDisplayMobile.textContent=this.recordingTime)},startTimeTracking(){this.timeUpdateInterval||(this.timeUpdateInterval=setInterval(()=>{this.totalRecordingTime>=this.MAX_MEETING_TIME&&this.stopRecording(),this.updateTimeDisplays()},100))},stopTimeTracking(){this.timeUpdateInterval&&(clearInterval(this.timeUpdateInterval),this.timeUpdateInterval=null)},startNewChunk(){if(!this.mediaRecorder)throw new Error("MediaRecorder not available");this.mediaRecorder.state==="inactive"&&(this.audioStatus="En cours d'enregistrement",this.mobileAudioStatusText="REC",this.recordingStartTime=Date.now(),this.chunkStartTime=Date.now(),this.mediaRecorder.start(),this.maxTimeTimeout=setTimeout(()=>{this.mediaRecorder.state==="recording"&&!this.isStopping&&(this.isStopping=!0,this.mediaRecorder.stop())},this.MAX_RECORDING_TIME_MS))},async startRecording(){var n,i;if(!this.isShowPage)try{const s=new FormData;s.append("meeting_id",this.meetingId),s.append("meeting_type",this.selectedMeetingType),s.append("client_id",this.selectedClient);const a=(await axios.post(this.meetingCreateUrl,s,{})).data.data.id;window.location.href=this.meetingShowPageUrl.replace("#ID#",a)+"?auto_
973start=1"}catch(s){if(s.status===403){const o=((i=(n=s.response)==null?void 0:n.data)==null?void 0:i.errors)||trans("The pack not include Meeting");return this.addToast("error",o),!1}return s.status===409?(this.addToast("error",trans(s.response.data.errors)),!1):(this.addToast("error","Internal server error"),!1)}try{await this.setupAudioCapture(),await this.setupMediaRecorder(),this.sessionStartTime=Date.now(),this.startTimeTracking(),this.startNewChunk()}catch(s){throw console.error("Recording setup failed:",s),this.addToast("error",trans("Impossible de démarrer l'enregistrement. Vérifiez les permissions.")),new Error("MediaRecorder not available")}},setupAudioCapture:async function(){try{this.displayStream=await navigator.mediaDevices.getDisplayMedia({video:{width:1,height:1},audio:{channelCount:1,echoCancellation:!1,noiseSuppression:!1},systemAudio:"include"}),this.displayStream.getAudioTracks().length===0?(console.warn("No audio track from screen share - user may not have shared audio"),this.displayStream.getTracks().forEach(i=>i.stop()),this.displayStream=null):(this.displayStream.getVideoTracks().forEach(i=>i.stop()),console.log("Screen share audio captured successfully"))}catch(n){console.warn("Screen share denied or not supported:",n),this.displayStream=null}try{this.micStream=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,echoCancellation:!1,noiseSuppression:!0,autoGainControl:!0}}),console.log("Microphone captured successfully")}catch(n){console.warn("Microphone access denied:",n)}if(!this.micStream&&!this.displayStream)throw new Error("Aucune source audio disponible. Veuillez autoriser le micro ou le partage d'écran.");await this.createCombinedAudioStream()},createCombinedAudioStream:async function(){this.audioContext=new(window.AudioContext||window.webkitAudioContext);let n;if(this.micStream&&this.displayStream){const s=this.audioContext.createMediaStreamSource(this.micStream),o=this.audioContext.createMediaStreamSource(this.displayStream),a=this.audioContext.createGain(),l=this.audioContext.createGain(),c=this.audioContext.createGain();a.gain.value=1.2,l.gain.value=.8,c.gain.value=.9,s.connect(a),o.connect(l),a.connect(c),l.connect(c),n=c,this.micSource=s,this.displaySource=o,this.micGain=a,this.displayGain=l,this.mixer=c,console.log("Audio capture: mic + system audio combined")}else this.micStream?(n=this.audioContext.createMediaStreamSource(this.micStream),this.micSource=n,console.log("Audio capture: mic only")):this.displayStream&&(n=this.audioContext.createMediaStreamSource(this.displayStream),this.displaySource=n,console.log("Audio capture: system audio only"));const i=this.audioContext.createMediaStreamDestination();n.connect(i),this.currentAudioStream=i.stream,this.analyser=this.audioContext.createAnalyser(),n.connect(this.analyser)},setupMediaRecorder:async function(){if(!this.currentAudioStream)throw new Error("No audio stream available");this.audioStatus="En cours d'enregistrement",this.mobileAudioStatusText="REC",this.mediaRecorder||(this.mediaRecorder=new MediaRecorder(this.currentAudioStream),this.mediaRecorder.ondataavailable=n=>{this.audioChunks.push(n.data)},this.mediaRecorder.onstop=()=>{if(this.isPaused)this.chunkStartTime=null;else if(this.chunkStartTime){const n=Date.now()-this.chunkStartTime;this.totalRecordingTime+=n,this.chunkStartTime=null}if(this.sessionStartTime=Date.now(),this.isStopping=!1,this.audioChunks.length>0){const n=new Blob(this.audioChunks,{type:"audio/webm;codecs=opus"});this.sendFile(n),this.audioChunks=[]}!this.isPaused&&this.startButtonDisabled&&this.startNewChunk()},this.startButtonDisabled=!0,this.stopButtonDisabled=!1,this.pauseButtonDisabled=!1)},initRealtimeTranscript:async function(){try{this.micStream||(this.micStream=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,echoCancellation:!1,noiseSuppression:!0,autoGainControl:!0}})),await this.connectWebSocket();const n=30*60*1e3;return this.renewInterval=setInterval(async()=>{await this.reconnectWebSocket()},n),!0}catch{throw new Error("MediaRecorder not available")}},reconnectWebSocket:async function(){let n;try{n=await axios.post(this.ephemeralEndpoint,[],{})}catch(a){throw a}const i=n.data.data.client_secret.value,s="wss://api.openai.com/v1/realtime",o=this.ws;this.ws=new WebSocket(s,["realtime","openai-insecure-api-key."+i,"openai-beta.realtime-v1"]),this.ws.onopen=()=>{this.audioContextReal||this.startRealtimeRecorder(),o&&o.close()},this.ws.onmessage=a=>{try{const l=JSON.parse(a.data);switch(l.type){case"session.created":break;case"session.updated":break;case"input_audio_buffer.speech_started":break;case"input_audio_buffer.speech_stopped":break;case"conversation.item.input_audio_transcription.delta":l.delta&&(this.transcript+=l.delta,this.renderTranscription(this.transcript));break;case"conversation.item.input_audio_transcription.completed":l.transcript&&(this.transcript+=`
974`);break;case"conversation.item.created":break;case"response.created":break;case"error":break;default:}}catch{}}
974,this.ws.onclose=a=>{},this.ws.onerror=a=>{console.log(a)}},connectWebSocket:async function(){await this.reconnectWebSocket()},startRealtimeRecorder:async function(){try{if(!this.micStream)try{this.micStream=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,echoCancellation:!1,noiseSuppression:!0,autoGainControl:!0}})}catch{}try{this.displayStream=await navigator.mediaDevices.getDisplayMedia({video:{width:1,height:1},audio:{channelCount:1,echoCancellation:!1,noiseSuppression:!1},systemAudio:"include"}),this.displayStream.getAudioTracks().length===0&&(this.displayStream.getTracks().forEach(p=>p.stop()),this.displayStream=null)}catch{this.displayStream=null}const n=new AudioContext,i=n.sampleRate,s=24e3;let o;const a=n.createBiquadFilter();a.type="highpass",a.frequency.value=80;const l=n.createBiquadFilter();l.type="lowpass",l.frequency.value=8e3;const c=n.createDynamicsCompressor();if(c.threshold.value=-20,c.knee.value=10,c.ratio.value=4,c.attack.value=.005,c.release.value=.15,this.micStream&&this.displayStream){const f=n.createMediaStreamSource(this.micStream),p=n.createMediaStreamSource(this.displayStream),m=n.createGain(),g=n.createGain(),y=n.createGain();m.gain.value=1.2,g.gain.value=.8,y.gain.value=.9,f.connect(m),p.connect(g),m.connect(y),g.connect(y),o=y,this.micSource=f,this.displaySource=p,this.micGain=m,this.displayGain=g,this.mixer=y}else if(this.micStream)o=n.createMediaStreamSource(this.micStream),this.micSource=o;else if(this.displayStream)o=n.createMediaStreamSource(this.displayStream),this.displaySource=o;else throw new Error("No audio source available");const h=n.createScriptProcessor(2048,1,1);o.connect(a),a.connect(l),l.connect(c),c.connect(h),h.connect(n.destination);const u=.008,d=.002;h.onaudioprocess=f=>{const p=f.inputBuffer.getChannelData(0);let m=0;for(let B=0;B<p.length;B++)m+=p[B]*p[B];const g=Math.sqrt(m/p.length);let y;g>=u?y=1:g<=d?y=0:y=(g-d)/(u-d);const b=i/s,x=Math.floor(p.length/b),S=new Float32Array(x);for(let B=0;B<x;B++){const E=B*b,D=Math.floor(E),N=Math.min(D+1,p.length-1),K=E-D;S[B]=p[D]*(1-K)+p[N]*K}const k=new Int16Array(x);for(let B=0;B<x;B++){let E=Math.max(-1,Math.min(1,S[B]*y));k[B]=Math.round(E<0?E*32768:E*32767)}const w=new ArrayBuffer(k.length*2),_=new DataView(w);for(let B=0;B<k.length;B++)_.setInt16(B*2,k[B],!0);const L=this.arrayBufferToBase64(w);this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"input_audio_buffer.append",audio:L}))},this.audioContextReal=n,this.processorReal=h,this.highPassFilter=a,this.lowPassFilter=l,this.compressor=c}catch(n){try{await this.startMicrophoneOnlyRecorder()}catch(i){throw console.error("Primary recorder failed:",n),console.error("Fallback recorder failed:",i),new Error("Veuillez autoriser l'accès au microphone pour utiliser cette fonctionnalité")}}},startMicrophoneOnlyRecorder:async function(){let n=this.currentAudioStream;n||(n=await navigator.mediaDevices.getUserMedia({audio:{sampleRate:{ideal:24e3},channelCount:{ideal:1},echoCancellation:!1,noiseSuppression:!0,autoGainControl:!0}}),this.currentAudioStream=n);const i=new AudioContext({sampleRate:24e3}),s=i.createMediaStreamSource(n),o=i.createScriptProcessor(4096,1,1);s.connect(o),o.connect(i.destination),o.onaudioprocess=a=>{const l=a.inputBuffer.getChannelData(0),c=new Int16Array(l.length);for(let f=0;f<l.length;f++){let p=Math.max(-1,Math.min(1,l[f]));c[f]=p<0?p*32768:p*32767}const h=new ArrayBuffer(c.length*2),u=new DataView(h);for(let f=0;f<c.length;f++)u.setInt16(f*2,c[f],!0);const d=this.arrayBufferToBase64(h);this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"input_audio_buffer.append",audio:d}))},this.audioContextReal=i,this.processorReal=o,this.audioSourceReal=s,this.micStream=n},arrayBufferToBase64:function(n){let i="";const s=new Uint8Array(n),o=32768;for(let a=0;a<s.length;a+=o){const l=s.subarray(a,a+o);i+=String.fromCharCode.apply(null,l)}return btoa(i)},stopRealtimeTranscript:function(){this.renewInterval&&(clearInterval(this.renewInterval),this.renewInterval=null),this.ws&&(this.ws.close(),this.ws=null),this.processorReal&&(this.processorReal.disconnect(),this.processorReal=null),this.highPassFilter&&(this.highPassFilter.disconnect(),this.highPassFilter=null),this.lowPassFilter&&(this.lowPassFilter.disconnect(),this.lowPassFilter=null),this.compressor&&(this.compressor.disconnect(),this.compressor=null),this.micGain&&(this.micGain.disconnect(),this.micGain=null),this.displayGain&&(this.displayGain.disconnect(),this.displayGain=null),this.audioSourceReal&&(this.audioSourceReal.disconnect(),this.audioSourceReal=null),this.audioContextReal&&(this.audioContextReal.close(),this.audioContextReal=null),this.micStream&&(this.micStream.getTracks().forEac
974h(n=>n.stop()),this.micStream=null),this.displayStream&&(this.displayStream.getTracks().forEach(n=>n.stop()),this.displayStream=null)},handlePauseResume:async function(){if(!this.isPaused)this.sessionStartTime&&(this.totalRecordingTime+=Date.now()-this.sessionStartTime),this.mediaRecorder&&this.mediaRecorder.state==="recording"&&!this.isStopping&&(this.isStopping=!0,this.mediaRecorder.stop()),this.cleanupAudioResources(),clearTimeout(this.silenceTimer),clearTimeout(this.maxTimeTimeout),this.isPaused=!0,this.pauseText=trans("REPRENDRE"),this.audioStatus=trans("En pause"),this.mobileAudioStatusText=trans("PAUSE"),this.sessionStartTime=null,this.stopTimeTracking();else try{await this.setupAudioCapture(),await this.setupMediaRecorder(),this.isPaused=!1,this.pauseText=trans("PAUSE"),this.sessionStartTime=Date.now(),this.startTimeTracking(),this.startNewChunk()}catch(n){console.error("Failed to resume recording:",n),this.addToast("error",trans("Impossible de reprendre l'enregistrement. Vérifiez les permissions."))}},stopRecording(){this.mediaRecorder&&this.mediaRecorder.state==="recording"&&!this.isStopping&&(this.isStopping=!0,this.mediaRecorder.stop(),this.stopTime=Date.now()),this.cleanupAudioResources(),clearTimeout(this.silenceTimer),clearTimeout(this.maxTimeTimeout),this.stopTimeTracking(),this.meetingEnd=!0,this.isSummarizing||(this.isSummarizing=!0,this.summaryMeeting()),this.startButtonDisabled=!1,this.stopButtonDisabled=!0,this.pauseButtonDisabled=!0,this.isPaused=!1,this.audioStatus="Fin de la réunion"},cleanupAudioResources(){if(this.micStream&&(this.micStream.getTracks().forEach(n=>n.stop()),this.micStream=null),this.displayStream&&(this.displayStream.getTracks().forEach(n=>n.stop()),this.displayStream=null),this.currentAudioStream&&(this.currentAudioStream.getTracks().forEach(n=>n.stop()),this.currentAudioStream=null),this.micSource){try{this.micSource.disconnect()}catch{}this.micSource=null}if(this.displaySource){try{this.displaySource.disconnect()}catch{}this.displaySource=null}if(this.mixer){try{this.mixer.disconnect()}catch{}this.mixer=null}if(this.analyser){try{this.analyser.disconnect()}catch{}this.analyser=null}this.audioContext&&this.audioContext.state!=="closed"&&(this.audioContext.close(),this.audioContext=null),this.mediaRecorder=null},sendFile(n){this.debugInfo.totalChunks++,this.debugInfo.lastChunkStatus="uploading",this.debugInfo.lastChunkSizeMb=(n.size/(1024*1024)).toFixed(2);const i=new FormData,s=`recording_${new Date().toISOString()}.webm`;if(i.append("audio_file",n,s),i.append("meeting_id",this.meetingId),console.log("sendFile - sessionStartTime:",this.sessionStartTime,"meetingId:",this.meetingId),i.append("start_time",this.sessionStartTime),i.append("meeting_type",this.selectedMeetingType),i.append("meeting_duration",this.meetingDuration),i.append("client_id",this.selectedClient),i.append("meeting_end",this.meetingEnd?1:0),i.append("transcript",this.transcript),i.append("chunk_sequence",this.debugInfo.totalChunks),this.selectedMeetingType==5){const o={};for(const[a,l]of Object.entries(this.meetingBlocks)){const c=l.label,h=l.items.map(u=>`• ${u}`).join(`
975`);o[c]={text:h||""}}this.currentFormData=o}this.currentFormData&&i.append("current_form_data",JSON.stringify(this.currentFormData)),this.manualOverrides&&i.append("manual_overrides",JSON.stringify(this.manualOverrides)),axios.post(this.uploadUrl,i,{headers:{"Content-Type":"multipart/form-data"}}).then(o=>{var f;if(this.debugInfo.processedChunks++,this.debugInfo.lastChunkStatus="success",(f=o.data.data)!=null&&f.debug){const p=o.data.data.debug;typeof p.processed_chunks=="number"&&(this.debugInfo.processedChunks=p.processed_chunks),typeof p.silence_chunks=="number"&&(this.debugInfo.silenceChunks=p.silence_chunks),Array.isArray(p.failed_chunks)&&(this.debugInfo.failedChunks=p.failed_chunks)}const a=o.data.data||{},l=a.form_data||{},c=a.manual_overrides||{},h=this.clientMeetingTypeId,u=parseInt(this.selectedMeetingType,10);if(h!==null&&!Number.isNaN(u)&&u===h?(this.applyIncomingManualOverrides(c),this.updateClientForm(l)):(!this.currentFormData||Object.keys(this.currentFormData).length===0?this.currentFormData=l||{}:this.currentFormData=this.mergeLibreFormData(l,this.currentFormData),this.parseMeetingBlocks(this.currentFormData)),o.data.data.questions&&Array.isArray(o.data.data.questions)){this.widgetQuestions=o.data.data.questions.filter(m=>{const g=m.toLowerCase().trim();return!this.dismissedQuestions.some(y=>y.toLowerCase().trim()===g)});const p=localStorage.getItem("widgetState");this.widgetQuestions.length>0&&p!=="minimized"&&(this.widgetState="preview")}if(Object.prototype.hasOwnProperty.call(o.data.data,"recording_type")){const p=this.normalizeRecordingType(o.data.data.recording_type),m=JSON.stringify(this.recordingType)!==JSON.stringify(p);if(this.recordingType=p,m){const g=new Date().toLocaleTimeString("fr-FR");this.recordingTypeDebug=`✓ API extracted at ${g}`,setTimeout(()=>{this.recordingTypeDebug=""},5e3)}}o.data.data.title&&(this.meetingTitle=o.data.data.title),this.isPaused&&(this.audioStatus=trans("En pause")),this.meetingEnd&&!this.isSummarizing&&(this.isSummarizing=!0,this.summaryMeeting())}).catch(o=>{this.debugInfo.lastChunkStatus="failed",this.debugInfo.failedChunks.push({chunk:this.debugInfo.totalChunks,error:o.message||"Unknown error"}),o.status==403&&this.addToast("error",trans("The pack not include Meeting"))})},summaryMeeting:function(n=!1){if(console.log("summaryMeeting called",{meetingEnd:this.meetingEnd,summaryUrl:this.summaryUrl}),!this.meetingEnd)return!1;const i=new FormData;this.currentFormData&&i.append("current_form_data",JSON.stringify(this.currentFormData)),this.manualOverrides&&i.append("manual_overrides",JSON.stringify(this.manualOverrides)),this.removeFormDataPropertyFields&&i.append("removed_data",JSON.stringify(this.removeFormDataPropertyFields)),i.append("meeting_end",this.meetingEnd?1:0),axios.post(this.summaryUrl,i).then(s=>{if(s.data.data.meeting_status=="FINISHED")if(this.returnClientId){const o=this.clientShowUrl.replace("#ID#",this.returnClientId),a=new URL(o,window.location.origin);a.searchParams.set("meeting",this.meetingId),a.searchParams.set("generating","1"),window.location.href=a.toString()}else{const o=new URL(this.meetingReportUrl,window.location.origin);o.searchParams.set("generating","1"),window.location.href=o.toString()}}).catch(s=>{this.addToast("error","Internal server error"),this.isSummarizing=!1})},onCancelMeeting:function(){axios.delete(this.destroyMeetingUrl).then(n=>{this.cleanupAudioResources(),this.returnClientId?window.location.href=this.clientShowUrl.replace("#ID#",this.returnClientId):window.location.href=this.createMeetingUrl}).catch(n=>{this.addToast("error","Internal server error")})},renderTranscription(n){const i=n.split(/\r?\n/),s={},o=[{desktop:"text-blue-400",mobile:"text-blue-600"},{desktop:"text-green-400",mobile:"text-green-600"},{desktop:"text-yellow-400",mobile:"text-yellow-600"},{desktop:"text-purple-400",mobile:"text-purple-600"},{desktop:"text-pink-400",mobile:"text-pink-600"},{desktop:"text-cyan-400",mobile:"text-cyan-600"},{desktop:"text-orange-400",mobile:"text-orange-600"},{desktop:"text-red-400",mobile:"text-red-600"}];let a=0;const l=/^(\d{2}:\d{2}:\d{2})\s+([^:]+):\s*(.*)$/,c=/^(\d{2}:\d{2}:\d{2})\s+(.*)$/;
975this.transcriptHtml="",this.transcriptMobileHtml="",i.forEach(h=>{if(h){const u=h.match(l),d=h.match(c);if(u){const f=u[1],p=u[2].trim(),m=u[3];s[p]||(s[p]=o[a%o.length],a++);const g=s[p];this.transcriptHtml+=`
976                            <div class="px-3 py-1.5 rounded-lg bg-gray-700/50 backdrop-blur">
977                                <div class="flex items-start">
978                                    <p class="text-sm text-gray-300 leading-snug flex-1">
979                                        <span class="text-xs text-gray-500 mr-1">${f}</span>
980                                        <span class="font-semibold ${g.desktop}">${p}:</span>
981                                        ${m}
982                                    </p>
983                                </div>
984                            </div>
985                        `,this.transcriptMobileHtml+=`
986                            <div class="p-3 rounded-lg bg-gray-100 border border-gray-200">
987                                <div class="flex items-start">
988                                    <p class="text-xs text-gray-700 leading-relaxed flex-1">
989                                        <span class="text-[10px] text-gray-400 mr-1">${f}</span>
990                                        <span class="font-semibold ${g.mobile}">${p}:</span>
991                                        ${m}
992                                    </p>
993                                </div>
994                            </div>
995                        `}else if(d){const f=d[1],p=d[2];this.transcriptHtml+=`
996                            <div class="px-3 py-1.5 rounded-lg bg-gray-700/50 backdrop-blur">
997                                <div class="flex items-start">
998                                    <p class="text-sm text-gray-300 leading-snug flex-1">
999                                        <span class="text-xs text-gray-500 mr-1">${f}</span>
1000                                        ${p}
1001                                    </p>
1002                                </div>
1003                            </div>
1004                        `,this.transcriptMobileHtml+=`
1005                            <div class="p-3 rounded-lg bg-gray-100 border border-gray-200">
1006                                <div class="flex items-start">
1007                                    <p class="text-xs text-gray-700 leading-relaxed flex-1">
1008                                        <span class="text-[10px] text-gray-400 mr-1">${f}</span>
1009                                        ${p}
1010                                    </p>
1011                                </div>
1012                            </div>
1013                        `}else this.transcriptHtml+=`
1014                            <div class="px-3 py-1.5 rounded-lg bg-gray-700/50 backdrop-blur">
1015                                <div class="flex items-start">
1016                                    <p class="text-sm text-gray-300 leading-snug flex-1">${h}</p>
1017                                </div>
1018                            </div>
1019                        `,this.transcriptMobileHtml+=`
1020                            <div class="p-3 rounded-lg bg-gray-100 border border-gray-200">
1021                                <div class="flex items-start">
1022                                    <p class="text-xs text-gray-700 leading-relaxed flex-1">${h}</p>
1023                                </div>
1024                            </div>
1025                        `}}),setTimeout(()=>{const h=this.$refs.chatContainer,u=this.$refs.chatMobileContainer;h.scrollTop=h.scrollHeight,u.scrollTop=u.scrollHeight},100)},formatBulletList(n){return!n||typeof n!="string"?"":n.split(`
1026`).map(i=>{const s=i.trim();if(!s)return"";if(s.startsWith("•")){let o=s.substring(1).trim();o=this.escapeHtml(o),o=o.replace(/\(([^)]+)\)/g,'<span class="text-gray-500 italic text-sm">($1)</span>');const a=o.indexOf(":");if(a>0&&a<50){const l=o.substring(0,a),c=o.substring(a+1).trimStart();o=`<span class="font-semibold text-gray-800">${l}</span>${c?` : ${c}`:""}`}return`<div class="py-1.5 leading-relaxed text-gray-700">${o}</div>`}return`<div class="py-1 leading-relaxed text-gray-700">${this.escapeHtml(i)}</div>`}).join("")},normalizeEditableValue(n,i){if(i==null)return"";let s=typeof i=="string"?i:String(i);if(/<[^>]+>/.test(s)){s=s.replace(/<\/?div[^>]*>/gi,`
1027`).replace(/<br\s*\/?\s*>/gi,`
1028`);const l=document.createElement("div");l.innerHTML=s,s=l.textContent||l.innerText||""}return s=s.replace(/\u00a0/g," ").replace(/\r\n/g,`
1029`).split(`
1030`).map(l=>l.trim()).filter(l=>l.length>0).join(`
1031`),["Points clés","Points d'attention","Prochaines étapes","Sujets abordés"].includes(n)?s.split(`
1032`).map(h=>h.trim()).map(h=>h.startsWith("•")?h:`• ${h}`).join(`
1033`):s},renderForm(n){const i=parseInt(this.selectedMeetingType,10);this.clientMeetingTypeId!==null&&!Number.isNaN(i)&&i===this.clientMeetingTypeId&&(this.meetingFormDataHtml="",this.meetingFormDataMobileHtml="",this.updateClientForm(n||{}))},updateClientForm(n){const i=JSON.parse(JSON.stringify(n||{}));this.hydrateManualOverridesFromData(i),this.pendingClientFormData=i,this.$nextTick(()=>{const s=this.pendingClientFormData;if(!s||typeof s!="object")return;const o=this.withManualOverrides(s);this.currentFormData=o;const a=this.getClientFormContainers();if(!a.desktop&&!a.mobile){setTimeout(()=>{this.pendingClientFormData&&this.updateClientForm(this.pendingClientFormData)},50);return}this.applyClientForm(o,a)})},getClientFormContainers(){return{desktop:this.$refs.clientFormDesktop||document.querySelector("[data-client-form-desktop]"),mobile:this.$refs.clientFormMobile||document.querySelector("[data-client-form-mobile]")}},applyClientForm(n,i){if(this.clientMeetingTypeId===null)return;const s=this.meetingTemplates[this.clientMeetingTypeId]||{};Object.entries(s).sort(([,o],[,a])=>
1033(o.__priority??0)-(a.__priority??0)).forEach(([o,a])=>{const l=n[o]||{};this.applyClientDesktopSection(i.desktop,o,a,l),this.applyClientMobileSection(i.mobile,o,a,l)})},applyClientDesktopSection(n,i,s,o){if(!n)return;const a=Array.from(n.querySelectorAll("[data-section-label]")).find(l=>l.dataset.sectionLabel===i);a&&(this.applyClientSectionFields(a,s,o),s.__is_dynamic&&this.applyClientDynamicDesktop(a,i,s,o))},applyClientSectionFields(n,i,s){const o=n.dataset.sectionLabel;Object.keys(i).forEach(a=>{if(a.startsWith("__")||Array.isArray(i[a]))return;const l=n.querySelector(`[data-field-name="${this.escapeSelector(a)}"]`);if(!l||(l.dataset.sectionLabel=o,l.dataset.fieldName=a,this.currentEditingField&&this.currentEditingField.section===o&&this.currentEditingField.fieldName===a))return;const c=l.querySelector("[data-display-element]"),h=l.querySelector(".meeting-inputs"),u=l.querySelector(".slider-indicator"),d=l.querySelectorAll(".enum-slider-button");let f=s[a];f==null&&(f=i[a]??"");const p=this.getManualOverride(o,a);if(p&&Object.prototype.hasOwnProperty.call(p,"value")&&(f=p.value),f&&typeof f=="object"&&(f=JSON.stringify(f)),l.dataset.fieldValue=f??"",c){const m=this.formatBulletList(f||"");c.innerHTML=m||this.escapeHtml(f||"")}h&&(h.value=f??""),l.dataset.fieldType==="slider-group"&&this.updateClientSliderField(l,i,a,f,u,d),this.updateManualOverrideIndicator(l,p)})},updateClientSliderField(n,i,s,o,a,l){var x,S;const h=(i.__enum_fields||{})[s]||[];let u=0,d=!1;h.forEach((k,w)=>{(k.value??k)===o&&(u=w,d=!0)});const p=(n.dataset.section||n.dataset.sectionLabel||"")==="Profil d'investissement";!d&&h.length>0&&!p&&(o=h[0].value??"",u=0,n.dataset.fieldValue=o??"");const g=100/(h.length||1),y=n.querySelector(".relative.flex"),b=y&&y.classList.contains("flex-col");a&&!b&&(a.style.width=`calc(${g}% - 4px)`,a.style.left=`calc(${u*g}% + 4px)`,d?(a.classList.remove("opacity-0"),a.classList.add("opacity-100")):(a.classList.remove("opacity-100"),a.classList.add("opacity-0"))),l&&l.length&&((S=(x=l[0])==null?void 0:x.dataset)!=null&&S.color,b?l.forEach((k,w)=>{const _=d&&w===u;k.classList.remove("bg-white","text-[#1f3463]","shadow-md","bg-white/10","bg-transparent","text-white","text-white/80"),k.style.background="",k.style.color="",k.style.fontWeight="",k.style.textShadow="",k.style.border="",k.style.boxShadow="",_?k.classList.add("bg-white","text-[#1f3463]","shadow-md"):p?k.classList.add("bg-white/10","text-white"):k.classList.add("bg-transparent","text-white/80")}):l.forEach((k,w)=>{d&&w===u?(k.style.color="#1f3463",k.style.fontWeight="700",k.style.textShadow="none"):(k.style.color="rgba(255, 255, 255, 0.7)",k.style.fontWeight="600",k.style.textShadow="0 1px 2px rgba(0, 0, 0, 0.3)"),k.style.background="transparent",k.style.border="none",k.style.boxShadow="none"}))},applyClientDynamicDesktop(n,i,s,o){const a=n.querySelector('[data-dynamic-container="desktop"]');if(!a)return;const l=this.prepareDynamicItems(o),c=typeof trans=="function"?trans("Enregistrer"):"Enregistrer",h=typeof trans=="function"?trans("Annuler"):"Annuler";a.innerHTML=l.map(d=>this.buildDynamicItemHtml(i,d.fieldName,d.value,c,h)).join(""),a.querySelectorAll(".input-wrapper").forEach(d=>
1033{const f=d.dataset.fieldName||d.dataset.field,p=this.getManualOverride(i,f);this.updateManualOverrideIndicator(d,p)})},applyClientDynamicMobile(n,i,s,o){if(!n)return;const a=n.querySelector('[data-dynamic-container="mobile"]');if(!a)return;const l=this.prepareDynamicItems(o);a.innerHTML=l.map(c=>this.buildDynamicMobileItemHtml(i,c.fieldName,c.value)).join("")},prepareDynamicItems(n){const i=[];return Object.keys(n||{}).forEach(s=>{if(s.startsWith("__"))return;const o=n[s];if(Array.isArray(o)){o.forEach((l,c)=>{const h=this.normalizeDynamicValue(l);i.push({fieldName:`${s}[${c}]`,value:h||""})});return}const a=this.normalizeDynamicValue(o);i.push({fieldName:s,value:a||""})}),i},applyClientMobileSection(n,i,s,o){if(!n)return;const a=Array.from(n.querySelectorAll("[data-section-label]")).find(l=>l.dataset.sectionLabel===i);if(a&&(this.applyClientSectionFields(a,s,o),s.__is_dynamic)){const l=a.querySelector('[data-dynamic-container="mobile"]');if(l){const c=this.prepareDynamicItems(o),h=typeof trans=="function"?trans("Enregistrer"):"Enregistrer",u=typeof trans=="function"?trans("Annuler"):"Annuler";l.innerHTML=c.map(f=>this.buildDynamicItemHtml(i,f.fieldName,f.value,h,u)).join(""),l.querySelectorAll(".input-wrapper").forEach(f=>{const p=f.dataset.fieldName||f.dataset.field,m=this.getManualOverride(i,p);this.updateManualOverrideIndicator(f,m)})}}},escapeSelector(n){return typeof CSS<"u"&&CSS.escape?CSS.escape(n):(n||"").replace(/([\.\\\[\]\(\)\^\$\*\+\?\|\{\}\-])/g,"\\$1")},getManualOverride(n,i){var s,o;return((o=(s=this.manualOverrides)==null?void 0:s[n])==null?void 0:o[i])??null},setManualOverride(n,i,s){if(!n||!i)return;this.manualOverrides[n]||(this.manualOverrides[n]={});const o=this.manualOverrides[n][i]||{};this.manualOverrides[n][i]={...o,value:s,timestamp:Date.now()},this.syncSectionManualOverrideMetadata(n)},normalizeManualOverrides(n){const i={};return!n||typeof n!="object"||Object.entries(n).forEach(([s,o])=>{if(!o||typeof o!="object")return;const a={};Object.entries(o).forEach(([l,c])=>{if(c!==void 0){if(c===null){a[l]=null;return}typeof c=="object"?a[l]={...c}:a[l]={value:c,timestamp:null}}}),i[s]=a}),i},applyIncomingManualOverrides(n){const i=this.normalizeManualOverrides(n);if(!Object.values(i).some(a=>Object.keys(a||{}).length>0))return;if(!this.manualOverrides||Object.keys(this.manualOverrides).length===0){this.manualOverrides=JSON.parse(JSON.stringify(i));return}const o=JSON.parse(JSON.stringify(this.manualOverrides));Object.entries(i).forEach(([a,l])=>{if(!l||Object.keys(l).length===0){delete o[a];return}o[a]||(o[a]={}),Object.entries(l).forEach(([c,h])=>{h===null?delete o[a][c]:o[a][c]={...h}}),Object.keys(o[a]).length===0&&delete o[a]}),this.manualOverrides=o},clearManualOverride(n,i){!n||!i||this.manualOverrides[n]&&(delete this.manualOverrides[n][i],Object.keys(this.manualOverrides[n]).length===0&&delete this.manualOverrides[n],this.syncSectionManualOverrideMetadata(n))},syncSectionManualOverrideMetadata(n){if(!this.currentFormData||!this.currentFormData[n])return;const i=this.manualOverrides[n];i&&Object.keys(i).length>0?this.currentFormData[n].__manual_overrides=JSON.parse(JSON.stringify(i)):this.currentFormData[n].__manual_overrides&&delete this.currentFormData[n].__manual_overrides},hydrateManualOverridesFromData(n){if(!n)return;const i={};Object.entries(n).forEach(([s,o])=>{!o||typeof o!="object"||o.__manual_overrides&&typeof o.__manual_overrides=="object"&&(i[s]=JSON.parse(JSON.stringify(o.__manual_overrides)),delete o.__manual_overrides)}),Object.keys(i).length>0&&this.applyIncomingManualOverrides(i)},withManualOverrides(n){const i=JSON.parse(JSON.stringify(n||{}));return Object.entries(i).forEach(([s,o])=>{o&&typeof o=="object"&&o.__manual_overrides&&delete o.__manual_overrides}),Object.entries(this.manualOverrides||{}).forEach(([s,o])=>{i[s]||(i[s]={}),Object.entries(o||{}).forEach(([a,l])=>{l&&Object.prototype.hasOwnProperty.call(l,"value")&&(i[s][a]=l.value)}),o&&Object.keys(o).length>0&&(i[s].__manual_overrides=JSON.parse(JSON.stringify(o)))}),i},updateManualOverrideIndicator(n,i){if(!n)return;n.classList.remove("manual-override-active"),delete n.dataset.manualOverride;const s=n.querySelector(".manual-override-indicator");s&&s.remove()},persistMeetingFormData(){if(!this.meetingUpdateUrl)return Promise.resolve();const n=new FormData;return n.append("form_data",JSON.stringify(this.currentFormData)),n.append("manual_overrides",JSON.stringify(this.manualOverrides)),n.append("_method","PUT"),axios.post(this.meetingUpdateUrl,n,{})},buildDynamicItemHtml(n,i,s,o,a){const l=this.formatBulletList(s)||this.escapeHtml(s).replace(/\n/g,"<br>");return`
1034                <div class="group relative mb-3 flex items-center gap-2">
1035                    <div class="relative input-wrapper flex-1"
1036                         data-section="${this.escapeAttribute(n)}"
1037                         data-section-label="${this.escapeAttribute(n)}"
1038                         data-field-name="${this.escapeAttribute(i)}"
1039                         data-field-type="dynamic"
1040                         data-field-value="${this.escapeAttribute(s)}"
1041                    >
1042                        <div class="editable-content flex text-sm text-gray-900 editable-field cursor-pointer items-center rounded-xl px-3 py-2.5 hover:bg-blue-50/50 border border-transparent hover:border-blue-100 transition-all">
1043                            <div class="flex-1 leading-relaxed" data-display-element>${l||'<span class="text-gray-400 italic">Non renseigné</span>'}</div>
1044                            <svg class="w-4 h-4 text-[#1f3463]/40 edit-icon ml-2 flex-shrink-0 opacity-0 group-hover:opacity-100 transition-opacity" fill="none" stroke="currentColor" viewBox="0 0 24 24">
1045                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"></path>
1046                            </svg>
1047                        </div>
1048                        <div class="editable-input hidden">
1049                            <div class="bg-blue-50/30 border-blue-200 rounded-xl border p-3">
1050                                <textarea class="meeting-inputs w-full bg-white border border-gray-200 rounded-lg px-3 py-2 focus:ring-2 focus:ring-[#1f3463]/20 focus:border-[#1f3463] focus:outline-none text-sm text-gray-900 placeholder-gray-400 resize-none" rows="3">${this.escapeHtml(s)}</textarea>
1051                                <div class="flex items-center gap-2 mt-3">
1052                                    <button class="save-input-btn flex items-center gap-2 px-4 py-2 bg-gradient-to-r from-[#1f3463] to-[#2a4172] text-white hover:from-[#23407a] hover:to-[#2f4a82] rounded-xl text-sm font-medium transition-all shadow-sm">
1053                                        <svg xmlns="http://www.w3.org/2000/svg" class="w-4 h-4" viewBox="0 0 20 20" fill="currentColor">
1054                                            <path fill-rule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-7.5 7.5a1 1 0 01-1.414 0l-3.5-3.5a1 1 0 111.414-1.414L8 11.086l6.793-6.793a1 1 0 011.414 0z" clip-rule="evenodd"></path>
1055                                        </svg>
1056                                        ${o}
1057                                    </button>
1058                                    <button class="cancel-input-btn px-4 py-2 text-gray-600 hover:text-gray-900 hover:bg-gray-100 text-sm rounded-xl transition-all">
1059                                        ${a}
1060                                    </button>
1061                                </div>
1062                            </div>
1063                        </div>
1064                    </div>
1065                    <div class="remove-form-property-btn opacity-0 group-hover:opacity-100 transition-opacity cursor-pointer flex-shrink-0"
1066                         data-property-name="${this.escapeAttribute(i)}"
1067                         data-section-name="${this.escapeAttribute(n)}">
1068                        <div class="bg-red-50 hover:bg-red-100 rounded-full p-1.5 
1068shadow-sm">
1069                            <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" class="w-4 h-4 text-red-500">
1070                                <path stroke-linecap="round" stroke-linejoin="round" d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0"></path>
1071                            </svg>
1072                        </div>
1073                    </div>
1074                </div>
1075            `},buildDynamicMobileItemHtml(n,i,s){const o=this.escapeHtml(s).replace(/\n/g,"<br>");return`<div class="text-gray-900" data-section="${this.escapeAttribute(n)}" data-field-name="${this.escapeAttribute(i)}">${o}</div>`},normalizeDynamicValue(n){if(n==null)return"";if(typeof n=="string"||typeof n=="number"||typeof n=="boolean")return String(n).trim();if(Array.isArray(n))return n.map(i=>typeof i=="string"?i:JSON.stringify(i)).join(`
1076`).trim();if(typeof n=="object"){const i=n.value??n.label??"";return String(i).trim()}return""},escapeHtml(n){return n==null?"":String(n).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")},escapeAttribute(n){return n==null?"":String(n).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/\n/g,"&#10;").replace(/\r/g,"&#13;")},handleAddDynamicField:function(n,i){n.previousElementSibling;const s=this.currentFormData[i],o=s.__dynamic_field_prefix,a=Object.keys(s).filter(c=>!c.startsWith("__")).length,l=o+" "+(a+1);this.currentFormData[i][l]="",this.renderForm(this.currentFormData)},handleRemoveDynamicItem:function(n,i,s,o){var a,l,c,h,u;if((l=(a=this.currentFormData)==null?void 0:a[i])!=null&&l[s]&&Array.isArray(this.currentFormData[i][s])){this.currentFormData[i][s].splice(o,1),(c=this.manualOverrides)!=null&&c[i]&&(Object.keys(this.manualOverrides[i]).forEach(d=>{d.startsWith(`${s}[`)&&delete this.manualOverrides[i][d]}),Object.keys(this.manualOverrides[i]).length===0&&delete this.manualOverrides[i],this.syncSectionManualOverrideMetadata(i)),this.renderForm(this.currentFormData),this.persistMeetingFormData();return}((u=(h=this.currentFormData)==null?void 0:h[i])==null?void 0:u[s])!==void 0&&(delete this.currentFormData[i][s],this.clearManualOverride(i,s),this.renderForm(this.currentFormData),this.persistMeetingFormData())},updateEnumSliderField:function(n,i,s,o,a,l,c){const h=n.closest(".input-wrapper");this.currentFormData[i][s]=o,h&&(h.dataset.fieldValue=o??""),this.clientMeetingTypeId!==null&&String(this.selectedMeetingType)===String(this.clientMeetingTypeId)&&(this.setManualOverride(i,s,o),this.updateManualOverrideIndicator(h,this.getManualOverride(i,s)));const d=h.querySelector(".relative.flex"),f=d&&d.classList.contains("flex-col"),p=i==="Profil d'investissement";if(f)h&&h.querySelectorAll(".enum-slider-button").forEach(g=>{g.classList.remove("bg-white","text-[#1f3463]","shadow-md"),p?g.classList.add("bg-white/10","text-white"):g.classList.add("bg-transparent","text-white/80"),g.style.background="",g.style.color="",g.style.fontWeight="",g.style.textShadow="",g.style.boxShadow=""}),n.classList.remove("bg-white/10","bg-transparent","text-white","text-white/80"),n.classList.add("bg-white","text-[#1f3463]","shadow-md");else{h&&h.querySelectorAll(".enum-slider-button").forEach(y=>{y.style.background="transparent",y.style.color="rgba(255, 255, 255, 0.7)",y.style.border="none",y.style.boxShadow="none",y.style.fontWeight="600",y.style.textShadow="0 1px 2px rgba(0, 0, 0, 0.3)"}),n.style.background="transparent",n.style.color="#1f3463",n.style.border="none",n.style.boxShadow="none",n.style.fontWeight="700",n.style.textShadow="none";const m=h.querySelector(".relative.flex.items-center");if(m){const g=m.querySelector(".slider-indicator"),y=h.querySelectorAll(".enum-slider-button"),b=Array.from(y).indexOf(n);if(g&&b>=0){const S=100/y.length,k=b*S;g.classList.remove("opacity-0"),g.classList.add("opacity-100"),g.style.left=`${k}%`,g.style.width=`calc(${S}% - 0.5rem)`,g.style.background="linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.95) 100%)",g.style.boxShadow="0 2px 8px rgba(0, 0, 0, 0.15), 0 4px 16px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 1), inset 0 -1px 0 rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(255, 255, 255, 0.4)"}}}this.persistMeetingFormData()},updateEnumField:function(n,i,s,o,a){this.currentFormData[i][s]=o;const l=n.closest(".input-wrapper");
1076l&&(l.dataset.fieldValue=o??""),this.clientMeetingTypeId!==null&&String(this.selectedMeetingType)===String(this.clientMeetingTypeId)&&(this.setManualOverride(i,s,o),this.updateManualOverrideIndicator(l,this.getManualOverride(i,s))),l&&l.querySelectorAll(".enum-button").forEach(u=>{u.classList.remove("bg-blue-600","border-blue-600","text-white","shadow-lg","hover:bg-blue-700","hover:border-blue-700"),u.classList.add("bg-white","border-gray-300","text-gray-700","hover:border-blue-500","hover:text-blue-600")}),n.classList.remove("bg-white","border-gray-300","text-gray-700","hover:border-blue-500","hover:text-blue-600"),n.classList.add("bg-blue-600","border-blue-600","text-white","shadow-lg","hover:bg-blue-700","hover:border-blue-700"),this.persistMeetingFormData()},deleteQuestion(n){if(n>=0&&n<this.widgetQuestions.length){const i=this.widgetQuestions[n];this.dismissedQuestions.push(i),this.widgetQuestions.splice(n,1);const s=new FormData;s.append("dismissed_questions",JSON.stringify(this.dismissedQuestions)),s.append("_method","PUT"),axios.post(this.meetingUpdateUrl,s),this.widgetIndex>=this.widgetQuestions.length&&this.widgetQuestions.length>0&&(this.widgetIndex=this.widgetQuestions.length-1),this.widgetQuestions.length===0&&(this.widgetState="minimized")}},handleRemoveFormProperty:function(n){var l,c,h,u,d,f,p;const i=n.dataset.propertyName,s=n.dataset.sectionName;this.removeFormDataPropertyFields||(this.removeFormDataPropertyFields={}),this.removeFormDataPropertyFields[s]||(this.removeFormDataPropertyFields[s]={}),i?(this.clearManualOverride(s,i),this.removeFormDataPropertyFields[s][i]=(c=(l=this.currentFormData)==null?void 0:l[s])==null?void 0:c[i],((u=(h=this.currentFormData)==null?void 0:h[s])==null?void 0:u[i])!==void 0&&delete this.currentFormData[s][i]):((d=this.manualOverrides)!=null&&d[s]&&delete this.manualOverrides[s],this.removeFormDataPropertyFields[s]=(f=this.currentFormData)==null?void 0:f[s],((p=this.currentFormData)==null?void 0:p[s])!==void 0&&delete this.currentFormData[s]);const o=["__color","__icon","__layout","__priority"];Object.keys(this.currentFormData[s]||{}).filter(m=>!o.includes(m)).length===0&&delete this.currentFormData[s],this.renderForm(this.currentFormData),this.persistMeetingFormData()},handleFormEvents(){document.addEventListener("click",n=>{var u,d;if(n.target.classList.contains("enum-slider-button")){const f=n.target,p=f.dataset.section,m=f.dataset.field,g=f.dataset.value,y=f.dataset.label,b=parseInt(f.dataset.index),x=f.dataset.color;this.updateEnumSliderField(f,p,m,g,y,b,x);return}if(n.target.classList.contains("enum-button")){const f=n.target,p=f.dataset.section,m=f.dataset.field,g=f.dataset.value,y=f.dataset.label;this.updateEnumField(f,p,m,g,y);return}const i=n.target.closest(".remove-form-property-btn");if(i){const f=i.dataset.propertyName||"",p=i.dataset.sectionName||((u=i.closest(".input-wrapper"))==null?void 0:u.dataset.section)||((d=i.closest("[data-section]"))==null?void 0:d.dataset.section),m=f.match(/^([^\[]+)\[(\d+)\]$/);if(m){const[,g,y]=m;this.handleRemoveDynamicItem(i,p,g,parseInt(y,10))}else this.handleRemoveFormProperty(i);return}const s=n.target.closest(".input-wrapper");if(s){const f=s.querySelector(".editable-input"),p=s.querySelector(".editable-content");if(p&&f&&p.classList.contains("editable-field")){p.classList.add("hidden"),f.classList.remove("hidden"),s.querySelector(".meeting-inputs").focus();const m=s.getAttribute("data-section-label")||s.getAttribute("data-section"),g=s.getAttribute("data-field-name")||s.getAttribute("data-field");this.currentEditingField={section:m,fieldName:g}}}if(n.target.closest(".save-input-btn")){const f=n.target.closest(".input-wrapper"),p=f.querySelector(".editable-input");f.querySelector(".editable-content").classList.remove("hidden"),p.classList.add("hidden"),this.currentEditingField=null,this.updateFormData(f)}if(n.target.closest(".cancel-input-btn")){const f=n.target.closest(".input-wrapper"),p=f.getAttribute("data-field-value"),m=f.querySelector(".meeting-inputs");m.value=p;const g=f.querySelector(".editable-input");f.querySelector(".editable-content").classList.remove("hidden"),g.classList.add("hidden"),this.currentEditingField=null}
1076const l=n.target.closest(".toggle-btn-milkdown-meeting");if(l){const f=l.getAttribute("data-milkdown-element-id"),p=l.closest(".meeting-form-milkdown"),m=document.getElementById(`milkdown-view-mode-btn-${f}`),g=document.getElementById(`milkdown-edit-mode-btn-${f}`);p.classList.remove("disabled"),this.crepeForms[f].setReadonly(!1),m&&m.classList.remove("hidden"),g&&g.classList.add("hidden")}const c=n.target.closest(".toggle-btn-view-milkdown-meeting");if(c){const f=c.getAttribute("data-milkdown-element-id"),p=document.getElementById(`milkdown-view-mode-btn-${f}`),m=document.getElementById(`milkdown-edit-mode-btn-${f}`);s.classList.add("disabled"),this.crepeForms[f].setReadonly(!0),p&&p.classList.add("hidden"),m&&m.classList.remove("hidden")}const h=n.target.closest(".toggle-btn-milkdown-meeting-mobile");if(h){const f=h.getAttribute("data-milkdown-element-id"),p=h.closest(".meeting-form-milkdown"),m=p.querySelector(".toggle-btn-milkdown-meeting-mobile span");p.classList.contains("disabled")?(this.crepeForms[f].setReadonly(!1),p.classList.remove("disabled"),m.textContent=trans("Quitter l'édition")):(this.crepeForms[f].setReadonly(!0),p.classList.add("disabled"),m.textContent=trans("Editer le contenu"),this.meetingEnd&&this.summaryMeeting(!0))}})},updateFormData(n){var f,p,m,g,y;let i=n.querySelector(".meeting-inputs");if(!i)return;const s=n.getAttribute("data-field-type"),o=n.getAttribute("data-section-label")||n.getAttribute("data-section"),a=n.getAttribute("data-field-name")||n.getAttribute("data-field");let l;s==="radio"?(i=n.querySelector(".meeting-inputs:checked"),l=i?i.value:""):i.type==="checkbox"?l=i.checked?i.value:"":l=i.value;const c=n.querySelector(".input-placeholder");c&&(c.textContent=l);const h=n.querySelector("[data-display-element]");if(h){const b=this.formatBulletList(l||"");h.innerHTML=b||this.escapeHtml(l||"").replace(/\n/g,"<br>")}if(n.setAttribute("data-field-value",l),!o||!a)return;const u=n.getAttribute("data-field-name")||a;if(a.includes("[")&&a.includes("]")){let b=a.match(/^([^\[]+)\[(\d+)\]\.(\w+)$/);if(b){const[,x,S,k]=b,w=parseInt(S,10);(p=(f=this.currentFormData)==null?void 0:f[o])!=null&&p[x]&&Array.isArray(this.currentFormData[o][x])&&this.currentFormData[o][x][w]&&(this.currentFormData[o][x][w][k]=l)}else if(b=a.match(/^([^\[]+)\[(\d+)\]$/),b){const[,x,S]=b,k=parseInt(S,10);(g=(m=this.currentFormData)==null?void 0:m[o])!=null&&g[x]&&Array.isArray(this.currentFormData[o][x])&&(typeof this.currentFormData[o][x][k]=="object"?this.currentFormData[o][x][k].value=l:this.currentFormData[o][x][k]=l)}}else(y=this.currentFormData)!=null&&y[o]&&(this.currentFormData[o][a]=l);const d=this.clientMeetingTypeId!==null&&String(this.selectedMeetingType)===String(this.clientMeetingTypeId);if(d&&(this.setManualOverride(o,u,l),this.updateManualOverrideIndicator(n,this.getManualOverride(o,u))),d&&typeof this.getClientFormContainers=="function"){const b=this.getClientFormContainers();(b.desktop||b.mobile)&&this.applyClientForm(this.currentFormData,b)}this.persistMeetingFormData()},startResize(n){this.isResizing=!0,this.startX=n.clientX,this.startWidth=this.menuWidth,document.body.style.userSelect="none",document.body.style.cursor="ew-resize",document.addEventListener("mousemove",this.handleMouseMove.bind(this)),document.addEventListener("mouseup",this.stopResize.bind(this))},handleMouseMove(n){if(!this.isResizing)return;const i=window.innerWidth,o=(this.startX-n.clientX)/i*100,a=this.startWidth+o;this.menuWidth=Math.max(this.minWidth,Math.min(this.maxWidth,a)),window.dispatchEvent(new CustomEvent("rightMenuResize",{detail:{width:this.menuWidth}}))},stopResize(){this.isResizing&&(this.isResizing=!1,document.body.style.userSelect="",document.body.style.cursor="",localStorage.setItem("rightMenuWidth",this.menuWidth.toString()),document.removeEventListener("mousemove",this.handleMouseMove.bind(this)),document.removeEventListener("mouseup",this.stopResize.bind(this)))}}};window.meetingReport=function(){return{menuWidth:20,isResizing:!1,startX:0,startWidth:0,minWidth:20,maxWidth:50,rightMenuWidth:20,showRightMenu:!1,currentView:"report",selectedMeetingType:null,clientMeetingTypeId:null,currentMeetingTemplateEnums:{},crepeForms:{}
1076,currentFormData:null,meetingUpdateUrl:null,csrfToken:null,showEditModal:!1,editModalContent:"",editModalSection:"",editModalField:"",editModalWrapper:null,meetingFormDataMobileHtml:"",meetingFormDataHtml:"",transcript:"",transcriptHtml:"",buildSafeMailto:function(t,e,r){let i=encodeURIComponent(e),s=encodeURIComponent(r),o=`mailto:${t}?subject=${i}&body=`,a=1e4-o.length;if(s.length>a){let l=r.slice(0,Math.floor(a/3));const c=l.lastIndexOf("."),h=l.lastIndexOf(`
1077
1078`),u=Math.max(c,h);u>l.length*.7&&(l=l.substring(0,u+1)),l+=`
1079
1080[...]
1081
1082Le compte-rendu complet est disponible dans l'application.`,s=encodeURIComponent(l)}return`${o}${s}`},formatDisplayValue:function(t){return!t||t===""?'<span class="text-gray-400 italic">Non renseigné</span>':typeof t=="string"&&t.includes("•")?this.formatBulletList(t):t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;").replace(/\n/g,"<br>")},escapeHtml:function(t){return t?t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;"):""},init:function(){this.loadFormData(),window.addEventListener("transcript-updated",t=>{t.detail&&t.detail.transcript&&(this.transcript=t.detail.transcript,this.renderTranscription(this.transcript))}),document.addEventListener("livewire:navigated",()=>{this.loadFormData()}),window.addEventListener("summary-completed",()=>{setTimeout(()=>{this.loadFormData()},100)}),typeof Livewire<"u"&&Livewire.hook("morph.updated",({el:t})=>{(t===this.$el||this.$el.contains(t)||t.contains(this.$el))&&this.loadFormData()}),window.addEventListener("send-mail",t=>{try{const{to:e,subject:r,body:n}=t.detail[0];window.location.href=this.buildSafeMailto(e,r,n)}catch{}}),document.readyState==="loading"&&document.addEventListener("DOMContentLoaded",()=>{setTimeout(()=>this.loadFormData(),100)}),this.initMenuHandlers()},loadFormData:function(){var n,i;const t=this.$el.getAttribute("data-form-data")||"{}";this.currentFormData=JSON.parse(t),this.selectedMeetingType=this.$el.getAttribute("data-selected-meeting"),this.clientMeetingTypeId=this.$el.getAttribute("data-client-meeting-type-id");const e=this.$el.getAttribute("data-meeting-template-enums")||"{}";this.meetingTemplateEnums=JSON.parse(e),this.currentMeetingTemplateEnums=((n=this.meetingTemplateEnums)==null?void 0:n[this.selectedMeetingType])||{},this.meetingUpdateUrl=this.$el.getAttribute("data-meeting-update-url"),this.csrfToken=((i=document.querySelector('meta[name="csrf-token"]'))==null?void 0:i.getAttribute("content"))||null,this.transcript=this.$el.getAttribute("data-transcript")||"",this.transcript&&this.renderTranscription(this.transcript),(!this.currentFormData||typeof this.currentFormData!="object")&&(this.currentFormData={});const r=Object.entries(this.currentFormData).sort(([,s],[,o])=>((s==null?void 0:s.__priority)??0)-((o==null?void 0:o.__priority)??0));this.currentFormData=Object.fromEntries(r),this.selectedMeetingType!=this.clientMeetingTypeId&&this.renderForm(this.currentFormData)},initMenuHandlers:function(){window.addEventListener("storage",t=>{t.key==="rightMenuWidth"&&t.newValue&&(this.rightMenuWidth=parseFloat(t.newValue))}),window.addEventListener("rightMenuResize",t=>{t.detail&&t.detail.width&&(this.rightMenuWidth=t.detail.width)}),window.innerWidth<1024?(this.showRightMenu=!1,setTimeout(()=>{window.innerWidth<1024&&this.showRightMenu&&(this.showRightMenu=!1)},100)):this.showRightMenu=!0,this.$watch("showRightMenu",t=>{window.dispatchEvent(new CustomEvent("rightMenuChanged",{detail:{showRightMenu:this.showRightMenu}}))}),this.setupEditHandlers()},setupEditHandlers(){document.addEventListener("click",t=>{const e=t.target.closest(".edit-block-btn");if(e){const s=e.getAttribute("data-section"),o=e.getAttribute("data-field"),a=e.closest(".relative").querySelector(".section-inputs"),l=a==null?void 0:a.querySelector(`.input-wrapper[data-section="${s}"][data-field="${o}"]`);l&&this.selectedMeetingType!=this.clientMeetingTypeId&&this.openEditModal(l);return}const r=t.target.closest(".input-wrapper");if(r){const s=r.querySelector(".editable-content");s&&s.classList.contains("editable-field")&&!t.target.closest(".save-input-btn")&&!t.target.closest(".cancel-input-btn")&&(this.selectedMeetingType==this.clientMeetingTypeId?this.activateInlineEdit(r):this.openEditModal(r))}if(t.target.closest(".save-input-btn")){const s=t.target.closest("[data-field-group]");s&&this.saveInlineEdit(s)}if(t.target.closest(".cancel-input-btn")){const s=t.target.closest("[data-field-group]");s&&this.cancelInlineEdit(s)}})},activateInlineEdit(t){const e=t.querySelector(".editable-input"),r=t.querySelector(".editable-content");
1082if(r&&e){r.classList.add("hidden"),e.classList.remove("hidden");const n=e.querySelector("input, textarea, select");n&&(n.focus(),(n.tagName==="INPUT"||n.tagName==="TEXTAREA")&&n.setSelectionRange(n.value.length,n.value.length))}},cancelInlineEdit(t){const e=t.querySelector(".editable-input"),r=t.querySelector(".editable-content"),n=e==null?void 0:e.querySelector("input, textarea, select");if(n&&t.hasAttribute("data-field-value")){const i=t.getAttribute("data-field-value");n.value=i}r&&e&&(r.classList.remove("hidden"),e.classList.add("hidden"))},saveInlineEdit(t){const e=t.querySelector(".editable-input"),r=t.querySelector(".editable-content"),n=e==null?void 0:e.querySelector("input, textarea, select");if(!n)return;const i=n.value,s=t.querySelector(".input-wrapper"),o=(s==null?void 0:s.getAttribute("data-section"))||t.getAttribute("data-section"),a=t.getAttribute("data-field-group"),l=r==null?void 0:r.querySelector("[data-display-element]");l&&(l.innerHTML=i?i.replace(/\n/g,"<br>"):'<span class="text-gray-400 italic">Non renseigné</span>'),t.setAttribute("data-field-value",i),r&&e&&(r.classList.remove("hidden"),e.classList.add("hidden")),this.meetingUpdateUrl&&this.updateFieldOnServer(o,a,i)},updateFieldOnServer(t,e,r){this.updateFormDataValue(t,e,r),fetch(this.meetingUpdateUrl,{method:"PUT",headers:{"Content-Type":"application/json","X-CSRF-TOKEN":this.csrfToken,Accept:"application/json"},body:JSON.stringify({form_data:JSON.stringify(this.currentFormData)})}).then(n=>n.json()).then(n=>{n.success||console.error("Failed to update meeting data")}).catch(n=>{console.error("Error updating meeting data:",n)})},openEditModal(t){this.editModalWrapper=t,this.editModalSection=t.getAttribute("data-section"),this.editModalField=t.getAttribute("data-field"),this.editModalContent=t.getAttribute("data-field-value"),this.showEditModal=!0,this.$nextTick(()=>{const e=this.$refs.editModalTextarea;e&&(e.focus(),e.setSelectionRange(e.value.length,e.value.length))})},closeEditModal(){this.showEditModal=!1,this.editModalContent="",this.editModalSection="",this.editModalField="",this.editModalWrapper=null},updateFormDataValue(t,e,r){var s;if(!t||!e||!((s=this.currentFormData)!=null&&s[t]))return;const n=this.currentFormData[t],i=e.match(/^([^\[]+)\[(\d+)\]$/);if(i){const[,o,a]=i,l=parseInt(a,10),c=n[o];if(!Array.isArray(c)||Number.isNaN(l)||l<0||l>=c.length)return;const h=c[l];if(typeof h=="string")c[l]=r;else if(h&&typeof h=="object"){const u={...h};Object.prototype.hasOwnProperty.call(u,"value")?u.value=r:Object.prototype.hasOwnProperty.call(u,"label")?u.label=r:u.text=r,c[l]=u}else c[l]=r;return}n[e]=r},saveEditModal(){if(!this.editModalWrapper)return;this.updateFormDataValue(this.editModalSection,this.editModalField,this.editModalContent),this.editModalWrapper.setAttribute("data-field-value",this.editModalContent);const t=this.formatBulletList(this.editModalContent),e=this.editModalWrapper.querySelector(".editable-content .flex-1");e&&(e.innerHTML=t);const r=this.$el.getAttribute("data-meeting-id"),n=this.meetingUpdateUrl||`/meetings/${r}`,i=new FormData;i.append("form_data",JSON.stringify(this.currentFormData)),i.append("_method","PUT"),this.csrfToken&&i.append("_token",this.csrfToken),axios.post(n,i).then(()=>{this.closeEditModal()}).catch(s=>{var c;const o=(c=s==null?void 0:s.response)==null?void 0:c.data,a=(o==null?void 0:o.message)||(o==null?void 0:o.errors)||(o==null?void 0:o.error);let l="Erreur lors de la sauvegarde";if(a){if(typeof a=="string")l=a;else if(Array.isArray(a))l=a.join(`
1083`);else if(typeof a=="object"){const h=Object.values(a).reduce((u,d)=>Array.isArray(d)?u.concat(d.filter(Boolean)):(d&&u.push(d),u),[]);h.length&&(l=h.join(`
1084`))}}alert(l)})},addBulletPoint(){this.editModalContent&&!this.editModalContent.endsWith(`
1085`)&&(this.editModalContent+=`
1086`),this.editModalContent+="• ",this.$nextTick(()=>{const t=this.$refs.editModalTextarea;t&&(t.focus(),t.setSelectionRange(t.value.length,t.value.length))})},startResize(t){this.isResizing=!0,this.startX=t.clientX,this.startWidth=this.menuWidth,document.body.style.userSelect="none",document.body.style.cursor="ew-resize",document.addEventListener("mousemove",this.handleMouseMove.bind(this)),document.addEventListener("mouseup",this.stopResize.bind(this))},handleMouseMove(t){if(!this.isResizing)return;const e=window.innerWidth,n=(this.startX-t.clientX)/e*100,i=this.startWidth+n;this.menuWidth=Math.max(this.minWidth,Math.min(this.maxWidth,i)),window.dispatchEvent(new CustomEvent("rightMenuResize",{detail:{width:this.menuWidth}}))},stopResize(){this.isResizing&&(this.isResizing=!1,document.body.style.userSelect="",document.body.style.cursor="",localStorage.setItem("rightMenuWidth",this.menuWidth.toString()),document.removeEventListener("mousemove",this.handleMouseMove.bind(this)),document.removeEventListener("mouseup",this.stopResize.bind(this)))},formatBulletList(t){return!t||typeof t!="string"?"":t.split(`
1087`).map(e=>{if(e.trim().startsWith("•")){let r=e.trim().substring(1).trim();r=r.replace(/\(([^)]+)\)/g,'<span class="text-gray-500 italic text-sm">($1)</span>');const n=r.indexOf(":");if(n>0&&n<50){const i=r.substring(0,n),s=r.substring(n);r=`<span class="font-semibold text-gray-800">${i}</span>${s}`}return`<div class="py-1.5 leading-relaxed text-gray-700">${r}</div>`}return e}).join("")},renderTranscription(t){if(!t||typeof t!="string"){this.transcriptHtml="";return}const e={},r=["bg-blue-500/80","bg-emerald-500/80","bg-purple-500/80","bg-orange-500/80","bg-pink-500/80","bg-cyan-500/80","bg-amber-500/80","bg-indigo-500/80"];let n=0;
1087if(/\[([^\]]+)\]/.test(t)){const u=[],d=t.split(/\[([^\]]+)\]\s*/);let f=null;for(let m=0;m<d.length;m++){const g=d[m].trim();g&&(g.length<50&&!g.includes(`
1088`)&&m+1<d.length?(f=g,e[f]||(e[f]=r[n%r.length],n++)):f?(u.push({speaker:f,text:g}),f=null):u.push({speaker:null,text:g}))}let p="";u.forEach(m=>{if(m.speaker){const g=e[m.speaker];p+=`<div class="px-3 py-2 rounded-lg bg-white/10 mb-2">
1089                            <div class="flex items-start gap-2">
1090                                <span class="inline-flex items-center px-2 py-0.5 rounded-full text-xs font-semibold flex-shrink-0 mt-0.5 ${g} text-white">${this.escapeHtml(m.speaker)}</span>
1091                                <p class="text-sm text-white/90 leading-relaxed flex-1">${this.escapeHtml(m.text)}</p>
1092                            </div>
1093                        </div>`}else p+=`<div class="px-3 py-2 rounded-lg bg-white/10 mb-2">
1094                            <p class="text-sm text-white/90 leading-relaxed">${this.escapeHtml(m.text)}</p>
1095                        </div>`}),this.transcriptHtml=p;return}const o=t.split(/\r?\n/),a=["text-blue-400","text-green-400","text-yellow-400","text-purple-400","text-pink-400","text-cyan-400","text-orange-400","text-red-400"],l=/^(\d{2}:\d{2}:\d{2})\s+([^:]+):\s*(.*)$/,c=/^(\d{2}:\d{2}:\d{2})\s+(.*)$/;let h="";o.forEach(u=>{if(!u.trim())return;const d=u.match(l),f=u.match(c);if(d){const p=d[1],m=d[2].trim(),g=this.escapeHtml(d[3]);e[m]||(e[m]=a[n%a.length],n++);const y=e[m];h+=`<div class="px-3 py-1.5 rounded-lg bg-gray-700/50">
1096                        <p class="text-sm text-gray-300 leading-snug">
1097                            <span class="text-xs text-gray-500 mr-1">${p}</span>
1098                            <span class="font-semibold ${y}">${this.escapeHtml(m)}:</span> ${g}
1099                        </p>
1100                    </div>`}else if(f){const p=f[1],m=this.escapeHtml(f[2]);h+=`<div class="px-3 py-1.5 rounded-lg bg-gray-700/50">
1101                        <p class="text-sm text-gray-300 leading-snug">
1102                            <span class="text-xs text-gray-500 mr-1">${p}</span> ${m}
1103                        </p>
1104                    </div>`}else h+=`<div class="px-3 py-1.5 rounded-lg bg-gray-700/50">
1105                        <p class="text-sm text-gray-300 leading-snug">${this.escapeHtml(u)}</p>
1106                    </div>`}),this.transcriptHtml=h},normalizeValue(t){return t===null||typeof t>"u"?"":typeof t=="string"?t:String(t)},escapeAttribute(t){return this.normalizeValue(t).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},stripHtmlTags(t){if(!t||typeof t!="string")return"";const e=document.createElement("div");return e.innerHTML=t,e.textContent||e.innerText||""},renderForm(t){let e="";for(let r in t){const n=t[r],i=n.__icon||"",s=n.__color||"#3b82f6",o=n.__layout||"1col";let a="";for(let c in n)if(!c.startsWith("__"))if(o==="1col"){const h=this.stripHtmlTags(n[c]),u=this.escapeAttribute(h),d=this.formatDisplayValue(n[c]||"");a+=`
1107                                <div class="group">
1108                                    <div class="text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2 flex meeting-form-label">
1109                                        <p>${c}</p>
1110                                    </div>
1111                                    <div class="relative input-wrapper" data-section="${r}" data-field="${c}" data-field-value="${u}">
1112                                        <div class="editable-content flex text-base font-medium text-gray-900 editable-field cursor-pointer items-center hover:bg-gray-100 rounded p-2.5">
1113                                            <span class="input-placeholder flex-1">${d}</span>
1114                                        </div>
1115                                        <div class="editable-input flex items-center border-blue-500 rounded-md px-3 py-2 focus-within:ring-1 focus-within:ring-blue-500 hidden">
1116                                            <input type="text" value="${u}" class="meeting-inputs flex-1 bg-transparent border-0 focus:border-none focus:ring-0 focus:outline-none text-sm text-gray-800">
1117                                            <button class="save-input-btn w-5 h-5 bg-blue-500 hover:bg-blue-700 rounded text-white flex items-center justify-center text-xs ml-2 mr-2">
1118                                                <svg xmlns="http://www.w3.org/2000/svg" class="w-4 h-4 text-white" viewBox="0 0 20 20" fill="currentColor">
1119                                                    <path fill-rule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-7.5 7.5a1 1 0 01-1.414 0l-3.5-3.5a1 1 0 111.414-1.414L8 11.086l6.793-6.793a1 1 0 011.414 0z" clip-rule="evenodd"></path>
1120                                                </svg>
1121                                            </button>
1122                                            <button class="cancel-input-btn ml-1 text-gray-400 hover:text-gray-600 text-sm size-5 hover:bg-gray-300 rounded">×</button>
1123                                        </div>
1124                                    </div>
1125                                </div>
1126                            `}else{const h=this.stripHtmlTags(n[c]),u=this.escapeAttribute(h),d=this.formatDisplayValue(n[c]||"");a+=`
1127                                <div class="group">
1128                                    <div class="relative input-wrapper" data-section="${r}" data-field="${c}" data-field-value="${u}">
1129                                        <div class="editable-content flex text-base font-medium text-gray-900 editable-field cursor-pointer items-center hover:bg-gray-100 rounded p-2.5">
1130                                            <span class="input-placeholder flex-1">${d}</span>
1131                                        </div>
1132                                        <div class="editable-input flex items-center border-blue-500 rounded-md px-3 py-2 focus-within:ring-1 focus-within:ring-blue-500 hidden">
1133                                            <textarea class="meeting-inputs flex-1 bg-transparent border-0 focus:border-none focus:ring-0 focus:outline-none text-sm text-gray-800" rows="3">${u}</textarea>
1134                                            <button class="save-input-btn bg-blue-500 p-2 hover:bg-blue-700 rounded text-white flex items-center justify-center text-xs ml-2 mr-2">
1135                                                Enregistrer
1136                                            </button>
1137                                            <button class="cancel-input-btn px-3 py-2 text-gray-400 hover:text-gray-600 text-sm hover:bg-gray-300 rounded">Annuler</button>
1138                                        </div>
1139                                    </div>
1140                                </div>
1141                            `}e+=`
1142                    <div class="relative bg-white rounded-xl border border-gray-200 shadow-sm hover:shadow-lg transition-all duration-300 overflow-hidden group ${o==="full"?"lg:col-span-2":"lg:col-span-1"}">
1143                        <div class="absolute top-0 left-0 w-full h-1" style="background: ${s}"></div>
1144                        <div class="p-6">
1145                            <div class="flex items-center mb-6 meeting-form-label">
1146                                <div class="relative">
1147                                    <div class="p-3 bg-gradient-to-br rounded-xl mr-4" style="background: ${s}">
1148                                        ${i}
1149                                    </div>
1150                                </div>
1151                                <div>
1152                                    <h3 class="text-lg font-bold text-gray-900">${r}</h3>
1153                                </div>
1154                            </div>
1155                            <div class="space-y-4 section-inputs">
1156                               ${a}
1157                            </div>
1158                        </div>
1159                    </div>
1160                `}this.meetingFormDataHtml=`<div class="grid grid-cols-1 lg:grid-cols-2 gap-5">${e}</div>`}}};var yI={name:"mermaid",version:"11.12.1",description:"Markdown-ish syntax for generating flowcharts, mindmaps, sequence diagrams, class diagrams, gantt charts, git graphs and more.",type:"module",module:"./dist/mermaid.core.mjs",types:"./dist/mermaid.d.ts",exports:{".":{types:"./dist/mermaid.d.ts",import:"./dist/mermaid.core.mjs",default:"./dist/mermaid.core.mjs"},"./*":"./*"},keywords:["diagram","markdown","flowchart","sequence diagram","gantt","class diagram","git graph","mindmap","packet diagram","c4 diagram","er diagram","pie chart","pie diagram","quadrant chart","requirement diagram","graph"],scripts:{clean:"rimraf dist",dev:"pnpm -w dev","docs:code":"typedoc src/defaultConfig.ts src/config.ts src/mermaid.ts && prettier --write ./src/docs/config/setup","docs:build":"rimraf ../../docs && pnpm docs:code && pnpm docs:spellcheck && tsx scripts/docs.cli.mts","docs:verify":"pnpm docs:code && pnpm docs:spellcheck && tsx scripts/docs.cli.mts --verify","docs:pre:vitepress":"pnpm --filter ./src/docs prefetch && rimraf src/vitepress && pnpm docs:code && tsx scripts/docs.cli.mts --vitepress && pnpm --filter ./src/vitepress install --no-frozen-lockfile --ignore-scripts","docs:build:vitepress":"pnpm docs:pre:vitepress && (cd src/vitepress && pnpm run build) && cpy --flat src/docs/landing/ ./src/vitepress/.vitepress/dist/landing","docs:dev":'pnpm docs:pre:vitepress && concurrently "pnpm --filter ./src/vitepress dev" "tsx scripts/docs.cli.mts --watch --vitepress"',"docs:dev:docker":'pnpm docs:pre:vitepress && concurrently "pnpm --filter ./src/vitepress dev:docker" "tsx scripts/docs.cli.mts --watch --vitepress"',"docs:serve":"pnpm docs:build:vitepress && vitepress serve src/vitepress","docs:spellcheck":'cspell "src/docs/**/*.md"',"docs:release-version":"tsx scripts/update-release-version.mts","docs:verify-version":"tsx scripts/update-release-version.mts --verify","types:build-config":"tsx scripts/create-types-from-json-schema.mts","types:verify-config":"tsx scripts/create-types-from-json-schema.mts --verify",checkCircle:"npx madge --circular ./src",prepublishOnly:"pnpm docs:verify-version"},repository:{type:"git",url:"https://github.com/mermaid-js/mermaid"},author:"Knut Sveidqvist",license:"MIT",standard:{ignore:["**/parser/*.js","dist/**/*.js","cypress/**/*.js"],globals:["page"]},dependencies:{"@braintree/sanitize-url":"^7.1.1","@iconify/utils":"^3.0.1","@mermaid-js/parser":"workspace:^","@types/d3":"^7.4.3",cytoscape:"^3.29.3","cytoscape-cose-bilkent":"^4.1.0","cytoscape-fcose":"^2.2.0",d3:"^7.9.0","d3-sankey":"^0.12.3","dagre-d3-es":"7.0.13",dayjs:"^1.11.18",dompurify:"^3.2.5",katex:"^0.16.22",khroma:"^2.1.0","lodash-es":"^4.17.21",marked:"^16.2.1",roughjs:"^4.6.6",stylis:"^4.3.6","ts-dedent":"^2.2.0",uuid:"^11.1.0"},devDependencies:{"@adobe/jsonschema2md":"^8.0.5","@iconify/types":"^2.0.0","@types/cytoscape":"^3.21.9","@types/cytoscape-fcose":"^2.2.4","@types/d3-sankey":"^0.12.4","@types/d3-scale":"^4.0.9","@types/d3-scale-chromatic":"^3.1.0","@types/d3-selection":"^3.0.11","@types/d3-shape":"^3.1.7","@types/jsdom":"^21.1.7","@types/katex":"^0.16.7","@types/lodash-es":"^4.17.12","@types/micromatch":"^4.0.9","@types/stylis":"^4.2.7","@types/uuid":"^10.0.0",ajv:"^8.17.1",canvas:"^3.1.2",chokidar:"3.6.0",concurrently:"^9.1.2","csstree-validator":"^4.0.1",globby:"^14.1.0",jison:"^0.4.18","js-base64":"^3.7.8",jsdom:"^26.1.0","json-schema-to-typescript":"^15.0.4",micromatch:"^4.0.8","path-browserify":"^1.0.1",prettier:"^3.5.3",remark:"^15.0.1","remark-frontmatter":"^5.0.0","remark-gfm":"^4.0.1",rimraf:"^6.0.1","start-server-and-test":"^2.0.13","type-fest":"^4.35.0",typedoc:"^0.28.12","typedoc-plugin-markdown":"^4.8.1",typescript:"~5.7.3","unist-util-flatmap":"^1.0.0","unist-util-visit":"^5.0.0",vitepress:"^1.6.4","vitepress-plugin-search":"1.0.4-alpha.22"},files:["dist/","README.md"],publishConfig:{access:"public"}},kj={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(Sue,function(){var r=1e3,n=6e4,i=36e5,s="millisecond",o="second",a="minute",l="hour",c="day",h="week",u="month",d="quarter",f="year",p="date",m="Invalid Date",g=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}
vendor: 4,386 bytes, line 1160
1160|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,b={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(z){var $=["th","st","nd","rd"],H=z%100;return"["+z+($[(H-20)%10]||$[H]||$[0])+"]"}},x=function(z,$,H){var j=String(z);return!j||j.length>=$?z:""+Array($+1-j.length).join(H)+z},S={s:x,z:function(z){var $=-z.utcOffset(),H=Math.abs($),j=Math.floor(H/60),q=H%60;return($<=0?"+":"-")+x(j,2,"0")+":"+x(q,2,"0")},m:function z($,H){if($.date()<H.date())return-z(H,$);var j=12*(H.year()-$.year())+(H.month()-$.month()),q=$.clone().add(j,u),ne=H-q<0,O=$.clone().add(j+(ne?-1:1),u);return+(-(j+(H-q)/(ne?q-O:O-q))||0)},a:function(z){return z<0?Math.ceil(z)||0:Math.floor(z)},p:function(z){return{M:u,y:f,w:h,d:c,D:p,h:l,m:a,s:o,ms:s,Q:d}[z]||String(z||"").toLowerCase().replace(/s$/,"")},u:function(z){return z===void 0}},k="en",w={};w[k]=b;var _="$isDayjsObject",L=function(z){return z instanceof N||!(!z||!z[_])},B=function z($,H,j){var q;if(!$)return k;if(typeof $=="string"){var ne=$.toLowerCase();w[ne]&&(q=ne),H&&(w[ne]=H,q=ne);var O=$.split("-");if(!q&&O.length>1)return z(O[0])}else{var fe=$.name;w[fe]=$,q=fe}return!j&&q&&(k=q),q||!j&&k},E=function(z,$){if(L(z))return z.clone();var H=typeof $=="object"?$:{};return H.date=z,H.args=arguments,new N(H)},D=S;D.l=B,D.i=L,D.w=function(z,$){return E(z,{locale:$.$L,utc:$.$u,x:$.$x,$offset:$.$offset})};var N=function(){function z(H){this.$L=B(H.locale,null,!0),this.parse(H),this.$x=this.$x||H.x||{},this[_]=!0}var $=z.prototype;return $.parse=function(H){this.$d=function(j){var q=j.date,ne=j.utc;if(q===null)return new Date(NaN);if(D.u(q))return new Date;if(q instanceof Date)return new Date(q);if(typeof q=="string"&&!/Z$/i.test(q)){var O=q.match(g);if(O){var fe=O[2]-1||0,Te=(O[7]||"0").substring(0,3);return ne?new Date(Date.UTC(O[1],fe,O[3]||1,O[4]||0,O[5]||0,O[6]||0,Te)):new Date(O[1],fe,O[3]||1,O[4]||0,O[5]||0,O[6]||0,Te)}}return new Date(q)}(H),this.init()},$.init=function(){var H=this.$d;this.$y=H.getFullYear(),this.$M=H.getMonth(),this.$D=H.getDate(),this.$W=H.getDay(),this.$H=H.getHours(),this.$m=H.getMinutes(),this.$s=H.getSeconds(),this.$ms=H.getMilliseconds()},$.$utils=function(){return D},$.isValid=function(){return this.$d.toString()!==m},$.isSame=function(H,j){var q=E(H);return this.startOf(j)<=q&&q<=this.endOf(j)},$.isAfter=function(H,j){return E(H)<this.startOf(j)},$.isBefore=function(H,j){return this.endOf(j)<E(H)},$.$g=function(H,j,q){return D.u(H)?this[j]:this.set(q,H)},$.unix=function(){return Math.floor(this.valueOf()/1e3)},$.valueOf=function(){return this.$d.getTime()},$.startOf=function(H,j){var q=this,ne=!!D.u(j)||j,O=D.p(H),fe=function(Ct,wt){var zt=D.w(q.$u?Date.UTC(q.$y,wt,Ct):new Date(q.$y,wt,Ct),q);return ne?zt:zt.endOf(c)},Te=function(Ct,wt){return D.w(q.toDate()[Ct].apply(q.toDate("s"),(ne?[0,0,0,0]:[23,59,59,999]).slice(wt)),q)},I=this.$W,tt=this.$M,qe=this.$D,Oe="set"+(this.$u?"UTC":"");switch(O){case f:return ne?fe(1,0):fe(31,11);case u:return ne?fe(1,tt):fe(0,tt+1);case h:var Ze=this.$locale().weekStart||0,vt=(I<Ze?I+7:I)-Ze;return fe(ne?qe-vt:qe+(6-vt),tt);case c:case p:return Te(Oe+"Hours",0);case l:return Te(Oe+"Minutes",1);case a:return Te(Oe+"Seconds",2);case o:return Te(Oe+"Milliseconds",3);default:return this.clone()}},$.endOf=function(H){return this.startOf(H,!1)},$.$set=function(H,j){var q,ne=D.p(H),O="set"+(this.$u?"UTC":""),fe=(q={},q[c]=O+"Date",q[p]=O+"Date",q[u]=O+"Month",q[f]=O+"FullYear",q[l]=O+"Hours",q[a]=O+"Minutes",q[o]=O+"Seconds",q[s]=O+"Milliseconds",q)[ne],Te=ne===c?this.$D+(j-this.$W):j;if(ne===u||ne===f){var I=this.clone().set(p,1);I.$d[fe](Te),I.init(),this.$d=I.set(p,Math.min(this.$D,I.daysInMonth())).$d}else fe&&this.$d[fe](Te);return this.init(),this},$.set=function(H,j){return this.clone().$set(H,j)},$.get=function(H){return this[D.p(H)]()},$.add=function(H,j){var q,ne=this;H=Number(H);var O=D.p(j),fe=function(tt){var qe=E(ne);return D.w(qe.date(qe.date()+Math.round(tt*H)),ne)};if(O===u)return this.set(u,this.$M+H);if(O===f)return this.set(f,this.$y+H);if(O===c)return fe(1);if(O===h)return fe(7);var Te=(q={},q[a]=n,q[l]=i,q[o]=r,q)[O]||1,I=this.$d.getTime()+H*Te;return D.w(I,this)},$.subtract=function(H,j){return this.add(-1*H,j)},$.format=function(H){var j=this,q=this.$locale();
vendor: 5,322 bytes, line 1160
1160if(!this.isValid())return q.invalidDate||m;var ne=H||"YYYY-MM-DDTHH:mm:ssZ",O=D.z(this),fe=this.$H,Te=this.$m,I=this.$M,tt=q.weekdays,qe=q.months,Oe=q.meridiem,Ze=function(wt,zt,gr,R){return wt&&(wt[zt]||wt(j,ne))||gr[zt].slice(0,R)},vt=function(wt){return D.s(fe%12||12,wt,"0")},Ct=Oe||function(wt,zt,gr){var R=wt<12?"AM":"PM";return gr?R.toLowerCase():R};return ne.replace(y,function(wt,zt){return zt||function(gr){switch(gr){case"YY":return String(j.$y).slice(-2);case"YYYY":return D.s(j.$y,4,"0");case"M":return I+1;case"MM":return D.s(I+1,2,"0");case"MMM":return Ze(q.monthsShort,I,qe,3);case"MMMM":return Ze(qe,I);case"D":return j.$D;case"DD":return D.s(j.$D,2,"0");case"d":return String(j.$W);case"dd":return Ze(q.weekdaysMin,j.$W,tt,2);case"ddd":return Ze(q.weekdaysShort,j.$W,tt,3);case"dddd":return tt[j.$W];case"H":return String(fe);case"HH":return D.s(fe,2,"0");case"h":return vt(1);case"hh":return vt(2);case"a":return Ct(fe,Te,!0);case"A":return Ct(fe,Te,!1);case"m":return String(Te);case"mm":return D.s(Te,2,"0");case"s":return String(j.$s);case"ss":return D.s(j.$s,2,"0");case"SSS":return D.s(j.$ms,3,"0");case"Z":return O}return null}(wt)||O.replace(":","")})},$.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},$.diff=function(H,j,q){var ne,O=this,fe=D.p(j),Te=E(H),I=(Te.utcOffset()-this.utcOffset())*n,tt=this-Te,qe=function(){return D.m(O,Te)};switch(fe){case f:ne=qe()/12;break;case u:ne=qe();break;case d:ne=qe()/3;break;case h:ne=(tt-I)/6048e5;break;case c:ne=(tt-I)/864e5;break;case l:ne=tt/i;break;case a:ne=tt/n;break;case o:ne=tt/r;break;default:ne=tt}return q?ne:D.a(ne)},$.daysInMonth=function(){return this.endOf(u).$D},$.$locale=function(){return w[this.$L]},$.locale=function(H,j){if(!H)return this.$L;var q=this.clone(),ne=B(H,j,!0);return ne&&(q.$L=ne),q},$.clone=function(){return D.w(this.$d,this)},$.toDate=function(){return new Date(this.valueOf())},$.toJSON=function(){return this.isValid()?this.toISOString():null},$.toISOString=function(){return this.$d.toISOString()},$.toString=function(){return this.$d.toUTCString()},z}(),K=N.prototype;return E.prototype=K,[["$ms",s],["$s",o],["$m",a],["$H",l],["$W",c],["$M",u],["$y",f],["$D",p]].forEach(function(z){K[z[1]]=function($){return this.$g($,z[0],z[1])}}),E.extend=function(z,$){return z.$i||(z($,N,E),z.$i=!0),E},E.locale=B,E.isDayjs=L,E.unix=function(z){return E(1e3*z)},E.en=w[k],E.Ls=w,E.p={},E})})(kj);var uSe=kj.exports;const dSe=$F(uSe);var Cj=Object.defineProperty,C=(t,e)=>Cj(t,"name",{value:e,configurable:!0}),fSe=(t,e)=>{for(var r in e)Cj(t,r,{get:e[r],enumerable:!0})},ka={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},de={trace:C((...t)=>{},"trace"),debug:C((...t)=>{},"debug"),info:C((...t)=>{},"info"),warn:C((...t)=>{},"warn"),error:C((...t)=>{},"error"),fatal:C((...t)=>{},"fatal")},xT=C(function(t="fatal"){let e=ka.fatal;typeof t=="string"?t.toLowerCase()in ka&&(e=ka[t]):typeof t=="number"&&(e=t),de.trace=()=>{},de.debug=()=>{},de.info=()=>{},de.warn=()=>{},de.error=()=>{},de.fatal=()=>{},e<=ka.fatal&&(de.fatal=console.error?console.error.bind(console,ps("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",ps("FATAL"))),e<=ka.error&&(de.error=console.error?console.error.bind(console,ps("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",ps("ERROR"))),e<=ka.warn&&(de.warn=console.warn?console.warn.bind(console,ps("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",ps("WARN"))),e<=ka.info&&(de.info=console.info?console.info.bind(console,ps("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",ps("INFO"))),e<=ka.debug&&(de.debug=console.debug?console.debug.bind(console,ps("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",ps("DEBUG"))),e<=ka.trace&&(de.trace=console.debug?console.debug.bind(console,ps("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",ps("TRACE")))},"setLogLevel"),ps=C(t=>`%c${dSe().format("ss.SSS")} : ${t} : `,"format");const _b={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:t=>t>=255?255:t<0?0:t,g:t=>t>=255?255:t<0?0:t,b:t=>t>=255?255:t<0?0:t,h:t=>t%360,s:t=>t>=100?100:t<0?0:t,l:t=>t>=100?100:t<0?0:t,a:t=>t>=1?1:t<0?0:t},toLinear:t=>{const e=t/255;return t>.03928?Math.pow((e+.055)/1.055,2.4):e/12.92},hue2rgb:(t,e,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t),hsl2rgb:({h:t,s:e,l:r},n)=>{if(!e)return r*2.55;t/=360,e/=100,r/=100;const i=r<.5?r*(1+e):r+e-r*e,s=2*r-i;switch(n){case"r":return _b.hue2rgb(s,i,t+1/3)*255;case"g":return _b.hue2rgb(s,i,t)*255;case"b":return _b.hue2rgb(s,i,t-1/3)*255}},rgb2hsl:({r:t,g:e,b:r},n)=>{t/=255,e/=255,r/=255;const i=Math.max(t,e,r),s=Math.min(t,e,r),o=(i+s)/2;if(n==="l")return o*100;if(i===s)return 0;const a=i-s,l=o>.5?a/(2-i-s):a/(i+s);if(n==="s")return l*100;switch(i){case t:return((e-r)/a+(e<r?6:0))*60;case e:return((r-t)/a+2)*60;case r:return((t-e)/a+4)*60;default:return-1}}},pSe={clamp:(t,e,r)=>e>r?Math.min(e,Math.max(r,t)):Math.min(r,Math.max(e,t)),round:t=>Math.round(t*1e10)/1e10},mSe={dec2hex:t=>{const e=Math.round(t).toString(16);return e.length>1?e:`0${e}`}},xt={channel:_b,lang:pSe,unit:mSe},Bl={};for(let t=0;t<=255;t++)Bl[t]=xt.unit.dec2hex(t);const On={ALL:0,RGB:1,HSL:2};class gSe{constructor(){this.type=On.ALL}get(){return this.type}
vendor: 10,756 bytes, lines 1160-1161
1160set(e){if(this.type&&this.type!==e)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=e}reset(){this.type=On.ALL}is(e){return this.type===e}}class ySe{constructor(e,r){this.color=r,this.changed=!1,this.data=e,this.type=new gSe}set(e,r){return this.color=r,this.changed=!1,this.data=e,this.type.type=On.ALL,this}_ensureHSL(){const e=this.data,{h:r,s:n,l:i}=e;r===void 0&&(e.h=xt.channel.rgb2hsl(e,"h")),n===void 0&&(e.s=xt.channel.rgb2hsl(e,"s")),i===void 0&&(e.l=xt.channel.rgb2hsl(e,"l"))}_ensureRGB(){const e=this.data,{r,g:n,b:i}=e;r===void 0&&(e.r=xt.channel.hsl2rgb(e,"r")),n===void 0&&(e.g=xt.channel.hsl2rgb(e,"g")),i===void 0&&(e.b=xt.channel.hsl2rgb(e,"b"))}get r(){const e=this.data,r=e.r;return!this.type.is(On.HSL)&&r!==void 0?r:(this._ensureHSL(),xt.channel.hsl2rgb(e,"r"))}get g(){const e=this.data,r=e.g;return!this.type.is(On.HSL)&&r!==void 0?r:(this._ensureHSL(),xt.channel.hsl2rgb(e,"g"))}get b(){const e=this.data,r=e.b;return!this.type.is(On.HSL)&&r!==void 0?r:(this._ensureHSL(),xt.channel.hsl2rgb(e,"b"))}get h(){const e=this.data,r=e.h;return!this.type.is(On.RGB)&&r!==void 0?r:(this._ensureRGB(),xt.channel.rgb2hsl(e,"h"))}get s(){const e=this.data,r=e.s;return!this.type.is(On.RGB)&&r!==void 0?r:(this._ensureRGB(),xt.channel.rgb2hsl(e,"s"))}get l(){const e=this.data,r=e.l;return!this.type.is(On.RGB)&&r!==void 0?r:(this._ensureRGB(),xt.channel.rgb2hsl(e,"l"))}get a(){return this.data.a}set r(e){this.type.set(On.RGB),this.changed=!0,this.data.r=e}set g(e){this.type.set(On.RGB),this.changed=!0,this.data.g=e}set b(e){this.type.set(On.RGB),this.changed=!0,this.data.b=e}set h(e){this.type.set(On.HSL),this.changed=!0,this.data.h=e}set s(e){this.type.set(On.HSL),this.changed=!0,this.data.s=e}set l(e){this.type.set(On.HSL),this.changed=!0,this.data.l=e}set a(e){this.changed=!0,this.data.a=e}}const a4=new ySe({r:0,g:0,b:0,a:0},"transparent"),Od={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:t=>{if(t.charCodeAt(0)!==35)return;const e=t.match(Od.re);if(!e)return;const r=e[1],n=parseInt(r,16),i=r.length,s=i%4===0,o=i>4,a=o?1:17,l=o?8:4,c=s?0:-1,h=o?255:15;return a4.set({r:(n>>l*(c+3)&h)*a,g:(n>>l*(c+2)&h)*a,b:(n>>l*(c+1)&h)*a,a:s?(n&h)*a/255:1},t)},stringify:t=>{const{r:e,g:r,b:n,a:i}=t;return i<1?`#${Bl[Math.round(e)]}${Bl[Math.round(r)]}${Bl[Math.round(n)]}${Bl[Math.round(i*255)]}`:`#${Bl[Math.round(e)]}${Bl[Math.round(r)]}${Bl[Math.round(n)]}`}},vh={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:t=>{const e=t.match(vh.hueRe);if(e){const[,r,n]=e;switch(n){case"grad":return xt.channel.clamp.h(parseFloat(r)*.9);case"rad":return xt.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return xt.channel.clamp.h(parseFloat(r)*360)}}return xt.channel.clamp.h(parseFloat(t))},parse:t=>{const e=t.charCodeAt(0);if(e!==104&&e!==72)return;const r=t.match(vh.re);if(!r)return;const[,n,i,s,o,a]=r;return a4.set({h:vh._hue2deg(n),s:xt.channel.clamp.s(parseFloat(i)),l:xt.channel.clamp.l(parseFloat(s)),a:o?xt.channel.clamp.a(a?parseFloat(o)/100:parseFloat(o)):1},t)},stringify:t=>{const{h:e,s:r,l:n,a:i}=t;return i<1?`hsla(${xt.lang.round(e)}, ${xt.lang.round(r)}%, ${xt.lang.round(n)}%, ${i})`:`hsl(${xt.lang.round(e)}, ${xt.lang.round(r)}%, ${xt.lang.round(n)}%)`}},Im={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:t=>{t=t.toLowerCase();const e=Im.colors[t];if(e)return Od.parse(e)},stringify:t=>{const e=Od.stringify(t);for(const r in Im.colors)if(Im.colors[r]===e)return r}},Hp={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:t=>{const e=t.charCodeAt(0);if(e!==114&&e!==82)return;const r=t.match(Hp.re);if(!r)return;const[,n,i,s,o,a,l,c,h]=r;return a4.set({r:xt.channel.clamp.r(i?parseFloat(n)*2.55:parseFloat(n)),g:xt.channel.clamp.g(o?parseFloat(s)*2.55:parseFloat(s)),b:xt.channel.clamp.b(l?parseFloat(a)*2.55:parseFloat(a)),a:c?xt.channel.clamp.a(h?parseFloat(c)/100:parseFloat(c)):1},t)},stringify:t=>{const{r:e,g:r,b:n,a:i}=t;return i<1?`rgba(${xt.lang.round(e)}, ${xt.lang.round(r)}, ${xt.lang.round(n)}, ${xt.lang.round(i)})`:`rgb(${xt.lang.round(e)}, ${xt.lang.round(r)}, ${xt.lang.round(n)})`}},ia={format:{keyword:Im,hex:Od,rgb:Hp,rgba:Hp,hsl:vh,hsla:vh},parse:t=>{if(typeof t!="string")return t;const e=Od.parse(t)||Hp.parse(t)||vh.parse(t)||Im.parse(t);if(e)return e;throw new Error(`Unsupported color format: "${t}"`)},stringify:t=>!t.changed&&t.color?t.color:t.type.is(On.HSL)||t.data.r===void 0?vh.stringify(t):t.a<1||!Number.isInteger(t.r)||!Number.isInteger(t.g)||!Number.isInteger(t.b)?Hp.stringify(t):Od.stringify(t)},Sj=(t,e)=>{const r=ia.parse(t);for(const n in e)r[n]=xt.channel.clamp[n](e[n]);return ia.stringify(r)},Bm=(t,e,r=0,n=1)=>{if(typeof t!="number")return Sj(t,{a:e});const i=a4.set({r:xt.channel.clamp.r(t),g:xt.channel.clamp.g(e),b:xt.channel.clamp.b(r),a:xt.channel.clamp.a(n)});return ia.stringify(i)},bSe=t=>{const{r:e,g:r,b:n}=ia.parse(t),i=.2126*xt.channel.toLinear(e)+.7152*xt.channel.toLinear(r)+.0722*xt.channel.toLinear(n);return xt.lang.round(i)},xSe=t=>bSe(t)>=.5,K1=t=>!xSe(t),Tj=(t,e,r)=>{const n=ia.parse(t),i=n[e],s=xt.channel.clamp[e](i+r);return i!==s&&(n[e]=s),ia.stringify(n)},Ve=(t,e)=>Tj(t,"l",e),it=(t,e)=>Tj(t,"l",-e),X=(t,e)=>{const r=ia.parse(t),n={};for(const i in e)e[i]&&(n[i]=r[i]+e[i]);return Sj(t,n)},vSe=(t,e,r=50)=>{const{r:n,g:i,b:s,a:o}=ia.parse(t),{r:a,g:l,b:c,a:h}=ia.parse(e),u=r/100,d=u*2-1,f=o-h,m=((d*f===-1?d:(d+f)/(1+d*f))+1)/2,g=1-m,y=n*m+a*g,b=i*m+l*g,x=s*m+c*g,S=o*u+h*(1-u);return Bm(y,b,x,S)},Ee=(t,e=100)=>{const r=ia.parse(t);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,vSe(r,t,e)};var _j=/^-{3}\s*[\n\r](.*?)[\n\r]-{3}\s*[\n\r]+/s,Rm=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,wSe=/\s*%%.*\n/gm,lf,Mj=(lf=class extends Error{constructor(e){super(e),this.name="UnknownDiagramError"}},C(lf,"UnknownDiagramError"),lf),yu={},vT=C(function(t,e){t=t.replace(_j,"").replace(Rm,"").replace(wSe,`
1161`);for(const[r,{detector:n}]of Object.entries(yu))if(n(t,e))return r;throw new Mj(`No diagram type detected matching given configuration for text: ${t}`)},"detectType"),RS=C((...t)=>{for(const{id:e,detector:r,loader:n}of t)Aj(e,r,n)},"registerLazyLoadedDiagrams"),Aj=C((t,e,r)=>{yu[t]&&de.warn(`Detector with key ${t} already exists. Overwriting.`),yu[t]={detector:e,loader:r},de.debug(`Detector with key ${t} added${r?" with loader":""}`)},"addDetector"),kSe=C(t=>yu[t].loader,"getDiagramLoader"),PS=C((t,e,{depth:r=2,clobber:n=!1}={})=>{const i={depth:r,clobber:n};return Array.isArray(e)&&!Array.isArray(t)?(e.forEach(s=>PS(t,s,i)),t):Array.isArray(e)&&Array.isArray(t)?(e.forEach(s=>{t.includes(s)||t.push(s)}),t):t===void 0||r<=0?t!=null&&typeof t=="object"&&typeof e=="object"?Object.assign(t,e):e:(e!==void 0&&typeof t=="object"&&typeof e=="object"&&Object.keys(e).forEach(s=>{typeof e[s]=="object"&&(t[s]===void 0||typeof t[s]=="object")?(t[s]===void 0&&(t[s]=Array.isArray(e[s])?[]:{}),t[s]=PS(t[s],e[s],{depth:r-1,clobber:n})):(n||typeof t[s]!="object"&&typeof e[s]!="object")&&(t[s]=e[s])}),t)},"assignWithDepth"),Qr=PS,l4="#ffffff",c4="#f2f2f2",ni=C((t,e)=>e?X(t,{s:-40,l:10}):X(t,{s:-40,l:-10}),"mkBorder"),cf,CSe=(cf=class{constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px"}
vendor: 4,314 bytes, line 1161
1161updateColors(){var r,n,i,s,o,a,l,c,h,u,d,f,p,m,g,y,b,x,S,k,w;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||X(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||X(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ni(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ni(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ni(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ni(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||Ee(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Ee(this.tertiaryColor),this.lineColor=this.lineColor||Ee(this.background),this.arrowheadColor=this.arrowheadColor||Ee(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?it(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||it(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Ee(this.lineColor),this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||Ve(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||"navy",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.darkMode?(this.rowOdd=this.rowOdd||it(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||it(this.mainBkg,10)):(this.rowOdd=this.rowOdd||Ve(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||Ve(this.mainBkg,5)),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroun
vendor: 29,122 bytes, line 1161
1161dColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||this.tertiaryColor,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||X(this.primaryColor,{h:30}),this.cScale4=this.cScale4||X(this.primaryColor,{h:60}),this.cScale5=this.cScale5||X(this.primaryColor,{h:90}),this.cScale6=this.cScale6||X(this.primaryColor,{h:120}),this.cScale7=this.cScale7||X(this.primaryColor,{h:150}),this.cScale8=this.cScale8||X(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||X(this.primaryColor,{h:270}),this.cScale10=this.cScale10||X(this.primaryColor,{h:300}),this.cScale11=this.cScale11||X(this.primaryColor,{h:330}),this.darkMode)for(let _=0;_<this.THEME_COLOR_LIMIT;_++)this["cScale"+_]=it(this["cScale"+_],75);else for(let _=0;_<this.THEME_COLOR_LIMIT;_++)this["cScale"+_]=it(this["cScale"+_],25);for(let _=0;_<this.THEME_COLOR_LIMIT;_++)this["cScaleInv"+_]=this["cScaleInv"+_]||Ee(this["cScale"+_]);for(let _=0;_<this.THEME_COLOR_LIMIT;_++)this.darkMode?this["cScalePeer"+_]=this["cScalePeer"+_]||Ve(this["cScale"+_],10):this["cScalePeer"+_]=this["cScalePeer"+_]||it(this["cScale"+_],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let _=0;_<this.THEME_COLOR_LIMIT;_++)this["cScaleLabel"+_]=this["cScaleLabel"+_]||this.scaleLabelColor;const e=this.darkMode?-4:-1;for(let _=0;_<5;_++)this["surface"+_]=this["surface"+_]||X(this.mainBkg,{h:180,s:-15,l:e*(5+_*3)}),this["surfacePeer"+_]=this["surfacePeer"+_]||X(this.mainBkg,{h:180,s:-15,l:e*(8+_*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||X(this.primaryColor,{h:64}),this.fillType3=this.fillType3||X(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||X(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||X(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||X(this.primaryColor,{h:128}),this.fillType7=this.fillType7||X(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||X(this.primaryColor,{l:-10}),this.pie5=this.pie5||X(this.secondaryColor,{l:-10}),this.pie6=this.pie6||X(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||X(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||X(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||X(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||X(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||X(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||X(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.radar={axisColor:((r=this.radar)==null?void 0:r.axisColor)||this.lineColor,axisStrokeWidth:((n=this.radar)==null?void 0:n.axisStrokeWidth)||2,axisLabelFontSize:((i=this.radar)==null?void 0:i.axisLabelFontSize)||12,curveOpacity:((s=this.radar)==null?void 0:s.curveOpacity)||.5,curveStrokeWidth:((o=this.radar)==null?void 0:o.curveStrokeWidth)||2,graticuleColor:((a=this.radar)==null?void 0:a.graticuleColor)||"#DEDEDE",graticuleStrokeWidth:((l=this.radar)==null?void 0:l.graticuleStrokeWidth)||1,graticuleOpacity:((c=this.radar)==null?void 0:c.graticuleOpacity)||.3,legendBoxSize:((h=this.radar)==null?void 0:h.legendBoxSize)||12,legendFontSize:((u=this.radar)==null?void 0:u.legendFontSize)||12},this.archEdgeColor=this.archEdgeColor||"#777",this.archEdgeArrowColor=this.archEdgeArrowColor||"#777",this.archEdgeWidth=this.archEdgeWidth||"3",this.archGroupBorderColor=this.archGroupBorderColor||"#000",this.archGroupBorderWidth=this.archGroupBorderWidth||"2px",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||X(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||X(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||X(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||X(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||X(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||X(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||K1(this.quadrant1Fill)?Ve(this.quadrant1Fill):it(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:((d=this.xyChart)==null?void 0:d.backgroundColor)||this.background,titleColor:((f=this.xyChart)==null?void 0:f.titleColor)||this.primaryTextColor,xAxisTitleColor:((p=this.xyChart)==null?void 0:p.xAxisTitleColor)||this.primaryTextColor,xAxisLabelColor:((m=this.xyChart)==null?void 0:m.xAxisLabelColor)||this.primaryTextColor,xAxisTickColor:((g=this.xyChart)==null?void 0:g.xAxisTickColor)||this.primaryTextColor,xAxisLineColor:((y=this.xyChart)==null?void 0:y.xAxisLineColor)||this.primaryTextColor,yAxisTitleColor:((b=this.xyChart)==null?void 0:b.yAxisTitleColor)||this.primaryTextColor,yAxisLabelColor:((x=this.xyChart)==null?void 0:x.yAxisLabelColor)||this.primaryTextColor,yAxisTickColor:((S=this.xyChart)==null?void 0:S.yAxisTickColor)||this.primaryTextColor,yAxisLineColor:((k=this.xyChart)==null?void 0:k.yAxisLineColor)||this.primaryTextColor,plotColorPalette:((w=this.xyChart)==null?void 0:w.plotColorPalette)||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?it(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||X(this.primaryColor,{h:-30}),this.git4=this.git4||X(this.primaryColor,{h:-60}),this.git5=this.git5||X(this.primaryColor,{h:-90}),this.git6=this.git6||X(this.primaryColor,{h:60}),this.git7=this.git7||X(this.primaryColor,{h:120}),this.darkMode?(this.git0=Ve(this.git0,25),this.git1=Ve(this.git1,25),this.git2=Ve(this.git2,25),this.git3=Ve(this.git3,25),this.git4=Ve(this.git4,25),this.git5=Ve(this.git5,25),this.git6=Ve(this.git6,25),this.git7=Ve(this.git7,25)):(this.git0=it(this.git0,25),this.git1=it(this.git1,25),this.git2=it(this.git2,25),this.git3=it(this.git3,25),this.git4=it(this.git4,25),this.git5=it(this.git5,25),this.git6=it(this.git6,25),this.git7=it(this.git7,25)),this.gitInv0=this.gitInv0||Ee(this.git0),this.gitInv1=this.gitInv1||Ee(this.git1),this.gitInv2=this.gitInv2||Ee(this.git2),this.gitInv3=this.gitInv3||Ee(this.git3),this.gitInv4=this.gitInv4||Ee(this.git4),this.gitInv5=this.gitInv5||Ee(this.git5),this.gitInv6=this.gitInv6||Ee(this.git6),this.gitInv7=this.gitInv7||Ee(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||l4,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||c4}calculate(e){if(typeof e!="object"){this.updateColors();return}const r=Object.keys(e);r.forEach(n=>{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},C(cf,"Theme"),cf),SSe=C(t=>{const e=new CSe;return e.calculate(t),e},"getThemeVariables"),hf,TSe=(hf=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=Ve(this.primaryColor,16),this.tertiaryColor=X(this.primaryColor,{h:-160}),this.primaryBorderColor=Ee(this.background),this.secondaryBorderColor=ni(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ni(this.tertiaryColor,this.darkMode),this.primaryTextColor=Ee(this.primaryColor),this.secondaryTextColor=Ee(this.secondaryColor),this.tertiaryTextColor=Ee(this.tertiaryColor),this.lineColor=Ee(this.background),this.textColor=Ee(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=Ve(Ee("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=Bm(255,255,255,.25),this.arrowheadColor="calculated",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#F9FFFE",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="calculated",this.activationBkgColor="calculated",this.sequenceNumberColor="black",this.sectionBkgColor=it("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=it(this.sectionBkgColor,10),this.taskBorderColor=Bm(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=Bm(255,255,255,50),this.activeTaskBkgColor="#81B1DB",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="grey",this.critBorderColor="#E83737",this.critBkgColor="#E83737",this.taskTextDarkColor="calculated",this.todayLineColor="#DB5757",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||Ve(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||it(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd"}updateColors(){var e,r,n,i,s,o,a,l,c,h,u,d,f,p,m,g,y,b,x,S,k;this.secondBkg=Ve(this.mainBkg,16),this.lineColor=this.mainContrastColor,this.arrowheadColor=this.mainContrastColor,this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.edgeLabelBackground=Ve(this.labelBackground,25),this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.actorBorder,this.signalColor=this.mainContrastColor,this.signalTextColor=this.mainContrastColor,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.mainContrastColor,this.loopTextColor=this.mainContrastColor,this.noteBorderColor=this.secondaryBorderColor,this.noteBkgColor=this.secondBkg,this.noteTextColor=this.secondaryTextColor,this.activationBorderColor=this.border1,this.activationBkgColor=this.secondBkg,this.altSectionBkgColor=this.background,this.taskBkgColor=Ve(this.mainBkg,23),this.taskTextColor=this.darkTextColor,this.taskTextLightColor=this.mainContrastColor,this.taskTextOutsideColor=this.taskTextLightColor,this.gridColor=this.mainContrastColor,this.doneTaskBkgColor=this.mainContrastColor,this.taskTextDarkColor=this.darkTextColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#555",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#f4f4f4",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=X(this.primaryColor,{h:64}),this.fillType3=X(this.secondaryColor,{h:64}),this.fillType4=X(this.primaryColor,{h:-64}),this.fillType5=X(this.secondaryColor,{h:-64}),this.fillType6=X(this.primaryColor,{h:128}),this.fillType7=X(this.secondaryColor,{h:128}),this.cScale1=this.cScale1||"#0b0000",this.cScale2=this.cScale2||"#4d1037",this.cScale3=this.cScale3||"#3f5258",this.cScale4=this.cScale4||"#4f2f1b",this.cScale5=this.cScale5||"#6e0a0a",this.cScale6=this.cScale6||"#3b0048",this.cScale7=this.cScale7||"#995a01",this.cScale8=this.cScale8||"#154706",this.cScale9=this.cScale9||"#161722",this.cScale10=this.cScale10||"#00296f",this.cScale11=this.cScale11||"#01629c",this.cScale12=this.cScale12||"#010029",this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||X(this.primaryColor,{h:30}),this.cScale4=this.cScale4||X(this.primaryColor,{h:60}),this.cScale5=this.cScale5||X(this.primaryColor,{h:90}),this.cScale6=this.cScale6||X(this.primaryColor,{h:120}),this.cScale7=this.cScale7||X(this.primaryColor,{h:150}),this.cScale8=this.cScale8||X(this.primaryColor,{h:210}),this.cScale9=this.cScale9||X(this.primaryColor,{h:270}),this.cScale10=this.cScale10||X(this.primaryColor,{h:300}),this.cScale11=this.cScale11||X(this.primaryColor,{h:330});for(let w=0;w<this.THEME_COLOR_LIMIT;w++)this["cScaleInv"+w]=this["cScaleInv"+w]||Ee(this["cScale"+w]);for(let w=0;w<this.THEME_COLOR_LIMIT;w++)this["cScalePeer"+w]=this["cScalePeer"+w]||Ve(this["cScale"+w],10);for(let w=0;w<5;w++)this["surface"+w]=this["surface"+w]||X(this.mainBkg,{h:30,s:-30,l:-(-10+w*4)}),this["surfacePeer"+w]=this["surfacePeer"+w]||X(this.mainBkg,{h:30,s:-30,l:-(-7+w*4)});this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor);for(let w=0;w<this.THEME_COLOR_LIMIT;w++)this["cScaleLabel"+w]=this["cScaleLabel"+w]||this.scaleLabelColor;for(let w=0;w<this.THEME_COLOR_LIMIT;w++)this["pie"+w]=this["cScale"+w];this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||X(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||X(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||X(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||X(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||X(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||X(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||K1(this.quadrant1Fill)?Ve(this.quadrant1Fill):it(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:((e=this.xyChart)==null?void 0:e.backgroundColor)||this.background,titleColor:((r=this.xyChart)==null?void 0:r.titleColor)||this.primaryTextColor,xAxisTitleColor:((n=this.xyChart)==null?void 0:n.xAxisTitleColor)||this.primaryTextColor,xAxisLabelColor:((i=this.xyChart)==null?void 0:i.xAxisLabelColor)||this.primaryTextColor,xAxisTickColor:((s=this.xyChart)==null?void 0:s.xAxisTickColor)||this.primaryTextColor,xAxisLineColor:((o=this.xyChart)==null?void 0:o.xAxisLineColor)||this.primaryTextColor,yAxisTitleColor:((a=this.xyChart)==null?void 0:a.yAxisTitleColor)||this.primaryTextColor,yAxisLabelColor:((l=this.xyChart)==null?void 0:l.yAxisLabelColor)||this.primaryTextColor,yAxisTickColor:((c=this.xyChart)==null?void 0:c.yAxisTickColor)||this.primaryTextColor,yAxisLineColor:((h=this.xyChart)==null?void 0:h.yAxisLineColor)||this.primaryTextColor,plotColorPalette:((u=this.xyChart)==null?void 0:u.plotColorPalette)||"#3498db,#2ecc71,#e74c3c,#f1c40f,#bdc3c7,#ffffff,#34495e,#9b59b6,#1abc9c,#e67e22"},this.packet={startByteColor:this.primaryTextColor,endByteColor:this.primaryTextColor,labelColor:this.primaryTextColor,titleColor:this.primaryTextColor,blockStrokeColor:this.primaryTextColor,blockFillColor:this.background},this.radar={axisColor:((d=this.radar)==null?void 0:d.axisColor)||this.lineColor,axisStrokeWidth:((f=this.radar)==null?void 0:f.axisStrokeWidth)||2,axisLabelFontSize:((p=this.radar)==null?void 0:p.axisLabelFontSize)||12,curveOpacity:((m=this.radar)==null?void 0:m.curveOpacity)||.5,curveStrokeWidth:((g=this.radar)==null?void 0:g.curveStrokeWidth)||2,graticuleColor:((y=this.radar)==null?void 0:y.graticuleColor)||"#DEDEDE",graticuleStrokeWidth:((b=this.radar)==null?void 0:b.graticuleStrokeWidth)||1,graticuleOpacity:((x=this.radar)==null?void 0:x.graticuleOpacity)||.3,legendBoxSize:((S=this.radar)==null?void 0:S.legendBoxSize)||12,legendFontSize:((k=this.radar)==null?void 0:k.legendFontSize)||12},this.classText=this.primaryTextColor,this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?it(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=Ve(this.secondaryColor,20),this.git1=Ve(this.pie2||this.secondaryColor,20),this.git2=Ve(this.pie3||this.tertiaryColor,20),this.git3=Ve(this.pie4||X(this.primaryColor,{h:-30}),20),this.git4=Ve(this.pie5||X(this.primaryColor,{h:-60}),20),this.git5=Ve(this.pie6||X(this.primaryColor,{h:-90}),10),this.git6=Ve(this.pie7||X(this.primaryColor,{h:60}),10),this.git7=Ve(this.pie8||X(this.primaryColor,{h:120}),20),this.gitInv0=this.gitInv0||Ee(this.git0),this.gitInv1=this.gitInv1||Ee(this.git1),this.gitInv2=this.gitInv2||Ee(this.git2),this.gitInv3=this.gitInv3||Ee(this.git3),this.gitInv4=this.gitInv4||Ee(this.git4),this.gitInv5=this.gitInv5||Ee(this.git5),this.gitInv6=this.gitInv6||Ee(this.git6),this.gitInv7=this.gitInv7||Ee(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||Ee(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||Ee(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Ve(this.background,12),this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Ve(this.background,2),this.nodeBorder=this.nodeBorder||"#999"}calculate(e){if(typeof e!="object"){this.updateColors();return}const r=Object.keys(e);r.forEach(n=>{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},C(hf,"Theme"),hf),_Se=C(t=>{const e=new TSe;return e.calculate(t),e},"getThemeVariables"),uf,MSe=(uf=class{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=X(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=X(this.primaryColor,{h:-160}),this.primaryBorderColor=ni(this.primaryColor,this.darkMode),this.secondaryBorderColor=ni(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ni(this.tertiaryColor,this.darkMode),this.primaryTextColor=Ee(this.primaryColor),this.secondaryTextColor=Ee(this.secondaryColor),this.tertiaryTextColor=Ee(this.tertiaryColor),this.lineColor=Ee(this.background),this.textColor=Ee(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.border2="#aaaa33",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="rgba(232,232,232, 0.8)",this.textColor="#333",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="calculated",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="calculated",this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor="calculated",this.taskTextOutsideColor=this.taskTextDarkColor,this.taskTextClickableColor="calculated",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBorderColor="calculated",this.critBkgColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.sectionBkgColor=Bm(102,102,255,.49),this.altSectionBkgColor="white",this.sectionBkgColor2="#fff400",this.taskBorderColor="#534fbc",this.taskBkgColor="#8a90dd",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="#534fbc",this.activeTaskBkgColor="#bfc7ff",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="navy",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd="calculated",this.rowEven="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.updateColors()}updateColors(){var e,r,n,i,s,o,a,l,c,h,u,d,f,p,m,g,y,b,x,S,k;this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||X(this.primaryColor,{h:30}),this.cScale4=this.cScale4||X(this.primaryColor,{h:60}),this.cScale5=this.cScale5||X(this.primaryColor,{h:90}),this.cScale6=this.cScale6||X(this.primaryColor,{h:120}),this.cScale7=this.cScale7||X(this.primaryColor,{h:150}),this.cScale8=this.cScale8||X(this.primaryColor,{h:210}),this.cScale9=this.cScale9||X(this.primaryColor,{h:270}),this.cScale10=this.cScale10||X(this.primaryColor,{h:300}),this.cScale11=this.cScale11||X(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||it(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||it(this.tertiaryColor,40);for(let w=0;w<this.THEME_COLOR_LIMIT;w++)this["cScale"+w]=it(this["cScale"+w],10),this["cScalePeer"+w]=this["cScalePeer"+w]||it(this["cScale"+w],25);for(let w=0;w<this.THEME_COLOR_LIMIT;w++)this["cScaleInv"+w]=this["cScaleInv"+w]||X(this["cScale"+w],{h:180});for(let w=0;w<5;w++)this["surface"+w]=this["surface"+w]||X(this.mainBkg,{h:30,l:-(5+w*5)}),this["surfacePeer"+w]=this["surfacePeer"+w]||X(this.mainBkg,{h:30,l:-(7+w*5)});if(this.scaleLabelColor=this.scaleLabelColor!=="calculated"&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor,this.labelTextColor!=="calculated"){this.cScaleLabel0=this.cScaleLabel0||Ee(this.labelTextColor),this.cScaleLabel3=this.cScaleLabel3||Ee(this.labelTextColor);for(let w=0;w<this.THEME_COLOR_LIMIT;w++)this["cScaleLabel"+w]=this["cScaleLabel"+w]||this.labelTextColor}this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.textColor,this.edgeLabelBackgroun
vendor: 4,252 bytes, line 1161
1161d=this.labelBackground,this.actorBorder=Ve(this.border1,23),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.signalColor=this.textColor,this.signalTextColor=this.textColor,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.rowOdd=this.rowOdd||Ve(this.primaryColor,75)||"#ffffff",this.rowEven=this.rowEven||Ve(this.primaryColor,1),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=X(this.primaryColor,{h:64}),this.fillType3=X(this.secondaryColor,{h:64}),this.fillType4=X(this.primaryColor,{h:-64}),this.fillType5=X(this.secondaryColor,{h:-64}),this.fillType6=X(this.primaryColor,{h:128}),this.fillType7=X(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||X(this.tertiaryColor,{l:-40}),this.pie4=this.pie4||X(this.primaryColor,{l:-10}),this.pie5=this.pie5||X(this.secondaryColor,{l:-30}),this.pie6=this.pie6||X(this.tertiaryColor,{l:-20}),this.pie7=this.pie7||X(this.primaryColor,{h:60,l:-20}),this.pie8=this.pie8||X(this.primaryColor,{h:-60,l:-40}),this.pie9=this.pie9||X(this.primaryColor,{h:120,l:-40}),this.pie10=this.pie10||X(this.primaryColor,{h:60,l:-40}),this.pie11=this.pie11||X(this.primaryColor,{h:-90,l:-40}),this.pie12=this.pie12||X(this.primaryColor,{h:120,l:-30}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||X(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||X(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||X(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||X(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||X(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||X(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||K1(this.quadrant1Fill)?Ve(this.quadrant1Fill):it(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExter
vendor: 31,161 bytes, line 1161
1161nalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.radar={axisColor:((e=this.radar)==null?void 0:e.axisColor)||this.lineColor,axisStrokeWidth:((r=this.radar)==null?void 0:r.axisStrokeWidth)||2,axisLabelFontSize:((n=this.radar)==null?void 0:n.axisLabelFontSize)||12,curveOpacity:((i=this.radar)==null?void 0:i.curveOpacity)||.5,curveStrokeWidth:((s=this.radar)==null?void 0:s.curveStrokeWidth)||2,graticuleColor:((o=this.radar)==null?void 0:o.graticuleColor)||"#DEDEDE",graticuleStrokeWidth:((a=this.radar)==null?void 0:a.graticuleStrokeWidth)||1,graticuleOpacity:((l=this.radar)==null?void 0:l.graticuleOpacity)||.3,legendBoxSize:((c=this.radar)==null?void 0:c.legendBoxSize)||12,legendFontSize:((h=this.radar)==null?void 0:h.legendFontSize)||12},this.xyChart={backgroundColor:((u=this.xyChart)==null?void 0:u.backgroundColor)||this.background,titleColor:((d=this.xyChart)==null?void 0:d.titleColor)||this.primaryTextColor,xAxisTitleColor:((f=this.xyChart)==null?void 0:f.xAxisTitleColor)||this.primaryTextColor,xAxisLabelColor:((p=this.xyChart)==null?void 0:p.xAxisLabelColor)||this.primaryTextColor,xAxisTickColor:((m=this.xyChart)==null?void 0:m.xAxisTickColor)||this.primaryTextColor,xAxisLineColor:((g=this.xyChart)==null?void 0:g.xAxisLineColor)||this.primaryTextColor,yAxisTitleColor:((y=this.xyChart)==null?void 0:y.yAxisTitleColor)||this.primaryTextColor,yAxisLabelColor:((b=this.xyChart)==null?void 0:b.yAxisLabelColor)||this.primaryTextColor,yAxisTickColor:((x=this.xyChart)==null?void 0:x.yAxisTickColor)||this.primaryTextColor,yAxisLineColor:((S=this.xyChart)==null?void 0:S.yAxisLineColor)||this.primaryTextColor,plotColorPalette:((k=this.xyChart)==null?void 0:k.plotColorPalette)||"#ECECFF,#8493A6,#FFC3A0,#DCDDE1,#B8E994,#D1A36F,#C3CDE6,#FFB6C1,#496078,#F8F3E3"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.labelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||X(this.primaryColor,{h:-30}),this.git4=this.git4||X(this.primaryColor,{h:-60}),this.git5=this.git5||X(this.primaryColor,{h:-90}),this.git6=this.git6||X(this.primaryColor,{h:60}),this.git7=this.git7||X(this.primaryColor,{h:120}),this.darkMode?(this.git0=Ve(this.git0,25),this.git1=Ve(this.git1,25),this.git2=Ve(this.git2,25),this.git3=Ve(this.git3,25),this.git4=Ve(this.git4,25),this.git5=Ve(this.git5,25),this.git6=Ve(this.git6,25),this.git7=Ve(this.git7,25)):(this.git0=it(this.git0,25),this.git1=it(this.git1,25),this.git2=it(this.git2,25),this.git3=it(this.git3,25),this.git4=it(this.git4,25),this.git5=it(this.git5,25),this.git6=it(this.git6,25),this.git7=it(this.git7,25)),this.gitInv0=this.gitInv0||it(Ee(this.git0),25),this.gitInv1=this.gitInv1||Ee(this.git1),this.gitInv2=this.gitInv2||Ee(this.git2),this.gitInv3=this.gitInv3||Ee(this.git3),this.gitInv4=this.gitInv4||Ee(this.git4),this.gitInv5=this.gitInv5||Ee(this.git5),this.gitInv6=this.gitInv6||Ee(this.git6),this.gitInv7=this.gitInv7||Ee(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||Ee(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||Ee(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||l4,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||c4}calculate(e){if(Object.keys(this).forEach(n=>{this[n]==="calculated"&&(this[n]=void 0)}),typeof e!="object"){this.updateColors();return}const r=Object.keys(e);r.forEach(n=>{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},C(uf,"Theme"),uf),ASe=C(t=>{const e=new MSe;return e.calculate(t),e},"getThemeVariables"),df,ESe=(df=class{constructor(){this.background="#f4f4f4",this.primaryColor="#cde498",this.secondaryColor="#cdffb2",this.background="white",this.mainBkg="#cde498",this.secondBkg="#cdffb2",this.lineColor="green",this.border1="#13540c",this.border2="#6eaa49",this.arrowheadColor="green",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.tertiaryColor=Ve("#cde498",10),this.primaryBorderColor=ni(this.primaryColor,this.darkMode),this.secondaryBorderColor=ni(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ni(this.tertiaryColor,this.darkMode),this.primaryTextColor=Ee(this.primaryColor),this.secondaryTextColor=Ee(this.secondaryColor),this.tertiaryTextColor=Ee(this.primaryColor),this.lineColor=Ee(this.background),this.textColor=Ee(this.background),this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#333",this.edgeLabelBackground="#e8e8e8",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="#333",this.signalTextColor="#333",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="#326932",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="#6eaa49",this.altSectionBkgColor="white",this.sectionBkgColor2="#6eaa49",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="#487e3a",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222"}updateColors(){var e,r,n,i,s,o,a,l,c,h,u,d,f,p,m,g,y,b,x,S,k;this.actorBorder=it(this.mainBkg,20),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||X(this.primaryColor,{h:30}),this.cScale4=this.cScale4||X(this.primaryColor,{h:60}),this.cScale5=this.cScale5||X(this.primaryColor,{h:90}),this.cScale6=this.cScale6||X(this.primaryColor,{h:120}),this.cScale7=this.cScale7||X(this.primaryColor,{h:150}),this.cScale8=this.cScale8||X(this.primaryColor,{h:210}),this.cScale9=this.cScale9||X(this.primaryColor,{h:270}),this.cScale10=this.cScale10||X(this.primaryColor,{h:300}),this.cScale11=this.cScale11||X(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||it(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||it(this.tertiaryColor,40);for(let w=0;w<this.THEME_COLOR_LIMIT;w++)this["cScale"+w]=it(this["cScale"+w],10),this["cScalePeer"+w]=this["cScalePeer"+w]||it(this["cScale"+w],25);for(let w=0;w<this.THEME_COLOR_LIMIT;w++)this["cScaleInv"+w]=this["cScaleInv"+w]||X(this["cScale"+w],{h:180});this.scaleLabelColor=this.scaleLabelColor!=="calculated"&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor;for(let w=0;w<this.THEME_COLOR_LIMIT;w++)this["cScaleLabel"+w]=this["cScaleLabel"+w]||this.scaleLabelColor;for(let w=0;w<5;w++)this["surface"+w]=this["surface"+w]||X(this.mainBkg,{h:30,s:-30,l:-(5+w*5)}),this["surfacePeer"+w]=this["surfacePeer"+w]||X(this.mainBkg,{h:30,s:-30,l:-(8+w*5)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.taskBorderColor=this.border1,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.rowOdd=this.rowOdd||Ve(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||Ve(this.mainBkg,20),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=X(this.primaryColor,{h:64}),this.fillType3=X(this.secondaryColor,{h:64}),this.fillType4=X(this.primaryColor,{h:-64}),this.fillType5=X(this.secondaryColor,{h:-64}),this.fillType6=X(this.primaryColor,{h:128}),this.fillType7=X(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||X(this.primaryColor,{l:-30}),this.pie5=this.pie5||X(this.secondaryColor,{l:-30}),this.pie6=this.pie6||X(this.tertiaryColor,{h:40,l:-40}),this.pie7=this.pie7||X(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||X(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||X(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||X(this.primaryColor,{h:60,l:-50}),this.pie11=this.pie11||X(this.primaryColor,{h:-60,l:-50}),this.pie12=this.pie12||X(this.primaryColor,{h:120,l:-50}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||X(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||X(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||X(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||X(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||X(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||X(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||K1(this.quadrant1Fill)?Ve(this.quadrant1Fill):it(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.packet={startByteColor:this.primaryTextColor,endByteColor:this.primaryTextColor,labelColor:this.primaryTextColor,titleColor:this.primaryTextColor,blockStrokeColor:this.primaryTextColor,blockFillColor:this.mainBkg},this.radar={axisColor:((e=this.radar)==null?void 0:e.axisColor)||this.lineColor,axisStrokeWidth:((r=this.radar)==null?void 0:r.axisStrokeWidth)||2,axisLabelFontSize:((n=this.radar)==null?void 0:n.axisLabelFontSize)||12,curveOpacity:((i=this.radar)==null?void 0:i.curveOpacity)||.5,curveStrokeWidth:((s=this.radar)==null?void 0:s.curveStrokeWidth)||2,graticuleColor:((o=this.radar)==null?void 0:o.graticuleColor)||"#DEDEDE",graticuleStrokeWidth:((a=this.radar)==null?void 0:a.graticuleStrokeWidth)||1,graticuleOpacity:((l=this.radar)==null?void 0:l.graticuleOpacity)||.3,legendBoxSize:((c=this.radar)==null?void 0:c.legendBoxSize)||12,legendFontSize:((h=this.radar)==null?void 0:h.legendFontSize)||12},this.xyChart={backgroundColor:((u=this.xyChart)==null?void 0:u.backgroundColor)||this.background,titleColor:((d=this.xyChart)==null?void 0:d.titleColor)||this.primaryTextColor,xAxisTitleColor:((f=this.xyChart)==null?void 0:f.xAxisTitleColor)||this.primaryTextColor,xAxisLabelColor:((p=this.xyChart)==null?void 0:p.xAxisLabelColor)||this.primaryTextColor,xAxisTickColor:((m=this.xyChart)==null?void 0:m.xAxisTickColor)||this.primaryTextColor,xAxisLineColor:((g=this.xyChart)==null?void 0:g.xAxisLineColor)||this.primaryTextColor,yAxisTitleColor:((y=this.xyChart)==null?void 0:y.yAxisTitleColor)||this.primaryTextColor,yAxisLabelColor:((b=this.xyChart)==null?void 0:b.yAxisLabelColor)||this.primaryTextColor,yAxisTickColor:((x=this.xyChart)==null?void 0:x.yAxisTickColor)||this.primaryTextColor,yAxisLineColor:((S=this.xyChart)==null?void 0:S.yAxisLineColor)||this.primaryTextColor,plotColorPalette:((k=this.xyChart)==null?void 0:k.plotColorPalette)||"#CDE498,#FF6B6B,#A0D2DB,#D7BDE2,#F0F0F0,#FFC3A0,#7FD8BE,#FF9A8B,#FAF3E0,#FFF176"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||X(this.primaryColor,{h:-30}),this.git4=this.git4||X(this.primaryColor,{h:-60}),this.git5=this.git5||X(this.primaryColor,{h:-90}),this.git6=this.git6||X(this.primaryColor,{h:60}),this.git7=this.git7||X(this.primaryColor,{h:120}),this.darkMode?(this.git0=Ve(this.git0,25),this.git1=Ve(this.git1,25),this.git2=Ve(this.git2,25),this.git3=Ve(this.git3,25),this.git4=Ve(this.git4,25),this.git5=Ve(this.git5,25),this.git6=Ve(this.git6,25),this.git7=Ve(this.git7,25)):(this.git0=it(this.git0,25),this.git1=it(this.git1,25),this.git2=it(this.git2,25),this.git3=it(this.git3,25),this.git4=it(this.git4,25),this.git5=it(this.git5,25),this.git6=it(this.git6,25),this.git7=it(this.git7,25)),this.gitInv0=this.gitInv0||Ee(this.git0),this.gitInv1=this.gitInv1||Ee(this.git1),this.gitInv2=this.gitInv2||Ee(this.git2),this.gitInv3=this.gitInv3||Ee(this.git3),this.gitInv4=this.gitInv4||Ee(this.git4),this.gitInv5=this.gitInv5||Ee(this.git5),this.gitInv6=this.gitInv6||Ee(this.git6),this.gitInv7=this.gitInv7||Ee(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||Ee(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||Ee(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||l4,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||c4}calculate(e){if(typeof e!="object"){this.updateColors();return}const r=Object.keys(e);r.forEach(n=>{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},C(df,"Theme"),df),OSe=C(t=>{const e=new ESe;return e.calculate(t),e},"getThemeVariables"),ff,LSe=(ff=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=Ve(this.contrast,55),this.background="#ffffff",this.tertiaryColor=X(this.primaryColor,{h:-160}),this.primaryBorderColor=ni(this.primaryColor,this.darkMode),this.secondaryBorderColor=ni(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ni(this.tertiaryColor,this.darkMode),this.primaryTextColor=Ee(this.primaryColor),this.secondaryTextColor=Ee(this.secondaryColor),this.tertiaryTextColor=Ee(this.tertiaryColor),this.lineColor=Ee(this.background),this.textColor=Ee(this.background),this.mainBkg="#eee",this.secondBkg="calculated",this.lineColor="#666",this.border1="#999",this.border2="calculated",this.note="#ffa",this.text="#333",this.critical="#d42",this.done="#bbb",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="white",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor=this.actorBorder,this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="calculated",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="white",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBkgColor="calculated",this.critBorderColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||Ve(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222"}updateColors(){var e,r,n,i,s,o,a,l,c,h,u,d,f,p,m,g,y,b,x,S,k;this.secondBkg=Ve(this.contrast,55),this.border2=this.contrast,this.actorBorder=Ve(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,this.signalColor=this.text,this.signalTextColor=this.text,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.text,this.loopTextColor=this.text,this.noteBorderColor="#999",this.noteBkgColor="#666",this.noteTextColor="#fff",this.cScale0=this.cScale0||"#555",this.cScale1=this.cScale1||"#F4F4F4",this.cScale2=this.cScale2||"#555",this.cScale3=this.cScale3||"#BBB",this.cScale4=this.cScale4||"#777",this.cScale5=this.cScale5||"#999",this.cScale6=this.cScale6||"#DDD",this.cScale7=this.cScale7||"#FFF",this.cScale8=this.cScale8||"#DDD",this.cScale9=this.cScale9||"#BBB",this.cScale10=this.cScale10||"#999",this.cScale11=this.cScale11||"#777";for(let w=0;w<this.THEME_COLOR_LIMIT;w++)this["cScaleInv"+w]=this["cScaleInv"+w]||Ee(this["cScale"+w]);for(let w=0;w<this.THEME_COLOR_LIMIT;w++)this.darkMode?this["cScalePeer"+w]=this["cScalePeer"+w]||Ve(this["cScale"+w],10):this["cScalePeer"+w]=this["cScalePeer"+w]||it(this["cScale"+w],10);this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor),this.cScaleLabel0=this.cScaleLabel0||this.cScale1,this.cScaleLabel2=this.cScaleLabel2||this.cScale1;for(let w=0;w<this.THEME_COLOR_LIMIT;w++)this["cScaleLabel"+w]=this["cScaleLabel"+w]||this.scaleLabelColor;for(let w=0;w<5;w++)this["surface"+w]=this["surface"+w]||X(this.mainBkg,{l:-(5+w*5)}),this["surfacePeer"+w]=this["surfacePeer"+w]||X(this.mainBkg,{l:-(8+w*5)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.text,this.sectionBkgColor=Ve(this.contrast,30),this.sectionBkgColor2=Ve(this.contrast,30),this.taskBorderColor=it(this.contrast,10),this.taskBkgColor=this.contrast,this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor=this.text,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.gridColor=Ve(this.border1,30),this.doneTaskBkgColor=this.done,this.doneTaskBorderColor=this.lineColor,this.critBkgColor=this.critical,this.critBorderColor=it(this.critBkgColor,10),this.todayLineColor=this.critBkgColor,this.vertLineColor=this.critBkgColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||"#000",this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f4f4f4",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.stateBorder=this.stateBorder||"#000",this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#222",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=X(this.primaryColor,{h:64}),this.fillType3=X(this.secondaryColor,{h:64}),this.fillType4=X(this.primaryColor,{h:-64}),this.fillType5=X(this.secondaryColor,{h:-64}),this.fillType6=X(this.primaryColor,{h:128}),this.fillType7=X(this.secondaryColor,{h:128});for(let w=0;w<this.THEME_COLOR_LIMIT;w++)this["pie"+w]=this["cScale"+w];this.pie12=this.pie0,this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||X(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||X(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||X(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||X(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||X(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||X(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||K1(this.quadrant1Fill)?Ve(this.quadrant1Fill):it(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:((e=this.xyChart)==null?void 0:e.backgroundColor)||this.background,titleColor:((r=this.xyChart)==null?void 0:r.titleColor)||this.primaryTextColor,xAxisTitleColor:((n=this.xyChart)==null?void 0:n.xAxisTitleColor)||this.primaryTextColor,xAxisLabelColor:((i=this.xyChart)==null?void 0:i.xAxisLabelColor)||this.primaryTextColor,xAxisTickColor:((s=this.xyChart)==null?void 0:s.xAxisTickColor)||this.primaryTextColor,xAxisLineColor:((o=this.xyChart)==null?void 0:o.xAxisLineColor)||this.primaryTextColor,yAxisTitleColor:((a=this.xyChart)==null?void 0:a.yAxisTitleColor)||this.primaryTextColor,yAxisLabelColor:((l=this.xyChart)==null?void 0:l.yAxisLabelColor)||this.primaryTextColor,yAxisTickColor:((c=this.xyChart)==null?void 0:c.yAxisTickColor)||this.primaryTextColor,yAxisLineColor:((h=this.xyChart)==null?void 0:h.yAxisLineColor)||this.primaryTextColor,plotColorPalette:((u=this.xyChart)==null?void 0:u.plotColorPalette)||"#EEE,#6BB8E4,#8ACB88,#C7ACD6,#E8DCC2,#FFB2A8,#FFF380,#7E8D91,#FFD8B1,#FAF3E0"},this.radar={axisColor:((d=this.radar)==null?void 0:d.axisColor)||this.lineColor,axisStrokeWidth:((f=this.radar)==null?void 0:f.axisStrokeWidth)||2,axisLabelFontSize:((p=this.radar)==null?void 0:p.axisLabelFontSize)||12,curveOpacity:((m=this.radar)==null?void 0:m.curveOpacity)||.5,curveStrokeWidth:((g=this.radar)==null?void 0:g.curveStrokeWidth)||2,graticuleColor:((y=this.radar)==null?void 0:y.graticuleColor)||"#DEDEDE",graticuleStrokeWidth:((b=this.radar)==null?void 0:b.graticuleStrokeWidth)||1,graticuleOpacity:((x=this.radar)==null?void 0:x.graticuleOpacity)||.3,legendBoxSize:((S=this.radar)==null?void 0:S.legendBoxSize)||12,legendFontSize:((k=this.radar)==null?void 0:k.legendFontSize)||12},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=it(this.pie1,25)||this.primaryColor,this.git1=this.pie2||this.secondaryColor,this.git2=this.pie3||this.tertiaryColor,this.git3=this.pie4||X(this.primaryColor,{h:-30}),this.git4=this.pie5||X(this.primaryColor,{h:-60}),this.git5=this.pie6||X(this.primaryColor,{h:-90}),this.git6=this.pie7||X(this.primaryColor,{h:60}),this.git7=this.pie8||X(this.primaryColor,{h:120}),this.gitInv0=this.gitInv0||Ee(this.git0),this.gitInv1=this.gitInv1||Ee(this.git1),this.gitInv2=this.gitInv2||Ee(this.git2),this.gitInv3=this.gitInv3||Ee(this.git3),this.gitInv4=this.gitInv4||Ee(this.git4),this.gitInv5=this.gitInv5||Ee(this.git5),this.gitInv6=this.gitInv6||Ee(this.git6),this.gitInv7=this.gitInv7||Ee(this.git7),this.branchLabelColor=this.branchLabelColor||this.labelTextColor,this.gitBranchLabel0=this.branchLabelColor,this.gitBranchLabel1="white",this.gitBranchLabel2=this.branchLabelColor,this.gitBranchLabel3="white",this.gitBranchLabel4=this.branchLabelColor,this.gitBranchLabel5=this.branchLabelColor,this.gitBranchLabel6=this.branchLabelColor,this.gitBranchLabel7=this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||l4,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||c4}calculate(e){if(typeof e!="object"){this.updateColors();return}const r=Object.keys(e);r.forEach(n=>{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},C(ff,"Theme"),ff),DSe=C(t=>{const e=new LSe;return e.calculate(t),e},"getThemeVariables"),el={base:{getThemeVariables:SSe},dark:{getThemeVariables:_Se},default:{getThemeVariables:ASe},forest:{getThemeVariables:OSe},neutral:{getThemeVariables:DSe}},_o
vendor: 9,639 bytes, line 1161
1161={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:!0,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,defaultRenderer:"dagre-wrapper",wrappingWidth:200,inheritDir:!1},sequence:{useMaxWidth:!0,hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,rightAngles:!1,showSequenceNumbers:!1,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:400,noteFontSize:14,noteFontFamily:'"trebuchet ms", verdana, arial, sans-serif',noteFontWeight:400,noteAlign:"center",messageFontSize:16,messageFontFamily:'"trebuchet ms", verdana, arial, sans-serif',messageFontWeight:400,wrap:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20},gantt:{useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:"%Y-%m-%d",topAxis:!1,displayMode:"",weekday:"sunday"},journey:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,maxLabelWidth:360,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],titleColor:"",titleFontFamily:'"trebuchet ms", verdana, arial, sans-serif',titleFontSize:"4ex"},class:{useMaxWidth:!0,titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,defaultRenderer:"dagre-wrapper",htmlLabels:!1,hideEmptyMembersBox:!1},state:{useMaxWidth:!0,titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:"20",compositTitleSize:35,radius:5,defaultRenderer:"dagre-wrapper"},er:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,nodeSpacing:140,rankSpacing:80,stroke:"gray",fill:"honeydew",fontSize:12},pie:{useMaxWidth:!0,textPosition:.75},quadrantChart:{useMaxWidth:!0,chartWidth:500,chartHeight:500,titleFontSize:20,titlePadding:10,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,xAxisPosition:"top",yAxisPosition:"left",quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2},xyChart:{useMaxWidth:!0,width:700,height:500,titleFontSize:20,titlePadding:10,showDataLabel:!1,showTitle:!0,xAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},yAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},chartOrientation:"vertical",plotReservedSpacePercent:50},requirement:{useMaxWidth:!0,rect_fill:"#f9f9f9",text_color:"#333",rect_border_size:"0.5px",rect_border_color:"#bbb",rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200,layoutAlgorithm:"cose-bilkent"},kanban:{useMaxWidth:!0,padding:8,sectionWidth:200,ticketBaseUrl:""},timeline:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],disableMulticolor:!1},gitGraph:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0,parallelCommits:!1,arrowMarkerAbsolute:!1},c4:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,c4ShapeInRow:4,nextLinePaddingX:0,c4BoundaryInRow:2,personFontSize:14,personFontFamily:'"Open Sans", sans-serif',personFontWeight:"normal",external_personFontSize:14,external_personFontFamily:'"Open Sans", sans-serif',external_personFontWeight:"normal",systemFontSize:14,systemFontFamily:'"Open Sans", sans-serif',systemFontWeight:"normal",external_systemFontSize:14,external_systemFontFamily:'"Open Sans", sans-serif',external_systemFontWeight:"normal",system_dbFontSize:14,system_dbFontFamily:'"Open Sans", sans-serif',system_dbFontWeight:"normal",external_system_dbFontSize:14,external_system_dbFontFamily:'"Open Sans", sans-serif',external_system_dbFontWeight:"normal",system_queueFontSize:14,system_queueFontFamily:'"Open Sans", sans-serif',system_queueFontWeight:"normal",external_system_queueFontSize:14,external_system_queueFontFamily:'"Open Sans", sans-serif',external_system_queueFontWeight:"normal",boundaryFontSize:14,boundaryFontFamily:'"Open Sans", sans-serif',boundaryFontWeight:"normal",messageFontSize:12,messageFontFamily:'"Open Sans", sans-serif',messageFontWeight:"normal",containerFontSize:14,containerFontFamily:'"Open Sans", sans-serif',containerFontWeight:"normal",external_containerFontSize:14,external_containerFontFamily:'"Open Sans", sans-serif',external_containerFontWeight:"normal",container_dbFontSize:14,container_dbFontFamily:'"Open Sans", sans-serif',container_dbFontWeight:"normal",external_container_dbFontSize:14,external_container_dbFontFamily:'"Open Sans", sans-serif',external_container_dbFontWeight:"normal",container_queueFontSize:14,container_queueFontFamily:'"Open Sans", sans-serif',container_queueFontWeight:"normal",external_container_queueFontSize:14,external_container_queueFontFamily:'"Open Sans", sans-serif',external_container_queueFontWeight:"normal",componentFontSize:14,componentFontFamily:'"Open Sans", sans-serif',componentFontWeight:"normal",external_componentFontSize:14,external_componentFontFamily:'"Open Sans", sans-serif',external_componentFontWeight:"normal",component_dbFontSize:14,component_dbFontFamily:'"Open Sans", sans-serif',component_dbFontWeight:"normal",external_component_dbFontSize:14,external_component_dbFontFamily:'"Open Sans", sans-serif',external_component_dbFontWeight:"normal",component_queueFontSize:14,component_queueFontFamily:'"Open Sans", sans-serif',component_queueFontWeight:"normal",external_component_queueFontSize:14,external_component_queueFontFamily:'"Open Sans", sans-serif',external_component_queueFontWeight:"normal",wrap:!0,wrapPadding:10,person_bg_color:"#08427B",person_border_color:"#073B6F",external_person_bg_color:"#686868",external_person_border_color:"#8A8A8A",system_bg_color:"#1168BD",system_border_color:"#3C7FC0",system_db_bg_color:"#1168BD",system_db_border_color:"#3C7FC0",system_queue_bg_color:"#1168BD",system_queue_border_color:"#3C7FC0",external_system_bg_color:"#999999",external_system_border_color:"#8A8A8A",external_system_db_bg_color:"#999999",external_system_db_border_color:"#8A8A8A",external_system_queue_bg_color:"#999999",external_system_queue_border_color:"#8A8A8A",container_bg_color:"#438DD5",container_border_color:"#3C7FC0",container_db_bg_color:"#438DD5",container_db_border_color:"#3C7FC0",container_queue_bg_color:"#438DD5",container_queue_border_color:"#3C7FC0",external_container_bg_color:"#B3B3B3",external_container_border_color:"#A6A6A6",external_container_db_bg_color:"#B3B3B3",external_container_db_border_color:"#A6A6A6",external_container_queue_bg_color:"#B3B3B3",external_container_queue_border_color:"#A6A6A6",component_bg_color:"#85BBF0",component_border_color:"#78A8D8",component_db_bg_color:"#85BBF0",component_db_border_color:"#78A8D8",component_queue_bg_color:"#85BBF0",component_queue_border_color:"#78A8D8",external_component_bg_color:"#CCCCCC",external_component_border_color:"#BFBFBF",external_component_db_bg_color:"#CCCCCC",external_component_db_border_color:"#BFBFBF",external_component_queue_bg_color:"#CCCCCC",external_component_queue_border_color:"#BFBFBF"},sankey:{useMaxWidth:!0,width:600,height:400,linkColor:"gradient",nodeAlignment:"justify",showValues:!0,prefix:"",suffix:""},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,paddingX:5,paddingY:5},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16},radar:{useMaxWidth:!0,width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17},theme:"default",look:"classic",handDrawnSeed:0,layout:"dagre",maxTextSize:5e4,maxEdges:500,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize","suppressErrorRendering","maxEdges"],legacyMathML:!1,forceLegacyMathML:!1,deterministicIds:!1,fontSize:16,markdownAutoWrap:!0,suppressErrorRendering:!1},
vendor: 24,872 bytes, lines 1161-1238
1161Ej={..._o,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:el.default.getThemeVariables(),sequence:{..._o.sequence,messageFont:C(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:C(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:C(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{hideEmptyMembersBox:!1},gantt:{..._o.gantt,tickInterval:void 0,useWidth:void 0},c4:{..._o.c4,useWidth:void 0,personFont:C(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{..._o.flowchart,inheritDir:!1},external_personFont:C(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:C(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:C(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:C(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:C(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:C(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:C(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:C(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:C(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:C(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:C(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:C(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:C(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:C(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:C(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:C(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:C(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:C(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:C(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:C(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:C(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{..._o.pie,useWidth:984},xyChart:{..._o.xyChart,useWidth:void 0},requirement:{..._o.requirement,useWidth:void 0},packet:{..._o.packet},radar:{..._o.radar},treemap:{useMaxWidth:!0,padding:10,diagramPadding:8,showValues:!0,nodeWidth:100,nodeHeight:40,borderWidth:1,valueFontSize:12,labelFontSize:14,valueFormat:","}},Oj=C((t,e="")=>Object.keys(t).reduce((r,n)=>Array.isArray(t[n])?r:typeof t[n]=="object"&&t[n]!==null?[...r,e+n,...Oj(t[n],"")]:[...r,e+n],[]),"keyify"),ISe=new Set(Oj(Ej,"")),Lj=Ej,Wx=C(t=>{if(de.debug("sanitizeDirective called with",t),!(typeof t!="object"||t==null)){if(Array.isArray(t)){t.forEach(e=>Wx(e));return}for(const e of Object.keys(t)){if(de.debug("Checking key",e),e.startsWith("__")||e.includes("proto")||e.includes("constr")||!ISe.has(e)||t[e]==null){de.debug("sanitize deleting key: ",e),delete t[e];continue}if(typeof t[e]=="object"){de.debug("sanitizing object",e),Wx(t[e]);continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const n of r)e.includes(n)&&(de.debug("sanitizing css option",e),t[e]=BSe(t[e]))}if(t.themeVariables)for(const e of Object.keys(t.themeVariables)){const r=t.themeVariables[e];r!=null&&r.match&&!r.match(/^[\d "#%(),.;A-Za-z]+$/)&&(t.themeVariables[e]="")}de.debug("After sanitization",t)}},"sanitizeDirective"),BSe=C(t=>{let e=0,r=0;for(const n of t){if(e<r)return"{ /* ERROR: Unbalanced CSS */ }";n==="{"?e++:n==="}"&&r++}return e!==r?"{ /* ERROR: Unbalanced CSS */ }":t},"sanitizeCss"),Pf=Object.freeze(Lj),Ti=Qr({},Pf),jx,bu=[],Pm=Qr({},Pf),h4=C((t,e)=>{let r=Qr({},t),n={};for(const i of e)Bj(i),n=Qr(n,i);if(r=Qr(r,n),n.theme&&n.theme in el){const i=Qr({},jx),s=Qr(i.themeVariables||{},n.themeVariables);r.theme&&r.theme in el&&(r.themeVariables=el[r.theme].getThemeVariables(s))}return Pm=r,Rj(Pm),Pm},"updateCurrentConfig"),RSe=C(t=>(Ti=Qr({},Pf),Ti=Qr(Ti,t),t.theme&&el[t.theme]&&(Ti.themeVariables=el[t.theme].getThemeVariables(t.themeVariables)),h4(Ti,bu),Ti),"setSiteConfig"),PSe=C(t=>{jx=Qr({},t)},"saveConfigFromInitialize"),NSe=C(t=>(Ti=Qr(Ti,t),h4(Ti,bu),Ti),"updateSiteConfig"),Dj=C(()=>Qr({},Ti),"getSiteConfig"),Ij=C(t=>(Rj(t),Qr(Pm,t),Hn()),"setConfig"),Hn=C(()=>Qr({},Pm),"getConfig"),Bj=C(t=>{t&&(["secure",...Ti.secure??[]].forEach(e=>{Object.hasOwn(t,e)&&(de.debug(`Denied attempt to modify a secure key ${e}`,t[e]),delete t[e])}),Object.keys(t).forEach(e=>{e.startsWith("__")&&delete t[e]}),Object.keys(t).forEach(e=>{typeof t[e]=="string"&&(t[e].includes("<")||t[e].includes(">")||t[e].includes("url(data:"))&&delete t[e],typeof t[e]=="object"&&Bj(t[e])}))},"sanitize"),FSe=C(t=>{var e;Wx(t),t.fontFamily&&!((e=t.themeVariables)!=null&&e.fontFamily)&&(t.themeVariables={...t.themeVariables,fontFamily:t.fontFamily}),bu.push(t),h4(Ti,bu)},"addDirective"),Ux=C((t=Ti)=>{bu=[],h4(t,bu)},"reset"),$Se={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead."},bI={},zSe=C(t=>{bI[t]||(de.warn($Se[t]),bI[t]=!0)},"issueWarning"),Rj=C(t=>{t&&(t.lazyLoadedDiagrams||t.loadExternalDiagramsAtStartup)&&zSe("LAZY_LOAD_DEPRECATED")},"checkConfig"),_De=C(()=>{let t={};jx&&(t=Qr(t,jx));for(const e of bu)t=Qr(t,e);return t},"getUserDefinedConfig"),Y1=/<br\s*\/?>/gi,HSe=C(t=>t?Fj(t).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),qSe=(()=>{let t=!1;return()=>{t||(Pj(),t=!0)}})();function Pj(){const t="data-temp-href-target";An.addHook("beforeSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute("target")&&e.setAttribute(t,e.getAttribute("target")??"")}),An.addHook("afterSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute(t)&&(e.setAttribute("target",e.getAttribute(t)??""),e.removeAttribute(t),e.getAttribute("target")==="_blank"&&e.setAttribute("rel","noopener"))})}C(Pj,"setupDompurifyHooks");var Nj=C(t=>(qSe(),An.sanitize(t)),"removeScript"),xI=C((t,e)=>{var r;if(((r=e.flowchart)==null?void 0:r.htmlLabels)!==!1){const n=e.securityLevel;n==="antiscript"||n==="strict"?t=Nj(t):n!=="loose"&&(t=Fj(t),t=t.replace(/</g,"&lt;").replace(/>/g,"&gt;"),t=t.replace(/=/g,"&equals;"),t=USe(t))}return t},"sanitizeMore"),Rs=C((t,e)=>t&&(e.dompurifyConfig?t=An.sanitize(xI(t,e),e.dompurifyConfig).toString():t=An.sanitize(xI(t,e),{FORBID_TAGS:["style"]}).toString(),t),"sanitizeText"),VSe=C((t,e)=>typeof t=="string"?Rs(t,e):t.flat().map(r=>Rs(r,e)),"sanitizeTextOrArray"),WSe=C(t=>Y1.test(t),"hasBreaks"),jSe=C(t=>t.split(Y1),"splitBreaks"),USe=C(t=>t.replace(/#br#/g,"<br/>"),"placeholderToBreak"),Fj=C(t=>t.replace(Y1,"#br#"),"breakToPlaceholder"),GSe=C(t=>{let e="";return t&&(e=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,e=CSS.escape(e)),e},"getUrl"),rn=C(t=>!(t===!1||["false","null","0"].includes(String(t).trim().toLowerCase())),"evaluate"),KSe=C(function(...t){const e=t.filter(r=>!isNaN(r));return Math.max(...e)},"getMax"),YSe=C(function(...t){const e=t.filter(r=>!isNaN(r));return Math.min(...e)},"getMin"),vI=C(function(t){const e=t.split(/(,)/),r=[];for(let n=0;n<e.length;n++){let i=e[n];if(i===","&&n>0&&n+1<e.length){const s=e[n-1],o=e[n+1];XSe(s,o)&&(i=s+","+o,n++,r.pop())}r.push(JSe(i))}return r.join("")},"parseGenericTypes"),NS=C((t,e)=>Math.max(0,t.split(e).length-1),"countOccurrence"),XSe=C((t,e)=>{const r=NS(t,"~"),n=NS(e,"~");return r===1&&n===1},"shouldCombineSets"),JSe=C(t=>{const e=NS(t,"~");let r=!1;if(e<=1)return t;e%2!==0&&t.startsWith("~")&&(t=t.substring(1),r=!0);const n=[...t];let i=n.indexOf("~"),s=n.lastIndexOf("~");for(;i!==-1&&s!==-1&&i!==s;)n[i]="<",n[s]=">",i=n.indexOf("~"),s=n.lastIndexOf("~");return r&&n.unshift("~"),n.join("")},"processSet"),wI=C(()=>window.MathMLElement!==void 0,"isMathMLSupported"),FS=/\$\$(.*)\$\$/g,Nf=C(t=>{var e;return(((e=t.match(FS))==null?void 0:e.length)??0)>0},"hasKatex"),MDe=C(async(t,e)=>{const r=document.createElement("div");r.innerHTML=await wT(t,e),r.id="katex-temp",r.style.visibility="hidden",r.style.position="absolute",r.style.top="0";const n=document.querySelector("body");n==null||n.insertAdjacentElement("beforeend",r);const i={width:r.clientWidth,height:r.clientHeight};return r.remove(),i},"calculateMathMLDimensions"),ZSe=C(async(t,e)=>{if(!Nf(t))return t;if(!(wI()||e.legacyMathML||e.forceLegacyMathML))return t.replace(FS,"MathML is unsupported in this environment.");{const{default:r}=await J(async()=>{const{default:i}=await Promise.resolve().then(()=>Cke);return{default:i}},void 0),n=e.forceLegacyMathML||!wI()&&e.legacyMathML?"htmlAndMathml":"mathml";return t.split(Y1).map(i=>Nf(i)?`<div style="display: flex; align-items: center; justify-content: center; white-space: nowrap;">${i}</div>`:`<div>${i}</div>`).join("").replace(FS,(i,s)=>r.renderToString(s,{throwOnError:!0,displayMode:!0,output:n}).replace(/\n/g," ").replace(/<annotation.*<\/annotation>/g,""))}},"renderKatexUnsanitized"),wT=C(async(t,e)=>Rs(await ZSe(t,e),e),"renderKatexSanitized"),d0={getRows:HSe,sanitizeText:Rs,sanitizeTextOrArray:VSe,hasBreaks:WSe,splitBreaks:jSe,lineBreakRegex:Y1,removeScript:Nj,getUrl:GSe,evaluate:rn,getMax:KSe,getMin:YSe},QSe=C(function(t,e){for(let r of e)t.attr(r[0],r[1])},"d3Attrs"),e6e=C(function(t,e,r){let n=new Map;return r?(n.set("width","100%"),n.set("style",`max-width: ${e}px;`)):(n.set("height",t),n.set("width",e)),n},"calculateSvgSizeAttrs"),$j=C(function(t,e,r,n){const i=e6e(e,r,n);QSe(t,i)},"configureSvgSize"),t6e=C(function(t,e,r,n){const i=e.node().getBBox(),s=i.width,o=i.height;de.info(`SVG bounds: ${s}x${o}`,i);let a=0,l=0;de.info(`Graph bounds: ${a}x${l}`,t),a=s+r*2,l=o+r*2,de.info(`Calculated bounds: ${a}x${l}`),$j(e,l,a,n);const c=`${i.x-r} ${i.y-r} ${i.width+2*r} ${i.height+2*r}`;e.attr("viewBox",c)},"setupGraphViewbox"),Mb={},r6e=C((t,e,r)=>{let n="";return t in Mb&&Mb[t]?n=Mb[t](r):de.warn(`No theme found for ${t}`),` & {
1162    font-family: ${r.fontFamily};
1163    font-size: ${r.fontSize};
1164    fill: ${r.textColor}
1165  }
1166  @keyframes edge-animation-frame {
1167    from {
1168      stroke-dashoffset: 0;
1169    }
1170  }
1171  @keyframes dash {
1172    to {
1173      stroke-dashoffset: 0;
1174    }
1175  }
1176  & .edge-animation-slow {
1177    stroke-dasharray: 9,5 !important;
1178    stroke-dashoffset: 900;
1179    animation: dash 50s linear infinite;
1180    stroke-linecap: round;
1181  }
1182  & .edge-animation-fast {
1183    stroke-dasharray: 9,5 !important;
1184    stroke-dashoffset: 900;
1185    animation: dash 20s linear infinite;
1186    stroke-linecap: round;
1187  }
1188  /* Classes common for multiple diagrams */
1189
1190  & .error-icon {
1191    fill: ${r.errorBkgColor};
1192  }
1193  & .error-text {
1194    fill: ${r.errorTextColor};
1195    stroke: ${r.errorTextColor};
1196  }
1197
1198  & .edge-thickness-normal {
1199    stroke-width: 1px;
1200  }
1201  & .edge-thickness-thick {
1202    stroke-width: 3.5px
1203  }
1204  & .edge-pattern-solid {
1205    stroke-dasharray: 0;
1206  }
1207  & .edge-thickness-invisible {
1208    stroke-width: 0;
1209    fill: none;
1210  }
1211  & .edge-pattern-dashed{
1212    stroke-dasharray: 3;
1213  }
1214  .edge-pattern-dotted {
1215    stroke-dasharray: 2;
1216  }
1217
1218  & .marker {
1219    fill: ${r.lineColor};
1220    stroke: ${r.lineColor};
1221  }
1222  & .marker.cross {
1223    stroke: ${r.lineColor};
1224  }
1225
1226  & svg {
1227    font-family: ${r.fontFamily};
1228    font-size: ${r.fontSize};
1229  }
1230   & p {
1231    margin: 0
1232   }
1233
1234  ${n}
1235
1236  ${e}
1237`},"getStyles"),n6e=C((t,e)=>{e!==void 0&&(Mb[t]=e)},"addStylesForDiagram"),i6e=r6e,zj={};fSe(zj,{clear:()=>s6e,getAccDescription:()=>c6e,getAccTitle:()=>a6e,getDiagramTitle:()=>u6e,setAccDescription:()=>l6e,setAccTitle:()=>o6e,setDiagramTitle:()=>h6e});var kT="",CT="",ST="",TT=C(t=>Rs(t,Hn()),"sanitizeText"),s6e=C(()=>{kT="",ST="",CT=""},"clear"),o6e=C(t=>{kT=TT(t).replace(/^\s+/g,"")},"setAccTitle"),a6e=C(()=>kT,"getAccTitle"),l6e=C(t=>{ST=TT(t).replace(/\n\s+/g,`
1238`)},"setAccDescription"),c6e=C(()=>ST,"getAccDescription"),h6e=C(t=>{CT=TT(t)},"setDiagramTitle"),u6e=C(()=>CT,"getDiagramTitle"),kI=de,d6e=xT,Zt=Hn,ADe=Ij,EDe=Pf,_T=C(t=>Rs(t,Zt()),"sanitizeText"),f6e=t6e,p6e=C(()=>zj,"getCommonDb"),Gx={},Kx=C((t,e,r)=>{var n;Gx[t]&&kI.warn(`Diagram with id ${t} already registered. Overwriting.`),Gx[t]=e,r&&Aj(t,r),n6e(t,e.styles),(n=e.injectUtils)==null||n.call(e,kI,d6e,Zt,_T,f6e,p6e(),()=>{})},"registerDiagram"),$S=C(t=>{if(t in Gx)return Gx[t];throw new m6e(t)},"getDiagram"),pf,m6e=(pf=class extends Error{constructor(e){super(`Diagram ${e} not found.`)}},C(pf,"DiagramNotFoundError"),pf),g6e={value:()=>{}};function Hj(){for(var t=0,e=arguments.length,r={},n;t<e;++t){if(!(n=arguments[t]+"")||n in r||/[\s.]/.test(n))throw new Error("illegal type: "+n);r[n]=[]}return new Ab(r)}function Ab(t){this._=t}function y6e(t,e){return t.trim().split(/^|\s+/).map(function(r){var n="",i=r.indexOf(".");if(i>=0&&(n=r.slice(i+1),r=r.slice(0,i)),r&&!e.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:n}})}Ab.prototype=Hj.prototype={constructor:Ab,on:function(t,e){var r=this._,n=y6e(t+"",r),i,s=-1,o=n.length;if(arguments.length<2){for(;++s<o;)if((i=(t=n[s]).type)&&(i=b6e(r[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++s<o;)if(i=(t=n[s]).type)r[i]=CI(r[i],t.name,e);else if(e==null)for(i in r)r[i]=CI(r[i],t.name,null);return this},copy:function(){var t={},e=this._;for(var r in e)t[r]=e[r].slice();return new Ab(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var r=new Array(i),n=0,i,s;n<i;++n)r[n]=arguments[n+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(s=this._[t],n=0,i=s.length;n<i;++n)s[n].value.apply(e,r)},apply:function(t,e,r){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var n=this._[t],i=0,s=n.length;i<s;++i)n[i].value.apply(e,r)}};function b6e(t,e){for(var r=0,n=t.length,i;r<n;++r)if((i=t[r]).name===e)return i.value}function CI(t,e,r){for(var n=0,i=t.length;n<i;++n)if(t[n].name===e){t[n]=g6e,t=t.slice(0,n).concat(t.slice(n+1));break}return r!=null&&t.push({name:e,value:r}),t}var zS="http://www.w3.org/1999/xhtml";const SI={svg:"http://www.w3.org/2000/svg",xhtml:zS,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function u4(t){var e=t+="",r=e.indexOf(":");return r>=0&&(e=t.slice(0,r))!=="xmlns"&&(t=t.slice(r+1)),SI.hasOwnProperty(e)?{space:SI[e],local:t}:t}function x6e(t){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===zS&&e.documentElement.namespaceURI===zS?e.createElement(t):e.createElementNS(r,t)}}function v6e(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function qj(t){var e=u4(t);return(e.local?v6e:x6e)(e)}function w6e(){}function MT(t){return t==null?w6e:function(){return this.querySelector(t)}}function k6e(t){typeof t!="function"&&(t=MT(t));for(var e=this._groups,r=e.length,n=new Array(r),i=0;i<r;++i)for(var s=e[i],o=s.length,a=n[i]=new Array(o),l,c,h=0;h<o;++h)(l=s[h])&&(c=t.call(l,l.__data__,h,s))&&("__data__"in l&&(c.__data__=l.__data__),a[h]=c);return new cs(n,this._parents)}function C6e(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function S6e(){return[]}function Vj(t){return t==null?S6e:function(){return this.querySelectorAll(t)}}function T6e(t){return function(){return C6e(t.apply(this,arguments))}}function _6e(t){typeof t=="function"?t=T6e(t):t=Vj(t);for(var e=this._groups,r=e.length,n=[],i=[],s=0;s<r;++s)for(var o=e[s],a=o.length,l,c=0;c<a;++c)(l=o[c])&&(n.push(t.call(l,l.__data__,c,o)),i.push(l));return new cs(n,i)}function Wj(t){return function(){return this.matches(t)}}function jj(t){return function(e){return e.matches(t)}}var M6e=Array.prototype.find;function A6e(t){return function(){return M6e.call(this.children,t)}}function E6e(){return this.firstElementChild}function O6e(t){return this.select(t==null?E6e:A6e(typeof t=="function"?t:jj(t)))}var L6e=Array.prototype.filter;function D6e(){return Array.from(this.children)}function I6e(t){return function(){return L6e.call(this.children,t)}}function B6e(t){return this.selectAll(t==null?D6e:I6e(typeof t=="function"?t:jj(t)))}function R6e(t){typeof t!="function"&&(t=Wj(t));for(var e=this._groups,r=e.length,n=new Array(r),i=0;i<r;++i)for(var s=e[i],o=s.length,a=n[i]=[],l,c=0;c<o;++c)(l=s[c])&&t.call(l,l.__data__,c,s)&&a.push(l);return new cs(n,this._parents)}function Uj(t){return new Array(t.length)}function P6e(){return new cs(this._enter||this._groups.map(Uj),this._parents)}function Yx(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}Yx.prototype={constructor:Yx,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function N6e(t){return function(){return t}}function F6e(t,e,r,n,i,s){for(var o=0,a,l=e.length,c=s.length;o<c;++o)(a=e[o])?(a.__data__=s[o],n[o]=a):r[o]=new Yx(t,s[o]);for(;o<l;++o)(a=e[o])&&(i[o]=a)}function $6e(t,e,r,n,i,s,o){var a,l,c=new Map,h=e.length,u=s.length,d=new Array(h),f;for(a=0;a<h;++a)(l=e[a])&&(d[a]=f=o.call(l,l.__data__,a,e)+"",c.has(f)?i[a]=l:c.set(f,l));for(a=0;a<u;++a)f=o.call(t,s[a],a,s)+"",(l=c.get(f))?(n[a]=l,l.__data__=s[a],c.delete(f)):r[a]=new Yx(t,s[a]);for(a=0;a<h;++a)(l=e[a])&&c.get(d[a])===l&&(i[a]=l)}function z6e(t){return t.__data__}function H6e(t,e){if(!arguments.length)return Array.from(this,z6e);var r=e?$6e:F6e,n=this._parents,i=this._groups;typeof t!="function"&&(t=N6e(t));for(var s=i.length,o=new Array(s),a=new Array(s),l=new Array(s),c=0;c<s;++c){var h=n[c],u=i[c],d=u.length,f=q6e(t.call(h,h&&h.__data__,c,n)),p=f.length,m=a[c]=new Array(p),g=o[c]=new Array(p),y=l[c]=new Array(d);r(h,u,m,g,y,f,e);for(var b=0,x=0,S,k;b<p;++b)if(S=m[b]){for(b>=x&&(x=b+1);!(k=g[x])&&++x<p;);S._next=k||null}}return o=new cs(o,n),o._enter=a,o._exit=l,o}function q6e(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function V6e(){return new cs(this._exit||this._groups.map(Uj),this._parents)}function W6e(t,e,r){var n=this.enter(),i=this,s=this.exit();return typeof t=="function"?(n=t(n),n&&(n=n.selection())):n=n.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),r==null?s.remove():r(s),n&&i?n.merge(i).order():i}function j6e(t){for(var e=t.selection?t.selection():t,r=this._groups,n=e._groups,i=r.length,s=n.length,o=Math.min(i,s),a=new Array(i),l=0;l<o;++l)for(var c=r[l],h=n[l],u=c.length,d=a[l]=new Array(u),f,p=0;p<u;++p)(f=c[p]||h[p])&&(d[p]=f);for(;l<i;++l)a[l]=r[l];return new cs(a,this._parents)}function U6e(){for(var t=this._groups,e=-1,r=t.length;++e<r;)for(var n=t[e],i=n.length-1,s=n[i],o;--i>=0;)(o=n[i])&&(s&&o.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(o,s),s=o);return this}function G6e(t){t||(t=K6e);function e(u,d){return u&&d?t(u.__data__,d.__data__):!u-!d}for(var r=this._groups,n=r.length,i=new Array(n),s=0;s<n;++s){for(var o=r[s],a=o.length,l=i[s]=new Array(a),c,h=0;h<a;++h)(c=o[h])&&(l[h]=c);l.sort(e)}return new cs(i,this._parents).order()}function K6e(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Y6e(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function X6e(){return Array.from(this)}function J6e(){for(var t=this._groups,e=0,r=t.length;e<r;++e)for(var n=t[e],i=0,s=n.length;i<s;++i){var o=n[i];if(o)return o}return null}function Z6e(){let t=0;for(const e of this)++t;return t}function Q6e(){return!this.node()}function e7e(t){for(var e=this._groups,r=0,n=e.length;r<n;++r)for(var i=e[r],s=0,o=i.length,a;s<o;++s)(a=i[s])&&t.call(a,a.__data__,s,i);return this}function t7e(t){return function(){this.removeAttribute(t)}}function r7e(t){return function(){this.removeAttributeNS(t.space,t.local)}}function n7e(t,e){return function(){this.setAttribute(t,e)}}function i7e(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function s7e(t,e){return function(){var r=e.apply(this,arguments);r==null?this.removeAttribute(t):this.setAttribute(t,r)}}function o7e(t,e){return function(){var r=e.apply(this,arguments);r==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,r)}}function a7e(t,e){var r=u4(t);if(arguments.length<2){var n=this.node();return r.local?n.getAttributeNS(r.space,r.local):n.getAttribute(r)}return this.each((e==null?r.local?r7e:t7e:typeof e=="function"?r.local?o7e:s7e:r.local?i7e:n7e)(r,e))}function Gj(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function l7e(t){return function(){this.style.removeProperty(t)}}function c7e(t,e,r){return function(){this.style.setProperty(t,e,r)}}function h7e(t,e,r){return function(){var n=e.apply(this,arguments);n==null?this.style.removeProperty(t):this.style.setProperty(t,n,r)}}function u7e(t,e,r){return arguments.length>1?this.each((e==null?l7e:typeof e=="function"?h7e:c7e)(t,e,r??"")):Ff(this.node(),t)}function Ff(t,e){return t.style.getPropertyValue(e)||Gj(t).getComputedStyle(t,null).getPropertyValue(e)}function d7e(t){return function(){delete this[t]}}function f7e(t,e){return function(){this[t]=e}}function p7e(t,e){return function(){var r=e.apply(this,arguments);r==null?delete this[t]:this[t]=r}}function m7e(t,e){return arguments.length>1?this.each((e==null?d7e:typeof e=="function"?p7e:f7e)(t,e)):this.node()[t]}function Kj(t){return t.trim().split(/^|\s+/)}function AT(t){return t.classList||new Yj(t)}function Yj(t){this._node=t,this._names=Kj(t.getAttribute("class")||"")}Yj.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function Xj(t,e){for(var r=AT(t),n=-1,i=e.length;++n<i;)r.add(e[n])}function Jj(t,e){for(var r=AT(t),n=-1,i=e.length;++n<i;)r.remove(e[n])}function g7e(t){return function(){Xj(this,t)}}function y7e(t){return function(){Jj(this,t)}}function b7e(t,e){return function(){(e.apply(this,arguments)?Xj:Jj)(this,t)}}function x7e(t,e){var r=Kj(t+"");
vendor: 8,720 bytes, line 1238
1238if(arguments.length<2){for(var n=AT(this.node()),i=-1,s=r.length;++i<s;)if(!n.contains(r[i]))return!1;return!0}return this.each((typeof e=="function"?b7e:e?g7e:y7e)(r,e))}function v7e(){this.textContent=""}function w7e(t){return function(){this.textContent=t}}function k7e(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function C7e(t){return arguments.length?this.each(t==null?v7e:(typeof t=="function"?k7e:w7e)(t)):this.node().textContent}function S7e(){this.innerHTML=""}function T7e(t){return function(){this.innerHTML=t}}function _7e(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function M7e(t){return arguments.length?this.each(t==null?S7e:(typeof t=="function"?_7e:T7e)(t)):this.node().innerHTML}function A7e(){this.nextSibling&&this.parentNode.appendChild(this)}function E7e(){return this.each(A7e)}function O7e(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function L7e(){return this.each(O7e)}function D7e(t){var e=typeof t=="function"?t:qj(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function I7e(){return null}function B7e(t,e){var r=typeof t=="function"?t:qj(t),n=e==null?I7e:typeof e=="function"?e:MT(e);return this.select(function(){return this.insertBefore(r.apply(this,arguments),n.apply(this,arguments)||null)})}function R7e(){var t=this.parentNode;t&&t.removeChild(this)}function P7e(){return this.each(R7e)}function N7e(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function F7e(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function $7e(t){return this.select(t?F7e:N7e)}function z7e(t){return arguments.length?this.property("__data__",t):this.node().__data__}function H7e(t){return function(e){t.call(this,e,this.__data__)}}function q7e(t){return t.trim().split(/^|\s+/).map(function(e){var r="",n=e.indexOf(".");return n>=0&&(r=e.slice(n+1),e=e.slice(0,n)),{type:e,name:r}})}function V7e(t){return function(){var e=this.__on;if(e){for(var r=0,n=-1,i=e.length,s;r<i;++r)s=e[r],(!t.type||s.type===t.type)&&s.name===t.name?this.removeEventListener(s.type,s.listener,s.options):e[++n]=s;++n?e.length=n:delete this.__on}}}function W7e(t,e,r){return function(){var n=this.__on,i,s=H7e(e);if(n){for(var o=0,a=n.length;o<a;++o)if((i=n[o]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=s,i.options=r),i.value=e;return}}this.addEventListener(t.type,s,r),i={type:t.type,name:t.name,value:e,listener:s,options:r},n?n.push(i):this.__on=[i]}}function j7e(t,e,r){var n=q7e(t+""),i,s=n.length,o;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,c=a.length,h;l<c;++l)for(i=0,h=a[l];i<s;++i)if((o=n[i]).type===h.type&&o.name===h.name)return h.value}return}for(a=e?W7e:V7e,i=0;i<s;++i)this.each(a(n[i],e,r));return this}function Zj(t,e,r){var n=Gj(t),i=n.CustomEvent;typeof i=="function"?i=new i(e,r):(i=n.document.createEvent("Event"),r?(i.initEvent(e,r.bubbles,r.cancelable),i.detail=r.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function U7e(t,e){return function(){return Zj(this,t,e)}}function G7e(t,e){return function(){return Zj(this,t,e.apply(this,arguments))}}function K7e(t,e){return this.each((typeof e=="function"?G7e:U7e)(t,e))}function*Y7e(){for(var t=this._groups,e=0,r=t.length;e<r;++e)for(var n=t[e],i=0,s=n.length,o;i<s;++i)(o=n[i])&&(yield o)}var Qj=[null];function cs(t,e){this._groups=t,this._parents=e}function X1(){return new cs([[document.documentElement]],Qj)}function X7e(){return this}cs.prototype=X1.prototype={constructor:cs,select:k6e,selectAll:_6e,selectChild:O6e,selectChildren:B6e,filter:R6e,data:H6e,enter:P6e,exit:V6e,join:W6e,merge:j6e,selection:X7e,order:U6e,sort:G6e,call:Y6e,nodes:X6e,node:J6e,size:Z6e,empty:Q6e,each:e7e,attr:a7e,style:u7e,property:m7e,classed:x7e,text:C7e,html:M7e,raise:E7e,lower:L7e,append:D7e,insert:B7e,remove:P7e,clone:$7e,datum:z7e,on:j7e,dispatch:K7e,[Symbol.iterator]:Y7e};function $t(t){return typeof t=="string"?new cs([[document.querySelector(t)]],[document.documentElement]):new cs([[t]],Qj)}function ET(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function eU(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function J1(){}var Eg=.7,Xx=1/Eg,Ld="\\s*([+-]?\\d+)\\s*",Og="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Jo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",J7e=/^#([0-9a-f]{3,8})$/,Z7e=new RegExp(`^rgb\\(${Ld},${Ld},${Ld}\\)$`),Q7e=new RegExp(`^rgb\\(${Jo},${Jo},${Jo}\\)$`),e8e=new RegExp(`^rgba\\(${Ld},${Ld},${Ld},${Og}\\)$`),t8e=new RegExp(`^rgba\\(${Jo},${Jo},${Jo},${Og}\\)$`),r8e=new RegExp(`^hsl\\(${Og},${Jo},${Jo}\\)$`),n8e=new RegExp(`^hsla\\(${Og},${Jo},${Jo},${Og}\\)$`),TI={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};ET(J1,Lg,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:_I,formatHex:_I,formatHex8:i8e,formatHsl:s8e,formatRgb:MI,toString:MI});function _I(){return this.rgb().formatHex()}function i8e(){return this.rgb().formatHex8()}function s8e(){return tU(this).formatHsl()}function MI(){return this.rgb().formatRgb()}function Lg(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=J7e.exec(t))?(r=e[1].length,e=parseInt(e[1],16),r===6?AI(e):r===3?new Oi(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?l2(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?l2(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Z7e.exec(t))?new Oi(e[1],e[2],e[3],1):(e=Q7e.exec(t))?new Oi(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=e8e.exec(t))?l2(e[1],e[2],e[3],e[4]):(e=t8e.exec(t))?l2(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=r8e.exec(t))?LI(e[1],e[2]/100,e[3]/100,1):(e=n8e.exec(t))?LI(e[1],e[2]/100,e[3]/100,e[4]):TI.hasOwnProperty(t)?AI(TI[t]):t==="transparent"?new Oi(NaN,NaN,NaN,0):null}function AI(t){return new Oi(t>>16&255,t>>8&255,t&255,1)}function l2(t,e,r,n){return n<=0&&(t=e=r=NaN),new Oi(t,e,r,n)}
vendor: 3,035 bytes, line 1238
1238function o8e(t){return t instanceof J1||(t=Lg(t)),t?(t=t.rgb(),new Oi(t.r,t.g,t.b,t.opacity)):new Oi}function HS(t,e,r,n){return arguments.length===1?o8e(t):new Oi(t,e,r,n??1)}function Oi(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}ET(Oi,HS,eU(J1,{brighter(t){return t=t==null?Xx:Math.pow(Xx,t),new Oi(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Eg:Math.pow(Eg,t),new Oi(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Oi(Xh(this.r),Xh(this.g),Xh(this.b),Jx(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:EI,formatHex:EI,formatHex8:a8e,formatRgb:OI,toString:OI}));function EI(){return`#${wh(this.r)}${wh(this.g)}${wh(this.b)}`}function a8e(){return`#${wh(this.r)}${wh(this.g)}${wh(this.b)}${wh((isNaN(this.opacity)?1:this.opacity)*255)}`}function OI(){const t=Jx(this.opacity);return`${t===1?"rgb(":"rgba("}${Xh(this.r)}, ${Xh(this.g)}, ${Xh(this.b)}${t===1?")":`, ${t})`}`}function Jx(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Xh(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function wh(t){return t=Xh(t),(t<16?"0":"")+t.toString(16)}function LI(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new Xs(t,e,r,n)}function tU(t){if(t instanceof Xs)return new Xs(t.h,t.s,t.l,t.opacity);if(t instanceof J1||(t=Lg(t)),!t)return new Xs;if(t instanceof Xs)return t;t=t.rgb();var e=t.r/255,r=t.g/255,n=t.b/255,i=Math.min(e,r,n),s=Math.max(e,r,n),o=NaN,a=s-i,l=(s+i)/2;return a?(e===s?o=(r-n)/a+(r<n)*6:r===s?o=(n-e)/a+2:o=(e-r)/a+4,a/=l<.5?s+i:2-s-i,o*=60):a=l>0&&l<1?0:o,new Xs(o,a,l,t.opacity)}function l8e(t,e,r,n){return arguments.length===1?tU(t):new Xs(t,e,r,n??1)}function Xs(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}ET(Xs,l8e,eU(J1,{brighter(t){return t=t==null?Xx:Math.pow(Xx,t),new Xs(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Eg:Math.pow(Eg,t),new Xs(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new Oi(Dk(t>=240?t-240:t+120,i,n),Dk(t,i,n),Dk(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new Xs(DI(this.h),c2(this.s),c2(this.l),Jx(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Jx(this.opacity);return`${t===1?"hsl(":"hsla("}${DI(this.h)}, ${c2(this.s)*100}%, ${c2(this.l)*100}%${t===1?")":`, ${t})`}`}}));function DI(t){return t=(t||0)%360,t<0?t+360:t}function c2(t){return Math.max(0,Math.min(1,t||0))}function Dk(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}const OT=t=>()=>t;function rU(t,e){return function(r){return t+r*e}}function c8e(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}function ODe(t,e){var r=e-t;return r?rU(t,r>180||r<-180?r-360*Math.round(r/360):r):OT(isNaN(t)?e:t)}
vendor: 5,614 bytes, line 1238
1238function h8e(t){return(t=+t)==1?nU:function(e,r){return r-e?c8e(e,r,t):OT(isNaN(e)?r:e)}}function nU(t,e){var r=e-t;return r?rU(t,r):OT(isNaN(t)?e:t)}const II=function t(e){var r=h8e(e);function n(i,s){var o=r((i=HS(i)).r,(s=HS(s)).r),a=r(i.g,s.g),l=r(i.b,s.b),c=nU(i.opacity,s.opacity);return function(h){return i.r=o(h),i.g=a(h),i.b=l(h),i.opacity=c(h),i+""}}return n.gamma=t,n}(1);function ql(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}var qS=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ik=new RegExp(qS.source,"g");function u8e(t){return function(){return t}}function d8e(t){return function(e){return t(e)+""}}function f8e(t,e){var r=qS.lastIndex=Ik.lastIndex=0,n,i,s,o=-1,a=[],l=[];for(t=t+"",e=e+"";(n=qS.exec(t))&&(i=Ik.exec(e));)(s=i.index)>r&&(s=e.slice(r,s),a[o]?a[o]+=s:a[++o]=s),(n=n[0])===(i=i[0])?a[o]?a[o]+=i:a[++o]=i:(a[++o]=null,l.push({i:o,x:ql(n,i)})),r=Ik.lastIndex;return r<e.length&&(s=e.slice(r),a[o]?a[o]+=s:a[++o]=s),a.length<2?l[0]?d8e(l[0].x):u8e(e):(e=l.length,function(c){for(var h=0,u;h<e;++h)a[(u=l[h]).i]=u.x(c);return a.join("")})}var BI=180/Math.PI,VS={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function iU(t,e,r,n,i,s){var o,a,l;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(l=t*r+e*n)&&(r-=t*l,n-=e*l),(a=Math.sqrt(r*r+n*n))&&(r/=a,n/=a,l/=a),t*n<e*r&&(t=-t,e=-e,l=-l,o=-o),{translateX:i,translateY:s,rotate:Math.atan2(e,t)*BI,skewX:Math.atan(l)*BI,scaleX:o,scaleY:a}}var h2;function p8e(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?VS:iU(e.a,e.b,e.c,e.d,e.e,e.f)}function m8e(t){return t==null||(h2||(h2=document.createElementNS("http://www.w3.org/2000/svg","g")),h2.setAttribute("transform",t),!(t=h2.transform.baseVal.consolidate()))?VS:(t=t.matrix,iU(t.a,t.b,t.c,t.d,t.e,t.f))}function sU(t,e,r,n){function i(c){return c.length?c.pop()+" ":""}function s(c,h,u,d,f,p){if(c!==u||h!==d){var m=f.push("translate(",null,e,null,r);p.push({i:m-4,x:ql(c,u)},{i:m-2,x:ql(h,d)})}else(u||d)&&f.push("translate("+u+e+d+r)}function o(c,h,u,d){c!==h?(c-h>180?h+=360:h-c>180&&(c+=360),d.push({i:u.push(i(u)+"rotate(",null,n)-2,x:ql(c,h)})):h&&u.push(i(u)+"rotate("+h+n)}function a(c,h,u,d){c!==h?d.push({i:u.push(i(u)+"skewX(",null,n)-2,x:ql(c,h)}):h&&u.push(i(u)+"skewX("+h+n)}function l(c,h,u,d,f,p){if(c!==u||h!==d){var m=f.push(i(f)+"scale(",null,",",null,")");p.push({i:m-4,x:ql(c,u)},{i:m-2,x:ql(h,d)})}else(u!==1||d!==1)&&f.push(i(f)+"scale("+u+","+d+")")}return function(c,h){var u=[],d=[];return c=t(c),h=t(h),s(c.translateX,c.translateY,h.translateX,h.translateY,u,d),o(c.rotate,h.rotate,u,d),a(c.skewX,h.skewX,u,d),l(c.scaleX,c.scaleY,h.scaleX,h.scaleY,u,d),c=h=null,function(f){for(var p=-1,m=d.length,g;++p<m;)u[(g=d[p]).i]=g.x(f);return u.join("")}}}var g8e=sU(p8e,"px, ","px)","deg)"),y8e=sU(m8e,", ",")",")"),$f=0,qp=0,J0=0,oU=1e3,Zx,Vp,Qx=0,xu=0,d4=0,Dg=typeof performance=="object"&&performance.now?performance:Date,aU=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function LT(){return xu||(aU(b8e),xu=Dg.now()+d4)}function b8e(){xu=0}function ev(){this._call=this._time=this._next=null}ev.prototype=lU.prototype={constructor:ev,restart:function(t,e,r){if(typeof t!="function")throw new TypeError("callback is not a function");r=(r==null?LT():+r)+(e==null?0:+e),!this._next&&Vp!==this&&(Vp?Vp._next=this:Zx=this,Vp=this),this._call=t,this._time=r,WS()},stop:function(){this._call&&(this._call=null,this._time=1/0,WS())}};function lU(t,e,r){var n=new ev;return n.restart(t,e,r),n}function x8e(){LT(),++$f;for(var t=Zx,e;t;)(e=xu-t._time)>=0&&t._call.call(void 0,e),t=t._next;--$f}function RI(){xu=(Qx=Dg.now())+d4,$f=qp=0;try{x8e()}finally{$f=0,w8e(),xu=0}}function v8e(){var t=Dg.now(),e=t-Qx;e>oU&&(d4-=e,Qx=t)}function w8e(){for(var t,e=Zx,r,n=1/0;e;)e._call?(n>e._time&&(n=e._time),t=e,e=e._next):(r=e._next,e._next=null,e=t?t._next=r:Zx=r);Vp=t,WS(n)}function WS(t){if(!$f){qp&&(qp=clearTimeout(qp));var e=t-xu;e>24?(t<1/0&&(qp=setTimeout(RI,t-Dg.now()-d4)),J0&&(J0=clearInterval(J0))):(J0||(Qx=Dg.now(),J0=setInterval(v8e,oU)),$f=1,aU(RI))}}function PI(t,e,r){var n=new ev;return e=e==null?0:+e,n.restart(i=>{n.stop(),t(i+e)},e,r),n}var k8e=Hj("start","end","cancel","interrupt"),C8e=[],cU=0,NI=1,jS=2,Eb=3,FI=4,US=5,Ob=6;function f4(t,e,r,n,i,s){var o=t.__transition;if(!o)t.__transition={};else if(r in o)return;S8e(t,r,{name:e,index:n,group:i,on:k8e,tween:C8e,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:cU})}function DT(t,e){var r=vo(t,e);if(r.state>cU)throw new Error("too late; already scheduled");return r}function ma(t,e){var r=vo(t,e);if(r.state>Eb)throw new Error("too late; already running");return r}function vo(t,e){var r=t.__transition;if(!r||!(r=r[e]))throw new Error("transition not found");return r}function S8e(t,e,r){var n=t.__transition,i;n[e]=r,r.timer=lU(s,0,r.time);function s(c){r.state=NI,r.timer.restart(o,r.delay,r.time),r.delay<=c&&o(c-r.delay)}function o(c){var h,u,d,f;if(r.state!==NI)return l();for(h in n)if(f=n[h],f.name===r.name){if(f.state===Eb)return PI(o);f.state===FI?(f.state=Ob,f.timer.stop(),f.on.call("interrupt",t,t.__data__,f.index,f.group),delete n[h]):+h<e&&(f.state=Ob,f.timer.stop(),f.on.call("cancel",t,t.__data__,f.index,f.group),delete n[h])}if(PI(function(){r.state===Eb&&(r.state=FI,r.timer.restart(a,r.delay,r.time),a(c))}),r.state=jS,r.on.call("start",t,t.__data__,r.index,r.group),r.state===jS){for(r.state=Eb,i=new Array(d=r.tween.length),h=0,u=-1;h<d;++h)(f=r.tween[h].value.call(t,t.__data__,r.index,r.group))&&(i[
vendor: 4,136 bytes, line 1238
1238++u]=f);i.length=u+1}}function a(c){for(var h=c<r.duration?r.ease.call(null,c/r.duration):(r.timer.restart(l),r.state=US,1),u=-1,d=i.length;++u<d;)i[u].call(t,h);r.state===US&&(r.on.call("end",t,t.__data__,r.index,r.group),l())}function l(){r.state=Ob,r.timer.stop(),delete n[e];for(var c in n)return;delete t.__transition}}function T8e(t,e){var r=t.__transition,n,i,s=!0,o;if(r){e=e==null?null:e+"";for(o in r){if((n=r[o]).name!==e){s=!1;continue}i=n.state>jS&&n.state<US,n.state=Ob,n.timer.stop(),n.on.call(i?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete r[o]}s&&delete t.__transition}}function _8e(t){return this.each(function(){T8e(this,t)})}function M8e(t,e){var r,n;return function(){var i=ma(this,t),s=i.tween;if(s!==r){n=r=s;for(var o=0,a=n.length;o<a;++o)if(n[o].name===e){n=n.slice(),n.splice(o,1);break}}i.tween=n}}function A8e(t,e,r){var n,i;if(typeof r!="function")throw new Error;return function(){var s=ma(this,t),o=s.tween;if(o!==n){i=(n=o).slice();for(var a={name:e,value:r},l=0,c=i.length;l<c;++l)if(i[l].name===e){i[l]=a;break}l===c&&i.push(a)}s.tween=i}}function E8e(t,e){var r=this._id;if(t+="",arguments.length<2){for(var n=vo(this.node(),r).tween,i=0,s=n.length,o;i<s;++i)if((o=n[i]).name===t)return o.value;return null}return this.each((e==null?M8e:A8e)(r,t,e))}function IT(t,e,r){var n=t._id;return t.each(function(){var i=ma(this,n);(i.value||(i.value={}))[e]=r.apply(this,arguments)}),function(i){return vo(i,n).value[e]}}function hU(t,e){var r;return(typeof e=="number"?ql:e instanceof Lg?II:(r=Lg(e))?(e=r,II):f8e)(t,e)}function O8e(t){return function(){this.removeAttribute(t)}}function L8e(t){return function(){this.removeAttributeNS(t.space,t.local)}}function D8e(t,e,r){var n,i=r+"",s;return function(){var o=this.getAttribute(t);return o===i?null:o===n?s:s=e(n=o,r)}}function I8e(t,e,r){var n,i=r+"",s;return function(){var o=this.getAttributeNS(t.space,t.local);return o===i?null:o===n?s:s=e(n=o,r)}}function B8e(t,e,r){var n,i,s;return function(){var o,a=r(this),l;return a==null?void this.removeAttribute(t):(o=this.getAttribute(t),l=a+"",o===l?null:o===n&&l===i?s:(i=l,s=e(n=o,a)))}}function R8e(t,e,r){var n,i,s;return function(){var o,a=r(this),l;return a==null?void this.removeAttributeNS(t.space,t.local):(o=this.getAttributeNS(t.space,t.local),l=a+"",o===l?null:o===n&&l===i?s:(i=l,s=e(n=o,a)))}}function P8e(t,e){var r=u4(t),n=r==="transform"?y8e:hU;return this.attrTween(t,typeof e=="function"?(r.local?R8e:B8e)(r,n,IT(this,"attr."+t,e)):e==null?(r.local?L8e:O8e)(r):(r.local?I8e:D8e)(r,n,e))}function N8e(t,e){return function(r){this.setAttribute(t,e.call(this,r))}}function F8e(t,e){return function(r){this.setAttributeNS(t.space,t.local,e.call(this,r))}}function $8e(t,e){var r,n;function i(){var s=e.apply(this,arguments);return s!==n&&(r=(n=s)&&F8e(t,s)),r}return i._value=e,i}function z8e(t,e){var r,n;function i(){var s=e.apply(this,arguments);return s!==n&&(r=(n=s)&&N8e(t,s)),r}return i._value=e,i}function H8e(t,e){var r="attr."+t;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;var n=u4(t);return this.tween(r,(n.local?$8e:z8e)(n,e))}function q8e(t,e){return function(){DT(this,t).delay=+e.apply(this,arguments)}}function V8e(t,e){return e=+e,function(){DT(this,t).delay=e}}function W8e(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?q8e:V8e)(e,t)):vo(this.node(),e).delay}function j8e(t,e){return function(){ma(this,t).duration=+e.apply(this,arguments)}}function U8e(t,e){return e=+e,function(){ma(this,t).duration=e}}function G8e(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?j8e:U8e)(e,t)):vo(this.node(),e).duration}function K8e(t,e){if(typeof e!="function")throw new Error;return function(){ma(this,t).ease=e}}function Y8e(t){var e=this._id;return arguments.length?this.each(K8e(e,t)):vo(this.node(),e).ease}function X8e(t,e){return function(){var r=e.apply(this,arguments);if(typeof r!="function")throw new Error;ma(this,t).ease=r}}function J8e(t){if(typeof t!="function")throw new Error;return this.each(X8e(this._id,t))}
vendor: 6,403 bytes, line 1238
1238function Z8e(t){typeof t!="function"&&(t=Wj(t));for(var e=this._groups,r=e.length,n=new Array(r),i=0;i<r;++i)for(var s=e[i],o=s.length,a=n[i]=[],l,c=0;c<o;++c)(l=s[c])&&t.call(l,l.__data__,c,s)&&a.push(l);return new dl(n,this._parents,this._name,this._id)}function Q8e(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,r=t._groups,n=e.length,i=r.length,s=Math.min(n,i),o=new Array(n),a=0;a<s;++a)for(var l=e[a],c=r[a],h=l.length,u=o[a]=new Array(h),d,f=0;f<h;++f)(d=l[f]||c[f])&&(u[f]=d);for(;a<n;++a)o[a]=e[a];return new dl(o,this._parents,this._name,this._id)}function e9e(t){return(t+"").trim().split(/^|\s+/).every(function(e){var r=e.indexOf(".");return r>=0&&(e=e.slice(0,r)),!e||e==="start"})}function t9e(t,e,r){var n,i,s=e9e(e)?DT:ma;return function(){var o=s(this,t),a=o.on;a!==n&&(i=(n=a).copy()).on(e,r),o.on=i}}function r9e(t,e){var r=this._id;return arguments.length<2?vo(this.node(),r).on.on(t):this.each(t9e(r,t,e))}function n9e(t){return function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==t)return;e&&e.removeChild(this)}}function i9e(){return this.on("end.remove",n9e(this._id))}function s9e(t){var e=this._name,r=this._id;typeof t!="function"&&(t=MT(t));for(var n=this._groups,i=n.length,s=new Array(i),o=0;o<i;++o)for(var a=n[o],l=a.length,c=s[o]=new Array(l),h,u,d=0;d<l;++d)(h=a[d])&&(u=t.call(h,h.__data__,d,a))&&("__data__"in h&&(u.__data__=h.__data__),c[d]=u,f4(c[d],e,r,d,c,vo(h,r)));return new dl(s,this._parents,e,r)}function o9e(t){var e=this._name,r=this._id;typeof t!="function"&&(t=Vj(t));for(var n=this._groups,i=n.length,s=[],o=[],a=0;a<i;++a)for(var l=n[a],c=l.length,h,u=0;u<c;++u)if(h=l[u]){for(var d=t.call(h,h.__data__,u,l),f,p=vo(h,r),m=0,g=d.length;m<g;++m)(f=d[m])&&f4(f,e,r,m,d,p);s.push(d),o.push(h)}return new dl(s,o,e,r)}var a9e=X1.prototype.constructor;function l9e(){return new a9e(this._groups,this._parents)}function c9e(t,e){var r,n,i;return function(){var s=Ff(this,t),o=(this.style.removeProperty(t),Ff(this,t));return s===o?null:s===r&&o===n?i:i=e(r=s,n=o)}}function uU(t){return function(){this.style.removeProperty(t)}}function h9e(t,e,r){var n,i=r+"",s;return function(){var o=Ff(this,t);return o===i?null:o===n?s:s=e(n=o,r)}}function u9e(t,e,r){var n,i,s;return function(){var o=Ff(this,t),a=r(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(t),Ff(this,t))),o===l?null:o===n&&l===i?s:(i=l,s=e(n=o,a))}}function d9e(t,e){var r,n,i,s="style."+e,o="end."+s,a;return function(){var l=ma(this,t),c=l.on,h=l.value[s]==null?a||(a=uU(e)):void 0;(c!==r||i!==h)&&(n=(r=c).copy()).on(o,i=h),l.on=n}}function f9e(t,e,r){var n=(t+="")=="transform"?g8e:hU;return e==null?this.styleTween(t,c9e(t,n)).on("end.style."+t,uU(t)):typeof e=="function"?this.styleTween(t,u9e(t,n,IT(this,"style."+t,e))).each(d9e(this._id,t)):this.styleTween(t,h9e(t,n,e),r).on("end.style."+t,null)}function p9e(t,e,r){return function(n){this.style.setProperty(t,e.call(this,n),r)}}function m9e(t,e,r){var n,i;function s(){var o=e.apply(this,arguments);return o!==i&&(n=(i=o)&&p9e(t,o,r)),n}return s._value=e,s}function g9e(t,e,r){var n="style."+(t+="");if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;return this.tween(n,m9e(t,e,r??""))}function y9e(t){return function(){this.textContent=t}}function b9e(t){return function(){var e=t(this);this.textContent=e??""}}function x9e(t){return this.tween("text",typeof t=="function"?b9e(IT(this,"text",t)):y9e(t==null?"":t+""))}function v9e(t){return function(e){this.textContent=t.call(this,e)}}function w9e(t){var e,r;function n(){var i=t.apply(this,arguments);return i!==r&&(e=(r=i)&&v9e(i)),e}return n._value=t,n}function k9e(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,w9e(t))}function C9e(){for(var t=this._name,e=this._id,r=dU(),n=this._groups,i=n.length,s=0;s<i;++s)for(var o=n[s],a=o.length,l,c=0;c<a;++c)if(l=o[c]){var h=vo(l,e);f4(l,t,r,c,o,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new dl(n,this._parents,t,r)}function S9e(){var t,e,r=this,n=r._id,i=r.size();return new Promise(function(s,o){var a={value:o},l={value:function(){--i===0&&s()}};r.each(function(){var c=ma(this,n),h=c.on;h!==t&&(e=(t=h).copy(),e._.cancel.push(a),e._.interrupt.push(a),e._.end.push(l)),c.on=e}),i===0&&s()})}var T9e=0;function dl(t,e,r,n){this._groups=t,this._parents=e,this._name=r,this._id=n}function dU(){return++T9e}var Ca=X1.prototype;dl.prototype={constructor:dl,select:s9e,selectAll:o9e,selectChild:Ca.selectChild,selectChildren:Ca.selectChildren,filter:Z8e,merge:Q8e,selection:l9e,transition:C9e,call:Ca.call,nodes:Ca.nodes,node:Ca.node,size:Ca.size,empty:Ca.empty,each:Ca.each,on:r9e,attr:P8e,attrTween:H8e,style:f9e,styleTween:g9e,text:x9e,textTween:k9e,remove:i9e,tween:E8e,delay:W8e,duration:G8e,ease:Y8e,easeVarying:J8e,end:S9e,[Symbol.iterator]:Ca[Symbol.iterator]};function _9e(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var M9e={time:null,delay:0,duration:250,ease:_9e};function A9e(t,e){for(var r;!(r=t.__transition)||!(r=r[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return r}function E9e(t){var e,r;t instanceof dl?(e=t._id,t=t._name):(e=dU(),(r=M9e).time=LT(),t=t==null?null:t+"");for(var n=this._groups,i=n.length,s=0;s<i;++s)for(var o=n[s],a=o.length,l,c=0;c<a;++c)(l=o[c])&&f4(l,t,e,c,o,r||A9e(l,e));return new dl(n,this._parents,t,e)}X1.prototype.interrupt=_8e;X1.prototype.transition=E9e;const GS=Math.PI,KS=2*GS,ah=1e-6,O9e=KS-ah;function fU(t){this._+=t[0];for(let e=1,r=t.length;e<r;++e)this._+=arguments[e]+t[e]}function L9e(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return fU;const r=10**e;return function(n){this._+=n[0];for(let i=1,s=n.length;i<s;++i)this._+=Math.round(arguments[i]*r)/r+n[i]}}class D9e{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?fU:L9e(e)}moveTo(e,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,r){this._append`L${this._x1=+e},${this._y1=+r}`}quadraticCurveTo(e,r,n,i){this._append`Q${+e},${+r},${this._x1=+n},${this._y1=+i}`}bezierCurveTo(e,r,n,i,s,o){this._append`C${+e},${+r},${+n}
1238,${+i},${this._x1=+s},${this._y1=+o}`}arcTo(e,r,n,i,s){if(e=+e,r=+r,n=+n,i=+i,s=+s,s<0)throw new Error(`negative radius: ${s}`);let o=this._x1,a=this._y1,l=n-e,c=i-r,h=o-e,u=a-r,d=h*h+u*u;if(this._x1===null)this._append`M${this._x1=e},${this._y1=r}`;else if(d>ah)if(!(Math.abs(u*l-c*h)>ah)||!s)this._append`L${this._x1=e},${this._y1=r}`;else{let f=n-o,p=i-a,m=l*l+c*c,g=f*f+p*p,y=Math.sqrt(m),b=Math.sqrt(d),x=s*Math.tan((GS-Math.acos((m+d-g)/(2*y*b)))/2),S=x/b,k=x/y;Math.abs(S-1)>ah&&this._append`L${e+S*h},${r+S*u}`,this._append`A${s},${s},0,0,${+(u*f>h*p)},${this._x1=e+k*l},${this._y1=r+k*c}`}}arc(e,r,n,i,s,o){if(e=+e,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let a=n*Math.cos(i),l=n*Math.sin(i),c=e+a,h=r+l,u=1^o,d=o?i-s:s-i;this._x1===null?this._append`M${c},${h}`:(Math.abs(this._x1-c)>ah||Math.abs(this._y1-h)>ah)&&this._append`L${c},${h}`,n&&(d<0&&(d=d%KS+KS),d>O9e?this._append`A${n},${n},0,1,${u},${e-a},${r-l}A${n},${n},0,1,${u},${this._x1=c},${this._y1=h}`:d>ah&&this._append`A${n},${n},0,${+(d>=GS)},${u},${this._x1=e+n*Math.cos(s)},${this._y1=r+n*Math.sin(s)}`)}rect(e,r,n,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function Uu(t){return function(){return t}}const LDe=Math.abs,DDe=Math.atan2,IDe=Math.cos,BDe=Math.max,RDe=Math.min,PDe=Math.sin,NDe=Math.sqrt,$I=1e-12,BT=Math.PI,zI=BT/2,FDe=2*BT;function $De(t){return t>1?0:t<-1?BT:Math.acos(t)}function zDe(t){return t>=1?zI:t<=-1?-zI:Math.asin(t)}function I9e(t){let e=3;return t.digits=function(r){if(!arguments.length)return e;if(r==null)e=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);e=n}return t},()=>new D9e(e)}function B9e(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function pU(t){this._context=t}pU.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}}};function tv(t){return new pU(t)}function R9e(t){return t[0]}function P9e(t){return t[1]}function N9e(t,e){var r=Uu(!0),n=null,i=tv,s=null,o=I9e(a);t=typeof t=="function"?t:t===void 0?R9e:Uu(t),e=typeof e=="function"?e:e===void 0?P9e:Uu(e);function a(l){var c,h=(l=B9e(l)).length,u,d=!1,f;for(n==null&&(s=i(f=o())),c=0;c<=h;++c)!(c<h&&r(u=l[c],c,l))===d&&((d=!d)?s.lineStart():s.lineEnd()),d&&s.point(+t(u,c,l),+e(u,c,l));if(f)return s=null,f+""||null}return a.x=function(l){return arguments.length?(t=typeof l=="function"?l:Uu(+l),a):t},a.y=function(l){return arguments.length?(e=typeof l=="function"?l:Uu(+l),a):e},a.defined=function(l){return arguments.length?(r=typeof l=="function"?l:Uu(!!l),a):r},a.curve=function(l){return arguments.length?(i=l,n!=null&&(s=i(n)),a):i},a.context=function(l){return arguments.length?(l==null?n=s=null:s=i(n=l),a):n},a}class mU{constructor(e,r){this._context=e,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,r){switch(e=+e,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,r,e,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,e,this._y0,e,r);break}}this._x0=e,this._y0=r}}function gU(t){return new mU(t,!0)}function yU(t){return new mU(t,!1)}function Sc(){}function rv(t,e,r){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+r)/6)}function p4(t){this._context=t}p4.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:rv(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:rv(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};
vendor: 9,712 bytes, line 1238
1238function Lb(t){return new p4(t)}function bU(t){this._context=t}bU.prototype={areaStart:Sc,areaEnd:Sc,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:rv(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function F9e(t){return new bU(t)}function xU(t){this._context=t}xU.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+t)/6,n=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:rv(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function $9e(t){return new xU(t)}function vU(t,e){this._basis=new p4(t),this._beta=e}vU.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,r=t.length-1;if(r>0)for(var n=t[0],i=e[0],s=t[r]-n,o=e[r]-i,a=-1,l;++a<=r;)l=a/r,this._basis.point(this._beta*t[a]+(1-this._beta)*(n+l*s),this._beta*e[a]+(1-this._beta)*(i+l*o));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};const z9e=function t(e){function r(n){return e===1?new p4(n):new vU(n,e)}return r.beta=function(n){return t(+n)},r}(.85);function nv(t,e,r){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-r),t._x2,t._y2)}function RT(t,e){this._context=t,this._k=(1-e)/6}RT.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:nv(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:nv(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const wU=function t(e){function r(n){return new RT(n,e)}return r.tension=function(n){return t(+n)},r}(0);function PT(t,e){this._context=t,this._k=(1-e)/6}PT.prototype={areaStart:Sc,areaEnd:Sc,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:nv(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const H9e=function t(e){function r(n){return new PT(n,e)}return r.tension=function(n){return t(+n)},r}(0);function NT(t,e){this._context=t,this._k=(1-e)/6}NT.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:nv(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const q9e=function t(e){function r(n){return new NT(n,e)}return r.tension=function(n){return t(+n)},r}(0);function FT(t,e,r){var n=t._x1,i=t._y1,s=t._x2,o=t._y2;if(t._l01_a>$I){var a=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);n=(n*a-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,i=(i*a-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>$I){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,h=3*t._l23_a*(t._l23_a+t._l12_a);s=(s*c+t._x1*t._l23_2a-e*t._l12_2a)/h,o=(o*c+t._y1*t._l23_2a-r*t._l12_2a)/h}t._context.bezierCurveTo(n,i,s,o,t._x2,t._y2)}function kU(t,e){this._context=t,this._alpha=e}kU.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:FT(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const CU=function t(e){function r(n){return e?new kU(n,e):new RT(n,0)}return r.alpha=function(n){return t(+n)},r}(.5);function SU(t,e){this._context=t,this._alpha=e}SU.prototype={areaStart:Sc,areaEnd:Sc,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:FT(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const V9e=function t(e){function r(n){return e?new SU(n,e):new PT(n,0)}return r.alpha=function(n){return t(+n)},r}(.5);function TU(t,e){this._context=t,this._alpha=e}TU.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:FT(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const W9e=function t(e){function r(n){return e?new TU(n,e):new NT(n,0)}return r.alpha=function(n){return t(+n)},r}(.5);function _U(t){this._context=t}_U.prototype={areaStart:Sc,areaEnd:Sc,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function j9e(t){return new _U(t)}function HI(t){return t<0?-1:1}function qI(t,e,r){var n=t._x1-t._x0,i=e-t._x1,s=(t._y1-t._y0)/(n||i<0&&-0),o=(r-t._y1)/(i||n<0&&-0),a=(s*i+o*n)/(n+i);return(HI(s)+HI(o))*Math.min(Math.abs(s),Math.abs(o),.5*Math.abs(a)
vendor: 8,227 bytes, lines 1238-1244
1238)||0}function VI(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function Bk(t,e,r){var n=t._x0,i=t._y0,s=t._x1,o=t._y1,a=(s-n)/3;t._context.bezierCurveTo(n+a,i+a*e,s-a,o-a*r,s,o)}function iv(t){this._context=t}iv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Bk(this,this._t0,VI(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var r=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,Bk(this,VI(this,r=qI(this,t,e)),r);break;default:Bk(this,this._t0,r=qI(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}}};function MU(t){this._context=new AU(t)}(MU.prototype=Object.create(iv.prototype)).point=function(t,e){iv.prototype.point.call(this,e,t)};function AU(t){this._context=t}AU.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,r,n,i,s){this._context.bezierCurveTo(e,t,n,r,s,i)}};function EU(t){return new iv(t)}function OU(t){return new MU(t)}function LU(t){this._context=t}LU.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,r=t.length;if(r)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),r===2)this._context.lineTo(t[1],e[1]);else for(var n=WI(t),i=WI(e),s=0,o=1;o<r;++s,++o)this._context.bezierCurveTo(n[0][s],i[0][s],n[1][s],i[1][s],t[o],e[o]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}};function WI(t){var e,r=t.length-1,n,i=new Array(r),s=new Array(r),o=new Array(r);for(i[0]=0,s[0]=2,o[0]=t[0]+2*t[1],e=1;e<r-1;++e)i[e]=1,s[e]=4,o[e]=4*t[e]+2*t[e+1];for(i[r-1]=2,s[r-1]=7,o[r-1]=8*t[r-1]+t[r],e=1;e<r;++e)n=i[e]/s[e-1],s[e]-=n,o[e]-=n*o[e-1];for(i[r-1]=o[r-1]/s[r-1],e=r-2;e>=0;--e)i[e]=(o[e]-i[e+1])/s[e];for(s[r-1]=(t[r]+i[r-1])/2,e=0;e<r-1;++e)s[e]=2*t[e+1]-i[e+1];return[i,s]}function DU(t){return new LU(t)}function m4(t,e){this._context=t,this._t=e}m4.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var r=this._x*(1-this._t)+t*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,e)}break}}this._x=t,this._y=e}};function IU(t){return new m4(t,.5)}function BU(t){return new m4(t,0)}function RU(t){return new m4(t,1)}function Wp(t,e,r){this.k=t,this.x=e,this.y=r}Wp.prototype={constructor:Wp,scale:function(t){return t===1?this:new Wp(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new Wp(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};Wp.prototype;var U9e=C(t=>{var i;const{securityLevel:e}=Zt();let r=$t("body");if(e==="sandbox"){const o=((i=$t(`#i${t}`).node())==null?void 0:i.contentDocument)??document;r=$t(o.body)}return r.select(`#${t}`)},"selectSvgElement");function $T(t){return typeof t>"u"||t===null}C($T,"isNothing");function PU(t){return typeof t=="object"&&t!==null}C(PU,"isObject");function NU(t){return Array.isArray(t)?t:$T(t)?[]:[t]}C(NU,"toArray");function FU(t,e){var r,n,i,s;if(e)for(s=Object.keys(e),r=0,n=s.length;r<n;r+=1)i=s[r],t[i]=e[i];return t}C(FU,"extend");function $U(t,e){var r="",n;for(n=0;n<e;n+=1)r+=t;return r}C($U,"repeat");function zU(t){return t===0&&Number.NEGATIVE_INFINITY===1/t}C(zU,"isNegativeZero");var G9e=$T,K9e=PU,Y9e=NU,X9e=$U,J9e=zU,Z9e=FU,en={isNothing:G9e,isObject:K9e,toArray:Y9e,repeat:X9e,isNegativeZero:J9e,extend:Z9e};function zT(t,e){var r="",n=t.reason||"(unknown reason)";return t.mark?(t.mark.name&&(r+='in "'+t.mark.name+'" '),r+="("+(t.mark.line+1)+":"+(t.mark.column+1)+")",!e&&t.mark.snippet&&(r+=`
1239
1240`+t.mark.snippet),n+" "+r):n}C(zT,"formatError");function zf(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=zT(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}C(zf,"YAMLException$1");zf.prototype=Object.create(Error.prototype);zf.prototype.constructor=zf;zf.prototype.toString=C(function(e){return this.name+": "+zT(this,e)},"toString");var _i=zf;function Db(t,e,r,n,i){var s="",o="",a=Math.floor(i/2)-1;return n-e>a&&(s=" ... ",e=n-a+s.length),r-n>a&&(o=" ...",r=n+a-o.length),{str:s+t.slice(e,r).replace(/\t/g,"→")+o,pos:n-e+s.length}}C(Db,"getLine");function Ib(t,e){return en.repeat(" ",e-t.length)+t}C(Ib,"padStart");function HU(t,e){if(e=Object.create(e||null),!t.buffer)return null;e.maxLength||(e.maxLength=79),typeof e.indent!="number"&&(e.indent=1),typeof e.linesBefore!="number"&&(e.linesBefore=3),typeof e.linesAfter!="number"&&(e.linesAfter=2);for(var r=/\r?\n|\r|\0/g,n=[0],i=[],s,o=-1;s=r.exec(t.buffer);)i.push(s.index),n.push(s.index+s[0].length),t.position<=s.index&&o<0&&(o=n.length-2);o<0&&(o=n.length-1);var a="",l,c,h=Math.min(t.line+e.linesAfter,i.length).toString().length,u=e.maxLength-(e.indent+h+3);for(l=1;l<=e.linesBefore&&!(o-l<0);l++)c=Db(t.buffer,n[o-l],i[o-l],t.position-(n[o]-n[o-l]),u),a=en.repeat(" ",e.indent)+Ib((t.line-l+1).toString(),h)+" | "+c.str+`
1241`+a;for(c=Db(t.buffer,n[o],i[o],t.position,u),a+=en.repeat(" ",e.indent)+Ib((t.line+1).toString(),h)+" | "+c.str+`
1242`,a+=en.repeat("-",e.indent+h+3+c.pos)+`^
1243`,l=1;l<=e.linesAfter&&!(o+l>=i.length);l++)c=Db(t.buffer,n[o+l],i[o+l],t.position-(n[o]-n[o+l]),u),a+=en.repeat(" ",e.indent)+Ib((t.line+l+1).toString(),h)+" | "+c.str+`
1244`;return a.replace(/\n$/,"")}C(HU,"makeSnippet");var Q9e=HU,eTe=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],tTe=["scalar","sequence","mapping"];function qU(t){var e={};return t!==null&&Object.keys(t).forEach(function(r){t[r].forEach(function(n){e[String(n)]=r})}),e}C(qU,"compileStyleAliases");function VU(t,e){if(e=e||{},Object.keys(e).forEach(function(r){if(eTe.indexOf(r)===-1)throw new _i('Unknown option "'+r+'" is met in definition of "'+t+'" YAML type.')}),this.options=e,this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(r){return r},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.representName=e.representName||null,this.defaultStyle=e.defaultStyle||null,this.multi=e.multi||!1,this.styleAliases=qU(e.styleAliases||null),tTe.indexOf(this.kind)===-1)throw new _i('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}C(VU,"Type$1");var qn=VU;function YS(t,e){var r=[];return t[e].forEach(function(n){var i=r.length;r.forEach(function(s,o){s.tag===n.tag&&s.kind===n.kind&&s.multi===n.multi&&(i=o)}),r[i]=n}
vendor: 7,048 bytes, line 1244
1244),r}C(YS,"compileList");function WU(){var t={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},e,r;function n(i){i.multi?(t.multi[i.kind].push(i),t.multi.fallback.push(i)):t[i.kind][i.tag]=t.fallback[i.tag]=i}for(C(n,"collectType"),e=0,r=arguments.length;e<r;e+=1)arguments[e].forEach(n);return t}C(WU,"compileMap");function sv(t){return this.extend(t)}C(sv,"Schema$1");sv.prototype.extend=C(function(e){var r=[],n=[];if(e instanceof qn)n.push(e);else if(Array.isArray(e))n=n.concat(e);else if(e&&(Array.isArray(e.implicit)||Array.isArray(e.explicit)))e.implicit&&(r=r.concat(e.implicit)),e.explicit&&(n=n.concat(e.explicit));else throw new _i("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(s){if(!(s instanceof qn))throw new _i("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(s.loadKind&&s.loadKind!=="scalar")throw new _i("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(s.multi)throw new _i("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),n.forEach(function(s){if(!(s instanceof qn))throw new _i("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(sv.prototype);return i.implicit=(this.implicit||[]).concat(r),i.explicit=(this.explicit||[]).concat(n),i.compiledImplicit=YS(i,"implicit"),i.compiledExplicit=YS(i,"explicit"),i.compiledTypeMap=WU(i.compiledImplicit,i.compiledExplicit),i},"extend");var rTe=sv,nTe=new qn("tag:yaml.org,2002:str",{kind:"scalar",construct:C(function(t){return t!==null?t:""},"construct")}),iTe=new qn("tag:yaml.org,2002:seq",{kind:"sequence",construct:C(function(t){return t!==null?t:[]},"construct")}),sTe=new qn("tag:yaml.org,2002:map",{kind:"mapping",construct:C(function(t){return t!==null?t:{}},"construct")}),oTe=new rTe({explicit:[nTe,iTe,sTe]});function jU(t){if(t===null)return!0;var e=t.length;return e===1&&t==="~"||e===4&&(t==="null"||t==="Null"||t==="NULL")}C(jU,"resolveYamlNull");function UU(){return null}C(UU,"constructYamlNull");function GU(t){return t===null}C(GU,"isNull");var aTe=new qn("tag:yaml.org,2002:null",{kind:"scalar",resolve:jU,construct:UU,predicate:GU,represent:{canonical:C(function(){return"~"},"canonical"),lowercase:C(function(){return"null"},"lowercase"),uppercase:C(function(){return"NULL"},"uppercase"),camelcase:C(function(){return"Null"},"camelcase"),empty:C(function(){return""},"empty")},defaultStyle:"lowercase"});function KU(t){if(t===null)return!1;var e=t.length;return e===4&&(t==="true"||t==="True"||t==="TRUE")||e===5&&(t==="false"||t==="False"||t==="FALSE")}C(KU,"resolveYamlBoolean");function YU(t){return t==="true"||t==="True"||t==="TRUE"}C(YU,"constructYamlBoolean");function XU(t){return Object.prototype.toString.call(t)==="[object Boolean]"}C(XU,"isBoolean");var lTe=new qn("tag:yaml.org,2002:bool",{kind:"scalar",resolve:KU,construct:YU,predicate:XU,represent:{lowercase:C(function(t){return t?"true":"false"},"lowercase"),uppercase:C(function(t){return t?"TRUE":"FALSE"},"uppercase"),camelcase:C(function(t){return t?"True":"False"},"camelcase")},defaultStyle:"lowercase"});function JU(t){return 48<=t&&t<=57||65<=t&&t<=70||97<=t&&t<=102}C(JU,"isHexCode");function ZU(t){return 48<=t&&t<=55}C(ZU,"isOctCode");function QU(t){return 48<=t&&t<=57}C(QU,"isDecCode");function eG(t){if(t===null)return!1;var e=t.length,r=0,n=!1,i;if(!e)return!1;if(i=t[r],(i==="-"||i==="+")&&(i=t[++r]),i==="0"){if(r+1===e)return!0;if(i=t[++r],i==="b"){for(r++;r<e;r++)if(i=t[r],i!=="_"){if(i!=="0"&&i!=="1")return!1;n=!0}return n&&i!=="_"}if(i==="x"){for(r++;r<e;r++)if(i=t[r],i!=="_"){if(!JU(t.charCodeAt(r)))return!1;n=!0}return n&&i!=="_"}if(i==="o"){for(r++;r<e;r++)if(i=t[r],i!=="_"){if(!ZU(t.charCodeAt(r)))return!1;n=!0}return n&&i!=="_"}}if(i==="_")return!1;for(;r<e;r++)if(i=t[r],i!=="_"){if(!QU(t.charCodeAt(r)))return!1;n=!0}return!(!n||i==="_")}C(eG,"resolveYamlInteger");function tG(t){var e=t,r=1,n;if(e.indexOf("_")!==-1&&(e=e.replace(/_/g,"")),n=e[0],(n==="-"||n==="+")&&(n==="-"&&(r=-1),e=e.slice(1),n=e[0]),e==="0")return 0;if(n==="0"){if(e[1]==="b")return r*parseInt(e.slice(2),2);if(e[1]==="x")return r*parseInt(e.slice(2),16);if(e[1]==="o")return r*parseInt(e.slice(2),8)}return r*parseInt(e,10)}C(tG,"constructYamlInteger");function rG(t){return Object.prototype.toString.call(t)==="[object Number]"&&t%1===0&&!en.isNegativeZero(t)}C(rG,"isInteger");var cTe=new qn("tag:yaml.org,2002:int",{kind:"scalar",resolve:eG,construct:tG,predicate:rG,represent:{binary:C(function(t){return t>=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},"binary"),octal:C(function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},"octal"),decimal:C(function(t){return t.toString(10)},"decimal"),hexadecimal:C(function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),hTe=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function nG(t){return!(t===null||!hTe.test(t)||t[t.length-1]==="_")}C(nG,"resolveYamlFloat");function iG(t){var e,r;return e=t.replace(/_/g,"").toLowerCase(),r=e[0]==="-"?-1:1,"+-".indexOf(e[0])>=0&&(e=e.slice(1)),e===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:e===".nan"?NaN:r*parseFloat(e,10)}C(iG,"constructYamlFloat");var uTe=/^[-+]?[0-9]+e/;function sG(t,e){var r;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(en.isNegativeZero(t))return"-0.0";return r=t.toString(10),uTe.test(r)?r.replace("e",".e"):r}C(sG,"representYamlFloat");function oG(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||en.isNegativeZero(t))}C(oG,"isFloat");var dTe=new qn("tag:yaml.org,2002:float",{kind:"scalar",resolve:nG,construct:iG,predicate:oG,represent:sG,defaultStyle:"lowercase"}),aG=oTe.extend({implicit:[aTe,lTe,cTe,dTe]}),fTe=aG,lG=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),cG=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function hG(t){return t===null?!1:lG.exec(t)!==null||cG.exec(t)!==null}C(hG,"resolveYamlTimestamp");function uG(t){var e,r,n,i,s,o,a,l=0,c=null,h,u,d;if(e=lG.exec(t),e===null&&(e=cG.exec(t)),e===null)throw new Error("Date resolve error");
vendor: 18,293 bytes, lines 1244-1253
1244if(r=+e[1],n=+e[2]-1,i=+e[3],!e[4])return new Date(Date.UTC(r,n,i));if(s=+e[4],o=+e[5],a=+e[6],e[7]){for(l=e[7].slice(0,3);l.length<3;)l+="0";l=+l}return e[9]&&(h=+e[10],u=+(e[11]||0),c=(h*60+u)*6e4,e[9]==="-"&&(c=-c)),d=new Date(Date.UTC(r,n,i,s,o,a,l)),c&&d.setTime(d.getTime()-c),d}C(uG,"constructYamlTimestamp");function dG(t){return t.toISOString()}C(dG,"representYamlTimestamp");var pTe=new qn("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:hG,construct:uG,instanceOf:Date,represent:dG});function fG(t){return t==="<<"||t===null}C(fG,"resolveYamlMerge");var mTe=new qn("tag:yaml.org,2002:merge",{kind:"scalar",resolve:fG}),HT=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
1245\r`;function pG(t){if(t===null)return!1;var e,r,n=0,i=t.length,s=HT;for(r=0;r<i;r++)if(e=s.indexOf(t.charAt(r)),!(e>64)){if(e<0)return!1;n+=6}return n%8===0}C(pG,"resolveYamlBinary");function mG(t){var e,r,n=t.replace(/[\r\n=]/g,""),i=n.length,s=HT,o=0,a=[];for(e=0;e<i;e++)e%4===0&&e&&(a.push(o>>16&255),a.push(o>>8&255),a.push(o&255)),o=o<<6|s.indexOf(n.charAt(e));return r=i%4*6,r===0?(a.push(o>>16&255),a.push(o>>8&255),a.push(o&255)):r===18?(a.push(o>>10&255),a.push(o>>2&255)):r===12&&a.push(o>>4&255),new Uint8Array(a)}C(mG,"constructYamlBinary");function gG(t){var e="",r=0,n,i,s=t.length,o=HT;for(n=0;n<s;n++)n%3===0&&n&&(e+=o[r>>18&63],e+=o[r>>12&63],e+=o[r>>6&63],e+=o[r&63]),r=(r<<8)+t[n];return i=s%3,i===0?(e+=o[r>>18&63],e+=o[r>>12&63],e+=o[r>>6&63],e+=o[r&63]):i===2?(e+=o[r>>10&63],e+=o[r>>4&63],e+=o[r<<2&63],e+=o[64]):i===1&&(e+=o[r>>2&63],e+=o[r<<4&63],e+=o[64],e+=o[64]),e}C(gG,"representYamlBinary");function yG(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}C(yG,"isBinary");var gTe=new qn("tag:yaml.org,2002:binary",{kind:"scalar",resolve:pG,construct:mG,predicate:yG,represent:gG}),yTe=Object.prototype.hasOwnProperty,bTe=Object.prototype.toString;function bG(t){if(t===null)return!0;var e=[],r,n,i,s,o,a=t;for(r=0,n=a.length;r<n;r+=1){if(i=a[r],o=!1,bTe.call(i)!=="[object Object]")return!1;for(s in i)if(yTe.call(i,s))if(!o)o=!0;else return!1;if(!o)return!1;if(e.indexOf(s)===-1)e.push(s);else return!1}return!0}C(bG,"resolveYamlOmap");function xG(t){return t!==null?t:[]}C(xG,"constructYamlOmap");var xTe=new qn("tag:yaml.org,2002:omap",{kind:"sequence",resolve:bG,construct:xG}),vTe=Object.prototype.toString;function vG(t){if(t===null)return!0;var e,r,n,i,s,o=t;for(s=new Array(o.length),e=0,r=o.length;e<r;e+=1){if(n=o[e],vTe.call(n)!=="[object Object]"||(i=Object.keys(n),i.length!==1))return!1;s[e]=[i[0],n[i[0]]]}return!0}C(vG,"resolveYamlPairs");function wG(t){if(t===null)return[];var e,r,n,i,s,o=t;for(s=new Array(o.length),e=0,r=o.length;e<r;e+=1)n=o[e],i=Object.keys(n),s[e]=[i[0],n[i[0]]];return s}C(wG,"constructYamlPairs");var wTe=new qn("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:vG,construct:wG}),kTe=Object.prototype.hasOwnProperty;function kG(t){if(t===null)return!0;var e,r=t;for(e in r)if(kTe.call(r,e)&&r[e]!==null)return!1;return!0}C(kG,"resolveYamlSet");function CG(t){return t!==null?t:{}}C(CG,"constructYamlSet");var CTe=new qn("tag:yaml.org,2002:set",{kind:"mapping",resolve:kG,construct:CG}),SG=fTe.extend({implicit:[pTe,mTe],explicit:[gTe,xTe,wTe,CTe]}),Tc=Object.prototype.hasOwnProperty,ov=1,TG=2,_G=3,av=4,Rk=1,STe=2,jI=3,TTe=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,_Te=/[\x85\u2028\u2029]/,MTe=/[,\[\]\{\}]/,MG=/^(?:!|!!|![a-z\-]+!)$/i,AG=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function XS(t){return Object.prototype.toString.call(t)}C(XS,"_class");function io(t){return t===10||t===13}C(io,"is_EOL");function hc(t){return t===9||t===32}C(hc,"is_WHITE_SPACE");function ii(t){return t===9||t===32||t===10||t===13}C(ii,"is_WS_OR_EOL");function kh(t){return t===44||t===91||t===93||t===123||t===125}C(kh,"is_FLOW_INDICATOR");function EG(t){var e;return 48<=t&&t<=57?t-48:(e=t|32,97<=e&&e<=102?e-97+10:-1)}C(EG,"fromHexCode");function OG(t){return t===120?2:t===117?4:t===85?8:0}C(OG,"escapedHexLen");function LG(t){return 48<=t&&t<=57?t-48:-1}C(LG,"fromDecimalCode");function JS(t){return t===48?"\0":t===97?"\x07":t===98?"\b":t===116||t===9?"	":t===110?`
1246`:t===118?"\v":t===102?"\f":t===114?"\r":t===101?"\x1B":t===32?" ":t===34?'"':t===47?"/":t===92?"\\":t===78?"…":t===95?" ":t===76?"\u2028":t===80?"\u2029":""}C(JS,"simpleEscapeSequence");function DG(t){return t<=65535?String.fromCharCode(t):String.fromCharCode((t-65536>>10)+55296,(t-65536&1023)+56320)}C(DG,"charFromCodepoint");var IG=new Array(256),BG=new Array(256);for(Qc=0;Qc<256;Qc++)IG[Qc]=JS(Qc)?1:0,BG[Qc]=JS(Qc);var Qc;function RG(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||SG,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}C(RG,"State$1");function qT(t,e){var r={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return r.snippet=Q9e(r),new _i(e,r)}C(qT,"generateError");function rt(t,e){throw qT(t,e)}C(rt,"throwError");function Ig(t,e){t.onWarning&&t.onWarning.call(null,qT(t,e))}C(Ig,"throwWarning");var UI={YAML:C(function(e,r,n){var i,s,o;e.version!==null&&rt(e,"duplication of %YAML directive"),n.length!==1&&rt(e,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),i===null&&rt(e,"ill-formed argument of the YAML directive"),s=parseInt(i[1],10),o=parseInt(i[2],10),s!==1&&rt(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=o<2,o!==1&&o!==2&&Ig(e,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:C(function(e,r,n){var i,s;n.length!==2&&rt(e,"TAG directive accepts exactly two arguments"),i=n[0],s=n[1],MG.test(i)||rt(e,"ill-formed tag handle (first argument) of the TAG directive"),Tc.call(e.tagMap,i)&&rt(e,'there is a previously declared suffix for "'+i+'" tag handle'),AG.test(s)||rt(e,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch{rt(e,"tag prefix is malformed: "+s)}e.tagMap[i]=s},"handleTagDirective")};function tl(t,e,r,n){var i,s,o,a;if(e<r){if(a=t.input.slice(e,r),n)for(i=0,s=a.length;i<s;i+=1)o=a.charCodeAt(i),o===9||32<=o&&o<=1114111||rt(t,"expected valid JSON character");else TTe.test(a)&&rt(t,"the stream contains non-printable characters");t.result+=a}}C(tl,"captureSegment");function ZS(t,e,r,n){var i,s,o,a;for(en.isObject(r)||rt(t,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(r),o=0,a=i.length;o<a;o+=1)s=i[o],Tc.call(e,s)||(e[s]=r[s],n[s]=!0)}C(ZS,"mergeMappings");function Ch(t,e,r,n,i,s,o,a,l){var c,h;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),c=0,h=i.length;c<h;c+=1)Array.isArray(i[c])&&rt(t,"nested arrays are not supported inside keys"),typeof i=="object"&&XS(i[c])==="[object Object]"&&(i[c]="[object Object]");if(typeof i=="object"&&XS(i)==="[object Object]"&&(i="[object Object]"),i=String(i),e===null&&(e={}),n==="tag:yaml.org,2002:merge")if(Array.isArray(s))for(c=0,h=s.length;c<h;c+=1)ZS(t,e,s[c],r);else ZS(t,e,s,r);else!t.json&&!Tc.call(r,i)&&Tc.call(e,i)&&(t.line=o||t.line,t.lineStart=a||t.lineStart,t.position=l||t.position,rt(t,"duplicated mapping key")),i==="__proto__"?Object.defineProperty(e,i,{configurable:!0,enumerable:!0,writable:!0,value:s}):e[i]=s,delete r[i];return e}C(Ch,"storeMappingPair");function g4(t){var e;e=t.input.charCodeAt(t.position),e===10?t.position++:e===13?(t.position++,t.input.charCodeAt(t.position)===10&&t.position++):rt(t,"a line break is expected"),t.line+=1,t.lineStart=t.position,t.firstTabInLine=-1}C(g4,"readLineBreak");function Fr(t,e,r){for(var n=0,i=t.input.charCodeAt(t.position);i!==0;){for(;hc(i);)i===9&&t.firstTabInLine===-1&&(t.firstTabInLine=t.position),i=t.input.charCodeAt(++t.position);if(e&&i===35)do i=t.input.charCodeAt(++t.position);while(i!==10&&i!==13&&i!==0);if(io(i))for(g4(t),i=t.input.charCodeAt(t.position),n++,t.lineIndent=0;i===32;)t.lineIndent++,i=t.input.charCodeAt(++t.position);else break}return r!==-1&&n!==0&&t.lineIndent<r&&Ig(t,"deficient indentation"),n}C(Fr,"skipSeparationSpace");function Z1(t){var e=t.position,r;return r=t.input.charCodeAt(e),!!((r===45||r===46)&&r===t.input.charCodeAt(e+1)&&r===t.input.charCodeAt(e+2)&&(e+=3,r=t.input.charCodeAt(e),r===0||ii(r)))}C(Z1,"testDocumentSeparator");function y4(t,e){e===1?t.result+=" ":e>1&&(t.result+=en.repeat(`
1247`,e-1))}C(y4,"writeFoldedLines");function PG(t,e,r){var n,i,s,o,a,l,c,h,u=t.kind,d=t.result,f;if(f=t.input.charCodeAt(t.position),ii(f)||kh(f)||f===35||f===38||f===42||f===33||f===124||f===62||f===39||f===34||f===37||f===64||f===96||(f===63||f===45)&&(i=t.input.charCodeAt(t.position+1),ii(i)||r&&kh(i)))return!1;for(t.kind="scalar",t.result="",s=o=t.position,a=!1;f!==0;){if(f===58){if(i=t.input.charCodeAt(t.position+1),ii(i)||r&&kh(i))break}else if(f===35){if(n=t.input.charCodeAt(t.position-1),ii(n))break}else{if(t.position===t.lineStart&&Z1(t)||r&&kh(f))break;if(io(f))if(l=t.line,c=t.lineStart,h=t.lineIndent,Fr(t,!1,-1),t.lineIndent>=e){a=!0,f=t.input.charCodeAt(t.position);continue}else{t.position=o,t.line=l,t.lineStart=c,t.lineIndent=h;break}}a&&(tl(t,s,o,!1),y4(t,t.line-l),s=o=t.position,a=!1),hc(f)||(o=t.position+1),f=t.input.charCodeAt(++t.position)}return tl(t,s,o,!1),t.result?!0:(t.kind=u,t.result=d,!1)}C(PG,"readPlainScalar");function NG(t,e){var r,n,i;if(r=t.input.charCodeAt(t.position),r!==39)return!1;for(t.kind="scalar",t.result="",t.position++,n=i=t.position;(r=t.input.charCodeAt(t.position))!==0;)if(r===39)if(tl(t,n,t.position,!0),r=t.input.charCodeAt(++t.position),r===39)n=t.position,t.position++,i=t.position;else return!0;else io(r)?(tl(t,n,i,!0),y4(t,Fr(t,!1,e)),n=i=t.position):t.position===t.lineStart&&Z1(t)?rt(t,"unexpected end of the document within a single quoted scalar"):(t.position++,i=t.position);rt(t,"unexpected end of the stream within a single quoted scalar")}C(NG,"readSingleQuotedScalar");function FG(t,e){var r,n,i,s,o,a;if(a=t.input.charCodeAt(t.position),a!==34)return!1;for(t.kind="scalar",t.result="",t.position++,r=n=t.position;(a=t.input.charCodeAt(t.position))!==0;){if(a===34)return tl(t,r,t.position,!0),t.position++,!0;if(a===92){if(tl(t,r,t.position,!0),a=t.input.charCodeAt(++t.position),io(a))Fr(t,!1,e);else if(a<256&&IG[a])t.result+=BG[a],t.position++;else if((o=OG(a))>0){for(i=o,s=0;i>0;i--)a=t.input.charCodeAt(++t.position),(o=EG(a))>=0?s=(s<<4)+o:rt(t,"expected hexadecimal character");t.result+=DG(s),t.position++}else rt(t,"unknown escape sequence");r=n=t.position}else io(a)?(tl(t,r,n,!0),y4(t,Fr(t,!1,e)),r=n=t.position):t.position===t.lineStart&&Z1(t)?rt(t,"unexpected end of the document within a double quoted scalar"):(t.position++,n=t.position)}rt(t,"unexpected end of the stream within a double quoted scalar")}C(FG,"readDoubleQuotedScalar");function $G(t,e){var r=!0,n,i,s,o=t.tag,a,l=t.anchor,c,h,u,d,f,p=Object.create(null),m,g,y,b;if(b=t.input.charCodeAt(t.position),b===91)h=93,f=!1,a=[];else if(b===123)h=125,f=!0,a={};else return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=a),b=t.input.charCodeAt(++t.position);b!==0;){if(Fr(t,!0,e),b=t.input.charCodeAt(t.position),b===h)return t.position++,t.tag=o,t.anchor=l,t.kind=f?"mapping":"sequence",t.result=a,!0;r?b===44&&rt(t,"expected the node content, but found ','"):rt(t,"missed comma between flow collection entries"),g=m=y=null,u=d=!1,b===63&&(c=t.input.charCodeAt(t.position+1),ii(c)&&(u=d=!0,t.position++,Fr(t,!0,e))),n=t.line,i=t.lineStart,s=t.position,vu(t,e,ov,!1,!0),g=t.tag,m=t.result,Fr(t,!0,e),b=t.input.charCodeAt(t.position),(d||t.line===n)&&b===58&&(u=!0,b=t.input.charCodeAt(++t.position),Fr(t,!0,e),vu(t,e,ov,!1,!0),y=t.result),f?Ch(t,a,p,g,m,y,n,i,s):u?a.push(Ch(t,null,p,g,m,y,n,i,s)):a.push(m),Fr(t,!0,e),b=t.input.charCodeAt(t.position),b===44?(r=!0,b=t.input.charCodeAt(++t.position)):r=!1}rt(t,"unexpected end of the stream within a flow collection")}C($G,"readFlowCollection");function zG(t,e){var r,n,i=Rk,s=!1,o=!1,a=e,l=0,c=!1,h,u;if(u=t.input.charCodeAt(t.position),u===124)n=!1;else if(u===62)n=!0;else return!1;for(t.kind="scalar",t.result="";u!==0;)if(u=t.input.charCodeAt(++t.position),u===43||u===45)Rk===i?i=u===43?jI:STe:rt(t,"repeat of a chomping mode identifier");else if((h=LG(u))>=0)h===0?rt(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?rt(t,"repeat of an indentation width identifier"):(a=e+h-1,o=!0);else break;if(hc(u)){do u=t.input.charCodeAt(++t.position);while(hc(u));if(u===35)do u=t.input.charCodeAt(++t.position);while(!io(u)&&u!==0)}for(;u!==0;){for(g4(t),t.lineIndent=0,u=t.input.charCodeAt(t.position);(!o||t.lineIndent<a)&&u===32;)t.lineIndent++,u=t.input.charCodeAt(++t.position);if(!o&&t.lineIndent>a&&(a=t.lineIndent),io(u)){l++;continue}if(t.lineIndent<a){i===jI?t.result+=en.repeat(`
1248`,s?1+l:l):i===Rk&&s&&(t.result+=`
1249`);break}for(n?hc(u)?(c=!0,t.result+=en.repeat(`
1250`,s?1+l:l)):c?(c=!1,t.result+=en.repeat(`
1251`,l+1)):l===0?s&&(t.result+=" "):t.result+=en.repeat(`
1252`,l):t.result+=en.repeat(`
1253`,s?1+l:l),s=!0,o=!0,l=0,r=t.position;!io(u)&&u!==0;)u=t.input.charCodeAt(++t.position);tl(t,r,t.position,!1)}return!0}C(zG,"readBlockScalar");function QS(t,e){var r,n=t.tag,i=t.anchor,s=[],o,a=!1,l;if(t.firstTabInLine!==-1)return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=s),l=t.input.charCodeAt(t.position);l!==0&&(t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,rt(t,"tab characters must not be used in indentation")),!(l!==45||(o=t.input.charCodeAt(t.position+1),!ii(o))));){if(a=!0,t.position++,Fr(t,!0,-1)&&t.lineIndent<=e){s.push(null),l=t.input.charCodeAt(t.position);continue}if(r=t.line,vu(t,e,_G,!1,!0),s.push(t.result),Fr(t,!0,-1),l=t.input.charCodeAt(t.position),(t.line===r||t.lineIndent>e)&&l!==0)rt(t,"bad indentation of a sequence entry");else if(t.lineIndent<e)break}return a?(t.tag=n,t.anchor=i,t.kind="sequence",t.result=s,!0):!1}C(QS,"readBlockSequence");function HG(t,e,r){var n,i,s,o,a,l,c=t.tag,h=t.anchor,u={},d=Object.create(null),f=null,p=null,m=null,g=!1,y=!1,b;if(t.firstTabInLine!==-1)return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=u),b=t.input.charCodeAt(t.position);b!==0;){if(!g&&t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,rt(t,"tab characters must not be used in indentation")),n=t.input.charCodeAt(t.position+1),s=t.line,(b===63||b===58)&&ii(n))b===63?(g&&(Ch(t,u,d,f,p,null,o,a,l),f=p=m=null),y=!0,g=!0,i=!0):g?(g=!1,i=!0):rt(t,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),t.position+=1,b=n;else{if(o=t.line,a=t.lineStart,l=t.position,!vu(t,r,TG,!1,!0))break;if(t.line===s){for(b=t.input.charCodeAt(t.position);hc(b);)b=t.input.charCodeAt(++t.position);if(b===58)b=t.input.charCodeAt(++t.position),ii(b)||rt(t,"a whitespace character is expected after the key-value separator within a block mapping"),g&&(Ch(t,u,d,f,p,null,o,a,l),f=p=m=null),y=!0,g=!1,i=!1,f=t.tag,p=t.result;else if(y)rt(t,"can not read an implicit mapping pair; a colon is missed");else return t.tag=c,t.anchor=h,!0}else if(y)rt(t,"can not read a block mapping entry; a multiline key may not be an implicit key");else return t.tag=c,t.anchor=h,!0}if((t.line===s||t.lineIndent>e)&&(g&&(o=t.line,a=t.lineStart,l=t.position),vu(t,e,av,!0,i)&&(g?p=t.result:m=t.result),g||(Ch(t,u,d,f,p,m,o,a,l),f=p=m=null),Fr(t,!0,-1),b=t.input.charCodeAt(t.position)),(t.line===s||t.lineIndent>e)&&b!==0)rt(t,"bad indentation of a mapping entry");else if(t.lineIndent<e)break}return g&&Ch(t,u,d,f,p,null,o,a,l),y&&(t.tag=c,t.anchor=h,t.kind="mapping",t.result=u),y}C(HG,"readBlockMapping");function qG(t){var e,r=!1,n=!1,i,s,o;if(o=t.input.charCodeAt(t.position),o!==33)return!1;if(t.tag!==null&&rt(t,"duplication of a tag property"),o=t.input.charCodeAt(++t.position),o===60?(r=!0,o=t.input.charCodeAt(++t.position)):o===33?(n=!0,i="!!",o=t.input.charCodeAt(++t.position)):i="!",e=t.position,r){do o=t.input.charCodeAt(++t.position);while(o!==0&&o!==62);t.position<t.length?(s=t.input.slice(e,t.position),o=t.input.charCodeAt(++t.position)):rt(t,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!ii(o);)o===33&&(n?rt(t,"tag suffix cannot contain exclamation marks"):(i=t.input.slice(e-1,t.position+1),MG.test(i)||rt(t,"named tag handle cannot contain such characters"),n=!0,e=t.position+1)),o=t.input.charCodeAt(++t.position);s=t.input.slice(e,t.position),MTe.test(s)&&rt(t,"tag suffix cannot contain flow indicator characters")}s&&!AG.test(s)&&rt(t,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch{rt(t,"tag name is malformed: "+s)}return r?t.tag=s:Tc.call(t.tagMap,i)?t.tag=t.tagMap[i]+s:i==="!"?t.tag="!"+s:i==="!!"?t.tag="tag:yaml.org,2002:"+s:rt(t,'undeclared tag handle "'+i+'"'),!0}C(qG,"readTagProperty");function VG(t){var e,r;if(r=t.input.charCodeAt(t.position),r!==38)return!1;for(t.anchor!==null&&rt(t,"duplication of an anchor property"),r=t.input.charCodeAt(++t.position),e=t.position;r!==0&&!ii(r)&&!kh(r);)r=t.input.charCodeAt(++t.position);return t.position===e&&rt(t,"name of an anchor node must contain at least one character"),t.anchor=t.input.slice(e,t.position),!0}C(VG,"readAnchorProperty");function WG(t){var e,r,n;if(n=t.input.charCodeAt(t.position),n!==42)return!1;for(n=t.input.charCodeAt(++t.position),e=t.position;n!==0&&!ii(n)&&!kh(n);)n=t.input.charCodeAt(++t.position);return t.position===e&&rt(t,"name of an alias node must contain at least one character"),r=t.input.slice(e,t.position),Tc.call(t.anchorMap,r)||rt(t,'unidentified alias "'+r+'"'),t.result=t.anchorMap[r],Fr(t,!0,-1),!0}C(WG,"readAlias");function vu(t,e,r,n,i){var s,o,a,l=1,c=!1,h=!1,u,d,f,p,m,g;if(t.listener!==null&&t.listener("open",t),t.tag=null,t.anchor=null,t.kind=null,t.result=null,s=o=a=av===r||_G===r,n&&Fr(t,!0,-1)&&(c=!0,t.lineIndent>e?l=1:t.lineIndent===e?l=0:t.lineIndent<e&&(l=-1)),l===1)for(;qG(t)||VG(t);)Fr(t,!0,-1)?(c=!0,a=s,t.lineIndent>e?l=1:t.lineIndent===e?l=0:t.lineIndent<e&&(l=-1)):a=!1;
vendor: 4,126 bytes, lines 1253-1254
1253if(a&&(a=c||i),(l===1||av===r)&&(ov===r||TG===r?m=e:m=e+1,g=t.position-t.lineStart,l===1?a&&(QS(t,g)||HG(t,g,m))||$G(t,m)?h=!0:(o&&zG(t,m)||NG(t,m)||FG(t,m)?h=!0:WG(t)?(h=!0,(t.tag!==null||t.anchor!==null)&&rt(t,"alias node should not have any properties")):PG(t,m,ov===r)&&(h=!0,t.tag===null&&(t.tag="?")),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):l===0&&(h=a&&QS(t,g))),t.tag===null)t.anchor!==null&&(t.anchorMap[t.anchor]=t.result);else if(t.tag==="?"){for(t.result!==null&&t.kind!=="scalar"&&rt(t,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+t.kind+'"'),u=0,d=t.implicitTypes.length;u<d;u+=1)if(p=t.implicitTypes[u],p.resolve(t.result)){t.result=p.construct(t.result),t.tag=p.tag,t.anchor!==null&&(t.anchorMap[t.anchor]=t.result);break}}else if(t.tag!=="!"){if(Tc.call(t.typeMap[t.kind||"fallback"],t.tag))p=t.typeMap[t.kind||"fallback"][t.tag];else for(p=null,f=t.typeMap.multi[t.kind||"fallback"],u=0,d=f.length;u<d;u+=1)if(t.tag.slice(0,f[u].tag.length)===f[u].tag){p=f[u];break}p||rt(t,"unknown tag !<"+t.tag+">"),t.result!==null&&p.kind!==t.kind&&rt(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+p.kind+'", not "'+t.kind+'"'),p.resolve(t.result,t.tag)?(t.result=p.construct(t.result,t.tag),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):rt(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return t.listener!==null&&t.listener("close",t),t.tag!==null||t.anchor!==null||h}C(vu,"composeNode");function jG(t){var e=t.position,r,n,i,s=!1,o;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);(o=t.input.charCodeAt(t.position))!==0&&(Fr(t,!0,-1),o=t.input.charCodeAt(t.position),!(t.lineIndent>0||o!==37));){for(s=!0,o=t.input.charCodeAt(++t.position),r=t.position;o!==0&&!ii(o);)o=t.input.charCodeAt(++t.position);for(n=t.input.slice(r,t.position),i=[],n.length<1&&rt(t,"directive name must not be less than one character in length");o!==0;){for(;hc(o);)o=t.input.charCodeAt(++t.position);if(o===35){do o=t.input.charCodeAt(++t.position);while(o!==0&&!io(o));break}if(io(o))break;for(r=t.position;o!==0&&!ii(o);)o=t.input.charCodeAt(++t.position);i.push(t.input.slice(r,t.position))}o!==0&&g4(t),Tc.call(UI,n)?UI[n](t,n,i):Ig(t,'unknown document directive "'+n+'"')}if(Fr(t,!0,-1),t.lineIndent===0&&t.input.charCodeAt(t.position)===45&&t.input.charCodeAt(t.position+1)===45&&t.input.charCodeAt(t.position+2)===45?(t.position+=3,Fr(t,!0,-1)):s&&rt(t,"directives end mark is expected"),vu(t,t.lineIndent-1,av,!1,!0),Fr(t,!0,-1),t.checkLineBreaks&&_Te.test(t.input.slice(e,t.position))&&Ig(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&Z1(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,Fr(t,!0,-1));return}if(t.position<t.length-1)rt(t,"end of the stream or a document separator is expected");else return}C(jG,"readDocument");function VT(t,e){t=String(t),e=e||{},t.length!==0&&(t.charCodeAt(t.length-1)!==10&&t.charCodeAt(t.length-1)!==13&&(t+=`
1254`),t.charCodeAt(0)===65279&&(t=t.slice(1)));var r=new RG(t,e),n=t.indexOf("\0");for(n!==-1&&(r.position=n,rt(r,"null byte is not allowed in input")),r.input+="\0";r.input.charCodeAt(r.position)===32;)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)jG(r);return r.documents}C(VT,"loadDocuments");function UG(t,e,r){e!==null&&typeof e=="object"&&typeof r>"u"&&(r=e,e=null);var n=VT(t,r);if(typeof e!="function")return n;for(var i=0,s=n.length;i<s;i+=1)e(n[i])}C(UG,"loadAll$1");function GG(t,e){var r=VT(t,e);if(r.length!==0){if(r.length===1)return r[0];throw new _i("expected a single document in the stream, but found more")}}C(GG,"load$1");var ATe=UG,ETe=GG,OTe={loadAll:ATe,load:ETe},KG=Object.prototype.toString,YG=Object.prototype.hasOwnProperty,WT=65279,LTe=9,Bg=10,DTe=13,ITe=32,BTe=33,RTe=34,e6=35,PTe=37,NTe=38,FTe=39,$Te=42,XG=44,zTe=45,lv=58,HTe=61,qTe=62,VTe=63,WTe=64,JG=91,ZG=93,jTe=96,QG=123,UTe=124,eK=125,Gn={};Gn[0]="\\0";Gn[7]="\\a";Gn[8]="\\b";Gn[9]="\\t";Gn[10]="\\n";Gn[11]="\\v";Gn[12]="\\f";Gn[13]="\\r";Gn[27]="\\e";Gn[34]='\\"';Gn[92]="\\\\";Gn[133]="\\N";
vendor: 5,286 bytes, lines 1254-1268
1254Gn[160]="\\_";Gn[8232]="\\L";Gn[8233]="\\P";var GTe=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],KTe=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function tK(t,e){var r,n,i,s,o,a,l;if(e===null)return{};for(r={},n=Object.keys(e),i=0,s=n.length;i<s;i+=1)o=n[i],a=String(e[o]),o.slice(0,2)==="!!"&&(o="tag:yaml.org,2002:"+o.slice(2)),l=t.compiledTypeMap.fallback[o],l&&YG.call(l.styleAliases,a)&&(a=l.styleAliases[a]),r[o]=a;return r}C(tK,"compileStyleMap");function rK(t){var e,r,n;if(e=t.toString(16).toUpperCase(),t<=255)r="x",n=2;else if(t<=65535)r="u",n=4;else if(t<=4294967295)r="U",n=8;else throw new _i("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+en.repeat("0",n-e.length)+e}C(rK,"encodeHex");var YTe=1,Rg=2;function nK(t){this.schema=t.schema||SG,this.indent=Math.max(1,t.indent||2),this.noArrayIndent=t.noArrayIndent||!1,this.skipInvalid=t.skipInvalid||!1,this.flowLevel=en.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=tK(this.schema,t.styles||null),this.sortKeys=t.sortKeys||!1,this.lineWidth=t.lineWidth||80,this.noRefs=t.noRefs||!1,this.noCompatMode=t.noCompatMode||!1,this.condenseFlow=t.condenseFlow||!1,this.quotingType=t.quotingType==='"'?Rg:YTe,this.forceQuotes=t.forceQuotes||!1,this.replacer=typeof t.replacer=="function"?t.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}C(nK,"State");function t6(t,e){for(var r=en.repeat(" ",e),n=0,i=-1,s="",o,a=t.length;n<a;)i=t.indexOf(`
1255`,n),i===-1?(o=t.slice(n),n=a):(o=t.slice(n,i+1),n=i+1),o.length&&o!==`
1256`&&(s+=r),s+=o;return s}C(t6,"indentString");function cv(t,e){return`
1257`+en.repeat(" ",t.indent*e)}C(cv,"generateNextLine");function iK(t,e){var r,n,i;for(r=0,n=t.implicitTypes.length;r<n;r+=1)if(i=t.implicitTypes[r],i.resolve(e))return!0;return!1}C(iK,"testImplicitResolving");function Pg(t){return t===ITe||t===LTe}C(Pg,"isWhitespace");function Hf(t){return 32<=t&&t<=126||161<=t&&t<=55295&&t!==8232&&t!==8233||57344<=t&&t<=65533&&t!==WT||65536<=t&&t<=1114111}C(Hf,"isPrintable");function r6(t){return Hf(t)&&t!==WT&&t!==DTe&&t!==Bg}C(r6,"isNsCharOrWhitespace");function n6(t,e,r){var n=r6(t),i=n&&!Pg(t);return(r?n:n&&t!==XG&&t!==JG&&t!==ZG&&t!==QG&&t!==eK)&&t!==e6&&!(e===lv&&!i)||r6(e)&&!Pg(e)&&t===e6||e===lv&&i}C(n6,"isPlainSafe");function sK(t){return Hf(t)&&t!==WT&&!Pg(t)&&t!==zTe&&t!==VTe&&t!==lv&&t!==XG&&t!==JG&&t!==ZG&&t!==QG&&t!==eK&&t!==e6&&t!==NTe&&t!==$Te&&t!==BTe&&t!==UTe&&t!==HTe&&t!==qTe&&t!==FTe&&t!==RTe&&t!==PTe&&t!==WTe&&t!==jTe}C(sK,"isPlainSafeFirst");function oK(t){return!Pg(t)&&t!==lv}C(oK,"isPlainSafeLast");function pd(t,e){var r=t.charCodeAt(e),n;return r>=55296&&r<=56319&&e+1<t.length&&(n=t.charCodeAt(e+1),n>=56320&&n<=57343)?(r-55296)*1024+n-56320+65536:r}C(pd,"codePointAt");function jT(t){var e=/^\n* /;return e.test(t)}C(jT,"needIndentIndicator");var aK=1,i6=2,lK=3,cK=4,cd=5;function hK(t,e,r,n,i,s,o,a){var l,c=0,h=null,u=!1,d=!1,f=n!==-1,p=-1,m=sK(pd(t,0))&&oK(pd(t,t.length-1));if(e||o)for(l=0;l<t.length;c>=65536?l+=2:l++){if(c=pd(t,l),!Hf(c))return cd;m=m&&n6(c,h,a),h=c}else{for(l=0;l<t.length;c>=65536?l+=2:l++){if(c=pd(t,l),c===Bg)u=!0,f&&(d=d||l-p-1>n&&t[p+1]!==" ",p=l);else if(!Hf(c))return cd;m=m&&n6(c,h,a),h=c}d=d||f&&l-p-1>n&&t[p+1]!==" "}return!u&&!d?m&&!o&&!i(t)?aK:s===Rg?cd:i6:r>9&&jT(t)?cd:o?s===Rg?cd:i6:d?cK:lK}C(hK,"chooseScalarStyle");function uK(t,e,r,n,i){t.dump=function(){if(e.length===0)return t.quotingType===Rg?'""':"''";if(!t.noCompatMode&&(GTe.indexOf(e)!==-1||KTe.test(e)))return t.quotingType===Rg?'"'+e+'"':"'"+e+"'";var s=t.indent*Math.max(1,r),o=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-s),a=n||t.flowLevel>-1&&r>=t.flowLevel;function l(c){return iK(t,c)}switch(C(l,"testAmbiguity"),hK(e,a,t.indent,o,l,t.quotingType,t.forceQuotes&&!n,i)){case aK:return e;case i6:return"'"+e.replace(/'/g,"''")+"'";case lK:return"|"+s6(e,t.indent)+o6(t6(e,s));case cK:return">"+s6(e,t.indent)+o6(t6(dK(e,o),s));case cd:return'"'+fK(e)+'"';default:throw new _i("impossible error: invalid scalar style")}}()}C(uK,"writeScalar");function s6(t,e){var r=jT(t)?String(e):"",n=t[t.length-1]===`
1258`,i=n&&(t[t.length-2]===`
1259`||t===`
1260`),s=i?"+":n?"":"-";return r+s+`
1261`}C(s6,"blockHeader");function o6(t){return t[t.length-1]===`
1262`?t.slice(0,-1):t}C(o6,"dropEndingNewline");function dK(t,e){for(var r=/(\n+)([^\n]*)/g,n=function(){var c=t.indexOf(`
1263`);return c=c!==-1?c:t.length,r.lastIndex=c,a6(t.slice(0,c),e)}(),i=t[0]===`
1264`||t[0]===" ",s,o;o=r.exec(t);){var a=o[1],l=o[2];s=l[0]===" ",n+=a+(!i&&!s&&l!==""?`
1265`:"")+a6(l,e),i=s}return n}C(dK,"foldString");function a6(t,e){if(t===""||t[0]===" ")return t;for(var r=/ [^ ]/g,n,i=0,s,o=0,a=0,l="";n=r.exec(t);)a=n.index,a-i>e&&(s=o>i?o:a,l+=`
1266`+t.slice(i,s),i=s+1),o=a;return l+=`
1267`,t.length-i>e&&o>i?l+=t.slice(i,o)+`
1268`+t.slice(o+1):l+=t.slice(i),l.slice(1)}C(a6,"foldLine");function fK(t){for(var e="",r=0,n,i=0;i<t.length;r>=65536?i+=2:i++)r=pd(t,i),n=Gn[r],!n&&Hf(r)?(e+=t[i],r>=65536&&(e+=t[i+1])):e+=n||rK(r);return e}C(fK,"escapeString");function pK(t,e,r){var n="",i=t.tag,s,o,a;for(s=0,o=r.length;s<o;s+=1)a=r[s],t.replacer&&(a=t.replacer.call(r,String(s),a)),(sa(t,e,a,!1,
vendor: 20,190 bytes, lines 1268-1274
1268!1)||typeof a>"u"&&sa(t,e,null,!1,!1))&&(n!==""&&(n+=","+(t.condenseFlow?"":" ")),n+=t.dump);t.tag=i,t.dump="["+n+"]"}C(pK,"writeFlowSequence");function l6(t,e,r,n){var i="",s=t.tag,o,a,l;for(o=0,a=r.length;o<a;o+=1)l=r[o],t.replacer&&(l=t.replacer.call(r,String(o),l)),(sa(t,e+1,l,!0,!0,!1,!0)||typeof l>"u"&&sa(t,e+1,null,!0,!0,!1,!0))&&((!n||i!=="")&&(i+=cv(t,e)),t.dump&&Bg===t.dump.charCodeAt(0)?i+="-":i+="- ",i+=t.dump);t.tag=s,t.dump=i||"[]"}C(l6,"writeBlockSequence");function mK(t,e,r){var n="",i=t.tag,s=Object.keys(r),o,a,l,c,h;for(o=0,a=s.length;o<a;o+=1)h="",n!==""&&(h+=", "),t.condenseFlow&&(h+='"'),l=s[o],c=r[l],t.replacer&&(c=t.replacer.call(r,l,c)),sa(t,e,l,!1,!1)&&(t.dump.length>1024&&(h+="? "),h+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),sa(t,e,c,!1,!1)&&(h+=t.dump,n+=h));t.tag=i,t.dump="{"+n+"}"}C(mK,"writeFlowMapping");function gK(t,e,r,n){var i="",s=t.tag,o=Object.keys(r),a,l,c,h,u,d;if(t.sortKeys===!0)o.sort();else if(typeof t.sortKeys=="function")o.sort(t.sortKeys);else if(t.sortKeys)throw new _i("sortKeys must be a boolean or a function");for(a=0,l=o.length;a<l;a+=1)d="",(!n||i!=="")&&(d+=cv(t,e)),c=o[a],h=r[c],t.replacer&&(h=t.replacer.call(r,c,h)),sa(t,e+1,c,!0,!0,!0)&&(u=t.tag!==null&&t.tag!=="?"||t.dump&&t.dump.length>1024,u&&(t.dump&&Bg===t.dump.charCodeAt(0)?d+="?":d+="? "),d+=t.dump,u&&(d+=cv(t,e)),sa(t,e+1,h,!0,u)&&(t.dump&&Bg===t.dump.charCodeAt(0)?d+=":":d+=": ",d+=t.dump,i+=d));t.tag=s,t.dump=i||"{}"}C(gK,"writeBlockMapping");function c6(t,e,r){var n,i,s,o,a,l;for(i=r?t.explicitTypes:t.implicitTypes,s=0,o=i.length;s<o;s+=1)if(a=i[s],(a.instanceOf||a.predicate)&&(!a.instanceOf||typeof e=="object"&&e instanceof a.instanceOf)&&(!a.predicate||a.predicate(e))){if(r?a.multi&&a.representName?t.tag=a.representName(e):t.tag=a.tag:t.tag="?",a.represent){if(l=t.styleMap[a.tag]||a.defaultStyle,KG.call(a.represent)==="[object Function]")n=a.represent(e,l);else if(YG.call(a.represent,l))n=a.represent[l](e,l);else throw new _i("!<"+a.tag+'> tag resolver accepts not "'+l+'" style');t.dump=n}return!0}return!1}C(c6,"detectType");function sa(t,e,r,n,i,s,o){t.tag=null,t.dump=r,c6(t,r,!1)||c6(t,r,!0);var a=KG.call(t.dump),l=n,c;n&&(n=t.flowLevel<0||t.flowLevel>e);var h=a==="[object Object]"||a==="[object Array]",u,d;if(h&&(u=t.duplicates.indexOf(r),d=u!==-1),(t.tag!==null&&t.tag!=="?"||d||t.indent!==2&&e>0)&&(i=!1),d&&t.usedDuplicates[u])t.dump="*ref_"+u;else{if(h&&d&&!t.usedDuplicates[u]&&(t.usedDuplicates[u]=!0),a==="[object Object]")n&&Object.keys(t.dump).length!==0?(gK(t,e,t.dump,i),d&&(t.dump="&ref_"+u+t.dump)):(mK(t,e,t.dump),d&&(t.dump="&ref_"+u+" "+t.dump));else if(a==="[object Array]")n&&t.dump.length!==0?(t.noArrayIndent&&!o&&e>0?l6(t,e-1,t.dump,i):l6(t,e,t.dump,i),d&&(t.dump="&ref_"+u+t.dump)):(pK(t,e,t.dump),d&&(t.dump="&ref_"+u+" "+t.dump));else if(a==="[object String]")t.tag!=="?"&&uK(t,t.dump,e,s,l);else{if(a==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new _i("unacceptable kind of an object to dump "+a)}t.tag!==null&&t.tag!=="?"&&(c=encodeURI(t.tag[0]==="!"?t.tag.slice(1):t.tag).replace(/!/g,"%21"),t.tag[0]==="!"?c="!"+c:c.slice(0,18)==="tag:yaml.org,2002:"?c="!!"+c.slice(18):c="!<"+c+">",t.dump=c+" "+t.dump)}return!0}C(sa,"writeNode");function yK(t,e){var r=[],n=[],i,s;for(hv(t,r,n),i=0,s=n.length;i<s;i+=1)e.duplicates.push(r[n[i]]);e.usedDuplicates=new Array(s)}C(yK,"getDuplicateReferences");function hv(t,e,r){var n,i,s;if(t!==null&&typeof t=="object")if(i=e.indexOf(t),i!==-1)r.indexOf(i)===-1&&r.push(i);else if(e.push(t),Array.isArray(t))for(i=0,s=t.length;i<s;i+=1)hv(t[i],e,r);else for(n=Object.keys(t),i=0,s=n.length;i<s;i+=1)hv(t[n[i]],e,r)}C(hv,"inspectNode");function XTe(t,e){e=e||{};var r=new nK(e);r.noRefs||yK(t,r);var n=t;return r.replacer&&(n=r.replacer.call({"":n},"",n)),sa(r,0,n,!0,!0)?r.dump+`
1269`:""}C(XTe,"dump$1");function JTe(t,e){return function(){throw new Error("Function yaml."+t+" is removed in js-yaml 4. Use yaml."+e+" instead, which is now safe by default.")}}C(JTe,"renamed");var ZTe=aG,QTe=OTe.load;/*! Bundled license information:
1270
1271js-yaml/dist/js-yaml.mjs:
1272  (*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT *)
1273*/var Dn={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4},GI={arrow_point:9,arrow_cross:12.5,arrow_circle:12.5};function jp(t,e){if(t===void 0||e===void 0)return{angle:0,deltaX:0,deltaY:0};t=Cr(t),e=Cr(e);const[r,n]=[t.x,t.y],[i,s]=[e.x,e.y],o=i-r,a=s-n;return{angle:Math.atan(a/o),deltaX:o,deltaY:a}}C(jp,"calculateDeltaAndAngle");var Cr=C(t=>Array.isArray(t)?{x:t[0],y:t[1]}:t,"pointTransformer"),e_e=C(t=>({x:C(function(e,r,n){let i=0;const s=Cr(n[0]).x<Cr(n[n.length-1]).x?"left":"right";if(r===0&&Object.hasOwn(Dn,t.arrowTypeStart)){const{angle:f,deltaX:p}=jp(n[0],n[1]);i=Dn[t.arrowTypeStart]*Math.cos(f)*(p>=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(Dn,t.arrowTypeEnd)){const{angle:f,deltaX:p}=jp(n[n.length-1],n[n.length-2]);i=Dn[t.arrowTypeEnd]*Math.cos(f)*(p>=0?1:-1)}const o=Math.abs(Cr(e).x-Cr(n[n.length-1]).x),a=Math.abs(Cr(e).y-Cr(n[n.length-1]).y),l=Math.abs(Cr(e).x-Cr(n[0]).x),c=Math.abs(Cr(e).y-Cr(n[0]).y),h=Dn[t.arrowTypeStart],u=Dn[t.arrowTypeEnd],d=1;if(o<u&&o>0&&a<u){let f=u+d-o;f*=s==="right"?-1:1,i-=f}if(l<h&&l>0&&c<h){let f=h+d-l;f*=s==="right"?-1:1,i+=f}return Cr(e).x+i},"x"),y:C(function(e,r,n){let i=0;const s=Cr(n[0]).y<Cr(n[n.length-1]).y?"down":"up";if(r===0&&Object.hasOwn(Dn,t.arrowTypeStart)){const{angle:f,deltaY:p}=jp(n[0],n[1]);i=Dn[t.arrowTypeStart]*Math.abs(Math.sin(f))*(p>=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(Dn,t.arrowTypeEnd)){const{angle:f,deltaY:p}=jp(n[n.length-1],n[n.length-2]);i=Dn[t.arrowTypeEnd]*Math.abs(Math.sin(f))*(p>=0?1:-1)}const o=Math.abs(Cr(e).y-Cr(n[n.length-1]).y),a=Math.abs(Cr(e).x-Cr(n[n.length-1]).x),l=Math.abs(Cr(e).y-Cr(n[0]).y),c=Math.abs(Cr(e).x-Cr(n[0]).x),h=Dn[t.arrowTypeStart],u=Dn[t.arrowTypeEnd],d=1;if(o<u&&o>0&&a<u){let f=u+d-o;f*=s==="up"?-1:1,i-=f}if(l<h&&l>0&&c<h){let f=h+d-l;f*=s==="up"?-1:1,i+=f}return Cr(e).y+i},"y")}),"getLineFunctionsWithOffset"),UT=C(({flowchart:t})=>{var i,s;const e=((i=t==null?void 0:t.subGraphTitleMargin)==null?void 0:i.top)??0,r=((s=t==null?void 0:t.subGraphTitleMargin)==null?void 0:s.bottom)??0,n=e+r;return{subGraphTitleTopMargin:e,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:n}},"getSubGraphTitleMargins"),t_e=C(t=>{const{handDrawnSeed:e}=Zt();return{fill:t,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:t,seed:e}},"solidStateFill"),f0=C(t=>{const e=r_e([...t.cssCompiledStyles||[],...t.cssStyles||[],...t.labelStyle||[]]);return{stylesMap:e,stylesArray:[...e]}},"compileStyles"),r_e=C(t=>{const e=new Map;return t.forEach(r=>{const[n,i]=r.split(":");e.set(n.trim(),i==null?void 0:i.trim())}),e},"styles2Map"),bK=C(t=>t==="color"||t==="font-size"||t==="font-family"||t==="font-weight"||t==="font-style"||t==="text-decoration"||t==="text-align"||t==="text-transform"||t==="line-height"||t==="letter-spacing"||t==="word-spacing"||t==="text-shadow"||t==="text-overflow"||t==="white-space"||t==="word-wrap"||t==="word-break"||t==="overflow-wrap"||t==="hyphens","isLabelStyle"),Ke=C(t=>{const{stylesArray:e}=f0(t),r=[],n=[],i=[],s=[];return e.forEach(o=>{const a=o[0];bK(a)?r.push(o.join(":")+" !important"):(n.push(o.join(":")+" !important"),a.includes("stroke")&&i.push(o.join(":")+" !important"),a==="fill"&&s.push(o.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:n.join(";"),stylesArray:e,borderStyles:i,backgroundStyles:s}},"styles2String"),Ge=C((t,e)=>{var l;const{themeVariables:r,handDrawnSeed:n}=Zt(),{nodeBorder:i,mainBkg:s}=r,{stylesMap:o}=f0(t);return Object.assign({roughness:.7,fill:o.get("fill")||s,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:o.get("stroke")||i,seed:n,strokeWidth:((l=o.get("stroke-width"))==null?void 0:l.replace("px",""))||1.3,fillLineDash:[0,0],strokeLineDash:n_e(o.get("stroke-dasharray"))},e)},"userNodeOverrides"),n_e=C(t=>{if(!t)return[0,0];const e=t.trim().split(/\s+/).map(Number);if(e.length===1){const i=isNaN(e[0])?0:e[0];return[i,i]}const r=isNaN(e[0])?0:e[0],n=isNaN(e[1])?0:e[1];return[r,n]},"getStrokeDashArray"),GT={},an={};Object.defineProperty(an,"__esModule",{value:!0});an.BLANK_URL=an.relativeFirstCharacters=an.whitespaceEscapeCharsRegex=an.urlSchemeRegex=an.ctrlCharactersRegex=an.htmlCtrlEntityRegex=an.htmlEntitiesRegex=an.invalidProtocolRegex=void 0;an.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im;an.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g;an.htmlCtrlEntityRegex=/&(newline|tab);/gi;an.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim;an.urlSchemeRegex=/^.+(:|&colon;)/gim;an.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g;an.relativeFirstCharacters=[".","/"];an.BLANK_URL="about:blank";Object.defineProperty(GT,"__esModule",{value:!0});var xK=GT.sanitizeUrl=void 0,Ln=an;function i_e(t){return Ln.relativeFirstCharacters.indexOf(t[0])>-1}function s_e(t){var e=t.replace(Ln.ctrlCharactersRegex,"");return e.replace(Ln.htmlEntitiesRegex,function(r,n){return String.fromCharCode(n)})}function o_e(t){return URL.canParse(t)}function KI(t){try{return decodeURIComponent(t)}catch{return t}}function a_e(t){if(!t)return Ln.BLANK_URL;var e,r=KI(t.trim());do r=s_e(r).replace(Ln.htmlCtrlEntityRegex,"").replace(Ln.ctrlCharactersRegex,"").replace(Ln.whitespaceEscapeCharsRegex,"").trim(),r=KI(r),e=r.match(Ln.ctrlCharactersRegex)||r.match(Ln.htmlEntitiesRegex)||r.match(Ln.htmlCtrlEntityRegex)||r.match(Ln.whitespaceEscapeCharsRegex);while(e&&e.length>0);var n=r;if(!n)return Ln.BLANK_URL;if(i_e(n))return n;var i=n.trimStart(),s=i.match(Ln.urlSchemeRegex);if(!s)return n;var o=s[0].toLowerCase().trim();if(Ln.invalidProtocolRegex.test(o))return Ln.BLANK_URL;var a=i.replace(/\\/g,"/");if(o==="mailto:"||o.includes("://"))return a;if(o==="http:"||o==="https:"){if(!o_e(a))return Ln.BLANK_URL;var l=new URL(a);return l.protocol=l.protocol.toLowerCase(),l.hostname=l.hostname.toLowerCase(),l.toString()}return a}xK=GT.sanitizeUrl=a_e;var l_e="​",c_e={curveBasis:Lb,curveBasisClosed:F9e,curveBasisOpen:$9e,curveBumpX:gU,curveBumpY:yU,curveBundle:z9e,curveCardinalClosed:H9e,curveCardinalOpen:q9e,curveCardinal:wU,curveCatmullRomClosed:V9e,curveCatmullRomOpen:W9e,curveCatmullRom:CU,curveLinear:tv,curveLinearClosed:j9e,curveMonotoneX:EU,curveMonotoneY:OU,curveNatural:DU,curveStep:IU,curveStepAfter:RU,curveStepBefore:BU},h_e=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,u_e=C(function(t,e){const r=vK(t,/(?:init\b)|(?:initialize\b)/);let n={};if(Array.isArray(r)){const o=r.map(a=>a.args);Wx(o),n=Qr(n,[...o])}else n=r.args;if(!n)return;let i=vT(t,e);const s="config";return n[s]!==void 0&&(i==="flowchart-v2"&&(i="flowchart"),n[i]=n[s],delete n[s]),n},"detectInit"),vK=C(function(t,e=null){var r,n;try{const i=new RegExp(`[%]{2}(?![{]${h_e.source})(?=[}][%]{2}).*
1274`,"ig");t=t.trim().replace(i,"").replace(/'/gm,'"'),de.debug(`Detecting diagram directive${e!==null?" type:"+e:""} based on the text:${t}`);let s;const o=[];for(;(s=Rm.exec(t))!==null;)if(s.index===Rm.lastIndex&&Rm.lastIndex++,s&&!e||e&&((r=s[1])!=null&&r.match(e))||e&&((n=s[2])!=null&&n.match(e))){const a=s[1]?s[1]:s[2],l=s[3]?s[3].trim():s[4]?JSON.parse(s[4].trim()):null;o.push({type:a,args:l})}return o.length===0?{type:t,args:null}:o.length===1?o[0]:o}catch(i){return de.error(`ERROR: ${i.message} - Unable to parse directive type: '${e}' based on the text: '${t}'`),{type:void 0,args:null}}},"detectDirective"),d_e=C(function(t){return t.replace(Rm,"")},"removeDirectives"),f_e=C(function(t,e){for(const[r,n]of e.entries())if(n.match(t))return r;return-1},"isSubstringInArray");function KT(t,e){if(!t)return e;const r=`curve${t.charAt(0).toUpperCase()+t.slice(1)}`;return c_e[r]??e}C(KT,"interpolateToCurve");function wK(t,e){const r=t.trim();if(r)return e.securityLevel!=="loose"?xK(r):r}C(wK,"formatUrl");var p_e=C((t,...e)=>{const r=t.split("."),n=r.length-1,i=r[n];let s=window;for(let o=0;o<n;o++)if(s=s[r[o]],!s){de.error(`Function name: ${t} not found in window`);return}s[i](...e)},"runFunc");function YT(t,e){return!t||!e?0:Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}C(YT,"distance");function kK(t){let e,r=0;t.forEach(i=>{r+=YT(i,e),e=i});const n=r/2;return XT(t,n)}C(kK,"traverseEdge");function CK(t){return t.length===1?t[0]:kK(t)}C(CK,"calcLabelPosition");var YI=C((t,e=2)=>{const r=Math.pow(10,e);return Math.round(t*r)/r},"roundNumber"),XT=C((t,e)=>{let r,n=e;for(const i of t){if(r){const s=YT(i,r);if(s===0)return r;if(s<n)n-=s;else{const o=n/s;if(o<=0)return r;if(o>=1)return{x:i.x,y:i.y};if(o>0&&o<1)return{x:YI((1-o)*r.x+o*i.x,5),y:YI((1-o)*r.y+o*i.y,5)}}}r=i}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),m_e=C((t,e,r)=>{de.info(`our points ${JSON.stringify(e)}`),e[0]!==r&&(e=e.reverse());const i=XT(e,25),s=t?10:5,o=Math.atan2(e[0].y-i.y,e[0].x-i.x),a={x:0,y:0};return a.x=Math.sin(o)*s+(e[0].x+i.x)/2,a.y=-Math.cos(o)*s+(e[0].y+i.y)/2,a},"calcCardinalityPosition");function SK(t,e,r){const n=structuredClone(r);de.info("our points",n),e!=="start_left"&&e!=="start_right"&&n.reverse();const i=25+t,s=XT(n,i),o=10+t*.5,a=Math.atan2(n[0].y-s.y,n[0].x-s.x),l={x:0,y:0};return e==="start_left"?(l.x=Math.sin(a+Math.PI)*o+(n[0].x+s.x)/2,l.y=-Math.cos(a+Math.PI)*o+(n[0].y+s.y)/2):e==="end_right"?(l.x=Math.sin(a-Math.PI)*o+(n[0].x+s.x)/2-5,l.y=-Math.cos(a-Math.PI)*o+(n[0].y+s.y)/2-5):e==="end_left"?(l.x=Math.sin(a)*o+(n[0].x+s.x)/2-5,l.y=-Math.cos(a)*o+(n[0].y+s.y)/2-5):(l.x=Math.sin(a)*o+(n[0].x+s.x)/2,l.y=-Math.cos(a)*o+(n[0].y+s.y)/2),l}C(SK,"calcTerminalLabelPosition");function TK(t){let e="",r="";for(const n of t)n!==void 0&&(n.startsWith("color:")||n.startsWith("text-align:")?r=r+n+";":e=e+n+";");return{style:e,labelStyle:r}}C(TK,"getStylesFromArray");var XI=0,g_e=C(()=>(XI++,"id-"+Math.random().toString(36).substr(2,12)+"-"+XI),"generateId");function _K(t){let e="";const r="0123456789abcdef",n=r.length;for(let i=0;i<t;i++)e+=r.charAt(Math.floor(Math.random()*n));return e}C(_K,"makeRandomHex");var y_e=C(t=>_K(t.length),"random"),b_e=C(function(){return{x:0,y:0,fill:void 0,anchor:"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:""}},"getTextObj"),x_e=C(function(t,e){const r=e.text.replace(d0.lineBreakRegex," "),[,n]=b4(e.fontSize),i=t.append("text");i.attr("x",e.x),i.attr("y",e.y),i.style("text-anchor",e.anchor),i.style("font-family",e.fontFamily),i.style("font-size",n),i.style("font-weight",e.fontWeight),i.attr("fill",e.fill),e.class!==void 0&&i.attr("class",e.class);const s=i.append("tspan");return s.attr("x",e.x+e.textMargin*2),s.attr("fill",e.fill),s.text(r),i},"drawSimpleText"),v_e=p1((t,e,r)=>{if(!t||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"<br/>"},r),d0.lineBreakRegex.test(t)))return t;const n=t.split(" ").filter(Boolean),i=[];let s="";return n.forEach((o,a)=>{const l=fl(`${o} `,r),c=fl(s,r);if(l>e){const{hyphenatedStrings:d,remainingWord:f}=w_e(o,e,"-",r);i.push(s,...d),s=f}else c+l>=e?(i.push(s),s=o):s=[s,o].filter(Boolean).join(" ");a+1===n.length&&i.push(s)}),i.filter(o=>o!=="").join(r.joinWith)},(t,e,r)=>`${t}${e}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),w_e=p1((t,e,r="-",n)=>{n=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},n);const i=[...t],s=[];let o="";return i.forEach((a,l)=>{const c=`${o}${a}`;if(fl(c,n)>=e){const u=l+1,d=i.length===u,f=`${c}${r}`;s.push(d?c:f),o=""}else o=c}),{hyphenatedStrings:s,remainingWord:o}},(t,e,r="-",n)=>`${t}${e}${r}${n.fontSize}${n.fontWeight}${n.fontFamily}`);function MK(t,e){return JT(t,e).height}C(MK,"calculateTextHeight");function fl(t,e){return JT(t,e).width}C(fl,"calculateTextWidth");var JT=p1((t,e)=>{const{fontSize:r=12,fontFamily:n="Arial",fontWeight:i=400}=e;if(!t)return{width:0,height:0};const[,s]=b4(r),o=["sans-serif",n],a=t.split(d0.lineBreakRegex),l=[],c=$t("body");if(!c.remove)return{width:0,height:0,lineHeight:0};const h=c.append("svg");for(const d of o){let f=0;const p={width:0,height:0,lineHeight:0};for(const m of a){const g=b_e();g.text=m||l_e;const y=x_e(h,g).style("font-size",s).style("font-weight",i).style("font-family",d),b=(y._groups||y)[0][0].getBBox();if(b.width===0&&b.height===0)throw new Error("svg element not in render tree");p.width=Math.round(Math.max(p.width,b.width)),f=Math.round(b.height),p.height+=f,p.lineHeight=Math.round(Math.max(p.lineHeight,f))}l.push(p)}h.remove();const u=isNaN(l[1].height)||isNaN(l[1].width)||isNaN(l[1].lineHeight)||l[0].height>l[1].height&&l[0].width>l[1].width&&l[0].lineHeight>l[1].lineHeight?0:1;return l[u]},(t,e)=>`${t}${e.fontSize}${e.fontWeight}${e.fontFamily}`),mf,k_e=(mf=class{constructor(e=!1,r){this.count=0,this.count=r?r.length:0,this.next=e?()=>this.count++:()=>Date.now()}},C(mf,"InitIDGenerator"),mf),u2,C_e=C(function(t){return u2=u2||document.createElement("div"),t=escape(t).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),u2.innerHTML=t,unescape(u2.textContent)},"entityDecode");function ZT(t){return"str"in t}C(ZT,"isDetailedError");var S_e=C((t,e,r,n)=>{var s;if(!n)return;const i=(s=t.node())==null?void 0:s.getBBox();i&&t.append("text").text(n).attr("text-anchor","middle").attr("x",i.x+i.width/2).attr("y",-r).attr("class",e)},"insertTitle"),b4=C(t=>{if(typeof t=="number")return[t,t+"px"];const e=parseInt(t??"",10);return Number.isNaN(e)?[void 0,void 0]:t===String(e)?[e,t+"px"]:[e,t]},"parseFontSize");function QT(t,e){return hre({},t,e)}C(QT,"cleanAndMerge");var Js={assignWithDepth:Qr,wrapLabel:v_e,calculateTextHeight:MK,calculateTextWidth:fl,calculateTextDimensions:JT,cleanAndMerge:QT,detectInit:u_e,detectDirective:vK,isSubstringInArray:f_e,interpolateToCurve:KT,calcLabelPosition:CK,calcCardinalityPosition:m_e,calcTerminalLabelPosition:SK,formatUrl:wK,getStylesFromArray:TK,generateId:g_e,random:y_e,runFunc:p_e,entityDecode:C_e,insertTitle:S_e,isLabelCoordinateInPath:AK,parseFontSize:b4,InitIDGenerator:k_e},T_e=C(function(t){let e=t;return e=e.replace(/style.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),e=e.replace(/classDef.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),e=e.replace(/#\w+;/g,function(r){const n=r.substring(1,r.length-1);return/^\+?\d+$/.test(n)?"fl°°"+n+"¶ß":"fl°"+n+"¶ß"}),e},"encodeEntities"),Ru=C(function(t){return t.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),HDe=C((t,e,{counter:r=0,prefix:n,suffix:i},s)=>s||`${n?`${n}_`:""}${t}_${e}_${r}${i?`_${i}`:""}`,"getEdgeId");function Vn(t){return t??null}C(Vn,"handleUndefinedAttr");function AK(t,e){const r=Math.round(t.x),n=Math.round(t.y),i=e.replace(/(\d+\.\d+)/g,s=>Math.round(parseFloat(s)).toString());return i.includes(r.toString())||i.includes(n.toString())}C(AK,"isLabelCoordinateInPath");const __e=Object.freeze({left:0,top:0,width:16,height:16}),uv=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),EK=Object.freeze({...__e,...uv}),M_e=Object.freeze({...EK,body:"",hidden:!1}),A_e=Object.freeze({width:null,height:null}),E_e=Object.freeze({...A_e,...uv}),O_e=(t,e,r,n="")=>{const i=t.split(":");if(t.slice(0,1)==="@"){if(i.length<2||i.length>3)return null;n=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const a=i.pop(),l=i.pop(),c={provider:i.length>0?i[0]:n,prefix:l,name:a};return Pk(c)?c:null}const s=i[0],o=s.split("-");if(o.length>1){const a={provider:n,prefix:o.shift(),name:o.join("-")};return Pk(a)?a:null}if(r&&n===""){const a={provider:n,prefix:"",name:s};return Pk(a,r)?a:null}return null},Pk=(t,e)=>t?!!((e&&t.prefix===""||t.prefix)&&t.name):!1;function L_e(t,e){const r={};!t.hFlip!=!e.hFlip&&(r.hFlip=!0),!t.vFlip!=!e.vFlip&&(r.vFlip=!0);const n=((t.rotate||0)+(e.rotate||0))%4;return n&&(r.rotate=n),r}function JI(t,e){const r=L_e(t,e);for(const n in M_e)n in uv?n in t&&!(n in r)&&(r[n]=uv[n]):n in e?r[n]=e[n]:n in t&&(r[n]=t[n]);return r}function D_e(t,e){const r=t.icons,n=t.aliases||Object.create(null),i=Object.create(null);function s(o){if(r[o])return i[o]=[];if(!(o in i)){i[o]=null;const a=n[o]&&n[o].parent,l=a&&s(a);l&&(i[o]=[a].concat(l))}return i[o]}
vendor: 4,253 bytes, line 1274
1274return(e||Object.keys(r).concat(Object.keys(n))).forEach(s),i}function ZI(t,e,r){const n=t.icons,i=t.aliases||Object.create(null);let s={};function o(a){s=JI(n[a]||i[a],s)}return o(e),r.forEach(o),JI(t,s)}function I_e(t,e){if(t.icons[e])return ZI(t,e,[]);const r=D_e(t,[e])[e];return r?ZI(t,e,r):null}const B_e=/(-?[0-9.]*[0-9]+[0-9.]*)/g,R_e=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function QI(t,e,r){if(e===1)return t;if(r=r||100,typeof t=="number")return Math.ceil(t*e*r)/r;if(typeof t!="string")return t;const n=t.split(B_e);if(n===null||!n.length)return t;const i=[];let s=n.shift(),o=R_e.test(s);for(;;){if(o){const a=parseFloat(s);isNaN(a)?i.push(s):i.push(Math.ceil(a*e*r)/r)}else i.push(s);if(s=n.shift(),s===void 0)return i.join("");o=!o}}function P_e(t,e="defs"){let r="";const n=t.indexOf("<"+e);for(;n>=0;){const i=t.indexOf(">",n),s=t.indexOf("</"+e);if(i===-1||s===-1)break;const o=t.indexOf(">",s);if(o===-1)break;r+=t.slice(i+1,s).trim(),t=t.slice(0,n).trim()+t.slice(o+1)}return{defs:r,content:t}}function N_e(t,e){return t?"<defs>"+t+"</defs>"+e:e}function F_e(t,e,r){const n=P_e(t);return N_e(n.defs,e+n.content+r)}const $_e=t=>t==="unset"||t==="undefined"||t==="none";function z_e(t,e){const r={...EK,...t},n={...E_e,...e},i={left:r.left,top:r.top,width:r.width,height:r.height};let s=r.body;[r,n].forEach(m=>{const g=[],y=m.hFlip,b=m.vFlip;let x=m.rotate;y?b?x+=2:(g.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),g.push("scale(-1 1)"),i.top=i.left=0):b&&(g.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),g.push("scale(1 -1)"),i.top=i.left=0);let S;switch(x<0&&(x-=Math.floor(x/4)*4),x=x%4,x){case 1:S=i.height/2+i.top,g.unshift("rotate(90 "+S.toString()+" "+S.toString()+")");break;case 2:g.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:S=i.width/2+i.left,g.unshift("rotate(-90 "+S.toString()+" "+S.toString()+")");break}x%2===1&&(i.left!==i.top&&(S=i.left,i.left=i.top,i.top=S),i.width!==i.height&&(S=i.width,i.width=i.height,i.height=S)),g.length&&(s=F_e(s,'<g transform="'+g.join(" ")+'">',"</g>"))});const o=n.width,a=n.height,l=i.width,c=i.height;let h,u;o===null?(u=a===null?"1em":a==="auto"?c:a,h=QI(u,l/c)):(h=o==="auto"?l:o,u=a===null?QI(h,c/l):a==="auto"?c:a);const d={},f=(m,g)=>{$_e(g)||(d[m]=g.toString())};f("width",h),f("height",u);const p=[i.left,i.top,l,c];return d.viewBox=p.join(" "),{attributes:d,viewBox:p,body:s}}const H_e=/\sid="(\S+)"/g,q_e="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let V_e=0;function W_e(t,e=q_e){const r=[];let n;for(;n=H_e.exec(t);)r.push(n[1]);if(!r.length)return t;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return r.forEach(s=>{const o=typeof e=="function"?e(s):e+(V_e++).toString(),a=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=t.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+o+i+"$3")}),t=t.replace(new RegExp(i,"g"),""),t}function j_e(t,e){let r=t.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const n in e)r+=" "+n+'="'+e[n]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+r+">"+t+"</svg>"}function e_(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Pu=e_();function OK(t){Pu=t}var Nm={exec:()=>null};function jt(t,e=""){let r=typeof t=="string"?t:t.source,n={replace:(i,s)=>{let o=typeof s=="string"?s:s.source;return o=o.replace(si.caret,"$1"),r=r.replace(i,o),n},getRegex:()=>new RegExp(r,e)};return n}var U_e=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),si={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine
vendor: 6,758 bytes, lines 1274-1275
1274:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[	 ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ 	][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},G_e=/^(?:[ \t]*(?:\n|$))+/,K_e=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Y_e=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Q1=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,X_e=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,t_=/(?:[*+-]|\d{1,9}[.)])/,LK=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,DK=jt(LK).replace(/bull/g,t_).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),J_e=jt(LK).replace(/bull/g,t_).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),r_=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Z_e=/^[^\n]+/,n_=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Q_e=jt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",n_).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),eMe=jt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,t_).getRegex(),x4="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",i_=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,tMe=jt("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ 	]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ 	]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ 	]*)+\\n|$))","i").replace("comment",i_).replace("tag",x4).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),IK=jt(r_).replace("hr",Q1).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",x4).getRegex(),rMe=jt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",IK).getRegex(),s_={blockquote:rMe,code:K_e,def:Q_e,fences:Y_e,heading:X_e,hr:Q1,html:tMe,lheading:DK,list:eMe,newline:G_e,paragraph:IK,table:Nm,text:Z_e},eB=jt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Q1).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}	)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",x4).getRegex(),nMe={...s_,lheading:J_e,table:eB,paragraph:jt(r_).replace("hr",Q1).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",eB).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",x4).getRegex()},iMe={...s_,html:jt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",i_).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Nm,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:jt(r_).replace("hr",Q1).replace("heading",` *#{1,6} *[^
1275]`).replace("lheading",DK).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},sMe=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,oMe=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,BK=/^( {2,}|\\)\n(?!\s*$)/,aMe=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,v4=/[\p{P}\p{S}]/u,o_=/[\s\p{P}\p{S}]/u,RK=/[^\s\p{P}\p{S}]/u,lMe=jt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,o_).getRegex(),PK=/(?!~)[\p{P}\p{S}]/u,cMe=/(?!~)[\s\p{P}\p{S}]/u,hMe=/(?:[^\s\p{P}\p{S}]|~)/u,uMe=jt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("prec
1275ode-",U_e?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),NK=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,dMe=jt(NK,"u").replace(/punct/g,v4).getRegex(),fMe=jt(NK,"u").replace(/punct/g,PK).getRegex(),FK="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",pMe=jt(FK,"gu").replace(/notPunctSpace/g,RK).replace(/punctSpace/g,o_).replace(/punct/g,v4).getRegex(),mMe=jt(FK,"gu").replace(/notPunctSpace/g,hMe).replace(/punctSpace/g,cMe).replace(/punct/g,PK).getRegex(),gMe=jt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,RK).replace(/punctSpace/g,o_).replace(/punct/g,v4).getRegex(),yMe=jt(/\\(punct)/,"gu").replace(/punct/g,v4).getRegex(),bMe=jt(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),xMe=jt(i_).replace("(?:-->|$)","-->").getRegex(),vMe=jt("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",xMe).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),dv=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,wMe=jt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",dv).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),$K=jt(/^!?\[(label)\]\[(ref)\]/).replace("label",dv).replace("ref",n_).getRegex(),zK=jt(/^!?\[(ref)\](?:\[\])?/).replace("ref",n_).getRegex(),kMe=jt("reflink|nolink(?!\\()","g").replace("reflink",$K).replace("nolink",zK).getRegex(),tB=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,a_={_backpedal:Nm,anyPunctuation:yMe,autolink:bMe,blockSkip:uMe,br:BK,code:oMe,del:Nm,emStrongLDelim:dMe,emStrongRDelimAst:pMe,emStrongRDelimUnd:gMe,escape:sMe,link:wMe,nolink:zK,punctuation:lMe,reflink:$K,reflinkSearch:kMe,tag:vMe,text:aMe,url:Nm},CMe={...a_,link:jt(/^!?\[(label)\]\((.*?)\)/).replace("label",dv).getRegex(),reflink:jt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",dv).getRegex()},h6={...a_,emStrongRDelimAst:mMe,emStrongLDelim:fMe,url:jt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",tB).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:jt(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",tB).getRegex()},SMe={...h6,br:jt(BK).replace("{2,}","*").getRegex(),text:jt(h6.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},d2={normal:s_,gfm:nMe,pedantic:iMe},Z0={normal:a_,gfm:h6,breaks:SMe,pedantic:CMe},TMe={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},rB=t=>TMe[t];function Oo(t,e){if(e){if(si.escapeTest.test(t))return t.replace(si.escapeReplace,rB)}else if(si.escapeTestNoEncode.test(t))return t.replace(si.escapeReplaceNoEncode,rB);return t}function nB(t){try{t=encodeURI(t).replace(si.percentDecode,"%")}catch{return null}return t}function iB(t,e){var s;let r=t.replace(si.findPipe,(o,a,l)=>{let c=!1,h=a;for(;--h>=0&&l[h]==="\\";)c=!c;return c?"|":" |"}),n=r.split(si.splitPipe),i=0;if(n[0].trim()||n.shift(),n.length>0&&!((s=n.at(-1))!=null&&s.trim())&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;i<n.length;i++)n[i]=n[i].trim().replace(si.slashPipe,"|");return n}function Q0(t,e,r){let n=t.length;if(n===0)return"";let i=0;for(;i<n;){let s=t.charAt(n-i-1);if(s===e&&!r)i++;else if(s!==e&&r)i++;else break}return t.slice(0,n-i)}function _Me(t,e){if(t.indexOf(e[1])===-1)return-1;let r=0;for(let n=0;n<t.length;n++)if(t[n]==="\\")n++;else if(t[n]===e[0])r++;else if(t[n]===e[1]&&(r--,r<0))return n;return r>0?-2:-1}function sB(t,e,r,n,i){let s=e.href,o=e.title||null,a=t[1].replace(i.other.outputLinkReplace,"$1");n.state.inLink=!0;let l={type:t[0].charAt(0)==="!"?"image":"link",raw:r,href:s,title:o,text:a,tokens:n.inlineTokens(a)};return n.state.inLink=!1,l}function MMe(t,e,r){let n=t.match(r.other.indentCodeCompensation);if(n===null)return e;let i=n[1];return e.split(`
1276`).map(s=>{let o=s.match(r.other.beginningSpace);if(o===null)return s;let[a]=o;return a.length>=i.length?s.slice(i.length):s}
vendor: 33,747 bytes, lines 1276-1343
1276).join(`
1277`)}var fv=class{constructor(e){er(this,"options");er(this,"rules");er(this,"lexer");this.options=e||Pu}space(e){let r=this.rules.block.newline.exec(e);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(e){let r=this.rules.block.code.exec(e);if(r){let n=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Q0(n,`
1278`)}}}fences(e){let r=this.rules.block.fences.exec(e);if(r){let n=r[0],i=MMe(n,r[3]||"",this.rules);return{type:"code",raw:n,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:i}}}heading(e){let r=this.rules.block.heading.exec(e);if(r){let n=r[2].trim();if(this.rules.other.endingHash.test(n)){let i=Q0(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(n=i.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let r=this.rules.block.hr.exec(e);if(r)return{type:"hr",raw:Q0(r[0],`
1279`)}}blockquote(e){let r=this.rules.block.blockquote.exec(e);if(r){let n=Q0(r[0],`
1280`).split(`
1281`),i="",s="",o=[];for(;n.length>0;){let a=!1,l=[],c;for(c=0;c<n.length;c++)if(this.rules.other.blockquoteStart.test(n[c]))l.push(n[c]),a=!0;else if(!a)l.push(n[c]);else break;n=n.slice(c);let h=l.join(`
1282`),u=h.replace(this.rules.other.blockquoteSetextReplace,`
1283    $1`).replace(this.rules.other.blockquoteSetextReplace2,"");i=i?`${i}
1284${h}`:h,s=s?`${s}
1285${u}`:u;let d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(u,o,!0),this.lexer.state.top=d,n.length===0)break;let f=o.at(-1);if((f==null?void 0:f.type)==="code")break;if((f==null?void 0:f.type)==="blockquote"){let p=f,m=p.raw+`
1286`+n.join(`
1287`),g=this.blockquote(m);o[o.length-1]=g,i=i.substring(0,i.length-p.raw.length)+g.raw,s=s.substring(0,s.length-p.text.length)+g.text;break}else if((f==null?void 0:f.type)==="list"){let p=f,m=p.raw+`
1288`+n.join(`
1289`),g=this.list(m);o[o.length-1]=g,i=i.substring(0,i.length-f.raw.length)+g.raw,s=s.substring(0,s.length-p.raw.length)+g.raw,n=m.substring(o.at(-1).raw.length).split(`
1290`);continue}}return{type:"blockquote",raw:i,tokens:o,text:s}}}list(e){let r=this.rules.block.list.exec(e);if(r){let n=r[1].trim(),i=n.length>1,s={type:"list",raw:"",ordered:i,start:i?+n.slice(0,-1):"",loose:!1,items:[]};n=i?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=i?n:"[*+-]");let o=this.rules.other.listItemRegex(n),a=!1;for(;e;){let c=!1,h="",u="";if(!(r=o.exec(e))||this.rules.block.hr.test(e))break;h=r[0],e=e.substring(h.length);let d=r[2].split(`
1291`,1)[0].replace(this.rules.other.listReplaceTabs,b=>" ".repeat(3*b.length)),f=e.split(`
1292`,1)[0],p=!d.trim(),m=0;if(this.options.pedantic?(m=2,u=d.trimStart()):p?m=r[1].length+1:(m=r[2].search(this.rules.other.nonSpaceChar),m=m>4?1:m,u=d.slice(m),m+=r[1].length),p&&this.rules.other.blankLine.test(f)&&(h+=f+`
1293`,e=e.substring(f.length+1),c=!0),!c){let b=this.rules.other.nextBulletRegex(m),x=this.rules.other.hrRegex(m),S=this.rules.other.fencesBeginRegex(m),k=this.rules.other.headingBeginRegex(m),w=this.rules.other.htmlBeginRegex(m);for(;e;){let _=e.split(`
1294`,1)[0],L;if(f=_,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting,"  "),L=f):L=f.replace(this.rules.other.tabCharGlobal,"    "),S.test(f)||k.test(f)||w.test(f)||b.test(f)||x.test(f))break;if(L.search(this.rules.other.nonSpaceChar)>=m||!f.trim())u+=`
1295`+L.slice(m);else{if(p||d.replace(this.rules.other.tabCharGlobal,"    ").search(this.rules.other.nonSpaceChar)>=4||S.test(d)||k.test(d)||x.test(d))break;u+=`
1296`+f}!p&&!f.trim()&&(p=!0),h+=_+`
1297`,e=e.substring(_.length+1),d=L.slice(m)}}s.loose||(a?s.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(a=!0));let g=null,y;this.options.gfm&&(g=this.rules.other.listIsTask.exec(u),g&&(y=g[0]!=="[ ] ",u=u.replace(this.rules.other.listReplaceTask,""))),s.items.push({type:"list_item",raw:h,task:!!g,checked:y,loose:!1,text:u,tokens:[]}),s.raw+=h}let l=s.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let c=0;c<s.items.length;c++)if(this.lexer.state.top=!1,s.items[c].tokens=this.lexer.blockTokens(s.items[c].text,[]),!s.loose){let h=s.items[c].tokens.filter(d=>d.type==="space"),u=h.length>0&&h.some(d=>this.rules.other.anyLine.test(d.raw));s.loose=u}if(s.loose)for(let c=0;c<s.items.length;c++)s.items[c].loose=!0;return s}}html(e){let r=this.rules.block.html.exec(e);if(r)return{type:"html",block:!0,raw:r[0],pre:r[1]==="pre"||r[1]==="script"||r[1]==="style",text:r[0]}}def(e){let r=this.rules.block.def.exec(e);if(r){let n=r[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=r[2]?r[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=r[3]?r[3].substring(1,r[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):r[3];return{type:"def",tag:n,raw:r[0],href:i,title:s}}}table(e){var a;let r=this.rules.block.table.exec(e);if(!r||!this.rules.other.tableDelimiter.test(r[2]))return;let n=iB(r[1]),i=r[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=(a=r[3])!=null&&a.trim()?r[3].replace(this.rules.other.tableRowBlankLine,"").split(`
1298`):[],o={type:"table",raw:r[0],header:[],align:[],rows:[]};if(n.length===i.length){for(let l of i)this.rules.other.tableAlignRight.test(l)?o.align.push("right"):this.rules.other.tableAlignCenter.test(l)?o.align.push("center"):this.rules.other.tableAlignLeft.test(l)?o.align.push("left"):o.align.push(null);for(let l=0;l<n.length;l++)o.header.push({text:n[l],tokens:this.lexer.inline(n[l]),header:!0,align:o.align[l]});for(let l of s)o.rows.push(iB(l,o.header.length).map((c,h)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:o.align[h]})));return o}}lheading(e){let r=this.rules.block.lheading.exec(e);if(r)return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(e){let r=this.rules.block.paragraph.exec(e);if(r){let n=r[1].charAt(r[1].length-1)===`
1299`?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let r=this.rules.block.text.exec(e);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(e){let r=this.rules.inline.escape.exec(e);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(e){let r=this.rules.inline.tag.exec(e);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(e){let r=this.rules.inline.link.exec(e);if(r){let n=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let o=Q0(n.slice(0,-1),"\\");if((n.length-o.length)%2===0)return}else{let o=_Me(r[2],"()");if(o===-2)return;if(o>-1){let a=(r[0].indexOf("!")===0?5:4)+r[1].length+o;r[2]=r[2].substring(0,o),r[0]=r[0].substring(0,a).trim(),r[3]=""}}let i=r[2],s="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(i);o&&(i=o[1],s=o[3])}else s=r[3]?r[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?i=i.slice(1):i=i.slice(1,-1)),sB(r,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(e,r){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=r[i.toLowerCase()];if(!s){let o=n[0].charAt(0);return{type:"text",raw:o,text:o}}return sB(n,s,n[0],this.lexer,this.rules)}}emStrong(e,r,n=""){let i=this.rules.inline.emStrongLDelim.exec(e);if(!(!i||i[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[2])||!n||this.rules.inline.punctuation.exec(n))){let s=[...i[0]].length-1,o,a,l=s,c=0,h=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,r=r.slice(-1*e.length+s);(i=h.exec(r))!=null;){if(o=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!o)continue;if(a=[...o].length,i[3]||i[4]){l+=a;continue}else if((i[5]||i[6])&&s%3&&!((s+a)%3)){c+=a;continue}if(l-=a,l>0)continue;a=Math.min(a,a+l+c);let u=[...i[0]][0].length,d=e.slice(0,s+i.index+u+a);if(Math.min(s,a)%2){let p=d.slice(1,-1);return{type:"em",raw:d,text:p,tokens:this.lexer.inlineTokens(p)}}let f=d.slice(2,-2);return{type:"strong",raw:d,text:f,tokens:this.lexer.inlineTokens(f)}}}}codespan(e){let r=this.rules.inline.code.exec(e);if(r){let n=r[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(n),s=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&s&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:r[0],text:n}}}br(e){let r=this.rules.inline.br.exec(e);if(r)return{type:"br",raw:r[0]}}del(e){let r=this.rules.inline.del.exec(e);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(e){let r=this.rules.inline.autolink.exec(e);if(r){let n,i;return r[2]==="@"?(n=r[1],i="mailto:"+n):(n=r[1],i=n),{type:"link",raw:r[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let r;if(r=this.rules.inline.url.exec(e)){let i,s;if(r[2]==="@")i=r[0],s="mailto:"+i;else{let o;do o=r[0],r[0]=((n=this.rules.inline._backpedal.exec(r[0]))==null?void 0:n[0])??"";while(o!==r[0]);i=r[0],r[1]==="www."?s="http://"+r[0]:s=r[0]}return{type:"link",raw:r[0],text:i,href:s,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(e){let r=this.rules.inline.text.exec(e);if(r){let n=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:n}}}},Gs=class u6{constructor(e){er(this,"tokens");er(this,"options");er(this,"state");er(this,"tokenizer");er(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Pu,this.options.tokenizer=this.options.tokenizer||new fv,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:si,block:d2.normal,inline:Z0.normal};this.options.pedantic?(r.block=d2.pedantic,r.inline=Z0.pedantic):this.options.gfm&&(r.block=d2.gfm,this.options.breaks?r.inline=Z0.breaks:r.inline=Z0.gfm),this.tokenizer.rules=r}static get rules(){return{block:d2,inline:Z0}}static lex(e,r){return new u6(r).lex(e)}static lexInline(e,r){return new u6(r).inlineTokens(e)}lex(e){e=e.replace(si.carriageReturn,`
1300`),this.blockTokens(e,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let n=this.inlineQueue[r];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,r=[],n=!1){var i,s,o;for(this.options.pedantic&&(e=e.replace(si.tabCharGlobal,"    ").replace(si.spaceLine,""));e;){let a;if((s=(i=this.options.extensions)==null?void 0:i.block)!=null&&s.some(c=>(a=c.call({lexer:this},e,r))?(e=e.substring(a.raw.length),r.push(a),!0):!1))continue;if(a=this.tokenizer.space(e)){e=e.substring(a.raw.length);let c=r.at(-1);a.raw.length===1&&c!==void 0?c.raw+=`
1301`:r.push(a);continue}if(a=this.tokenizer.code(e)){e=e.substring(a.raw.length);let c=r.at(-1);(c==null?void 0:c.type)==="paragraph"||(c==null?void 0:c.type)==="text"?(c.raw+=(c.raw.endsWith(`
1302`)?"":`
1303`)+a.raw,c.text+=`
1304`+a.text,this.inlineQueue.at(-1).src=c.text):r.push(a);continue}if(a=this.tokenizer.fences(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.heading(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.hr(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.blockquote(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.list(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.html(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.def(e)){e=e.substring(a.raw.length);let c=r.at(-1);(c==null?void 0:c.type)==="paragraph"||(c==null?void 0:c.type)==="text"?(c.raw+=(c.raw.endsWith(`
1305`)?"":`
1306`)+a.raw,c.text+=`
1307`+a.raw,this.inlineQueue.at(-1).src=c.text):this.tokens.links[a.tag]||(this.tokens.links[a.tag]={href:a.href,title:a.title},r.push(a));continue}if(a=this.tokenizer.table(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.lheading(e)){e=e.substring(a.raw.length),r.push(a);continue}let l=e;if((o=this.options.extensions)!=null&&o.startBlock){let c=1/0,h=e.slice(1),u;this.options.extensions.startBlock.forEach(d=>{u=d.call({lexer:this},h),typeof u=="number"&&u>=0&&(c=Math.min(c,u))}),c<1/0&&c>=0&&(l=e.substring(0,c+1))}if(this.state.top&&(a=this.tokenizer.paragraph(l))){let c=r.at(-1);n&&(c==null?void 0:c.type)==="paragraph"?(c.raw+=(c.raw.endsWith(`
1308`)?"":`
1309`)+a.raw,c.text+=`
1310`+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):r.push(a),n=l.length!==e.length,e=e.substring(a.raw.length);continue}if(a=this.tokenizer.text(e)){e=e.substring(a.raw.length);let c=r.at(-1);(c==null?void 0:c.type)==="text"?(c.raw+=(c.raw.endsWith(`
1311`)?"":`
1312`)+a.raw,c.text+=`
1313`+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):r.push(a);continue}if(e){let c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){var l,c,h,u,d;let n=e,i=null;if(this.tokens.links){let f=Object.keys(this.tokens.links);if(f.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)f.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,i.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let s;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)s=i[2]?i[2].length:0,n=n.slice(0,i.index+s)+"["+"a".repeat(i[0].length-s-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=((c=(l=this.options.hooks)==null?void 0:l.emStrongMask)==null?void 0:c.call({lexer:this},n))??n;let o=!1,a="";for(;e;){o||(a=""),o=!1;let f;if((u=(h=this.options.extensions)==null?void 0:h.inline)!=null&&u.some(m=>(f=m.call({lexer:this},e,r))?(e=e.substring(f.raw.length),r.push(f),!0):!1))continue;if(f=this.tokenizer.escape(e)){e=e.substring(f.raw.length),r.push(f);continue}if(f=this.tokenizer.tag(e)){e=e.substring(f.raw.length),r.push(f);continue}if(f=this.tokenizer.link(e)){e=e.substring(f.raw.length),r.push(f);continue}if(f=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(f.raw.length);let m=r.at(-1);f.type==="text"&&(m==null?void 0:m.type)==="text"?(m.raw+=f.raw,m.text+=f.text):r.push(f);continue}if(f=this.tokenizer.emStrong(e,n,a)){e=e.substring(f.raw.length),r.push(f);continue}if(f=this.tokenizer.codespan(e)){e=e.substring(f.raw.length),r.push(f);continue}if(f=this.tokenizer.br(e)){e=e.substring(f.raw.length),r.push(f);continue}if(f=this.tokenizer.del(e)){e=e.substring(f.raw.length),r.push(f);continue}if(f=this.tokenizer.autolink(e)){e=e.substring(f.raw.length),r.push(f);continue}if(!this.state.inLink&&(f=this.tokenizer.url(e))){e=e.substring(f.raw.length),r.push(f);continue}let p=e;if((d=this.options.extensions)!=null&&d.startInline){let m=1/0,g=e.slice(1),y;this.options.extensions.startInline.forEach(b=>{y=b.call({lexer:this},g),typeof y=="number"&&y>=0&&(m=Math.min(m,y))}),m<1/0&&m>=0&&(p=e.substring(0,m+1))}if(f=this.tokenizer.inlineText(p)){e=e.substring(f.raw.length),f.raw.slice(-1)!=="_"&&(a=f.raw.slice(-1)),o=!0;let m=r.at(-1);(m==null?void 0:m.type)==="text"?(m.raw+=f.raw,m.text+=f.text):r.push(f);continue}if(e){let m="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return r}},pv=class{constructor(e){er(this,"options");er(this,"parser");this.options=e||Pu}space(e){return""}code({text:e,lang:r,escaped:n}){var o;let i=(o=(r||"").match(si.notSpaceStart))==null?void 0:o[0],s=e.replace(si.endingNewline,"")+`
1314`;return i?'<pre><code class="language-'+Oo(i)+'">'+(n?s:Oo(s,!0))+`</code></pre>
1315`:"<pre><code>"+(n?s:Oo(s,!0))+`</code></pre>
1316`}blockquote({tokens:e}){return`<blockquote>
1317${this.parser.parse(e)}</blockquote>
1318`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:r}){return`<h${r}>${this.parser.parseInline(e)}</h${r}>
1319`}hr(e){return`<hr>
1320`}list(e){let r=e.ordered,n=e.start,i="";for(let a=0;a<e.items.length;a++){let l=e.items[a];i+=this.listitem(l)}let s=r?"ol":"ul",o=r&&n!==1?' start="'+n+'"':"";return"<"+s+o+`>
1321`+i+"</"+s+`>
1322`}listitem(e){var n;let r="";if(e.task){let i=this.checkbox({checked:!!e.checked});e.loose?((n=e.tokens[0])==null?void 0:n.type)==="paragraph"?(e.tokens[0].text=i+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=i+" "+Oo(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:i+" ",text:i+" ",escaped:!0}):r+=i+" "}return r+=this.parser.parse(e.tokens,!!e.loose),`<li>${r}</li>
1323`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
1324`}table(e){let r="",n="";for(let s=0;s<e.header.length;s++)n+=this.tablecell(e.header[s]);r+=this.tablerow({text:n});let i="";for(let s=0;s<e.rows.length;s++){let o=e.rows[s];n="";for(let a=0;a<o.length;a++)n+=this.tablecell(o[a]);i+=this.tablerow({text:n})}return i&&(i=`<tbody>${i}</tbody>`),`<table>
1325<thead>
1326`+r+`</thead>
1327`+i+`</table>
1328`}tablerow({text:e}){return`<tr>
1329${e}</tr>
1330`}tablecell(e){let r=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+r+`</${n}>
1331`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Oo(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:r,tokens:n}){let i=this.parser.parseInline(n),s=nB(e);if(s===null)return i;e=s;let o='<a href="'+e+'"';return r&&(o+=' title="'+Oo(r)+'"'),o+=">"+i+"</a>",o}image({href:e,title:r,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let s=nB(e);if(s===null)return Oo(n);e=s;let o=`<img src="${e}" alt="${n}"`;return r&&(o+=` title="${Oo(r)}"`),o+=">",o}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Oo(e.text)}},l_=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},Ks=class d6{constructor(e){er(this,"options");er(this,"renderer");er(this,"textRenderer");this.options=e||Pu,this.options.renderer=this.options.renderer||new pv,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new l_}static parse(e,r){return new d6(r).parse(e)}static parseInline(e,r){return new d6(r).parseInline(e)}parse(e,r=!0){var i,s;let n="";for(let o=0;o<e.length;o++){let a=e[o];if((s=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&s[a.type]){let c=a,h=this.options.extensions.renderers[c.type].call({parser:this},c);if(h!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(c.type)){n+=h||"";continue}}let l=a;switch(l.type){case"space":{n+=this.renderer.space(l);continue}case"hr":{n+=this.renderer.hr(l);continue}case"heading":{n+=this.renderer.heading(l);continue}case"code":{n+=this.renderer.code(l);continue}case"table":{n+=this.renderer.table(l);continue}case"blockquote":{n+=this.renderer.blockquote(l);continue}case"list":{n+=this.renderer.list(l);continue}case"html":{n+=this.renderer.html(l);continue}case"def":{n+=this.renderer.def(l);continue}case"paragraph":{n+=this.renderer.paragraph(l);continue}case"text":{let c=l,h=this.renderer.text(c);for(;o+1<e.length&&e[o+1].type==="text";)c=e[++o],h+=`
1332`+this.renderer.text(c);r?n+=this.renderer.paragraph({type:"paragraph",raw:h,text:h,tokens:[{type:"text",raw:h,text:h,escaped:!0}]}):n+=h;continue}default:{let c='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return n}parseInline(e,r=this.renderer){var i,s;let n="";for(let o=0;o<e.length;o++){let a=e[o];if((s=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&s[a.type]){let c=this.options.extensions.renderers[a.type].call({parser:this},a);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){n+=c||"";continue}}let l=a;switch(l.type){case"escape":{n+=r.text(l);break}case"html":{n+=r.html(l);break}case"link":{n+=r.link(l);break}case"image":{n+=r.image(l);break}case"strong":{n+=r.strong(l);break}case"em":{n+=r.em(l);break}case"codespan":{n+=r.codespan(l);break}case"br":{n+=r.br(l);break}case"del":{n+=r.del(l);break}case"text":{n+=r.text(l);break}default:{let c='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return n}},b2,Up=(b2=class{constructor(e){er(this,"options");er(this,"block");this.options=e||Pu}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?Gs.lex:Gs.lexInline}provideParser(){return this.block?Ks.parse:Ks.parseInline}},er(b2,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),er(b2,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),b2),AMe=class{constructor(...e){er(this,"defaults",e_());er(this,"options",this.setOptions);er(this,"parse",this.parseMarkdown(!0));er(this,"parseInline",this.parseMarkdown(!1));er(this,"Parser",Ks);er(this,"Renderer",pv);er(this,"TextRenderer",l_);er(this,"Lexer",Gs);er(this,"Tokenizer",fv);er(this,"Hooks",Up);this.use(...e)}walkTokens(e,r){var i,s;let n=[];for(let o of e)switch(n=n.concat(r.call(this,o)),o.type){case"table":{let a=o;for(let l of a.header)n=n.concat(this.walkTokens(l.tokens,r));for(let l of a.rows)for(let c of l)n=n.concat(this.walkTokens(c.tokens,r));break}case"list":{let a=o;n=n.concat(this.walkTokens(a.items,r));break}default:{let a=o;(s=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&s[a.type]?this.defaults.extensions.childTokens[a.type].forEach(l=>{let c=a[l].flat(1/0);n=n.concat(this.walkTokens(c,r))}):a.tokens&&(n=n.concat(this.walkTokens(a.tokens,r)))}}return n}use(...e){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let i={...n};if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let o=r.renderers[s.name];o?r.renderers[s.name]=function(...a){let l=s.renderer.apply(this,a);return l===!1&&(l=o.apply(this,a)),l}:r.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=r[s.level];o?o.unshift(s.tokenizer):r[s.level]=[s.tokenizer],s.start&&(s.level==="block"?r.startBlock?r.startBlock.push(s.start):r.startBlock=[s.start]:s.level==="inline"&&(r.startInline?r.startInline.push(s.start):r.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(r.childTokens[s.name]=s.childTokens)}),i.extensions=r),n.renderer){let s=this.defaults.renderer||new pv(this.defaults);for(let o in n.renderer){if(!(o in s))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let a=o,l=n.renderer[a],c=s[a];s[a]=(...h)=>{let u=l.apply(s,h);return u===!1&&(u=c.apply(s,h)),u||""}}i.renderer=s}if(n.tokenizer){let s=this.defaults.tokenizer||new fv(this.defaults);for(let o in n.tokenizer){if(!(o in s))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let a=o,l=n.tokenizer[a],c=s[a];s[a]=(...h)=>{let u=l.apply(s,h);return u===!1&&(u=c.apply(s,h)),u}}i.tokenizer=s}if(n.hooks){let s=this.defaults.hooks||new Up;for(let o in n.hooks){if(!(o in s))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let a=o,l=n.hooks[a],c=s[a];Up.passThroughHooks.has(o)?s[a]=h=>{if(this.defaults.async&&Up.passThroughHooksRespectAsync.has(o))return(async()=>{let d=await l.call(s,h);return c.call(s,d)})();let u=l.call(s,h);return c.call(s,u)}:s[a]=(...h)=>{if(this.defaults.async)return(async()=>{let d=await l.apply(s,h);return d===!1&&(d=await c.apply(s,h)),d})();let u=l.apply(s,h);return u===!1&&(u=c.apply(s,h)),u}}i.hooks=s}if(n.walkTokens){let s=this.defaults.walkTokens,o=n.walkTokens;i.walkTokens=function(a){let l=[];return l.push(o.call(this,a)),s&&(l=l.concat(s.call(this,a))),l}}this.defaults={...this.defaults,...i}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,r){return Gs.lex(e,r??this.defaults)}parser(e,r){return Ks.parse(e,r??this.defaults)}parseMarkdown(e){return(r,n)=>{let i={...n},s={...this.defaults,...i},o=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&i.async===!1)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=e),s.async)return(async()=>{let a=s.hooks?await s.hooks.preprocess(r):r,l=await(s.hooks?await s.hooks.provideLexer():e?Gs.lex:Gs.lexInline)(a,s),c=s.hooks?await s.hooks.processAllTokens(l):l;s.walkTokens&&await Promise.all(this.walkTokens(c,s.walkTokens));let h=await(s.hooks?await s.hooks.provideParser():e?Ks.parse:Ks.parseInline)(c,s);return s.hooks?await s.hooks.postprocess(h):h})().catch(o);try{s.hooks&&(r=s.hooks.preprocess(r));let a=(s.hooks?s.hooks.provideLexer():e?Gs.lex:Gs.lexInline)(r,s);s.hooks&&(a=s.hooks.processAllTokens(a)),s.walkTokens&&this.walkTokens(a,s.walkTokens);let l=(s.hooks?s.hooks.provideParser():e?Ks.parse:Ks.parseInline)(a,s);return s.hooks&&(l=s.hooks.postprocess(l)),l}catch(a){return o(a)}}}onError(e,r){return n=>{if(n.message+=`
1333Please report this to https://github.com/markedjs/marked.`,e){let i="<p>An error occurred:</p><pre>"+Oo(n.message+"",!0)+"</pre>";return r?Promise.resolve(i):i}if(r)return Promise.reject(n);throw n}}},wu=new AMe;function Qt(t,e){return wu.parse(t,e)}Qt.options=Qt.setOptions=function(t){return wu.setOptions(t),Qt.defaults=wu.defaults,OK(Qt.defaults),Qt};Qt.getDefaults=e_;Qt.defaults=Pu;Qt.use=function(...t){return wu.use(...t),Qt.defaults=wu.defaults,OK(Qt.defaults),Qt};Qt.walkTokens=function(t,e){return wu.walkTokens(t,e)};Qt.parseInline=wu.parseInline;Qt.Parser=Ks;Qt.parser=Ks.parse;Qt.Renderer=pv;Qt.TextRenderer=l_;Qt.Lexer=Gs;Qt.lexer=Gs.lex;Qt.Tokenizer=fv;Qt.Hooks=Up;Qt.parse=Qt;Qt.options;Qt.setOptions;Qt.use;Qt.walkTokens;Qt.parseInline;Ks.parse;Gs.lex;function HK(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n=Array.from(typeof t=="string"?[t]:t);n[n.length-1]=n[n.length-1].replace(/\r?\n([\t ]*)$/,"");var i=n.reduce(function(a,l){var c=l.match(/\n([\t ]+|(?!\s).)/g);return c?a.concat(c.map(function(h){var u,d;return(d=(u=h.match(/[\t ]/g))===null||u===void 0?void 0:u.length)!==null&&d!==void 0?d:0})):a},[]);if(i.length){var s=new RegExp(`
1334[	 ]{`+Math.min.apply(Math,i)+"}","g");n=n.map(function(a){return a.replace(s,`
1335`)})}n[0]=n[0].replace(/^\r?\n/,"");var o=n[0];return e.forEach(function(a,l){var c=o.match(/(?:^|\n)( *)$/),h=c?c[1]:"",u=a;typeof a=="string"&&a.includes(`
1336`)&&(u=String(a).split(`
1337`).map(function(d,f){return f===0?d:""+h+d}).join(`
1338`)),o+=u+n[l+1]}),o}var EMe={body:'<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/><text transform="translate(21.16 64.67)" style="fill: #fff; font-family: ArialMT, Arial; font-size: 67.75px;"><tspan x="0" y="0">?</tspan></text></g>',height:80,width:80},f6=new Map,qK=new Map,OMe=C(t=>{for(const e of t){if(!e.name)throw new Error('Invalid icon loader. Must have a "name" property with non-empty string value.');if(de.debug("Registering icon pack:",e.name),"loader"in e)qK.set(e.name,e.loader);else if("icons"in e)f6.set(e.name,e.icons);else throw de.error("Invalid icon loader:",e),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),VK=C(async(t,e)=>{const r=O_e(t,!0,e!==void 0);if(!r)throw new Error(`Invalid icon name: ${t}`);const n=r.prefix||e;if(!n)throw new Error(`Icon name must contain a prefix: ${t}`);let i=f6.get(n);if(!i){const o=qK.get(n);if(!o)throw new Error(`Icon set not found: ${r.prefix}`);try{i={...await o(),prefix:n},f6.set(n,i)}catch(a){throw de.error(a),new Error(`Failed to load icon set: ${r.prefix}`)}}const s=I_e(i,r.name);if(!s)throw new Error(`Icon not found: ${t}`);return s},"getRegisteredIconData"),LMe=C(async t=>{try{return await VK(t),!0}catch{return!1}},"isIconAvailable"),ey=C(async(t,e,r)=>{let n;try{n=await VK(t,e==null?void 0:e.fallbackPrefix)}catch(o){de.error(o),n=EMe}const i=z_e(n,e),s=j_e(W_e(i.body),{...i.attributes,...r});return Rs(s,Hn())},"getIconSVG");function WK(t,{markdownAutoWrap:e}){const n=t.replace(/<br\/>/g,`
1339`).replace(/\n{2,}/g,`
1340`),i=HK(n);return e===!1?i.replace(/ /g,"&nbsp;"):i}C(WK,"preprocessMarkdown");function jK(t,e={}){const r=WK(t,e),n=Qt.lexer(r),i=[[]];let s=0;function o(a,l="normal"){a.type==="text"?a.text.split(`
1341`).forEach((h,u)=>{u!==0&&(s++,i.push([])),h.split(" ").forEach(d=>{d=d.replace(/&#39;/g,"'"),d&&i[s].push({content:d,type:l})})}):a.type==="strong"||a.type==="em"?a.tokens.forEach(c=>{o(c,a.type)}):a.type==="html"&&i[s].push({content:a.text,type:"normal"})}return C(o,"processNode"),n.forEach(a=>{var l;a.type==="paragraph"?(l=a.tokens)==null||l.forEach(c=>{o(c)}):a.type==="html"?i[s].push({content:a.text,type:"normal"}):i[s].push({content:a.raw,type:"normal"})}),i}C(jK,"markdownToLines");function UK(t,{markdownAutoWrap:e}={}){const r=Qt.lexer(t);function n(i){var s,o,a;return i.type==="text"?e===!1?i.text.replace(/\n */g,"<br/>").replace(/ /g,"&nbsp;"):i.text.replace(/\n */g,"<br/>"):i.type==="strong"?`<strong>${(s=i.tokens)==null?void 0:s.map(n).join("")}</strong>`:i.type==="em"?`<em>${(o=i.tokens)==null?void 0:o.map(n).join("")}</em>`:i.type==="paragraph"?`<p>${(a=i.tokens)==null?void 0:a.map(n).join("")}</p>`:i.type==="space"?"":i.type==="html"?`${i.text}`:i.type==="escape"?i.text:(de.warn(`Unsupported markdown: ${i.type}`),i.raw)}return C(n,"output"),r.map(n).join("")}C(UK,"markdownToHTML");function GK(t){return Intl.Segmenter?[...new Intl.Segmenter().segment(t)].map(e=>e.segment):[...t]}C(GK,"splitTextToChars");function KK(t,e){const r=GK(e.content);return c_(t,[],r,e.type)}C(KK,"splitWordToFitWidth");function c_(t,e,r,n){if(r.length===0)return[{content:e.join(""),type:n},{content:"",type:n}];const[i,...s]=r,o=[...e,i];return t([{content:o.join(""),type:n}])?c_(t,o,s,n):(e.length===0&&i&&(e.push(i),r.shift()),[{content:e.join(""),type:n},{content:r.join(""),type:n}])}C(c_,"splitWordToFitWidthRecursion");function YK(t,e){if(t.some(({content:r})=>r.includes(`
1342`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return mv(t,e)}C(YK,"splitLineToFitWidth");function mv(t,e,r=[],n=[]){if(t.length===0)return n.length>0&&r.push(n),r.length>0?r:[];let i="";t[0].content===" "&&(i=" ",t.shift());const s=t.shift()??{content:" ",type:"normal"},o=[...n];if(i!==""&&o.push({content:i,type:"normal"}),o.push(s),e(o))return mv(t,e,r,o);if(n.length>0)r.push(n),t.unshift(s);else if(s.content){const[a,l]=KK(e,s);r.push([a]),l.content&&t.unshift(l)}return mv(t,e,r)}C(mv,"splitLineToFitWidthRecursion");function p6(t,e){e&&t.attr("style",e)}C(p6,"applyStyle");async function XK(t,e,r,n,i=!1,s=Hn()){const o=t.append("foreignObject");o.attr("width",`${10*r}px`),o.attr("height",`${10*r}px`);const a=o.append("xhtml:div"),l=Nf(e.label)?await wT(e.label.replace(d0.lineBreakRegex,`
1343`),s):Rs(e.label,s),c=e.isNode?"nodeLabel":"edgeLabel",h=a.append("span");h.html(l),p6(h,e.labelStyle),h.attr("class",`${c} ${n}`),p6(a,e.labelStyle),a.style("display","table-cell"),a.style("white-space","nowrap"),a.style("line-height","1.5"),a.style("max-width",r+"px"),a.style("text-align","center"),a.attr("xmlns","http://www.w3.org/1999/xhtml"),i&&a.attr("class","labelBkg");let u=a.node().getBoundingClientRect();return u.width===r&&(a.style("display","table"),a.style("white-space","break-spaces"),a.style("width",r+"px"),u=a.node().getBoundingClientRect()),o.node()}C(XK,"addHtmlSpan");function w4(t,e,r){return t.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",e*r-.1+"em").attr("dy",r+"em")}C(w4,"createTspan");function JK(t,e,r){const n=t.append("text"),i=w4(n,1,e);k4(i,r);const s=i.node().getComputedTextLength();return n.remove(),s}C(JK,"computeWidthOfText");function DMe(t,e,r){var o;const n=t.append("text"),i=w4(n,1,e);k4(i,[{content:r,type:"normal"}]);const s=(o=i.node())==null?void 0:o.getBoundingClientRect();return s&&n.remove(),s}
vendor: 24,474 bytes, line 1343
1343C(DMe,"computeDimensionOfText");function ZK(t,e,r,n=!1){const s=e.append("g"),o=s.insert("rect").attr("class","background").attr("style","stroke: none"),a=s.append("text").attr("y","-10.1");let l=0;for(const c of r){const h=C(d=>JK(s,1.1,d)<=t,"checkWidth"),u=h(c)?[c]:YK(c,h);for(const d of u){const f=w4(a,l,1.1);k4(f,d),l++}}if(n){const c=a.node().getBBox(),h=2;return o.attr("x",c.x-h).attr("y",c.y-h).attr("width",c.width+2*h).attr("height",c.height+2*h),s.node()}else return a.node()}C(ZK,"createFormattedText");function k4(t,e){t.text(""),e.forEach((r,n)=>{const i=t.append("tspan").attr("font-style",r.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",r.type==="strong"?"bold":"normal");n===0?i.text(r.content):i.text(" "+r.content)})}C(k4,"updateTextContentAndStyles");async function QK(t,e={}){const r=[];t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(i,s,o)=>(r.push((async()=>{const a=`${s}:${o}`;return await LMe(a)?await ey(a,void 0,{class:"label-icon"}):`<i class='${Rs(i,e).replace(":"," ")}'></i>`})()),i));const n=await Promise.all(r);return t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>n.shift()??"")}C(QK,"replaceIconSubstring");var Fc=C(async(t,e="",{style:r="",isTitle:n=!1,classes:i="",useHtmlLabels:s=!0,isNode:o=!0,width:a=200,addSvgBackground:l=!1}={},c)=>{if(de.debug("XYZ createText",e,r,n,i,s,o,"addSvgBackground: ",l),s){const h=UK(e,c),u=await QK(Ru(h),c),d=e.replace(/\\\\/g,"\\"),f={isNode:o,label:Nf(e)?d:u,labelStyle:r.replace("fill:","color:")};return await XK(t,f,a,i,l,c)}else{const h=e.replace(/<br\s*\/?>/g,"<br/>"),u=jK(h.replace("<br>","<br/>"),c),d=ZK(a,t,u,e?l:!1);if(o){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));const f=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");$t(d).attr("style",f)}else{const f=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");$t(d).select("rect").attr("style",f.replace(/background:/g,"fill:"));const p=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");$t(d).select("text").attr("style",p)}return d}},"createText");function Nk(t,e,r){if(t&&t.length){const[n,i]=e,s=Math.PI/180*r,o=Math.cos(s),a=Math.sin(s);for(const l of t){const[c,h]=l;l[0]=(c-n)*o-(h-i)*a+n,l[1]=(c-n)*a+(h-i)*o+i}}}function IMe(t,e){return t[0]===e[0]&&t[1]===e[1]}function BMe(t,e,r,n=1){const i=r,s=Math.max(e,.1),o=t[0]&&t[0][0]&&typeof t[0][0]=="number"?[t]:t,a=[0,0];if(i)for(const c of o)Nk(c,a,i);const l=function(c,h,u){const d=[];for(const b of c){const x=[...b];IMe(x[0],x[x.length-1])||x.push([x[0][0],x[0][1]]),x.length>2&&d.push(x)}const f=[];h=Math.max(h,.1);const p=[];for(const b of d)for(let x=0;x<b.length-1;x++){const S=b[x],k=b[x+1];if(S[1]!==k[1]){const w=Math.min(S[1],k[1]);p.push({ymin:w,ymax:Math.max(S[1],k[1]),x:w===S[1]?S[0]:k[0],islope:(k[0]-S[0])/(k[1]-S[1])})}}if(p.sort((b,x)=>b.ymin<x.ymin?-1:b.ymin>x.ymin?1:b.x<x.x?-1:b.x>x.x?1:b.ymax===x.ymax?0:(b.ymax-x.ymax)/Math.abs(b.ymax-x.ymax)),!p.length)return f;let m=[],g=p[0].ymin,y=0;for(;m.length||p.length;){if(p.length){let b=-1;for(let x=0;x<p.length&&!(p[x].ymin>g);x++)b=x;p.splice(0,b+1).forEach(x=>{m.push({s:g,edge:x})})}if(m=m.filter(b=>!(b.edge.ymax<=g)),m.sort((b,x)=>b.edge.x===x.edge.x?0:(b.edge.x-x.edge.x)/Math.abs(b.edge.x-x.edge.x)),(u!==1||y%h==0)&&m.length>1)for(let b=0;b<m.length;b+=2){const x=b+1;if(x>=m.length)break;const S=m[b].edge,k=m[x].edge;f.push([[Math.round(S.x),g],[Math.round(k.x),g]])}g+=u,m.forEach(b=>{b.edge.x=b.edge.x+u*b.edge.islope}),y++}return f}(o,s,n);if(i){for(const c of o)Nk(c,a,-i);(function(c,h,u){const d=[];c.forEach(f=>d.push(...f)),Nk(d,h,u)})(l,a,-i)}return l}function ty(t,e){var r;const n=e.hachureAngle+90;let i=e.hachureGap;i<0&&(i=4*e.strokeWidth),i=Math.round(Math.max(i,.1));let s=1;return e.roughness>=1&&(((r=e.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(s=i),BMe(t,i,n,s||1)}let h_=class{constructor(e){this.helper=e}fillPolygons(e,r){return this._fillPolygons(e,r)}_fillPolygons(e,r){const n=ty(e,r);return{type:"fillSketch",ops:this.renderLines(n,r)}}renderLines(e,r){const n=[];for(const i of e)n.push(...this.helper.doubleLineOps(i[0][0],i[0][1],i[1][0],i[1][1],r));return n}};function C4(t){const e=t[0],r=t[1];return Math.sqrt(Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2))}class RMe extends h_{fillPolygons(e,r){let n=r.hachureGap;n<0&&(n=4*r.strokeWidth),n=Math.max(n,.1);const i=ty(e,Object.assign({},r,{hachureGap:n})),s=Math.PI/180*r.hachureAngle,o=[],a=.5*n*Math.cos(s),l=.5*n*Math.sin(s);for(const[c,h]of i)C4([c,h])&&o.push([[c[0]-a,c[1]+l],[...h]],[[c[0]+a,c[1]-l],[...h]]);return{type:"fillSketch",ops:this.renderLines(o,r)}}}let PMe=class extends h_{fillPolygons(e,r){const n=this._fillPolygons(e,r),i=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),s=this._fillPolygons(e,i);return n.ops=n.ops.concat(s.ops),n}};class NMe{constructor(e){this.helper=e}fillPolygons(e,r){const n=ty(e,r=Object.assign({},r,{hachureAngle:0}));return this.dotsOnLines(n,r)}dotsOnLines(e,r){const n=[];let i=r.hachureGap;i<0&&(i=4*r.strokeWidth),i=Math.max(i,.1);let s=r.fillWeight;s<0&&(s=r.strokeWidth/2);const o=i/4;for(const a of e){const l=C4(a),c=l/i,h=Math.ceil(c)-1,u=l-h*i,d=(a[0][0]+a[1][0])/2-i/4,f=Math.min(a[0][1],a[1][1]);for(let p=0;p<h;p++){const m=f+u+p*i,g=d-o+2*Math.random()*o,y=m-o+2*Math.random()*o,b=this.helper.ellipse(g,y,s,s,r);n.push(...b.ops)}}return{type:"fillSketch",ops:n}}}class FMe{constructor(e){this.helper=e}fillPolygons(e,r){const n=ty(e,r);return{type:"fillSketch",ops:this.dashedLine(n,r)}}dashedLine(e,r){const n=r.dashOffset<0?r.hachureGap<0?4*r.strokeWidth:r.hachureGap:r.dashOffset,i=r.dashGap<0?r.hachureGap<0?4*r.strokeWidth:r.hachureGap:r.dashGap,s=[];return e.forEach(o=>{const a=C4(o),l=Math.floor(a/(n+i)),c=(a+i-l*(n+i))/2;let h=o[0],u=o[1];h[0]>u[0]&&(h=o[1],u=o[0]);const d=Math.atan((u[1]-h[1])/(u[0]-h[0]));for(let f=0;f<l;f++){const p=f*(n+i),m=p+n,g=[h[0]+p*Math.cos(d)+c*Math.cos(d),h[1]+p*Math.sin(d)+c*Math.sin(d)],y=[h[0]+m*Math.cos(d)+c*Math.cos(d),h[1]+m*Math.sin(d)+c*Math.sin(d)];s.push(...this.helper.doubleLineOps(g[0],g[1],y[0],y[1],r))}}),s}}class $Me{constructor(e){this.helper=e}fillPolygons(e,r){const n=r.hachureGap<0?4*r.strokeWidth:r.hachureGap,i=r.zigzagOffset<0?n:r.zigzagOffset,s=ty(e,r=Object.assign({},r,{hachureGap:n+i}));return{type:"fillSketch",ops:this.zigzagLines(s,i,r)}}zigzagLines(e,r,n){const i=[];return e.forEach(s=>{const o=C4(s),a=Math.round(o/(2*r));let l=s[0],c=s[1];l[0]>c[0]&&(l=s[1],c=s[0]);const h=Math.atan((c[1]-l[1])/(c[0]-l[0]));for(let u=0;u<a;u++){const d=2*u*r,f=2*(u+1)*r,p=Math.sqrt(2*Math.pow(r,2)),m=[l[0]+d*Math.cos(h),l[1]+d*Math.sin(h)],g=[l[0]+f*Math.cos(h),l[1]+f*Math.sin(h)],y=[m[0]+p*Math.cos(h+Math.PI/4),m[1]+p*Math.sin(h+Math.PI/4)];i.push(...this.helper.doubleLineOps(m[0],m[1],y[0],y[1],n),...this.helper.doubleLineOps(y[0],y[1],g[0],g[1],n))}}),i}}const mi={};class zMe{constructor(e){this.seed=e}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const HMe=0,Fk=1,oB=2,f2={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function $k(t,e){return t.type===e}function u_(t){const e=[],r=function(o){const a=new Array;for(;o!=="";)if(o.match(/^([ \t\r\n,]+)/))o=o.substr(RegExp.$1.length);else if(o.match(/^([aAcChHlLmMqQsStTvVzZ])/))a[a.length]={type:HMe,text:RegExp.$1},o=o.substr(RegExp.$1.length);else{if(!o.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];a[a.length]={type:Fk,text:`${parseFloat(RegExp.$1)}`},o=o.substr(RegExp.$1.length)}return a[a.length]={type:oB,text:""},a}(t);let n="BOD",i=0,s=r[i];for(;!$k(s,oB);){let o=0;const a=[];if(n==="BOD"){if(s.text!=="M"&&s.text!=="m")return u_("M0,0"+t);i++,o=f2[s.text],n=s.text}else $k(s,Fk)?o=f2[n]:(i++,o=f2[s.text],n=s.text);if(!(i+o<r.length))throw new Error("Path data ended short");for(let l=i;l<i+o;l++){const c=r[l];if(!$k(c,Fk))throw new Error("Param not a number: "+n+","+c.text);a[a.length]=+c.text}if(typeof f2[n]!="number")throw new Error("Bad segment: "+n);{const l={key:n,data:a};e.push(l),i+=o,s=r[i],n==="M"&&(n="L"),n==="m"&&(n="l")}}return e}function eY(t){let e=0,r=0,n=0,i=0;const s=[];for(const{key:o,data:a}of t)switch(o){case"M":s.push({key:"M",data:[...a]}),[e,r]=a,[n,i]=a;break;case"m":e+=a[0],r+=a[1],s.push({key:"M",data:[e,r]}),n=e,i=r;break;case"L":s.push({key:"L",data:[...a]}),[e,r]=a;break;case"l":e+=a[0],r+=a[1],s.push({key:"L",data:[e,r]});break;case"C":s.push({key:"C",data:[...a]}),e=a[4],r=a[5];break;case"c":{const l=a.map((c,h)=>h%2?c+r:c+e);s.push({key:"C",data:l}),e=l[4],r=l[5];break}case"Q":s.push({key:"Q",data:[...a]}),e=a[2],r=a[3];break;case"q":{const l=a.map((c,h)=>h%2?c+r:c+e);s.push({key:"Q",data:l}),e=l[2],r=l[3];break}case"A":s.push({key:"A",data:[...a]}),e=a[5],r=a[6];break;case"a":e+=a[5],r+=a[6],s.push({key:"A",data:[a[0],a[1],a[2],a[3],a[4],e,r]});break;case"H":s.push({key:"H",data:[...a]}),e=a[0];break;case"h":e+=a[0],s.push({key:"H",data:[e]});break;case"V":s.push({key:"V",data:[...a]}),r=a[0];break;case"v":r+=a[0],s.push({key:"V",data:[r]});break;case"S":s.push({key:"S",data:[...a]}),e=a[2],r=a[3];break;case"s":{const l=a.map((c,h)=>h%2?c+r:c+e);s.push({key:"S",data:l}),e=l[2],r=l[3];break}case"T":s.push({key:"T",data:[...a]}),e=a[0],r=a[1];break;case"t":e+=a[0],r+=a[1],s.push({key:"T",data:[e,r]});break;case"Z":case"z":s.push({key:"Z",data:[]}),e=n,r=i}return s}function tY(t){const e=[];let r="",n=0,i=0,s=0,o=0,a=0,l=0;for(const{key:c,data:h}of t){switch(c){case"M":e.push({key:"M",data:[...h]}),[n,i]=h,[s,o]=h;break;case"C":e.push({key:"C",data:[...h]}),n=h[4],i=h[5],a=h[2],l=h[3];break;case"L":e.push({key:"L",data:[...h]}),[n,i]=h;break;case"H":n=h[0],e.push({key:"L",data:[n,i]});break;case"V":i=h[0],e.push({key:"L",data:[n,i]});break;case"S":{let u=0,d=0;r==="C"||r==="S"?(u=n+(n-a),d=i+(i-l)):(u=n,d=i),e.push({key:"C",data:[u,d,...h]}),a=h[0],l=h[1],n=h[2],i=h[3];break}case"T":{const[u,d]=h;let f=0,p=0;r==="Q"||r==="T"?(f=n+(n-a),p=i+(i-l)):(f=n,p=i);const m=n+2*(f-n)/3,g=i+2*(p-i)/3,y=u+2*(f-u)/3,b=d+2*(p-d)/3;e.push({key:"C",data:[m,g,y,b,u,d]}),a=f,l=p,n=u,i=d;break}case"Q":{const[u,d,f,p]=h,m=n+2*(u-n)/3,g=i+2*(d-i)/3,y=f+2*(u-f)/3,b=p+2*(d-p)/3;e.push({key:"C",data:[m,g,y,b,f,p]}),a=u,l=d,n=f,i=p;break}case"A":{const u=Math.abs(h[0]),d=Math.abs(h[1]),f=h[2],p=h[3],m=h[4],g=h[5],y=h[6];u===0||d===0?(e.push({key:"C",data:[n,i,g,y,g,y]}),n=g,i=y):(n!==g||i!==y)&&(rY(n,i,g,y,u,d,f,p,m).forEach(function(b){e.push({key:"C",data:b})}),n=g,i=y);break}case"Z":e.push({key:"Z",data:[]}),n=s,i=o}r=c}return e}function ep(t,e,r){return[t*Math.cos(r)-e*Math.sin(r),t*Math.sin(r)+e*Math.cos(r)]}function rY(t,e,r,n,i,s,o,a,l,c){const h=(u=o,Math.PI*u/180);var u;let d=[],f=0,p=0,m=0,g=0;if(c)[f,p,m,g]=c;else{[t,e]=ep(t,e,-h),[r,n]=ep(r,n,-h);const K=(t-r)/2,z=(e-n)/2;let $=K*K/(i*i)+z*z/(s*s);$>1&&($=Math.sqrt($),i*=$,s*=$);const H=i*i,j=s*s,q=H*j-H*z*z-j*K*K,ne=H*z*z+j*K*K,O=(a===l?-1:1)*Math.sqrt(Math.abs(q/ne));m=O*i*z/s+(t+r)/2,g=O*-s*K/i+(e+n)/2,f=Math.asin(parseFloat(((e-g)/s).toFixed(9))),p=Math.asin(parseFloat(((n-g)/s).toFixed(9))),t<m&&(f=Math.PI-f),r<m&&(p=Math.PI-p),f<0&&(f=2*Math.PI+f),p<0&&(p=2*Math.PI+p),l&&f>p&&(f-=2*Math.PI),!l&&p>f&&(p-=2*Math.PI)}let y=p-f;if(Math.abs(y)>120*Math.PI/180){const K=p,z=r,$=n;p=l&&p>f?f+120*Math.PI/180*1:f+120*Math.PI/180*-1,d=rY(r=m+i*Math.cos(p),n=g+s*Math.sin(p),z,$,i,s,o,0,l,[p,K,m,g])}y=p-f;const b=Math.cos(f),x=Math.sin(f),S=Math.cos(p),k=Math.sin(p),w=Math.tan(y/4),_=4/3*i*w,L=4/3*s*w,B=[t,e],E=[t+_*x,e-L*b],D=[r+_*k,n-L*S],N=[r,n];if(E[0]=2*B[0]-E[0],E[1]=2*B[1]-E[1],c)return[E,D,N].concat(d);{d=[E,D,N].concat(d);const K=[];for(let z=0;z<d.length;z+=3){const $=ep(d[z][0],d[z][1],h),H=ep(d[z+1][0],d[z+1][1],h),j=ep(d[z+2][0],d[z+2][1],h);K.push([$[0],$[1],H[0],H[1],j[0],j[1]])}return K}}const qMe={randOffset:function(t,e){return pt(t,e)},randOffsetWithRange:function(t,e,r){return gv(t,e,r)},ellipse:function(t,e,r,n,i){const s=iY(r,n,i);return m6(t,e,i,s).opset},doubleLineOps:function(t,e,r,n,i){return _c(t,e,r,n,i,!0)}};function nY(t,e,r,n,i){return{type:"path",ops:_c(t,e,r,n,i)}}function Bb(t,e,r){const n=(t||[]).length;if(n>2){const i=[];for(let s=0;s<n-1;s++)i.push(..._c(t[s][0],t[s][1],t[s+1][0],t[s+1][1],r));return e&&i.push(..._c(t[n-1][0],t[n-1][1],t[0][0],t[0][1],r)),{type:"path",ops:i}}return n===2?nY(t[0][0],t[0][1],t[1][0],t[1][1],r):{type:"path",ops:[]}}function VMe(t,e,r,n,i){return function(s,o){return Bb(s,!0,o)}([[t,e],[t+r,e],[t+r,e+n],[t,e+n]],i)}function aB(t,e){if(t.length){const r=typeof t[0][0]=="number"?[t]:t,n=p2(r[0],1*(1+.2*e.roughness),e),i=e.disableMultiStroke?[]:p2(r[0],1.5*(1+.22*e.roughness),hB(e));for(let s=1;s<r.length;s++){const o=r[s];if(o.length){const a=p2(o,1*(1+.2*e.roughness),e),l=e.disableMultiStroke?[]:p2(o,1.5*(1+.22*e.roughness),hB(e));for(const c of a)c.op!=="move"&&n.push(c);for(const c of l)c.op!=="move"&&i.push(c)}}return{type:"path",ops:n.concat(i)}}return{type:"path",ops:[]}}function iY(t,e,r){const n=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(t/2,2)+Math.pow(e/2,2))/2)),i=Math.ceil(Math.max(r.curveStepCount,r.curveStepCount/Math.sqrt(200)*n)),s=2*Math.PI/i;let o=Math.abs(t/2),a=Math.abs(e/2);const l=1-r.curveFitting;return o+=pt(o*l,r),a+=pt(a*l,r),{increment:s,rx:o,ry:a}}function m6(t,e,r,n){const[i,s]=uB(n.increment,t,e,n.rx,n.ry,1,n.increment*gv(.1,gv(.4,1,r),r),r);let o=yv(i,null,r);if(!r.disableMultiStroke&&r.roughness!==0){const[a]=uB(n.increment,t,e,n.rx,n.ry,1.5,0,r),l=yv(a,null,r);o=o.concat(l)}return{estimatedPoints:s,opset:{type:"path",ops:o}}}function lB(t,e,r,n,i,s,o,a,l){const c=t,h=e;let u=Math.abs(r/2),d=Math.abs(n/2);u+=pt(.01*u,l),d+=pt(.01*d,l);let f=i,p=s;for(;f<0;)f+=2*Math.PI,p+=2*Math.PI;p-f>2*Math.PI&&(f=0,p=2*Math.PI);const m=2*Math.PI/l.curveStepCount,g=Math.min(m/2,(p-f)/2),y=dB(g,c,h,u,d,f,p,1,l);if(!l.disableMultiStroke){const b=dB(g,c,h,u,d,f,p,1.5,l);y.push(...b)}return o&&(a?y.push(..._c(c,h,c+u*Math.cos(f),h+d*Math.sin(f),l),..._c(c,h,c+u*Math.cos(p),h+d*Math.sin(p),l)):y.push({op:"lineTo",data:[c,h]},{op:"lineTo",data:[c+u*Math.cos(f),h+d*Math.sin(f)]})),{type:"path",ops:y}}function cB(t,e){const r=tY(eY(u_(t))),n=[];let i=[0,0],s=[0,0];for(const{key:o,data:a}of r)switch(o){case"M":s=[a[0],a[1]],i=[a[0],a[1]];break;case"L":n.push(..._c(s[0],s[1],a[0],a[1],e)),s=[a[0],a[1]];break;case"C":{const[l,c,h,u,d,f]=a;n.push(...WMe(l,c,h,u,d,f,s,e)),s=[d,f];break}case"Z":n.push(..._c(s[0],s[1],i[0],i[1],e)),s=[i[0],i[1]]}return{type:"path",ops:n}}function zk(t,e){const r=[];for(const n of t)if(n.length){const i=e.maxRandomnessOffset||0,s=n.length;if(s>2){r.push({op:"move",data:[n[0][0]+pt(i,e),n[0][1]+pt(i,e)]});for(let o=1;o<s;o++)r.push({op:"lineTo",data:[n[o][0]+pt(i,e),n[o][1]+pt(i,e)]})}}return{type:"fillPath",ops:r}}function Gu(t,e){return function(r,n){let i=r.fillStyle||"hachure";if(!mi[i])switch(i){case"zigzag":mi[i]||(mi[i]=new RMe(n));break;case"cross-hatch":mi[i]||(mi[i]=new PMe(n));break;case"dots":mi[i]||(mi[i]=new NMe(n));break;case"dashed":mi[i]||(mi[i]=new FMe(n));break;case"zigzag-line":mi[i]||(mi[i]=new $Me(n));break;default:i="hachure",mi[i]||(mi[i]=new h_(n))}return mi[i]}(e,qMe).fillPolygons(t,e)}function hB(t){const e=Object.assign({},t);return e.randomizer=void 0,t.seed&&(e.seed=t.seed+1),e}function sY(t){return t.randomizer||(t.randomizer=new zMe(t.seed||0)),t.randomizer.next()}function gv(t,e,r,n=1){return r.roughness*n*(sY(r)*(e-t)+t)}function pt(t,e,r=1){return gv(-t,t,e,r)}function _c(t,e,r,n,i,s=!1){const o=s?i.disableMultiStrokeFill:i.disableMultiStroke,a=g6(t,e,r,n,i,!0,!1);if(o)return a;const l=g6(t,e,r,n,i,!0,!0);return a.concat(l)}function g6(t,e,r,n,i,s,o){const a=Math.pow(t-r,2)+Math.pow(e-n,2),l=Math.sqrt(a);let c=1;c=l<200?1:l>500?.4:-.0016668*l+1.233334;let h=i.maxRandomnessOffset||0;h*h*100>a&&(h=l/10);const u=h/2,d=.2+.2*sY(i);let f=i.bowing*i.maxRandomnessOffset*(n-e)/200,p=i.bowing*i.maxRandomnessOffset*(t-r)/200;f=pt(f,i,c),p=pt(p,i,c);const m=[],g=()=>pt(u,i,c),y=()=>pt(h,i,c),b=i.preserveVertices;return o?m.push({op:"move",data:[t+(b?0:g()),e+(b?0:g())]}):m.push({op:"move",data:[t+(b?0:pt(h,i,c)),e+(b?0:pt(h,i,c))]}),o?m.push({op:"bcurveTo",data:[f+t+(r-t)*d+g(),p+e+(n-e)*d+g(),f+t+2*(r-t)*d+g(),p+e+2*(n-e)*d+g(),r+(b?0:g()),n+(b?0:g())]}):m.push({op:"bcurveTo",data:[f+t+(r-t)*d+y(),p+e+(n-e)*d+y(),f+t+2*(r-t)*d+y(),p+e+2*(n-e)*d+y(),r+(b?0:y()),n+(b?0:y())]}),m}function p2(t,e,r){if(!t.length)return[];const n=[];n.push([t[0][0]+pt(e,r),t[0][1]+pt(e,r)]),n.push([t[0][0]+pt(e,r),t[0][1]+pt(e,r)]);for(let i=1;i<t.length;i++)n.push([t[i][0]+pt(e,r),t[i][1]+pt(e,r)]),i===t.length-1&&n.push([t[i][0]+pt(e,r),t[i][1]+pt(e,r)]);return yv(n,null,r)}function yv(t,e,r){const n=t.length,i=[];if(n>3){const s=[],o=1-r.curveTightness;i.push({op:"move",data:[t[1][0],t[1][1]]});for(let a=1;a+2<n;a++){const l=t[a];s[0]=[l[0],l[1]],s[1]=[l[0]+(o*t[a+1][0]-o*t[a-1][0])/6,l[1]+(o*t[a+1][1]-o*t[a-1][1])/6],s[2]=[t[a+1][0]+(o*t[a][0]-o*t[a+2][0])/6,t[a+1][1]+(o*t[a][1]-o*t[a+2][1])/6],s[3]=[t[a+1][0],t[a+1][1]],i.push({op:"bcurveTo",data:[s[1][0],s[1][1],s[2][0],s[2][1],s[3][0],s[3][1]]})}}else n===3?(i.push({op:"move",data:[t[1][0],t[1][1]]}),i.push({op:"bcurveTo",data:[t[1][0],t[1][1],t[2][0],t[2][1],t[2][0],t[2][1]]})):n===2&&i.push(...g6(t[0][0],t[0][1],t[1][0],t[1][1],r,!0,!0));return i}function uB(t,e,r,n,i,s,o,a){const l=[],c=[];if(a.roughness===0){t/=4,c.push([e+n*Math.cos(-t),r+i*Math.sin(-t)]);for(let h=0;h<=2*Math.PI;h+=t){const u=[e+n*Math.cos(h),r+i*Math.sin(h)];l.push(u),c.push(u)}c.push([e+n*Math.cos(0),r+i*Math.sin(0)]),c.push([e+n*Math.cos(t),r+i*Math.sin(t)])}else{const h=pt(.5,a)-Math.PI/2;c.push([pt(s,a)+e+.9*n*Math.cos(h-t),pt(s,a)+r+.9*i*Math.sin(h-t)]);const u=2*Math.PI+h-.01;for(let d=h;d<u;d+=t){const f=[pt(s,a)+e+n*Math.cos(d),pt(s,a)+r+i*Math.sin(d)];l.push(f),c.push(f)}c.push([pt(s,a)+e+n*Math.cos(h+2*Math.PI+.5*o),pt(s,a)+r+i*Math.sin(h+2*Math.PI+.5*o)]),c.push([pt(s,a)+e+.98*n*Math.cos(h+o),pt(s,a)+r+.98*i*Math.sin(h+o)]),c.push([pt(s,a)+e+.9*n*Math.cos(h+.5*o),pt(s,a)+r+.9*i*Math.sin(h+.5*o)])}return[c,l]}function dB(t,e,r,n,i,s,o,a,l){const c=s+pt(.1,l),h=[];h.push([pt(a,l)+e+.9*n*Math.cos(c-t),pt(a,l)+r+.9*i*Math.sin(c-t)]);for(let u=c;u<=o;u+=t)h.push([pt(a,l)+e+n*Math.cos(u),pt(a,l)+r+i*Math.sin(u)]);return h.push([e+n*Math.cos(o),r+i*Math.sin(o)]),h.push([e+n*Math.cos(o),r+i*Math.sin(o)]),yv(h,null,l)}function WMe(t,e,r,n,i,s,o,a){const l=[],c=[a.maxRandomnessOffset||1,(a.maxRandomnessOffset||1)+.3];let h=[0,0];const u=a.disableMultiStroke?1:2,d=a.preserveVertices;for(let f=0;f<u;f++)f===0?l.push({op:"move",data:[o[0],o[1]]}):l.push({op:"move",data:[o[0]+(d?0:pt(c[0],a)),o[1]+(d?0:pt(c[0],a))]}),h=d?[i,s]:[i+pt(c[f],a),s+pt(c[f],a)],l.push({op:"bcurveTo",data:[t+pt(c[f],a),e+pt(c[f],a),r+pt(c[f],a),n+pt(c[f],a),h[0],h[1]]});return l}function tp(t){return[...t]}function fB(t,e=0){const r=t.length;if(r<3)throw new Error("A curve must have at least three points.");const n=[];if(r===3)n.push(tp(t[0]),tp(t[1]),tp(t[2]),tp(t[2]));else{const i=[];i.push(t[0],t[0]);for(let a=1;a<t.length;a++)i.push(t[a]),a===t.length-1&&i.push(t[a]);const s=[],o=1-e;n.push(tp(i[0]));for(let a=1;a+2<i.length;a++){const l=i[a];s[0]=[l[0],l[1]],s[1]=[l[0]+(o*i[a+1][0]-o*i[a-1][0])/6,l[1]+(o*i[a+1][1]-o*i[a-1][1])/6],s[2]=[i[a+1][0]+(o*i[a][0]-o*i[a+2][0])/6,i[a+1][1]+(o*i[a][1]-o*i[a+2][1])/6],s[3]=[i[a+1][0],i[a+1][1]],n.push(s[1],s[2],s[3])}}return n}function Rb(t,e){return Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)}function jMe(t,e,r){const n=Rb(e,r);if(n===0)return Rb(t,e);let i=((t[0]-e[0])*(r[0]-e[0])+(t[1]-e[1])*(r[1]-e[1]))/n;return i=Math.max(0,Math.min(1,i)),Rb(t,lh(e,r,i))}function lh(t,e,r){return[t[0]+(e[0]-t[0])*r,t[1]+(e[1]-t[1])*r]}function y6(t,e,r,n){const i=n||[];if(function(a,l){const c=a[l+0],h=a[l+1],u=a[l+2],d=a[l+3];let f=3*h[0]-2*c[0]-d[0];f*=f;let p=3*h[1]-2*c[1]-d[1];p*=p;let m=3*u[0]-2*d[0]-c[0];m*=m;let g=3*u[1]-2*d[1]-c[1];return g*=g,f<m&&(f=m),p<g&&(p=g),f+p}(t,e)<r){const a=t[e+0];i.length?(s=i[i.length-1],o=a,Math.sqrt(Rb(s,o))>1&&i.push(a)):i.push(a),i.push(t[e+3])}else{const l=t[e+0],c=t[e+1],h=t[e+2],u=t[e+3],d=lh(l,c,.5),f=lh(c,h,.5),p=lh(h,u,.5),m=lh(d,f,.5),g=lh(f,p,.5),y=lh(m,g,.5);y6([l,d,m,y],0,r,i),y6([y,g,p,u],0,r,i)}var s,o;return i}function UMe(t,e){return bv(t,0,t.length,e)}function bv(t,e,r,n,i){const s=i||[],o=t[e],a=t[r-1];let l=0,c=1;for(let h=e+1;h<r-1;++h){const u=jMe(t[h],o,a);u>l&&(l=u,c=h)}return Math.sqrt(l)>n?(bv(t,e,c+1,n,s),bv(t,c,r,n,s)):(s.length||s.push(o),s.push(a)),s}function Hk(t,e=.15,r){const n=[],i=(t.length-1)/3;for(let s=0;s<i;s++)y6(t,3*s,e,n);return r&&r>0?bv(n,0,n.length,r):n}const ji="none";class xv{constructor(e){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=e||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}_d(e,r,n){return{shape:e,sets:r||[],options:n||this.defaultOptions}}line(e,r,n,i,s){const o=this._o(s);return this._d("line",[nY(e,r,n,i,o)],o)}rectangle(e,r,n,i,s){const o=this._o(s),a=[],l=VMe(e,r,n,i,o);if(o.fill){const c=[[e,r],[e+n,r],[e+n,r+i],[e,r+i]];o.fillStyle==="solid"?a.push(zk([c],o)):a.push(Gu([c],o))}return o.stroke!==ji&&a.push(l),this._d("rectangle",a,o)}ellipse(e,r,n,i,s){const o=this._o(s),a=[],l=iY(n,i,o),c=m6(e,r,o,l);if(o.fill)if(o.fillStyle==="solid"){const h=m6(e,r,o,l).opset;h.type="fillPath",a.push(h)}else a.push(Gu([c.estimatedPoints],o));return o.stroke!==ji&&a.push(c.opset),this._d("ellipse",a,o)}circle(e,r,n,i){const s=this.ellipse(e,r,n,n,i);return s.shape="circle",s}linearPath(e,r){const n=this._o(r);return this._d("linearPath",[Bb(e,!1,n)],n)}arc(e,r,n,i,s,o,a=!1,l){const c=this._o(l),h=[],u=lB(e,r,n,i,s,o,a,!0,c);if(a&&c.fill)if(c.fillStyle==="solid"){const d=Object.assign({},c);d.disableMultiStroke=!0;const f=lB(e,r,n,i,s,o,!0,!1,d);f.type="fillPath",h.push(f)}else h.push(function(d,f,p,m,g,y,b){const x=d,S=f;let k=Math.abs(p/2),w=Math.abs(m/2);k+=pt(.01*k,b),w+=pt(.01*w,b);let _=g,L=y;for(;_<0;)_+=2*Math.PI,L+=2*Math.PI;L-_>2*Math.PI&&(_=0,L=2*Math.PI);const B=(L-_)/b.curveStepCount,E=[];for(let D=_;D<=L;D+=B)E.push([x+k*Math.cos(D),S+w*Math.sin(D)]);return E.push([x+k*Math.cos(L),S+w*Math.sin(L)]),E.push([x,S]),Gu([E],b)}(e,r,n,i,s,o,c));return c.stroke!==ji&&h.push(u),this._d("arc",h,c)}curve(e,r){const n=this._o(r),i=[],s=aB(e,n);if(n.fill&&n.fill!==ji)if(n.fillStyle==="solid"){const o=aB(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(o.ops)})}else{const o=[],a=e;if(a.length){const l=typeof a[0][0]=="number"?[a]:a;for(const c of l)c.length<3?o.push(...c):c.length===3?o.push(...Hk(fB([c[0],c[0],c[1],c[2]]),10,(1+n.roughness)/2)):o.push(...Hk(fB(c),10,(1+n.roughness)/2))}o.length&&i.push(Gu([o],n))}return n.stroke!==ji&&i.push(s),this._d("curve",i,n)}polygon(e,r){const n=this._o(r),i=[],s=Bb(e,!0,n);return n.fill&&(n.fillStyle==="solid"?i.push(zk([e],n)):i.push(Gu([e],n))),n.stroke!==ji&&i.push(s),this._d("polygon",i,n)}path(e,r){const n=this._o(r),i=[];if(!e)return this._d("path",i,n);e=(e||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const s=n.fill&&n.fill!=="transparent"&&n.fill!==ji,o=n.stroke!==ji,a=!!(n.simplification&&n.simplification<1),l=function(h,u,d){const f=tY(eY(u_(h))),p=[];let m=[],g=[0,0],y=[];const b=()=>{y.length>=4&&m.push(...Hk(y,u)),y=[]},x=()=>{b(),m.length&&(p.push(m),m=[])};for(const{key:k,data:w}of f)switch(k){case"M":x(),g=[w[0],w[1]],m.push(g);break;case"L":b(),m.push([w[0],w[1]]);break;case"C":if(!y.length){const _=m.length?m[m.length-1]:g;y.push([_[0],_[1]])}y.push([w[0],w[1]]),y.push([w[2],w[3]]),y.push([w[4],w[5]]);break;case"Z":b(),m.push([g[0],g[1]])}if(x(),!d)return p;const S=[];for(const k of p){const w=UMe(k,d);w.length&&S.push(w)}return S}
vendor: 6,101 bytes, line 1343
1343(e,1,a?4-4*(n.simplification||1):(1+n.roughness)/2),c=cB(e,n);if(s)if(n.fillStyle==="solid")if(l.length===1){const h=cB(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(h.ops)})}else i.push(zk(l,n));else i.push(Gu(l,n));return o&&(a?l.forEach(h=>{i.push(Bb(h,!1,n))}):i.push(c)),this._d("path",i,n)}opsToPath(e,r){let n="";for(const i of e.ops){const s=typeof r=="number"&&r>=0?i.data.map(o=>+o.toFixed(r)):i.data;switch(i.op){case"move":n+=`M${s[0]} ${s[1]} `;break;case"bcurveTo":n+=`C${s[0]} ${s[1]}, ${s[2]} ${s[3]}, ${s[4]} ${s[5]} `;break;case"lineTo":n+=`L${s[0]} ${s[1]} `}}return n.trim()}toPaths(e){const r=e.sets||[],n=e.options||this.defaultOptions,i=[];for(const s of r){let o=null;switch(s.type){case"path":o={d:this.opsToPath(s),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:ji};break;case"fillPath":o={d:this.opsToPath(s),stroke:ji,strokeWidth:0,fill:n.fill||ji};break;case"fillSketch":o=this.fillSketch(s,n)}o&&i.push(o)}return i}fillSketch(e,r){let n=r.fillWeight;return n<0&&(n=r.strokeWidth/2),{d:this.opsToPath(e),stroke:r.fill||ji,strokeWidth:n,fill:ji}}_mergedShape(e){return e.filter((r,n)=>n===0||r.op!=="move")}}class GMe{constructor(e,r){this.canvas=e,this.ctx=this.canvas.getContext("2d"),this.gen=new xv(r)}draw(e){const r=e.sets||[],n=e.options||this.getDefaultOptions(),i=this.ctx,s=e.options.fixedDecimalPlaceDigits;for(const o of r)switch(o.type){case"path":i.save(),i.strokeStyle=n.stroke==="none"?"transparent":n.stroke,i.lineWidth=n.strokeWidth,n.strokeLineDash&&i.setLineDash(n.strokeLineDash),n.strokeLineDashOffset&&(i.lineDashOffset=n.strokeLineDashOffset),this._drawToContext(i,o,s),i.restore();break;case"fillPath":{i.save(),i.fillStyle=n.fill||"";const a=e.shape==="curve"||e.shape==="polygon"||e.shape==="path"?"evenodd":"nonzero";this._drawToContext(i,o,s,a),i.restore();break}case"fillSketch":this.fillSketch(i,o,n)}}fillSketch(e,r,n){let i=n.fillWeight;i<0&&(i=n.strokeWidth/2),e.save(),n.fillLineDash&&e.setLineDash(n.fillLineDash),n.fillLineDashOffset&&(e.lineDashOffset=n.fillLineDashOffset),e.strokeStyle=n.fill||"",e.lineWidth=i,this._drawToContext(e,r,n.fixedDecimalPlaceDigits),e.restore()}_drawToContext(e,r,n,i="nonzero"){e.beginPath();for(const s of r.ops){const o=typeof n=="number"&&n>=0?s.data.map(a=>+a.toFixed(n)):s.data;switch(s.op){case"move":e.moveTo(o[0],o[1]);break;case"bcurveTo":e.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5]);break;case"lineTo":e.lineTo(o[0],o[1])}}r.type==="fillPath"?e.fill(i):e.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(e,r,n,i,s){const o=this.gen.line(e,r,n,i,s);return this.draw(o),o}rectangle(e,r,n,i,s){const o=this.gen.rectangle(e,r,n,i,s);return this.draw(o),o}ellipse(e,r,n,i,s){const o=this.gen.ellipse(e,r,n,i,s);return this.draw(o),o}circle(e,r,n,i){const s=this.gen.circle(e,r,n,i);return this.draw(s),s}linearPath(e,r){const n=this.gen.linearPath(e,r);return this.draw(n),n}polygon(e,r){const n=this.gen.polygon(e,r);return this.draw(n),n}arc(e,r,n,i,s,o,a=!1,l){const c=this.gen.arc(e,r,n,i,s,o,a,l);return this.draw(c),c}curve(e,r){const n=this.gen.curve(e,r);return this.draw(n),n}path(e,r){const n=this.gen.path(e,r);return this.draw(n),n}}const m2="http://www.w3.org/2000/svg";class KMe{constructor(e,r){this.svg=e,this.gen=new xv(r)}draw(e){const r=e.sets||[],n=e.options||this.getDefaultOptions(),i=this.svg.ownerDocument||window.document,s=i.createElementNS(m2,"g"),o=e.options.fixedDecimalPlaceDigits;for(const a of r){let l=null;switch(a.type){case"path":l=i.createElementNS(m2,"path"),l.setAttribute("d",this.opsToPath(a,o)),l.setAttribute("stroke",n.stroke),l.setAttribute("stroke-width",n.strokeWidth+""),l.setAttribute("fill","none"),n.strokeLineDash&&l.setAttribute("stroke-dasharray",n.strokeLineDash.join(" ").trim()),n.strokeLineDashOffset&&l.setAttribute("stroke-dashoffset",`${n.strokeLineDashOffset}`);break;case"fillPath":l=i.createElementNS(m2,"path"),l.setAttribute("d",this.opsToPath(a,o)),l.setAttribute("stroke","none"),l.setAttribute("stroke-width","0"),l.setAttribute("fill",n.fill||""),e.shape!=="curve"&&e.shape!=="polygon"||l.setAttribute("fill-rule","evenodd");break;case"fillSketch":l=this.fillSketch(i,a,n)}l&&s.appendChild(l)}return s}fillSketch(e,r,n){let i=n.fillWeight;i<0&&(i=n.strokeWidth/2);const s=e.createElementNS(m2,"path");return s.setAttribute("d",this.opsToPath(r,n.fixedDecimalPlaceDigits)),s.setAttribute("stroke",n.fill||""),s.setAttribute("stroke-width",i+""),s.setAttribute("fill","none"),n.fillLineDash&&s.setAttribute("stroke-dasharray",n.fillLineDash.join(" ").trim()),n.fillLineDashOffset&&s.setAttribute("stroke-dashoffset",`${n.fillLineDashOffset}`),s}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(e,r){return this.gen.opsToPath(e,r)}line(e,r,n,i,s){const o=this.gen.line(e,r,n,i,s);return this.draw(o)}rectangle(e,r,n,i,s){const o=this.gen.rectangle(e,r,n,i,s);return this.draw(o)}ellipse(e,r,n,i,s){const o=this.gen.ellipse(e,r,n,i,s);return this.draw(o)}circle(e,r,n,i){const s=this.gen.circle(e,r,n,i);return this.draw(s)}linearPath(e,r){const n=this.gen.linearPath(e,r);return this.draw(n)}polygon(e,r){const n=this.gen.polygon(e,r);return this.draw(n)}arc(e,r,n,i,s,o,a=!1,l){const c=this.gen.arc(e,r,n,i,s,o,a,l);return this.draw(c)}curve(e,r){const n=this.gen.curve(e,r);return this.draw(n)}path(e,r){const n=this.gen.path(e,r);return this.draw(n)}}var je={canvas:(t,e)=>new GMe(t,e),svg:(t,e)=>new KMe(t,e),generator:t=>new xv(t),newSeed:()=>xv.newSeed()},dt=C(async(t,e,r)=>{var u,d;let n;const i=e.useHtmlLabels||rn((u=Zt())==null?void 0:u.htmlLabels);r?n=r:n="node default";const s=t.insert("g").attr("class",n).attr("id",e.domId||e.id),o=s.insert("g").attr("class","label").attr("style",Vn(e.labelStyle));let a;e.label===void 0?a="":a=typeof e.label=="string"?e.label:e.label[0];const l=await Fc(o,Rs(Ru(a),Zt()),{useHtmlLabels:i,width:e.width||((d=Zt().flowchart)==null?void 0:d.wrappingWidth),cssClasse
vendor: 10,914 bytes, lines 1343-1344
1343s:"markdown-node-label",style:e.labelStyle,addSvgBackground:!!e.icon||!!e.img});let c=l.getBBox();const h=((e==null?void 0:e.padding)??0)/2;if(i){const f=l.children[0],p=$t(l),m=f.getElementsByTagName("img");if(m){const g=a.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...m].map(y=>new Promise(b=>{function x(){if(y.style.display="flex",y.style.flexDirection="column",g){const S=Zt().fontSize?Zt().fontSize:window.getComputedStyle(document.body).fontSize,k=5,[w=Lj.fontSize]=b4(S),_=w*k+"px";y.style.minWidth=_,y.style.maxWidth=_}else y.style.width="100%";b(y)}C(x,"setupImage"),setTimeout(()=>{y.complete&&x()}),y.addEventListener("error",x),y.addEventListener("load",x)})))}c=f.getBoundingClientRect(),p.attr("width",c.width),p.attr("height",c.height)}return i?o.attr("transform","translate("+-c.width/2+", "+-c.height/2+")"):o.attr("transform","translate(0, "+-c.height/2+")"),e.centerLabel&&o.attr("transform","translate("+-c.width/2+", "+-c.height/2+")"),o.insert("rect",":first-child"),{shapeSvg:s,bbox:c,halfPadding:h,label:o}},"labelHelper"),qk=C(async(t,e,r)=>{var l,c,h,u,d,f;const n=r.useHtmlLabels||rn((c=(l=Zt())==null?void 0:l.flowchart)==null?void 0:c.htmlLabels),i=t.insert("g").attr("class","label").attr("style",r.labelStyle||""),s=await Fc(i,Rs(Ru(e),Zt()),{useHtmlLabels:n,width:r.width||((u=(h=Zt())==null?void 0:h.flowchart)==null?void 0:u.wrappingWidth),style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img});let o=s.getBBox();const a=r.padding/2;if(rn((f=(d=Zt())==null?void 0:d.flowchart)==null?void 0:f.htmlLabels)){const p=s.children[0],m=$t(s);o=p.getBoundingClientRect(),m.attr("width",o.width),m.attr("height",o.height)}return n?i.attr("transform","translate("+-o.width/2+", "+-o.height/2+")"):i.attr("transform","translate(0, "+-o.height/2+")"),r.centerLabel&&i.attr("transform","translate("+-o.width/2+", "+-o.height/2+")"),i.insert("rect",":first-child"),{shapeSvg:t,bbox:o,halfPadding:a,label:i}},"insertLabel"),Xe=C((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds"),ct=C((t,e)=>(t.look==="handDrawn"?"rough-node":"node")+" "+t.cssClasses+" "+(e||""),"getNodeClasses");function Bt(t){const e=t.map((r,n)=>`${n===0?"M":"L"}${r.x},${r.y}`);return e.push("Z"),e.join(" ")}C(Bt,"createPathFromPoints");function Mc(t,e,r,n,i,s){const o=[],l=r-t,c=n-e,h=l/s,u=2*Math.PI/h,d=e+c/2;for(let f=0;f<=50;f++){const p=f/50,m=t+p*l,g=d+i*Math.sin(u*(m-t));o.push({x:m,y:g})}return o}C(Mc,"generateFullSineWavePoints");function Ng(t,e,r,n,i,s){const o=[],a=i*Math.PI/180,h=(s*Math.PI/180-a)/(n-1);for(let u=0;u<n;u++){const d=a+u*h,f=t+r*Math.cos(d),p=e+r*Math.sin(d);o.push({x:-f,y:-p})}return o}C(Ng,"generateCirclePoints");var YMe=C((t,e)=>{var r=t.x,n=t.y,i=e.x-r,s=e.y-n,o=t.width/2,a=t.height/2,l,c;return Math.abs(s)*o>Math.abs(i)*a?(s<0&&(a=-a),l=s===0?0:a*i/s,c=a):(i<0&&(o=-o),l=o,c=i===0?0:o*s/i),{x:r+l,y:n+c}},"intersectRect"),p0=YMe;function oY(t,e){e&&t.attr("style",e)}C(oY,"applyStyle");async function aY(t){const e=$t(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),r=e.append("xhtml:div"),n=Zt();let i=t.label;t.label&&Nf(t.label)&&(i=await wT(t.label.replace(d0.lineBreakRegex,`
1344`),n));const o='<span class="'+(t.isNode?"nodeLabel":"edgeLabel")+'" '+(t.labelStyle?'style="'+t.labelStyle+'"':"")+">"+i+"</span>";return r.html(Rs(o,n)),oY(r,t.labelStyle),r.style("display","inline-block"),r.style("padding-right","1px"),r.style("white-space","nowrap"),r.attr("xmlns","http://www.w3.org/1999/xhtml"),e.node()}C(aY,"addHtmlLabel");var XMe=C(async(t,e,r,n)=>{let i=t||"";if(typeof i=="object"&&(i=i[0]),rn(Zt().flowchart.htmlLabels)){i=i.replace(/\\n|\n/g,"<br />"),de.info("vertexText"+i);const s={isNode:n,label:Ru(i).replace(/fa[blrs]?:fa-[\w-]+/g,a=>`<i class='${a.replace(":"," ")}'></i>`),labelStyle:e&&e.replace("fill:","color:")};return await aY(s)}else{const s=document.createElementNS("http://www.w3.org/2000/svg","text");s.setAttribute("style",e.replace("color:","fill:"));let o=[];typeof i=="string"?o=i.split(/\\n|\n|<br\s*\/?>/gi):Array.isArray(i)?o=i:o=[];for(const a of o){const l=document.createElementNS("http://www.w3.org/2000/svg","tspan");l.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),l.setAttribute("dy","1em"),l.setAttribute("x","0"),r?l.setAttribute("class","title-row"):l.setAttribute("class","row"),l.textContent=a.trim(),s.appendChild(l)}return s}},"createLabel"),Sh=XMe,$c=C((t,e,r,n,i)=>["M",t+i,e,"H",t+r-i,"A",i,i,0,0,1,t+r,e+i,"V",e+n-i,"A",i,i,0,0,1,t+r-i,e+n,"H",t+i,"A",i,i,0,0,1,t,e+n-i,"V",e+i,"A",i,i,0,0,1,t+i,e,"Z"].join(" "),"createRoundedRectPathD"),lY=C(async(t,e)=>{de.info("Creating subgraph rect for ",e.id,e);const r=Zt(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:s,clusterBorder:o}=n,{labelStyles:a,nodeStyles:l,borderStyles:c,backgroundStyles:h}=Ke(e),u=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.id).attr("data-look",e.look),d=rn(r.flowchart.htmlLabels),f=u.insert("g").attr("class","cluster-label "),p=await Fc(f,e.label,{style:e.labelStyle,useHtmlLabels:d,isNode:!0});let m=p.getBBox();if(rn(r.flowchart.htmlLabels)){const _=p.children[0],L=$t(p);m=_.getBoundingClientRect(),L.attr("width",m.width),L.attr("height",m.height)}const g=e.width<=m.width+e.padding?m.width+e.padding:e.width;e.width<=m.width+e.padding?e.diff=(g-e.width)/2-e.padding:e.diff=-e.padding;const y=e.height,b=e.x-g/2,x=e.y-y/2;de.trace("Data ",e,JSON.stringify(e));let S;if(e.look==="handDrawn"){const _=je.svg(u),L=Ge(e,{roughness:.7,fill:s,stroke:o,fillWeight:3,seed:i}),B=_.path($c(b,x,g,y,0),L);S=u.insert(()=>(de.debug("Rough node insert CXC",B),B),":first-child"),S.select("path:nth-child(2)").attr("style",c.join(";")),S.select("path").attr("style",h.join(";").replace("fill","stroke"))}else S=u.insert("rect",":first-child"),S.attr("style",l).attr("rx",e.rx).attr("ry",e.ry).attr("x",b).attr("y",x).attr("width",g).attr("height",y);const{subGraphTitleTopMargin:k}=UT(r);if(f.attr("transform",`translate(${e.x-m.width/2}, ${e.y-e.height/2+k})`),a){const _=f.select("span");_&&_.attr("style",a)}const w=S.node().getBBox();return e.offsetX=0,e.width=w.width,e.height=w.height,e.offsetY=m.height-e.padding/2,e.intersect=function(_){return p0(e,_)},{cluster:u,labelBBox:m}},"rect"),JMe=C((t,e)=>{const r=t.insert("g").attr("class","note-cluster").attr("id",e.id),n=r.insert("rect",":first-child"),i=0*e.padding,s=i/2;n.attr("rx",e.rx).attr("ry",e.ry).attr("x",e.x-e.width/2-s).attr("y",e.y-e.height/2-s).attr("width",e.width+i).attr("height",e.height+i).attr("fill","none");const o=n.node().getBBox();return e.width=o.width,e.height=o.height,e.intersect=function(a){return p0(e,a)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),ZMe=C(async(t,e)=>{const r=Zt(),{themeVariables:n,handDrawnSeed:i}=r,{altBackground:s,compositeBackground:o,compositeTitleBackground:a,nodeBorder:l}=n,c=t.insert("g").attr("class",e.cssClasses).attr("id",e.id).attr("data-id",e.id).attr("data-look",e.look),h=c.insert("g",":first-child"),u=c.insert("g").attr("class","cluster-label");let d=c.append("rect");const f=u.node().appendChild(await Sh(e.label,e.labelStyle,void 0,!0));let p=f.getBBox();if(rn(r.flowchart.htmlLabels)){const B=f.children[0],E=$t(f);p=B.getBoundingClientRect(),E.attr("width",p.width),E.attr("height",p.height)}const m=0*e.padding,g=m/2,y=(e.width<=p.width+e.padding?p.width+e.padding:e.width)+m;e.width<=p.width+e.padding?e.diff=(y-e.width)/2-e.padding:e.diff=-e.padding;const b=e.height+m,x=e.height+m-p.height-6,S=e.x-y/2,k=e.y-b/2;e.width=y;const w=e.y-e.height/2-g+p.height+2;let _;if(e.look==="handDrawn"){const B=e.cssClasses.includes("statediagram-cluster-alt"),E=je.svg(c),D=e.rx||e.ry?E.path($c(S,k,y,b,10),{roughness:.7,fill:a,fillStyle:"solid",stroke:l,seed:i}):E.rectangle(S,k,y,b,{seed:i});_=c.insert(()=>D,":first-child");const N=E.rectangle(S,w,y,x,{fill:B?s:o,fillStyle:B?"hachure":"solid",stroke:l,seed:i});_=c.insert(()=>D,":first-child"),d=c.insert(()=>N)}else _=h.insert("rect",":first-child"),_.attr("class","outer").attr("x",S).attr("y",k).attr("width",y).attr("height",b).attr("data-look",e.look),d.attr("class","inner").attr("x",S).attr("y",w).attr("width",y).attr("height",x);u.attr("transform",`translate(${e.x-p.width/2}, ${k+1-(rn(r.flowchart.htmlLabels)?0:3)})`);const L=_.node().getBBox();return e.height=L.height,e.offsetX=0,e.offsetY=p.height-e.padding/2,e.labelBBox=p,e.intersect=function(B){return p0(e,B)},{cluster:c,labelBBox:p}},"roundedWithTitle"),QMe=C(async(t,e)=>{de.info("Creating subgraph rect for ",e.id,e);const r=Zt(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:s,clusterBorder:o}=n,{labelStyles:a,nodeStyles:l,borderStyles:c,backgroundStyles:h}=Ke(e),u=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.id).attr("data-look",e.look),d=rn(r.flowchart.htmlLabels),f=u.insert("g").attr("class","cluster-label "),p=await Fc(f,e.label,{style:e.labelStyle,useHtmlLabels:d,isNode:!0,width:e.width});let m=p.getBBox();if(rn(r.flowchart.htmlLabels)){const _=p.children[0],L=$t(p);m=_.getBoundingClientRect(),L.attr("width",m.width),L.attr("height",m.height)}const g=e.width<=m.width+e.padding?m.width+e.padding:e.width;e.width<=m.width+e.padding?e.diff=(g-e.width)/2-e.padding:e.diff=-e.padding;const y=e.height,b=e.x-g/2,x=e.y-y/2;de.trace("Data ",e,JSON.stringify(e));let S;if(e.look==="handDrawn"){const _=je.svg(u),L=Ge(e,{roughness:.7,fill:s,stroke:o,fillWeight:4,seed:i}),B=_.path($c(b,x,g,y,e.rx),L);S=u.insert(()=>(de.debug("Rough node insert CXC",B),B),":first-child"),S.select("path:nth-child(2)").attr("style",c.join(";")),S.select("path").attr("style",h.join(";").replace("fill","stroke"))}else S=u.insert("rect",":first-child"),S.attr("style",l).attr("rx",e.rx).attr("ry",e.ry).attr("x",b).attr("y",x).attr("width",g).attr("height",y);const{subGraphTitleTopMargin:k}=UT(r);if(f.attr("transform",`translate(${e.x-m.width/2}, ${e.y-e.height/2+k})`),a){const _=f.select("span");_&&_.attr("style",a)}const w=S.node().getBBox();return e.offsetX=0,e.width=w.width,e.height=w.height,e.offsetY=m.height-e.padding/2,e.intersect=function(_){return p0(e,_)},{cluster:u,labelBBox:m}},"kanbanSection"),eAe=C((t,e)=>{const r=Zt(),{themeVariables:n,handDrawnSeed:i}=r,{nodeBorder:s}=n,o=t.insert("g").attr("class",e.cssClasses).attr("id",e.id).attr("data-look",e.look),a=o.insert("g",":first-child"),l=0*e.padding,c=e.width+l;e.diff=-e.padding;const h=e.height+l,u=e.x-c/2,d=e.y-h/2;e.width=c;let f;if(e.look==="handDrawn"){const g=je.svg(o).rectangle(u,d,c,h,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:s,seed:i});f=o.insert(()=>g,":first-child")}else f=a.insert("rect",":first-child"),f.attr("class","divider").attr("x",u).attr("y",d).attr("width",c).attr("height",h).attr("data-look",e.look);const p=f.node().getBBox();return e.height=p.height,e.offsetX=0,e.offsetY=0,e.intersect=function(m){return p0(e,m)},{cluster:o,labelBBox:{}}}
vendor: 14,586 bytes, lines 1344-1345
1344,"divider"),tAe=lY,rAe={rect:lY,squareRect:tAe,roundedWithTitle:ZMe,noteGroup:JMe,divider:eAe,kanbanSection:QMe},cY=new Map,nAe=C(async(t,e)=>{const r=e.shape||"rect",n=await rAe[r](t,e);return cY.set(e.id,n),n},"insertCluster"),YDe=C(()=>{cY=new Map},"clear");function hY(t,e){return t.intersect(e)}C(hY,"intersectNode");var iAe=hY;function uY(t,e,r,n){var i=t.x,s=t.y,o=i-n.x,a=s-n.y,l=Math.sqrt(e*e*a*a+r*r*o*o),c=Math.abs(e*r*o/l);n.x<i&&(c=-c);var h=Math.abs(e*r*a/l);return n.y<s&&(h=-h),{x:i+c,y:s+h}}C(uY,"intersectEllipse");var dY=uY;function fY(t,e,r){return dY(t,e,e,r)}C(fY,"intersectCircle");var sAe=fY;function pY(t,e,r,n){{const i=e.y-t.y,s=t.x-e.x,o=e.x*t.y-t.x*e.y,a=i*r.x+s*r.y+o,l=i*n.x+s*n.y+o,c=1e-6;if(a!==0&&l!==0&&b6(a,l))return;const h=n.y-r.y,u=r.x-n.x,d=n.x*r.y-r.x*n.y,f=h*t.x+u*t.y+d,p=h*e.x+u*e.y+d;if(Math.abs(f)<c&&Math.abs(p)<c&&b6(f,p))return;const m=i*u-h*s;if(m===0)return;const g=Math.abs(m/2);let y=s*d-u*o;const b=y<0?(y-g)/m:(y+g)/m;y=h*o-i*d;const x=y<0?(y-g)/m:(y+g)/m;return{x:b,y:x}}}C(pY,"intersectLine");function b6(t,e){return t*e>0}C(b6,"sameSign");var oAe=pY;function mY(t,e,r){let n=t.x,i=t.y,s=[],o=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY;typeof e.forEach=="function"?e.forEach(function(h){o=Math.min(o,h.x),a=Math.min(a,h.y)}):(o=Math.min(o,e.x),a=Math.min(a,e.y));let l=n-t.width/2-o,c=i-t.height/2-a;for(let h=0;h<e.length;h++){let u=e[h],d=e[h<e.length-1?h+1:0],f=oAe(t,r,{x:l+u.x,y:c+u.y},{x:l+d.x,y:c+d.y});f&&s.push(f)}return s.length?(s.length>1&&s.sort(function(h,u){let d=h.x-r.x,f=h.y-r.y,p=Math.sqrt(d*d+f*f),m=u.x-r.x,g=u.y-r.y,y=Math.sqrt(m*m+g*g);return p<y?-1:p===y?0:1}),s[0]):t}C(mY,"intersectPolygon");var aAe=mY,Re={node:iAe,circle:sAe,ellipse:dY,polygon:aAe,rect:p0};function gY(t,e){const{labelStyles:r}=Ke(e);e.labelStyle=r;const n=ct(e);let i=n;n||(i="anchor");const s=t.insert("g").attr("class",i).attr("id",e.domId||e.id),o=1,{cssStyles:a}=e,l=je.svg(s),c=Ge(e,{fill:"black",stroke:"none",fillStyle:"solid"});e.look!=="handDrawn"&&(c.roughness=0);const h=l.circle(0,0,o*2,c),u=s.insert(()=>h,":first-child");return u.attr("class","anchor").attr("style",Vn(a)),Xe(e,u),e.intersect=function(d){return de.info("Circle intersect",e,o,d),Re.circle(e,o,d)},s}C(gY,"anchor");function x6(t,e,r,n,i,s,o){const l=(t+r)/2,c=(e+n)/2,h=Math.atan2(n-e,r-t),u=(r-t)/2,d=(n-e)/2,f=u/i,p=d/s,m=Math.sqrt(f**2+p**2);if(m>1)throw new Error("The given radii are too small to create an arc between the points.");const g=Math.sqrt(1-m**2),y=l+g*s*Math.sin(h)*(o?-1:1),b=c-g*i*Math.cos(h)*(o?-1:1),x=Math.atan2((e-b)/s,(t-y)/i);let k=Math.atan2((n-b)/s,(r-y)/i)-x;o&&k<0&&(k+=2*Math.PI),!o&&k>0&&(k-=2*Math.PI);const w=[];for(let _=0;_<20;_++){const L=_/19,B=x+L*k,E=y+i*Math.cos(B),D=b+s*Math.sin(B);w.push({x:E,y:D})}return w}C(x6,"generateArcPoints");async function yY(t,e){const{labelStyles:r,nodeStyles:n}=Ke(e);e.labelStyle=r;const{shapeSvg:i,bbox:s}=await dt(t,e,ct(e)),o=s.width+e.padding+20,a=s.height+e.padding,l=a/2,c=l/(2.5+a/50),{cssStyles:h}=e,u=[{x:o/2,y:-a/2},{x:-o/2,y:-a/2},...x6(-o/2,-a/2,-o/2,a/2,c,l,!1),{x:o/2,y:a/2},...x6(o/2,a/2,o/2,-a/2,c,l,!0)],d=je.svg(i),f=Ge(e,{});e.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const p=Bt(u),m=d.path(p,f),g=i.insert(()=>m,":first-child");return g.attr("class","basic label-container"),h&&e.look!=="handDrawn"&&g.selectAll("path").attr("style",h),n&&e.look!=="handDrawn"&&g.selectAll("path").attr("style",n),g.attr("transform",`translate(${c/2}, 0)`),Xe(e,g),e.intersect=function(y){return Re.polygon(e,u,y)},i}C(yY,"bowTieRect");function zc(t,e,r,n){return t.insert("polygon",":first-child").attr("points",n.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}C(zc,"insertPolygonShape");async function bY(t,e){const{labelStyles:r,nodeStyles:n}=Ke(e);e.labelStyle=r;const{shapeSvg:i,bbox:s}=await dt(t,e,ct(e)),o=s.height+e.padding,a=12,l=s.width+e.padding+a,c=0,h=l,u=-o,d=0,f=[{x:c+a,y:u},{x:h,y:u},{x:h,y:d},{x:c,y:d},{x:c,y:u+a},{x:c+a,y:u}];let p;const{cssStyles:m}=e;if(e.look==="handDrawn"){const g=je.svg(i),y=Ge(e,{}),b=Bt(f),x=g.path(b,y);p=i.insert(()=>x,":first-child").attr("transform",`translate(${-l/2}, ${o/2})`),m&&p.attr("style",m)}else p=zc(i,l,o,f);return n&&p.attr("style",n),Xe(e,p),e.intersect=function(g){return Re.polygon(e,f,g)},i}C(bY,"card");function xY(t,e){const{nodeStyles:r}=Ke(e);e.label="";const n=t.insert("g").attr("class",ct(e)).attr("id",e.domId??e.id),{cssStyles:i}=e,s=Math.max(28,e.width??0),o=[{x:0,y:s/2},{x:s/2,y:0},{x:0,y:-s/2},{x:-s/2,y:0}],a=je.svg(n),l=Ge(e,{});e.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const c=Bt(o),h=a.path(c,l),u=n.insert(()=>h,":first-child");return i&&e.look!=="handDrawn"&&u.selectAll("path").attr("style",i),r&&e.look!=="handDrawn"&&u.selectAll("path").attr("style",r),e.width=28,e.height=28,e.intersect=function(d){return Re.polygon(e,o,d)},n}C(xY,"choice");async function d_(t,e,r){const{labelStyles:n,nodeStyles:i}=Ke(e);e.labelStyle=n;const{shapeSvg:s,bbox:o,halfPadding:a}=await dt(t,e,ct(e)),l=(r==null?void 0:r.padding)??a,c=o.width/2+l;let h;const{cssStyles:u}=e;if(e.look==="handDrawn"){const d=je.svg(s),f=Ge(e,{}),p=d.circle(0,0,c*2,f);h=s.insert(()=>p,":first-child"),h.attr("class","basic label-container").attr("style",Vn(u))}else h=s.insert("circle",":first-child").attr("class","basic label-container").attr("style",i).attr("r",c).attr("cx",0).attr("cy",0);return Xe(e,h),e.calcIntersect=function(d,f){const p=d.width/2;return Re.circle(d,p,f)},e.intersect=function(d){return de.info("Circle intersect",e,c,d),Re.circle(e,c,d)},s}C(d_,"circle");function vY(t){const e=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),n=t*2,i={x:n/2*e,y:n/2*r},s={x:-(n/2)*e,y:n/2*r},o={x:-(n/2)*e,y:-(n/2)*r},a={x:n/2*e,y:-(n/2)*r};return`M ${s.x},${s.y} L ${a.x},${a.y}
1345                   M ${i.x},${i.y} L ${o.x},${o.y}`}C(vY,"createLine");function wY(t,e){const{labelStyles:r,nodeStyles:n}=Ke(e);e.labelStyle=r,e.label="";const i=t.insert("g").attr("class",ct(e)).attr("id",e.domId??e.id),s=Math.max(30,(e==null?void 0:e.width)??0),{cssStyles:o}=e,a=je.svg(i),l=Ge(e,{});e.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const c=a.circle(0,0,s*2,l),h=vY(s),u=a.path(h,l),d=i.insert(()=>c,":first-child");return d.insert(()=>u),o&&e.look!=="handDrawn"&&d.selectAll("path").attr("style",o),n&&e.look!=="handDrawn"&&d.selectAll("path").attr("style",n),Xe(e,d),e.intersect=function(f){return de.info("crossedCircle intersect",e,{radius:s,point:f}),Re.circle(e,s,f)},i}C(wY,"crossedCircle");function Ea(t,e,r,n=100,i=0,s=180){const o=[],a=i*Math.PI/180,h=(s*Math.PI/180-a)/(n-1);for(let u=0;u<n;u++){const d=a+u*h,f=t+r*Math.cos(d),p=e+r*Math.sin(d);o.push({x:-f,y:-p})}return o}C(Ea,"generateCirclePoints");async function kY(t,e){const{labelStyles:r,nodeStyles:n}=Ke(e);e.labelStyle=r;const{shapeSvg:i,bbox:s,label:o}=await dt(t,e,ct(e)),a=s.width+(e.padding??0),l=s.height+(e.padding??0),c=Math.max(5,l*.1),{cssStyles:h}=e,u=[...Ea(a/2,-l/2,c,30,-90,0),{x:-a/2-c,y:c},...Ea(a/2+c*2,-c,c,20,-180,-270),...Ea(a/2+c*2,c,c,20,-90,-180),{x:-a/2-c,y:-l/2},...Ea(a/2,l/2,c,20,0,90)],d=[{x:a/2,y:-l/2-c},{x:-a/2,y:-l/2-c},...Ea(a/2,-l/2,c,20,-90,0),{x:-a/2-c,y:-c},...Ea(a/2+a*.1,-c,c,20,-180,-270),...Ea(a/2+a*.1,c,c,20,-90,-180),{x:-a/2-c,y:l/2},...Ea(a/2,l/2,c,20,0,90),{x:-a/2,y:l/2+c},{x:a/2,y:l/2+c}],f=je.svg(i),p=Ge(e,{fill:"none"});e.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const g=Bt(u).replace("Z",""),y=f.path(g,p),b=Bt(d),x=f.path(b,{...p}),S=i.insert("g",":first-child");return S.insert(()=>x,":first-child").attr("stroke-opacity",0),S.insert(()=>y,":first-child"),S.attr("class","text"),h&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",h),n&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",n),S.attr("transform",`translate(${c}, 0)`),o.attr("transform",`translate(${-a/2+c-(s.x-(s.left??0))},${-l/2+(e.padding??0)/2-(s.y-(s.top??0))})`),Xe(e,S),e.intersect=function(k){return Re.polygon(e,d,k)},i}C(kY,"curlyBraceLeft");function Oa(t,e,r,n=100,i=0,s=180){const o=[],a=i*Math.PI/180,h=(s*Math.PI/180-a)/(n-1);for(let u=0;u<n;u++){const d=a+u*h,f=t+r*Math.cos(d),p=e+r*Math.sin(d);o.push({x:f,y:p})}return o}C(Oa,"generateCirclePoints");async function CY(t,e){const{labelStyles:r,nodeStyles:n}=Ke(e);e.labelStyle=r;const{shapeSvg:i,bbox:s,label:o}=await dt(t,e,ct(e)),a=s.width+(e.padding??0),l=s.height+(e.padding??0),c=Math.max(5,l*.1),{cssStyles:h}=e,u=[...Oa(a/2,-l/2,c,20,-90,0),{x:a/2+c,y:-c},...Oa(a/2+c*2,-c,c,20,-180,-270),...Oa(a/2+c*2,c,c,20,-90,-180),{x:a/2+c,y:l/2},...Oa(a/2,l/2,c,20,0,90)],d=[{x:-a/2,y:-l/2-c},{x:a/2,y:-l/2-c},...Oa(a/2,-l/2,c,20,-90,0),{x:a/2+c,y:-c},...Oa(a/2+c*2,-c,c,20,-180,-270),...Oa(a/2+c*2,c,c,20,-90,-180),{x:a/2+c,y:l/2},...Oa(a/2,l/2,c,20,0,90),{x:a/2,y:l/2+c},{x:-a/2,y:l/2+c}],f=je.svg(i),p=Ge(e,{fill:"none"});e.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const g=Bt(u).replace("Z",""),y=f.path(g,p),b=Bt(d),x=f.path(b,{...p}),S=i.insert("g",":first-child");return S.insert(()=>x,":first-child").attr("stroke-opacity",0),S.insert(()=>y,":first-child"),S.attr("class","text"),h&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",h),n&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",n),S.attr("transform",`translate(${-c}, 0)`),o.attr("transform",`translate(${-a/2+(e.padding??0)/2-(s.x-(s.left??0))},${-l/2+(e.padding??0)/2-(s.y-(s.top??0))})`),Xe(e,S),e.intersect=function(k){return Re.polygon(e,d,k)},i}C(CY,"curlyBraceRight");function yn(t,e,r,n=100,i=0,s=180){const o=[],a=i*Math.PI/180,h=(s*Math.PI/180-a)/(n-1);for(let u=0;u<n;u++){const d=a+u*h,f=t+r*Math.cos(d),p=e+r*Math.sin(d);o.push({x:-f,y:-p})}return o}C(yn,"generateCirclePoints");async function SY(t,e){const{labelStyles:r,nodeStyles:n}=Ke(e);e.labelStyle=r;const{shapeSvg:i,bbox:s,label:o}=await dt(t,e,ct(e)),a=s.width+(e.padding??0),l=s.height+(e.padding??0),c=Math.max(5,l*.1),{cssStyles:h}=e,u=[...yn(a/2,-l/2,c,30,-90,0),{x:-a/2-c,y:c},...yn(a/2+c*2,-c,c,20,-180,-270),...yn(a/2+c*2,c,c,20,-90,-180),{x:-a/2-c,y:-l/2},...yn(a/2,l/2,c,20,0,90)],d=[...yn(-a/2+c+c/2,-l/2,c,20,-90,-180),{x:a/2-c/2,y:c},...yn(-a/2-c/2,-c,c,20,0,90),...yn(-a/2-c/2,c,c,20,-90,0),{x:a/2-c/2,y:-c},...yn(-a/2+c+c/2,l/2,c,30,-180,-270)],f=[{x:a/2,y:-l/2-c},{x:-a/2,y:-l/2-c},...yn(a/2,-l/2,c,20,-90,0),{x:-a/2-c,y:-c},...yn(a/2+c*2,-c,c,20,-180,-270),...yn(a/2+c*2,c,c,20,-90,-180),{x:-a/2-c,y:l/2},...yn(a/2,l/2,c,20,0,90),{x:-a/2,y:l/2+c},{x:a/2-c-c/2,y:l/2+c},...yn(-a/2+c+c/2,-l/2,c,20,-90,-180),{x:a/2-c/2,y:c},...yn(-a/2-c/2,-c,c,20,0,90),...yn(-a/2-c/2,c,c,20,-90,0),{x:a/2-c/2,y:-c},...yn(-a/2+c+c/2,l/2,c,30,-180,-270)],p=je.svg(i),m=Ge(e,{fill:"none"});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=Bt(u).replace("Z",""),b=p.path(y,m),S=Bt(d).replace("Z",""),k=p.path(S,m),w=Bt(f),_=p.path(w,{...m}),L=i.insert("g",":first-child");return L.insert(()=>_,":first-child").attr("stroke-opacity",0),L.insert(()=>b,":first-child"),L.insert(()=>k,":first-child"),L.attr("class","text"),h&&e.look!=="handDrawn"&&L.selectAll("path").attr("style",h),n&&e.look!=="handDrawn"&&L.selectAll("path").attr("style",n),L.attr("transform",`translate(${c-c/4}, 0)`),o.attr("transform",`translate(${-a/2+(e.padding??0)/2-(s.x-(s.left??0))},${-l/2+(e.padding??0)/2-(s.y-(s.top??0))})`),Xe(e,L),e.intersect=function(B){return Re.polygon(e,f,B)},i}C(SY,"curlyBraces");async function TY(t,e){const{labelStyles:r,nodeStyles:n}=Ke(e);e.labelStyle=r;const{shapeSvg:i,bbox:s}=await dt(t,e,ct(e)),o=80,a=20,l=Math.max(o,(s.width+(e.padding??0)*2)*1.25,(e==null?void 0:e.width)??0),c=Math.max(a,s.height+(e.padding??0)*2,(e==null?void 0:e.height)??0),h=c/2,{cssStyles:u}=e,d=je.svg(i),f=Ge(e,{});e.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const p=l,m=c,g=p-h,y=m/4,b=[{x:g,y:0},{x:y,y:0},{x:0,y:m/2},{x:y,y:m},{x:g,y:m},...Ng(-g,-m/2,h,50,270,90)],x=Bt(b),S=d.path(x,f),k=i.insert(()=>S,":first-child");return k.attr("class","basic label-container"),u&&e.look!=="handDrawn"&&k.selectChildren("path").attr("style",u),n&&e.look!=="handDrawn"&&k.selectChildren("path").attr("style",n),k.attr("transform",`translate(${-l/2}, ${-c/2})`),Xe(e,k),e.intersect=function(w){return Re.polygon(e,b,w)},i}C(TY,"curvedTrapezoid");var lAe=C((t,e,r,n,i,s)=>[`M${t},${e+s}`,`a${i},${s} 0,0,0 ${r},0`,`a${i},${s} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${s} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createCylinderPathD"),cAe=C((t,e,r,n,i,s)=>[`M${t},${e+s}`,`M${t+r},${e+s}`,`a${i},${s} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${s} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createOuterCylinderPathD"),hAe=C((t,e,r,n,i,s)=>[`M${t-r/2},${-n/2}`,`a${i},${s} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD");async function _Y(t,e){const{labelStyles:r,nodeStyles:n}=Ke(e);e.labelStyle=r;const{shapeSvg:i,bbox:s,label:o}=await dt(t,e,ct(e)),a=Math.max(s.width+e.padding,e.width??0),l=a/2,c=l/(2.5+a/50),h=Math.max(s.height+c+e.padding,e.height??0);let u;const{cssStyles:d}=e;if(e.look==="handDrawn"){const f=je.svg(i),p=cAe(0,0,a,h,l,c),m=hAe(0,c,a,h,l,c),g=f.path(p,Ge(e,{})),y=f.path(m,Ge(e,{fill:"none"}));u=i.insert(()=>y,":first-child"),u=i.insert(()=>g,":first-child"),u.attr("class","basic label-container"),d&&u.attr("style",d)}else{const f=lAe(0,0,a,h,l,c);u=i.insert("path",":first-child").attr("d",f).attr("class","basic label-container").attr("style",Vn(d)).attr("style",n)}return u.attr("label-offset-y",c),u.attr("transform",`translate(${-a/2}, ${-(h/2+c)})`),Xe(e,u),o.attr("transform",`translate(${-(s.width/2)-(s.x-(s.left??0))}, ${-(s.height/2)+(e.padding??0)/1.5-(s.y-(s.top??0))})`),e.intersect=function(f){const p=Re.rect(e,f),m=p.x-(e.x??0);if(l!=0&&(Math.abs(m)<(e.width??0)/2||Math.abs(m)==(e.width??0)/2&&Math.abs(p.y-(e.y??0))>(e.height??0)/2-c)){let g=c*c*(1-m*m/(l*l));g>0&&(g=Math.sqrt(g)),g=c-g,f.y-(e.y??0)>0&&(g=-g),p.y+=g}return p},i}C(_Y,"cylinder");async function MY(t,e){const{labelStyles:r,nodeStyles:n}=Ke(e);e.labelStyle=r;const{shapeSvg:i,bbox:s,label:o}=await dt(t,e,ct(e)),a=s.width+e.padding,l=s.height+e.padding,c=l*.2,h=-a/2,u=-l/2-c/2,{cssStyles:d}=e,f=je.svg(i),p=Ge(e,{});e.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const m=[{x:h,y:u+c},{x:-h,y:u+c},{x:-h,y:-u},{x:h,y:-u},{x:h,y:u},{x:-h,y:u},{x:-h,y:u+c}],g=f.polygon(m.map(b=>[b.x,b.y]),p),y=i.insert(()=>g,":first-child");return y.attr("class","basic label-container"),d&&e.look!=="handDrawn"&&y.selectAll("path").attr("style",d),n&&e.look!=="handDrawn"&&y.selectAll("path").attr("style",n),o.attr("transform",`translate(${h+(e.padding??0)
1345/2-(s.x-(s.left??0))}, ${u+c+(e.padding??0)/2-(s.y-(s.top??0))})`),Xe(e,y),e.intersect=function(b){return Re.rect(e,b)},i}C(MY,"dividedRectangle");async function AY(t,e){var d,f;const{labelStyles:r,nodeStyles:n}=Ke(e);e.labelStyle=r;const{shapeSvg:i,bbox:s,halfPadding:o}=await dt(t,e,ct(e)),l=s.width/2+o+5,c=s.width/2+o;let h;const{cssStyles:u}=e;if(e.look==="handDrawn"){const p=je.svg(i),m=Ge(e,{roughness:.2,strokeWidth:2.5}),g=Ge(e,{roughness:.2,strokeWidth:1.5}),y=p.circle(0,0,l*2,m),b=p.circle(0,0,c*2,g);h=i.insert("g",":first-child"),h.attr("class",Vn(e.cssClasses)).attr("style",Vn(u)),(d=h.node())==null||d.appendChild(y),(f=h.node())==null||f.appendChild(b)}else{h=i.insert("g",":first-child");const p=h.insert("circle",":first-child"),m=h.insert("circle");h.attr("class","basic label-container").attr("style",n),p.attr("class","outer-circle").attr("style",n).attr("r",l).attr("cx",0).attr("cy",0),m.attr("class","inner-circle").attr("style",n).attr("r",c).attr("cx",0).attr("cy",0)}return Xe(e,h),e.intersect=function(p){return de.info("DoubleCircle intersect",e,l,p),Re.circle(e,l,p)},i}C(AY,"doublecircle");function EY(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=Ke(e);e.label="",e.labelStyle=n;const s=t.insert("g").attr("class",ct(e)).attr("id",e.domId??e.id),o=7,{cssStyles:a}=e,l=je.svg(s),{nodeBorder:c}=r,h=Ge(e,{fillStyle:"solid"});e.look!=="handDrawn"&&(h.roughness=0);const u=l.circle(0,0,o*2,h),d=s.insert(()=>u,":first-child");return d.selectAll("path").attr("style",`fill: ${c} !important;`),a&&a.length>0&&e.look!=="handDrawn"&&d.selectAll("path").attr("style",a),i&&e.look!=="handDrawn"&&d.selectAll("path").attr("style",i),Xe(e,d),e.intersect=function(f){return de.info("filledCircle intersect",e,{radius:o,point:f}),Re.circle(e,o,f)},s}C(EY,"filledCircle");async function OY(t,e){const{labelStyles:r,nodeStyles:n}=Ke(e);e.labelStyle=r;const{shapeSvg:i,bbox:s,label:o}=await dt(t,e,ct(e)),a=s.width+(e.padding??0),l=a+s.height,c=a+s.height,h=[{x:0,y:-l},{x:c,y:-l},{x:c/2,y:0}],{cssStyles:u}=e,d=je.svg(i),f=Ge(e,{});e.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const p=Bt(h),m=d.path(p,f),g=i.insert(()=>m,":first-child").attr("transform",`translate(${-l/2}, ${l/2})`);return u&&e.look!=="handDrawn"&&g.selectChildren("path").attr("style",u),n&&e.look!=="handDrawn"&&g.selectChildren("path").attr("style",n),e.width=a,e.height=l,Xe(e,g),o.attr("transform",`translate(${-s.width/2-(s.x-(s.left??0))}, ${-l/2+(e.padding??0)/2+(s.y-(s.top??0))})`),e.intersect=function(y){return de.info("Triangle intersect",e,h,y),Re.polygon(e,h,y)},i}C(OY,"flippedTriangle");function LY(t,e,{dir:r,config:{state:n,themeVariables:i}}){const{nodeStyles:s}=Ke(e);e.label="";const o=t.insert("g").attr("class",ct(e)).attr("id",e.domId??e.id),{cssStyles:a}=e;let l=Math.max(70,(e==null?void 0:e.width)??0),c=Math.max(10,(e==null?void 0:e.height)??0);r==="LR"&&(l=Math.max(10,(e==null?void 0:e.width)??0),c=Math.max(70,(e==null?void 0:e.height)??0));const h=-1*l/2,u=-1*c/2,d=je.svg(o),f=Ge(e,{stroke:i.lineColor,fill:i.lineColor});e.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const p=d.rectangle(h,u,l,c,f),m=o.insert(()=>p,":first-child");a&&e.look!=="handDrawn"&&m.selectAll("path").attr("style",a),s&&e.look!=="handDrawn"&&m.selectAll("path").attr("style",s),Xe(e,m);const g=(n==null?void 0:n.padding)??0;return e.width&&e.height&&(e.width+=g/2||0,e.height+=g/2||0),e.intersect=function(y){return Re.rect(e,y)},o}C(LY,"forkJoin");async function DY(t,e){const{labelStyles:r,nodeStyles:n}=Ke(e);e.labelStyle=r;const i=80,s=50,{shapeSvg:o,bbox:a}=await dt(t,e,ct(e)),l=Math.max(i,a.width+(e.padding??0)*2,(e==null?void 0:e.width)??0),c=Math.max(s,a.height+(e.padding??0)*2,(e==null?void 0:e.height)??0),h=c/2,{cssStyles:u}=e,d=je.svg(o),f=Ge(e,{});e.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const p=[{x:-l/2,y:-c/2},{x:l/2-h,y:-c/2},...Ng(-l/2+h,0,h,50,90,270),{x:l/2-h,y:c/2},{x:-l/2,y:c/2}],m=Bt(p),g=d.path(m,f),y=o.insert(()=>g,":first-child");return y.attr("class","basic label-container"),u&&e.look!=="handDrawn"&&y.selectChildren("path").attr("style",u),n&&e.look!=="handDrawn"&&y.selectChildren("path").attr("style",n),Xe(e,y),e.intersect=function(b){return de.info("Pill intersect",e,{radius:h,point:b}),Re.polygon(e,p,b)},o}C(DY,"halfRoundedRectangle");async function IY(t,e){const{labelStyles:r,nodeStyles:n}=Ke(e);e.labelStyle=r;const{shapeSvg:i,bbox:s}=await dt(t,e,ct(e)),o=s.height+(e.padding??0),a=s.width+(e.padding??0)*2.5,{cssStyles:l}=e,c=je.svg(i),h=Ge(e,{});e.look!=="handDrawn"&&(h.roughness=0,h.fillStyle="solid");let u=a/2;const d=u/6;u=u+d;const f=o/2,p=f/2,m=u-p,g=[{x:-m,y:-f},{x:0,y:-f},{x:m,y:-f},{x:u,y:0},{x:m,y:f},{x:0,y:f},{x:-m,y:f},{x:-u,y:0}],y=Bt(g),b=c.path(y,h),x=i.insert(()=>b,":first-child");return x.attr("class","basic label-container"),l&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",l),n&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",n),e.width=a,e.height=o,Xe(e,x),e.intersect=function(S){return Re.polygon(e,g,S)},i}C(IY,"hexagon");async function BY(t,e){const{labelStyles:r,nodeStyles:n}=Ke(e);e.label="",e.labelStyle=r;const{shapeSvg:i}=await dt(t,e,ct(e)),s=Math.max(30,(e==null?void 0:e.width)??0),o=Math.max(30,(e==null?void 0:e.he
vendor: 20,386 bytes, line 1345
1345ight)??0),{cssStyles:a}=e,l=je.svg(i),c=Ge(e,{});e.look!=="handDrawn"&&(c.roughness=0,c.fillStyle="solid");const h=[{x:0,y:0},{x:s,y:0},{x:0,y:o},{x:s,y:o}],u=Bt(h),d=l.path(u,c),f=i.insert(()=>d,":first-child");return f.attr("class","basic label-container"),a&&e.look!=="handDrawn"&&f.selectChildren("path").attr("style",a),n&&e.look!=="handDrawn"&&f.selectChildren("path").attr("style",n),f.attr("transform",`translate(${-s/2}, ${-o/2})`),Xe(e,f),e.intersect=function(p){return de.info("Pill intersect",e,{points:h}),Re.polygon(e,h,p)},i}C(BY,"hourglass");async function RY(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=Ke(e);e.labelStyle=i;const s=e.assetHeight??48,o=e.assetWidth??48,a=Math.max(s,o),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(a,l??0);const{shapeSvg:c,bbox:h,label:u}=await dt(t,e,"icon-shape default"),d=e.pos==="t",f=a,p=a,{nodeBorder:m}=r,{stylesMap:g}=f0(e),y=-p/2,b=-f/2,x=e.label?8:0,S=je.svg(c),k=Ge(e,{stroke:"none",fill:"none"});e.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const w=S.rectangle(y,b,p,f,k),_=Math.max(p,h.width),L=f+h.height+x,B=S.rectangle(-_/2,-L/2,_,L,{...k,fill:"transparent",stroke:"none"}),E=c.insert(()=>w,":first-child"),D=c.insert(()=>B);if(e.icon){const N=c.append("g");N.html(`<g>${await ey(e.icon,{height:a,width:a,fallbackPrefix:""})}</g>`);const K=N.node().getBBox(),z=K.width,$=K.height,H=K.x,j=K.y;N.attr("transform",`translate(${-z/2-H},${d?h.height/2+x/2-$/2-j:-h.height/2-x/2-$/2-j})`),N.attr("style",`color: ${g.get("stroke")??m};`)}return u.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${d?-L/2:L/2-h.height})`),E.attr("transform",`translate(0,${d?h.height/2+x/2:-h.height/2-x/2})`),Xe(e,D),e.intersect=function(N){if(de.info("iconSquare intersect",e,N),!e.label)return Re.rect(e,N);const K=e.x??0,z=e.y??0,$=e.height??0;let H=[];return d?H=[{x:K-h.width/2,y:z-$/2},{x:K+h.width/2,y:z-$/2},{x:K+h.width/2,y:z-$/2+h.height+x},{x:K+p/2,y:z-$/2+h.height+x},{x:K+p/2,y:z+$/2},{x:K-p/2,y:z+$/2},{x:K-p/2,y:z-$/2+h.height+x},{x:K-h.width/2,y:z-$/2+h.height+x}]:H=[{x:K-p/2,y:z-$/2},{x:K+p/2,y:z-$/2},{x:K+p/2,y:z-$/2+f},{x:K+h.width/2,y:z-$/2+f},{x:K+h.width/2/2,y:z+$/2},{x:K-h.width/2,y:z+$/2},{x:K-h.width/2,y:z-$/2+f},{x:K-p/2,y:z-$/2+f}],Re.polygon(e,H,N)},c}C(RY,"icon");async function PY(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=Ke(e);e.labelStyle=i;const s=e.assetHeight??48,o=e.assetWidth??48,a=Math.max(s,o),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(a,l??0);const{shapeSvg:c,bbox:h,label:u}=await dt(t,e,"icon-shape default"),d=20,f=e.label?8:0,p=e.pos==="t",{nodeBorder:m,mainBkg:g}=r,{stylesMap:y}=f0(e),b=je.svg(c),x=Ge(e,{});e.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const S=y.get("fill");x.stroke=S??g;const k=c.append("g");e.icon&&k.html(`<g>${await ey(e.icon,{height:a,width:a,fallbackPrefix:""})}</g>`);const w=k.node().getBBox(),_=w.width,L=w.height,B=w.x,E=w.y,D=Math.max(_,L)*Math.SQRT2+d*2,N=b.circle(0,0,D,x),K=Math.max(D,h.width),z=D+h.height+f,$=b.rectangle(-K/2,-z/2,K,z,{...x,fill:"transparent",stroke:"none"}),H=c.insert(()=>N,":first-child"),j=c.insert(()=>$);return k.attr("transform",`translate(${-_/2-B},${p?h.height/2+f/2-L/2-E:-h.height/2-f/2-L/2-E})`),k.attr("style",`color: ${y.get("stroke")??m};`),u.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-z/2:z/2-h.height})`),H.attr("transform",`translate(0,${p?h.height/2+f/2:-h.height/2-f/2})`),Xe(e,j),e.intersect=function(q){return de.info("iconSquare intersect",e,q),Re.rect(e,q)},c}C(PY,"iconCircle");async function NY(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=Ke(e);e.labelStyle=i;const s=e.assetHeight??48,o=e.assetWidth??48,a=Math.max(s,o),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(a,l??0);const{shapeSvg:c,bbox:h,halfPadding:u,label:d}=await dt(t,e,"icon-shape default"),f=e.pos==="t",p=a+u*2,m=a+u*2,{nodeBorder:g,mainBkg:y}=r,{stylesMap:b}=f0(e),x=-m/2,S=-p/2,k=e.label?8:0,w=je.svg(c),_=Ge(e,{});e.look!=="handDrawn"&&(_.roughness=0,_.fillStyle="solid");const L=b.get("fill");_.stroke=L??y;const B=w.path($c(x,S,m,p,5),_),E=Math.max(m,h.width),D=p+h.height+k,N=w.rectangle(-E/2,-D/2,E,D,{..._,fill:"transparent",stroke:"none"}),K=c.insert(()=>B,":first-child").attr("class","icon-shape2"),z=c.insert(()=>N);if(e.icon){const $=c.append("g");$.html(`<g>${await ey(e.icon,{height:a,width:a,fallbackPrefix:""})}</g>`);const H=$.node().getBBox(),j=H.width,q=H.height,ne=H.x,O=H.y;$.attr("transform",`translate(${-j/2-ne},${f?h.height/2+k/2-q/2-O:-h.height/2-k/2-q/2-O})`),$.attr("style",`color: ${b.get("stroke")??g};`)}return d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${f?-D/2:D/2-h.height})`),K.attr("transform",`translate(0,${f?h.height/2+k/2:-h.height/2-k/2})`),Xe(e,z),e.intersect=function($){if(de.info("iconSquare intersect",e,$),!e.label)return Re.rect(e,$);const H=e.x??0,j=e.y??0,q=e.height??0;let ne=[];return f?ne=[{x:H-h.width/2,y:j-q/2},{x:H+h.width/2,y:j-q/2},{x:H+h.width/2,y:j-q/2+h.height+k},{x:H+m/2,y:j-q/2+h.height+k},{x:H+m/2,y:j+q/2},{x:H-m/2,y:j+q/2},{x:H-m/2,y:j-q/2+h.height+k},{x:H-h.width/2,y:j-q/2+h.height+k}]:ne=[{x:H-m/2,y:j-q/2},{x:H+m/2,y:j-q/2},{x:H+m/2,y:j-q/2+p},{x:H+h.width/2,y:j-q/2+p},{x:H+h.width/2/2,y:j+q/2},{x:H-h.width/2,y:j+q/2},{x:H-h.width/2,y:j-q/2+p},{x:H-m/2,y:j-q/2+p}],Re.polygon(e,ne,$)},c}C(NY,"iconRounded");async function FY(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=Ke(e);e.labelStyle=i;const s=e.assetHeight??48,o=e.assetWidth??48,a=Math.max(s,o),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(a,l??0);const{shapeSvg:c,bbox:h,halfPadding:u,label:d}=await dt(t,e,"icon-shape default"),f=e.pos==="t",p=a+u*2,m=a+u*2,{nodeBorder:g,mainBkg:y}=r,{stylesMap:b}=f0(e),x=-m/2,S=-p/2,k=e.label?8:0,w=je.svg(c),_=Ge(e,{});e.look!=="handDrawn"&&(_.roughness=0,_.fillStyle="solid");const L=b.get("fill");_.stroke=L??y;const B=w.path($c(x,S,m,p,.1),_),E=Math.max(m,h.width),D=p+h.height+k,N=w.rectangle(-E/2,-D/2,E,D,{..._,fill:"transparent",stroke:"none"}),K=c.insert(()=>B,":first-child"),z=c.insert(()=>N);if(e.icon){const $=c.append("g");$.html(`<g>${await ey(e.icon,{height:a,width:a,fallbackPrefix:""})}</g>`);const H=$.node().getBBox(),j=H.width,q=H.height,ne=H.x,O=H.y;$.attr("transform",`translate(${-j/2-ne},${f?h.height/2+k/2-q/2-O:-h.height/2-k/2-q/2-O})`),$.attr("style",`color: ${b.get("stroke")??g};`)}return d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${f?-D/2:D/2-h.height})`),K.attr("transform",`translate(0,${f?h.height/2+k/2:-h.height/2-k/2})`),Xe(e,z),e.intersect=function($){if(de.info("iconSquare intersect",e,$),!e.label)return Re.rect(e,$);const H=e.x??0,j=e.y??0,q=e.height??0;let ne=[];return f?ne=[{x:H-h.width/2,y:j-q/2},{x:H+h.width/2,y:j-q/2},{x:H+h.width/2,y:j-q/2+h.height+k},{x:H+m/2,y:j-q/2+h.height+k},{x:H+m/2,y:j+q/2},{x:H-m/2,y:j+q/2},{x:H-m/2,y:j-q/2+h.height+k},{x:H-h.width/2,y:j-q/2+h.height+k}]:ne=[{x:H-m/2,y:j-q/2},{x:H+m/2,y:j-q/2},{x:H+m/2,y:j-q/2+p},{x:H+h.width/2,y:j-q/2+p},{x:H+h.width/2/2,y:j+q/2},{x:H-h.width/2,y:j+q/2},{x:H-h.width/2,y:j-q/2+p},{x:H-m/2,y:j-q/2+p}],Re.polygon(e,ne,$)},c}C(FY,"iconSquare");async function $Y(t,e,{config:{flowchart:r}}){const n=new Image;n.src=(e==null?void 0:e.img)??"",await n.decode();const i=Number(n.naturalWidth.toString().replace("px","")),s=Number(n.naturalHeight.toString().replace("px",""));e.imageAspectRatio=i/s;const{labelStyles:o}=Ke(e);e.labelStyle=o;const a=r==null?void 0:r.wrappingWidth;e.defaultWidth=r==null?void 0:r.wrappingWidth;const l=Math.max(e.label?a??0:0,(e==null?void 0:e.assetWidth)??i),c=e.constraint==="on"&&e!=null&&e.assetHeight?e.assetHeight*e.imageAspectRatio:l,h=e.constraint==="on"?c/e.imageAspectRatio:(e==null?void 0:e.assetHeight)??s;e.width=Math.max(c,a??0);const{shapeSvg:u,bbox:d,label:f}=await dt(t,e,"image-shape default"),p=e.pos==="t",m=-c/2,g=-h/2,y=e.label?8:0,b=je.svg(u),x=Ge(e,{});e.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const S=b.rectangle(m,g,c,h,x),k=Math.max(c,d.width),w=h+d.height+y,_=b.rectangle(-k/2,-w/2,k,w,{...x,fill:"none",stroke:"none"}),L=u.insert(()=>S,":first-child"),B=u.insert(()=>_);if(e.img){const E=u.append("image");E.attr("href",e.img),E.attr("width",c),E.attr("height",h),E.attr("preserveAspectRatio","none"),E.attr("transform",`translate(${-c/2},${p?w/2-h:-w/2})`)}return f.attr("transform",`translate(${-d.width/2-(d.x-(d.left??0))},${p?-h/2-d.height/2-y/2:h/2-d.height/2+y/2})`),L.attr("transform",`translate(0,${p?d.height/2+y/2:-d.height/2-y/2})`),Xe(e,B),e.intersect=function(E){if(de.info("iconSquare intersect",e,E),!e.label)return Re.rect(e,E);const D=e.x??0,N=e.y??0,K=e.height??0;let z=[];return p?z=[{x:D-d.width/2,y:N-K/2},{x:D+d.width/2,y:N-K/2},{x:D+d.width/2,y:N-K/2+d.height+y},{x:D+c/2,y:N-K/2+d.height+y},{x:D+c/2,y:N+K/2},{x:D-c/2,y:N+K/2},{x:D-c/2,y:N-K/2+d.height+y},{x:D-d.width/2,y:N-K/2+d.height+y}]:z=[{x:D-c/2,y:N-K/2},{x:D+c/2,y:N-K/2},{x:D+c/2,y:N-K/2+h},{x:D+d.width/2,y:N-K/2+h},{x:D+d.width/2/2,y:N+K/2},{x:D-d.width/2,y:N+K/2},{x:D-d.width/2,y:N-K/2+h},{x:D-c/2,y:N-K/2+h}],Re.polygon(e,z,E)},u}C($Y,"imageSquare");async function zY(t,e){const{labelStyles:r,nodeStyles:n}=Ke(e);e.labelStyle=r;const{shapeSvg:i,bbox:s}=await dt(t,e,ct(e)),o=Math.max(s.width+(e.padding??0)*2,(e==null?void 0:e.width)??0),a=Math.max(s.height+(e.padding??0)*2,(e==null?void 0:e.height)??0),l=[{x:0,y:0},{x:o,y:0},{x:o+3*a/6,y:-a},{x:-3*a/6,y:-a}];let c;const{cssStyles:h}=e;if(e.look==="handDrawn"){const u=je.svg(i),d=Ge(e,{}),f=Bt(l),p=u.path(f,d);c=i.insert(()=>p,":first-child").attr("transform",`translate(${-o/2}, ${a/2})`),h&&c.attr("style",h)}else c=zc(i,o,a,l);return n&&c.attr("style",n),e.width=o,e.height=a,Xe(e,c),e.intersect=function(u){return Re.polygon(e,l,u)},i}C(zY,"inv_trapezoid");async function S4(t,e,r){const{labelStyles:n,nodeStyles:i}=Ke(e);e.labelStyle=n;const{shapeSvg:s,bbox:o}=await dt(t,e,ct(e)),a=Math.max(o.width+r.labelPaddingX*2,(e==null?void 0:e.width)||0),l=Math.max(o.height+r.labelPaddingY*2,(e==null?void 0:e.height)||0),c=-a/2,h=-l/2;let u,{rx:d,ry:f}=e;const{cssStyles:p}=e;if(r!=null&&r.rx&&r.ry&&(d=r.rx,f=r.ry),e.look==="handDrawn"){const m=je.svg(s),g=Ge(e,{}),y=d||f?m.path($c(c,h,a,l,d||0),g):m.rectangle(c,h,a,l,g);u=s.insert(()=>y,":first-child"),u.attr("class","basic label-container").attr("style",Vn(p))}else u=s.insert("rect",":first-child"),u.attr("class","basic label-container").attr("style",i).attr("rx",Vn(d)).attr("ry",Vn(f)).attr("x",c).attr("y",h).attr("width",a).attr("height",l);return Xe(e,u),e.calcIntersect=function(m,g){return Re.rect(m,g)},e.intersect=function(m){return Re.rect(e,m)},s}C(S4,"drawRect");async function HY(t,e){const{shapeSvg:r,bbox:n,label:i}=await dt(t,e,"label"),s=r.insert("rect",":first-child");return s.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),i.attr("transform",`translate(${-(n.width/2)-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),Xe(e,s),e.intersect=function(l){return Re.rect(e,l)},r}C(HY,"labelRect");async function qY(t,e){const{labelStyles:r,nodeStyles:n}=Ke(e);e.labelStyle=r;const{shapeSvg:i,bbox:s}=await dt(t,e,ct(e)),o=Math.max(s.width+(e.padding??0),(e==null?void 0:e.width)??0),a=Math.max(s.height+(e.padding??0),(e==null?void 0:e.height)??0),l=[{x:0,y:0},{x:o+3*a/6,y:0},{x:o,y:-a},{x:-(3*a)/6,y:-a}];let c;const{cssStyles:h}=e;if(e.look==="handDrawn"){const u=je.svg(i),d=Ge(e,{}),f=Bt(l),p=u.path(f,d);c=i.insert(()=>p,":first-child").attr("transform",`translate(${-o/2}, ${a/2})`),h&&c.attr("style",h)}else c=zc(i,o,a,l);return n&&c.attr("style",n),e.width=o,e.height=a,Xe(e,c),e.intersect=function(u){return Re.polygon(e,l,u)},i}C(qY,"lean_left");async function VY(t,e){const{labelStyles:r,nodeStyles:n}=Ke(e);e.labelStyle=r;const{shapeSvg:i,bbox:s}=await dt(t,e,ct(e)),o=Math.max(s.width+(e.padding??0),(e==null?void 0:e.width)??0),a=Math.max(s.height+(e.padding??0),(e==null?void 0:e.height)??0),l=[{x:-3*a/6,y:0},{x:o,y:0},{x:o+3*a/6,y:-a},{x:0,y:-a}];let c;const{cssStyles:h}=e;if(e.look==="handDrawn"){const u=je.svg(i),d=Ge(e,{}),f=Bt(l),p=u.path(f,d);c=i.insert(()=>p,":first-child").attr("transform",`translate(${-o/2}, ${a/2})`),h&&c.attr("style",h)}else c=zc(i,o,a,l);return n&&c.attr("style",n),e.width=o,e.height=a,Xe(e,c),e.intersect=function(u){return Re.polygon(e,l,u)},i}C(VY,"lean_right");function WY(t,e){const{labelStyles:r,nodeStyles:n}=Ke(e);e.label="",e.labelStyle=r;const i=t.insert("g").attr("class",ct(e)).attr("id",e.domId??e.id),{cssStyles:s}=e,o=Math.max(35,(e==null?void 0:e.width)??0),a=Math.max(35,(e==null?void 0:e.height)??0),l=7,c=[{x:o,y:0},{x:0,y:a+l/2},{x:o-2*l,y:a+l/2},{x:0,y:2*a},{x:o,y:a-l/2},{x:2*l,y:a-l/2}],h=je.svg(i),u=Ge(e,{});e.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const d=Bt(c),f=h.path(d,u),p=i.insert(()=>f,":first-child");return s&&e.look!=="handDrawn"&&p.selectAll("path").attr("style",s),n&&e.look!=="handDrawn"&&p.selectAll("path").attr("style",n),p.attr("transform",`translate(-${o/2},${-a})`),Xe(e,p),e.intersect=function(m){return de.info("lightningBolt intersect",e,m),Re.polygon(e,c,m)},i}C(WY,"lightningBolt");var uAe=C((t,e,r,n,i,s,o)=>[`M${t},${e+s}`,`a${i},${s} 0,0,0 ${r},0`,`a${i},${s} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${s} 0,0,0 ${r},0`,`l0,${-n}`,`M${t},${e+s+o}`,`a${i},${s} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),dAe=C((t,e,r,n,i,s,o)=>[`M${t},${e+s}`,`M${t+r},${e+s}`,`a${i},${s} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${s} 0,0,0 ${r},0`,`l0,${-n}`,`M${t},${e+s+o}`,`a${i},${s} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),fAe=C((t,e,r,n,i,s)=>[`M${t-r/2},${-n/2}`,`a${i},${s} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD");async function jY(t,e){const{labelStyles:r,nodeStyles:n}=Ke(e);e.labelStyle=r;const{shapeSvg:i,bbox:s,label:o}=await dt(t,e,ct(e)),a=Math.max(s.width+(e.padding??0),e.width??0),l=a/2,c=l/(2.5+a/50),h=Math.max(s.height+c+(e.padding??0),e.height??0),u=h*.1;let d;const{cssStyles:f}=e;if(e.look==="handDrawn"){const p=je.svg(i),m=dAe(0,0,a,h,l,c,u),g=fAe(0,c,a,h,l,c),y=Ge(e,{}),b=p.path(m,y),x=p.path(g,y);i.insert(()=>x,":first-child").attr("class","line"),d=i.insert(()=>b,":first-child"),d.attr("class","basic label-container"),f&&d.attr("style",f)}else{const p=uAe(0,0,a,h,l,c,u);d=i.insert("path",":first-child").attr("d",p).attr("class","basic label-container").attr("style",Vn(f)).attr("style",n)}return d.attr("label-offset-y",c),d.attr("transform",`translate(${-a/2}, ${-(h/2+c)})`),Xe(e,d),o.attr("transform",`translate(${-(s.width/2)-(s.x-(s.left??0))}, ${-(s.height/2)+c-(s.y-(s.top??0))})`),e.intersect=function(p){const m=Re.rect(e,p),g=m.x-(e.x??0);if(l!=0&&(Math.abs(g)<(e.width??0)/2||Math.abs(g)==(e.width??0)/2&&Math.abs(m.y-(e.y??0))>(e.height??0)/2-c)){let y=c*c*(1-g*g/(l*l));y>0&&(y=Math.sqrt(y)),y=c-y,p.y-(e.y??0)>0&&(y=-y),m.y+=y}return m},i}C(jY,"linedCylinder");async function UY(t,e){const{labelStyles:r,nodeStyles:n}=Ke(e);e.labelStyle=r;const{shapeSvg:i,bbox:s,label:o}=await dt(t,e,ct(e)),a=Math.max(s.width+(e.padding??0)*2,(e==null?void 0:e.width)??0),l=Math.max(s.height+(e.padding??0)*2,(e==null?void 0:e.height)??0),c=l/4,h=l+c,{cssStyles:u}=e,d=je.svg(i),f=Ge(e,{});e.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const p=[{x:-a/2-a/2*.1,y:-h/2},{x:-a/2-a/2*.1,y:h/2},...Mc(-a/2-a/2*.1,h/2,a/2+a/2*.1,h/2,c,.8),{x:a/2+a/2*.1,y:-h/2},{x:-a/2-a/2*.1,y:-h/2},{x:-a/2,y:-h/2},{x:-a/2,y:h/2*1.1},{x:-a/2,y:-h/2}],m=d.polygon(p.map(y=>[y.x,y.y]),f),g=i.insert(()=>m,":first-child");return g.attr("class","basic label-container"),u&&e.look!=="handDrawn"&&g.selectAll("path").attr("style",u),n&&e.look!=="handDrawn"&&g.selectAll("path").attr("style",n),g.attr("transform",`translate(0,${-c/2})`),o.attr("transform",`translate(${-a/2+(e.padding??0)+a/2*.1/2-(s.x-(s.left??0))},${-l/2+(e.padding??0)-c/2-(s.y-(s.top??0))})`),Xe(e,g),e.intersect=function(y){return Re.polygon(e,p,y)},i}C(UY,"linedWaveEdgedRect");async function GY(t,e){const{labelStyles:r,nodeStyles:n}=Ke(e);e.labelStyle=r;const{shapeSvg:i,bbox:s,label:o}=await dt(t,e,ct(e)),a=Math.max(s.width+(e.padding??0)*2,(e==null?void 0:e.width)??0),l=Math.max(s.height+(e.padding??0)*2,(e==null?void 0:e.height)??0),c=5,h=-a/2,u=-l/2,{cssStyles:d}=e,f=je.svg(i),p=Ge(e,{}),m=[{x:h-c,y:u+c},{x:h-c,y:u+l+c},{x:h+a-c,y:u+l+c},{x:h+a-c,y:u+l},{x:h+a,y:u+l},{x:h+a,y:u+l-c},{x:h+a+c,y:u+l-c},{x:h+a+c,y:u-c},{x:h+c,y:u-c},{x:h+c,y:u},{x:h,y:u},{x:h,y:u+c}],g=[{x:h,y:u+c},{x:h+a-c,y:u+c},{x:h+a-c,y:u+l},{x:h+a,y:u+l},{x:h+a,y:u},{x:h,y:u}];e.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const y=Bt(m),b=f.path(y,p),x=Bt(g),S=f.path(x,{...p,fill:"none"}),k=i.insert(()=>S,":first-child");return k.insert(()=>b,":first-child"),k.attr("class","basic label-container"),d&&e.look!=="handDrawn"&&k.selectAll("path").attr("style",d),n&&e.look!=="handDrawn"&&k.selectAll("path").attr("style",n),o.attr("transform",`translate(${-(s.width/2)-c-(s.x-(s.left??0))}, ${-(s.height/2)+c-(s.y-(s.top??0))})`),Xe(e,k),e.intersect=function(w){return Re.polygon(e,m,w)},i}C(GY,"multiRect");async function KY(t,e){const{labelStyles:r,nodeStyles:n}=Ke(e);e.labelStyle=r;const{shapeSvg:i,bbox:s,label:o}=await dt(t,e,ct(e)),a=Math.max(s.width+(e.padding??0)*2,(e==null?void 0:e.width)??0),l=Math.max(s.height+(e.padding??0)*2,(e==null?void 0:e.height)??0),c=l/4,h=l+c,u=-a/2,d=-h/2,f=5,{cssStyles:p}=e,m=Mc(u-f,d+h+f,u+a-f,d+h+f,c,.8),g=m==null?void 0:m[m.length-1],y=[{x:u-f,y:d+f},{x:u-f,y:d+h+f},...m,{x:u+a-f,y:g.y-f},{x:u+a,y:g.y-f},{x:u+a,y:g.y-2*f},{x:u+a+f,y:g.y-2*f},{x:u+a+f,y:d-f},{x:u+f,y:d-f},{x:u+f,y:d},{x:u,y:d},{x:u,y:d+f}],b=[{x:u,y:d+f},{x:u+a-f,y:d+f},{x:u+a-f,y:g.y-f},{x:u+a,y:g.y-f},{x:u+a,y:d},{x:u,y:d}],x=je.svg(i),S=Ge(e,{});e.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");const k=Bt(y),w=x.path(k,S),_=Bt(b),L=x.path(_,S),B=i.insert(()=>w,":first-child");return B.insert(()=>L),B.attr("class","basic label-container"),p&&e.look!=="handDrawn"&&B.selectAll("path").attr("style",p),n&&e.look!=="handDrawn"&&B.selectAll("path").attr("style",n),B.attr("transform",`translate(0,${-c/2})`),o.attr("transform",`translate(${-(s.width/2)-f-(s.x-(s.left??0))}, ${-(s.height/2)+f-c/2-(s.y-(s.top??0))})`),Xe(e,B),e.intersect=function(E){return Re.polygon(e,y,E)},i}C(KY,"multiWaveEdgedRectangle");async function YY(t,e,{config:{themeVariables:r}}){var b;const{labelStyles:n,nodeStyles:i}=Ke(e);e.labelStyle=n,e.useHtmlLabels||((b=Hn().flowchart)==null?void 0:b.htmlLabels)!==!1||(e.centerLabel=!0);const{shapeSvg:o,bbox:a,label:l}=await dt(t,e,ct(e)),c=Math.max(a.width+(e.padding??0)*2,(e==null?void 0:e.width)??0),h=Math.max(a.height+(e.padding??0)*2,(e==null?void 0:e.height)??0),u=-c/2,d=-h/2,{cssStyles:f}=e,p=je.svg(o),m=Ge(e,{fill:r.noteBkgColor,stroke:r.noteBorderColor});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const g=p.rectangle(u,d,c,h,m),y=o.insert(()=>g,":first-child");return y.attr("class","basic label-container"),f&&e.look!=="handDrawn"&&y.selectAll("path").attr("style",f),i&&e.look!=="handDrawn"&&y.selectAll("path").attr("style",i),l.attr("transform",`translate(${-a.width/2-(a.x-(a.left??0))}, ${-(a.height/2)-(a.y-(a.top??0))})`),Xe(e,y),e.intersect=function(x){return Re.rect(e,x)},o}C(YY,"note");var pAe=C((t,e,r)=>[`M${t+r/2},${e}`,`L${t+r},${e-r/2}`,`L${t+r/2},${e-r}`,`L${t},${e-r/2}`,"Z"].join(" "),"createDecisionBoxPathD");async function XY(t,e){const{labelStyles:r,nodeStyles:n}=Ke(e);e.labelStyle=r;const{shapeSvg:i,bbox:s}=await dt(t,e,ct(e)),o=s.width+e.padding,a=s.height+e.padding,l=o+a,c=.5,h=[{x:l/2,y:0},{x:l,y:-l/2},{x:l/2,y:-l},{x:0,y:-l/2}];let u;const{cssStyles:d}=e;if(e.look==="handDrawn"){const f=je.svg(i),p=Ge(e,{}),m=pAe(0,0,l),g=f.path(m,p);u=i.insert(()=>g,":first-child").attr("transform",`translate(${-l/2+c}, ${l/2})`),d&&u.attr("style",d)}else u=zc(i,l,l,h),u.attr("transform",`translate(${-l/2+c}, ${l/2})`);return n&&u.attr("style",n),Xe(e,u),e.calcIntersect=function(f,p){const m=f.width,g=[{x:m/2,y:0},{x:m,y:-m/2},{x:m/2,y:-m},{x:0,y:-m/2}],y=Re.polygon(f,g,p);return{x:y.x-.5,y:y.y-.5}},e.intersect=function(f){return this.calcIntersect(e,f)},i}C(XY,"question");async function JY(t,e){const{labelStyles:r,nodeStyles:n}=Ke(e);e.labelStyle=r;const{shapeSvg:i,bbox:s,label:o}=await dt(t,e,ct(e)),a=Math.max(s.width+(e.padding??0),(e==null?void 0:e.width)??0),l=Math.max(s.height+(e.padding??0),(e==null?void 0:e.he
vendor: 4,543 bytes, line 1345
1345ight)??0),c=-a/2,h=-l/2,u=h/2,d=[{x:c+u,y:h},{x:c,y:0},{x:c+u,y:-h},{x:-c,y:-h},{x:-c,y:h}],{cssStyles:f}=e,p=je.svg(i),m=Ge(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const g=Bt(d),y=p.path(g,m),b=i.insert(()=>y,":first-child");return b.attr("class","basic label-container"),f&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",n),b.attr("transform",`translate(${-u/2},0)`),o.attr("transform",`translate(${-u/2-s.width/2-(s.x-(s.left??0))}, ${-(s.height/2)-(s.y-(s.top??0))})`),Xe(e,b),e.intersect=function(x){return Re.polygon(e,d,x)},i}C(JY,"rect_left_inv_arrow");async function ZY(t,e){var L,B;const{labelStyles:r,nodeStyles:n}=Ke(e);e.labelStyle=r;let i;e.cssClasses?i="node "+e.cssClasses:i="node default";const s=t.insert("g").attr("class",i).attr("id",e.domId||e.id),o=s.insert("g"),a=s.insert("g").attr("class","label").attr("style",n),l=e.description,c=e.label,h=a.node().appendChild(await Sh(c,e.labelStyle,!0,!0));let u={width:0,height:0};if(rn((B=(L=Zt())==null?void 0:L.flowchart)==null?void 0:B.htmlLabels)){const E=h.children[0],D=$t(h);u=E.getBoundingClientRect(),D.attr("width",u.width),D.attr("height",u.height)}de.info("Text 2",l);const d=l||[],f=h.getBBox(),p=a.node().appendChild(await Sh(d.join?d.join("<br/>"):d,e.labelStyle,!0,!0)),m=p.children[0],g=$t(p);u=m.getBoundingClientRect(),g.attr("width",u.width),g.attr("height",u.height);const y=(e.padding||0)/2;$t(p).attr("transform","translate( "+(u.width>f.width?0:(f.width-u.width)/2)+", "+(f.height+y+5)+")"),$t(h).attr("transform","translate( "+(u.width<f.width?0:-(f.width-u.width)/2)+", 0)"),u=a.node().getBBox(),a.attr("transform","translate("+-u.width/2+", "+(-u.height/2-y+3)+")");const b=u.width+(e.padding||0),x=u.height+(e.padding||0),S=-u.width/2-y,k=-u.height/2-y;let w,_;if(e.look==="handDrawn"){const E=je.svg(s),D=Ge(e,{}),N=E.path($c(S,k,b,x,e.rx||0),D),K=E.line(-u.width/2-y,-u.height/2-y+f.height+y,u.width/2+y,-u.height/2-y+f.height+y,D);_=s.insert(()=>(de.debug("Rough node insert CXC",N),K),":first-child"),w=s.insert(()=>(de.debug("Rough node insert CXC",N),N),":first-child")}else w=o.insert("rect",":first-child"),_=o.insert("line"),w.attr("class","outer title-state").attr("style",n).attr("x",-u.width/2-y).attr("y",-u.height/2-y).attr("width",u.width+(e.padding||0)).attr("height",u.height+(e.padding||0)),_.attr("class","divider").attr("x1",-u.width/2-y).attr("x2",u.width/2+y).attr("y1",-u.height/2-y+f.height+y).attr("y2",-u.height/2-y+f.height+y);return Xe(e,w),e.intersect=function(E){return Re.rect(e,E)},s}C(ZY,"rectWithTitle");function Gp(t,e,r,n,i,s,o){const l=(t+r)/2,c=(e+n)/2,h=Math.atan2(n-e,r-t),u=(r-t)/2,d=(n-e)/2,f=u/i,p=d/s,m=Math.sqrt(f**2+p**2);if(m>1)throw new Error("The given radii are too small to create an arc between the points.");const g=Math.sqrt(1-m**2),y=l+g*s*Math.sin(h)*(o?-1:1),b=c-g*i*Math.cos(h)*(o?-1:1),x=Math.atan2((e-b)/s,(t-y)/i);let k=Math.atan2((n-b)/s,(r-y)/i)-x;o&&k<0&&(k+=2*Math.PI),!o&&k>0&&(k-=2*Math.PI);const w=[];for(let _=0;_<20;_++){const L=_/19,B=x+L*k,E=y+i*Math.cos(B),D=b+s*Math.sin(B);w.push({x:E,y:D})}return w}C(Gp,"generateArcPoints");async function QY(t,e){const{labelStyles:r,nodeStyles:n}=Ke(e);e.labelStyle=r;const{shapeSvg:i,bbox:s}=await dt(t,e,ct(e)),o=(e==null?void 0:e.padding)??0,a=(e==null?void 0:e.padding)??0,l=(e!=null&&e.width?e==null?void 0:e.width:s.width)+o*2,c=(e!=null&&e.height?e==null?void 0:e.height:s.height)+a*2,h=e.radius||5,u=e.taper||5,{cssStyles:d}=e,f=je.svg(i),p=Ge(e,{});e.stroke&&(p.stroke=e.stroke),e.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const m=[{x:-l/2+u,y:-c/2},{x:l/2-u,y:-c/2},...Gp(l/2-u,-c/2,l/2,-c/2+u,h,h,!0),{x:l/2,y:-c/2+u},{x:l/2,y:c/2-u},...Gp(l/2,c/2-u,l/2-u,c/2,h,h,!0),{x:l/2-u,y:c/2},{x:-l/2+u,y:c/2},...Gp(-l/2+u,c/2,-l/2,c/2-u,h,h,!0),{x:-l/2,y:c/2-u},{x:-l/2,y:-c/2+u},...Gp(-l/2,-c/2+u,-l/2+u,-c/2,h,h,!0)],g=Bt(m),y=f.path(g,p),b=i.insert(()=>y,":first-child");return b.attr("class","basic label-container outer-path"),d&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",d),n&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),Xe(e,b),e.intersect=function(x){return Re.polygon(e,m,x)},i}C(QY,"roundedRect");async function eX(t,e){const{labelStyles:r,nodeStyles:n}=Ke(e);e.labelStyle=r;const{shapeSvg:i,bbox:s,label:o}=await dt(t,e,ct(e)),a=(e==null?void 0:e.padding)??0,l=Math.max(s.width+(e.padding??0)*2,(e==null?void 0:e.width)??0),c=Math.max(s.height+(e.padding??0)*2,(e==null?void 0:e.he
vendor: 32,985 bytes, lines 1345-1396
1345ight)??0),h=-s.width/2-a,u=-s.height/2-a,{cssStyles:d}=e,f=je.svg(i),p=Ge(e,{});e.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const m=[{x:h,y:u},{x:h+l+8,y:u},{x:h+l+8,y:u+c},{x:h-8,y:u+c},{x:h-8,y:u},{x:h,y:u},{x:h,y:u+c}],g=f.polygon(m.map(b=>[b.x,b.y]),p),y=i.insert(()=>g,":first-child");return y.attr("class","basic label-container").attr("style",Vn(d)),n&&e.look!=="handDrawn"&&y.selectAll("path").attr("style",n),d&&e.look!=="handDrawn"&&y.selectAll("path").attr("style",n),o.attr("transform",`translate(${-l/2+4+(e.padding??0)-(s.x-(s.left??0))},${-c/2+(e.padding??0)-(s.y-(s.top??0))})`),Xe(e,y),e.intersect=function(b){return Re.rect(e,b)},i}C(eX,"shadedProcess");async function tX(t,e){const{labelStyles:r,nodeStyles:n}=Ke(e);e.labelStyle=r;const{shapeSvg:i,bbox:s,label:o}=await dt(t,e,ct(e)),a=Math.max(s.width+(e.padding??0)*2,(e==null?void 0:e.width)??0),l=Math.max(s.height+(e.padding??0)*2,(e==null?void 0:e.height)??0),c=-a/2,h=-l/2,{cssStyles:u}=e,d=je.svg(i),f=Ge(e,{});e.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const p=[{x:c,y:h},{x:c,y:h+l},{x:c+a,y:h+l},{x:c+a,y:h-l/2}],m=Bt(p),g=d.path(m,f),y=i.insert(()=>g,":first-child");return y.attr("class","basic label-container"),u&&e.look!=="handDrawn"&&y.selectChildren("path").attr("style",u),n&&e.look!=="handDrawn"&&y.selectChildren("path").attr("style",n),y.attr("transform",`translate(0, ${l/4})`),o.attr("transform",`translate(${-a/2+(e.padding??0)-(s.x-(s.left??0))}, ${-l/4+(e.padding??0)-(s.y-(s.top??0))})`),Xe(e,y),e.intersect=function(b){return Re.polygon(e,p,b)},i}C(tX,"slopedRect");async function rX(t,e){const r={rx:0,ry:0,classes:"",labelPaddingX:e.labelPaddingX??((e==null?void 0:e.padding)||0)*2,labelPaddingY:((e==null?void 0:e.padding)||0)*1};return S4(t,e,r)}C(rX,"squareRect");async function nX(t,e){const{labelStyles:r,nodeStyles:n}=Ke(e);e.labelStyle=r;const{shapeSvg:i,bbox:s}=await dt(t,e,ct(e)),o=s.height+e.padding,a=s.width+o/4+e.padding,l=o/2,{cssStyles:c}=e,h=je.svg(i),u=Ge(e,{});e.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const d=[{x:-a/2+l,y:-o/2},{x:a/2-l,y:-o/2},...Ng(-a/2+l,0,l,50,90,270),{x:a/2-l,y:o/2},...Ng(a/2-l,0,l,50,270,450)],f=Bt(d),p=h.path(f,u),m=i.insert(()=>p,":first-child");return m.attr("class","basic label-container outer-path"),c&&e.look!=="handDrawn"&&m.selectChildren("path").attr("style",c),n&&e.look!=="handDrawn"&&m.selectChildren("path").attr("style",n),Xe(e,m),e.intersect=function(g){return Re.polygon(e,d,g)},i}C(nX,"stadium");async function iX(t,e){return S4(t,e,{rx:5,ry:5,classes:"flowchart-node"})}C(iX,"state");function sX(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=Ke(e);e.labelStyle=n;const{cssStyles:s}=e,{lineColor:o,stateBorder:a,nodeBorder:l}=r,c=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),h=je.svg(c),u=Ge(e,{});e.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const d=h.circle(0,0,14,{...u,stroke:o,strokeWidth:2}),f=a??l,p=h.circle(0,0,5,{...u,fill:f,stroke:f,strokeWidth:2,fillStyle:"solid"}),m=c.insert(()=>d,":first-child");return m.insert(()=>p),s&&m.selectAll("path").attr("style",s),i&&m.selectAll("path").attr("style",i),Xe(e,m),e.intersect=function(g){return Re.circle(e,7,g)},c}C(sX,"stateEnd");function oX(t,e,{config:{themeVariables:r}}){const{lineColor:n}=r,i=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let s;if(e.look==="handDrawn"){const a=je.svg(i).circle(0,0,14,t_e(n));s=i.insert(()=>a),s.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14)}else s=i.insert("circle",":first-child"),s.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14);return Xe(e,s),e.intersect=function(o){return Re.circle(e,7,o)},i}C(oX,"stateStart");async function aX(t,e){const{labelStyles:r,nodeStyles:n}=Ke(e);e.labelStyle=r;const{shapeSvg:i,bbox:s}=await dt(t,e,ct(e)),o=((e==null?void 0:e.padding)||0)/2,a=s.width+e.padding,l=s.height+e.padding,c=-s.width/2-o,h=-s.height/2-o,u=[{x:0,y:0},{x:a,y:0},{x:a,y:-l},{x:0,y:-l},{x:0,y:0},{x:-8,y:0},{x:a+8,y:0},{x:a+8,y:-l},{x:-8,y:-l},{x:-8,y:0}];if(e.look==="handDrawn"){const d=je.svg(i),f=Ge(e,{}),p=d.rectangle(c-8,h,a+16,l,f),m=d.line(c,h,c,h+l,f),g=d.line(c+a,h,c+a,h+l,f);i.insert(()=>m,":first-child"),i.insert(()=>g,":first-child");const y=i.insert(()=>p,":first-child"),{cssStyles:b}=e;y.attr("class","basic label-container").attr("style",Vn(b)),Xe(e,y)}else{const d=zc(i,a,l,u);n&&d.attr("style",n),Xe(e,d)}return e.intersect=function(d){return Re.polygon(e,u,d)},i}C(aX,"subroutine");async function lX(t,e){const{labelStyles:r,nodeStyles:n}=Ke(e);e.labelStyle=r;const{shapeSvg:i,bbox:s}=await dt(t,e,ct(e)),o=Math.max(s.width+(e.padding??0)*2,(e==null?void 0:e.width)??0),a=Math.max(s.height+(e.padding??0)*2,(e==null?void 0:e.height)??0),l=-o/2,c=-a/2,h=.2*a,u=.2*a,{cssStyles:d}=e,f=je.svg(i),p=Ge(e,{}),m=[{x:l-h/2,y:c},{x:l+o+h/2,y:c},{x:l+o+h/2,y:c+a},{x:l-h/2,y:c+a}],g=[{x:l+o-h/2,y:c+a},{x:l+o+h/2,y:c+a},{x:l+o+h/2,y:c+a-u}];e.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const y=Bt(m),b=f.path(y,p),x=Bt(g),S=f.path(x,{...p,fillStyle:"solid"}),k=i.insert(()=>S,":first-child");return k.insert(()=>b,":first-child"),k.attr("class","basic label-container"),d&&e.look!=="handDrawn"&&k.selectAll("path").attr("style",d),n&&e.look!=="handDrawn"&&k.selectAll("path").attr("style",n),Xe(e,k),e.intersect=function(w){return Re.polygon(e,m,w)},i}C(lX,"taggedRect");async function cX(t,e){const{labelStyles:r,nodeStyles:n}=Ke(e);e.labelStyle=r;const{shapeSvg:i,bbox:s,label:o}=await dt(t,e,ct(e)),a=Math.max(s.width+(e.padding??0)*2,(e==null?void 0:e.width)??0),l=Math.max(s.height+(e.padding??0)*2,(e==null?void 0:e.height)??0),c=l/4,h=.2*a,u=.2*l,d=l+c,{cssStyles:f}=e,p=je.svg(i),m=Ge(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const g=[{x:-a/2-a/2*.1,y:d/2},...Mc(-a/2-a/2*.1,d/2,a/2+a/2*.1,d/2,c,.8),{x:a/2+a/2*.1,y:-d/2},{x:-a/2-a/2*.1,y:-d/2}],y=-a/2+a/2*.1,b=-d/2-u*.4,x=[{x:y+a-h,y:(b+l)*1.4},{x:y+a,y:b+l-u},{x:y+a,y:(b+l)*.9},...Mc(y+a,(b+l)*1.3,y+a-h,(b+l)*1.5,-l*.03,.5)],S=Bt(g),k=p.path(S,m),w=Bt(x),_=p.path(w,{...m,fillStyle:"solid"}),L=i.insert(()=>_,":first-child");return L.insert(()=>k,":first-child"),L.attr("class","basic label-container"),f&&e.look!=="handDrawn"&&L.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&L.selectAll("path").attr("style",n),L.attr("transform",`translate(0,${-c/2})`),o.attr("transform",`translate(${-a/2+(e.padding??0)-(s.x-(s.left??0))},${-l/2+(e.padding??0)-c/2-(s.y-(s.top??0))})`),Xe(e,L),e.intersect=function(B){return Re.polygon(e,g,B)},i}C(cX,"taggedWaveEdgedRectangle");async function hX(t,e){const{labelStyles:r,nodeStyles:n}=Ke(e);e.labelStyle=r;const{shapeSvg:i,bbox:s}=await dt(t,e,ct(e)),o=Math.max(s.width+e.padding,(e==null?void 0:e.width)||0),a=Math.max(s.height+e.padding,(e==null?void 0:e.height)||0),l=-o/2,c=-a/2,h=i.insert("rect",":first-child");return h.attr("class","text").attr("style",n).attr("rx",0).attr("ry",0).attr("x",l).attr("y",c).attr("width",o).attr("height",a),Xe(e,h),e.intersect=function(u){return Re.rect(e,u)},i}C(hX,"text");var mAe=C((t,e,r,n,i,s)=>`M${t},${e}
1346    a${i},${s} 0,0,1 0,${-n}
1347    l${r},0
1348    a${i},${s} 0,0,1 0,${n}
1349    M${r},${-n}
1350    a${i},${s} 0,0,0 0,${n}
1351    l${-r},0`,"createCylinderPathD"),gAe=C((t,e,r,n,i,s)=>[`M${t},${e}`,`M${t+r},${e}`,`a${i},${s} 0,0,0 0,${-n}`,`l${-r},0`,`a${i},${s} 0,0,0 0,${n}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),yAe=C((t,e,r,n,i,s)=>[`M${t+r/2},${-n/2}`,`a${i},${s} 0,0,0 0,${n}`].join(" "),"createInnerCylinderPathD");async function uX(t,e){const{labelStyles:r,nodeStyles:n}=Ke(e);e.labelStyle=r;const{shapeSvg:i,bbox:s,label:o,halfPadding:a}=await dt(t,e,ct(e)),l=e.look==="neo"?a*2:a,c=s.height+l,h=c/2,u=h/(2.5+c/50),d=s.width+u+l,{cssStyles:f}=e;let p;if(e.look==="handDrawn"){const m=je.svg(i),g=gAe(0,0,d,c,u,h),y=yAe(0,0,d,c,u,h),b=m.path(g,Ge(e,{})),x=m.path(y,Ge(e,{fill:"none"}));p=i.insert(()=>x,":first-child"),p=i.insert(()=>b,":first-child"),p.attr("class","basic label-container"),f&&p.attr("style",f)}else{const m=mAe(0,0,d,c,u,h);p=i.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",Vn(f)).attr("style",n),p.attr("class","basic label-container"),f&&p.selectAll("path").attr("style",f),n&&p.selectAll("path").attr("style",n)}return p.attr("label-offset-x",u),p.attr("transform",`translate(${-d/2}, ${c/2} )`),o.attr("transform",`translate(${-(s.width/2)-u-(s.x-(s.left??0))}, ${-(s.height/2)-(s.y-(s.top??0))})`),Xe(e,p),e.intersect=function(m){const g=Re.rect(e,m),y=g.y-(e.y??0);if(h!=0&&(Math.abs(y)<(e.height??0)/2||Math.abs(y)==(e.height??0)/2&&Math.abs(g.x-(e.x??0))>(e.width??0)/2-u)){let b=u*u*(1-y*y/(h*h));b!=0&&(b=Math.sqrt(Math.abs(b))),b=u-b,m.x-(e.x??0)>0&&(b=-b),g.x+=b}return g},i}C(uX,"tiltedCylinder");async function dX(t,e){const{labelStyles:r,nodeStyles:n}=Ke(e);e.labelStyle=r;const{shapeSvg:i,bbox:s}=await dt(t,e,ct(e)),o=s.width+e.padding,a=s.height+e.padding,l=[{x:-3*a/6,y:0},{x:o+3*a/6,y:0},{x:o,y:-a},{x:0,y:-a}];let c;const{cssStyles:h}=e;if(e.look==="handDrawn"){const u=je.svg(i),d=Ge(e,{}),f=Bt(l),p=u.path(f,d);c=i.insert(()=>p,":first-child").attr("transform",`translate(${-o/2}, ${a/2})`),h&&c.attr("style",h)}else c=zc(i,o,a,l);return n&&c.attr("style",n),e.width=o,e.height=a,Xe(e,c),e.intersect=function(u){return Re.polygon(e,l,u)},i}C(dX,"trapezoid");async function fX(t,e){const{labelStyles:r,nodeStyles:n}=Ke(e);e.labelStyle=r;const{shapeSvg:i,bbox:s}=await dt(t,e,ct(e)),o=60,a=20,l=Math.max(o,s.width+(e.padding??0)*2,(e==null?void 0:e.width)??0),c=Math.max(a,s.height+(e.padding??0)*2,(e==null?void 0:e.height)??0),{cssStyles:h}=e,u=je.svg(i),d=Ge(e,{});e.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const f=[{x:-l/2*.8,y:-c/2},{x:l/2*.8,y:-c/2},{x:l/2,y:-c/2*.6},{x:l/2,y:c/2},{x:-l/2,y:c/2},{x:-l/2,y:-c/2*.6}],p=Bt(f),m=u.path(p,d),g=i.insert(()=>m,":first-child");return g.attr("class","basic label-container"),h&&e.look!=="handDrawn"&&g.selectChildren("path").attr("style",h),n&&e.look!=="handDrawn"&&g.selectChildren("path").attr("style",n),Xe(e,g),e.intersect=function(y){return Re.polygon(e,f,y)},i}C(fX,"trapezoidalPentagon");async function pX(t,e){var b;const{labelStyles:r,nodeStyles:n}=Ke(e);e.labelStyle=r;const{shapeSvg:i,bbox:s,label:o}=await dt(t,e,ct(e)),a=rn((b=Zt().flowchart)==null?void 0:b.htmlLabels),l=s.width+(e.padding??0),c=l+s.height,h=l+s.height,u=[{x:0,y:0},{x:h,y:0},{x:h/2,y:-c}],{cssStyles:d}=e,f=je.svg(i),p=Ge(e,{});e.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const m=Bt(u),g=f.path(m,p),y=i.insert(()=>g,":first-child").attr("transform",`translate(${-c/2}, ${c/2})`);return d&&e.look!=="handDrawn"&&y.selectChildren("path").attr("style",d),n&&e.look!=="handDrawn"&&y.selectChildren("path").attr("style",n),e.width=l,e.height=c,Xe(e,y),o.attr("transform",`translate(${-s.width/2-(s.x-(s.left??0))}, ${c/2-(s.height+(e.padding??0)/(a?2:1)-(s.y-(s.top??0)))})`),e.intersect=function(x){return de.info("Triangle intersect",e,u,x),Re.polygon(e,u,x)},i}C(pX,"triangle");async function mX(t,e){const{labelStyles:r,nodeStyles:n}=Ke(e);e.labelStyle=r;const{shapeSvg:i,bbox:s,label:o}=await dt(t,e,ct(e)),a=Math.max(s.width+(e.padding??0)*2,(e==null?void 0:e.width)??0),l=Math.max(s.height+(e.padding??0)*2,(e==null?void 0:e.height)??0),c=l/8,h=l+c,{cssStyles:u}=e,f=70-a,p=f>0?f/2:0,m=je.svg(i),g=Ge(e,{});e.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const y=[{x:-a/2-p,y:h/2},...Mc(-a/2-p,h/2,a/2+p,h/2,c,.8),{x:a/2+p,y:-h/2},{x:-a/2-p,y:-h/2}],b=Bt(y),x=m.path(b,g),S=i.insert(()=>x,":first-child");return S.attr("class","basic label-container"),u&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",u),n&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",n),S.attr("transform",`translate(0,${-c/2})`),o.attr("transform",`translate(${-a/2+(e.padding??0)-(s.x-(s.left??0))},${-l/2+(e.padding??0)-c-(s.y-(s.top??0))})`),Xe(e,S),e.intersect=function(k){return Re.polygon(e,y,k)},i}C(mX,"waveEdgedRectangle");async function gX(t,e){const{labelStyles:r,nodeStyles:n}=Ke(e);e.labelStyle=r;const{shapeSvg:i,bbox:s}=await dt(t,e,ct(e)),o=100,a=50,l=Math.max(s.width+(e.padding??0)*2,(e==null?void 0:e.width)??0),c=Math.max(s.height+(e.padding??0)*2,(e==null?void 0:e.height)??0),h=l/c;let u=l,d=c;u>d*h?d=u/h:u=d*h,u=Math.max(u,o),d=Math.max(d,a);const f=Math.min(d*.2,d/4),p=d+f*2,{cssStyles:m}=e,g=je.svg(i),y=Ge(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const b=[{x:-u/2,y:p/2},...Mc(-u/2,p/2,u/2,p/2,f,1),{x:u/2,y:-p/2},...Mc(u/2,-p/2,-u/2,-p/2,f,-1)],x=Bt(b),S=g.path(x,y),k=i.insert(()=>S,":first-child");return k.attr("class","basic label-container"),m&&e.look!=="handDrawn"&&k.selectAll("path").attr("style",m),n&&e.look!=="handDrawn"&&k.selectAll("path").attr("style",n),Xe(e,k),e.intersect=function(w){return Re.polygon(e,b,w)},i}C(gX,"waveRectangle");async function yX(t,e){const{labelStyles:r,nodeStyles:n}=Ke(e);e.labelStyle=r;const{shapeSvg:i,bbox:s,label:o}=await dt(t,e,ct(e)),a=Math.max(s.width+(e.padding??0)*2,(e==null?void 0:e.width)??0),l=Math.max(s.height+(e.padding??0)*2,(e==null?void 0:e.height)??0),c=5,h=-a/2,u=-l/2,{cssStyles:d}=e,f=je.svg(i),p=Ge(e,{}),m=[{x:h-c,y:u-c},{x:h-c,y:u+l},{x:h+a,y:u+l},{x:h+a,y:u-c}],g=`M${h-c},${u-c} L${h+a},${u-c} L${h+a},${u+l} L${h-c},${u+l} L${h-c},${u-c}
1352                M${h-c},${u} L${h+a},${u}
1353                M${h},${u-c} L${h},${u+l}`;e.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const y=f.path(g,p),b=i.insert(()=>y,":first-child");return b.attr("transform",`translate(${c/2}, ${c/2})`),b.attr("class","basic label-container"),d&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",d),n&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",n),o.attr("transform",`translate(${-(s.width/2)+c/2-(s.x-(s.left??0))}, ${-(s.height/2)+c/2-(s.y-(s.top??0))})`),Xe(e,b),e.intersect=function(x){return Re.polygon(e,m,x)},i}C(yX,"windowPane");async function f_(t,e){var Te,I,tt,qe;const r=e;if(r.alias&&(e.label=r.alias),e.look==="handDrawn"){const{themeVariables:Oe}=Hn(),{background:Ze}=Oe,vt={...e,id:e.id+"-background",look:"default",cssStyles:["stroke: none",`fill: ${Ze}`]};await f_(t,vt)}const n=Hn();e.useHtmlLabels=n.htmlLabels;let i=((Te=n.er)==null?void 0:Te.diagramPadding)??10,s=((I=n.er)==null?void 0:I.entityPadding)??6;const{cssStyles:o}=e,{labelStyles:a,nodeStyles:l}=Ke(e);if(r.attributes.length===0&&e.label){const Oe={rx:0,ry:0,labelPaddingX:i,labelPaddingY:i*1.5,classes:""};fl(e.label,n)+Oe.labelPaddingX*2<n.er.minEntityWidth&&(e.width=n.er.minEntityWidth);const Ze=await S4(t,e,Oe);if(!rn(n.htmlLabels)){const vt=Ze.select("text"),Ct=(tt=vt.node())==null?void 0:tt.getBBox();vt.attr("transform",`translate(${-Ct.width/2}, 0)`)}return Ze}n.htmlLabels||(i*=1.25,s*=1.25);let c=ct(e);c||(c="node default");const h=t.insert("g").attr("class",c).attr("id",e.domId||e.id),u=await hd(h,e.label??"",n,0,0,["name"],a);u.height+=s;let d=0;const f=[],p=[];let m=0,g=0,y=0,b=0,x=!0,S=!0;for(const Oe of r.attributes){const Ze=await hd(h,Oe.type,n,0,d,["attribute-type"],a);m=Math.max(m,Ze.width+i);const vt=await hd(h,Oe.name,n,0,d,["attribute-name"],a);g=Math.max(g,vt.width+i);const Ct=await hd(h,Oe.keys.join(),n,0,d,["attribute-keys"],a);y=Math.max(y,Ct.width+i);const wt=await hd(h,Oe.comment,n,0,d,["attribute-comment"],a);b=Math.max(b,wt.width+i);const zt=Math.max(Ze.height,vt.height,Ct.height,wt.height)+s;p.push({yOffset:d,rowHeight:zt}),d+=zt}let k=4;y<=i&&(x=!1,y=0,k--),b<=i&&(S=!1,b=0,k--);const w=h.node().getBBox();if(u.width+i*2-(m+g+y+b)>0){const Oe=u.width+i*2-(m+g+y+b);m+=Oe/k,g+=Oe/k,y>0&&(y+=Oe/k),b>0&&(b+=Oe/k)}const _=m+g+y+b,L=je.svg(h),B=Ge(e,{});e.look!=="handDrawn"&&(B.roughness=0,B.fillStyle="solid");let E=0;p.length>0&&(E=p.reduce((Oe,Ze)=>Oe+((Ze==null?void 0:Ze.rowHeight)??0),0));const D=Math.max(w.width+i*2,(e==null?void 0:e.width)||0,_),N=Math.max((E??0)+u.height,(e==null?void 0:e.height)||0),K=-D/2,z=-N/2;h.selectAll("g:not(:first-child)").each((Oe,Ze,vt)=>{const Ct=$t(vt[Ze]),wt=Ct.attr("transform");let zt=0,gr=0;if(wt){const W=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(wt);W&&(zt=parseFloat(W[1]),gr=parseFloat(W[2]),Ct.attr("class").includes("attribute-name")?zt+=m:Ct.attr("class").includes("attribute-keys")?zt+=m+g:Ct.attr("class").includes("attribute-comment")&&(zt+=m+g+y))}Ct.attr("transform",`translate(${K+i/2+zt}, ${gr+z+u.height+s/2})`)}),h.select(".name").attr("transform","translate("+-u.width/2+", "+(z+s/2)+")");const $=L.rectangle(K,z,D,N,B),H=h.insert(()=>$,":first-child").attr("style",o.join("")),{themeVariables:j}=Hn(),{rowEven:q,rowOdd:ne,nodeBorder:O}=j;f.push(0);for(const[Oe,Ze]of p.entries()){const Ct=(Oe+1)%2===0&&Ze.yOffset!==0,wt=L.rectangle(K,u.height+z+(Ze==null?void 0:Ze.yOffset),D,Ze==null?void 0:Ze.rowHeight,{...B,fill:Ct?q:ne,stroke:O});h.insert(()=>wt,"g.label").attr("style",o.join("")).attr("class",`row-rect-${Ct?"even":"odd"}`)}let fe=L.line(K,u.height+z,D+K,u.height+z,B);h.insert(()=>fe).attr("class","divider"),fe=L.line(m+K,u.height+z,m+K,N+z,B),h.insert(()=>fe).attr("class","divider"),x&&(fe=L.line(m+g+K,u.height+z,m+g+K,N+z,B),h.insert(()=>fe).attr("class","divider")),S&&(fe=L.line(m+g+y+K,u.height+z,m+g+y+K,N+z,B),h.insert(()=>fe).attr("class","divider"));for(const Oe of f)fe=L.line(K,u.height+z+Oe,D+K,u.height+z+Oe,B),h.insert(()=>fe).attr("class","divider");if(Xe(e,H),l&&e.look!=="handDrawn"){const Oe=l.split(";"),Ze=(qe=Oe==null?void 0:Oe.filter(vt=>vt.includes("stroke")))==null?void 0:qe.map(vt=>`${vt}`).join("; ");h.selectAll("path").attr("style",Ze??""),h.selectAll(".row-rect-even path").attr("style",l)}return e.intersect=function(Oe){return Re.rect(e,Oe)},h}C(f_,"erBox");async function hd(t,e,r,n=0,i=0,s=[],o=""){const a=t.insert("g").attr("class",`label ${s.join(" ")}`).attr("transform",`translate(${n}, ${i})`).attr("style",o);e!==vI(e)&&(e=vI(e),e=e.replaceAll("<","&lt;").replaceAll(">","&gt;"));const l=a.node().appendChild(await Fc(a,e,{width:fl(e,r)+100,style:o,useHtmlLabels:r.htmlLabels},r));if(e.includes("&lt;")||e.includes("&gt;")){let h=l.children[0];for(h.textContent=h.textContent.replaceAll("&lt;","<").replaceAll("&gt;",">");h.childNodes[0];)h=h.childNodes[0],h.textContent=h.textContent.replaceAll("&lt;","<").replaceAll("&gt;",">")}let c=l.getBBox();if(rn(r.htmlLabels)){const h=l.children[0];h.style.textAlign="start";const u=$t(l);c=h.getBoundingClientRect(),u.attr("width",c.width),u.attr("height",c.height)}return c}C(hd,"addText");async function bX(t,e,r,n,i=r.class.padding??12){const s=n?0:3,o=t.insert("g").attr("class",ct(e)).attr("id",e.domId||e.id);let a=null,l=null,c=null,h=null,u=0,d=0,f=0;if(a=o.insert("g").attr("class","annotation-group text"),e.annotations.length>0){const b=e.annotations[0];await Kp(a,{text:`«${b}»`},0),u=a.node().getBBox().height}l=o.insert("g").attr("class","label-group text"),await Kp(l,e,0,["font-weight: bolder"]);const p=l.node().getBBox();d=p.height,c=o.insert("g").attr("class","members-group text");let m=0;for(const b of e.members){const x=await Kp(c,b,m,[b.parseClassifier()]);m+=x+s}f=c.node().getBBox().height,f<=0&&(f=i/2),h=o.insert("g").attr("class","methods-group text");let g=0;for(const b of e.methods){const x=await Kp(h,b,g,[b.parseClassifier()]);g+=x+s}let y=o.node().getBBox();if(a!==null){const b=a.node().getBBox();a.attr("transform",`translate(${-b.width/2})`)}return l.attr("transform",`translate(${-p.width/2}, ${u})`),y=o.node().getBBox(),c.attr("transform",`translate(0, ${u+d+i*2})`),y=o.node().getBBox(),h.attr("transform",`translate(0, ${u+d+(f?f+i*4:i*2)})`),y=o.node().getBBox(),{shapeSvg:o,bbox:y}}C(bX,"textHelper");async function Kp(t,e,r,n=[]){const i=t.insert("g").attr("class","label").attr("style",n.join("; ")),s=Hn();let o="useHtmlLabels"in e?e.useHtmlLabels:rn(s.htmlLabels)??!0,a="";"text"in e?a=e.text:a=e.label,!o&&a.startsWith("\\")&&(a=a.substring(1)),Nf(a)&&(o=!0);const l=await Fc(i,_T(Ru(a)),{width:fl(a,s)+50,classes:"markdown-node-label",useHtmlLabels:o},s);let c,h=1;if(o){const u=l.children[0],d=$t(l);h=u.innerHTML.split("<br>").length,u.innerHTML.includes("</math>")&&(h+=u.innerHTML.split("<mrow>").length-1);const f=u.getElementsByTagName("img");if(f){const p=a.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...f].map(m=>new Promise(g=>{function y(){var b;if(m.style.display="flex",m.style.flexDirection="column",p){const x=((b=s.fontSize)==null?void 0:b.toString())??window.getComputedStyle(document.body).fontSize,k=parseInt(x,10)*5+"px";m.style.minWidth=k,m.style.maxWidth=k}else m.style.width="100%";g(m)}C(y,"setupImage"),setTimeout(()=>{m.complete&&y()}),m.addEventListener("error",y),m.addEventListener("load",y)})))}c=u.getBoundingClientRect(),d.attr("width",c.width),d.attr("height",c.height)}else{n.includes("font-weight: bolder")&&$t(l).selectAll("tspan").attr("font-weight",""),h=l.children.length;const u=l.children[0];(l.textContent===""||l.textContent.includes("&gt"))&&(u.textContent=a[0]+a.substring(1).replaceAll("&gt;",">").replaceAll("&lt;","<").trim(),a[1]===" "&&(u.textContent=u.textContent[0]+" "+u.textContent.substring(1))),u.textContent==="undefined"&&(u.textContent=""),c=l.getBBox()}return i.attr("transform","translate(0,"+(-c.height/(2*h)+r)+")"),c.height}C(Kp,"addText");async function xX(t,e){var B,E;const r=Zt(),n=r.class.padding??12,i=n,s=e.useHtmlLabels??rn(r.htmlLabels)??!0,o=e;o.annotations=o.annotations??[],o.members=o.members??[],o.methods=o.methods??[];const{shapeSvg:a,bbox:l}=await bX(t,e,r,s,i),{labelStyles:c,nodeStyles:h}=Ke(e);e.labelStyle=c,e.cssStyles=o.styles||"";const u=((B=o.styles)==null?void 0:B.join(";"))||h||"";e.cssStyles||(e.cssStyles=u.replaceAll("!important","").split(";"));const d=o.members.length===0&&o.methods.length===0&&!((E=r.class)!=null&&E.hideEmptyMembersBox),f=je.svg(a),p=Ge(e,{});e.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const m=l.width;let g=l.height;o.members.length===0&&o.methods.length===0?g+=i:o.members.length>0&&o.methods.length===0&&(g+=i*2);const y=-m/2,b=-g/2,x=f.rectangle(y-n,b-n-(d?n:o.members.length===0&&o.methods.length===0?-n/2:0),m+2*n,g+2*n+(d?n*2:o.members.length===0&&o.methods.length===0?-n:0),p),S=a.insert(()=>x,":first-child");S.attr("class","basic label-container");const k=S.node().getBBox();a.selectAll(".text").each((D,N,K)=>{var ne;const z=$t(K[N]),$=z.attr("transform");let H=0;if($){const fe=RegExp(/translate\(([^,]+),([^)]+)\)/).exec($);fe&&(H=parseFloat(fe[2]))}let j=H+b+n-(d?n:o.members.length===0&&o.methods.length===0?-n/2:0);s||(j-=4);let q=y;(z.attr("class").includes("label-group")||z.attr("class").includes("annotation-group"))&&(q=-((ne=z.node())==null?void 0:ne.getBBox().width)/2||0,a.selectAll("text").each(function(O,fe,Te){window.getComputedStyle(Te[fe]).textAnchor==="middle"&&(q=0)})),z.attr("transform",`translate(${q}, ${j})`)});const w=a.select(".annotation-group").node().getBBox().height-(d?n/2:0)||0,_=a.select(".label-group").node().getBBox().height-(d?n/2:0)||0,L=a.select(".members-group").node().getBBox().height-(d?n/2:0)||0;if(o.members.length>0||o.methods.length>0||d){const D=f.line(k.x,w+_+b+n,k.x+k.width,w+_+b+n,p);a.insert(()=>D).attr("class","divider").attr("style",u)}if(d||o.members.length>0||o.methods.length>0){const D=f.line(k.x,w+_+L+b+i*2+n,k.x+k.width,w+_+L+b+n+i*2,p);a.insert(()=>D).attr("class","divider").attr("style",u)}if(o.look!=="handDrawn"&&a.selectAll("path").attr("style",u),S.select(":nth-child(2)").attr("style",u),a.selectAll(".divider").select("path").attr("style",u),e.labelStyle?a.selectAll("span").attr("style",e.labelStyle):a.selectAll("span").attr("style",u),!s){const D=RegExp(/color\s*:\s*([^;]*)/),N=D.exec(u);if(N){const K=N[0].replace("color","fill");a.selectAll("tspan").attr("style",K)}else if(c){const K=D.exec(c);if(K){const z=K[0].replace("color","fill");a.selectAll("tspan").attr("style",z)}}}return Xe(e,S),e.intersect=function(D){return Re.rect(e,D)},a}C(xX,"classBox");async function vX(t,e){var w,_;const{labelStyles:r,nodeStyles:n}=Ke(e);e.labelStyle=r;const i=e,s=e,o=20,a=20,l="verifyMethod"in e,c=ct(e),h=t.insert("g").attr("class",c).attr("id",e.domId??e.id);let u;l?u=await Lo(h,`&lt;&lt;${i.type}&gt;&gt;`,0,e.labelStyle):u=await Lo(h,"&lt;&lt;Element&gt;&gt;",0,e.labelStyle);let d=u;const f=await Lo(h,i.name,d,e.labelStyle+"; font-weight: bold;");if(d+=f+a,l){const L=await Lo(h,`${i.requirementId?`ID: ${i.requirementId}`:""}`,d,e.labelStyle);d+=L;const B=await Lo(h,`${i.text?`Text: ${i.text}`:""}`,d,e.labelStyle);d+=B;const E=await Lo(h,`${i.risk?`Risk: ${i.risk}`:""}`,d,e.labelStyle);d+=E,await Lo(h,`${i.verifyMethod?`Verification: ${i.verifyMethod}`:""}`,d,e.labelStyle)}else{const L=await Lo(h,`${s.type?`Type: ${s.type}`:""}`,d,e.labelStyle);d+=L,await Lo(h,`${s.docRef?`Doc Ref: ${s.docRef}`:""}`,d,e.labelStyle)}const p=(((w=h.node())==null?void 0:w.getBBox().width)??200)+o,m=(((_=h.node())==null?void 0:_.getBBox().height)??200)+o,g=-p/2,y=-m/2,b=je.svg(h),x=Ge(e,{});e.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const S=b.rectangle(g,y,p,m,x),k=h.insert(()=>S,":first-child");if(k.attr("class","basic label-container").attr("style",n),h.selectAll(".label").each((L,B,E)=>{const D=$t(E[B]),N=D.attr("transform");let K=0,z=0;if(N){const q=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(N);q&&(K=parseFloat(q[1]),z=parseFloat(q[2]))}const $=z-m/2;let H=g+o/2;(B===0||B===1)&&(H=K),D.attr("transform",`translate(${H}, ${$+o})`)}),d>u+f+a){const L=b.line(g,y+u+f+a,g+p,y+u+f+a,x);h.insert(()=>L).attr("style",n)}return Xe(e,k),e.intersect=function(L){return Re.rect(e,L)},h}C(vX,"requirementBox");async function Lo(t,e,r,n=""){if(e==="")return 0;const i=t.insert("g").attr("class","label").attr("style",n),s=Zt(),o=s.htmlLabels??!0,a=await Fc(i,_T(Ru(e)),{width:fl(e,s)+50,classes:"markdown-node-label",useHtmlLabels:o,style:n},s);let l;if(o){const c=a.children[0],h=$t(a);l=c.getBoundingClientRect(),h.attr("width",l.width),h.attr("height",l.height)}else{const c=a.children[0];for(const h of c.children)h.textContent=h.textContent.replaceAll("&gt;",">").replaceAll("&lt;","<"),n&&h.setAttribute("style",n);l=a.getBBox(),l.height+=6}return i.attr("transform",`translate(${-l.width/2},${-l.height/2+r})`),l.height}C(Lo,"addText");var bAe=C(t=>{switch(t){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}},"colorFromPriority");async function wX(t,e,{config:r}){var N,K;const{labelStyles:n,nodeStyles:i}=Ke(e);e.labelStyle=n||"";const s=10,o=e.width;e.width=(e.width??200)-10;const{shapeSvg:a,bbox:l,label:c}=await dt(t,e,ct(e)),h=e.padding||10;let u="",d;"ticket"in e&&e.ticket&&((N=r==null?void 0:r.kanban)!=null&&N.ticketBaseUrl)&&(u=(K=r==null?void 0:r.kanban)==null?void 0:K.ticketBaseUrl.replace("#TICKET#",e.ticket),d=a.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",u).attr("target","_blank"));const f={useHtmlLabels:e.useHtmlLabels,labelStyle:e.labelStyle||"",width:e.width,img:e.img,padding:e.padding||8,centerLabel:!1};let p,m;d?{label:p,bbox:m}=await qk(d,"ticket"in e&&e.ticket||"",f):{label:p,bbox:m}=await qk(a,"ticket"in e&&e.ticket||"",f);const{label:g,bbox:y}=await qk(a,"assigned"in e&&e.assigned||"",f);e.width=o;const b=10,x=(e==null?void 0:e.width)||0,S=Math.max(m.height,y.height)/2,k=Math.max(l.height+b*2,(e==null?void 0:e.height)||0)+S,w=-x/2,_=-k/2;c.attr("transform","translate("+(h-x/2)+", "+(-S-l.height/2)+")"),p.attr("transform","translate("+(h-x/2)+", "+(-S+l.height/2)+")"),g.attr("transform","translate("+(h+x/2-y.width-2*s)+", "+(-S+l.height/2)+")");let L;const{rx:B,ry:E}=e,{cssStyles:D}=e;if(e.look==="handDrawn"){const z=je.svg(a),$=Ge(e,{}),H=B||E?z.path($c(w,_,x,k,B||0),$):z.rectangle(w,_,x,k,$);L=a.insert(()=>H,":first-child"),L.attr("class","basic label-container").attr("style",D||null)}else{L=a.insert("rect",":first-child"),L.attr("class","basic label-container __APA__").attr("style",i).attr("rx",B??5).attr("ry",E??5).attr("x",w).attr("y",_).attr("width",x).attr("height",k);const z="priority"in e&&e.priority;if(z){const $=a.append("line"),H=w+2,j=_+Math.floor((B??0)/2),q=_+k-Math.floor((B??0)/2);$.attr("x1",H).attr("y1",j).attr("x2",H).attr("y2",q).attr("stroke-width","4").attr("stroke",bAe(z))}}return Xe(e,L),e.height=k,e.intersect=function(z){return Re.rect(e,z)},a}C(wX,"kanbanItem");async function kX(t,e){const{labelStyles:r,nodeStyles:n}=Ke(e);e.labelStyle=r;const{shapeSvg:i,bbox:s,halfPadding:o,label:a}=await dt(t,e,ct(e)),l=s.width+10*o,c=s.height+8*o,h=.15*l,{cssStyles:u}=e,d=s.width+20,f=s.height+20,p=Math.max(l,d),m=Math.max(c,f);a.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`);let g;const y=`M0 0 
1354    a${h},${h} 1 0,0 ${p*.25},${-1*m*.1}
1355    a${h},${h} 1 0,0 ${p*.25},0
1356    a${h},${h} 1 0,0 ${p*.25},0
1357    a${h},${h} 1 0,0 ${p*.25},${m*.1}
1358
1359    a${h},${h} 1 0,0 ${p*.15},${m*.33}
1360    a${h*.8},${h*.8} 1 0,0 0,${m*.34}
1361    a${h},${h} 1 0,0 ${-1*p*.15},${m*.33}
1362
1363    a${h},${h} 1 0,0 ${-1*p*.25},${m*.15}
1364    a${h},${h} 1 0,0 ${-1*p*.25},0
1365    a${h},${h} 1 0,0 ${-1*p*.25},0
1366    a${h},${h} 1 0,0 ${-1*p*.25},${-1*m*.15}
1367
1368    a${h},${h} 1 0,0 ${-1*p*.1},${-1*m*.33}
1369    a${h*.8},${h*.8} 1 0,0 0,${-1*m*.34}
1370    a${h},${h} 1 0,0 ${p*.1},${-1*m*.33}
1371  H0 V0 Z`;if(e.look==="handDrawn"){const b=je.svg(i),x=Ge(e,{}),S=b.path(y,x);g=i.insert(()=>S,":first-child"),g.attr("class","basic label-container").attr("style",Vn(u))}else g=i.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",y);return g.attr("transform",`translate(${-p/2}, ${-m/2})`),Xe(e,g),e.calcIntersect=function(b,x){return Re.rect(b,x)},e.intersect=function(b){return de.info("Bang intersect",e,b),Re.rect(e,b)},i}C(kX,"bang");async function CX(t,e){const{labelStyles:r,nodeStyles:n}=Ke(e);e.labelStyle=r;const{shapeSvg:i,bbox:s,halfPadding:o,label:a}=await dt(t,e,ct(e)),l=s.width+2*o,c=s.height+2*o,h=.15*l,u=.25*l,d=.35*l,f=.2*l,{cssStyles:p}=e;let m;const g=`M0 0 
1372    a${h},${h} 0 0,1 ${l*.25},${-1*l*.1}
1373    a${d},${d} 1 0,1 ${l*.4},${-1*l*.1}
1374    a${u},${u} 1 0,1 ${l*.35},${l*.2}
1375
1376    a${h},${h} 1 0,1 ${l*.15},${c*.35}
1377    a${f},${f} 1 0,1 ${-1*l*.15},${c*.65}
1378
1379    a${u},${h} 1 0,1 ${-1*l*.25},${l*.15}
1380    a${d},${d} 1 0,1 ${-1*l*.5},0
1381    a${h},${h} 1 0,1 ${-1*l*.25},${-1*l*.15}
1382
1383    a${h},${h} 1 0,1 ${-1*l*.1},${-1*c*.35}
1384    a${f},${f} 1 0,1 ${l*.1},${-1*c*.65}
1385  H0 V0 Z`;if(e.look==="handDrawn"){const y=je.svg(i),b=Ge(e,{}),x=y.path(g,b);m=i.insert(()=>x,":first-child"),m.attr("class","basic label-container").attr("style",Vn(p))}else m=i.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",g);return a.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`),m.attr("transform",`translate(${-l/2}, ${-c/2})`),Xe(e,m),e.calcIntersect=function(y,b){return Re.rect(y,b)},e.intersect=function(y){return de.info("Cloud intersect",e,y),Re.rect(e,y)},i}C(CX,"cloud");async function SX(t,e){const{labelStyles:r,nodeStyles:n}=Ke(e);e.labelStyle=r;const{shapeSvg:i,bbox:s,halfPadding:o,label:a}=await dt(t,e,ct(e)),l=s.width+8*o,c=s.height+2*o,h=5,u=`
1386    M${-l/2} ${c/2-h}
1387    v${-c+2*h}
1388    q0,-${h} ${h},-${h}
1389    h${l-2*h}
1390    q${h},0 ${h},${h}
1391    v${c-2*h}
1392    q0,${h} -${h},${h}
1393    h${-l+2*h}
1394    q-${h},0 -${h},-${h}
1395    Z
1396  `,d=i.append("path").attr("id","node-"+e.id).attr("class","node-bkg node-"+e.type).attr("style",n).attr("d",u);return i.append("line").attr("class","node-line-").attr("x1",-l/2).attr("y1",c/2).attr("x2",l/2).attr("y2",c/2),a.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`),i.append(()=>a.node()),Xe(e,d),e.calcIntersect=function(f,p){return Re.rect(f,p)},e.intersect=function(f){return Re.rect(e,f)},i}C(SX,"defaultMindmapNode");async function TX(t,e){const r={padding:e.padding??0};return d_(t,e,r)}C(TX,"mindmapCircle");var xAe=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:rX},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:QY},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:nX},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:aX},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:_Y},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:d_},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:kX},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:CX}
1396,{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:XY},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:IY},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:VY},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:qY},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:dX},{semanticName:"Manual Operation",name:"Trapezoid Base Top",shortName:"trap-t",description:"Represents a manual task",aliases:["manual","trapezoid-top","inv-trapezoid"],internalAliases:["inv_trapezoid"],handler:zY},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:AY},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:hX}
1396,{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:bY},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:eX},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:oX},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:sX},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:LY},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:BY},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:kY},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:CY},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:SY},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:WY}
vendor: 4,282 bytes, line 1396
1396,{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:mX},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:DY},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:uX},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:jY},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:TY},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:MY},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:pX},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:yX},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:EY},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:fX},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:OY},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:tX},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:KY},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:GY},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:yY},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:wY},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:cX},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:lX},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:gX},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:JY},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:UY}],vAe=C(()=>{const e=[...Object.entries({state:iX,choice:xY,note:YY,rectWithTitle:ZY,labelRect:HY,iconSquare:FY,iconCircle:PY,icon:RY,iconRounded:NY,imageSquare:$Y,anchor:gY,kanbanItem:wX,mindmapCircle:TX,defaultMindmapNode:SX,classBox:xX,erBox:f_,requirementBox:vX}),...xAe.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(i=>[i,r.handler]))];return Object.fromEntries(e)},"generateShapeMap"),_X=vAe();function wAe(t){return t in _X}C(wAe,"isValidShape");var T4=new Map;async function MX(t,e,r){let n,i;e.shape==="rect"&&(e.rx&&e.ry?e.shape="roundedRect":e.shape="squareRect");const s=e.shape?_X[e.shape]:void 0;if(!s)throw new Error(`No such shape: ${e.shape}. Please check your syntax.`);if(e.link){let o;r.config.securityLevel==="sandbox"?o="_top":e.linkTarget&&(o=e.linkTarget||"_blank"),n=t.insert("svg:a").attr("xlink:href",e.link).attr("target",o??null),i=await s(n,e,r)}else i=await s(t,e,r),n=i;return e.tooltip&&i.attr("title",e.tooltip),T4.set(e.id,n),e.haveCallback&&n.attr("class",n.attr("class")+" clickable"),n}
vendor: 10,393 bytes, lines 1396-1399
1396C(MX,"insertNode");var XDe=C((t,e)=>{T4.set(e.id,t)},"setNodeElem"),JDe=C(()=>{T4.clear()},"clear"),ZDe=C(t=>{const e=T4.get(t.id);de.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");const r=8,n=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+n-t.width/2)+", "+(t.y-t.height/2-r)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),n},"positionNode"),kAe=C((t,e,r,n,i,s)=>{e.arrowTypeStart&&pB(t,"start",e.arrowTypeStart,r,n,i,s),e.arrowTypeEnd&&pB(t,"end",e.arrowTypeEnd,r,n,i,s)},"addEdgeMarkers"),CAe={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_circle:{type:"circle",fill:!1},aggregation:{type:"aggregation",fill:!1},extension:{type:"extension",fill:!1},composition:{type:"composition",fill:!0},dependency:{type:"dependency",fill:!0},lollipop:{type:"lollipop",fill:!1},only_one:{type:"onlyOne",fill:!1},zero_or_one:{type:"zeroOrOne",fill:!1},one_or_more:{type:"oneOrMore",fill:!1},zero_or_more:{type:"zeroOrMore",fill:!1},requirement_arrow:{type:"requirement_arrow",fill:!1},requirement_contains:{type:"requirement_contains",fill:!1}},pB=C((t,e,r,n,i,s,o)=>{var u;const a=CAe[r];if(!a){de.warn(`Unknown arrow type: ${r}`);return}const l=a.type,h=`${i}_${s}-${l}${e==="start"?"Start":"End"}`;if(o&&o.trim()!==""){const d=o.replace(/[^\dA-Za-z]/g,"_"),f=`${h}_${d}`;if(!document.getElementById(f)){const p=document.getElementById(h);if(p){const m=p.cloneNode(!0);m.id=f,m.querySelectorAll("path, circle, line").forEach(y=>{y.setAttribute("stroke",o),a.fill&&y.setAttribute("fill",o)}),(u=p.parentNode)==null||u.appendChild(m)}}t.attr(`marker-${e}`,`url(${n}#${f})`)}else t.attr(`marker-${e}`,`url(${n}#${h})`)},"addEdgeMarker"),vv=new Map,xn=new Map,QDe=C(()=>{vv.clear(),xn.clear()},"clear"),g2=C(t=>t?t.reduce((r,n)=>r+";"+n,""):"","getLabelStyles"),SAe=C(async(t,e)=>{let r=rn(Zt().flowchart.htmlLabels);const{labelStyles:n}=Ke(e);e.labelStyle=n;const i=await Fc(t,e.label,{style:e.labelStyle,useHtmlLabels:r,addSvgBackground:!0,isNode:!1});de.info("abc82",e,e.labelType);const s=t.insert("g").attr("class","edgeLabel"),o=s.insert("g").attr("class","label").attr("data-id",e.id);o.node().appendChild(i);let a=i.getBBox();if(r){const c=i.children[0],h=$t(i);a=c.getBoundingClientRect(),h.attr("width",a.width),h.attr("height",a.height)}o.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),vv.set(e.id,s),e.width=a.width,e.height=a.height;let l;if(e.startLabelLeft){const c=await Sh(e.startLabelLeft,g2(e.labelStyle)),h=t.insert("g").attr("class","edgeTerminals"),u=h.insert("g").attr("class","inner");l=u.node().appendChild(c);const d=c.getBBox();u.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),xn.get(e.id)||xn.set(e.id,{}),xn.get(e.id).startLeft=h,Yp(l,e.startLabelLeft)}if(e.startLabelRight){const c=await Sh(e.startLabelRight,g2(e.labelStyle)),h=t.insert("g").attr("class","edgeTerminals"),u=h.insert("g").attr("class","inner");l=h.node().appendChild(c),u.node().appendChild(c);const d=c.getBBox();u.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),xn.get(e.id)||xn.set(e.id,{}),xn.get(e.id).startRight=h,Yp(l,e.startLabelRight)}if(e.endLabelLeft){const c=await Sh(e.endLabelLeft,g2(e.labelStyle)),h=t.insert("g").attr("class","edgeTerminals"),u=h.insert("g").attr("class","inner");l=u.node().appendChild(c);const d=c.getBBox();u.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),h.node().appendChild(c),xn.get(e.id)||xn.set(e.id,{}),xn.get(e.id).endLeft=h,Yp(l,e.endLabelLeft)}if(e.endLabelRight){const c=await Sh(e.endLabelRight,g2(e.labelStyle)),h=t.insert("g").attr("class","edgeTerminals"),u=h.insert("g").attr("class","inner");l=u.node().appendChild(c);const d=c.getBBox();u.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),h.node().appendChild(c),xn.get(e.id)||xn.set(e.id,{}),xn.get(e.id).endRight=h,Yp(l,e.endLabelRight)}return i},"insertEdgeLabel");function Yp(t,e){Zt().flowchart.htmlLabels&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}C(Yp,"setTerminalWidth");var TAe=C((t,e)=>{de.debug("Moving label abc88 ",t.id,t.label,vv.get(t.id),e);let r=e.updatedPath?e.updatedPath:e.originalPath;const n=Zt(),{subGraphTitleTotalMargin:i}=UT(n);if(t.label){const s=vv.get(t.id);let o=t.x,a=t.y;if(r){const l=Js.calcLabelPosition(r);de.debug("Moving label "+t.label+" from (",o,",",a,") to (",l.x,",",l.y,") abc88"),e.updatedPath&&(o=l.x,a=l.y)}s.attr("transform",`translate(${o}, ${a+i/2})`)}if(t.startLabelLeft){const s=xn.get(t.id).startLeft;let o=t.x,a=t.y;if(r){const l=Js.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);o=l.x,a=l.y}s.attr("transform",`translate(${o}, ${a})`)}if(t.startLabelRight){const s=xn.get(t.id).startRight;let o=t.x,a=t.y;if(r){const l=Js.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);o=l.x,a=l.y}s.attr("transform",`translate(${o}, ${a})`)}if(t.endLabelLeft){const s=xn.get(t.id).endLeft;let o=t.x,a=t.y;if(r){const l=Js.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);o=l.x,a=l.y}s.attr("transform",`translate(${o}, ${a})`)}if(t.endLabelRight){const s=xn.get(t.id).endRight;let o=t.x,a=t.y;if(r){const l=Js.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);o=l.x,a=l.y}s.attr("transform",`translate(${o}, ${a})`)}},"positionEdgeLabel"),_Ae=C((t,e)=>{const r=t.x,n=t.y,i=Math.abs(e.x-r),s=Math.abs(e.y-n),o=t.width/2,a=t.height/2;return i>=o||s>=a},"outsideNode"),MAe=C((t,e,r)=>{de.debug(`intersection calc abc89:
1397  outsidePoint: ${JSON.stringify(e)}
1398  insidePoint : ${JSON.stringify(r)}
1399  node        : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);const n=t.x,i=t.y,s=Math.abs(n-r.x),o=t.width/2;let a=r.x<e.x?o-s:o+s;const l=t.height/2,c=Math.abs(e.y-r.y),h=Math.abs(e.x-r.x);if(Math.abs(i-e.y)*o>Math.abs(n-e.x)*l){let u=r.y<e.y?e.y-l-i:i-l-e.y;a=h*u/c;const d={x:r.x<e.x?r.x+a:r.x-h+a,y:r.y<e.y?r.y+c-u:r.y-c+u};return a===0&&(d.x=e.x,d.y=e.y),h===0&&(d.x=e.x),c===0&&(d.y=e.y),de.debug(`abc89 top/bottom calc, Q ${c}, q ${u}, R ${h}, r ${a}`,d),d}else{r.x<e.x?a=e.x-o-n:a=n-o-e.x;let u=c*a/h,d=r.x<e.x?r.x+h-a:r.x-h+a,f=r.y<e.y?r.y+u:r.y-u;return de.debug(`sides calc abc89, Q ${c}, q ${u}, R ${h}, r ${a}`,{_x:d,_y:f}),a===0&&(d=e.x,f=e.y),h===0&&(d=e.x),c===0&&(f=e.y),{x:d,y:f}}},"intersection"),mB=C((t,e)=>{de.warn("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],i=!1;return t.forEach(s=>{if(de.info("abc88 checking point",s,e),!_Ae(e,s)&&!i){const o=MAe(e,n,s);de.debug("abc88 inside",s,n,o),de.debug("abc88 intersection",o,e);let a=!1;r.forEach(l=>{a=a||l.x===o.x&&l.y===o.y}),r.some(l=>l.x===o.x&&l.y===o.y)?de.warn("abc88 no intersect",o,r):r.push(o),i=!0}else de.warn("abc88 outside",s,n),n=s,i||r.push(s)}),de.debug("returning points",r),r},"cutPathAtIntersect");function AX(t){const e=[],r=[];for(let n=1;n<t.length-1;n++){const i=t[n-1],s=t[n],o=t[n+1];(i.x===s.x&&s.y===o.y&&Math.abs(s.x-o.x)>5&&Math.abs(s.y-i.y)>5||i.y===s.y&&s.x===o.x&&Math.abs(s.x-i.x)>5&&Math.abs(s.y-o.y)>5)&&(e.push(s),r.push(n))}return{cornerPoints:e,cornerPointPositions:r}}C(AX,"extractCornerPoints");var gB=C(function(t,e,r){const n=e.x-t.x,i=e.y-t.y,s=Math.sqrt(n*n+i*i),o=r/s;return{x:e.x-o*n,y:e.y-o*i}},"findAdjacentPoint"),AAe=C(function(t){const{cornerPointPositions:e}=AX(t),r=[];for(let n=0;n<t.length;n++)if(e.includes(n)){const i=t[n-1],s=t[n+1],o=t[n],a=gB(i,o,5),l=gB(s,o,5),c=l.x-a.x,h=l.y-a.y;r.push(a);const u=Math.sqrt(2)*2;let d={x:o.x,y:o.y};if(Math.abs(s.x-i.x)>10&&Math.abs(s.y-i.y)>=10){de.debug("Corner point fixing",Math.abs(s.x-i.x),Math.abs(s.y-i.y));const f=5;o.x===a.x?d={x:c<0?a.x-f+u:a.x+f-u,y:h<0?a.y-u:a.y+u}:d={x:c<0?a.x-u:a.x+u,y:h<0?a.y-f+u:a.y+f-u}}else de.debug("Corner point skipping fixing",Math.abs(s.x-i.x),Math.abs(s.y-i.y));r.push(d,l)}else r.push(t[n]);return r},"fixCorners"),EAe=C((t,e,r)=>{const n=t-e-r,i=2,s=2,o=i+s,a=Math.floor(n/o),l=Array(a).fill(`${i} ${s}`).join(" ");return`0 ${e} ${l} ${r}`},"generateDashArray"),OAe=C(function(t,e,r,n,i,s,o,a=!1){var z;const{handDrawnSeed:l}=Zt();let c=e.points,h=!1;const u=i;var d=s;const f=[];for(const $ in e.cssCompiledStyles)bK($)||f.push(e.cssCompiledStyles[$]);de.debug("UIO intersect check",e.points,d.x,u.x),d.intersect&&u.intersect&&!a&&(c=c.slice(1,e.points.length-1),c.unshift(u.intersect(c[0])),de.debug("Last point UIO",e.start,"-->",e.end,c[c.length-1],d,d.intersect(c[c.length-1])),c.push(d.intersect(c[c.length-1])));const p=btoa(JSON.stringify(c));e.toCluster&&(de.info("to cluster abc88",r.get(e.toCluster)),c=mB(e.points,r.get(e.toCluster).node),h=!0),e.fromCluster&&(de.debug("from cluster abc88",r.get(e.fromCluster),JSON.stringify(c,null,2)),c=mB(c.reverse(),r.get(e.fromCluster).node).reverse(),h=!0);let m=c.filter($=>!Number.isNaN($.y));m=AAe(m);let g=Lb;switch(g=tv,e.curve){case"linear":g=tv;break;case"basis":g=Lb;break;case"cardinal":g=wU;break;case"bumpX":g=gU;break;case"bumpY":g=yU;break;case"catmullRom":g=CU;break;case"monotoneX":g=EU;break;case"monotoneY":g=OU;break;case"natural":g=DU;break;case"step":g=IU;break;case"stepAfter":g=RU;break;case"stepBefore":g=BU;break;default:g=Lb}const{x:y,y:b}=e_e(e),x=N9e().x(y).y(b).curve(g);let S;switch(e.thickness){case"normal":S="edge-thickness-normal";break;case"thick":S="edge-thickness-thick";break;case"invisible":S="edge-thickness-invisible";break;default:S="edge-thickness-normal"}switch(e.pattern){case"solid":S+=" edge-pattern-solid";break;case"dotted":S+=" edge-pattern-dotted";break;case"dashed":S+=" edge-pattern-dashed";break;default:S+=" edge-pattern-solid"}let k,w=e.curve==="rounded"?EX(OX(m,e),5):x(m);const _=Array.isArray(e.style)?e.style:[e.style];let L=_.find($=>$==null?void 0:$.startsWith("stroke:")),B=!1;if(e.look==="handDrawn"){const $=je.svg(t);Object.assign([],m);const H=$.path(w,{roughness:.3,seed:l});S+=" transition",k=$t(H).select("path").attr("id",e.id).attr("class"," "+S+(e.classes?" "+e.classes:"")).attr("style",_?_.reduce((q,ne)=>q+";"+ne,""):"");let j=k.attr("d");k.attr("d",j),t.node().appendChild(k.node())}else{const $=f.join(";"),H=_?_.reduce((I,tt)=>I+tt+";",""):"";let j="";e.animate&&(j=" edge-animation-fast"),e.animation&&(j=" edge-animation-"+e.animation);const q=($?$+";"+H+";":H)+";"+(_?_.reduce((I,tt)=>I+";"+tt,""):"");k=t.append("path").attr("d",w).attr("id",e.id).attr("class"," "+S+(e.classes?" "+e.classes:"")+(j??"")).attr("style",q),L=(z=q.match(/stroke:([^;
vendor: 10,915 bytes, lines 1399-1402
1399]+)/))==null?void 0:z[1],B=e.animate===!0||!!e.animation||$.includes("animation");const ne=k.node(),O=typeof ne.getTotalLength=="function"?ne.getTotalLength():0,fe=GI[e.arrowTypeStart]||0,Te=GI[e.arrowTypeEnd]||0;if(e.look==="neo"&&!B){const tt=`stroke-dasharray: ${e.pattern==="dotted"||e.pattern==="dashed"?EAe(O,fe,Te):`0 ${fe} ${O-fe-Te} ${Te}`}; stroke-dashoffset: 0;`;k.attr("style",tt+k.attr("style"))}}k.attr("data-edge",!0),k.attr("data-et","edge"),k.attr("data-id",e.id),k.attr("data-points",p),e.showPoints&&m.forEach($=>{t.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",$.x).attr("cy",$.y)});let E="";(Zt().flowchart.arrowMarkerAbsolute||Zt().state.arrowMarkerAbsolute)&&(E=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,E=E.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),de.info("arrowTypeStart",e.arrowTypeStart),de.info("arrowTypeEnd",e.arrowTypeEnd),kAe(k,e,E,o,n,L);const D=Math.floor(c.length/2),N=c[D];Js.isLabelCoordinateInPath(N,k.attr("d"))||(h=!0);let K={};return h&&(K.updatedPath=c),K.originalPath=e.points,K},"insertEdge");function EX(t,e){if(t.length<2)return"";let r="";const n=t.length,i=1e-5;for(let s=0;s<n;s++){const o=t[s],a=t[s-1],l=t[s+1];if(s===0)r+=`M${o.x},${o.y}`;else if(s===n-1)r+=`L${o.x},${o.y}`;else{const c=o.x-a.x,h=o.y-a.y,u=l.x-o.x,d=l.y-o.y,f=Math.hypot(c,h),p=Math.hypot(u,d);if(f<i||p<i){r+=`L${o.x},${o.y}`;continue}const m=c/f,g=h/f,y=u/p,b=d/p,x=m*y+g*b,S=Math.max(-1,Math.min(1,x)),k=Math.acos(S);if(k<i||Math.abs(Math.PI-k)<i){r+=`L${o.x},${o.y}`;continue}const w=Math.min(e/Math.sin(k/2),f/2,p/2),_=o.x-m*w,L=o.y-g*w,B=o.x+y*w,E=o.y+b*w;r+=`L${_},${L}`,r+=`Q${o.x},${o.y} ${B},${E}`}}return r}C(EX,"generateRoundedPath");function v6(t,e){if(!t||!e)return{angle:0,deltaX:0,deltaY:0};const r=e.x-t.x,n=e.y-t.y;return{angle:Math.atan2(n,r),deltaX:r,deltaY:n}}C(v6,"calculateDeltaAndAngle");function OX(t,e){const r=t.map(i=>({...i}));if(t.length>=2&&Dn[e.arrowTypeStart]){const i=Dn[e.arrowTypeStart],s=t[0],o=t[1],{angle:a}=v6(s,o),l=i*Math.cos(a),c=i*Math.sin(a);r[0].x=s.x+l,r[0].y=s.y+c}const n=t.length;if(n>=2&&Dn[e.arrowTypeEnd]){const i=Dn[e.arrowTypeEnd],s=t[n-1],o=t[n-2],{angle:a}=v6(o,s),l=i*Math.cos(a),c=i*Math.sin(a);r[n-1].x=s.x-l,r[n-1].y=s.y-c}return r}C(OX,"applyMarkerOffsetsToPoints");var LAe=C((t,e,r,n)=>{e.forEach(i=>{GAe[i](t,r,n)})},"insertMarkers"),DAe=C((t,e,r)=>{de.trace("Making markers for ",r),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionStart").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd").attr("class","marker extension "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),IAe=C((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart").attr("class","marker composition "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd").attr("class","marker composition "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),BAe=C((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),RAe=C((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),PAe=C((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),NAe=C((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-pointEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),FAe=C((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-circleEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),$Ae=C((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-crossEnd").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossStart").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),zAe=C((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),HAe=C((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneStart").attr("class","marker onlyOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneEnd").attr("class","marker onlyOne "+e).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")},"only_one"),qAe=C((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneStart").attr("class","marker zeroOrOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),n.append("path").attr("d","M9,0 L9,18");const i=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+e).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),i.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),VAe=C((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreStart").attr("class","marker oneOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreEnd").attr("class","marker oneOrMore "+e).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")},"one_or_more"),WAe=C((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),n.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const i=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+e).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),i.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),jAe=C((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0
1400      L20,10
1401      M20,10
1402      L0,20`)},"requirement_arrow"),UAe=C((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_c
1402ontainsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");n.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),n.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),n.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),GAe={extension:DAe,composition:IAe,aggregation:BAe,dependency:RAe,lollipop:PAe,point:NAe,circle:FAe,cross:$Ae,barb:zAe,only_one:HAe,zero_or_one:qAe,one_or_more:VAe,zero_or_more:WAe,requirement_arrow:jAe,requirement_contains:UAe},KAe=LAe,YAe={common:d0,getConfig:Hn,insertCluster:nAe,insertEdge:OAe,insertEdgeLabel:SAe,insertMarkers:KAe,insertNode:MX,interpolateToCurve:KT,labelHelper:dt,log:de,positionEdgeLabel:TAe},Fg={},LX=C(t=>{for(const e of t)Fg[e.name]=e},"registerLayoutLoaders"),XAe=C(()=>{LX([{name:"dagre",loader:C(async()=>await J(()=>import("./dagre-6UL2VRFP-Bktqv8BI.js"),__vite__mapDeps([28,29,30,31,32,33,2])),"loader")},{name:"cose-bilkent",loader:C(async()=>await J(()=>import("./cose-bilkent-S5V4N54A-DZ2P_XuW.js"),__vite__mapDeps([34,35,2])),"loader")}])},"registerDefaultLayoutLoaders");XAe();var eIe=C(async(t,e)=>{if(!(t.layoutAlgorithm in Fg))throw new Error(`Unknown layout algorithm: ${t.layoutAlgorithm}`);const r=Fg[t.layoutAlgorithm];return(await r.loader()).render(t,e,YAe,{algorithm:r.algorithm})},"render"),tIe=C((t="",{fallback:e="dagre"}={})=>{if(t in Fg)return t;if(e in Fg)return de.warn(`Layout algorithm ${t} is not registered. Using ${e} as fallback.`),e;throw new Error(`Both layout algorithms ${t} and ${e} are not registered.`)},"getRegisteredLayoutAlgorithm"),DX="comm",IX="rule",BX="decl",JAe="@import",ZAe="@namespace",QAe="@keyframes",eEe="@layer",RX=Math.abs,p_=String.fromCharCode;function PX(t){return t.trim()}function Pb(t,e,r){return t.replace(e,r)}function tEe(t,e,r){return t.indexOf(e,r)}function Dd(t,e){return t.charCodeAt(e)|0}function qf(t,e,r){return t.slice(e,r)}function Ro(t){return t.length}function rEe(t){return t.length}function y2(t,e){return e.push(t),t}var _4=1,Vf=1,NX=0,Ps=0,Wr=0,m0="";function m_(t,e,r,n,i,s,o,a){return{value:t,root:e,parent:r,type:n,props:i,children:s,line:_4,column:Vf,length:o,return:"",siblings:a}}function nEe(){return Wr}function iEe(){return Wr=Ps>0?Dd(m0,--Ps):0,Vf--,Wr===10&&(Vf=1,_4--),Wr}function so(){return Wr=Ps<NX?Dd(m0,Ps++):0,Vf++,Wr===10&&(Vf=1,_4++),Wr}function ic(){return Dd(m0,Ps)}function Nb(){return Ps}function M4(t,e){return qf(m0,t,e)}function $g(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function sEe(t){return _4=Vf=1,NX=Ro(m0=t),Ps=0,[]}function oEe(t){return m0="",t}function Vk(t){return PX(M4(Ps-1,w6(t===91?t+2:t===40?t+1:t)))}function aEe(t){for(;(Wr=ic())&&Wr<33;)so();return $g(t)>2||$g(Wr)>3?"":" "}function lEe(t,e){for(;--e&&so()&&!(Wr<48||Wr>102||Wr>57&&Wr<65||Wr>70&&Wr<97););return M4(t,Nb()+(e<6&&ic()==32&&so()==32))}function w6(t){for(;so();)switch(Wr){case t:return Ps;case 34:case 39:t!==34&&t!==39&&w6(Wr);break;case 40:t===41&&w6(t);break;case 92:so();break}return Ps}function cEe(t,e){for(;so()&&t+Wr!==57;)if(t+Wr===84&&ic()===47)break;return"/*"+M4(e,Ps-1)+"*"+p_(t===47?t:so())}function hEe(t){for(;!$g(ic());)so();return M4(t,Ps)}function uEe(t){return oEe(Fb("",null,null,null,[""],t=sEe(t),0,[0],t))}function Fb(t,e,r,n,i,s,o,a,l){for(var c=0,h=0,u=o,d=0,f=0,p=0,m=1,g=1,y=1,b=0,x="",S=i,k=s,w=n,_=x;g;)switch(p=b,b=so()){case 40:if(p!=108&&Dd(_,u-1)==58){tEe(_+=Pb(Vk(b),"&","&\f"),"&\f",RX(c?a[c-1]:0))!=-1&&(y=-1);break}case 34:case 39:case 91:_+=Vk(b);break;case 9:case 10:case 13:case 32:_+=aEe(p);break;case 92:_+=lEe(Nb()-1,7);continue;case 47:switch(ic()){case 42:case 47:y2(dEe(cEe(so(),Nb()),e,r,l),l),($g(p||1)==5||$g(ic()||1)==5)&&Ro(_)&&qf(_,-1,void 0)!==" "&&(_+=" ");break;default:_+="/"}break;case 123*m:a[c++]=Ro(_)*y;case 125*m:case 59:case 0:switch(b){case 0:case 125:g=0;case 59+h:y==-1&&(_=Pb(_,/\f/g,"")),f>0&&(Ro(_)-u||m===0&&p===47)&&y2(f>32?bB(_+";",n,r,u-1,l):bB(Pb(_," ","")+";",n,r,u-2,l),l);break;case 59:_+=";";default:if(y2(w=yB(_,e,r,c,h,i,a,x,S=[],k=[],u,s),s),b===123)if(h===0)Fb(_,e,w,w,S,s,u,a,k);else{switch(d){case 99:if(Dd(_,3)===110)break;case 108:if(Dd(_,2)===97)break;default:h=0;case 100:case 109:case 115:}h?Fb(t,w,w,n&&y2(yB(t,w,w,0,0,i,a,x,i,S=[],u,k),k),i,k,u,a,n?S:k):Fb(_,w,w,w,[""],k,0,a,k)}}c=h=f=0,m=y=1,x=_="",u=o;break;case 58:u=1+Ro(_),f=p;default:if(m<1){if(b==123)--m;else if(b==125&&m++==0&&iEe()==125)continue}switch(_+=p_(b),b*m){case 38:y=h>0?1:(_+="\f",-1);break;case 44:a[c++]=(Ro(_)-1)*y,y=1;break;case 64:ic()===45&&(_+=Vk(so())),d=ic(),h=u=Ro(x=_+=hEe(Nb())),b++;break;case 45:p===45&&Ro(_)==2&&(m=0)}}return s}function yB(t,e,r,n,i,s,o,a,l,c,h,u){for(var d=i-1,f=i===0?s:[""],p=rEe(f),m=0,g=0,y=0;m<n;++m)for(var b=0,x=qf(t,d+1,d=RX(g=o[m])),S=t;b<p;++b)(S=PX(g>0?f[b]+" "+x:Pb(x,/&\f/g,f[b])))&&(l[y++]=S);return m_(t,e,r,i===0?IX:a,l,c,h,u)}function dEe(t,e,r,n){return m_(t,e,r,DX,p_(nEe()),qf(t,2,-2),0,n)}function bB(t,e,r,n,i){return m_(t,e,r,BX,qf(t,0,n),qf(t,n+1,-1),n,i)}function k6(t,e){for(var r="",n=0;n<t.length;n++)r+=e(t[n],n,t,e)||"";return r}function fEe(t,e,r,n){switch(t.type){case eEe:if(t.children.length)break;case JAe:case ZAe:case BX:return t.return=t.return||t.value;case DX:return"";case QAe:return t.return=t.value+"{"+k6(t.children,n)+"}";case IX:if(!Ro(t.value=t.props.join(",")))return""}return Ro(r=k6(t.children,n))?t.return=t.value+"{"+r+"}":""}var FX="c4",pEe=C(t=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(t),"detector"),mEe=C(async()=>{const{diagram:t}
vendor: 7,585 bytes, lines 1402-1403
1402=await J(async()=>{const{diagram:e}=await import("./c4Diagram-YG6GDRKO-DPpkOeZj.js");return{diagram:e}},__vite__mapDeps([36,37,2]));return{id:FX,diagram:t}},"loader"),gEe={id:FX,detector:pEe,loader:mEe},yEe=gEe,$X="flowchart",bEe=C((t,e)=>{var r,n;return((r=e==null?void 0:e.flowchart)==null?void 0:r.defaultRenderer)==="dagre-wrapper"||((n=e==null?void 0:e.flowchart)==null?void 0:n.defaultRenderer)==="elk"?!1:/^\s*graph/.test(t)},"detector"),xEe=C(async()=>{const{diagram:t}=await J(async()=>{const{diagram:e}=await import("./flowDiagram-NV44I4VS-C0ej3jNn.js");return{diagram:e}},__vite__mapDeps([38,39,40,41,42,2]));return{id:$X,diagram:t}},"loader"),vEe={id:$X,detector:bEe,loader:xEe},wEe=vEe,zX="flowchart-v2",kEe=C((t,e)=>{var r,n,i;return((r=e==null?void 0:e.flowchart)==null?void 0:r.defaultRenderer)==="dagre-d3"?!1:(((n=e==null?void 0:e.flowchart)==null?void 0:n.defaultRenderer)==="elk"&&(e.layout="elk"),/^\s*graph/.test(t)&&((i=e==null?void 0:e.flowchart)==null?void 0:i.defaultRenderer)==="dagre-wrapper"?!0:/^\s*flowchart/.test(t))},"detector"),CEe=C(async()=>{const{diagram:t}=await J(async()=>{const{diagram:e}=await import("./flowDiagram-NV44I4VS-C0ej3jNn.js");return{diagram:e}},__vite__mapDeps([38,39,40,41,42,2]));return{id:zX,diagram:t}},"loader"),SEe={id:zX,detector:kEe,loader:CEe},TEe=SEe,HX="er",_Ee=C(t=>/^\s*erDiagram/.test(t),"detector"),MEe=C(async()=>{const{diagram:t}=await J(async()=>{const{diagram:e}=await import("./erDiagram-Q2GNP2WA-C0ahC3th.js");return{diagram:e}},__vite__mapDeps([43,40,41,42,2]));return{id:HX,diagram:t}},"loader"),AEe={id:HX,detector:_Ee,loader:MEe},EEe=AEe,qX="gitGraph",OEe=C(t=>/^\s*gitGraph/.test(t),"detector"),LEe=C(async()=>{const{diagram:t}=await J(async()=>{const{diagram:e}=await import("./gitGraphDiagram-NY62KEGX-DsjWZ6x7.js");return{diagram:e}},__vite__mapDeps([44,45,46,47,30,32,33,2]));return{id:qX,diagram:t}},"loader"),DEe={id:qX,detector:OEe,loader:LEe},IEe=DEe,VX="gantt",BEe=C(t=>/^\s*gantt/.test(t),"detector"),REe=C(async()=>{const{diagram:t}=await J(async()=>{const{diagram:e}=await import("./ganttDiagram-LVOFAZNH-B3vHhhd_.js");return{diagram:e}},__vite__mapDeps([48,49,50,51,2]));return{id:VX,diagram:t}},"loader"),PEe={id:VX,detector:BEe,loader:REe},NEe=PEe,WX="info",FEe=C(t=>/^\s*info/.test(t),"detector"),$Ee=C(async()=>{const{diagram:t}=await J(async()=>{const{diagram:e}=await import("./infoDiagram-ER5ION4S-_pt6W9aq.js");return{diagram:e}},__vite__mapDeps([52,47,30,32,33,2]));return{id:WX,diagram:t}},"loader"),zEe={id:WX,detector:FEe,loader:$Ee},jX="pie",HEe=C(t=>/^\s*pie/.test(t),"detector"),qEe=C(async()=>{const{diagram:t}=await J(async()=>{const{diagram:e}=await import("./pieDiagram-ADFJNKIX-CF9MlHxn.js");return{diagram:e}},__vite__mapDeps([53,45,47,30,32,33,54,55,50,2]));return{id:jX,diagram:t}},"loader"),VEe={id:jX,detector:HEe,loader:qEe},UX="quadrantChart",WEe=C(t=>/^\s*quadrantChart/.test(t),"detector"),jEe=C(async()=>{const{diagram:t}=await J(async()=>{const{diagram:e}=await import("./quadrantDiagram-AYHSOK5B-DLMR4q8P.js");return{diagram:e}},__vite__mapDeps([56,49,50,51,2]));return{id:UX,diagram:t}},"loader"),UEe={id:UX,detector:WEe,loader:jEe},GEe=UEe,GX="xychart",KEe=C(t=>/^\s*xychart(-beta)?/.test(t),"detector"),YEe=C(async()=>{const{diagram:t}=await J(async()=>{const{diagram:e}=await import("./xychartDiagram-PRI3JC2R-BSVDBaZF.js");return{diagram:e}},__vite__mapDeps([57,50,55,49,51,2]));return{id:GX,diagram:t}},"loader"),XEe={id:GX,detector:KEe,loader:YEe},JEe=XEe,KX="requirement",ZEe=C(t=>/^\s*requirement(Diagram)?/.test(t),"detector"),QEe=C(async()=>{const{diagram:t}=await J(async()=>{const{diagram:e}=await import("./requirementDiagram-UZGBJVZJ-B1eX7-K3.js");return{diagram:e}},__vite__mapDeps([58,40,41,2]));return{id:KX,diagram:t}},"loader"),eOe={id:KX,detector:ZEe,loader:QEe},tOe=eOe,YX="sequence",rOe=C(t=>/^\s*sequenceDiagram/.test(t),"detector"),nOe=C(async()=>{const{diagram:t}=await J(async()=>{const{diagram:e}=await import("./sequenceDiagram-WL72ISMW-DWeiiBgm.js");return{diagram:e}},__vite__mapDeps([59,37,46,2]));return{id:YX,diagram:t}},"loader"),iOe={id:YX,detector:rOe,loader:nOe},sOe=iOe,XX="class",oOe=C((t,e)=>{var r;return((r=e==null?void 0:e.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:/^\s*classDiagram/.test(t)},"detector"),aOe=C(async()=>{const{diagram:t}=await J(async()=>{const{diagram:e}=await import("./classDiagram-2ON5EDUG-DKG3HXGe.js");return{diagram:e}},__vite__mapDeps([60,61,39,40,41,2]));return{id:XX,diagram:t}},"loader"),lOe={id:XX,detector:oOe,loader:aOe},cOe=lOe,JX="classDiagram",hOe=C((t,e)=>{var r;return/^\s*classDiagram/.test(t)&&((r=e==null?void 0:e.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(t)},"detector"),uOe=C(async()=>{const{diagram:t}=await J(async()=>{const{diagram:e}=await import("./classDiagram-v2-WZHVMYZB-DKG3HXGe.js");return{diagram:e}},__vite__mapDeps([62,61,39,40,41,2]));return{id:JX,diagram:t}},"loader"),dOe={id:JX,detector:hOe,loader:uOe},fOe=dOe,ZX="state",pOe=C((t,e)=>{var r;return((r=e==null?void 0:e.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(t)},"detector"),mOe=C(async()=>{const{diagram:t}=await J(async()=>{const{diagram:e}=await import("./stateDiagram-FKZM4ZOC-DH4wndlI.js");return{diagram:e}},__vite__mapDeps([63,64,40,41,29,30,31,32,2]));return{id:ZX,diagram:t}},"loader"),gOe={id:ZX,detector:pOe,loader:mOe},yOe=gOe,QX="stateDiagram",bOe=C((t,e)=>{var r;return!!(/^\s*stateDiagram-v2/.test(t)||/^\s*stateDiagram/.test(t)&&((r=e==null?void 0:e.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper")},"detector"),xOe=C(async()=>{const{diagram:t}=await J(async()=>{const{diagram:e}=await import("./stateDiagram-v2-4FDKWEC3-TsHybPtB.js");return{diagram:e}},__vite__mapDeps([65,64,40,41,2]));return{id:QX,diagram:t}},"loader"),vOe={id:QX,detector:bOe,loader:xOe},wOe=vOe,eJ="journey",kOe=C(t=>/^\s*journey/.test(t),"detector"),COe=C(async()=>{const{diagram:t}=await J(async()=>{const{diagram:e}=await import("./journeyDiagram-XKPGCS4Q-BFC4BXTc.js");return{diagram:e}},__vite__mapDeps([66,37,39,54,2]));return{id:eJ,diagram:t}},"loader"),SOe={id:eJ,detector:kOe,loader:COe},TOe=SOe,_Oe=C((t,e,r)=>{de.debug(`rendering svg for syntax error
1403`);const n=U9e(e),i=n.append("g");n.attr("viewBox","0 0 2412 512"),$j(n,100,512,!0),i.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),i.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),i.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),i.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.
1403164-16,16v32c0,8.836 7.156,16 16,16z"),i.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),i.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),i.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),i.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)},"draw"),tJ={draw:_Oe},MOe=tJ,AOe={db:{},renderer:tJ,parser:{parse:C(()=>{},"parse")}},EOe=AOe,rJ="flowchart-elk",OOe=C((t,e={})=>{var r;return/^\s*flowchart-elk/.test(t)||/^\s*(flowchart|graph)/.test(t)&&((r=e==null?void 0:e.flowchart)==null?void 0:r.defaultRenderer)==="elk"?(e.layout="elk",!0):!1},"detector"),LOe=C(async()=>{const{diagram:t}=await J(async()=>{const{diagram:e}=await import("./flowDiagram-NV44I4VS-C0ej3jNn.js");return{diagram:e}},__vite__mapDeps([38,39,40,41,42,2]));return{id:rJ,diagram:t}},"loader"),DOe={id:rJ,detector:OOe,loader:LOe},IOe=DOe,nJ="timeline",BOe=C(t=>/^\s*timeline/.test(t),"detector"),ROe=C(async()=>{const{diagram:t}=await J(async()=>{const{diagram:e}=await import("./timeline-definition-IT6M3QCI-BGUGHo_t.js");return{diagram:e}},__vite__mapDeps([67,54,2]));return{id:nJ,diagram:t}},"loader"),POe={id:nJ,detector:BOe,loader:ROe},NOe=POe,iJ="mindmap",FOe=C(t=>/^\s*mindmap/.test(t),"detector"),$Oe=C(async()=>{const{diagram:t}=await J(async()=>{const{diagram:e}=await import("./mindmap-definition-VGOIOE7T-6OlLdD-A.js");return{diagram:e}},__vite__mapDeps([68,40,41,2]));return{id:iJ,diagram:t}},"loader"),zOe={id:iJ,detector:FOe,loader:$Oe},HOe=zOe,sJ="kanban",qOe=C(t=>/^\s*kanban/.test(t),"detector"),VOe=C(async()=>{const{diagram:t}=await J(async()=>{const{diagram:e}=await import("./kanban-definition-3W4ZIXB7-BwEO7lCF.js");return{diagram:e}},__vite__mapDeps([69,39,2]));return{id:sJ,diagram:t}},"loader"),WOe={id:sJ,detector:qOe,loader:VOe},jOe=WOe,oJ="sankey",UOe=C(t=>/^\s*sankey(-beta)?/.test(t),"detector"),GOe=C(async()=>{const{diagram:t}=await J(async()=>{const{diagram:e}=await import("./sankeyDiagram-TZEHDZUN-DeFe9P43.js");return{diagram:e}},__vite__mapDeps([70,55,50,2]));return{id:oJ,diagram:t}},"loader"),KOe={id:oJ,detector:UOe,loader:GOe},YOe=KOe,aJ="packet",XOe=C(t=>/^\s*packet(-beta)?/.test(t),"detector"),JOe=C(async()=>{const{diagram:t}=await J(async()=>{const{diagram:e}=await import("./diagram-S2PKOQOG-CMXEwnxL.js");return{diagram:e}},__vite__mapDeps([71,45,47,30,32,33,2]));return{id:aJ,diagram:t}},"loader"),ZOe={id:aJ,detector:XOe,loader:JOe},lJ="radar",QOe=C(t=>/^\s*radar-beta/.test(t),"detector"),eLe=C(async()=>{const{diagram:t}=await J(async()=>{const{diagram:e}=await import("./diagram-QEK2KX5R-DC8YLwPF.js");return{diagram:e}},__vite__mapDeps([72,45,47,30,32,33,2]));return{id:lJ,diagram:t}},"loader"),tLe={id:lJ,detector:QOe,loader:eLe},cJ="block",rLe=C(t=>/^\s*block(-beta)?/.test(t),"detector"),nLe=C(async()=>{const{diagram:t}=await J(async()=>{const{diagram:e}=await import("./blockDiagram-VD42YOAC-4R2RCh9E.js");return{diagram:e}},__vite__mapDeps([73,39,33,30,29,42,2]));return{id:cJ,diagram:t}},"loader"),iLe={id:cJ,detector:rLe,loader:nLe},sLe=iLe,hJ="architecture",oLe=C(t=>/^\s*architecture/.test(t),"detector"),aLe=C(async()=>{const{diagram:t}=await J(async()=>{const{diagram:e}=await import("./architectureDiagram-VXUJARFQ-CQRW3dfl.js");return{diagram:e}},__vite__mapDeps([74,45,47,30,32,33,35,2]));return{id:hJ,diagram:t}},"loader"),lLe={id:hJ,detector:oLe,loader:aLe},cLe=lLe,uJ="treemap",hLe=C(t=>/^\s*treemap/.test(t),"detector"),uLe=C(async()=>{const{diagram:t}=await J(async()=>{const{diagram:e}=await import("./diagram-PSM6KHXK-B9IcYbAy.js");return{diagram:e}},__vite__mapDeps([75,41,45,47,30,32,33,51,55,50,2]));return{id:uJ,diagram:t}},"loader"),dLe={id:uJ,detector:hLe,loader:uLe},xB=!1,A4=C(()=>{xB||(xB=!0,Kx("error",EOe,t=>t.toLowerCase().trim()==="error"),Kx("---",{db:{clear:C(()=>{},"clear")},styles:{},renderer:{draw:C(()=>{},"draw")},parser:{parse:C(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:C(()=>null,"init")},t=>t.toLowerCase().trimStart().startsWith("---")),RS(IOe,HOe,cLe),RS(yEe,jOe,fOe,cOe,EEe,NEe,zEe,VEe,tOe,sOe,TEe,wEe,NOe,IEe,wOe,yOe,TOe,GEe,YOe,ZOe,JEe,sLe,tLe,dLe))},"addDiagrams"),fLe=C(async()=>{de.debug("Loading registered diagrams");const e=(await Promise.allSettled(Object.entries(yu).map(async([r,{detector:n,loader:i}])=>{if(i)try{$S(r)}catch{try{const{diagram:s,id:o}=await i();Kx(o,s,n)}catch(s){throw de.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete yu[r],s}}}))).filter(r=>r.status==="rejected");if(e.length>0){de.error(`Failed to load ${e.length} external diagrams`);for(const r of e)de.error(r);throw new Error(`Failed to load ${e.length} external diagrams`)}},"loadRegisteredDiagrams"),pLe="graphics-document document";function dJ(t,e){t.attr("role",pLe),e!==""&&t.attr("aria-roledescription",e)}C(dJ,"setA11yDiagramInfo");
vendor: 8,429 bytes, lines 1403-1411
1403function fJ(t,e,r,n){if(t.insert!==void 0){if(r){const i=`chart-desc-${n}`;t.attr("aria-describedby",i),t.insert("desc",":first-child").attr("id",i).text(r)}if(e){const i=`chart-title-${n}`;t.attr("aria-labelledby",i),t.insert("title",":first-child").attr("id",i).text(e)}}}C(fJ,"addSVGa11yTitleDescription");var Jh,C6=(Jh=class{constructor(e,r,n,i,s){this.type=e,this.text=r,this.db=n,this.parser=i,this.renderer=s}static async fromText(e,r={}){var c,h;const n=Hn(),i=vT(e,n);e=T_e(e)+`
1404`;try{$S(i)}catch{const u=kSe(i);if(!u)throw new Mj(`Diagram ${i} not found.`);const{id:d,diagram:f}=await u();Kx(d,f)}const{db:s,parser:o,renderer:a,init:l}=$S(i);return o.parser&&(o.parser.yy=s),(c=s.clear)==null||c.call(s),l==null||l(n),r.title&&((h=s.setDiagramTitle)==null||h.call(s,r.title)),await o.parse(e),new Jh(i,e,s,o,a)}async render(e,r){await this.renderer.draw(this.text,e,r,this)}getParser(){return this.parser}getType(){return this.type}},C(Jh,"Diagram"),Jh),vB=[],mLe=C(()=>{vB.forEach(t=>{t()}),vB=[]},"attachFunctions"),gLe=C(t=>t.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function pJ(t){const e=t.match(_j);if(!e)return{text:t,metadata:{}};let r=QTe(e[1],{schema:ZTe})??{};r=typeof r=="object"&&!Array.isArray(r)?r:{};const n={};return r.displayMode&&(n.displayMode=r.displayMode.toString()),r.title&&(n.title=r.title.toString()),r.config&&(n.config=r.config),{text:t.slice(e[0].length),metadata:n}}C(pJ,"extractFrontMatter");var yLe=C(t=>t.replace(/\r\n?/g,`
1405`).replace(/<(\w+)([^>]*)>/g,(e,r,n)=>"<"+r+n.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),bLe=C(t=>{const{text:e,metadata:r}=pJ(t),{displayMode:n,title:i,config:s={}}=r;return n&&(s.gantt||(s.gantt={}),s.gantt.displayMode=n),{title:i,config:s,text:e}},"processFrontmatter"),xLe=C(t=>{const e=Js.detectInit(t)??{},r=Js.detectDirective(t,"wrap");return Array.isArray(r)?e.wrap=r.some(({type:n})=>n==="wrap"):(r==null?void 0:r.type)==="wrap"&&(e.wrap=!0),{text:d_e(t),directive:e}},"processDirectives");function g_(t){const e=yLe(t),r=bLe(e),n=xLe(r.text),i=QT(r.config,n.directive);return t=gLe(n.text),{code:t,title:r.title,config:i}}C(g_,"preprocessDiagram");function mJ(t){const e=new TextEncoder().encode(t),r=Array.from(e,n=>String.fromCodePoint(n)).join("");return btoa(r)}C(mJ,"toBase64");var vLe=5e4,wLe="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",kLe="sandbox",CLe="loose",SLe="http://www.w3.org/2000/svg",TLe="http://www.w3.org/1999/xlink",_Le="http://www.w3.org/1999/xhtml",MLe="100%",ALe="100%",ELe="border:0;margin:0;",OLe="margin:0",LLe="allow-top-navigation-by-user-activation allow-popups",DLe='The "iframe" tag is not supported by your browser.',ILe=["foreignobject"],BLe=["dominant-baseline"];function y_(t){const e=g_(t);return Ux(),FSe(e.config??{}),e}C(y_,"processAndSetConfigs");async function gJ(t,e){A4();try{const{code:r,config:n}=y_(t);return{diagramType:(await bJ(r)).type,config:n}}catch(r){if(e!=null&&e.suppressErrors)return!1;throw r}}C(gJ,"parse");var wB=C((t,e,r=[])=>`
1406.${t} ${e} { ${r.join(" !important; ")} !important; }`,"cssImportantStyles"),RLe=C((t,e=new Map)=>{var n;let r="";if(t.themeCSS!==void 0&&(r+=`
1407${t.themeCSS}`),t.fontFamily!==void 0&&(r+=`
1408:root { --mermaid-font-family: ${t.fontFamily}}`),t.altFontFamily!==void 0&&(r+=`
1409:root { --mermaid-alt-font-family: ${t.altFontFamily}}`),e instanceof Map){const a=t.htmlLabels??((n=t.flowchart)==null?void 0:n.htmlLabels)?["> *","span"]:["rect","polygon","ellipse","circle","path"];e.forEach(l=>{dM(l.styles)||a.forEach(c=>{r+=wB(l.id,c,l.styles)}),dM(l.textStyles)||(r+=wB(l.id,"tspan",((l==null?void 0:l.textStyles)||[]).map(c=>c.replace("color","fill"))))})}return r},"createCssStyles"),PLe=C((t,e,r,n)=>{const i=RLe(t,r),s=i6e(e,i,t.themeVariables);return k6(uEe(`${n}{${s}}`),fEe)},"createUserStyles"),NLe=C((t="",e,r)=>{let n=t;return!r&&!e&&(n=n.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),n=Ru(n),n=n.replace(/<br>/g,"<br/>"),n},"cleanUpSvgCode"),FLe=C((t="",e)=>{var i,s;const r=(s=(i=e==null?void 0:e.viewBox)==null?void 0:i.baseVal)!=null&&s.height?e.viewBox.baseVal.height+"px":ALe,n=mJ(`<body style="${OLe}">${t}</body>`);return`<iframe style="width:${MLe};height:${r};${ELe}" src="data:text/html;charset=UTF-8;base64,${n}" sandbox="${LLe}">
1410  ${DLe}
1411</iframe>`},"putIntoIFrame"),kB=C((t,e,r,n,i)=>{const s=t.append("div");s.attr("id",r),n&&s.attr("style",n);const o=s.append("svg").attr("id",e).attr("width","100%").attr("xmlns",SLe);return i&&o.attr("xmlns:xlink",i),o.append("g"),t},"appendDivSvgG");function S6(t,e){return t.append("iframe").attr("id",e).attr("style","width: 100%; height: 100%;").attr("sandbox","")}C(S6,"sandboxedIframe");var $Le=C((t,e,r,n)=>{var i,s,o;(i=t.getElementById(e))==null||i.remove(),(s=t.getElementById(r))==null||s.remove(),(o=t.getElementById(n))==null||o.remove()},"removeExistingElements"),zLe=C(async function(t,e,r){var N,K,z,$,H,j;A4();const n=y_(e);e=n.code;const i=Hn();de.debug(i),e.length>((i==null?void 0:i.maxTextSize)??vLe)&&(e=wLe);const s="#"+t,o="i"+t,a="#"+o,l="d"+t,c="#"+l,h=C(()=>{const ne=$t(d?a:c).node();ne&&"remove"in ne&&ne.remove()},"removeTempElements");let u=$t("body");const d=i.securityLevel===kLe,f=i.securityLevel===CLe,p=i.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),d){const q=S6($t(r),o);u=$t(q.nodes()[0].contentDocument.body),u.node().style.margin=0}else u=$t(r);kB(u,t,l,`font-family: ${p}`,TLe)}else{if($Le(document,t,l,o),d){const q=S6($t("body"),o);u=$t(q.nodes()[0].contentDocument.body),u.node().style.margin=0}else u=$t("body");kB(u,t,l)}let m,g;try{m=await C6.fromText(e,{title:n.title})}catch(q){if(i.suppressErrorRendering)throw h(),q;m=await C6.fromText("error"),g=q}const y=u.select(c).node(),b=m.type,x=y.firstChild,S=x.firstChild,k=(K=(N=m.renderer).getClasses)==null?void 0:K.call(N,e,m),w=PLe(i,b,k,s),_=document.createElement("style");_.innerHTML=w,x.insertBefore(_,S);try{await m.renderer.draw(e,t,yI.version,m)}catch(q){throw i.suppressErrorRendering?h():MOe.draw(e,t,yI.version),q}const L=u.select(`${c} svg`),B=($=(z=m.db).getAccTitle)==null?void 0:$.call(z),E=(j=(H=m.db).getAccDescription)==null?void 0:j.call(H);xJ(b,L,B,E),u.select(`[id="${t}"]`).selectAll("foreignobject > *").attr("xmlns",_Le);let D=u.select(c).node().innerHTML;if(de.debug("config.arrowMarkerAbsolute",i.arrowMarkerAbsolute),D=NLe(D,d,rn(i.arrowMarkerAbsolute)),d){const q=u.select(c+" svg").node();D=FLe(D,q)}else f||(D=An.sanitize(D,{ADD_TAGS:ILe,ADD_ATTR:BLe,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(mLe(),g)throw g;return h(),{diagramType:b,svg:D,bindFunctions:m.db.bindFunctions}},"render");function yJ(t={}){var n;const e=Qr({},t);e!=null&&e.fontFamily&&!((n=e.themeVariables)!=null&&n.fontFamily)&&(e.themeVariables||(e.themeVariables={}),e.themeVariables.fontFamily=e.fontFamily),PSe(e),e!=null&&e.theme&&e.theme in el?e.themeVariables=el[e.theme].getThemeVariables(e.themeVariables):e&&(e.themeVariables=el.default.getThemeVariables(e.themeVariables));const r=typeof e=="object"?RSe(e):Dj();xT(r.logLevel),A4()}C(yJ,"initialize");var bJ=C((t,e={})=>{const{code:r}=g_(t);return C6.fromText(r,e)},"getDiagramFromText");function xJ(t,e,r,n){dJ(e,t),fJ(e,r,n,e.attr("id"))}C(xJ,"addA11yInfo");var ku=Object.freeze({render:zLe,parse:gJ,getDiagramFromText:bJ,initialize:yJ,getConfig:Hn,setConfig:Ij,getSiteConfig:Dj,updateSiteConfig:NSe,reset:C(()=>{Ux()},"reset"),globalReset:C(()=>{Ux(Pf)},"globalReset"),defaultConfig:Pf});xT(Hn().logLevel);Ux(Hn());var HLe=C((t,e,r)=>{de.warn(t),ZT(t)?(r&&r(t.str,t.hash),e.push({...t,message:t.str,error:t})):(r&&r(t),t instanceof Error&&e.push({str:t.message,message:t.message,hash:t.name,error:t}))},"handleError"),vJ=C(async function(t={querySelector:".mermaid"}){try{await qLe(t)}catch(e){if(ZT(e)&&de.error(e.str),ss.parseError&&ss.parseError(e),!t.suppressErrors)throw de.error("Use the suppressErrors option to suppress these errors"),e}},"run"),qLe=C(async function({postRenderCallback:t,querySelector:e,nodes:r}={querySelector:".mermaid"}){const n=ku.getConfig();de.debug(`${t?"":"No "}Callback function found`);let i;if(r)i=r;else if(e)i=document.querySelectorAll(e);else throw new Error("Nodes and querySelector are both undefined");de.debug(`Found ${i.length} diagrams`),(n==null?void 0:n.startOnLoad)!==void 0&&(de.debug("Start On Load: "+(n==null?void 0:n.startOnLoad)),ku.updateSiteConfig({startOnLoad:n==null?void 0:n.startOnLoad}
1411));const s=new Js.InitIDGenerator(n.deterministicIds,n.deterministicIDSeed);let o;const a=[];for(const l of Array.from(i)){if(de.info("Rendering diagram: "+l.id),l.getAttribute("data-processed"))continue;l.setAttribute("data-processed","true");const c=`mermaid-${s.next()}`;o=l.innerHTML,o=HK(Js.entityDecode(o)).trim().replace(/<br\s*\/?>/gi,"<br/>");const h=Js.detectInit(o);h&&de.debug("Detected early reinit: ",h);try{const{svg:u,bindFunctions:d}=await SJ(c,o,l);l.innerHTML=u,t&&await t(c),d&&d(l)}catch(u){HLe(u,a,ss.parseError)}}if(a.length>0)throw a[0]},"runThrowsErrors"),wJ=C(function(t){ku.initialize(t)},"initialize"),VLe=C(async function(t,e,r){de.warn("mermaid.init is deprecated. Please use run instead."),t&&wJ(t);const n={postRenderCallback:r,querySelector:".mermaid"};typeof e=="string"?n.querySelector=e:e&&(e instanceof HTMLElement?n.nodes=[e]:n.nodes=e),await vJ(n)},"init"),WLe=C(async(t,{lazyLoad:e=!0}={})=>{A4(),RS(...t),e===!1&&await fLe()},"registerExternalDiagrams"),kJ=C(function(){if(ss.startOnLoad){const{startOnLoad:t}=ku.getConfig();t&&ss.run().catch(e=>de.error("Mermaid failed to initialize",e))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",kJ,!1);var jLe=C(function(t){ss.parseError=t},"setParseErrorHandler"),wv=[],Wk=!1,CJ=C(async()=>{if(!Wk){for(Wk=!0;wv.length>0;){const t=wv.shift();if(t)try{await t()}catch(e){de.error("Error executing queue",e)}}Wk=!1}},"executeQueue"),ULe=C(async(t,e)=>new Promise((r,n)=>{const i=C(()=>new Promise((s,o)=>{ku.parse(t,e).then(a=>{s(a),r(a)},a=>{var l;de.error("Error parsing",a),(l=ss.parseError)==null||l.call(ss,a),o(a),n(a)})}),"performCall");wv.push(i),CJ().catch(n)}),"parse"),SJ=C((t,e,r)=>new Promise((n,i)=>{const s=C(()=>new Promise((o,a)=>{ku.render(t,e,r).then(l=>{o(l),n(l)},l=>{var c;de.error("Error parsing",l),(c=ss.parseError)==null||c.call(ss,l),a(l),i(l)})}),"performCall");wv.push(s),CJ().catch(i)}),"render"),GLe=C(()=>Object.keys(yu).map(t=>({id:t})),"getRegisteredDiagramsMetadata"),ss={startOnLoad:!0,mermaidAPI:ku,parse:ULe,render:SJ,init:VLe,run:vJ,registerExternalDiagrams:WLe,registerLayoutLoaders:LX,initialize:wJ,parseError:void 0,contentLoaded:kJ,setParseErrorHandler:jLe,detectType:vT,registerIconPacks:OMe,getRegisteredDiagramsMetadata:GLe},TJ=ss;/*! Check if previously processed *//*!
1412 * Wait for document loaded before starting the execution
1413 */const KLe={primaryColor:"#0147a1",primaryTextColor:"#374151",primaryBorderColor:"#00142c",lineColor:"#00142c",secondaryColor:"#3b82f6",tertiaryColor:"#10b981",background:"#f8fafc",mainBkg:"#fff",secondBkg:"#dbeafe",tertiaryBkg:"#d1fae5",nodeBorder:"#0147a1",clusterBkg:"#eff6ff",clusterBorder:"#3b82f6",titleColor:"#1f2937",edgeLabelBackground:"#fff",actorBorder:"#0147a1",actorBkg:"#e0e7ff",actorTextColor:"#1f2937",actorLineColor:"#00142c",signalColor:"#1f2937",signalTextColor:"#1f2937",labelBoxBkgColor:"#e0e7ff",labelBoxBorderColor:"#0147a1",labelTextColor:"#1f2937",loopTextColor:"#1f2937",noteBorderColor:"#3b82f6",noteBkgColor:"#dbeafe",noteTextColor:"#1f2937",activationBorderColor:"#0147a1",activationBkgColor:"#e0e7ff",sequenceNumberColor:"#374151"};function YLe(t,e=200){let r=null;return function(...n){clearTimeout(r),r=setTimeout(()=>t.apply(this,n),e)}}async function XLe(){const t=document.querySelectorAll("pre.mermaid:not([data-processed])");if(t.length!==0)try{await TJ.run({nodes:Array.from(t)})}catch(e){console.error("❌ Mermaid rendering error:",e)}}const b_=YLe(XLe,500);TJ.initialize({startOnLoad:!1,theme:"base",themeVariables:KLe,securityLevel:"loose"});document.addEventListener("DOMContentLoaded",b_);document.addEventListener("livewire:navigated",b_);window.Livewire&&document.addEventListener("livewire:init",()=>{Livewire.hook("morph.updated",({el:t})=>{(t.matches&&t.matches("pre.mermaid:not([data-processed])")||t.querySelector&&t.querySelector("pre.mermaid:not([data-processed])"))&&b_()})});function JLe(t){t.data("ToastComponent",e=>({defaultDuration:e.defaultDuration,wireToasts:e.$entangle("toasts"),prod:e.$entangle("prod"),wireToastsIndex:0,toasts:[],pendingToasts:[],pendingRemovals:[],count:0,loaded:!1,init(){window.Toast={component:this,make:(r,n,i,s)=>({title:n,message:r,type:i,duration:s}),debug(r,n="",i=void 0){this.component.add(this.make(r,n,"debug",i??this.component.defaultDuration))},info(r,n="",i=void 0){this.component.add(this.make(r,n,"info",i??this.component.defaultDuration))},success(r,n="",i=void 0){this.component.add(this.make(r,n,"success",i??this.component.defaultDuration))},warning(r,n="",i=void 0){this.component.add(this.make(r,n,"warning",i??this.component.defaultDuration))},danger(r,n="",i=void 0){this.component.add(this.make(r,n,"danger",i??this.component.defaultDuration))}},addEventListener("toast",r=>{this.add(r.detail)}),this.fetchWireToasts(),this.$watch("wireToasts",()=>{this.fetchWireToasts()}),setTimeout(()=>
1413{this.loaded=!0,this.pendingToasts.forEach(r=>{this.add(r)}),this.pendingToasts=null},e.loadDelay)},fetchWireToasts(){this.wireToasts.forEach((r,n)=>{n<this.wireToastsIndex||(this.add(window.Alpine.raw(r)),this.wireToastsIndex++)})},add(r){if(this.loaded!==!0){this.pendingToasts.push(r);return}if(r.type==="debug"){if(this.prod)return;console.log(r.title,r.message)}r.type??(r.type="info"),r.show=0,r.index=this.count,this.toasts[this.count]=r,this.scheduleRemoval(this.count),this.count++},scheduleRemoval(r){Object.keys(this.pendingRemovals).includes(r.toString())||this.toasts[r].duration!==0&&(this.pendingRemovals[r]=setTimeout(()=>{this.remove(r)},this.toasts[r].duration))},scheduleRemovalWithOlder(r=this.count){for(let n=0;n<r;n++)this.scheduleRemoval(n)},cancelRemovalWithNewer(r){for(let n=this.count-1;n>=r;n--)clearTimeout(this.pendingRemovals[n]),delete this.pendingRemovals[n]},remove(r){this.toasts[r]&&(this.toasts[r].show=0),setTimeout(()=>{this.toasts[r]="",delete this.pendingRemovals[r]},500)}}))}var Fm=new Map;function ZLe(t){var e=Fm.get(t);e&&e.destroy()}function QLe(t){var e=Fm.get(t);e&&e.update()}var Xp=null;typeof window>"u"?((Xp=function(t){return t}).destroy=function(t){return t},Xp.update=function(t){return t}):((Xp=function(t,e){return t&&Array.prototype.forEach.call(t.length?t:[t],function(r){return function(n){if(n&&n.nodeName&&n.nodeName==="TEXTAREA"&&!Fm.has(n)){var i,s=null,o=window.getComputedStyle(n),a=(i=n.value,function(){c({testForHeightReduction:i===""||!n.value.startsWith(i),restoreTextAlign:null}),i=n.value}),l=(function(u){n.removeEventListener("autosize:destroy",l),n.removeEventListener("autosize:update",h),n.removeEventListener("input",a),window.removeEventListener("resize",h),Object.keys(u).forEach(function(d){return n.style[d]=u[d]}),Fm.delete(n)}).bind(n,{height:n.style.height,resize:n.style.resize,textAlign:n.style.textAlign,overflowY:n.style.overflowY,overflowX:n.style.overflowX,wordWrap:n.style.wordWrap});n.addEventListener("autosize:destroy",l),n.addEventListener("autosize:update",h),n.addEventListener("input",a),window.addEventListener("resize",h),n.style.overflowX="hidden",n.style.wordWrap="break-word",Fm.set(n,{destroy:l,update:h}),h()}function c(u){var d,f,p=u.restoreTextAlign,m=p===void 0?null:p,g=u.testForHeightReduction,y=g===void 0||g,b=o.overflowY;if(n.scrollHeight!==0&&(o.resize==="vertical"?n.style.resize="none":o.resize==="both"&&(n.style.resize="horizontal"),y&&(d=function(S){for(var k=[];S&&S.parentNode&&S.parentNode instanceof Element;)S.parentNode.scrollTop&&k.push([S.parentNode,S.parentNode.scrollTop]),S=S.parentNode;return function(){return k.forEach(function(w){var _=w[0],L=w[1];_.style.scrollBehavior="auto",_.scrollTop=L,_.style.scrollBehavior=null})}}(n),n.style.height=""),f=o.boxSizing==="content-box"?n.scrollHeight-(parseFloat(o.paddingTop)+parseFloat(o.paddingBottom)):n.scrollHeight+parseFloat(o.borderTopWidth)+parseFloat(o.borderBottomWidth),o.maxHeight!=="none"&&f>parseFloat(o.maxHeight)?(o.overflowY==="hidden"&&(n.style.overflow="scroll"),f=parseFloat(o.maxHeight)):o.overflowY!=="hidden"&&(n.style.overflow="hidden"),n.style.height=f+"px",m&&(n.style.textAlign=m),d&&d(),s!==f&&(n.dispatchEvent(new Event("autosize:resized",{bubbles:!0})),s=f),b!==o.overflow&&!m)){var x=o.textAlign;o.overflow==="hidden"&&(n.style.textAlign=x==="start"?"end":"start"),c({restoreTextAlign:x,testForHeightReduction:!0})}}function h(){c({testForHeightReduction:!0,restoreTextAlign:null})}}(r)}),t}).destroy=function(t){return t&&Array.prototype.forEach.call(t.length?t:[t],ZLe),t},Xp.update=function(t){return t&&Array.prototype.forEach.call(t.length?t:[t],QLe),t});var jk=Xp;function eDe(t){t.directive("autosize",(e,{modifiers:r},{cleanup:n})=>{jk(e);const i=Array.from(e.attributes);let s=!1;for(let{nodeName:a}of i)if(a==="wire:model"||a.startsWith("wire:model.")){s=!0;break}!e.hasAttribute("wire:ignore")&&s&&e.setAttribute("wire:ignore","");const o=()=>{jk.update(e)};e.addEventListener("autosize",o),n(()=>{jk.destroy(e),e.removeEventListener("autosize",o)})}),t.magic("autosize",e=>r=>{(r||e).dispatchEvent(new Event("autosize"))})}window.loadPptxExport=()=>J(()=>import("./pptx-export-Cd42YgqY.js"),__vite__mapDeps([76,2]));document.addEventListener("livewire:init",()=>{window.Alpine.plugin(eDe),window.Alpine.plugin(JLe),Livewire.on("scroll-to-zone",t=>{const e=t.target||".chat-update-highlight";setTimeout(()=>{const r=document.querySelectorAll(".chat-update-highlight"),n=r[r.length-1]||document.querySelector(e);
1413if(n)n.scrollIntoView({behavior:"smooth",block:"center"}),console.log("🎯 Scroll vers élément mis à jour:",n),n.style.boxShadow="0 0 0 6px rgba(59, 130, 246, 0.5)",n.style.transform="scale(1.03)",n.style.transition="all 0.3s ease",n.style.backgroundColor="#dbeafe",setTimeout(()=>{n.style.boxShadow="",n.style.transform="",n.style.backgroundColor=""},4e3);else{console.log("❌ Aucun élément trouvé pour:",e);const i=document.querySelector("#zone-1-result");i&&i.scrollIntoView({behavior:"smooth",block:"start"})}},2e3)}),Livewire.on("scroll-to-first-highlight",()=>{setTimeout(()=>{const t=document.querySelector(".chat-addition-highlight, .chat-replacement-highlight");t&&(t.scrollIntoView({behavior:"smooth",block:"center"}),t.style.transition="box-shadow 0.3s ease, transform 0.3s ease",t.style.boxShadow="0 0 0 6px rgba(34, 197, 94, 0.35)",t.style.transform="scale(1.01)",setTimeout(()=>{t.style.boxShadow="",t.style.transform=""},3e3))},500)}),Livewire.on("scroll-to-modifications",()=>{setTimeout(()=>{const t=document.querySelectorAll(".chat-addition-highlight, .chat-new-section, .chat-replacement-highlight"),e=t&&t.length?t[0]:document.querySelector("#zone-1-result");e&&e.scrollIntoView({behavior:"smooth",block:"center"}),t.forEach(r=>{r.classList.add("chat-flash");const n=r.style.backgroundColor,i=r.style.boxShadow;r.style.backgroundColor="#ecfccb",r.style.boxShadow="0 0 0 3px rgba(34,197,94,0.35)",setTimeout(()=>{r.classList.remove("chat-flash"),r.style.backgroundColor=n,r.style.boxShadow=i},2500)})},600)}),setTimeout(()=>{["chat-addition-highlight","chat-replacement-highlight","chat-new-section","chat-flash"].forEach(e=>{document.querySelectorAll("."+e).forEach(r=>r.classList.remove(e))})},250),Livewire.on("notify",t=>{const e=t[0]||t;let r=e.type||"info";const n=e.message||"",i=e.title||"",s=e.duration||3e3;r==="error"&&(r="danger"),window.Toast&&typeof window.Toast[r]=="function"&&window.Toast[r](n,i,s)}),Livewire.on("toast-error",t=>{const e=t[0]||t,r=e.message||e;window.Toast&&window.Toast.danger(r,"",3e3)})});window.copyElementToClipboard=function(e){if(!e){console.error("Element not found");return}const r=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),n=e.innerText||e.textContent;if(r)try{const i=document.createElement("input");i.value=n,document.body.appendChild(i),i.select(),document.execCommand("copy"),document.body.removeChild(i)}catch(i){console.error("Safari: Failed to copy text:",i)}else{const i=document.createElement("textarea");i.value=n,i.setAttribute("readonly",""),i.style.position="absolute",i.style.left="-9999px",document.body.appendChild(i),i.select();try{document.execCommand("copy")}catch(s){console.error("Chrome: Failed to copy text:",s)}document.body.removeChild(i)}};export{Ve as $,eIe as A,Bm as B,fSe as C,Lj as D,QT as E,Hn as F,y_e as G,f6e as H,U9e as I,ZTe as J,yI as K,ASe as L,Nf as M,MDe as N,GSe as O,wT as P,b4 as Q,vI as R,N9e as S,Lb as T,g_e as U,Y1 as V,zj as W,t6e as X,K1 as Y,l_e as Z,J as _,C as a,Ec as a$,it as a0,I9e as a1,zI as a2,$I as a3,FDe as a4,IDe as a5,PDe as a6,RDe as a7,LDe as a8,BT as a9,Kve as aA,_n as aB,yR as aC,B6 as aD,ls as aE,dre as aF,Lt as aG,pr as aH,Or as aI,gDe as aJ,ze as aK,ce as aL,fDe as aM,oDe as aN,tR as aO,tre as aP,ZQ as aQ,O6 as aR,dM as aS,pDe as aT,iDe as aU,TDe as aV,moe as aW,Lse as aX,XP as aY,bs as aZ,Kf as a_,NDe as aa,DDe as ab,Uu as ac,zDe as ad,$De as ae,BDe as af,nAe as ag,MX as ah,ZDe as ai,TK as aj,rn as ak,Fc as al,UT as am,e_e as an,QK as ao,Ru as ap,xt as aq,ia as ar,ZP as as,mDe as at,jse as au,_se as av,se as aw,U3 as ax,Bse as ay,SDe as az,Qr as b,oee as b$,Yf as b0,oV as b1,Tr as b2,Wse as b3,ks as b4,Vv as b5,fh as b6,Q as b7,G3 as b8,KAe as b9,see as bA,OT as bB,ql as bC,Lg as bD,II as bE,f8e as bF,bK as bG,Ke as bH,ET as bI,eU as bJ,Oi as bK,J1 as bL,o8e as bM,nU as bN,ODe as bO,dSe as bP,eee as bQ,aee as bR,Jte as bS,L6 as bT,Vee as bU,hre as bV,Hb as bW,Gee as bX,Jee as bY,p1 as bZ,Wb as b_,JDe as ba,QDe as bb,YDe as bc,Xe as bd,XDe as be,OAe as bf,TAe as bg,SAe as bh,DMe as bi,B9e as bj,Sue as bk,$F as bl,_De as bm,EMe as bn,OMe as bo,ey as bp,K_ as bq,cee as br,lR as bs,Ov as bt,Lv as bu,qb as bv,wQ as bw,ZB as bx,as as by,eR as bz,c6e as c,cR as c0,Gte as c1,Kte as c2,Uf as c3,eh as c4,tM as c5,GQ as c6,D6 as c7,zte as c8,Yte as c9,Gf as ca,Ac as cb,uM as cc,I6 as cd,rR as ce,n3 as cf,n
1413R as cg,Dv as ch,Cu as ci,l6e as d,Zt as e,d0 as f,a6e as g,MK as h,fl as i,Rs as j,$t as k,de as l,$j as m,xK as n,h6e as o,u6e as p,QTe as q,wAe as r,o6e as s,HDe as t,Js as u,s6e as v,v_e as w,EDe as x,ADe as y,tIe as z};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.