AI-native knowledge base & Evernote/Obsidian alternative with instant sync & native MCP. Free on Cloudflare or self-hosted via Docker.
HTML ai-agentcloudflarecloudflare-d1cloudflare-r2cloudflare-workersdockerelectronevernoteevernote-alternativeknowledge-basemcpnote-takingobsidian-alternativeoffline-firstpersonal-knowledge-basepwaself-hostedsqlitetiptapweb-clipper
Default note image sharing to Aurora across platforms
tianma-if5397a1ff5649
diff --git a/apps/ios/EdgeEver/Features/Workspace/MemoDetailView.swift b/apps/ios/EdgeEver/Features/Workspace/MemoDetailView.swiftindex 15a25830..0f416a0b 100644--- a/apps/ios/EdgeEver/Features/Workspace/MemoDetailView.swift+++ b/apps/ios/EdgeEver/Features/Workspace/MemoDetailView.swift@@ -23,7 +23,7 @@ struct MemoDetailView: View {@State private var imageExportBuffer = MemoImageExportBuffer()@State private var imageShareOptionsOpen = false@State private var imageShareFormat = "png"- @State private var imageShareTheme = "slate"+ @State private var imageShareTheme = "aurora"@State private var imageShareFontStyle = "serif"@State private var imageShareFontSize = "lg"@State private var imageShareCardWidth = "standard"@@ -186,7 +186,6 @@ struct MemoDetailView: View {Form {Section(env.preferences.t("主题风格", en: "Theme", pl: "Motyw")) {Picker(env.preferences.t("主题风格", en: "Theme", pl: "Motyw"), selection: $imageShareTheme) {- Text(env.preferences.t("经典浅色", en: "Light", pl: "Jasny")).tag("slate")Text(env.preferences.t("极光渐变", en: "Aurora", pl: "Zorza")).tag("aurora")Text(env.preferences.t("暮色晚霞", en: "Sunset", pl: "Zachód słońca")).tag("sunset")Text(env.preferences.t("暗夜曜石", en: "Midnight", pl: "Północ")).tag("midnight")@@ -1149,7 +1148,7 @@ struct MemoDetailView: View {private func exportMemoImage(_ memo: MemoDetail,format: String,- theme: String = "slate",+ theme: String = "aurora",fontStyle: String = "serif",fontSize: String = "lg",cardWidth: String = "standard",diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/index.html b/apps/ios/EdgeEver/Resources/EditorBundle/index.htmlindex 2b3aff50..2d814803 100644--- a/apps/ios/EdgeEver/Resources/EditorBundle/index.html+++ b/apps/ios/EdgeEver/Resources/EditorBundle/index.html@@ -7,7 +7,7 @@content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/><title>EdgeEver Editor</title>- <script type="module" crossorigin>var zYe=Object.defineProperty;var VYe=(t,e,r)=>e in t?zYe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var wr=(t,e,r)=>VYe(t,typeof e!="symbol"?e+"":e,r);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&n(a)}).observe(document,{childList:!0,subtree:!0});function r(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(i){if(i.ep)return;i.ep=!0;const s=r(i);fetch(i.href,s)}})();function gn(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function Nn(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(s=(i<3?a(s):i>3?a(e,r,s):a(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}function aX(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function o(h){try{u(n.next(h))}catch(d){a(d)}}function l(h){try{u(n.throw(h))}catch(d){a(d)}}function u(h){h.done?s(h.value):i(h.value).then(o,l)}u((n=n.apply(t,e||[])).next())})}function HYe(t){t.forEach(e=>{Object.hasOwn(e,"append")||Object.defineProperty(e,"append",{configurable:!0,enumerable:!0,writable:!0,value(...r){const n=document.createDocumentFragment();r.forEach(i=>{const s=i instanceof Node;n.appendChild(s?i:document.createTextNode(String(i)))}),this.appendChild(n)}})})}typeof window=="object"&&window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach);typeof window<"u"&&(t=>{HYe(t)})([Element.prototype,Document.prototype,DocumentFragment.prototype]);var cve=typeof global=="object"&&global&&global.Object===Object&&global,GYe=typeof self=="object"&&self&&self.Object===Object&&self,Ih=cve||GYe||Function("return this")(),Mu=Ih.Symbol,uve=Object.prototype,WYe=uve.hasOwnProperty,qYe=uve.toString,V3=Mu?Mu.toStringTag:void 0;function UYe(t){var e=WYe.call(t,V3),r=t[V3];try{t[V3]=void 0;var n=!0}catch{}var i=qYe.call(t);return n&&(e?t[V3]=r:delete t[V3]),i}var jYe=Object.prototype,YYe=jYe.toString;function XYe(t){return YYe.call(t)}var KYe="[object Null]",ZYe="[object Undefined]",bie=Mu?Mu.toStringTag:void 0;function Hg(t){return t==null?t===void 0?ZYe:KYe:bie&&bie in Object(t)?UYe(t):XYe(t)}function Eh(t){return t!=null&&typeof t=="object"}var QYe="[object Symbol]";function _d(t){return typeof t=="symbol"||Eh(t)&&Hg(t)==QYe}function yb(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}var Bs=Array.isArray,xie=Mu?Mu.prototype:void 0,wie=xie?xie.toString:void 0;function hve(t){if(typeof t=="string")return t;if(Bs(t))return yb(t,hve)+"";if(_d(t))return wie?wie.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}var JYe=/\s/;function eXe(t){for(var e=t.length;e--&&JYe.test(t.charAt(e)););return e}var tXe=/^\s+/;function rXe(t){return t&&t.slice(0,eXe(t)+1).replace(tXe,"")}function $s(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Tie=NaN,nXe=/^[-+]0x[0-9a-f]+$/i,iXe=/^0b[01]+$/i,sXe=/^0o[0-7]+$/i,aXe=parseInt;function vb(t){if(typeof t=="number")return t;if(_d(t))return Tie;if($s(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=$s(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=rXe(t);var r=iXe.test(t);return r||sXe.test(t)?aXe(t.slice(2),r?2:8):nXe.test(t)?Tie:+t}var Cie=1/0,oXe=17976931348623157e292;function bM(t){if(!t)return t===0?t:0;if(t=vb(t),t===Cie||t===-Cie){var e=t<0?-1:1;return e*oXe}return t===t?t:0}function lXe(t){var e=bM(t),r=e%1;return e===e?r?e-r:e:0}function Gg(t){return t}var cXe="[object AsyncFunction]",uXe="[object Function]",hXe="[object GeneratorFunction]",dXe="[object Proxy]";function _S(t){if(!$s(t))return!1;var e=Hg(t);return e==uXe||e==hXe||e==cXe||e==dXe}var KP=Ih["__core-js_shared__"],kie=(function(){var t=/[^.]+$/.exec(KP&&KP.keys&&KP.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function fXe(t){return!!kie&&kie in t}var pXe=Function.prototype,gXe=pXe.toString;function Gy(t){if(t!=null){try{return gXe.call(t)}catch{}try{return t+""}catch{}}return""}var mXe=/[\\^$.*+?()[\]{}|]/g,yXe=/^\[object .+?Constructor\]$/,vXe=Function.prototype,bXe=Object.prototype,xXe=vXe.toString,wXe=bXe.hasOwnProperty,TXe=RegExp("^"+xXe.call(wXe).replace(mXe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function CXe(t){if(!$s(t)||fXe(t))return!1;var e=_S(t)?TXe:yXe;return e.test(Gy(t))}function kXe(t,e){return t==null?void 0:t[e]}function Wy(t,e){var r=kXe(t,e);return CXe(r)?r:void 0}var FV=Wy(Ih,"WeakMap"),Sie=Object.create,SXe=(function(){function t(){}return function(e){if(!$s(e))return{};if(Sie)return Sie(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}})();function dve(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 EXe(){}function fve(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var AXe=800,MXe=16,RXe=Date.now;function _Xe(t){var e=0,r=0;return function(){var n=RXe(),i=MXe-(n-r);if(r=n,i>0){if(++e>=AXe)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Y2(t){return function(){return t}}var s9=(function(){try{var t=Wy(Object,"defineProperty");return t({},"",{}),t}catch{}})(),LXe=s9?function(t,e){return s9(t,"toString",{configurable:!0,enumerable:!1,value:Y2(e),writable:!0})}:Gg,pve=_Xe(LXe);function gve(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}function mve(t,e,r,n){for(var i=t.length,s=r+-1;++s<i;)if(e(t[s],s,t))return s;return-1}function IXe(t){return t!==t}function NXe(t,e,r){for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}function DXe(t,e,r){return e===e?NXe(t,e,r):mve(t,IXe,r)}function yve(t,e){var r=t==null?0:t.length;return!!r&&DXe(t,e,0)>-1}var OXe=9007199254740991,PXe=/^(?:0|[1-9]\d*)$/;function iN(t,e){var r=typeof t;return e=e??OXe,!!e&&(r=="number"||r!="symbol"&&PXe.test(t))&&t>-1&&t%1==0&&t<e}function R6(t,e,r){e=="__proto__"&&s9?s9(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function K5(t,e){return t===e||t!==t&&e!==e}var $Xe=Object.prototype,BXe=$Xe.hasOwnProperty;function sN(t,e,r){var n=t[e];(!(BXe.call(t,e)&&K5(n,r))||r===void 0&&!(e in t))&&R6(t,e,r)}function _6(t,e,r,n){var i=!r;r||(r={});for(var s=-1,a=e.length;++s<a;){var o=e[s],l=void 0;l===void 0&&(l=t[o]),i?R6(r,o,l):sN(r,o,l)}return r}var Eie=Math.max;function vve(t,e,r){return e=Eie(e===void 0?t.length-1:e,0),function(){for(var n=arguments,i=-1,s=Eie(n.length-e,0),a=Array(s);++i<s;)a[i]=n[e+i];i=-1;for(var o=Array(e+1);++i<e;)o[i]=n[i];return o[e]=r(a),dve(t,this,o)}}function Z5(t,e){return pve(vve(t,e,Gg),t+"")}var FXe=9007199254740991;function oX(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=FXe}function Wg(t){return t!=null&&oX(t.length)&&!_S(t)}function LS(t,e,r){if(!$s(r))return!1;var n=typeof e;return(n=="number"?Wg(r)&&iN(e,r.length):n=="string"&&e in r)?K5(r[e],t):!1}function bve(t){return Z5(function(e,r){var n=-1,i=r.length,s=i>1?r[i-1]:void 0,a=i>2?r[2]:void 0;for(s=t.length>3&&typeof s=="function"?(i--,s):void 0,a&&LS(r[0],r[1],a)&&(s=i<3?void 0:s,i=1),e=Object(e);++n<i;){var o=r[n];o&&t(e,o,n,s)}return e})}var zXe=Object.prototype;function aN(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||zXe;return t===r}function VXe(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var HXe="[object Arguments]";function Aie(t){return Eh(t)&&Hg(t)==HXe}var xve=Object.prototype,GXe=xve.hasOwnProperty,WXe=xve.propertyIsEnumerable,NT=Aie((function(){return arguments})())?Aie:function(t){return Eh(t)&&GXe.call(t,"callee")&&!WXe.call(t,"callee")};function qXe(){return!1}var wve=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Mie=wve&&typeof module=="object"&&module&&!module.nodeType&&module,UXe=Mie&&Mie.exports===wve,Rie=UXe?Ih.Buffer:void 0,jXe=Rie?Rie.isBuffer:void 0,DT=jXe||qXe,YXe="[object Arguments]",XXe="[object Array]",KXe="[object Boolean]",ZXe="[object Date]",QXe="[object Error]",JXe="[object Function]",eKe="[object Map]",tKe="[object Number]",rKe="[object Object]",nKe="[object RegExp]",iKe="[object Set]",sKe="[object String]",aKe="[object WeakMap]",oKe="[object ArrayBuffer]",lKe="[object DataView]",cKe="[object Float32Array]",uKe="[object Float64Array]",hKe="[object Int8Array]",dKe="[object Int16Array]",fKe="[object Int32Array]",pKe="[object Uint8Array]",gKe="[object Uint8ClampedArray]",mKe="[object Uint16Array]",yKe="[object Uint32Array]",Ui={};Ui[cKe]=Ui[uKe]=Ui[hKe]=Ui[dKe]=Ui[fKe]=Ui[pKe]=Ui[gKe]=Ui[mKe]=Ui[yKe]=!0;Ui[YXe]=Ui[XXe]=Ui[oKe]=Ui[KXe]=Ui[lKe]=Ui[ZXe]=Ui[QXe]=Ui[JXe]=Ui[eKe]=Ui[tKe]=Ui[rKe]=Ui[nKe]=Ui[iKe]=Ui[sKe]=Ui[aKe]=!1;function vKe(t){return Eh(t)&&oX(t.length)&&!!Ui[Hg(t)]}function oN(t){return function(e){return t(e)}}var Tve=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Dk=Tve&&typeof module=="object"&&module&&!module.nodeType&&module,bKe=Dk&&Dk.exports===Tve,ZP=bKe&&cve.process,OT=(function(){try{var t=Dk&&Dk.require&&Dk.require("util").types;return t||ZP&&ZP.binding&&ZP.binding("util")}catch{}})(),_ie=OT&&OT.isTypedArray,lN=_ie?oN(_ie):vKe,xKe=Object.prototype,wKe=xKe.hasOwnProperty;function Cve(t,e){var r=Bs(t),n=!r&&NT(t),i=!r&&!n&&DT(t),s=!r&&!n&&!i&&lN(t),a=r||n||i||s,o=a?VXe(t.length,String):[],l=o.length;for(var u in t)(e||wKe.call(t,u))&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||s&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||iN(u,l)))&&o.push(u);return o}function kve(t,e){return function(r){return t(e(r))}}var TKe=kve(Object.keys,Object),CKe=Object.prototype,kKe=CKe.hasOwnProperty;function Sve(t){if(!aN(t))return TKe(t);var e=[];for(var r in Object(t))kKe.call(t,r)&&r!="constructor"&&e.push(r);return e}function Lc(t){return Wg(t)?Cve(t):Sve(t)}function SKe(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var EKe=Object.prototype,AKe=EKe.hasOwnProperty;function MKe(t){if(!$s(t))return SKe(t);var e=aN(t),r=[];for(var n in t)n=="constructor"&&(e||!AKe.call(t,n))||r.push(n);return r}function qy(t){return Wg(t)?Cve(t,!0):MKe(t)}var RKe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,_Ke=/^\w*$/;function lX(t,e){if(Bs(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||_d(t)?!0:_Ke.test(t)||!RKe.test(t)||e!=null&&t in Object(e)}var IS=Wy(Object,"create");function LKe(){this.__data__=IS?IS(null):{},this.size=0}function IKe(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var NKe="__lodash_hash_undefined__",DKe=Object.prototype,OKe=DKe.hasOwnProperty;function PKe(t){var e=this.__data__;if(IS){var r=e[t];return r===NKe?void 0:r}return OKe.call(e,t)?e[t]:void 0}var $Ke=Object.prototype,BKe=$Ke.hasOwnProperty;function FKe(t){var e=this.__data__;return IS?e[t]!==void 0:BKe.call(e,t)}var zKe="__lodash_hash_undefined__";function VKe(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=IS&&e===void 0?zKe:e,this}function uy(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])}}uy.prototype.clear=LKe;uy.prototype.delete=IKe;uy.prototype.get=PKe;uy.prototype.has=FKe;uy.prototype.set=VKe;function HKe(){this.__data__=[],this.size=0}function cN(t,e){for(var r=t.length;r--;)if(K5(t[r][0],e))return r;return-1}var GKe=Array.prototype,WKe=GKe.splice;function qKe(t){var e=this.__data__,r=cN(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():WKe.call(e,r,1),--this.size,!0}function UKe(t){var e=this.__data__,r=cN(e,t);return r<0?void 0:e[r][1]}function jKe(t){return cN(this.__data__,t)>-1}function YKe(t,e){var r=this.__data__,n=cN(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function $0(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])}}$0.prototype.clear=HKe;$0.prototype.delete=qKe;$0.prototype.get=UKe;$0.prototype.has=jKe;$0.prototype.set=YKe;var NS=Wy(Ih,"Map");function XKe(){this.size=0,this.__data__={hash:new uy,map:new(NS||$0),string:new uy}}function KKe(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function uN(t,e){var r=t.__data__;return KKe(e)?r[typeof e=="string"?"string":"hash"]:r.map}function ZKe(t){var e=uN(this,t).delete(t);return this.size-=e?1:0,e}function QKe(t){return uN(this,t).get(t)}function JKe(t){return uN(this,t).has(t)}function eZe(t,e){var r=uN(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function B0(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])}}B0.prototype.clear=XKe;B0.prototype.delete=ZKe;B0.prototype.get=QKe;B0.prototype.has=JKe;B0.prototype.set=eZe;var tZe="Expected a function";function cX(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(tZe);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 a=t.apply(this,n);return r.cache=s.set(i,a)||s,a};return r.cache=new(cX.Cache||B0),r}cX.Cache=B0;var rZe=500;function nZe(t){var e=cX(t,function(n){return r.size===rZe&&r.clear(),n}),r=e.cache;return e}var iZe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,sZe=/\\(\\)?/g,aZe=nZe(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(iZe,function(r,n,i,s){e.push(i?s.replace(sZe,"$1"):n||r)}),e});function Q5(t){return t==null?"":hve(t)}function hN(t,e){return Bs(t)?t:lX(t,e)?[t]:aZe(Q5(t))}function L6(t){if(typeof t=="string"||_d(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function dN(t,e){e=hN(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[L6(e[r++])];return r&&r==n?t:void 0}function oZe(t,e,r){var n=t==null?void 0:dN(t,e);return n===void 0?r:n}function uX(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}var Lie=Mu?Mu.isConcatSpreadable:void 0;function lZe(t){return Bs(t)||NT(t)||!!(Lie&&t&&t[Lie])}function fN(t,e,r,n,i){var s=-1,a=t.length;for(r||(r=lZe),i||(i=[]);++s<a;){var o=t[s];r(o)?uX(i,o):n||(i[i.length]=o)}return i}function J5(t){var e=t==null?0:t.length;return e?fN(t):[]}function cZe(t){return pve(vve(t,void 0,J5),t+"")}var hX=kve(Object.getPrototypeOf,Object),uZe="[object Object]",hZe=Function.prototype,dZe=Object.prototype,Eve=hZe.toString,fZe=dZe.hasOwnProperty,pZe=Eve.call(Object);function Nh(t){if(!Eh(t)||Hg(t)!=uZe)return!1;var e=hX(t);if(e===null)return!0;var r=fZe.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Eve.call(r)==pZe}function gZe(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),r=r>i?i:r,r<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var s=Array(i);++n<i;)s[n]=t[n+e];return s}function mZe(t,e,r){var n=t.length;return r=r===void 0?n:r,!e&&r>=n?t:gZe(t,e,r)}var yZe="\\ud800-\\udfff",vZe="\\u0300-\\u036f",bZe="\\ufe20-\\ufe2f",xZe="\\u20d0-\\u20ff",wZe=vZe+bZe+xZe,TZe="\\ufe0e\\ufe0f",CZe="\\u200d",kZe=RegExp("["+CZe+yZe+wZe+TZe+"]");function Ave(t){return kZe.test(t)}function SZe(t){return t.split("")}var Mve="\\ud800-\\udfff",EZe="\\u0300-\\u036f",AZe="\\ufe20-\\ufe2f",MZe="\\u20d0-\\u20ff",RZe=EZe+AZe+MZe,_Ze="\\ufe0e\\ufe0f",LZe="["+Mve+"]",zV="["+RZe+"]",VV="\\ud83c[\\udffb-\\udfff]",IZe="(?:"+zV+"|"+VV+")",Rve="[^"+Mve+"]",_ve="(?:\\ud83c[\\udde6-\\uddff]){2}",Lve="[\\ud800-\\udbff][\\udc00-\\udfff]",NZe="\\u200d",Ive=IZe+"?",Nve="["+_Ze+"]?",DZe="(?:"+NZe+"(?:"+[Rve,_ve,Lve].join("|")+")"+Nve+Ive+")*",OZe=Nve+Ive+DZe,PZe="(?:"+[Rve+zV+"?",zV,_ve,Lve,LZe].join("|")+")",$Ze=RegExp(VV+"(?="+VV+")|"+PZe+OZe,"g");function BZe(t){return t.match($Ze)||[]}function FZe(t){return Ave(t)?BZe(t):SZe(t)}function Dve(t){return function(e){e=Q5(e);var r=Ave(e)?FZe(e):void 0,n=r?r[0]:e.charAt(0),i=r?mZe(r,1).join(""):e.slice(1);return n[t]()+i}}var a9=Dve("toUpperCase");function zZe(t){return a9(Q5(t).toLowerCase())}function Ove(t,e,r,n){var i=-1,s=t==null?0:t.length;for(n&&s&&(r=t[++i]);++i<s;)r=e(r,t[i],i,t);return r}function VZe(t){return function(e){return t==null?void 0:t[e]}}var HZe={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},GZe=VZe(HZe),WZe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,qZe="\\u0300-\\u036f",UZe="\\ufe20-\\ufe2f",jZe="\\u20d0-\\u20ff",YZe=qZe+UZe+jZe,XZe="["+YZe+"]",KZe=RegExp(XZe,"g");function ZZe(t){return t=Q5(t),t&&t.replace(WZe,GZe).replace(KZe,"")}var QZe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function JZe(t){return t.match(QZe)||[]}var eQe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function tQe(t){return eQe.test(t)}var Pve="\\ud800-\\udfff",rQe="\\u0300-\\u036f",nQe="\\ufe20-\\ufe2f",iQe="\\u20d0-\\u20ff",sQe=rQe+nQe+iQe,$ve="\\u2700-\\u27bf",Bve="a-z\\xdf-\\xf6\\xf8-\\xff",aQe="\\xac\\xb1\\xd7\\xf7",oQe="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",lQe="\\u2000-\\u206f",cQe=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Fve="A-Z\\xc0-\\xd6\\xd8-\\xde",uQe="\\ufe0e\\ufe0f",zve=aQe+oQe+lQe+cQe,Vve="['’]",Iie="["+zve+"]",hQe="["+sQe+"]",Hve="\\d+",dQe="["+$ve+"]",Gve="["+Bve+"]",Wve="[^"+Pve+zve+Hve+$ve+Bve+Fve+"]",fQe="\\ud83c[\\udffb-\\udfff]",pQe="(?:"+hQe+"|"+fQe+")",gQe="[^"+Pve+"]",qve="(?:\\ud83c[\\udde6-\\uddff]){2}",Uve="[\\ud800-\\udbff][\\udc00-\\udfff]",f2="["+Fve+"]",mQe="\\u200d",Nie="(?:"+Gve+"|"+Wve+")",yQe="(?:"+f2+"|"+Wve+")",Die="(?:"+Vve+"(?:d|ll|m|re|s|t|ve))?",Oie="(?:"+Vve+"(?:D|LL|M|RE|S|T|VE))?",jve=pQe+"?",Yve="["+uQe+"]?",vQe="(?:"+mQe+"(?:"+[gQe,qve,Uve].join("|")+")"+Yve+jve+")*",bQe="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",xQe="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",wQe=Yve+jve+vQe,TQe="(?:"+[dQe,qve,Uve].join("|")+")"+wQe,CQe=RegExp([f2+"?"+Gve+"+"+Die+"(?="+[Iie,f2,"$"].join("|")+")",yQe+"+"+Oie+"(?="+[Iie,f2+Nie,"$"].join("|")+")",f2+"?"+Nie+"+"+Die,f2+"+"+Oie,xQe,bQe,Hve,TQe].join("|"),"g");function kQe(t){return t.match(CQe)||[]}function SQe(t,e,r){return t=Q5(t),e=e,e===void 0?tQe(t)?kQe(t):JZe(t):t.match(e)||[]}var EQe="['’]",AQe=RegExp(EQe,"g");function Xve(t){return function(e){return Ove(SQe(ZZe(e).replace(AQe,"")),t,"")}}var I6=Xve(function(t,e,r){return e=e.toLowerCase(),t+(r?zZe(e):e)});function Pie(){if(!arguments.length)return[];var t=arguments[0];return Bs(t)?t:[t]}function MQe(t,e,r){return t===t&&(r!==void 0&&(t=t<=r?t:r),e!==void 0&&(t=t>=e?t:e)),t}function Y1(t,e,r){return r===void 0&&(r=e,e=void 0),r!==void 0&&(r=vb(r),r=r===r?r:0),e!==void 0&&(e=vb(e),e=e===e?e:0),MQe(vb(t),e,r)}function RQe(){this.__data__=new $0,this.size=0}function _Qe(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function LQe(t){return this.__data__.get(t)}function IQe(t){return this.__data__.has(t)}var NQe=200;function DQe(t,e){var r=this.__data__;if(r instanceof $0){var n=r.__data__;if(!NS||n.length<NQe-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new B0(n)}return r.set(t,e),this.size=r.size,this}function hh(t){var e=this.__data__=new $0(t);this.size=e.size}hh.prototype.clear=RQe;hh.prototype.delete=_Qe;hh.prototype.get=LQe;hh.prototype.has=IQe;hh.prototype.set=DQe;function OQe(t,e){return t&&_6(e,Lc(e),t)}function PQe(t,e){return t&&_6(e,qy(e),t)}var Kve=typeof exports=="object"&&exports&&!exports.nodeType&&exports,$ie=Kve&&typeof module=="object"&&module&&!module.nodeType&&module,$Qe=$ie&&$ie.exports===Kve,Bie=$Qe?Ih.Buffer:void 0,Fie=Bie?Bie.allocUnsafe:void 0;function Zve(t,e){if(e)return t.slice();var r=t.length,n=Fie?Fie(r):new t.constructor(r);return t.copy(n),n}function Qve(t,e){for(var r=-1,n=t==null?0:t.length,i=0,s=[];++r<n;){var a=t[r];e(a,r,t)&&(s[i++]=a)}return s}function Jve(){return[]}var BQe=Object.prototype,FQe=BQe.propertyIsEnumerable,zie=Object.getOwnPropertySymbols,dX=zie?function(t){return t==null?[]:(t=Object(t),Qve(zie(t),function(e){return FQe.call(t,e)}))}:Jve;function zQe(t,e){return _6(t,dX(t),e)}var VQe=Object.getOwnPropertySymbols,e2e=VQe?function(t){for(var e=[];t;)uX(e,dX(t)),t=hX(t);return e}:Jve;function HQe(t,e){return _6(t,e2e(t),e)}function t2e(t,e,r){var n=e(t);return Bs(t)?n:uX(n,r(t))}function HV(t){return t2e(t,Lc,dX)}function GQe(t){return t2e(t,qy,e2e)}var GV=Wy(Ih,"DataView"),WV=Wy(Ih,"Promise"),bb=Wy(Ih,"Set"),Vie="[object Map]",WQe="[object Object]",Hie="[object Promise]",Gie="[object Set]",Wie="[object WeakMap]",qie="[object DataView]",qQe=Gy(GV),UQe=Gy(NS),jQe=Gy(WV),YQe=Gy(bb),XQe=Gy(FV),du=Hg;(GV&&du(new GV(new ArrayBuffer(1)))!=qie||NS&&du(new NS)!=Vie||WV&&du(WV.resolve())!=Hie||bb&&du(new bb)!=Gie||FV&&du(new FV)!=Wie)&&(du=function(t){var e=Hg(t),r=e==WQe?t.constructor:void 0,n=r?Gy(r):"";if(n)switch(n){case qQe:return qie;case UQe:return Vie;case jQe:return Hie;case YQe:return Gie;case XQe:return Wie}return e});var KQe=Object.prototype,ZQe=KQe.hasOwnProperty;function QQe(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&ZQe.call(t,"index")&&(r.index=t.index,r.input=t.input),r}var o9=Ih.Uint8Array;function fX(t){var e=new t.constructor(t.byteLength);return new o9(e).set(new o9(t)),e}function JQe(t,e){var r=e?fX(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var eJe=/\w*$/;function tJe(t){var e=new t.constructor(t.source,eJe.exec(t));return e.lastIndex=t.lastIndex,e}var Uie=Mu?Mu.prototype:void 0,jie=Uie?Uie.valueOf:void 0;function rJe(t){return jie?Object(jie.call(t)):{}}function r2e(t,e){var r=e?fX(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var nJe="[object Boolean]",iJe="[object Date]",sJe="[object Map]",aJe="[object Number]",oJe="[object RegExp]",lJe="[object Set]",cJe="[object String]",uJe="[object Symbol]",hJe="[object ArrayBuffer]",dJe="[object DataView]",fJe="[object Float32Array]",pJe="[object Float64Array]",gJe="[object Int8Array]",mJe="[object Int16Array]",yJe="[object Int32Array]",vJe="[object Uint8Array]",bJe="[object Uint8ClampedArray]",xJe="[object Uint16Array]",wJe="[object Uint32Array]";function TJe(t,e,r){var n=t.constructor;switch(e){case hJe:return fX(t);case nJe:case iJe:return new n(+t);case dJe:return JQe(t,r);case fJe:case pJe:case gJe:case mJe:case yJe:case vJe:case bJe:case xJe:case wJe:return r2e(t,r);case sJe:return new n;case aJe:case cJe:return new n(t);case oJe:return tJe(t);case lJe:return new n;case uJe:return rJe(t)}}function n2e(t){return typeof t.constructor=="function"&&!aN(t)?SXe(hX(t)):{}}var CJe="[object Map]";function kJe(t){return Eh(t)&&du(t)==CJe}var Yie=OT&&OT.isMap,SJe=Yie?oN(Yie):kJe,EJe="[object Set]";function AJe(t){return Eh(t)&&du(t)==EJe}var Xie=OT&&OT.isSet,MJe=Xie?oN(Xie):AJe,RJe=1,_Je=2,LJe=4,i2e="[object Arguments]",IJe="[object Array]",NJe="[object Boolean]",DJe="[object Date]",OJe="[object Error]",s2e="[object Function]",PJe="[object GeneratorFunction]",$Je="[object Map]",BJe="[object Number]",a2e="[object Object]",FJe="[object RegExp]",zJe="[object Set]",VJe="[object String]",HJe="[object Symbol]",GJe="[object WeakMap]",WJe="[object ArrayBuffer]",qJe="[object DataView]",UJe="[object Float32Array]",jJe="[object Float64Array]",YJe="[object Int8Array]",XJe="[object Int16Array]",KJe="[object Int32Array]",ZJe="[object Uint8Array]",QJe="[object Uint8ClampedArray]",JJe="[object Uint16Array]",eet="[object Uint32Array]",Ii={};Ii[i2e]=Ii[IJe]=Ii[WJe]=Ii[qJe]=Ii[NJe]=Ii[DJe]=Ii[UJe]=Ii[jJe]=Ii[YJe]=Ii[XJe]=Ii[KJe]=Ii[$Je]=Ii[BJe]=Ii[a2e]=Ii[FJe]=Ii[zJe]=Ii[VJe]=Ii[HJe]=Ii[ZJe]=Ii[QJe]=Ii[JJe]=Ii[eet]=!0;Ii[OJe]=Ii[s2e]=Ii[GJe]=!1;function Ok(t,e,r,n,i,s){var a,o=e&RJe,l=e&_Je,u=e&LJe;if(a!==void 0)return a;if(!$s(t))return t;var h=Bs(t);if(h){if(a=QQe(t),!o)return fve(t,a)}else{var d=du(t),f=d==s2e||d==PJe;if(DT(t))return Zve(t,o);if(d==a2e||d==i2e||f&&!i){if(a=l||f?{}:n2e(t),!o)return l?HQe(t,PQe(a,t)):zQe(t,OQe(a,t))}else{if(!Ii[d])return i?t:{};a=TJe(t,d,o)}}s||(s=new hh);var p=s.get(t);if(p)return p;s.set(t,a),MJe(t)?t.forEach(function(y){a.add(Ok(y,e,r,y,t,s))}):SJe(t)&&t.forEach(function(y,v){a.set(v,Ok(y,e,r,v,t,s))});var g=u?l?GQe:HV:l?qy:Lc,m=h?void 0:g(t);return gve(m||t,function(y,v){m&&(v=y,y=t[v]),sN(a,v,Ok(y,e,r,v,t,s))}),a}var tet=4;function l9(t){return Ok(t,tet)}var ret=1,net=4;function Oi(t){return Ok(t,ret|net)}var iet="__lodash_hash_undefined__";function set(t){return this.__data__.set(t,iet),this}function aet(t){return this.__data__.has(t)}function PT(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new B0;++e<r;)this.add(t[e])}PT.prototype.add=PT.prototype.push=set;PT.prototype.has=aet;function oet(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function pX(t,e){return t.has(e)}var cet=1,uet=2;function o2e(t,e,r,n,i,s){var a=r&cet,o=t.length,l=e.length;if(o!=l&&!(a&&l>o))return!1;var u=s.get(t),h=s.get(e);if(u&&h)return u==e&&h==t;var d=-1,f=!0,p=r&uet?new PT:void 0;for(s.set(t,e),s.set(e,t);++d<o;){var g=t[d],m=e[d];if(n)var y=a?n(m,g,d,e,t,s):n(g,m,d,t,e,s);if(y!==void 0){if(y)continue;f=!1;break}if(p){if(!oet(e,function(v,x){if(!pX(p,x)&&(g===v||i(g,v,r,n,s)))return p.push(x)})){f=!1;break}}else if(!(g===m||i(g,m,r,n,s))){f=!1;break}}return s.delete(t),s.delete(e),f}function het(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}function gX(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var det=1,fet=2,pet="[object Boolean]",get="[object Date]",met="[object Error]",yet="[object Map]",vet="[object Number]",bet="[object RegExp]",xet="[object Set]",wet="[object String]",Tet="[object Symbol]",Cet="[object ArrayBuffer]",ket="[object DataView]",Kie=Mu?Mu.prototype:void 0,QP=Kie?Kie.valueOf:void 0;function Eet(t,e,r,n,i,s,a){switch(r){case ket:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Cet:return!(t.byteLength!=e.byteLength||!s(new o9(t),new o9(e)));case pet:case get:case vet:return K5(+t,+e);case met:return t.name==e.name&&t.message==e.message;case bet:case wet:return t==e+"";case yet:var o=het;case xet:var l=n&det;if(o||(o=gX),t.size!=e.size&&!l)return!1;var u=a.get(t);if(u)return u==e;n|=fet,a.set(t,e);var h=o2e(o(t),o(e),n,i,s,a);return a.delete(t),h;case Tet:if(QP)return QP.call(t)==QP.call(e)}return!1}var Aet=1,Met=Object.prototype,Ret=Met.hasOwnProperty;function _et(t,e,r,n,i,s){var a=r&Aet,o=HV(t),l=o.length,u=HV(e),h=u.length;if(l!=h&&!a)return!1;for(var d=l;d--;){var f=o[d];if(!(a?f in e:Ret.call(e,f)))return!1}var p=s.get(t),g=s.get(e);if(p&&g)return p==e&&g==t;var m=!0;s.set(t,e),s.set(e,t);for(var y=a;++d<l;){f=o[d];var v=t[f],x=e[f];if(n)var b=a?n(x,v,f,e,t,s):n(v,x,f,t,e,s);if(!(b===void 0?v===x||i(v,x,r,n,s):b)){m=!1;break}y||(y=f=="constructor")}if(m&&!y){var T=t.constructor,C=e.constructor;T!=C&&"constructor"in t&&"constructor"in e&&!(typeof T=="function"&&T instanceof T&&typeof C=="function"&&C instanceof C)&&(m=!1)}return s.delete(t),s.delete(e),m}var Let=1,Zie="[object Arguments]",Qie="[object Array]",s7="[object Object]",Iet=Object.prototype,Jie=Iet.hasOwnProperty;function Net(t,e,r,n,i,s){var a=Bs(t),o=Bs(e),l=a?Qie:du(t),u=o?Qie:du(e);l=l==Zie?s7:l,u=u==Zie?s7:u;var h=l==s7,d=u==s7,f=l==u;if(f&&DT(t)){if(!DT(e))return!1;a=!0,h=!1}if(f&&!h)return s||(s=new hh),a||lN(t)?o2e(t,e,r,n,i,s):Eet(t,e,l,r,n,i,s);if(!(r&Let)){var p=h&&Jie.call(t,"__wrapped__"),g=d&&Jie.call(e,"__wrapped__");if(p||g){var m=p?t.value():t,y=g?e.value():e;return s||(s=new hh),i(m,y,r,n,s)}}return f?(s||(s=new hh),_et(t,e,r,n,i,s)):!1}function pN(t,e,r,n,i){return t===e?!0:t==null||e==null||!Eh(t)&&!Eh(e)?t!==t&&e!==e:Net(t,e,r,n,pN,i)}var Det=1,Oet=2;function Pet(t,e,r,n){var i=r.length,s=i;if(t==null)return!s;for(t=Object(t);i--;){var a=r[i];if(a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<s;){a=r[i];var o=a[0],l=t[o],u=a[1];if(a[2]){if(l===void 0&&!(o in t))return!1}else{var h=new hh,d;if(!(d===void 0?pN(u,l,Det|Oet,n,h):d))return!1}}return!0}function l2e(t){return t===t&&!$s(t)}function $et(t){for(var e=Lc(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,l2e(i)]}return e}function c2e(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function Bet(t){var e=$et(t);return e.length==1&&e[0][2]?c2e(e[0][0],e[0][1]):function(r){return r===t||Pet(r,t,e)}}function Fet(t,e){return t!=null&&e in Object(t)}function u2e(t,e,r){e=hN(e,t);for(var n=-1,i=e.length,s=!1;++n<i;){var a=L6(e[n]);if(!(s=t!=null&&r(t,a)))break;t=t[a]}return s||++n!=i?s:(i=t==null?0:t.length,!!i&&oX(i)&&iN(a,i)&&(Bs(t)||NT(t)))}function h2e(t,e){return t!=null&&u2e(t,e,Fet)}var zet=1,Vet=2;function Het(t,e){return lX(t)&&l2e(e)?c2e(L6(t),e):function(r){var n=oZe(r,t);return n===void 0&&n===e?h2e(r,t):pN(e,n,zet|Vet)}}function Get(t){return function(e){return e==null?void 0:e[t]}}function Wet(t){return function(e){return dN(e,t)}}function qet(t){return lX(t)?Get(L6(t)):Wet(t)}function F0(t){return typeof t=="function"?t:t==null?Gg:typeof t=="object"?Bs(t)?Het(t[0],t[1]):Bet(t):qet(t)}function Uet(t,e,r,n){for(var i=-1,s=t==null?0:t.length;++i<s;){var a=t[i];e(n,a,r(a),t)}return n}function jet(t){return function(e,r,n){for(var i=-1,s=Object(e),a=n(e),o=a.length;o--;){var l=a[++i];if(r(s[l],l,s)===!1)break}return e}}var mX=jet();function yX(t,e){return t&&mX(t,e,Lc)}function Yet(t,e){return function(r,n){if(r==null)return r;if(!Wg(r))return t(r,n);for(var i=r.length,s=-1,a=Object(r);++s<i&&n(a[s],s,a)!==!1;);return r}}var N6=Yet(yX);function Xet(t,e,r,n){return N6(t,function(i,s,a){e(n,i,r(i),a)}),n}function Ket(t,e){return function(r,n){var i=Bs(r)?Uet:Xet,s=e?e():{};return i(r,t,F0(n),s)}}var JP=function(){return Ih.Date.now()},Zet="Expected a function",Qet=Math.max,Jet=Math.min;function gN(t,e,r){var n,i,s,a,o,l,u=0,h=!1,d=!1,f=!0;if(typeof t!="function")throw new TypeError(Zet);e=vb(e)||0,$s(r)&&(h=!!r.leading,d="maxWait"in r,s=d?Qet(vb(r.maxWait)||0,e):s,f="trailing"in r?!!r.trailing:f);function p(S){var k=n,E=i;return n=i=void 0,u=S,a=t.apply(E,k),a}function g(S){return u=S,o=setTimeout(v,e),h?p(S):a}function m(S){var k=S-l,E=S-u,A=e-k;return d?Jet(A,s-E):A}function y(S){var k=S-l,E=S-u;return l===void 0||k>=e||k<0||d&&E>=s}function v(){var S=JP();if(y(S))return x(S);o=setTimeout(v,m(S))}function x(S){return o=void 0,f&&n?p(S):(n=i=void 0,a)}function b(){o!==void 0&&clearTimeout(o),u=0,n=l=i=o=void 0}function T(){return o===void 0?a:x(JP())}function C(){var S=JP(),k=y(S);if(n=arguments,i=this,l=S,k){if(o===void 0)return g(l);if(d)return clearTimeout(o),o=setTimeout(v,e),p(l)}return o===void 0&&(o=setTimeout(v,e)),a}return C.cancel=b,C.flush=T,C}var d2e=Object.prototype,ett=d2e.hasOwnProperty,f2e=Z5(function(t,e){t=Object(t);var r=-1,n=e.length,i=n>2?e[2]:void 0;for(i&&LS(e[0],e[1],i)&&(n=1);++r<n;)for(var s=e[r],a=qy(s),o=-1,l=a.length;++o<l;){var u=a[o],h=t[u];(h===void 0||K5(h,d2e[u])&&!ett.call(t,u))&&(t[u]=s[u])}return t});function qV(t,e,r){(r!==void 0&&!K5(t[e],r)||r===void 0&&!(e in t))&&R6(t,e,r)}function c9(t){return Eh(t)&&Wg(t)}function UV(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function ttt(t){return _6(t,qy(t))}function rtt(t,e,r,n,i,s,a){var o=UV(t,r),l=UV(e,r),u=a.get(l);if(u){qV(t,r,u);return}var h=s?s(o,l,r+"",t,e,a):void 0,d=h===void 0;if(d){var f=Bs(l),p=!f&&DT(l),g=!f&&!p&&lN(l);h=l,f||p||g?Bs(o)?h=o:c9(o)?h=fve(o):p?(d=!1,h=Zve(l,!0)):g?(d=!1,h=r2e(l,!0)):h=[]:Nh(l)||NT(l)?(h=o,NT(o)?h=ttt(o):(!$s(o)||_S(o))&&(h=n2e(l))):d=!1}d&&(a.set(l,h),i(h,l,n,s,a),a.delete(l)),qV(t,r,h)}function mN(t,e,r,n,i){t!==e&&mX(e,function(s,a){if(i||(i=new hh),$s(s))rtt(t,e,a,r,mN,n,i);else{var o=n?n(UV(t,a),s,a+"",t,e,i):void 0;o===void 0&&(o=s),qV(t,a,o)}},qy)}function p2e(t,e,r,n,i,s){return $s(t)&&$s(e)&&(s.set(e,t),mN(t,e,void 0,p2e,s),s.delete(e)),t}var ntt=bve(function(t,e,r,n){mN(t,e,r,n)}),g2e=Z5(function(t){return t.push(void 0,p2e),dve(ntt,void 0,t)}),itt=200;function stt(t,e,r,n){var i=-1,s=yve,a=!0,o=t.length,l=[],u=e.length;if(!o)return l;e.length>=itt&&(s=pX,a=!1,e=new PT(e));e:for(;++i<o;){var h=t[i],d=h;if(h=h!==0?h:0,a&&d===d){for(var f=u;f--;)if(e[f]===d)continue e;l.push(h)}else s(e,d,n)||l.push(h)}return l}var att=Z5(function(t,e){return c9(t)?stt(t,fN(e,1,c9,!0)):[]});function u9(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}function vX(t){return typeof t=="function"?t:Gg}function Et(t,e){var r=Bs(t)?gve:N6;return r(t,vX(e))}function ott(t,e){var r=[];return N6(t,function(n,i,s){e(n,i,s)&&r.push(n)}),r}function $f(t,e){var r=Bs(t)?Qve:ott;return r(t,F0(e))}function ltt(t){return function(e,r,n){var i=Object(e);if(!Wg(e)){var s=F0(r);e=Lc(e),r=function(o){return s(i[o],o,i)}}var a=t(e,r,n);return a>-1?i[s?e[a]:a]:void 0}}var ctt=Math.max;function utt(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:lXe(r);return i<0&&(i=ctt(n+i,0)),mve(t,F0(e),i)}var bX=ltt(utt);function m2e(t,e){var r=-1,n=Wg(t)?Array(t.length):[];return N6(t,function(i,s,a){n[++r]=e(i,s,a)}),n}function la(t,e){var r=Bs(t)?yb:m2e;return r(t,F0(e))}function htt(t,e){return t==null?t:mX(t,vX(e),qy)}function dtt(t,e){return t&&yX(t,vX(e))}var ftt=Object.prototype,ptt=ftt.hasOwnProperty,ese=Ket(function(t,e,r){ptt.call(t,r)?t[r].push(e):R6(t,r,[e])});function gtt(t,e){return t>e}var mtt=Object.prototype,ytt=mtt.hasOwnProperty;function vtt(t,e){return t!=null&&ytt.call(t,e)}function X2(t,e){return t!=null&&u2e(t,e,vtt)}function btt(t,e){return yb(e,function(r){return t[r]})}function Zf(t){return t==null?[]:btt(t,Lc(t))}var xtt="[object Map]",wtt="[object Set]",Ttt=Object.prototype,Ctt=Ttt.hasOwnProperty;function DS(t){if(t==null)return!0;if(Wg(t)&&(Bs(t)||typeof t=="string"||typeof t.splice=="function"||DT(t)||lN(t)||NT(t)))return!t.length;var e=du(t);if(e==xtt||e==wtt)return!t.size;if(aN(t))return!Sve(t).length;for(var r in t)if(Ctt.call(t,r))return!1;return!0}function Qf(t,e){return pN(t,e)}var ktt="[object Number]";function Bf(t){return typeof t=="number"||Eh(t)&&Hg(t)==ktt}function Us(t){return t===void 0}var Stt=Dve("toLowerCase");function y2e(t,e){return t<e}function yN(t,e){var r={};return e=F0(e),yX(t,function(n,i,s){R6(r,i,e(n,i,s))}),r}function xX(t,e,r){for(var n=-1,i=t.length;++n<i;){var s=t[n],a=e(s);if(a!=null&&(o===void 0?a===a&&!_d(a):r(a,o)))var o=a,l=s}return l}function hg(t){return t&&t.length?xX(t,Gg,gtt):void 0}var Pi=bve(function(t,e,r){mN(t,e,r)});function OS(t){return t&&t.length?xX(t,Gg,y2e):void 0}function wX(t,e){return t&&t.length?xX(t,F0(e),y2e):void 0}function Ett(t,e,r,n){if(!$s(t))return t;e=hN(e,t);for(var i=-1,s=e.length,a=s-1,o=t;o!=null&&++i<s;){var l=L6(e[i]),u=r;if(l==="__proto__"||l==="constructor"||l==="prototype")return t;if(i!=a){var h=o[l];u=void 0,u===void 0&&(u=$s(h)?h:iN(e[i+1])?[]:{})}sN(o,l,u),o=o[l]}return t}function Att(t,e,r){for(var n=-1,i=e.length,s={};++n<i;){var a=e[n],o=dN(t,a);r(o,a)&&Ett(s,hN(a,t),o)}return s}function Mtt(t,e){var r=t.length;for(t.sort(e);r--;)t[r]=t[r].value;return t}function Rtt(t,e){if(t!==e){var r=t!==void 0,n=t===null,i=t===t,s=_d(t),a=e!==void 0,o=e===null,l=e===e,u=_d(e);if(!o&&!u&&!s&&t>e||s&&a&&l&&!o&&!u||n&&a&&l||!r&&l||!i)return 1;if(!n&&!s&&!u&&t<e||u&&r&&i&&!n&&!s||o&&r&&i||!a&&i||!l)return-1}return 0}function _tt(t,e,r){for(var n=-1,i=t.criteria,s=e.criteria,a=i.length,o=r.length;++n<a;){var l=Rtt(i[n],s[n]);if(l){if(n>=o)return l;var u=r[n];return l*(u=="desc"?-1:1)}}return t.index-e.index}function Ltt(t,e,r){e.length?e=yb(e,function(s){return Bs(s)?function(a){return dN(a,s.length===1?s[0]:s)}:s}):e=[Gg];var n=-1;e=yb(e,oN(F0));var i=m2e(t,function(s,a,o){var l=yb(e,function(u){return u(s)});return{criteria:l,index:++n,value:s}});return Mtt(i,function(s,a){return _tt(s,a,r)})}function Itt(t,e){return Att(t,e,function(r,n){return h2e(t,n)})}var $T=cZe(function(t,e){return t==null?{}:Itt(t,e)}),Ntt=Math.ceil,Dtt=Math.max;function Ott(t,e,r,n){for(var i=-1,s=Dtt(Ntt((e-t)/(r||1)),0),a=Array(s);s--;)a[++i]=t,t+=r;return a}function Ptt(t){return function(e,r,n){return n&&typeof n!="number"&&LS(e,r,n)&&(r=n=void 0),e=bM(e),r===void 0?(r=e,e=0):r=bM(r),n=n===void 0?e<r?1:-1:bM(n),Ott(e,r,n)}}var BT=Ptt();function $tt(t,e,r,n,i){return i(t,function(s,a,o){r=n?(n=!1,s):e(r,s,a,o)}),r}function D6(t,e,r){var n=Bs(t)?Ove:$tt,i=arguments.length<3;return n(t,F0(e),r,i,N6)}var qg=Z5(function(t,e){if(t==null)return[];var r=e.length;return r>1&&LS(t,e[0],e[1])?e=[]:r>2&&LS(e[0],e[1],e[2])&&(e=[e[0]]),Ltt(t,fN(e),[])}),Btt=4294967295,Ftt=Btt-1,ztt=Math.floor,Vtt=Math.min;function Htt(t,e,r,n){var i=0,s=t==null?0:t.length;if(s===0)return 0;e=r(e);for(var a=e!==e,o=e===null,l=_d(e),u=e===void 0;i<s;){var h=ztt((i+s)/2),d=r(t[h]),f=d!==void 0,p=d===null,g=d===d,m=_d(d);if(a)var y=g;else u?y=g&&f:o?y=g&&f&&!p:l?y=g&&f&&!p&&!m:p||m?y=!1:y=d<e;y?i=h+1:s=h}return Vtt(s,Ftt)}var Gtt=4294967295,Wtt=Gtt>>>1;function qtt(t,e,r){var n=0,i=t==null?n:t.length;if(typeof e=="number"&&e===e&&i<=Wtt){for(;n<i;){var s=n+i>>>1,a=t[s];a!==null&&!_d(a)&&a<e?n=s+1:i=s}return i}return Htt(t,e,Gg)}function Utt(t,e){return qtt(t,e)}var jtt=Xve(function(t,e,r){return t+(r?" ":"")+a9(e)}),Ytt="Expected a function";function Xtt(t,e,r){var n=!0,i=!0;if(typeof t!="function")throw new TypeError(Ytt);return $s(r)&&(n="leading"in r?!0:n,i="trailing"in r?!!r.trailing:i),gN(t,e,{leading:n,maxWait:e,trailing:i})}var Ktt=1/0,Ztt=bb&&1/gX(new bb([,-0]))[1]==Ktt?function(t){return new bb(t)}:EXe,Qtt=200;function v2e(t,e,r){var n=-1,i=yve,s=t.length,a=!0,o=[],l=o;if(s>=Qtt){var u=Ztt(t);if(u)return gX(u);a=!1,i=pX,l=new PT}else l=o;e:for(;++n<s;){var h=t[n],d=h;if(h=h!==0?h:0,a&&d===d){for(var f=l.length;f--;)if(l[f]===d)continue e;o.push(h)}else i(l,d,r)||(l!==o&&l.push(d),o.push(h))}return o}var jV=Z5(function(t){return v2e(fN(t,1,c9,!0))});function b2e(t){return t&&t.length?v2e(t):[]}var Jtt=0;function vN(t){var e=++Jtt;return Q5(t)+e}function ert(t,e,r){for(var n=-1,i=t.length,s=e.length,a={};++n<i;){var o=n<s?e[n]:void 0;r(a,t[n],o)}return a}function trt(t,e){return ert(t||[],e||[],sN)}function c0(t){return typeof t=="string"&&t.slice(-1)==="%"}function Pc(t,e){if(t==null)return 0;let r;if(typeof t=="string"){if(r=parseFloat(t),c0(t)&&(r/=100,Number.isFinite(r)))return r*e}else r=t;return Number.isFinite(r)?r>0&&r<1?r*e:r:0}function dh(t){if(typeof t=="object"){let r=0,n=0,i=0,s=0;return t.vertical!=null&&Number.isFinite(t.vertical)&&(n=s=t.vertical),t.horizontal!=null&&Number.isFinite(t.horizontal)&&(i=r=t.horizontal),t.left!=null&&Number.isFinite(t.left)&&(r=t.left),t.top!=null&&Number.isFinite(t.top)&&(n=t.top),t.right!=null&&Number.isFinite(t.right)&&(i=t.right),t.bottom!=null&&Number.isFinite(t.bottom)&&(s=t.bottom),{top:n,right:i,bottom:s,left:r}}let e=0;return t!=null&&Number.isFinite(t)&&(e=t),{top:e,right:e,bottom:e,left:e}}let x2e=!1,w2e=!1,T2e=!1,rrt=!1,C2e=!1;if(typeof navigator=="object"){const t=navigator.userAgent;t.indexOf("Macintosh")>=0,t.match(/(iPad|iPhone|iPod)/g),t.indexOf("Windows")>=0,x2e=t.indexOf("MSIE")>=0,t.match(/Trident\/7\./),w2e=!!t.match(/Edge\//),t.indexOf("Mozilla/")>=0&&t.indexOf("MSIE")<0&&t.indexOf("Edge/")<0,t.indexOf("Chrome/")>=0&&t.indexOf("Edge/")<0,t.indexOf("Opera/")>=0||t.indexOf("OPR/")>=0,t.indexOf("Firefox/")>=0,T2e=t.indexOf("AppleWebKit/")>=0&&t.indexOf("Chrome/")<0&&t.indexOf("Edge/")<0,typeof document=="object"&&(C2e=!document.createElementNS||`${document.createElementNS("http://www.w3.org/2000/svg","foreignObject")}`!="[object SVGForeignObjectElement]"||t.indexOf("Opera/")>=0)}typeof window=="object"&&window.chrome!=null&&window.chrome.app!=null&&window.chrome.app.runtime!=null;if(typeof document=="object")try{const t=Object.defineProperty({},"passive",{get(){rrt=!0}}),e=document.createElement("div");e.addEventListener&&e.addEventListener("click",()=>{},t)}catch{}const tse=x2e,rse=w2e,nrt=T2e,irt=C2e,srt=!irt;function art(){const t=window.module;return t!=null&&t.hot!=null&&t.hot.status!=null?t.hot.status():"unkonwn"}function k2e(){return art()==="apply"}const ort={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};function lrt(t){const e=document.createElement(ort[t]||"div"),r=`on${t}`;let n=r in e;return n||(e.setAttribute(r,"return;"),n=typeof e[r]=="function"),n}const Pk=[];function Ug(t,e){const r=Pk.find(n=>n.name===t);if(!(r&&(r.loadTimes+=1,r.loadTimes>1))&&!k2e()){const n=document.createElement("style");n.setAttribute("type","text/css"),n.textContent=e;const i=document.querySelector("head");i&&i.insertBefore(n,i.firstChild),Pk.push({name:t,loadTimes:1,styleElement:n})}}function jg(t){const e=Pk.findIndex(r=>r.name===t);if(e>-1){const r=Pk[e];if(r.loadTimes-=1,r.loadTimes>0)return;let n=r.styleElement;n&&n.parentNode&&n.parentNode.removeChild(n),n=null,Pk.splice(e,1)}}function crt(t){const e=t.match(/<svg[^>]*viewBox\s*=\s*(["']?)(.+?)\1[^>]*>/i);return e&&e[2]?e[2].replace(/\s+/," ").split(" "):null}function nse(t){const e=parseFloat(t);return Number.isNaN(e)?null:e}function urt(t){const e="data:";return t.substr(0,e.length)===e}function hrt(t,e){if(!t||urt(t)){setTimeout(()=>e(null,t));return}const r=()=>{e(new Error(`Failed to load image: ${t}`))},n=window.FileReader?s=>{if(s.status===200){const a=new FileReader;a.onload=o=>{const l=o.target.result;e(null,l)},a.onerror=r,a.readAsDataURL(s.response)}else r()}:s=>{const a=o=>{const u=[];for(let h=0;h<o.length;h+=32768)u.push(String.fromCharCode.apply(null,o.subarray(h,h+32768)));return u.join("")};if(s.status===200){let o=t.split(".").pop()||"png";o==="svg"&&(o="svg+xml");const l=`data:image/${o};base64,`,u=new Uint8Array(s.response),h=l+btoa(a(u));e(null,h)}else r()},i=new XMLHttpRequest;i.responseType=window.FileReader?"blob":"arraybuffer",i.open("GET",t,!0),i.addEventListener("error",r),i.addEventListener("load",()=>n(i)),i.send()}function drt(t){let e=t.replace(/\s/g,"");e=decodeURIComponent(e);const r=e.indexOf(","),n=e.slice(0,r),i=n.split(":")[1].split(";")[0],s=e.slice(r+1);let a;n.indexOf("base64")>=0?a=atob(s):a=unescape(encodeURIComponent(s));const o=new Uint8Array(a.length);for(let l=0;l<a.length;l+=1)o[l]=a.charCodeAt(l);return new Blob([o],{type:i})}function frt(t,e){const r=window.navigator.msSaveBlob;if(r)r(t,e);else{const n=window.URL.createObjectURL(t),i=document.createElement("a");i.href=n,i.download=e,document.body.appendChild(i),i.click(),document.body.removeChild(i),window.URL.revokeObjectURL(n)}}function e$(t,e){const r=drt(t);frt(r,e)}function prt(t,e={}){let r=null;const n=h=>(r==null&&(r=crt(t)),r!=null?nse(r[h]):null),i=h=>{const d=t.match(h);return d&&d[2]?nse(d[2]):null};let s=e.width;if(s==null&&(s=i(/<svg[^>]*width\s*=\s*(["']?)(.+?)\1[^>]*>/i)),s==null&&(s=n(2)),s==null)throw new Error("Can not parse width from svg string");let a=e.height;if(a==null&&(a=i(/<svg[^>]*height\s*=\s*(["']?)(.+?)\1[^>]*>/i)),a==null&&(a=n(3)),a==null)throw new Error("Can not parse height from svg string");return`data:image/svg+xml,${encodeURIComponent(t).replace(/'/g,"%27").replace(/"/g,"%22")}`}function grt(t){return typeof t=="object"&&t.then&&typeof t.then=="function"}function YV(t){return t!=null&&(t instanceof Promise||grt(t))}function TX(...t){const e=[];if(t.forEach(n=>{Array.isArray(n)?e.push(...n):e.push(n)}),e.some(n=>YV(n))){const n=e.map(i=>YV(i)?i:Promise.resolve(i!==!1));return Promise.all(n).then(i=>i.reduce((s,a)=>a!==!1&&s,!0))}return e.every(n=>n!==!1)}function mrt(...t){const e=TX(t);return typeof e=="boolean"?Promise.resolve(e):e}function S2e(t,e,r){if(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]);case 4:return t.call(e,r[0],r[1],r[2],r[3]);case 5:return t.call(e,r[0],r[1],r[2],r[3],r[4]);case 6:return t.call(e,r[0],r[1],r[2],r[3],r[4],r[5]);default:return t.apply(e,r)}return t.call(e)}function vr(t,e,...r){return S2e(t,e,r)}function ise(t){return 180*t/Math.PI%360}const Fo=function(t,e=!1){return(e?t:t%360)*Math.PI/180};function ml(t){return t%360+(t<0?360:0)}function L1(t,e=0){return Number.isInteger(t)?t:+t.toFixed(e)}function sse(t,e){let r,n;if(e==null?(n=t??1,r=0):(n=e,r=t??0),n<r){const i=r;r=n,n=i}return Math.floor(Math.random()*(n-r+1)+r)}function Lv(t,e,r){return Number.isNaN(t)?NaN:Number.isNaN(e)||Number.isNaN(r)?0:t<e?e:t>r?r:t}function fh(t,e){return e*Math.round(t/e)}function E2e(t,e){return e!=null&&t!=null&&e.x>=t.x&&e.x<=t.x+t.width&&e.y>=t.y&&e.y<=t.y+t.height}function ase(t,e){const r=t.x-e.x,n=t.y-e.y;return r*r+n*n}class Yg{valueOf(){return this.toJSON()}toString(){return JSON.stringify(this.toJSON())}}let Qe=class Fr extends Yg{static create(e,r){return e==null||typeof e=="number"?new Fr(e,r):Fr.clone(e)}static clone(e){return Fr.isPoint(e)?new Fr(e.x,e.y):Array.isArray(e)?new Fr(e[0],e[1]):new Fr(e.x,e.y)}static equals(e,r){return e===r?!0:e!=null&&r!=null?e.x===r.x&&e.y===r.y:!1}static rotateEx(e,r,n,i=new Fr){const s=Fr.clone(e),a=Fr.clone(i),o=s.x-a.x,l=s.y-a.y,u=o*r-l*n,h=l*r+o*n;return new Fr(u+a.x,h+a.y)}static toJSON(e){return Fr.isPoint(e)?{x:e.x,y:e.y}:Array.isArray(e)?{x:e[0],y:e[1]}:{x:e.x,y:e.y}}static fromPolar(e,r,n=new Fr){let i=Math.abs(e*Math.cos(r)),s=Math.abs(e*Math.sin(r));const a=Fr.clone(n),o=ml(ise(r));return o<90?s=-s:o<180?(i=-i,s=-s):o<270&&(i=-i),new Fr(a.x+i,a.y+s)}static toPolar(e,r=new Fr){const n=Fr.clone(e),i=Fr.clone(r),s=n.x-i.x,a=n.y-i.y;return new Fr(Math.sqrt(s*s+a*a),Fo(i.theta(n)))}static equalPoints(e,r){if(e==null&&r!=null||e!=null&&r==null||e!=null&&r!=null&&e.length!==r.length)return!1;if(e!=null&&r!=null){for(let n=0,i=e.length;n<i;n+=1)if(!Fr.equals(e[n],r[n]))return!1}return!0}static random(e,r,n,i){return new Fr(sse(e,r),sse(n,i))}static rotate(e,r,n){const i=Fo(ml(-r)),s=Math.sin(i),a=Math.cos(i);return Fr.rotateEx(e,a,s,n)}static isPoint(e){return e!=null&&e instanceof Fr}static isPointLike(e){return e!=null&&typeof e=="object"&&typeof e.x=="number"&&typeof e.y=="number"}static isPointData(e){return e!=null&&Array.isArray(e)&&e.length===2&&typeof e[0]=="number"&&typeof e[1]=="number"}constructor(e,r){super(),this.x=e??0,this.y=r??0}round(e=0){return this.x=L1(this.x,e),this.y=L1(this.y,e),this}add(e,r){const n=Fr.create(e,r);return this.x+=n.x,this.y+=n.y,this}update(e,r){const n=Fr.create(e,r);return this.x=n.x,this.y=n.y,this}translate(e,r){const n=Fr.create(e,r);return this.x+=n.x,this.y+=n.y,this}rotate(e,r){const n=Fr.rotate(this,e,r);return this.x=n.x,this.y=n.y,this}scale(e,r,n=new Fr){const i=Fr.create(n);return this.x=i.x+e*(this.x-i.x),this.y=i.y+r*(this.y-i.y),this}closest(e){if(e.length===1)return Fr.create(e[0]);let r=null,n=1/0;return e.forEach(i=>{const s=this.squaredDistance(i);s<n&&(r=i,n=s)}),r?Fr.create(r):null}distance(e){return Math.sqrt(this.squaredDistance(e))}squaredDistance(e){const r=Fr.create(e),n=this.x-r.x,i=this.y-r.y;return n*n+i*i}manhattanDistance(e){const r=Fr.create(e);return Math.abs(r.x-this.x)+Math.abs(r.y-this.y)}magnitude(){return Math.sqrt(this.x*this.x+this.y*this.y)||.01}theta(e=new Fr){const r=Fr.create(e),n=-(r.y-this.y),i=r.x-this.x;let s=Math.atan2(n,i);return s<0&&(s=2*Math.PI+s),180*s/Math.PI}angleBetween(e,r){if(this.equals(e)||this.equals(r))return NaN;let n=this.theta(r)-this.theta(e);return n<0&&(n+=360),n}vectorAngle(e){return new Fr(0,0).angleBetween(this,e)}toPolar(e){return this.update(Fr.toPolar(this,e)),this}changeInAngle(e,r,n=new Fr){return this.clone().translate(-e,-r).theta(n)-this.theta(n)}adhereToRect(e){return E2e(e,this)||(this.x=Math.min(Math.max(this.x,e.x),e.x+e.width),this.y=Math.min(Math.max(this.y,e.y),e.y+e.height)),this}bearing(e){const r=Fr.create(e),n=Fo(this.y),i=Fo(r.y),s=this.x,a=r.x,o=Fo(a-s),l=Math.sin(o)*Math.cos(i),u=Math.cos(n)*Math.sin(i)-Math.sin(n)*Math.cos(i)*Math.cos(o),h=ise(Math.atan2(l,u)),d=["NE","E","SE","S","SW","W","NW","N"];let f=h-22.5;return f<0&&(f+=360),f=parseInt(f/45,10),d[f]}cross(e,r){if(e!=null&&r!=null){const n=Fr.create(e),i=Fr.create(r);return(i.x-this.x)*(n.y-this.y)-(i.y-this.y)*(n.x-this.x)}return NaN}dot(e){const r=Fr.create(e);return this.x*r.x+this.y*r.y}diff(e,r){if(typeof e=="number")return new Fr(this.x-e,this.y-r);const n=Fr.create(e);return new Fr(this.x-n.x,this.y-n.y)}lerp(e,r){const n=Fr.create(e);return new Fr((1-r)*this.x+r*n.x,(1-r)*this.y+r*n.y)}normalize(e=1){const r=e/this.magnitude();return this.scale(r,r)}move(e,r){const n=Fr.create(e),i=Fo(n.theta(this));return this.translate(Math.cos(i)*r,-Math.sin(i)*r)}reflection(e){return Fr.create(e).move(this,this.distance(e))}snapToGrid(e,r){return this.x=fh(this.x,e),this.y=fh(this.y,r??e),this}equals(e){const r=Fr.create(e);return r!=null&&r.x===this.x&&r.y===this.y}clone(){return Fr.clone(this)}toJSON(){return Fr.toJSON(this)}serialize(){return`${this.x} ${this.y}`}};class Bt extends Yg{static isRectangle(e){return e!=null&&e instanceof Bt}static isRectangleLike(e){return e!=null&&typeof e=="object"&&typeof e.x=="number"&&typeof e.y=="number"&&typeof e.width=="number"&&typeof e.height=="number"}static create(e,r,n,i){return e==null||typeof e=="number"?new Bt(e,r,n,i):Bt.clone(e)}static clone(e){return Bt.isRectangle(e)?e.clone():Array.isArray(e)?new Bt(e[0],e[1],e[2],e[3]):new Bt(e.x,e.y,e.width,e.height)}static fromEllipse(e){return new Bt(e.x-e.a,e.y-e.b,2*e.a,2*e.b)}static fromSize(e){return new Bt(0,0,e.width,e.height)}static fromPositionAndSize(e,r){return new Bt(e.x,e.y,r.width,r.height)}get left(){return this.x}get top(){return this.y}get right(){return this.x+this.width}get bottom(){return this.y+this.height}get origin(){return new Qe(this.x,this.y)}get topLeft(){return new Qe(this.x,this.y)}get topCenter(){return new Qe(this.x+this.width/2,this.y)}get topRight(){return new Qe(this.x+this.width,this.y)}get center(){return new Qe(this.x+this.width/2,this.y+this.height/2)}get bottomLeft(){return new Qe(this.x,this.y+this.height)}get bottomCenter(){return new Qe(this.x+this.width/2,this.y+this.height)}get bottomRight(){return new Qe(this.x+this.width,this.y+this.height)}get corner(){return new Qe(this.x+this.width,this.y+this.height)}get rightMiddle(){return new Qe(this.x+this.width,this.y+this.height/2)}get leftMiddle(){return new Qe(this.x,this.y+this.height/2)}get topLine(){return new lr(this.topLeft,this.topRight)}get rightLine(){return new lr(this.topRight,this.bottomRight)}get bottomLine(){return new lr(this.bottomLeft,this.bottomRight)}get leftLine(){return new lr(this.topLeft,this.bottomLeft)}constructor(e,r,n,i){super(),this.x=e??0,this.y=r??0,this.width=n??0,this.height=i??0}getOrigin(){return this.origin}getTopLeft(){return this.topLeft}getTopCenter(){return this.topCenter}getTopRight(){return this.topRight}getCenter(){return this.center}getCenterX(){return this.x+this.width/2}getCenterY(){return this.y+this.height/2}getBottomLeft(){return this.bottomLeft}getBottomCenter(){return this.bottomCenter}getBottomRight(){return this.bottomRight}getCorner(){return this.corner}getRightMiddle(){return this.rightMiddle}getLeftMiddle(){return this.leftMiddle}getTopLine(){return this.topLine}getRightLine(){return this.rightLine}getBottomLine(){return this.bottomLine}getLeftLine(){return this.leftLine}bbox(e){if(!e)return this.clone();const r=Fo(e),n=Math.abs(Math.sin(r)),i=Math.abs(Math.cos(r)),s=this.width*i+this.height*n,a=this.width*n+this.height*i;return new Bt(this.x+(this.width-s)/2,this.y+(this.height-a)/2,s,a)}round(e=0){return this.x=L1(this.x,e),this.y=L1(this.y,e),this.width=L1(this.width,e),this.height=L1(this.height,e),this}add(e,r,n,i){const s=Bt.create(e,r,n,i),a=Math.min(this.x,s.x),o=Math.min(this.y,s.y),l=Math.max(this.x+this.width,s.x+s.width),u=Math.max(this.y+this.height,s.y+s.height);return this.x=a,this.y=o,this.width=l-a,this.height=u-o,this}update(e,r,n,i){const s=Bt.create(e,r,n,i);return this.x=s.x,this.y=s.y,this.width=s.width,this.height=s.height,this}inflate(e,r){const n=e,i=r??e;return this.x-=n,this.y-=i,this.width+=2*n,this.height+=2*i,this}snapToGrid(e,r){const n=this.origin.snapToGrid(e,r),i=this.corner.snapToGrid(e,r);return this.x=n.x,this.y=n.y,this.width=i.x-n.x,this.height=i.y-n.y,this}translate(e,r){const n=Qe.create(e,r);return this.x+=n.x,this.y+=n.y,this}scale(e,r,n=new Qe){const i=this.origin.scale(e,r,n);return this.x=i.x,this.y=i.y,this.width*=e,this.height*=r,this}rotate(e,r=this.getCenter()){if(e!==0){const n=Fo(e),i=Math.cos(n),s=Math.sin(n);let a=this.getOrigin(),o=this.getTopRight(),l=this.getBottomRight(),u=this.getBottomLeft();a=Qe.rotateEx(a,i,s,r),o=Qe.rotateEx(o,i,s,r),l=Qe.rotateEx(l,i,s,r),u=Qe.rotateEx(u,i,s,r);const h=new Bt(a.x,a.y,0,0);h.add(o.x,o.y,0,0),h.add(l.x,l.y,0,0),h.add(u.x,u.y,0,0),this.update(h)}return this}rotate90(){const e=(this.width-this.height)/2;this.x+=e,this.y-=e;const r=this.width;return this.width=this.height,this.height=r,this}moveAndExpand(e){const r=Bt.clone(e);return this.x+=r.x||0,this.y+=r.y||0,this.width+=r.width||0,this.height+=r.height||0,this}getMaxScaleToFit(e,r=this.center){const n=Bt.clone(e),i=r.x,s=r.y;let a=1/0,o=1/0,l=1/0,u=1/0,h=1/0,d=1/0,f=1/0,p=1/0;const g=n.topLeft;g.x<i&&(a=(this.x-i)/(g.x-i)),g.y<s&&(h=(this.y-s)/(g.y-s));const m=n.bottomRight;m.x>i&&(o=(this.x+this.width-i)/(m.x-i)),m.y>s&&(d=(this.y+this.height-s)/(m.y-s));const y=n.topRight;y.x>i&&(l=(this.x+this.width-i)/(y.x-i)),y.y<s&&(f=(this.y-s)/(y.y-s));const v=n.bottomLeft;return v.x<i&&(u=(this.x-i)/(v.x-i)),v.y>s&&(p=(this.y+this.height-s)/(v.y-s)),{sx:Math.min(a,o,l,u),sy:Math.min(h,d,f,p)}}getMaxUniformScaleToFit(e,r=this.center){const n=this.getMaxScaleToFit(e,r);return Math.min(n.sx,n.sy)}containsPoint(e,r){return E2e(this,Qe.create(e,r))}containsRect(e,r,n,i){const s=Bt.create(e,r,n,i),a=this.x,o=this.y,l=this.width,u=this.height,h=s.x,d=s.y,f=s.width,p=s.height;return l===0||u===0||f===0||p===0?!1:h>=a&&d>=o&&h+f<=a+l&&d+p<=o+u}intersectsWithLine(e){const r=[this.topLine,this.rightLine,this.bottomLine,this.leftLine],n=[],i=[];return r.forEach(s=>{const a=e.intersectsWithLine(s);a!==null&&i.indexOf(a.toString())<0&&(n.push(a),i.push(a.toString()))}),n.length>0?n:null}intersectsWithLineFromCenterToPoint(e,r){const n=Qe.clone(e),i=this.center;let s=null;r!=null&&r!==0&&n.rotate(r,i);const a=[this.topLine,this.rightLine,this.bottomLine,this.leftLine],o=new lr(i,n);for(let l=a.length-1;l>=0;l-=1){const u=a[l].intersectsWithLine(o);if(u!==null){s=u;break}}return s&&r!=null&&r!==0&&s.rotate(-r,i),s}intersectsWithRect(e,r,n,i){const s=Bt.create(e,r,n,i);if(!this.isIntersectWithRect(s))return null;const a=this.origin,o=this.corner,l=s.origin,u=s.corner,h=Math.max(a.x,l.x),d=Math.max(a.y,l.y);return new Bt(h,d,Math.min(o.x,u.x)-h,Math.min(o.y,u.y)-d)}isIntersectWithRect(e,r,n,i){const s=Bt.create(e,r,n,i),a=this.origin,o=this.corner,l=s.origin,u=s.corner;return!(u.x<=a.x||u.y<=a.y||l.x>=o.x||l.y>=o.y)}normalize(){let e=this.x,r=this.y,n=this.width,i=this.height;return this.width<0&&(e=this.x+this.width,n=-this.width),this.height<0&&(r=this.y+this.height,i=-this.height),this.x=e,this.y=r,this.width=n,this.height=i,this}union(e){const r=Bt.clone(e),n=this.origin,i=this.corner,s=r.origin,a=r.corner,o=Math.min(n.x,s.x),l=Math.min(n.y,s.y),u=Math.max(i.x,a.x),h=Math.max(i.y,a.y);return new Bt(o,l,u-o,h-l)}getNearestSideToPoint(e){const r=Qe.clone(e),n=r.x-this.x,i=this.x+this.width-r.x,s=r.y-this.y,a=this.y+this.height-r.y;let o=n,l="left";return i<o&&(o=i,l="right"),s<o&&(o=s,l="top"),a<o&&(l="bottom"),l}getNearestPointToPoint(e){const r=Qe.clone(e);if(this.containsPoint(r)){const n=this.getNearestSideToPoint(r);if(n==="left")return new Qe(this.x,r.y);if(n==="top")return new Qe(r.x,this.y);if(n==="right")return new Qe(this.x+this.width,r.y);if(n==="bottom")return new Qe(r.x,this.y+this.height)}return r.adhereToRect(this)}equals(e){return e!=null&&e.x===this.x&&e.y===this.y&&e.width===this.width&&e.height===this.height}clone(){return new Bt(this.x,this.y,this.width,this.height)}toJSON(){return{x:this.x,y:this.y,width:this.width,height:this.height}}serialize(){return`${this.x} ${this.y} ${this.width} ${this.height}`}}class lr extends Yg{static isLine(e){return e!=null&&e instanceof lr}get center(){return new Qe((this.start.x+this.end.x)/2,(this.start.y+this.end.y)/2)}constructor(e,r,n,i){super(),typeof e=="number"&&typeof r=="number"?(this.start=new Qe(e,r),this.end=new Qe(n,i)):(this.start=Qe.create(e),this.end=Qe.create(r))}getCenter(){return this.center}round(e=0){return this.start.round(e),this.end.round(e),this}translate(e,r){return typeof e=="number"?(this.start.translate(e,r),this.end.translate(e,r)):(this.start.translate(e),this.end.translate(e)),this}rotate(e,r){return this.start.rotate(e,r),this.end.rotate(e,r),this}scale(e,r,n){return this.start.scale(e,r,n),this.end.scale(e,r,n),this}length(){return Math.sqrt(this.squaredLength())}squaredLength(){const e=this.start.x-this.end.x,r=this.start.y-this.end.y;return e*e+r*r}setLength(e){const r=this.length();if(!r)return this;const n=e/r;return this.scale(n,n,this.start)}parallel(e){const r=this.clone();if(!r.isDifferentiable())return r;const{start:n,end:i}=r,s=n.clone().rotate(270,i),a=i.clone().rotate(90,n);return n.move(a,e),i.move(s,e),r}vector(){return new Qe(this.end.x-this.start.x,this.end.y-this.start.y)}angle(){const e=new Qe(this.start.x+1,this.start.y);return this.start.angleBetween(this.end,e)}bbox(){const e=Math.min(this.start.x,this.end.x),r=Math.min(this.start.y,this.end.y),n=Math.max(this.start.x,this.end.x),i=Math.max(this.start.y,this.end.y);return new Bt(e,r,n-e,i-r)}bearing(){return this.start.bearing(this.end)}closestPoint(e){return this.pointAt(this.closestPointNormalizedLength(e))}closestPointLength(e){return this.closestPointNormalizedLength(e)*this.length()}closestPointTangent(e){return this.tangentAt(this.closestPointNormalizedLength(e))}closestPointNormalizedLength(e){const r=this.vector().dot(new lr(this.start,e).vector()),n=Math.min(1,Math.max(0,r/this.squaredLength()));return Number.isNaN(n)?0:n}pointAt(e){const r=this.start,n=this.end;return e<=0?r.clone():e>=1?n.clone():r.lerp(n,e)}pointAtLength(e){const r=this.start,n=this.end;let i=!0;e<0&&(i=!1,e=-e);const s=this.length();if(e>=s)return i?n.clone():r.clone();const a=(i?e:s-e)/s;return this.pointAt(a)}divideAt(e){const r=this.pointAt(e);return[new lr(this.start,r),new lr(r,this.end)]}divideAtLength(e){const r=this.pointAtLength(e);return[new lr(this.start,r),new lr(r,this.end)]}containsPoint(e){const r=this.start,n=this.end;if(r.cross(e,n)!==0)return!1;const i=this.length();return!(new lr(r,e).length()>i||new lr(e,n).length()>i)}intersect(e,r){const n=e.intersectsWithLine(this,r);return n?Array.isArray(n)?n:[n]:null}intersectsWithLine(e){const r=new Qe(this.end.x-this.start.x,this.end.y-this.start.y),n=new Qe(e.end.x-e.start.x,e.end.y-e.start.y),i=r.x*n.y-r.y*n.x,s=new Qe(e.start.x-this.start.x,e.start.y-this.start.y),a=s.x*n.y-s.y*n.x,o=s.x*r.y-s.y*r.x;if(i===0||a*i<0||o*i<0)return null;if(i>0){if(a>i||o>i)return null}else if(a<i||o<i)return null;return new Qe(this.start.x+a*r.x/i,this.start.y+a*r.y/i)}isDifferentiable(){return!this.start.equals(this.end)}pointOffset(e){const r=Qe.clone(e),n=this.start,i=this.end;return((i.x-n.x)*(r.y-n.y)-(i.y-n.y)*(r.x-n.x))/this.length()}pointSquaredDistance(e,r){const n=Qe.create(e,r);return this.closestPoint(n).squaredDistance(n)}pointDistance(e,r){const n=Qe.create(e,r);return this.closestPoint(n).distance(n)}tangentAt(e){if(!this.isDifferentiable())return null;const r=this.start,n=this.end,i=this.pointAt(e),s=new lr(r,n);return s.translate(i.x-r.x,i.y-r.y),s}tangentAtLength(e){if(!this.isDifferentiable())return null;const r=this.start,n=this.end,i=this.pointAtLength(e),s=new lr(r,n);return s.translate(i.x-r.x,i.y-r.y),s}relativeCcw(e,r){const n=Qe.create(e,r);let i=n.x-this.start.x,s=n.y-this.start.y;const a=this.end.x-this.start.x,o=this.end.y-this.start.y;let l=i*o-s*a;return l===0&&(l=i*a+s*o,l>0&&(i-=a,s-=o,l=i*a+s*o,l<0&&(l=0))),l<0?-1:l>0?1:0}equals(e){return e!=null&&this.start.x===e.start.x&&this.start.y===e.start.y&&this.end.x===e.end.x&&this.end.y===e.end.y}clone(){return new lr(this.start,this.end)}toJSON(){return{start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){return[this.start.serialize(),this.end.serialize()].join(" ")}}class rc extends Yg{static isEllipse(e){return e!=null&&e instanceof rc}static create(e,r,n,i){return e==null||typeof e=="number"?new rc(e,r,n,i):rc.parse(e)}static parse(e){return rc.isEllipse(e)?e.clone():Array.isArray(e)?new rc(e[0],e[1],e[2],e[3]):new rc(e.x,e.y,e.a,e.b)}static fromRect(e){const r=e.center;return new rc(r.x,r.y,e.width/2,e.height/2)}get center(){return new Qe(this.x,this.y)}constructor(e,r,n,i){super(),this.x=e??0,this.y=r??0,this.a=n??0,this.b=i??0}bbox(){return Bt.fromEllipse(this)}getCenter(){return this.center}inflate(e,r){const n=e,i=r??e;return this.a+=2*n,this.b+=2*i,this}normalizedDistance(e,r){const n=Qe.create(e,r),i=n.x-this.x,s=n.y-this.y,a=this.a,o=this.b;return i*i/(a*a)+s*s/(o*o)}containsPoint(e,r){return this.normalizedDistance(e,r)<=1}intersectsWithLine(e){const r=[],n=this.a,i=this.b,s=e.start,a=e.end,o=e.vector(),l=s.diff(new Qe(this.x,this.y)),u=new Qe(o.x/(n*n),o.y/(i*i)),h=new Qe(l.x/(n*n),l.y/(i*i)),d=o.dot(u),f=o.dot(h),p=l.dot(h)-1,g=f*f-d*p;if(g<0)return null;if(g>0){const m=Math.sqrt(g),y=(-f-m)/d,v=(-f+m)/d;if((y<0||y>1)&&(v<0||v>1))return null;y>=0&&y<=1&&r.push(s.lerp(a,y)),v>=0&&v<=1&&r.push(s.lerp(a,v))}else{const m=-f/d;if(m>=0&&m<=1)r.push(s.lerp(a,m));else return null}return r}intersectsWithLineFromCenterToPoint(e,r=0){const n=Qe.clone(e);r&&n.rotate(r,this.getCenter());const i=n.x-this.x,s=n.y-this.y;let a;if(i===0)return a=this.bbox().getNearestPointToPoint(n),r?a.rotate(-r,this.getCenter()):a;const o=s/i,l=o*o,u=this.a*this.a,h=this.b*this.b;let d=Math.sqrt(1/(1/u+l/h));d=i<0?-d:d;const f=o*d;return a=new Qe(this.x+d,this.y+f),r?a.rotate(-r,this.getCenter()):a}tangentTheta(e){const r=Qe.clone(e),n=r.x,i=r.y,s=this.a,a=this.b,o=this.bbox().center,l=o.x,u=o.y,h=30,d=n>o.x+s/2,f=n<o.x-s/2;let p,g;return d||f?(g=n>o.x?i-h:i+h,p=s*s/(n-l)-s*s*(i-u)*(g-u)/(a*a*(n-l))+l):(p=i>o.y?n+h:n-h,g=a*a/(i-u)-a*a*(n-l)*(p-l)/(s*s*(i-u))+u),new Qe(p,g).theta(r)}scale(e,r){return this.a*=e,this.b*=r,this}rotate(e,r){const n=Bt.fromEllipse(this);n.rotate(e,r);const i=rc.fromRect(n);return this.a=i.a,this.b=i.b,this.x=i.x,this.y=i.y,this}translate(e,r){const n=Qe.create(e,r);return this.x+=n.x,this.y+=n.y,this}equals(e){return e!=null&&e.x===this.x&&e.y===this.y&&e.a===this.a&&e.b===this.b}clone(){return new rc(this.x,this.y,this.a,this.b)}toJSON(){return{x:this.x,y:this.y,a:this.a,b:this.b}}serialize(){return`${this.x} ${this.y} ${this.a} ${this.b}`}}const yrt=new RegExp("^[\\s\\dLMCZz,.]*$");function vrt(t){return typeof t!="string"?!1:yrt.test(t)}function t$(t,e){return(t%e+e)%e}function brt(t,e,r,n,i){if(!t||t.length===0)return"";const s=[],a=t[t.length-1],o=e!=null&&e>0,l=e||0;if(n&&o){t=t.slice();const d=t[0],f=new Qe(a.x+(d.x-a.x)/2,a.y+(d.y-a.y)/2);t.splice(0,0,f)}let u=t[0],h=1;for(r?s.push("M",u.x,u.y):s.push("L",u.x,u.y);h<(n?t.length:t.length-1);){let d=t[t$(h,t.length)],f=u.x-d.x,p=u.y-d.y;if(o&&(f!==0||p!==0)&&(i==null||i.indexOf(h-1)<0)){let g=Math.sqrt(f*f+p*p);const m=f*Math.min(l,g/2)/g,y=p*Math.min(l,g/2)/g,v=d.x+m,x=d.y+y;s.push("L",v,x);let b=t[t$(h+1,t.length)];for(;h<t.length-2&&Math.round(b.x-d.x)===0&&Math.round(b.y-d.y)===0;)b=t[t$(h+2,t.length)],h+=1;f=b.x-d.x,p=b.y-d.y,g=Math.max(1,Math.sqrt(f*f+p*p));const T=f*Math.min(l,g/2)/g,C=p*Math.min(l,g/2)/g,S=d.x+T,k=d.y+C;s.push("Q",d.x,d.y,S,k),d=new Qe(S,k)}else s.push("L",d.x,d.y);u=d,h+=1}return n?s.push("Z"):s.push("L",a.x,a.y),s.map(d=>typeof d=="string"?d:+d.toFixed(3)).join(" ")}function xrt(t,e={}){const r=[];return t&&t.length&&t.forEach(n=>{Array.isArray(n)?r.push({x:n[0],y:n[1]}):r.push({x:n.x,y:n.y})}),brt(r,e.round,e.initialMove==null||e.initialMove,e.close,e.exclude)}function ose(t,e,r,n,i=0,s=0,a=0,o,l){if(r===0||n===0)return[];o-=t,l-=e,r=Math.abs(r),n=Math.abs(n);const u=-o/2,h=-l/2,d=Math.cos(i*Math.PI/180),f=Math.sin(i*Math.PI/180),p=d*u+f*h,g=-1*f*u+d*h,m=p*p,y=g*g,v=r*r,x=n*n,b=m/v+y/x;let T;if(b>1)r=Math.sqrt(b)*r,n=Math.sqrt(b)*n,T=0;else{let q=1;s===a&&(q=-1),T=q*Math.sqrt((v*x-v*y-x*m)/(v*y+x*m))}const C=T*r*g/n,S=-1*T*n*p/r,k=d*C-f*S+o/2,E=f*C+d*S+l/2;let A=Math.atan2((g-S)/n,(p-C)/r)-Math.atan2(0,1),R=A>=0?A:2*Math.PI+A;A=Math.atan2((-g-S)/n,(-p-C)/r)-Math.atan2((g-S)/n,(p-C)/r);let _=A>=0?A:2*Math.PI+A;a===0&&_>0?_-=2*Math.PI:a!==0&&_<0&&(_+=2*Math.PI);const P=_*2/Math.PI,N=Math.ceil(P<0?-1*P:P),L=_/N,I=8/3*Math.sin(L/4)*Math.sin(L/4)/Math.sin(L/2),$=d*r,O=d*n,D=f*r,F=f*n;let z=Math.cos(R),V=Math.sin(R),B=-I*($*V+F*z),H=-I*(D*V-O*z),G=0,W=0;const K=[];for(let q=0;q<N;q+=1){R+=L,z=Math.cos(R),V=Math.sin(R),G=$*z-F*V+k,W=D*z+O*V+E;const oe=-I*($*V+F*z),Q=-I*(D*V-O*z),Z=q*6;K[Z]=Number(B+t),K[Z+1]=Number(H+e),K[Z+2]=Number(G-oe+t),K[Z+3]=Number(W-Q+e),K[Z+4]=Number(G+t),K[Z+5]=Number(W+e),B=G+oe,H=W+Q}return K.map(q=>+q.toFixed(2))}class Ba extends Yg{static isPolyline(e){return e!=null&&e instanceof Ba}static parse(e){const r=e.trim();if(r==="")return new Ba;const n=[],i=r.split(/\s*,\s*|\s+/);for(let s=0,a=i.length;s<a;s+=2)n.push({x:+i[s],y:+i[s+1]});return new Ba(n)}get start(){return this.points[0]||null}get end(){return this.points[this.points.length-1]||null}constructor(e){if(super(),e!=null){if(typeof e=="string")return Ba.parse(e);this.points=e.map(r=>Qe.create(r))}else this.points=[]}scale(e,r,n=new Qe){return this.points.forEach(i=>i.scale(e,r,n)),this}rotate(e,r){return this.points.forEach(n=>n.rotate(e,r)),this}translate(e,r){const n=Qe.create(e,r);return this.points.forEach(i=>i.translate(n.x,n.y)),this}round(e=0){return this.points.forEach(r=>r.round(e)),this}bbox(){if(this.points.length===0)return new Bt;let e=1/0,r=-1/0,n=1/0,i=-1/0;const s=this.points;for(let a=0,o=s.length;a<o;a+=1){const l=s[a],u=l.x,h=l.y;u<e&&(e=u),u>r&&(r=u),h<n&&(n=h),h>i&&(i=h)}return new Bt(e,n,r-e,i-n)}closestPoint(e){const r=this.closestPointLength(e);return this.pointAtLength(r)}closestPointLength(e){const r=this.points,n=r.length;if(n===0||n===1)return 0;let i=0,s=0,a=1/0;for(let o=0,l=n-1;o<l;o+=1){const u=new lr(r[o],r[o+1]),h=u.length(),d=u.closestPointNormalizedLength(e),p=u.pointAt(d).squaredDistance(e);p<a&&(a=p,s=i+d*h),i+=h}return s}closestPointNormalizedLength(e){const r=this.length();return r===0?0:this.closestPointLength(e)/r}closestPointTangent(e){const r=this.closestPointLength(e);return this.tangentAtLength(r)}containsPoint(e){if(this.points.length===0)return!1;const r=Qe.clone(e),n=r.x,i=r.y,s=this.points,a=s.length;let o=a-1,l=0;for(let u=0;u<a;u+=1){const h=s[o],d=s[u];if(r.equals(h))return!0;const f=new lr(h,d);if(f.containsPoint(e))return!0;if(i<=h.y&&i>d.y||i>h.y&&i<=d.y){const p=h.x-n>d.x-n?h.x-n:d.x-n;if(p>=0){const g=new Qe(n+p,i),m=new lr(e,g);f.intersectsWithLine(m)&&(l+=1)}}o=u}return l%2===1}intersectsWithLine(e){const r=[];for(let n=0,i=this.points.length-1;n<i;n+=1){const s=this.points[n],a=this.points[n+1],o=e.intersectsWithLine(new lr(s,a));o&&r.push(o)}return r.length>0?r:null}isDifferentiable(){for(let e=0,r=this.points.length-1;e<r;e+=1){const n=this.points[e],i=this.points[e+1];if(new lr(n,i).isDifferentiable())return!0}return!1}length(){let e=0;for(let r=0,n=this.points.length-1;r<n;r+=1){const i=this.points[r],s=this.points[r+1];e+=i.distance(s)}return e}pointAt(e){const r=this.points,n=r.length;if(n===0)return null;if(n===1||e<=0)return r[0].clone();if(e>=1)return r[n-1].clone();const s=this.length()*e;return this.pointAtLength(s)}pointAtLength(e){const r=this.points,n=r.length;if(n===0)return null;if(n===1)return r[0].clone();let i=!0;e<0&&(i=!1,e=-e);let s=0;for(let o=0,l=n-1;o<l;o+=1){const u=i?o:l-1-o,h=r[u],d=r[u+1],f=new lr(h,d),p=h.distance(d);if(e<=s+p)return f.pointAtLength((i?1:-1)*(e-s));s+=p}return(i?r[n-1]:r[0]).clone()}tangentAt(e){const n=this.points.length;if(n===0||n===1)return null;e<0&&(e=0),e>1&&(e=1);const s=this.length()*e;return this.tangentAtLength(s)}tangentAtLength(e){const r=this.points,n=r.length;if(n===0||n===1)return null;let i=!0;e<0&&(i=!1,e=-e);let s,a=0;for(let o=0,l=n-1;o<l;o+=1){const u=i?o:l-1-o,h=r[u],d=r[u+1],f=new lr(h,d),p=h.distance(d);if(f.isDifferentiable()){if(e<=a+p)return f.tangentAtLength((i?1:-1)*(e-a));s=f}a+=p}if(s){const o=i?1:0;return s.tangentAt(o)}return null}simplify(e={}){const r=this.points;if(r.length<3)return this;const n=e.threshold||0;let i=0;for(;r[i+2];){const s=i,a=i+1,o=i+2,l=r[s],u=r[a],h=r[o];new lr(l,h).closestPoint(u).distance(u)<=n?r.splice(a,1):i+=1}return this}toHull(){const e=this.points,r=e.length;if(r===0)return new Ba;let n=e[0];for(let f=1;f<r;f+=1)(e[f].y<n.y||e[f].y===n.y&&e[f].x>n.x)&&(n=e[f]);const i=[];for(let f=0;f<r;f+=1){let p=n.theta(e[f]);p===0&&(p=360),i.push([e[f],f,p])}if(i.sort((f,p)=>{let g=f[2]-p[2];return g===0&&(g=p[1]-f[1]),g}),i.length>2){const f=i[i.length-1];i.unshift(f)}const s={},a=[],o=f=>`${f[0].toString()}@${f[1]}`;for(;i.length!==0;){const f=i.pop(),p=f[0];if(s[o(f)])continue;let g=!1;for(;!g;)if(a.length<2)a.push(f),g=!0;else{const m=a.pop(),y=m[0],v=a.pop(),x=v[0],b=x.cross(y,p);if(b<0)a.push(v),a.push(m),a.push(f),g=!0;else if(b===0){const C=y.angleBetween(x,p);Math.abs(C-180)<1e-10||y.equals(p)||x.equals(y)?(s[o(m)]=y,a.push(v)):Math.abs((C+1)%360-1)<1e-10&&(a.push(v),i.push(m))}else s[o(m)]=y,a.push(v)}}a.length>2&&a.pop();let l,u=-1;for(let f=0,p=a.length;f<p;f+=1){const g=a[f][1];(l===void 0||g<l)&&(l=g,u=f)}let h=[];if(u>0){const f=a.slice(u),p=a.slice(0,u);h=f.concat(p)}else h=a;const d=[];for(let f=0,p=h.length;f<p;f+=1)d.push(h[f][0]);return new Ba(d)}equals(e){return e==null||e.points.length!==this.points.length?!1:e.points.every((r,n)=>r.equals(this.points[n]))}clone(){return new Ba(this.points.map(e=>e.clone()))}toJSON(){return this.points.map(e=>e.toJSON())}serialize(){return this.points.map(e=>`${e.serialize()}`).join(" ")}}let Jf=class Wu extends Yg{static isCurve(e){return e!=null&&e instanceof Wu}static throughPoints(e){if(e==null||Array.isArray(e)&&e.length<2)throw new Error("At least 2 points are required");const r=wrt(e),n=[];for(let i=0,s=r[0].length;i<s;i+=1){const a=new Qe(r[0][i].x,r[0][i].y),o=new Qe(r[1][i].x,r[1][i].y);n.push(new Wu(e[i],a,o,e[i+1]))}return n}constructor(e,r,n,i){super(),this.PRECISION=3,this.start=Qe.create(e),this.controlPoint1=Qe.create(r),this.controlPoint2=Qe.create(n),this.end=Qe.create(i)}bbox(){const e=this.start,r=this.controlPoint1,n=this.controlPoint2,i=this.end,s=e.x,a=e.y,o=r.x,l=r.y,u=n.x,h=n.y,d=i.x,f=i.y,p=[],g=[[],[]];let m,y,v,x,b,T,C,S;for(let $=0;$<2;$+=1){if($===0?(y=6*s-12*o+6*u,m=-3*s+9*o-9*u+3*d,v=3*o-3*s):(y=6*a-12*l+6*h,m=-3*a+9*l-9*h+3*f,v=3*l-3*a),Math.abs(m)<1e-12){if(Math.abs(y)<1e-12)continue;x=-v/y,x>0&&x<1&&p.push(x);continue}C=y*y-4*v*m,S=Math.sqrt(C),!(C<0)&&(b=(-y+S)/(2*m),b>0&&b<1&&p.push(b),T=(-y-S)/(2*m),T>0&&T<1&&p.push(T))}let k,E,A,R=p.length;const _=R;for(;R;)R-=1,x=p[R],A=1-x,k=A*A*A*s+3*A*A*x*o+3*A*x*x*u+x*x*x*d,g[0][R]=k,E=A*A*A*a+3*A*A*x*l+3*A*x*x*h+x*x*x*f,g[1][R]=E;p[_]=0,p[_+1]=1,g[0][_]=s,g[1][_]=a,g[0][_+1]=d,g[1][_+1]=f,p.length=_+2,g[0].length=_+2,g[1].length=_+2;const P=Math.min.apply(null,g[0]),N=Math.min.apply(null,g[1]),L=Math.max.apply(null,g[0]),I=Math.max.apply(null,g[1]);return new Bt(P,N,L-P,I-N)}closestPoint(e,r={}){return this.pointAtT(this.closestPointT(e,r))}closestPointLength(e,r={}){const n=this.getOptions(r);return this.lengthAtT(this.closestPointT(e,n),n)}closestPointNormalizedLength(e,r={}){const n=this.getOptions(r),i=this.closestPointLength(e,n);if(!i)return 0;const s=this.length(n);return s===0?0:i/s}closestPointT(e,r={}){const n=this.getPrecision(r),i=this.getDivisions(r),s=Math.pow(10,-n);let a=null,o=0,l=0,u=0,h=0,d=0,f=null;const p=i.length;let g=p>0?1/p:0;for(i.forEach((m,y)=>{const v=m.start.distance(e),x=m.end.distance(e),b=v+x;(f==null||b<f)&&(a=m,o=y*g,l=(y+1)*g,u=v,h=x,f=b,d=m.endpointDistance())});;){const m=u?Math.abs(u-h)/u:0,y=h!=null?Math.abs(u-h)/h:0,v=m<s||y<s,x=u?u<d*s:!0,b=h?h<d*s:!0;if(v||(x||b))return u<=h?o:l;const C=a.divide(.5);g/=2;const S=C[0].start.distance(e),k=C[0].end.distance(e),E=S+k,A=C[1].start.distance(e),R=C[1].end.distance(e),_=A+R;E<=_?(a=C[0],l-=g,u=S,h=k):(a=C[1],o+=g,u=A,h=R)}}closestPointTangent(e,r={}){return this.tangentAtT(this.closestPointT(e,r))}containsPoint(e,r={}){return this.toPolyline(r).containsPoint(e)}divideAt(e,r={}){if(e<=0)return this.divideAtT(0);if(e>=1)return this.divideAtT(1);const n=this.tAt(e,r);return this.divideAtT(n)}divideAtLength(e,r={}){const n=this.tAtLength(e,r);return this.divideAtT(n)}divide(e){return this.divideAtT(e)}divideAtT(e){const r=this.start,n=this.controlPoint1,i=this.controlPoint2,s=this.end;if(e<=0)return[new Wu(r,r,r,r),new Wu(r,n,i,s)];if(e>=1)return[new Wu(r,n,i,s),new Wu(s,s,s,s)];const a=this.getSkeletonPoints(e),o=a.startControlPoint1,l=a.startControlPoint2,u=a.divider,h=a.dividerControlPoint1,d=a.dividerControlPoint2;return[new Wu(r,o,l,u),new Wu(u,h,d,s)]}endpointDistance(){return this.start.distance(this.end)}getSkeletonPoints(e){const r=this.start,n=this.controlPoint1,i=this.controlPoint2,s=this.end;if(e<=0)return{startControlPoint1:r.clone(),startControlPoint2:r.clone(),divider:r.clone(),dividerControlPoint1:n.clone(),dividerControlPoint2:i.clone()};if(e>=1)return{startControlPoint1:n.clone(),startControlPoint2:i.clone(),divider:s.clone(),dividerControlPoint1:s.clone(),dividerControlPoint2:s.clone()};const a=new lr(r,n).pointAt(e),o=new lr(n,i).pointAt(e),l=new lr(i,s).pointAt(e),u=new lr(a,o).pointAt(e),h=new lr(o,l).pointAt(e),d=new lr(u,h).pointAt(e);return{startControlPoint1:a,startControlPoint2:u,divider:d,dividerControlPoint1:h,dividerControlPoint2:l}}getSubdivisions(e={}){const r=this.getPrecision(e);let n=[new Wu(this.start,this.controlPoint1,this.controlPoint2,this.end)];if(r===0)return n;let i=this.endpointDistance();const s=Math.pow(10,-r);let a=0;for(;;){a+=1;const o=[];n.forEach(h=>{const d=h.divide(.5);o.push(d[0],d[1])});const l=o.reduce((h,d)=>h+d.endpointDistance(),0),u=l!==0?(l-i)/l:0;if(a>1&&u<s)return o;n=o,i=l}}length(e={}){return this.getDivisions(e).reduce((n,i)=>n+i.endpointDistance(),0)}lengthAtT(e,r={}){if(e<=0)return 0;const n=r.precision===void 0?this.PRECISION:r.precision;return this.divide(e)[0].length({precision:n})}pointAt(e,r={}){if(e<=0)return this.start.clone();if(e>=1)return this.end.clone();const n=this.tAt(e,r);return this.pointAtT(n)}pointAtLength(e,r={}){const n=this.tAtLength(e,r);return this.pointAtT(n)}pointAtT(e){return e<=0?this.start.clone():e>=1?this.end.clone():this.getSkeletonPoints(e).divider}isDifferentiable(){const e=this.start,r=this.controlPoint1,n=this.controlPoint2,i=this.end;return!(e.equals(r)&&r.equals(n)&&n.equals(i))}tangentAt(e,r={}){if(!this.isDifferentiable())return null;e<0?e=0:e>1&&(e=1);const n=this.tAt(e,r);return this.tangentAtT(n)}tangentAtLength(e,r={}){if(!this.isDifferentiable())return null;const n=this.tAtLength(e,r);return this.tangentAtT(n)}tangentAtT(e){if(!this.isDifferentiable())return null;e<0&&(e=0),e>1&&(e=1);const r=this.getSkeletonPoints(e),n=r.startControlPoint2,i=r.dividerControlPoint1,s=r.divider,a=new lr(n,i);return a.translate(s.x-n.x,s.y-n.y),a}getPrecision(e={}){return e.precision==null?this.PRECISION:e.precision}getDivisions(e={}){if(e.subdivisions!=null)return e.subdivisions;const r=this.getPrecision(e);return this.getSubdivisions({precision:r})}getOptions(e={}){const r=this.getPrecision(e),n=this.getDivisions(e);return{precision:r,subdivisions:n}}tAt(e,r={}){if(e<=0)return 0;if(e>=1)return 1;const n=this.getOptions(r),s=this.length(n)*e;return this.tAtLength(s,n)}tAtLength(e,r={}){let n=!0;e<0&&(n=!1,e=-e);const i=this.getPrecision(r),s=this.getDivisions(r),a={precision:i,subdivisions:s};let o=null,l,u,h=0,d=0,f=0;const p=s.length;let g=p>0?1/p:0;for(let v=0;v<p;v+=1){const x=n?v:p-1-v,b=s[v],T=b.endpointDistance();if(e<=f+T){o=b,l=x*g,u=(x+1)*g,h=n?e-f:T+f-e,d=n?T+f-e:e-f;break}f+=T}if(o==null)return n?1:0;const m=this.length(a),y=Math.pow(10,-i);for(;;){let v;if(v=m!==0?h/m:0,v<y)return l;if(v=m!==0?d/m:0,v<y)return u;let x,b;const T=o.divide(.5);g/=2;const C=T[0].endpointDistance(),S=T[1].endpointDistance();h<=C?(o=T[0],u-=g,x=h,b=C-x):(o=T[1],l+=g,x=h-C,b=S-x),h=x,d=b}}toPoints(e={}){const r=this.getDivisions(e),n=[r[0].start.clone()];return r.forEach(i=>n.push(i.end.clone())),n}toPolyline(e={}){return new Ba(this.toPoints(e))}scale(e,r,n){return this.start.scale(e,r,n),this.controlPoint1.scale(e,r,n),this.controlPoint2.scale(e,r,n),this.end.scale(e,r,n),this}rotate(e,r){return this.start.rotate(e,r),this.controlPoint1.rotate(e,r),this.controlPoint2.rotate(e,r),this.end.rotate(e,r),this}translate(e,r){return typeof e=="number"?(this.start.translate(e,r),this.controlPoint1.translate(e,r),this.controlPoint2.translate(e,r),this.end.translate(e,r)):(this.start.translate(e),this.controlPoint1.translate(e),this.controlPoint2.translate(e),this.end.translate(e)),this}equals(e){return e!=null&&this.start.equals(e.start)&&this.controlPoint1.equals(e.controlPoint1)&&this.controlPoint2.equals(e.controlPoint2)&&this.end.equals(e.end)}clone(){return new Wu(this.start,this.controlPoint1,this.controlPoint2,this.end)}toJSON(){return{start:this.start.toJSON(),controlPoint1:this.controlPoint1.toJSON(),controlPoint2:this.controlPoint2.toJSON(),end:this.end.toJSON()}}serialize(){return[this.start.serialize(),this.controlPoint1.serialize(),this.controlPoint2.serialize(),this.end.serialize()].join(" ")}};function lse(t){const e=t.length,r=[],n=[];let i=2;r[0]=t[0]/i;for(let s=1;s<e;s+=1)n[s]=1/i,i=(s<e-1?4:3.5)-n[s],r[s]=(t[s]-r[s-1])/i;for(let s=1;s<e;s+=1)r[e-s-1]-=n[e-s]*r[e-s];return r}function wrt(t){const e=t.map(l=>Qe.clone(l)),r=[],n=[],i=e.length-1;if(i===1)return r[0]=new Qe((2*e[0].x+e[1].x)/3,(2*e[0].y+e[1].y)/3),n[0]=new Qe(2*r[0].x-e[0].x,2*r[0].y-e[0].y),[r,n];const s=[];for(let l=1;l<i-1;l+=1)s[l]=4*e[l].x+2*e[l+1].x;s[0]=e[0].x+2*e[1].x,s[i-1]=(8*e[i-1].x+e[i].x)/2;const a=lse(s);for(let l=1;l<i-1;l+=1)s[l]=4*e[l].y+2*e[l+1].y;s[0]=e[0].y+2*e[1].y,s[i-1]=(8*e[i-1].y+e[i].y)/2;const o=lse(s);for(let l=0;l<i;l+=1)r.push(new Qe(a[l],o[l])),l<i-1?n.push(new Qe(2*e[l+1].x-a[l+1],2*e[l+1].y-o[l+1])):n.push(new Qe((e[i].x+a[i-1])/2,(e[i].y+o[i-1])/2));return[r,n]}class bN extends Yg{constructor(){super(...arguments),this.isVisible=!0,this.isSegment=!0,this.isSubpathStart=!1}get end(){return this.endPoint}get start(){if(this.previousSegment==null)throw new Error("Missing previous segment. (This segment cannot be the first segment of a path, or segment has not yet been added to a path.)");return this.previousSegment.end}closestPointT(e,r){if(this.closestPointNormalizedLength)return this.closestPointNormalizedLength(e);throw new Error("Neither `closestPointT` nor `closestPointNormalizedLength` method is implemented.")}lengthAtT(e,r){if(e<=0)return 0;const n=this.length();return e>=1?n:n*e}divideAtT(e){if(this.divideAt)return this.divideAt(e);throw new Error("Neither `divideAtT` nor `divideAt` method is implemented.")}pointAtT(e){if(this.pointAt)return this.pointAt(e);throw new Error("Neither `pointAtT` nor `pointAt` method is implemented.")}tangentAtT(e){if(this.tangentAt)return this.tangentAt(e);throw new Error("Neither `tangentAtT` nor `tangentAt` method is implemented.")}}class xa extends bN{static create(...e){const r=e.length,n=e[0];if(lr.isLine(n))return new xa(n);if(Qe.isPointLike(n))return r===1?new xa(n):e.map(s=>new xa(s));if(r===2)return new xa(+e[0],+e[1]);const i=[];for(let s=0;s<r;s+=2){const a=+e[s],o=+e[s+1];i.push(new xa(a,o))}return i}constructor(e,r){super(),lr.isLine(e)?this.endPoint=e.end.clone().round(2):this.endPoint=Qe.create(e,r).round(2)}get type(){return"L"}get line(){return new lr(this.start,this.end)}bbox(){return this.line.bbox()}closestPoint(e){return this.line.closestPoint(e)}closestPointLength(e){return this.line.closestPointLength(e)}closestPointNormalizedLength(e){return this.line.closestPointNormalizedLength(e)}closestPointTangent(e){return this.line.closestPointTangent(e)}length(){return this.line.length()}divideAt(e){const r=this.line.divideAt(e);return[new xa(r[0]),new xa(r[1])]}divideAtLength(e){const r=this.line.divideAtLength(e);return[new xa(r[0]),new xa(r[1])]}getSubdivisions(){return[]}pointAt(e){return this.line.pointAt(e)}pointAtLength(e){return this.line.pointAtLength(e)}tangentAt(e){return this.line.tangentAt(e)}tangentAtLength(e){return this.line.tangentAtLength(e)}isDifferentiable(){return this.previousSegment==null?!1:!this.start.equals(this.end)}clone(){return new xa(this.end)}scale(e,r,n){return this.end.scale(e,r,n),this}rotate(e,r){return this.end.rotate(e,r),this}translate(e,r){return typeof e=="number"?this.end.translate(e,r):this.end.translate(e),this}equals(e){return this.type===e.type&&this.start.equals(e.start)&&this.end.equals(e.end)}toJSON(){return{type:this.type,start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){const e=this.end;return`${this.type} ${e.x} ${e.y}`}}class PS extends bN{static create(){return new PS}get end(){if(!this.subpathStartSegment)throw new Error("Missing subpath start segment. (This segment needs a subpath start segment (e.g. MoveTo), or segment has not yet been added to a path.)");return this.subpathStartSegment.end}get type(){return"Z"}get line(){return new lr(this.start,this.end)}bbox(){return this.line.bbox()}closestPoint(e){return this.line.closestPoint(e)}closestPointLength(e){return this.line.closestPointLength(e)}closestPointNormalizedLength(e){return this.line.closestPointNormalizedLength(e)}closestPointTangent(e){return this.line.closestPointTangent(e)}length(){return this.line.length()}divideAt(e){const r=this.line.divideAt(e);return[r[1].isDifferentiable()?new xa(r[0]):this.clone(),new xa(r[1])]}divideAtLength(e){const r=this.line.divideAtLength(e);return[r[1].isDifferentiable()?new xa(r[0]):this.clone(),new xa(r[1])]}getSubdivisions(){return[]}pointAt(e){return this.line.pointAt(e)}pointAtLength(e){return this.line.pointAtLength(e)}tangentAt(e){return this.line.tangentAt(e)}tangentAtLength(e){return this.line.tangentAtLength(e)}isDifferentiable(){return!this.previousSegment||!this.subpathStartSegment?!1:!this.start.equals(this.end)}scale(){return this}rotate(){return this}translate(){return this}equals(e){return this.type===e.type&&this.start.equals(e.start)&&this.end.equals(e.end)}clone(){return new PS}toJSON(){return{type:this.type,start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){return this.type}}class nd extends bN{static create(...e){const r=e.length,n=e[0];if(lr.isLine(n))return new nd(n);if(Jf.isCurve(n))return new nd(n);if(Qe.isPointLike(n)){if(r===1)return new nd(n);const s=[];for(let a=0;a<r;a+=1)a===0?s.push(new nd(e[a])):s.push(new xa(e[a]));return s}if(r===2)return new nd(+e[0],+e[1]);const i=[];for(let s=0;s<r;s+=2){const a=+e[s],o=+e[s+1];s===0?i.push(new nd(a,o)):i.push(new xa(a,o))}return i}constructor(e,r){super(),this.isVisible=!1,this.isSubpathStart=!0,lr.isLine(e)||Jf.isCurve(e)?this.endPoint=e.end.clone().round(2):this.endPoint=Qe.create(e,r).round(2)}get start(){throw new Error("Illegal access. Moveto segments should not need a start property.")}get type(){return"M"}bbox(){return null}closestPoint(){return this.end.clone()}closestPointLength(){return 0}closestPointNormalizedLength(){return 0}closestPointT(){return 1}closestPointTangent(){return null}length(){return 0}lengthAtT(){return 0}divideAt(){return[this.clone(),this.clone()]}divideAtLength(){return[this.clone(),this.clone()]}getSubdivisions(){return[]}pointAt(){return this.end.clone()}pointAtLength(){return this.end.clone()}pointAtT(){return this.end.clone()}tangentAt(){return null}tangentAtLength(){return null}tangentAtT(){return null}isDifferentiable(){return!1}scale(e,r,n){return this.end.scale(e,r,n),this}rotate(e,r){return this.end.rotate(e,r),this}translate(e,r){return typeof e=="number"?this.end.translate(e,r):this.end.translate(e),this}clone(){return new nd(this.end)}equals(e){return this.type===e.type&&this.end.equals(e.end)}toJSON(){return{type:this.type,end:this.end.toJSON()}}serialize(){const e=this.end;return`${this.type} ${e.x} ${e.y}`}}class ol extends bN{static create(...e){const r=e.length,n=e[0];if(Jf.isCurve(n))return new ol(n);if(Qe.isPointLike(n)){if(r===3)return new ol(e[0],e[1],e[2]);const s=[];for(let a=0;a<r;a+=3)s.push(new ol(e[a],e[a+1],e[a+2]));return s}if(r===6)return new ol(e[0],e[1],e[2],e[3],e[4],e[5]);const i=[];for(let s=0;s<r;s+=6)i.push(new ol(e[s],e[s+1],e[s+2],e[s+3],e[s+4],e[s+5]));return i}constructor(e,r,n,i,s,a){super(),Jf.isCurve(e)?(this.controlPoint1=e.controlPoint1.clone().round(2),this.controlPoint2=e.controlPoint2.clone().round(2),this.endPoint=e.end.clone().round(2)):typeof e=="number"?(this.controlPoint1=new Qe(e,r).round(2),this.controlPoint2=new Qe(n,i).round(2),this.endPoint=new Qe(s,a).round(2)):(this.controlPoint1=Qe.create(e).round(2),this.controlPoint2=Qe.create(r).round(2),this.endPoint=Qe.create(n).round(2))}get type(){return"C"}get curve(){return new Jf(this.start,this.controlPoint1,this.controlPoint2,this.end)}bbox(){return this.curve.bbox()}closestPoint(e){return this.curve.closestPoint(e)}closestPointLength(e){return this.curve.closestPointLength(e)}closestPointNormalizedLength(e){return this.curve.closestPointNormalizedLength(e)}closestPointTangent(e){return this.curve.closestPointTangent(e)}length(){return this.curve.length()}divideAt(e,r={}){const n=this.curve.divideAt(e,r);return[new ol(n[0]),new ol(n[1])]}divideAtLength(e,r={}){const n=this.curve.divideAtLength(e,r);return[new ol(n[0]),new ol(n[1])]}divideAtT(e){const r=this.curve.divideAtT(e);return[new ol(r[0]),new ol(r[1])]}getSubdivisions(){return[]}pointAt(e){return this.curve.pointAt(e)}pointAtLength(e){return this.curve.pointAtLength(e)}tangentAt(e){return this.curve.tangentAt(e)}tangentAtLength(e){return this.curve.tangentAtLength(e)}isDifferentiable(){if(!this.previousSegment)return!1;const e=this.start,r=this.controlPoint1,n=this.controlPoint2,i=this.end;return!(e.equals(r)&&r.equals(n)&&n.equals(i))}scale(e,r,n){return this.controlPoint1.scale(e,r,n),this.controlPoint2.scale(e,r,n),this.end.scale(e,r,n),this}rotate(e,r){return this.controlPoint1.rotate(e,r),this.controlPoint2.rotate(e,r),this.end.rotate(e,r),this}translate(e,r){return typeof e=="number"?(this.controlPoint1.translate(e,r),this.controlPoint2.translate(e,r),this.end.translate(e,r)):(this.controlPoint1.translate(e),this.controlPoint2.translate(e),this.end.translate(e)),this}equals(e){return this.start.equals(e.start)&&this.end.equals(e.end)&&this.controlPoint1.equals(e.controlPoint1)&&this.controlPoint2.equals(e.controlPoint2)}clone(){return new ol(this.controlPoint1,this.controlPoint2,this.end)}toJSON(){return{type:this.type,start:this.start.toJSON(),controlPoint1:this.controlPoint1.toJSON(),controlPoint2:this.controlPoint2.toJSON(),end:this.end.toJSON()}}serialize(){const e=this.controlPoint1,r=this.controlPoint2,n=this.end;return[this.type,e.x,e.y,r.x,r.y,n.x,n.y].join(" ")}}function a7(t,e,r){return{x:t*Math.cos(r)-e*Math.sin(r),y:t*Math.sin(r)+e*Math.cos(r)}}function cse(t,e,r,n,i,s){const a=.3333333333333333,o=2/3;return[a*t+o*r,a*e+o*n,a*i+o*r,a*s+o*n,i,s]}function A2e(t,e,r,n,i,s,a,o,l,u){const h=Math.PI*120/180,d=Math.PI/180*(+i||0);let f=[],p,g,m,y,v;if(u)g=u[0],m=u[1],y=u[2],v=u[3];else{p=a7(t,e,-d),t=p.x,e=p.y,p=a7(o,l,-d),o=p.x,l=p.y;const L=(t-o)/2,I=(e-l)/2;let $=L*L/(r*r)+I*I/(n*n);$>1&&($=Math.sqrt($),r=$*r,n=$*n);const O=r*r,D=n*n,F=(s===a?-1:1)*Math.sqrt(Math.abs((O*D-O*I*I-D*L*L)/(O*I*I+D*L*L)));y=F*r*I/n+(t+o)/2,v=F*-n*L/r+(e+l)/2,g=Math.asin((e-v)/n),m=Math.asin((l-v)/n),g=t<y?Math.PI-g:g,m=o<y?Math.PI-m:m,g<0&&(g=Math.PI*2+g),m<0&&(m=Math.PI*2+m),a&&g>m&&(g-=Math.PI*2),!a&&m>g&&(m-=Math.PI*2)}let x=m-g;if(Math.abs(x)>h){const L=m,I=o,$=l;m=g+h*(a&&m>g?1:-1),o=y+r*Math.cos(m),l=v+n*Math.sin(m),f=A2e(o,l,r,n,i,0,a,I,$,[m,L,y,v])}x=m-g;const b=Math.cos(g),T=Math.sin(g),C=Math.cos(m),S=Math.sin(m),k=Math.tan(x/4),E=4/3*(r*k),A=4/3*(n*k),R=[t,e],_=[t+E*T,e-A*b],P=[o+E*S,l-A*C],N=[o,l];if(_[0]=2*R[0]-_[0],_[1]=2*R[1]-_[1],u)return[_,P,N].concat(f);{f=[_,P,N].concat(f).join().split(",");const L=[],I=f.length;for(let $=0;$<I;$+=1)L[$]=$%2?a7(+f[$-1],+f[$],d).y:a7(+f[$],+f[$+1],d).x;return L}}function Trt(t){if(!t)return null;const e=`+ <script type="module" crossorigin>var zYe=Object.defineProperty;var VYe=(t,e,r)=>e in t?zYe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var wr=(t,e,r)=>VYe(t,typeof e!="symbol"?e+"":e,r);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&n(a)}).observe(document,{childList:!0,subtree:!0});function r(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(i){if(i.ep)return;i.ep=!0;const s=r(i);fetch(i.href,s)}})();function gn(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function Nn(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(s=(i<3?a(s):i>3?a(e,r,s):a(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}function aX(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function o(h){try{u(n.next(h))}catch(d){a(d)}}function l(h){try{u(n.throw(h))}catch(d){a(d)}}function u(h){h.done?s(h.value):i(h.value).then(o,l)}u((n=n.apply(t,e||[])).next())})}function HYe(t){t.forEach(e=>{Object.hasOwn(e,"append")||Object.defineProperty(e,"append",{configurable:!0,enumerable:!0,writable:!0,value(...r){const n=document.createDocumentFragment();r.forEach(i=>{const s=i instanceof Node;n.appendChild(s?i:document.createTextNode(String(i)))}),this.appendChild(n)}})})}typeof window=="object"&&window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach);typeof window<"u"&&(t=>{HYe(t)})([Element.prototype,Document.prototype,DocumentFragment.prototype]);var cve=typeof global=="object"&&global&&global.Object===Object&&global,GYe=typeof self=="object"&&self&&self.Object===Object&&self,Ih=cve||GYe||Function("return this")(),Mu=Ih.Symbol,uve=Object.prototype,WYe=uve.hasOwnProperty,qYe=uve.toString,V3=Mu?Mu.toStringTag:void 0;function UYe(t){var e=WYe.call(t,V3),r=t[V3];try{t[V3]=void 0;var n=!0}catch{}var i=qYe.call(t);return n&&(e?t[V3]=r:delete t[V3]),i}var jYe=Object.prototype,YYe=jYe.toString;function XYe(t){return YYe.call(t)}var KYe="[object Null]",ZYe="[object Undefined]",bie=Mu?Mu.toStringTag:void 0;function Hg(t){return t==null?t===void 0?ZYe:KYe:bie&&bie in Object(t)?UYe(t):XYe(t)}function Eh(t){return t!=null&&typeof t=="object"}var QYe="[object Symbol]";function _d(t){return typeof t=="symbol"||Eh(t)&&Hg(t)==QYe}function yb(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}var Bs=Array.isArray,xie=Mu?Mu.prototype:void 0,wie=xie?xie.toString:void 0;function hve(t){if(typeof t=="string")return t;if(Bs(t))return yb(t,hve)+"";if(_d(t))return wie?wie.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}var JYe=/\s/;function eXe(t){for(var e=t.length;e--&&JYe.test(t.charAt(e)););return e}var tXe=/^\s+/;function rXe(t){return t&&t.slice(0,eXe(t)+1).replace(tXe,"")}function $s(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Tie=NaN,nXe=/^[-+]0x[0-9a-f]+$/i,iXe=/^0b[01]+$/i,sXe=/^0o[0-7]+$/i,aXe=parseInt;function vb(t){if(typeof t=="number")return t;if(_d(t))return Tie;if($s(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=$s(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=rXe(t);var r=iXe.test(t);return r||sXe.test(t)?aXe(t.slice(2),r?2:8):nXe.test(t)?Tie:+t}var Cie=1/0,oXe=17976931348623157e292;function bM(t){if(!t)return t===0?t:0;if(t=vb(t),t===Cie||t===-Cie){var e=t<0?-1:1;return e*oXe}return t===t?t:0}function lXe(t){var e=bM(t),r=e%1;return e===e?r?e-r:e:0}function Gg(t){return t}var cXe="[object AsyncFunction]",uXe="[object Function]",hXe="[object GeneratorFunction]",dXe="[object Proxy]";function _S(t){if(!$s(t))return!1;var e=Hg(t);return e==uXe||e==hXe||e==cXe||e==dXe}var KP=Ih["__core-js_shared__"],kie=(function(){var t=/[^.]+$/.exec(KP&&KP.keys&&KP.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function fXe(t){return!!kie&&kie in t}var pXe=Function.prototype,gXe=pXe.toString;function Gy(t){if(t!=null){try{return gXe.call(t)}catch{}try{return t+""}catch{}}return""}var mXe=/[\\^$.*+?()[\]{}|]/g,yXe=/^\[object .+?Constructor\]$/,vXe=Function.prototype,bXe=Object.prototype,xXe=vXe.toString,wXe=bXe.hasOwnProperty,TXe=RegExp("^"+xXe.call(wXe).replace(mXe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function CXe(t){if(!$s(t)||fXe(t))return!1;var e=_S(t)?TXe:yXe;return e.test(Gy(t))}function kXe(t,e){return t==null?void 0:t[e]}function Wy(t,e){var r=kXe(t,e);return CXe(r)?r:void 0}var FV=Wy(Ih,"WeakMap"),Sie=Object.create,SXe=(function(){function t(){}return function(e){if(!$s(e))return{};if(Sie)return Sie(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}})();function dve(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 EXe(){}function fve(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var AXe=800,MXe=16,RXe=Date.now;function _Xe(t){var e=0,r=0;return function(){var n=RXe(),i=MXe-(n-r);if(r=n,i>0){if(++e>=AXe)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Y2(t){return function(){return t}}var s9=(function(){try{var t=Wy(Object,"defineProperty");return t({},"",{}),t}catch{}})(),LXe=s9?function(t,e){return s9(t,"toString",{configurable:!0,enumerable:!1,value:Y2(e),writable:!0})}:Gg,pve=_Xe(LXe);function gve(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}function mve(t,e,r,n){for(var i=t.length,s=r+-1;++s<i;)if(e(t[s],s,t))return s;return-1}function IXe(t){return t!==t}function NXe(t,e,r){for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}function DXe(t,e,r){return e===e?NXe(t,e,r):mve(t,IXe,r)}function yve(t,e){var r=t==null?0:t.length;return!!r&&DXe(t,e,0)>-1}var OXe=9007199254740991,PXe=/^(?:0|[1-9]\d*)$/;function iN(t,e){var r=typeof t;return e=e??OXe,!!e&&(r=="number"||r!="symbol"&&PXe.test(t))&&t>-1&&t%1==0&&t<e}function R6(t,e,r){e=="__proto__"&&s9?s9(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function K5(t,e){return t===e||t!==t&&e!==e}var $Xe=Object.prototype,BXe=$Xe.hasOwnProperty;function sN(t,e,r){var n=t[e];(!(BXe.call(t,e)&&K5(n,r))||r===void 0&&!(e in t))&&R6(t,e,r)}function _6(t,e,r,n){var i=!r;r||(r={});for(var s=-1,a=e.length;++s<a;){var o=e[s],l=void 0;l===void 0&&(l=t[o]),i?R6(r,o,l):sN(r,o,l)}return r}var Eie=Math.max;function vve(t,e,r){return e=Eie(e===void 0?t.length-1:e,0),function(){for(var n=arguments,i=-1,s=Eie(n.length-e,0),a=Array(s);++i<s;)a[i]=n[e+i];i=-1;for(var o=Array(e+1);++i<e;)o[i]=n[i];return o[e]=r(a),dve(t,this,o)}}function Z5(t,e){return pve(vve(t,e,Gg),t+"")}var FXe=9007199254740991;function oX(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=FXe}function Wg(t){return t!=null&&oX(t.length)&&!_S(t)}function LS(t,e,r){if(!$s(r))return!1;var n=typeof e;return(n=="number"?Wg(r)&&iN(e,r.length):n=="string"&&e in r)?K5(r[e],t):!1}function bve(t){return Z5(function(e,r){var n=-1,i=r.length,s=i>1?r[i-1]:void 0,a=i>2?r[2]:void 0;for(s=t.length>3&&typeof s=="function"?(i--,s):void 0,a&&LS(r[0],r[1],a)&&(s=i<3?void 0:s,i=1),e=Object(e);++n<i;){var o=r[n];o&&t(e,o,n,s)}return e})}var zXe=Object.prototype;function aN(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||zXe;return t===r}function VXe(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var HXe="[object Arguments]";function Aie(t){return Eh(t)&&Hg(t)==HXe}var xve=Object.prototype,GXe=xve.hasOwnProperty,WXe=xve.propertyIsEnumerable,NT=Aie((function(){return arguments})())?Aie:function(t){return Eh(t)&&GXe.call(t,"callee")&&!WXe.call(t,"callee")};function qXe(){return!1}var wve=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Mie=wve&&typeof module=="object"&&module&&!module.nodeType&&module,UXe=Mie&&Mie.exports===wve,Rie=UXe?Ih.Buffer:void 0,jXe=Rie?Rie.isBuffer:void 0,DT=jXe||qXe,YXe="[object Arguments]",XXe="[object Array]",KXe="[object Boolean]",ZXe="[object Date]",QXe="[object Error]",JXe="[object Function]",eKe="[object Map]",tKe="[object Number]",rKe="[object Object]",nKe="[object RegExp]",iKe="[object Set]",sKe="[object String]",aKe="[object WeakMap]",oKe="[object ArrayBuffer]",lKe="[object DataView]",cKe="[object Float32Array]",uKe="[object Float64Array]",hKe="[object Int8Array]",dKe="[object Int16Array]",fKe="[object Int32Array]",pKe="[object Uint8Array]",gKe="[object Uint8ClampedArray]",mKe="[object Uint16Array]",yKe="[object Uint32Array]",Ui={};Ui[cKe]=Ui[uKe]=Ui[hKe]=Ui[dKe]=Ui[fKe]=Ui[pKe]=Ui[gKe]=Ui[mKe]=Ui[yKe]=!0;Ui[YXe]=Ui[XXe]=Ui[oKe]=Ui[KXe]=Ui[lKe]=Ui[ZXe]=Ui[QXe]=Ui[JXe]=Ui[eKe]=Ui[tKe]=Ui[rKe]=Ui[nKe]=Ui[iKe]=Ui[sKe]=Ui[aKe]=!1;function vKe(t){return Eh(t)&&oX(t.length)&&!!Ui[Hg(t)]}function oN(t){return function(e){return t(e)}}var Tve=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Dk=Tve&&typeof module=="object"&&module&&!module.nodeType&&module,bKe=Dk&&Dk.exports===Tve,ZP=bKe&&cve.process,OT=(function(){try{var t=Dk&&Dk.require&&Dk.require("util").types;return t||ZP&&ZP.binding&&ZP.binding("util")}catch{}})(),_ie=OT&&OT.isTypedArray,lN=_ie?oN(_ie):vKe,xKe=Object.prototype,wKe=xKe.hasOwnProperty;function Cve(t,e){var r=Bs(t),n=!r&&NT(t),i=!r&&!n&&DT(t),s=!r&&!n&&!i&&lN(t),a=r||n||i||s,o=a?VXe(t.length,String):[],l=o.length;for(var u in t)(e||wKe.call(t,u))&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||s&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||iN(u,l)))&&o.push(u);return o}function kve(t,e){return function(r){return t(e(r))}}var TKe=kve(Object.keys,Object),CKe=Object.prototype,kKe=CKe.hasOwnProperty;function Sve(t){if(!aN(t))return TKe(t);var e=[];for(var r in Object(t))kKe.call(t,r)&&r!="constructor"&&e.push(r);return e}function Lc(t){return Wg(t)?Cve(t):Sve(t)}function SKe(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var EKe=Object.prototype,AKe=EKe.hasOwnProperty;function MKe(t){if(!$s(t))return SKe(t);var e=aN(t),r=[];for(var n in t)n=="constructor"&&(e||!AKe.call(t,n))||r.push(n);return r}function qy(t){return Wg(t)?Cve(t,!0):MKe(t)}var RKe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,_Ke=/^\w*$/;function lX(t,e){if(Bs(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||_d(t)?!0:_Ke.test(t)||!RKe.test(t)||e!=null&&t in Object(e)}var IS=Wy(Object,"create");function LKe(){this.__data__=IS?IS(null):{},this.size=0}function IKe(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var NKe="__lodash_hash_undefined__",DKe=Object.prototype,OKe=DKe.hasOwnProperty;function PKe(t){var e=this.__data__;if(IS){var r=e[t];return r===NKe?void 0:r}return OKe.call(e,t)?e[t]:void 0}var $Ke=Object.prototype,BKe=$Ke.hasOwnProperty;function FKe(t){var e=this.__data__;return IS?e[t]!==void 0:BKe.call(e,t)}var zKe="__lodash_hash_undefined__";function VKe(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=IS&&e===void 0?zKe:e,this}function uy(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])}}uy.prototype.clear=LKe;uy.prototype.delete=IKe;uy.prototype.get=PKe;uy.prototype.has=FKe;uy.prototype.set=VKe;function HKe(){this.__data__=[],this.size=0}function cN(t,e){for(var r=t.length;r--;)if(K5(t[r][0],e))return r;return-1}var GKe=Array.prototype,WKe=GKe.splice;function qKe(t){var e=this.__data__,r=cN(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():WKe.call(e,r,1),--this.size,!0}function UKe(t){var e=this.__data__,r=cN(e,t);return r<0?void 0:e[r][1]}function jKe(t){return cN(this.__data__,t)>-1}function YKe(t,e){var r=this.__data__,n=cN(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function $0(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])}}$0.prototype.clear=HKe;$0.prototype.delete=qKe;$0.prototype.get=UKe;$0.prototype.has=jKe;$0.prototype.set=YKe;var NS=Wy(Ih,"Map");function XKe(){this.size=0,this.__data__={hash:new uy,map:new(NS||$0),string:new uy}}function KKe(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function uN(t,e){var r=t.__data__;return KKe(e)?r[typeof e=="string"?"string":"hash"]:r.map}function ZKe(t){var e=uN(this,t).delete(t);return this.size-=e?1:0,e}function QKe(t){return uN(this,t).get(t)}function JKe(t){return uN(this,t).has(t)}function eZe(t,e){var r=uN(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function B0(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])}}B0.prototype.clear=XKe;B0.prototype.delete=ZKe;B0.prototype.get=QKe;B0.prototype.has=JKe;B0.prototype.set=eZe;var tZe="Expected a function";function cX(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(tZe);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 a=t.apply(this,n);return r.cache=s.set(i,a)||s,a};return r.cache=new(cX.Cache||B0),r}cX.Cache=B0;var rZe=500;function nZe(t){var e=cX(t,function(n){return r.size===rZe&&r.clear(),n}),r=e.cache;return e}var iZe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,sZe=/\\(\\)?/g,aZe=nZe(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(iZe,function(r,n,i,s){e.push(i?s.replace(sZe,"$1"):n||r)}),e});function Q5(t){return t==null?"":hve(t)}function hN(t,e){return Bs(t)?t:lX(t,e)?[t]:aZe(Q5(t))}function L6(t){if(typeof t=="string"||_d(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function dN(t,e){e=hN(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[L6(e[r++])];return r&&r==n?t:void 0}function oZe(t,e,r){var n=t==null?void 0:dN(t,e);return n===void 0?r:n}function uX(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}var Lie=Mu?Mu.isConcatSpreadable:void 0;function lZe(t){return Bs(t)||NT(t)||!!(Lie&&t&&t[Lie])}function fN(t,e,r,n,i){var s=-1,a=t.length;for(r||(r=lZe),i||(i=[]);++s<a;){var o=t[s];r(o)?uX(i,o):n||(i[i.length]=o)}return i}function J5(t){var e=t==null?0:t.length;return e?fN(t):[]}function cZe(t){return pve(vve(t,void 0,J5),t+"")}var hX=kve(Object.getPrototypeOf,Object),uZe="[object Object]",hZe=Function.prototype,dZe=Object.prototype,Eve=hZe.toString,fZe=dZe.hasOwnProperty,pZe=Eve.call(Object);function Nh(t){if(!Eh(t)||Hg(t)!=uZe)return!1;var e=hX(t);if(e===null)return!0;var r=fZe.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Eve.call(r)==pZe}function gZe(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),r=r>i?i:r,r<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var s=Array(i);++n<i;)s[n]=t[n+e];return s}function mZe(t,e,r){var n=t.length;return r=r===void 0?n:r,!e&&r>=n?t:gZe(t,e,r)}var yZe="\\ud800-\\udfff",vZe="\\u0300-\\u036f",bZe="\\ufe20-\\ufe2f",xZe="\\u20d0-\\u20ff",wZe=vZe+bZe+xZe,TZe="\\ufe0e\\ufe0f",CZe="\\u200d",kZe=RegExp("["+CZe+yZe+wZe+TZe+"]");function Ave(t){return kZe.test(t)}function SZe(t){return t.split("")}var Mve="\\ud800-\\udfff",EZe="\\u0300-\\u036f",AZe="\\ufe20-\\ufe2f",MZe="\\u20d0-\\u20ff",RZe=EZe+AZe+MZe,_Ze="\\ufe0e\\ufe0f",LZe="["+Mve+"]",zV="["+RZe+"]",VV="\\ud83c[\\udffb-\\udfff]",IZe="(?:"+zV+"|"+VV+")",Rve="[^"+Mve+"]",_ve="(?:\\ud83c[\\udde6-\\uddff]){2}",Lve="[\\ud800-\\udbff][\\udc00-\\udfff]",NZe="\\u200d",Ive=IZe+"?",Nve="["+_Ze+"]?",DZe="(?:"+NZe+"(?:"+[Rve,_ve,Lve].join("|")+")"+Nve+Ive+")*",OZe=Nve+Ive+DZe,PZe="(?:"+[Rve+zV+"?",zV,_ve,Lve,LZe].join("|")+")",$Ze=RegExp(VV+"(?="+VV+")|"+PZe+OZe,"g");function BZe(t){return t.match($Ze)||[]}function FZe(t){return Ave(t)?BZe(t):SZe(t)}function Dve(t){return function(e){e=Q5(e);var r=Ave(e)?FZe(e):void 0,n=r?r[0]:e.charAt(0),i=r?mZe(r,1).join(""):e.slice(1);return n[t]()+i}}var a9=Dve("toUpperCase");function zZe(t){return a9(Q5(t).toLowerCase())}function Ove(t,e,r,n){var i=-1,s=t==null?0:t.length;for(n&&s&&(r=t[++i]);++i<s;)r=e(r,t[i],i,t);return r}function VZe(t){return function(e){return t==null?void 0:t[e]}}var HZe={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},GZe=VZe(HZe),WZe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,qZe="\\u0300-\\u036f",UZe="\\ufe20-\\ufe2f",jZe="\\u20d0-\\u20ff",YZe=qZe+UZe+jZe,XZe="["+YZe+"]",KZe=RegExp(XZe,"g");function ZZe(t){return t=Q5(t),t&&t.replace(WZe,GZe).replace(KZe,"")}var QZe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function JZe(t){return t.match(QZe)||[]}var eQe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function tQe(t){return eQe.test(t)}var Pve="\\ud800-\\udfff",rQe="\\u0300-\\u036f",nQe="\\ufe20-\\ufe2f",iQe="\\u20d0-\\u20ff",sQe=rQe+nQe+iQe,$ve="\\u2700-\\u27bf",Bve="a-z\\xdf-\\xf6\\xf8-\\xff",aQe="\\xac\\xb1\\xd7\\xf7",oQe="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",lQe="\\u2000-\\u206f",cQe=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Fve="A-Z\\xc0-\\xd6\\xd8-\\xde",uQe="\\ufe0e\\ufe0f",zve=aQe+oQe+lQe+cQe,Vve="['’]",Iie="["+zve+"]",hQe="["+sQe+"]",Hve="\\d+",dQe="["+$ve+"]",Gve="["+Bve+"]",Wve="[^"+Pve+zve+Hve+$ve+Bve+Fve+"]",fQe="\\ud83c[\\udffb-\\udfff]",pQe="(?:"+hQe+"|"+fQe+")",gQe="[^"+Pve+"]",qve="(?:\\ud83c[\\udde6-\\uddff]){2}",Uve="[\\ud800-\\udbff][\\udc00-\\udfff]",f2="["+Fve+"]",mQe="\\u200d",Nie="(?:"+Gve+"|"+Wve+")",yQe="(?:"+f2+"|"+Wve+")",Die="(?:"+Vve+"(?:d|ll|m|re|s|t|ve))?",Oie="(?:"+Vve+"(?:D|LL|M|RE|S|T|VE))?",jve=pQe+"?",Yve="["+uQe+"]?",vQe="(?:"+mQe+"(?:"+[gQe,qve,Uve].join("|")+")"+Yve+jve+")*",bQe="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",xQe="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",wQe=Yve+jve+vQe,TQe="(?:"+[dQe,qve,Uve].join("|")+")"+wQe,CQe=RegExp([f2+"?"+Gve+"+"+Die+"(?="+[Iie,f2,"$"].join("|")+")",yQe+"+"+Oie+"(?="+[Iie,f2+Nie,"$"].join("|")+")",f2+"?"+Nie+"+"+Die,f2+"+"+Oie,xQe,bQe,Hve,TQe].join("|"),"g");function kQe(t){return t.match(CQe)||[]}function SQe(t,e,r){return t=Q5(t),e=e,e===void 0?tQe(t)?kQe(t):JZe(t):t.match(e)||[]}var EQe="['’]",AQe=RegExp(EQe,"g");function Xve(t){return function(e){return Ove(SQe(ZZe(e).replace(AQe,"")),t,"")}}var I6=Xve(function(t,e,r){return e=e.toLowerCase(),t+(r?zZe(e):e)});function Pie(){if(!arguments.length)return[];var t=arguments[0];return Bs(t)?t:[t]}function MQe(t,e,r){return t===t&&(r!==void 0&&(t=t<=r?t:r),e!==void 0&&(t=t>=e?t:e)),t}function Y1(t,e,r){return r===void 0&&(r=e,e=void 0),r!==void 0&&(r=vb(r),r=r===r?r:0),e!==void 0&&(e=vb(e),e=e===e?e:0),MQe(vb(t),e,r)}function RQe(){this.__data__=new $0,this.size=0}function _Qe(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function LQe(t){return this.__data__.get(t)}function IQe(t){return this.__data__.has(t)}var NQe=200;function DQe(t,e){var r=this.__data__;if(r instanceof $0){var n=r.__data__;if(!NS||n.length<NQe-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new B0(n)}return r.set(t,e),this.size=r.size,this}function hh(t){var e=this.__data__=new $0(t);this.size=e.size}hh.prototype.clear=RQe;hh.prototype.delete=_Qe;hh.prototype.get=LQe;hh.prototype.has=IQe;hh.prototype.set=DQe;function OQe(t,e){return t&&_6(e,Lc(e),t)}function PQe(t,e){return t&&_6(e,qy(e),t)}var Kve=typeof exports=="object"&&exports&&!exports.nodeType&&exports,$ie=Kve&&typeof module=="object"&&module&&!module.nodeType&&module,$Qe=$ie&&$ie.exports===Kve,Bie=$Qe?Ih.Buffer:void 0,Fie=Bie?Bie.allocUnsafe:void 0;function Zve(t,e){if(e)return t.slice();var r=t.length,n=Fie?Fie(r):new t.constructor(r);return t.copy(n),n}function Qve(t,e){for(var r=-1,n=t==null?0:t.length,i=0,s=[];++r<n;){var a=t[r];e(a,r,t)&&(s[i++]=a)}return s}function Jve(){return[]}var BQe=Object.prototype,FQe=BQe.propertyIsEnumerable,zie=Object.getOwnPropertySymbols,dX=zie?function(t){return t==null?[]:(t=Object(t),Qve(zie(t),function(e){return FQe.call(t,e)}))}:Jve;function zQe(t,e){return _6(t,dX(t),e)}var VQe=Object.getOwnPropertySymbols,e2e=VQe?function(t){for(var e=[];t;)uX(e,dX(t)),t=hX(t);return e}:Jve;function HQe(t,e){return _6(t,e2e(t),e)}function t2e(t,e,r){var n=e(t);return Bs(t)?n:uX(n,r(t))}function HV(t){return t2e(t,Lc,dX)}function GQe(t){return t2e(t,qy,e2e)}var GV=Wy(Ih,"DataView"),WV=Wy(Ih,"Promise"),bb=Wy(Ih,"Set"),Vie="[object Map]",WQe="[object Object]",Hie="[object Promise]",Gie="[object Set]",Wie="[object WeakMap]",qie="[object DataView]",qQe=Gy(GV),UQe=Gy(NS),jQe=Gy(WV),YQe=Gy(bb),XQe=Gy(FV),du=Hg;(GV&&du(new GV(new ArrayBuffer(1)))!=qie||NS&&du(new NS)!=Vie||WV&&du(WV.resolve())!=Hie||bb&&du(new bb)!=Gie||FV&&du(new FV)!=Wie)&&(du=function(t){var e=Hg(t),r=e==WQe?t.constructor:void 0,n=r?Gy(r):"";if(n)switch(n){case qQe:return qie;case UQe:return Vie;case jQe:return Hie;case YQe:return Gie;case XQe:return Wie}return e});var KQe=Object.prototype,ZQe=KQe.hasOwnProperty;function QQe(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&ZQe.call(t,"index")&&(r.index=t.index,r.input=t.input),r}var o9=Ih.Uint8Array;function fX(t){var e=new t.constructor(t.byteLength);return new o9(e).set(new o9(t)),e}function JQe(t,e){var r=e?fX(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var eJe=/\w*$/;function tJe(t){var e=new t.constructor(t.source,eJe.exec(t));return e.lastIndex=t.lastIndex,e}var Uie=Mu?Mu.prototype:void 0,jie=Uie?Uie.valueOf:void 0;function rJe(t){return jie?Object(jie.call(t)):{}}function r2e(t,e){var r=e?fX(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var nJe="[object Boolean]",iJe="[object Date]",sJe="[object Map]",aJe="[object Number]",oJe="[object RegExp]",lJe="[object Set]",cJe="[object String]",uJe="[object Symbol]",hJe="[object ArrayBuffer]",dJe="[object DataView]",fJe="[object Float32Array]",pJe="[object Float64Array]",gJe="[object Int8Array]",mJe="[object Int16Array]",yJe="[object Int32Array]",vJe="[object Uint8Array]",bJe="[object Uint8ClampedArray]",xJe="[object Uint16Array]",wJe="[object Uint32Array]";function TJe(t,e,r){var n=t.constructor;switch(e){case hJe:return fX(t);case nJe:case iJe:return new n(+t);case dJe:return JQe(t,r);case fJe:case pJe:case gJe:case mJe:case yJe:case vJe:case bJe:case xJe:case wJe:return r2e(t,r);case sJe:return new n;case aJe:case cJe:return new n(t);case oJe:return tJe(t);case lJe:return new n;case uJe:return rJe(t)}}function n2e(t){return typeof t.constructor=="function"&&!aN(t)?SXe(hX(t)):{}}var CJe="[object Map]";function kJe(t){return Eh(t)&&du(t)==CJe}var Yie=OT&&OT.isMap,SJe=Yie?oN(Yie):kJe,EJe="[object Set]";function AJe(t){return Eh(t)&&du(t)==EJe}var Xie=OT&&OT.isSet,MJe=Xie?oN(Xie):AJe,RJe=1,_Je=2,LJe=4,i2e="[object Arguments]",IJe="[object Array]",NJe="[object Boolean]",DJe="[object Date]",OJe="[object Error]",s2e="[object Function]",PJe="[object GeneratorFunction]",$Je="[object Map]",BJe="[object Number]",a2e="[object Object]",FJe="[object RegExp]",zJe="[object Set]",VJe="[object String]",HJe="[object Symbol]",GJe="[object WeakMap]",WJe="[object ArrayBuffer]",qJe="[object DataView]",UJe="[object Float32Array]",jJe="[object Float64Array]",YJe="[object Int8Array]",XJe="[object Int16Array]",KJe="[object Int32Array]",ZJe="[object Uint8Array]",QJe="[object Uint8ClampedArray]",JJe="[object Uint16Array]",eet="[object Uint32Array]",Ii={};Ii[i2e]=Ii[IJe]=Ii[WJe]=Ii[qJe]=Ii[NJe]=Ii[DJe]=Ii[UJe]=Ii[jJe]=Ii[YJe]=Ii[XJe]=Ii[KJe]=Ii[$Je]=Ii[BJe]=Ii[a2e]=Ii[FJe]=Ii[zJe]=Ii[VJe]=Ii[HJe]=Ii[ZJe]=Ii[QJe]=Ii[JJe]=Ii[eet]=!0;Ii[OJe]=Ii[s2e]=Ii[GJe]=!1;function Ok(t,e,r,n,i,s){var a,o=e&RJe,l=e&_Je,u=e&LJe;if(a!==void 0)return a;if(!$s(t))return t;var h=Bs(t);if(h){if(a=QQe(t),!o)return fve(t,a)}else{var d=du(t),f=d==s2e||d==PJe;if(DT(t))return Zve(t,o);if(d==a2e||d==i2e||f&&!i){if(a=l||f?{}:n2e(t),!o)return l?HQe(t,PQe(a,t)):zQe(t,OQe(a,t))}else{if(!Ii[d])return i?t:{};a=TJe(t,d,o)}}s||(s=new hh);var p=s.get(t);if(p)return p;s.set(t,a),MJe(t)?t.forEach(function(y){a.add(Ok(y,e,r,y,t,s))}):SJe(t)&&t.forEach(function(y,v){a.set(v,Ok(y,e,r,v,t,s))});var g=u?l?GQe:HV:l?qy:Lc,m=h?void 0:g(t);return gve(m||t,function(y,v){m&&(v=y,y=t[v]),sN(a,v,Ok(y,e,r,v,t,s))}),a}var tet=4;function l9(t){return Ok(t,tet)}var ret=1,net=4;function Oi(t){return Ok(t,ret|net)}var iet="__lodash_hash_undefined__";function set(t){return this.__data__.set(t,iet),this}function aet(t){return this.__data__.has(t)}function PT(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new B0;++e<r;)this.add(t[e])}PT.prototype.add=PT.prototype.push=set;PT.prototype.has=aet;function oet(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function pX(t,e){return t.has(e)}var cet=1,uet=2;function o2e(t,e,r,n,i,s){var a=r&cet,o=t.length,l=e.length;if(o!=l&&!(a&&l>o))return!1;var u=s.get(t),h=s.get(e);if(u&&h)return u==e&&h==t;var d=-1,f=!0,p=r&uet?new PT:void 0;for(s.set(t,e),s.set(e,t);++d<o;){var g=t[d],m=e[d];if(n)var y=a?n(m,g,d,e,t,s):n(g,m,d,t,e,s);if(y!==void 0){if(y)continue;f=!1;break}if(p){if(!oet(e,function(v,x){if(!pX(p,x)&&(g===v||i(g,v,r,n,s)))return p.push(x)})){f=!1;break}}else if(!(g===m||i(g,m,r,n,s))){f=!1;break}}return s.delete(t),s.delete(e),f}function het(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}function gX(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var det=1,fet=2,pet="[object Boolean]",get="[object Date]",met="[object Error]",yet="[object Map]",vet="[object Number]",bet="[object RegExp]",xet="[object Set]",wet="[object String]",Tet="[object Symbol]",Cet="[object ArrayBuffer]",ket="[object DataView]",Kie=Mu?Mu.prototype:void 0,QP=Kie?Kie.valueOf:void 0;function Eet(t,e,r,n,i,s,a){switch(r){case ket:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Cet:return!(t.byteLength!=e.byteLength||!s(new o9(t),new o9(e)));case pet:case get:case vet:return K5(+t,+e);case met:return t.name==e.name&&t.message==e.message;case bet:case wet:return t==e+"";case yet:var o=het;case xet:var l=n&det;if(o||(o=gX),t.size!=e.size&&!l)return!1;var u=a.get(t);if(u)return u==e;n|=fet,a.set(t,e);var h=o2e(o(t),o(e),n,i,s,a);return a.delete(t),h;case Tet:if(QP)return QP.call(t)==QP.call(e)}return!1}var Aet=1,Met=Object.prototype,Ret=Met.hasOwnProperty;function _et(t,e,r,n,i,s){var a=r&Aet,o=HV(t),l=o.length,u=HV(e),h=u.length;if(l!=h&&!a)return!1;for(var d=l;d--;){var f=o[d];if(!(a?f in e:Ret.call(e,f)))return!1}var p=s.get(t),g=s.get(e);if(p&&g)return p==e&&g==t;var m=!0;s.set(t,e),s.set(e,t);for(var y=a;++d<l;){f=o[d];var v=t[f],x=e[f];if(n)var b=a?n(x,v,f,e,t,s):n(v,x,f,t,e,s);if(!(b===void 0?v===x||i(v,x,r,n,s):b)){m=!1;break}y||(y=f=="constructor")}if(m&&!y){var T=t.constructor,C=e.constructor;T!=C&&"constructor"in t&&"constructor"in e&&!(typeof T=="function"&&T instanceof T&&typeof C=="function"&&C instanceof C)&&(m=!1)}return s.delete(t),s.delete(e),m}var Let=1,Zie="[object Arguments]",Qie="[object Array]",s7="[object Object]",Iet=Object.prototype,Jie=Iet.hasOwnProperty;function Net(t,e,r,n,i,s){var a=Bs(t),o=Bs(e),l=a?Qie:du(t),u=o?Qie:du(e);l=l==Zie?s7:l,u=u==Zie?s7:u;var h=l==s7,d=u==s7,f=l==u;if(f&&DT(t)){if(!DT(e))return!1;a=!0,h=!1}if(f&&!h)return s||(s=new hh),a||lN(t)?o2e(t,e,r,n,i,s):Eet(t,e,l,r,n,i,s);if(!(r&Let)){var p=h&&Jie.call(t,"__wrapped__"),g=d&&Jie.call(e,"__wrapped__");if(p||g){var m=p?t.value():t,y=g?e.value():e;return s||(s=new hh),i(m,y,r,n,s)}}return f?(s||(s=new hh),_et(t,e,r,n,i,s)):!1}function pN(t,e,r,n,i){return t===e?!0:t==null||e==null||!Eh(t)&&!Eh(e)?t!==t&&e!==e:Net(t,e,r,n,pN,i)}var Det=1,Oet=2;function Pet(t,e,r,n){var i=r.length,s=i;if(t==null)return!s;for(t=Object(t);i--;){var a=r[i];if(a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<s;){a=r[i];var o=a[0],l=t[o],u=a[1];if(a[2]){if(l===void 0&&!(o in t))return!1}else{var h=new hh,d;if(!(d===void 0?pN(u,l,Det|Oet,n,h):d))return!1}}return!0}function l2e(t){return t===t&&!$s(t)}function $et(t){for(var e=Lc(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,l2e(i)]}return e}function c2e(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function Bet(t){var e=$et(t);return e.length==1&&e[0][2]?c2e(e[0][0],e[0][1]):function(r){return r===t||Pet(r,t,e)}}function Fet(t,e){return t!=null&&e in Object(t)}function u2e(t,e,r){e=hN(e,t);for(var n=-1,i=e.length,s=!1;++n<i;){var a=L6(e[n]);if(!(s=t!=null&&r(t,a)))break;t=t[a]}return s||++n!=i?s:(i=t==null?0:t.length,!!i&&oX(i)&&iN(a,i)&&(Bs(t)||NT(t)))}function h2e(t,e){return t!=null&&u2e(t,e,Fet)}var zet=1,Vet=2;function Het(t,e){return lX(t)&&l2e(e)?c2e(L6(t),e):function(r){var n=oZe(r,t);return n===void 0&&n===e?h2e(r,t):pN(e,n,zet|Vet)}}function Get(t){return function(e){return e==null?void 0:e[t]}}function Wet(t){return function(e){return dN(e,t)}}function qet(t){return lX(t)?Get(L6(t)):Wet(t)}function F0(t){return typeof t=="function"?t:t==null?Gg:typeof t=="object"?Bs(t)?Het(t[0],t[1]):Bet(t):qet(t)}function Uet(t,e,r,n){for(var i=-1,s=t==null?0:t.length;++i<s;){var a=t[i];e(n,a,r(a),t)}return n}function jet(t){return function(e,r,n){for(var i=-1,s=Object(e),a=n(e),o=a.length;o--;){var l=a[++i];if(r(s[l],l,s)===!1)break}return e}}var mX=jet();function yX(t,e){return t&&mX(t,e,Lc)}function Yet(t,e){return function(r,n){if(r==null)return r;if(!Wg(r))return t(r,n);for(var i=r.length,s=-1,a=Object(r);++s<i&&n(a[s],s,a)!==!1;);return r}}var N6=Yet(yX);function Xet(t,e,r,n){return N6(t,function(i,s,a){e(n,i,r(i),a)}),n}function Ket(t,e){return function(r,n){var i=Bs(r)?Uet:Xet,s=e?e():{};return i(r,t,F0(n),s)}}var JP=function(){return Ih.Date.now()},Zet="Expected a function",Qet=Math.max,Jet=Math.min;function gN(t,e,r){var n,i,s,a,o,l,u=0,h=!1,d=!1,f=!0;if(typeof t!="function")throw new TypeError(Zet);e=vb(e)||0,$s(r)&&(h=!!r.leading,d="maxWait"in r,s=d?Qet(vb(r.maxWait)||0,e):s,f="trailing"in r?!!r.trailing:f);function p(S){var k=n,E=i;return n=i=void 0,u=S,a=t.apply(E,k),a}function g(S){return u=S,o=setTimeout(v,e),h?p(S):a}function m(S){var k=S-l,E=S-u,A=e-k;return d?Jet(A,s-E):A}function y(S){var k=S-l,E=S-u;return l===void 0||k>=e||k<0||d&&E>=s}function v(){var S=JP();if(y(S))return x(S);o=setTimeout(v,m(S))}function x(S){return o=void 0,f&&n?p(S):(n=i=void 0,a)}function b(){o!==void 0&&clearTimeout(o),u=0,n=l=i=o=void 0}function T(){return o===void 0?a:x(JP())}function C(){var S=JP(),k=y(S);if(n=arguments,i=this,l=S,k){if(o===void 0)return g(l);if(d)return clearTimeout(o),o=setTimeout(v,e),p(l)}return o===void 0&&(o=setTimeout(v,e)),a}return C.cancel=b,C.flush=T,C}var d2e=Object.prototype,ett=d2e.hasOwnProperty,f2e=Z5(function(t,e){t=Object(t);var r=-1,n=e.length,i=n>2?e[2]:void 0;for(i&&LS(e[0],e[1],i)&&(n=1);++r<n;)for(var s=e[r],a=qy(s),o=-1,l=a.length;++o<l;){var u=a[o],h=t[u];(h===void 0||K5(h,d2e[u])&&!ett.call(t,u))&&(t[u]=s[u])}return t});function qV(t,e,r){(r!==void 0&&!K5(t[e],r)||r===void 0&&!(e in t))&&R6(t,e,r)}function c9(t){return Eh(t)&&Wg(t)}function UV(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function ttt(t){return _6(t,qy(t))}function rtt(t,e,r,n,i,s,a){var o=UV(t,r),l=UV(e,r),u=a.get(l);if(u){qV(t,r,u);return}var h=s?s(o,l,r+"",t,e,a):void 0,d=h===void 0;if(d){var f=Bs(l),p=!f&&DT(l),g=!f&&!p&&lN(l);h=l,f||p||g?Bs(o)?h=o:c9(o)?h=fve(o):p?(d=!1,h=Zve(l,!0)):g?(d=!1,h=r2e(l,!0)):h=[]:Nh(l)||NT(l)?(h=o,NT(o)?h=ttt(o):(!$s(o)||_S(o))&&(h=n2e(l))):d=!1}d&&(a.set(l,h),i(h,l,n,s,a),a.delete(l)),qV(t,r,h)}function mN(t,e,r,n,i){t!==e&&mX(e,function(s,a){if(i||(i=new hh),$s(s))rtt(t,e,a,r,mN,n,i);else{var o=n?n(UV(t,a),s,a+"",t,e,i):void 0;o===void 0&&(o=s),qV(t,a,o)}},qy)}function p2e(t,e,r,n,i,s){return $s(t)&&$s(e)&&(s.set(e,t),mN(t,e,void 0,p2e,s),s.delete(e)),t}var ntt=bve(function(t,e,r,n){mN(t,e,r,n)}),g2e=Z5(function(t){return t.push(void 0,p2e),dve(ntt,void 0,t)}),itt=200;function stt(t,e,r,n){var i=-1,s=yve,a=!0,o=t.length,l=[],u=e.length;if(!o)return l;e.length>=itt&&(s=pX,a=!1,e=new PT(e));e:for(;++i<o;){var h=t[i],d=h;if(h=h!==0?h:0,a&&d===d){for(var f=u;f--;)if(e[f]===d)continue e;l.push(h)}else s(e,d,n)||l.push(h)}return l}var att=Z5(function(t,e){return c9(t)?stt(t,fN(e,1,c9,!0)):[]});function u9(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}function vX(t){return typeof t=="function"?t:Gg}function Et(t,e){var r=Bs(t)?gve:N6;return r(t,vX(e))}function ott(t,e){var r=[];return N6(t,function(n,i,s){e(n,i,s)&&r.push(n)}),r}function $f(t,e){var r=Bs(t)?Qve:ott;return r(t,F0(e))}function ltt(t){return function(e,r,n){var i=Object(e);if(!Wg(e)){var s=F0(r);e=Lc(e),r=function(o){return s(i[o],o,i)}}var a=t(e,r,n);return a>-1?i[s?e[a]:a]:void 0}}var ctt=Math.max;function utt(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:lXe(r);return i<0&&(i=ctt(n+i,0)),mve(t,F0(e),i)}var bX=ltt(utt);function m2e(t,e){var r=-1,n=Wg(t)?Array(t.length):[];return N6(t,function(i,s,a){n[++r]=e(i,s,a)}),n}function la(t,e){var r=Bs(t)?yb:m2e;return r(t,F0(e))}function htt(t,e){return t==null?t:mX(t,vX(e),qy)}function dtt(t,e){return t&&yX(t,vX(e))}var ftt=Object.prototype,ptt=ftt.hasOwnProperty,ese=Ket(function(t,e,r){ptt.call(t,r)?t[r].push(e):R6(t,r,[e])});function gtt(t,e){return t>e}var mtt=Object.prototype,ytt=mtt.hasOwnProperty;function vtt(t,e){return t!=null&&ytt.call(t,e)}function X2(t,e){return t!=null&&u2e(t,e,vtt)}function btt(t,e){return yb(e,function(r){return t[r]})}function Zf(t){return t==null?[]:btt(t,Lc(t))}var xtt="[object Map]",wtt="[object Set]",Ttt=Object.prototype,Ctt=Ttt.hasOwnProperty;function DS(t){if(t==null)return!0;if(Wg(t)&&(Bs(t)||typeof t=="string"||typeof t.splice=="function"||DT(t)||lN(t)||NT(t)))return!t.length;var e=du(t);if(e==xtt||e==wtt)return!t.size;if(aN(t))return!Sve(t).length;for(var r in t)if(Ctt.call(t,r))return!1;return!0}function Qf(t,e){return pN(t,e)}var ktt="[object Number]";function Bf(t){return typeof t=="number"||Eh(t)&&Hg(t)==ktt}function Us(t){return t===void 0}var Stt=Dve("toLowerCase");function y2e(t,e){return t<e}function yN(t,e){var r={};return e=F0(e),yX(t,function(n,i,s){R6(r,i,e(n,i,s))}),r}function xX(t,e,r){for(var n=-1,i=t.length;++n<i;){var s=t[n],a=e(s);if(a!=null&&(o===void 0?a===a&&!_d(a):r(a,o)))var o=a,l=s}return l}function hg(t){return t&&t.length?xX(t,Gg,gtt):void 0}var Pi=bve(function(t,e,r){mN(t,e,r)});function OS(t){return t&&t.length?xX(t,Gg,y2e):void 0}function wX(t,e){return t&&t.length?xX(t,F0(e),y2e):void 0}function Ett(t,e,r,n){if(!$s(t))return t;e=hN(e,t);for(var i=-1,s=e.length,a=s-1,o=t;o!=null&&++i<s;){var l=L6(e[i]),u=r;if(l==="__proto__"||l==="constructor"||l==="prototype")return t;if(i!=a){var h=o[l];u=void 0,u===void 0&&(u=$s(h)?h:iN(e[i+1])?[]:{})}sN(o,l,u),o=o[l]}return t}function Att(t,e,r){for(var n=-1,i=e.length,s={};++n<i;){var a=e[n],o=dN(t,a);r(o,a)&&Ett(s,hN(a,t),o)}return s}function Mtt(t,e){var r=t.length;for(t.sort(e);r--;)t[r]=t[r].value;return t}function Rtt(t,e){if(t!==e){var r=t!==void 0,n=t===null,i=t===t,s=_d(t),a=e!==void 0,o=e===null,l=e===e,u=_d(e);if(!o&&!u&&!s&&t>e||s&&a&&l&&!o&&!u||n&&a&&l||!r&&l||!i)return 1;if(!n&&!s&&!u&&t<e||u&&r&&i&&!n&&!s||o&&r&&i||!a&&i||!l)return-1}return 0}function _tt(t,e,r){for(var n=-1,i=t.criteria,s=e.criteria,a=i.length,o=r.length;++n<a;){var l=Rtt(i[n],s[n]);if(l){if(n>=o)return l;var u=r[n];return l*(u=="desc"?-1:1)}}return t.index-e.index}function Ltt(t,e,r){e.length?e=yb(e,function(s){return Bs(s)?function(a){return dN(a,s.length===1?s[0]:s)}:s}):e=[Gg];var n=-1;e=yb(e,oN(F0));var i=m2e(t,function(s,a,o){var l=yb(e,function(u){return u(s)});return{criteria:l,index:++n,value:s}});return Mtt(i,function(s,a){return _tt(s,a,r)})}function Itt(t,e){return Att(t,e,function(r,n){return h2e(t,n)})}var $T=cZe(function(t,e){return t==null?{}:Itt(t,e)}),Ntt=Math.ceil,Dtt=Math.max;function Ott(t,e,r,n){for(var i=-1,s=Dtt(Ntt((e-t)/(r||1)),0),a=Array(s);s--;)a[++i]=t,t+=r;return a}function Ptt(t){return function(e,r,n){return n&&typeof n!="number"&&LS(e,r,n)&&(r=n=void 0),e=bM(e),r===void 0?(r=e,e=0):r=bM(r),n=n===void 0?e<r?1:-1:bM(n),Ott(e,r,n)}}var BT=Ptt();function $tt(t,e,r,n,i){return i(t,function(s,a,o){r=n?(n=!1,s):e(r,s,a,o)}),r}function D6(t,e,r){var n=Bs(t)?Ove:$tt,i=arguments.length<3;return n(t,F0(e),r,i,N6)}var qg=Z5(function(t,e){if(t==null)return[];var r=e.length;return r>1&&LS(t,e[0],e[1])?e=[]:r>2&&LS(e[0],e[1],e[2])&&(e=[e[0]]),Ltt(t,fN(e),[])}),Btt=4294967295,Ftt=Btt-1,ztt=Math.floor,Vtt=Math.min;function Htt(t,e,r,n){var i=0,s=t==null?0:t.length;if(s===0)return 0;e=r(e);for(var a=e!==e,o=e===null,l=_d(e),u=e===void 0;i<s;){var h=ztt((i+s)/2),d=r(t[h]),f=d!==void 0,p=d===null,g=d===d,m=_d(d);if(a)var y=g;else u?y=g&&f:o?y=g&&f&&!p:l?y=g&&f&&!p&&!m:p||m?y=!1:y=d<e;y?i=h+1:s=h}return Vtt(s,Ftt)}var Gtt=4294967295,Wtt=Gtt>>>1;function qtt(t,e,r){var n=0,i=t==null?n:t.length;if(typeof e=="number"&&e===e&&i<=Wtt){for(;n<i;){var s=n+i>>>1,a=t[s];a!==null&&!_d(a)&&a<e?n=s+1:i=s}return i}return Htt(t,e,Gg)}function Utt(t,e){return qtt(t,e)}var jtt=Xve(function(t,e,r){return t+(r?" ":"")+a9(e)}),Ytt="Expected a function";function Xtt(t,e,r){var n=!0,i=!0;if(typeof t!="function")throw new TypeError(Ytt);return $s(r)&&(n="leading"in r?!0:n,i="trailing"in r?!!r.trailing:i),gN(t,e,{leading:n,maxWait:e,trailing:i})}var Ktt=1/0,Ztt=bb&&1/gX(new bb([,-0]))[1]==Ktt?function(t){return new bb(t)}:EXe,Qtt=200;function v2e(t,e,r){var n=-1,i=yve,s=t.length,a=!0,o=[],l=o;if(s>=Qtt){var u=Ztt(t);if(u)return gX(u);a=!1,i=pX,l=new PT}else l=o;e:for(;++n<s;){var h=t[n],d=h;if(h=h!==0?h:0,a&&d===d){for(var f=l.length;f--;)if(l[f]===d)continue e;o.push(h)}else i(l,d,r)||(l!==o&&l.push(d),o.push(h))}return o}var jV=Z5(function(t){return v2e(fN(t,1,c9,!0))});function b2e(t){return t&&t.length?v2e(t):[]}var Jtt=0;function vN(t){var e=++Jtt;return Q5(t)+e}function ert(t,e,r){for(var n=-1,i=t.length,s=e.length,a={};++n<i;){var o=n<s?e[n]:void 0;r(a,t[n],o)}return a}function trt(t,e){return ert(t||[],e||[],sN)}function c0(t){return typeof t=="string"&&t.slice(-1)==="%"}function Pc(t,e){if(t==null)return 0;let r;if(typeof t=="string"){if(r=parseFloat(t),c0(t)&&(r/=100,Number.isFinite(r)))return r*e}else r=t;return Number.isFinite(r)?r>0&&r<1?r*e:r:0}function dh(t){if(typeof t=="object"){let r=0,n=0,i=0,s=0;return t.vertical!=null&&Number.isFinite(t.vertical)&&(n=s=t.vertical),t.horizontal!=null&&Number.isFinite(t.horizontal)&&(i=r=t.horizontal),t.left!=null&&Number.isFinite(t.left)&&(r=t.left),t.top!=null&&Number.isFinite(t.top)&&(n=t.top),t.right!=null&&Number.isFinite(t.right)&&(i=t.right),t.bottom!=null&&Number.isFinite(t.bottom)&&(s=t.bottom),{top:n,right:i,bottom:s,left:r}}let e=0;return t!=null&&Number.isFinite(t)&&(e=t),{top:e,right:e,bottom:e,left:e}}let x2e=!1,w2e=!1,T2e=!1,rrt=!1,C2e=!1;if(typeof navigator=="object"){const t=navigator.userAgent;t.indexOf("Macintosh")>=0,t.match(/(iPad|iPhone|iPod)/g),t.indexOf("Windows")>=0,x2e=t.indexOf("MSIE")>=0,t.match(/Trident\/7\./),w2e=!!t.match(/Edge\//),t.indexOf("Mozilla/")>=0&&t.indexOf("MSIE")<0&&t.indexOf("Edge/")<0,t.indexOf("Chrome/")>=0&&t.indexOf("Edge/")<0,t.indexOf("Opera/")>=0||t.indexOf("OPR/")>=0,t.indexOf("Firefox/")>=0,T2e=t.indexOf("AppleWebKit/")>=0&&t.indexOf("Chrome/")<0&&t.indexOf("Edge/")<0,typeof document=="object"&&(C2e=!document.createElementNS||`${document.createElementNS("http://www.w3.org/2000/svg","foreignObject")}`!="[object SVGForeignObjectElement]"||t.indexOf("Opera/")>=0)}typeof window=="object"&&window.chrome!=null&&window.chrome.app!=null&&window.chrome.app.runtime!=null;if(typeof document=="object")try{const t=Object.defineProperty({},"passive",{get(){rrt=!0}}),e=document.createElement("div");e.addEventListener&&e.addEventListener("click",()=>{},t)}catch{}const tse=x2e,rse=w2e,nrt=T2e,irt=C2e,srt=!irt;function art(){const t=window.module;return t!=null&&t.hot!=null&&t.hot.status!=null?t.hot.status():"unkonwn"}function k2e(){return art()==="apply"}const ort={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};function lrt(t){const e=document.createElement(ort[t]||"div"),r=`on${t}`;let n=r in e;return n||(e.setAttribute(r,"return;"),n=typeof e[r]=="function"),n}const Pk=[];function Ug(t,e){const r=Pk.find(n=>n.name===t);if(!(r&&(r.loadTimes+=1,r.loadTimes>1))&&!k2e()){const n=document.createElement("style");n.setAttribute("type","text/css"),n.textContent=e;const i=document.querySelector("head");i&&i.insertBefore(n,i.firstChild),Pk.push({name:t,loadTimes:1,styleElement:n})}}function jg(t){const e=Pk.findIndex(r=>r.name===t);if(e>-1){const r=Pk[e];if(r.loadTimes-=1,r.loadTimes>0)return;let n=r.styleElement;n&&n.parentNode&&n.parentNode.removeChild(n),n=null,Pk.splice(e,1)}}function crt(t){const e=t.match(/<svg[^>]*viewBox\s*=\s*(["']?)(.+?)\1[^>]*>/i);return e&&e[2]?e[2].replace(/\s+/," ").split(" "):null}function nse(t){const e=parseFloat(t);return Number.isNaN(e)?null:e}function urt(t){const e="data:";return t.substr(0,e.length)===e}function hrt(t,e){if(!t||urt(t)){setTimeout(()=>e(null,t));return}const r=()=>{e(new Error(`Failed to load image: ${t}`))},n=window.FileReader?s=>{if(s.status===200){const a=new FileReader;a.onload=o=>{const l=o.target.result;e(null,l)},a.onerror=r,a.readAsDataURL(s.response)}else r()}:s=>{const a=o=>{const u=[];for(let h=0;h<o.length;h+=32768)u.push(String.fromCharCode.apply(null,o.subarray(h,h+32768)));return u.join("")};if(s.status===200){let o=t.split(".").pop()||"png";o==="svg"&&(o="svg+xml");const l=`data:image/${o};base64,`,u=new Uint8Array(s.response),h=l+btoa(a(u));e(null,h)}else r()},i=new XMLHttpRequest;i.responseType=window.FileReader?"blob":"arraybuffer",i.open("GET",t,!0),i.addEventListener("error",r),i.addEventListener("load",()=>n(i)),i.send()}function drt(t){let e=t.replace(/\s/g,"");e=decodeURIComponent(e);const r=e.indexOf(","),n=e.slice(0,r),i=n.split(":")[1].split(";")[0],s=e.slice(r+1);let a;n.indexOf("base64")>=0?a=atob(s):a=unescape(encodeURIComponent(s));const o=new Uint8Array(a.length);for(let l=0;l<a.length;l+=1)o[l]=a.charCodeAt(l);return new Blob([o],{type:i})}function frt(t,e){const r=window.navigator.msSaveBlob;if(r)r(t,e);else{const n=window.URL.createObjectURL(t),i=document.createElement("a");i.href=n,i.download=e,document.body.appendChild(i),i.click(),document.body.removeChild(i),window.URL.revokeObjectURL(n)}}function e$(t,e){const r=drt(t);frt(r,e)}function prt(t,e={}){let r=null;const n=h=>(r==null&&(r=crt(t)),r!=null?nse(r[h]):null),i=h=>{const d=t.match(h);return d&&d[2]?nse(d[2]):null};let s=e.width;if(s==null&&(s=i(/<svg[^>]*width\s*=\s*(["']?)(.+?)\1[^>]*>/i)),s==null&&(s=n(2)),s==null)throw new Error("Can not parse width from svg string");let a=e.height;if(a==null&&(a=i(/<svg[^>]*height\s*=\s*(["']?)(.+?)\1[^>]*>/i)),a==null&&(a=n(3)),a==null)throw new Error("Can not parse height from svg string");return`data:image/svg+xml,${encodeURIComponent(t).replace(/'/g,"%27").replace(/"/g,"%22")}`}function grt(t){return typeof t=="object"&&t.then&&typeof t.then=="function"}function YV(t){return t!=null&&(t instanceof Promise||grt(t))}function TX(...t){const e=[];if(t.forEach(n=>{Array.isArray(n)?e.push(...n):e.push(n)}),e.some(n=>YV(n))){const n=e.map(i=>YV(i)?i:Promise.resolve(i!==!1));return Promise.all(n).then(i=>i.reduce((s,a)=>a!==!1&&s,!0))}return e.every(n=>n!==!1)}function mrt(...t){const e=TX(t);return typeof e=="boolean"?Promise.resolve(e):e}function S2e(t,e,r){if(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]);case 4:return t.call(e,r[0],r[1],r[2],r[3]);case 5:return t.call(e,r[0],r[1],r[2],r[3],r[4]);case 6:return t.call(e,r[0],r[1],r[2],r[3],r[4],r[5]);default:return t.apply(e,r)}return t.call(e)}function vr(t,e,...r){return S2e(t,e,r)}function ise(t){return 180*t/Math.PI%360}const Fo=function(t,e=!1){return(e?t:t%360)*Math.PI/180};function ml(t){return t%360+(t<0?360:0)}function L1(t,e=0){return Number.isInteger(t)?t:+t.toFixed(e)}function sse(t,e){let r,n;if(e==null?(n=t??1,r=0):(n=e,r=t??0),n<r){const i=r;r=n,n=i}return Math.floor(Math.random()*(n-r+1)+r)}function Lv(t,e,r){return Number.isNaN(t)?NaN:Number.isNaN(e)||Number.isNaN(r)?0:t<e?e:t>r?r:t}function fh(t,e){return e*Math.round(t/e)}function E2e(t,e){return e!=null&&t!=null&&e.x>=t.x&&e.x<=t.x+t.width&&e.y>=t.y&&e.y<=t.y+t.height}function ase(t,e){const r=t.x-e.x,n=t.y-e.y;return r*r+n*n}class Yg{valueOf(){return this.toJSON()}toString(){return JSON.stringify(this.toJSON())}}let Qe=class Fr extends Yg{static create(e,r){return e==null||typeof e=="number"?new Fr(e,r):Fr.clone(e)}static clone(e){return Fr.isPoint(e)?new Fr(e.x,e.y):Array.isArray(e)?new Fr(e[0],e[1]):new Fr(e.x,e.y)}static equals(e,r){return e===r?!0:e!=null&&r!=null?e.x===r.x&&e.y===r.y:!1}static rotateEx(e,r,n,i=new Fr){const s=Fr.clone(e),a=Fr.clone(i),o=s.x-a.x,l=s.y-a.y,u=o*r-l*n,h=l*r+o*n;return new Fr(u+a.x,h+a.y)}static toJSON(e){return Fr.isPoint(e)?{x:e.x,y:e.y}:Array.isArray(e)?{x:e[0],y:e[1]}:{x:e.x,y:e.y}}static fromPolar(e,r,n=new Fr){let i=Math.abs(e*Math.cos(r)),s=Math.abs(e*Math.sin(r));const a=Fr.clone(n),o=ml(ise(r));return o<90?s=-s:o<180?(i=-i,s=-s):o<270&&(i=-i),new Fr(a.x+i,a.y+s)}static toPolar(e,r=new Fr){const n=Fr.clone(e),i=Fr.clone(r),s=n.x-i.x,a=n.y-i.y;return new Fr(Math.sqrt(s*s+a*a),Fo(i.theta(n)))}static equalPoints(e,r){if(e==null&&r!=null||e!=null&&r==null||e!=null&&r!=null&&e.length!==r.length)return!1;if(e!=null&&r!=null){for(let n=0,i=e.length;n<i;n+=1)if(!Fr.equals(e[n],r[n]))return!1}return!0}static random(e,r,n,i){return new Fr(sse(e,r),sse(n,i))}static rotate(e,r,n){const i=Fo(ml(-r)),s=Math.sin(i),a=Math.cos(i);return Fr.rotateEx(e,a,s,n)}static isPoint(e){return e!=null&&e instanceof Fr}static isPointLike(e){return e!=null&&typeof e=="object"&&typeof e.x=="number"&&typeof e.y=="number"}static isPointData(e){return e!=null&&Array.isArray(e)&&e.length===2&&typeof e[0]=="number"&&typeof e[1]=="number"}constructor(e,r){super(),this.x=e??0,this.y=r??0}round(e=0){return this.x=L1(this.x,e),this.y=L1(this.y,e),this}add(e,r){const n=Fr.create(e,r);return this.x+=n.x,this.y+=n.y,this}update(e,r){const n=Fr.create(e,r);return this.x=n.x,this.y=n.y,this}translate(e,r){const n=Fr.create(e,r);return this.x+=n.x,this.y+=n.y,this}rotate(e,r){const n=Fr.rotate(this,e,r);return this.x=n.x,this.y=n.y,this}scale(e,r,n=new Fr){const i=Fr.create(n);return this.x=i.x+e*(this.x-i.x),this.y=i.y+r*(this.y-i.y),this}closest(e){if(e.length===1)return Fr.create(e[0]);let r=null,n=1/0;return e.forEach(i=>{const s=this.squaredDistance(i);s<n&&(r=i,n=s)}),r?Fr.create(r):null}distance(e){return Math.sqrt(this.squaredDistance(e))}squaredDistance(e){const r=Fr.create(e),n=this.x-r.x,i=this.y-r.y;return n*n+i*i}manhattanDistance(e){const r=Fr.create(e);return Math.abs(r.x-this.x)+Math.abs(r.y-this.y)}magnitude(){return Math.sqrt(this.x*this.x+this.y*this.y)||.01}theta(e=new Fr){const r=Fr.create(e),n=-(r.y-this.y),i=r.x-this.x;let s=Math.atan2(n,i);return s<0&&(s=2*Math.PI+s),180*s/Math.PI}angleBetween(e,r){if(this.equals(e)||this.equals(r))return NaN;let n=this.theta(r)-this.theta(e);return n<0&&(n+=360),n}vectorAngle(e){return new Fr(0,0).angleBetween(this,e)}toPolar(e){return this.update(Fr.toPolar(this,e)),this}changeInAngle(e,r,n=new Fr){return this.clone().translate(-e,-r).theta(n)-this.theta(n)}adhereToRect(e){return E2e(e,this)||(this.x=Math.min(Math.max(this.x,e.x),e.x+e.width),this.y=Math.min(Math.max(this.y,e.y),e.y+e.height)),this}bearing(e){const r=Fr.create(e),n=Fo(this.y),i=Fo(r.y),s=this.x,a=r.x,o=Fo(a-s),l=Math.sin(o)*Math.cos(i),u=Math.cos(n)*Math.sin(i)-Math.sin(n)*Math.cos(i)*Math.cos(o),h=ise(Math.atan2(l,u)),d=["NE","E","SE","S","SW","W","NW","N"];let f=h-22.5;return f<0&&(f+=360),f=parseInt(f/45,10),d[f]}cross(e,r){if(e!=null&&r!=null){const n=Fr.create(e),i=Fr.create(r);return(i.x-this.x)*(n.y-this.y)-(i.y-this.y)*(n.x-this.x)}return NaN}dot(e){const r=Fr.create(e);return this.x*r.x+this.y*r.y}diff(e,r){if(typeof e=="number")return new Fr(this.x-e,this.y-r);const n=Fr.create(e);return new Fr(this.x-n.x,this.y-n.y)}lerp(e,r){const n=Fr.create(e);return new Fr((1-r)*this.x+r*n.x,(1-r)*this.y+r*n.y)}normalize(e=1){const r=e/this.magnitude();return this.scale(r,r)}move(e,r){const n=Fr.create(e),i=Fo(n.theta(this));return this.translate(Math.cos(i)*r,-Math.sin(i)*r)}reflection(e){return Fr.create(e).move(this,this.distance(e))}snapToGrid(e,r){return this.x=fh(this.x,e),this.y=fh(this.y,r??e),this}equals(e){const r=Fr.create(e);return r!=null&&r.x===this.x&&r.y===this.y}clone(){return Fr.clone(this)}toJSON(){return Fr.toJSON(this)}serialize(){return`${this.x} ${this.y}`}};class Bt extends Yg{static isRectangle(e){return e!=null&&e instanceof Bt}static isRectangleLike(e){return e!=null&&typeof e=="object"&&typeof e.x=="number"&&typeof e.y=="number"&&typeof e.width=="number"&&typeof e.height=="number"}static create(e,r,n,i){return e==null||typeof e=="number"?new Bt(e,r,n,i):Bt.clone(e)}static clone(e){return Bt.isRectangle(e)?e.clone():Array.isArray(e)?new Bt(e[0],e[1],e[2],e[3]):new Bt(e.x,e.y,e.width,e.height)}static fromEllipse(e){return new Bt(e.x-e.a,e.y-e.b,2*e.a,2*e.b)}static fromSize(e){return new Bt(0,0,e.width,e.height)}static fromPositionAndSize(e,r){return new Bt(e.x,e.y,r.width,r.height)}get left(){return this.x}get top(){return this.y}get right(){return this.x+this.width}get bottom(){return this.y+this.height}get origin(){return new Qe(this.x,this.y)}get topLeft(){return new Qe(this.x,this.y)}get topCenter(){return new Qe(this.x+this.width/2,this.y)}get topRight(){return new Qe(this.x+this.width,this.y)}get center(){return new Qe(this.x+this.width/2,this.y+this.height/2)}get bottomLeft(){return new Qe(this.x,this.y+this.height)}get bottomCenter(){return new Qe(this.x+this.width/2,this.y+this.height)}get bottomRight(){return new Qe(this.x+this.width,this.y+this.height)}get corner(){return new Qe(this.x+this.width,this.y+this.height)}get rightMiddle(){return new Qe(this.x+this.width,this.y+this.height/2)}get leftMiddle(){return new Qe(this.x,this.y+this.height/2)}get topLine(){return new lr(this.topLeft,this.topRight)}get rightLine(){return new lr(this.topRight,this.bottomRight)}get bottomLine(){return new lr(this.bottomLeft,this.bottomRight)}get leftLine(){return new lr(this.topLeft,this.bottomLeft)}constructor(e,r,n,i){super(),this.x=e??0,this.y=r??0,this.width=n??0,this.height=i??0}getOrigin(){return this.origin}getTopLeft(){return this.topLeft}getTopCenter(){return this.topCenter}getTopRight(){return this.topRight}getCenter(){return this.center}getCenterX(){return this.x+this.width/2}getCenterY(){return this.y+this.height/2}getBottomLeft(){return this.bottomLeft}getBottomCenter(){return this.bottomCenter}getBottomRight(){return this.bottomRight}getCorner(){return this.corner}getRightMiddle(){return this.rightMiddle}getLeftMiddle(){return this.leftMiddle}getTopLine(){return this.topLine}getRightLine(){return this.rightLine}getBottomLine(){return this.bottomLine}getLeftLine(){return this.leftLine}bbox(e){if(!e)return this.clone();const r=Fo(e),n=Math.abs(Math.sin(r)),i=Math.abs(Math.cos(r)),s=this.width*i+this.height*n,a=this.width*n+this.height*i;return new Bt(this.x+(this.width-s)/2,this.y+(this.height-a)/2,s,a)}round(e=0){return this.x=L1(this.x,e),this.y=L1(this.y,e),this.width=L1(this.width,e),this.height=L1(this.height,e),this}add(e,r,n,i){const s=Bt.create(e,r,n,i),a=Math.min(this.x,s.x),o=Math.min(this.y,s.y),l=Math.max(this.x+this.width,s.x+s.width),u=Math.max(this.y+this.height,s.y+s.height);return this.x=a,this.y=o,this.width=l-a,this.height=u-o,this}update(e,r,n,i){const s=Bt.create(e,r,n,i);return this.x=s.x,this.y=s.y,this.width=s.width,this.height=s.height,this}inflate(e,r){const n=e,i=r??e;return this.x-=n,this.y-=i,this.width+=2*n,this.height+=2*i,this}snapToGrid(e,r){const n=this.origin.snapToGrid(e,r),i=this.corner.snapToGrid(e,r);return this.x=n.x,this.y=n.y,this.width=i.x-n.x,this.height=i.y-n.y,this}translate(e,r){const n=Qe.create(e,r);return this.x+=n.x,this.y+=n.y,this}scale(e,r,n=new Qe){const i=this.origin.scale(e,r,n);return this.x=i.x,this.y=i.y,this.width*=e,this.height*=r,this}rotate(e,r=this.getCenter()){if(e!==0){const n=Fo(e),i=Math.cos(n),s=Math.sin(n);let a=this.getOrigin(),o=this.getTopRight(),l=this.getBottomRight(),u=this.getBottomLeft();a=Qe.rotateEx(a,i,s,r),o=Qe.rotateEx(o,i,s,r),l=Qe.rotateEx(l,i,s,r),u=Qe.rotateEx(u,i,s,r);const h=new Bt(a.x,a.y,0,0);h.add(o.x,o.y,0,0),h.add(l.x,l.y,0,0),h.add(u.x,u.y,0,0),this.update(h)}return this}rotate90(){const e=(this.width-this.height)/2;this.x+=e,this.y-=e;const r=this.width;return this.width=this.height,this.height=r,this}moveAndExpand(e){const r=Bt.clone(e);return this.x+=r.x||0,this.y+=r.y||0,this.width+=r.width||0,this.height+=r.height||0,this}getMaxScaleToFit(e,r=this.center){const n=Bt.clone(e),i=r.x,s=r.y;let a=1/0,o=1/0,l=1/0,u=1/0,h=1/0,d=1/0,f=1/0,p=1/0;const g=n.topLeft;g.x<i&&(a=(this.x-i)/(g.x-i)),g.y<s&&(h=(this.y-s)/(g.y-s));const m=n.bottomRight;m.x>i&&(o=(this.x+this.width-i)/(m.x-i)),m.y>s&&(d=(this.y+this.height-s)/(m.y-s));const y=n.topRight;y.x>i&&(l=(this.x+this.width-i)/(y.x-i)),y.y<s&&(f=(this.y-s)/(y.y-s));const v=n.bottomLeft;return v.x<i&&(u=(this.x-i)/(v.x-i)),v.y>s&&(p=(this.y+this.height-s)/(v.y-s)),{sx:Math.min(a,o,l,u),sy:Math.min(h,d,f,p)}}getMaxUniformScaleToFit(e,r=this.center){const n=this.getMaxScaleToFit(e,r);return Math.min(n.sx,n.sy)}containsPoint(e,r){return E2e(this,Qe.create(e,r))}containsRect(e,r,n,i){const s=Bt.create(e,r,n,i),a=this.x,o=this.y,l=this.width,u=this.height,h=s.x,d=s.y,f=s.width,p=s.height;return l===0||u===0||f===0||p===0?!1:h>=a&&d>=o&&h+f<=a+l&&d+p<=o+u}intersectsWithLine(e){const r=[this.topLine,this.rightLine,this.bottomLine,this.leftLine],n=[],i=[];return r.forEach(s=>{const a=e.intersectsWithLine(s);a!==null&&i.indexOf(a.toString())<0&&(n.push(a),i.push(a.toString()))}),n.length>0?n:null}intersectsWithLineFromCenterToPoint(e,r){const n=Qe.clone(e),i=this.center;let s=null;r!=null&&r!==0&&n.rotate(r,i);const a=[this.topLine,this.rightLine,this.bottomLine,this.leftLine],o=new lr(i,n);for(let l=a.length-1;l>=0;l-=1){const u=a[l].intersectsWithLine(o);if(u!==null){s=u;break}}return s&&r!=null&&r!==0&&s.rotate(-r,i),s}intersectsWithRect(e,r,n,i){const s=Bt.create(e,r,n,i);if(!this.isIntersectWithRect(s))return null;const a=this.origin,o=this.corner,l=s.origin,u=s.corner,h=Math.max(a.x,l.x),d=Math.max(a.y,l.y);return new Bt(h,d,Math.min(o.x,u.x)-h,Math.min(o.y,u.y)-d)}isIntersectWithRect(e,r,n,i){const s=Bt.create(e,r,n,i),a=this.origin,o=this.corner,l=s.origin,u=s.corner;return!(u.x<=a.x||u.y<=a.y||l.x>=o.x||l.y>=o.y)}normalize(){let e=this.x,r=this.y,n=this.width,i=this.height;return this.width<0&&(e=this.x+this.width,n=-this.width),this.height<0&&(r=this.y+this.height,i=-this.height),this.x=e,this.y=r,this.width=n,this.height=i,this}union(e){const r=Bt.clone(e),n=this.origin,i=this.corner,s=r.origin,a=r.corner,o=Math.min(n.x,s.x),l=Math.min(n.y,s.y),u=Math.max(i.x,a.x),h=Math.max(i.y,a.y);return new Bt(o,l,u-o,h-l)}getNearestSideToPoint(e){const r=Qe.clone(e),n=r.x-this.x,i=this.x+this.width-r.x,s=r.y-this.y,a=this.y+this.height-r.y;let o=n,l="left";return i<o&&(o=i,l="right"),s<o&&(o=s,l="top"),a<o&&(l="bottom"),l}getNearestPointToPoint(e){const r=Qe.clone(e);if(this.containsPoint(r)){const n=this.getNearestSideToPoint(r);if(n==="left")return new Qe(this.x,r.y);if(n==="top")return new Qe(r.x,this.y);if(n==="right")return new Qe(this.x+this.width,r.y);if(n==="bottom")return new Qe(r.x,this.y+this.height)}return r.adhereToRect(this)}equals(e){return e!=null&&e.x===this.x&&e.y===this.y&&e.width===this.width&&e.height===this.height}clone(){return new Bt(this.x,this.y,this.width,this.height)}toJSON(){return{x:this.x,y:this.y,width:this.width,height:this.height}}serialize(){return`${this.x} ${this.y} ${this.width} ${this.height}`}}class lr extends Yg{static isLine(e){return e!=null&&e instanceof lr}get center(){return new Qe((this.start.x+this.end.x)/2,(this.start.y+this.end.y)/2)}constructor(e,r,n,i){super(),typeof e=="number"&&typeof r=="number"?(this.start=new Qe(e,r),this.end=new Qe(n,i)):(this.start=Qe.create(e),this.end=Qe.create(r))}getCenter(){return this.center}round(e=0){return this.start.round(e),this.end.round(e),this}translate(e,r){return typeof e=="number"?(this.start.translate(e,r),this.end.translate(e,r)):(this.start.translate(e),this.end.translate(e)),this}rotate(e,r){return this.start.rotate(e,r),this.end.rotate(e,r),this}scale(e,r,n){return this.start.scale(e,r,n),this.end.scale(e,r,n),this}length(){return Math.sqrt(this.squaredLength())}squaredLength(){const e=this.start.x-this.end.x,r=this.start.y-this.end.y;return e*e+r*r}setLength(e){const r=this.length();if(!r)return this;const n=e/r;return this.scale(n,n,this.start)}parallel(e){const r=this.clone();if(!r.isDifferentiable())return r;const{start:n,end:i}=r,s=n.clone().rotate(270,i),a=i.clone().rotate(90,n);return n.move(a,e),i.move(s,e),r}vector(){return new Qe(this.end.x-this.start.x,this.end.y-this.start.y)}angle(){const e=new Qe(this.start.x+1,this.start.y);return this.start.angleBetween(this.end,e)}bbox(){const e=Math.min(this.start.x,this.end.x),r=Math.min(this.start.y,this.end.y),n=Math.max(this.start.x,this.end.x),i=Math.max(this.start.y,this.end.y);return new Bt(e,r,n-e,i-r)}bearing(){return this.start.bearing(this.end)}closestPoint(e){return this.pointAt(this.closestPointNormalizedLength(e))}closestPointLength(e){return this.closestPointNormalizedLength(e)*this.length()}closestPointTangent(e){return this.tangentAt(this.closestPointNormalizedLength(e))}closestPointNormalizedLength(e){const r=this.vector().dot(new lr(this.start,e).vector()),n=Math.min(1,Math.max(0,r/this.squaredLength()));return Number.isNaN(n)?0:n}pointAt(e){const r=this.start,n=this.end;return e<=0?r.clone():e>=1?n.clone():r.lerp(n,e)}pointAtLength(e){const r=this.start,n=this.end;let i=!0;e<0&&(i=!1,e=-e);const s=this.length();if(e>=s)return i?n.clone():r.clone();const a=(i?e:s-e)/s;return this.pointAt(a)}divideAt(e){const r=this.pointAt(e);return[new lr(this.start,r),new lr(r,this.end)]}divideAtLength(e){const r=this.pointAtLength(e);return[new lr(this.start,r),new lr(r,this.end)]}containsPoint(e){const r=this.start,n=this.end;if(r.cross(e,n)!==0)return!1;const i=this.length();return!(new lr(r,e).length()>i||new lr(e,n).length()>i)}intersect(e,r){const n=e.intersectsWithLine(this,r);return n?Array.isArray(n)?n:[n]:null}intersectsWithLine(e){const r=new Qe(this.end.x-this.start.x,this.end.y-this.start.y),n=new Qe(e.end.x-e.start.x,e.end.y-e.start.y),i=r.x*n.y-r.y*n.x,s=new Qe(e.start.x-this.start.x,e.start.y-this.start.y),a=s.x*n.y-s.y*n.x,o=s.x*r.y-s.y*r.x;if(i===0||a*i<0||o*i<0)return null;if(i>0){if(a>i||o>i)return null}else if(a<i||o<i)return null;return new Qe(this.start.x+a*r.x/i,this.start.y+a*r.y/i)}isDifferentiable(){return!this.start.equals(this.end)}pointOffset(e){const r=Qe.clone(e),n=this.start,i=this.end;return((i.x-n.x)*(r.y-n.y)-(i.y-n.y)*(r.x-n.x))/this.length()}pointSquaredDistance(e,r){const n=Qe.create(e,r);return this.closestPoint(n).squaredDistance(n)}pointDistance(e,r){const n=Qe.create(e,r);return this.closestPoint(n).distance(n)}tangentAt(e){if(!this.isDifferentiable())return null;const r=this.start,n=this.end,i=this.pointAt(e),s=new lr(r,n);return s.translate(i.x-r.x,i.y-r.y),s}tangentAtLength(e){if(!this.isDifferentiable())return null;const r=this.start,n=this.end,i=this.pointAtLength(e),s=new lr(r,n);return s.translate(i.x-r.x,i.y-r.y),s}relativeCcw(e,r){const n=Qe.create(e,r);let i=n.x-this.start.x,s=n.y-this.start.y;const a=this.end.x-this.start.x,o=this.end.y-this.start.y;let l=i*o-s*a;return l===0&&(l=i*a+s*o,l>0&&(i-=a,s-=o,l=i*a+s*o,l<0&&(l=0))),l<0?-1:l>0?1:0}equals(e){return e!=null&&this.start.x===e.start.x&&this.start.y===e.start.y&&this.end.x===e.end.x&&this.end.y===e.end.y}clone(){return new lr(this.start,this.end)}toJSON(){return{start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){return[this.start.serialize(),this.end.serialize()].join(" ")}}class rc extends Yg{static isEllipse(e){return e!=null&&e instanceof rc}static create(e,r,n,i){return e==null||typeof e=="number"?new rc(e,r,n,i):rc.parse(e)}static parse(e){return rc.isEllipse(e)?e.clone():Array.isArray(e)?new rc(e[0],e[1],e[2],e[3]):new rc(e.x,e.y,e.a,e.b)}static fromRect(e){const r=e.center;return new rc(r.x,r.y,e.width/2,e.height/2)}get center(){return new Qe(this.x,this.y)}constructor(e,r,n,i){super(),this.x=e??0,this.y=r??0,this.a=n??0,this.b=i??0}bbox(){return Bt.fromEllipse(this)}getCenter(){return this.center}inflate(e,r){const n=e,i=r??e;return this.a+=2*n,this.b+=2*i,this}normalizedDistance(e,r){const n=Qe.create(e,r),i=n.x-this.x,s=n.y-this.y,a=this.a,o=this.b;return i*i/(a*a)+s*s/(o*o)}containsPoint(e,r){return this.normalizedDistance(e,r)<=1}intersectsWithLine(e){const r=[],n=this.a,i=this.b,s=e.start,a=e.end,o=e.vector(),l=s.diff(new Qe(this.x,this.y)),u=new Qe(o.x/(n*n),o.y/(i*i)),h=new Qe(l.x/(n*n),l.y/(i*i)),d=o.dot(u),f=o.dot(h),p=l.dot(h)-1,g=f*f-d*p;if(g<0)return null;if(g>0){const m=Math.sqrt(g),y=(-f-m)/d,v=(-f+m)/d;if((y<0||y>1)&&(v<0||v>1))return null;y>=0&&y<=1&&r.push(s.lerp(a,y)),v>=0&&v<=1&&r.push(s.lerp(a,v))}else{const m=-f/d;if(m>=0&&m<=1)r.push(s.lerp(a,m));else return null}return r}intersectsWithLineFromCenterToPoint(e,r=0){const n=Qe.clone(e);r&&n.rotate(r,this.getCenter());const i=n.x-this.x,s=n.y-this.y;let a;if(i===0)return a=this.bbox().getNearestPointToPoint(n),r?a.rotate(-r,this.getCenter()):a;const o=s/i,l=o*o,u=this.a*this.a,h=this.b*this.b;let d=Math.sqrt(1/(1/u+l/h));d=i<0?-d:d;const f=o*d;return a=new Qe(this.x+d,this.y+f),r?a.rotate(-r,this.getCenter()):a}tangentTheta(e){const r=Qe.clone(e),n=r.x,i=r.y,s=this.a,a=this.b,o=this.bbox().center,l=o.x,u=o.y,h=30,d=n>o.x+s/2,f=n<o.x-s/2;let p,g;return d||f?(g=n>o.x?i-h:i+h,p=s*s/(n-l)-s*s*(i-u)*(g-u)/(a*a*(n-l))+l):(p=i>o.y?n+h:n-h,g=a*a/(i-u)-a*a*(n-l)*(p-l)/(s*s*(i-u))+u),new Qe(p,g).theta(r)}scale(e,r){return this.a*=e,this.b*=r,this}rotate(e,r){const n=Bt.fromEllipse(this);n.rotate(e,r);const i=rc.fromRect(n);return this.a=i.a,this.b=i.b,this.x=i.x,this.y=i.y,this}translate(e,r){const n=Qe.create(e,r);return this.x+=n.x,this.y+=n.y,this}equals(e){return e!=null&&e.x===this.x&&e.y===this.y&&e.a===this.a&&e.b===this.b}clone(){return new rc(this.x,this.y,this.a,this.b)}toJSON(){return{x:this.x,y:this.y,a:this.a,b:this.b}}serialize(){return`${this.x} ${this.y} ${this.a} ${this.b}`}}const yrt=new RegExp("^[\\s\\dLMCZz,.]*$");function vrt(t){return typeof t!="string"?!1:yrt.test(t)}function t$(t,e){return(t%e+e)%e}function brt(t,e,r,n,i){if(!t||t.length===0)return"";const s=[],a=t[t.length-1],o=e!=null&&e>0,l=e||0;if(n&&o){t=t.slice();const d=t[0],f=new Qe(a.x+(d.x-a.x)/2,a.y+(d.y-a.y)/2);t.splice(0,0,f)}let u=t[0],h=1;for(r?s.push("M",u.x,u.y):s.push("L",u.x,u.y);h<(n?t.length:t.length-1);){let d=t[t$(h,t.length)],f=u.x-d.x,p=u.y-d.y;if(o&&(f!==0||p!==0)&&(i==null||i.indexOf(h-1)<0)){let g=Math.sqrt(f*f+p*p);const m=f*Math.min(l,g/2)/g,y=p*Math.min(l,g/2)/g,v=d.x+m,x=d.y+y;s.push("L",v,x);let b=t[t$(h+1,t.length)];for(;h<t.length-2&&Math.round(b.x-d.x)===0&&Math.round(b.y-d.y)===0;)b=t[t$(h+2,t.length)],h+=1;f=b.x-d.x,p=b.y-d.y,g=Math.max(1,Math.sqrt(f*f+p*p));const T=f*Math.min(l,g/2)/g,C=p*Math.min(l,g/2)/g,S=d.x+T,k=d.y+C;s.push("Q",d.x,d.y,S,k),d=new Qe(S,k)}else s.push("L",d.x,d.y);u=d,h+=1}return n?s.push("Z"):s.push("L",a.x,a.y),s.map(d=>typeof d=="string"?d:+d.toFixed(3)).join(" ")}function xrt(t,e={}){const r=[];return t&&t.length&&t.forEach(n=>{Array.isArray(n)?r.push({x:n[0],y:n[1]}):r.push({x:n.x,y:n.y})}),brt(r,e.round,e.initialMove==null||e.initialMove,e.close,e.exclude)}function ose(t,e,r,n,i=0,s=0,a=0,o,l){if(r===0||n===0)return[];o-=t,l-=e,r=Math.abs(r),n=Math.abs(n);const u=-o/2,h=-l/2,d=Math.cos(i*Math.PI/180),f=Math.sin(i*Math.PI/180),p=d*u+f*h,g=-1*f*u+d*h,m=p*p,y=g*g,v=r*r,x=n*n,b=m/v+y/x;let T;if(b>1)r=Math.sqrt(b)*r,n=Math.sqrt(b)*n,T=0;else{let q=1;s===a&&(q=-1),T=q*Math.sqrt((v*x-v*y-x*m)/(v*y+x*m))}const C=T*r*g/n,S=-1*T*n*p/r,k=d*C-f*S+o/2,E=f*C+d*S+l/2;let A=Math.atan2((g-S)/n,(p-C)/r)-Math.atan2(0,1),R=A>=0?A:2*Math.PI+A;A=Math.atan2((-g-S)/n,(-p-C)/r)-Math.atan2((g-S)/n,(p-C)/r);let _=A>=0?A:2*Math.PI+A;a===0&&_>0?_-=2*Math.PI:a!==0&&_<0&&(_+=2*Math.PI);const P=_*2/Math.PI,N=Math.ceil(P<0?-1*P:P),L=_/N,I=8/3*Math.sin(L/4)*Math.sin(L/4)/Math.sin(L/2),$=d*r,O=d*n,D=f*r,F=f*n;let z=Math.cos(R),V=Math.sin(R),B=-I*($*V+F*z),H=-I*(D*V-O*z),G=0,W=0;const K=[];for(let q=0;q<N;q+=1){R+=L,z=Math.cos(R),V=Math.sin(R),G=$*z-F*V+k,W=D*z+O*V+E;const oe=-I*($*V+F*z),Q=-I*(D*V-O*z),Z=q*6;K[Z]=Number(B+t),K[Z+1]=Number(H+e),K[Z+2]=Number(G-oe+t),K[Z+3]=Number(W-Q+e),K[Z+4]=Number(G+t),K[Z+5]=Number(W+e),B=G+oe,H=W+Q}return K.map(q=>+q.toFixed(2))}class Ba extends Yg{static isPolyline(e){return e!=null&&e instanceof Ba}static parse(e){const r=e.trim();if(r==="")return new Ba;const n=[],i=r.split(/\s*,\s*|\s+/);for(let s=0,a=i.length;s<a;s+=2)n.push({x:+i[s],y:+i[s+1]});return new Ba(n)}get start(){return this.points[0]||null}get end(){return this.points[this.points.length-1]||null}constructor(e){if(super(),e!=null){if(typeof e=="string")return Ba.parse(e);this.points=e.map(r=>Qe.create(r))}else this.points=[]}scale(e,r,n=new Qe){return this.points.forEach(i=>i.scale(e,r,n)),this}rotate(e,r){return this.points.forEach(n=>n.rotate(e,r)),this}translate(e,r){const n=Qe.create(e,r);return this.points.forEach(i=>i.translate(n.x,n.y)),this}round(e=0){return this.points.forEach(r=>r.round(e)),this}bbox(){if(this.points.length===0)return new Bt;let e=1/0,r=-1/0,n=1/0,i=-1/0;const s=this.points;for(let a=0,o=s.length;a<o;a+=1){const l=s[a],u=l.x,h=l.y;u<e&&(e=u),u>r&&(r=u),h<n&&(n=h),h>i&&(i=h)}return new Bt(e,n,r-e,i-n)}closestPoint(e){const r=this.closestPointLength(e);return this.pointAtLength(r)}closestPointLength(e){const r=this.points,n=r.length;if(n===0||n===1)return 0;let i=0,s=0,a=1/0;for(let o=0,l=n-1;o<l;o+=1){const u=new lr(r[o],r[o+1]),h=u.length(),d=u.closestPointNormalizedLength(e),p=u.pointAt(d).squaredDistance(e);p<a&&(a=p,s=i+d*h),i+=h}return s}closestPointNormalizedLength(e){const r=this.length();return r===0?0:this.closestPointLength(e)/r}closestPointTangent(e){const r=this.closestPointLength(e);return this.tangentAtLength(r)}containsPoint(e){if(this.points.length===0)return!1;const r=Qe.clone(e),n=r.x,i=r.y,s=this.points,a=s.length;let o=a-1,l=0;for(let u=0;u<a;u+=1){const h=s[o],d=s[u];if(r.equals(h))return!0;const f=new lr(h,d);if(f.containsPoint(e))return!0;if(i<=h.y&&i>d.y||i>h.y&&i<=d.y){const p=h.x-n>d.x-n?h.x-n:d.x-n;if(p>=0){const g=new Qe(n+p,i),m=new lr(e,g);f.intersectsWithLine(m)&&(l+=1)}}o=u}return l%2===1}intersectsWithLine(e){const r=[];for(let n=0,i=this.points.length-1;n<i;n+=1){const s=this.points[n],a=this.points[n+1],o=e.intersectsWithLine(new lr(s,a));o&&r.push(o)}return r.length>0?r:null}isDifferentiable(){for(let e=0,r=this.points.length-1;e<r;e+=1){const n=this.points[e],i=this.points[e+1];if(new lr(n,i).isDifferentiable())return!0}return!1}length(){let e=0;for(let r=0,n=this.points.length-1;r<n;r+=1){const i=this.points[r],s=this.points[r+1];e+=i.distance(s)}return e}pointAt(e){const r=this.points,n=r.length;if(n===0)return null;if(n===1||e<=0)return r[0].clone();if(e>=1)return r[n-1].clone();const s=this.length()*e;return this.pointAtLength(s)}pointAtLength(e){const r=this.points,n=r.length;if(n===0)return null;if(n===1)return r[0].clone();let i=!0;e<0&&(i=!1,e=-e);let s=0;for(let o=0,l=n-1;o<l;o+=1){const u=i?o:l-1-o,h=r[u],d=r[u+1],f=new lr(h,d),p=h.distance(d);if(e<=s+p)return f.pointAtLength((i?1:-1)*(e-s));s+=p}return(i?r[n-1]:r[0]).clone()}tangentAt(e){const n=this.points.length;if(n===0||n===1)return null;e<0&&(e=0),e>1&&(e=1);const s=this.length()*e;return this.tangentAtLength(s)}tangentAtLength(e){const r=this.points,n=r.length;if(n===0||n===1)return null;let i=!0;e<0&&(i=!1,e=-e);let s,a=0;for(let o=0,l=n-1;o<l;o+=1){const u=i?o:l-1-o,h=r[u],d=r[u+1],f=new lr(h,d),p=h.distance(d);if(f.isDifferentiable()){if(e<=a+p)return f.tangentAtLength((i?1:-1)*(e-a));s=f}a+=p}if(s){const o=i?1:0;return s.tangentAt(o)}return null}simplify(e={}){const r=this.points;if(r.length<3)return this;const n=e.threshold||0;let i=0;for(;r[i+2];){const s=i,a=i+1,o=i+2,l=r[s],u=r[a],h=r[o];new lr(l,h).closestPoint(u).distance(u)<=n?r.splice(a,1):i+=1}return this}toHull(){const e=this.points,r=e.length;if(r===0)return new Ba;let n=e[0];for(let f=1;f<r;f+=1)(e[f].y<n.y||e[f].y===n.y&&e[f].x>n.x)&&(n=e[f]);const i=[];for(let f=0;f<r;f+=1){let p=n.theta(e[f]);p===0&&(p=360),i.push([e[f],f,p])}if(i.sort((f,p)=>{let g=f[2]-p[2];return g===0&&(g=p[1]-f[1]),g}),i.length>2){const f=i[i.length-1];i.unshift(f)}const s={},a=[],o=f=>`${f[0].toString()}@${f[1]}`;for(;i.length!==0;){const f=i.pop(),p=f[0];if(s[o(f)])continue;let g=!1;for(;!g;)if(a.length<2)a.push(f),g=!0;else{const m=a.pop(),y=m[0],v=a.pop(),x=v[0],b=x.cross(y,p);if(b<0)a.push(v),a.push(m),a.push(f),g=!0;else if(b===0){const C=y.angleBetween(x,p);Math.abs(C-180)<1e-10||y.equals(p)||x.equals(y)?(s[o(m)]=y,a.push(v)):Math.abs((C+1)%360-1)<1e-10&&(a.push(v),i.push(m))}else s[o(m)]=y,a.push(v)}}a.length>2&&a.pop();let l,u=-1;for(let f=0,p=a.length;f<p;f+=1){const g=a[f][1];(l===void 0||g<l)&&(l=g,u=f)}let h=[];if(u>0){const f=a.slice(u),p=a.slice(0,u);h=f.concat(p)}else h=a;const d=[];for(let f=0,p=h.length;f<p;f+=1)d.push(h[f][0]);return new Ba(d)}equals(e){return e==null||e.points.length!==this.points.length?!1:e.points.every((r,n)=>r.equals(this.points[n]))}clone(){return new Ba(this.points.map(e=>e.clone()))}toJSON(){return this.points.map(e=>e.toJSON())}serialize(){return this.points.map(e=>`${e.serialize()}`).join(" ")}}let Jf=class Wu extends Yg{static isCurve(e){return e!=null&&e instanceof Wu}static throughPoints(e){if(e==null||Array.isArray(e)&&e.length<2)throw new Error("At least 2 points are required");const r=wrt(e),n=[];for(let i=0,s=r[0].length;i<s;i+=1){const a=new Qe(r[0][i].x,r[0][i].y),o=new Qe(r[1][i].x,r[1][i].y);n.push(new Wu(e[i],a,o,e[i+1]))}return n}constructor(e,r,n,i){super(),this.PRECISION=3,this.start=Qe.create(e),this.controlPoint1=Qe.create(r),this.controlPoint2=Qe.create(n),this.end=Qe.create(i)}bbox(){const e=this.start,r=this.controlPoint1,n=this.controlPoint2,i=this.end,s=e.x,a=e.y,o=r.x,l=r.y,u=n.x,h=n.y,d=i.x,f=i.y,p=[],g=[[],[]];let m,y,v,x,b,T,C,S;for(let $=0;$<2;$+=1){if($===0?(y=6*s-12*o+6*u,m=-3*s+9*o-9*u+3*d,v=3*o-3*s):(y=6*a-12*l+6*h,m=-3*a+9*l-9*h+3*f,v=3*l-3*a),Math.abs(m)<1e-12){if(Math.abs(y)<1e-12)continue;x=-v/y,x>0&&x<1&&p.push(x);continue}C=y*y-4*v*m,S=Math.sqrt(C),!(C<0)&&(b=(-y+S)/(2*m),b>0&&b<1&&p.push(b),T=(-y-S)/(2*m),T>0&&T<1&&p.push(T))}let k,E,A,R=p.length;const _=R;for(;R;)R-=1,x=p[R],A=1-x,k=A*A*A*s+3*A*A*x*o+3*A*x*x*u+x*x*x*d,g[0][R]=k,E=A*A*A*a+3*A*A*x*l+3*A*x*x*h+x*x*x*f,g[1][R]=E;p[_]=0,p[_+1]=1,g[0][_]=s,g[1][_]=a,g[0][_+1]=d,g[1][_+1]=f,p.length=_+2,g[0].length=_+2,g[1].length=_+2;const P=Math.min.apply(null,g[0]),N=Math.min.apply(null,g[1]),L=Math.max.apply(null,g[0]),I=Math.max.apply(null,g[1]);return new Bt(P,N,L-P,I-N)}closestPoint(e,r={}){return this.pointAtT(this.closestPointT(e,r))}closestPointLength(e,r={}){const n=this.getOptions(r);return this.lengthAtT(this.closestPointT(e,n),n)}closestPointNormalizedLength(e,r={}){const n=this.getOptions(r),i=this.closestPointLength(e,n);if(!i)return 0;const s=this.length(n);return s===0?0:i/s}closestPointT(e,r={}){const n=this.getPrecision(r),i=this.getDivisions(r),s=Math.pow(10,-n);let a=null,o=0,l=0,u=0,h=0,d=0,f=null;const p=i.length;let g=p>0?1/p:0;for(i.forEach((m,y)=>{const v=m.start.distance(e),x=m.end.distance(e),b=v+x;(f==null||b<f)&&(a=m,o=y*g,l=(y+1)*g,u=v,h=x,f=b,d=m.endpointDistance())});;){const m=u?Math.abs(u-h)/u:0,y=h!=null?Math.abs(u-h)/h:0,v=m<s||y<s,x=u?u<d*s:!0,b=h?h<d*s:!0;if(v||(x||b))return u<=h?o:l;const C=a.divide(.5);g/=2;const S=C[0].start.distance(e),k=C[0].end.distance(e),E=S+k,A=C[1].start.distance(e),R=C[1].end.distance(e),_=A+R;E<=_?(a=C[0],l-=g,u=S,h=k):(a=C[1],o+=g,u=A,h=R)}}closestPointTangent(e,r={}){return this.tangentAtT(this.closestPointT(e,r))}containsPoint(e,r={}){return this.toPolyline(r).containsPoint(e)}divideAt(e,r={}){if(e<=0)return this.divideAtT(0);if(e>=1)return this.divideAtT(1);const n=this.tAt(e,r);return this.divideAtT(n)}divideAtLength(e,r={}){const n=this.tAtLength(e,r);return this.divideAtT(n)}divide(e){return this.divideAtT(e)}divideAtT(e){const r=this.start,n=this.controlPoint1,i=this.controlPoint2,s=this.end;if(e<=0)return[new Wu(r,r,r,r),new Wu(r,n,i,s)];if(e>=1)return[new Wu(r,n,i,s),new Wu(s,s,s,s)];const a=this.getSkeletonPoints(e),o=a.startControlPoint1,l=a.startControlPoint2,u=a.divider,h=a.dividerControlPoint1,d=a.dividerControlPoint2;return[new Wu(r,o,l,u),new Wu(u,h,d,s)]}endpointDistance(){return this.start.distance(this.end)}getSkeletonPoints(e){const r=this.start,n=this.controlPoint1,i=this.controlPoint2,s=this.end;if(e<=0)return{startControlPoint1:r.clone(),startControlPoint2:r.clone(),divider:r.clone(),dividerControlPoint1:n.clone(),dividerControlPoint2:i.clone()};if(e>=1)return{startControlPoint1:n.clone(),startControlPoint2:i.clone(),divider:s.clone(),dividerControlPoint1:s.clone(),dividerControlPoint2:s.clone()};const a=new lr(r,n).pointAt(e),o=new lr(n,i).pointAt(e),l=new lr(i,s).pointAt(e),u=new lr(a,o).pointAt(e),h=new lr(o,l).pointAt(e),d=new lr(u,h).pointAt(e);return{startControlPoint1:a,startControlPoint2:u,divider:d,dividerControlPoint1:h,dividerControlPoint2:l}}getSubdivisions(e={}){const r=this.getPrecision(e);let n=[new Wu(this.start,this.controlPoint1,this.controlPoint2,this.end)];if(r===0)return n;let i=this.endpointDistance();const s=Math.pow(10,-r);let a=0;for(;;){a+=1;const o=[];n.forEach(h=>{const d=h.divide(.5);o.push(d[0],d[1])});const l=o.reduce((h,d)=>h+d.endpointDistance(),0),u=l!==0?(l-i)/l:0;if(a>1&&u<s)return o;n=o,i=l}}length(e={}){return this.getDivisions(e).reduce((n,i)=>n+i.endpointDistance(),0)}lengthAtT(e,r={}){if(e<=0)return 0;const n=r.precision===void 0?this.PRECISION:r.precision;return this.divide(e)[0].length({precision:n})}pointAt(e,r={}){if(e<=0)return this.start.clone();if(e>=1)return this.end.clone();const n=this.tAt(e,r);return this.pointAtT(n)}pointAtLength(e,r={}){const n=this.tAtLength(e,r);return this.pointAtT(n)}pointAtT(e){return e<=0?this.start.clone():e>=1?this.end.clone():this.getSkeletonPoints(e).divider}isDifferentiable(){const e=this.start,r=this.controlPoint1,n=this.controlPoint2,i=this.end;return!(e.equals(r)&&r.equals(n)&&n.equals(i))}tangentAt(e,r={}){if(!this.isDifferentiable())return null;e<0?e=0:e>1&&(e=1);const n=this.tAt(e,r);return this.tangentAtT(n)}tangentAtLength(e,r={}){if(!this.isDifferentiable())return null;const n=this.tAtLength(e,r);return this.tangentAtT(n)}tangentAtT(e){if(!this.isDifferentiable())return null;e<0&&(e=0),e>1&&(e=1);const r=this.getSkeletonPoints(e),n=r.startControlPoint2,i=r.dividerControlPoint1,s=r.divider,a=new lr(n,i);return a.translate(s.x-n.x,s.y-n.y),a}getPrecision(e={}){return e.precision==null?this.PRECISION:e.precision}getDivisions(e={}){if(e.subdivisions!=null)return e.subdivisions;const r=this.getPrecision(e);return this.getSubdivisions({precision:r})}getOptions(e={}){const r=this.getPrecision(e),n=this.getDivisions(e);return{precision:r,subdivisions:n}}tAt(e,r={}){if(e<=0)return 0;if(e>=1)return 1;const n=this.getOptions(r),s=this.length(n)*e;return this.tAtLength(s,n)}tAtLength(e,r={}){let n=!0;e<0&&(n=!1,e=-e);const i=this.getPrecision(r),s=this.getDivisions(r),a={precision:i,subdivisions:s};let o=null,l,u,h=0,d=0,f=0;const p=s.length;let g=p>0?1/p:0;for(let v=0;v<p;v+=1){const x=n?v:p-1-v,b=s[v],T=b.endpointDistance();if(e<=f+T){o=b,l=x*g,u=(x+1)*g,h=n?e-f:T+f-e,d=n?T+f-e:e-f;break}f+=T}if(o==null)return n?1:0;const m=this.length(a),y=Math.pow(10,-i);for(;;){let v;if(v=m!==0?h/m:0,v<y)return l;if(v=m!==0?d/m:0,v<y)return u;let x,b;const T=o.divide(.5);g/=2;const C=T[0].endpointDistance(),S=T[1].endpointDistance();h<=C?(o=T[0],u-=g,x=h,b=C-x):(o=T[1],l+=g,x=h-C,b=S-x),h=x,d=b}}toPoints(e={}){const r=this.getDivisions(e),n=[r[0].start.clone()];return r.forEach(i=>n.push(i.end.clone())),n}toPolyline(e={}){return new Ba(this.toPoints(e))}scale(e,r,n){return this.start.scale(e,r,n),this.controlPoint1.scale(e,r,n),this.controlPoint2.scale(e,r,n),this.end.scale(e,r,n),this}rotate(e,r){return this.start.rotate(e,r),this.controlPoint1.rotate(e,r),this.controlPoint2.rotate(e,r),this.end.rotate(e,r),this}translate(e,r){return typeof e=="number"?(this.start.translate(e,r),this.controlPoint1.translate(e,r),this.controlPoint2.translate(e,r),this.end.translate(e,r)):(this.start.translate(e),this.controlPoint1.translate(e),this.controlPoint2.translate(e),this.end.translate(e)),this}equals(e){return e!=null&&this.start.equals(e.start)&&this.controlPoint1.equals(e.controlPoint1)&&this.controlPoint2.equals(e.controlPoint2)&&this.end.equals(e.end)}clone(){return new Wu(this.start,this.controlPoint1,this.controlPoint2,this.end)}toJSON(){return{start:this.start.toJSON(),controlPoint1:this.controlPoint1.toJSON(),controlPoint2:this.controlPoint2.toJSON(),end:this.end.toJSON()}}serialize(){return[this.start.serialize(),this.controlPoint1.serialize(),this.controlPoint2.serialize(),this.end.serialize()].join(" ")}};function lse(t){const e=t.length,r=[],n=[];let i=2;r[0]=t[0]/i;for(let s=1;s<e;s+=1)n[s]=1/i,i=(s<e-1?4:3.5)-n[s],r[s]=(t[s]-r[s-1])/i;for(let s=1;s<e;s+=1)r[e-s-1]-=n[e-s]*r[e-s];return r}function wrt(t){const e=t.map(l=>Qe.clone(l)),r=[],n=[],i=e.length-1;if(i===1)return r[0]=new Qe((2*e[0].x+e[1].x)/3,(2*e[0].y+e[1].y)/3),n[0]=new Qe(2*r[0].x-e[0].x,2*r[0].y-e[0].y),[r,n];const s=[];for(let l=1;l<i-1;l+=1)s[l]=4*e[l].x+2*e[l+1].x;s[0]=e[0].x+2*e[1].x,s[i-1]=(8*e[i-1].x+e[i].x)/2;const a=lse(s);for(let l=1;l<i-1;l+=1)s[l]=4*e[l].y+2*e[l+1].y;s[0]=e[0].y+2*e[1].y,s[i-1]=(8*e[i-1].y+e[i].y)/2;const o=lse(s);for(let l=0;l<i;l+=1)r.push(new Qe(a[l],o[l])),l<i-1?n.push(new Qe(2*e[l+1].x-a[l+1],2*e[l+1].y-o[l+1])):n.push(new Qe((e[i].x+a[i-1])/2,(e[i].y+o[i-1])/2));return[r,n]}class bN extends Yg{constructor(){super(...arguments),this.isVisible=!0,this.isSegment=!0,this.isSubpathStart=!1}get end(){return this.endPoint}get start(){if(this.previousSegment==null)throw new Error("Missing previous segment. (This segment cannot be the first segment of a path, or segment has not yet been added to a path.)");return this.previousSegment.end}closestPointT(e,r){if(this.closestPointNormalizedLength)return this.closestPointNormalizedLength(e);throw new Error("Neither `closestPointT` nor `closestPointNormalizedLength` method is implemented.")}lengthAtT(e,r){if(e<=0)return 0;const n=this.length();return e>=1?n:n*e}divideAtT(e){if(this.divideAt)return this.divideAt(e);throw new Error("Neither `divideAtT` nor `divideAt` method is implemented.")}pointAtT(e){if(this.pointAt)return this.pointAt(e);throw new Error("Neither `pointAtT` nor `pointAt` method is implemented.")}tangentAtT(e){if(this.tangentAt)return this.tangentAt(e);throw new Error("Neither `tangentAtT` nor `tangentAt` method is implemented.")}}class xa extends bN{static create(...e){const r=e.length,n=e[0];if(lr.isLine(n))return new xa(n);if(Qe.isPointLike(n))return r===1?new xa(n):e.map(s=>new xa(s));if(r===2)return new xa(+e[0],+e[1]);const i=[];for(let s=0;s<r;s+=2){const a=+e[s],o=+e[s+1];i.push(new xa(a,o))}return i}constructor(e,r){super(),lr.isLine(e)?this.endPoint=e.end.clone().round(2):this.endPoint=Qe.create(e,r).round(2)}get type(){return"L"}get line(){return new lr(this.start,this.end)}bbox(){return this.line.bbox()}closestPoint(e){return this.line.closestPoint(e)}closestPointLength(e){return this.line.closestPointLength(e)}closestPointNormalizedLength(e){return this.line.closestPointNormalizedLength(e)}closestPointTangent(e){return this.line.closestPointTangent(e)}length(){return this.line.length()}divideAt(e){const r=this.line.divideAt(e);return[new xa(r[0]),new xa(r[1])]}divideAtLength(e){const r=this.line.divideAtLength(e);return[new xa(r[0]),new xa(r[1])]}getSubdivisions(){return[]}pointAt(e){return this.line.pointAt(e)}pointAtLength(e){return this.line.pointAtLength(e)}tangentAt(e){return this.line.tangentAt(e)}tangentAtLength(e){return this.line.tangentAtLength(e)}isDifferentiable(){return this.previousSegment==null?!1:!this.start.equals(this.end)}clone(){return new xa(this.end)}scale(e,r,n){return this.end.scale(e,r,n),this}rotate(e,r){return this.end.rotate(e,r),this}translate(e,r){return typeof e=="number"?this.end.translate(e,r):this.end.translate(e),this}equals(e){return this.type===e.type&&this.start.equals(e.start)&&this.end.equals(e.end)}toJSON(){return{type:this.type,start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){const e=this.end;return`${this.type} ${e.x} ${e.y}`}}class PS extends bN{static create(){return new PS}get end(){if(!this.subpathStartSegment)throw new Error("Missing subpath start segment. (This segment needs a subpath start segment (e.g. MoveTo), or segment has not yet been added to a path.)");return this.subpathStartSegment.end}get type(){return"Z"}get line(){return new lr(this.start,this.end)}bbox(){return this.line.bbox()}closestPoint(e){return this.line.closestPoint(e)}closestPointLength(e){return this.line.closestPointLength(e)}closestPointNormalizedLength(e){return this.line.closestPointNormalizedLength(e)}closestPointTangent(e){return this.line.closestPointTangent(e)}length(){return this.line.length()}divideAt(e){const r=this.line.divideAt(e);return[r[1].isDifferentiable()?new xa(r[0]):this.clone(),new xa(r[1])]}divideAtLength(e){const r=this.line.divideAtLength(e);return[r[1].isDifferentiable()?new xa(r[0]):this.clone(),new xa(r[1])]}getSubdivisions(){return[]}pointAt(e){return this.line.pointAt(e)}pointAtLength(e){return this.line.pointAtLength(e)}tangentAt(e){return this.line.tangentAt(e)}tangentAtLength(e){return this.line.tangentAtLength(e)}isDifferentiable(){return!this.previousSegment||!this.subpathStartSegment?!1:!this.start.equals(this.end)}scale(){return this}rotate(){return this}translate(){return this}equals(e){return this.type===e.type&&this.start.equals(e.start)&&this.end.equals(e.end)}clone(){return new PS}toJSON(){return{type:this.type,start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){return this.type}}class nd extends bN{static create(...e){const r=e.length,n=e[0];if(lr.isLine(n))return new nd(n);if(Jf.isCurve(n))return new nd(n);if(Qe.isPointLike(n)){if(r===1)return new nd(n);const s=[];for(let a=0;a<r;a+=1)a===0?s.push(new nd(e[a])):s.push(new xa(e[a]));return s}if(r===2)return new nd(+e[0],+e[1]);const i=[];for(let s=0;s<r;s+=2){const a=+e[s],o=+e[s+1];s===0?i.push(new nd(a,o)):i.push(new xa(a,o))}return i}constructor(e,r){super(),this.isVisible=!1,this.isSubpathStart=!0,lr.isLine(e)||Jf.isCurve(e)?this.endPoint=e.end.clone().round(2):this.endPoint=Qe.create(e,r).round(2)}get start(){throw new Error("Illegal access. Moveto segments should not need a start property.")}get type(){return"M"}bbox(){return null}closestPoint(){return this.end.clone()}closestPointLength(){return 0}closestPointNormalizedLength(){return 0}closestPointT(){return 1}closestPointTangent(){return null}length(){return 0}lengthAtT(){return 0}divideAt(){return[this.clone(),this.clone()]}divideAtLength(){return[this.clone(),this.clone()]}getSubdivisions(){return[]}pointAt(){return this.end.clone()}pointAtLength(){return this.end.clone()}pointAtT(){return this.end.clone()}tangentAt(){return null}tangentAtLength(){return null}tangentAtT(){return null}isDifferentiable(){return!1}scale(e,r,n){return this.end.scale(e,r,n),this}rotate(e,r){return this.end.rotate(e,r),this}translate(e,r){return typeof e=="number"?this.end.translate(e,r):this.end.translate(e),this}clone(){return new nd(this.end)}equals(e){return this.type===e.type&&this.end.equals(e.end)}toJSON(){return{type:this.type,end:this.end.toJSON()}}serialize(){const e=this.end;return`${this.type} ${e.x} ${e.y}`}}class ol extends bN{static create(...e){const r=e.length,n=e[0];if(Jf.isCurve(n))return new ol(n);if(Qe.isPointLike(n)){if(r===3)return new ol(e[0],e[1],e[2]);const s=[];for(let a=0;a<r;a+=3)s.push(new ol(e[a],e[a+1],e[a+2]));return s}if(r===6)return new ol(e[0],e[1],e[2],e[3],e[4],e[5]);const i=[];for(let s=0;s<r;s+=6)i.push(new ol(e[s],e[s+1],e[s+2],e[s+3],e[s+4],e[s+5]));return i}constructor(e,r,n,i,s,a){super(),Jf.isCurve(e)?(this.controlPoint1=e.controlPoint1.clone().round(2),this.controlPoint2=e.controlPoint2.clone().round(2),this.endPoint=e.end.clone().round(2)):typeof e=="number"?(this.controlPoint1=new Qe(e,r).round(2),this.controlPoint2=new Qe(n,i).round(2),this.endPoint=new Qe(s,a).round(2)):(this.controlPoint1=Qe.create(e).round(2),this.controlPoint2=Qe.create(r).round(2),this.endPoint=Qe.create(n).round(2))}get type(){return"C"}get curve(){return new Jf(this.start,this.controlPoint1,this.controlPoint2,this.end)}bbox(){return this.curve.bbox()}closestPoint(e){return this.curve.closestPoint(e)}closestPointLength(e){return this.curve.closestPointLength(e)}closestPointNormalizedLength(e){return this.curve.closestPointNormalizedLength(e)}closestPointTangent(e){return this.curve.closestPointTangent(e)}length(){return this.curve.length()}divideAt(e,r={}){const n=this.curve.divideAt(e,r);return[new ol(n[0]),new ol(n[1])]}divideAtLength(e,r={}){const n=this.curve.divideAtLength(e,r);return[new ol(n[0]),new ol(n[1])]}divideAtT(e){const r=this.curve.divideAtT(e);return[new ol(r[0]),new ol(r[1])]}getSubdivisions(){return[]}pointAt(e){return this.curve.pointAt(e)}pointAtLength(e){return this.curve.pointAtLength(e)}tangentAt(e){return this.curve.tangentAt(e)}tangentAtLength(e){return this.curve.tangentAtLength(e)}isDifferentiable(){if(!this.previousSegment)return!1;const e=this.start,r=this.controlPoint1,n=this.controlPoint2,i=this.end;return!(e.equals(r)&&r.equals(n)&&n.equals(i))}scale(e,r,n){return this.controlPoint1.scale(e,r,n),this.controlPoint2.scale(e,r,n),this.end.scale(e,r,n),this}rotate(e,r){return this.controlPoint1.rotate(e,r),this.controlPoint2.rotate(e,r),this.end.rotate(e,r),this}translate(e,r){return typeof e=="number"?(this.controlPoint1.translate(e,r),this.controlPoint2.translate(e,r),this.end.translate(e,r)):(this.controlPoint1.translate(e),this.controlPoint2.translate(e),this.end.translate(e)),this}equals(e){return this.start.equals(e.start)&&this.end.equals(e.end)&&this.controlPoint1.equals(e.controlPoint1)&&this.controlPoint2.equals(e.controlPoint2)}clone(){return new ol(this.controlPoint1,this.controlPoint2,this.end)}toJSON(){return{type:this.type,start:this.start.toJSON(),controlPoint1:this.controlPoint1.toJSON(),controlPoint2:this.controlPoint2.toJSON(),end:this.end.toJSON()}}serialize(){const e=this.controlPoint1,r=this.controlPoint2,n=this.end;return[this.type,e.x,e.y,r.x,r.y,n.x,n.y].join(" ")}}function a7(t,e,r){return{x:t*Math.cos(r)-e*Math.sin(r),y:t*Math.sin(r)+e*Math.cos(r)}}function cse(t,e,r,n,i,s){const a=.3333333333333333,o=2/3;return[a*t+o*r,a*e+o*n,a*i+o*r,a*s+o*n,i,s]}function A2e(t,e,r,n,i,s,a,o,l,u){const h=Math.PI*120/180,d=Math.PI/180*(+i||0);let f=[],p,g,m,y,v;if(u)g=u[0],m=u[1],y=u[2],v=u[3];else{p=a7(t,e,-d),t=p.x,e=p.y,p=a7(o,l,-d),o=p.x,l=p.y;const L=(t-o)/2,I=(e-l)/2;let $=L*L/(r*r)+I*I/(n*n);$>1&&($=Math.sqrt($),r=$*r,n=$*n);const O=r*r,D=n*n,F=(s===a?-1:1)*Math.sqrt(Math.abs((O*D-O*I*I-D*L*L)/(O*I*I+D*L*L)));y=F*r*I/n+(t+o)/2,v=F*-n*L/r+(e+l)/2,g=Math.asin((e-v)/n),m=Math.asin((l-v)/n),g=t<y?Math.PI-g:g,m=o<y?Math.PI-m:m,g<0&&(g=Math.PI*2+g),m<0&&(m=Math.PI*2+m),a&&g>m&&(g-=Math.PI*2),!a&&m>g&&(m-=Math.PI*2)}let x=m-g;if(Math.abs(x)>h){const L=m,I=o,$=l;m=g+h*(a&&m>g?1:-1),o=y+r*Math.cos(m),l=v+n*Math.sin(m),f=A2e(o,l,r,n,i,0,a,I,$,[m,L,y,v])}x=m-g;const b=Math.cos(g),T=Math.sin(g),C=Math.cos(m),S=Math.sin(m),k=Math.tan(x/4),E=4/3*(r*k),A=4/3*(n*k),R=[t,e],_=[t+E*T,e-A*b],P=[o+E*S,l-A*C],N=[o,l];if(_[0]=2*R[0]-_[0],_[1]=2*R[1]-_[1],u)return[_,P,N].concat(f);{f=[_,P,N].concat(f).join().split(",");const L=[],I=f.length;for(let $=0;$<I;$+=1)L[$]=$%2?a7(+f[$-1],+f[$],d).y:a7(+f[$],+f[$+1],d).x;return L}}function Trt(t){if(!t)return null;const e=`\v\f\r \u2028\u2029`,r=new RegExp(`([a-z])[${e},]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?[${e}]*,?[${e}]*)+)`,"ig"),n=new RegExp(`(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)[${e}]*,?[${e}]*`,"ig"),i={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},s=[];return t.replace(r,(a,o,l)=>{const u=[];let h=o.toLowerCase();l.replace(n,(f,p)=>(p&&u.push(+p),f)),h==="m"&&u.length>2&&(s.push([o,...u.splice(0,2)]),h="l",o=o==="m"?"l":"L");const d=i[h];for(;u.length>=d&&(s.push([o,...u.splice(0,d)]),!!d););return a}),s}function Crt(t){const e=Trt(t);if(!e||!e.length)return[["M",0,0]];let r=0,n=0,i=0,s=0;const a=[];for(let o=0,l=e.length;o<l;o+=1){const u=[];a.push(u);const h=e[o],d=h[0];if(d!==d.toUpperCase())switch(u[0]=d.toUpperCase(),u[0]){case"A":u[1]=h[1],u[2]=h[2],u[3]=h[3],u[4]=h[4],u[5]=h[5],u[6]=+h[6]+r,u[7]=+h[7]+n;break;case"V":u[1]=+h[1]+n;break;case"H":u[1]=+h[1]+r;break;case"M":i=+h[1]+r,s=+h[2]+n;for(let f=1,p=h.length;f<p;f+=1)u[f]=+h[f]+(f%2?r:n);break;default:for(let f=1,p=h.length;f<p;f+=1)u[f]=+h[f]+(f%2?r:n);break}else for(let f=0,p=h.length;f<p;f+=1)u[f]=h[f];switch(u[0]){case"Z":r=+i,n=+s;break;case"H":r=u[1];break;case"V":n=u[1];break;case"M":i=u[u.length-2],s=u[u.length-1],r=u[u.length-2],n=u[u.length-1];break;default:r=u[u.length-2],n=u[u.length-1];break}}return a}function krt(t){const e=Crt(t),r={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null};function n(l,u,h){let d,f;if(!l)return["C",u.x,u.y,u.x,u.y,u.x,u.y];switch(l[0]in{T:1,Q:1}||(u.qx=null,u.qy=null),l[0]){case"M":u.X=l[1],u.Y=l[2];break;case"A":return parseFloat(l[1])===0||parseFloat(l[2])===0?["L",l[6],l[7]]:["C"].concat(A2e.apply(0,[u.x,u.y].concat(l.slice(1))));case"S":return h==="C"||h==="S"?(d=u.x*2-u.bx,f=u.y*2-u.by):(d=u.x,f=u.y),["C",d,f].concat(l.slice(1));case"T":return h==="Q"||h==="T"?(u.qx=u.x*2-u.qx,u.qy=u.y*2-u.qy):(u.qx=u.x,u.qy=u.y),["C"].concat(cse(u.x,u.y,u.qx,u.qy,l[1],l[2]));case"Q":return u.qx=l[1],u.qy=l[2],["C"].concat(cse(u.x,u.y,l[1],l[2],l[3],l[4]));case"H":return["L"].concat(l[1],u.y);case"V":return["L"].concat(u.x,l[1])}return l}function i(l,u){if(l[u].length>7){l[u].shift();const h=l[u];for(;h.length;)s[u]="A",u+=1,l.splice(u,0,["C"].concat(h.splice(0,6)));l.splice(u,1),o=e.length}}const s=[];let a="",o=e.length;for(let l=0;l<o;l+=1){let u="";e[l]&&(u=e[l][0]),u!=="C"&&(s[l]=u,l>0&&(a=s[l-1])),e[l]=n(e[l],r,a),s[l]!=="A"&&u==="C"&&(s[l]="C"),i(e,l);const h=e[l],d=h.length;r.x=h[d-2],r.y=h[d-1],r.bx=parseFloat(h[d-4])||r.x,r.by=parseFloat(h[d-3])||r.y}return(!e[0][0]||e[0][0]!=="M")&&e.unshift(["M",0,0]),e}function M2e(t){return krt(t).map(e=>e.map(r=>typeof r=="string"?r:L1(r,2))).join(",").split(",").join(" ")}let ci=class Ls extends Yg{static isPath(e){return e!=null&&e instanceof Ls}static parse(e){if(!e)return new Ls;const r=new Ls,n=/(?:[a-zA-Z] *)(?:(?:-?\d+(?:\.\d+)?(?:e[-+]?\d+)? *,? *)|(?:-?\.\d+ *,? *))+|(?:[a-zA-Z] *)(?! |\d|-|\.)/g,i=M2e(e).match(n);if(i!=null)for(let s=0,a=i.length;s<a;s+=1){const o=i[s],l=/(?:[a-zA-Z])|(?:(?:-?\d+(?:\.\d+)?(?:e[-+]?\d+)?))|(?:(?:-?\.\d+))/g,u=o.match(l);if(u!=null){const h=u[0],d=u.slice(1).map(p=>+p),f=Ls.createSegment.call(null,h,...d);r.appendSegment(f)}}return r}static createSegment(e,...r){if(e==="M")return nd.create.call(null,...r);if(e==="L")return xa.create.call(null,...r);if(e==="C")return ol.create.call(null,...r);if(e==="z"||e==="Z")return PS.create();throw new Error(`Invalid path segment type "${e}"`)}constructor(e){if(super(),this.PRECISION=3,this.segments=[],Array.isArray(e))if(lr.isLine(e[0])||Jf.isCurve(e[0])){let r=null;e.forEach((i,s)=>{s===0&&this.appendSegment(Ls.createSegment("M",i.start)),r!=null&&!r.end.equals(i.start)&&this.appendSegment(Ls.createSegment("M",i.start)),lr.isLine(i)?this.appendSegment(Ls.createSegment("L",i.end)):Jf.isCurve(i)&&this.appendSegment(Ls.createSegment("C",i.controlPoint1,i.controlPoint2,i.end)),r=i})}else e.forEach(n=>{n.isSegment&&this.appendSegment(n)});else e!=null&&(lr.isLine(e)?(this.appendSegment(Ls.createSegment("M",e.start)),this.appendSegment(Ls.createSegment("L",e.end))):Jf.isCurve(e)?(this.appendSegment(Ls.createSegment("M",e.start)),this.appendSegment(Ls.createSegment("C",e.controlPoint1,e.controlPoint2,e.end))):Ba.isPolyline(e)?e.points&&e.points.length&&e.points.forEach((r,n)=>{const i=n===0?Ls.createSegment("M",r):Ls.createSegment("L",r);this.appendSegment(i)}):e.isSegment&&this.appendSegment(e))}get start(){const e=this.segments,r=e.length;if(r===0)return null;for(let n=0;n<r;n+=1){const i=e[n];if(i.isVisible)return i.start}return e[r-1].end}get end(){const e=this.segments,r=e.length;if(r===0)return null;for(let n=r-1;n>=0;n-=1){const i=e[n];if(i.isVisible)return i.end}return e[r-1].end}moveTo(...e){return this.appendSegment(nd.create.call(null,...e))}lineTo(...e){return this.appendSegment(xa.create.call(null,...e))}curveTo(...e){return this.appendSegment(ol.create.call(null,...e))}arcTo(e,r,n,i,s,a,o){const l=this.end||new Qe,u=typeof a=="number"?ose(l.x,l.y,e,r,n,i,s,a,o):ose(l.x,l.y,e,r,n,i,s,a.x,a.y);if(u!=null)for(let h=0,d=u.length;h<d;h+=6)this.curveTo(u[h],u[h+1],u[h+2],u[h+3],u[h+4],u[h+5]);return this}quadTo(e,r,n,i){const s=this.end||new Qe,a=["M",s.x,s.y];if(typeof e=="number")a.push("Q",e,r,n,i);else{const l=r;a.push("Q",e.x,e.y,l.x,l.y)}const o=Ls.parse(a.join(" "));return this.appendSegment(o.segments.slice(1)),this}close(){return this.appendSegment(PS.create())}drawPoints(e,r={}){const n=xrt(e,r),i=Ls.parse(n);i&&i.segments&&this.appendSegment(i.segments)}bbox(){const e=this.segments,r=e.length;if(r===0)return null;let n;for(let s=0;s<r;s+=1){const a=e[s];if(a.isVisible){const o=a.bbox();o!=null&&(n=n?n.union(o):o)}}if(n!=null)return n;const i=e[r-1];return new Bt(i.end.x,i.end.y,0,0)}appendSegment(e){const r=this.segments.length;let n=r!==0?this.segments[r-1]:null,i;const s=null;if(Array.isArray(e))for(let a=0,o=e.length;a<o;a+=1){const l=e[a];i=this.prepareSegment(l,n,s),this.segments.push(i),n=i}else e!=null&&e.isSegment&&(i=this.prepareSegment(e,n,s),this.segments.push(i));return this}insertSegment(e,r){const n=this.segments.length;if(e<0&&(e=n+e+1),e>n||e<0)throw new Error("Index out of range.");let i,s=null,a=null;if(n!==0&&(e>=1?(s=this.segments[e-1],a=s.nextSegment):(s=null,a=this.segments[0])),!Array.isArray(r))i=this.prepareSegment(r,s,a),this.segments.splice(e,0,i);else for(let o=0,l=r.length;o<l;o+=1){const u=r[o];i=this.prepareSegment(u,s,a),this.segments.splice(e+o,0,i),s=i}return this}removeSegment(e){const r=this.fixIndex(e),n=this.segments.splice(r,1)[0],i=n.previousSegment,s=n.nextSegment;return i&&(i.nextSegment=s),s&&(s.previousSegment=i),n.isSubpathStart&&s&&this.updateSubpathStartSegment(s),n}replaceSegment(e,r){const n=this.fixIndex(e);let i;const s=this.segments[n];let a=s.previousSegment;const o=s.nextSegment;let l=s.isSubpathStart;if(!Array.isArray(r))i=this.prepareSegment(r,a,o),this.segments.splice(n,1,i),l&&i.isSubpathStart&&(l=!1);else{this.segments.splice(e,1);for(let u=0,h=r.length;u<h;u+=1){const d=r[u];i=this.prepareSegment(d,a,o),this.segments.splice(e+u,0,i),a=i,l&&i.isSubpathStart&&(l=!1)}}l&&o&&this.updateSubpathStartSegment(o)}getSegment(e){const r=this.fixIndex(e);return this.segments[r]}fixIndex(e){const r=this.segments.length;if(r===0)throw new Error("Path has no segments.");let n=e;for(;n<0;)n=r+n;if(n>=r||n<0)throw new Error("Index out of range.");return n}segmentAt(e,r={}){const n=this.segmentIndexAt(e,r);return n?this.getSegment(n):null}segmentAtLength(e,r={}){const n=this.segmentIndexAtLength(e,r);return n?this.getSegment(n):null}segmentIndexAt(e,r={}){if(this.segments.length===0)return null;const n=Lv(e,0,1),i=this.getOptions(r),a=this.length(i)*n;return this.segmentIndexAtLength(a,i)}segmentIndexAtLength(e,r={}){const n=this.segments.length;if(n===0)return null;let i=!0;e<0&&(i=!1,e=-e);const s=this.getPrecision(r),a=this.getSubdivisions(r);let o=0,l=null;for(let u=0;u<n;u+=1){const h=i?u:n-1-u,d=this.segments[h],f=a[h],p=d.length({precision:s,subdivisions:f});if(d.isVisible){if(e<=o+p)return h;l=h}o+=p}return l}getSegmentSubdivisions(e={}){const r=this.getPrecision(e),n=[];for(let i=0,s=this.segments.length;i<s;i+=1){const o=this.segments[i].getSubdivisions({precision:r});n.push(o)}return n}updateSubpathStartSegment(e){let r=e.previousSegment,n=e;for(;n&&!n.isSubpathStart;)r!=null?n.subpathStartSegment=r.subpathStartSegment:n.subpathStartSegment=null,r=n,n=n.nextSegment}prepareSegment(e,r,n){e.previousSegment=r,e.nextSegment=n,r!=null&&(r.nextSegment=e),n!=null&&(n.previousSegment=e);let i=e;return e.isSubpathStart&&(e.subpathStartSegment=e,i=n),i!=null&&this.updateSubpathStartSegment(i),e}closestPoint(e,r={}){const n=this.closestPointT(e,r);return n?this.pointAtT(n):null}closestPointLength(e,r={}){const n=this.getOptions(r),i=this.closestPointT(e,n);return i?this.lengthAtT(i,n):0}closestPointNormalizedLength(e,r={}){const n=this.getOptions(r),i=this.closestPointLength(e,n);if(i===0)return 0;const s=this.length(n);return s===0?0:i/s}closestPointT(e,r={}){if(this.segments.length===0)return null;const n=this.getPrecision(r),i=this.getSubdivisions(r);let s,a=1/0;for(let o=0,l=this.segments.length;o<l;o+=1){const u=this.segments[o],h=i[o];if(u.isVisible){const d=u.closestPointT(e,{precision:n,subdivisions:h}),f=u.pointAtT(d),p=ase(f,e);p<a&&(s={segmentIndex:o,value:d},a=p)}}return s||{segmentIndex:this.segments.length-1,value:1}}closestPointTangent(e,r={}){if(this.segments.length===0)return null;const n=this.getPrecision(r),i=this.getSubdivisions(r);let s,a=1/0;for(let o=0,l=this.segments.length;o<l;o+=1){const u=this.segments[o],h=i[o];if(u.isDifferentiable()){const d=u.closestPointT(e,{precision:n,subdivisions:h}),f=u.pointAtT(d),p=ase(f,e);p<a&&(s=u.tangentAtT(d),a=p)}}return s||null}containsPoint(e,r={}){const n=this.toPolylines(r);if(!n)return!1;let i=0;for(let s=0,a=n.length;s<a;s+=1)n[s].containsPoint(e)&&(i+=1);return i%2===1}pointAt(e,r={}){if(this.segments.length===0)return null;if(e<=0)return this.start.clone();if(e>=1)return this.end.clone();const n=this.getOptions(r),s=this.length(n)*e;return this.pointAtLength(s,n)}pointAtLength(e,r={}){if(this.segments.length===0)return null;if(e===0)return this.start.clone();let n=!0;e<0&&(n=!1,e=-e);const i=this.getPrecision(r),s=this.getSubdivisions(r);let a,o=0;for(let u=0,h=this.segments.length;u<h;u+=1){const d=n?u:h-1-u,f=this.segments[d],p=s[d],g=f.length({precision:i,subdivisions:p});if(f.isVisible){if(e<=o+g)return f.pointAtLength((n?1:-1)*(e-o),{precision:i,subdivisions:p});a=f}o+=g}return a?n?a.end:a.start:this.segments[this.segments.length-1].end.clone()}pointAtT(e){const r=this.segments,n=r.length;if(n===0)return null;const i=e.segmentIndex;if(i<0)return r[0].pointAtT(0);if(i>=n)return r[n-1].pointAtT(1);const s=Lv(e.value,0,1);return r[i].pointAtT(s)}divideAt(e,r={}){if(this.segments.length===0)return null;const n=Lv(e,0,1),i=this.getOptions(r),a=this.length(i)*n;return this.divideAtLength(a,i)}divideAtLength(e,r={}){if(this.segments.length===0)return null;let n=!0;e<0&&(n=!1,e=-e);const i=this.getPrecision(r),s=this.getSubdivisions(r);let a=0,o,l,u,h,d;for(let C=0,S=this.segments.length;C<S;C+=1){const k=n?C:S-1-C,E=this.getSegment(k),A=s[k],R={precision:i,subdivisions:A},_=E.length(R);if(E.isDifferentiable()&&(u=E,h=k,e<=a+_)){l=k,o=E.divideAtLength((n?1:-1)*(e-a),R);break}a+=_}if(!u)return null;o||(l=h,d=n?1:0,o=u.divideAtT(d));const f=this.clone(),p=l;f.replaceSegment(p,o);const g=p;let m=p+1,y=p+2;o[0].isDifferentiable()||(f.removeSegment(g),m-=1,y-=1);const v=f.getSegment(m).start;f.insertSegment(m,Ls.createSegment("M",v)),y+=1,o[1].isDifferentiable()||(f.removeSegment(y-1),y-=1);const x=y-g-1;for(let C=y,S=f.segments.length;C<S;C+=1){const k=this.getSegment(C-x),E=f.getSegment(C);if(E.type==="Z"&&!k.subpathStartSegment.end.equals(E.subpathStartSegment.end)){const A=Ls.createSegment("L",k.end);f.replaceSegment(C,A)}}const b=new Ls(f.segments.slice(0,m)),T=new Ls(f.segments.slice(m));return[b,T]}intersectsWithLine(e,r={}){const n=this.toPolylines(r);if(n==null)return null;let i=null;for(let s=0,a=n.length;s<a;s+=1){const o=n[s],l=e.intersect(o);l&&(i==null&&(i=[]),Array.isArray(l)?i.push(...l):i.push(l))}return i}isDifferentiable(){for(let e=0,r=this.segments.length;e<r;e+=1)if(this.segments[e].isDifferentiable())return!0;return!1}isValid(){const e=this.segments;return e.length===0||e[0].type==="M"}length(e={}){if(this.segments.length===0)return 0;const r=this.getSubdivisions(e);let n=0;for(let i=0,s=this.segments.length;i<s;i+=1){const a=this.segments[i],o=r[i];n+=a.length({subdivisions:o})}return n}lengthAtT(e,r={}){const n=this.segments.length;if(n===0)return 0;let i=e.segmentIndex;if(i<0)return 0;let s=Lv(e.value,0,1);i>=n&&(i=n-1,s=1);const a=this.getPrecision(r),o=this.getSubdivisions(r);let l=0;for(let d=0;d<i;d+=1){const f=this.segments[d],p=o[d];l+=f.length({precision:a,subdivisions:p})}const u=this.segments[i],h=o[i];return l+=u.lengthAtT(s,{precision:a,subdivisions:h}),l}tangentAt(e,r={}){if(this.segments.length===0)return null;const n=Lv(e,0,1),i=this.getOptions(r),a=this.length(i)*n;return this.tangentAtLength(a,i)}tangentAtLength(e,r={}){if(this.segments.length===0)return null;let n=!0;e<0&&(n=!1,e=-e);const i=this.getPrecision(r),s=this.getSubdivisions(r);let a,o=0;for(let l=0,u=this.segments.length;l<u;l+=1){const h=n?l:u-1-l,d=this.segments[h],f=s[h],p=d.length({precision:i,subdivisions:f});if(d.isDifferentiable()){if(e<=o+p)return d.tangentAtLength((n?1:-1)*(e-o),{precision:i,subdivisions:f});a=d}o+=p}if(a){const l=n?1:0;return a.tangentAtT(l)}return null}tangentAtT(e){const r=this.segments.length;if(r===0)return null;const n=e.segmentIndex;if(n<0)return this.segments[0].tangentAtT(0);if(n>=r)return this.segments[r-1].tangentAtT(1);const i=Lv(e.value,0,1);return this.segments[n].tangentAtT(i)}getPrecision(e={}){return e.precision==null?this.PRECISION:e.precision}getSubdivisions(e={}){if(e.segmentSubdivisions==null){const r=this.getPrecision(e);return this.getSegmentSubdivisions({precision:r})}return e.segmentSubdivisions}getOptions(e={}){const r=this.getPrecision(e),n=this.getSubdivisions(e);return{precision:r,segmentSubdivisions:n}}toPoints(e={}){const r=this.segments,n=r.length;if(n===0)return null;const i=this.getSubdivisions(e),s=[];let a=[];for(let o=0;o<n;o+=1){const l=r[o];if(l.isVisible){const u=i[o];u.length>0?u.forEach(h=>a.push(h.start)):a.push(l.start)}else a.length>0&&(a.push(r[o-1].end),s.push(a),a=[])}return a.length>0&&(a.push(this.end),s.push(a)),s}toPolylines(e={}){const r=this.toPoints(e);return r?r.map(n=>new Ba(n)):null}scale(e,r,n){return this.segments.forEach(i=>i.scale(e,r,n)),this}rotate(e,r){return this.segments.forEach(n=>n.rotate(e,r)),this}translate(e,r){return typeof e=="number"?this.segments.forEach(n=>n.translate(e,r)):this.segments.forEach(n=>n.translate(e)),this}clone(){const e=new Ls;return this.segments.forEach(r=>e.appendSegment(r.clone())),e}equals(e){if(e==null)return!1;const r=this.segments,n=e.segments,i=r.length;if(n.length!==i)return!1;for(let s=0;s<i;s+=1){const a=r[s],o=n[s];if(a.type!==o.type||!a.equals(o))return!1}return!0}toJSON(){return this.segments.map(e=>e.toJSON())}serialize(){if(!this.isValid())throw new Error("Invalid path segments.");return this.segments.map(e=>e.serialize()).join(" ")}toString(){return this.serialize()}};function e3(t,e,r){let n,i;typeof e=="object"?(n=e.x,i=e.y):(n=e,i=r);const s=ci.parse(t),a=s.bbox();if(a){let o=-a.height/2-a.y,l=-a.width/2-a.x;typeof n=="number"&&(l-=n),typeof i=="number"&&(o-=i),s.translate(l,o)}return s.serialize()}const CX=/[\t\r\n\f]/g,kX=/\S+/g,FT=t=>` ${t} `;function zT(t){return t&&t.getAttribute&&t.getAttribute("class")||""}function fd(t,e){if(t==null||e==null)return!1;const r=FT(zT(t)),n=FT(e);return t.nodeType===1?r.replace(CX," ").includes(n):!1}function rr(t,e){if(!(t==null||e==null)){if(typeof e=="function")return rr(t,e(zT(t)));if(typeof e=="string"&&t.nodeType===1){const r=e.match(kX)||[],n=FT(zT(t)).replace(CX," ");let i=r.reduce((s,a)=>s.indexOf(FT(a))<0?`${s}${a} `:s,n);i=i.trim(),n!==i&&t.setAttribute("class",i)}}}function Bi(t,e){if(t!=null){if(typeof e=="function")return Bi(t,e(zT(t)));if((!e||typeof e=="string")&&t.nodeType===1){const r=(e||"").match(kX)||[],n=FT(zT(t)).replace(CX," ");let i=r.reduce((s,a)=>{const o=FT(a);return s.indexOf(o)>-1?s.replace(o," "):s},n);i=e?i.trim():"",n!==i&&t.setAttribute("class",i)}}}function Ju(t,e,r){if(!(t==null||e==null)){if(r!=null&&typeof e=="string"){r?rr(t,e):Bi(t,e);return}if(typeof e=="function")return Ju(t,e(zT(t),r),r);typeof e=="string"&&(e.match(kX)||[]).forEach(i=>{fd(t,i)?Bi(t,i):rr(t,i)})}}let use=0;function Srt(){return use+=1,`v${use}`}function SX(t){return(t.id==null||t.id==="")&&(t.id=Srt()),t.id}function dg(t){return t==null?!1:typeof t.getScreenCTM=="function"&&t instanceof SVGElement}const Fa={svg:"http://www.w3.org/2000/svg",xmlns:"http://www.w3.org/2000/xmlns/",xml:"http://www.w3.org/XML/1998/namespace",xlink:"http://www.w3.org/1999/xlink",xhtml:"http://www.w3.org/1999/xhtml"},hse="1.1";function R2e(t,e=document){return e.createElement(t)}function EX(t,e=Fa.xhtml,r=document){return r.createElementNS(e,t)}function Dh(t,e=document){return EX(t,Fa.svg,e)}function xM(t){if(t){const r=`<svg xmlns="${Fa.svg}" xmlns:xlink="${Fa.xlink}" version="${hse}">${t}</svg>`,{documentElement:n}=Ert(r,{async:!1});return n}const e=document.createElementNS(Fa.svg,"svg");return e.setAttributeNS(Fa.xmlns,"xmlns:xlink",Fa.xlink),e.setAttribute("version",hse),e}function Ert(t,e={}){let r;try{const n=new DOMParser;if(e.async!=null){const i=n;i.async=e.async}r=n.parseFromString(t,e.mimeType||"text/xml")}catch{r=void 0}if(!r||r.getElementsByTagName("parsererror").length)throw new Error(`Invalid XML: ${t}`);return r}function Art(t,e=!0){const r=t.nodeName;return e?r.toLowerCase():r.toUpperCase()}function AX(t){let e=0,r=t.previousSibling;for(;r;)r.nodeType===1&&(e+=1),r=r.previousSibling;return e}function Mrt(t,e){return t.querySelectorAll(e)}function Rrt(t,e){return t.querySelector(e)}function _2e(t,e,r){const n=t.ownerSVGElement;let i=t.parentNode;for(;i&&i!==r&&i!==n;){if(fd(i,e))return i;i=i.parentNode}return null}function MX(t,e){const r=e&&e.parentNode;return t===r||!!(r&&r.nodeType===1&&t.compareDocumentPosition(r)&16)}function Cu(t){t&&(Array.isArray(t)?t:[t]).forEach(r=>{r.parentNode&&r.parentNode.removeChild(r)})}function O6(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function To(t,e){(Array.isArray(e)?e:[e]).forEach(n=>{n!=null&&t.appendChild(n)})}function L2e(t,e){const r=t.firstChild;return r?$S(r,e):To(t,e)}function $S(t,e){const r=t.parentNode;r&&(Array.isArray(e)?e:[e]).forEach(i=>{i!=null&&r.insertBefore(i,t)})}function _rt(t,e){const r=t.parentNode;r&&(Array.isArray(e)?e:[e]).forEach(i=>{i!=null&&r.insertBefore(i,t.nextSibling)})}function ku(t,e){e!=null&&e.appendChild(t)}function Lrt(t){return!!t&&t.nodeType===1}function I2e(t){try{return t instanceof HTMLElement}catch{return typeof t=="object"&&t.nodeType===1&&typeof t.style=="object"&&typeof t.ownerDocument=="object"}}function Irt(t,e){const r=[];let n=t.firstChild;for(;n;n=n.nextSibling)n.nodeType===1&&(!e||fd(n,e))&&r.push(n);return r}const N2e=t=>{const e=Object.create(null);return(r=>e[r]||(e[r]=t(r)))},D2e=N2e(t=>t.replace(/\B([A-Z])/g,"-$1").toLowerCase()),RX=N2e(t=>jtt(I6(t)).replace(/ /g,"")),O2e=["viewBox","attributeName","attributeType","repeatCount","textLength","lengthAdjust","gradientUnits","preserveAspectRatio"];function Nrt(t,e){return t.getAttribute(e)}function _X(t,e){const r=$2e(e);r.ns?t.hasAttributeNS(r.ns,r.local)&&t.removeAttributeNS(r.ns,r.local):t.hasAttribute(e)&&t.removeAttribute(e)}function LX(t,e,r){if(r==null)return _X(t,e);const n=$2e(e);n.ns&&typeof r=="string"?t.setAttributeNS(n.ns,e,r):e==="id"?t.id=`${r}`:t.setAttribute(e,`${r}`)}function P2e(t,e){Object.keys(e).forEach(r=>{LX(t,r,e[r])})}function _n(t,e,r){if(e==null){const n=t.attributes,i={};for(let s=0;s<n.length;s+=1)i[n[s].name]=n[s].value;return i}if(typeof e=="string"&&r===void 0)return t.getAttribute(e);typeof e=="object"?P2e(t,e):LX(t,e,r)}function $2e(t){if(t.indexOf(":")!==-1){const e=t.split(":");return{ns:Fa[e[0]],local:e[1]}}return{ns:null,local:t}}function BS(t){const e={};return Object.keys(t).forEach(r=>{const n=O2e.includes(r)?r:D2e(r);e[n]=t[r]}),e}function o7(t){const e={};return t.split(";").forEach(n=>{const i=n.trim();if(i){const s=i.split("=");s.length&&(e[s[0].trim()]=s[1]?s[1].trim():"")}}),e}function XV(t,e){return Object.keys(e).forEach(r=>{if(r==="class")t[r]=t[r]?`${t[r]} ${e[r]}`:e[r];else if(r==="style"){const n=typeof t[r]=="object",i=typeof e[r]=="object";let s,a;n&&i?(s=t[r],a=e[r]):n?(s=t[r],a=o7(e[r])):i?(s=o7(t[r]),a=e[r]):(s=o7(t[r]),a=o7(e[r])),t[r]=XV(s,a)}else t[r]=e[r]}),t}const Drt=/-(.)/g;function Ort(t){return t.replace(Drt,(e,r)=>r.toUpperCase())}const r$={},dse=["webkit","ms","moz","o"],B2e=typeof document<"u"?document.createElement("div").style:{};function Prt(t){for(let e=0;e<dse.length;e+=1){const r=dse[e]+t;if(r in B2e)return r}return null}function $rt(t){const e=Ort(t);if(r$[e]==null){const r=e.charAt(0).toUpperCase()+e.slice(1);r$[e]=e in B2e?e:Prt(r)}return r$[e]}function fse(t,e){const r=t.ownerDocument&&t.ownerDocument.defaultView&&t.ownerDocument.defaultView.opener?t.ownerDocument.defaultView.getComputedStyle(t,null):window.getComputedStyle(t,null);return r&&e?r.getPropertyValue(e)||r[e]:r}const Brt={animationIterationCount:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0};function Frt(t){return/^--/.test(t)}function h9(t,e,r){const n=window.getComputedStyle(t,null);return r?n.getPropertyValue(e)||void 0:n[e]||t.style[e]}function l7(t,e){return parseInt(h9(t,e),10)||0}function zrt(t,e){return!Brt[t]&&typeof e=="number"?`${e}px`:e}function ri(t,e,r){if(typeof e=="string"){const n=Frt(e);if(n||(e=$rt(e)),r===void 0)return h9(t,e,n);n||(r=zrt(e,r));const i=t.style;n?i.setProperty(e,r):i[e]=r;return}for(const n in e)ri(t,n,e[n])}function n$(t){let e=2166136261,r=!1,n=t;for(let i=0,s=n.length;i<s;i+=1){let a=n.charCodeAt(i);a>127&&!r&&(n=unescape(encodeURIComponent(n)),a=n.charCodeAt(i),r=!0),e^=a,e+=(e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24)}return e>>>0}function IX(){let t="";const e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx";for(let r=0,n=e.length;r<n;r+=1){const i=e[r],s=Math.random()*16|0,a=i==="x"?s:i==="y"?s&3|8:i;t+=a.toString(16)}return t}function Vrt(t,e,r){const n=Math.min(2,Math.floor(t.length*.34));let i=Math.floor(t.length*.4)+1,s,a=!1;const o=t.toLowerCase();for(const l of e){const u=r(l);if(u!==void 0&&Math.abs(u.length-o.length)<=n){const h=u.toLowerCase();if(h===o){if(u===t)continue;return l}if(a||u.length<3)continue;const d=Hrt(o,h,i-1);if(d===void 0)continue;d<3?(a=!0,s=l):(i=d,s=l)}}return s}function Hrt(t,e,r){let n=new Array(e.length+1),i=new Array(e.length+1);const s=r+1;for(let o=0;o<=e.length;o+=1)n[o]=o;for(let o=1;o<=t.length;o+=1){const l=t.charCodeAt(o-1),u=o>r?o-r:1,h=e.length>r+o?r+o:e.length;i[0]=o;let d=o;for(let p=1;p<u;p+=1)i[p]=s;for(let p=u;p<=h;p+=1){const g=l===e.charCodeAt(p-1)?n[p-1]:Math.min(n[p]+1,i[p-1]+1,n[p-1]+2);i[p]=g,d=Math.min(d,g)}for(let p=h+1;p<=e.length;p+=1)i[p]=s;if(d>r)return;const f=n;n=i,i=f}const a=n[e.length];return a>r?void 0:a}const d9=new WeakMap;function Grt(t,e){const r=I6(e),n=d9.get(t);if(n)return n[r]}function Wrt(t,e,r){const n=I6(e),i=d9.get(t);i?i[n]=r:d9.set(t,{[n]:r})}function hy(t,e,r){if(!e)return d9.get(t);if(typeof e=="string"){if(r===void 0)return Grt(t,e);Wrt(t,e,r);return}for(const n in e)hy(t,n,e[n])}const qrt={class:"className",contenteditable:"contentEditable",for:"htmlFor",readonly:"readOnly",maxlength:"maxLength",tabindex:"tabIndex",colspan:"colSpan",rowspan:"rowSpan",usemap:"useMap"};function KV(t,e,r){if(e){if(typeof e=="string"){if(e=qrt[e]||e,arguments.length<3)return t[e];t[e]=r;return}for(const n in e)KV(t,n,e[n])}}function Urt(t,...e){e.forEach(r=>{Object.getOwnPropertyNames(r.prototype).forEach(n=>{n!=="constructor"&&Object.defineProperty(t.prototype,n,Object.getOwnPropertyDescriptor(r.prototype,n))})})}const jrt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])};function Yrt(t,e){jrt(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}let Xrt=class{};const Krt=/^\s*class\s+/.test(`${Xrt}`)||/^\s*class\s*\{/.test(`${class{}}`);function NX(t,e){let r;return Krt?r=class extends e{}:(r=function(){return e.apply(this,arguments)},Yrt(r,e)),Object.defineProperty(r,"name",{value:t}),r}function pse(t){return t==="__proto__"}function DX(t,e,r="/"){let n;const i=Array.isArray(e)?e:e.split(r);if(i.length)for(n=t;i.length;){const s=i.shift();if(Object(n)===n&&s&&s in n)n=n[s];else return}return n}function t3(t,e,r,n="/"){const i=Array.isArray(e)?e:e.split(n),s=i.pop();if(s&&!pse(s)){let a=t;i.forEach(o=>{pse(o)||(a[o]==null&&(a[o]={}),a=a[o])}),a[s]=r}return t}function gse(t,e,r="/"){const n=Array.isArray(e)?e.slice():e.split(r),i=n.pop();if(i)if(n.length>0){const s=DX(t,n);s&&delete s[i]}else delete t[i];return t}function Zrt(t,e,r={}){const n=r.offset||0,i=[],s=[];let a,o,l=null;for(let u=0;u<t.length;u+=1){a=s[u]=t[u];for(let h=0,d=e.length;h<d;h+=1){const f=e[h],p=f.start+n,g=f.end+n;u>=p&&u<g&&(typeof a=="string"?a=s[u]={t:t[u],attrs:f.attrs}:a.attrs=XV(XV({},a.attrs),f.attrs),r.includeAnnotationIndices&&(a.annotations==null&&(a.annotations=[]),a.annotations.push(h)))}o=s[u-1],o?$s(a)&&$s(o)?(l=l,JSON.stringify(a.attrs)===JSON.stringify(o.attrs)?l.t+=a.t:(i.push(l),l=a)):$s(a)||$s(o)?(l=l,i.push(l),l=a):l=String(l||"")+String(a):l=a}return l!=null&&i.push(l),i}function Qrt(t){return t.replace(/ /g," ")}class Mr{get[Symbol.toStringTag](){return mse}get type(){return this.node.nodeName}get id(){return this.node.id}set id(e){this.node.id=e}static isVector(e){if(e==null)return!1;if(e instanceof Mr)return!0;const r=e[Symbol.toStringTag],n=e;return(r==null||r===mse)&&n.node instanceof SVGElement&&typeof n.sample=="function"&&typeof n.toPath=="function"}static create(e,r,n){return new Mr(e,r,n)}static createVectors(e){if(e[0]==="<"){const r=xM(e),n=[];for(let i=0,s=r.childNodes.length;i<s;i+=1){const a=r.childNodes[i];n.push(Mr.create(document.importNode(a,!0)))}return n}return[Mr.create(e)]}static toNode(e){return Mr.isVector(e)?e.node:e}static toNodes(e){return Array.isArray(e)?e.map(r=>Mr.toNode(r)):[Mr.toNode(e)]}constructor(e,r,n){if(!e)throw new TypeError("Invalid element to create vector");let i;if(Mr.isVector(e))i=e.node;else if(typeof e=="string")if(e.toLowerCase()==="svg")i=xM();else if(e[0]==="<"){const s=xM(e);i=document.importNode(s.firstChild,!0)}else i=document.createElementNS(Fa.svg,e);else i=e;this.node=i,r&&this.setAttributes(r),n&&this.append(n)}transform(e,r){return e==null?VT(this.node):(VT(this.node,e,r),this)}translate(e,r=0,n={}){return e==null?vse(this.node):(vse(this.node,e,r,n),this)}rotate(e,r,n,i={}){return e==null?JV(this.node):(JV(this.node,e,r,n,i),this)}scale(e,r){return e==null?bse(this.node):(bse(this.node,e,r),this)}getTransformToElement(e){const r=Mr.toNode(e);return OX(this.node,r)}removeAttribute(e){return _X(this.node,e),this}getAttribute(e){return Nrt(this.node,e)}setAttribute(e,r){return LX(this.node,e,r),this}setAttributes(e){return P2e(this.node,e),this}attr(e,r){return e==null?_n(this.node):typeof e=="string"&&r===void 0?_n(this.node,e):(typeof e=="object"?_n(this.node,e):_n(this.node,e,r),this)}svg(){return this.node instanceof SVGSVGElement?this:Mr.create(this.node.ownerSVGElement)}defs(){const e=this.svg()||this,r=e.node.getElementsByTagName("defs")[0];return r?Mr.create(r):Mr.create("defs").appendTo(e)}text(e,r={}){return z2e(this.node,e,r),this}tagName(){return Art(this.node)}clone(){return Mr.create(this.node.cloneNode(!0))}remove(){return Cu(this.node),this}empty(){return O6(this.node),this}append(e){return To(this.node,Mr.toNodes(e)),this}appendTo(e){return ku(this.node,Mr.isVector(e)?e.node:e),this}prepend(e){return L2e(this.node,Mr.toNodes(e)),this}before(e){return $S(this.node,Mr.toNodes(e)),this}replace(e){return this.node.parentNode&&this.node.parentNode.replaceChild(Mr.toNode(e),this.node),Mr.create(e)}first(){return this.node.firstChild?Mr.create(this.node.firstChild):null}last(){return this.node.lastChild?Mr.create(this.node.lastChild):null}get(e){const r=this.node.childNodes[e];return r?Mr.create(r):null}indexOf(e){return Array.prototype.slice.call(this.node.childNodes).indexOf(Mr.toNode(e))}find(e){const r=[],n=Mrt(this.node,e);if(n)for(let i=0,s=n.length;i<s;i+=1)r.push(Mr.create(n[i]));return r}findOne(e){const r=Rrt(this.node,e);return r?Mr.create(r):null}findParentByClass(e,r){const n=_2e(this.node,e,r);return n?Mr.create(n):null}matches(e){const r=this.node;this.node.matches;const n=r.matches||r.matchesSelector||r.msMatchesSelector||r.mozMatchesSelector||r.webkitMatchesSelector||r.oMatchesSelector||null;return n&&n.call(r,e)}contains(e){return MX(this.node,Mr.isVector(e)?e.node:e)}wrap(e){const r=Mr.create(e),n=this.node.parentNode;return n!=null&&n.insertBefore(r.node,this.node),r.append(this)}parent(e){let r=this;if(r.node.parentNode==null)return null;if(r=Mr.create(r.node.parentNode),e==null)return r;do if(typeof e=="string"?r.matches(e):r instanceof e)return r;while(r=Mr.create(r.node.parentNode));return r}children(){const e=this.node.childNodes,r=[];for(let n=0;n<e.length;n+=1)e[n].nodeType===1&&r.push(Mr.create(e[n]));return r}eachChild(e,r){const n=this.children();for(let i=0,s=n.length;i<s;i+=1)e.call(n[i],n[i],i,n),r&&n[i].eachChild(e,r);return this}index(){return AX(this.node)}hasClass(e){return fd(this.node,e)}addClass(e){return rr(this.node,e),this}removeClass(e){return Bi(this.node,e),this}toggleClass(e,r){return Ju(this.node,e,r),this}toLocalPoint(e,r){return bnt(this.node,e,r)}sample(e=1){return this.node instanceof SVGPathElement?rnt(this.node,e):[]}toPath(){return Mr.create(cnt(this.node))}toPathData(){return W2e(this.node)}}const mse=`X6.${Mr.name}`;function Jrt(t,e){const r=Mr.create(e),n=Mr.create("textPath"),i=t.d;if(i&&t["xlink:href"]===void 0){const s=Mr.create("path").attr("d",i).appendTo(r.defs());n.attr("xlink:href",`#${s.id}`)}return typeof t=="object"&&n.attr(t),n.node}function ent(t,e,r){const n=r.eol,i=r.baseSize,s=r.lineHeight;let a=0,o;const l={},u=e.length-1;for(let h=0;h<=u;h+=1){let d=e[h],f=null;if(typeof d=="object"){const p=d.attrs,g=Mr.create("tspan",p);o=g.node;let m=d.t;n&&h===u&&(m+=n),o.textContent=m;const y=p.class;y&&g.addClass(y),r.includeAnnotationIndices&&g.attr("annotations",d.annotations.join(",")),f=parseFloat(p["font-size"]),f===void 0&&(f=i),f&&f>a&&(a=f)}else n&&h===u&&(d+=n),o=document.createTextNode(d||" "),i&&i>a&&(a=i);t.appendChild(o)}return a&&(l.maxFontSize=a),s?l.lineHeight=s:a&&(l.lineHeight=a*1.2),l}const F2e=/em$/;function c7(t,e){const r=parseFloat(t);return F2e.test(t)?r*e:r}function tnt(t,e,r,n){if(!Array.isArray(e))return 0;const i=e.length;if(!i)return 0;let s=e[0];const a=c7(s.maxFontSize,r)||r;let o=0;const l=c7(n,r);for(let d=1;d<i;d+=1){s=e[d];const f=c7(s.lineHeight,r)||l;o+=f}const u=c7(s.maxFontSize,r)||r;let h;switch(t){case"middle":h=a/2-.15*u-o/2;break;case"bottom":h=-(.25*u)-o;break;case"top":default:h=.8*a;break}return h}function z2e(t,e,r={}){e=Qrt(e);const n=r.eol;let i=r.textPath;const s=r.textVerticalAnchor,a=s==="middle"||s==="bottom"||s==="top";let o=r.x;o===void 0&&(o=t.getAttribute("x")||0);const l=r.includeAnnotationIndices;let u=r.annotations;u&&!Array.isArray(u)&&(u=[u]);const h=r.lineHeight,d=h==="auto",f=d?"1.5em":h||"1em";let p=!0;const g=t.childNodes;if(g.length===1){const A=g[0];A&&A.tagName.toUpperCase()==="TITLE"&&(p=!1)}p&&O6(t),_n(t,{"xml:space":"preserve",display:e||r.displayEmpty?null:"none"});const m=_n(t,"font-size");let y=parseFloat(m);y||(y=16,(a||u)&&!m&&_n(t,"font-size",`${y}`));let v;i?(typeof i=="string"&&(i={d:i}),v=Jrt(i,t)):v=document.createDocumentFragment();let x,b=0,T;const C=e.split(``),S=[],k=C.length-1;for(let A=0;A<=k;A+=1){x=f;let R="v-line";const _=Dh("tspan");let P,N=C[A];if(N)if(u){const L=Zrt(N,u,{offset:-b,includeAnnotationIndices:l});P=ent(_,L,{eol:A!==k&&n,baseSize:y,lineHeight:d?null:f,includeAnnotationIndices:l});const I=P.lineHeight;I&&d&&A!==0&&(x=I),A===0&&(T=P.maxFontSize*.8)}else n&&A!==k&&(N+=n),_.textContent=N;else{_.textContent="-",R+=" v-empty-line";const L=_.style;L.fillOpacity=0,L.strokeOpacity=0,u&&(P={})}P&&S.push(P),A>0&&_.setAttribute("dy",x),(A>0||i)&&_.setAttribute("x",o),_.className.baseVal=R,v.appendChild(_),b+=N.length+1}if(a)if(u)x=tnt(s,S,y,f);else if(s==="top")x="0.8em";else{let A;switch(k>0?(A=parseFloat(f)||1,A*=k,F2e.test(f)||(A/=y)):A=0,s){case"middle":x=`${.3-A/2}em`;break;case"bottom":x=`${-A-.3}em`;break}}else s===0?x="0em":s?x=s:(x=0,t.getAttribute("y")==null&&t.setAttribute("y",`${T||"0.8em"}`));v.firstChild.setAttribute("dy",x),t.appendChild(v)}function $k(t,e={}){const r=document.createElement("canvas").getContext("2d");if(!t)return{width:0};const n=[],i=e["font-size"]?`${parseFloat(e["font-size"])}px`:"14px";return n.push(e["font-style"]||"normal"),n.push(e["font-variant"]||"normal"),n.push(e["font-weight"]||400),n.push(i),n.push(e["font-family"]||"sans-serif"),r.font=n.join(" "),r.measureText(t)}function yse(t,e,r,n={}){if(e>=r)return[t,""];const i=t.length,s={};let a=Math.round(e/r*i-1);for(a<0&&(a=0);a>=0&&a<i;){const o=t.slice(0,a),l=s[o]||$k(o,n).width,u=t.slice(0,a+1),h=s[u]||$k(u,n).width;if(s[o]=l,s[u]=h,l>e)a-=1;else if(h<=e)a+=1;else break}return[t.slice(0,a),t.slice(a)]}function V2e(t,e,r={},n={}){const i=e.width,s=e.height,a=n.eol||``,o=r.fontSize||14,l=r.lineHeight?parseFloat(r.lineHeight):Math.ceil(o*1.4),u=Math.floor(s/l);if(t.indexOf(a)>-1){const y=IX(),v=[];return t.split(a).forEach(x=>{const b=V2e(x,Object.assign(Object.assign({},e),{height:Number.MAX_SAFE_INTEGER}),r,Object.assign(Object.assign({},n),{eol:y}));b&&v.push(...b.split(y))}),v.slice(0,u).join(a)}const{width:h}=$k(t,r);if(h<i)return t;const d=[];let f=t,p=h,g=n.ellipsis,m=0;g&&(typeof g!="string"&&(g="…"),m=$k(g,r).width);for(let y=0;y<u;y+=1)if(p>i)if(y===u-1){const[x]=yse(f,i-m,p,r);d.push(g?`${x}${g}`:x)}else{const[x,b]=yse(f,i,p,r);d.push(x),f=b,p=$k(f,r).width}else{d.push(f);break}return d.join(a)}const ZV=.551784;function bo(t,e,r=NaN){const n=t.getAttribute(e);if(n==null)return r;const i=parseFloat(n);return Number.isNaN(i)?r:i}function rnt(t,e=1){const r=t.getTotalLength(),n=[];let i=0,s;for(;i<r;)s=t.getPointAtLength(i),n.push({distance:i,x:s.x,y:s.y}),i+=e;return n}function nnt(t){return["M",bo(t,"x1"),bo(t,"y1"),"L",bo(t,"x2"),bo(t,"y2")].join(" ")}function int(t){const e=f9(t);return e.length===0?null:`${H2e(e)} Z`}function snt(t){const e=f9(t);return e.length===0?null:H2e(e)}function H2e(t){return`M ${t.map(r=>`${r.x} ${r.y}`).join(" L")}`}function f9(t){const e=[],r=t.points;if(r)for(let n=0,i=r.numberOfItems;n<i;n+=1)e.push(r.getItem(n));return e}function ant(t){const e=bo(t,"cx",0),r=bo(t,"cy",0),n=bo(t,"r"),i=n*ZV;return["M",e,r-n,"C",e+i,r-n,e+n,r-i,e+n,r,"C",e+n,r+i,e+i,r+n,e,r+n,"C",e-i,r+n,e-n,r+i,e-n,r,"C",e-n,r-i,e-i,r-n,e,r-n,"Z"].join(" ")}function ont(t){const e=bo(t,"cx",0),r=bo(t,"cy",0),n=bo(t,"rx"),i=bo(t,"ry")||n,s=n*ZV,a=i*ZV;return["M",e,r-i,"C",e+s,r-i,e+n,r-a,e+n,r,"C",e+n,r+a,e+s,r+i,e,r+i,"C",e-s,r+i,e-n,r+a,e-n,r,"C",e-n,r-a,e-s,r-i,e,r-i,"Z"].join(" ")}function lnt(t){return G2e({x:bo(t,"x",0),y:bo(t,"y",0),width:bo(t,"width",0),height:bo(t,"height",0),rx:bo(t,"rx",0),ry:bo(t,"ry",0)})}function G2e(t){let e;const r=t.x,n=t.y,i=t.width,s=t.height,a=Math.min(t.rx||t["top-rx"]||0,i/2),o=Math.min(t.rx||t["bottom-rx"]||0,i/2),l=Math.min(t.ry||t["top-ry"]||0,s/2),u=Math.min(t.ry||t["bottom-ry"]||0,s/2);return a||o||l||u?e=["M",r,n+l,"v",s-l-u,"a",o,u,0,0,0,o,u,"h",i-2*o,"a",o,u,0,0,0,o,-u,"v",-(s-u-l),"a",a,l,0,0,0,-a,-l,"h",-(i-2*a),"a",a,l,0,0,0,-a,l,"Z"]:e=["M",r,n,"H",r+i,"V",n+s,"H",r,"V",n,"Z"],e.join(" ")}function cnt(t){const e=Dh("path");_n(e,_n(t));const r=W2e(t);return r&&e.setAttribute("d",r),e}function W2e(t){const e=t.tagName.toLowerCase();switch(e){case"path":return t.getAttribute("d");case"line":return nnt(t);case"polygon":return int(t);case"polyline":return snt(t);case"ellipse":return ont(t);case"circle":return ant(t);case"rect":return lnt(t)}throw new Error(`"${e}" cannot be converted to svg path element.`)}const unt=/(\w+)\(([^,)]+),?([^)]+)?\)/gi,q2e=/[ ,]+/,hnt=/^(\w+)\((.*)\)/;function dnt(t,e){const n=Dh("svg").createSVGPoint();return n.x=t,n.y=e,n}function Qa(t){const r=Dh("svg").createSVGMatrix();if(t!=null){const n=t,i=["a","b","c","d","e","f"];for(const s of i)n[s]!==void 0&&(r[s]=n[s])}return r}function fnt(t){const e=Dh("svg");return t!=null?(t instanceof DOMMatrix||(t=Qa(t)),e.createSVGTransformFromMatrix(t)):e.createSVGTransform()}function FS(t){let e=Qa();const r=t!=null&&t.match(unt);if(!r)return e;for(let n=0,i=r.length;n<i;n+=1){const a=r[n].match(hnt);if(a){let o,l,u,h,d,f=Qa();const p=a[2].split(q2e);switch(a[1].toLowerCase()){case"scale":o=parseFloat(p[0]),l=p[1]===void 0?o:parseFloat(p[1]),f=f.scaleNonUniform(o,l);break;case"translate":u=parseFloat(p[0]),h=parseFloat(p[1]),f=f.translate(u,h);break;case"rotate":d=parseFloat(p[0]),u=parseFloat(p[1])||0,h=parseFloat(p[2])||0,u!==0||h!==0?f=f.translate(u,h).rotate(d).translate(-u,-h):f=f.rotate(d);break;case"skewx":d=parseFloat(p[0]),f=f.skewX(d);break;case"skewy":d=parseFloat(p[0]),f=f.skewY(d);break;case"matrix":f.a=parseFloat(p[0]),f.b=parseFloat(p[1]),f.c=parseFloat(p[2]),f.d=parseFloat(p[3]),f.e=parseFloat(p[4]),f.f=parseFloat(p[5]);break;default:continue}e=e.multiply(f)}}return e}function P6(t){const e=t||{},r=e.a!=null?e.a:1,n=e.b!=null?e.b:0,i=e.c!=null?e.c:0,s=e.d!=null?e.d:1,a=e.e!=null?e.e:0,o=e.f!=null?e.f:0;return`matrix(${r},${n},${i},${s},${a},${o})`}function xN(t){let e,r,n;if(t){const s=q2e;if(t.trim().indexOf("matrix")>=0){const a=FS(t),o=pnt(a);e=[o.translateX,o.translateY],r=[o.rotation],n=[o.scaleX,o.scaleY];const l=[];(e[0]!==0||e[1]!==0)&&l.push(`translate(${e.join(",")})`),(n[0]!==1||n[1]!==1)&&l.push(`scale(${n.join(",")})`),r[0]!==0&&l.push(`rotate(${r[0]})`),t=l.join(" ")}else{const a=t.match(/translate\((.*?)\)/);a&&(e=a[1].split(s));const o=t.match(/rotate\((.*?)\)/);o&&(r=o[1].split(s));const l=t.match(/scale\((.*?)\)/);l&&(n=l[1].split(s))}}const i=n&&n[0]?parseFloat(n[0]):1;return{raw:t||"",translation:{tx:e&&e[0]?parseInt(e[0],10):0,ty:e&&e[1]?parseInt(e[1],10):0},rotation:{angle:r&&r[0]?parseInt(r[0],10):0,cx:r&&r[1]?parseInt(r[1],10):void 0,cy:r&&r[2]?parseInt(r[2],10):void 0},scale:{sx:i,sy:n&&n[1]?parseFloat(n[1]):i}}}function QV(t,e){const r=e.x*t.a+e.y*t.c+0,n=e.x*t.b+e.y*t.d+0;return{x:r,y:n}}function pnt(t){const e=QV(t,{x:0,y:1}),r=QV(t,{x:1,y:0}),n=180/Math.PI*Math.atan2(e.y,e.x)-90,i=180/Math.PI*Math.atan2(r.y,r.x);return{skewX:n,skewY:i,translateX:t.e,translateY:t.f,scaleX:Math.sqrt(t.a*t.a+t.b*t.b),scaleY:Math.sqrt(t.c*t.c+t.d*t.d),rotation:n}}function gnt(t){let e,r,n,i;return t?(e=t.a==null?1:t.a,i=t.d==null?1:t.d,r=t.b,n=t.c):e=i=1,{sx:r?Math.sqrt(e*e+r*r):e,sy:n?Math.sqrt(n*n+i*i):i}}function mnt(t){let e={x:0,y:1};t&&(e=QV(t,e));const r=180*Math.atan2(e.y,e.x)/Math.PI%360-90;return{angle:r%360+(r<0?360:0)}}function ynt(t){return{tx:t&&t.e||0,ty:t&&t.f||0}}function VT(t,e,r={}){if(e==null)return FS(_n(t,"transform"));if(r.absolute){t.setAttribute("transform",P6(e));return}const n=t.transform,i=fnt(e);n.baseVal.appendItem(i)}function vse(t,e,r=0,n={}){let i=_n(t,"transform");const s=xN(i);if(e==null)return s.translation;i=s.raw,i=i.replace(/translate\([^)]*\)/g,"").trim();const a=n.absolute?e:s.translation.tx+e,o=n.absolute?r:s.translation.ty+r,l=`translate(${a},${o})`;t.setAttribute("transform",`${l} ${i}`.trim())}function JV(t,e,r,n,i={}){let s=_n(t,"transform");const a=xN(s);if(e==null)return a.rotation;s=a.raw,s=s.replace(/rotate\([^)]*\)/g,"").trim(),e%=360;const o=i.absolute?e:a.rotation.angle+e,l=r!=null&&n!=null?`,${r},${n}`:"",u=`rotate(${o}${l})`;t.setAttribute("transform",`${s} ${u}`.trim())}function bse(t,e,r){let n=_n(t,"transform");const i=xN(n);if(e==null)return i.scale;r=r??e,n=i.raw,n=n.replace(/scale\([^)]*\)/g,"").trim();const s=`scale(${e},${r})`;t.setAttribute("transform",`${n} ${s}`.trim())}function OX(t,e){if(dg(e)&&dg(t)){const r=e.getScreenCTM(),n=t.getScreenCTM();if(r&&n)return r.inverse().multiply(n)}return Qa()}function vnt(t,e){let r=Qa();if(dg(e)&&dg(t)){let n=t;const i=[];for(;n&&n!==e;){const s=n.getAttribute("transform")||null,a=FS(s);i.push(a),n=n.parentNode}i.reverse().forEach(s=>{r=r.multiply(s)})}return r}function bnt(t,e,r){const n=t instanceof SVGSVGElement?t:t.ownerSVGElement,i=n.createSVGPoint();i.x=e,i.y=r;try{const s=n.getScreenCTM(),a=i.matrixTransform(s.inverse()),o=OX(t,n).inverse();return a.matrixTransform(o)}catch{return i}}const U2e={};function HT(t){return U2e[t]||{}}function wN(t,e){U2e[t]=e}const Bk=new WeakMap;function xnt(t){return Bk.has(t)||Bk.set(t,{events:Object.create(null)}),Bk.get(t)}function PX(t){return Bk.get(t)}function wnt(t){return Bk.delete(t)}const u7=()=>!0,K2=()=>!1;function xse(t){t.stopPropagation()}function Tnt(t,e,r){t.addEventListener!=null&&t.addEventListener(e,r)}function Cnt(t,e,r){t.removeEventListener!=null&&t.removeEventListener(e,r)}const knt=/[^\x20\t\r\n\f]+/g,Snt=/^([^.]*)(?:\.(.+)|)/;function j2e(t){return(t||"").match(knt)||[""]}function Y2e(t){const e=Snt.exec(t)||[];return{originType:e[1]?e[1].trim():e[1],namespaces:e[2]?e[2].split(".").map(r=>r.trim()).sort():[]}}function eH(t){return t.nodeType===1||t.nodeType===9||!+t.nodeType}let wse=0;const xb=new WeakMap;function X2e(t){return xb.has(t)||(xb.set(t,wse),wse+=1),xb.get(t)}function Ent(t){return xb.get(t)}function Ant(t){return xb.delete(t)}function K2e(t,e){return xb.set(t,e)}function Mnt(t,e){const r=[],n=PX(t),i=n&&n.events&&n.events[e.type],s=i&&i.handlers||[],a=i?i.delegateCount:0;if(a>0&&!(e.type==="click"&&typeof e.button=="number"&&e.button>=1)){for(let o=e.target;o!==t;o=o.parentNode||t)if(o.nodeType===1&&!(e.type==="click"&&o.disabled===!0)){const l=[],u={};for(let h=0;h<a;h+=1){const d=s[h],f=d.selector;if(f!=null&&u[f]==null){const p=t,g=[];p.querySelectorAll(f).forEach(m=>{g.push(m)}),u[f]=g.includes(o)}u[f]&&l.push(d)}l.length&&r.push({elem:o,handlers:l})}}return a<s.length&&r.push({elem:t,handlers:s.slice(a)}),r}function Tse(t){return t!=null&&t===t.window}function Z2e(t,e){const r=t.nodeType===9?t.documentElement:t,n=e&&e.parentNode;return t===n||!!(n&&n.nodeType===1&&(r.contains?r.contains(n):t.compareDocumentPosition&&t.compareDocumentPosition(n)&16))}class e0{static create(e){return e instanceof e0?e:new e0(e)}static addProperty(e,r){Object.defineProperty(e0.prototype,e,{enumerable:!0,configurable:!0,get:typeof r=="function"?function(){if(this.originalEvent)return r(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set(n){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:n})}})}constructor(e,r){this.isDefaultPrevented=K2,this.isPropagationStopped=K2,this.isImmediatePropagationStopped=K2,this.isSimulated=!1,this.preventDefault=()=>{const n=this.originalEvent;this.isDefaultPrevented=u7,n&&!this.isSimulated&&n.preventDefault()},this.stopPropagation=()=>{const n=this.originalEvent;this.isPropagationStopped=u7,n&&!this.isSimulated&&n.stopPropagation()},this.stopImmediatePropagation=()=>{const n=this.originalEvent;this.isImmediatePropagationStopped=u7,n&&!this.isSimulated&&n.stopImmediatePropagation(),this.stopPropagation()},typeof e=="string"?this.type=e:e.type&&(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?u7:K2,this.target=e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget,this.timeStamp=e.timeStamp),r&&Object.assign(this,r),this.timeStamp||(this.timeStamp=Date.now())}}const Cse={bubbles:!0,cancelable:!0,eventPhase:!0,detail:!0,view:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pageX:!0,pageY:!0,screenX:!0,screenY:!0,toElement:!0,pointerId:!0,pointerType:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,touches:!0,changedTouches:!0,targetTouches:!0,which:!0,altKey:!0,ctrlKey:!0,metaKey:!0,shiftKey:!0};Object.keys(Cse).forEach(t=>e0.addProperty(t,Cse[t]));wN("load",{noBubble:!0});wN("beforeunload",{postDispatch(t,e){e.result!==void 0&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}});wN("mouseenter",{delegateType:"mouseover",bindType:"mouseover",handle(t,e){let r;const n=e.relatedTarget,i=e.handleObj;return(!n||n!==t&&!Z2e(t,n))&&(e.type=i.originType,r=i.handler.call(t,e),e.type="mouseover"),r}});wN("mouseleave",{delegateType:"mouseout",bindType:"mouseout",handle(t,e){let r;const n=e.relatedTarget,i=e.handleObj;return(!n||n!==t&&!Z2e(t,n))&&(e.type=i.originType,r=i.handler.call(t,e),e.type="mouseout"),r}});let tH;function Rnt(t,e,r,n,i){if(!eH(t))return;let s;if(typeof r!="function"){const{handler:u,selector:h}=r,d=gn(r,["handler","selector"]);r=u,i=h,s=d}const a=xnt(t);let o=a.handler;o==null&&(o=a.handler=function(u,...h){return tH!==u.type?_nt(t,u,...h):void 0});const l=X2e(r);j2e(e).forEach(u=>{const{originType:h,namespaces:d}=Y2e(u);if(!h)return;let f=h,p=HT(f);f=(i?p.delegateType:p.bindType)||f,p=HT(f);const g=Object.assign({type:f,originType:h,data:n,selector:i,guid:l,handler:r,namespace:d.join(".")},s),m=a.events;let y=m[f];y||(y=m[f]={handlers:[],delegateCount:0},(!p.setup||p.setup(t,n,d,o)===!1)&&Tnt(t,f,o)),p.add&&(Ant(g.handler),p.add(t,g),K2e(g.handler,l)),i?(y.handlers.splice(y.delegateCount,0,g),y.delegateCount+=1):y.handlers.push(g)})}function Q2e(t,e,r,n,i){const s=PX(t);if(!s)return;const a=s.events;a&&(j2e(e).forEach(o=>{const{originType:l,namespaces:u}=Y2e(o);if(!l){Object.keys(a).forEach(m=>{Q2e(t,m+o,r,n,!0)});return}let h=l;const d=HT(h);h=(n?d.delegateType:d.bindType)||h;const f=a[h];if(!f)return;const p=u.length>0?new RegExp(`(^|\\.)${u.join("\\.(?:.*\\.|)")}(\\.|$)`):null,g=f.handlers.length;for(let m=f.handlers.length-1;m>=0;m-=1){const y=f.handlers[m];(i||l===y.originType)&&(!r||Ent(r)===y.guid)&&(p==null||y.namespace&&p.test(y.namespace))&&(n==null||n===y.selector||n==="**"&&y.selector)&&(f.handlers.splice(m,1),y.selector&&(f.delegateCount-=1),d.remove&&d.remove(t,y))}g&&f.handlers.length===0&&((!d.teardown||d.teardown(t,u,s.handler)===!1)&&Cnt(t,h,s.handler),delete a[h])}),Object.keys(a).length===0&&wnt(t))}function _nt(t,e,...r){const n=e0.create(e);n.delegateTarget=t;const i=HT(n.type);if(i.preDispatch&&i.preDispatch(t,n)===!1)return;const s=Mnt(t,n);for(let a=0,o=s.length;a<o&&!n.isPropagationStopped();a+=1){const l=s[a];n.currentTarget=l.elem;for(let u=0,h=l.handlers.length;u<h&&!n.isImmediatePropagationStopped();u+=1){const d=l.handlers[u];if(n.rnamespace==null||d.namespace&&n.rnamespace.test(d.namespace)){n.handleObj=d,n.data=d.data;const f=HT(d.originType).handle,p=f?f(l.elem,n,...r):d.handler.call(l.elem,n,...r);p!==void 0&&(n.result=p,p===!1&&(n.preventDefault(),n.stopPropagation()))}}}return i.postDispatch&&i.postDispatch(t,n),n.result}function Lnt(t,e,r,n){let i=t,s=typeof t=="string"?t:t.type,a=typeof t=="string"||i.namespace==null?[]:i.namespace.split(".");const o=r;if(o.nodeType===3||o.nodeType===8)return;s.indexOf(".")>-1&&(a=s.split("."),s=a.shift(),a.sort());const l=s.indexOf(":")<0&&`on${s}`;i=t instanceof e0?t:new e0(s,typeof t=="object"?t:null),i.namespace=a.join("."),i.rnamespace=i.namespace?new RegExp(`(^|\\.)${a.join("\\.(?:.*\\.|)")}(\\.|$)`):null,i.result=void 0,i.target||(i.target=o);const u=[i];Array.isArray(e)?u.push(...e):u.push(e);const h=HT(s);if(!n&&h.trigger&&h.trigger(o,i,e)===!1)return;let d;const f=[o];if(!n&&!h.noBubble&&!Tse(o)){d=h.delegateType||s;let g=o,m=o.parentNode;for(;m!=null;)f.push(m),g=m,m=m.parentNode;const y=o.ownerDocument||document;if(g===y){const v=g.defaultView||g.parentWindow||window;f.push(v)}}let p=o;for(let g=0,m=f.length;g<m&&!i.isPropagationStopped();g+=1){const y=f[g];p=y,i.type=g>1?d:h.bindType||s;const v=PX(y);v&&v.events[i.type]&&v.handler&&v.handler.call(y,...u);const x=l&&y[l]||null;x&&eH(y)&&(i.result=x.call(y,...u),i.result===!1&&i.preventDefault())}if(i.type=s,!n&&!i.isDefaultPrevented()){const g=h.preventDefault;if((g==null||g(f.pop(),i,e)===!1)&&eH(o)&&l&&typeof o[s]=="function"&&!Tse(o)){const m=o[l];m&&(o[l]=null),tH=s,i.isPropagationStopped()&&p.addEventListener(s,xse),o[s](),i.isPropagationStopped()&&p.removeEventListener(s,xse),tH=void 0,m&&(o[l]=m)}}return i.result}let Ti=class{static on(e,r,n,i,s){return Fk.on(e,r,n,i,s),e}static once(e,r,n,i,s){return Fk.on(e,r,n,i,s,!0),e}static off(e,r,n,i){return Fk.off(e,r,n,i),e}static trigger(e,r,n,i){return Lnt(r,n,e,i),e}};var Fk;(function(t){function e(n,i,s,a,o,l){if(typeof i=="object"){typeof s!="string"&&(a=a||s,s=void 0),Object.keys(i).forEach(u=>e(n,u,s,a,i[u],l));return}if(a==null&&o==null?(o=s,a=s=void 0):o==null&&(typeof s=="string"?(o=a,a=void 0):(o=a,a=s,s=void 0)),o===!1)o=K2;else if(!o)return;if(l){const u=o;o=function(h,...d){return t.off(n,h),u.call(this,h,...d)},K2e(o,X2e(u))}Rnt(n,i,o,a,s)}t.on=e;function r(n,i,s,a){const o=i;if(o&&o.preventDefault!=null&&o.handleObj!=null){const l=o.handleObj;r(o.delegateTarget,l.namespace?`${l.originType}.${l.namespace}`:l.originType,l.selector,l.handler);return}if(typeof i=="object"){const l=i;Object.keys(l).forEach(u=>r(n,u,s,l[u]));return}(s===!1||typeof s=="function")&&(a=s,s=void 0),a===!1&&(a=K2),Q2e(n,i,a,s)}t.off=r})(Fk||(Fk={}));class J2e{constructor(e,r,n){this.animationFrameId=0,this.deltaX=0,this.deltaY=0,this.eventName=lrt("wheel")?"wheel":"mousewheel",this.target=e,this.onWheelCallback=r,this.onWheelGuard=n,this.onWheel=this.onWheel.bind(this),this.didWheel=this.didWheel.bind(this)}enable(){this.target.addEventListener(this.eventName,this.onWheel,{passive:!1})}disable(){this.target.removeEventListener(this.eventName,this.onWheel)}onWheel(e){if(this.onWheelGuard!=null&&!this.onWheelGuard(e))return;this.deltaX+=e.deltaX,this.deltaY+=e.deltaY,e.preventDefault();let r;(this.deltaX!==0||this.deltaY!==0)&&(e.stopPropagation(),r=!0),r===!0&&this.animationFrameId===0&&(this.animationFrameId=requestAnimationFrame(()=>{this.didWheel(e)}))}didWheel(e){this.animationFrameId=0,this.onWheelCallback(e,this.deltaX,this.deltaY),this.deltaX=0,this.deltaY=0}}function GT(t){const e=t.getBoundingClientRect(),r=t.ownerDocument.defaultView;return{top:e.top+r.pageYOffset,left:e.left+r.pageXOffset}}function Int(t){return t.getBoundingClientRect().width}function Nnt(t){return t.getBoundingClientRect().height}function Dnt(t){const e=h9(t,"position")==="fixed";let r;if(e){const n=t.getBoundingClientRect();r={left:n.left,top:n.top}}else r=GT(t);if(!e){const n=t.ownerDocument;let i=t.offsetParent||n.documentElement;for(;(i===n.body||i===n.documentElement)&&h9(i,"position")==="static";)i=i.parentNode;if(i!==t&&Lrt(i)){const s=GT(i);r.top-=s.top+l7(i,"borderTopWidth"),r.left-=s.left+l7(i,"borderLeftWidth")}}return{top:r.top-l7(t,"marginTop"),left:r.left-l7(t,"marginLeft")}}function Df(t,e){const r=dnt(t.x,t.y).matrixTransform(e);return new Qe(r.x,r.y)}function Ont(t,e){return new lr(Df(t.start,e),Df(t.end,e))}function gu(t,e){const n=Dh("svg").createSVGPoint();n.x=t.x,n.y=t.y;const i=n.matrixTransform(e);n.x=t.x+t.width,n.y=t.y;const s=n.matrixTransform(e);n.x=t.x+t.width,n.y=t.y+t.height;const a=n.matrixTransform(e);n.x=t.x,n.y=t.y+t.height;const o=n.matrixTransform(e),l=Math.min(i.x,s.x,a.x,o.x),u=Math.max(i.x,s.x,a.x,o.x),h=Math.min(i.y,s.y,a.y,o.y),d=Math.max(i.y,s.y,a.y,o.y);return new Bt(l,h,u-l,d-h)}function kse(t,e,r){let n=null;if(!t.ownerSVGElement)return new Bt(0,0,0,0);try{n=t.getBBox()}catch{n={x:t.clientLeft,y:t.clientTop,width:t.clientWidth,height:t.clientHeight}}return Bt.create(n)}function Cd(t,e={}){let r=null;if(!t.ownerSVGElement||!dg(t)){if(I2e(t)){const{left:a,top:o,width:l,height:u}=ebe(t);return new Bt(a,o,l,u)}return new Bt(0,0,0,0)}let i=e.target;if(!e.recursive){try{r=t.getBBox()}catch{r={x:t.clientLeft,y:t.clientTop,width:t.clientWidth,height:t.clientHeight}}if(!i)return Bt.create(r);const a=OX(t,i);return gu(r,a)}{const a=t.childNodes,o=a.length;if(o===0)return Cd(t,{target:i});i||(i=t);let l=null;for(let u=0;u<o;u+=1){const h=a[u];let d=null;h.childNodes.length===0?d=Cd(h,{target:i}):d=Cd(h,{target:i,recursive:!0}),l?l=l.union(d):l=Bt.create(d)}return l||new Bt(0,0,0,0)}}function ebe(t){let e=0,r=0,n=0,i=0;if(t){let s=t;for(;s;)e+=s.offsetLeft,r+=s.offsetTop,s=s.offsetParent,s&&(e+=parseInt(fse(s,"borderLeft"),10),r+=parseInt(fse(s,"borderTop"),10));n=t.offsetWidth,i=t.offsetHeight}return{left:e,top:r,width:n,height:i}}function tbe(t){const e=r=>{const n=t.getAttribute(r),i=n?parseFloat(n):0;return Number.isNaN(i)?0:i};switch(t instanceof SVGElement&&t.nodeName.toLowerCase()){case"rect":return new Bt(e("x"),e("y"),e("width"),e("height"));case"circle":return new rc(e("cx"),e("cy"),e("r"),e("r"));case"ellipse":return new rc(e("cx"),e("cy"),e("rx"),e("ry"));case"polyline":{const r=f9(t);return new Ba(r)}case"polygon":{const r=f9(t);return r.length>1&&r.push(r[0]),new Ba(r)}case"path":{let r=t.getAttribute("d");return vrt(r)||(r=M2e(r)),ci.parse(r)}case"line":return new lr(e("x1"),e("y1"),e("x2"),e("y2"))}return Cd(t)}function Pnt(t){if(t==null)return null;let e=t;do{let r=e.tagName;if(typeof r!="string")return null;if(r=r.toUpperCase(),fd(e,"x6-port"))e=e.nextElementSibling;else if(r==="G")e=e.firstElementChild;else if(r==="TITLE")e=e.nextElementSibling;else break}while(e);return e}function $nt(t){const e=Pnt(t);if(!dg(e)){if(I2e(t)){const{left:i,top:s,width:a,height:o}=ebe(t);return new Bt(i,s,a,o)}return new Bt(0,0,0,0)}return tbe(e).bbox()||Bt.create()}const Bnt=(t,e)=>t-e;class Fnt{constructor(e={}){this.comparator=e.comparator||Bnt,this.index={},this.data=e.data||[],this.heapify()}isEmpty(){return this.data.length===0}insert(e,r,n){const i={priority:e,value:r},s=this.data.length;return n&&(i.id=n,this.index[n]=s),this.data.push(i),this.bubbleUp(s),this}peek(){return this.data[0]?this.data[0].value:null}peekPriority(){return this.data[0]?this.data[0].priority:null}updatePriority(e,r){const n=this.index[e];if(typeof n>"u")throw new Error(`Node with id '${e}' was not found in the heap.`);const i=this.data,s=i[n].priority,a=this.comparator(r,s);a<0?(i[n].priority=r,this.bubbleUp(n)):a>0&&(i[n].priority=r,this.bubbleDown(n))}remove(){const e=this.data,r=e[0],n=e.pop();return r!=null&&r.id&&delete this.index[r.id],e.length>0&&(e[0]=n,n.id&&(this.index[n.id]=0),this.bubbleDown(0)),r?r.value:null}heapify(){for(let e=0;e<this.data.length;e+=1)this.bubbleUp(e)}bubbleUp(e){const r=this.data;let n,i,s=e;for(;s>0&&(i=s-1>>>1,this.comparator(r[s].priority,r[i].priority)<0);){n=r[i],r[i]=r[s];let a=r[s].id;a!=null&&(this.index[a]=i),r[s]=n,a=r[s].id,a!=null&&(this.index[a]=s),s=i}}bubbleDown(e){const r=this.data,n=r.length-1;let i=e;for(;;){const s=(i<<1)+1,a=s+1;let o=i;if(s<=n&&this.comparator(r[s].priority,r[o].priority)<0&&(o=s),a<=n&&this.comparator(r[a].priority,r[o].priority)<0&&(o=a),o!==i){const l=r[o];r[o]=r[i];let u=r[i].id;u!=null&&(this.index[u]=o),r[i]=l,u=r[i].id,u!=null&&(this.index[u]=i),i=o}else break}}}function znt(t,e,r=(n,i)=>1){const n={},i={},s={},a=new Fnt;for(n[e]=0,Object.keys(t).forEach(o=>{o!==e&&(n[o]=1/0),a.insert(n[o],o,o)});!a.isEmpty();){const o=a.remove();s[o]=!0;const l=t[o];for(let u=0;u<l.length;u+=1){const h=l[u];if(!s[h]){const d=n[o]+r(o,h);d<n[h]&&(n[h]=d,i[h]=o,a.updatePriority(h,d))}}}return i}const zS=/(-?(?:\d*\.\d+|\d+))\s*(px|em|rem|ch|vh|vw|vmin|vmax|%|cm|mm|in|pt|pc|ex|fr|deg|rad|turn)$/,rbe=(t,e)=>{const r=e-t;return n=>t+r*n},nbe=(t,e)=>{const r=zS,n=r.exec(t),i=r.exec(e),s=i?i[1]:"",a=n?+n[1]:0,o=i?+i[1]:0,l=s.indexOf("."),u=l>0?s[1].length-l-1:0,h=o-a,d=n?n[2]:"";return f=>(a+h*f).toFixed(u)+d},Vnt=(t,e)=>{const r=parseInt(t.slice(1),16),n=parseInt(e.slice(1),16),i=r&255,s=(n&255)-i,a=r&65280,o=(n&65280)-a,l=r&16711680,u=(n&16711680)-l;return h=>{const d=i+s*h&255,f=a+o*h&65280,p=l+u*h&16711680;return`#${(1<<24|d|f|p).toString(16).slice(1)}`}},Hnt=(t,e)=>{const r=s=>{const a=[];if(!s)return a;const o=/(\w+)\(([^)]+)\)/g;let l=o.exec(s);for(;l!==null;)l[1]&&l[2]&&a.push({name:l[1],values:l[2].split(/\s*,\s*/).filter(Boolean)}),l=o.exec(s);return a},n=r(t),i=r(e);return n.length===0||i.length===0?()=>t:s=>{const a=[];for(let o=0;o<Math.min(n.length,i.length);o++){const l=n[o],u=i[o];if(!(!l||!u)&&l.name===u.name&&l.values.length>0&&l.values.length===u.values.length){const h=[];for(let d=0;d<l.values.length;d++){const f=l.values[d],p=u.values[d];if(!(f===void 0||p===void 0))if(zS.test(f)||zS.test(p)){const g=nbe(f,p);h.push(g(s))}else if(!Number.isNaN(parseFloat(f))&&!Number.isNaN(parseFloat(p))){const g=rbe(parseFloat(f),parseFloat(p));h.push(g(s).toString())}else h.push(f)}h.length>0&&a.push(`${l.name}(${h.join(", ")})`)}}return a.length>0?a.join(" "):t}},ibe=t=>t,Gnt=t=>t*t,Wnt=t=>t*t*t,qnt=t=>{if(t<=0)return 0;if(t>=1)return 1;const e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)},Unt=t=>Math.pow(2,10*(t-1)),jnt=(t=>{for(let e=0,r=1;;e+=r,r/=2)if(t>=(7-4*e)/11){const n=(11-6*e-11*t)/4;return-n*n+r*r}}),Ynt={reverse(t){return e=>1-t(1-e)},reflect(t){return e=>.5*(e<.5?t(2*e):2-t(2-2*e))},clamp(t,e=0,r=1){return n=>{const i=t(n);return i<e?e:i>r?r:i}},back(t=1.70158){return e=>e*e*((t+1)*e-t)},elastic(t=1.5){return e=>Math.pow(2,10*(e-1))*Math.cos(20*Math.PI*t/3*e)}};function Xnt(t){return-1*Math.cos(t*(Math.PI/2))+1}function Knt(t){return Math.sin(t*(Math.PI/2))}function Znt(t){return-.5*(Math.cos(Math.PI*t)-1)}function Qnt(t){return t*t}function Jnt(t){return t*(2-t)}function eit(t){return t<.5?2*t*t:-1+(4-2*t)*t}function tit(t){return t*t*t}function rit(t){const e=t-1;return e*e*e+1}function nit(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1}function iit(t){return t*t*t*t}function sit(t){const e=t-1;return 1-e*e*e*e}function ait(t){const e=t-1;return t<.5?8*t*t*t*t:1-8*e*e*e*e}function oit(t){return t*t*t*t*t}function lit(t){const e=t-1;return 1+e*e*e*e*e}function cit(t){const e=t-1;return t<.5?16*t*t*t*t*t:1+16*e*e*e*e*e}function uit(t){return t===0?0:Math.pow(2,10*(t-1))}function hit(t){return t===1?1:-Math.pow(2,-10*t)+1}function dit(t){if(t===0||t===1)return t;const e=t*2,r=e-1;return e<1?.5*Math.pow(2,10*r):.5*(-Math.pow(2,-10*r)+2)}function fit(t){const e=t/1;return-1*(Math.sqrt(1-e*t)-1)}function pit(t){const e=t-1;return Math.sqrt(1-e*e)}function git(t){const e=t*2,r=e-2;return e<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-r*r)+1)}function mit(t,e=1.70158){return t*t*((e+1)*t-e)}function yit(t,e=1.70158){const r=t/1-1;return r*r*((e+1)*r+e)+1}function vit(t,e=1.70158){const r=t*2,n=r-2,i=e*1.525;return r<1?.5*r*r*((i+1)*r-i):.5*(n*n*((i+1)*n+i)+2)}function bit(t,e=.7){if(t===0||t===1)return t;const n=t/1-1,i=1-e,s=i/(2*Math.PI)*Math.asin(1);return-(Math.pow(2,10*n)*Math.sin((n-s)*(2*Math.PI)/i))}function xit(t,e=.7){const r=1-e,n=t*2;if(t===0||t===1)return t;const i=r/(2*Math.PI)*Math.asin(1);return Math.pow(2,-10*n)*Math.sin((n-i)*(2*Math.PI)/r)+1}function wit(t,e=.65){const r=1-e;if(t===0||t===1)return t;const n=t*2,i=n-1,s=r/(2*Math.PI)*Math.asin(1);return n<1?-.5*(Math.pow(2,10*i)*Math.sin((i-s)*(2*Math.PI)/r)):Math.pow(2,-10*i)*Math.sin((i-s)*(2*Math.PI)/r)*.5+1}function $X(t){const e=t/1;if(e<1/2.75)return 7.5625*e*e;if(e<2/2.75){const r=e-.5454545454545454;return 7.5625*r*r+.75}if(e<2.5/2.75){const r=e-.8181818181818182;return 7.5625*r*r+.9375}{const r=e-.9545454545454546;return 7.5625*r*r+.984375}}function sbe(t){return 1-$X(1-t)}function Tit(t){return t<.5?sbe(t*2)*.5:$X(t*2-1)*.5+.5}const Cit=Object.freeze(Object.defineProperty({__proto__:null,bounce:jnt,cubic:Wnt,decorators:Ynt,easeInBack:mit,easeInBounce:sbe,easeInCirc:fit,easeInCubic:tit,easeInElastic:bit,easeInExpo:uit,easeInOutBack:vit,easeInOutBounce:Tit,easeInOutCirc:git,easeInOutCubic:nit,easeInOutElastic:wit,easeInOutExpo:dit,easeInOutQuad:eit,easeInOutQuart:ait,easeInOutQuint:cit,easeInOutSine:Znt,easeInQuad:Qnt,easeInQuart:iit,easeInQuint:oit,easeInSine:Xnt,easeOutBack:yit,easeOutBounce:$X,easeOutCirc:pit,easeOutCubic:rit,easeOutElastic:xit,easeOutExpo:hit,easeOutQuad:Jnt,easeOutQuart:sit,easeOutQuint:lit,easeOutSine:Knt,exponential:Unt,inout:qnt,linear:ibe,quad:Gnt},Symbol.toStringTag,{value:"Module"}));function i$(t,e){const r=[];for(let n=0;n<t.length;n+=2){const i=t[n],s=t[n+1],a=Array.isArray(e)?e:[e],o=S2e(i,s,a);r.push(o)}return TX(r)}class kit{constructor(){this.listeners={}}on(e,r,n){return r==null?this:(this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(r,n),this)}once(e,r,n){const i=(...s)=>(this.off(e,i),i$([r,n],s));return this.on(e,i,this)}off(e,r,n){if(!(e||r||n))return this.listeners={},this;const i=this.listeners;return(e?[e]:Object.keys(i)).forEach(a=>{const o=i[a];if(o){if(!(r||n)){delete i[a];return}for(let l=o.length-2;l>=0;l-=2)r&&o[l]!==r||n&&o[l+1]!==n||o.splice(l,2)}}),this}trigger(e,...r){let n=!0;if(e!=="*"){const s=this.listeners[e];s!=null&&(n=i$([...s],r))}const i=this.listeners["*"];return i!=null?TX([n,i$([...i],[e,...r])]):n}emit(e,...r){return this.trigger(e,...r)}}let r3=class{get disposed(){return this._disposed===!0}dispose(){this._disposed=!0}};function Dn(){return(t,e,r)=>{const n=r.value,i=t.__proto__;r.value=function(...s){this.disposed||(n.call(this,...s),i.dispose.call(this))}}}class Bl extends kit{dispose(){this.off()}}Nn([Dn()],Bl.prototype,"dispose",null);Urt(Bl,r3);class rH{constructor(){this.clear()}clear(){this.map=new WeakMap,this.arr=[]}has(e){return this.map.has(e)}get(e){return this.map.get(e)}set(e,r){this.map.set(e,r),this.arr.push(e)}delete(e){const r=this.arr.indexOf(e);r>=0&&this.arr.splice(r,1);const n=this.map.get(e);return this.map.delete(e),n}each(e){this.arr.forEach(r=>{const n=this.map.get(r);e(n,r)})}dispose(){this.clear()}}function nH(t){const e=[],r=[];return Array.isArray(t)?e.push(...t):t.split("|").forEach(n=>{n.indexOf("&")===-1?e.push(n):r.push(...n.split("&"))}),{or:e,and:r}}function Sit(t,e){if(t!=null&&e!=null){const r=nH(t),n=nH(e),i=r.or.sort(),s=n.or.sort(),a=r.and.sort(),o=n.and.sort(),l=(u,h)=>u.length===h.length&&(u.length===0||u.every((d,f)=>d===h[f]));return l(i,s)&&l(a,o)}return t==null&&e==null}function fg(t,e,r){if(e==null||Array.isArray(e)&&e.length===0)return r?t.altKey!==!0&&t.ctrlKey!==!0&&t.metaKey!==!0&&t.shiftKey!==!0:!0;const{or:n,and:i}=nH(e),s=a=>{const o=`${a.toLowerCase()}Key`;return t[o]===!0};return n.some(a=>s(a))&&i.every(a=>s(a))}class Zs{static create(e){return new Zs(e)}constructor(e){this.options=Object.assign({},e),this.data=this.options.data||{},this.register=this.register.bind(this),this.unregister=this.unregister.bind(this)}get names(){return Object.keys(this.data)}register(e,r,n=!1){if(typeof e=="object"){Object.entries(e).forEach(([a,o])=>{this.register(a,o,r)});return}this.exist(e)&&!n&&!k2e()&&this.onDuplicated(e);const i=this.options.process,s=i?vr(i,this,e,r):r;return this.data[e]=s,s}unregister(e){const r=e?this.data[e]:null;return delete this.data[e],r}get(e){return e?this.data[e]:null}exist(e){return e?this.data[e]!=null:!1}onDuplicated(e){try{throw this.options.onConflict&&vr(this.options.onConflict,this,e),new Error(`${a9(this.options.type)} with name '${e}' already registered.`)}catch(r){throw r}}onNotFound(e,r){throw new Error(this.getSpellingSuggestion(e,r))}getSpellingSuggestion(e,r){const n=this.getSpellingSuggestionForName(e),i=r?`${r} ${Stt(this.options.type)}`:this.options.type;return`${a9(i)} with name '${e}' does not exist.${n?` Did you mean '${n}'?`:""}`}getSpellingSuggestionForName(e){return Vrt(e,Object.keys(this.data),r=>r)}}const Eit={},abe={position:TN("x","width","origin")},obe={position:TN("y","height","origin")},Ait={position:TN("x","width","corner")},Mit={position:TN("y","height","corner")},lbe={set:pg("width","width")},cbe={set:pg("height","height")},Rit={set:pg("rx","width")},_it={set:pg("ry","height")},ube={set:(t=>{const e=pg(t,"width"),r=pg(t,"height");return function(n,i){const s=i.refBBox,a=s.height>s.width?e:r;return vr(a,this,n,i)}})("r")},Lit={set(t,{refBBox:e}){let r=parseFloat(t);const n=c0(t);n&&(r/=100);const i=Math.sqrt(e.height*e.height+e.width*e.width);let s;return Number.isFinite(r)&&(n||r>=0&&r<=1?s=r*i:s=Math.max(r+i,0)),{r:s}}},Iit={set:pg("cx","width")},Nit={set:pg("cy","height")},hbe={set:pbe({resetOffset:!0})},Dit={set:pbe({resetOffset:!1})},dbe={set:gbe({resetOffset:!0})},Oit={set:gbe({resetOffset:!1})},Pit=ube,$it=hbe,Bit=dbe,Fit=abe,zit=obe,Vit=lbe,Hit=cbe;function TN(t,e,r){return(n,{refBBox:i})=>{if(n==null)return null;let s=parseFloat(n);const a=c0(n);a&&(s/=100);let o;if(Number.isFinite(s)){const u=i[r];a||s>0&&s<1?o=u[t]+i[e]*s:o=u[t]+s}const l=new Qe;return l[t]=o||0,l}}function pg(t,e){return(r,{refBBox:n})=>{let i=parseFloat(r);const s=c0(r);s&&(i/=100);const a={};if(Number.isFinite(i)){const o=s||i>=0&&i<=1?i*n[e]:Math.max(i+n[e],0);a[t]=o}return a}}function fbe(t,e){const r="x6-shape",n=e&&e.resetOffset;return(i,{elem:s,refBBox:a})=>{let o=hy(s,r);if(!o||o.value!==i){const m=t(i);o={value:i,shape:m,shapeBBox:m.bbox()},hy(s,r,o)}const l=o.shape.clone(),u=o.shapeBBox.clone(),h=u.getOrigin(),d=a.getOrigin();u.x=d.x,u.y=d.y;const f=a.getMaxScaleToFit(u,d),p=u.width===0||a.width===0?1:f.sx,g=u.height===0||a.height===0?1:f.sy;return l.scale(p,g,h),n&&l.translate(-h.x,-h.y),l}}function pbe(t){function e(n){return ci.parse(n)}const r=fbe(e,t);return(n,i)=>({d:r(n,i).serialize()})}function gbe(t){const e=fbe(r=>new Ba(r),t);return(r,n)=>({points:e(r,n).serialize()})}const Git={qualify:Nh,set(t,{view:e}){return`url(#${e.graph.defineGradient(t)})`}},Wit={qualify:Nh,set(t,{view:e}){const r=e.cell,n=Object.assign({},t);if(r.isEdge()&&n.type==="linearGradient"){const i=e,s=i.sourcePoint,a=i.targetPoint;n.id=`gradient-${n.type}-${r.id}`,n.attrs=Object.assign(Object.assign({},n.attrs),{x1:s.x,y1:s.y,x2:a.x,y2:a.y,gradientUnits:"userSpaceOnUse"}),e.graph.defs.remove(n.id)}return`url(#${e.graph.defineGradient(n)})`}},mbe={qualify(t,{attrs:e}){return e.textWrap==null||!Nh(e.textWrap)},set(t,{view:e,elem:r,attrs:n}){const i="x6-text",s=hy(r,i),a=h=>{try{if(typeof h=="string")return JSON.parse(h)}catch{}return h},o={x:n.x,eol:n.eol,annotations:a(n.annotations),textPath:a(n["text-path"]||n.textPath),textVerticalAnchor:n["text-vertical-anchor"]||n.textVerticalAnchor,displayEmpty:(n["display-empty"]||n.displayEmpty)==="true",lineHeight:n["line-height"]||n.lineHeight},l=n["font-size"]||n.fontSize,u=JSON.stringify([t,o]);if(l&&r.setAttribute("font-size",l),s==null||s!==u){const h=o.textPath;if(h!=null&&typeof h=="object"){const d=h.selector;if(typeof d=="string"){const f=e.find(d)[0];f instanceof SVGPathElement&&(SX(f),o.textPath=Object.assign({"xlink:href":`#${f.id}`},h))}}z2e(r,`${t}`,o),hy(r,i,u)}}},qit={qualify:Nh,set(t,{view:e,elem:r,attrs:n,refBBox:i}){var s,a;const o=t,l=o.width||0;c0(l)?i.width*=parseFloat(l)/100:l<=0?i.width+=l:i.width=l;const u=o.height||0;c0(u)?i.height*=parseFloat(u)/100:u<=0?i.height+=u:i.height=u;let h;const d=(a=(s=o.text)!==null&&s!==void 0?s:n.text)!==null&&a!==void 0?a:r==null?void 0:r.textContent;d!=null?h=V2e(`${d}`,i,{"font-weight":n["font-weight"]||n.fontWeight,"font-size":n["font-size"]||n.fontSize,"font-family":n["font-family"]||n.fontFamily,lineHeight:n.lineHeight},{ellipsis:o.ellipsis}):h="",vr(mbe.set,this,h,{view:e,elem:r,attrs:n,refBBox:i,cell:e.cell})}},n3=(t,{attrs:e})=>e.text!==void 0,Uit={qualify:n3},jit={qualify:n3},Yit={qualify:n3},Xit={qualify:n3},Kit={qualify:n3},Zit={qualify:n3},Qit={qualify(t,{elem:e}){return e instanceof SVGElement},set(t,{elem:e}){const r="x6-title",n=`${t}`,i=hy(e,r);if(i==null||i!==n){hy(e,r,n);const s=e.firstChild;if(s&&s.tagName.toUpperCase()==="TITLE"){const a=s;a.textContent=n}else{const a=document.createElementNS(e.namespaceURI,"title");a.textContent=n,e.insertBefore(a,s)}}}},Jit={offset:ybe("x","width","right")},est={offset:ybe("y","height","bottom")},tst={offset(t,{refBBox:e}){return t?{x:-e.x,y:-e.y}:{x:0,y:0}}};function ybe(t,e,r){return(n,{refBBox:i})=>{const s=new Qe;let a;return n==="middle"?a=i[e]/2:n===r?a=i[e]:typeof n=="number"&&Number.isFinite(n)?a=n>-1&&n<1?-i[e]*n:-n:c0(n)?a=i[e]*parseFloat(n)/100:a=0,s[t]=-(i[t]+a),s}}const rst={qualify:Nh,set(t,{elem:e}){ri(e,t)}},nst={set(t,{elem:e}){e.innerHTML=`${t}`}},ist={qualify:Nh,set(t,{view:e}){return`url(#${e.graph.defineFilter(t)})`}},sst={set(t){return t!=null&&typeof t=="object"&&t.id?t.id:t}},ast=t=>{var{size:e,width:r,height:n,offset:i,open:s}=t,a=gn(t,["size","width","height","offset","open"]);return vbe({size:e,width:r,height:n,offset:i},s===!0,!0,void 0,a)},ost=t=>{var{size:e,width:r,height:n,offset:i,factor:s}=t,a=gn(t,["size","width","height","offset","factor"]);return vbe({size:e,width:r,height:n,offset:i},!1,!1,s,a)};function vbe(t,e,r,n=3/4,i={}){const s=t.size||10,a=t.width||s,o=t.height||s,l=new ci,u={};if(e)l.moveTo(a,0).lineTo(0,o/2).lineTo(a,o),u.fill="none";else{if(l.moveTo(0,o/2),l.lineTo(a,0),!r){const h=Y1(n,0,1);l.lineTo(a*h,o/2)}l.lineTo(a,o),l.close()}return Object.assign(Object.assign(Object.assign({},u),i),{tagName:"path",d:e3(l.serialize(),{x:t.offset!=null?t.offset:-a/2})})}const lst=t=>{var{size:e,width:r,height:n,offset:i}=t,s=gn(t,["size","width","height","offset"]);const a=e||10,o=r||a,l=n||a,u=new ci;return u.moveTo(0,l/2).lineTo(o/2,0).lineTo(o,l/2).lineTo(o/2,l).close(),Object.assign(Object.assign({},s),{tagName:"path",d:e3(u.serialize(),i??-o/2)})},cst=t=>{var{d:e,offsetX:r,offsetY:n}=t,i=gn(t,["d","offsetX","offsetY"]);return Object.assign(Object.assign({},i),{tagName:"path",d:e3(e,r,n)})},ust=t=>{var{size:e,width:r,height:n,offset:i}=t,s=gn(t,["size","width","height","offset"]);const a=e||10,o=r||a,l=n||a,u=new ci;return u.moveTo(0,0).lineTo(o,l).moveTo(0,l).lineTo(o,0),Object.assign(Object.assign({},s),{tagName:"path",fill:"none",d:e3(u.serialize(),i||-o/2)})},hst=t=>{var{width:e,height:r,offset:n,open:i,flip:s}=t,a=gn(t,["width","height","offset","open","flip"]);let o=r||6;const l=e||10,u=i===!0,h=s===!0,d=Object.assign(Object.assign({},a),{tagName:"path"});h&&(o=-o);const f=new ci;return f.moveTo(0,o).lineTo(l,0),u?d.fill="none":(f.lineTo(l,o),f.close()),d.d=e3(f.serialize(),{x:n||-l/2,y:o/2}),d},bbe=t=>{var{r:e}=t,r=gn(t,["r"]);const n=e||5;return Object.assign(Object.assign({cx:n},r),{tagName:"circle",r:n})},dst=t=>{var{r:e}=t,r=gn(t,["r"]);const n=e||5,i=new ci;return i.moveTo(n,0).lineTo(n,n*2),i.moveTo(0,n).lineTo(n*2,n),{children:[Object.assign(Object.assign({},bbe({r:n})),{fill:"none"}),Object.assign(Object.assign({},r),{tagName:"path",d:e3(i.serialize(),-n)})]}},fst=t=>{var{rx:e,ry:r}=t,n=gn(t,["rx","ry"]);const i=e||5,s=r||5;return Object.assign(Object.assign({cx:i},n),{tagName:"ellipse",rx:i,ry:s})},pst=Object.freeze(Object.defineProperty({__proto__:null,async:hst,block:ast,circle:bbe,circlePlus:dst,classic:ost,cross:ust,diamond:lst,ellipse:fst,path:cst},Symbol.toStringTag,{value:"Module"})),gst=pst,VS=Zs.create({type:"marker"});VS.register(gst,!0);function BX(t){return typeof t=="string"||Nh(t)}const mst={qualify:BX,set(t,{view:e,attrs:r}){return FX("marker-start",t,e,r)}},yst={qualify:BX,set(t,{view:e,attrs:r}){return FX("marker-end",t,e,r,{transform:"rotate(180)"})}},vst={qualify:BX,set(t,{view:e,attrs:r}){return FX("marker-mid",t,e,r)}};function FX(t,e,r,n,i={}){const s=typeof e=="string"?{name:e}:e,{name:a,args:o}=s,l=gn(s,["name","args"]);let u=l;if(a&&typeof a=="string"){const d=VS.get(a);if(d)u=d(Object.assign(Object.assign({},l),o));else return VS.onNotFound(a)}const h=Object.assign(Object.assign(Object.assign({},bst(n,t)),i),u);return{[t]:`url(#${r.graph.defineMarker(h)})`}}function bst(t,e){const r={},n=t.stroke;if(typeof n=="string"&&(r.stroke=n,r.fill=n),e!=="marker-mid"){const i=parseFloat(t.strokeWidth||t["stroke-width"]);if(Number.isFinite(i)&&i>1){const s=Math.ceil(i/2);r.refX=e==="marker-start"?s:-s}}return r}const $6=(t,{view:e})=>e.cell.isEdge(),xst={qualify:$6,set(t,e){var r,n,i,s;const a=e.view,o=t.reverse||!1,l=t.stubs||0;let u;if(Number.isFinite(l)&&l!==0)if(o){let h,d;const f=a.getConnectionLength()||0;l<0?(h=(f+l)/2,d=-l):(h=l,d=f-l*2);const p=a.getConnection();u=(s=(i=(n=(r=p==null?void 0:p.divideAtLength(h))===null||r===void 0?void 0:r[1])===null||n===void 0?void 0:n.divideAtLength(d))===null||i===void 0?void 0:i[0])===null||s===void 0?void 0:s.serialize()}else{let h;l<0?h=((a.getConnectionLength()||0)+l)/2:h=l;const d=a.getConnection();if(d){const f=d.divideAtLength(h),p=d.divideAtLength(-h);f&&p&&(u=`${f[0].serialize()} ${p[1].serialize()}`)}}return{d:u||a.getConnectionPathData()}}},xbe={qualify:$6,set:CN("getTangentAtLength",{rotate:!0})},wst={qualify:$6,set:CN("getTangentAtLength",{rotate:!1})},wbe={qualify:$6,set:CN("getTangentAtRatio",{rotate:!0})},Tst={qualify:$6,set:CN("getTangentAtRatio",{rotate:!1})},Cst=xbe,kst=wbe;function CN(t,e){const r={x:1,y:0};return(n,i)=>{let s,a;const o=i.view,l=o[t](Number(n));return l?(a=e.rotate?l.vector().vectorAngle(r):0,s=l.start):(s=o.path.start,a=0),a===0||Number.isNaN(a)?{transform:`translate(${s.x},${s.y})`}:{transform:`translate(${s.x},${s.y}) rotate(${a})`}}}const Sst=Object.freeze(Object.defineProperty({__proto__:null,annotations:Xit,atConnectionLength:Cst,atConnectionLengthIgnoreGradient:wst,atConnectionLengthKeepGradient:xbe,atConnectionRatio:kst,atConnectionRatioIgnoreGradient:Tst,atConnectionRatioKeepGradient:wbe,connection:xst,displayEmpty:Zit,eol:Kit,fill:Git,filter:ist,html:nst,lineHeight:Uit,port:sst,ref:Eit,refCx:Iit,refCy:Nit,refD:$it,refDKeepOffset:Dit,refDResetOffset:hbe,refDx:Ait,refDy:Mit,refHeight:cbe,refHeight2:Hit,refPoints:Bit,refPointsKeepOffset:Oit,refPointsResetOffset:dbe,refR:Pit,refRCircumscribed:Lit,refRInscribed:ube,refRx:Rit,refRy:_it,refWidth:lbe,refWidth2:Vit,refX:abe,refX2:Fit,refY:obe,refY2:zit,resetOffset:tst,sourceMarker:mst,stroke:Wit,style:rst,targetMarker:yst,text:mbe,textPath:Yit,textVerticalAnchor:jit,textWrap:qit,title:Qit,vertexMarker:vst,xAlign:Jit,yAlign:est},Symbol.toStringTag,{value:"Module"})),Est={xlinkHref:"xlink:href",xlinkShow:"xlink:show",xlinkRole:"xlink:role",xlinkType:"xlink:type",xlinkArcrole:"xlink:arcrole",xlinkTitle:"xlink:title",xlinkActuate:"xlink:actuate",xmlSpace:"xml:space",xmlBase:"xml:base",xmlLang:"xml:lang",preserveAspectRatio:"preserveAspectRatio",requiredExtension:"requiredExtension",requiredFeatures:"requiredFeatures",systemLanguage:"systemLanguage",externalResourcesRequired:"externalResourceRequired"};function Ast(t,e,r){return!!(t!=null&&(typeof t=="string"||typeof t.qualify!="function"||vr(t.qualify,this,e,r)))}const Tbe=Object.assign(Object.assign({},Est),Sst),HS=Zs.create({type:"attribute definition"});HS.register(Tbe,!0);const Cbe=t=>{const e=document.createElement("canvas"),r=t.width,n=t.height;e.width=r*2,e.height=n;const i=e.getContext("2d");return i.drawImage(t,0,0,r,n),i.translate(2*r,0),i.scale(-1,1),i.drawImage(t,0,0,r,n),e},kbe=t=>{const e=document.createElement("canvas"),r=t.width,n=t.height;e.width=r,e.height=n*2;const i=e.getContext("2d");return i.drawImage(t,0,0,r,n),i.translate(0,2*n),i.scale(1,-1),i.drawImage(t,0,0,r,n),e},Sbe=t=>{const e=document.createElement("canvas"),r=t.width,n=t.height;e.width=2*r,e.height=2*n;const i=e.getContext("2d");return i.drawImage(t,0,0,r,n),i.setTransform(-1,0,0,-1,e.width,e.height),i.drawImage(t,0,0,r,n),i.setTransform(-1,0,0,1,e.width,0),i.drawImage(t,0,0,r,n),i.setTransform(1,0,0,-1,0,e.height),i.drawImage(t,0,0,r,n),e},Mst=(t,e)=>{const r=t.width,n=t.height,i=document.createElement("canvas");i.width=r*3,i.height=n*3;const s=i.getContext("2d"),a=e.angle!=null?-e.angle:-20,o=Fo(a),l=i.width/4,u=i.height/4;for(let h=0;h<4;h+=1)for(let d=0;d<4;d+=1)(h+d)%2>0&&(s.setTransform(1,0,0,1,(2*h-1)*l,(2*d-1)*u),s.rotate(o),s.drawImage(t,-r/2,-n/2,r,n));return i},Rst=Object.freeze(Object.defineProperty({__proto__:null,flipX:Cbe,flipXY:Sbe,flipY:kbe,watermark:Mst},Symbol.toStringTag,{value:"Module"})),kN=Object.assign({},Rst);kN["flip-x"]=Cbe;kN["flip-y"]=kbe;kN["flip-xy"]=Sbe;const SN=Zs.create({type:"background pattern"});SN.register(kN,!0);function EN(t,e,r){let n;if(typeof r=="object"){if(Number.isFinite(r.y)){const s=new lr(e,t),{start:a,end:o}=s.parallel(r.y);e=a,t=o}n=r.x}else n=r;if(n==null||!Number.isFinite(n))return t;const i=t.distance(e);return n===0&&i>0?t:t.move(e,-Math.min(n,i-1))}function p9(t){const e=t.getAttribute("stroke-width");return e===null?0:parseFloat(e)||0}function _st(t){if(t==null)return null;let e=t;do{let r=e.tagName;if(typeof r!="string")return null;if(r=r.toUpperCase(),r==="G")e=e.firstElementChild;else if(r==="TITLE")e=e.nextElementSibling;else break}while(e);return e}const Ebe=(t,e,r,n)=>{const i=e.getBBoxOfElement(r);n.stroked&&i.inflate(p9(r)/2);const s=t.intersect(i),a=s&&s.length?t.start.closest(s):t.end;return EN(a,t.start,n.offset)},Lst=function(t,e,r,n,i){const s=e.cell,a=s.isNode()?s.getAngle():0;if(a===0)return vr(Ebe,this,t,e,r,n,i);const o=e.getUnrotatedBBoxOfElement(r);n.stroked&&o.inflate(p9(r)/2);const l=o.getCenter(),u=t.clone().rotate(a,l),h=u.setLength(1e6).intersect(o),d=h&&h.length?u.start.closest(h).rotate(-a,l):t.end;return EN(d,t.start,n.offset)},Ist=(t,e,r,n)=>{let i,s;const a=t.end,o=n.selector;if(typeof o=="string"?i=e.findOne(o):Array.isArray(o)?i=DX(r,o):i=_st(r),!dg(i)){if(i===r||!dg(r))return a;i=r}const l=e.getShapeOfElement(i),u=e.getMatrixOfElement(i),h=e.getRootTranslatedMatrix(),d=e.getRootRotatedMatrix(),f=h.multiply(d).multiply(u),p=f.inverse(),g=Ont(t,p),m=g.start.clone(),y=e.getDataOfElement(i);if(n.insideout===!1){y.shapeBBox==null&&(y.shapeBBox=l.bbox());const T=y.shapeBBox;if(T!=null&&T.containsPoint(m))return a}n.extrapolate===!0&&g.setLength(1e6);let v;if(ci.isPath(l)){const T=n.precision||2;y.segmentSubdivisions==null&&(y.segmentSubdivisions=l.getSegmentSubdivisions({precision:T})),v={precision:T,segmentSubdivisions:y.segmentSubdivisions},s=g.intersect(l,v)}else s=g.intersect(l);s?Array.isArray(s)&&(s=m.closest(s)):n.sticky===!0&&(Bt.isRectangle(l)?s=l.getNearestPointToPoint(m):rc.isEllipse(l)?s=l.intersectsWithLineFromCenterToPoint(m):s=l.closestPoint(m,v));const x=s?Df(s,f):a;let b=n.offset||0;return n.stroked!==!1&&(typeof b=="object"?(b=Object.assign({},b),b.x==null&&(b.x=0),b.x+=p9(i)/2):b+=p9(i)/2),EN(x,t.start,b)};function Nst(t,e,r=0){const{start:n,end:i}=t;let s,a,o,l;switch(e){case"left":l="x",s=i,a=n,o=-1;break;case"right":l="x",s=n,a=i,o=1;break;case"top":l="y",s=i,a=n,o=-1;break;case"bottom":l="y",s=n,a=i,o=1;break;default:return}n[l]<i[l]?s[l]=a[l]:a[l]=s[l],Number.isFinite(r)&&(s[l]+=o*r,a[l]+=o*r)}const Dst=(t,e,r,n)=>{const{alignOffset:i,align:s}=n;return s&&Nst(t,s,i),EN(t.end,t.start,n.offset)},Ost=Object.freeze(Object.defineProperty({__proto__:null,anchor:Dst,bbox:Ebe,boundary:Ist,rect:Lst},Symbol.toStringTag,{value:"Module"})),Pst=Ost,GS=Zs.create({type:"connection point"});GS.register(Pst,!0);const Sse=1,h7=1/3,d7=2/3;let WS=[],g9=[];function $st(t){let e=t.graph._jumpOverUpdateList;if(e==null&&(e=t.graph._jumpOverUpdateList=[],t.graph.on("cell:mouseup",()=>{const r=t.graph._jumpOverUpdateList;setTimeout(()=>{for(let n=0;n<r.length;n+=1)r[n].update()})}),t.graph.on("model:reseted",()=>{e=t.graph._jumpOverUpdateList=[]})),e.indexOf(t)<0){e.push(t);const r=()=>e.splice(e.indexOf(t),1);t.cell.once("change:connector",r),t.cell.once("removed",r)}}function s$(t,e,r=[]){const n=[t,...r,e],i=[];return n.forEach((s,a)=>{const o=n[a+1];o!=null&&i.push(new lr(s,o))}),i}function Bst(t,e){const r=[];return e.forEach(n=>{const i=t.intersectsWithLine(n);if(i){const{x:s,y:a}=i,{start:o,end:l}=n,u=Math.round(o.x)===Math.round(s)&&Math.round(o.y)===Math.round(a),h=Math.round(l.x)===Math.round(s)&&Math.round(l.y)===Math.round(a);if(u||h)return;r.push(i)}}),r}function Ese(t,e){return new lr(t,e).squaredLength()}function Fst(t,e,r){return e.reduce((n,i,s)=>{if(g9.includes(i))return n;const a=n.pop()||t,o=Qe.create(i).move(a.start,-r);let l=Qe.create(i).move(a.start,+r);const u=e[s+1];if(u!=null){const f=l.distance(u);f<=r&&(l=u.move(a.start,f),g9.push(u))}else if(o.distance(a.end)<r*2+Sse)return n.push(a),n;if(l.distance(a.start)<r*2+Sse)return n.push(a),n;const d=new lr(o,l);return WS.push(d),n.push(new lr(a.start,o),d,new lr(l,a.end)),n},[])}function Ase(t,e,r,n){const i=new ci;let s;return s=ci.createSegment("M",t[0].start),i.appendSegment(s),t.forEach((a,o)=>{if(WS.includes(a)){let l,u,h,d;if(r==="arc"){l=-90,u=a.start.diff(a.end),(u.x<0||u.x===0&&u.y<0)&&(l+=180);const p=a.getCenter(),g=new lr(p,a.end).rotate(l,p);let m;m=new lr(a.start,p),h=m.pointAt(2/3).rotate(l,a.start),d=g.pointAt(1/3).rotate(-l,g.end),s=ci.createSegment("C",h,d,g.end),i.appendSegment(s),m=new lr(p,a.end),h=g.pointAt(1/3).rotate(l,g.end),d=m.pointAt(1/3).rotate(-l,a.end),s=ci.createSegment("C",h,d,a.end),i.appendSegment(s)}else if(r==="gap")s=ci.createSegment("M",a.end),i.appendSegment(s);else if(r==="cubic"){l=a.start.theta(a.end);const f=e*.6;let p=e*1.35;u=a.start.diff(a.end),(u.x<0||u.x===0&&u.y<0)&&(p*=-1),h=new Qe(a.start.x+f,a.start.y+p).rotate(l,a.start),d=new Qe(a.end.x-f,a.end.y+p).rotate(l,a.end),s=ci.createSegment("C",h,d,a.end),i.appendSegment(s)}}else{const l=t[o+1];n===0||!l||WS.includes(l)?(s=ci.createSegment("L",a.end),i.appendSegment(s)):zst(n,i,a.end,a.start,l.end)}}),i}function zst(t,e,r,n,i){const s=r.distance(n)/2,a=r.distance(i)/2,o=-Math.min(t,s),l=-Math.min(t,a),u=r.clone().move(n,o).round(),h=r.clone().move(i,l).round(),d=new Qe(h7*u.x+d7*r.x,d7*r.y+h7*u.y),f=new Qe(h7*h.x+d7*r.x,d7*r.y+h7*h.y);let p;p=ci.createSegment("L",u),e.appendSegment(p),p=ci.createSegment("C",d,f,h),e.appendSegment(p)}const Vst=function(t,e,r,n={}){WS=[],g9=[],$st(this);const i=n.size||5,s=n.type||"arc",a=n.radius||0,o=n.ignoreConnectors||["smooth"],l=this.graph,h=l.model.getEdges();if(h.length===1)return Ase(s$(t,e,r),i,s,a);const d=this.cell,f=h.indexOf(d),p=l.options.connecting.connector||{},g=h.filter((T,C)=>{const S=T.getConnector()||p;return o.includes(S.name)?!1:C>f?S.name!=="jumpover":!0}),m=g.map(T=>l.findViewByCell(T)),y=s$(t,e,r),v=m.map(T=>T==null?[]:T===this?y:s$(T.sourcePoint,T.targetPoint,T.routePoints)),x=[];y.forEach(T=>{const C=g.reduce((S,k,E)=>{if(k!==d){const A=Bst(T,v[E]);S.push(...A)}return S},[]).sort((S,k)=>Ese(T.start,S)-Ese(T.start,k));C.length>0?x.push(...Fst(T,C,i)):x.push(T)});const b=Ase(x,i,s,a);return WS=[],g9=[],n.raw?b:b.serialize()},Hst=(t,e,r,n={})=>{const i=r.length===3?0:1,s=Qe.create(r[0+i]),a=Qe.create(r[2+i]),o=Qe.create(r[1+i]);if(!Qe.equals(t,e)){const u=new Qe((t.x+e.x)/2,(t.y+e.y)/2),h=u.angleBetween(Qe.create(t).rotate(90,u),o);h>1&&(s.rotate(180-h,u),a.rotate(180-h,u),o.rotate(180-h,u))}const l=`@@ -1173,7 +1173,7 @@ Please report this to https://github.com/markedjs/marked.`,e){let i="<p>An errora${i},${s} 0,0,0 0,${n}l${-r},0`,"createCylinderPathD"),v3t=w((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"),b3t=w((t,e,r,n,i,s)=>[`M${t+r/2},${-n/2}`,`a${i},${s} 0,0,0 0,${n}`].join(" "),"createInnerCylinderPathD"),Nce=5,Dce=10;async function USe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?12:i/2;if(e.width||e.height){const m=e.height??0;e.height=(e.height??0)-s,e.height<Nce&&(e.height=Nce);const v=m/2/(2.5+m/50);e.width=(e.width??0)-s-v*3,e.width<Dce&&(e.width=Dce)}const{shapeSvg:a,bbox:o,label:l}=await Qr(t,e,Wr(e)),u=(e.height?e.height:o.height)+s,h=u/2,d=h/(2.5+u/50),f=(e.width?e.width:o.width)+d+s,{cssStyles:p}=e;let g;if(e.look==="handDrawn"){const m=dr.svg(a),y=v3t(0,0,f,u,d,h),v=b3t(0,0,f,u,d,h),x=m.path(y,fr(e,{})),b=m.path(v,fr(e,{fill:"none"}));g=a.insert(()=>b,":first-child"),g=a.insert(()=>x,":first-child"),g.attr("class","basic label-container"),p&&g.attr("style",p)}else{const m=y3t(0,0,f,u,d,h);g=a.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",Xa(p)).attr("style",n),g.attr("class","basic label-container outer-path"),p&&g.selectAll("path").attr("style",p),n&&g.selectAll("path").attr("style",n)}return g.attr("label-offset-x",d),g.attr("transform",`translate(${-f/2}, ${u/2} )`),l.attr("transform",`translate(${-(o.width/2)-d-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),Tr(e,g),e.intersect=function(m){const y=or.rect(e,m),v=y.y-(e.y??0);if(h!=0&&(Math.abs(v)<(e.height??0)/2||Math.abs(v)==(e.height??0)/2&&Math.abs(y.x-(e.x??0))>(e.width??0)/2-d)){let x=d*d*(1-v*v/(h*h));x!=0&&(x=Math.sqrt(Math.abs(x))),x=d-x,m.x-(e.x??0)>0&&(x=-x),y.x+=x}return y},a}w(USe,"tiltedCylinder");async function jSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=(e.look==="neo",i),a=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await Qr(t,e,Wr(e)),u=((e==null?void 0:e.height)??l.height)+s,h=((e==null?void 0:e.width)??l.width)+a,d=[{x:-3*u/6,y:0},{x:h+3*u/6,y:0},{x:h,y:-u},{x:0,y:-u}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=dr.svg(o),m=fr(e,{}),y=Fn(d),v=g.path(y,m);f=o.insert(()=>v,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=W0(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,Tr(e,f),e.intersect=function(g){return or.polygon(e,d,g)},o}w(jSe,"trapezoid");async function YSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?16:i,a=e.look==="neo"?12:i,o=15,l=5;(e.width||e.height)&&(e.height=(e.height??0)-a*2,e.height<l&&(e.height=l),e.width=(e.width??0)-s*2,e.width<o&&(e.width=o));const{shapeSvg:u,bbox:h}=await Qr(t,e,Wr(e)),d=(e!=null&&e.width?e==null?void 0:e.width:h.width)+s*2,f=(e!=null&&e.height?e==null?void 0:e.height:h.height)+a*2,{cssStyles:p}=e,g=dr.svg(u),m=fr(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-d/2*.8,y:-f/2},{x:d/2*.8,y:-f/2},{x:d/2,y:-f/2*.6},{x:d/2,y:f/2},{x:-d/2,y:f/2},{x:-d/2,y:-f/2*.6}],v=Fn(y),x=g.path(v,m),b=u.insert(()=>x,":first-child");return b.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),Tr(e,b),e.intersect=function(T){return or.polygon(e,y,T)},u}w(YSe,"trapezoidalPentagon");var Oce=10,Pce=10;async function XSe(t,e){var T;const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?i*2:i;(e.width||e.height)&&(e.width=(((e==null?void 0:e.width)??0)-s)/2,e.width<Pce&&(e.width=Pce),e.height=(e==null?void 0:e.height)??0,e.height<Oce&&(e.height=Oce));const{shapeSvg:a,bbox:o,label:l}=await Qr(t,e,Wr(e)),u=Wd((T=Ve().flowchart)==null?void 0:T.htmlLabels),h=(e!=null&&e.width?e==null?void 0:e.width:o.width)+s,d=e!=null&&e.height?e==null?void 0:e.height:h+o.height,f=d,p=[{x:0,y:0},{x:f,y:0},{x:f/2,y:-d}],{cssStyles:g}=e,m=dr.svg(a),y=fr(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=Fn(p),x=m.path(v,y),b=a.insert(()=>x,":first-child").attr("transform",`translate(${-d/2}, ${d/2})`).attr("class","outer-path");return g&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",g),n&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),e.width=h,e.height=d,Tr(e,b),l.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${d/2-(o.height+(e.padding??0)/(u?2:1)-(o.y-(o.top??0)))})`),e.intersect=function(C){return de.info("Triangle intersect",e,p,C),or.polygon(e,p,C)},a}w(XSe,"triangle");async function KSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?16:i,a=e.look==="neo"?12:i;let o=!0;(e.width||e.height)&&(o=!1,e.width=((e==null?void 0:e.width)??0)-s*2,e.width<10&&(e.width=10),e.height=((e==null?void 0:e.height)??0)-a*2,e.height<10&&(e.height=10));const{shapeSvg:l,bbox:u,label:h}=await Qr(t,e,Wr(e)),d=(e!=null&&e.width?e==null?void 0:e.width:u.width)+(s??0)*2,f=(e!=null&&e.height?e==null?void 0:e.height:u.height)+(a??0)*2,p=e.look==="neo"?f/4:f/8,g=f+(o?p:-p),{cssStyles:m}=e,v=14-d,x=v>0?v/2:0,b=dr.svg(l),T=fr(e,{});e.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const C=[{x:-d/2-x,y:g/2},...wg(-d/2-x,g/2,d/2+x,g/2,p,.8),{x:d/2+x,y:-g/2},{x:-d/2-x,y:-g/2}],S=Fn(C),k=b.path(S,T),E=l.insert(()=>k,":first-child");return E.attr("class","basic label-container outer-path"),m&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",m),n&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",n),E.attr("transform",`translate(0,${-p/2})`),h.attr("transform",`translate(${-d/2+(e.padding??0)-(u.x-(u.left??0))},${-f/2+(e.padding??0)-p-(u.y-(u.top??0))})`),Tr(e,E),e.intersect=function(A){return or.polygon(e,C,A)},l}w(KSe,"waveEdgedRectangle");async function ZSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?16:i,a=e.look==="neo"?20:i;if(e.width||e.height){e.width=(e==null?void 0:e.width)??0,e.width<20&&(e.width=20),e.height=(e==null?void 0:e.height)??0,e.height<10&&(e.height=10);const T=Math.min(e.height*.2,e.height/4);e.height=Math.ceil(e.height-a-T*(20/9)),e.width=e.width-s*2}const{shapeSvg:o,bbox:l}=await Qr(t,e,Wr(e)),u=(e!=null&&e.width?e==null?void 0:e.width:l.width)+s*2,h=(e!=null&&e.height?e==null?void 0:e.height:l.height)+a,d=h/8,f=h+d*2,{cssStyles:p}=e,g=dr.svg(o),m=fr(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-u/2,y:f/2},...wg(-u/2,f/2,u/2,f/2,d,1),{x:u/2,y:-f/2},...wg(u/2,-f/2,-u/2,-f/2,d,-1)],v=Fn(y),x=g.path(v,m),b=o.insert(()=>x,":first-child");return 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),Tr(e,b),e.intersect=function(T){return or.polygon(e,y,T)},o}w(ZSe,"waveRectangle");var As=10;async function QSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.look==="neo"?16:e.padding??0,s=e.look==="neo"?12:e.padding??0;(e.width||e.height)&&(e.width=Math.max(((e==null?void 0:e.width)??0)-i*2-As,10),e.height=Math.max(((e==null?void 0:e.height)??0)-s*2-As,10));const{shapeSvg:a,bbox:o,label:l}=await Qr(t,e,Wr(e)),u=(e!=null&&e.width?e==null?void 0:e.width:o.width)+i*2+As,h=(e!=null&&e.height?e==null?void 0:e.height:o.height)+s*2+As,d=u-As,f=h-As,p=-d/2,g=-f/2,{cssStyles:m}=e,y=dr.svg(a),v=fr(e,{}),x=[{x:p-As,y:g-As},{x:p-As,y:g+f},{x:p+d,y:g+f},{x:p+d,y:g-As}],b=`M${p-As},${g-As} L${p+d},${g-As} L${p+d},${g+f} L${p-As},${g+f} L${p-As},${g-As}M${p-As},${g} L${p+d},${g}- M${p},${g-As} L${p},${g+f}`;e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const T=y.path(b,v),C=a.insert(()=>T,":first-child");return C.attr("transform",`translate(${As/2}, ${As/2})`),C.attr("class","basic label-container outer-path"),m&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",m),n&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",n),l.attr("transform",`translate(${-(o.width/2)+As/2-(o.x-(o.left??0))}, ${-(o.height/2)+As/2-(o.y-(o.top??0))})`),Tr(e,C),e.intersect=function(S){return or.polygon(e,x,S)},a}w(QSe,"windowPane");var $ce=new Set(["redux-color","redux-dark-color"]),x3t=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function DZ(t,e){var K,q,oe,Q;const r=e;r.alias&&(e.label=r.alias);const{theme:n,themeVariables:i}=xr(),{rowEven:s,rowOdd:a,nodeBorder:o,borderColorArray:l}=i;if(e.look==="handDrawn"){const{themeVariables:Z}=xr(),{background:re}=Z,ie={...e,id:e.id+"-background",domId:(e.domId||e.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${re}`]};await DZ(t,ie)}const u=xr();e.useHtmlLabels=u.htmlLabels;let h=((K=u.er)==null?void 0:K.diagramPadding)??10,d=((q=u.er)==null?void 0:q.entityPadding)??6;const{cssStyles:f}=e,{labelStyles:p,nodeStyles:g}=cr(e);if(r.attributes.length===0&&e.label){const Z={rx:0,ry:0,labelPaddingX:h,labelPaddingY:h*1.5};Al(e.label,u)+Z.labelPaddingX*2<u.er.minEntityWidth&&(e.width=u.er.minEntityWidth);const re=await u3(t,e,Z);if(n!=null&&$ce.has(n)){const ie=r.colorIndex??0;re.attr("data-color-id",`color-${ie%l.length}`)}if(!Wd(u.htmlLabels)){const ie=re.select("text"),me=(oe=ie.node())==null?void 0:oe.getBBox();ie.attr("transform",`translate(${-me.width/2}, 0)`)}return re}u.htmlLabels||(h*=1.25,d*=1.25);let m=Wr(e);m||(m="node default");const y=t.insert("g").attr("class",m).attr("id",e.domId||e.id),v=await C2(y,e.label??"",u,0,0,["name"],p);v.height+=d;let x=0;const b=[],T=[];let C=0,S=0,k=0,E=0,A=!0,R=!0;for(const Z of r.attributes){const re=await C2(y,Z.type,u,0,x,["attribute-type"],p);C=Math.max(C,re.width+h);const ie=await C2(y,Z.name,u,0,x,["attribute-name"],p);S=Math.max(S,ie.width+h);const me=await C2(y,Z.keys.join(),u,0,x,["attribute-keys"],p);k=Math.max(k,me.width+h);const te=await C2(y,Z.comment,u,0,x,["attribute-comment"],p);E=Math.max(E,te.width+h);const _e=Math.max(re.height,ie.height,me.height,te.height)+d;T.push({yOffset:x,rowHeight:_e}),x+=_e}let _=4;k<=h&&(A=!1,k=0,_--),E<=h&&(R=!1,E=0,_--);const P=y.node().getBBox();if(v.width+h*2-(C+S+k+E)>0){const Z=v.width+h*2-(C+S+k+E);C+=Z/_,S+=Z/_,k>0&&(k+=Z/_),E>0&&(E+=Z/_)}const N=C+S+k+E,L=dr.svg(y),I=fr(e,{});e.look!=="handDrawn"&&(I.roughness=0,I.fillStyle="solid");let $=0;T.length>0&&($=T.reduce((Z,re)=>Z+((re==null?void 0:re.rowHeight)??0),0));const O=Math.max(P.width+h*2,(e==null?void 0:e.width)||0,N),D=Math.max(($??0)+v.height,(e==null?void 0:e.height)||0),F=-O/2,z=-D/2;if(y.selectAll("g:not(:first-child)").each((Z,re,ie)=>{const me=wt(ie[re]),te=me.attr("transform");let _e=0,$e=0;if(te){const ce=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(te);ce&&(_e=parseFloat(ce[1]),$e=parseFloat(ce[2]),me.attr("class").includes("attribute-name")?_e+=C:me.attr("class").includes("attribute-keys")?_e+=C+S:me.attr("class").includes("attribute-comment")&&(_e+=C+S+k))}me.attr("transform",`translate(${F+h/2+_e}, ${$e+z+v.height+d/2})`)}),y.select(".name").attr("transform","translate("+-v.width/2+", "+(z+d/2)+")"),n!=null&&$ce.has(n)){const Z=r.colorIndex??0;y.attr("data-color-id",`color-${Z%l.length}`)}const V=L.rectangle(F,z,O,D,I),B=y.insert(()=>V,":first-child").attr("class","outer-path").attr("style",f.join(""));b.push(0);for(const[Z,re]of T.entries()){const me=(Z+1)%2===0&&re.yOffset!==0,te=L.rectangle(F,v.height+z+(re==null?void 0:re.yOffset),O,re==null?void 0:re.rowHeight,{...I,fill:me?s:a,stroke:o});y.insert(()=>te,"g.label").attr("style",f.join("")).attr("class",`row-rect-${me?"even":"odd"}`)}const H=1e-4;let G=k2(F,v.height+z,O+F,v.height+z,H),W=L.polygon(G.map(Z=>[Z.x,Z.y]),I);if(y.insert(()=>W).attr("class","divider"),G=k2(C+F,v.height+z,C+F,D+z,H),W=L.polygon(G.map(Z=>[Z.x,Z.y]),I),y.insert(()=>W).attr("class","divider"),A){const Z=C+S+F;G=k2(Z,v.height+z,Z,D+z,H),W=L.polygon(G.map(re=>[re.x,re.y]),I),y.insert(()=>W).attr("class","divider")}if(R){const Z=C+S+k+F;G=k2(Z,v.height+z,Z,D+z,H),W=L.polygon(G.map(re=>[re.x,re.y]),I),y.insert(()=>W).attr("class","divider")}for(const Z of b){const re=v.height+z+Z;G=k2(F,re,O+F,re,H),W=L.polygon(G.map(ie=>[ie.x,ie.y]),I),y.insert(()=>W).attr("class","divider")}if(Tr(e,B),g&&e.look!=="handDrawn")if(n!=null&&x3t.has(n))y.selectAll("path").attr("style",g);else{const Z=g.split(";"),re=(Q=Z==null?void 0:Z.filter(ie=>ie.includes("stroke")))==null?void 0:Q.map(ie=>`${ie}`).join("; ");y.selectAll("path").attr("style",re??""),y.selectAll(".row-rect-even path").attr("style",g)}return e.intersect=function(Z){return or.rect(e,Z)},y}w(DZ,"erBox");async function C2(t,e,r,n=0,i=0,s=[],a=""){const o=t.insert("g").attr("class",`label ${s.join(" ")}`).attr("transform",`translate(${n}, ${i})`).attr("style",a);e!==Ep(e)&&(e=Ep(e),e=e.replaceAll("<","<").replaceAll(">",">"));const l=o.node().appendChild(await Qo(o,e,{width:Al(e,r)+100,style:a,useHtmlLabels:r.htmlLabels},r));if(e.includes("<")||e.includes(">")){let h=l.children[0];for(h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">");h.childNodes[0];)h=h.childNodes[0],h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">")}let u=l.getBBox();if(Wd(r.htmlLabels)){const h=l.children[0];h.style.textAlign="start";const d=wt(l);u=h.getBoundingClientRect(),d.attr("width",u.width),d.attr("height",u.height)}return u}w(C2,"addText");function k2(t,e,r,n,i){return t===r?[{x:t-i/2,y:e},{x:t+i/2,y:e},{x:r+i/2,y:n},{x:r-i/2,y:n}]:[{x:t,y:e-i/2},{x:t,y:e+i/2},{x:r,y:n+i/2},{x:r,y:n-i/2}]}w(k2,"lineToPolygon");async function JSe(t,e,r,n,i=r.class.padding??12){const s=n?0:3,a=t.insert("g").attr("class",Wr(e)).attr("id",e.domId||e.id);let o=null,l=null,u=null,h=null,d=0,f=0,p=0;if(o=a.insert("g").attr("class","annotation-group text"),e.annotations.length>0){const x=e.annotations[0];await KC(o,{text:`«${x}»`},0),d=o.node().getBBox().height}l=a.insert("g").attr("class","label-group text"),await KC(l,e,0,["font-weight: bolder"]);const g=l.node().getBBox();f=g.height,u=a.insert("g").attr("class","members-group text");let m=0;for(const x of e.members){const b=await KC(u,x,m,[x.parseClassifier()]);m+=b+s}p=u.node().getBBox().height,p<=0&&(p=i/2),h=a.insert("g").attr("class","methods-group text");let y=0;for(const x of e.methods){const b=await KC(h,x,y,[x.parseClassifier()]);y+=b+s}let v=a.node().getBBox();if(o!==null){const x=o.node().getBBox();o.attr("transform",`translate(${-x.width/2})`)}return l.attr("transform",`translate(${-g.width/2}, ${d})`),v=a.node().getBBox(),u.attr("transform",`translate(0, ${d+f+i*2})`),v=a.node().getBBox(),h.attr("transform",`translate(0, ${d+f+(p?p+i*4:i*2)})`),v=a.node().getBBox(),{shapeSvg:a,bbox:v}}w(JSe,"textHelper");async function KC(t,e,r,n=[]){const i=t.insert("g").attr("class","label").attr("style",n.join("; ")),s=xr();let a="useHtmlLabels"in e?e.useHtmlLabels:Wd(s.htmlLabels)??!0,o="";"text"in e?o=e.text:o=e.label,!a&&o.startsWith("\\")&&(o=o.substring(1)),Ks(o)&&(a=!0);const l=await Qo(i,PK(m0(o)),{width:Al(o,s)+50,classes:"markdown-node-label",useHtmlLabels:a},s);let u,h=1;if(a){const d=l.children[0],f=wt(l);h=d.innerHTML.split("<br>").length,d.innerHTML.includes("</math>")&&(h+=d.innerHTML.split("<mrow>").length-1);const p=d.getElementsByTagName("img");if(p){const g=o.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...p].map(m=>new Promise(y=>{function v(){var x;if(m.style.display="flex",m.style.flexDirection="column",g){const b=((x=s.fontSize)==null?void 0:x.toString())??window.getComputedStyle(document.body).fontSize,C=parseInt(b,10)*5+"px";m.style.minWidth=C,m.style.maxWidth=C}else m.style.width="100%";y(m)}w(v,"setupImage"),setTimeout(()=>{m.complete&&v()}),m.addEventListener("error",v),m.addEventListener("load",v)})))}u=d.getBoundingClientRect(),f.attr("width",u.width),f.attr("height",u.height)}else{n.includes("font-weight: bolder")&&wt(l).selectAll("tspan").attr("font-weight",""),h=l.children.length;const d=l.children[0];(l.textContent===""||l.textContent.includes(">"))&&(d.textContent=o[0]+o.substring(1).replaceAll(">",">").replaceAll("<","<").trim(),o[1]===" "&&(d.textContent=d.textContent[0]+" "+d.textContent.substring(1))),d.textContent==="undefined"&&(d.textContent=""),u=l.getBBox()}return i.attr("transform","translate(0,"+(-u.height/(2*h)+r)+")"),u.height}w(KC,"addText");async function eEe(t,e){var L,I;const r=Ve(),{themeVariables:n}=r,{useGradient:i}=n,s=r.class.padding??12,a=s,o=e.useHtmlLabels??Wd(r.htmlLabels)??!0,l=e;l.annotations=l.annotations??[],l.members=l.members??[],l.methods=l.methods??[];const{shapeSvg:u,bbox:h}=await JSe(t,e,r,o,a),{labelStyles:d,nodeStyles:f}=cr(e);e.labelStyle=d,e.cssStyles=l.styles||"";const p=((L=l.styles)==null?void 0:L.join(";"))||f||"";e.cssStyles||(e.cssStyles=p.replaceAll("!important","").split(";"));const g=l.members.length===0&&l.methods.length===0&&!((I=r.class)!=null&&I.hideEmptyMembersBox),m=dr.svg(u),y=fr(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=Math.max(e.width??0,h.width);let x=Math.max(e.height??0,h.height);const b=(e.height??0)>h.height;l.members.length===0&&l.methods.length===0?x+=a:l.members.length>0&&l.methods.length===0&&(x+=a*2);const T=-v/2,C=-x/2;let S=g?s*2:l.members.length===0&&l.methods.length===0?-s:0;b&&(S=s*2);const k=m.rectangle(T-s,C-s-(g?s:l.members.length===0&&l.methods.length===0?-s/2:0),v+2*s,x+2*s+S,y),E=u.insert(()=>k,":first-child");E.attr("class","basic label-container outer-path");const A=E.node().getBBox(),R=u.select(".annotation-group").node().getBBox().height-(g?s/2:0)||0,_=u.select(".label-group").node().getBBox().height-(g?s/2:0)||0,P=u.select(".members-group").node().getBBox().height-(g?s/2:0)||0,N=(R+_+C+s-(C-s-(g?s:l.members.length===0&&l.methods.length===0?-s/2:0)))/2;if(u.selectAll(".text").each(($,O,D)=>{var G,W;const F=wt(D[O]),z=F.attr("transform");let V=0;if(z){const q=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(z);q&&(V=parseFloat(q[2]))}let B=V+C+s-(g?s:l.members.length===0&&l.methods.length===0?-s/2:0);if(F.attr("class").includes("methods-group")){const K=Math.max(P,a/2);b?B=Math.max(N,R+_+K+C+a*2+s)+a*2:B=R+_+K+C+a*4+s}l.members.length===0&&l.methods.length===0&&((G=r.class)!=null&&G.hideEmptyMembersBox)&&(l.annotations.length>0?B=V-a:B=V),o||(B-=4);let H=T;(F.attr("class").includes("label-group")||F.attr("class").includes("annotation-group"))&&(H=-((W=F.node())==null?void 0:W.getBBox().width)/2||0,u.selectAll("text").each(function(K,q,oe){window.getComputedStyle(oe[q]).textAnchor==="middle"&&(H=0)})),F.attr("transform",`translate(${H}, ${B})`)}),l.members.length>0||l.methods.length>0||g){const $=R+_+C+s,O=m.line(A.x,$,A.x+A.width,$+.001,y);u.insert(()=>O).attr("class",`divider${e.look==="neo"&&!i?" neo-line":""}`).attr("style",p)}if(g||l.members.length>0||l.methods.length>0){const $=R+_+P+C+a*2+s,O=m.line(A.x,b?Math.max(N,$):$,A.x+A.width,(b?Math.max(N,$):$)+.001,y);u.insert(()=>O).attr("class",`divider${e.look==="neo"&&!i?" neo-line":""}`).attr("style",p)}if(l.look!=="handDrawn"&&u.selectAll("path").attr("style",p),E.select(":nth-child(2)").attr("style",p),u.selectAll(".divider").select("path").attr("style",p),e.labelStyle?u.selectAll("span").attr("style",e.labelStyle):u.selectAll("span").attr("style",p),!o){const $=RegExp(/color\s*:\s*([^;]*)/),O=$.exec(p);if(O){const D=O[0].replace("color","fill");u.selectAll("tspan").attr("style",D)}else if(d){const D=$.exec(d);if(D){const F=D[0].replace("color","fill");u.selectAll("tspan").attr("style",F)}}}return Tr(e,E),e.intersect=function($){return or.rect(e,$)},u}w(eEe,"classBox");async function tEe(t,e){var A,R;const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e,s=e,a=20,o=20,l="verifyMethod"in e,u=Wr(e),{themeVariables:h}=Ve(),{borderColorArray:d,requirementEdgeLabelBackground:f}=h,p=t.insert("g").attr("class",u).attr("id",e.domId??e.id);let g;l?g=await Uh(p,`<<${i.type}>>`,0,e.labelStyle):g=await Uh(p,"<<Element>>",0,e.labelStyle);let m=g;const y=await Uh(p,i.name,m,e.labelStyle+"; font-weight: bold;");if(m+=y+o,l){const _=await Uh(p,`${i.requirementId?`ID: ${i.requirementId}`:""}`,m,e.labelStyle);m+=_;const P=await Uh(p,`${i.text?`Text: ${i.text}`:""}`,m,e.labelStyle);m+=P;const N=await Uh(p,`${i.risk?`Risk: ${i.risk}`:""}`,m,e.labelStyle);m+=N,await Uh(p,`${i.verifyMethod?`Verification: ${i.verifyMethod}`:""}`,m,e.labelStyle)}else{const _=await Uh(p,`${s.type?`Type: ${s.type}`:""}`,m,e.labelStyle);m+=_,await Uh(p,`${s.docRef?`Doc Ref: ${s.docRef}`:""}`,m,e.labelStyle)}const v=(((A=p.node())==null?void 0:A.getBBox().width)??200)+a,x=(((R=p.node())==null?void 0:R.getBBox().height)??200)+a,b=-v/2,T=-x/2,C=dr.svg(p),S=fr(e,{});e.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");const k=C.rectangle(b,T,v,x,S),E=p.insert(()=>k,":first-child");if(E.attr("class","basic label-container outer-path").attr("style",n),d!=null&&d.length){const _=e.colorIndex??0;p.attr("data-color-id",`color-${_%d.length}`)}if(p.selectAll(".label").each((_,P,N)=>{const L=wt(N[P]),I=L.attr("transform");let $=0,O=0;if(I){const V=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(I);V&&($=parseFloat(V[1]),O=parseFloat(V[2]))}const D=O-x/2;let F=b+a/2;(P===0||P===1)&&(F=$),L.attr("transform",`translate(${F}, ${D+a})`)}),m>g+y+o){const _=T+g+y+o;let P;if(e.look==="neo"){const I=[[b,_],[b+v,_],[b+v,_+.001],[b,_+.001]];P=C.polygon(I,S)}else P=C.line(b,_,b+v,_,S);p.insert(()=>P).attr("class","divider")}return Tr(e,E),e.intersect=function(_){return or.rect(e,_)},n&&e.look!=="handDrawn"&&(f||d!=null&&d.length)&&p.selectAll("path").attr("style",n),p}w(tEe,"requirementBox");async function Uh(t,e,r,n=""){if(e==="")return 0;const i=t.insert("g").attr("class","label").attr("style",n),s=Ve(),a=s.htmlLabels??!0,o=await Qo(i,PK(m0(e)),{width:Al(e,s)+50,classes:"markdown-node-label",useHtmlLabels:a,style:n},s);let l;if(a){const u=o.children[0],h=wt(o);l=u.getBoundingClientRect(),h.attr("width",l.width),h.attr("height",l.height)}else{const u=o.children[0];for(const h of u.children)n&&h.setAttribute("style",n);l=o.getBBox(),l.height+=6}return i.attr("transform",`translate(${-l.width/2},${-l.height/2+r})`),l.height}w(Uh,"addText");var w3t=w(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 rEe(t,e,{config:r}){var P,N;const{labelStyles:n,nodeStyles:i}=cr(e);e.labelStyle=n||"";const s=10,a=e.width;e.width=(e.width??200)-10;const{shapeSvg:o,bbox:l,label:u}=await Qr(t,e,Wr(e)),h=e.padding||10;let d="",f;"ticket"in e&&e.ticket&&((P=r==null?void 0:r.kanban)!=null&&P.ticketBaseUrl)&&(d=(N=r==null?void 0:r.kanban)==null?void 0:N.ticketBaseUrl.replace("#TICKET#",e.ticket),f=o.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",d).attr("target","_blank"));const p={useHtmlLabels:e.useHtmlLabels,labelStyle:e.labelStyle||"",width:e.width,img:e.img,padding:e.padding||8,centerLabel:!1};let g,m;f?{label:g,bbox:m}=await hB(f,"ticket"in e&&e.ticket||"",p):{label:g,bbox:m}=await hB(o,"ticket"in e&&e.ticket||"",p);const{label:y,bbox:v}=await hB(o,"assigned"in e&&e.assigned||"",p);e.width=a;const x=10,b=(e==null?void 0:e.width)||0,T=Math.max(m.height,v.height)/2,C=Math.max(l.height+x*2,(e==null?void 0:e.height)||0)+T,S=-b/2,k=-C/2;u.attr("transform","translate("+(h-b/2)+", "+(-T-l.height/2)+")"),g.attr("transform","translate("+(h-b/2)+", "+(-T+l.height/2)+")"),y.attr("transform","translate("+(h+b/2-v.width-2*s)+", "+(-T+l.height/2)+")");let E;const{rx:A,ry:R}=e,{cssStyles:_}=e;if(e.look==="handDrawn"){const L=dr.svg(o),I=fr(e,{}),$=A||R?L.path(Jg(S,k,b,C,A||0),I):L.rectangle(S,k,b,C,I);E=o.insert(()=>$,":first-child"),E.attr("class","basic label-container").attr("style",_||null)}else{E=o.insert("rect",":first-child"),E.attr("class","basic label-container __APA__").attr("style",i).attr("rx",A??5).attr("ry",R??5).attr("x",S).attr("y",k).attr("width",b).attr("height",C);const L="priority"in e&&e.priority;if(L){const I=o.append("line"),$=S+2,O=k+Math.floor((A??0)/2),D=k+C-Math.floor((A??0)/2);I.attr("x1",$).attr("y1",O).attr("x2",$).attr("y2",D).attr("stroke-width","4").attr("stroke",w3t(L))}}return Tr(e,E),e.height=C,e.intersect=function(L){return or.rect(e,L)},o}w(rEe,"kanbanItem");async function nEe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const{shapeSvg:i,bbox:s,halfPadding:a,label:o}=await Qr(t,e,Wr(e)),l=s.width+10*a,u=s.height+8*a,h=.15*l,{cssStyles:d}=e,f=s.width+20,p=s.height+20,g=Math.max(l,f),m=Math.max(u,p);o.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`);let y;const v=`M0 0+ M${p},${g-As} L${p},${g+f}`;e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const T=y.path(b,v),C=a.insert(()=>T,":first-child");return C.attr("transform",`translate(${As/2}, ${As/2})`),C.attr("class","basic label-container outer-path"),m&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",m),n&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",n),l.attr("transform",`translate(${-(o.width/2)+As/2-(o.x-(o.left??0))}, ${-(o.height/2)+As/2-(o.y-(o.top??0))})`),Tr(e,C),e.intersect=function(S){return or.polygon(e,x,S)},a}w(QSe,"windowPane");var $ce=new Set(["redux-color","redux-dark-color"]),x3t=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function DZ(t,e){var K,q,oe,Q;const r=e;r.alias&&(e.label=r.alias);const{theme:n,themeVariables:i}=xr(),{rowEven:s,rowOdd:a,nodeBorder:o,borderColorArray:l}=i;if(e.look==="handDrawn"){const{themeVariables:Z}=xr(),{background:re}=Z,ie={...e,id:e.id+"-background",domId:(e.domId||e.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${re}`]};await DZ(t,ie)}const u=xr();e.useHtmlLabels=u.htmlLabels;let h=((K=u.er)==null?void 0:K.diagramPadding)??10,d=((q=u.er)==null?void 0:q.entityPadding)??6;const{cssStyles:f}=e,{labelStyles:p,nodeStyles:g}=cr(e);if(r.attributes.length===0&&e.label){const Z={rx:0,ry:0,labelPaddingX:h,labelPaddingY:h*1.5};Al(e.label,u)+Z.labelPaddingX*2<u.er.minEntityWidth&&(e.width=u.er.minEntityWidth);const re=await u3(t,e,Z);if(n!=null&&$ce.has(n)){const ie=r.colorIndex??0;re.attr("data-color-id",`color-${ie%l.length}`)}if(!Wd(u.htmlLabels)){const ie=re.select("text"),me=(oe=ie.node())==null?void 0:oe.getBBox();ie.attr("transform",`translate(${-me.width/2}, 0)`)}return re}u.htmlLabels||(h*=1.25,d*=1.25);let m=Wr(e);m||(m="node default");const y=t.insert("g").attr("class",m).attr("id",e.domId||e.id),v=await C2(y,e.label??"",u,0,0,["name"],p);v.height+=d;let x=0;const b=[],T=[];let C=0,S=0,k=0,E=0,A=!0,R=!0;for(const Z of r.attributes){const re=await C2(y,Z.type,u,0,x,["attribute-type"],p);C=Math.max(C,re.width+h);const ie=await C2(y,Z.name,u,0,x,["attribute-name"],p);S=Math.max(S,ie.width+h);const me=await C2(y,Z.keys.join(),u,0,x,["attribute-keys"],p);k=Math.max(k,me.width+h);const te=await C2(y,Z.comment,u,0,x,["attribute-comment"],p);E=Math.max(E,te.width+h);const _e=Math.max(re.height,ie.height,me.height,te.height)+d;T.push({yOffset:x,rowHeight:_e}),x+=_e}let _=4;k<=h&&(A=!1,k=0,_--),E<=h&&(R=!1,E=0,_--);const P=y.node().getBBox();if(v.width+h*2-(C+S+k+E)>0){const Z=v.width+h*2-(C+S+k+E);C+=Z/_,S+=Z/_,k>0&&(k+=Z/_),E>0&&(E+=Z/_)}const N=C+S+k+E,L=dr.svg(y),I=fr(e,{});e.look!=="handDrawn"&&(I.roughness=0,I.fillStyle="solid");let $=0;T.length>0&&($=T.reduce((Z,re)=>Z+((re==null?void 0:re.rowHeight)??0),0));const O=Math.max(P.width+h*2,(e==null?void 0:e.width)||0,N),D=Math.max(($??0)+v.height,(e==null?void 0:e.height)||0),F=-O/2,z=-D/2;if(y.selectAll("g:not(:first-child)").each((Z,re,ie)=>{const me=wt(ie[re]),te=me.attr("transform");let _e=0,$e=0;if(te){const ce=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(te);ce&&(_e=parseFloat(ce[1]),$e=parseFloat(ce[2]),me.attr("class").includes("attribute-name")?_e+=C:me.attr("class").includes("attribute-keys")?_e+=C+S:me.attr("class").includes("attribute-comment")&&(_e+=C+S+k))}me.attr("transform",`translate(${F+h/2+_e}, ${$e+z+v.height+d/2})`)}),y.select(".name").attr("transform","translate("+-v.width/2+", "+(z+d/2)+")"),n!=null&&$ce.has(n)){const Z=r.colorIndex??0;y.attr("data-color-id",`color-${Z%l.length}`)}const V=L.rectangle(F,z,O,D,I),B=y.insert(()=>V,":first-child").attr("class","outer-path").attr("style",f.join(""));b.push(0);for(const[Z,re]of T.entries()){const me=(Z+1)%2===0&&re.yOffset!==0,te=L.rectangle(F,v.height+z+(re==null?void 0:re.yOffset),O,re==null?void 0:re.rowHeight,{...I,fill:me?s:a,stroke:o});y.insert(()=>te,"g.label").attr("style",f.join("")).attr("class",`row-rect-${me?"even":"odd"}`)}const H=1e-4;let G=k2(F,v.height+z,O+F,v.height+z,H),W=L.polygon(G.map(Z=>[Z.x,Z.y]),I);if(y.insert(()=>W).attr("class","divider"),G=k2(C+F,v.height+z,C+F,D+z,H),W=L.polygon(G.map(Z=>[Z.x,Z.y]),I),y.insert(()=>W).attr("class","divider"),A){const Z=C+S+F;G=k2(Z,v.height+z,Z,D+z,H),W=L.polygon(G.map(re=>[re.x,re.y]),I),y.insert(()=>W).attr("class","divider")}if(R){const Z=C+S+k+F;G=k2(Z,v.height+z,Z,D+z,H),W=L.polygon(G.map(re=>[re.x,re.y]),I),y.insert(()=>W).attr("class","divider")}for(const Z of b){const re=v.height+z+Z;G=k2(F,re,O+F,re,H),W=L.polygon(G.map(ie=>[ie.x,ie.y]),I),y.insert(()=>W).attr("class","divider")}if(Tr(e,B),g&&e.look!=="handDrawn")if(n!=null&&x3t.has(n))y.selectAll("path").attr("style",g);else{const Z=g.split(";"),re=(Q=Z==null?void 0:Z.filter(ie=>ie.includes("stroke")))==null?void 0:Q.map(ie=>`${ie}`).join("; ");y.selectAll("path").attr("style",re??""),y.selectAll(".row-rect-even path").attr("style",g)}return e.intersect=function(Z){return or.rect(e,Z)},y}w(DZ,"erBox");async function C2(t,e,r,n=0,i=0,s=[],a=""){const o=t.insert("g").attr("class",`label ${s.join(" ")}`).attr("transform",`translate(${n}, ${i})`).attr("style",a);e!==Ep(e)&&(e=Ep(e),e=e.replaceAll("<","<").replaceAll(">",">"));const l=o.node().appendChild(await Qo(o,e,{width:Al(e,r)+100,style:a,useHtmlLabels:r.htmlLabels},r));if(e.includes("<")||e.includes(">")){let h=l.children[0];for(h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">");h.childNodes[0];)h=h.childNodes[0],h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">")}let u=l.getBBox();if(Wd(r.htmlLabels)){const h=l.children[0];h.style.textAlign="start";const d=wt(l);u=h.getBoundingClientRect(),d.attr("width",u.width),d.attr("height",u.height)}return u}w(C2,"addText");function k2(t,e,r,n,i){return t===r?[{x:t-i/2,y:e},{x:t+i/2,y:e},{x:r+i/2,y:n},{x:r-i/2,y:n}]:[{x:t,y:e-i/2},{x:t,y:e+i/2},{x:r,y:n+i/2},{x:r,y:n-i/2}]}w(k2,"lineToPolygon");async function JSe(t,e,r,n,i=r.class.padding??12){const s=n?0:3,a=t.insert("g").attr("class",Wr(e)).attr("id",e.domId||e.id);let o=null,l=null,u=null,h=null,d=0,f=0,p=0;if(o=a.insert("g").attr("class","annotation-group text"),e.annotations.length>0){const x=e.annotations[0];await KC(o,{text:`«${x}»`},0),d=o.node().getBBox().height}l=a.insert("g").attr("class","label-group text"),await KC(l,e,0,["font-weight: bolder"]);const g=l.node().getBBox();f=g.height,u=a.insert("g").attr("class","members-group text");let m=0;for(const x of e.members){const b=await KC(u,x,m,[x.parseClassifier()]);m+=b+s}p=u.node().getBBox().height,p<=0&&(p=i/2),h=a.insert("g").attr("class","methods-group text");let y=0;for(const x of e.methods){const b=await KC(h,x,y,[x.parseClassifier()]);y+=b+s}let v=a.node().getBBox();if(o!==null){const x=o.node().getBBox();o.attr("transform",`translate(${-x.width/2})`)}return l.attr("transform",`translate(${-g.width/2}, ${d})`),v=a.node().getBBox(),u.attr("transform",`translate(0, ${d+f+i*2})`),v=a.node().getBBox(),h.attr("transform",`translate(0, ${d+f+(p?p+i*4:i*2)})`),v=a.node().getBBox(),{shapeSvg:a,bbox:v}}w(JSe,"textHelper");async function KC(t,e,r,n=[]){const i=t.insert("g").attr("class","label").attr("style",n.join("; ")),s=xr();let a="useHtmlLabels"in e?e.useHtmlLabels:Wd(s.htmlLabels)??!0,o="";"text"in e?o=e.text:o=e.label,!a&&o.startsWith("\\")&&(o=o.substring(1)),Ks(o)&&(a=!0);const l=await Qo(i,PK(m0(o)),{width:Al(o,s)+50,classes:"markdown-node-label",useHtmlLabels:a},s);let u,h=1;if(a){const d=l.children[0],f=wt(l);h=d.innerHTML.split("<br>").length,d.innerHTML.includes("</math>")&&(h+=d.innerHTML.split("<mrow>").length-1);const p=d.getElementsByTagName("img");if(p){const g=o.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...p].map(m=>new Promise(y=>{function v(){var x;if(m.style.display="flex",m.style.flexDirection="column",g){const b=((x=s.fontSize)==null?void 0:x.toString())??window.getComputedStyle(document.body).fontSize,C=parseInt(b,10)*5+"px";m.style.minWidth=C,m.style.maxWidth=C}else m.style.width="100%";y(m)}w(v,"setupImage"),setTimeout(()=>{m.complete&&v()}),m.addEventListener("error",v),m.addEventListener("load",v)})))}u=d.getBoundingClientRect(),f.attr("width",u.width),f.attr("height",u.height)}else{n.includes("font-weight: bolder")&&wt(l).selectAll("tspan").attr("font-weight",""),h=l.children.length;const d=l.children[0];(l.textContent===""||l.textContent.includes(">"))&&(d.textContent=o[0]+o.substring(1).replaceAll(">",">").replaceAll("<","<").trim(),o[1]===" "&&(d.textContent=d.textContent[0]+" "+d.textContent.substring(1))),d.textContent==="undefined"&&(d.textContent=""),u=l.getBBox()}return i.attr("transform","translate(0,"+(-u.height/(2*h)+r)+")"),u.height}w(KC,"addText");async function eEe(t,e){var L,I;const r=Ve(),{themeVariables:n}=r,{useGradient:i}=n,s=r.class.padding??12,a=s,o=e.useHtmlLabels??Wd(r.htmlLabels)??!0,l=e;l.annotations=l.annotations??[],l.members=l.members??[],l.methods=l.methods??[];const{shapeSvg:u,bbox:h}=await JSe(t,e,r,o,a),{labelStyles:d,nodeStyles:f}=cr(e);e.labelStyle=d,e.cssStyles=l.styles||"";const p=((L=l.styles)==null?void 0:L.join(";"))||f||"";e.cssStyles||(e.cssStyles=p.replaceAll("!important","").split(";"));const g=l.members.length===0&&l.methods.length===0&&!((I=r.class)!=null&&I.hideEmptyMembersBox),m=dr.svg(u),y=fr(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=Math.max(e.width??0,h.width);let x=Math.max(e.height??0,h.height);const b=(e.height??0)>h.height;l.members.length===0&&l.methods.length===0?x+=a:l.members.length>0&&l.methods.length===0&&(x+=a*2);const T=-v/2,C=-x/2;let S=g?s*2:l.members.length===0&&l.methods.length===0?-s:0;b&&(S=s*2);const k=m.rectangle(T-s,C-s-(g?s:l.members.length===0&&l.methods.length===0?-s/2:0),v+2*s,x+2*s+S,y),E=u.insert(()=>k,":first-child");E.attr("class","basic label-container outer-path");const A=E.node().getBBox(),R=u.select(".annotation-group").node().getBBox().height-(g?s/2:0)||0,_=u.select(".label-group").node().getBBox().height-(g?s/2:0)||0,P=u.select(".members-group").node().getBBox().height-(g?s/2:0)||0,N=(R+_+C+s-(C-s-(g?s:l.members.length===0&&l.methods.length===0?-s/2:0)))/2;if(u.selectAll(".text").each(($,O,D)=>{var G,W;const F=wt(D[O]),z=F.attr("transform");let V=0;if(z){const q=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(z);q&&(V=parseFloat(q[2]))}let B=V+C+s-(g?s:l.members.length===0&&l.methods.length===0?-s/2:0);if(F.attr("class").includes("methods-group")){const K=Math.max(P,a/2);b?B=Math.max(N,R+_+K+C+a*2+s)+a*2:B=R+_+K+C+a*4+s}l.members.length===0&&l.methods.length===0&&((G=r.class)!=null&&G.hideEmptyMembersBox)&&(l.annotations.length>0?B=V-a:B=V),o||(B-=4);let H=T;(F.attr("class").includes("label-group")||F.attr("class").includes("annotation-group"))&&(H=-((W=F.node())==null?void 0:W.getBBox().width)/2||0,u.selectAll("text").each(function(K,q,oe){window.getComputedStyle(oe[q]).textAnchor==="middle"&&(H=0)})),F.attr("transform",`translate(${H}, ${B})`)}),l.members.length>0||l.methods.length>0||g){const $=R+_+C+s,O=m.line(A.x,$,A.x+A.width,$+.001,y);u.insert(()=>O).attr("class",`divider${e.look==="neo"&&!i?" neo-line":""}`).attr("style",p)}if(g||l.members.length>0||l.methods.length>0){const $=R+_+P+C+a*2+s,O=m.line(A.x,b?Math.max(N,$):$,A.x+A.width,(b?Math.max(N,$):$)+.001,y);u.insert(()=>O).attr("class",`divider${e.look==="neo"&&!i?" neo-line":""}`).attr("style",p)}if(l.look!=="handDrawn"&&u.selectAll("path").attr("style",p),E.select(":nth-child(2)").attr("style",p),u.selectAll(".divider").select("path").attr("style",p),e.labelStyle?u.selectAll("span").attr("style",e.labelStyle):u.selectAll("span").attr("style",p),!o){const $=RegExp(/color\s*:\s*([^;]*)/),O=$.exec(p);if(O){const D=O[0].replace("color","fill");u.selectAll("tspan").attr("style",D)}else if(d){const D=$.exec(d);if(D){const F=D[0].replace("color","fill");u.selectAll("tspan").attr("style",F)}}}return Tr(e,E),e.intersect=function($){return or.rect(e,$)},u}w(eEe,"classBox");async function tEe(t,e){var A,R;const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e,s=e,a=20,o=20,l="verifyMethod"in e,u=Wr(e),{themeVariables:h}=Ve(),{borderColorArray:d,requirementEdgeLabelBackground:f}=h,p=t.insert("g").attr("class",u).attr("id",e.domId??e.id);let g;l?g=await Uh(p,`<<${i.type}>>`,0,e.labelStyle):g=await Uh(p,"<<Element>>",0,e.labelStyle);let m=g;const y=await Uh(p,i.name,m,e.labelStyle+"; font-weight: bold;");if(m+=y+o,l){const _=await Uh(p,`${i.requirementId?`ID: ${i.requirementId}`:""}`,m,e.labelStyle);m+=_;const P=await Uh(p,`${i.text?`Text: ${i.text}`:""}`,m,e.labelStyle);m+=P;const N=await Uh(p,`${i.risk?`Risk: ${i.risk}`:""}`,m,e.labelStyle);m+=N,await Uh(p,`${i.verifyMethod?`Verification: ${i.verifyMethod}`:""}`,m,e.labelStyle)}else{const _=await Uh(p,`${s.type?`Type: ${s.type}`:""}`,m,e.labelStyle);m+=_,await Uh(p,`${s.docRef?`Doc Ref: ${s.docRef}`:""}`,m,e.labelStyle)}const v=(((A=p.node())==null?void 0:A.getBBox().width)??200)+a,x=(((R=p.node())==null?void 0:R.getBBox().height)??200)+a,b=-v/2,T=-x/2,C=dr.svg(p),S=fr(e,{});e.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");const k=C.rectangle(b,T,v,x,S),E=p.insert(()=>k,":first-child");if(E.attr("class","basic label-container outer-path").attr("style",n),d!=null&&d.length){const _=e.colorIndex??0;p.attr("data-color-id",`color-${_%d.length}`)}if(p.selectAll(".label").each((_,P,N)=>{const L=wt(N[P]),I=L.attr("transform");let $=0,O=0;if(I){const V=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(I);V&&($=parseFloat(V[1]),O=parseFloat(V[2]))}const D=O-x/2;let F=b+a/2;(P===0||P===1)&&(F=$),L.attr("transform",`translate(${F}, ${D+a})`)}),m>g+y+o){const _=T+g+y+o;let P;if(e.look==="neo"){const I=[[b,_],[b+v,_],[b+v,_+.001],[b,_+.001]];P=C.polygon(I,S)}else P=C.line(b,_,b+v,_,S);p.insert(()=>P).attr("class","divider")}return Tr(e,E),e.intersect=function(_){return or.rect(e,_)},n&&e.look!=="handDrawn"&&(f||d!=null&&d.length)&&p.selectAll("path").attr("style",n),p}w(tEe,"requirementBox");async function Uh(t,e,r,n=""){if(e==="")return 0;const i=t.insert("g").attr("class","label").attr("style",n),s=Ve(),a=s.htmlLabels??!0,o=await Qo(i,PK(m0(e)),{width:Al(e,s)+50,classes:"markdown-node-label",useHtmlLabels:a,style:n},s);let l;if(a){const u=o.children[0],h=wt(o);l=u.getBoundingClientRect(),h.attr("width",l.width),h.attr("height",l.height)}else{const u=o.children[0];for(const h of u.children)n&&h.setAttribute("style",n);l=o.getBBox(),l.height+=6}return i.attr("transform",`translate(${-l.width/2},${-l.height/2+r})`),l.height}w(Uh,"addText");var w3t=w(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 rEe(t,e,{config:r}){var P,N;const{labelStyles:n,nodeStyles:i}=cr(e);e.labelStyle=n||"";const s=10,a=e.width;e.width=(e.width??200)-10;const{shapeSvg:o,bbox:l,label:u}=await Qr(t,e,Wr(e)),h=e.padding||10;let d="",f;"ticket"in e&&e.ticket&&((P=r==null?void 0:r.kanban)!=null&&P.ticketBaseUrl)&&(d=(N=r==null?void 0:r.kanban)==null?void 0:N.ticketBaseUrl.replace("#TICKET#",e.ticket),f=o.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",d).attr("target","_blank"));const p={useHtmlLabels:e.useHtmlLabels,labelStyle:e.labelStyle||"",width:e.width,img:e.img,padding:e.padding||8,centerLabel:!1};let g,m;f?{label:g,bbox:m}=await hB(f,"ticket"in e&&e.ticket||"",p):{label:g,bbox:m}=await hB(o,"ticket"in e&&e.ticket||"",p);const{label:y,bbox:v}=await hB(o,"assigned"in e&&e.assigned||"",p);e.width=a;const x=10,b=(e==null?void 0:e.width)||0,T=Math.max(m.height,v.height)/2,C=Math.max(l.height+x*2,(e==null?void 0:e.height)||0)+T,S=-b/2,k=-C/2;u.attr("transform","translate("+(h-b/2)+", "+(-T-l.height/2)+")"),g.attr("transform","translate("+(h-b/2)+", "+(-T+l.height/2)+")"),y.attr("transform","translate("+(h+b/2-v.width-2*s)+", "+(-T+l.height/2)+")");let E;const{rx:A,ry:R}=e,{cssStyles:_}=e;if(e.look==="handDrawn"){const L=dr.svg(o),I=fr(e,{}),$=A||R?L.path(Jg(S,k,b,C,A||0),I):L.rectangle(S,k,b,C,I);E=o.insert(()=>$,":first-child"),E.attr("class","basic label-container").attr("style",_||null)}else{E=o.insert("rect",":first-child"),E.attr("class","basic label-container __APA__").attr("style",i).attr("rx",A??5).attr("ry",R??5).attr("x",S).attr("y",k).attr("width",b).attr("height",C);const L="priority"in e&&e.priority;if(L){const I=o.append("line"),$=S+2,O=k+Math.floor((A??0)/2),D=k+C-Math.floor((A??0)/2);I.attr("x1",$).attr("y1",O).attr("x2",$).attr("y2",D).attr("stroke-width","4").attr("stroke",w3t(L))}}return Tr(e,E),e.height=C,e.intersect=function(L){return or.rect(e,L)},o}w(rEe,"kanbanItem");async function nEe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const{shapeSvg:i,bbox:s,halfPadding:a,label:o}=await Qr(t,e,Wr(e)),l=s.width+10*a,u=s.height+8*a,h=.15*l,{cssStyles:d}=e,f=s.width+20,p=s.height+20,g=Math.max(l,f),m=Math.max(u,p);o.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`);let y;const v=`M0 0a${h},${h} 1 0,0 ${g*.25},${-1*m*.1}a${h},${h} 1 0,0 ${g*.25},0a${h},${h} 1 0,0 ${g*.25},0@@ -1191,7 +1191,7 @@ Please report this to https://github.com/markedjs/marked.`,e){let i="<p>An errora${h},${h} 1 0,0 ${-1*g*.1},${-1*m*.33}a${h*.8},${h*.8} 1 0,0 0,${-1*m*.34}a${h},${h} 1 0,0 ${g*.1},${-1*m*.33}- H0 V0 Z`;if(e.look==="handDrawn"){const x=dr.svg(i),b=fr(e,{}),T=x.path(v,b);y=i.insert(()=>T,":first-child"),y.attr("class","basic label-container").attr("style",Xa(d))}else y=i.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",v);return y.attr("transform",`translate(${-g/2}, ${-m/2})`),Tr(e,y),e.calcIntersect=function(x,b){return or.rect(x,b)},e.intersect=function(x){return de.info("Bang intersect",e,x),or.rect(e,x)},i}w(nEe,"bang");async function iEe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const{shapeSvg:i,bbox:s,halfPadding:a,label:o}=await Qr(t,e,Wr(e)),l=s.width+2*a,u=s.height+2*a,h=.15*l,d=.25*l,f=.35*l,p=.2*l,{cssStyles:g}=e;let m;const y=`M0 0+ H0 V0 Z`;if(e.look==="handDrawn"){const x=dr.svg(i),b=fr(e,{}),T=x.path(v,b);y=i.insert(()=>T,":first-child"),y.attr("class","basic label-container").attr("style",Xa(d))}else y=i.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",v);return y.attr("transform",`translate(${-g/2}, ${-m/2})`),Tr(e,y),e.calcIntersect=function(x,b){return or.rect(x,b)},e.intersect=function(x){return de.info("Bang intersect",e,x),or.rect(e,x)},i}w(nEe,"bang");async function iEe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const{shapeSvg:i,bbox:s,halfPadding:a,label:o}=await Qr(t,e,Wr(e)),l=s.width+2*a,u=s.height+2*a,h=.15*l,d=.25*l,f=.35*l,p=.2*l,{cssStyles:g}=e;let m;const y=`M0 0a${h},${h} 0 0,1 ${l*.25},${-1*l*.1}a${f},${f} 1 0,1 ${l*.4},${-1*l*.1}a${d},${d} 1 0,1 ${l*.35},${l*.2}@@ -1343,7 +1343,7 @@ ${r}`)},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote(),Backspace:()=>E8t(this.editor,this.type)}},addInputRules(){return[e5({find:A8t,type:this.type})]}}),R8t=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,_8t=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,L8t=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,I8t=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,N8t=Qg.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return R_("strong",{...xn(this.options.HTMLAttributes,t),children:R_("slot",{})})},markdownTokenName:"strong",parseMarkdown:(t,e)=>e.applyMark("bold",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"<strong>",close:"</strong>"}},renderMarkdown:(t,e)=>`**${e.renderChildren(t)}**`,addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[yy({find:R8t,type:this.type}),yy({find:L8t,type:this.type})]},addPasteRules(){return[yg({find:_8t,type:this.type}),yg({find:I8t,type:this.type})]}}),D8t=t=>{const e=/`([^`]+)`(?!`)$/.exec(t);return!e||e.index>0&&t[e.index-1]==="`"?null:{index:e.index,text:e[0],replaceWith:e[1]}},O8t=t=>{const e=/`([^`]+)`(?!`)/g,r=[];let n;for(;(n=e.exec(t))!==null;)n.index>0&&t[n.index-1]==="`"||r.push({index:n.index,text:n[0],replaceWith:n[1]});return r},P8t=Qg.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",xn(this.options.HTMLAttributes,t),0]},markdownTokenName:"codespan",parseMarkdown:(t,e)=>e.applyMark("code",[{type:"text",text:t.text||""}]),renderMarkdown:(t,e)=>t.content?`\`${e.renderChildren(t.content)}\``:"",addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[yy({find:D8t,type:this.type})]},addPasteRules(){return[yg({find:O8t,type:this.type})]}}),$8t=Jn.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,``):""}),B8t=Jn.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",xn(this.options.HTMLAttributes,t)]},renderText(){return`-`},renderMarkdown:()=>`+`},renderMarkdown:()=>``,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:r,editor:n})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:i,storedMarks:s}=r;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:a}=this.options,{splittableMarks:o}=n.extensionManager,l=s||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:u,dispatch:h})=>{if(h&&l&&a){const d=l.filter(f=>o.includes(f.type.name));u.ensureMarks(d)}return!0}).scrollIntoView().run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),F8t=Jn.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,xn(this.options.HTMLAttributes,e),0]},parseMarkdown:(t,e)=>e.createNode("heading",{level:t.depth||1},e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>{var r;const n=!((r=t.attrs)===null||r===void 0)&&r.level?parseInt(t.attrs.level,10):1,i="#".repeat(n);return t.content?`${i} ${e.renderChildren(t.content)}`:""},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>FH({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),z8t=Jn.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",xn(this.options.HTMLAttributes,t)]},markdownTokenName:"hr",parseMarkdown:(t,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!Z0t(e,e.schema.nodes[this.name]))return!1;const{selection:r}=e,{$to:n}=r,i=t();return O4e(r)?i.insertContentAt(n.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:s,tr:a,dispatch:o})=>{if(o){const{$to:l}=a.selection,u=l.end();if(l.nodeAfter)l.nodeAfter.isTextblock?a.setSelection(br.create(a.doc,l.pos+1)):l.nodeAfter.isBlock?a.setSelection(Nr.create(a.doc,l.pos)):a.setSelection(br.create(a.doc,l.pos));else{const h=s.schema.nodes[this.options.nextNodeType]||l.parent.type.contentMatch.defaultType,d=h==null?void 0:h.create();d&&(a.insert(u,d),a.setSelection(br.create(a.doc,u+1)))}a.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Y4e({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),V8t=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,H8t=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,G8t=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,W8t=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,q8t=Qg.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",xn(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(t,e)=>e.applyMark("italic",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"<em>",close:"</em>"}},renderMarkdown:(t,e)=>`*${e.renderChildren(t)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[yy({find:V8t,type:this.type}),yy({find:G8t,type:this.type})]},addPasteRules(){return[yg({find:H8t,type:this.type}),yg({find:W8t,type:this.type})]}}),U8t="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",j8t="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",aW="numeric",oW="ascii",lW="alpha",rS="asciinumeric",ek="alphanumeric",cW="domain",pAe="emoji",Y8t="scheme",X8t="slashscheme",vB="whitespace";function K8t(t,e){return t in e||(e[t]=[]),e[t]}function F1(t,e,r){e[aW]&&(e[rS]=!0,e[ek]=!0),e[oW]&&(e[rS]=!0,e[lW]=!0),e[rS]&&(e[ek]=!0),e[lW]&&(e[ek]=!0),e[ek]&&(e[cW]=!0),e[pAe]&&(e[cW]=!0);for(const n in e){const i=K8t(n,r);i.indexOf(t)<0&&i.push(t)}}function Z8t(t,e){const r={};for(const n in e)e[n].indexOf(t)>=0&&(r[n]=!0);return r}function ac(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}ac.groups={};ac.prototype={accepts(){return!!this.t},go(t){const e=this,r=e.j[t];if(r)return r;for(let n=0;n<e.jr.length;n++){const i=e.jr[n][0],s=e.jr[n][1];if(s&&i.test(t))return s}return e.jd},has(t,e=!1){return e?t in this.j:!!this.go(t)},ta(t,e,r,n){for(let i=0;i<t.length;i++)this.tt(t[i],e,r,n)},tr(t,e,r,n){n=n||ac.groups;let i;return e&&e.j?i=e:(i=new ac(e),r&&n&&F1(e,r,n)),this.jr.push([t,i]),i},ts(t,e,r,n){let i=this;const s=t.length;if(!s)return i;for(let a=0;a<s-1;a++)i=i.tt(t[a]);return i.tt(t[s-1],e,r,n)},tt(t,e,r,n){n=n||ac.groups;const i=this;if(e&&e.j)return i.j[t]=e,e;const s=e;let a,o=i.go(t);if(o?(a=new ac,Object.assign(a.j,o.j),a.jr.push.apply(a.jr,o.jr),a.jd=o.jd,a.t=o.t):a=new ac,s){if(n)if(a.t&&typeof a.t=="string"){const l=Object.assign(Z8t(a.t,n),r);F1(s,l,n)}else r&&F1(s,r,n);a.t=s}return i.j[t]=a,a}};const Tn=(t,e,r,n,i)=>t.ta(e,r,n,i),Ms=(t,e,r,n,i)=>t.tr(e,r,n,i),Iue=(t,e,r,n,i)=>t.ts(e,r,n,i),Wt=(t,e,r,n,i)=>t.tt(e,r,n,i),kf="WORD",uW="UWORD",gAe="ASCIINUMERICAL",mAe="ALPHANUMERICAL",_E="LOCALHOST",hW="TLD",dW="UTLD",UM="SCHEME",E2="SLASH_SCHEME",rQ="NUM",fW="WS",nQ="NL",nS="OPENBRACE",iS="CLOSEBRACE",__="OPENBRACKET",L_="CLOSEBRACKET",I_="OPENPAREN",N_="CLOSEPAREN",D_="OPENANGLEBRACKET",O_="CLOSEANGLEBRACKET",P_="FULLWIDTHLEFTPAREN",$_="FULLWIDTHRIGHTPAREN",B_="LEFTCORNERBRACKET",F_="RIGHTCORNERBRACKET",z_="LEFTWHITECORNERBRACKET",V_="RIGHTWHITECORNERBRACKET",H_="FULLWIDTHLESSTHAN",G_="FULLWIDTHGREATERTHAN",W_="AMPERSAND",q_="APOSTROPHE",U_="ASTERISK",Ap="AT",j_="BACKSLASH",Y_="BACKTICK",X_="CARET",z1="COLON",iQ="COMMA",K_="DOLLAR",Qh="DOT",Z_="EQUALS",sQ="EXCLAMATION",lu="HYPHEN",sS="PERCENT",Q_="PIPE",J_="PLUS",eL="POUND",aS="QUERY",aQ="QUOTE",yAe="FULLWIDTHMIDDLEDOT",oQ="SEMI",Jh="SLASH",oS="TILDE",tL="UNDERSCORE",vAe="EMOJI",rL="SYM";var bAe=Object.freeze({__proto__:null,ALPHANUMERICAL:mAe,AMPERSAND:W_,APOSTROPHE:q_,ASCIINUMERICAL:gAe,ASTERISK:U_,AT:Ap,BACKSLASH:j_,BACKTICK:Y_,CARET:X_,CLOSEANGLEBRACKET:O_,CLOSEBRACE:iS,CLOSEBRACKET:L_,CLOSEPAREN:N_,COLON:z1,COMMA:iQ,DOLLAR:K_,DOT:Qh,EMOJI:vAe,EQUALS:Z_,EXCLAMATION:sQ,FULLWIDTHGREATERTHAN:G_,FULLWIDTHLEFTPAREN:P_,FULLWIDTHLESSTHAN:H_,FULLWIDTHMIDDLEDOT:yAe,FULLWIDTHRIGHTPAREN:$_,HYPHEN:lu,LEFTCORNERBRACKET:B_,LEFTWHITECORNERBRACKET:z_,LOCALHOST:_E,NL:nQ,NUM:rQ,OPENANGLEBRACKET:D_,OPENBRACE:nS,OPENBRACKET:__,OPENPAREN:I_,PERCENT:sS,PIPE:Q_,PLUS:J_,POUND:eL,QUERY:aS,QUOTE:aQ,RIGHTCORNERBRACKET:F_,RIGHTWHITECORNERBRACKET:V_,SCHEME:UM,SEMI:oQ,SLASH:Jh,SLASH_SCHEME:E2,SYM:rL,TILDE:oS,TLD:hW,UNDERSCORE:tL,UTLD:dW,UWORD:uW,WORD:kf,WS:fW});const hf=/[a-z]/,lC=new RegExp("\\p{L}","u"),bB=new RegExp("\\p{Emoji}","u"),df=/\d/,xB=/\s/,Nue="\r",wB=``,Q8t="️",J8t="",TB="";let K7=null,Z7=null;function eMt(t=[]){const e={};ac.groups=e;const r=new ac;K7==null&&(K7=Due(U8t)),Z7==null&&(Z7=Due(j8t)),Wt(r,"'",q_),Wt(r,"{",nS),Wt(r,"}",iS),Wt(r,"[",__),Wt(r,"]",L_),Wt(r,"(",I_),Wt(r,")",N_),Wt(r,"<",D_),Wt(r,">",O_),Wt(r,"(",P_),Wt(r,")",$_),Wt(r,"「",B_),Wt(r,"」",F_),Wt(r,"『",z_),Wt(r,"』",V_),Wt(r,"<",H_),Wt(r,">",G_),Wt(r,"&",W_),Wt(r,"*",U_),Wt(r,"@",Ap),Wt(r,"`",Y_),Wt(r,"^",X_),Wt(r,":",z1),Wt(r,",",iQ),Wt(r,"$",K_),Wt(r,".",Qh),Wt(r,"=",Z_),Wt(r,"!",sQ),Wt(r,"-",lu),Wt(r,"%",sS),Wt(r,"|",Q_),Wt(r,"+",J_),Wt(r,"#",eL),Wt(r,"?",aS),Wt(r,'"',aQ),Wt(r,"/",Jh),Wt(r,";",oQ),Wt(r,"~",oS),Wt(r,"_",tL),Wt(r,"\\",j_),Wt(r,"・",yAe);const n=Ms(r,df,rQ,{[aW]:!0});Ms(n,df,n);const i=Ms(n,hf,gAe,{[rS]:!0}),s=Ms(n,lC,mAe,{[ek]:!0}),a=Ms(r,hf,kf,{[oW]:!0});Ms(a,df,i),Ms(a,hf,a),Ms(i,df,i),Ms(i,hf,i);const o=Ms(r,lC,uW,{[lW]:!0});Ms(o,hf),Ms(o,df,s),Ms(o,lC,o),Ms(s,df,s),Ms(s,hf),Ms(s,lC,s);const l=Wt(r,wB,nQ,{[vB]:!0}),u=Wt(r,Nue,fW,{[vB]:!0}),h=Ms(r,xB,fW,{[vB]:!0});Wt(r,TB,h),Wt(u,wB,l),Wt(u,TB,h),Ms(u,xB,h),Wt(h,Nue),Wt(h,wB),Ms(h,xB,h),Wt(h,TB,h);const d=Ms(r,bB,vAe,{[pAe]:!0});Wt(d,"#"),Ms(d,bB,d),Wt(d,Q8t,d);const f=Wt(d,J8t);Wt(f,"#"),Ms(f,bB,d);const p=[[hf,a],[df,i]],g=[[hf,null],[lC,o],[df,s]];for(let m=0;m<K7.length;m++)up(r,K7[m],hW,kf,p);for(let m=0;m<Z7.length;m++)up(r,Z7[m],dW,uW,g);F1(hW,{tld:!0,ascii:!0},e),F1(dW,{utld:!0,alpha:!0},e),up(r,"file",UM,kf,p),up(r,"mailto",UM,kf,p),up(r,"http",E2,kf,p),up(r,"https",E2,kf,p),up(r,"ftp",E2,kf,p),up(r,"ftps",E2,kf,p),F1(UM,{scheme:!0,ascii:!0},e),F1(E2,{slashscheme:!0,ascii:!0},e),t=t.sort((m,y)=>m[0]>y[0]?1:-1);for(let m=0;m<t.length;m++){const y=t[m][0],x=t[m][1]?{[Y8t]:!0}:{[X8t]:!0};y.indexOf("-")>=0?x[cW]=!0:hf.test(y)?df.test(y)?x[rS]=!0:x[oW]=!0:x[aW]=!0,Iue(r,y,y,x)}return Iue(r,"localhost",_E,{ascii:!0}),r.jd=new ac(rL),{start:r,tokens:Object.assign({groups:e},bAe)}}function xAe(t,e){const r=tMt(e.replace(/[A-Z]/g,o=>o.toLowerCase())),n=r.length,i=[];let s=0,a=0;for(;a<n;){let o=t,l=null,u=0,h=null,d=-1,f=-1;for(;a<n&&(l=o.go(r[a]));)o=l,o.accepts()?(d=0,f=0,h=o):d>=0&&(d+=r[a].length,f++),u+=r[a].length,s+=r[a].length,a++;s-=d,a-=f,u-=d,i.push({t:h.t,v:e.slice(s-u,s),s:s-u,e:s})}return i}function tMt(t){const e=[],r=t.length;let n=0;for(;n<r;){let i=t.charCodeAt(n),s,a=i<55296||i>56319||n+1===r||(s=t.charCodeAt(n+1))<56320||s>57343?t[n]:t.slice(n,n+2);e.push(a),n+=a.length}return e}function up(t,e,r,n,i){let s;const a=e.length;for(let o=0;o<a-1;o++){const l=e[o];t.j[l]?s=t.j[l]:(s=new ac(n),s.jr=i.slice(),t.j[l]=s),t=s}return s=new ac(r),s.jr=i.slice(),t.j[e[a-1]]=s,s}function Due(t){const e=[],r=[];let n=0,i="0123456789";for(;n<t.length;){let s=0;for(;i.indexOf(t[n+s])>=0;)s++;if(s>0){e.push(r.join(""));for(let a=parseInt(t.substring(n,n+s),10);a>0;a--)r.pop();n+=s}else r.push(t[n]),n++}return e}const LE={defaultProtocol:"http",events:null,format:Oue,formatHref:Oue,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function lQ(t,e=null){let r=Object.assign({},LE);t&&(r=Object.assign(r,t instanceof lQ?t.o:t));const n=r.ignoreTags,i=[];for(let s=0;s<n.length;s++)i.push(n[s].toUpperCase());this.o=r,e&&(this.defaultRender=e),this.ignoreTags=i}lQ.prototype={o:LE,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,r){const n=e!=null;let i=this.o[t];return i&&(typeof i=="object"?(i=r.t in i?i[r.t]:LE[t],typeof i=="function"&&n&&(i=i(e,r))):typeof i=="function"&&n&&(i=i(e,r.t,r)),i)},getObj(t,e,r){let n=this.o[t];return typeof n=="function"&&e!=null&&(n=n(e,r.t,r)),n},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function Oue(t){return t}function wAe(t,e){this.t="token",this.v=t,this.tk=e}wAe.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),r=t.get("truncate",e,this),n=t.get("format",e,this);return r&&n.length>r?n.substring(0,r)+"…":n},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=LE.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,r=this.toHref(t.get("defaultProtocol")),n=t.get("formatHref",r,this),i=t.get("tagName",r,e),s=this.toFormattedString(t),a={},o=t.get("className",r,e),l=t.get("target",r,e),u=t.get("rel",r,e),h=t.getObj("attributes",r,e),d=t.getObj("events",r,e);return a.href=n,o&&(a.class=o),l&&(a.target=l),u&&(a.rel=u),h&&Object.assign(a,h),{tagName:i,attributes:a,content:s,eventListeners:d}}};function SD(t,e){class r extends wAe{constructor(i,s){super(i,s),this.t=t}}for(const n in e)r.prototype[n]=e[n];return r.t=t,r}const rMt=SD("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Pue=SD("text"),nMt=SD("nl"),Q7=SD("url",{isLink:!0,toHref(t=LE.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==_E&&t[1].t===z1}}),nu=t=>new ac(t);function iMt({groups:t}){const e=t.domain.concat([W_,U_,Ap,j_,Y_,X_,K_,Z_,lu,rQ,sS,Q_,J_,eL,Jh,rL,oS,tL]),r=[q_,z1,iQ,Qh,sQ,sS,aS,aQ,oQ,D_,O_,nS,iS,L_,__,I_,N_,P_,$_,B_,F_,z_,V_,H_,G_],n=[W_,q_,U_,j_,Y_,X_,K_,Z_,lu,nS,iS,sS,Q_,J_,eL,aS,Jh,rL,oS,tL],i=nu(),s=Wt(i,oS);Tn(s,n,s),Tn(s,t.domain,s);const a=nu(),o=nu(),l=nu();Tn(i,t.domain,a),Tn(i,t.scheme,o),Tn(i,t.slashscheme,l),Tn(a,n,s),Tn(a,t.domain,a);const u=Wt(a,Ap);Wt(s,Ap,u),Wt(o,Ap,u),Wt(l,Ap,u);const h=Wt(s,Qh);Tn(h,n,s),Tn(h,t.domain,s);const d=nu();Tn(u,t.domain,d),Tn(d,t.domain,d);const f=Wt(d,Qh);Tn(f,t.domain,d);const p=nu(rMt);Tn(f,t.tld,p),Tn(f,t.utld,p),Wt(u,_E,p);const g=Wt(d,lu);Wt(g,lu,g),Tn(g,t.domain,d),Tn(p,t.domain,d),Wt(p,Qh,f),Wt(p,lu,g);const m=Wt(a,lu),y=Wt(a,Qh);Wt(m,lu,m),Tn(m,t.domain,a),Tn(y,n,s),Tn(y,t.domain,a);const v=nu(Q7);Tn(y,t.tld,v),Tn(y,t.utld,v),Tn(v,t.domain,a),Tn(v,n,s),Wt(v,Qh,y),Wt(v,lu,m),Wt(v,Ap,u);const x=Wt(v,z1),b=nu(Q7);Tn(x,t.numeric,b);const T=nu(Q7),C=nu();Tn(T,e,T),Tn(T,r,C),Tn(C,e,T),Tn(C,r,C),Wt(v,Jh,T),Wt(b,Jh,T);const S=Wt(o,z1),k=Wt(l,z1),E=Wt(k,Jh),A=Wt(E,Jh);Tn(o,t.domain,a),Wt(o,Qh,y),Wt(o,lu,m),Tn(l,t.domain,a),Wt(l,Qh,y),Wt(l,lu,m),Tn(S,t.domain,T),Wt(S,Jh,T),Wt(S,aS,T),Tn(A,t.domain,T),Tn(A,e,T),Wt(A,Jh,T);const R=[[nS,iS],[__,L_],[I_,N_],[D_,O_],[P_,$_],[B_,F_],[z_,V_],[H_,G_]];for(let _=0;_<R.length;_++){const[P,N]=R[_],L=Wt(T,P);Wt(C,P,L);const I=nu(Q7);Tn(L,e,I);const $=nu();Tn(L,r,$),Wt(L,N,T),Tn(I,e,I),Tn(I,r,$),Tn($,e,I),Tn($,r,$),Wt(I,N,T),Wt($,N,T)}return Wt(i,_E,v),Wt(i,nQ,nMt),{start:i,tokens:bAe}}function sMt(t,e,r){let n=r.length,i=0,s=[],a=[];for(;i<n;){let o=t,l=null,u=null,h=0,d=null,f=-1;for(;i<n&&!(l=o.go(r[i].t));)a.push(r[i++]);for(;i<n&&(u=l||o.go(r[i].t));)l=null,o=u,o.accepts()?(f=0,d=o):f>=0&&f++,i++,h++;if(f<0)i-=h,i<n&&(a.push(r[i]),i++);else{a.length>0&&(s.push(CB(Pue,e,a)),a=[]),i-=f,h-=f;const p=d.t,g=r.slice(i-h,i);s.push(CB(p,e,g))}}return a.length>0&&s.push(CB(Pue,e,a)),s}function CB(t,e,r){const n=r[0].s,i=r[r.length-1].e,s=e.slice(n,i);return new t(s,r)}const aMt=typeof console<"u"&&console&&console.warn||(()=>{}),oMt="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Xi={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function lMt(){return ac.groups={},Xi.scanner=null,Xi.parser=null,Xi.tokenQueue=[],Xi.pluginQueue=[],Xi.customSchemes=[],Xi.initialized=!1,Xi}function $ue(t,e=!1){if(Xi.initialized&&aMt(`linkifyjs: already initialized - will not register custom scheme "${t}" ${oMt}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.1. Must only contain digits, lowercase ASCII letters or "-"@@ -1470,7 +1470,7 @@ ${JSON.stringify(t)}})));}}-+if (${S}.value === undefined) {if (${k} in input) {newResult[${k}] = undefined;@@ -1478,7 +1478,7 @@ ${JSON.stringify(t)}} else {newResult[${k}] = ${S}.value;}-+`):A?p.write(`if (${S}.issues.length) {payload.issues = payload.issues.concat(${S}.issues.map(iss => ({@@ -1486,7 +1486,7 @@ ${JSON.stringify(t)}path: iss.path ? [${k}, ...iss.path] : [${k}]})));}-+if (${S}.value === undefined) {if (${k} in input) {newResult[${k}] = undefined;@@ -1494,7 +1494,7 @@ ${JSON.stringify(t)}} else {newResult[${k}] = ${S}.value;}-+`):p.write(`const ${S}_present = ${k} in input;if (${S}.issues.length) {@@ -1524,7 +1524,7 @@ ${JSON.stringify(t)}Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const h of t.seen.entries()){const d=h[1];if(e===h[0]){s(h);continue}if(t.external){const p=(l=t.external.registry.get(h[0]))==null?void 0:l.id;if(e!==h[0]&&p){s(h);continue}}if((u=t.metadataRegistry.get(h[0]))==null?void 0:u.id){s(h);continue}if(d.cycle){s(h);continue}if(d.count>1&&t.reused==="ref"){s(h);continue}}}function v7e(t,e){var o,l,u,h;const r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=d=>{const f=t.seen.get(d);if(f.ref===null)return;const p=f.def??f.schema,g={...p},m=f.ref;if(f.ref=null,m){n(m);const v=t.seen.get(m),x=v.schema;if(x.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(p.allOf=p.allOf??[],p.allOf.push(x)):Object.assign(p,x),Object.assign(p,g),d._zod.parent===m)for(const T in p)T==="$ref"||T==="allOf"||T in g||delete p[T];if(x.$ref&&v.def)for(const T in p)T==="$ref"||T==="allOf"||T in v.def&&JSON.stringify(p[T])===JSON.stringify(v.def[T])&&delete p[T]}const y=d._zod.parent;if(y&&y!==m){n(y);const v=t.seen.get(y);if(v!=null&&v.schema.$ref&&(p.$ref=v.schema.$ref,v.def))for(const x in p)x==="$ref"||x==="allOf"||x in v.def&&JSON.stringify(p[x])===JSON.stringify(v.def[x])&&delete p[x]}t.override({zodSchema:d,jsonSchema:p,path:f.path??[]})};for(const d of[...t.seen.entries()].reverse())n(d[0]);const i={};if(t.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":t.target,(o=t.external)!=null&&o.uri){const d=(l=t.external.registry.get(e))==null?void 0:l.id;if(!d)throw new Error("Schema is missing an `id` property");i.$id=t.external.uri(d)}Object.assign(i,r.def??r.schema);const s=(u=t.metadataRegistry.get(e))==null?void 0:u.id;s!==void 0&&i.id===s&&delete i.id;const a=((h=t.external)==null?void 0:h.defs)??{};for(const d of t.seen.entries()){const f=d[1];f.def&&f.defId&&(f.def.id===f.defId&&delete f.def.id,a[f.defId]=f.def)}t.external||Object.keys(a).length>0&&(t.target==="draft-2020-12"?i.$defs=a:i.definitions=a);try{const d=JSON.parse(JSON.stringify(i));return Object.defineProperty(d,"~standard",{value:{...e["~standard"],jsonSchema:{input:cL(e,"input",t.processors),output:cL(e,"output",t.processors)}},enumerable:!1,writable:!1}),d}catch{throw new Error("Error converting schema to JSON.")}}function al(t,e){const r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);const n=t._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return al(n.element,r);if(n.type==="set")return al(n.valueType,r);if(n.type==="lazy")return al(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return al(n.innerType,r);if(n.type==="intersection")return al(n.left,r)||al(n.right,r);if(n.type==="record"||n.type==="map")return al(n.keyType,r)||al(n.valueType,r);if(n.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:al(n.in,r)||al(n.out,r);if(n.type==="object"){for(const i in n.shape)if(al(n.shape[i],r))return!0;return!1}if(n.type==="union"){for(const i of n.options)if(al(i,r))return!0;return!1}if(n.type==="tuple"){for(const i of n.items)if(al(i,r))return!0;return!!(n.rest&&al(n.rest,r))}return!1}const lIt=(t,e={})=>r=>{const n=m7e({...r,processors:e});return da(t,n),y7e(n,t),v7e(n,t)},cL=(t,e,r={})=>n=>{const{libraryOptions:i,target:s}=n??{},a=m7e({...i??{},target:s,io:e,processors:r});return da(t,a),y7e(a,t),v7e(a,t)},cIt={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},uIt=(t,e,r,n)=>{const i=r;i.type="string";const{minimum:s,maximum:a,format:o,patterns:l,contentEncoding:u}=t._zod.bag;if(typeof s=="number"&&(i.minLength=s),typeof a=="number"&&(i.maxLength=a),o&&(i.format=cIt[o]??o,i.format===""&&delete i.format,o==="time"&&delete i.format),u&&(i.contentEncoding=u),l&&l.size>0){const h=[...l];h.length===1?i.pattern=h[0].source:h.length>1&&(i.allOf=[...h.map(d=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},hIt=(t,e,r,n)=>{const i=r,{minimum:s,maximum:a,format:o,multipleOf:l,exclusiveMaximum:u,exclusiveMinimum:h}=t._zod.bag;typeof o=="string"&&o.includes("int")?i.type="integer":i.type="number";const d=typeof h=="number"&&h>=(s??Number.NEGATIVE_INFINITY),f=typeof u=="number"&&u<=(a??Number.POSITIVE_INFINITY),p=e.target==="draft-04"||e.target==="openapi-3.0";d?p?(i.minimum=h,i.exclusiveMinimum=!0):i.exclusiveMinimum=h:typeof s=="number"&&(i.minimum=s),f?p?(i.maximum=u,i.exclusiveMaximum=!0):i.exclusiveMaximum=u:typeof a=="number"&&(i.maximum=a),typeof l=="number"&&(i.multipleOf=l)},dIt=(t,e,r,n)=>{r.type="boolean"},fIt=(t,e,r,n)=>{r.not={}},pIt=(t,e,r,n)=>{},gIt=(t,e,r,n)=>{const i=t._zod.def,s=XAe(i.entries);s.every(a=>typeof a=="number")&&(r.type="number"),s.every(a=>typeof a=="string")&&(r.type="string"),r.enum=s},mIt=(t,e,r,n)=>{const i=t._zod.def,s=[];for(const a of i.values)if(a===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(a))}else s.push(a);if(s.length!==0)if(s.length===1){const a=s[0];r.type=a===null?"null":typeof a,e.target==="draft-04"||e.target==="openapi-3.0"?r.enum=[a]:r.const=a}else s.every(a=>typeof a=="number")&&(r.type="number"),s.every(a=>typeof a=="string")&&(r.type="string"),s.every(a=>typeof a=="boolean")&&(r.type="boolean"),s.every(a=>a===null)&&(r.type="null"),r.enum=s},yIt=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},vIt=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},bIt=(t,e,r,n)=>{const i=r,s=t._zod.def,{minimum:a,maximum:o}=t._zod.bag;typeof a=="number"&&(i.minItems=a),typeof o=="number"&&(i.maxItems=o),i.type="array",i.items=da(s.element,e,{...n,path:[...n.path,"items"]})},xIt=(t,e,r,n)=>{var u;const i=r,s=t._zod.def;i.type="object",i.properties={};const a=s.shape;for(const h in a)i.properties[h]=da(a[h],e,{...n,path:[...n.path,"properties",h]});const o=new Set(Object.keys(a)),l=new Set([...o].filter(h=>{const d=s.shape[h]._zod;return e.io==="input"?d.optin===void 0:d.optout===void 0}));l.size>0&&(i.required=Array.from(l)),((u=s.catchall)==null?void 0:u._zod.def.type)==="never"?i.additionalProperties=!1:s.catchall?s.catchall&&(i.additionalProperties=da(s.catchall,e,{...n,path:[...n.path,"additionalProperties"]})):e.io==="output"&&(i.additionalProperties=!1)},wIt=(t,e,r,n)=>{const i=t._zod.def,s=i.inclusive===!1,a=i.options.map((o,l)=>da(o,e,{...n,path:[...n.path,s?"oneOf":"anyOf",l]}));s?r.oneOf=a:r.anyOf=a},TIt=(t,e,r,n)=>{const i=t._zod.def,s=da(i.left,e,{...n,path:[...n.path,"allOf",0]}),a=da(i.right,e,{...n,path:[...n.path,"allOf",1]}),o=u=>"allOf"in u&&Object.keys(u).length===1,l=[...o(s)?s.allOf:[s],...o(a)?a.allOf:[a]];r.allOf=l},CIt=(t,e,r,n)=>{const i=r,s=t._zod.def;i.type="object";const a=s.keyType,o=a._zod.bag,l=o==null?void 0:o.patterns;if(s.mode==="loose"&&l&&l.size>0){const h=da(s.valueType,e,{...n,path:[...n.path,"patternProperties","*"]});i.patternProperties={};for(const d of l)i.patternProperties[d.source]=h}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(i.propertyNames=da(s.keyType,e,{...n,path:[...n.path,"propertyNames"]})),i.additionalProperties=da(s.valueType,e,{...n,path:[...n.path,"additionalProperties"]});const u=a._zod.values;if(u){const h=[...u].filter(d=>typeof d=="string"||typeof d=="number");h.length>0&&(i.required=h)}},kIt=(t,e,r,n)=>{const i=t._zod.def,s=da(i.innerType,e,n),a=e.seen.get(t);e.target==="openapi-3.0"?(a.ref=i.innerType,r.nullable=!0):r.anyOf=[s,{type:"null"}]},SIt=(t,e,r,n)=>{const i=t._zod.def;da(i.innerType,e,n);const s=e.seen.get(t);s.ref=i.innerType},EIt=(t,e,r,n)=>{const i=t._zod.def;da(i.innerType,e,n);const s=e.seen.get(t);s.ref=i.innerType,r.default=JSON.parse(JSON.stringify(i.defaultValue))},AIt=(t,e,r,n)=>{const i=t._zod.def;da(i.innerType,e,n);const s=e.seen.get(t);s.ref=i.innerType,e.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},MIt=(t,e,r,n)=>{const i=t._zod.def;da(i.innerType,e,n);const s=e.seen.get(t);s.ref=i.innerType;let a;try{a=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=a},RIt=(t,e,r,n)=>{const i=t._zod.def,s=i.in._zod.traits.has("$ZodTransform"),a=e.io==="input"?s?i.out:i.in:i.out;da(a,e,n);const o=e.seen.get(t);o.ref=a},_It=(t,e,r,n)=>{const i=t._zod.def;da(i.innerType,e,n);const s=e.seen.get(t);s.ref=i.innerType,r.readOnly=!0},b7e=(t,e,r,n)=>{const i=t._zod.def;da(i.innerType,e,n);const s=e.seen.get(t);s.ref=i.innerType},LIt=Ct("ZodISODateTime",(t,e)=>{I_t.init(t,e),Ss.init(t,e)});function IIt(t){return BLt(LIt,t)}const NIt=Ct("ZodISODate",(t,e)=>{N_t.init(t,e),Ss.init(t,e)});function DIt(t){return FLt(NIt,t)}const OIt=Ct("ZodISOTime",(t,e)=>{D_t.init(t,e),Ss.init(t,e)});function PIt(t){return zLt(OIt,t)}const $It=Ct("ZodISODuration",(t,e)=>{O_t.init(t,e),Ss.init(t,e)});function BIt(t){return VLt($It,t)}const FIt=(t,e)=>{JAe.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:r=>k9t(t,r)},flatten:{value:r=>C9t(t,r)},addIssue:{value:r=>{t.issues.push(r),t.message=JSON.stringify(t.issues,vW,2)}},addIssues:{value:r=>{t.issues.push(...r),t.message=JSON.stringify(t.issues,vW,2)}},isEmpty:{get(){return t.issues.length===0}}})},$u=Ct("ZodError",FIt,{Parent:Error}),zIt=CQ($u),VIt=kQ($u),HIt=MD($u),GIt=RD($u),WIt=A9t($u),qIt=M9t($u),UIt=R9t($u),jIt=_9t($u),YIt=L9t($u),XIt=I9t($u),KIt=N9t($u),ZIt=D9t($u),dhe=new WeakMap;function dA(t,e,r){const n=Object.getPrototypeOf(t);let i=dhe.get(n);if(i||(i=new Set,dhe.set(n,i)),!i.has(e)){i.add(e);for(const s in r){const a=r[s];Object.defineProperty(n,s,{configurable:!0,enumerable:!1,get(){const o=a.bind(this);return Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:o}),o},set(o){Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:o})}})}}}const ks=Ct("ZodType",(t,e)=>(Cs.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:cL(t,"input"),output:cL(t,"output")}}),t.toJSONSchema=lIt(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.parse=(r,n)=>zIt(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>HIt(t,r,n),t.parseAsync=async(r,n)=>VIt(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>GIt(t,r,n),t.spa=t.safeParseAsync,t.encode=(r,n)=>WIt(t,r,n),t.decode=(r,n)=>qIt(t,r,n),t.encodeAsync=async(r,n)=>UIt(t,r,n),t.decodeAsync=async(r,n)=>jIt(t,r,n),t.safeEncode=(r,n)=>YIt(t,r,n),t.safeDecode=(r,n)=>XIt(t,r,n),t.safeEncodeAsync=async(r,n)=>KIt(t,r,n),t.safeDecodeAsync=async(r,n)=>ZIt(t,r,n),dA(t,"ZodType",{check(...r){const n=this.def;return this.clone(em(n,{checks:[...n.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,n){return tm(this,r,n)},brand(){return this},register(r,n){return r.add(this,n),this},refine(r,n){return this.check(GNt(r,n))},superRefine(r,n){return this.check(WNt(r,n))},overwrite(r){return this.check(p3(r))},optional(){return mhe(this)},exactOptional(){return _Nt(this)},nullable(){return yhe(this)},nullish(){return mhe(yhe(this))},nonoptional(r){return PNt(this,r)},array(){return Kn(this)},or(r){return $E([this,r])},and(r){return SNt(this,r)},transform(r){return vhe(this,MNt(r))},default(r){return NNt(this,r)},prefault(r){return ONt(this,r)},catch(r){return BNt(this,r)},pipe(r){return vhe(this,r)},readonly(){return VNt(this)},describe(r){const n=this.clone();return rk.add(n,{description:r}),n},meta(...r){if(r.length===0)return rk.get(this);const n=this.clone();return rk.add(n,r[0]),n},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(t,"description",{get(){var r;return(r=rk.get(t))==null?void 0:r.description},configurable:!0}),t)),x7e=Ct("_ZodString",(t,e)=>{SQ.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(n,i,s)=>uIt(t,n,i);const r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,dA(t,"_ZodString",{regex(...n){return this.check(jLt(...n))},includes(...n){return this.check(KLt(...n))},startsWith(...n){return this.check(ZLt(...n))},endsWith(...n){return this.check(QLt(...n))},min(...n){return this.check(lL(...n))},max(...n){return this.check(p7e(...n))},length(...n){return this.check(g7e(...n))},nonempty(...n){return this.check(lL(1,...n))},lowercase(n){return this.check(YLt(n))},uppercase(n){return this.check(XLt(n))},trim(){return this.check(eIt())},normalize(...n){return this.check(JLt(...n))},toLowerCase(){return this.check(tIt())},toUpperCase(){return this.check(rIt())},slugify(){return this.check(nIt())}})}),QIt=Ct("ZodString",(t,e)=>{SQ.init(t,e),x7e.init(t,e),t.email=r=>t.check(yLt(JIt,r)),t.url=r=>t.check(TLt(eNt,r)),t.jwt=r=>t.check($Lt(gNt,r)),t.emoji=r=>t.check(CLt(tNt,r)),t.guid=r=>t.check(lhe(fhe,r)),t.uuid=r=>t.check(vLt(i8,r)),t.uuidv4=r=>t.check(bLt(i8,r)),t.uuidv6=r=>t.check(xLt(i8,r)),t.uuidv7=r=>t.check(wLt(i8,r)),t.nanoid=r=>t.check(kLt(rNt,r)),t.guid=r=>t.check(lhe(fhe,r)),t.cuid=r=>t.check(SLt(nNt,r)),t.cuid2=r=>t.check(ELt(iNt,r)),t.ulid=r=>t.check(ALt(sNt,r)),t.base64=r=>t.check(DLt(dNt,r)),t.base64url=r=>t.check(OLt(fNt,r)),t.xid=r=>t.check(MLt(aNt,r)),t.ksuid=r=>t.check(RLt(oNt,r)),t.ipv4=r=>t.check(_Lt(lNt,r)),t.ipv6=r=>t.check(LLt(cNt,r)),t.cidrv4=r=>t.check(ILt(uNt,r)),t.cidrv6=r=>t.check(NLt(hNt,r)),t.e164=r=>t.check(PLt(pNt,r)),t.datetime=r=>t.check(IIt(r)),t.date=r=>t.check(DIt(r)),t.time=r=>t.check(PIt(r)),t.duration=r=>t.check(BIt(r))});function Ze(t){return mLt(QIt,t)}const Ss=Ct("ZodStringFormat",(t,e)=>{hs.init(t,e),x7e.init(t,e)}),JIt=Ct("ZodEmail",(t,e)=>{C_t.init(t,e),Ss.init(t,e)}),fhe=Ct("ZodGUID",(t,e)=>{w_t.init(t,e),Ss.init(t,e)}),i8=Ct("ZodUUID",(t,e)=>{T_t.init(t,e),Ss.init(t,e)}),eNt=Ct("ZodURL",(t,e)=>{k_t.init(t,e),Ss.init(t,e)}),tNt=Ct("ZodEmoji",(t,e)=>{S_t.init(t,e),Ss.init(t,e)}),rNt=Ct("ZodNanoID",(t,e)=>{E_t.init(t,e),Ss.init(t,e)}),nNt=Ct("ZodCUID",(t,e)=>{A_t.init(t,e),Ss.init(t,e)}),iNt=Ct("ZodCUID2",(t,e)=>{M_t.init(t,e),Ss.init(t,e)}),sNt=Ct("ZodULID",(t,e)=>{R_t.init(t,e),Ss.init(t,e)}),aNt=Ct("ZodXID",(t,e)=>{__t.init(t,e),Ss.init(t,e)}),oNt=Ct("ZodKSUID",(t,e)=>{L_t.init(t,e),Ss.init(t,e)}),lNt=Ct("ZodIPv4",(t,e)=>{P_t.init(t,e),Ss.init(t,e)}),cNt=Ct("ZodIPv6",(t,e)=>{$_t.init(t,e),Ss.init(t,e)}),uNt=Ct("ZodCIDRv4",(t,e)=>{B_t.init(t,e),Ss.init(t,e)}),hNt=Ct("ZodCIDRv6",(t,e)=>{F_t.init(t,e),Ss.init(t,e)}),dNt=Ct("ZodBase64",(t,e)=>{z_t.init(t,e),Ss.init(t,e)}),fNt=Ct("ZodBase64URL",(t,e)=>{H_t.init(t,e),Ss.init(t,e)}),pNt=Ct("ZodE164",(t,e)=>{G_t.init(t,e),Ss.init(t,e)}),gNt=Ct("ZodJWT",(t,e)=>{q_t.init(t,e),Ss.init(t,e)}),w7e=Ct("ZodNumber",(t,e)=>{c7e.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(n,i,s)=>hIt(t,n,i),dA(t,"ZodNumber",{gt(n,i){return this.check(uhe(n,i))},gte(n,i){return this.check(AB(n,i))},min(n,i){return this.check(AB(n,i))},lt(n,i){return this.check(che(n,i))},lte(n,i){return this.check(EB(n,i))},max(n,i){return this.check(EB(n,i))},int(n){return this.check(phe(n))},safe(n){return this.check(phe(n))},positive(n){return this.check(uhe(0,n))},nonnegative(n){return this.check(AB(0,n))},negative(n){return this.check(che(0,n))},nonpositive(n){return this.check(EB(0,n))},multipleOf(n,i){return this.check(hhe(n,i))},step(n,i){return this.check(hhe(n,i))},finite(){return this}});const r=t._zod.bag;t.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),t.isFinite=!0,t.format=r.format??null});function sa(t){return HLt(w7e,t)}const mNt=Ct("ZodNumberFormat",(t,e)=>{U_t.init(t,e),w7e.init(t,e)});function phe(t){return GLt(mNt,t)}const yNt=Ct("ZodBoolean",(t,e)=>{j_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>dIt(t,r,n)});function Vn(t){return WLt(yNt,t)}const vNt=Ct("ZodUnknown",(t,e)=>{Y_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>pIt()});function Dd(){return qLt(vNt)}const bNt=Ct("ZodNever",(t,e)=>{X_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>fIt(t,r,n)});function xNt(t){return ULt(bNt,t)}const wNt=Ct("ZodArray",(t,e)=>{K_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>bIt(t,r,n,i),t.element=e.element,dA(t,"ZodArray",{min(r,n){return this.check(lL(r,n))},nonempty(r){return this.check(lL(1,r))},max(r,n){return this.check(p7e(r,n))},length(r,n){return this.check(g7e(r,n))},unwrap(){return this.element}})});function Kn(t,e){return iIt(wNt,t,e)}const TNt=Ct("ZodObject",(t,e)=>{Q_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>xIt(t,r,n,i),bi(t,"shape",()=>e.shape),dA(t,"ZodObject",{keyof(){return ii(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:Dd()})},loose(){return this.clone({...this._zod.def,catchall:Dd()})},strict(){return this.clone({...this._zod.def,catchall:xNt()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return y9t(this,r)},safeExtend(r){return v9t(this,r)},merge(r){return b9t(this,r)},pick(r){return g9t(this,r)},omit(r){return m9t(this,r)},partial(...r){return x9t(k7e,this,r[0])},required(...r){return w9t(S7e,this,r[0])}})});function Yt(t,e){const r={type:"object",shape:t??{},..._r(e)};return new TNt(r)}const T7e=Ct("ZodUnion",(t,e)=>{d7e.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>wIt(t,r,n,i),t.options=e.options});function $E(t,e){return new T7e({type:"union",options:t,..._r(e)})}const CNt=Ct("ZodDiscriminatedUnion",(t,e)=>{T7e.init(t,e),J_t.init(t,e)});function C7e(t,e,r){return new CNt({type:"union",options:e,discriminator:t,..._r(r)})}const kNt=Ct("ZodIntersection",(t,e)=>{eLt.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>TIt(t,r,n,i)});function SNt(t,e){return new kNt({type:"intersection",left:t,right:e})}const ghe=Ct("ZodRecord",(t,e)=>{tLt.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>CIt(t,r,n,i),t.keyType=e.keyType,t.valueType=e.valueType});function LD(t,e,r){return!e||!e._zod?new ghe({type:"record",keyType:Ze(),valueType:t,..._r(e)}):new ghe({type:"record",keyType:t,valueType:e,..._r(r)})}const xW=Ct("ZodEnum",(t,e)=>{rLt.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(n,i,s)=>gIt(t,n,i),t.enum=e.entries,t.options=Object.values(e.entries);const r=new Set(Object.keys(e.entries));t.extract=(n,i)=>{const s={};for(const a of n)if(r.has(a))s[a]=e.entries[a];else throw new Error(`Key ${a} not found in enum`);return new xW({...e,checks:[],..._r(i),entries:s})},t.exclude=(n,i)=>{const s={...e.entries};for(const a of n)if(r.has(a))delete s[a];else throw new Error(`Key ${a} not found in enum`);return new xW({...e,checks:[],..._r(i),entries:s})}});function ii(t,e){const r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new xW({type:"enum",entries:r,..._r(e)})}const ENt=Ct("ZodLiteral",(t,e)=>{nLt.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>mIt(t,r,n),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function na(t,e){return new ENt({type:"literal",values:Array.isArray(t)?t:[t],..._r(e)})}const ANt=Ct("ZodTransform",(t,e)=>{iLt.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>vIt(t,r),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new YAe(t.constructor.name);r.addIssue=s=>{if(typeof s=="string")r.issues.push(PE(s,r.value,e));else{const a=s;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=t),r.issues.push(PE(a))}};const i=e.transform(r.value,r);return i instanceof Promise?i.then(s=>(r.value=s,r.fallback=!0,r)):(r.value=i,r.fallback=!0,r)}});function MNt(t){return new ANt({type:"transform",transform:t})}const k7e=Ct("ZodOptional",(t,e)=>{f7e.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>b7e(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function mhe(t){return new k7e({type:"optional",innerType:t})}const RNt=Ct("ZodExactOptional",(t,e)=>{sLt.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>b7e(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function _Nt(t){return new RNt({type:"optional",innerType:t})}const LNt=Ct("ZodNullable",(t,e)=>{aLt.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>kIt(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function yhe(t){return new LNt({type:"nullable",innerType:t})}const INt=Ct("ZodDefault",(t,e)=>{oLt.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>EIt(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function NNt(t,e){return new INt({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():ZAe(e)}})}const DNt=Ct("ZodPrefault",(t,e)=>{lLt.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>AIt(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function ONt(t,e){return new DNt({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():ZAe(e)}})}const S7e=Ct("ZodNonOptional",(t,e)=>{cLt.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>SIt(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function PNt(t,e){return new S7e({type:"nonoptional",innerType:t,..._r(e)})}const $Nt=Ct("ZodCatch",(t,e)=>{uLt.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>MIt(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function BNt(t,e){return new $Nt({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}const FNt=Ct("ZodPipe",(t,e)=>{hLt.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>RIt(t,r,n,i),t.in=e.in,t.out=e.out});function vhe(t,e){return new FNt({type:"pipe",in:t,out:e})}const zNt=Ct("ZodReadonly",(t,e)=>{dLt.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>_It(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function VNt(t){return new zNt({type:"readonly",innerType:t})}const HNt=Ct("ZodCustom",(t,e)=>{fLt.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>yIt(t,r)});function GNt(t,e={}){return sIt(HNt,t,e)}function WNt(t,e){return aIt(t,e)}const wW=["summarize","extract-key-points","extract-todos","rewrite-proofread","translate","improve-writing","fix-spelling-grammar","make-shorter","make-longer","simplify-language","change-tone","continue-writing","custom"],qNt=["professional","friendly","casual","direct"],UNt=["en","zh-CN","zh-TW","ja","ko","es","fr","de","pt","pl"],jNt=["image/jpeg","image/png","image/webp","image/gif","application/pdf","application/json","text/plain","text/markdown","text/csv"],YNt=4,bhe=4*1024*1024,XNt=256*1024,KNt=8*1024*1024,E7e=t=>{if(!t||t.length%4!==0||!/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t))return null;const e=t.endsWith("==")?2:t.endsWith("=")?1:0;return t.length/4*3-e},ZNt=t=>t.startsWith("text/")||t==="application/json",EQ=["none","target-language","tone"],AQ=["append","replace","both"],uL=Ze().uuid();Yt({content:Ze().trim().min(1).max(500),sourceTurnId:uL.optional()}).strict();Yt({content:Ze().trim().min(1).max(500),version:sa().int().positive()}).strict();const QNt=Yt({memoId:Ze().trim().min(1).max(100).optional(),notebookId:Ze().trim().min(1).max(100).optional(),notebookTitle:Ze().trim().max(160).optional(),title:Ze().trim().max(160).optional(),selectionMarkdown:Ze().max(2e3).optional(),contentMarkdown:Ze().max(4e3).optional(),contentTruncated:Vn().optional(),diagramKind:ii(["mind-map","flowchart","architecture"]).optional()}).strict(),JNt=Yt({type:ii(["memo","notebook","tag"]),id:Ze().trim().min(1).max(100),title:Ze().trim().max(160).optional()}).strict();Yt({id:uL,threadId:uL,message:Ze().trim().min(1).max(4e3),useMemory:Vn().default(!0),allowNotes:Vn().default(!1),allowWrites:Vn().optional(),locale:ii(["zh-CN","en-US","ja","pl"]).default("en-US"),focus:QNt.optional(),mentions:Kn(JNt).max(8).optional(),attachmentIds:Kn(Ze().uuid()).max(4).optional()}).strict();Yt({id:Ze().trim().min(1).max(80),prompt:Ze().trim().min(1).max(200),inputType:ii(["free_text","single_select","multi_select"]),options:Kn(Yt({id:Ze().trim().min(1).max(80),label:Ze().trim().min(1).max(80)}).strict()).min(2).max(6).optional()}).strict();const eDt=Yt({questionId:Ze().trim().min(1).max(80),optionIds:Kn(Ze().trim().min(1).max(80)).max(6).optional(),text:Ze().trim().max(400).optional()}).strict();Yt({answers:Kn(eDt).max(3).optional()}).strict();Yt({name:Ze().trim().min(1).max(80),input:LD(Ze(),Dd()).default({}),callId:Ze().trim().min(1).max(100).optional(),response:Ze().max(16e3).optional(),process:Ze().max(32e3).optional()}).strict();Yt({response:Ze().max(16e3),process:Ze().max(32e3).optional()}).strict();Yt({response:Ze().max(16e3),process:Ze().max(32e3).optional(),status:ii(["completed","interrupted","failed"]),inputTokens:sa().int().nonnegative().optional(),outputTokens:sa().int().nonnegative().optional()}).strict();Yt({enabled:Vn(),learningEnabled:Vn().optional(),useMemory:Vn().optional(),version:sa().int().nonnegative()}).strict();const tDt=Ze().trim().min(1).max(180).refine(t=>t.split(/\r?\n/).length<=3,"Discovery body must contain at most 3 lines.");Yt({suggestion:Yt({kind:ii(["insight","merge","append","move","tag"]),title:Ze().trim().min(1).max(60),body:tDt,sourceIds:Kn(Ze().min(1).max(100)).min(1).max(5),memoryIds:Kn(Ze().max(100)).max(8).optional(),notebookId:Ze().max(100).nullable().optional(),tags:Kn(Ze().min(1).max(40)).max(5).optional(),targetId:Ze().max(100).nullable()}).nullable()});Yt({turnId:uL,output:Dd()}).strict();const MQ=Ze().trim().min(1).max(400),A7e=Ze().trim().min(1).max(100),rDt=Yt({kind:na("merge"),memoIds:Kn(A7e).min(2).max(5),title:Ze().trim().min(1).max(160),reason:MQ}).strict(),nDt=Yt({kind:na("tag"),memoId:A7e,tags:Kn(Ze().trim().min(1).max(40)).min(1).max(5),reason:MQ}).strict(),iDt=Yt({kind:na("tool"),toolName:Ze().min(1).max(80),arguments:LD(Ze(),Dd()),reason:MQ}).strict();C7e("kind",[rDt,nDt,iDt]);Yt({version:$E([na(1),na(2)]),memories:Kn(Yt({content:Ze().trim().min(1).max(500),kind:ii(["explicit","inferred"]).optional()})).max(50),controls:Yt({useMemory:Vn(),learningEnabled:Vn()}).optional()}).strict();const qv=(t,e,r,n,i)=>({...t,...e,translations:{"zh-CN":e,"en-US":r,ja:n,pl:i}});qv({key:"summarize",action:"summarize",parameterKind:"none",resultMode:"append"},{name:"精简总结",description:"压缩全文,提炼主题、结论与可执行结果",instruction:["对笔记做真正的精简总结,不要逐句改写、同义复述或回声式重写。","识别中心主题、主要主张、关键结论与可执行结果。","省略重复、修辞、举例、引语和次要细节,除非它们对理解关键结论必不可少。","较长笔记目标约为原文 20–30% 篇幅,用 3–7 条简洁 Markdown 要点;短笔记用 1–3 句即可。","不要大段照搬原文,也不要添加原文没有的信息。","保持笔记原语言,只返回 Markdown 总结。"].join("")},{name:"Summarize",description:"Condense the note into its topic, conclusions, and actionable outcomes",instruction:["Create a genuinely condensed summary of the note rather than rewriting, paraphrasing line by line, or echoing it. ","Identify the central topic, main claims, essential conclusions, and actionable outcomes. ","Omit repetition, rhetorical phrasing, examples, quotations, and minor details unless necessary to understand a key conclusion. ","For a substantial note, target roughly 20–30% of the source length and use 3–7 concise Markdown bullet points; for a short note, use 1–3 concise sentences. ","Do not reproduce long passages verbatim or add facts that are not present in the source. ","Preserve the note's language and return only the summary in Markdown."].join("")},{name:"要約する",description:"テーマ、結論、実行できる結果に圧縮する",instruction:["ノートを本当に要約してください。逐語の言い換え、行ごとの書き換え、エコーのような再述はしないでください。","中心テーマ、主要な主張、重要な結論、実行できる結果を抜き出してください。","繰り返し、修辞、例示、引用、枝葉の詳細は、重要な結論を理解するのに必要でない限り省いてください。","長いノートは原文のおよそ 20–30% を目安に、3–7 個の簡潔な Markdown 箇条書きにしてください。短いノートは 1–3 文で構いません。","長い原文をそのまま写したり、原文にない事実を足したりしないでください。","ノートの言語を保ち、Markdown の要約だけを返してください。"].join("")},{name:"Podsumuj",description:"Streść notatkę do tematu, wniosków i działań do podjęcia",instruction:["Utwórz faktycznie skondensowane podsumowanie notatki, zamiast ją przepisywać, parafrazować zdanie po zdaniu lub powtarzać. ","Wskaż główny temat, najważniejsze tezy, kluczowe wnioski i działania do podjęcia. ","Pomiń powtórzenia, ozdobniki retoryczne, przykłady, cytaty i drobne szczegóły, chyba że są niezbędne do zrozumienia kluczowego wniosku. ","W przypadku obszernej notatki celuj w około 20–30% długości oryginału i użyj 3–7 zwięzłych punktów listy Markdown; w przypadku krótkiej notatki wystarczą 1–3 zwięzłe zdania. ","Nie przytaczaj dosłownie długich fragmentów i nie dodawaj faktów, których nie ma w oryginale. ","Zachowaj język notatki i zwróć wyłącznie podsumowanie w formacie Markdown."].join("")}),qv({key:"translate",action:"translate",parameterKind:"target-language",resultMode:"both"},{name:"全文翻译",description:"翻译为指定目标语言,保留结构与格式",instruction:"将完整笔记翻译成用户指定的目标语言。保留原意、Markdown 结构、链接与代码块。只返回译文,不要评论。"},{name:"Translate",description:"Translate into a selected language while preserving formatting",instruction:"Translate the complete note into the target language specified by the user. Preserve its meaning, Markdown structure, links, and code blocks. Return only the translated note without commentary."},{name:"翻訳する",description:"指定した言語へ翻訳し、構造と書式を残す",instruction:"ノート全体を、ユーザーが指定した目標言語へ翻訳してください。意味、Markdown の構造、リンク、コードブロックは残してください。解説は付けず、訳文だけを返してください。"},{name:"Przetłumacz",description:"Przetłumacz na wybrany język, zachowując formatowanie",instruction:"Przetłumacz całą notatkę na język docelowy wskazany przez użytkownika. Zachowaj jej znaczenie, strukturę Markdown, linki i bloki kodu. Zwróć wyłącznie przetłumaczoną notatkę, bez komentarzy."}),qv({key:"improve-writing",action:"improve-writing",parameterKind:"none",resultMode:"both"},{name:"润色表达",description:"校正语言并提升文字的清晰度与流畅度",instruction:"润色内容,修正错别字、语法与标点,改善用词、句式、清晰度和流畅度,但不要改变原意或刻意缩短内容。保持原语言与有用的 Markdown 格式。只返回润色后的内容。"},{name:"Polish",description:"Correct the language and improve clarity and flow",instruction:"Polish the content by correcting spelling, grammar, and punctuation and improving word choice, sentence structure, clarity, and flow. Do not change its meaning or deliberately shorten it. Preserve its language and useful Markdown formatting. Return only the polished content."},{name:"文章を整える",description:"誤字と文法を直し、わかりやすさと流れを上げる",instruction:"内容を整えてください。誤字、文法、句読点を直し、語彙、文の形、明瞭さ、流れを改善します。意味を変えたり、意図的に短くしたりしないでください。元の言語と有用な Markdown 書式は残してください。整えた本文だけを返してください。"},{name:"Popraw styl",description:"Popraw język oraz zwiększ przejrzystość i płynność tekstu",instruction:"Dopracuj treść: popraw pisownię, gramatykę i interpunkcję oraz ulepsz dobór słów, budowę zdań, przejrzystość i płynność. Nie zmieniaj jej znaczenia ani celowo jej nie skracaj. Zachowaj jej język i przydatne formatowanie Markdown. Zwróć wyłącznie dopracowaną treść."}),qv({key:"make-shorter",action:"make-shorter",parameterKind:"none",resultMode:"both"},{name:"精炼表达",description:"删去重复与冗余,让表达更简洁有力",instruction:"精炼内容,删除重复、空话和不必要的修饰,合并可以合并的句子,使表达简洁、清晰、有力。保留所有关键事实、观点与原意,不要添加新信息。保持原语言与有用的 Markdown 格式。只返回精炼后的内容。"},{name:"Make concise",description:"Remove repetition and make the writing concise and direct",instruction:"Refine the content by removing repetition, filler, and unnecessary modifiers and by combining sentences where useful. Make it concise, clear, and direct while preserving every key fact, claim, and the original meaning. Do not add new information. Preserve its language and useful Markdown formatting. Return only the refined content."},{name:"簡潔にする",description:"重複と冗長さを削り、短くはっきり書く",instruction:"内容を簡潔にしてください。繰り返し、空疎な言い回し、不要な修飾を削り、まとめられる文はまとめて、短く、はっきり、力強くしてください。重要な事実、主張、元の意味はすべて残し、新しい情報は足さないでください。元の言語と有用な Markdown 書式は残してください。簡潔にした本文だけを返してください。"},{name:"Skróć i uprość",description:"Usuń powtórzenia i napisz tekst zwięźle i konkretnie",instruction:"Dopracuj treść, usuwając powtórzenia, puste frazy i zbędne określenia oraz łącząc zdania tam, gdzie to pomaga. Spraw, by tekst był zwięzły, jasny i konkretny, zachowując każdy kluczowy fakt, tezę i pierwotne znaczenie. Nie dodawaj nowych informacji. Zachowaj jej język i przydatne formatowanie Markdown. Zwróć wyłącznie dopracowaną treść."}),qv({key:"extract-todos",action:"extract-todos",parameterKind:"none",resultMode:"append"},{name:"提取待办",description:"识别可执行任务,生成任务清单",instruction:"从笔记中提取明确或隐含的可执行任务,用 Markdown 任务列表(- [ ])输出。保持原语言,不要编造任务。若没有可执行事项,用原文语言简短说明。"},{name:"Extract tasks",description:"Identify actionable work and produce a task list",instruction:"Extract explicit or implied actionable tasks from the note as a Markdown task list using '- [ ]'. Preserve its language and do not invent tasks. If there are no actionable tasks, say so briefly in the note's language."},{name:"タスクを抜き出す",description:"実行できる作業を見つけ、チェックリストにする",instruction:"ノートから明示または含意された実行可能なタスクを抜き出し、Markdown のタスクリスト(- [ ])で出力してください。ノートの言語を保ち、タスクを捏造しないでください。実行できることがなければ、ノートの言語で短くそう書いてください。"},{name:"Wyodrębnij zadania",description:"Znajdź działania do wykonania i utwórz listę zadań",instruction:"Wyodrębnij z notatki jawne lub domniemane zadania do wykonania jako listę zadań Markdown z użyciem '- [ ]'. Zachowaj jej język i nie wymyślaj zadań. Jeśli nie ma zadań do wykonania, napisz to krótko w języku notatki."}),qv({key:"continue-writing",action:"continue-writing",parameterKind:"none",resultMode:"append"},{name:"继续写作",description:"从笔记末尾自然续写",instruction:"从笔记结束处自然续写。只返回新增续写内容,不要重复原文。保持原语言与 Markdown 风格。"},{name:"Continue writing",description:"Continue naturally from the end of the note",instruction:"Continue writing naturally from where the note ends. Return only the new continuation, not the original content. Preserve its language and Markdown style."},{name:"続きを書く",description:"ノートの末尾から自然に書き継ぐ",instruction:"ノートの終わりから自然に書き継いでください。原文は繰り返さず、新しい続きだけを返してください。元の言語と Markdown の調子を保ってください。"},{name:"Pisz dalej",description:"Kontynuuj naturalnie od końca notatki",instruction:"Kontynuuj pisanie naturalnie od miejsca, w którym kończy się notatka. Zwróć wyłącznie nową kontynuację, bez oryginalnej treści. Zachowaj jej język i styl Markdown."});const sDt=new Set([qf,tb]),hC=(t,e)=>{var n;const r=(n=t.attrs)==null?void 0:n[e];return typeof r=="string"?r:""},xhe="edgeever-attachment-kind-",RQ=t=>t.replace(/^\s*(?:附件[::]|Attachment:)\s*/i,"").trim(),M7e=(t,e,r)=>{const n=typeof r=="string"?r.split(/\s+/).filter(s=>s&&s!=="edgeever-attachment-link"&&!s.startsWith(xhe)):[],i=f5(e,RQ(t));return[...n,"edgeever-attachment-link",`${xhe}${i}`].join(" ")},aDt=Wi.create({name:"edgeeverNativeAttachmentMetadata",addGlobalAttributes(){return[{types:["link"],attributes:{attachmentFilename:{default:null,parseHTML:t=>t.getAttribute("data-attachment-filename"),renderHTML:t=>t.attachmentFilename?{"data-attachment-filename":String(t.attachmentFilename)}:{}},attachmentMimeType:{default:null,parseHTML:t=>t.getAttribute("data-attachment-mime-type"),renderHTML:t=>t.attachmentMimeType?{"data-attachment-mime-type":String(t.attachmentMimeType)}:{}},attachmentByteSize:{default:null,parseHTML:t=>Tg(t.getAttribute("data-attachment-byte-size")),renderHTML:t=>{const e=Tg(t.attachmentByteSize),r=typeof t.attachmentFilename=="string"?t.attachmentFilename:"",n=typeof t.attachmentMimeType=="string"?t.attachmentMimeType:"";return!r&&!n&&e===null?{}:{...e===null?{}:{"data-attachment-byte-size":String(e)},"data-attachment-meta":GMt(n,r,e)}}}}}]}}),whe=t=>{var n,i;if(t.type!=="link")return!1;const e=typeof((n=t.attrs)==null?void 0:n.href)=="string"?t.attrs.href:"";return(typeof((i=t.attrs)==null?void 0:i.class)=="string"?t.attrs.class:"").split(/\s+/).includes("edgeever-attachment-link")||e.includes("/api/v1/resources/")},oDt=t=>{var e;return(e=t.marks)!=null&&e.some(whe)?{...t,marks:t.marks.map(r=>{var n,i;return whe(r)?{...r,attrs:{...r.attrs,class:M7e(t.text,null,(n=r.attrs)==null?void 0:n.class),attachmentFilename:typeof((i=r.attrs)==null?void 0:i.attachmentFilename)=="string"?r.attrs.attachmentFilename:RQ(t.text)}}:r})}:t},lDt=t=>{var a;const e=hC(t,"url"),r=hC(t,"label")||hC(t,"filename")||"Attachment",n=hC(t,"mimeType"),i=hC(t,"filename")||RQ(r),s=Tg((a=t.attrs)==null?void 0:a.byteSize);return{type:"text",text:r,...e?{marks:[{type:"link",attrs:{href:e,target:"_blank",class:M7e(r,n),attachmentFilename:i,attachmentMimeType:n,attachmentByteSize:s}}]}:{}}},cDt=t=>{const e=r=>sDt.has(r.type)?lDt(r):"content"in r&&r.content?{...r,content:r.content.map(e)}:r.type==="text"?oDt(r):r;return{...t,content:t.content.map(r=>e(r))}},uDt="edgeever-zip",hDt=2,vh=Ze().datetime();Yt({format:na(uDt),formatVersion:$E([na(1),na(hDt)]),schemaVersion:sa().int().positive(),edgeeverVersion:Ze().trim().min(1),buildId:Ze().trim().min(1),exportedAt:vh,includesTrash:na(!1),counts:Yt({notebooks:sa().int().min(0),memos:sa().int().min(0),revisions:sa().int().min(0),resources:sa().int().min(0),prompts:sa().int().min(0).optional()})});const dDt=Yt({id:Ze().trim().min(1),parentId:Ze().trim().min(1).nullable(),name:Ze().trim().min(1).max(80),slug:Ze().nullable(),icon:Ze().nullable(),color:Ze().nullable(),sortOrder:sa().int(),createdAt:vh,updatedAt:vh}),fDt=Yt({id:Ze().trim().min(1),memoId:Ze().trim().min(1),revision:sa().int().min(0),title:Ze().nullable(),tags:Kn(Ze()),contentJson:Dd(),contentMarkdown:Ze(),contentText:Ze(),contentHash:Ze(),createdBy:Ze(),createdAt:vh}),pDt=Yt({id:Ze().trim().min(1),notebookId:Ze().trim().min(1),title:Ze().nullable(),excerpt:Ze(),tags:Kn(Ze()),isPinned:Vn(),isArchived:Vn(),isDeleted:Vn(),revision:sa().int().min(0),createdAt:vh,updatedAt:vh,deletedAt:vh.nullable(),contentJson:Dd(),contentMarkdown:Ze(),contentText:Ze(),contentHash:Ze(),sourceMemoIds:Kn(Ze()),mergeSourceCount:sa().int().min(0),mergedIntoMemoId:Ze().nullable()}),R7e=Yt({memo:pDt,revisions:Kn(fDt),resources:Kn(Yt({id:Ze().trim().min(1),memoId:Ze().trim().min(1),originalMemoId:Ze().nullable(),kind:ii(["image","attachment"]),mimeType:Ze().nullable(),filename:Ze().nullable(),byteSize:sa().int().min(0),sha256:Ze().nullable(),width:sa().int().positive().nullable(),height:sa().int().positive().nullable(),createdAt:vh,updatedAt:vh,archivePath:Ze().trim().min(1)}))});Yt({notebooks:Kn(dDt).min(1).max(100)});Yt({memos:Kn(R7e).min(1).max(10)});const gDt=Yt({id:Ze().trim().min(1).max(200),origin:ii(["default","custom"]),seedKey:ii(wW.filter(t=>t!=="custom")).nullable(),action:ii(wW),parameterKind:ii(EQ),resultMode:ii(AQ),nameCustomized:Vn(),descriptionCustomized:Vn(),instructionCustomized:Vn(),name:Ze().trim().min(1).max(80),description:Ze().max(200).nullable(),instruction:Ze().trim().min(1).max(2e3),createdAt:vh,updatedAt:vh}).superRefine((t,e)=>{t.origin==="default"&&!t.seedKey&&e.addIssue({code:"custom",path:["seedKey"],message:"A default prompt must include a seed key."}),t.origin==="default"&&t.seedKey&&t.action!==t.seedKey&&e.addIssue({code:"custom",path:["action"],message:"A default prompt action must match its seed key."}),t.origin==="custom"&&(t.seedKey!==null||t.action!=="custom")&&e.addIssue({code:"custom",path:["origin"],message:"A custom prompt cannot use factory prompt identity."})});Yt({prompts:Kn(gDt).max(100)});R7e.shape.resources.element;const dC=(t,e,r,n,i)=>({...t,translations:{"zh-CN":e,"en-US":r,ja:n,pl:i}});dC({key:"quick-note",translationKey:"quickNote",tag:"quick-note"},{title:"灵感速记",description:"快速捕捉闪念、临时灵感、资料链接与即刻行动。",contentMarkdown:`## 💡 闪念记录--+-## 📌 背景与补充说明@@ -1534,7 +1534,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.- [ ] `},{title:"Quick Spark",description:"Capture fleeting thoughts, ideas, links, and immediate action items.",contentMarkdown:`## 💡 Fleeting Thoughts--+-## 📌 Context & Notes@@ -1544,7 +1544,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.- [ ] `},{title:"ひらめきメモ",description:"ふとした思いつき、アイデア、リンク、すぐやることをすばやく書き留めます。",contentMarkdown:`## 💡 ひらめき--+-## 📌 背景と補足@@ -1554,7 +1554,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.- [ ] `},{title:"Szybka notatka",description:"Zapisuj ulotne myśli, pomysły, linki i działania do natychmiastowego podjęcia.",contentMarkdown:`## 💡 Ulotne myśli--+-## 📌 Kontekst i uwagi@@ -1572,7 +1572,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.## 🎯 会议目标--+-## 💬 核心讨论与决策@@ -1598,7 +1598,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.## 🎯 Goal--+-## 💬 Discussion & Decisions@@ -1624,7 +1624,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.## 🎯 会議の目的--+-## 💬 議論と決定@@ -1650,7 +1650,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.## 🎯 Cel--+-## 💬 Dyskusja i decyzje@@ -1679,13 +1679,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.## 🎯 下周优先级 (Next Week Priorities)-- [ ]-- [ ]-- [ ]+- [ ]+- [ ]+- [ ]## 💡 总结与思考--+-`},{title:"Weekly Review & Status",description:"Summarize weekly highlights, blockers, and next week's key priorities.",contentMarkdown:`# 🗓️ Weekly Status Report## 🌟 Highlights@@ -1699,13 +1699,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.## 🎯 Next Week Priorities-- [ ]-- [ ]-- [ ]+- [ ]+- [ ]+- [ ]## 💡 Reflection & Insights--+-`},{title:"週次レビュー",description:"今週の成果、ブロッカー、来週の優先事項を整理します。",contentMarkdown:`# 🗓️ 週次レポート## 🌟 今週のハイライト@@ -1719,13 +1719,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.## 🎯 来週の優先事項-- [ ]-- [ ]-- [ ]+- [ ]+- [ ]+- [ ]## 💡 振り返り--+-`},{title:"Przegląd tygodnia i postępy",description:"Podsumuj najważniejsze osiągnięcia tygodnia, blokery i kluczowe priorytety na kolejny tydzień.",contentMarkdown:`# 🗓️ Tygodniowy raport postępów## 🌟 Najważniejsze osiągnięcia@@ -1739,13 +1739,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.## 🎯 Priorytety na kolejny tydzień-- [ ]-- [ ]-- [ ]+- [ ]+- [ ]+- [ ]## 💡 Refleksje i wnioski--+-`}),dC({key:"reading",translationKey:"reading",tag:"reading"},{title:"深度阅读卡片",description:"提炼核心观点、精妙摘录、个人理解与关联知识卡片。",contentMarkdown:`# 📖 深度阅读卡片- **书名/文章**:@@ -1756,7 +1756,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.## 💡 一句话总结 (Key Takeaway)->+>## ✍️ 核心观点与金句摘录@@ -1765,7 +1765,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.## 🧠 我的理解与延伸思考--+-## 🔗 关联知识与行动@@ -1780,7 +1780,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.## 💡 Key Takeaway->+>## ✍️ Highlights & Quotes@@ -1789,7 +1789,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.## 🧠 Personal Reflections--+-## 🔗 Action & Practice@@ -1804,7 +1804,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.## 💡 一言まとめ->+>## ✍️ 要点と引用@@ -1813,7 +1813,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.## 🧠 自分の理解と考察--+-## 🔗 関連知識とアクション@@ -1828,7 +1828,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.## 💡 Najważniejszy wniosek->+>## ✍️ Najciekawsze fragmenty i cytaty@@ -1837,7 +1837,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.## 🧠 Własne refleksje--+-## 🔗 Działanie i praktyka@@ -1851,7 +1851,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.## 📌 目标 (Objective)->+>## 📈 关键结果 (Key Results)@@ -1865,8 +1865,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.## 📋 执行任务清单-- [ ]-- [ ]+- [ ]+- [ ]`},{title:"Goal & Task Breakdown",description:"Define OKRs, Key Results, milestones, and task checklists.",contentMarkdown:`# 🎯 Goal Breakdown- **Period**:@@ -1876,7 +1876,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.## 📌 Objective->+>## 📈 Key Results@@ -1890,8 +1890,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.## 📋 Execution Checklist-- [ ]-- [ ]+- [ ]+- [ ]`},{title:"目標とタスク分解",description:"OKR の目標、主要な結果、マイルストーン、実行チェックリストを定義します。",contentMarkdown:`# 🎯 目標の分解- **期間**:@@ -1901,7 +1901,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.## 📌 目標 (Objective)->+>## 📈 主要な結果 (Key Results)@@ -1915,8 +1915,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.## 📋 実行チェックリスト-- [ ]-- [ ]+- [ ]+- [ ]`},{title:"Cele i podział zadań",description:"Określ cele OKR, kluczowe rezultaty, kamienie milowe i listy zadań.",contentMarkdown:`# 🎯 Podział celu- **Okres**:@@ -1926,7 +1926,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.## 📌 Cel (Objective)->+>## 📈 Kluczowe rezultaty (Key Results)@@ -1940,13 +1940,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.## 📋 Lista zadań do wykonania-- [ ]-- [ ]+- [ ]+- [ ]`});const mDt=["clay","orange","dawn","teal","azure","violet","pink","slate"],yDt=["native",...mDt],vDt=8*1024;Yt({name:Ze().trim().min(1).max(80),parentId:Ze().trim().min(1).nullable().optional()});Yt({name:Ze().trim().min(1).max(80).optional(),parentId:Ze().trim().min(1).nullable().optional(),sortOrder:sa().int().optional()});Yt({notebookId:Ze().trim().min(1),title:Ze().trim().max(160).optional(),contentJson:Dd().optional(),contentMarkdown:Ze().optional(),tags:Kn(Ze()).optional(),createdAt:Ze().datetime().optional(),updatedAt:Ze().datetime().optional()});Yt({expectedRevision:sa().int().min(0).optional(),expectedContentHash:Ze().length(64).optional(),editSessionId:Ze().trim().min(1).optional(),notebookId:Ze().trim().min(1).optional(),title:Ze().trim().max(160).optional(),isPinned:Vn().optional(),contentJson:Dd().optional(),contentMarkdown:Ze().optional(),tags:Kn(Ze()).optional(),createdAt:Ze().datetime().optional(),updatedAt:Ze().datetime().optional(),allowDestructiveOverwrite:Vn().optional()});Yt({name:Ze().trim().min(1).max(160),description:Ze().trim().max(500).optional(),memoId:Ze().trim().min(1).optional(),title:Ze().trim().max(160).nullable().optional(),contentMarkdown:Ze().optional(),tags:Kn(Ze()).optional()}).refine(t=>t.memoId||t.contentMarkdown!==void 0,{message:"memoId or contentMarkdown is required"});Yt({name:Ze().trim().min(1).max(160).optional(),description:Ze().trim().max(500).nullable().optional(),title:Ze().trim().max(160).nullable().optional(),contentMarkdown:Ze().optional(),tags:Kn(Ze()).optional()});Yt({notebookId:Ze().trim().min(1)});const _7e=Yt({pluginId:Ze().trim().min(3).max(200),commandId:Ze().trim().min(1).max(200)}),bDt=Yt({name:Ze().trim().min(1).max(120),taskType:na("plugin-command"),taskPayload:_7e,cronExpression:Ze().trim().min(1).max(160),timezone:Ze().trim().min(1).max(80),executorDeviceId:Ze().trim().min(16).max(160),missedRunPolicy:ii(["run-once","skip"]).default("run-once"),isEnabled:Vn().default(!0)});bDt.omit({taskType:!0,taskPayload:!0,executorDeviceId:!0}).partial().extend({taskPayload:_7e.optional(),executorDeviceId:Ze().trim().min(16).max(160).optional()}).refine(t=>Object.values(t).some(e=>e!==void 0),{message:"At least one field is required."});Yt({pluginId:Ze().trim().min(3).max(200),scheduleKey:Ze().trim().regex(/^[a-z0-9][a-z0-9._-]*$/i).max(120),name:Ze().trim().min(1).max(120),commandId:Ze().trim().min(1).max(200),cronExpression:Ze().trim().min(1).max(160),timezone:Ze().trim().min(1).max(80),executorDeviceId:Ze().trim().min(16).max(160),missedRunPolicy:ii(["run-once","skip"]).default("run-once"),isEnabled:Vn().optional()});Yt({scheduledFor:Ze().datetime(),executorDeviceId:Ze().trim().min(16).max(160)});Yt({executorDeviceId:Ze().trim().min(16).max(160),status:ii(["succeeded","failed"]),errorMessage:Ze().trim().max(2e3).nullable().optional()});const The=Ze().trim().max(2e3).refine(t=>{try{const e=new URL(t);return e.protocol==="http:"||e.protocol==="https:"}catch{return!1}},{message:"URL must use http or https."});Yt({type:ii(["plugin","theme"]),version:Ze().trim().regex(/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/).max(80),enabled:Vn(),installedAt:Ze().datetime(),manifestUrl:The,sourceKind:ii(["marketplace","github","manifest"]),verified:Vn(),repositoryUrl:The.max(500).nullable().optional(),releaseTag:Ze().trim().min(1).max(80).nullable().optional(),publisher:na("edgeever").nullable().optional()}).refine(t=>t.sourceKind==="github"?!!t.repositoryUrl:t.sourceKind==="marketplace"?!!(t.repositoryUrl||t.manifestUrl):!0,{message:"GitHub and marketplace extensions require a source URL."});Yt({memoIds:Kn(Ze().trim().min(1)).min(1).max(100),notebookId:Ze().trim().min(1)});Yt({memoIds:Kn(Ze().trim().min(1)).min(1).max(100),permanent:Vn().optional()});Yt({memoIds:Kn(Ze().trim().min(1)).min(2).max(50),notebookId:Ze().trim().min(1).optional(),title:Ze().trim().max(160).optional()});Yt({username:Ze().trim().min(1).max(80),password:Ze().min(1).max(512),deviceId:Ze().trim().min(16).max(160).optional()});Yt({label:Ze().trim().max(80).nullable()});Yt({currentPassword:Ze().min(1).max(512),newPassword:Ze().min(8).max(512),confirmPassword:Ze().min(8).max(512)}).refine(t=>t.newPassword===t.confirmPassword,{message:"New passwords do not match.",path:["confirmPassword"]});Yt({username:Ze().trim().min(1).max(80),displayName:Ze().trim().max(80).nullable().optional(),password:Ze().min(8).max(512)});Yt({displayName:Ze().trim().max(80).nullable().optional(),password:Ze().min(8).max(512).optional(),isDisabled:Vn().optional()}).refine(t=>Object.keys(t).length>0,"At least one field is required.");Yt({name:Ze().trim().min(1).max(80),scopes:Kn(Ze().trim().min(1).max(80)).min(1).max(32),expiresAt:Ze().datetime().nullable().optional()});Yt({name:Ze().trim().min(1).max(80)});Yt({filename:Ze().trim().min(1).max(160)});const L7e=Ze().trim().url().max(500).refine(t=>t.startsWith("https://")||t.startsWith("http://"),"Object storage endpoint must use HTTP or HTTPS.");C7e("provider",[Yt({provider:na("builtin")}),Yt({provider:na("s3"),displayName:Ze().trim().min(1).max(80),endpoint:L7e,region:Ze().trim().min(1).max(80),bucket:Ze().trim().min(1).max(255),accessKeyId:Ze().trim().min(1).max(256),secretAccessKey:Ze().min(1).max(1024).optional(),forcePathStyle:Vn().default(!0),objectPrefix:Ze().trim().max(500).default("")})]);Yt({endpoint:L7e,region:Ze().trim().min(1).max(80),bucket:Ze().trim().min(1).max(255),accessKeyId:Ze().trim().min(1).max(256),secretAccessKey:Ze().min(1).max(1024).optional(),forcePathStyle:Vn().default(!0),objectPrefix:Ze().trim().max(500).default("")});const I7e=ii(["openai-compatible","anthropic","google"]),N7e=ii(["openai-compatible"]),D7e=(t,e)=>{let r;try{r=new URL(t)}catch{e.addIssue({code:"custom",message:"AI Base URL must be a valid URL."});return}r.protocol!=="http:"&&r.protocol!=="https:"&&e.addIssue({code:"custom",message:"AI Base URL must use HTTP or HTTPS."}),(r.username||r.password)&&e.addIssue({code:"custom",message:"AI Base URL must not contain credentials."})},O7e=Ze().trim().url().max(500).superRefine(D7e),P7e=Ze().trim().min(1).max(500).superRefine((t,e)=>{if(!Ze().url().safeParse(t).success){e.addIssue({code:"custom",message:"AI Base URL must be a valid URL."});return}D7e(t,e)});Yt({provider:N7e.default("openai-compatible"),displayName:Ze().trim().min(1).max(80),baseUrl:P7e,apiKey:Ze().trim().min(1).max(4096),isEnabled:Vn().default(!0),initialModelId:Ze().trim().min(1).max(200).optional()});Yt({provider:N7e.default("openai-compatible"),displayName:Ze().trim().min(1).max(80),baseUrl:P7e,apiKey:Ze().trim().min(1).max(4096).optional(),isEnabled:Vn().default(!0)});Yt({modelId:Ze().trim().min(1).max(200),displayName:Ze().trim().min(1).max(80).optional()});Yt({modelConfigId:Ze().trim().min(1).nullable()});const $7e=Yt({provider:I7e,displayName:Ze().trim().min(1).max(80),baseUrl:O7e,isEnabled:Vn().default(!0)});$7e.extend({apiKey:Ze().min(1).max(4096),initialModelId:Ze().trim().min(1).max(200).optional()});$7e.extend({apiKey:Ze().min(1).max(4096).optional()});Yt({modelId:Ze().trim().min(1).max(200),provider:I7e.optional(),baseUrl:O7e.optional(),apiKey:Ze().min(1).max(4096).optional()});Yt({modelId:Ze().trim().min(1).max(200),displayName:Ze().trim().min(1).max(200).optional()});Yt({modelConfigId:Ze().trim().min(1).nullable()});const xDt=Yt({filename:Ze().trim().min(1).max(255).regex(/^[^\u0000-\u001F\u007F]+$/),mediaType:ii(jNt),base64Data:Ze().min(1).max(Math.ceil(bhe/3)*4)}).superRefine((t,e)=>{const r=E7e(t.base64Data);if(r===null){e.addIssue({code:"custom",path:["base64Data"],message:"Attachment data must be valid base64."});return}const n=ZNt(t.mediaType)?XNt:bhe;r>n&&e.addIssue({code:"custom",path:["base64Data"],message:"The attachment is too large."})});Yt({action:ii(wW),promptId:Ze().trim().min(1).max(200).optional(),locale:Ze().trim().min(2).max(35).optional(),title:Ze().trim().max(160).default(""),contentMarkdown:Ze().max(3e5),stream:Vn().default(!1),targetLanguage:ii(UNt).optional(),tone:ii(qNt).optional(),instruction:Ze().trim().min(1).max(2e3).optional(),attachments:Kn(xDt).max(YNt).default([])}).superRefine((t,e)=>{!t.promptId&&t.action==="translate"&&!t.targetLanguage&&e.addIssue({code:"custom",path:["targetLanguage"],message:"A target language is required for translation."}),!t.promptId&&t.action==="change-tone"&&!t.tone&&e.addIssue({code:"custom",path:["tone"],message:"A tone is required when changing tone."}),!t.promptId&&t.action==="custom"&&!t.instruction&&e.addIssue({code:"custom",path:["instruction"],message:"An instruction is required for a custom action."});const r=t.action==="custom"&&!!(t.instruction||t.promptId);!t.title&&!t.contentMarkdown.trim()&&t.attachments.length===0&&!r&&e.addIssue({code:"custom",path:["contentMarkdown"],message:"Note content is required."}),t.attachments.reduce((i,s)=>i+(E7e(s.base64Data)??0),0)>KNt&&e.addIssue({code:"custom",path:["attachments"],message:"The attachments are too large in total."})});Yt({title:Ze().trim().max(160).default(""),contentMarkdown:Ze().max(3e5),currentTags:Kn(Ze().trim().min(1).max(200)).max(24).default([]),locale:Ze().trim().min(2).max(35).optional()}).superRefine((t,e)=>{!t.title&&!t.contentMarkdown.trim()&&e.addIssue({code:"custom",path:["contentMarkdown"],message:"Note content is required."})});Yt({name:Ze().trim().min(1).max(80),description:Ze().trim().max(200).optional(),instruction:Ze().trim().min(1).max(2e3),parameterKind:ii(EQ).default("none"),resultMode:ii(AQ).default("both")});Yt({name:Ze().trim().min(1).max(80).optional(),description:Ze().trim().max(200).nullable().optional(),instruction:Ze().trim().min(1).max(2e3).optional(),parameterKind:ii(EQ).optional(),resultMode:ii(AQ).optional()}).refine(t=>Object.values(t).some(e=>e!==void 0),{message:"At least one field is required."});Yt({passwordProtected:Vn()});Yt({bodyFont:ii(["wenkai","wenkai-screen","zhuque","source-han-serif","neo-zhi-song","source-han-sans","source-serif"]).nullable()});const hp=Ze().regex(/^#[0-9a-f]{6}$/i),Che=Yt({background:hp,text:hp,muted:hp,heading:hp,accent:hp,soft:hp,codeBackground:hp,border:hp});Yt({fontSize:$E([na(14),na(16),na(18),na(20)]).nullable().optional(),lineHeight:$E([na(1.5),na(1.65),na(2)]).nullable().optional(),palette:ii(yDt).nullable().optional(),customCss:Ze().refine(t=>new TextEncoder().encode(t).byteLength<=vDt).nullable().optional(),customColors:Yt({light:Che,dark:Che}).nullable().optional()}).refine(t=>Object.values(t).some(e=>e!==void 0),{message:"At least one field is required."});Yt({password:Ze().min(1).max(64)});const wDt=Yt({fieldId:Ze().trim().min(1).max(80),required:Vn()});Yt({enabled:Vn(),passwordProtected:Vn(),rotatePassword:Vn().optional(),title:Ze().trim().max(120),description:Ze().trim().max(1e3),submitLabel:Ze().trim().max(40),fields:Kn(wDt).max(40)});Yt({cells:LD(Ze().max(80),Dd())});const B7e="3.9.3",TDt=B7e,khe=typeof TextDecoder=="function"?new TextDecoder("utf-8",{ignoreBOM:!0}):void 0,She=typeof TextEncoder=="function"?new TextEncoder:void 0,CDt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",nk=Array.prototype.slice.call(CDt),s8=(t=>{let e={};return t.forEach((r,n)=>e[r]=n),e})(nk),kDt=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,vo=String.fromCharCode.bind(String),SDt=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):t=>new Uint8Array(Array.prototype.slice.call(t,0)),F7e=t=>t.replace(/=/g,"").replace(/[+\/]/g,e=>e=="+"?"-":"_"),z7e=t=>t.replace(/[^A-Za-z0-9\+\/]/g,""),V7e=t=>{let e,r,n,i,s="";const a=t.length%3;for(let o=0;o<t.length;){if((r=t.charCodeAt(o++))>255||(n=t.charCodeAt(o++))>255||(i=t.charCodeAt(o++))>255)throw new TypeError("invalid character found");e=r<<16|n<<8|i,s+=nk[e>>18&63]+nk[e>>12&63]+nk[e>>6&63]+nk[e&63]}return a?s.slice(0,a-3)+"===".substring(a):s},_Q=typeof btoa=="function"?t=>btoa(t):V7e,TW=typeof Uint8Array.prototype.toBase64=="function"?t=>t.toBase64():t=>{let r=[];for(let n=0,i=t.length;n<i;n+=4096)r.push(vo.apply(null,t.subarray(n,n+4096)));return _Q(r.join(""))},jM=(t,e=!1)=>e?F7e(TW(t)):TW(t),EDt=t=>{if(t.length<2){var e=t.charCodeAt(0);return e<128?t:e<2048?vo(192|e>>>6)+vo(128|e&63):vo(224|e>>>12&15)+vo(128|e>>>6&63)+vo(128|e&63)}else{var e=65536+(t.charCodeAt(0)-55296)*1024+(t.charCodeAt(1)-56320);return vo(240|e>>>18&7)+vo(128|e>>>12&63)+vo(128|e>>>6&63)+vo(128|e&63)}},ADt=/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\x00-\x7F]/g,H7e=t=>t.replace(ADt,EDt),Ehe=She?t=>TW(She.encode(t)):t=>_Q(H7e(t)),Nb=(t,e=!1)=>e?F7e(Ehe(t)):Ehe(t),Ahe=t=>Nb(t,!0),MDt=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,RDt=t=>{switch(t.length){case 4:var e=(7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3),r=e-65536;return vo((r>>>10)+55296)+vo((r&1023)+56320);case 3:return vo((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return vo((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},G7e=t=>t.replace(MDt,RDt),W7e=t=>{if(t=t.replace(/\s+/g,""),!kDt.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(t.length&3));let e,r,n,i=[];for(let s=0;s<t.length;)e=s8[t.charAt(s++)]<<18|s8[t.charAt(s++)]<<12|(r=s8[t.charAt(s++)])<<6|(n=s8[t.charAt(s++)]),r===64?i.push(vo(e>>16&255)):n===64?i.push(vo(e>>16&255,e>>8&255)):i.push(vo(e>>16&255,e>>8&255,e&255));return i.join("")},LQ=typeof atob=="function"?t=>atob(z7e(t)):W7e,q7e=typeof Uint8Array.fromBase64=="function"?t=>Uint8Array.fromBase64(t):t=>SDt(LQ(t).split("").map(e=>e.charCodeAt(0))),U7e=t=>q7e(j7e(t)),_Dt=khe?t=>khe.decode(q7e(t)):t=>G7e(LQ(t)),j7e=t=>z7e(t.replace(/[-_]/g,e=>e=="-"?"+":"/")),CW=t=>_Dt(j7e(t)),LDt=t=>{if(typeof t!="string")return!1;const e=t.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(e)||!/[^\s0-9a-zA-Z\-_]/.test(e)},Y7e=t=>({value:t,enumerable:!1,writable:!0,configurable:!0}),X7e=function(){const t=(e,r)=>Object.defineProperty(String.prototype,e,Y7e(r));t("fromBase64",function(){return CW(this)}),t("toBase64",function(e){return Nb(this,e)}),t("toBase64URI",function(){return Nb(this,!0)}),t("toBase64URL",function(){return Nb(this,!0)}),t("toUint8Array",function(){return U7e(this)})},K7e=function(){const t=(e,r)=>Object.defineProperty(Uint8Array.prototype,e,Y7e(r));t("toBase64",function(e){return jM(this,e)}),t("toBase64URI",function(){return jM(this,!0)}),t("toBase64URL",function(){return jM(this,!0)})},IDt=()=>{X7e(),K7e()},NDt={version:B7e,VERSION:TDt,atob:LQ,atobPolyfill:W7e,btoa:_Q,btoaPolyfill:V7e,fromBase64:CW,toBase64:Nb,encode:Nb,encodeURI:Ahe,encodeURL:Ahe,utob:H7e,btou:G7e,decode:CW,isValid:LDt,fromUint8Array:jM,toUint8Array:U7e,extendString:X7e,extendUint8Array:K7e,extendBuiltins:IDt},ll="#f8fafb",cl="#191e1b",Mhe={client:[{tagName:"path",attrs:{d:"M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8"}},{tagName:"path",attrs:{d:"M10 19v-3.96 3.15"}},{tagName:"path",attrs:{d:"M7 19h5"}},{tagName:"rect",attrs:{width:"6",height:"10",x:"16",y:"12",rx:"2"}}],webApp:[{tagName:"rect",attrs:{x:"2",y:"4",width:"20",height:"16",rx:"2"}},{tagName:"path",attrs:{d:"M10 4v4"}},{tagName:"path",attrs:{d:"M2 8h20"}},{tagName:"path",attrs:{d:"M6 4v4"}}],mobileApp:[{tagName:"rect",attrs:{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2"}},{tagName:"path",attrs:{d:"M12 18h.01"}}],website:[{tagName:"path",attrs:{d:"M21.54 15H17a2 2 0 0 0-2 2v4.54"}},{tagName:"path",attrs:{d:"M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17"}},{tagName:"path",attrs:{d:"M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05"}},{tagName:"circle",attrs:{cx:"12",cy:"12",r:"10"}}],apiClient:[{tagName:"path",attrs:{d:"m18 16 4-4-4-4"}},{tagName:"path",attrs:{d:"m6 8-4 4 4 4"}},{tagName:"path",attrs:{d:"m14.5 4-5 16"}}],service:[{tagName:"rect",attrs:{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2"}},{tagName:"rect",attrs:{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2"}},{tagName:"line",attrs:{x1:"6",x2:"6.01",y1:"6",y2:"6"}},{tagName:"line",attrs:{x1:"6",x2:"6.01",y1:"18",y2:"18"}}],cpu:[{tagName:"path",attrs:{d:"M12 20v2"}},{tagName:"path",attrs:{d:"M12 2v2"}},{tagName:"path",attrs:{d:"M17 20v2"}},{tagName:"path",attrs:{d:"M17 2v2"}},{tagName:"path",attrs:{d:"M2 12h2"}},{tagName:"path",attrs:{d:"M2 17h2"}},{tagName:"path",attrs:{d:"M2 7h2"}},{tagName:"path",attrs:{d:"M20 12h2"}},{tagName:"path",attrs:{d:"M20 17h2"}},{tagName:"path",attrs:{d:"M20 7h2"}},{tagName:"path",attrs:{d:"M7 20v2"}},{tagName:"path",attrs:{d:"M7 2v2"}},{tagName:"rect",attrs:{x:"4",y:"4",width:"16",height:"16",rx:"2"}},{tagName:"rect",attrs:{x:"8",y:"8",width:"8",height:"8",rx:"1"}}],gpu:[{tagName:"path",attrs:{d:"M2 17h18a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2H2"}},{tagName:"path",attrs:{d:"M2 21V3"}},{tagName:"path",attrs:{d:"M7 17v3a1 1 0 0 0 1 1h5a1 1 0 0 0 1-1v-3"}},{tagName:"circle",attrs:{cx:"16",cy:"11",r:"2"}},{tagName:"circle",attrs:{cx:"8",cy:"11",r:"2"}}],memory:[{tagName:"path",attrs:{d:"M12 12v-2"}},{tagName:"path",attrs:{d:"M12 18v-2"}},{tagName:"path",attrs:{d:"M16 12v-2"}},{tagName:"path",attrs:{d:"M16 18v-2"}},{tagName:"path",attrs:{d:"M2 11h1.5"}},{tagName:"path",attrs:{d:"M20 18v-2"}},{tagName:"path",attrs:{d:"M20.5 11H22"}},{tagName:"path",attrs:{d:"M4 18v-2"}},{tagName:"path",attrs:{d:"M8 12v-2"}},{tagName:"path",attrs:{d:"M8 18v-2"}},{tagName:"rect",attrs:{x:"2",y:"6",width:"20",height:"10",rx:"2"}}],virtualMachine:[{tagName:"path",attrs:{d:"m10.852 14.772-.383.923"}},{tagName:"path",attrs:{d:"M13.148 14.772a3 3 0 1 0-2.296-5.544l-.383-.923"}},{tagName:"path",attrs:{d:"m13.148 9.228.383-.923"}},{tagName:"path",attrs:{d:"m13.53 15.696-.382-.924a3 3 0 1 1-2.296-5.544"}},{tagName:"path",attrs:{d:"m14.772 10.852.923-.383"}},{tagName:"path",attrs:{d:"m14.772 13.148.923.383"}},{tagName:"path",attrs:{d:"M4.5 10H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-.5"}},{tagName:"path",attrs:{d:"M4.5 14H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-.5"}},{tagName:"path",attrs:{d:"M6 18h.01"}},{tagName:"path",attrs:{d:"M6 6h.01"}},{tagName:"path",attrs:{d:"m9.228 10.852-.923-.383"}},{tagName:"path",attrs:{d:"m9.228 13.148-.923.383"}}],container:[{tagName:"path",attrs:{d:"M22 7.7c0-.6-.4-1.2-.8-1.5l-6.3-3.9a1.72 1.72 0 0 0-1.7 0l-10.3 6c-.5.2-.9.8-.9 1.4v6.6c0 .5.4 1.2.8 1.5l6.3 3.9a1.72 1.72 0 0 0 1.7 0l10.3-6c.5-.3.9-1 .9-1.5Z"}},{tagName:"path",attrs:{d:"M10 21.9V14L2.1 9.1"}},{tagName:"path",attrs:{d:"m10 14 11.9-6.9"}},{tagName:"path",attrs:{d:"M14 19.8v-8.1"}},{tagName:"path",attrs:{d:"M18 17.5V9.4"}}],kubernetes:[{tagName:"circle",attrs:{cx:"12",cy:"12",r:"8"}},{tagName:"path",attrs:{d:"M12 2v7.5"}},{tagName:"path",attrs:{d:"m19 5-5.23 5.23"}},{tagName:"path",attrs:{d:"M22 12h-7.5"}},{tagName:"path",attrs:{d:"m19 19-5.23-5.23"}},{tagName:"path",attrs:{d:"M12 14.5V22"}},{tagName:"path",attrs:{d:"M10.23 13.77 5 19"}},{tagName:"path",attrs:{d:"M9.5 12H2"}},{tagName:"path",attrs:{d:"M10.23 10.23 5 5"}},{tagName:"circle",attrs:{cx:"12",cy:"12",r:"2.5"}}],serverless:[{tagName:"rect",attrs:{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}},{tagName:"path",attrs:{d:"M9 17c2 0 2.8-1 2.8-2.8V10c0-2 1-3.3 3.2-3"}},{tagName:"path",attrs:{d:"M9 11.2h5.7"}}],largeLanguageModel:[{tagName:"path",attrs:{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z"}},{tagName:"path",attrs:{d:"M9 13a4.5 4.5 0 0 0 3-4"}},{tagName:"path",attrs:{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5"}},{tagName:"path",attrs:{d:"M3.477 10.896a4 4 0 0 1 .585-.396"}},{tagName:"path",attrs:{d:"M6 18a4 4 0 0 1-1.967-.516"}},{tagName:"path",attrs:{d:"M12 13h4"}},{tagName:"path",attrs:{d:"M12 18h6a2 2 0 0 1 2 2v1"}},{tagName:"path",attrs:{d:"M12 8h8"}},{tagName:"path",attrs:{d:"M16 8V5a2 2 0 0 1 2-2"}},{tagName:"circle",attrs:{cx:"16",cy:"13",r:".5"}},{tagName:"circle",attrs:{cx:"18",cy:"3",r:".5"}},{tagName:"circle",attrs:{cx:"20",cy:"21",r:".5"}},{tagName:"circle",attrs:{cx:"20",cy:"8",r:".5"}}],multimodalModel:[{tagName:"path",attrs:{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z"}},{tagName:"path",attrs:{d:"M20 2v4"}},{tagName:"path",attrs:{d:"M22 4h-4"}},{tagName:"circle",attrs:{cx:"4",cy:"20",r:"2"}}],embeddingModel:[{tagName:"rect",attrs:{x:"14",y:"14",width:"4",height:"6",rx:"2"}},{tagName:"rect",attrs:{x:"6",y:"4",width:"4",height:"6",rx:"2"}},{tagName:"path",attrs:{d:"M6 20h4"}},{tagName:"path",attrs:{d:"M14 10h4"}},{tagName:"path",attrs:{d:"M6 14h2v6"}},{tagName:"path",attrs:{d:"M14 4h2v6"}}],reranker:[{tagName:"path",attrs:{d:"m3 16 4 4 4-4"}},{tagName:"path",attrs:{d:"M7 20V4"}},{tagName:"path",attrs:{d:"m21 8-4-4-4 4"}},{tagName:"path",attrs:{d:"M17 4v16"}}],modelInference:[{tagName:"path",attrs:{d:"M10 12h4"}},{tagName:"path",attrs:{d:"M10 17h4"}},{tagName:"path",attrs:{d:"M10 7h4"}},{tagName:"path",attrs:{d:"M18 12h2"}},{tagName:"path",attrs:{d:"M18 18h2"}},{tagName:"path",attrs:{d:"M18 6h2"}},{tagName:"path",attrs:{d:"M4 12h2"}},{tagName:"path",attrs:{d:"M4 18h2"}},{tagName:"path",attrs:{d:"M4 6h2"}},{tagName:"rect",attrs:{x:"6",y:"2",width:"12",height:"20",rx:"2"}}],vectorDatabase:[{tagName:"path",attrs:{d:"m10.586 5.414-5.172 5.172"}},{tagName:"path",attrs:{d:"m18.586 13.414-5.172 5.172"}},{tagName:"path",attrs:{d:"M6 12h12"}},{tagName:"circle",attrs:{cx:"12",cy:"20",r:"2"}},{tagName:"circle",attrs:{cx:"12",cy:"4",r:"2"}},{tagName:"circle",attrs:{cx:"20",cy:"12",r:"2"}},{tagName:"circle",attrs:{cx:"4",cy:"12",r:"2"}}],ragPipeline:[{tagName:"rect",attrs:{width:"8",height:"8",x:"3",y:"3",rx:"2"}},{tagName:"path",attrs:{d:"M7 11v4a2 2 0 0 0 2 2h4"}},{tagName:"rect",attrs:{width:"8",height:"8",x:"13",y:"13",rx:"2"}}],aiAgent:[{tagName:"path",attrs:{d:"M12 8V4H8"}},{tagName:"rect",attrs:{width:"16",height:"12",x:"4",y:"8",rx:"2"}},{tagName:"path",attrs:{d:"M2 14h2"}},{tagName:"path",attrs:{d:"M20 14h2"}},{tagName:"path",attrs:{d:"M15 13v2"}},{tagName:"path",attrs:{d:"M9 13v2"}}],modelGateway:[{tagName:"rect",attrs:{width:"20",height:"8",x:"2",y:"14",rx:"2"}},{tagName:"path",attrs:{d:"M6.01 18H6"}},{tagName:"path",attrs:{d:"M10.01 18H10"}},{tagName:"path",attrs:{d:"M15 10v4"}},{tagName:"path",attrs:{d:"M17.84 7.17a4 4 0 0 0-5.66 0"}},{tagName:"path",attrs:{d:"M20.66 4.34a8 8 0 0 0-11.31 0"}}],mcpServer:[{tagName:"path",attrs:{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z"}},{tagName:"path",attrs:{d:"m2 22 3-3"}},{tagName:"path",attrs:{d:"M7.5 13.5 10 11"}},{tagName:"path",attrs:{d:"M10.5 16.5 13 14"}},{tagName:"path",attrs:{d:"m18 3-4 4h6l-4 4"}}],relationalDatabase:[{tagName:"ellipse",attrs:{cx:"12",cy:"5",rx:"9",ry:"3"}},{tagName:"path",attrs:{d:"M3 5V19A9 3 0 0 0 21 19V5"}},{tagName:"path",attrs:{d:"M3 12A9 3 0 0 0 21 12"}}],noSqlDatabase:[{tagName:"ellipse",attrs:{cx:"12",cy:"5",rx:"9",ry:"3"}},{tagName:"path",attrs:{d:"M3 5V19A9 3 0 0 0 15 21.84"}},{tagName:"path",attrs:{d:"M21 5V8"}},{tagName:"path",attrs:{d:"M21 12L18 17H22L19 22"}},{tagName:"path",attrs:{d:"M3 12A9 3 0 0 0 14.59 14.87"}}],cache:[{tagName:"path",attrs:{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z"}}],dataWarehouse:[{tagName:"path",attrs:{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z"}},{tagName:"path",attrs:{d:"m7 16.5-4.74-2.85"}},{tagName:"path",attrs:{d:"m7 16.5 5-3"}},{tagName:"path",attrs:{d:"M7 16.5v5.17"}},{tagName:"path",attrs:{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z"}},{tagName:"path",attrs:{d:"m17 16.5-5-3"}},{tagName:"path",attrs:{d:"m17 16.5 4.74-2.85"}},{tagName:"path",attrs:{d:"M17 16.5v5.17"}},{tagName:"path",attrs:{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z"}},{tagName:"path",attrs:{d:"M12 8 7.26 5.15"}},{tagName:"path",attrs:{d:"m12 8 4.74-2.85"}},{tagName:"path",attrs:{d:"M12 13.5V8"}}],searchEngine:[{tagName:"path",attrs:{d:"m21 21-4.34-4.34"}},{tagName:"circle",attrs:{cx:"11",cy:"11",r:"8"}}],objectStorage:[{tagName:"path",attrs:{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z"}}],fileStorage:[{tagName:"path",attrs:{d:"M11 21a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-8a1 1 0 0 1 1-1"}},{tagName:"path",attrs:{d:"M16 16a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1"}},{tagName:"path",attrs:{d:"M21 6a2 2 0 0 0-.586-1.414l-2-2A2 2 0 0 0 17 2h-3a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1z"}}],blockStorage:[{tagName:"path",attrs:{d:"M10 16h.01"}},{tagName:"path",attrs:{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"}},{tagName:"path",attrs:{d:"M21.946 12.013H2.054"}},{tagName:"path",attrs:{d:"M6 16h.01"}}],backup:[{tagName:"circle",attrs:{cx:"15",cy:"19",r:"2"}},{tagName:"path",attrs:{d:"M20.9 19.8A2 2 0 0 0 22 18V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2h5.1"}},{tagName:"path",attrs:{d:"M15 11v-1"}},{tagName:"path",attrs:{d:"M15 17v-2"}}],cdn:[{tagName:"path",attrs:{d:"M16.247 7.761a6 6 0 0 1 0 8.478"}},{tagName:"path",attrs:{d:"M19.075 4.933a10 10 0 0 1 0 14.134"}},{tagName:"path",attrs:{d:"M4.925 19.067a10 10 0 0 1 0-14.134"}},{tagName:"path",attrs:{d:"M7.753 16.239a6 6 0 0 1 0-8.478"}},{tagName:"circle",attrs:{cx:"12",cy:"12",r:"2"}}],messageQueue:[{tagName:"path",attrs:{d:"M11 5h10"}},{tagName:"path",attrs:{d:"M11 12h10"}},{tagName:"path",attrs:{d:"M11 19h10"}},{tagName:"path",attrs:{d:"M4 4h1v5"}},{tagName:"path",attrs:{d:"M4 9h2"}},{tagName:"path",attrs:{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02"}}],eventBus:[{tagName:"circle",attrs:{cx:"18",cy:"5",r:"3"}},{tagName:"circle",attrs:{cx:"6",cy:"12",r:"3"}},{tagName:"circle",attrs:{cx:"18",cy:"19",r:"3"}},{tagName:"line",attrs:{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49"}},{tagName:"line",attrs:{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49"}}],streamProcessing:[{tagName:"path",attrs:{d:"M2 12q2.5 2 5 0t5 0 5 0 5 0"}},{tagName:"path",attrs:{d:"M2 19q2.5 2 5 0t5 0 5 0 5 0"}},{tagName:"path",attrs:{d:"M2 5q2.5 2 5 0t5 0 5 0 5 0"}}],webhook:[{tagName:"path",attrs:{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2"}},{tagName:"path",attrs:{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06"}},{tagName:"path",attrs:{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8"}}],serviceMesh:[{tagName:"path",attrs:{d:"M12 3v18"}},{tagName:"path",attrs:{d:"M3 12h18"}},{tagName:"rect",attrs:{x:"3",y:"3",width:"18",height:"18",rx:"2"}}],apiGateway:[{tagName:"circle",attrs:{cx:"6",cy:"19",r:"3"}},{tagName:"path",attrs:{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15"}},{tagName:"circle",attrs:{cx:"18",cy:"5",r:"3"}}],loadBalancer:[{tagName:"circle",attrs:{cx:"12",cy:"18",r:"3"}},{tagName:"circle",attrs:{cx:"6",cy:"6",r:"3"}},{tagName:"circle",attrs:{cx:"18",cy:"6",r:"3"}},{tagName:"path",attrs:{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9"}},{tagName:"path",attrs:{d:"M12 12v3"}}],dns:[{tagName:"circle",attrs:{cx:"12",cy:"12",r:"10"}},{tagName:"path",attrs:{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z"}}],vpc:[{tagName:"rect",attrs:{x:"16",y:"16",width:"6",height:"6",rx:"1"}},{tagName:"rect",attrs:{x:"2",y:"16",width:"6",height:"6",rx:"1"}},{tagName:"rect",attrs:{x:"9",y:"2",width:"6",height:"6",rx:"1"}},{tagName:"path",attrs:{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3"}},{tagName:"path",attrs:{d:"M12 12V8"}}],subnet:[{tagName:"path",attrs:{d:"M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z"}},{tagName:"path",attrs:{d:"M17 21v-2"}},{tagName:"path",attrs:{d:"M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10"}},{tagName:"path",attrs:{d:"M21 21v-2"}},{tagName:"path",attrs:{d:"M3 5V3"}},{tagName:"path",attrs:{d:"M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z"}},{tagName:"path",attrs:{d:"M7 5V3"}}],vpn:[{tagName:"path",attrs:{d:"m15 20 3-3h2a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h2l3 3z"}},{tagName:"path",attrs:{d:"M6 8v1"}},{tagName:"path",attrs:{d:"M10 8v1"}},{tagName:"path",attrs:{d:"M14 8v1"}},{tagName:"path",attrs:{d:"M18 8v1"}}],identity:[{tagName:"path",attrs:{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z"}},{tagName:"circle",attrs:{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor"}}],firewall:[{tagName:"rect",attrs:{width:"18",height:"18",x:"3",y:"3",rx:"2"}},{tagName:"path",attrs:{d:"M12 9v6"}},{tagName:"path",attrs:{d:"M16 15v6"}},{tagName:"path",attrs:{d:"M16 3v6"}},{tagName:"path",attrs:{d:"M3 15h18"}},{tagName:"path",attrs:{d:"M3 9h18"}},{tagName:"path",attrs:{d:"M8 15v6"}},{tagName:"path",attrs:{d:"M8 3v6"}}],waf:[{tagName:"path",attrs:{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"}},{tagName:"path",attrs:{d:"m9 12 2 2 4-4"}}],secretManager:[{tagName:"circle",attrs:{cx:"12",cy:"16",r:"1"}},{tagName:"rect",attrs:{x:"3",y:"10",width:"18",height:"12",rx:"2"}},{tagName:"path",attrs:{d:"M7 10V7a5 5 0 0 1 10 0v3"}}],certificate:[{tagName:"path",attrs:{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"}},{tagName:"path",attrs:{d:"M8 12h.01"}},{tagName:"path",attrs:{d:"M12 12h.01"}},{tagName:"path",attrs:{d:"M16 12h.01"}}],systemBoundary:[{tagName:"path",attrs:{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z"}},{tagName:"path",attrs:{d:"m3.3 7 8.7 5 8.7-5"}},{tagName:"path",attrs:{d:"M12 22V12"}}],monitoring:[{tagName:"path",attrs:{d:"m12 14 4-4"}},{tagName:"path",attrs:{d:"M3.34 19a10 10 0 1 1 17.32 0"}}],logging:[{tagName:"path",attrs:{d:"M16 22h2a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v2.85"}},{tagName:"path",attrs:{d:"M14 2v5a1 1 0 0 0 1 1h5"}},{tagName:"path",attrs:{d:"M8 14v2.2l1.6 1"}},{tagName:"circle",attrs:{cx:"8",cy:"16",r:"6"}}],metrics:[{tagName:"path",attrs:{d:"M12 16v5"}},{tagName:"path",attrs:{d:"M16 14.639V21"}},{tagName:"path",attrs:{d:"M20 10.656V21"}},{tagName:"path",attrs:{d:"m22 3-8.646 8.646a.5.5 0 0 1-.708 0L9.354 8.354a.5.5 0 0 0-.707 0L2 15"}},{tagName:"path",attrs:{d:"M4 18.463V21"}},{tagName:"path",attrs:{d:"M8 14.656V21"}}],tracing:[{tagName:"path",attrs:{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2"}}],alerting:[{tagName:"circle",attrs:{cx:"12",cy:"12",r:"10"}},{tagName:"line",attrs:{x1:"12",x2:"12",y1:"8",y2:"12"}},{tagName:"line",attrs:{x1:"12",x2:"12.01",y1:"16",y2:"16"}}],saas:[{tagName:"path",attrs:{d:"m10.852 19.772-.383.924"}},{tagName:"path",attrs:{d:"m13.148 14.228.383-.923"}},{tagName:"path",attrs:{d:"M13.148 19.772a3 3 0 1 0-2.296-5.544l-.383-.923"}},{tagName:"path",attrs:{d:"m13.53 20.696-.382-.924a3 3 0 1 1-2.296-5.544"}},{tagName:"path",attrs:{d:"m14.772 15.852.923-.383"}},{tagName:"path",attrs:{d:"m14.772 18.148.923.383"}},{tagName:"path",attrs:{d:"M4.2 15.1a7 7 0 1 1 9.93-9.858A7 7 0 0 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.2"}},{tagName:"path",attrs:{d:"m9.228 15.852-.923-.383"}},{tagName:"path",attrs:{d:"m9.228 18.148-.923.383"}}],externalApi:[{tagName:"path",attrs:{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1"}},{tagName:"path",attrs:{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1"}}],thirdPartyService:[{tagName:"path",attrs:{d:"M15 3h6v6"}},{tagName:"path",attrs:{d:"M10 14 21 3"}},{tagName:"path",attrs:{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}}]},Z7e='Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',DDt=12,ODt=550,PDt=17,$Dt=10,BDt=14,kW=34,FDt=10,a8=32,o8=64,zDt=(t,e,r,n)=>({name:"manhattan",args:{padding:8,step:8,maxLoopCount:5e3,excludeNodes:[...new Set([t,e,...r])],...n?{startDirections:[n.source],endDirections:[n.target]}:{}}}),Q7e=(t,e)=>{const r=t.x+t.width,n=e.x+e.width,i=t.y-(e.y+e.height),s=e.y-(t.y+t.height);if(e.x>=r)return e.x-r<a8&&i>o8?{source:"right",target:"bottom"}:e.x-r<a8&&s>o8?{source:"right",target:"top"}:{source:"right",target:"left"};if(n<=t.x)return t.x-n<a8&&i>o8?{source:"left",target:"bottom"}:t.x-n<a8&&s>o8?{source:"left",target:"top"}:{source:"left",target:"right"};const a=t.y+t.height/2;return e.y+e.height/2>=a?{source:"bottom",target:"top"}:{source:"top",target:"bottom"}},Rhe=({side:t,offset:e})=>({name:t,args:t==="left"||t==="right"?{dy:e}:{dx:e}}),VDt=(t,e)=>{const r=new Map(t.map(s=>[s.id,s])),n=new Map,i=new Map;for(const s of e){const a=r.get(s.source),o=r.get(s.target);if(!a||!o)continue;const l=Q7e(a,o);n.set(s.id,{source:{side:l.source,offset:0},target:{side:l.target,offset:0}});for(const[u,h,d,f]of[["source",a,l.source,o],["target",o,l.target,a]]){const p=`${h.id}:${d}`,g=i.get(p)??[];g.push({edgeId:s.id,end:u,opposite:d==="left"||d==="right"?f.y+f.height/2:f.x+f.width/2}),i.set(p,g)}}for(const[s,a]of i){if(a.length<2)continue;const o=s.lastIndexOf(":"),l=r.get(s.slice(0,o)),u=s.slice(o+1);if(!l)continue;const h=u==="left"||u==="right"?l.height:l.width,d=Math.min(Math.max(0,h-28),(a.length-1)*16);a.sort((f,p)=>f.opposite-p.opposite||f.edgeId.localeCompare(p.edgeId)),a.forEach(({edgeId:f,end:p},g)=>{const m=n.get(f);m&&(m[p].offset=Math.round(-d/2+d*g/(a.length-1)))})}return n},J7e=["client","frontend","service","database","storage","queue","security","external"],HDt={client:"client",frontend:"webApp",service:"service",database:"relationalDatabase",storage:"objectStorage",queue:"messageQueue",security:"waf",external:"saas"},GDt={light:{canvas:ll,boundaryStroke:"#7B8F86",boundaryText:"#1C3D31",boundaryFill:"rgba(123, 143, 134, 0.05)",boundaryBadgeFill:"rgba(255, 255, 255, 0.95)",boundaryBadgeStroke:"rgba(123, 143, 134, 0.4)",nodes:{client:{fill:"#E9EFF5",stroke:"#3B6285",text:"#1A3B5C",accent:"#2B5A84",iconFrame:"#D4E2EE"},frontend:{fill:"#EEF2FF",stroke:"#4338CA",text:"#312E81",accent:"#4F46E5",iconFrame:"#E0E7FF"},service:{fill:"#E3F4EE",stroke:"#169567",text:"#19563E",accent:"#16A06E",iconFrame:"#D0ECE2"},database:{fill:"#EFE7FD",stroke:"#7437DC",text:"#472877",accent:"#7C3AED",iconFrame:"#E5D8FB"},storage:{fill:"#FAEFE1",stroke:"#CA6F07",text:"#71430F",accent:"#D97706",iconFrame:"#F7E4CD"},queue:{fill:"#FCEBE2",stroke:"#DA530D",text:"#793512",accent:"#EA580C",iconFrame:"#FBDECE"},security:{fill:"#FBE4E9",stroke:"#D11D44",text:"#751B2D",accent:"#E11D48",iconFrame:"#F9D2DA"},external:{fill:"#ECEEF1",stroke:"#5E6D82",text:"#3C424B",accent:"#64748B",iconFrame:"#E0E3E8"}},edges:{dependency:{stroke:"#64748B",strokeWidth:1.2,markerWidth:7,markerHeight:5},request:{stroke:"#0F8A5C",strokeWidth:1.6,markerWidth:8,markerHeight:6},data:{stroke:"#7C3AED",strokeWidth:1.6,markerWidth:8,markerHeight:6},async:{stroke:"#EA580C",strokeWidth:1.5,strokeDasharray:"7 5",markerWidth:8,markerHeight:6}}},dark:{canvas:cl,boundaryStroke:"#5B6F66",boundaryText:"#D7F4E8",boundaryFill:"rgba(91, 111, 102, 0.12)",boundaryBadgeFill:"rgba(16, 19, 17, 0.95)",boundaryBadgeStroke:"rgba(91, 111, 102, 0.5)",nodes:{client:{fill:"#132537",stroke:"#5A8EB9",text:"#DCE8F2",accent:"#5A8EB9",iconFrame:"#1C3752"},frontend:{fill:"#18214D",stroke:"#6366F1",text:"#E0E7FF",accent:"#6366F1",iconFrame:"#232F6B"},service:{fill:"#123A2B",stroke:"#49B58E",text:"#D5EEE5",accent:"#49B58E",iconFrame:"#13573E"},database:{fill:"#2E1E4F",stroke:"#9965F1",text:"#E7DCFC",accent:"#9965F1",iconFrame:"#44267B"},storage:{fill:"#482F0E",stroke:"#E1953D",text:"#F8E7D2",accent:"#E1953D",iconFrame:"#70430C"},queue:{fill:"#4D2610",stroke:"#EF7D41",text:"#FBE1D3",accent:"#EF7D41",iconFrame:"#79340F"},security:{fill:"#4B1620",stroke:"#E84F70",text:"#FAD6DE",accent:"#E84F70",iconFrame:"#74182B"},external:{fill:"#282E33",stroke:"#8693A5",text:"#E3E6EA",accent:"#8693A5",iconFrame:"#38424C"}},edges:{dependency:{stroke:"#94A3B8",strokeWidth:1.2,markerWidth:7,markerHeight:5},request:{stroke:"#4DB58B",strokeWidth:1.6,markerWidth:8,markerHeight:6},data:{stroke:"#A78BFA",strokeWidth:1.6,markerWidth:8,markerHeight:6},async:{stroke:"#FB923C",strokeWidth:1.5,strokeDasharray:"7 5",markerWidth:8,markerHeight:6}}}},ID=(t="light")=>GDt[t],WDt=(t,e)=>{const r=ID(e);return t==="boundary"?{fill:r.boundaryFill,stroke:r.boundaryStroke,text:r.boundaryText,accent:r.boundaryStroke,iconFrame:"transparent"}:J7e.includes(t)?r.nodes[t]:r.nodes.service},qDt=(t,e)=>t==="database"||t==="queue"||t==="external"?Math.round(e/2):t==="security"?16:t==="frontend"?10:t==="service"?8:t==="client"||t==="storage"?6:11,_he=t=>t==="database"||t==="external"?17:t==="security"?12:t==="queue"?10:8,UDt=t=>Math.round((t-kW)/2),e8e=(t,e)=>{const r=t??(J7e.includes(e)?HDt[e]:"service");return Mhe[r]??Mhe.service},jDt=(t,e)=>{if(e==="boundary")return[{tagName:"rect",selector:"body"},{tagName:"rect",selector:"headerBadge"},{tagName:"text",selector:"label"}];const r=e8e(t,e);return[{tagName:"rect",selector:"body"},{tagName:"rect",selector:"iconFrame"},...r.map((n,i)=>({tagName:n.tagName,selector:`architectureIcon${i}`})),{tagName:"text",selector:"label"}]},YDt=(t,e,r,n)=>{const i=ID(e),s=WDt(t,e),a=t==="boundary",o=qDt(t,r.height),l=UDt(r.height),u=a?[]:e8e(n,t),h=Object.fromEntries(u.map((d,f)=>[`architectureIcon${f}`,{...d.attrs,transform:`translate(15 ${l+5})`,fill:"none",stroke:s.accent,strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",pointerEvents:"none"}]));return{markup:jDt(n,t),body:{fill:s.fill,stroke:s.stroke,strokeWidth:1.5,strokeDasharray:a||t==="external"?"7 5":void 0,rx:o,ry:o},label:{fill:s.text,fontSize:a?12:DDt,fontWeight:a?650:ODt,fontFamily:Z7e,lineHeight:a?18:PDt,...a?{refX:20,refY:20,textAnchor:"start",textVerticalAnchor:"middle"}:{refX:54,refY:"50%",textAnchor:"start",textVerticalAnchor:"middle"}},attrs:a?{headerBadge:{ref:"label",refWidth:1,refHeight:1,refWidth2:16,refHeight2:6,refX:-8,refY:-3,fill:i.boundaryBadgeFill,stroke:i.boundaryBadgeStroke,strokeWidth:1,rx:4,ry:4,pointerEvents:"none"}}:{iconFrame:{x:FDt,y:l,width:kW,height:kW,rx:_he(t),ry:_he(t),fill:s.iconFrame,stroke:"none",pointerEvents:"none"},...h}}},XDt=(t,e,r=!1)=>{const n=ID(e).edges[t??"dependency"],i={name:"block",width:n.markerWidth,height:n.markerHeight};return{stroke:n.stroke,strokeWidth:n.strokeWidth,strokeDasharray:n.strokeDasharray,sourceMarker:r?i:null,targetMarker:i,fill:"none"}},SW='Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',KDt=10,ZDt=14,QDt={name:"manhattan",args:{padding:8,step:8,excludeEnds:!0}},JDt=(t,e)=>{const r={x:t.x+t.width/2,y:t.y+t.height/2},n={x:e.x+e.width/2,y:e.y+e.height/2},i=n.x-r.x,s=n.y-r.y;return s<-t.height?{source:"left",target:"left"}:i<-t.width?{source:"top",target:"top"}:Math.abs(s)>=Math.abs(i)?s>=0?{source:"bottom",target:"top"}:{source:"top",target:"bottom"}:i>=0?{source:"right",target:"left"}:{source:"left",target:"right"}},eOt=(t,e)=>{const r=e.x+e.width/2-(t.x+t.width/2),n=e.y+e.height/2-(t.y+t.height/2);return n<-t.height||r<-t.width?!1:Math.abs(r)<=1&&Math.abs(n)>8||Math.abs(n)<=1&&Math.abs(r)>8},tOt=.85,rOt=["plain","brand","ink","paper","island","tea","cosmos","sun","wa","rose","mint"],nOt={ocean:"brand",slate:"ink",mono:"ink",classic:"paper",sand:"island",sky:"cosmos",sunset:"sun",violet:"rose",aurora:"mint"},iOt=t=>t&&rOt.includes(t)?t:t?nOt[t]??"brand":"plain",sOt={plain:{light:{canvas:ll,edge:"#737373",process:{fill:"#FFFFFF",stroke:"#D4D4D4",text:"#212121"},decision:{fill:"#F4F4F5",stroke:"#737373",text:"#212121"},terminator:{fill:"#707070",stroke:"#707070",text:"#FFFFFF"}},dark:{canvas:cl,edge:"#A3A3A3",process:{fill:"#1C1C1C",stroke:"#3A3A3A",text:"#F4F4F5"},decision:{fill:"#262626",stroke:"#A3A3A3",text:"#F4F4F5"},terminator:{fill:"#F5F5F5",stroke:"#F5F5F5",text:"#212121"}}},brand:{light:{canvas:ll,edge:"#5C7166",process:{fill:"#FFFFFF",stroke:"#6F9B88",text:"#1C3D31"},decision:{fill:"#FFF6E5",stroke:"#D4A24A",text:"#7A4A12"},terminator:{fill:"#E7F6EF",stroke:"#16A06E",text:"#145C40"}},dark:{canvas:cl,edge:"#8CA397",process:{fill:"#1B2420",stroke:"#5B7569",text:"#E8F2ED"},decision:{fill:"#2A2316",stroke:"#E0B35C",text:"#F8E4B8"},terminator:{fill:"#1A3329",stroke:"#4DB58B",text:"#D8F3E6"}}},ink:{light:{canvas:ll,edge:"#64748B",process:{fill:"#FFFFFF",stroke:"#7D8794",text:"#1C232C"},decision:{fill:"#E8EDF3",stroke:"#6E7C8F",text:"#243044"},terminator:{fill:"#E6EAEF",stroke:"#3A4656",text:"#1A222C"}},dark:{canvas:cl,edge:"#94A3B8",process:{fill:"#1B1E23",stroke:"#6B7380",text:"#E8ECF1"},decision:{fill:"#222830",stroke:"#8B9BB0",text:"#D5DDE8"},terminator:{fill:"#1A2028",stroke:"#A8B4C4",text:"#E8EEF4"}}},paper:{light:{canvas:ll,edge:"#78716C",process:{fill:"#FFFCF6",stroke:"#C4B396",text:"#3A3126"},decision:{fill:"#F4E4CC",stroke:"#C08A48",text:"#6A3F14"},terminator:{fill:"#F0E4D0",stroke:"#7A5230",text:"#3F2A16"}},dark:{canvas:cl,edge:"#A8A29E",process:{fill:"#221E19",stroke:"#7A6A56",text:"#F3EBE0"},decision:{fill:"#2C2418",stroke:"#D4A06A",text:"#F6E2C4"},terminator:{fill:"#2A2118",stroke:"#C4A07A",text:"#F0E4D4"}}},island:{light:{canvas:ll,edge:"#7C6F68",process:{fill:"#FFF8F3",stroke:"#C4A090",text:"#3A2A22"},decision:{fill:"#F3D8C8",stroke:"#C46A48",text:"#6A3220"},terminator:{fill:"#EBD0C0",stroke:"#8B4A32",text:"#3F2418"}},dark:{canvas:cl,edge:"#ABA09A",process:{fill:"#231C18",stroke:"#8A6A56",text:"#F3E8E0"},decision:{fill:"#2C2018",stroke:"#D49070",text:"#F6D8C4"},terminator:{fill:"#281A16",stroke:"#C48868",text:"#F0D8CC"}}},tea:{light:{canvas:ll,edge:"#657361",process:{fill:"#FFFFFF",stroke:"#8A9A72",text:"#2A3420"},decision:{fill:"#E8EED4",stroke:"#8A9A48",text:"#3F4A18"},terminator:{fill:"#DCE6C8",stroke:"#4F6A32",text:"#243018"}},dark:{canvas:cl,edge:"#97A693",process:{fill:"#1C2018",stroke:"#6A7A56",text:"#E8F0DC"},decision:{fill:"#222618",stroke:"#B8C46A",text:"#E8F0C4"},terminator:{fill:"#1A2418",stroke:"#8AAA5A",text:"#D8E8C4"}}},cosmos:{light:{canvas:ll,edge:"#5C6D7E",process:{fill:"#FFFFFF",stroke:"#7A94A8",text:"#1C2A38"},decision:{fill:"#E4EEF5",stroke:"#5A82A0",text:"#1E3A52"},terminator:{fill:"#D8E6F0",stroke:"#2A5470",text:"#163044"}},dark:{canvas:cl,edge:"#8EA0B2",process:{fill:"#181E26",stroke:"#5A7088",text:"#E0E8F0"},decision:{fill:"#1C2834",stroke:"#7AA0C0",text:"#D0E4F4"},terminator:{fill:"#162028",stroke:"#8AB4D0",text:"#D8E8F4"}}},sun:{light:{canvas:ll,edge:"#736B5E",process:{fill:"#FFFEF6",stroke:"#D4C47A",text:"#3A3418"},decision:{fill:"#FFF0C4",stroke:"#E0B040",text:"#6A4A08"},terminator:{fill:"#F8E8B0",stroke:"#C09020",text:"#4A3808"}},dark:{canvas:cl,edge:"#A8A092",process:{fill:"#242018",stroke:"#8A7A48",text:"#F6F0D8"},decision:{fill:"#2C2410",stroke:"#E0B848",text:"#F8E8B8"},terminator:{fill:"#28240C",stroke:"#D4B040",text:"#F4E8C0"}}},wa:{light:{canvas:ll,edge:"#5B6F7D",process:{fill:"#FFFFFF",stroke:"#8AA8C0",text:"#1C2C3A"},decision:{fill:"#FCE8DC",stroke:"#E09070",text:"#7A3A24"},terminator:{fill:"#DCE8F4",stroke:"#2A5A88",text:"#1A3858"}},dark:{canvas:cl,edge:"#8EA3B3",process:{fill:"#182028",stroke:"#5A7088",text:"#E0E8F0"},decision:{fill:"#2C2018",stroke:"#E0A080",text:"#F8DCC8"},terminator:{fill:"#162030",stroke:"#6A98C0",text:"#D4E4F4"}}},rose:{light:{canvas:ll,edge:"#75646B",process:{fill:"#FFFFFF",stroke:"#C49AAC",text:"#3A2430"},decision:{fill:"#F8E4EC",stroke:"#D0809A",text:"#7A3048"},terminator:{fill:"#F0D8E2",stroke:"#A04060",text:"#4A2030"}},dark:{canvas:cl,edge:"#A8969D",process:{fill:"#24181C",stroke:"#8A5A6A",text:"#F4E4EA"},decision:{fill:"#2C1A22",stroke:"#E090A8",text:"#F8D8E4"},terminator:{fill:"#28141C",stroke:"#E07090",text:"#F4D0DC"}}},mint:{light:{canvas:ll,edge:"#5A736F",process:{fill:"#FFFFFF",stroke:"#7AB0A8",text:"#1C3A38"},decision:{fill:"#E4F4F0",stroke:"#4AA89A",text:"#1A5A52"},terminator:{fill:"#D4EEE8",stroke:"#1A7A70",text:"#145048"}},dark:{canvas:cl,edge:"#8EA8A4",process:{fill:"#182422",stroke:"#4A786E",text:"#DCF0EC"},decision:{fill:"#1A2C28",stroke:"#6AC4B4",text:"#D0F0E8"},terminator:{fill:"#162824",stroke:"#5AB8A8",text:"#D0EEE6"}}}},t8e=(t="light",e)=>sOt[iOt(e)][t],aOt=(t,e,r)=>{const n=t8e(e,r);return t==="decision"?n.decision:t==="terminator"?n.terminator:n.process},oOt=(t,e,r,n)=>{const i=aOt(t,e,n),s=t==="terminator",a=t==="decision";return{body:{fill:i.fill,stroke:i.stroke,strokeWidth:1.5,rx:s?Math.round(r.height/2):10,ry:s?Math.round(r.height/2):10,...a?{refPoints:"0,10 10,0 20,10 10,20"}:{},style:{filter:e==="dark"?"drop-shadow(0 1px 3px rgba(0, 0, 0, 0.45)) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3))":"drop-shadow(0 1px 2px rgba(15, 23, 42, 0.06)) drop-shadow(0 2px 5px rgba(15, 23, 42, 0.04))"}},label:{fill:i.text,fontSize:13,fontWeight:s?650:a?600:500,fontFamily:SW,lineHeight:18}}},lOt=1,cOt=2,uOt=["plain","brand","cosmos","dune","slate","prism","sunrise","marine","blossom","mint","macaron"],hOt="plain",dOt=["plain","brand","ocean","ink","classic","sky","sunset","violet","rose","sand","slate","aurora","mono","sun","wa","island","mint","cosmos","tea","naive","macaron","paper","dune","prism","sunrise","marine","blossom"],fOt=["map","line","capsule","box","circle","ellipse","hexagon","logic","tree","brace","org","timeline","fishbone"],pOt=[...fOt,"rect","diamond","cloud"],gOt={ocean:"brand",ink:"brand",paper:"brand",classic:"sunrise",sunset:"sunrise",sun:"sunrise",wa:"marine",island:"dune",sand:"dune",tea:"slate",mono:"slate",slate:"slate",sky:"cosmos",cosmos:"cosmos",rose:"blossom",violet:"blossom",aurora:"mint",naive:"prism",mint:"mint",macaron:"macaron"},IQ=t=>t&&uOt.includes(t)?t:t?gOt[t]??"brand":hOt,mOt=["client","webApp","mobileApp","website","apiClient","service","cpu","gpu","memory","virtualMachine","container","kubernetes","serverless","largeLanguageModel","multimodalModel","embeddingModel","reranker","modelInference","vectorDatabase","ragPipeline","aiAgent","modelGateway","mcpServer","relationalDatabase","noSqlDatabase","cache","dataWarehouse","searchEngine","objectStorage","fileStorage","blockStorage","backup","cdn","messageQueue","eventBus","streamProcessing","webhook","serviceMesh","apiGateway","loadBalancer","dns","vpc","subnet","vpn","identity","firewall","waf","secretManager","certificate","systemBoundary","monitoring","logging","metrics","tracing","alerting","saas","externalApi","thirdPartyService"],yOt="edgeever-diagram-v1",r8e=new RegExp(`\x3C!--\\s*${yOt}:([\\s\\S]*?)\\s*-->`),vOt=t=>NDt.decode(t),l8=t=>typeof t=="number"&&Number.isFinite(t),bOt=["mind-map","flowchart","architecture"],xOt=["topic","process","decision","terminator","client","frontend","service","database","storage","queue","security","external","boundary"],Lhe=["dependency","request","async","data"],wOt=t=>typeof t=="string"&&mOt.includes(t),TOt=t=>{if(!t||typeof t!="object"||Array.isArray(t))return null;const e=t;return typeof e.id!="string"||!e.id||typeof e.label!="string"||!l8(e.x)||!l8(e.y)||!l8(e.width)||!l8(e.height)||!xOt.includes(e.shape)?null:{id:e.id,label:e.label,x:e.x,y:e.y,width:e.width,height:e.height,shape:e.shape,...typeof e.parentId=="string"&&e.parentId?{parentId:e.parentId}:{},...wOt(e.resourceIcon)?{resourceIcon:e.resourceIcon}:{}}},COt=t=>{if(!t||typeof t!="object"||Array.isArray(t))return null;const e=t;return typeof e.id!="string"||!e.id||typeof e.source!="string"||typeof e.target!="string"||e.kind!==void 0&&!Lhe.includes(e.kind)||e.bidirectional!==void 0&&typeof e.bidirectional!="boolean"?null:{id:e.id,source:e.source,target:e.target,...typeof e.label=="string"&&e.label?{label:e.label}:{},...Lhe.includes(e.kind)?{kind:e.kind}:{},...typeof e.bidirectional=="boolean"?{bidirectional:e.bidirectional}:{}}},kOt=t=>{var r,n;const e=(n=(r=t==null?void 0:t.match(r8e))==null?void 0:r[1])==null?void 0:n.replace(/\s+/g,"");if(!e||!/^[A-Za-z0-9_-]+$/.test(e))return null;try{const i=JSON.parse(vOt(e));if(!bOt.includes(i.kind))return null;const s=i.kind==="architecture";if((s?i.schemaVersion!==cOt:i.schemaVersion!==lOt)||!Array.isArray(i.nodes)||!Array.isArray(i.edges))return null;const a=dOt.includes(i.theme)?i.theme:void 0,o=pOt.includes(i.structure)?i.structure:void 0,l=i.nodes.map(TOt),u=i.edges.map(COt);if(l.some(f=>!f)||u.some(f=>!f))return null;const h=new Set(l.map(f=>f.id)),d=new Map(l.map(f=>[f.id,f]));if(h.size!==l.length||l.some(f=>f.parentId&&(f.parentId===f.id||!h.has(f.parentId)))||u.some(f=>!h.has(f.source)||!h.has(f.target)))return null;if(s){if(l.some(f=>f.shape==="topic"||f.shape==="process"||f.shape==="decision"||f.shape==="terminator")||l.some(f=>{var p;return f.parentId&&((p=d.get(f.parentId))==null?void 0:p.shape)!=="boundary"})||u.some(f=>{var p,g;return((p=d.get(f.source))==null?void 0:p.shape)==="boundary"||((g=d.get(f.target))==null?void 0:g.shape)==="boundary"}))return null}else if(l.some(f=>!["topic","process","decision","terminator"].includes(f.shape)))return null;return{schemaVersion:i.schemaVersion,kind:i.kind,...a?{theme:a}:{},...i.kind==="mind-map"&&o?{structure:o}:{},nodes:l,edges:u}}catch{return null}},SOt=t=>(t??"").replace(r8e,"").trimEnd(),EOt=1e5;Yt({prompt:Ze().trim().min(1).max(1e3),locale:Ze().trim().min(2).max(35).optional(),currentTemplate:Ze().regex(/^[a-z0-9-]+$/).max(120).optional(),currentContent:Ze().max(EOt).default(""),candidates:Kn(Ze().regex(/^[a-z0-9-]+$/).max(120)).min(1).max(50),history:Kn(Yt({prompt:Ze().max(1e3),response:Ze().max(2e3)})).max(12).default([])});const n8e={plain:{id:"plain",group:"classic",colors:["#707070","#8A8A8A","#A3A3A3","#BDBDBD","#D4D4D4","#FFFFFF"],accent:"#707070"},brand:{id:"brand",group:"classic",colors:["#16A06E","#059669","#0D9488","#10B981","#047857","#065F46"],accent:"#16A06E"},cosmos:{id:"cosmos",group:"classic",colors:["#2563EB","#0284C7","#4F46E5","#0D9488","#3B82F6","#1D4ED8"],accent:"#2563EB"},dune:{id:"dune",group:"classic",colors:["#C2410C","#D97706","#B45309","#A16207","#78350F","#9A3412"],accent:"#B45309"},slate:{id:"slate",group:"classic",colors:["#475569","#52525B","#4B5563","#334155","#64748B","#1E293B"],accent:"#475569"},prism:{id:"prism",group:"vivid",colors:["#E11D48","#EA580C","#D97706","#059669","#2563EB","#7C3AED"],accent:"#6366F1"},sunrise:{id:"sunrise",group:"vivid",colors:["#E11D48","#F97316","#F59E0B","#D97706","#DC2626","#EA580C"],accent:"#EA580C"},marine:{id:"marine",group:"vivid",colors:["#0284C7","#06B6D4","#0D9488","#2563EB","#0891B2","#1D4ED8"],accent:"#0284C7"},blossom:{id:"blossom",group:"vivid",colors:["#DB2777","#C026D3","#9333EA","#E11D48","#BE185D","#7C3AED"],accent:"#DB2777"},mint:{id:"mint",group:"vivid",colors:["#0D9488","#059669","#10B981","#0891B2","#16A34A","#047857"],accent:"#0D9488"},macaron:{id:"macaron",group:"vivid",colors:["#EC4899","#FB923C","#EAB308","#10B981","#38BDF8","#8B5CF6"],accent:"#EC4899"}},AOt=Object.fromEntries(Object.entries(n8e).map(([t,e])=>[t,{id:e.id,group:e.group,colors:e.colors}])),EW=t=>{const e=t.replace("#","");return[Number.parseInt(e.slice(0,2),16),Number.parseInt(e.slice(2,4),16),Number.parseInt(e.slice(4,6),16)]},MOt=(t,e,r)=>`#${[t,e,r].map(n=>Math.round(Math.min(255,Math.max(0,n))).toString(16).padStart(2,"0")).join("")}`,hl=(t,e,r)=>{const n=EW(t),i=EW(e);return MOt(n[0]+(i[0]-n[0])*r,n[1]+(i[1]-n[1])*r,n[2]+(i[2]-n[2])*r)},ROt=t=>{const e=t/255;return e<=.04045?e/12.92:((e+.055)/1.055)**2.4},i8e=t=>{const[e,r,n]=EW(t).map(ROt);return e*.2126+r*.7152+n*.0722},AW=t=>i8e(t)>.35?"#1C1917":"#FFFCF8",_Ot=t=>AOt[IQ(t)].colors,LOt=t=>{const e=IQ(t);return e!=="brand"&&e!=="plain"},MW=(t,e)=>{const r=i8e(t);return e==="dark"?r<.22?hl(t,"#FFFFFF",Math.max(.35,(.3-r)*1.6)):t:r>.26?hl(t,"#18181B",Math.max(.24,(r-.2)*.9)):t},IOt=(t,e)=>_Ot(t).map(n=>{const i=MW(n,e),s=e==="dark"?hl(n,"#121518",.72):hl(n,"#FFFFFF",.84);return{fill:s,stroke:e==="dark"?hl(i,"#FFFFFF",.15):hl(i,"#1C1917",.12),text:AW(s),edge:i}}),NOt=(t,e)=>{const r=IQ(t),n=n8e[r],i=n.accent;if(r==="plain")return e==="dark"?{topicFill:"#F5F5F5",topicText:"#212121",nodeFill:"#1C1C1C",nodeText:"#F4F4F5",nodeStroke:"#3A3A3A",topicStroke:"#F5F5F5",mindMapEdge:"#A3A3A3",flowEdge:"#A3A3A3",canvas:cl}:{topicFill:"#707070",topicText:"#FFFFFF",nodeFill:"#FFFFFF",nodeText:"#212121",nodeStroke:"#D4D4D4",topicStroke:"#707070",mindMapEdge:"#737373",flowEdge:"#737373",canvas:ll};if(r==="brand")return e==="dark"?{topicFill:"#16A06E",topicText:"#F4FFF9",nodeFill:"#18211D",nodeText:"#E8F2ED",nodeStroke:"#3B5248",topicStroke:"#58CDA4",mindMapEdge:"#4DB58B",flowEdge:"#72B99B",canvas:cl}:{topicFill:"#16A06E",topicText:"#FFFFFF",nodeFill:"#F0F8F4",nodeText:"#173B2E",nodeStroke:"#B8DFD0",topicStroke:"#12845B",mindMapEdge:"#55B891",flowEdge:"#408A6D",canvas:ll};if(e==="dark"){const a=MW(i,"dark");return{topicFill:i,topicText:AW(i),nodeFill:hl(i,"#101418",.78),nodeText:"#E8EEF2",nodeStroke:hl(a,"#FFFFFF",.15),topicStroke:hl(i,"#FFFFFF",.25),mindMapEdge:a,flowEdge:hl(i,"#FFFFFF",.15),canvas:cl}}const s=MW(i,"light");return{topicFill:i,topicText:AW(i),nodeFill:hl(i,"#FFFFFF",.88),nodeText:hl(n.colors[n.colors.length-1],"#1C1917",.35),nodeStroke:hl(s,"#FFFFFF",.5),topicStroke:hl(i,"#1C1917",.15),mindMapEdge:s,flowEdge:hl(i,"#1C1917",.15),canvas:ll}},NQ=t=>Array.from(t).reduce((e,r)=>e+(/[^\u0000-\u00ff]/.test(r)?1:.55),0),DOt=t=>t==="decision"?{width:176,height:80}:t==="terminator"?{width:140,height:44}:{width:176,height:56},OOt=13,POt=18,Ihe=.7,$Ot=(t,e)=>t.split(``).flatMap(r=>{const n=[];let i="";for(const s of Array.from(r))i&&NQ(i+s)>e&&(n.push(i),i=""),i+=s;return n.push(i),n}),BOt=(t,e)=>{const r=DOt(t),n=t==="decision",i=t==="terminator",s=i?36:28,a=r.width,o=Math.max(4,(n?a*Ihe:a-s)/OOt),l=$Ot(e,o),u=Math.max(l.length,1)*POt,h=Math.max(r.height,n?Math.ceil(u/(1-Ihe)):u+(i?16:18));return{width:a,height:h,text:l.join(``)}},s8e="edgeever-mindmap",Nhe='Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',FOt=10,zOt=14,DQ=t=>t==="logic"?"logic":t==="brace"?"brace":t==="org"?"org":t==="tree"?"tree":t==="timeline"?"timeline":t==="fishbone"?"fishbone":"map",VOt=t=>{const e=DQ(t);return e==="map"||e==="logic"},g3=(t,e)=>t==="root"?!1:e==="line"||e==="brace"?!0:e==="map"||e==="tree"||e==="timeline"||e==="fishbone"||!e?t==="nested":!1,OQ=(t,e="primary")=>g3(e,t)?"underline":t==="capsule"?"capsule":t==="ellipse"?"ellipse":t==="circle"?"circle":t==="hexagon"?"hexagon":t==="box"||t==="logic"||t==="org"?"rounded":e==="root"?"capsule":"rounded",HOt=(t,e="primary")=>{const r=OQ(t,e);return[r==="ellipse"||r==="circle"?{tagName:"ellipse",selector:"body"}:r==="diamond"||r==="hexagon"?{tagName:"polygon",selector:"body"}:r==="cloud"?{tagName:"path",selector:"body"}:{tagName:"rect",selector:"body"},{tagName:"path",selector:"underline"},{tagName:"text",selector:"label"}]},GOt={light:[{fill:"#E7F6EF",stroke:"#0F8A5C",text:"#145C40",edge:"#16A06E"},{fill:"#E7F0FE",stroke:"#2563EB",text:"#1E3A8A",edge:"#3B82F6"},{fill:"#F3E8FF",stroke:"#7C3AED",text:"#5B21B6",edge:"#8B5CF6"},{fill:"#FEF3C7",stroke:"#D97706",text:"#92400E",edge:"#F59E0B"},{fill:"#FCE7F3",stroke:"#DB2777",text:"#9D174D",edge:"#EC4899"},{fill:"#CFFAFE",stroke:"#0E7490",text:"#155E75",edge:"#06B6D4"}],dark:[{fill:"#1A2A22",stroke:"#4DB58B",text:"#D7F4E8",edge:"#4DB58B"},{fill:"#1A2438",stroke:"#60A5FA",text:"#DBEAFE",edge:"#60A5FA"},{fill:"#251B38",stroke:"#A78BFA",text:"#EDE9FE",edge:"#A78BFA"},{fill:"#2A2114",stroke:"#FBBF24",text:"#FEF3C7",edge:"#FBBF24"},{fill:"#2A1520",stroke:"#F472B6",text:"#FCE7F3",edge:"#F472B6"},{fill:"#15252B",stroke:"#22D3EE",text:"#CFFAFE",edge:"#22D3EE"}]},WOt=(t,e)=>t.split(``).flatMap(r=>{const n=[];let i="";for(const s of Array.from(r))i&&NQ(i+s)>e&&(n.push(i),i=""),i+=s;return n.push(i),n}),tr=t=>(Math.round(t*100)/100).toFixed(2),qOt=t=>LOt(t),YM=(t,e)=>{const r=new Map(t.map(s=>[s.id,s])),n=r.get(e);if(!(n!=null&&n.parentId))return"root";const i=r.get(n.parentId);return i!=null&&i.parentId?"nested":"primary"},UOt=(t,e)=>{const r=new Map(t.map(u=>[u.id,u])),n=r.get(e);if(!(n!=null&&n.parentId))return null;let i=n,s=n;const a=new Set;for(;s.parentId&&r.has(s.parentId)&&!a.has(s.id);){a.add(s.id);const u=r.get(s.parentId);if(!u)break;if(!u.parentId){i=s;break}s=u,i=s}const l=t.filter(u=>u.parentId===i.parentId).sort((u,h)=>(u.y??0)-(h.y??0)||(u.x??0)-(h.x??0)||u.id.localeCompare(h.id)).findIndex(u=>u.id===i.id);return l<0?0:l},jOt=(t,e,r)=>{if(t==null)return;const n=r?IOt(r,e):GOt[e];return n[t%n.length]},YOt=(t,e="primary",r)=>{const n=e==="root",i=g3(e,r),s=OQ(r,e),a=n?36:i?22:s==="diamond"||s==="hexagon"||s==="circle"?36:28,o=Math.round(Math.min(n?180:s==="circle"?132:168,Math.max(n?124:i?88:s==="circle"?108:96,NQ(t)*13+a))),l=n?46:i?32:s==="circle"?Math.max(40,o-24):36;return{width:o,height:l}},XOt=(t,e,r)=>{const n=YOt(t,e,r),i=g3(e,r),s=e==="root"?20:18,a=e==="root"?36:i?22:28,o=WOt(t,Math.max(4,(n.width-a)/13));return{...n,height:Math.max(n.height,o.length*s+(e==="root"?18:i?10:14)),text:o.join(`-`),fontSize:e==="root"?15:e==="primary"?14:13}},KOt=t=>Math.round(Math.max(1,t/2)),ZOt=(t,e)=>`M 1 ${tr(Math.max(2,e-2))} H ${tr(Math.max(2,t-1))}`,QOt=(t,e)=>{const r=Math.max(t,12),n=Math.max(e,12);return[`M ${tr(r*.18)} ${tr(n*.62)}`,`Q ${tr(r*.06)} ${tr(n*.6)} ${tr(r*.08)} ${tr(n*.44)}`,`Q ${tr(r*.02)} ${tr(n*.26)} ${tr(r*.22)} ${tr(n*.24)}`,`Q ${tr(r*.3)} ${tr(n*.06)} ${tr(r*.48)} ${tr(n*.14)}`,`Q ${tr(r*.6)} ${tr(n*.02)} ${tr(r*.72)} ${tr(n*.16)}`,`Q ${tr(r*.96)} ${tr(n*.14)} ${tr(r*.92)} ${tr(n*.4)}`,`Q ${tr(r*1.02)} ${tr(n*.56)} ${tr(r*.84)} ${tr(n*.64)}`,`Q ${tr(r*.8)} ${tr(n*.84)} ${tr(r*.58)} ${tr(n*.78)}`,`Q ${tr(r*.42)} ${tr(n*.92)} ${tr(r*.3)} ${tr(n*.76)}`,`Q ${tr(r*.12)} ${tr(n*.82)} ${tr(r*.18)} ${tr(n*.62)}`,"Z"].join(" ")},JOt=(t,e,r,n)=>t==="ellipse"||t==="circle"?{refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%"}:t==="diamond"?{refPoints:"5,0 10,5 5,10 0,5"}:t==="hexagon"?{refPoints:"2.5,0 7.5,0 10,5 7.5,10 2.5,10 0,5"}:t==="cloud"?{d:QOt(e,r)}:{rx:n,ry:n},ePt=(t,e,r={})=>{const n=r.underline??g3(t,r.structure),i=r.width??96,s=r.height??(t==="root"?46:n?32:36),a=r.tint,o=OQ(r.structure,t);if(n){const h=(a==null?void 0:a.edge)??e.mindMapEdge;return{body:{fill:"transparent",stroke:"none",strokeWidth:0,rx:0,ry:0},label:{fill:(a==null?void 0:a.text)??e.nodeText,fontSize:t==="primary"?14:13,fontWeight:t==="primary"?650:500,fontFamily:Nhe,lineHeight:18,refX:"50%",refY:s-6,textAnchor:"middle",textVerticalAnchor:"bottom"},underline:{d:ZOt(i,s),stroke:h,strokeWidth:1.8,fill:"none",strokeLinecap:"round",pointerEvents:"none"}}}const l=t==="root",u=o==="capsule"||l&&o==="rounded"?KOt(s):o==="rect"?2:l?12:t==="nested"?8:10;return{body:{fill:l?e.topicFill:(a==null?void 0:a.fill)??(t==="nested"?e.canvas:e.nodeFill),stroke:l?e.topicStroke:(a==null?void 0:a.stroke)??(t==="nested"?e.nodeStroke:e.topicStroke),strokeWidth:t==="nested"&&!l?1:1.5,...JOt(o,i,s,u)},label:{fill:l?e.topicText:(a==null?void 0:a.text)??e.nodeText,fontSize:l?15:t==="primary"?14:13,fontWeight:l||t==="primary"?650:500,fontFamily:Nhe,lineHeight:l?20:18,refY:"50%",textAnchor:"middle",textVerticalAnchor:"middle"},underline:{d:"",stroke:"none",fill:"none"}}},Dhe=(t,e,r,n,i,s,a)=>{const o=YM(t,e),l=g3(o,a),u=qOt(n)?jOt(UOt(t,e),i,n):void 0;return{role:o,underline:l,tint:u,visual:ePt(o,r,{tint:u,underline:l,structure:a,width:s.width,height:s.height})}},tPt=(t,e,r)=>{const n=(r==null?void 0:r.edge)??e.mindMapEdge;return t==="root"?{stroke:n,sourceWidth:3.1,targetWidth:1.55}:t==="primary"?{stroke:n,sourceWidth:1.85,targetWidth:1.15}:{stroke:n,sourceWidth:1.25,targetWidth:.9}},rPt=(t,e,r)=>{const n=DQ(r),i=t.x+t.width/2,s=e.x+e.width/2,a=t.y+t.height/2,o=e.y+e.height/2;return n==="org"?{source:"bottom",target:"top"}:n==="fishbone"?s<i-8?{source:"left",target:"right"}:o<a-8?{source:"top",target:"bottom"}:o>a+8?{source:"bottom",target:"top"}:{source:"left",target:"right"}:n==="timeline"?o<a-8?{source:s>=i?"right":"left",target:"bottom"}:o>a+8?{source:s>=i?"right":"left",target:"top"}:s>=i?{source:"right",target:"left"}:{source:"left",target:"right"}:s>=i?{source:"right",target:"left"}:{source:"left",target:"right"}},Ohe=(t,e,r,n)=>{const i=g3(e,n),s=i&&(r==="left"||r==="right")?t.height/2-2:0;return{anchor:{name:r,...s?{args:{dy:s}}:{}},connectionPoint:{name:i?"anchor":"boundary"}}},nPt=(t,e)=>{const r=t.filter(i=>i.parentId===e);if(r.length===0)return null;const n=r.map(i=>i.y+i.height/2);return{top:Math.min(...n),bottom:Math.max(...n)}},Phe=(t,e)=>VOt(t)?{fill:e,strokeWidth:.5,strokeLinejoin:"round",strokeLinecap:"round"}:{fill:"none",strokeWidth:1.7,strokeLinejoin:"round",strokeLinecap:"round"},iPt=(t,e,r,n,i)=>{const s=1-i;return{x:s*s*s*t.x+3*s*s*i*e.x+3*s*i*i*r.x+i*i*i*n.x,y:s*s*s*t.y+3*s*s*i*e.y+3*s*i*i*r.y+i*i*i*n.y}},sPt=(t,e,r,n,i)=>{const s=1-i;return{x:3*s*s*(e.x-t.x)+6*s*i*(r.x-e.x)+3*i*i*(n.x-r.x),y:3*s*s*(e.y-t.y)+6*s*i*(r.y-e.y)+3*i*i*(n.y-r.y)}},aPt=(t,e,r=2.4,n=1.15)=>{const i=e.x-t.x,s=e.y-t.y;if(Math.abs(i)<.01&&Math.abs(s)<.01)return`M ${tr(t.x)} ${tr(t.y)} L ${tr(e.x)} ${tr(e.y)}`;const a=(t.x+e.x)/2,o=t,l={x:a,y:t.y},u={x:a,y:e.y},h=e,d=20,f=[],p=[];for(let y=0;y<=d;y+=1){const v=y/d,x=iPt(o,l,u,h,v),b=sPt(o,l,u,h,v),T=Math.hypot(b.x,b.y)||1,C=((1-v)*r+v*n)/2,S=-b.y/T,k=b.x/T;f.push({x:x.x+S*C,y:x.y+k*C}),p.push({x:x.x-S*C,y:x.y-k*C})}const g=f[0],m=[`M ${tr(g.x)} ${tr(g.y)}`];for(let y=1;y<f.length;y+=1)m.push(`L ${tr(f[y].x)} ${tr(f[y].y)}`);for(let y=p.length-1;y>=0;y-=1)m.push(`L ${tr(p[y].x)} ${tr(p[y].y)}`);return m.push("Z"),m.join(" ")},oPt=t=>`${tr(t.x)} ${tr(t.y)}`,Od=t=>t.map((e,r)=>`${r===0?"M":"L"} ${oPt(e)}`).join(" "),lPt=(t,e,r)=>{if(Math.abs(t.x-e.x)<.8||Math.abs(t.y-e.y)<.8)return Od([t,e]);const n={x:t.x,y:(t.y+e.y)/2},i={x:e.x,y:n.y};return Od([t,n,i,e])},cPt=(t,e)=>{const r=t.x+Math.max(10,Math.min(28,Math.abs(e.x-t.x)*.38));return Math.abs(t.y-e.y)<.8?Od([t,e]):Od([t,{x:r,y:t.y},{x:r,y:e.y},e])},uPt=(t,e,r,n)=>{const i=Math.min(r??t.y,n??t.y,t.y,e.y),s=Math.max(r??t.y,n??t.y,t.y,e.y),a=Math.max(18,s-i),o=(i+s)/2-a/2,l=o+a,u=(o+l)/2,h=9,d=t.x+Math.max(18,Math.min(36,Math.abs(e.x-t.x)*.42));return[Od([t,{x:d-h,y:t.y}]),`M ${tr(d-h)} ${tr(o)}`,`C ${tr(d)} ${tr(o)} ${tr(d)} ${tr(o)} ${tr(d)} ${tr((o+u)/2)}`,`C ${tr(d)} ${tr(u)} ${tr(d+h)} ${tr(u)} ${tr(d+h)} ${tr(u)}`,`C ${tr(d)} ${tr(u)} ${tr(d)} ${tr(u)} ${tr(d)} ${tr((u+l)/2)}`,`C ${tr(d)} ${tr(l)} ${tr(d)} ${tr(l)} ${tr(d-h)} ${tr(l)}`,Od([{x:d,y:e.y},e])].join(" ")},hPt=(t,e)=>Math.abs(t.x-e.x)<.8||Math.abs(t.y-e.y)<.8?Od([t,e]):Od([t,{x:e.x,y:t.y},e]),dPt=(t,e)=>{if(Math.abs(t.y-e.y)<.8||Math.abs(t.x-e.x)<.8)return Od([t,e]);const r=Math.abs(e.y-t.y),n=t.x>=e.x?1:-1,i=e.x+n*Math.max(18,r/Math.sqrt(3)),s={x:n>0?Math.min(t.x,i):Math.max(t.x,i),y:t.y};return Od([t,s,e])},fPt=(t,e,r,n={})=>{const i=DQ(n.structure);return i==="org"?lPt(t,e):i==="tree"?cPt(t,e):i==="brace"?uPt(t,e,n.braceTop,n.braceBottom):i==="timeline"?hPt(t,e):i==="fishbone"?dPt(t,e):aPt(t,e,n.sourceWidth,n.targetWidth)},pPt=(t,e="light")=>NOt(t,e),gPt=(t,e)=>{const r=pPt(t.kind==="architecture"?t.theme??"brand":t.theme,e),n=t.kind==="flowchart"?t8e(e,t.theme):null,i=t.kind==="architecture"?ID(e):null,s=t.nodes.map(h=>{const d=t.kind==="mind-map"?YM(t.nodes,h.id):null,f=t.kind==="flowchart"?BOt(h.shape,h.label):d?XOt(h.label,d,t.structure):{width:h.width,height:h.height,text:h.label},p=d?Dhe(t.nodes,h.id,r,t.theme,e,f,t.structure):null,g=(p==null?void 0:p.visual)??null,m=t.kind==="flowchart"?oOt(h.shape,e,f,t.theme):null,y=t.kind==="architecture"?YDt(h.shape,e,f,h.resourceIcon):null,v=h.shape==="topic"&&!h.parentId,x=h.shape==="terminator",b=h.shape==="boundary",T=v||x,C=g?g.body.fill:m?m.body.fill:y?y.body.fill:T?r.topicFill:r.nodeFill,S=g?g.body.stroke:m?m.body.stroke:y?y.body.stroke:T?r.topicStroke:r.nodeStroke;return{id:h.id,shape:h.shape==="decision"?"polygon":"rect",x:h.x,y:h.y,width:f.width,height:f.height,zIndex:b?0:2,...y?{markup:y.markup}:d?{markup:HOt(t.structure,d)}:{},attrs:{body:{fill:C,stroke:S,strokeWidth:(g==null?void 0:g.body.strokeWidth)??(m==null?void 0:m.body.strokeWidth)??(y==null?void 0:y.body.strokeWidth)??1,strokeDasharray:(y==null?void 0:y.body.strokeDasharray)??(b?"7 5":void 0),...(g==null?void 0:g.body)??(m==null?void 0:m.body)??(y==null?void 0:y.body)??{rx:x?24:11,ry:x?24:11},...h.shape==="decision"?{refPoints:"0,10 10,0 20,10 10,20"}:{}},label:{text:f.text,lineHeight:(g==null?void 0:g.label.lineHeight)??(m==null?void 0:m.label.lineHeight)??(y==null?void 0:y.label.lineHeight)??(d==="root"?20:18),fill:(g==null?void 0:g.label.fill)??(m==null?void 0:m.label.fill)??(y==null?void 0:y.label.fill)??(T?r.topicText:r.nodeText),fontSize:(g==null?void 0:g.label.fontSize)??(m==null?void 0:m.label.fontSize)??(y==null?void 0:y.label.fontSize)??(h.shape==="topic"?14:13),fontWeight:(g==null?void 0:g.label.fontWeight)??(m==null?void 0:m.label.fontWeight)??(y==null?void 0:y.label.fontWeight)??(T?650:500),fontFamily:(g==null?void 0:g.label.fontFamily)??(m==null?void 0:m.label.fontFamily)??(y==null?void 0:y.label.fontFamily)??SW,...g?{refX:g.label.refX,refY:g.label.refY,textAnchor:g.label.textAnchor,textVerticalAnchor:g.label.textVerticalAnchor}:{},...y?{refX:y.label.refX,refY:y.label.refY,textAnchor:y.label.textAnchor,textVerticalAnchor:y.label.textVerticalAnchor}:{}},...g?{underline:g.underline}:{},...(y==null?void 0:y.attrs)??{}}}}),a=new Map(s.map(h=>[h.id,h])),o=t.nodes.filter(h=>h.shape==="boundary").map(h=>h.id),l=t.kind==="architecture"?VDt(t.nodes.filter(h=>h.shape!=="boundary"),t.edges):null,u=t.edges.map(h=>{const d=h.kind??(t.kind==="architecture"?"dependency":void 0),f=a.get(h.source),p=a.get(h.target),g=t.kind==="mind-map"?YM(t.nodes,h.source):null,m=t.kind==="mind-map"?YM(t.nodes,h.target):null,y=t.kind==="mind-map"?Dhe(t.nodes,h.target,r,t.theme,e,{width:96,height:36},t.structure).tint:void 0,v=g?tPt(g,r,y):null,x=f&&p?rPt(f,p,t.structure):{source:"right",target:"left"},b=f&&g?Ohe(f,g,x.source,t.structure):null,T=p&&m?Ohe(p,m,x.target,t.structure):null,C=t.kind==="mind-map"&&t.structure==="brace"?nPt(t.nodes,h.source):null,S=t.kind==="architecture"?XDt(d,e,h.bidirectional):null,k=(S==null?void 0:S.stroke)??(v==null?void 0:v.stroke)??(n==null?void 0:n.edge)??r.flowEdge,E=f&&p?t.kind==="architecture"?Q7e(f,p):t.kind==="flowchart"?JDt(f,p):null:null,A=t.kind==="flowchart"&&!!(E&&f&&p&&eOt(f,p)),R=l==null?void 0:l.get(h.id);return{id:h.id,source:t.kind==="mind-map"?{cell:h.source,...b??{anchor:{name:x.source}}}:R?{cell:h.source,anchor:Rhe(R.source)}:E?{cell:h.source,port:E.source}:{cell:h.source},target:t.kind==="mind-map"?{cell:h.target,...T??{anchor:{name:x.target}}}:R?{cell:h.target,anchor:Rhe(R.target)}:E?{cell:h.target,port:E.target}:{cell:h.target},router:t.kind==="architecture"?zDt(h.source,h.target,o,E??void 0):t.kind==="flowchart"?A?{name:"normal"}:QDt:void 0,connector:t.kind==="mind-map"?{name:s8e,args:{sourceWidth:v==null?void 0:v.sourceWidth,targetWidth:v==null?void 0:v.targetWidth,structure:t.structure,...C?{braceTop:C.top,braceBottom:C.bottom}:{}}}:{name:"rounded",args:{radius:10}},attrs:{line:{stroke:k,strokeWidth:(S==null?void 0:S.strokeWidth)??(v?Phe(t.structure,k).strokeWidth:1.5),strokeDasharray:S==null?void 0:S.strokeDasharray,sourceMarker:S?S.sourceMarker:h.bidirectional?{name:"block",width:7,height:5}:null,targetMarker:t.kind==="mind-map"?null:(S==null?void 0:S.targetMarker)??{name:"block",width:7,height:5},...v?Phe(t.structure,k):{fill:"none"}}},labels:h.label?[{attrs:{label:{text:h.label,fill:t.kind==="architecture"?e==="dark"?"#E2E8F0":"#334155":t.kind==="flowchart"?e==="dark"?"#E2E8F0":"#475569":(n==null?void 0:n.process.text)??(i==null?void 0:i.nodes.service.text)??r.nodeText,fontSize:t.kind==="architecture"?$Dt:t.kind==="flowchart"?KDt:FOt,fontWeight:t.kind==="architecture"||t.kind==="flowchart"?500:400,lineHeight:t.kind==="architecture"?BDt:t.kind==="flowchart"?ZDt:zOt,fontFamily:t.kind==="architecture"?Z7e:SW,textWrap:{width:140,height:512}},body:{ref:"label",refWidth:1,refHeight:1,refWidth2:t.kind==="architecture"||t.kind==="flowchart"?14:12,refHeight2:6,refX:t.kind==="architecture"||t.kind==="flowchart"?-7:-6,refY:-3,fill:t.kind==="architecture"?e==="dark"?"rgba(15, 23, 42, 0.92)":"rgba(255, 255, 255, 0.96)":t.kind==="flowchart"?e==="dark"?"rgba(24, 28, 34, 0.94)":"rgba(255, 255, 255, 0.95)":(n==null?void 0:n.canvas)??(i==null?void 0:i.canvas)??r.canvas,stroke:t.kind==="architecture"?(S==null?void 0:S.stroke)??(e==="dark"?"rgba(148, 163, 184, 0.3)":"rgba(203, 213, 225, 0.8)"):t.kind==="flowchart"?e==="dark"?"rgba(148, 163, 184, 0.28)":"rgba(100, 116, 139, 0.24)":(n==null?void 0:n.process.stroke)??(i==null?void 0:i.nodes.service.stroke)??r.nodeStroke,strokeWidth:1,rx:6,ry:6,...t.kind==="architecture"||t.kind==="flowchart"?{style:{filter:"drop-shadow(0 1px 2px rgba(0,0,0,0.06))"}}:{}}}}]:void 0}});return{canvas:(n==null?void 0:n.canvas)??(i==null?void 0:i.canvas)??r.canvas,edges:u,nodes:s}},a8e={compact:560,standard:680,wide:800},mPt=/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\.|$)/i,yPt={slate:"#f8fafc",aurora:"#a7f3d0",sunset:"#fde68a",midnight:"#090d16",mint:"#ecfdf5",notepad:"#fbf7ee",xuan:"#f7f6f2",lavender:"#f5f3ff",warm:"#fffbeb"},y5={slate:{canvasBg:"linear-gradient(145deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%)",cardBg:"#ffffff",cardBorder:"1px solid rgba(226, 232, 240, 0.85)",cardShadow:"0 2px 4px rgba(15, 23, 42, 0.02), 0 12px 28px -4px rgba(15, 23, 42, 0.07), 0 24px 60px -12px rgba(15, 23, 42, 0.06)",textColor:"#1e293b",headingColor:"#0f172a",metaColor:"#64748b",metaBg:"#f8fafc",metaBorder:"#e2e8f0",accentColor:"#16a06e",accentSubtle:"rgba(22, 160, 110, 0.16)",linkBg:"rgba(22, 160, 110, 0.08)",dividerColor:"#e2e8f0",codeBg:"#f8fafc",codeBorder:"#e2e8f0",codeColor:"#0f172a",quoteBg:"rgba(240, 253, 244, 0.7)",quoteBorder:"#10b981",tableThBg:"#f8fafc",tableBorder:"#e2e8f0",brandText:"#07130b",brandMark:"#16a06e"},aurora:{canvasBg:"linear-gradient(135deg, #a7f3d0 0%, #67e8f9 40%, #c4b5fd 100%)",cardBg:"rgba(255, 255, 255, 0.96)",cardBorder:"1px solid rgba(255, 255, 255, 0.95)",cardShadow:"0 24px 60px -12px rgba(14, 165, 233, 0.28), 0 4px 16px rgba(0, 0, 0, 0.04)",textColor:"#1e293b",headingColor:"#0f172a",metaColor:"#475569",metaBg:"rgba(241, 245, 249, 0.85)",metaBorder:"rgba(203, 213, 225, 0.7)",accentColor:"#0d9488",accentSubtle:"rgba(13, 148, 136, 0.18)",linkBg:"rgba(13, 148, 136, 0.09)",dividerColor:"rgba(226, 232, 240, 0.8)",codeBg:"rgba(248, 250, 252, 0.95)",codeBorder:"rgba(226, 232, 240, 0.8)",codeColor:"#0f172a",quoteBg:"rgba(240, 253, 250, 0.85)",quoteBorder:"#14b8a6",tableThBg:"#f1f5f9",tableBorder:"#cbd5e1",brandText:"#0f172a",brandMark:"#0d9488"},sunset:{canvasBg:"linear-gradient(135deg, #fde68a 0%, #fbcfe8 45%, #fed7aa 100%)",cardBg:"#fffdfa",cardBorder:"1px solid rgba(253, 230, 138, 0.7)",cardShadow:"0 24px 60px -12px rgba(244, 63, 94, 0.18), 0 4px 16px rgba(0, 0, 0, 0.03)",textColor:"#292524",headingColor:"#1c1917",metaColor:"#78716c",metaBg:"rgba(254, 243, 199, 0.75)",metaBorder:"rgba(253, 230, 138, 0.8)",accentColor:"#ea580c",accentSubtle:"rgba(234, 88, 12, 0.15)",linkBg:"rgba(234, 88, 12, 0.08)",dividerColor:"rgba(254, 215, 170, 0.7)",codeBg:"#fffbeb",codeBorder:"#fde68a",codeColor:"#1c1917",quoteBg:"rgba(255, 247, 237, 0.85)",quoteBorder:"#f97316",tableThBg:"#fef3c7",tableBorder:"#fde68a",brandText:"#1c1917",brandMark:"#ea580c"},midnight:{canvasBg:"linear-gradient(135deg, #090d16 0%, #0f172a 50%, #1e1b4b 100%)",cardBg:"#131b2e",cardBorder:"1px solid rgba(255, 255, 255, 0.14)",cardShadow:"0 24px 60px -12px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.08)",textColor:"#cbd5e1",headingColor:"#f8fafc",metaColor:"#94a3b8",metaBg:"rgba(30, 41, 59, 0.85)",metaBorder:"rgba(51, 65, 85, 0.8)",accentColor:"#34d399",accentSubtle:"rgba(52, 211, 153, 0.2)",linkBg:"rgba(52, 211, 153, 0.12)",dividerColor:"rgba(51, 65, 85, 0.7)",codeBg:"#0b1120",codeBorder:"#1e293b",codeColor:"#e2e8f0",quoteBg:"rgba(16, 185, 129, 0.12)",quoteBorder:"#34d399",tableThBg:"#1e293b",tableBorder:"#334155",brandText:"#f8fafc",brandMark:"#34d399",isDark:!0},mint:{canvasBg:"linear-gradient(135deg, #ecfdf5 0%, #d1fae5 50%, #a7f3d0 100%)",cardBg:"#ffffff",cardBorder:"1px solid rgba(167, 243, 208, 0.85)",cardShadow:"0 20px 50px -15px rgba(16, 185, 129, 0.2), 0 4px 16px rgba(16, 185, 129, 0.06)",textColor:"#134e4a",headingColor:"#042f2e",metaColor:"#0f766e",metaBg:"#ccfbf1",metaBorder:"#99f6e4",accentColor:"#059669",accentSubtle:"rgba(5, 150, 105, 0.18)",linkBg:"rgba(5, 150, 105, 0.1)",dividerColor:"#a7f3d0",codeBg:"#f0fdf4",codeBorder:"#a7f3d0",codeColor:"#064e3b",quoteBg:"rgba(236, 253, 245, 0.85)",quoteBorder:"#10b981",tableThBg:"#ccfbf1",tableBorder:"#99f6e4",brandText:"#042f2e",brandMark:"#059669"},notepad:{canvasBg:"linear-gradient(135deg, #fbf7ee 0%, #f4ede0 100%)",cardBg:"#fefdfa",cardBorder:"1px solid rgba(220, 205, 180, 0.85)",cardShadow:"0 2px 4px rgba(100, 80, 50, 0.04), 0 16px 36px -8px rgba(100, 80, 50, 0.12), 0 28px 64px -16px rgba(100, 80, 50, 0.08)",textColor:"#2c2419",headingColor:"#1a140d",metaColor:"#8c7b68",metaBg:"rgba(240, 230, 214, 0.6)",metaBorder:"#dfd3c3",accentColor:"#c2410c",accentSubtle:"rgba(194, 65, 12, 0.15)",linkBg:"rgba(194, 65, 12, 0.08)",dividerColor:"#e8decb",codeBg:"#f5efe4",codeBorder:"#e2d5c3",codeColor:"#1a140d",quoteBg:"rgba(248, 241, 230, 0.85)",quoteBorder:"#d97706",tableThBg:"#f5ede0",tableBorder:"#dfd3c3",brandText:"#1a140d",brandMark:"#c2410c"},xuan:{canvasBg:"linear-gradient(135deg, #f7f6f2 0%, #ebe8e1 100%)",cardBg:"#fdfcf7",cardBorder:"1px solid rgba(210, 205, 195, 0.8)",cardShadow:"0 20px 48px -12px rgba(40, 35, 30, 0.1), 0 4px 16px rgba(40, 35, 30, 0.03)",textColor:"#242220",headingColor:"#0f0e0d",metaColor:"#736d66",metaBg:"#f0eee8",metaBorder:"#dedad2",accentColor:"#b91c1c",accentSubtle:"rgba(185, 28, 28, 0.15)",linkBg:"rgba(185, 28, 28, 0.08)",dividerColor:"#e3dfd6",codeBg:"#f4f2eb",codeBorder:"#dedad2",codeColor:"#0f0e0d",quoteBg:"rgba(245, 243, 238, 0.85)",quoteBorder:"#b91c1c",tableThBg:"#edeae2",tableBorder:"#dedad2",brandText:"#0f0e0d",brandMark:"#b91c1c"},lavender:{canvasBg:"linear-gradient(135deg, #f5f3ff 0%, #ede9fe 50%, #ddd6fe 100%)",cardBg:"#ffffff",cardBorder:"1px solid rgba(221, 214, 254, 0.85)",cardShadow:"0 20px 48px -12px rgba(124, 58, 237, 0.16), 0 2px 8px rgba(124, 58, 237, 0.04)",textColor:"#1e1b4b",headingColor:"#0f0a2e",metaColor:"#6b21a8",metaBg:"#f5f3ff",metaBorder:"#ddd6fe",accentColor:"#7c3aed",accentSubtle:"rgba(124, 58, 237, 0.18)",linkBg:"rgba(124, 58, 237, 0.08)",dividerColor:"#e9d5ff",codeBg:"#faf5ff",codeBorder:"#e9d5ff",codeColor:"#4c1d95",quoteBg:"rgba(245, 243, 255, 0.85)",quoteBorder:"#8b5cf6",tableThBg:"#f5f3ff",tableBorder:"#ddd6fe",brandText:"#1e1b4b",brandMark:"#7c3aed"}},$he={sans:'system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif',serif:'"Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", "Hiragino Mincho ProN", Georgia, "Times New Roman", serif',mono:'"JetBrains Mono", "SF Mono", "Fira Code", Menlo, Monaco, Consolas, "Liberation Mono", monospace'},Bhe={sm:{base:"14.5px",lineHeight:"1.72",title:"28px",h1:"21px",h2:"18px",h3:"16px",h4:"15px",h5:"14.5px",h6:"14.5px",meta:"12px",code:"12.5px"},md:{base:"16px",lineHeight:"1.8",title:"32px",h1:"24px",h2:"20px",h3:"17.5px",h4:"16.5px",h5:"16px",h6:"16px",meta:"13px",code:"13.5px"},lg:{base:"18px",lineHeight:"1.86",title:"36px",h1:"27px",h2:"22.5px",h3:"19px",h4:"18px",h5:"18px",h6:"18px",meta:"14px",code:"15px"}},vPt=(t,e)=>e&&y5[e]?e:t==="warm"?"sunset":t&&y5[t]?t:"slate",bPt=(t,e)=>{const n=t.replace(/[\u0000-\u001f<>:"/\\|?*]/g,"-").replace(/\s+/g," ").replace(/[. ]+$/g,"").trim().slice(0,100)||e;return mPt.test(n)?`_${n}`:n},fC=t=>t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),xPt=({title:t,notebook:e="",tags:r=[],updatedAt:n="",bodyHtml:i,theme:s="slate",fontStyle:a="serif",showTitle:o=!0,showNotebook:l=!1,showTags:u=!1,showUpdatedAt:h=!0,showBranding:d=!0})=>{const f=a==="mono",p=s==="notepad",g=f?`<div class="edgeever-terminal-header">+`),fontSize:e==="root"?15:e==="primary"?14:13}},KOt=t=>Math.round(Math.max(1,t/2)),ZOt=(t,e)=>`M 1 ${tr(Math.max(2,e-2))} H ${tr(Math.max(2,t-1))}`,QOt=(t,e)=>{const r=Math.max(t,12),n=Math.max(e,12);return[`M ${tr(r*.18)} ${tr(n*.62)}`,`Q ${tr(r*.06)} ${tr(n*.6)} ${tr(r*.08)} ${tr(n*.44)}`,`Q ${tr(r*.02)} ${tr(n*.26)} ${tr(r*.22)} ${tr(n*.24)}`,`Q ${tr(r*.3)} ${tr(n*.06)} ${tr(r*.48)} ${tr(n*.14)}`,`Q ${tr(r*.6)} ${tr(n*.02)} ${tr(r*.72)} ${tr(n*.16)}`,`Q ${tr(r*.96)} ${tr(n*.14)} ${tr(r*.92)} ${tr(n*.4)}`,`Q ${tr(r*1.02)} ${tr(n*.56)} ${tr(r*.84)} ${tr(n*.64)}`,`Q ${tr(r*.8)} ${tr(n*.84)} ${tr(r*.58)} ${tr(n*.78)}`,`Q ${tr(r*.42)} ${tr(n*.92)} ${tr(r*.3)} ${tr(n*.76)}`,`Q ${tr(r*.12)} ${tr(n*.82)} ${tr(r*.18)} ${tr(n*.62)}`,"Z"].join(" ")},JOt=(t,e,r,n)=>t==="ellipse"||t==="circle"?{refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%"}:t==="diamond"?{refPoints:"5,0 10,5 5,10 0,5"}:t==="hexagon"?{refPoints:"2.5,0 7.5,0 10,5 7.5,10 2.5,10 0,5"}:t==="cloud"?{d:QOt(e,r)}:{rx:n,ry:n},ePt=(t,e,r={})=>{const n=r.underline??g3(t,r.structure),i=r.width??96,s=r.height??(t==="root"?46:n?32:36),a=r.tint,o=OQ(r.structure,t);if(n){const h=(a==null?void 0:a.edge)??e.mindMapEdge;return{body:{fill:"transparent",stroke:"none",strokeWidth:0,rx:0,ry:0},label:{fill:(a==null?void 0:a.text)??e.nodeText,fontSize:t==="primary"?14:13,fontWeight:t==="primary"?650:500,fontFamily:Nhe,lineHeight:18,refX:"50%",refY:s-6,textAnchor:"middle",textVerticalAnchor:"bottom"},underline:{d:ZOt(i,s),stroke:h,strokeWidth:1.8,fill:"none",strokeLinecap:"round",pointerEvents:"none"}}}const l=t==="root",u=o==="capsule"||l&&o==="rounded"?KOt(s):o==="rect"?2:l?12:t==="nested"?8:10;return{body:{fill:l?e.topicFill:(a==null?void 0:a.fill)??(t==="nested"?e.canvas:e.nodeFill),stroke:l?e.topicStroke:(a==null?void 0:a.stroke)??(t==="nested"?e.nodeStroke:e.topicStroke),strokeWidth:t==="nested"&&!l?1:1.5,...JOt(o,i,s,u)},label:{fill:l?e.topicText:(a==null?void 0:a.text)??e.nodeText,fontSize:l?15:t==="primary"?14:13,fontWeight:l||t==="primary"?650:500,fontFamily:Nhe,lineHeight:l?20:18,refY:"50%",textAnchor:"middle",textVerticalAnchor:"middle"},underline:{d:"",stroke:"none",fill:"none"}}},Dhe=(t,e,r,n,i,s,a)=>{const o=YM(t,e),l=g3(o,a),u=qOt(n)?jOt(UOt(t,e),i,n):void 0;return{role:o,underline:l,tint:u,visual:ePt(o,r,{tint:u,underline:l,structure:a,width:s.width,height:s.height})}},tPt=(t,e,r)=>{const n=(r==null?void 0:r.edge)??e.mindMapEdge;return t==="root"?{stroke:n,sourceWidth:3.1,targetWidth:1.55}:t==="primary"?{stroke:n,sourceWidth:1.85,targetWidth:1.15}:{stroke:n,sourceWidth:1.25,targetWidth:.9}},rPt=(t,e,r)=>{const n=DQ(r),i=t.x+t.width/2,s=e.x+e.width/2,a=t.y+t.height/2,o=e.y+e.height/2;return n==="org"?{source:"bottom",target:"top"}:n==="fishbone"?s<i-8?{source:"left",target:"right"}:o<a-8?{source:"top",target:"bottom"}:o>a+8?{source:"bottom",target:"top"}:{source:"left",target:"right"}:n==="timeline"?o<a-8?{source:s>=i?"right":"left",target:"bottom"}:o>a+8?{source:s>=i?"right":"left",target:"top"}:s>=i?{source:"right",target:"left"}:{source:"left",target:"right"}:s>=i?{source:"right",target:"left"}:{source:"left",target:"right"}},Ohe=(t,e,r,n)=>{const i=g3(e,n),s=i&&(r==="left"||r==="right")?t.height/2-2:0;return{anchor:{name:r,...s?{args:{dy:s}}:{}},connectionPoint:{name:i?"anchor":"boundary"}}},nPt=(t,e)=>{const r=t.filter(i=>i.parentId===e);if(r.length===0)return null;const n=r.map(i=>i.y+i.height/2);return{top:Math.min(...n),bottom:Math.max(...n)}},Phe=(t,e)=>VOt(t)?{fill:e,strokeWidth:.5,strokeLinejoin:"round",strokeLinecap:"round"}:{fill:"none",strokeWidth:1.7,strokeLinejoin:"round",strokeLinecap:"round"},iPt=(t,e,r,n,i)=>{const s=1-i;return{x:s*s*s*t.x+3*s*s*i*e.x+3*s*i*i*r.x+i*i*i*n.x,y:s*s*s*t.y+3*s*s*i*e.y+3*s*i*i*r.y+i*i*i*n.y}},sPt=(t,e,r,n,i)=>{const s=1-i;return{x:3*s*s*(e.x-t.x)+6*s*i*(r.x-e.x)+3*i*i*(n.x-r.x),y:3*s*s*(e.y-t.y)+6*s*i*(r.y-e.y)+3*i*i*(n.y-r.y)}},aPt=(t,e,r=2.4,n=1.15)=>{const i=e.x-t.x,s=e.y-t.y;if(Math.abs(i)<.01&&Math.abs(s)<.01)return`M ${tr(t.x)} ${tr(t.y)} L ${tr(e.x)} ${tr(e.y)}`;const a=(t.x+e.x)/2,o=t,l={x:a,y:t.y},u={x:a,y:e.y},h=e,d=20,f=[],p=[];for(let y=0;y<=d;y+=1){const v=y/d,x=iPt(o,l,u,h,v),b=sPt(o,l,u,h,v),T=Math.hypot(b.x,b.y)||1,C=((1-v)*r+v*n)/2,S=-b.y/T,k=b.x/T;f.push({x:x.x+S*C,y:x.y+k*C}),p.push({x:x.x-S*C,y:x.y-k*C})}const g=f[0],m=[`M ${tr(g.x)} ${tr(g.y)}`];for(let y=1;y<f.length;y+=1)m.push(`L ${tr(f[y].x)} ${tr(f[y].y)}`);for(let y=p.length-1;y>=0;y-=1)m.push(`L ${tr(p[y].x)} ${tr(p[y].y)}`);return m.push("Z"),m.join(" ")},oPt=t=>`${tr(t.x)} ${tr(t.y)}`,Od=t=>t.map((e,r)=>`${r===0?"M":"L"} ${oPt(e)}`).join(" "),lPt=(t,e,r)=>{if(Math.abs(t.x-e.x)<.8||Math.abs(t.y-e.y)<.8)return Od([t,e]);const n={x:t.x,y:(t.y+e.y)/2},i={x:e.x,y:n.y};return Od([t,n,i,e])},cPt=(t,e)=>{const r=t.x+Math.max(10,Math.min(28,Math.abs(e.x-t.x)*.38));return Math.abs(t.y-e.y)<.8?Od([t,e]):Od([t,{x:r,y:t.y},{x:r,y:e.y},e])},uPt=(t,e,r,n)=>{const i=Math.min(r??t.y,n??t.y,t.y,e.y),s=Math.max(r??t.y,n??t.y,t.y,e.y),a=Math.max(18,s-i),o=(i+s)/2-a/2,l=o+a,u=(o+l)/2,h=9,d=t.x+Math.max(18,Math.min(36,Math.abs(e.x-t.x)*.42));return[Od([t,{x:d-h,y:t.y}]),`M ${tr(d-h)} ${tr(o)}`,`C ${tr(d)} ${tr(o)} ${tr(d)} ${tr(o)} ${tr(d)} ${tr((o+u)/2)}`,`C ${tr(d)} ${tr(u)} ${tr(d+h)} ${tr(u)} ${tr(d+h)} ${tr(u)}`,`C ${tr(d)} ${tr(u)} ${tr(d)} ${tr(u)} ${tr(d)} ${tr((u+l)/2)}`,`C ${tr(d)} ${tr(l)} ${tr(d)} ${tr(l)} ${tr(d-h)} ${tr(l)}`,Od([{x:d,y:e.y},e])].join(" ")},hPt=(t,e)=>Math.abs(t.x-e.x)<.8||Math.abs(t.y-e.y)<.8?Od([t,e]):Od([t,{x:e.x,y:t.y},e]),dPt=(t,e)=>{if(Math.abs(t.y-e.y)<.8||Math.abs(t.x-e.x)<.8)return Od([t,e]);const r=Math.abs(e.y-t.y),n=t.x>=e.x?1:-1,i=e.x+n*Math.max(18,r/Math.sqrt(3)),s={x:n>0?Math.min(t.x,i):Math.max(t.x,i),y:t.y};return Od([t,s,e])},fPt=(t,e,r,n={})=>{const i=DQ(n.structure);return i==="org"?lPt(t,e):i==="tree"?cPt(t,e):i==="brace"?uPt(t,e,n.braceTop,n.braceBottom):i==="timeline"?hPt(t,e):i==="fishbone"?dPt(t,e):aPt(t,e,n.sourceWidth,n.targetWidth)},pPt=(t,e="light")=>NOt(t,e),gPt=(t,e)=>{const r=pPt(t.kind==="architecture"?t.theme??"brand":t.theme,e),n=t.kind==="flowchart"?t8e(e,t.theme):null,i=t.kind==="architecture"?ID(e):null,s=t.nodes.map(h=>{const d=t.kind==="mind-map"?YM(t.nodes,h.id):null,f=t.kind==="flowchart"?BOt(h.shape,h.label):d?XOt(h.label,d,t.structure):{width:h.width,height:h.height,text:h.label},p=d?Dhe(t.nodes,h.id,r,t.theme,e,f,t.structure):null,g=(p==null?void 0:p.visual)??null,m=t.kind==="flowchart"?oOt(h.shape,e,f,t.theme):null,y=t.kind==="architecture"?YDt(h.shape,e,f,h.resourceIcon):null,v=h.shape==="topic"&&!h.parentId,x=h.shape==="terminator",b=h.shape==="boundary",T=v||x,C=g?g.body.fill:m?m.body.fill:y?y.body.fill:T?r.topicFill:r.nodeFill,S=g?g.body.stroke:m?m.body.stroke:y?y.body.stroke:T?r.topicStroke:r.nodeStroke;return{id:h.id,shape:h.shape==="decision"?"polygon":"rect",x:h.x,y:h.y,width:f.width,height:f.height,zIndex:b?0:2,...y?{markup:y.markup}:d?{markup:HOt(t.structure,d)}:{},attrs:{body:{fill:C,stroke:S,strokeWidth:(g==null?void 0:g.body.strokeWidth)??(m==null?void 0:m.body.strokeWidth)??(y==null?void 0:y.body.strokeWidth)??1,strokeDasharray:(y==null?void 0:y.body.strokeDasharray)??(b?"7 5":void 0),...(g==null?void 0:g.body)??(m==null?void 0:m.body)??(y==null?void 0:y.body)??{rx:x?24:11,ry:x?24:11},...h.shape==="decision"?{refPoints:"0,10 10,0 20,10 10,20"}:{}},label:{text:f.text,lineHeight:(g==null?void 0:g.label.lineHeight)??(m==null?void 0:m.label.lineHeight)??(y==null?void 0:y.label.lineHeight)??(d==="root"?20:18),fill:(g==null?void 0:g.label.fill)??(m==null?void 0:m.label.fill)??(y==null?void 0:y.label.fill)??(T?r.topicText:r.nodeText),fontSize:(g==null?void 0:g.label.fontSize)??(m==null?void 0:m.label.fontSize)??(y==null?void 0:y.label.fontSize)??(h.shape==="topic"?14:13),fontWeight:(g==null?void 0:g.label.fontWeight)??(m==null?void 0:m.label.fontWeight)??(y==null?void 0:y.label.fontWeight)??(T?650:500),fontFamily:(g==null?void 0:g.label.fontFamily)??(m==null?void 0:m.label.fontFamily)??(y==null?void 0:y.label.fontFamily)??SW,...g?{refX:g.label.refX,refY:g.label.refY,textAnchor:g.label.textAnchor,textVerticalAnchor:g.label.textVerticalAnchor}:{},...y?{refX:y.label.refX,refY:y.label.refY,textAnchor:y.label.textAnchor,textVerticalAnchor:y.label.textVerticalAnchor}:{}},...g?{underline:g.underline}:{},...(y==null?void 0:y.attrs)??{}}}}),a=new Map(s.map(h=>[h.id,h])),o=t.nodes.filter(h=>h.shape==="boundary").map(h=>h.id),l=t.kind==="architecture"?VDt(t.nodes.filter(h=>h.shape!=="boundary"),t.edges):null,u=t.edges.map(h=>{const d=h.kind??(t.kind==="architecture"?"dependency":void 0),f=a.get(h.source),p=a.get(h.target),g=t.kind==="mind-map"?YM(t.nodes,h.source):null,m=t.kind==="mind-map"?YM(t.nodes,h.target):null,y=t.kind==="mind-map"?Dhe(t.nodes,h.target,r,t.theme,e,{width:96,height:36},t.structure).tint:void 0,v=g?tPt(g,r,y):null,x=f&&p?rPt(f,p,t.structure):{source:"right",target:"left"},b=f&&g?Ohe(f,g,x.source,t.structure):null,T=p&&m?Ohe(p,m,x.target,t.structure):null,C=t.kind==="mind-map"&&t.structure==="brace"?nPt(t.nodes,h.source):null,S=t.kind==="architecture"?XDt(d,e,h.bidirectional):null,k=(S==null?void 0:S.stroke)??(v==null?void 0:v.stroke)??(n==null?void 0:n.edge)??r.flowEdge,E=f&&p?t.kind==="architecture"?Q7e(f,p):t.kind==="flowchart"?JDt(f,p):null:null,A=t.kind==="flowchart"&&!!(E&&f&&p&&eOt(f,p)),R=l==null?void 0:l.get(h.id);return{id:h.id,source:t.kind==="mind-map"?{cell:h.source,...b??{anchor:{name:x.source}}}:R?{cell:h.source,anchor:Rhe(R.source)}:E?{cell:h.source,port:E.source}:{cell:h.source},target:t.kind==="mind-map"?{cell:h.target,...T??{anchor:{name:x.target}}}:R?{cell:h.target,anchor:Rhe(R.target)}:E?{cell:h.target,port:E.target}:{cell:h.target},router:t.kind==="architecture"?zDt(h.source,h.target,o,E??void 0):t.kind==="flowchart"?A?{name:"normal"}:QDt:void 0,connector:t.kind==="mind-map"?{name:s8e,args:{sourceWidth:v==null?void 0:v.sourceWidth,targetWidth:v==null?void 0:v.targetWidth,structure:t.structure,...C?{braceTop:C.top,braceBottom:C.bottom}:{}}}:{name:"rounded",args:{radius:10}},attrs:{line:{stroke:k,strokeWidth:(S==null?void 0:S.strokeWidth)??(v?Phe(t.structure,k).strokeWidth:1.5),strokeDasharray:S==null?void 0:S.strokeDasharray,sourceMarker:S?S.sourceMarker:h.bidirectional?{name:"block",width:7,height:5}:null,targetMarker:t.kind==="mind-map"?null:(S==null?void 0:S.targetMarker)??{name:"block",width:7,height:5},...v?Phe(t.structure,k):{fill:"none"}}},labels:h.label?[{attrs:{label:{text:h.label,fill:t.kind==="architecture"?e==="dark"?"#E2E8F0":"#334155":t.kind==="flowchart"?e==="dark"?"#E2E8F0":"#475569":(n==null?void 0:n.process.text)??(i==null?void 0:i.nodes.service.text)??r.nodeText,fontSize:t.kind==="architecture"?$Dt:t.kind==="flowchart"?KDt:FOt,fontWeight:t.kind==="architecture"||t.kind==="flowchart"?500:400,lineHeight:t.kind==="architecture"?BDt:t.kind==="flowchart"?ZDt:zOt,fontFamily:t.kind==="architecture"?Z7e:SW,textWrap:{width:140,height:512}},body:{ref:"label",refWidth:1,refHeight:1,refWidth2:t.kind==="architecture"||t.kind==="flowchart"?14:12,refHeight2:6,refX:t.kind==="architecture"||t.kind==="flowchart"?-7:-6,refY:-3,fill:t.kind==="architecture"?e==="dark"?"rgba(15, 23, 42, 0.92)":"rgba(255, 255, 255, 0.96)":t.kind==="flowchart"?e==="dark"?"rgba(24, 28, 34, 0.94)":"rgba(255, 255, 255, 0.95)":(n==null?void 0:n.canvas)??(i==null?void 0:i.canvas)??r.canvas,stroke:t.kind==="architecture"?(S==null?void 0:S.stroke)??(e==="dark"?"rgba(148, 163, 184, 0.3)":"rgba(203, 213, 225, 0.8)"):t.kind==="flowchart"?e==="dark"?"rgba(148, 163, 184, 0.28)":"rgba(100, 116, 139, 0.24)":(n==null?void 0:n.process.stroke)??(i==null?void 0:i.nodes.service.stroke)??r.nodeStroke,strokeWidth:1,rx:6,ry:6,...t.kind==="architecture"||t.kind==="flowchart"?{style:{filter:"drop-shadow(0 1px 2px rgba(0,0,0,0.06))"}}:{}}}}]:void 0}});return{canvas:(n==null?void 0:n.canvas)??(i==null?void 0:i.canvas)??r.canvas,edges:u,nodes:s}},a8e={compact:560,standard:680,wide:800},mPt=/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\.|$)/i,yPt={slate:"#f8fafc",aurora:"#a7f3d0",sunset:"#fde68a",midnight:"#090d16",mint:"#ecfdf5",notepad:"#fbf7ee",xuan:"#f7f6f2",lavender:"#f5f3ff",warm:"#fffbeb"},y5={slate:{canvasBg:"linear-gradient(145deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%)",cardBg:"#ffffff",cardBorder:"1px solid rgba(226, 232, 240, 0.85)",cardShadow:"0 2px 4px rgba(15, 23, 42, 0.02), 0 12px 28px -4px rgba(15, 23, 42, 0.07), 0 24px 60px -12px rgba(15, 23, 42, 0.06)",textColor:"#1e293b",headingColor:"#0f172a",metaColor:"#64748b",metaBg:"#f8fafc",metaBorder:"#e2e8f0",accentColor:"#16a06e",accentSubtle:"rgba(22, 160, 110, 0.16)",linkBg:"rgba(22, 160, 110, 0.08)",dividerColor:"#e2e8f0",codeBg:"#f8fafc",codeBorder:"#e2e8f0",codeColor:"#0f172a",quoteBg:"rgba(240, 253, 244, 0.7)",quoteBorder:"#10b981",tableThBg:"#f8fafc",tableBorder:"#e2e8f0",brandText:"#07130b",brandMark:"#16a06e"},aurora:{canvasBg:"linear-gradient(135deg, #a7f3d0 0%, #67e8f9 40%, #c4b5fd 100%)",cardBg:"rgba(255, 255, 255, 0.96)",cardBorder:"1px solid rgba(255, 255, 255, 0.95)",cardShadow:"0 24px 60px -12px rgba(14, 165, 233, 0.28), 0 4px 16px rgba(0, 0, 0, 0.04)",textColor:"#1e293b",headingColor:"#0f172a",metaColor:"#475569",metaBg:"rgba(241, 245, 249, 0.85)",metaBorder:"rgba(203, 213, 225, 0.7)",accentColor:"#0d9488",accentSubtle:"rgba(13, 148, 136, 0.18)",linkBg:"rgba(13, 148, 136, 0.09)",dividerColor:"rgba(226, 232, 240, 0.8)",codeBg:"rgba(248, 250, 252, 0.95)",codeBorder:"rgba(226, 232, 240, 0.8)",codeColor:"#0f172a",quoteBg:"rgba(240, 253, 250, 0.85)",quoteBorder:"#14b8a6",tableThBg:"#f1f5f9",tableBorder:"#cbd5e1",brandText:"#0f172a",brandMark:"#0d9488"},sunset:{canvasBg:"linear-gradient(135deg, #fde68a 0%, #fbcfe8 45%, #fed7aa 100%)",cardBg:"#fffdfa",cardBorder:"1px solid rgba(253, 230, 138, 0.7)",cardShadow:"0 24px 60px -12px rgba(244, 63, 94, 0.18), 0 4px 16px rgba(0, 0, 0, 0.03)",textColor:"#292524",headingColor:"#1c1917",metaColor:"#78716c",metaBg:"rgba(254, 243, 199, 0.75)",metaBorder:"rgba(253, 230, 138, 0.8)",accentColor:"#ea580c",accentSubtle:"rgba(234, 88, 12, 0.15)",linkBg:"rgba(234, 88, 12, 0.08)",dividerColor:"rgba(254, 215, 170, 0.7)",codeBg:"#fffbeb",codeBorder:"#fde68a",codeColor:"#1c1917",quoteBg:"rgba(255, 247, 237, 0.85)",quoteBorder:"#f97316",tableThBg:"#fef3c7",tableBorder:"#fde68a",brandText:"#1c1917",brandMark:"#ea580c"},midnight:{canvasBg:"linear-gradient(135deg, #090d16 0%, #0f172a 50%, #1e1b4b 100%)",cardBg:"#131b2e",cardBorder:"1px solid rgba(255, 255, 255, 0.14)",cardShadow:"0 24px 60px -12px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.08)",textColor:"#cbd5e1",headingColor:"#f8fafc",metaColor:"#94a3b8",metaBg:"rgba(30, 41, 59, 0.85)",metaBorder:"rgba(51, 65, 85, 0.8)",accentColor:"#34d399",accentSubtle:"rgba(52, 211, 153, 0.2)",linkBg:"rgba(52, 211, 153, 0.12)",dividerColor:"rgba(51, 65, 85, 0.7)",codeBg:"#0b1120",codeBorder:"#1e293b",codeColor:"#e2e8f0",quoteBg:"rgba(16, 185, 129, 0.12)",quoteBorder:"#34d399",tableThBg:"#1e293b",tableBorder:"#334155",brandText:"#f8fafc",brandMark:"#34d399",isDark:!0},mint:{canvasBg:"linear-gradient(135deg, #ecfdf5 0%, #d1fae5 50%, #a7f3d0 100%)",cardBg:"#ffffff",cardBorder:"1px solid rgba(167, 243, 208, 0.85)",cardShadow:"0 20px 50px -15px rgba(16, 185, 129, 0.2), 0 4px 16px rgba(16, 185, 129, 0.06)",textColor:"#134e4a",headingColor:"#042f2e",metaColor:"#0f766e",metaBg:"#ccfbf1",metaBorder:"#99f6e4",accentColor:"#059669",accentSubtle:"rgba(5, 150, 105, 0.18)",linkBg:"rgba(5, 150, 105, 0.1)",dividerColor:"#a7f3d0",codeBg:"#f0fdf4",codeBorder:"#a7f3d0",codeColor:"#064e3b",quoteBg:"rgba(236, 253, 245, 0.85)",quoteBorder:"#10b981",tableThBg:"#ccfbf1",tableBorder:"#99f6e4",brandText:"#042f2e",brandMark:"#059669"},notepad:{canvasBg:"linear-gradient(135deg, #fbf7ee 0%, #f4ede0 100%)",cardBg:"#fefdfa",cardBorder:"1px solid rgba(220, 205, 180, 0.85)",cardShadow:"0 2px 4px rgba(100, 80, 50, 0.04), 0 16px 36px -8px rgba(100, 80, 50, 0.12), 0 28px 64px -16px rgba(100, 80, 50, 0.08)",textColor:"#2c2419",headingColor:"#1a140d",metaColor:"#8c7b68",metaBg:"rgba(240, 230, 214, 0.6)",metaBorder:"#dfd3c3",accentColor:"#c2410c",accentSubtle:"rgba(194, 65, 12, 0.15)",linkBg:"rgba(194, 65, 12, 0.08)",dividerColor:"#e8decb",codeBg:"#f5efe4",codeBorder:"#e2d5c3",codeColor:"#1a140d",quoteBg:"rgba(248, 241, 230, 0.85)",quoteBorder:"#d97706",tableThBg:"#f5ede0",tableBorder:"#dfd3c3",brandText:"#1a140d",brandMark:"#c2410c"},xuan:{canvasBg:"linear-gradient(135deg, #f7f6f2 0%, #ebe8e1 100%)",cardBg:"#fdfcf7",cardBorder:"1px solid rgba(210, 205, 195, 0.8)",cardShadow:"0 20px 48px -12px rgba(40, 35, 30, 0.1), 0 4px 16px rgba(40, 35, 30, 0.03)",textColor:"#242220",headingColor:"#0f0e0d",metaColor:"#736d66",metaBg:"#f0eee8",metaBorder:"#dedad2",accentColor:"#b91c1c",accentSubtle:"rgba(185, 28, 28, 0.15)",linkBg:"rgba(185, 28, 28, 0.08)",dividerColor:"#e3dfd6",codeBg:"#f4f2eb",codeBorder:"#dedad2",codeColor:"#0f0e0d",quoteBg:"rgba(245, 243, 238, 0.85)",quoteBorder:"#b91c1c",tableThBg:"#edeae2",tableBorder:"#dedad2",brandText:"#0f0e0d",brandMark:"#b91c1c"},lavender:{canvasBg:"linear-gradient(135deg, #f5f3ff 0%, #ede9fe 50%, #ddd6fe 100%)",cardBg:"#ffffff",cardBorder:"1px solid rgba(221, 214, 254, 0.85)",cardShadow:"0 20px 48px -12px rgba(124, 58, 237, 0.16), 0 2px 8px rgba(124, 58, 237, 0.04)",textColor:"#1e1b4b",headingColor:"#0f0a2e",metaColor:"#6b21a8",metaBg:"#f5f3ff",metaBorder:"#ddd6fe",accentColor:"#7c3aed",accentSubtle:"rgba(124, 58, 237, 0.18)",linkBg:"rgba(124, 58, 237, 0.08)",dividerColor:"#e9d5ff",codeBg:"#faf5ff",codeBorder:"#e9d5ff",codeColor:"#4c1d95",quoteBg:"rgba(245, 243, 255, 0.85)",quoteBorder:"#8b5cf6",tableThBg:"#f5f3ff",tableBorder:"#ddd6fe",brandText:"#1e1b4b",brandMark:"#7c3aed"}},$he={sans:'system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif',serif:'"Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", "Hiragino Mincho ProN", Georgia, "Times New Roman", serif',mono:'"JetBrains Mono", "SF Mono", "Fira Code", Menlo, Monaco, Consolas, "Liberation Mono", monospace'},Bhe={sm:{base:"14.5px",lineHeight:"1.72",title:"28px",h1:"21px",h2:"18px",h3:"16px",h4:"15px",h5:"14.5px",h6:"14.5px",meta:"12px",code:"12.5px"},md:{base:"16px",lineHeight:"1.8",title:"32px",h1:"24px",h2:"20px",h3:"17.5px",h4:"16.5px",h5:"16px",h6:"16px",meta:"13px",code:"13.5px"},lg:{base:"18px",lineHeight:"1.86",title:"36px",h1:"27px",h2:"22.5px",h3:"19px",h4:"18px",h5:"18px",h6:"18px",meta:"14px",code:"15px"}},vPt=(t,e)=>e&&y5[e]?e:t==="warm"?"sunset":t&&y5[t]?t:"aurora",bPt=(t,e)=>{const n=t.replace(/[\u0000-\u001f<>:"/\\|?*]/g,"-").replace(/\s+/g," ").replace(/[. ]+$/g,"").trim().slice(0,100)||e;return mPt.test(n)?`_${n}`:n},fC=t=>t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),xPt=({title:t,notebook:e="",tags:r=[],updatedAt:n="",bodyHtml:i,theme:s="aurora",fontStyle:a="serif",showTitle:o=!0,showNotebook:l=!1,showTags:u=!1,showUpdatedAt:h=!0,showBranding:d=!0})=>{const f=a==="mono",p=s==="notepad",g=f?`<div class="edgeever-terminal-header"><span class="edgeever-terminal-dot dot-red"></span><span class="edgeever-terminal-dot dot-yellow"></span><span class="edgeever-terminal-dot dot-green"></span>@@ -1978,7 +1978,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.</div></footer>`:""}</article>-</div>`},wPt=({theme:t="slate",fontStyle:e="serif",fontSize:r="lg",cardWidth:n="standard"})=>{const i=y5[t]||y5.slate,s=$he[e]||$he.sans,a=Bhe[r]||Bhe.md,o=a8e[n]||680;return`+</div>`},wPt=({theme:t="aurora",fontStyle:e="serif",fontSize:r="lg",cardWidth:n="standard"})=>{const i=y5[t]||y5.aurora,s=$he[e]||$he.sans,a=Bhe[r]||Bhe.md,o=a8e[n]||680;return`:root {--ee-canvas-bg: ${i.canvasBg};--ee-card-bg: ${i.cardBg};@@ -2661,7 +2661,7 @@ l0,-`+(r+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,`)},WB="edgeever-inline-sentinel",aFt=(t,e,r)=>{var i;const n=(i=t.storage.markdown)==null?void 0:i.manager;return n!=null&&n.serialize?n.serialize(aJ({type:"doc",content:[{type:"paragraph",content:e}]})).replaceAll(sJ,"\\$"):r},oFt=t=>{const e=t.state.selection;if(e.empty||e.from>=e.to)return null;const r=[];if(t.state.doc.nodesBetween(e.from,e.to,(i,s)=>{if(!i.isTextblock)return!0;const a=s+1,o=a+i.content.size,l=Math.max(e.from,a),u=Math.min(e.to,o);return u>l&&r.push({node:i,contentFrom:a,contentTo:o,from:l,to:u}),!1}),r.length===1){const i=r[0],s=i.node.cut(i.from-i.contentFrom,i.to-i.contentFrom).toJSON(),a=t.state.doc.textBetween(i.from,i.to,``),o=aFt(t,s.content??[],a).trim();return o?{from:i.from,to:i.to,isInline:!0,markdown:o,text:a}:null}const n=sFt(t,e.from,e.to).trim();return n?{from:e.from,to:e.to,isInline:!1,markdown:n,text:t.state.doc.textBetween(e.from,e.to,`-`)}:null},lFt=(t,e,r)=>{var f,p,g;const n=(f=t.storage.markdown)==null?void 0:f.manager,i=e.trim(),s=((p=n==null?void 0:n.parse)==null?void 0:p.call(n,i).content)??[{type:"text",text:i}];if(!r)return s;const a=i.replace(/\s*\n+\s*/g," "),o=(g=n==null?void 0:n.parse)==null?void 0:g.call(n,`${WB}${a}`).content,l=(o==null?void 0:o.length)===1?o[0]:null,u=(l==null?void 0:l.type)==="paragraph"?l.content??[]:[],h=u[0];if((h==null?void 0:h.type)!=="text"||typeof h.text!="string"||!h.text.startsWith(WB))return[{type:"text",text:a}];const d=h.text.slice(WB.length);return[...d?[{...h,text:d}]:[],...u.slice(1)]};function ed(t){try{const e=JSON.stringify(vQ(t.getJSON())),r=yMe(t);Ua({type:"change",contentMarkdown:r,contentJson:e})}catch(e){Ua({type:"error",message:e instanceof Error?e.message:String(e)})}}function cFt(t,e){const r=e.trim().toLocaleLowerCase();if(r.length===0)return[];const n=[];let i=null;t.state.doc.descendants((l,u)=>{if(!(!l.isText||!l.text)){i!==null&&u>i&&n.push({char:"\0",pos:-1});for(let h=0;h<l.text.length;h+=1)n.push({char:l.text[h]??"",pos:u+h});i=u+l.text.length}});const s=n.map(l=>l.char).join("").toLocaleLowerCase(),a=[];let o=s.indexOf(r);for(;o!==-1;){const l=n[o],u=n[o+r.length-1];l&&u&&l.pos>=0&&u.pos>=0&&a.push({from:l.pos,to:u.pos+1}),o=s.indexOf(r,o+r.length)}return a}const Rde=()=>mr.isActive("taskItem")?"taskItem":"listItem";function vMe(t){var r;if(QM.classList.toggle("editor-mode",t),QM.innerHTML="",!t)return;const e=[{id:"undo",label:"↩",run:()=>mr.chain().focus().undo().run()},{id:"redo",label:"↪",run:()=>mr.chain().focus().redo().run()},{id:"image",label:"▧+",run:()=>Ua({type:"pickImage"})},{id:"bold",label:"B",run:()=>mr.chain().focus().toggleBold().run()},{id:"bullet",label:"•",run:()=>mr.chain().focus().toggleBulletList().run()},{id:"task",label:"☑",run:()=>mr.chain().focus().toggleTaskList().run()},{id:"indent",label:"⇥",run:()=>mr.chain().focus().sinkListItem(Rde()).run()},{id:"outdent",label:"⇤",run:()=>mr.chain().focus().liftListItem(Rde()).run()},{id:"quote",label:"❝",run:()=>mr.chain().focus().toggleBlockquote().run()},{id:"hr",label:"—",run:()=>mr.chain().focus().setHorizontalRule().run()}];for(const n of e){const i=document.createElement("button");i.type="button",i.textContent=n.label,i.dataset.action=n.id;const s={undo:{"zh-CN":"撤销","en-US":"Undo",ja:"元に戻す",pl:"Cofnij"},redo:{"zh-CN":"重做","en-US":"Redo",ja:"やり直す",pl:"Ponów"},image:{"zh-CN":"插入图片","en-US":"Insert image",ja:"画像を挿入",pl:"Wstaw obraz"},bold:{"zh-CN":"粗体","en-US":"Bold",ja:"太字",pl:"Pogrubienie"},bullet:{"zh-CN":"项目符号列表","en-US":"Bullet list",ja:"箇条書き",pl:"Lista punktowana"},task:{"zh-CN":"任务清单","en-US":"Task list",ja:"タスクリスト",pl:"Lista zadań"},indent:{"zh-CN":"增加列表缩进","en-US":"Increase list indent",ja:"リストのインデントを増やす",pl:"Zwiększ wcięcie listy"},outdent:{"zh-CN":"减少列表缩进","en-US":"Decrease list indent",ja:"リストのインデントを減らす",pl:"Zmniejsz wcięcie listy"},quote:{"zh-CN":"引用","en-US":"Block quote",ja:"引用",pl:"Cytat"},hr:{"zh-CN":"分隔线","en-US":"Horizontal rule",ja:"区切り線",pl:"Linia pozioma"}};i.setAttribute("aria-label",((r=s[n.id])==null?void 0:r[mL])??n.id),i.addEventListener("click",()=>{n.run(),n.id!=="image"&&ed(mr),b5()}),QM.appendChild(i)}b5()}function b5(){const t={bold:mr.isActive("bold"),bullet:mr.isActive("bulletList"),task:mr.isActive("taskList"),quote:mr.isActive("blockquote")},e=n=>{try{return mr.can().chain().focus()[n]().run()}catch{return!1}},r={undo:e("undo"),redo:e("redo")};QM.querySelectorAll("button[data-action]").forEach(n=>{const i=n.dataset.action??"";n.classList.toggle("is-active",t[i]??!1),i in r&&(n.disabled=!r[i])})}async function qB(t="light"){zo.querySelectorAll("[data-placeholder]").forEach(e=>{e.dataset.placeholder=BW}),fMe(zo),await JBt(zo),ta==="viewer"&&(!bL||!tFt(zo,bL,t))&&(iJ(),await eFt(zo,t))}async function uFt(t){var p;if(!t.requestId||t.format!=="png"&&t.format!=="jpeg")return;const e=vPt(t.background,t.theme),r=t.fontStyle??"serif",n=t.fontSize??"lg",i=t.cardWidth??"standard",s=a8e[i]||680,a=y5[e]||y5.slate,o=mr.view.dom.cloneNode(!0);o.removeAttribute("contenteditable"),o.querySelectorAll("button, [contenteditable='true']").forEach(g=>{g.removeAttribute("contenteditable"),g instanceof HTMLButtonElement&&g.remove()});const l=o.innerHTML,u=document.createElement("div");u.style.cssText=`position:fixed;left:-100000px;top:0;width:${s}px;pointer-events:none;`;const h=document.createElement("style");h.textContent=wPt({theme:e,fontStyle:r,fontSize:n,cardWidth:i});const d=xPt({title:t.title||t.fallbackTitle,notebook:t.notebook,tags:t.tags,updatedAt:t.updatedAt,bodyHtml:l,theme:e,fontStyle:r,showTitle:t.showTitle??!0,showNotebook:t.showNotebook??!1,showTags:t.showTags??!1,showUpdatedAt:t.showUpdatedAt??!0,showBranding:t.branding??!0});u.appendChild(h),u.insertAdjacentHTML("beforeend",d);const f=u.lastElementChild;f.style.width=`${s}px`,f.style.maxWidth="none",f.style.margin="0",document.body.appendChild(u);try{await((p=document.fonts)==null?void 0:p.ready),await Promise.all(Array.from(f.querySelectorAll("img")).map(async R=>{if(!R.complete)try{await R.decode()}catch{}}));const g=Array.from(f.querySelectorAll(".edgeever-card-body img")),m=g.filter(R=>!R.complete||R.naturalWidth===0).length,y=Math.max(1,Math.ceil(f.getBoundingClientRect().height)),v=yPt[e]||a.canvasBg,x=await D6t(f,{backgroundColor:v,cacheBust:!1,height:y,pixelRatio:2,skipFonts:!0,width:s}),b=await new Promise((R,_)=>{x.toBlob(P=>P?R(P):_(new Error("Image renderer returned an empty file")),t.format==="jpeg"?"image/jpeg":"image/png",t.format==="jpeg"?.92:1)}),T=t.format==="jpeg"?"jpg":"png",C=bPt(t.title,t.fallbackTitle),S=await ZBt(b),k=`${C}.${T}`,E=t.format==="jpeg"?"image/jpeg":"image/png",A=QBt(S);for(let R=0;R<A.length;R+=Ede)Ua({type:"imageExportChunk",requestId:t.requestId,chunk:A.slice(R,R+Ede)}),await new Promise(_=>setTimeout(_,0));Ua({type:"imageExportComplete",requestId:t.requestId,filename:k,mimeType:E,width:x.width,height:x.height,totalImages:g.length,failedImages:m})}catch(g){Ua({type:"imageExportError",requestId:t.requestId,message:g instanceof Error?g.message:"Image export failed"})}finally{u.remove()}}const hFt={exportImage(t){uFt(t)},configure(t){const e=t.mode==="editor"?"editor":"viewer",r=e!==ta;ta=e,mL=t.locale==="en-US"||t.locale==="ja"||t.locale==="pl"?t.locale:"zh-CN",mr.setEditable(ta==="editor"),vMe(ta==="editor"),document.documentElement.dataset.theme=t.theme||"light",document.body.classList.toggle("viewer-mode",ta==="viewer"),document.body.classList.toggle("editor-mode",ta==="editor"),t.placeholder&&(BW=t.placeholder,zo.querySelectorAll("[data-placeholder]").forEach(n=>{n.dataset.placeholder=BW})),ta==="editor"&&r&&requestAnimationFrame(()=>{try{mr.commands.focus("end")}catch{}}),qB(t.theme||"light")},setMarkdown(t){var n;sk=!0;const e=ta==="viewer"?kOt(t):null;bL=e;const r=ta==="viewer"?e?"":SOt(t):t;try{mr.commands.setContent(r||"",{contentType:"markdown"})}catch{try{const i=(n=mr.storage.markdown)==null?void 0:n.manager;if(i)mr.commands.setContent(i.parse(r||""));else throw new Error("no markdown manager")}catch{mr.commands.setContent({type:"doc",content:[{type:"paragraph",content:r?[{type:"text",text:r}]:[]}]})}}mr.setEditable(ta==="editor"),zhe(mr),b5(),sk=!1,qB(document.documentElement.dataset.theme||"light")},setDocumentFromJSON(t){sk=!0,bL=null,iJ();try{const e=JSON.parse(t);mr.commands.setContent(n9t(cDt(e),mL))}catch{mr.commands.setContent({type:"doc",content:[{type:"paragraph"}]})}mr.setEditable(ta==="editor"),zhe(mr),b5(),sk=!1,qB(document.documentElement.dataset.theme||"light")},resolveResource(t,e){const r=yL.get(t);r&&(yL.delete(t),r(e))},getMarkdown(){return yMe(mr)},getDocument(){return JSON.stringify(vQ(mr.getJSON()))},captureSelection(){const t=oFt(mr);return t?(pC={from:t.from,to:t.to,isInline:t.isInline,documentFingerprint:JSON.stringify(mr.getJSON())},JSON.stringify({from:t.from,to:t.to,markdown:t.markdown,text:t.text})):(pC=null,null)},applySelectionDraft(t,e){var a,o;const r=pC;if(!r||!t.trim())return!1;if(JSON.stringify(mr.getJSON())!==r.documentFingerprint)return pC=null,!1;const n=mr.state.doc.content.size,i=Math.min(Math.max(r.from,0),n),s=Math.min(Math.max(r.to,i),n);try{const l=(a=mr.storage.markdown)==null?void 0:a.manager,u=(o=l==null?void 0:l.parse)==null?void 0:o.call(l,t),h=e==="replace"?lFt(mr,t,r.isInline):(u==null?void 0:u.content)??t,d=e==="append"?{from:s,to:s}:{from:i,to:s};return mr.chain().focus().insertContentAt(d,h).run(),pC=null,ed(mr),!0}catch{return!1}},undo(){if(!mr.can().undo())return!1;const t=mr.commands.undo();return t&&ed(mr),t},focusEnd(){var t;try{mr.commands.focus("end")}catch{}try{const e=(t=mr.view)==null?void 0:t.dom;e&&typeof e.focus=="function"&&e.focus({preventScroll:!0})}catch{}},flush(){ed(mr)},exec(t){var r;const e={bold:()=>mr.chain().focus().toggleBold().run(),bulletList:()=>mr.chain().focus().toggleBulletList().run(),taskList:()=>mr.chain().focus().toggleTaskList().run(),blockquote:()=>mr.chain().focus().toggleBlockquote().run(),horizontalRule:()=>mr.chain().focus().setHorizontalRule().run(),heading2:()=>mr.chain().focus().toggleHeading({level:2}).run(),codeBlock:()=>mr.chain().focus().toggleCodeBlock().run()};(r=e[t])==null||r.call(e),ed(mr)},beginImageUpload(t,e){mr.chain().focus().setImage({src:e,alt:t,width:Vue}).run();const r=zo.querySelectorAll("img"),n=r[r.length-1];n&&(n.dataset.uploadId=t),ed(mr)},completeImageUpload(t,e,r){mr.isEditable&&(mr.view.dispatch(VBt(mr.state,{src:e,alt:r||t||"",width:Vue})),ed(mr))},groupImages(t){const e=HBt(mr,t);return e&&ed(mr),e},cancelImageUpload(t){const e=zo.querySelector(`img[data-upload-id="${t}"]`);e==null||e.remove(),ed(mr)},search(t,e){const r=cFt(mr,t),n=r.length>0?Math.min(Math.max(Number.isFinite(e)?e:0,0),r.length-1):0,i=r[n];if(i){mr.commands.setTextSelection({from:i.from,to:i.to});try{const s=mr.view.domAtPos(i.from).node,a=s instanceof Element?s:s.parentElement;a==null||a.scrollIntoView({block:"center",behavior:"smooth"})}catch{}}Ua({type:"searchResult",count:r.length,index:n})}};window.EdgeEverEditor=hFt;vMe(!1);Ua({type:"ready",startupMs:Math.round(performance.now()-XBt)});class Gt extends Error{constructor(e,r){var n="KaTeX parse error: "+e,i,s,a=r&&r.loc;if(a&&a.start<=a.end){var o=a.lexer.input;i=a.start,s=a.end,i===o.length?n+=" at end of input: ":n+=" at position "+(i+1)+": ";var l=o.slice(i,s).replace(/[^]/g,"$&̲"),u;i>15?u="…"+o.slice(i-15,i):u=o.slice(0,i);var h;s+15<o.length?h=o.slice(s,s+15)+"…":h=o.slice(s),n+=u+l+h}super(n),this.name="ParseError",this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,Gt.prototype),this.position=i,i!=null&&s!=null&&(this.length=s-i),this.rawMessage=e}}var dFt=/([A-Z])/g,fFt=t=>t.replace(dFt,"-$1").toLowerCase(),pFt={"&":"&",">":">","<":"<",'"':""","'":"'"},gFt=/[&><"']/g,Go=t=>String(t).replace(gFt,e=>pFt[e]),JM=t=>t.type==="ordgroup"||t.type==="color"?t.body.length===1?JM(t.body[0]):t:t.type==="font"?JM(t.body):t,mFt=new Set(["mathord","textord","atom"]),U0=t=>mFt.has(JM(t).type),yFt=t=>{var e=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(t);return e?e[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e[1])?null:e[1].toLowerCase():"_relative"},xL={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 vFt(t){if(typeof t!="string")return t.enum[0];switch(t){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}function bFt(t){if(t.default!==void 0)return t.default;var e=Array.isArray(t.type)?t.type[0]:t.type;return vFt(e)}function xFt(t,e,r,n){var i=r[e];t[e]=i!==void 0?n.processor?n.processor(i):i:bFt(n)}class oJ{constructor(e){e===void 0&&(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 of Object.keys(xL)){var n=xL[r];n&&xFt(this,r,e,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 Gt("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("url"in e&&e.url&&!e.protocol){var r=yFt(e.url);if(r==null)return!1;e.protocol=r}var n=typeof this.trust=="function"?this.trust(e):this.trust;return!!n}}class gp{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 ud[wFt[this.id]]}sub(){return ud[TFt[this.id]]}fracNum(){return ud[CFt[this.id]]}fracDen(){return ud[kFt[this.id]]}cramp(){return ud[SFt[this.id]]}text(){return ud[EFt[this.id]]}isTight(){return this.size>=2}}var lJ=0,wL=1,Ob=2,o0=3,zE=4,xu=5,x5=6,kl=7,ud=[new gp(lJ,0,!1),new gp(wL,0,!0),new gp(Ob,1,!1),new gp(o0,1,!0),new gp(zE,2,!1),new gp(xu,2,!0),new gp(x5,3,!1),new gp(kl,3,!0)],wFt=[zE,xu,zE,xu,x5,kl,x5,kl],TFt=[xu,xu,xu,xu,kl,kl,kl,kl],CFt=[Ob,o0,zE,xu,x5,kl,x5,kl],kFt=[o0,o0,xu,xu,kl,kl,kl,kl],SFt=[wL,wL,o0,o0,xu,xu,kl,kl],EFt=[lJ,wL,Ob,o0,Ob,o0,Ob,o0],dn={DISPLAY:ud[lJ],TEXT:ud[Ob],SCRIPT:ud[zE],SCRIPTSCRIPT:ud[x5]},FW=[{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 AFt(t){for(var e=0;e<FW.length;e++)for(var r=FW[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 eR=[];FW.forEach(t=>t.blocks.forEach(e=>eR.push(...e)));function bMe(t){for(var e=0;e<eR.length;e+=2)if(t>=eR[e]&&t<=eR[e+1])return!0;return!1}var ba=t=>t+" "+t,jv=80,MFt=function(e,r){return"M95,"+(622+e+r)+`+`)}:null},lFt=(t,e,r)=>{var f,p,g;const n=(f=t.storage.markdown)==null?void 0:f.manager,i=e.trim(),s=((p=n==null?void 0:n.parse)==null?void 0:p.call(n,i).content)??[{type:"text",text:i}];if(!r)return s;const a=i.replace(/\s*\n+\s*/g," "),o=(g=n==null?void 0:n.parse)==null?void 0:g.call(n,`${WB}${a}`).content,l=(o==null?void 0:o.length)===1?o[0]:null,u=(l==null?void 0:l.type)==="paragraph"?l.content??[]:[],h=u[0];if((h==null?void 0:h.type)!=="text"||typeof h.text!="string"||!h.text.startsWith(WB))return[{type:"text",text:a}];const d=h.text.slice(WB.length);return[...d?[{...h,text:d}]:[],...u.slice(1)]};function ed(t){try{const e=JSON.stringify(vQ(t.getJSON())),r=yMe(t);Ua({type:"change",contentMarkdown:r,contentJson:e})}catch(e){Ua({type:"error",message:e instanceof Error?e.message:String(e)})}}function cFt(t,e){const r=e.trim().toLocaleLowerCase();if(r.length===0)return[];const n=[];let i=null;t.state.doc.descendants((l,u)=>{if(!(!l.isText||!l.text)){i!==null&&u>i&&n.push({char:"\0",pos:-1});for(let h=0;h<l.text.length;h+=1)n.push({char:l.text[h]??"",pos:u+h});i=u+l.text.length}});const s=n.map(l=>l.char).join("").toLocaleLowerCase(),a=[];let o=s.indexOf(r);for(;o!==-1;){const l=n[o],u=n[o+r.length-1];l&&u&&l.pos>=0&&u.pos>=0&&a.push({from:l.pos,to:u.pos+1}),o=s.indexOf(r,o+r.length)}return a}const Rde=()=>mr.isActive("taskItem")?"taskItem":"listItem";function vMe(t){var r;if(QM.classList.toggle("editor-mode",t),QM.innerHTML="",!t)return;const e=[{id:"undo",label:"↩",run:()=>mr.chain().focus().undo().run()},{id:"redo",label:"↪",run:()=>mr.chain().focus().redo().run()},{id:"image",label:"▧+",run:()=>Ua({type:"pickImage"})},{id:"bold",label:"B",run:()=>mr.chain().focus().toggleBold().run()},{id:"bullet",label:"•",run:()=>mr.chain().focus().toggleBulletList().run()},{id:"task",label:"☑",run:()=>mr.chain().focus().toggleTaskList().run()},{id:"indent",label:"⇥",run:()=>mr.chain().focus().sinkListItem(Rde()).run()},{id:"outdent",label:"⇤",run:()=>mr.chain().focus().liftListItem(Rde()).run()},{id:"quote",label:"❝",run:()=>mr.chain().focus().toggleBlockquote().run()},{id:"hr",label:"—",run:()=>mr.chain().focus().setHorizontalRule().run()}];for(const n of e){const i=document.createElement("button");i.type="button",i.textContent=n.label,i.dataset.action=n.id;const s={undo:{"zh-CN":"撤销","en-US":"Undo",ja:"元に戻す",pl:"Cofnij"},redo:{"zh-CN":"重做","en-US":"Redo",ja:"やり直す",pl:"Ponów"},image:{"zh-CN":"插入图片","en-US":"Insert image",ja:"画像を挿入",pl:"Wstaw obraz"},bold:{"zh-CN":"粗体","en-US":"Bold",ja:"太字",pl:"Pogrubienie"},bullet:{"zh-CN":"项目符号列表","en-US":"Bullet list",ja:"箇条書き",pl:"Lista punktowana"},task:{"zh-CN":"任务清单","en-US":"Task list",ja:"タスクリスト",pl:"Lista zadań"},indent:{"zh-CN":"增加列表缩进","en-US":"Increase list indent",ja:"リストのインデントを増やす",pl:"Zwiększ wcięcie listy"},outdent:{"zh-CN":"减少列表缩进","en-US":"Decrease list indent",ja:"リストのインデントを減らす",pl:"Zmniejsz wcięcie listy"},quote:{"zh-CN":"引用","en-US":"Block quote",ja:"引用",pl:"Cytat"},hr:{"zh-CN":"分隔线","en-US":"Horizontal rule",ja:"区切り線",pl:"Linia pozioma"}};i.setAttribute("aria-label",((r=s[n.id])==null?void 0:r[mL])??n.id),i.addEventListener("click",()=>{n.run(),n.id!=="image"&&ed(mr),b5()}),QM.appendChild(i)}b5()}function b5(){const t={bold:mr.isActive("bold"),bullet:mr.isActive("bulletList"),task:mr.isActive("taskList"),quote:mr.isActive("blockquote")},e=n=>{try{return mr.can().chain().focus()[n]().run()}catch{return!1}},r={undo:e("undo"),redo:e("redo")};QM.querySelectorAll("button[data-action]").forEach(n=>{const i=n.dataset.action??"";n.classList.toggle("is-active",t[i]??!1),i in r&&(n.disabled=!r[i])})}async function qB(t="light"){zo.querySelectorAll("[data-placeholder]").forEach(e=>{e.dataset.placeholder=BW}),fMe(zo),await JBt(zo),ta==="viewer"&&(!bL||!tFt(zo,bL,t))&&(iJ(),await eFt(zo,t))}async function uFt(t){var p;if(!t.requestId||t.format!=="png"&&t.format!=="jpeg")return;const e=vPt(t.background,t.theme),r=t.fontStyle??"serif",n=t.fontSize??"lg",i=t.cardWidth??"standard",s=a8e[i]||680,a=y5[e]||y5.aurora,o=mr.view.dom.cloneNode(!0);o.removeAttribute("contenteditable"),o.querySelectorAll("button, [contenteditable='true']").forEach(g=>{g.removeAttribute("contenteditable"),g instanceof HTMLButtonElement&&g.remove()});const l=o.innerHTML,u=document.createElement("div");u.style.cssText=`position:fixed;left:-100000px;top:0;width:${s}px;pointer-events:none;`;const h=document.createElement("style");h.textContent=wPt({theme:e,fontStyle:r,fontSize:n,cardWidth:i});const d=xPt({title:t.title||t.fallbackTitle,notebook:t.notebook,tags:t.tags,updatedAt:t.updatedAt,bodyHtml:l,theme:e,fontStyle:r,showTitle:t.showTitle??!0,showNotebook:t.showNotebook??!1,showTags:t.showTags??!1,showUpdatedAt:t.showUpdatedAt??!0,showBranding:t.branding??!0});u.appendChild(h),u.insertAdjacentHTML("beforeend",d);const f=u.lastElementChild;f.style.width=`${s}px`,f.style.maxWidth="none",f.style.margin="0",document.body.appendChild(u);try{await((p=document.fonts)==null?void 0:p.ready),await Promise.all(Array.from(f.querySelectorAll("img")).map(async R=>{if(!R.complete)try{await R.decode()}catch{}}));const g=Array.from(f.querySelectorAll(".edgeever-card-body img")),m=g.filter(R=>!R.complete||R.naturalWidth===0).length,y=Math.max(1,Math.ceil(f.getBoundingClientRect().height)),v=yPt[e]||a.canvasBg,x=await D6t(f,{backgroundColor:v,cacheBust:!1,height:y,pixelRatio:2,skipFonts:!0,width:s}),b=await new Promise((R,_)=>{x.toBlob(P=>P?R(P):_(new Error("Image renderer returned an empty file")),t.format==="jpeg"?"image/jpeg":"image/png",t.format==="jpeg"?.92:1)}),T=t.format==="jpeg"?"jpg":"png",C=bPt(t.title,t.fallbackTitle),S=await ZBt(b),k=`${C}.${T}`,E=t.format==="jpeg"?"image/jpeg":"image/png",A=QBt(S);for(let R=0;R<A.length;R+=Ede)Ua({type:"imageExportChunk",requestId:t.requestId,chunk:A.slice(R,R+Ede)}),await new Promise(_=>setTimeout(_,0));Ua({type:"imageExportComplete",requestId:t.requestId,filename:k,mimeType:E,width:x.width,height:x.height,totalImages:g.length,failedImages:m})}catch(g){Ua({type:"imageExportError",requestId:t.requestId,message:g instanceof Error?g.message:"Image export failed"})}finally{u.remove()}}const hFt={exportImage(t){uFt(t)},configure(t){const e=t.mode==="editor"?"editor":"viewer",r=e!==ta;ta=e,mL=t.locale==="en-US"||t.locale==="ja"||t.locale==="pl"?t.locale:"zh-CN",mr.setEditable(ta==="editor"),vMe(ta==="editor"),document.documentElement.dataset.theme=t.theme||"light",document.body.classList.toggle("viewer-mode",ta==="viewer"),document.body.classList.toggle("editor-mode",ta==="editor"),t.placeholder&&(BW=t.placeholder,zo.querySelectorAll("[data-placeholder]").forEach(n=>{n.dataset.placeholder=BW})),ta==="editor"&&r&&requestAnimationFrame(()=>{try{mr.commands.focus("end")}catch{}}),qB(t.theme||"light")},setMarkdown(t){var n;sk=!0;const e=ta==="viewer"?kOt(t):null;bL=e;const r=ta==="viewer"?e?"":SOt(t):t;try{mr.commands.setContent(r||"",{contentType:"markdown"})}catch{try{const i=(n=mr.storage.markdown)==null?void 0:n.manager;if(i)mr.commands.setContent(i.parse(r||""));else throw new Error("no markdown manager")}catch{mr.commands.setContent({type:"doc",content:[{type:"paragraph",content:r?[{type:"text",text:r}]:[]}]})}}mr.setEditable(ta==="editor"),zhe(mr),b5(),sk=!1,qB(document.documentElement.dataset.theme||"light")},setDocumentFromJSON(t){sk=!0,bL=null,iJ();try{const e=JSON.parse(t);mr.commands.setContent(n9t(cDt(e),mL))}catch{mr.commands.setContent({type:"doc",content:[{type:"paragraph"}]})}mr.setEditable(ta==="editor"),zhe(mr),b5(),sk=!1,qB(document.documentElement.dataset.theme||"light")},resolveResource(t,e){const r=yL.get(t);r&&(yL.delete(t),r(e))},getMarkdown(){return yMe(mr)},getDocument(){return JSON.stringify(vQ(mr.getJSON()))},captureSelection(){const t=oFt(mr);return t?(pC={from:t.from,to:t.to,isInline:t.isInline,documentFingerprint:JSON.stringify(mr.getJSON())},JSON.stringify({from:t.from,to:t.to,markdown:t.markdown,text:t.text})):(pC=null,null)},applySelectionDraft(t,e){var a,o;const r=pC;if(!r||!t.trim())return!1;if(JSON.stringify(mr.getJSON())!==r.documentFingerprint)return pC=null,!1;const n=mr.state.doc.content.size,i=Math.min(Math.max(r.from,0),n),s=Math.min(Math.max(r.to,i),n);try{const l=(a=mr.storage.markdown)==null?void 0:a.manager,u=(o=l==null?void 0:l.parse)==null?void 0:o.call(l,t),h=e==="replace"?lFt(mr,t,r.isInline):(u==null?void 0:u.content)??t,d=e==="append"?{from:s,to:s}:{from:i,to:s};return mr.chain().focus().insertContentAt(d,h).run(),pC=null,ed(mr),!0}catch{return!1}},undo(){if(!mr.can().undo())return!1;const t=mr.commands.undo();return t&&ed(mr),t},focusEnd(){var t;try{mr.commands.focus("end")}catch{}try{const e=(t=mr.view)==null?void 0:t.dom;e&&typeof e.focus=="function"&&e.focus({preventScroll:!0})}catch{}},flush(){ed(mr)},exec(t){var r;const e={bold:()=>mr.chain().focus().toggleBold().run(),bulletList:()=>mr.chain().focus().toggleBulletList().run(),taskList:()=>mr.chain().focus().toggleTaskList().run(),blockquote:()=>mr.chain().focus().toggleBlockquote().run(),horizontalRule:()=>mr.chain().focus().setHorizontalRule().run(),heading2:()=>mr.chain().focus().toggleHeading({level:2}).run(),codeBlock:()=>mr.chain().focus().toggleCodeBlock().run()};(r=e[t])==null||r.call(e),ed(mr)},beginImageUpload(t,e){mr.chain().focus().setImage({src:e,alt:t,width:Vue}).run();const r=zo.querySelectorAll("img"),n=r[r.length-1];n&&(n.dataset.uploadId=t),ed(mr)},completeImageUpload(t,e,r){mr.isEditable&&(mr.view.dispatch(VBt(mr.state,{src:e,alt:r||t||"",width:Vue})),ed(mr))},groupImages(t){const e=HBt(mr,t);return e&&ed(mr),e},cancelImageUpload(t){const e=zo.querySelector(`img[data-upload-id="${t}"]`);e==null||e.remove(),ed(mr)},search(t,e){const r=cFt(mr,t),n=r.length>0?Math.min(Math.max(Number.isFinite(e)?e:0,0),r.length-1):0,i=r[n];if(i){mr.commands.setTextSelection({from:i.from,to:i.to});try{const s=mr.view.domAtPos(i.from).node,a=s instanceof Element?s:s.parentElement;a==null||a.scrollIntoView({block:"center",behavior:"smooth"})}catch{}}Ua({type:"searchResult",count:r.length,index:n})}};window.EdgeEverEditor=hFt;vMe(!1);Ua({type:"ready",startupMs:Math.round(performance.now()-XBt)});class Gt extends Error{constructor(e,r){var n="KaTeX parse error: "+e,i,s,a=r&&r.loc;if(a&&a.start<=a.end){var o=a.lexer.input;i=a.start,s=a.end,i===o.length?n+=" at end of input: ":n+=" at position "+(i+1)+": ";var l=o.slice(i,s).replace(/[^]/g,"$&̲"),u;i>15?u="…"+o.slice(i-15,i):u=o.slice(0,i);var h;s+15<o.length?h=o.slice(s,s+15)+"…":h=o.slice(s),n+=u+l+h}super(n),this.name="ParseError",this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,Gt.prototype),this.position=i,i!=null&&s!=null&&(this.length=s-i),this.rawMessage=e}}var dFt=/([A-Z])/g,fFt=t=>t.replace(dFt,"-$1").toLowerCase(),pFt={"&":"&",">":">","<":"<",'"':""","'":"'"},gFt=/[&><"']/g,Go=t=>String(t).replace(gFt,e=>pFt[e]),JM=t=>t.type==="ordgroup"||t.type==="color"?t.body.length===1?JM(t.body[0]):t:t.type==="font"?JM(t.body):t,mFt=new Set(["mathord","textord","atom"]),U0=t=>mFt.has(JM(t).type),yFt=t=>{var e=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(t);return e?e[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e[1])?null:e[1].toLowerCase():"_relative"},xL={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 vFt(t){if(typeof t!="string")return t.enum[0];switch(t){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}function bFt(t){if(t.default!==void 0)return t.default;var e=Array.isArray(t.type)?t.type[0]:t.type;return vFt(e)}function xFt(t,e,r,n){var i=r[e];t[e]=i!==void 0?n.processor?n.processor(i):i:bFt(n)}class oJ{constructor(e){e===void 0&&(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 of Object.keys(xL)){var n=xL[r];n&&xFt(this,r,e,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 Gt("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("url"in e&&e.url&&!e.protocol){var r=yFt(e.url);if(r==null)return!1;e.protocol=r}var n=typeof this.trust=="function"?this.trust(e):this.trust;return!!n}}class gp{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 ud[wFt[this.id]]}sub(){return ud[TFt[this.id]]}fracNum(){return ud[CFt[this.id]]}fracDen(){return ud[kFt[this.id]]}cramp(){return ud[SFt[this.id]]}text(){return ud[EFt[this.id]]}isTight(){return this.size>=2}}var lJ=0,wL=1,Ob=2,o0=3,zE=4,xu=5,x5=6,kl=7,ud=[new gp(lJ,0,!1),new gp(wL,0,!0),new gp(Ob,1,!1),new gp(o0,1,!0),new gp(zE,2,!1),new gp(xu,2,!0),new gp(x5,3,!1),new gp(kl,3,!0)],wFt=[zE,xu,zE,xu,x5,kl,x5,kl],TFt=[xu,xu,xu,xu,kl,kl,kl,kl],CFt=[Ob,o0,zE,xu,x5,kl,x5,kl],kFt=[o0,o0,xu,xu,kl,kl,kl,kl],SFt=[wL,wL,o0,o0,xu,xu,kl,kl],EFt=[lJ,wL,Ob,o0,Ob,o0,Ob,o0],dn={DISPLAY:ud[lJ],TEXT:ud[Ob],SCRIPT:ud[zE],SCRIPTSCRIPT:ud[x5]},FW=[{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 AFt(t){for(var e=0;e<FW.length;e++)for(var r=FW[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 eR=[];FW.forEach(t=>t.blocks.forEach(e=>eR.push(...e)));function bMe(t){for(var e=0;e<eR.length;e+=2)if(t>=eR[e]&&t<=eR[e+1])return!0;return!1}var ba=t=>t+" "+t,jv=80,MFt=function(e,r){return"M95,"+(622+e+r)+`c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54c44.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@@ -2965,10 +2965,10 @@ https://github.com/jquery/jquery/blob/master/src/event.jsvec2 v = ab*vec2(-cs.y,cs.x);w = w + dot(p-u,v)/(dot(p-u,u)+dot(v,v));}-+// compute final point and distancefloat d = length(p-ab*vec2(cos(w),sin(w)));-+// return signed distancereturn (dot(p/ab,p/ab)>1.0) ? d : -d;}@@ -2977,16 +2977,16 @@ https://github.com/jquery/jquery/blob/master/src/event.jsuniform mat3 uPanZoomMatrix;uniform int uAtlasSize;-+// instancedin vec2 aPosition; // a vertex from the unit square-+in mat3 aTransform; // used to transform verticies, eg into a bounding boxin int aVertType; // the type of thing we are rendering// the z-index that is output when using picking modein vec4 aIndex;-+// For texturesin int aAtlasId; // which shader unit/atlas to usein vec4 aTex; // x/y/w/h of texture in atlas@@ -3006,7 +3006,7 @@ https://github.com/jquery/jquery/blob/master/src/event.jsout vec4 vColor;out vec2 vPosition;// flat values are not interpolated- flat out int vAtlasId;+ flat out int vAtlasId;flat out int vVertType;flat out vec2 vTopRight;flat out vec2 vBotLeft;@@ -3014,7 +3014,7 @@ https://github.com/jquery/jquery/blob/master/src/event.jsflat out vec4 vBorderColor;flat out vec2 vBorderWidth;flat out vec4 vIndex;-+void main(void) {int vid = gl_VertexID;vec2 position = aPosition; // TODO make this a vec3, simplifies some code below@@ -3037,7 +3037,7 @@ https://github.com/jquery/jquery/blob/master/src/event.jsgl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);}- else if(aVertType == `).concat(t2," || aVertType == ").concat(wC,`+ else if(aVertType == `).concat(t2," || aVertType == ").concat(wC,`|| aVertType == `).concat(q8," || aVertType == ").concat(xC,`) { // simple shapes// the bounding box is needed by the fragment shader@@ -3067,7 +3067,7 @@ https://github.com/jquery/jquery/blob/master/src/event.jsgl_Position = vec4(uPanZoomMatrix * vec3(point, 1.0), 1.0);vColor = aColor;- }+ }else if(aVertType == `).concat(age,`) {vec2 pointA = aPointAPointB.xy;vec2 pointB = aPointAPointB.zw;@@ -3116,7 +3116,7 @@ https://github.com/jquery/jquery/blob/master/src/event.js}vColor = aColor;- }+ }else if(aVertType == `).concat(Wz,` && vid < 3) {// massage the first triangle into an edge arrowif(vid == 0)@@ -3168,16 +3168,16 @@ https://github.com/jquery/jquery/blob/master/src/event.js`).concat(IXt,`vec4 blend(vec4 top, vec4 bot) { // blend colors with premultiplied alpha- return vec4(+ return vec4(top.rgb + (bot.rgb * (1.0 - top.a)),- top.a + (bot.a * (1.0 - top.a))+ top.a + (bot.a * (1.0 - top.a)));}vec4 distInterp(vec4 cA, vec4 cB, float d) { // interpolate color using Signed Distance// scale to the zoom level so that borders don't look blurry when zoomed in// note 1.5 is an aribitrary value chosen because it looks good- return mix(cA, cB, 1.0 - smoothstep(0.0, 1.5 / uZoom, abs(d)));+ return mix(cA, cB, 1.0 - smoothstep(0.0, 1.5 / uZoom, abs(d)));}void main(void) {@@ -3185,7 +3185,7 @@ https://github.com/jquery/jquery/blob/master/src/event.js// look up the texel from the texture unit`).concat(s.map(function(u){return"if(vAtlasId == ".concat(u,") outColor = texture(uTexture").concat(u,", vTexCoord);")}).join(`else `),`- }+ }else if(vVertType == `).concat(Wz,`) {// mimics how canvas renderer uses context.globalCompositeOperation = 'destination-out';outColor = blend(vColor, uBGColor);@@ -3194,7 +3194,7 @@ https://github.com/jquery/jquery/blob/master/src/event.jselse if(vVertType == `).concat(t2,` && vBorderWidth == vec2(0.0)) { // simple rectangle with no borderoutColor = vColor; // unit square is already transformed to the rectangle, nothing else needs to be done}- else if(vVertType == `).concat(t2," || vVertType == ").concat(wC,`+ else if(vVertType == `).concat(t2," || vVertType == ").concat(wC,`|| vVertType == `).concat(q8," || vVertType == ").concat(xC,`) { // use SDFfloat outerBorder = vBorderWidth[0];@@ -3229,7 +3229,7 @@ https://github.com/jquery/jquery/blob/master/src/event.jsvec4 outerColor = outerBorder == 0.0 ? vec4(0) : vBorderColor;vec4 innerBorderColor = blend(vBorderColor, vColor);outColor = distInterp(innerBorderColor, outerColor, d);- }+ }else {vec4 outerColor;if(innerBorder == 0.0 && outerBorder == 0.0) {@@ -3267,7 +3267,7 @@ Expecting `+It.join(", ")+", got '"+(this.terminals_[st]||st)+"'":ft="Parse errooverflow: visible;vertical-align: -0.125em;}-+.node .label-icon path {fill: currentColor;stroke: revert;@@ -3527,7 +3527,7 @@ Expecting `+st.join(", ")+", got '"+(this.terminals_[Ae]||Ae)+"'":Oe="Parse erro${JSON.stringify(Object.fromEntries(g))}`));return}const y=parseInt(m);if(isNaN(y)){this.fireError(new Error(`Content-Length value must be a number. Got ${m}`));return}this.nextMessageLength=y}const p=this.buffer.tryReadBody(this.nextMessageLength);if(p===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{const g=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(p):p,m=await this.options.contentTypeDecoder.decode(g,this.options);this.callback(m)}).catch(g=>{this.fireError(g)})}}catch(p){this.fireError(p)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,e.default)().timer.setTimeout((f,p)=>{this.partialMessageTimer=void 0,f===this.messageToken&&(this.firePartialMessage({messageToken:f,waitingTime:p}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}},M(h,"ReadableStreamMessageReader"),h);t.ReadableStreamMessageReader=l}}),OZt=pn({"../../node_modules/.pnpm/[email protected]/node_modules/vscode-jsonrpc/lib/common/messageWriter.js"(t){var d,f;Object.defineProperty(t,"__esModule",{value:!0}),t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=void 0;var e=lv(),r=DA(),n=WIe(),i=_3(),s="Content-Length: ",a=`\r`,o;(function(p){function g(m){let y=m;return y&&r.func(y.dispose)&&r.func(y.onClose)&&r.func(y.onError)&&r.func(y.write)}M(g,"is"),p.is=g})(o||(t.MessageWriter=o={}));var l=(d=class{constructor(){this.errorEmitter=new i.Emitter,this.closeEmitter=new i.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(g,m,y){this.errorEmitter.fire([this.asError(g),m,y])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(g){return g instanceof Error?g:new Error(`Writer received error. Reason: ${r.string(g.message)?g.message:"unknown"}`)}},M(d,"AbstractMessageWriter"),d);t.AbstractMessageWriter=l;var u;(function(p){function g(m){return m===void 0||typeof m=="string"?{charset:m??"utf-8",contentTypeEncoder:(0,e.default)().applicationJson.encoder}:{charset:m.charset??"utf-8",contentEncoder:m.contentEncoder,contentTypeEncoder:m.contentTypeEncoder??(0,e.default)().applicationJson.encoder}}M(g,"fromOptions"),p.fromOptions=g})(u||(u={}));var h=(f=class extends l{constructor(g,m){super(),this.writable=g,this.options=u.fromOptions(m),this.errorCount=0,this.writeSemaphore=new n.Semaphore(1),this.writable.onError(y=>this.fireError(y)),this.writable.onClose(()=>this.fireClose())}async write(g){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(g,this.options).then(y=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(y):y).then(y=>{const v=[];return v.push(s,y.byteLength.toString(),a),v.push(a),this.doWrite(g,v,y)},y=>{throw this.fireError(y),y}))}async doWrite(g,m,y){try{return await this.writable.write(m.join(""),"ascii"),this.writable.write(y)}catch(v){return this.handleError(v,g),Promise.reject(v)}}handleError(g,m){this.errorCount++,this.fireError(g,m,this.errorCount)}end(){this.writable.end()}},M(f,"WriteableStreamMessageWriter"),f);t.WriteableStreamMessageWriter=h}}),PZt=pn({"../../node_modules/.pnpm/[email protected]/node_modules/vscode-jsonrpc/lib/common/messageBuffer.js"(t){var s;Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractMessageBuffer=void 0;var e=13,r=10,n=`\r`,i=(s=class{constructor(o="utf-8"){this._encoding=o,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(o){const l=typeof o=="string"?this.fromString(o,this._encoding):o;this._chunks.push(l),this._totalLength+=l.byteLength}tryReadHeaders(o=!1){if(this._chunks.length===0)return;let l=0,u=0,h=0,d=0;e:for(;u<this._chunks.length;){const m=this._chunks[u];for(h=0;h<m.length;){switch(m[h]){case e:switch(l){case 0:l=1;break;case 2:l=3;break;default:l=0}break;case r:switch(l){case 1:l=2;break;case 3:l=4,h++;break e;default:l=0}break;default:l=0}h++}d+=m.byteLength,u++}if(l!==4)return;const f=this._read(d+h),p=new Map,g=this.toString(f,"ascii").split(n);if(g.length<2)return p;for(let m=0;m<g.length-2;m++){const y=g[m],v=y.indexOf(":");if(v===-1)throw new Error(`Message header must separate key and value using ':'-${y}`);const x=y.substr(0,v),b=y.substr(v+1).trim();p.set(o?x.toLowerCase():x,b)}return p}tryReadBody(o){if(!(this._totalLength<o))return this._read(o)}get numberOfBytes(){return this._totalLength}_read(o){if(o===0)return this.emptyBuffer();if(o>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===o){const d=this._chunks[0];return this._chunks.shift(),this._totalLength-=o,this.asNative(d)}if(this._chunks[0].byteLength>o){const d=this._chunks[0],f=this.asNative(d,o);return this._chunks[0]=d.slice(o),this._totalLength-=o,f}const l=this.allocNative(o);let u=0,h=0;for(;o>0;){const d=this._chunks[h];if(d.byteLength>o){const f=d.slice(0,o);l.set(f,u),u+=o,this._chunks[h]=d.slice(o),this._totalLength-=o,o-=o}else l.set(d,u),u+=d.byteLength,this._chunks.shift(),this._totalLength-=d.byteLength,o-=d.byteLength}return l}},M(s,"AbstractMessageBuffer"),s);t.AbstractMessageBuffer=i}}),$Zt=pn({"../../node_modules/.pnpm/[email protected]/node_modules/vscode-jsonrpc/lib/common/connection.js"(t){var N,L;Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.ConnectionOptions=t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.RequestCancellationReceiverStrategy=t.IdCancellationReceiverStrategy=t.ConnectionStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=t.NullLogger=t.ProgressType=t.ProgressToken=void 0;var e=lv(),r=DA(),n=HIe(),i=GIe(),s=_3(),a=kO(),o;(function(I){I.type=new n.NotificationType("$/cancelRequest")})(o||(o={}));var l;(function(I){function $(O){return typeof O=="string"||typeof O=="number"}M($,"is"),I.is=$})(l||(t.ProgressToken=l={}));var u;(function(I){I.type=new n.NotificationType("$/progress")})(u||(u={}));var h=(N=class{constructor(){}},M(N,"ProgressType"),N);t.ProgressType=h;var d;(function(I){function $(O){return r.func(O)}M($,"is"),I.is=$})(d||(d={})),t.NullLogger=Object.freeze({error:M(()=>{},"error"),warn:M(()=>{},"warn"),info:M(()=>{},"info"),log:M(()=>{},"log")});var f;(function(I){I[I.Off=0]="Off",I[I.Messages=1]="Messages",I[I.Compact=2]="Compact",I[I.Verbose=3]="Verbose"})(f||(t.Trace=f={}));var p;(function(I){I.Off="off",I.Messages="messages",I.Compact="compact",I.Verbose="verbose"})(p||(t.TraceValues=p={})),(function(I){function $(D){if(!r.string(D))return I.Off;switch(D=D.toLowerCase(),D){case"off":return I.Off;case"messages":return I.Messages;case"compact":return I.Compact;case"verbose":return I.Verbose;default:return I.Off}}M($,"fromString"),I.fromString=$;function O(D){switch(D){case I.Off:return"off";case I.Messages:return"messages";case I.Compact:return"compact";case I.Verbose:return"verbose";default:return"off"}}M(O,"toString"),I.toString=O})(f||(t.Trace=f={}));var g;(function(I){I.Text="text",I.JSON="json"})(g||(t.TraceFormat=g={})),(function(I){function $(O){return r.string(O)?(O=O.toLowerCase(),O==="json"?I.JSON:I.Text):I.Text}M($,"fromString"),I.fromString=$})(g||(t.TraceFormat=g={}));var m;(function(I){I.type=new n.NotificationType("$/setTrace")})(m||(t.SetTraceNotification=m={}));var y;(function(I){I.type=new n.NotificationType("$/logTrace")})(y||(t.LogTraceNotification=y={}));var v;(function(I){I[I.Closed=1]="Closed",I[I.Disposed=2]="Disposed",I[I.AlreadyListening=3]="AlreadyListening"})(v||(t.ConnectionErrors=v={}));var x=(L=class extends Error{constructor($,O){super(O),this.code=$,Object.setPrototypeOf(this,L.prototype)}},M(L,"ConnectionError"),L);t.ConnectionError=x;var b;(function(I){function $(O){const D=O;return D&&r.func(D.cancelUndispatched)}M($,"is"),I.is=$})(b||(t.ConnectionStrategy=b={}));var T;(function(I){function $(O){const D=O;return D&&(D.kind===void 0||D.kind==="id")&&r.func(D.createCancellationTokenSource)&&(D.dispose===void 0||r.func(D.dispose))}M($,"is"),I.is=$})(T||(t.IdCancellationReceiverStrategy=T={}));var C;(function(I){function $(O){const D=O;return D&&D.kind==="request"&&r.func(D.createCancellationTokenSource)&&(D.dispose===void 0||r.func(D.dispose))}M($,"is"),I.is=$})(C||(t.RequestCancellationReceiverStrategy=C={}));var S;(function(I){I.Message=Object.freeze({createCancellationTokenSource(O){return new a.CancellationTokenSource}});function $(O){return T.is(O)||C.is(O)}M($,"is"),I.is=$})(S||(t.CancellationReceiverStrategy=S={}));var k;(function(I){I.Message=Object.freeze({sendCancellation(O,D){return O.sendNotification(o.type,{id:D})},cleanup(O){}});function $(O){const D=O;return D&&r.func(D.sendCancellation)&&r.func(D.cleanup)}M($,"is"),I.is=$})(k||(t.CancellationSenderStrategy=k={}));var E;(function(I){I.Message=Object.freeze({receiver:S.Message,sender:k.Message});function $(O){const D=O;return D&&S.is(D.receiver)&&k.is(D.sender)}M($,"is"),I.is=$})(E||(t.CancellationStrategy=E={}));var A;(function(I){function $(O){const D=O;return D&&r.func(D.handleMessage)}M($,"is"),I.is=$})(A||(t.MessageStrategy=A={}));var R;(function(I){function $(O){const D=O;return D&&(E.is(D.cancellationStrategy)||b.is(D.connectionStrategy)||A.is(D.messageStrategy))}M($,"is"),I.is=$})(R||(t.ConnectionOptions=R={}));var _;(function(I){I[I.New=1]="New",I[I.Listening=2]="Listening",I[I.Closed=3]="Closed",I[I.Disposed=4]="Disposed"})(_||(_={}));function P(I,$,O,D){const F=O!==void 0?O:t.NullLogger;let z=0,V=0,B=0;const H="2.0";let G;const W=new Map;let K;const q=new Map,oe=new Map;let Q,Z=new i.LinkedMap,re=new Map,ie=new Set,me=new Map,te=f.Off,_e=g.Text,$e,Fe=_.New;const ce=new s.Emitter,he=new s.Emitter,Te=new s.Emitter,ge=new s.Emitter,He=new s.Emitter,we=D&&D.cancellationStrategy?D.cancellationStrategy:E.Message;function Me(Ee){if(Ee===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+Ee.toString()}M(Me,"createRequestQueueKey");function Ye(Ee){return Ee===null?"res-unknown-"+(++B).toString():"res-"+Ee.toString()}M(Ye,"createResponseQueueKey");function le(){return"not-"+(++V).toString()}M(le,"createNotificationQueueKey");function pe(Ee,it){n.Message.isRequest(it)?Ee.set(Me(it.id),it):n.Message.isResponse(it)?Ee.set(Ye(it.id),it):Ee.set(le(),it)}M(pe,"addMessageToQueue");function Ce(Ee){}M(Ce,"cancelUndispatched");function ne(){return Fe===_.Listening}M(ne,"isListening");function Y(){return Fe===_.Closed}M(Y,"isClosed");function J(){return Fe===_.Disposed}M(J,"isDisposed");function ue(){(Fe===_.New||Fe===_.Listening)&&(Fe=_.Closed,he.fire(void 0))}M(ue,"closeHandler");function X(Ee){ce.fire([Ee,void 0,void 0])}M(X,"readErrorHandler");function fe(Ee){ce.fire(Ee)}M(fe,"writeErrorHandler"),I.onClose(ue),I.onError(X),$.onClose(ue),$.onError(fe);function ee(){Q||Z.size===0||(Q=(0,e.default)().timer.setImmediate(()=>{Q=void 0,Re()}))}M(ee,"triggerMessageQueue");function Ae(Ee){n.Message.isRequest(Ee)?Ne(Ee):n.Message.isNotification(Ee)?De(Ee):n.Message.isResponse(Ee)?qe(Ee):Ke(Ee)}M(Ae,"handleMessage");function Re(){if(Z.size===0)return;const Ee=Z.shift();try{const it=D==null?void 0:D.messageStrategy;A.is(it)?it.handleMessage(Ee,Ae):Ae(Ee)}finally{ee()}}M(Re,"processMessageQueue");const Xe=M(Ee=>{try{if(n.Message.isNotification(Ee)&&Ee.method===o.type.method){const it=Ee.params.id,gt=Me(it),xt=Z.get(gt);if(n.Message.isRequest(xt)){const $r=D==null?void 0:D.connectionStrategy,kr=$r&&$r.cancelUndispatched?$r.cancelUndispatched(xt,Ce):void 0;if(kr&&(kr.error!==void 0||kr.result!==void 0)){Z.delete(gt),me.delete(it),kr.id=xt.id,mt(kr,Ee.method,Date.now()),$.write(kr).catch(()=>F.error("Sending response for canceled message failed."));return}}const nr=me.get(it);if(nr!==void 0){nr.cancel(),St(Ee);return}else ie.add(it)}pe(Z,Ee)}finally{ee()}},"callback");function Ne(Ee){if(J())return;function it(Er,nn,Cr){const jr={jsonrpc:H,id:Ee.id};Er instanceof n.ResponseError?jr.error=Er.toJson():jr.result=Er===void 0?null:Er,mt(jr,nn,Cr),$.write(jr).catch(()=>F.error("Sending response failed."))}M(it,"reply");function gt(Er,nn,Cr){const jr={jsonrpc:H,id:Ee.id,error:Er.toJson()};mt(jr,nn,Cr),$.write(jr).catch(()=>F.error("Sending response failed."))}M(gt,"replyError");function xt(Er,nn,Cr){Er===void 0&&(Er=null);const jr={jsonrpc:H,id:Ee.id,result:Er};mt(jr,nn,Cr),$.write(jr).catch(()=>F.error("Sending response failed."))}M(xt,"replySuccess"),Le(Ee);const nr=W.get(Ee.method);let $r,kr;nr&&($r=nr.type,kr=nr.handler);const Ur=Date.now();if(kr||G){const Er=Ee.id??String(Date.now()),nn=T.is(we.receiver)?we.receiver.createCancellationTokenSource(Er):we.receiver.createCancellationTokenSource(Ee);Ee.id!==null&&ie.has(Ee.id)&&nn.cancel(),Ee.id!==null&&me.set(Er,nn);try{let Cr;if(kr)if(Ee.params===void 0){if($r!==void 0&&$r.numberOfParams!==0){gt(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${Ee.method} defines ${$r.numberOfParams} params but received none.`),Ee.method,Ur);return}Cr=kr(nn.token)}else if(Array.isArray(Ee.params)){if($r!==void 0&&$r.parameterStructures===n.ParameterStructures.byName){gt(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${Ee.method} defines parameters by name but received parameters by position`),Ee.method,Ur);return}Cr=kr(...Ee.params,nn.token)}else{if($r!==void 0&&$r.parameterStructures===n.ParameterStructures.byPosition){gt(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${Ee.method} defines parameters by position but received parameters by name`),Ee.method,Ur);return}Cr=kr(Ee.params,nn.token)}else G&&(Cr=G(Ee.method,Ee.params,nn.token));const jr=Cr;Cr?jr.then?jr.then(wn=>{me.delete(Er),it(wn,Ee.method,Ur)},wn=>{me.delete(Er),wn instanceof n.ResponseError?gt(wn,Ee.method,Ur):wn&&r.string(wn.message)?gt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Ee.method} failed with message: ${wn.message}`),Ee.method,Ur):gt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Ee.method} failed unexpectedly without providing any details.`),Ee.method,Ur)}):(me.delete(Er),it(Cr,Ee.method,Ur)):(me.delete(Er),xt(Cr,Ee.method,Ur))}catch(Cr){me.delete(Er),Cr instanceof n.ResponseError?it(Cr,Ee.method,Ur):Cr&&r.string(Cr.message)?gt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Ee.method} failed with message: ${Cr.message}`),Ee.method,Ur):gt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Ee.method} failed unexpectedly without providing any details.`),Ee.method,Ur)}}else gt(new n.ResponseError(n.ErrorCodes.MethodNotFound,`Unhandled method ${Ee.method}`),Ee.method,Ur)}M(Ne,"handleRequest");function qe(Ee){if(!J())if(Ee.id===null)Ee.error?F.error(`Received response message without id: Error is:+${y}`);const x=y.substr(0,v),b=y.substr(v+1).trim();p.set(o?x.toLowerCase():x,b)}return p}tryReadBody(o){if(!(this._totalLength<o))return this._read(o)}get numberOfBytes(){return this._totalLength}_read(o){if(o===0)return this.emptyBuffer();if(o>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===o){const d=this._chunks[0];return this._chunks.shift(),this._totalLength-=o,this.asNative(d)}if(this._chunks[0].byteLength>o){const d=this._chunks[0],f=this.asNative(d,o);return this._chunks[0]=d.slice(o),this._totalLength-=o,f}const l=this.allocNative(o);let u=0,h=0;for(;o>0;){const d=this._chunks[h];if(d.byteLength>o){const f=d.slice(0,o);l.set(f,u),u+=o,this._chunks[h]=d.slice(o),this._totalLength-=o,o-=o}else l.set(d,u),u+=d.byteLength,this._chunks.shift(),this._totalLength-=d.byteLength,o-=d.byteLength}return l}},M(s,"AbstractMessageBuffer"),s);t.AbstractMessageBuffer=i}}),$Zt=pn({"../../node_modules/.pnpm/[email protected]/node_modules/vscode-jsonrpc/lib/common/connection.js"(t){var N,L;Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.ConnectionOptions=t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.RequestCancellationReceiverStrategy=t.IdCancellationReceiverStrategy=t.ConnectionStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=t.NullLogger=t.ProgressType=t.ProgressToken=void 0;var e=lv(),r=DA(),n=HIe(),i=GIe(),s=_3(),a=kO(),o;(function(I){I.type=new n.NotificationType("$/cancelRequest")})(o||(o={}));var l;(function(I){function $(O){return typeof O=="string"||typeof O=="number"}M($,"is"),I.is=$})(l||(t.ProgressToken=l={}));var u;(function(I){I.type=new n.NotificationType("$/progress")})(u||(u={}));var h=(N=class{constructor(){}},M(N,"ProgressType"),N);t.ProgressType=h;var d;(function(I){function $(O){return r.func(O)}M($,"is"),I.is=$})(d||(d={})),t.NullLogger=Object.freeze({error:M(()=>{},"error"),warn:M(()=>{},"warn"),info:M(()=>{},"info"),log:M(()=>{},"log")});var f;(function(I){I[I.Off=0]="Off",I[I.Messages=1]="Messages",I[I.Compact=2]="Compact",I[I.Verbose=3]="Verbose"})(f||(t.Trace=f={}));var p;(function(I){I.Off="off",I.Messages="messages",I.Compact="compact",I.Verbose="verbose"})(p||(t.TraceValues=p={})),(function(I){function $(D){if(!r.string(D))return I.Off;switch(D=D.toLowerCase(),D){case"off":return I.Off;case"messages":return I.Messages;case"compact":return I.Compact;case"verbose":return I.Verbose;default:return I.Off}}M($,"fromString"),I.fromString=$;function O(D){switch(D){case I.Off:return"off";case I.Messages:return"messages";case I.Compact:return"compact";case I.Verbose:return"verbose";default:return"off"}}M(O,"toString"),I.toString=O})(f||(t.Trace=f={}));var g;(function(I){I.Text="text",I.JSON="json"})(g||(t.TraceFormat=g={})),(function(I){function $(O){return r.string(O)?(O=O.toLowerCase(),O==="json"?I.JSON:I.Text):I.Text}M($,"fromString"),I.fromString=$})(g||(t.TraceFormat=g={}));var m;(function(I){I.type=new n.NotificationType("$/setTrace")})(m||(t.SetTraceNotification=m={}));var y;(function(I){I.type=new n.NotificationType("$/logTrace")})(y||(t.LogTraceNotification=y={}));var v;(function(I){I[I.Closed=1]="Closed",I[I.Disposed=2]="Disposed",I[I.AlreadyListening=3]="AlreadyListening"})(v||(t.ConnectionErrors=v={}));var x=(L=class extends Error{constructor($,O){super(O),this.code=$,Object.setPrototypeOf(this,L.prototype)}},M(L,"ConnectionError"),L);t.ConnectionError=x;var b;(function(I){function $(O){const D=O;return D&&r.func(D.cancelUndispatched)}M($,"is"),I.is=$})(b||(t.ConnectionStrategy=b={}));var T;(function(I){function $(O){const D=O;return D&&(D.kind===void 0||D.kind==="id")&&r.func(D.createCancellationTokenSource)&&(D.dispose===void 0||r.func(D.dispose))}M($,"is"),I.is=$})(T||(t.IdCancellationReceiverStrategy=T={}));var C;(function(I){function $(O){const D=O;return D&&D.kind==="request"&&r.func(D.createCancellationTokenSource)&&(D.dispose===void 0||r.func(D.dispose))}M($,"is"),I.is=$})(C||(t.RequestCancellationReceiverStrategy=C={}));var S;(function(I){I.Message=Object.freeze({createCancellationTokenSource(O){return new a.CancellationTokenSource}});function $(O){return T.is(O)||C.is(O)}M($,"is"),I.is=$})(S||(t.CancellationReceiverStrategy=S={}));var k;(function(I){I.Message=Object.freeze({sendCancellation(O,D){return O.sendNotification(o.type,{id:D})},cleanup(O){}});function $(O){const D=O;return D&&r.func(D.sendCancellation)&&r.func(D.cleanup)}M($,"is"),I.is=$})(k||(t.CancellationSenderStrategy=k={}));var E;(function(I){I.Message=Object.freeze({receiver:S.Message,sender:k.Message});function $(O){const D=O;return D&&S.is(D.receiver)&&k.is(D.sender)}M($,"is"),I.is=$})(E||(t.CancellationStrategy=E={}));var A;(function(I){function $(O){const D=O;return D&&r.func(D.handleMessage)}M($,"is"),I.is=$})(A||(t.MessageStrategy=A={}));var R;(function(I){function $(O){const D=O;return D&&(E.is(D.cancellationStrategy)||b.is(D.connectionStrategy)||A.is(D.messageStrategy))}M($,"is"),I.is=$})(R||(t.ConnectionOptions=R={}));var _;(function(I){I[I.New=1]="New",I[I.Listening=2]="Listening",I[I.Closed=3]="Closed",I[I.Disposed=4]="Disposed"})(_||(_={}));function P(I,$,O,D){const F=O!==void 0?O:t.NullLogger;let z=0,V=0,B=0;const H="2.0";let G;const W=new Map;let K;const q=new Map,oe=new Map;let Q,Z=new i.LinkedMap,re=new Map,ie=new Set,me=new Map,te=f.Off,_e=g.Text,$e,Fe=_.New;const ce=new s.Emitter,he=new s.Emitter,Te=new s.Emitter,ge=new s.Emitter,He=new s.Emitter,we=D&&D.cancellationStrategy?D.cancellationStrategy:E.Message;function Me(Ee){if(Ee===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+Ee.toString()}M(Me,"createRequestQueueKey");function Ye(Ee){return Ee===null?"res-unknown-"+(++B).toString():"res-"+Ee.toString()}M(Ye,"createResponseQueueKey");function le(){return"not-"+(++V).toString()}M(le,"createNotificationQueueKey");function pe(Ee,it){n.Message.isRequest(it)?Ee.set(Me(it.id),it):n.Message.isResponse(it)?Ee.set(Ye(it.id),it):Ee.set(le(),it)}M(pe,"addMessageToQueue");function Ce(Ee){}M(Ce,"cancelUndispatched");function ne(){return Fe===_.Listening}M(ne,"isListening");function Y(){return Fe===_.Closed}M(Y,"isClosed");function J(){return Fe===_.Disposed}M(J,"isDisposed");function ue(){(Fe===_.New||Fe===_.Listening)&&(Fe=_.Closed,he.fire(void 0))}M(ue,"closeHandler");function X(Ee){ce.fire([Ee,void 0,void 0])}M(X,"readErrorHandler");function fe(Ee){ce.fire(Ee)}M(fe,"writeErrorHandler"),I.onClose(ue),I.onError(X),$.onClose(ue),$.onError(fe);function ee(){Q||Z.size===0||(Q=(0,e.default)().timer.setImmediate(()=>{Q=void 0,Re()}))}M(ee,"triggerMessageQueue");function Ae(Ee){n.Message.isRequest(Ee)?Ne(Ee):n.Message.isNotification(Ee)?De(Ee):n.Message.isResponse(Ee)?qe(Ee):Ke(Ee)}M(Ae,"handleMessage");function Re(){if(Z.size===0)return;const Ee=Z.shift();try{const it=D==null?void 0:D.messageStrategy;A.is(it)?it.handleMessage(Ee,Ae):Ae(Ee)}finally{ee()}}M(Re,"processMessageQueue");const Xe=M(Ee=>{try{if(n.Message.isNotification(Ee)&&Ee.method===o.type.method){const it=Ee.params.id,gt=Me(it),xt=Z.get(gt);if(n.Message.isRequest(xt)){const $r=D==null?void 0:D.connectionStrategy,kr=$r&&$r.cancelUndispatched?$r.cancelUndispatched(xt,Ce):void 0;if(kr&&(kr.error!==void 0||kr.result!==void 0)){Z.delete(gt),me.delete(it),kr.id=xt.id,mt(kr,Ee.method,Date.now()),$.write(kr).catch(()=>F.error("Sending response for canceled message failed."));return}}const nr=me.get(it);if(nr!==void 0){nr.cancel(),St(Ee);return}else ie.add(it)}pe(Z,Ee)}finally{ee()}},"callback");function Ne(Ee){if(J())return;function it(Er,nn,Cr){const jr={jsonrpc:H,id:Ee.id};Er instanceof n.ResponseError?jr.error=Er.toJson():jr.result=Er===void 0?null:Er,mt(jr,nn,Cr),$.write(jr).catch(()=>F.error("Sending response failed."))}M(it,"reply");function gt(Er,nn,Cr){const jr={jsonrpc:H,id:Ee.id,error:Er.toJson()};mt(jr,nn,Cr),$.write(jr).catch(()=>F.error("Sending response failed."))}M(gt,"replyError");function xt(Er,nn,Cr){Er===void 0&&(Er=null);const jr={jsonrpc:H,id:Ee.id,result:Er};mt(jr,nn,Cr),$.write(jr).catch(()=>F.error("Sending response failed."))}M(xt,"replySuccess"),Le(Ee);const nr=W.get(Ee.method);let $r,kr;nr&&($r=nr.type,kr=nr.handler);const Ur=Date.now();if(kr||G){const Er=Ee.id??String(Date.now()),nn=T.is(we.receiver)?we.receiver.createCancellationTokenSource(Er):we.receiver.createCancellationTokenSource(Ee);Ee.id!==null&&ie.has(Ee.id)&&nn.cancel(),Ee.id!==null&&me.set(Er,nn);try{let Cr;if(kr)if(Ee.params===void 0){if($r!==void 0&&$r.numberOfParams!==0){gt(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${Ee.method} defines ${$r.numberOfParams} params but received none.`),Ee.method,Ur);return}Cr=kr(nn.token)}else if(Array.isArray(Ee.params)){if($r!==void 0&&$r.parameterStructures===n.ParameterStructures.byName){gt(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${Ee.method} defines parameters by name but received parameters by position`),Ee.method,Ur);return}Cr=kr(...Ee.params,nn.token)}else{if($r!==void 0&&$r.parameterStructures===n.ParameterStructures.byPosition){gt(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${Ee.method} defines parameters by position but received parameters by name`),Ee.method,Ur);return}Cr=kr(Ee.params,nn.token)}else G&&(Cr=G(Ee.method,Ee.params,nn.token));const jr=Cr;Cr?jr.then?jr.then(wn=>{me.delete(Er),it(wn,Ee.method,Ur)},wn=>{me.delete(Er),wn instanceof n.ResponseError?gt(wn,Ee.method,Ur):wn&&r.string(wn.message)?gt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Ee.method} failed with message: ${wn.message}`),Ee.method,Ur):gt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Ee.method} failed unexpectedly without providing any details.`),Ee.method,Ur)}):(me.delete(Er),it(Cr,Ee.method,Ur)):(me.delete(Er),xt(Cr,Ee.method,Ur))}catch(Cr){me.delete(Er),Cr instanceof n.ResponseError?it(Cr,Ee.method,Ur):Cr&&r.string(Cr.message)?gt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Ee.method} failed with message: ${Cr.message}`),Ee.method,Ur):gt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Ee.method} failed unexpectedly without providing any details.`),Ee.method,Ur)}}else gt(new n.ResponseError(n.ErrorCodes.MethodNotFound,`Unhandled method ${Ee.method}`),Ee.method,Ur)}M(Ne,"handleRequest");function qe(Ee){if(!J())if(Ee.id===null)Ee.error?F.error(`Received response message without id: Error is:${JSON.stringify(Ee.error,void 0,4)}`):F.error("Received response message without id. No further error information provided.");else{const it=Ee.id,gt=re.get(it);if(At(Ee,gt),gt!==void 0){re.delete(it);try{if(Ee.error){const xt=Ee.error;gt.reject(new n.ResponseError(xt.code,xt.message,xt.data))}else if(Ee.result!==void 0)gt.resolve(Ee.result);else throw new Error("Should never happen.")}catch(xt){xt.message?F.error(`Response handler '${gt.method}' failed with message: ${xt.message}`):F.error(`Response handler '${gt.method}' failed unexpectedly.`)}}}}M(qe,"handleResponse");function De(Ee){if(J())return;let it,gt;if(Ee.method===o.type.method){const xt=Ee.params.id;ie.delete(xt),St(Ee);return}else{const xt=q.get(Ee.method);xt&&(gt=xt.handler,it=xt.type)}if(gt||K)try{if(St(Ee),gt)if(Ee.params===void 0)it!==void 0&&it.numberOfParams!==0&&it.parameterStructures!==n.ParameterStructures.byName&&F.error(`Notification ${Ee.method} defines ${it.numberOfParams} params but received none.`),gt();else if(Array.isArray(Ee.params)){const xt=Ee.params;Ee.method===u.type.method&&xt.length===2&&l.is(xt[0])?gt({token:xt[0],value:xt[1]}):(it!==void 0&&(it.parameterStructures===n.ParameterStructures.byName&&F.error(`Notification ${Ee.method} defines parameters by name but received parameters by position`),it.numberOfParams!==Ee.params.length&&F.error(`Notification ${Ee.method} defines ${it.numberOfParams} params but received ${xt.length} arguments`)),gt(...xt))}else it!==void 0&&it.parameterStructures===n.ParameterStructures.byPosition&&F.error(`Notification ${Ee.method} defines parameters by position but received parameters by name`),gt(Ee.params);else K&&K(Ee.method,Ee.params)}catch(xt){xt.message?F.error(`Notification handler '${Ee.method}' failed with message: ${xt.message}`):F.error(`Notification handler '${Ee.method}' failed unexpectedly.`)}else Te.fire(Ee)}M(De,"handleNotification");function Ke(Ee){if(!Ee){F.error("Received empty message.");return}F.error(`Received message which is neither a response nor a notification message:${JSON.stringify(Ee,null,4)}`);const it=Ee;if(r.string(it.id)||r.number(it.id)){const gt=it.id,xt=re.get(gt);xt&&xt.reject(new Error("The received response has neither a result nor an error property."))}}M(Ke,"handleInvalidMessage");function ze(Ee){if(Ee!=null)switch(te){case f.Verbose:return JSON.stringify(Ee,null,4);case f.Compact:return JSON.stringify(Ee);default:return}}M(ze,"stringifyTrace");function st(Ee){if(!(te===f.Off||!$e))if(_e===g.Text){let it;(te===f.Verbose||te===f.Compact)&&Ee.params&&(it=`Params: ${ze(Ee.params)}@@ -3593,7 +3593,7 @@ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.`,type:Ps.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}M(lBe,"performRuntimeChecks");function cBe(t,e,r){const n=[];let i=!1;const s=YA(Ch(Ta(t.modes))),a=eP(s,l=>l[Fy]===Rl.NA),o=ire(r);return e&&tn(a,l=>{const u=nre(l,o);if(u!==!1){const d={message:dBe(l,u),type:u.issue,tokenType:l};n.push(d)}else Yr(l,"LINE_BREAKS")?l.LINE_BREAKS===!0&&(i=!0):rP(o,l.PATTERN)&&(i=!0)}),e&&!i&&n.push({message:`Warning: No LINE_BREAKS Found.This Lexer has been defined to track line and column information,But none of the Token Types can be identified as matching a line terminator.- See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS+ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKSfor details.`,type:Ps.NO_LINE_BREAKS_FLAGS}),n}M(cBe,"performWarningRuntimeChecks");function uBe(t){const e={},r=qc(t);return tn(r,n=>{const i=t[n];if(Qn(i))e[n]=[];else throw Error("non exhaustive match")}),e}M(uBe,"cloneEmptyGroups");function rre(t){const e=t.PATTERN;if(L0(e))return!1;if(ep(e))return!0;if(Yr(e,"exec"))return!0;if(yc(e))return!1;throw Error("non exhaustive match")}M(rre,"isCustomPattern");function hBe(t){return yc(t)&&t.length===1?t.charCodeAt(0):!1}M(hBe,"isShortPattern");var $ir={test:M(function(t){const e=t.length;for(let r=this.lastIndex;r<e;r++){const n=t.charCodeAt(r);if(n===10)return this.lastIndex=r+1,!0;if(n===13)return t.charCodeAt(r+1)===10?this.lastIndex=r+2:this.lastIndex=r+1,!0}return!1},"test"),lastIndex:0};function nre(t,e){if(Yr(t,"LINE_BREAKS"))return!1;if(L0(t.PATTERN)){try{rP(e,t.PATTERN)}catch(r){return{issue:Ps.IDENTIFY_TERMINATOR,errMsg:r.message}}return!1}else{if(yc(t.PATTERN))return!1;if(rre(t))return{issue:Ps.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}M(nre,"checkLineBreaksIssues");function dBe(t,e){if(e.issue===Ps.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.The problem is in the <${t.name}> Token TypeRoot cause: ${e.errMsg}.@@ -3616,8 +3616,8 @@ ${Lr(u,(f,p)=>` ${p+1}. ${f}`).join(`but found: '`+Lh(e).image+"'";if(r)return i+r+a;{const l=`expecting at least one iteration which starts with one of these possible Token sequences::<${Lr(t,u=>`[${Lr(u,h=>iy(h)).join(",")}]`).join(" ,")}>`;return i+l+a}}};Object.freeze(pb);var Fir={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<-inside top level rule: ->`+t.name+"<-"}},W1={buildDuplicateFoundError(t,e){function r(h){return h instanceof Zi?h.terminalType.name:h instanceof Ol?h.nonTerminalName:""}M(r,"getExtraProductionArgument");const n=t.name,i=Lh(e),s=i.idx,a=ah(i),o=r(i),l=s>0;let u=`->${a}${l?s:""}<- ${o?`with argument: ->${o}<-`:""}- appears more than once (${e.length} times) in the top level rule: ->${n}<-.- For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES+ appears more than once (${e.length} times) in the top level rule: ->${n}<-.+ For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES`;return u=u.replace(/[ \t]+/g," "),u=u.replace(/\s\s+/g,``),u},buildNamespaceConflictError(t){return`Namespace conflict found in grammar.The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${t.name}>.@@ -3638,7 +3638,7 @@ Only the last alternative may be an empty alternative.`},buildTooManyAlternative<OR${t.alternation.idx}> inside <${t.topLevelRule.name}> Rule.has ${t.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(t){const e=t.topLevelRule.name,r=Lr(t.leftRecursionPath,s=>s.name),n=`${e} --> ${r.concat([e]).join(" --> ")}`;return`Left Recursion found in grammar.rule: <${e}> can be invoked from itself (directly or indirectly)-without consuming any Tokens. The grammar path that causes this is:+without consuming any Tokens. The grammar path that causes this is:${n}To fix this refactor your grammar to remove the left recursion.see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return"deprecated"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof N3?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function CBe(t,e){const r=new zir(t,e);return r.resolveRefs(),r.errors}M(CBe,"resolveGrammar");var Bx,zir=(Bx=class extends D3{constructor(e,r){super(),this.nameToTopRule=e,this.errMsgProvider=r,this.errors=[]}resolveRefs(){tn(Ta(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const r=this.nameToTopRule[e.nonTerminalName];if(r)e.referencedRule=r;else{const n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:n,type:Pl.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}},M(Bx,"GastRefResolverVisitor"),Bx),Fx,Vir=(Fx=class extends tP{constructor(e,r){super(),this.topProd=e,this.path=r,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=Mo(this.path.ruleStack).reverse(),this.occurrenceStack=Mo(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,r=[]){this.found||super.walk(e,r)}walkProdRef(e,r,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const i=r.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){Fi(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},M(Fx,"AbstractNextPossibleTokensWalker"),Fx),zx,Hir=(zx=class extends Vir{constructor(e,r){super(e,r),this.path=r,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,r,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const i=r.concat(n),s=new vc({definition:i});this.possibleTokTypes=O3(s),this.found=!0}}},M(zx,"NextAfterTokenWalker"),zx),Vx,nP=(Vx=class extends tP{constructor(e,r){super(),this.topRule=e,this.occurrence=r,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}},M(Vx,"AbstractNextTerminalAfterProductionWalker"),Vx),Hx,Gir=(Hx=class extends nP{walkMany(e,r,n){if(e.idx===this.occurrence){const i=Lh(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Zi&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,r,n)}},M(Hx,"NextTerminalAfterManyWalker"),Hx),Gx,lme=(Gx=class extends nP{walkManySep(e,r,n){if(e.idx===this.occurrence){const i=Lh(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Zi&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,r,n)}},M(Gx,"NextTerminalAfterManySepWalker"),Gx),Wx,Wir=(Wx=class extends nP{walkAtLeastOne(e,r,n){if(e.idx===this.occurrence){const i=Lh(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Zi&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,r,n)}},M(Wx,"NextTerminalAfterAtLeastOneWalker"),Wx),qx,cme=(qx=class extends nP{walkAtLeastOneSep(e,r,n){if(e.idx===this.occurrence){const i=Lh(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Zi&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,r,n)}},M(qx,"NextTerminalAfterAtLeastOneSepWalker"),qx);function AI(t,e,r=[]){r=Mo(r);let n=[],i=0;function s(o){return o.concat(mo(t,i+1))}M(s,"remainingPathWith");function a(o){const l=AI(s(o),e,r);return n.concat(l)}for(M(a,"getAlternativesForProd");r.length<e&&i<t.length;){const o=t[i];if(o instanceof vc)return a(o.definition);if(o instanceof Ol)return a(o.definition);if(o instanceof Ao)n=a(o.definition);else if(o instanceof Qc){const l=o.definition.concat([new Os({definition:o.definition})]);return a(l)}else if(o instanceof Jc){const l=[new vc({definition:o.definition}),new Os({definition:[new Zi({terminalType:o.separator})].concat(o.definition)})];return a(l)}else if(o instanceof Tc){const l=o.definition.concat([new Os({definition:[new Zi({terminalType:o.separator})].concat(o.definition)})]);n=a(l)}else if(o instanceof Os){const l=o.definition.concat([new Os({definition:o.definition})]);n=a(l)}else{if(o instanceof Cc)return tn(o.definition,l=>{Fi(l.definition)===!1&&(n=a(l.definition))}),n;if(o instanceof Zi)r.push(o.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:r,suffixDef:mo(t,i)}),n}M(AI,"possiblePathsFrom");function cre(t,e,r,n){const i="EXIT_NONE_TERMINAL",s=[i],a="EXIT_ALTERNATIVE";let o=!1;const l=e.length,u=l-n-1,h=[],d=[];for(d.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!Fi(d);){const f=d.pop();if(f===a){o&&By(d).idx<=u&&d.pop();continue}const p=f.def,g=f.idx,m=f.ruleStack,y=f.occurrenceStack;if(Fi(p))continue;const v=p[0];if(v===i){const x={idx:g,def:mo(p),ruleStack:l6(m),occurrenceStack:l6(y)};d.push(x)}else if(v instanceof Zi)if(g<l-1){const x=g+1,b=e[x];if(r(b,v.terminalType)){const T={idx:x,def:mo(p),ruleStack:m,occurrenceStack:y};d.push(T)}}else if(g===l-1)h.push({nextTokenType:v.terminalType,nextTokenOccurrence:v.idx,ruleStack:m,occurrenceStack:y}),o=!0;else throw Error("non exhaustive match");else if(v instanceof Ol){const x=Mo(m);x.push(v.nonTerminalName);const b=Mo(y);b.push(v.idx);const T={idx:g,def:v.definition.concat(s,mo(p)),ruleStack:x,occurrenceStack:b};d.push(T)}else if(v instanceof Ao){const x={idx:g,def:mo(p),ruleStack:m,occurrenceStack:y};d.push(x),d.push(a);const b={idx:g,def:v.definition.concat(mo(p)),ruleStack:m,occurrenceStack:y};d.push(b)}else if(v instanceof Qc){const x=new Os({definition:v.definition,idx:v.idx}),b=v.definition.concat([x],mo(p)),T={idx:g,def:b,ruleStack:m,occurrenceStack:y};d.push(T)}else if(v instanceof Jc){const x=new Zi({terminalType:v.separator}),b=new Os({definition:[x].concat(v.definition),idx:v.idx}),T=v.definition.concat([b],mo(p)),C={idx:g,def:T,ruleStack:m,occurrenceStack:y};d.push(C)}else if(v instanceof Tc){const x={idx:g,def:mo(p),ruleStack:m,occurrenceStack:y};d.push(x),d.push(a);const b=new Zi({terminalType:v.separator}),T=new Os({definition:[b].concat(v.definition),idx:v.idx}),C=v.definition.concat([T],mo(p)),S={idx:g,def:C,ruleStack:m,occurrenceStack:y};d.push(S)}else if(v instanceof Os){const x={idx:g,def:mo(p),ruleStack:m,occurrenceStack:y};d.push(x),d.push(a);const b=new Os({definition:v.definition,idx:v.idx}),T=v.definition.concat([b],mo(p)),C={idx:g,def:T,ruleStack:m,occurrenceStack:y};d.push(C)}else if(v instanceof Cc)for(let x=v.definition.length-1;x>=0;x--){const b=v.definition[x],T={idx:g,def:b.definition.concat(mo(p)),ruleStack:m,occurrenceStack:y};d.push(T),d.push(a)}else if(v instanceof vc)d.push({idx:g,def:v.definition.concat(mo(p)),ruleStack:m,occurrenceStack:y});else if(v instanceof N3)d.push(kBe(v,g,m,y));else throw Error("non exhaustive match")}return h}M(cre,"nextPossibleTokensAfter");function kBe(t,e,r,n){const i=Mo(r);i.push(t.name);const s=Mo(n);return s.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:s}}M(kBe,"expandTopLevelRule");var ws;(function(t){t[t.OPTION=0]="OPTION",t[t.REPETITION=1]="REPETITION",t[t.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",t[t.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",t[t.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",t[t.ALTERNATION=5]="ALTERNATION"})(ws||(ws={}));function iP(t){if(t instanceof Ao||t==="Option")return ws.OPTION;if(t instanceof Os||t==="Repetition")return ws.REPETITION;if(t instanceof Qc||t==="RepetitionMandatory")return ws.REPETITION_MANDATORY;if(t instanceof Jc||t==="RepetitionMandatoryWithSeparator")return ws.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof Tc||t==="RepetitionWithSeparator")return ws.REPETITION_WITH_SEPARATOR;if(t instanceof Cc||t==="Alternation")return ws.ALTERNATION;throw Error("non exhaustive match")}M(iP,"getProdType");function wj(t){const{occurrence:e,rule:r,prodType:n,maxLookahead:i}=t,s=iP(n);return s===ws.ALTERNATION?ZA(e,r,i):QA(e,r,s,i)}M(wj,"getLookaheadPaths");function SBe(t,e,r,n,i,s){const a=ZA(t,e,r),o=hre(a)?u6:P3;return s(a,n,o,i)}M(SBe,"buildLookaheadFuncForOr");function EBe(t,e,r,n,i,s){const a=QA(t,e,i,r),o=hre(a)?u6:P3;return s(a[0],o,n)}M(EBe,"buildLookaheadFuncForOptionalProd");function ABe(t,e,r,n){const i=t.length,s=kh(t,a=>kh(a,o=>o.length===1));if(e)return function(a){const o=Lr(a,l=>l.GATE);for(let l=0;l<i;l++){const u=t[l],h=u.length,d=o[l];if(!(d!==void 0&&d.call(this)===!1))e:for(let f=0;f<h;f++){const p=u[f],g=p.length;for(let m=0;m<g;m++){const y=this.LA(m+1);if(r(y,p[m])===!1)continue e}return l}}};if(s&&!n){const a=Lr(t,l=>Ch(l)),o=jc(a,(l,u,h)=>(tn(u,d=>{Yr(l,d.tokenTypeIdx)||(l[d.tokenTypeIdx]=h),tn(d.categoryMatches,f=>{Yr(l,f)||(l[f]=h)})}),l),{});return function(){const l=this.LA(1);return o[l.tokenTypeIdx]}}else return function(){for(let a=0;a<i;a++){const o=t[a],l=o.length;e:for(let u=0;u<l;u++){const h=o[u],d=h.length;for(let f=0;f<d;f++){const p=this.LA(f+1);if(r(p,h[f])===!1)continue e}return a}}}}M(ABe,"buildAlternativesLookAheadFunc");function MBe(t,e,r){const n=kh(t,s=>s.length===1),i=t.length;if(n&&!r){const s=Ch(t);if(s.length===1&&Fi(s[0].categoryMatches)){const o=s[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===o}}else{const a=jc(s,(o,l,u)=>(o[l.tokenTypeIdx]=!0,tn(l.categoryMatches,h=>{o[h]=!0}),o),[]);return function(){const o=this.LA(1);return a[o.tokenTypeIdx]===!0}}}else return function(){e:for(let s=0;s<i;s++){const a=t[s],o=a.length;for(let l=0;l<o;l++){const u=this.LA(l+1);if(e(u,a[l])===!1)continue e}return!0}return!1}}M(MBe,"buildSingleAlternativeLookaheadFunction");var Ux,qir=(Ux=class extends tP{constructor(e,r,n){super(),this.topProd=e,this.targetOccurrence=r,this.targetProdType=n}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(e,r,n,i){return e.idx===this.targetOccurrence&&this.targetProdType===r?(this.restDef=n.concat(i),!0):!1}walkOption(e,r,n){this.checkIsTarget(e,ws.OPTION,r,n)||super.walkOption(e,r,n)}walkAtLeastOne(e,r,n){this.checkIsTarget(e,ws.REPETITION_MANDATORY,r,n)||super.walkOption(e,r,n)}walkAtLeastOneSep(e,r,n){this.checkIsTarget(e,ws.REPETITION_MANDATORY_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}walkMany(e,r,n){this.checkIsTarget(e,ws.REPETITION,r,n)||super.walkOption(e,r,n)}walkManySep(e,r,n){this.checkIsTarget(e,ws.REPETITION_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}},M(Ux,"RestDefinitionFinderWalker"),Ux),jx,RBe=(jx=class extends D3{constructor(e,r,n){super(),this.targetOccurrence=e,this.targetProdType=r,this.targetRef=n,this.result=[]}checkIsTarget(e,r){e.idx===this.targetOccurrence&&this.targetProdType===r&&(this.targetRef===void 0||e===this.targetRef)&&(this.result=e.definition)}visitOption(e){this.checkIsTarget(e,ws.OPTION)}visitRepetition(e){this.checkIsTarget(e,ws.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,ws.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,ws.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,ws.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,ws.ALTERNATION)}},M(jx,"InsideDefinitionFinderVisitor"),jx);function Tj(t){const e=new Array(t);for(let r=0;r<t;r++)e[r]=[];return e}M(Tj,"initializeArrayOfArrays");function LR(t){let e=[""];for(let r=0;r<t.length;r++){const n=t[r],i=[];for(let s=0;s<e.length;s++){const a=e[s];i.push(a+"_"+n.tokenTypeIdx);for(let o=0;o<n.categoryMatches.length;o++){const l="_"+n.categoryMatches[o];i.push(a+l)}}e=i}return e}M(LR,"pathToHashKeys");function _Be(t,e,r){for(let n=0;n<t.length;n++){if(n===r)continue;const i=t[n];for(let s=0;s<e.length;s++){const a=e[s];if(i[a]===!0)return!1}}return!0}M(_Be,"isUniquePrefixHash");function ure(t,e){const r=Lr(t,a=>AI([a],1)),n=Tj(r.length),i=Lr(r,a=>{const o={};return tn(a,l=>{const u=LR(l.partialPath);tn(u,h=>{o[h]=!0})}),o});let s=r;for(let a=1;a<=e;a++){const o=s;s=Tj(o.length);for(let l=0;l<o.length;l++){const u=o[l];for(let h=0;h<u.length;h++){const d=u[h].partialPath,f=u[h].suffixDef,p=LR(d);if(_Be(i,p,l)||Fi(f)||d.length===e){const m=n[l];if(MI(m,d)===!1){m.push(d);for(let y=0;y<p.length;y++){const v=p[y];i[l][v]=!0}}}else{const m=AI(f,a+1,d);s[l]=s[l].concat(m),tn(m,y=>{const v=LR(y.partialPath);tn(v,x=>{i[l][x]=!0})})}}}}return n}M(ure,"lookAheadSequenceFromAlternatives");function ZA(t,e,r,n){const i=new RBe(t,ws.ALTERNATION,n);return e.accept(i),ure(i.result,r)}M(ZA,"getLookaheadPathsForOr");function QA(t,e,r,n){const i=new RBe(t,r);e.accept(i);const s=i.result,o=new qir(e,t,r).startWalking(),l=new vc({definition:s}),u=new vc({definition:o});return ure([l,u],n)}M(QA,"getLookaheadPathsForOptionalProd");function MI(t,e){e:for(let r=0;r<t.length;r++){const n=t[r];if(n.length===e.length){for(let i=0;i<n.length;i++){const s=e[i],a=n[i];if((s===a||a.categoryMatchesMap[s.tokenTypeIdx]!==void 0)===!1)continue e}return!0}}return!1}M(MI,"containsPath");function LBe(t,e){return t.length<e.length&&kh(t,(r,n)=>{const i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}M(LBe,"isStrictPrefixOfPath");function hre(t){return kh(t,e=>kh(e,r=>kh(r,n=>Fi(n.categoryMatches))))}M(hre,"areTokenCategoriesNotUsed");function IBe(t){const e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return Lr(e,r=>Object.assign({type:Pl.CUSTOM_LOOKAHEAD_VALIDATION},r))}M(IBe,"validateLookahead");function NBe(t,e,r,n){const i=Au(t,l=>DBe(l,r)),s=WBe(t,e,r),a=Au(t,l=>zBe(l,r)),o=Au(t,l=>PBe(l,t,n,r));return i.concat(s,a,o)}M(NBe,"validateGrammar");function DBe(t,e){const r=new Uir;t.accept(r);const n=r.allProductions,i=air(n,OBe),s=$h(i,o=>o.length>1);return Lr(Ta(s),o=>{const l=Lh(o),u=e.buildDuplicateFoundError(t,o),h=ah(l),d={message:u,type:Pl.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:h,occurrence:l.idx},f=dre(l);return f&&(d.parameter=f),d})}M(DBe,"validateDuplicateProductions");function OBe(t){return`${ah(t)}_#_${t.idx}_#_${dre(t)}`}M(OBe,"identifyProductionForDuplicates");function dre(t){return t instanceof Zi?t.terminalType.name:t instanceof Ol?t.nonTerminalName:""}M(dre,"getExtraProductionArgument");var Yx,Uir=(Yx=class extends D3{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}},M(Yx,"OccurrenceValidationCollector"),Yx);function PBe(t,e,r,n){const i=[];if(jc(e,(a,o)=>o.name===t.name?a+1:a,0)>1){const a=n.buildDuplicateRuleNameError({topLevelRule:t,grammarName:r});i.push({message:a,type:Pl.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}M(PBe,"validateRuleDoesNotAlreadyExist");function $Be(t,e,r){const n=[];let i;return Wl(e,t)||(i=`Invalid rule override, rule: ->${t}<- cannot be overridden in the grammar: ->${r}<-as it is not defined in any of the super grammars `,n.push({message:i,type:Pl.INVALID_RULE_OVERRIDE,ruleName:t})),n}M($Be,"validateRuleIsOverridden");function fre(t,e,r,n=[]){const i=[],s=SS(e.definition);if(Fi(s))return[];{const a=t.name;Wl(s,t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:Pl.LEFT_RECURSION,ruleName:a});const l=JO(s,n.concat([t])),u=Au(l,h=>{const d=Mo(n);return d.push(h),fre(t,h,r,d)});return i.concat(u)}}M(fre,"validateNoLeftRecursion");function SS(t){let e=[];if(Fi(t))return e;const r=Lh(t);if(r instanceof Ol)e.push(r.referencedRule);else if(r instanceof vc||r instanceof Ao||r instanceof Qc||r instanceof Jc||r instanceof Tc||r instanceof Os)e=e.concat(SS(r.definition));else if(r instanceof Cc)e=Ch(Lr(r.definition,s=>SS(s.definition)));else if(!(r instanceof Zi))throw Error("non exhaustive match");const n=c6(r),i=t.length>1;if(n&&i){const s=mo(t);return e.concat(SS(s))}else return e}M(SS,"getFirstNoneTerminal");var Xx,pre=(Xx=class extends D3{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}},M(Xx,"OrCollector"),Xx);function BBe(t,e){const r=new pre;t.accept(r);const n=r.alternations;return Au(n,s=>{const a=l6(s.definition);return Au(a,(o,l)=>{const u=cre([o],[],P3,1);return Fi(u)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:s,emptyChoiceIdx:l}),type:Pl.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:s.idx,alternative:l+1}]:[]})})}M(BBe,"validateEmptyOrAlternative");function FBe(t,e,r){const n=new pre;t.accept(n);let i=n.alternations;return i=eP(i,a=>a.ignoreAmbiguities===!0),Au(i,a=>{const o=a.idx,l=a.maxLookahead||e,u=ZA(o,t,l,a),h=HBe(u,a,t,r),d=GBe(u,a,t,r);return h.concat(d)})}M(FBe,"validateAmbiguousAlternationAlternatives");var Kx,jir=(Kx=class extends D3{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}},M(Kx,"RepetitionCollector"),Kx);function zBe(t,e){const r=new pre;t.accept(r);const n=r.alternations;return Au(n,s=>s.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:s}),type:Pl.TOO_MANY_ALTS,ruleName:t.name,occurrence:s.idx}]:[])}M(zBe,"validateTooManyAlts");function VBe(t,e,r){const n=[];return tn(t,i=>{const s=new jir;i.accept(s);const a=s.allProductions;tn(a,o=>{const l=iP(o),u=o.maxLookahead||e,h=o.idx,f=QA(h,i,l,u)[0];if(Fi(Ch(f))){const p=r.buildEmptyRepetitionError({topLevelRule:i,repetition:o});n.push({message:p,type:Pl.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}M(VBe,"validateSomeNonEmptyLookaheadPath");function HBe(t,e,r,n){const i=[],s=jc(t,(o,l,u)=>(e.definition[u].ignoreAmbiguities===!0||tn(l,h=>{const d=[u];tn(t,(f,p)=>{u!==p&&MI(f,h)&&e.definition[p].ignoreAmbiguities!==!0&&d.push(p)}),d.length>1&&!MI(i,h)&&(i.push(h),o.push({alts:d,path:h}))}),o),[]);return Lr(s,o=>{const l=Lr(o.alts,h=>h+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:l,prefixPath:o.path}),type:Pl.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:o.alts}})}M(HBe,"checkAlternativesAmbiguities");function GBe(t,e,r,n){const i=jc(t,(a,o,l)=>{const u=Lr(o,h=>({idx:l,path:h}));return a.concat(u)},[]);return YA(Au(i,a=>{if(e.definition[a.idx].ignoreAmbiguities===!0)return[];const l=a.idx,u=a.path,h=Fu(i,f=>e.definition[f.idx].ignoreAmbiguities!==!0&&f.idx<l&&LBe(f.path,u));return Lr(h,f=>{const p=[f.idx+1,l+1],g=e.idx===0?"":e.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:p,prefixPath:f.path}),type:Pl.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:g,alternatives:p}})}))}M(GBe,"checkPrefixAlternativesAmbiguities");function WBe(t,e,r){const n=[],i=Lr(e,s=>s.name);return tn(t,s=>{const a=s.name;if(Wl(i,a)){const o=r.buildNamespaceConflictError(s);n.push({message:o,type:Pl.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:a})}}),n}M(WBe,"checkTerminalAndNoneTerminalsNameSpace");function qBe(t){const e=Zte(t,{errMsgProvider:Fir}),r={};return tn(t.rules,n=>{r[n.name]=n}),CBe(r,e.errMsgProvider)}M(qBe,"resolveGrammar");function UBe(t){return t=Zte(t,{errMsgProvider:W1}),NBe(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}M(UBe,"validateGrammar");var jBe="MismatchedTokenException",YBe="NoViableAltException",XBe="EarlyExitException",KBe="NotAllInputParsedException",ZBe=[jBe,YBe,XBe,KBe];Object.freeze(ZBe);function h6(t){return Wl(ZBe,t.name)}M(h6,"isRecognitionException");var Zx,sP=(Zx=class extends Error{constructor(e,r){super(e),this.token=r,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},M(Zx,"RecognitionException"),Zx),Qx,QBe=(Qx=class extends sP{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=jBe}},M(Qx,"MismatchedTokenException"),Qx),Jx,Yir=(Jx=class extends sP{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=YBe}},M(Jx,"NoViableAltException"),Jx),ew,Xir=(ew=class extends sP{constructor(e,r){super(e,r),this.name=KBe}},M(ew,"NotAllInputParsedException"),ew),tw,Kir=(tw=class extends sP{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=XBe}},M(tw,"EarlyExitException"),tw),Qz={},JBe="InRuleRecoveryException",rw,Zir=(rw=class extends Error{constructor(e){super(e),this.name=JBe}},M(rw,"InRuleRecoveryException"),rw),nw,Qir=(nw=class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=Yr(e,"recoveryEnabled")?e.recoveryEnabled:D0.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=eFe)}getTokenToInsert(e){const r=KA(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return r.isInsertedInRecovery=!0,r}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,r,n,i){const s=this.findReSyncTokenType(),a=this.exportLexerState(),o=[];let l=!1;const u=this.LA(1);let h=this.LA(1);const d=M(()=>{const f=this.LA(0),p=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:u,previous:f,ruleName:this.getCurrRuleFullName()}),g=new QBe(p,u,this.LA(0));g.resyncedTokens=l6(o),this.SAVE_ERROR(g)},"generateErrorMessage");for(;!l;)if(this.tokenMatcher(h,i)){d();return}else if(n.call(this)){d(),e.apply(this,r);return}else this.tokenMatcher(h,s)?l=!0:(h=this.SKIP_TOKEN(),this.addToResyncTokens(h,o));this.importLexerState(a)}shouldInRepetitionRecoveryBeTried(e,r,n){return!(n===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,r)))}getFollowsForInRuleRecovery(e,r){const n=this.getCurrentGrammarPath(e,r);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,r){if(this.canRecoverWithSingleTokenInsertion(e,r))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new Zir("sad sad panda")}canPerformInRuleRecovery(e,r){return this.canRecoverWithSingleTokenInsertion(e,r)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,r){if(!this.canTokenTypeBeInsertedInRecovery(e)||Fi(r))return!1;const n=this.LA(1);return F5(r,s=>this.tokenMatcher(n,s))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){const r=this.getCurrFollowKey(),n=this.getFollowSetFromFollowKey(r);return Wl(n,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let r=this.LA(1),n=2;for(;;){const i=F5(e,s=>lre(r,s));if(i!==void 0)return i;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return Qz;const e=this.getLastExplicitRuleShortName(),r=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:r,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,r=this.RULE_OCCURRENCE_STACK;return Lr(e,(n,i)=>i===0?Qz:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:r[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){const e=Lr(this.buildFullFollowKeyStack(),r=>this.getFollowSetFromFollowKey(r));return Ch(e)}getFollowSetFromFollowKey(e){if(e===Qz)return[Bg];const r=e.ruleName+e.idxInCallingRule+F$e+e.inRule;return this.resyncFollows[r]}addToResyncTokens(e,r){return this.tokenMatcher(e,Bg)||r.push(e),r}reSyncTo(e){const r=[];let n=this.LA(1);for(;this.tokenMatcher(n,e)===!1;)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,r);return l6(r)}attemptInRepetitionRecovery(e,r,n,i,s,a,o){}getCurrentGrammarPath(e,r){const n=this.getHumanReadableRuleStack(),i=Mo(this.RULE_OCCURRENCE_STACK);return{ruleStack:n,occurrenceStack:i,lastTok:e,lastTokOccurrence:r}}getHumanReadableRuleStack(){return Lr(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}},M(nw,"Recoverable"),nw);function eFe(t,e,r,n,i,s,a){const o=this.getKeyForAutomaticLookahead(n,i);let l=this.firstAfterRepMap[o];if(l===void 0){const f=this.getCurrRuleFullName(),p=this.getGAstProductions()[f];l=new s(p,i).startWalking(),this.firstAfterRepMap[o]=l}let u=l.token,h=l.occurrence;const d=l.isEndOfRule;this.RULE_STACK.length===1&&d&&u===void 0&&(u=Bg,h=1),!(u===void 0||h===void 0)&&this.shouldInRepetitionRecoveryBeTried(u,h,a)&&this.tryInRepetitionRecovery(t,e,r,u)}M(eFe,"attemptInRepetitionRecovery");var Jir=4,gm=8,tFe=1<<gm,rFe=2<<gm,Cj=3<<gm,kj=4<<gm,Sj=5<<gm,IR=6<<gm;function NR(t,e,r){return r|e|t}M(NR,"getKeyForAutomaticLookahead");var iw,gre=(iw=class{constructor(e){var r;this.maxLookahead=(r=e==null?void 0:e.maxLookahead)!==null&&r!==void 0?r:D0.maxLookahead}validate(e){const r=this.validateNoLeftRecursion(e.rules);if(Fi(r)){const n=this.validateEmptyOrAlternatives(e.rules),i=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),s=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...r,...n,...i,...s]}return r}validateNoLeftRecursion(e){return Au(e,r=>fre(r,r,W1))}validateEmptyOrAlternatives(e){return Au(e,r=>BBe(r,W1))}validateAmbiguousAlternationAlternatives(e,r){return Au(e,n=>FBe(n,r,W1))}validateSomeNonEmptyLookaheadPath(e,r){return VBe(e,r,W1)}buildLookaheadForAlternation(e){return SBe(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,ABe)}buildLookaheadForOptional(e){return EBe(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,iP(e.prodType),MBe)}},M(iw,"LLkLookaheadStrategy"),iw),sw,esr=(sw=class{initLooksAhead(e){this.dynamicTokensEnabled=Yr(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:D0.dynamicTokensEnabled,this.maxLookahead=Yr(e,"maxLookahead")?e.maxLookahead:D0.maxLookahead,this.lookaheadStrategy=Yr(e,"lookaheadStrategy")?e.lookaheadStrategy:new gre({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){tn(e,r=>{this.TRACE_INIT(`${r.name} Rule Lookahead`,()=>{const{alternation:n,repetition:i,option:s,repetitionMandatory:a,repetitionMandatoryWithSeparator:o,repetitionWithSeparator:l}=nFe(r);tn(n,u=>{const h=u.idx===0?"":u.idx;this.TRACE_INIT(`${ah(u)}${h}`,()=>{const d=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:u.idx,rule:r,maxLookahead:u.maxLookahead||this.maxLookahead,hasPredicates:u.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),f=NR(this.fullRuleNameToShort[r.name],tFe,u.idx);this.setLaFuncCache(f,d)})}),tn(i,u=>{this.computeLookaheadFunc(r,u.idx,Cj,"Repetition",u.maxLookahead,ah(u))}),tn(s,u=>{this.computeLookaheadFunc(r,u.idx,rFe,"Option",u.maxLookahead,ah(u))}),tn(a,u=>{this.computeLookaheadFunc(r,u.idx,kj,"RepetitionMandatory",u.maxLookahead,ah(u))}),tn(o,u=>{this.computeLookaheadFunc(r,u.idx,IR,"RepetitionMandatoryWithSeparator",u.maxLookahead,ah(u))}),tn(l,u=>{this.computeLookaheadFunc(r,u.idx,Sj,"RepetitionWithSeparator",u.maxLookahead,ah(u))})})})}computeLookaheadFunc(e,r,n,i,s,a){this.TRACE_INIT(`${a}${r===0?"":r}`,()=>{const o=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:r,rule:e,maxLookahead:s||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),l=NR(this.fullRuleNameToShort[e.name],n,r);this.setLaFuncCache(l,o)})}getKeyForAutomaticLookahead(e,r){const n=this.getLastExplicitRuleShortName();return NR(n,e,r)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,r){this.lookAheadFuncsCache.set(e,r)}},M(sw,"LooksAhead"),sw),aw,tsr=(aw=class extends D3{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}},M(aw,"DslMethodsCollectorVisitor"),aw),X8=new tsr;function nFe(t){X8.reset(),t.accept(X8);const e=X8.dslMethods;return X8.reset(),e}M(nFe,"collectMethods");function Ej(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset)}M(Ej,"setNodeLocationOnlyOffset");function Aj(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.startColumn=e.startColumn,t.startLine=e.startLine,t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine)}M(Aj,"setNodeLocationFull");function iFe(t,e,r){t.children[r]===void 0?t.children[r]=[e]:t.children[r].push(e)}M(iFe,"addTerminalToCst");function sFe(t,e,r){t.children[e]===void 0?t.children[e]=[r]:t.children[e].push(r)}M(sFe,"addNoneTerminalToCst");var rsr="name";function mre(t,e){Object.defineProperty(t,rsr,{enumerable:!1,configurable:!0,writable:!1,value:e})}M(mre,"defineNameProp");function aFe(t,e){const r=qc(t),n=r.length;for(let i=0;i<n;i++){const s=r[i],a=t[s],o=a.length;for(let l=0;l<o;l++){const u=a[l];u.tokenTypeIdx===void 0&&this[u.name](u.children,e)}}}M(aFe,"defaultVisit");function oFe(t,e){const r=M(function(){},"derivedConstructor");mre(r,t+"BaseSemantics");const n={visit:M(function(i,s){if(Qn(i)&&(i=i[0]),!I0(i))return this[i.name](i.children,s)},"visit"),validateVisitor:M(function(){const i=cFe(this,e);if(!Fi(i)){const s=Lr(i,a=>a.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:@@ -3697,7 +3697,7 @@ lodash-es/lodash.js:`;break;case"r":r+="\r";break;case"t":r+=" ";break;default:r+=s}continue}r+=i}return r},"decodeEscapedString"),W4,hhr=(W4=class extends af{runConverter(e,r,n){const i=super.runConverter(e,r,n);if(e.name==="TITLE"&&typeof i=="string"){const s=i.trim();if(s.startsWith('"')&&s.endsWith('"')||s.startsWith("'")&&s.endsWith("'"))return H1e(s)}return i}runCustomConverter(e,r,n){if(e.name==="PEG_STRING")return H1e(r)}},M(W4,"RailroadPegValueConverter"),W4),GGe={parser:{TokenBuilder:M(()=>new uhr,"TokenBuilder"),ValueConverter:M(()=>new hhr,"ValueConverter")}};function yne(t=Lo){const e=Gn(io(t),ql),r=Gn(no({shared:e}),Xur,GGe);return e.ServiceRegistry.register(r),{shared:e,RailroadPeg:r}}M(yne,"createRailroadPegServices");var q4,dhr=(q4=class extends Ul{constructor(){super(["treemap"])}},M(q4,"TreemapTokenBuilder"),q4),fhr=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/,U4,phr=(U4=class extends af{runCustomConverter(e,r,n){if(e.name==="NUMBER2")return parseFloat(r.replace(/,/g,""));if(e.name==="SEPARATOR")return r.substring(1,r.length-1);if(e.name==="STRING2")return r.substring(1,r.length-1);if(e.name==="INDENTATION")return r.length;if(e.name==="ClassDef"){if(typeof r!="string")return r;const i=fhr.exec(r);if(i)return{$type:"ClassDefStatement",className:i[1],styleText:i[2]||void 0}}}},M(U4,"TreemapValueConverter"),U4);function WGe(t){const e=t.validation.TreemapValidator,r=t.validation.ValidationRegistry;if(r){const n={Treemap:e.checkSingleRoot.bind(e)};r.register(n,e)}}M(WGe,"registerValidationChecks");var j4,ghr=(j4=class{checkSingleRoot(e,r){let n;for(const i of e.TreemapRows)i.item&&(n===void 0&&i.indent===void 0?n=0:i.indent===void 0?r("error","Multiple root nodes are not allowed in a treemap.",{node:i,property:"item"}):n!==void 0&&n>=parseInt(i.indent,10)&&r("error","Multiple root nodes are not allowed in a treemap.",{node:i,property:"item"}))}},M(j4,"TreemapValidator"),j4),qGe={parser:{TokenBuilder:M(()=>new dhr,"TokenBuilder"),ValueConverter:M(()=>new phr,"ValueConverter")},validation:{TreemapValidator:M(()=>new ghr,"TreemapValidator")}};function UGe(t=Lo){const e=Gn(io(t),ql),r=Gn(no({shared:e}),Kur,qGe);return e.ServiceRegistry.register(r),WGe(r),{shared:e,Treemap:r}}M(UGe,"createTreemapServices");var Y4,mhr=(Y4=class extends af{runCustomConverter(e,r,n){switch(e.name.toUpperCase()){case"LINK_LABEL":return r.substring(1).trim();default:return}}},M(Y4,"WardleyValueConverter"),Y4),jGe={parser:{ValueConverter:M(()=>new mhr,"ValueConverter")}};function YGe(t=Lo){const e=Gn(io(t),ql),r=Gn(no({shared:e}),Qur,jGe);return e.ServiceRegistry.register(r),{shared:e,Wardley:r}}M(YGe,"createWardleyServices");var X4,yhr=(X4=class extends Ul{constructor(){super(["cynefin-beta"])}},M(X4,"CynefinTokenBuilder"),X4),XGe={parser:{TokenBuilder:M(()=>new yhr,"TokenBuilder"),ValueConverter:M(()=>new z3,"ValueConverter")}};function KGe(t=Lo){const e=Gn(io(t),ql),r=Gn(no({shared:e}),Fur,XGe);return e.ServiceRegistry.register(r),{shared:e,Cynefin:r}}M(KGe,"createCynefinServices");var K4,vhr=(K4=class extends Ul{constructor(){super(["gitGraph"])}},M(K4,"GitGraphTokenBuilder"),K4),ZGe={parser:{TokenBuilder:M(()=>new vhr,"TokenBuilder"),ValueConverter:M(()=>new z3,"ValueConverter")}};function QGe(t=Lo){const e=Gn(io(t),ql),r=Gn(no({shared:e}),Vur,ZGe);return e.ServiceRegistry.register(r),{shared:e,GitGraph:r}}M(QGe,"createGitGraphServices");var Z4,bhr=(Z4=class extends Ul{constructor(){super(["info","showInfo"])}},M(Z4,"InfoTokenBuilder"),Z4),JGe={parser:{TokenBuilder:M(()=>new bhr,"TokenBuilder"),ValueConverter:M(()=>new z3,"ValueConverter")}};function eWe(t=Lo){const e=Gn(io(t),ql),r=Gn(no({shared:e}),Hur,JGe);return e.ServiceRegistry.register(r),{shared:e,Info:r}}M(eWe,"createInfoServices");var Q4,xhr=(Q4=class extends Ul{constructor(){super(["packet"])}},M(Q4,"PacketTokenBuilder"),Q4),tWe={parser:{TokenBuilder:M(()=>new xhr,"TokenBuilder"),ValueConverter:M(()=>new z3,"ValueConverter")}};function rWe(t=Lo){const e=Gn(io(t),ql),r=Gn(no({shared:e}),Gur,tWe);return e.ServiceRegistry.register(r),{shared:e,Packet:r}}M(rWe,"createPacketServices");var J4,whr=(J4=class extends Ul{constructor(){super(["pie","showData"])}},M(J4,"PieTokenBuilder"),J4),eT,Thr=(eT=class extends af{runCustomConverter(e,r,n){if(e.name==="PIE_SECTION_LABEL")return r.replace(/"/g,"").trim()}},M(eT,"PieValueConverter"),eT),nWe={parser:{TokenBuilder:M(()=>new whr,"TokenBuilder"),ValueConverter:M(()=>new Thr,"ValueConverter")}};function iWe(t=Lo){const e=Gn(io(t),ql),r=Gn(no({shared:e}),Wur,nWe);return e.ServiceRegistry.register(r),{shared:e,Pie:r}}M(iWe,"createPieServices");var tT,Chr=(tT=class extends af{runCustomConverter(e,r,n){if(e.name==="INDENTATION")return(r==null?void 0:r.length)||0;if(e.name==="QUOTED_NAME")return r.substring(1,r.length-1);if(e.name==="BARE_NAME")return r.replace(/[\t ]+$/,"");if(e.name==="CLASS_ANNOTATION")return r.trim().substring(3).trim();if(e.name==="ICON_ANNOTATION"){const i=r.trim();return i.substring(5,i.length-1)}if(e.name==="DESC_ANNOTATION")return r.trim().substring(2).trim()}},M(tT,"TreeViewValueConverter"),tT),rT,khr=(rT=class extends Ul{constructor(){super(["treeView-beta"])}},M(rT,"TreeViewTokenBuilder"),rT),sWe={parser:{TokenBuilder:M(()=>new khr,"TokenBuilder"),ValueConverter:M(()=>new Chr,"ValueConverter")}};function aWe(t=Lo){const e=Gn(io(t),ql),r=Gn(no({shared:e}),Zur,sWe);return e.ServiceRegistry.register(r),{shared:e,TreeView:r}}M(aWe,"createTreeViewServices");var nT,Shr=(nT=class extends Ul{constructor(){super(["architecture"])}},M(nT,"ArchitectureTokenBuilder"),nT),iT,Ehr=(iT=class extends af{runCustomConverter(e,r,n){if(e.name==="ARCH_ICON")return r.replace(/[()]/g,"").trim();if(e.name==="ARCH_TEXT_ICON")return r.replace(/["()]/g,"");if(e.name==="ARCH_TITLE"){let i=r.replace(/^\[|]$/g,"").trim();return(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))&&(i=i.slice(1,-1),i=i.replace(/\\"/g,'"').replace(/\\'/g,"'")),i.trim()}}},M(iT,"ArchitectureValueConverter"),iT),oWe={parser:{TokenBuilder:M(()=>new Shr,"TokenBuilder"),ValueConverter:M(()=>new Ehr,"ValueConverter")}};function lWe(t=Lo){const e=Gn(io(t),ql),r=Gn(no({shared:e}),Bur,oWe);return e.ServiceRegistry.register(r),{shared:e,Architecture:r}}M(lWe,"createArchitectureServices");var sT,Ahr=(sT=class extends Ul{constructor(){super(["eventmodeling"])}},M(sT,"EventModelingTokenBuilder"),sT),G1e=new Set(["cmd","command"]),W1e=new Set(["evt","event"]),kV=new Set(["rmo","readmodel"]),q1e=new Set(["pcr","processor"]),U1e=new Set(["ui"]);function cWe(t){const e=t.validation.EventModelingValidator,r=t.validation.ValidationRegistry;if(r){const n={EmTimeFrame:e.checkSourceFrameTypes.bind(e),EmResetFrame:e.checkSourceFrameTypes.bind(e)};r.register(n,e)}}M(cWe,"registerValidationChecks");var aT,Mhr=(aT=class{checkSourceFrameTypes(e,r){e.sourceFrames.length!==0&&(G1e.has(e.modelEntityType)?this.validateSources(e,new Set([...U1e,...q1e]),"command","ui or processor",r):W1e.has(e.modelEntityType)?this.validateSources(e,G1e,"event","command",r):kV.has(e.modelEntityType)?this.validateSources(e,W1e,"read model","event",r):q1e.has(e.modelEntityType)?this.validateSources(e,kV,"processor","read model",r):U1e.has(e.modelEntityType)&&this.validateSources(e,kV,"ui","read model",r))}validateSources(e,r,n,i,s){for(const a of e.sourceFrames){const o=a.ref;o!==void 0&&!r.has(o.modelEntityType)&&s("error",`A ${n} can only receive input from a ${i}, not from '${o.modelEntityType}'.`,{node:e,property:"sourceFrames"})}}},M(aT,"EventModelingValidator"),aT),uWe={parser:{TokenBuilder:M(()=>new Ahr,"TokenBuilder"),ValueConverter:M(()=>new z3,"ValueConverter")},validation:{EventModelingValidator:M(()=>new Mhr,"EventModelingValidator")}};function hWe(t=Lo){const e=Gn(io(t),ql),r=Gn(no({shared:e}),zur,uWe);return e.ServiceRegistry.register(r),cWe(r),{shared:e,EventModel:r}}M(hWe,"createEventModelingServices");var go={},Rhr={info:M(async()=>{const{createInfoServices:t}=await Rr(async()=>{const{createInfoServices:r}=await Promise.resolve().then(()=>c4r);return{createInfoServices:r}},void 0,import.meta.url),e=t().Info.parser.LangiumParser;go.info=e},"info"),packet:M(async()=>{const{createPacketServices:t}=await Rr(async()=>{const{createPacketServices:r}=await Promise.resolve().then(()=>u4r);return{createPacketServices:r}},void 0,import.meta.url),e=t().Packet.parser.LangiumParser;go.packet=e},"packet"),pie:M(async()=>{const{createPieServices:t}=await Rr(async()=>{const{createPieServices:r}=await Promise.resolve().then(()=>h4r);return{createPieServices:r}},void 0,import.meta.url),e=t().Pie.parser.LangiumParser;go.pie=e},"pie"),treeView:M(async()=>{const{createTreeViewServices:t}=await Rr(async()=>{const{createTreeViewServices:r}=await Promise.resolve().then(()=>d4r);return{createTreeViewServices:r}},void 0,import.meta.url),e=t().TreeView.parser.LangiumParser;go.treeView=e},"treeView"),architecture:M(async()=>{const{createArchitectureServices:t}=await Rr(async()=>{const{createArchitectureServices:r}=await Promise.resolve().then(()=>f4r);return{createArchitectureServices:r}},void 0,import.meta.url),e=t().Architecture.parser.LangiumParser;go.architecture=e},"architecture"),gitGraph:M(async()=>{const{createGitGraphServices:t}=await Rr(async()=>{const{createGitGraphServices:r}=await Promise.resolve().then(()=>p4r);return{createGitGraphServices:r}},void 0,import.meta.url),e=t().GitGraph.parser.LangiumParser;go.gitGraph=e},"gitGraph"),eventmodeling:M(async()=>{const{createEventModelingServices:t}=await Rr(async()=>{const{createEventModelingServices:r}=await Promise.resolve().then(()=>g4r);return{createEventModelingServices:r}},void 0,import.meta.url),e=t().EventModel.parser.LangiumParser;go.eventmodeling=e},"eventmodeling"),radar:M(async()=>{const{createRadarServices:t}=await Rr(async()=>{const{createRadarServices:r}=await Promise.resolve().then(()=>m4r);return{createRadarServices:r}},void 0,import.meta.url),e=t().Radar.parser.LangiumParser;go.radar=e},"radar"),railroad:M(async()=>{const{createRailroadServices:t}=await Rr(async()=>{const{createRailroadServices:r}=await Promise.resolve().then(()=>y4r);return{createRailroadServices:r}},void 0,import.meta.url),e=t().Railroad.parser.LangiumParser;go.railroad=e},"railroad"),railroadEbnf:M(async()=>{const{createRailroadEbnfServices:t}=await Rr(async()=>{const{createRailroadEbnfServices:r}=await Promise.resolve().then(()=>v4r);return{createRailroadEbnfServices:r}},void 0,import.meta.url),e=t().RailroadEbnf.parser.LangiumParser;go.railroadEbnf=e},"railroadEbnf"),railroadAbnf:M(async()=>{const{createRailroadAbnfServices:t}=await Rr(async()=>{const{createRailroadAbnfServices:r}=await Promise.resolve().then(()=>b4r);return{createRailroadAbnfServices:r}},void 0,import.meta.url),e=t().RailroadAbnf.parser.LangiumParser;go.railroadAbnf=e},"railroadAbnf"),railroadPeg:M(async()=>{const{createRailroadPegServices:t}=await Rr(async()=>{const{createRailroadPegServices:r}=await Promise.resolve().then(()=>x4r);return{createRailroadPegServices:r}},void 0,import.meta.url),e=t().RailroadPeg.parser.LangiumParser;go.railroadPeg=e},"railroadPeg"),treemap:M(async()=>{const{createTreemapServices:t}=await Rr(async()=>{const{createTreemapServices:r}=await Promise.resolve().then(()=>w4r);return{createTreemapServices:r}},void 0,import.meta.url),e=t().Treemap.parser.LangiumParser;go.treemap=e},"treemap"),wardley:M(async()=>{const{createWardleyServices:t}=await Rr(async()=>{const{createWardleyServices:r}=await Promise.resolve().then(()=>T4r);return{createWardleyServices:r}},void 0,import.meta.url),e=t().Wardley.parser.LangiumParser;go.wardley=e},"wardley"),cynefin:M(async()=>{const{createCynefinServices:t}=await Rr(async()=>{const{createCynefinServices:r}=await Promise.resolve().then(()=>C4r);return{createCynefinServices:r}},void 0,import.meta.url),e=t().Cynefin.parser.LangiumParser;go.cynefin=e},"cynefin")};async function zu(t,e){const r=Rhr[t];if(!r)throw new Error(`Unknown diagram type: ${t}`);go[t]||await r();const i=go[t].parse(e);if(i.lexerErrors.length>0||i.parserErrors.length>0)throw new e7(i);return i.value}M(zu,"parse");var oT,e7=(oT=class extends Error{constructor(e){const r=e.lexerErrors.map(i=>{const s=i.line!==void 0&&!isNaN(i.line)?i.line:"?",a=i.column!==void 0&&!isNaN(i.column)?i.column:"?";return`Lexer error on line ${s}, column ${a}: ${i.message}`}).join(``),n=e.parserErrors.map(i=>{const s=i.token.startLine!==void 0&&!isNaN(i.token.startLine)?i.token.startLine:"?",a=i.token.startColumn!==void 0&&!isNaN(i.token.startColumn)?i.token.startColumn:"?";return`Parse error on line ${s}, column ${a}: ${i.message}`}).join(``);super(`Parsing failed: ${r} ${n}`),this.result=e}},M(oT,"MermaidParseError"),oT),Ci={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},_hr=Sn.gitGraph,Rv=w(()=>es({..._hr,...xr().gitGraph}),"getConfig"),Jt=new Aee(()=>{const t=Rv(),e=t.mainBranchName,r=t.mainBranchOrder;return{mainBranchName:e,commits:new Map,head:null,branchConfig:new Map([[e,{name:e,order:r}]]),branches:new Map([[e,null]]),currBranch:e,direction:"LR",seq:0,options:{}}});function IP(){return nke({length:7})}w(IP,"getID");function dWe(t,e){const r=Object.create(null);return t.reduce((n,i)=>{const s=e(i);return r[s]||(r[s]=!0,n.push(i)),n},[])}w(dWe,"uniqBy");var Lhr=w(function(t){Jt.records.direction=t},"setDirection"),Ihr=w(function(t){de.debug("options str",t),t=t==null?void 0:t.trim(),t=t||"{}";try{Jt.records.options=JSON.parse(t)}catch(e){de.error("error while parsing gitGraph options",e.message)}},"setOptions"),Nhr=w(function(){return Jt.records.options},"getOptions"),Dhr=w(function(t){let e=t.msg,r=t.id;const n=t.type;let i=t.tags;de.info("commit",e,r,n,i),de.debug("Entering commit:",e,r,n,i);const s=Rv();r=Vt.sanitizeText(r,s),e=Vt.sanitizeText(e,s),i=i==null?void 0:i.map(o=>Vt.sanitizeText(o,s));const a={id:r||Jt.records.seq+"-"+IP(),message:e,seq:Jt.records.seq++,type:n??Ci.NORMAL,tags:i??[],parents:Jt.records.head==null?[]:[Jt.records.head.id],branch:Jt.records.currBranch};Jt.records.head=a,de.info("main branch",s.mainBranchName),Jt.records.commits.has(a.id)&&de.warn(`Commit ID ${a.id} already exists`),Jt.records.commits.set(a.id,a),Jt.records.branches.set(Jt.records.currBranch,a.id),de.debug("in pushCommit "+a.id)},"commit"),Ohr=w(function(t){let e=t.name;const r=t.order;if(e=Vt.sanitizeText(e,Rv()),Jt.records.branches.has(e))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${e}")`);Jt.records.branches.set(e,Jt.records.head!=null?Jt.records.head.id:null),Jt.records.branchConfig.set(e,{name:e,order:r}),fWe(e),de.debug("in createBranch")},"branch"),Phr=w(t=>{let e=t.branch,r=t.id;const n=t.type,i=t.tags,s=Rv();e=Vt.sanitizeText(e,s),r&&(r=Vt.sanitizeText(r,s));const a=Jt.records.branches.get(Jt.records.currBranch),o=Jt.records.branches.get(e),l=a?Jt.records.commits.get(a):void 0,u=o?Jt.records.commits.get(o):void 0;if(l&&u&&l.branch===e)throw new Error(`Cannot merge branch '${e}' into itself.`);if(Jt.records.currBranch===e){const f=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},f}if(l===void 0||!l){const f=new Error(`Incorrect usage of "merge". Current branch (${Jt.records.currBranch})has no commits`);throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["commit"]},f}if(!Jt.records.branches.has(e)){const f=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") does not exist");throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:[`branch ${e}`]},f}if(u===void 0||!u){const f=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") has no commits");throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:['"commit"']},f}if(l===u){const f=new Error('Incorrect usage of "merge". Both branches have same head');throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},f}if(r&&Jt.records.commits.has(r)){const f=new Error('Incorrect usage of "merge". Commit with id:'+r+" already exists, use different custom id");throw f.hash={text:`merge ${e} ${r} ${n} ${i==null?void 0:i.join(" ")}`,token:`merge ${e} ${r} ${n} ${i==null?void 0:i.join(" ")}`,expected:[`merge ${e} ${r}_UNIQUE ${n} ${i==null?void 0:i.join(" ")}`]},f}const h=o||"",d={id:r||`${Jt.records.seq}-${IP()}`,message:`merged branch ${e} into ${Jt.records.currBranch}`,seq:Jt.records.seq++,parents:Jt.records.head==null?[]:[Jt.records.head.id,h],branch:Jt.records.currBranch,type:Ci.MERGE,customType:n,customId:!!r,tags:i??[]};Jt.records.head=d,Jt.records.commits.set(d.id,d),Jt.records.branches.set(Jt.records.currBranch,d.id),de.debug(Jt.records.branches),de.debug("in mergeBranch")},"merge"),$hr=w(function(t){let e=t.id,r=t.targetId,n=t.tags,i=t.parent;de.debug("Entering cherryPick:",e,r,n);const s=Rv();if(e=Vt.sanitizeText(e,s),r=Vt.sanitizeText(r,s),n=n==null?void 0:n.map(l=>Vt.sanitizeText(l,s)),i=Vt.sanitizeText(i,s),!e||!Jt.records.commits.has(e)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},l}const a=Jt.records.commits.get(e);if(a===void 0||!a)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(i&&!(Array.isArray(a.parents)&&a.parents.includes(i)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const o=a.branch;if(a.type===Ci.MERGE&&!i)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!r||!Jt.records.commits.has(r)){if(o===Jt.records.currBranch){const d=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const l=Jt.records.branches.get(Jt.records.currBranch);if(l===void 0||!l){const d=new Error(`Incorrect usage of "cherry-pick". Current branch (${Jt.records.currBranch})has no commits`);throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const u=Jt.records.commits.get(l);if(u===void 0||!u){const d=new Error(`Incorrect usage of "cherry-pick". Current branch (${Jt.records.currBranch})has no commits`);throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const h={id:Jt.records.seq+"-"+IP(),message:`cherry-picked ${a==null?void 0:a.message} into ${Jt.records.currBranch}`,seq:Jt.records.seq++,parents:Jt.records.head==null?[]:[Jt.records.head.id,a.id],branch:Jt.records.currBranch,type:Ci.CHERRY_PICK,tags:n?n.filter(Boolean):[`cherry-pick:${a.id}${a.type===Ci.MERGE?`|parent:${i}`:""}`]};Jt.records.head=h,Jt.records.commits.set(h.id,h),Jt.records.branches.set(Jt.records.currBranch,h.id),de.debug(Jt.records.branches),de.debug("in cherryPick")}},"cherryPick"),fWe=w(function(t){if(t=Vt.sanitizeText(t,Rv()),Jt.records.branches.has(t)){Jt.records.currBranch=t;const e=Jt.records.branches.get(Jt.records.currBranch);e===void 0||!e?Jt.records.head=null:Jt.records.head=Jt.records.commits.get(e)??null}else{const e=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${t}")`);throw e.hash={text:`checkout ${t}`,token:`checkout ${t}`,expected:[`branch ${t}`]},e}},"checkout");function lY(t,e,r){const n=t.indexOf(e);n===-1?t.push(r):t.splice(n,1,r)}w(lY,"upsert");function vne(t){const e=t.reduce((i,s)=>i.seq>s.seq?i:s,t[0]);let r="";t.forEach(function(i){i===e?r+=" *":r+=" |"});const n=[r,e.id,e.seq];for(const i in Jt.records.branches)Jt.records.branches.get(i)===e.id&&n.push(i);if(de.debug(n.join(" ")),e.parents&&e.parents.length==2&&e.parents[0]&&e.parents[1]){const i=Jt.records.commits.get(e.parents[0]);lY(t,e,i),e.parents[1]&&t.push(Jt.records.commits.get(e.parents[1]))}else{if(e.parents.length==0)return;if(e.parents[0]){const i=Jt.records.commits.get(e.parents[0]);lY(t,e,i)}}t=dWe(t,i=>i.id),vne(t)}w(vne,"prettyPrintCommitHistory");var Bhr=w(function(){de.debug(Jt.records.commits);const t=pWe()[0];vne([t])},"prettyPrint"),Fhr=w(function(){Jt.reset(),Ri()},"clear"),zhr=w(function(){return[...Jt.records.branchConfig.values()].map((e,r)=>e.order!==null&&e.order!==void 0?e:{...e,order:parseFloat(`0.${r}`)}).sort((e,r)=>(e.order??0)-(r.order??0)).map(({name:e})=>({name:e}))},"getBranchesAsObjArray"),Vhr=w(function(){return Jt.records.branches},"getBranches"),Hhr=w(function(){return Jt.records.commits},"getCommits"),pWe=w(function(){const t=[...Jt.records.commits.values()];return t.forEach(function(e){de.debug(e.id)}),t.sort((e,r)=>e.seq-r.seq),t},"getCommitsArray"),Ghr=w(function(){return Jt.records.currBranch},"getCurrentBranch"),Whr=w(function(){return Jt.records.direction},"getDirection"),qhr=w(function(){return Jt.records.head},"getHead"),gWe={commitType:Ci,getConfig:Rv,setDirection:Lhr,setOptions:Ihr,getOptions:Nhr,commit:Dhr,branch:Ohr,merge:Phr,cherryPick:$hr,checkout:fWe,prettyPrint:Bhr,clear:Fhr,getBranchesAsObjArray:zhr,getBranches:Vhr,getCommits:Hhr,getCommitsArray:pWe,getCurrentBranch:Ghr,getDirection:Whr,getHead:qhr,setAccTitle:Hi,getAccTitle:ts,getAccDescription:ns,setAccDescription:rs,setDiagramTitle:Ji,getDiagramTitle:qi},Uhr=w((t,e)=>{Gl(t,e),t.dir&&e.setDirection(t.dir);for(const r of t.statements)jhr(r,e)},"populate"),jhr=w((t,e)=>{const n={Commit:w(i=>e.commit(Yhr(i)),"Commit"),Branch:w(i=>e.branch(Xhr(i)),"Branch"),Merge:w(i=>e.merge(Khr(i)),"Merge"),Checkout:w(i=>e.checkout(Zhr(i)),"Checkout"),CherryPicking:w(i=>e.cherryPick(Qhr(i)),"CherryPicking")}[t.$type];n?n(t):de.error(`Unknown statement type: ${t.$type}`)},"parseStatement"),Yhr=w(t=>({id:t.id,msg:t.message??"",type:t.type!==void 0?Ci[t.type]:Ci.NORMAL,tags:t.tags??void 0}),"parseCommit"),Xhr=w(t=>({name:t.name,order:t.order??0}),"parseBranch"),Khr=w(t=>({branch:t.branch,id:t.id??"",type:t.type!==void 0?Ci[t.type]:void 0,tags:t.tags??void 0}),"parseMerge"),Zhr=w(t=>t.branch,"parseCheckout"),Qhr=w(t=>{var r;return{id:t.id,targetId:"",tags:((r=t.tags)==null?void 0:r.length)===0?void 0:t.tags,parent:t.parent}},"parseCherryPicking"),Jhr={parse:w(async t=>{const e=await zu("gitGraph",t);de.debug(e),Uhr(e,gWe)},"parse")},Zp=10,Qp=40,rd=4,If=2,M1=8,NP=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),cY=12,bne=new Set(["redux-color","redux-dark-color"]),edr=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),R1=w((t,e,r=!1)=>r&&t>0?(t-1)%(e-1)+1:t%e,"calcColorIndex"),cc=new Map,pc=new Map,HI=30,Mk=new Map,GI=[],Nf=0,In="LR",tdr=w(()=>{cc.clear(),pc.clear(),Mk.clear(),Nf=0,GI=[],In="LR"},"clear"),mWe=w(t=>{const e=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof t=="string"?t.split(/\\n|\n|<br\s*\/?>/gi):t).forEach(n=>{const i=document.createElementNS("http://www.w3.org/2000/svg","tspan");i.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),i.setAttribute("dy","1em"),i.setAttribute("x","0"),i.setAttribute("class","row"),i.textContent=n.trim(),e.appendChild(i)}),e},"drawText"),yWe=w(t=>{let e,r,n;return In==="BT"?(r=w((i,s)=>i<=s,"comparisonFunc"),n=1/0):(r=w((i,s)=>i>=s,"comparisonFunc"),n=0),t.forEach(i=>{var a,o;const s=In==="TB"||In=="BT"?(a=pc.get(i))==null?void 0:a.y:(o=pc.get(i))==null?void 0:o.x;s!==void 0&&r(s,n)&&(e=i,n=s)}),e},"findClosestParent"),rdr=w(t=>{let e="",r=1/0;return t.forEach(n=>{const i=pc.get(n).y;i<=r&&(e=n,r=i)}),e||void 0},"findClosestParentBT"),ndr=w((t,e,r)=>{let n=r,i=r;const s=[];t.forEach(a=>{const o=e.get(a);if(!o)throw new Error(`Commit not found for key ${a}`);o.parents.length?(n=sdr(o),i=Math.max(n,i)):s.push(o),adr(o,n)}),n=i,s.forEach(a=>{odr(a,n,r)}),t.forEach(a=>{const o=e.get(a);if(o!=null&&o.parents.length){const l=rdr(o.parents);n=pc.get(l).y-Qp,n<=i&&(i=n);const u=cc.get(o.branch).pos,h=n-Zp;pc.set(o.id,{x:u,y:h})}})},"setParallelBTPos"),idr=w(t=>{var n;const e=yWe(t.parents.filter(i=>i!==null));if(!e)throw new Error(`Closest parent not found for commit ${t.id}`);const r=(n=pc.get(e))==null?void 0:n.y;if(r===void 0)throw new Error(`Closest parent position not found for commit ${t.id}`);return r},"findClosestParentPos"),sdr=w(t=>idr(t)+Qp,"calculateCommitPosition"),adr=w((t,e)=>{const r=cc.get(t.branch);if(!r)throw new Error(`Branch not found for commit ${t.id}`);const n=r.pos,i=e+Zp;return pc.set(t.id,{x:n,y:i}),{x:n,y:i}},"setCommitPosition"),odr=w((t,e,r)=>{const n=cc.get(t.branch);if(!n)throw new Error(`Branch not found for commit ${t.id}`);const i=e+r,s=n.pos;pc.set(t.id,{x:s,y:i})},"setRootPosition"),ldr=w((t,e,r,n,i,s)=>{const{theme:a}=Ve(),o=NP.has(a??""),l=bne.has(a??""),u=edr.has(a??"");if(s===Ci.HIGHLIGHT)t.append("rect").attr("x",r.x-10+(o?3:0)).attr("y",r.y-10+(o?3:0)).attr("width",o?14:20).attr("height",o?14:20).attr("class",`commit ${e.id} commit-highlight${R1(i,M1,l)} ${n}-outer`),t.append("rect").attr("x",r.x-6+(o?2:0)).attr("y",r.y-6+(o?2:0)).attr("width",o?8:12).attr("height",o?8:12).attr("class",`commit ${e.id} commit${R1(i,M1,l)} ${n}-inner`);else if(s===Ci.CHERRY_PICK)t.append("circle").attr("cx",r.x).attr("cy",r.y).attr("r",o?7:10).attr("class",`commit ${e.id} ${n}`),t.append("circle").attr("cx",r.x-3).attr("cy",r.y+2).attr("r",o?2.5:2.75).attr("fill",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`),t.append("circle").attr("cx",r.x+3).attr("cy",r.y+2).attr("r",o?2.5:2.75).attr("fill",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`),t.append("line").attr("x1",r.x+3).attr("y1",r.y+1).attr("x2",r.x).attr("y2",r.y-5).attr("stroke",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`),t.append("line").attr("x1",r.x-3).attr("y1",r.y+1).attr("x2",r.x).attr("y2",r.y-5).attr("stroke",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`);else{const h=t.append("circle");if(h.attr("cx",r.x),h.attr("cy",r.y),h.attr("r",o?7:10),h.attr("class",`commit ${e.id} commit${R1(i,M1,l)}`),s===Ci.MERGE){const d=t.append("circle");d.attr("cx",r.x),d.attr("cy",r.y),d.attr("r",o?5:6),d.attr("class",`commit ${n} ${e.id} commit${R1(i,M1,l)}`)}if(s===Ci.REVERSE){const d=t.append("path"),f=o?4:5;d.attr("d",`M ${r.x-f},${r.y-f}L${r.x+f},${r.y+f}M${r.x-f},${r.y+f}L${r.x+f},${r.y-f}`).attr("class",`commit ${n} ${e.id} commit${R1(i,M1,l)}`)}}},"drawCommitBullet"),cdr=w((t,e,r,n,i)=>{var s;if(e.type!==Ci.CHERRY_PICK&&(e.customId&&e.type===Ci.MERGE||e.type!==Ci.MERGE)&&i.showCommitLabel){const a=t.append("g"),o=a.insert("rect").attr("class","commit-label-bkg"),l=a.append("text").attr("x",n).attr("y",r.y+25).attr("class","commit-label").text(e.id),u=(s=l.node())==null?void 0:s.getBBox();if(u&&(o.attr("x",r.posWithOffset-u.width/2-If).attr("y",r.y+13.5).attr("width",u.width+2*If).attr("height",u.height+2*If),In==="TB"||In==="BT"?(o.attr("x",r.x-(u.width+4*rd+5)).attr("y",r.y-12),l.attr("x",r.x-(u.width+4*rd)).attr("y",r.y+u.height-12)):l.attr("x",r.posWithOffset-u.width/2),i.rotateCommitLabel))if(In==="TB"||In==="BT")l.attr("transform","rotate(-45, "+r.x+", "+r.y+")"),o.attr("transform","rotate(-45, "+r.x+", "+r.y+")");else{const h=-7.5-(u.width+10)/25*9.5,d=10+u.width/25*8.5;a.attr("transform","translate("+h+", "+d+") rotate(-45, "+n+", "+r.y+")")}}},"drawCommitLabel"),udr=w((t,e,r,n)=>{var i;if(e.tags.length>0){let s=0,a=0,o=0;const l=[];for(const u of e.tags.reverse()){const h=t.insert("polygon"),d=t.append("circle"),f=t.append("text").attr("y",r.y-16-s).attr("class","tag-label").text(u),p=(i=f.node())==null?void 0:i.getBBox();if(!p)throw new Error("Tag bbox not found");a=Math.max(a,p.width),o=Math.max(o,p.height),f.attr("x",r.posWithOffset-p.width/2),l.push({tag:f,hole:d,rect:h,yOffset:s}),s+=20}for(const{tag:u,hole:h,rect:d,yOffset:f}of l){const p=o/2,g=r.y-19.2-f;if(d.attr("class","tag-label-bkg").attr("points",`- ${n-a/2-rd/2},${g+If}+ ${n-a/2-rd/2},${g+If}${n-a/2-rd/2},${g-If}${r.posWithOffset-a/2-rd},${g-p-If}${r.posWithOffset+a/2+rd},${g-p-If}@@ -3760,7 +3760,7 @@ lodash-es/lodash.js:font-family: 'trebuchet ms', verdana, arial, sans-serif;font-family: var(--mermaid-font-family);}-+${n?Edr(t):Adr(t)}.branch {@@ -4181,7 +4181,7 @@ Expecting `+Rt.join(", ")+", got '"+(this.terminals_[lt]||lt)+"'":Or="Parse errostroke: ${t.requirementBorderColor};stroke-width: ${t.requirementBorderSize};}-+.reqTitle, .reqLabel{fill: ${t.requirementTextColor};}@@ -5542,10 +5542,10 @@ Expecting `+ie.join(", ")+", got '"+(this.terminals_[G]||G)+"'":me="Parse errorstroke-dasharray: 8;}.node-icon-text {- display: flex;+ display: flex;align-items: center;}-+.node-icon-text > div {color: #fff;margin: 1px;diff --git a/apps/ios/EditorBundle/index.html b/apps/ios/EditorBundle/index.htmlindex 2b3aff50..2d814803 100644--- a/apps/ios/EditorBundle/index.html+++ b/apps/ios/EditorBundle/index.html@@ -7,7 +7,7 @@content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/><title>EdgeEver Editor</title>- <script type="module" crossorigin>var zYe=Object.defineProperty;var VYe=(t,e,r)=>e in t?zYe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var wr=(t,e,r)=>VYe(t,typeof e!="symbol"?e+"":e,r);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&n(a)}).observe(document,{childList:!0,subtree:!0});function r(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(i){if(i.ep)return;i.ep=!0;const s=r(i);fetch(i.href,s)}})();function gn(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function Nn(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(s=(i<3?a(s):i>3?a(e,r,s):a(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}function aX(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function o(h){try{u(n.next(h))}catch(d){a(d)}}function l(h){try{u(n.throw(h))}catch(d){a(d)}}function u(h){h.done?s(h.value):i(h.value).then(o,l)}u((n=n.apply(t,e||[])).next())})}function HYe(t){t.forEach(e=>{Object.hasOwn(e,"append")||Object.defineProperty(e,"append",{configurable:!0,enumerable:!0,writable:!0,value(...r){const n=document.createDocumentFragment();r.forEach(i=>{const s=i instanceof Node;n.appendChild(s?i:document.createTextNode(String(i)))}),this.appendChild(n)}})})}typeof window=="object"&&window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach);typeof window<"u"&&(t=>{HYe(t)})([Element.prototype,Document.prototype,DocumentFragment.prototype]);var cve=typeof global=="object"&&global&&global.Object===Object&&global,GYe=typeof self=="object"&&self&&self.Object===Object&&self,Ih=cve||GYe||Function("return this")(),Mu=Ih.Symbol,uve=Object.prototype,WYe=uve.hasOwnProperty,qYe=uve.toString,V3=Mu?Mu.toStringTag:void 0;function UYe(t){var e=WYe.call(t,V3),r=t[V3];try{t[V3]=void 0;var n=!0}catch{}var i=qYe.call(t);return n&&(e?t[V3]=r:delete t[V3]),i}var jYe=Object.prototype,YYe=jYe.toString;function XYe(t){return YYe.call(t)}var KYe="[object Null]",ZYe="[object Undefined]",bie=Mu?Mu.toStringTag:void 0;function Hg(t){return t==null?t===void 0?ZYe:KYe:bie&&bie in Object(t)?UYe(t):XYe(t)}function Eh(t){return t!=null&&typeof t=="object"}var QYe="[object Symbol]";function _d(t){return typeof t=="symbol"||Eh(t)&&Hg(t)==QYe}function yb(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}var Bs=Array.isArray,xie=Mu?Mu.prototype:void 0,wie=xie?xie.toString:void 0;function hve(t){if(typeof t=="string")return t;if(Bs(t))return yb(t,hve)+"";if(_d(t))return wie?wie.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}var JYe=/\s/;function eXe(t){for(var e=t.length;e--&&JYe.test(t.charAt(e)););return e}var tXe=/^\s+/;function rXe(t){return t&&t.slice(0,eXe(t)+1).replace(tXe,"")}function $s(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Tie=NaN,nXe=/^[-+]0x[0-9a-f]+$/i,iXe=/^0b[01]+$/i,sXe=/^0o[0-7]+$/i,aXe=parseInt;function vb(t){if(typeof t=="number")return t;if(_d(t))return Tie;if($s(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=$s(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=rXe(t);var r=iXe.test(t);return r||sXe.test(t)?aXe(t.slice(2),r?2:8):nXe.test(t)?Tie:+t}var Cie=1/0,oXe=17976931348623157e292;function bM(t){if(!t)return t===0?t:0;if(t=vb(t),t===Cie||t===-Cie){var e=t<0?-1:1;return e*oXe}return t===t?t:0}function lXe(t){var e=bM(t),r=e%1;return e===e?r?e-r:e:0}function Gg(t){return t}var cXe="[object AsyncFunction]",uXe="[object Function]",hXe="[object GeneratorFunction]",dXe="[object Proxy]";function _S(t){if(!$s(t))return!1;var e=Hg(t);return e==uXe||e==hXe||e==cXe||e==dXe}var KP=Ih["__core-js_shared__"],kie=(function(){var t=/[^.]+$/.exec(KP&&KP.keys&&KP.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function fXe(t){return!!kie&&kie in t}var pXe=Function.prototype,gXe=pXe.toString;function Gy(t){if(t!=null){try{return gXe.call(t)}catch{}try{return t+""}catch{}}return""}var mXe=/[\\^$.*+?()[\]{}|]/g,yXe=/^\[object .+?Constructor\]$/,vXe=Function.prototype,bXe=Object.prototype,xXe=vXe.toString,wXe=bXe.hasOwnProperty,TXe=RegExp("^"+xXe.call(wXe).replace(mXe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function CXe(t){if(!$s(t)||fXe(t))return!1;var e=_S(t)?TXe:yXe;return e.test(Gy(t))}function kXe(t,e){return t==null?void 0:t[e]}function Wy(t,e){var r=kXe(t,e);return CXe(r)?r:void 0}var FV=Wy(Ih,"WeakMap"),Sie=Object.create,SXe=(function(){function t(){}return function(e){if(!$s(e))return{};if(Sie)return Sie(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}})();function dve(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 EXe(){}function fve(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var AXe=800,MXe=16,RXe=Date.now;function _Xe(t){var e=0,r=0;return function(){var n=RXe(),i=MXe-(n-r);if(r=n,i>0){if(++e>=AXe)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Y2(t){return function(){return t}}var s9=(function(){try{var t=Wy(Object,"defineProperty");return t({},"",{}),t}catch{}})(),LXe=s9?function(t,e){return s9(t,"toString",{configurable:!0,enumerable:!1,value:Y2(e),writable:!0})}:Gg,pve=_Xe(LXe);function gve(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}function mve(t,e,r,n){for(var i=t.length,s=r+-1;++s<i;)if(e(t[s],s,t))return s;return-1}function IXe(t){return t!==t}function NXe(t,e,r){for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}function DXe(t,e,r){return e===e?NXe(t,e,r):mve(t,IXe,r)}function yve(t,e){var r=t==null?0:t.length;return!!r&&DXe(t,e,0)>-1}var OXe=9007199254740991,PXe=/^(?:0|[1-9]\d*)$/;function iN(t,e){var r=typeof t;return e=e??OXe,!!e&&(r=="number"||r!="symbol"&&PXe.test(t))&&t>-1&&t%1==0&&t<e}function R6(t,e,r){e=="__proto__"&&s9?s9(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function K5(t,e){return t===e||t!==t&&e!==e}var $Xe=Object.prototype,BXe=$Xe.hasOwnProperty;function sN(t,e,r){var n=t[e];(!(BXe.call(t,e)&&K5(n,r))||r===void 0&&!(e in t))&&R6(t,e,r)}function _6(t,e,r,n){var i=!r;r||(r={});for(var s=-1,a=e.length;++s<a;){var o=e[s],l=void 0;l===void 0&&(l=t[o]),i?R6(r,o,l):sN(r,o,l)}return r}var Eie=Math.max;function vve(t,e,r){return e=Eie(e===void 0?t.length-1:e,0),function(){for(var n=arguments,i=-1,s=Eie(n.length-e,0),a=Array(s);++i<s;)a[i]=n[e+i];i=-1;for(var o=Array(e+1);++i<e;)o[i]=n[i];return o[e]=r(a),dve(t,this,o)}}function Z5(t,e){return pve(vve(t,e,Gg),t+"")}var FXe=9007199254740991;function oX(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=FXe}function Wg(t){return t!=null&&oX(t.length)&&!_S(t)}function LS(t,e,r){if(!$s(r))return!1;var n=typeof e;return(n=="number"?Wg(r)&&iN(e,r.length):n=="string"&&e in r)?K5(r[e],t):!1}function bve(t){return Z5(function(e,r){var n=-1,i=r.length,s=i>1?r[i-1]:void 0,a=i>2?r[2]:void 0;for(s=t.length>3&&typeof s=="function"?(i--,s):void 0,a&&LS(r[0],r[1],a)&&(s=i<3?void 0:s,i=1),e=Object(e);++n<i;){var o=r[n];o&&t(e,o,n,s)}return e})}var zXe=Object.prototype;function aN(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||zXe;return t===r}function VXe(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var HXe="[object Arguments]";function Aie(t){return Eh(t)&&Hg(t)==HXe}var xve=Object.prototype,GXe=xve.hasOwnProperty,WXe=xve.propertyIsEnumerable,NT=Aie((function(){return arguments})())?Aie:function(t){return Eh(t)&&GXe.call(t,"callee")&&!WXe.call(t,"callee")};function qXe(){return!1}var wve=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Mie=wve&&typeof module=="object"&&module&&!module.nodeType&&module,UXe=Mie&&Mie.exports===wve,Rie=UXe?Ih.Buffer:void 0,jXe=Rie?Rie.isBuffer:void 0,DT=jXe||qXe,YXe="[object Arguments]",XXe="[object Array]",KXe="[object Boolean]",ZXe="[object Date]",QXe="[object Error]",JXe="[object Function]",eKe="[object Map]",tKe="[object Number]",rKe="[object Object]",nKe="[object RegExp]",iKe="[object Set]",sKe="[object String]",aKe="[object WeakMap]",oKe="[object ArrayBuffer]",lKe="[object DataView]",cKe="[object Float32Array]",uKe="[object Float64Array]",hKe="[object Int8Array]",dKe="[object Int16Array]",fKe="[object Int32Array]",pKe="[object Uint8Array]",gKe="[object Uint8ClampedArray]",mKe="[object Uint16Array]",yKe="[object Uint32Array]",Ui={};Ui[cKe]=Ui[uKe]=Ui[hKe]=Ui[dKe]=Ui[fKe]=Ui[pKe]=Ui[gKe]=Ui[mKe]=Ui[yKe]=!0;Ui[YXe]=Ui[XXe]=Ui[oKe]=Ui[KXe]=Ui[lKe]=Ui[ZXe]=Ui[QXe]=Ui[JXe]=Ui[eKe]=Ui[tKe]=Ui[rKe]=Ui[nKe]=Ui[iKe]=Ui[sKe]=Ui[aKe]=!1;function vKe(t){return Eh(t)&&oX(t.length)&&!!Ui[Hg(t)]}function oN(t){return function(e){return t(e)}}var Tve=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Dk=Tve&&typeof module=="object"&&module&&!module.nodeType&&module,bKe=Dk&&Dk.exports===Tve,ZP=bKe&&cve.process,OT=(function(){try{var t=Dk&&Dk.require&&Dk.require("util").types;return t||ZP&&ZP.binding&&ZP.binding("util")}catch{}})(),_ie=OT&&OT.isTypedArray,lN=_ie?oN(_ie):vKe,xKe=Object.prototype,wKe=xKe.hasOwnProperty;function Cve(t,e){var r=Bs(t),n=!r&&NT(t),i=!r&&!n&&DT(t),s=!r&&!n&&!i&&lN(t),a=r||n||i||s,o=a?VXe(t.length,String):[],l=o.length;for(var u in t)(e||wKe.call(t,u))&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||s&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||iN(u,l)))&&o.push(u);return o}function kve(t,e){return function(r){return t(e(r))}}var TKe=kve(Object.keys,Object),CKe=Object.prototype,kKe=CKe.hasOwnProperty;function Sve(t){if(!aN(t))return TKe(t);var e=[];for(var r in Object(t))kKe.call(t,r)&&r!="constructor"&&e.push(r);return e}function Lc(t){return Wg(t)?Cve(t):Sve(t)}function SKe(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var EKe=Object.prototype,AKe=EKe.hasOwnProperty;function MKe(t){if(!$s(t))return SKe(t);var e=aN(t),r=[];for(var n in t)n=="constructor"&&(e||!AKe.call(t,n))||r.push(n);return r}function qy(t){return Wg(t)?Cve(t,!0):MKe(t)}var RKe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,_Ke=/^\w*$/;function lX(t,e){if(Bs(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||_d(t)?!0:_Ke.test(t)||!RKe.test(t)||e!=null&&t in Object(e)}var IS=Wy(Object,"create");function LKe(){this.__data__=IS?IS(null):{},this.size=0}function IKe(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var NKe="__lodash_hash_undefined__",DKe=Object.prototype,OKe=DKe.hasOwnProperty;function PKe(t){var e=this.__data__;if(IS){var r=e[t];return r===NKe?void 0:r}return OKe.call(e,t)?e[t]:void 0}var $Ke=Object.prototype,BKe=$Ke.hasOwnProperty;function FKe(t){var e=this.__data__;return IS?e[t]!==void 0:BKe.call(e,t)}var zKe="__lodash_hash_undefined__";function VKe(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=IS&&e===void 0?zKe:e,this}function uy(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])}}uy.prototype.clear=LKe;uy.prototype.delete=IKe;uy.prototype.get=PKe;uy.prototype.has=FKe;uy.prototype.set=VKe;function HKe(){this.__data__=[],this.size=0}function cN(t,e){for(var r=t.length;r--;)if(K5(t[r][0],e))return r;return-1}var GKe=Array.prototype,WKe=GKe.splice;function qKe(t){var e=this.__data__,r=cN(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():WKe.call(e,r,1),--this.size,!0}function UKe(t){var e=this.__data__,r=cN(e,t);return r<0?void 0:e[r][1]}function jKe(t){return cN(this.__data__,t)>-1}function YKe(t,e){var r=this.__data__,n=cN(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function $0(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])}}$0.prototype.clear=HKe;$0.prototype.delete=qKe;$0.prototype.get=UKe;$0.prototype.has=jKe;$0.prototype.set=YKe;var NS=Wy(Ih,"Map");function XKe(){this.size=0,this.__data__={hash:new uy,map:new(NS||$0),string:new uy}}function KKe(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function uN(t,e){var r=t.__data__;return KKe(e)?r[typeof e=="string"?"string":"hash"]:r.map}function ZKe(t){var e=uN(this,t).delete(t);return this.size-=e?1:0,e}function QKe(t){return uN(this,t).get(t)}function JKe(t){return uN(this,t).has(t)}function eZe(t,e){var r=uN(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function B0(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])}}B0.prototype.clear=XKe;B0.prototype.delete=ZKe;B0.prototype.get=QKe;B0.prototype.has=JKe;B0.prototype.set=eZe;var tZe="Expected a function";function cX(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(tZe);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 a=t.apply(this,n);return r.cache=s.set(i,a)||s,a};return r.cache=new(cX.Cache||B0),r}cX.Cache=B0;var rZe=500;function nZe(t){var e=cX(t,function(n){return r.size===rZe&&r.clear(),n}),r=e.cache;return e}var iZe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,sZe=/\\(\\)?/g,aZe=nZe(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(iZe,function(r,n,i,s){e.push(i?s.replace(sZe,"$1"):n||r)}),e});function Q5(t){return t==null?"":hve(t)}function hN(t,e){return Bs(t)?t:lX(t,e)?[t]:aZe(Q5(t))}function L6(t){if(typeof t=="string"||_d(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function dN(t,e){e=hN(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[L6(e[r++])];return r&&r==n?t:void 0}function oZe(t,e,r){var n=t==null?void 0:dN(t,e);return n===void 0?r:n}function uX(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}var Lie=Mu?Mu.isConcatSpreadable:void 0;function lZe(t){return Bs(t)||NT(t)||!!(Lie&&t&&t[Lie])}function fN(t,e,r,n,i){var s=-1,a=t.length;for(r||(r=lZe),i||(i=[]);++s<a;){var o=t[s];r(o)?uX(i,o):n||(i[i.length]=o)}return i}function J5(t){var e=t==null?0:t.length;return e?fN(t):[]}function cZe(t){return pve(vve(t,void 0,J5),t+"")}var hX=kve(Object.getPrototypeOf,Object),uZe="[object Object]",hZe=Function.prototype,dZe=Object.prototype,Eve=hZe.toString,fZe=dZe.hasOwnProperty,pZe=Eve.call(Object);function Nh(t){if(!Eh(t)||Hg(t)!=uZe)return!1;var e=hX(t);if(e===null)return!0;var r=fZe.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Eve.call(r)==pZe}function gZe(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),r=r>i?i:r,r<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var s=Array(i);++n<i;)s[n]=t[n+e];return s}function mZe(t,e,r){var n=t.length;return r=r===void 0?n:r,!e&&r>=n?t:gZe(t,e,r)}var yZe="\\ud800-\\udfff",vZe="\\u0300-\\u036f",bZe="\\ufe20-\\ufe2f",xZe="\\u20d0-\\u20ff",wZe=vZe+bZe+xZe,TZe="\\ufe0e\\ufe0f",CZe="\\u200d",kZe=RegExp("["+CZe+yZe+wZe+TZe+"]");function Ave(t){return kZe.test(t)}function SZe(t){return t.split("")}var Mve="\\ud800-\\udfff",EZe="\\u0300-\\u036f",AZe="\\ufe20-\\ufe2f",MZe="\\u20d0-\\u20ff",RZe=EZe+AZe+MZe,_Ze="\\ufe0e\\ufe0f",LZe="["+Mve+"]",zV="["+RZe+"]",VV="\\ud83c[\\udffb-\\udfff]",IZe="(?:"+zV+"|"+VV+")",Rve="[^"+Mve+"]",_ve="(?:\\ud83c[\\udde6-\\uddff]){2}",Lve="[\\ud800-\\udbff][\\udc00-\\udfff]",NZe="\\u200d",Ive=IZe+"?",Nve="["+_Ze+"]?",DZe="(?:"+NZe+"(?:"+[Rve,_ve,Lve].join("|")+")"+Nve+Ive+")*",OZe=Nve+Ive+DZe,PZe="(?:"+[Rve+zV+"?",zV,_ve,Lve,LZe].join("|")+")",$Ze=RegExp(VV+"(?="+VV+")|"+PZe+OZe,"g");function BZe(t){return t.match($Ze)||[]}function FZe(t){return Ave(t)?BZe(t):SZe(t)}function Dve(t){return function(e){e=Q5(e);var r=Ave(e)?FZe(e):void 0,n=r?r[0]:e.charAt(0),i=r?mZe(r,1).join(""):e.slice(1);return n[t]()+i}}var a9=Dve("toUpperCase");function zZe(t){return a9(Q5(t).toLowerCase())}function Ove(t,e,r,n){var i=-1,s=t==null?0:t.length;for(n&&s&&(r=t[++i]);++i<s;)r=e(r,t[i],i,t);return r}function VZe(t){return function(e){return t==null?void 0:t[e]}}var HZe={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},GZe=VZe(HZe),WZe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,qZe="\\u0300-\\u036f",UZe="\\ufe20-\\ufe2f",jZe="\\u20d0-\\u20ff",YZe=qZe+UZe+jZe,XZe="["+YZe+"]",KZe=RegExp(XZe,"g");function ZZe(t){return t=Q5(t),t&&t.replace(WZe,GZe).replace(KZe,"")}var QZe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function JZe(t){return t.match(QZe)||[]}var eQe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function tQe(t){return eQe.test(t)}var Pve="\\ud800-\\udfff",rQe="\\u0300-\\u036f",nQe="\\ufe20-\\ufe2f",iQe="\\u20d0-\\u20ff",sQe=rQe+nQe+iQe,$ve="\\u2700-\\u27bf",Bve="a-z\\xdf-\\xf6\\xf8-\\xff",aQe="\\xac\\xb1\\xd7\\xf7",oQe="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",lQe="\\u2000-\\u206f",cQe=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Fve="A-Z\\xc0-\\xd6\\xd8-\\xde",uQe="\\ufe0e\\ufe0f",zve=aQe+oQe+lQe+cQe,Vve="['’]",Iie="["+zve+"]",hQe="["+sQe+"]",Hve="\\d+",dQe="["+$ve+"]",Gve="["+Bve+"]",Wve="[^"+Pve+zve+Hve+$ve+Bve+Fve+"]",fQe="\\ud83c[\\udffb-\\udfff]",pQe="(?:"+hQe+"|"+fQe+")",gQe="[^"+Pve+"]",qve="(?:\\ud83c[\\udde6-\\uddff]){2}",Uve="[\\ud800-\\udbff][\\udc00-\\udfff]",f2="["+Fve+"]",mQe="\\u200d",Nie="(?:"+Gve+"|"+Wve+")",yQe="(?:"+f2+"|"+Wve+")",Die="(?:"+Vve+"(?:d|ll|m|re|s|t|ve))?",Oie="(?:"+Vve+"(?:D|LL|M|RE|S|T|VE))?",jve=pQe+"?",Yve="["+uQe+"]?",vQe="(?:"+mQe+"(?:"+[gQe,qve,Uve].join("|")+")"+Yve+jve+")*",bQe="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",xQe="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",wQe=Yve+jve+vQe,TQe="(?:"+[dQe,qve,Uve].join("|")+")"+wQe,CQe=RegExp([f2+"?"+Gve+"+"+Die+"(?="+[Iie,f2,"$"].join("|")+")",yQe+"+"+Oie+"(?="+[Iie,f2+Nie,"$"].join("|")+")",f2+"?"+Nie+"+"+Die,f2+"+"+Oie,xQe,bQe,Hve,TQe].join("|"),"g");function kQe(t){return t.match(CQe)||[]}function SQe(t,e,r){return t=Q5(t),e=e,e===void 0?tQe(t)?kQe(t):JZe(t):t.match(e)||[]}var EQe="['’]",AQe=RegExp(EQe,"g");function Xve(t){return function(e){return Ove(SQe(ZZe(e).replace(AQe,"")),t,"")}}var I6=Xve(function(t,e,r){return e=e.toLowerCase(),t+(r?zZe(e):e)});function Pie(){if(!arguments.length)return[];var t=arguments[0];return Bs(t)?t:[t]}function MQe(t,e,r){return t===t&&(r!==void 0&&(t=t<=r?t:r),e!==void 0&&(t=t>=e?t:e)),t}function Y1(t,e,r){return r===void 0&&(r=e,e=void 0),r!==void 0&&(r=vb(r),r=r===r?r:0),e!==void 0&&(e=vb(e),e=e===e?e:0),MQe(vb(t),e,r)}function RQe(){this.__data__=new $0,this.size=0}function _Qe(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function LQe(t){return this.__data__.get(t)}function IQe(t){return this.__data__.has(t)}var NQe=200;function DQe(t,e){var r=this.__data__;if(r instanceof $0){var n=r.__data__;if(!NS||n.length<NQe-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new B0(n)}return r.set(t,e),this.size=r.size,this}function hh(t){var e=this.__data__=new $0(t);this.size=e.size}hh.prototype.clear=RQe;hh.prototype.delete=_Qe;hh.prototype.get=LQe;hh.prototype.has=IQe;hh.prototype.set=DQe;function OQe(t,e){return t&&_6(e,Lc(e),t)}function PQe(t,e){return t&&_6(e,qy(e),t)}var Kve=typeof exports=="object"&&exports&&!exports.nodeType&&exports,$ie=Kve&&typeof module=="object"&&module&&!module.nodeType&&module,$Qe=$ie&&$ie.exports===Kve,Bie=$Qe?Ih.Buffer:void 0,Fie=Bie?Bie.allocUnsafe:void 0;function Zve(t,e){if(e)return t.slice();var r=t.length,n=Fie?Fie(r):new t.constructor(r);return t.copy(n),n}function Qve(t,e){for(var r=-1,n=t==null?0:t.length,i=0,s=[];++r<n;){var a=t[r];e(a,r,t)&&(s[i++]=a)}return s}function Jve(){return[]}var BQe=Object.prototype,FQe=BQe.propertyIsEnumerable,zie=Object.getOwnPropertySymbols,dX=zie?function(t){return t==null?[]:(t=Object(t),Qve(zie(t),function(e){return FQe.call(t,e)}))}:Jve;function zQe(t,e){return _6(t,dX(t),e)}var VQe=Object.getOwnPropertySymbols,e2e=VQe?function(t){for(var e=[];t;)uX(e,dX(t)),t=hX(t);return e}:Jve;function HQe(t,e){return _6(t,e2e(t),e)}function t2e(t,e,r){var n=e(t);return Bs(t)?n:uX(n,r(t))}function HV(t){return t2e(t,Lc,dX)}function GQe(t){return t2e(t,qy,e2e)}var GV=Wy(Ih,"DataView"),WV=Wy(Ih,"Promise"),bb=Wy(Ih,"Set"),Vie="[object Map]",WQe="[object Object]",Hie="[object Promise]",Gie="[object Set]",Wie="[object WeakMap]",qie="[object DataView]",qQe=Gy(GV),UQe=Gy(NS),jQe=Gy(WV),YQe=Gy(bb),XQe=Gy(FV),du=Hg;(GV&&du(new GV(new ArrayBuffer(1)))!=qie||NS&&du(new NS)!=Vie||WV&&du(WV.resolve())!=Hie||bb&&du(new bb)!=Gie||FV&&du(new FV)!=Wie)&&(du=function(t){var e=Hg(t),r=e==WQe?t.constructor:void 0,n=r?Gy(r):"";if(n)switch(n){case qQe:return qie;case UQe:return Vie;case jQe:return Hie;case YQe:return Gie;case XQe:return Wie}return e});var KQe=Object.prototype,ZQe=KQe.hasOwnProperty;function QQe(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&ZQe.call(t,"index")&&(r.index=t.index,r.input=t.input),r}var o9=Ih.Uint8Array;function fX(t){var e=new t.constructor(t.byteLength);return new o9(e).set(new o9(t)),e}function JQe(t,e){var r=e?fX(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var eJe=/\w*$/;function tJe(t){var e=new t.constructor(t.source,eJe.exec(t));return e.lastIndex=t.lastIndex,e}var Uie=Mu?Mu.prototype:void 0,jie=Uie?Uie.valueOf:void 0;function rJe(t){return jie?Object(jie.call(t)):{}}function r2e(t,e){var r=e?fX(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var nJe="[object Boolean]",iJe="[object Date]",sJe="[object Map]",aJe="[object Number]",oJe="[object RegExp]",lJe="[object Set]",cJe="[object String]",uJe="[object Symbol]",hJe="[object ArrayBuffer]",dJe="[object DataView]",fJe="[object Float32Array]",pJe="[object Float64Array]",gJe="[object Int8Array]",mJe="[object Int16Array]",yJe="[object Int32Array]",vJe="[object Uint8Array]",bJe="[object Uint8ClampedArray]",xJe="[object Uint16Array]",wJe="[object Uint32Array]";function TJe(t,e,r){var n=t.constructor;switch(e){case hJe:return fX(t);case nJe:case iJe:return new n(+t);case dJe:return JQe(t,r);case fJe:case pJe:case gJe:case mJe:case yJe:case vJe:case bJe:case xJe:case wJe:return r2e(t,r);case sJe:return new n;case aJe:case cJe:return new n(t);case oJe:return tJe(t);case lJe:return new n;case uJe:return rJe(t)}}function n2e(t){return typeof t.constructor=="function"&&!aN(t)?SXe(hX(t)):{}}var CJe="[object Map]";function kJe(t){return Eh(t)&&du(t)==CJe}var Yie=OT&&OT.isMap,SJe=Yie?oN(Yie):kJe,EJe="[object Set]";function AJe(t){return Eh(t)&&du(t)==EJe}var Xie=OT&&OT.isSet,MJe=Xie?oN(Xie):AJe,RJe=1,_Je=2,LJe=4,i2e="[object Arguments]",IJe="[object Array]",NJe="[object Boolean]",DJe="[object Date]",OJe="[object Error]",s2e="[object Function]",PJe="[object GeneratorFunction]",$Je="[object Map]",BJe="[object Number]",a2e="[object Object]",FJe="[object RegExp]",zJe="[object Set]",VJe="[object String]",HJe="[object Symbol]",GJe="[object WeakMap]",WJe="[object ArrayBuffer]",qJe="[object DataView]",UJe="[object Float32Array]",jJe="[object Float64Array]",YJe="[object Int8Array]",XJe="[object Int16Array]",KJe="[object Int32Array]",ZJe="[object Uint8Array]",QJe="[object Uint8ClampedArray]",JJe="[object Uint16Array]",eet="[object Uint32Array]",Ii={};Ii[i2e]=Ii[IJe]=Ii[WJe]=Ii[qJe]=Ii[NJe]=Ii[DJe]=Ii[UJe]=Ii[jJe]=Ii[YJe]=Ii[XJe]=Ii[KJe]=Ii[$Je]=Ii[BJe]=Ii[a2e]=Ii[FJe]=Ii[zJe]=Ii[VJe]=Ii[HJe]=Ii[ZJe]=Ii[QJe]=Ii[JJe]=Ii[eet]=!0;Ii[OJe]=Ii[s2e]=Ii[GJe]=!1;function Ok(t,e,r,n,i,s){var a,o=e&RJe,l=e&_Je,u=e&LJe;if(a!==void 0)return a;if(!$s(t))return t;var h=Bs(t);if(h){if(a=QQe(t),!o)return fve(t,a)}else{var d=du(t),f=d==s2e||d==PJe;if(DT(t))return Zve(t,o);if(d==a2e||d==i2e||f&&!i){if(a=l||f?{}:n2e(t),!o)return l?HQe(t,PQe(a,t)):zQe(t,OQe(a,t))}else{if(!Ii[d])return i?t:{};a=TJe(t,d,o)}}s||(s=new hh);var p=s.get(t);if(p)return p;s.set(t,a),MJe(t)?t.forEach(function(y){a.add(Ok(y,e,r,y,t,s))}):SJe(t)&&t.forEach(function(y,v){a.set(v,Ok(y,e,r,v,t,s))});var g=u?l?GQe:HV:l?qy:Lc,m=h?void 0:g(t);return gve(m||t,function(y,v){m&&(v=y,y=t[v]),sN(a,v,Ok(y,e,r,v,t,s))}),a}var tet=4;function l9(t){return Ok(t,tet)}var ret=1,net=4;function Oi(t){return Ok(t,ret|net)}var iet="__lodash_hash_undefined__";function set(t){return this.__data__.set(t,iet),this}function aet(t){return this.__data__.has(t)}function PT(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new B0;++e<r;)this.add(t[e])}PT.prototype.add=PT.prototype.push=set;PT.prototype.has=aet;function oet(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function pX(t,e){return t.has(e)}var cet=1,uet=2;function o2e(t,e,r,n,i,s){var a=r&cet,o=t.length,l=e.length;if(o!=l&&!(a&&l>o))return!1;var u=s.get(t),h=s.get(e);if(u&&h)return u==e&&h==t;var d=-1,f=!0,p=r&uet?new PT:void 0;for(s.set(t,e),s.set(e,t);++d<o;){var g=t[d],m=e[d];if(n)var y=a?n(m,g,d,e,t,s):n(g,m,d,t,e,s);if(y!==void 0){if(y)continue;f=!1;break}if(p){if(!oet(e,function(v,x){if(!pX(p,x)&&(g===v||i(g,v,r,n,s)))return p.push(x)})){f=!1;break}}else if(!(g===m||i(g,m,r,n,s))){f=!1;break}}return s.delete(t),s.delete(e),f}function het(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}function gX(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var det=1,fet=2,pet="[object Boolean]",get="[object Date]",met="[object Error]",yet="[object Map]",vet="[object Number]",bet="[object RegExp]",xet="[object Set]",wet="[object String]",Tet="[object Symbol]",Cet="[object ArrayBuffer]",ket="[object DataView]",Kie=Mu?Mu.prototype:void 0,QP=Kie?Kie.valueOf:void 0;function Eet(t,e,r,n,i,s,a){switch(r){case ket:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Cet:return!(t.byteLength!=e.byteLength||!s(new o9(t),new o9(e)));case pet:case get:case vet:return K5(+t,+e);case met:return t.name==e.name&&t.message==e.message;case bet:case wet:return t==e+"";case yet:var o=het;case xet:var l=n&det;if(o||(o=gX),t.size!=e.size&&!l)return!1;var u=a.get(t);if(u)return u==e;n|=fet,a.set(t,e);var h=o2e(o(t),o(e),n,i,s,a);return a.delete(t),h;case Tet:if(QP)return QP.call(t)==QP.call(e)}return!1}var Aet=1,Met=Object.prototype,Ret=Met.hasOwnProperty;function _et(t,e,r,n,i,s){var a=r&Aet,o=HV(t),l=o.length,u=HV(e),h=u.length;if(l!=h&&!a)return!1;for(var d=l;d--;){var f=o[d];if(!(a?f in e:Ret.call(e,f)))return!1}var p=s.get(t),g=s.get(e);if(p&&g)return p==e&&g==t;var m=!0;s.set(t,e),s.set(e,t);for(var y=a;++d<l;){f=o[d];var v=t[f],x=e[f];if(n)var b=a?n(x,v,f,e,t,s):n(v,x,f,t,e,s);if(!(b===void 0?v===x||i(v,x,r,n,s):b)){m=!1;break}y||(y=f=="constructor")}if(m&&!y){var T=t.constructor,C=e.constructor;T!=C&&"constructor"in t&&"constructor"in e&&!(typeof T=="function"&&T instanceof T&&typeof C=="function"&&C instanceof C)&&(m=!1)}return s.delete(t),s.delete(e),m}var Let=1,Zie="[object Arguments]",Qie="[object Array]",s7="[object Object]",Iet=Object.prototype,Jie=Iet.hasOwnProperty;function Net(t,e,r,n,i,s){var a=Bs(t),o=Bs(e),l=a?Qie:du(t),u=o?Qie:du(e);l=l==Zie?s7:l,u=u==Zie?s7:u;var h=l==s7,d=u==s7,f=l==u;if(f&&DT(t)){if(!DT(e))return!1;a=!0,h=!1}if(f&&!h)return s||(s=new hh),a||lN(t)?o2e(t,e,r,n,i,s):Eet(t,e,l,r,n,i,s);if(!(r&Let)){var p=h&&Jie.call(t,"__wrapped__"),g=d&&Jie.call(e,"__wrapped__");if(p||g){var m=p?t.value():t,y=g?e.value():e;return s||(s=new hh),i(m,y,r,n,s)}}return f?(s||(s=new hh),_et(t,e,r,n,i,s)):!1}function pN(t,e,r,n,i){return t===e?!0:t==null||e==null||!Eh(t)&&!Eh(e)?t!==t&&e!==e:Net(t,e,r,n,pN,i)}var Det=1,Oet=2;function Pet(t,e,r,n){var i=r.length,s=i;if(t==null)return!s;for(t=Object(t);i--;){var a=r[i];if(a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<s;){a=r[i];var o=a[0],l=t[o],u=a[1];if(a[2]){if(l===void 0&&!(o in t))return!1}else{var h=new hh,d;if(!(d===void 0?pN(u,l,Det|Oet,n,h):d))return!1}}return!0}function l2e(t){return t===t&&!$s(t)}function $et(t){for(var e=Lc(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,l2e(i)]}return e}function c2e(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function Bet(t){var e=$et(t);return e.length==1&&e[0][2]?c2e(e[0][0],e[0][1]):function(r){return r===t||Pet(r,t,e)}}function Fet(t,e){return t!=null&&e in Object(t)}function u2e(t,e,r){e=hN(e,t);for(var n=-1,i=e.length,s=!1;++n<i;){var a=L6(e[n]);if(!(s=t!=null&&r(t,a)))break;t=t[a]}return s||++n!=i?s:(i=t==null?0:t.length,!!i&&oX(i)&&iN(a,i)&&(Bs(t)||NT(t)))}function h2e(t,e){return t!=null&&u2e(t,e,Fet)}var zet=1,Vet=2;function Het(t,e){return lX(t)&&l2e(e)?c2e(L6(t),e):function(r){var n=oZe(r,t);return n===void 0&&n===e?h2e(r,t):pN(e,n,zet|Vet)}}function Get(t){return function(e){return e==null?void 0:e[t]}}function Wet(t){return function(e){return dN(e,t)}}function qet(t){return lX(t)?Get(L6(t)):Wet(t)}function F0(t){return typeof t=="function"?t:t==null?Gg:typeof t=="object"?Bs(t)?Het(t[0],t[1]):Bet(t):qet(t)}function Uet(t,e,r,n){for(var i=-1,s=t==null?0:t.length;++i<s;){var a=t[i];e(n,a,r(a),t)}return n}function jet(t){return function(e,r,n){for(var i=-1,s=Object(e),a=n(e),o=a.length;o--;){var l=a[++i];if(r(s[l],l,s)===!1)break}return e}}var mX=jet();function yX(t,e){return t&&mX(t,e,Lc)}function Yet(t,e){return function(r,n){if(r==null)return r;if(!Wg(r))return t(r,n);for(var i=r.length,s=-1,a=Object(r);++s<i&&n(a[s],s,a)!==!1;);return r}}var N6=Yet(yX);function Xet(t,e,r,n){return N6(t,function(i,s,a){e(n,i,r(i),a)}),n}function Ket(t,e){return function(r,n){var i=Bs(r)?Uet:Xet,s=e?e():{};return i(r,t,F0(n),s)}}var JP=function(){return Ih.Date.now()},Zet="Expected a function",Qet=Math.max,Jet=Math.min;function gN(t,e,r){var n,i,s,a,o,l,u=0,h=!1,d=!1,f=!0;if(typeof t!="function")throw new TypeError(Zet);e=vb(e)||0,$s(r)&&(h=!!r.leading,d="maxWait"in r,s=d?Qet(vb(r.maxWait)||0,e):s,f="trailing"in r?!!r.trailing:f);function p(S){var k=n,E=i;return n=i=void 0,u=S,a=t.apply(E,k),a}function g(S){return u=S,o=setTimeout(v,e),h?p(S):a}function m(S){var k=S-l,E=S-u,A=e-k;return d?Jet(A,s-E):A}function y(S){var k=S-l,E=S-u;return l===void 0||k>=e||k<0||d&&E>=s}function v(){var S=JP();if(y(S))return x(S);o=setTimeout(v,m(S))}function x(S){return o=void 0,f&&n?p(S):(n=i=void 0,a)}function b(){o!==void 0&&clearTimeout(o),u=0,n=l=i=o=void 0}function T(){return o===void 0?a:x(JP())}function C(){var S=JP(),k=y(S);if(n=arguments,i=this,l=S,k){if(o===void 0)return g(l);if(d)return clearTimeout(o),o=setTimeout(v,e),p(l)}return o===void 0&&(o=setTimeout(v,e)),a}return C.cancel=b,C.flush=T,C}var d2e=Object.prototype,ett=d2e.hasOwnProperty,f2e=Z5(function(t,e){t=Object(t);var r=-1,n=e.length,i=n>2?e[2]:void 0;for(i&&LS(e[0],e[1],i)&&(n=1);++r<n;)for(var s=e[r],a=qy(s),o=-1,l=a.length;++o<l;){var u=a[o],h=t[u];(h===void 0||K5(h,d2e[u])&&!ett.call(t,u))&&(t[u]=s[u])}return t});function qV(t,e,r){(r!==void 0&&!K5(t[e],r)||r===void 0&&!(e in t))&&R6(t,e,r)}function c9(t){return Eh(t)&&Wg(t)}function UV(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function ttt(t){return _6(t,qy(t))}function rtt(t,e,r,n,i,s,a){var o=UV(t,r),l=UV(e,r),u=a.get(l);if(u){qV(t,r,u);return}var h=s?s(o,l,r+"",t,e,a):void 0,d=h===void 0;if(d){var f=Bs(l),p=!f&&DT(l),g=!f&&!p&&lN(l);h=l,f||p||g?Bs(o)?h=o:c9(o)?h=fve(o):p?(d=!1,h=Zve(l,!0)):g?(d=!1,h=r2e(l,!0)):h=[]:Nh(l)||NT(l)?(h=o,NT(o)?h=ttt(o):(!$s(o)||_S(o))&&(h=n2e(l))):d=!1}d&&(a.set(l,h),i(h,l,n,s,a),a.delete(l)),qV(t,r,h)}function mN(t,e,r,n,i){t!==e&&mX(e,function(s,a){if(i||(i=new hh),$s(s))rtt(t,e,a,r,mN,n,i);else{var o=n?n(UV(t,a),s,a+"",t,e,i):void 0;o===void 0&&(o=s),qV(t,a,o)}},qy)}function p2e(t,e,r,n,i,s){return $s(t)&&$s(e)&&(s.set(e,t),mN(t,e,void 0,p2e,s),s.delete(e)),t}var ntt=bve(function(t,e,r,n){mN(t,e,r,n)}),g2e=Z5(function(t){return t.push(void 0,p2e),dve(ntt,void 0,t)}),itt=200;function stt(t,e,r,n){var i=-1,s=yve,a=!0,o=t.length,l=[],u=e.length;if(!o)return l;e.length>=itt&&(s=pX,a=!1,e=new PT(e));e:for(;++i<o;){var h=t[i],d=h;if(h=h!==0?h:0,a&&d===d){for(var f=u;f--;)if(e[f]===d)continue e;l.push(h)}else s(e,d,n)||l.push(h)}return l}var att=Z5(function(t,e){return c9(t)?stt(t,fN(e,1,c9,!0)):[]});function u9(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}function vX(t){return typeof t=="function"?t:Gg}function Et(t,e){var r=Bs(t)?gve:N6;return r(t,vX(e))}function ott(t,e){var r=[];return N6(t,function(n,i,s){e(n,i,s)&&r.push(n)}),r}function $f(t,e){var r=Bs(t)?Qve:ott;return r(t,F0(e))}function ltt(t){return function(e,r,n){var i=Object(e);if(!Wg(e)){var s=F0(r);e=Lc(e),r=function(o){return s(i[o],o,i)}}var a=t(e,r,n);return a>-1?i[s?e[a]:a]:void 0}}var ctt=Math.max;function utt(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:lXe(r);return i<0&&(i=ctt(n+i,0)),mve(t,F0(e),i)}var bX=ltt(utt);function m2e(t,e){var r=-1,n=Wg(t)?Array(t.length):[];return N6(t,function(i,s,a){n[++r]=e(i,s,a)}),n}function la(t,e){var r=Bs(t)?yb:m2e;return r(t,F0(e))}function htt(t,e){return t==null?t:mX(t,vX(e),qy)}function dtt(t,e){return t&&yX(t,vX(e))}var ftt=Object.prototype,ptt=ftt.hasOwnProperty,ese=Ket(function(t,e,r){ptt.call(t,r)?t[r].push(e):R6(t,r,[e])});function gtt(t,e){return t>e}var mtt=Object.prototype,ytt=mtt.hasOwnProperty;function vtt(t,e){return t!=null&&ytt.call(t,e)}function X2(t,e){return t!=null&&u2e(t,e,vtt)}function btt(t,e){return yb(e,function(r){return t[r]})}function Zf(t){return t==null?[]:btt(t,Lc(t))}var xtt="[object Map]",wtt="[object Set]",Ttt=Object.prototype,Ctt=Ttt.hasOwnProperty;function DS(t){if(t==null)return!0;if(Wg(t)&&(Bs(t)||typeof t=="string"||typeof t.splice=="function"||DT(t)||lN(t)||NT(t)))return!t.length;var e=du(t);if(e==xtt||e==wtt)return!t.size;if(aN(t))return!Sve(t).length;for(var r in t)if(Ctt.call(t,r))return!1;return!0}function Qf(t,e){return pN(t,e)}var ktt="[object Number]";function Bf(t){return typeof t=="number"||Eh(t)&&Hg(t)==ktt}function Us(t){return t===void 0}var Stt=Dve("toLowerCase");function y2e(t,e){return t<e}function yN(t,e){var r={};return e=F0(e),yX(t,function(n,i,s){R6(r,i,e(n,i,s))}),r}function xX(t,e,r){for(var n=-1,i=t.length;++n<i;){var s=t[n],a=e(s);if(a!=null&&(o===void 0?a===a&&!_d(a):r(a,o)))var o=a,l=s}return l}function hg(t){return t&&t.length?xX(t,Gg,gtt):void 0}var Pi=bve(function(t,e,r){mN(t,e,r)});function OS(t){return t&&t.length?xX(t,Gg,y2e):void 0}function wX(t,e){return t&&t.length?xX(t,F0(e),y2e):void 0}function Ett(t,e,r,n){if(!$s(t))return t;e=hN(e,t);for(var i=-1,s=e.length,a=s-1,o=t;o!=null&&++i<s;){var l=L6(e[i]),u=r;if(l==="__proto__"||l==="constructor"||l==="prototype")return t;if(i!=a){var h=o[l];u=void 0,u===void 0&&(u=$s(h)?h:iN(e[i+1])?[]:{})}sN(o,l,u),o=o[l]}return t}function Att(t,e,r){for(var n=-1,i=e.length,s={};++n<i;){var a=e[n],o=dN(t,a);r(o,a)&&Ett(s,hN(a,t),o)}return s}function Mtt(t,e){var r=t.length;for(t.sort(e);r--;)t[r]=t[r].value;return t}function Rtt(t,e){if(t!==e){var r=t!==void 0,n=t===null,i=t===t,s=_d(t),a=e!==void 0,o=e===null,l=e===e,u=_d(e);if(!o&&!u&&!s&&t>e||s&&a&&l&&!o&&!u||n&&a&&l||!r&&l||!i)return 1;if(!n&&!s&&!u&&t<e||u&&r&&i&&!n&&!s||o&&r&&i||!a&&i||!l)return-1}return 0}function _tt(t,e,r){for(var n=-1,i=t.criteria,s=e.criteria,a=i.length,o=r.length;++n<a;){var l=Rtt(i[n],s[n]);if(l){if(n>=o)return l;var u=r[n];return l*(u=="desc"?-1:1)}}return t.index-e.index}function Ltt(t,e,r){e.length?e=yb(e,function(s){return Bs(s)?function(a){return dN(a,s.length===1?s[0]:s)}:s}):e=[Gg];var n=-1;e=yb(e,oN(F0));var i=m2e(t,function(s,a,o){var l=yb(e,function(u){return u(s)});return{criteria:l,index:++n,value:s}});return Mtt(i,function(s,a){return _tt(s,a,r)})}function Itt(t,e){return Att(t,e,function(r,n){return h2e(t,n)})}var $T=cZe(function(t,e){return t==null?{}:Itt(t,e)}),Ntt=Math.ceil,Dtt=Math.max;function Ott(t,e,r,n){for(var i=-1,s=Dtt(Ntt((e-t)/(r||1)),0),a=Array(s);s--;)a[++i]=t,t+=r;return a}function Ptt(t){return function(e,r,n){return n&&typeof n!="number"&&LS(e,r,n)&&(r=n=void 0),e=bM(e),r===void 0?(r=e,e=0):r=bM(r),n=n===void 0?e<r?1:-1:bM(n),Ott(e,r,n)}}var BT=Ptt();function $tt(t,e,r,n,i){return i(t,function(s,a,o){r=n?(n=!1,s):e(r,s,a,o)}),r}function D6(t,e,r){var n=Bs(t)?Ove:$tt,i=arguments.length<3;return n(t,F0(e),r,i,N6)}var qg=Z5(function(t,e){if(t==null)return[];var r=e.length;return r>1&&LS(t,e[0],e[1])?e=[]:r>2&&LS(e[0],e[1],e[2])&&(e=[e[0]]),Ltt(t,fN(e),[])}),Btt=4294967295,Ftt=Btt-1,ztt=Math.floor,Vtt=Math.min;function Htt(t,e,r,n){var i=0,s=t==null?0:t.length;if(s===0)return 0;e=r(e);for(var a=e!==e,o=e===null,l=_d(e),u=e===void 0;i<s;){var h=ztt((i+s)/2),d=r(t[h]),f=d!==void 0,p=d===null,g=d===d,m=_d(d);if(a)var y=g;else u?y=g&&f:o?y=g&&f&&!p:l?y=g&&f&&!p&&!m:p||m?y=!1:y=d<e;y?i=h+1:s=h}return Vtt(s,Ftt)}var Gtt=4294967295,Wtt=Gtt>>>1;function qtt(t,e,r){var n=0,i=t==null?n:t.length;if(typeof e=="number"&&e===e&&i<=Wtt){for(;n<i;){var s=n+i>>>1,a=t[s];a!==null&&!_d(a)&&a<e?n=s+1:i=s}return i}return Htt(t,e,Gg)}function Utt(t,e){return qtt(t,e)}var jtt=Xve(function(t,e,r){return t+(r?" ":"")+a9(e)}),Ytt="Expected a function";function Xtt(t,e,r){var n=!0,i=!0;if(typeof t!="function")throw new TypeError(Ytt);return $s(r)&&(n="leading"in r?!0:n,i="trailing"in r?!!r.trailing:i),gN(t,e,{leading:n,maxWait:e,trailing:i})}var Ktt=1/0,Ztt=bb&&1/gX(new bb([,-0]))[1]==Ktt?function(t){return new bb(t)}:EXe,Qtt=200;function v2e(t,e,r){var n=-1,i=yve,s=t.length,a=!0,o=[],l=o;if(s>=Qtt){var u=Ztt(t);if(u)return gX(u);a=!1,i=pX,l=new PT}else l=o;e:for(;++n<s;){var h=t[n],d=h;if(h=h!==0?h:0,a&&d===d){for(var f=l.length;f--;)if(l[f]===d)continue e;o.push(h)}else i(l,d,r)||(l!==o&&l.push(d),o.push(h))}return o}var jV=Z5(function(t){return v2e(fN(t,1,c9,!0))});function b2e(t){return t&&t.length?v2e(t):[]}var Jtt=0;function vN(t){var e=++Jtt;return Q5(t)+e}function ert(t,e,r){for(var n=-1,i=t.length,s=e.length,a={};++n<i;){var o=n<s?e[n]:void 0;r(a,t[n],o)}return a}function trt(t,e){return ert(t||[],e||[],sN)}function c0(t){return typeof t=="string"&&t.slice(-1)==="%"}function Pc(t,e){if(t==null)return 0;let r;if(typeof t=="string"){if(r=parseFloat(t),c0(t)&&(r/=100,Number.isFinite(r)))return r*e}else r=t;return Number.isFinite(r)?r>0&&r<1?r*e:r:0}function dh(t){if(typeof t=="object"){let r=0,n=0,i=0,s=0;return t.vertical!=null&&Number.isFinite(t.vertical)&&(n=s=t.vertical),t.horizontal!=null&&Number.isFinite(t.horizontal)&&(i=r=t.horizontal),t.left!=null&&Number.isFinite(t.left)&&(r=t.left),t.top!=null&&Number.isFinite(t.top)&&(n=t.top),t.right!=null&&Number.isFinite(t.right)&&(i=t.right),t.bottom!=null&&Number.isFinite(t.bottom)&&(s=t.bottom),{top:n,right:i,bottom:s,left:r}}let e=0;return t!=null&&Number.isFinite(t)&&(e=t),{top:e,right:e,bottom:e,left:e}}let x2e=!1,w2e=!1,T2e=!1,rrt=!1,C2e=!1;if(typeof navigator=="object"){const t=navigator.userAgent;t.indexOf("Macintosh")>=0,t.match(/(iPad|iPhone|iPod)/g),t.indexOf("Windows")>=0,x2e=t.indexOf("MSIE")>=0,t.match(/Trident\/7\./),w2e=!!t.match(/Edge\//),t.indexOf("Mozilla/")>=0&&t.indexOf("MSIE")<0&&t.indexOf("Edge/")<0,t.indexOf("Chrome/")>=0&&t.indexOf("Edge/")<0,t.indexOf("Opera/")>=0||t.indexOf("OPR/")>=0,t.indexOf("Firefox/")>=0,T2e=t.indexOf("AppleWebKit/")>=0&&t.indexOf("Chrome/")<0&&t.indexOf("Edge/")<0,typeof document=="object"&&(C2e=!document.createElementNS||`${document.createElementNS("http://www.w3.org/2000/svg","foreignObject")}`!="[object SVGForeignObjectElement]"||t.indexOf("Opera/")>=0)}typeof window=="object"&&window.chrome!=null&&window.chrome.app!=null&&window.chrome.app.runtime!=null;if(typeof document=="object")try{const t=Object.defineProperty({},"passive",{get(){rrt=!0}}),e=document.createElement("div");e.addEventListener&&e.addEventListener("click",()=>{},t)}catch{}const tse=x2e,rse=w2e,nrt=T2e,irt=C2e,srt=!irt;function art(){const t=window.module;return t!=null&&t.hot!=null&&t.hot.status!=null?t.hot.status():"unkonwn"}function k2e(){return art()==="apply"}const ort={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};function lrt(t){const e=document.createElement(ort[t]||"div"),r=`on${t}`;let n=r in e;return n||(e.setAttribute(r,"return;"),n=typeof e[r]=="function"),n}const Pk=[];function Ug(t,e){const r=Pk.find(n=>n.name===t);if(!(r&&(r.loadTimes+=1,r.loadTimes>1))&&!k2e()){const n=document.createElement("style");n.setAttribute("type","text/css"),n.textContent=e;const i=document.querySelector("head");i&&i.insertBefore(n,i.firstChild),Pk.push({name:t,loadTimes:1,styleElement:n})}}function jg(t){const e=Pk.findIndex(r=>r.name===t);if(e>-1){const r=Pk[e];if(r.loadTimes-=1,r.loadTimes>0)return;let n=r.styleElement;n&&n.parentNode&&n.parentNode.removeChild(n),n=null,Pk.splice(e,1)}}function crt(t){const e=t.match(/<svg[^>]*viewBox\s*=\s*(["']?)(.+?)\1[^>]*>/i);return e&&e[2]?e[2].replace(/\s+/," ").split(" "):null}function nse(t){const e=parseFloat(t);return Number.isNaN(e)?null:e}function urt(t){const e="data:";return t.substr(0,e.length)===e}function hrt(t,e){if(!t||urt(t)){setTimeout(()=>e(null,t));return}const r=()=>{e(new Error(`Failed to load image: ${t}`))},n=window.FileReader?s=>{if(s.status===200){const a=new FileReader;a.onload=o=>{const l=o.target.result;e(null,l)},a.onerror=r,a.readAsDataURL(s.response)}else r()}:s=>{const a=o=>{const u=[];for(let h=0;h<o.length;h+=32768)u.push(String.fromCharCode.apply(null,o.subarray(h,h+32768)));return u.join("")};if(s.status===200){let o=t.split(".").pop()||"png";o==="svg"&&(o="svg+xml");const l=`data:image/${o};base64,`,u=new Uint8Array(s.response),h=l+btoa(a(u));e(null,h)}else r()},i=new XMLHttpRequest;i.responseType=window.FileReader?"blob":"arraybuffer",i.open("GET",t,!0),i.addEventListener("error",r),i.addEventListener("load",()=>n(i)),i.send()}function drt(t){let e=t.replace(/\s/g,"");e=decodeURIComponent(e);const r=e.indexOf(","),n=e.slice(0,r),i=n.split(":")[1].split(";")[0],s=e.slice(r+1);let a;n.indexOf("base64")>=0?a=atob(s):a=unescape(encodeURIComponent(s));const o=new Uint8Array(a.length);for(let l=0;l<a.length;l+=1)o[l]=a.charCodeAt(l);return new Blob([o],{type:i})}function frt(t,e){const r=window.navigator.msSaveBlob;if(r)r(t,e);else{const n=window.URL.createObjectURL(t),i=document.createElement("a");i.href=n,i.download=e,document.body.appendChild(i),i.click(),document.body.removeChild(i),window.URL.revokeObjectURL(n)}}function e$(t,e){const r=drt(t);frt(r,e)}function prt(t,e={}){let r=null;const n=h=>(r==null&&(r=crt(t)),r!=null?nse(r[h]):null),i=h=>{const d=t.match(h);return d&&d[2]?nse(d[2]):null};let s=e.width;if(s==null&&(s=i(/<svg[^>]*width\s*=\s*(["']?)(.+?)\1[^>]*>/i)),s==null&&(s=n(2)),s==null)throw new Error("Can not parse width from svg string");let a=e.height;if(a==null&&(a=i(/<svg[^>]*height\s*=\s*(["']?)(.+?)\1[^>]*>/i)),a==null&&(a=n(3)),a==null)throw new Error("Can not parse height from svg string");return`data:image/svg+xml,${encodeURIComponent(t).replace(/'/g,"%27").replace(/"/g,"%22")}`}function grt(t){return typeof t=="object"&&t.then&&typeof t.then=="function"}function YV(t){return t!=null&&(t instanceof Promise||grt(t))}function TX(...t){const e=[];if(t.forEach(n=>{Array.isArray(n)?e.push(...n):e.push(n)}),e.some(n=>YV(n))){const n=e.map(i=>YV(i)?i:Promise.resolve(i!==!1));return Promise.all(n).then(i=>i.reduce((s,a)=>a!==!1&&s,!0))}return e.every(n=>n!==!1)}function mrt(...t){const e=TX(t);return typeof e=="boolean"?Promise.resolve(e):e}function S2e(t,e,r){if(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]);case 4:return t.call(e,r[0],r[1],r[2],r[3]);case 5:return t.call(e,r[0],r[1],r[2],r[3],r[4]);case 6:return t.call(e,r[0],r[1],r[2],r[3],r[4],r[5]);default:return t.apply(e,r)}return t.call(e)}function vr(t,e,...r){return S2e(t,e,r)}function ise(t){return 180*t/Math.PI%360}const Fo=function(t,e=!1){return(e?t:t%360)*Math.PI/180};function ml(t){return t%360+(t<0?360:0)}function L1(t,e=0){return Number.isInteger(t)?t:+t.toFixed(e)}function sse(t,e){let r,n;if(e==null?(n=t??1,r=0):(n=e,r=t??0),n<r){const i=r;r=n,n=i}return Math.floor(Math.random()*(n-r+1)+r)}function Lv(t,e,r){return Number.isNaN(t)?NaN:Number.isNaN(e)||Number.isNaN(r)?0:t<e?e:t>r?r:t}function fh(t,e){return e*Math.round(t/e)}function E2e(t,e){return e!=null&&t!=null&&e.x>=t.x&&e.x<=t.x+t.width&&e.y>=t.y&&e.y<=t.y+t.height}function ase(t,e){const r=t.x-e.x,n=t.y-e.y;return r*r+n*n}class Yg{valueOf(){return this.toJSON()}toString(){return JSON.stringify(this.toJSON())}}let Qe=class Fr extends Yg{static create(e,r){return e==null||typeof e=="number"?new Fr(e,r):Fr.clone(e)}static clone(e){return Fr.isPoint(e)?new Fr(e.x,e.y):Array.isArray(e)?new Fr(e[0],e[1]):new Fr(e.x,e.y)}static equals(e,r){return e===r?!0:e!=null&&r!=null?e.x===r.x&&e.y===r.y:!1}static rotateEx(e,r,n,i=new Fr){const s=Fr.clone(e),a=Fr.clone(i),o=s.x-a.x,l=s.y-a.y,u=o*r-l*n,h=l*r+o*n;return new Fr(u+a.x,h+a.y)}static toJSON(e){return Fr.isPoint(e)?{x:e.x,y:e.y}:Array.isArray(e)?{x:e[0],y:e[1]}:{x:e.x,y:e.y}}static fromPolar(e,r,n=new Fr){let i=Math.abs(e*Math.cos(r)),s=Math.abs(e*Math.sin(r));const a=Fr.clone(n),o=ml(ise(r));return o<90?s=-s:o<180?(i=-i,s=-s):o<270&&(i=-i),new Fr(a.x+i,a.y+s)}static toPolar(e,r=new Fr){const n=Fr.clone(e),i=Fr.clone(r),s=n.x-i.x,a=n.y-i.y;return new Fr(Math.sqrt(s*s+a*a),Fo(i.theta(n)))}static equalPoints(e,r){if(e==null&&r!=null||e!=null&&r==null||e!=null&&r!=null&&e.length!==r.length)return!1;if(e!=null&&r!=null){for(let n=0,i=e.length;n<i;n+=1)if(!Fr.equals(e[n],r[n]))return!1}return!0}static random(e,r,n,i){return new Fr(sse(e,r),sse(n,i))}static rotate(e,r,n){const i=Fo(ml(-r)),s=Math.sin(i),a=Math.cos(i);return Fr.rotateEx(e,a,s,n)}static isPoint(e){return e!=null&&e instanceof Fr}static isPointLike(e){return e!=null&&typeof e=="object"&&typeof e.x=="number"&&typeof e.y=="number"}static isPointData(e){return e!=null&&Array.isArray(e)&&e.length===2&&typeof e[0]=="number"&&typeof e[1]=="number"}constructor(e,r){super(),this.x=e??0,this.y=r??0}round(e=0){return this.x=L1(this.x,e),this.y=L1(this.y,e),this}add(e,r){const n=Fr.create(e,r);return this.x+=n.x,this.y+=n.y,this}update(e,r){const n=Fr.create(e,r);return this.x=n.x,this.y=n.y,this}translate(e,r){const n=Fr.create(e,r);return this.x+=n.x,this.y+=n.y,this}rotate(e,r){const n=Fr.rotate(this,e,r);return this.x=n.x,this.y=n.y,this}scale(e,r,n=new Fr){const i=Fr.create(n);return this.x=i.x+e*(this.x-i.x),this.y=i.y+r*(this.y-i.y),this}closest(e){if(e.length===1)return Fr.create(e[0]);let r=null,n=1/0;return e.forEach(i=>{const s=this.squaredDistance(i);s<n&&(r=i,n=s)}),r?Fr.create(r):null}distance(e){return Math.sqrt(this.squaredDistance(e))}squaredDistance(e){const r=Fr.create(e),n=this.x-r.x,i=this.y-r.y;return n*n+i*i}manhattanDistance(e){const r=Fr.create(e);return Math.abs(r.x-this.x)+Math.abs(r.y-this.y)}magnitude(){return Math.sqrt(this.x*this.x+this.y*this.y)||.01}theta(e=new Fr){const r=Fr.create(e),n=-(r.y-this.y),i=r.x-this.x;let s=Math.atan2(n,i);return s<0&&(s=2*Math.PI+s),180*s/Math.PI}angleBetween(e,r){if(this.equals(e)||this.equals(r))return NaN;let n=this.theta(r)-this.theta(e);return n<0&&(n+=360),n}vectorAngle(e){return new Fr(0,0).angleBetween(this,e)}toPolar(e){return this.update(Fr.toPolar(this,e)),this}changeInAngle(e,r,n=new Fr){return this.clone().translate(-e,-r).theta(n)-this.theta(n)}adhereToRect(e){return E2e(e,this)||(this.x=Math.min(Math.max(this.x,e.x),e.x+e.width),this.y=Math.min(Math.max(this.y,e.y),e.y+e.height)),this}bearing(e){const r=Fr.create(e),n=Fo(this.y),i=Fo(r.y),s=this.x,a=r.x,o=Fo(a-s),l=Math.sin(o)*Math.cos(i),u=Math.cos(n)*Math.sin(i)-Math.sin(n)*Math.cos(i)*Math.cos(o),h=ise(Math.atan2(l,u)),d=["NE","E","SE","S","SW","W","NW","N"];let f=h-22.5;return f<0&&(f+=360),f=parseInt(f/45,10),d[f]}cross(e,r){if(e!=null&&r!=null){const n=Fr.create(e),i=Fr.create(r);return(i.x-this.x)*(n.y-this.y)-(i.y-this.y)*(n.x-this.x)}return NaN}dot(e){const r=Fr.create(e);return this.x*r.x+this.y*r.y}diff(e,r){if(typeof e=="number")return new Fr(this.x-e,this.y-r);const n=Fr.create(e);return new Fr(this.x-n.x,this.y-n.y)}lerp(e,r){const n=Fr.create(e);return new Fr((1-r)*this.x+r*n.x,(1-r)*this.y+r*n.y)}normalize(e=1){const r=e/this.magnitude();return this.scale(r,r)}move(e,r){const n=Fr.create(e),i=Fo(n.theta(this));return this.translate(Math.cos(i)*r,-Math.sin(i)*r)}reflection(e){return Fr.create(e).move(this,this.distance(e))}snapToGrid(e,r){return this.x=fh(this.x,e),this.y=fh(this.y,r??e),this}equals(e){const r=Fr.create(e);return r!=null&&r.x===this.x&&r.y===this.y}clone(){return Fr.clone(this)}toJSON(){return Fr.toJSON(this)}serialize(){return`${this.x} ${this.y}`}};class Bt extends Yg{static isRectangle(e){return e!=null&&e instanceof Bt}static isRectangleLike(e){return e!=null&&typeof e=="object"&&typeof e.x=="number"&&typeof e.y=="number"&&typeof e.width=="number"&&typeof e.height=="number"}static create(e,r,n,i){return e==null||typeof e=="number"?new Bt(e,r,n,i):Bt.clone(e)}static clone(e){return Bt.isRectangle(e)?e.clone():Array.isArray(e)?new Bt(e[0],e[1],e[2],e[3]):new Bt(e.x,e.y,e.width,e.height)}static fromEllipse(e){return new Bt(e.x-e.a,e.y-e.b,2*e.a,2*e.b)}static fromSize(e){return new Bt(0,0,e.width,e.height)}static fromPositionAndSize(e,r){return new Bt(e.x,e.y,r.width,r.height)}get left(){return this.x}get top(){return this.y}get right(){return this.x+this.width}get bottom(){return this.y+this.height}get origin(){return new Qe(this.x,this.y)}get topLeft(){return new Qe(this.x,this.y)}get topCenter(){return new Qe(this.x+this.width/2,this.y)}get topRight(){return new Qe(this.x+this.width,this.y)}get center(){return new Qe(this.x+this.width/2,this.y+this.height/2)}get bottomLeft(){return new Qe(this.x,this.y+this.height)}get bottomCenter(){return new Qe(this.x+this.width/2,this.y+this.height)}get bottomRight(){return new Qe(this.x+this.width,this.y+this.height)}get corner(){return new Qe(this.x+this.width,this.y+this.height)}get rightMiddle(){return new Qe(this.x+this.width,this.y+this.height/2)}get leftMiddle(){return new Qe(this.x,this.y+this.height/2)}get topLine(){return new lr(this.topLeft,this.topRight)}get rightLine(){return new lr(this.topRight,this.bottomRight)}get bottomLine(){return new lr(this.bottomLeft,this.bottomRight)}get leftLine(){return new lr(this.topLeft,this.bottomLeft)}constructor(e,r,n,i){super(),this.x=e??0,this.y=r??0,this.width=n??0,this.height=i??0}getOrigin(){return this.origin}getTopLeft(){return this.topLeft}getTopCenter(){return this.topCenter}getTopRight(){return this.topRight}getCenter(){return this.center}getCenterX(){return this.x+this.width/2}getCenterY(){return this.y+this.height/2}getBottomLeft(){return this.bottomLeft}getBottomCenter(){return this.bottomCenter}getBottomRight(){return this.bottomRight}getCorner(){return this.corner}getRightMiddle(){return this.rightMiddle}getLeftMiddle(){return this.leftMiddle}getTopLine(){return this.topLine}getRightLine(){return this.rightLine}getBottomLine(){return this.bottomLine}getLeftLine(){return this.leftLine}bbox(e){if(!e)return this.clone();const r=Fo(e),n=Math.abs(Math.sin(r)),i=Math.abs(Math.cos(r)),s=this.width*i+this.height*n,a=this.width*n+this.height*i;return new Bt(this.x+(this.width-s)/2,this.y+(this.height-a)/2,s,a)}round(e=0){return this.x=L1(this.x,e),this.y=L1(this.y,e),this.width=L1(this.width,e),this.height=L1(this.height,e),this}add(e,r,n,i){const s=Bt.create(e,r,n,i),a=Math.min(this.x,s.x),o=Math.min(this.y,s.y),l=Math.max(this.x+this.width,s.x+s.width),u=Math.max(this.y+this.height,s.y+s.height);return this.x=a,this.y=o,this.width=l-a,this.height=u-o,this}update(e,r,n,i){const s=Bt.create(e,r,n,i);return this.x=s.x,this.y=s.y,this.width=s.width,this.height=s.height,this}inflate(e,r){const n=e,i=r??e;return this.x-=n,this.y-=i,this.width+=2*n,this.height+=2*i,this}snapToGrid(e,r){const n=this.origin.snapToGrid(e,r),i=this.corner.snapToGrid(e,r);return this.x=n.x,this.y=n.y,this.width=i.x-n.x,this.height=i.y-n.y,this}translate(e,r){const n=Qe.create(e,r);return this.x+=n.x,this.y+=n.y,this}scale(e,r,n=new Qe){const i=this.origin.scale(e,r,n);return this.x=i.x,this.y=i.y,this.width*=e,this.height*=r,this}rotate(e,r=this.getCenter()){if(e!==0){const n=Fo(e),i=Math.cos(n),s=Math.sin(n);let a=this.getOrigin(),o=this.getTopRight(),l=this.getBottomRight(),u=this.getBottomLeft();a=Qe.rotateEx(a,i,s,r),o=Qe.rotateEx(o,i,s,r),l=Qe.rotateEx(l,i,s,r),u=Qe.rotateEx(u,i,s,r);const h=new Bt(a.x,a.y,0,0);h.add(o.x,o.y,0,0),h.add(l.x,l.y,0,0),h.add(u.x,u.y,0,0),this.update(h)}return this}rotate90(){const e=(this.width-this.height)/2;this.x+=e,this.y-=e;const r=this.width;return this.width=this.height,this.height=r,this}moveAndExpand(e){const r=Bt.clone(e);return this.x+=r.x||0,this.y+=r.y||0,this.width+=r.width||0,this.height+=r.height||0,this}getMaxScaleToFit(e,r=this.center){const n=Bt.clone(e),i=r.x,s=r.y;let a=1/0,o=1/0,l=1/0,u=1/0,h=1/0,d=1/0,f=1/0,p=1/0;const g=n.topLeft;g.x<i&&(a=(this.x-i)/(g.x-i)),g.y<s&&(h=(this.y-s)/(g.y-s));const m=n.bottomRight;m.x>i&&(o=(this.x+this.width-i)/(m.x-i)),m.y>s&&(d=(this.y+this.height-s)/(m.y-s));const y=n.topRight;y.x>i&&(l=(this.x+this.width-i)/(y.x-i)),y.y<s&&(f=(this.y-s)/(y.y-s));const v=n.bottomLeft;return v.x<i&&(u=(this.x-i)/(v.x-i)),v.y>s&&(p=(this.y+this.height-s)/(v.y-s)),{sx:Math.min(a,o,l,u),sy:Math.min(h,d,f,p)}}getMaxUniformScaleToFit(e,r=this.center){const n=this.getMaxScaleToFit(e,r);return Math.min(n.sx,n.sy)}containsPoint(e,r){return E2e(this,Qe.create(e,r))}containsRect(e,r,n,i){const s=Bt.create(e,r,n,i),a=this.x,o=this.y,l=this.width,u=this.height,h=s.x,d=s.y,f=s.width,p=s.height;return l===0||u===0||f===0||p===0?!1:h>=a&&d>=o&&h+f<=a+l&&d+p<=o+u}intersectsWithLine(e){const r=[this.topLine,this.rightLine,this.bottomLine,this.leftLine],n=[],i=[];return r.forEach(s=>{const a=e.intersectsWithLine(s);a!==null&&i.indexOf(a.toString())<0&&(n.push(a),i.push(a.toString()))}),n.length>0?n:null}intersectsWithLineFromCenterToPoint(e,r){const n=Qe.clone(e),i=this.center;let s=null;r!=null&&r!==0&&n.rotate(r,i);const a=[this.topLine,this.rightLine,this.bottomLine,this.leftLine],o=new lr(i,n);for(let l=a.length-1;l>=0;l-=1){const u=a[l].intersectsWithLine(o);if(u!==null){s=u;break}}return s&&r!=null&&r!==0&&s.rotate(-r,i),s}intersectsWithRect(e,r,n,i){const s=Bt.create(e,r,n,i);if(!this.isIntersectWithRect(s))return null;const a=this.origin,o=this.corner,l=s.origin,u=s.corner,h=Math.max(a.x,l.x),d=Math.max(a.y,l.y);return new Bt(h,d,Math.min(o.x,u.x)-h,Math.min(o.y,u.y)-d)}isIntersectWithRect(e,r,n,i){const s=Bt.create(e,r,n,i),a=this.origin,o=this.corner,l=s.origin,u=s.corner;return!(u.x<=a.x||u.y<=a.y||l.x>=o.x||l.y>=o.y)}normalize(){let e=this.x,r=this.y,n=this.width,i=this.height;return this.width<0&&(e=this.x+this.width,n=-this.width),this.height<0&&(r=this.y+this.height,i=-this.height),this.x=e,this.y=r,this.width=n,this.height=i,this}union(e){const r=Bt.clone(e),n=this.origin,i=this.corner,s=r.origin,a=r.corner,o=Math.min(n.x,s.x),l=Math.min(n.y,s.y),u=Math.max(i.x,a.x),h=Math.max(i.y,a.y);return new Bt(o,l,u-o,h-l)}getNearestSideToPoint(e){const r=Qe.clone(e),n=r.x-this.x,i=this.x+this.width-r.x,s=r.y-this.y,a=this.y+this.height-r.y;let o=n,l="left";return i<o&&(o=i,l="right"),s<o&&(o=s,l="top"),a<o&&(l="bottom"),l}getNearestPointToPoint(e){const r=Qe.clone(e);if(this.containsPoint(r)){const n=this.getNearestSideToPoint(r);if(n==="left")return new Qe(this.x,r.y);if(n==="top")return new Qe(r.x,this.y);if(n==="right")return new Qe(this.x+this.width,r.y);if(n==="bottom")return new Qe(r.x,this.y+this.height)}return r.adhereToRect(this)}equals(e){return e!=null&&e.x===this.x&&e.y===this.y&&e.width===this.width&&e.height===this.height}clone(){return new Bt(this.x,this.y,this.width,this.height)}toJSON(){return{x:this.x,y:this.y,width:this.width,height:this.height}}serialize(){return`${this.x} ${this.y} ${this.width} ${this.height}`}}class lr extends Yg{static isLine(e){return e!=null&&e instanceof lr}get center(){return new Qe((this.start.x+this.end.x)/2,(this.start.y+this.end.y)/2)}constructor(e,r,n,i){super(),typeof e=="number"&&typeof r=="number"?(this.start=new Qe(e,r),this.end=new Qe(n,i)):(this.start=Qe.create(e),this.end=Qe.create(r))}getCenter(){return this.center}round(e=0){return this.start.round(e),this.end.round(e),this}translate(e,r){return typeof e=="number"?(this.start.translate(e,r),this.end.translate(e,r)):(this.start.translate(e),this.end.translate(e)),this}rotate(e,r){return this.start.rotate(e,r),this.end.rotate(e,r),this}scale(e,r,n){return this.start.scale(e,r,n),this.end.scale(e,r,n),this}length(){return Math.sqrt(this.squaredLength())}squaredLength(){const e=this.start.x-this.end.x,r=this.start.y-this.end.y;return e*e+r*r}setLength(e){const r=this.length();if(!r)return this;const n=e/r;return this.scale(n,n,this.start)}parallel(e){const r=this.clone();if(!r.isDifferentiable())return r;const{start:n,end:i}=r,s=n.clone().rotate(270,i),a=i.clone().rotate(90,n);return n.move(a,e),i.move(s,e),r}vector(){return new Qe(this.end.x-this.start.x,this.end.y-this.start.y)}angle(){const e=new Qe(this.start.x+1,this.start.y);return this.start.angleBetween(this.end,e)}bbox(){const e=Math.min(this.start.x,this.end.x),r=Math.min(this.start.y,this.end.y),n=Math.max(this.start.x,this.end.x),i=Math.max(this.start.y,this.end.y);return new Bt(e,r,n-e,i-r)}bearing(){return this.start.bearing(this.end)}closestPoint(e){return this.pointAt(this.closestPointNormalizedLength(e))}closestPointLength(e){return this.closestPointNormalizedLength(e)*this.length()}closestPointTangent(e){return this.tangentAt(this.closestPointNormalizedLength(e))}closestPointNormalizedLength(e){const r=this.vector().dot(new lr(this.start,e).vector()),n=Math.min(1,Math.max(0,r/this.squaredLength()));return Number.isNaN(n)?0:n}pointAt(e){const r=this.start,n=this.end;return e<=0?r.clone():e>=1?n.clone():r.lerp(n,e)}pointAtLength(e){const r=this.start,n=this.end;let i=!0;e<0&&(i=!1,e=-e);const s=this.length();if(e>=s)return i?n.clone():r.clone();const a=(i?e:s-e)/s;return this.pointAt(a)}divideAt(e){const r=this.pointAt(e);return[new lr(this.start,r),new lr(r,this.end)]}divideAtLength(e){const r=this.pointAtLength(e);return[new lr(this.start,r),new lr(r,this.end)]}containsPoint(e){const r=this.start,n=this.end;if(r.cross(e,n)!==0)return!1;const i=this.length();return!(new lr(r,e).length()>i||new lr(e,n).length()>i)}intersect(e,r){const n=e.intersectsWithLine(this,r);return n?Array.isArray(n)?n:[n]:null}intersectsWithLine(e){const r=new Qe(this.end.x-this.start.x,this.end.y-this.start.y),n=new Qe(e.end.x-e.start.x,e.end.y-e.start.y),i=r.x*n.y-r.y*n.x,s=new Qe(e.start.x-this.start.x,e.start.y-this.start.y),a=s.x*n.y-s.y*n.x,o=s.x*r.y-s.y*r.x;if(i===0||a*i<0||o*i<0)return null;if(i>0){if(a>i||o>i)return null}else if(a<i||o<i)return null;return new Qe(this.start.x+a*r.x/i,this.start.y+a*r.y/i)}isDifferentiable(){return!this.start.equals(this.end)}pointOffset(e){const r=Qe.clone(e),n=this.start,i=this.end;return((i.x-n.x)*(r.y-n.y)-(i.y-n.y)*(r.x-n.x))/this.length()}pointSquaredDistance(e,r){const n=Qe.create(e,r);return this.closestPoint(n).squaredDistance(n)}pointDistance(e,r){const n=Qe.create(e,r);return this.closestPoint(n).distance(n)}tangentAt(e){if(!this.isDifferentiable())return null;const r=this.start,n=this.end,i=this.pointAt(e),s=new lr(r,n);return s.translate(i.x-r.x,i.y-r.y),s}tangentAtLength(e){if(!this.isDifferentiable())return null;const r=this.start,n=this.end,i=this.pointAtLength(e),s=new lr(r,n);return s.translate(i.x-r.x,i.y-r.y),s}relativeCcw(e,r){const n=Qe.create(e,r);let i=n.x-this.start.x,s=n.y-this.start.y;const a=this.end.x-this.start.x,o=this.end.y-this.start.y;let l=i*o-s*a;return l===0&&(l=i*a+s*o,l>0&&(i-=a,s-=o,l=i*a+s*o,l<0&&(l=0))),l<0?-1:l>0?1:0}equals(e){return e!=null&&this.start.x===e.start.x&&this.start.y===e.start.y&&this.end.x===e.end.x&&this.end.y===e.end.y}clone(){return new lr(this.start,this.end)}toJSON(){return{start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){return[this.start.serialize(),this.end.serialize()].join(" ")}}class rc extends Yg{static isEllipse(e){return e!=null&&e instanceof rc}static create(e,r,n,i){return e==null||typeof e=="number"?new rc(e,r,n,i):rc.parse(e)}static parse(e){return rc.isEllipse(e)?e.clone():Array.isArray(e)?new rc(e[0],e[1],e[2],e[3]):new rc(e.x,e.y,e.a,e.b)}static fromRect(e){const r=e.center;return new rc(r.x,r.y,e.width/2,e.height/2)}get center(){return new Qe(this.x,this.y)}constructor(e,r,n,i){super(),this.x=e??0,this.y=r??0,this.a=n??0,this.b=i??0}bbox(){return Bt.fromEllipse(this)}getCenter(){return this.center}inflate(e,r){const n=e,i=r??e;return this.a+=2*n,this.b+=2*i,this}normalizedDistance(e,r){const n=Qe.create(e,r),i=n.x-this.x,s=n.y-this.y,a=this.a,o=this.b;return i*i/(a*a)+s*s/(o*o)}containsPoint(e,r){return this.normalizedDistance(e,r)<=1}intersectsWithLine(e){const r=[],n=this.a,i=this.b,s=e.start,a=e.end,o=e.vector(),l=s.diff(new Qe(this.x,this.y)),u=new Qe(o.x/(n*n),o.y/(i*i)),h=new Qe(l.x/(n*n),l.y/(i*i)),d=o.dot(u),f=o.dot(h),p=l.dot(h)-1,g=f*f-d*p;if(g<0)return null;if(g>0){const m=Math.sqrt(g),y=(-f-m)/d,v=(-f+m)/d;if((y<0||y>1)&&(v<0||v>1))return null;y>=0&&y<=1&&r.push(s.lerp(a,y)),v>=0&&v<=1&&r.push(s.lerp(a,v))}else{const m=-f/d;if(m>=0&&m<=1)r.push(s.lerp(a,m));else return null}return r}intersectsWithLineFromCenterToPoint(e,r=0){const n=Qe.clone(e);r&&n.rotate(r,this.getCenter());const i=n.x-this.x,s=n.y-this.y;let a;if(i===0)return a=this.bbox().getNearestPointToPoint(n),r?a.rotate(-r,this.getCenter()):a;const o=s/i,l=o*o,u=this.a*this.a,h=this.b*this.b;let d=Math.sqrt(1/(1/u+l/h));d=i<0?-d:d;const f=o*d;return a=new Qe(this.x+d,this.y+f),r?a.rotate(-r,this.getCenter()):a}tangentTheta(e){const r=Qe.clone(e),n=r.x,i=r.y,s=this.a,a=this.b,o=this.bbox().center,l=o.x,u=o.y,h=30,d=n>o.x+s/2,f=n<o.x-s/2;let p,g;return d||f?(g=n>o.x?i-h:i+h,p=s*s/(n-l)-s*s*(i-u)*(g-u)/(a*a*(n-l))+l):(p=i>o.y?n+h:n-h,g=a*a/(i-u)-a*a*(n-l)*(p-l)/(s*s*(i-u))+u),new Qe(p,g).theta(r)}scale(e,r){return this.a*=e,this.b*=r,this}rotate(e,r){const n=Bt.fromEllipse(this);n.rotate(e,r);const i=rc.fromRect(n);return this.a=i.a,this.b=i.b,this.x=i.x,this.y=i.y,this}translate(e,r){const n=Qe.create(e,r);return this.x+=n.x,this.y+=n.y,this}equals(e){return e!=null&&e.x===this.x&&e.y===this.y&&e.a===this.a&&e.b===this.b}clone(){return new rc(this.x,this.y,this.a,this.b)}toJSON(){return{x:this.x,y:this.y,a:this.a,b:this.b}}serialize(){return`${this.x} ${this.y} ${this.a} ${this.b}`}}const yrt=new RegExp("^[\\s\\dLMCZz,.]*$");function vrt(t){return typeof t!="string"?!1:yrt.test(t)}function t$(t,e){return(t%e+e)%e}function brt(t,e,r,n,i){if(!t||t.length===0)return"";const s=[],a=t[t.length-1],o=e!=null&&e>0,l=e||0;if(n&&o){t=t.slice();const d=t[0],f=new Qe(a.x+(d.x-a.x)/2,a.y+(d.y-a.y)/2);t.splice(0,0,f)}let u=t[0],h=1;for(r?s.push("M",u.x,u.y):s.push("L",u.x,u.y);h<(n?t.length:t.length-1);){let d=t[t$(h,t.length)],f=u.x-d.x,p=u.y-d.y;if(o&&(f!==0||p!==0)&&(i==null||i.indexOf(h-1)<0)){let g=Math.sqrt(f*f+p*p);const m=f*Math.min(l,g/2)/g,y=p*Math.min(l,g/2)/g,v=d.x+m,x=d.y+y;s.push("L",v,x);let b=t[t$(h+1,t.length)];for(;h<t.length-2&&Math.round(b.x-d.x)===0&&Math.round(b.y-d.y)===0;)b=t[t$(h+2,t.length)],h+=1;f=b.x-d.x,p=b.y-d.y,g=Math.max(1,Math.sqrt(f*f+p*p));const T=f*Math.min(l,g/2)/g,C=p*Math.min(l,g/2)/g,S=d.x+T,k=d.y+C;s.push("Q",d.x,d.y,S,k),d=new Qe(S,k)}else s.push("L",d.x,d.y);u=d,h+=1}return n?s.push("Z"):s.push("L",a.x,a.y),s.map(d=>typeof d=="string"?d:+d.toFixed(3)).join(" ")}function xrt(t,e={}){const r=[];return t&&t.length&&t.forEach(n=>{Array.isArray(n)?r.push({x:n[0],y:n[1]}):r.push({x:n.x,y:n.y})}),brt(r,e.round,e.initialMove==null||e.initialMove,e.close,e.exclude)}function ose(t,e,r,n,i=0,s=0,a=0,o,l){if(r===0||n===0)return[];o-=t,l-=e,r=Math.abs(r),n=Math.abs(n);const u=-o/2,h=-l/2,d=Math.cos(i*Math.PI/180),f=Math.sin(i*Math.PI/180),p=d*u+f*h,g=-1*f*u+d*h,m=p*p,y=g*g,v=r*r,x=n*n,b=m/v+y/x;let T;if(b>1)r=Math.sqrt(b)*r,n=Math.sqrt(b)*n,T=0;else{let q=1;s===a&&(q=-1),T=q*Math.sqrt((v*x-v*y-x*m)/(v*y+x*m))}const C=T*r*g/n,S=-1*T*n*p/r,k=d*C-f*S+o/2,E=f*C+d*S+l/2;let A=Math.atan2((g-S)/n,(p-C)/r)-Math.atan2(0,1),R=A>=0?A:2*Math.PI+A;A=Math.atan2((-g-S)/n,(-p-C)/r)-Math.atan2((g-S)/n,(p-C)/r);let _=A>=0?A:2*Math.PI+A;a===0&&_>0?_-=2*Math.PI:a!==0&&_<0&&(_+=2*Math.PI);const P=_*2/Math.PI,N=Math.ceil(P<0?-1*P:P),L=_/N,I=8/3*Math.sin(L/4)*Math.sin(L/4)/Math.sin(L/2),$=d*r,O=d*n,D=f*r,F=f*n;let z=Math.cos(R),V=Math.sin(R),B=-I*($*V+F*z),H=-I*(D*V-O*z),G=0,W=0;const K=[];for(let q=0;q<N;q+=1){R+=L,z=Math.cos(R),V=Math.sin(R),G=$*z-F*V+k,W=D*z+O*V+E;const oe=-I*($*V+F*z),Q=-I*(D*V-O*z),Z=q*6;K[Z]=Number(B+t),K[Z+1]=Number(H+e),K[Z+2]=Number(G-oe+t),K[Z+3]=Number(W-Q+e),K[Z+4]=Number(G+t),K[Z+5]=Number(W+e),B=G+oe,H=W+Q}return K.map(q=>+q.toFixed(2))}class Ba extends Yg{static isPolyline(e){return e!=null&&e instanceof Ba}static parse(e){const r=e.trim();if(r==="")return new Ba;const n=[],i=r.split(/\s*,\s*|\s+/);for(let s=0,a=i.length;s<a;s+=2)n.push({x:+i[s],y:+i[s+1]});return new Ba(n)}get start(){return this.points[0]||null}get end(){return this.points[this.points.length-1]||null}constructor(e){if(super(),e!=null){if(typeof e=="string")return Ba.parse(e);this.points=e.map(r=>Qe.create(r))}else this.points=[]}scale(e,r,n=new Qe){return this.points.forEach(i=>i.scale(e,r,n)),this}rotate(e,r){return this.points.forEach(n=>n.rotate(e,r)),this}translate(e,r){const n=Qe.create(e,r);return this.points.forEach(i=>i.translate(n.x,n.y)),this}round(e=0){return this.points.forEach(r=>r.round(e)),this}bbox(){if(this.points.length===0)return new Bt;let e=1/0,r=-1/0,n=1/0,i=-1/0;const s=this.points;for(let a=0,o=s.length;a<o;a+=1){const l=s[a],u=l.x,h=l.y;u<e&&(e=u),u>r&&(r=u),h<n&&(n=h),h>i&&(i=h)}return new Bt(e,n,r-e,i-n)}closestPoint(e){const r=this.closestPointLength(e);return this.pointAtLength(r)}closestPointLength(e){const r=this.points,n=r.length;if(n===0||n===1)return 0;let i=0,s=0,a=1/0;for(let o=0,l=n-1;o<l;o+=1){const u=new lr(r[o],r[o+1]),h=u.length(),d=u.closestPointNormalizedLength(e),p=u.pointAt(d).squaredDistance(e);p<a&&(a=p,s=i+d*h),i+=h}return s}closestPointNormalizedLength(e){const r=this.length();return r===0?0:this.closestPointLength(e)/r}closestPointTangent(e){const r=this.closestPointLength(e);return this.tangentAtLength(r)}containsPoint(e){if(this.points.length===0)return!1;const r=Qe.clone(e),n=r.x,i=r.y,s=this.points,a=s.length;let o=a-1,l=0;for(let u=0;u<a;u+=1){const h=s[o],d=s[u];if(r.equals(h))return!0;const f=new lr(h,d);if(f.containsPoint(e))return!0;if(i<=h.y&&i>d.y||i>h.y&&i<=d.y){const p=h.x-n>d.x-n?h.x-n:d.x-n;if(p>=0){const g=new Qe(n+p,i),m=new lr(e,g);f.intersectsWithLine(m)&&(l+=1)}}o=u}return l%2===1}intersectsWithLine(e){const r=[];for(let n=0,i=this.points.length-1;n<i;n+=1){const s=this.points[n],a=this.points[n+1],o=e.intersectsWithLine(new lr(s,a));o&&r.push(o)}return r.length>0?r:null}isDifferentiable(){for(let e=0,r=this.points.length-1;e<r;e+=1){const n=this.points[e],i=this.points[e+1];if(new lr(n,i).isDifferentiable())return!0}return!1}length(){let e=0;for(let r=0,n=this.points.length-1;r<n;r+=1){const i=this.points[r],s=this.points[r+1];e+=i.distance(s)}return e}pointAt(e){const r=this.points,n=r.length;if(n===0)return null;if(n===1||e<=0)return r[0].clone();if(e>=1)return r[n-1].clone();const s=this.length()*e;return this.pointAtLength(s)}pointAtLength(e){const r=this.points,n=r.length;if(n===0)return null;if(n===1)return r[0].clone();let i=!0;e<0&&(i=!1,e=-e);let s=0;for(let o=0,l=n-1;o<l;o+=1){const u=i?o:l-1-o,h=r[u],d=r[u+1],f=new lr(h,d),p=h.distance(d);if(e<=s+p)return f.pointAtLength((i?1:-1)*(e-s));s+=p}return(i?r[n-1]:r[0]).clone()}tangentAt(e){const n=this.points.length;if(n===0||n===1)return null;e<0&&(e=0),e>1&&(e=1);const s=this.length()*e;return this.tangentAtLength(s)}tangentAtLength(e){const r=this.points,n=r.length;if(n===0||n===1)return null;let i=!0;e<0&&(i=!1,e=-e);let s,a=0;for(let o=0,l=n-1;o<l;o+=1){const u=i?o:l-1-o,h=r[u],d=r[u+1],f=new lr(h,d),p=h.distance(d);if(f.isDifferentiable()){if(e<=a+p)return f.tangentAtLength((i?1:-1)*(e-a));s=f}a+=p}if(s){const o=i?1:0;return s.tangentAt(o)}return null}simplify(e={}){const r=this.points;if(r.length<3)return this;const n=e.threshold||0;let i=0;for(;r[i+2];){const s=i,a=i+1,o=i+2,l=r[s],u=r[a],h=r[o];new lr(l,h).closestPoint(u).distance(u)<=n?r.splice(a,1):i+=1}return this}toHull(){const e=this.points,r=e.length;if(r===0)return new Ba;let n=e[0];for(let f=1;f<r;f+=1)(e[f].y<n.y||e[f].y===n.y&&e[f].x>n.x)&&(n=e[f]);const i=[];for(let f=0;f<r;f+=1){let p=n.theta(e[f]);p===0&&(p=360),i.push([e[f],f,p])}if(i.sort((f,p)=>{let g=f[2]-p[2];return g===0&&(g=p[1]-f[1]),g}),i.length>2){const f=i[i.length-1];i.unshift(f)}const s={},a=[],o=f=>`${f[0].toString()}@${f[1]}`;for(;i.length!==0;){const f=i.pop(),p=f[0];if(s[o(f)])continue;let g=!1;for(;!g;)if(a.length<2)a.push(f),g=!0;else{const m=a.pop(),y=m[0],v=a.pop(),x=v[0],b=x.cross(y,p);if(b<0)a.push(v),a.push(m),a.push(f),g=!0;else if(b===0){const C=y.angleBetween(x,p);Math.abs(C-180)<1e-10||y.equals(p)||x.equals(y)?(s[o(m)]=y,a.push(v)):Math.abs((C+1)%360-1)<1e-10&&(a.push(v),i.push(m))}else s[o(m)]=y,a.push(v)}}a.length>2&&a.pop();let l,u=-1;for(let f=0,p=a.length;f<p;f+=1){const g=a[f][1];(l===void 0||g<l)&&(l=g,u=f)}let h=[];if(u>0){const f=a.slice(u),p=a.slice(0,u);h=f.concat(p)}else h=a;const d=[];for(let f=0,p=h.length;f<p;f+=1)d.push(h[f][0]);return new Ba(d)}equals(e){return e==null||e.points.length!==this.points.length?!1:e.points.every((r,n)=>r.equals(this.points[n]))}clone(){return new Ba(this.points.map(e=>e.clone()))}toJSON(){return this.points.map(e=>e.toJSON())}serialize(){return this.points.map(e=>`${e.serialize()}`).join(" ")}}let Jf=class Wu extends Yg{static isCurve(e){return e!=null&&e instanceof Wu}static throughPoints(e){if(e==null||Array.isArray(e)&&e.length<2)throw new Error("At least 2 points are required");const r=wrt(e),n=[];for(let i=0,s=r[0].length;i<s;i+=1){const a=new Qe(r[0][i].x,r[0][i].y),o=new Qe(r[1][i].x,r[1][i].y);n.push(new Wu(e[i],a,o,e[i+1]))}return n}constructor(e,r,n,i){super(),this.PRECISION=3,this.start=Qe.create(e),this.controlPoint1=Qe.create(r),this.controlPoint2=Qe.create(n),this.end=Qe.create(i)}bbox(){const e=this.start,r=this.controlPoint1,n=this.controlPoint2,i=this.end,s=e.x,a=e.y,o=r.x,l=r.y,u=n.x,h=n.y,d=i.x,f=i.y,p=[],g=[[],[]];let m,y,v,x,b,T,C,S;for(let $=0;$<2;$+=1){if($===0?(y=6*s-12*o+6*u,m=-3*s+9*o-9*u+3*d,v=3*o-3*s):(y=6*a-12*l+6*h,m=-3*a+9*l-9*h+3*f,v=3*l-3*a),Math.abs(m)<1e-12){if(Math.abs(y)<1e-12)continue;x=-v/y,x>0&&x<1&&p.push(x);continue}C=y*y-4*v*m,S=Math.sqrt(C),!(C<0)&&(b=(-y+S)/(2*m),b>0&&b<1&&p.push(b),T=(-y-S)/(2*m),T>0&&T<1&&p.push(T))}let k,E,A,R=p.length;const _=R;for(;R;)R-=1,x=p[R],A=1-x,k=A*A*A*s+3*A*A*x*o+3*A*x*x*u+x*x*x*d,g[0][R]=k,E=A*A*A*a+3*A*A*x*l+3*A*x*x*h+x*x*x*f,g[1][R]=E;p[_]=0,p[_+1]=1,g[0][_]=s,g[1][_]=a,g[0][_+1]=d,g[1][_+1]=f,p.length=_+2,g[0].length=_+2,g[1].length=_+2;const P=Math.min.apply(null,g[0]),N=Math.min.apply(null,g[1]),L=Math.max.apply(null,g[0]),I=Math.max.apply(null,g[1]);return new Bt(P,N,L-P,I-N)}closestPoint(e,r={}){return this.pointAtT(this.closestPointT(e,r))}closestPointLength(e,r={}){const n=this.getOptions(r);return this.lengthAtT(this.closestPointT(e,n),n)}closestPointNormalizedLength(e,r={}){const n=this.getOptions(r),i=this.closestPointLength(e,n);if(!i)return 0;const s=this.length(n);return s===0?0:i/s}closestPointT(e,r={}){const n=this.getPrecision(r),i=this.getDivisions(r),s=Math.pow(10,-n);let a=null,o=0,l=0,u=0,h=0,d=0,f=null;const p=i.length;let g=p>0?1/p:0;for(i.forEach((m,y)=>{const v=m.start.distance(e),x=m.end.distance(e),b=v+x;(f==null||b<f)&&(a=m,o=y*g,l=(y+1)*g,u=v,h=x,f=b,d=m.endpointDistance())});;){const m=u?Math.abs(u-h)/u:0,y=h!=null?Math.abs(u-h)/h:0,v=m<s||y<s,x=u?u<d*s:!0,b=h?h<d*s:!0;if(v||(x||b))return u<=h?o:l;const C=a.divide(.5);g/=2;const S=C[0].start.distance(e),k=C[0].end.distance(e),E=S+k,A=C[1].start.distance(e),R=C[1].end.distance(e),_=A+R;E<=_?(a=C[0],l-=g,u=S,h=k):(a=C[1],o+=g,u=A,h=R)}}closestPointTangent(e,r={}){return this.tangentAtT(this.closestPointT(e,r))}containsPoint(e,r={}){return this.toPolyline(r).containsPoint(e)}divideAt(e,r={}){if(e<=0)return this.divideAtT(0);if(e>=1)return this.divideAtT(1);const n=this.tAt(e,r);return this.divideAtT(n)}divideAtLength(e,r={}){const n=this.tAtLength(e,r);return this.divideAtT(n)}divide(e){return this.divideAtT(e)}divideAtT(e){const r=this.start,n=this.controlPoint1,i=this.controlPoint2,s=this.end;if(e<=0)return[new Wu(r,r,r,r),new Wu(r,n,i,s)];if(e>=1)return[new Wu(r,n,i,s),new Wu(s,s,s,s)];const a=this.getSkeletonPoints(e),o=a.startControlPoint1,l=a.startControlPoint2,u=a.divider,h=a.dividerControlPoint1,d=a.dividerControlPoint2;return[new Wu(r,o,l,u),new Wu(u,h,d,s)]}endpointDistance(){return this.start.distance(this.end)}getSkeletonPoints(e){const r=this.start,n=this.controlPoint1,i=this.controlPoint2,s=this.end;if(e<=0)return{startControlPoint1:r.clone(),startControlPoint2:r.clone(),divider:r.clone(),dividerControlPoint1:n.clone(),dividerControlPoint2:i.clone()};if(e>=1)return{startControlPoint1:n.clone(),startControlPoint2:i.clone(),divider:s.clone(),dividerControlPoint1:s.clone(),dividerControlPoint2:s.clone()};const a=new lr(r,n).pointAt(e),o=new lr(n,i).pointAt(e),l=new lr(i,s).pointAt(e),u=new lr(a,o).pointAt(e),h=new lr(o,l).pointAt(e),d=new lr(u,h).pointAt(e);return{startControlPoint1:a,startControlPoint2:u,divider:d,dividerControlPoint1:h,dividerControlPoint2:l}}getSubdivisions(e={}){const r=this.getPrecision(e);let n=[new Wu(this.start,this.controlPoint1,this.controlPoint2,this.end)];if(r===0)return n;let i=this.endpointDistance();const s=Math.pow(10,-r);let a=0;for(;;){a+=1;const o=[];n.forEach(h=>{const d=h.divide(.5);o.push(d[0],d[1])});const l=o.reduce((h,d)=>h+d.endpointDistance(),0),u=l!==0?(l-i)/l:0;if(a>1&&u<s)return o;n=o,i=l}}length(e={}){return this.getDivisions(e).reduce((n,i)=>n+i.endpointDistance(),0)}lengthAtT(e,r={}){if(e<=0)return 0;const n=r.precision===void 0?this.PRECISION:r.precision;return this.divide(e)[0].length({precision:n})}pointAt(e,r={}){if(e<=0)return this.start.clone();if(e>=1)return this.end.clone();const n=this.tAt(e,r);return this.pointAtT(n)}pointAtLength(e,r={}){const n=this.tAtLength(e,r);return this.pointAtT(n)}pointAtT(e){return e<=0?this.start.clone():e>=1?this.end.clone():this.getSkeletonPoints(e).divider}isDifferentiable(){const e=this.start,r=this.controlPoint1,n=this.controlPoint2,i=this.end;return!(e.equals(r)&&r.equals(n)&&n.equals(i))}tangentAt(e,r={}){if(!this.isDifferentiable())return null;e<0?e=0:e>1&&(e=1);const n=this.tAt(e,r);return this.tangentAtT(n)}tangentAtLength(e,r={}){if(!this.isDifferentiable())return null;const n=this.tAtLength(e,r);return this.tangentAtT(n)}tangentAtT(e){if(!this.isDifferentiable())return null;e<0&&(e=0),e>1&&(e=1);const r=this.getSkeletonPoints(e),n=r.startControlPoint2,i=r.dividerControlPoint1,s=r.divider,a=new lr(n,i);return a.translate(s.x-n.x,s.y-n.y),a}getPrecision(e={}){return e.precision==null?this.PRECISION:e.precision}getDivisions(e={}){if(e.subdivisions!=null)return e.subdivisions;const r=this.getPrecision(e);return this.getSubdivisions({precision:r})}getOptions(e={}){const r=this.getPrecision(e),n=this.getDivisions(e);return{precision:r,subdivisions:n}}tAt(e,r={}){if(e<=0)return 0;if(e>=1)return 1;const n=this.getOptions(r),s=this.length(n)*e;return this.tAtLength(s,n)}tAtLength(e,r={}){let n=!0;e<0&&(n=!1,e=-e);const i=this.getPrecision(r),s=this.getDivisions(r),a={precision:i,subdivisions:s};let o=null,l,u,h=0,d=0,f=0;const p=s.length;let g=p>0?1/p:0;for(let v=0;v<p;v+=1){const x=n?v:p-1-v,b=s[v],T=b.endpointDistance();if(e<=f+T){o=b,l=x*g,u=(x+1)*g,h=n?e-f:T+f-e,d=n?T+f-e:e-f;break}f+=T}if(o==null)return n?1:0;const m=this.length(a),y=Math.pow(10,-i);for(;;){let v;if(v=m!==0?h/m:0,v<y)return l;if(v=m!==0?d/m:0,v<y)return u;let x,b;const T=o.divide(.5);g/=2;const C=T[0].endpointDistance(),S=T[1].endpointDistance();h<=C?(o=T[0],u-=g,x=h,b=C-x):(o=T[1],l+=g,x=h-C,b=S-x),h=x,d=b}}toPoints(e={}){const r=this.getDivisions(e),n=[r[0].start.clone()];return r.forEach(i=>n.push(i.end.clone())),n}toPolyline(e={}){return new Ba(this.toPoints(e))}scale(e,r,n){return this.start.scale(e,r,n),this.controlPoint1.scale(e,r,n),this.controlPoint2.scale(e,r,n),this.end.scale(e,r,n),this}rotate(e,r){return this.start.rotate(e,r),this.controlPoint1.rotate(e,r),this.controlPoint2.rotate(e,r),this.end.rotate(e,r),this}translate(e,r){return typeof e=="number"?(this.start.translate(e,r),this.controlPoint1.translate(e,r),this.controlPoint2.translate(e,r),this.end.translate(e,r)):(this.start.translate(e),this.controlPoint1.translate(e),this.controlPoint2.translate(e),this.end.translate(e)),this}equals(e){return e!=null&&this.start.equals(e.start)&&this.controlPoint1.equals(e.controlPoint1)&&this.controlPoint2.equals(e.controlPoint2)&&this.end.equals(e.end)}clone(){return new Wu(this.start,this.controlPoint1,this.controlPoint2,this.end)}toJSON(){return{start:this.start.toJSON(),controlPoint1:this.controlPoint1.toJSON(),controlPoint2:this.controlPoint2.toJSON(),end:this.end.toJSON()}}serialize(){return[this.start.serialize(),this.controlPoint1.serialize(),this.controlPoint2.serialize(),this.end.serialize()].join(" ")}};function lse(t){const e=t.length,r=[],n=[];let i=2;r[0]=t[0]/i;for(let s=1;s<e;s+=1)n[s]=1/i,i=(s<e-1?4:3.5)-n[s],r[s]=(t[s]-r[s-1])/i;for(let s=1;s<e;s+=1)r[e-s-1]-=n[e-s]*r[e-s];return r}function wrt(t){const e=t.map(l=>Qe.clone(l)),r=[],n=[],i=e.length-1;if(i===1)return r[0]=new Qe((2*e[0].x+e[1].x)/3,(2*e[0].y+e[1].y)/3),n[0]=new Qe(2*r[0].x-e[0].x,2*r[0].y-e[0].y),[r,n];const s=[];for(let l=1;l<i-1;l+=1)s[l]=4*e[l].x+2*e[l+1].x;s[0]=e[0].x+2*e[1].x,s[i-1]=(8*e[i-1].x+e[i].x)/2;const a=lse(s);for(let l=1;l<i-1;l+=1)s[l]=4*e[l].y+2*e[l+1].y;s[0]=e[0].y+2*e[1].y,s[i-1]=(8*e[i-1].y+e[i].y)/2;const o=lse(s);for(let l=0;l<i;l+=1)r.push(new Qe(a[l],o[l])),l<i-1?n.push(new Qe(2*e[l+1].x-a[l+1],2*e[l+1].y-o[l+1])):n.push(new Qe((e[i].x+a[i-1])/2,(e[i].y+o[i-1])/2));return[r,n]}class bN extends Yg{constructor(){super(...arguments),this.isVisible=!0,this.isSegment=!0,this.isSubpathStart=!1}get end(){return this.endPoint}get start(){if(this.previousSegment==null)throw new Error("Missing previous segment. (This segment cannot be the first segment of a path, or segment has not yet been added to a path.)");return this.previousSegment.end}closestPointT(e,r){if(this.closestPointNormalizedLength)return this.closestPointNormalizedLength(e);throw new Error("Neither `closestPointT` nor `closestPointNormalizedLength` method is implemented.")}lengthAtT(e,r){if(e<=0)return 0;const n=this.length();return e>=1?n:n*e}divideAtT(e){if(this.divideAt)return this.divideAt(e);throw new Error("Neither `divideAtT` nor `divideAt` method is implemented.")}pointAtT(e){if(this.pointAt)return this.pointAt(e);throw new Error("Neither `pointAtT` nor `pointAt` method is implemented.")}tangentAtT(e){if(this.tangentAt)return this.tangentAt(e);throw new Error("Neither `tangentAtT` nor `tangentAt` method is implemented.")}}class xa extends bN{static create(...e){const r=e.length,n=e[0];if(lr.isLine(n))return new xa(n);if(Qe.isPointLike(n))return r===1?new xa(n):e.map(s=>new xa(s));if(r===2)return new xa(+e[0],+e[1]);const i=[];for(let s=0;s<r;s+=2){const a=+e[s],o=+e[s+1];i.push(new xa(a,o))}return i}constructor(e,r){super(),lr.isLine(e)?this.endPoint=e.end.clone().round(2):this.endPoint=Qe.create(e,r).round(2)}get type(){return"L"}get line(){return new lr(this.start,this.end)}bbox(){return this.line.bbox()}closestPoint(e){return this.line.closestPoint(e)}closestPointLength(e){return this.line.closestPointLength(e)}closestPointNormalizedLength(e){return this.line.closestPointNormalizedLength(e)}closestPointTangent(e){return this.line.closestPointTangent(e)}length(){return this.line.length()}divideAt(e){const r=this.line.divideAt(e);return[new xa(r[0]),new xa(r[1])]}divideAtLength(e){const r=this.line.divideAtLength(e);return[new xa(r[0]),new xa(r[1])]}getSubdivisions(){return[]}pointAt(e){return this.line.pointAt(e)}pointAtLength(e){return this.line.pointAtLength(e)}tangentAt(e){return this.line.tangentAt(e)}tangentAtLength(e){return this.line.tangentAtLength(e)}isDifferentiable(){return this.previousSegment==null?!1:!this.start.equals(this.end)}clone(){return new xa(this.end)}scale(e,r,n){return this.end.scale(e,r,n),this}rotate(e,r){return this.end.rotate(e,r),this}translate(e,r){return typeof e=="number"?this.end.translate(e,r):this.end.translate(e),this}equals(e){return this.type===e.type&&this.start.equals(e.start)&&this.end.equals(e.end)}toJSON(){return{type:this.type,start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){const e=this.end;return`${this.type} ${e.x} ${e.y}`}}class PS extends bN{static create(){return new PS}get end(){if(!this.subpathStartSegment)throw new Error("Missing subpath start segment. (This segment needs a subpath start segment (e.g. MoveTo), or segment has not yet been added to a path.)");return this.subpathStartSegment.end}get type(){return"Z"}get line(){return new lr(this.start,this.end)}bbox(){return this.line.bbox()}closestPoint(e){return this.line.closestPoint(e)}closestPointLength(e){return this.line.closestPointLength(e)}closestPointNormalizedLength(e){return this.line.closestPointNormalizedLength(e)}closestPointTangent(e){return this.line.closestPointTangent(e)}length(){return this.line.length()}divideAt(e){const r=this.line.divideAt(e);return[r[1].isDifferentiable()?new xa(r[0]):this.clone(),new xa(r[1])]}divideAtLength(e){const r=this.line.divideAtLength(e);return[r[1].isDifferentiable()?new xa(r[0]):this.clone(),new xa(r[1])]}getSubdivisions(){return[]}pointAt(e){return this.line.pointAt(e)}pointAtLength(e){return this.line.pointAtLength(e)}tangentAt(e){return this.line.tangentAt(e)}tangentAtLength(e){return this.line.tangentAtLength(e)}isDifferentiable(){return!this.previousSegment||!this.subpathStartSegment?!1:!this.start.equals(this.end)}scale(){return this}rotate(){return this}translate(){return this}equals(e){return this.type===e.type&&this.start.equals(e.start)&&this.end.equals(e.end)}clone(){return new PS}toJSON(){return{type:this.type,start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){return this.type}}class nd extends bN{static create(...e){const r=e.length,n=e[0];if(lr.isLine(n))return new nd(n);if(Jf.isCurve(n))return new nd(n);if(Qe.isPointLike(n)){if(r===1)return new nd(n);const s=[];for(let a=0;a<r;a+=1)a===0?s.push(new nd(e[a])):s.push(new xa(e[a]));return s}if(r===2)return new nd(+e[0],+e[1]);const i=[];for(let s=0;s<r;s+=2){const a=+e[s],o=+e[s+1];s===0?i.push(new nd(a,o)):i.push(new xa(a,o))}return i}constructor(e,r){super(),this.isVisible=!1,this.isSubpathStart=!0,lr.isLine(e)||Jf.isCurve(e)?this.endPoint=e.end.clone().round(2):this.endPoint=Qe.create(e,r).round(2)}get start(){throw new Error("Illegal access. Moveto segments should not need a start property.")}get type(){return"M"}bbox(){return null}closestPoint(){return this.end.clone()}closestPointLength(){return 0}closestPointNormalizedLength(){return 0}closestPointT(){return 1}closestPointTangent(){return null}length(){return 0}lengthAtT(){return 0}divideAt(){return[this.clone(),this.clone()]}divideAtLength(){return[this.clone(),this.clone()]}getSubdivisions(){return[]}pointAt(){return this.end.clone()}pointAtLength(){return this.end.clone()}pointAtT(){return this.end.clone()}tangentAt(){return null}tangentAtLength(){return null}tangentAtT(){return null}isDifferentiable(){return!1}scale(e,r,n){return this.end.scale(e,r,n),this}rotate(e,r){return this.end.rotate(e,r),this}translate(e,r){return typeof e=="number"?this.end.translate(e,r):this.end.translate(e),this}clone(){return new nd(this.end)}equals(e){return this.type===e.type&&this.end.equals(e.end)}toJSON(){return{type:this.type,end:this.end.toJSON()}}serialize(){const e=this.end;return`${this.type} ${e.x} ${e.y}`}}class ol extends bN{static create(...e){const r=e.length,n=e[0];if(Jf.isCurve(n))return new ol(n);if(Qe.isPointLike(n)){if(r===3)return new ol(e[0],e[1],e[2]);const s=[];for(let a=0;a<r;a+=3)s.push(new ol(e[a],e[a+1],e[a+2]));return s}if(r===6)return new ol(e[0],e[1],e[2],e[3],e[4],e[5]);const i=[];for(let s=0;s<r;s+=6)i.push(new ol(e[s],e[s+1],e[s+2],e[s+3],e[s+4],e[s+5]));return i}constructor(e,r,n,i,s,a){super(),Jf.isCurve(e)?(this.controlPoint1=e.controlPoint1.clone().round(2),this.controlPoint2=e.controlPoint2.clone().round(2),this.endPoint=e.end.clone().round(2)):typeof e=="number"?(this.controlPoint1=new Qe(e,r).round(2),this.controlPoint2=new Qe(n,i).round(2),this.endPoint=new Qe(s,a).round(2)):(this.controlPoint1=Qe.create(e).round(2),this.controlPoint2=Qe.create(r).round(2),this.endPoint=Qe.create(n).round(2))}get type(){return"C"}get curve(){return new Jf(this.start,this.controlPoint1,this.controlPoint2,this.end)}bbox(){return this.curve.bbox()}closestPoint(e){return this.curve.closestPoint(e)}closestPointLength(e){return this.curve.closestPointLength(e)}closestPointNormalizedLength(e){return this.curve.closestPointNormalizedLength(e)}closestPointTangent(e){return this.curve.closestPointTangent(e)}length(){return this.curve.length()}divideAt(e,r={}){const n=this.curve.divideAt(e,r);return[new ol(n[0]),new ol(n[1])]}divideAtLength(e,r={}){const n=this.curve.divideAtLength(e,r);return[new ol(n[0]),new ol(n[1])]}divideAtT(e){const r=this.curve.divideAtT(e);return[new ol(r[0]),new ol(r[1])]}getSubdivisions(){return[]}pointAt(e){return this.curve.pointAt(e)}pointAtLength(e){return this.curve.pointAtLength(e)}tangentAt(e){return this.curve.tangentAt(e)}tangentAtLength(e){return this.curve.tangentAtLength(e)}isDifferentiable(){if(!this.previousSegment)return!1;const e=this.start,r=this.controlPoint1,n=this.controlPoint2,i=this.end;return!(e.equals(r)&&r.equals(n)&&n.equals(i))}scale(e,r,n){return this.controlPoint1.scale(e,r,n),this.controlPoint2.scale(e,r,n),this.end.scale(e,r,n),this}rotate(e,r){return this.controlPoint1.rotate(e,r),this.controlPoint2.rotate(e,r),this.end.rotate(e,r),this}translate(e,r){return typeof e=="number"?(this.controlPoint1.translate(e,r),this.controlPoint2.translate(e,r),this.end.translate(e,r)):(this.controlPoint1.translate(e),this.controlPoint2.translate(e),this.end.translate(e)),this}equals(e){return this.start.equals(e.start)&&this.end.equals(e.end)&&this.controlPoint1.equals(e.controlPoint1)&&this.controlPoint2.equals(e.controlPoint2)}clone(){return new ol(this.controlPoint1,this.controlPoint2,this.end)}toJSON(){return{type:this.type,start:this.start.toJSON(),controlPoint1:this.controlPoint1.toJSON(),controlPoint2:this.controlPoint2.toJSON(),end:this.end.toJSON()}}serialize(){const e=this.controlPoint1,r=this.controlPoint2,n=this.end;return[this.type,e.x,e.y,r.x,r.y,n.x,n.y].join(" ")}}function a7(t,e,r){return{x:t*Math.cos(r)-e*Math.sin(r),y:t*Math.sin(r)+e*Math.cos(r)}}function cse(t,e,r,n,i,s){const a=.3333333333333333,o=2/3;return[a*t+o*r,a*e+o*n,a*i+o*r,a*s+o*n,i,s]}function A2e(t,e,r,n,i,s,a,o,l,u){const h=Math.PI*120/180,d=Math.PI/180*(+i||0);let f=[],p,g,m,y,v;if(u)g=u[0],m=u[1],y=u[2],v=u[3];else{p=a7(t,e,-d),t=p.x,e=p.y,p=a7(o,l,-d),o=p.x,l=p.y;const L=(t-o)/2,I=(e-l)/2;let $=L*L/(r*r)+I*I/(n*n);$>1&&($=Math.sqrt($),r=$*r,n=$*n);const O=r*r,D=n*n,F=(s===a?-1:1)*Math.sqrt(Math.abs((O*D-O*I*I-D*L*L)/(O*I*I+D*L*L)));y=F*r*I/n+(t+o)/2,v=F*-n*L/r+(e+l)/2,g=Math.asin((e-v)/n),m=Math.asin((l-v)/n),g=t<y?Math.PI-g:g,m=o<y?Math.PI-m:m,g<0&&(g=Math.PI*2+g),m<0&&(m=Math.PI*2+m),a&&g>m&&(g-=Math.PI*2),!a&&m>g&&(m-=Math.PI*2)}let x=m-g;if(Math.abs(x)>h){const L=m,I=o,$=l;m=g+h*(a&&m>g?1:-1),o=y+r*Math.cos(m),l=v+n*Math.sin(m),f=A2e(o,l,r,n,i,0,a,I,$,[m,L,y,v])}x=m-g;const b=Math.cos(g),T=Math.sin(g),C=Math.cos(m),S=Math.sin(m),k=Math.tan(x/4),E=4/3*(r*k),A=4/3*(n*k),R=[t,e],_=[t+E*T,e-A*b],P=[o+E*S,l-A*C],N=[o,l];if(_[0]=2*R[0]-_[0],_[1]=2*R[1]-_[1],u)return[_,P,N].concat(f);{f=[_,P,N].concat(f).join().split(",");const L=[],I=f.length;for(let $=0;$<I;$+=1)L[$]=$%2?a7(+f[$-1],+f[$],d).y:a7(+f[$],+f[$+1],d).x;return L}}function Trt(t){if(!t)return null;const e=`+ <script type="module" crossorigin>var zYe=Object.defineProperty;var VYe=(t,e,r)=>e in t?zYe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var wr=(t,e,r)=>VYe(t,typeof e!="symbol"?e+"":e,r);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&n(a)}).observe(document,{childList:!0,subtree:!0});function r(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(i){if(i.ep)return;i.ep=!0;const s=r(i);fetch(i.href,s)}})();function gn(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function Nn(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(s=(i<3?a(s):i>3?a(e,r,s):a(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}function aX(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function o(h){try{u(n.next(h))}catch(d){a(d)}}function l(h){try{u(n.throw(h))}catch(d){a(d)}}function u(h){h.done?s(h.value):i(h.value).then(o,l)}u((n=n.apply(t,e||[])).next())})}function HYe(t){t.forEach(e=>{Object.hasOwn(e,"append")||Object.defineProperty(e,"append",{configurable:!0,enumerable:!0,writable:!0,value(...r){const n=document.createDocumentFragment();r.forEach(i=>{const s=i instanceof Node;n.appendChild(s?i:document.createTextNode(String(i)))}),this.appendChild(n)}})})}typeof window=="object"&&window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach);typeof window<"u"&&(t=>{HYe(t)})([Element.prototype,Document.prototype,DocumentFragment.prototype]);var cve=typeof global=="object"&&global&&global.Object===Object&&global,GYe=typeof self=="object"&&self&&self.Object===Object&&self,Ih=cve||GYe||Function("return this")(),Mu=Ih.Symbol,uve=Object.prototype,WYe=uve.hasOwnProperty,qYe=uve.toString,V3=Mu?Mu.toStringTag:void 0;function UYe(t){var e=WYe.call(t,V3),r=t[V3];try{t[V3]=void 0;var n=!0}catch{}var i=qYe.call(t);return n&&(e?t[V3]=r:delete t[V3]),i}var jYe=Object.prototype,YYe=jYe.toString;function XYe(t){return YYe.call(t)}var KYe="[object Null]",ZYe="[object Undefined]",bie=Mu?Mu.toStringTag:void 0;function Hg(t){return t==null?t===void 0?ZYe:KYe:bie&&bie in Object(t)?UYe(t):XYe(t)}function Eh(t){return t!=null&&typeof t=="object"}var QYe="[object Symbol]";function _d(t){return typeof t=="symbol"||Eh(t)&&Hg(t)==QYe}function yb(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}var Bs=Array.isArray,xie=Mu?Mu.prototype:void 0,wie=xie?xie.toString:void 0;function hve(t){if(typeof t=="string")return t;if(Bs(t))return yb(t,hve)+"";if(_d(t))return wie?wie.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}var JYe=/\s/;function eXe(t){for(var e=t.length;e--&&JYe.test(t.charAt(e)););return e}var tXe=/^\s+/;function rXe(t){return t&&t.slice(0,eXe(t)+1).replace(tXe,"")}function $s(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Tie=NaN,nXe=/^[-+]0x[0-9a-f]+$/i,iXe=/^0b[01]+$/i,sXe=/^0o[0-7]+$/i,aXe=parseInt;function vb(t){if(typeof t=="number")return t;if(_d(t))return Tie;if($s(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=$s(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=rXe(t);var r=iXe.test(t);return r||sXe.test(t)?aXe(t.slice(2),r?2:8):nXe.test(t)?Tie:+t}var Cie=1/0,oXe=17976931348623157e292;function bM(t){if(!t)return t===0?t:0;if(t=vb(t),t===Cie||t===-Cie){var e=t<0?-1:1;return e*oXe}return t===t?t:0}function lXe(t){var e=bM(t),r=e%1;return e===e?r?e-r:e:0}function Gg(t){return t}var cXe="[object AsyncFunction]",uXe="[object Function]",hXe="[object GeneratorFunction]",dXe="[object Proxy]";function _S(t){if(!$s(t))return!1;var e=Hg(t);return e==uXe||e==hXe||e==cXe||e==dXe}var KP=Ih["__core-js_shared__"],kie=(function(){var t=/[^.]+$/.exec(KP&&KP.keys&&KP.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function fXe(t){return!!kie&&kie in t}var pXe=Function.prototype,gXe=pXe.toString;function Gy(t){if(t!=null){try{return gXe.call(t)}catch{}try{return t+""}catch{}}return""}var mXe=/[\\^$.*+?()[\]{}|]/g,yXe=/^\[object .+?Constructor\]$/,vXe=Function.prototype,bXe=Object.prototype,xXe=vXe.toString,wXe=bXe.hasOwnProperty,TXe=RegExp("^"+xXe.call(wXe).replace(mXe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function CXe(t){if(!$s(t)||fXe(t))return!1;var e=_S(t)?TXe:yXe;return e.test(Gy(t))}function kXe(t,e){return t==null?void 0:t[e]}function Wy(t,e){var r=kXe(t,e);return CXe(r)?r:void 0}var FV=Wy(Ih,"WeakMap"),Sie=Object.create,SXe=(function(){function t(){}return function(e){if(!$s(e))return{};if(Sie)return Sie(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}})();function dve(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 EXe(){}function fve(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var AXe=800,MXe=16,RXe=Date.now;function _Xe(t){var e=0,r=0;return function(){var n=RXe(),i=MXe-(n-r);if(r=n,i>0){if(++e>=AXe)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Y2(t){return function(){return t}}var s9=(function(){try{var t=Wy(Object,"defineProperty");return t({},"",{}),t}catch{}})(),LXe=s9?function(t,e){return s9(t,"toString",{configurable:!0,enumerable:!1,value:Y2(e),writable:!0})}:Gg,pve=_Xe(LXe);function gve(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}function mve(t,e,r,n){for(var i=t.length,s=r+-1;++s<i;)if(e(t[s],s,t))return s;return-1}function IXe(t){return t!==t}function NXe(t,e,r){for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}function DXe(t,e,r){return e===e?NXe(t,e,r):mve(t,IXe,r)}function yve(t,e){var r=t==null?0:t.length;return!!r&&DXe(t,e,0)>-1}var OXe=9007199254740991,PXe=/^(?:0|[1-9]\d*)$/;function iN(t,e){var r=typeof t;return e=e??OXe,!!e&&(r=="number"||r!="symbol"&&PXe.test(t))&&t>-1&&t%1==0&&t<e}function R6(t,e,r){e=="__proto__"&&s9?s9(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function K5(t,e){return t===e||t!==t&&e!==e}var $Xe=Object.prototype,BXe=$Xe.hasOwnProperty;function sN(t,e,r){var n=t[e];(!(BXe.call(t,e)&&K5(n,r))||r===void 0&&!(e in t))&&R6(t,e,r)}function _6(t,e,r,n){var i=!r;r||(r={});for(var s=-1,a=e.length;++s<a;){var o=e[s],l=void 0;l===void 0&&(l=t[o]),i?R6(r,o,l):sN(r,o,l)}return r}var Eie=Math.max;function vve(t,e,r){return e=Eie(e===void 0?t.length-1:e,0),function(){for(var n=arguments,i=-1,s=Eie(n.length-e,0),a=Array(s);++i<s;)a[i]=n[e+i];i=-1;for(var o=Array(e+1);++i<e;)o[i]=n[i];return o[e]=r(a),dve(t,this,o)}}function Z5(t,e){return pve(vve(t,e,Gg),t+"")}var FXe=9007199254740991;function oX(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=FXe}function Wg(t){return t!=null&&oX(t.length)&&!_S(t)}function LS(t,e,r){if(!$s(r))return!1;var n=typeof e;return(n=="number"?Wg(r)&&iN(e,r.length):n=="string"&&e in r)?K5(r[e],t):!1}function bve(t){return Z5(function(e,r){var n=-1,i=r.length,s=i>1?r[i-1]:void 0,a=i>2?r[2]:void 0;for(s=t.length>3&&typeof s=="function"?(i--,s):void 0,a&&LS(r[0],r[1],a)&&(s=i<3?void 0:s,i=1),e=Object(e);++n<i;){var o=r[n];o&&t(e,o,n,s)}return e})}var zXe=Object.prototype;function aN(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||zXe;return t===r}function VXe(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var HXe="[object Arguments]";function Aie(t){return Eh(t)&&Hg(t)==HXe}var xve=Object.prototype,GXe=xve.hasOwnProperty,WXe=xve.propertyIsEnumerable,NT=Aie((function(){return arguments})())?Aie:function(t){return Eh(t)&&GXe.call(t,"callee")&&!WXe.call(t,"callee")};function qXe(){return!1}var wve=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Mie=wve&&typeof module=="object"&&module&&!module.nodeType&&module,UXe=Mie&&Mie.exports===wve,Rie=UXe?Ih.Buffer:void 0,jXe=Rie?Rie.isBuffer:void 0,DT=jXe||qXe,YXe="[object Arguments]",XXe="[object Array]",KXe="[object Boolean]",ZXe="[object Date]",QXe="[object Error]",JXe="[object Function]",eKe="[object Map]",tKe="[object Number]",rKe="[object Object]",nKe="[object RegExp]",iKe="[object Set]",sKe="[object String]",aKe="[object WeakMap]",oKe="[object ArrayBuffer]",lKe="[object DataView]",cKe="[object Float32Array]",uKe="[object Float64Array]",hKe="[object Int8Array]",dKe="[object Int16Array]",fKe="[object Int32Array]",pKe="[object Uint8Array]",gKe="[object Uint8ClampedArray]",mKe="[object Uint16Array]",yKe="[object Uint32Array]",Ui={};Ui[cKe]=Ui[uKe]=Ui[hKe]=Ui[dKe]=Ui[fKe]=Ui[pKe]=Ui[gKe]=Ui[mKe]=Ui[yKe]=!0;Ui[YXe]=Ui[XXe]=Ui[oKe]=Ui[KXe]=Ui[lKe]=Ui[ZXe]=Ui[QXe]=Ui[JXe]=Ui[eKe]=Ui[tKe]=Ui[rKe]=Ui[nKe]=Ui[iKe]=Ui[sKe]=Ui[aKe]=!1;function vKe(t){return Eh(t)&&oX(t.length)&&!!Ui[Hg(t)]}function oN(t){return function(e){return t(e)}}var Tve=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Dk=Tve&&typeof module=="object"&&module&&!module.nodeType&&module,bKe=Dk&&Dk.exports===Tve,ZP=bKe&&cve.process,OT=(function(){try{var t=Dk&&Dk.require&&Dk.require("util").types;return t||ZP&&ZP.binding&&ZP.binding("util")}catch{}})(),_ie=OT&&OT.isTypedArray,lN=_ie?oN(_ie):vKe,xKe=Object.prototype,wKe=xKe.hasOwnProperty;function Cve(t,e){var r=Bs(t),n=!r&&NT(t),i=!r&&!n&&DT(t),s=!r&&!n&&!i&&lN(t),a=r||n||i||s,o=a?VXe(t.length,String):[],l=o.length;for(var u in t)(e||wKe.call(t,u))&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||s&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||iN(u,l)))&&o.push(u);return o}function kve(t,e){return function(r){return t(e(r))}}var TKe=kve(Object.keys,Object),CKe=Object.prototype,kKe=CKe.hasOwnProperty;function Sve(t){if(!aN(t))return TKe(t);var e=[];for(var r in Object(t))kKe.call(t,r)&&r!="constructor"&&e.push(r);return e}function Lc(t){return Wg(t)?Cve(t):Sve(t)}function SKe(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var EKe=Object.prototype,AKe=EKe.hasOwnProperty;function MKe(t){if(!$s(t))return SKe(t);var e=aN(t),r=[];for(var n in t)n=="constructor"&&(e||!AKe.call(t,n))||r.push(n);return r}function qy(t){return Wg(t)?Cve(t,!0):MKe(t)}var RKe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,_Ke=/^\w*$/;function lX(t,e){if(Bs(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||_d(t)?!0:_Ke.test(t)||!RKe.test(t)||e!=null&&t in Object(e)}var IS=Wy(Object,"create");function LKe(){this.__data__=IS?IS(null):{},this.size=0}function IKe(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var NKe="__lodash_hash_undefined__",DKe=Object.prototype,OKe=DKe.hasOwnProperty;function PKe(t){var e=this.__data__;if(IS){var r=e[t];return r===NKe?void 0:r}return OKe.call(e,t)?e[t]:void 0}var $Ke=Object.prototype,BKe=$Ke.hasOwnProperty;function FKe(t){var e=this.__data__;return IS?e[t]!==void 0:BKe.call(e,t)}var zKe="__lodash_hash_undefined__";function VKe(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=IS&&e===void 0?zKe:e,this}function uy(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])}}uy.prototype.clear=LKe;uy.prototype.delete=IKe;uy.prototype.get=PKe;uy.prototype.has=FKe;uy.prototype.set=VKe;function HKe(){this.__data__=[],this.size=0}function cN(t,e){for(var r=t.length;r--;)if(K5(t[r][0],e))return r;return-1}var GKe=Array.prototype,WKe=GKe.splice;function qKe(t){var e=this.__data__,r=cN(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():WKe.call(e,r,1),--this.size,!0}function UKe(t){var e=this.__data__,r=cN(e,t);return r<0?void 0:e[r][1]}function jKe(t){return cN(this.__data__,t)>-1}function YKe(t,e){var r=this.__data__,n=cN(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function $0(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])}}$0.prototype.clear=HKe;$0.prototype.delete=qKe;$0.prototype.get=UKe;$0.prototype.has=jKe;$0.prototype.set=YKe;var NS=Wy(Ih,"Map");function XKe(){this.size=0,this.__data__={hash:new uy,map:new(NS||$0),string:new uy}}function KKe(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function uN(t,e){var r=t.__data__;return KKe(e)?r[typeof e=="string"?"string":"hash"]:r.map}function ZKe(t){var e=uN(this,t).delete(t);return this.size-=e?1:0,e}function QKe(t){return uN(this,t).get(t)}function JKe(t){return uN(this,t).has(t)}function eZe(t,e){var r=uN(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function B0(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])}}B0.prototype.clear=XKe;B0.prototype.delete=ZKe;B0.prototype.get=QKe;B0.prototype.has=JKe;B0.prototype.set=eZe;var tZe="Expected a function";function cX(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(tZe);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 a=t.apply(this,n);return r.cache=s.set(i,a)||s,a};return r.cache=new(cX.Cache||B0),r}cX.Cache=B0;var rZe=500;function nZe(t){var e=cX(t,function(n){return r.size===rZe&&r.clear(),n}),r=e.cache;return e}var iZe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,sZe=/\\(\\)?/g,aZe=nZe(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(iZe,function(r,n,i,s){e.push(i?s.replace(sZe,"$1"):n||r)}),e});function Q5(t){return t==null?"":hve(t)}function hN(t,e){return Bs(t)?t:lX(t,e)?[t]:aZe(Q5(t))}function L6(t){if(typeof t=="string"||_d(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function dN(t,e){e=hN(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[L6(e[r++])];return r&&r==n?t:void 0}function oZe(t,e,r){var n=t==null?void 0:dN(t,e);return n===void 0?r:n}function uX(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}var Lie=Mu?Mu.isConcatSpreadable:void 0;function lZe(t){return Bs(t)||NT(t)||!!(Lie&&t&&t[Lie])}function fN(t,e,r,n,i){var s=-1,a=t.length;for(r||(r=lZe),i||(i=[]);++s<a;){var o=t[s];r(o)?uX(i,o):n||(i[i.length]=o)}return i}function J5(t){var e=t==null?0:t.length;return e?fN(t):[]}function cZe(t){return pve(vve(t,void 0,J5),t+"")}var hX=kve(Object.getPrototypeOf,Object),uZe="[object Object]",hZe=Function.prototype,dZe=Object.prototype,Eve=hZe.toString,fZe=dZe.hasOwnProperty,pZe=Eve.call(Object);function Nh(t){if(!Eh(t)||Hg(t)!=uZe)return!1;var e=hX(t);if(e===null)return!0;var r=fZe.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Eve.call(r)==pZe}function gZe(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),r=r>i?i:r,r<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var s=Array(i);++n<i;)s[n]=t[n+e];return s}function mZe(t,e,r){var n=t.length;return r=r===void 0?n:r,!e&&r>=n?t:gZe(t,e,r)}var yZe="\\ud800-\\udfff",vZe="\\u0300-\\u036f",bZe="\\ufe20-\\ufe2f",xZe="\\u20d0-\\u20ff",wZe=vZe+bZe+xZe,TZe="\\ufe0e\\ufe0f",CZe="\\u200d",kZe=RegExp("["+CZe+yZe+wZe+TZe+"]");function Ave(t){return kZe.test(t)}function SZe(t){return t.split("")}var Mve="\\ud800-\\udfff",EZe="\\u0300-\\u036f",AZe="\\ufe20-\\ufe2f",MZe="\\u20d0-\\u20ff",RZe=EZe+AZe+MZe,_Ze="\\ufe0e\\ufe0f",LZe="["+Mve+"]",zV="["+RZe+"]",VV="\\ud83c[\\udffb-\\udfff]",IZe="(?:"+zV+"|"+VV+")",Rve="[^"+Mve+"]",_ve="(?:\\ud83c[\\udde6-\\uddff]){2}",Lve="[\\ud800-\\udbff][\\udc00-\\udfff]",NZe="\\u200d",Ive=IZe+"?",Nve="["+_Ze+"]?",DZe="(?:"+NZe+"(?:"+[Rve,_ve,Lve].join("|")+")"+Nve+Ive+")*",OZe=Nve+Ive+DZe,PZe="(?:"+[Rve+zV+"?",zV,_ve,Lve,LZe].join("|")+")",$Ze=RegExp(VV+"(?="+VV+")|"+PZe+OZe,"g");function BZe(t){return t.match($Ze)||[]}function FZe(t){return Ave(t)?BZe(t):SZe(t)}function Dve(t){return function(e){e=Q5(e);var r=Ave(e)?FZe(e):void 0,n=r?r[0]:e.charAt(0),i=r?mZe(r,1).join(""):e.slice(1);return n[t]()+i}}var a9=Dve("toUpperCase");function zZe(t){return a9(Q5(t).toLowerCase())}function Ove(t,e,r,n){var i=-1,s=t==null?0:t.length;for(n&&s&&(r=t[++i]);++i<s;)r=e(r,t[i],i,t);return r}function VZe(t){return function(e){return t==null?void 0:t[e]}}var HZe={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},GZe=VZe(HZe),WZe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,qZe="\\u0300-\\u036f",UZe="\\ufe20-\\ufe2f",jZe="\\u20d0-\\u20ff",YZe=qZe+UZe+jZe,XZe="["+YZe+"]",KZe=RegExp(XZe,"g");function ZZe(t){return t=Q5(t),t&&t.replace(WZe,GZe).replace(KZe,"")}var QZe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function JZe(t){return t.match(QZe)||[]}var eQe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function tQe(t){return eQe.test(t)}var Pve="\\ud800-\\udfff",rQe="\\u0300-\\u036f",nQe="\\ufe20-\\ufe2f",iQe="\\u20d0-\\u20ff",sQe=rQe+nQe+iQe,$ve="\\u2700-\\u27bf",Bve="a-z\\xdf-\\xf6\\xf8-\\xff",aQe="\\xac\\xb1\\xd7\\xf7",oQe="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",lQe="\\u2000-\\u206f",cQe=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Fve="A-Z\\xc0-\\xd6\\xd8-\\xde",uQe="\\ufe0e\\ufe0f",zve=aQe+oQe+lQe+cQe,Vve="['’]",Iie="["+zve+"]",hQe="["+sQe+"]",Hve="\\d+",dQe="["+$ve+"]",Gve="["+Bve+"]",Wve="[^"+Pve+zve+Hve+$ve+Bve+Fve+"]",fQe="\\ud83c[\\udffb-\\udfff]",pQe="(?:"+hQe+"|"+fQe+")",gQe="[^"+Pve+"]",qve="(?:\\ud83c[\\udde6-\\uddff]){2}",Uve="[\\ud800-\\udbff][\\udc00-\\udfff]",f2="["+Fve+"]",mQe="\\u200d",Nie="(?:"+Gve+"|"+Wve+")",yQe="(?:"+f2+"|"+Wve+")",Die="(?:"+Vve+"(?:d|ll|m|re|s|t|ve))?",Oie="(?:"+Vve+"(?:D|LL|M|RE|S|T|VE))?",jve=pQe+"?",Yve="["+uQe+"]?",vQe="(?:"+mQe+"(?:"+[gQe,qve,Uve].join("|")+")"+Yve+jve+")*",bQe="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",xQe="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",wQe=Yve+jve+vQe,TQe="(?:"+[dQe,qve,Uve].join("|")+")"+wQe,CQe=RegExp([f2+"?"+Gve+"+"+Die+"(?="+[Iie,f2,"$"].join("|")+")",yQe+"+"+Oie+"(?="+[Iie,f2+Nie,"$"].join("|")+")",f2+"?"+Nie+"+"+Die,f2+"+"+Oie,xQe,bQe,Hve,TQe].join("|"),"g");function kQe(t){return t.match(CQe)||[]}function SQe(t,e,r){return t=Q5(t),e=e,e===void 0?tQe(t)?kQe(t):JZe(t):t.match(e)||[]}var EQe="['’]",AQe=RegExp(EQe,"g");function Xve(t){return function(e){return Ove(SQe(ZZe(e).replace(AQe,"")),t,"")}}var I6=Xve(function(t,e,r){return e=e.toLowerCase(),t+(r?zZe(e):e)});function Pie(){if(!arguments.length)return[];var t=arguments[0];return Bs(t)?t:[t]}function MQe(t,e,r){return t===t&&(r!==void 0&&(t=t<=r?t:r),e!==void 0&&(t=t>=e?t:e)),t}function Y1(t,e,r){return r===void 0&&(r=e,e=void 0),r!==void 0&&(r=vb(r),r=r===r?r:0),e!==void 0&&(e=vb(e),e=e===e?e:0),MQe(vb(t),e,r)}function RQe(){this.__data__=new $0,this.size=0}function _Qe(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function LQe(t){return this.__data__.get(t)}function IQe(t){return this.__data__.has(t)}var NQe=200;function DQe(t,e){var r=this.__data__;if(r instanceof $0){var n=r.__data__;if(!NS||n.length<NQe-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new B0(n)}return r.set(t,e),this.size=r.size,this}function hh(t){var e=this.__data__=new $0(t);this.size=e.size}hh.prototype.clear=RQe;hh.prototype.delete=_Qe;hh.prototype.get=LQe;hh.prototype.has=IQe;hh.prototype.set=DQe;function OQe(t,e){return t&&_6(e,Lc(e),t)}function PQe(t,e){return t&&_6(e,qy(e),t)}var Kve=typeof exports=="object"&&exports&&!exports.nodeType&&exports,$ie=Kve&&typeof module=="object"&&module&&!module.nodeType&&module,$Qe=$ie&&$ie.exports===Kve,Bie=$Qe?Ih.Buffer:void 0,Fie=Bie?Bie.allocUnsafe:void 0;function Zve(t,e){if(e)return t.slice();var r=t.length,n=Fie?Fie(r):new t.constructor(r);return t.copy(n),n}function Qve(t,e){for(var r=-1,n=t==null?0:t.length,i=0,s=[];++r<n;){var a=t[r];e(a,r,t)&&(s[i++]=a)}return s}function Jve(){return[]}var BQe=Object.prototype,FQe=BQe.propertyIsEnumerable,zie=Object.getOwnPropertySymbols,dX=zie?function(t){return t==null?[]:(t=Object(t),Qve(zie(t),function(e){return FQe.call(t,e)}))}:Jve;function zQe(t,e){return _6(t,dX(t),e)}var VQe=Object.getOwnPropertySymbols,e2e=VQe?function(t){for(var e=[];t;)uX(e,dX(t)),t=hX(t);return e}:Jve;function HQe(t,e){return _6(t,e2e(t),e)}function t2e(t,e,r){var n=e(t);return Bs(t)?n:uX(n,r(t))}function HV(t){return t2e(t,Lc,dX)}function GQe(t){return t2e(t,qy,e2e)}var GV=Wy(Ih,"DataView"),WV=Wy(Ih,"Promise"),bb=Wy(Ih,"Set"),Vie="[object Map]",WQe="[object Object]",Hie="[object Promise]",Gie="[object Set]",Wie="[object WeakMap]",qie="[object DataView]",qQe=Gy(GV),UQe=Gy(NS),jQe=Gy(WV),YQe=Gy(bb),XQe=Gy(FV),du=Hg;(GV&&du(new GV(new ArrayBuffer(1)))!=qie||NS&&du(new NS)!=Vie||WV&&du(WV.resolve())!=Hie||bb&&du(new bb)!=Gie||FV&&du(new FV)!=Wie)&&(du=function(t){var e=Hg(t),r=e==WQe?t.constructor:void 0,n=r?Gy(r):"";if(n)switch(n){case qQe:return qie;case UQe:return Vie;case jQe:return Hie;case YQe:return Gie;case XQe:return Wie}return e});var KQe=Object.prototype,ZQe=KQe.hasOwnProperty;function QQe(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&ZQe.call(t,"index")&&(r.index=t.index,r.input=t.input),r}var o9=Ih.Uint8Array;function fX(t){var e=new t.constructor(t.byteLength);return new o9(e).set(new o9(t)),e}function JQe(t,e){var r=e?fX(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var eJe=/\w*$/;function tJe(t){var e=new t.constructor(t.source,eJe.exec(t));return e.lastIndex=t.lastIndex,e}var Uie=Mu?Mu.prototype:void 0,jie=Uie?Uie.valueOf:void 0;function rJe(t){return jie?Object(jie.call(t)):{}}function r2e(t,e){var r=e?fX(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var nJe="[object Boolean]",iJe="[object Date]",sJe="[object Map]",aJe="[object Number]",oJe="[object RegExp]",lJe="[object Set]",cJe="[object String]",uJe="[object Symbol]",hJe="[object ArrayBuffer]",dJe="[object DataView]",fJe="[object Float32Array]",pJe="[object Float64Array]",gJe="[object Int8Array]",mJe="[object Int16Array]",yJe="[object Int32Array]",vJe="[object Uint8Array]",bJe="[object Uint8ClampedArray]",xJe="[object Uint16Array]",wJe="[object Uint32Array]";function TJe(t,e,r){var n=t.constructor;switch(e){case hJe:return fX(t);case nJe:case iJe:return new n(+t);case dJe:return JQe(t,r);case fJe:case pJe:case gJe:case mJe:case yJe:case vJe:case bJe:case xJe:case wJe:return r2e(t,r);case sJe:return new n;case aJe:case cJe:return new n(t);case oJe:return tJe(t);case lJe:return new n;case uJe:return rJe(t)}}function n2e(t){return typeof t.constructor=="function"&&!aN(t)?SXe(hX(t)):{}}var CJe="[object Map]";function kJe(t){return Eh(t)&&du(t)==CJe}var Yie=OT&&OT.isMap,SJe=Yie?oN(Yie):kJe,EJe="[object Set]";function AJe(t){return Eh(t)&&du(t)==EJe}var Xie=OT&&OT.isSet,MJe=Xie?oN(Xie):AJe,RJe=1,_Je=2,LJe=4,i2e="[object Arguments]",IJe="[object Array]",NJe="[object Boolean]",DJe="[object Date]",OJe="[object Error]",s2e="[object Function]",PJe="[object GeneratorFunction]",$Je="[object Map]",BJe="[object Number]",a2e="[object Object]",FJe="[object RegExp]",zJe="[object Set]",VJe="[object String]",HJe="[object Symbol]",GJe="[object WeakMap]",WJe="[object ArrayBuffer]",qJe="[object DataView]",UJe="[object Float32Array]",jJe="[object Float64Array]",YJe="[object Int8Array]",XJe="[object Int16Array]",KJe="[object Int32Array]",ZJe="[object Uint8Array]",QJe="[object Uint8ClampedArray]",JJe="[object Uint16Array]",eet="[object Uint32Array]",Ii={};Ii[i2e]=Ii[IJe]=Ii[WJe]=Ii[qJe]=Ii[NJe]=Ii[DJe]=Ii[UJe]=Ii[jJe]=Ii[YJe]=Ii[XJe]=Ii[KJe]=Ii[$Je]=Ii[BJe]=Ii[a2e]=Ii[FJe]=Ii[zJe]=Ii[VJe]=Ii[HJe]=Ii[ZJe]=Ii[QJe]=Ii[JJe]=Ii[eet]=!0;Ii[OJe]=Ii[s2e]=Ii[GJe]=!1;function Ok(t,e,r,n,i,s){var a,o=e&RJe,l=e&_Je,u=e&LJe;if(a!==void 0)return a;if(!$s(t))return t;var h=Bs(t);if(h){if(a=QQe(t),!o)return fve(t,a)}else{var d=du(t),f=d==s2e||d==PJe;if(DT(t))return Zve(t,o);if(d==a2e||d==i2e||f&&!i){if(a=l||f?{}:n2e(t),!o)return l?HQe(t,PQe(a,t)):zQe(t,OQe(a,t))}else{if(!Ii[d])return i?t:{};a=TJe(t,d,o)}}s||(s=new hh);var p=s.get(t);if(p)return p;s.set(t,a),MJe(t)?t.forEach(function(y){a.add(Ok(y,e,r,y,t,s))}):SJe(t)&&t.forEach(function(y,v){a.set(v,Ok(y,e,r,v,t,s))});var g=u?l?GQe:HV:l?qy:Lc,m=h?void 0:g(t);return gve(m||t,function(y,v){m&&(v=y,y=t[v]),sN(a,v,Ok(y,e,r,v,t,s))}),a}var tet=4;function l9(t){return Ok(t,tet)}var ret=1,net=4;function Oi(t){return Ok(t,ret|net)}var iet="__lodash_hash_undefined__";function set(t){return this.__data__.set(t,iet),this}function aet(t){return this.__data__.has(t)}function PT(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new B0;++e<r;)this.add(t[e])}PT.prototype.add=PT.prototype.push=set;PT.prototype.has=aet;function oet(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function pX(t,e){return t.has(e)}var cet=1,uet=2;function o2e(t,e,r,n,i,s){var a=r&cet,o=t.length,l=e.length;if(o!=l&&!(a&&l>o))return!1;var u=s.get(t),h=s.get(e);if(u&&h)return u==e&&h==t;var d=-1,f=!0,p=r&uet?new PT:void 0;for(s.set(t,e),s.set(e,t);++d<o;){var g=t[d],m=e[d];if(n)var y=a?n(m,g,d,e,t,s):n(g,m,d,t,e,s);if(y!==void 0){if(y)continue;f=!1;break}if(p){if(!oet(e,function(v,x){if(!pX(p,x)&&(g===v||i(g,v,r,n,s)))return p.push(x)})){f=!1;break}}else if(!(g===m||i(g,m,r,n,s))){f=!1;break}}return s.delete(t),s.delete(e),f}function het(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}function gX(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var det=1,fet=2,pet="[object Boolean]",get="[object Date]",met="[object Error]",yet="[object Map]",vet="[object Number]",bet="[object RegExp]",xet="[object Set]",wet="[object String]",Tet="[object Symbol]",Cet="[object ArrayBuffer]",ket="[object DataView]",Kie=Mu?Mu.prototype:void 0,QP=Kie?Kie.valueOf:void 0;function Eet(t,e,r,n,i,s,a){switch(r){case ket:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Cet:return!(t.byteLength!=e.byteLength||!s(new o9(t),new o9(e)));case pet:case get:case vet:return K5(+t,+e);case met:return t.name==e.name&&t.message==e.message;case bet:case wet:return t==e+"";case yet:var o=het;case xet:var l=n&det;if(o||(o=gX),t.size!=e.size&&!l)return!1;var u=a.get(t);if(u)return u==e;n|=fet,a.set(t,e);var h=o2e(o(t),o(e),n,i,s,a);return a.delete(t),h;case Tet:if(QP)return QP.call(t)==QP.call(e)}return!1}var Aet=1,Met=Object.prototype,Ret=Met.hasOwnProperty;function _et(t,e,r,n,i,s){var a=r&Aet,o=HV(t),l=o.length,u=HV(e),h=u.length;if(l!=h&&!a)return!1;for(var d=l;d--;){var f=o[d];if(!(a?f in e:Ret.call(e,f)))return!1}var p=s.get(t),g=s.get(e);if(p&&g)return p==e&&g==t;var m=!0;s.set(t,e),s.set(e,t);for(var y=a;++d<l;){f=o[d];var v=t[f],x=e[f];if(n)var b=a?n(x,v,f,e,t,s):n(v,x,f,t,e,s);if(!(b===void 0?v===x||i(v,x,r,n,s):b)){m=!1;break}y||(y=f=="constructor")}if(m&&!y){var T=t.constructor,C=e.constructor;T!=C&&"constructor"in t&&"constructor"in e&&!(typeof T=="function"&&T instanceof T&&typeof C=="function"&&C instanceof C)&&(m=!1)}return s.delete(t),s.delete(e),m}var Let=1,Zie="[object Arguments]",Qie="[object Array]",s7="[object Object]",Iet=Object.prototype,Jie=Iet.hasOwnProperty;function Net(t,e,r,n,i,s){var a=Bs(t),o=Bs(e),l=a?Qie:du(t),u=o?Qie:du(e);l=l==Zie?s7:l,u=u==Zie?s7:u;var h=l==s7,d=u==s7,f=l==u;if(f&&DT(t)){if(!DT(e))return!1;a=!0,h=!1}if(f&&!h)return s||(s=new hh),a||lN(t)?o2e(t,e,r,n,i,s):Eet(t,e,l,r,n,i,s);if(!(r&Let)){var p=h&&Jie.call(t,"__wrapped__"),g=d&&Jie.call(e,"__wrapped__");if(p||g){var m=p?t.value():t,y=g?e.value():e;return s||(s=new hh),i(m,y,r,n,s)}}return f?(s||(s=new hh),_et(t,e,r,n,i,s)):!1}function pN(t,e,r,n,i){return t===e?!0:t==null||e==null||!Eh(t)&&!Eh(e)?t!==t&&e!==e:Net(t,e,r,n,pN,i)}var Det=1,Oet=2;function Pet(t,e,r,n){var i=r.length,s=i;if(t==null)return!s;for(t=Object(t);i--;){var a=r[i];if(a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<s;){a=r[i];var o=a[0],l=t[o],u=a[1];if(a[2]){if(l===void 0&&!(o in t))return!1}else{var h=new hh,d;if(!(d===void 0?pN(u,l,Det|Oet,n,h):d))return!1}}return!0}function l2e(t){return t===t&&!$s(t)}function $et(t){for(var e=Lc(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,l2e(i)]}return e}function c2e(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function Bet(t){var e=$et(t);return e.length==1&&e[0][2]?c2e(e[0][0],e[0][1]):function(r){return r===t||Pet(r,t,e)}}function Fet(t,e){return t!=null&&e in Object(t)}function u2e(t,e,r){e=hN(e,t);for(var n=-1,i=e.length,s=!1;++n<i;){var a=L6(e[n]);if(!(s=t!=null&&r(t,a)))break;t=t[a]}return s||++n!=i?s:(i=t==null?0:t.length,!!i&&oX(i)&&iN(a,i)&&(Bs(t)||NT(t)))}function h2e(t,e){return t!=null&&u2e(t,e,Fet)}var zet=1,Vet=2;function Het(t,e){return lX(t)&&l2e(e)?c2e(L6(t),e):function(r){var n=oZe(r,t);return n===void 0&&n===e?h2e(r,t):pN(e,n,zet|Vet)}}function Get(t){return function(e){return e==null?void 0:e[t]}}function Wet(t){return function(e){return dN(e,t)}}function qet(t){return lX(t)?Get(L6(t)):Wet(t)}function F0(t){return typeof t=="function"?t:t==null?Gg:typeof t=="object"?Bs(t)?Het(t[0],t[1]):Bet(t):qet(t)}function Uet(t,e,r,n){for(var i=-1,s=t==null?0:t.length;++i<s;){var a=t[i];e(n,a,r(a),t)}return n}function jet(t){return function(e,r,n){for(var i=-1,s=Object(e),a=n(e),o=a.length;o--;){var l=a[++i];if(r(s[l],l,s)===!1)break}return e}}var mX=jet();function yX(t,e){return t&&mX(t,e,Lc)}function Yet(t,e){return function(r,n){if(r==null)return r;if(!Wg(r))return t(r,n);for(var i=r.length,s=-1,a=Object(r);++s<i&&n(a[s],s,a)!==!1;);return r}}var N6=Yet(yX);function Xet(t,e,r,n){return N6(t,function(i,s,a){e(n,i,r(i),a)}),n}function Ket(t,e){return function(r,n){var i=Bs(r)?Uet:Xet,s=e?e():{};return i(r,t,F0(n),s)}}var JP=function(){return Ih.Date.now()},Zet="Expected a function",Qet=Math.max,Jet=Math.min;function gN(t,e,r){var n,i,s,a,o,l,u=0,h=!1,d=!1,f=!0;if(typeof t!="function")throw new TypeError(Zet);e=vb(e)||0,$s(r)&&(h=!!r.leading,d="maxWait"in r,s=d?Qet(vb(r.maxWait)||0,e):s,f="trailing"in r?!!r.trailing:f);function p(S){var k=n,E=i;return n=i=void 0,u=S,a=t.apply(E,k),a}function g(S){return u=S,o=setTimeout(v,e),h?p(S):a}function m(S){var k=S-l,E=S-u,A=e-k;return d?Jet(A,s-E):A}function y(S){var k=S-l,E=S-u;return l===void 0||k>=e||k<0||d&&E>=s}function v(){var S=JP();if(y(S))return x(S);o=setTimeout(v,m(S))}function x(S){return o=void 0,f&&n?p(S):(n=i=void 0,a)}function b(){o!==void 0&&clearTimeout(o),u=0,n=l=i=o=void 0}function T(){return o===void 0?a:x(JP())}function C(){var S=JP(),k=y(S);if(n=arguments,i=this,l=S,k){if(o===void 0)return g(l);if(d)return clearTimeout(o),o=setTimeout(v,e),p(l)}return o===void 0&&(o=setTimeout(v,e)),a}return C.cancel=b,C.flush=T,C}var d2e=Object.prototype,ett=d2e.hasOwnProperty,f2e=Z5(function(t,e){t=Object(t);var r=-1,n=e.length,i=n>2?e[2]:void 0;for(i&&LS(e[0],e[1],i)&&(n=1);++r<n;)for(var s=e[r],a=qy(s),o=-1,l=a.length;++o<l;){var u=a[o],h=t[u];(h===void 0||K5(h,d2e[u])&&!ett.call(t,u))&&(t[u]=s[u])}return t});function qV(t,e,r){(r!==void 0&&!K5(t[e],r)||r===void 0&&!(e in t))&&R6(t,e,r)}function c9(t){return Eh(t)&&Wg(t)}function UV(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function ttt(t){return _6(t,qy(t))}function rtt(t,e,r,n,i,s,a){var o=UV(t,r),l=UV(e,r),u=a.get(l);if(u){qV(t,r,u);return}var h=s?s(o,l,r+"",t,e,a):void 0,d=h===void 0;if(d){var f=Bs(l),p=!f&&DT(l),g=!f&&!p&&lN(l);h=l,f||p||g?Bs(o)?h=o:c9(o)?h=fve(o):p?(d=!1,h=Zve(l,!0)):g?(d=!1,h=r2e(l,!0)):h=[]:Nh(l)||NT(l)?(h=o,NT(o)?h=ttt(o):(!$s(o)||_S(o))&&(h=n2e(l))):d=!1}d&&(a.set(l,h),i(h,l,n,s,a),a.delete(l)),qV(t,r,h)}function mN(t,e,r,n,i){t!==e&&mX(e,function(s,a){if(i||(i=new hh),$s(s))rtt(t,e,a,r,mN,n,i);else{var o=n?n(UV(t,a),s,a+"",t,e,i):void 0;o===void 0&&(o=s),qV(t,a,o)}},qy)}function p2e(t,e,r,n,i,s){return $s(t)&&$s(e)&&(s.set(e,t),mN(t,e,void 0,p2e,s),s.delete(e)),t}var ntt=bve(function(t,e,r,n){mN(t,e,r,n)}),g2e=Z5(function(t){return t.push(void 0,p2e),dve(ntt,void 0,t)}),itt=200;function stt(t,e,r,n){var i=-1,s=yve,a=!0,o=t.length,l=[],u=e.length;if(!o)return l;e.length>=itt&&(s=pX,a=!1,e=new PT(e));e:for(;++i<o;){var h=t[i],d=h;if(h=h!==0?h:0,a&&d===d){for(var f=u;f--;)if(e[f]===d)continue e;l.push(h)}else s(e,d,n)||l.push(h)}return l}var att=Z5(function(t,e){return c9(t)?stt(t,fN(e,1,c9,!0)):[]});function u9(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}function vX(t){return typeof t=="function"?t:Gg}function Et(t,e){var r=Bs(t)?gve:N6;return r(t,vX(e))}function ott(t,e){var r=[];return N6(t,function(n,i,s){e(n,i,s)&&r.push(n)}),r}function $f(t,e){var r=Bs(t)?Qve:ott;return r(t,F0(e))}function ltt(t){return function(e,r,n){var i=Object(e);if(!Wg(e)){var s=F0(r);e=Lc(e),r=function(o){return s(i[o],o,i)}}var a=t(e,r,n);return a>-1?i[s?e[a]:a]:void 0}}var ctt=Math.max;function utt(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:lXe(r);return i<0&&(i=ctt(n+i,0)),mve(t,F0(e),i)}var bX=ltt(utt);function m2e(t,e){var r=-1,n=Wg(t)?Array(t.length):[];return N6(t,function(i,s,a){n[++r]=e(i,s,a)}),n}function la(t,e){var r=Bs(t)?yb:m2e;return r(t,F0(e))}function htt(t,e){return t==null?t:mX(t,vX(e),qy)}function dtt(t,e){return t&&yX(t,vX(e))}var ftt=Object.prototype,ptt=ftt.hasOwnProperty,ese=Ket(function(t,e,r){ptt.call(t,r)?t[r].push(e):R6(t,r,[e])});function gtt(t,e){return t>e}var mtt=Object.prototype,ytt=mtt.hasOwnProperty;function vtt(t,e){return t!=null&&ytt.call(t,e)}function X2(t,e){return t!=null&&u2e(t,e,vtt)}function btt(t,e){return yb(e,function(r){return t[r]})}function Zf(t){return t==null?[]:btt(t,Lc(t))}var xtt="[object Map]",wtt="[object Set]",Ttt=Object.prototype,Ctt=Ttt.hasOwnProperty;function DS(t){if(t==null)return!0;if(Wg(t)&&(Bs(t)||typeof t=="string"||typeof t.splice=="function"||DT(t)||lN(t)||NT(t)))return!t.length;var e=du(t);if(e==xtt||e==wtt)return!t.size;if(aN(t))return!Sve(t).length;for(var r in t)if(Ctt.call(t,r))return!1;return!0}function Qf(t,e){return pN(t,e)}var ktt="[object Number]";function Bf(t){return typeof t=="number"||Eh(t)&&Hg(t)==ktt}function Us(t){return t===void 0}var Stt=Dve("toLowerCase");function y2e(t,e){return t<e}function yN(t,e){var r={};return e=F0(e),yX(t,function(n,i,s){R6(r,i,e(n,i,s))}),r}function xX(t,e,r){for(var n=-1,i=t.length;++n<i;){var s=t[n],a=e(s);if(a!=null&&(o===void 0?a===a&&!_d(a):r(a,o)))var o=a,l=s}return l}function hg(t){return t&&t.length?xX(t,Gg,gtt):void 0}var Pi=bve(function(t,e,r){mN(t,e,r)});function OS(t){return t&&t.length?xX(t,Gg,y2e):void 0}function wX(t,e){return t&&t.length?xX(t,F0(e),y2e):void 0}function Ett(t,e,r,n){if(!$s(t))return t;e=hN(e,t);for(var i=-1,s=e.length,a=s-1,o=t;o!=null&&++i<s;){var l=L6(e[i]),u=r;if(l==="__proto__"||l==="constructor"||l==="prototype")return t;if(i!=a){var h=o[l];u=void 0,u===void 0&&(u=$s(h)?h:iN(e[i+1])?[]:{})}sN(o,l,u),o=o[l]}return t}function Att(t,e,r){for(var n=-1,i=e.length,s={};++n<i;){var a=e[n],o=dN(t,a);r(o,a)&&Ett(s,hN(a,t),o)}return s}function Mtt(t,e){var r=t.length;for(t.sort(e);r--;)t[r]=t[r].value;return t}function Rtt(t,e){if(t!==e){var r=t!==void 0,n=t===null,i=t===t,s=_d(t),a=e!==void 0,o=e===null,l=e===e,u=_d(e);if(!o&&!u&&!s&&t>e||s&&a&&l&&!o&&!u||n&&a&&l||!r&&l||!i)return 1;if(!n&&!s&&!u&&t<e||u&&r&&i&&!n&&!s||o&&r&&i||!a&&i||!l)return-1}return 0}function _tt(t,e,r){for(var n=-1,i=t.criteria,s=e.criteria,a=i.length,o=r.length;++n<a;){var l=Rtt(i[n],s[n]);if(l){if(n>=o)return l;var u=r[n];return l*(u=="desc"?-1:1)}}return t.index-e.index}function Ltt(t,e,r){e.length?e=yb(e,function(s){return Bs(s)?function(a){return dN(a,s.length===1?s[0]:s)}:s}):e=[Gg];var n=-1;e=yb(e,oN(F0));var i=m2e(t,function(s,a,o){var l=yb(e,function(u){return u(s)});return{criteria:l,index:++n,value:s}});return Mtt(i,function(s,a){return _tt(s,a,r)})}function Itt(t,e){return Att(t,e,function(r,n){return h2e(t,n)})}var $T=cZe(function(t,e){return t==null?{}:Itt(t,e)}),Ntt=Math.ceil,Dtt=Math.max;function Ott(t,e,r,n){for(var i=-1,s=Dtt(Ntt((e-t)/(r||1)),0),a=Array(s);s--;)a[++i]=t,t+=r;return a}function Ptt(t){return function(e,r,n){return n&&typeof n!="number"&&LS(e,r,n)&&(r=n=void 0),e=bM(e),r===void 0?(r=e,e=0):r=bM(r),n=n===void 0?e<r?1:-1:bM(n),Ott(e,r,n)}}var BT=Ptt();function $tt(t,e,r,n,i){return i(t,function(s,a,o){r=n?(n=!1,s):e(r,s,a,o)}),r}function D6(t,e,r){var n=Bs(t)?Ove:$tt,i=arguments.length<3;return n(t,F0(e),r,i,N6)}var qg=Z5(function(t,e){if(t==null)return[];var r=e.length;return r>1&&LS(t,e[0],e[1])?e=[]:r>2&&LS(e[0],e[1],e[2])&&(e=[e[0]]),Ltt(t,fN(e),[])}),Btt=4294967295,Ftt=Btt-1,ztt=Math.floor,Vtt=Math.min;function Htt(t,e,r,n){var i=0,s=t==null?0:t.length;if(s===0)return 0;e=r(e);for(var a=e!==e,o=e===null,l=_d(e),u=e===void 0;i<s;){var h=ztt((i+s)/2),d=r(t[h]),f=d!==void 0,p=d===null,g=d===d,m=_d(d);if(a)var y=g;else u?y=g&&f:o?y=g&&f&&!p:l?y=g&&f&&!p&&!m:p||m?y=!1:y=d<e;y?i=h+1:s=h}return Vtt(s,Ftt)}var Gtt=4294967295,Wtt=Gtt>>>1;function qtt(t,e,r){var n=0,i=t==null?n:t.length;if(typeof e=="number"&&e===e&&i<=Wtt){for(;n<i;){var s=n+i>>>1,a=t[s];a!==null&&!_d(a)&&a<e?n=s+1:i=s}return i}return Htt(t,e,Gg)}function Utt(t,e){return qtt(t,e)}var jtt=Xve(function(t,e,r){return t+(r?" ":"")+a9(e)}),Ytt="Expected a function";function Xtt(t,e,r){var n=!0,i=!0;if(typeof t!="function")throw new TypeError(Ytt);return $s(r)&&(n="leading"in r?!0:n,i="trailing"in r?!!r.trailing:i),gN(t,e,{leading:n,maxWait:e,trailing:i})}var Ktt=1/0,Ztt=bb&&1/gX(new bb([,-0]))[1]==Ktt?function(t){return new bb(t)}:EXe,Qtt=200;function v2e(t,e,r){var n=-1,i=yve,s=t.length,a=!0,o=[],l=o;if(s>=Qtt){var u=Ztt(t);if(u)return gX(u);a=!1,i=pX,l=new PT}else l=o;e:for(;++n<s;){var h=t[n],d=h;if(h=h!==0?h:0,a&&d===d){for(var f=l.length;f--;)if(l[f]===d)continue e;o.push(h)}else i(l,d,r)||(l!==o&&l.push(d),o.push(h))}return o}var jV=Z5(function(t){return v2e(fN(t,1,c9,!0))});function b2e(t){return t&&t.length?v2e(t):[]}var Jtt=0;function vN(t){var e=++Jtt;return Q5(t)+e}function ert(t,e,r){for(var n=-1,i=t.length,s=e.length,a={};++n<i;){var o=n<s?e[n]:void 0;r(a,t[n],o)}return a}function trt(t,e){return ert(t||[],e||[],sN)}function c0(t){return typeof t=="string"&&t.slice(-1)==="%"}function Pc(t,e){if(t==null)return 0;let r;if(typeof t=="string"){if(r=parseFloat(t),c0(t)&&(r/=100,Number.isFinite(r)))return r*e}else r=t;return Number.isFinite(r)?r>0&&r<1?r*e:r:0}function dh(t){if(typeof t=="object"){let r=0,n=0,i=0,s=0;return t.vertical!=null&&Number.isFinite(t.vertical)&&(n=s=t.vertical),t.horizontal!=null&&Number.isFinite(t.horizontal)&&(i=r=t.horizontal),t.left!=null&&Number.isFinite(t.left)&&(r=t.left),t.top!=null&&Number.isFinite(t.top)&&(n=t.top),t.right!=null&&Number.isFinite(t.right)&&(i=t.right),t.bottom!=null&&Number.isFinite(t.bottom)&&(s=t.bottom),{top:n,right:i,bottom:s,left:r}}let e=0;return t!=null&&Number.isFinite(t)&&(e=t),{top:e,right:e,bottom:e,left:e}}let x2e=!1,w2e=!1,T2e=!1,rrt=!1,C2e=!1;if(typeof navigator=="object"){const t=navigator.userAgent;t.indexOf("Macintosh")>=0,t.match(/(iPad|iPhone|iPod)/g),t.indexOf("Windows")>=0,x2e=t.indexOf("MSIE")>=0,t.match(/Trident\/7\./),w2e=!!t.match(/Edge\//),t.indexOf("Mozilla/")>=0&&t.indexOf("MSIE")<0&&t.indexOf("Edge/")<0,t.indexOf("Chrome/")>=0&&t.indexOf("Edge/")<0,t.indexOf("Opera/")>=0||t.indexOf("OPR/")>=0,t.indexOf("Firefox/")>=0,T2e=t.indexOf("AppleWebKit/")>=0&&t.indexOf("Chrome/")<0&&t.indexOf("Edge/")<0,typeof document=="object"&&(C2e=!document.createElementNS||`${document.createElementNS("http://www.w3.org/2000/svg","foreignObject")}`!="[object SVGForeignObjectElement]"||t.indexOf("Opera/")>=0)}typeof window=="object"&&window.chrome!=null&&window.chrome.app!=null&&window.chrome.app.runtime!=null;if(typeof document=="object")try{const t=Object.defineProperty({},"passive",{get(){rrt=!0}}),e=document.createElement("div");e.addEventListener&&e.addEventListener("click",()=>{},t)}catch{}const tse=x2e,rse=w2e,nrt=T2e,irt=C2e,srt=!irt;function art(){const t=window.module;return t!=null&&t.hot!=null&&t.hot.status!=null?t.hot.status():"unkonwn"}function k2e(){return art()==="apply"}const ort={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};function lrt(t){const e=document.createElement(ort[t]||"div"),r=`on${t}`;let n=r in e;return n||(e.setAttribute(r,"return;"),n=typeof e[r]=="function"),n}const Pk=[];function Ug(t,e){const r=Pk.find(n=>n.name===t);if(!(r&&(r.loadTimes+=1,r.loadTimes>1))&&!k2e()){const n=document.createElement("style");n.setAttribute("type","text/css"),n.textContent=e;const i=document.querySelector("head");i&&i.insertBefore(n,i.firstChild),Pk.push({name:t,loadTimes:1,styleElement:n})}}function jg(t){const e=Pk.findIndex(r=>r.name===t);if(e>-1){const r=Pk[e];if(r.loadTimes-=1,r.loadTimes>0)return;let n=r.styleElement;n&&n.parentNode&&n.parentNode.removeChild(n),n=null,Pk.splice(e,1)}}function crt(t){const e=t.match(/<svg[^>]*viewBox\s*=\s*(["']?)(.+?)\1[^>]*>/i);return e&&e[2]?e[2].replace(/\s+/," ").split(" "):null}function nse(t){const e=parseFloat(t);return Number.isNaN(e)?null:e}function urt(t){const e="data:";return t.substr(0,e.length)===e}function hrt(t,e){if(!t||urt(t)){setTimeout(()=>e(null,t));return}const r=()=>{e(new Error(`Failed to load image: ${t}`))},n=window.FileReader?s=>{if(s.status===200){const a=new FileReader;a.onload=o=>{const l=o.target.result;e(null,l)},a.onerror=r,a.readAsDataURL(s.response)}else r()}:s=>{const a=o=>{const u=[];for(let h=0;h<o.length;h+=32768)u.push(String.fromCharCode.apply(null,o.subarray(h,h+32768)));return u.join("")};if(s.status===200){let o=t.split(".").pop()||"png";o==="svg"&&(o="svg+xml");const l=`data:image/${o};base64,`,u=new Uint8Array(s.response),h=l+btoa(a(u));e(null,h)}else r()},i=new XMLHttpRequest;i.responseType=window.FileReader?"blob":"arraybuffer",i.open("GET",t,!0),i.addEventListener("error",r),i.addEventListener("load",()=>n(i)),i.send()}function drt(t){let e=t.replace(/\s/g,"");e=decodeURIComponent(e);const r=e.indexOf(","),n=e.slice(0,r),i=n.split(":")[1].split(";")[0],s=e.slice(r+1);let a;n.indexOf("base64")>=0?a=atob(s):a=unescape(encodeURIComponent(s));const o=new Uint8Array(a.length);for(let l=0;l<a.length;l+=1)o[l]=a.charCodeAt(l);return new Blob([o],{type:i})}function frt(t,e){const r=window.navigator.msSaveBlob;if(r)r(t,e);else{const n=window.URL.createObjectURL(t),i=document.createElement("a");i.href=n,i.download=e,document.body.appendChild(i),i.click(),document.body.removeChild(i),window.URL.revokeObjectURL(n)}}function e$(t,e){const r=drt(t);frt(r,e)}function prt(t,e={}){let r=null;const n=h=>(r==null&&(r=crt(t)),r!=null?nse(r[h]):null),i=h=>{const d=t.match(h);return d&&d[2]?nse(d[2]):null};let s=e.width;if(s==null&&(s=i(/<svg[^>]*width\s*=\s*(["']?)(.+?)\1[^>]*>/i)),s==null&&(s=n(2)),s==null)throw new Error("Can not parse width from svg string");let a=e.height;if(a==null&&(a=i(/<svg[^>]*height\s*=\s*(["']?)(.+?)\1[^>]*>/i)),a==null&&(a=n(3)),a==null)throw new Error("Can not parse height from svg string");return`data:image/svg+xml,${encodeURIComponent(t).replace(/'/g,"%27").replace(/"/g,"%22")}`}function grt(t){return typeof t=="object"&&t.then&&typeof t.then=="function"}function YV(t){return t!=null&&(t instanceof Promise||grt(t))}function TX(...t){const e=[];if(t.forEach(n=>{Array.isArray(n)?e.push(...n):e.push(n)}),e.some(n=>YV(n))){const n=e.map(i=>YV(i)?i:Promise.resolve(i!==!1));return Promise.all(n).then(i=>i.reduce((s,a)=>a!==!1&&s,!0))}return e.every(n=>n!==!1)}function mrt(...t){const e=TX(t);return typeof e=="boolean"?Promise.resolve(e):e}function S2e(t,e,r){if(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]);case 4:return t.call(e,r[0],r[1],r[2],r[3]);case 5:return t.call(e,r[0],r[1],r[2],r[3],r[4]);case 6:return t.call(e,r[0],r[1],r[2],r[3],r[4],r[5]);default:return t.apply(e,r)}return t.call(e)}function vr(t,e,...r){return S2e(t,e,r)}function ise(t){return 180*t/Math.PI%360}const Fo=function(t,e=!1){return(e?t:t%360)*Math.PI/180};function ml(t){return t%360+(t<0?360:0)}function L1(t,e=0){return Number.isInteger(t)?t:+t.toFixed(e)}function sse(t,e){let r,n;if(e==null?(n=t??1,r=0):(n=e,r=t??0),n<r){const i=r;r=n,n=i}return Math.floor(Math.random()*(n-r+1)+r)}function Lv(t,e,r){return Number.isNaN(t)?NaN:Number.isNaN(e)||Number.isNaN(r)?0:t<e?e:t>r?r:t}function fh(t,e){return e*Math.round(t/e)}function E2e(t,e){return e!=null&&t!=null&&e.x>=t.x&&e.x<=t.x+t.width&&e.y>=t.y&&e.y<=t.y+t.height}function ase(t,e){const r=t.x-e.x,n=t.y-e.y;return r*r+n*n}class Yg{valueOf(){return this.toJSON()}toString(){return JSON.stringify(this.toJSON())}}let Qe=class Fr extends Yg{static create(e,r){return e==null||typeof e=="number"?new Fr(e,r):Fr.clone(e)}static clone(e){return Fr.isPoint(e)?new Fr(e.x,e.y):Array.isArray(e)?new Fr(e[0],e[1]):new Fr(e.x,e.y)}static equals(e,r){return e===r?!0:e!=null&&r!=null?e.x===r.x&&e.y===r.y:!1}static rotateEx(e,r,n,i=new Fr){const s=Fr.clone(e),a=Fr.clone(i),o=s.x-a.x,l=s.y-a.y,u=o*r-l*n,h=l*r+o*n;return new Fr(u+a.x,h+a.y)}static toJSON(e){return Fr.isPoint(e)?{x:e.x,y:e.y}:Array.isArray(e)?{x:e[0],y:e[1]}:{x:e.x,y:e.y}}static fromPolar(e,r,n=new Fr){let i=Math.abs(e*Math.cos(r)),s=Math.abs(e*Math.sin(r));const a=Fr.clone(n),o=ml(ise(r));return o<90?s=-s:o<180?(i=-i,s=-s):o<270&&(i=-i),new Fr(a.x+i,a.y+s)}static toPolar(e,r=new Fr){const n=Fr.clone(e),i=Fr.clone(r),s=n.x-i.x,a=n.y-i.y;return new Fr(Math.sqrt(s*s+a*a),Fo(i.theta(n)))}static equalPoints(e,r){if(e==null&&r!=null||e!=null&&r==null||e!=null&&r!=null&&e.length!==r.length)return!1;if(e!=null&&r!=null){for(let n=0,i=e.length;n<i;n+=1)if(!Fr.equals(e[n],r[n]))return!1}return!0}static random(e,r,n,i){return new Fr(sse(e,r),sse(n,i))}static rotate(e,r,n){const i=Fo(ml(-r)),s=Math.sin(i),a=Math.cos(i);return Fr.rotateEx(e,a,s,n)}static isPoint(e){return e!=null&&e instanceof Fr}static isPointLike(e){return e!=null&&typeof e=="object"&&typeof e.x=="number"&&typeof e.y=="number"}static isPointData(e){return e!=null&&Array.isArray(e)&&e.length===2&&typeof e[0]=="number"&&typeof e[1]=="number"}constructor(e,r){super(),this.x=e??0,this.y=r??0}round(e=0){return this.x=L1(this.x,e),this.y=L1(this.y,e),this}add(e,r){const n=Fr.create(e,r);return this.x+=n.x,this.y+=n.y,this}update(e,r){const n=Fr.create(e,r);return this.x=n.x,this.y=n.y,this}translate(e,r){const n=Fr.create(e,r);return this.x+=n.x,this.y+=n.y,this}rotate(e,r){const n=Fr.rotate(this,e,r);return this.x=n.x,this.y=n.y,this}scale(e,r,n=new Fr){const i=Fr.create(n);return this.x=i.x+e*(this.x-i.x),this.y=i.y+r*(this.y-i.y),this}closest(e){if(e.length===1)return Fr.create(e[0]);let r=null,n=1/0;return e.forEach(i=>{const s=this.squaredDistance(i);s<n&&(r=i,n=s)}),r?Fr.create(r):null}distance(e){return Math.sqrt(this.squaredDistance(e))}squaredDistance(e){const r=Fr.create(e),n=this.x-r.x,i=this.y-r.y;return n*n+i*i}manhattanDistance(e){const r=Fr.create(e);return Math.abs(r.x-this.x)+Math.abs(r.y-this.y)}magnitude(){return Math.sqrt(this.x*this.x+this.y*this.y)||.01}theta(e=new Fr){const r=Fr.create(e),n=-(r.y-this.y),i=r.x-this.x;let s=Math.atan2(n,i);return s<0&&(s=2*Math.PI+s),180*s/Math.PI}angleBetween(e,r){if(this.equals(e)||this.equals(r))return NaN;let n=this.theta(r)-this.theta(e);return n<0&&(n+=360),n}vectorAngle(e){return new Fr(0,0).angleBetween(this,e)}toPolar(e){return this.update(Fr.toPolar(this,e)),this}changeInAngle(e,r,n=new Fr){return this.clone().translate(-e,-r).theta(n)-this.theta(n)}adhereToRect(e){return E2e(e,this)||(this.x=Math.min(Math.max(this.x,e.x),e.x+e.width),this.y=Math.min(Math.max(this.y,e.y),e.y+e.height)),this}bearing(e){const r=Fr.create(e),n=Fo(this.y),i=Fo(r.y),s=this.x,a=r.x,o=Fo(a-s),l=Math.sin(o)*Math.cos(i),u=Math.cos(n)*Math.sin(i)-Math.sin(n)*Math.cos(i)*Math.cos(o),h=ise(Math.atan2(l,u)),d=["NE","E","SE","S","SW","W","NW","N"];let f=h-22.5;return f<0&&(f+=360),f=parseInt(f/45,10),d[f]}cross(e,r){if(e!=null&&r!=null){const n=Fr.create(e),i=Fr.create(r);return(i.x-this.x)*(n.y-this.y)-(i.y-this.y)*(n.x-this.x)}return NaN}dot(e){const r=Fr.create(e);return this.x*r.x+this.y*r.y}diff(e,r){if(typeof e=="number")return new Fr(this.x-e,this.y-r);const n=Fr.create(e);return new Fr(this.x-n.x,this.y-n.y)}lerp(e,r){const n=Fr.create(e);return new Fr((1-r)*this.x+r*n.x,(1-r)*this.y+r*n.y)}normalize(e=1){const r=e/this.magnitude();return this.scale(r,r)}move(e,r){const n=Fr.create(e),i=Fo(n.theta(this));return this.translate(Math.cos(i)*r,-Math.sin(i)*r)}reflection(e){return Fr.create(e).move(this,this.distance(e))}snapToGrid(e,r){return this.x=fh(this.x,e),this.y=fh(this.y,r??e),this}equals(e){const r=Fr.create(e);return r!=null&&r.x===this.x&&r.y===this.y}clone(){return Fr.clone(this)}toJSON(){return Fr.toJSON(this)}serialize(){return`${this.x} ${this.y}`}};class Bt extends Yg{static isRectangle(e){return e!=null&&e instanceof Bt}static isRectangleLike(e){return e!=null&&typeof e=="object"&&typeof e.x=="number"&&typeof e.y=="number"&&typeof e.width=="number"&&typeof e.height=="number"}static create(e,r,n,i){return e==null||typeof e=="number"?new Bt(e,r,n,i):Bt.clone(e)}static clone(e){return Bt.isRectangle(e)?e.clone():Array.isArray(e)?new Bt(e[0],e[1],e[2],e[3]):new Bt(e.x,e.y,e.width,e.height)}static fromEllipse(e){return new Bt(e.x-e.a,e.y-e.b,2*e.a,2*e.b)}static fromSize(e){return new Bt(0,0,e.width,e.height)}static fromPositionAndSize(e,r){return new Bt(e.x,e.y,r.width,r.height)}get left(){return this.x}get top(){return this.y}get right(){return this.x+this.width}get bottom(){return this.y+this.height}get origin(){return new Qe(this.x,this.y)}get topLeft(){return new Qe(this.x,this.y)}get topCenter(){return new Qe(this.x+this.width/2,this.y)}get topRight(){return new Qe(this.x+this.width,this.y)}get center(){return new Qe(this.x+this.width/2,this.y+this.height/2)}get bottomLeft(){return new Qe(this.x,this.y+this.height)}get bottomCenter(){return new Qe(this.x+this.width/2,this.y+this.height)}get bottomRight(){return new Qe(this.x+this.width,this.y+this.height)}get corner(){return new Qe(this.x+this.width,this.y+this.height)}get rightMiddle(){return new Qe(this.x+this.width,this.y+this.height/2)}get leftMiddle(){return new Qe(this.x,this.y+this.height/2)}get topLine(){return new lr(this.topLeft,this.topRight)}get rightLine(){return new lr(this.topRight,this.bottomRight)}get bottomLine(){return new lr(this.bottomLeft,this.bottomRight)}get leftLine(){return new lr(this.topLeft,this.bottomLeft)}constructor(e,r,n,i){super(),this.x=e??0,this.y=r??0,this.width=n??0,this.height=i??0}getOrigin(){return this.origin}getTopLeft(){return this.topLeft}getTopCenter(){return this.topCenter}getTopRight(){return this.topRight}getCenter(){return this.center}getCenterX(){return this.x+this.width/2}getCenterY(){return this.y+this.height/2}getBottomLeft(){return this.bottomLeft}getBottomCenter(){return this.bottomCenter}getBottomRight(){return this.bottomRight}getCorner(){return this.corner}getRightMiddle(){return this.rightMiddle}getLeftMiddle(){return this.leftMiddle}getTopLine(){return this.topLine}getRightLine(){return this.rightLine}getBottomLine(){return this.bottomLine}getLeftLine(){return this.leftLine}bbox(e){if(!e)return this.clone();const r=Fo(e),n=Math.abs(Math.sin(r)),i=Math.abs(Math.cos(r)),s=this.width*i+this.height*n,a=this.width*n+this.height*i;return new Bt(this.x+(this.width-s)/2,this.y+(this.height-a)/2,s,a)}round(e=0){return this.x=L1(this.x,e),this.y=L1(this.y,e),this.width=L1(this.width,e),this.height=L1(this.height,e),this}add(e,r,n,i){const s=Bt.create(e,r,n,i),a=Math.min(this.x,s.x),o=Math.min(this.y,s.y),l=Math.max(this.x+this.width,s.x+s.width),u=Math.max(this.y+this.height,s.y+s.height);return this.x=a,this.y=o,this.width=l-a,this.height=u-o,this}update(e,r,n,i){const s=Bt.create(e,r,n,i);return this.x=s.x,this.y=s.y,this.width=s.width,this.height=s.height,this}inflate(e,r){const n=e,i=r??e;return this.x-=n,this.y-=i,this.width+=2*n,this.height+=2*i,this}snapToGrid(e,r){const n=this.origin.snapToGrid(e,r),i=this.corner.snapToGrid(e,r);return this.x=n.x,this.y=n.y,this.width=i.x-n.x,this.height=i.y-n.y,this}translate(e,r){const n=Qe.create(e,r);return this.x+=n.x,this.y+=n.y,this}scale(e,r,n=new Qe){const i=this.origin.scale(e,r,n);return this.x=i.x,this.y=i.y,this.width*=e,this.height*=r,this}rotate(e,r=this.getCenter()){if(e!==0){const n=Fo(e),i=Math.cos(n),s=Math.sin(n);let a=this.getOrigin(),o=this.getTopRight(),l=this.getBottomRight(),u=this.getBottomLeft();a=Qe.rotateEx(a,i,s,r),o=Qe.rotateEx(o,i,s,r),l=Qe.rotateEx(l,i,s,r),u=Qe.rotateEx(u,i,s,r);const h=new Bt(a.x,a.y,0,0);h.add(o.x,o.y,0,0),h.add(l.x,l.y,0,0),h.add(u.x,u.y,0,0),this.update(h)}return this}rotate90(){const e=(this.width-this.height)/2;this.x+=e,this.y-=e;const r=this.width;return this.width=this.height,this.height=r,this}moveAndExpand(e){const r=Bt.clone(e);return this.x+=r.x||0,this.y+=r.y||0,this.width+=r.width||0,this.height+=r.height||0,this}getMaxScaleToFit(e,r=this.center){const n=Bt.clone(e),i=r.x,s=r.y;let a=1/0,o=1/0,l=1/0,u=1/0,h=1/0,d=1/0,f=1/0,p=1/0;const g=n.topLeft;g.x<i&&(a=(this.x-i)/(g.x-i)),g.y<s&&(h=(this.y-s)/(g.y-s));const m=n.bottomRight;m.x>i&&(o=(this.x+this.width-i)/(m.x-i)),m.y>s&&(d=(this.y+this.height-s)/(m.y-s));const y=n.topRight;y.x>i&&(l=(this.x+this.width-i)/(y.x-i)),y.y<s&&(f=(this.y-s)/(y.y-s));const v=n.bottomLeft;return v.x<i&&(u=(this.x-i)/(v.x-i)),v.y>s&&(p=(this.y+this.height-s)/(v.y-s)),{sx:Math.min(a,o,l,u),sy:Math.min(h,d,f,p)}}getMaxUniformScaleToFit(e,r=this.center){const n=this.getMaxScaleToFit(e,r);return Math.min(n.sx,n.sy)}containsPoint(e,r){return E2e(this,Qe.create(e,r))}containsRect(e,r,n,i){const s=Bt.create(e,r,n,i),a=this.x,o=this.y,l=this.width,u=this.height,h=s.x,d=s.y,f=s.width,p=s.height;return l===0||u===0||f===0||p===0?!1:h>=a&&d>=o&&h+f<=a+l&&d+p<=o+u}intersectsWithLine(e){const r=[this.topLine,this.rightLine,this.bottomLine,this.leftLine],n=[],i=[];return r.forEach(s=>{const a=e.intersectsWithLine(s);a!==null&&i.indexOf(a.toString())<0&&(n.push(a),i.push(a.toString()))}),n.length>0?n:null}intersectsWithLineFromCenterToPoint(e,r){const n=Qe.clone(e),i=this.center;let s=null;r!=null&&r!==0&&n.rotate(r,i);const a=[this.topLine,this.rightLine,this.bottomLine,this.leftLine],o=new lr(i,n);for(let l=a.length-1;l>=0;l-=1){const u=a[l].intersectsWithLine(o);if(u!==null){s=u;break}}return s&&r!=null&&r!==0&&s.rotate(-r,i),s}intersectsWithRect(e,r,n,i){const s=Bt.create(e,r,n,i);if(!this.isIntersectWithRect(s))return null;const a=this.origin,o=this.corner,l=s.origin,u=s.corner,h=Math.max(a.x,l.x),d=Math.max(a.y,l.y);return new Bt(h,d,Math.min(o.x,u.x)-h,Math.min(o.y,u.y)-d)}isIntersectWithRect(e,r,n,i){const s=Bt.create(e,r,n,i),a=this.origin,o=this.corner,l=s.origin,u=s.corner;return!(u.x<=a.x||u.y<=a.y||l.x>=o.x||l.y>=o.y)}normalize(){let e=this.x,r=this.y,n=this.width,i=this.height;return this.width<0&&(e=this.x+this.width,n=-this.width),this.height<0&&(r=this.y+this.height,i=-this.height),this.x=e,this.y=r,this.width=n,this.height=i,this}union(e){const r=Bt.clone(e),n=this.origin,i=this.corner,s=r.origin,a=r.corner,o=Math.min(n.x,s.x),l=Math.min(n.y,s.y),u=Math.max(i.x,a.x),h=Math.max(i.y,a.y);return new Bt(o,l,u-o,h-l)}getNearestSideToPoint(e){const r=Qe.clone(e),n=r.x-this.x,i=this.x+this.width-r.x,s=r.y-this.y,a=this.y+this.height-r.y;let o=n,l="left";return i<o&&(o=i,l="right"),s<o&&(o=s,l="top"),a<o&&(l="bottom"),l}getNearestPointToPoint(e){const r=Qe.clone(e);if(this.containsPoint(r)){const n=this.getNearestSideToPoint(r);if(n==="left")return new Qe(this.x,r.y);if(n==="top")return new Qe(r.x,this.y);if(n==="right")return new Qe(this.x+this.width,r.y);if(n==="bottom")return new Qe(r.x,this.y+this.height)}return r.adhereToRect(this)}equals(e){return e!=null&&e.x===this.x&&e.y===this.y&&e.width===this.width&&e.height===this.height}clone(){return new Bt(this.x,this.y,this.width,this.height)}toJSON(){return{x:this.x,y:this.y,width:this.width,height:this.height}}serialize(){return`${this.x} ${this.y} ${this.width} ${this.height}`}}class lr extends Yg{static isLine(e){return e!=null&&e instanceof lr}get center(){return new Qe((this.start.x+this.end.x)/2,(this.start.y+this.end.y)/2)}constructor(e,r,n,i){super(),typeof e=="number"&&typeof r=="number"?(this.start=new Qe(e,r),this.end=new Qe(n,i)):(this.start=Qe.create(e),this.end=Qe.create(r))}getCenter(){return this.center}round(e=0){return this.start.round(e),this.end.round(e),this}translate(e,r){return typeof e=="number"?(this.start.translate(e,r),this.end.translate(e,r)):(this.start.translate(e),this.end.translate(e)),this}rotate(e,r){return this.start.rotate(e,r),this.end.rotate(e,r),this}scale(e,r,n){return this.start.scale(e,r,n),this.end.scale(e,r,n),this}length(){return Math.sqrt(this.squaredLength())}squaredLength(){const e=this.start.x-this.end.x,r=this.start.y-this.end.y;return e*e+r*r}setLength(e){const r=this.length();if(!r)return this;const n=e/r;return this.scale(n,n,this.start)}parallel(e){const r=this.clone();if(!r.isDifferentiable())return r;const{start:n,end:i}=r,s=n.clone().rotate(270,i),a=i.clone().rotate(90,n);return n.move(a,e),i.move(s,e),r}vector(){return new Qe(this.end.x-this.start.x,this.end.y-this.start.y)}angle(){const e=new Qe(this.start.x+1,this.start.y);return this.start.angleBetween(this.end,e)}bbox(){const e=Math.min(this.start.x,this.end.x),r=Math.min(this.start.y,this.end.y),n=Math.max(this.start.x,this.end.x),i=Math.max(this.start.y,this.end.y);return new Bt(e,r,n-e,i-r)}bearing(){return this.start.bearing(this.end)}closestPoint(e){return this.pointAt(this.closestPointNormalizedLength(e))}closestPointLength(e){return this.closestPointNormalizedLength(e)*this.length()}closestPointTangent(e){return this.tangentAt(this.closestPointNormalizedLength(e))}closestPointNormalizedLength(e){const r=this.vector().dot(new lr(this.start,e).vector()),n=Math.min(1,Math.max(0,r/this.squaredLength()));return Number.isNaN(n)?0:n}pointAt(e){const r=this.start,n=this.end;return e<=0?r.clone():e>=1?n.clone():r.lerp(n,e)}pointAtLength(e){const r=this.start,n=this.end;let i=!0;e<0&&(i=!1,e=-e);const s=this.length();if(e>=s)return i?n.clone():r.clone();const a=(i?e:s-e)/s;return this.pointAt(a)}divideAt(e){const r=this.pointAt(e);return[new lr(this.start,r),new lr(r,this.end)]}divideAtLength(e){const r=this.pointAtLength(e);return[new lr(this.start,r),new lr(r,this.end)]}containsPoint(e){const r=this.start,n=this.end;if(r.cross(e,n)!==0)return!1;const i=this.length();return!(new lr(r,e).length()>i||new lr(e,n).length()>i)}intersect(e,r){const n=e.intersectsWithLine(this,r);return n?Array.isArray(n)?n:[n]:null}intersectsWithLine(e){const r=new Qe(this.end.x-this.start.x,this.end.y-this.start.y),n=new Qe(e.end.x-e.start.x,e.end.y-e.start.y),i=r.x*n.y-r.y*n.x,s=new Qe(e.start.x-this.start.x,e.start.y-this.start.y),a=s.x*n.y-s.y*n.x,o=s.x*r.y-s.y*r.x;if(i===0||a*i<0||o*i<0)return null;if(i>0){if(a>i||o>i)return null}else if(a<i||o<i)return null;return new Qe(this.start.x+a*r.x/i,this.start.y+a*r.y/i)}isDifferentiable(){return!this.start.equals(this.end)}pointOffset(e){const r=Qe.clone(e),n=this.start,i=this.end;return((i.x-n.x)*(r.y-n.y)-(i.y-n.y)*(r.x-n.x))/this.length()}pointSquaredDistance(e,r){const n=Qe.create(e,r);return this.closestPoint(n).squaredDistance(n)}pointDistance(e,r){const n=Qe.create(e,r);return this.closestPoint(n).distance(n)}tangentAt(e){if(!this.isDifferentiable())return null;const r=this.start,n=this.end,i=this.pointAt(e),s=new lr(r,n);return s.translate(i.x-r.x,i.y-r.y),s}tangentAtLength(e){if(!this.isDifferentiable())return null;const r=this.start,n=this.end,i=this.pointAtLength(e),s=new lr(r,n);return s.translate(i.x-r.x,i.y-r.y),s}relativeCcw(e,r){const n=Qe.create(e,r);let i=n.x-this.start.x,s=n.y-this.start.y;const a=this.end.x-this.start.x,o=this.end.y-this.start.y;let l=i*o-s*a;return l===0&&(l=i*a+s*o,l>0&&(i-=a,s-=o,l=i*a+s*o,l<0&&(l=0))),l<0?-1:l>0?1:0}equals(e){return e!=null&&this.start.x===e.start.x&&this.start.y===e.start.y&&this.end.x===e.end.x&&this.end.y===e.end.y}clone(){return new lr(this.start,this.end)}toJSON(){return{start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){return[this.start.serialize(),this.end.serialize()].join(" ")}}class rc extends Yg{static isEllipse(e){return e!=null&&e instanceof rc}static create(e,r,n,i){return e==null||typeof e=="number"?new rc(e,r,n,i):rc.parse(e)}static parse(e){return rc.isEllipse(e)?e.clone():Array.isArray(e)?new rc(e[0],e[1],e[2],e[3]):new rc(e.x,e.y,e.a,e.b)}static fromRect(e){const r=e.center;return new rc(r.x,r.y,e.width/2,e.height/2)}get center(){return new Qe(this.x,this.y)}constructor(e,r,n,i){super(),this.x=e??0,this.y=r??0,this.a=n??0,this.b=i??0}bbox(){return Bt.fromEllipse(this)}getCenter(){return this.center}inflate(e,r){const n=e,i=r??e;return this.a+=2*n,this.b+=2*i,this}normalizedDistance(e,r){const n=Qe.create(e,r),i=n.x-this.x,s=n.y-this.y,a=this.a,o=this.b;return i*i/(a*a)+s*s/(o*o)}containsPoint(e,r){return this.normalizedDistance(e,r)<=1}intersectsWithLine(e){const r=[],n=this.a,i=this.b,s=e.start,a=e.end,o=e.vector(),l=s.diff(new Qe(this.x,this.y)),u=new Qe(o.x/(n*n),o.y/(i*i)),h=new Qe(l.x/(n*n),l.y/(i*i)),d=o.dot(u),f=o.dot(h),p=l.dot(h)-1,g=f*f-d*p;if(g<0)return null;if(g>0){const m=Math.sqrt(g),y=(-f-m)/d,v=(-f+m)/d;if((y<0||y>1)&&(v<0||v>1))return null;y>=0&&y<=1&&r.push(s.lerp(a,y)),v>=0&&v<=1&&r.push(s.lerp(a,v))}else{const m=-f/d;if(m>=0&&m<=1)r.push(s.lerp(a,m));else return null}return r}intersectsWithLineFromCenterToPoint(e,r=0){const n=Qe.clone(e);r&&n.rotate(r,this.getCenter());const i=n.x-this.x,s=n.y-this.y;let a;if(i===0)return a=this.bbox().getNearestPointToPoint(n),r?a.rotate(-r,this.getCenter()):a;const o=s/i,l=o*o,u=this.a*this.a,h=this.b*this.b;let d=Math.sqrt(1/(1/u+l/h));d=i<0?-d:d;const f=o*d;return a=new Qe(this.x+d,this.y+f),r?a.rotate(-r,this.getCenter()):a}tangentTheta(e){const r=Qe.clone(e),n=r.x,i=r.y,s=this.a,a=this.b,o=this.bbox().center,l=o.x,u=o.y,h=30,d=n>o.x+s/2,f=n<o.x-s/2;let p,g;return d||f?(g=n>o.x?i-h:i+h,p=s*s/(n-l)-s*s*(i-u)*(g-u)/(a*a*(n-l))+l):(p=i>o.y?n+h:n-h,g=a*a/(i-u)-a*a*(n-l)*(p-l)/(s*s*(i-u))+u),new Qe(p,g).theta(r)}scale(e,r){return this.a*=e,this.b*=r,this}rotate(e,r){const n=Bt.fromEllipse(this);n.rotate(e,r);const i=rc.fromRect(n);return this.a=i.a,this.b=i.b,this.x=i.x,this.y=i.y,this}translate(e,r){const n=Qe.create(e,r);return this.x+=n.x,this.y+=n.y,this}equals(e){return e!=null&&e.x===this.x&&e.y===this.y&&e.a===this.a&&e.b===this.b}clone(){return new rc(this.x,this.y,this.a,this.b)}toJSON(){return{x:this.x,y:this.y,a:this.a,b:this.b}}serialize(){return`${this.x} ${this.y} ${this.a} ${this.b}`}}const yrt=new RegExp("^[\\s\\dLMCZz,.]*$");function vrt(t){return typeof t!="string"?!1:yrt.test(t)}function t$(t,e){return(t%e+e)%e}function brt(t,e,r,n,i){if(!t||t.length===0)return"";const s=[],a=t[t.length-1],o=e!=null&&e>0,l=e||0;if(n&&o){t=t.slice();const d=t[0],f=new Qe(a.x+(d.x-a.x)/2,a.y+(d.y-a.y)/2);t.splice(0,0,f)}let u=t[0],h=1;for(r?s.push("M",u.x,u.y):s.push("L",u.x,u.y);h<(n?t.length:t.length-1);){let d=t[t$(h,t.length)],f=u.x-d.x,p=u.y-d.y;if(o&&(f!==0||p!==0)&&(i==null||i.indexOf(h-1)<0)){let g=Math.sqrt(f*f+p*p);const m=f*Math.min(l,g/2)/g,y=p*Math.min(l,g/2)/g,v=d.x+m,x=d.y+y;s.push("L",v,x);let b=t[t$(h+1,t.length)];for(;h<t.length-2&&Math.round(b.x-d.x)===0&&Math.round(b.y-d.y)===0;)b=t[t$(h+2,t.length)],h+=1;f=b.x-d.x,p=b.y-d.y,g=Math.max(1,Math.sqrt(f*f+p*p));const T=f*Math.min(l,g/2)/g,C=p*Math.min(l,g/2)/g,S=d.x+T,k=d.y+C;s.push("Q",d.x,d.y,S,k),d=new Qe(S,k)}else s.push("L",d.x,d.y);u=d,h+=1}return n?s.push("Z"):s.push("L",a.x,a.y),s.map(d=>typeof d=="string"?d:+d.toFixed(3)).join(" ")}function xrt(t,e={}){const r=[];return t&&t.length&&t.forEach(n=>{Array.isArray(n)?r.push({x:n[0],y:n[1]}):r.push({x:n.x,y:n.y})}),brt(r,e.round,e.initialMove==null||e.initialMove,e.close,e.exclude)}function ose(t,e,r,n,i=0,s=0,a=0,o,l){if(r===0||n===0)return[];o-=t,l-=e,r=Math.abs(r),n=Math.abs(n);const u=-o/2,h=-l/2,d=Math.cos(i*Math.PI/180),f=Math.sin(i*Math.PI/180),p=d*u+f*h,g=-1*f*u+d*h,m=p*p,y=g*g,v=r*r,x=n*n,b=m/v+y/x;let T;if(b>1)r=Math.sqrt(b)*r,n=Math.sqrt(b)*n,T=0;else{let q=1;s===a&&(q=-1),T=q*Math.sqrt((v*x-v*y-x*m)/(v*y+x*m))}const C=T*r*g/n,S=-1*T*n*p/r,k=d*C-f*S+o/2,E=f*C+d*S+l/2;let A=Math.atan2((g-S)/n,(p-C)/r)-Math.atan2(0,1),R=A>=0?A:2*Math.PI+A;A=Math.atan2((-g-S)/n,(-p-C)/r)-Math.atan2((g-S)/n,(p-C)/r);let _=A>=0?A:2*Math.PI+A;a===0&&_>0?_-=2*Math.PI:a!==0&&_<0&&(_+=2*Math.PI);const P=_*2/Math.PI,N=Math.ceil(P<0?-1*P:P),L=_/N,I=8/3*Math.sin(L/4)*Math.sin(L/4)/Math.sin(L/2),$=d*r,O=d*n,D=f*r,F=f*n;let z=Math.cos(R),V=Math.sin(R),B=-I*($*V+F*z),H=-I*(D*V-O*z),G=0,W=0;const K=[];for(let q=0;q<N;q+=1){R+=L,z=Math.cos(R),V=Math.sin(R),G=$*z-F*V+k,W=D*z+O*V+E;const oe=-I*($*V+F*z),Q=-I*(D*V-O*z),Z=q*6;K[Z]=Number(B+t),K[Z+1]=Number(H+e),K[Z+2]=Number(G-oe+t),K[Z+3]=Number(W-Q+e),K[Z+4]=Number(G+t),K[Z+5]=Number(W+e),B=G+oe,H=W+Q}return K.map(q=>+q.toFixed(2))}class Ba extends Yg{static isPolyline(e){return e!=null&&e instanceof Ba}static parse(e){const r=e.trim();if(r==="")return new Ba;const n=[],i=r.split(/\s*,\s*|\s+/);for(let s=0,a=i.length;s<a;s+=2)n.push({x:+i[s],y:+i[s+1]});return new Ba(n)}get start(){return this.points[0]||null}get end(){return this.points[this.points.length-1]||null}constructor(e){if(super(),e!=null){if(typeof e=="string")return Ba.parse(e);this.points=e.map(r=>Qe.create(r))}else this.points=[]}scale(e,r,n=new Qe){return this.points.forEach(i=>i.scale(e,r,n)),this}rotate(e,r){return this.points.forEach(n=>n.rotate(e,r)),this}translate(e,r){const n=Qe.create(e,r);return this.points.forEach(i=>i.translate(n.x,n.y)),this}round(e=0){return this.points.forEach(r=>r.round(e)),this}bbox(){if(this.points.length===0)return new Bt;let e=1/0,r=-1/0,n=1/0,i=-1/0;const s=this.points;for(let a=0,o=s.length;a<o;a+=1){const l=s[a],u=l.x,h=l.y;u<e&&(e=u),u>r&&(r=u),h<n&&(n=h),h>i&&(i=h)}return new Bt(e,n,r-e,i-n)}closestPoint(e){const r=this.closestPointLength(e);return this.pointAtLength(r)}closestPointLength(e){const r=this.points,n=r.length;if(n===0||n===1)return 0;let i=0,s=0,a=1/0;for(let o=0,l=n-1;o<l;o+=1){const u=new lr(r[o],r[o+1]),h=u.length(),d=u.closestPointNormalizedLength(e),p=u.pointAt(d).squaredDistance(e);p<a&&(a=p,s=i+d*h),i+=h}return s}closestPointNormalizedLength(e){const r=this.length();return r===0?0:this.closestPointLength(e)/r}closestPointTangent(e){const r=this.closestPointLength(e);return this.tangentAtLength(r)}containsPoint(e){if(this.points.length===0)return!1;const r=Qe.clone(e),n=r.x,i=r.y,s=this.points,a=s.length;let o=a-1,l=0;for(let u=0;u<a;u+=1){const h=s[o],d=s[u];if(r.equals(h))return!0;const f=new lr(h,d);if(f.containsPoint(e))return!0;if(i<=h.y&&i>d.y||i>h.y&&i<=d.y){const p=h.x-n>d.x-n?h.x-n:d.x-n;if(p>=0){const g=new Qe(n+p,i),m=new lr(e,g);f.intersectsWithLine(m)&&(l+=1)}}o=u}return l%2===1}intersectsWithLine(e){const r=[];for(let n=0,i=this.points.length-1;n<i;n+=1){const s=this.points[n],a=this.points[n+1],o=e.intersectsWithLine(new lr(s,a));o&&r.push(o)}return r.length>0?r:null}isDifferentiable(){for(let e=0,r=this.points.length-1;e<r;e+=1){const n=this.points[e],i=this.points[e+1];if(new lr(n,i).isDifferentiable())return!0}return!1}length(){let e=0;for(let r=0,n=this.points.length-1;r<n;r+=1){const i=this.points[r],s=this.points[r+1];e+=i.distance(s)}return e}pointAt(e){const r=this.points,n=r.length;if(n===0)return null;if(n===1||e<=0)return r[0].clone();if(e>=1)return r[n-1].clone();const s=this.length()*e;return this.pointAtLength(s)}pointAtLength(e){const r=this.points,n=r.length;if(n===0)return null;if(n===1)return r[0].clone();let i=!0;e<0&&(i=!1,e=-e);let s=0;for(let o=0,l=n-1;o<l;o+=1){const u=i?o:l-1-o,h=r[u],d=r[u+1],f=new lr(h,d),p=h.distance(d);if(e<=s+p)return f.pointAtLength((i?1:-1)*(e-s));s+=p}return(i?r[n-1]:r[0]).clone()}tangentAt(e){const n=this.points.length;if(n===0||n===1)return null;e<0&&(e=0),e>1&&(e=1);const s=this.length()*e;return this.tangentAtLength(s)}tangentAtLength(e){const r=this.points,n=r.length;if(n===0||n===1)return null;let i=!0;e<0&&(i=!1,e=-e);let s,a=0;for(let o=0,l=n-1;o<l;o+=1){const u=i?o:l-1-o,h=r[u],d=r[u+1],f=new lr(h,d),p=h.distance(d);if(f.isDifferentiable()){if(e<=a+p)return f.tangentAtLength((i?1:-1)*(e-a));s=f}a+=p}if(s){const o=i?1:0;return s.tangentAt(o)}return null}simplify(e={}){const r=this.points;if(r.length<3)return this;const n=e.threshold||0;let i=0;for(;r[i+2];){const s=i,a=i+1,o=i+2,l=r[s],u=r[a],h=r[o];new lr(l,h).closestPoint(u).distance(u)<=n?r.splice(a,1):i+=1}return this}toHull(){const e=this.points,r=e.length;if(r===0)return new Ba;let n=e[0];for(let f=1;f<r;f+=1)(e[f].y<n.y||e[f].y===n.y&&e[f].x>n.x)&&(n=e[f]);const i=[];for(let f=0;f<r;f+=1){let p=n.theta(e[f]);p===0&&(p=360),i.push([e[f],f,p])}if(i.sort((f,p)=>{let g=f[2]-p[2];return g===0&&(g=p[1]-f[1]),g}),i.length>2){const f=i[i.length-1];i.unshift(f)}const s={},a=[],o=f=>`${f[0].toString()}@${f[1]}`;for(;i.length!==0;){const f=i.pop(),p=f[0];if(s[o(f)])continue;let g=!1;for(;!g;)if(a.length<2)a.push(f),g=!0;else{const m=a.pop(),y=m[0],v=a.pop(),x=v[0],b=x.cross(y,p);if(b<0)a.push(v),a.push(m),a.push(f),g=!0;else if(b===0){const C=y.angleBetween(x,p);Math.abs(C-180)<1e-10||y.equals(p)||x.equals(y)?(s[o(m)]=y,a.push(v)):Math.abs((C+1)%360-1)<1e-10&&(a.push(v),i.push(m))}else s[o(m)]=y,a.push(v)}}a.length>2&&a.pop();let l,u=-1;for(let f=0,p=a.length;f<p;f+=1){const g=a[f][1];(l===void 0||g<l)&&(l=g,u=f)}let h=[];if(u>0){const f=a.slice(u),p=a.slice(0,u);h=f.concat(p)}else h=a;const d=[];for(let f=0,p=h.length;f<p;f+=1)d.push(h[f][0]);return new Ba(d)}equals(e){return e==null||e.points.length!==this.points.length?!1:e.points.every((r,n)=>r.equals(this.points[n]))}clone(){return new Ba(this.points.map(e=>e.clone()))}toJSON(){return this.points.map(e=>e.toJSON())}serialize(){return this.points.map(e=>`${e.serialize()}`).join(" ")}}let Jf=class Wu extends Yg{static isCurve(e){return e!=null&&e instanceof Wu}static throughPoints(e){if(e==null||Array.isArray(e)&&e.length<2)throw new Error("At least 2 points are required");const r=wrt(e),n=[];for(let i=0,s=r[0].length;i<s;i+=1){const a=new Qe(r[0][i].x,r[0][i].y),o=new Qe(r[1][i].x,r[1][i].y);n.push(new Wu(e[i],a,o,e[i+1]))}return n}constructor(e,r,n,i){super(),this.PRECISION=3,this.start=Qe.create(e),this.controlPoint1=Qe.create(r),this.controlPoint2=Qe.create(n),this.end=Qe.create(i)}bbox(){const e=this.start,r=this.controlPoint1,n=this.controlPoint2,i=this.end,s=e.x,a=e.y,o=r.x,l=r.y,u=n.x,h=n.y,d=i.x,f=i.y,p=[],g=[[],[]];let m,y,v,x,b,T,C,S;for(let $=0;$<2;$+=1){if($===0?(y=6*s-12*o+6*u,m=-3*s+9*o-9*u+3*d,v=3*o-3*s):(y=6*a-12*l+6*h,m=-3*a+9*l-9*h+3*f,v=3*l-3*a),Math.abs(m)<1e-12){if(Math.abs(y)<1e-12)continue;x=-v/y,x>0&&x<1&&p.push(x);continue}C=y*y-4*v*m,S=Math.sqrt(C),!(C<0)&&(b=(-y+S)/(2*m),b>0&&b<1&&p.push(b),T=(-y-S)/(2*m),T>0&&T<1&&p.push(T))}let k,E,A,R=p.length;const _=R;for(;R;)R-=1,x=p[R],A=1-x,k=A*A*A*s+3*A*A*x*o+3*A*x*x*u+x*x*x*d,g[0][R]=k,E=A*A*A*a+3*A*A*x*l+3*A*x*x*h+x*x*x*f,g[1][R]=E;p[_]=0,p[_+1]=1,g[0][_]=s,g[1][_]=a,g[0][_+1]=d,g[1][_+1]=f,p.length=_+2,g[0].length=_+2,g[1].length=_+2;const P=Math.min.apply(null,g[0]),N=Math.min.apply(null,g[1]),L=Math.max.apply(null,g[0]),I=Math.max.apply(null,g[1]);return new Bt(P,N,L-P,I-N)}closestPoint(e,r={}){return this.pointAtT(this.closestPointT(e,r))}closestPointLength(e,r={}){const n=this.getOptions(r);return this.lengthAtT(this.closestPointT(e,n),n)}closestPointNormalizedLength(e,r={}){const n=this.getOptions(r),i=this.closestPointLength(e,n);if(!i)return 0;const s=this.length(n);return s===0?0:i/s}closestPointT(e,r={}){const n=this.getPrecision(r),i=this.getDivisions(r),s=Math.pow(10,-n);let a=null,o=0,l=0,u=0,h=0,d=0,f=null;const p=i.length;let g=p>0?1/p:0;for(i.forEach((m,y)=>{const v=m.start.distance(e),x=m.end.distance(e),b=v+x;(f==null||b<f)&&(a=m,o=y*g,l=(y+1)*g,u=v,h=x,f=b,d=m.endpointDistance())});;){const m=u?Math.abs(u-h)/u:0,y=h!=null?Math.abs(u-h)/h:0,v=m<s||y<s,x=u?u<d*s:!0,b=h?h<d*s:!0;if(v||(x||b))return u<=h?o:l;const C=a.divide(.5);g/=2;const S=C[0].start.distance(e),k=C[0].end.distance(e),E=S+k,A=C[1].start.distance(e),R=C[1].end.distance(e),_=A+R;E<=_?(a=C[0],l-=g,u=S,h=k):(a=C[1],o+=g,u=A,h=R)}}closestPointTangent(e,r={}){return this.tangentAtT(this.closestPointT(e,r))}containsPoint(e,r={}){return this.toPolyline(r).containsPoint(e)}divideAt(e,r={}){if(e<=0)return this.divideAtT(0);if(e>=1)return this.divideAtT(1);const n=this.tAt(e,r);return this.divideAtT(n)}divideAtLength(e,r={}){const n=this.tAtLength(e,r);return this.divideAtT(n)}divide(e){return this.divideAtT(e)}divideAtT(e){const r=this.start,n=this.controlPoint1,i=this.controlPoint2,s=this.end;if(e<=0)return[new Wu(r,r,r,r),new Wu(r,n,i,s)];if(e>=1)return[new Wu(r,n,i,s),new Wu(s,s,s,s)];const a=this.getSkeletonPoints(e),o=a.startControlPoint1,l=a.startControlPoint2,u=a.divider,h=a.dividerControlPoint1,d=a.dividerControlPoint2;return[new Wu(r,o,l,u),new Wu(u,h,d,s)]}endpointDistance(){return this.start.distance(this.end)}getSkeletonPoints(e){const r=this.start,n=this.controlPoint1,i=this.controlPoint2,s=this.end;if(e<=0)return{startControlPoint1:r.clone(),startControlPoint2:r.clone(),divider:r.clone(),dividerControlPoint1:n.clone(),dividerControlPoint2:i.clone()};if(e>=1)return{startControlPoint1:n.clone(),startControlPoint2:i.clone(),divider:s.clone(),dividerControlPoint1:s.clone(),dividerControlPoint2:s.clone()};const a=new lr(r,n).pointAt(e),o=new lr(n,i).pointAt(e),l=new lr(i,s).pointAt(e),u=new lr(a,o).pointAt(e),h=new lr(o,l).pointAt(e),d=new lr(u,h).pointAt(e);return{startControlPoint1:a,startControlPoint2:u,divider:d,dividerControlPoint1:h,dividerControlPoint2:l}}getSubdivisions(e={}){const r=this.getPrecision(e);let n=[new Wu(this.start,this.controlPoint1,this.controlPoint2,this.end)];if(r===0)return n;let i=this.endpointDistance();const s=Math.pow(10,-r);let a=0;for(;;){a+=1;const o=[];n.forEach(h=>{const d=h.divide(.5);o.push(d[0],d[1])});const l=o.reduce((h,d)=>h+d.endpointDistance(),0),u=l!==0?(l-i)/l:0;if(a>1&&u<s)return o;n=o,i=l}}length(e={}){return this.getDivisions(e).reduce((n,i)=>n+i.endpointDistance(),0)}lengthAtT(e,r={}){if(e<=0)return 0;const n=r.precision===void 0?this.PRECISION:r.precision;return this.divide(e)[0].length({precision:n})}pointAt(e,r={}){if(e<=0)return this.start.clone();if(e>=1)return this.end.clone();const n=this.tAt(e,r);return this.pointAtT(n)}pointAtLength(e,r={}){const n=this.tAtLength(e,r);return this.pointAtT(n)}pointAtT(e){return e<=0?this.start.clone():e>=1?this.end.clone():this.getSkeletonPoints(e).divider}isDifferentiable(){const e=this.start,r=this.controlPoint1,n=this.controlPoint2,i=this.end;return!(e.equals(r)&&r.equals(n)&&n.equals(i))}tangentAt(e,r={}){if(!this.isDifferentiable())return null;e<0?e=0:e>1&&(e=1);const n=this.tAt(e,r);return this.tangentAtT(n)}tangentAtLength(e,r={}){if(!this.isDifferentiable())return null;const n=this.tAtLength(e,r);return this.tangentAtT(n)}tangentAtT(e){if(!this.isDifferentiable())return null;e<0&&(e=0),e>1&&(e=1);const r=this.getSkeletonPoints(e),n=r.startControlPoint2,i=r.dividerControlPoint1,s=r.divider,a=new lr(n,i);return a.translate(s.x-n.x,s.y-n.y),a}getPrecision(e={}){return e.precision==null?this.PRECISION:e.precision}getDivisions(e={}){if(e.subdivisions!=null)return e.subdivisions;const r=this.getPrecision(e);return this.getSubdivisions({precision:r})}getOptions(e={}){const r=this.getPrecision(e),n=this.getDivisions(e);return{precision:r,subdivisions:n}}tAt(e,r={}){if(e<=0)return 0;if(e>=1)return 1;const n=this.getOptions(r),s=this.length(n)*e;return this.tAtLength(s,n)}tAtLength(e,r={}){let n=!0;e<0&&(n=!1,e=-e);const i=this.getPrecision(r),s=this.getDivisions(r),a={precision:i,subdivisions:s};let o=null,l,u,h=0,d=0,f=0;const p=s.length;let g=p>0?1/p:0;for(let v=0;v<p;v+=1){const x=n?v:p-1-v,b=s[v],T=b.endpointDistance();if(e<=f+T){o=b,l=x*g,u=(x+1)*g,h=n?e-f:T+f-e,d=n?T+f-e:e-f;break}f+=T}if(o==null)return n?1:0;const m=this.length(a),y=Math.pow(10,-i);for(;;){let v;if(v=m!==0?h/m:0,v<y)return l;if(v=m!==0?d/m:0,v<y)return u;let x,b;const T=o.divide(.5);g/=2;const C=T[0].endpointDistance(),S=T[1].endpointDistance();h<=C?(o=T[0],u-=g,x=h,b=C-x):(o=T[1],l+=g,x=h-C,b=S-x),h=x,d=b}}toPoints(e={}){const r=this.getDivisions(e),n=[r[0].start.clone()];return r.forEach(i=>n.push(i.end.clone())),n}toPolyline(e={}){return new Ba(this.toPoints(e))}scale(e,r,n){return this.start.scale(e,r,n),this.controlPoint1.scale(e,r,n),this.controlPoint2.scale(e,r,n),this.end.scale(e,r,n),this}rotate(e,r){return this.start.rotate(e,r),this.controlPoint1.rotate(e,r),this.controlPoint2.rotate(e,r),this.end.rotate(e,r),this}translate(e,r){return typeof e=="number"?(this.start.translate(e,r),this.controlPoint1.translate(e,r),this.controlPoint2.translate(e,r),this.end.translate(e,r)):(this.start.translate(e),this.controlPoint1.translate(e),this.controlPoint2.translate(e),this.end.translate(e)),this}equals(e){return e!=null&&this.start.equals(e.start)&&this.controlPoint1.equals(e.controlPoint1)&&this.controlPoint2.equals(e.controlPoint2)&&this.end.equals(e.end)}clone(){return new Wu(this.start,this.controlPoint1,this.controlPoint2,this.end)}toJSON(){return{start:this.start.toJSON(),controlPoint1:this.controlPoint1.toJSON(),controlPoint2:this.controlPoint2.toJSON(),end:this.end.toJSON()}}serialize(){return[this.start.serialize(),this.controlPoint1.serialize(),this.controlPoint2.serialize(),this.end.serialize()].join(" ")}};function lse(t){const e=t.length,r=[],n=[];let i=2;r[0]=t[0]/i;for(let s=1;s<e;s+=1)n[s]=1/i,i=(s<e-1?4:3.5)-n[s],r[s]=(t[s]-r[s-1])/i;for(let s=1;s<e;s+=1)r[e-s-1]-=n[e-s]*r[e-s];return r}function wrt(t){const e=t.map(l=>Qe.clone(l)),r=[],n=[],i=e.length-1;if(i===1)return r[0]=new Qe((2*e[0].x+e[1].x)/3,(2*e[0].y+e[1].y)/3),n[0]=new Qe(2*r[0].x-e[0].x,2*r[0].y-e[0].y),[r,n];const s=[];for(let l=1;l<i-1;l+=1)s[l]=4*e[l].x+2*e[l+1].x;s[0]=e[0].x+2*e[1].x,s[i-1]=(8*e[i-1].x+e[i].x)/2;const a=lse(s);for(let l=1;l<i-1;l+=1)s[l]=4*e[l].y+2*e[l+1].y;s[0]=e[0].y+2*e[1].y,s[i-1]=(8*e[i-1].y+e[i].y)/2;const o=lse(s);for(let l=0;l<i;l+=1)r.push(new Qe(a[l],o[l])),l<i-1?n.push(new Qe(2*e[l+1].x-a[l+1],2*e[l+1].y-o[l+1])):n.push(new Qe((e[i].x+a[i-1])/2,(e[i].y+o[i-1])/2));return[r,n]}class bN extends Yg{constructor(){super(...arguments),this.isVisible=!0,this.isSegment=!0,this.isSubpathStart=!1}get end(){return this.endPoint}get start(){if(this.previousSegment==null)throw new Error("Missing previous segment. (This segment cannot be the first segment of a path, or segment has not yet been added to a path.)");return this.previousSegment.end}closestPointT(e,r){if(this.closestPointNormalizedLength)return this.closestPointNormalizedLength(e);throw new Error("Neither `closestPointT` nor `closestPointNormalizedLength` method is implemented.")}lengthAtT(e,r){if(e<=0)return 0;const n=this.length();return e>=1?n:n*e}divideAtT(e){if(this.divideAt)return this.divideAt(e);throw new Error("Neither `divideAtT` nor `divideAt` method is implemented.")}pointAtT(e){if(this.pointAt)return this.pointAt(e);throw new Error("Neither `pointAtT` nor `pointAt` method is implemented.")}tangentAtT(e){if(this.tangentAt)return this.tangentAt(e);throw new Error("Neither `tangentAtT` nor `tangentAt` method is implemented.")}}class xa extends bN{static create(...e){const r=e.length,n=e[0];if(lr.isLine(n))return new xa(n);if(Qe.isPointLike(n))return r===1?new xa(n):e.map(s=>new xa(s));if(r===2)return new xa(+e[0],+e[1]);const i=[];for(let s=0;s<r;s+=2){const a=+e[s],o=+e[s+1];i.push(new xa(a,o))}return i}constructor(e,r){super(),lr.isLine(e)?this.endPoint=e.end.clone().round(2):this.endPoint=Qe.create(e,r).round(2)}get type(){return"L"}get line(){return new lr(this.start,this.end)}bbox(){return this.line.bbox()}closestPoint(e){return this.line.closestPoint(e)}closestPointLength(e){return this.line.closestPointLength(e)}closestPointNormalizedLength(e){return this.line.closestPointNormalizedLength(e)}closestPointTangent(e){return this.line.closestPointTangent(e)}length(){return this.line.length()}divideAt(e){const r=this.line.divideAt(e);return[new xa(r[0]),new xa(r[1])]}divideAtLength(e){const r=this.line.divideAtLength(e);return[new xa(r[0]),new xa(r[1])]}getSubdivisions(){return[]}pointAt(e){return this.line.pointAt(e)}pointAtLength(e){return this.line.pointAtLength(e)}tangentAt(e){return this.line.tangentAt(e)}tangentAtLength(e){return this.line.tangentAtLength(e)}isDifferentiable(){return this.previousSegment==null?!1:!this.start.equals(this.end)}clone(){return new xa(this.end)}scale(e,r,n){return this.end.scale(e,r,n),this}rotate(e,r){return this.end.rotate(e,r),this}translate(e,r){return typeof e=="number"?this.end.translate(e,r):this.end.translate(e),this}equals(e){return this.type===e.type&&this.start.equals(e.start)&&this.end.equals(e.end)}toJSON(){return{type:this.type,start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){const e=this.end;return`${this.type} ${e.x} ${e.y}`}}class PS extends bN{static create(){return new PS}get end(){if(!this.subpathStartSegment)throw new Error("Missing subpath start segment. (This segment needs a subpath start segment (e.g. MoveTo), or segment has not yet been added to a path.)");return this.subpathStartSegment.end}get type(){return"Z"}get line(){return new lr(this.start,this.end)}bbox(){return this.line.bbox()}closestPoint(e){return this.line.closestPoint(e)}closestPointLength(e){return this.line.closestPointLength(e)}closestPointNormalizedLength(e){return this.line.closestPointNormalizedLength(e)}closestPointTangent(e){return this.line.closestPointTangent(e)}length(){return this.line.length()}divideAt(e){const r=this.line.divideAt(e);return[r[1].isDifferentiable()?new xa(r[0]):this.clone(),new xa(r[1])]}divideAtLength(e){const r=this.line.divideAtLength(e);return[r[1].isDifferentiable()?new xa(r[0]):this.clone(),new xa(r[1])]}getSubdivisions(){return[]}pointAt(e){return this.line.pointAt(e)}pointAtLength(e){return this.line.pointAtLength(e)}tangentAt(e){return this.line.tangentAt(e)}tangentAtLength(e){return this.line.tangentAtLength(e)}isDifferentiable(){return!this.previousSegment||!this.subpathStartSegment?!1:!this.start.equals(this.end)}scale(){return this}rotate(){return this}translate(){return this}equals(e){return this.type===e.type&&this.start.equals(e.start)&&this.end.equals(e.end)}clone(){return new PS}toJSON(){return{type:this.type,start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){return this.type}}class nd extends bN{static create(...e){const r=e.length,n=e[0];if(lr.isLine(n))return new nd(n);if(Jf.isCurve(n))return new nd(n);if(Qe.isPointLike(n)){if(r===1)return new nd(n);const s=[];for(let a=0;a<r;a+=1)a===0?s.push(new nd(e[a])):s.push(new xa(e[a]));return s}if(r===2)return new nd(+e[0],+e[1]);const i=[];for(let s=0;s<r;s+=2){const a=+e[s],o=+e[s+1];s===0?i.push(new nd(a,o)):i.push(new xa(a,o))}return i}constructor(e,r){super(),this.isVisible=!1,this.isSubpathStart=!0,lr.isLine(e)||Jf.isCurve(e)?this.endPoint=e.end.clone().round(2):this.endPoint=Qe.create(e,r).round(2)}get start(){throw new Error("Illegal access. Moveto segments should not need a start property.")}get type(){return"M"}bbox(){return null}closestPoint(){return this.end.clone()}closestPointLength(){return 0}closestPointNormalizedLength(){return 0}closestPointT(){return 1}closestPointTangent(){return null}length(){return 0}lengthAtT(){return 0}divideAt(){return[this.clone(),this.clone()]}divideAtLength(){return[this.clone(),this.clone()]}getSubdivisions(){return[]}pointAt(){return this.end.clone()}pointAtLength(){return this.end.clone()}pointAtT(){return this.end.clone()}tangentAt(){return null}tangentAtLength(){return null}tangentAtT(){return null}isDifferentiable(){return!1}scale(e,r,n){return this.end.scale(e,r,n),this}rotate(e,r){return this.end.rotate(e,r),this}translate(e,r){return typeof e=="number"?this.end.translate(e,r):this.end.translate(e),this}clone(){return new nd(this.end)}equals(e){return this.type===e.type&&this.end.equals(e.end)}toJSON(){return{type:this.type,end:this.end.toJSON()}}serialize(){const e=this.end;return`${this.type} ${e.x} ${e.y}`}}class ol extends bN{static create(...e){const r=e.length,n=e[0];if(Jf.isCurve(n))return new ol(n);if(Qe.isPointLike(n)){if(r===3)return new ol(e[0],e[1],e[2]);const s=[];for(let a=0;a<r;a+=3)s.push(new ol(e[a],e[a+1],e[a+2]));return s}if(r===6)return new ol(e[0],e[1],e[2],e[3],e[4],e[5]);const i=[];for(let s=0;s<r;s+=6)i.push(new ol(e[s],e[s+1],e[s+2],e[s+3],e[s+4],e[s+5]));return i}constructor(e,r,n,i,s,a){super(),Jf.isCurve(e)?(this.controlPoint1=e.controlPoint1.clone().round(2),this.controlPoint2=e.controlPoint2.clone().round(2),this.endPoint=e.end.clone().round(2)):typeof e=="number"?(this.controlPoint1=new Qe(e,r).round(2),this.controlPoint2=new Qe(n,i).round(2),this.endPoint=new Qe(s,a).round(2)):(this.controlPoint1=Qe.create(e).round(2),this.controlPoint2=Qe.create(r).round(2),this.endPoint=Qe.create(n).round(2))}get type(){return"C"}get curve(){return new Jf(this.start,this.controlPoint1,this.controlPoint2,this.end)}bbox(){return this.curve.bbox()}closestPoint(e){return this.curve.closestPoint(e)}closestPointLength(e){return this.curve.closestPointLength(e)}closestPointNormalizedLength(e){return this.curve.closestPointNormalizedLength(e)}closestPointTangent(e){return this.curve.closestPointTangent(e)}length(){return this.curve.length()}divideAt(e,r={}){const n=this.curve.divideAt(e,r);return[new ol(n[0]),new ol(n[1])]}divideAtLength(e,r={}){const n=this.curve.divideAtLength(e,r);return[new ol(n[0]),new ol(n[1])]}divideAtT(e){const r=this.curve.divideAtT(e);return[new ol(r[0]),new ol(r[1])]}getSubdivisions(){return[]}pointAt(e){return this.curve.pointAt(e)}pointAtLength(e){return this.curve.pointAtLength(e)}tangentAt(e){return this.curve.tangentAt(e)}tangentAtLength(e){return this.curve.tangentAtLength(e)}isDifferentiable(){if(!this.previousSegment)return!1;const e=this.start,r=this.controlPoint1,n=this.controlPoint2,i=this.end;return!(e.equals(r)&&r.equals(n)&&n.equals(i))}scale(e,r,n){return this.controlPoint1.scale(e,r,n),this.controlPoint2.scale(e,r,n),this.end.scale(e,r,n),this}rotate(e,r){return this.controlPoint1.rotate(e,r),this.controlPoint2.rotate(e,r),this.end.rotate(e,r),this}translate(e,r){return typeof e=="number"?(this.controlPoint1.translate(e,r),this.controlPoint2.translate(e,r),this.end.translate(e,r)):(this.controlPoint1.translate(e),this.controlPoint2.translate(e),this.end.translate(e)),this}equals(e){return this.start.equals(e.start)&&this.end.equals(e.end)&&this.controlPoint1.equals(e.controlPoint1)&&this.controlPoint2.equals(e.controlPoint2)}clone(){return new ol(this.controlPoint1,this.controlPoint2,this.end)}toJSON(){return{type:this.type,start:this.start.toJSON(),controlPoint1:this.controlPoint1.toJSON(),controlPoint2:this.controlPoint2.toJSON(),end:this.end.toJSON()}}serialize(){const e=this.controlPoint1,r=this.controlPoint2,n=this.end;return[this.type,e.x,e.y,r.x,r.y,n.x,n.y].join(" ")}}function a7(t,e,r){return{x:t*Math.cos(r)-e*Math.sin(r),y:t*Math.sin(r)+e*Math.cos(r)}}function cse(t,e,r,n,i,s){const a=.3333333333333333,o=2/3;return[a*t+o*r,a*e+o*n,a*i+o*r,a*s+o*n,i,s]}function A2e(t,e,r,n,i,s,a,o,l,u){const h=Math.PI*120/180,d=Math.PI/180*(+i||0);let f=[],p,g,m,y,v;if(u)g=u[0],m=u[1],y=u[2],v=u[3];else{p=a7(t,e,-d),t=p.x,e=p.y,p=a7(o,l,-d),o=p.x,l=p.y;const L=(t-o)/2,I=(e-l)/2;let $=L*L/(r*r)+I*I/(n*n);$>1&&($=Math.sqrt($),r=$*r,n=$*n);const O=r*r,D=n*n,F=(s===a?-1:1)*Math.sqrt(Math.abs((O*D-O*I*I-D*L*L)/(O*I*I+D*L*L)));y=F*r*I/n+(t+o)/2,v=F*-n*L/r+(e+l)/2,g=Math.asin((e-v)/n),m=Math.asin((l-v)/n),g=t<y?Math.PI-g:g,m=o<y?Math.PI-m:m,g<0&&(g=Math.PI*2+g),m<0&&(m=Math.PI*2+m),a&&g>m&&(g-=Math.PI*2),!a&&m>g&&(m-=Math.PI*2)}let x=m-g;if(Math.abs(x)>h){const L=m,I=o,$=l;m=g+h*(a&&m>g?1:-1),o=y+r*Math.cos(m),l=v+n*Math.sin(m),f=A2e(o,l,r,n,i,0,a,I,$,[m,L,y,v])}x=m-g;const b=Math.cos(g),T=Math.sin(g),C=Math.cos(m),S=Math.sin(m),k=Math.tan(x/4),E=4/3*(r*k),A=4/3*(n*k),R=[t,e],_=[t+E*T,e-A*b],P=[o+E*S,l-A*C],N=[o,l];if(_[0]=2*R[0]-_[0],_[1]=2*R[1]-_[1],u)return[_,P,N].concat(f);{f=[_,P,N].concat(f).join().split(",");const L=[],I=f.length;for(let $=0;$<I;$+=1)L[$]=$%2?a7(+f[$-1],+f[$],d).y:a7(+f[$],+f[$+1],d).x;return L}}function Trt(t){if(!t)return null;const e=`\v\f\r \u2028\u2029`,r=new RegExp(`([a-z])[${e},]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?[${e}]*,?[${e}]*)+)`,"ig"),n=new RegExp(`(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)[${e}]*,?[${e}]*`,"ig"),i={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},s=[];return t.replace(r,(a,o,l)=>{const u=[];let h=o.toLowerCase();l.replace(n,(f,p)=>(p&&u.push(+p),f)),h==="m"&&u.length>2&&(s.push([o,...u.splice(0,2)]),h="l",o=o==="m"?"l":"L");const d=i[h];for(;u.length>=d&&(s.push([o,...u.splice(0,d)]),!!d););return a}),s}function Crt(t){const e=Trt(t);if(!e||!e.length)return[["M",0,0]];let r=0,n=0,i=0,s=0;const a=[];for(let o=0,l=e.length;o<l;o+=1){const u=[];a.push(u);const h=e[o],d=h[0];if(d!==d.toUpperCase())switch(u[0]=d.toUpperCase(),u[0]){case"A":u[1]=h[1],u[2]=h[2],u[3]=h[3],u[4]=h[4],u[5]=h[5],u[6]=+h[6]+r,u[7]=+h[7]+n;break;case"V":u[1]=+h[1]+n;break;case"H":u[1]=+h[1]+r;break;case"M":i=+h[1]+r,s=+h[2]+n;for(let f=1,p=h.length;f<p;f+=1)u[f]=+h[f]+(f%2?r:n);break;default:for(let f=1,p=h.length;f<p;f+=1)u[f]=+h[f]+(f%2?r:n);break}else for(let f=0,p=h.length;f<p;f+=1)u[f]=h[f];switch(u[0]){case"Z":r=+i,n=+s;break;case"H":r=u[1];break;case"V":n=u[1];break;case"M":i=u[u.length-2],s=u[u.length-1],r=u[u.length-2],n=u[u.length-1];break;default:r=u[u.length-2],n=u[u.length-1];break}}return a}function krt(t){const e=Crt(t),r={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null};function n(l,u,h){let d,f;if(!l)return["C",u.x,u.y,u.x,u.y,u.x,u.y];switch(l[0]in{T:1,Q:1}||(u.qx=null,u.qy=null),l[0]){case"M":u.X=l[1],u.Y=l[2];break;case"A":return parseFloat(l[1])===0||parseFloat(l[2])===0?["L",l[6],l[7]]:["C"].concat(A2e.apply(0,[u.x,u.y].concat(l.slice(1))));case"S":return h==="C"||h==="S"?(d=u.x*2-u.bx,f=u.y*2-u.by):(d=u.x,f=u.y),["C",d,f].concat(l.slice(1));case"T":return h==="Q"||h==="T"?(u.qx=u.x*2-u.qx,u.qy=u.y*2-u.qy):(u.qx=u.x,u.qy=u.y),["C"].concat(cse(u.x,u.y,u.qx,u.qy,l[1],l[2]));case"Q":return u.qx=l[1],u.qy=l[2],["C"].concat(cse(u.x,u.y,l[1],l[2],l[3],l[4]));case"H":return["L"].concat(l[1],u.y);case"V":return["L"].concat(u.x,l[1])}return l}function i(l,u){if(l[u].length>7){l[u].shift();const h=l[u];for(;h.length;)s[u]="A",u+=1,l.splice(u,0,["C"].concat(h.splice(0,6)));l.splice(u,1),o=e.length}}const s=[];let a="",o=e.length;for(let l=0;l<o;l+=1){let u="";e[l]&&(u=e[l][0]),u!=="C"&&(s[l]=u,l>0&&(a=s[l-1])),e[l]=n(e[l],r,a),s[l]!=="A"&&u==="C"&&(s[l]="C"),i(e,l);const h=e[l],d=h.length;r.x=h[d-2],r.y=h[d-1],r.bx=parseFloat(h[d-4])||r.x,r.by=parseFloat(h[d-3])||r.y}return(!e[0][0]||e[0][0]!=="M")&&e.unshift(["M",0,0]),e}function M2e(t){return krt(t).map(e=>e.map(r=>typeof r=="string"?r:L1(r,2))).join(",").split(",").join(" ")}let ci=class Ls extends Yg{static isPath(e){return e!=null&&e instanceof Ls}static parse(e){if(!e)return new Ls;const r=new Ls,n=/(?:[a-zA-Z] *)(?:(?:-?\d+(?:\.\d+)?(?:e[-+]?\d+)? *,? *)|(?:-?\.\d+ *,? *))+|(?:[a-zA-Z] *)(?! |\d|-|\.)/g,i=M2e(e).match(n);if(i!=null)for(let s=0,a=i.length;s<a;s+=1){const o=i[s],l=/(?:[a-zA-Z])|(?:(?:-?\d+(?:\.\d+)?(?:e[-+]?\d+)?))|(?:(?:-?\.\d+))/g,u=o.match(l);if(u!=null){const h=u[0],d=u.slice(1).map(p=>+p),f=Ls.createSegment.call(null,h,...d);r.appendSegment(f)}}return r}static createSegment(e,...r){if(e==="M")return nd.create.call(null,...r);if(e==="L")return xa.create.call(null,...r);if(e==="C")return ol.create.call(null,...r);if(e==="z"||e==="Z")return PS.create();throw new Error(`Invalid path segment type "${e}"`)}constructor(e){if(super(),this.PRECISION=3,this.segments=[],Array.isArray(e))if(lr.isLine(e[0])||Jf.isCurve(e[0])){let r=null;e.forEach((i,s)=>{s===0&&this.appendSegment(Ls.createSegment("M",i.start)),r!=null&&!r.end.equals(i.start)&&this.appendSegment(Ls.createSegment("M",i.start)),lr.isLine(i)?this.appendSegment(Ls.createSegment("L",i.end)):Jf.isCurve(i)&&this.appendSegment(Ls.createSegment("C",i.controlPoint1,i.controlPoint2,i.end)),r=i})}else e.forEach(n=>{n.isSegment&&this.appendSegment(n)});else e!=null&&(lr.isLine(e)?(this.appendSegment(Ls.createSegment("M",e.start)),this.appendSegment(Ls.createSegment("L",e.end))):Jf.isCurve(e)?(this.appendSegment(Ls.createSegment("M",e.start)),this.appendSegment(Ls.createSegment("C",e.controlPoint1,e.controlPoint2,e.end))):Ba.isPolyline(e)?e.points&&e.points.length&&e.points.forEach((r,n)=>{const i=n===0?Ls.createSegment("M",r):Ls.createSegment("L",r);this.appendSegment(i)}):e.isSegment&&this.appendSegment(e))}get start(){const e=this.segments,r=e.length;if(r===0)return null;for(let n=0;n<r;n+=1){const i=e[n];if(i.isVisible)return i.start}return e[r-1].end}get end(){const e=this.segments,r=e.length;if(r===0)return null;for(let n=r-1;n>=0;n-=1){const i=e[n];if(i.isVisible)return i.end}return e[r-1].end}moveTo(...e){return this.appendSegment(nd.create.call(null,...e))}lineTo(...e){return this.appendSegment(xa.create.call(null,...e))}curveTo(...e){return this.appendSegment(ol.create.call(null,...e))}arcTo(e,r,n,i,s,a,o){const l=this.end||new Qe,u=typeof a=="number"?ose(l.x,l.y,e,r,n,i,s,a,o):ose(l.x,l.y,e,r,n,i,s,a.x,a.y);if(u!=null)for(let h=0,d=u.length;h<d;h+=6)this.curveTo(u[h],u[h+1],u[h+2],u[h+3],u[h+4],u[h+5]);return this}quadTo(e,r,n,i){const s=this.end||new Qe,a=["M",s.x,s.y];if(typeof e=="number")a.push("Q",e,r,n,i);else{const l=r;a.push("Q",e.x,e.y,l.x,l.y)}const o=Ls.parse(a.join(" "));return this.appendSegment(o.segments.slice(1)),this}close(){return this.appendSegment(PS.create())}drawPoints(e,r={}){const n=xrt(e,r),i=Ls.parse(n);i&&i.segments&&this.appendSegment(i.segments)}bbox(){const e=this.segments,r=e.length;if(r===0)return null;let n;for(let s=0;s<r;s+=1){const a=e[s];if(a.isVisible){const o=a.bbox();o!=null&&(n=n?n.union(o):o)}}if(n!=null)return n;const i=e[r-1];return new Bt(i.end.x,i.end.y,0,0)}appendSegment(e){const r=this.segments.length;let n=r!==0?this.segments[r-1]:null,i;const s=null;if(Array.isArray(e))for(let a=0,o=e.length;a<o;a+=1){const l=e[a];i=this.prepareSegment(l,n,s),this.segments.push(i),n=i}else e!=null&&e.isSegment&&(i=this.prepareSegment(e,n,s),this.segments.push(i));return this}insertSegment(e,r){const n=this.segments.length;if(e<0&&(e=n+e+1),e>n||e<0)throw new Error("Index out of range.");let i,s=null,a=null;if(n!==0&&(e>=1?(s=this.segments[e-1],a=s.nextSegment):(s=null,a=this.segments[0])),!Array.isArray(r))i=this.prepareSegment(r,s,a),this.segments.splice(e,0,i);else for(let o=0,l=r.length;o<l;o+=1){const u=r[o];i=this.prepareSegment(u,s,a),this.segments.splice(e+o,0,i),s=i}return this}removeSegment(e){const r=this.fixIndex(e),n=this.segments.splice(r,1)[0],i=n.previousSegment,s=n.nextSegment;return i&&(i.nextSegment=s),s&&(s.previousSegment=i),n.isSubpathStart&&s&&this.updateSubpathStartSegment(s),n}replaceSegment(e,r){const n=this.fixIndex(e);let i;const s=this.segments[n];let a=s.previousSegment;const o=s.nextSegment;let l=s.isSubpathStart;if(!Array.isArray(r))i=this.prepareSegment(r,a,o),this.segments.splice(n,1,i),l&&i.isSubpathStart&&(l=!1);else{this.segments.splice(e,1);for(let u=0,h=r.length;u<h;u+=1){const d=r[u];i=this.prepareSegment(d,a,o),this.segments.splice(e+u,0,i),a=i,l&&i.isSubpathStart&&(l=!1)}}l&&o&&this.updateSubpathStartSegment(o)}getSegment(e){const r=this.fixIndex(e);return this.segments[r]}fixIndex(e){const r=this.segments.length;if(r===0)throw new Error("Path has no segments.");let n=e;for(;n<0;)n=r+n;if(n>=r||n<0)throw new Error("Index out of range.");return n}segmentAt(e,r={}){const n=this.segmentIndexAt(e,r);return n?this.getSegment(n):null}segmentAtLength(e,r={}){const n=this.segmentIndexAtLength(e,r);return n?this.getSegment(n):null}segmentIndexAt(e,r={}){if(this.segments.length===0)return null;const n=Lv(e,0,1),i=this.getOptions(r),a=this.length(i)*n;return this.segmentIndexAtLength(a,i)}segmentIndexAtLength(e,r={}){const n=this.segments.length;if(n===0)return null;let i=!0;e<0&&(i=!1,e=-e);const s=this.getPrecision(r),a=this.getSubdivisions(r);let o=0,l=null;for(let u=0;u<n;u+=1){const h=i?u:n-1-u,d=this.segments[h],f=a[h],p=d.length({precision:s,subdivisions:f});if(d.isVisible){if(e<=o+p)return h;l=h}o+=p}return l}getSegmentSubdivisions(e={}){const r=this.getPrecision(e),n=[];for(let i=0,s=this.segments.length;i<s;i+=1){const o=this.segments[i].getSubdivisions({precision:r});n.push(o)}return n}updateSubpathStartSegment(e){let r=e.previousSegment,n=e;for(;n&&!n.isSubpathStart;)r!=null?n.subpathStartSegment=r.subpathStartSegment:n.subpathStartSegment=null,r=n,n=n.nextSegment}prepareSegment(e,r,n){e.previousSegment=r,e.nextSegment=n,r!=null&&(r.nextSegment=e),n!=null&&(n.previousSegment=e);let i=e;return e.isSubpathStart&&(e.subpathStartSegment=e,i=n),i!=null&&this.updateSubpathStartSegment(i),e}closestPoint(e,r={}){const n=this.closestPointT(e,r);return n?this.pointAtT(n):null}closestPointLength(e,r={}){const n=this.getOptions(r),i=this.closestPointT(e,n);return i?this.lengthAtT(i,n):0}closestPointNormalizedLength(e,r={}){const n=this.getOptions(r),i=this.closestPointLength(e,n);if(i===0)return 0;const s=this.length(n);return s===0?0:i/s}closestPointT(e,r={}){if(this.segments.length===0)return null;const n=this.getPrecision(r),i=this.getSubdivisions(r);let s,a=1/0;for(let o=0,l=this.segments.length;o<l;o+=1){const u=this.segments[o],h=i[o];if(u.isVisible){const d=u.closestPointT(e,{precision:n,subdivisions:h}),f=u.pointAtT(d),p=ase(f,e);p<a&&(s={segmentIndex:o,value:d},a=p)}}return s||{segmentIndex:this.segments.length-1,value:1}}closestPointTangent(e,r={}){if(this.segments.length===0)return null;const n=this.getPrecision(r),i=this.getSubdivisions(r);let s,a=1/0;for(let o=0,l=this.segments.length;o<l;o+=1){const u=this.segments[o],h=i[o];if(u.isDifferentiable()){const d=u.closestPointT(e,{precision:n,subdivisions:h}),f=u.pointAtT(d),p=ase(f,e);p<a&&(s=u.tangentAtT(d),a=p)}}return s||null}containsPoint(e,r={}){const n=this.toPolylines(r);if(!n)return!1;let i=0;for(let s=0,a=n.length;s<a;s+=1)n[s].containsPoint(e)&&(i+=1);return i%2===1}pointAt(e,r={}){if(this.segments.length===0)return null;if(e<=0)return this.start.clone();if(e>=1)return this.end.clone();const n=this.getOptions(r),s=this.length(n)*e;return this.pointAtLength(s,n)}pointAtLength(e,r={}){if(this.segments.length===0)return null;if(e===0)return this.start.clone();let n=!0;e<0&&(n=!1,e=-e);const i=this.getPrecision(r),s=this.getSubdivisions(r);let a,o=0;for(let u=0,h=this.segments.length;u<h;u+=1){const d=n?u:h-1-u,f=this.segments[d],p=s[d],g=f.length({precision:i,subdivisions:p});if(f.isVisible){if(e<=o+g)return f.pointAtLength((n?1:-1)*(e-o),{precision:i,subdivisions:p});a=f}o+=g}return a?n?a.end:a.start:this.segments[this.segments.length-1].end.clone()}pointAtT(e){const r=this.segments,n=r.length;if(n===0)return null;const i=e.segmentIndex;if(i<0)return r[0].pointAtT(0);if(i>=n)return r[n-1].pointAtT(1);const s=Lv(e.value,0,1);return r[i].pointAtT(s)}divideAt(e,r={}){if(this.segments.length===0)return null;const n=Lv(e,0,1),i=this.getOptions(r),a=this.length(i)*n;return this.divideAtLength(a,i)}divideAtLength(e,r={}){if(this.segments.length===0)return null;let n=!0;e<0&&(n=!1,e=-e);const i=this.getPrecision(r),s=this.getSubdivisions(r);let a=0,o,l,u,h,d;for(let C=0,S=this.segments.length;C<S;C+=1){const k=n?C:S-1-C,E=this.getSegment(k),A=s[k],R={precision:i,subdivisions:A},_=E.length(R);if(E.isDifferentiable()&&(u=E,h=k,e<=a+_)){l=k,o=E.divideAtLength((n?1:-1)*(e-a),R);break}a+=_}if(!u)return null;o||(l=h,d=n?1:0,o=u.divideAtT(d));const f=this.clone(),p=l;f.replaceSegment(p,o);const g=p;let m=p+1,y=p+2;o[0].isDifferentiable()||(f.removeSegment(g),m-=1,y-=1);const v=f.getSegment(m).start;f.insertSegment(m,Ls.createSegment("M",v)),y+=1,o[1].isDifferentiable()||(f.removeSegment(y-1),y-=1);const x=y-g-1;for(let C=y,S=f.segments.length;C<S;C+=1){const k=this.getSegment(C-x),E=f.getSegment(C);if(E.type==="Z"&&!k.subpathStartSegment.end.equals(E.subpathStartSegment.end)){const A=Ls.createSegment("L",k.end);f.replaceSegment(C,A)}}const b=new Ls(f.segments.slice(0,m)),T=new Ls(f.segments.slice(m));return[b,T]}intersectsWithLine(e,r={}){const n=this.toPolylines(r);if(n==null)return null;let i=null;for(let s=0,a=n.length;s<a;s+=1){const o=n[s],l=e.intersect(o);l&&(i==null&&(i=[]),Array.isArray(l)?i.push(...l):i.push(l))}return i}isDifferentiable(){for(let e=0,r=this.segments.length;e<r;e+=1)if(this.segments[e].isDifferentiable())return!0;return!1}isValid(){const e=this.segments;return e.length===0||e[0].type==="M"}length(e={}){if(this.segments.length===0)return 0;const r=this.getSubdivisions(e);let n=0;for(let i=0,s=this.segments.length;i<s;i+=1){const a=this.segments[i],o=r[i];n+=a.length({subdivisions:o})}return n}lengthAtT(e,r={}){const n=this.segments.length;if(n===0)return 0;let i=e.segmentIndex;if(i<0)return 0;let s=Lv(e.value,0,1);i>=n&&(i=n-1,s=1);const a=this.getPrecision(r),o=this.getSubdivisions(r);let l=0;for(let d=0;d<i;d+=1){const f=this.segments[d],p=o[d];l+=f.length({precision:a,subdivisions:p})}const u=this.segments[i],h=o[i];return l+=u.lengthAtT(s,{precision:a,subdivisions:h}),l}tangentAt(e,r={}){if(this.segments.length===0)return null;const n=Lv(e,0,1),i=this.getOptions(r),a=this.length(i)*n;return this.tangentAtLength(a,i)}tangentAtLength(e,r={}){if(this.segments.length===0)return null;let n=!0;e<0&&(n=!1,e=-e);const i=this.getPrecision(r),s=this.getSubdivisions(r);let a,o=0;for(let l=0,u=this.segments.length;l<u;l+=1){const h=n?l:u-1-l,d=this.segments[h],f=s[h],p=d.length({precision:i,subdivisions:f});if(d.isDifferentiable()){if(e<=o+p)return d.tangentAtLength((n?1:-1)*(e-o),{precision:i,subdivisions:f});a=d}o+=p}if(a){const l=n?1:0;return a.tangentAtT(l)}return null}tangentAtT(e){const r=this.segments.length;if(r===0)return null;const n=e.segmentIndex;if(n<0)return this.segments[0].tangentAtT(0);if(n>=r)return this.segments[r-1].tangentAtT(1);const i=Lv(e.value,0,1);return this.segments[n].tangentAtT(i)}getPrecision(e={}){return e.precision==null?this.PRECISION:e.precision}getSubdivisions(e={}){if(e.segmentSubdivisions==null){const r=this.getPrecision(e);return this.getSegmentSubdivisions({precision:r})}return e.segmentSubdivisions}getOptions(e={}){const r=this.getPrecision(e),n=this.getSubdivisions(e);return{precision:r,segmentSubdivisions:n}}toPoints(e={}){const r=this.segments,n=r.length;if(n===0)return null;const i=this.getSubdivisions(e),s=[];let a=[];for(let o=0;o<n;o+=1){const l=r[o];if(l.isVisible){const u=i[o];u.length>0?u.forEach(h=>a.push(h.start)):a.push(l.start)}else a.length>0&&(a.push(r[o-1].end),s.push(a),a=[])}return a.length>0&&(a.push(this.end),s.push(a)),s}toPolylines(e={}){const r=this.toPoints(e);return r?r.map(n=>new Ba(n)):null}scale(e,r,n){return this.segments.forEach(i=>i.scale(e,r,n)),this}rotate(e,r){return this.segments.forEach(n=>n.rotate(e,r)),this}translate(e,r){return typeof e=="number"?this.segments.forEach(n=>n.translate(e,r)):this.segments.forEach(n=>n.translate(e)),this}clone(){const e=new Ls;return this.segments.forEach(r=>e.appendSegment(r.clone())),e}equals(e){if(e==null)return!1;const r=this.segments,n=e.segments,i=r.length;if(n.length!==i)return!1;for(let s=0;s<i;s+=1){const a=r[s],o=n[s];if(a.type!==o.type||!a.equals(o))return!1}return!0}toJSON(){return this.segments.map(e=>e.toJSON())}serialize(){if(!this.isValid())throw new Error("Invalid path segments.");return this.segments.map(e=>e.serialize()).join(" ")}toString(){return this.serialize()}};function e3(t,e,r){let n,i;typeof e=="object"?(n=e.x,i=e.y):(n=e,i=r);const s=ci.parse(t),a=s.bbox();if(a){let o=-a.height/2-a.y,l=-a.width/2-a.x;typeof n=="number"&&(l-=n),typeof i=="number"&&(o-=i),s.translate(l,o)}return s.serialize()}const CX=/[\t\r\n\f]/g,kX=/\S+/g,FT=t=>` ${t} `;function zT(t){return t&&t.getAttribute&&t.getAttribute("class")||""}function fd(t,e){if(t==null||e==null)return!1;const r=FT(zT(t)),n=FT(e);return t.nodeType===1?r.replace(CX," ").includes(n):!1}function rr(t,e){if(!(t==null||e==null)){if(typeof e=="function")return rr(t,e(zT(t)));if(typeof e=="string"&&t.nodeType===1){const r=e.match(kX)||[],n=FT(zT(t)).replace(CX," ");let i=r.reduce((s,a)=>s.indexOf(FT(a))<0?`${s}${a} `:s,n);i=i.trim(),n!==i&&t.setAttribute("class",i)}}}function Bi(t,e){if(t!=null){if(typeof e=="function")return Bi(t,e(zT(t)));if((!e||typeof e=="string")&&t.nodeType===1){const r=(e||"").match(kX)||[],n=FT(zT(t)).replace(CX," ");let i=r.reduce((s,a)=>{const o=FT(a);return s.indexOf(o)>-1?s.replace(o," "):s},n);i=e?i.trim():"",n!==i&&t.setAttribute("class",i)}}}function Ju(t,e,r){if(!(t==null||e==null)){if(r!=null&&typeof e=="string"){r?rr(t,e):Bi(t,e);return}if(typeof e=="function")return Ju(t,e(zT(t),r),r);typeof e=="string"&&(e.match(kX)||[]).forEach(i=>{fd(t,i)?Bi(t,i):rr(t,i)})}}let use=0;function Srt(){return use+=1,`v${use}`}function SX(t){return(t.id==null||t.id==="")&&(t.id=Srt()),t.id}function dg(t){return t==null?!1:typeof t.getScreenCTM=="function"&&t instanceof SVGElement}const Fa={svg:"http://www.w3.org/2000/svg",xmlns:"http://www.w3.org/2000/xmlns/",xml:"http://www.w3.org/XML/1998/namespace",xlink:"http://www.w3.org/1999/xlink",xhtml:"http://www.w3.org/1999/xhtml"},hse="1.1";function R2e(t,e=document){return e.createElement(t)}function EX(t,e=Fa.xhtml,r=document){return r.createElementNS(e,t)}function Dh(t,e=document){return EX(t,Fa.svg,e)}function xM(t){if(t){const r=`<svg xmlns="${Fa.svg}" xmlns:xlink="${Fa.xlink}" version="${hse}">${t}</svg>`,{documentElement:n}=Ert(r,{async:!1});return n}const e=document.createElementNS(Fa.svg,"svg");return e.setAttributeNS(Fa.xmlns,"xmlns:xlink",Fa.xlink),e.setAttribute("version",hse),e}function Ert(t,e={}){let r;try{const n=new DOMParser;if(e.async!=null){const i=n;i.async=e.async}r=n.parseFromString(t,e.mimeType||"text/xml")}catch{r=void 0}if(!r||r.getElementsByTagName("parsererror").length)throw new Error(`Invalid XML: ${t}`);return r}function Art(t,e=!0){const r=t.nodeName;return e?r.toLowerCase():r.toUpperCase()}function AX(t){let e=0,r=t.previousSibling;for(;r;)r.nodeType===1&&(e+=1),r=r.previousSibling;return e}function Mrt(t,e){return t.querySelectorAll(e)}function Rrt(t,e){return t.querySelector(e)}function _2e(t,e,r){const n=t.ownerSVGElement;let i=t.parentNode;for(;i&&i!==r&&i!==n;){if(fd(i,e))return i;i=i.parentNode}return null}function MX(t,e){const r=e&&e.parentNode;return t===r||!!(r&&r.nodeType===1&&t.compareDocumentPosition(r)&16)}function Cu(t){t&&(Array.isArray(t)?t:[t]).forEach(r=>{r.parentNode&&r.parentNode.removeChild(r)})}function O6(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function To(t,e){(Array.isArray(e)?e:[e]).forEach(n=>{n!=null&&t.appendChild(n)})}function L2e(t,e){const r=t.firstChild;return r?$S(r,e):To(t,e)}function $S(t,e){const r=t.parentNode;r&&(Array.isArray(e)?e:[e]).forEach(i=>{i!=null&&r.insertBefore(i,t)})}function _rt(t,e){const r=t.parentNode;r&&(Array.isArray(e)?e:[e]).forEach(i=>{i!=null&&r.insertBefore(i,t.nextSibling)})}function ku(t,e){e!=null&&e.appendChild(t)}function Lrt(t){return!!t&&t.nodeType===1}function I2e(t){try{return t instanceof HTMLElement}catch{return typeof t=="object"&&t.nodeType===1&&typeof t.style=="object"&&typeof t.ownerDocument=="object"}}function Irt(t,e){const r=[];let n=t.firstChild;for(;n;n=n.nextSibling)n.nodeType===1&&(!e||fd(n,e))&&r.push(n);return r}const N2e=t=>{const e=Object.create(null);return(r=>e[r]||(e[r]=t(r)))},D2e=N2e(t=>t.replace(/\B([A-Z])/g,"-$1").toLowerCase()),RX=N2e(t=>jtt(I6(t)).replace(/ /g,"")),O2e=["viewBox","attributeName","attributeType","repeatCount","textLength","lengthAdjust","gradientUnits","preserveAspectRatio"];function Nrt(t,e){return t.getAttribute(e)}function _X(t,e){const r=$2e(e);r.ns?t.hasAttributeNS(r.ns,r.local)&&t.removeAttributeNS(r.ns,r.local):t.hasAttribute(e)&&t.removeAttribute(e)}function LX(t,e,r){if(r==null)return _X(t,e);const n=$2e(e);n.ns&&typeof r=="string"?t.setAttributeNS(n.ns,e,r):e==="id"?t.id=`${r}`:t.setAttribute(e,`${r}`)}function P2e(t,e){Object.keys(e).forEach(r=>{LX(t,r,e[r])})}function _n(t,e,r){if(e==null){const n=t.attributes,i={};for(let s=0;s<n.length;s+=1)i[n[s].name]=n[s].value;return i}if(typeof e=="string"&&r===void 0)return t.getAttribute(e);typeof e=="object"?P2e(t,e):LX(t,e,r)}function $2e(t){if(t.indexOf(":")!==-1){const e=t.split(":");return{ns:Fa[e[0]],local:e[1]}}return{ns:null,local:t}}function BS(t){const e={};return Object.keys(t).forEach(r=>{const n=O2e.includes(r)?r:D2e(r);e[n]=t[r]}),e}function o7(t){const e={};return t.split(";").forEach(n=>{const i=n.trim();if(i){const s=i.split("=");s.length&&(e[s[0].trim()]=s[1]?s[1].trim():"")}}),e}function XV(t,e){return Object.keys(e).forEach(r=>{if(r==="class")t[r]=t[r]?`${t[r]} ${e[r]}`:e[r];else if(r==="style"){const n=typeof t[r]=="object",i=typeof e[r]=="object";let s,a;n&&i?(s=t[r],a=e[r]):n?(s=t[r],a=o7(e[r])):i?(s=o7(t[r]),a=e[r]):(s=o7(t[r]),a=o7(e[r])),t[r]=XV(s,a)}else t[r]=e[r]}),t}const Drt=/-(.)/g;function Ort(t){return t.replace(Drt,(e,r)=>r.toUpperCase())}const r$={},dse=["webkit","ms","moz","o"],B2e=typeof document<"u"?document.createElement("div").style:{};function Prt(t){for(let e=0;e<dse.length;e+=1){const r=dse[e]+t;if(r in B2e)return r}return null}function $rt(t){const e=Ort(t);if(r$[e]==null){const r=e.charAt(0).toUpperCase()+e.slice(1);r$[e]=e in B2e?e:Prt(r)}return r$[e]}function fse(t,e){const r=t.ownerDocument&&t.ownerDocument.defaultView&&t.ownerDocument.defaultView.opener?t.ownerDocument.defaultView.getComputedStyle(t,null):window.getComputedStyle(t,null);return r&&e?r.getPropertyValue(e)||r[e]:r}const Brt={animationIterationCount:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0};function Frt(t){return/^--/.test(t)}function h9(t,e,r){const n=window.getComputedStyle(t,null);return r?n.getPropertyValue(e)||void 0:n[e]||t.style[e]}function l7(t,e){return parseInt(h9(t,e),10)||0}function zrt(t,e){return!Brt[t]&&typeof e=="number"?`${e}px`:e}function ri(t,e,r){if(typeof e=="string"){const n=Frt(e);if(n||(e=$rt(e)),r===void 0)return h9(t,e,n);n||(r=zrt(e,r));const i=t.style;n?i.setProperty(e,r):i[e]=r;return}for(const n in e)ri(t,n,e[n])}function n$(t){let e=2166136261,r=!1,n=t;for(let i=0,s=n.length;i<s;i+=1){let a=n.charCodeAt(i);a>127&&!r&&(n=unescape(encodeURIComponent(n)),a=n.charCodeAt(i),r=!0),e^=a,e+=(e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24)}return e>>>0}function IX(){let t="";const e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx";for(let r=0,n=e.length;r<n;r+=1){const i=e[r],s=Math.random()*16|0,a=i==="x"?s:i==="y"?s&3|8:i;t+=a.toString(16)}return t}function Vrt(t,e,r){const n=Math.min(2,Math.floor(t.length*.34));let i=Math.floor(t.length*.4)+1,s,a=!1;const o=t.toLowerCase();for(const l of e){const u=r(l);if(u!==void 0&&Math.abs(u.length-o.length)<=n){const h=u.toLowerCase();if(h===o){if(u===t)continue;return l}if(a||u.length<3)continue;const d=Hrt(o,h,i-1);if(d===void 0)continue;d<3?(a=!0,s=l):(i=d,s=l)}}return s}function Hrt(t,e,r){let n=new Array(e.length+1),i=new Array(e.length+1);const s=r+1;for(let o=0;o<=e.length;o+=1)n[o]=o;for(let o=1;o<=t.length;o+=1){const l=t.charCodeAt(o-1),u=o>r?o-r:1,h=e.length>r+o?r+o:e.length;i[0]=o;let d=o;for(let p=1;p<u;p+=1)i[p]=s;for(let p=u;p<=h;p+=1){const g=l===e.charCodeAt(p-1)?n[p-1]:Math.min(n[p]+1,i[p-1]+1,n[p-1]+2);i[p]=g,d=Math.min(d,g)}for(let p=h+1;p<=e.length;p+=1)i[p]=s;if(d>r)return;const f=n;n=i,i=f}const a=n[e.length];return a>r?void 0:a}const d9=new WeakMap;function Grt(t,e){const r=I6(e),n=d9.get(t);if(n)return n[r]}function Wrt(t,e,r){const n=I6(e),i=d9.get(t);i?i[n]=r:d9.set(t,{[n]:r})}function hy(t,e,r){if(!e)return d9.get(t);if(typeof e=="string"){if(r===void 0)return Grt(t,e);Wrt(t,e,r);return}for(const n in e)hy(t,n,e[n])}const qrt={class:"className",contenteditable:"contentEditable",for:"htmlFor",readonly:"readOnly",maxlength:"maxLength",tabindex:"tabIndex",colspan:"colSpan",rowspan:"rowSpan",usemap:"useMap"};function KV(t,e,r){if(e){if(typeof e=="string"){if(e=qrt[e]||e,arguments.length<3)return t[e];t[e]=r;return}for(const n in e)KV(t,n,e[n])}}function Urt(t,...e){e.forEach(r=>{Object.getOwnPropertyNames(r.prototype).forEach(n=>{n!=="constructor"&&Object.defineProperty(t.prototype,n,Object.getOwnPropertyDescriptor(r.prototype,n))})})}const jrt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])};function Yrt(t,e){jrt(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}let Xrt=class{};const Krt=/^\s*class\s+/.test(`${Xrt}`)||/^\s*class\s*\{/.test(`${class{}}`);function NX(t,e){let r;return Krt?r=class extends e{}:(r=function(){return e.apply(this,arguments)},Yrt(r,e)),Object.defineProperty(r,"name",{value:t}),r}function pse(t){return t==="__proto__"}function DX(t,e,r="/"){let n;const i=Array.isArray(e)?e:e.split(r);if(i.length)for(n=t;i.length;){const s=i.shift();if(Object(n)===n&&s&&s in n)n=n[s];else return}return n}function t3(t,e,r,n="/"){const i=Array.isArray(e)?e:e.split(n),s=i.pop();if(s&&!pse(s)){let a=t;i.forEach(o=>{pse(o)||(a[o]==null&&(a[o]={}),a=a[o])}),a[s]=r}return t}function gse(t,e,r="/"){const n=Array.isArray(e)?e.slice():e.split(r),i=n.pop();if(i)if(n.length>0){const s=DX(t,n);s&&delete s[i]}else delete t[i];return t}function Zrt(t,e,r={}){const n=r.offset||0,i=[],s=[];let a,o,l=null;for(let u=0;u<t.length;u+=1){a=s[u]=t[u];for(let h=0,d=e.length;h<d;h+=1){const f=e[h],p=f.start+n,g=f.end+n;u>=p&&u<g&&(typeof a=="string"?a=s[u]={t:t[u],attrs:f.attrs}:a.attrs=XV(XV({},a.attrs),f.attrs),r.includeAnnotationIndices&&(a.annotations==null&&(a.annotations=[]),a.annotations.push(h)))}o=s[u-1],o?$s(a)&&$s(o)?(l=l,JSON.stringify(a.attrs)===JSON.stringify(o.attrs)?l.t+=a.t:(i.push(l),l=a)):$s(a)||$s(o)?(l=l,i.push(l),l=a):l=String(l||"")+String(a):l=a}return l!=null&&i.push(l),i}function Qrt(t){return t.replace(/ /g," ")}class Mr{get[Symbol.toStringTag](){return mse}get type(){return this.node.nodeName}get id(){return this.node.id}set id(e){this.node.id=e}static isVector(e){if(e==null)return!1;if(e instanceof Mr)return!0;const r=e[Symbol.toStringTag],n=e;return(r==null||r===mse)&&n.node instanceof SVGElement&&typeof n.sample=="function"&&typeof n.toPath=="function"}static create(e,r,n){return new Mr(e,r,n)}static createVectors(e){if(e[0]==="<"){const r=xM(e),n=[];for(let i=0,s=r.childNodes.length;i<s;i+=1){const a=r.childNodes[i];n.push(Mr.create(document.importNode(a,!0)))}return n}return[Mr.create(e)]}static toNode(e){return Mr.isVector(e)?e.node:e}static toNodes(e){return Array.isArray(e)?e.map(r=>Mr.toNode(r)):[Mr.toNode(e)]}constructor(e,r,n){if(!e)throw new TypeError("Invalid element to create vector");let i;if(Mr.isVector(e))i=e.node;else if(typeof e=="string")if(e.toLowerCase()==="svg")i=xM();else if(e[0]==="<"){const s=xM(e);i=document.importNode(s.firstChild,!0)}else i=document.createElementNS(Fa.svg,e);else i=e;this.node=i,r&&this.setAttributes(r),n&&this.append(n)}transform(e,r){return e==null?VT(this.node):(VT(this.node,e,r),this)}translate(e,r=0,n={}){return e==null?vse(this.node):(vse(this.node,e,r,n),this)}rotate(e,r,n,i={}){return e==null?JV(this.node):(JV(this.node,e,r,n,i),this)}scale(e,r){return e==null?bse(this.node):(bse(this.node,e,r),this)}getTransformToElement(e){const r=Mr.toNode(e);return OX(this.node,r)}removeAttribute(e){return _X(this.node,e),this}getAttribute(e){return Nrt(this.node,e)}setAttribute(e,r){return LX(this.node,e,r),this}setAttributes(e){return P2e(this.node,e),this}attr(e,r){return e==null?_n(this.node):typeof e=="string"&&r===void 0?_n(this.node,e):(typeof e=="object"?_n(this.node,e):_n(this.node,e,r),this)}svg(){return this.node instanceof SVGSVGElement?this:Mr.create(this.node.ownerSVGElement)}defs(){const e=this.svg()||this,r=e.node.getElementsByTagName("defs")[0];return r?Mr.create(r):Mr.create("defs").appendTo(e)}text(e,r={}){return z2e(this.node,e,r),this}tagName(){return Art(this.node)}clone(){return Mr.create(this.node.cloneNode(!0))}remove(){return Cu(this.node),this}empty(){return O6(this.node),this}append(e){return To(this.node,Mr.toNodes(e)),this}appendTo(e){return ku(this.node,Mr.isVector(e)?e.node:e),this}prepend(e){return L2e(this.node,Mr.toNodes(e)),this}before(e){return $S(this.node,Mr.toNodes(e)),this}replace(e){return this.node.parentNode&&this.node.parentNode.replaceChild(Mr.toNode(e),this.node),Mr.create(e)}first(){return this.node.firstChild?Mr.create(this.node.firstChild):null}last(){return this.node.lastChild?Mr.create(this.node.lastChild):null}get(e){const r=this.node.childNodes[e];return r?Mr.create(r):null}indexOf(e){return Array.prototype.slice.call(this.node.childNodes).indexOf(Mr.toNode(e))}find(e){const r=[],n=Mrt(this.node,e);if(n)for(let i=0,s=n.length;i<s;i+=1)r.push(Mr.create(n[i]));return r}findOne(e){const r=Rrt(this.node,e);return r?Mr.create(r):null}findParentByClass(e,r){const n=_2e(this.node,e,r);return n?Mr.create(n):null}matches(e){const r=this.node;this.node.matches;const n=r.matches||r.matchesSelector||r.msMatchesSelector||r.mozMatchesSelector||r.webkitMatchesSelector||r.oMatchesSelector||null;return n&&n.call(r,e)}contains(e){return MX(this.node,Mr.isVector(e)?e.node:e)}wrap(e){const r=Mr.create(e),n=this.node.parentNode;return n!=null&&n.insertBefore(r.node,this.node),r.append(this)}parent(e){let r=this;if(r.node.parentNode==null)return null;if(r=Mr.create(r.node.parentNode),e==null)return r;do if(typeof e=="string"?r.matches(e):r instanceof e)return r;while(r=Mr.create(r.node.parentNode));return r}children(){const e=this.node.childNodes,r=[];for(let n=0;n<e.length;n+=1)e[n].nodeType===1&&r.push(Mr.create(e[n]));return r}eachChild(e,r){const n=this.children();for(let i=0,s=n.length;i<s;i+=1)e.call(n[i],n[i],i,n),r&&n[i].eachChild(e,r);return this}index(){return AX(this.node)}hasClass(e){return fd(this.node,e)}addClass(e){return rr(this.node,e),this}removeClass(e){return Bi(this.node,e),this}toggleClass(e,r){return Ju(this.node,e,r),this}toLocalPoint(e,r){return bnt(this.node,e,r)}sample(e=1){return this.node instanceof SVGPathElement?rnt(this.node,e):[]}toPath(){return Mr.create(cnt(this.node))}toPathData(){return W2e(this.node)}}const mse=`X6.${Mr.name}`;function Jrt(t,e){const r=Mr.create(e),n=Mr.create("textPath"),i=t.d;if(i&&t["xlink:href"]===void 0){const s=Mr.create("path").attr("d",i).appendTo(r.defs());n.attr("xlink:href",`#${s.id}`)}return typeof t=="object"&&n.attr(t),n.node}function ent(t,e,r){const n=r.eol,i=r.baseSize,s=r.lineHeight;let a=0,o;const l={},u=e.length-1;for(let h=0;h<=u;h+=1){let d=e[h],f=null;if(typeof d=="object"){const p=d.attrs,g=Mr.create("tspan",p);o=g.node;let m=d.t;n&&h===u&&(m+=n),o.textContent=m;const y=p.class;y&&g.addClass(y),r.includeAnnotationIndices&&g.attr("annotations",d.annotations.join(",")),f=parseFloat(p["font-size"]),f===void 0&&(f=i),f&&f>a&&(a=f)}else n&&h===u&&(d+=n),o=document.createTextNode(d||" "),i&&i>a&&(a=i);t.appendChild(o)}return a&&(l.maxFontSize=a),s?l.lineHeight=s:a&&(l.lineHeight=a*1.2),l}const F2e=/em$/;function c7(t,e){const r=parseFloat(t);return F2e.test(t)?r*e:r}function tnt(t,e,r,n){if(!Array.isArray(e))return 0;const i=e.length;if(!i)return 0;let s=e[0];const a=c7(s.maxFontSize,r)||r;let o=0;const l=c7(n,r);for(let d=1;d<i;d+=1){s=e[d];const f=c7(s.lineHeight,r)||l;o+=f}const u=c7(s.maxFontSize,r)||r;let h;switch(t){case"middle":h=a/2-.15*u-o/2;break;case"bottom":h=-(.25*u)-o;break;case"top":default:h=.8*a;break}return h}function z2e(t,e,r={}){e=Qrt(e);const n=r.eol;let i=r.textPath;const s=r.textVerticalAnchor,a=s==="middle"||s==="bottom"||s==="top";let o=r.x;o===void 0&&(o=t.getAttribute("x")||0);const l=r.includeAnnotationIndices;let u=r.annotations;u&&!Array.isArray(u)&&(u=[u]);const h=r.lineHeight,d=h==="auto",f=d?"1.5em":h||"1em";let p=!0;const g=t.childNodes;if(g.length===1){const A=g[0];A&&A.tagName.toUpperCase()==="TITLE"&&(p=!1)}p&&O6(t),_n(t,{"xml:space":"preserve",display:e||r.displayEmpty?null:"none"});const m=_n(t,"font-size");let y=parseFloat(m);y||(y=16,(a||u)&&!m&&_n(t,"font-size",`${y}`));let v;i?(typeof i=="string"&&(i={d:i}),v=Jrt(i,t)):v=document.createDocumentFragment();let x,b=0,T;const C=e.split(``),S=[],k=C.length-1;for(let A=0;A<=k;A+=1){x=f;let R="v-line";const _=Dh("tspan");let P,N=C[A];if(N)if(u){const L=Zrt(N,u,{offset:-b,includeAnnotationIndices:l});P=ent(_,L,{eol:A!==k&&n,baseSize:y,lineHeight:d?null:f,includeAnnotationIndices:l});const I=P.lineHeight;I&&d&&A!==0&&(x=I),A===0&&(T=P.maxFontSize*.8)}else n&&A!==k&&(N+=n),_.textContent=N;else{_.textContent="-",R+=" v-empty-line";const L=_.style;L.fillOpacity=0,L.strokeOpacity=0,u&&(P={})}P&&S.push(P),A>0&&_.setAttribute("dy",x),(A>0||i)&&_.setAttribute("x",o),_.className.baseVal=R,v.appendChild(_),b+=N.length+1}if(a)if(u)x=tnt(s,S,y,f);else if(s==="top")x="0.8em";else{let A;switch(k>0?(A=parseFloat(f)||1,A*=k,F2e.test(f)||(A/=y)):A=0,s){case"middle":x=`${.3-A/2}em`;break;case"bottom":x=`${-A-.3}em`;break}}else s===0?x="0em":s?x=s:(x=0,t.getAttribute("y")==null&&t.setAttribute("y",`${T||"0.8em"}`));v.firstChild.setAttribute("dy",x),t.appendChild(v)}function $k(t,e={}){const r=document.createElement("canvas").getContext("2d");if(!t)return{width:0};const n=[],i=e["font-size"]?`${parseFloat(e["font-size"])}px`:"14px";return n.push(e["font-style"]||"normal"),n.push(e["font-variant"]||"normal"),n.push(e["font-weight"]||400),n.push(i),n.push(e["font-family"]||"sans-serif"),r.font=n.join(" "),r.measureText(t)}function yse(t,e,r,n={}){if(e>=r)return[t,""];const i=t.length,s={};let a=Math.round(e/r*i-1);for(a<0&&(a=0);a>=0&&a<i;){const o=t.slice(0,a),l=s[o]||$k(o,n).width,u=t.slice(0,a+1),h=s[u]||$k(u,n).width;if(s[o]=l,s[u]=h,l>e)a-=1;else if(h<=e)a+=1;else break}return[t.slice(0,a),t.slice(a)]}function V2e(t,e,r={},n={}){const i=e.width,s=e.height,a=n.eol||``,o=r.fontSize||14,l=r.lineHeight?parseFloat(r.lineHeight):Math.ceil(o*1.4),u=Math.floor(s/l);if(t.indexOf(a)>-1){const y=IX(),v=[];return t.split(a).forEach(x=>{const b=V2e(x,Object.assign(Object.assign({},e),{height:Number.MAX_SAFE_INTEGER}),r,Object.assign(Object.assign({},n),{eol:y}));b&&v.push(...b.split(y))}),v.slice(0,u).join(a)}const{width:h}=$k(t,r);if(h<i)return t;const d=[];let f=t,p=h,g=n.ellipsis,m=0;g&&(typeof g!="string"&&(g="…"),m=$k(g,r).width);for(let y=0;y<u;y+=1)if(p>i)if(y===u-1){const[x]=yse(f,i-m,p,r);d.push(g?`${x}${g}`:x)}else{const[x,b]=yse(f,i,p,r);d.push(x),f=b,p=$k(f,r).width}else{d.push(f);break}return d.join(a)}const ZV=.551784;function bo(t,e,r=NaN){const n=t.getAttribute(e);if(n==null)return r;const i=parseFloat(n);return Number.isNaN(i)?r:i}function rnt(t,e=1){const r=t.getTotalLength(),n=[];let i=0,s;for(;i<r;)s=t.getPointAtLength(i),n.push({distance:i,x:s.x,y:s.y}),i+=e;return n}function nnt(t){return["M",bo(t,"x1"),bo(t,"y1"),"L",bo(t,"x2"),bo(t,"y2")].join(" ")}function int(t){const e=f9(t);return e.length===0?null:`${H2e(e)} Z`}function snt(t){const e=f9(t);return e.length===0?null:H2e(e)}function H2e(t){return`M ${t.map(r=>`${r.x} ${r.y}`).join(" L")}`}function f9(t){const e=[],r=t.points;if(r)for(let n=0,i=r.numberOfItems;n<i;n+=1)e.push(r.getItem(n));return e}function ant(t){const e=bo(t,"cx",0),r=bo(t,"cy",0),n=bo(t,"r"),i=n*ZV;return["M",e,r-n,"C",e+i,r-n,e+n,r-i,e+n,r,"C",e+n,r+i,e+i,r+n,e,r+n,"C",e-i,r+n,e-n,r+i,e-n,r,"C",e-n,r-i,e-i,r-n,e,r-n,"Z"].join(" ")}function ont(t){const e=bo(t,"cx",0),r=bo(t,"cy",0),n=bo(t,"rx"),i=bo(t,"ry")||n,s=n*ZV,a=i*ZV;return["M",e,r-i,"C",e+s,r-i,e+n,r-a,e+n,r,"C",e+n,r+a,e+s,r+i,e,r+i,"C",e-s,r+i,e-n,r+a,e-n,r,"C",e-n,r-a,e-s,r-i,e,r-i,"Z"].join(" ")}function lnt(t){return G2e({x:bo(t,"x",0),y:bo(t,"y",0),width:bo(t,"width",0),height:bo(t,"height",0),rx:bo(t,"rx",0),ry:bo(t,"ry",0)})}function G2e(t){let e;const r=t.x,n=t.y,i=t.width,s=t.height,a=Math.min(t.rx||t["top-rx"]||0,i/2),o=Math.min(t.rx||t["bottom-rx"]||0,i/2),l=Math.min(t.ry||t["top-ry"]||0,s/2),u=Math.min(t.ry||t["bottom-ry"]||0,s/2);return a||o||l||u?e=["M",r,n+l,"v",s-l-u,"a",o,u,0,0,0,o,u,"h",i-2*o,"a",o,u,0,0,0,o,-u,"v",-(s-u-l),"a",a,l,0,0,0,-a,-l,"h",-(i-2*a),"a",a,l,0,0,0,-a,l,"Z"]:e=["M",r,n,"H",r+i,"V",n+s,"H",r,"V",n,"Z"],e.join(" ")}function cnt(t){const e=Dh("path");_n(e,_n(t));const r=W2e(t);return r&&e.setAttribute("d",r),e}function W2e(t){const e=t.tagName.toLowerCase();switch(e){case"path":return t.getAttribute("d");case"line":return nnt(t);case"polygon":return int(t);case"polyline":return snt(t);case"ellipse":return ont(t);case"circle":return ant(t);case"rect":return lnt(t)}throw new Error(`"${e}" cannot be converted to svg path element.`)}const unt=/(\w+)\(([^,)]+),?([^)]+)?\)/gi,q2e=/[ ,]+/,hnt=/^(\w+)\((.*)\)/;function dnt(t,e){const n=Dh("svg").createSVGPoint();return n.x=t,n.y=e,n}function Qa(t){const r=Dh("svg").createSVGMatrix();if(t!=null){const n=t,i=["a","b","c","d","e","f"];for(const s of i)n[s]!==void 0&&(r[s]=n[s])}return r}function fnt(t){const e=Dh("svg");return t!=null?(t instanceof DOMMatrix||(t=Qa(t)),e.createSVGTransformFromMatrix(t)):e.createSVGTransform()}function FS(t){let e=Qa();const r=t!=null&&t.match(unt);if(!r)return e;for(let n=0,i=r.length;n<i;n+=1){const a=r[n].match(hnt);if(a){let o,l,u,h,d,f=Qa();const p=a[2].split(q2e);switch(a[1].toLowerCase()){case"scale":o=parseFloat(p[0]),l=p[1]===void 0?o:parseFloat(p[1]),f=f.scaleNonUniform(o,l);break;case"translate":u=parseFloat(p[0]),h=parseFloat(p[1]),f=f.translate(u,h);break;case"rotate":d=parseFloat(p[0]),u=parseFloat(p[1])||0,h=parseFloat(p[2])||0,u!==0||h!==0?f=f.translate(u,h).rotate(d).translate(-u,-h):f=f.rotate(d);break;case"skewx":d=parseFloat(p[0]),f=f.skewX(d);break;case"skewy":d=parseFloat(p[0]),f=f.skewY(d);break;case"matrix":f.a=parseFloat(p[0]),f.b=parseFloat(p[1]),f.c=parseFloat(p[2]),f.d=parseFloat(p[3]),f.e=parseFloat(p[4]),f.f=parseFloat(p[5]);break;default:continue}e=e.multiply(f)}}return e}function P6(t){const e=t||{},r=e.a!=null?e.a:1,n=e.b!=null?e.b:0,i=e.c!=null?e.c:0,s=e.d!=null?e.d:1,a=e.e!=null?e.e:0,o=e.f!=null?e.f:0;return`matrix(${r},${n},${i},${s},${a},${o})`}function xN(t){let e,r,n;if(t){const s=q2e;if(t.trim().indexOf("matrix")>=0){const a=FS(t),o=pnt(a);e=[o.translateX,o.translateY],r=[o.rotation],n=[o.scaleX,o.scaleY];const l=[];(e[0]!==0||e[1]!==0)&&l.push(`translate(${e.join(",")})`),(n[0]!==1||n[1]!==1)&&l.push(`scale(${n.join(",")})`),r[0]!==0&&l.push(`rotate(${r[0]})`),t=l.join(" ")}else{const a=t.match(/translate\((.*?)\)/);a&&(e=a[1].split(s));const o=t.match(/rotate\((.*?)\)/);o&&(r=o[1].split(s));const l=t.match(/scale\((.*?)\)/);l&&(n=l[1].split(s))}}const i=n&&n[0]?parseFloat(n[0]):1;return{raw:t||"",translation:{tx:e&&e[0]?parseInt(e[0],10):0,ty:e&&e[1]?parseInt(e[1],10):0},rotation:{angle:r&&r[0]?parseInt(r[0],10):0,cx:r&&r[1]?parseInt(r[1],10):void 0,cy:r&&r[2]?parseInt(r[2],10):void 0},scale:{sx:i,sy:n&&n[1]?parseFloat(n[1]):i}}}function QV(t,e){const r=e.x*t.a+e.y*t.c+0,n=e.x*t.b+e.y*t.d+0;return{x:r,y:n}}function pnt(t){const e=QV(t,{x:0,y:1}),r=QV(t,{x:1,y:0}),n=180/Math.PI*Math.atan2(e.y,e.x)-90,i=180/Math.PI*Math.atan2(r.y,r.x);return{skewX:n,skewY:i,translateX:t.e,translateY:t.f,scaleX:Math.sqrt(t.a*t.a+t.b*t.b),scaleY:Math.sqrt(t.c*t.c+t.d*t.d),rotation:n}}function gnt(t){let e,r,n,i;return t?(e=t.a==null?1:t.a,i=t.d==null?1:t.d,r=t.b,n=t.c):e=i=1,{sx:r?Math.sqrt(e*e+r*r):e,sy:n?Math.sqrt(n*n+i*i):i}}function mnt(t){let e={x:0,y:1};t&&(e=QV(t,e));const r=180*Math.atan2(e.y,e.x)/Math.PI%360-90;return{angle:r%360+(r<0?360:0)}}function ynt(t){return{tx:t&&t.e||0,ty:t&&t.f||0}}function VT(t,e,r={}){if(e==null)return FS(_n(t,"transform"));if(r.absolute){t.setAttribute("transform",P6(e));return}const n=t.transform,i=fnt(e);n.baseVal.appendItem(i)}function vse(t,e,r=0,n={}){let i=_n(t,"transform");const s=xN(i);if(e==null)return s.translation;i=s.raw,i=i.replace(/translate\([^)]*\)/g,"").trim();const a=n.absolute?e:s.translation.tx+e,o=n.absolute?r:s.translation.ty+r,l=`translate(${a},${o})`;t.setAttribute("transform",`${l} ${i}`.trim())}function JV(t,e,r,n,i={}){let s=_n(t,"transform");const a=xN(s);if(e==null)return a.rotation;s=a.raw,s=s.replace(/rotate\([^)]*\)/g,"").trim(),e%=360;const o=i.absolute?e:a.rotation.angle+e,l=r!=null&&n!=null?`,${r},${n}`:"",u=`rotate(${o}${l})`;t.setAttribute("transform",`${s} ${u}`.trim())}function bse(t,e,r){let n=_n(t,"transform");const i=xN(n);if(e==null)return i.scale;r=r??e,n=i.raw,n=n.replace(/scale\([^)]*\)/g,"").trim();const s=`scale(${e},${r})`;t.setAttribute("transform",`${n} ${s}`.trim())}function OX(t,e){if(dg(e)&&dg(t)){const r=e.getScreenCTM(),n=t.getScreenCTM();if(r&&n)return r.inverse().multiply(n)}return Qa()}function vnt(t,e){let r=Qa();if(dg(e)&&dg(t)){let n=t;const i=[];for(;n&&n!==e;){const s=n.getAttribute("transform")||null,a=FS(s);i.push(a),n=n.parentNode}i.reverse().forEach(s=>{r=r.multiply(s)})}return r}function bnt(t,e,r){const n=t instanceof SVGSVGElement?t:t.ownerSVGElement,i=n.createSVGPoint();i.x=e,i.y=r;try{const s=n.getScreenCTM(),a=i.matrixTransform(s.inverse()),o=OX(t,n).inverse();return a.matrixTransform(o)}catch{return i}}const U2e={};function HT(t){return U2e[t]||{}}function wN(t,e){U2e[t]=e}const Bk=new WeakMap;function xnt(t){return Bk.has(t)||Bk.set(t,{events:Object.create(null)}),Bk.get(t)}function PX(t){return Bk.get(t)}function wnt(t){return Bk.delete(t)}const u7=()=>!0,K2=()=>!1;function xse(t){t.stopPropagation()}function Tnt(t,e,r){t.addEventListener!=null&&t.addEventListener(e,r)}function Cnt(t,e,r){t.removeEventListener!=null&&t.removeEventListener(e,r)}const knt=/[^\x20\t\r\n\f]+/g,Snt=/^([^.]*)(?:\.(.+)|)/;function j2e(t){return(t||"").match(knt)||[""]}function Y2e(t){const e=Snt.exec(t)||[];return{originType:e[1]?e[1].trim():e[1],namespaces:e[2]?e[2].split(".").map(r=>r.trim()).sort():[]}}function eH(t){return t.nodeType===1||t.nodeType===9||!+t.nodeType}let wse=0;const xb=new WeakMap;function X2e(t){return xb.has(t)||(xb.set(t,wse),wse+=1),xb.get(t)}function Ent(t){return xb.get(t)}function Ant(t){return xb.delete(t)}function K2e(t,e){return xb.set(t,e)}function Mnt(t,e){const r=[],n=PX(t),i=n&&n.events&&n.events[e.type],s=i&&i.handlers||[],a=i?i.delegateCount:0;if(a>0&&!(e.type==="click"&&typeof e.button=="number"&&e.button>=1)){for(let o=e.target;o!==t;o=o.parentNode||t)if(o.nodeType===1&&!(e.type==="click"&&o.disabled===!0)){const l=[],u={};for(let h=0;h<a;h+=1){const d=s[h],f=d.selector;if(f!=null&&u[f]==null){const p=t,g=[];p.querySelectorAll(f).forEach(m=>{g.push(m)}),u[f]=g.includes(o)}u[f]&&l.push(d)}l.length&&r.push({elem:o,handlers:l})}}return a<s.length&&r.push({elem:t,handlers:s.slice(a)}),r}function Tse(t){return t!=null&&t===t.window}function Z2e(t,e){const r=t.nodeType===9?t.documentElement:t,n=e&&e.parentNode;return t===n||!!(n&&n.nodeType===1&&(r.contains?r.contains(n):t.compareDocumentPosition&&t.compareDocumentPosition(n)&16))}class e0{static create(e){return e instanceof e0?e:new e0(e)}static addProperty(e,r){Object.defineProperty(e0.prototype,e,{enumerable:!0,configurable:!0,get:typeof r=="function"?function(){if(this.originalEvent)return r(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set(n){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:n})}})}constructor(e,r){this.isDefaultPrevented=K2,this.isPropagationStopped=K2,this.isImmediatePropagationStopped=K2,this.isSimulated=!1,this.preventDefault=()=>{const n=this.originalEvent;this.isDefaultPrevented=u7,n&&!this.isSimulated&&n.preventDefault()},this.stopPropagation=()=>{const n=this.originalEvent;this.isPropagationStopped=u7,n&&!this.isSimulated&&n.stopPropagation()},this.stopImmediatePropagation=()=>{const n=this.originalEvent;this.isImmediatePropagationStopped=u7,n&&!this.isSimulated&&n.stopImmediatePropagation(),this.stopPropagation()},typeof e=="string"?this.type=e:e.type&&(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?u7:K2,this.target=e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget,this.timeStamp=e.timeStamp),r&&Object.assign(this,r),this.timeStamp||(this.timeStamp=Date.now())}}const Cse={bubbles:!0,cancelable:!0,eventPhase:!0,detail:!0,view:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pageX:!0,pageY:!0,screenX:!0,screenY:!0,toElement:!0,pointerId:!0,pointerType:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,touches:!0,changedTouches:!0,targetTouches:!0,which:!0,altKey:!0,ctrlKey:!0,metaKey:!0,shiftKey:!0};Object.keys(Cse).forEach(t=>e0.addProperty(t,Cse[t]));wN("load",{noBubble:!0});wN("beforeunload",{postDispatch(t,e){e.result!==void 0&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}});wN("mouseenter",{delegateType:"mouseover",bindType:"mouseover",handle(t,e){let r;const n=e.relatedTarget,i=e.handleObj;return(!n||n!==t&&!Z2e(t,n))&&(e.type=i.originType,r=i.handler.call(t,e),e.type="mouseover"),r}});wN("mouseleave",{delegateType:"mouseout",bindType:"mouseout",handle(t,e){let r;const n=e.relatedTarget,i=e.handleObj;return(!n||n!==t&&!Z2e(t,n))&&(e.type=i.originType,r=i.handler.call(t,e),e.type="mouseout"),r}});let tH;function Rnt(t,e,r,n,i){if(!eH(t))return;let s;if(typeof r!="function"){const{handler:u,selector:h}=r,d=gn(r,["handler","selector"]);r=u,i=h,s=d}const a=xnt(t);let o=a.handler;o==null&&(o=a.handler=function(u,...h){return tH!==u.type?_nt(t,u,...h):void 0});const l=X2e(r);j2e(e).forEach(u=>{const{originType:h,namespaces:d}=Y2e(u);if(!h)return;let f=h,p=HT(f);f=(i?p.delegateType:p.bindType)||f,p=HT(f);const g=Object.assign({type:f,originType:h,data:n,selector:i,guid:l,handler:r,namespace:d.join(".")},s),m=a.events;let y=m[f];y||(y=m[f]={handlers:[],delegateCount:0},(!p.setup||p.setup(t,n,d,o)===!1)&&Tnt(t,f,o)),p.add&&(Ant(g.handler),p.add(t,g),K2e(g.handler,l)),i?(y.handlers.splice(y.delegateCount,0,g),y.delegateCount+=1):y.handlers.push(g)})}function Q2e(t,e,r,n,i){const s=PX(t);if(!s)return;const a=s.events;a&&(j2e(e).forEach(o=>{const{originType:l,namespaces:u}=Y2e(o);if(!l){Object.keys(a).forEach(m=>{Q2e(t,m+o,r,n,!0)});return}let h=l;const d=HT(h);h=(n?d.delegateType:d.bindType)||h;const f=a[h];if(!f)return;const p=u.length>0?new RegExp(`(^|\\.)${u.join("\\.(?:.*\\.|)")}(\\.|$)`):null,g=f.handlers.length;for(let m=f.handlers.length-1;m>=0;m-=1){const y=f.handlers[m];(i||l===y.originType)&&(!r||Ent(r)===y.guid)&&(p==null||y.namespace&&p.test(y.namespace))&&(n==null||n===y.selector||n==="**"&&y.selector)&&(f.handlers.splice(m,1),y.selector&&(f.delegateCount-=1),d.remove&&d.remove(t,y))}g&&f.handlers.length===0&&((!d.teardown||d.teardown(t,u,s.handler)===!1)&&Cnt(t,h,s.handler),delete a[h])}),Object.keys(a).length===0&&wnt(t))}function _nt(t,e,...r){const n=e0.create(e);n.delegateTarget=t;const i=HT(n.type);if(i.preDispatch&&i.preDispatch(t,n)===!1)return;const s=Mnt(t,n);for(let a=0,o=s.length;a<o&&!n.isPropagationStopped();a+=1){const l=s[a];n.currentTarget=l.elem;for(let u=0,h=l.handlers.length;u<h&&!n.isImmediatePropagationStopped();u+=1){const d=l.handlers[u];if(n.rnamespace==null||d.namespace&&n.rnamespace.test(d.namespace)){n.handleObj=d,n.data=d.data;const f=HT(d.originType).handle,p=f?f(l.elem,n,...r):d.handler.call(l.elem,n,...r);p!==void 0&&(n.result=p,p===!1&&(n.preventDefault(),n.stopPropagation()))}}}return i.postDispatch&&i.postDispatch(t,n),n.result}function Lnt(t,e,r,n){let i=t,s=typeof t=="string"?t:t.type,a=typeof t=="string"||i.namespace==null?[]:i.namespace.split(".");const o=r;if(o.nodeType===3||o.nodeType===8)return;s.indexOf(".")>-1&&(a=s.split("."),s=a.shift(),a.sort());const l=s.indexOf(":")<0&&`on${s}`;i=t instanceof e0?t:new e0(s,typeof t=="object"?t:null),i.namespace=a.join("."),i.rnamespace=i.namespace?new RegExp(`(^|\\.)${a.join("\\.(?:.*\\.|)")}(\\.|$)`):null,i.result=void 0,i.target||(i.target=o);const u=[i];Array.isArray(e)?u.push(...e):u.push(e);const h=HT(s);if(!n&&h.trigger&&h.trigger(o,i,e)===!1)return;let d;const f=[o];if(!n&&!h.noBubble&&!Tse(o)){d=h.delegateType||s;let g=o,m=o.parentNode;for(;m!=null;)f.push(m),g=m,m=m.parentNode;const y=o.ownerDocument||document;if(g===y){const v=g.defaultView||g.parentWindow||window;f.push(v)}}let p=o;for(let g=0,m=f.length;g<m&&!i.isPropagationStopped();g+=1){const y=f[g];p=y,i.type=g>1?d:h.bindType||s;const v=PX(y);v&&v.events[i.type]&&v.handler&&v.handler.call(y,...u);const x=l&&y[l]||null;x&&eH(y)&&(i.result=x.call(y,...u),i.result===!1&&i.preventDefault())}if(i.type=s,!n&&!i.isDefaultPrevented()){const g=h.preventDefault;if((g==null||g(f.pop(),i,e)===!1)&&eH(o)&&l&&typeof o[s]=="function"&&!Tse(o)){const m=o[l];m&&(o[l]=null),tH=s,i.isPropagationStopped()&&p.addEventListener(s,xse),o[s](),i.isPropagationStopped()&&p.removeEventListener(s,xse),tH=void 0,m&&(o[l]=m)}}return i.result}let Ti=class{static on(e,r,n,i,s){return Fk.on(e,r,n,i,s),e}static once(e,r,n,i,s){return Fk.on(e,r,n,i,s,!0),e}static off(e,r,n,i){return Fk.off(e,r,n,i),e}static trigger(e,r,n,i){return Lnt(r,n,e,i),e}};var Fk;(function(t){function e(n,i,s,a,o,l){if(typeof i=="object"){typeof s!="string"&&(a=a||s,s=void 0),Object.keys(i).forEach(u=>e(n,u,s,a,i[u],l));return}if(a==null&&o==null?(o=s,a=s=void 0):o==null&&(typeof s=="string"?(o=a,a=void 0):(o=a,a=s,s=void 0)),o===!1)o=K2;else if(!o)return;if(l){const u=o;o=function(h,...d){return t.off(n,h),u.call(this,h,...d)},K2e(o,X2e(u))}Rnt(n,i,o,a,s)}t.on=e;function r(n,i,s,a){const o=i;if(o&&o.preventDefault!=null&&o.handleObj!=null){const l=o.handleObj;r(o.delegateTarget,l.namespace?`${l.originType}.${l.namespace}`:l.originType,l.selector,l.handler);return}if(typeof i=="object"){const l=i;Object.keys(l).forEach(u=>r(n,u,s,l[u]));return}(s===!1||typeof s=="function")&&(a=s,s=void 0),a===!1&&(a=K2),Q2e(n,i,a,s)}t.off=r})(Fk||(Fk={}));class J2e{constructor(e,r,n){this.animationFrameId=0,this.deltaX=0,this.deltaY=0,this.eventName=lrt("wheel")?"wheel":"mousewheel",this.target=e,this.onWheelCallback=r,this.onWheelGuard=n,this.onWheel=this.onWheel.bind(this),this.didWheel=this.didWheel.bind(this)}enable(){this.target.addEventListener(this.eventName,this.onWheel,{passive:!1})}disable(){this.target.removeEventListener(this.eventName,this.onWheel)}onWheel(e){if(this.onWheelGuard!=null&&!this.onWheelGuard(e))return;this.deltaX+=e.deltaX,this.deltaY+=e.deltaY,e.preventDefault();let r;(this.deltaX!==0||this.deltaY!==0)&&(e.stopPropagation(),r=!0),r===!0&&this.animationFrameId===0&&(this.animationFrameId=requestAnimationFrame(()=>{this.didWheel(e)}))}didWheel(e){this.animationFrameId=0,this.onWheelCallback(e,this.deltaX,this.deltaY),this.deltaX=0,this.deltaY=0}}function GT(t){const e=t.getBoundingClientRect(),r=t.ownerDocument.defaultView;return{top:e.top+r.pageYOffset,left:e.left+r.pageXOffset}}function Int(t){return t.getBoundingClientRect().width}function Nnt(t){return t.getBoundingClientRect().height}function Dnt(t){const e=h9(t,"position")==="fixed";let r;if(e){const n=t.getBoundingClientRect();r={left:n.left,top:n.top}}else r=GT(t);if(!e){const n=t.ownerDocument;let i=t.offsetParent||n.documentElement;for(;(i===n.body||i===n.documentElement)&&h9(i,"position")==="static";)i=i.parentNode;if(i!==t&&Lrt(i)){const s=GT(i);r.top-=s.top+l7(i,"borderTopWidth"),r.left-=s.left+l7(i,"borderLeftWidth")}}return{top:r.top-l7(t,"marginTop"),left:r.left-l7(t,"marginLeft")}}function Df(t,e){const r=dnt(t.x,t.y).matrixTransform(e);return new Qe(r.x,r.y)}function Ont(t,e){return new lr(Df(t.start,e),Df(t.end,e))}function gu(t,e){const n=Dh("svg").createSVGPoint();n.x=t.x,n.y=t.y;const i=n.matrixTransform(e);n.x=t.x+t.width,n.y=t.y;const s=n.matrixTransform(e);n.x=t.x+t.width,n.y=t.y+t.height;const a=n.matrixTransform(e);n.x=t.x,n.y=t.y+t.height;const o=n.matrixTransform(e),l=Math.min(i.x,s.x,a.x,o.x),u=Math.max(i.x,s.x,a.x,o.x),h=Math.min(i.y,s.y,a.y,o.y),d=Math.max(i.y,s.y,a.y,o.y);return new Bt(l,h,u-l,d-h)}function kse(t,e,r){let n=null;if(!t.ownerSVGElement)return new Bt(0,0,0,0);try{n=t.getBBox()}catch{n={x:t.clientLeft,y:t.clientTop,width:t.clientWidth,height:t.clientHeight}}return Bt.create(n)}function Cd(t,e={}){let r=null;if(!t.ownerSVGElement||!dg(t)){if(I2e(t)){const{left:a,top:o,width:l,height:u}=ebe(t);return new Bt(a,o,l,u)}return new Bt(0,0,0,0)}let i=e.target;if(!e.recursive){try{r=t.getBBox()}catch{r={x:t.clientLeft,y:t.clientTop,width:t.clientWidth,height:t.clientHeight}}if(!i)return Bt.create(r);const a=OX(t,i);return gu(r,a)}{const a=t.childNodes,o=a.length;if(o===0)return Cd(t,{target:i});i||(i=t);let l=null;for(let u=0;u<o;u+=1){const h=a[u];let d=null;h.childNodes.length===0?d=Cd(h,{target:i}):d=Cd(h,{target:i,recursive:!0}),l?l=l.union(d):l=Bt.create(d)}return l||new Bt(0,0,0,0)}}function ebe(t){let e=0,r=0,n=0,i=0;if(t){let s=t;for(;s;)e+=s.offsetLeft,r+=s.offsetTop,s=s.offsetParent,s&&(e+=parseInt(fse(s,"borderLeft"),10),r+=parseInt(fse(s,"borderTop"),10));n=t.offsetWidth,i=t.offsetHeight}return{left:e,top:r,width:n,height:i}}function tbe(t){const e=r=>{const n=t.getAttribute(r),i=n?parseFloat(n):0;return Number.isNaN(i)?0:i};switch(t instanceof SVGElement&&t.nodeName.toLowerCase()){case"rect":return new Bt(e("x"),e("y"),e("width"),e("height"));case"circle":return new rc(e("cx"),e("cy"),e("r"),e("r"));case"ellipse":return new rc(e("cx"),e("cy"),e("rx"),e("ry"));case"polyline":{const r=f9(t);return new Ba(r)}case"polygon":{const r=f9(t);return r.length>1&&r.push(r[0]),new Ba(r)}case"path":{let r=t.getAttribute("d");return vrt(r)||(r=M2e(r)),ci.parse(r)}case"line":return new lr(e("x1"),e("y1"),e("x2"),e("y2"))}return Cd(t)}function Pnt(t){if(t==null)return null;let e=t;do{let r=e.tagName;if(typeof r!="string")return null;if(r=r.toUpperCase(),fd(e,"x6-port"))e=e.nextElementSibling;else if(r==="G")e=e.firstElementChild;else if(r==="TITLE")e=e.nextElementSibling;else break}while(e);return e}function $nt(t){const e=Pnt(t);if(!dg(e)){if(I2e(t)){const{left:i,top:s,width:a,height:o}=ebe(t);return new Bt(i,s,a,o)}return new Bt(0,0,0,0)}return tbe(e).bbox()||Bt.create()}const Bnt=(t,e)=>t-e;class Fnt{constructor(e={}){this.comparator=e.comparator||Bnt,this.index={},this.data=e.data||[],this.heapify()}isEmpty(){return this.data.length===0}insert(e,r,n){const i={priority:e,value:r},s=this.data.length;return n&&(i.id=n,this.index[n]=s),this.data.push(i),this.bubbleUp(s),this}peek(){return this.data[0]?this.data[0].value:null}peekPriority(){return this.data[0]?this.data[0].priority:null}updatePriority(e,r){const n=this.index[e];if(typeof n>"u")throw new Error(`Node with id '${e}' was not found in the heap.`);const i=this.data,s=i[n].priority,a=this.comparator(r,s);a<0?(i[n].priority=r,this.bubbleUp(n)):a>0&&(i[n].priority=r,this.bubbleDown(n))}remove(){const e=this.data,r=e[0],n=e.pop();return r!=null&&r.id&&delete this.index[r.id],e.length>0&&(e[0]=n,n.id&&(this.index[n.id]=0),this.bubbleDown(0)),r?r.value:null}heapify(){for(let e=0;e<this.data.length;e+=1)this.bubbleUp(e)}bubbleUp(e){const r=this.data;let n,i,s=e;for(;s>0&&(i=s-1>>>1,this.comparator(r[s].priority,r[i].priority)<0);){n=r[i],r[i]=r[s];let a=r[s].id;a!=null&&(this.index[a]=i),r[s]=n,a=r[s].id,a!=null&&(this.index[a]=s),s=i}}bubbleDown(e){const r=this.data,n=r.length-1;let i=e;for(;;){const s=(i<<1)+1,a=s+1;let o=i;if(s<=n&&this.comparator(r[s].priority,r[o].priority)<0&&(o=s),a<=n&&this.comparator(r[a].priority,r[o].priority)<0&&(o=a),o!==i){const l=r[o];r[o]=r[i];let u=r[i].id;u!=null&&(this.index[u]=o),r[i]=l,u=r[i].id,u!=null&&(this.index[u]=i),i=o}else break}}}function znt(t,e,r=(n,i)=>1){const n={},i={},s={},a=new Fnt;for(n[e]=0,Object.keys(t).forEach(o=>{o!==e&&(n[o]=1/0),a.insert(n[o],o,o)});!a.isEmpty();){const o=a.remove();s[o]=!0;const l=t[o];for(let u=0;u<l.length;u+=1){const h=l[u];if(!s[h]){const d=n[o]+r(o,h);d<n[h]&&(n[h]=d,i[h]=o,a.updatePriority(h,d))}}}return i}const zS=/(-?(?:\d*\.\d+|\d+))\s*(px|em|rem|ch|vh|vw|vmin|vmax|%|cm|mm|in|pt|pc|ex|fr|deg|rad|turn)$/,rbe=(t,e)=>{const r=e-t;return n=>t+r*n},nbe=(t,e)=>{const r=zS,n=r.exec(t),i=r.exec(e),s=i?i[1]:"",a=n?+n[1]:0,o=i?+i[1]:0,l=s.indexOf("."),u=l>0?s[1].length-l-1:0,h=o-a,d=n?n[2]:"";return f=>(a+h*f).toFixed(u)+d},Vnt=(t,e)=>{const r=parseInt(t.slice(1),16),n=parseInt(e.slice(1),16),i=r&255,s=(n&255)-i,a=r&65280,o=(n&65280)-a,l=r&16711680,u=(n&16711680)-l;return h=>{const d=i+s*h&255,f=a+o*h&65280,p=l+u*h&16711680;return`#${(1<<24|d|f|p).toString(16).slice(1)}`}},Hnt=(t,e)=>{const r=s=>{const a=[];if(!s)return a;const o=/(\w+)\(([^)]+)\)/g;let l=o.exec(s);for(;l!==null;)l[1]&&l[2]&&a.push({name:l[1],values:l[2].split(/\s*,\s*/).filter(Boolean)}),l=o.exec(s);return a},n=r(t),i=r(e);return n.length===0||i.length===0?()=>t:s=>{const a=[];for(let o=0;o<Math.min(n.length,i.length);o++){const l=n[o],u=i[o];if(!(!l||!u)&&l.name===u.name&&l.values.length>0&&l.values.length===u.values.length){const h=[];for(let d=0;d<l.values.length;d++){const f=l.values[d],p=u.values[d];if(!(f===void 0||p===void 0))if(zS.test(f)||zS.test(p)){const g=nbe(f,p);h.push(g(s))}else if(!Number.isNaN(parseFloat(f))&&!Number.isNaN(parseFloat(p))){const g=rbe(parseFloat(f),parseFloat(p));h.push(g(s).toString())}else h.push(f)}h.length>0&&a.push(`${l.name}(${h.join(", ")})`)}}return a.length>0?a.join(" "):t}},ibe=t=>t,Gnt=t=>t*t,Wnt=t=>t*t*t,qnt=t=>{if(t<=0)return 0;if(t>=1)return 1;const e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)},Unt=t=>Math.pow(2,10*(t-1)),jnt=(t=>{for(let e=0,r=1;;e+=r,r/=2)if(t>=(7-4*e)/11){const n=(11-6*e-11*t)/4;return-n*n+r*r}}),Ynt={reverse(t){return e=>1-t(1-e)},reflect(t){return e=>.5*(e<.5?t(2*e):2-t(2-2*e))},clamp(t,e=0,r=1){return n=>{const i=t(n);return i<e?e:i>r?r:i}},back(t=1.70158){return e=>e*e*((t+1)*e-t)},elastic(t=1.5){return e=>Math.pow(2,10*(e-1))*Math.cos(20*Math.PI*t/3*e)}};function Xnt(t){return-1*Math.cos(t*(Math.PI/2))+1}function Knt(t){return Math.sin(t*(Math.PI/2))}function Znt(t){return-.5*(Math.cos(Math.PI*t)-1)}function Qnt(t){return t*t}function Jnt(t){return t*(2-t)}function eit(t){return t<.5?2*t*t:-1+(4-2*t)*t}function tit(t){return t*t*t}function rit(t){const e=t-1;return e*e*e+1}function nit(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1}function iit(t){return t*t*t*t}function sit(t){const e=t-1;return 1-e*e*e*e}function ait(t){const e=t-1;return t<.5?8*t*t*t*t:1-8*e*e*e*e}function oit(t){return t*t*t*t*t}function lit(t){const e=t-1;return 1+e*e*e*e*e}function cit(t){const e=t-1;return t<.5?16*t*t*t*t*t:1+16*e*e*e*e*e}function uit(t){return t===0?0:Math.pow(2,10*(t-1))}function hit(t){return t===1?1:-Math.pow(2,-10*t)+1}function dit(t){if(t===0||t===1)return t;const e=t*2,r=e-1;return e<1?.5*Math.pow(2,10*r):.5*(-Math.pow(2,-10*r)+2)}function fit(t){const e=t/1;return-1*(Math.sqrt(1-e*t)-1)}function pit(t){const e=t-1;return Math.sqrt(1-e*e)}function git(t){const e=t*2,r=e-2;return e<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-r*r)+1)}function mit(t,e=1.70158){return t*t*((e+1)*t-e)}function yit(t,e=1.70158){const r=t/1-1;return r*r*((e+1)*r+e)+1}function vit(t,e=1.70158){const r=t*2,n=r-2,i=e*1.525;return r<1?.5*r*r*((i+1)*r-i):.5*(n*n*((i+1)*n+i)+2)}function bit(t,e=.7){if(t===0||t===1)return t;const n=t/1-1,i=1-e,s=i/(2*Math.PI)*Math.asin(1);return-(Math.pow(2,10*n)*Math.sin((n-s)*(2*Math.PI)/i))}function xit(t,e=.7){const r=1-e,n=t*2;if(t===0||t===1)return t;const i=r/(2*Math.PI)*Math.asin(1);return Math.pow(2,-10*n)*Math.sin((n-i)*(2*Math.PI)/r)+1}function wit(t,e=.65){const r=1-e;if(t===0||t===1)return t;const n=t*2,i=n-1,s=r/(2*Math.PI)*Math.asin(1);return n<1?-.5*(Math.pow(2,10*i)*Math.sin((i-s)*(2*Math.PI)/r)):Math.pow(2,-10*i)*Math.sin((i-s)*(2*Math.PI)/r)*.5+1}function $X(t){const e=t/1;if(e<1/2.75)return 7.5625*e*e;if(e<2/2.75){const r=e-.5454545454545454;return 7.5625*r*r+.75}if(e<2.5/2.75){const r=e-.8181818181818182;return 7.5625*r*r+.9375}{const r=e-.9545454545454546;return 7.5625*r*r+.984375}}function sbe(t){return 1-$X(1-t)}function Tit(t){return t<.5?sbe(t*2)*.5:$X(t*2-1)*.5+.5}const Cit=Object.freeze(Object.defineProperty({__proto__:null,bounce:jnt,cubic:Wnt,decorators:Ynt,easeInBack:mit,easeInBounce:sbe,easeInCirc:fit,easeInCubic:tit,easeInElastic:bit,easeInExpo:uit,easeInOutBack:vit,easeInOutBounce:Tit,easeInOutCirc:git,easeInOutCubic:nit,easeInOutElastic:wit,easeInOutExpo:dit,easeInOutQuad:eit,easeInOutQuart:ait,easeInOutQuint:cit,easeInOutSine:Znt,easeInQuad:Qnt,easeInQuart:iit,easeInQuint:oit,easeInSine:Xnt,easeOutBack:yit,easeOutBounce:$X,easeOutCirc:pit,easeOutCubic:rit,easeOutElastic:xit,easeOutExpo:hit,easeOutQuad:Jnt,easeOutQuart:sit,easeOutQuint:lit,easeOutSine:Knt,exponential:Unt,inout:qnt,linear:ibe,quad:Gnt},Symbol.toStringTag,{value:"Module"}));function i$(t,e){const r=[];for(let n=0;n<t.length;n+=2){const i=t[n],s=t[n+1],a=Array.isArray(e)?e:[e],o=S2e(i,s,a);r.push(o)}return TX(r)}class kit{constructor(){this.listeners={}}on(e,r,n){return r==null?this:(this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(r,n),this)}once(e,r,n){const i=(...s)=>(this.off(e,i),i$([r,n],s));return this.on(e,i,this)}off(e,r,n){if(!(e||r||n))return this.listeners={},this;const i=this.listeners;return(e?[e]:Object.keys(i)).forEach(a=>{const o=i[a];if(o){if(!(r||n)){delete i[a];return}for(let l=o.length-2;l>=0;l-=2)r&&o[l]!==r||n&&o[l+1]!==n||o.splice(l,2)}}),this}trigger(e,...r){let n=!0;if(e!=="*"){const s=this.listeners[e];s!=null&&(n=i$([...s],r))}const i=this.listeners["*"];return i!=null?TX([n,i$([...i],[e,...r])]):n}emit(e,...r){return this.trigger(e,...r)}}let r3=class{get disposed(){return this._disposed===!0}dispose(){this._disposed=!0}};function Dn(){return(t,e,r)=>{const n=r.value,i=t.__proto__;r.value=function(...s){this.disposed||(n.call(this,...s),i.dispose.call(this))}}}class Bl extends kit{dispose(){this.off()}}Nn([Dn()],Bl.prototype,"dispose",null);Urt(Bl,r3);class rH{constructor(){this.clear()}clear(){this.map=new WeakMap,this.arr=[]}has(e){return this.map.has(e)}get(e){return this.map.get(e)}set(e,r){this.map.set(e,r),this.arr.push(e)}delete(e){const r=this.arr.indexOf(e);r>=0&&this.arr.splice(r,1);const n=this.map.get(e);return this.map.delete(e),n}each(e){this.arr.forEach(r=>{const n=this.map.get(r);e(n,r)})}dispose(){this.clear()}}function nH(t){const e=[],r=[];return Array.isArray(t)?e.push(...t):t.split("|").forEach(n=>{n.indexOf("&")===-1?e.push(n):r.push(...n.split("&"))}),{or:e,and:r}}function Sit(t,e){if(t!=null&&e!=null){const r=nH(t),n=nH(e),i=r.or.sort(),s=n.or.sort(),a=r.and.sort(),o=n.and.sort(),l=(u,h)=>u.length===h.length&&(u.length===0||u.every((d,f)=>d===h[f]));return l(i,s)&&l(a,o)}return t==null&&e==null}function fg(t,e,r){if(e==null||Array.isArray(e)&&e.length===0)return r?t.altKey!==!0&&t.ctrlKey!==!0&&t.metaKey!==!0&&t.shiftKey!==!0:!0;const{or:n,and:i}=nH(e),s=a=>{const o=`${a.toLowerCase()}Key`;return t[o]===!0};return n.some(a=>s(a))&&i.every(a=>s(a))}class Zs{static create(e){return new Zs(e)}constructor(e){this.options=Object.assign({},e),this.data=this.options.data||{},this.register=this.register.bind(this),this.unregister=this.unregister.bind(this)}get names(){return Object.keys(this.data)}register(e,r,n=!1){if(typeof e=="object"){Object.entries(e).forEach(([a,o])=>{this.register(a,o,r)});return}this.exist(e)&&!n&&!k2e()&&this.onDuplicated(e);const i=this.options.process,s=i?vr(i,this,e,r):r;return this.data[e]=s,s}unregister(e){const r=e?this.data[e]:null;return delete this.data[e],r}get(e){return e?this.data[e]:null}exist(e){return e?this.data[e]!=null:!1}onDuplicated(e){try{throw this.options.onConflict&&vr(this.options.onConflict,this,e),new Error(`${a9(this.options.type)} with name '${e}' already registered.`)}catch(r){throw r}}onNotFound(e,r){throw new Error(this.getSpellingSuggestion(e,r))}getSpellingSuggestion(e,r){const n=this.getSpellingSuggestionForName(e),i=r?`${r} ${Stt(this.options.type)}`:this.options.type;return`${a9(i)} with name '${e}' does not exist.${n?` Did you mean '${n}'?`:""}`}getSpellingSuggestionForName(e){return Vrt(e,Object.keys(this.data),r=>r)}}const Eit={},abe={position:TN("x","width","origin")},obe={position:TN("y","height","origin")},Ait={position:TN("x","width","corner")},Mit={position:TN("y","height","corner")},lbe={set:pg("width","width")},cbe={set:pg("height","height")},Rit={set:pg("rx","width")},_it={set:pg("ry","height")},ube={set:(t=>{const e=pg(t,"width"),r=pg(t,"height");return function(n,i){const s=i.refBBox,a=s.height>s.width?e:r;return vr(a,this,n,i)}})("r")},Lit={set(t,{refBBox:e}){let r=parseFloat(t);const n=c0(t);n&&(r/=100);const i=Math.sqrt(e.height*e.height+e.width*e.width);let s;return Number.isFinite(r)&&(n||r>=0&&r<=1?s=r*i:s=Math.max(r+i,0)),{r:s}}},Iit={set:pg("cx","width")},Nit={set:pg("cy","height")},hbe={set:pbe({resetOffset:!0})},Dit={set:pbe({resetOffset:!1})},dbe={set:gbe({resetOffset:!0})},Oit={set:gbe({resetOffset:!1})},Pit=ube,$it=hbe,Bit=dbe,Fit=abe,zit=obe,Vit=lbe,Hit=cbe;function TN(t,e,r){return(n,{refBBox:i})=>{if(n==null)return null;let s=parseFloat(n);const a=c0(n);a&&(s/=100);let o;if(Number.isFinite(s)){const u=i[r];a||s>0&&s<1?o=u[t]+i[e]*s:o=u[t]+s}const l=new Qe;return l[t]=o||0,l}}function pg(t,e){return(r,{refBBox:n})=>{let i=parseFloat(r);const s=c0(r);s&&(i/=100);const a={};if(Number.isFinite(i)){const o=s||i>=0&&i<=1?i*n[e]:Math.max(i+n[e],0);a[t]=o}return a}}function fbe(t,e){const r="x6-shape",n=e&&e.resetOffset;return(i,{elem:s,refBBox:a})=>{let o=hy(s,r);if(!o||o.value!==i){const m=t(i);o={value:i,shape:m,shapeBBox:m.bbox()},hy(s,r,o)}const l=o.shape.clone(),u=o.shapeBBox.clone(),h=u.getOrigin(),d=a.getOrigin();u.x=d.x,u.y=d.y;const f=a.getMaxScaleToFit(u,d),p=u.width===0||a.width===0?1:f.sx,g=u.height===0||a.height===0?1:f.sy;return l.scale(p,g,h),n&&l.translate(-h.x,-h.y),l}}function pbe(t){function e(n){return ci.parse(n)}const r=fbe(e,t);return(n,i)=>({d:r(n,i).serialize()})}function gbe(t){const e=fbe(r=>new Ba(r),t);return(r,n)=>({points:e(r,n).serialize()})}const Git={qualify:Nh,set(t,{view:e}){return`url(#${e.graph.defineGradient(t)})`}},Wit={qualify:Nh,set(t,{view:e}){const r=e.cell,n=Object.assign({},t);if(r.isEdge()&&n.type==="linearGradient"){const i=e,s=i.sourcePoint,a=i.targetPoint;n.id=`gradient-${n.type}-${r.id}`,n.attrs=Object.assign(Object.assign({},n.attrs),{x1:s.x,y1:s.y,x2:a.x,y2:a.y,gradientUnits:"userSpaceOnUse"}),e.graph.defs.remove(n.id)}return`url(#${e.graph.defineGradient(n)})`}},mbe={qualify(t,{attrs:e}){return e.textWrap==null||!Nh(e.textWrap)},set(t,{view:e,elem:r,attrs:n}){const i="x6-text",s=hy(r,i),a=h=>{try{if(typeof h=="string")return JSON.parse(h)}catch{}return h},o={x:n.x,eol:n.eol,annotations:a(n.annotations),textPath:a(n["text-path"]||n.textPath),textVerticalAnchor:n["text-vertical-anchor"]||n.textVerticalAnchor,displayEmpty:(n["display-empty"]||n.displayEmpty)==="true",lineHeight:n["line-height"]||n.lineHeight},l=n["font-size"]||n.fontSize,u=JSON.stringify([t,o]);if(l&&r.setAttribute("font-size",l),s==null||s!==u){const h=o.textPath;if(h!=null&&typeof h=="object"){const d=h.selector;if(typeof d=="string"){const f=e.find(d)[0];f instanceof SVGPathElement&&(SX(f),o.textPath=Object.assign({"xlink:href":`#${f.id}`},h))}}z2e(r,`${t}`,o),hy(r,i,u)}}},qit={qualify:Nh,set(t,{view:e,elem:r,attrs:n,refBBox:i}){var s,a;const o=t,l=o.width||0;c0(l)?i.width*=parseFloat(l)/100:l<=0?i.width+=l:i.width=l;const u=o.height||0;c0(u)?i.height*=parseFloat(u)/100:u<=0?i.height+=u:i.height=u;let h;const d=(a=(s=o.text)!==null&&s!==void 0?s:n.text)!==null&&a!==void 0?a:r==null?void 0:r.textContent;d!=null?h=V2e(`${d}`,i,{"font-weight":n["font-weight"]||n.fontWeight,"font-size":n["font-size"]||n.fontSize,"font-family":n["font-family"]||n.fontFamily,lineHeight:n.lineHeight},{ellipsis:o.ellipsis}):h="",vr(mbe.set,this,h,{view:e,elem:r,attrs:n,refBBox:i,cell:e.cell})}},n3=(t,{attrs:e})=>e.text!==void 0,Uit={qualify:n3},jit={qualify:n3},Yit={qualify:n3},Xit={qualify:n3},Kit={qualify:n3},Zit={qualify:n3},Qit={qualify(t,{elem:e}){return e instanceof SVGElement},set(t,{elem:e}){const r="x6-title",n=`${t}`,i=hy(e,r);if(i==null||i!==n){hy(e,r,n);const s=e.firstChild;if(s&&s.tagName.toUpperCase()==="TITLE"){const a=s;a.textContent=n}else{const a=document.createElementNS(e.namespaceURI,"title");a.textContent=n,e.insertBefore(a,s)}}}},Jit={offset:ybe("x","width","right")},est={offset:ybe("y","height","bottom")},tst={offset(t,{refBBox:e}){return t?{x:-e.x,y:-e.y}:{x:0,y:0}}};function ybe(t,e,r){return(n,{refBBox:i})=>{const s=new Qe;let a;return n==="middle"?a=i[e]/2:n===r?a=i[e]:typeof n=="number"&&Number.isFinite(n)?a=n>-1&&n<1?-i[e]*n:-n:c0(n)?a=i[e]*parseFloat(n)/100:a=0,s[t]=-(i[t]+a),s}}const rst={qualify:Nh,set(t,{elem:e}){ri(e,t)}},nst={set(t,{elem:e}){e.innerHTML=`${t}`}},ist={qualify:Nh,set(t,{view:e}){return`url(#${e.graph.defineFilter(t)})`}},sst={set(t){return t!=null&&typeof t=="object"&&t.id?t.id:t}},ast=t=>{var{size:e,width:r,height:n,offset:i,open:s}=t,a=gn(t,["size","width","height","offset","open"]);return vbe({size:e,width:r,height:n,offset:i},s===!0,!0,void 0,a)},ost=t=>{var{size:e,width:r,height:n,offset:i,factor:s}=t,a=gn(t,["size","width","height","offset","factor"]);return vbe({size:e,width:r,height:n,offset:i},!1,!1,s,a)};function vbe(t,e,r,n=3/4,i={}){const s=t.size||10,a=t.width||s,o=t.height||s,l=new ci,u={};if(e)l.moveTo(a,0).lineTo(0,o/2).lineTo(a,o),u.fill="none";else{if(l.moveTo(0,o/2),l.lineTo(a,0),!r){const h=Y1(n,0,1);l.lineTo(a*h,o/2)}l.lineTo(a,o),l.close()}return Object.assign(Object.assign(Object.assign({},u),i),{tagName:"path",d:e3(l.serialize(),{x:t.offset!=null?t.offset:-a/2})})}const lst=t=>{var{size:e,width:r,height:n,offset:i}=t,s=gn(t,["size","width","height","offset"]);const a=e||10,o=r||a,l=n||a,u=new ci;return u.moveTo(0,l/2).lineTo(o/2,0).lineTo(o,l/2).lineTo(o/2,l).close(),Object.assign(Object.assign({},s),{tagName:"path",d:e3(u.serialize(),i??-o/2)})},cst=t=>{var{d:e,offsetX:r,offsetY:n}=t,i=gn(t,["d","offsetX","offsetY"]);return Object.assign(Object.assign({},i),{tagName:"path",d:e3(e,r,n)})},ust=t=>{var{size:e,width:r,height:n,offset:i}=t,s=gn(t,["size","width","height","offset"]);const a=e||10,o=r||a,l=n||a,u=new ci;return u.moveTo(0,0).lineTo(o,l).moveTo(0,l).lineTo(o,0),Object.assign(Object.assign({},s),{tagName:"path",fill:"none",d:e3(u.serialize(),i||-o/2)})},hst=t=>{var{width:e,height:r,offset:n,open:i,flip:s}=t,a=gn(t,["width","height","offset","open","flip"]);let o=r||6;const l=e||10,u=i===!0,h=s===!0,d=Object.assign(Object.assign({},a),{tagName:"path"});h&&(o=-o);const f=new ci;return f.moveTo(0,o).lineTo(l,0),u?d.fill="none":(f.lineTo(l,o),f.close()),d.d=e3(f.serialize(),{x:n||-l/2,y:o/2}),d},bbe=t=>{var{r:e}=t,r=gn(t,["r"]);const n=e||5;return Object.assign(Object.assign({cx:n},r),{tagName:"circle",r:n})},dst=t=>{var{r:e}=t,r=gn(t,["r"]);const n=e||5,i=new ci;return i.moveTo(n,0).lineTo(n,n*2),i.moveTo(0,n).lineTo(n*2,n),{children:[Object.assign(Object.assign({},bbe({r:n})),{fill:"none"}),Object.assign(Object.assign({},r),{tagName:"path",d:e3(i.serialize(),-n)})]}},fst=t=>{var{rx:e,ry:r}=t,n=gn(t,["rx","ry"]);const i=e||5,s=r||5;return Object.assign(Object.assign({cx:i},n),{tagName:"ellipse",rx:i,ry:s})},pst=Object.freeze(Object.defineProperty({__proto__:null,async:hst,block:ast,circle:bbe,circlePlus:dst,classic:ost,cross:ust,diamond:lst,ellipse:fst,path:cst},Symbol.toStringTag,{value:"Module"})),gst=pst,VS=Zs.create({type:"marker"});VS.register(gst,!0);function BX(t){return typeof t=="string"||Nh(t)}const mst={qualify:BX,set(t,{view:e,attrs:r}){return FX("marker-start",t,e,r)}},yst={qualify:BX,set(t,{view:e,attrs:r}){return FX("marker-end",t,e,r,{transform:"rotate(180)"})}},vst={qualify:BX,set(t,{view:e,attrs:r}){return FX("marker-mid",t,e,r)}};function FX(t,e,r,n,i={}){const s=typeof e=="string"?{name:e}:e,{name:a,args:o}=s,l=gn(s,["name","args"]);let u=l;if(a&&typeof a=="string"){const d=VS.get(a);if(d)u=d(Object.assign(Object.assign({},l),o));else return VS.onNotFound(a)}const h=Object.assign(Object.assign(Object.assign({},bst(n,t)),i),u);return{[t]:`url(#${r.graph.defineMarker(h)})`}}function bst(t,e){const r={},n=t.stroke;if(typeof n=="string"&&(r.stroke=n,r.fill=n),e!=="marker-mid"){const i=parseFloat(t.strokeWidth||t["stroke-width"]);if(Number.isFinite(i)&&i>1){const s=Math.ceil(i/2);r.refX=e==="marker-start"?s:-s}}return r}const $6=(t,{view:e})=>e.cell.isEdge(),xst={qualify:$6,set(t,e){var r,n,i,s;const a=e.view,o=t.reverse||!1,l=t.stubs||0;let u;if(Number.isFinite(l)&&l!==0)if(o){let h,d;const f=a.getConnectionLength()||0;l<0?(h=(f+l)/2,d=-l):(h=l,d=f-l*2);const p=a.getConnection();u=(s=(i=(n=(r=p==null?void 0:p.divideAtLength(h))===null||r===void 0?void 0:r[1])===null||n===void 0?void 0:n.divideAtLength(d))===null||i===void 0?void 0:i[0])===null||s===void 0?void 0:s.serialize()}else{let h;l<0?h=((a.getConnectionLength()||0)+l)/2:h=l;const d=a.getConnection();if(d){const f=d.divideAtLength(h),p=d.divideAtLength(-h);f&&p&&(u=`${f[0].serialize()} ${p[1].serialize()}`)}}return{d:u||a.getConnectionPathData()}}},xbe={qualify:$6,set:CN("getTangentAtLength",{rotate:!0})},wst={qualify:$6,set:CN("getTangentAtLength",{rotate:!1})},wbe={qualify:$6,set:CN("getTangentAtRatio",{rotate:!0})},Tst={qualify:$6,set:CN("getTangentAtRatio",{rotate:!1})},Cst=xbe,kst=wbe;function CN(t,e){const r={x:1,y:0};return(n,i)=>{let s,a;const o=i.view,l=o[t](Number(n));return l?(a=e.rotate?l.vector().vectorAngle(r):0,s=l.start):(s=o.path.start,a=0),a===0||Number.isNaN(a)?{transform:`translate(${s.x},${s.y})`}:{transform:`translate(${s.x},${s.y}) rotate(${a})`}}}const Sst=Object.freeze(Object.defineProperty({__proto__:null,annotations:Xit,atConnectionLength:Cst,atConnectionLengthIgnoreGradient:wst,atConnectionLengthKeepGradient:xbe,atConnectionRatio:kst,atConnectionRatioIgnoreGradient:Tst,atConnectionRatioKeepGradient:wbe,connection:xst,displayEmpty:Zit,eol:Kit,fill:Git,filter:ist,html:nst,lineHeight:Uit,port:sst,ref:Eit,refCx:Iit,refCy:Nit,refD:$it,refDKeepOffset:Dit,refDResetOffset:hbe,refDx:Ait,refDy:Mit,refHeight:cbe,refHeight2:Hit,refPoints:Bit,refPointsKeepOffset:Oit,refPointsResetOffset:dbe,refR:Pit,refRCircumscribed:Lit,refRInscribed:ube,refRx:Rit,refRy:_it,refWidth:lbe,refWidth2:Vit,refX:abe,refX2:Fit,refY:obe,refY2:zit,resetOffset:tst,sourceMarker:mst,stroke:Wit,style:rst,targetMarker:yst,text:mbe,textPath:Yit,textVerticalAnchor:jit,textWrap:qit,title:Qit,vertexMarker:vst,xAlign:Jit,yAlign:est},Symbol.toStringTag,{value:"Module"})),Est={xlinkHref:"xlink:href",xlinkShow:"xlink:show",xlinkRole:"xlink:role",xlinkType:"xlink:type",xlinkArcrole:"xlink:arcrole",xlinkTitle:"xlink:title",xlinkActuate:"xlink:actuate",xmlSpace:"xml:space",xmlBase:"xml:base",xmlLang:"xml:lang",preserveAspectRatio:"preserveAspectRatio",requiredExtension:"requiredExtension",requiredFeatures:"requiredFeatures",systemLanguage:"systemLanguage",externalResourcesRequired:"externalResourceRequired"};function Ast(t,e,r){return!!(t!=null&&(typeof t=="string"||typeof t.qualify!="function"||vr(t.qualify,this,e,r)))}const Tbe=Object.assign(Object.assign({},Est),Sst),HS=Zs.create({type:"attribute definition"});HS.register(Tbe,!0);const Cbe=t=>{const e=document.createElement("canvas"),r=t.width,n=t.height;e.width=r*2,e.height=n;const i=e.getContext("2d");return i.drawImage(t,0,0,r,n),i.translate(2*r,0),i.scale(-1,1),i.drawImage(t,0,0,r,n),e},kbe=t=>{const e=document.createElement("canvas"),r=t.width,n=t.height;e.width=r,e.height=n*2;const i=e.getContext("2d");return i.drawImage(t,0,0,r,n),i.translate(0,2*n),i.scale(1,-1),i.drawImage(t,0,0,r,n),e},Sbe=t=>{const e=document.createElement("canvas"),r=t.width,n=t.height;e.width=2*r,e.height=2*n;const i=e.getContext("2d");return i.drawImage(t,0,0,r,n),i.setTransform(-1,0,0,-1,e.width,e.height),i.drawImage(t,0,0,r,n),i.setTransform(-1,0,0,1,e.width,0),i.drawImage(t,0,0,r,n),i.setTransform(1,0,0,-1,0,e.height),i.drawImage(t,0,0,r,n),e},Mst=(t,e)=>{const r=t.width,n=t.height,i=document.createElement("canvas");i.width=r*3,i.height=n*3;const s=i.getContext("2d"),a=e.angle!=null?-e.angle:-20,o=Fo(a),l=i.width/4,u=i.height/4;for(let h=0;h<4;h+=1)for(let d=0;d<4;d+=1)(h+d)%2>0&&(s.setTransform(1,0,0,1,(2*h-1)*l,(2*d-1)*u),s.rotate(o),s.drawImage(t,-r/2,-n/2,r,n));return i},Rst=Object.freeze(Object.defineProperty({__proto__:null,flipX:Cbe,flipXY:Sbe,flipY:kbe,watermark:Mst},Symbol.toStringTag,{value:"Module"})),kN=Object.assign({},Rst);kN["flip-x"]=Cbe;kN["flip-y"]=kbe;kN["flip-xy"]=Sbe;const SN=Zs.create({type:"background pattern"});SN.register(kN,!0);function EN(t,e,r){let n;if(typeof r=="object"){if(Number.isFinite(r.y)){const s=new lr(e,t),{start:a,end:o}=s.parallel(r.y);e=a,t=o}n=r.x}else n=r;if(n==null||!Number.isFinite(n))return t;const i=t.distance(e);return n===0&&i>0?t:t.move(e,-Math.min(n,i-1))}function p9(t){const e=t.getAttribute("stroke-width");return e===null?0:parseFloat(e)||0}function _st(t){if(t==null)return null;let e=t;do{let r=e.tagName;if(typeof r!="string")return null;if(r=r.toUpperCase(),r==="G")e=e.firstElementChild;else if(r==="TITLE")e=e.nextElementSibling;else break}while(e);return e}const Ebe=(t,e,r,n)=>{const i=e.getBBoxOfElement(r);n.stroked&&i.inflate(p9(r)/2);const s=t.intersect(i),a=s&&s.length?t.start.closest(s):t.end;return EN(a,t.start,n.offset)},Lst=function(t,e,r,n,i){const s=e.cell,a=s.isNode()?s.getAngle():0;if(a===0)return vr(Ebe,this,t,e,r,n,i);const o=e.getUnrotatedBBoxOfElement(r);n.stroked&&o.inflate(p9(r)/2);const l=o.getCenter(),u=t.clone().rotate(a,l),h=u.setLength(1e6).intersect(o),d=h&&h.length?u.start.closest(h).rotate(-a,l):t.end;return EN(d,t.start,n.offset)},Ist=(t,e,r,n)=>{let i,s;const a=t.end,o=n.selector;if(typeof o=="string"?i=e.findOne(o):Array.isArray(o)?i=DX(r,o):i=_st(r),!dg(i)){if(i===r||!dg(r))return a;i=r}const l=e.getShapeOfElement(i),u=e.getMatrixOfElement(i),h=e.getRootTranslatedMatrix(),d=e.getRootRotatedMatrix(),f=h.multiply(d).multiply(u),p=f.inverse(),g=Ont(t,p),m=g.start.clone(),y=e.getDataOfElement(i);if(n.insideout===!1){y.shapeBBox==null&&(y.shapeBBox=l.bbox());const T=y.shapeBBox;if(T!=null&&T.containsPoint(m))return a}n.extrapolate===!0&&g.setLength(1e6);let v;if(ci.isPath(l)){const T=n.precision||2;y.segmentSubdivisions==null&&(y.segmentSubdivisions=l.getSegmentSubdivisions({precision:T})),v={precision:T,segmentSubdivisions:y.segmentSubdivisions},s=g.intersect(l,v)}else s=g.intersect(l);s?Array.isArray(s)&&(s=m.closest(s)):n.sticky===!0&&(Bt.isRectangle(l)?s=l.getNearestPointToPoint(m):rc.isEllipse(l)?s=l.intersectsWithLineFromCenterToPoint(m):s=l.closestPoint(m,v));const x=s?Df(s,f):a;let b=n.offset||0;return n.stroked!==!1&&(typeof b=="object"?(b=Object.assign({},b),b.x==null&&(b.x=0),b.x+=p9(i)/2):b+=p9(i)/2),EN(x,t.start,b)};function Nst(t,e,r=0){const{start:n,end:i}=t;let s,a,o,l;switch(e){case"left":l="x",s=i,a=n,o=-1;break;case"right":l="x",s=n,a=i,o=1;break;case"top":l="y",s=i,a=n,o=-1;break;case"bottom":l="y",s=n,a=i,o=1;break;default:return}n[l]<i[l]?s[l]=a[l]:a[l]=s[l],Number.isFinite(r)&&(s[l]+=o*r,a[l]+=o*r)}const Dst=(t,e,r,n)=>{const{alignOffset:i,align:s}=n;return s&&Nst(t,s,i),EN(t.end,t.start,n.offset)},Ost=Object.freeze(Object.defineProperty({__proto__:null,anchor:Dst,bbox:Ebe,boundary:Ist,rect:Lst},Symbol.toStringTag,{value:"Module"})),Pst=Ost,GS=Zs.create({type:"connection point"});GS.register(Pst,!0);const Sse=1,h7=1/3,d7=2/3;let WS=[],g9=[];function $st(t){let e=t.graph._jumpOverUpdateList;if(e==null&&(e=t.graph._jumpOverUpdateList=[],t.graph.on("cell:mouseup",()=>{const r=t.graph._jumpOverUpdateList;setTimeout(()=>{for(let n=0;n<r.length;n+=1)r[n].update()})}),t.graph.on("model:reseted",()=>{e=t.graph._jumpOverUpdateList=[]})),e.indexOf(t)<0){e.push(t);const r=()=>e.splice(e.indexOf(t),1);t.cell.once("change:connector",r),t.cell.once("removed",r)}}function s$(t,e,r=[]){const n=[t,...r,e],i=[];return n.forEach((s,a)=>{const o=n[a+1];o!=null&&i.push(new lr(s,o))}),i}function Bst(t,e){const r=[];return e.forEach(n=>{const i=t.intersectsWithLine(n);if(i){const{x:s,y:a}=i,{start:o,end:l}=n,u=Math.round(o.x)===Math.round(s)&&Math.round(o.y)===Math.round(a),h=Math.round(l.x)===Math.round(s)&&Math.round(l.y)===Math.round(a);if(u||h)return;r.push(i)}}),r}function Ese(t,e){return new lr(t,e).squaredLength()}function Fst(t,e,r){return e.reduce((n,i,s)=>{if(g9.includes(i))return n;const a=n.pop()||t,o=Qe.create(i).move(a.start,-r);let l=Qe.create(i).move(a.start,+r);const u=e[s+1];if(u!=null){const f=l.distance(u);f<=r&&(l=u.move(a.start,f),g9.push(u))}else if(o.distance(a.end)<r*2+Sse)return n.push(a),n;if(l.distance(a.start)<r*2+Sse)return n.push(a),n;const d=new lr(o,l);return WS.push(d),n.push(new lr(a.start,o),d,new lr(l,a.end)),n},[])}function Ase(t,e,r,n){const i=new ci;let s;return s=ci.createSegment("M",t[0].start),i.appendSegment(s),t.forEach((a,o)=>{if(WS.includes(a)){let l,u,h,d;if(r==="arc"){l=-90,u=a.start.diff(a.end),(u.x<0||u.x===0&&u.y<0)&&(l+=180);const p=a.getCenter(),g=new lr(p,a.end).rotate(l,p);let m;m=new lr(a.start,p),h=m.pointAt(2/3).rotate(l,a.start),d=g.pointAt(1/3).rotate(-l,g.end),s=ci.createSegment("C",h,d,g.end),i.appendSegment(s),m=new lr(p,a.end),h=g.pointAt(1/3).rotate(l,g.end),d=m.pointAt(1/3).rotate(-l,a.end),s=ci.createSegment("C",h,d,a.end),i.appendSegment(s)}else if(r==="gap")s=ci.createSegment("M",a.end),i.appendSegment(s);else if(r==="cubic"){l=a.start.theta(a.end);const f=e*.6;let p=e*1.35;u=a.start.diff(a.end),(u.x<0||u.x===0&&u.y<0)&&(p*=-1),h=new Qe(a.start.x+f,a.start.y+p).rotate(l,a.start),d=new Qe(a.end.x-f,a.end.y+p).rotate(l,a.end),s=ci.createSegment("C",h,d,a.end),i.appendSegment(s)}}else{const l=t[o+1];n===0||!l||WS.includes(l)?(s=ci.createSegment("L",a.end),i.appendSegment(s)):zst(n,i,a.end,a.start,l.end)}}),i}function zst(t,e,r,n,i){const s=r.distance(n)/2,a=r.distance(i)/2,o=-Math.min(t,s),l=-Math.min(t,a),u=r.clone().move(n,o).round(),h=r.clone().move(i,l).round(),d=new Qe(h7*u.x+d7*r.x,d7*r.y+h7*u.y),f=new Qe(h7*h.x+d7*r.x,d7*r.y+h7*h.y);let p;p=ci.createSegment("L",u),e.appendSegment(p),p=ci.createSegment("C",d,f,h),e.appendSegment(p)}const Vst=function(t,e,r,n={}){WS=[],g9=[],$st(this);const i=n.size||5,s=n.type||"arc",a=n.radius||0,o=n.ignoreConnectors||["smooth"],l=this.graph,h=l.model.getEdges();if(h.length===1)return Ase(s$(t,e,r),i,s,a);const d=this.cell,f=h.indexOf(d),p=l.options.connecting.connector||{},g=h.filter((T,C)=>{const S=T.getConnector()||p;return o.includes(S.name)?!1:C>f?S.name!=="jumpover":!0}),m=g.map(T=>l.findViewByCell(T)),y=s$(t,e,r),v=m.map(T=>T==null?[]:T===this?y:s$(T.sourcePoint,T.targetPoint,T.routePoints)),x=[];y.forEach(T=>{const C=g.reduce((S,k,E)=>{if(k!==d){const A=Bst(T,v[E]);S.push(...A)}return S},[]).sort((S,k)=>Ese(T.start,S)-Ese(T.start,k));C.length>0?x.push(...Fst(T,C,i)):x.push(T)});const b=Ase(x,i,s,a);return WS=[],g9=[],n.raw?b:b.serialize()},Hst=(t,e,r,n={})=>{const i=r.length===3?0:1,s=Qe.create(r[0+i]),a=Qe.create(r[2+i]),o=Qe.create(r[1+i]);if(!Qe.equals(t,e)){const u=new Qe((t.x+e.x)/2,(t.y+e.y)/2),h=u.angleBetween(Qe.create(t).rotate(90,u),o);h>1&&(s.rotate(180-h,u),a.rotate(180-h,u),o.rotate(180-h,u))}const l=`@@ -1173,7 +1173,7 @@ Please report this to https://github.com/markedjs/marked.`,e){let i="<p>An errora${i},${s} 0,0,0 0,${n}l${-r},0`,"createCylinderPathD"),v3t=w((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"),b3t=w((t,e,r,n,i,s)=>[`M${t+r/2},${-n/2}`,`a${i},${s} 0,0,0 0,${n}`].join(" "),"createInnerCylinderPathD"),Nce=5,Dce=10;async function USe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?12:i/2;if(e.width||e.height){const m=e.height??0;e.height=(e.height??0)-s,e.height<Nce&&(e.height=Nce);const v=m/2/(2.5+m/50);e.width=(e.width??0)-s-v*3,e.width<Dce&&(e.width=Dce)}const{shapeSvg:a,bbox:o,label:l}=await Qr(t,e,Wr(e)),u=(e.height?e.height:o.height)+s,h=u/2,d=h/(2.5+u/50),f=(e.width?e.width:o.width)+d+s,{cssStyles:p}=e;let g;if(e.look==="handDrawn"){const m=dr.svg(a),y=v3t(0,0,f,u,d,h),v=b3t(0,0,f,u,d,h),x=m.path(y,fr(e,{})),b=m.path(v,fr(e,{fill:"none"}));g=a.insert(()=>b,":first-child"),g=a.insert(()=>x,":first-child"),g.attr("class","basic label-container"),p&&g.attr("style",p)}else{const m=y3t(0,0,f,u,d,h);g=a.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",Xa(p)).attr("style",n),g.attr("class","basic label-container outer-path"),p&&g.selectAll("path").attr("style",p),n&&g.selectAll("path").attr("style",n)}return g.attr("label-offset-x",d),g.attr("transform",`translate(${-f/2}, ${u/2} )`),l.attr("transform",`translate(${-(o.width/2)-d-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),Tr(e,g),e.intersect=function(m){const y=or.rect(e,m),v=y.y-(e.y??0);if(h!=0&&(Math.abs(v)<(e.height??0)/2||Math.abs(v)==(e.height??0)/2&&Math.abs(y.x-(e.x??0))>(e.width??0)/2-d)){let x=d*d*(1-v*v/(h*h));x!=0&&(x=Math.sqrt(Math.abs(x))),x=d-x,m.x-(e.x??0)>0&&(x=-x),y.x+=x}return y},a}w(USe,"tiltedCylinder");async function jSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=(e.look==="neo",i),a=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await Qr(t,e,Wr(e)),u=((e==null?void 0:e.height)??l.height)+s,h=((e==null?void 0:e.width)??l.width)+a,d=[{x:-3*u/6,y:0},{x:h+3*u/6,y:0},{x:h,y:-u},{x:0,y:-u}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=dr.svg(o),m=fr(e,{}),y=Fn(d),v=g.path(y,m);f=o.insert(()=>v,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=W0(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,Tr(e,f),e.intersect=function(g){return or.polygon(e,d,g)},o}w(jSe,"trapezoid");async function YSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?16:i,a=e.look==="neo"?12:i,o=15,l=5;(e.width||e.height)&&(e.height=(e.height??0)-a*2,e.height<l&&(e.height=l),e.width=(e.width??0)-s*2,e.width<o&&(e.width=o));const{shapeSvg:u,bbox:h}=await Qr(t,e,Wr(e)),d=(e!=null&&e.width?e==null?void 0:e.width:h.width)+s*2,f=(e!=null&&e.height?e==null?void 0:e.height:h.height)+a*2,{cssStyles:p}=e,g=dr.svg(u),m=fr(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-d/2*.8,y:-f/2},{x:d/2*.8,y:-f/2},{x:d/2,y:-f/2*.6},{x:d/2,y:f/2},{x:-d/2,y:f/2},{x:-d/2,y:-f/2*.6}],v=Fn(y),x=g.path(v,m),b=u.insert(()=>x,":first-child");return b.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),Tr(e,b),e.intersect=function(T){return or.polygon(e,y,T)},u}w(YSe,"trapezoidalPentagon");var Oce=10,Pce=10;async function XSe(t,e){var T;const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?i*2:i;(e.width||e.height)&&(e.width=(((e==null?void 0:e.width)??0)-s)/2,e.width<Pce&&(e.width=Pce),e.height=(e==null?void 0:e.height)??0,e.height<Oce&&(e.height=Oce));const{shapeSvg:a,bbox:o,label:l}=await Qr(t,e,Wr(e)),u=Wd((T=Ve().flowchart)==null?void 0:T.htmlLabels),h=(e!=null&&e.width?e==null?void 0:e.width:o.width)+s,d=e!=null&&e.height?e==null?void 0:e.height:h+o.height,f=d,p=[{x:0,y:0},{x:f,y:0},{x:f/2,y:-d}],{cssStyles:g}=e,m=dr.svg(a),y=fr(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=Fn(p),x=m.path(v,y),b=a.insert(()=>x,":first-child").attr("transform",`translate(${-d/2}, ${d/2})`).attr("class","outer-path");return g&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",g),n&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),e.width=h,e.height=d,Tr(e,b),l.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${d/2-(o.height+(e.padding??0)/(u?2:1)-(o.y-(o.top??0)))})`),e.intersect=function(C){return de.info("Triangle intersect",e,p,C),or.polygon(e,p,C)},a}w(XSe,"triangle");async function KSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?16:i,a=e.look==="neo"?12:i;let o=!0;(e.width||e.height)&&(o=!1,e.width=((e==null?void 0:e.width)??0)-s*2,e.width<10&&(e.width=10),e.height=((e==null?void 0:e.height)??0)-a*2,e.height<10&&(e.height=10));const{shapeSvg:l,bbox:u,label:h}=await Qr(t,e,Wr(e)),d=(e!=null&&e.width?e==null?void 0:e.width:u.width)+(s??0)*2,f=(e!=null&&e.height?e==null?void 0:e.height:u.height)+(a??0)*2,p=e.look==="neo"?f/4:f/8,g=f+(o?p:-p),{cssStyles:m}=e,v=14-d,x=v>0?v/2:0,b=dr.svg(l),T=fr(e,{});e.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const C=[{x:-d/2-x,y:g/2},...wg(-d/2-x,g/2,d/2+x,g/2,p,.8),{x:d/2+x,y:-g/2},{x:-d/2-x,y:-g/2}],S=Fn(C),k=b.path(S,T),E=l.insert(()=>k,":first-child");return E.attr("class","basic label-container outer-path"),m&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",m),n&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",n),E.attr("transform",`translate(0,${-p/2})`),h.attr("transform",`translate(${-d/2+(e.padding??0)-(u.x-(u.left??0))},${-f/2+(e.padding??0)-p-(u.y-(u.top??0))})`),Tr(e,E),e.intersect=function(A){return or.polygon(e,C,A)},l}w(KSe,"waveEdgedRectangle");async function ZSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?16:i,a=e.look==="neo"?20:i;if(e.width||e.height){e.width=(e==null?void 0:e.width)??0,e.width<20&&(e.width=20),e.height=(e==null?void 0:e.height)??0,e.height<10&&(e.height=10);const T=Math.min(e.height*.2,e.height/4);e.height=Math.ceil(e.height-a-T*(20/9)),e.width=e.width-s*2}const{shapeSvg:o,bbox:l}=await Qr(t,e,Wr(e)),u=(e!=null&&e.width?e==null?void 0:e.width:l.width)+s*2,h=(e!=null&&e.height?e==null?void 0:e.height:l.height)+a,d=h/8,f=h+d*2,{cssStyles:p}=e,g=dr.svg(o),m=fr(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-u/2,y:f/2},...wg(-u/2,f/2,u/2,f/2,d,1),{x:u/2,y:-f/2},...wg(u/2,-f/2,-u/2,-f/2,d,-1)],v=Fn(y),x=g.path(v,m),b=o.insert(()=>x,":first-child");return 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),Tr(e,b),e.intersect=function(T){return or.polygon(e,y,T)},o}w(ZSe,"waveRectangle");var As=10;async function QSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.look==="neo"?16:e.padding??0,s=e.look==="neo"?12:e.padding??0;(e.width||e.height)&&(e.width=Math.max(((e==null?void 0:e.width)??0)-i*2-As,10),e.height=Math.max(((e==null?void 0:e.height)??0)-s*2-As,10));const{shapeSvg:a,bbox:o,label:l}=await Qr(t,e,Wr(e)),u=(e!=null&&e.width?e==null?void 0:e.width:o.width)+i*2+As,h=(e!=null&&e.height?e==null?void 0:e.height:o.height)+s*2+As,d=u-As,f=h-As,p=-d/2,g=-f/2,{cssStyles:m}=e,y=dr.svg(a),v=fr(e,{}),x=[{x:p-As,y:g-As},{x:p-As,y:g+f},{x:p+d,y:g+f},{x:p+d,y:g-As}],b=`M${p-As},${g-As} L${p+d},${g-As} L${p+d},${g+f} L${p-As},${g+f} L${p-As},${g-As}M${p-As},${g} L${p+d},${g}- M${p},${g-As} L${p},${g+f}`;e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const T=y.path(b,v),C=a.insert(()=>T,":first-child");return C.attr("transform",`translate(${As/2}, ${As/2})`),C.attr("class","basic label-container outer-path"),m&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",m),n&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",n),l.attr("transform",`translate(${-(o.width/2)+As/2-(o.x-(o.left??0))}, ${-(o.height/2)+As/2-(o.y-(o.top??0))})`),Tr(e,C),e.intersect=function(S){return or.polygon(e,x,S)},a}w(QSe,"windowPane");var $ce=new Set(["redux-color","redux-dark-color"]),x3t=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function DZ(t,e){var K,q,oe,Q;const r=e;r.alias&&(e.label=r.alias);const{theme:n,themeVariables:i}=xr(),{rowEven:s,rowOdd:a,nodeBorder:o,borderColorArray:l}=i;if(e.look==="handDrawn"){const{themeVariables:Z}=xr(),{background:re}=Z,ie={...e,id:e.id+"-background",domId:(e.domId||e.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${re}`]};await DZ(t,ie)}const u=xr();e.useHtmlLabels=u.htmlLabels;let h=((K=u.er)==null?void 0:K.diagramPadding)??10,d=((q=u.er)==null?void 0:q.entityPadding)??6;const{cssStyles:f}=e,{labelStyles:p,nodeStyles:g}=cr(e);if(r.attributes.length===0&&e.label){const Z={rx:0,ry:0,labelPaddingX:h,labelPaddingY:h*1.5};Al(e.label,u)+Z.labelPaddingX*2<u.er.minEntityWidth&&(e.width=u.er.minEntityWidth);const re=await u3(t,e,Z);if(n!=null&&$ce.has(n)){const ie=r.colorIndex??0;re.attr("data-color-id",`color-${ie%l.length}`)}if(!Wd(u.htmlLabels)){const ie=re.select("text"),me=(oe=ie.node())==null?void 0:oe.getBBox();ie.attr("transform",`translate(${-me.width/2}, 0)`)}return re}u.htmlLabels||(h*=1.25,d*=1.25);let m=Wr(e);m||(m="node default");const y=t.insert("g").attr("class",m).attr("id",e.domId||e.id),v=await C2(y,e.label??"",u,0,0,["name"],p);v.height+=d;let x=0;const b=[],T=[];let C=0,S=0,k=0,E=0,A=!0,R=!0;for(const Z of r.attributes){const re=await C2(y,Z.type,u,0,x,["attribute-type"],p);C=Math.max(C,re.width+h);const ie=await C2(y,Z.name,u,0,x,["attribute-name"],p);S=Math.max(S,ie.width+h);const me=await C2(y,Z.keys.join(),u,0,x,["attribute-keys"],p);k=Math.max(k,me.width+h);const te=await C2(y,Z.comment,u,0,x,["attribute-comment"],p);E=Math.max(E,te.width+h);const _e=Math.max(re.height,ie.height,me.height,te.height)+d;T.push({yOffset:x,rowHeight:_e}),x+=_e}let _=4;k<=h&&(A=!1,k=0,_--),E<=h&&(R=!1,E=0,_--);const P=y.node().getBBox();if(v.width+h*2-(C+S+k+E)>0){const Z=v.width+h*2-(C+S+k+E);C+=Z/_,S+=Z/_,k>0&&(k+=Z/_),E>0&&(E+=Z/_)}const N=C+S+k+E,L=dr.svg(y),I=fr(e,{});e.look!=="handDrawn"&&(I.roughness=0,I.fillStyle="solid");let $=0;T.length>0&&($=T.reduce((Z,re)=>Z+((re==null?void 0:re.rowHeight)??0),0));const O=Math.max(P.width+h*2,(e==null?void 0:e.width)||0,N),D=Math.max(($??0)+v.height,(e==null?void 0:e.height)||0),F=-O/2,z=-D/2;if(y.selectAll("g:not(:first-child)").each((Z,re,ie)=>{const me=wt(ie[re]),te=me.attr("transform");let _e=0,$e=0;if(te){const ce=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(te);ce&&(_e=parseFloat(ce[1]),$e=parseFloat(ce[2]),me.attr("class").includes("attribute-name")?_e+=C:me.attr("class").includes("attribute-keys")?_e+=C+S:me.attr("class").includes("attribute-comment")&&(_e+=C+S+k))}me.attr("transform",`translate(${F+h/2+_e}, ${$e+z+v.height+d/2})`)}),y.select(".name").attr("transform","translate("+-v.width/2+", "+(z+d/2)+")"),n!=null&&$ce.has(n)){const Z=r.colorIndex??0;y.attr("data-color-id",`color-${Z%l.length}`)}const V=L.rectangle(F,z,O,D,I),B=y.insert(()=>V,":first-child").attr("class","outer-path").attr("style",f.join(""));b.push(0);for(const[Z,re]of T.entries()){const me=(Z+1)%2===0&&re.yOffset!==0,te=L.rectangle(F,v.height+z+(re==null?void 0:re.yOffset),O,re==null?void 0:re.rowHeight,{...I,fill:me?s:a,stroke:o});y.insert(()=>te,"g.label").attr("style",f.join("")).attr("class",`row-rect-${me?"even":"odd"}`)}const H=1e-4;let G=k2(F,v.height+z,O+F,v.height+z,H),W=L.polygon(G.map(Z=>[Z.x,Z.y]),I);if(y.insert(()=>W).attr("class","divider"),G=k2(C+F,v.height+z,C+F,D+z,H),W=L.polygon(G.map(Z=>[Z.x,Z.y]),I),y.insert(()=>W).attr("class","divider"),A){const Z=C+S+F;G=k2(Z,v.height+z,Z,D+z,H),W=L.polygon(G.map(re=>[re.x,re.y]),I),y.insert(()=>W).attr("class","divider")}if(R){const Z=C+S+k+F;G=k2(Z,v.height+z,Z,D+z,H),W=L.polygon(G.map(re=>[re.x,re.y]),I),y.insert(()=>W).attr("class","divider")}for(const Z of b){const re=v.height+z+Z;G=k2(F,re,O+F,re,H),W=L.polygon(G.map(ie=>[ie.x,ie.y]),I),y.insert(()=>W).attr("class","divider")}if(Tr(e,B),g&&e.look!=="handDrawn")if(n!=null&&x3t.has(n))y.selectAll("path").attr("style",g);else{const Z=g.split(";"),re=(Q=Z==null?void 0:Z.filter(ie=>ie.includes("stroke")))==null?void 0:Q.map(ie=>`${ie}`).join("; ");y.selectAll("path").attr("style",re??""),y.selectAll(".row-rect-even path").attr("style",g)}return e.intersect=function(Z){return or.rect(e,Z)},y}w(DZ,"erBox");async function C2(t,e,r,n=0,i=0,s=[],a=""){const o=t.insert("g").attr("class",`label ${s.join(" ")}`).attr("transform",`translate(${n}, ${i})`).attr("style",a);e!==Ep(e)&&(e=Ep(e),e=e.replaceAll("<","<").replaceAll(">",">"));const l=o.node().appendChild(await Qo(o,e,{width:Al(e,r)+100,style:a,useHtmlLabels:r.htmlLabels},r));if(e.includes("<")||e.includes(">")){let h=l.children[0];for(h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">");h.childNodes[0];)h=h.childNodes[0],h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">")}let u=l.getBBox();if(Wd(r.htmlLabels)){const h=l.children[0];h.style.textAlign="start";const d=wt(l);u=h.getBoundingClientRect(),d.attr("width",u.width),d.attr("height",u.height)}return u}w(C2,"addText");function k2(t,e,r,n,i){return t===r?[{x:t-i/2,y:e},{x:t+i/2,y:e},{x:r+i/2,y:n},{x:r-i/2,y:n}]:[{x:t,y:e-i/2},{x:t,y:e+i/2},{x:r,y:n+i/2},{x:r,y:n-i/2}]}w(k2,"lineToPolygon");async function JSe(t,e,r,n,i=r.class.padding??12){const s=n?0:3,a=t.insert("g").attr("class",Wr(e)).attr("id",e.domId||e.id);let o=null,l=null,u=null,h=null,d=0,f=0,p=0;if(o=a.insert("g").attr("class","annotation-group text"),e.annotations.length>0){const x=e.annotations[0];await KC(o,{text:`«${x}»`},0),d=o.node().getBBox().height}l=a.insert("g").attr("class","label-group text"),await KC(l,e,0,["font-weight: bolder"]);const g=l.node().getBBox();f=g.height,u=a.insert("g").attr("class","members-group text");let m=0;for(const x of e.members){const b=await KC(u,x,m,[x.parseClassifier()]);m+=b+s}p=u.node().getBBox().height,p<=0&&(p=i/2),h=a.insert("g").attr("class","methods-group text");let y=0;for(const x of e.methods){const b=await KC(h,x,y,[x.parseClassifier()]);y+=b+s}let v=a.node().getBBox();if(o!==null){const x=o.node().getBBox();o.attr("transform",`translate(${-x.width/2})`)}return l.attr("transform",`translate(${-g.width/2}, ${d})`),v=a.node().getBBox(),u.attr("transform",`translate(0, ${d+f+i*2})`),v=a.node().getBBox(),h.attr("transform",`translate(0, ${d+f+(p?p+i*4:i*2)})`),v=a.node().getBBox(),{shapeSvg:a,bbox:v}}w(JSe,"textHelper");async function KC(t,e,r,n=[]){const i=t.insert("g").attr("class","label").attr("style",n.join("; ")),s=xr();let a="useHtmlLabels"in e?e.useHtmlLabels:Wd(s.htmlLabels)??!0,o="";"text"in e?o=e.text:o=e.label,!a&&o.startsWith("\\")&&(o=o.substring(1)),Ks(o)&&(a=!0);const l=await Qo(i,PK(m0(o)),{width:Al(o,s)+50,classes:"markdown-node-label",useHtmlLabels:a},s);let u,h=1;if(a){const d=l.children[0],f=wt(l);h=d.innerHTML.split("<br>").length,d.innerHTML.includes("</math>")&&(h+=d.innerHTML.split("<mrow>").length-1);const p=d.getElementsByTagName("img");if(p){const g=o.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...p].map(m=>new Promise(y=>{function v(){var x;if(m.style.display="flex",m.style.flexDirection="column",g){const b=((x=s.fontSize)==null?void 0:x.toString())??window.getComputedStyle(document.body).fontSize,C=parseInt(b,10)*5+"px";m.style.minWidth=C,m.style.maxWidth=C}else m.style.width="100%";y(m)}w(v,"setupImage"),setTimeout(()=>{m.complete&&v()}),m.addEventListener("error",v),m.addEventListener("load",v)})))}u=d.getBoundingClientRect(),f.attr("width",u.width),f.attr("height",u.height)}else{n.includes("font-weight: bolder")&&wt(l).selectAll("tspan").attr("font-weight",""),h=l.children.length;const d=l.children[0];(l.textContent===""||l.textContent.includes(">"))&&(d.textContent=o[0]+o.substring(1).replaceAll(">",">").replaceAll("<","<").trim(),o[1]===" "&&(d.textContent=d.textContent[0]+" "+d.textContent.substring(1))),d.textContent==="undefined"&&(d.textContent=""),u=l.getBBox()}return i.attr("transform","translate(0,"+(-u.height/(2*h)+r)+")"),u.height}w(KC,"addText");async function eEe(t,e){var L,I;const r=Ve(),{themeVariables:n}=r,{useGradient:i}=n,s=r.class.padding??12,a=s,o=e.useHtmlLabels??Wd(r.htmlLabels)??!0,l=e;l.annotations=l.annotations??[],l.members=l.members??[],l.methods=l.methods??[];const{shapeSvg:u,bbox:h}=await JSe(t,e,r,o,a),{labelStyles:d,nodeStyles:f}=cr(e);e.labelStyle=d,e.cssStyles=l.styles||"";const p=((L=l.styles)==null?void 0:L.join(";"))||f||"";e.cssStyles||(e.cssStyles=p.replaceAll("!important","").split(";"));const g=l.members.length===0&&l.methods.length===0&&!((I=r.class)!=null&&I.hideEmptyMembersBox),m=dr.svg(u),y=fr(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=Math.max(e.width??0,h.width);let x=Math.max(e.height??0,h.height);const b=(e.height??0)>h.height;l.members.length===0&&l.methods.length===0?x+=a:l.members.length>0&&l.methods.length===0&&(x+=a*2);const T=-v/2,C=-x/2;let S=g?s*2:l.members.length===0&&l.methods.length===0?-s:0;b&&(S=s*2);const k=m.rectangle(T-s,C-s-(g?s:l.members.length===0&&l.methods.length===0?-s/2:0),v+2*s,x+2*s+S,y),E=u.insert(()=>k,":first-child");E.attr("class","basic label-container outer-path");const A=E.node().getBBox(),R=u.select(".annotation-group").node().getBBox().height-(g?s/2:0)||0,_=u.select(".label-group").node().getBBox().height-(g?s/2:0)||0,P=u.select(".members-group").node().getBBox().height-(g?s/2:0)||0,N=(R+_+C+s-(C-s-(g?s:l.members.length===0&&l.methods.length===0?-s/2:0)))/2;if(u.selectAll(".text").each(($,O,D)=>{var G,W;const F=wt(D[O]),z=F.attr("transform");let V=0;if(z){const q=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(z);q&&(V=parseFloat(q[2]))}let B=V+C+s-(g?s:l.members.length===0&&l.methods.length===0?-s/2:0);if(F.attr("class").includes("methods-group")){const K=Math.max(P,a/2);b?B=Math.max(N,R+_+K+C+a*2+s)+a*2:B=R+_+K+C+a*4+s}l.members.length===0&&l.methods.length===0&&((G=r.class)!=null&&G.hideEmptyMembersBox)&&(l.annotations.length>0?B=V-a:B=V),o||(B-=4);let H=T;(F.attr("class").includes("label-group")||F.attr("class").includes("annotation-group"))&&(H=-((W=F.node())==null?void 0:W.getBBox().width)/2||0,u.selectAll("text").each(function(K,q,oe){window.getComputedStyle(oe[q]).textAnchor==="middle"&&(H=0)})),F.attr("transform",`translate(${H}, ${B})`)}),l.members.length>0||l.methods.length>0||g){const $=R+_+C+s,O=m.line(A.x,$,A.x+A.width,$+.001,y);u.insert(()=>O).attr("class",`divider${e.look==="neo"&&!i?" neo-line":""}`).attr("style",p)}if(g||l.members.length>0||l.methods.length>0){const $=R+_+P+C+a*2+s,O=m.line(A.x,b?Math.max(N,$):$,A.x+A.width,(b?Math.max(N,$):$)+.001,y);u.insert(()=>O).attr("class",`divider${e.look==="neo"&&!i?" neo-line":""}`).attr("style",p)}if(l.look!=="handDrawn"&&u.selectAll("path").attr("style",p),E.select(":nth-child(2)").attr("style",p),u.selectAll(".divider").select("path").attr("style",p),e.labelStyle?u.selectAll("span").attr("style",e.labelStyle):u.selectAll("span").attr("style",p),!o){const $=RegExp(/color\s*:\s*([^;]*)/),O=$.exec(p);if(O){const D=O[0].replace("color","fill");u.selectAll("tspan").attr("style",D)}else if(d){const D=$.exec(d);if(D){const F=D[0].replace("color","fill");u.selectAll("tspan").attr("style",F)}}}return Tr(e,E),e.intersect=function($){return or.rect(e,$)},u}w(eEe,"classBox");async function tEe(t,e){var A,R;const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e,s=e,a=20,o=20,l="verifyMethod"in e,u=Wr(e),{themeVariables:h}=Ve(),{borderColorArray:d,requirementEdgeLabelBackground:f}=h,p=t.insert("g").attr("class",u).attr("id",e.domId??e.id);let g;l?g=await Uh(p,`<<${i.type}>>`,0,e.labelStyle):g=await Uh(p,"<<Element>>",0,e.labelStyle);let m=g;const y=await Uh(p,i.name,m,e.labelStyle+"; font-weight: bold;");if(m+=y+o,l){const _=await Uh(p,`${i.requirementId?`ID: ${i.requirementId}`:""}`,m,e.labelStyle);m+=_;const P=await Uh(p,`${i.text?`Text: ${i.text}`:""}`,m,e.labelStyle);m+=P;const N=await Uh(p,`${i.risk?`Risk: ${i.risk}`:""}`,m,e.labelStyle);m+=N,await Uh(p,`${i.verifyMethod?`Verification: ${i.verifyMethod}`:""}`,m,e.labelStyle)}else{const _=await Uh(p,`${s.type?`Type: ${s.type}`:""}`,m,e.labelStyle);m+=_,await Uh(p,`${s.docRef?`Doc Ref: ${s.docRef}`:""}`,m,e.labelStyle)}const v=(((A=p.node())==null?void 0:A.getBBox().width)??200)+a,x=(((R=p.node())==null?void 0:R.getBBox().height)??200)+a,b=-v/2,T=-x/2,C=dr.svg(p),S=fr(e,{});e.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");const k=C.rectangle(b,T,v,x,S),E=p.insert(()=>k,":first-child");if(E.attr("class","basic label-container outer-path").attr("style",n),d!=null&&d.length){const _=e.colorIndex??0;p.attr("data-color-id",`color-${_%d.length}`)}if(p.selectAll(".label").each((_,P,N)=>{const L=wt(N[P]),I=L.attr("transform");let $=0,O=0;if(I){const V=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(I);V&&($=parseFloat(V[1]),O=parseFloat(V[2]))}const D=O-x/2;let F=b+a/2;(P===0||P===1)&&(F=$),L.attr("transform",`translate(${F}, ${D+a})`)}),m>g+y+o){const _=T+g+y+o;let P;if(e.look==="neo"){const I=[[b,_],[b+v,_],[b+v,_+.001],[b,_+.001]];P=C.polygon(I,S)}else P=C.line(b,_,b+v,_,S);p.insert(()=>P).attr("class","divider")}return Tr(e,E),e.intersect=function(_){return or.rect(e,_)},n&&e.look!=="handDrawn"&&(f||d!=null&&d.length)&&p.selectAll("path").attr("style",n),p}w(tEe,"requirementBox");async function Uh(t,e,r,n=""){if(e==="")return 0;const i=t.insert("g").attr("class","label").attr("style",n),s=Ve(),a=s.htmlLabels??!0,o=await Qo(i,PK(m0(e)),{width:Al(e,s)+50,classes:"markdown-node-label",useHtmlLabels:a,style:n},s);let l;if(a){const u=o.children[0],h=wt(o);l=u.getBoundingClientRect(),h.attr("width",l.width),h.attr("height",l.height)}else{const u=o.children[0];for(const h of u.children)n&&h.setAttribute("style",n);l=o.getBBox(),l.height+=6}return i.attr("transform",`translate(${-l.width/2},${-l.height/2+r})`),l.height}w(Uh,"addText");var w3t=w(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 rEe(t,e,{config:r}){var P,N;const{labelStyles:n,nodeStyles:i}=cr(e);e.labelStyle=n||"";const s=10,a=e.width;e.width=(e.width??200)-10;const{shapeSvg:o,bbox:l,label:u}=await Qr(t,e,Wr(e)),h=e.padding||10;let d="",f;"ticket"in e&&e.ticket&&((P=r==null?void 0:r.kanban)!=null&&P.ticketBaseUrl)&&(d=(N=r==null?void 0:r.kanban)==null?void 0:N.ticketBaseUrl.replace("#TICKET#",e.ticket),f=o.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",d).attr("target","_blank"));const p={useHtmlLabels:e.useHtmlLabels,labelStyle:e.labelStyle||"",width:e.width,img:e.img,padding:e.padding||8,centerLabel:!1};let g,m;f?{label:g,bbox:m}=await hB(f,"ticket"in e&&e.ticket||"",p):{label:g,bbox:m}=await hB(o,"ticket"in e&&e.ticket||"",p);const{label:y,bbox:v}=await hB(o,"assigned"in e&&e.assigned||"",p);e.width=a;const x=10,b=(e==null?void 0:e.width)||0,T=Math.max(m.height,v.height)/2,C=Math.max(l.height+x*2,(e==null?void 0:e.height)||0)+T,S=-b/2,k=-C/2;u.attr("transform","translate("+(h-b/2)+", "+(-T-l.height/2)+")"),g.attr("transform","translate("+(h-b/2)+", "+(-T+l.height/2)+")"),y.attr("transform","translate("+(h+b/2-v.width-2*s)+", "+(-T+l.height/2)+")");let E;const{rx:A,ry:R}=e,{cssStyles:_}=e;if(e.look==="handDrawn"){const L=dr.svg(o),I=fr(e,{}),$=A||R?L.path(Jg(S,k,b,C,A||0),I):L.rectangle(S,k,b,C,I);E=o.insert(()=>$,":first-child"),E.attr("class","basic label-container").attr("style",_||null)}else{E=o.insert("rect",":first-child"),E.attr("class","basic label-container __APA__").attr("style",i).attr("rx",A??5).attr("ry",R??5).attr("x",S).attr("y",k).attr("width",b).attr("height",C);const L="priority"in e&&e.priority;if(L){const I=o.append("line"),$=S+2,O=k+Math.floor((A??0)/2),D=k+C-Math.floor((A??0)/2);I.attr("x1",$).attr("y1",O).attr("x2",$).attr("y2",D).attr("stroke-width","4").attr("stroke",w3t(L))}}return Tr(e,E),e.height=C,e.intersect=function(L){return or.rect(e,L)},o}w(rEe,"kanbanItem");async function nEe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const{shapeSvg:i,bbox:s,halfPadding:a,label:o}=await Qr(t,e,Wr(e)),l=s.width+10*a,u=s.height+8*a,h=.15*l,{cssStyles:d}=e,f=s.width+20,p=s.height+20,g=Math.max(l,f),m=Math.max(u,p);o.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`);let y;const v=`M0 0+ M${p},${g-As} L${p},${g+f}`;e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const T=y.path(b,v),C=a.insert(()=>T,":first-child");return C.attr("transform",`translate(${As/2}, ${As/2})`),C.attr("class","basic label-container outer-path"),m&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",m),n&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",n),l.attr("transform",`translate(${-(o.width/2)+As/2-(o.x-(o.left??0))}, ${-(o.height/2)+As/2-(o.y-(o.top??0))})`),Tr(e,C),e.intersect=function(S){return or.polygon(e,x,S)},a}w(QSe,"windowPane");var $ce=new Set(["redux-color","redux-dark-color"]),x3t=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function DZ(t,e){var K,q,oe,Q;const r=e;r.alias&&(e.label=r.alias);const{theme:n,themeVariables:i}=xr(),{rowEven:s,rowOdd:a,nodeBorder:o,borderColorArray:l}=i;if(e.look==="handDrawn"){const{themeVariables:Z}=xr(),{background:re}=Z,ie={...e,id:e.id+"-background",domId:(e.domId||e.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${re}`]};await DZ(t,ie)}const u=xr();e.useHtmlLabels=u.htmlLabels;let h=((K=u.er)==null?void 0:K.diagramPadding)??10,d=((q=u.er)==null?void 0:q.entityPadding)??6;const{cssStyles:f}=e,{labelStyles:p,nodeStyles:g}=cr(e);if(r.attributes.length===0&&e.label){const Z={rx:0,ry:0,labelPaddingX:h,labelPaddingY:h*1.5};Al(e.label,u)+Z.labelPaddingX*2<u.er.minEntityWidth&&(e.width=u.er.minEntityWidth);const re=await u3(t,e,Z);if(n!=null&&$ce.has(n)){const ie=r.colorIndex??0;re.attr("data-color-id",`color-${ie%l.length}`)}if(!Wd(u.htmlLabels)){const ie=re.select("text"),me=(oe=ie.node())==null?void 0:oe.getBBox();ie.attr("transform",`translate(${-me.width/2}, 0)`)}return re}u.htmlLabels||(h*=1.25,d*=1.25);let m=Wr(e);m||(m="node default");const y=t.insert("g").attr("class",m).attr("id",e.domId||e.id),v=await C2(y,e.label??"",u,0,0,["name"],p);v.height+=d;let x=0;const b=[],T=[];let C=0,S=0,k=0,E=0,A=!0,R=!0;for(const Z of r.attributes){const re=await C2(y,Z.type,u,0,x,["attribute-type"],p);C=Math.max(C,re.width+h);const ie=await C2(y,Z.name,u,0,x,["attribute-name"],p);S=Math.max(S,ie.width+h);const me=await C2(y,Z.keys.join(),u,0,x,["attribute-keys"],p);k=Math.max(k,me.width+h);const te=await C2(y,Z.comment,u,0,x,["attribute-comment"],p);E=Math.max(E,te.width+h);const _e=Math.max(re.height,ie.height,me.height,te.height)+d;T.push({yOffset:x,rowHeight:_e}),x+=_e}let _=4;k<=h&&(A=!1,k=0,_--),E<=h&&(R=!1,E=0,_--);const P=y.node().getBBox();if(v.width+h*2-(C+S+k+E)>0){const Z=v.width+h*2-(C+S+k+E);C+=Z/_,S+=Z/_,k>0&&(k+=Z/_),E>0&&(E+=Z/_)}const N=C+S+k+E,L=dr.svg(y),I=fr(e,{});e.look!=="handDrawn"&&(I.roughness=0,I.fillStyle="solid");let $=0;T.length>0&&($=T.reduce((Z,re)=>Z+((re==null?void 0:re.rowHeight)??0),0));const O=Math.max(P.width+h*2,(e==null?void 0:e.width)||0,N),D=Math.max(($??0)+v.height,(e==null?void 0:e.height)||0),F=-O/2,z=-D/2;if(y.selectAll("g:not(:first-child)").each((Z,re,ie)=>{const me=wt(ie[re]),te=me.attr("transform");let _e=0,$e=0;if(te){const ce=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(te);ce&&(_e=parseFloat(ce[1]),$e=parseFloat(ce[2]),me.attr("class").includes("attribute-name")?_e+=C:me.attr("class").includes("attribute-keys")?_e+=C+S:me.attr("class").includes("attribute-comment")&&(_e+=C+S+k))}me.attr("transform",`translate(${F+h/2+_e}, ${$e+z+v.height+d/2})`)}),y.select(".name").attr("transform","translate("+-v.width/2+", "+(z+d/2)+")"),n!=null&&$ce.has(n)){const Z=r.colorIndex??0;y.attr("data-color-id",`color-${Z%l.length}`)}const V=L.rectangle(F,z,O,D,I),B=y.insert(()=>V,":first-child").attr("class","outer-path").attr("style",f.join(""));b.push(0);for(const[Z,re]of T.entries()){const me=(Z+1)%2===0&&re.yOffset!==0,te=L.rectangle(F,v.height+z+(re==null?void 0:re.yOffset),O,re==null?void 0:re.rowHeight,{...I,fill:me?s:a,stroke:o});y.insert(()=>te,"g.label").attr("style",f.join("")).attr("class",`row-rect-${me?"even":"odd"}`)}const H=1e-4;let G=k2(F,v.height+z,O+F,v.height+z,H),W=L.polygon(G.map(Z=>[Z.x,Z.y]),I);if(y.insert(()=>W).attr("class","divider"),G=k2(C+F,v.height+z,C+F,D+z,H),W=L.polygon(G.map(Z=>[Z.x,Z.y]),I),y.insert(()=>W).attr("class","divider"),A){const Z=C+S+F;G=k2(Z,v.height+z,Z,D+z,H),W=L.polygon(G.map(re=>[re.x,re.y]),I),y.insert(()=>W).attr("class","divider")}if(R){const Z=C+S+k+F;G=k2(Z,v.height+z,Z,D+z,H),W=L.polygon(G.map(re=>[re.x,re.y]),I),y.insert(()=>W).attr("class","divider")}for(const Z of b){const re=v.height+z+Z;G=k2(F,re,O+F,re,H),W=L.polygon(G.map(ie=>[ie.x,ie.y]),I),y.insert(()=>W).attr("class","divider")}if(Tr(e,B),g&&e.look!=="handDrawn")if(n!=null&&x3t.has(n))y.selectAll("path").attr("style",g);else{const Z=g.split(";"),re=(Q=Z==null?void 0:Z.filter(ie=>ie.includes("stroke")))==null?void 0:Q.map(ie=>`${ie}`).join("; ");y.selectAll("path").attr("style",re??""),y.selectAll(".row-rect-even path").attr("style",g)}return e.intersect=function(Z){return or.rect(e,Z)},y}w(DZ,"erBox");async function C2(t,e,r,n=0,i=0,s=[],a=""){const o=t.insert("g").attr("class",`label ${s.join(" ")}`).attr("transform",`translate(${n}, ${i})`).attr("style",a);e!==Ep(e)&&(e=Ep(e),e=e.replaceAll("<","<").replaceAll(">",">"));const l=o.node().appendChild(await Qo(o,e,{width:Al(e,r)+100,style:a,useHtmlLabels:r.htmlLabels},r));if(e.includes("<")||e.includes(">")){let h=l.children[0];for(h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">");h.childNodes[0];)h=h.childNodes[0],h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">")}let u=l.getBBox();if(Wd(r.htmlLabels)){const h=l.children[0];h.style.textAlign="start";const d=wt(l);u=h.getBoundingClientRect(),d.attr("width",u.width),d.attr("height",u.height)}return u}w(C2,"addText");function k2(t,e,r,n,i){return t===r?[{x:t-i/2,y:e},{x:t+i/2,y:e},{x:r+i/2,y:n},{x:r-i/2,y:n}]:[{x:t,y:e-i/2},{x:t,y:e+i/2},{x:r,y:n+i/2},{x:r,y:n-i/2}]}w(k2,"lineToPolygon");async function JSe(t,e,r,n,i=r.class.padding??12){const s=n?0:3,a=t.insert("g").attr("class",Wr(e)).attr("id",e.domId||e.id);let o=null,l=null,u=null,h=null,d=0,f=0,p=0;if(o=a.insert("g").attr("class","annotation-group text"),e.annotations.length>0){const x=e.annotations[0];await KC(o,{text:`«${x}»`},0),d=o.node().getBBox().height}l=a.insert("g").attr("class","label-group text"),await KC(l,e,0,["font-weight: bolder"]);const g=l.node().getBBox();f=g.height,u=a.insert("g").attr("class","members-group text");let m=0;for(const x of e.members){const b=await KC(u,x,m,[x.parseClassifier()]);m+=b+s}p=u.node().getBBox().height,p<=0&&(p=i/2),h=a.insert("g").attr("class","methods-group text");let y=0;for(const x of e.methods){const b=await KC(h,x,y,[x.parseClassifier()]);y+=b+s}let v=a.node().getBBox();if(o!==null){const x=o.node().getBBox();o.attr("transform",`translate(${-x.width/2})`)}return l.attr("transform",`translate(${-g.width/2}, ${d})`),v=a.node().getBBox(),u.attr("transform",`translate(0, ${d+f+i*2})`),v=a.node().getBBox(),h.attr("transform",`translate(0, ${d+f+(p?p+i*4:i*2)})`),v=a.node().getBBox(),{shapeSvg:a,bbox:v}}w(JSe,"textHelper");async function KC(t,e,r,n=[]){const i=t.insert("g").attr("class","label").attr("style",n.join("; ")),s=xr();let a="useHtmlLabels"in e?e.useHtmlLabels:Wd(s.htmlLabels)??!0,o="";"text"in e?o=e.text:o=e.label,!a&&o.startsWith("\\")&&(o=o.substring(1)),Ks(o)&&(a=!0);const l=await Qo(i,PK(m0(o)),{width:Al(o,s)+50,classes:"markdown-node-label",useHtmlLabels:a},s);let u,h=1;if(a){const d=l.children[0],f=wt(l);h=d.innerHTML.split("<br>").length,d.innerHTML.includes("</math>")&&(h+=d.innerHTML.split("<mrow>").length-1);const p=d.getElementsByTagName("img");if(p){const g=o.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...p].map(m=>new Promise(y=>{function v(){var x;if(m.style.display="flex",m.style.flexDirection="column",g){const b=((x=s.fontSize)==null?void 0:x.toString())??window.getComputedStyle(document.body).fontSize,C=parseInt(b,10)*5+"px";m.style.minWidth=C,m.style.maxWidth=C}else m.style.width="100%";y(m)}w(v,"setupImage"),setTimeout(()=>{m.complete&&v()}),m.addEventListener("error",v),m.addEventListener("load",v)})))}u=d.getBoundingClientRect(),f.attr("width",u.width),f.attr("height",u.height)}else{n.includes("font-weight: bolder")&&wt(l).selectAll("tspan").attr("font-weight",""),h=l.children.length;const d=l.children[0];(l.textContent===""||l.textContent.includes(">"))&&(d.textContent=o[0]+o.substring(1).replaceAll(">",">").replaceAll("<","<").trim(),o[1]===" "&&(d.textContent=d.textContent[0]+" "+d.textContent.substring(1))),d.textContent==="undefined"&&(d.textContent=""),u=l.getBBox()}return i.attr("transform","translate(0,"+(-u.height/(2*h)+r)+")"),u.height}w(KC,"addText");async function eEe(t,e){var L,I;const r=Ve(),{themeVariables:n}=r,{useGradient:i}=n,s=r.class.padding??12,a=s,o=e.useHtmlLabels??Wd(r.htmlLabels)??!0,l=e;l.annotations=l.annotations??[],l.members=l.members??[],l.methods=l.methods??[];const{shapeSvg:u,bbox:h}=await JSe(t,e,r,o,a),{labelStyles:d,nodeStyles:f}=cr(e);e.labelStyle=d,e.cssStyles=l.styles||"";const p=((L=l.styles)==null?void 0:L.join(";"))||f||"";e.cssStyles||(e.cssStyles=p.replaceAll("!important","").split(";"));const g=l.members.length===0&&l.methods.length===0&&!((I=r.class)!=null&&I.hideEmptyMembersBox),m=dr.svg(u),y=fr(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=Math.max(e.width??0,h.width);let x=Math.max(e.height??0,h.height);const b=(e.height??0)>h.height;l.members.length===0&&l.methods.length===0?x+=a:l.members.length>0&&l.methods.length===0&&(x+=a*2);const T=-v/2,C=-x/2;let S=g?s*2:l.members.length===0&&l.methods.length===0?-s:0;b&&(S=s*2);const k=m.rectangle(T-s,C-s-(g?s:l.members.length===0&&l.methods.length===0?-s/2:0),v+2*s,x+2*s+S,y),E=u.insert(()=>k,":first-child");E.attr("class","basic label-container outer-path");const A=E.node().getBBox(),R=u.select(".annotation-group").node().getBBox().height-(g?s/2:0)||0,_=u.select(".label-group").node().getBBox().height-(g?s/2:0)||0,P=u.select(".members-group").node().getBBox().height-(g?s/2:0)||0,N=(R+_+C+s-(C-s-(g?s:l.members.length===0&&l.methods.length===0?-s/2:0)))/2;if(u.selectAll(".text").each(($,O,D)=>{var G,W;const F=wt(D[O]),z=F.attr("transform");let V=0;if(z){const q=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(z);q&&(V=parseFloat(q[2]))}let B=V+C+s-(g?s:l.members.length===0&&l.methods.length===0?-s/2:0);if(F.attr("class").includes("methods-group")){const K=Math.max(P,a/2);b?B=Math.max(N,R+_+K+C+a*2+s)+a*2:B=R+_+K+C+a*4+s}l.members.length===0&&l.methods.length===0&&((G=r.class)!=null&&G.hideEmptyMembersBox)&&(l.annotations.length>0?B=V-a:B=V),o||(B-=4);let H=T;(F.attr("class").includes("label-group")||F.attr("class").includes("annotation-group"))&&(H=-((W=F.node())==null?void 0:W.getBBox().width)/2||0,u.selectAll("text").each(function(K,q,oe){window.getComputedStyle(oe[q]).textAnchor==="middle"&&(H=0)})),F.attr("transform",`translate(${H}, ${B})`)}),l.members.length>0||l.methods.length>0||g){const $=R+_+C+s,O=m.line(A.x,$,A.x+A.width,$+.001,y);u.insert(()=>O).attr("class",`divider${e.look==="neo"&&!i?" neo-line":""}`).attr("style",p)}if(g||l.members.length>0||l.methods.length>0){const $=R+_+P+C+a*2+s,O=m.line(A.x,b?Math.max(N,$):$,A.x+A.width,(b?Math.max(N,$):$)+.001,y);u.insert(()=>O).attr("class",`divider${e.look==="neo"&&!i?" neo-line":""}`).attr("style",p)}if(l.look!=="handDrawn"&&u.selectAll("path").attr("style",p),E.select(":nth-child(2)").attr("style",p),u.selectAll(".divider").select("path").attr("style",p),e.labelStyle?u.selectAll("span").attr("style",e.labelStyle):u.selectAll("span").attr("style",p),!o){const $=RegExp(/color\s*:\s*([^;]*)/),O=$.exec(p);if(O){const D=O[0].replace("color","fill");u.selectAll("tspan").attr("style",D)}else if(d){const D=$.exec(d);if(D){const F=D[0].replace("color","fill");u.selectAll("tspan").attr("style",F)}}}return Tr(e,E),e.intersect=function($){return or.rect(e,$)},u}w(eEe,"classBox");async function tEe(t,e){var A,R;const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e,s=e,a=20,o=20,l="verifyMethod"in e,u=Wr(e),{themeVariables:h}=Ve(),{borderColorArray:d,requirementEdgeLabelBackground:f}=h,p=t.insert("g").attr("class",u).attr("id",e.domId??e.id);let g;l?g=await Uh(p,`<<${i.type}>>`,0,e.labelStyle):g=await Uh(p,"<<Element>>",0,e.labelStyle);let m=g;const y=await Uh(p,i.name,m,e.labelStyle+"; font-weight: bold;");if(m+=y+o,l){const _=await Uh(p,`${i.requirementId?`ID: ${i.requirementId}`:""}`,m,e.labelStyle);m+=_;const P=await Uh(p,`${i.text?`Text: ${i.text}`:""}`,m,e.labelStyle);m+=P;const N=await Uh(p,`${i.risk?`Risk: ${i.risk}`:""}`,m,e.labelStyle);m+=N,await Uh(p,`${i.verifyMethod?`Verification: ${i.verifyMethod}`:""}`,m,e.labelStyle)}else{const _=await Uh(p,`${s.type?`Type: ${s.type}`:""}`,m,e.labelStyle);m+=_,await Uh(p,`${s.docRef?`Doc Ref: ${s.docRef}`:""}`,m,e.labelStyle)}const v=(((A=p.node())==null?void 0:A.getBBox().width)??200)+a,x=(((R=p.node())==null?void 0:R.getBBox().height)??200)+a,b=-v/2,T=-x/2,C=dr.svg(p),S=fr(e,{});e.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");const k=C.rectangle(b,T,v,x,S),E=p.insert(()=>k,":first-child");if(E.attr("class","basic label-container outer-path").attr("style",n),d!=null&&d.length){const _=e.colorIndex??0;p.attr("data-color-id",`color-${_%d.length}`)}if(p.selectAll(".label").each((_,P,N)=>{const L=wt(N[P]),I=L.attr("transform");let $=0,O=0;if(I){const V=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(I);V&&($=parseFloat(V[1]),O=parseFloat(V[2]))}const D=O-x/2;let F=b+a/2;(P===0||P===1)&&(F=$),L.attr("transform",`translate(${F}, ${D+a})`)}),m>g+y+o){const _=T+g+y+o;let P;if(e.look==="neo"){const I=[[b,_],[b+v,_],[b+v,_+.001],[b,_+.001]];P=C.polygon(I,S)}else P=C.line(b,_,b+v,_,S);p.insert(()=>P).attr("class","divider")}return Tr(e,E),e.intersect=function(_){return or.rect(e,_)},n&&e.look!=="handDrawn"&&(f||d!=null&&d.length)&&p.selectAll("path").attr("style",n),p}w(tEe,"requirementBox");async function Uh(t,e,r,n=""){if(e==="")return 0;const i=t.insert("g").attr("class","label").attr("style",n),s=Ve(),a=s.htmlLabels??!0,o=await Qo(i,PK(m0(e)),{width:Al(e,s)+50,classes:"markdown-node-label",useHtmlLabels:a,style:n},s);let l;if(a){const u=o.children[0],h=wt(o);l=u.getBoundingClientRect(),h.attr("width",l.width),h.attr("height",l.height)}else{const u=o.children[0];for(const h of u.children)n&&h.setAttribute("style",n);l=o.getBBox(),l.height+=6}return i.attr("transform",`translate(${-l.width/2},${-l.height/2+r})`),l.height}w(Uh,"addText");var w3t=w(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 rEe(t,e,{config:r}){var P,N;const{labelStyles:n,nodeStyles:i}=cr(e);e.labelStyle=n||"";const s=10,a=e.width;e.width=(e.width??200)-10;const{shapeSvg:o,bbox:l,label:u}=await Qr(t,e,Wr(e)),h=e.padding||10;let d="",f;"ticket"in e&&e.ticket&&((P=r==null?void 0:r.kanban)!=null&&P.ticketBaseUrl)&&(d=(N=r==null?void 0:r.kanban)==null?void 0:N.ticketBaseUrl.replace("#TICKET#",e.ticket),f=o.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",d).attr("target","_blank"));const p={useHtmlLabels:e.useHtmlLabels,labelStyle:e.labelStyle||"",width:e.width,img:e.img,padding:e.padding||8,centerLabel:!1};let g,m;f?{label:g,bbox:m}=await hB(f,"ticket"in e&&e.ticket||"",p):{label:g,bbox:m}=await hB(o,"ticket"in e&&e.ticket||"",p);const{label:y,bbox:v}=await hB(o,"assigned"in e&&e.assigned||"",p);e.width=a;const x=10,b=(e==null?void 0:e.width)||0,T=Math.max(m.height,v.height)/2,C=Math.max(l.height+x*2,(e==null?void 0:e.height)||0)+T,S=-b/2,k=-C/2;u.attr("transform","translate("+(h-b/2)+", "+(-T-l.height/2)+")"),g.attr("transform","translate("+(h-b/2)+", "+(-T+l.height/2)+")"),y.attr("transform","translate("+(h+b/2-v.width-2*s)+", "+(-T+l.height/2)+")");let E;const{rx:A,ry:R}=e,{cssStyles:_}=e;if(e.look==="handDrawn"){const L=dr.svg(o),I=fr(e,{}),$=A||R?L.path(Jg(S,k,b,C,A||0),I):L.rectangle(S,k,b,C,I);E=o.insert(()=>$,":first-child"),E.attr("class","basic label-container").attr("style",_||null)}else{E=o.insert("rect",":first-child"),E.attr("class","basic label-container __APA__").attr("style",i).attr("rx",A??5).attr("ry",R??5).attr("x",S).attr("y",k).attr("width",b).attr("height",C);const L="priority"in e&&e.priority;if(L){const I=o.append("line"),$=S+2,O=k+Math.floor((A??0)/2),D=k+C-Math.floor((A??0)/2);I.attr("x1",$).attr("y1",O).attr("x2",$).attr("y2",D).attr("stroke-width","4").attr("stroke",w3t(L))}}return Tr(e,E),e.height=C,e.intersect=function(L){return or.rect(e,L)},o}w(rEe,"kanbanItem");async function nEe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const{shapeSvg:i,bbox:s,halfPadding:a,label:o}=await Qr(t,e,Wr(e)),l=s.width+10*a,u=s.height+8*a,h=.15*l,{cssStyles:d}=e,f=s.width+20,p=s.height+20,g=Math.max(l,f),m=Math.max(u,p);o.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`);let y;const v=`M0 0a${h},${h} 1 0,0 ${g*.25},${-1*m*.1}a${h},${h} 1 0,0 ${g*.25},0a${h},${h} 1 0,0 ${g*.25},0@@ -1191,7 +1191,7 @@ Please report this to https://github.com/markedjs/marked.`,e){let i="<p>An errora${h},${h} 1 0,0 ${-1*g*.1},${-1*m*.33}a${h*.8},${h*.8} 1 0,0 0,${-1*m*.34}a${h},${h} 1 0,0 ${g*.1},${-1*m*.33}- H0 V0 Z`;if(e.look==="handDrawn"){const x=dr.svg(i),b=fr(e,{}),T=x.path(v,b);y=i.insert(()=>T,":first-child"),y.attr("class","basic label-container").attr("style",Xa(d))}else y=i.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",v);return y.attr("transform",`translate(${-g/2}, ${-m/2})`),Tr(e,y),e.calcIntersect=function(x,b){return or.rect(x,b)},e.intersect=function(x){return de.info("Bang intersect",e,x),or.rect(e,x)},i}w(nEe,"bang");async function iEe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const{shapeSvg:i,bbox:s,halfPadding:a,label:o}=await Qr(t,e,Wr(e)),l=s.width+2*a,u=s.height+2*a,h=.15*l,d=.25*l,f=.35*l,p=.2*l,{cssStyles:g}=e;let m;const y=`M0 0+ H0 V0 Z`;if(e.look==="handDrawn"){const x=dr.svg(i),b=fr(e,{}),T=x.path(v,b);y=i.insert(()=>T,":first-child"),y.attr("class","basic label-container").attr("style",Xa(d))}else y=i.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",v);return y.attr("transform",`translate(${-g/2}, ${-m/2})`),Tr(e,y),e.calcIntersect=function(x,b){return or.rect(x,b)},e.intersect=function(x){return de.info("Bang intersect",e,x),or.rect(e,x)},i}w(nEe,"bang");async function iEe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const{shapeSvg:i,bbox:s,halfPadding:a,label:o}=await Qr(t,e,Wr(e)),l=s.width+2*a,u=s.height+2*a,h=.15*l,d=.25*l,f=.35*l,p=.2*l,{cssStyles:g}=e;let m;const y=`M0 0a${h},${h} 0 0,1 ${l*.25},${-1*l*.1}a${f},${f} 1 0,1 ${l*.4},${-1*l*.1}a${d},${d} 1 0,1 ${l*.35},${l*.2}@@ -1343,7 +1343,7 @@ ${r}`)},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote(),Backspace:()=>E8t(this.editor,this.type)}},addInputRules(){return[e5({find:A8t,type:this.type})]}}),R8t=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,_8t=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,L8t=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,I8t=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,N8t=Qg.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return R_("strong",{...xn(this.options.HTMLAttributes,t),children:R_("slot",{})})},markdownTokenName:"strong",parseMarkdown:(t,e)=>e.applyMark("bold",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"<strong>",close:"</strong>"}},renderMarkdown:(t,e)=>`**${e.renderChildren(t)}**`,addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[yy({find:R8t,type:this.type}),yy({find:L8t,type:this.type})]},addPasteRules(){return[yg({find:_8t,type:this.type}),yg({find:I8t,type:this.type})]}}),D8t=t=>{const e=/`([^`]+)`(?!`)$/.exec(t);return!e||e.index>0&&t[e.index-1]==="`"?null:{index:e.index,text:e[0],replaceWith:e[1]}},O8t=t=>{const e=/`([^`]+)`(?!`)/g,r=[];let n;for(;(n=e.exec(t))!==null;)n.index>0&&t[n.index-1]==="`"||r.push({index:n.index,text:n[0],replaceWith:n[1]});return r},P8t=Qg.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",xn(this.options.HTMLAttributes,t),0]},markdownTokenName:"codespan",parseMarkdown:(t,e)=>e.applyMark("code",[{type:"text",text:t.text||""}]),renderMarkdown:(t,e)=>t.content?`\`${e.renderChildren(t.content)}\``:"",addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[yy({find:D8t,type:this.type})]},addPasteRules(){return[yg({find:O8t,type:this.type})]}}),$8t=Jn.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,``):""}),B8t=Jn.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",xn(this.options.HTMLAttributes,t)]},renderText(){return`-`},renderMarkdown:()=>`+`},renderMarkdown:()=>``,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:r,editor:n})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:i,storedMarks:s}=r;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:a}=this.options,{splittableMarks:o}=n.extensionManager,l=s||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:u,dispatch:h})=>{if(h&&l&&a){const d=l.filter(f=>o.includes(f.type.name));u.ensureMarks(d)}return!0}).scrollIntoView().run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),F8t=Jn.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,xn(this.options.HTMLAttributes,e),0]},parseMarkdown:(t,e)=>e.createNode("heading",{level:t.depth||1},e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>{var r;const n=!((r=t.attrs)===null||r===void 0)&&r.level?parseInt(t.attrs.level,10):1,i="#".repeat(n);return t.content?`${i} ${e.renderChildren(t.content)}`:""},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>FH({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),z8t=Jn.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",xn(this.options.HTMLAttributes,t)]},markdownTokenName:"hr",parseMarkdown:(t,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!Z0t(e,e.schema.nodes[this.name]))return!1;const{selection:r}=e,{$to:n}=r,i=t();return O4e(r)?i.insertContentAt(n.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:s,tr:a,dispatch:o})=>{if(o){const{$to:l}=a.selection,u=l.end();if(l.nodeAfter)l.nodeAfter.isTextblock?a.setSelection(br.create(a.doc,l.pos+1)):l.nodeAfter.isBlock?a.setSelection(Nr.create(a.doc,l.pos)):a.setSelection(br.create(a.doc,l.pos));else{const h=s.schema.nodes[this.options.nextNodeType]||l.parent.type.contentMatch.defaultType,d=h==null?void 0:h.create();d&&(a.insert(u,d),a.setSelection(br.create(a.doc,u+1)))}a.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Y4e({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),V8t=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,H8t=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,G8t=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,W8t=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,q8t=Qg.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",xn(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(t,e)=>e.applyMark("italic",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"<em>",close:"</em>"}},renderMarkdown:(t,e)=>`*${e.renderChildren(t)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[yy({find:V8t,type:this.type}),yy({find:G8t,type:this.type})]},addPasteRules(){return[yg({find:H8t,type:this.type}),yg({find:W8t,type:this.type})]}}),U8t="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",j8t="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",aW="numeric",oW="ascii",lW="alpha",rS="asciinumeric",ek="alphanumeric",cW="domain",pAe="emoji",Y8t="scheme",X8t="slashscheme",vB="whitespace";function K8t(t,e){return t in e||(e[t]=[]),e[t]}function F1(t,e,r){e[aW]&&(e[rS]=!0,e[ek]=!0),e[oW]&&(e[rS]=!0,e[lW]=!0),e[rS]&&(e[ek]=!0),e[lW]&&(e[ek]=!0),e[ek]&&(e[cW]=!0),e[pAe]&&(e[cW]=!0);for(const n in e){const i=K8t(n,r);i.indexOf(t)<0&&i.push(t)}}function Z8t(t,e){const r={};for(const n in e)e[n].indexOf(t)>=0&&(r[n]=!0);return r}function ac(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}ac.groups={};ac.prototype={accepts(){return!!this.t},go(t){const e=this,r=e.j[t];if(r)return r;for(let n=0;n<e.jr.length;n++){const i=e.jr[n][0],s=e.jr[n][1];if(s&&i.test(t))return s}return e.jd},has(t,e=!1){return e?t in this.j:!!this.go(t)},ta(t,e,r,n){for(let i=0;i<t.length;i++)this.tt(t[i],e,r,n)},tr(t,e,r,n){n=n||ac.groups;let i;return e&&e.j?i=e:(i=new ac(e),r&&n&&F1(e,r,n)),this.jr.push([t,i]),i},ts(t,e,r,n){let i=this;const s=t.length;if(!s)return i;for(let a=0;a<s-1;a++)i=i.tt(t[a]);return i.tt(t[s-1],e,r,n)},tt(t,e,r,n){n=n||ac.groups;const i=this;if(e&&e.j)return i.j[t]=e,e;const s=e;let a,o=i.go(t);if(o?(a=new ac,Object.assign(a.j,o.j),a.jr.push.apply(a.jr,o.jr),a.jd=o.jd,a.t=o.t):a=new ac,s){if(n)if(a.t&&typeof a.t=="string"){const l=Object.assign(Z8t(a.t,n),r);F1(s,l,n)}else r&&F1(s,r,n);a.t=s}return i.j[t]=a,a}};const Tn=(t,e,r,n,i)=>t.ta(e,r,n,i),Ms=(t,e,r,n,i)=>t.tr(e,r,n,i),Iue=(t,e,r,n,i)=>t.ts(e,r,n,i),Wt=(t,e,r,n,i)=>t.tt(e,r,n,i),kf="WORD",uW="UWORD",gAe="ASCIINUMERICAL",mAe="ALPHANUMERICAL",_E="LOCALHOST",hW="TLD",dW="UTLD",UM="SCHEME",E2="SLASH_SCHEME",rQ="NUM",fW="WS",nQ="NL",nS="OPENBRACE",iS="CLOSEBRACE",__="OPENBRACKET",L_="CLOSEBRACKET",I_="OPENPAREN",N_="CLOSEPAREN",D_="OPENANGLEBRACKET",O_="CLOSEANGLEBRACKET",P_="FULLWIDTHLEFTPAREN",$_="FULLWIDTHRIGHTPAREN",B_="LEFTCORNERBRACKET",F_="RIGHTCORNERBRACKET",z_="LEFTWHITECORNERBRACKET",V_="RIGHTWHITECORNERBRACKET",H_="FULLWIDTHLESSTHAN",G_="FULLWIDTHGREATERTHAN",W_="AMPERSAND",q_="APOSTROPHE",U_="ASTERISK",Ap="AT",j_="BACKSLASH",Y_="BACKTICK",X_="CARET",z1="COLON",iQ="COMMA",K_="DOLLAR",Qh="DOT",Z_="EQUALS",sQ="EXCLAMATION",lu="HYPHEN",sS="PERCENT",Q_="PIPE",J_="PLUS",eL="POUND",aS="QUERY",aQ="QUOTE",yAe="FULLWIDTHMIDDLEDOT",oQ="SEMI",Jh="SLASH",oS="TILDE",tL="UNDERSCORE",vAe="EMOJI",rL="SYM";var bAe=Object.freeze({__proto__:null,ALPHANUMERICAL:mAe,AMPERSAND:W_,APOSTROPHE:q_,ASCIINUMERICAL:gAe,ASTERISK:U_,AT:Ap,BACKSLASH:j_,BACKTICK:Y_,CARET:X_,CLOSEANGLEBRACKET:O_,CLOSEBRACE:iS,CLOSEBRACKET:L_,CLOSEPAREN:N_,COLON:z1,COMMA:iQ,DOLLAR:K_,DOT:Qh,EMOJI:vAe,EQUALS:Z_,EXCLAMATION:sQ,FULLWIDTHGREATERTHAN:G_,FULLWIDTHLEFTPAREN:P_,FULLWIDTHLESSTHAN:H_,FULLWIDTHMIDDLEDOT:yAe,FULLWIDTHRIGHTPAREN:$_,HYPHEN:lu,LEFTCORNERBRACKET:B_,LEFTWHITECORNERBRACKET:z_,LOCALHOST:_E,NL:nQ,NUM:rQ,OPENANGLEBRACKET:D_,OPENBRACE:nS,OPENBRACKET:__,OPENPAREN:I_,PERCENT:sS,PIPE:Q_,PLUS:J_,POUND:eL,QUERY:aS,QUOTE:aQ,RIGHTCORNERBRACKET:F_,RIGHTWHITECORNERBRACKET:V_,SCHEME:UM,SEMI:oQ,SLASH:Jh,SLASH_SCHEME:E2,SYM:rL,TILDE:oS,TLD:hW,UNDERSCORE:tL,UTLD:dW,UWORD:uW,WORD:kf,WS:fW});const hf=/[a-z]/,lC=new RegExp("\\p{L}","u"),bB=new RegExp("\\p{Emoji}","u"),df=/\d/,xB=/\s/,Nue="\r",wB=``,Q8t="️",J8t="",TB="";let K7=null,Z7=null;function eMt(t=[]){const e={};ac.groups=e;const r=new ac;K7==null&&(K7=Due(U8t)),Z7==null&&(Z7=Due(j8t)),Wt(r,"'",q_),Wt(r,"{",nS),Wt(r,"}",iS),Wt(r,"[",__),Wt(r,"]",L_),Wt(r,"(",I_),Wt(r,")",N_),Wt(r,"<",D_),Wt(r,">",O_),Wt(r,"(",P_),Wt(r,")",$_),Wt(r,"「",B_),Wt(r,"」",F_),Wt(r,"『",z_),Wt(r,"』",V_),Wt(r,"<",H_),Wt(r,">",G_),Wt(r,"&",W_),Wt(r,"*",U_),Wt(r,"@",Ap),Wt(r,"`",Y_),Wt(r,"^",X_),Wt(r,":",z1),Wt(r,",",iQ),Wt(r,"$",K_),Wt(r,".",Qh),Wt(r,"=",Z_),Wt(r,"!",sQ),Wt(r,"-",lu),Wt(r,"%",sS),Wt(r,"|",Q_),Wt(r,"+",J_),Wt(r,"#",eL),Wt(r,"?",aS),Wt(r,'"',aQ),Wt(r,"/",Jh),Wt(r,";",oQ),Wt(r,"~",oS),Wt(r,"_",tL),Wt(r,"\\",j_),Wt(r,"・",yAe);const n=Ms(r,df,rQ,{[aW]:!0});Ms(n,df,n);const i=Ms(n,hf,gAe,{[rS]:!0}),s=Ms(n,lC,mAe,{[ek]:!0}),a=Ms(r,hf,kf,{[oW]:!0});Ms(a,df,i),Ms(a,hf,a),Ms(i,df,i),Ms(i,hf,i);const o=Ms(r,lC,uW,{[lW]:!0});Ms(o,hf),Ms(o,df,s),Ms(o,lC,o),Ms(s,df,s),Ms(s,hf),Ms(s,lC,s);const l=Wt(r,wB,nQ,{[vB]:!0}),u=Wt(r,Nue,fW,{[vB]:!0}),h=Ms(r,xB,fW,{[vB]:!0});Wt(r,TB,h),Wt(u,wB,l),Wt(u,TB,h),Ms(u,xB,h),Wt(h,Nue),Wt(h,wB),Ms(h,xB,h),Wt(h,TB,h);const d=Ms(r,bB,vAe,{[pAe]:!0});Wt(d,"#"),Ms(d,bB,d),Wt(d,Q8t,d);const f=Wt(d,J8t);Wt(f,"#"),Ms(f,bB,d);const p=[[hf,a],[df,i]],g=[[hf,null],[lC,o],[df,s]];for(let m=0;m<K7.length;m++)up(r,K7[m],hW,kf,p);for(let m=0;m<Z7.length;m++)up(r,Z7[m],dW,uW,g);F1(hW,{tld:!0,ascii:!0},e),F1(dW,{utld:!0,alpha:!0},e),up(r,"file",UM,kf,p),up(r,"mailto",UM,kf,p),up(r,"http",E2,kf,p),up(r,"https",E2,kf,p),up(r,"ftp",E2,kf,p),up(r,"ftps",E2,kf,p),F1(UM,{scheme:!0,ascii:!0},e),F1(E2,{slashscheme:!0,ascii:!0},e),t=t.sort((m,y)=>m[0]>y[0]?1:-1);for(let m=0;m<t.length;m++){const y=t[m][0],x=t[m][1]?{[Y8t]:!0}:{[X8t]:!0};y.indexOf("-")>=0?x[cW]=!0:hf.test(y)?df.test(y)?x[rS]=!0:x[oW]=!0:x[aW]=!0,Iue(r,y,y,x)}return Iue(r,"localhost",_E,{ascii:!0}),r.jd=new ac(rL),{start:r,tokens:Object.assign({groups:e},bAe)}}function xAe(t,e){const r=tMt(e.replace(/[A-Z]/g,o=>o.toLowerCase())),n=r.length,i=[];let s=0,a=0;for(;a<n;){let o=t,l=null,u=0,h=null,d=-1,f=-1;for(;a<n&&(l=o.go(r[a]));)o=l,o.accepts()?(d=0,f=0,h=o):d>=0&&(d+=r[a].length,f++),u+=r[a].length,s+=r[a].length,a++;s-=d,a-=f,u-=d,i.push({t:h.t,v:e.slice(s-u,s),s:s-u,e:s})}return i}function tMt(t){const e=[],r=t.length;let n=0;for(;n<r;){let i=t.charCodeAt(n),s,a=i<55296||i>56319||n+1===r||(s=t.charCodeAt(n+1))<56320||s>57343?t[n]:t.slice(n,n+2);e.push(a),n+=a.length}return e}function up(t,e,r,n,i){let s;const a=e.length;for(let o=0;o<a-1;o++){const l=e[o];t.j[l]?s=t.j[l]:(s=new ac(n),s.jr=i.slice(),t.j[l]=s),t=s}return s=new ac(r),s.jr=i.slice(),t.j[e[a-1]]=s,s}function Due(t){const e=[],r=[];let n=0,i="0123456789";for(;n<t.length;){let s=0;for(;i.indexOf(t[n+s])>=0;)s++;if(s>0){e.push(r.join(""));for(let a=parseInt(t.substring(n,n+s),10);a>0;a--)r.pop();n+=s}else r.push(t[n]),n++}return e}const LE={defaultProtocol:"http",events:null,format:Oue,formatHref:Oue,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function lQ(t,e=null){let r=Object.assign({},LE);t&&(r=Object.assign(r,t instanceof lQ?t.o:t));const n=r.ignoreTags,i=[];for(let s=0;s<n.length;s++)i.push(n[s].toUpperCase());this.o=r,e&&(this.defaultRender=e),this.ignoreTags=i}lQ.prototype={o:LE,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,r){const n=e!=null;let i=this.o[t];return i&&(typeof i=="object"?(i=r.t in i?i[r.t]:LE[t],typeof i=="function"&&n&&(i=i(e,r))):typeof i=="function"&&n&&(i=i(e,r.t,r)),i)},getObj(t,e,r){let n=this.o[t];return typeof n=="function"&&e!=null&&(n=n(e,r.t,r)),n},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function Oue(t){return t}function wAe(t,e){this.t="token",this.v=t,this.tk=e}wAe.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),r=t.get("truncate",e,this),n=t.get("format",e,this);return r&&n.length>r?n.substring(0,r)+"…":n},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=LE.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,r=this.toHref(t.get("defaultProtocol")),n=t.get("formatHref",r,this),i=t.get("tagName",r,e),s=this.toFormattedString(t),a={},o=t.get("className",r,e),l=t.get("target",r,e),u=t.get("rel",r,e),h=t.getObj("attributes",r,e),d=t.getObj("events",r,e);return a.href=n,o&&(a.class=o),l&&(a.target=l),u&&(a.rel=u),h&&Object.assign(a,h),{tagName:i,attributes:a,content:s,eventListeners:d}}};function SD(t,e){class r extends wAe{constructor(i,s){super(i,s),this.t=t}}for(const n in e)r.prototype[n]=e[n];return r.t=t,r}const rMt=SD("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Pue=SD("text"),nMt=SD("nl"),Q7=SD("url",{isLink:!0,toHref(t=LE.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==_E&&t[1].t===z1}}),nu=t=>new ac(t);function iMt({groups:t}){const e=t.domain.concat([W_,U_,Ap,j_,Y_,X_,K_,Z_,lu,rQ,sS,Q_,J_,eL,Jh,rL,oS,tL]),r=[q_,z1,iQ,Qh,sQ,sS,aS,aQ,oQ,D_,O_,nS,iS,L_,__,I_,N_,P_,$_,B_,F_,z_,V_,H_,G_],n=[W_,q_,U_,j_,Y_,X_,K_,Z_,lu,nS,iS,sS,Q_,J_,eL,aS,Jh,rL,oS,tL],i=nu(),s=Wt(i,oS);Tn(s,n,s),Tn(s,t.domain,s);const a=nu(),o=nu(),l=nu();Tn(i,t.domain,a),Tn(i,t.scheme,o),Tn(i,t.slashscheme,l),Tn(a,n,s),Tn(a,t.domain,a);const u=Wt(a,Ap);Wt(s,Ap,u),Wt(o,Ap,u),Wt(l,Ap,u);const h=Wt(s,Qh);Tn(h,n,s),Tn(h,t.domain,s);const d=nu();Tn(u,t.domain,d),Tn(d,t.domain,d);const f=Wt(d,Qh);Tn(f,t.domain,d);const p=nu(rMt);Tn(f,t.tld,p),Tn(f,t.utld,p),Wt(u,_E,p);const g=Wt(d,lu);Wt(g,lu,g),Tn(g,t.domain,d),Tn(p,t.domain,d),Wt(p,Qh,f),Wt(p,lu,g);const m=Wt(a,lu),y=Wt(a,Qh);Wt(m,lu,m),Tn(m,t.domain,a),Tn(y,n,s),Tn(y,t.domain,a);const v=nu(Q7);Tn(y,t.tld,v),Tn(y,t.utld,v),Tn(v,t.domain,a),Tn(v,n,s),Wt(v,Qh,y),Wt(v,lu,m),Wt(v,Ap,u);const x=Wt(v,z1),b=nu(Q7);Tn(x,t.numeric,b);const T=nu(Q7),C=nu();Tn(T,e,T),Tn(T,r,C),Tn(C,e,T),Tn(C,r,C),Wt(v,Jh,T),Wt(b,Jh,T);const S=Wt(o,z1),k=Wt(l,z1),E=Wt(k,Jh),A=Wt(E,Jh);Tn(o,t.domain,a),Wt(o,Qh,y),Wt(o,lu,m),Tn(l,t.domain,a),Wt(l,Qh,y),Wt(l,lu,m),Tn(S,t.domain,T),Wt(S,Jh,T),Wt(S,aS,T),Tn(A,t.domain,T),Tn(A,e,T),Wt(A,Jh,T);const R=[[nS,iS],[__,L_],[I_,N_],[D_,O_],[P_,$_],[B_,F_],[z_,V_],[H_,G_]];for(let _=0;_<R.length;_++){const[P,N]=R[_],L=Wt(T,P);Wt(C,P,L);const I=nu(Q7);Tn(L,e,I);const $=nu();Tn(L,r,$),Wt(L,N,T),Tn(I,e,I),Tn(I,r,$),Tn($,e,I),Tn($,r,$),Wt(I,N,T),Wt($,N,T)}return Wt(i,_E,v),Wt(i,nQ,nMt),{start:i,tokens:bAe}}function sMt(t,e,r){let n=r.length,i=0,s=[],a=[];for(;i<n;){let o=t,l=null,u=null,h=0,d=null,f=-1;for(;i<n&&!(l=o.go(r[i].t));)a.push(r[i++]);for(;i<n&&(u=l||o.go(r[i].t));)l=null,o=u,o.accepts()?(f=0,d=o):f>=0&&f++,i++,h++;if(f<0)i-=h,i<n&&(a.push(r[i]),i++);else{a.length>0&&(s.push(CB(Pue,e,a)),a=[]),i-=f,h-=f;const p=d.t,g=r.slice(i-h,i);s.push(CB(p,e,g))}}return a.length>0&&s.push(CB(Pue,e,a)),s}function CB(t,e,r){const n=r[0].s,i=r[r.length-1].e,s=e.slice(n,i);return new t(s,r)}const aMt=typeof console<"u"&&console&&console.warn||(()=>{}),oMt="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Xi={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function lMt(){return ac.groups={},Xi.scanner=null,Xi.parser=null,Xi.tokenQueue=[],Xi.pluginQueue=[],Xi.customSchemes=[],Xi.initialized=!1,Xi}function $ue(t,e=!1){if(Xi.initialized&&aMt(`linkifyjs: already initialized - will not register custom scheme "${t}" ${oMt}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.1. Must only contain digits, lowercase ASCII letters or "-"@@ -1470,7 +1470,7 @@ ${JSON.stringify(t)}})));}}-+if (${S}.value === undefined) {if (${k} in input) {newResult[${k}] = undefined;@@ -1478,7 +1478,7 @@ ${JSON.stringify(t)}} else {newResult[${k}] = ${S}.value;}-+`):A?p.write(`if (${S}.issues.length) {payload.issues = payload.issues.concat(${S}.issues.map(iss => ({@@ -1486,7 +1486,7 @@ ${JSON.stringify(t)}path: iss.path ? [${k}, ...iss.path] : [${k}]})));}-+if (${S}.value === undefined) {if (${k} in input) {newResult[${k}] = undefined;@@ -1494,7 +1494,7 @@ ${JSON.stringify(t)}} else {newResult[${k}] = ${S}.value;}-+`):p.write(`const ${S}_present = ${k} in input;if (${S}.issues.length) {@@ -1524,7 +1524,7 @@ ${JSON.stringify(t)}Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const h of t.seen.entries()){const d=h[1];if(e===h[0]){s(h);continue}if(t.external){const p=(l=t.external.registry.get(h[0]))==null?void 0:l.id;if(e!==h[0]&&p){s(h);continue}}if((u=t.metadataRegistry.get(h[0]))==null?void 0:u.id){s(h);continue}if(d.cycle){s(h);continue}if(d.count>1&&t.reused==="ref"){s(h);continue}}}function v7e(t,e){var o,l,u,h;const r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=d=>{const f=t.seen.get(d);if(f.ref===null)return;const p=f.def??f.schema,g={...p},m=f.ref;if(f.ref=null,m){n(m);const v=t.seen.get(m),x=v.schema;if(x.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(p.allOf=p.allOf??[],p.allOf.push(x)):Object.assign(p,x),Object.assign(p,g),d._zod.parent===m)for(const T in p)T==="$ref"||T==="allOf"||T in g||delete p[T];if(x.$ref&&v.def)for(const T in p)T==="$ref"||T==="allOf"||T in v.def&&JSON.stringify(p[T])===JSON.stringify(v.def[T])&&delete p[T]}const y=d._zod.parent;if(y&&y!==m){n(y);const v=t.seen.get(y);if(v!=null&&v.schema.$ref&&(p.$ref=v.schema.$ref,v.def))for(const x in p)x==="$ref"||x==="allOf"||x in v.def&&JSON.stringify(p[x])===JSON.stringify(v.def[x])&&delete p[x]}t.override({zodSchema:d,jsonSchema:p,path:f.path??[]})};for(const d of[...t.seen.entries()].reverse())n(d[0]);const i={};if(t.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":t.target,(o=t.external)!=null&&o.uri){const d=(l=t.external.registry.get(e))==null?void 0:l.id;if(!d)throw new Error("Schema is missing an `id` property");i.$id=t.external.uri(d)}Object.assign(i,r.def??r.schema);const s=(u=t.metadataRegistry.get(e))==null?void 0:u.id;s!==void 0&&i.id===s&&delete i.id;const a=((h=t.external)==null?void 0:h.defs)??{};for(const d of t.seen.entries()){const f=d[1];f.def&&f.defId&&(f.def.id===f.defId&&delete f.def.id,a[f.defId]=f.def)}t.external||Object.keys(a).length>0&&(t.target==="draft-2020-12"?i.$defs=a:i.definitions=a);try{const d=JSON.parse(JSON.stringify(i));return Object.defineProperty(d,"~standard",{value:{...e["~standard"],jsonSchema:{input:cL(e,"input",t.processors),output:cL(e,"output",t.processors)}},enumerable:!1,writable:!1}),d}catch{throw new Error("Error converting schema to JSON.")}}function al(t,e){const r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);const n=t._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return al(n.element,r);if(n.type==="set")return al(n.valueType,r);if(n.type==="lazy")return al(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return al(n.innerType,r);if(n.type==="intersection")return al(n.left,r)||al(n.right,r);if(n.type==="record"||n.type==="map")return al(n.keyType,r)||al(n.valueType,r);if(n.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:al(n.in,r)||al(n.out,r);if(n.type==="object"){for(const i in n.shape)if(al(n.shape[i],r))return!0;return!1}if(n.type==="union"){for(const i of n.options)if(al(i,r))return!0;return!1}if(n.type==="tuple"){for(const i of n.items)if(al(i,r))return!0;return!!(n.rest&&al(n.rest,r))}return!1}const lIt=(t,e={})=>r=>{const n=m7e({...r,processors:e});return da(t,n),y7e(n,t),v7e(n,t)},cL=(t,e,r={})=>n=>{const{libraryOptions:i,target:s}=n??{},a=m7e({...i??{},target:s,io:e,processors:r});return da(t,a),y7e(a,t),v7e(a,t)},cIt={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},uIt=(t,e,r,n)=>{const i=r;i.type="string";const{minimum:s,maximum:a,format:o,patterns:l,contentEncoding:u}=t._zod.bag;if(typeof s=="number"&&(i.minLength=s),typeof a=="number"&&(i.maxLength=a),o&&(i.format=cIt[o]??o,i.format===""&&delete i.format,o==="time"&&delete i.format),u&&(i.contentEncoding=u),l&&l.size>0){const h=[...l];h.length===1?i.pattern=h[0].source:h.length>1&&(i.allOf=[...h.map(d=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},hIt=(t,e,r,n)=>{const i=r,{minimum:s,maximum:a,format:o,multipleOf:l,exclusiveMaximum:u,exclusiveMinimum:h}=t._zod.bag;typeof o=="string"&&o.includes("int")?i.type="integer":i.type="number";const d=typeof h=="number"&&h>=(s??Number.NEGATIVE_INFINITY),f=typeof u=="number"&&u<=(a??Number.POSITIVE_INFINITY),p=e.target==="draft-04"||e.target==="openapi-3.0";d?p?(i.minimum=h,i.exclusiveMinimum=!0):i.exclusiveMinimum=h:typeof s=="number"&&(i.minimum=s),f?p?(i.maximum=u,i.exclusiveMaximum=!0):i.exclusiveMaximum=u:typeof a=="number"&&(i.maximum=a),typeof l=="number"&&(i.multipleOf=l)},dIt=(t,e,r,n)=>{r.type="boolean"},fIt=(t,e,r,n)=>{r.not={}},pIt=(t,e,r,n)=>{},gIt=(t,e,r,n)=>{const i=t._zod.def,s=XAe(i.entries);s.every(a=>typeof a=="number")&&(r.type="number"),s.every(a=>typeof a=="string")&&(r.type="string"),r.enum=s},mIt=(t,e,r,n)=>{const i=t._zod.def,s=[];for(const a of i.values)if(a===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(a))}else s.push(a);if(s.length!==0)if(s.length===1){const a=s[0];r.type=a===null?"null":typeof a,e.target==="draft-04"||e.target==="openapi-3.0"?r.enum=[a]:r.const=a}else s.every(a=>typeof a=="number")&&(r.type="number"),s.every(a=>typeof a=="string")&&(r.type="string"),s.every(a=>typeof a=="boolean")&&(r.type="boolean"),s.every(a=>a===null)&&(r.type="null"),r.enum=s},yIt=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},vIt=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},bIt=(t,e,r,n)=>{const i=r,s=t._zod.def,{minimum:a,maximum:o}=t._zod.bag;typeof a=="number"&&(i.minItems=a),typeof o=="number"&&(i.maxItems=o),i.type="array",i.items=da(s.element,e,{...n,path:[...n.path,"items"]})},xIt=(t,e,r,n)=>{var u;const i=r,s=t._zod.def;i.type="object",i.properties={};const a=s.shape;for(const h in a)i.properties[h]=da(a[h],e,{...n,path:[...n.path,"properties",h]});const o=new Set(Object.keys(a)),l=new Set([...o].filter(h=>{const d=s.shape[h]._zod;return e.io==="input"?d.optin===void 0:d.optout===void 0}));l.size>0&&(i.required=Array.from(l)),((u=s.catchall)==null?void 0:u._zod.def.type)==="never"?i.additionalProperties=!1:s.catchall?s.catchall&&(i.additionalProperties=da(s.catchall,e,{...n,path:[...n.path,"additionalProperties"]})):e.io==="output"&&(i.additionalProperties=!1)},wIt=(t,e,r,n)=>{const i=t._zod.def,s=i.inclusive===!1,a=i.options.map((o,l)=>da(o,e,{...n,path:[...n.path,s?"oneOf":"anyOf",l]}));s?r.oneOf=a:r.anyOf=a},TIt=(t,e,r,n)=>{const i=t._zod.def,s=da(i.left,e,{...n,path:[...n.path,"allOf",0]}),a=da(i.right,e,{...n,path:[...n.path,"allOf",1]}),o=u=>"allOf"in u&&Object.keys(u).length===1,l=[...o(s)?s.allOf:[s],...o(a)?a.allOf:[a]];r.allOf=l},CIt=(t,e,r,n)=>{const i=r,s=t._zod.def;i.type="object";const a=s.keyType,o=a._zod.bag,l=o==null?void 0:o.patterns;if(s.mode==="loose"&&l&&l.size>0){const h=da(s.valueType,e,{...n,path:[...n.path,"patternProperties","*"]});i.patternProperties={};for(const d of l)i.patternProperties[d.source]=h}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(i.propertyNames=da(s.keyType,e,{...n,path:[...n.path,"propertyNames"]})),i.additionalProperties=da(s.valueType,e,{...n,path:[...n.path,"additionalProperties"]});const u=a._zod.values;if(u){const h=[...u].filter(d=>typeof d=="string"||typeof d=="number");h.length>0&&(i.required=h)}},kIt=(t,e,r,n)=>{const i=t._zod.def,s=da(i.innerType,e,n),a=e.seen.get(t);e.target==="openapi-3.0"?(a.ref=i.innerType,r.nullable=!0):r.anyOf=[s,{type:"null"}]},SIt=(t,e,r,n)=>{const i=t._zod.def;da(i.innerType,e,n);const s=e.seen.get(t);s.ref=i.innerType},EIt=(t,e,r,n)=>{const i=t._zod.def;da(i.innerType,e,n);const s=e.seen.get(t);s.ref=i.innerType,r.default=JSON.parse(JSON.stringify(i.defaultValue))},AIt=(t,e,r,n)=>{const i=t._zod.def;da(i.innerType,e,n);const s=e.seen.get(t);s.ref=i.innerType,e.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},MIt=(t,e,r,n)=>{const i=t._zod.def;da(i.innerType,e,n);const s=e.seen.get(t);s.ref=i.innerType;let a;try{a=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=a},RIt=(t,e,r,n)=>{const i=t._zod.def,s=i.in._zod.traits.has("$ZodTransform"),a=e.io==="input"?s?i.out:i.in:i.out;da(a,e,n);const o=e.seen.get(t);o.ref=a},_It=(t,e,r,n)=>{const i=t._zod.def;da(i.innerType,e,n);const s=e.seen.get(t);s.ref=i.innerType,r.readOnly=!0},b7e=(t,e,r,n)=>{const i=t._zod.def;da(i.innerType,e,n);const s=e.seen.get(t);s.ref=i.innerType},LIt=Ct("ZodISODateTime",(t,e)=>{I_t.init(t,e),Ss.init(t,e)});function IIt(t){return BLt(LIt,t)}const NIt=Ct("ZodISODate",(t,e)=>{N_t.init(t,e),Ss.init(t,e)});function DIt(t){return FLt(NIt,t)}const OIt=Ct("ZodISOTime",(t,e)=>{D_t.init(t,e),Ss.init(t,e)});function PIt(t){return zLt(OIt,t)}const $It=Ct("ZodISODuration",(t,e)=>{O_t.init(t,e),Ss.init(t,e)});function BIt(t){return VLt($It,t)}const FIt=(t,e)=>{JAe.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:r=>k9t(t,r)},flatten:{value:r=>C9t(t,r)},addIssue:{value:r=>{t.issues.push(r),t.message=JSON.stringify(t.issues,vW,2)}},addIssues:{value:r=>{t.issues.push(...r),t.message=JSON.stringify(t.issues,vW,2)}},isEmpty:{get(){return t.issues.length===0}}})},$u=Ct("ZodError",FIt,{Parent:Error}),zIt=CQ($u),VIt=kQ($u),HIt=MD($u),GIt=RD($u),WIt=A9t($u),qIt=M9t($u),UIt=R9t($u),jIt=_9t($u),YIt=L9t($u),XIt=I9t($u),KIt=N9t($u),ZIt=D9t($u),dhe=new WeakMap;function dA(t,e,r){const n=Object.getPrototypeOf(t);let i=dhe.get(n);if(i||(i=new Set,dhe.set(n,i)),!i.has(e)){i.add(e);for(const s in r){const a=r[s];Object.defineProperty(n,s,{configurable:!0,enumerable:!1,get(){const o=a.bind(this);return Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:o}),o},set(o){Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:o})}})}}}const ks=Ct("ZodType",(t,e)=>(Cs.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:cL(t,"input"),output:cL(t,"output")}}),t.toJSONSchema=lIt(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.parse=(r,n)=>zIt(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>HIt(t,r,n),t.parseAsync=async(r,n)=>VIt(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>GIt(t,r,n),t.spa=t.safeParseAsync,t.encode=(r,n)=>WIt(t,r,n),t.decode=(r,n)=>qIt(t,r,n),t.encodeAsync=async(r,n)=>UIt(t,r,n),t.decodeAsync=async(r,n)=>jIt(t,r,n),t.safeEncode=(r,n)=>YIt(t,r,n),t.safeDecode=(r,n)=>XIt(t,r,n),t.safeEncodeAsync=async(r,n)=>KIt(t,r,n),t.safeDecodeAsync=async(r,n)=>ZIt(t,r,n),dA(t,"ZodType",{check(...r){const n=this.def;return this.clone(em(n,{checks:[...n.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,n){return tm(this,r,n)},brand(){return this},register(r,n){return r.add(this,n),this},refine(r,n){return this.check(GNt(r,n))},superRefine(r,n){return this.check(WNt(r,n))},overwrite(r){return this.check(p3(r))},optional(){return mhe(this)},exactOptional(){return _Nt(this)},nullable(){return yhe(this)},nullish(){return mhe(yhe(this))},nonoptional(r){return PNt(this,r)},array(){return Kn(this)},or(r){return $E([this,r])},and(r){return SNt(this,r)},transform(r){return vhe(this,MNt(r))},default(r){return NNt(this,r)},prefault(r){return ONt(this,r)},catch(r){return BNt(this,r)},pipe(r){return vhe(this,r)},readonly(){return VNt(this)},describe(r){const n=this.clone();return rk.add(n,{description:r}),n},meta(...r){if(r.length===0)return rk.get(this);const n=this.clone();return rk.add(n,r[0]),n},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(t,"description",{get(){var r;return(r=rk.get(t))==null?void 0:r.description},configurable:!0}),t)),x7e=Ct("_ZodString",(t,e)=>{SQ.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(n,i,s)=>uIt(t,n,i);const r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,dA(t,"_ZodString",{regex(...n){return this.check(jLt(...n))},includes(...n){return this.check(KLt(...n))},startsWith(...n){return this.check(ZLt(...n))},endsWith(...n){return this.check(QLt(...n))},min(...n){return this.check(lL(...n))},max(...n){return this.check(p7e(...n))},length(...n){return this.check(g7e(...n))},nonempty(...n){return this.check(lL(1,...n))},lowercase(n){return this.check(YLt(n))},uppercase(n){return this.check(XLt(n))},trim(){return this.check(eIt())},normalize(...n){return this.check(JLt(...n))},toLowerCase(){return this.check(tIt())},toUpperCase(){return this.check(rIt())},slugify(){return this.check(nIt())}})}),QIt=Ct("ZodString",(t,e)=>{SQ.init(t,e),x7e.init(t,e),t.email=r=>t.check(yLt(JIt,r)),t.url=r=>t.check(TLt(eNt,r)),t.jwt=r=>t.check($Lt(gNt,r)),t.emoji=r=>t.check(CLt(tNt,r)),t.guid=r=>t.check(lhe(fhe,r)),t.uuid=r=>t.check(vLt(i8,r)),t.uuidv4=r=>t.check(bLt(i8,r)),t.uuidv6=r=>t.check(xLt(i8,r)),t.uuidv7=r=>t.check(wLt(i8,r)),t.nanoid=r=>t.check(kLt(rNt,r)),t.guid=r=>t.check(lhe(fhe,r)),t.cuid=r=>t.check(SLt(nNt,r)),t.cuid2=r=>t.check(ELt(iNt,r)),t.ulid=r=>t.check(ALt(sNt,r)),t.base64=r=>t.check(DLt(dNt,r)),t.base64url=r=>t.check(OLt(fNt,r)),t.xid=r=>t.check(MLt(aNt,r)),t.ksuid=r=>t.check(RLt(oNt,r)),t.ipv4=r=>t.check(_Lt(lNt,r)),t.ipv6=r=>t.check(LLt(cNt,r)),t.cidrv4=r=>t.check(ILt(uNt,r)),t.cidrv6=r=>t.check(NLt(hNt,r)),t.e164=r=>t.check(PLt(pNt,r)),t.datetime=r=>t.check(IIt(r)),t.date=r=>t.check(DIt(r)),t.time=r=>t.check(PIt(r)),t.duration=r=>t.check(BIt(r))});function Ze(t){return mLt(QIt,t)}const Ss=Ct("ZodStringFormat",(t,e)=>{hs.init(t,e),x7e.init(t,e)}),JIt=Ct("ZodEmail",(t,e)=>{C_t.init(t,e),Ss.init(t,e)}),fhe=Ct("ZodGUID",(t,e)=>{w_t.init(t,e),Ss.init(t,e)}),i8=Ct("ZodUUID",(t,e)=>{T_t.init(t,e),Ss.init(t,e)}),eNt=Ct("ZodURL",(t,e)=>{k_t.init(t,e),Ss.init(t,e)}),tNt=Ct("ZodEmoji",(t,e)=>{S_t.init(t,e),Ss.init(t,e)}),rNt=Ct("ZodNanoID",(t,e)=>{E_t.init(t,e),Ss.init(t,e)}),nNt=Ct("ZodCUID",(t,e)=>{A_t.init(t,e),Ss.init(t,e)}),iNt=Ct("ZodCUID2",(t,e)=>{M_t.init(t,e),Ss.init(t,e)}),sNt=Ct("ZodULID",(t,e)=>{R_t.init(t,e),Ss.init(t,e)}),aNt=Ct("ZodXID",(t,e)=>{__t.init(t,e),Ss.init(t,e)}),oNt=Ct("ZodKSUID",(t,e)=>{L_t.init(t,e),Ss.init(t,e)}),lNt=Ct("ZodIPv4",(t,e)=>{P_t.init(t,e),Ss.init(t,e)}),cNt=Ct("ZodIPv6",(t,e)=>{$_t.init(t,e),Ss.init(t,e)}),uNt=Ct("ZodCIDRv4",(t,e)=>{B_t.init(t,e),Ss.init(t,e)}),hNt=Ct("ZodCIDRv6",(t,e)=>{F_t.init(t,e),Ss.init(t,e)}),dNt=Ct("ZodBase64",(t,e)=>{z_t.init(t,e),Ss.init(t,e)}),fNt=Ct("ZodBase64URL",(t,e)=>{H_t.init(t,e),Ss.init(t,e)}),pNt=Ct("ZodE164",(t,e)=>{G_t.init(t,e),Ss.init(t,e)}),gNt=Ct("ZodJWT",(t,e)=>{q_t.init(t,e),Ss.init(t,e)}),w7e=Ct("ZodNumber",(t,e)=>{c7e.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(n,i,s)=>hIt(t,n,i),dA(t,"ZodNumber",{gt(n,i){return this.check(uhe(n,i))},gte(n,i){return this.check(AB(n,i))},min(n,i){return this.check(AB(n,i))},lt(n,i){return this.check(che(n,i))},lte(n,i){return this.check(EB(n,i))},max(n,i){return this.check(EB(n,i))},int(n){return this.check(phe(n))},safe(n){return this.check(phe(n))},positive(n){return this.check(uhe(0,n))},nonnegative(n){return this.check(AB(0,n))},negative(n){return this.check(che(0,n))},nonpositive(n){return this.check(EB(0,n))},multipleOf(n,i){return this.check(hhe(n,i))},step(n,i){return this.check(hhe(n,i))},finite(){return this}});const r=t._zod.bag;t.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),t.isFinite=!0,t.format=r.format??null});function sa(t){return HLt(w7e,t)}const mNt=Ct("ZodNumberFormat",(t,e)=>{U_t.init(t,e),w7e.init(t,e)});function phe(t){return GLt(mNt,t)}const yNt=Ct("ZodBoolean",(t,e)=>{j_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>dIt(t,r,n)});function Vn(t){return WLt(yNt,t)}const vNt=Ct("ZodUnknown",(t,e)=>{Y_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>pIt()});function Dd(){return qLt(vNt)}const bNt=Ct("ZodNever",(t,e)=>{X_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>fIt(t,r,n)});function xNt(t){return ULt(bNt,t)}const wNt=Ct("ZodArray",(t,e)=>{K_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>bIt(t,r,n,i),t.element=e.element,dA(t,"ZodArray",{min(r,n){return this.check(lL(r,n))},nonempty(r){return this.check(lL(1,r))},max(r,n){return this.check(p7e(r,n))},length(r,n){return this.check(g7e(r,n))},unwrap(){return this.element}})});function Kn(t,e){return iIt(wNt,t,e)}const TNt=Ct("ZodObject",(t,e)=>{Q_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>xIt(t,r,n,i),bi(t,"shape",()=>e.shape),dA(t,"ZodObject",{keyof(){return ii(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:Dd()})},loose(){return this.clone({...this._zod.def,catchall:Dd()})},strict(){return this.clone({...this._zod.def,catchall:xNt()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return y9t(this,r)},safeExtend(r){return v9t(this,r)},merge(r){return b9t(this,r)},pick(r){return g9t(this,r)},omit(r){return m9t(this,r)},partial(...r){return x9t(k7e,this,r[0])},required(...r){return w9t(S7e,this,r[0])}})});function Yt(t,e){const r={type:"object",shape:t??{},..._r(e)};return new TNt(r)}const T7e=Ct("ZodUnion",(t,e)=>{d7e.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>wIt(t,r,n,i),t.options=e.options});function $E(t,e){return new T7e({type:"union",options:t,..._r(e)})}const CNt=Ct("ZodDiscriminatedUnion",(t,e)=>{T7e.init(t,e),J_t.init(t,e)});function C7e(t,e,r){return new CNt({type:"union",options:e,discriminator:t,..._r(r)})}const kNt=Ct("ZodIntersection",(t,e)=>{eLt.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>TIt(t,r,n,i)});function SNt(t,e){return new kNt({type:"intersection",left:t,right:e})}const ghe=Ct("ZodRecord",(t,e)=>{tLt.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>CIt(t,r,n,i),t.keyType=e.keyType,t.valueType=e.valueType});function LD(t,e,r){return!e||!e._zod?new ghe({type:"record",keyType:Ze(),valueType:t,..._r(e)}):new ghe({type:"record",keyType:t,valueType:e,..._r(r)})}const xW=Ct("ZodEnum",(t,e)=>{rLt.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(n,i,s)=>gIt(t,n,i),t.enum=e.entries,t.options=Object.values(e.entries);const r=new Set(Object.keys(e.entries));t.extract=(n,i)=>{const s={};for(const a of n)if(r.has(a))s[a]=e.entries[a];else throw new Error(`Key ${a} not found in enum`);return new xW({...e,checks:[],..._r(i),entries:s})},t.exclude=(n,i)=>{const s={...e.entries};for(const a of n)if(r.has(a))delete s[a];else throw new Error(`Key ${a} not found in enum`);return new xW({...e,checks:[],..._r(i),entries:s})}});function ii(t,e){const r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new xW({type:"enum",entries:r,..._r(e)})}const ENt=Ct("ZodLiteral",(t,e)=>{nLt.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>mIt(t,r,n),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function na(t,e){return new ENt({type:"literal",values:Array.isArray(t)?t:[t],..._r(e)})}const ANt=Ct("ZodTransform",(t,e)=>{iLt.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>vIt(t,r),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new YAe(t.constructor.name);r.addIssue=s=>{if(typeof s=="string")r.issues.push(PE(s,r.value,e));else{const a=s;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=t),r.issues.push(PE(a))}};const i=e.transform(r.value,r);return i instanceof Promise?i.then(s=>(r.value=s,r.fallback=!0,r)):(r.value=i,r.fallback=!0,r)}});function MNt(t){return new ANt({type:"transform",transform:t})}const k7e=Ct("ZodOptional",(t,e)=>{f7e.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>b7e(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function mhe(t){return new k7e({type:"optional",innerType:t})}const RNt=Ct("ZodExactOptional",(t,e)=>{sLt.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>b7e(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function _Nt(t){return new RNt({type:"optional",innerType:t})}const LNt=Ct("ZodNullable",(t,e)=>{aLt.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>kIt(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function yhe(t){return new LNt({type:"nullable",innerType:t})}const INt=Ct("ZodDefault",(t,e)=>{oLt.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>EIt(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function NNt(t,e){return new INt({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():ZAe(e)}})}const DNt=Ct("ZodPrefault",(t,e)=>{lLt.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>AIt(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function ONt(t,e){return new DNt({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():ZAe(e)}})}const S7e=Ct("ZodNonOptional",(t,e)=>{cLt.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>SIt(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function PNt(t,e){return new S7e({type:"nonoptional",innerType:t,..._r(e)})}const $Nt=Ct("ZodCatch",(t,e)=>{uLt.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>MIt(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function BNt(t,e){return new $Nt({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}const FNt=Ct("ZodPipe",(t,e)=>{hLt.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>RIt(t,r,n,i),t.in=e.in,t.out=e.out});function vhe(t,e){return new FNt({type:"pipe",in:t,out:e})}const zNt=Ct("ZodReadonly",(t,e)=>{dLt.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>_It(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function VNt(t){return new zNt({type:"readonly",innerType:t})}const HNt=Ct("ZodCustom",(t,e)=>{fLt.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>yIt(t,r)});function GNt(t,e={}){return sIt(HNt,t,e)}function WNt(t,e){return aIt(t,e)}const wW=["summarize","extract-key-points","extract-todos","rewrite-proofread","translate","improve-writing","fix-spelling-grammar","make-shorter","make-longer","simplify-language","change-tone","continue-writing","custom"],qNt=["professional","friendly","casual","direct"],UNt=["en","zh-CN","zh-TW","ja","ko","es","fr","de","pt","pl"],jNt=["image/jpeg","image/png","image/webp","image/gif","application/pdf","application/json","text/plain","text/markdown","text/csv"],YNt=4,bhe=4*1024*1024,XNt=256*1024,KNt=8*1024*1024,E7e=t=>{if(!t||t.length%4!==0||!/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t))return null;const e=t.endsWith("==")?2:t.endsWith("=")?1:0;return t.length/4*3-e},ZNt=t=>t.startsWith("text/")||t==="application/json",EQ=["none","target-language","tone"],AQ=["append","replace","both"],uL=Ze().uuid();Yt({content:Ze().trim().min(1).max(500),sourceTurnId:uL.optional()}).strict();Yt({content:Ze().trim().min(1).max(500),version:sa().int().positive()}).strict();const QNt=Yt({memoId:Ze().trim().min(1).max(100).optional(),notebookId:Ze().trim().min(1).max(100).optional(),notebookTitle:Ze().trim().max(160).optional(),title:Ze().trim().max(160).optional(),selectionMarkdown:Ze().max(2e3).optional(),contentMarkdown:Ze().max(4e3).optional(),contentTruncated:Vn().optional(),diagramKind:ii(["mind-map","flowchart","architecture"]).optional()}).strict(),JNt=Yt({type:ii(["memo","notebook","tag"]),id:Ze().trim().min(1).max(100),title:Ze().trim().max(160).optional()}).strict();Yt({id:uL,threadId:uL,message:Ze().trim().min(1).max(4e3),useMemory:Vn().default(!0),allowNotes:Vn().default(!1),allowWrites:Vn().optional(),locale:ii(["zh-CN","en-US","ja","pl"]).default("en-US"),focus:QNt.optional(),mentions:Kn(JNt).max(8).optional(),attachmentIds:Kn(Ze().uuid()).max(4).optional()}).strict();Yt({id:Ze().trim().min(1).max(80),prompt:Ze().trim().min(1).max(200),inputType:ii(["free_text","single_select","multi_select"]),options:Kn(Yt({id:Ze().trim().min(1).max(80),label:Ze().trim().min(1).max(80)}).strict()).min(2).max(6).optional()}).strict();const eDt=Yt({questionId:Ze().trim().min(1).max(80),optionIds:Kn(Ze().trim().min(1).max(80)).max(6).optional(),text:Ze().trim().max(400).optional()}).strict();Yt({answers:Kn(eDt).max(3).optional()}).strict();Yt({name:Ze().trim().min(1).max(80),input:LD(Ze(),Dd()).default({}),callId:Ze().trim().min(1).max(100).optional(),response:Ze().max(16e3).optional(),process:Ze().max(32e3).optional()}).strict();Yt({response:Ze().max(16e3),process:Ze().max(32e3).optional()}).strict();Yt({response:Ze().max(16e3),process:Ze().max(32e3).optional(),status:ii(["completed","interrupted","failed"]),inputTokens:sa().int().nonnegative().optional(),outputTokens:sa().int().nonnegative().optional()}).strict();Yt({enabled:Vn(),learningEnabled:Vn().optional(),useMemory:Vn().optional(),version:sa().int().nonnegative()}).strict();const tDt=Ze().trim().min(1).max(180).refine(t=>t.split(/\r?\n/).length<=3,"Discovery body must contain at most 3 lines.");Yt({suggestion:Yt({kind:ii(["insight","merge","append","move","tag"]),title:Ze().trim().min(1).max(60),body:tDt,sourceIds:Kn(Ze().min(1).max(100)).min(1).max(5),memoryIds:Kn(Ze().max(100)).max(8).optional(),notebookId:Ze().max(100).nullable().optional(),tags:Kn(Ze().min(1).max(40)).max(5).optional(),targetId:Ze().max(100).nullable()}).nullable()});Yt({turnId:uL,output:Dd()}).strict();const MQ=Ze().trim().min(1).max(400),A7e=Ze().trim().min(1).max(100),rDt=Yt({kind:na("merge"),memoIds:Kn(A7e).min(2).max(5),title:Ze().trim().min(1).max(160),reason:MQ}).strict(),nDt=Yt({kind:na("tag"),memoId:A7e,tags:Kn(Ze().trim().min(1).max(40)).min(1).max(5),reason:MQ}).strict(),iDt=Yt({kind:na("tool"),toolName:Ze().min(1).max(80),arguments:LD(Ze(),Dd()),reason:MQ}).strict();C7e("kind",[rDt,nDt,iDt]);Yt({version:$E([na(1),na(2)]),memories:Kn(Yt({content:Ze().trim().min(1).max(500),kind:ii(["explicit","inferred"]).optional()})).max(50),controls:Yt({useMemory:Vn(),learningEnabled:Vn()}).optional()}).strict();const qv=(t,e,r,n,i)=>({...t,...e,translations:{"zh-CN":e,"en-US":r,ja:n,pl:i}});qv({key:"summarize",action:"summarize",parameterKind:"none",resultMode:"append"},{name:"精简总结",description:"压缩全文,提炼主题、结论与可执行结果",instruction:["对笔记做真正的精简总结,不要逐句改写、同义复述或回声式重写。","识别中心主题、主要主张、关键结论与可执行结果。","省略重复、修辞、举例、引语和次要细节,除非它们对理解关键结论必不可少。","较长笔记目标约为原文 20–30% 篇幅,用 3–7 条简洁 Markdown 要点;短笔记用 1–3 句即可。","不要大段照搬原文,也不要添加原文没有的信息。","保持笔记原语言,只返回 Markdown 总结。"].join("")},{name:"Summarize",description:"Condense the note into its topic, conclusions, and actionable outcomes",instruction:["Create a genuinely condensed summary of the note rather than rewriting, paraphrasing line by line, or echoing it. ","Identify the central topic, main claims, essential conclusions, and actionable outcomes. ","Omit repetition, rhetorical phrasing, examples, quotations, and minor details unless necessary to understand a key conclusion. ","For a substantial note, target roughly 20–30% of the source length and use 3–7 concise Markdown bullet points; for a short note, use 1–3 concise sentences. ","Do not reproduce long passages verbatim or add facts that are not present in the source. ","Preserve the note's language and return only the summary in Markdown."].join("")},{name:"要約する",description:"テーマ、結論、実行できる結果に圧縮する",instruction:["ノートを本当に要約してください。逐語の言い換え、行ごとの書き換え、エコーのような再述はしないでください。","中心テーマ、主要な主張、重要な結論、実行できる結果を抜き出してください。","繰り返し、修辞、例示、引用、枝葉の詳細は、重要な結論を理解するのに必要でない限り省いてください。","長いノートは原文のおよそ 20–30% を目安に、3–7 個の簡潔な Markdown 箇条書きにしてください。短いノートは 1–3 文で構いません。","長い原文をそのまま写したり、原文にない事実を足したりしないでください。","ノートの言語を保ち、Markdown の要約だけを返してください。"].join("")},{name:"Podsumuj",description:"Streść notatkę do tematu, wniosków i działań do podjęcia",instruction:["Utwórz faktycznie skondensowane podsumowanie notatki, zamiast ją przepisywać, parafrazować zdanie po zdaniu lub powtarzać. ","Wskaż główny temat, najważniejsze tezy, kluczowe wnioski i działania do podjęcia. ","Pomiń powtórzenia, ozdobniki retoryczne, przykłady, cytaty i drobne szczegóły, chyba że są niezbędne do zrozumienia kluczowego wniosku. ","W przypadku obszernej notatki celuj w około 20–30% długości oryginału i użyj 3–7 zwięzłych punktów listy Markdown; w przypadku krótkiej notatki wystarczą 1–3 zwięzłe zdania. ","Nie przytaczaj dosłownie długich fragmentów i nie dodawaj faktów, których nie ma w oryginale. ","Zachowaj język notatki i zwróć wyłącznie podsumowanie w formacie Markdown."].join("")}),qv({key:"translate",action:"translate",parameterKind:"target-language",resultMode:"both"},{name:"全文翻译",description:"翻译为指定目标语言,保留结构与格式",instruction:"将完整笔记翻译成用户指定的目标语言。保留原意、Markdown 结构、链接与代码块。只返回译文,不要评论。"},{name:"Translate",description:"Translate into a selected language while preserving formatting",instruction:"Translate the complete note into the target language specified by the user. Preserve its meaning, Markdown structure, links, and code blocks. Return only the translated note without commentary."},{name:"翻訳する",description:"指定した言語へ翻訳し、構造と書式を残す",instruction:"ノート全体を、ユーザーが指定した目標言語へ翻訳してください。意味、Markdown の構造、リンク、コードブロックは残してください。解説は付けず、訳文だけを返してください。"},{name:"Przetłumacz",description:"Przetłumacz na wybrany język, zachowując formatowanie",instruction:"Przetłumacz całą notatkę na język docelowy wskazany przez użytkownika. Zachowaj jej znaczenie, strukturę Markdown, linki i bloki kodu. Zwróć wyłącznie przetłumaczoną notatkę, bez komentarzy."}),qv({key:"improve-writing",action:"improve-writing",parameterKind:"none",resultMode:"both"},{name:"润色表达",description:"校正语言并提升文字的清晰度与流畅度",instruction:"润色内容,修正错别字、语法与标点,改善用词、句式、清晰度和流畅度,但不要改变原意或刻意缩短内容。保持原语言与有用的 Markdown 格式。只返回润色后的内容。"},{name:"Polish",description:"Correct the language and improve clarity and flow",instruction:"Polish the content by correcting spelling, grammar, and punctuation and improving word choice, sentence structure, clarity, and flow. Do not change its meaning or deliberately shorten it. Preserve its language and useful Markdown formatting. Return only the polished content."},{name:"文章を整える",description:"誤字と文法を直し、わかりやすさと流れを上げる",instruction:"内容を整えてください。誤字、文法、句読点を直し、語彙、文の形、明瞭さ、流れを改善します。意味を変えたり、意図的に短くしたりしないでください。元の言語と有用な Markdown 書式は残してください。整えた本文だけを返してください。"},{name:"Popraw styl",description:"Popraw język oraz zwiększ przejrzystość i płynność tekstu",instruction:"Dopracuj treść: popraw pisownię, gramatykę i interpunkcję oraz ulepsz dobór słów, budowę zdań, przejrzystość i płynność. Nie zmieniaj jej znaczenia ani celowo jej nie skracaj. Zachowaj jej język i przydatne formatowanie Markdown. Zwróć wyłącznie dopracowaną treść."}),qv({key:"make-shorter",action:"make-shorter",parameterKind:"none",resultMode:"both"},{name:"精炼表达",description:"删去重复与冗余,让表达更简洁有力",instruction:"精炼内容,删除重复、空话和不必要的修饰,合并可以合并的句子,使表达简洁、清晰、有力。保留所有关键事实、观点与原意,不要添加新信息。保持原语言与有用的 Markdown 格式。只返回精炼后的内容。"},{name:"Make concise",description:"Remove repetition and make the writing concise and direct",instruction:"Refine the content by removing repetition, filler, and unnecessary modifiers and by combining sentences where useful. Make it concise, clear, and direct while preserving every key fact, claim, and the original meaning. Do not add new information. Preserve its language and useful Markdown formatting. Return only the refined content."},{name:"簡潔にする",description:"重複と冗長さを削り、短くはっきり書く",instruction:"内容を簡潔にしてください。繰り返し、空疎な言い回し、不要な修飾を削り、まとめられる文はまとめて、短く、はっきり、力強くしてください。重要な事実、主張、元の意味はすべて残し、新しい情報は足さないでください。元の言語と有用な Markdown 書式は残してください。簡潔にした本文だけを返してください。"},{name:"Skróć i uprość",description:"Usuń powtórzenia i napisz tekst zwięźle i konkretnie",instruction:"Dopracuj treść, usuwając powtórzenia, puste frazy i zbędne określenia oraz łącząc zdania tam, gdzie to pomaga. Spraw, by tekst był zwięzły, jasny i konkretny, zachowując każdy kluczowy fakt, tezę i pierwotne znaczenie. Nie dodawaj nowych informacji. Zachowaj jej język i przydatne formatowanie Markdown. Zwróć wyłącznie dopracowaną treść."}),qv({key:"extract-todos",action:"extract-todos",parameterKind:"none",resultMode:"append"},{name:"提取待办",description:"识别可执行任务,生成任务清单",instruction:"从笔记中提取明确或隐含的可执行任务,用 Markdown 任务列表(- [ ])输出。保持原语言,不要编造任务。若没有可执行事项,用原文语言简短说明。"},{name:"Extract tasks",description:"Identify actionable work and produce a task list",instruction:"Extract explicit or implied actionable tasks from the note as a Markdown task list using '- [ ]'. Preserve its language and do not invent tasks. If there are no actionable tasks, say so briefly in the note's language."},{name:"タスクを抜き出す",description:"実行できる作業を見つけ、チェックリストにする",instruction:"ノートから明示または含意された実行可能なタスクを抜き出し、Markdown のタスクリスト(- [ ])で出力してください。ノートの言語を保ち、タスクを捏造しないでください。実行できることがなければ、ノートの言語で短くそう書いてください。"},{name:"Wyodrębnij zadania",description:"Znajdź działania do wykonania i utwórz listę zadań",instruction:"Wyodrębnij z notatki jawne lub domniemane zadania do wykonania jako listę zadań Markdown z użyciem '- [ ]'. Zachowaj jej język i nie wymyślaj zadań. Jeśli nie ma zadań do wykonania, napisz to krótko w języku notatki."}),qv({key:"continue-writing",action:"continue-writing",parameterKind:"none",resultMode:"append"},{name:"继续写作",description:"从笔记末尾自然续写",instruction:"从笔记结束处自然续写。只返回新增续写内容,不要重复原文。保持原语言与 Markdown 风格。"},{name:"Continue writing",description:"Continue naturally from the end of the note",instruction:"Continue writing naturally from where the note ends. Return only the new continuation, not the original content. Preserve its language and Markdown style."},{name:"続きを書く",description:"ノートの末尾から自然に書き継ぐ",instruction:"ノートの終わりから自然に書き継いでください。原文は繰り返さず、新しい続きだけを返してください。元の言語と Markdown の調子を保ってください。"},{name:"Pisz dalej",description:"Kontynuuj naturalnie od końca notatki",instruction:"Kontynuuj pisanie naturalnie od miejsca, w którym kończy się notatka. Zwróć wyłącznie nową kontynuację, bez oryginalnej treści. Zachowaj jej język i styl Markdown."});const sDt=new Set([qf,tb]),hC=(t,e)=>{var n;const r=(n=t.attrs)==null?void 0:n[e];return typeof r=="string"?r:""},xhe="edgeever-attachment-kind-",RQ=t=>t.replace(/^\s*(?:附件[::]|Attachment:)\s*/i,"").trim(),M7e=(t,e,r)=>{const n=typeof r=="string"?r.split(/\s+/).filter(s=>s&&s!=="edgeever-attachment-link"&&!s.startsWith(xhe)):[],i=f5(e,RQ(t));return[...n,"edgeever-attachment-link",`${xhe}${i}`].join(" ")},aDt=Wi.create({name:"edgeeverNativeAttachmentMetadata",addGlobalAttributes(){return[{types:["link"],attributes:{attachmentFilename:{default:null,parseHTML:t=>t.getAttribute("data-attachment-filename"),renderHTML:t=>t.attachmentFilename?{"data-attachment-filename":String(t.attachmentFilename)}:{}},attachmentMimeType:{default:null,parseHTML:t=>t.getAttribute("data-attachment-mime-type"),renderHTML:t=>t.attachmentMimeType?{"data-attachment-mime-type":String(t.attachmentMimeType)}:{}},attachmentByteSize:{default:null,parseHTML:t=>Tg(t.getAttribute("data-attachment-byte-size")),renderHTML:t=>{const e=Tg(t.attachmentByteSize),r=typeof t.attachmentFilename=="string"?t.attachmentFilename:"",n=typeof t.attachmentMimeType=="string"?t.attachmentMimeType:"";return!r&&!n&&e===null?{}:{...e===null?{}:{"data-attachment-byte-size":String(e)},"data-attachment-meta":GMt(n,r,e)}}}}}]}}),whe=t=>{var n,i;if(t.type!=="link")return!1;const e=typeof((n=t.attrs)==null?void 0:n.href)=="string"?t.attrs.href:"";return(typeof((i=t.attrs)==null?void 0:i.class)=="string"?t.attrs.class:"").split(/\s+/).includes("edgeever-attachment-link")||e.includes("/api/v1/resources/")},oDt=t=>{var e;return(e=t.marks)!=null&&e.some(whe)?{...t,marks:t.marks.map(r=>{var n,i;return whe(r)?{...r,attrs:{...r.attrs,class:M7e(t.text,null,(n=r.attrs)==null?void 0:n.class),attachmentFilename:typeof((i=r.attrs)==null?void 0:i.attachmentFilename)=="string"?r.attrs.attachmentFilename:RQ(t.text)}}:r})}:t},lDt=t=>{var a;const e=hC(t,"url"),r=hC(t,"label")||hC(t,"filename")||"Attachment",n=hC(t,"mimeType"),i=hC(t,"filename")||RQ(r),s=Tg((a=t.attrs)==null?void 0:a.byteSize);return{type:"text",text:r,...e?{marks:[{type:"link",attrs:{href:e,target:"_blank",class:M7e(r,n),attachmentFilename:i,attachmentMimeType:n,attachmentByteSize:s}}]}:{}}},cDt=t=>{const e=r=>sDt.has(r.type)?lDt(r):"content"in r&&r.content?{...r,content:r.content.map(e)}:r.type==="text"?oDt(r):r;return{...t,content:t.content.map(r=>e(r))}},uDt="edgeever-zip",hDt=2,vh=Ze().datetime();Yt({format:na(uDt),formatVersion:$E([na(1),na(hDt)]),schemaVersion:sa().int().positive(),edgeeverVersion:Ze().trim().min(1),buildId:Ze().trim().min(1),exportedAt:vh,includesTrash:na(!1),counts:Yt({notebooks:sa().int().min(0),memos:sa().int().min(0),revisions:sa().int().min(0),resources:sa().int().min(0),prompts:sa().int().min(0).optional()})});const dDt=Yt({id:Ze().trim().min(1),parentId:Ze().trim().min(1).nullable(),name:Ze().trim().min(1).max(80),slug:Ze().nullable(),icon:Ze().nullable(),color:Ze().nullable(),sortOrder:sa().int(),createdAt:vh,updatedAt:vh}),fDt=Yt({id:Ze().trim().min(1),memoId:Ze().trim().min(1),revision:sa().int().min(0),title:Ze().nullable(),tags:Kn(Ze()),contentJson:Dd(),contentMarkdown:Ze(),contentText:Ze(),contentHash:Ze(),createdBy:Ze(),createdAt:vh}),pDt=Yt({id:Ze().trim().min(1),notebookId:Ze().trim().min(1),title:Ze().nullable(),excerpt:Ze(),tags:Kn(Ze()),isPinned:Vn(),isArchived:Vn(),isDeleted:Vn(),revision:sa().int().min(0),createdAt:vh,updatedAt:vh,deletedAt:vh.nullable(),contentJson:Dd(),contentMarkdown:Ze(),contentText:Ze(),contentHash:Ze(),sourceMemoIds:Kn(Ze()),mergeSourceCount:sa().int().min(0),mergedIntoMemoId:Ze().nullable()}),R7e=Yt({memo:pDt,revisions:Kn(fDt),resources:Kn(Yt({id:Ze().trim().min(1),memoId:Ze().trim().min(1),originalMemoId:Ze().nullable(),kind:ii(["image","attachment"]),mimeType:Ze().nullable(),filename:Ze().nullable(),byteSize:sa().int().min(0),sha256:Ze().nullable(),width:sa().int().positive().nullable(),height:sa().int().positive().nullable(),createdAt:vh,updatedAt:vh,archivePath:Ze().trim().min(1)}))});Yt({notebooks:Kn(dDt).min(1).max(100)});Yt({memos:Kn(R7e).min(1).max(10)});const gDt=Yt({id:Ze().trim().min(1).max(200),origin:ii(["default","custom"]),seedKey:ii(wW.filter(t=>t!=="custom")).nullable(),action:ii(wW),parameterKind:ii(EQ),resultMode:ii(AQ),nameCustomized:Vn(),descriptionCustomized:Vn(),instructionCustomized:Vn(),name:Ze().trim().min(1).max(80),description:Ze().max(200).nullable(),instruction:Ze().trim().min(1).max(2e3),createdAt:vh,updatedAt:vh}).superRefine((t,e)=>{t.origin==="default"&&!t.seedKey&&e.addIssue({code:"custom",path:["seedKey"],message:"A default prompt must include a seed key."}),t.origin==="default"&&t.seedKey&&t.action!==t.seedKey&&e.addIssue({code:"custom",path:["action"],message:"A default prompt action must match its seed key."}),t.origin==="custom"&&(t.seedKey!==null||t.action!=="custom")&&e.addIssue({code:"custom",path:["origin"],message:"A custom prompt cannot use factory prompt identity."})});Yt({prompts:Kn(gDt).max(100)});R7e.shape.resources.element;const dC=(t,e,r,n,i)=>({...t,translations:{"zh-CN":e,"en-US":r,ja:n,pl:i}});dC({key:"quick-note",translationKey:"quickNote",tag:"quick-note"},{title:"灵感速记",description:"快速捕捉闪念、临时灵感、资料链接与即刻行动。",contentMarkdown:`## 💡 闪念记录--+-## 📌 背景与补充说明@@ -1534,7 +1534,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.- [ ] `},{title:"Quick Spark",description:"Capture fleeting thoughts, ideas, links, and immediate action items.",contentMarkdown:`## 💡 Fleeting Thoughts--+-## 📌 Context & Notes@@ -1544,7 +1544,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.- [ ] `},{title:"ひらめきメモ",description:"ふとした思いつき、アイデア、リンク、すぐやることをすばやく書き留めます。",contentMarkdown:`## 💡 ひらめき--+-## 📌 背景と補足@@ -1554,7 +1554,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.- [ ] `},{title:"Szybka notatka",description:"Zapisuj ulotne myśli, pomysły, linki i działania do natychmiastowego podjęcia.",contentMarkdown:`## 💡 Ulotne myśli--+-## 📌 Kontekst i uwagi@@ -1572,7 +1572,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.## 🎯 会议目标--+-## 💬 核心讨论与决策@@ -1598,7 +1598,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.## 🎯 Goal--+-## 💬 Discussion & Decisions@@ -1624,7 +1624,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.## 🎯 会議の目的--+-## 💬 議論と決定@@ -1650,7 +1650,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.## 🎯 Cel--+-## 💬 Dyskusja i decyzje@@ -1679,13 +1679,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.## 🎯 下周优先级 (Next Week Priorities)-- [ ]-- [ ]-- [ ]+- [ ]+- [ ]+- [ ]## 💡 总结与思考--+-`},{title:"Weekly Review & Status",description:"Summarize weekly highlights, blockers, and next week's key priorities.",contentMarkdown:`# 🗓️ Weekly Status Report## 🌟 Highlights@@ -1699,13 +1699,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.## 🎯 Next Week Priorities-- [ ]-- [ ]-- [ ]+- [ ]+- [ ]+- [ ]## 💡 Reflection & Insights--+-`},{title:"週次レビュー",description:"今週の成果、ブロッカー、来週の優先事項を整理します。",contentMarkdown:`# 🗓️ 週次レポート## 🌟 今週のハイライト@@ -1719,13 +1719,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.## 🎯 来週の優先事項-- [ ]-- [ ]-- [ ]+- [ ]+- [ ]+- [ ]## 💡 振り返り--+-`},{title:"Przegląd tygodnia i postępy",description:"Podsumuj najważniejsze osiągnięcia tygodnia, blokery i kluczowe priorytety na kolejny tydzień.",contentMarkdown:`# 🗓️ Tygodniowy raport postępów## 🌟 Najważniejsze osiągnięcia@@ -1739,13 +1739,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.## 🎯 Priorytety na kolejny tydzień-- [ ]-- [ ]-- [ ]+- [ ]+- [ ]+- [ ]## 💡 Refleksje i wnioski--+-`}),dC({key:"reading",translationKey:"reading",tag:"reading"},{title:"深度阅读卡片",description:"提炼核心观点、精妙摘录、个人理解与关联知识卡片。",contentMarkdown:`# 📖 深度阅读卡片- **书名/文章**:@@ -1756,7 +1756,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.## 💡 一句话总结 (Key Takeaway)->+>## ✍️ 核心观点与金句摘录@@ -1765,7 +1765,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.## 🧠 我的理解与延伸思考--+-## 🔗 关联知识与行动@@ -1780,7 +1780,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.## 💡 Key Takeaway->+>## ✍️ Highlights & Quotes@@ -1789,7 +1789,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.## 🧠 Personal Reflections--+-## 🔗 Action & Practice@@ -1804,7 +1804,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.## 💡 一言まとめ->+>## ✍️ 要点と引用@@ -1813,7 +1813,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.## 🧠 自分の理解と考察--+-## 🔗 関連知識とアクション@@ -1828,7 +1828,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.## 💡 Najważniejszy wniosek->+>## ✍️ Najciekawsze fragmenty i cytaty@@ -1837,7 +1837,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.## 🧠 Własne refleksje--+-## 🔗 Działanie i praktyka@@ -1851,7 +1851,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.## 📌 目标 (Objective)->+>## 📈 关键结果 (Key Results)@@ -1865,8 +1865,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.## 📋 执行任务清单-- [ ]-- [ ]+- [ ]+- [ ]`},{title:"Goal & Task Breakdown",description:"Define OKRs, Key Results, milestones, and task checklists.",contentMarkdown:`# 🎯 Goal Breakdown- **Period**:@@ -1876,7 +1876,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.## 📌 Objective->+>## 📈 Key Results@@ -1890,8 +1890,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.## 📋 Execution Checklist-- [ ]-- [ ]+- [ ]+- [ ]`},{title:"目標とタスク分解",description:"OKR の目標、主要な結果、マイルストーン、実行チェックリストを定義します。",contentMarkdown:`# 🎯 目標の分解- **期間**:@@ -1901,7 +1901,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.## 📌 目標 (Objective)->+>## 📈 主要な結果 (Key Results)@@ -1915,8 +1915,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.## 📋 実行チェックリスト-- [ ]-- [ ]+- [ ]+- [ ]`},{title:"Cele i podział zadań",description:"Określ cele OKR, kluczowe rezultaty, kamienie milowe i listy zadań.",contentMarkdown:`# 🎯 Podział celu- **Okres**:@@ -1926,7 +1926,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.## 📌 Cel (Objective)->+>## 📈 Kluczowe rezultaty (Key Results)@@ -1940,13 +1940,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.## 📋 Lista zadań do wykonania-- [ ]-- [ ]+- [ ]+- [ ]`});const mDt=["clay","orange","dawn","teal","azure","violet","pink","slate"],yDt=["native",...mDt],vDt=8*1024;Yt({name:Ze().trim().min(1).max(80),parentId:Ze().trim().min(1).nullable().optional()});Yt({name:Ze().trim().min(1).max(80).optional(),parentId:Ze().trim().min(1).nullable().optional(),sortOrder:sa().int().optional()});Yt({notebookId:Ze().trim().min(1),title:Ze().trim().max(160).optional(),contentJson:Dd().optional(),contentMarkdown:Ze().optional(),tags:Kn(Ze()).optional(),createdAt:Ze().datetime().optional(),updatedAt:Ze().datetime().optional()});Yt({expectedRevision:sa().int().min(0).optional(),expectedContentHash:Ze().length(64).optional(),editSessionId:Ze().trim().min(1).optional(),notebookId:Ze().trim().min(1).optional(),title:Ze().trim().max(160).optional(),isPinned:Vn().optional(),contentJson:Dd().optional(),contentMarkdown:Ze().optional(),tags:Kn(Ze()).optional(),createdAt:Ze().datetime().optional(),updatedAt:Ze().datetime().optional(),allowDestructiveOverwrite:Vn().optional()});Yt({name:Ze().trim().min(1).max(160),description:Ze().trim().max(500).optional(),memoId:Ze().trim().min(1).optional(),title:Ze().trim().max(160).nullable().optional(),contentMarkdown:Ze().optional(),tags:Kn(Ze()).optional()}).refine(t=>t.memoId||t.contentMarkdown!==void 0,{message:"memoId or contentMarkdown is required"});Yt({name:Ze().trim().min(1).max(160).optional(),description:Ze().trim().max(500).nullable().optional(),title:Ze().trim().max(160).nullable().optional(),contentMarkdown:Ze().optional(),tags:Kn(Ze()).optional()});Yt({notebookId:Ze().trim().min(1)});const _7e=Yt({pluginId:Ze().trim().min(3).max(200),commandId:Ze().trim().min(1).max(200)}),bDt=Yt({name:Ze().trim().min(1).max(120),taskType:na("plugin-command"),taskPayload:_7e,cronExpression:Ze().trim().min(1).max(160),timezone:Ze().trim().min(1).max(80),executorDeviceId:Ze().trim().min(16).max(160),missedRunPolicy:ii(["run-once","skip"]).default("run-once"),isEnabled:Vn().default(!0)});bDt.omit({taskType:!0,taskPayload:!0,executorDeviceId:!0}).partial().extend({taskPayload:_7e.optional(),executorDeviceId:Ze().trim().min(16).max(160).optional()}).refine(t=>Object.values(t).some(e=>e!==void 0),{message:"At least one field is required."});Yt({pluginId:Ze().trim().min(3).max(200),scheduleKey:Ze().trim().regex(/^[a-z0-9][a-z0-9._-]*$/i).max(120),name:Ze().trim().min(1).max(120),commandId:Ze().trim().min(1).max(200),cronExpression:Ze().trim().min(1).max(160),timezone:Ze().trim().min(1).max(80),executorDeviceId:Ze().trim().min(16).max(160),missedRunPolicy:ii(["run-once","skip"]).default("run-once"),isEnabled:Vn().optional()});Yt({scheduledFor:Ze().datetime(),executorDeviceId:Ze().trim().min(16).max(160)});Yt({executorDeviceId:Ze().trim().min(16).max(160),status:ii(["succeeded","failed"]),errorMessage:Ze().trim().max(2e3).nullable().optional()});const The=Ze().trim().max(2e3).refine(t=>{try{const e=new URL(t);return e.protocol==="http:"||e.protocol==="https:"}catch{return!1}},{message:"URL must use http or https."});Yt({type:ii(["plugin","theme"]),version:Ze().trim().regex(/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/).max(80),enabled:Vn(),installedAt:Ze().datetime(),manifestUrl:The,sourceKind:ii(["marketplace","github","manifest"]),verified:Vn(),repositoryUrl:The.max(500).nullable().optional(),releaseTag:Ze().trim().min(1).max(80).nullable().optional(),publisher:na("edgeever").nullable().optional()}).refine(t=>t.sourceKind==="github"?!!t.repositoryUrl:t.sourceKind==="marketplace"?!!(t.repositoryUrl||t.manifestUrl):!0,{message:"GitHub and marketplace extensions require a source URL."});Yt({memoIds:Kn(Ze().trim().min(1)).min(1).max(100),notebookId:Ze().trim().min(1)});Yt({memoIds:Kn(Ze().trim().min(1)).min(1).max(100),permanent:Vn().optional()});Yt({memoIds:Kn(Ze().trim().min(1)).min(2).max(50),notebookId:Ze().trim().min(1).optional(),title:Ze().trim().max(160).optional()});Yt({username:Ze().trim().min(1).max(80),password:Ze().min(1).max(512),deviceId:Ze().trim().min(16).max(160).optional()});Yt({label:Ze().trim().max(80).nullable()});Yt({currentPassword:Ze().min(1).max(512),newPassword:Ze().min(8).max(512),confirmPassword:Ze().min(8).max(512)}).refine(t=>t.newPassword===t.confirmPassword,{message:"New passwords do not match.",path:["confirmPassword"]});Yt({username:Ze().trim().min(1).max(80),displayName:Ze().trim().max(80).nullable().optional(),password:Ze().min(8).max(512)});Yt({displayName:Ze().trim().max(80).nullable().optional(),password:Ze().min(8).max(512).optional(),isDisabled:Vn().optional()}).refine(t=>Object.keys(t).length>0,"At least one field is required.");Yt({name:Ze().trim().min(1).max(80),scopes:Kn(Ze().trim().min(1).max(80)).min(1).max(32),expiresAt:Ze().datetime().nullable().optional()});Yt({name:Ze().trim().min(1).max(80)});Yt({filename:Ze().trim().min(1).max(160)});const L7e=Ze().trim().url().max(500).refine(t=>t.startsWith("https://")||t.startsWith("http://"),"Object storage endpoint must use HTTP or HTTPS.");C7e("provider",[Yt({provider:na("builtin")}),Yt({provider:na("s3"),displayName:Ze().trim().min(1).max(80),endpoint:L7e,region:Ze().trim().min(1).max(80),bucket:Ze().trim().min(1).max(255),accessKeyId:Ze().trim().min(1).max(256),secretAccessKey:Ze().min(1).max(1024).optional(),forcePathStyle:Vn().default(!0),objectPrefix:Ze().trim().max(500).default("")})]);Yt({endpoint:L7e,region:Ze().trim().min(1).max(80),bucket:Ze().trim().min(1).max(255),accessKeyId:Ze().trim().min(1).max(256),secretAccessKey:Ze().min(1).max(1024).optional(),forcePathStyle:Vn().default(!0),objectPrefix:Ze().trim().max(500).default("")});const I7e=ii(["openai-compatible","anthropic","google"]),N7e=ii(["openai-compatible"]),D7e=(t,e)=>{let r;try{r=new URL(t)}catch{e.addIssue({code:"custom",message:"AI Base URL must be a valid URL."});return}r.protocol!=="http:"&&r.protocol!=="https:"&&e.addIssue({code:"custom",message:"AI Base URL must use HTTP or HTTPS."}),(r.username||r.password)&&e.addIssue({code:"custom",message:"AI Base URL must not contain credentials."})},O7e=Ze().trim().url().max(500).superRefine(D7e),P7e=Ze().trim().min(1).max(500).superRefine((t,e)=>{if(!Ze().url().safeParse(t).success){e.addIssue({code:"custom",message:"AI Base URL must be a valid URL."});return}D7e(t,e)});Yt({provider:N7e.default("openai-compatible"),displayName:Ze().trim().min(1).max(80),baseUrl:P7e,apiKey:Ze().trim().min(1).max(4096),isEnabled:Vn().default(!0),initialModelId:Ze().trim().min(1).max(200).optional()});Yt({provider:N7e.default("openai-compatible"),displayName:Ze().trim().min(1).max(80),baseUrl:P7e,apiKey:Ze().trim().min(1).max(4096).optional(),isEnabled:Vn().default(!0)});Yt({modelId:Ze().trim().min(1).max(200),displayName:Ze().trim().min(1).max(80).optional()});Yt({modelConfigId:Ze().trim().min(1).nullable()});const $7e=Yt({provider:I7e,displayName:Ze().trim().min(1).max(80),baseUrl:O7e,isEnabled:Vn().default(!0)});$7e.extend({apiKey:Ze().min(1).max(4096),initialModelId:Ze().trim().min(1).max(200).optional()});$7e.extend({apiKey:Ze().min(1).max(4096).optional()});Yt({modelId:Ze().trim().min(1).max(200),provider:I7e.optional(),baseUrl:O7e.optional(),apiKey:Ze().min(1).max(4096).optional()});Yt({modelId:Ze().trim().min(1).max(200),displayName:Ze().trim().min(1).max(200).optional()});Yt({modelConfigId:Ze().trim().min(1).nullable()});const xDt=Yt({filename:Ze().trim().min(1).max(255).regex(/^[^\u0000-\u001F\u007F]+$/),mediaType:ii(jNt),base64Data:Ze().min(1).max(Math.ceil(bhe/3)*4)}).superRefine((t,e)=>{const r=E7e(t.base64Data);if(r===null){e.addIssue({code:"custom",path:["base64Data"],message:"Attachment data must be valid base64."});return}const n=ZNt(t.mediaType)?XNt:bhe;r>n&&e.addIssue({code:"custom",path:["base64Data"],message:"The attachment is too large."})});Yt({action:ii(wW),promptId:Ze().trim().min(1).max(200).optional(),locale:Ze().trim().min(2).max(35).optional(),title:Ze().trim().max(160).default(""),contentMarkdown:Ze().max(3e5),stream:Vn().default(!1),targetLanguage:ii(UNt).optional(),tone:ii(qNt).optional(),instruction:Ze().trim().min(1).max(2e3).optional(),attachments:Kn(xDt).max(YNt).default([])}).superRefine((t,e)=>{!t.promptId&&t.action==="translate"&&!t.targetLanguage&&e.addIssue({code:"custom",path:["targetLanguage"],message:"A target language is required for translation."}),!t.promptId&&t.action==="change-tone"&&!t.tone&&e.addIssue({code:"custom",path:["tone"],message:"A tone is required when changing tone."}),!t.promptId&&t.action==="custom"&&!t.instruction&&e.addIssue({code:"custom",path:["instruction"],message:"An instruction is required for a custom action."});const r=t.action==="custom"&&!!(t.instruction||t.promptId);!t.title&&!t.contentMarkdown.trim()&&t.attachments.length===0&&!r&&e.addIssue({code:"custom",path:["contentMarkdown"],message:"Note content is required."}),t.attachments.reduce((i,s)=>i+(E7e(s.base64Data)??0),0)>KNt&&e.addIssue({code:"custom",path:["attachments"],message:"The attachments are too large in total."})});Yt({title:Ze().trim().max(160).default(""),contentMarkdown:Ze().max(3e5),currentTags:Kn(Ze().trim().min(1).max(200)).max(24).default([]),locale:Ze().trim().min(2).max(35).optional()}).superRefine((t,e)=>{!t.title&&!t.contentMarkdown.trim()&&e.addIssue({code:"custom",path:["contentMarkdown"],message:"Note content is required."})});Yt({name:Ze().trim().min(1).max(80),description:Ze().trim().max(200).optional(),instruction:Ze().trim().min(1).max(2e3),parameterKind:ii(EQ).default("none"),resultMode:ii(AQ).default("both")});Yt({name:Ze().trim().min(1).max(80).optional(),description:Ze().trim().max(200).nullable().optional(),instruction:Ze().trim().min(1).max(2e3).optional(),parameterKind:ii(EQ).optional(),resultMode:ii(AQ).optional()}).refine(t=>Object.values(t).some(e=>e!==void 0),{message:"At least one field is required."});Yt({passwordProtected:Vn()});Yt({bodyFont:ii(["wenkai","wenkai-screen","zhuque","source-han-serif","neo-zhi-song","source-han-sans","source-serif"]).nullable()});const hp=Ze().regex(/^#[0-9a-f]{6}$/i),Che=Yt({background:hp,text:hp,muted:hp,heading:hp,accent:hp,soft:hp,codeBackground:hp,border:hp});Yt({fontSize:$E([na(14),na(16),na(18),na(20)]).nullable().optional(),lineHeight:$E([na(1.5),na(1.65),na(2)]).nullable().optional(),palette:ii(yDt).nullable().optional(),customCss:Ze().refine(t=>new TextEncoder().encode(t).byteLength<=vDt).nullable().optional(),customColors:Yt({light:Che,dark:Che}).nullable().optional()}).refine(t=>Object.values(t).some(e=>e!==void 0),{message:"At least one field is required."});Yt({password:Ze().min(1).max(64)});const wDt=Yt({fieldId:Ze().trim().min(1).max(80),required:Vn()});Yt({enabled:Vn(),passwordProtected:Vn(),rotatePassword:Vn().optional(),title:Ze().trim().max(120),description:Ze().trim().max(1e3),submitLabel:Ze().trim().max(40),fields:Kn(wDt).max(40)});Yt({cells:LD(Ze().max(80),Dd())});const B7e="3.9.3",TDt=B7e,khe=typeof TextDecoder=="function"?new TextDecoder("utf-8",{ignoreBOM:!0}):void 0,She=typeof TextEncoder=="function"?new TextEncoder:void 0,CDt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",nk=Array.prototype.slice.call(CDt),s8=(t=>{let e={};return t.forEach((r,n)=>e[r]=n),e})(nk),kDt=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,vo=String.fromCharCode.bind(String),SDt=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):t=>new Uint8Array(Array.prototype.slice.call(t,0)),F7e=t=>t.replace(/=/g,"").replace(/[+\/]/g,e=>e=="+"?"-":"_"),z7e=t=>t.replace(/[^A-Za-z0-9\+\/]/g,""),V7e=t=>{let e,r,n,i,s="";const a=t.length%3;for(let o=0;o<t.length;){if((r=t.charCodeAt(o++))>255||(n=t.charCodeAt(o++))>255||(i=t.charCodeAt(o++))>255)throw new TypeError("invalid character found");e=r<<16|n<<8|i,s+=nk[e>>18&63]+nk[e>>12&63]+nk[e>>6&63]+nk[e&63]}return a?s.slice(0,a-3)+"===".substring(a):s},_Q=typeof btoa=="function"?t=>btoa(t):V7e,TW=typeof Uint8Array.prototype.toBase64=="function"?t=>t.toBase64():t=>{let r=[];for(let n=0,i=t.length;n<i;n+=4096)r.push(vo.apply(null,t.subarray(n,n+4096)));return _Q(r.join(""))},jM=(t,e=!1)=>e?F7e(TW(t)):TW(t),EDt=t=>{if(t.length<2){var e=t.charCodeAt(0);return e<128?t:e<2048?vo(192|e>>>6)+vo(128|e&63):vo(224|e>>>12&15)+vo(128|e>>>6&63)+vo(128|e&63)}else{var e=65536+(t.charCodeAt(0)-55296)*1024+(t.charCodeAt(1)-56320);return vo(240|e>>>18&7)+vo(128|e>>>12&63)+vo(128|e>>>6&63)+vo(128|e&63)}},ADt=/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\x00-\x7F]/g,H7e=t=>t.replace(ADt,EDt),Ehe=She?t=>TW(She.encode(t)):t=>_Q(H7e(t)),Nb=(t,e=!1)=>e?F7e(Ehe(t)):Ehe(t),Ahe=t=>Nb(t,!0),MDt=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,RDt=t=>{switch(t.length){case 4:var e=(7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3),r=e-65536;return vo((r>>>10)+55296)+vo((r&1023)+56320);case 3:return vo((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return vo((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},G7e=t=>t.replace(MDt,RDt),W7e=t=>{if(t=t.replace(/\s+/g,""),!kDt.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(t.length&3));let e,r,n,i=[];for(let s=0;s<t.length;)e=s8[t.charAt(s++)]<<18|s8[t.charAt(s++)]<<12|(r=s8[t.charAt(s++)])<<6|(n=s8[t.charAt(s++)]),r===64?i.push(vo(e>>16&255)):n===64?i.push(vo(e>>16&255,e>>8&255)):i.push(vo(e>>16&255,e>>8&255,e&255));return i.join("")},LQ=typeof atob=="function"?t=>atob(z7e(t)):W7e,q7e=typeof Uint8Array.fromBase64=="function"?t=>Uint8Array.fromBase64(t):t=>SDt(LQ(t).split("").map(e=>e.charCodeAt(0))),U7e=t=>q7e(j7e(t)),_Dt=khe?t=>khe.decode(q7e(t)):t=>G7e(LQ(t)),j7e=t=>z7e(t.replace(/[-_]/g,e=>e=="-"?"+":"/")),CW=t=>_Dt(j7e(t)),LDt=t=>{if(typeof t!="string")return!1;const e=t.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(e)||!/[^\s0-9a-zA-Z\-_]/.test(e)},Y7e=t=>({value:t,enumerable:!1,writable:!0,configurable:!0}),X7e=function(){const t=(e,r)=>Object.defineProperty(String.prototype,e,Y7e(r));t("fromBase64",function(){return CW(this)}),t("toBase64",function(e){return Nb(this,e)}),t("toBase64URI",function(){return Nb(this,!0)}),t("toBase64URL",function(){return Nb(this,!0)}),t("toUint8Array",function(){return U7e(this)})},K7e=function(){const t=(e,r)=>Object.defineProperty(Uint8Array.prototype,e,Y7e(r));t("toBase64",function(e){return jM(this,e)}),t("toBase64URI",function(){return jM(this,!0)}),t("toBase64URL",function(){return jM(this,!0)})},IDt=()=>{X7e(),K7e()},NDt={version:B7e,VERSION:TDt,atob:LQ,atobPolyfill:W7e,btoa:_Q,btoaPolyfill:V7e,fromBase64:CW,toBase64:Nb,encode:Nb,encodeURI:Ahe,encodeURL:Ahe,utob:H7e,btou:G7e,decode:CW,isValid:LDt,fromUint8Array:jM,toUint8Array:U7e,extendString:X7e,extendUint8Array:K7e,extendBuiltins:IDt},ll="#f8fafb",cl="#191e1b",Mhe={client:[{tagName:"path",attrs:{d:"M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8"}},{tagName:"path",attrs:{d:"M10 19v-3.96 3.15"}},{tagName:"path",attrs:{d:"M7 19h5"}},{tagName:"rect",attrs:{width:"6",height:"10",x:"16",y:"12",rx:"2"}}],webApp:[{tagName:"rect",attrs:{x:"2",y:"4",width:"20",height:"16",rx:"2"}},{tagName:"path",attrs:{d:"M10 4v4"}},{tagName:"path",attrs:{d:"M2 8h20"}},{tagName:"path",attrs:{d:"M6 4v4"}}],mobileApp:[{tagName:"rect",attrs:{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2"}},{tagName:"path",attrs:{d:"M12 18h.01"}}],website:[{tagName:"path",attrs:{d:"M21.54 15H17a2 2 0 0 0-2 2v4.54"}},{tagName:"path",attrs:{d:"M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17"}},{tagName:"path",attrs:{d:"M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05"}},{tagName:"circle",attrs:{cx:"12",cy:"12",r:"10"}}],apiClient:[{tagName:"path",attrs:{d:"m18 16 4-4-4-4"}},{tagName:"path",attrs:{d:"m6 8-4 4 4 4"}},{tagName:"path",attrs:{d:"m14.5 4-5 16"}}],service:[{tagName:"rect",attrs:{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2"}},{tagName:"rect",attrs:{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2"}},{tagName:"line",attrs:{x1:"6",x2:"6.01",y1:"6",y2:"6"}},{tagName:"line",attrs:{x1:"6",x2:"6.01",y1:"18",y2:"18"}}],cpu:[{tagName:"path",attrs:{d:"M12 20v2"}},{tagName:"path",attrs:{d:"M12 2v2"}},{tagName:"path",attrs:{d:"M17 20v2"}},{tagName:"path",attrs:{d:"M17 2v2"}},{tagName:"path",attrs:{d:"M2 12h2"}},{tagName:"path",attrs:{d:"M2 17h2"}},{tagName:"path",attrs:{d:"M2 7h2"}},{tagName:"path",attrs:{d:"M20 12h2"}},{tagName:"path",attrs:{d:"M20 17h2"}},{tagName:"path",attrs:{d:"M20 7h2"}},{tagName:"path",attrs:{d:"M7 20v2"}},{tagName:"path",attrs:{d:"M7 2v2"}},{tagName:"rect",attrs:{x:"4",y:"4",width:"16",height:"16",rx:"2"}},{tagName:"rect",attrs:{x:"8",y:"8",width:"8",height:"8",rx:"1"}}],gpu:[{tagName:"path",attrs:{d:"M2 17h18a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2H2"}},{tagName:"path",attrs:{d:"M2 21V3"}},{tagName:"path",attrs:{d:"M7 17v3a1 1 0 0 0 1 1h5a1 1 0 0 0 1-1v-3"}},{tagName:"circle",attrs:{cx:"16",cy:"11",r:"2"}},{tagName:"circle",attrs:{cx:"8",cy:"11",r:"2"}}],memory:[{tagName:"path",attrs:{d:"M12 12v-2"}},{tagName:"path",attrs:{d:"M12 18v-2"}},{tagName:"path",attrs:{d:"M16 12v-2"}},{tagName:"path",attrs:{d:"M16 18v-2"}},{tagName:"path",attrs:{d:"M2 11h1.5"}},{tagName:"path",attrs:{d:"M20 18v-2"}},{tagName:"path",attrs:{d:"M20.5 11H22"}},{tagName:"path",attrs:{d:"M4 18v-2"}},{tagName:"path",attrs:{d:"M8 12v-2"}},{tagName:"path",attrs:{d:"M8 18v-2"}},{tagName:"rect",attrs:{x:"2",y:"6",width:"20",height:"10",rx:"2"}}],virtualMachine:[{tagName:"path",attrs:{d:"m10.852 14.772-.383.923"}},{tagName:"path",attrs:{d:"M13.148 14.772a3 3 0 1 0-2.296-5.544l-.383-.923"}},{tagName:"path",attrs:{d:"m13.148 9.228.383-.923"}},{tagName:"path",attrs:{d:"m13.53 15.696-.382-.924a3 3 0 1 1-2.296-5.544"}},{tagName:"path",attrs:{d:"m14.772 10.852.923-.383"}},{tagName:"path",attrs:{d:"m14.772 13.148.923.383"}},{tagName:"path",attrs:{d:"M4.5 10H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-.5"}},{tagName:"path",attrs:{d:"M4.5 14H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-.5"}},{tagName:"path",attrs:{d:"M6 18h.01"}},{tagName:"path",attrs:{d:"M6 6h.01"}},{tagName:"path",attrs:{d:"m9.228 10.852-.923-.383"}},{tagName:"path",attrs:{d:"m9.228 13.148-.923.383"}}],container:[{tagName:"path",attrs:{d:"M22 7.7c0-.6-.4-1.2-.8-1.5l-6.3-3.9a1.72 1.72 0 0 0-1.7 0l-10.3 6c-.5.2-.9.8-.9 1.4v6.6c0 .5.4 1.2.8 1.5l6.3 3.9a1.72 1.72 0 0 0 1.7 0l10.3-6c.5-.3.9-1 .9-1.5Z"}},{tagName:"path",attrs:{d:"M10 21.9V14L2.1 9.1"}},{tagName:"path",attrs:{d:"m10 14 11.9-6.9"}},{tagName:"path",attrs:{d:"M14 19.8v-8.1"}},{tagName:"path",attrs:{d:"M18 17.5V9.4"}}],kubernetes:[{tagName:"circle",attrs:{cx:"12",cy:"12",r:"8"}},{tagName:"path",attrs:{d:"M12 2v7.5"}},{tagName:"path",attrs:{d:"m19 5-5.23 5.23"}},{tagName:"path",attrs:{d:"M22 12h-7.5"}},{tagName:"path",attrs:{d:"m19 19-5.23-5.23"}},{tagName:"path",attrs:{d:"M12 14.5V22"}},{tagName:"path",attrs:{d:"M10.23 13.77 5 19"}},{tagName:"path",attrs:{d:"M9.5 12H2"}},{tagName:"path",attrs:{d:"M10.23 10.23 5 5"}},{tagName:"circle",attrs:{cx:"12",cy:"12",r:"2.5"}}],serverless:[{tagName:"rect",attrs:{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}},{tagName:"path",attrs:{d:"M9 17c2 0 2.8-1 2.8-2.8V10c0-2 1-3.3 3.2-3"}},{tagName:"path",attrs:{d:"M9 11.2h5.7"}}],largeLanguageModel:[{tagName:"path",attrs:{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z"}},{tagName:"path",attrs:{d:"M9 13a4.5 4.5 0 0 0 3-4"}},{tagName:"path",attrs:{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5"}},{tagName:"path",attrs:{d:"M3.477 10.896a4 4 0 0 1 .585-.396"}},{tagName:"path",attrs:{d:"M6 18a4 4 0 0 1-1.967-.516"}},{tagName:"path",attrs:{d:"M12 13h4"}},{tagName:"path",attrs:{d:"M12 18h6a2 2 0 0 1 2 2v1"}},{tagName:"path",attrs:{d:"M12 8h8"}},{tagName:"path",attrs:{d:"M16 8V5a2 2 0 0 1 2-2"}},{tagName:"circle",attrs:{cx:"16",cy:"13",r:".5"}},{tagName:"circle",attrs:{cx:"18",cy:"3",r:".5"}},{tagName:"circle",attrs:{cx:"20",cy:"21",r:".5"}},{tagName:"circle",attrs:{cx:"20",cy:"8",r:".5"}}],multimodalModel:[{tagName:"path",attrs:{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z"}},{tagName:"path",attrs:{d:"M20 2v4"}},{tagName:"path",attrs:{d:"M22 4h-4"}},{tagName:"circle",attrs:{cx:"4",cy:"20",r:"2"}}],embeddingModel:[{tagName:"rect",attrs:{x:"14",y:"14",width:"4",height:"6",rx:"2"}},{tagName:"rect",attrs:{x:"6",y:"4",width:"4",height:"6",rx:"2"}},{tagName:"path",attrs:{d:"M6 20h4"}},{tagName:"path",attrs:{d:"M14 10h4"}},{tagName:"path",attrs:{d:"M6 14h2v6"}},{tagName:"path",attrs:{d:"M14 4h2v6"}}],reranker:[{tagName:"path",attrs:{d:"m3 16 4 4 4-4"}},{tagName:"path",attrs:{d:"M7 20V4"}},{tagName:"path",attrs:{d:"m21 8-4-4-4 4"}},{tagName:"path",attrs:{d:"M17 4v16"}}],modelInference:[{tagName:"path",attrs:{d:"M10 12h4"}},{tagName:"path",attrs:{d:"M10 17h4"}},{tagName:"path",attrs:{d:"M10 7h4"}},{tagName:"path",attrs:{d:"M18 12h2"}},{tagName:"path",attrs:{d:"M18 18h2"}},{tagName:"path",attrs:{d:"M18 6h2"}},{tagName:"path",attrs:{d:"M4 12h2"}},{tagName:"path",attrs:{d:"M4 18h2"}},{tagName:"path",attrs:{d:"M4 6h2"}},{tagName:"rect",attrs:{x:"6",y:"2",width:"12",height:"20",rx:"2"}}],vectorDatabase:[{tagName:"path",attrs:{d:"m10.586 5.414-5.172 5.172"}},{tagName:"path",attrs:{d:"m18.586 13.414-5.172 5.172"}},{tagName:"path",attrs:{d:"M6 12h12"}},{tagName:"circle",attrs:{cx:"12",cy:"20",r:"2"}},{tagName:"circle",attrs:{cx:"12",cy:"4",r:"2"}},{tagName:"circle",attrs:{cx:"20",cy:"12",r:"2"}},{tagName:"circle",attrs:{cx:"4",cy:"12",r:"2"}}],ragPipeline:[{tagName:"rect",attrs:{width:"8",height:"8",x:"3",y:"3",rx:"2"}},{tagName:"path",attrs:{d:"M7 11v4a2 2 0 0 0 2 2h4"}},{tagName:"rect",attrs:{width:"8",height:"8",x:"13",y:"13",rx:"2"}}],aiAgent:[{tagName:"path",attrs:{d:"M12 8V4H8"}},{tagName:"rect",attrs:{width:"16",height:"12",x:"4",y:"8",rx:"2"}},{tagName:"path",attrs:{d:"M2 14h2"}},{tagName:"path",attrs:{d:"M20 14h2"}},{tagName:"path",attrs:{d:"M15 13v2"}},{tagName:"path",attrs:{d:"M9 13v2"}}],modelGateway:[{tagName:"rect",attrs:{width:"20",height:"8",x:"2",y:"14",rx:"2"}},{tagName:"path",attrs:{d:"M6.01 18H6"}},{tagName:"path",attrs:{d:"M10.01 18H10"}},{tagName:"path",attrs:{d:"M15 10v4"}},{tagName:"path",attrs:{d:"M17.84 7.17a4 4 0 0 0-5.66 0"}},{tagName:"path",attrs:{d:"M20.66 4.34a8 8 0 0 0-11.31 0"}}],mcpServer:[{tagName:"path",attrs:{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z"}},{tagName:"path",attrs:{d:"m2 22 3-3"}},{tagName:"path",attrs:{d:"M7.5 13.5 10 11"}},{tagName:"path",attrs:{d:"M10.5 16.5 13 14"}},{tagName:"path",attrs:{d:"m18 3-4 4h6l-4 4"}}],relationalDatabase:[{tagName:"ellipse",attrs:{cx:"12",cy:"5",rx:"9",ry:"3"}},{tagName:"path",attrs:{d:"M3 5V19A9 3 0 0 0 21 19V5"}},{tagName:"path",attrs:{d:"M3 12A9 3 0 0 0 21 12"}}],noSqlDatabase:[{tagName:"ellipse",attrs:{cx:"12",cy:"5",rx:"9",ry:"3"}},{tagName:"path",attrs:{d:"M3 5V19A9 3 0 0 0 15 21.84"}},{tagName:"path",attrs:{d:"M21 5V8"}},{tagName:"path",attrs:{d:"M21 12L18 17H22L19 22"}},{tagName:"path",attrs:{d:"M3 12A9 3 0 0 0 14.59 14.87"}}],cache:[{tagName:"path",attrs:{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z"}}],dataWarehouse:[{tagName:"path",attrs:{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z"}},{tagName:"path",attrs:{d:"m7 16.5-4.74-2.85"}},{tagName:"path",attrs:{d:"m7 16.5 5-3"}},{tagName:"path",attrs:{d:"M7 16.5v5.17"}},{tagName:"path",attrs:{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z"}},{tagName:"path",attrs:{d:"m17 16.5-5-3"}},{tagName:"path",attrs:{d:"m17 16.5 4.74-2.85"}},{tagName:"path",attrs:{d:"M17 16.5v5.17"}},{tagName:"path",attrs:{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z"}},{tagName:"path",attrs:{d:"M12 8 7.26 5.15"}},{tagName:"path",attrs:{d:"m12 8 4.74-2.85"}},{tagName:"path",attrs:{d:"M12 13.5V8"}}],searchEngine:[{tagName:"path",attrs:{d:"m21 21-4.34-4.34"}},{tagName:"circle",attrs:{cx:"11",cy:"11",r:"8"}}],objectStorage:[{tagName:"path",attrs:{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z"}}],fileStorage:[{tagName:"path",attrs:{d:"M11 21a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-8a1 1 0 0 1 1-1"}},{tagName:"path",attrs:{d:"M16 16a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1"}},{tagName:"path",attrs:{d:"M21 6a2 2 0 0 0-.586-1.414l-2-2A2 2 0 0 0 17 2h-3a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1z"}}],blockStorage:[{tagName:"path",attrs:{d:"M10 16h.01"}},{tagName:"path",attrs:{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"}},{tagName:"path",attrs:{d:"M21.946 12.013H2.054"}},{tagName:"path",attrs:{d:"M6 16h.01"}}],backup:[{tagName:"circle",attrs:{cx:"15",cy:"19",r:"2"}},{tagName:"path",attrs:{d:"M20.9 19.8A2 2 0 0 0 22 18V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2h5.1"}},{tagName:"path",attrs:{d:"M15 11v-1"}},{tagName:"path",attrs:{d:"M15 17v-2"}}],cdn:[{tagName:"path",attrs:{d:"M16.247 7.761a6 6 0 0 1 0 8.478"}},{tagName:"path",attrs:{d:"M19.075 4.933a10 10 0 0 1 0 14.134"}},{tagName:"path",attrs:{d:"M4.925 19.067a10 10 0 0 1 0-14.134"}},{tagName:"path",attrs:{d:"M7.753 16.239a6 6 0 0 1 0-8.478"}},{tagName:"circle",attrs:{cx:"12",cy:"12",r:"2"}}],messageQueue:[{tagName:"path",attrs:{d:"M11 5h10"}},{tagName:"path",attrs:{d:"M11 12h10"}},{tagName:"path",attrs:{d:"M11 19h10"}},{tagName:"path",attrs:{d:"M4 4h1v5"}},{tagName:"path",attrs:{d:"M4 9h2"}},{tagName:"path",attrs:{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02"}}],eventBus:[{tagName:"circle",attrs:{cx:"18",cy:"5",r:"3"}},{tagName:"circle",attrs:{cx:"6",cy:"12",r:"3"}},{tagName:"circle",attrs:{cx:"18",cy:"19",r:"3"}},{tagName:"line",attrs:{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49"}},{tagName:"line",attrs:{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49"}}],streamProcessing:[{tagName:"path",attrs:{d:"M2 12q2.5 2 5 0t5 0 5 0 5 0"}},{tagName:"path",attrs:{d:"M2 19q2.5 2 5 0t5 0 5 0 5 0"}},{tagName:"path",attrs:{d:"M2 5q2.5 2 5 0t5 0 5 0 5 0"}}],webhook:[{tagName:"path",attrs:{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2"}},{tagName:"path",attrs:{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06"}},{tagName:"path",attrs:{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8"}}],serviceMesh:[{tagName:"path",attrs:{d:"M12 3v18"}},{tagName:"path",attrs:{d:"M3 12h18"}},{tagName:"rect",attrs:{x:"3",y:"3",width:"18",height:"18",rx:"2"}}],apiGateway:[{tagName:"circle",attrs:{cx:"6",cy:"19",r:"3"}},{tagName:"path",attrs:{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15"}},{tagName:"circle",attrs:{cx:"18",cy:"5",r:"3"}}],loadBalancer:[{tagName:"circle",attrs:{cx:"12",cy:"18",r:"3"}},{tagName:"circle",attrs:{cx:"6",cy:"6",r:"3"}},{tagName:"circle",attrs:{cx:"18",cy:"6",r:"3"}},{tagName:"path",attrs:{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9"}},{tagName:"path",attrs:{d:"M12 12v3"}}],dns:[{tagName:"circle",attrs:{cx:"12",cy:"12",r:"10"}},{tagName:"path",attrs:{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z"}}],vpc:[{tagName:"rect",attrs:{x:"16",y:"16",width:"6",height:"6",rx:"1"}},{tagName:"rect",attrs:{x:"2",y:"16",width:"6",height:"6",rx:"1"}},{tagName:"rect",attrs:{x:"9",y:"2",width:"6",height:"6",rx:"1"}},{tagName:"path",attrs:{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3"}},{tagName:"path",attrs:{d:"M12 12V8"}}],subnet:[{tagName:"path",attrs:{d:"M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z"}},{tagName:"path",attrs:{d:"M17 21v-2"}},{tagName:"path",attrs:{d:"M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10"}},{tagName:"path",attrs:{d:"M21 21v-2"}},{tagName:"path",attrs:{d:"M3 5V3"}},{tagName:"path",attrs:{d:"M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z"}},{tagName:"path",attrs:{d:"M7 5V3"}}],vpn:[{tagName:"path",attrs:{d:"m15 20 3-3h2a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h2l3 3z"}},{tagName:"path",attrs:{d:"M6 8v1"}},{tagName:"path",attrs:{d:"M10 8v1"}},{tagName:"path",attrs:{d:"M14 8v1"}},{tagName:"path",attrs:{d:"M18 8v1"}}],identity:[{tagName:"path",attrs:{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z"}},{tagName:"circle",attrs:{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor"}}],firewall:[{tagName:"rect",attrs:{width:"18",height:"18",x:"3",y:"3",rx:"2"}},{tagName:"path",attrs:{d:"M12 9v6"}},{tagName:"path",attrs:{d:"M16 15v6"}},{tagName:"path",attrs:{d:"M16 3v6"}},{tagName:"path",attrs:{d:"M3 15h18"}},{tagName:"path",attrs:{d:"M3 9h18"}},{tagName:"path",attrs:{d:"M8 15v6"}},{tagName:"path",attrs:{d:"M8 3v6"}}],waf:[{tagName:"path",attrs:{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"}},{tagName:"path",attrs:{d:"m9 12 2 2 4-4"}}],secretManager:[{tagName:"circle",attrs:{cx:"12",cy:"16",r:"1"}},{tagName:"rect",attrs:{x:"3",y:"10",width:"18",height:"12",rx:"2"}},{tagName:"path",attrs:{d:"M7 10V7a5 5 0 0 1 10 0v3"}}],certificate:[{tagName:"path",attrs:{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"}},{tagName:"path",attrs:{d:"M8 12h.01"}},{tagName:"path",attrs:{d:"M12 12h.01"}},{tagName:"path",attrs:{d:"M16 12h.01"}}],systemBoundary:[{tagName:"path",attrs:{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z"}},{tagName:"path",attrs:{d:"m3.3 7 8.7 5 8.7-5"}},{tagName:"path",attrs:{d:"M12 22V12"}}],monitoring:[{tagName:"path",attrs:{d:"m12 14 4-4"}},{tagName:"path",attrs:{d:"M3.34 19a10 10 0 1 1 17.32 0"}}],logging:[{tagName:"path",attrs:{d:"M16 22h2a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v2.85"}},{tagName:"path",attrs:{d:"M14 2v5a1 1 0 0 0 1 1h5"}},{tagName:"path",attrs:{d:"M8 14v2.2l1.6 1"}},{tagName:"circle",attrs:{cx:"8",cy:"16",r:"6"}}],metrics:[{tagName:"path",attrs:{d:"M12 16v5"}},{tagName:"path",attrs:{d:"M16 14.639V21"}},{tagName:"path",attrs:{d:"M20 10.656V21"}},{tagName:"path",attrs:{d:"m22 3-8.646 8.646a.5.5 0 0 1-.708 0L9.354 8.354a.5.5 0 0 0-.707 0L2 15"}},{tagName:"path",attrs:{d:"M4 18.463V21"}},{tagName:"path",attrs:{d:"M8 14.656V21"}}],tracing:[{tagName:"path",attrs:{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2"}}],alerting:[{tagName:"circle",attrs:{cx:"12",cy:"12",r:"10"}},{tagName:"line",attrs:{x1:"12",x2:"12",y1:"8",y2:"12"}},{tagName:"line",attrs:{x1:"12",x2:"12.01",y1:"16",y2:"16"}}],saas:[{tagName:"path",attrs:{d:"m10.852 19.772-.383.924"}},{tagName:"path",attrs:{d:"m13.148 14.228.383-.923"}},{tagName:"path",attrs:{d:"M13.148 19.772a3 3 0 1 0-2.296-5.544l-.383-.923"}},{tagName:"path",attrs:{d:"m13.53 20.696-.382-.924a3 3 0 1 1-2.296-5.544"}},{tagName:"path",attrs:{d:"m14.772 15.852.923-.383"}},{tagName:"path",attrs:{d:"m14.772 18.148.923.383"}},{tagName:"path",attrs:{d:"M4.2 15.1a7 7 0 1 1 9.93-9.858A7 7 0 0 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.2"}},{tagName:"path",attrs:{d:"m9.228 15.852-.923-.383"}},{tagName:"path",attrs:{d:"m9.228 18.148-.923.383"}}],externalApi:[{tagName:"path",attrs:{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1"}},{tagName:"path",attrs:{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1"}}],thirdPartyService:[{tagName:"path",attrs:{d:"M15 3h6v6"}},{tagName:"path",attrs:{d:"M10 14 21 3"}},{tagName:"path",attrs:{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}}]},Z7e='Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',DDt=12,ODt=550,PDt=17,$Dt=10,BDt=14,kW=34,FDt=10,a8=32,o8=64,zDt=(t,e,r,n)=>({name:"manhattan",args:{padding:8,step:8,maxLoopCount:5e3,excludeNodes:[...new Set([t,e,...r])],...n?{startDirections:[n.source],endDirections:[n.target]}:{}}}),Q7e=(t,e)=>{const r=t.x+t.width,n=e.x+e.width,i=t.y-(e.y+e.height),s=e.y-(t.y+t.height);if(e.x>=r)return e.x-r<a8&&i>o8?{source:"right",target:"bottom"}:e.x-r<a8&&s>o8?{source:"right",target:"top"}:{source:"right",target:"left"};if(n<=t.x)return t.x-n<a8&&i>o8?{source:"left",target:"bottom"}:t.x-n<a8&&s>o8?{source:"left",target:"top"}:{source:"left",target:"right"};const a=t.y+t.height/2;return e.y+e.height/2>=a?{source:"bottom",target:"top"}:{source:"top",target:"bottom"}},Rhe=({side:t,offset:e})=>({name:t,args:t==="left"||t==="right"?{dy:e}:{dx:e}}),VDt=(t,e)=>{const r=new Map(t.map(s=>[s.id,s])),n=new Map,i=new Map;for(const s of e){const a=r.get(s.source),o=r.get(s.target);if(!a||!o)continue;const l=Q7e(a,o);n.set(s.id,{source:{side:l.source,offset:0},target:{side:l.target,offset:0}});for(const[u,h,d,f]of[["source",a,l.source,o],["target",o,l.target,a]]){const p=`${h.id}:${d}`,g=i.get(p)??[];g.push({edgeId:s.id,end:u,opposite:d==="left"||d==="right"?f.y+f.height/2:f.x+f.width/2}),i.set(p,g)}}for(const[s,a]of i){if(a.length<2)continue;const o=s.lastIndexOf(":"),l=r.get(s.slice(0,o)),u=s.slice(o+1);if(!l)continue;const h=u==="left"||u==="right"?l.height:l.width,d=Math.min(Math.max(0,h-28),(a.length-1)*16);a.sort((f,p)=>f.opposite-p.opposite||f.edgeId.localeCompare(p.edgeId)),a.forEach(({edgeId:f,end:p},g)=>{const m=n.get(f);m&&(m[p].offset=Math.round(-d/2+d*g/(a.length-1)))})}return n},J7e=["client","frontend","service","database","storage","queue","security","external"],HDt={client:"client",frontend:"webApp",service:"service",database:"relationalDatabase",storage:"objectStorage",queue:"messageQueue",security:"waf",external:"saas"},GDt={light:{canvas:ll,boundaryStroke:"#7B8F86",boundaryText:"#1C3D31",boundaryFill:"rgba(123, 143, 134, 0.05)",boundaryBadgeFill:"rgba(255, 255, 255, 0.95)",boundaryBadgeStroke:"rgba(123, 143, 134, 0.4)",nodes:{client:{fill:"#E9EFF5",stroke:"#3B6285",text:"#1A3B5C",accent:"#2B5A84",iconFrame:"#D4E2EE"},frontend:{fill:"#EEF2FF",stroke:"#4338CA",text:"#312E81",accent:"#4F46E5",iconFrame:"#E0E7FF"},service:{fill:"#E3F4EE",stroke:"#169567",text:"#19563E",accent:"#16A06E",iconFrame:"#D0ECE2"},database:{fill:"#EFE7FD",stroke:"#7437DC",text:"#472877",accent:"#7C3AED",iconFrame:"#E5D8FB"},storage:{fill:"#FAEFE1",stroke:"#CA6F07",text:"#71430F",accent:"#D97706",iconFrame:"#F7E4CD"},queue:{fill:"#FCEBE2",stroke:"#DA530D",text:"#793512",accent:"#EA580C",iconFrame:"#FBDECE"},security:{fill:"#FBE4E9",stroke:"#D11D44",text:"#751B2D",accent:"#E11D48",iconFrame:"#F9D2DA"},external:{fill:"#ECEEF1",stroke:"#5E6D82",text:"#3C424B",accent:"#64748B",iconFrame:"#E0E3E8"}},edges:{dependency:{stroke:"#64748B",strokeWidth:1.2,markerWidth:7,markerHeight:5},request:{stroke:"#0F8A5C",strokeWidth:1.6,markerWidth:8,markerHeight:6},data:{stroke:"#7C3AED",strokeWidth:1.6,markerWidth:8,markerHeight:6},async:{stroke:"#EA580C",strokeWidth:1.5,strokeDasharray:"7 5",markerWidth:8,markerHeight:6}}},dark:{canvas:cl,boundaryStroke:"#5B6F66",boundaryText:"#D7F4E8",boundaryFill:"rgba(91, 111, 102, 0.12)",boundaryBadgeFill:"rgba(16, 19, 17, 0.95)",boundaryBadgeStroke:"rgba(91, 111, 102, 0.5)",nodes:{client:{fill:"#132537",stroke:"#5A8EB9",text:"#DCE8F2",accent:"#5A8EB9",iconFrame:"#1C3752"},frontend:{fill:"#18214D",stroke:"#6366F1",text:"#E0E7FF",accent:"#6366F1",iconFrame:"#232F6B"},service:{fill:"#123A2B",stroke:"#49B58E",text:"#D5EEE5",accent:"#49B58E",iconFrame:"#13573E"},database:{fill:"#2E1E4F",stroke:"#9965F1",text:"#E7DCFC",accent:"#9965F1",iconFrame:"#44267B"},storage:{fill:"#482F0E",stroke:"#E1953D",text:"#F8E7D2",accent:"#E1953D",iconFrame:"#70430C"},queue:{fill:"#4D2610",stroke:"#EF7D41",text:"#FBE1D3",accent:"#EF7D41",iconFrame:"#79340F"},security:{fill:"#4B1620",stroke:"#E84F70",text:"#FAD6DE",accent:"#E84F70",iconFrame:"#74182B"},external:{fill:"#282E33",stroke:"#8693A5",text:"#E3E6EA",accent:"#8693A5",iconFrame:"#38424C"}},edges:{dependency:{stroke:"#94A3B8",strokeWidth:1.2,markerWidth:7,markerHeight:5},request:{stroke:"#4DB58B",strokeWidth:1.6,markerWidth:8,markerHeight:6},data:{stroke:"#A78BFA",strokeWidth:1.6,markerWidth:8,markerHeight:6},async:{stroke:"#FB923C",strokeWidth:1.5,strokeDasharray:"7 5",markerWidth:8,markerHeight:6}}}},ID=(t="light")=>GDt[t],WDt=(t,e)=>{const r=ID(e);return t==="boundary"?{fill:r.boundaryFill,stroke:r.boundaryStroke,text:r.boundaryText,accent:r.boundaryStroke,iconFrame:"transparent"}:J7e.includes(t)?r.nodes[t]:r.nodes.service},qDt=(t,e)=>t==="database"||t==="queue"||t==="external"?Math.round(e/2):t==="security"?16:t==="frontend"?10:t==="service"?8:t==="client"||t==="storage"?6:11,_he=t=>t==="database"||t==="external"?17:t==="security"?12:t==="queue"?10:8,UDt=t=>Math.round((t-kW)/2),e8e=(t,e)=>{const r=t??(J7e.includes(e)?HDt[e]:"service");return Mhe[r]??Mhe.service},jDt=(t,e)=>{if(e==="boundary")return[{tagName:"rect",selector:"body"},{tagName:"rect",selector:"headerBadge"},{tagName:"text",selector:"label"}];const r=e8e(t,e);return[{tagName:"rect",selector:"body"},{tagName:"rect",selector:"iconFrame"},...r.map((n,i)=>({tagName:n.tagName,selector:`architectureIcon${i}`})),{tagName:"text",selector:"label"}]},YDt=(t,e,r,n)=>{const i=ID(e),s=WDt(t,e),a=t==="boundary",o=qDt(t,r.height),l=UDt(r.height),u=a?[]:e8e(n,t),h=Object.fromEntries(u.map((d,f)=>[`architectureIcon${f}`,{...d.attrs,transform:`translate(15 ${l+5})`,fill:"none",stroke:s.accent,strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",pointerEvents:"none"}]));return{markup:jDt(n,t),body:{fill:s.fill,stroke:s.stroke,strokeWidth:1.5,strokeDasharray:a||t==="external"?"7 5":void 0,rx:o,ry:o},label:{fill:s.text,fontSize:a?12:DDt,fontWeight:a?650:ODt,fontFamily:Z7e,lineHeight:a?18:PDt,...a?{refX:20,refY:20,textAnchor:"start",textVerticalAnchor:"middle"}:{refX:54,refY:"50%",textAnchor:"start",textVerticalAnchor:"middle"}},attrs:a?{headerBadge:{ref:"label",refWidth:1,refHeight:1,refWidth2:16,refHeight2:6,refX:-8,refY:-3,fill:i.boundaryBadgeFill,stroke:i.boundaryBadgeStroke,strokeWidth:1,rx:4,ry:4,pointerEvents:"none"}}:{iconFrame:{x:FDt,y:l,width:kW,height:kW,rx:_he(t),ry:_he(t),fill:s.iconFrame,stroke:"none",pointerEvents:"none"},...h}}},XDt=(t,e,r=!1)=>{const n=ID(e).edges[t??"dependency"],i={name:"block",width:n.markerWidth,height:n.markerHeight};return{stroke:n.stroke,strokeWidth:n.strokeWidth,strokeDasharray:n.strokeDasharray,sourceMarker:r?i:null,targetMarker:i,fill:"none"}},SW='Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',KDt=10,ZDt=14,QDt={name:"manhattan",args:{padding:8,step:8,excludeEnds:!0}},JDt=(t,e)=>{const r={x:t.x+t.width/2,y:t.y+t.height/2},n={x:e.x+e.width/2,y:e.y+e.height/2},i=n.x-r.x,s=n.y-r.y;return s<-t.height?{source:"left",target:"left"}:i<-t.width?{source:"top",target:"top"}:Math.abs(s)>=Math.abs(i)?s>=0?{source:"bottom",target:"top"}:{source:"top",target:"bottom"}:i>=0?{source:"right",target:"left"}:{source:"left",target:"right"}},eOt=(t,e)=>{const r=e.x+e.width/2-(t.x+t.width/2),n=e.y+e.height/2-(t.y+t.height/2);return n<-t.height||r<-t.width?!1:Math.abs(r)<=1&&Math.abs(n)>8||Math.abs(n)<=1&&Math.abs(r)>8},tOt=.85,rOt=["plain","brand","ink","paper","island","tea","cosmos","sun","wa","rose","mint"],nOt={ocean:"brand",slate:"ink",mono:"ink",classic:"paper",sand:"island",sky:"cosmos",sunset:"sun",violet:"rose",aurora:"mint"},iOt=t=>t&&rOt.includes(t)?t:t?nOt[t]??"brand":"plain",sOt={plain:{light:{canvas:ll,edge:"#737373",process:{fill:"#FFFFFF",stroke:"#D4D4D4",text:"#212121"},decision:{fill:"#F4F4F5",stroke:"#737373",text:"#212121"},terminator:{fill:"#707070",stroke:"#707070",text:"#FFFFFF"}},dark:{canvas:cl,edge:"#A3A3A3",process:{fill:"#1C1C1C",stroke:"#3A3A3A",text:"#F4F4F5"},decision:{fill:"#262626",stroke:"#A3A3A3",text:"#F4F4F5"},terminator:{fill:"#F5F5F5",stroke:"#F5F5F5",text:"#212121"}}},brand:{light:{canvas:ll,edge:"#5C7166",process:{fill:"#FFFFFF",stroke:"#6F9B88",text:"#1C3D31"},decision:{fill:"#FFF6E5",stroke:"#D4A24A",text:"#7A4A12"},terminator:{fill:"#E7F6EF",stroke:"#16A06E",text:"#145C40"}},dark:{canvas:cl,edge:"#8CA397",process:{fill:"#1B2420",stroke:"#5B7569",text:"#E8F2ED"},decision:{fill:"#2A2316",stroke:"#E0B35C",text:"#F8E4B8"},terminator:{fill:"#1A3329",stroke:"#4DB58B",text:"#D8F3E6"}}},ink:{light:{canvas:ll,edge:"#64748B",process:{fill:"#FFFFFF",stroke:"#7D8794",text:"#1C232C"},decision:{fill:"#E8EDF3",stroke:"#6E7C8F",text:"#243044"},terminator:{fill:"#E6EAEF",stroke:"#3A4656",text:"#1A222C"}},dark:{canvas:cl,edge:"#94A3B8",process:{fill:"#1B1E23",stroke:"#6B7380",text:"#E8ECF1"},decision:{fill:"#222830",stroke:"#8B9BB0",text:"#D5DDE8"},terminator:{fill:"#1A2028",stroke:"#A8B4C4",text:"#E8EEF4"}}},paper:{light:{canvas:ll,edge:"#78716C",process:{fill:"#FFFCF6",stroke:"#C4B396",text:"#3A3126"},decision:{fill:"#F4E4CC",stroke:"#C08A48",text:"#6A3F14"},terminator:{fill:"#F0E4D0",stroke:"#7A5230",text:"#3F2A16"}},dark:{canvas:cl,edge:"#A8A29E",process:{fill:"#221E19",stroke:"#7A6A56",text:"#F3EBE0"},decision:{fill:"#2C2418",stroke:"#D4A06A",text:"#F6E2C4"},terminator:{fill:"#2A2118",stroke:"#C4A07A",text:"#F0E4D4"}}},island:{light:{canvas:ll,edge:"#7C6F68",process:{fill:"#FFF8F3",stroke:"#C4A090",text:"#3A2A22"},decision:{fill:"#F3D8C8",stroke:"#C46A48",text:"#6A3220"},terminator:{fill:"#EBD0C0",stroke:"#8B4A32",text:"#3F2418"}},dark:{canvas:cl,edge:"#ABA09A",process:{fill:"#231C18",stroke:"#8A6A56",text:"#F3E8E0"},decision:{fill:"#2C2018",stroke:"#D49070",text:"#F6D8C4"},terminator:{fill:"#281A16",stroke:"#C48868",text:"#F0D8CC"}}},tea:{light:{canvas:ll,edge:"#657361",process:{fill:"#FFFFFF",stroke:"#8A9A72",text:"#2A3420"},decision:{fill:"#E8EED4",stroke:"#8A9A48",text:"#3F4A18"},terminator:{fill:"#DCE6C8",stroke:"#4F6A32",text:"#243018"}},dark:{canvas:cl,edge:"#97A693",process:{fill:"#1C2018",stroke:"#6A7A56",text:"#E8F0DC"},decision:{fill:"#222618",stroke:"#B8C46A",text:"#E8F0C4"},terminator:{fill:"#1A2418",stroke:"#8AAA5A",text:"#D8E8C4"}}},cosmos:{light:{canvas:ll,edge:"#5C6D7E",process:{fill:"#FFFFFF",stroke:"#7A94A8",text:"#1C2A38"},decision:{fill:"#E4EEF5",stroke:"#5A82A0",text:"#1E3A52"},terminator:{fill:"#D8E6F0",stroke:"#2A5470",text:"#163044"}},dark:{canvas:cl,edge:"#8EA0B2",process:{fill:"#181E26",stroke:"#5A7088",text:"#E0E8F0"},decision:{fill:"#1C2834",stroke:"#7AA0C0",text:"#D0E4F4"},terminator:{fill:"#162028",stroke:"#8AB4D0",text:"#D8E8F4"}}},sun:{light:{canvas:ll,edge:"#736B5E",process:{fill:"#FFFEF6",stroke:"#D4C47A",text:"#3A3418"},decision:{fill:"#FFF0C4",stroke:"#E0B040",text:"#6A4A08"},terminator:{fill:"#F8E8B0",stroke:"#C09020",text:"#4A3808"}},dark:{canvas:cl,edge:"#A8A092",process:{fill:"#242018",stroke:"#8A7A48",text:"#F6F0D8"},decision:{fill:"#2C2410",stroke:"#E0B848",text:"#F8E8B8"},terminator:{fill:"#28240C",stroke:"#D4B040",text:"#F4E8C0"}}},wa:{light:{canvas:ll,edge:"#5B6F7D",process:{fill:"#FFFFFF",stroke:"#8AA8C0",text:"#1C2C3A"},decision:{fill:"#FCE8DC",stroke:"#E09070",text:"#7A3A24"},terminator:{fill:"#DCE8F4",stroke:"#2A5A88",text:"#1A3858"}},dark:{canvas:cl,edge:"#8EA3B3",process:{fill:"#182028",stroke:"#5A7088",text:"#E0E8F0"},decision:{fill:"#2C2018",stroke:"#E0A080",text:"#F8DCC8"},terminator:{fill:"#162030",stroke:"#6A98C0",text:"#D4E4F4"}}},rose:{light:{canvas:ll,edge:"#75646B",process:{fill:"#FFFFFF",stroke:"#C49AAC",text:"#3A2430"},decision:{fill:"#F8E4EC",stroke:"#D0809A",text:"#7A3048"},terminator:{fill:"#F0D8E2",stroke:"#A04060",text:"#4A2030"}},dark:{canvas:cl,edge:"#A8969D",process:{fill:"#24181C",stroke:"#8A5A6A",text:"#F4E4EA"},decision:{fill:"#2C1A22",stroke:"#E090A8",text:"#F8D8E4"},terminator:{fill:"#28141C",stroke:"#E07090",text:"#F4D0DC"}}},mint:{light:{canvas:ll,edge:"#5A736F",process:{fill:"#FFFFFF",stroke:"#7AB0A8",text:"#1C3A38"},decision:{fill:"#E4F4F0",stroke:"#4AA89A",text:"#1A5A52"},terminator:{fill:"#D4EEE8",stroke:"#1A7A70",text:"#145048"}},dark:{canvas:cl,edge:"#8EA8A4",process:{fill:"#182422",stroke:"#4A786E",text:"#DCF0EC"},decision:{fill:"#1A2C28",stroke:"#6AC4B4",text:"#D0F0E8"},terminator:{fill:"#162824",stroke:"#5AB8A8",text:"#D0EEE6"}}}},t8e=(t="light",e)=>sOt[iOt(e)][t],aOt=(t,e,r)=>{const n=t8e(e,r);return t==="decision"?n.decision:t==="terminator"?n.terminator:n.process},oOt=(t,e,r,n)=>{const i=aOt(t,e,n),s=t==="terminator",a=t==="decision";return{body:{fill:i.fill,stroke:i.stroke,strokeWidth:1.5,rx:s?Math.round(r.height/2):10,ry:s?Math.round(r.height/2):10,...a?{refPoints:"0,10 10,0 20,10 10,20"}:{},style:{filter:e==="dark"?"drop-shadow(0 1px 3px rgba(0, 0, 0, 0.45)) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3))":"drop-shadow(0 1px 2px rgba(15, 23, 42, 0.06)) drop-shadow(0 2px 5px rgba(15, 23, 42, 0.04))"}},label:{fill:i.text,fontSize:13,fontWeight:s?650:a?600:500,fontFamily:SW,lineHeight:18}}},lOt=1,cOt=2,uOt=["plain","brand","cosmos","dune","slate","prism","sunrise","marine","blossom","mint","macaron"],hOt="plain",dOt=["plain","brand","ocean","ink","classic","sky","sunset","violet","rose","sand","slate","aurora","mono","sun","wa","island","mint","cosmos","tea","naive","macaron","paper","dune","prism","sunrise","marine","blossom"],fOt=["map","line","capsule","box","circle","ellipse","hexagon","logic","tree","brace","org","timeline","fishbone"],pOt=[...fOt,"rect","diamond","cloud"],gOt={ocean:"brand",ink:"brand",paper:"brand",classic:"sunrise",sunset:"sunrise",sun:"sunrise",wa:"marine",island:"dune",sand:"dune",tea:"slate",mono:"slate",slate:"slate",sky:"cosmos",cosmos:"cosmos",rose:"blossom",violet:"blossom",aurora:"mint",naive:"prism",mint:"mint",macaron:"macaron"},IQ=t=>t&&uOt.includes(t)?t:t?gOt[t]??"brand":hOt,mOt=["client","webApp","mobileApp","website","apiClient","service","cpu","gpu","memory","virtualMachine","container","kubernetes","serverless","largeLanguageModel","multimodalModel","embeddingModel","reranker","modelInference","vectorDatabase","ragPipeline","aiAgent","modelGateway","mcpServer","relationalDatabase","noSqlDatabase","cache","dataWarehouse","searchEngine","objectStorage","fileStorage","blockStorage","backup","cdn","messageQueue","eventBus","streamProcessing","webhook","serviceMesh","apiGateway","loadBalancer","dns","vpc","subnet","vpn","identity","firewall","waf","secretManager","certificate","systemBoundary","monitoring","logging","metrics","tracing","alerting","saas","externalApi","thirdPartyService"],yOt="edgeever-diagram-v1",r8e=new RegExp(`\x3C!--\\s*${yOt}:([\\s\\S]*?)\\s*-->`),vOt=t=>NDt.decode(t),l8=t=>typeof t=="number"&&Number.isFinite(t),bOt=["mind-map","flowchart","architecture"],xOt=["topic","process","decision","terminator","client","frontend","service","database","storage","queue","security","external","boundary"],Lhe=["dependency","request","async","data"],wOt=t=>typeof t=="string"&&mOt.includes(t),TOt=t=>{if(!t||typeof t!="object"||Array.isArray(t))return null;const e=t;return typeof e.id!="string"||!e.id||typeof e.label!="string"||!l8(e.x)||!l8(e.y)||!l8(e.width)||!l8(e.height)||!xOt.includes(e.shape)?null:{id:e.id,label:e.label,x:e.x,y:e.y,width:e.width,height:e.height,shape:e.shape,...typeof e.parentId=="string"&&e.parentId?{parentId:e.parentId}:{},...wOt(e.resourceIcon)?{resourceIcon:e.resourceIcon}:{}}},COt=t=>{if(!t||typeof t!="object"||Array.isArray(t))return null;const e=t;return typeof e.id!="string"||!e.id||typeof e.source!="string"||typeof e.target!="string"||e.kind!==void 0&&!Lhe.includes(e.kind)||e.bidirectional!==void 0&&typeof e.bidirectional!="boolean"?null:{id:e.id,source:e.source,target:e.target,...typeof e.label=="string"&&e.label?{label:e.label}:{},...Lhe.includes(e.kind)?{kind:e.kind}:{},...typeof e.bidirectional=="boolean"?{bidirectional:e.bidirectional}:{}}},kOt=t=>{var r,n;const e=(n=(r=t==null?void 0:t.match(r8e))==null?void 0:r[1])==null?void 0:n.replace(/\s+/g,"");if(!e||!/^[A-Za-z0-9_-]+$/.test(e))return null;try{const i=JSON.parse(vOt(e));if(!bOt.includes(i.kind))return null;const s=i.kind==="architecture";if((s?i.schemaVersion!==cOt:i.schemaVersion!==lOt)||!Array.isArray(i.nodes)||!Array.isArray(i.edges))return null;const a=dOt.includes(i.theme)?i.theme:void 0,o=pOt.includes(i.structure)?i.structure:void 0,l=i.nodes.map(TOt),u=i.edges.map(COt);if(l.some(f=>!f)||u.some(f=>!f))return null;const h=new Set(l.map(f=>f.id)),d=new Map(l.map(f=>[f.id,f]));if(h.size!==l.length||l.some(f=>f.parentId&&(f.parentId===f.id||!h.has(f.parentId)))||u.some(f=>!h.has(f.source)||!h.has(f.target)))return null;if(s){if(l.some(f=>f.shape==="topic"||f.shape==="process"||f.shape==="decision"||f.shape==="terminator")||l.some(f=>{var p;return f.parentId&&((p=d.get(f.parentId))==null?void 0:p.shape)!=="boundary"})||u.some(f=>{var p,g;return((p=d.get(f.source))==null?void 0:p.shape)==="boundary"||((g=d.get(f.target))==null?void 0:g.shape)==="boundary"}))return null}else if(l.some(f=>!["topic","process","decision","terminator"].includes(f.shape)))return null;return{schemaVersion:i.schemaVersion,kind:i.kind,...a?{theme:a}:{},...i.kind==="mind-map"&&o?{structure:o}:{},nodes:l,edges:u}}catch{return null}},SOt=t=>(t??"").replace(r8e,"").trimEnd(),EOt=1e5;Yt({prompt:Ze().trim().min(1).max(1e3),locale:Ze().trim().min(2).max(35).optional(),currentTemplate:Ze().regex(/^[a-z0-9-]+$/).max(120).optional(),currentContent:Ze().max(EOt).default(""),candidates:Kn(Ze().regex(/^[a-z0-9-]+$/).max(120)).min(1).max(50),history:Kn(Yt({prompt:Ze().max(1e3),response:Ze().max(2e3)})).max(12).default([])});const n8e={plain:{id:"plain",group:"classic",colors:["#707070","#8A8A8A","#A3A3A3","#BDBDBD","#D4D4D4","#FFFFFF"],accent:"#707070"},brand:{id:"brand",group:"classic",colors:["#16A06E","#059669","#0D9488","#10B981","#047857","#065F46"],accent:"#16A06E"},cosmos:{id:"cosmos",group:"classic",colors:["#2563EB","#0284C7","#4F46E5","#0D9488","#3B82F6","#1D4ED8"],accent:"#2563EB"},dune:{id:"dune",group:"classic",colors:["#C2410C","#D97706","#B45309","#A16207","#78350F","#9A3412"],accent:"#B45309"},slate:{id:"slate",group:"classic",colors:["#475569","#52525B","#4B5563","#334155","#64748B","#1E293B"],accent:"#475569"},prism:{id:"prism",group:"vivid",colors:["#E11D48","#EA580C","#D97706","#059669","#2563EB","#7C3AED"],accent:"#6366F1"},sunrise:{id:"sunrise",group:"vivid",colors:["#E11D48","#F97316","#F59E0B","#D97706","#DC2626","#EA580C"],accent:"#EA580C"},marine:{id:"marine",group:"vivid",colors:["#0284C7","#06B6D4","#0D9488","#2563EB","#0891B2","#1D4ED8"],accent:"#0284C7"},blossom:{id:"blossom",group:"vivid",colors:["#DB2777","#C026D3","#9333EA","#E11D48","#BE185D","#7C3AED"],accent:"#DB2777"},mint:{id:"mint",group:"vivid",colors:["#0D9488","#059669","#10B981","#0891B2","#16A34A","#047857"],accent:"#0D9488"},macaron:{id:"macaron",group:"vivid",colors:["#EC4899","#FB923C","#EAB308","#10B981","#38BDF8","#8B5CF6"],accent:"#EC4899"}},AOt=Object.fromEntries(Object.entries(n8e).map(([t,e])=>[t,{id:e.id,group:e.group,colors:e.colors}])),EW=t=>{const e=t.replace("#","");return[Number.parseInt(e.slice(0,2),16),Number.parseInt(e.slice(2,4),16),Number.parseInt(e.slice(4,6),16)]},MOt=(t,e,r)=>`#${[t,e,r].map(n=>Math.round(Math.min(255,Math.max(0,n))).toString(16).padStart(2,"0")).join("")}`,hl=(t,e,r)=>{const n=EW(t),i=EW(e);return MOt(n[0]+(i[0]-n[0])*r,n[1]+(i[1]-n[1])*r,n[2]+(i[2]-n[2])*r)},ROt=t=>{const e=t/255;return e<=.04045?e/12.92:((e+.055)/1.055)**2.4},i8e=t=>{const[e,r,n]=EW(t).map(ROt);return e*.2126+r*.7152+n*.0722},AW=t=>i8e(t)>.35?"#1C1917":"#FFFCF8",_Ot=t=>AOt[IQ(t)].colors,LOt=t=>{const e=IQ(t);return e!=="brand"&&e!=="plain"},MW=(t,e)=>{const r=i8e(t);return e==="dark"?r<.22?hl(t,"#FFFFFF",Math.max(.35,(.3-r)*1.6)):t:r>.26?hl(t,"#18181B",Math.max(.24,(r-.2)*.9)):t},IOt=(t,e)=>_Ot(t).map(n=>{const i=MW(n,e),s=e==="dark"?hl(n,"#121518",.72):hl(n,"#FFFFFF",.84);return{fill:s,stroke:e==="dark"?hl(i,"#FFFFFF",.15):hl(i,"#1C1917",.12),text:AW(s),edge:i}}),NOt=(t,e)=>{const r=IQ(t),n=n8e[r],i=n.accent;if(r==="plain")return e==="dark"?{topicFill:"#F5F5F5",topicText:"#212121",nodeFill:"#1C1C1C",nodeText:"#F4F4F5",nodeStroke:"#3A3A3A",topicStroke:"#F5F5F5",mindMapEdge:"#A3A3A3",flowEdge:"#A3A3A3",canvas:cl}:{topicFill:"#707070",topicText:"#FFFFFF",nodeFill:"#FFFFFF",nodeText:"#212121",nodeStroke:"#D4D4D4",topicStroke:"#707070",mindMapEdge:"#737373",flowEdge:"#737373",canvas:ll};if(r==="brand")return e==="dark"?{topicFill:"#16A06E",topicText:"#F4FFF9",nodeFill:"#18211D",nodeText:"#E8F2ED",nodeStroke:"#3B5248",topicStroke:"#58CDA4",mindMapEdge:"#4DB58B",flowEdge:"#72B99B",canvas:cl}:{topicFill:"#16A06E",topicText:"#FFFFFF",nodeFill:"#F0F8F4",nodeText:"#173B2E",nodeStroke:"#B8DFD0",topicStroke:"#12845B",mindMapEdge:"#55B891",flowEdge:"#408A6D",canvas:ll};if(e==="dark"){const a=MW(i,"dark");return{topicFill:i,topicText:AW(i),nodeFill:hl(i,"#101418",.78),nodeText:"#E8EEF2",nodeStroke:hl(a,"#FFFFFF",.15),topicStroke:hl(i,"#FFFFFF",.25),mindMapEdge:a,flowEdge:hl(i,"#FFFFFF",.15),canvas:cl}}const s=MW(i,"light");return{topicFill:i,topicText:AW(i),nodeFill:hl(i,"#FFFFFF",.88),nodeText:hl(n.colors[n.colors.length-1],"#1C1917",.35),nodeStroke:hl(s,"#FFFFFF",.5),topicStroke:hl(i,"#1C1917",.15),mindMapEdge:s,flowEdge:hl(i,"#1C1917",.15),canvas:ll}},NQ=t=>Array.from(t).reduce((e,r)=>e+(/[^\u0000-\u00ff]/.test(r)?1:.55),0),DOt=t=>t==="decision"?{width:176,height:80}:t==="terminator"?{width:140,height:44}:{width:176,height:56},OOt=13,POt=18,Ihe=.7,$Ot=(t,e)=>t.split(``).flatMap(r=>{const n=[];let i="";for(const s of Array.from(r))i&&NQ(i+s)>e&&(n.push(i),i=""),i+=s;return n.push(i),n}),BOt=(t,e)=>{const r=DOt(t),n=t==="decision",i=t==="terminator",s=i?36:28,a=r.width,o=Math.max(4,(n?a*Ihe:a-s)/OOt),l=$Ot(e,o),u=Math.max(l.length,1)*POt,h=Math.max(r.height,n?Math.ceil(u/(1-Ihe)):u+(i?16:18));return{width:a,height:h,text:l.join(``)}},s8e="edgeever-mindmap",Nhe='Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',FOt=10,zOt=14,DQ=t=>t==="logic"?"logic":t==="brace"?"brace":t==="org"?"org":t==="tree"?"tree":t==="timeline"?"timeline":t==="fishbone"?"fishbone":"map",VOt=t=>{const e=DQ(t);return e==="map"||e==="logic"},g3=(t,e)=>t==="root"?!1:e==="line"||e==="brace"?!0:e==="map"||e==="tree"||e==="timeline"||e==="fishbone"||!e?t==="nested":!1,OQ=(t,e="primary")=>g3(e,t)?"underline":t==="capsule"?"capsule":t==="ellipse"?"ellipse":t==="circle"?"circle":t==="hexagon"?"hexagon":t==="box"||t==="logic"||t==="org"?"rounded":e==="root"?"capsule":"rounded",HOt=(t,e="primary")=>{const r=OQ(t,e);return[r==="ellipse"||r==="circle"?{tagName:"ellipse",selector:"body"}:r==="diamond"||r==="hexagon"?{tagName:"polygon",selector:"body"}:r==="cloud"?{tagName:"path",selector:"body"}:{tagName:"rect",selector:"body"},{tagName:"path",selector:"underline"},{tagName:"text",selector:"label"}]},GOt={light:[{fill:"#E7F6EF",stroke:"#0F8A5C",text:"#145C40",edge:"#16A06E"},{fill:"#E7F0FE",stroke:"#2563EB",text:"#1E3A8A",edge:"#3B82F6"},{fill:"#F3E8FF",stroke:"#7C3AED",text:"#5B21B6",edge:"#8B5CF6"},{fill:"#FEF3C7",stroke:"#D97706",text:"#92400E",edge:"#F59E0B"},{fill:"#FCE7F3",stroke:"#DB2777",text:"#9D174D",edge:"#EC4899"},{fill:"#CFFAFE",stroke:"#0E7490",text:"#155E75",edge:"#06B6D4"}],dark:[{fill:"#1A2A22",stroke:"#4DB58B",text:"#D7F4E8",edge:"#4DB58B"},{fill:"#1A2438",stroke:"#60A5FA",text:"#DBEAFE",edge:"#60A5FA"},{fill:"#251B38",stroke:"#A78BFA",text:"#EDE9FE",edge:"#A78BFA"},{fill:"#2A2114",stroke:"#FBBF24",text:"#FEF3C7",edge:"#FBBF24"},{fill:"#2A1520",stroke:"#F472B6",text:"#FCE7F3",edge:"#F472B6"},{fill:"#15252B",stroke:"#22D3EE",text:"#CFFAFE",edge:"#22D3EE"}]},WOt=(t,e)=>t.split(``).flatMap(r=>{const n=[];let i="";for(const s of Array.from(r))i&&NQ(i+s)>e&&(n.push(i),i=""),i+=s;return n.push(i),n}),tr=t=>(Math.round(t*100)/100).toFixed(2),qOt=t=>LOt(t),YM=(t,e)=>{const r=new Map(t.map(s=>[s.id,s])),n=r.get(e);if(!(n!=null&&n.parentId))return"root";const i=r.get(n.parentId);return i!=null&&i.parentId?"nested":"primary"},UOt=(t,e)=>{const r=new Map(t.map(u=>[u.id,u])),n=r.get(e);if(!(n!=null&&n.parentId))return null;let i=n,s=n;const a=new Set;for(;s.parentId&&r.has(s.parentId)&&!a.has(s.id);){a.add(s.id);const u=r.get(s.parentId);if(!u)break;if(!u.parentId){i=s;break}s=u,i=s}const l=t.filter(u=>u.parentId===i.parentId).sort((u,h)=>(u.y??0)-(h.y??0)||(u.x??0)-(h.x??0)||u.id.localeCompare(h.id)).findIndex(u=>u.id===i.id);return l<0?0:l},jOt=(t,e,r)=>{if(t==null)return;const n=r?IOt(r,e):GOt[e];return n[t%n.length]},YOt=(t,e="primary",r)=>{const n=e==="root",i=g3(e,r),s=OQ(r,e),a=n?36:i?22:s==="diamond"||s==="hexagon"||s==="circle"?36:28,o=Math.round(Math.min(n?180:s==="circle"?132:168,Math.max(n?124:i?88:s==="circle"?108:96,NQ(t)*13+a))),l=n?46:i?32:s==="circle"?Math.max(40,o-24):36;return{width:o,height:l}},XOt=(t,e,r)=>{const n=YOt(t,e,r),i=g3(e,r),s=e==="root"?20:18,a=e==="root"?36:i?22:28,o=WOt(t,Math.max(4,(n.width-a)/13));return{...n,height:Math.max(n.height,o.length*s+(e==="root"?18:i?10:14)),text:o.join(`-`),fontSize:e==="root"?15:e==="primary"?14:13}},KOt=t=>Math.round(Math.max(1,t/2)),ZOt=(t,e)=>`M 1 ${tr(Math.max(2,e-2))} H ${tr(Math.max(2,t-1))}`,QOt=(t,e)=>{const r=Math.max(t,12),n=Math.max(e,12);return[`M ${tr(r*.18)} ${tr(n*.62)}`,`Q ${tr(r*.06)} ${tr(n*.6)} ${tr(r*.08)} ${tr(n*.44)}`,`Q ${tr(r*.02)} ${tr(n*.26)} ${tr(r*.22)} ${tr(n*.24)}`,`Q ${tr(r*.3)} ${tr(n*.06)} ${tr(r*.48)} ${tr(n*.14)}`,`Q ${tr(r*.6)} ${tr(n*.02)} ${tr(r*.72)} ${tr(n*.16)}`,`Q ${tr(r*.96)} ${tr(n*.14)} ${tr(r*.92)} ${tr(n*.4)}`,`Q ${tr(r*1.02)} ${tr(n*.56)} ${tr(r*.84)} ${tr(n*.64)}`,`Q ${tr(r*.8)} ${tr(n*.84)} ${tr(r*.58)} ${tr(n*.78)}`,`Q ${tr(r*.42)} ${tr(n*.92)} ${tr(r*.3)} ${tr(n*.76)}`,`Q ${tr(r*.12)} ${tr(n*.82)} ${tr(r*.18)} ${tr(n*.62)}`,"Z"].join(" ")},JOt=(t,e,r,n)=>t==="ellipse"||t==="circle"?{refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%"}:t==="diamond"?{refPoints:"5,0 10,5 5,10 0,5"}:t==="hexagon"?{refPoints:"2.5,0 7.5,0 10,5 7.5,10 2.5,10 0,5"}:t==="cloud"?{d:QOt(e,r)}:{rx:n,ry:n},ePt=(t,e,r={})=>{const n=r.underline??g3(t,r.structure),i=r.width??96,s=r.height??(t==="root"?46:n?32:36),a=r.tint,o=OQ(r.structure,t);if(n){const h=(a==null?void 0:a.edge)??e.mindMapEdge;return{body:{fill:"transparent",stroke:"none",strokeWidth:0,rx:0,ry:0},label:{fill:(a==null?void 0:a.text)??e.nodeText,fontSize:t==="primary"?14:13,fontWeight:t==="primary"?650:500,fontFamily:Nhe,lineHeight:18,refX:"50%",refY:s-6,textAnchor:"middle",textVerticalAnchor:"bottom"},underline:{d:ZOt(i,s),stroke:h,strokeWidth:1.8,fill:"none",strokeLinecap:"round",pointerEvents:"none"}}}const l=t==="root",u=o==="capsule"||l&&o==="rounded"?KOt(s):o==="rect"?2:l?12:t==="nested"?8:10;return{body:{fill:l?e.topicFill:(a==null?void 0:a.fill)??(t==="nested"?e.canvas:e.nodeFill),stroke:l?e.topicStroke:(a==null?void 0:a.stroke)??(t==="nested"?e.nodeStroke:e.topicStroke),strokeWidth:t==="nested"&&!l?1:1.5,...JOt(o,i,s,u)},label:{fill:l?e.topicText:(a==null?void 0:a.text)??e.nodeText,fontSize:l?15:t==="primary"?14:13,fontWeight:l||t==="primary"?650:500,fontFamily:Nhe,lineHeight:l?20:18,refY:"50%",textAnchor:"middle",textVerticalAnchor:"middle"},underline:{d:"",stroke:"none",fill:"none"}}},Dhe=(t,e,r,n,i,s,a)=>{const o=YM(t,e),l=g3(o,a),u=qOt(n)?jOt(UOt(t,e),i,n):void 0;return{role:o,underline:l,tint:u,visual:ePt(o,r,{tint:u,underline:l,structure:a,width:s.width,height:s.height})}},tPt=(t,e,r)=>{const n=(r==null?void 0:r.edge)??e.mindMapEdge;return t==="root"?{stroke:n,sourceWidth:3.1,targetWidth:1.55}:t==="primary"?{stroke:n,sourceWidth:1.85,targetWidth:1.15}:{stroke:n,sourceWidth:1.25,targetWidth:.9}},rPt=(t,e,r)=>{const n=DQ(r),i=t.x+t.width/2,s=e.x+e.width/2,a=t.y+t.height/2,o=e.y+e.height/2;return n==="org"?{source:"bottom",target:"top"}:n==="fishbone"?s<i-8?{source:"left",target:"right"}:o<a-8?{source:"top",target:"bottom"}:o>a+8?{source:"bottom",target:"top"}:{source:"left",target:"right"}:n==="timeline"?o<a-8?{source:s>=i?"right":"left",target:"bottom"}:o>a+8?{source:s>=i?"right":"left",target:"top"}:s>=i?{source:"right",target:"left"}:{source:"left",target:"right"}:s>=i?{source:"right",target:"left"}:{source:"left",target:"right"}},Ohe=(t,e,r,n)=>{const i=g3(e,n),s=i&&(r==="left"||r==="right")?t.height/2-2:0;return{anchor:{name:r,...s?{args:{dy:s}}:{}},connectionPoint:{name:i?"anchor":"boundary"}}},nPt=(t,e)=>{const r=t.filter(i=>i.parentId===e);if(r.length===0)return null;const n=r.map(i=>i.y+i.height/2);return{top:Math.min(...n),bottom:Math.max(...n)}},Phe=(t,e)=>VOt(t)?{fill:e,strokeWidth:.5,strokeLinejoin:"round",strokeLinecap:"round"}:{fill:"none",strokeWidth:1.7,strokeLinejoin:"round",strokeLinecap:"round"},iPt=(t,e,r,n,i)=>{const s=1-i;return{x:s*s*s*t.x+3*s*s*i*e.x+3*s*i*i*r.x+i*i*i*n.x,y:s*s*s*t.y+3*s*s*i*e.y+3*s*i*i*r.y+i*i*i*n.y}},sPt=(t,e,r,n,i)=>{const s=1-i;return{x:3*s*s*(e.x-t.x)+6*s*i*(r.x-e.x)+3*i*i*(n.x-r.x),y:3*s*s*(e.y-t.y)+6*s*i*(r.y-e.y)+3*i*i*(n.y-r.y)}},aPt=(t,e,r=2.4,n=1.15)=>{const i=e.x-t.x,s=e.y-t.y;if(Math.abs(i)<.01&&Math.abs(s)<.01)return`M ${tr(t.x)} ${tr(t.y)} L ${tr(e.x)} ${tr(e.y)}`;const a=(t.x+e.x)/2,o=t,l={x:a,y:t.y},u={x:a,y:e.y},h=e,d=20,f=[],p=[];for(let y=0;y<=d;y+=1){const v=y/d,x=iPt(o,l,u,h,v),b=sPt(o,l,u,h,v),T=Math.hypot(b.x,b.y)||1,C=((1-v)*r+v*n)/2,S=-b.y/T,k=b.x/T;f.push({x:x.x+S*C,y:x.y+k*C}),p.push({x:x.x-S*C,y:x.y-k*C})}const g=f[0],m=[`M ${tr(g.x)} ${tr(g.y)}`];for(let y=1;y<f.length;y+=1)m.push(`L ${tr(f[y].x)} ${tr(f[y].y)}`);for(let y=p.length-1;y>=0;y-=1)m.push(`L ${tr(p[y].x)} ${tr(p[y].y)}`);return m.push("Z"),m.join(" ")},oPt=t=>`${tr(t.x)} ${tr(t.y)}`,Od=t=>t.map((e,r)=>`${r===0?"M":"L"} ${oPt(e)}`).join(" "),lPt=(t,e,r)=>{if(Math.abs(t.x-e.x)<.8||Math.abs(t.y-e.y)<.8)return Od([t,e]);const n={x:t.x,y:(t.y+e.y)/2},i={x:e.x,y:n.y};return Od([t,n,i,e])},cPt=(t,e)=>{const r=t.x+Math.max(10,Math.min(28,Math.abs(e.x-t.x)*.38));return Math.abs(t.y-e.y)<.8?Od([t,e]):Od([t,{x:r,y:t.y},{x:r,y:e.y},e])},uPt=(t,e,r,n)=>{const i=Math.min(r??t.y,n??t.y,t.y,e.y),s=Math.max(r??t.y,n??t.y,t.y,e.y),a=Math.max(18,s-i),o=(i+s)/2-a/2,l=o+a,u=(o+l)/2,h=9,d=t.x+Math.max(18,Math.min(36,Math.abs(e.x-t.x)*.42));return[Od([t,{x:d-h,y:t.y}]),`M ${tr(d-h)} ${tr(o)}`,`C ${tr(d)} ${tr(o)} ${tr(d)} ${tr(o)} ${tr(d)} ${tr((o+u)/2)}`,`C ${tr(d)} ${tr(u)} ${tr(d+h)} ${tr(u)} ${tr(d+h)} ${tr(u)}`,`C ${tr(d)} ${tr(u)} ${tr(d)} ${tr(u)} ${tr(d)} ${tr((u+l)/2)}`,`C ${tr(d)} ${tr(l)} ${tr(d)} ${tr(l)} ${tr(d-h)} ${tr(l)}`,Od([{x:d,y:e.y},e])].join(" ")},hPt=(t,e)=>Math.abs(t.x-e.x)<.8||Math.abs(t.y-e.y)<.8?Od([t,e]):Od([t,{x:e.x,y:t.y},e]),dPt=(t,e)=>{if(Math.abs(t.y-e.y)<.8||Math.abs(t.x-e.x)<.8)return Od([t,e]);const r=Math.abs(e.y-t.y),n=t.x>=e.x?1:-1,i=e.x+n*Math.max(18,r/Math.sqrt(3)),s={x:n>0?Math.min(t.x,i):Math.max(t.x,i),y:t.y};return Od([t,s,e])},fPt=(t,e,r,n={})=>{const i=DQ(n.structure);return i==="org"?lPt(t,e):i==="tree"?cPt(t,e):i==="brace"?uPt(t,e,n.braceTop,n.braceBottom):i==="timeline"?hPt(t,e):i==="fishbone"?dPt(t,e):aPt(t,e,n.sourceWidth,n.targetWidth)},pPt=(t,e="light")=>NOt(t,e),gPt=(t,e)=>{const r=pPt(t.kind==="architecture"?t.theme??"brand":t.theme,e),n=t.kind==="flowchart"?t8e(e,t.theme):null,i=t.kind==="architecture"?ID(e):null,s=t.nodes.map(h=>{const d=t.kind==="mind-map"?YM(t.nodes,h.id):null,f=t.kind==="flowchart"?BOt(h.shape,h.label):d?XOt(h.label,d,t.structure):{width:h.width,height:h.height,text:h.label},p=d?Dhe(t.nodes,h.id,r,t.theme,e,f,t.structure):null,g=(p==null?void 0:p.visual)??null,m=t.kind==="flowchart"?oOt(h.shape,e,f,t.theme):null,y=t.kind==="architecture"?YDt(h.shape,e,f,h.resourceIcon):null,v=h.shape==="topic"&&!h.parentId,x=h.shape==="terminator",b=h.shape==="boundary",T=v||x,C=g?g.body.fill:m?m.body.fill:y?y.body.fill:T?r.topicFill:r.nodeFill,S=g?g.body.stroke:m?m.body.stroke:y?y.body.stroke:T?r.topicStroke:r.nodeStroke;return{id:h.id,shape:h.shape==="decision"?"polygon":"rect",x:h.x,y:h.y,width:f.width,height:f.height,zIndex:b?0:2,...y?{markup:y.markup}:d?{markup:HOt(t.structure,d)}:{},attrs:{body:{fill:C,stroke:S,strokeWidth:(g==null?void 0:g.body.strokeWidth)??(m==null?void 0:m.body.strokeWidth)??(y==null?void 0:y.body.strokeWidth)??1,strokeDasharray:(y==null?void 0:y.body.strokeDasharray)??(b?"7 5":void 0),...(g==null?void 0:g.body)??(m==null?void 0:m.body)??(y==null?void 0:y.body)??{rx:x?24:11,ry:x?24:11},...h.shape==="decision"?{refPoints:"0,10 10,0 20,10 10,20"}:{}},label:{text:f.text,lineHeight:(g==null?void 0:g.label.lineHeight)??(m==null?void 0:m.label.lineHeight)??(y==null?void 0:y.label.lineHeight)??(d==="root"?20:18),fill:(g==null?void 0:g.label.fill)??(m==null?void 0:m.label.fill)??(y==null?void 0:y.label.fill)??(T?r.topicText:r.nodeText),fontSize:(g==null?void 0:g.label.fontSize)??(m==null?void 0:m.label.fontSize)??(y==null?void 0:y.label.fontSize)??(h.shape==="topic"?14:13),fontWeight:(g==null?void 0:g.label.fontWeight)??(m==null?void 0:m.label.fontWeight)??(y==null?void 0:y.label.fontWeight)??(T?650:500),fontFamily:(g==null?void 0:g.label.fontFamily)??(m==null?void 0:m.label.fontFamily)??(y==null?void 0:y.label.fontFamily)??SW,...g?{refX:g.label.refX,refY:g.label.refY,textAnchor:g.label.textAnchor,textVerticalAnchor:g.label.textVerticalAnchor}:{},...y?{refX:y.label.refX,refY:y.label.refY,textAnchor:y.label.textAnchor,textVerticalAnchor:y.label.textVerticalAnchor}:{}},...g?{underline:g.underline}:{},...(y==null?void 0:y.attrs)??{}}}}),a=new Map(s.map(h=>[h.id,h])),o=t.nodes.filter(h=>h.shape==="boundary").map(h=>h.id),l=t.kind==="architecture"?VDt(t.nodes.filter(h=>h.shape!=="boundary"),t.edges):null,u=t.edges.map(h=>{const d=h.kind??(t.kind==="architecture"?"dependency":void 0),f=a.get(h.source),p=a.get(h.target),g=t.kind==="mind-map"?YM(t.nodes,h.source):null,m=t.kind==="mind-map"?YM(t.nodes,h.target):null,y=t.kind==="mind-map"?Dhe(t.nodes,h.target,r,t.theme,e,{width:96,height:36},t.structure).tint:void 0,v=g?tPt(g,r,y):null,x=f&&p?rPt(f,p,t.structure):{source:"right",target:"left"},b=f&&g?Ohe(f,g,x.source,t.structure):null,T=p&&m?Ohe(p,m,x.target,t.structure):null,C=t.kind==="mind-map"&&t.structure==="brace"?nPt(t.nodes,h.source):null,S=t.kind==="architecture"?XDt(d,e,h.bidirectional):null,k=(S==null?void 0:S.stroke)??(v==null?void 0:v.stroke)??(n==null?void 0:n.edge)??r.flowEdge,E=f&&p?t.kind==="architecture"?Q7e(f,p):t.kind==="flowchart"?JDt(f,p):null:null,A=t.kind==="flowchart"&&!!(E&&f&&p&&eOt(f,p)),R=l==null?void 0:l.get(h.id);return{id:h.id,source:t.kind==="mind-map"?{cell:h.source,...b??{anchor:{name:x.source}}}:R?{cell:h.source,anchor:Rhe(R.source)}:E?{cell:h.source,port:E.source}:{cell:h.source},target:t.kind==="mind-map"?{cell:h.target,...T??{anchor:{name:x.target}}}:R?{cell:h.target,anchor:Rhe(R.target)}:E?{cell:h.target,port:E.target}:{cell:h.target},router:t.kind==="architecture"?zDt(h.source,h.target,o,E??void 0):t.kind==="flowchart"?A?{name:"normal"}:QDt:void 0,connector:t.kind==="mind-map"?{name:s8e,args:{sourceWidth:v==null?void 0:v.sourceWidth,targetWidth:v==null?void 0:v.targetWidth,structure:t.structure,...C?{braceTop:C.top,braceBottom:C.bottom}:{}}}:{name:"rounded",args:{radius:10}},attrs:{line:{stroke:k,strokeWidth:(S==null?void 0:S.strokeWidth)??(v?Phe(t.structure,k).strokeWidth:1.5),strokeDasharray:S==null?void 0:S.strokeDasharray,sourceMarker:S?S.sourceMarker:h.bidirectional?{name:"block",width:7,height:5}:null,targetMarker:t.kind==="mind-map"?null:(S==null?void 0:S.targetMarker)??{name:"block",width:7,height:5},...v?Phe(t.structure,k):{fill:"none"}}},labels:h.label?[{attrs:{label:{text:h.label,fill:t.kind==="architecture"?e==="dark"?"#E2E8F0":"#334155":t.kind==="flowchart"?e==="dark"?"#E2E8F0":"#475569":(n==null?void 0:n.process.text)??(i==null?void 0:i.nodes.service.text)??r.nodeText,fontSize:t.kind==="architecture"?$Dt:t.kind==="flowchart"?KDt:FOt,fontWeight:t.kind==="architecture"||t.kind==="flowchart"?500:400,lineHeight:t.kind==="architecture"?BDt:t.kind==="flowchart"?ZDt:zOt,fontFamily:t.kind==="architecture"?Z7e:SW,textWrap:{width:140,height:512}},body:{ref:"label",refWidth:1,refHeight:1,refWidth2:t.kind==="architecture"||t.kind==="flowchart"?14:12,refHeight2:6,refX:t.kind==="architecture"||t.kind==="flowchart"?-7:-6,refY:-3,fill:t.kind==="architecture"?e==="dark"?"rgba(15, 23, 42, 0.92)":"rgba(255, 255, 255, 0.96)":t.kind==="flowchart"?e==="dark"?"rgba(24, 28, 34, 0.94)":"rgba(255, 255, 255, 0.95)":(n==null?void 0:n.canvas)??(i==null?void 0:i.canvas)??r.canvas,stroke:t.kind==="architecture"?(S==null?void 0:S.stroke)??(e==="dark"?"rgba(148, 163, 184, 0.3)":"rgba(203, 213, 225, 0.8)"):t.kind==="flowchart"?e==="dark"?"rgba(148, 163, 184, 0.28)":"rgba(100, 116, 139, 0.24)":(n==null?void 0:n.process.stroke)??(i==null?void 0:i.nodes.service.stroke)??r.nodeStroke,strokeWidth:1,rx:6,ry:6,...t.kind==="architecture"||t.kind==="flowchart"?{style:{filter:"drop-shadow(0 1px 2px rgba(0,0,0,0.06))"}}:{}}}}]:void 0}});return{canvas:(n==null?void 0:n.canvas)??(i==null?void 0:i.canvas)??r.canvas,edges:u,nodes:s}},a8e={compact:560,standard:680,wide:800},mPt=/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\.|$)/i,yPt={slate:"#f8fafc",aurora:"#a7f3d0",sunset:"#fde68a",midnight:"#090d16",mint:"#ecfdf5",notepad:"#fbf7ee",xuan:"#f7f6f2",lavender:"#f5f3ff",warm:"#fffbeb"},y5={slate:{canvasBg:"linear-gradient(145deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%)",cardBg:"#ffffff",cardBorder:"1px solid rgba(226, 232, 240, 0.85)",cardShadow:"0 2px 4px rgba(15, 23, 42, 0.02), 0 12px 28px -4px rgba(15, 23, 42, 0.07), 0 24px 60px -12px rgba(15, 23, 42, 0.06)",textColor:"#1e293b",headingColor:"#0f172a",metaColor:"#64748b",metaBg:"#f8fafc",metaBorder:"#e2e8f0",accentColor:"#16a06e",accentSubtle:"rgba(22, 160, 110, 0.16)",linkBg:"rgba(22, 160, 110, 0.08)",dividerColor:"#e2e8f0",codeBg:"#f8fafc",codeBorder:"#e2e8f0",codeColor:"#0f172a",quoteBg:"rgba(240, 253, 244, 0.7)",quoteBorder:"#10b981",tableThBg:"#f8fafc",tableBorder:"#e2e8f0",brandText:"#07130b",brandMark:"#16a06e"},aurora:{canvasBg:"linear-gradient(135deg, #a7f3d0 0%, #67e8f9 40%, #c4b5fd 100%)",cardBg:"rgba(255, 255, 255, 0.96)",cardBorder:"1px solid rgba(255, 255, 255, 0.95)",cardShadow:"0 24px 60px -12px rgba(14, 165, 233, 0.28), 0 4px 16px rgba(0, 0, 0, 0.04)",textColor:"#1e293b",headingColor:"#0f172a",metaColor:"#475569",metaBg:"rgba(241, 245, 249, 0.85)",metaBorder:"rgba(203, 213, 225, 0.7)",accentColor:"#0d9488",accentSubtle:"rgba(13, 148, 136, 0.18)",linkBg:"rgba(13, 148, 136, 0.09)",dividerColor:"rgba(226, 232, 240, 0.8)",codeBg:"rgba(248, 250, 252, 0.95)",codeBorder:"rgba(226, 232, 240, 0.8)",codeColor:"#0f172a",quoteBg:"rgba(240, 253, 250, 0.85)",quoteBorder:"#14b8a6",tableThBg:"#f1f5f9",tableBorder:"#cbd5e1",brandText:"#0f172a",brandMark:"#0d9488"},sunset:{canvasBg:"linear-gradient(135deg, #fde68a 0%, #fbcfe8 45%, #fed7aa 100%)",cardBg:"#fffdfa",cardBorder:"1px solid rgba(253, 230, 138, 0.7)",cardShadow:"0 24px 60px -12px rgba(244, 63, 94, 0.18), 0 4px 16px rgba(0, 0, 0, 0.03)",textColor:"#292524",headingColor:"#1c1917",metaColor:"#78716c",metaBg:"rgba(254, 243, 199, 0.75)",metaBorder:"rgba(253, 230, 138, 0.8)",accentColor:"#ea580c",accentSubtle:"rgba(234, 88, 12, 0.15)",linkBg:"rgba(234, 88, 12, 0.08)",dividerColor:"rgba(254, 215, 170, 0.7)",codeBg:"#fffbeb",codeBorder:"#fde68a",codeColor:"#1c1917",quoteBg:"rgba(255, 247, 237, 0.85)",quoteBorder:"#f97316",tableThBg:"#fef3c7",tableBorder:"#fde68a",brandText:"#1c1917",brandMark:"#ea580c"},midnight:{canvasBg:"linear-gradient(135deg, #090d16 0%, #0f172a 50%, #1e1b4b 100%)",cardBg:"#131b2e",cardBorder:"1px solid rgba(255, 255, 255, 0.14)",cardShadow:"0 24px 60px -12px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.08)",textColor:"#cbd5e1",headingColor:"#f8fafc",metaColor:"#94a3b8",metaBg:"rgba(30, 41, 59, 0.85)",metaBorder:"rgba(51, 65, 85, 0.8)",accentColor:"#34d399",accentSubtle:"rgba(52, 211, 153, 0.2)",linkBg:"rgba(52, 211, 153, 0.12)",dividerColor:"rgba(51, 65, 85, 0.7)",codeBg:"#0b1120",codeBorder:"#1e293b",codeColor:"#e2e8f0",quoteBg:"rgba(16, 185, 129, 0.12)",quoteBorder:"#34d399",tableThBg:"#1e293b",tableBorder:"#334155",brandText:"#f8fafc",brandMark:"#34d399",isDark:!0},mint:{canvasBg:"linear-gradient(135deg, #ecfdf5 0%, #d1fae5 50%, #a7f3d0 100%)",cardBg:"#ffffff",cardBorder:"1px solid rgba(167, 243, 208, 0.85)",cardShadow:"0 20px 50px -15px rgba(16, 185, 129, 0.2), 0 4px 16px rgba(16, 185, 129, 0.06)",textColor:"#134e4a",headingColor:"#042f2e",metaColor:"#0f766e",metaBg:"#ccfbf1",metaBorder:"#99f6e4",accentColor:"#059669",accentSubtle:"rgba(5, 150, 105, 0.18)",linkBg:"rgba(5, 150, 105, 0.1)",dividerColor:"#a7f3d0",codeBg:"#f0fdf4",codeBorder:"#a7f3d0",codeColor:"#064e3b",quoteBg:"rgba(236, 253, 245, 0.85)",quoteBorder:"#10b981",tableThBg:"#ccfbf1",tableBorder:"#99f6e4",brandText:"#042f2e",brandMark:"#059669"},notepad:{canvasBg:"linear-gradient(135deg, #fbf7ee 0%, #f4ede0 100%)",cardBg:"#fefdfa",cardBorder:"1px solid rgba(220, 205, 180, 0.85)",cardShadow:"0 2px 4px rgba(100, 80, 50, 0.04), 0 16px 36px -8px rgba(100, 80, 50, 0.12), 0 28px 64px -16px rgba(100, 80, 50, 0.08)",textColor:"#2c2419",headingColor:"#1a140d",metaColor:"#8c7b68",metaBg:"rgba(240, 230, 214, 0.6)",metaBorder:"#dfd3c3",accentColor:"#c2410c",accentSubtle:"rgba(194, 65, 12, 0.15)",linkBg:"rgba(194, 65, 12, 0.08)",dividerColor:"#e8decb",codeBg:"#f5efe4",codeBorder:"#e2d5c3",codeColor:"#1a140d",quoteBg:"rgba(248, 241, 230, 0.85)",quoteBorder:"#d97706",tableThBg:"#f5ede0",tableBorder:"#dfd3c3",brandText:"#1a140d",brandMark:"#c2410c"},xuan:{canvasBg:"linear-gradient(135deg, #f7f6f2 0%, #ebe8e1 100%)",cardBg:"#fdfcf7",cardBorder:"1px solid rgba(210, 205, 195, 0.8)",cardShadow:"0 20px 48px -12px rgba(40, 35, 30, 0.1), 0 4px 16px rgba(40, 35, 30, 0.03)",textColor:"#242220",headingColor:"#0f0e0d",metaColor:"#736d66",metaBg:"#f0eee8",metaBorder:"#dedad2",accentColor:"#b91c1c",accentSubtle:"rgba(185, 28, 28, 0.15)",linkBg:"rgba(185, 28, 28, 0.08)",dividerColor:"#e3dfd6",codeBg:"#f4f2eb",codeBorder:"#dedad2",codeColor:"#0f0e0d",quoteBg:"rgba(245, 243, 238, 0.85)",quoteBorder:"#b91c1c",tableThBg:"#edeae2",tableBorder:"#dedad2",brandText:"#0f0e0d",brandMark:"#b91c1c"},lavender:{canvasBg:"linear-gradient(135deg, #f5f3ff 0%, #ede9fe 50%, #ddd6fe 100%)",cardBg:"#ffffff",cardBorder:"1px solid rgba(221, 214, 254, 0.85)",cardShadow:"0 20px 48px -12px rgba(124, 58, 237, 0.16), 0 2px 8px rgba(124, 58, 237, 0.04)",textColor:"#1e1b4b",headingColor:"#0f0a2e",metaColor:"#6b21a8",metaBg:"#f5f3ff",metaBorder:"#ddd6fe",accentColor:"#7c3aed",accentSubtle:"rgba(124, 58, 237, 0.18)",linkBg:"rgba(124, 58, 237, 0.08)",dividerColor:"#e9d5ff",codeBg:"#faf5ff",codeBorder:"#e9d5ff",codeColor:"#4c1d95",quoteBg:"rgba(245, 243, 255, 0.85)",quoteBorder:"#8b5cf6",tableThBg:"#f5f3ff",tableBorder:"#ddd6fe",brandText:"#1e1b4b",brandMark:"#7c3aed"}},$he={sans:'system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif',serif:'"Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", "Hiragino Mincho ProN", Georgia, "Times New Roman", serif',mono:'"JetBrains Mono", "SF Mono", "Fira Code", Menlo, Monaco, Consolas, "Liberation Mono", monospace'},Bhe={sm:{base:"14.5px",lineHeight:"1.72",title:"28px",h1:"21px",h2:"18px",h3:"16px",h4:"15px",h5:"14.5px",h6:"14.5px",meta:"12px",code:"12.5px"},md:{base:"16px",lineHeight:"1.8",title:"32px",h1:"24px",h2:"20px",h3:"17.5px",h4:"16.5px",h5:"16px",h6:"16px",meta:"13px",code:"13.5px"},lg:{base:"18px",lineHeight:"1.86",title:"36px",h1:"27px",h2:"22.5px",h3:"19px",h4:"18px",h5:"18px",h6:"18px",meta:"14px",code:"15px"}},vPt=(t,e)=>e&&y5[e]?e:t==="warm"?"sunset":t&&y5[t]?t:"slate",bPt=(t,e)=>{const n=t.replace(/[\u0000-\u001f<>:"/\\|?*]/g,"-").replace(/\s+/g," ").replace(/[. ]+$/g,"").trim().slice(0,100)||e;return mPt.test(n)?`_${n}`:n},fC=t=>t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),xPt=({title:t,notebook:e="",tags:r=[],updatedAt:n="",bodyHtml:i,theme:s="slate",fontStyle:a="serif",showTitle:o=!0,showNotebook:l=!1,showTags:u=!1,showUpdatedAt:h=!0,showBranding:d=!0})=>{const f=a==="mono",p=s==="notepad",g=f?`<div class="edgeever-terminal-header">+`),fontSize:e==="root"?15:e==="primary"?14:13}},KOt=t=>Math.round(Math.max(1,t/2)),ZOt=(t,e)=>`M 1 ${tr(Math.max(2,e-2))} H ${tr(Math.max(2,t-1))}`,QOt=(t,e)=>{const r=Math.max(t,12),n=Math.max(e,12);return[`M ${tr(r*.18)} ${tr(n*.62)}`,`Q ${tr(r*.06)} ${tr(n*.6)} ${tr(r*.08)} ${tr(n*.44)}`,`Q ${tr(r*.02)} ${tr(n*.26)} ${tr(r*.22)} ${tr(n*.24)}`,`Q ${tr(r*.3)} ${tr(n*.06)} ${tr(r*.48)} ${tr(n*.14)}`,`Q ${tr(r*.6)} ${tr(n*.02)} ${tr(r*.72)} ${tr(n*.16)}`,`Q ${tr(r*.96)} ${tr(n*.14)} ${tr(r*.92)} ${tr(n*.4)}`,`Q ${tr(r*1.02)} ${tr(n*.56)} ${tr(r*.84)} ${tr(n*.64)}`,`Q ${tr(r*.8)} ${tr(n*.84)} ${tr(r*.58)} ${tr(n*.78)}`,`Q ${tr(r*.42)} ${tr(n*.92)} ${tr(r*.3)} ${tr(n*.76)}`,`Q ${tr(r*.12)} ${tr(n*.82)} ${tr(r*.18)} ${tr(n*.62)}`,"Z"].join(" ")},JOt=(t,e,r,n)=>t==="ellipse"||t==="circle"?{refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%"}:t==="diamond"?{refPoints:"5,0 10,5 5,10 0,5"}:t==="hexagon"?{refPoints:"2.5,0 7.5,0 10,5 7.5,10 2.5,10 0,5"}:t==="cloud"?{d:QOt(e,r)}:{rx:n,ry:n},ePt=(t,e,r={})=>{const n=r.underline??g3(t,r.structure),i=r.width??96,s=r.height??(t==="root"?46:n?32:36),a=r.tint,o=OQ(r.structure,t);if(n){const h=(a==null?void 0:a.edge)??e.mindMapEdge;return{body:{fill:"transparent",stroke:"none",strokeWidth:0,rx:0,ry:0},label:{fill:(a==null?void 0:a.text)??e.nodeText,fontSize:t==="primary"?14:13,fontWeight:t==="primary"?650:500,fontFamily:Nhe,lineHeight:18,refX:"50%",refY:s-6,textAnchor:"middle",textVerticalAnchor:"bottom"},underline:{d:ZOt(i,s),stroke:h,strokeWidth:1.8,fill:"none",strokeLinecap:"round",pointerEvents:"none"}}}const l=t==="root",u=o==="capsule"||l&&o==="rounded"?KOt(s):o==="rect"?2:l?12:t==="nested"?8:10;return{body:{fill:l?e.topicFill:(a==null?void 0:a.fill)??(t==="nested"?e.canvas:e.nodeFill),stroke:l?e.topicStroke:(a==null?void 0:a.stroke)??(t==="nested"?e.nodeStroke:e.topicStroke),strokeWidth:t==="nested"&&!l?1:1.5,...JOt(o,i,s,u)},label:{fill:l?e.topicText:(a==null?void 0:a.text)??e.nodeText,fontSize:l?15:t==="primary"?14:13,fontWeight:l||t==="primary"?650:500,fontFamily:Nhe,lineHeight:l?20:18,refY:"50%",textAnchor:"middle",textVerticalAnchor:"middle"},underline:{d:"",stroke:"none",fill:"none"}}},Dhe=(t,e,r,n,i,s,a)=>{const o=YM(t,e),l=g3(o,a),u=qOt(n)?jOt(UOt(t,e),i,n):void 0;return{role:o,underline:l,tint:u,visual:ePt(o,r,{tint:u,underline:l,structure:a,width:s.width,height:s.height})}},tPt=(t,e,r)=>{const n=(r==null?void 0:r.edge)??e.mindMapEdge;return t==="root"?{stroke:n,sourceWidth:3.1,targetWidth:1.55}:t==="primary"?{stroke:n,sourceWidth:1.85,targetWidth:1.15}:{stroke:n,sourceWidth:1.25,targetWidth:.9}},rPt=(t,e,r)=>{const n=DQ(r),i=t.x+t.width/2,s=e.x+e.width/2,a=t.y+t.height/2,o=e.y+e.height/2;return n==="org"?{source:"bottom",target:"top"}:n==="fishbone"?s<i-8?{source:"left",target:"right"}:o<a-8?{source:"top",target:"bottom"}:o>a+8?{source:"bottom",target:"top"}:{source:"left",target:"right"}:n==="timeline"?o<a-8?{source:s>=i?"right":"left",target:"bottom"}:o>a+8?{source:s>=i?"right":"left",target:"top"}:s>=i?{source:"right",target:"left"}:{source:"left",target:"right"}:s>=i?{source:"right",target:"left"}:{source:"left",target:"right"}},Ohe=(t,e,r,n)=>{const i=g3(e,n),s=i&&(r==="left"||r==="right")?t.height/2-2:0;return{anchor:{name:r,...s?{args:{dy:s}}:{}},connectionPoint:{name:i?"anchor":"boundary"}}},nPt=(t,e)=>{const r=t.filter(i=>i.parentId===e);if(r.length===0)return null;const n=r.map(i=>i.y+i.height/2);return{top:Math.min(...n),bottom:Math.max(...n)}},Phe=(t,e)=>VOt(t)?{fill:e,strokeWidth:.5,strokeLinejoin:"round",strokeLinecap:"round"}:{fill:"none",strokeWidth:1.7,strokeLinejoin:"round",strokeLinecap:"round"},iPt=(t,e,r,n,i)=>{const s=1-i;return{x:s*s*s*t.x+3*s*s*i*e.x+3*s*i*i*r.x+i*i*i*n.x,y:s*s*s*t.y+3*s*s*i*e.y+3*s*i*i*r.y+i*i*i*n.y}},sPt=(t,e,r,n,i)=>{const s=1-i;return{x:3*s*s*(e.x-t.x)+6*s*i*(r.x-e.x)+3*i*i*(n.x-r.x),y:3*s*s*(e.y-t.y)+6*s*i*(r.y-e.y)+3*i*i*(n.y-r.y)}},aPt=(t,e,r=2.4,n=1.15)=>{const i=e.x-t.x,s=e.y-t.y;if(Math.abs(i)<.01&&Math.abs(s)<.01)return`M ${tr(t.x)} ${tr(t.y)} L ${tr(e.x)} ${tr(e.y)}`;const a=(t.x+e.x)/2,o=t,l={x:a,y:t.y},u={x:a,y:e.y},h=e,d=20,f=[],p=[];for(let y=0;y<=d;y+=1){const v=y/d,x=iPt(o,l,u,h,v),b=sPt(o,l,u,h,v),T=Math.hypot(b.x,b.y)||1,C=((1-v)*r+v*n)/2,S=-b.y/T,k=b.x/T;f.push({x:x.x+S*C,y:x.y+k*C}),p.push({x:x.x-S*C,y:x.y-k*C})}const g=f[0],m=[`M ${tr(g.x)} ${tr(g.y)}`];for(let y=1;y<f.length;y+=1)m.push(`L ${tr(f[y].x)} ${tr(f[y].y)}`);for(let y=p.length-1;y>=0;y-=1)m.push(`L ${tr(p[y].x)} ${tr(p[y].y)}`);return m.push("Z"),m.join(" ")},oPt=t=>`${tr(t.x)} ${tr(t.y)}`,Od=t=>t.map((e,r)=>`${r===0?"M":"L"} ${oPt(e)}`).join(" "),lPt=(t,e,r)=>{if(Math.abs(t.x-e.x)<.8||Math.abs(t.y-e.y)<.8)return Od([t,e]);const n={x:t.x,y:(t.y+e.y)/2},i={x:e.x,y:n.y};return Od([t,n,i,e])},cPt=(t,e)=>{const r=t.x+Math.max(10,Math.min(28,Math.abs(e.x-t.x)*.38));return Math.abs(t.y-e.y)<.8?Od([t,e]):Od([t,{x:r,y:t.y},{x:r,y:e.y},e])},uPt=(t,e,r,n)=>{const i=Math.min(r??t.y,n??t.y,t.y,e.y),s=Math.max(r??t.y,n??t.y,t.y,e.y),a=Math.max(18,s-i),o=(i+s)/2-a/2,l=o+a,u=(o+l)/2,h=9,d=t.x+Math.max(18,Math.min(36,Math.abs(e.x-t.x)*.42));return[Od([t,{x:d-h,y:t.y}]),`M ${tr(d-h)} ${tr(o)}`,`C ${tr(d)} ${tr(o)} ${tr(d)} ${tr(o)} ${tr(d)} ${tr((o+u)/2)}`,`C ${tr(d)} ${tr(u)} ${tr(d+h)} ${tr(u)} ${tr(d+h)} ${tr(u)}`,`C ${tr(d)} ${tr(u)} ${tr(d)} ${tr(u)} ${tr(d)} ${tr((u+l)/2)}`,`C ${tr(d)} ${tr(l)} ${tr(d)} ${tr(l)} ${tr(d-h)} ${tr(l)}`,Od([{x:d,y:e.y},e])].join(" ")},hPt=(t,e)=>Math.abs(t.x-e.x)<.8||Math.abs(t.y-e.y)<.8?Od([t,e]):Od([t,{x:e.x,y:t.y},e]),dPt=(t,e)=>{if(Math.abs(t.y-e.y)<.8||Math.abs(t.x-e.x)<.8)return Od([t,e]);const r=Math.abs(e.y-t.y),n=t.x>=e.x?1:-1,i=e.x+n*Math.max(18,r/Math.sqrt(3)),s={x:n>0?Math.min(t.x,i):Math.max(t.x,i),y:t.y};return Od([t,s,e])},fPt=(t,e,r,n={})=>{const i=DQ(n.structure);return i==="org"?lPt(t,e):i==="tree"?cPt(t,e):i==="brace"?uPt(t,e,n.braceTop,n.braceBottom):i==="timeline"?hPt(t,e):i==="fishbone"?dPt(t,e):aPt(t,e,n.sourceWidth,n.targetWidth)},pPt=(t,e="light")=>NOt(t,e),gPt=(t,e)=>{const r=pPt(t.kind==="architecture"?t.theme??"brand":t.theme,e),n=t.kind==="flowchart"?t8e(e,t.theme):null,i=t.kind==="architecture"?ID(e):null,s=t.nodes.map(h=>{const d=t.kind==="mind-map"?YM(t.nodes,h.id):null,f=t.kind==="flowchart"?BOt(h.shape,h.label):d?XOt(h.label,d,t.structure):{width:h.width,height:h.height,text:h.label},p=d?Dhe(t.nodes,h.id,r,t.theme,e,f,t.structure):null,g=(p==null?void 0:p.visual)??null,m=t.kind==="flowchart"?oOt(h.shape,e,f,t.theme):null,y=t.kind==="architecture"?YDt(h.shape,e,f,h.resourceIcon):null,v=h.shape==="topic"&&!h.parentId,x=h.shape==="terminator",b=h.shape==="boundary",T=v||x,C=g?g.body.fill:m?m.body.fill:y?y.body.fill:T?r.topicFill:r.nodeFill,S=g?g.body.stroke:m?m.body.stroke:y?y.body.stroke:T?r.topicStroke:r.nodeStroke;return{id:h.id,shape:h.shape==="decision"?"polygon":"rect",x:h.x,y:h.y,width:f.width,height:f.height,zIndex:b?0:2,...y?{markup:y.markup}:d?{markup:HOt(t.structure,d)}:{},attrs:{body:{fill:C,stroke:S,strokeWidth:(g==null?void 0:g.body.strokeWidth)??(m==null?void 0:m.body.strokeWidth)??(y==null?void 0:y.body.strokeWidth)??1,strokeDasharray:(y==null?void 0:y.body.strokeDasharray)??(b?"7 5":void 0),...(g==null?void 0:g.body)??(m==null?void 0:m.body)??(y==null?void 0:y.body)??{rx:x?24:11,ry:x?24:11},...h.shape==="decision"?{refPoints:"0,10 10,0 20,10 10,20"}:{}},label:{text:f.text,lineHeight:(g==null?void 0:g.label.lineHeight)??(m==null?void 0:m.label.lineHeight)??(y==null?void 0:y.label.lineHeight)??(d==="root"?20:18),fill:(g==null?void 0:g.label.fill)??(m==null?void 0:m.label.fill)??(y==null?void 0:y.label.fill)??(T?r.topicText:r.nodeText),fontSize:(g==null?void 0:g.label.fontSize)??(m==null?void 0:m.label.fontSize)??(y==null?void 0:y.label.fontSize)??(h.shape==="topic"?14:13),fontWeight:(g==null?void 0:g.label.fontWeight)??(m==null?void 0:m.label.fontWeight)??(y==null?void 0:y.label.fontWeight)??(T?650:500),fontFamily:(g==null?void 0:g.label.fontFamily)??(m==null?void 0:m.label.fontFamily)??(y==null?void 0:y.label.fontFamily)??SW,...g?{refX:g.label.refX,refY:g.label.refY,textAnchor:g.label.textAnchor,textVerticalAnchor:g.label.textVerticalAnchor}:{},...y?{refX:y.label.refX,refY:y.label.refY,textAnchor:y.label.textAnchor,textVerticalAnchor:y.label.textVerticalAnchor}:{}},...g?{underline:g.underline}:{},...(y==null?void 0:y.attrs)??{}}}}),a=new Map(s.map(h=>[h.id,h])),o=t.nodes.filter(h=>h.shape==="boundary").map(h=>h.id),l=t.kind==="architecture"?VDt(t.nodes.filter(h=>h.shape!=="boundary"),t.edges):null,u=t.edges.map(h=>{const d=h.kind??(t.kind==="architecture"?"dependency":void 0),f=a.get(h.source),p=a.get(h.target),g=t.kind==="mind-map"?YM(t.nodes,h.source):null,m=t.kind==="mind-map"?YM(t.nodes,h.target):null,y=t.kind==="mind-map"?Dhe(t.nodes,h.target,r,t.theme,e,{width:96,height:36},t.structure).tint:void 0,v=g?tPt(g,r,y):null,x=f&&p?rPt(f,p,t.structure):{source:"right",target:"left"},b=f&&g?Ohe(f,g,x.source,t.structure):null,T=p&&m?Ohe(p,m,x.target,t.structure):null,C=t.kind==="mind-map"&&t.structure==="brace"?nPt(t.nodes,h.source):null,S=t.kind==="architecture"?XDt(d,e,h.bidirectional):null,k=(S==null?void 0:S.stroke)??(v==null?void 0:v.stroke)??(n==null?void 0:n.edge)??r.flowEdge,E=f&&p?t.kind==="architecture"?Q7e(f,p):t.kind==="flowchart"?JDt(f,p):null:null,A=t.kind==="flowchart"&&!!(E&&f&&p&&eOt(f,p)),R=l==null?void 0:l.get(h.id);return{id:h.id,source:t.kind==="mind-map"?{cell:h.source,...b??{anchor:{name:x.source}}}:R?{cell:h.source,anchor:Rhe(R.source)}:E?{cell:h.source,port:E.source}:{cell:h.source},target:t.kind==="mind-map"?{cell:h.target,...T??{anchor:{name:x.target}}}:R?{cell:h.target,anchor:Rhe(R.target)}:E?{cell:h.target,port:E.target}:{cell:h.target},router:t.kind==="architecture"?zDt(h.source,h.target,o,E??void 0):t.kind==="flowchart"?A?{name:"normal"}:QDt:void 0,connector:t.kind==="mind-map"?{name:s8e,args:{sourceWidth:v==null?void 0:v.sourceWidth,targetWidth:v==null?void 0:v.targetWidth,structure:t.structure,...C?{braceTop:C.top,braceBottom:C.bottom}:{}}}:{name:"rounded",args:{radius:10}},attrs:{line:{stroke:k,strokeWidth:(S==null?void 0:S.strokeWidth)??(v?Phe(t.structure,k).strokeWidth:1.5),strokeDasharray:S==null?void 0:S.strokeDasharray,sourceMarker:S?S.sourceMarker:h.bidirectional?{name:"block",width:7,height:5}:null,targetMarker:t.kind==="mind-map"?null:(S==null?void 0:S.targetMarker)??{name:"block",width:7,height:5},...v?Phe(t.structure,k):{fill:"none"}}},labels:h.label?[{attrs:{label:{text:h.label,fill:t.kind==="architecture"?e==="dark"?"#E2E8F0":"#334155":t.kind==="flowchart"?e==="dark"?"#E2E8F0":"#475569":(n==null?void 0:n.process.text)??(i==null?void 0:i.nodes.service.text)??r.nodeText,fontSize:t.kind==="architecture"?$Dt:t.kind==="flowchart"?KDt:FOt,fontWeight:t.kind==="architecture"||t.kind==="flowchart"?500:400,lineHeight:t.kind==="architecture"?BDt:t.kind==="flowchart"?ZDt:zOt,fontFamily:t.kind==="architecture"?Z7e:SW,textWrap:{width:140,height:512}},body:{ref:"label",refWidth:1,refHeight:1,refWidth2:t.kind==="architecture"||t.kind==="flowchart"?14:12,refHeight2:6,refX:t.kind==="architecture"||t.kind==="flowchart"?-7:-6,refY:-3,fill:t.kind==="architecture"?e==="dark"?"rgba(15, 23, 42, 0.92)":"rgba(255, 255, 255, 0.96)":t.kind==="flowchart"?e==="dark"?"rgba(24, 28, 34, 0.94)":"rgba(255, 255, 255, 0.95)":(n==null?void 0:n.canvas)??(i==null?void 0:i.canvas)??r.canvas,stroke:t.kind==="architecture"?(S==null?void 0:S.stroke)??(e==="dark"?"rgba(148, 163, 184, 0.3)":"rgba(203, 213, 225, 0.8)"):t.kind==="flowchart"?e==="dark"?"rgba(148, 163, 184, 0.28)":"rgba(100, 116, 139, 0.24)":(n==null?void 0:n.process.stroke)??(i==null?void 0:i.nodes.service.stroke)??r.nodeStroke,strokeWidth:1,rx:6,ry:6,...t.kind==="architecture"||t.kind==="flowchart"?{style:{filter:"drop-shadow(0 1px 2px rgba(0,0,0,0.06))"}}:{}}}}]:void 0}});return{canvas:(n==null?void 0:n.canvas)??(i==null?void 0:i.canvas)??r.canvas,edges:u,nodes:s}},a8e={compact:560,standard:680,wide:800},mPt=/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\.|$)/i,yPt={slate:"#f8fafc",aurora:"#a7f3d0",sunset:"#fde68a",midnight:"#090d16",mint:"#ecfdf5",notepad:"#fbf7ee",xuan:"#f7f6f2",lavender:"#f5f3ff",warm:"#fffbeb"},y5={slate:{canvasBg:"linear-gradient(145deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%)",cardBg:"#ffffff",cardBorder:"1px solid rgba(226, 232, 240, 0.85)",cardShadow:"0 2px 4px rgba(15, 23, 42, 0.02), 0 12px 28px -4px rgba(15, 23, 42, 0.07), 0 24px 60px -12px rgba(15, 23, 42, 0.06)",textColor:"#1e293b",headingColor:"#0f172a",metaColor:"#64748b",metaBg:"#f8fafc",metaBorder:"#e2e8f0",accentColor:"#16a06e",accentSubtle:"rgba(22, 160, 110, 0.16)",linkBg:"rgba(22, 160, 110, 0.08)",dividerColor:"#e2e8f0",codeBg:"#f8fafc",codeBorder:"#e2e8f0",codeColor:"#0f172a",quoteBg:"rgba(240, 253, 244, 0.7)",quoteBorder:"#10b981",tableThBg:"#f8fafc",tableBorder:"#e2e8f0",brandText:"#07130b",brandMark:"#16a06e"},aurora:{canvasBg:"linear-gradient(135deg, #a7f3d0 0%, #67e8f9 40%, #c4b5fd 100%)",cardBg:"rgba(255, 255, 255, 0.96)",cardBorder:"1px solid rgba(255, 255, 255, 0.95)",cardShadow:"0 24px 60px -12px rgba(14, 165, 233, 0.28), 0 4px 16px rgba(0, 0, 0, 0.04)",textColor:"#1e293b",headingColor:"#0f172a",metaColor:"#475569",metaBg:"rgba(241, 245, 249, 0.85)",metaBorder:"rgba(203, 213, 225, 0.7)",accentColor:"#0d9488",accentSubtle:"rgba(13, 148, 136, 0.18)",linkBg:"rgba(13, 148, 136, 0.09)",dividerColor:"rgba(226, 232, 240, 0.8)",codeBg:"rgba(248, 250, 252, 0.95)",codeBorder:"rgba(226, 232, 240, 0.8)",codeColor:"#0f172a",quoteBg:"rgba(240, 253, 250, 0.85)",quoteBorder:"#14b8a6",tableThBg:"#f1f5f9",tableBorder:"#cbd5e1",brandText:"#0f172a",brandMark:"#0d9488"},sunset:{canvasBg:"linear-gradient(135deg, #fde68a 0%, #fbcfe8 45%, #fed7aa 100%)",cardBg:"#fffdfa",cardBorder:"1px solid rgba(253, 230, 138, 0.7)",cardShadow:"0 24px 60px -12px rgba(244, 63, 94, 0.18), 0 4px 16px rgba(0, 0, 0, 0.03)",textColor:"#292524",headingColor:"#1c1917",metaColor:"#78716c",metaBg:"rgba(254, 243, 199, 0.75)",metaBorder:"rgba(253, 230, 138, 0.8)",accentColor:"#ea580c",accentSubtle:"rgba(234, 88, 12, 0.15)",linkBg:"rgba(234, 88, 12, 0.08)",dividerColor:"rgba(254, 215, 170, 0.7)",codeBg:"#fffbeb",codeBorder:"#fde68a",codeColor:"#1c1917",quoteBg:"rgba(255, 247, 237, 0.85)",quoteBorder:"#f97316",tableThBg:"#fef3c7",tableBorder:"#fde68a",brandText:"#1c1917",brandMark:"#ea580c"},midnight:{canvasBg:"linear-gradient(135deg, #090d16 0%, #0f172a 50%, #1e1b4b 100%)",cardBg:"#131b2e",cardBorder:"1px solid rgba(255, 255, 255, 0.14)",cardShadow:"0 24px 60px -12px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.08)",textColor:"#cbd5e1",headingColor:"#f8fafc",metaColor:"#94a3b8",metaBg:"rgba(30, 41, 59, 0.85)",metaBorder:"rgba(51, 65, 85, 0.8)",accentColor:"#34d399",accentSubtle:"rgba(52, 211, 153, 0.2)",linkBg:"rgba(52, 211, 153, 0.12)",dividerColor:"rgba(51, 65, 85, 0.7)",codeBg:"#0b1120",codeBorder:"#1e293b",codeColor:"#e2e8f0",quoteBg:"rgba(16, 185, 129, 0.12)",quoteBorder:"#34d399",tableThBg:"#1e293b",tableBorder:"#334155",brandText:"#f8fafc",brandMark:"#34d399",isDark:!0},mint:{canvasBg:"linear-gradient(135deg, #ecfdf5 0%, #d1fae5 50%, #a7f3d0 100%)",cardBg:"#ffffff",cardBorder:"1px solid rgba(167, 243, 208, 0.85)",cardShadow:"0 20px 50px -15px rgba(16, 185, 129, 0.2), 0 4px 16px rgba(16, 185, 129, 0.06)",textColor:"#134e4a",headingColor:"#042f2e",metaColor:"#0f766e",metaBg:"#ccfbf1",metaBorder:"#99f6e4",accentColor:"#059669",accentSubtle:"rgba(5, 150, 105, 0.18)",linkBg:"rgba(5, 150, 105, 0.1)",dividerColor:"#a7f3d0",codeBg:"#f0fdf4",codeBorder:"#a7f3d0",codeColor:"#064e3b",quoteBg:"rgba(236, 253, 245, 0.85)",quoteBorder:"#10b981",tableThBg:"#ccfbf1",tableBorder:"#99f6e4",brandText:"#042f2e",brandMark:"#059669"},notepad:{canvasBg:"linear-gradient(135deg, #fbf7ee 0%, #f4ede0 100%)",cardBg:"#fefdfa",cardBorder:"1px solid rgba(220, 205, 180, 0.85)",cardShadow:"0 2px 4px rgba(100, 80, 50, 0.04), 0 16px 36px -8px rgba(100, 80, 50, 0.12), 0 28px 64px -16px rgba(100, 80, 50, 0.08)",textColor:"#2c2419",headingColor:"#1a140d",metaColor:"#8c7b68",metaBg:"rgba(240, 230, 214, 0.6)",metaBorder:"#dfd3c3",accentColor:"#c2410c",accentSubtle:"rgba(194, 65, 12, 0.15)",linkBg:"rgba(194, 65, 12, 0.08)",dividerColor:"#e8decb",codeBg:"#f5efe4",codeBorder:"#e2d5c3",codeColor:"#1a140d",quoteBg:"rgba(248, 241, 230, 0.85)",quoteBorder:"#d97706",tableThBg:"#f5ede0",tableBorder:"#dfd3c3",brandText:"#1a140d",brandMark:"#c2410c"},xuan:{canvasBg:"linear-gradient(135deg, #f7f6f2 0%, #ebe8e1 100%)",cardBg:"#fdfcf7",cardBorder:"1px solid rgba(210, 205, 195, 0.8)",cardShadow:"0 20px 48px -12px rgba(40, 35, 30, 0.1), 0 4px 16px rgba(40, 35, 30, 0.03)",textColor:"#242220",headingColor:"#0f0e0d",metaColor:"#736d66",metaBg:"#f0eee8",metaBorder:"#dedad2",accentColor:"#b91c1c",accentSubtle:"rgba(185, 28, 28, 0.15)",linkBg:"rgba(185, 28, 28, 0.08)",dividerColor:"#e3dfd6",codeBg:"#f4f2eb",codeBorder:"#dedad2",codeColor:"#0f0e0d",quoteBg:"rgba(245, 243, 238, 0.85)",quoteBorder:"#b91c1c",tableThBg:"#edeae2",tableBorder:"#dedad2",brandText:"#0f0e0d",brandMark:"#b91c1c"},lavender:{canvasBg:"linear-gradient(135deg, #f5f3ff 0%, #ede9fe 50%, #ddd6fe 100%)",cardBg:"#ffffff",cardBorder:"1px solid rgba(221, 214, 254, 0.85)",cardShadow:"0 20px 48px -12px rgba(124, 58, 237, 0.16), 0 2px 8px rgba(124, 58, 237, 0.04)",textColor:"#1e1b4b",headingColor:"#0f0a2e",metaColor:"#6b21a8",metaBg:"#f5f3ff",metaBorder:"#ddd6fe",accentColor:"#7c3aed",accentSubtle:"rgba(124, 58, 237, 0.18)",linkBg:"rgba(124, 58, 237, 0.08)",dividerColor:"#e9d5ff",codeBg:"#faf5ff",codeBorder:"#e9d5ff",codeColor:"#4c1d95",quoteBg:"rgba(245, 243, 255, 0.85)",quoteBorder:"#8b5cf6",tableThBg:"#f5f3ff",tableBorder:"#ddd6fe",brandText:"#1e1b4b",brandMark:"#7c3aed"}},$he={sans:'system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif',serif:'"Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", "Hiragino Mincho ProN", Georgia, "Times New Roman", serif',mono:'"JetBrains Mono", "SF Mono", "Fira Code", Menlo, Monaco, Consolas, "Liberation Mono", monospace'},Bhe={sm:{base:"14.5px",lineHeight:"1.72",title:"28px",h1:"21px",h2:"18px",h3:"16px",h4:"15px",h5:"14.5px",h6:"14.5px",meta:"12px",code:"12.5px"},md:{base:"16px",lineHeight:"1.8",title:"32px",h1:"24px",h2:"20px",h3:"17.5px",h4:"16.5px",h5:"16px",h6:"16px",meta:"13px",code:"13.5px"},lg:{base:"18px",lineHeight:"1.86",title:"36px",h1:"27px",h2:"22.5px",h3:"19px",h4:"18px",h5:"18px",h6:"18px",meta:"14px",code:"15px"}},vPt=(t,e)=>e&&y5[e]?e:t==="warm"?"sunset":t&&y5[t]?t:"aurora",bPt=(t,e)=>{const n=t.replace(/[\u0000-\u001f<>:"/\\|?*]/g,"-").replace(/\s+/g," ").replace(/[. ]+$/g,"").trim().slice(0,100)||e;return mPt.test(n)?`_${n}`:n},fC=t=>t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),xPt=({title:t,notebook:e="",tags:r=[],updatedAt:n="",bodyHtml:i,theme:s="aurora",fontStyle:a="serif",showTitle:o=!0,showNotebook:l=!1,showTags:u=!1,showUpdatedAt:h=!0,showBranding:d=!0})=>{const f=a==="mono",p=s==="notepad",g=f?`<div class="edgeever-terminal-header"><span class="edgeever-terminal-dot dot-red"></span><span class="edgeever-terminal-dot dot-yellow"></span><span class="edgeever-terminal-dot dot-green"></span>@@ -1978,7 +1978,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.</div></footer>`:""}</article>-</div>`},wPt=({theme:t="slate",fontStyle:e="serif",fontSize:r="lg",cardWidth:n="standard"})=>{const i=y5[t]||y5.slate,s=$he[e]||$he.sans,a=Bhe[r]||Bhe.md,o=a8e[n]||680;return`+</div>`},wPt=({theme:t="aurora",fontStyle:e="serif",fontSize:r="lg",cardWidth:n="standard"})=>{const i=y5[t]||y5.aurora,s=$he[e]||$he.sans,a=Bhe[r]||Bhe.md,o=a8e[n]||680;return`:root {--ee-canvas-bg: ${i.canvasBg};--ee-card-bg: ${i.cardBg};@@ -2661,7 +2661,7 @@ l0,-`+(r+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,`)},WB="edgeever-inline-sentinel",aFt=(t,e,r)=>{var i;const n=(i=t.storage.markdown)==null?void 0:i.manager;return n!=null&&n.serialize?n.serialize(aJ({type:"doc",content:[{type:"paragraph",content:e}]})).replaceAll(sJ,"\\$"):r},oFt=t=>{const e=t.state.selection;if(e.empty||e.from>=e.to)return null;const r=[];if(t.state.doc.nodesBetween(e.from,e.to,(i,s)=>{if(!i.isTextblock)return!0;const a=s+1,o=a+i.content.size,l=Math.max(e.from,a),u=Math.min(e.to,o);return u>l&&r.push({node:i,contentFrom:a,contentTo:o,from:l,to:u}),!1}),r.length===1){const i=r[0],s=i.node.cut(i.from-i.contentFrom,i.to-i.contentFrom).toJSON(),a=t.state.doc.textBetween(i.from,i.to,``),o=aFt(t,s.content??[],a).trim();return o?{from:i.from,to:i.to,isInline:!0,markdown:o,text:a}:null}const n=sFt(t,e.from,e.to).trim();return n?{from:e.from,to:e.to,isInline:!1,markdown:n,text:t.state.doc.textBetween(e.from,e.to,`-`)}:null},lFt=(t,e,r)=>{var f,p,g;const n=(f=t.storage.markdown)==null?void 0:f.manager,i=e.trim(),s=((p=n==null?void 0:n.parse)==null?void 0:p.call(n,i).content)??[{type:"text",text:i}];if(!r)return s;const a=i.replace(/\s*\n+\s*/g," "),o=(g=n==null?void 0:n.parse)==null?void 0:g.call(n,`${WB}${a}`).content,l=(o==null?void 0:o.length)===1?o[0]:null,u=(l==null?void 0:l.type)==="paragraph"?l.content??[]:[],h=u[0];if((h==null?void 0:h.type)!=="text"||typeof h.text!="string"||!h.text.startsWith(WB))return[{type:"text",text:a}];const d=h.text.slice(WB.length);return[...d?[{...h,text:d}]:[],...u.slice(1)]};function ed(t){try{const e=JSON.stringify(vQ(t.getJSON())),r=yMe(t);Ua({type:"change",contentMarkdown:r,contentJson:e})}catch(e){Ua({type:"error",message:e instanceof Error?e.message:String(e)})}}function cFt(t,e){const r=e.trim().toLocaleLowerCase();if(r.length===0)return[];const n=[];let i=null;t.state.doc.descendants((l,u)=>{if(!(!l.isText||!l.text)){i!==null&&u>i&&n.push({char:"\0",pos:-1});for(let h=0;h<l.text.length;h+=1)n.push({char:l.text[h]??"",pos:u+h});i=u+l.text.length}});const s=n.map(l=>l.char).join("").toLocaleLowerCase(),a=[];let o=s.indexOf(r);for(;o!==-1;){const l=n[o],u=n[o+r.length-1];l&&u&&l.pos>=0&&u.pos>=0&&a.push({from:l.pos,to:u.pos+1}),o=s.indexOf(r,o+r.length)}return a}const Rde=()=>mr.isActive("taskItem")?"taskItem":"listItem";function vMe(t){var r;if(QM.classList.toggle("editor-mode",t),QM.innerHTML="",!t)return;const e=[{id:"undo",label:"↩",run:()=>mr.chain().focus().undo().run()},{id:"redo",label:"↪",run:()=>mr.chain().focus().redo().run()},{id:"image",label:"▧+",run:()=>Ua({type:"pickImage"})},{id:"bold",label:"B",run:()=>mr.chain().focus().toggleBold().run()},{id:"bullet",label:"•",run:()=>mr.chain().focus().toggleBulletList().run()},{id:"task",label:"☑",run:()=>mr.chain().focus().toggleTaskList().run()},{id:"indent",label:"⇥",run:()=>mr.chain().focus().sinkListItem(Rde()).run()},{id:"outdent",label:"⇤",run:()=>mr.chain().focus().liftListItem(Rde()).run()},{id:"quote",label:"❝",run:()=>mr.chain().focus().toggleBlockquote().run()},{id:"hr",label:"—",run:()=>mr.chain().focus().setHorizontalRule().run()}];for(const n of e){const i=document.createElement("button");i.type="button",i.textContent=n.label,i.dataset.action=n.id;const s={undo:{"zh-CN":"撤销","en-US":"Undo",ja:"元に戻す",pl:"Cofnij"},redo:{"zh-CN":"重做","en-US":"Redo",ja:"やり直す",pl:"Ponów"},image:{"zh-CN":"插入图片","en-US":"Insert image",ja:"画像を挿入",pl:"Wstaw obraz"},bold:{"zh-CN":"粗体","en-US":"Bold",ja:"太字",pl:"Pogrubienie"},bullet:{"zh-CN":"项目符号列表","en-US":"Bullet list",ja:"箇条書き",pl:"Lista punktowana"},task:{"zh-CN":"任务清单","en-US":"Task list",ja:"タスクリスト",pl:"Lista zadań"},indent:{"zh-CN":"增加列表缩进","en-US":"Increase list indent",ja:"リストのインデントを増やす",pl:"Zwiększ wcięcie listy"},outdent:{"zh-CN":"减少列表缩进","en-US":"Decrease list indent",ja:"リストのインデントを減らす",pl:"Zmniejsz wcięcie listy"},quote:{"zh-CN":"引用","en-US":"Block quote",ja:"引用",pl:"Cytat"},hr:{"zh-CN":"分隔线","en-US":"Horizontal rule",ja:"区切り線",pl:"Linia pozioma"}};i.setAttribute("aria-label",((r=s[n.id])==null?void 0:r[mL])??n.id),i.addEventListener("click",()=>{n.run(),n.id!=="image"&&ed(mr),b5()}),QM.appendChild(i)}b5()}function b5(){const t={bold:mr.isActive("bold"),bullet:mr.isActive("bulletList"),task:mr.isActive("taskList"),quote:mr.isActive("blockquote")},e=n=>{try{return mr.can().chain().focus()[n]().run()}catch{return!1}},r={undo:e("undo"),redo:e("redo")};QM.querySelectorAll("button[data-action]").forEach(n=>{const i=n.dataset.action??"";n.classList.toggle("is-active",t[i]??!1),i in r&&(n.disabled=!r[i])})}async function qB(t="light"){zo.querySelectorAll("[data-placeholder]").forEach(e=>{e.dataset.placeholder=BW}),fMe(zo),await JBt(zo),ta==="viewer"&&(!bL||!tFt(zo,bL,t))&&(iJ(),await eFt(zo,t))}async function uFt(t){var p;if(!t.requestId||t.format!=="png"&&t.format!=="jpeg")return;const e=vPt(t.background,t.theme),r=t.fontStyle??"serif",n=t.fontSize??"lg",i=t.cardWidth??"standard",s=a8e[i]||680,a=y5[e]||y5.slate,o=mr.view.dom.cloneNode(!0);o.removeAttribute("contenteditable"),o.querySelectorAll("button, [contenteditable='true']").forEach(g=>{g.removeAttribute("contenteditable"),g instanceof HTMLButtonElement&&g.remove()});const l=o.innerHTML,u=document.createElement("div");u.style.cssText=`position:fixed;left:-100000px;top:0;width:${s}px;pointer-events:none;`;const h=document.createElement("style");h.textContent=wPt({theme:e,fontStyle:r,fontSize:n,cardWidth:i});const d=xPt({title:t.title||t.fallbackTitle,notebook:t.notebook,tags:t.tags,updatedAt:t.updatedAt,bodyHtml:l,theme:e,fontStyle:r,showTitle:t.showTitle??!0,showNotebook:t.showNotebook??!1,showTags:t.showTags??!1,showUpdatedAt:t.showUpdatedAt??!0,showBranding:t.branding??!0});u.appendChild(h),u.insertAdjacentHTML("beforeend",d);const f=u.lastElementChild;f.style.width=`${s}px`,f.style.maxWidth="none",f.style.margin="0",document.body.appendChild(u);try{await((p=document.fonts)==null?void 0:p.ready),await Promise.all(Array.from(f.querySelectorAll("img")).map(async R=>{if(!R.complete)try{await R.decode()}catch{}}));const g=Array.from(f.querySelectorAll(".edgeever-card-body img")),m=g.filter(R=>!R.complete||R.naturalWidth===0).length,y=Math.max(1,Math.ceil(f.getBoundingClientRect().height)),v=yPt[e]||a.canvasBg,x=await D6t(f,{backgroundColor:v,cacheBust:!1,height:y,pixelRatio:2,skipFonts:!0,width:s}),b=await new Promise((R,_)=>{x.toBlob(P=>P?R(P):_(new Error("Image renderer returned an empty file")),t.format==="jpeg"?"image/jpeg":"image/png",t.format==="jpeg"?.92:1)}),T=t.format==="jpeg"?"jpg":"png",C=bPt(t.title,t.fallbackTitle),S=await ZBt(b),k=`${C}.${T}`,E=t.format==="jpeg"?"image/jpeg":"image/png",A=QBt(S);for(let R=0;R<A.length;R+=Ede)Ua({type:"imageExportChunk",requestId:t.requestId,chunk:A.slice(R,R+Ede)}),await new Promise(_=>setTimeout(_,0));Ua({type:"imageExportComplete",requestId:t.requestId,filename:k,mimeType:E,width:x.width,height:x.height,totalImages:g.length,failedImages:m})}catch(g){Ua({type:"imageExportError",requestId:t.requestId,message:g instanceof Error?g.message:"Image export failed"})}finally{u.remove()}}const hFt={exportImage(t){uFt(t)},configure(t){const e=t.mode==="editor"?"editor":"viewer",r=e!==ta;ta=e,mL=t.locale==="en-US"||t.locale==="ja"||t.locale==="pl"?t.locale:"zh-CN",mr.setEditable(ta==="editor"),vMe(ta==="editor"),document.documentElement.dataset.theme=t.theme||"light",document.body.classList.toggle("viewer-mode",ta==="viewer"),document.body.classList.toggle("editor-mode",ta==="editor"),t.placeholder&&(BW=t.placeholder,zo.querySelectorAll("[data-placeholder]").forEach(n=>{n.dataset.placeholder=BW})),ta==="editor"&&r&&requestAnimationFrame(()=>{try{mr.commands.focus("end")}catch{}}),qB(t.theme||"light")},setMarkdown(t){var n;sk=!0;const e=ta==="viewer"?kOt(t):null;bL=e;const r=ta==="viewer"?e?"":SOt(t):t;try{mr.commands.setContent(r||"",{contentType:"markdown"})}catch{try{const i=(n=mr.storage.markdown)==null?void 0:n.manager;if(i)mr.commands.setContent(i.parse(r||""));else throw new Error("no markdown manager")}catch{mr.commands.setContent({type:"doc",content:[{type:"paragraph",content:r?[{type:"text",text:r}]:[]}]})}}mr.setEditable(ta==="editor"),zhe(mr),b5(),sk=!1,qB(document.documentElement.dataset.theme||"light")},setDocumentFromJSON(t){sk=!0,bL=null,iJ();try{const e=JSON.parse(t);mr.commands.setContent(n9t(cDt(e),mL))}catch{mr.commands.setContent({type:"doc",content:[{type:"paragraph"}]})}mr.setEditable(ta==="editor"),zhe(mr),b5(),sk=!1,qB(document.documentElement.dataset.theme||"light")},resolveResource(t,e){const r=yL.get(t);r&&(yL.delete(t),r(e))},getMarkdown(){return yMe(mr)},getDocument(){return JSON.stringify(vQ(mr.getJSON()))},captureSelection(){const t=oFt(mr);return t?(pC={from:t.from,to:t.to,isInline:t.isInline,documentFingerprint:JSON.stringify(mr.getJSON())},JSON.stringify({from:t.from,to:t.to,markdown:t.markdown,text:t.text})):(pC=null,null)},applySelectionDraft(t,e){var a,o;const r=pC;if(!r||!t.trim())return!1;if(JSON.stringify(mr.getJSON())!==r.documentFingerprint)return pC=null,!1;const n=mr.state.doc.content.size,i=Math.min(Math.max(r.from,0),n),s=Math.min(Math.max(r.to,i),n);try{const l=(a=mr.storage.markdown)==null?void 0:a.manager,u=(o=l==null?void 0:l.parse)==null?void 0:o.call(l,t),h=e==="replace"?lFt(mr,t,r.isInline):(u==null?void 0:u.content)??t,d=e==="append"?{from:s,to:s}:{from:i,to:s};return mr.chain().focus().insertContentAt(d,h).run(),pC=null,ed(mr),!0}catch{return!1}},undo(){if(!mr.can().undo())return!1;const t=mr.commands.undo();return t&&ed(mr),t},focusEnd(){var t;try{mr.commands.focus("end")}catch{}try{const e=(t=mr.view)==null?void 0:t.dom;e&&typeof e.focus=="function"&&e.focus({preventScroll:!0})}catch{}},flush(){ed(mr)},exec(t){var r;const e={bold:()=>mr.chain().focus().toggleBold().run(),bulletList:()=>mr.chain().focus().toggleBulletList().run(),taskList:()=>mr.chain().focus().toggleTaskList().run(),blockquote:()=>mr.chain().focus().toggleBlockquote().run(),horizontalRule:()=>mr.chain().focus().setHorizontalRule().run(),heading2:()=>mr.chain().focus().toggleHeading({level:2}).run(),codeBlock:()=>mr.chain().focus().toggleCodeBlock().run()};(r=e[t])==null||r.call(e),ed(mr)},beginImageUpload(t,e){mr.chain().focus().setImage({src:e,alt:t,width:Vue}).run();const r=zo.querySelectorAll("img"),n=r[r.length-1];n&&(n.dataset.uploadId=t),ed(mr)},completeImageUpload(t,e,r){mr.isEditable&&(mr.view.dispatch(VBt(mr.state,{src:e,alt:r||t||"",width:Vue})),ed(mr))},groupImages(t){const e=HBt(mr,t);return e&&ed(mr),e},cancelImageUpload(t){const e=zo.querySelector(`img[data-upload-id="${t}"]`);e==null||e.remove(),ed(mr)},search(t,e){const r=cFt(mr,t),n=r.length>0?Math.min(Math.max(Number.isFinite(e)?e:0,0),r.length-1):0,i=r[n];if(i){mr.commands.setTextSelection({from:i.from,to:i.to});try{const s=mr.view.domAtPos(i.from).node,a=s instanceof Element?s:s.parentElement;a==null||a.scrollIntoView({block:"center",behavior:"smooth"})}catch{}}Ua({type:"searchResult",count:r.length,index:n})}};window.EdgeEverEditor=hFt;vMe(!1);Ua({type:"ready",startupMs:Math.round(performance.now()-XBt)});class Gt extends Error{constructor(e,r){var n="KaTeX parse error: "+e,i,s,a=r&&r.loc;if(a&&a.start<=a.end){var o=a.lexer.input;i=a.start,s=a.end,i===o.length?n+=" at end of input: ":n+=" at position "+(i+1)+": ";var l=o.slice(i,s).replace(/[^]/g,"$&̲"),u;i>15?u="…"+o.slice(i-15,i):u=o.slice(0,i);var h;s+15<o.length?h=o.slice(s,s+15)+"…":h=o.slice(s),n+=u+l+h}super(n),this.name="ParseError",this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,Gt.prototype),this.position=i,i!=null&&s!=null&&(this.length=s-i),this.rawMessage=e}}var dFt=/([A-Z])/g,fFt=t=>t.replace(dFt,"-$1").toLowerCase(),pFt={"&":"&",">":">","<":"<",'"':""","'":"'"},gFt=/[&><"']/g,Go=t=>String(t).replace(gFt,e=>pFt[e]),JM=t=>t.type==="ordgroup"||t.type==="color"?t.body.length===1?JM(t.body[0]):t:t.type==="font"?JM(t.body):t,mFt=new Set(["mathord","textord","atom"]),U0=t=>mFt.has(JM(t).type),yFt=t=>{var e=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(t);return e?e[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e[1])?null:e[1].toLowerCase():"_relative"},xL={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 vFt(t){if(typeof t!="string")return t.enum[0];switch(t){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}function bFt(t){if(t.default!==void 0)return t.default;var e=Array.isArray(t.type)?t.type[0]:t.type;return vFt(e)}function xFt(t,e,r,n){var i=r[e];t[e]=i!==void 0?n.processor?n.processor(i):i:bFt(n)}class oJ{constructor(e){e===void 0&&(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 of Object.keys(xL)){var n=xL[r];n&&xFt(this,r,e,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 Gt("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("url"in e&&e.url&&!e.protocol){var r=yFt(e.url);if(r==null)return!1;e.protocol=r}var n=typeof this.trust=="function"?this.trust(e):this.trust;return!!n}}class gp{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 ud[wFt[this.id]]}sub(){return ud[TFt[this.id]]}fracNum(){return ud[CFt[this.id]]}fracDen(){return ud[kFt[this.id]]}cramp(){return ud[SFt[this.id]]}text(){return ud[EFt[this.id]]}isTight(){return this.size>=2}}var lJ=0,wL=1,Ob=2,o0=3,zE=4,xu=5,x5=6,kl=7,ud=[new gp(lJ,0,!1),new gp(wL,0,!0),new gp(Ob,1,!1),new gp(o0,1,!0),new gp(zE,2,!1),new gp(xu,2,!0),new gp(x5,3,!1),new gp(kl,3,!0)],wFt=[zE,xu,zE,xu,x5,kl,x5,kl],TFt=[xu,xu,xu,xu,kl,kl,kl,kl],CFt=[Ob,o0,zE,xu,x5,kl,x5,kl],kFt=[o0,o0,xu,xu,kl,kl,kl,kl],SFt=[wL,wL,o0,o0,xu,xu,kl,kl],EFt=[lJ,wL,Ob,o0,Ob,o0,Ob,o0],dn={DISPLAY:ud[lJ],TEXT:ud[Ob],SCRIPT:ud[zE],SCRIPTSCRIPT:ud[x5]},FW=[{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 AFt(t){for(var e=0;e<FW.length;e++)for(var r=FW[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 eR=[];FW.forEach(t=>t.blocks.forEach(e=>eR.push(...e)));function bMe(t){for(var e=0;e<eR.length;e+=2)if(t>=eR[e]&&t<=eR[e+1])return!0;return!1}var ba=t=>t+" "+t,jv=80,MFt=function(e,r){return"M95,"+(622+e+r)+`+`)}:null},lFt=(t,e,r)=>{var f,p,g;const n=(f=t.storage.markdown)==null?void 0:f.manager,i=e.trim(),s=((p=n==null?void 0:n.parse)==null?void 0:p.call(n,i).content)??[{type:"text",text:i}];if(!r)return s;const a=i.replace(/\s*\n+\s*/g," "),o=(g=n==null?void 0:n.parse)==null?void 0:g.call(n,`${WB}${a}`).content,l=(o==null?void 0:o.length)===1?o[0]:null,u=(l==null?void 0:l.type)==="paragraph"?l.content??[]:[],h=u[0];if((h==null?void 0:h.type)!=="text"||typeof h.text!="string"||!h.text.startsWith(WB))return[{type:"text",text:a}];const d=h.text.slice(WB.length);return[...d?[{...h,text:d}]:[],...u.slice(1)]};function ed(t){try{const e=JSON.stringify(vQ(t.getJSON())),r=yMe(t);Ua({type:"change",contentMarkdown:r,contentJson:e})}catch(e){Ua({type:"error",message:e instanceof Error?e.message:String(e)})}}function cFt(t,e){const r=e.trim().toLocaleLowerCase();if(r.length===0)return[];const n=[];let i=null;t.state.doc.descendants((l,u)=>{if(!(!l.isText||!l.text)){i!==null&&u>i&&n.push({char:"\0",pos:-1});for(let h=0;h<l.text.length;h+=1)n.push({char:l.text[h]??"",pos:u+h});i=u+l.text.length}});const s=n.map(l=>l.char).join("").toLocaleLowerCase(),a=[];let o=s.indexOf(r);for(;o!==-1;){const l=n[o],u=n[o+r.length-1];l&&u&&l.pos>=0&&u.pos>=0&&a.push({from:l.pos,to:u.pos+1}),o=s.indexOf(r,o+r.length)}return a}const Rde=()=>mr.isActive("taskItem")?"taskItem":"listItem";function vMe(t){var r;if(QM.classList.toggle("editor-mode",t),QM.innerHTML="",!t)return;const e=[{id:"undo",label:"↩",run:()=>mr.chain().focus().undo().run()},{id:"redo",label:"↪",run:()=>mr.chain().focus().redo().run()},{id:"image",label:"▧+",run:()=>Ua({type:"pickImage"})},{id:"bold",label:"B",run:()=>mr.chain().focus().toggleBold().run()},{id:"bullet",label:"•",run:()=>mr.chain().focus().toggleBulletList().run()},{id:"task",label:"☑",run:()=>mr.chain().focus().toggleTaskList().run()},{id:"indent",label:"⇥",run:()=>mr.chain().focus().sinkListItem(Rde()).run()},{id:"outdent",label:"⇤",run:()=>mr.chain().focus().liftListItem(Rde()).run()},{id:"quote",label:"❝",run:()=>mr.chain().focus().toggleBlockquote().run()},{id:"hr",label:"—",run:()=>mr.chain().focus().setHorizontalRule().run()}];for(const n of e){const i=document.createElement("button");i.type="button",i.textContent=n.label,i.dataset.action=n.id;const s={undo:{"zh-CN":"撤销","en-US":"Undo",ja:"元に戻す",pl:"Cofnij"},redo:{"zh-CN":"重做","en-US":"Redo",ja:"やり直す",pl:"Ponów"},image:{"zh-CN":"插入图片","en-US":"Insert image",ja:"画像を挿入",pl:"Wstaw obraz"},bold:{"zh-CN":"粗体","en-US":"Bold",ja:"太字",pl:"Pogrubienie"},bullet:{"zh-CN":"项目符号列表","en-US":"Bullet list",ja:"箇条書き",pl:"Lista punktowana"},task:{"zh-CN":"任务清单","en-US":"Task list",ja:"タスクリスト",pl:"Lista zadań"},indent:{"zh-CN":"增加列表缩进","en-US":"Increase list indent",ja:"リストのインデントを増やす",pl:"Zwiększ wcięcie listy"},outdent:{"zh-CN":"减少列表缩进","en-US":"Decrease list indent",ja:"リストのインデントを減らす",pl:"Zmniejsz wcięcie listy"},quote:{"zh-CN":"引用","en-US":"Block quote",ja:"引用",pl:"Cytat"},hr:{"zh-CN":"分隔线","en-US":"Horizontal rule",ja:"区切り線",pl:"Linia pozioma"}};i.setAttribute("aria-label",((r=s[n.id])==null?void 0:r[mL])??n.id),i.addEventListener("click",()=>{n.run(),n.id!=="image"&&ed(mr),b5()}),QM.appendChild(i)}b5()}function b5(){const t={bold:mr.isActive("bold"),bullet:mr.isActive("bulletList"),task:mr.isActive("taskList"),quote:mr.isActive("blockquote")},e=n=>{try{return mr.can().chain().focus()[n]().run()}catch{return!1}},r={undo:e("undo"),redo:e("redo")};QM.querySelectorAll("button[data-action]").forEach(n=>{const i=n.dataset.action??"";n.classList.toggle("is-active",t[i]??!1),i in r&&(n.disabled=!r[i])})}async function qB(t="light"){zo.querySelectorAll("[data-placeholder]").forEach(e=>{e.dataset.placeholder=BW}),fMe(zo),await JBt(zo),ta==="viewer"&&(!bL||!tFt(zo,bL,t))&&(iJ(),await eFt(zo,t))}async function uFt(t){var p;if(!t.requestId||t.format!=="png"&&t.format!=="jpeg")return;const e=vPt(t.background,t.theme),r=t.fontStyle??"serif",n=t.fontSize??"lg",i=t.cardWidth??"standard",s=a8e[i]||680,a=y5[e]||y5.aurora,o=mr.view.dom.cloneNode(!0);o.removeAttribute("contenteditable"),o.querySelectorAll("button, [contenteditable='true']").forEach(g=>{g.removeAttribute("contenteditable"),g instanceof HTMLButtonElement&&g.remove()});const l=o.innerHTML,u=document.createElement("div");u.style.cssText=`position:fixed;left:-100000px;top:0;width:${s}px;pointer-events:none;`;const h=document.createElement("style");h.textContent=wPt({theme:e,fontStyle:r,fontSize:n,cardWidth:i});const d=xPt({title:t.title||t.fallbackTitle,notebook:t.notebook,tags:t.tags,updatedAt:t.updatedAt,bodyHtml:l,theme:e,fontStyle:r,showTitle:t.showTitle??!0,showNotebook:t.showNotebook??!1,showTags:t.showTags??!1,showUpdatedAt:t.showUpdatedAt??!0,showBranding:t.branding??!0});u.appendChild(h),u.insertAdjacentHTML("beforeend",d);const f=u.lastElementChild;f.style.width=`${s}px`,f.style.maxWidth="none",f.style.margin="0",document.body.appendChild(u);try{await((p=document.fonts)==null?void 0:p.ready),await Promise.all(Array.from(f.querySelectorAll("img")).map(async R=>{if(!R.complete)try{await R.decode()}catch{}}));const g=Array.from(f.querySelectorAll(".edgeever-card-body img")),m=g.filter(R=>!R.complete||R.naturalWidth===0).length,y=Math.max(1,Math.ceil(f.getBoundingClientRect().height)),v=yPt[e]||a.canvasBg,x=await D6t(f,{backgroundColor:v,cacheBust:!1,height:y,pixelRatio:2,skipFonts:!0,width:s}),b=await new Promise((R,_)=>{x.toBlob(P=>P?R(P):_(new Error("Image renderer returned an empty file")),t.format==="jpeg"?"image/jpeg":"image/png",t.format==="jpeg"?.92:1)}),T=t.format==="jpeg"?"jpg":"png",C=bPt(t.title,t.fallbackTitle),S=await ZBt(b),k=`${C}.${T}`,E=t.format==="jpeg"?"image/jpeg":"image/png",A=QBt(S);for(let R=0;R<A.length;R+=Ede)Ua({type:"imageExportChunk",requestId:t.requestId,chunk:A.slice(R,R+Ede)}),await new Promise(_=>setTimeout(_,0));Ua({type:"imageExportComplete",requestId:t.requestId,filename:k,mimeType:E,width:x.width,height:x.height,totalImages:g.length,failedImages:m})}catch(g){Ua({type:"imageExportError",requestId:t.requestId,message:g instanceof Error?g.message:"Image export failed"})}finally{u.remove()}}const hFt={exportImage(t){uFt(t)},configure(t){const e=t.mode==="editor"?"editor":"viewer",r=e!==ta;ta=e,mL=t.locale==="en-US"||t.locale==="ja"||t.locale==="pl"?t.locale:"zh-CN",mr.setEditable(ta==="editor"),vMe(ta==="editor"),document.documentElement.dataset.theme=t.theme||"light",document.body.classList.toggle("viewer-mode",ta==="viewer"),document.body.classList.toggle("editor-mode",ta==="editor"),t.placeholder&&(BW=t.placeholder,zo.querySelectorAll("[data-placeholder]").forEach(n=>{n.dataset.placeholder=BW})),ta==="editor"&&r&&requestAnimationFrame(()=>{try{mr.commands.focus("end")}catch{}}),qB(t.theme||"light")},setMarkdown(t){var n;sk=!0;const e=ta==="viewer"?kOt(t):null;bL=e;const r=ta==="viewer"?e?"":SOt(t):t;try{mr.commands.setContent(r||"",{contentType:"markdown"})}catch{try{const i=(n=mr.storage.markdown)==null?void 0:n.manager;if(i)mr.commands.setContent(i.parse(r||""));else throw new Error("no markdown manager")}catch{mr.commands.setContent({type:"doc",content:[{type:"paragraph",content:r?[{type:"text",text:r}]:[]}]})}}mr.setEditable(ta==="editor"),zhe(mr),b5(),sk=!1,qB(document.documentElement.dataset.theme||"light")},setDocumentFromJSON(t){sk=!0,bL=null,iJ();try{const e=JSON.parse(t);mr.commands.setContent(n9t(cDt(e),mL))}catch{mr.commands.setContent({type:"doc",content:[{type:"paragraph"}]})}mr.setEditable(ta==="editor"),zhe(mr),b5(),sk=!1,qB(document.documentElement.dataset.theme||"light")},resolveResource(t,e){const r=yL.get(t);r&&(yL.delete(t),r(e))},getMarkdown(){return yMe(mr)},getDocument(){return JSON.stringify(vQ(mr.getJSON()))},captureSelection(){const t=oFt(mr);return t?(pC={from:t.from,to:t.to,isInline:t.isInline,documentFingerprint:JSON.stringify(mr.getJSON())},JSON.stringify({from:t.from,to:t.to,markdown:t.markdown,text:t.text})):(pC=null,null)},applySelectionDraft(t,e){var a,o;const r=pC;if(!r||!t.trim())return!1;if(JSON.stringify(mr.getJSON())!==r.documentFingerprint)return pC=null,!1;const n=mr.state.doc.content.size,i=Math.min(Math.max(r.from,0),n),s=Math.min(Math.max(r.to,i),n);try{const l=(a=mr.storage.markdown)==null?void 0:a.manager,u=(o=l==null?void 0:l.parse)==null?void 0:o.call(l,t),h=e==="replace"?lFt(mr,t,r.isInline):(u==null?void 0:u.content)??t,d=e==="append"?{from:s,to:s}:{from:i,to:s};return mr.chain().focus().insertContentAt(d,h).run(),pC=null,ed(mr),!0}catch{return!1}},undo(){if(!mr.can().undo())return!1;const t=mr.commands.undo();return t&&ed(mr),t},focusEnd(){var t;try{mr.commands.focus("end")}catch{}try{const e=(t=mr.view)==null?void 0:t.dom;e&&typeof e.focus=="function"&&e.focus({preventScroll:!0})}catch{}},flush(){ed(mr)},exec(t){var r;const e={bold:()=>mr.chain().focus().toggleBold().run(),bulletList:()=>mr.chain().focus().toggleBulletList().run(),taskList:()=>mr.chain().focus().toggleTaskList().run(),blockquote:()=>mr.chain().focus().toggleBlockquote().run(),horizontalRule:()=>mr.chain().focus().setHorizontalRule().run(),heading2:()=>mr.chain().focus().toggleHeading({level:2}).run(),codeBlock:()=>mr.chain().focus().toggleCodeBlock().run()};(r=e[t])==null||r.call(e),ed(mr)},beginImageUpload(t,e){mr.chain().focus().setImage({src:e,alt:t,width:Vue}).run();const r=zo.querySelectorAll("img"),n=r[r.length-1];n&&(n.dataset.uploadId=t),ed(mr)},completeImageUpload(t,e,r){mr.isEditable&&(mr.view.dispatch(VBt(mr.state,{src:e,alt:r||t||"",width:Vue})),ed(mr))},groupImages(t){const e=HBt(mr,t);return e&&ed(mr),e},cancelImageUpload(t){const e=zo.querySelector(`img[data-upload-id="${t}"]`);e==null||e.remove(),ed(mr)},search(t,e){const r=cFt(mr,t),n=r.length>0?Math.min(Math.max(Number.isFinite(e)?e:0,0),r.length-1):0,i=r[n];if(i){mr.commands.setTextSelection({from:i.from,to:i.to});try{const s=mr.view.domAtPos(i.from).node,a=s instanceof Element?s:s.parentElement;a==null||a.scrollIntoView({block:"center",behavior:"smooth"})}catch{}}Ua({type:"searchResult",count:r.length,index:n})}};window.EdgeEverEditor=hFt;vMe(!1);Ua({type:"ready",startupMs:Math.round(performance.now()-XBt)});class Gt extends Error{constructor(e,r){var n="KaTeX parse error: "+e,i,s,a=r&&r.loc;if(a&&a.start<=a.end){var o=a.lexer.input;i=a.start,s=a.end,i===o.length?n+=" at end of input: ":n+=" at position "+(i+1)+": ";var l=o.slice(i,s).replace(/[^]/g,"$&̲"),u;i>15?u="…"+o.slice(i-15,i):u=o.slice(0,i);var h;s+15<o.length?h=o.slice(s,s+15)+"…":h=o.slice(s),n+=u+l+h}super(n),this.name="ParseError",this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,Gt.prototype),this.position=i,i!=null&&s!=null&&(this.length=s-i),this.rawMessage=e}}var dFt=/([A-Z])/g,fFt=t=>t.replace(dFt,"-$1").toLowerCase(),pFt={"&":"&",">":">","<":"<",'"':""","'":"'"},gFt=/[&><"']/g,Go=t=>String(t).replace(gFt,e=>pFt[e]),JM=t=>t.type==="ordgroup"||t.type==="color"?t.body.length===1?JM(t.body[0]):t:t.type==="font"?JM(t.body):t,mFt=new Set(["mathord","textord","atom"]),U0=t=>mFt.has(JM(t).type),yFt=t=>{var e=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(t);return e?e[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e[1])?null:e[1].toLowerCase():"_relative"},xL={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 vFt(t){if(typeof t!="string")return t.enum[0];switch(t){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}function bFt(t){if(t.default!==void 0)return t.default;var e=Array.isArray(t.type)?t.type[0]:t.type;return vFt(e)}function xFt(t,e,r,n){var i=r[e];t[e]=i!==void 0?n.processor?n.processor(i):i:bFt(n)}class oJ{constructor(e){e===void 0&&(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 of Object.keys(xL)){var n=xL[r];n&&xFt(this,r,e,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 Gt("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("url"in e&&e.url&&!e.protocol){var r=yFt(e.url);if(r==null)return!1;e.protocol=r}var n=typeof this.trust=="function"?this.trust(e):this.trust;return!!n}}class gp{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 ud[wFt[this.id]]}sub(){return ud[TFt[this.id]]}fracNum(){return ud[CFt[this.id]]}fracDen(){return ud[kFt[this.id]]}cramp(){return ud[SFt[this.id]]}text(){return ud[EFt[this.id]]}isTight(){return this.size>=2}}var lJ=0,wL=1,Ob=2,o0=3,zE=4,xu=5,x5=6,kl=7,ud=[new gp(lJ,0,!1),new gp(wL,0,!0),new gp(Ob,1,!1),new gp(o0,1,!0),new gp(zE,2,!1),new gp(xu,2,!0),new gp(x5,3,!1),new gp(kl,3,!0)],wFt=[zE,xu,zE,xu,x5,kl,x5,kl],TFt=[xu,xu,xu,xu,kl,kl,kl,kl],CFt=[Ob,o0,zE,xu,x5,kl,x5,kl],kFt=[o0,o0,xu,xu,kl,kl,kl,kl],SFt=[wL,wL,o0,o0,xu,xu,kl,kl],EFt=[lJ,wL,Ob,o0,Ob,o0,Ob,o0],dn={DISPLAY:ud[lJ],TEXT:ud[Ob],SCRIPT:ud[zE],SCRIPTSCRIPT:ud[x5]},FW=[{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 AFt(t){for(var e=0;e<FW.length;e++)for(var r=FW[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 eR=[];FW.forEach(t=>t.blocks.forEach(e=>eR.push(...e)));function bMe(t){for(var e=0;e<eR.length;e+=2)if(t>=eR[e]&&t<=eR[e+1])return!0;return!1}var ba=t=>t+" "+t,jv=80,MFt=function(e,r){return"M95,"+(622+e+r)+`c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54c44.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@@ -2965,10 +2965,10 @@ https://github.com/jquery/jquery/blob/master/src/event.jsvec2 v = ab*vec2(-cs.y,cs.x);w = w + dot(p-u,v)/(dot(p-u,u)+dot(v,v));}-+// compute final point and distancefloat d = length(p-ab*vec2(cos(w),sin(w)));-+// return signed distancereturn (dot(p/ab,p/ab)>1.0) ? d : -d;}@@ -2977,16 +2977,16 @@ https://github.com/jquery/jquery/blob/master/src/event.jsuniform mat3 uPanZoomMatrix;uniform int uAtlasSize;-+// instancedin vec2 aPosition; // a vertex from the unit square-+in mat3 aTransform; // used to transform verticies, eg into a bounding boxin int aVertType; // the type of thing we are rendering// the z-index that is output when using picking modein vec4 aIndex;-+// For texturesin int aAtlasId; // which shader unit/atlas to usein vec4 aTex; // x/y/w/h of texture in atlas@@ -3006,7 +3006,7 @@ https://github.com/jquery/jquery/blob/master/src/event.jsout vec4 vColor;out vec2 vPosition;// flat values are not interpolated- flat out int vAtlasId;+ flat out int vAtlasId;flat out int vVertType;flat out vec2 vTopRight;flat out vec2 vBotLeft;@@ -3014,7 +3014,7 @@ https://github.com/jquery/jquery/blob/master/src/event.jsflat out vec4 vBorderColor;flat out vec2 vBorderWidth;flat out vec4 vIndex;-+void main(void) {int vid = gl_VertexID;vec2 position = aPosition; // TODO make this a vec3, simplifies some code below@@ -3037,7 +3037,7 @@ https://github.com/jquery/jquery/blob/master/src/event.jsgl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);}- else if(aVertType == `).concat(t2," || aVertType == ").concat(wC,`+ else if(aVertType == `).concat(t2," || aVertType == ").concat(wC,`|| aVertType == `).concat(q8," || aVertType == ").concat(xC,`) { // simple shapes// the bounding box is needed by the fragment shader@@ -3067,7 +3067,7 @@ https://github.com/jquery/jquery/blob/master/src/event.jsgl_Position = vec4(uPanZoomMatrix * vec3(point, 1.0), 1.0);vColor = aColor;- }+ }else if(aVertType == `).concat(age,`) {vec2 pointA = aPointAPointB.xy;vec2 pointB = aPointAPointB.zw;@@ -3116,7 +3116,7 @@ https://github.com/jquery/jquery/blob/master/src/event.js}vColor = aColor;- }+ }else if(aVertType == `).concat(Wz,` && vid < 3) {// massage the first triangle into an edge arrowif(vid == 0)@@ -3168,16 +3168,16 @@ https://github.com/jquery/jquery/blob/master/src/event.js`).concat(IXt,`vec4 blend(vec4 top, vec4 bot) { // blend colors with premultiplied alpha- return vec4(+ return vec4(top.rgb + (bot.rgb * (1.0 - top.a)),- top.a + (bot.a * (1.0 - top.a))+ top.a + (bot.a * (1.0 - top.a)));}vec4 distInterp(vec4 cA, vec4 cB, float d) { // interpolate color using Signed Distance// scale to the zoom level so that borders don't look blurry when zoomed in// note 1.5 is an aribitrary value chosen because it looks good- return mix(cA, cB, 1.0 - smoothstep(0.0, 1.5 / uZoom, abs(d)));+ return mix(cA, cB, 1.0 - smoothstep(0.0, 1.5 / uZoom, abs(d)));}void main(void) {@@ -3185,7 +3185,7 @@ https://github.com/jquery/jquery/blob/master/src/event.js// look up the texel from the texture unit`).concat(s.map(function(u){return"if(vAtlasId == ".concat(u,") outColor = texture(uTexture").concat(u,", vTexCoord);")}).join(`else `),`- }+ }else if(vVertType == `).concat(Wz,`) {// mimics how canvas renderer uses context.globalCompositeOperation = 'destination-out';outColor = blend(vColor, uBGColor);@@ -3194,7 +3194,7 @@ https://github.com/jquery/jquery/blob/master/src/event.jselse if(vVertType == `).concat(t2,` && vBorderWidth == vec2(0.0)) { // simple rectangle with no borderoutColor = vColor; // unit square is already transformed to the rectangle, nothing else needs to be done}- else if(vVertType == `).concat(t2," || vVertType == ").concat(wC,`+ else if(vVertType == `).concat(t2," || vVertType == ").concat(wC,`|| vVertType == `).concat(q8," || vVertType == ").concat(xC,`) { // use SDFfloat outerBorder = vBorderWidth[0];@@ -3229,7 +3229,7 @@ https://github.com/jquery/jquery/blob/master/src/event.jsvec4 outerColor = outerBorder == 0.0 ? vec4(0) : vBorderColor;vec4 innerBorderColor = blend(vBorderColor, vColor);outColor = distInterp(innerBorderColor, outerColor, d);- }+ }else {vec4 outerColor;if(innerBorder == 0.0 && outerBorder == 0.0) {@@ -3267,7 +3267,7 @@ Expecting `+It.join(", ")+", got '"+(this.terminals_[st]||st)+"'":ft="Parse errooverflow: visible;vertical-align: -0.125em;}-+.node .label-icon path {fill: currentColor;stroke: revert;@@ -3527,7 +3527,7 @@ Expecting `+st.join(", ")+", got '"+(this.terminals_[Ae]||Ae)+"'":Oe="Parse erro${JSON.stringify(Object.fromEntries(g))}`));return}const y=parseInt(m);if(isNaN(y)){this.fireError(new Error(`Content-Length value must be a number. Got ${m}`));return}this.nextMessageLength=y}const p=this.buffer.tryReadBody(this.nextMessageLength);if(p===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{const g=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(p):p,m=await this.options.contentTypeDecoder.decode(g,this.options);this.callback(m)}).catch(g=>{this.fireError(g)})}}catch(p){this.fireError(p)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,e.default)().timer.setTimeout((f,p)=>{this.partialMessageTimer=void 0,f===this.messageToken&&(this.firePartialMessage({messageToken:f,waitingTime:p}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}},M(h,"ReadableStreamMessageReader"),h);t.ReadableStreamMessageReader=l}}),OZt=pn({"../../node_modules/.pnpm/[email protected]/node_modules/vscode-jsonrpc/lib/common/messageWriter.js"(t){var d,f;Object.defineProperty(t,"__esModule",{value:!0}),t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=void 0;var e=lv(),r=DA(),n=WIe(),i=_3(),s="Content-Length: ",a=`\r`,o;(function(p){function g(m){let y=m;return y&&r.func(y.dispose)&&r.func(y.onClose)&&r.func(y.onError)&&r.func(y.write)}M(g,"is"),p.is=g})(o||(t.MessageWriter=o={}));var l=(d=class{constructor(){this.errorEmitter=new i.Emitter,this.closeEmitter=new i.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(g,m,y){this.errorEmitter.fire([this.asError(g),m,y])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(g){return g instanceof Error?g:new Error(`Writer received error. Reason: ${r.string(g.message)?g.message:"unknown"}`)}},M(d,"AbstractMessageWriter"),d);t.AbstractMessageWriter=l;var u;(function(p){function g(m){return m===void 0||typeof m=="string"?{charset:m??"utf-8",contentTypeEncoder:(0,e.default)().applicationJson.encoder}:{charset:m.charset??"utf-8",contentEncoder:m.contentEncoder,contentTypeEncoder:m.contentTypeEncoder??(0,e.default)().applicationJson.encoder}}M(g,"fromOptions"),p.fromOptions=g})(u||(u={}));var h=(f=class extends l{constructor(g,m){super(),this.writable=g,this.options=u.fromOptions(m),this.errorCount=0,this.writeSemaphore=new n.Semaphore(1),this.writable.onError(y=>this.fireError(y)),this.writable.onClose(()=>this.fireClose())}async write(g){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(g,this.options).then(y=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(y):y).then(y=>{const v=[];return v.push(s,y.byteLength.toString(),a),v.push(a),this.doWrite(g,v,y)},y=>{throw this.fireError(y),y}))}async doWrite(g,m,y){try{return await this.writable.write(m.join(""),"ascii"),this.writable.write(y)}catch(v){return this.handleError(v,g),Promise.reject(v)}}handleError(g,m){this.errorCount++,this.fireError(g,m,this.errorCount)}end(){this.writable.end()}},M(f,"WriteableStreamMessageWriter"),f);t.WriteableStreamMessageWriter=h}}),PZt=pn({"../../node_modules/.pnpm/[email protected]/node_modules/vscode-jsonrpc/lib/common/messageBuffer.js"(t){var s;Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractMessageBuffer=void 0;var e=13,r=10,n=`\r`,i=(s=class{constructor(o="utf-8"){this._encoding=o,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(o){const l=typeof o=="string"?this.fromString(o,this._encoding):o;this._chunks.push(l),this._totalLength+=l.byteLength}tryReadHeaders(o=!1){if(this._chunks.length===0)return;let l=0,u=0,h=0,d=0;e:for(;u<this._chunks.length;){const m=this._chunks[u];for(h=0;h<m.length;){switch(m[h]){case e:switch(l){case 0:l=1;break;case 2:l=3;break;default:l=0}break;case r:switch(l){case 1:l=2;break;case 3:l=4,h++;break e;default:l=0}break;default:l=0}h++}d+=m.byteLength,u++}if(l!==4)return;const f=this._read(d+h),p=new Map,g=this.toString(f,"ascii").split(n);if(g.length<2)return p;for(let m=0;m<g.length-2;m++){const y=g[m],v=y.indexOf(":");if(v===-1)throw new Error(`Message header must separate key and value using ':'-${y}`);const x=y.substr(0,v),b=y.substr(v+1).trim();p.set(o?x.toLowerCase():x,b)}return p}tryReadBody(o){if(!(this._totalLength<o))return this._read(o)}get numberOfBytes(){return this._totalLength}_read(o){if(o===0)return this.emptyBuffer();if(o>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===o){const d=this._chunks[0];return this._chunks.shift(),this._totalLength-=o,this.asNative(d)}if(this._chunks[0].byteLength>o){const d=this._chunks[0],f=this.asNative(d,o);return this._chunks[0]=d.slice(o),this._totalLength-=o,f}const l=this.allocNative(o);let u=0,h=0;for(;o>0;){const d=this._chunks[h];if(d.byteLength>o){const f=d.slice(0,o);l.set(f,u),u+=o,this._chunks[h]=d.slice(o),this._totalLength-=o,o-=o}else l.set(d,u),u+=d.byteLength,this._chunks.shift(),this._totalLength-=d.byteLength,o-=d.byteLength}return l}},M(s,"AbstractMessageBuffer"),s);t.AbstractMessageBuffer=i}}),$Zt=pn({"../../node_modules/.pnpm/[email protected]/node_modules/vscode-jsonrpc/lib/common/connection.js"(t){var N,L;Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.ConnectionOptions=t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.RequestCancellationReceiverStrategy=t.IdCancellationReceiverStrategy=t.ConnectionStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=t.NullLogger=t.ProgressType=t.ProgressToken=void 0;var e=lv(),r=DA(),n=HIe(),i=GIe(),s=_3(),a=kO(),o;(function(I){I.type=new n.NotificationType("$/cancelRequest")})(o||(o={}));var l;(function(I){function $(O){return typeof O=="string"||typeof O=="number"}M($,"is"),I.is=$})(l||(t.ProgressToken=l={}));var u;(function(I){I.type=new n.NotificationType("$/progress")})(u||(u={}));var h=(N=class{constructor(){}},M(N,"ProgressType"),N);t.ProgressType=h;var d;(function(I){function $(O){return r.func(O)}M($,"is"),I.is=$})(d||(d={})),t.NullLogger=Object.freeze({error:M(()=>{},"error"),warn:M(()=>{},"warn"),info:M(()=>{},"info"),log:M(()=>{},"log")});var f;(function(I){I[I.Off=0]="Off",I[I.Messages=1]="Messages",I[I.Compact=2]="Compact",I[I.Verbose=3]="Verbose"})(f||(t.Trace=f={}));var p;(function(I){I.Off="off",I.Messages="messages",I.Compact="compact",I.Verbose="verbose"})(p||(t.TraceValues=p={})),(function(I){function $(D){if(!r.string(D))return I.Off;switch(D=D.toLowerCase(),D){case"off":return I.Off;case"messages":return I.Messages;case"compact":return I.Compact;case"verbose":return I.Verbose;default:return I.Off}}M($,"fromString"),I.fromString=$;function O(D){switch(D){case I.Off:return"off";case I.Messages:return"messages";case I.Compact:return"compact";case I.Verbose:return"verbose";default:return"off"}}M(O,"toString"),I.toString=O})(f||(t.Trace=f={}));var g;(function(I){I.Text="text",I.JSON="json"})(g||(t.TraceFormat=g={})),(function(I){function $(O){return r.string(O)?(O=O.toLowerCase(),O==="json"?I.JSON:I.Text):I.Text}M($,"fromString"),I.fromString=$})(g||(t.TraceFormat=g={}));var m;(function(I){I.type=new n.NotificationType("$/setTrace")})(m||(t.SetTraceNotification=m={}));var y;(function(I){I.type=new n.NotificationType("$/logTrace")})(y||(t.LogTraceNotification=y={}));var v;(function(I){I[I.Closed=1]="Closed",I[I.Disposed=2]="Disposed",I[I.AlreadyListening=3]="AlreadyListening"})(v||(t.ConnectionErrors=v={}));var x=(L=class extends Error{constructor($,O){super(O),this.code=$,Object.setPrototypeOf(this,L.prototype)}},M(L,"ConnectionError"),L);t.ConnectionError=x;var b;(function(I){function $(O){const D=O;return D&&r.func(D.cancelUndispatched)}M($,"is"),I.is=$})(b||(t.ConnectionStrategy=b={}));var T;(function(I){function $(O){const D=O;return D&&(D.kind===void 0||D.kind==="id")&&r.func(D.createCancellationTokenSource)&&(D.dispose===void 0||r.func(D.dispose))}M($,"is"),I.is=$})(T||(t.IdCancellationReceiverStrategy=T={}));var C;(function(I){function $(O){const D=O;return D&&D.kind==="request"&&r.func(D.createCancellationTokenSource)&&(D.dispose===void 0||r.func(D.dispose))}M($,"is"),I.is=$})(C||(t.RequestCancellationReceiverStrategy=C={}));var S;(function(I){I.Message=Object.freeze({createCancellationTokenSource(O){return new a.CancellationTokenSource}});function $(O){return T.is(O)||C.is(O)}M($,"is"),I.is=$})(S||(t.CancellationReceiverStrategy=S={}));var k;(function(I){I.Message=Object.freeze({sendCancellation(O,D){return O.sendNotification(o.type,{id:D})},cleanup(O){}});function $(O){const D=O;return D&&r.func(D.sendCancellation)&&r.func(D.cleanup)}M($,"is"),I.is=$})(k||(t.CancellationSenderStrategy=k={}));var E;(function(I){I.Message=Object.freeze({receiver:S.Message,sender:k.Message});function $(O){const D=O;return D&&S.is(D.receiver)&&k.is(D.sender)}M($,"is"),I.is=$})(E||(t.CancellationStrategy=E={}));var A;(function(I){function $(O){const D=O;return D&&r.func(D.handleMessage)}M($,"is"),I.is=$})(A||(t.MessageStrategy=A={}));var R;(function(I){function $(O){const D=O;return D&&(E.is(D.cancellationStrategy)||b.is(D.connectionStrategy)||A.is(D.messageStrategy))}M($,"is"),I.is=$})(R||(t.ConnectionOptions=R={}));var _;(function(I){I[I.New=1]="New",I[I.Listening=2]="Listening",I[I.Closed=3]="Closed",I[I.Disposed=4]="Disposed"})(_||(_={}));function P(I,$,O,D){const F=O!==void 0?O:t.NullLogger;let z=0,V=0,B=0;const H="2.0";let G;const W=new Map;let K;const q=new Map,oe=new Map;let Q,Z=new i.LinkedMap,re=new Map,ie=new Set,me=new Map,te=f.Off,_e=g.Text,$e,Fe=_.New;const ce=new s.Emitter,he=new s.Emitter,Te=new s.Emitter,ge=new s.Emitter,He=new s.Emitter,we=D&&D.cancellationStrategy?D.cancellationStrategy:E.Message;function Me(Ee){if(Ee===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+Ee.toString()}M(Me,"createRequestQueueKey");function Ye(Ee){return Ee===null?"res-unknown-"+(++B).toString():"res-"+Ee.toString()}M(Ye,"createResponseQueueKey");function le(){return"not-"+(++V).toString()}M(le,"createNotificationQueueKey");function pe(Ee,it){n.Message.isRequest(it)?Ee.set(Me(it.id),it):n.Message.isResponse(it)?Ee.set(Ye(it.id),it):Ee.set(le(),it)}M(pe,"addMessageToQueue");function Ce(Ee){}M(Ce,"cancelUndispatched");function ne(){return Fe===_.Listening}M(ne,"isListening");function Y(){return Fe===_.Closed}M(Y,"isClosed");function J(){return Fe===_.Disposed}M(J,"isDisposed");function ue(){(Fe===_.New||Fe===_.Listening)&&(Fe=_.Closed,he.fire(void 0))}M(ue,"closeHandler");function X(Ee){ce.fire([Ee,void 0,void 0])}M(X,"readErrorHandler");function fe(Ee){ce.fire(Ee)}M(fe,"writeErrorHandler"),I.onClose(ue),I.onError(X),$.onClose(ue),$.onError(fe);function ee(){Q||Z.size===0||(Q=(0,e.default)().timer.setImmediate(()=>{Q=void 0,Re()}))}M(ee,"triggerMessageQueue");function Ae(Ee){n.Message.isRequest(Ee)?Ne(Ee):n.Message.isNotification(Ee)?De(Ee):n.Message.isResponse(Ee)?qe(Ee):Ke(Ee)}M(Ae,"handleMessage");function Re(){if(Z.size===0)return;const Ee=Z.shift();try{const it=D==null?void 0:D.messageStrategy;A.is(it)?it.handleMessage(Ee,Ae):Ae(Ee)}finally{ee()}}M(Re,"processMessageQueue");const Xe=M(Ee=>{try{if(n.Message.isNotification(Ee)&&Ee.method===o.type.method){const it=Ee.params.id,gt=Me(it),xt=Z.get(gt);if(n.Message.isRequest(xt)){const $r=D==null?void 0:D.connectionStrategy,kr=$r&&$r.cancelUndispatched?$r.cancelUndispatched(xt,Ce):void 0;if(kr&&(kr.error!==void 0||kr.result!==void 0)){Z.delete(gt),me.delete(it),kr.id=xt.id,mt(kr,Ee.method,Date.now()),$.write(kr).catch(()=>F.error("Sending response for canceled message failed."));return}}const nr=me.get(it);if(nr!==void 0){nr.cancel(),St(Ee);return}else ie.add(it)}pe(Z,Ee)}finally{ee()}},"callback");function Ne(Ee){if(J())return;function it(Er,nn,Cr){const jr={jsonrpc:H,id:Ee.id};Er instanceof n.ResponseError?jr.error=Er.toJson():jr.result=Er===void 0?null:Er,mt(jr,nn,Cr),$.write(jr).catch(()=>F.error("Sending response failed."))}M(it,"reply");function gt(Er,nn,Cr){const jr={jsonrpc:H,id:Ee.id,error:Er.toJson()};mt(jr,nn,Cr),$.write(jr).catch(()=>F.error("Sending response failed."))}M(gt,"replyError");function xt(Er,nn,Cr){Er===void 0&&(Er=null);const jr={jsonrpc:H,id:Ee.id,result:Er};mt(jr,nn,Cr),$.write(jr).catch(()=>F.error("Sending response failed."))}M(xt,"replySuccess"),Le(Ee);const nr=W.get(Ee.method);let $r,kr;nr&&($r=nr.type,kr=nr.handler);const Ur=Date.now();if(kr||G){const Er=Ee.id??String(Date.now()),nn=T.is(we.receiver)?we.receiver.createCancellationTokenSource(Er):we.receiver.createCancellationTokenSource(Ee);Ee.id!==null&&ie.has(Ee.id)&&nn.cancel(),Ee.id!==null&&me.set(Er,nn);try{let Cr;if(kr)if(Ee.params===void 0){if($r!==void 0&&$r.numberOfParams!==0){gt(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${Ee.method} defines ${$r.numberOfParams} params but received none.`),Ee.method,Ur);return}Cr=kr(nn.token)}else if(Array.isArray(Ee.params)){if($r!==void 0&&$r.parameterStructures===n.ParameterStructures.byName){gt(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${Ee.method} defines parameters by name but received parameters by position`),Ee.method,Ur);return}Cr=kr(...Ee.params,nn.token)}else{if($r!==void 0&&$r.parameterStructures===n.ParameterStructures.byPosition){gt(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${Ee.method} defines parameters by position but received parameters by name`),Ee.method,Ur);return}Cr=kr(Ee.params,nn.token)}else G&&(Cr=G(Ee.method,Ee.params,nn.token));const jr=Cr;Cr?jr.then?jr.then(wn=>{me.delete(Er),it(wn,Ee.method,Ur)},wn=>{me.delete(Er),wn instanceof n.ResponseError?gt(wn,Ee.method,Ur):wn&&r.string(wn.message)?gt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Ee.method} failed with message: ${wn.message}`),Ee.method,Ur):gt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Ee.method} failed unexpectedly without providing any details.`),Ee.method,Ur)}):(me.delete(Er),it(Cr,Ee.method,Ur)):(me.delete(Er),xt(Cr,Ee.method,Ur))}catch(Cr){me.delete(Er),Cr instanceof n.ResponseError?it(Cr,Ee.method,Ur):Cr&&r.string(Cr.message)?gt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Ee.method} failed with message: ${Cr.message}`),Ee.method,Ur):gt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Ee.method} failed unexpectedly without providing any details.`),Ee.method,Ur)}}else gt(new n.ResponseError(n.ErrorCodes.MethodNotFound,`Unhandled method ${Ee.method}`),Ee.method,Ur)}M(Ne,"handleRequest");function qe(Ee){if(!J())if(Ee.id===null)Ee.error?F.error(`Received response message without id: Error is:+${y}`);const x=y.substr(0,v),b=y.substr(v+1).trim();p.set(o?x.toLowerCase():x,b)}return p}tryReadBody(o){if(!(this._totalLength<o))return this._read(o)}get numberOfBytes(){return this._totalLength}_read(o){if(o===0)return this.emptyBuffer();if(o>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===o){const d=this._chunks[0];return this._chunks.shift(),this._totalLength-=o,this.asNative(d)}if(this._chunks[0].byteLength>o){const d=this._chunks[0],f=this.asNative(d,o);return this._chunks[0]=d.slice(o),this._totalLength-=o,f}const l=this.allocNative(o);let u=0,h=0;for(;o>0;){const d=this._chunks[h];if(d.byteLength>o){const f=d.slice(0,o);l.set(f,u),u+=o,this._chunks[h]=d.slice(o),this._totalLength-=o,o-=o}else l.set(d,u),u+=d.byteLength,this._chunks.shift(),this._totalLength-=d.byteLength,o-=d.byteLength}return l}},M(s,"AbstractMessageBuffer"),s);t.AbstractMessageBuffer=i}}),$Zt=pn({"../../node_modules/.pnpm/[email protected]/node_modules/vscode-jsonrpc/lib/common/connection.js"(t){var N,L;Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.ConnectionOptions=t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.RequestCancellationReceiverStrategy=t.IdCancellationReceiverStrategy=t.ConnectionStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=t.NullLogger=t.ProgressType=t.ProgressToken=void 0;var e=lv(),r=DA(),n=HIe(),i=GIe(),s=_3(),a=kO(),o;(function(I){I.type=new n.NotificationType("$/cancelRequest")})(o||(o={}));var l;(function(I){function $(O){return typeof O=="string"||typeof O=="number"}M($,"is"),I.is=$})(l||(t.ProgressToken=l={}));var u;(function(I){I.type=new n.NotificationType("$/progress")})(u||(u={}));var h=(N=class{constructor(){}},M(N,"ProgressType"),N);t.ProgressType=h;var d;(function(I){function $(O){return r.func(O)}M($,"is"),I.is=$})(d||(d={})),t.NullLogger=Object.freeze({error:M(()=>{},"error"),warn:M(()=>{},"warn"),info:M(()=>{},"info"),log:M(()=>{},"log")});var f;(function(I){I[I.Off=0]="Off",I[I.Messages=1]="Messages",I[I.Compact=2]="Compact",I[I.Verbose=3]="Verbose"})(f||(t.Trace=f={}));var p;(function(I){I.Off="off",I.Messages="messages",I.Compact="compact",I.Verbose="verbose"})(p||(t.TraceValues=p={})),(function(I){function $(D){if(!r.string(D))return I.Off;switch(D=D.toLowerCase(),D){case"off":return I.Off;case"messages":return I.Messages;case"compact":return I.Compact;case"verbose":return I.Verbose;default:return I.Off}}M($,"fromString"),I.fromString=$;function O(D){switch(D){case I.Off:return"off";case I.Messages:return"messages";case I.Compact:return"compact";case I.Verbose:return"verbose";default:return"off"}}M(O,"toString"),I.toString=O})(f||(t.Trace=f={}));var g;(function(I){I.Text="text",I.JSON="json"})(g||(t.TraceFormat=g={})),(function(I){function $(O){return r.string(O)?(O=O.toLowerCase(),O==="json"?I.JSON:I.Text):I.Text}M($,"fromString"),I.fromString=$})(g||(t.TraceFormat=g={}));var m;(function(I){I.type=new n.NotificationType("$/setTrace")})(m||(t.SetTraceNotification=m={}));var y;(function(I){I.type=new n.NotificationType("$/logTrace")})(y||(t.LogTraceNotification=y={}));var v;(function(I){I[I.Closed=1]="Closed",I[I.Disposed=2]="Disposed",I[I.AlreadyListening=3]="AlreadyListening"})(v||(t.ConnectionErrors=v={}));var x=(L=class extends Error{constructor($,O){super(O),this.code=$,Object.setPrototypeOf(this,L.prototype)}},M(L,"ConnectionError"),L);t.ConnectionError=x;var b;(function(I){function $(O){const D=O;return D&&r.func(D.cancelUndispatched)}M($,"is"),I.is=$})(b||(t.ConnectionStrategy=b={}));var T;(function(I){function $(O){const D=O;return D&&(D.kind===void 0||D.kind==="id")&&r.func(D.createCancellationTokenSource)&&(D.dispose===void 0||r.func(D.dispose))}M($,"is"),I.is=$})(T||(t.IdCancellationReceiverStrategy=T={}));var C;(function(I){function $(O){const D=O;return D&&D.kind==="request"&&r.func(D.createCancellationTokenSource)&&(D.dispose===void 0||r.func(D.dispose))}M($,"is"),I.is=$})(C||(t.RequestCancellationReceiverStrategy=C={}));var S;(function(I){I.Message=Object.freeze({createCancellationTokenSource(O){return new a.CancellationTokenSource}});function $(O){return T.is(O)||C.is(O)}M($,"is"),I.is=$})(S||(t.CancellationReceiverStrategy=S={}));var k;(function(I){I.Message=Object.freeze({sendCancellation(O,D){return O.sendNotification(o.type,{id:D})},cleanup(O){}});function $(O){const D=O;return D&&r.func(D.sendCancellation)&&r.func(D.cleanup)}M($,"is"),I.is=$})(k||(t.CancellationSenderStrategy=k={}));var E;(function(I){I.Message=Object.freeze({receiver:S.Message,sender:k.Message});function $(O){const D=O;return D&&S.is(D.receiver)&&k.is(D.sender)}M($,"is"),I.is=$})(E||(t.CancellationStrategy=E={}));var A;(function(I){function $(O){const D=O;return D&&r.func(D.handleMessage)}M($,"is"),I.is=$})(A||(t.MessageStrategy=A={}));var R;(function(I){function $(O){const D=O;return D&&(E.is(D.cancellationStrategy)||b.is(D.connectionStrategy)||A.is(D.messageStrategy))}M($,"is"),I.is=$})(R||(t.ConnectionOptions=R={}));var _;(function(I){I[I.New=1]="New",I[I.Listening=2]="Listening",I[I.Closed=3]="Closed",I[I.Disposed=4]="Disposed"})(_||(_={}));function P(I,$,O,D){const F=O!==void 0?O:t.NullLogger;let z=0,V=0,B=0;const H="2.0";let G;const W=new Map;let K;const q=new Map,oe=new Map;let Q,Z=new i.LinkedMap,re=new Map,ie=new Set,me=new Map,te=f.Off,_e=g.Text,$e,Fe=_.New;const ce=new s.Emitter,he=new s.Emitter,Te=new s.Emitter,ge=new s.Emitter,He=new s.Emitter,we=D&&D.cancellationStrategy?D.cancellationStrategy:E.Message;function Me(Ee){if(Ee===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+Ee.toString()}M(Me,"createRequestQueueKey");function Ye(Ee){return Ee===null?"res-unknown-"+(++B).toString():"res-"+Ee.toString()}M(Ye,"createResponseQueueKey");function le(){return"not-"+(++V).toString()}M(le,"createNotificationQueueKey");function pe(Ee,it){n.Message.isRequest(it)?Ee.set(Me(it.id),it):n.Message.isResponse(it)?Ee.set(Ye(it.id),it):Ee.set(le(),it)}M(pe,"addMessageToQueue");function Ce(Ee){}M(Ce,"cancelUndispatched");function ne(){return Fe===_.Listening}M(ne,"isListening");function Y(){return Fe===_.Closed}M(Y,"isClosed");function J(){return Fe===_.Disposed}M(J,"isDisposed");function ue(){(Fe===_.New||Fe===_.Listening)&&(Fe=_.Closed,he.fire(void 0))}M(ue,"closeHandler");function X(Ee){ce.fire([Ee,void 0,void 0])}M(X,"readErrorHandler");function fe(Ee){ce.fire(Ee)}M(fe,"writeErrorHandler"),I.onClose(ue),I.onError(X),$.onClose(ue),$.onError(fe);function ee(){Q||Z.size===0||(Q=(0,e.default)().timer.setImmediate(()=>{Q=void 0,Re()}))}M(ee,"triggerMessageQueue");function Ae(Ee){n.Message.isRequest(Ee)?Ne(Ee):n.Message.isNotification(Ee)?De(Ee):n.Message.isResponse(Ee)?qe(Ee):Ke(Ee)}M(Ae,"handleMessage");function Re(){if(Z.size===0)return;const Ee=Z.shift();try{const it=D==null?void 0:D.messageStrategy;A.is(it)?it.handleMessage(Ee,Ae):Ae(Ee)}finally{ee()}}M(Re,"processMessageQueue");const Xe=M(Ee=>{try{if(n.Message.isNotification(Ee)&&Ee.method===o.type.method){const it=Ee.params.id,gt=Me(it),xt=Z.get(gt);if(n.Message.isRequest(xt)){const $r=D==null?void 0:D.connectionStrategy,kr=$r&&$r.cancelUndispatched?$r.cancelUndispatched(xt,Ce):void 0;if(kr&&(kr.error!==void 0||kr.result!==void 0)){Z.delete(gt),me.delete(it),kr.id=xt.id,mt(kr,Ee.method,Date.now()),$.write(kr).catch(()=>F.error("Sending response for canceled message failed."));return}}const nr=me.get(it);if(nr!==void 0){nr.cancel(),St(Ee);return}else ie.add(it)}pe(Z,Ee)}finally{ee()}},"callback");function Ne(Ee){if(J())return;function it(Er,nn,Cr){const jr={jsonrpc:H,id:Ee.id};Er instanceof n.ResponseError?jr.error=Er.toJson():jr.result=Er===void 0?null:Er,mt(jr,nn,Cr),$.write(jr).catch(()=>F.error("Sending response failed."))}M(it,"reply");function gt(Er,nn,Cr){const jr={jsonrpc:H,id:Ee.id,error:Er.toJson()};mt(jr,nn,Cr),$.write(jr).catch(()=>F.error("Sending response failed."))}M(gt,"replyError");function xt(Er,nn,Cr){Er===void 0&&(Er=null);const jr={jsonrpc:H,id:Ee.id,result:Er};mt(jr,nn,Cr),$.write(jr).catch(()=>F.error("Sending response failed."))}M(xt,"replySuccess"),Le(Ee);const nr=W.get(Ee.method);let $r,kr;nr&&($r=nr.type,kr=nr.handler);const Ur=Date.now();if(kr||G){const Er=Ee.id??String(Date.now()),nn=T.is(we.receiver)?we.receiver.createCancellationTokenSource(Er):we.receiver.createCancellationTokenSource(Ee);Ee.id!==null&&ie.has(Ee.id)&&nn.cancel(),Ee.id!==null&&me.set(Er,nn);try{let Cr;if(kr)if(Ee.params===void 0){if($r!==void 0&&$r.numberOfParams!==0){gt(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${Ee.method} defines ${$r.numberOfParams} params but received none.`),Ee.method,Ur);return}Cr=kr(nn.token)}else if(Array.isArray(Ee.params)){if($r!==void 0&&$r.parameterStructures===n.ParameterStructures.byName){gt(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${Ee.method} defines parameters by name but received parameters by position`),Ee.method,Ur);return}Cr=kr(...Ee.params,nn.token)}else{if($r!==void 0&&$r.parameterStructures===n.ParameterStructures.byPosition){gt(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${Ee.method} defines parameters by position but received parameters by name`),Ee.method,Ur);return}Cr=kr(Ee.params,nn.token)}else G&&(Cr=G(Ee.method,Ee.params,nn.token));const jr=Cr;Cr?jr.then?jr.then(wn=>{me.delete(Er),it(wn,Ee.method,Ur)},wn=>{me.delete(Er),wn instanceof n.ResponseError?gt(wn,Ee.method,Ur):wn&&r.string(wn.message)?gt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Ee.method} failed with message: ${wn.message}`),Ee.method,Ur):gt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Ee.method} failed unexpectedly without providing any details.`),Ee.method,Ur)}):(me.delete(Er),it(Cr,Ee.method,Ur)):(me.delete(Er),xt(Cr,Ee.method,Ur))}catch(Cr){me.delete(Er),Cr instanceof n.ResponseError?it(Cr,Ee.method,Ur):Cr&&r.string(Cr.message)?gt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Ee.method} failed with message: ${Cr.message}`),Ee.method,Ur):gt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Ee.method} failed unexpectedly without providing any details.`),Ee.method,Ur)}}else gt(new n.ResponseError(n.ErrorCodes.MethodNotFound,`Unhandled method ${Ee.method}`),Ee.method,Ur)}M(Ne,"handleRequest");function qe(Ee){if(!J())if(Ee.id===null)Ee.error?F.error(`Received response message without id: Error is:${JSON.stringify(Ee.error,void 0,4)}`):F.error("Received response message without id. No further error information provided.");else{const it=Ee.id,gt=re.get(it);if(At(Ee,gt),gt!==void 0){re.delete(it);try{if(Ee.error){const xt=Ee.error;gt.reject(new n.ResponseError(xt.code,xt.message,xt.data))}else if(Ee.result!==void 0)gt.resolve(Ee.result);else throw new Error("Should never happen.")}catch(xt){xt.message?F.error(`Response handler '${gt.method}' failed with message: ${xt.message}`):F.error(`Response handler '${gt.method}' failed unexpectedly.`)}}}}M(qe,"handleResponse");function De(Ee){if(J())return;let it,gt;if(Ee.method===o.type.method){const xt=Ee.params.id;ie.delete(xt),St(Ee);return}else{const xt=q.get(Ee.method);xt&&(gt=xt.handler,it=xt.type)}if(gt||K)try{if(St(Ee),gt)if(Ee.params===void 0)it!==void 0&&it.numberOfParams!==0&&it.parameterStructures!==n.ParameterStructures.byName&&F.error(`Notification ${Ee.method} defines ${it.numberOfParams} params but received none.`),gt();else if(Array.isArray(Ee.params)){const xt=Ee.params;Ee.method===u.type.method&&xt.length===2&&l.is(xt[0])?gt({token:xt[0],value:xt[1]}):(it!==void 0&&(it.parameterStructures===n.ParameterStructures.byName&&F.error(`Notification ${Ee.method} defines parameters by name but received parameters by position`),it.numberOfParams!==Ee.params.length&&F.error(`Notification ${Ee.method} defines ${it.numberOfParams} params but received ${xt.length} arguments`)),gt(...xt))}else it!==void 0&&it.parameterStructures===n.ParameterStructures.byPosition&&F.error(`Notification ${Ee.method} defines parameters by position but received parameters by name`),gt(Ee.params);else K&&K(Ee.method,Ee.params)}catch(xt){xt.message?F.error(`Notification handler '${Ee.method}' failed with message: ${xt.message}`):F.error(`Notification handler '${Ee.method}' failed unexpectedly.`)}else Te.fire(Ee)}M(De,"handleNotification");function Ke(Ee){if(!Ee){F.error("Received empty message.");return}F.error(`Received message which is neither a response nor a notification message:${JSON.stringify(Ee,null,4)}`);const it=Ee;if(r.string(it.id)||r.number(it.id)){const gt=it.id,xt=re.get(gt);xt&&xt.reject(new Error("The received response has neither a result nor an error property."))}}M(Ke,"handleInvalidMessage");function ze(Ee){if(Ee!=null)switch(te){case f.Verbose:return JSON.stringify(Ee,null,4);case f.Compact:return JSON.stringify(Ee);default:return}}M(ze,"stringifyTrace");function st(Ee){if(!(te===f.Off||!$e))if(_e===g.Text){let it;(te===f.Verbose||te===f.Compact)&&Ee.params&&(it=`Params: ${ze(Ee.params)}@@ -3593,7 +3593,7 @@ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.`,type:Ps.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}M(lBe,"performRuntimeChecks");function cBe(t,e,r){const n=[];let i=!1;const s=YA(Ch(Ta(t.modes))),a=eP(s,l=>l[Fy]===Rl.NA),o=ire(r);return e&&tn(a,l=>{const u=nre(l,o);if(u!==!1){const d={message:dBe(l,u),type:u.issue,tokenType:l};n.push(d)}else Yr(l,"LINE_BREAKS")?l.LINE_BREAKS===!0&&(i=!0):rP(o,l.PATTERN)&&(i=!0)}),e&&!i&&n.push({message:`Warning: No LINE_BREAKS Found.This Lexer has been defined to track line and column information,But none of the Token Types can be identified as matching a line terminator.- See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS+ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKSfor details.`,type:Ps.NO_LINE_BREAKS_FLAGS}),n}M(cBe,"performWarningRuntimeChecks");function uBe(t){const e={},r=qc(t);return tn(r,n=>{const i=t[n];if(Qn(i))e[n]=[];else throw Error("non exhaustive match")}),e}M(uBe,"cloneEmptyGroups");function rre(t){const e=t.PATTERN;if(L0(e))return!1;if(ep(e))return!0;if(Yr(e,"exec"))return!0;if(yc(e))return!1;throw Error("non exhaustive match")}M(rre,"isCustomPattern");function hBe(t){return yc(t)&&t.length===1?t.charCodeAt(0):!1}M(hBe,"isShortPattern");var $ir={test:M(function(t){const e=t.length;for(let r=this.lastIndex;r<e;r++){const n=t.charCodeAt(r);if(n===10)return this.lastIndex=r+1,!0;if(n===13)return t.charCodeAt(r+1)===10?this.lastIndex=r+2:this.lastIndex=r+1,!0}return!1},"test"),lastIndex:0};function nre(t,e){if(Yr(t,"LINE_BREAKS"))return!1;if(L0(t.PATTERN)){try{rP(e,t.PATTERN)}catch(r){return{issue:Ps.IDENTIFY_TERMINATOR,errMsg:r.message}}return!1}else{if(yc(t.PATTERN))return!1;if(rre(t))return{issue:Ps.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}M(nre,"checkLineBreaksIssues");function dBe(t,e){if(e.issue===Ps.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.The problem is in the <${t.name}> Token TypeRoot cause: ${e.errMsg}.@@ -3616,8 +3616,8 @@ ${Lr(u,(f,p)=>` ${p+1}. ${f}`).join(`but found: '`+Lh(e).image+"'";if(r)return i+r+a;{const l=`expecting at least one iteration which starts with one of these possible Token sequences::<${Lr(t,u=>`[${Lr(u,h=>iy(h)).join(",")}]`).join(" ,")}>`;return i+l+a}}};Object.freeze(pb);var Fir={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<-inside top level rule: ->`+t.name+"<-"}},W1={buildDuplicateFoundError(t,e){function r(h){return h instanceof Zi?h.terminalType.name:h instanceof Ol?h.nonTerminalName:""}M(r,"getExtraProductionArgument");const n=t.name,i=Lh(e),s=i.idx,a=ah(i),o=r(i),l=s>0;let u=`->${a}${l?s:""}<- ${o?`with argument: ->${o}<-`:""}- appears more than once (${e.length} times) in the top level rule: ->${n}<-.- For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES+ appears more than once (${e.length} times) in the top level rule: ->${n}<-.+ For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES`;return u=u.replace(/[ \t]+/g," "),u=u.replace(/\s\s+/g,``),u},buildNamespaceConflictError(t){return`Namespace conflict found in grammar.The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${t.name}>.@@ -3638,7 +3638,7 @@ Only the last alternative may be an empty alternative.`},buildTooManyAlternative<OR${t.alternation.idx}> inside <${t.topLevelRule.name}> Rule.has ${t.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(t){const e=t.topLevelRule.name,r=Lr(t.leftRecursionPath,s=>s.name),n=`${e} --> ${r.concat([e]).join(" --> ")}`;return`Left Recursion found in grammar.rule: <${e}> can be invoked from itself (directly or indirectly)-without consuming any Tokens. The grammar path that causes this is:+without consuming any Tokens. The grammar path that causes this is:${n}To fix this refactor your grammar to remove the left recursion.see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return"deprecated"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof N3?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function CBe(t,e){const r=new zir(t,e);return r.resolveRefs(),r.errors}M(CBe,"resolveGrammar");var Bx,zir=(Bx=class extends D3{constructor(e,r){super(),this.nameToTopRule=e,this.errMsgProvider=r,this.errors=[]}resolveRefs(){tn(Ta(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const r=this.nameToTopRule[e.nonTerminalName];if(r)e.referencedRule=r;else{const n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:n,type:Pl.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}},M(Bx,"GastRefResolverVisitor"),Bx),Fx,Vir=(Fx=class extends tP{constructor(e,r){super(),this.topProd=e,this.path=r,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=Mo(this.path.ruleStack).reverse(),this.occurrenceStack=Mo(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,r=[]){this.found||super.walk(e,r)}walkProdRef(e,r,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const i=r.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){Fi(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},M(Fx,"AbstractNextPossibleTokensWalker"),Fx),zx,Hir=(zx=class extends Vir{constructor(e,r){super(e,r),this.path=r,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,r,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const i=r.concat(n),s=new vc({definition:i});this.possibleTokTypes=O3(s),this.found=!0}}},M(zx,"NextAfterTokenWalker"),zx),Vx,nP=(Vx=class extends tP{constructor(e,r){super(),this.topRule=e,this.occurrence=r,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}},M(Vx,"AbstractNextTerminalAfterProductionWalker"),Vx),Hx,Gir=(Hx=class extends nP{walkMany(e,r,n){if(e.idx===this.occurrence){const i=Lh(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Zi&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,r,n)}},M(Hx,"NextTerminalAfterManyWalker"),Hx),Gx,lme=(Gx=class extends nP{walkManySep(e,r,n){if(e.idx===this.occurrence){const i=Lh(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Zi&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,r,n)}},M(Gx,"NextTerminalAfterManySepWalker"),Gx),Wx,Wir=(Wx=class extends nP{walkAtLeastOne(e,r,n){if(e.idx===this.occurrence){const i=Lh(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Zi&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,r,n)}},M(Wx,"NextTerminalAfterAtLeastOneWalker"),Wx),qx,cme=(qx=class extends nP{walkAtLeastOneSep(e,r,n){if(e.idx===this.occurrence){const i=Lh(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Zi&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,r,n)}},M(qx,"NextTerminalAfterAtLeastOneSepWalker"),qx);function AI(t,e,r=[]){r=Mo(r);let n=[],i=0;function s(o){return o.concat(mo(t,i+1))}M(s,"remainingPathWith");function a(o){const l=AI(s(o),e,r);return n.concat(l)}for(M(a,"getAlternativesForProd");r.length<e&&i<t.length;){const o=t[i];if(o instanceof vc)return a(o.definition);if(o instanceof Ol)return a(o.definition);if(o instanceof Ao)n=a(o.definition);else if(o instanceof Qc){const l=o.definition.concat([new Os({definition:o.definition})]);return a(l)}else if(o instanceof Jc){const l=[new vc({definition:o.definition}),new Os({definition:[new Zi({terminalType:o.separator})].concat(o.definition)})];return a(l)}else if(o instanceof Tc){const l=o.definition.concat([new Os({definition:[new Zi({terminalType:o.separator})].concat(o.definition)})]);n=a(l)}else if(o instanceof Os){const l=o.definition.concat([new Os({definition:o.definition})]);n=a(l)}else{if(o instanceof Cc)return tn(o.definition,l=>{Fi(l.definition)===!1&&(n=a(l.definition))}),n;if(o instanceof Zi)r.push(o.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:r,suffixDef:mo(t,i)}),n}M(AI,"possiblePathsFrom");function cre(t,e,r,n){const i="EXIT_NONE_TERMINAL",s=[i],a="EXIT_ALTERNATIVE";let o=!1;const l=e.length,u=l-n-1,h=[],d=[];for(d.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!Fi(d);){const f=d.pop();if(f===a){o&&By(d).idx<=u&&d.pop();continue}const p=f.def,g=f.idx,m=f.ruleStack,y=f.occurrenceStack;if(Fi(p))continue;const v=p[0];if(v===i){const x={idx:g,def:mo(p),ruleStack:l6(m),occurrenceStack:l6(y)};d.push(x)}else if(v instanceof Zi)if(g<l-1){const x=g+1,b=e[x];if(r(b,v.terminalType)){const T={idx:x,def:mo(p),ruleStack:m,occurrenceStack:y};d.push(T)}}else if(g===l-1)h.push({nextTokenType:v.terminalType,nextTokenOccurrence:v.idx,ruleStack:m,occurrenceStack:y}),o=!0;else throw Error("non exhaustive match");else if(v instanceof Ol){const x=Mo(m);x.push(v.nonTerminalName);const b=Mo(y);b.push(v.idx);const T={idx:g,def:v.definition.concat(s,mo(p)),ruleStack:x,occurrenceStack:b};d.push(T)}else if(v instanceof Ao){const x={idx:g,def:mo(p),ruleStack:m,occurrenceStack:y};d.push(x),d.push(a);const b={idx:g,def:v.definition.concat(mo(p)),ruleStack:m,occurrenceStack:y};d.push(b)}else if(v instanceof Qc){const x=new Os({definition:v.definition,idx:v.idx}),b=v.definition.concat([x],mo(p)),T={idx:g,def:b,ruleStack:m,occurrenceStack:y};d.push(T)}else if(v instanceof Jc){const x=new Zi({terminalType:v.separator}),b=new Os({definition:[x].concat(v.definition),idx:v.idx}),T=v.definition.concat([b],mo(p)),C={idx:g,def:T,ruleStack:m,occurrenceStack:y};d.push(C)}else if(v instanceof Tc){const x={idx:g,def:mo(p),ruleStack:m,occurrenceStack:y};d.push(x),d.push(a);const b=new Zi({terminalType:v.separator}),T=new Os({definition:[b].concat(v.definition),idx:v.idx}),C=v.definition.concat([T],mo(p)),S={idx:g,def:C,ruleStack:m,occurrenceStack:y};d.push(S)}else if(v instanceof Os){const x={idx:g,def:mo(p),ruleStack:m,occurrenceStack:y};d.push(x),d.push(a);const b=new Os({definition:v.definition,idx:v.idx}),T=v.definition.concat([b],mo(p)),C={idx:g,def:T,ruleStack:m,occurrenceStack:y};d.push(C)}else if(v instanceof Cc)for(let x=v.definition.length-1;x>=0;x--){const b=v.definition[x],T={idx:g,def:b.definition.concat(mo(p)),ruleStack:m,occurrenceStack:y};d.push(T),d.push(a)}else if(v instanceof vc)d.push({idx:g,def:v.definition.concat(mo(p)),ruleStack:m,occurrenceStack:y});else if(v instanceof N3)d.push(kBe(v,g,m,y));else throw Error("non exhaustive match")}return h}M(cre,"nextPossibleTokensAfter");function kBe(t,e,r,n){const i=Mo(r);i.push(t.name);const s=Mo(n);return s.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:s}}M(kBe,"expandTopLevelRule");var ws;(function(t){t[t.OPTION=0]="OPTION",t[t.REPETITION=1]="REPETITION",t[t.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",t[t.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",t[t.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",t[t.ALTERNATION=5]="ALTERNATION"})(ws||(ws={}));function iP(t){if(t instanceof Ao||t==="Option")return ws.OPTION;if(t instanceof Os||t==="Repetition")return ws.REPETITION;if(t instanceof Qc||t==="RepetitionMandatory")return ws.REPETITION_MANDATORY;if(t instanceof Jc||t==="RepetitionMandatoryWithSeparator")return ws.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof Tc||t==="RepetitionWithSeparator")return ws.REPETITION_WITH_SEPARATOR;if(t instanceof Cc||t==="Alternation")return ws.ALTERNATION;throw Error("non exhaustive match")}M(iP,"getProdType");function wj(t){const{occurrence:e,rule:r,prodType:n,maxLookahead:i}=t,s=iP(n);return s===ws.ALTERNATION?ZA(e,r,i):QA(e,r,s,i)}M(wj,"getLookaheadPaths");function SBe(t,e,r,n,i,s){const a=ZA(t,e,r),o=hre(a)?u6:P3;return s(a,n,o,i)}M(SBe,"buildLookaheadFuncForOr");function EBe(t,e,r,n,i,s){const a=QA(t,e,i,r),o=hre(a)?u6:P3;return s(a[0],o,n)}M(EBe,"buildLookaheadFuncForOptionalProd");function ABe(t,e,r,n){const i=t.length,s=kh(t,a=>kh(a,o=>o.length===1));if(e)return function(a){const o=Lr(a,l=>l.GATE);for(let l=0;l<i;l++){const u=t[l],h=u.length,d=o[l];if(!(d!==void 0&&d.call(this)===!1))e:for(let f=0;f<h;f++){const p=u[f],g=p.length;for(let m=0;m<g;m++){const y=this.LA(m+1);if(r(y,p[m])===!1)continue e}return l}}};if(s&&!n){const a=Lr(t,l=>Ch(l)),o=jc(a,(l,u,h)=>(tn(u,d=>{Yr(l,d.tokenTypeIdx)||(l[d.tokenTypeIdx]=h),tn(d.categoryMatches,f=>{Yr(l,f)||(l[f]=h)})}),l),{});return function(){const l=this.LA(1);return o[l.tokenTypeIdx]}}else return function(){for(let a=0;a<i;a++){const o=t[a],l=o.length;e:for(let u=0;u<l;u++){const h=o[u],d=h.length;for(let f=0;f<d;f++){const p=this.LA(f+1);if(r(p,h[f])===!1)continue e}return a}}}}M(ABe,"buildAlternativesLookAheadFunc");function MBe(t,e,r){const n=kh(t,s=>s.length===1),i=t.length;if(n&&!r){const s=Ch(t);if(s.length===1&&Fi(s[0].categoryMatches)){const o=s[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===o}}else{const a=jc(s,(o,l,u)=>(o[l.tokenTypeIdx]=!0,tn(l.categoryMatches,h=>{o[h]=!0}),o),[]);return function(){const o=this.LA(1);return a[o.tokenTypeIdx]===!0}}}else return function(){e:for(let s=0;s<i;s++){const a=t[s],o=a.length;for(let l=0;l<o;l++){const u=this.LA(l+1);if(e(u,a[l])===!1)continue e}return!0}return!1}}M(MBe,"buildSingleAlternativeLookaheadFunction");var Ux,qir=(Ux=class extends tP{constructor(e,r,n){super(),this.topProd=e,this.targetOccurrence=r,this.targetProdType=n}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(e,r,n,i){return e.idx===this.targetOccurrence&&this.targetProdType===r?(this.restDef=n.concat(i),!0):!1}walkOption(e,r,n){this.checkIsTarget(e,ws.OPTION,r,n)||super.walkOption(e,r,n)}walkAtLeastOne(e,r,n){this.checkIsTarget(e,ws.REPETITION_MANDATORY,r,n)||super.walkOption(e,r,n)}walkAtLeastOneSep(e,r,n){this.checkIsTarget(e,ws.REPETITION_MANDATORY_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}walkMany(e,r,n){this.checkIsTarget(e,ws.REPETITION,r,n)||super.walkOption(e,r,n)}walkManySep(e,r,n){this.checkIsTarget(e,ws.REPETITION_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}},M(Ux,"RestDefinitionFinderWalker"),Ux),jx,RBe=(jx=class extends D3{constructor(e,r,n){super(),this.targetOccurrence=e,this.targetProdType=r,this.targetRef=n,this.result=[]}checkIsTarget(e,r){e.idx===this.targetOccurrence&&this.targetProdType===r&&(this.targetRef===void 0||e===this.targetRef)&&(this.result=e.definition)}visitOption(e){this.checkIsTarget(e,ws.OPTION)}visitRepetition(e){this.checkIsTarget(e,ws.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,ws.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,ws.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,ws.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,ws.ALTERNATION)}},M(jx,"InsideDefinitionFinderVisitor"),jx);function Tj(t){const e=new Array(t);for(let r=0;r<t;r++)e[r]=[];return e}M(Tj,"initializeArrayOfArrays");function LR(t){let e=[""];for(let r=0;r<t.length;r++){const n=t[r],i=[];for(let s=0;s<e.length;s++){const a=e[s];i.push(a+"_"+n.tokenTypeIdx);for(let o=0;o<n.categoryMatches.length;o++){const l="_"+n.categoryMatches[o];i.push(a+l)}}e=i}return e}M(LR,"pathToHashKeys");function _Be(t,e,r){for(let n=0;n<t.length;n++){if(n===r)continue;const i=t[n];for(let s=0;s<e.length;s++){const a=e[s];if(i[a]===!0)return!1}}return!0}M(_Be,"isUniquePrefixHash");function ure(t,e){const r=Lr(t,a=>AI([a],1)),n=Tj(r.length),i=Lr(r,a=>{const o={};return tn(a,l=>{const u=LR(l.partialPath);tn(u,h=>{o[h]=!0})}),o});let s=r;for(let a=1;a<=e;a++){const o=s;s=Tj(o.length);for(let l=0;l<o.length;l++){const u=o[l];for(let h=0;h<u.length;h++){const d=u[h].partialPath,f=u[h].suffixDef,p=LR(d);if(_Be(i,p,l)||Fi(f)||d.length===e){const m=n[l];if(MI(m,d)===!1){m.push(d);for(let y=0;y<p.length;y++){const v=p[y];i[l][v]=!0}}}else{const m=AI(f,a+1,d);s[l]=s[l].concat(m),tn(m,y=>{const v=LR(y.partialPath);tn(v,x=>{i[l][x]=!0})})}}}}return n}M(ure,"lookAheadSequenceFromAlternatives");function ZA(t,e,r,n){const i=new RBe(t,ws.ALTERNATION,n);return e.accept(i),ure(i.result,r)}M(ZA,"getLookaheadPathsForOr");function QA(t,e,r,n){const i=new RBe(t,r);e.accept(i);const s=i.result,o=new qir(e,t,r).startWalking(),l=new vc({definition:s}),u=new vc({definition:o});return ure([l,u],n)}M(QA,"getLookaheadPathsForOptionalProd");function MI(t,e){e:for(let r=0;r<t.length;r++){const n=t[r];if(n.length===e.length){for(let i=0;i<n.length;i++){const s=e[i],a=n[i];if((s===a||a.categoryMatchesMap[s.tokenTypeIdx]!==void 0)===!1)continue e}return!0}}return!1}M(MI,"containsPath");function LBe(t,e){return t.length<e.length&&kh(t,(r,n)=>{const i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}M(LBe,"isStrictPrefixOfPath");function hre(t){return kh(t,e=>kh(e,r=>kh(r,n=>Fi(n.categoryMatches))))}M(hre,"areTokenCategoriesNotUsed");function IBe(t){const e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return Lr(e,r=>Object.assign({type:Pl.CUSTOM_LOOKAHEAD_VALIDATION},r))}M(IBe,"validateLookahead");function NBe(t,e,r,n){const i=Au(t,l=>DBe(l,r)),s=WBe(t,e,r),a=Au(t,l=>zBe(l,r)),o=Au(t,l=>PBe(l,t,n,r));return i.concat(s,a,o)}M(NBe,"validateGrammar");function DBe(t,e){const r=new Uir;t.accept(r);const n=r.allProductions,i=air(n,OBe),s=$h(i,o=>o.length>1);return Lr(Ta(s),o=>{const l=Lh(o),u=e.buildDuplicateFoundError(t,o),h=ah(l),d={message:u,type:Pl.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:h,occurrence:l.idx},f=dre(l);return f&&(d.parameter=f),d})}M(DBe,"validateDuplicateProductions");function OBe(t){return`${ah(t)}_#_${t.idx}_#_${dre(t)}`}M(OBe,"identifyProductionForDuplicates");function dre(t){return t instanceof Zi?t.terminalType.name:t instanceof Ol?t.nonTerminalName:""}M(dre,"getExtraProductionArgument");var Yx,Uir=(Yx=class extends D3{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}},M(Yx,"OccurrenceValidationCollector"),Yx);function PBe(t,e,r,n){const i=[];if(jc(e,(a,o)=>o.name===t.name?a+1:a,0)>1){const a=n.buildDuplicateRuleNameError({topLevelRule:t,grammarName:r});i.push({message:a,type:Pl.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}M(PBe,"validateRuleDoesNotAlreadyExist");function $Be(t,e,r){const n=[];let i;return Wl(e,t)||(i=`Invalid rule override, rule: ->${t}<- cannot be overridden in the grammar: ->${r}<-as it is not defined in any of the super grammars `,n.push({message:i,type:Pl.INVALID_RULE_OVERRIDE,ruleName:t})),n}M($Be,"validateRuleIsOverridden");function fre(t,e,r,n=[]){const i=[],s=SS(e.definition);if(Fi(s))return[];{const a=t.name;Wl(s,t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:Pl.LEFT_RECURSION,ruleName:a});const l=JO(s,n.concat([t])),u=Au(l,h=>{const d=Mo(n);return d.push(h),fre(t,h,r,d)});return i.concat(u)}}M(fre,"validateNoLeftRecursion");function SS(t){let e=[];if(Fi(t))return e;const r=Lh(t);if(r instanceof Ol)e.push(r.referencedRule);else if(r instanceof vc||r instanceof Ao||r instanceof Qc||r instanceof Jc||r instanceof Tc||r instanceof Os)e=e.concat(SS(r.definition));else if(r instanceof Cc)e=Ch(Lr(r.definition,s=>SS(s.definition)));else if(!(r instanceof Zi))throw Error("non exhaustive match");const n=c6(r),i=t.length>1;if(n&&i){const s=mo(t);return e.concat(SS(s))}else return e}M(SS,"getFirstNoneTerminal");var Xx,pre=(Xx=class extends D3{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}},M(Xx,"OrCollector"),Xx);function BBe(t,e){const r=new pre;t.accept(r);const n=r.alternations;return Au(n,s=>{const a=l6(s.definition);return Au(a,(o,l)=>{const u=cre([o],[],P3,1);return Fi(u)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:s,emptyChoiceIdx:l}),type:Pl.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:s.idx,alternative:l+1}]:[]})})}M(BBe,"validateEmptyOrAlternative");function FBe(t,e,r){const n=new pre;t.accept(n);let i=n.alternations;return i=eP(i,a=>a.ignoreAmbiguities===!0),Au(i,a=>{const o=a.idx,l=a.maxLookahead||e,u=ZA(o,t,l,a),h=HBe(u,a,t,r),d=GBe(u,a,t,r);return h.concat(d)})}M(FBe,"validateAmbiguousAlternationAlternatives");var Kx,jir=(Kx=class extends D3{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}},M(Kx,"RepetitionCollector"),Kx);function zBe(t,e){const r=new pre;t.accept(r);const n=r.alternations;return Au(n,s=>s.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:s}),type:Pl.TOO_MANY_ALTS,ruleName:t.name,occurrence:s.idx}]:[])}M(zBe,"validateTooManyAlts");function VBe(t,e,r){const n=[];return tn(t,i=>{const s=new jir;i.accept(s);const a=s.allProductions;tn(a,o=>{const l=iP(o),u=o.maxLookahead||e,h=o.idx,f=QA(h,i,l,u)[0];if(Fi(Ch(f))){const p=r.buildEmptyRepetitionError({topLevelRule:i,repetition:o});n.push({message:p,type:Pl.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}M(VBe,"validateSomeNonEmptyLookaheadPath");function HBe(t,e,r,n){const i=[],s=jc(t,(o,l,u)=>(e.definition[u].ignoreAmbiguities===!0||tn(l,h=>{const d=[u];tn(t,(f,p)=>{u!==p&&MI(f,h)&&e.definition[p].ignoreAmbiguities!==!0&&d.push(p)}),d.length>1&&!MI(i,h)&&(i.push(h),o.push({alts:d,path:h}))}),o),[]);return Lr(s,o=>{const l=Lr(o.alts,h=>h+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:l,prefixPath:o.path}),type:Pl.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:o.alts}})}M(HBe,"checkAlternativesAmbiguities");function GBe(t,e,r,n){const i=jc(t,(a,o,l)=>{const u=Lr(o,h=>({idx:l,path:h}));return a.concat(u)},[]);return YA(Au(i,a=>{if(e.definition[a.idx].ignoreAmbiguities===!0)return[];const l=a.idx,u=a.path,h=Fu(i,f=>e.definition[f.idx].ignoreAmbiguities!==!0&&f.idx<l&&LBe(f.path,u));return Lr(h,f=>{const p=[f.idx+1,l+1],g=e.idx===0?"":e.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:p,prefixPath:f.path}),type:Pl.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:g,alternatives:p}})}))}M(GBe,"checkPrefixAlternativesAmbiguities");function WBe(t,e,r){const n=[],i=Lr(e,s=>s.name);return tn(t,s=>{const a=s.name;if(Wl(i,a)){const o=r.buildNamespaceConflictError(s);n.push({message:o,type:Pl.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:a})}}),n}M(WBe,"checkTerminalAndNoneTerminalsNameSpace");function qBe(t){const e=Zte(t,{errMsgProvider:Fir}),r={};return tn(t.rules,n=>{r[n.name]=n}),CBe(r,e.errMsgProvider)}M(qBe,"resolveGrammar");function UBe(t){return t=Zte(t,{errMsgProvider:W1}),NBe(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}M(UBe,"validateGrammar");var jBe="MismatchedTokenException",YBe="NoViableAltException",XBe="EarlyExitException",KBe="NotAllInputParsedException",ZBe=[jBe,YBe,XBe,KBe];Object.freeze(ZBe);function h6(t){return Wl(ZBe,t.name)}M(h6,"isRecognitionException");var Zx,sP=(Zx=class extends Error{constructor(e,r){super(e),this.token=r,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},M(Zx,"RecognitionException"),Zx),Qx,QBe=(Qx=class extends sP{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=jBe}},M(Qx,"MismatchedTokenException"),Qx),Jx,Yir=(Jx=class extends sP{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=YBe}},M(Jx,"NoViableAltException"),Jx),ew,Xir=(ew=class extends sP{constructor(e,r){super(e,r),this.name=KBe}},M(ew,"NotAllInputParsedException"),ew),tw,Kir=(tw=class extends sP{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=XBe}},M(tw,"EarlyExitException"),tw),Qz={},JBe="InRuleRecoveryException",rw,Zir=(rw=class extends Error{constructor(e){super(e),this.name=JBe}},M(rw,"InRuleRecoveryException"),rw),nw,Qir=(nw=class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=Yr(e,"recoveryEnabled")?e.recoveryEnabled:D0.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=eFe)}getTokenToInsert(e){const r=KA(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return r.isInsertedInRecovery=!0,r}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,r,n,i){const s=this.findReSyncTokenType(),a=this.exportLexerState(),o=[];let l=!1;const u=this.LA(1);let h=this.LA(1);const d=M(()=>{const f=this.LA(0),p=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:u,previous:f,ruleName:this.getCurrRuleFullName()}),g=new QBe(p,u,this.LA(0));g.resyncedTokens=l6(o),this.SAVE_ERROR(g)},"generateErrorMessage");for(;!l;)if(this.tokenMatcher(h,i)){d();return}else if(n.call(this)){d(),e.apply(this,r);return}else this.tokenMatcher(h,s)?l=!0:(h=this.SKIP_TOKEN(),this.addToResyncTokens(h,o));this.importLexerState(a)}shouldInRepetitionRecoveryBeTried(e,r,n){return!(n===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,r)))}getFollowsForInRuleRecovery(e,r){const n=this.getCurrentGrammarPath(e,r);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,r){if(this.canRecoverWithSingleTokenInsertion(e,r))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new Zir("sad sad panda")}canPerformInRuleRecovery(e,r){return this.canRecoverWithSingleTokenInsertion(e,r)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,r){if(!this.canTokenTypeBeInsertedInRecovery(e)||Fi(r))return!1;const n=this.LA(1);return F5(r,s=>this.tokenMatcher(n,s))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){const r=this.getCurrFollowKey(),n=this.getFollowSetFromFollowKey(r);return Wl(n,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let r=this.LA(1),n=2;for(;;){const i=F5(e,s=>lre(r,s));if(i!==void 0)return i;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return Qz;const e=this.getLastExplicitRuleShortName(),r=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:r,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,r=this.RULE_OCCURRENCE_STACK;return Lr(e,(n,i)=>i===0?Qz:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:r[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){const e=Lr(this.buildFullFollowKeyStack(),r=>this.getFollowSetFromFollowKey(r));return Ch(e)}getFollowSetFromFollowKey(e){if(e===Qz)return[Bg];const r=e.ruleName+e.idxInCallingRule+F$e+e.inRule;return this.resyncFollows[r]}addToResyncTokens(e,r){return this.tokenMatcher(e,Bg)||r.push(e),r}reSyncTo(e){const r=[];let n=this.LA(1);for(;this.tokenMatcher(n,e)===!1;)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,r);return l6(r)}attemptInRepetitionRecovery(e,r,n,i,s,a,o){}getCurrentGrammarPath(e,r){const n=this.getHumanReadableRuleStack(),i=Mo(this.RULE_OCCURRENCE_STACK);return{ruleStack:n,occurrenceStack:i,lastTok:e,lastTokOccurrence:r}}getHumanReadableRuleStack(){return Lr(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}},M(nw,"Recoverable"),nw);function eFe(t,e,r,n,i,s,a){const o=this.getKeyForAutomaticLookahead(n,i);let l=this.firstAfterRepMap[o];if(l===void 0){const f=this.getCurrRuleFullName(),p=this.getGAstProductions()[f];l=new s(p,i).startWalking(),this.firstAfterRepMap[o]=l}let u=l.token,h=l.occurrence;const d=l.isEndOfRule;this.RULE_STACK.length===1&&d&&u===void 0&&(u=Bg,h=1),!(u===void 0||h===void 0)&&this.shouldInRepetitionRecoveryBeTried(u,h,a)&&this.tryInRepetitionRecovery(t,e,r,u)}M(eFe,"attemptInRepetitionRecovery");var Jir=4,gm=8,tFe=1<<gm,rFe=2<<gm,Cj=3<<gm,kj=4<<gm,Sj=5<<gm,IR=6<<gm;function NR(t,e,r){return r|e|t}M(NR,"getKeyForAutomaticLookahead");var iw,gre=(iw=class{constructor(e){var r;this.maxLookahead=(r=e==null?void 0:e.maxLookahead)!==null&&r!==void 0?r:D0.maxLookahead}validate(e){const r=this.validateNoLeftRecursion(e.rules);if(Fi(r)){const n=this.validateEmptyOrAlternatives(e.rules),i=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),s=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...r,...n,...i,...s]}return r}validateNoLeftRecursion(e){return Au(e,r=>fre(r,r,W1))}validateEmptyOrAlternatives(e){return Au(e,r=>BBe(r,W1))}validateAmbiguousAlternationAlternatives(e,r){return Au(e,n=>FBe(n,r,W1))}validateSomeNonEmptyLookaheadPath(e,r){return VBe(e,r,W1)}buildLookaheadForAlternation(e){return SBe(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,ABe)}buildLookaheadForOptional(e){return EBe(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,iP(e.prodType),MBe)}},M(iw,"LLkLookaheadStrategy"),iw),sw,esr=(sw=class{initLooksAhead(e){this.dynamicTokensEnabled=Yr(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:D0.dynamicTokensEnabled,this.maxLookahead=Yr(e,"maxLookahead")?e.maxLookahead:D0.maxLookahead,this.lookaheadStrategy=Yr(e,"lookaheadStrategy")?e.lookaheadStrategy:new gre({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){tn(e,r=>{this.TRACE_INIT(`${r.name} Rule Lookahead`,()=>{const{alternation:n,repetition:i,option:s,repetitionMandatory:a,repetitionMandatoryWithSeparator:o,repetitionWithSeparator:l}=nFe(r);tn(n,u=>{const h=u.idx===0?"":u.idx;this.TRACE_INIT(`${ah(u)}${h}`,()=>{const d=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:u.idx,rule:r,maxLookahead:u.maxLookahead||this.maxLookahead,hasPredicates:u.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),f=NR(this.fullRuleNameToShort[r.name],tFe,u.idx);this.setLaFuncCache(f,d)})}),tn(i,u=>{this.computeLookaheadFunc(r,u.idx,Cj,"Repetition",u.maxLookahead,ah(u))}),tn(s,u=>{this.computeLookaheadFunc(r,u.idx,rFe,"Option",u.maxLookahead,ah(u))}),tn(a,u=>{this.computeLookaheadFunc(r,u.idx,kj,"RepetitionMandatory",u.maxLookahead,ah(u))}),tn(o,u=>{this.computeLookaheadFunc(r,u.idx,IR,"RepetitionMandatoryWithSeparator",u.maxLookahead,ah(u))}),tn(l,u=>{this.computeLookaheadFunc(r,u.idx,Sj,"RepetitionWithSeparator",u.maxLookahead,ah(u))})})})}computeLookaheadFunc(e,r,n,i,s,a){this.TRACE_INIT(`${a}${r===0?"":r}`,()=>{const o=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:r,rule:e,maxLookahead:s||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),l=NR(this.fullRuleNameToShort[e.name],n,r);this.setLaFuncCache(l,o)})}getKeyForAutomaticLookahead(e,r){const n=this.getLastExplicitRuleShortName();return NR(n,e,r)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,r){this.lookAheadFuncsCache.set(e,r)}},M(sw,"LooksAhead"),sw),aw,tsr=(aw=class extends D3{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}},M(aw,"DslMethodsCollectorVisitor"),aw),X8=new tsr;function nFe(t){X8.reset(),t.accept(X8);const e=X8.dslMethods;return X8.reset(),e}M(nFe,"collectMethods");function Ej(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset)}M(Ej,"setNodeLocationOnlyOffset");function Aj(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.startColumn=e.startColumn,t.startLine=e.startLine,t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine)}M(Aj,"setNodeLocationFull");function iFe(t,e,r){t.children[r]===void 0?t.children[r]=[e]:t.children[r].push(e)}M(iFe,"addTerminalToCst");function sFe(t,e,r){t.children[e]===void 0?t.children[e]=[r]:t.children[e].push(r)}M(sFe,"addNoneTerminalToCst");var rsr="name";function mre(t,e){Object.defineProperty(t,rsr,{enumerable:!1,configurable:!0,writable:!1,value:e})}M(mre,"defineNameProp");function aFe(t,e){const r=qc(t),n=r.length;for(let i=0;i<n;i++){const s=r[i],a=t[s],o=a.length;for(let l=0;l<o;l++){const u=a[l];u.tokenTypeIdx===void 0&&this[u.name](u.children,e)}}}M(aFe,"defaultVisit");function oFe(t,e){const r=M(function(){},"derivedConstructor");mre(r,t+"BaseSemantics");const n={visit:M(function(i,s){if(Qn(i)&&(i=i[0]),!I0(i))return this[i.name](i.children,s)},"visit"),validateVisitor:M(function(){const i=cFe(this,e);if(!Fi(i)){const s=Lr(i,a=>a.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:@@ -3697,7 +3697,7 @@ lodash-es/lodash.js:`;break;case"r":r+="\r";break;case"t":r+=" ";break;default:r+=s}continue}r+=i}return r},"decodeEscapedString"),W4,hhr=(W4=class extends af{runConverter(e,r,n){const i=super.runConverter(e,r,n);if(e.name==="TITLE"&&typeof i=="string"){const s=i.trim();if(s.startsWith('"')&&s.endsWith('"')||s.startsWith("'")&&s.endsWith("'"))return H1e(s)}return i}runCustomConverter(e,r,n){if(e.name==="PEG_STRING")return H1e(r)}},M(W4,"RailroadPegValueConverter"),W4),GGe={parser:{TokenBuilder:M(()=>new uhr,"TokenBuilder"),ValueConverter:M(()=>new hhr,"ValueConverter")}};function yne(t=Lo){const e=Gn(io(t),ql),r=Gn(no({shared:e}),Xur,GGe);return e.ServiceRegistry.register(r),{shared:e,RailroadPeg:r}}M(yne,"createRailroadPegServices");var q4,dhr=(q4=class extends Ul{constructor(){super(["treemap"])}},M(q4,"TreemapTokenBuilder"),q4),fhr=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/,U4,phr=(U4=class extends af{runCustomConverter(e,r,n){if(e.name==="NUMBER2")return parseFloat(r.replace(/,/g,""));if(e.name==="SEPARATOR")return r.substring(1,r.length-1);if(e.name==="STRING2")return r.substring(1,r.length-1);if(e.name==="INDENTATION")return r.length;if(e.name==="ClassDef"){if(typeof r!="string")return r;const i=fhr.exec(r);if(i)return{$type:"ClassDefStatement",className:i[1],styleText:i[2]||void 0}}}},M(U4,"TreemapValueConverter"),U4);function WGe(t){const e=t.validation.TreemapValidator,r=t.validation.ValidationRegistry;if(r){const n={Treemap:e.checkSingleRoot.bind(e)};r.register(n,e)}}M(WGe,"registerValidationChecks");var j4,ghr=(j4=class{checkSingleRoot(e,r){let n;for(const i of e.TreemapRows)i.item&&(n===void 0&&i.indent===void 0?n=0:i.indent===void 0?r("error","Multiple root nodes are not allowed in a treemap.",{node:i,property:"item"}):n!==void 0&&n>=parseInt(i.indent,10)&&r("error","Multiple root nodes are not allowed in a treemap.",{node:i,property:"item"}))}},M(j4,"TreemapValidator"),j4),qGe={parser:{TokenBuilder:M(()=>new dhr,"TokenBuilder"),ValueConverter:M(()=>new phr,"ValueConverter")},validation:{TreemapValidator:M(()=>new ghr,"TreemapValidator")}};function UGe(t=Lo){const e=Gn(io(t),ql),r=Gn(no({shared:e}),Kur,qGe);return e.ServiceRegistry.register(r),WGe(r),{shared:e,Treemap:r}}M(UGe,"createTreemapServices");var Y4,mhr=(Y4=class extends af{runCustomConverter(e,r,n){switch(e.name.toUpperCase()){case"LINK_LABEL":return r.substring(1).trim();default:return}}},M(Y4,"WardleyValueConverter"),Y4),jGe={parser:{ValueConverter:M(()=>new mhr,"ValueConverter")}};function YGe(t=Lo){const e=Gn(io(t),ql),r=Gn(no({shared:e}),Qur,jGe);return e.ServiceRegistry.register(r),{shared:e,Wardley:r}}M(YGe,"createWardleyServices");var X4,yhr=(X4=class extends Ul{constructor(){super(["cynefin-beta"])}},M(X4,"CynefinTokenBuilder"),X4),XGe={parser:{TokenBuilder:M(()=>new yhr,"TokenBuilder"),ValueConverter:M(()=>new z3,"ValueConverter")}};function KGe(t=Lo){const e=Gn(io(t),ql),r=Gn(no({shared:e}),Fur,XGe);return e.ServiceRegistry.register(r),{shared:e,Cynefin:r}}M(KGe,"createCynefinServices");var K4,vhr=(K4=class extends Ul{constructor(){super(["gitGraph"])}},M(K4,"GitGraphTokenBuilder"),K4),ZGe={parser:{TokenBuilder:M(()=>new vhr,"TokenBuilder"),ValueConverter:M(()=>new z3,"ValueConverter")}};function QGe(t=Lo){const e=Gn(io(t),ql),r=Gn(no({shared:e}),Vur,ZGe);return e.ServiceRegistry.register(r),{shared:e,GitGraph:r}}M(QGe,"createGitGraphServices");var Z4,bhr=(Z4=class extends Ul{constructor(){super(["info","showInfo"])}},M(Z4,"InfoTokenBuilder"),Z4),JGe={parser:{TokenBuilder:M(()=>new bhr,"TokenBuilder"),ValueConverter:M(()=>new z3,"ValueConverter")}};function eWe(t=Lo){const e=Gn(io(t),ql),r=Gn(no({shared:e}),Hur,JGe);return e.ServiceRegistry.register(r),{shared:e,Info:r}}M(eWe,"createInfoServices");var Q4,xhr=(Q4=class extends Ul{constructor(){super(["packet"])}},M(Q4,"PacketTokenBuilder"),Q4),tWe={parser:{TokenBuilder:M(()=>new xhr,"TokenBuilder"),ValueConverter:M(()=>new z3,"ValueConverter")}};function rWe(t=Lo){const e=Gn(io(t),ql),r=Gn(no({shared:e}),Gur,tWe);return e.ServiceRegistry.register(r),{shared:e,Packet:r}}M(rWe,"createPacketServices");var J4,whr=(J4=class extends Ul{constructor(){super(["pie","showData"])}},M(J4,"PieTokenBuilder"),J4),eT,Thr=(eT=class extends af{runCustomConverter(e,r,n){if(e.name==="PIE_SECTION_LABEL")return r.replace(/"/g,"").trim()}},M(eT,"PieValueConverter"),eT),nWe={parser:{TokenBuilder:M(()=>new whr,"TokenBuilder"),ValueConverter:M(()=>new Thr,"ValueConverter")}};function iWe(t=Lo){const e=Gn(io(t),ql),r=Gn(no({shared:e}),Wur,nWe);return e.ServiceRegistry.register(r),{shared:e,Pie:r}}M(iWe,"createPieServices");var tT,Chr=(tT=class extends af{runCustomConverter(e,r,n){if(e.name==="INDENTATION")return(r==null?void 0:r.length)||0;if(e.name==="QUOTED_NAME")return r.substring(1,r.length-1);if(e.name==="BARE_NAME")return r.replace(/[\t ]+$/,"");if(e.name==="CLASS_ANNOTATION")return r.trim().substring(3).trim();if(e.name==="ICON_ANNOTATION"){const i=r.trim();return i.substring(5,i.length-1)}if(e.name==="DESC_ANNOTATION")return r.trim().substring(2).trim()}},M(tT,"TreeViewValueConverter"),tT),rT,khr=(rT=class extends Ul{constructor(){super(["treeView-beta"])}},M(rT,"TreeViewTokenBuilder"),rT),sWe={parser:{TokenBuilder:M(()=>new khr,"TokenBuilder"),ValueConverter:M(()=>new Chr,"ValueConverter")}};function aWe(t=Lo){const e=Gn(io(t),ql),r=Gn(no({shared:e}),Zur,sWe);return e.ServiceRegistry.register(r),{shared:e,TreeView:r}}M(aWe,"createTreeViewServices");var nT,Shr=(nT=class extends Ul{constructor(){super(["architecture"])}},M(nT,"ArchitectureTokenBuilder"),nT),iT,Ehr=(iT=class extends af{runCustomConverter(e,r,n){if(e.name==="ARCH_ICON")return r.replace(/[()]/g,"").trim();if(e.name==="ARCH_TEXT_ICON")return r.replace(/["()]/g,"");if(e.name==="ARCH_TITLE"){let i=r.replace(/^\[|]$/g,"").trim();return(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))&&(i=i.slice(1,-1),i=i.replace(/\\"/g,'"').replace(/\\'/g,"'")),i.trim()}}},M(iT,"ArchitectureValueConverter"),iT),oWe={parser:{TokenBuilder:M(()=>new Shr,"TokenBuilder"),ValueConverter:M(()=>new Ehr,"ValueConverter")}};function lWe(t=Lo){const e=Gn(io(t),ql),r=Gn(no({shared:e}),Bur,oWe);return e.ServiceRegistry.register(r),{shared:e,Architecture:r}}M(lWe,"createArchitectureServices");var sT,Ahr=(sT=class extends Ul{constructor(){super(["eventmodeling"])}},M(sT,"EventModelingTokenBuilder"),sT),G1e=new Set(["cmd","command"]),W1e=new Set(["evt","event"]),kV=new Set(["rmo","readmodel"]),q1e=new Set(["pcr","processor"]),U1e=new Set(["ui"]);function cWe(t){const e=t.validation.EventModelingValidator,r=t.validation.ValidationRegistry;if(r){const n={EmTimeFrame:e.checkSourceFrameTypes.bind(e),EmResetFrame:e.checkSourceFrameTypes.bind(e)};r.register(n,e)}}M(cWe,"registerValidationChecks");var aT,Mhr=(aT=class{checkSourceFrameTypes(e,r){e.sourceFrames.length!==0&&(G1e.has(e.modelEntityType)?this.validateSources(e,new Set([...U1e,...q1e]),"command","ui or processor",r):W1e.has(e.modelEntityType)?this.validateSources(e,G1e,"event","command",r):kV.has(e.modelEntityType)?this.validateSources(e,W1e,"read model","event",r):q1e.has(e.modelEntityType)?this.validateSources(e,kV,"processor","read model",r):U1e.has(e.modelEntityType)&&this.validateSources(e,kV,"ui","read model",r))}validateSources(e,r,n,i,s){for(const a of e.sourceFrames){const o=a.ref;o!==void 0&&!r.has(o.modelEntityType)&&s("error",`A ${n} can only receive input from a ${i}, not from '${o.modelEntityType}'.`,{node:e,property:"sourceFrames"})}}},M(aT,"EventModelingValidator"),aT),uWe={parser:{TokenBuilder:M(()=>new Ahr,"TokenBuilder"),ValueConverter:M(()=>new z3,"ValueConverter")},validation:{EventModelingValidator:M(()=>new Mhr,"EventModelingValidator")}};function hWe(t=Lo){const e=Gn(io(t),ql),r=Gn(no({shared:e}),zur,uWe);return e.ServiceRegistry.register(r),cWe(r),{shared:e,EventModel:r}}M(hWe,"createEventModelingServices");var go={},Rhr={info:M(async()=>{const{createInfoServices:t}=await Rr(async()=>{const{createInfoServices:r}=await Promise.resolve().then(()=>c4r);return{createInfoServices:r}},void 0,import.meta.url),e=t().Info.parser.LangiumParser;go.info=e},"info"),packet:M(async()=>{const{createPacketServices:t}=await Rr(async()=>{const{createPacketServices:r}=await Promise.resolve().then(()=>u4r);return{createPacketServices:r}},void 0,import.meta.url),e=t().Packet.parser.LangiumParser;go.packet=e},"packet"),pie:M(async()=>{const{createPieServices:t}=await Rr(async()=>{const{createPieServices:r}=await Promise.resolve().then(()=>h4r);return{createPieServices:r}},void 0,import.meta.url),e=t().Pie.parser.LangiumParser;go.pie=e},"pie"),treeView:M(async()=>{const{createTreeViewServices:t}=await Rr(async()=>{const{createTreeViewServices:r}=await Promise.resolve().then(()=>d4r);return{createTreeViewServices:r}},void 0,import.meta.url),e=t().TreeView.parser.LangiumParser;go.treeView=e},"treeView"),architecture:M(async()=>{const{createArchitectureServices:t}=await Rr(async()=>{const{createArchitectureServices:r}=await Promise.resolve().then(()=>f4r);return{createArchitectureServices:r}},void 0,import.meta.url),e=t().Architecture.parser.LangiumParser;go.architecture=e},"architecture"),gitGraph:M(async()=>{const{createGitGraphServices:t}=await Rr(async()=>{const{createGitGraphServices:r}=await Promise.resolve().then(()=>p4r);return{createGitGraphServices:r}},void 0,import.meta.url),e=t().GitGraph.parser.LangiumParser;go.gitGraph=e},"gitGraph"),eventmodeling:M(async()=>{const{createEventModelingServices:t}=await Rr(async()=>{const{createEventModelingServices:r}=await Promise.resolve().then(()=>g4r);return{createEventModelingServices:r}},void 0,import.meta.url),e=t().EventModel.parser.LangiumParser;go.eventmodeling=e},"eventmodeling"),radar:M(async()=>{const{createRadarServices:t}=await Rr(async()=>{const{createRadarServices:r}=await Promise.resolve().then(()=>m4r);return{createRadarServices:r}},void 0,import.meta.url),e=t().Radar.parser.LangiumParser;go.radar=e},"radar"),railroad:M(async()=>{const{createRailroadServices:t}=await Rr(async()=>{const{createRailroadServices:r}=await Promise.resolve().then(()=>y4r);return{createRailroadServices:r}},void 0,import.meta.url),e=t().Railroad.parser.LangiumParser;go.railroad=e},"railroad"),railroadEbnf:M(async()=>{const{createRailroadEbnfServices:t}=await Rr(async()=>{const{createRailroadEbnfServices:r}=await Promise.resolve().then(()=>v4r);return{createRailroadEbnfServices:r}},void 0,import.meta.url),e=t().RailroadEbnf.parser.LangiumParser;go.railroadEbnf=e},"railroadEbnf"),railroadAbnf:M(async()=>{const{createRailroadAbnfServices:t}=await Rr(async()=>{const{createRailroadAbnfServices:r}=await Promise.resolve().then(()=>b4r);return{createRailroadAbnfServices:r}},void 0,import.meta.url),e=t().RailroadAbnf.parser.LangiumParser;go.railroadAbnf=e},"railroadAbnf"),railroadPeg:M(async()=>{const{createRailroadPegServices:t}=await Rr(async()=>{const{createRailroadPegServices:r}=await Promise.resolve().then(()=>x4r);return{createRailroadPegServices:r}},void 0,import.meta.url),e=t().RailroadPeg.parser.LangiumParser;go.railroadPeg=e},"railroadPeg"),treemap:M(async()=>{const{createTreemapServices:t}=await Rr(async()=>{const{createTreemapServices:r}=await Promise.resolve().then(()=>w4r);return{createTreemapServices:r}},void 0,import.meta.url),e=t().Treemap.parser.LangiumParser;go.treemap=e},"treemap"),wardley:M(async()=>{const{createWardleyServices:t}=await Rr(async()=>{const{createWardleyServices:r}=await Promise.resolve().then(()=>T4r);return{createWardleyServices:r}},void 0,import.meta.url),e=t().Wardley.parser.LangiumParser;go.wardley=e},"wardley"),cynefin:M(async()=>{const{createCynefinServices:t}=await Rr(async()=>{const{createCynefinServices:r}=await Promise.resolve().then(()=>C4r);return{createCynefinServices:r}},void 0,import.meta.url),e=t().Cynefin.parser.LangiumParser;go.cynefin=e},"cynefin")};async function zu(t,e){const r=Rhr[t];if(!r)throw new Error(`Unknown diagram type: ${t}`);go[t]||await r();const i=go[t].parse(e);if(i.lexerErrors.length>0||i.parserErrors.length>0)throw new e7(i);return i.value}M(zu,"parse");var oT,e7=(oT=class extends Error{constructor(e){const r=e.lexerErrors.map(i=>{const s=i.line!==void 0&&!isNaN(i.line)?i.line:"?",a=i.column!==void 0&&!isNaN(i.column)?i.column:"?";return`Lexer error on line ${s}, column ${a}: ${i.message}`}).join(``),n=e.parserErrors.map(i=>{const s=i.token.startLine!==void 0&&!isNaN(i.token.startLine)?i.token.startLine:"?",a=i.token.startColumn!==void 0&&!isNaN(i.token.startColumn)?i.token.startColumn:"?";return`Parse error on line ${s}, column ${a}: ${i.message}`}).join(``);super(`Parsing failed: ${r} ${n}`),this.result=e}},M(oT,"MermaidParseError"),oT),Ci={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},_hr=Sn.gitGraph,Rv=w(()=>es({..._hr,...xr().gitGraph}),"getConfig"),Jt=new Aee(()=>{const t=Rv(),e=t.mainBranchName,r=t.mainBranchOrder;return{mainBranchName:e,commits:new Map,head:null,branchConfig:new Map([[e,{name:e,order:r}]]),branches:new Map([[e,null]]),currBranch:e,direction:"LR",seq:0,options:{}}});function IP(){return nke({length:7})}w(IP,"getID");function dWe(t,e){const r=Object.create(null);return t.reduce((n,i)=>{const s=e(i);return r[s]||(r[s]=!0,n.push(i)),n},[])}w(dWe,"uniqBy");var Lhr=w(function(t){Jt.records.direction=t},"setDirection"),Ihr=w(function(t){de.debug("options str",t),t=t==null?void 0:t.trim(),t=t||"{}";try{Jt.records.options=JSON.parse(t)}catch(e){de.error("error while parsing gitGraph options",e.message)}},"setOptions"),Nhr=w(function(){return Jt.records.options},"getOptions"),Dhr=w(function(t){let e=t.msg,r=t.id;const n=t.type;let i=t.tags;de.info("commit",e,r,n,i),de.debug("Entering commit:",e,r,n,i);const s=Rv();r=Vt.sanitizeText(r,s),e=Vt.sanitizeText(e,s),i=i==null?void 0:i.map(o=>Vt.sanitizeText(o,s));const a={id:r||Jt.records.seq+"-"+IP(),message:e,seq:Jt.records.seq++,type:n??Ci.NORMAL,tags:i??[],parents:Jt.records.head==null?[]:[Jt.records.head.id],branch:Jt.records.currBranch};Jt.records.head=a,de.info("main branch",s.mainBranchName),Jt.records.commits.has(a.id)&&de.warn(`Commit ID ${a.id} already exists`),Jt.records.commits.set(a.id,a),Jt.records.branches.set(Jt.records.currBranch,a.id),de.debug("in pushCommit "+a.id)},"commit"),Ohr=w(function(t){let e=t.name;const r=t.order;if(e=Vt.sanitizeText(e,Rv()),Jt.records.branches.has(e))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${e}")`);Jt.records.branches.set(e,Jt.records.head!=null?Jt.records.head.id:null),Jt.records.branchConfig.set(e,{name:e,order:r}),fWe(e),de.debug("in createBranch")},"branch"),Phr=w(t=>{let e=t.branch,r=t.id;const n=t.type,i=t.tags,s=Rv();e=Vt.sanitizeText(e,s),r&&(r=Vt.sanitizeText(r,s));const a=Jt.records.branches.get(Jt.records.currBranch),o=Jt.records.branches.get(e),l=a?Jt.records.commits.get(a):void 0,u=o?Jt.records.commits.get(o):void 0;if(l&&u&&l.branch===e)throw new Error(`Cannot merge branch '${e}' into itself.`);if(Jt.records.currBranch===e){const f=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},f}if(l===void 0||!l){const f=new Error(`Incorrect usage of "merge". Current branch (${Jt.records.currBranch})has no commits`);throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["commit"]},f}if(!Jt.records.branches.has(e)){const f=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") does not exist");throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:[`branch ${e}`]},f}if(u===void 0||!u){const f=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") has no commits");throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:['"commit"']},f}if(l===u){const f=new Error('Incorrect usage of "merge". Both branches have same head');throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},f}if(r&&Jt.records.commits.has(r)){const f=new Error('Incorrect usage of "merge". Commit with id:'+r+" already exists, use different custom id");throw f.hash={text:`merge ${e} ${r} ${n} ${i==null?void 0:i.join(" ")}`,token:`merge ${e} ${r} ${n} ${i==null?void 0:i.join(" ")}`,expected:[`merge ${e} ${r}_UNIQUE ${n} ${i==null?void 0:i.join(" ")}`]},f}const h=o||"",d={id:r||`${Jt.records.seq}-${IP()}`,message:`merged branch ${e} into ${Jt.records.currBranch}`,seq:Jt.records.seq++,parents:Jt.records.head==null?[]:[Jt.records.head.id,h],branch:Jt.records.currBranch,type:Ci.MERGE,customType:n,customId:!!r,tags:i??[]};Jt.records.head=d,Jt.records.commits.set(d.id,d),Jt.records.branches.set(Jt.records.currBranch,d.id),de.debug(Jt.records.branches),de.debug("in mergeBranch")},"merge"),$hr=w(function(t){let e=t.id,r=t.targetId,n=t.tags,i=t.parent;de.debug("Entering cherryPick:",e,r,n);const s=Rv();if(e=Vt.sanitizeText(e,s),r=Vt.sanitizeText(r,s),n=n==null?void 0:n.map(l=>Vt.sanitizeText(l,s)),i=Vt.sanitizeText(i,s),!e||!Jt.records.commits.has(e)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},l}const a=Jt.records.commits.get(e);if(a===void 0||!a)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(i&&!(Array.isArray(a.parents)&&a.parents.includes(i)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const o=a.branch;if(a.type===Ci.MERGE&&!i)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!r||!Jt.records.commits.has(r)){if(o===Jt.records.currBranch){const d=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const l=Jt.records.branches.get(Jt.records.currBranch);if(l===void 0||!l){const d=new Error(`Incorrect usage of "cherry-pick". Current branch (${Jt.records.currBranch})has no commits`);throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const u=Jt.records.commits.get(l);if(u===void 0||!u){const d=new Error(`Incorrect usage of "cherry-pick". Current branch (${Jt.records.currBranch})has no commits`);throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const h={id:Jt.records.seq+"-"+IP(),message:`cherry-picked ${a==null?void 0:a.message} into ${Jt.records.currBranch}`,seq:Jt.records.seq++,parents:Jt.records.head==null?[]:[Jt.records.head.id,a.id],branch:Jt.records.currBranch,type:Ci.CHERRY_PICK,tags:n?n.filter(Boolean):[`cherry-pick:${a.id}${a.type===Ci.MERGE?`|parent:${i}`:""}`]};Jt.records.head=h,Jt.records.commits.set(h.id,h),Jt.records.branches.set(Jt.records.currBranch,h.id),de.debug(Jt.records.branches),de.debug("in cherryPick")}},"cherryPick"),fWe=w(function(t){if(t=Vt.sanitizeText(t,Rv()),Jt.records.branches.has(t)){Jt.records.currBranch=t;const e=Jt.records.branches.get(Jt.records.currBranch);e===void 0||!e?Jt.records.head=null:Jt.records.head=Jt.records.commits.get(e)??null}else{const e=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${t}")`);throw e.hash={text:`checkout ${t}`,token:`checkout ${t}`,expected:[`branch ${t}`]},e}},"checkout");function lY(t,e,r){const n=t.indexOf(e);n===-1?t.push(r):t.splice(n,1,r)}w(lY,"upsert");function vne(t){const e=t.reduce((i,s)=>i.seq>s.seq?i:s,t[0]);let r="";t.forEach(function(i){i===e?r+=" *":r+=" |"});const n=[r,e.id,e.seq];for(const i in Jt.records.branches)Jt.records.branches.get(i)===e.id&&n.push(i);if(de.debug(n.join(" ")),e.parents&&e.parents.length==2&&e.parents[0]&&e.parents[1]){const i=Jt.records.commits.get(e.parents[0]);lY(t,e,i),e.parents[1]&&t.push(Jt.records.commits.get(e.parents[1]))}else{if(e.parents.length==0)return;if(e.parents[0]){const i=Jt.records.commits.get(e.parents[0]);lY(t,e,i)}}t=dWe(t,i=>i.id),vne(t)}w(vne,"prettyPrintCommitHistory");var Bhr=w(function(){de.debug(Jt.records.commits);const t=pWe()[0];vne([t])},"prettyPrint"),Fhr=w(function(){Jt.reset(),Ri()},"clear"),zhr=w(function(){return[...Jt.records.branchConfig.values()].map((e,r)=>e.order!==null&&e.order!==void 0?e:{...e,order:parseFloat(`0.${r}`)}).sort((e,r)=>(e.order??0)-(r.order??0)).map(({name:e})=>({name:e}))},"getBranchesAsObjArray"),Vhr=w(function(){return Jt.records.branches},"getBranches"),Hhr=w(function(){return Jt.records.commits},"getCommits"),pWe=w(function(){const t=[...Jt.records.commits.values()];return t.forEach(function(e){de.debug(e.id)}),t.sort((e,r)=>e.seq-r.seq),t},"getCommitsArray"),Ghr=w(function(){return Jt.records.currBranch},"getCurrentBranch"),Whr=w(function(){return Jt.records.direction},"getDirection"),qhr=w(function(){return Jt.records.head},"getHead"),gWe={commitType:Ci,getConfig:Rv,setDirection:Lhr,setOptions:Ihr,getOptions:Nhr,commit:Dhr,branch:Ohr,merge:Phr,cherryPick:$hr,checkout:fWe,prettyPrint:Bhr,clear:Fhr,getBranchesAsObjArray:zhr,getBranches:Vhr,getCommits:Hhr,getCommitsArray:pWe,getCurrentBranch:Ghr,getDirection:Whr,getHead:qhr,setAccTitle:Hi,getAccTitle:ts,getAccDescription:ns,setAccDescription:rs,setDiagramTitle:Ji,getDiagramTitle:qi},Uhr=w((t,e)=>{Gl(t,e),t.dir&&e.setDirection(t.dir);for(const r of t.statements)jhr(r,e)},"populate"),jhr=w((t,e)=>{const n={Commit:w(i=>e.commit(Yhr(i)),"Commit"),Branch:w(i=>e.branch(Xhr(i)),"Branch"),Merge:w(i=>e.merge(Khr(i)),"Merge"),Checkout:w(i=>e.checkout(Zhr(i)),"Checkout"),CherryPicking:w(i=>e.cherryPick(Qhr(i)),"CherryPicking")}[t.$type];n?n(t):de.error(`Unknown statement type: ${t.$type}`)},"parseStatement"),Yhr=w(t=>({id:t.id,msg:t.message??"",type:t.type!==void 0?Ci[t.type]:Ci.NORMAL,tags:t.tags??void 0}),"parseCommit"),Xhr=w(t=>({name:t.name,order:t.order??0}),"parseBranch"),Khr=w(t=>({branch:t.branch,id:t.id??"",type:t.type!==void 0?Ci[t.type]:void 0,tags:t.tags??void 0}),"parseMerge"),Zhr=w(t=>t.branch,"parseCheckout"),Qhr=w(t=>{var r;return{id:t.id,targetId:"",tags:((r=t.tags)==null?void 0:r.length)===0?void 0:t.tags,parent:t.parent}},"parseCherryPicking"),Jhr={parse:w(async t=>{const e=await zu("gitGraph",t);de.debug(e),Uhr(e,gWe)},"parse")},Zp=10,Qp=40,rd=4,If=2,M1=8,NP=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),cY=12,bne=new Set(["redux-color","redux-dark-color"]),edr=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),R1=w((t,e,r=!1)=>r&&t>0?(t-1)%(e-1)+1:t%e,"calcColorIndex"),cc=new Map,pc=new Map,HI=30,Mk=new Map,GI=[],Nf=0,In="LR",tdr=w(()=>{cc.clear(),pc.clear(),Mk.clear(),Nf=0,GI=[],In="LR"},"clear"),mWe=w(t=>{const e=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof t=="string"?t.split(/\\n|\n|<br\s*\/?>/gi):t).forEach(n=>{const i=document.createElementNS("http://www.w3.org/2000/svg","tspan");i.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),i.setAttribute("dy","1em"),i.setAttribute("x","0"),i.setAttribute("class","row"),i.textContent=n.trim(),e.appendChild(i)}),e},"drawText"),yWe=w(t=>{let e,r,n;return In==="BT"?(r=w((i,s)=>i<=s,"comparisonFunc"),n=1/0):(r=w((i,s)=>i>=s,"comparisonFunc"),n=0),t.forEach(i=>{var a,o;const s=In==="TB"||In=="BT"?(a=pc.get(i))==null?void 0:a.y:(o=pc.get(i))==null?void 0:o.x;s!==void 0&&r(s,n)&&(e=i,n=s)}),e},"findClosestParent"),rdr=w(t=>{let e="",r=1/0;return t.forEach(n=>{const i=pc.get(n).y;i<=r&&(e=n,r=i)}),e||void 0},"findClosestParentBT"),ndr=w((t,e,r)=>{let n=r,i=r;const s=[];t.forEach(a=>{const o=e.get(a);if(!o)throw new Error(`Commit not found for key ${a}`);o.parents.length?(n=sdr(o),i=Math.max(n,i)):s.push(o),adr(o,n)}),n=i,s.forEach(a=>{odr(a,n,r)}),t.forEach(a=>{const o=e.get(a);if(o!=null&&o.parents.length){const l=rdr(o.parents);n=pc.get(l).y-Qp,n<=i&&(i=n);const u=cc.get(o.branch).pos,h=n-Zp;pc.set(o.id,{x:u,y:h})}})},"setParallelBTPos"),idr=w(t=>{var n;const e=yWe(t.parents.filter(i=>i!==null));if(!e)throw new Error(`Closest parent not found for commit ${t.id}`);const r=(n=pc.get(e))==null?void 0:n.y;if(r===void 0)throw new Error(`Closest parent position not found for commit ${t.id}`);return r},"findClosestParentPos"),sdr=w(t=>idr(t)+Qp,"calculateCommitPosition"),adr=w((t,e)=>{const r=cc.get(t.branch);if(!r)throw new Error(`Branch not found for commit ${t.id}`);const n=r.pos,i=e+Zp;return pc.set(t.id,{x:n,y:i}),{x:n,y:i}},"setCommitPosition"),odr=w((t,e,r)=>{const n=cc.get(t.branch);if(!n)throw new Error(`Branch not found for commit ${t.id}`);const i=e+r,s=n.pos;pc.set(t.id,{x:s,y:i})},"setRootPosition"),ldr=w((t,e,r,n,i,s)=>{const{theme:a}=Ve(),o=NP.has(a??""),l=bne.has(a??""),u=edr.has(a??"");if(s===Ci.HIGHLIGHT)t.append("rect").attr("x",r.x-10+(o?3:0)).attr("y",r.y-10+(o?3:0)).attr("width",o?14:20).attr("height",o?14:20).attr("class",`commit ${e.id} commit-highlight${R1(i,M1,l)} ${n}-outer`),t.append("rect").attr("x",r.x-6+(o?2:0)).attr("y",r.y-6+(o?2:0)).attr("width",o?8:12).attr("height",o?8:12).attr("class",`commit ${e.id} commit${R1(i,M1,l)} ${n}-inner`);else if(s===Ci.CHERRY_PICK)t.append("circle").attr("cx",r.x).attr("cy",r.y).attr("r",o?7:10).attr("class",`commit ${e.id} ${n}`),t.append("circle").attr("cx",r.x-3).attr("cy",r.y+2).attr("r",o?2.5:2.75).attr("fill",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`),t.append("circle").attr("cx",r.x+3).attr("cy",r.y+2).attr("r",o?2.5:2.75).attr("fill",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`),t.append("line").attr("x1",r.x+3).attr("y1",r.y+1).attr("x2",r.x).attr("y2",r.y-5).attr("stroke",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`),t.append("line").attr("x1",r.x-3).attr("y1",r.y+1).attr("x2",r.x).attr("y2",r.y-5).attr("stroke",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`);else{const h=t.append("circle");if(h.attr("cx",r.x),h.attr("cy",r.y),h.attr("r",o?7:10),h.attr("class",`commit ${e.id} commit${R1(i,M1,l)}`),s===Ci.MERGE){const d=t.append("circle");d.attr("cx",r.x),d.attr("cy",r.y),d.attr("r",o?5:6),d.attr("class",`commit ${n} ${e.id} commit${R1(i,M1,l)}`)}if(s===Ci.REVERSE){const d=t.append("path"),f=o?4:5;d.attr("d",`M ${r.x-f},${r.y-f}L${r.x+f},${r.y+f}M${r.x-f},${r.y+f}L${r.x+f},${r.y-f}`).attr("class",`commit ${n} ${e.id} commit${R1(i,M1,l)}`)}}},"drawCommitBullet"),cdr=w((t,e,r,n,i)=>{var s;if(e.type!==Ci.CHERRY_PICK&&(e.customId&&e.type===Ci.MERGE||e.type!==Ci.MERGE)&&i.showCommitLabel){const a=t.append("g"),o=a.insert("rect").attr("class","commit-label-bkg"),l=a.append("text").attr("x",n).attr("y",r.y+25).attr("class","commit-label").text(e.id),u=(s=l.node())==null?void 0:s.getBBox();if(u&&(o.attr("x",r.posWithOffset-u.width/2-If).attr("y",r.y+13.5).attr("width",u.width+2*If).attr("height",u.height+2*If),In==="TB"||In==="BT"?(o.attr("x",r.x-(u.width+4*rd+5)).attr("y",r.y-12),l.attr("x",r.x-(u.width+4*rd)).attr("y",r.y+u.height-12)):l.attr("x",r.posWithOffset-u.width/2),i.rotateCommitLabel))if(In==="TB"||In==="BT")l.attr("transform","rotate(-45, "+r.x+", "+r.y+")"),o.attr("transform","rotate(-45, "+r.x+", "+r.y+")");else{const h=-7.5-(u.width+10)/25*9.5,d=10+u.width/25*8.5;a.attr("transform","translate("+h+", "+d+") rotate(-45, "+n+", "+r.y+")")}}},"drawCommitLabel"),udr=w((t,e,r,n)=>{var i;if(e.tags.length>0){let s=0,a=0,o=0;const l=[];for(const u of e.tags.reverse()){const h=t.insert("polygon"),d=t.append("circle"),f=t.append("text").attr("y",r.y-16-s).attr("class","tag-label").text(u),p=(i=f.node())==null?void 0:i.getBBox();if(!p)throw new Error("Tag bbox not found");a=Math.max(a,p.width),o=Math.max(o,p.height),f.attr("x",r.posWithOffset-p.width/2),l.push({tag:f,hole:d,rect:h,yOffset:s}),s+=20}for(const{tag:u,hole:h,rect:d,yOffset:f}of l){const p=o/2,g=r.y-19.2-f;if(d.attr("class","tag-label-bkg").attr("points",`- ${n-a/2-rd/2},${g+If}+ ${n-a/2-rd/2},${g+If}${n-a/2-rd/2},${g-If}${r.posWithOffset-a/2-rd},${g-p-If}${r.posWithOffset+a/2+rd},${g-p-If}@@ -3760,7 +3760,7 @@ lodash-es/lodash.js:font-family: 'trebuchet ms', verdana, arial, sans-serif;font-family: var(--mermaid-font-family);}-+${n?Edr(t):Adr(t)}.branch {@@ -4181,7 +4181,7 @@ Expecting `+Rt.join(", ")+", got '"+(this.terminals_[lt]||lt)+"'":Or="Parse errostroke: ${t.requirementBorderColor};stroke-width: ${t.requirementBorderSize};}-+.reqTitle, .reqLabel{fill: ${t.requirementTextColor};}@@ -5542,10 +5542,10 @@ Expecting `+ie.join(", ")+", got '"+(this.terminals_[G]||G)+"'":me="Parse errorstroke-dasharray: 8;}.node-icon-text {- display: flex;+ display: flex;align-items: center;}-+.node-icon-text > div {color: #fff;margin: 1px;diff --git a/apps/ios/EditorSource/src/main.ts b/apps/ios/EditorSource/src/main.tsindex 3cbf115a..0379d579 100644--- a/apps/ios/EditorSource/src/main.ts+++ b/apps/ios/EditorSource/src/main.ts@@ -1237,7 +1237,7 @@ async function exportNoteImage(request: ImageExportRequest) {const fontSize = request.fontSize ?? "lg";const cardWidth = request.cardWidth ?? "standard";const targetWidth = NOTE_IMAGE_CARD_WIDTH_PIXELS[cardWidth] || 680;- const themeCfg = NOTE_IMAGE_THEMES[resolvedTheme] || NOTE_IMAGE_THEMES.slate;+ const themeCfg = NOTE_IMAGE_THEMES[resolvedTheme] || NOTE_IMAGE_THEMES.aurora;const editorClone = editor.view.dom.cloneNode(true) as HTMLElement;editorClone.removeAttribute("contenteditable");diff --git a/apps/mobile/src/components/LocalTiptapEditor.tsx b/apps/mobile/src/components/LocalTiptapEditor.tsxindex 7a6f90f0..44c07ccd 100644--- a/apps/mobile/src/components/LocalTiptapEditor.tsx+++ b/apps/mobile/src/components/LocalTiptapEditor.tsx@@ -1254,7 +1254,7 @@ function LocalTiptapEditorImpl(props: LocalTiptapEditorProps) {const fontSize = request.fontSize ?? "lg";const cardWidth = request.cardWidth ?? "standard";const targetWidth = NOTE_IMAGE_CARD_WIDTH_PIXELS[cardWidth] || 680;- const themeCfg = NOTE_IMAGE_THEMES[resolvedTheme] || NOTE_IMAGE_THEMES.slate;+ const themeCfg = NOTE_IMAGE_THEMES[resolvedTheme] || NOTE_IMAGE_THEMES.aurora;const editorClone = editor.view.dom.cloneNode(true) as HTMLElement;editorClone.removeAttribute("contenteditable");diff --git a/apps/mobile/src/screens/WorkspaceMemoDetail.tsx b/apps/mobile/src/screens/WorkspaceMemoDetail.tsxindex d8671705..2afd3bf7 100644--- a/apps/mobile/src/screens/WorkspaceMemoDetail.tsx+++ b/apps/mobile/src/screens/WorkspaceMemoDetail.tsx@@ -217,7 +217,6 @@ const MOBILE_THEME_OPTIONS: Array<{previewBg: string;dotColor: string;}> = [- { id: "slate", labelZh: "经典浅色", labelEn: "Light", previewBg: "#f8fafc", dotColor: "#16a06e" },{ id: "aurora", labelZh: "极光渐变", labelEn: "Aurora", previewBg: "#a7f3d0", dotColor: "#0d9488" },{ id: "sunset", labelZh: "暮色晚霞", labelEn: "Sunset", previewBg: "#fde68a", dotColor: "#ea580c" },{ id: "midnight", labelZh: "暗夜曜石", labelEn: "Midnight", previewBg: "#090d16", dotColor: "#34d399" },@@ -508,7 +507,7 @@ export const MemoDetailModal = ({const [imageExportStage, setImageExportStage] = useState<"prepare" | "render" | "transfer">("prepare");const [imageShareOptionsOpen, setImageShareOptionsOpen] = useState(false);const [imageShareFormat, setImageShareFormat] = useState<"jpeg" | "png">("png");- const [imageShareTheme, setImageShareTheme] = useState<NoteImageTheme>("slate");+ const [imageShareTheme, setImageShareTheme] = useState<NoteImageTheme>("aurora");const [imageShareFontStyle, setImageShareFontStyle] = useState<NoteImageFontStyle>("serif");const [imageShareFontSize, setImageShareFontSize] = useState<NoteImageFontSize>("lg");const [imageShareCardWidth, setImageShareCardWidth] = useState<NoteImageCardWidth>("standard");@@ -969,7 +968,7 @@ export const MemoDetailModal = ({notebook: options.showNotebook === false ? "" : notebookName,tags: options.showTags === false ? [] : memo.tags,updatedAt: options.showUpdatedAt === false ? "" : new Date(memo.updatedAt).toLocaleString(resolvedLocale),- theme: options.theme ?? "slate",+ theme: options.theme ?? "aurora",fontStyle: options.fontStyle ?? "serif",fontSize: options.fontSize ?? "lg",cardWidth: options.cardWidth ?? "standard",diff --git a/apps/web/src/components/dialogs/ShareNoteImageDialog.tsx b/apps/web/src/components/dialogs/ShareNoteImageDialog.tsxindex 96746fda..612434a0 100644--- a/apps/web/src/components/dialogs/ShareNoteImageDialog.tsx+++ b/apps/web/src/components/dialogs/ShareNoteImageDialog.tsx@@ -35,7 +35,6 @@ const THEME_OPTIONS: Array<{dotColor: string;isDark?: boolean;}> = [- { id: "slate", previewBg: "linear-gradient(135deg, #f8fafc, #e2e8f0)", dotColor: "#16a06e" },{ id: "aurora", previewBg: "linear-gradient(135deg, #a7f3d0, #67e8f9, #c4b5fd)", dotColor: "#0d9488" },{ id: "sunset", previewBg: "linear-gradient(135deg, #fde68a, #fbcfe8, #fed7aa)", dotColor: "#ea580c" },{ id: "midnight", previewBg: "linear-gradient(135deg, #090d16, #1e1b4b)", dotColor: "#34d399", isDark: true },@@ -74,7 +73,7 @@ export const ShareNoteImageDialog = ({}) => {const { t } = useTranslation();const [format, setFormat] = useState<NoteImageFormat>("png");- const [theme, setTheme] = useState<NoteImageTheme>("slate");+ const [theme, setTheme] = useState<NoteImageTheme>("aurora");const [fontStyle, setFontStyle] = useState<NoteImageFontStyle>("serif");const [fontSize, setFontSize] = useState<NoteImageFontSize>("lg");const [cardWidth, setCardWidth] = useState<NoteImageCardWidth>("standard");@@ -93,7 +92,7 @@ export const ShareNoteImageDialog = ({useEffect(() => {if (!open) return;setFormat("png");- setTheme("slate");+ setTheme("aurora");setFontStyle("serif");setFontSize("lg");setCardWidth("standard");@@ -446,4 +445,3 @@ export const ShareNoteImageDialog = ({</Dialog>);};-diff --git a/packages/shared/src/i18n/en-US.ts b/packages/shared/src/i18n/en-US.tsindex e6e250a8..2f1f55be 100644--- a/packages/shared/src/i18n/en-US.ts+++ b/packages/shared/src/i18n/en-US.ts@@ -2168,7 +2168,6 @@ export const enUS = {theme: "Theme",background: "Background",themes: {- slate: "Classic Light",aurora: "Aurora",sunset: "Sunset",midnight: "Midnight",diff --git a/packages/shared/src/i18n/ja.ts b/packages/shared/src/i18n/ja.tsindex 89022afb..ce0d0491 100644--- a/packages/shared/src/i18n/ja.ts+++ b/packages/shared/src/i18n/ja.ts@@ -2168,7 +2168,6 @@ export const ja = {theme: "テーマ",background: "背景",themes: {- slate: "クラシックライト",aurora: "オーロラ",sunset: "夕焼け",midnight: "ミッドナイト",diff --git a/packages/shared/src/i18n/pl.ts b/packages/shared/src/i18n/pl.tsindex 403e2077..eb850181 100644--- a/packages/shared/src/i18n/pl.ts+++ b/packages/shared/src/i18n/pl.ts@@ -2168,7 +2168,6 @@ export const pl = {theme: "Motyw",background: "Tło",themes: {- slate: "Klasyczny jasny",aurora: "Zorza",sunset: "Zachód słońca",midnight: "Północ",diff --git a/packages/shared/src/i18n/zh-CN.ts b/packages/shared/src/i18n/zh-CN.tsindex a683bbe9..314cc438 100644--- a/packages/shared/src/i18n/zh-CN.ts+++ b/packages/shared/src/i18n/zh-CN.ts@@ -2166,7 +2166,6 @@ export const zhCN = {theme: "主题风格",background: "背景",themes: {- slate: "经典浅色",aurora: "极光渐变",sunset: "暮色晚霞",midnight: "暗夜曜石",diff --git a/packages/shared/src/note-image-card.test.mjs b/packages/shared/src/note-image-card.test.mjsindex bb6622af..9a93939b 100644--- a/packages/shared/src/note-image-card.test.mjs+++ b/packages/shared/src/note-image-card.test.mjs@@ -13,10 +13,10 @@ describe("note-image-card shared module", () => {expect(resolveTheme(undefined, "notepad")).toBe("notepad");expect(resolveTheme(undefined, "xuan")).toBe("xuan");expect(resolveTheme("warm", undefined)).toBe("sunset");- expect(resolveTheme(undefined, undefined)).toBe("slate");+ expect(resolveTheme(undefined, undefined)).toBe("aurora");});- test("contains all 8 curated themes with valid colors", () => {+ test("retains valid colors for current themes and legacy slate exports", () => {const expectedThemes = ["slate", "aurora", "sunset", "midnight", "mint", "lavender", "notepad", "xuan"];for (const theme of expectedThemes) {expect(NOTE_IMAGE_THEMES[theme]).toBeDefined();diff --git a/packages/shared/src/note-image-card.ts b/packages/shared/src/note-image-card.tsindex 2475e8c6..88ed6166 100644--- a/packages/shared/src/note-image-card.ts+++ b/packages/shared/src/note-image-card.ts@@ -317,7 +317,7 @@ export const resolveTheme = (background?: NoteImageBackground, theme?: NoteImageif (theme && NOTE_IMAGE_THEMES[theme]) return theme;if (background === "warm") return "sunset";if (background && NOTE_IMAGE_THEMES[background as NoteImageTheme]) return background as NoteImageTheme;- return "slate";+ return "aurora";};export const buildImageExportBasename = (title: string, fallback: string) => {@@ -345,7 +345,7 @@ export const buildNoteImageCardMarkup = ({tags = [],updatedAt = "",bodyHtml,- theme = "slate",+ theme = "aurora",fontStyle = "serif",showTitle = true,showNotebook = false,@@ -442,7 +442,7 @@ export const buildNoteImageCardMarkup = ({};export const generateCardCss = ({- theme = "slate",+ theme = "aurora",fontStyle = "serif",fontSize = "lg",cardWidth = "standard",@@ -452,7 +452,7 @@ export const generateCardCss = ({fontSize: NoteImageFontSize;cardWidth: NoteImageCardWidth;}) => {- const themeCfg = NOTE_IMAGE_THEMES[theme] || NOTE_IMAGE_THEMES.slate;+ const themeCfg = NOTE_IMAGE_THEMES[theme] || NOTE_IMAGE_THEMES.aurora;const fontFam = NOTE_IMAGE_FONT_FAMILIES[fontStyle] || NOTE_IMAGE_FONT_FAMILIES.sans;const sizeCfg = NOTE_IMAGE_FONT_SIZES[fontSize] || NOTE_IMAGE_FONT_SIZES.md;const widthPx = NOTE_IMAGE_CARD_WIDTH_PIXELS[cardWidth] || 680;