webui: fix syntax highlighting lost after streaming for non-common languages (#21206)

* webui: fix syntax highlighting lost for non-common languages after streaming

rehype-highlight uses lowlight internally, which only bundles 37 "common"
languages. The streaming code path uses highlight.js directly (192 languages),
so languages like Haskell highlight correctly while streaming but lose all
color once the code block closes. Pass the full lowlight language set to
rehype-highlight so both paths support the same languages.

* webui: rebuild static files after rebase
This commit is contained in:
Hamish M. Blair authored and GitHub committed 2026-04-08 08:58:08 +02:00
1 parent 5c4aae66e1
commit 97508acb17
3 files changed
+166 -159

No files matched your search

+163 -158
View File
@@ -1,188 +1,188 @@
var j6=r=>{throw TypeError(r)};var rS=(r,e,t)=>e.has(r)||j6("Cannot "+t);var ma=(r,e,t)=>(rS(r,e,"read from private field"),t?t.call(r):e.get(r)),ml=(r,e,t)=>e.has(r)?j6("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),gs=(r,e,t,n)=>(rS(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t),gl=(r,e,t)=>(rS(r,e,"access private method"),t);var K6=(r,e,t,n)=>({set _(a){gs(r,e,a,t)},get _(){return ma(r,e,n)}});var zm=Array.isArray,yY=Array.prototype.indexOf,yf=Array.prototype.includes,Qb=Array.from,qA=Object.defineProperty,Cu=Object.getOwnPropertyDescriptor,$L=Object.getOwnPropertyDescriptors,GL=Object.prototype,SY=Array.prototype,Zb=Object.getPrototypeOf,X6=Object.isExtensible;function Ph(r){return typeof r=="function"}const $e=()=>{};function EY(r){return r()}function EC(r){for(var e=0;e<r.length;e++)r[e]()}function zL(){var r,e,t=new Promise((n,a)=>{r=n,e=a});return{promise:t,resolve:r,reject:e}}function wY(r,e,t=!1){return r===void 0?t?e():e:r}function HA(r,e){if(Array.isArray(r))return r;if(!(Symbol.iterator in r))return Array.from(r);const t=[];for(const n of r)if(t.push(n),t.length===e)break;return t}const si=2,hm=4,qm=8,VA=1<<24,ql=16,Wc=32,Vu=64,YA=128,Ao=512,qi=1024,Vi=2048,jc=4096,ro=8192,Cc=16384,Hm=32768,Fl=65536,wC=1<<17,WA=1<<18,rh=1<<19,qL=1<<20,Ec=1<<25,Wd=32768,TC=1<<21,jA=1<<22,Au=1<<23,kl=Symbol("$state"),KA=Symbol("legacy props"),TY=Symbol(""),jh=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},CY=1,Jb=3,Kc=8;function HL(r){throw new Error("https://svelte.dev/e/experimental_async_required")}function Vf(r){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function AY(){throw new Error("https://svelte.dev/e/missing_context")}function xY(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function RY(r){throw new Error("https://svelte.dev/e/effect_in_teardown")}function OY(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function NY(r){throw new Error("https://svelte.dev/e/effect_orphan")}function IY(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function kY(){throw new Error("https://svelte.dev/e/fork_discarded")}function MY(){throw new Error("https://svelte.dev/e/fork_timing")}function DY(){throw new Error("https://svelte.dev/e/get_abort_signal_outside_reaction")}function PY(){throw new Error("https://svelte.dev/e/hydration_failed")}function VL(r){throw new Error("https://svelte.dev/e/lifecycle_legacy_only")}function LY(r){throw new Error("https://svelte.dev/e/props_invalid_value")}function FY(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function BY(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function UY(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function $Y(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const GY=1,zY=2,YL=4,qY=8,HY=16,VY=1,YY=2,WY=4,jY=8,KY=16,XY=1,QY=2,ZY=4,JY=1,eW=2,WL="[",ev="[!",XA="]",jd={},pi=Symbol(),tW="http://www.w3.org/1999/xhtml",rW="http://www.w3.org/2000/svg",jL="@attach";function nW(r){console.warn("https://svelte.dev/e/hydratable_missing_but_expected")}function Vm(r){console.warn("https://svelte.dev/e/hydration_mismatch")}function aW(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function iW(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}let Or=!1;function ss(r){Or=r}let en;function $a(r){if(r===null)throw Vm(),jd;return en=r}function No(){return $a(oo(en))}function V(r){if(Or){if(oo(en)!==null)throw Vm(),jd;en=r}}function et(r=1){if(Or){for(var e=r,t=en;e--;)t=oo(t);en=t}}function M_(r=!0){for(var e=0,t=en;;){if(t.nodeType===Kc){var n=t.data;if(n===XA){if(e===0)return t;e-=1}else(n===WL||n===ev)&&(e+=1)}var a=oo(t);r&&t.remove(),t=a}}function KL(r){if(!r||r.nodeType!==Kc)throw Vm(),jd;return r.data}function XL(r){return r===this.v}function QA(r,e){return r!=r?e==e:r!==e||r!==null&&typeof r=="object"||typeof r=="function"}function QL(r){return!QA(r,this.v)}let Yf=!1;function sW(){Yf=!0}const oW=[];function rf(r,e=!1,t=!1){return m_(r,new Map,"",oW,null,t)}function m_(r,e,t,n,a=null,i=!1){if(typeof r=="object"&&r!==null){var s=e.get(r);if(s!==void 0)return s;if(r instanceof Map)return new Map(r);if(r instanceof Set)return new Set(r);if(zm(r)){var o=Array(r.length);e.set(r,o),a!==null&&e.set(a,o);for(var l=0;l<r.length;l+=1){var c=r[l];l in r&&(o[l]=m_(c,e,t,n,null,i))}return o}if(Zb(r)===GL){o={},e.set(r,o),a!==null&&e.set(a,o);for(var u in r)o[u]=m_(r[u],e,t,n,null,i);return o}if(r instanceof Date)return structuredClone(r);if(typeof r.toJSON=="function"&&!i)return m_(r.toJSON(),e,t,n,r)}if(r instanceof EventTarget)return r;try{return structuredClone(r)}catch{return r}}let $n=null;function Sf(r){$n=r}function lW(){const r={};return[()=>(tv(r)||AY(),Bl(r)),e=>Yu(r,e)]}function Bl(r){return rv().get(r)}function Yu(r,e){return rv().set(r,e)Line truncated
`).some(o=>o.startsWith("https://svelte.dev/e/")))throw s;return s!==jd&&console.warn("Failed to hydrate: ",s),e.recover===!1&&PY(),OC(),r5(t),ss(!1),ov(r,e)}finally{ss(n),$a(a)}}const wh=new Map;function BF(r,{target:e,anchor:t,props:n={},events:a,context:i,intro:s=!0}){OC();var o=new Set,l=d=>{for(var h=0;h<d.length;h++){var p=d[h];if(!o.has(p)){o.add(p);var m=FW(p);e.addEventListener(p,Up,{passive:m});var g=wh.get(p);g===void 0?(document.addEventListener(p,Up,{passive:m}),wh.set(p,1)):wh.set(p,g+1)}}};l(Qb(LF)),IC.add(l);var c=void 0,u=CW(()=>{var d=t??e.appendChild(Hi());return mW(d,{pending:()=>{}},h=>{if(i){Ee({});var p=$n;p.c=i}if(a&&(n.$$events=a),Or&&Is(h,null),L_=s,c=r(h,n)||{},L_=!0,Or&&(Pn.nodes.end=en,en===null||en.nodeType!==Kc||en.data!==XA))throw Vm(),jd;i&&we()}),()=>{for(var h of o){e.removeEventListener(h,Up);var p=wh.get(h);--p===0?(document.removeEventListener(h,Up),wh.delete(h)):wh.set(h,p)}IC.delete(l),d!==t&&d.parentNode?.removeChild(d)}});return kC.set(c,u),c}let kC=new WeakMap;function o5(r,e){const t=kC.get(r);return t?(kC.delete(r),t(e)):Promise.resolve()}class Qm{anchor;#e=new Map;#t=new Map;#r=new Map;#n=new Set;#i=!0;constructor(e,t=!0){this.anchor=e,this.#i=t}#a=()=>{var e=Hn;if(this.#e.has(e)){var t=this.#e.get(e),n=this.#t.get(t);if(n)a5(n),this.#n.delete(t);else{var a=this.#r.get(t);a&&(this.#t.set(t,a.effect),this.#r.delete(t),a.fragment.lastChild.remove(),this.anchor.before(a.fragment),n=a.effect)}for(const[i,s]of this.#e){if(this.#e.delete(i),i===e)break;const o=this.#r.get(s);o&&(_i(o.effect),this.#r.delete(s))}for(const[i,s]of this.#t){if(i===t||this.#n.has(i))continue;const o=()=>{if(Array.from(this.#e.values()).includes(i)){var c=document.createDocumentFragment();xF(s,c),c.append(Hi()),this.#r.set(i,{effect:s,fragment:c})}else _i(s);this.#n.delete(i),this.#t.delete(i)};this.#i||!n?(this.#n.add(i),Vd(s,o,!1)):o()}}};#s=e=>{this.#e.delete(e);const t=Array.from(this.#e.values());for(const[n,a]of this.#r)t.includes(n)||(_i(a.effect),this.#r.delete(n))};ensure(e,t){var n=Hn,a=pF();if(t&&!this.#t.has(e)&&!this.#r.has(e))if(a){var i=document.createDocumentFragment(),s=Hi();i.append(s),this.#r.set(e,{effect:As(()=>t(s)),fragment:i})}else this.#t.set(e,As(()=>t(this.anchor)));if(this.#e.set(n,e),a){for(const[o,l]of this.#t)o===e?n.skipped_effects.delete(l):n.skipped_effects.add(l);for(const[o,l]of this.#r)o===e?n.skipped_effects.delete(l.effect):n.skipped_effects.add(l.effect);n.oncommit(this.#a),n.ondiscard(this.#s)}else Or&&(this.anchor=en),this.#a()}}function le(r,e,t=!1){Or&&No();var n=new Qm(r),a=t?Fl:0;function i(s,o){if(Or){const c=KL(r)===ev;if(s===c){var l=M_();$a(l),n.anchor=l,ss(!1),n.ensure(s,o),ss(!0);return}}n.ensure(s,o)}ju(()=>{var s=!1;e((o,l=!0)=>{s=!0,i(l,o)}),s||i(!1,null)},a)}function GW(r,e,t){Or&&No();var n=new Qm(r),a=!Wf();ju(()=>{var i=e();a&&i!==null&&typeof i=="object"&&(i={}),n.ensure(i,t)})}function Ru(r,e){return e}function zW(r,e,t){for(var n=[],a=e.length,i,s=e.length,o=0;o<a;o++){let d=e[o];Vd(d,()=>{if(i){if(i.pending.delete(d),i.done.add(d),i.pending.size===0){var h=r.outrogroups;MC(Qb(i.done)),h.delete(i),h.size===0&&(r.outrogroups=null)}}else s-=1},!1)}if(s===0){var l=n.length===0&&t!==null;if(l){var c=t,u=c.parentNode;r5(u),u.append(c),r.items.clear()}MC(e,!l)}else i={pending:new Set(e),done:new Set},(r.outrogroups??=new Set).add(i)}function MC(r,e=!0){for(var t=0;t<r.length;t++)_i(r[t],e)}var nR;function Ir(r,e,t,n,a,i=null){var s=r,o=new Map,l=(e&YL)!==0;if(l){var c=r;s=Or?$a(Ni(c)):c.appendChild(Hi())}Or&&No();var u=null,d=av(()=>{var _=t();return zm(_)?_:_==null?[]:Qb(_)}),h,p=!0;function m(){b.fallback=u,qW(b,h,s,e,n),u!==null&&(h.length===0?(u.f&Ec)===0?a5(u):(u.f^=Ec,$p(u,null,s)):Vd(u,()=>{u=null}))}var g=ju(()=>{h=f(d);var _=h.length;let v=!1;if(Or){var y=KL(s)===ev;y!==(_===0)&&(s=M_(),$a(s),ss(!1),v=!0)}for(var E=new Set,S=Hn,w=pF(),C=0;C<_;C+=1){Or&&en.nodeType===Kc&&en.data===XA&&(s=en,v=!0,ss(!1));var x=h[C],N=n(x,C),I=p?null:o.get(N);I?(I.v&&wf(I.v,x),I.i&&wf(I.i,C),w&&S.skipped_effects.delete(I.e)):(I=HW(o,p?s:nR??=Hi(),x,N,C,a,e,t),p||(I.e.f|=Ec),o.set(N,I)),E.add(N)}if(_===0&&i&&!u&&(p?u=As(()=>i(s)):(u=As(()=>i(nR??=Hi())),u.f|=Ec)),Or&&_>0&&$a(M_()),!p)if(w){for(const[D,H]of o)E.has(D)||S.skipped_effects.add(H.e);S.oncommit(m),S.ondiscard(()=>{})}else m();v&&ss(!0),f(d)}),b={effect:g,items:o,outrogroups:null,fallback:u};p=!1,Or&&(s=en)}function qW(r,e,t,n,a){var i=(n&qY)!==0,s=e.length,o=r.items,l=r.effect.first,c,u=null,d,h=[],p=[],m,g,b,_;if(i)for(_=0;_<s;_+=1)m=e[_],g=a(m,_),b=o.get(g).e,(b.f&Ec)===0&&(b.nodes?.a?.measure(),(d??=new Set).add(b));for(_=0;_<s;_+=1){if(m=e[_],g=a(m,_),b=o.get(g).e,r.outrogroups!==null)for(const I of r.outrogroups)I.pending.delete(b),I.done.delete(b);if((b.f&Ec)!==0)if(b.f^=Ec,b===l)$p(b,null,t);else{var v=u?u.next:l;b===r.effect.last&&(r.effect.last=b.prev),b.prev&&(b.prev.next=b.next),b.next&&(b.next.prev=b.prev),ou(r,u,b),ou(r,b,v),$p(b,v,t),u=b,h=[],p=[],l=u.next;continue}if((b.f Line truncated
\r\f \v\uFEFF`];function QW(r,e,t){var n=r==null?"":""+r;if(e&&(n=n?n+" "+e:e),t){for(var a in t)if(t[a])n=n?n+" "+a:a;else if(n.length)for(var i=a.length,s=0;(s=n.indexOf(a,s))>=0;){var o=s+i;(s===0||iR.includes(n[s-1]))&&(o===n.length||iR.includes(n[o]))?n=(s===0?"":n.substring(0,s))+n.substring(o+1):s=o}}return n===""?null:n}function sR(r,e=!1){var t=e?" !important;":";",n="";for(var a in r){var i=r[a];i!=null&&i!==""&&(n+=" "+a+": "+i+t)}return n}function nS(r){return r[0]!=="-"||r[1]!=="-"?r.toLowerCase():r}function ZW(r,e){if(e){var t="",n,a;if(Array.isArray(e)?(n=e[0],a=e[1]):n=e,r){r=String(r).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var i=!1,s=0,o=!1,l=[];n&&l.push(...Object.keys(n).map(nS)),a&&l.push(...Object.keys(a).map(nS));var c=0,u=-1;const g=r.length;for(var d=0;d<g;d++){var h=r[d];if(o?h==="/"&&r[d-1]==="*"&&(o=!1):i?i===h&&(i=!1):h==="/"&&r[d+1]==="*"?o=!0:h==='"'||h==="'"?i=h:h==="("?s++:h===")"&&s--,!o&&i===!1&&s===0){if(h===":"&&u===-1)u=d;else if(h===";"||d===g-1){if(u!==-1){var p=nS(r.substring(c,u).trim());if(!l.includes(p)){h!==";"&&d++;var m=r.substring(c,d).trim();t+=" "+m+";"}}c=d+1,u=-1}}}}return n&&(t+=sR(n)),a&&(t+=sR(a,!0)),t=t.trim(),t===""?null:t}return r==null?null:String(r)}function yt(r,e,t,n,a,i){var s=r.__className;if(Or||s!==t||s===void 0){var o=QW(t,n,i);(!Or||o!==r.getAttribute("class"))&&(o==null?r.removeAttribute("class"):e?r.className=o:r.setAttribute("class",o)),r.__className=t}else if(i&&a!==i)for(var l in i){var c=!!i[l];(a==null||c!==!!a[l])&&r.classList.toggle(l,c)}return i}function aS(r,e={},t,n){for(var a in t){var i=t[a];e[a]!==i&&(t[a]==null?r.style.removeProperty(a):r.style.setProperty(a,i,n))}}function ds(r,e,t,n){var a=r.__style;if(Or||a!==e){var i=ZW(e,n);(!Or||i!==r.getAttribute("style"))&&(i==null?r.removeAttribute("style"):r.style.cssText=i),r.__style=e}else n&&(Array.isArray(n)?(aS(r,t?.[0],n[0]),aS(r,t?.[1],n[1],"important")):aS(r,t,n));return n}function PC(r,e,t=!1){if(r.multiple){if(e==null)return;if(!zm(e))return aW();for(var n of r.options)n.selected=e.includes(oR(n));return}for(n of r.options){var a=oR(n);if(SW(a,e)){n.selected=!0;return}}(!t||e!==void 0)&&(r.selectedIndex=-1)}function JW(r){var e=new MutationObserver(()=>{PC(r,r.__value)});e.observe(r,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),ah(()=>{e.disconnect()})}function oR(r){return"__value"in r?r.__value:r.value}const _p=Symbol("class"),Lh=Symbol("style"),zF=Symbol("is custom element"),qF=Symbol("is html");function ej(r){if(Or){var e=!1,t=()=>{if(!e){if(e=!0,r.hasAttribute("value")){var n=r.value;er(r,"value",null),r.value=n}if(r.hasAttribute("checked")){var a=r.checked;er(r,"checked",null),r.checked=a}}};r.__on_r=t,xo(t),mF()}}function c5(r,e){var t=u5(r);t.value===(t.value=e??void 0)||r.value===e&&(e!==0||r.nodeName!=="PROGRESS")||(r.value=e??"")}function tj(r,e){e?r.hasAttribute("selected")||r.setAttribute("selected",""):r.removeAttribute("selected")}function er(r,e,t,n){var a=u5(r);Or&&(a[e]=r.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&r.nodeName==="LINK")||a[e]!==(a[e]=t)&&(e==="loading"&&(r[TY]=t),t==null?r.removeAttribute(e):typeof t!="string"&&HF(r).includes(e)?r[e]=t:r.setAttribute(e,t))}function rj(r,e,t,n,a=!1,i=!1){if(Or&&a&&r.tagName==="INPUT"){var s=r,o=s.type==="checkbox"?"defaultChecked":"defaultValue";o in t||ej(s)}var l=u5(r),c=l[zF],u=!l[qF];let d=Or&&c;d&&ss(!1);var h=e||{},p=r.tagName==="OPTION";for(var m in e)m in t||(t[m]=null);t.class?t.class=qr(t.class):(n||t[_p])&&(t.class=null),t[Lh]&&(t.style??=null);var g=HF(r);for(const w in t){let C=t[w];if(p&&w==="value"&&C==null){r.value=r.__value="",h[w]=C;continue}if(w==="class"){var b=r.namespaceURI==="http://www.w3.org/1999/xhtml";yt(r,b,C,n,e?.[_p],t[_p]),h[w]=C,h[_p]=t[_p];continue}if(w==="style"){ds(r,C,e?.[Lh],t[Lh]),h[w]=C,h[Lh]=t[Lh];continue}var _=h[w];if(!(C===_&&!(C===void 0&&r.hasAttribute(w)))){h[w]=C;var v=w[0]+w[1];if(v!=="$$")if(v==="on"){const x={},N="$$"+w;let I=w.slice(2);var y=MW(I);if(IW(I)&&(I=I.slice(0,-7),x.capture=!0),!y&&_){if(C!=null)continue;r.removeEventListener(I,h[N],x),h[N]=null}if(C!=null)if(y)r[`__${I}`]=C,Ln([I]);else{let D=function(H){h[w].call(this,H)};h[N]=s5(I,r,D,x)}else y&&(r[`__${I}`]=void 0)}else if(w==="style")er(r,w,C);else if(w==="autofocus")EW(r,!!C);else if(!c&&(w==="__value"||w==="value"&&C!=null))r.value=r.__value=C;else if(w==="selected"&&p)tj(r,C);else{var E=w;u||(E=PW(E));var S=E==="defaultValue"||E==="defaultChecked";if(C==null&&!c&&!S)if(l[w]=null,E==="value"||E==="checked"){let x=r;const N=e===void 0;if(E==="value"){let I=x.defaultValue;x.removeAttribute(E),x.defaultValue=I,x.value=x.__value=N?I:null}else{let I=x.defaultChecked;x.removeAttribute(E),x.defaultChecked=I,x.checked=N?I:!1}}else r.removeAttribute(w);else S||g.includes(E)&&(c||typeof C!="string")?(r[E]=C,E in l&&(l[E]=pi)):typeof C!="function"&&er(r,E,C)}}}return d&&ss(!0),h}function zt(r,e,t=[],n=[],a=[],i,s=!1,o=!1){JA(a,t,n,l=>{var c=void 0,u={},d=r.nodeName= Line truncated
`,c="/",u="*",d="",h="comment",p="declaration";fS=function(g,b){if(typeof g!="string")throw new TypeError("First argument must be a string");if(!g)return[];b=b||{};var _=1,v=1;function y(q){var $=q.match(e);$&&(_+=$.length);var K=q.lastIndexOf(l);v=~K?q.length-K:v+q.length}function E(){var q={line:_,column:v};return function($){return $.position=new S(q),x(),$}}function S(q){this.start=q,this.end={line:_,column:v},this.source=b.source}S.prototype.content=g;function w(q){var $=new Error(b.source+":"+_+":"+v+": "+q);if($.reason=q,$.filename=b.source,$.line=_,$.column=v,$.source=g,!b.silent)throw $}function C(q){var $=q.exec(g);if($){var K=$[0];return y(K),g=g.slice(K.length),$}}function x(){C(t)}function N(q){var $;for(q=q||[];$=I();)$!==!1&&q.push($);return q}function I(){var q=E();if(!(c!=g.charAt(0)||u!=g.charAt(1))){for(var $=2;d!=g.charAt($)&&(u!=g.charAt($)||c!=g.charAt($+1));)++$;if($+=2,d===g.charAt($-1))return w("End of comment missing");var K=g.slice(2,$-2);return v+=2,y(K),g=g.slice($),v+=2,q({type:h,comment:K})}}function D(){var q=E(),$=C(n);if($){if(I(),!C(a))return w("property missing ':'");var K=C(i),z=q({type:p,property:m($[0].replace(r,d)),value:K?m(K[0].replace(r,d)):d});return C(s),z}}function H(){var q=[];N(q);for(var $;$=D();)$!==!1&&(q.push($),N(q));return q}return x(),H()};function m(g){return g?g.replace(o,d):d}return fS}var AR;function CX(){if(AR)return xh;AR=1;var r=xh&&xh.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(xh,"__esModule",{value:!0}),xh.default=t;var e=r(TX());function t(n,a){var i=null;if(!n||typeof n!="string")return i;var s=(0,e.default)(n),o=typeof a=="function";return s.forEach(function(l){if(l.type==="declaration"){var c=l.property,u=l.value;o?a(c,u,l):u&&(i=i||{},i[c]=u)}}),i}return xh}var AX=CX();const xR=sh(AX),xX=xR.default||xR,RX=/\d/,OX=["-","_","/","."];function NX(r=""){if(!RX.test(r))return r!==r.toLowerCase()}function IX(r){const e=[];let t="",n,a;for(const i of r){const s=OX.includes(i);if(s===!0){e.push(t),t="",n=void 0;continue}const o=NX(i);if(a===!1){if(n===!1&&o===!0){e.push(t),t=i,n=o;continue}if(n===!0&&o===!1&&t.length>1){const l=t.at(-1);e.push(t.slice(0,Math.max(0,t.length-1))),t=l+i,n=o;continue}}t+=i,n=o,a=s}return e.push(t),e}function IB(r){return r?IX(r).map(e=>MX(e)).join(""):""}function kX(r){return DX(IB(r||""))}function MX(r){return r?r[0].toUpperCase()+r.slice(1):""}function DX(r){return r?r[0].toLowerCase()+r.slice(1):""}function qp(r){if(!r)return{};const e={};function t(n,a){if(n.startsWith("-moz-")||n.startsWith("-webkit-")||n.startsWith("-ms-")||n.startsWith("-o-")){e[IB(n)]=a;return}if(n.startsWith("--")){e[n]=a;return}e[kX(n)]=a}return xX(r,t),e}function Ac(...r){return(...e)=>{for(const t of r)typeof t=="function"&&t(...e)}}function PX(r,e){const t=RegExp(r,"g");return n=>{if(typeof n!="string")throw new TypeError(`expected an argument of type string, but got ${typeof n}`);return n.match(t)?n.replace(t,e):n}}const LX=PX(/[A-Z]/,r=>`-${r.toLowerCase()}`);function FX(r){if(!r||typeof r!="object"||Array.isArray(r))throw new TypeError(`expected an argument of type object, but got ${typeof r}`);return Object.keys(r).map(e=>`${LX(e)}: ${r[e]};`).join(`
`)}function k5(r={}){return FX(r).replace(`
`," ")}const BX=["onabort","onanimationcancel","onanimationend","onanimationiteration","onanimationstart","onauxclick","onbeforeinput","onbeforetoggle","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncompositionend","oncompositionstart","oncompositionupdate","oncontextlost","oncontextmenu","oncontextrestored","oncopy","oncuechange","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onfocusin","onfocusout","onformdata","ongotpointercapture","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onlostpointercapture","onmousedown","onmouseenter","onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onpaste","onpause","onplay","onplaying","onpointercancel","onpointerdown","onpointerenter","onpointerleave","onpointermove","onpointerout","onpointerover","onpointerup","onprogress","onratechange","onreset","onresize","onscroll","onscrollend","onsecuritypolicyviolation","onseeked","onseeking","onselect","onselectionchange","onselectstart","onslotchange","onstalled","onsubmit","onsuspend","ontimeupdate","ontoggle","ontouchcancel","ontouchend","ontouchmove","ontouchstart","ontransitioncancel","ontransitionend","ontransitionrun","ontransitionstart","onvolumechange","onwaiting","onwebkitanimationend","onwebkitanimationiteration","onwebkitanimationstart","onwebkittransitionend","onwheel"],UX=new Set(BX);function $X(r){return UX.has(r)}function vr(...r){const e={...r[0]};for(let t=1;t<r.length;t++){const n=r[t];if(n){for(const a of Object.keys(n)){const i=e[a],s=n[a],o=typeof i=="function",l=typeof s=="function";if(o&&$X(a)){const c=i,u=s;e[a]=NB(c,u)}else if(o&&l)e[a]=Ac(i,s);else if(a==="class"){const c=jC(i),u=jC(s);c&&u?e[a]=tm(i,s):c?e[a]=tm(i):u&&(e[a]=tm(s))}else if(a==="style"){const c=typeof i=="object",u=typeof s=="object",d=typeof i=="string",h=typeof s=="string";if(c&&u)e[a]={...i,...s};else if(c&&h){const p=qp(s);e[a]={...i,...p}}else if(d&&u){const p=qp(i);e[a]={...p,...s}}else if(d&&h){const p=qp(i),m=qp(s);e[a]={...p,...m}}else c?e[a]=i:u?e[a]=s:d?e[a]=i:h&&(e[a]=s)}else e[a]=s!==void 0?s:i}for(const a of Object.getOwnPropertySymbols(n)){const i=e[a],s=n[a];e[a]=s!==void 0?s:i}}}return typeof e.style=="object"&&(e.style=k5(e.style).replaceAll(`
`," ")),e.hidden===!1&&(e.hidden=void 0,delete e.hidden),e.disabled===!1&&(e.disabled=void 0,delete e.disabled),e}const GX={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",transform:"translateX(-100%)"},zX=k5(GX),kB=typeof window<"u"?window:void 0;function qX(r){let e=r.activeElement;for(;e?.shadowRoot;){const t=e.shadowRoot.activeElement;if(t===e)break;e=t}return e}var HX=["forEach","isDisjointFrom","isSubsetOf","isSupersetOf"],VX=["difference","intersection","symmetricDifference","union"],RR=!1;class ls extends Set{#e=new Map;#t=_e(0);#r=_e(0);#n=Jo||-1;constructor(e){if(super(),e){for(var t of e)super.add(t);this.#r.v=super.size}RR||this.#a()}#i(e){return Jo===this.#n?_e(e):Mc(e)}#a(){RR=!0;var e=ls.prototype,t=Set.prototype;for(const n of HX)e[n]=function(...a){return f(this.#t),t[n].apply(this,a)};for(const n of VX)e[n]=function(...a){f(this.#t);var i=t[n].apply(this,a);return new ls(i)}}has(e){var t=super.has(e),n=this.#e,a=n.get(e);if(a===void 0){if(!t)return f(this.#t),!1;a=this.#i(!0),n.set(e,a)}return f(a),t}add(e){return super.has(e)||(super.add(e),M(this.#r,super.size),Qs(this.#t)),this}delete(e){var t=super.delete(e),n=this.#e,a=n.get(e);return a!==void 0&&(n.delete(e),M(a,!1)),t&&(M(this.#r,super.size),Qs(this.#t)),t}clear(){if(super.size!==0){super.clear();var e=this.#e;for(var t of e.values())M(t,!1);e.clear(),M(this.#r,0),Qs(this.#t)}}keys(){return this.values()}values(){return f(this.#t),super.values()}entries(){return f(this.#t),super.entries()}[Symbol.iterator](){return this.keys()}get size(){return f(this.#r)}}class Oi extends Map{#e=new Map;#t=_e(0);#r=_e(0);#n=Jo||-1;constructor(e){if(super(),e){for(var[t,n]of e)super.set(t,n);this.#r.v=super.size}}#i(e){return Jo===this.#n?_e(e):Mc(e)}has(e){var t=this.#e,n=t.get(e);if(n===void 0){var a=super.get(e);if(a!==void 0)n=this.#i(0),t.set(e,n);else return f(this.#t),!1}return f(n),!0}forEach(e,t){this.#a(),super.forEach(e,t)}get(e){var t=this.#e,n=t.get(e);if(n===void 0){var a=super.get(e);if(a!==void 0)n=this.#i(0),t.set(e,n);else{f(this.#t);return}}return f(n),super.get(e)}set(e,t){var n=this.#e,a=n.get(e),i=super.get(e),s=super.set(e,t),o=this.#t;if(a===void 0)a=this.#i(0),n.set(e,a),M(this.#r,super.size),Qs(o);else if(i!==t){Qs(a);var l=o.reactions===null?null:new Set(o.reactions),c=l===null||!a.reactions?.every(u=>l.has(u));c&&Qs(o)}return s}delete(e){var t=this.#e,n=t.get(e),a=super.delete(e);return n!==void 0&&(t.delete(e),M(this.#r,super.size),M(n,-1),Qs(this.#t)),a}clear(){if(super.size!==0){super.clear();var e=this.#e;M(this.#r,0);for(var t of e.values())M(t,-1);Qs(this.#t),e.clear()}}#a(){f(this.#t);var e=this.#e;if(this.#r.v!==e.size){for(var t of super.keys())if(!e.has(t)){var n=this.#i(0);e.set(t,n)}}for([,n]of this.#e)f(n)}keys(){return f(this.#t),super.keys()}values(){return this.#a(),super.values()}entries(){return this.#a(),super.entries()}[Symbol.iterator](){return this.entries()}get size(){return f(this.#r),super.size}}class YX{#e;#t;constructor(e,t){this.#e=e,this.#t=Wu(t)}get current(){return this.#t(),this.#e()}}const WX=/\(.+\)/,jX=new Set(["all","print","screen","and","or","not","only"]);class MB extends YX{constructor(e,t){let n=WX.test(e)||e.split(/[\s,]+/).some(i=>jX.has(i.trim()))?e:`(${e})`;const a=window.matchMedia(n);super(()=>a.matches,i=>jr(a,"change",i))}}let KX=class{#e;#t;constructor(e={}){const{window:t=kB,document:n=t?.document}=e;t!==void 0&&(this.#e=n,this.#t=Wu(a=>{const i=jr(t,"focusin",a),s=jr(t,"focusout",a);return()=>{i(),s()}}))}get current(){return this.#t?.(),this.#e?qX(this.#e):null}};new KX;function DB(r){return typeof r=="function"}function XX(r,e){if(DB(r)){const n=r();return n===void 0?e:n}return r===void 0?e:r}let ka=class{#e;#t;constructor(e){this.#e=e,this.#t=Symbol(e)}get key(){return this.#t}exists(){return tv(this.#t)}get(){const e=Bl(this.#t);if(e===void 0)throw new Error(`Context "${this.#e}" not found`);return e}getOr(e){const t=Bl(this.#t);return t===void 0?e:t}set(e){return Yu(this.#t,e)}};function _v(r,e){let t=_e(null);const n=F(()=>XX(e,250));function a(...i){if(f(t))f(t).timeout&&clearTimeout(f(t).timeout);else{let s,o;const l=new Promise((c,u)=>{s=c,o=u});M(t,{timeout:null,runner:null,promise:l,resolve:s,reject:o},!0)}return f(t).runner=async()=>{if(!f(t))return;const s=f(t);M(t,null);try{s.resolve(await r.apply(this,i))}catch(o){s.reject(o)}},f(t).timeout=setTimeout(f(t).runner,f(n)),f(t).promise}return a.cancel=async()=>{(!f(t)||f(t).timeout===null)&&(await new Promise(i=>setTimeout(i,0)),!f(t)||f(t).timeout===null)||(clearTimeout(f(t).timeout),f(t).reject("Cancelled"),M(t,null))},a.runScheduledNow=async()=>{(!f(t)||!f(t).timeout)&&(await new Promise(i=>setTimeout(i,0)),!f(t)||!f(t).timeout)||(clearTimeout(f(t).timeout),f(t).timeout=null,await f(t).runner?.())},Object.defineProperty(a,"pending",{enumerable:!0,get(){return!!f(t)?.timeout}}),a}function QX(r,e){switch(r){c Line truncated
`,JR="\n\n```\nTurn limit reached\n```\n",eO=`
var Z3=t=>{throw TypeError(t)};var iv=(t,e,r)=>e.has(t)||Z3("Cannot "+r);var ba=(t,e,r)=>(iv(t,e,"read from private field"),r?r.call(t):e.get(t)),El=(t,e,r)=>e.has(t)?Z3("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),_s=(t,e,r,n)=>(iv(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),vl=(t,e,r)=>(iv(t,e,"access private method"),r);var J3=(t,e,r,n)=>({set _(a){_s(t,e,a,r)},get _(){return ba(t,e,n)}});var Yf=Array.isArray,AV=Array.prototype.indexOf,Tp=Array.prototype.includes,eS=Array.from,W2=Object.defineProperty,xu=Object.getOwnPropertyDescriptor,H8=Object.getOwnPropertyDescriptors,Y8=Object.prototype,RV=Array.prototype,tS=Object.getPrototypeOf,eD=Object.isExtensible;function Uh(t){return typeof t=="function"}const Ge=()=>{};function OV(t){return t()}function AA(t){for(var e=0;e<t.length;e++)t[e]()}function V8(){var t,e,r=new Promise((n,a)=>{t=n,e=a});return{promise:r,resolve:t,reject:e}}function NV(t,e,r=!1){return t===void 0?r?e():e:t}function K2(t,e){if(Array.isArray(t))return t;if(!(Symbol.iterator in t))return Array.from(t);const r=[];for(const n of t)if(r.push(n),r.length===e)break;return r}const ui=2,ff=4,Vf=8,j2=1<<24,Kl=16,Jc=32,Xu=64,Q2=128,xo=512,Yi=1024,Wi=2048,eu=4096,io=8192,xc=16384,Wf=32768,zl=65536,RA=1<<17,X2=1<<18,ch=1<<19,W8=1<<20,Oc=1<<25,eh=32768,OA=1<<21,Z2=1<<22,Du=1<<23,Fl=Symbol("$state"),J2=Symbol("legacy props"),IV=Symbol(""),Zh=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},xV=1,rS=3,tu=8;function K8(t){throw new Error("https://svelte.dev/e/experimental_async_required")}function Kp(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function DV(){throw new Error("https://svelte.dev/e/missing_context")}function MV(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function kV(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function PV(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function LV(t){throw new Error("https://svelte.dev/e/effect_orphan")}function FV(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function BV(){throw new Error("https://svelte.dev/e/fork_discarded")}function UV(){throw new Error("https://svelte.dev/e/fork_timing")}function GV(){throw new Error("https://svelte.dev/e/get_abort_signal_outside_reaction")}function qV(){throw new Error("https://svelte.dev/e/hydration_failed")}function j8(t){throw new Error("https://svelte.dev/e/lifecycle_legacy_only")}function zV(t){throw new Error("https://svelte.dev/e/props_invalid_value")}function $V(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function HV(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function YV(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function VV(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const WV=1,KV=2,Q8=4,jV=8,QV=16,XV=1,ZV=2,JV=4,eW=8,tW=16,rW=1,nW=2,aW=4,iW=1,sW=2,X8="[",nS="[!",eO="]",th={},_i=Symbol(),oW="http://www.w3.org/1999/xhtml",lW="http://www.w3.org/2000/svg",Z8="@attach";function cW(t){console.warn("https://svelte.dev/e/hydratable_missing_but_expected")}function Kf(t){console.warn("https://svelte.dev/e/hydration_mismatch")}function uW(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function dW(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}let Nr=!1;function cs(t){Nr=t}let tn;function Ga(t){if(t===null)throw Kf(),th;return tn=t}function Po(){return Ga(uo(tn))}function Y(t){if(Nr){if(uo(tn)!==null)throw Kf(),th;tn=t}}function et(t=1){if(Nr){for(var e=t,r=tn;e--;)r=uo(r);tn=r}}function L1(t=!0){for(var e=0,r=tn;;){if(r.nodeType===tu){var n=r.data;if(n===eO){if(e===0)return r;e-=1}else(n===X8||n===nS)&&(e+=1)}var a=uo(r);t&&r.remove(),r=a}}function J8(t){if(!t||t.nodeType!==tu)throw Kf(),th;return t.data}function eF(t){return t===this.v}function tO(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function tF(t){return!tO(t,this.v)}let jp=!1;function hW(){jp=!0}const pW=[];function sp(t,e=!1,r=!1){return b1(t,new Map,"",pW,null,r)}function b1(t,e,r,n,a=null,i=!1){if(typeof t=="object"&&t!==null){var s=e.get(t);if(s!==void 0)return s;if(t instanceof Map)return new Map(t);if(t instanceof Set)return new Set(t);if(Yf(t)){var o=Array(t.length);e.set(t,o),a!==null&&e.set(a,o);for(var l=0;l<t.length;l+=1){var c=t[l];l in t&&(o[l]=b1(c,e,r,n,null,i))}return o}if(tS(t)===Y8){o={},e.set(t,o),a!==null&&e.set(a,o);for(var u in t)o[u]=b1(t[u],e,r,n,null,i);return o}if(t instanceof Date)return structuredClone(t);if(typeof t.toJSON=="function"&&!i)return b1(t.toJSON(),e,r,n,t)}if(t instanceof EventTarget)return t;try{return structuredClone(t)}catch{return t}}let qn=null;function Cp(t){qn=t}function mW(){const t={};return[()=>(aS(t)||DV(),$l(t)),e=>Zu(t,e)]}function $l(t){return iS().get(t)}function Zu(t,e){return iS().set(t,e)Line truncated
`).some(o=>o.startsWith("https://svelte.dev/e/")))throw s;return s!==th&&console.warn("Failed to hydrate: ",s),e.recover===!1&&qV(),MA(),sO(r),cs(!1),uS(t,e)}finally{cs(n),Ga(a)}}const Rh=new Map;function zF(t,{target:e,anchor:r,props:n={},events:a,context:i,intro:s=!0}){MA();var o=new Set,l=d=>{for(var h=0;h<d.length;h++){var m=d[h];if(!o.has(m)){o.add(m);var f=$W(m);e.addEventListener(m,qm,{passive:f});var g=Rh.get(m);g===void 0?(document.addEventListener(m,qm,{passive:f}),Rh.set(m,1)):Rh.set(m,g+1)}}};l(eS(GF)),PA.add(l);var c=void 0,u=xW(()=>{var d=r??e.appendChild(Vi());return vW(d,{pending:()=>{}},h=>{if(i){ye({});var m=qn;m.c=i}if(a&&(n.$$events=a),Nr&&Ds(h,null),U1=s,c=t(h,n)||{},U1=!0,Nr&&(Pn.nodes.end=tn,tn===null||tn.nodeType!==tu||tn.data!==eO))throw Kf(),th;i&&Te()}),()=>{for(var h of o){e.removeEventListener(h,qm);var m=Rh.get(h);--m===0?(document.removeEventListener(h,qm),Rh.delete(h)):Rh.set(h,m)}PA.delete(l),d!==r&&d.parentNode?.removeChild(d)}});return LA.set(c,u),c}let LA=new WeakMap;function dO(t,e){const r=LA.get(t);return r?(LA.delete(t),r(e)):Promise.resolve()}class eg{anchor;#e=new Map;#t=new Map;#r=new Map;#n=new Set;#i=!0;constructor(e,r=!0){this.anchor=e,this.#i=r}#a=()=>{var e=Hn;if(this.#e.has(e)){var r=this.#e.get(e),n=this.#t.get(r);if(n)lO(n),this.#n.delete(r);else{var a=this.#r.get(r);a&&(this.#t.set(r,a.effect),this.#r.delete(r),a.fragment.lastChild.remove(),this.anchor.before(a.fragment),n=a.effect)}for(const[i,s]of this.#e){if(this.#e.delete(i),i===e)break;const o=this.#r.get(s);o&&(Ei(o.effect),this.#r.delete(s))}for(const[i,s]of this.#t){if(i===r||this.#n.has(i))continue;const o=()=>{if(Array.from(this.#e.values()).includes(i)){var c=document.createDocumentFragment();xF(s,c),c.append(Vi()),this.#r.set(i,{effect:s,fragment:c})}else Ei(s);this.#n.delete(i),this.#t.delete(i)};this.#i||!n?(this.#n.add(i),Zd(s,o,!1)):o()}}};#s=e=>{this.#e.delete(e);const r=Array.from(this.#e.values());for(const[n,a]of this.#r)r.includes(n)||(Ei(a.effect),this.#r.delete(n))};ensure(e,r){var n=Hn,a=bF();if(r&&!this.#t.has(e)&&!this.#r.has(e))if(a){var i=document.createDocumentFragment(),s=Vi();i.append(s),this.#r.set(e,{effect:Rs(()=>r(s)),fragment:i})}else this.#t.set(e,Rs(()=>r(this.anchor)));if(this.#e.set(n,e),a){for(const[o,l]of this.#t)o===e?n.skipped_effects.delete(l):n.skipped_effects.add(l);for(const[o,l]of this.#r)o===e?n.skipped_effects.delete(l.effect):n.skipped_effects.add(l.effect);n.oncommit(this.#a),n.ondiscard(this.#s)}else Nr&&(this.anchor=tn),this.#a()}}function le(t,e,r=!1){Nr&&Po();var n=new eg(t),a=r?zl:0;function i(s,o){if(Nr){const c=J8(t)===nS;if(s===c){var l=L1();Ga(l),n.anchor=l,cs(!1),n.ensure(s,o),cs(!0);return}}n.ensure(s,o)}ed(()=>{var s=!1;e((o,l=!0)=>{s=!0,i(l,o)}),s||i(!1,null)},a)}function WW(t,e,r){Nr&&Po();var n=new eg(t),a=!Qp();ed(()=>{var i=e();a&&i!==null&&typeof i=="object"&&(i={}),n.ensure(i,r)})}function ku(t,e){return e}function KW(t,e,r){for(var n=[],a=e.length,i,s=e.length,o=0;o<a;o++){let d=e[o];Zd(d,()=>{if(i){if(i.pending.delete(d),i.done.add(d),i.pending.size===0){var h=t.outrogroups;FA(eS(i.done)),h.delete(i),h.size===0&&(t.outrogroups=null)}}else s-=1},!1)}if(s===0){var l=n.length===0&&r!==null;if(l){var c=r,u=c.parentNode;sO(u),u.append(c),t.items.clear()}FA(e,!l)}else i={pending:new Set(e),done:new Set},(t.outrogroups??=new Set).add(i)}function FA(t,e=!0){for(var r=0;r<t.length;r++)Ei(t[r],e)}var oD;function xr(t,e,r,n,a,i=null){var s=t,o=new Map,l=(e&Q8)!==0;if(l){var c=t;s=Nr?Ga(xi(c)):c.appendChild(Vi())}Nr&&Po();var u=null,d=oS(()=>{var _=r();return Yf(_)?_:_==null?[]:eS(_)}),h,m=!0;function f(){b.fallback=u,jW(b,h,s,e,n),u!==null&&(h.length===0?(u.f&Oc)===0?lO(u):(u.f^=Oc,zm(u,null,s)):Zd(u,()=>{u=null}))}var g=ed(()=>{h=p(d);var _=h.length;let S=!1;if(Nr){var E=J8(s)===nS;E!==(_===0)&&(s=L1(),Ga(s),cs(!1),S=!0)}for(var y=new Set,v=Hn,T=bF(),w=0;w<_;w+=1){Nr&&tn.nodeType===tu&&tn.data===eO&&(s=tn,S=!0,cs(!1));var A=h[w],I=n(A,w),x=m?null:o.get(I);x?(x.v&&Ap(x.v,A),x.i&&Ap(x.i,w),T&&v.skipped_effects.delete(x.e)):(x=QW(o,m?s:oD??=Vi(),A,I,w,a,e,r),m||(x.e.f|=Oc),o.set(I,x)),y.add(I)}if(_===0&&i&&!u&&(m?u=Rs(()=>i(s)):(u=Rs(()=>i(oD??=Vi())),u.f|=Oc)),Nr&&_>0&&Ga(L1()),!m)if(T){for(const[D,$]of o)y.has(D)||v.skipped_effects.add($.e);v.oncommit(f),v.ondiscard(()=>{})}else f();S&&cs(!0),p(d)}),b={effect:g,items:o,outrogroups:null,fallback:u};m=!1,Nr&&(s=tn)}function jW(t,e,r,n,a){var i=(n&jV)!==0,s=e.length,o=t.items,l=t.effect.first,c,u=null,d,h=[],m=[],f,g,b,_;if(i)for(_=0;_<s;_+=1)f=e[_],g=a(f,_),b=o.get(g).e,(b.f&Oc)===0&&(b.nodes?.a?.measure(),(d??=new Set).add(b));for(_=0;_<s;_+=1){if(f=e[_],g=a(f,_),b=o.get(g).e,t.outrogroups!==null)for(const x of t.outrogroups)x.pending.delete(b),x.done.delete(b);if((b.f&Oc)!==0)if(b.f^=Oc,b===l)zm(b,null,r);else{var S=u?u.next:l;b===t.effect.last&&(t.effect.last=b.prev),b.prev&&(b.prev.next=b.next),b.next&&(b.next.prev=b.prev),pu(t,u,b),pu(t,b,S),zm(b,S,r),u=b,h=[],m=[],l=u.next;continue}if((b.f Line truncated
\r\f \v\uFEFF`];function nK(t,e,r){var n=t==null?"":""+t;if(e&&(n=n?n+" "+e:e),r){for(var a in r)if(r[a])n=n?n+" "+a:a;else if(n.length)for(var i=a.length,s=0;(s=n.indexOf(a,s))>=0;){var o=s+i;(s===0||cD.includes(n[s-1]))&&(o===n.length||cD.includes(n[o]))?n=(s===0?"":n.substring(0,s))+n.substring(o+1):s=o}}return n===""?null:n}function uD(t,e=!1){var r=e?" !important;":";",n="";for(var a in t){var i=t[a];i!=null&&i!==""&&(n+=" "+a+": "+i+r)}return n}function sv(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function aK(t,e){if(e){var r="",n,a;if(Array.isArray(e)?(n=e[0],a=e[1]):n=e,t){t=String(t).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var i=!1,s=0,o=!1,l=[];n&&l.push(...Object.keys(n).map(sv)),a&&l.push(...Object.keys(a).map(sv));var c=0,u=-1;const g=t.length;for(var d=0;d<g;d++){var h=t[d];if(o?h==="/"&&t[d-1]==="*"&&(o=!1):i?i===h&&(i=!1):h==="/"&&t[d+1]==="*"?o=!0:h==='"'||h==="'"?i=h:h==="("?s++:h===")"&&s--,!o&&i===!1&&s===0){if(h===":"&&u===-1)u=d;else if(h===";"||d===g-1){if(u!==-1){var m=sv(t.substring(c,u).trim());if(!l.includes(m)){h!==";"&&d++;var f=t.substring(c,d).trim();r+=" "+f+";"}}c=d+1,u=-1}}}}return n&&(r+=uD(n)),a&&(r+=uD(a,!0)),r=r.trim(),r===""?null:r}return t==null?null:String(t)}function Et(t,e,r,n,a,i){var s=t.__className;if(Nr||s!==r||s===void 0){var o=nK(r,n,i);(!Nr||o!==t.getAttribute("class"))&&(o==null?t.removeAttribute("class"):e?t.className=o:t.setAttribute("class",o)),t.__className=r}else if(i&&a!==i)for(var l in i){var c=!!i[l];(a==null||c!==!!a[l])&&t.classList.toggle(l,c)}return i}function ov(t,e={},r,n){for(var a in r){var i=r[a];e[a]!==i&&(r[a]==null?t.style.removeProperty(a):t.style.setProperty(a,i,n))}}function ms(t,e,r,n){var a=t.__style;if(Nr||a!==e){var i=aK(e,n);(!Nr||i!==t.getAttribute("style"))&&(i==null?t.removeAttribute("style"):t.style.cssText=i),t.__style=e}else n&&(Array.isArray(n)?(ov(t,r?.[0],n[0]),ov(t,r?.[1],n[1],"important")):ov(t,r,n));return n}function UA(t,e,r=!1){if(t.multiple){if(e==null)return;if(!Yf(e))return uW();for(var n of t.options)n.selected=e.includes(dD(n));return}for(n of t.options){var a=dD(n);if(RW(a,e)){n.selected=!0;return}}(!r||e!==void 0)&&(t.selectedIndex=-1)}function iK(t){var e=new MutationObserver(()=>{UA(t,t.__value)});e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),dh(()=>{e.disconnect()})}function dD(t){return"__value"in t?t.__value:t.value}const bm=Symbol("class"),Gh=Symbol("style"),VF=Symbol("is custom element"),WF=Symbol("is html");function sK(t){if(Nr){var e=!1,r=()=>{if(!e){if(e=!0,t.hasAttribute("value")){var n=t.value;rr(t,"value",null),t.value=n}if(t.hasAttribute("checked")){var a=t.checked;rr(t,"checked",null),t.checked=a}}};t.__on_r=r,Do(r),SF()}}function pO(t,e){var r=mO(t);r.value===(r.value=e??void 0)||t.value===e&&(e!==0||t.nodeName!=="PROGRESS")||(t.value=e??"")}function oK(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function rr(t,e,r,n){var a=mO(t);Nr&&(a[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName==="LINK")||a[e]!==(a[e]=r)&&(e==="loading"&&(t[IV]=r),r==null?t.removeAttribute(e):typeof r!="string"&&KF(t).includes(e)?t[e]=r:t.setAttribute(e,r))}function lK(t,e,r,n,a=!1,i=!1){if(Nr&&a&&t.tagName==="INPUT"){var s=t,o=s.type==="checkbox"?"defaultChecked":"defaultValue";o in r||sK(s)}var l=mO(t),c=l[VF],u=!l[WF];let d=Nr&&c;d&&cs(!1);var h=e||{},m=t.tagName==="OPTION";for(var f in e)f in r||(r[f]=null);r.class?r.class=$r(r.class):(n||r[bm])&&(r.class=null),r[Gh]&&(r.style??=null);var g=KF(t);for(const T in r){let w=r[T];if(m&&T==="value"&&w==null){t.value=t.__value="",h[T]=w;continue}if(T==="class"){var b=t.namespaceURI==="http://www.w3.org/1999/xhtml";Et(t,b,w,n,e?.[bm],r[bm]),h[T]=w,h[bm]=r[bm];continue}if(T==="style"){ms(t,w,e?.[Gh],r[Gh]),h[T]=w,h[Gh]=r[Gh];continue}var _=h[T];if(!(w===_&&!(w===void 0&&t.hasAttribute(T)))){h[T]=w;var S=T[0]+T[1];if(S!=="$$")if(S==="on"){const A={},I="$$"+T;let x=T.slice(2);var E=UW(x);if(FW(x)&&(x=x.slice(0,-7),A.capture=!0),!E&&_){if(w!=null)continue;t.removeEventListener(x,h[I],A),h[I]=null}if(w!=null)if(E)t[`__${x}`]=w,Bn([x]);else{let D=function($){h[T].call(this,$)};h[I]=uO(x,t,D,A)}else E&&(t[`__${x}`]=void 0)}else if(T==="style")rr(t,T,w);else if(T==="autofocus")OW(t,!!w);else if(!c&&(T==="__value"||T==="value"&&w!=null))t.value=t.__value=w;else if(T==="selected"&&m)oK(t,w);else{var y=T;u||(y=qW(y));var v=y==="defaultValue"||y==="defaultChecked";if(w==null&&!c&&!v)if(l[T]=null,y==="value"||y==="checked"){let A=t;const I=e===void 0;if(y==="value"){let x=A.defaultValue;A.removeAttribute(y),A.defaultValue=x,A.value=A.__value=I?x:null}else{let x=A.defaultChecked;A.removeAttribute(y),A.defaultChecked=x,A.checked=I?x:!1}}else t.removeAttribute(T);else v||g.includes(y)&&(c||typeof w!="string")?(t[y]=w,y in l&&(l[y]=_i)):typeof w!="function"&&rr(t,y,w)}}}return d&&cs(!0),h}function $t(t,e,r=[],n=[],a=[],i,s=!1,o=!1){nO(a,r,n,l=>{var c=void 0,u={},d=t.nodeName= Line truncated
`,c="/",u="*",d="",h="comment",m="declaration";gv=function(g,b){if(typeof g!="string")throw new TypeError("First argument must be a string");if(!g)return[];b=b||{};var _=1,S=1;function E(H){var G=H.match(e);G&&(_+=G.length);var K=H.lastIndexOf(l);S=~K?H.length-K:S+H.length}function y(){var H={line:_,column:S};return function(G){return G.position=new v(H),A(),G}}function v(H){this.start=H,this.end={line:_,column:S},this.source=b.source}v.prototype.content=g;function T(H){var G=new Error(b.source+":"+_+":"+S+": "+H);if(G.reason=H,G.filename=b.source,G.line=_,G.column=S,G.source=g,!b.silent)throw G}function w(H){var G=H.exec(g);if(G){var K=G[0];return E(K),g=g.slice(K.length),G}}function A(){w(r)}function I(H){var G;for(H=H||[];G=x();)G!==!1&&H.push(G);return H}function x(){var H=y();if(!(c!=g.charAt(0)||u!=g.charAt(1))){for(var G=2;d!=g.charAt(G)&&(u!=g.charAt(G)||c!=g.charAt(G+1));)++G;if(G+=2,d===g.charAt(G-1))return T("End of comment missing");var K=g.slice(2,G-2);return S+=2,E(K),g=g.slice(G),S+=2,H({type:h,comment:K})}}function D(){var H=y(),G=w(n);if(G){if(x(),!w(a))return T("property missing ':'");var K=w(i),z=H({type:m,property:f(G[0].replace(t,d)),value:K?f(K[0].replace(t,d)):d});return w(s),z}}function $(){var H=[];I(H);for(var G;G=D();)G!==!1&&(H.push(G),I(H));return H}return A(),$()};function f(g){return g?g.replace(o,d):d}return gv}var ID;function xQ(){if(ID)return xh;ID=1;var t=xh&&xh.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(xh,"__esModule",{value:!0}),xh.default=r;var e=t(IQ());function r(n,a){var i=null;if(!n||typeof n!="string")return i;var s=(0,e.default)(n),o=typeof a=="function";return s.forEach(function(l){if(l.type==="declaration"){var c=l.property,u=l.value;o?a(c,u,l):u&&(i=i||{},i[c]=u)}}),i}return xh}var DQ=xQ();const xD=ph(DQ),MQ=xD.default||xD,kQ=/\d/,PQ=["-","_","/","."];function LQ(t=""){if(!kQ.test(t))return t!==t.toLowerCase()}function FQ(t){const e=[];let r="",n,a;for(const i of t){const s=PQ.includes(i);if(s===!0){e.push(r),r="",n=void 0;continue}const o=LQ(i);if(a===!1){if(n===!1&&o===!0){e.push(r),r=i,n=o;continue}if(n===!0&&o===!1&&r.length>1){const l=r.at(-1);e.push(r.slice(0,Math.max(0,r.length-1))),r=l+i,n=o;continue}}r+=i,n=o,a=s}return e.push(r),e}function PB(t){return t?FQ(t).map(e=>UQ(e)).join(""):""}function BQ(t){return GQ(PB(t||""))}function UQ(t){return t?t[0].toUpperCase()+t.slice(1):""}function GQ(t){return t?t[0].toLowerCase()+t.slice(1):""}function Ym(t){if(!t)return{};const e={};function r(n,a){if(n.startsWith("-moz-")||n.startsWith("-webkit-")||n.startsWith("-ms-")||n.startsWith("-o-")){e[PB(n)]=a;return}if(n.startsWith("--")){e[n]=a;return}e[BQ(n)]=a}return MQ(t,r),e}function Dc(...t){return(...e)=>{for(const r of t)typeof r=="function"&&r(...e)}}function qQ(t,e){const r=RegExp(t,"g");return n=>{if(typeof n!="string")throw new TypeError(`expected an argument of type string, but got ${typeof n}`);return n.match(r)?n.replace(r,e):n}}const zQ=qQ(/[A-Z]/,t=>`-${t.toLowerCase()}`);function $Q(t){if(!t||typeof t!="object"||Array.isArray(t))throw new TypeError(`expected an argument of type object, but got ${typeof t}`);return Object.keys(t).map(e=>`${zQ(e)}: ${t[e]};`).join(`
`)}function LO(t={}){return $Q(t).replace(`
`," ")}const HQ=["onabort","onanimationcancel","onanimationend","onanimationiteration","onanimationstart","onauxclick","onbeforeinput","onbeforetoggle","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncompositionend","oncompositionstart","oncompositionupdate","oncontextlost","oncontextmenu","oncontextrestored","oncopy","oncuechange","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onfocusin","onfocusout","onformdata","ongotpointercapture","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onlostpointercapture","onmousedown","onmouseenter","onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onpaste","onpause","onplay","onplaying","onpointercancel","onpointerdown","onpointerenter","onpointerleave","onpointermove","onpointerout","onpointerover","onpointerup","onprogress","onratechange","onreset","onresize","onscroll","onscrollend","onsecuritypolicyviolation","onseeked","onseeking","onselect","onselectionchange","onselectstart","onslotchange","onstalled","onsubmit","onsuspend","ontimeupdate","ontoggle","ontouchcancel","ontouchend","ontouchmove","ontouchstart","ontransitioncancel","ontransitionend","ontransitionrun","ontransitionstart","onvolumechange","onwaiting","onwebkitanimationend","onwebkitanimationiteration","onwebkitanimationstart","onwebkittransitionend","onwheel"],YQ=new Set(HQ);function VQ(t){return YQ.has(t)}function Er(...t){const e={...t[0]};for(let r=1;r<t.length;r++){const n=t[r];if(n){for(const a of Object.keys(n)){const i=e[a],s=n[a],o=typeof i=="function",l=typeof s=="function";if(o&&VQ(a)){const c=i,u=s;e[a]=kB(c,u)}else if(o&&l)e[a]=Dc(i,s);else if(a==="class"){const c=ZA(i),u=ZA(s);c&&u?e[a]=nf(i,s):c?e[a]=nf(i):u&&(e[a]=nf(s))}else if(a==="style"){const c=typeof i=="object",u=typeof s=="object",d=typeof i=="string",h=typeof s=="string";if(c&&u)e[a]={...i,...s};else if(c&&h){const m=Ym(s);e[a]={...i,...m}}else if(d&&u){const m=Ym(i);e[a]={...m,...s}}else if(d&&h){const m=Ym(i),f=Ym(s);e[a]={...m,...f}}else c?e[a]=i:u?e[a]=s:d?e[a]=i:h&&(e[a]=s)}else e[a]=s!==void 0?s:i}for(const a of Object.getOwnPropertySymbols(n)){const i=e[a],s=n[a];e[a]=s!==void 0?s:i}}}return typeof e.style=="object"&&(e.style=LO(e.style).replaceAll(`
`," ")),e.hidden===!1&&(e.hidden=void 0,delete e.hidden),e.disabled===!1&&(e.disabled=void 0,delete e.disabled),e}const WQ={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",transform:"translateX(-100%)"},KQ=LO(WQ),LB=typeof window<"u"?window:void 0;function jQ(t){let e=t.activeElement;for(;e?.shadowRoot;){const r=e.shadowRoot.activeElement;if(r===e)break;e=r}return e}var QQ=["forEach","isDisjointFrom","isSubsetOf","isSupersetOf"],XQ=["difference","intersection","symmetricDifference","union"],DD=!1;class ds extends Set{#e=new Map;#t=_e(0);#r=_e(0);#n=al||-1;constructor(e){if(super(),e){for(var r of e)super.add(r);this.#r.v=super.size}DD||this.#a()}#i(e){return al===this.#n?_e(e):Uc(e)}#a(){DD=!0;var e=ds.prototype,r=Set.prototype;for(const n of QQ)e[n]=function(...a){return p(this.#t),r[n].apply(this,a)};for(const n of XQ)e[n]=function(...a){p(this.#t);var i=r[n].apply(this,a);return new ds(i)}}has(e){var r=super.has(e),n=this.#e,a=n.get(e);if(a===void 0){if(!r)return p(this.#t),!1;a=this.#i(!0),n.set(e,a)}return p(a),r}add(e){return super.has(e)||(super.add(e),k(this.#r,super.size),eo(this.#t)),this}delete(e){var r=super.delete(e),n=this.#e,a=n.get(e);return a!==void 0&&(n.delete(e),k(a,!1)),r&&(k(this.#r,super.size),eo(this.#t)),r}clear(){if(super.size!==0){super.clear();var e=this.#e;for(var r of e.values())k(r,!1);e.clear(),k(this.#r,0),eo(this.#t)}}keys(){return this.values()}values(){return p(this.#t),super.values()}entries(){return p(this.#t),super.entries()}[Symbol.iterator](){return this.keys()}get size(){return p(this.#r)}}class Ii extends Map{#e=new Map;#t=_e(0);#r=_e(0);#n=al||-1;constructor(e){if(super(),e){for(var[r,n]of e)super.set(r,n);this.#r.v=super.size}}#i(e){return al===this.#n?_e(e):Uc(e)}has(e){var r=this.#e,n=r.get(e);if(n===void 0){var a=super.get(e);if(a!==void 0)n=this.#i(0),r.set(e,n);else return p(this.#t),!1}return p(n),!0}forEach(e,r){this.#a(),super.forEach(e,r)}get(e){var r=this.#e,n=r.get(e);if(n===void 0){var a=super.get(e);if(a!==void 0)n=this.#i(0),r.set(e,n);else{p(this.#t);return}}return p(n),super.get(e)}set(e,r){var n=this.#e,a=n.get(e),i=super.get(e),s=super.set(e,r),o=this.#t;if(a===void 0)a=this.#i(0),n.set(e,a),k(this.#r,super.size),eo(o);else if(i!==r){eo(a);var l=o.reactions===null?null:new Set(o.reactions),c=l===null||!a.reactions?.every(u=>l.has(u));c&&eo(o)}return s}delete(e){var r=this.#e,n=r.get(e),a=super.delete(e);return n!==void 0&&(r.delete(e),k(this.#r,super.size),k(n,-1),eo(this.#t)),a}clear(){if(super.size!==0){super.clear();var e=this.#e;k(this.#r,0);for(var r of e.values())k(r,-1);eo(this.#t),e.clear()}}#a(){p(this.#t);var e=this.#e;if(this.#r.v!==e.size){for(var r of super.keys())if(!e.has(r)){var n=this.#i(0);e.set(r,n)}}for([,n]of this.#e)p(n)}keys(){return p(this.#t),super.keys()}values(){return this.#a(),super.values()}entries(){return this.#a(),super.entries()}[Symbol.iterator](){return this.entries()}get size(){return p(this.#r),super.size}}class ZQ{#e;#t;constructor(e,r){this.#e=e,this.#t=Ju(r)}get current(){return this.#t(),this.#e()}}const JQ=/\(.+\)/,eX=new Set(["all","print","screen","and","or","not","only"]);class FB extends ZQ{constructor(e,r){let n=JQ.test(e)||e.split(/[\s,]+/).some(i=>eX.has(i.trim()))?e:`(${e})`;const a=window.matchMedia(n);super(()=>a.matches,i=>Kr(a,"change",i))}}let tX=class{#e;#t;constructor(e={}){const{window:r=LB,document:n=r?.document}=e;r!==void 0&&(this.#e=n,this.#t=Ju(a=>{const i=Kr(r,"focusin",a),s=Kr(r,"focusout",a);return()=>{i(),s()}}))}get current(){return this.#t?.(),this.#e?jQ(this.#e):null}};new tX;function BB(t){return typeof t=="function"}function rX(t,e){if(BB(t)){const n=t();return n===void 0?e:n}return t===void 0?e:t}let ka=class{#e;#t;constructor(e){this.#e=e,this.#t=Symbol(e)}get key(){return this.#t}exists(){return aS(this.#t)}get(){const e=$l(this.#t);if(e===void 0)throw new Error(`Context "${this.#e}" not found`);return e}getOr(e){const r=$l(this.#t);return r===void 0?e:r}set(e){return Zu(this.#t,e)}};function ES(t,e){let r=_e(null);const n=F(()=>rX(e,250));function a(...i){if(p(r))p(r).timeout&&clearTimeout(p(r).timeout);else{let s,o;const l=new Promise((c,u)=>{s=c,o=u});k(r,{timeout:null,runner:null,promise:l,resolve:s,reject:o},!0)}return p(r).runner=async()=>{if(!p(r))return;const s=p(r);k(r,null);try{s.resolve(await t.apply(this,i))}catch(o){s.reject(o)}},p(r).timeout=setTimeout(p(r).runner,p(n)),p(r).promise}return a.cancel=async()=>{(!p(r)||p(r).timeout===null)&&(await new Promise(i=>setTimeout(i,0)),!p(r)||p(r).timeout===null)||(clearTimeout(p(r).timeout),p(r).reject("Cancelled"),k(r,null))},a.runScheduledNow=async()=>{(!p(r)||!p(r).timeout)&&(await new Promise(i=>setTimeout(i,0)),!p(r)||!p(r).timeout)||(clearTimeout(p(r).timeout),p(r).timeout=null,await p(r).runner?.())},Object.defineProperty(a,"pending",{enumerable:!0,get(){return!!p(r)?.timeout}}),a}function nX(t,e){switch(t){c Line truncated
`,n5="\n\n```\nTurn limit reached\n```\n",a5=`
\`\`\`
Upstream LLM error:
`,tO="\n```\n",yS={enabled:!0,maxTurns:100,maxToolPreviewLines:25},kre={START:"<<<reasoning_content_start>>>"},cf={COMPLETED_TOOL_CALL:/<<<AGENTIC_TOOL_CALL_START>>>\n<<<TOOL_NAME:(.+?)>>>\n<<<TOOL_ARGS_START>>>([\s\S]*?)<<<TOOL_ARGS_END>>>([\s\S]*?)<<<AGENTIC_TOOL_CALL_END>>>/g,REASONING_BLOCK:/<<<reasoning_content_start>>>[\s\S]*?<<<reasoning_content_end>>>/g,REASONING_EXTRACT:/<<<reasoning_content_start>>>([\s\S]*?)<<<reasoning_content_end>>>/,REASONING_OPEN:/<<<reasoning_content_start>>>[\s\S]*$/,AGENTIC_TOOL_CALL_OPEN:/\n*<<<AGENTIC_TOOL_CALL_START>>>[\s\S]*$/,HAS_LEGACY_MARKERS:/<<<(?:AGENTIC_TOOL_CALL_START|reasoning_content_start)>>>/},o0={LIST:"/v1/models",LOAD:"/models/load",UNLOAD:"/models/unload"},qU="/cors-proxy",Mre="PDF File",Dre="MCP Prompt",Pre="MCP Resource",rO=100,Lre=10,Fre={prefixLength:1024*10,suspiciousCharThresholdRatio:.15,maxAbsoluteNullBytes:2},HU=300*1e3,Bre=100,Ure=600*1e3,$re=50,Gre=50,zre=300*1e3,qre=10,Hre=1800*1e3,Vre=0,Yre=`
`,i5="\n```\n",Tv={enabled:!0,maxTurns:100,maxToolPreviewLines:25},Bre={START:"<<<reasoning_content_start>>>"},hp={COMPLETED_TOOL_CALL:/<<<AGENTIC_TOOL_CALL_START>>>\n<<<TOOL_NAME:(.+?)>>>\n<<<TOOL_ARGS_START>>>([\s\S]*?)<<<TOOL_ARGS_END>>>([\s\S]*?)<<<AGENTIC_TOOL_CALL_END>>>/g,REASONING_BLOCK:/<<<reasoning_content_start>>>[\s\S]*?<<<reasoning_content_end>>>/g,REASONING_EXTRACT:/<<<reasoning_content_start>>>([\s\S]*?)<<<reasoning_content_end>>>/,REASONING_OPEN:/<<<reasoning_content_start>>>[\s\S]*$/,AGENTIC_TOOL_CALL_OPEN:/\n*<<<AGENTIC_TOOL_CALL_START>>>[\s\S]*$/,HAS_LEGACY_MARKERS:/<<<(?:AGENTIC_TOOL_CALL_START|reasoning_content_start)>>>/},u_={LIST:"/v1/models",LOAD:"/models/load",UNLOAD:"/models/unload"},WU="/cors-proxy",Ure="PDF File",Gre="MCP Prompt",qre="MCP Resource",s5=100,zre=10,$re={prefixLength:1024*10,suspiciousCharThresholdRatio:.15,maxAbsoluteNullBytes:2},KU=300*1e3,Hre=100,Yre=600*1e3,Vre=50,Wre=50,Kre=300*1e3,jre=10,Qre=1800*1e3,Xre=0,Zre=`
`,Wre='"',nO="/",SS="@",jre="code-block-scroll-container",Kre="code-block-wrapper",Xre="code-block-header",Qre="code-block-actions",Zre="code-language",Jre="copy-code-btn",ene="preview-code-btn",tne="relative",rne=`
`,nne="text",ane=/^(\w*)\n?/,ine=/&/g,sne=/</g,one=/>/g,aO=/^```|\n```/g,lne="chat-message-edit",cne="chat-actions",une="chat-settings-dialog",VU="border border-border/30 focus-within:border-border dark:border-border/20 dark:focus-within:border-border",T4=`
`,Jre='"',o5="/",Cv="@",ene="code-block-scroll-container",tne="code-block-wrapper",rne="code-block-header",nne="code-block-actions",ane="code-language",ine="copy-code-btn",sne="preview-code-btn",one="relative",lne=`
`,cne="text",une=/^(\w*)\n?/,dne=/&/g,hne=/</g,pne=/>/g,l5=/^```|\n```/g,mne="chat-message-edit",fne="chat-actions",gne="chat-settings-dialog",jU="border border-border/30 focus-within:border-border dark:border-border/20 dark:focus-within:border-border",OI=`
bg-muted/60 dark:bg-muted/75
${VU}
${jU}
shadow-sm
outline-none
text-foreground
`,dne=`
`,_ne=`
bg-background
border border-border/30 dark:border-border/20
shadow-sm backdrop-blur-lg!
rounded-t-lg!
`,hne="max-h-80",fne="https://www.google.com/s2/favicons",pne=32,iO=".",sO=2,y_=1e3,oO=60,lO=3600,mne=1,gne=10,cO="0s",YU=256,WU=8192,_ne=/[\x00-\x1F\x7F]/g,bne=/[\x00-\x08\x0A-\x0D\x0E-\x1F\x7F]/g,Yo={[Dn.IMAGE]:g4,[Dn.AUDIO]:v4,[Dn.TEXT]:wc,[Dn.PDF]:m4},vne={[qc.VISION]:p4,[qc.AUDIO]:v4},yne={[qc.VISION]:"Vision",[qc.AUDIO]:"Audio"},Sne=/(```[\s\S]*?```|`[^`\n]+`)/g,Ene=new RegExp("(```[\\S\\s]*?```|`.*?`)|(?<!\\\\)\\\\\\[([\\S\\s]*?[^\\\\])\\\\]|(?<!\\\\)\\\\\\((.*?)\\\\\\)","g"),wne=/\$\$([\s\S]*?\\\\[\s\S]*?)\$\$/,Tne=/\r?\n/,Cne=new Set(["paragraph","heading","emphasis","strong","delete","link","linkReference","tableCell"]),jU=" ",Ane=jU.repeat(4),uO="LlamaCppWebui.config",dO="LlamaCppWebui.userOverrides",hO="LlamaCppWebui.favoriteModels",ES="LlamaCppWebui.mcpDefaultEnabled",xne="img:not([data-error-bound])",Rne="errorBound",fO="errorHandled",wS="true",KU="1.0.0",One=ea.PNG,Nne=new Set([ea.PNG,ea.JPEG,ea.JPG,ea.SVG,ea.WEBP]),Ine="2025-06-18",Va={protocolVersion:Ine,capabilities:{tools:{listChanged:!0}},clientInfo:{name:"llama-webui-mcp",version:KU},requestTimeoutSeconds:300,connectionTimeoutMs:1e4},C4="LlamaCpp-WebUI-MCP-Server",kne=1e3,Mne=2,Dne=3e4,pO=15e3,mO=3,Pne=2,Lne="url",Fne={[Os.WEBSOCKET]:"WebSocket",[Os.STREAMABLE_HTTP]:"HTTP",[Os.SSE]:"SSE"},Bne={[Os.WEBSOCKET]:E4,[Os.STREAMABLE_HTTP]:mre,[Os.SSE]:Tre},Une="https://mcp.example.com/sse",$ne=1,XU=/\.(png|jpg|jpeg|gif|svg|webp)$/i,QU=/\.(js|ts|json|yaml|yml|xml|html|css|py|rs|go|java|cpp|c|h|rb|sh|toml)$/i,Gne=/\.(txt|md|log)$/i,zne=/^[a-z]+:\/\//,qne=/\.[^.]+$/,Hne=/[-_]/,Vne=/^data:([^;]+);base64,([A-Za-z0-9+/]+=*)$/,Yne="mcp-attachment",Wne="res",jne="img",ZU="resource.txt",Kne="/",Xne=`
`,bne="max-h-80",Sne="https://www.google.com/s2/favicons",Ene=32,c5=".",u5=2,T1=1e3,d5=60,h5=3600,vne=1,yne=10,p5="0s",QU=256,XU=8192,Tne=/[\x00-\x1F\x7F]/g,Cne=/[\x00-\x08\x0A-\x0D\x0E-\x1F\x7F]/g,Xo={[kn.IMAGE]:EI,[kn.AUDIO]:TI,[kn.TEXT]:Nc,[kn.PDF]:SI},wne={[jc.VISION]:bI,[jc.AUDIO]:TI},Ane={[jc.VISION]:"Vision",[jc.AUDIO]:"Audio"},Rne=/(```[\s\S]*?```|`[^`\n]+`)/g,One=new RegExp("(```[\\S\\s]*?```|`.*?`)|(?<!\\\\)\\\\\\[([\\S\\s]*?[^\\\\])\\\\]|(?<!\\\\)\\\\\\((.*?)\\\\\\)","g"),Nne=/\$\$([\s\S]*?\\\\[\s\S]*?)\$\$/,Ine=/\r?\n/,xne=new Set(["paragraph","heading","emphasis","strong","delete","link","linkReference","tableCell"]),ZU=" ",Dne=ZU.repeat(4),m5="LlamaCppWebui.config",f5="LlamaCppWebui.userOverrides",g5="LlamaCppWebui.favoriteModels",wv="LlamaCppWebui.mcpDefaultEnabled",Mne="img:not([data-error-bound])",kne="errorBound",_5="errorHandled",Av="true",JU="1.0.0",Pne=ta.PNG,Lne=new Set([ta.PNG,ta.JPEG,ta.JPG,ta.SVG,ta.WEBP]),Fne="2025-06-18",Va={protocolVersion:Fne,capabilities:{tools:{listChanged:!0}},clientInfo:{name:"llama-webui-mcp",version:JU},requestTimeoutSeconds:300,connectionTimeoutMs:1e4},NI="LlamaCpp-WebUI-MCP-Server",Bne=1e3,Une=2,Gne=3e4,b5=15e3,S5=3,qne=2,zne="url",$ne={[Is.WEBSOCKET]:"WebSocket",[Is.STREAMABLE_HTTP]:"HTTP",[Is.SSE]:"SSE"},Hne={[Is.WEBSOCKET]:AI,[Is.STREAMABLE_HTTP]:vre,[Is.SSE]:Ire},Yne="https://mcp.example.com/sse",Vne=1,eG=/\.(png|jpg|jpeg|gif|svg|webp)$/i,tG=/\.(js|ts|json|yaml|yml|xml|html|css|py|rs|go|java|cpp|c|h|rb|sh|toml)$/i,Wne=/\.(txt|md|log)$/i,Kne=/^[a-z]+:\/\//,jne=/\.[^.]+$/,Qne=/[-_]/,Xne=/^data:([^;]+);base64,([A-Za-z0-9+/]+=*)$/,Zne="mcp-attachment",Jne="res",eae="img",rG="resource.txt",tae="/",rae=`
`,gO="unknown type",_O="Binary content",Qne={[ea.JPEG]:"jpg",[ea.JPG]:"jpg",[ea.PNG]:"png",[ea.GIF]:"gif",[ea.WEBP]:"webp"},Zne=8,Jne=20,eae=19,tae=/[^a-z0-9]/gi,rae="_",nae=/_+/g,JU="T",aae="_",iae=":",sae="-",rc=-1,oae="/",bO="-",lae=":",vO=/^(I?Q\d+(_[A-Z0-9]+)*|F\d+|BF\d+|MXFP\d+(_[A-Z0-9]+)*)$/i,cae=/^UD$/i,uae=/^\d+(\.\d+)?[BbMmKkTt]$/,dae=/^[Aa]\d+(\.\d+)?[BbMmKkTt]$/,hae=new Set(["GGUF","GGML"]),yO=1e6,fae=2e3,SO={TOKENS_PER_SECOND:"t/s"},dc={apiKey:"",systemMessage:"",showSystemMessage:!0,theme:Pl.SYSTEM,showThoughtInProgress:!1,disableReasoningParsing:!1,excludeReasoningFromContext:!1,showRawOutputSwitch:!1,keepStatsVisible:!1,showMessageStats:!0,askForTitleConfirmation:!1,pasteLongTextToFileLen:2500,copyTextAttachmentsAsPlainText:!1,pdfAsImage:!1,disableAutoScroll:!1,renderUserContentAsMarkdown:!1,alwaysShowSidebarOnDesktop:!1,autoShowSidebarOnNewChat:!0,autoMicOnEmpty:!1,fullHeightCodeBlocks:!1,showRawModelNames:!1,mcpServers:"[]",mcpServerUsageStats:"{}",agenticMaxTurns:10,agenticMaxToolPreviewLines:25,showToolCallInProgress:!1,alwaysShowAgenticTurns:!1,samplers:"",backend_sampling:!1,temperature:void 0,dynatemp_range:void 0,dynatemp_exponent:void 0,top_k:void 0,top_p:void 0,min_p:void 0,xtc_probability:void 0,xtc_threshold:void 0,typ_p:void 0,repeat_last_n:void 0,repeat_penalty:void 0,presence_penalty:void 0,frequency_penalty:void 0,dry_multiplier:void 0,dry_base:void 0,dry_allowed_length:void 0,dry_penalty_last_n:void 0,max_tokens:void 0,custom:"",pyInterpreterEnabled:!1,enableContinueGeneration:!1},cu={apiKey:"Set the API Key if you are using <code>--api-key</code> option for the server.",systemMessage:"The starting message that defines how model should behave.",showSystemMessage:"Display the system message at the top of each conversation.",theme:"Choose the color theme for the interface. You can choose between System (follows your device settings), Light, or Dark.",pasteLongTextToFileLen:"On pasting long text, it will be converted to a file. You can control the file length by setting the value of this parameter. Value 0 means disable.",copyTextAttachmentsAsPlainText:"When copying a message with text attachments, combine them into a single plain text string instead of a special format that can be pasted back as attachments.",samplers:'The order at which samplers are applied, in simplified way. Default is "top_k;typ_p;top_p;min_p;temperature": top_k->typ_p->top_p->min_p->temperature',backend_sampling:"Enable backend-based samplers. When enabled, supported samplers run on the accelerator backend for faster sampling.",temperature:"Controls the randomness of the generated text by affecting the probability distribution of the output tokens. Higher = more random, lower = more focused.",dynatemp_range:"Addon for the temperature sampler. The added value to the range of dynamic temperature, which adjusts probabilities by entropy of tokens.",dynatemp_exponent:"Addon for the temperature sampler. Smoothes out the probability redistribution based on the most probable token.",top_k:"Keeps only k top tokens.",top_p:"Limits tokens to those that together have a cumulative probability of at least p",min_p:"Limits tokens based on the minimum probability for a token to be considered, relative to the probability of the most likely token.",xtc_probability:"XTC sampler cuts out top tokens; this parameter controls the chance of cutting tokens at all. 0 disables XTC.",xtc_threshold:"XTC sampler cuts out top tokens; this parameter controls the token probability that is required to cut that token.",typ_p:"Sorts and limits tokens based on the difference between log-probability and entropy.",repeat_last_n:"Last n tokens to consider for penalizing repetition",repeat_penalty:"Controls the repetition of token sequences in the generated text",presence_penalty:"Limits tokens based on whether they appear in the output or not.",frequency_penalty:"Limits tokens based on how often they appear in the output.",dry_multiplier:"DRY sampling reduces repetition in generated text even across long contexts. This parameter sets the DRY sampling multiplier.",dry_base:"DRY sampling reduces repetition in generated text even across long contexts. This parameter sets the DRY sampling base value.",dry_allowed_length:"DRY sampling reduces repetition in generated text even across long contexts. This parameter sets the allowed length for DRY sampling.",dry_penalty_last_n:"DRY sampling reduces repetition in generated text even across long contexts. This parameter sets DRY penalty for the last n tokens.",max_tokens:"The maximum number of token per output. Use -1 for infinite (no limit).",custom:"Custom JSON parameters to send to the API. Must be valid JSON format.",showThoughtInProgress:"Expand thought process by default when generating messages.",disableReasoningParsing:"Send reasoning_format=none to prevent server-side extraction of reasoning tokens into separate field",excludeReasoningFromContext:"Strip reasoning content from previous messages Line truncated
https://github.com/highlightjs/highlight.js/issues/2277`),Ea=Gt,Un=Cr),ln===void 0&&(ln=!0);const Yr={code:Un,language:Ea};ul("before:highlight",Yr);const go=Yr.result?Yr.result:In(Yr.language,Yr.code,ln);return go.code=Yr.code,ul("after:highlight",go),go}function In(Gt,Cr,ln,Un){const Ea=Object.create(null);function Yr(nr,yr){return nr.keywords[yr]}function go(){if(!ir.keywords){Ma.addText(qn);return}let nr=0;ir.keywordPatternRe.lastIndex=0;let yr=ir.keywordPatternRe.exec(qn),Ar="";for(;yr;){Ar+=qn.substring(nr,yr.index);const tn=di.case_insensitive?yr[0].toLowerCase():yr[0],la=Yr(ir,tn);if(la){const[hi,Sh]=la;if(Ma.addText(Ar),Ar="",Ea[tn]=(Ea[tn]||0)+1,Ea[tn]<=Ut&&(Da+=Sh),hi.startsWith("_"))Ar+=yr[0];else{const Go=di.classNameAliases[hi]||hi;Sn(yr[0],Go)}}else Ar+=yr[0];nr=ir.keywordPatternRe.lastIndex,yr=ir.keywordPatternRe.exec(qn)}Ar+=qn.substring(nr),Ma.addText(Ar)}function au(){if(qn==="")return;let nr=null;if(typeof ir.subLanguage=="string"){if(!Qe[ir.subLanguage]){Ma.addText(qn);return}nr=In(ir.subLanguage,qn,!0,iu[ir.subLanguage]),iu[ir.subLanguage]=nr._top}else nr=Fn(qn,ir.subLanguage.length?ir.subLanguage:null);ir.relevance>0&&(Da+=nr.relevance),Ma.__addSublanguage(nr._emitter,nr.language)}function Si(){ir.subLanguage!=null?au():go(),qn=""}function Sn(nr,yr){nr!==""&&(Ma.startScope(yr),Ma.addText(nr),Ma.endScope())}function Zl(nr,yr){let Ar=1;const tn=yr.length-1;for(;Ar<=tn;){if(!nr._emit[Ar]){Ar++;continue}const la=di.classNameAliases[nr[Ar]]||nr[Ar],hi=yr[Ar];la?Sn(hi,la):(qn=hi,go(),qn=""),Ar++}}function Jl(nr,yr){return nr.scope&&typeof nr.scope=="string"&&Ma.openNode(di.classNameAliases[nr.scope]||nr.scope),nr.beginScope&&(nr.beginScope._wrap?(Sn(qn,di.classNameAliases[nr.beginScope._wrap]||nr.beginScope._wrap),qn=""):nr.beginScope._multi&&(Zl(nr.beginScope,yr),qn="")),ir=Object.create(nr,{parent:{value:ir}}),ir}function dl(nr,yr,Ar){let tn=y(nr.endRe,Ar);if(tn){if(nr["on:end"]){const la=new e(nr);nr["on:end"](yr,la),la.isMatchIgnored&&(tn=!1)}if(tn){for(;nr.endsParent&&nr.parent;)nr=nr.parent;return nr}}if(nr.endsWithParent)return dl(nr.parent,yr,Ar)}function bh(nr){return ir.matcher.regexIndex===0?(qn+=nr[0],1):(ms=!0,0)}function vh(nr){const yr=nr[0],Ar=nr.rule,tn=new e(Ar),la=[Ar.__beforeBegin,Ar["on:begin"]];for(const hi of la)if(hi&&(hi(nr,tn),tn.isMatchIgnored))return bh(yr);return Ar.skip?qn+=yr:(Ar.excludeBegin&&(qn+=yr),Si(),!Ar.returnBegin&&!Ar.excludeBegin&&(qn=yr)),Jl(Ar,nr),Ar.returnBegin?0:yr.length}function ld(nr){const yr=nr[0],Ar=Cr.substring(nr.index),tn=dl(ir,nr,Ar);if(!tn)return ut;const la=ir;ir.endScope&&ir.endScope._wrap?(Si(),Sn(yr,ir.endScope._wrap)):ir.endScope&&ir.endScope._multi?(Si(),Zl(ir.endScope,nr)):la.skip?qn+=yr:(la.returnEnd||la.excludeEnd||(qn+=yr),Si(),la.excludeEnd&&(qn=yr));do ir.scope&&Ma.closeNode(),!ir.skip&&!ir.subLanguage&&(Da+=ir.relevance),ir=ir.parent;while(ir!==tn.parent);return tn.starts&&Jl(tn.starts,nr),la.returnEnd?0:yr.length}function hp(){const nr=[];for(let yr=ir;yr!==di;yr=yr.parent)yr.scope&&nr.unshift(yr.scope);nr.forEach(yr=>Ma.openNode(yr))}let hl={};function cd(nr,yr){const Ar=yr&&yr[0];if(qn+=nr,Ar==null)return Si(),0;if(hl.type==="begin"&&yr.type==="end"&&hl.index===yr.index&&Ar===""){if(qn+=Cr.slice(yr.index,yr.index+1),!Lt){const tn=new Error(`0 width match regex (${Gt})`);throw tn.languageName=Gt,tn.badRule=hl.rule,tn}return 1}if(hl=yr,yr.type==="begin")return vh(yr);if(yr.type==="illegal"&&!ln){const tn=new Error('Illegal lexeme "'+Ar+'" for mode "'+(ir.scope||"<unnamed>")+'"');throw tn.mode=ir,tn}else if(yr.type==="end"){const tn=ld(yr);if(tn!==ut)return tn}if(yr.type==="illegal"&&Ar==="")return qn+=`
`,1;if(fl>1e5&&fl>yr.index*3)throw new Error("potential infinite loop, way more iterations than matches");return qn+=Ar,Ar.length}const di=Yi(Gt);if(!di)throw st(Dt.replace("{}",Gt)),new Error('Unknown language: "'+Gt+'"');const yh=qt(di);let ud="",ir=Un||yh;const iu={},Ma=new wt.__emitter(wt);hp();let qn="",Da=0,Ei=0,fl=0,ms=!1;try{if(di.__emitTokens)di.__emitTokens(Cr,Ma);else{for(ir.matcher.considerAll();;){fl++,ms?ms=!1:ir.matcher.considerAll(),ir.matcher.lastIndex=Ei;const nr=ir.matcher.exec(Cr);if(!nr)break;const yr=Cr.substring(Ei,nr.index),Ar=cd(yr,nr);Ei=nr.index+Ar}cd(Cr.substring(Ei))}return Ma.finalize(),ud=Ma.toHTML(),{language:Gt,value:ud,relevance:Da,illegal:!1,_emitter:Ma,_top:ir}}catch(nr){if(nr.message&&nr.message.includes("Illegal"))return{language:Gt,value:Ft(Cr),illegal:!0,relevance:0,_illegalBy:{message:nr.message,index:Ei,context:Cr.slice(Ei-100,Ei+100),mode:nr.mode,resultSoFar:ud},_emitter:Ma};if(Lt)return{language:Gt,value:Ft(Cr),illegal:!1,relevance:0,errorRaised:nr,_emitter:Ma,_top:ir};throw nr}}function Er(Gt){const Cr={value:Ft(Gt),illegal:!1,relevance:0,_top:bt,_emitter:new wt.__emitter(wt)};return Cr._emitter.addText(Gt),Cr}function Fn(Gt,Cr){Cr=Cr||wt.languages||Object.keys(Qe);const ln=Er(Gt),Un=Cr.filter(Yi).filter($o).map(Si=>In(Si,Gt,!1));Un.unshift(ln);const Ea=Un.sort((Si,Sn)=>{if(Si.relevance!==Sn.relevance)return Sn.relevance-Si.relevance;if(Si.language&&Sn.language){if(Yi(Si.language).supersetOf===Sn.language)return 1;if(Yi(Sn.language).supersetOf===Si.language)return-1}return 0}),[Yr,go]=Ea,au=Yr;return au.secondBest=go,au}function po(Gt,Cr,ln){const Un=Cr&&ft[Cr]||ln;Gt.classList.add("hljs"),Gt.classList.add(`language-${Un}`)}function yi(Gt){let Cr=null;const ln=kt(Gt);if(vt(ln))return;if(ul("before:highlightElement",{el:Gt,language:ln}),Gt.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",Gt);return}if(Gt.children.length>0&&(wt.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(Gt)),wt.throwUnescapedHTML))throw new Rt("One of your code blocks includes unescaped HTML.",Gt.innerHTML);Cr=Gt;const Un=Cr.textContent,Ea=ln?dr(Un,{language:ln,ignoreIllegals:!0}):Fn(Un);Gt.innerHTML=Ea.value,Gt.dataset.highlighted="yes",po(Gt,ln,Ea.language),Gt.result={language:Ea.language,re:Ea.relevance,relevance:Ea.relevance},Ea.secondBest&&(Gt.secondBest={language:Ea.secondBest.language,relevance:Ea.secondBest.relevance}),ul("after:highlightElement",{el:Gt,result:Ea,text:Un})}function Bo(Gt){wt=tr(wt,Gt)}const Ls=()=>{ui(),Ae("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function fs(){ui(),Ae("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Uo=!1;function ui(){function Gt(){ui()}if(document.readyState==="loading"){Uo||window.addEventListener("DOMContentLoaded",Gt,!1),Uo=!0;return}document.querySelectorAll(wt.cssSelector).forEach(yi)}function od(Gt,Cr){let ln=null;try{ln=Cr(xe)}catch(Un){if(st("Language definition for '{}' could not be registered.".replace("{}",Gt)),Lt)st(Un);else throw Un;ln=bt}ln.name||(ln.name=Gt),Qe[Gt]=ln,ln.rawDefinition=Cr.bind(null,xe),ln.aliases&&oa(ln.aliases,{languageName:Gt})}function ps(Gt){delete Qe[Gt];for(const Cr of Object.keys(ft))ft[Cr]===Gt&&delete ft[Cr]}function nu(){return Object.keys(Qe)}function Yi(Gt){return Gt=(Gt||"").toLowerCase(),Qe[Gt]||Qe[ft[Gt]]}function oa(Gt,{languageName:Cr}){typeof Gt=="string"&&(Gt=[Gt]),Gt.forEach(ln=>{ft[ln.toLowerCase()]=Cr})}function $o(Gt){const Cr=Yi(Gt);return Cr&&!Cr.disableAutodetect}function mo(Gt){Gt["before:highlightBlock"]&&!Gt["before:highlightElement"]&&(Gt["before:highlightElement"]=Cr=>{Gt["before:highlightBlock"](Object.assign({block:Cr.el},Cr))}),Gt["after:highlightBlock"]&&!Gt["after:highlightElement"]&&(Gt["after:highlightElement"]=Cr=>{Gt["after:highlightBlock"](Object.assign({block:Cr.el},Cr))})}function dp(Gt){mo(Gt),Ct.push(Gt)}function Ql(Gt){const Cr=Ct.indexOf(Gt);Cr!==-1&&Ct.splice(Cr,1)}function ul(Gt,Cr){const ln=Gt;Ct.forEach(function(Un){Un[ln]&&Un[ln](Cr)})}function _h(Gt){return Ae("10.7.0","highlightBlock will be removed entirely in v12.0"),Ae("10.7.0","Please use highlightElement now."),yi(Gt)}Object.assign(xe,{highlight:dr,highlightAuto:Fn,highlightAll:ui,highlightElement:yi,highlightBlock:_h,configure:Bo,initHighlighting:Ls,initHighlightingOnLoad:fs,registerLanguage:od,unregisterLanguage:ps,listLanguages:nu,getLanguage:Yi,registerAliases:oa,autoDetection:$o,inherit:tr,addPlugin:dp,removePlugin:Ql}),xe.debugMode=function(){Lt=!1},xe.safeMode=function(){Lt=!0},xe.versionString=ct,xe.regex={concat:g,lookahead:h,either:_,optional:m,anyNumberOfTimes:p};for(const Gt in be)typeof be[Gt]=="object"&&r(be[Gt]);return Object.assign(xe,be),xe},It=Et({}) Line truncated
`},m]}}return u2=a,u2}var d2,uI;function yse(){if(uI)return d2;uI=1;function r(e){const t="[a-zA-Z_][\\w.]*",n="<\\?(lasso(script)?|=)",a="\\]|\\?>",i={$pattern:t+"|&[lg]t;",literal:"true false none minimal full all void and or not bw nbw ew new cn ncn lt lte gt gte eq neq rx nrx ft",built_in:"array date decimal duration integer map pair string tag xml null boolean bytes keyword list locale queue set stack staticarray local var variable global data self inherited currentcapture givenblock",keyword:"cache database_names database_schemanames database_tablenames define_tag define_type email_batch encode_set html_comment handle handle_error header if inline iterate ljax_target link link_currentaction link_currentgroup link_currentrecord link_detail link_firstgroup link_firstrecord link_lastgroup link_lastrecord link_nextgroup link_nextrecord link_prevgroup link_prevrecord log loop namespace_using output_none portal private protect records referer referrer repeating resultset rows search_args search_arguments select sort_args sort_arguments thread_atomic value_list while abort case else fail_if fail_ifnot fail if_empty if_false if_null if_true loop_abort loop_continue loop_count params params_up return return_value run_children soap_definetag soap_lastrequest soap_lastresponse tag_name ascending average by define descending do equals frozen group handle_failure import in into join let match max min on order parent protected provide public require returnhome skip split_thread sum take thread to trait type where with yield yieldhome"},s=e.COMMENT("<!--","-->",{relevance:0}),o={className:"meta",begin:"\\[noprocess\\]",starts:{end:"\\[/noprocess\\]",returnEnd:!0,contains:[s]}},l={className:"meta",begin:"\\[/noprocess|"+n},c={className:"symbol",begin:"'"+t+"'"},u=[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.inherit(e.C_NUMBER_MODE,{begin:e.C_NUMBER_RE+"|(-?infinity|NaN)\\b"}),e.inherit(e.APOS_STRING_MODE,{illegal:null}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null}),{className:"string",begin:"`",end:"`"},{variants:[{begin:"[#$]"+t},{begin:"#",end:"\\d+",illegal:"\\W"}]},{className:"type",begin:"::\\s*",end:t,illegal:"\\W"},{className:"params",variants:[{begin:"-(?!infinity)"+t,relevance:0},{begin:"(\\.\\.\\.)"}]},{begin:/(->|\.)\s*/,relevance:0,contains:[c]},{className:"class",beginKeywords:"define",returnEnd:!0,end:"\\(|=>",contains:[e.inherit(e.TITLE_MODE,{begin:t+"(=(?!>))?|[-+*/%](?!>)"})]}];return{name:"Lasso",aliases:["ls","lassoscript"],case_insensitive:!0,keywords:i,contains:[{className:"meta",begin:a,relevance:0,starts:{end:"\\[|"+n,returnEnd:!0,relevance:0,contains:[s]}},o,l,{className:"meta",begin:"\\[no_square_brackets",starts:{end:"\\[/no_square_brackets\\]",keywords:i,contains:[{className:"meta",begin:a,relevance:0,starts:{end:"\\[noprocess\\]|"+n,returnEnd:!0,contains:[s]}},o,l].concat(u)}},{className:"meta",begin:"\\[",relevance:0},{className:"meta",begin:"^#!",end:"lasso9$",relevance:10}].concat(u)}}return d2=r,d2}var h2,dI;function Sse(){if(dI)return h2;dI=1;function r(e){const n=e.regex.either(...["(?:NeedsTeXFormat|RequirePackage|GetIdInfo)","Provides(?:Expl)?(?:Package|Class|File)","(?:DeclareOption|ProcessOptions)","(?:documentclass|usepackage|input|include)","makeat(?:letter|other)","ExplSyntax(?:On|Off)","(?:new|renew|provide)?command","(?:re)newenvironment","(?:New|Renew|Provide|Declare)(?:Expandable)?DocumentCommand","(?:New|Renew|Provide|Declare)DocumentEnvironment","(?:(?:e|g|x)?def|let)","(?:begin|end)","(?:part|chapter|(?:sub){0,2}section|(?:sub)?paragraph)","caption","(?:label|(?:eq|page|name)?ref|(?:paren|foot|super)?cite)","(?:alpha|beta|[Gg]amma|[Dd]elta|(?:var)?epsilon|zeta|eta|[Tt]heta|vartheta)","(?:iota|(?:var)?kappa|[Ll]ambda|mu|nu|[Xx]i|[Pp]i|varpi|(?:var)rho)","(?:[Ss]igma|varsigma|tau|[Uu]psilon|[Pp]hi|varphi|chi|[Pp]si|[Oo]mega)","(?:frac|sum|prod|lim|infty|times|sqrt|leq|geq|left|right|middle|[bB]igg?)","(?:[lr]angle|q?quad|[lcvdi]?dots|d?dot|hat|tilde|bar)"].map(D=>D+"(?![a-zA-Z@:_])")),a=new RegExp(["(?:__)?[a-zA-Z]{2,}_[a-zA-Z](?:_?[a-zA-Z])+:[a-zA-Z]*","[lgc]__?[a-zA-Z](?:_?[a-zA-Z])*_[a-zA-Z]{2,}","[qs]__?[a-zA-Z](?:_?[a-zA-Z])+","use(?:_i)?:[a-zA-Z]*","(?:else|fi|or):","(?:if|cs|exp):w","(?:hbox|vbox):n","::[a-zA-Z]_unbraced","::[a-zA-Z:]"].map(D=>D+"(?![a-zA-Z:_])").join("|")),i=[{begin:/[a-zA-Z@]+/},{begin:/[^a-zA-Z@]?/}],s=[{begin:/\^{6}[0-9a-f]{6}/},{begin:/\^{5}[0-9a-f]{5}/},{begin:/\^{4}[0-9a-f]{4}/},{begin:/\^{3}[0-9a-f]{3}/},{begin:/\^{2}[0-9a-f]{2}/},{begin:/\^{2}[\u0000-\u007f]/}],o={className:"keyword",begin:/\\/,relevance:0,contains:[{endsParent:!0,begin:n},{endsParent:!0,begin:a},{endsParent:!0,variants:s},{endsParent:!0,relevance:0,variants:i}]},l={className:"params",relevance:0,begin:/#+\d?/},c={variants:s},u={className:"built_in",relevance:0,begin:/[$&^_]/},d={className:"meta",begin:/% ?!(T[eE]X|tex|BIB|bib)/,end:"$",relevance:10},h=e.COMMENT("%","$",{relevance:0}),p=[o,l,c,u,d,h],m={begin:/\{/,end:/\}/,relevance:0,contains:["self",...p]},g=e.inheri Line truncated
]`,g={scope:"string",variants:[d,u,h,p]},b={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},_=["false","null","true"],v=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],y=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],S={keyword:v,literal:(K=>{const z=[];return K.forEach(re=>{z.push(re),re.toLowerCase()===re?z.push(re.toUpperCase()):z.push(re.toLowerCase())}),z})(_),built_in:y},w=K=>K.map(z=>z.replace(/\|\d+$/,"")),C={variants:[{match:[/new/,t.concat(m,"+"),t.concat("(?!",w(y).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},x=t.concat(a,"\\b(?!\\()"),N={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),x],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,t.concat(/::/,t.lookahead(/(?!class\b)/)),x],scope:{1:"title.class",3:"variable.constant"}},{match:[i,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},I={scope:"attr",match:t.concat(a,t.lookahead(":"),t.lookahead(/(?!::)/))},D={relevance:0,begin:/\(/,end:/\)/,keywords:S,contains:[I,o,N,e.C_BLOCK_COMMENT_MODE,g,b,C]},H={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",w(v).join("\\b|"),"|",w(y).join("\\b|"),"\\b)"),a,t.concat(m,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[D]};D.contains.push(H);const q=[I,N,e.C_BLOCK_COMMENT_MODE,g,b,C],$={begin:t.concat(/#\[\s*\\?/,t.either(i,s)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:_,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:_,keyword:["new","array"]},contains:["self",...q]},...q,{scope:"meta",variants:[{match:i},{match:s}]}]};return{case_insensitive:!1,keywords:S,contains:[$,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},l,{scope:"variable.language",match:/\$this\b/},o,H,N,{match:[/const/,/\s/,a],scope:{1:"keyword",3:"variable.constant"}},C,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:S,contains:["self",$,o,N,e.C_BLOCK_COMMENT_MODE,g,b]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywor Line truncated
]*;`,relevance:0},{begin:"[vp][0-9]+"}]}}return Tw=r,Tw}var Cw,T7;function Doe(){if(T7)return Cw;T7=1;function r(e){const t="[a-z][a-zA-Z0-9_]*",n={className:"string",begin:"\\$.{1}"},a={className:"symbol",begin:"#"+e.UNDERSCORE_IDENT_RE};return{name:"Smalltalk",aliases:["st"],keywords:["self","super","nil","true","false","thisContext"],contains:[e.COMMENT('"','"'),e.APOS_STRING_MODE,{className:"type",begin:"\\b[A-Z][A-Za-z0-9_]*",relevance:0},{begin:t+":",relevance:0},e.C_NUMBER_MODE,a,n,{begin:"\\|[ ]*"+t+"([ ]+"+t+")*[ ]*\\|",returnBegin:!0,end:/\|/,illegal:/\S/,contains:[{begin:"(\\|[ ]*)?"+t}]},{begin:"#\\(",end:"\\)",contains:[e.APOS_STRING_MODE,n,e.C_NUMBER_MODE,a]}]}}return Cw=r,Cw}var Aw,C7;function Poe(){if(C7)return Aw;C7=1;function r(e){return{name:"SML (Standard ML)",aliases:["ml"],keywords:{$pattern:"[a-z_]\\w*!?",keyword:"abstype and andalso as case datatype do else end eqtype exception fn fun functor handle if in include infix infixr let local nonfix of op open orelse raise rec sharing sig signature struct structure then type val with withtype where while",built_in:"array bool char exn int list option order real ref string substring vector unit word",literal:"true false NONE SOME LESS EQUAL GREATER nil"},illegal:/\/\/|>>/,contains:[{className:"literal",begin:/\[(\|\|)?\]|\(\)/,relevance:0},e.COMMENT("\\(\\*","\\*\\)",{contains:["self"]}),{className:"symbol",begin:"'[A-Za-z_](?!')[\\w']*"},{className:"type",begin:"`[A-Z][\\w']*"},{className:"type",begin:"\\b[A-Z][\\w']*",relevance:0},{begin:"[a-z_]\\w*'[\\w']*"},e.inherit(e.APOS_STRING_MODE,{className:"string",relevance:0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null}),{className:"number",begin:"\\b(0[xX][a-fA-F0-9_]+[Lln]?|0[oO][0-7_]+[Lln]?|0[bB][01_]+[Lln]?|[0-9][0-9_]*([Lln]|(\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)",relevance:0},{begin:/[-=]>/}]}}return Aw=r,Aw}var xw,A7;function Loe(){if(A7)return xw;A7=1;function r(e){const t={className:"variable",begin:/\b_+[a-zA-Z]\w*/},n={className:"title",begin:/[a-zA-Z][a-zA-Z_0-9]*_fnc_[a-zA-Z_0-9]+/},a={className:"string",variants:[{begin:'"',end:'"',contains:[{begin:'""',relevance:0}]},{begin:"'",end:"'",contains:[{begin:"''",relevance:0}]}]},i=["break","breakWith","breakOut","breakTo","case","catch","continue","continueWith","default","do","else","exit","exitWith","for","forEach","from","if","local","private","switch","step","then","throw","to","try","waitUntil","while","with"],s=["blufor","civilian","configNull","controlNull","displayNull","diaryRecordNull","east","endl","false","grpNull","independent","lineBreak","locationNull","nil","objNull","opfor","pi","resistance","scriptNull","sideAmbientLife","sideEmpty","sideEnemy","sideFriendly","sideLogic","sideUnknown","taskNull","teamMemberNull","true","west"],o=["abs","accTime","acos","action","actionIDs","actionKeys","actionKeysEx","actionKeysImages","actionKeysNames","actionKeysNamesArray","actionName","actionParams","activateAddons","activatedAddons","activateKey","activeTitleEffectParams","add3DENConnection","add3DENEventHandler","add3DENLayer","addAction","addBackpack","addBackpackCargo","addBackpackCargoGlobal","addBackpackGlobal","addBinocularItem","addCamShake","addCuratorAddons","addCuratorCameraArea","addCuratorEditableObjects","addCuratorEditingArea","addCuratorPoints","addEditorObject","addEventHandler","addForce","addForceGeneratorRTD","addGoggles","addGroupIcon","addHandgunItem","addHeadgear","addItem","addItemCargo","addItemCargoGlobal","addItemPool","addItemToBackpack","addItemToUniform","addItemToVest","addLiveStats","addMagazine","addMagazineAmmoCargo","addMagazineCargo","addMagazineCargoGlobal","addMagazineGlobal","addMagazinePool","addMagazines","addMagazineTurret","addMenu","addMenuItem","addMissionEventHandler","addMPEventHandler","addMusicEventHandler","addonFiles","addOwnedMine","addPlayerScores","addPrimaryWeaponItem","addPublicVariableEventHandler","addRating","addResources","addScore","addScoreSide","addSecondaryWeaponItem","addSwitchableUnit","addTeamMember","addToRemainsCollector","addTorque","addUniform","addUserActionEventHandler","addVehicle","addVest","addWaypoint","addWeapon","addWeaponCargo","addWeaponCargoGlobal","addWeaponGlobal","addWeaponItem","addWeaponPool","addWeaponTurret","addWeaponWithAttachmentsCargo","addWeaponWithAttachmentsCargoGlobal","admin","agent","agents","AGLToASL","aimedAtTarget","aimPos","airDensityCurveRTD","airDensityRTD","airplaneThrottle","airportSide","AISFinishHeal","alive","all3DENEntities","allActiveTitleEffects","allAddonsInfo","allAirports","allControls","allCurators","allCutLayers","allDead","allDeadMen","allDiaryRecords","allDiarySubjects","allDisplays","allEnv3DSoundSources","allGroups","allLODs","allMapMarkers","allMines","allMissionObjects","allObjects","allow3DMode","allowCrewInImmobile","allowCuratorLogicIgnoreAreas","allowDamage","allowDammage","allowedService","allowFileOperations","allowFleeing","allowGetIn","allowService","allowSprint","allPlayers","allSimpleObjects","allSiLine truncated
`,E5="unknown type",v5="Binary content",nae={[ta.JPEG]:"jpg",[ta.JPG]:"jpg",[ta.PNG]:"png",[ta.GIF]:"gif",[ta.WEBP]:"webp"},aae=8,iae=20,sae=19,oae=/[^a-z0-9]/gi,lae="_",cae=/_+/g,nG="T",uae="_",dae=":",hae="-",lc=-1,pae="/",y5="-",mae=":",T5=/^(I?Q\d+(_[A-Z0-9]+)*|F\d+|BF\d+|MXFP\d+(_[A-Z0-9]+)*)$/i,fae=/^UD$/i,gae=/^\d+(\.\d+)?[BbMmKkTt]$/,_ae=/^[Aa]\d+(\.\d+)?[BbMmKkTt]$/,bae=new Set(["GGUF","GGML"]),C5=1e6,Sae=2e3,w5={TOKENS_PER_SECOND:"t/s"},_c={apiKey:"",systemMessage:"",showSystemMessage:!0,theme:Gl.SYSTEM,showThoughtInProgress:!1,disableReasoningParsing:!1,excludeReasoningFromContext:!1,showRawOutputSwitch:!1,keepStatsVisible:!1,showMessageStats:!0,askForTitleConfirmation:!1,pasteLongTextToFileLen:2500,copyTextAttachmentsAsPlainText:!1,pdfAsImage:!1,disableAutoScroll:!1,renderUserContentAsMarkdown:!1,alwaysShowSidebarOnDesktop:!1,autoShowSidebarOnNewChat:!0,autoMicOnEmpty:!1,fullHeightCodeBlocks:!1,showRawModelNames:!1,mcpServers:"[]",mcpServerUsageStats:"{}",agenticMaxTurns:10,agenticMaxToolPreviewLines:25,showToolCallInProgress:!1,alwaysShowAgenticTurns:!1,samplers:"",backend_sampling:!1,temperature:void 0,dynatemp_range:void 0,dynatemp_exponent:void 0,top_k:void 0,top_p:void 0,min_p:void 0,xtc_probability:void 0,xtc_threshold:void 0,typ_p:void 0,repeat_last_n:void 0,repeat_penalty:void 0,presence_penalty:void 0,frequency_penalty:void 0,dry_multiplier:void 0,dry_base:void 0,dry_allowed_length:void 0,dry_penalty_last_n:void 0,max_tokens:void 0,custom:"",pyInterpreterEnabled:!1,enableContinueGeneration:!1},fu={apiKey:"Set the API Key if you are using <code>--api-key</code> option for the server.",systemMessage:"The starting message that defines how model should behave.",showSystemMessage:"Display the system message at the top of each conversation.",theme:"Choose the color theme for the interface. You can choose between System (follows your device settings), Light, or Dark.",pasteLongTextToFileLen:"On pasting long text, it will be converted to a file. You can control the file length by setting the value of this parameter. Value 0 means disable.",copyTextAttachmentsAsPlainText:"When copying a message with text attachments, combine them into a single plain text string instead of a special format that can be pasted back as attachments.",samplers:'The order at which samplers are applied, in simplified way. Default is "top_k;typ_p;top_p;min_p;temperature": top_k->typ_p->top_p->min_p->temperature',backend_sampling:"Enable backend-based samplers. When enabled, supported samplers run on the accelerator backend for faster sampling.",temperature:"Controls the randomness of the generated text by affecting the probability distribution of the output tokens. Higher = more random, lower = more focused.",dynatemp_range:"Addon for the temperature sampler. The added value to the range of dynamic temperature, which adjusts probabilities by entropy of tokens.",dynatemp_exponent:"Addon for the temperature sampler. Smoothes out the probability redistribution based on the most probable token.",top_k:"Keeps only k top tokens.",top_p:"Limits tokens to those that together have a cumulative probability of at least p",min_p:"Limits tokens based on the minimum probability for a token to be considered, relative to the probability of the most likely token.",xtc_probability:"XTC sampler cuts out top tokens; this parameter controls the chance of cutting tokens at all. 0 disables XTC.",xtc_threshold:"XTC sampler cuts out top tokens; this parameter controls the token probability that is required to cut that token.",typ_p:"Sorts and limits tokens based on the difference between log-probability and entropy.",repeat_last_n:"Last n tokens to consider for penalizing repetition",repeat_penalty:"Controls the repetition of token sequences in the generated text",presence_penalty:"Limits tokens based on whether they appear in the output or not.",frequency_penalty:"Limits tokens based on how often they appear in the output.",dry_multiplier:"DRY sampling reduces repetition in generated text even across long contexts. This parameter sets the DRY sampling multiplier.",dry_base:"DRY sampling reduces repetition in generated text even across long contexts. This parameter sets the DRY sampling base value.",dry_allowed_length:"DRY sampling reduces repetition in generated text even across long contexts. This parameter sets the allowed length for DRY sampling.",dry_penalty_last_n:"DRY sampling reduces repetition in generated text even across long contexts. This parameter sets DRY penalty for the last n tokens.",max_tokens:"The maximum number of token per output. Use -1 for infinite (no limit).",custom:"Custom JSON parameters to send to the API. Must be valid JSON format.",showThoughtInProgress:"Expand thought process by default when generating messages.",disableReasoningParsing:"Send reasoning_format=none to prevent server-side extraction of reasoning tokens into separate field",excludeReasoningFromContext:"Strip reasoning content from previous messages Line truncated
https://github.com/highlightjs/highlight.js/issues/2277`),fa=Gt,Un=Cr),ln===void 0&&(ln=!0);const Hr={code:Un,language:fa};$o("before:highlight",Hr);const Us=Hr.result?Hr.result:On(Hr.language,Hr.code,ln);return Us.code=Hr.code,$o("after:highlight",Us),Us}function On(Gt,Cr,ln,Un){const fa=Object.create(null);function Hr(Qt,gr){return Qt.keywords[gr]}function Us(){if(!nr.keywords){ga.addText(Fn);return}let Qt=0;nr.keywordPatternRe.lastIndex=0;let gr=nr.keywordPatternRe.exec(Fn),yr="";for(;gr;){yr+=Fn.substring(Qt,gr.index);const jr=$a.case_insensitive?gr[0].toLowerCase():gr[0],Xn=Hr(nr,jr);if(Xn){const[ai,gd]=Xn;if(ga.addText(yr),yr="",fa[jr]=(fa[jr]||0)+1,fa[jr]<=Ut&&(_a+=gd),ai.startsWith("_"))yr+=gr[0];else{const Yo=$a.classNameAliases[ai]||ai;fn(gr[0],Yo)}}else yr+=gr[0];Qt=nr.keywordPatternRe.lastIndex,gr=nr.keywordPatternRe.exec(Fn)}yr+=Fn.substring(Qt),ga.addText(yr)}function nc(){if(Fn==="")return;let Qt=null;if(typeof nr.subLanguage=="string"){if(!Xe[nr.subLanguage]){ga.addText(Fn);return}Qt=On(nr.subLanguage,Fn,!0,bl[nr.subLanguage]),bl[nr.subLanguage]=Qt._top}else Qt=Ln(Fn,nr.subLanguage.length?nr.subLanguage:null);nr.relevance>0&&(_a+=Qt.relevance),ga.__addSublanguage(Qt._emitter,Qt.language)}function fi(){nr.subLanguage!=null?nc():Us(),Fn=""}function fn(Qt,gr){Qt!==""&&(ga.startScope(gr),ga.addText(Qt),ga.endScope())}function gl(Qt,gr){let yr=1;const jr=gr.length-1;for(;yr<=jr;){if(!Qt._emit[yr]){yr++;continue}const Xn=$a.classNameAliases[Qt[yr]]||Qt[yr],ai=gr[yr];Xn?fn(ai,Xn):(Fn=ai,Us(),Fn=""),yr++}}function _l(Qt,gr){return Qt.scope&&typeof Qt.scope=="string"&&ga.openNode($a.classNameAliases[Qt.scope]||Qt.scope),Qt.beginScope&&(Qt.beginScope._wrap?(fn(Fn,$a.classNameAliases[Qt.beginScope._wrap]||Qt.beginScope._wrap),Fn=""):Qt.beginScope._multi&&(gl(Qt.beginScope,gr),Fn="")),nr=Object.create(Qt,{parent:{value:nr}}),nr}function Ho(Qt,gr,yr){let jr=E(Qt.endRe,yr);if(jr){if(Qt["on:end"]){const Xn=new e(Qt);Qt["on:end"](gr,Xn),Xn.isMatchIgnored&&(jr=!1)}if(jr){for(;Qt.endsParent&&Qt.parent;)Qt=Qt.parent;return Qt}}if(Qt.endsWithParent)return Ho(Qt.parent,gr,yr)}function md(Qt){return nr.matcher.regexIndex===0?(Fn+=Qt[0],1):(Ti=!0,0)}function fd(Qt){const gr=Qt[0],yr=Qt.rule,jr=new e(yr),Xn=[yr.__beforeBegin,yr["on:begin"]];for(const ai of Xn)if(ai&&(ai(Qt,jr),jr.isMatchIgnored))return md(gr);return yr.skip?Fn+=gr:(yr.excludeBegin&&(Fn+=gr),fi(),!yr.returnBegin&&!yr.excludeBegin&&(Fn=gr)),_l(yr,Qt),yr.returnBegin?0:gr.length}function uu(Qt){const gr=Qt[0],yr=Cr.substring(Qt.index),jr=Ho(nr,Qt,yr);if(!jr)return ut;const Xn=nr;nr.endScope&&nr.endScope._wrap?(fi(),fn(gr,nr.endScope._wrap)):nr.endScope&&nr.endScope._multi?(fi(),gl(nr.endScope,Qt)):Xn.skip?Fn+=gr:(Xn.returnEnd||Xn.excludeEnd||(Fn+=gr),fi(),Xn.excludeEnd&&(Fn=gr));do nr.scope&&ga.closeNode(),!nr.skip&&!nr.subLanguage&&(_a+=nr.relevance),nr=nr.parent;while(nr!==jr.parent);return jr.starts&&_l(jr.starts,Qt),Xn.returnEnd?0:gr.length}function wh(){const Qt=[];for(let gr=nr;gr!==$a;gr=gr.parent)gr.scope&&Qt.unshift(gr.scope);Qt.forEach(gr=>ga.openNode(gr))}let Eo={};function ac(Qt,gr){const yr=gr&&gr[0];if(Fn+=Qt,yr==null)return fi(),0;if(Eo.type==="begin"&&gr.type==="end"&&Eo.index===gr.index&&yr===""){if(Fn+=Cr.slice(gr.index,gr.index+1),!Pt){const jr=new Error(`0 width match regex (${Gt})`);throw jr.languageName=Gt,jr.badRule=Eo.rule,jr}return 1}if(Eo=gr,gr.type==="begin")return fd(gr);if(gr.type==="illegal"&&!ln){const jr=new Error('Illegal lexeme "'+yr+'" for mode "'+(nr.scope||"<unnamed>")+'"');throw jr.mode=nr,jr}else if(gr.type==="end"){const jr=uu(gr);if(jr!==ut)return jr}if(gr.type==="illegal"&&yr==="")return Fn+=`
`,1;if(vo>1e5&&vo>gr.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Fn+=yr,yr.length}const $a=Bi(Gt);if(!$a)throw st(kt.replace("{}",Gt)),new Error('Unknown language: "'+Gt+'"');const du=zt($a);let ic="",nr=Un||du;const bl={},ga=new Tt.__emitter(Tt);wh();let Fn="",_a=0,ni=0,vo=0,Ti=!1;try{if($a.__emitTokens)$a.__emitTokens(Cr,ga);else{for(nr.matcher.considerAll();;){vo++,Ti?Ti=!1:nr.matcher.considerAll(),nr.matcher.lastIndex=ni;const Qt=nr.matcher.exec(Cr);if(!Qt)break;const gr=Cr.substring(ni,Qt.index),yr=ac(gr,Qt);ni=Qt.index+yr}ac(Cr.substring(ni))}return ga.finalize(),ic=ga.toHTML(),{language:Gt,value:ic,relevance:_a,illegal:!1,_emitter:ga,_top:nr}}catch(Qt){if(Qt.message&&Qt.message.includes("Illegal"))return{language:Gt,value:Ft(Cr),illegal:!0,relevance:0,_illegalBy:{message:Qt.message,index:ni,context:Cr.slice(ni-100,ni+100),mode:Qt.mode,resultSoFar:ic},_emitter:ga};if(Pt)return{language:Gt,value:Ft(Cr),illegal:!1,relevance:0,errorRaised:Qt,_emitter:ga,_top:nr};throw Qt}}function vr(Gt){const Cr={value:Ft(Gt),illegal:!1,relevance:0,_top:bt,_emitter:new Tt.__emitter(Tt)};return Cr._emitter.addText(Gt),Cr}function Ln(Gt,Cr){Cr=Cr||Tt.languages||Object.keys(Xe);const ln=vr(Gt),Un=Cr.filter(Bi).filter(So).map(fi=>On(fi,Gt,!1));Un.unshift(ln);const fa=Un.sort((fi,fn)=>{if(fi.relevance!==fn.relevance)return fn.relevance-fi.relevance;if(fi.language&&fn.language){if(Bi(fi.language).supersetOf===fn.language)return 1;if(Bi(fn.language).supersetOf===fi.language)return-1}return 0}),[Hr,Us]=fa,nc=Hr;return nc.secondBest=Us,nc}function Fs(Gt,Cr,ln){const Un=Cr&&pt[Cr]||ln;Gt.classList.add("hljs"),Gt.classList.add(`language-${Un}`)}function mi(Gt){let Cr=null;const ln=Dt(Gt);if(St(ln))return;if($o("before:highlightElement",{el:Gt,language:ln}),Gt.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",Gt);return}if(Gt.children.length>0&&(Tt.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(Gt)),Tt.throwUnescapedHTML))throw new Ot("One of your code blocks includes unescaped HTML.",Gt.innerHTML);Cr=Gt;const Un=Cr.textContent,fa=ln?ur(Un,{language:ln,ignoreIllegals:!0}):Ln(Un);Gt.innerHTML=fa.value,Gt.dataset.highlighted="yes",Fs(Gt,ln,fa.language),Gt.result={language:fa.language,re:fa.relevance,relevance:fa.relevance},fa.secondBest&&(Gt.secondBest={language:fa.secondBest.language,relevance:fa.secondBest.relevance}),$o("after:highlightElement",{el:Gt,result:fa,text:Un})}function _o(Gt){Tt=Jt(Tt,Gt)}const gs=()=>{ri(),Ae("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Ki(){ri(),Ae("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let bo=!1;function ri(){function Gt(){ri()}if(document.readyState==="loading"){bo||window.addEventListener("DOMContentLoaded",Gt,!1),bo=!0;return}document.querySelectorAll(Tt.cssSelector).forEach(mi)}function cu(Gt,Cr){let ln=null;try{ln=Cr(Re)}catch(Un){if(st("Language definition for '{}' could not be registered.".replace("{}",Gt)),Pt)st(Un);else throw Un;ln=bt}ln.name||(ln.name=Gt),Xe[Gt]=ln,ln.rawDefinition=Cr.bind(null,Re),ln.aliases&&ia(ln.aliases,{languageName:Gt})}function ji(Gt){delete Xe[Gt];for(const Cr of Object.keys(pt))pt[Cr]===Gt&&delete pt[Cr]}function rc(){return Object.keys(Xe)}function Bi(Gt){return Gt=(Gt||"").toLowerCase(),Xe[Gt]||Xe[pt[Gt]]}function ia(Gt,{languageName:Cr}){typeof Gt=="string"&&(Gt=[Gt]),Gt.forEach(ln=>{pt[ln.toLowerCase()]=Cr})}function So(Gt){const Cr=Bi(Gt);return Cr&&!Cr.disableAutodetect}function Bs(Gt){Gt["before:highlightBlock"]&&!Gt["before:highlightElement"]&&(Gt["before:highlightElement"]=Cr=>{Gt["before:highlightBlock"](Object.assign({block:Cr.el},Cr))}),Gt["after:highlightBlock"]&&!Gt["after:highlightElement"]&&(Gt["after:highlightElement"]=Cr=>{Gt["after:highlightBlock"](Object.assign({block:Cr.el},Cr))})}function Ch(Gt){Bs(Gt),Ct.push(Gt)}function fl(Gt){const Cr=Ct.indexOf(Gt);Cr!==-1&&Ct.splice(Cr,1)}function $o(Gt,Cr){const ln=Gt;Ct.forEach(function(Un){Un[ln]&&Un[ln](Cr)})}function pd(Gt){return Ae("10.7.0","highlightBlock will be removed entirely in v12.0"),Ae("10.7.0","Please use highlightElement now."),mi(Gt)}Object.assign(Re,{highlight:ur,highlightAuto:Ln,highlightAll:ri,highlightElement:mi,highlightBlock:pd,configure:_o,initHighlighting:gs,initHighlightingOnLoad:Ki,registerLanguage:cu,unregisterLanguage:ji,listLanguages:rc,getLanguage:Bi,registerAliases:ia,autoDetection:So,inherit:Jt,addPlugin:Ch,removePlugin:fl}),Re.debugMode=function(){Pt=!1},Re.safeMode=function(){Pt=!0},Re.versionString=lt,Re.regex={concat:g,lookahead:h,either:_,optional:f,anyNumberOfTimes:m};for(const Gt in be)typeof be[Gt]=="object"&&t(be[Gt]);return Object.assign(Re,be),Re},xt=yt({}) Line truncated
`},f]}}return pT=a,pT}var mT,mk;function Ase(){if(mk)return mT;mk=1;function t(e){const r="[a-zA-Z_][\\w.]*",n="<\\?(lasso(script)?|=)",a="\\]|\\?>",i={$pattern:r+"|&[lg]t;",literal:"true false none minimal full all void and or not bw nbw ew new cn ncn lt lte gt gte eq neq rx nrx ft",built_in:"array date decimal duration integer map pair string tag xml null boolean bytes keyword list locale queue set stack staticarray local var variable global data self inherited currentcapture givenblock",keyword:"cache database_names database_schemanames database_tablenames define_tag define_type email_batch encode_set html_comment handle handle_error header if inline iterate ljax_target link link_currentaction link_currentgroup link_currentrecord link_detail link_firstgroup link_firstrecord link_lastgroup link_lastrecord link_nextgroup link_nextrecord link_prevgroup link_prevrecord log loop namespace_using output_none portal private protect records referer referrer repeating resultset rows search_args search_arguments select sort_args sort_arguments thread_atomic value_list while abort case else fail_if fail_ifnot fail if_empty if_false if_null if_true loop_abort loop_continue loop_count params params_up return return_value run_children soap_definetag soap_lastrequest soap_lastresponse tag_name ascending average by define descending do equals frozen group handle_failure import in into join let match max min on order parent protected provide public require returnhome skip split_thread sum take thread to trait type where with yield yieldhome"},s=e.COMMENT("<!--","-->",{relevance:0}),o={className:"meta",begin:"\\[noprocess\\]",starts:{end:"\\[/noprocess\\]",returnEnd:!0,contains:[s]}},l={className:"meta",begin:"\\[/noprocess|"+n},c={className:"symbol",begin:"'"+r+"'"},u=[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.inherit(e.C_NUMBER_MODE,{begin:e.C_NUMBER_RE+"|(-?infinity|NaN)\\b"}),e.inherit(e.APOS_STRING_MODE,{illegal:null}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null}),{className:"string",begin:"`",end:"`"},{variants:[{begin:"[#$]"+r},{begin:"#",end:"\\d+",illegal:"\\W"}]},{className:"type",begin:"::\\s*",end:r,illegal:"\\W"},{className:"params",variants:[{begin:"-(?!infinity)"+r,relevance:0},{begin:"(\\.\\.\\.)"}]},{begin:/(->|\.)\s*/,relevance:0,contains:[c]},{className:"class",beginKeywords:"define",returnEnd:!0,end:"\\(|=>",contains:[e.inherit(e.TITLE_MODE,{begin:r+"(=(?!>))?|[-+*/%](?!>)"})]}];return{name:"Lasso",aliases:["ls","lassoscript"],case_insensitive:!0,keywords:i,contains:[{className:"meta",begin:a,relevance:0,starts:{end:"\\[|"+n,returnEnd:!0,relevance:0,contains:[s]}},o,l,{className:"meta",begin:"\\[no_square_brackets",starts:{end:"\\[/no_square_brackets\\]",keywords:i,contains:[{className:"meta",begin:a,relevance:0,starts:{end:"\\[noprocess\\]|"+n,returnEnd:!0,contains:[s]}},o,l].concat(u)}},{className:"meta",begin:"\\[",relevance:0},{className:"meta",begin:"^#!",end:"lasso9$",relevance:10}].concat(u)}}return mT=t,mT}var fT,fk;function Rse(){if(fk)return fT;fk=1;function t(e){const n=e.regex.either(...["(?:NeedsTeXFormat|RequirePackage|GetIdInfo)","Provides(?:Expl)?(?:Package|Class|File)","(?:DeclareOption|ProcessOptions)","(?:documentclass|usepackage|input|include)","makeat(?:letter|other)","ExplSyntax(?:On|Off)","(?:new|renew|provide)?command","(?:re)newenvironment","(?:New|Renew|Provide|Declare)(?:Expandable)?DocumentCommand","(?:New|Renew|Provide|Declare)DocumentEnvironment","(?:(?:e|g|x)?def|let)","(?:begin|end)","(?:part|chapter|(?:sub){0,2}section|(?:sub)?paragraph)","caption","(?:label|(?:eq|page|name)?ref|(?:paren|foot|super)?cite)","(?:alpha|beta|[Gg]amma|[Dd]elta|(?:var)?epsilon|zeta|eta|[Tt]heta|vartheta)","(?:iota|(?:var)?kappa|[Ll]ambda|mu|nu|[Xx]i|[Pp]i|varpi|(?:var)rho)","(?:[Ss]igma|varsigma|tau|[Uu]psilon|[Pp]hi|varphi|chi|[Pp]si|[Oo]mega)","(?:frac|sum|prod|lim|infty|times|sqrt|leq|geq|left|right|middle|[bB]igg?)","(?:[lr]angle|q?quad|[lcvdi]?dots|d?dot|hat|tilde|bar)"].map(D=>D+"(?![a-zA-Z@:_])")),a=new RegExp(["(?:__)?[a-zA-Z]{2,}_[a-zA-Z](?:_?[a-zA-Z])+:[a-zA-Z]*","[lgc]__?[a-zA-Z](?:_?[a-zA-Z])*_[a-zA-Z]{2,}","[qs]__?[a-zA-Z](?:_?[a-zA-Z])+","use(?:_i)?:[a-zA-Z]*","(?:else|fi|or):","(?:if|cs|exp):w","(?:hbox|vbox):n","::[a-zA-Z]_unbraced","::[a-zA-Z:]"].map(D=>D+"(?![a-zA-Z:_])").join("|")),i=[{begin:/[a-zA-Z@]+/},{begin:/[^a-zA-Z@]?/}],s=[{begin:/\^{6}[0-9a-f]{6}/},{begin:/\^{5}[0-9a-f]{5}/},{begin:/\^{4}[0-9a-f]{4}/},{begin:/\^{3}[0-9a-f]{3}/},{begin:/\^{2}[0-9a-f]{2}/},{begin:/\^{2}[\u0000-\u007f]/}],o={className:"keyword",begin:/\\/,relevance:0,contains:[{endsParent:!0,begin:n},{endsParent:!0,begin:a},{endsParent:!0,variants:s},{endsParent:!0,relevance:0,variants:i}]},l={className:"params",relevance:0,begin:/#+\d?/},c={variants:s},u={className:"built_in",relevance:0,begin:/[$&^_]/},d={className:"meta",begin:/% ?!(T[eE]X|tex|BIB|bib)/,end:"$",relevance:10},h=e.COMMENT("%","$",{relevance:0}),m=[o,l,c,u,d,h],f={begin:/\{/,end:/\}/,relevance:0,contains:["self",...m]},g=e.inheri Line truncated
]`,g={scope:"string",variants:[d,u,h,m]},b={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},_=["false","null","true"],S=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],E=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],v={keyword:S,literal:(K=>{const z=[];return K.forEach(re=>{z.push(re),re.toLowerCase()===re?z.push(re.toUpperCase()):z.push(re.toLowerCase())}),z})(_),built_in:E},T=K=>K.map(z=>z.replace(/\|\d+$/,"")),w={variants:[{match:[/new/,r.concat(f,"+"),r.concat("(?!",T(E).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},A=r.concat(a,"\\b(?!\\()"),I={variants:[{match:[r.concat(/::/,r.lookahead(/(?!class\b)/)),A],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,r.concat(/::/,r.lookahead(/(?!class\b)/)),A],scope:{1:"title.class",3:"variable.constant"}},{match:[i,r.concat("::",r.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},x={scope:"attr",match:r.concat(a,r.lookahead(":"),r.lookahead(/(?!::)/))},D={relevance:0,begin:/\(/,end:/\)/,keywords:v,contains:[x,o,I,e.C_BLOCK_COMMENT_MODE,g,b,w]},$={relevance:0,match:[/\b/,r.concat("(?!fn\\b|function\\b|",T(S).join("\\b|"),"|",T(E).join("\\b|"),"\\b)"),a,r.concat(f,"*"),r.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[D]};D.contains.push($);const H=[x,I,e.C_BLOCK_COMMENT_MODE,g,b,w],G={begin:r.concat(/#\[\s*\\?/,r.either(i,s)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:_,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:_,keyword:["new","array"]},contains:["self",...H]},...H,{scope:"meta",variants:[{match:i},{match:s}]}]};return{case_insensitive:!1,keywords:v,contains:[G,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},l,{scope:"variable.language",match:/\$this\b/},o,$,I,{match:[/const/,/\s/,a],scope:{1:"keyword",3:"variable.constant"}},w,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:v,contains:["self",G,o,I,e.C_BLOCK_COMMENT_MODE,g,b]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywor Line truncated
]*;`,relevance:0},{begin:"[vp][0-9]+"}]}}return RC=t,RC}var OC,O9;function Goe(){if(O9)return OC;O9=1;function t(e){const r="[a-z][a-zA-Z0-9_]*",n={className:"string",begin:"\\$.{1}"},a={className:"symbol",begin:"#"+e.UNDERSCORE_IDENT_RE};return{name:"Smalltalk",aliases:["st"],keywords:["self","super","nil","true","false","thisContext"],contains:[e.COMMENT('"','"'),e.APOS_STRING_MODE,{className:"type",begin:"\\b[A-Z][A-Za-z0-9_]*",relevance:0},{begin:r+":",relevance:0},e.C_NUMBER_MODE,a,n,{begin:"\\|[ ]*"+r+"([ ]+"+r+")*[ ]*\\|",returnBegin:!0,end:/\|/,illegal:/\S/,contains:[{begin:"(\\|[ ]*)?"+r}]},{begin:"#\\(",end:"\\)",contains:[e.APOS_STRING_MODE,n,e.C_NUMBER_MODE,a]}]}}return OC=t,OC}var NC,N9;function qoe(){if(N9)return NC;N9=1;function t(e){return{name:"SML (Standard ML)",aliases:["ml"],keywords:{$pattern:"[a-z_]\\w*!?",keyword:"abstype and andalso as case datatype do else end eqtype exception fn fun functor handle if in include infix infixr let local nonfix of op open orelse raise rec sharing sig signature struct structure then type val with withtype where while",built_in:"array bool char exn int list option order real ref string substring vector unit word",literal:"true false NONE SOME LESS EQUAL GREATER nil"},illegal:/\/\/|>>/,contains:[{className:"literal",begin:/\[(\|\|)?\]|\(\)/,relevance:0},e.COMMENT("\\(\\*","\\*\\)",{contains:["self"]}),{className:"symbol",begin:"'[A-Za-z_](?!')[\\w']*"},{className:"type",begin:"`[A-Z][\\w']*"},{className:"type",begin:"\\b[A-Z][\\w']*",relevance:0},{begin:"[a-z_]\\w*'[\\w']*"},e.inherit(e.APOS_STRING_MODE,{className:"string",relevance:0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null}),{className:"number",begin:"\\b(0[xX][a-fA-F0-9_]+[Lln]?|0[oO][0-7_]+[Lln]?|0[bB][01_]+[Lln]?|[0-9][0-9_]*([Lln]|(\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)",relevance:0},{begin:/[-=]>/}]}}return NC=t,NC}var IC,I9;function zoe(){if(I9)return IC;I9=1;function t(e){const r={className:"variable",begin:/\b_+[a-zA-Z]\w*/},n={className:"title",begin:/[a-zA-Z][a-zA-Z_0-9]*_fnc_[a-zA-Z_0-9]+/},a={className:"string",variants:[{begin:'"',end:'"',contains:[{begin:'""',relevance:0}]},{begin:"'",end:"'",contains:[{begin:"''",relevance:0}]}]},i=["break","breakWith","breakOut","breakTo","case","catch","continue","continueWith","default","do","else","exit","exitWith","for","forEach","from","if","local","private","switch","step","then","throw","to","try","waitUntil","while","with"],s=["blufor","civilian","configNull","controlNull","displayNull","diaryRecordNull","east","endl","false","grpNull","independent","lineBreak","locationNull","nil","objNull","opfor","pi","resistance","scriptNull","sideAmbientLife","sideEmpty","sideEnemy","sideFriendly","sideLogic","sideUnknown","taskNull","teamMemberNull","true","west"],o=["abs","accTime","acos","action","actionIDs","actionKeys","actionKeysEx","actionKeysImages","actionKeysNames","actionKeysNamesArray","actionName","actionParams","activateAddons","activatedAddons","activateKey","activeTitleEffectParams","add3DENConnection","add3DENEventHandler","add3DENLayer","addAction","addBackpack","addBackpackCargo","addBackpackCargoGlobal","addBackpackGlobal","addBinocularItem","addCamShake","addCuratorAddons","addCuratorCameraArea","addCuratorEditableObjects","addCuratorEditingArea","addCuratorPoints","addEditorObject","addEventHandler","addForce","addForceGeneratorRTD","addGoggles","addGroupIcon","addHandgunItem","addHeadgear","addItem","addItemCargo","addItemCargoGlobal","addItemPool","addItemToBackpack","addItemToUniform","addItemToVest","addLiveStats","addMagazine","addMagazineAmmoCargo","addMagazineCargo","addMagazineCargoGlobal","addMagazineGlobal","addMagazinePool","addMagazines","addMagazineTurret","addMenu","addMenuItem","addMissionEventHandler","addMPEventHandler","addMusicEventHandler","addonFiles","addOwnedMine","addPlayerScores","addPrimaryWeaponItem","addPublicVariableEventHandler","addRating","addResources","addScore","addScoreSide","addSecondaryWeaponItem","addSwitchableUnit","addTeamMember","addToRemainsCollector","addTorque","addUniform","addUserActionEventHandler","addVehicle","addVest","addWaypoint","addWeapon","addWeaponCargo","addWeaponCargoGlobal","addWeaponGlobal","addWeaponItem","addWeaponPool","addWeaponTurret","addWeaponWithAttachmentsCargo","addWeaponWithAttachmentsCargoGlobal","admin","agent","agents","AGLToASL","aimedAtTarget","aimPos","airDensityCurveRTD","airDensityRTD","airplaneThrottle","airportSide","AISFinishHeal","alive","all3DENEntities","allActiveTitleEffects","allAddonsInfo","allAirports","allControls","allCurators","allCutLayers","allDead","allDeadMen","allDiaryRecords","allDiarySubjects","allDisplays","allEnv3DSoundSources","allGroups","allLODs","allMapMarkers","allMines","allMissionObjects","allObjects","allow3DMode","allowCrewInImmobile","allowCuratorLogicIgnoreAreas","allowDamage","allowDammage","allowedService","allowFileOperations","allowFleeing","allowGetIn","allowService","allowSprint","allPlayers","allSimpleObjects","allSiLine truncated
]*?"'`},{begin:`"[^\r
"]*"`}]},{className:"built_in",variants:[{begin:"\\b(abs|acos|asin|atan|atan2|atanh|ceil|cloglog|comb|cos|digamma|exp|floor|invcloglog|invlogit|ln|lnfact|lnfactorial|lngamma|log|log10|max|min|mod|reldif|round|sign|sin|sqrt|sum|tan|tanh|trigamma|trunc|betaden|Binomial|binorm|binormal|chi2|chi2tail|dgammapda|dgammapdada|dgammapdadx|dgammapdx|dgammapdxdx|F|Fden|Ftail|gammaden|gammap|ibeta|invbinomial|invchi2|invchi2tail|invF|invFtail|invgammap|invibeta|invnchi2|invnFtail|invnibeta|invnorm|invnormal|invttail|nbetaden|nchi2|nFden|nFtail|nibeta|norm|normal|normalden|normd|npnchi2|tden|ttail|uniform|abbrev|char|index|indexnot|length|lower|ltrim|match|plural|proper|real|regexm|regexr|regexs|reverse|rtrim|string|strlen|strlower|strltrim|strmatch|strofreal|strpos|strproper|strreverse|strrtrim|strtrim|strupper|subinstr|subinword|substr|trim|upper|word|wordcount|_caller|autocode|byteorder|chop|clip|cond|e|epsdouble|epsfloat|group|inlist|inrange|irecode|matrix|maxbyte|maxdouble|maxfloat|maxint|maxlong|mi|minbyte|mindouble|minfloat|minint|minlong|missing|r|recode|replay|return|s|scalar|d|date|day|dow|doy|halfyear|mdy|month|quarter|week|year|d|daily|dofd|dofh|dofm|dofq|dofw|dofy|h|halfyearly|hofd|m|mofd|monthly|q|qofd|quarterly|tin|twithin|w|weekly|wofd|y|yearly|yh|ym|yofd|yq|yw|cholesky|colnumb|colsof|corr|det|diag|diag0cnt|el|get|hadamard|I|inv|invsym|issym|issymmetric|J|matmissing|matuniform|mreldif|nullmat|rownumb|rowsof|sweep|syminv|trace|vec|vecdiag)(?=\\()"}]},e.COMMENT("^[ ]*\\*.*$",!1),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]}}return Nw=r,Nw}var Iw,N7;function $oe(){if(N7)return Iw;N7=1;function r(e){return{name:"STEP Part 21",aliases:["p21","step","stp"],case_insensitive:!0,keywords:{$pattern:"[A-Z_][A-Z0-9_.]*",keyword:["HEADER","ENDSEC","DATA"]},contains:[{className:"meta",begin:"ISO-10303-21;",relevance:10},{className:"meta",begin:"END-ISO-10303-21;",relevance:10},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.COMMENT("/\\*\\*!","\\*/"),e.C_NUMBER_MODE,e.inherit(e.APOS_STRING_MODE,{illegal:null}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null}),{className:"string",begin:"'",end:"'"},{className:"symbol",variants:[{begin:"#",end:"\\d+",illegal:"\\W"}]}]}}return Iw=r,Iw}var kw,I7;function Goe(){if(I7)return kw;I7=1;const r=c=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:c.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[c.APOS_STRING_MODE,c.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:c.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),e=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],t=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],n=[...e,...t],a=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),i=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target Line truncated
"]*"`}]},{className:"built_in",variants:[{begin:"\\b(abs|acos|asin|atan|atan2|atanh|ceil|cloglog|comb|cos|digamma|exp|floor|invcloglog|invlogit|ln|lnfact|lnfactorial|lngamma|log|log10|max|min|mod|reldif|round|sign|sin|sqrt|sum|tan|tanh|trigamma|trunc|betaden|Binomial|binorm|binormal|chi2|chi2tail|dgammapda|dgammapdada|dgammapdadx|dgammapdx|dgammapdxdx|F|Fden|Ftail|gammaden|gammap|ibeta|invbinomial|invchi2|invchi2tail|invF|invFtail|invgammap|invibeta|invnchi2|invnFtail|invnibeta|invnorm|invnormal|invttail|nbetaden|nchi2|nFden|nFtail|nibeta|norm|normal|normalden|normd|npnchi2|tden|ttail|uniform|abbrev|char|index|indexnot|length|lower|ltrim|match|plural|proper|real|regexm|regexr|regexs|reverse|rtrim|string|strlen|strlower|strltrim|strmatch|strofreal|strpos|strproper|strreverse|strrtrim|strtrim|strupper|subinstr|subinword|substr|trim|upper|word|wordcount|_caller|autocode|byteorder|chop|clip|cond|e|epsdouble|epsfloat|group|inlist|inrange|irecode|matrix|maxbyte|maxdouble|maxfloat|maxint|maxlong|mi|minbyte|mindouble|minfloat|minint|minlong|missing|r|recode|replay|return|s|scalar|d|date|day|dow|doy|halfyear|mdy|month|quarter|week|year|d|daily|dofd|dofh|dofm|dofq|dofw|dofy|h|halfyearly|hofd|m|mofd|monthly|q|qofd|quarterly|tin|twithin|w|weekly|wofd|y|yearly|yh|ym|yofd|yq|yw|cholesky|colnumb|colsof|corr|det|diag|diag0cnt|el|get|hadamard|I|inv|invsym|issym|issymmetric|J|matmissing|matuniform|mreldif|nullmat|rownumb|rowsof|sweep|syminv|trace|vec|vecdiag)(?=\\()"}]},e.COMMENT("^[ ]*\\*.*$",!1),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]}}return MC=t,MC}var kC,k9;function Voe(){if(k9)return kC;k9=1;function t(e){return{name:"STEP Part 21",aliases:["p21","step","stp"],case_insensitive:!0,keywords:{$pattern:"[A-Z_][A-Z0-9_.]*",keyword:["HEADER","ENDSEC","DATA"]},contains:[{className:"meta",begin:"ISO-10303-21;",relevance:10},{className:"meta",begin:"END-ISO-10303-21;",relevance:10},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.COMMENT("/\\*\\*!","\\*/"),e.C_NUMBER_MODE,e.inherit(e.APOS_STRING_MODE,{illegal:null}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null}),{className:"string",begin:"'",end:"'"},{className:"symbol",variants:[{begin:"#",end:"\\d+",illegal:"\\W"}]}]}}return kC=t,kC}var PC,P9;function Woe(){if(P9)return PC;P9=1;const t=c=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:c.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[c.APOS_STRING_MODE,c.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:c.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),e=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],r=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],n=[...e,...r],a=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),i=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target Line truncated
(multipart)?`,end:`\\]
`},{className:"string",begin:"\\d{4}-\\d{2}-\\d{2}(\\s+)\\d{2}:\\d{2}:\\d{2}.\\d+Z"},{className:"string",begin:"(\\+|-)\\d+"},{className:"keyword",relevance:10,variants:[{begin:"^(test|testing|success|successful|failure|error|skip|xfail|uxsuccess)(:?)\\s+(test)?"},{begin:"^progress(:?)(\\s+)?(pop|push)?"},{begin:"^tags:"},{begin:"^time:"}]}]}}return Mw=r,Mw}var Dw,M7;function qoe(){if(M7)return Dw;M7=1;function r(x){return x?typeof x=="string"?x:x.source:null}function e(x){return t("(?=",x,")")}function t(...x){return x.map(I=>r(I)).join("")}function n(x){const N=x[x.length-1];return typeof N=="object"&&N.constructor===Object?(x.splice(x.length-1,1),N):{}}function a(...x){return"("+(n(x).capture?"":"?:")+x.map(D=>r(D)).join("|")+")"}const i=x=>t(/\b/,x,/\w$/.test(x)?/\b/:/\B/),s=["Protocol","Type"].map(i),o=["init","self"].map(i),l=["Any","Self"],c=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],u=["false","nil","true"],d=["assignment","associativity","higherThan","left","lowerThan","none","right"],h=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],p=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],m=a(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),g=a(m,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),b=t(m,g,"*"),_=a(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),v=a(_,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),y=t(_,v,"*"),E=t(/[A-Z]/,v,"*"),S=["attached","autoclosure",t(/convention\(/,a("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",t(/objc\(/,y,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],w=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function C(x){const N={match:/\s+/,relevance:0},I=x.COMMENT("/\\*","\\*/",{contains:["self"]}),D=[x.C_LINE_COMMENT_MODE,I],H={match:[/\./,a(...s,...o)],className:{2:"keyword"}},q={match:t(/\./,a(...c)),relevance:0},$=c.filter(ut=>typeof ut=="string").concat(["_|0"]),K=c.filter(ut=>typeof ut!="string").concat(l).map(i),z={variants:[{className:"keyword",match:a(...K,...o)}]},re={$pattern:a(/\b\w+/,/#\w+/),keyword:$.concat(h),literal:u},W=[H,q,z],ie={match:t(/\./,a(...p)),relevance:0},k={className:"built_in",match:t(/\b/,a(...p),/(?=\()/)},B=[ie,k],te={match:/->/,relevance:0},O={className:"operator",relevance:0,variants Line truncated
`},{className:"string",begin:"\\d{4}-\\d{2}-\\d{2}(\\s+)\\d{2}:\\d{2}:\\d{2}.\\d+Z"},{className:"string",begin:"(\\+|-)\\d+"},{className:"keyword",relevance:10,variants:[{begin:"^(test|testing|success|successful|failure|error|skip|xfail|uxsuccess)(:?)\\s+(test)?"},{begin:"^progress(:?)(\\s+)?(pop|push)?"},{begin:"^tags:"},{begin:"^time:"}]}]}}return LC=t,LC}var FC,F9;function joe(){if(F9)return FC;F9=1;function t(A){return A?typeof A=="string"?A:A.source:null}function e(A){return r("(?=",A,")")}function r(...A){return A.map(x=>t(x)).join("")}function n(A){const I=A[A.length-1];return typeof I=="object"&&I.constructor===Object?(A.splice(A.length-1,1),I):{}}function a(...A){return"("+(n(A).capture?"":"?:")+A.map(D=>t(D)).join("|")+")"}const i=A=>r(/\b/,A,/\w$/.test(A)?/\b/:/\B/),s=["Protocol","Type"].map(i),o=["init","self"].map(i),l=["Any","Self"],c=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],u=["false","nil","true"],d=["assignment","associativity","higherThan","left","lowerThan","none","right"],h=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],m=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],f=a(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),g=a(f,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),b=r(f,g,"*"),_=a(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),S=a(_,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),E=r(_,S,"*"),y=r(/[A-Z]/,S,"*"),v=["attached","autoclosure",r(/convention\(/,a("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",r(/objc\(/,E,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],T=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function w(A){const I={match:/\s+/,relevance:0},x=A.COMMENT("/\\*","\\*/",{contains:["self"]}),D=[A.C_LINE_COMMENT_MODE,x],$={match:[/\./,a(...s,...o)],className:{2:"keyword"}},H={match:r(/\./,a(...c)),relevance:0},G=c.filter(ut=>typeof ut=="string").concat(["_|0"]),K=c.filter(ut=>typeof ut!="string").concat(l).map(i),z={variants:[{className:"keyword",match:a(...K,...o)}]},re={$pattern:a(/\b\w+/,/#\w+/),keyword:G.concat(h),literal:u},W=[$,H,z],ie={match:r(/\./,a(...m)),relevance:0},M={className:"built_in",match:r(/\b/,a(...m),/(?=\()/)},B=[ie,M],J={match:/->/,relevance:0},N={className:"operator",relevance:0,variants: Line truncated
`)}const a=n.map(i=>{if(i.type===Kr.MCP_PROMPT){const s=i;return{type:Kr.MCP_PROMPT,name:s.name,serverName:s.serverName,promptName:s.promptName,content:s.content,arguments:s.arguments}}return{type:Kr.TEXT,name:i.name,content:i.content}});return`${JSON.stringify(r)}
${JSON.stringify(a,null,2)}`}function pce(r){const e={message:r,textAttachments:[],mcpPromptAttachments:[]};if(!r.startsWith('"'))return e;try{let t=-1,n=!1;for(let u=1;u<r.length;u++){const d=r[u];if(n){n=!1;continue}if(d==="\\"){n=!0;continue}if(d==='"'){t=u;break}}if(t===-1)return e;const a=r.substring(0,t+1),i=r.substring(t+1).trim(),s=JSON.parse(a);if(!i||!i.startsWith("["))return{message:s,textAttachments:[],mcpPromptAttachments:[]};const o=JSON.parse(i),l=[],c=[];for(const u of o)mce(u)?c.push({type:Kr.MCP_PROMPT,name:u.name,serverName:u.serverName,promptName:u.promptName,content:u.content,arguments:u.arguments}):gce(u)&&l.push({type:Kr.TEXT,name:u.name,content:u.content});return{message:s,textAttachments:l,mcpPromptAttachments:c}}catch{return e}}function mce(r){if(typeof r!="object"||r===null)return!1;const e=r;return(e.type===Kr.MCP_PROMPT||e.type==="MCP_PROMPT")&&typeof e.name=="string"&&typeof e.serverName=="string"&&typeof e.promptName=="string"&&typeof e.content=="string"}function gce(r){if(typeof r!="object"||r===null)return!1;const e=r;return(e.type===Kr.TEXT||e.type==="TEXT")&&typeof e.name=="string"&&typeof e.content=="string"}function u0(r){if(!r)return"FILE";if(r.includes("/")){const e=r.split("/").pop();if(e)return e.includes(".")?e.split(".").pop()?.toUpperCase()||"FILE":e.toUpperCase()}if(r.includes(".")){const e=r.split(".").pop();if(e)return e.toUpperCase()}return r.toUpperCase()}function m3(r,e=150){return r.length>e?r.slice(0,e)+"...":r}function tl(r){switch(r){case ea.JPEG:case ea.PNG:case ea.GIF:case ea.WEBP:case ea.SVG:return Dn.IMAGE;case ja.MP3_MPEG:case ja.MP3:case ja.MP4:case ja.WAV:case ja.WEBM:case ja.WEBM_OPUS:return Dn.AUDIO;case xm.PDF:return Dn.PDF;case Pt.PLAIN:case Pt.MARKDOWN:case Pt.ASCIIDOC:case Pt.JAVASCRIPT:case Pt.JAVASCRIPT_APP:case Pt.TYPESCRIPT:case Pt.JSX:case Pt.TSX:case Pt.CSS:case Pt.HTML:case Pt.JSON:case Pt.XML_TEXT:case Pt.XML_APP:case Pt.YAML_TEXT:case Pt.YAML_APP:case Pt.CSV:case Pt.PYTHON:case Pt.JAVA:case Pt.CPP_SRC:case Pt.C_SRC:case Pt.C_HDR:case Pt.PHP:case Pt.RUBY:case Pt.GO:case Pt.RUST:case Pt.SHELL:case Pt.BAT:case Pt.SQL:case Pt.R:case Pt.SCALA:case Pt.KOTLIN:case Pt.SWIFT:case Pt.DART:case Pt.VUE:case Pt.SVELTE:case Pt.LATEX:case Pt.BIBTEX:case Pt.CUDA:case Pt.CPP_HDR:case Pt.CSHARP:case Pt.HASKELL:case Pt.PROPERTIES:case Pt.TEX:case Pt.TEX_APP:return Dn.TEXT;default:return null}}function R4(r){switch(r.toLowerCase().substring(r.lastIndexOf("."))){case Ks.JPG:case Ks.JPEG:case Ks.PNG:case Ks.GIF:case Ks.WEBP:case Ks.SVG:return Dn.IMAGE;case Am.MP3:case Am.WAV:return Dn.AUDIO;case w4.PDF:return Dn.PDF;case Wt.TXT:case Wt.MD:case Wt.ADOC:case Wt.JS:case Wt.TS:case Wt.JSX:case Wt.TSX:case Wt.CSS:case Wt.HTML:case Wt.HTM:case Wt.JSON:case Wt.XML:case Wt.YAML:case Wt.YML:case Wt.CSV:case Wt.LOG:case Wt.PY:case Wt.JAVA:case Wt.CPP:case Wt.C:case Wt.H:case Wt.PHP:case Wt.RB:case Wt.GO:case Wt.RS:case Wt.SH:case Wt.BAT:case Wt.SQL:case Wt.R:case Wt.SCALA:case Wt.KT:case Wt.SWIFT:case Wt.DART:case Wt.VUE:case Wt.SVELTE:case Wt.TEX:case Wt.BIB:case Wt.COMP:case Wt.CU:case Wt.CUH:case Wt.HPP:case Wt.HS:case Wt.PROPERTIES:return Dn.TEXT;default:return null}}function _ce(r,e){if(e){const n=tl(e);if(n===Dn.IMAGE||n===Dn.AUDIO||n===Dn.PDF)return!0}const t=R4(r);return t===Dn.IMAGE||t===Dn.AUDIO||t===Dn.PDF,!0}function ub(r){if(typeof r!="number")return"Unknown";if(r===0)return"0 Bytes";const e=1024,t=["Bytes","KB","MB","GB"],n=Math.floor(Math.log(r)/Math.log(e));return parseFloat((r/Math.pow(e,n)).toFixed(2))+" "+t[n]}function bce(r){return typeof r!="number"?"Unknown":r>=1e9?`${(r/1e9).toFixed(2)}B`:r>=1e6?`${(r/1e6).toFixed(2)}M`:r>=1e3?`${(r/1e3).toFixed(2)}K`:r.toString()}function d0(r){return typeof r!="number"?"Unknown":r.toLocaleString()}function s8(r){try{const e=JSON.parse(r);return JSON.stringify(e,null,2)}catch{return r}}function vce(r){return r.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}function h0(r){if(r<0)return"0s";const e=r/y_;if(e<mne)return`${e.toFixed(1)}s`;if(e<gne)return`${e.toFixed(1)}s`;const t=Math.floor(e/lO),n=Math.floor(e%lO/oO),a=Math.floor(e%oO),i=[];return t>0&&i.push(`${t}h`),n>0&&i.push(`${n}min`),(a>0||i.length===0)&&i.push(`${a}s`),i.join(" ")}function Tp(r,e,t,n){const a=n?`${e} (${n})`:e;return`
`)}const a=n.map(i=>{if(i.type===Qr.MCP_PROMPT){const s=i;return{type:Qr.MCP_PROMPT,name:s.name,serverName:s.serverName,promptName:s.promptName,content:s.content,arguments:s.arguments}}return{type:Qr.TEXT,name:i.name,content:i.content}});return`${JSON.stringify(t)}
${JSON.stringify(a,null,2)}`}function Ece(t){const e={message:t,textAttachments:[],mcpPromptAttachments:[]};if(!t.startsWith('"'))return e;try{let r=-1,n=!1;for(let u=1;u<t.length;u++){const d=t[u];if(n){n=!1;continue}if(d==="\\"){n=!0;continue}if(d==='"'){r=u;break}}if(r===-1)return e;const a=t.substring(0,r+1),i=t.substring(r+1).trim(),s=JSON.parse(a);if(!i||!i.startsWith("["))return{message:s,textAttachments:[],mcpPromptAttachments:[]};const o=JSON.parse(i),l=[],c=[];for(const u of o)vce(u)?c.push({type:Qr.MCP_PROMPT,name:u.name,serverName:u.serverName,promptName:u.promptName,content:u.content,arguments:u.arguments}):yce(u)&&l.push({type:Qr.TEXT,name:u.name,content:u.content});return{message:s,textAttachments:l,mcpPromptAttachments:c}}catch{return e}}function vce(t){if(typeof t!="object"||t===null)return!1;const e=t;return(e.type===Qr.MCP_PROMPT||e.type==="MCP_PROMPT")&&typeof e.name=="string"&&typeof e.serverName=="string"&&typeof e.promptName=="string"&&typeof e.content=="string"}function yce(t){if(typeof t!="object"||t===null)return!1;const e=t;return(e.type===Qr.TEXT||e.type==="TEXT")&&typeof e.name=="string"&&typeof e.content=="string"}function p_(t){if(!t)return"FILE";if(t.includes("/")){const e=t.split("/").pop();if(e)return e.includes(".")?e.split(".").pop()?.toUpperCase()||"FILE":e.toUpperCase()}if(t.includes(".")){const e=t.split(".").pop();if(e)return e.toUpperCase()}return t.toUpperCase()}function SR(t,e=150){return t.length>e?t.slice(0,e)+"...":t}function sl(t){switch(t){case ta.JPEG:case ta.PNG:case ta.GIF:case ta.WEBP:case ta.SVG:return kn.IMAGE;case ja.MP3_MPEG:case ja.MP3:case ja.MP4:case ja.WAV:case ja.WEBM:case ja.WEBM_OPUS:return kn.AUDIO;case If.PDF:return kn.PDF;case Lt.PLAIN:case Lt.MARKDOWN:case Lt.ASCIIDOC:case Lt.JAVASCRIPT:case Lt.JAVASCRIPT_APP:case Lt.TYPESCRIPT:case Lt.JSX:case Lt.TSX:case Lt.CSS:case Lt.HTML:case Lt.JSON:case Lt.XML_TEXT:case Lt.XML_APP:case Lt.YAML_TEXT:case Lt.YAML_APP:case Lt.CSV:case Lt.PYTHON:case Lt.JAVA:case Lt.CPP_SRC:case Lt.C_SRC:case Lt.C_HDR:case Lt.PHP:case Lt.RUBY:case Lt.GO:case Lt.RUST:case Lt.SHELL:case Lt.BAT:case Lt.SQL:case Lt.R:case Lt.SCALA:case Lt.KOTLIN:case Lt.SWIFT:case Lt.DART:case Lt.VUE:case Lt.SVELTE:case Lt.LATEX:case Lt.BIBTEX:case Lt.CUDA:case Lt.CPP_HDR:case Lt.CSHARP:case Lt.HASKELL:case Lt.PROPERTIES:case Lt.TEX:case Lt.TEX_APP:return kn.TEXT;default:return null}}function DI(t){switch(t.toLowerCase().substring(t.lastIndexOf("."))){case Zs.JPG:case Zs.JPEG:case Zs.PNG:case Zs.GIF:case Zs.WEBP:case Zs.SVG:return kn.IMAGE;case Nf.MP3:case Nf.WAV:return kn.AUDIO;case RI.PDF:return kn.PDF;case Wt.TXT:case Wt.MD:case Wt.ADOC:case Wt.JS:case Wt.TS:case Wt.JSX:case Wt.TSX:case Wt.CSS:case Wt.HTML:case Wt.HTM:case Wt.JSON:case Wt.XML:case Wt.YAML:case Wt.YML:case Wt.CSV:case Wt.LOG:case Wt.PY:case Wt.JAVA:case Wt.CPP:case Wt.C:case Wt.H:case Wt.PHP:case Wt.RB:case Wt.GO:case Wt.RS:case Wt.SH:case Wt.BAT:case Wt.SQL:case Wt.R:case Wt.SCALA:case Wt.KT:case Wt.SWIFT:case Wt.DART:case Wt.VUE:case Wt.SVELTE:case Wt.TEX:case Wt.BIB:case Wt.COMP:case Wt.CU:case Wt.CUH:case Wt.HPP:case Wt.HS:case Wt.PROPERTIES:return kn.TEXT;default:return null}}function Tce(t,e){if(e){const n=sl(e);if(n===kn.IMAGE||n===kn.AUDIO||n===kn.PDF)return!0}const r=DI(t);return r===kn.IMAGE||r===kn.AUDIO||r===kn.PDF,!0}function pb(t){if(typeof t!="number")return"Unknown";if(t===0)return"0 Bytes";const e=1024,r=["Bytes","KB","MB","GB"],n=Math.floor(Math.log(t)/Math.log(e));return parseFloat((t/Math.pow(e,n)).toFixed(2))+" "+r[n]}function Cce(t){return typeof t!="number"?"Unknown":t>=1e9?`${(t/1e9).toFixed(2)}B`:t>=1e6?`${(t/1e6).toFixed(2)}M`:t>=1e3?`${(t/1e3).toFixed(2)}K`:t.toString()}function m_(t){return typeof t!="number"?"Unknown":t.toLocaleString()}function u4(t){try{const e=JSON.parse(t);return JSON.stringify(e,null,2)}catch{return t}}function wce(t){return t.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}function f_(t){if(t<0)return"0s";const e=t/T1;if(e<vne)return`${e.toFixed(1)}s`;if(e<yne)return`${e.toFixed(1)}s`;const r=Math.floor(e/h5),n=Math.floor(e%h5/d5),a=Math.floor(e%d5),i=[];return r>0&&i.push(`${r}h`),n>0&&i.push(`${n}min`),(a>0||i.length===0)&&i.push(`${a}s`),i.join(" ")}function wm(t,e,r,n){const a=n?`${e} (${n})`:e;return`
--- ${r}: ${a} ---
${t}`}function O4(r){return r.isComposing||r.keyCode===229}function yce(r,e){return r.includes("$")?r.split(`
`).map(t=>{if(t.indexOf("$")==-1)return t;let n="",a=0;for(;a<t.length;){const i=t.indexOf("$",a);if(i==-1){n+=t.slice(a);break}const s=t.indexOf("$",i+1);if(s==-1){n+=t.slice(a);break}const o=i>0?t[i-1]:"",l=t[i+1],c=i+1<s?t[s-1]:"",u=s+1<t.length?t[s+1]:"";let d=!1;if(s==a+1&&(d=!0),/[A-Za-z0-9_$-]/.test(o)&&(d=!0),/[0-9]/.test(l)&&(/[A-Za-z0-9_$-]/.test(u)||c==" ")&&(d=!0),d){n+=t.slice(a,i+1),a=i+1;continue}n+=t.slice(a,i);const h=t.slice(i,s+1);e.push(h),n+=`<<LATEX_${e.length-1}>>`,a=s+1}return n}).join(`
`):r}function Sce(r){return r.replace(Ene,(e,t,n,a)=>t??(n!=null?`$$${n}$$`:a!=null?`$${a}$`:e))}function o8(r){const e=new Map;r=r.split(`
--- ${t}: ${a} ---
${r}`}function MI(t){return t.isComposing||t.keyCode===229}function Ace(t,e){return t.includes("$")?t.split(`
`).map(r=>{if(r.indexOf("$")==-1)return r;let n="",a=0;for(;a<r.length;){const i=r.indexOf("$",a);if(i==-1){n+=r.slice(a);break}const s=r.indexOf("$",i+1);if(s==-1){n+=r.slice(a);break}const o=i>0?r[i-1]:"",l=r[i+1],c=i+1<s?r[s-1]:"",u=s+1<r.length?r[s+1]:"";let d=!1;if(s==a+1&&(d=!0),/[A-Za-z0-9_$-]/.test(o)&&(d=!0),/[0-9]/.test(l)&&(/[A-Za-z0-9_$-]/.test(u)||c==" ")&&(d=!0),d){n+=r.slice(a,i+1),a=i+1;continue}n+=r.slice(a,i);const h=r.slice(i,s+1);e.push(h),n+=`<<LATEX_${e.length-1}>>`,a=s+1}return n}).join(`
`):t}function Rce(t){return t.replace(One,(e,r,n,a)=>r??(n!=null?`$$${n}$$`:a!=null?`$${a}$`:e))}function d4(t){const e=new Map;t=t.split(`
`).map((s,o)=>{const l=s.match(/^(>\s*)/);return l?(e.set(o,l[1]),s.slice(l[1].length)):s}).join(`
`);const a=[];r=r.replace(Sne,s=>(a.push(s),`<<CODE_BLOCK_${a.length-1}>>`));const i=[];return r=r.replace(/([\S].*?)\\\[([\s\S]*?)\\\](.*)/g,(s,o,l,c)=>{if(o.endsWith("\\"))return s;const u=/\S/.test(c);let d;return u?(i.push(`\\(${l.trim()}\\)`),d=""):(i.push(`\\[${l}\\]`),d=`
`),`${o}${d}<<LATEX_${i.length-1}>>${d}${c}`}),r=r.replace(new RegExp("(\\$\\$[\\s\\S]*?\\$\\$|(?<!\\\\)\\\\\\[[\\s\\S]*?\\\\\\]|(?<!\\\\)\\\\\\(.*?\\\\\\))","g"),s=>(i.push(s),`<<LATEX_${i.length-1}>>`)),r=yce(r,i),r=r.replace(/\$(?=\d)/g,"\\$"),r=r.replace(/<<LATEX_(\d+)>>/g,(s,o)=>{let l=i[parseInt(o)];const c=l.match(wne);if(c){const u=c[1],d=u.startsWith(`
`);const a=[];t=t.replace(Rne,s=>(a.push(s),`<<CODE_BLOCK_${a.length-1}>>`));const i=[];return t=t.replace(/([\S].*?)\\\[([\s\S]*?)\\\](.*)/g,(s,o,l,c)=>{if(o.endsWith("\\"))return s;const u=/\S/.test(c);let d;return u?(i.push(`\\(${l.trim()}\\)`),d=""):(i.push(`\\[${l}\\]`),d=`
`),`${o}${d}<<LATEX_${i.length-1}>>${d}${c}`}),t=t.replace(new RegExp("(\\$\\$[\\s\\S]*?\\$\\$|(?<!\\\\)\\\\\\[[\\s\\S]*?\\\\\\]|(?<!\\\\)\\\\\\(.*?\\\\\\))","g"),s=>(i.push(s),`<<LATEX_${i.length-1}>>`)),t=Ace(t,i),t=t.replace(/\$(?=\d)/g,"\\$"),t=t.replace(/<<LATEX_(\d+)>>/g,(s,o)=>{let l=i[parseInt(o)];const c=l.match(Nne);if(c){const u=c[1],d=u.startsWith(`
`)?"":`
`,h=u.endsWith(`
`)?"":`
`;l="$$"+d+u+h+"$$"}return l}),r=Sce(r),r=r.replace(new RegExp("(?<!\\\\)\\\\\\((.+?)\\\\\\)","g"),"$$$1$").replace(new RegExp("(?<!\\\\)\\\\\\[([\\s\\S]*?)\\\\\\]","g"),(s,o)=>`$$${o}$$`),r=r.replace(/<<CODE_BLOCK_(\d+)>>/g,(s,o)=>a[parseInt(o)]),e.size>0&&(r=r.split(`
`;l="$$"+d+u+h+"$$"}return l}),t=Rce(t),t=t.replace(new RegExp("(?<!\\\\)\\\\\\((.+?)\\\\\\)","g"),"$$$1$").replace(new RegExp("(?<!\\\\)\\\\\\[([\\s\\S]*?)\\\\\\]","g"),(s,o)=>`$$${o}$$`),t=t.replace(/<<CODE_BLOCK_(\d+)>>/g,(s,o)=>a[parseInt(o)]),e.size>0&&(t=t.split(`
`).map((l,c)=>{const u=e.get(c);return u?u+l:l}).join(`
`)),r}function Ece(r,e){const t=[],n=[],a={},{hasVision:i,hasAudio:s}=e;for(const o of r){const l=tl(o.type);let c=!0,u="";switch(l){case Dn.IMAGE:i||(c=!1,u="Images require a vision-capable model");break;case Dn.AUDIO:s||(c=!1,u="Audio files require an audio-capable model");break;case Dn.TEXT:case Dn.PDF:break}c?t.push(o):(n.push(o),a[o.name]=u)}return{supportedFiles:t,unsupportedFiles:n,modalityReasons:a}}function wce(r){const e=r.trim();if(!e)return"";const t=e.split(/[\\/]/);if(t.length===2){const[i,s]=t,o=i?.trim(),l=s?.trim();if(o&&l)return`${o}/${l}`}const a=t.pop()?.trim();return a&&a.length>0?a:e}function bu(r){return typeof r=="number"?Math.round(r*yO)/yO:r}function m$(r){switch(r.toLowerCase().substring(r.lastIndexOf("."))){case".js":case".mjs":case".cjs":return"javascript";case".ts":case".mts":case".cts":return"typescript";case".jsx":return"javascript";case".tsx":return"typescript";case".html":case".htm":return"html";case".css":return"css";case".scss":return"scss";case".less":return"less";case".vue":return"html";case".svelte":return"html";case".json":return"json";case".xml":return"xml";case".yaml":case".yml":return"yaml";case".toml":return"ini";case".csv":return"plaintext";case".py":return"python";case".java":return"java";case".kt":case".kts":return"kotlin";case".scala":return"scala";case".cpp":case".cc":case".cxx":case".c++":return"cpp";case".c":return"c";case".h":case".hpp":return"cpp";case".cs":return"csharp";case".go":return"go";case".rs":return"rust";case".rb":return"ruby";case".php":return"php";case".swift":return"swift";case".dart":return"dart";case".r":return"r";case".lua":return"lua";case".pl":case".pm":return"perl";case".sh":case".bash":case".zsh":return"bash";case".bat":case".cmd":return"dos";case".ps1":return"powershell";case".sql":return"sql";case".md":case".markdown":return"markdown";case".tex":case".latex":return"latex";case".adoc":case".asciidoc":return"asciidoc";case".ini":case".cfg":case".conf":return"ini";case".dockerfile":return"dockerfile";case".nginx":return"nginx";case".graphql":case".gql":return"graphql";case".proto":return"protobuf";case".diff":case".patch":return"diff";case".log":return"plaintext";case".txt":return"plaintext";default:return"plaintext"}}async function Tce(r){return new Promise((e,t)=>{const n=new FileReader;n.onload=a=>{a.target?.result!==null&&a.target?.result!==void 0?e(a.target.result):t(new Error("Failed to read file"))},n.onerror=()=>t(new Error("File reading error")),n.readAsText(r)})}function Cce(r,e={}){if(!r)return!0;const t={...Fre,...e},n=r.substring(0,t.prefixLength);let a=0,i=0;for(let s=0;s<n.length;s++){const o=n.charCodeAt(s);if(o===0){a++;continue}o<32&&o!==9&&o!==10&&o!==13&&(o<8||o>13&&o<27)&&i++,o===65533&&i++}return!(a>t.maxAbsoluteNullBytes||i/n.length>t.suspiciousCharThresholdRatio)}function g$(r,e){let t=null;return(...n)=>{t&&clearTimeout(t),t=setTimeout(()=>{r(...n),t=null},e)}}function Ace(r){return r.replace(_ne,"").slice(0,YU)}function xce(r){return r.replace(bne,"").slice(0,WU)}function Rce(r){return`<div class="image-error-content">
`)),t}function Oce(t,e){const r=[],n=[],a={},{hasVision:i,hasAudio:s}=e;for(const o of t){const l=sl(o.type);let c=!0,u="";switch(l){case kn.IMAGE:i||(c=!1,u="Images require a vision-capable model");break;case kn.AUDIO:s||(c=!1,u="Audio files require an audio-capable model");break;case kn.TEXT:case kn.PDF:break}c?r.push(o):(n.push(o),a[o.name]=u)}return{supportedFiles:r,unsupportedFiles:n,modalityReasons:a}}function Nce(t){const e=t.trim();if(!e)return"";const r=e.split(/[\\/]/);if(r.length===2){const[i,s]=r,o=i?.trim(),l=s?.trim();if(o&&l)return`${o}/${l}`}const a=r.pop()?.trim();return a&&a.length>0?a:e}function Cu(t){return typeof t=="number"?Math.round(t*C5)/C5:t}function SG(t){switch(t.toLowerCase().substring(t.lastIndexOf("."))){case".js":case".mjs":case".cjs":return"javascript";case".ts":case".mts":case".cts":return"typescript";case".jsx":return"javascript";case".tsx":return"typescript";case".html":case".htm":return"html";case".css":return"css";case".scss":return"scss";case".less":return"less";case".vue":return"html";case".svelte":return"html";case".json":return"json";case".xml":return"xml";case".yaml":case".yml":return"yaml";case".toml":return"ini";case".csv":return"plaintext";case".py":return"python";case".java":return"java";case".kt":case".kts":return"kotlin";case".scala":return"scala";case".cpp":case".cc":case".cxx":case".c++":return"cpp";case".c":return"c";case".h":case".hpp":return"cpp";case".cs":return"csharp";case".go":return"go";case".rs":return"rust";case".rb":return"ruby";case".php":return"php";case".swift":return"swift";case".dart":return"dart";case".r":return"r";case".lua":return"lua";case".pl":case".pm":return"perl";case".sh":case".bash":case".zsh":return"bash";case".bat":case".cmd":return"dos";case".ps1":return"powershell";case".sql":return"sql";case".md":case".markdown":return"markdown";case".tex":case".latex":return"latex";case".adoc":case".asciidoc":return"asciidoc";case".ini":case".cfg":case".conf":return"ini";case".dockerfile":return"dockerfile";case".nginx":return"nginx";case".graphql":case".gql":return"graphql";case".proto":return"protobuf";case".diff":case".patch":return"diff";case".log":return"plaintext";case".txt":return"plaintext";default:return"plaintext"}}async function Ice(t){return new Promise((e,r)=>{const n=new FileReader;n.onload=a=>{a.target?.result!==null&&a.target?.result!==void 0?e(a.target.result):r(new Error("Failed to read file"))},n.onerror=()=>r(new Error("File reading error")),n.readAsText(t)})}function xce(t,e={}){if(!t)return!0;const r={...$re,...e},n=t.substring(0,r.prefixLength);let a=0,i=0;for(let s=0;s<n.length;s++){const o=n.charCodeAt(s);if(o===0){a++;continue}o<32&&o!==9&&o!==10&&o!==13&&(o<8||o>13&&o<27)&&i++,o===65533&&i++}return!(a>r.maxAbsoluteNullBytes||i/n.length>r.suspiciousCharThresholdRatio)}function EG(t,e){let r=null;return(...n)=>{r&&clearTimeout(r),r=setTimeout(()=>{t(...n),r=null},e)}}function Dce(t){return t.replace(Tne,"").slice(0,QU)}function Mce(t){return t.replace(Cne,"").slice(0,XU)}function kce(t){return`<div class="image-error-content">
<span>Image cannot be displayed</span>
<a href="${r}" target="_blank" rel="noopener noreferrer">(open link)</a>
</div>`}function l8(r){const e=r.trim().toLowerCase();return e.startsWith(lo.WEBSOCKET)||e.startsWith(lo.WEBSOCKET_SECURE)?Os.WEBSOCKET:Os.STREAMABLE_HTTP}function c8(r){if(!r)return[];let e;if(typeof r=="string"){const t=r.trim();if(!t)return[];try{e=JSON.parse(t)}catch(n){return console.warn("[MCP] Failed to parse mcpServers JSON, ignoring value:",n),[]}}else e=r;return Array.isArray(e)?e.map((t,n)=>{const a=typeof t?.url=="string"?t.url.trim():"",i=typeof t?.headers=="string"?t.headers.trim():void 0;return{id:typeof t?.id=="string"&&t.id?.trim()?t.id.trim():`${C4}-${n+1}`,enabled:!!t?.enabled,url:a,name:t?.name,requestTimeoutSeconds:Va.requestTimeoutSeconds,headers:i||void 0,useProxy:!!t?.useProxy}}):[]}function Oce(r){switch(r){case Pu.ERROR:return MU;case Pu.WARN:return zc;default:return _4}}function Nce(r){switch(r){case Pu.ERROR:return"text-destructive";case Pu.WARN:return"text-yellow-600 dark:text-yellow-500";default:return"text-muted-foreground"}}function Ice(r){return r?.startsWith(kf.IMAGE)??!1}function db(r){try{return r.replace(zne,"").split(Kne).filter(t=>t.length>0)}catch{return[r]}}function kce(r){return r.replace(qne,"").split(Hne).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function g3(r){try{const e=db(r.uri);return e[e.length-1]||r.name||r.uri}catch{return r.name||r.uri}}function Mce(r,e){const t=r?.toLowerCase()||"",n=e?.toLowerCase()||"";return t.includes(Xs.JSON)||t.includes(Xs.JAVASCRIPT)||t.includes(Xs.TYPESCRIPT)||QU.test(n)}function Dce(r,e){const t=r?.toLowerCase()||"",n=e?.toLowerCase()||"";return t.startsWith(kf.IMAGE)||XU.test(n)}function _$(r,e){const t=r?.toLowerCase()||"",n=e?.toLowerCase()||"";return t.startsWith(kf.IMAGE)||XU.test(n)?g4:t.includes(Xs.JSON)||t.includes(Xs.JAVASCRIPT)||t.includes(Xs.TYPESCRIPT)||QU.test(n)?DU:t.includes(kf.TEXT)||Gne.test(n)?wc:n.includes(d3.DATABASE_KEYWORD)||n.includes(d3.DATABASE_SCHEME)?f4:m4}function Cp(r){return r?r.filter(e=>"text"in e).map(e=>e.text).join(Xne):""}function Pce(r){return r?r.filter(e=>"blob"in e):[]}function b$(r,e=Pt.PLAIN,t=ZU){const n=new Blob([r],{type:e}),a=URL.createObjectURL(n),i=document.createElement("a");i.href=a,i.download=t,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(a)}function f0(r){const e=r.indexOf(TS);if(e===-1)return r;const t=r.substring(0,e),n=r.substring(e+TS.length).replace(Sae,"");return`${t}${TS}${n}`}function v$(r){const e=[],t=new Set;let n;for(lb.lastIndex=0;(n=lb.exec(r))!==null;){const a=n[1]||"",i=n[2];for(const s of i.split(",")){const o=s.replace(t$,"").replace(r$,"").trim();o&&!t.has(o)&&(t.add(o),e.push({name:o,operator:a}))}}return e}function Lce(r,e){return lb.lastIndex=0,r.replace(lb,(t,n,a)=>{const i=a.split(",").map(o=>o.replace(t$,"").replace(r$,"").trim()),s=i.map(o=>e[o]??"").filter(o=>o!=="");if(s.length===0)return"";switch(n){case uu.RESERVED:return s.join(bo.COMMA);case uu.FRAGMENT:return uu.FRAGMENT+s.join(bo.COMMA);case uu.PATH_SEGMENT:return bo.SLASH+s.join(bo.SLASH);case uu.LABEL:return bo.PERIOD+s.join(bo.PERIOD);case uu.PATH_PARAM:return i.filter((o,l)=>s[l]).map((o,l)=>`${bo.SEMICOLON}${o}=${s[l]}`).join("");case uu.FORM_QUERY:return bo.QUERY_PREFIX+i.filter((o,l)=>s[l]).map((o,l)=>`${encodeURIComponent(o)}=${encodeURIComponent(s[l])}`).join(bo.COMMA);case uu.FORM_CONTINUATION:return bo.QUERY_CONTINUATION+i.filter((o,l)=>s[l]).map((o,l)=>`${encodeURIComponent(o)}=${encodeURIComponent(s[l])}`).join(bo.COMMA);default:return s.map(o=>encodeURIComponent(o)).join(bo.COMMA)}})}function Fce(r,e){return v$(r).every(n=>(e[n.name]??"").trim()!=="")}function hb(r,e){return`data:${r};base64,${e}`}function Bce(r){if(!r?.trim())return[];try{const e=JSON.parse(r);if(typeof e=="object"&&e!==null&&!Array.isArray(e))return Object.entries(e).map(([t,n])=>({key:t,value:String(n)}))}catch{return[]}return[]}function Uce(r){const e=r.filter(n=>n.key.trim());if(e.length===0)return"";const t={};for(const n of e)t[n.key.trim()]=n.value;return JSON.stringify(t)}function $ce(r,e=!0){try{const t=new URL(r),n=t.hostname.split(iO),a=n.length>=sO?n.slice(-sO).join(iO):t.hostname,i=`${fne}?domain=${a}&sz=${pne}`;return e?h$(i):i}catch{return null}}function aT(r,e=[],t=[],n=!1){const a=[];if(r.reasoningContent){const s=_3(r.toolCalls),o=!!r.content?.trim()||s.length>0||t.length>0,l=n&&!o;a.push({type:l?Wa.REASONING_PENDING:Wa.REASONING,content:r.reasoningContent})}r.content?.trim()&&a.push({type:Wa.TEXT,content:r.content});const i=_3(r.toolCalls);for(const s of i){const o=e.find(l=>l.toolCallId===s.id);a.push({type:o?Wa.TOOL_CALL:Wa.TOOL_CALL_PENDING,content:o?.content||"",toolName:s.function?.name,toolArgs:s.function?.arguments,toolResult:o?.content,toolResultExtras:o?.extra})}for(const s of t)s.id&&i.find(o=>o.id===s.id)||a.push({type:Wa.TOOL_CALL_STREAMING,content:"",toolName:s.function?.name,toolArgs:s.function?.arguments});return a}function Gce(r,e=[],t=[],n=!1){if(!e.some(l=>l.role===Jt.ASSISTANT))return aT(r,e,t,n);const i=[],s=u8(e,0);iLine truncated
`)}function U(A,P,J,ce){this.failures=P,this.failedKeys=ce,this.successCount=J,this.message=R(A,P)}function Q(A,P){this.name="BulkError",this.failures=Object.keys(P).map(function(J){return P[J]}),this.failuresByPos=P,this.message=R(A,this.failures)}g(O).from(Error).extend({toString:function(){return this.name+": "+this.message}}),g(U).from(O),g(Q).from(O);var ne=_o.reduce(function(A,P){return A[P]=P+"Error",A},{}),ue=O,he=_o.reduce(function(A,P){var J=P+"Error";function ce(de,ve){this.name=J,de?typeof de=="string"?(this.message="".concat(de).concat(ve?`
`+ve:""),this.inner=ve||null):typeof de=="object"&&(this.message="".concat(de.name," ").concat(de.message),this.inner=de):(this.message=te[P]||J,this.inner=null)}return g(ce).from(ue),A[P]=ce,A},{});he.Syntax=SyntaxError,he.Type=TypeError,he.Range=RangeError;var be=dt.reduce(function(A,P){return A[P+"Error"]=he[P],A},{}),Z=_o.reduce(function(A,P){return["Syntax","Type","Range"].indexOf(P)===-1&&(A[P+"Error"]=he[P]),A},{});function ae(){}function fe(A){return A}function pe(A,P){return A==null||A===fe?P:function(J){return P(A(J))}}function ye(A,P){return function(){A.apply(this,arguments),P.apply(this,arguments)}}function Te(A,P){return A===ae?P:function(){var J=A.apply(this,arguments);J!==void 0&&(arguments[0]=J);var ce=this.onsuccess,de=this.onerror;this.onsuccess=null,this.onerror=null;var ve=P.apply(this,arguments);return ce&&(this.onsuccess=this.onsuccess?ye(ce,this.onsuccess):ce),de&&(this.onerror=this.onerror?ye(de,this.onerror):de),ve!==void 0?ve:J}}function Oe(A,P){return A===ae?P:function(){A.apply(this,arguments);var J=this.onsuccess,ce=this.onerror;this.onsuccess=this.onerror=null,P.apply(this,arguments),J&&(this.onsuccess=this.onsuccess?ye(J,this.onsuccess):J),ce&&(this.onerror=this.onerror?ye(ce,this.onerror):ce)}}function Ne(A,P){return A===ae?P:function(J){var ce=A.apply(this,arguments);l(J,ce);var de=this.onsuccess,ve=this.onerror;return this.onsuccess=null,this.onerror=null,J=P.apply(this,arguments),de&&(this.onsuccess=this.onsuccess?ye(de,this.onsuccess):de),ve&&(this.onerror=this.onerror?ye(ve,this.onerror):ve),ce===void 0?J===void 0?void 0:J:l(ce,J)}}function Ue(A,P){return A===ae?P:function(){return P.apply(this,arguments)!==!1&&A.apply(this,arguments)}}function Fe(A,P){return A===ae?P:function(){var J=A.apply(this,arguments);if(J&&typeof J.then=="function"){for(var ce=this,de=arguments.length,ve=new Array(de);de--;)ve[de]=arguments[de];return J.then(function(){return P.apply(ce,ve)})}return P.apply(this,arguments)}}Z.ModifyError=U,Z.DexieError=O,Z.BulkError=Q;var Ke=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function He(A){Ke=A}var it={},st=100,Ae=typeof Promise>"u"?[]:function(){var A=Promise.resolve();if(typeof crypto>"u"||!crypto.subtle)return[A,c(A),A];var P=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[P,c(P),A]}(),dt=Ae[0],_o=Ae[1],Ae=Ae[2],_o=_o&&_o.then,Le=dt&&dt.constructor,ht=!!Ae,ze=function(A,P){Rt.push([A,P]),At&&(queueMicrotask(Ct),At=!1)},mt=!0,At=!0,xt=[],qt=[],ar=fe,fr={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:ae,pgp:!1,env:{},finalize:ae},ct=fr,Rt=[],Ft=0,tr=[];function ut(A){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var P=this._PSD=ct;if(typeof A!="function"){if(A!==it)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&It(this,this._value))}this._state=null,this._value=null,++P.ref,function J(ce,de){try{de(function(ve){if(ce._state===null){if(ve===ce)throw new TypeError("A promise cannot be resolved with itself.");var Re=ce._lib&&Lt();ve&&typeof ve.then=="function"?J(ce,function(De,Ve){ve instanceof ut?ve._then(De,Ve):ve.then(De,Ve)}):(ce._state=!0,ce._value=ve,xe(ce)),Re&&Dt()}},It.bind(null,ce))}catch(ve){It(ce,ve)}}(this,A)}var Ut={get:function(){var A=ct,P=Fn;function J(ce,de){var ve=this,Re=!A.global&&(A!==ct||P!==Fn),De=Re&&!Ls(),Ve=new ut(function(Xe,tt){Qe(ve,new Et(nu(ce,A,Re,De),nu(de,A,Re,De),Xe,tt,A))});return this._consoleTask&&(Ve._consoleTask=this._consoleTask),Ve}return J.prototype=it,J},set:function(A){m(this,"then",A&&A.prototype===it?Ut:{get:function(){return A},set:Ut.set})}};function Et(A,P,J,ce,de){this.onFulfilled=typeof A=="function"?A:null,this.onRejected=typeof P=="function"?P:null,this.resolve=J,this.reject=ce,this.psd=de}function It(A,P){var J,ce;qt.push(P),A._state===null&&(J=A._lib&&Lt(),P=ar(P),A._state=!1,A._value=P,ce=A,xt.some(function(de){return de._value===ce._value})||xt.push(ce),xe(A),J&&Dt())}function xe(A){var P=A._listeners;A._listeners=[];for(var J=0,ce=P.length;J<ce;++J)Qe(A,P[J]);var de=A._PSD;--de.ref||de.finalize(),Ft===0&&(++Ft,ze(function(){--Ft==0&&bt()},[]))}function Qe(A,P){if(A._state!==null){var J=A._state?P.onFulfilled:P.onRejected;if(J===null)return(A._state?P.resolve:P.reject)(A._value);++P.psd.ref,++Ft,ze(ft,[J,A,P])}else A._listeners.push(P)}function ft(A,P,J){try{var ce,de=P._value;!P._state&&qt.length&&(qt=[]),ce=Ke&&P._consoleTask?P._consoleTask.run(function(){return A(de)}):A(de),P._state||qt.indexOf(de)!==-1||function(ve){for(var Re=xt.length;Re;)if(xt[--Re]._value===ve._value)return xt.splice(Re,1)}(P),J.resolve(ce)}catch(ve){J.reject(ve)}finally{--Ft==0&&bt(),--J.psd.ref||J.psd.finalize()}}function Ct(){ps(fr,function(){Lt()&&Dt()})}function Lt(){var A=mt;return At=mt=!1,A}function Dt(){var A,P,J;do for(;0<Rt.length;)for(A=Rt,Rt=[],J=A.length,P=0;P<J;++P){var ce=A[P];ce[0].apply(null,ce[1])}whil Line truncated
`).filter(s=>s),a=Math.min(...n.map(s=>s.length-s.trimStart().length)),i=n.map(s=>s.slice(a)).map(s=>" ".repeat(this.indent*2)+s);for(const s of i)this.content.push(s)}compile(){const e=Function,t=this?.args,a=[...(this?.content??[""]).map(i=>` ${i}`)];return new e(...t,a.join(`
`))}}const wde={major:4,minor:2,patch:1},fa=St("$ZodType",(r,e)=>{var t;r??(r={}),r._zod.def=e,r._zod.bag=r._zod.bag||{},r._zod.version=wde;const n=[...r._zod.def.checks??[]];r._zod.traits.has("$ZodCheck")&&n.unshift(r);for(const a of n)for(const i of a._zod.onattach)i(r);if(n.length===0)(t=r._zod).deferred??(t.deferred=[]),r._zod.deferred?.push(()=>{r._zod.run=r._zod.parse});else{const a=(s,o,l)=>{let c=Kh(s),u;for(const d of o){if(d._zod.def.when){if(!d._zod.def.when(s))continue}else if(c)continue;const h=s.issues.length,p=d._zod.check(s);if(p instanceof Promise&&l?.async===!1)throw new hf;if(u||p instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await p,s.issues.length!==h&&(c||(c=Kh(s,h)))});else{if(s.issues.length===h)continue;c||(c=Kh(s,h))}}return u?u.then(()=>s):s},i=(s,o,l)=>{if(Kh(s))return s.aborted=!0,s;const c=a(o,n,l);if(c instanceof Promise){if(l.async===!1)throw new hf;return c.then(u=>r._zod.parse(u,l))}return r._zod.parse(c,l)};r._zod.run=(s,o)=>{if(o.skipChecks)return r._zod.parse(s,o);if(o.direction==="backward"){const c=r._zod.parse({value:s.value,issues:[]},{...o,skipChecks:!0});return c instanceof Promise?c.then(u=>i(u,s,o)):i(c,s,o)}const l=r._zod.parse(s,o);if(l instanceof Promise){if(o.async===!1)throw new hf;return l.then(c=>a(c,n,o))}return a(l,n,o)}}r["~standard"]={validate:a=>{try{const i=I$(r,a);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return Rue(r,a).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}}),P4=St("$ZodString",(r,e)=>{fa.init(r,e),r._zod.pattern=[...r?._zod.bag?.patterns??[]].pop()??nde(r._zod.bag),r._zod.parse=(t,n)=>{if(e.coerce)try{t.value=String(t.value)}catch{}return typeof t.value=="string"||t.issues.push({expected:"string",code:"invalid_type",input:t.value,inst:r}),t}}),va=St("$ZodStringFormat",(r,e)=>{Vv.init(r,e),P4.init(r,e)}),Tde=St("$ZodGUID",(r,e)=>{e.pattern??(e.pattern=Hue),va.init(r,e)}),Cde=St("$ZodUUID",(r,e)=>{if(e.version){const n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(n===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=b8(n))}else e.pattern??(e.pattern=b8());va.init(r,e)}),Ade=St("$ZodEmail",(r,e)=>{e.pattern??(e.pattern=Vue),va.init(r,e)}),xde=St("$ZodURL",(r,e)=>{va.init(r,e),r._zod.check=t=>{try{const n=t.value.trim(),a=new URL(n);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(a.hostname)||t.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:t.value,inst:r,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(a.protocol.endsWith(":")?a.protocol.slice(0,-1):a.protocol)||t.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:t.value,inst:r,continue:!e.abort})),e.normalize?t.value=a.href:t.value=n;return}catch{t.issues.push({code:"invalid_format",format:"url",input:t.value,inst:r,continue:!e.abort})}}}),Rde=St("$ZodEmoji",(r,e)=>{e.pattern??(e.pattern=Wue()),va.init(r,e)}),Ode=St("$ZodNanoID",(r,e)=>{e.pattern??(e.pattern=zue),va.init(r,e)}),Nde=St("$ZodCUID",(r,e)=>{e.pattern??(e.pattern=Fue),va.init(r,e)}),Ide=St("$ZodCUID2",(r,e)=>{e.pattern??(e.pattern=Bue),va.init(r,e)}),kde=St("$ZodULID",(r,e)=>{e.pattern??(e.pattern=Uue),va.init(r,e)}),Mde=St("$ZodXID",(r,e)=>{e.pattern??(e.pattern=$ue),va.init(r,e)}),Dde=St("$ZodKSUID",(r,e)=>{e.pattern??(e.pattern=Gue),va.init(r,e)}),Pde=St("$ZodISODateTime",(r,e)=>{e.pattern??(e.pattern=rde(e)),va.init(r,e)}),Lde=St("$ZodISODate",(r,e)=>{e.pattern??(e.pattern=ede),va.init(r,e)}),Fde=St("$ZodISOTime",(r,e)=>{e.pattern??(e.pattern=tde(e)),va.init(r,e)}),Bde=St("$ZodISODuration",(r,e)=>{e.pattern??(e.pattern=que),va.init(r,e)}),Ude=St("$ZodIPv4",(r,e)=>{e.pattern??(e.pattern=jue),va.init(r,e),r._zod.bag.format="ipv4"}),$de=St("$ZodIPv6",(r,e)=>{e.pattern??(e.pattern=Kue),va.init(r,e),r._zod.bag.format="ipv6",r._zod.check=t=>{try{new URL(`http://[${t.value}]`)}catch{t.issues.push({code:"invalid_format",format:"ipv6",input:t.value,inst:r,continue:!e.abort})}}}),Gde=St("$ZodCIDRv4",(r,e)=>{e.pattern??(e.pattern=Xue),va.init(r,e)}),zde=St("$ZodCIDRv6",(r,e)=>{e.pattern??(e.pattern=Que),va.init(r,e),r._zod.check=t=>{const n=t.value.split("/");try{if(n.length!==2)throw new Error;const[a,i]=n;if(!i)throw new Error;const s=Number(i);if(`${s}`!==i)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${a}]`)}catch{t.issues.push({code:"invalid_format",format:"cidrv6",input:t.value,inst:r,continue:!e.abort})}}});function B$(r){if(r==="")return!0;if(r.length%4!==0)return!1;try{return atob(r),!0}catch{return!1}}const qde=St("$ZodBase64",(r,e)=>{e.pattern??(e.pattern=Zue),va.init(r,e),r._zod.bag.contentEncoding="base64",r._zod.check=t=>{B$(t.value)||t.issues.push({code:"invalid_format",format:"base64",input:t.value,inst:r,continue:!e.abort})}});function Hde(r){if(!k$.test(r))return!1;const e=r.replace(/[-_]/g,n=>n==="-"?"+":"/"),t=e.padEnd(Math.ceil(e.length/4)*4,"= Line truncated
if (${E}.issues.length) {
payload.issues = payload.issues.concat(${E}.issues.map(iss => ({
<a href="${t}" target="_blank" rel="noopener noreferrer">(open link)</a>
</div>`}function h4(t){const e=t.trim().toLowerCase();return e.startsWith(ho.WEBSOCKET)||e.startsWith(ho.WEBSOCKET_SECURE)?Is.WEBSOCKET:Is.STREAMABLE_HTTP}function p4(t){if(!t)return[];let e;if(typeof t=="string"){const r=t.trim();if(!r)return[];try{e=JSON.parse(r)}catch(n){return console.warn("[MCP] Failed to parse mcpServers JSON, ignoring value:",n),[]}}else e=t;return Array.isArray(e)?e.map((r,n)=>{const a=typeof r?.url=="string"?r.url.trim():"",i=typeof r?.headers=="string"?r.headers.trim():void 0;return{id:typeof r?.id=="string"&&r.id?.trim()?r.id.trim():`${NI}-${n+1}`,enabled:!!r?.enabled,url:a,name:r?.name,requestTimeoutSeconds:Va.requestTimeoutSeconds,headers:i||void 0,useProxy:!!r?.useProxy}}):[]}function Pce(t){switch(t){case qu.ERROR:return FU;case qu.WARN:return Kc;default:return vI}}function Lce(t){switch(t){case qu.ERROR:return"text-destructive";case qu.WARN:return"text-yellow-600 dark:text-yellow-500";default:return"text-muted-foreground"}}function Fce(t){return t?.startsWith(Pp.IMAGE)??!1}function mb(t){try{return t.replace(Kne,"").split(tae).filter(r=>r.length>0)}catch{return[t]}}function Bce(t){return t.replace(jne,"").split(Qne).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" ")}function ER(t){try{const e=mb(t.uri);return e[e.length-1]||t.name||t.uri}catch{return t.name||t.uri}}function Uce(t,e){const r=t?.toLowerCase()||"",n=e?.toLowerCase()||"";return r.includes(Js.JSON)||r.includes(Js.JAVASCRIPT)||r.includes(Js.TYPESCRIPT)||tG.test(n)}function Gce(t,e){const r=t?.toLowerCase()||"",n=e?.toLowerCase()||"";return r.startsWith(Pp.IMAGE)||eG.test(n)}function vG(t,e){const r=t?.toLowerCase()||"",n=e?.toLowerCase()||"";return r.startsWith(Pp.IMAGE)||eG.test(n)?EI:r.includes(Js.JSON)||r.includes(Js.JAVASCRIPT)||r.includes(Js.TYPESCRIPT)||tG.test(n)?BU:r.includes(Pp.TEXT)||Wne.test(n)?Nc:n.includes(fR.DATABASE_KEYWORD)||n.includes(fR.DATABASE_SCHEME)?_I:SI}function Am(t){return t?t.filter(e=>"text"in e).map(e=>e.text).join(rae):""}function qce(t){return t?t.filter(e=>"blob"in e):[]}function yG(t,e=Lt.PLAIN,r=rG){const n=new Blob([t],{type:e}),a=URL.createObjectURL(n),i=document.createElement("a");i.href=a,i.download=r,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(a)}function g_(t){const e=t.indexOf(Rv);if(e===-1)return t;const r=t.substring(0,e),n=t.substring(e+Rv.length).replace(Rae,"");return`${r}${Rv}${n}`}function TG(t){const e=[],r=new Set;let n;for(db.lastIndex=0;(n=db.exec(t))!==null;){const a=n[1]||"",i=n[2];for(const s of i.split(",")){const o=s.replace(iG,"").replace(sG,"").trim();o&&!r.has(o)&&(r.add(o),e.push({name:o,operator:a}))}}return e}function zce(t,e){return db.lastIndex=0,t.replace(db,(r,n,a)=>{const i=a.split(",").map(o=>o.replace(iG,"").replace(sG,"").trim()),s=i.map(o=>e[o]??"").filter(o=>o!=="");if(s.length===0)return"";switch(n){case gu.RESERVED:return s.join(To.COMMA);case gu.FRAGMENT:return gu.FRAGMENT+s.join(To.COMMA);case gu.PATH_SEGMENT:return To.SLASH+s.join(To.SLASH);case gu.LABEL:return To.PERIOD+s.join(To.PERIOD);case gu.PATH_PARAM:return i.filter((o,l)=>s[l]).map((o,l)=>`${To.SEMICOLON}${o}=${s[l]}`).join("");case gu.FORM_QUERY:return To.QUERY_PREFIX+i.filter((o,l)=>s[l]).map((o,l)=>`${encodeURIComponent(o)}=${encodeURIComponent(s[l])}`).join(To.COMMA);case gu.FORM_CONTINUATION:return To.QUERY_CONTINUATION+i.filter((o,l)=>s[l]).map((o,l)=>`${encodeURIComponent(o)}=${encodeURIComponent(s[l])}`).join(To.COMMA);default:return s.map(o=>encodeURIComponent(o)).join(To.COMMA)}})}function $ce(t,e){return TG(t).every(n=>(e[n.name]??"").trim()!=="")}function fb(t,e){return`data:${t};base64,${e}`}function Hce(t){if(!t?.trim())return[];try{const e=JSON.parse(t);if(typeof e=="object"&&e!==null&&!Array.isArray(e))return Object.entries(e).map(([r,n])=>({key:r,value:String(n)}))}catch{return[]}return[]}function Yce(t){const e=t.filter(n=>n.key.trim());if(e.length===0)return"";const r={};for(const n of e)r[n.key.trim()]=n.value;return JSON.stringify(r)}function Vce(t,e=!0){try{const r=new URL(t),n=r.hostname.split(c5),a=n.length>=u5?n.slice(-u5).join(c5):r.hostname,i=`${Sne}?domain=${a}&sz=${Ene}`;return e?gG(i):i}catch{return null}}function ow(t,e=[],r=[],n=!1){const a=[];if(t.reasoningContent){const s=vR(t.toolCalls),o=!!t.content?.trim()||s.length>0||r.length>0,l=n&&!o;a.push({type:l?Ka.REASONING_PENDING:Ka.REASONING,content:t.reasoningContent})}t.content?.trim()&&a.push({type:Ka.TEXT,content:t.content});const i=vR(t.toolCalls);for(const s of i){const o=e.find(l=>l.toolCallId===s.id);a.push({type:o?Ka.TOOL_CALL:Ka.TOOL_CALL_PENDING,content:o?.content||"",toolName:s.function?.name,toolArgs:s.function?.arguments,toolResult:o?.content,toolResultExtras:o?.extra})}for(const s of r)s.id&&i.find(o=>o.id===s.id)||a.push({type:Ka.TOOL_CALL_STREAMING,content:"",toolName:s.function?.name,toolArgs:s.function?.arguments});return a}function Wce(t,e=[],r=[],n=!1){if(!e.some(l=>l.role===tr.ASSISTANT))return ow(t,e,r,n);const i=[],s=m4(e,0);iLine truncated
`)}function U(R,P,ee,ce){this.failures=P,this.failedKeys=ce,this.successCount=ee,this.message=O(R,P)}function X(R,P){this.name="BulkError",this.failures=Object.keys(P).map(function(ee){return P[ee]}),this.failuresByPos=P,this.message=O(R,this.failures)}g(N).from(Error).extend({toString:function(){return this.name+": "+this.message}}),g(U).from(N),g(X).from(N);var ne=yo.reduce(function(R,P){return R[P]=P+"Error",R},{}),ue=N,he=yo.reduce(function(R,P){var ee=P+"Error";function ce(de,Se){this.name=ee,de?typeof de=="string"?(this.message="".concat(de).concat(Se?`
`+Se:""),this.inner=Se||null):typeof de=="object"&&(this.message="".concat(de.name," ").concat(de.message),this.inner=de):(this.message=J[P]||ee,this.inner=null)}return g(ce).from(ue),R[P]=ce,R},{});he.Syntax=SyntaxError,he.Type=TypeError,he.Range=RangeError;var be=dt.reduce(function(R,P){return R[P+"Error"]=he[P],R},{}),Z=yo.reduce(function(R,P){return["Syntax","Type","Range"].indexOf(P)===-1&&(R[P+"Error"]=he[P]),R},{});function ae(){}function pe(R){return R}function me(R,P){return R==null||R===pe?P:function(ee){return P(R(ee))}}function Ee(R,P){return function(){R.apply(this,arguments),P.apply(this,arguments)}}function Ce(R,P){return R===ae?P:function(){var ee=R.apply(this,arguments);ee!==void 0&&(arguments[0]=ee);var ce=this.onsuccess,de=this.onerror;this.onsuccess=null,this.onerror=null;var Se=P.apply(this,arguments);return ce&&(this.onsuccess=this.onsuccess?Ee(ce,this.onsuccess):ce),de&&(this.onerror=this.onerror?Ee(de,this.onerror):de),Se!==void 0?Se:ee}}function Ne(R,P){return R===ae?P:function(){R.apply(this,arguments);var ee=this.onsuccess,ce=this.onerror;this.onsuccess=this.onerror=null,P.apply(this,arguments),ee&&(this.onsuccess=this.onsuccess?Ee(ee,this.onsuccess):ee),ce&&(this.onerror=this.onerror?Ee(ce,this.onerror):ce)}}function Ie(R,P){return R===ae?P:function(ee){var ce=R.apply(this,arguments);l(ee,ce);var de=this.onsuccess,Se=this.onerror;return this.onsuccess=null,this.onerror=null,ee=P.apply(this,arguments),de&&(this.onsuccess=this.onsuccess?Ee(de,this.onsuccess):de),Se&&(this.onerror=this.onerror?Ee(Se,this.onerror):Se),ce===void 0?ee===void 0?void 0:ee:l(ce,ee)}}function Ue(R,P){return R===ae?P:function(){return P.apply(this,arguments)!==!1&&R.apply(this,arguments)}}function Fe(R,P){return R===ae?P:function(){var ee=R.apply(this,arguments);if(ee&&typeof ee.then=="function"){for(var ce=this,de=arguments.length,Se=new Array(de);de--;)Se[de]=arguments[de];return ee.then(function(){return P.apply(ce,Se)})}return P.apply(this,arguments)}}Z.ModifyError=U,Z.DexieError=N,Z.BulkError=X;var je=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function He(R){je=R}var at={},st=100,Ae=typeof Promise>"u"?[]:function(){var R=Promise.resolve();if(typeof crypto>"u"||!crypto.subtle)return[R,c(R),R];var P=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[P,c(P),R]}(),dt=Ae[0],yo=Ae[1],Ae=Ae[2],yo=yo&&yo.then,Le=dt&&dt.constructor,ht=!!Ae,ze=function(R,P){Ot.push([R,P]),At&&(queueMicrotask(Ct),At=!1)},ft=!0,At=!0,Rt=[],zt=[],ir=pe,hr={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:ae,pgp:!1,env:{},finalize:ae},lt=hr,Ot=[],Ft=0,Jt=[];function ut(R){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var P=this._PSD=lt;if(typeof R!="function"){if(R!==at)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&xt(this,this._value))}this._state=null,this._value=null,++P.ref,function ee(ce,de){try{de(function(Se){if(ce._state===null){if(Se===ce)throw new TypeError("A promise cannot be resolved with itself.");var Oe=ce._lib&&Pt();Se&&typeof Se.then=="function"?ee(ce,function(ke,Ye){Se instanceof ut?Se._then(ke,Ye):Se.then(ke,Ye)}):(ce._state=!0,ce._value=Se,Re(ce)),Oe&&kt()}},xt.bind(null,ce))}catch(Se){xt(ce,Se)}}(this,R)}var Ut={get:function(){var R=lt,P=Ln;function ee(ce,de){var Se=this,Oe=!R.global&&(R!==lt||P!==Ln),ke=Oe&&!gs(),Ye=new ut(function(Qe,tt){Xe(Se,new yt(rc(ce,R,Oe,ke),rc(de,R,Oe,ke),Qe,tt,R))});return this._consoleTask&&(Ye._consoleTask=this._consoleTask),Ye}return ee.prototype=at,ee},set:function(R){f(this,"then",R&&R.prototype===at?Ut:{get:function(){return R},set:Ut.set})}};function yt(R,P,ee,ce,de){this.onFulfilled=typeof R=="function"?R:null,this.onRejected=typeof P=="function"?P:null,this.resolve=ee,this.reject=ce,this.psd=de}function xt(R,P){var ee,ce;zt.push(P),R._state===null&&(ee=R._lib&&Pt(),P=ir(P),R._state=!1,R._value=P,ce=R,Rt.some(function(de){return de._value===ce._value})||Rt.push(ce),Re(R),ee&&kt())}function Re(R){var P=R._listeners;R._listeners=[];for(var ee=0,ce=P.length;ee<ce;++ee)Xe(R,P[ee]);var de=R._PSD;--de.ref||de.finalize(),Ft===0&&(++Ft,ze(function(){--Ft==0&&bt()},[]))}function Xe(R,P){if(R._state!==null){var ee=R._state?P.onFulfilled:P.onRejected;if(ee===null)return(R._state?P.resolve:P.reject)(R._value);++P.psd.ref,++Ft,ze(pt,[ee,R,P])}else R._listeners.push(P)}function pt(R,P,ee){try{var ce,de=P._value;!P._state&&zt.length&&(zt=[]),ce=je&&P._consoleTask?P._consoleTask.run(function(){return R(de)}):R(de),P._state||zt.indexOf(de)!==-1||function(Se){for(var Oe=Rt.length;Oe;)if(Rt[--Oe]._value===Se._value)return Rt.splice(Oe,1)}(P),ee.resolve(ce)}catch(Se){ee.reject(Se)}finally{--Ft==0&&bt(),--ee.psd.ref||ee.psd.finalize()}}function Ct(){ji(hr,function(){Pt()&&kt()})}function Pt(){var R=ft;return At=ft=!1,R}function kt(){var R,P,ee;do for(;0<Ot.length;)for(R=Ot,Ot=[],ee=R.length,P=0;P<ee; Line truncated
`).filter(s=>s),a=Math.min(...n.map(s=>s.length-s.trimStart().length)),i=n.map(s=>s.slice(a)).map(s=>" ".repeat(this.indent*2)+s);for(const s of i)this.content.push(s)}compile(){const e=Function,r=this?.args,a=[...(this?.content??[""]).map(i=>` ${i}`)];return new e(...r,a.join(`
`))}}const Nde={major:4,minor:2,patch:1},pa=vt("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=Nde;const n=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&n.unshift(t);for(const a of n)for(const i of a._zod.onattach)i(t);if(n.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{const a=(s,o,l)=>{let c=Jh(s),u;for(const d of o){if(d._zod.def.when){if(!d._zod.def.when(s))continue}else if(c)continue;const h=s.issues.length,m=d._zod.check(s);if(m instanceof Promise&&l?.async===!1)throw new fp;if(u||m instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await m,s.issues.length!==h&&(c||(c=Jh(s,h)))});else{if(s.issues.length===h)continue;c||(c=Jh(s,h))}}return u?u.then(()=>s):s},i=(s,o,l)=>{if(Jh(s))return s.aborted=!0,s;const c=a(o,n,l);if(c instanceof Promise){if(l.async===!1)throw new fp;return c.then(u=>t._zod.parse(u,l))}return t._zod.parse(c,l)};t._zod.run=(s,o)=>{if(o.skipChecks)return t._zod.parse(s,o);if(o.direction==="backward"){const c=t._zod.parse({value:s.value,issues:[]},{...o,skipChecks:!0});return c instanceof Promise?c.then(u=>i(u,s,o)):i(c,s,o)}const l=t._zod.parse(s,o);if(l instanceof Promise){if(o.async===!1)throw new fp;return l.then(c=>a(c,n,o))}return a(l,n,o)}}t["~standard"]={validate:a=>{try{const i=PG(t,a);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return kue(t,a).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}}),UI=vt("$ZodString",(t,e)=>{pa.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??cde(t._zod.bag),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:t}),r}}),ya=vt("$ZodStringFormat",(t,e)=>{KS.init(t,e),UI.init(t,e)}),Ide=vt("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=Que),ya.init(t,e)}),xde=vt("$ZodUUID",(t,e)=>{if(e.version){const n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(n===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=y4(n))}else e.pattern??(e.pattern=y4());ya.init(t,e)}),Dde=vt("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=Xue),ya.init(t,e)}),Mde=vt("$ZodURL",(t,e)=>{ya.init(t,e),t._zod.check=r=>{try{const n=r.value.trim(),a=new URL(n);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(a.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(a.protocol.endsWith(":")?a.protocol.slice(0,-1):a.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),e.normalize?r.value=a.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}}),kde=vt("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=Jue()),ya.init(t,e)}),Pde=vt("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=Kue),ya.init(t,e)}),Lde=vt("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=$ue),ya.init(t,e)}),Fde=vt("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=Hue),ya.init(t,e)}),Bde=vt("$ZodULID",(t,e)=>{e.pattern??(e.pattern=Yue),ya.init(t,e)}),Ude=vt("$ZodXID",(t,e)=>{e.pattern??(e.pattern=Vue),ya.init(t,e)}),Gde=vt("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=Wue),ya.init(t,e)}),qde=vt("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=lde(e)),ya.init(t,e)}),zde=vt("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=sde),ya.init(t,e)}),$de=vt("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=ode(e)),ya.init(t,e)}),Hde=vt("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=jue),ya.init(t,e)}),Yde=vt("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=ede),ya.init(t,e),t._zod.bag.format="ipv4"}),Vde=vt("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=tde),ya.init(t,e),t._zod.bag.format="ipv6",t._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:t,continue:!e.abort})}}}),Wde=vt("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=rde),ya.init(t,e)}),Kde=vt("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=nde),ya.init(t,e),t._zod.check=r=>{const n=r.value.split("/");try{if(n.length!==2)throw new Error;const[a,i]=n;if(!i)throw new Error;const s=Number(i);if(`${s}`!==i)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${a}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort})}}});function zG(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}const jde=vt("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=ade),ya.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=r=>{zG(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});function Qde(t){if(!LG.test(t))return!1;const e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"= Line truncated
if (${y}.issues.length) {
payload.issues = payload.issues.concat(${y}.issues.map(iss => ({
...iss,
path: iss.path ? [${S}, ...iss.path] : [${S}]
path: iss.path ? [${v}, ...iss.path] : [${v}]
})));
}
if (${E}.value === undefined) {
if (${S} in input) {
newResult[${S}] = undefined;
if (${y}.value === undefined) {
if (${v} in input) {
newResult[${v}] = undefined;
}
} else {
newResult[${S}] = ${E}.value;
newResult[${v}] = ${y}.value;
}
`)}p.write("payload.value = newResult;"),p.write("return payload;");const v=p.compile();return(y,E)=>v(h,y,E)};let i;const s=Nm,o=!T$.jitless,c=o&&mue.value,u=e.catchall;let d;r._zod.parse=(h,p)=>{d??(d=n.value);const m=h.value;return s(m)?o&&c&&p?.async===!1&&p.jitless!==!0?(i||(i=a(e.shape)),h=i(h,p),u?G$([],m,h,p,d,r):h):t(h,p):(h.issues.push({expected:"object",code:"invalid_type",input:m,inst:r}),h)}});function y8(r,e,t,n){for(const i of r)if(i.issues.length===0)return e.value=i.value,e;const a=r.filter(i=>!Kh(i));return a.length===1?(e.value=a[0].value,a[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:t,errors:r.map(i=>i.issues.map(s=>Fu(s,n,Lu())))}),e)}const z$=St("$ZodUnion",(r,e)=>{fa.init(r,e),ta(r._zod,"optin",()=>e.options.some(a=>a._zod.optin==="optional")?"optional":void 0),ta(r._zod,"optout",()=>e.options.some(a=>a._zod.optout==="optional")?"optional":void 0),ta(r._zod,"values",()=>{if(e.options.every(a=>a._zod.values))return new Set(e.options.flatMap(a=>Array.from(a._zod.values)))}),ta(r._zod,"pattern",()=>{if(e.options.every(a=>a._zod.pattern)){const a=e.options.map(i=>i._zod.pattern);return new RegExp(`^(${a.map(i=>I4(i.source)).join("|")})$`)}});const t=e.options.length===1,n=e.options[0]._zod.run;r._zod.parse=(a,i)=>{if(t)return n(a,i);let s=!1;const o=[];for(const l of e.options){const c=l._zod.run({value:a.value,issues:[]},i);if(c instanceof Promise)o.push(c),s=!0;else{if(c.issues.length===0)return c;o.push(c)}}return s?Promise.all(o).then(l=>y8(l,a,r,i)):y8(o,a,r,i)}}),ahe=St("$ZodDiscriminatedUnion",(r,e)=>{e.inclusive=!1,z$.init(r,e);const t=r._zod.parse;ta(r._zod,"propValues",()=>{const a={};for(const i of e.options){const s=i._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(i)}"`);for(const[o,l]of Object.entries(s)){a[o]||(a[o]=new Set);for(const c of l)a[o].add(c)}}return a});const n=zv(()=>{const a=e.options,i=new Map;for(const s of a){const o=s._zod.propValues?.[e.discriminator];if(!o||o.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(const l of o){if(i.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);i.set(l,s)}}return i});r._zod.parse=(a,i)=>{const s=a.value;if(!Nm(s))return a.issues.push({code:"invalid_type",expected:"object",input:s,inst:r}),a;const o=n.value.get(s?.[e.discriminator]);return o?o._zod.run(a,i):e.unionFallback?t(a,i):(a.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:s,path:[e.discriminator],inst:r}),a)}}),ihe=St("$ZodIntersection",(r,e)=>{fa.init(r,e),r._zod.parse=(t,n)=>{const a=t.value,i=e.left._zod.run({value:a,issues:[]},n),s=e.right._zod.run({value:a,issues:[]},n);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([l,c])=>S8(t,l,c)):S8(t,i,s)}});function S3(r,e){if(r===e)return{valid:!0,data:r};if(r instanceof Date&&e instanceof Date&&+r==+e)return{valid:!0,data:r};if(Pf(r)&&Pf(e)){const t=Object.keys(e),n=Object.keys(r).filter(i=>t.indexOf(i)!==-1),a={...r,...e};for(const i of n){const s=S3(r[i],e[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};a[i]=s.data}return{valid:!0,data:a}}if(Array.isArray(r)&&Array.isArray(e)){if(r.length!==e.length)return{valid:!1,mergeErrorPath:[]};const t=[];for(let n=0;n<r.length;n++){const a=r[n],i=e[n],s=S3(a,i);if(!s.valid)return{valid:!1,mergeErrorPath:[n,...s.mergeErrorPath]};t.push(s.data)}return{valid:!0,data:t}}return{valid:!1,mergeErrorPath:[]}}function S8(r,e,t){if(e.issues.length&&r.issues.push(...e.issues),t.issues.length&&r.issues.push(...t.issues),Kh(r))return r;const n=S3(e.value,t.value);if(!n.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return r.value=n.data,r}const she=St("$ZodRecord",(r,e)=>{fa.init(r,e),r._zod.parse=(t,n)=>{const a=t.value;if(!Pf(a))return t.issues.push({expected:"record",code:"invalid_type",input:a,inst:r}),t;const i=[],s=e.keyType._zod.values;if(s){t.value={};const o=new Set;for(const c of s)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){o.add(typeof c=="number"?c.toString():c);const u=e.valueType._zod.run({value:a[c],issues:[]},n);u instanceof Promise?i.push(u.then(d=>{d.issues.length&&t.issues.push(...Xh(c,d.issues)),t.value[c]=d.value})):(u.issues.length&&t.issues.push(...Xh(c,u.issues)),t.value[c]=u.value)}let l;for(const c in a)o.has(c)||(l=l??[],l.push(c));l&&l.length>0&&t.issues.push({code:"unrecognized_keys",input:a,inst:r,keys:l})}else{t.value={};for(const o of Reflect.ownKeys(a)){if(o==="__proto__")continue;const l=e.keyType._zod.run({value:o,issues:[]},n);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(l.issues.length){e.mode==="loose"?t.value[o]=a[o]:t.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(u=>Fu(u,n,Lu())),input:o,path:[o],inst:r});continue}c Line truncated
`)}m.write("payload.value = newResult;"),m.write("return payload;");const S=m.compile();return(E,y)=>S(h,E,y)};let i;const s=Mf,o=!OG.jitless,c=o&&vue.value,u=e.catchall;let d;t._zod.parse=(h,m)=>{d??(d=n.value);const f=h.value;return s(f)?o&&c&&m?.async===!1&&m.jitless!==!0?(i||(i=a(e.shape)),h=i(h,m),u?YG([],f,h,m,d,t):h):r(h,m):(h.issues.push({expected:"object",code:"invalid_type",input:f,inst:t}),h)}});function C4(t,e,r,n){for(const i of t)if(i.issues.length===0)return e.value=i.value,e;const a=t.filter(i=>!Jh(i));return a.length===1?(e.value=a[0].value,a[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(i=>i.issues.map(s=>$u(s,n,zu())))}),e)}const VG=vt("$ZodUnion",(t,e)=>{pa.init(t,e),ra(t._zod,"optin",()=>e.options.some(a=>a._zod.optin==="optional")?"optional":void 0),ra(t._zod,"optout",()=>e.options.some(a=>a._zod.optout==="optional")?"optional":void 0),ra(t._zod,"values",()=>{if(e.options.every(a=>a._zod.values))return new Set(e.options.flatMap(a=>Array.from(a._zod.values)))}),ra(t._zod,"pattern",()=>{if(e.options.every(a=>a._zod.pattern)){const a=e.options.map(i=>i._zod.pattern);return new RegExp(`^(${a.map(i=>PI(i.source)).join("|")})$`)}});const r=e.options.length===1,n=e.options[0]._zod.run;t._zod.parse=(a,i)=>{if(r)return n(a,i);let s=!1;const o=[];for(const l of e.options){const c=l._zod.run({value:a.value,issues:[]},i);if(c instanceof Promise)o.push(c),s=!0;else{if(c.issues.length===0)return c;o.push(c)}}return s?Promise.all(o).then(l=>C4(l,a,t,i)):C4(o,a,t,i)}}),uhe=vt("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,VG.init(t,e);const r=t._zod.parse;ra(t._zod,"propValues",()=>{const a={};for(const i of e.options){const s=i._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(i)}"`);for(const[o,l]of Object.entries(s)){a[o]||(a[o]=new Set);for(const c of l)a[o].add(c)}}return a});const n=YS(()=>{const a=e.options,i=new Map;for(const s of a){const o=s._zod.propValues?.[e.discriminator];if(!o||o.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(const l of o){if(i.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);i.set(l,s)}}return i});t._zod.parse=(a,i)=>{const s=a.value;if(!Mf(s))return a.issues.push({code:"invalid_type",expected:"object",input:s,inst:t}),a;const o=n.value.get(s?.[e.discriminator]);return o?o._zod.run(a,i):e.unionFallback?r(a,i):(a.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:s,path:[e.discriminator],inst:t}),a)}}),dhe=vt("$ZodIntersection",(t,e)=>{pa.init(t,e),t._zod.parse=(r,n)=>{const a=r.value,i=e.left._zod.run({value:a,issues:[]},n),s=e.right._zod.run({value:a,issues:[]},n);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([l,c])=>w4(r,l,c)):w4(r,i,s)}});function wR(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(Bp(t)&&Bp(e)){const r=Object.keys(e),n=Object.keys(t).filter(i=>r.indexOf(i)!==-1),a={...t,...e};for(const i of n){const s=wR(t[i],e[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};a[i]=s.data}return{valid:!0,data:a}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let n=0;n<t.length;n++){const a=t[n],i=e[n],s=wR(a,i);if(!s.valid)return{valid:!1,mergeErrorPath:[n,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function w4(t,e,r){if(e.issues.length&&t.issues.push(...e.issues),r.issues.length&&t.issues.push(...r.issues),Jh(t))return t;const n=wR(e.value,r.value);if(!n.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return t.value=n.data,t}const hhe=vt("$ZodRecord",(t,e)=>{pa.init(t,e),t._zod.parse=(r,n)=>{const a=r.value;if(!Bp(a))return r.issues.push({expected:"record",code:"invalid_type",input:a,inst:t}),r;const i=[],s=e.keyType._zod.values;if(s){r.value={};const o=new Set;for(const c of s)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){o.add(typeof c=="number"?c.toString():c);const u=e.valueType._zod.run({value:a[c],issues:[]},n);u instanceof Promise?i.push(u.then(d=>{d.issues.length&&r.issues.push(...ep(c,d.issues)),r.value[c]=d.value})):(u.issues.length&&r.issues.push(...ep(c,u.issues)),r.value[c]=u.value)}let l;for(const c in a)o.has(c)||(l=l??[],l.push(c));l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:a,inst:t,keys:l})}else{r.value={};for(const o of Reflect.ownKeys(a)){if(o==="__proto__")continue;const l=e.keyType._zod.run({value:o,issues:[]},n);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(l.issues.length){e.mode==="loose"?r.value[o]=a[o]:r.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(u=>$u(u,n,zu())),input:o,path:[o],inst:t});continue}c Line truncated
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const i of r.seen.entries()){const s=i[1];if(e===i[0]){a(i);continue}if(r.external){const l=r.external.registry.get(i[0])?.id;if(e!==i[0]&&l){a(i);continue}}if(r.metadataRegistry.get(i[0])?.id){a(i);continue}if(s.cycle){a(i);continue}if(s.count>1&&r.reused==="ref"){a(i);continue}}}function j$(r,e){const t=r.seen.get(e);if(!t)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=s=>{const o=r.seen.get(s),l=o.def??o.schema,c={...l};if(o.ref===null)return;const u=o.ref;if(o.ref=null,u){n(u);const d=r.seen.get(u).schema;d.$ref&&(r.target==="draft-07"||r.target==="draft-04"||r.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(d)):(Object.assign(l,d),Object.assign(l,c))}o.isParent||r.override({zodSchema:s,jsonSchema:l,path:o.path??[]})};for(const s of[...r.seen.entries()].reverse())n(s[0]);const a={};if(r.target==="draft-2020-12"?a.$schema="https://json-schema.org/draft/2020-12/schema":r.target==="draft-07"?a.$schema="http://json-schema.org/draft-07/schema#":r.target==="draft-04"?a.$schema="http://json-schema.org/draft-04/schema#":r.target,r.external?.uri){const s=r.external.registry.get(e)?.id;if(!s)throw new Error("Schema is missing an `id` property");a.$id=r.external.uri(s)}Object.assign(a,t.def??t.schema);const i=r.external?.defs??{};for(const s of r.seen.entries()){const o=s[1];o.def&&o.defId&&(i[o.defId]=o.def)}r.external||Object.keys(i).length>0&&(r.target==="draft-2020-12"?a.$defs=i:a.definitions=i);try{const s=JSON.parse(JSON.stringify(a));return Object.defineProperty(s,"~standard",{value:{...e["~standard"],jsonSchema:{input:gb(e,"input"),output:gb(e,"output")}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function Qi(r,e){const t=e??{seen:new Set};if(t.seen.has(r))return!1;t.seen.add(r);const n=r._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return Qi(n.element,t);if(n.type==="set")return Qi(n.valueType,t);if(n.type==="lazy")return Qi(n.getter(),t);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return Qi(n.innerType,t);if(n.type==="intersection")return Qi(n.left,t)||Qi(n.right,t);if(n.type==="record"||n.type==="map")return Qi(n.keyType,t)||Qi(n.valueType,t);if(n.type==="pipe")return Qi(n.in,t)||Qi(n.out,t);if(n.type==="object"){for(const a in n.shape)if(Qi(n.shape[a],t))return!0;return!1}if(n.type==="union"){for(const a of n.options)if(Qi(a,t))return!0;return!1}if(n.type==="tuple"){for(const a of n.items)if(Qi(a,t))return!0;return!!(n.rest&&Qi(n.rest,t))}return!1}const gfe=(r,e={})=>t=>{const n=Y$({...t,processors:e});return oi(r,n),W$(n,r),j$(n,r)},gb=(r,e)=>t=>{const{libraryOptions:n,target:a}=t??{},i=Y$({...n??{},target:a,io:e,processors:{}});return oi(r,i),W$(i,r),j$(i,r)},_fe={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},bfe=(r,e,t,n)=>{const a=t;a.type="string";const{minimum:i,maximum:s,format:o,patterns:l,contentEncoding:c}=r._zod.bag;if(typeof i=="number"&&(a.minLength=i),typeof s=="number"&&(a.maxLength=s),o&&(a.format=_fe[o]??o,a.format===""&&delete a.format),c&&(a.contentEncoding=c),l&&l.size>0){const u=[...l];u.length===1?a.pattern=u[0].source:u.length>1&&(a.allOf=[...u.map(d=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},vfe=(r,e,t,n)=>{const a=t,{minimum:i,maximum:s,format:o,multipleOf:l,exclusiveMaximum:c,exclusiveMinimum:u}=r._zod.bag;typeof o=="string"&&o.includes("int")?a.type="integer":a.type="number",typeof u=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(a.minimum=u,a.exclusiveMinimum=!0):a.exclusiveMinimum=u),typeof i=="number"&&(a.minimum=i,typeof u=="number"&&e.target!=="draft-04"&&(u>=i?delete a.minimum:delete a.exclusiveMinimum)),typeof c=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(a.maximum=c,a.exclusiveMaximum=!0):a.exclusiveMaximum=c),typeof s=="number"&&(a.maximum=s,typeof c=="number"&&e.target!=="draft-04"&&(c<=s?delete a.maximum:delete a.exclusiveMaximum)),typeof l=="number"&&(a.multipleOf=l)},yfe=(r,e,t,n)=>{t.type="boolean"},Sfe=(r,e,t,n)=>{e.target==="openapi-3.0"?(t.type="string",t.nullable=!0,t.enum=[null]):t.type="null"},Efe=(r,e,t,n)=>{t.not={}},wfe=(r,e,t,n)=>{},Tfe=(r,e,t,n)=>{},Cfe=(r,e,t,n)=>{const a=r._zod.def,i=C$(a.entries);i.every(s=>typeof s=="number")&&(t.type="number"),i.every(s=>typeof s=="string")&&(t.type="string"),t.enum=i},Afe=(r,e,t,n)=>{const a=r._zod.def,i=[];for(const s of a.values)if(s===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(s))}else i.push(s);if(i.length!==0)if(i.length===1){const s=i[0];t.type=s===null?"null":typeof s,e.Line truncated
`:""},this._extScope=R,this._scope=new t.Scope({parent:R}),this._nodes=[new g]}toString(){return this._root.render(this.opts)}name(R){return this._scope.name(R)}scopeName(R){return this._extScope.name(R)}scopeValue(R,U){const Q=this._extScope.value(R,U);return(this._values[Q.prefix]||(this._values[Q.prefix]=new Set)).add(Q),Q}getScopeValue(R,U){return this._extScope.getValue(R,U)}scopeRefs(R){return this._extScope.scopeRefs(R,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(R,U,Q,ne){const ue=this._scope.toName(U);return Q!==void 0&&ne&&(this._constants[ue.str]=Q),this._leafNode(new s(R,ue,Q)),ue}const(R,U,Q){return this._def(t.varKinds.const,R,U,Q)}let(R,U,Q){return this._def(t.varKinds.let,R,U,Q)}var(R,U,Q){return this._def(t.varKinds.var,R,U,Q)}assign(R,U,Q){return this._leafNode(new o(R,U,Q))}add(R,U){return this._leafNode(new l(R,r.operators.ADD,U))}code(R){return typeof R=="function"?R():R!==e.nil&&this._leafNode(new h(R)),this}object(...R){const U=["{"];for(const[Q,ne]of R)U.length>1&&U.push(","),U.push(Q),(Q!==ne||this.opts.es5)&&(U.push(":"),(0,e.addCodeArg)(U,ne));return U.push("}"),new e._Code(U)}if(R,U,Q){if(this._blockNode(new _(R)),U&&Q)this.code(U).else().code(Q).endIf();else if(U)this.code(U).endIf();else if(Q)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(R){return this._elseNode(new _(R))}else(){return this._elseNode(new b)}endIf(){return this._endBlockNode(_,b)}_for(R,U){return this._blockNode(R),U&&this.code(U).endFor(),this}for(R,U){return this._for(new y(R),U)}forRange(R,U,Q,ne,ue=this.opts.es5?t.varKinds.var:t.varKinds.let){const he=this._scope.toName(R);return this._for(new E(ue,he,U,Q),()=>ne(he))}forOf(R,U,Q,ne=t.varKinds.const){const ue=this._scope.toName(R);if(this.opts.es5){const he=U instanceof e.Name?U:this.var("_arr",U);return this.forRange("_i",0,(0,e._)`${he}.length`,be=>{this.var(ue,(0,e._)`${he}[${be}]`),Q(ue)})}return this._for(new S("of",ne,ue,U),()=>Q(ue))}forIn(R,U,Q,ne=this.opts.es5?t.varKinds.var:t.varKinds.const){if(this.opts.ownProperties)return this.forOf(R,(0,e._)`Object.keys(${U})`,Q);const ue=this._scope.toName(R);return this._for(new S("in",ne,ue,U),()=>Q(ue))}endFor(){return this._endBlockNode(v)}label(R){return this._leafNode(new c(R))}break(R){return this._leafNode(new u(R))}return(R){const U=new C;if(this._blockNode(U),this.code(R),U.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(C)}try(R,U,Q){if(!U&&!Q)throw new Error('CodeGen: "try" without "catch" and "finally"');const ne=new x;if(this._blockNode(ne),this.code(R),U){const ue=this.name("e");this._currNode=ne.catch=new N(ue),U(ue)}return Q&&(this._currNode=ne.finally=new I,this.code(Q)),this._endBlockNode(N,I)}throw(R){return this._leafNode(new d(R))}block(R,U){return this._blockStarts.push(this._nodes.length),R&&this.code(R).endBlock(U),this}endBlock(R){const U=this._blockStarts.pop();if(U===void 0)throw new Error("CodeGen: not in self-balancing block");const Q=this._nodes.length-U;if(Q<0||R!==void 0&&Q!==R)throw new Error(`CodeGen: wrong number of nodes: ${Q} vs ${R} expected`);return this._nodes.length=U,this}func(R,U=e.nil,Q,ne){return this._blockNode(new w(R,U,Q)),ne&&this.code(ne).endFunc(),this}endFunc(){return this._endBlockNode(w)}optimize(R=1){for(;R-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(R){return this._currNode.nodes.push(R),this}_blockNode(R){this._currNode.nodes.push(R),this._nodes.push(R)}_endBlockNode(R,U){const Q=this._currNode;if(Q instanceof R||U&&Q instanceof U)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${U?`${R.kind}/${U.kind}`:R.kind}"`)}_elseNode(R){const U=this._currNode;if(!(U instanceof _))throw new Error('CodeGen: "else" without "if"');return this._currNode=U.else=R,this}get _root(){return this._nodes[0]}get _currNode(){const R=this._nodes;return R[R.length-1]}set _currNode(R){const U=this._nodes;U[U.length-1]=R}}r.CodeGen=D;function H(O,R){for(const U in R)O[U]=(O[U]||0)+(R[U]||0);return O}function q(O,R){return R instanceof e._CodeOrName?H(O,R.names):O}function $(O,R,U){if(O instanceof e.Name)return Q(O);if(!ne(O))return O;return new e._Code(O._items.reduce((ue,he)=>(he instanceof e.Name&&(he=Q(he)),he instanceof e._Code?ue.push(...he._items):ue.push(he),ue),[]));function Q(ue){const he=U[ue.str];return he===void 0||R[ue.str]!==1?ue:(delete R[ue.str],he)}function ne(ue){return ue instanceof e._Code&&ue._items.some(he=>he instanceof e.Name&&R[he.str]===1&&U[he.str]!==void 0)}}function K(O,R){for(const U in R)O[U]=(O[U]||0)-(R[U]||0)}function z(O){return typeof O=="boolean"||typeof O=="number"||O===null?!O:(0,e._)`!${te(O)}`}r.not=z;const re=B(r.operators.AND);function W(...O){return O.reduce(re)}r.and=W;const ie=B(r.operators.OR);function k(...O){return O.reduce(ie)}r.or=k;function B(O){return(R,U)=>R===e.nil?U:U===e.nil?R:(0,e._)`${te(R)} ${O} ${te(U)}`}function te(O){return Line truncated
|| (${x} == "string" && ${w} && ${w} == +${w})`).assign(N,(0,n._)`+${w}`);return;case"integer":S.elseIf((0,n._)`${x} === "boolean" || ${w} === null
|| (${x} === "string" && ${w} && ${w} == +${w} && !(${w} % 1))`).assign(N,(0,n._)`+${w}`);return;case"boolean":S.elseIf((0,n._)`${w} === "false" || ${w} === 0 || ${w} === null`).assign(N,!1).elseIf((0,n._)`${w} === "true" || ${w} === 1`).assign(N,!0);return;case"null":S.elseIf((0,n._)`${w} === "" || ${w} === 0 || ${w} === false`),S.assign(N,null);return;case"array":S.elseIf((0,n._)`${x} === "string" || ${x} === "number"
|| ${x} === "boolean" || ${w} === null`).assign(N,(0,n._)`[${w}]`)}}}function h({gen:v,parentData:y,parentDataProperty:E},S){v.if((0,n._)`${y} !== undefined`,()=>v.assign((0,n._)`${y}[${E}]`,S))}function p(v,y,E,S=i.Correct){const w=S===i.Correct?n.operators.EQ:n.operators.NEQ;let C;switch(v){case"null":return(0,n._)`${y} ${w} null`;case"array":C=(0,n._)`Array.isArray(${y})`;break;case"object":C=(0,n._)`${y} && typeof ${y} == "object" && !Array.isArray(${y})`;break;case"integer":C=x((0,n._)`!(${y} % 1) && !isNaN(${y})`);break;case"number":C=x();break;default:return(0,n._)`typeof ${y} ${w} ${v}`}return S===i.Correct?C:(0,n.not)(C);function x(N=n.nil){return(0,n.and)((0,n._)`typeof ${y} == "number"`,N,E?(0,n._)`isFinite(${y})`:n.nil)}}wi.checkDataType=p;function m(v,y,E,S){if(v.length===1)return p(v[0],y,E,S);let w;const C=(0,a.toHash)(v);if(C.array&&C.object){const x=(0,n._)`typeof ${y} != "object"`;w=C.null?x:(0,n._)`!${y} || ${x}`,delete C.null,delete C.array,delete C.object}else w=n.nil;C.number&&delete C.integer;for(const x in C)w=(0,n.and)(w,p(x,y,E,S));return w}wi.checkDataTypes=m;const g={message:({schema:v})=>`must be ${v}`,params:({schema:v,schemaValue:y})=>typeof v=="string"?(0,n._)`{type: ${v}}`:(0,n._)`{type: ${y}}`};function b(v){const y=_(v);(0,t.reportError)(y,g)}wi.reportTypeError=b;function _(v){const{gen:y,data:E,schema:S}=v,w=(0,a.schemaRefOrVal)(v,S,"type");return{gen:y,keyword:"type",data:E,schema:S.type,schemaCode:w,schemaValue:w,parentSchema:S,params:{},it:v}}return wi}var Ap={},K8;function Uge(){if(K8)return Ap;K8=1,Object.defineProperty(Ap,"__esModule",{value:!0}),Ap.assignDefaults=void 0;const r=xn(),e=Gn();function t(a,i){const{properties:s,items:o}=a.schema;if(i==="object"&&s)for(const l in s)n(a,l,s[l].default);else i==="array"&&Array.isArray(o)&&o.forEach((l,c)=>n(a,c,l.default))}Ap.assignDefaults=t;function n(a,i,s){const{gen:o,compositeRule:l,data:c,opts:u}=a;if(s===void 0)return;const d=(0,r._)`${c}${(0,r.getProperty)(i)}`;if(l){(0,e.checkStrictMode)(a,`default is ignored for: ${d}`);return}let h=(0,r._)`${d} === undefined`;u.useDefaults==="empty"&&(h=(0,r._)`${h} || ${d} === null || ${d} === ""`),o.if(h,(0,r._)`${d} = ${(0,r.stringify)(s)}`)}return Ap}var zo={},Wn={},X8;function ol(){if(X8)return Wn;X8=1,Object.defineProperty(Wn,"__esModule",{value:!0}),Wn.validateUnion=Wn.validateArray=Wn.usePattern=Wn.callValidateCode=Wn.schemaProperties=Wn.allSchemaProperties=Wn.noPropertyInData=Wn.propertyInData=Wn.isOwnProperty=Wn.hasPropFunc=Wn.reportMissingProp=Wn.checkMissingProp=Wn.checkReportMissingProp=void 0;const r=xn(),e=Gn(),t=Qu(),n=Gn();function a(v,y){const{gen:E,data:S,it:w}=v;E.if(u(E,S,y,w.opts.ownProperties),()=>{v.setParams({missingProperty:(0,r._)`${y}`},!0),v.error()})}Wn.checkReportMissingProp=a;function i({gen:v,data:y,it:{opts:E}},S,w){return(0,r.or)(...S.map(C=>(0,r.and)(u(v,y,C,E.ownProperties),(0,r._)`${w} = ${C}`)))}Wn.checkMissingProp=i;function s(v,y){v.setParams({missingProperty:y},!0),v.error()}Wn.reportMissingProp=s;function o(v){return v.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,r._)`Object.prototype.hasOwnProperty`})}Wn.hasPropFunc=o;function l(v,y,E){return(0,r._)`${o(v)}.call(${y}, ${E})`}Wn.isOwnProperty=l;function c(v,y,E,S){const w=(0,r._)`${y}${(0,r.getProperty)(E)} !== undefined`;return S?(0,r._)`${w} && ${l(v,y,E)}`:w}Wn.propertyInData=c;function u(v,y,E,S){const w=(0,r._)`${y}${(0,r.getProperty)(E)} === undefined`;return S?(0,r.or)(w,(0,r.not)(l(v,y,E))):w}Wn.noPropertyInData=u;function d(v){return v?Object.keys(v).filter(y=>y!=="__proto__"):[]}Wn.allSchemaProperties=d;function h(v,y){return d(y).filter(E=>!(0,e.alwaysValidSchema)(v,y[E]))}Wn.schemaProperties=h;function p({schemaCode:v,data:y,it:{gen:E,topSchemaRef:S,schemaPath:w,errorPath:C},it:x},N,I,D){const H=D?(0,r._)`${v}, ${y}, ${S}${w}`:y,q=[[t.default.instancePath,(0,r.strConcat)(t.default.instancePath,C)],[t.default.parentData,x.parentData],[t.default.parentDataProperty,x.parentDataProperty],[t.default.rootData,t.default.rootData]];x.opts.dynamicRef&&q.push([t.default.dynamicAnchors,t.default.dynamicAnchors]);const $=(0,r._)`${H}, ${E.object(...q)}`;return I!==r.nil?(0,r._)`${N}.call(${I}, ${$})`:(0,r._)`${N}(${$})`}Wn.callValidateCode=p;const m=(0,r._)`new RegExp`;function g({gen:v,it:{opts:y}},E){const S=y.unicodeRegExp?"u":"",{regExp:w}=y.code,C=w(E,S);return v.scopeValue("pattern",{key:C.toString(),ref:C,code:(0,r._)`${w.code==="new RegExp"?m:(0,n.useFunc)(v,w)}(${E}, ${S})`})}Wn.usePattern=g;function b(v){const{gen:y,data:E,keyword:S,it:w}=v,C=y.name("valid");if(w.allErrors){const N=y.let("valid",!0);return x(()=>y.assign(N,!1)),N}return y.var(C,!0),x(()=>y.break()),C;function x(N){const I=y.const("len",(0,r._)`${E}.length`);y.forRange("i",0,I,D=>{v.subschema({keyword:S,dataProp:D,dataPropType:e.Type.Num},C),y.if((0,r.not)(C),N)})}}Wn.validateArray=b;function _(v){const{gen:y,schema:E,keyword:S,it:w}=v;if(!Array.isArray(E))throw new Error("ajv Line truncated
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const i of t.seen.entries()){const s=i[1];if(e===i[0]){a(i);continue}if(t.external){const l=t.external.registry.get(i[0])?.id;if(e!==i[0]&&l){a(i);continue}}if(t.metadataRegistry.get(i[0])?.id){a(i);continue}if(s.cycle){a(i);continue}if(s.count>1&&t.reused==="ref"){a(i);continue}}}function ZG(t,e){const r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=s=>{const o=t.seen.get(s),l=o.def??o.schema,c={...l};if(o.ref===null)return;const u=o.ref;if(o.ref=null,u){n(u);const d=t.seen.get(u).schema;d.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(d)):(Object.assign(l,d),Object.assign(l,c))}o.isParent||t.override({zodSchema:s,jsonSchema:l,path:o.path??[]})};for(const s of[...t.seen.entries()].reverse())n(s[0]);const a={};if(t.target==="draft-2020-12"?a.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?a.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?a.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){const s=t.external.registry.get(e)?.id;if(!s)throw new Error("Schema is missing an `id` property");a.$id=t.external.uri(s)}Object.assign(a,r.def??r.schema);const i=t.external?.defs??{};for(const s of t.seen.entries()){const o=s[1];o.def&&o.defId&&(i[o.defId]=o.def)}t.external||Object.keys(i).length>0&&(t.target==="draft-2020-12"?a.$defs=i:a.definitions=i);try{const s=JSON.parse(JSON.stringify(a));return Object.defineProperty(s,"~standard",{value:{...e["~standard"],jsonSchema:{input:Sb(e,"input"),output:Sb(e,"output")}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function es(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 es(n.element,r);if(n.type==="set")return es(n.valueType,r);if(n.type==="lazy")return es(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 es(n.innerType,r);if(n.type==="intersection")return es(n.left,r)||es(n.right,r);if(n.type==="record"||n.type==="map")return es(n.keyType,r)||es(n.valueType,r);if(n.type==="pipe")return es(n.in,r)||es(n.out,r);if(n.type==="object"){for(const a in n.shape)if(es(n.shape[a],r))return!0;return!1}if(n.type==="union"){for(const a of n.options)if(es(a,r))return!0;return!1}if(n.type==="tuple"){for(const a of n.items)if(es(a,r))return!0;return!!(n.rest&&es(n.rest,r))}return!1}const ype=(t,e={})=>r=>{const n=QG({...r,processors:e});return di(t,n),XG(n,t),ZG(n,t)},Sb=(t,e)=>r=>{const{libraryOptions:n,target:a}=r??{},i=QG({...n??{},target:a,io:e,processors:{}});return di(t,i),XG(i,t),ZG(i,t)},Tpe={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Cpe=(t,e,r,n)=>{const a=r;a.type="string";const{minimum:i,maximum:s,format:o,patterns:l,contentEncoding:c}=t._zod.bag;if(typeof i=="number"&&(a.minLength=i),typeof s=="number"&&(a.maxLength=s),o&&(a.format=Tpe[o]??o,a.format===""&&delete a.format),c&&(a.contentEncoding=c),l&&l.size>0){const u=[...l];u.length===1?a.pattern=u[0].source:u.length>1&&(a.allOf=[...u.map(d=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},wpe=(t,e,r,n)=>{const a=r,{minimum:i,maximum:s,format:o,multipleOf:l,exclusiveMaximum:c,exclusiveMinimum:u}=t._zod.bag;typeof o=="string"&&o.includes("int")?a.type="integer":a.type="number",typeof u=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(a.minimum=u,a.exclusiveMinimum=!0):a.exclusiveMinimum=u),typeof i=="number"&&(a.minimum=i,typeof u=="number"&&e.target!=="draft-04"&&(u>=i?delete a.minimum:delete a.exclusiveMinimum)),typeof c=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(a.maximum=c,a.exclusiveMaximum=!0):a.exclusiveMaximum=c),typeof s=="number"&&(a.maximum=s,typeof c=="number"&&e.target!=="draft-04"&&(c<=s?delete a.maximum:delete a.exclusiveMaximum)),typeof l=="number"&&(a.multipleOf=l)},Ape=(t,e,r,n)=>{r.type="boolean"},Rpe=(t,e,r,n)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},Ope=(t,e,r,n)=>{r.not={}},Npe=(t,e,r,n)=>{},Ipe=(t,e,r,n)=>{},xpe=(t,e,r,n)=>{const a=t._zod.def,i=NG(a.entries);i.every(s=>typeof s=="number")&&(r.type="number"),i.every(s=>typeof s=="string")&&(r.type="string"),r.enum=i},Dpe=(t,e,r,n)=>{const a=t._zod.def,i=[];for(const s of a.values)if(s===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(s))}else i.push(s);if(i.length!==0)if(i.length===1){const s=i[0];r.type=s===null?"null":typeof s,e.Line truncated
`:""},this._extScope=O,this._scope=new r.Scope({parent:O}),this._nodes=[new g]}toString(){return this._root.render(this.opts)}name(O){return this._scope.name(O)}scopeName(O){return this._extScope.name(O)}scopeValue(O,U){const X=this._extScope.value(O,U);return(this._values[X.prefix]||(this._values[X.prefix]=new Set)).add(X),X}getScopeValue(O,U){return this._extScope.getValue(O,U)}scopeRefs(O){return this._extScope.scopeRefs(O,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(O,U,X,ne){const ue=this._scope.toName(U);return X!==void 0&&ne&&(this._constants[ue.str]=X),this._leafNode(new s(O,ue,X)),ue}const(O,U,X){return this._def(r.varKinds.const,O,U,X)}let(O,U,X){return this._def(r.varKinds.let,O,U,X)}var(O,U,X){return this._def(r.varKinds.var,O,U,X)}assign(O,U,X){return this._leafNode(new o(O,U,X))}add(O,U){return this._leafNode(new l(O,t.operators.ADD,U))}code(O){return typeof O=="function"?O():O!==e.nil&&this._leafNode(new h(O)),this}object(...O){const U=["{"];for(const[X,ne]of O)U.length>1&&U.push(","),U.push(X),(X!==ne||this.opts.es5)&&(U.push(":"),(0,e.addCodeArg)(U,ne));return U.push("}"),new e._Code(U)}if(O,U,X){if(this._blockNode(new _(O)),U&&X)this.code(U).else().code(X).endIf();else if(U)this.code(U).endIf();else if(X)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(O){return this._elseNode(new _(O))}else(){return this._elseNode(new b)}endIf(){return this._endBlockNode(_,b)}_for(O,U){return this._blockNode(O),U&&this.code(U).endFor(),this}for(O,U){return this._for(new E(O),U)}forRange(O,U,X,ne,ue=this.opts.es5?r.varKinds.var:r.varKinds.let){const he=this._scope.toName(O);return this._for(new y(ue,he,U,X),()=>ne(he))}forOf(O,U,X,ne=r.varKinds.const){const ue=this._scope.toName(O);if(this.opts.es5){const he=U instanceof e.Name?U:this.var("_arr",U);return this.forRange("_i",0,(0,e._)`${he}.length`,be=>{this.var(ue,(0,e._)`${he}[${be}]`),X(ue)})}return this._for(new v("of",ne,ue,U),()=>X(ue))}forIn(O,U,X,ne=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(O,(0,e._)`Object.keys(${U})`,X);const ue=this._scope.toName(O);return this._for(new v("in",ne,ue,U),()=>X(ue))}endFor(){return this._endBlockNode(S)}label(O){return this._leafNode(new c(O))}break(O){return this._leafNode(new u(O))}return(O){const U=new w;if(this._blockNode(U),this.code(O),U.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(w)}try(O,U,X){if(!U&&!X)throw new Error('CodeGen: "try" without "catch" and "finally"');const ne=new A;if(this._blockNode(ne),this.code(O),U){const ue=this.name("e");this._currNode=ne.catch=new I(ue),U(ue)}return X&&(this._currNode=ne.finally=new x,this.code(X)),this._endBlockNode(I,x)}throw(O){return this._leafNode(new d(O))}block(O,U){return this._blockStarts.push(this._nodes.length),O&&this.code(O).endBlock(U),this}endBlock(O){const U=this._blockStarts.pop();if(U===void 0)throw new Error("CodeGen: not in self-balancing block");const X=this._nodes.length-U;if(X<0||O!==void 0&&X!==O)throw new Error(`CodeGen: wrong number of nodes: ${X} vs ${O} expected`);return this._nodes.length=U,this}func(O,U=e.nil,X,ne){return this._blockNode(new T(O,U,X)),ne&&this.code(ne).endFunc(),this}endFunc(){return this._endBlockNode(T)}optimize(O=1){for(;O-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(O){return this._currNode.nodes.push(O),this}_blockNode(O){this._currNode.nodes.push(O),this._nodes.push(O)}_endBlockNode(O,U){const X=this._currNode;if(X instanceof O||U&&X instanceof U)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${U?`${O.kind}/${U.kind}`:O.kind}"`)}_elseNode(O){const U=this._currNode;if(!(U instanceof _))throw new Error('CodeGen: "else" without "if"');return this._currNode=U.else=O,this}get _root(){return this._nodes[0]}get _currNode(){const O=this._nodes;return O[O.length-1]}set _currNode(O){const U=this._nodes;U[U.length-1]=O}}t.CodeGen=D;function $(N,O){for(const U in O)N[U]=(N[U]||0)+(O[U]||0);return N}function H(N,O){return O instanceof e._CodeOrName?$(N,O.names):N}function G(N,O,U){if(N instanceof e.Name)return X(N);if(!ne(N))return N;return new e._Code(N._items.reduce((ue,he)=>(he instanceof e.Name&&(he=X(he)),he instanceof e._Code?ue.push(...he._items):ue.push(he),ue),[]));function X(ue){const he=U[ue.str];return he===void 0||O[ue.str]!==1?ue:(delete O[ue.str],he)}function ne(ue){return ue instanceof e._Code&&ue._items.some(he=>he instanceof e.Name&&O[he.str]===1&&U[he.str]!==void 0)}}function K(N,O){for(const U in O)N[U]=(N[U]||0)-(O[U]||0)}function z(N){return typeof N=="boolean"||typeof N=="number"||N===null?!N:(0,e._)`!${J(N)}`}t.not=z;const re=B(t.operators.AND);function W(...N){return N.reduce(re)}t.and=W;const ie=B(t.operators.OR);function M(...N){return N.reduce(ie)}t.or=M;function B(N){return(O,U)=>O===e.nil?U:U===e.nil?O:(0,e._)`${J(O)} ${N} ${J(U)}`}function J(N){return N i Line truncated
|| (${A} == "string" && ${T} && ${T} == +${T})`).assign(I,(0,n._)`+${T}`);return;case"integer":v.elseIf((0,n._)`${A} === "boolean" || ${T} === null
|| (${A} === "string" && ${T} && ${T} == +${T} && !(${T} % 1))`).assign(I,(0,n._)`+${T}`);return;case"boolean":v.elseIf((0,n._)`${T} === "false" || ${T} === 0 || ${T} === null`).assign(I,!1).elseIf((0,n._)`${T} === "true" || ${T} === 1`).assign(I,!0);return;case"null":v.elseIf((0,n._)`${T} === "" || ${T} === 0 || ${T} === false`),v.assign(I,null);return;case"array":v.elseIf((0,n._)`${A} === "string" || ${A} === "number"
|| ${A} === "boolean" || ${T} === null`).assign(I,(0,n._)`[${T}]`)}}}function h({gen:S,parentData:E,parentDataProperty:y},v){S.if((0,n._)`${E} !== undefined`,()=>S.assign((0,n._)`${E}[${y}]`,v))}function m(S,E,y,v=i.Correct){const T=v===i.Correct?n.operators.EQ:n.operators.NEQ;let w;switch(S){case"null":return(0,n._)`${E} ${T} null`;case"array":w=(0,n._)`Array.isArray(${E})`;break;case"object":w=(0,n._)`${E} && typeof ${E} == "object" && !Array.isArray(${E})`;break;case"integer":w=A((0,n._)`!(${E} % 1) && !isNaN(${E})`);break;case"number":w=A();break;default:return(0,n._)`typeof ${E} ${T} ${S}`}return v===i.Correct?w:(0,n.not)(w);function A(I=n.nil){return(0,n.and)((0,n._)`typeof ${E} == "number"`,I,y?(0,n._)`isFinite(${E})`:n.nil)}}Ci.checkDataType=m;function f(S,E,y,v){if(S.length===1)return m(S[0],E,y,v);let T;const w=(0,a.toHash)(S);if(w.array&&w.object){const A=(0,n._)`typeof ${E} != "object"`;T=w.null?A:(0,n._)`!${E} || ${A}`,delete w.null,delete w.array,delete w.object}else T=n.nil;w.number&&delete w.integer;for(const A in w)T=(0,n.and)(T,m(A,E,y,v));return T}Ci.checkDataTypes=f;const g={message:({schema:S})=>`must be ${S}`,params:({schema:S,schemaValue:E})=>typeof S=="string"?(0,n._)`{type: ${S}}`:(0,n._)`{type: ${E}}`};function b(S){const E=_(S);(0,r.reportError)(E,g)}Ci.reportTypeError=b;function _(S){const{gen:E,data:y,schema:v}=S,T=(0,a.schemaRefOrVal)(S,v,"type");return{gen:E,keyword:"type",data:y,schema:v.type,schemaCode:T,schemaValue:T,parentSchema:v,params:{},it:S}}return Ci}var Rm={},J4;function Yge(){if(J4)return Rm;J4=1,Object.defineProperty(Rm,"__esModule",{value:!0}),Rm.assignDefaults=void 0;const t=Rn(),e=zn();function r(a,i){const{properties:s,items:o}=a.schema;if(i==="object"&&s)for(const l in s)n(a,l,s[l].default);else i==="array"&&Array.isArray(o)&&o.forEach((l,c)=>n(a,c,l.default))}Rm.assignDefaults=r;function n(a,i,s){const{gen:o,compositeRule:l,data:c,opts:u}=a;if(s===void 0)return;const d=(0,t._)`${c}${(0,t.getProperty)(i)}`;if(l){(0,e.checkStrictMode)(a,`default is ignored for: ${d}`);return}let h=(0,t._)`${d} === undefined`;u.useDefaults==="empty"&&(h=(0,t._)`${h} || ${d} === null || ${d} === ""`),o.if(h,(0,t._)`${d} = ${(0,t.stringify)(s)}`)}return Rm}var Vo={},Wn={},eP;function hl(){if(eP)return Wn;eP=1,Object.defineProperty(Wn,"__esModule",{value:!0}),Wn.validateUnion=Wn.validateArray=Wn.usePattern=Wn.callValidateCode=Wn.schemaProperties=Wn.allSchemaProperties=Wn.noPropertyInData=Wn.propertyInData=Wn.isOwnProperty=Wn.hasPropFunc=Wn.reportMissingProp=Wn.checkMissingProp=Wn.checkReportMissingProp=void 0;const t=Rn(),e=zn(),r=nd(),n=zn();function a(S,E){const{gen:y,data:v,it:T}=S;y.if(u(y,v,E,T.opts.ownProperties),()=>{S.setParams({missingProperty:(0,t._)`${E}`},!0),S.error()})}Wn.checkReportMissingProp=a;function i({gen:S,data:E,it:{opts:y}},v,T){return(0,t.or)(...v.map(w=>(0,t.and)(u(S,E,w,y.ownProperties),(0,t._)`${T} = ${w}`)))}Wn.checkMissingProp=i;function s(S,E){S.setParams({missingProperty:E},!0),S.error()}Wn.reportMissingProp=s;function o(S){return S.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,t._)`Object.prototype.hasOwnProperty`})}Wn.hasPropFunc=o;function l(S,E,y){return(0,t._)`${o(S)}.call(${E}, ${y})`}Wn.isOwnProperty=l;function c(S,E,y,v){const T=(0,t._)`${E}${(0,t.getProperty)(y)} !== undefined`;return v?(0,t._)`${T} && ${l(S,E,y)}`:T}Wn.propertyInData=c;function u(S,E,y,v){const T=(0,t._)`${E}${(0,t.getProperty)(y)} === undefined`;return v?(0,t.or)(T,(0,t.not)(l(S,E,y))):T}Wn.noPropertyInData=u;function d(S){return S?Object.keys(S).filter(E=>E!=="__proto__"):[]}Wn.allSchemaProperties=d;function h(S,E){return d(E).filter(y=>!(0,e.alwaysValidSchema)(S,E[y]))}Wn.schemaProperties=h;function m({schemaCode:S,data:E,it:{gen:y,topSchemaRef:v,schemaPath:T,errorPath:w},it:A},I,x,D){const $=D?(0,t._)`${S}, ${E}, ${v}${T}`:E,H=[[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,w)],[r.default.parentData,A.parentData],[r.default.parentDataProperty,A.parentDataProperty],[r.default.rootData,r.default.rootData]];A.opts.dynamicRef&&H.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);const G=(0,t._)`${$}, ${y.object(...H)}`;return x!==t.nil?(0,t._)`${I}.call(${x}, ${G})`:(0,t._)`${I}(${G})`}Wn.callValidateCode=m;const f=(0,t._)`new RegExp`;function g({gen:S,it:{opts:E}},y){const v=E.unicodeRegExp?"u":"",{regExp:T}=E.code,w=T(y,v);return S.scopeValue("pattern",{key:w.toString(),ref:w,code:(0,t._)`${T.code==="new RegExp"?f:(0,n.useFunc)(S,T)}(${y}, ${v})`})}Wn.usePattern=g;function b(S){const{gen:E,data:y,keyword:v,it:T}=S,w=E.name("valid");if(T.allErrors){const I=E.let("valid",!0);return A(()=>E.assign(I,!1)),I}return E.var(w,!0),A(()=>E.break()),w;function A(I){const x=E.const("len",(0,t._)`${y}.length`);E.forRange("i",0,x,D=>{S.subschema({keyword:v,dataProp:D,dataPropType:e.Type.Num},w),E.if((0,t.not)(w),I)})}}Wn.validateArray=b;function _(S){const{gen:E,schema:y,keyword:v,it:T}=S;if(!Array.isArray(y))throw new Error("ajv Line truncated
missingProperty: ${d},
depsCount: ${c},
deps: ${u}}`};const a={keyword:"dependencies",type:"object",schemaType:"object",error:r.error,code(l){const[c,u]=i(l);s(l,c),o(l,u)}};function i({schema:l}){const c={},u={};for(const d in l){if(d==="__proto__")continue;const h=Array.isArray(l[d])?c:u;h[d]=l[d]}return[c,u]}function s(l,c=l.schema){const{gen:u,data:d,it:h}=l;if(Object.keys(c).length===0)return;const p=u.let("missing");for(const m in c){const g=c[m];if(g.length===0)continue;const b=(0,n.propertyInData)(u,d,m,h.opts.ownProperties);l.setParams({property:m,depsCount:g.length,deps:g.join(", ")}),h.allErrors?u.if(b,()=>{for(const _ of g)(0,n.checkReportMissingProp)(l,_)}):(u.if((0,e._)`${b} && (${(0,n.checkMissingProp)(l,g,p)})`),(0,n.reportMissingProp)(l,p),u.else())}}r.validatePropertyDeps=s;function o(l,c=l.schema){const{gen:u,data:d,keyword:h,it:p}=l,m=u.name("valid");for(const g in c)(0,t.alwaysValidSchema)(p,c[g])||(u.if((0,n.propertyInData)(u,d,g,p.opts.ownProperties),()=>{const b=l.subschema({keyword:h,schemaProp:g},m);l.mergeValidEvaluated(b,m)},()=>u.var(m,!0)),l.ok(m))}r.validateSchemaDeps=o,r.default=a}(gT)),gT}var z0={},Mk;function b0e(){if(Mk)return z0;Mk=1,Object.defineProperty(z0,"__esModule",{value:!0});const r=xn(),e=Gn(),n={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:a})=>(0,r._)`{propertyName: ${a.propertyName}}`},code(a){const{gen:i,schema:s,data:o,it:l}=a;if((0,e.alwaysValidSchema)(l,s))return;const c=i.name("valid");i.forIn("key",o,u=>{a.setParams({propertyName:u}),a.subschema({keyword:"propertyNames",data:u,dataTypes:["string"],propertyName:u,compositeRule:!0},c),i.if((0,r.not)(c),()=>{a.error(!0),l.allErrors||i.break()})}),a.ok(c)}};return z0.default=n,z0}var q0={},Dk;function zG(){if(Dk)return q0;Dk=1,Object.defineProperty(q0,"__esModule",{value:!0});const r=ol(),e=xn(),t=Qu(),n=Gn(),i={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:s})=>(0,e._)`{additionalProperty: ${s.additionalProperty}}`},code(s){const{gen:o,schema:l,parentSchema:c,data:u,errsCount:d,it:h}=s;if(!d)throw new Error("ajv implementation error");const{allErrors:p,opts:m}=h;if(h.props=!0,m.removeAdditional!=="all"&&(0,n.alwaysValidSchema)(h,l))return;const g=(0,r.allSchemaProperties)(c.properties),b=(0,r.allSchemaProperties)(c.patternProperties);_(),s.ok((0,e._)`${d} === ${t.default.errors}`);function _(){o.forIn("key",u,w=>{!g.length&&!b.length?E(w):o.if(v(w),()=>E(w))})}function v(w){let C;if(g.length>8){const x=(0,n.schemaRefOrVal)(h,c.properties,"properties");C=(0,r.isOwnProperty)(o,x,w)}else g.length?C=(0,e.or)(...g.map(x=>(0,e._)`${w} === ${x}`)):C=e.nil;return b.length&&(C=(0,e.or)(C,...b.map(x=>(0,e._)`${(0,r.usePattern)(s,x)}.test(${w})`))),(0,e.not)(C)}function y(w){o.code((0,e._)`delete ${u}[${w}]`)}function E(w){if(m.removeAdditional==="all"||m.removeAdditional&&l===!1){y(w);return}if(l===!1){s.setParams({additionalProperty:w}),s.error(),p||o.break();return}if(typeof l=="object"&&!(0,n.alwaysValidSchema)(h,l)){const C=o.name("valid");m.removeAdditional==="failing"?(S(w,C,!1),o.if((0,e.not)(C),()=>{s.reset(),y(w)})):(S(w,C),p||o.if((0,e.not)(C),()=>o.break()))}}function S(w,C,x){const N={keyword:"additionalProperties",dataProp:w,dataPropType:n.Type.Str};x===!1&&Object.assign(N,{compositeRule:!0,createErrors:!1,allErrors:!1}),s.subschema(N,C)}}};return q0.default=i,q0}var H0={},Pk;function v0e(){if(Pk)return H0;Pk=1,Object.defineProperty(H0,"__esModule",{value:!0});const r=ey(),e=ol(),t=Gn(),n=zG(),a={keyword:"properties",type:"object",schemaType:"object",code(i){const{gen:s,schema:o,parentSchema:l,data:c,it:u}=i;u.opts.removeAdditional==="all"&&l.additionalProperties===void 0&&n.default.code(new r.KeywordCxt(u,n.default,"additionalProperties"));const d=(0,e.allSchemaProperties)(o);for(const b of d)u.definedProperties.add(b);u.opts.unevaluated&&d.length&&u.props!==!0&&(u.props=t.mergeEvaluated.props(s,(0,t.toHash)(d),u.props));const h=d.filter(b=>!(0,t.alwaysValidSchema)(u,o[b]));if(h.length===0)return;const p=s.name("valid");for(const b of h)m(b)?g(b):(s.if((0,e.propertyInData)(s,c,b,u.opts.ownProperties)),g(b),u.allErrors||s.else().var(p,!0),s.endIf()),i.it.definedProperties.add(b),i.ok(p);function m(b){return u.opts.useDefaults&&!u.compositeRule&&o[b].default!==void 0}function g(b){i.subschema({keyword:"properties",schemaProp:b,dataProp:b},p)}}};return H0.default=a,H0}var V0={},Lk;function y0e(){if(Lk)return V0;Lk=1,Object.defineProperty(V0,"__esModule",{value:!0});const r=ol(),e=xn(),t=Gn(),n=Gn(),a={keyword:"patternProperties",type:"object",schemaType:"object",code(i){const{gen:s,schema:o,data:l,parentSchema:c,it:u}=i,{opts:d}=u,h=(0,r.allSchemaProperties)(o),p=h.filter(E=>(0,t.alwaysValidSchema)(u,o[E]));if(h.length===0||p.length===h.length&&(!u.opts.unevaluated||u.props===!0))return;const m=d.strictSchema&&!d.allowMatch Line truncated
`:""},this._extScope=R,this._scope=new t.Scope({parent:R}),this._nodes=[new g]}toString(){return this._root.render(this.opts)}name(R){return this._scope.name(R)}scopeName(R){return this._extScope.name(R)}scopeValue(R,U){const Q=this._extScope.value(R,U);return(this._values[Q.prefix]||(this._values[Q.prefix]=new Set)).add(Q),Q}getScopeValue(R,U){return this._extScope.getValue(R,U)}scopeRefs(R){return this._extScope.scopeRefs(R,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(R,U,Q,ne){const ue=this._scope.toName(U);return Q!==void 0&&ne&&(this._constants[ue.str]=Q),this._leafNode(new s(R,ue,Q)),ue}const(R,U,Q){return this._def(t.varKinds.const,R,U,Q)}let(R,U,Q){return this._def(t.varKinds.let,R,U,Q)}var(R,U,Q){return this._def(t.varKinds.var,R,U,Q)}assign(R,U,Q){return this._leafNode(new o(R,U,Q))}add(R,U){return this._leafNode(new l(R,r.operators.ADD,U))}code(R){return typeof R=="function"?R():R!==e.nil&&this._leafNode(new h(R)),this}object(...R){const U=["{"];for(const[Q,ne]of R)U.length>1&&U.push(","),U.push(Q),(Q!==ne||this.opts.es5)&&(U.push(":"),(0,e.addCodeArg)(U,ne));return U.push("}"),new e._Code(U)}if(R,U,Q){if(this._blockNode(new _(R)),U&&Q)this.code(U).else().code(Q).endIf();else if(U)this.code(U).endIf();else if(Q)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(R){return this._elseNode(new _(R))}else(){return this._elseNode(new b)}endIf(){return this._endBlockNode(_,b)}_for(R,U){return this._blockNode(R),U&&this.code(U).endFor(),this}for(R,U){return this._for(new y(R),U)}forRange(R,U,Q,ne,ue=this.opts.es5?t.varKinds.var:t.varKinds.let){const he=this._scope.toName(R);return this._for(new E(ue,he,U,Q),()=>ne(he))}forOf(R,U,Q,ne=t.varKinds.const){const ue=this._scope.toName(R);if(this.opts.es5){const he=U instanceof e.Name?U:this.var("_arr",U);return this.forRange("_i",0,(0,e._)`${he}.length`,be=>{this.var(ue,(0,e._)`${he}[${be}]`),Q(ue)})}return this._for(new S("of",ne,ue,U),()=>Q(ue))}forIn(R,U,Q,ne=this.opts.es5?t.varKinds.var:t.varKinds.const){if(this.opts.ownProperties)return this.forOf(R,(0,e._)`Object.keys(${U})`,Q);const ue=this._scope.toName(R);return this._for(new S("in",ne,ue,U),()=>Q(ue))}endFor(){return this._endBlockNode(v)}label(R){return this._leafNode(new c(R))}break(R){return this._leafNode(new u(R))}return(R){const U=new C;if(this._blockNode(U),this.code(R),U.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(C)}try(R,U,Q){if(!U&&!Q)throw new Error('CodeGen: "try" without "catch" and "finally"');const ne=new x;if(this._blockNode(ne),this.code(R),U){const ue=this.name("e");this._currNode=ne.catch=new N(ue),U(ue)}return Q&&(this._currNode=ne.finally=new I,this.code(Q)),this._endBlockNode(N,I)}throw(R){return this._leafNode(new d(R))}block(R,U){return this._blockStarts.push(this._nodes.length),R&&this.code(R).endBlock(U),this}endBlock(R){const U=this._blockStarts.pop();if(U===void 0)throw new Error("CodeGen: not in self-balancing block");const Q=this._nodes.length-U;if(Q<0||R!==void 0&&Q!==R)throw new Error(`CodeGen: wrong number of nodes: ${Q} vs ${R} expected`);return this._nodes.length=U,this}func(R,U=e.nil,Q,ne){return this._blockNode(new w(R,U,Q)),ne&&this.code(ne).endFunc(),this}endFunc(){return this._endBlockNode(w)}optimize(R=1){for(;R-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(R){return this._currNode.nodes.push(R),this}_blockNode(R){this._currNode.nodes.push(R),this._nodes.push(R)}_endBlockNode(R,U){const Q=this._currNode;if(Q instanceof R||U&&Q instanceof U)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${U?`${R.kind}/${U.kind}`:R.kind}"`)}_elseNode(R){const U=this._currNode;if(!(U instanceof _))throw new Error('CodeGen: "else" without "if"');return this._currNode=U.else=R,this}get _root(){return this._nodes[0]}get _currNode(){const R=this._nodes;return R[R.length-1]}set _currNode(R){const U=this._nodes;U[U.length-1]=R}}r.CodeGen=D;function H(O,R){for(const U in R)O[U]=(O[U]||0)+(R[U]||0);return O}function q(O,R){return R instanceof e._CodeOrName?H(O,R.names):O}function $(O,R,U){if(O instanceof e.Name)return Q(O);if(!ne(O))return O;return new e._Code(O._items.reduce((ue,he)=>(he instanceof e.Name&&(he=Q(he)),he instanceof e._Code?ue.push(...he._items):ue.push(he),ue),[]));function Q(ue){const he=U[ue.str];return he===void 0||R[ue.str]!==1?ue:(delete R[ue.str],he)}function ne(ue){return ue instanceof e._Code&&ue._items.some(he=>he instanceof e.Name&&R[he.str]===1&&U[he.str]!==void 0)}}function K(O,R){for(const U in R)O[U]=(O[U]||0)-(R[U]||0)}function z(O){return typeof O=="boolean"||typeof O=="number"||O===null?!O:(0,e._)`!${te(O)}`}r.not=z;const re=B(r.operators.AND);function W(...O){return O.reduce(re)}r.and=W;const ie=B(r.operators.OR);function k(...O){return O.reduce(ie)}r.or=k;function B(O){return(R,U)=>R===e.nil?U:U===e.nil?R:(0,e._)`${te(R)} ${O} ${te(U)}`}function te(O){return Line truncated
|| (${x} == "string" && ${w} && ${w} == +${w})`).assign(N,(0,n._)`+${w}`);return;case"integer":S.elseIf((0,n._)`${x} === "boolean" || ${w} === null
|| (${x} === "string" && ${w} && ${w} == +${w} && !(${w} % 1))`).assign(N,(0,n._)`+${w}`);return;case"boolean":S.elseIf((0,n._)`${w} === "false" || ${w} === 0 || ${w} === null`).assign(N,!1).elseIf((0,n._)`${w} === "true" || ${w} === 1`).assign(N,!0);return;case"null":S.elseIf((0,n._)`${w} === "" || ${w} === 0 || ${w} === false`),S.assign(N,null);return;case"array":S.elseIf((0,n._)`${x} === "string" || ${x} === "number"
|| ${x} === "boolean" || ${w} === null`).assign(N,(0,n._)`[${w}]`)}}}function h({gen:v,parentData:y,parentDataProperty:E},S){v.if((0,n._)`${y} !== undefined`,()=>v.assign((0,n._)`${y}[${E}]`,S))}function p(v,y,E,S=i.Correct){const w=S===i.Correct?n.operators.EQ:n.operators.NEQ;let C;switch(v){case"null":return(0,n._)`${y} ${w} null`;case"array":C=(0,n._)`Array.isArray(${y})`;break;case"object":C=(0,n._)`${y} && typeof ${y} == "object" && !Array.isArray(${y})`;break;case"integer":C=x((0,n._)`!(${y} % 1) && !isNaN(${y})`);break;case"number":C=x();break;default:return(0,n._)`typeof ${y} ${w} ${v}`}return S===i.Correct?C:(0,n.not)(C);function x(N=n.nil){return(0,n.and)((0,n._)`typeof ${y} == "number"`,N,E?(0,n._)`isFinite(${y})`:n.nil)}}Ti.checkDataType=p;function m(v,y,E,S){if(v.length===1)return p(v[0],y,E,S);let w;const C=(0,a.toHash)(v);if(C.array&&C.object){const x=(0,n._)`typeof ${y} != "object"`;w=C.null?x:(0,n._)`!${y} || ${x}`,delete C.null,delete C.array,delete C.object}else w=n.nil;C.number&&delete C.integer;for(const x in C)w=(0,n.and)(w,p(x,y,E,S));return w}Ti.checkDataTypes=m;const g={message:({schema:v})=>`must be ${v}`,params:({schema:v,schemaValue:y})=>typeof v=="string"?(0,n._)`{type: ${v}}`:(0,n._)`{type: ${y}}`};function b(v){const y=_(v);(0,t.reportError)(y,g)}Ti.reportTypeError=b;function _(v){const{gen:y,data:E,schema:S}=v,w=(0,a.schemaRefOrVal)(v,S,"type");return{gen:y,keyword:"type",data:E,schema:S.type,schemaCode:w,schemaValue:w,parentSchema:S,params:{},it:v}}return Ti}var Op={},cM;function Y0e(){if(cM)return Op;cM=1,Object.defineProperty(Op,"__esModule",{value:!0}),Op.assignDefaults=void 0;const r=pn(),e=zn();function t(a,i){const{properties:s,items:o}=a.schema;if(i==="object"&&s)for(const l in s)n(a,l,s[l].default);else i==="array"&&Array.isArray(o)&&o.forEach((l,c)=>n(a,c,l.default))}Op.assignDefaults=t;function n(a,i,s){const{gen:o,compositeRule:l,data:c,opts:u}=a;if(s===void 0)return;const d=(0,r._)`${c}${(0,r.getProperty)(i)}`;if(l){(0,e.checkStrictMode)(a,`default is ignored for: ${d}`);return}let h=(0,r._)`${d} === undefined`;u.useDefaults==="empty"&&(h=(0,r._)`${h} || ${d} === null || ${d} === ""`),o.if(h,(0,r._)`${d} = ${(0,r.stringify)(s)}`)}return Op}var qo={},jn={},uM;function ll(){if(uM)return jn;uM=1,Object.defineProperty(jn,"__esModule",{value:!0}),jn.validateUnion=jn.validateArray=jn.usePattern=jn.callValidateCode=jn.schemaProperties=jn.allSchemaProperties=jn.noPropertyInData=jn.propertyInData=jn.isOwnProperty=jn.hasPropFunc=jn.reportMissingProp=jn.checkMissingProp=jn.checkReportMissingProp=void 0;const r=pn(),e=zn(),t=Zu(),n=zn();function a(v,y){const{gen:E,data:S,it:w}=v;E.if(u(E,S,y,w.opts.ownProperties),()=>{v.setParams({missingProperty:(0,r._)`${y}`},!0),v.error()})}jn.checkReportMissingProp=a;function i({gen:v,data:y,it:{opts:E}},S,w){return(0,r.or)(...S.map(C=>(0,r.and)(u(v,y,C,E.ownProperties),(0,r._)`${w} = ${C}`)))}jn.checkMissingProp=i;function s(v,y){v.setParams({missingProperty:y},!0),v.error()}jn.reportMissingProp=s;function o(v){return v.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,r._)`Object.prototype.hasOwnProperty`})}jn.hasPropFunc=o;function l(v,y,E){return(0,r._)`${o(v)}.call(${y}, ${E})`}jn.isOwnProperty=l;function c(v,y,E,S){const w=(0,r._)`${y}${(0,r.getProperty)(E)} !== undefined`;return S?(0,r._)`${w} && ${l(v,y,E)}`:w}jn.propertyInData=c;function u(v,y,E,S){const w=(0,r._)`${y}${(0,r.getProperty)(E)} === undefined`;return S?(0,r.or)(w,(0,r.not)(l(v,y,E))):w}jn.noPropertyInData=u;function d(v){return v?Object.keys(v).filter(y=>y!=="__proto__"):[]}jn.allSchemaProperties=d;function h(v,y){return d(y).filter(E=>!(0,e.alwaysValidSchema)(v,y[E]))}jn.schemaProperties=h;function p({schemaCode:v,data:y,it:{gen:E,topSchemaRef:S,schemaPath:w,errorPath:C},it:x},N,I,D){const H=D?(0,r._)`${v}, ${y}, ${S}${w}`:y,q=[[t.default.instancePath,(0,r.strConcat)(t.default.instancePath,C)],[t.default.parentData,x.parentData],[t.default.parentDataProperty,x.parentDataProperty],[t.default.rootData,t.default.rootData]];x.opts.dynamicRef&&q.push([t.default.dynamicAnchors,t.default.dynamicAnchors]);const $=(0,r._)`${H}, ${E.object(...q)}`;return I!==r.nil?(0,r._)`${N}.call(${I}, ${$})`:(0,r._)`${N}(${$})`}jn.callValidateCode=p;const m=(0,r._)`new RegExp`;function g({gen:v,it:{opts:y}},E){const S=y.unicodeRegExp?"u":"",{regExp:w}=y.code,C=w(E,S);return v.scopeValue("pattern",{key:C.toString(),ref:C,code:(0,r._)`${w.code==="new RegExp"?m:(0,n.useFunc)(v,w)}(${E}, ${S})`})}jn.usePattern=g;function b(v){const{gen:y,data:E,keyword:S,it:w}=v,C=y.name("valid");if(w.allErrors){const N=y.let("valid",!0);return x(()=>y.assign(N,!1)),N}return y.var(C,!0),x(()=>y.break()),C;function x(N){const I=y.const("len",(0,r._)`${E}.length`);y.forRange("i",0,I,D=>{v.subschema({keyword:S,dataProp:D,dataPropType:e.Type.Num},C),y.if((0,r.not)(C),N)})}}jn.validateArray=b;function _(v){const{gen:y,schema:E,keyword:S,it:w}=v;if(!Array.isArray(E))throw new Error("ajv Line truncated
deps: ${u}}`};const a={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(l){const[c,u]=i(l);s(l,c),o(l,u)}};function i({schema:l}){const c={},u={};for(const d in l){if(d==="__proto__")continue;const h=Array.isArray(l[d])?c:u;h[d]=l[d]}return[c,u]}function s(l,c=l.schema){const{gen:u,data:d,it:h}=l;if(Object.keys(c).length===0)return;const m=u.let("missing");for(const f in c){const g=c[f];if(g.length===0)continue;const b=(0,n.propertyInData)(u,d,f,h.opts.ownProperties);l.setParams({property:f,depsCount:g.length,deps:g.join(", ")}),h.allErrors?u.if(b,()=>{for(const _ of g)(0,n.checkReportMissingProp)(l,_)}):(u.if((0,e._)`${b} && (${(0,n.checkMissingProp)(l,g,m)})`),(0,n.reportMissingProp)(l,m),u.else())}}t.validatePropertyDeps=s;function o(l,c=l.schema){const{gen:u,data:d,keyword:h,it:m}=l,f=u.name("valid");for(const g in c)(0,r.alwaysValidSchema)(m,c[g])||(u.if((0,n.propertyInData)(u,d,g,m.opts.ownProperties),()=>{const b=l.subschema({keyword:h,schemaProp:g},f);l.mergeValidEvaluated(b,f)},()=>u.var(f,!0)),l.ok(f))}t.validateSchemaDeps=o,t.default=a}(Sw)),Sw}var Y_={},FP;function C_e(){if(FP)return Y_;FP=1,Object.defineProperty(Y_,"__esModule",{value:!0});const t=Rn(),e=zn(),n={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:a})=>(0,t._)`{propertyName: ${a.propertyName}}`},code(a){const{gen:i,schema:s,data:o,it:l}=a;if((0,e.alwaysValidSchema)(l,s))return;const c=i.name("valid");i.forIn("key",o,u=>{a.setParams({propertyName:u}),a.subschema({keyword:"propertyNames",data:u,dataTypes:["string"],propertyName:u,compositeRule:!0},c),i.if((0,t.not)(c),()=>{a.error(!0),l.allErrors||i.break()})}),a.ok(c)}};return Y_.default=n,Y_}var V_={},BP;function Vq(){if(BP)return V_;BP=1,Object.defineProperty(V_,"__esModule",{value:!0});const t=hl(),e=Rn(),r=nd(),n=zn(),i={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:s})=>(0,e._)`{additionalProperty: ${s.additionalProperty}}`},code(s){const{gen:o,schema:l,parentSchema:c,data:u,errsCount:d,it:h}=s;if(!d)throw new Error("ajv implementation error");const{allErrors:m,opts:f}=h;if(h.props=!0,f.removeAdditional!=="all"&&(0,n.alwaysValidSchema)(h,l))return;const g=(0,t.allSchemaProperties)(c.properties),b=(0,t.allSchemaProperties)(c.patternProperties);_(),s.ok((0,e._)`${d} === ${r.default.errors}`);function _(){o.forIn("key",u,T=>{!g.length&&!b.length?y(T):o.if(S(T),()=>y(T))})}function S(T){let w;if(g.length>8){const A=(0,n.schemaRefOrVal)(h,c.properties,"properties");w=(0,t.isOwnProperty)(o,A,T)}else g.length?w=(0,e.or)(...g.map(A=>(0,e._)`${T} === ${A}`)):w=e.nil;return b.length&&(w=(0,e.or)(w,...b.map(A=>(0,e._)`${(0,t.usePattern)(s,A)}.test(${T})`))),(0,e.not)(w)}function E(T){o.code((0,e._)`delete ${u}[${T}]`)}function y(T){if(f.removeAdditional==="all"||f.removeAdditional&&l===!1){E(T);return}if(l===!1){s.setParams({additionalProperty:T}),s.error(),m||o.break();return}if(typeof l=="object"&&!(0,n.alwaysValidSchema)(h,l)){const w=o.name("valid");f.removeAdditional==="failing"?(v(T,w,!1),o.if((0,e.not)(w),()=>{s.reset(),E(T)})):(v(T,w),m||o.if((0,e.not)(w),()=>o.break()))}}function v(T,w,A){const I={keyword:"additionalProperties",dataProp:T,dataPropType:n.Type.Str};A===!1&&Object.assign(I,{compositeRule:!0,createErrors:!1,allErrors:!1}),s.subschema(I,w)}}};return V_.default=i,V_}var W_={},UP;function w_e(){if(UP)return W_;UP=1,Object.defineProperty(W_,"__esModule",{value:!0});const t=nE(),e=hl(),r=zn(),n=Vq(),a={keyword:"properties",type:"object",schemaType:"object",code(i){const{gen:s,schema:o,parentSchema:l,data:c,it:u}=i;u.opts.removeAdditional==="all"&&l.additionalProperties===void 0&&n.default.code(new t.KeywordCxt(u,n.default,"additionalProperties"));const d=(0,e.allSchemaProperties)(o);for(const b of d)u.definedProperties.add(b);u.opts.unevaluated&&d.length&&u.props!==!0&&(u.props=r.mergeEvaluated.props(s,(0,r.toHash)(d),u.props));const h=d.filter(b=>!(0,r.alwaysValidSchema)(u,o[b]));if(h.length===0)return;const m=s.name("valid");for(const b of h)f(b)?g(b):(s.if((0,e.propertyInData)(s,c,b,u.opts.ownProperties)),g(b),u.allErrors||s.else().var(m,!0),s.endIf()),i.it.definedProperties.add(b),i.ok(m);function f(b){return u.opts.useDefaults&&!u.compositeRule&&o[b].default!==void 0}function g(b){i.subschema({keyword:"properties",schemaProp:b,dataProp:b},m)}}};return W_.default=a,W_}var K_={},GP;function A_e(){if(GP)return K_;GP=1,Object.defineProperty(K_,"__esModule",{value:!0});const t=hl(),e=Rn(),r=zn(),n=zn(),a={keyword:"patternProperties",type:"object",schemaType:"object",code(i){const{gen:s,schema:o,data:l,parentSchema:c,it:u}=i,{opts:d}=u,h=(0,t.allSchemaProperties)(o),m=h.filter(y=>(0,r.alwaysValidSchema)(u,o[y]));if(h.length===0||m.length===h.length&&(!u.opts.unevaluated||u.props===!0))return;const f=d.strictSchema&&!d.allowMatch Line truncated
`:""},this._extScope=O,this._scope=new r.Scope({parent:O}),this._nodes=[new g]}toString(){return this._root.render(this.opts)}name(O){return this._scope.name(O)}scopeName(O){return this._extScope.name(O)}scopeValue(O,U){const X=this._extScope.value(O,U);return(this._values[X.prefix]||(this._values[X.prefix]=new Set)).add(X),X}getScopeValue(O,U){return this._extScope.getValue(O,U)}scopeRefs(O){return this._extScope.scopeRefs(O,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(O,U,X,ne){const ue=this._scope.toName(U);return X!==void 0&&ne&&(this._constants[ue.str]=X),this._leafNode(new s(O,ue,X)),ue}const(O,U,X){return this._def(r.varKinds.const,O,U,X)}let(O,U,X){return this._def(r.varKinds.let,O,U,X)}var(O,U,X){return this._def(r.varKinds.var,O,U,X)}assign(O,U,X){return this._leafNode(new o(O,U,X))}add(O,U){return this._leafNode(new l(O,t.operators.ADD,U))}code(O){return typeof O=="function"?O():O!==e.nil&&this._leafNode(new h(O)),this}object(...O){const U=["{"];for(const[X,ne]of O)U.length>1&&U.push(","),U.push(X),(X!==ne||this.opts.es5)&&(U.push(":"),(0,e.addCodeArg)(U,ne));return U.push("}"),new e._Code(U)}if(O,U,X){if(this._blockNode(new _(O)),U&&X)this.code(U).else().code(X).endIf();else if(U)this.code(U).endIf();else if(X)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(O){return this._elseNode(new _(O))}else(){return this._elseNode(new b)}endIf(){return this._endBlockNode(_,b)}_for(O,U){return this._blockNode(O),U&&this.code(U).endFor(),this}for(O,U){return this._for(new E(O),U)}forRange(O,U,X,ne,ue=this.opts.es5?r.varKinds.var:r.varKinds.let){const he=this._scope.toName(O);return this._for(new y(ue,he,U,X),()=>ne(he))}forOf(O,U,X,ne=r.varKinds.const){const ue=this._scope.toName(O);if(this.opts.es5){const he=U instanceof e.Name?U:this.var("_arr",U);return this.forRange("_i",0,(0,e._)`${he}.length`,be=>{this.var(ue,(0,e._)`${he}[${be}]`),X(ue)})}return this._for(new v("of",ne,ue,U),()=>X(ue))}forIn(O,U,X,ne=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(O,(0,e._)`Object.keys(${U})`,X);const ue=this._scope.toName(O);return this._for(new v("in",ne,ue,U),()=>X(ue))}endFor(){return this._endBlockNode(S)}label(O){return this._leafNode(new c(O))}break(O){return this._leafNode(new u(O))}return(O){const U=new w;if(this._blockNode(U),this.code(O),U.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(w)}try(O,U,X){if(!U&&!X)throw new Error('CodeGen: "try" without "catch" and "finally"');const ne=new A;if(this._blockNode(ne),this.code(O),U){const ue=this.name("e");this._currNode=ne.catch=new I(ue),U(ue)}return X&&(this._currNode=ne.finally=new x,this.code(X)),this._endBlockNode(I,x)}throw(O){return this._leafNode(new d(O))}block(O,U){return this._blockStarts.push(this._nodes.length),O&&this.code(O).endBlock(U),this}endBlock(O){const U=this._blockStarts.pop();if(U===void 0)throw new Error("CodeGen: not in self-balancing block");const X=this._nodes.length-U;if(X<0||O!==void 0&&X!==O)throw new Error(`CodeGen: wrong number of nodes: ${X} vs ${O} expected`);return this._nodes.length=U,this}func(O,U=e.nil,X,ne){return this._blockNode(new T(O,U,X)),ne&&this.code(ne).endFunc(),this}endFunc(){return this._endBlockNode(T)}optimize(O=1){for(;O-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(O){return this._currNode.nodes.push(O),this}_blockNode(O){this._currNode.nodes.push(O),this._nodes.push(O)}_endBlockNode(O,U){const X=this._currNode;if(X instanceof O||U&&X instanceof U)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${U?`${O.kind}/${U.kind}`:O.kind}"`)}_elseNode(O){const U=this._currNode;if(!(U instanceof _))throw new Error('CodeGen: "else" without "if"');return this._currNode=U.else=O,this}get _root(){return this._nodes[0]}get _currNode(){const O=this._nodes;return O[O.length-1]}set _currNode(O){const U=this._nodes;U[U.length-1]=O}}t.CodeGen=D;function $(N,O){for(const U in O)N[U]=(N[U]||0)+(O[U]||0);return N}function H(N,O){return O instanceof e._CodeOrName?$(N,O.names):N}function G(N,O,U){if(N instanceof e.Name)return X(N);if(!ne(N))return N;return new e._Code(N._items.reduce((ue,he)=>(he instanceof e.Name&&(he=X(he)),he instanceof e._Code?ue.push(...he._items):ue.push(he),ue),[]));function X(ue){const he=U[ue.str];return he===void 0||O[ue.str]!==1?ue:(delete O[ue.str],he)}function ne(ue){return ue instanceof e._Code&&ue._items.some(he=>he instanceof e.Name&&O[he.str]===1&&U[he.str]!==void 0)}}function K(N,O){for(const U in O)N[U]=(N[U]||0)-(O[U]||0)}function z(N){return typeof N=="boolean"||typeof N=="number"||N===null?!N:(0,e._)`!${J(N)}`}t.not=z;const re=B(t.operators.AND);function W(...N){return N.reduce(re)}t.and=W;const ie=B(t.operators.OR);function M(...N){return N.reduce(ie)}t.or=M;function B(N){return(O,U)=>O===e.nil?U:U===e.nil?O:(0,e._)`${J(O)} ${N} ${J(U)}`}function J(N){return N i Line truncated
|| (${A} == "string" && ${T} && ${T} == +${T})`).assign(I,(0,n._)`+${T}`);return;case"integer":v.elseIf((0,n._)`${A} === "boolean" || ${T} === null
|| (${A} === "string" && ${T} && ${T} == +${T} && !(${T} % 1))`).assign(I,(0,n._)`+${T}`);return;case"boolean":v.elseIf((0,n._)`${T} === "false" || ${T} === 0 || ${T} === null`).assign(I,!1).elseIf((0,n._)`${T} === "true" || ${T} === 1`).assign(I,!0);return;case"null":v.elseIf((0,n._)`${T} === "" || ${T} === 0 || ${T} === false`),v.assign(I,null);return;case"array":v.elseIf((0,n._)`${A} === "string" || ${A} === "number"
|| ${A} === "boolean" || ${T} === null`).assign(I,(0,n._)`[${T}]`)}}}function h({gen:S,parentData:E,parentDataProperty:y},v){S.if((0,n._)`${E} !== undefined`,()=>S.assign((0,n._)`${E}[${y}]`,v))}function m(S,E,y,v=i.Correct){const T=v===i.Correct?n.operators.EQ:n.operators.NEQ;let w;switch(S){case"null":return(0,n._)`${E} ${T} null`;case"array":w=(0,n._)`Array.isArray(${E})`;break;case"object":w=(0,n._)`${E} && typeof ${E} == "object" && !Array.isArray(${E})`;break;case"integer":w=A((0,n._)`!(${E} % 1) && !isNaN(${E})`);break;case"number":w=A();break;default:return(0,n._)`typeof ${E} ${T} ${S}`}return v===i.Correct?w:(0,n.not)(w);function A(I=n.nil){return(0,n.and)((0,n._)`typeof ${E} == "number"`,I,y?(0,n._)`isFinite(${E})`:n.nil)}}wi.checkDataType=m;function f(S,E,y,v){if(S.length===1)return m(S[0],E,y,v);let T;const w=(0,a.toHash)(S);if(w.array&&w.object){const A=(0,n._)`typeof ${E} != "object"`;T=w.null?A:(0,n._)`!${E} || ${A}`,delete w.null,delete w.array,delete w.object}else T=n.nil;w.number&&delete w.integer;for(const A in w)T=(0,n.and)(T,m(A,E,y,v));return T}wi.checkDataTypes=f;const g={message:({schema:S})=>`must be ${S}`,params:({schema:S,schemaValue:E})=>typeof S=="string"?(0,n._)`{type: ${S}}`:(0,n._)`{type: ${E}}`};function b(S){const E=_(S);(0,r.reportError)(E,g)}wi.reportTypeError=b;function _(S){const{gen:E,data:y,schema:v}=S,T=(0,a.schemaRefOrVal)(S,v,"type");return{gen:E,keyword:"type",data:y,schema:v.type,schemaCode:T,schemaValue:T,parentSchema:v,params:{},it:S}}return wi}var Im={},p6;function Z_e(){if(p6)return Im;p6=1,Object.defineProperty(Im,"__esModule",{value:!0}),Im.assignDefaults=void 0;const t=mn(),e=$n();function r(a,i){const{properties:s,items:o}=a.schema;if(i==="object"&&s)for(const l in s)n(a,l,s[l].default);else i==="array"&&Array.isArray(o)&&o.forEach((l,c)=>n(a,c,l.default))}Im.assignDefaults=r;function n(a,i,s){const{gen:o,compositeRule:l,data:c,opts:u}=a;if(s===void 0)return;const d=(0,t._)`${c}${(0,t.getProperty)(i)}`;if(l){(0,e.checkStrictMode)(a,`default is ignored for: ${d}`);return}let h=(0,t._)`${d} === undefined`;u.useDefaults==="empty"&&(h=(0,t._)`${h} || ${d} === null || ${d} === ""`),o.if(h,(0,t._)`${d} = ${(0,t.stringify)(s)}`)}return Im}var Wo={},Kn={},m6;function pl(){if(m6)return Kn;m6=1,Object.defineProperty(Kn,"__esModule",{value:!0}),Kn.validateUnion=Kn.validateArray=Kn.usePattern=Kn.callValidateCode=Kn.schemaProperties=Kn.allSchemaProperties=Kn.noPropertyInData=Kn.propertyInData=Kn.isOwnProperty=Kn.hasPropFunc=Kn.reportMissingProp=Kn.checkMissingProp=Kn.checkReportMissingProp=void 0;const t=mn(),e=$n(),r=ad(),n=$n();function a(S,E){const{gen:y,data:v,it:T}=S;y.if(u(y,v,E,T.opts.ownProperties),()=>{S.setParams({missingProperty:(0,t._)`${E}`},!0),S.error()})}Kn.checkReportMissingProp=a;function i({gen:S,data:E,it:{opts:y}},v,T){return(0,t.or)(...v.map(w=>(0,t.and)(u(S,E,w,y.ownProperties),(0,t._)`${T} = ${w}`)))}Kn.checkMissingProp=i;function s(S,E){S.setParams({missingProperty:E},!0),S.error()}Kn.reportMissingProp=s;function o(S){return S.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,t._)`Object.prototype.hasOwnProperty`})}Kn.hasPropFunc=o;function l(S,E,y){return(0,t._)`${o(S)}.call(${E}, ${y})`}Kn.isOwnProperty=l;function c(S,E,y,v){const T=(0,t._)`${E}${(0,t.getProperty)(y)} !== undefined`;return v?(0,t._)`${T} && ${l(S,E,y)}`:T}Kn.propertyInData=c;function u(S,E,y,v){const T=(0,t._)`${E}${(0,t.getProperty)(y)} === undefined`;return v?(0,t.or)(T,(0,t.not)(l(S,E,y))):T}Kn.noPropertyInData=u;function d(S){return S?Object.keys(S).filter(E=>E!=="__proto__"):[]}Kn.allSchemaProperties=d;function h(S,E){return d(E).filter(y=>!(0,e.alwaysValidSchema)(S,E[y]))}Kn.schemaProperties=h;function m({schemaCode:S,data:E,it:{gen:y,topSchemaRef:v,schemaPath:T,errorPath:w},it:A},I,x,D){const $=D?(0,t._)`${S}, ${E}, ${v}${T}`:E,H=[[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,w)],[r.default.parentData,A.parentData],[r.default.parentDataProperty,A.parentDataProperty],[r.default.rootData,r.default.rootData]];A.opts.dynamicRef&&H.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);const G=(0,t._)`${$}, ${y.object(...H)}`;return x!==t.nil?(0,t._)`${I}.call(${x}, ${G})`:(0,t._)`${I}(${G})`}Kn.callValidateCode=m;const f=(0,t._)`new RegExp`;function g({gen:S,it:{opts:E}},y){const v=E.unicodeRegExp?"u":"",{regExp:T}=E.code,w=T(y,v);return S.scopeValue("pattern",{key:w.toString(),ref:w,code:(0,t._)`${T.code==="new RegExp"?f:(0,n.useFunc)(S,T)}(${y}, ${v})`})}Kn.usePattern=g;function b(S){const{gen:E,data:y,keyword:v,it:T}=S,w=E.name("valid");if(T.allErrors){const I=E.let("valid",!0);return A(()=>E.assign(I,!1)),I}return E.var(w,!0),A(()=>E.break()),w;function A(I){const x=E.const("len",(0,t._)`${y}.length`);E.forRange("i",0,x,D=>{S.subschema({keyword:v,dataProp:D,dataPropType:e.Type.Num},w),E.if((0,t.not)(w),I)})}}Kn.validateArray=b;function _(S){const{gen:E,schema:y,keyword:v,it:T}=S;if(!Array.isArray(y))throw new Error("ajv Line truncated
missingProperty: ${d},
depsCount: ${c},
deps: ${u}}`};const a={keyword:"dependencies",type:"object",schemaType:"object",error:r.error,code(l){const[c,u]=i(l);s(l,c),o(l,u)}};function i({schema:l}){const c={},u={};for(const d in l){if(d==="__proto__")continue;const h=Array.isArray(l[d])?c:u;h[d]=l[d]}return[c,u]}function s(l,c=l.schema){const{gen:u,data:d,it:h}=l;if(Object.keys(c).length===0)return;const p=u.let("missing");for(const m in c){const g=c[m];if(g.length===0)continue;const b=(0,n.propertyInData)(u,d,m,h.opts.ownProperties);l.setParams({property:m,depsCount:g.length,deps:g.join(", ")}),h.allErrors?u.if(b,()=>{for(const _ of g)(0,n.checkReportMissingProp)(l,_)}):(u.if((0,e._)`${b} && (${(0,n.checkMissingProp)(l,g,p)})`),(0,n.reportMissingProp)(l,p),u.else())}}r.validatePropertyDeps=s;function o(l,c=l.schema){const{gen:u,data:d,keyword:h,it:p}=l,m=u.name("valid");for(const g in c)(0,t.alwaysValidSchema)(p,c[g])||(u.if((0,n.propertyInData)(u,d,g,p.opts.ownProperties),()=>{const b=l.subschema({keyword:h,schemaProp:g},m);l.mergeValidEvaluated(b,m)},()=>u.var(m,!0)),l.ok(m))}r.validateSchemaDeps=o,r.default=a}(CT)),CT}var x1={},qM;function T1e(){if(qM)return x1;qM=1,Object.defineProperty(x1,"__esModule",{value:!0});const r=pn(),e=zn(),n={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:a})=>(0,r._)`{propertyName: ${a.propertyName}}`},code(a){const{gen:i,schema:s,data:o,it:l}=a;if((0,e.alwaysValidSchema)(l,s))return;const c=i.name("valid");i.forIn("key",o,u=>{a.setParams({propertyName:u}),a.subschema({keyword:"propertyNames",data:u,dataTypes:["string"],propertyName:u,compositeRule:!0},c),i.if((0,r.not)(c),()=>{a.error(!0),l.allErrors||i.break()})}),a.ok(c)}};return x1.default=n,x1}var R1={},HM;function WG(){if(HM)return R1;HM=1,Object.defineProperty(R1,"__esModule",{value:!0});const r=ll(),e=pn(),t=Zu(),n=zn(),i={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:s})=>(0,e._)`{additionalProperty: ${s.additionalProperty}}`},code(s){const{gen:o,schema:l,parentSchema:c,data:u,errsCount:d,it:h}=s;if(!d)throw new Error("ajv implementation error");const{allErrors:p,opts:m}=h;if(h.props=!0,m.removeAdditional!=="all"&&(0,n.alwaysValidSchema)(h,l))return;const g=(0,r.allSchemaProperties)(c.properties),b=(0,r.allSchemaProperties)(c.patternProperties);_(),s.ok((0,e._)`${d} === ${t.default.errors}`);function _(){o.forIn("key",u,w=>{!g.length&&!b.length?E(w):o.if(v(w),()=>E(w))})}function v(w){let C;if(g.length>8){const x=(0,n.schemaRefOrVal)(h,c.properties,"properties");C=(0,r.isOwnProperty)(o,x,w)}else g.length?C=(0,e.or)(...g.map(x=>(0,e._)`${w} === ${x}`)):C=e.nil;return b.length&&(C=(0,e.or)(C,...b.map(x=>(0,e._)`${(0,r.usePattern)(s,x)}.test(${w})`))),(0,e.not)(C)}function y(w){o.code((0,e._)`delete ${u}[${w}]`)}function E(w){if(m.removeAdditional==="all"||m.removeAdditional&&l===!1){y(w);return}if(l===!1){s.setParams({additionalProperty:w}),s.error(),p||o.break();return}if(typeof l=="object"&&!(0,n.alwaysValidSchema)(h,l)){const C=o.name("valid");m.removeAdditional==="failing"?(S(w,C,!1),o.if((0,e.not)(C),()=>{s.reset(),y(w)})):(S(w,C),p||o.if((0,e.not)(C),()=>o.break()))}}function S(w,C,x){const N={keyword:"additionalProperties",dataProp:w,dataPropType:n.Type.Str};x===!1&&Object.assign(N,{compositeRule:!0,createErrors:!1,allErrors:!1}),s.subschema(N,C)}}};return R1.default=i,R1}var O1={},VM;function C1e(){if(VM)return O1;VM=1,Object.defineProperty(O1,"__esModule",{value:!0});const r=ay(),e=ll(),t=zn(),n=WG(),a={keyword:"properties",type:"object",schemaType:"object",code(i){const{gen:s,schema:o,parentSchema:l,data:c,it:u}=i;u.opts.removeAdditional==="all"&&l.additionalProperties===void 0&&n.default.code(new r.KeywordCxt(u,n.default,"additionalProperties"));const d=(0,e.allSchemaProperties)(o);for(const b of d)u.definedProperties.add(b);u.opts.unevaluated&&d.length&&u.props!==!0&&(u.props=t.mergeEvaluated.props(s,(0,t.toHash)(d),u.props));const h=d.filter(b=>!(0,t.alwaysValidSchema)(u,o[b]));if(h.length===0)return;const p=s.name("valid");for(const b of h)m(b)?g(b):(s.if((0,e.propertyInData)(s,c,b,u.opts.ownProperties)),g(b),u.allErrors||s.else().var(p,!0),s.endIf()),i.it.definedProperties.add(b),i.ok(p);function m(b){return u.opts.useDefaults&&!u.compositeRule&&o[b].default!==void 0}function g(b){i.subschema({keyword:"properties",schemaProp:b,dataProp:b},p)}}};return O1.default=a,O1}var N1={},YM;function A1e(){if(YM)return N1;YM=1,Object.defineProperty(N1,"__esModule",{value:!0});const r=ll(),e=pn(),t=zn(),n=zn(),a={keyword:"patternProperties",type:"object",schemaType:"object",code(i){const{gen:s,schema:o,data:l,parentSchema:c,it:u}=i,{opts:d}=u,h=(0,r.allSchemaProperties)(o),p=h.filter(E=>(0,t.alwaysValidSchema)(u,o[E]));if(h.length===0||p.length===h.length&&(!u.opts.unevaluated||u.props===!0))return;const m=d.strictSchema&&!d.allowMatch Line truncated
`;break;case"id":o=b.includes("\0")?void 0:b;break;case"retry":/^\d+$/.test(b)?n(parseInt(b,10)):t(new dD(`Invalid \`retry\` value: "${b}"`,{type:"invalid-retry",value:b,line:_}));break;default:t(new dD(`Unknown field "${g.length>20?`${g.slice(0,20)}…`:g}"`,{type:"unknown-field",field:g,value:b,line:_}));break}}function p(){l.length>0&&e({id:o,event:c||void 0,data:l.endsWith(`
`)?l.slice(0,-1):l}),o=void 0,l="",c=""}function m(g={}){i&&g.consume&&d(i),s=!0,o=void 0,l="",c="",i=""}return{feed:u,reset:m}}function $_e(r){const e=[];let t="",n=0;for(;n<r.length;){const a=r.indexOf("\r",n),i=r.indexOf(`
`,n);let s=-1;if(a!==-1&&i!==-1?s=Math.min(a,i):a!==-1?a===r.length-1?s=-1:s=a:i!==-1&&(s=i),s===-1){t=r.slice(n);break}else{const o=r.slice(n,s);e.push(o),n=s+1,r[n-1]==="\r"&&r[n]===`
`&&n++}}return[e,t]}class G_e extends TransformStream{constructor({onError:e,onRetry:t,onComment:n}={}){let a;super({start(i){a=ZG({onEvent:s=>{i.enqueue(s)},onError(s){e==="terminate"?i.error(s):typeof e=="function"&&e(s)},onRetry:t,onComment:n})},transform(i){a.feed(i)}})}}const z_e={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2};class Nd extends Error{constructor(e,t){super(`Streamable HTTP error: ${t}`),this.code=e}}class q_e{constructor(e,t){this._hasCompletedAuthFlow=!1,this._url=e,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=t?.requestInit,this._authProvider=t?.authProvider,this._fetch=t?.fetch,this._fetchWithInit=jG(t?.fetch,t?.requestInit),this._sessionId=t?.sessionId,this._reconnectionOptions=t?.reconnectionOptions??z_e}async _authThenStart(){if(!this._authProvider)throw new jo("No auth provider");let e;try{e=await Bd(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(t){throw this.onerror?.(t),t}if(e!=="AUTHORIZED")throw new jo;return await this._startOrAuthSse({resumptionToken:void 0})}async _commonHeaders(){const e={};if(this._authProvider){const n=await this._authProvider.tokens();n&&(e.Authorization=`Bearer ${n.access_token}`)}this._sessionId&&(e["mcp-session-id"]=this._sessionId),this._protocolVersion&&(e["mcp-protocol-version"]=this._protocolVersion);const t=wb(this._requestInit?.headers);return new Headers({...e,...t})}async _startOrAuthSse(e){const{resumptionToken:t}=e;try{const n=await this._commonHeaders();n.set("Accept","text/event-stream"),t&&n.set("last-event-id",t);const a=await(this._fetch??fetch)(this._url,{method:"GET",headers:n,signal:this._abortController?.signal});if(!a.ok){if(await a.body?.cancel(),a.status===401&&this._authProvider)return await this._authThenStart();if(a.status===405)return;throw new Nd(a.status,`Failed to open SSE stream: ${a.statusText}`)}this._handleSseStream(a.body,e,!0)}catch(n){throw this.onerror?.(n),n}}_getNextReconnectionDelay(e){if(this._serverRetryMs!==void 0)return this._serverRetryMs;const t=this._reconnectionOptions.initialReconnectionDelay,n=this._reconnectionOptions.reconnectionDelayGrowFactor,a=this._reconnectionOptions.maxReconnectionDelay;return Math.min(t*Math.pow(n,e),a)}_scheduleReconnection(e,t=0){const n=this._reconnectionOptions.maxRetries;if(t>=n){this.onerror?.(new Error(`Maximum reconnection attempts (${n}) exceeded.`));return}const a=this._getNextReconnectionDelay(t);this._reconnectionTimeout=setTimeout(()=>{this._startOrAuthSse(e).catch(i=>{this.onerror?.(new Error(`Failed to reconnect SSE stream: ${i instanceof Error?i.message:String(i)}`)),this._scheduleReconnection(e,t+1)})},a)}_handleSseStream(e,t,n){if(!e)return;const{onresumptiontoken:a,replayMessageId:i}=t;let s,o=!1,l=!1;(async()=>{try{const u=e.pipeThrough(new TextDecoderStream).pipeThrough(new G_e({onRetry:p=>{this._serverRetryMs=p}})).getReader();for(;;){const{value:p,done:m}=await u.read();if(m)break;if(p.id&&(s=p.id,o=!0,a?.(p.id)),!!p.data&&(!p.event||p.event==="message"))try{const g=im.parse(JSON.parse(p.data));Wp(g)&&(l=!0,i!==void 0&&(g.id=i)),this.onmessage?.(g)}catch(g){this.onerror?.(g)}}(n||o)&&!l&&this._abortController&&!this._abortController.signal.aborted&&this._scheduleReconnection({resumptionToken:s,onresumptiontoken:a,replayMessageId:i},0)}catch(u){if(this.onerror?.(new Error(`SSE stream disconnected: ${u}`)),(n||o)&&!l&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:s,onresumptiontoken:a,replayMessageId:i},0)}catch(p){this.onerror?.(new Error(`Failed to reconnect: ${p instanceof Error?p.message:String(p)}`))}}})()}async start(){if(this._abortController)throw new Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.");this._abortController=new AbortController}async finishAuth(e){if(!this._authProvider)throw new jo("No auth provider");if(await Bd(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new jo("Failed to authorize")}async close(){this._reconnectionTimeout&&(clearTimeout(this._reconnectionTimeout),this._reconnectionTimeout=void 0),this._abortController?.abort(),this.onclose?.()}async send(e,t){try{const{resumptionToken:n,onresumptiontoken:a}=t||{};if(n){this._startOrAuthSse({resumptionToken:n,replayMessageId:T3(e)?e.id:void 0}).catch(h=>this.onerror?.(h));return}const i=await this._commonHeaders();i.set("content-type","application/json"),i.set("accept","application/json, text/event-stream");const s={...this._requestInit,method:"POST",headers:i,body:JSON.stringify(e),signal:this._abortController?.signal},o=await(this._fetch??fetch)(this._url,s),l=o.headers.get("mcp-session-id");if(l&&(this._sessionId=l),!o.ok){const h=await o.t Line truncated
`):""}static formatSingleContent(e){if(e.type===v_.TEXT&&e.text)return e.text;if(e.type===v_.IMAGE&&e.data)return hb(e.mimeType??One,e.data);if(e.type===v_.RESOURCE&&e.resource){const t=e.resource;return t.text?t.text:t.blob?t.blob:JSON.stringify(t)}return e.data&&e.mimeType?hb(e.mimeType,e.data):JSON.stringify(e)}static async complete(e,t,n){try{return(await e.client.complete({ref:t,argument:n})).completion}catch(a){return console.error("[MCPService] Failed to get completions:",a),null}}static async listResources(e,t){try{const n=await e.client.listResources(t?{cursor:t}:void 0);return{resources:n.resources??[],nextCursor:n.nextCursor}}catch(n){if(this.isSessionExpiredError(n))throw n;return console.warn(`[MCPService][${e.serverName}] Failed to list resources:`,n),{resources:[]}}}static async listAllResources(e){const t=[];let n;do{const a=await this.listResources(e,n);t.push(...a.resources),n=a.nextCursor}while(n);return t}static async listResourceTemplates(e,t){try{const n=await e.client.listResourceTemplates(t?{cursor:t}:void 0);return{resourceTemplates:n.resourceTemplates??[],nextCursor:n.nextCursor}}catch(n){if(this.isSessionExpiredError(n))throw n;return console.warn(`[MCPService][${e.serverName}] Failed to list resource templates:`,n),{resourceTemplates:[]}}}static async listAllResourceTemplates(e){const t=[];let n;do{const a=await this.listResourceTemplates(e,n);t.push(...a.resourceTemplates),n=a.nextCursor}while(n);return t}static async readResource(e,t){try{const n=await e.client.readResource({uri:t});return{contents:n.contents??[],_meta:n._meta}}catch(n){throw console.error(`[MCPService][${e.serverName}] Failed to read resource:`,n),n}}static async subscribeResource(e,t){try{await e.client.subscribeResource({uri:t}),console.log(`[MCPService][${e.serverName}] Subscribed to resource: ${t}`)}catch(n){throw console.error(`[MCPService][${e.serverName}] Failed to subscribe to resource:`,n),n}}static async unsubscribeResource(e,t){try{await e.client.unsubscribeResource({uri:t}),console.log(`[MCPService][${e.serverName}] Unsubscribed from resource: ${t}`)}catch(n){throw console.error(`[MCPService][${e.serverName}] Failed to unsubscribe from resource:`,n),n}}static supportsResources(e){return e.serverCapabilities?.resources!==void 0}static supportsResourceSubscriptions(e){return!!e.serverCapabilities?.resources?.subscribe}}function X_e(){return`${Wne}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`}class Q_e{#e=_e(Sr(new Oi));get _serverResources(){return f(this.#e)}set _serverResources(e){M(this.#e,e,!0)}#t=_e(Sr(new Oi));get _cachedResources(){return f(this.#t)}set _cachedResources(e){M(this.#t,e,!0)}#r=_e(Sr(new Oi));get _subscriptions(){return f(this.#r)}set _subscriptions(e){M(this.#r,e,!0)}#n=_e(Sr([]));get _attachments(){return f(this.#n)}set _attachments(e){M(this.#n,e,!0)}#i=_e(!1);get _isLoading(){return f(this.#i)}set _isLoading(e){M(this.#i,e,!0)}get serverResources(){return this._serverResources}get cachedResources(){return this._cachedResources}get subscriptions(){return this._subscriptions}get attachments(){return this._attachments}get isLoading(){return this._isLoading}get totalResourceCount(){let e=0;for(const t of this._serverResources.values())e+=t.resources.length;return e}get totalTemplateCount(){let e=0;for(const t of this._serverResources.values())e+=t.templates.length;return e}get attachmentCount(){return this._attachments.length}get hasAttachments(){return this._attachments.length>0}setServerResources(e,t,n){this._serverResources.set(e,{serverName:e,resources:t,templates:n,lastFetched:new Date,loading:!1,error:void 0}),console.log(`[MCPResources][${e}] Set ${t.length} resources, ${n.length} templates`)}setServerLoading(e,t){const n=this._serverResources.get(e);n?this._serverResources.set(e,{...n,loading:t}):this._serverResources.set(e,{serverName:e,resources:[],templates:[],loading:t,error:void 0})}setServerError(e,t){const n=this._serverResources.get(e);n?this._serverResources.set(e,{...n,loading:!1,error:t}):this._serverResources.set(e,{serverName:e,resources:[],templates:[],loading:!1,error:t})}getServerResources(e){return this._serverResources.get(e)}getAllResourceInfos(){const e=[];for(const[t,n]of this._serverResources)for(const a of n.resources)e.push({uri:a.uri,name:a.name,title:a.title,description:a.description,mimeType:a.mimeType,serverName:t,annotations:a.annotations,icons:a.icons});return e}getAllTemplateInfos(){const e=[];for(const[t,n]of this._serverResources)for(const a of n.templates)e.push({uriTemplate:a.uriTemplate,name:a.name,title:a.title,description:a.description,mimeType:a.mimeType,serverName:t,annotations:a.annotations,icons:a.icons});return e}clearServerResources(e){this._serverResources.delete(e);for(const[t,n]of this._cachedResources)n.resource.serverName===e&&this._cachedResources.delete(t);for(const[t,n]of this._subscriptions)n.serverName===e&&this._subscriptions.delete(t);console.log(`[MCPResources][${e}] Cleared all resources`)}cacheReso Line truncated
deps: ${u}}`};const a={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(l){const[c,u]=i(l);s(l,c),o(l,u)}};function i({schema:l}){const c={},u={};for(const d in l){if(d==="__proto__")continue;const h=Array.isArray(l[d])?c:u;h[d]=l[d]}return[c,u]}function s(l,c=l.schema){const{gen:u,data:d,it:h}=l;if(Object.keys(c).length===0)return;const m=u.let("missing");for(const f in c){const g=c[f];if(g.length===0)continue;const b=(0,n.propertyInData)(u,d,f,h.opts.ownProperties);l.setParams({property:f,depsCount:g.length,deps:g.join(", ")}),h.allErrors?u.if(b,()=>{for(const _ of g)(0,n.checkReportMissingProp)(l,_)}):(u.if((0,e._)`${b} && (${(0,n.checkMissingProp)(l,g,m)})`),(0,n.reportMissingProp)(l,m),u.else())}}t.validatePropertyDeps=s;function o(l,c=l.schema){const{gen:u,data:d,keyword:h,it:m}=l,f=u.name("valid");for(const g in c)(0,r.alwaysValidSchema)(m,c[g])||(u.if((0,n.propertyInData)(u,d,g,m.opts.ownProperties),()=>{const b=l.subschema({keyword:h,schemaProp:g},f);l.mergeValidEvaluated(b,f)},()=>u.var(f,!0)),l.ok(f))}t.validateSchemaDeps=o,t.default=a}(Ow)),Ow}var I0={},W6;function I0e(){if(W6)return I0;W6=1,Object.defineProperty(I0,"__esModule",{value:!0});const t=mn(),e=$n(),n={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:a})=>(0,t._)`{propertyName: ${a.propertyName}}`},code(a){const{gen:i,schema:s,data:o,it:l}=a;if((0,e.alwaysValidSchema)(l,s))return;const c=i.name("valid");i.forIn("key",o,u=>{a.setParams({propertyName:u}),a.subschema({keyword:"propertyNames",data:u,dataTypes:["string"],propertyName:u,compositeRule:!0},c),i.if((0,t.not)(c),()=>{a.error(!0),l.allErrors||i.break()})}),a.ok(c)}};return I0.default=n,I0}var x0={},K6;function Xq(){if(K6)return x0;K6=1,Object.defineProperty(x0,"__esModule",{value:!0});const t=pl(),e=mn(),r=ad(),n=$n(),i={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:s})=>(0,e._)`{additionalProperty: ${s.additionalProperty}}`},code(s){const{gen:o,schema:l,parentSchema:c,data:u,errsCount:d,it:h}=s;if(!d)throw new Error("ajv implementation error");const{allErrors:m,opts:f}=h;if(h.props=!0,f.removeAdditional!=="all"&&(0,n.alwaysValidSchema)(h,l))return;const g=(0,t.allSchemaProperties)(c.properties),b=(0,t.allSchemaProperties)(c.patternProperties);_(),s.ok((0,e._)`${d} === ${r.default.errors}`);function _(){o.forIn("key",u,T=>{!g.length&&!b.length?y(T):o.if(S(T),()=>y(T))})}function S(T){let w;if(g.length>8){const A=(0,n.schemaRefOrVal)(h,c.properties,"properties");w=(0,t.isOwnProperty)(o,A,T)}else g.length?w=(0,e.or)(...g.map(A=>(0,e._)`${T} === ${A}`)):w=e.nil;return b.length&&(w=(0,e.or)(w,...b.map(A=>(0,e._)`${(0,t.usePattern)(s,A)}.test(${T})`))),(0,e.not)(w)}function E(T){o.code((0,e._)`delete ${u}[${T}]`)}function y(T){if(f.removeAdditional==="all"||f.removeAdditional&&l===!1){E(T);return}if(l===!1){s.setParams({additionalProperty:T}),s.error(),m||o.break();return}if(typeof l=="object"&&!(0,n.alwaysValidSchema)(h,l)){const w=o.name("valid");f.removeAdditional==="failing"?(v(T,w,!1),o.if((0,e.not)(w),()=>{s.reset(),E(T)})):(v(T,w),m||o.if((0,e.not)(w),()=>o.break()))}}function v(T,w,A){const I={keyword:"additionalProperties",dataProp:T,dataPropType:n.Type.Str};A===!1&&Object.assign(I,{compositeRule:!0,createErrors:!1,allErrors:!1}),s.subschema(I,w)}}};return x0.default=i,x0}var D0={},j6;function x0e(){if(j6)return D0;j6=1,Object.defineProperty(D0,"__esModule",{value:!0});const t=oE(),e=pl(),r=$n(),n=Xq(),a={keyword:"properties",type:"object",schemaType:"object",code(i){const{gen:s,schema:o,parentSchema:l,data:c,it:u}=i;u.opts.removeAdditional==="all"&&l.additionalProperties===void 0&&n.default.code(new t.KeywordCxt(u,n.default,"additionalProperties"));const d=(0,e.allSchemaProperties)(o);for(const b of d)u.definedProperties.add(b);u.opts.unevaluated&&d.length&&u.props!==!0&&(u.props=r.mergeEvaluated.props(s,(0,r.toHash)(d),u.props));const h=d.filter(b=>!(0,r.alwaysValidSchema)(u,o[b]));if(h.length===0)return;const m=s.name("valid");for(const b of h)f(b)?g(b):(s.if((0,e.propertyInData)(s,c,b,u.opts.ownProperties)),g(b),u.allErrors||s.else().var(m,!0),s.endIf()),i.it.definedProperties.add(b),i.ok(m);function f(b){return u.opts.useDefaults&&!u.compositeRule&&o[b].default!==void 0}function g(b){i.subschema({keyword:"properties",schemaProp:b,dataProp:b},m)}}};return D0.default=a,D0}var M0={},Q6;function D0e(){if(Q6)return M0;Q6=1,Object.defineProperty(M0,"__esModule",{value:!0});const t=pl(),e=mn(),r=$n(),n=$n(),a={keyword:"patternProperties",type:"object",schemaType:"object",code(i){const{gen:s,schema:o,data:l,parentSchema:c,it:u}=i,{opts:d}=u,h=(0,t.allSchemaProperties)(o),m=h.filter(y=>(0,r.alwaysValidSchema)(u,o[y]));if(h.length===0||m.length===h.length&&(!u.opts.unevaluated||u.props===!0))return;const f=d.strictSchema&&!d.allowMatch Line truncated
`;break;case"id":o=b.includes("\0")?void 0:b;break;case"retry":/^\d+$/.test(b)?n(parseInt(b,10)):r(new f7(`Invalid \`retry\` value: "${b}"`,{type:"invalid-retry",value:b,line:_}));break;default:r(new f7(`Unknown field "${g.length>20?`${g.slice(0,20)}…`:g}"`,{type:"unknown-field",field:g,value:b,line:_}));break}}function m(){l.length>0&&e({id:o,event:c||void 0,data:l.endsWith(`
`)?l.slice(0,-1):l}),o=void 0,l="",c=""}function f(g={}){i&&g.consume&&d(i),s=!0,o=void 0,l="",c="",i=""}return{feed:u,reset:f}}function V1e(t){const e=[];let r="",n=0;for(;n<t.length;){const a=t.indexOf("\r",n),i=t.indexOf(`
`,n);let s=-1;if(a!==-1&&i!==-1?s=Math.min(a,i):a!==-1?a===t.length-1?s=-1:s=a:i!==-1&&(s=i),s===-1){r=t.slice(n);break}else{const o=t.slice(n,s);e.push(o),n=s+1,t[n-1]==="\r"&&t[n]===`
`&&n++}}return[e,r]}class W1e extends TransformStream{constructor({onError:e,onRetry:r,onComment:n}={}){let a;super({start(i){a=rz({onEvent:s=>{i.enqueue(s)},onError(s){e==="terminate"?i.error(s):typeof e=="function"&&e(s)},onRetry:r,onComment:n})},transform(i){a.feed(i)}})}}const K1e={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2};class Fd extends Error{constructor(e,r){super(`Streamable HTTP error: ${r}`),this.code=e}}class j1e{constructor(e,r){this._hasCompletedAuthFlow=!1,this._url=e,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=r?.requestInit,this._authProvider=r?.authProvider,this._fetch=r?.fetch,this._fetchWithInit=Zq(r?.fetch,r?.requestInit),this._sessionId=r?.sessionId,this._reconnectionOptions=r?.reconnectionOptions??K1e}async _authThenStart(){if(!this._authProvider)throw new Jo("No auth provider");let e;try{e=await Yd(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(r){throw this.onerror?.(r),r}if(e!=="AUTHORIZED")throw new Jo;return await this._startOrAuthSse({resumptionToken:void 0})}async _commonHeaders(){const e={};if(this._authProvider){const n=await this._authProvider.tokens();n&&(e.Authorization=`Bearer ${n.access_token}`)}this._sessionId&&(e["mcp-session-id"]=this._sessionId),this._protocolVersion&&(e["mcp-protocol-version"]=this._protocolVersion);const r=Ab(this._requestInit?.headers);return new Headers({...e,...r})}async _startOrAuthSse(e){const{resumptionToken:r}=e;try{const n=await this._commonHeaders();n.set("Accept","text/event-stream"),r&&n.set("last-event-id",r);const a=await(this._fetch??fetch)(this._url,{method:"GET",headers:n,signal:this._abortController?.signal});if(!a.ok){if(await a.body?.cancel(),a.status===401&&this._authProvider)return await this._authThenStart();if(a.status===405)return;throw new Fd(a.status,`Failed to open SSE stream: ${a.statusText}`)}this._handleSseStream(a.body,e,!0)}catch(n){throw this.onerror?.(n),n}}_getNextReconnectionDelay(e){if(this._serverRetryMs!==void 0)return this._serverRetryMs;const r=this._reconnectionOptions.initialReconnectionDelay,n=this._reconnectionOptions.reconnectionDelayGrowFactor,a=this._reconnectionOptions.maxReconnectionDelay;return Math.min(r*Math.pow(n,e),a)}_scheduleReconnection(e,r=0){const n=this._reconnectionOptions.maxRetries;if(r>=n){this.onerror?.(new Error(`Maximum reconnection attempts (${n}) exceeded.`));return}const a=this._getNextReconnectionDelay(r);this._reconnectionTimeout=setTimeout(()=>{this._startOrAuthSse(e).catch(i=>{this.onerror?.(new Error(`Failed to reconnect SSE stream: ${i instanceof Error?i.message:String(i)}`)),this._scheduleReconnection(e,r+1)})},a)}_handleSseStream(e,r,n){if(!e)return;const{onresumptiontoken:a,replayMessageId:i}=r;let s,o=!1,l=!1;(async()=>{try{const u=e.pipeThrough(new TextDecoderStream).pipeThrough(new W1e({onRetry:m=>{this._serverRetryMs=m}})).getReader();for(;;){const{value:m,done:f}=await u.read();if(f)break;if(m.id&&(s=m.id,o=!0,a?.(m.id)),!!m.data&&(!m.event||m.event==="message"))try{const g=lf.parse(JSON.parse(m.data));jm(g)&&(l=!0,i!==void 0&&(g.id=i)),this.onmessage?.(g)}catch(g){this.onerror?.(g)}}(n||o)&&!l&&this._abortController&&!this._abortController.signal.aborted&&this._scheduleReconnection({resumptionToken:s,onresumptiontoken:a,replayMessageId:i},0)}catch(u){if(this.onerror?.(new Error(`SSE stream disconnected: ${u}`)),(n||o)&&!l&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:s,onresumptiontoken:a,replayMessageId:i},0)}catch(m){this.onerror?.(new Error(`Failed to reconnect: ${m instanceof Error?m.message:String(m)}`))}}})()}async start(){if(this._abortController)throw new Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.");this._abortController=new AbortController}async finishAuth(e){if(!this._authProvider)throw new Jo("No auth provider");if(await Yd(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new Jo("Failed to authorize")}async close(){this._reconnectionTimeout&&(clearTimeout(this._reconnectionTimeout),this._reconnectionTimeout=void 0),this._abortController?.abort(),this.onclose?.()}async send(e,r){try{const{resumptionToken:n,onresumptiontoken:a}=r||{};if(n){this._startOrAuthSse({resumptionToken:n,replayMessageId:OR(e)?e.id:void 0}).catch(h=>this.onerror?.(h));return}const i=await this._commonHeaders();i.set("content-type","application/json"),i.set("accept","application/json, text/event-stream");const s={...this._requestInit,method:"POST",headers:i,body:JSON.stringify(e),signal:this._abortController?.signal},o=await(this._fetch??fetch)(this._url,s),l=o.headers.get("mcp-session-id");if(l&&(this._sessionId=l),!o.ok){const h=await o.t Line truncated
`):""}static formatSingleContent(e){if(e.type===y1.TEXT&&e.text)return e.text;if(e.type===y1.IMAGE&&e.data)return fb(e.mimeType??Pne,e.data);if(e.type===y1.RESOURCE&&e.resource){const r=e.resource;return r.text?r.text:r.blob?r.blob:JSON.stringify(r)}return e.data&&e.mimeType?fb(e.mimeType,e.data):JSON.stringify(e)}static async complete(e,r,n){try{return(await e.client.complete({ref:r,argument:n})).completion}catch(a){return console.error("[MCPService] Failed to get completions:",a),null}}static async listResources(e,r){try{const n=await e.client.listResources(r?{cursor:r}:void 0);return{resources:n.resources??[],nextCursor:n.nextCursor}}catch(n){if(this.isSessionExpiredError(n))throw n;return console.warn(`[MCPService][${e.serverName}] Failed to list resources:`,n),{resources:[]}}}static async listAllResources(e){const r=[];let n;do{const a=await this.listResources(e,n);r.push(...a.resources),n=a.nextCursor}while(n);return r}static async listResourceTemplates(e,r){try{const n=await e.client.listResourceTemplates(r?{cursor:r}:void 0);return{resourceTemplates:n.resourceTemplates??[],nextCursor:n.nextCursor}}catch(n){if(this.isSessionExpiredError(n))throw n;return console.warn(`[MCPService][${e.serverName}] Failed to list resource templates:`,n),{resourceTemplates:[]}}}static async listAllResourceTemplates(e){const r=[];let n;do{const a=await this.listResourceTemplates(e,n);r.push(...a.resourceTemplates),n=a.nextCursor}while(n);return r}static async readResource(e,r){try{const n=await e.client.readResource({uri:r});return{contents:n.contents??[],_meta:n._meta}}catch(n){throw console.error(`[MCPService][${e.serverName}] Failed to read resource:`,n),n}}static async subscribeResource(e,r){try{await e.client.subscribeResource({uri:r}),console.log(`[MCPService][${e.serverName}] Subscribed to resource: ${r}`)}catch(n){throw console.error(`[MCPService][${e.serverName}] Failed to subscribe to resource:`,n),n}}static async unsubscribeResource(e,r){try{await e.client.unsubscribeResource({uri:r}),console.log(`[MCPService][${e.serverName}] Unsubscribed from resource: ${r}`)}catch(n){throw console.error(`[MCPService][${e.serverName}] Failed to unsubscribe from resource:`,n),n}}static supportsResources(e){return e.serverCapabilities?.resources!==void 0}static supportsResourceSubscriptions(e){return!!e.serverCapabilities?.resources?.subscribe}}function rbe(){return`${Jne}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`}class nbe{#e=_e(Tr(new Ii));get _serverResources(){return p(this.#e)}set _serverResources(e){k(this.#e,e,!0)}#t=_e(Tr(new Ii));get _cachedResources(){return p(this.#t)}set _cachedResources(e){k(this.#t,e,!0)}#r=_e(Tr(new Ii));get _subscriptions(){return p(this.#r)}set _subscriptions(e){k(this.#r,e,!0)}#n=_e(Tr([]));get _attachments(){return p(this.#n)}set _attachments(e){k(this.#n,e,!0)}#i=_e(!1);get _isLoading(){return p(this.#i)}set _isLoading(e){k(this.#i,e,!0)}get serverResources(){return this._serverResources}get cachedResources(){return this._cachedResources}get subscriptions(){return this._subscriptions}get attachments(){return this._attachments}get isLoading(){return this._isLoading}get totalResourceCount(){let e=0;for(const r of this._serverResources.values())e+=r.resources.length;return e}get totalTemplateCount(){let e=0;for(const r of this._serverResources.values())e+=r.templates.length;return e}get attachmentCount(){return this._attachments.length}get hasAttachments(){return this._attachments.length>0}setServerResources(e,r,n){this._serverResources.set(e,{serverName:e,resources:r,templates:n,lastFetched:new Date,loading:!1,error:void 0}),console.log(`[MCPResources][${e}] Set ${r.length} resources, ${n.length} templates`)}setServerLoading(e,r){const n=this._serverResources.get(e);n?this._serverResources.set(e,{...n,loading:r}):this._serverResources.set(e,{serverName:e,resources:[],templates:[],loading:r,error:void 0})}setServerError(e,r){const n=this._serverResources.get(e);n?this._serverResources.set(e,{...n,loading:!1,error:r}):this._serverResources.set(e,{serverName:e,resources:[],templates:[],loading:!1,error:r})}getServerResources(e){return this._serverResources.get(e)}getAllResourceInfos(){const e=[];for(const[r,n]of this._serverResources)for(const a of n.resources)e.push({uri:a.uri,name:a.name,title:a.title,description:a.description,mimeType:a.mimeType,serverName:r,annotations:a.annotations,icons:a.icons});return e}getAllTemplateInfos(){const e=[];for(const[r,n]of this._serverResources)for(const a of n.templates)e.push({uriTemplate:a.uriTemplate,name:a.name,title:a.title,description:a.description,mimeType:a.mimeType,serverName:r,annotations:a.annotations,icons:a.icons});return e}clearServerResources(e){this._serverResources.delete(e);for(const[r,n]of this._cachedResources)n.resource.serverName===e&&this._cachedResources.delete(r);for(const[r,n]of this._subscriptions)n.serverName===e&&this._subscriptions.delete(r);console.log(`[MCPResources][${e}] Cleared all resources`)}cacheReso Line truncated
--- Resource: ${n} (from ${a}) ---
${i.text}`):"blob"in i&&i.blob&&e.push(`
--- Resource: ${n} (from ${a}) ---
[${_O}: ${i.mimeType||gO}]`)}return e.join("")}toMessageExtras(){const e=[];for(const t of this._attachments){if(t.error||!t.content||t.content.length===0)continue;const n=t.resource.title||t.resource.name,a=[];for(const i of t.content)"text"in i&&i.text?a.push(i.text):"blob"in i&&i.blob&&a.push(`[${_O}: ${i.mimeType||gO}]`);a.length>0&&e.push({type:Kr.MCP_RESOURCE,name:n,uri:t.resource.uri,serverName:t.resource.serverName,content:a.join(ob),mimeType:t.resource.mimeType})}return e}}const _n=new Q_e,ez=()=>_n.serverResources,Z_e=()=>_n.attachments,tz=()=>_n.hasAttachments,J_e=()=>_n.totalResourceCount,ebe=()=>_n.isLoading,rz=typeof window<"u"?window:void 0;function tbe(r){let e=r.activeElement;for(;e?.shadowRoot;){const t=e.shadowRoot.activeElement;if(t===e)break;e=t}return e}let rbe=class{#e;#t;constructor(e={}){const{window:t=rz,document:n=t?.document}=e;t!==void 0&&(this.#e=n,this.#t=Wu(a=>{const i=jr(t,"focusin",a),s=jr(t,"focusout",a);return()=>{i(),s()}}))}get current(){return this.#t?.(),this.#e?tbe(this.#e):null}};new rbe;function nbe(r,e){switch(r){case"post":Nt(e);break;case"pre":Gi(e);break}}function nz(r,e,t,n={}){const{lazy:a=!1}=n;let i=!a,s=Array.isArray(r)?[]:void 0;nbe(e,()=>{const o=Array.isArray(r)?r.map(c=>c()):r();if(!i){i=!0,s=o;return}const l=Rn(()=>t(o,s));return s=o,l})}function dx(r,e,t){nz(r,"post",e,t)}function abe(r,e,t){nz(r,"pre",e,t)}dx.pre=abe;function ibe(r,e){switch(r){case"local":return e.localStorage;case"session":return e.sessionStorage}}class az{#e;#t;#r;#n;#i;#a=_e(0);constructor(e,t,n={}){const{storage:a="local",serializer:i={serialize:JSON.stringify,deserialize:JSON.parse},syncTabs:s=!0,window:o=rz}=n;if(this.#e=t,this.#t=e,this.#r=i,o===void 0)return;const l=ibe(a,o);this.#n=l;const c=l.getItem(e);c!==null?this.#e=this.#o(c):this.#l(t),s&&a==="local"&&(this.#i=Wu(()=>jr(o,"storage",this.#s)))}get current(){this.#i?.(),f(this.#a);const e=this.#o(this.#n?.getItem(this.#t))??this.#e,t=new WeakMap,n=a=>{if(a===null||a?.constructor.name==="Date"||typeof a!="object")return a;let i=t.get(a);return i||(i=new Proxy(a,{get:(s,o)=>(f(this.#a),n(Reflect.get(s,o))),set:(s,o,l)=>(M(this.#a,f(this.#a)+1),Reflect.set(s,o,l),this.#l(e),!0)}),t.set(a,i)),i};return n(e)}set current(e){this.#l(e),M(this.#a,f(this.#a)+1)}#s=e=>{e.key!==this.#t||e.newValue===null||(this.#e=this.#o(e.newValue),M(this.#a,f(this.#a)+1))};#o(e){try{return this.#r.deserialize(e)}catch(t){console.error(`Error when parsing "${e}" from persisted store "${this.#t}"`,t);return}}#l(e){try{e!=null&&this.#n?.setItem(this.#t,this.#r.serialize(e))}catch(t){console.error(`Error when writing value from persisted store "${this.#t}" to ${this.#n}`,t)}}}function mD(r){return r.filter(e=>e.length>0)}const iz={getItem:r=>null,setItem:(r,e)=>{}},yg=typeof document<"u";function sbe(r){return typeof r=="function"}function obe(r){return r!==null&&typeof r=="object"}const Mm=Symbol("box"),hx=Symbol("is-writable");function lbe(r){return obe(r)&&Mm in r}function cbe(r){return Za.isBox(r)&&hx in r}function Za(r){let e=_e(Sr(r));return{[Mm]:!0,[hx]:!0,get current(){return f(e)},set current(t){M(e,t,!0)}}}function ube(r,e){const t=F(r);return e?{[Mm]:!0,[hx]:!0,get current(){return f(t)},set current(n){e(n)}}:{[Mm]:!0,get current(){return r()}}}function dbe(r){return Za.isBox(r)?r:sbe(r)?Za.with(r):Za(r)}function hbe(r){return Object.entries(r).reduce((e,[t,n])=>Za.isBox(n)?(Za.isWritableBox(n)?Object.defineProperty(e,t,{get(){return n.current},set(a){n.current=a}}):Object.defineProperty(e,t,{get(){return n.current}}),e):Object.assign(e,{[t]:n}),{})}function fbe(r){return Za.isWritableBox(r)?{[Mm]:!0,get current(){return r.current}}:r}Za.from=dbe;Za.with=ube;Za.flatten=hbe;Za.readonly=fbe;Za.isBox=lbe;Za.isWritableBox=cbe;function pbe(r,e){const t=RegExp(r,"g");return n=>{if(typeof n!="string")throw new TypeError(`expected an argument of type string, but got ${typeof n}`);return n.match(t)?n.replace(t,e):n}}const mbe=pbe(/[A-Z]/,r=>`-${r.toLowerCase()}`);function gbe(r){if(!r||typeof r!="object"||Array.isArray(r))throw new TypeError(`expected an argument of type object, but got ${typeof r}`);return Object.keys(r).map(e=>`${mbe(e)}: ${r[e]};`).join(`
`)}function _be(r={}){return gbe(r).replace(`
`," ")}const bbe={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",transform:"translateX(-100%)"};_be(bbe);const vbe=typeof window<"u"?window:void 0;function ybe(r){let e=r.activeElement;for(;e?.shadowRoot;){const t=e.shadowRoot.activeElement;if(t===e)break;e=t}return e}class Sbe{#e;#t;constructor(e={}){const{window:t=vbe,document:n=t?.document}=e;t!==void 0&&(this.#e=n,this.#t=Wu(a=>{const i=jr(t,"focusin",a),s=jr(t,"focusout",a);return()=>{i(),s()}}))}get current(){return this.#t?.(),this.#e?ybe(this.#e):null}}new Sbe;const Ud=Za("mode-watcher-mode"),$d=Za("mode-watcher-theme"),Ebe=["dark","light","system"];function V3(r){return typeof r!="string"?!1:Ebe.includes(r)}class wbe{#e="system";#t=yg?localStorage:iz;#r=this.#t.getItem(Ud.current);#n=V3(this.#r)?this.#r:this.#e;#i=_e(Sr(this.#a()));#a(e=this.#n){return new az(Ud.current,e,{serializer:{serialize:t=>t,deserialize:t=>V3(t)?t:this.#e}})}constructor(){jm(()=>dx.pre(()=>Ud.current,(e,t)=>{const n=f(this.#i).current;M(this.#i,this.#a(n),!0),t&&localStorage.removeItem(t)}))}get current(){return f(this.#i).current}set current(e){f(this.#i).current=e}}class Tbe{#e=void 0;#t=!0;#r=_e(Sr(this.#e));#n=typeof window<"u"&&typeof window.matchMedia=="function"?new MB("prefers-color-scheme: light"):{current:!1};query(){yg&&M(this.#r,this.#n.current?"light":"dark",!0)}tracking(e){this.#t=e}constructor(){jm(()=>{Gi(()=>{this.#t&&this.query()})}),this.query=this.query.bind(this),this.tracking=this.tracking.bind(this)}get current(){return f(this.#r)}}const Y3=new wbe,W3=new Tbe;class Cbe{#e=yg?localStorage:iz;#t=this.#e.getItem($d.current);#r=this.#t===null||this.#t===void 0?"":this.#t;#n=_e(Sr(this.#i()));#i(e=this.#r){return new az($d.current,e,{serializer:{serialize:t=>typeof t!="string"?"":t,deserialize:t=>t}})}constructor(){jm(()=>dx.pre(()=>$d.current,(e,t)=>{const n=f(this.#n).current;M(this.#n,this.#i(n),!0),t&&localStorage.removeItem(t)}))}get current(){return f(this.#n).current}set current(e){f(this.#n).current=e}}const C_=new Cbe;let gD,_D,bD=!1,Ip=null;function Abe(){return Ip||(Ip=document.createElement("style"),Ip.appendChild(document.createTextNode(`* {
[${v5}: ${i.mimeType||E5}]`)}return e.join("")}toMessageExtras(){const e=[];for(const r of this._attachments){if(r.error||!r.content||r.content.length===0)continue;const n=r.resource.title||r.resource.name,a=[];for(const i of r.content)"text"in i&&i.text?a.push(i.text):"blob"in i&&i.blob&&a.push(`[${v5}: ${i.mimeType||E5}]`);a.length>0&&e.push({type:Qr.MCP_RESOURCE,name:n,uri:r.resource.uri,serverName:r.resource.serverName,content:a.join(ub),mimeType:r.resource.mimeType})}return e}}const bn=new nbe,az=()=>bn.serverResources,abe=()=>bn.attachments,iz=()=>bn.hasAttachments,ibe=()=>bn.totalResourceCount,sbe=()=>bn.isLoading,sz=typeof window<"u"?window:void 0;function obe(t){let e=t.activeElement;for(;e?.shadowRoot;){const r=e.shadowRoot.activeElement;if(r===e)break;e=r}return e}let lbe=class{#e;#t;constructor(e={}){const{window:r=sz,document:n=r?.document}=e;r!==void 0&&(this.#e=n,this.#t=Ju(a=>{const i=Kr(r,"focusin",a),s=Kr(r,"focusout",a);return()=>{i(),s()}}))}get current(){return this.#t?.(),this.#e?obe(this.#e):null}};new lbe;function cbe(t,e){switch(t){case"post":It(e);break;case"pre":$i(e);break}}function oz(t,e,r,n={}){const{lazy:a=!1}=n;let i=!a,s=Array.isArray(t)?[]:void 0;cbe(e,()=>{const o=Array.isArray(t)?t.map(c=>c()):t();if(!i){i=!0,s=o;return}const l=Nn(()=>r(o,s));return s=o,l})}function fx(t,e,r){oz(t,"post",e,r)}function ube(t,e,r){oz(t,"pre",e,r)}fx.pre=ube;function dbe(t,e){switch(t){case"local":return e.localStorage;case"session":return e.sessionStorage}}class lz{#e;#t;#r;#n;#i;#a=_e(0);constructor(e,r,n={}){const{storage:a="local",serializer:i={serialize:JSON.stringify,deserialize:JSON.parse},syncTabs:s=!0,window:o=sz}=n;if(this.#e=r,this.#t=e,this.#r=i,o===void 0)return;const l=dbe(a,o);this.#n=l;const c=l.getItem(e);c!==null?this.#e=this.#o(c):this.#l(r),s&&a==="local"&&(this.#i=Ju(()=>Kr(o,"storage",this.#s)))}get current(){this.#i?.(),p(this.#a);const e=this.#o(this.#n?.getItem(this.#t))??this.#e,r=new WeakMap,n=a=>{if(a===null||a?.constructor.name==="Date"||typeof a!="object")return a;let i=r.get(a);return i||(i=new Proxy(a,{get:(s,o)=>(p(this.#a),n(Reflect.get(s,o))),set:(s,o,l)=>(k(this.#a,p(this.#a)+1),Reflect.set(s,o,l),this.#l(e),!0)}),r.set(a,i)),i};return n(e)}set current(e){this.#l(e),k(this.#a,p(this.#a)+1)}#s=e=>{e.key!==this.#t||e.newValue===null||(this.#e=this.#o(e.newValue),k(this.#a,p(this.#a)+1))};#o(e){try{return this.#r.deserialize(e)}catch(r){console.error(`Error when parsing "${e}" from persisted store "${this.#t}"`,r);return}}#l(e){try{e!=null&&this.#n?.setItem(this.#t,this.#r.serialize(e))}catch(r){console.error(`Error when writing value from persisted store "${this.#t}" to ${this.#n}`,r)}}}function S7(t){return t.filter(e=>e.length>0)}const cz={getItem:t=>null,setItem:(t,e)=>{}},Tg=typeof document<"u";function hbe(t){return typeof t=="function"}function pbe(t){return t!==null&&typeof t=="object"}const Lf=Symbol("box"),gx=Symbol("is-writable");function mbe(t){return pbe(t)&&Lf in t}function fbe(t){return Ja.isBox(t)&&gx in t}function Ja(t){let e=_e(Tr(t));return{[Lf]:!0,[gx]:!0,get current(){return p(e)},set current(r){k(e,r,!0)}}}function gbe(t,e){const r=F(t);return e?{[Lf]:!0,[gx]:!0,get current(){return p(r)},set current(n){e(n)}}:{[Lf]:!0,get current(){return t()}}}function _be(t){return Ja.isBox(t)?t:hbe(t)?Ja.with(t):Ja(t)}function bbe(t){return Object.entries(t).reduce((e,[r,n])=>Ja.isBox(n)?(Ja.isWritableBox(n)?Object.defineProperty(e,r,{get(){return n.current},set(a){n.current=a}}):Object.defineProperty(e,r,{get(){return n.current}}),e):Object.assign(e,{[r]:n}),{})}function Sbe(t){return Ja.isWritableBox(t)?{[Lf]:!0,get current(){return t.current}}:t}Ja.from=_be;Ja.with=gbe;Ja.flatten=bbe;Ja.readonly=Sbe;Ja.isBox=mbe;Ja.isWritableBox=fbe;function Ebe(t,e){const r=RegExp(t,"g");return n=>{if(typeof n!="string")throw new TypeError(`expected an argument of type string, but got ${typeof n}`);return n.match(r)?n.replace(r,e):n}}const vbe=Ebe(/[A-Z]/,t=>`-${t.toLowerCase()}`);function ybe(t){if(!t||typeof t!="object"||Array.isArray(t))throw new TypeError(`expected an argument of type object, but got ${typeof t}`);return Object.keys(t).map(e=>`${vbe(e)}: ${t[e]};`).join(`
`)}function Tbe(t={}){return ybe(t).replace(`
`," ")}const Cbe={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",transform:"translateX(-100%)"};Tbe(Cbe);const wbe=typeof window<"u"?window:void 0;function Abe(t){let e=t.activeElement;for(;e?.shadowRoot;){const r=e.shadowRoot.activeElement;if(r===e)break;e=r}return e}class Rbe{#e;#t;constructor(e={}){const{window:r=wbe,document:n=r?.document}=e;r!==void 0&&(this.#e=n,this.#t=Ju(a=>{const i=Kr(r,"focusin",a),s=Kr(r,"focusout",a);return()=>{i(),s()}}))}get current(){return this.#t?.(),this.#e?Abe(this.#e):null}}new Rbe;const Vd=Ja("mode-watcher-mode"),Wd=Ja("mode-watcher-theme"),Obe=["dark","light","system"];function jR(t){return typeof t!="string"?!1:Obe.includes(t)}class Nbe{#e="system";#t=Tg?localStorage:cz;#r=this.#t.getItem(Vd.current);#n=jR(this.#r)?this.#r:this.#e;#i=_e(Tr(this.#a()));#a(e=this.#n){return new lz(Vd.current,e,{serializer:{serialize:r=>r,deserialize:r=>jR(r)?r:this.#e}})}constructor(){Xf(()=>fx.pre(()=>Vd.current,(e,r)=>{const n=p(this.#i).current;k(this.#i,this.#a(n),!0),r&&localStorage.removeItem(r)}))}get current(){return p(this.#i).current}set current(e){p(this.#i).current=e}}class Ibe{#e=void 0;#t=!0;#r=_e(Tr(this.#e));#n=typeof window<"u"&&typeof window.matchMedia=="function"?new FB("prefers-color-scheme: light"):{current:!1};query(){Tg&&k(this.#r,this.#n.current?"light":"dark",!0)}tracking(e){this.#t=e}constructor(){Xf(()=>{$i(()=>{this.#t&&this.query()})}),this.query=this.query.bind(this),this.tracking=this.tracking.bind(this)}get current(){return p(this.#r)}}const QR=new Nbe,XR=new Ibe;class xbe{#e=Tg?localStorage:cz;#t=this.#e.getItem(Wd.current);#r=this.#t===null||this.#t===void 0?"":this.#t;#n=_e(Tr(this.#i()));#i(e=this.#r){return new lz(Wd.current,e,{serializer:{serialize:r=>typeof r!="string"?"":r,deserialize:r=>r}})}constructor(){Xf(()=>fx.pre(()=>Wd.current,(e,r)=>{const n=p(this.#n).current;k(this.#n,this.#i(n),!0),r&&localStorage.removeItem(r)}))}get current(){return p(this.#n).current}set current(e){p(this.#n).current=e}}const O1=new xbe;let E7,v7,y7=!1,Dm=null;function Dbe(){return Dm||(Dm=document.createElement("style"),Dm.appendChild(document.createTextNode(`* {
-webkit-transition: none !important;
-moz-transition: none !important;
-o-transition: none !important;
-ms-transition: none !important;
transition: none !important;
}`)),Ip)}function sz(r,e=!1){if(typeof document>"u")return;if(!bD){bD=!0,r();return}if(typeof window<"u"&&window.__vitest_worker__){r();return}clearTimeout(gD),clearTimeout(_D);const n=Abe(),a=()=>document.head.appendChild(n),i=()=>{n.parentNode&&document.head.removeChild(n)};function s(){r(),window.requestAnimationFrame(i)}if(typeof window.requestAnimationFrame<"u"){a(),e?s():window.requestAnimationFrame(()=>{s()});return}a(),gD=window.setTimeout(()=>{r(),_D=window.setTimeout(i,16)},16)}const wu=Za(void 0),Nb=Za(!0),Ib=Za(!1),j3=Za([]),K3=Za([]);function xbe(){const r=F(()=>{if(!yg)return;const e=Y3.current==="system"?W3.current:Y3.current,t=mD(j3.current),n=mD(K3.current);function a(){const i=document.documentElement,s=document.querySelector('meta[name="theme-color"]');e==="light"?(t.length&&i.classList.remove(...t),n.length&&i.classList.add(...n),i.style.colorScheme="light",s&&wu.current&&s.setAttribute("content",wu.current.light)):(n.length&&i.classList.remove(...n),t.length&&i.classList.add(...t),i.style.colorScheme="dark",s&&wu.current&&s.setAttribute("content",wu.current.dark))}return Nb.current?sz(a,Ib.current):a(),e});return{get current(){return f(r)}}}function Rbe(){const r=F(()=>{if(C_.current,!yg)return;function e(){document.documentElement.setAttribute("data-theme",C_.current)}return Nb.current?sz(e,Rn(()=>Ib.current)):e(),C_.current});return{get current(){return f(r)}}}const sy=xbe(),Obe=Rbe();function X3(r){Y3.current=r}function Nbe(r){C_.current=r}function Ibe({defaultMode:r="system",themeColors:e,darkClassNames:t=["dark"],lightClassNames:n=[],defaultTheme:a="",modeStorageKey:i="mode-watcher-mode",themeStorageKey:s="mode-watcher-theme"}){const o=document.documentElement,l=localStorage.getItem(i)??r,c=localStorage.getItem(s)??a,u=l==="light"||l==="system"&&window.matchMedia("(prefers-color-scheme: light)").matches;if(u?(t.length&&o.classList.remove(...t.filter(Boolean)),n.length&&o.classList.add(...n.filter(Boolean))):(n.length&&o.classList.remove(...n.filter(Boolean)),t.length&&o.classList.add(...t.filter(Boolean))),o.style.colorScheme=u?"light":"dark",e){const d=document.querySelector('meta[name="theme-color"]');d&&d.setAttribute("content",l==="light"?e.light:e.dark)}c&&(o.setAttribute("data-theme",c),localStorage.setItem(s,c)),localStorage.setItem(i,l)}var kbe=G('<meta name="theme-color"/>');function Mbe(r,e){Ee(e,!0);var t=se(),n=L(t);{var a=i=>{var s=kbe();Ce(()=>er(s,"content",e.themeColors.dark)),T(i,s)};le(n,i=>{e.themeColors&&i(a)})}T(r,t),we()}var Dbe=G('<meta name="theme-color"/>'),Pbe=G("<!> <!>",1);function Lbe(r,e){Ee(e,!0);let t=Y(e,"trueNonce",3,"");lv("1funsus",n=>{var a=Pbe(),i=L(a);{var s=l=>{var c=Dbe();Ce(()=>er(c,"content",e.themeColors.dark)),T(l,c)};le(i,l=>{e.themeColors&&l(s)})}var o=ee(i,2);nf(o,()=>`<script${t()?` nonce=${t()}`:""}>(`+Ibe.toString()+")("+JSON.stringify(e.initConfig)+");<\/script>"),T(n,a)}),we()}function Fbe(r,e){Ee(e,!0);let t=Y(e,"track",3,!0),n=Y(e,"defaultMode",3,"system"),a=Y(e,"disableTransitions",3,!0),i=Y(e,"darkClassNames",19,()=>["dark"]),s=Y(e,"lightClassNames",19,()=>[]),o=Y(e,"defaultTheme",3,""),l=Y(e,"nonce",3,""),c=Y(e,"themeStorageKey",3,"mode-watcher-theme"),u=Y(e,"modeStorageKey",3,"mode-watcher-mode"),d=Y(e,"disableHeadScriptInjection",3,!1),h=Y(e,"synchronousModeChanges",3,!1);Ud.current=u(),$d.current=c(),j3.current=i(),K3.current=s(),Nb.current=a(),wu.current=e.themeColors,Ib.current=h(),Gi(()=>{Ib.current=h()}),Gi(()=>{Nb.current=a()}),Gi(()=>{wu.current=e.themeColors}),Gi(()=>{j3.current=i()}),Gi(()=>{K3.current=s()}),Gi(()=>{Ud.current=u()}),Gi(()=>{$d.current=c()}),Gi(()=>{sy.current,Ud.current,$d.current,Obe.current}),bi(()=>{W3.tracking(t()),W3.query();const y=localStorage.getItem(Ud.current);X3(V3(y)?y:n());const E=localStorage.getItem($d.current);Nbe(E||o())});const p={defaultMode:n(),themeColors:e.themeColors,darkClassNames:i(),lightClassNames:s(),defaultTheme:o(),modeStorageKey:u(),themeStorageKey:c()},m=F(()=>typeof window>"u"?l():"");var g=se(),b=L(g);{var _=y=>{Mbe(y,{get themeColors(){return wu.current}})},v=y=>{Lbe(y,{get trueNonce(){return f(m)},get initConfig(){return p},get themeColors(){return wu.current}})};le(b,y=>{d()?y(_):y(v,!1)})}T(r,g),we()}class Bbe{#e=_e(!1);get _isInitializing(){return f(this.#e)}set _isInitializing(e){M(this.#e,e,!0)}#t=_e(null);get _error(){return f(this.#t)}set _error(e){M(this.#t,e,!0)}#r=_e(0);get _toolCount(){return f(this.#r)}set _toolCount(e){M(this.#r,e,!0)}#n=_e(Sr([]));get _connectedServers(){return f(this.#n)}set _connectedServers(e){M(this.#n,e,!0)}#i=_e(Sr({}));get _healthChecks(){return f(this.#i)}set _healthChecks(e){M(this.#i,e,!0)}#a=_e(!1);get _proxyAvailable(){return f(this.#a)}set _proxyAvailable(e){M(this.#a,e,!0)}connections=new Map;toolsIndex=new Map;serverConfigs=new Map;reconnectingServers=new Set;configSignature=null;initPromise=null;activeFlowCount=0;constructor(){this.probeProxy()}async probeProxy(){try{const e=await fetch(`${Ga}${qU}`,{method:"HEAD" Line truncated
`);return e.join("")}}function Xp(r,e){const t=e?URL.parse(r,e):URL.parse(r);return t?.protocol==="http:"||t?.protocol==="https:"}function ko(r){r.preventDefault()}function Ka(r){r.preventDefault(),r.stopPropagation()}function fve(r){console.log("Deprecated API usage: "+r)}class nA{static#e;static toDateObject(e){if(e instanceof Date)return e;if(!e||typeof e!="string")return null;this.#e||=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?");const t=this.#e.exec(e);if(!t)return null;const n=parseInt(t[1],10);let a=parseInt(t[2],10);a=a>=1&&a<=12?a-1:0;let i=parseInt(t[3],10);i=i>=1&&i<=31?i:1;let s=parseInt(t[4],10);s=s>=0&&s<=23?s:0;let o=parseInt(t[5],10);o=o>=0&&o<=59?o:0;let l=parseInt(t[6],10);l=l>=0&&l<=59?l:0;const c=t[7]||"Z";let u=parseInt(t[8],10);u=u>=0&&u<=23?u:0;let d=parseInt(t[9],10)||0;return d=d>=0&&d<=59?d:0,c==="-"?(s+=u,o+=d):c==="+"&&(s-=u,o-=d),new Date(Date.UTC(n,a,i,s,o,l))}}function pve(r,{scale:e=1,rotation:t=0}){const{width:n,height:a}=r.attributes.style,i=[0,0,parseInt(n),parseInt(a)];return new wg({viewBox:i,userUnit:1,scale:e,rotation:t})}function dy(r){if(r.startsWith("#")){const e=parseInt(r.slice(1),16);return[(e&16711680)>>16,(e&65280)>>8,e&255]}return r.startsWith("rgb(")?r.slice(4,-1).split(",").map(e=>parseInt(e)):r.startsWith("rgba(")?r.slice(5,-1).split(",").map(e=>parseInt(e)).slice(0,3):(Jr(`Not a valid color format: "${r}"`),[0,0,0])}function mve(r){const e=document.createElement("span");e.style.visibility="hidden",e.style.colorScheme="only light",document.body.append(e);for(const t of r.keys()){e.style.color=t;const n=window.getComputedStyle(e).color;r.set(t,dy(n))}e.remove()}function wa(r){const{a:e,b:t,c:n,d:a,e:i,f:s}=r.getTransform();return[e,t,n,a,i,s]}function _l(r){const{a:e,b:t,c:n,d:a,e:i,f:s}=r.getTransform().invertSelf();return[e,t,n,a,i,s]}function Zd(r,e,t=!1,n=!0){if(e instanceof wg){const{pageWidth:a,pageHeight:i}=e.rawDims,{style:s}=r,o=Mi.isCSSRoundSupported,l=`var(--total-scale-factor) * ${a}px`,c=`var(--total-scale-factor) * ${i}px`,u=o?`round(down, ${l}, var(--scale-round-x))`:`calc(${l})`,d=o?`round(down, ${c}, var(--scale-round-y))`:`calc(${c})`;!t||e.rotation%180===0?(s.width=u,s.height=d):(s.width=d,s.height=u)}n&&r.setAttribute("data-main-rotation",e.rotation)}class zl{constructor(){const{pixelRatio:e}=zl;this.sx=e,this.sy=e}get scaled(){return this.sx!==1||this.sy!==1}get symmetric(){return this.sx===this.sy}limitCanvas(e,t,n,a,i=-1){let s=1/0,o=1/0,l=1/0;n=zl.capPixels(n,i),n>0&&(s=Math.sqrt(n/(e*t))),a!==-1&&(o=a/e,l=a/t);const c=Math.min(s,o,l);return this.sx>c||this.sy>c?(this.sx=c,this.sy=c,!0):!1}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(e,t){if(t>=0){const n=Math.ceil(window.screen.availWidth*window.screen.availHeight*this.pixelRatio**2*(1+t/100));return e>0?Math.min(e,n):n}return e}}const aA=["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/x-icon"];class lm{#e=null;#t=null;#r;#n=null;#i=null;#a=null;#s=null;static#o=null;constructor(e){this.#r=e,lm.#o||=Object.freeze({freetext:"pdfjs-editor-remove-freetext-button",highlight:"pdfjs-editor-remove-highlight-button",ink:"pdfjs-editor-remove-ink-button",stamp:"pdfjs-editor-remove-stamp-button",signature:"pdfjs-editor-remove-signature-button"})}render(){const e=this.#e=document.createElement("div");e.classList.add("editToolbar","hidden"),e.setAttribute("role","toolbar");const t=this.#r._uiManager._signal;e.addEventListener("contextmenu",ko,{signal:t}),e.addEventListener("pointerdown",lm.#l,{signal:t});const n=this.#n=document.createElement("div");n.className="buttons",e.append(n);const a=this.#r.toolbarPosition;if(a){const{style:i}=e,s=this.#r._uiManager.direction==="ltr"?1-a[0]:a[0];i.insetInlineEnd=`${100*s}%`,i.top=`calc(${100*a[1]}% + var(--editor-toolbar-vert-offset))`}return e}get div(){return this.#e}static#l(e){e.stopPropagation()}#c(e){this.#r._focusEventsAllowed=!1,Ka(e)}#d(e){this.#r._focusEventsAllowed=!0,Ka(e)}#u(e){const t=this.#r._uiManager._signal;e.addEventListener("focusin",this.#c.bind(this),{capture:!0,signal:t}),e.addEventListener("focusout",this.#d.bind(this),{capture:!0,signal:t}),e.addEventListener("contextmenu",ko,{signal:t})}hide(){this.#e.classList.add("hidden"),this.#t?.hideDropdown()}show(){this.#e.classList.remove("hidden"),this.#i?.shown(),this.#a?.shown()}addDeleteButton(){const{editorType:e,_uiManager:t}=this.#r,n=document.createElement("button");n.className="delete",n.tabIndex=0,n.setAttribute("data-l10n-id",lm.#o[e]),this.#u(n),n.addEventListener("click",a=>{t.delete()},{signal:t._signal}),this.#n.append(n)}get#p(){const e=document.createElement("div");return e.className="divider",e}async addAltText(e){const t=await e.render();this.#u(t),this.#n.append(t,this.#p),this.#i=e}addComment(e){if(this.#a)return;const t=e.render();t&&(this.#u(t),this.#n.prepend(t,this.#p),this.#a=e,e.toolbar=this)}addColorPicker( Line truncated
`)||null;o&&this.data.comb&&(o=o.replaceAll(/\s+/g,""));const l={userValue:i,formattedValue:o,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(n=document.createElement("textarea"),n.textContent=o??i,this.data.doNotScroll&&(n.style.overflowY="hidden")):(n=document.createElement("input"),n.type=this.data.password?"password":"text",n.setAttribute("value",o??i),this.data.doNotScroll&&(n.style.overflowX="hidden")),this.data.hasOwnCanvas&&(n.hidden=!0),Jd.add(n),n.setAttribute("data-element-id",t),n.disabled=this.data.readOnly,n.name=this.data.fieldName,n.tabIndex=0;const{datetimeFormat:c,datetimeType:u,timeStep:d}=this.data,h=!!u&&this.enableScripting;c&&(n.title=c),this._setRequired(n,this.data.required),s&&(n.maxLength=s),n.addEventListener("input",m=>{e.setValue(t,{value:m.target.value}),this.setPropertyOnSiblings(n,"value",m.target.value,"value"),l.formattedValue=null}),n.addEventListener("resetform",m=>{const g=this.data.defaultFieldValue??"";n.value=l.userValue=g,l.formattedValue=null});let p=m=>{const{formattedValue:g}=l;g!=null&&(m.target.value=g),m.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){n.addEventListener("focus",g=>{if(l.focused)return;const{target:b}=g;if(h&&(b.type=u,d&&(b.step=d)),l.userValue){const _=l.userValue;if(h)if(u==="time"){const v=new Date(_),y=[v.getHours(),v.getMinutes(),v.getSeconds()];b.value=y.map(E=>E.toString().padStart(2,"0")).join(":")}else b.value=new Date(_-Eye).toISOString().split(u==="date"?"T":".",1)[0];else b.value=_}l.lastCommittedValue=b.value,l.commitKey=1,this.data.actions?.Focus||(l.focused=!0)}),n.addEventListener("updatefromsandbox",g=>{this.showElementAndHideCanvas(g.target);const b={value(_){l.userValue=_.detail.value??"",h||e.setValue(t,{value:l.userValue.toString()}),_.target.value=l.userValue},formattedValue(_){const{formattedValue:v}=_.detail;l.formattedValue=v,v!=null&&_.target!==document.activeElement&&(_.target.value=v);const y={formattedValue:v};h&&(y.value=v),e.setValue(t,y)},selRange(_){_.target.setSelectionRange(..._.detail.selRange)},charLimit:_=>{const{charLimit:v}=_.detail,{target:y}=_;if(v===0){y.removeAttribute("maxLength");return}y.setAttribute("maxLength",v);let E=l.userValue;!E||E.length<=v||(E=E.slice(0,v),y.value=l.userValue=E,e.setValue(t,{value:E}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:E,willCommit:!0,commitKey:1,selStart:y.selectionStart,selEnd:y.selectionEnd}}))}};this._dispatchEventFromSandbox(b,g)}),n.addEventListener("keydown",g=>{l.commitKey=1;let b=-1;if(g.key==="Escape"?b=0:g.key==="Enter"&&!this.data.multiLine?b=2:g.key==="Tab"&&(l.commitKey=3),b===-1)return;const{value:_}=g.target;l.lastCommittedValue!==_&&(l.lastCommittedValue=_,l.userValue=_,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:_,willCommit:!0,commitKey:b,selStart:g.target.selectionStart,selEnd:g.target.selectionEnd}}))});const m=p;p=null,n.addEventListener("blur",g=>{if(!l.focused||!g.relatedTarget)return;this.data.actions?.Blur||(l.focused=!1);const{target:b}=g;let{value:_}=b;if(h){if(_&&u==="time"){const v=_.split(":").map(y=>parseInt(y,10));_=new Date(2e3,0,1,v[0],v[1],v[2]||0).valueOf(),b.step=""}else _=new Date(_).valueOf();b.type="text"}l.userValue=_,l.lastCommittedValue!==_&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:_,willCommit:!0,commitKey:l.commitKey,selStart:g.target.selectionStart,selEnd:g.target.selectionEnd}}),m(g)}),this.data.actions?.Keystroke&&n.addEventListener("beforeinput",g=>{l.lastCommittedValue=null;const{data:b,target:_}=g,{value:v,selectionStart:y,selectionEnd:E}=_;let S=y,w=E;switch(g.inputType){case"deleteWordBackward":{const C=v.substring(0,y).match(/\w*[^\w]*$/);C&&(S-=C[0].length);break}case"deleteWordForward":{const C=v.substring(y).match(/^[^\w]*\w*/);C&&(w+=C[0].length);break}case"deleteContentBackward":y===E&&(S-=1);break;case"deleteContentForward":y===E&&(w+=1);break}g.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:v,change:b||"",willCommit:!1,selStart:S,selEnd:w}})}),this._setEventListeners(n,l,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],g=>g.target.value)}if(p&&n.addEventListener("blur",p),this.data.comb){const g=(this.data.rect[2]-this.data.rect[0])/s;n.classList.add("comb"),n.style.letterSpacing=`calc(${g}px * var(--total-scale-factor) - 1ch)`}}else n=document.createElement("div"),n.textContent=this.data.fieldValue,n.style.verticalAlign="middle",n.style.display="table-cell",this.data.hasOwnCanvas&&(n.hidden=!0);return this._setTextStyle(n),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class Cye extends uh{constructor(e){super(e,{isRenderable:!!e.data.has Line truncated
`))t.push({name:"span",value:i,attributes:a});return n}_formatContents({str:e,dir:t}){const n=document.createElement("p");n.classList.add("popupContent"),n.dir=t;const a=e.split(/(?:\r\n?|\n)/);for(let i=0,s=a.length;i<s;++i){const o=a[i];n.append(document.createTextNode(o)),i<s-1&&n.append(document.createElement("br"))}return n}#N(e){e.altKey||e.shiftKey||e.ctrlKey||e.metaKey||(e.key==="Enter"||e.key==="Escape"&&this.#u)&&this.#R()}updateEdited({rect:e,popup:t,deleted:n}){if(n||t?.deleted){this.remove();return}this.#S(),this.#_||={contentsObj:this.#s,richText:this.#g},e&&(this.#f=null),t&&(this.#g=this.#C(t.text),this.#o=nA.toDateObject(t.date),this.#s=null),this.#p?.remove(),this.#p=null}resetEdited(){this.#_&&({contentsObj:this.#s,richText:this.#g}=this.#_,this.#_=null,this.#p?.remove(),this.#p=null,this.#f=null)}remove(){this.#m?.abort(),this.#m=null,this.#p?.remove(),this.#p=null,this.#y=!1,this.#u=!1;for(const e of this.trigger)e.classList.remove("popupTriggerArea")}#O(){if(this.#f!==null)return;const{page:{view:e},viewport:{rawDims:{pageWidth:t,pageHeight:n,pageX:a,pageY:i}}}=this.#c;let s=!!this.#d,o=s?this.#d:this.#h;for(const m of this.#l)if(!o||Dr.intersect(m.data.rect,o)!==null){o=m.data.rect,s=!0;break}const l=Dr.normalizeRect([o[0],e[3]-o[1]+e[1],o[2],e[3]-o[3]+e[1]]),u=s?o[2]-o[0]+5:0,d=l[0]+u,h=l[1];this.#f=[100*(d-a)/t,100*(h-i)/n];const{style:p}=this.#a;p.left=`${this.#f[0]}%`,p.top=`${this.#f[1]}%`}#R(){this.#u=!this.#u,this.#u?(this.#x(),this.#a.addEventListener("click",this.#n),this.#a.addEventListener("keydown",this.#e)):(this.#k(),this.#a.removeEventListener("click",this.#n),this.#a.removeEventListener("keydown",this.#e))}#x(){this.#p||this.render(),this.isVisible?this.#u&&this.#a.classList.add("focused"):(this.#O(),this.#a.hidden=!1,this.#a.style.zIndex=parseInt(this.#a.style.zIndex)+1e3)}#k(){this.#a.classList.remove("focused"),!(this.#u||!this.isVisible)&&(this.#a.hidden=!0,this.#a.style.zIndex=parseInt(this.#a.style.zIndex)-1e3)}forceHide(){this.#y=this.isVisible,this.#y&&(this.#a.hidden=!0)}maybeShow(){this.#S(),this.#y&&(this.#p||this.#x(),this.#y=!1,this.#a.hidden=!1)}get isVisible(){return this.#a.hidden===!1}}class Mz extends za{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.textContent=e.data.textContent,this.textPosition=e.data.textPosition,this.annotationEditorType=Zr.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const e=document.createElement("div");e.classList.add("annotationTextContent"),e.setAttribute("role","comment");for(const t of this.textContent){const n=document.createElement("span");n.textContent=t,e.append(n)}this.container.append(e)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}class Nye extends za{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("lineAnnotation");const{data:e,width:t,height:n}=this,a=this.svgFactory.create(t,n,!0),i=this.#e=this.svgFactory.createElement("svg:line");return i.setAttribute("x1",e.rect[2]-e.lineCoordinates[0]),i.setAttribute("y1",e.rect[3]-e.lineCoordinates[1]),i.setAttribute("x2",e.rect[2]-e.lineCoordinates[2]),i.setAttribute("y2",e.rect[3]-e.lineCoordinates[3]),i.setAttribute("stroke-width",e.borderStyle.width||1),i.setAttribute("stroke","transparent"),i.setAttribute("fill","transparent"),a.append(i),this.container.append(a),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}}class Iye extends za{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("squareAnnotation");const{data:e,width:t,height:n}=this,a=this.svgFactory.create(t,n,!0),i=e.borderStyle.width,s=this.#e=this.svgFactory.createElement("svg:rect");return s.setAttribute("x",i/2),s.setAttribute("y",i/2),s.setAttribute("width",t-i),s.setAttribute("height",n-i),s.setAttribute("stroke-width",i||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),a.append(s),this.container.append(a),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}}class kye extends za{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("circleAnnotation");const{data:e,width:t,height:n}=this,a=this.svgFactory.create(t,n,!0),i=e.borderStyle.width,s=this.#e=this.svgFactory.createElement("svg:ellipse");return s.setAttribute("cx",t/2),s.setAttribute("cy",n/2),s.setAttribute("rx",t/2-i/2),s.setAttribute("ry",n/2-i/2),s.setAttribute("stroke-width",i||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),a.append(s),this.container.append(a),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return Line truncated
`)}#l(){const[e,t]=this.parentDimensions;let n;if(this.isAttachedToDOM)n=this.div.getBoundingClientRect();else{const{currentLayer:a,div:i}=this,s=i.style.display,o=i.classList.contains("hidden");i.classList.remove("hidden"),i.style.display="hidden",a.div.append(this.div),n=i.getBoundingClientRect(),i.remove(),i.style.display=s,i.classList.toggle("hidden",o)}this.rotation%180===this.parentRotation%180?(this.width=n.width/e,this.height=n.height/t):(this.width=n.height/e,this.height=n.width/t),this.fixAndSetPosition()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const e=this.#t,t=this.#t=this.#o().trimEnd();if(e===t)return;const n=a=>{if(this.#t=a,!a){this.remove();return}this.#d(),this._uiManager.rebuild(this),this.#l()};this.addCommands({cmd:()=>{n(t)},undo:()=>{n(e)},mustExec:!1}),this.#l()}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}keydown(e){e.target===this.div&&e.key==="Enter"&&(this.enterInEditMode(),e.preventDefault())}editorDivKeydown(e){ni._keyboardManager.exec(this,e)}editorDivFocus(e){this.isEditing=!0}editorDivBlur(e){this.isEditing=!1}editorDivInput(e){this.parent.div.classList.toggle("freetextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}get canChangeContent(){return!0}render(){if(this.div)return this.div;let e,t;(this._isCopy||this.annotationElementId)&&(e=this.x,t=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",this.#r),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text2"),this.editorDiv.setAttribute("data-l10n-attrs","default-content"),this.enableEditing(),this.editorDiv.contentEditable=!0;const{style:n}=this.editorDiv;if(n.fontSize=`calc(${this.#i}px * var(--total-scale-factor))`,n.color=this.#e,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),this._isCopy||this.annotationElementId){const[a,i]=this.parentDimensions;if(this.annotationElementId){const{position:s}=this._initialData;let[o,l]=this.getInitialTranslation();[o,l]=this.pageTranslationToScreen(o,l);const[c,u]=this.pageDimensions,[d,h]=this.pageTranslation;let p,m;switch(this.rotation){case 0:p=e+(s[0]-d)/c,m=t+this.height-(s[1]-h)/u;break;case 90:p=e+(s[0]-d)/c,m=t-(s[1]-h)/u,[o,l]=[l,-o];break;case 180:p=e-this.width+(s[0]-d)/c,m=t-(s[1]-h)/u,[o,l]=[-o,-l];break;case 270:p=e+(s[0]-d-this.height*u)/c,m=t+(s[1]-h-this.width*c)/u,[o,l]=[-l,o];break}this.setAt(p*a,m*i,o,l)}else this._moveAfterPaste(e,t);this.#d(),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}static#c(e){return(e.nodeType===Node.TEXT_NODE?e.nodeValue:e.innerText).replaceAll(Y1,"")}editorDivPaste(e){const t=e.clipboardData||window.clipboardData,{types:n}=t;if(n.length===1&&n[0]==="text/plain")return;e.preventDefault();const a=ni.#p(t.getData("text")||"").replaceAll(Y1,`
}`)),Dm)}function uz(t,e=!1){if(typeof document>"u")return;if(!y7){y7=!0,t();return}if(typeof window<"u"&&window.__vitest_worker__){t();return}clearTimeout(E7),clearTimeout(v7);const n=Dbe(),a=()=>document.head.appendChild(n),i=()=>{n.parentNode&&document.head.removeChild(n)};function s(){t(),window.requestAnimationFrame(i)}if(typeof window.requestAnimationFrame<"u"){a(),e?s():window.requestAnimationFrame(()=>{s()});return}a(),E7=window.setTimeout(()=>{t(),v7=window.setTimeout(i,16)},16)}const Nu=Ja(void 0),Mb=Ja(!0),kb=Ja(!1),ZR=Ja([]),JR=Ja([]);function Mbe(){const t=F(()=>{if(!Tg)return;const e=QR.current==="system"?XR.current:QR.current,r=S7(ZR.current),n=S7(JR.current);function a(){const i=document.documentElement,s=document.querySelector('meta[name="theme-color"]');e==="light"?(r.length&&i.classList.remove(...r),n.length&&i.classList.add(...n),i.style.colorScheme="light",s&&Nu.current&&s.setAttribute("content",Nu.current.light)):(n.length&&i.classList.remove(...n),r.length&&i.classList.add(...r),i.style.colorScheme="dark",s&&Nu.current&&s.setAttribute("content",Nu.current.dark))}return Mb.current?uz(a,kb.current):a(),e});return{get current(){return p(t)}}}function kbe(){const t=F(()=>{if(O1.current,!Tg)return;function e(){document.documentElement.setAttribute("data-theme",O1.current)}return Mb.current?uz(e,Nn(()=>kb.current)):e(),O1.current});return{get current(){return p(t)}}}const cE=Mbe(),Pbe=kbe();function e2(t){QR.current=t}function Lbe(t){O1.current=t}function Fbe({defaultMode:t="system",themeColors:e,darkClassNames:r=["dark"],lightClassNames:n=[],defaultTheme:a="",modeStorageKey:i="mode-watcher-mode",themeStorageKey:s="mode-watcher-theme"}){const o=document.documentElement,l=localStorage.getItem(i)??t,c=localStorage.getItem(s)??a,u=l==="light"||l==="system"&&window.matchMedia("(prefers-color-scheme: light)").matches;if(u?(r.length&&o.classList.remove(...r.filter(Boolean)),n.length&&o.classList.add(...n.filter(Boolean))):(n.length&&o.classList.remove(...n.filter(Boolean)),r.length&&o.classList.add(...r.filter(Boolean))),o.style.colorScheme=u?"light":"dark",e){const d=document.querySelector('meta[name="theme-color"]');d&&d.setAttribute("content",l==="light"?e.light:e.dark)}c&&(o.setAttribute("data-theme",c),localStorage.setItem(s,c)),localStorage.setItem(i,l)}var Bbe=q('<meta name="theme-color"/>');function Ube(t,e){ye(e,!0);var r=se(),n=L(r);{var a=i=>{var s=Bbe();we(()=>rr(s,"content",e.themeColors.dark)),C(i,s)};le(n,i=>{e.themeColors&&i(a)})}C(t,r),Te()}var Gbe=q('<meta name="theme-color"/>'),qbe=q("<!> <!>",1);function zbe(t,e){ye(e,!0);let r=V(e,"trueNonce",3,"");dS("1funsus",n=>{var a=qbe(),i=L(a);{var s=l=>{var c=Gbe();we(()=>rr(c,"content",e.themeColors.dark)),C(l,c)};le(i,l=>{e.themeColors&&l(s)})}var o=te(i,2);op(o,()=>`<script${r()?` nonce=${r()}`:""}>(`+Fbe.toString()+")("+JSON.stringify(e.initConfig)+");<\/script>"),C(n,a)}),Te()}function $be(t,e){ye(e,!0);let r=V(e,"track",3,!0),n=V(e,"defaultMode",3,"system"),a=V(e,"disableTransitions",3,!0),i=V(e,"darkClassNames",19,()=>["dark"]),s=V(e,"lightClassNames",19,()=>[]),o=V(e,"defaultTheme",3,""),l=V(e,"nonce",3,""),c=V(e,"themeStorageKey",3,"mode-watcher-theme"),u=V(e,"modeStorageKey",3,"mode-watcher-mode"),d=V(e,"disableHeadScriptInjection",3,!1),h=V(e,"synchronousModeChanges",3,!1);Vd.current=u(),Wd.current=c(),ZR.current=i(),JR.current=s(),Mb.current=a(),Nu.current=e.themeColors,kb.current=h(),$i(()=>{kb.current=h()}),$i(()=>{Mb.current=a()}),$i(()=>{Nu.current=e.themeColors}),$i(()=>{ZR.current=i()}),$i(()=>{JR.current=s()}),$i(()=>{Vd.current=u()}),$i(()=>{Wd.current=c()}),$i(()=>{cE.current,Vd.current,Wd.current,Pbe.current}),vi(()=>{XR.tracking(r()),XR.query();const E=localStorage.getItem(Vd.current);e2(jR(E)?E:n());const y=localStorage.getItem(Wd.current);Lbe(y||o())});const m={defaultMode:n(),themeColors:e.themeColors,darkClassNames:i(),lightClassNames:s(),defaultTheme:o(),modeStorageKey:u(),themeStorageKey:c()},f=F(()=>typeof window>"u"?l():"");var g=se(),b=L(g);{var _=E=>{Ube(E,{get themeColors(){return Nu.current}})},S=E=>{zbe(E,{get trueNonce(){return p(f)},get initConfig(){return m},get themeColors(){return Nu.current}})};le(b,E=>{d()?E(_):E(S,!1)})}C(t,g),Te()}class Hbe{#e=_e(!1);get _isInitializing(){return p(this.#e)}set _isInitializing(e){k(this.#e,e,!0)}#t=_e(null);get _error(){return p(this.#t)}set _error(e){k(this.#t,e,!0)}#r=_e(0);get _toolCount(){return p(this.#r)}set _toolCount(e){k(this.#r,e,!0)}#n=_e(Tr([]));get _connectedServers(){return p(this.#n)}set _connectedServers(e){k(this.#n,e,!0)}#i=_e(Tr({}));get _healthChecks(){return p(this.#i)}set _healthChecks(e){k(this.#i,e,!0)}#a=_e(!1);get _proxyAvailable(){return p(this.#a)}set _proxyAvailable(e){k(this.#a,e,!0)}connections=new Map;toolsIndex=new Map;serverConfigs=new Map;reconnectingServers=new Set;configSignature=null;initPromise=null;activeFlowCount=0;constructor(){this.probeProxy()}async probeProxy(){try{const e=await fetch(`${qa}${WU}`,{method:"HEAD" Line truncated
`);return e.join("")}}function Zm(t,e){const r=e?URL.parse(t,e):URL.parse(t);return r?.protocol==="http:"||r?.protocol==="https:"}function Fo(t){t.preventDefault()}function Qa(t){t.preventDefault(),t.stopPropagation()}function SSe(t){console.log("Deprecated API usage: "+t)}class o2{static#e;static toDateObject(e){if(e instanceof Date)return e;if(!e||typeof e!="string")return null;this.#e||=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?");const r=this.#e.exec(e);if(!r)return null;const n=parseInt(r[1],10);let a=parseInt(r[2],10);a=a>=1&&a<=12?a-1:0;let i=parseInt(r[3],10);i=i>=1&&i<=31?i:1;let s=parseInt(r[4],10);s=s>=0&&s<=23?s:0;let o=parseInt(r[5],10);o=o>=0&&o<=59?o:0;let l=parseInt(r[6],10);l=l>=0&&l<=59?l:0;const c=r[7]||"Z";let u=parseInt(r[8],10);u=u>=0&&u<=23?u:0;let d=parseInt(r[9],10)||0;return d=d>=0&&d<=59?d:0,c==="-"?(s+=u,o+=d):c==="+"&&(s-=u,o-=d),new Date(Date.UTC(n,a,i,s,o,l))}}function ESe(t,{scale:e=1,rotation:r=0}){const{width:n,height:a}=t.attributes.style,i=[0,0,parseInt(n),parseInt(a)];return new Ag({viewBox:i,userUnit:1,scale:e,rotation:r})}function mE(t){if(t.startsWith("#")){const e=parseInt(t.slice(1),16);return[(e&16711680)>>16,(e&65280)>>8,e&255]}return t.startsWith("rgb(")?t.slice(4,-1).split(",").map(e=>parseInt(e)):t.startsWith("rgba(")?t.slice(5,-1).split(",").map(e=>parseInt(e)).slice(0,3):(en(`Not a valid color format: "${t}"`),[0,0,0])}function vSe(t){const e=document.createElement("span");e.style.visibility="hidden",e.style.colorScheme="only light",document.body.append(e);for(const r of t.keys()){e.style.color=r;const n=window.getComputedStyle(e).color;t.set(r,mE(n))}e.remove()}function wa(t){const{a:e,b:r,c:n,d:a,e:i,f:s}=t.getTransform();return[e,r,n,a,i,s]}function yl(t){const{a:e,b:r,c:n,d:a,e:i,f:s}=t.getTransform().invertSelf();return[e,r,n,a,i,s]}function ih(t,e,r=!1,n=!0){if(e instanceof Ag){const{pageWidth:a,pageHeight:i}=e.rawDims,{style:s}=t,o=ki.isCSSRoundSupported,l=`var(--total-scale-factor) * ${a}px`,c=`var(--total-scale-factor) * ${i}px`,u=o?`round(down, ${l}, var(--scale-round-x))`:`calc(${l})`,d=o?`round(down, ${c}, var(--scale-round-y))`:`calc(${c})`;!r||e.rotation%180===0?(s.width=u,s.height=d):(s.width=d,s.height=u)}n&&t.setAttribute("data-main-rotation",e.rotation)}class Wl{constructor(){const{pixelRatio:e}=Wl;this.sx=e,this.sy=e}get scaled(){return this.sx!==1||this.sy!==1}get symmetric(){return this.sx===this.sy}limitCanvas(e,r,n,a,i=-1){let s=1/0,o=1/0,l=1/0;n=Wl.capPixels(n,i),n>0&&(s=Math.sqrt(n/(e*r))),a!==-1&&(o=a/e,l=a/r);const c=Math.min(s,o,l);return this.sx>c||this.sy>c?(this.sx=c,this.sy=c,!0):!1}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(e,r){if(r>=0){const n=Math.ceil(window.screen.availWidth*window.screen.availHeight*this.pixelRatio**2*(1+r/100));return e>0?Math.min(e,n):n}return e}}const l2=["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/x-icon"];class df{#e=null;#t=null;#r;#n=null;#i=null;#a=null;#s=null;static#o=null;constructor(e){this.#r=e,df.#o||=Object.freeze({freetext:"pdfjs-editor-remove-freetext-button",highlight:"pdfjs-editor-remove-highlight-button",ink:"pdfjs-editor-remove-ink-button",stamp:"pdfjs-editor-remove-stamp-button",signature:"pdfjs-editor-remove-signature-button"})}render(){const e=this.#e=document.createElement("div");e.classList.add("editToolbar","hidden"),e.setAttribute("role","toolbar");const r=this.#r._uiManager._signal;e.addEventListener("contextmenu",Fo,{signal:r}),e.addEventListener("pointerdown",df.#l,{signal:r});const n=this.#n=document.createElement("div");n.className="buttons",e.append(n);const a=this.#r.toolbarPosition;if(a){const{style:i}=e,s=this.#r._uiManager.direction==="ltr"?1-a[0]:a[0];i.insetInlineEnd=`${100*s}%`,i.top=`calc(${100*a[1]}% + var(--editor-toolbar-vert-offset))`}return e}get div(){return this.#e}static#l(e){e.stopPropagation()}#c(e){this.#r._focusEventsAllowed=!1,Qa(e)}#d(e){this.#r._focusEventsAllowed=!0,Qa(e)}#u(e){const r=this.#r._uiManager._signal;e.addEventListener("focusin",this.#c.bind(this),{capture:!0,signal:r}),e.addEventListener("focusout",this.#d.bind(this),{capture:!0,signal:r}),e.addEventListener("contextmenu",Fo,{signal:r})}hide(){this.#e.classList.add("hidden"),this.#t?.hideDropdown()}show(){this.#e.classList.remove("hidden"),this.#i?.shown(),this.#a?.shown()}addDeleteButton(){const{editorType:e,_uiManager:r}=this.#r,n=document.createElement("button");n.className="delete",n.tabIndex=0,n.setAttribute("data-l10n-id",df.#o[e]),this.#u(n),n.addEventListener("click",a=>{r.delete()},{signal:r._signal}),this.#n.append(n)}get#m(){const e=document.createElement("div");return e.className="divider",e}async addAltText(e){const r=await e.render();this.#u(r),this.#n.append(r,this.#m),this.#i=e}addComment(e){if(this.#a)return;const r=e.render();r&&(this.#u(r),this.#n.prepend(r,this.#m),this.#a=e,e.toolbar=this)}addColorPicker( Line truncated
`)||null;o&&this.data.comb&&(o=o.replaceAll(/\s+/g,""));const l={userValue:i,formattedValue:o,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(n=document.createElement("textarea"),n.textContent=o??i,this.data.doNotScroll&&(n.style.overflowY="hidden")):(n=document.createElement("input"),n.type=this.data.password?"password":"text",n.setAttribute("value",o??i),this.data.doNotScroll&&(n.style.overflowX="hidden")),this.data.hasOwnCanvas&&(n.hidden=!0),sh.add(n),n.setAttribute("data-element-id",r),n.disabled=this.data.readOnly,n.name=this.data.fieldName,n.tabIndex=0;const{datetimeFormat:c,datetimeType:u,timeStep:d}=this.data,h=!!u&&this.enableScripting;c&&(n.title=c),this._setRequired(n,this.data.required),s&&(n.maxLength=s),n.addEventListener("input",f=>{e.setValue(r,{value:f.target.value}),this.setPropertyOnSiblings(n,"value",f.target.value,"value"),l.formattedValue=null}),n.addEventListener("resetform",f=>{const g=this.data.defaultFieldValue??"";n.value=l.userValue=g,l.formattedValue=null});let m=f=>{const{formattedValue:g}=l;g!=null&&(f.target.value=g),f.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){n.addEventListener("focus",g=>{if(l.focused)return;const{target:b}=g;if(h&&(b.type=u,d&&(b.step=d)),l.userValue){const _=l.userValue;if(h)if(u==="time"){const S=new Date(_),E=[S.getHours(),S.getMinutes(),S.getSeconds()];b.value=E.map(y=>y.toString().padStart(2,"0")).join(":")}else b.value=new Date(_-OEe).toISOString().split(u==="date"?"T":".",1)[0];else b.value=_}l.lastCommittedValue=b.value,l.commitKey=1,this.data.actions?.Focus||(l.focused=!0)}),n.addEventListener("updatefromsandbox",g=>{this.showElementAndHideCanvas(g.target);const b={value(_){l.userValue=_.detail.value??"",h||e.setValue(r,{value:l.userValue.toString()}),_.target.value=l.userValue},formattedValue(_){const{formattedValue:S}=_.detail;l.formattedValue=S,S!=null&&_.target!==document.activeElement&&(_.target.value=S);const E={formattedValue:S};h&&(E.value=S),e.setValue(r,E)},selRange(_){_.target.setSelectionRange(..._.detail.selRange)},charLimit:_=>{const{charLimit:S}=_.detail,{target:E}=_;if(S===0){E.removeAttribute("maxLength");return}E.setAttribute("maxLength",S);let y=l.userValue;!y||y.length<=S||(y=y.slice(0,S),E.value=l.userValue=y,e.setValue(r,{value:y}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:r,name:"Keystroke",value:y,willCommit:!0,commitKey:1,selStart:E.selectionStart,selEnd:E.selectionEnd}}))}};this._dispatchEventFromSandbox(b,g)}),n.addEventListener("keydown",g=>{l.commitKey=1;let b=-1;if(g.key==="Escape"?b=0:g.key==="Enter"&&!this.data.multiLine?b=2:g.key==="Tab"&&(l.commitKey=3),b===-1)return;const{value:_}=g.target;l.lastCommittedValue!==_&&(l.lastCommittedValue=_,l.userValue=_,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:r,name:"Keystroke",value:_,willCommit:!0,commitKey:b,selStart:g.target.selectionStart,selEnd:g.target.selectionEnd}}))});const f=m;m=null,n.addEventListener("blur",g=>{if(!l.focused||!g.relatedTarget)return;this.data.actions?.Blur||(l.focused=!1);const{target:b}=g;let{value:_}=b;if(h){if(_&&u==="time"){const S=_.split(":").map(E=>parseInt(E,10));_=new Date(2e3,0,1,S[0],S[1],S[2]||0).valueOf(),b.step=""}else _=new Date(_).valueOf();b.type="text"}l.userValue=_,l.lastCommittedValue!==_&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:r,name:"Keystroke",value:_,willCommit:!0,commitKey:l.commitKey,selStart:g.target.selectionStart,selEnd:g.target.selectionEnd}}),f(g)}),this.data.actions?.Keystroke&&n.addEventListener("beforeinput",g=>{l.lastCommittedValue=null;const{data:b,target:_}=g,{value:S,selectionStart:E,selectionEnd:y}=_;let v=E,T=y;switch(g.inputType){case"deleteWordBackward":{const w=S.substring(0,E).match(/\w*[^\w]*$/);w&&(v-=w[0].length);break}case"deleteWordForward":{const w=S.substring(E).match(/^[^\w]*\w*/);w&&(T+=w[0].length);break}case"deleteContentBackward":E===y&&(v-=1);break;case"deleteContentForward":E===y&&(T+=1);break}g.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:r,name:"Keystroke",value:S,change:b||"",willCommit:!1,selStart:v,selEnd:T}})}),this._setEventListeners(n,l,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],g=>g.target.value)}if(m&&n.addEventListener("blur",m),this.data.comb){const g=(this.data.rect[2]-this.data.rect[0])/s;n.classList.add("comb"),n.style.letterSpacing=`calc(${g}px * var(--total-scale-factor) - 1ch)`}}else n=document.createElement("div"),n.textContent=this.data.fieldValue,n.style.verticalAlign="middle",n.style.display="table-cell",this.data.hasOwnCanvas&&(n.hidden=!0);return this._setTextStyle(n),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class xEe extends _h{constructor(e){super(e,{isRenderable:!!e.data.has Line truncated
`))r.push({name:"span",value:i,attributes:a});return n}_formatContents({str:e,dir:r}){const n=document.createElement("p");n.classList.add("popupContent"),n.dir=r;const a=e.split(/(?:\r\n?|\n)/);for(let i=0,s=a.length;i<s;++i){const o=a[i];n.append(document.createTextNode(o)),i<s-1&&n.append(document.createElement("br"))}return n}#I(e){e.altKey||e.shiftKey||e.ctrlKey||e.metaKey||(e.key==="Enter"||e.key==="Escape"&&this.#u)&&this.#O()}updateEdited({rect:e,popup:r,deleted:n}){if(n||r?.deleted){this.remove();return}this.#v(),this.#_||={contentsObj:this.#s,richText:this.#g},e&&(this.#p=null),r&&(this.#g=this.#w(r.text),this.#o=o2.toDateObject(r.date),this.#s=null),this.#m?.remove(),this.#m=null}resetEdited(){this.#_&&({contentsObj:this.#s,richText:this.#g}=this.#_,this.#_=null,this.#m?.remove(),this.#m=null,this.#p=null)}remove(){this.#f?.abort(),this.#f=null,this.#m?.remove(),this.#m=null,this.#E=!1,this.#u=!1;for(const e of this.trigger)e.classList.remove("popupTriggerArea")}#N(){if(this.#p!==null)return;const{page:{view:e},viewport:{rawDims:{pageWidth:r,pageHeight:n,pageX:a,pageY:i}}}=this.#c;let s=!!this.#d,o=s?this.#d:this.#h;for(const f of this.#l)if(!o||kr.intersect(f.data.rect,o)!==null){o=f.data.rect,s=!0;break}const l=kr.normalizeRect([o[0],e[3]-o[1]+e[1],o[2],e[3]-o[3]+e[1]]),u=s?o[2]-o[0]+5:0,d=l[0]+u,h=l[1];this.#p=[100*(d-a)/r,100*(h-i)/n];const{style:m}=this.#a;m.left=`${this.#p[0]}%`,m.top=`${this.#p[1]}%`}#O(){this.#u=!this.#u,this.#u?(this.#R(),this.#a.addEventListener("click",this.#n),this.#a.addEventListener("keydown",this.#e)):(this.#D(),this.#a.removeEventListener("click",this.#n),this.#a.removeEventListener("keydown",this.#e))}#R(){this.#m||this.render(),this.isVisible?this.#u&&this.#a.classList.add("focused"):(this.#N(),this.#a.hidden=!1,this.#a.style.zIndex=parseInt(this.#a.style.zIndex)+1e3)}#D(){this.#a.classList.remove("focused"),!(this.#u||!this.isVisible)&&(this.#a.hidden=!0,this.#a.style.zIndex=parseInt(this.#a.style.zIndex)-1e3)}forceHide(){this.#E=this.isVisible,this.#E&&(this.#a.hidden=!0)}maybeShow(){this.#v(),this.#E&&(this.#m||this.#R(),this.#E=!1,this.#a.hidden=!1)}get isVisible(){return this.#a.hidden===!1}}class Fz extends za{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.textContent=e.data.textContent,this.textPosition=e.data.textPosition,this.annotationEditorType=Jr.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const e=document.createElement("div");e.classList.add("annotationTextContent"),e.setAttribute("role","comment");for(const r of this.textContent){const n=document.createElement("span");n.textContent=r,e.append(n)}this.container.append(e)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}class LEe extends za{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("lineAnnotation");const{data:e,width:r,height:n}=this,a=this.svgFactory.create(r,n,!0),i=this.#e=this.svgFactory.createElement("svg:line");return i.setAttribute("x1",e.rect[2]-e.lineCoordinates[0]),i.setAttribute("y1",e.rect[3]-e.lineCoordinates[1]),i.setAttribute("x2",e.rect[2]-e.lineCoordinates[2]),i.setAttribute("y2",e.rect[3]-e.lineCoordinates[3]),i.setAttribute("stroke-width",e.borderStyle.width||1),i.setAttribute("stroke","transparent"),i.setAttribute("fill","transparent"),a.append(i),this.container.append(a),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}}class FEe extends za{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("squareAnnotation");const{data:e,width:r,height:n}=this,a=this.svgFactory.create(r,n,!0),i=e.borderStyle.width,s=this.#e=this.svgFactory.createElement("svg:rect");return s.setAttribute("x",i/2),s.setAttribute("y",i/2),s.setAttribute("width",r-i),s.setAttribute("height",n-i),s.setAttribute("stroke-width",i||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),a.append(s),this.container.append(a),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}}class BEe extends za{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("circleAnnotation");const{data:e,width:r,height:n}=this,a=this.svgFactory.create(r,n,!0),i=e.borderStyle.width,s=this.#e=this.svgFactory.createElement("svg:ellipse");return s.setAttribute("cx",r/2),s.setAttribute("cy",n/2),s.setAttribute("rx",r/2-i/2),s.setAttribute("ry",n/2-i/2),s.setAttribute("stroke-width",i||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),a.append(s),this.container.append(a),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return Line truncated
`)}#l(){const[e,r]=this.parentDimensions;let n;if(this.isAttachedToDOM)n=this.div.getBoundingClientRect();else{const{currentLayer:a,div:i}=this,s=i.style.display,o=i.classList.contains("hidden");i.classList.remove("hidden"),i.style.display="hidden",a.div.append(this.div),n=i.getBoundingClientRect(),i.remove(),i.style.display=s,i.classList.toggle("hidden",o)}this.rotation%180===this.parentRotation%180?(this.width=n.width/e,this.height=n.height/r):(this.width=n.height/e,this.height=n.width/r),this.fixAndSetPosition()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const e=this.#t,r=this.#t=this.#o().trimEnd();if(e===r)return;const n=a=>{if(this.#t=a,!a){this.remove();return}this.#d(),this._uiManager.rebuild(this),this.#l()};this.addCommands({cmd:()=>{n(r)},undo:()=>{n(e)},mustExec:!1}),this.#l()}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}keydown(e){e.target===this.div&&e.key==="Enter"&&(this.enterInEditMode(),e.preventDefault())}editorDivKeydown(e){oi._keyboardManager.exec(this,e)}editorDivFocus(e){this.isEditing=!0}editorDivBlur(e){this.isEditing=!1}editorDivInput(e){this.parent.div.classList.toggle("freetextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}get canChangeContent(){return!0}render(){if(this.div)return this.div;let e,r;(this._isCopy||this.annotationElementId)&&(e=this.x,r=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",this.#r),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text2"),this.editorDiv.setAttribute("data-l10n-attrs","default-content"),this.enableEditing(),this.editorDiv.contentEditable=!0;const{style:n}=this.editorDiv;if(n.fontSize=`calc(${this.#i}px * var(--total-scale-factor))`,n.color=this.#e,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),this._isCopy||this.annotationElementId){const[a,i]=this.parentDimensions;if(this.annotationElementId){const{position:s}=this._initialData;let[o,l]=this.getInitialTranslation();[o,l]=this.pageTranslationToScreen(o,l);const[c,u]=this.pageDimensions,[d,h]=this.pageTranslation;let m,f;switch(this.rotation){case 0:m=e+(s[0]-d)/c,f=r+this.height-(s[1]-h)/u;break;case 90:m=e+(s[0]-d)/c,f=r-(s[1]-h)/u,[o,l]=[l,-o];break;case 180:m=e-this.width+(s[0]-d)/c,f=r-(s[1]-h)/u,[o,l]=[-o,-l];break;case 270:m=e+(s[0]-d-this.height*u)/c,f=r+(s[1]-h-this.width*c)/u,[o,l]=[-l,o];break}this.setAt(m*a,f*i,o,l)}else this._moveAfterPaste(e,r);this.#d(),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}static#c(e){return(e.nodeType===Node.TEXT_NODE?e.nodeValue:e.innerText).replaceAll(j0,"")}editorDivPaste(e){const r=e.clipboardData||window.clipboardData,{types:n}=r;if(n.length===1&&n[0]==="text/plain")return;e.preventDefault();const a=oi.#m(r.getData("text")||"").replaceAll(j0,`
`);if(!a)return;const i=window.getSelection();if(!i.rangeCount)return;this.editorDiv.normalize(),i.deleteFromDocument();const s=i.getRangeAt(0);if(!a.includes(`
`)){s.insertNode(document.createTextNode(a)),this.editorDiv.normalize(),i.collapseToStart();return}const{startContainer:o,startOffset:l}=s,c=[],u=[];if(o.nodeType===Node.TEXT_NODE){const p=o.parentElement;if(u.push(o.nodeValue.slice(l).replaceAll(Y1,"")),p!==this.editorDiv){let m=c;for(const g of this.editorDiv.childNodes){if(g===p){m=u;continue}m.push(ni.#c(g))}}c.push(o.nodeValue.slice(0,l).replaceAll(Y1,""))}else if(o===this.editorDiv){let p=c,m=0;for(const g of this.editorDiv.childNodes)m++===l&&(p=u),p.push(ni.#c(g))}this.#t=`${c.join(`
`)){s.insertNode(document.createTextNode(a)),this.editorDiv.normalize(),i.collapseToStart();return}const{startContainer:o,startOffset:l}=s,c=[],u=[];if(o.nodeType===Node.TEXT_NODE){const m=o.parentElement;if(u.push(o.nodeValue.slice(l).replaceAll(j0,"")),m!==this.editorDiv){let f=c;for(const g of this.editorDiv.childNodes){if(g===m){f=u;continue}f.push(oi.#c(g))}}c.push(o.nodeValue.slice(0,l).replaceAll(j0,""))}else if(o===this.editorDiv){let m=c,f=0;for(const g of this.editorDiv.childNodes)f++===l&&(m=u),m.push(oi.#c(g))}this.#t=`${c.join(`
`)}${a}${u.join(`
`)}`,this.#d();const d=new Range;let h=Math.sumPrecise(c.map(p=>p.length));for(const{firstChild:p}of this.editorDiv.childNodes)if(p.nodeType===Node.TEXT_NODE){const m=p.nodeValue.length;if(h<=m){d.setStart(p,h),d.setEnd(p,h);break}h-=m}i.removeAllRanges(),i.addRange(d)}#d(){if(this.editorDiv.replaceChildren(),!!this.#t)for(const e of this.#t.split(`
`)){const t=document.createElement("div");t.append(e?document.createTextNode(e):document.createElement("br")),this.editorDiv.append(t)}}#u(){return this.#t.replaceAll(" "," ")}static#p(e){return e.replaceAll(" "," ")}get contentDiv(){return this.editorDiv}static async deserialize(e,t,n){let a=null;if(e instanceof Mz){const{data:{defaultAppearanceData:{fontSize:s,fontColor:o},rect:l,rotation:c,id:u,popupRef:d,contentsObj:h},textContent:p,textPosition:m,parent:{page:{pageNumber:g}}}=e;if(!p||p.length===0)return null;a=e={annotationType:Zr.FREETEXT,color:Array.from(o),fontSize:s,value:p.join(`
`),position:m,pageIndex:g-1,rect:l.slice(0),rotation:c,annotationElementId:u,id:u,deleted:!1,popupRef:d,comment:h?.str||null}}const i=await super.deserialize(e,t,n);return i.#i=e.fontSize,i.#e=Dr.makeHexColor(...e.color),i.#t=ni.#p(e.value),i._initialData=a,e.comment&&i.setCommentData(e.comment),i}serialize(e=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const t=ni._internalPadding*this.parentScale,n=this.getRect(t,t),a=Fr._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.#e),i={annotationType:Zr.FREETEXT,color:a,fontSize:this.#i,value:this.#u(),pageIndex:this.pageIndex,rect:n,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return this.addComment(i),e?(i.isCopy=!0,i):this.annotationElementId&&!this.#m(i)?null:(i.id=this.annotationElementId,i)}#m(e){const{value:t,fontSize:n,color:a,pageIndex:i}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||e.value!==t||e.fontSize!==n||e.color.some((s,o)=>s!==a[o])||e.pageIndex!==i}renderAnnotationElement(e){const t=super.renderAnnotationElement(e),{style:n}=t;n.fontSize=`calc(${this.#i}px * var(--total-scale-factor))`,n.color=this.#e,t.replaceChildren();for(const s of this.#t.split(`
`)){const o=document.createElement("div");o.append(s?document.createTextNode(s):document.createElement("br")),t.append(o)}const a=ni._internalPadding*this.parentScale,i={rect:this.getRect(a,a)};return i.popup=this.hasEditedComment?this.comment:{text:this.#t},e.updateEdited(i),t}resetAnnotationElement(e){super.resetAnnotationElement(e),e.resetEdited()}}class br{static PRECISION=1e-4;toSVGPath(){Zn("Abstract method `toSVGPath` must be implemented.")}get box(){Zn("Abstract getter `box` must be implemented.")}serialize(e,t){Zn("Abstract method `serialize` must be implemented.")}static _rescale(e,t,n,a,i,s){s||=new Float32Array(e.length);for(let o=0,l=e.length;o<l;o+=2)s[o]=t+e[o]*a,s[o+1]=n+e[o+1]*i;return s}static _rescaleAndSwap(e,t,n,a,i,s){s||=new Float32Array(e.length);for(let o=0,l=e.length;o<l;o+=2)s[o]=t+e[o+1]*a,s[o+1]=n+e[o]*i;return s}static _translate(e,t,n,a){a||=new Float32Array(e.length);for(let i=0,s=e.length;i<s;i+=2)a[i]=t+e[i],a[i+1]=n+e[i+1];return a}static svgRound(e){return Math.round(e*1e4)}static _normalizePoint(e,t,n,a,i){switch(i){case 90:return[1-t/n,e/a];case 180:return[1-e/n,1-t/a];case 270:return[t/n,1-e/a];default:return[e/n,t/a]}}static _normalizePagePoint(e,t,n){switch(n){case 90:return[1-t,e];case 180:return[1-e,1-t];case 270:return[t,1-e];default:return[e,t]}}static createBezierPoints(e,t,n,a,i,s){return[(e+5*n)/6,(t+5*a)/6,(5*n+i)/6,(5*a+s)/6,(n+i)/2,(a+s)/2]}}class Gd{#e;#t=[];#r;#n;#i=[];#a=new Float32Array(18);#s;#o;#l;#c;#d;#u;#p=[];static#m=8;static#f=2;static#h=Gd.#m+Gd.#f;constructor({x:e,y:t},n,a,i,s,o=0){this.#e=n,this.#u=i*a,this.#n=s,this.#a.set([NaN,NaN,NaN,NaN,e,t],6),this.#r=o,this.#c=Gd.#m*a,this.#l=Gd.#h*a,this.#d=a,this.#p.push(e,t)}isEmpty(){return isNaN(this.#a[8])}#g(){const e=this.#a.subarray(4,6),t=this.#a.subarray(16,18),[n,a,i,s]=this.#e;return[(this.#s+(e[0]-t[0])/2-n)/i,(this.#o+(e[1]-t[1])/2-a)/s,(this.#s+(t[0]-e[0])/2-n)/i,(this.#o+(t[1]-e[1])/2-a)/s]}add({x:e,y:t}){this.#s=e,this.#o=t;const[n,a,i,s]=this.#e;let[o,l,c,u]=this.#a.subarray(8,12);const d=e-c,h=t-u,p=Math.hypot(d,h);if(p<this.#l)return!1;const m=p-this.#c,g=m/p,b=g*d,_=g*h;let v=o,y=l;o=c,l=u,c+=b,u+=_,this.#p?.push(e,t);const E=-_/m,S=b/m,w=E*this.#u,C=S*this.#u;return this.#a.set(this.#a.subarray(2,8),0),this.#a.set([c+w,u+C],4),this.#a.set(this.#a.subarray(14,18),12),this.#a.set([c-w,u-C],16),isNaN(this.#a[6])?(this.#i.length===0&&(this.#a.set([o+w,l+C],2),this.#i.push(NaN,NaN,NaN,NaN,(o+w-n)/i,(l+C-a)/s),this.#a.set([o-w,l-C],14),this.#t.push(NaN,NaN,NaN,NaN,(o-w-n)/i,(l-C-a)/s)),this.#a.set([v,y,o,l,c,u],6),!this.isEmpty()):(this.#a.set([v,y,o,l,c,u],6),Math.abs(Math.atan2(y-l,v-o)-Math.atan2(_,b))<Math.PI/2?([o,l,c,u]=this.#a.subarray(2,6),this.#i.push(NaN,NaN,NaN,NaN,((o+c)/2-n)/i,((l+u)/2-a)/s),[o,l,v,y]=this.#a.subarray(14,18),this.#t.push(NaN,NaN,NaN,NaN,((v+o)/2-n)/i,((y+l)/2-a)/s),!0):([v,y,o,l,c,u]=this.#a.subarray(0,6),this.#i.push(((v+5*o)/6-n)/i,((y+5*l)/6-a)/s,((5*o+c)/6-n)/i,((5*l+u)/6-a)/s,((o+c)/2-n)/i,((l+u)/2-a)/s),[c,u,o,l,v,y]=this.#a.subarray(12,18),this.#t.push(((v+5*o)/6-n)/i,((y+5*l)/6-a)/s,((5*o+c)/6-n)/i,((5*l+u)/6-a)/s,((o+c)/2-n)/i,((l+u)/2-a)/s),!0))}toSVGPath(){if(this.isEmpty())return"";const e=this.#i,t=this.#t;if(isNaN(this.#a[6])&&!this.isEmpty())return this.#v();const n=[];n.push(`M${e[4]} ${e[5]}`);for(let a=6;a<e.length;a+=6)isNaN(e[a])?n.push(`L${e[a+4]} ${e[a+5]}`):n.push(`C${e[a]} ${e[a+1]} ${e[a+2]} ${e[a+3]} ${e[a+4]} ${e[a+5]}`);this.#y(n);for(let a=t.length-6;a>=6;a-=6)isNaN(t[a])?n.push(`L${t[a+4]} ${t[a+5]}`):n.push(`C${t[a]} ${t[a+1]} ${t[a+2]} ${t[a+3]} ${t[a+4]} ${t[a+5]}`);return this.#_(n),n.join(" ")}#v(){const[e,t,n,a]=this.#e,[i,s,o,l]=this.#g();return`M${(this.#a[2]-e)/n} ${(this.#a[3]-t)/a} L${(this.#a[4]-e)/n} ${(this.#a[5]-t)/a} L${i} ${s} L${o} ${l} L${(this.#a[16]-e)/n} ${(this.#a[17]-t)/a} L${(this.#a[14]-e)/n} ${(this.#a[15]-t)/a} Z`}#_(e){const t=this.#t;e.push(`L${t[4]} ${t[5]} Z`)}#y(e){const[t,n,a,i]=this.#e,s=this.#a.subarray(4,6),o=this.#a.subarray(16,18),[l,c,u,d]=this.#g();e.push(`L${(s[0]-t)/a} ${(s[1]-n)/i} L${l} ${c} L${u} ${d} L${(o[0]-t)/a} ${(o[1]-n)/i}`)}newFreeDrawOutline(e,t,n,a,i,s){return new Fz(e,t,n,a,i,s)}getOutlines(){const e=this.#i,t=this.#t,n=this.#a,[a,i,s,o]=this.#e,l=new Float32Array((this.#p?.length??0)+2);for(let d=0,h=l.length-2;d<h;d+=2)l[d]=(this.#p[d]-a)/s,l[d+1]=(this.#p[d+1]-i)/o;if(l[l.length-2]=(this.#s-a)/s,l[l.length-1]=(this.#o-i)/o,isNaN(n[6])&&!this.isEmpty())return this.#S(l);const c=new Float32Array(this.#i.length+24+this.#t.length);let u=e.length;for(let d=0;d<u;d+=2){if(isNaN(e[d])){c[d]=c[d+1]=NaN;continue}c[d]=e[d],c[d+1]=e[d+1]}u=this.#w(c,u);for(let d=t.length-6;d>=6;d-=6)for(let h=0;h<6;h+=2){if(isNaN(t[d+h])){c[u]=c[u+1]=NaN,u+=2;continue}c[u]=t[d+h],c[u+1]=t[d+h+1],u+=2}return this.#b(c,u),this.newFreeDrawOutline(c,l,this.#e,this.#d,this.#r,this.#n)}#S(e){const t=this.#a,[n,a,i,s]=this.#e,[o,l,c,u]=this.#g(),d=new Float32Array(36);return d.set([NaN,NaN,NaN,NaN,(t[2] Line truncated
`)}catch(e){throw console.error("Error converting PDF to text:",e),new Error(`Failed to convert PDF to text: ${e instanceof Error?e.message:"Unknown error"}`)}}async function $z(r,e=1.5){try{const t=await Uz(r),n=await Ex(t).promise,a=[];for(let i=1;i<=n.numPages;i++){const s=await n.getPage(i),o=s.getViewport({scale:e}),l=document.createElement("canvas"),c=l.getContext("2d");if(l.width=o.width,l.height=o.height,!c)throw new Error("Failed to get 2D context from canvas");const u=s.render({canvasContext:c,viewport:o,canvas:l});a.push(u.promise.then(()=>l.toDataURL(ea.PNG)))}return await Promise.all(a)}catch(t){throw console.error("Error converting PDF to images:",t),new Error(`Failed to convert PDF to images: ${t instanceof Error?t.message:"Unknown error"}`)}}function Gz(r,e="white"){return new Promise((t,n)=>{try{const a=new Image;a.onload=()=>{const i=document.createElement("canvas"),s=i.getContext("2d");if(!s){n(new Error("Failed to get 2D canvas context."));return}const o=a.naturalWidth||300,l=a.naturalHeight||300;i.width=o,i.height=l,e&&(s.fillStyle=e,s.fillRect(0,0,i.width,i.height)),s.drawImage(a,0,0,o,l),t(i.toDataURL(ea.PNG))},a.onerror=()=>{n(new Error("Failed to load SVG image. Ensure the SVG data is valid."))},a.src=r}catch(a){const s=`Error converting SVG to PNG: ${a instanceof Error?a.message:String(a)}`;console.error(s,a),n(new Error(s))}})}function zz(r){return r===ea.SVG}function qz(r,e="white"){return new Promise((t,n)=>{try{const a=new Image;a.onload=()=>{const i=document.createElement("canvas"),s=i.getContext("2d");if(!s){n(new Error("Failed to get 2D canvas context."));return}const o=a.naturalWidth||300,l=a.naturalHeight||300;i.width=o,i.height=l,e&&(s.fillStyle=e,s.fillRect(0,0,i.width,i.height)),s.drawImage(a,0,0,o,l),t(i.toDataURL(ea.PNG))},a.onerror=()=>{n(new Error("Failed to load WebP image. Ensure the WebP data is valid."))},a.src=r}catch(a){const s=`Error converting WebP to PNG: ${a instanceof Error?a.message:String(a)}`;console.error(s,a),n(new Error(s))}})}function Hz(r){return r===ea.WEBP}class rs{static async sendMessage(e,t={},n,a){const{stream:i,onChunk:s,onComplete:o,onError:l,onReasoningChunk:c,onToolCallChunk:u,onModel:d,onTimings:h,tools:p,temperature:m,max_tokens:g,dynatemp_range:b,dynatemp_exponent:_,top_k:v,top_p:y,min_p:E,xtc_probability:S,xtc_threshold:w,typ_p:C,repeat_last_n:x,repeat_penalty:N,presence_penalty:I,frequency_penalty:D,dry_multiplier:H,dry_base:q,dry_allowed_length:$,dry_penalty_last_n:K,samplers:z,backend_sampling:re,custom:W,timings_per_token:ie,disableReasoningParsing:k,excludeReasoningFromContext:B}=t,te=e.map(R=>{if("id"in R&&"convId"in R&&"timestamp"in R){const U=R;return rs.convertDbMessageToApiChatMessageData(U)}else return R}).filter(R=>R.role===Jt.SYSTEM?(typeof R.content=="string"?R.content:"").trim().length>0:!0);t.model&&!rr.modelSupportsVision(t.model)&&te.forEach(R=>{Array.isArray(R.content)&&(R.content=R.content.filter(U=>U.type===Zi.IMAGE_URL?(console.info(`[ChatService] Skipping image attachment in message history (model "${t.model}" does not support vision)`),!1):!0),R.content.length===1&&R.content[0].type===Zi.TEXT&&(R.content=R.content[0].text))});const O={messages:te.map(R=>{const U={role:R.role,content:R.content,tool_calls:R.tool_calls,tool_call_id:R.tool_call_id};return!B&&R.reasoning_content&&(U.reasoning_content=R.reasoning_content),U}),stream:i,return_progress:i?!0:void 0,tools:p&&p.length>0?p:void 0};if(t.model&&(O.model=t.model),O.reasoning_format=k?c3.NONE:c3.AUTO,m!==void 0&&(O.temperature=m),g!==void 0&&(O.max_tokens=g!==null&&g!==0?g:-1),b!==void 0&&(O.dynatemp_range=b),_!==void 0&&(O.dynatemp_exponent=_),v!==void 0&&(O.top_k=v),y!==void 0&&(O.top_p=y),E!==void 0&&(O.min_p=E),S!==void 0&&(O.xtc_probability=S),w!==void 0&&(O.xtc_threshold=w),C!==void 0&&(O.typ_p=C),x!==void 0&&(O.repeat_last_n=x),N!==void 0&&(O.repeat_penalty=N),I!==void 0&&(O.presence_penalty=I),D!==void 0&&(O.frequency_penalty=D),H!==void 0&&(O.dry_multiplier=H),q!==void 0&&(O.dry_base=q),$!==void 0&&(O.dry_allowed_length=$),K!==void 0&&(O.dry_penalty_last_n=K),z!==void 0&&(O.samplers=typeof z=="string"?z.split(";").filter(R=>R.trim()):z),re!==void 0&&(O.backend_sampling=re),ie!==void 0&&(O.timings_per_token=ie),W)try{const R=typeof W=="string"?JSON.parse(W):W;Object.assign(O,R)}catch(R){console.warn("Failed to parse custom parameters:",R)}try{const R=await fetch("./v1/chat/completions",{method:"POST",headers:x4(),body:JSON.stringify(O),signal:a});if(!R.ok){const U=await rs.parseErrorResponse(R);throw l&&l(U),U}if(i){await rs.handleStreamResponse(R,s,o,l,c,u,d,h,n,a);return}else return rs.handleNonStreamResponse(R,o,l,u,d)}catch(R){if(El(R)){console.log("Chat completion request was aborted");return}let U;throw R instanceof Error?R.name==="TypeError"&&R.message.includes("fetch")?(U=new Error("Unable to connect to server - please check if the server is running"),U.name="NetworkError"):R.message.includes("ECONNREFUSED")?(U=new Error("Connection refused - Line truncated
`);C=I.pop()||"";for(const D of I){if(u?.aborted)break;if(D.startsWith(lo.DATA)){const H=D.slice(6);if(H==="[DONE]"){_=!0;continue}try{const q=JSON.parse(H),$=q.choices[0]?.delta?.content,K=q.choices[0]?.delta?.reasoning_content,z=q.choices[0]?.delta?.tool_calls,re=q.timings,W=q.prompt_progress,ie=rs.extractModelName(q);ie&&!v&&(v=!0,o?.(ie)),W&&rs.notifyTimings(void 0,W,l),re&&(rs.notifyTimings(re,W,l),b=re),$&&(S(),p+=$,u?.aborted||t?.($)),K&&(S(),m+=K,u?.aborted||i?.(K)),w(z)}catch(q){console.error("Error parsing JSON chunk:",q)}}}if(u?.aborted)break}if(u?.aborted)return;if(_){S();const x=g.length>0?JSON.stringify(g):void 0;n?.(p,m||void 0,b,x)}}catch(C){const x=C instanceof Error?C:new Error("Stream error");throw a?.(x),x}finally{d.releaseLock()}}static async handleNonStreamResponse(e,t,n,a,i){try{const s=await e.text();if(!s.trim())throw new Error("No response received from server. Please try again.");const o=JSON.parse(s),l=rs.extractModelName(o);l&&i?.(l);const c=o.choices[0]?.message?.content||"",u=o.choices[0]?.message?.reasoning_content,d=o.choices[0]?.message?.tool_calls;let h;if(d&&d.length>0){const p=rs.mergeToolCallDeltas([],d);p.length>0&&(h=JSON.stringify(p),h&&a?.(h))}if(!c.trim()&&!h)throw new Error("No response received from server. Please try again.");return t?.(c,u,void 0,h),c}catch(s){const o=s instanceof Error?s:new Error("Parse error");throw n?.(o),o}}static mergeToolCallDeltas(e,t,n=0){const a=e.map(i=>({...i,function:i.function?{...i.function}:void 0}));for(const i of t){const s=typeof i.index=="number"&&i.index>=0?i.index+n:a.length;for(;a.length<=s;)a.push({function:void 0});const o=a[s];if(i.id&&(o.id=i.id),i.type&&(o.type=i.type),i.function){const l=o.function?{...o.function}:{};i.function.name&&(l.name=i.function.name),i.function.arguments&&(l.arguments=(l.arguments??"")+i.function.arguments),o.function=l}}return a}static convertDbMessageToApiChatMessageData(e){if(e.role===Jt.TOOL&&e.toolCallId)return{role:Jt.TOOL,content:e.content,tool_call_id:e.toolCallId};let t;if(e.toolCalls)try{t=JSON.parse(e.toolCalls)}catch{}if(!e.extra||e.extra.length===0){const h={role:e.role,content:e.content};return e.reasoningContent&&(h.reasoning_content=e.reasoningContent),t&&t.length>0&&(h.tool_calls=t),h}const n=[];e.content&&n.push({type:Zi.TEXT,text:e.content});const a=e.extra.filter(h=>h.type===Kr.IMAGE);for(const h of a)n.push({type:Zi.IMAGE_URL,image_url:{url:h.base64Url}});const i=e.extra.filter(h=>h.type===Kr.TEXT);for(const h of i)n.push({type:Zi.TEXT,text:Tp("File",h.name,h.content)});const s=e.extra.filter(h=>h.type===Kr.LEGACY_CONTEXT);for(const h of s)n.push({type:Zi.TEXT,text:Tp("File",h.name,h.content)});const o=e.extra.filter(h=>h.type===Kr.AUDIO);for(const h of o)n.push({type:Zi.INPUT_AUDIO,input_audio:{data:h.base64Data,format:h.mimeType.includes("wav")?"wav":"mp3"}});const l=e.extra.filter(h=>h.type===Kr.PDF);for(const h of l)if(h.processedAsImages&&h.images)for(let p=0;p<h.images.length;p++)n.push({type:Zi.IMAGE_URL,image_url:{url:h.images[p]}});else n.push({type:Zi.TEXT,text:Tp(Mre,h.name,h.content)});const c=e.extra.filter(h=>h.type===Kr.MCP_PROMPT);for(const h of c)n.push({type:Zi.TEXT,text:Tp(Dre,h.name,h.content,h.serverName)});const u=e.extra.filter(h=>h.type===Kr.MCP_RESOURCE);for(const h of u)n.push({type:Zi.TEXT,text:Tp(Pre,h.name,h.content,h.serverName)});const d={role:e.role,content:n};return e.reasoningContent&&(d.reasoning_content=e.reasoningContent),t&&t.length>0&&(d.tool_calls=t),d}static async parseErrorResponse(e){try{const t=await e.text(),n=JSON.parse(t),a=n.error?.message||"Unknown server error",i=new Error(a);return i.name=e.status===400?"ServerError":"HttpError",n.error&&"n_prompt_tokens"in n.error&&"n_ctx"in n.error&&(i.contextInfo={n_prompt_tokens:n.error.n_prompt_tokens,n_ctx:n.error.n_ctx}),i}catch{const t=new Error(`Server error (${e.status}): ${e.statusText}`);return t.name="HttpError",t}}static extractModelName(e){const t=c=>typeof c=="object"&&c!==null?c:void 0,n=c=>typeof c=="string"&&c.trim()?c.trim():void 0,a=t(e);if(!a)return;const i=n(a.model);if(i)return i;const s=Array.isArray(a.choices)?t(a.choices[0]):void 0;if(!s)return;const o=n(t(s.delta)?.model);if(o)return o;const l=n(t(s.message)?.model);if(l)return l}static notifyTimings(e,t,n){!n||!e&&!t||n(e,t)}}class Hh{static async list(){return p3(o0.LIST)}static async listRouter(){return p3(o0.LIST)}static async load(e,t){const n={model:e};return t&&t.length>0&&(n.extra_args=t),wO(o0.LOAD,n)}static async unload(e){return wO(o0.UNLOAD,{model:e})}static isModelLoaded(e){return e.status.value===mi.LOADED}static isModelLoading(e){return e.status.value===mi.LOADING}static parseModelId(e){const t={raw:e,orgName:null,modelName:null,params:null,activatedParams:null,quantization:null,tags:[]},n=e.indexOf(lae);let a;n!==rc?(t.quantization=e.slice(n+1)||null,a=e.slice(0,n)):a=e;const i=a.indexOf(oae);let s;i!==rc?(t.orgName=a.slice(0,i),s=a.slice(i+1)):s=a;const o=s.lastIndexOf(".");if(o!==rc&&!t.quan Line truncated
p-0 md:h-[64vh] md:max-h-[64vh] md:min-h-0 md:rounded-lg`,children:(b,_)=>{pr(c5e(b,{onSave:i,get initialSection(){return e.initialSection}}),v=>M(n,v,!0),()=>f(n))},$$slots:{default:!0}})}),T(u,h)},$$slots:{default:!0}})}),T(r,s),we()}function Ju(r,e){Ee(e,!0);let t=Y(e,"ref",15,null),n=Ye(e,["$$slots","$$events","$$legacy","ref","class"]);var a=se(),i=L(a);{let s=F(()=>Kt("text-lg font-semibold",e.class));me(i,()=>q5,(o,l)=>{l(o,ot({"data-slot":"alert-dialog-title",get class(){return f(s)}},()=>n,{get ref(){return t()},set ref(c){t(c)}}))})}T(r,a),we()}function fh(r,e){Ee(e,!0);let t=Y(e,"ref",15,null),n=Ye(e,["$$slots","$$events","$$legacy","ref","class"]);var a=se(),i=L(a);{let s=F(()=>Kt(Sm(),e.class));me(i,()=>CQ,(o,l)=>{l(o,ot({"data-slot":"alert-dialog-action",get class(){return f(s)}},()=>n,{get ref(){return t()},set ref(c){t(c)}}))})}T(r,a),we()}function Px(r,e){Ee(e,!0);let t=Y(e,"ref",15,null),n=Ye(e,["$$slots","$$events","$$legacy","ref","class"]);var a=se(),i=L(a);{let s=F(()=>Kt(Sm({variant:"outline"}),e.class));me(i,()=>xQ,(o,l)=>{l(o,ot({"data-slot":"alert-dialog-cancel",get class(){return f(s)}},()=>n,{get ref(){return t()},set ref(c){t(c)}}))})}T(r,a),we()}var $Se=G("<div><!></div>");function ed(r,e){Ee(e,!0);let t=Y(e,"ref",15,null),n=Ye(e,["$$slots","$$events","$$legacy","ref","class","children"]);var a=$Se();zt(a,s=>({"data-slot":"alert-dialog-footer",class:s,...n}),[()=>Kt("mt-6 flex flex-row gap-2 sm:mt-0 sm:justify-end [&>*]:flex-1 sm:[&>*]:flex-none",e.class)]);var i=j(a);ke(i,()=>e.children??$e),V(a),pr(a,s=>t(s),()=>t()),T(r,a),we()}var GSe=G("<div><!></div>");function td(r,e){Ee(e,!0);let t=Y(e,"ref",15,null),n=Ye(e,["$$slots","$$events","$$legacy","ref","class","children"]);var a=GSe();zt(a,s=>({"data-slot":"alert-dialog-header",class:s,...n}),[()=>Kt("flex flex-col gap-2 text-center sm:text-left",e.class)]);var i=j(a);ke(i,()=>e.children??$e),V(a),pr(a,s=>t(s),()=>t()),T(r,a),we()}function jz(r,e){Ee(e,!0);let t=Y(e,"ref",15,null),n=Ye(e,["$$slots","$$events","$$legacy","ref","class"]);var a=se(),i=L(a);{let s=F(()=>Kt("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",e.class));me(i,()=>Av,(o,l)=>{l(o,ot({"data-slot":"alert-dialog-overlay",get class(){return f(s)}},()=>n,{get ref(){return t()},set ref(c){t(c)}}))})}T(r,a),we()}var zSe=G("<!> <!>",1);function rd(r,e){Ee(e,!0);let t=Y(e,"ref",15,null),n=Ye(e,["$$slots","$$events","$$legacy","ref","class","portalProps"]);var a=se(),i=L(a);me(i,()=>Jc,(s,o)=>{o(s,ot(()=>e.portalProps,{children:(l,c)=>{var u=zSe(),d=L(u);jz(d,{});var h=ee(d,2);{let p=F(()=>Kt("fixed z-[999999] grid w-full gap-4 border bg-background p-6 shadow-lg duration-200","right-0 bottom-0 left-0 max-h-[100dvh] translate-x-0 translate-y-0 overflow-y-auto rounded-t-lg","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-bottom-full","data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:slide-in-from-bottom-full","sm:top-[50%] sm:right-auto sm:bottom-auto sm:left-[50%] sm:max-h-[100vh] sm:max-w-lg sm:translate-x-[-50%] sm:translate-y-[-50%] sm:rounded-lg","sm:data-[state=closed]:slide-out-to-bottom-0 sm:data-[state=closed]:zoom-out-95","sm:data-[state=open]:slide-in-from-bottom-0 sm:data-[state=open]:zoom-in-95",e.class));me(h,()=>MZ,(m,g)=>{g(m,ot({"data-slot":"alert-dialog-content",get class(){return f(p)}},()=>n,{get ref(){return t()},set ref(b){t(b)}}))})}T(l,u)},$$slots:{default:!0}}))}),T(r,a),we()}function nd(r,e){Ee(e,!0);let t=Y(e,"ref",15,null),n=Ye(e,["$$slots","$$events","$$legacy","ref","class"]);var a=se(),i=L(a);{let s=F(()=>Kt("text-sm text-muted-foreground",e.class));me(i,()=>l9,(o,l)=>{l(o,ot({"data-slot":"alert-dialog-description",get class(){return f(s)}},()=>n,{get ref(){return t()},set ref(c){t(c)}}))})}T(r,a),we()}const ad=EQ,qSe=Jc;var HSe=G("<!> ",1),VSe=G("<!> <!>",1),YSe=G("<!> <!>",1),WSe=G("<!> <!> <!>",1);function eh(r,e){Ee(e,!0);let t=Y(e,"confirmText",3,"Confirm"),n=Y(e,"cancelText",3,"Cancel"),a=Y(e,"variant",3,"default");function i(c){c.key===Tn.ENTER&&(c.preventDefault(),e.onConfirm()),e.onKeydown?.(c)}function s(c){c||e.onCancel()}var o=se(),l=L(o);me(l,()=>ad,(c,u)=>{u(c,{get open(){return e.open},onOpenChange:s,children:(d,h)=>{var p=se(),m=L(p);me(m,()=>rd,(g,b)=>{b(g,{onkeydown:i,children:(_,v)=>{var y=WSe(),E=L(y);me(E,()=>td,(x,N)=>{N(x,{children:(I,D)=>{var H=VSe(),q=L(H);me(q,()=>Ju,(K,z)=>{z(K,{class:"flex items-center gap-2",children:(re,W)=>{var ie=HSe(),k=L(ie);{var B=O=>{const R=F(()=>e.icon);var U=se(),Q=L(U);{let ne=F(()=>a()==="destructive"?"text-destructive":"");me(Q,()=>f(R),(ue,he)=>{he(ue,{get class(){return`h-5 w-5 ${f(ne)??""}`}})})}T(O,U)};le(k,O=>{e.icon&&O(B)})}var te=ee(k);Ce(()=>Ge(te,` ${e.title??""}`)),T(re,ie)},$$slots:{default:!0}})});var $=ee(q,2);me($,()=>nd,(K,z)=>{z(K,{children:(re,W)=>{et();var ie=Ot();Ce(()=>Ge(ie,e.des Line truncated
as a JSON file.`);T(ne,ue)},Q=ne=>{var ue=Ot(`Choose which conversations you want to import. Selected conversations will be merged
with your existing conversations.`);T(ne,ue)};le(R,ne=>{e.mode==="export"?ne(U):ne(Q,!1)})}T(B,O)},$$slots:{default:!0}})}),T($,z)},$$slots:{default:!0}})});var D=ee(I,2);pr(QCe(D,{get conversations(){return e.conversations},get messageCountMap(){return t()},get mode(){return e.mode},get onCancel(){return e.onCancel},get onConfirm(){return e.onConfirm}}),H=>M(a,H,!0),()=>f(a)),T(C,N)},$$slots:{default:!0}})}),T(b,v)},$$slots:{default:!0}})}),T(u,h)},$$slots:{default:!0}})}),T(r,s),we()}var xEe=G('<div data-slot="table-container" class="relative w-full overflow-x-auto"><table><!></table></div>');function REe(r,e){Ee(e,!0);let t=Y(e,"ref",15,null),n=Ye(e,["$$slots","$$events","$$legacy","ref","class","children"]);var a=xEe(),i=j(a);zt(i,o=>({"data-slot":"table",class:o,...n}),[()=>Kt("w-full caption-bottom text-sm",e.class)]);var s=j(i);ke(s,()=>e.children??$e),V(i),pr(i,o=>t(o),()=>t()),V(a),T(r,a),we()}var OEe=G("<tbody><!></tbody>");function NEe(r,e){Ee(e,!0);let t=Y(e,"ref",15,null),n=Ye(e,["$$slots","$$events","$$legacy","ref","class","children"]);var a=OEe();zt(a,s=>({"data-slot":"table-body",class:s,...n}),[()=>Kt("[&_tr:last-child]:border-0",e.class)]);var i=j(a);ke(i,()=>e.children??$e),V(a),pr(a,s=>t(s),()=>t()),T(r,a),we()}var IEe=G("<td><!></td>");function aa(r,e){Ee(e,!0);let t=Y(e,"ref",15,null),n=Ye(e,["$$slots","$$events","$$legacy","ref","class","children"]);var a=IEe();zt(a,s=>({"data-slot":"table-cell",class:s,...n}),[()=>Kt("bg-clip-padding p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pe-0",e.class)]);var i=j(a);ke(i,()=>e.children??$e),V(a),pr(a,s=>t(s),()=>t()),T(r,a),we()}var kEe=G("<th><!></th>");function qD(r,e){Ee(e,!0);let t=Y(e,"ref",15,null),n=Ye(e,["$$slots","$$events","$$legacy","ref","class","children"]);var a=kEe();zt(a,s=>({"data-slot":"table-head",class:s,...n}),[()=>Kt("h-10 bg-clip-padding px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pe-0",e.class)]);var i=j(a);ke(i,()=>e.children??$e),V(a),pr(a,s=>t(s),()=>t()),T(r,a),we()}var MEe=G("<thead><!></thead>");function DEe(r,e){Ee(e,!0);let t=Y(e,"ref",15,null),n=Ye(e,["$$slots","$$events","$$legacy","ref","class","children"]);var a=MEe();zt(a,s=>({"data-slot":"table-header",class:s,...n}),[()=>Kt("[&_tr]:border-b",e.class)]);var i=j(a);ke(i,()=>e.children??$e),V(a),pr(a,s=>t(s),()=>t()),T(r,a),we()}var PEe=G("<tr><!></tr>");function _s(r,e){Ee(e,!0);let t=Y(e,"ref",15,null),n=Ye(e,["$$slots","$$events","$$legacy","ref","class","children"]);var a=PEe();zt(a,s=>({"data-slot":"table-row",class:s,...n}),[()=>Kt("border-b transition-colors data-[state=selected]:bg-muted hover:[&,&>svelte-css-wrapper]:[&>th,td]:bg-muted/50",e.class)]);var i=j(a);ke(i,()=>e.children??$e),V(a),pr(a,s=>t(s),()=>t()),T(r,a),we()}var LEe=G("<!> <!>",1),FEe=G('<div class="flex items-center justify-center py-8"><div class="text-sm text-muted-foreground">Loading model information...</div></div>'),BEe=G('<div class="inline-flex items-center gap-2"><span class="resizable-text-container min-w-0 flex-1 truncate"> </span> <!></div>'),UEe=G("<!> <!>",1),$Ee=G('<span class="resizable-text-container min-w-0 flex-1 truncate"> </span> <!>',1),GEe=G("<!> <!>",1),zEe=G("<!> <!>",1),qEe=G("<!> <!>",1),HEe=G("<!> <!>",1),VEe=G("<!> <!>",1),YEe=G("<!> <!>",1),WEe=G("<!> <!>",1),jEe=G("<!> <!>",1),KEe=G("<!> <!>",1),XEe=G("<!> <!>",1),QEe=G('<div class="flex flex-wrap gap-1"><!></div>'),ZEe=G("<!> <!>",1),JEe=G("<!> <!>",1),e2e=G('<div class="rounded-md bg-muted p-4"><pre class="font-mono text-xs whitespace-pre-wrap"> </pre></div>'),t2e=G("<!> <!>",1),r2e=G("<!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!>",1),n2e=G("<!> <!>",1),a2e=G('<div class="flex items-center justify-center py-8"><div class="text-sm text-muted-foreground">No model information available</div></div>'),i2e=G(`<style>@container (max-width: 56rem) {
`)}`,this.#d();const d=new Range;let h=Math.sumPrecise(c.map(m=>m.length));for(const{firstChild:m}of this.editorDiv.childNodes)if(m.nodeType===Node.TEXT_NODE){const f=m.nodeValue.length;if(h<=f){d.setStart(m,h),d.setEnd(m,h);break}h-=f}i.removeAllRanges(),i.addRange(d)}#d(){if(this.editorDiv.replaceChildren(),!!this.#t)for(const e of this.#t.split(`
`)){const r=document.createElement("div");r.append(e?document.createTextNode(e):document.createElement("br")),this.editorDiv.append(r)}}#u(){return this.#t.replaceAll(" "," ")}static#m(e){return e.replaceAll(" "," ")}get contentDiv(){return this.editorDiv}static async deserialize(e,r,n){let a=null;if(e instanceof Fz){const{data:{defaultAppearanceData:{fontSize:s,fontColor:o},rect:l,rotation:c,id:u,popupRef:d,contentsObj:h},textContent:m,textPosition:f,parent:{page:{pageNumber:g}}}=e;if(!m||m.length===0)return null;a=e={annotationType:Jr.FREETEXT,color:Array.from(o),fontSize:s,value:m.join(`
`),position:f,pageIndex:g-1,rect:l.slice(0),rotation:c,annotationElementId:u,id:u,deleted:!1,popupRef:d,comment:h?.str||null}}const i=await super.deserialize(e,r,n);return i.#i=e.fontSize,i.#e=kr.makeHexColor(...e.color),i.#t=oi.#m(e.value),i._initialData=a,e.comment&&i.setCommentData(e.comment),i}serialize(e=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const r=oi._internalPadding*this.parentScale,n=this.getRect(r,r),a=Fr._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.#e),i={annotationType:Jr.FREETEXT,color:a,fontSize:this.#i,value:this.#u(),pageIndex:this.pageIndex,rect:n,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return this.addComment(i),e?(i.isCopy=!0,i):this.annotationElementId&&!this.#f(i)?null:(i.id=this.annotationElementId,i)}#f(e){const{value:r,fontSize:n,color:a,pageIndex:i}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||e.value!==r||e.fontSize!==n||e.color.some((s,o)=>s!==a[o])||e.pageIndex!==i}renderAnnotationElement(e){const r=super.renderAnnotationElement(e),{style:n}=r;n.fontSize=`calc(${this.#i}px * var(--total-scale-factor))`,n.color=this.#e,r.replaceChildren();for(const s of this.#t.split(`
`)){const o=document.createElement("div");o.append(s?document.createTextNode(s):document.createElement("br")),r.append(o)}const a=oi._internalPadding*this.parentScale,i={rect:this.getRect(a,a)};return i.popup=this.hasEditedComment?this.comment:{text:this.#t},e.updateEdited(i),r}resetAnnotationElement(e){super.resetAnnotationElement(e),e.resetEdited()}}class Sr{static PRECISION=1e-4;toSVGPath(){Jn("Abstract method `toSVGPath` must be implemented.")}get box(){Jn("Abstract getter `box` must be implemented.")}serialize(e,r){Jn("Abstract method `serialize` must be implemented.")}static _rescale(e,r,n,a,i,s){s||=new Float32Array(e.length);for(let o=0,l=e.length;o<l;o+=2)s[o]=r+e[o]*a,s[o+1]=n+e[o+1]*i;return s}static _rescaleAndSwap(e,r,n,a,i,s){s||=new Float32Array(e.length);for(let o=0,l=e.length;o<l;o+=2)s[o]=r+e[o+1]*a,s[o+1]=n+e[o]*i;return s}static _translate(e,r,n,a){a||=new Float32Array(e.length);for(let i=0,s=e.length;i<s;i+=2)a[i]=r+e[i],a[i+1]=n+e[i+1];return a}static svgRound(e){return Math.round(e*1e4)}static _normalizePoint(e,r,n,a,i){switch(i){case 90:return[1-r/n,e/a];case 180:return[1-e/n,1-r/a];case 270:return[r/n,1-e/a];default:return[e/n,r/a]}}static _normalizePagePoint(e,r,n){switch(n){case 90:return[1-r,e];case 180:return[1-e,1-r];case 270:return[r,1-e];default:return[e,r]}}static createBezierPoints(e,r,n,a,i,s){return[(e+5*n)/6,(r+5*a)/6,(5*n+i)/6,(5*a+s)/6,(n+i)/2,(a+s)/2]}}class Kd{#e;#t=[];#r;#n;#i=[];#a=new Float32Array(18);#s;#o;#l;#c;#d;#u;#m=[];static#f=8;static#p=2;static#h=Kd.#f+Kd.#p;constructor({x:e,y:r},n,a,i,s,o=0){this.#e=n,this.#u=i*a,this.#n=s,this.#a.set([NaN,NaN,NaN,NaN,e,r],6),this.#r=o,this.#c=Kd.#f*a,this.#l=Kd.#h*a,this.#d=a,this.#m.push(e,r)}isEmpty(){return isNaN(this.#a[8])}#g(){const e=this.#a.subarray(4,6),r=this.#a.subarray(16,18),[n,a,i,s]=this.#e;return[(this.#s+(e[0]-r[0])/2-n)/i,(this.#o+(e[1]-r[1])/2-a)/s,(this.#s+(r[0]-e[0])/2-n)/i,(this.#o+(r[1]-e[1])/2-a)/s]}add({x:e,y:r}){this.#s=e,this.#o=r;const[n,a,i,s]=this.#e;let[o,l,c,u]=this.#a.subarray(8,12);const d=e-c,h=r-u,m=Math.hypot(d,h);if(m<this.#l)return!1;const f=m-this.#c,g=f/m,b=g*d,_=g*h;let S=o,E=l;o=c,l=u,c+=b,u+=_,this.#m?.push(e,r);const y=-_/f,v=b/f,T=y*this.#u,w=v*this.#u;return this.#a.set(this.#a.subarray(2,8),0),this.#a.set([c+T,u+w],4),this.#a.set(this.#a.subarray(14,18),12),this.#a.set([c-T,u-w],16),isNaN(this.#a[6])?(this.#i.length===0&&(this.#a.set([o+T,l+w],2),this.#i.push(NaN,NaN,NaN,NaN,(o+T-n)/i,(l+w-a)/s),this.#a.set([o-T,l-w],14),this.#t.push(NaN,NaN,NaN,NaN,(o-T-n)/i,(l-w-a)/s)),this.#a.set([S,E,o,l,c,u],6),!this.isEmpty()):(this.#a.set([S,E,o,l,c,u],6),Math.abs(Math.atan2(E-l,S-o)-Math.atan2(_,b))<Math.PI/2?([o,l,c,u]=this.#a.subarray(2,6),this.#i.push(NaN,NaN,NaN,NaN,((o+c)/2-n)/i,((l+u)/2-a)/s),[o,l,S,E]=this.#a.subarray(14,18),this.#t.push(NaN,NaN,NaN,NaN,((S+o)/2-n)/i,((E+l)/2-a)/s),!0):([S,E,o,l,c,u]=this.#a.subarray(0,6),this.#i.push(((S+5*o)/6-n)/i,((E+5*l)/6-a)/s,((5*o+c)/6-n)/i,((5*l+u)/6-a)/s,((o+c)/2-n)/i,((l+u)/2-a)/s),[c,u,o,l,S,E]=this.#a.subarray(12,18),this.#t.push(((S+5*o)/6-n)/i,((E+5*l)/6-a)/s,((5*o+c)/6-n)/i,((5*l+u)/6-a)/s,((o+c)/2-n)/i,((l+u)/2-a)/s),!0))}toSVGPath(){if(this.isEmpty())return"";const e=this.#i,r=this.#t;if(isNaN(this.#a[6])&&!this.isEmpty())return this.#S();const n=[];n.push(`M${e[4]} ${e[5]}`);for(let a=6;a<e.length;a+=6)isNaN(e[a])?n.push(`L${e[a+4]} ${e[a+5]}`):n.push(`C${e[a]} ${e[a+1]} ${e[a+2]} ${e[a+3]} ${e[a+4]} ${e[a+5]}`);this.#E(n);for(let a=r.length-6;a>=6;a-=6)isNaN(r[a])?n.push(`L${r[a+4]} ${r[a+5]}`):n.push(`C${r[a]} ${r[a+1]} ${r[a+2]} ${r[a+3]} ${r[a+4]} ${r[a+5]}`);return this.#_(n),n.join(" ")}#S(){const[e,r,n,a]=this.#e,[i,s,o,l]=this.#g();return`M${(this.#a[2]-e)/n} ${(this.#a[3]-r)/a} L${(this.#a[4]-e)/n} ${(this.#a[5]-r)/a} L${i} ${s} L${o} ${l} L${(this.#a[16]-e)/n} ${(this.#a[17]-r)/a} L${(this.#a[14]-e)/n} ${(this.#a[15]-r)/a} Z`}#_(e){const r=this.#t;e.push(`L${r[4]} ${r[5]} Z`)}#E(e){const[r,n,a,i]=this.#e,s=this.#a.subarray(4,6),o=this.#a.subarray(16,18),[l,c,u,d]=this.#g();e.push(`L${(s[0]-r)/a} ${(s[1]-n)/i} L${l} ${c} L${u} ${d} L${(o[0]-r)/a} ${(o[1]-n)/i}`)}newFreeDrawOutline(e,r,n,a,i,s){return new qz(e,r,n,a,i,s)}getOutlines(){const e=this.#i,r=this.#t,n=this.#a,[a,i,s,o]=this.#e,l=new Float32Array((this.#m?.length??0)+2);for(let d=0,h=l.length-2;d<h;d+=2)l[d]=(this.#m[d]-a)/s,l[d+1]=(this.#m[d+1]-i)/o;if(l[l.length-2]=(this.#s-a)/s,l[l.length-1]=(this.#o-i)/o,isNaN(n[6])&&!this.isEmpty())return this.#v(l);const c=new Float32Array(this.#i.length+24+this.#t.length);let u=e.length;for(let d=0;d<u;d+=2){if(isNaN(e[d])){c[d]=c[d+1]=NaN;continue}c[d]=e[d],c[d+1]=e[d+1]}u=this.#T(c,u);for(let d=r.length-6;d>=6;d-=6)for(let h=0;h<6;h+=2){if(isNaN(r[d+h])){c[u]=c[u+1]=NaN,u+=2;continue}c[u]=r[d+h],c[u+1]=r[d+h+1],u+=2}return this.#b(c,u),this.newFreeDrawOutline(c,l,this.#e,this.#d,this.#r,this.#n)}#v(e){const r=this.#a,[n,a,i,s]=this.#e,[o,l,c,u]=this.#g(),d=new Float32Array(36);return d.set([NaN,NaN,NaN,NaN,(r[2] Line truncated
`)}catch(e){throw console.error("Error converting PDF to text:",e),new Error(`Failed to convert PDF to text: ${e instanceof Error?e.message:"Unknown error"}`)}}async function Hz(t,e=1.5){try{const r=await $z(t),n=await Ax(r).promise,a=[];for(let i=1;i<=n.numPages;i++){const s=await n.getPage(i),o=s.getViewport({scale:e}),l=document.createElement("canvas"),c=l.getContext("2d");if(l.width=o.width,l.height=o.height,!c)throw new Error("Failed to get 2D context from canvas");const u=s.render({canvasContext:c,viewport:o,canvas:l});a.push(u.promise.then(()=>l.toDataURL(ta.PNG)))}return await Promise.all(a)}catch(r){throw console.error("Error converting PDF to images:",r),new Error(`Failed to convert PDF to images: ${r instanceof Error?r.message:"Unknown error"}`)}}function Yz(t,e="white"){return new Promise((r,n)=>{try{const a=new Image;a.onload=()=>{const i=document.createElement("canvas"),s=i.getContext("2d");if(!s){n(new Error("Failed to get 2D canvas context."));return}const o=a.naturalWidth||300,l=a.naturalHeight||300;i.width=o,i.height=l,e&&(s.fillStyle=e,s.fillRect(0,0,i.width,i.height)),s.drawImage(a,0,0,o,l),r(i.toDataURL(ta.PNG))},a.onerror=()=>{n(new Error("Failed to load SVG image. Ensure the SVG data is valid."))},a.src=t}catch(a){const s=`Error converting SVG to PNG: ${a instanceof Error?a.message:String(a)}`;console.error(s,a),n(new Error(s))}})}function Vz(t){return t===ta.SVG}function Wz(t,e="white"){return new Promise((r,n)=>{try{const a=new Image;a.onload=()=>{const i=document.createElement("canvas"),s=i.getContext("2d");if(!s){n(new Error("Failed to get 2D canvas context."));return}const o=a.naturalWidth||300,l=a.naturalHeight||300;i.width=o,i.height=l,e&&(s.fillStyle=e,s.fillRect(0,0,i.width,i.height)),s.drawImage(a,0,0,o,l),r(i.toDataURL(ta.PNG))},a.onerror=()=>{n(new Error("Failed to load WebP image. Ensure the WebP data is valid."))},a.src=t}catch(a){const s=`Error converting WebP to PNG: ${a instanceof Error?a.message:String(a)}`;console.error(s,a),n(new Error(s))}})}function Kz(t){return t===ta.WEBP}class is{static async sendMessage(e,r={},n,a){const{stream:i,onChunk:s,onComplete:o,onError:l,onReasoningChunk:c,onToolCallChunk:u,onModel:d,onTimings:h,tools:m,temperature:f,max_tokens:g,dynatemp_range:b,dynatemp_exponent:_,top_k:S,top_p:E,min_p:y,xtc_probability:v,xtc_threshold:T,typ_p:w,repeat_last_n:A,repeat_penalty:I,presence_penalty:x,frequency_penalty:D,dry_multiplier:$,dry_base:H,dry_allowed_length:G,dry_penalty_last_n:K,samplers:z,backend_sampling:re,custom:W,timings_per_token:ie,disableReasoningParsing:M,excludeReasoningFromContext:B}=r,J=e.map(O=>{if("id"in O&&"convId"in O&&"timestamp"in O){const U=O;return is.convertDbMessageToApiChatMessageData(U)}else return O}).filter(O=>O.role===tr.SYSTEM?(typeof O.content=="string"?O.content:"").trim().length>0:!0);r.model&&!ar.modelSupportsVision(r.model)&&J.forEach(O=>{Array.isArray(O.content)&&(O.content=O.content.filter(U=>U.type===ts.IMAGE_URL?(console.info(`[ChatService] Skipping image attachment in message history (model "${r.model}" does not support vision)`),!1):!0),O.content.length===1&&O.content[0].type===ts.TEXT&&(O.content=O.content[0].text))});const N={messages:J.map(O=>{const U={role:O.role,content:O.content,tool_calls:O.tool_calls,tool_call_id:O.tool_call_id};return!B&&O.reasoning_content&&(U.reasoning_content=O.reasoning_content),U}),stream:i,return_progress:i?!0:void 0,tools:m&&m.length>0?m:void 0};if(r.model&&(N.model=r.model),N.reasoning_format=M?pR.NONE:pR.AUTO,f!==void 0&&(N.temperature=f),g!==void 0&&(N.max_tokens=g!==null&&g!==0?g:-1),b!==void 0&&(N.dynatemp_range=b),_!==void 0&&(N.dynatemp_exponent=_),S!==void 0&&(N.top_k=S),E!==void 0&&(N.top_p=E),y!==void 0&&(N.min_p=y),v!==void 0&&(N.xtc_probability=v),T!==void 0&&(N.xtc_threshold=T),w!==void 0&&(N.typ_p=w),A!==void 0&&(N.repeat_last_n=A),I!==void 0&&(N.repeat_penalty=I),x!==void 0&&(N.presence_penalty=x),D!==void 0&&(N.frequency_penalty=D),$!==void 0&&(N.dry_multiplier=$),H!==void 0&&(N.dry_base=H),G!==void 0&&(N.dry_allowed_length=G),K!==void 0&&(N.dry_penalty_last_n=K),z!==void 0&&(N.samplers=typeof z=="string"?z.split(";").filter(O=>O.trim()):z),re!==void 0&&(N.backend_sampling=re),ie!==void 0&&(N.timings_per_token=ie),W)try{const O=typeof W=="string"?JSON.parse(W):W;Object.assign(N,O)}catch(O){console.warn("Failed to parse custom parameters:",O)}try{const O=await fetch("./v1/chat/completions",{method:"POST",headers:xI(),body:JSON.stringify(N),signal:a});if(!O.ok){const U=await is.parseErrorResponse(O);throw l&&l(U),U}if(i){await is.handleStreamResponse(O,s,o,l,c,u,d,h,n,a);return}else return is.handleNonStreamResponse(O,o,l,u,d)}catch(O){if(Rl(O)){console.log("Chat completion request was aborted");return}let U;throw O instanceof Error?O.name==="TypeError"&&O.message.includes("fetch")?(U=new Error("Unable to connect to server - please check if the server is running"),U.name="NetworkError"):O.message.includes("ECONNREFUSED")?(U=new Error("Connection refused - se Line truncated
`);w=x.pop()||"";for(const D of x){if(u?.aborted)break;if(D.startsWith(ho.DATA)){const $=D.slice(6);if($==="[DONE]"){_=!0;continue}try{const H=JSON.parse($),G=H.choices[0]?.delta?.content,K=H.choices[0]?.delta?.reasoning_content,z=H.choices[0]?.delta?.tool_calls,re=H.timings,W=H.prompt_progress,ie=is.extractModelName(H);ie&&!S&&(S=!0,o?.(ie)),W&&is.notifyTimings(void 0,W,l),re&&(is.notifyTimings(re,W,l),b=re),G&&(v(),m+=G,u?.aborted||r?.(G)),K&&(v(),f+=K,u?.aborted||i?.(K)),T(z)}catch(H){console.error("Error parsing JSON chunk:",H)}}}if(u?.aborted)break}if(u?.aborted)return;if(_){v();const A=g.length>0?JSON.stringify(g):void 0;n?.(m,f||void 0,b,A)}}catch(w){const A=w instanceof Error?w:new Error("Stream error");throw a?.(A),A}finally{d.releaseLock()}}static async handleNonStreamResponse(e,r,n,a,i){try{const s=await e.text();if(!s.trim())throw new Error("No response received from server. Please try again.");const o=JSON.parse(s),l=is.extractModelName(o);l&&i?.(l);const c=o.choices[0]?.message?.content||"",u=o.choices[0]?.message?.reasoning_content,d=o.choices[0]?.message?.tool_calls;let h;if(d&&d.length>0){const m=is.mergeToolCallDeltas([],d);m.length>0&&(h=JSON.stringify(m),h&&a?.(h))}if(!c.trim()&&!h)throw new Error("No response received from server. Please try again.");return r?.(c,u,void 0,h),c}catch(s){const o=s instanceof Error?s:new Error("Parse error");throw n?.(o),o}}static mergeToolCallDeltas(e,r,n=0){const a=e.map(i=>({...i,function:i.function?{...i.function}:void 0}));for(const i of r){const s=typeof i.index=="number"&&i.index>=0?i.index+n:a.length;for(;a.length<=s;)a.push({function:void 0});const o=a[s];if(i.id&&(o.id=i.id),i.type&&(o.type=i.type),i.function){const l=o.function?{...o.function}:{};i.function.name&&(l.name=i.function.name),i.function.arguments&&(l.arguments=(l.arguments??"")+i.function.arguments),o.function=l}}return a}static convertDbMessageToApiChatMessageData(e){if(e.role===tr.TOOL&&e.toolCallId)return{role:tr.TOOL,content:e.content,tool_call_id:e.toolCallId};let r;if(e.toolCalls)try{r=JSON.parse(e.toolCalls)}catch{}if(!e.extra||e.extra.length===0){const h={role:e.role,content:e.content};return e.reasoningContent&&(h.reasoning_content=e.reasoningContent),r&&r.length>0&&(h.tool_calls=r),h}const n=[];e.content&&n.push({type:ts.TEXT,text:e.content});const a=e.extra.filter(h=>h.type===Qr.IMAGE);for(const h of a)n.push({type:ts.IMAGE_URL,image_url:{url:h.base64Url}});const i=e.extra.filter(h=>h.type===Qr.TEXT);for(const h of i)n.push({type:ts.TEXT,text:wm("File",h.name,h.content)});const s=e.extra.filter(h=>h.type===Qr.LEGACY_CONTEXT);for(const h of s)n.push({type:ts.TEXT,text:wm("File",h.name,h.content)});const o=e.extra.filter(h=>h.type===Qr.AUDIO);for(const h of o)n.push({type:ts.INPUT_AUDIO,input_audio:{data:h.base64Data,format:h.mimeType.includes("wav")?"wav":"mp3"}});const l=e.extra.filter(h=>h.type===Qr.PDF);for(const h of l)if(h.processedAsImages&&h.images)for(let m=0;m<h.images.length;m++)n.push({type:ts.IMAGE_URL,image_url:{url:h.images[m]}});else n.push({type:ts.TEXT,text:wm(Ure,h.name,h.content)});const c=e.extra.filter(h=>h.type===Qr.MCP_PROMPT);for(const h of c)n.push({type:ts.TEXT,text:wm(Gre,h.name,h.content,h.serverName)});const u=e.extra.filter(h=>h.type===Qr.MCP_RESOURCE);for(const h of u)n.push({type:ts.TEXT,text:wm(qre,h.name,h.content,h.serverName)});const d={role:e.role,content:n};return e.reasoningContent&&(d.reasoning_content=e.reasoningContent),r&&r.length>0&&(d.tool_calls=r),d}static async parseErrorResponse(e){try{const r=await e.text(),n=JSON.parse(r),a=n.error?.message||"Unknown server error",i=new Error(a);return i.name=e.status===400?"ServerError":"HttpError",n.error&&"n_prompt_tokens"in n.error&&"n_ctx"in n.error&&(i.contextInfo={n_prompt_tokens:n.error.n_prompt_tokens,n_ctx:n.error.n_ctx}),i}catch{const r=new Error(`Server error (${e.status}): ${e.statusText}`);return r.name="HttpError",r}}static extractModelName(e){const r=c=>typeof c=="object"&&c!==null?c:void 0,n=c=>typeof c=="string"&&c.trim()?c.trim():void 0,a=r(e);if(!a)return;const i=n(a.model);if(i)return i;const s=Array.isArray(a.choices)?r(a.choices[0]):void 0;if(!s)return;const o=n(r(s.delta)?.model);if(o)return o;const l=n(r(s.message)?.model);if(l)return l}static notifyTimings(e,r,n){!n||!e&&!r||n(e,r)}}class Kh{static async list(){return bR(u_.LIST)}static async listRouter(){return bR(u_.LIST)}static async load(e,r){const n={model:e};return r&&r.length>0&&(n.extra_args=r),R5(u_.LOAD,n)}static async unload(e){return R5(u_.UNLOAD,{model:e})}static isModelLoaded(e){return e.status.value===bi.LOADED}static isModelLoading(e){return e.status.value===bi.LOADING}static parseModelId(e){const r={raw:e,orgName:null,modelName:null,params:null,activatedParams:null,quantization:null,tags:[]},n=e.indexOf(mae);let a;n!==lc?(r.quantization=e.slice(n+1)||null,a=e.slice(0,n)):a=e;const i=a.indexOf(pae);let s;i!==lc?(r.orgName=a.slice(0,i),s=a.slice(i+1)):s=a;const o=s.lastIndexOf(".");if(o!==lc&&!r.quan Line truncated
p-0 md:h-[64vh] md:max-h-[64vh] md:min-h-0 md:rounded-lg`,children:(b,_)=>{mr(fOe(b,{onSave:i,get initialSection(){return e.initialSection}}),S=>k(n,S,!0),()=>p(n))},$$slots:{default:!0}})}),C(u,h)},$$slots:{default:!0}})}),C(t,s),Te()}function id(t,e){ye(e,!0);let r=V(e,"ref",15,null),n=Ve(e,["$$slots","$$events","$$legacy","ref","class"]);var a=se(),i=L(a);{let s=F(()=>jt("text-lg font-semibold",e.class));fe(i,()=>WO,(o,l)=>{l(o,ot({"data-slot":"alert-dialog-title",get class(){return p(s)}},()=>n,{get ref(){return r()},set ref(c){r(c)}}))})}C(t,a),Te()}function Eh(t,e){ye(e,!0);let r=V(e,"ref",15,null),n=Ve(e,["$$slots","$$events","$$legacy","ref","class"]);var a=se(),i=L(a);{let s=F(()=>jt(Cf(),e.class));fe(i,()=>xX,(o,l)=>{l(o,ot({"data-slot":"alert-dialog-action",get class(){return p(s)}},()=>n,{get ref(){return r()},set ref(c){r(c)}}))})}C(t,a),Te()}function Ux(t,e){ye(e,!0);let r=V(e,"ref",15,null),n=Ve(e,["$$slots","$$events","$$legacy","ref","class"]);var a=se(),i=L(a);{let s=F(()=>jt(Cf({variant:"outline"}),e.class));fe(i,()=>MX,(o,l)=>{l(o,ot({"data-slot":"alert-dialog-cancel",get class(){return p(s)}},()=>n,{get ref(){return r()},set ref(c){r(c)}}))})}C(t,a),Te()}var Vve=q("<div><!></div>");function sd(t,e){ye(e,!0);let r=V(e,"ref",15,null),n=Ve(e,["$$slots","$$events","$$legacy","ref","class","children"]);var a=Vve();$t(a,s=>({"data-slot":"alert-dialog-footer",class:s,...n}),[()=>jt("mt-6 flex flex-row gap-2 sm:mt-0 sm:justify-end [&>*]:flex-1 sm:[&>*]:flex-none",e.class)]);var i=j(a);De(i,()=>e.children??Ge),Y(a),mr(a,s=>r(s),()=>r()),C(t,a),Te()}var Wve=q("<div><!></div>");function od(t,e){ye(e,!0);let r=V(e,"ref",15,null),n=Ve(e,["$$slots","$$events","$$legacy","ref","class","children"]);var a=Wve();$t(a,s=>({"data-slot":"alert-dialog-header",class:s,...n}),[()=>jt("flex flex-col gap-2 text-center sm:text-left",e.class)]);var i=j(a);De(i,()=>e.children??Ge),Y(a),mr(a,s=>r(s),()=>r()),C(t,a),Te()}function Zz(t,e){ye(e,!0);let r=V(e,"ref",15,null),n=Ve(e,["$$slots","$$events","$$legacy","ref","class"]);var a=se(),i=L(a);{let s=F(()=>jt("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",e.class));fe(i,()=>NS,(o,l)=>{l(o,ot({"data-slot":"alert-dialog-overlay",get class(){return p(s)}},()=>n,{get ref(){return r()},set ref(c){r(c)}}))})}C(t,a),Te()}var Kve=q("<!> <!>",1);function ld(t,e){ye(e,!0);let r=V(e,"ref",15,null),n=Ve(e,["$$slots","$$events","$$legacy","ref","class","portalProps"]);var a=se(),i=L(a);fe(i,()=>iu,(s,o)=>{o(s,ot(()=>e.portalProps,{children:(l,c)=>{var u=Kve(),d=L(u);Zz(d,{});var h=te(d,2);{let m=F(()=>jt("fixed z-[999999] grid w-full gap-4 border bg-background p-6 shadow-lg duration-200","right-0 bottom-0 left-0 max-h-[100dvh] translate-x-0 translate-y-0 overflow-y-auto rounded-t-lg","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-bottom-full","data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:slide-in-from-bottom-full","sm:top-[50%] sm:right-auto sm:bottom-auto sm:left-[50%] sm:max-h-[100vh] sm:max-w-lg sm:translate-x-[-50%] sm:translate-y-[-50%] sm:rounded-lg","sm:data-[state=closed]:slide-out-to-bottom-0 sm:data-[state=closed]:zoom-out-95","sm:data-[state=open]:slide-in-from-bottom-0 sm:data-[state=open]:zoom-in-95",e.class));fe(h,()=>UZ,(f,g)=>{g(f,ot({"data-slot":"alert-dialog-content",get class(){return p(m)}},()=>n,{get ref(){return r()},set ref(b){r(b)}}))})}C(l,u)},$$slots:{default:!0}}))}),C(t,a),Te()}function cd(t,e){ye(e,!0);let r=V(e,"ref",15,null),n=Ve(e,["$$slots","$$events","$$legacy","ref","class"]);var a=se(),i=L(a);{let s=F(()=>jt("text-sm text-muted-foreground",e.class));fe(i,()=>hN,(o,l)=>{l(o,ot({"data-slot":"alert-dialog-description",get class(){return p(s)}},()=>n,{get ref(){return r()},set ref(c){r(c)}}))})}C(t,a),Te()}const ud=OX,jve=iu;var Qve=q("<!> ",1),Xve=q("<!> <!>",1),Zve=q("<!> <!>",1),Jve=q("<!> <!> <!>",1);function oh(t,e){ye(e,!0);let r=V(e,"confirmText",3,"Confirm"),n=V(e,"cancelText",3,"Cancel"),a=V(e,"variant",3,"default");function i(c){c.key===Cn.ENTER&&(c.preventDefault(),e.onConfirm()),e.onKeydown?.(c)}function s(c){c||e.onCancel()}var o=se(),l=L(o);fe(l,()=>ud,(c,u)=>{u(c,{get open(){return e.open},onOpenChange:s,children:(d,h)=>{var m=se(),f=L(m);fe(f,()=>ld,(g,b)=>{b(g,{onkeydown:i,children:(_,S)=>{var E=Jve(),y=L(E);fe(y,()=>od,(A,I)=>{I(A,{children:(x,D)=>{var $=Xve(),H=L($);fe(H,()=>id,(K,z)=>{z(K,{class:"flex items-center gap-2",children:(re,W)=>{var ie=Qve(),M=L(ie);{var B=N=>{const O=F(()=>e.icon);var U=se(),X=L(U);{let ne=F(()=>a()==="destructive"?"text-destructive":"");fe(X,()=>p(O),(ue,he)=>{he(ue,{get class(){return`h-5 w-5 ${p(ne)??""}`}})})}C(N,U)};le(M,N=>{e.icon&&N(B)})}var J=te(M);we(()=>qe(J,` ${e.title??""}`)),C(re,ie)},$$slots:{default:!0}})});var G=te(H,2);fe(G,()=>cd,(K,z)=>{z(K,{children:(re,W)=>{et();var ie=Nt();we(()=>qe(ie,e.descr Line truncated
as a JSON file.`);C(ne,ue)},X=ne=>{var ue=Nt(`Choose which conversations you want to import. Selected conversations will be merged
with your existing conversations.`);C(ne,ue)};le(O,ne=>{e.mode==="export"?ne(U):ne(X,!1)})}C(B,N)},$$slots:{default:!0}})}),C(G,z)},$$slots:{default:!0}})});var D=te(x,2);mr(nRe(D,{get conversations(){return e.conversations},get messageCountMap(){return r()},get mode(){return e.mode},get onCancel(){return e.onCancel},get onConfirm(){return e.onConfirm}}),$=>k(a,$,!0),()=>p(a)),C(w,I)},$$slots:{default:!0}})}),C(b,S)},$$slots:{default:!0}})}),C(u,h)},$$slots:{default:!0}})}),C(t,s),Te()}var Mye=q('<div data-slot="table-container" class="relative w-full overflow-x-auto"><table><!></table></div>');function kye(t,e){ye(e,!0);let r=V(e,"ref",15,null),n=Ve(e,["$$slots","$$events","$$legacy","ref","class","children"]);var a=Mye(),i=j(a);$t(i,o=>({"data-slot":"table",class:o,...n}),[()=>jt("w-full caption-bottom text-sm",e.class)]);var s=j(i);De(s,()=>e.children??Ge),Y(i),mr(i,o=>r(o),()=>r()),Y(a),C(t,a),Te()}var Pye=q("<tbody><!></tbody>");function Lye(t,e){ye(e,!0);let r=V(e,"ref",15,null),n=Ve(e,["$$slots","$$events","$$legacy","ref","class","children"]);var a=Pye();$t(a,s=>({"data-slot":"table-body",class:s,...n}),[()=>jt("[&_tr:last-child]:border-0",e.class)]);var i=j(a);De(i,()=>e.children??Ge),Y(a),mr(a,s=>r(s),()=>r()),C(t,a),Te()}var Fye=q("<td><!></td>");function sa(t,e){ye(e,!0);let r=V(e,"ref",15,null),n=Ve(e,["$$slots","$$events","$$legacy","ref","class","children"]);var a=Fye();$t(a,s=>({"data-slot":"table-cell",class:s,...n}),[()=>jt("bg-clip-padding p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pe-0",e.class)]);var i=j(a);De(i,()=>e.children??Ge),Y(a),mr(a,s=>r(s),()=>r()),C(t,a),Te()}var Bye=q("<th><!></th>");function W7(t,e){ye(e,!0);let r=V(e,"ref",15,null),n=Ve(e,["$$slots","$$events","$$legacy","ref","class","children"]);var a=Bye();$t(a,s=>({"data-slot":"table-head",class:s,...n}),[()=>jt("h-10 bg-clip-padding px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pe-0",e.class)]);var i=j(a);De(i,()=>e.children??Ge),Y(a),mr(a,s=>r(s),()=>r()),C(t,a),Te()}var Uye=q("<thead><!></thead>");function Gye(t,e){ye(e,!0);let r=V(e,"ref",15,null),n=Ve(e,["$$slots","$$events","$$legacy","ref","class","children"]);var a=Uye();$t(a,s=>({"data-slot":"table-header",class:s,...n}),[()=>jt("[&_tr]:border-b",e.class)]);var i=j(a);De(i,()=>e.children??Ge),Y(a),mr(a,s=>r(s),()=>r()),C(t,a),Te()}var qye=q("<tr><!></tr>");function bs(t,e){ye(e,!0);let r=V(e,"ref",15,null),n=Ve(e,["$$slots","$$events","$$legacy","ref","class","children"]);var a=qye();$t(a,s=>({"data-slot":"table-row",class:s,...n}),[()=>jt("border-b transition-colors data-[state=selected]:bg-muted hover:[&,&>svelte-css-wrapper]:[&>th,td]:bg-muted/50",e.class)]);var i=j(a);De(i,()=>e.children??Ge),Y(a),mr(a,s=>r(s),()=>r()),C(t,a),Te()}var zye=q("<!> <!>",1),$ye=q('<div class="flex items-center justify-center py-8"><div class="text-sm text-muted-foreground">Loading model information...</div></div>'),Hye=q('<div class="inline-flex items-center gap-2"><span class="resizable-text-container min-w-0 flex-1 truncate"> </span> <!></div>'),Yye=q("<!> <!>",1),Vye=q('<span class="resizable-text-container min-w-0 flex-1 truncate"> </span> <!>',1),Wye=q("<!> <!>",1),Kye=q("<!> <!>",1),jye=q("<!> <!>",1),Qye=q("<!> <!>",1),Xye=q("<!> <!>",1),Zye=q("<!> <!>",1),Jye=q("<!> <!>",1),eTe=q("<!> <!>",1),tTe=q("<!> <!>",1),rTe=q("<!> <!>",1),nTe=q('<div class="flex flex-wrap gap-1"><!></div>'),aTe=q("<!> <!>",1),iTe=q("<!> <!>",1),sTe=q('<div class="rounded-md bg-muted p-4"><pre class="font-mono text-xs whitespace-pre-wrap"> </pre></div>'),oTe=q("<!> <!>",1),lTe=q("<!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!>",1),cTe=q("<!> <!>",1),uTe=q('<div class="flex items-center justify-center py-8"><div class="text-sm text-muted-foreground">No model information available</div></div>'),dTe=q(`<style>@container (max-width: 56rem) {
.resizable-text-container {
max-width: calc(100vw - var(--threshold));
}
}</style> <!> <div class="space-y-6 py-4"><!></div>`,1);function Qz(r,e){Ee(e,!0);let t=Y(e,"open",15),n=Y(e,"modelId",3,null),a=F(()=>Xn.isRouterMode),i=_e(null),s=_e(!1),o=F(()=>f(a)&&n()?f(i):Xn.props),l=F(()=>f(a)&&n()?n():rr.singleModelName),c=F(to),u=F(Ix),d=F(()=>f(a)&&n()?f(c).find(g=>g.model===n())??null:f(c)[0]??null),h=F(()=>f(d)?.id?rr.getModelModalitiesArray(f(d).id):[]);Nt(()=>{t()&&f(c).length===0&&rr.fetch()}),Nt(()=>{t()&&f(a)&&n()&&(M(s,!0),rr.fetchModelProps(n()).then(g=>{M(i,g,!0)}).catch(()=>{M(i,null)}).finally(()=>{M(s,!1)})),t()||M(i,null)});var p=se(),m=L(p);me(m,()=>hh,(g,b)=>{b(g,{get onOpenChange(){return e.onOpenChange},get open(){return t()},set open(_){t(_)},children:(_,v)=>{var y=se(),E=L(y);me(E,()=>dh,(S,w)=>{w(S,{class:"@container z-9999 !max-h-[80dvh] !max-w-[60rem] max-w-full",children:(C,x)=>{var N=i2e(),I=ee(L(N),2);me(I,()=>ap,(K,z)=>{z(K,{children:(re,W)=>{var ie=LEe(),k=L(ie);me(k,()=>np,(te,O)=>{O(te,{children:(R,U)=>{et();var Q=Ot("Model Information");T(R,Q)},$$slots:{default:!0}})});var B=ee(k,2);me(B,()=>ip,(te,O)=>{O(te,{children:(R,U)=>{et();var Q=Ot("Current model details and capabilities");T(R,Q)},$$slots:{default:!0}})}),T(re,ie)},$$slots:{default:!0}})});var D=ee(I,2),H=j(D);{var q=K=>{var z=FEe();T(K,z)},$=K=>{var z=se(),re=L(z);{var W=k=>{const B=F(()=>f(d).meta);var te=se(),O=L(te);{var R=U=>{var Q=se(),ne=L(Q);me(ne,()=>REe,(ue,he)=>{he(ue,{children:(be,Z)=>{var ae=n2e(),fe=L(ae);me(fe,()=>DEe,(ye,Te)=>{Te(ye,{children:(Oe,Ne)=>{var Ue=se(),Fe=L(Ue);me(Fe,()=>_s,(Ke,He)=>{He(Ke,{children:(it,st)=>{var dt=UEe(),Ae=L(dt);me(Ae,()=>qD,(ht,ze)=>{ze(ht,{class:"w-[10rem]",children:(mt,At)=>{et();var xt=Ot("Model");T(mt,xt)},$$slots:{default:!0}})});var Le=ee(Ae,2);me(Le,()=>qD,(ht,ze)=>{ze(ht,{children:(mt,At)=>{var xt=BEe(),qt=j(xt);ds(qt,"",{},{"--threshold":"12rem"});var ar=j(qt,!0);V(qt);var fr=ee(qt,2);{let ct=F(()=>f(l)||""),Rt=F(()=>!!f(l));Df(fr,{get text(){return f(ct)},get canCopy(){return f(Rt)},ariaLabel:"Copy model name to clipboard"})}V(xt),Ce(()=>Ge(ar,f(l))),T(mt,xt)},$$slots:{default:!0}})}),T(it,dt)},$$slots:{default:!0}})}),T(Oe,Ue)},$$slots:{default:!0}})});var pe=ee(fe,2);me(pe,()=>NEe,(ye,Te)=>{Te(ye,{children:(Oe,Ne)=>{var Ue=r2e(),Fe=L(Ue);me(Fe,()=>_s,(Et,It)=>{It(Et,{children:(xe,Qe)=>{var ft=GEe(),Ct=L(ft);me(Ct,()=>aa,(Dt,bt)=>{bt(Dt,{class:"h-10 align-middle font-medium",children:(wt,vt)=>{et();var kt=Ot("File Path");T(wt,kt)},$$slots:{default:!0}})});var Lt=ee(Ct,2);me(Lt,()=>aa,(Dt,bt)=>{bt(Dt,{class:"inline-flex h-10 items-center gap-2 align-middle font-mono text-xs",children:(wt,vt)=>{var kt=$Ee(),dr=L(kt);ds(dr,"",{},{"--threshold":"14rem"});var In=j(dr,!0);V(dr);var Er=ee(dr,2);Df(Er,{get text(){return f(o).model_path},ariaLabel:"Copy model path to clipboard"}),Ce(()=>Ge(In,f(o).model_path)),T(wt,kt)},$$slots:{default:!0}})}),T(xe,ft)},$$slots:{default:!0}})});var Ke=ee(Fe,2);{var He=Et=>{var It=se(),xe=L(It);me(xe,()=>_s,(Qe,ft)=>{ft(Qe,{children:(Ct,Lt)=>{var Dt=zEe(),bt=L(Dt);me(bt,()=>aa,(vt,kt)=>{kt(vt,{class:"h-10 align-middle font-medium",children:(dr,In)=>{et();var Er=Ot("Context Size");T(dr,Er)},$$slots:{default:!0}})});var wt=ee(bt,2);me(wt,()=>aa,(vt,kt)=>{kt(vt,{children:(dr,In)=>{et();var Er=Ot();Ce(Fn=>Ge(Er,`${Fn??""} tokens`),[()=>d0(f(o).default_generation_settings.n_ctx)]),T(dr,Er)},$$slots:{default:!0}})}),T(Ct,Dt)},$$slots:{default:!0}})}),T(Et,It)},it=Et=>{var It=se(),xe=L(It);me(xe,()=>_s,(Qe,ft)=>{ft(Qe,{children:(Ct,Lt)=>{var Dt=qEe(),bt=L(Dt);me(bt,()=>aa,(vt,kt)=>{kt(vt,{class:"h-10 align-middle font-medium text-red-500",children:(dr,In)=>{et();var Er=Ot("Context Size");T(dr,Er)},$$slots:{default:!0}})});var wt=ee(bt,2);me(wt,()=>aa,(vt,kt)=>{kt(vt,{class:"text-red-500",children:(dr,In)=>{et();var Er=Ot("Not available");T(dr,Er)},$$slots:{default:!0}})}),T(Ct,Dt)},$$slots:{default:!0}})}),T(Et,It)};le(Ke,Et=>{f(o)?.default_generation_settings?.n_ctx?Et(He):Et(it,!1)})}var st=ee(Ke,2);{var dt=Et=>{var It=se(),xe=L(It);me(xe,()=>_s,(Qe,ft)=>{ft(Qe,{children:(Ct,Lt)=>{var Dt=HEe(),bt=L(Dt);me(bt,()=>aa,(vt,kt)=>{kt(vt,{class:"h-10 align-middle font-medium",children:(dr,In)=>{et();var Er=Ot("Training Context");T(dr,Er)},$$slots:{default:!0}})});var wt=ee(bt,2);me(wt,()=>aa,(vt,kt)=>{kt(vt,{children:(dr,In)=>{et();var Er=Ot();Ce(Fn=>Ge(Er,`${Fn??""} tokens`),[()=>d0(f(B).n_ctx_train)]),T(dr,Er)},$$slots:{default:!0}})}),T(Ct,Dt)},$$slots:{default:!0}})}),T(Et,It)};le(st,Et=>{f(B)?.n_ctx_train&&Et(dt)})}var Ae=ee(st,2);{var Le=Et=>{var It=se(),xe=L(It);me(xe,()=>_s,(Qe,ft)=>{ft(Qe,{children:(Ct,Lt)=>{var Dt=VEe(),bt=L(Dt);me(bt,()=>aa,(vt,kt)=>{kt(vt,{class:"h-10 align-middle font-medium",children:(dr,In)=>{et();var Er=Ot("Model Size");T(dr,Er)},$$slots:{default:!0}})});var wt=ee(bt,2);me(wt,()=>aa,(vt,kt)=>{kt(vt,{children:(dr,In)=>{et();var Er=Ot();Ce(Fn=>Ge(Er,Fn),[()=>ub(f(B).size)]),T(dr,Er)},$$slots:{default:!0}})}),T(Ct,Dt)},$$slots:{default:!0}})}),T(Et,It)};le(Ae,Et=>{f(B)?.size&&Et(Le)})}vaLine truncated
transform: ${c} translate(${(1-g)*d}${h}, ${(1-g)*p}${m});
opacity: ${l-u*b}`}}function fTe(r,{delay:e=0,duration:t=400,easing:n=Hx,axis:a="y"}={}){const i=getComputedStyle(r),s=+i.opacity,o=a==="y"?"height":"width",l=parseFloat(i[o]),c=a==="y"?["top","bottom"]:["left","right"],u=c.map(_=>`${_[0].toUpperCase()}${_.slice(1)}`),d=parseFloat(i[`padding${u[0]}`]),h=parseFloat(i[`padding${u[1]}`]),p=parseFloat(i[`margin${u[0]}`]),m=parseFloat(i[`margin${u[1]}`]),g=parseFloat(i[`border${u[0]}Width`]),b=parseFloat(i[`border${u[1]}Width`]);return{delay:e,duration:t,easing:n,css:_=>`overflow: hidden;opacity: ${Math.min(_*20,1)*s};${o}: ${_*l}px;padding-${c[0]}: ${_*d}px;padding-${c[1]}: ${_*h}px;margin-${c[0]}: ${_*p}px;margin-${c[1]}: ${_*m}px;border-${c[0]}-width: ${_*g}px;border-${c[1]}-width: ${_*b}px;min-${o}: 0`}}function WD(r,{delay:e=0,duration:t=400,easing:n=Hx,start:a=0,opacity:i=0}={}){const s=getComputedStyle(r),o=+s.opacity,l=s.transform==="none"?"":s.transform,c=1-a,u=o*(1-i);return{delay:e,duration:t,easing:n,css:(d,h)=>`
}</style> <!> <div class="space-y-6 py-4"><!></div>`,1);function t$(t,e){ye(e,!0);let r=V(e,"open",15),n=V(e,"modelId",3,null),a=F(()=>Qn.isRouterMode),i=_e(null),s=_e(!1),o=F(()=>p(a)&&n()?p(i):Qn.props),l=F(()=>p(a)&&n()?n():ar.singleModelName),c=F(ao),u=F(Px),d=F(()=>p(a)&&n()?p(c).find(g=>g.model===n())??null:p(c)[0]??null),h=F(()=>p(d)?.id?ar.getModelModalitiesArray(p(d).id):[]);It(()=>{r()&&p(c).length===0&&ar.fetch()}),It(()=>{r()&&p(a)&&n()&&(k(s,!0),ar.fetchModelProps(n()).then(g=>{k(i,g,!0)}).catch(()=>{k(i,null)}).finally(()=>{k(s,!1)})),r()||k(i,null)});var m=se(),f=L(m);fe(f,()=>Sh,(g,b)=>{b(g,{get onOpenChange(){return e.onOpenChange},get open(){return r()},set open(_){r(_)},children:(_,S)=>{var E=se(),y=L(E);fe(y,()=>bh,(v,T)=>{T(v,{class:"@container z-9999 !max-h-[80dvh] !max-w-[60rem] max-w-full",children:(w,A)=>{var I=dTe(),x=te(L(I),2);fe(x,()=>om,(K,z)=>{z(K,{children:(re,W)=>{var ie=zye(),M=L(ie);fe(M,()=>sm,(J,N)=>{N(J,{children:(O,U)=>{et();var X=Nt("Model Information");C(O,X)},$$slots:{default:!0}})});var B=te(M,2);fe(B,()=>lm,(J,N)=>{N(J,{children:(O,U)=>{et();var X=Nt("Current model details and capabilities");C(O,X)},$$slots:{default:!0}})}),C(re,ie)},$$slots:{default:!0}})});var D=te(x,2),$=j(D);{var H=K=>{var z=$ye();C(K,z)},G=K=>{var z=se(),re=L(z);{var W=M=>{const B=F(()=>p(d).meta);var J=se(),N=L(J);{var O=U=>{var X=se(),ne=L(X);fe(ne,()=>kye,(ue,he)=>{he(ue,{children:(be,Z)=>{var ae=cTe(),pe=L(ae);fe(pe,()=>Gye,(Ee,Ce)=>{Ce(Ee,{children:(Ne,Ie)=>{var Ue=se(),Fe=L(Ue);fe(Fe,()=>bs,(je,He)=>{He(je,{children:(at,st)=>{var dt=Yye(),Ae=L(dt);fe(Ae,()=>W7,(ht,ze)=>{ze(ht,{class:"w-[10rem]",children:(ft,At)=>{et();var Rt=Nt("Model");C(ft,Rt)},$$slots:{default:!0}})});var Le=te(Ae,2);fe(Le,()=>W7,(ht,ze)=>{ze(ht,{children:(ft,At)=>{var Rt=Hye(),zt=j(Rt);ms(zt,"",{},{"--threshold":"12rem"});var ir=j(zt,!0);Y(zt);var hr=te(zt,2);{let lt=F(()=>p(l)||""),Ot=F(()=>!!p(l));Fp(hr,{get text(){return p(lt)},get canCopy(){return p(Ot)},ariaLabel:"Copy model name to clipboard"})}Y(Rt),we(()=>qe(ir,p(l))),C(ft,Rt)},$$slots:{default:!0}})}),C(at,dt)},$$slots:{default:!0}})}),C(Ne,Ue)},$$slots:{default:!0}})});var me=te(pe,2);fe(me,()=>Lye,(Ee,Ce)=>{Ce(Ee,{children:(Ne,Ie)=>{var Ue=lTe(),Fe=L(Ue);fe(Fe,()=>bs,(yt,xt)=>{xt(yt,{children:(Re,Xe)=>{var pt=Wye(),Ct=L(pt);fe(Ct,()=>sa,(kt,bt)=>{bt(kt,{class:"h-10 align-middle font-medium",children:(Tt,St)=>{et();var Dt=Nt("File Path");C(Tt,Dt)},$$slots:{default:!0}})});var Pt=te(Ct,2);fe(Pt,()=>sa,(kt,bt)=>{bt(kt,{class:"inline-flex h-10 items-center gap-2 align-middle font-mono text-xs",children:(Tt,St)=>{var Dt=Vye(),ur=L(Dt);ms(ur,"",{},{"--threshold":"14rem"});var On=j(ur,!0);Y(ur);var vr=te(ur,2);Fp(vr,{get text(){return p(o).model_path},ariaLabel:"Copy model path to clipboard"}),we(()=>qe(On,p(o).model_path)),C(Tt,Dt)},$$slots:{default:!0}})}),C(Re,pt)},$$slots:{default:!0}})});var je=te(Fe,2);{var He=yt=>{var xt=se(),Re=L(xt);fe(Re,()=>bs,(Xe,pt)=>{pt(Xe,{children:(Ct,Pt)=>{var kt=Kye(),bt=L(kt);fe(bt,()=>sa,(St,Dt)=>{Dt(St,{class:"h-10 align-middle font-medium",children:(ur,On)=>{et();var vr=Nt("Context Size");C(ur,vr)},$$slots:{default:!0}})});var Tt=te(bt,2);fe(Tt,()=>sa,(St,Dt)=>{Dt(St,{children:(ur,On)=>{et();var vr=Nt();we(Ln=>qe(vr,`${Ln??""} tokens`),[()=>m_(p(o).default_generation_settings.n_ctx)]),C(ur,vr)},$$slots:{default:!0}})}),C(Ct,kt)},$$slots:{default:!0}})}),C(yt,xt)},at=yt=>{var xt=se(),Re=L(xt);fe(Re,()=>bs,(Xe,pt)=>{pt(Xe,{children:(Ct,Pt)=>{var kt=jye(),bt=L(kt);fe(bt,()=>sa,(St,Dt)=>{Dt(St,{class:"h-10 align-middle font-medium text-red-500",children:(ur,On)=>{et();var vr=Nt("Context Size");C(ur,vr)},$$slots:{default:!0}})});var Tt=te(bt,2);fe(Tt,()=>sa,(St,Dt)=>{Dt(St,{class:"text-red-500",children:(ur,On)=>{et();var vr=Nt("Not available");C(ur,vr)},$$slots:{default:!0}})}),C(Ct,kt)},$$slots:{default:!0}})}),C(yt,xt)};le(je,yt=>{p(o)?.default_generation_settings?.n_ctx?yt(He):yt(at,!1)})}var st=te(je,2);{var dt=yt=>{var xt=se(),Re=L(xt);fe(Re,()=>bs,(Xe,pt)=>{pt(Xe,{children:(Ct,Pt)=>{var kt=Qye(),bt=L(kt);fe(bt,()=>sa,(St,Dt)=>{Dt(St,{class:"h-10 align-middle font-medium",children:(ur,On)=>{et();var vr=Nt("Training Context");C(ur,vr)},$$slots:{default:!0}})});var Tt=te(bt,2);fe(Tt,()=>sa,(St,Dt)=>{Dt(St,{children:(ur,On)=>{et();var vr=Nt();we(Ln=>qe(vr,`${Ln??""} tokens`),[()=>m_(p(B).n_ctx_train)]),C(ur,vr)},$$slots:{default:!0}})}),C(Ct,kt)},$$slots:{default:!0}})}),C(yt,xt)};le(st,yt=>{p(B)?.n_ctx_train&&yt(dt)})}var Ae=te(st,2);{var Le=yt=>{var xt=se(),Re=L(xt);fe(Re,()=>bs,(Xe,pt)=>{pt(Xe,{children:(Ct,Pt)=>{var kt=Xye(),bt=L(kt);fe(bt,()=>sa,(St,Dt)=>{Dt(St,{class:"h-10 align-middle font-medium",children:(ur,On)=>{et();var vr=Nt("Model Size");C(ur,vr)},$$slots:{default:!0}})});var Tt=te(bt,2);fe(Tt,()=>sa,(St,Dt)=>{Dt(St,{children:(ur,On)=>{et();var vr=Nt();we(Ln=>qe(vr,Ln),[()=>pb(p(B).size)]),C(ur,vr)},$$slots:{default:!0}})}),C(Ct,kt)},$$slots:{default:!0}})}),C(yt,xt)};le(Ae,yt=>{p(B)?.size&&yt(Le)})}var ht=tLine truncated
transform: ${c} translate(${(1-g)*d}${h}, ${(1-g)*m}${f});
opacity: ${l-u*b}`}}function Swe(t,{delay:e=0,duration:r=400,easing:n=Kx,axis:a="y"}={}){const i=getComputedStyle(t),s=+i.opacity,o=a==="y"?"height":"width",l=parseFloat(i[o]),c=a==="y"?["top","bottom"]:["left","right"],u=c.map(_=>`${_[0].toUpperCase()}${_.slice(1)}`),d=parseFloat(i[`padding${u[0]}`]),h=parseFloat(i[`padding${u[1]}`]),m=parseFloat(i[`margin${u[0]}`]),f=parseFloat(i[`margin${u[1]}`]),g=parseFloat(i[`border${u[0]}Width`]),b=parseFloat(i[`border${u[1]}Width`]);return{delay:e,duration:r,easing:n,css:_=>`overflow: hidden;opacity: ${Math.min(_*20,1)*s};${o}: ${_*l}px;padding-${c[0]}: ${_*d}px;padding-${c[1]}: ${_*h}px;margin-${c[0]}: ${_*m}px;margin-${c[1]}: ${_*f}px;border-${c[0]}-width: ${_*g}px;border-${c[1]}-width: ${_*b}px;min-${o}: 0`}}function X7(t,{delay:e=0,duration:r=400,easing:n=Kx,start:a=0,opacity:i=0}={}){const s=getComputedStyle(t),o=+s.opacity,l=s.transform==="none"?"":s.transform,c=1-a,u=o*(1-i);return{delay:e,duration:r,easing:n,css:(d,h)=>`
transform: ${l} scale(${1-c*h});
opacity: ${o-u*h}
`}}var pTe=G("<input/>"),mTe=G("<input/>");function cl(r,e){Ee(e,!0);let t=Y(e,"ref",15,null),n=Y(e,"value",15),a=Y(e,"files",15),i=Ye(e,["$$slots","$$events","$$legacy","ref","value","type","files","class"]);var s=se(),o=L(s);{var l=u=>{var d=pTe();zt(d,h=>({"data-slot":"input",class:h,type:"file",...i}),[()=>Kt("flex h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 pt-1.5 text-sm font-medium shadow-xs ring-offset-background transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",e.class)],void 0,void 0,void 0,!0),pr(d,h=>t(h),()=>t()),nj(d,a),mm(d,n),T(u,d)},c=u=>{var d=mTe();zt(d,h=>({"data-slot":"input",class:h,style:"backdrop-filter: blur(0.5rem);",type:e.type,...i}),[()=>Kt("flex h-9 w-full min-w-0 rounded-md border border-input bg-background px-3 py-1 text-base shadow-xs ring-offset-background transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",e.class)],void 0,void 0,void 0,!0),pr(d,h=>t(h),()=>t()),mm(d,n),T(u,d)};le(o,u=>{e.type==="file"?u(l):u(c,!1)})}T(r,s),we()}function Qo(r,e){Ee(e,!0);let t=Y(e,"ref",15,null),n=Ye(e,["$$slots","$$events","$$legacy","ref","class"]);var a=se(),i=L(a);{let s=F(()=>Kt("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e.class));me(i,()=>ite,(o,l)=>{l(o,ot({"data-slot":"label",get class(){return f(s)}},()=>n,{get ref(){return t()},set ref(c){t(c)}}))})}T(r,a),we()}var gTe=G('<span class="text-destructive">*</span>'),_Te=G('<span class="text-xs text-muted-foreground/50">...</span>'),bTe=G("<span> <!></span> <!>",1),vTe=G('<button type="button"> </button>'),yTe=G('<div class="absolute top-full right-0 left-0 z-10 mt-1 max-h-32 overflow-y-auto rounded-lg border border-border/50 bg-background shadow-lg"></div>'),STe=G('<div class="relative grid gap-1"><!> <!> <!></div>');function ETe(r,e){Ee(e,!0);let t=Y(e,"value",3,""),n=Y(e,"suggestions",19,()=>[]),a=Y(e,"isLoadingSuggestions",3,!1),i=Y(e,"isAutocompleteActive",3,!1),s=Y(e,"autocompleteIndex",3,0);var o=STe(),l=j(o);Qo(l,{get for(){return`arg-${e.argument.name??""}`},class:"mb-1 text-muted-foreground",children:(h,p)=>{var m=bTe(),g=L(m),b=j(g),_=ee(b);{var v=S=>{var w=gTe();T(S,w)};le(_,S=>{e.argument.required&&S(v)})}V(g);var y=ee(g,2);{var E=S=>{var w=_Te();T(S,w)};le(y,S=>{a()&&S(E)})}Ce(()=>Ge(b,`${e.argument.name??""} `)),T(h,m)},$$slots:{default:!0}});var c=ee(l,2);{let h=F(()=>e.argument.description||e.argument.name);cl(c,{get id(){return`arg-${e.argument.name??""}`},type:"text",get value(){return t()},oninput:p=>e.onInput(p.currentTarget.value),get onkeydown(){return e.onKeydown},get onblur(){return e.onBlur},get onfocus(){return e.onFocus},get placeholder(){return f(h)},get required(){return e.argument.required},autocomplete:"off"})}var u=ee(c,2);{var d=h=>{var p=yTe();Ir(p,22,n,m=>m,(m,g,b)=>{var _=vTe();_.__mousedown=()=>e.onSelectSuggestion(g);var v=j(_,!0);V(_),Ce(()=>{yt(_,1,`w-full px-3 py-1.5 text-left text-sm hover:bg-accent ${f(b)===s()?"bg-accent":""}`),Ge(v,g)}),T(m,_)}),V(p),ai(3,p,()=>Ko,()=>({y:-5,duration:100})),T(h,p)};le(u,h=>{i()&&n().length>0&&h(d)})}V(o),T(r,o),we()}Ln(["mousedown"]);var wTe=G('<div class="flex items-start gap-2 rounded-lg border border-destructive/50 bg-destructive/10 px-3 py-2 text-sm text-destructive" role="alert"><span class="shrink-0">⚠</span> <span> </span></div>'),TTe=G('<form class="space-y-3 pt-4"><!> <!> <div class="mt-8 flex justify-end gap-2"><!> <!></div></form>');function CTe(r,e){Ee(e,!0);var t=TTe(),n=j(t);Ir(n,17,()=>e.prompt.arguments??[],c=>c.name,(c,u)=>{{let d=F(()=>e.promptArgs[f(u).name]??""),h=F(()=>e.suggestions[f(u).name]??[]),p=F(()=>e.loadingSuggestions[f(u).name]??!1),m=F(()=>e.activeAutocomplete===f(u).name),g=F(()=>e.activeAutocomplete===f(u).name?e.autocompleteIndex:0);ETe(c,{get argument(){return f(u)},get value(){return f(d)},get suggestions(){return f(h)},get isLoadingSuggestions(){return f(p)},get isAutocompleteActive(){return f(m)},get autocompleteIndex(){return f(g)},onInput:b=>e.onArgInput(f(u).name,b),onKeydown:b=>e.onArgKeydown(b,f(u).name),onBlur:()=>e.onArgBlur(f(u).name),onFocus:()=>e.onArgFocus(f(u).name),onSelectSuggestion:b=>e.onSelectSuggestion(f(u).name,b)})}});var a=ee Line truncated
`)&&M(o,!0);const y=new ResizeObserver(E=>{for(const S of E){const w=S.target;M(o,w.offsetHeight>24*1.5),M(u,w.scrollHeight,!0)}});return y.observe(f(l)),()=>{y.disconnect()}});function m(){M(c,!f(c))}var g=I3e(),b=j(g);{var _=y=>{var E=E3e(),S=j(E);Wm(S),S.__keydown=s,S.__input=N=>i.setContent(N.currentTarget.value),pr(S,N=>a(N),()=>a());var w=ee(S,2),C=j(w);kr(C,{class:"h-8 px-3",get onclick(){return i.cancel},size:"sm",variant:"outline",children:(N,I)=>{var D=y3e(),H=L(D);Yl(H,{class:"mr-1 h-3 w-3"}),et(),T(N,D)},$$slots:{default:!0}});var x=ee(C,2);{let N=F(()=>!i.editedContent.trim());kr(x,{class:"h-8 px-3",get onclick(){return i.save},get disabled(){return f(N)},size:"sm",children:(I,D)=>{var H=S3e(),q=L(H);Lv(q,{class:"mr-1 h-3 w-3"}),et(),T(I,H)},$$slots:{default:!0}})}V(w),V(E),Ce(()=>{c5(S,i.editedContent),yt(S,1,`min-h-[60px] w-full resize-none rounded-2xl px-3 py-2 text-sm ${T4??""}`)}),T(y,E)},v=y=>{var E=N3e(),S=L(E);{var w=N=>{var I=R3e(),D=j(I);D.__click=function(...q){(f(p)&&!f(c)?m:void 0)?.apply(this,q)};var H=j(D);{let q=F(()=>f(o)?"":void 0);Oc(H,{class:"overflow-y-auto rounded-[1.125rem] !border-2 !border-dashed !border-border/50 bg-muted px-3.75 py-1.5 data-[multiline]:py-2.5",get"data-multiline"(){return f(q)},style:"border: 2px dashed hsl(var(--border)); max-height: var(--max-message-height); overflow-wrap: anywhere; word-break: break-word;",children:($,K)=>{var z=x3e(),re=L(z),W=j(re);{var ie=U=>{var Q=w3e(),ne=j(Q);N6(ne,{class:"markdown-system-content -my-4",get content(){return e.message.content}}),V(Q),pr(Q,ue=>M(l,ue),()=>f(l)),Ce(()=>yt(Q,1,qr(f(c)?"cursor-text":""))),T(U,Q)},k=U=>{var Q=T3e(),ne=j(Q,!0);V(Q),pr(Q,ue=>M(l,ue),()=>f(l)),Ce(()=>{yt(Q,1,`text-md whitespace-pre-wrap ${f(c)?"cursor-text":""}`),Ge(ne,e.message.content)}),T(U,Q)};le(W,U=>{h.renderUserContentAsMarkdown?U(ie):U(k,!1)})}var B=ee(W,2);{var te=U=>{var Q=C3e(),ne=ee(L(Q),2),ue=j(ne);kr(ue,{class:"rounded-full px-4 py-1.5 text-xs shadow-md",size:"sm",variant:"outline",children:(he,be)=>{et();var Z=Ot("Show full system message");T(he,Z)},$$slots:{default:!0}}),V(ne),T(U,Q)};le(B,U=>{!f(c)&&f(p)&&U(te)})}V(re);var O=ee(re,2);{var R=U=>{var Q=A3e(),ne=j(Q);kr(ne,{class:"rounded-full px-4 py-1.5 text-xs",onclick:ue=>{ue.stopPropagation(),m()},size:"sm",variant:"outline",children:(ue,he)=>{et();var be=Ot("Collapse System Message");T(ue,be)},$$slots:{default:!0}}),V(Q),T(U,Q)};le(O,U=>{f(c)&&f(p)&&U(R)})}Ce(()=>{yt(re,1,`relative transition-all duration-300 ${f(c)?"cursor-text select-text":"select-none"}`),ds(re,!f(c)&&f(p)?`max-height: ${d}px;`:"max-height: none;")}),T($,z)},$$slots:{default:!0}})}V(D),V(I),Ce(()=>yt(D,1,`group/expand w-full text-left ${!f(c)&&f(p)?"cursor-pointer":"cursor-auto"}`)),T(N,I)};le(S,N=>{e.message.content.trim()&&N(w)})}var C=ee(S,2);{var x=N=>{var I=O3e(),D=j(I);vy(D,{actionsPosition:"right",get deletionInfo(){return e.deletionInfo},justify:"end",get onConfirmDelete(){return e.onConfirmDelete},get onCopy(){return e.onCopy},get onDelete(){return e.onDelete},get onEdit(){return e.onEdit},get onNavigateToSibling(){return e.onNavigateToSibling},get onShowDeleteDialogChange(){return e.onShowDeleteDialogChange},get siblingInfo(){return n()},get showDeleteDialog(){return e.showDeleteDialog},get role(){return Jt.USER}}),V(I),T(N,I)};le(C,N=>{e.message.timestamp&&N(x)})}T(y,E)};le(b,y=>{i.isEditing?y(_):y(v,!1)})}V(g),Ce(()=>yt(g,1,`group flex flex-col items-end gap-3 md:gap-2 ${t()??""}`)),T(r,g),we()}Ln(["keydown","input","click"]);var M3e=G('<div class="flex items-center gap-2"><!> <label for="save-only-switch" class="cursor-pointer text-xs text-muted-foreground">Update without re-sending</label></div>'),D3e=G("<div></div>"),P3e=G("<!> Cancel",1),L3e=G('<div class="relative w-full max-w-[80%]"><!></div> <div class="mt-2 flex w-full max-w-[80%] items-center justify-between"><!> <!></div> <!>',1);function cq(r,e){Ee(e,!0);const t=xg();let n=_e(void 0),a=_e(!1),i=_e(!1),s=F(()=>!!(t.editedContent!==t.originalContent||t.editedUploadedFiles.length>0||t.editedExtras.length!==t.originalExtras.length||t.editedExtras.some((I,D)=>I!==t.originalExtras[D]))),o=F(()=>t.editedExtras&&t.editedExtras.length>0||t.editedUploadedFiles&&t.editedUploadedFiles.length>0),l=F(()=>t.editedContent.trim().length>0||f(o));function c(N){N.key===Tn.ESCAPE&&(N.preventDefault(),u())}function u(){f(s)?M(i,!0):t.cancel()}function d(){f(l)&&(f(a)&&t.showSaveOnlyOption?t.saveOnly():t.save(),M(a,!1))}function h(N){const I=[...t.editedExtras];I.splice(N,1),t.setExtras(I)}function p(N){const I=t.editedUploadedFiles.filter(D=>D.id!==N);t.setUploadedFiles(I)}async function m(N){const I=await Wz(N);t.setUploadedFiles([...t.editedUploadedFiles,...I])}function g(N){t.setUploadedFiles(N)}Nt(()=>(fn.setEditModeActive(m),()=>{fn.clearEditMode()}));var b=L3e();hn("keydown",Tf,c);var _=L(b),v=j(_);pr(Zz(v,{get value(){return t.editedContent},get attachments(){return t.editedExtras},get uploadedFiles(){return t.editedUploadedFiles},pla Line truncated
`)){M(i,!0);return}const h=new ResizeObserver(p=>{for(const m of p){const g=m.target;M(i,g.offsetHeight>24*1.5)}});return h.observe(f(s)),()=>{h.disconnect()}});var l=z3e(),c=j(l);{var u=h=>{cq(h,{})},d=h=>{var p=G3e(),m=L(p);{var g=E=>{var S=F3e(),w=j(S);E$(w,{get attachments(){return e.message.extra},readonly:!0,imageHeight:"h-80"}),V(S),T(E,S)};le(m,E=>{e.message.extra&&e.message.extra.length>0&&E(g)})}var b=ee(m,2);{var _=E=>{{let S=F(()=>f(i)?"":void 0);Oc(E,{class:"max-w-[80%] overflow-y-auto rounded-[1.125rem] border-none bg-primary/5 px-3.75 py-1.5 text-foreground backdrop-blur-md data-[multiline]:py-2.5 dark:bg-primary/15",get"data-multiline"(){return f(S)},style:"max-height: var(--max-message-height); overflow-wrap: anywhere; word-break: break-word;",children:(w,C)=>{var x=se(),N=L(x);{var I=H=>{var q=B3e(),$=j(q);N6($,{class:"markdown-user-content -my-4",get content(){return e.message.content}}),V(q),pr(q,K=>M(s,K),()=>f(s)),T(H,q)},D=H=>{var q=U3e(),$=j(q,!0);V(q),pr(q,K=>M(s,K),()=>f(s)),Ce(()=>Ge($,e.message.content)),T(H,q)};le(N,H=>{o.renderUserContentAsMarkdown?H(I):H(D,!1)})}T(w,x)},$$slots:{default:!0}})}};le(b,E=>{e.message.content.trim()&&E(_)})}var v=ee(b,2);{var y=E=>{var S=$3e(),w=j(S);vy(w,{actionsPosition:"right",get deletionInfo(){return e.deletionInfo},justify:"end",get onConfirmDelete(){return e.onConfirmDelete},get onCopy(){return e.onCopy},get onDelete(){return e.onDelete},get onEdit(){return e.onEdit},get onForkConversation(){return e.onForkConversation},get onNavigateToSibling(){return e.onNavigateToSibling},get onShowDeleteDialogChange(){return e.onShowDeleteDialogChange},get siblingInfo(){return n()},get showDeleteDialog(){return e.showDeleteDialog},get role(){return Jt.USER}}),V(S),T(E,S)};le(v,E=>{e.message.timestamp&&E(y)})}T(h,p)};le(c,h=>{a.isEditing?h(u):h(d,!1)})}V(l),Ce(()=>yt(l,1,`group flex flex-col items-end gap-3 md:gap-2 ${t()??""}`)),T(r,l),we()}function uq(){let r=_e(!1),e=_e(null),t=_e(null);const n=F(()=>f(r)?L2e():f(e));Nt(()=>{f(n)&&f(r)&&M(e,f(n),!0)}),Nt(()=>{if(f(n)?.promptProgress){const{processed:m,total:g,time_ms:b,cache:_}=f(n).promptProgress,v=m-_,y=g-_;if(v>0&&b>0){const E=v/(b/1e3);M(t,{tokensProcessed:v,totalTokens:y,timeMs:b,tokensPerSecond:E},!0)}}});function a(m,g,b){const _=b/1e3;return m===0||_<.5?void 0:_*(g/m-1)}function i(){f(r)||M(r,!0)}function s(){if(!f(r))return;M(r,!1),An().keepStatsVisible||(M(e,null),M(t,null))}function o(){if(!f(n))return"Processing...";switch(f(n).status){case"initializing":return"Initializing...";case"preparing":return f(n).progressPercent!==void 0?`Processing (${f(n).progressPercent}%)`:"Preparing response...";case"generating":return"";default:return"Processing..."}}function l(){const m=f(n)||f(e);if(!m)return[];const g=[];if(m.promptProgress){const{processed:b,total:_,time_ms:v,cache:y}=m.promptProgress,E=b-y,S=_-y;if(E<S&&E>0){const w=Math.round(E/S*100),C=a(E,S,v);if(C!==void 0){const x=Math.ceil(C);g.push(`Processing ${w}% (ETA: ${x}s)`)}else g.push(`Processing ${w}%`)}}if(typeof m.contextTotal=="number"&&m.contextUsed>=0&&m.contextTotal>0){const b=Math.round(m.contextUsed/m.contextTotal*100);g.push(`Context: ${m.contextUsed}/${m.contextTotal} (${b}%)`)}if(m.outputTokensUsed>0)if(m.outputTokensMax<=0)g.push(`Output: ${m.outputTokensUsed}/∞`);else{const b=Math.round(m.outputTokensUsed/m.outputTokensMax*100);g.push(`Output: ${m.outputTokensUsed}/${m.outputTokensMax} (${b}%)`)}return m.tokensPerSecond&&m.tokensPerSecond>0&&g.push(`${m.tokensPerSecond.toFixed(1)} ${SO.TOKENS_PER_SECOND}`),m.speculative&&g.push("Speculative decoding enabled"),g}function c(){const m=f(n)||f(e);if(!m)return[];const g=[];if(typeof m.contextTotal=="number"&&m.contextUsed>=0&&m.contextTotal>0){const b=Math.round(m.contextUsed/m.contextTotal*100);g.push(`Context: ${m.contextUsed}/${m.contextTotal} (${b}%)`)}if(m.outputTokensUsed>0)if(m.outputTokensMax<=0)g.push(`Output: ${m.outputTokensUsed}/∞`);else{const b=Math.round(m.outputTokensUsed/m.outputTokensMax*100);g.push(`Output: ${m.outputTokensUsed}/${m.outputTokensMax} (${b}%)`)}return m.tokensPerSecond&&m.tokensPerSecond>0&&g.push(`${m.tokensPerSecond.toFixed(1)} ${SO.TOKENS_PER_SECOND}`),m.speculative&&g.push("Speculative decoding enabled"),g}function u(){return f(n)!==null&&f(n).status!=="idle"}function d(){if(!f(n)?.promptProgress)return null;const{processed:m,total:g,cache:b}=f(n).promptProgress,_=m-b,v=g-b,y=Math.round(_/v*100),E=a(_,v,f(n).promptProgress.time_ms);if(E!==void 0){const S=Math.ceil(E);return`Processing ${y}% (ETA: ${S}s)`}return`Processing ${y}%`}function h(){if(f(n)?.promptProgress){const{processed:m,total:g,time_ms:b,cache:_}=f(n).promptProgress,v=m-_,y=g-_;if(v>0&&b>0){const E=v/(b/1e3);return{tokensProcessed:v,totalTokens:y,timeMs:b,tokensPerSecond:E}}}return f(t)}function p(){if(!f(n))return null;const{tokensDecoded:m,tokensPerSecond:g}=f(n);if(m<=0)return null;const b=g&&g>0?m/g*1e3:0;return{tokensGenerated:m,timeMs:b,tokensPerSecond:g||0}}return{get Line truncated
`}}var Ewe=q("<input/>"),vwe=q("<input/>");function ml(t,e){ye(e,!0);let r=V(e,"ref",15,null),n=V(e,"value",15),a=V(e,"files",15),i=Ve(e,["$$slots","$$events","$$legacy","ref","value","type","files","class"]);var s=se(),o=L(s);{var l=u=>{var d=Ewe();$t(d,h=>({"data-slot":"input",class:h,type:"file",...i}),[()=>jt("flex h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 pt-1.5 text-sm font-medium shadow-xs ring-offset-background transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",e.class)],void 0,void 0,void 0,!0),mr(d,h=>r(h),()=>r()),cK(d,a),bf(d,n),C(u,d)},c=u=>{var d=vwe();$t(d,h=>({"data-slot":"input",class:h,style:"backdrop-filter: blur(0.5rem);",type:e.type,...i}),[()=>jt("flex h-9 w-full min-w-0 rounded-md border border-input bg-background px-3 py-1 text-base shadow-xs ring-offset-background transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",e.class)],void 0,void 0,void 0,!0),mr(d,h=>r(h),()=>r()),bf(d,n),C(u,d)};le(o,u=>{e.type==="file"?u(l):u(c,!1)})}C(t,s),Te()}function rl(t,e){ye(e,!0);let r=V(e,"ref",15,null),n=Ve(e,["$$slots","$$events","$$legacy","ref","class"]);var a=se(),i=L(a);{let s=F(()=>jt("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e.class));fe(i,()=>dte,(o,l)=>{l(o,ot({"data-slot":"label",get class(){return p(s)}},()=>n,{get ref(){return r()},set ref(c){r(c)}}))})}C(t,a),Te()}var ywe=q('<span class="text-destructive">*</span>'),Twe=q('<span class="text-xs text-muted-foreground/50">...</span>'),Cwe=q("<span> <!></span> <!>",1),wwe=q('<button type="button"> </button>'),Awe=q('<div class="absolute top-full right-0 left-0 z-10 mt-1 max-h-32 overflow-y-auto rounded-lg border border-border/50 bg-background shadow-lg"></div>'),Rwe=q('<div class="relative grid gap-1"><!> <!> <!></div>');function Owe(t,e){ye(e,!0);let r=V(e,"value",3,""),n=V(e,"suggestions",19,()=>[]),a=V(e,"isLoadingSuggestions",3,!1),i=V(e,"isAutocompleteActive",3,!1),s=V(e,"autocompleteIndex",3,0);var o=Rwe(),l=j(o);rl(l,{get for(){return`arg-${e.argument.name??""}`},class:"mb-1 text-muted-foreground",children:(h,m)=>{var f=Cwe(),g=L(f),b=j(g),_=te(b);{var S=v=>{var T=ywe();C(v,T)};le(_,v=>{e.argument.required&&v(S)})}Y(g);var E=te(g,2);{var y=v=>{var T=Twe();C(v,T)};le(E,v=>{a()&&v(y)})}we(()=>qe(b,`${e.argument.name??""} `)),C(h,f)},$$slots:{default:!0}});var c=te(l,2);{let h=F(()=>e.argument.description||e.argument.name);ml(c,{get id(){return`arg-${e.argument.name??""}`},type:"text",get value(){return r()},oninput:m=>e.onInput(m.currentTarget.value),get onkeydown(){return e.onKeydown},get onblur(){return e.onBlur},get onfocus(){return e.onFocus},get placeholder(){return p(h)},get required(){return e.argument.required},autocomplete:"off"})}var u=te(c,2);{var d=h=>{var m=Awe();xr(m,22,n,f=>f,(f,g,b)=>{var _=wwe();_.__mousedown=()=>e.onSelectSuggestion(g);var S=j(_,!0);Y(_),we(()=>{Et(_,1,`w-full px-3 py-1.5 text-left text-sm hover:bg-accent ${p(b)===s()?"bg-accent":""}`),qe(S,g)}),C(f,_)}),Y(m),li(3,m,()=>el,()=>({y:-5,duration:100})),C(h,m)};le(u,h=>{i()&&n().length>0&&h(d)})}Y(o),C(t,o),Te()}Bn(["mousedown"]);var Nwe=q('<div class="flex items-start gap-2 rounded-lg border border-destructive/50 bg-destructive/10 px-3 py-2 text-sm text-destructive" role="alert"><span class="shrink-0">⚠</span> <span> </span></div>'),Iwe=q('<form class="space-y-3 pt-4"><!> <!> <div class="mt-8 flex justify-end gap-2"><!> <!></div></form>');function xwe(t,e){ye(e,!0);var r=Iwe(),n=j(r);xr(n,17,()=>e.prompt.arguments??[],c=>c.name,(c,u)=>{{let d=F(()=>e.promptArgs[p(u).name]??""),h=F(()=>e.suggestions[p(u).name]??[]),m=F(()=>e.loadingSuggestions[p(u).name]??!1),f=F(()=>e.activeAutocomplete===p(u).name),g=F(()=>e.activeAutocomplete===p(u).name?e.autocompleteIndex:0);Owe(c,{get argument(){return p(u)},get value(){return p(d)},get suggestions(){return p(h)},get isLoadingSuggestions(){return p(m)},get isAutocompleteActive(){return p(f)},get autocompleteIndex(){return p(g)},onInput:b=>e.onArgInput(p(u).name,b),onKeydown:b=>e.onArgKeydown(b,p(u).name),onBlur:()=>e.onArgBlur(p(u).name),onFocus:()=>e.onArgFocus(p(u).name),onSelectSuggestion:b=>e.onSelectSuggestion(p(u).name,b)})}});var a=te Line truncated
`)&&k(o,!0);const E=new ResizeObserver(y=>{for(const v of y){const T=v.target;k(o,T.offsetHeight>24*1.5),k(u,T.scrollHeight,!0)}});return E.observe(p(l)),()=>{E.disconnect()}});function f(){k(c,!p(c))}var g=FRe(),b=j(g);{var _=E=>{var y=ORe(),v=j(y);Qf(v),v.__keydown=s,v.__input=I=>i.setContent(I.currentTarget.value),mr(v,I=>a(I),()=>a());var T=te(v,2),w=j(T);Dr(w,{class:"h-8 px-3",get onclick(){return i.cancel},size:"sm",variant:"outline",children:(I,x)=>{var D=ARe(),$=L(D);Xl($,{class:"mr-1 h-3 w-3"}),et(),C(I,D)},$$slots:{default:!0}});var A=te(w,2);{let I=F(()=>!i.editedContent.trim());Dr(A,{class:"h-8 px-3",get onclick(){return i.save},get disabled(){return p(I)},size:"sm",children:(x,D)=>{var $=RRe(),H=L($);US(H,{class:"mr-1 h-3 w-3"}),et(),C(x,$)},$$slots:{default:!0}})}Y(T),Y(y),we(()=>{pO(v,i.editedContent),Et(v,1,`min-h-[60px] w-full resize-none rounded-2xl px-3 py-2 text-sm ${OI??""}`)}),C(E,y)},S=E=>{var y=LRe(),v=L(y);{var T=I=>{var x=kRe(),D=j(x);D.__click=function(...H){(p(m)&&!p(c)?f:void 0)?.apply(this,H)};var $=j(D);{let H=F(()=>p(o)?"":void 0);Pc($,{class:"overflow-y-auto rounded-[1.125rem] !border-2 !border-dashed !border-border/50 bg-muted px-3.75 py-1.5 data-[multiline]:py-2.5",get"data-multiline"(){return p(H)},style:"border: 2px dashed hsl(var(--border)); max-height: var(--max-message-height); overflow-wrap: anywhere; word-break: break-word;",children:(G,K)=>{var z=MRe(),re=L(z),W=j(re);{var ie=U=>{var X=NRe(),ne=j(X);k3(ne,{class:"markdown-system-content -my-4",get content(){return e.message.content}}),Y(X),mr(X,ue=>k(l,ue),()=>p(l)),we(()=>Et(X,1,$r(p(c)?"cursor-text":""))),C(U,X)},M=U=>{var X=IRe(),ne=j(X,!0);Y(X),mr(X,ue=>k(l,ue),()=>p(l)),we(()=>{Et(X,1,`text-md whitespace-pre-wrap ${p(c)?"cursor-text":""}`),qe(ne,e.message.content)}),C(U,X)};le(W,U=>{h.renderUserContentAsMarkdown?U(ie):U(M,!1)})}var B=te(W,2);{var J=U=>{var X=xRe(),ne=te(L(X),2),ue=j(ne);Dr(ue,{class:"rounded-full px-4 py-1.5 text-xs shadow-md",size:"sm",variant:"outline",children:(he,be)=>{et();var Z=Nt("Show full system message");C(he,Z)},$$slots:{default:!0}}),Y(ne),C(U,X)};le(B,U=>{!p(c)&&p(m)&&U(J)})}Y(re);var N=te(re,2);{var O=U=>{var X=DRe(),ne=j(X);Dr(ne,{class:"rounded-full px-4 py-1.5 text-xs",onclick:ue=>{ue.stopPropagation(),f()},size:"sm",variant:"outline",children:(ue,he)=>{et();var be=Nt("Collapse System Message");C(ue,be)},$$slots:{default:!0}}),Y(X),C(U,X)};le(N,U=>{p(c)&&p(m)&&U(O)})}we(()=>{Et(re,1,`relative transition-all duration-300 ${p(c)?"cursor-text select-text":"select-none"}`),ms(re,!p(c)&&p(m)?`max-height: ${d}px;`:"max-height: none;")}),C(G,z)},$$slots:{default:!0}})}Y(D),Y(x),we(()=>Et(D,1,`group/expand w-full text-left ${!p(c)&&p(m)?"cursor-pointer":"cursor-auto"}`)),C(I,x)};le(v,I=>{e.message.content.trim()&&I(T)})}var w=te(v,2);{var A=I=>{var x=PRe(),D=j(x);yE(D,{actionsPosition:"right",get deletionInfo(){return e.deletionInfo},justify:"end",get onConfirmDelete(){return e.onConfirmDelete},get onCopy(){return e.onCopy},get onDelete(){return e.onDelete},get onEdit(){return e.onEdit},get onNavigateToSibling(){return e.onNavigateToSibling},get onShowDeleteDialogChange(){return e.onShowDeleteDialogChange},get siblingInfo(){return n()},get showDeleteDialog(){return e.showDeleteDialog},get role(){return tr.USER}}),Y(x),C(I,x)};le(w,I=>{e.message.timestamp&&I(A)})}C(E,y)};le(b,E=>{i.isEditing?E(_):E(S,!1)})}Y(g),we(()=>Et(g,1,`group flex flex-col items-end gap-3 md:gap-2 ${r()??""}`)),C(t,g),Te()}Bn(["keydown","input","click"]);var URe=q('<div class="flex items-center gap-2"><!> <label for="save-only-switch" class="cursor-pointer text-xs text-muted-foreground">Update without re-sending</label></div>'),GRe=q("<div></div>"),qRe=q("<!> Cancel",1),zRe=q('<div class="relative w-full max-w-[80%]"><!></div> <div class="mt-2 flex w-full max-w-[80%] items-center justify-between"><!> <!></div> <!>',1);function p$(t,e){ye(e,!0);const r=Ig();let n=_e(void 0),a=_e(!1),i=_e(!1),s=F(()=>!!(r.editedContent!==r.originalContent||r.editedUploadedFiles.length>0||r.editedExtras.length!==r.originalExtras.length||r.editedExtras.some((x,D)=>x!==r.originalExtras[D]))),o=F(()=>r.editedExtras&&r.editedExtras.length>0||r.editedUploadedFiles&&r.editedUploadedFiles.length>0),l=F(()=>r.editedContent.trim().length>0||p(o));function c(I){I.key===Cn.ESCAPE&&(I.preventDefault(),u())}function u(){p(s)?k(i,!0):r.cancel()}function d(){p(l)&&(p(a)&&r.showSaveOnlyOption?r.saveOnly():r.save(),k(a,!1))}function h(I){const x=[...r.editedExtras];x.splice(I,1),r.setExtras(x)}function m(I){const x=r.editedUploadedFiles.filter(D=>D.id!==I);r.setUploadedFiles(x)}async function f(I){const x=await Xz(I);r.setUploadedFiles([...r.editedUploadedFiles,...x])}function g(I){r.setUploadedFiles(I)}It(()=>(pn.setEditModeActive(f),()=>{pn.clearEditMode()}));var b=zRe();hn("keydown",Rp,c);var _=L(b),S=j(_);mr(r$(S,{get value(){return r.editedContent},get attachments(){return r.editedExtras},get uploadedFiles(){return r.editedUploadedFiles},place Line truncated
`)){k(i,!0);return}const h=new ResizeObserver(m=>{for(const f of m){const g=f.target;k(i,g.offsetHeight>24*1.5)}});return h.observe(p(s)),()=>{h.disconnect()}});var l=KRe(),c=j(l);{var u=h=>{p$(h,{})},d=h=>{var m=WRe(),f=L(m);{var g=y=>{var v=$Re(),T=j(v);AG(T,{get attachments(){return e.message.extra},readonly:!0,imageHeight:"h-80"}),Y(v),C(y,v)};le(f,y=>{e.message.extra&&e.message.extra.length>0&&y(g)})}var b=te(f,2);{var _=y=>{{let v=F(()=>p(i)?"":void 0);Pc(y,{class:"max-w-[80%] overflow-y-auto rounded-[1.125rem] border-none bg-primary/5 px-3.75 py-1.5 text-foreground backdrop-blur-md data-[multiline]:py-2.5 dark:bg-primary/15",get"data-multiline"(){return p(v)},style:"max-height: var(--max-message-height); overflow-wrap: anywhere; word-break: break-word;",children:(T,w)=>{var A=se(),I=L(A);{var x=$=>{var H=HRe(),G=j(H);k3(G,{class:"markdown-user-content -my-4",get content(){return e.message.content}}),Y(H),mr(H,K=>k(s,K),()=>p(s)),C($,H)},D=$=>{var H=YRe(),G=j(H,!0);Y(H),mr(H,K=>k(s,K),()=>p(s)),we(()=>qe(G,e.message.content)),C($,H)};le(I,$=>{o.renderUserContentAsMarkdown?$(x):$(D,!1)})}C(T,A)},$$slots:{default:!0}})}};le(b,y=>{e.message.content.trim()&&y(_)})}var S=te(b,2);{var E=y=>{var v=VRe(),T=j(v);yE(T,{actionsPosition:"right",get deletionInfo(){return e.deletionInfo},justify:"end",get onConfirmDelete(){return e.onConfirmDelete},get onCopy(){return e.onCopy},get onDelete(){return e.onDelete},get onEdit(){return e.onEdit},get onForkConversation(){return e.onForkConversation},get onNavigateToSibling(){return e.onNavigateToSibling},get onShowDeleteDialogChange(){return e.onShowDeleteDialogChange},get siblingInfo(){return n()},get showDeleteDialog(){return e.showDeleteDialog},get role(){return tr.USER}}),Y(v),C(y,v)};le(S,y=>{e.message.timestamp&&y(E)})}C(h,m)};le(c,h=>{a.isEditing?h(u):h(d,!1)})}Y(l),we(()=>Et(l,1,`group flex flex-col items-end gap-3 md:gap-2 ${r()??""}`)),C(t,l),Te()}function m$(){let t=_e(!1),e=_e(null),r=_e(null);const n=F(()=>p(t)?zTe():p(e));It(()=>{p(n)&&p(t)&&k(e,p(n),!0)}),It(()=>{if(p(n)?.promptProgress){const{processed:f,total:g,time_ms:b,cache:_}=p(n).promptProgress,S=f-_,E=g-_;if(S>0&&b>0){const y=S/(b/1e3);k(r,{tokensProcessed:S,totalTokens:E,timeMs:b,tokensPerSecond:y},!0)}}});function a(f,g,b){const _=b/1e3;return f===0||_<.5?void 0:_*(g/f-1)}function i(){p(t)||k(t,!0)}function s(){if(!p(t))return;k(t,!1),An().keepStatsVisible||(k(e,null),k(r,null))}function o(){if(!p(n))return"Processing...";switch(p(n).status){case"initializing":return"Initializing...";case"preparing":return p(n).progressPercent!==void 0?`Processing (${p(n).progressPercent}%)`:"Preparing response...";case"generating":return"";default:return"Processing..."}}function l(){const f=p(n)||p(e);if(!f)return[];const g=[];if(f.promptProgress){const{processed:b,total:_,time_ms:S,cache:E}=f.promptProgress,y=b-E,v=_-E;if(y<v&&y>0){const T=Math.round(y/v*100),w=a(y,v,S);if(w!==void 0){const A=Math.ceil(w);g.push(`Processing ${T}% (ETA: ${A}s)`)}else g.push(`Processing ${T}%`)}}if(typeof f.contextTotal=="number"&&f.contextUsed>=0&&f.contextTotal>0){const b=Math.round(f.contextUsed/f.contextTotal*100);g.push(`Context: ${f.contextUsed}/${f.contextTotal} (${b}%)`)}if(f.outputTokensUsed>0)if(f.outputTokensMax<=0)g.push(`Output: ${f.outputTokensUsed}/∞`);else{const b=Math.round(f.outputTokensUsed/f.outputTokensMax*100);g.push(`Output: ${f.outputTokensUsed}/${f.outputTokensMax} (${b}%)`)}return f.tokensPerSecond&&f.tokensPerSecond>0&&g.push(`${f.tokensPerSecond.toFixed(1)} ${w5.TOKENS_PER_SECOND}`),f.speculative&&g.push("Speculative decoding enabled"),g}function c(){const f=p(n)||p(e);if(!f)return[];const g=[];if(typeof f.contextTotal=="number"&&f.contextUsed>=0&&f.contextTotal>0){const b=Math.round(f.contextUsed/f.contextTotal*100);g.push(`Context: ${f.contextUsed}/${f.contextTotal} (${b}%)`)}if(f.outputTokensUsed>0)if(f.outputTokensMax<=0)g.push(`Output: ${f.outputTokensUsed}/∞`);else{const b=Math.round(f.outputTokensUsed/f.outputTokensMax*100);g.push(`Output: ${f.outputTokensUsed}/${f.outputTokensMax} (${b}%)`)}return f.tokensPerSecond&&f.tokensPerSecond>0&&g.push(`${f.tokensPerSecond.toFixed(1)} ${w5.TOKENS_PER_SECOND}`),f.speculative&&g.push("Speculative decoding enabled"),g}function u(){return p(n)!==null&&p(n).status!=="idle"}function d(){if(!p(n)?.promptProgress)return null;const{processed:f,total:g,cache:b}=p(n).promptProgress,_=f-b,S=g-b,E=Math.round(_/S*100),y=a(_,S,p(n).promptProgress.time_ms);if(y!==void 0){const v=Math.ceil(y);return`Processing ${E}% (ETA: ${v}s)`}return`Processing ${E}%`}function h(){if(p(n)?.promptProgress){const{processed:f,total:g,time_ms:b,cache:_}=p(n).promptProgress,S=f-_,E=g-_;if(S>0&&b>0){const y=S/(b/1e3);return{tokensProcessed:S,totalTokens:E,timeMs:b,tokensPerSecond:y}}}return p(r)}function m(){if(!p(n))return null;const{tokensDecoded:f,tokensPerSecond:g}=p(n);if(f<=0)return null;const b=g&&g>0?f/g*1e3:0;return{tokensGenerated:f,timeMs:b,tokensPerSecond:g||0}}return{get Line truncated
parameters to the values provided by the server's /props endpoint and remove all your custom
configurations.`);T(W,k)},$$slots:{default:!0}})}),T(D,q)},$$slots:{default:!0}})});var x=ee(C,2);me(x,()=>ed,(N,I)=>{I(N,{children:(D,H)=>{var q=h5e(),$=L(q);me($,()=>Px,(z,re)=>{re(z,{children:(W,ie)=>{et();var k=Ot("Cancel");T(W,k)},$$slots:{default:!0}})});var K=ee($,2);me(K,()=>fh,(z,re)=>{re(z,{onclick:a,children:(W,ie)=>{et();var k=Ot("Reset to Default");T(W,k)},$$slots:{default:!0}})}),T(D,q)},$$slots:{default:!0}})}),T(E,w)},$$slots:{default:!0}})}),T(m,b)},$$slots:{default:!0}})}),T(r,s),we()}var g5e=G('<span class="absolute right-2 flex size-3.5 items-center justify-center"><!></span> <!>',1);function _5e(r,e){Ee(e,!0);let t=Y(e,"ref",15,null),n=Ye(e,["$$slots","$$events","$$legacy","ref","class","value","label","children"]);var a=se(),i=L(a);{const s=(l,c)=>{let u=()=>c?.().selected,d=()=>c?.().highlighted;var h=g5e(),p=L(h),m=j(p);{var g=y=>{Lv(y,{class:"size-4"})};le(m,y=>{u()&&y(g)})}V(p);var b=ee(p,2);{var _=y=>{var E=se(),S=L(E);ke(S,()=>e.children,()=>({selected:u(),highlighted:d()})),T(y,E)},v=y=>{var E=Ot();Ce(()=>Ge(E,e.label||e.value)),T(y,E)};le(b,y=>{e.children?y(_):y(v,!1)})}T(l,h)};let o=F(()=>Kt("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e.class));me(i,()=>wee,(l,c)=>{c(l,ot({get value(){return e.value},"data-slot":"select-item",get class(){return f(o)}},()=>n,{get ref(){return t()},set ref(u){t(u)},children:s,$$slots:{default:!0}}))})}T(r,a),we()}function b5e(r,e){Ee(e,!0);let t=Y(e,"ref",15,null),n=Ye(e,["$$slots","$$events","$$legacy","ref","class"]);var a=se(),i=L(a);{let s=F(()=>Kt("flex cursor-default items-center justify-center py-1",e.class));me(i,()=>Iee,(o,l)=>{l(o,ot({"data-slot":"select-scroll-up-button",get class(){return f(s)}},()=>n,{get ref(){return t()},set ref(c){t(c)},children:(c,u)=>{lre(c,{class:"size-4"})},$$slots:{default:!0}}))})}T(r,a),we()}function v5e(r,e){Ee(e,!0);let t=Y(e,"ref",15,null),n=Ye(e,["$$slots","$$events","$$legacy","ref","class"]);var a=se(),i=L(a);{let s=F(()=>Kt("flex cursor-default items-center justify-center py-1",e.class));me(i,()=>Ree,(o,l)=>{l(o,ot({"data-slot":"select-scroll-down-button",get class(){return f(s)}},()=>n,{get ref(){return t()},set ref(c){t(c)},children:(c,u)=>{Uc(c,{class:"size-4"})},$$slots:{default:!0}}))})}T(r,a),we()}var y5e=G("<!> <!> <!>",1);function S5e(r,e){Ee(e,!0);let t=Y(e,"ref",15,null),n=Y(e,"sideOffset",3,4),a=Ye(e,["$$slots","$$events","$$legacy","ref","class","sideOffset","portalProps","children"]),i;bi(()=>{const l={passive:!1},c=d=>{if(!t())return;const h=d.target;(!h||!t().contains(h))&&(d.preventDefault(),d.stopPropagation())},u=d=>{if(!t())return;const h=d.target;(!h||!t().contains(h))&&(d.preventDefault(),d.stopPropagation())};return document.addEventListener("wheel",c,l),document.addEventListener("touchmove",u,l),()=>{document.removeEventListener("wheel",c,l),document.removeEventListener("touchmove",u,l)}}),Nt(()=>{const l=t();if(i?.(),!l)return;const c=d=>{d.stopPropagation()},u=d=>{d.stopPropagation()};l.addEventListener("wheel",c),l.addEventListener("touchmove",u),i=()=>{l.removeEventListener("wheel",c),l.removeEventListener("touchmove",u)}}),f5(()=>{i?.()});var s=se(),o=L(s);me(o,()=>Jc,(l,c)=>{c(l,ot(()=>e.portalProps,{children:(u,d)=>{var h=se(),p=L(h);{let m=F(()=>Kt("relative z-[var(--layer-popover,1000000)] max-h-(--bits-select-content-available-height) min-w-[8rem] origin-(--bits-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:translate-y-1 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:-translate-x-1 data-[side=left]:slide-in-from-right-2 data-[side=right]:translate-x-1 data-[side=right]:slide-in-from-left-2 data-[side=top]:-translate-y-1 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",e.class));me(p,()=>yee,(g,b)=>{b(g,ot({get sideOffset(){return n()},"data-slot":"select-content",get class(){return f(m)}},()=>a,{get ref(){return t()},set ref(_){t(_)},children:(_,v)=>{var y=y5e(),E=L(y);b5e(E,{});var S=ee(E,2);{let C=F(()=>Kt("h-(--bits-select-anchor-height) w-full min-w-(--bits-select-anchor-width) scroll-my-1 p-1"));me(S,()=>Cee,(x,N)=>{N(x,{get class(){return f(C)},children:(I,D)=>{var H=se(),q=L(H);ke(q,()=>e.children??$e),T(I,H)},$$slots:{default:!0}})})}var w=ee(S,2);v5e(w,{}),T(_,y)},$$slots:{default:!0}}))})}T(u,h)},$$slots:{default:!0}}))}),T(r,s),we()}var E5e=G("<!> <!>",1);function w5e(r, Line truncated
configurations.`);C(W,M)},$$slots:{default:!0}})}),C(D,H)},$$slots:{default:!0}})});var A=te(w,2);fe(A,()=>sd,(I,x)=>{x(I,{children:(D,$)=>{var H=bOe(),G=L(H);fe(G,()=>Ux,(z,re)=>{re(z,{children:(W,ie)=>{et();var M=Nt("Cancel");C(W,M)},$$slots:{default:!0}})});var K=te(G,2);fe(K,()=>Eh,(z,re)=>{re(z,{onclick:a,children:(W,ie)=>{et();var M=Nt("Reset to Default");C(W,M)},$$slots:{default:!0}})}),C(D,H)},$$slots:{default:!0}})}),C(y,T)},$$slots:{default:!0}})}),C(f,b)},$$slots:{default:!0}})}),C(t,s),Te()}var yOe=q('<span class="absolute right-2 flex size-3.5 items-center justify-center"><!></span> <!>',1);function TOe(t,e){ye(e,!0);let r=V(e,"ref",15,null),n=Ve(e,["$$slots","$$events","$$legacy","ref","class","value","label","children"]);var a=se(),i=L(a);{const s=(l,c)=>{let u=()=>c?.().selected,d=()=>c?.().highlighted;var h=yOe(),m=L(h),f=j(m);{var g=E=>{US(E,{class:"size-4"})};le(f,E=>{u()&&E(g)})}Y(m);var b=te(m,2);{var _=E=>{var y=se(),v=L(y);De(v,()=>e.children,()=>({selected:u(),highlighted:d()})),C(E,y)},S=E=>{var y=Nt();we(()=>qe(y,e.label||e.value)),C(E,y)};le(b,E=>{e.children?E(_):E(S,!1)})}C(l,h)};let o=F(()=>jt("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e.class));fe(i,()=>Nee,(l,c)=>{c(l,ot({get value(){return e.value},"data-slot":"select-item",get class(){return p(o)}},()=>n,{get ref(){return r()},set ref(u){r(u)},children:s,$$slots:{default:!0}}))})}C(t,a),Te()}function COe(t,e){ye(e,!0);let r=V(e,"ref",15,null),n=Ve(e,["$$slots","$$events","$$legacy","ref","class"]);var a=se(),i=L(a);{let s=F(()=>jt("flex cursor-default items-center justify-center py-1",e.class));fe(i,()=>Fee,(o,l)=>{l(o,ot({"data-slot":"select-scroll-up-button",get class(){return p(s)}},()=>n,{get ref(){return r()},set ref(c){r(c)},children:(c,u)=>{mre(c,{class:"size-4"})},$$slots:{default:!0}}))})}C(t,a),Te()}function wOe(t,e){ye(e,!0);let r=V(e,"ref",15,null),n=Ve(e,["$$slots","$$events","$$legacy","ref","class"]);var a=se(),i=L(a);{let s=F(()=>jt("flex cursor-default items-center justify-center py-1",e.class));fe(i,()=>kee,(o,l)=>{l(o,ot({"data-slot":"select-scroll-down-button",get class(){return p(s)}},()=>n,{get ref(){return r()},set ref(c){r(c)},children:(c,u)=>{Yc(c,{class:"size-4"})},$$slots:{default:!0}}))})}C(t,a),Te()}var AOe=q("<!> <!> <!>",1);function ROe(t,e){ye(e,!0);let r=V(e,"ref",15,null),n=V(e,"sideOffset",3,4),a=Ve(e,["$$slots","$$events","$$legacy","ref","class","sideOffset","portalProps","children"]),i;vi(()=>{const l={passive:!1},c=d=>{if(!r())return;const h=d.target;(!h||!r().contains(h))&&(d.preventDefault(),d.stopPropagation())},u=d=>{if(!r())return;const h=d.target;(!h||!r().contains(h))&&(d.preventDefault(),d.stopPropagation())};return document.addEventListener("wheel",c,l),document.addEventListener("touchmove",u,l),()=>{document.removeEventListener("wheel",c,l),document.removeEventListener("touchmove",u,l)}}),It(()=>{const l=r();if(i?.(),!l)return;const c=d=>{d.stopPropagation()},u=d=>{d.stopPropagation()};l.addEventListener("wheel",c),l.addEventListener("touchmove",u),i=()=>{l.removeEventListener("wheel",c),l.removeEventListener("touchmove",u)}}),_O(()=>{i?.()});var s=se(),o=L(s);fe(o,()=>iu,(l,c)=>{c(l,ot(()=>e.portalProps,{children:(u,d)=>{var h=se(),m=L(h);{let f=F(()=>jt("relative z-[var(--layer-popover,1000000)] max-h-(--bits-select-content-available-height) min-w-[8rem] origin-(--bits-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:translate-y-1 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:-translate-x-1 data-[side=left]:slide-in-from-right-2 data-[side=right]:translate-x-1 data-[side=right]:slide-in-from-left-2 data-[side=top]:-translate-y-1 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",e.class));fe(m,()=>Aee,(g,b)=>{b(g,ot({get sideOffset(){return n()},"data-slot":"select-content",get class(){return p(f)}},()=>a,{get ref(){return r()},set ref(_){r(_)},children:(_,S)=>{var E=AOe(),y=L(E);COe(y,{});var v=te(y,2);{let w=F(()=>jt("h-(--bits-select-anchor-height) w-full min-w-(--bits-select-anchor-width) scroll-my-1 p-1"));fe(v,()=>xee,(A,I)=>{I(A,{get class(){return p(w)},children:(x,D)=>{var $=se(),H=L($);De(H,()=>e.children??Ge),C(x,$)},$$slots:{default:!0}})})}var T=te(v,2);wOe(T,{}),C(_,E)},$$slots:{default:!0}}))})}C(u,h)},$$slots:{default:!0}}))}),C(t,s),Te()}var OOe=q("<!> <!>",1);function NOe(t, Line truncated
conversation history.</p> <!> <!></div> <div class="grid border-t border-border/30 pt-4"><h4 class="mb-2 text-sm font-medium">Import Conversations</h4> <p class="mb-4 text-sm text-muted-foreground">Import one or more conversations from a previously exported JSON file. This will merge with
your existing conversations.</p> <!> <!></div> <div class="grid border-t border-border/30 pt-4"><h4 class="mb-2 text-sm font-medium text-destructive">Delete All Conversations</h4> <p class="mb-4 text-sm text-muted-foreground">Permanently delete all conversations and their messages. This action cannot be undone.
Consider exporting your conversations first if you want to keep a backup.</p> <!></div></div></div> <!> <!> <!>`,1);function t9e(r,e){Ee(e,!0);let t=_e(Sr([])),n=_e(Sr([])),a=_e(!1),i=_e(!1),s=_e(!1),o=_e(!1),l=_e(Sr([])),c=_e(Sr(new Map)),u=_e(Sr([])),d=_e(!1);async function h(){try{const ie=Dd();if(ie.length===0){Jn.info("No conversations to export");return}const k=await Promise.all(ie.map(async B=>{const te=await rt.getConversationMessages(B.id);return{conv:B,messages:te}}));M(c,r8(k),!0),M(l,ie,!0),M(s,!0)}catch(ie){console.error("Failed to load conversations:",ie),alert("Failed to load conversations")}}async function p(ie){try{const k=await Promise.all(ie.map(async B=>{const te=await rt.getConversationMessages(B.id);return{conv:rf(B),messages:rf(te)}}));rt.downloadConversationFile(k,`${new Date().toISOString().split(JU)[0]}_conversations.json`),M(t,ie,!0),M(a,!0),M(i,!1),M(s,!1)}catch(k){console.error("Export failed:",k),alert("Failed to export conversations")}}async function m(){try{const ie=document.createElement("input");ie.type="file",ie.accept=".json",ie.onchange=async k=>{const B=k.target?.files?.[0];if(B)try{const te=await B.text(),O=JSON.parse(te);let R;if(Array.isArray(O))R=O;else if(O&&typeof O=="object"&&"conv"in O&&"messages"in O)R=[O];else throw new Error("Invalid file format: expected array of conversations or single conversation object");M(u,R,!0),M(l,R.map(U=>U.conv),!0),M(c,r8(R),!0),M(o,!0)}catch(te){const O=te instanceof Error?te.message:"Unknown error";console.error("Failed to parse file:",te),alert(`Failed to parse file: ${O}`)}},ie.click()}catch(ie){console.error("Import failed:",ie),alert("Failed to import conversations")}}async function g(ie){try{const k=new Set(ie.map(te=>te.id)),B=rf(f(u)).filter(te=>k.has(te.conv.id));await rt.importConversationsData(B),M(n,ie,!0),M(i,!0),M(a,!1),M(o,!1)}catch(k){console.error("Import failed:",k),alert("Failed to import conversations. Please check the file format.")}}async function b(){try{if(Dd().length===0){Jn.info("No conversations to delete");return}M(d,!0)}catch(ie){console.error("Failed to load conversations for deletion:",ie),Jn.error("Failed to load conversations")}}async function _(){try{await rt.deleteAll(),M(d,!1)}catch(ie){console.error("Failed to delete conversations:",ie)}}function v(){M(d,!1)}var y=e9e(),E=L(y),S=j(E),w=j(S),C=ee(j(w),4);kr(C,{class:"w-full justify-start justify-self-start md:w-auto",onclick:h,variant:"outline",children:(ie,k)=>{var B=V5e(),te=L(B);Fv(te,{class:"mr-2 h-4 w-4"}),et(),T(ie,B)},$$slots:{default:!0}});var x=ee(C,2);{var N=ie=>{var k=j5e(),B=j(k),te=j(B);V(B);var O=ee(B,2),R=j(O);Ir(R,17,()=>f(t).slice(0,10),ne=>ne.id,(ne,ue)=>{var he=Y5e(),be=j(he);V(he),Ce(()=>Ge(be,`• ${f(ue).name||"Untitled conversation"}`)),T(ne,he)});var U=ee(R,2);{var Q=ne=>{var ue=W5e(),he=j(ue);V(ue),Ce(()=>Ge(he,`... and ${f(t).length-10} more`)),T(ne,ue)};le(U,ne=>{f(t).length>10&&ne(Q)})}V(O),V(k),Ce(()=>Ge(te,`Exported ${f(t).length??""} conversation${f(t).length===1?"":"s"}`)),T(ie,k)};le(x,ie=>{f(a)&&f(t).length>0&&ie(N)})}V(w);var I=ee(w,2),D=ee(j(I),4);kr(D,{class:"w-full justify-start justify-self-start md:w-auto",onclick:m,variant:"outline",children:(ie,k)=>{var B=K5e(),te=L(B);$U(te,{class:"mr-2 h-4 w-4"}),et(),T(ie,B)},$$slots:{default:!0}});var H=ee(D,2);{var q=ie=>{var k=Z5e(),B=j(k),te=j(B);V(B);var O=ee(B,2),R=j(O);Ir(R,17,()=>f(n).slice(0,10),ne=>ne.id,(ne,ue)=>{var he=X5e(),be=j(he);V(he),Ce(()=>Ge(be,`• ${f(ue).name||"Untitled conversation"}`)),T(ne,he)});var U=ee(R,2);{var Q=ne=>{var ue=Q5e(),he=j(ue);V(ue),Ce(()=>Ge(he,`... and ${f(n).length-10} more`)),T(ne,ue)};le(U,ne=>{f(n).length>10&&ne(Q)})}V(O),V(k),Ce(()=>Ge(te,`Imported ${f(n).length??""} conversation${f(n).length===1?"":"s"}`)),T(ie,k)};le(H,ie=>{f(i)&&f(n).length>0&&ie(q)})}V(I);var $=ee(I,2),K=ee(j($),4);kr(K,{class:"text-destructive-foreground w-full justify-start justify-self-start bg-destructive hover:bg-destructive/80 md:w-auto",onclick:b,variant:"destructive",children:(ie,k)=>{var B=J5e(),te=L(B);Gc(te,{class:"mr-2 h-4 w-4"}),et(),T(ie,B)},$$slots:{default:!0}}),V($),V(S),V(E);var z=ee(E,2);zD(z,{get conversations(){return f(l)},get messageCountMap(){return f(c)},mode:"export",onCancel:()=>M(s,!1),onConfirm:p,get open(){return f(s)},set open(ie){M(s,ie,!0)}});var re=ee(z,2);zD(re,{get conversations(){return f(l)},get messageCountMap(){return f(c)},mode:"import",onCancel:()=>M(o,!1),onConfirm:g,get open(){return f(o)},set open(ie){M(o,ie,!0)}});var W=ee(re,2);eh(W,{title:"Delete all conversations",description:"Are you sure you want to delete all conversations? This action cannot be undone and will permanently remove all your conversations and messages.",confirmText:"Delete All",cancelText:"Cancel",variant:"destructive",get icon(){return Gc},onConfirm:_,onCancel:v,get open(){return f(d)},set open(ie){M(d,ie,!0)}}),T(r,y),we()}var r9e=G("<!> Custom",1);function QD(r,e){let t=Y(e,"class",3,"");Rs(r,{variant:"secondary",get class(){Line truncated
Consider exporting your conversations first if you want to keep a backup.</p> <!></div></div></div> <!> <!> <!>`,1);function oNe(t,e){ye(e,!0);let r=_e(Tr([])),n=_e(Tr([])),a=_e(!1),i=_e(!1),s=_e(!1),o=_e(!1),l=_e(Tr([])),c=_e(Tr(new Map)),u=_e(Tr([])),d=_e(!1);async function h(){try{const ie=qd();if(ie.length===0){ea.info("No conversations to export");return}const M=await Promise.all(ie.map(async B=>{const J=await rt.getConversationMessages(B.id);return{conv:B,messages:J}}));k(c,s4(M),!0),k(l,ie,!0),k(s,!0)}catch(ie){console.error("Failed to load conversations:",ie),alert("Failed to load conversations")}}async function m(ie){try{const M=await Promise.all(ie.map(async B=>{const J=await rt.getConversationMessages(B.id);return{conv:sp(B),messages:sp(J)}}));rt.downloadConversationFile(M,`${new Date().toISOString().split(nG)[0]}_conversations.json`),k(r,ie,!0),k(a,!0),k(i,!1),k(s,!1)}catch(M){console.error("Export failed:",M),alert("Failed to export conversations")}}async function f(){try{const ie=document.createElement("input");ie.type="file",ie.accept=".json",ie.onchange=async M=>{const B=M.target?.files?.[0];if(B)try{const J=await B.text(),N=JSON.parse(J);let O;if(Array.isArray(N))O=N;else if(N&&typeof N=="object"&&"conv"in N&&"messages"in N)O=[N];else throw new Error("Invalid file format: expected array of conversations or single conversation object");k(u,O,!0),k(l,O.map(U=>U.conv),!0),k(c,s4(O),!0),k(o,!0)}catch(J){const N=J instanceof Error?J.message:"Unknown error";console.error("Failed to parse file:",J),alert(`Failed to parse file: ${N}`)}},ie.click()}catch(ie){console.error("Import failed:",ie),alert("Failed to import conversations")}}async function g(ie){try{const M=new Set(ie.map(J=>J.id)),B=sp(p(u)).filter(J=>M.has(J.conv.id));await rt.importConversationsData(B),k(n,ie,!0),k(i,!0),k(a,!1),k(o,!1)}catch(M){console.error("Import failed:",M),alert("Failed to import conversations. Please check the file format.")}}async function b(){try{if(qd().length===0){ea.info("No conversations to delete");return}k(d,!0)}catch(ie){console.error("Failed to load conversations for deletion:",ie),ea.error("Failed to load conversations")}}async function _(){try{await rt.deleteAll(),k(d,!1)}catch(ie){console.error("Failed to delete conversations:",ie)}}function S(){k(d,!1)}var E=sNe(),y=L(E),v=j(y),T=j(v),w=te(j(T),4);Dr(w,{class:"w-full justify-start justify-self-start md:w-auto",onclick:h,variant:"outline",children:(ie,M)=>{var B=XOe(),J=L(B);GS(J,{class:"mr-2 h-4 w-4"}),et(),C(ie,B)},$$slots:{default:!0}});var A=te(w,2);{var I=ie=>{var M=eNe(),B=j(M),J=j(B);Y(B);var N=te(B,2),O=j(N);xr(O,17,()=>p(r).slice(0,10),ne=>ne.id,(ne,ue)=>{var he=ZOe(),be=j(he);Y(he),we(()=>qe(be,`• ${p(ue).name||"Untitled conversation"}`)),C(ne,he)});var U=te(O,2);{var X=ne=>{var ue=JOe(),he=j(ue);Y(ue),we(()=>qe(he,`... and ${p(r).length-10} more`)),C(ne,ue)};le(U,ne=>{p(r).length>10&&ne(X)})}Y(N),Y(M),we(()=>qe(J,`Exported ${p(r).length??""} conversation${p(r).length===1?"":"s"}`)),C(ie,M)};le(A,ie=>{p(a)&&p(r).length>0&&ie(I)})}Y(T);var x=te(T,2),D=te(j(x),4);Dr(D,{class:"w-full justify-start justify-self-start md:w-auto",onclick:f,variant:"outline",children:(ie,M)=>{var B=tNe(),J=L(B);HU(J,{class:"mr-2 h-4 w-4"}),et(),C(ie,B)},$$slots:{default:!0}});var $=te(D,2);{var H=ie=>{var M=aNe(),B=j(M),J=j(B);Y(B);var N=te(B,2),O=j(N);xr(O,17,()=>p(n).slice(0,10),ne=>ne.id,(ne,ue)=>{var he=rNe(),be=j(he);Y(he),we(()=>qe(be,`• ${p(ue).name||"Untitled conversation"}`)),C(ne,he)});var U=te(O,2);{var X=ne=>{var ue=nNe(),he=j(ue);Y(ue),we(()=>qe(he,`... and ${p(n).length-10} more`)),C(ne,ue)};le(U,ne=>{p(n).length>10&&ne(X)})}Y(N),Y(M),we(()=>qe(J,`Imported ${p(n).length??""} conversation${p(n).length===1?"":"s"}`)),C(ie,M)};le($,ie=>{p(i)&&p(n).length>0&&ie(H)})}Y(x);var G=te(x,2),K=te(j(G),4);Dr(K,{class:"text-destructive-foreground w-full justify-start justify-self-start bg-destructive hover:bg-destructive/80 md:w-auto",onclick:b,variant:"destructive",children:(ie,M)=>{var B=iNe(),J=L(B);Wc(J,{class:"mr-2 h-4 w-4"}),et(),C(ie,B)},$$slots:{default:!0}}),Y(G),Y(v),Y(y);var z=te(y,2);V7(z,{get conversations(){return p(l)},get messageCountMap(){return p(c)},mode:"export",onCancel:()=>k(s,!1),onConfirm:m,get open(){return p(s)},set open(ie){k(s,ie,!0)}});var re=te(z,2);V7(re,{get conversations(){return p(l)},get messageCountMap(){return p(c)},mode:"import",onCancel:()=>k(o,!1),onConfirm:g,get open(){return p(o)},set open(ie){k(o,ie,!0)}});var W=te(re,2);oh(W,{title:"Delete all conversations",description:"Are you sure you want to delete all conversations? This action cannot be undone and will permanently remove all your conversations and messages.",confirmText:"Delete All",cancelText:"Cancel",variant:"destructive",get icon(){return Wc},onConfirm:_,onCancel:S,get open(){return p(d)},set open(ie){k(d,ie,!0)}}),C(t,E),Te()}var lNe=q("<!> Custom",1);function tL(t,e){let r=V(e,"class",3,"");Ns(t,{variant:"secondary",get class(){return`h-5 bg-orange-100Line truncated
`;break}case-3:{s=`\r
`;break}case-2:{s=e?" ":" ";break}case-1:{if(!e&&a)continue;s=" ";break}default:s=String.fromCharCode(i)}a=i===-2,n.push(s)}return n.join("")}function vxe(r){const n={constructs:pq([mxe,...(r||{}).extensions||[]]),content:a(D9e),defined:[],document:a(L9e),flow:a(exe),lazy:{},string:a(nxe),text:a(axe)};return n;function a(i){return s;function s(o){return gxe(n,i,o)}}}function yxe(r){for(;!vq(r););return r}const oP=/[\0\t\n\r]/g;function Sxe(){let r=1,e="",t=!0,n;return a;function a(i,s,o){const l=[];let c,u,d,h,p;for(i=e+(typeof i=="string"?i.toString():new TextDecoder(s||void 0).decode(i)),d=0,e="",t&&(i.charCodeAt(0)===65279&&d++,t=void 0);d<i.length;){if(oP.lastIndex=d,c=oP.exec(i),h=c&&c.index!==void 0?c.index:i.length,p=i.charCodeAt(h),!c){e=i.slice(d);break}if(p===10&&d===h&&n)l.push(-3),n=void 0;else switch(n&&(l.push(-5),n=void 0),d<h&&(l.push(i.slice(d,h)),r+=h-d),p){case 0:{l.push(65533),r++;break}case 9:{for(u=Math.ceil(r/4)*4,l.push(-2);r++<u;)l.push(-1);break}case 10:{l.push(-4),r=1;break}default:n=!0,r=1}d=h+1}return o&&(n&&l.push(-5),e&&l.push(e),l.push(null)),l}}const Exe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Cq(r){return r.replace(Exe,wxe)}function wxe(r,e,t){if(e)return e;if(t.charCodeAt(0)===35){const a=t.charCodeAt(1),i=a===120||a===88;return mq(t.slice(i?2:1),i?16:10)}return Wx(t)||r}function N_(r){return!r||typeof r!="object"?"":"position"in r||"type"in r?lP(r.position):"start"in r||"end"in r?lP(r):"line"in r||"column"in r?SA(r):""}function SA(r){return cP(r&&r.line)+":"+cP(r&&r.column)}function lP(r){return SA(r&&r.start)+"-"+SA(r&&r.end)}function cP(r){return r&&typeof r=="number"?r:1}const Aq={}.hasOwnProperty;function Txe(r,e,t){return typeof e!="string"&&(t=e,e=void 0),Cxe(t)(yxe(vxe(t).document().write(Sxe()(r,e,!0))))}function Cxe(r){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Ue),autolinkProtocol:N,autolinkEmail:N,atxHeading:i(ye),blockQuote:i(be),characterEscape:N,characterReference:N,codeFenced:i(Z),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:i(Z,s),codeText:i(ae,s),codeTextData:N,data:N,codeFlowValue:N,definition:i(fe),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:i(pe),hardBreakEscape:i(Te),hardBreakTrailing:i(Te),htmlFlow:i(Oe,s),htmlFlowData:N,htmlText:i(Oe,s),htmlTextData:N,image:i(Ne),label:s,link:i(Ue),listItem:i(Ke),listItemValue:h,listOrdered:i(Fe,d),listUnordered:i(Fe),paragraph:i(He),reference:O,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:i(ye),strong:i(it),thematicBreak:i(dt)},exit:{atxHeading:l(),atxHeadingSequence:S,autolink:l(),autolinkEmail:he,autolinkProtocol:ue,blockQuote:l(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:U,characterReferenceMarkerNumeric:U,characterReferenceValue:Q,characterReference:ne,codeFenced:l(b),codeFencedFence:g,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:I,codeIndented:l(_),codeText:l(K),codeTextData:I,data:I,definition:l(),definitionDestinationString:E,definitionLabelString:v,definitionTitleString:y,emphasis:l(),hardBreakEscape:l(H),hardBreakTrailing:l(H),htmlFlow:l(q),htmlFlowData:I,htmlText:l($),htmlTextData:I,image:l(re),label:ie,labelText:W,lineEnding:D,link:l(z),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:R,resourceDestinationString:k,resourceTitleString:B,resource:te,setextHeading:l(x),setextHeadingLineSequence:C,setextHeadingText:w,strong:l(),thematicBreak:l()}};xq(e,(r||{}).mdastExtensions||[]);const t={};return n;function n(Ae){let Le={type:"root",children:[]};const ht={stack:[Le],tokenStack:[],config:e,enter:o,exit:c,buffer:s,resume:u,data:t},ze=[];let mt=-1;for(;++mt<Ae.length;)if(Ae[mt][1].type==="listOrdered"||Ae[mt][1].type==="listUnordered")if(Ae[mt][0]==="enter")ze.push(mt);else{const At=ze.pop();mt=a(Ae,At,mt)}for(mt=-1;++mt<Ae.length;){const At=e[Ae[mt][0]];Aq.call(At,Ae[mt][1].type)&&At[Ae[mt][1].type].call(Object.assign({sliceSerialize:Ae[mt][2].sliceSerialize},ht),Ae[mt][1])}if(ht.tokenStack.length>0){const At=ht.tokenStack[ht.tokenStack.length-1];(At[1]||uP).call(ht,void 0,At[0])}for(Le.position={start:pu(Ae.length>0?Ae[0][1].start:{line:1,column:1,offset:0}),end:pu(Ae.length>0?Ae[Ae.length-2][1].end:{line:1,column:1,offset:0})},mt=-1;++mt<e.transforms.length;)Le=e.transforms[mt](Le)||Le;return Le}function a(Ae,Le,ht){let ze=Le-1,mt=-1,At=!1,xt,qt,ar,fr;for(;++ze<=ht;){const ct=Ae[ze];switch(ct[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ct[0]==="enter"?mt++:mt--,fr=void 0;break}case"lineEndingBlank":{ct[0]==="enter"&&(xt&&!fr&&!mt&&!ar&&(ar=ze),fr=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:fr=void 0}if(!mt&&ct[0]==="enter"&&ct[1].type==="listItemPrefix"||mt===-1&&ct[0]==="exit"&&(ct[1].type==="listUnordered"||ct[1].type==="listOrdered")){if(xLine truncated
`&&Nq(t.stack,t.unsafe[a]))return/[ \t]/.test(n.before)?"":" ";return`\\
`}function Iq(r,e){const t=String(r);let n=t.indexOf(e),a=n,i=0,s=0;if(typeof e!="string")throw new TypeError("Expected substring");for(;n!==-1;)n===a?++i>s&&(s=i):i=1,a=n+e.length,n=t.indexOf(e,a);return s}function EA(r,e){return!!(e.options.fences===!1&&r.value&&!r.lang&&/[^ \r\n]/.test(r.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(r.value))}function kxe(r){const e=r.options.fence||"`";if(e!=="`"&&e!=="~")throw new Error("Cannot serialize code with `"+e+"` for `options.fence`, expected `` ` `` or `~`");return e}function Mxe(r,e,t,n){const a=kxe(t),i=r.value||"",s=a==="`"?"GraveAccent":"Tilde";if(EA(r,t)){const d=t.enter("codeIndented"),h=t.indentLines(i,Dxe);return d(),h}const o=t.createTracker(n),l=a.repeat(Math.max(Iq(i,a)+1,3)),c=t.enter("codeFenced");let u=o.move(l);if(r.lang){const d=t.enter(`codeFencedLang${s}`);u+=o.move(t.safe(r.lang,{before:u,after:" ",encode:["`"],...o.current()})),d()}if(r.lang&&r.meta){const d=t.enter(`codeFencedMeta${s}`);u+=o.move(" "),u+=o.move(t.safe(r.meta,{before:u,after:`
`;break}case-2:{s=e?" ":" ";break}case-1:{if(!e&&a)continue;s=" ";break}default:s=String.fromCharCode(i)}a=i===-2,n.push(s)}return n.join("")}function wxe(t){const n={constructs:b$([vxe,...(t||{}).extensions||[]]),content:a(GNe),defined:[],document:a(zNe),flow:a(sxe),lazy:{},string:a(cxe),text:a(uxe)};return n;function a(i){return s;function s(o){return yxe(n,i,o)}}}function Axe(t){for(;!T$(t););return t}const dL=/[\0\t\n\r]/g;function Rxe(){let t=1,e="",r=!0,n;return a;function a(i,s,o){const l=[];let c,u,d,h,m;for(i=e+(typeof i=="string"?i.toString():new TextDecoder(s||void 0).decode(i)),d=0,e="",r&&(i.charCodeAt(0)===65279&&d++,r=void 0);d<i.length;){if(dL.lastIndex=d,c=dL.exec(i),h=c&&c.index!==void 0?c.index:i.length,m=i.charCodeAt(h),!c){e=i.slice(d);break}if(m===10&&d===h&&n)l.push(-3),n=void 0;else switch(n&&(l.push(-5),n=void 0),d<h&&(l.push(i.slice(d,h)),t+=h-d),m){case 0:{l.push(65533),t++;break}case 9:{for(u=Math.ceil(t/4)*4,l.push(-2);t++<u;)l.push(-1);break}case 10:{l.push(-4),t=1;break}default:n=!0,t=1}d=h+1}return o&&(n&&l.push(-5),e&&l.push(e),l.push(null)),l}}const Oxe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function N$(t){return t.replace(Oxe,Nxe)}function Nxe(t,e,r){if(e)return e;if(r.charCodeAt(0)===35){const a=r.charCodeAt(1),i=a===120||a===88;return S$(r.slice(i?2:1),i?16:10)}return Xx(r)||t}function M1(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?hL(t.position):"start"in t||"end"in t?hL(t):"line"in t||"column"in t?w2(t):""}function w2(t){return pL(t&&t.line)+":"+pL(t&&t.column)}function hL(t){return w2(t&&t.start)+"-"+w2(t&&t.end)}function pL(t){return t&&typeof t=="number"?t:1}const I$={}.hasOwnProperty;function Ixe(t,e,r){return typeof e!="string"&&(r=e,e=void 0),xxe(r)(Axe(wxe(r).document().write(Rxe()(t,e,!0))))}function xxe(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Ue),autolinkProtocol:I,autolinkEmail:I,atxHeading:i(Ee),blockQuote:i(be),characterEscape:I,characterReference:I,codeFenced:i(Z),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:i(Z,s),codeText:i(ae,s),codeTextData:I,data:I,codeFlowValue:I,definition:i(pe),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:i(me),hardBreakEscape:i(Ce),hardBreakTrailing:i(Ce),htmlFlow:i(Ne,s),htmlFlowData:I,htmlText:i(Ne,s),htmlTextData:I,image:i(Ie),label:s,link:i(Ue),listItem:i(je),listItemValue:h,listOrdered:i(Fe,d),listUnordered:i(Fe),paragraph:i(He),reference:N,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:i(Ee),strong:i(at),thematicBreak:i(dt)},exit:{atxHeading:l(),atxHeadingSequence:v,autolink:l(),autolinkEmail:he,autolinkProtocol:ue,blockQuote:l(),characterEscapeValue:x,characterReferenceMarkerHexadecimal:U,characterReferenceMarkerNumeric:U,characterReferenceValue:X,characterReference:ne,codeFenced:l(b),codeFencedFence:g,codeFencedFenceInfo:m,codeFencedFenceMeta:f,codeFlowValue:x,codeIndented:l(_),codeText:l(K),codeTextData:x,data:x,definition:l(),definitionDestinationString:y,definitionLabelString:S,definitionTitleString:E,emphasis:l(),hardBreakEscape:l($),hardBreakTrailing:l($),htmlFlow:l(H),htmlFlowData:x,htmlText:l(G),htmlTextData:x,image:l(re),label:ie,labelText:W,lineEnding:D,link:l(z),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:O,resourceDestinationString:M,resourceTitleString:B,resource:J,setextHeading:l(A),setextHeadingLineSequence:w,setextHeadingText:T,strong:l(),thematicBreak:l()}};x$(e,(t||{}).mdastExtensions||[]);const r={};return n;function n(Ae){let Le={type:"root",children:[]};const ht={stack:[Le],tokenStack:[],config:e,enter:o,exit:c,buffer:s,resume:u,data:r},ze=[];let ft=-1;for(;++ft<Ae.length;)if(Ae[ft][1].type==="listOrdered"||Ae[ft][1].type==="listUnordered")if(Ae[ft][0]==="enter")ze.push(ft);else{const At=ze.pop();ft=a(Ae,At,ft)}for(ft=-1;++ft<Ae.length;){const At=e[Ae[ft][0]];I$.call(At,Ae[ft][1].type)&&At[Ae[ft][1].type].call(Object.assign({sliceSerialize:Ae[ft][2].sliceSerialize},ht),Ae[ft][1])}if(ht.tokenStack.length>0){const At=ht.tokenStack[ht.tokenStack.length-1];(At[1]||mL).call(ht,void 0,At[0])}for(Le.position={start:Eu(Ae.length>0?Ae[0][1].start:{line:1,column:1,offset:0}),end:Eu(Ae.length>0?Ae[Ae.length-2][1].end:{line:1,column:1,offset:0})},ft=-1;++ft<e.transforms.length;)Le=e.transforms[ft](Le)||Le;return Le}function a(Ae,Le,ht){let ze=Le-1,ft=-1,At=!1,Rt,zt,ir,hr;for(;++ze<=ht;){const lt=Ae[ze];switch(lt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{lt[0]==="enter"?ft++:ft--,hr=void 0;break}case"lineEndingBlank":{lt[0]==="enter"&&(Rt&&!hr&&!ft&&!ir&&(ir=ze),hr=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:hr=void 0}if(!ft&&lt[0]==="enter"&&lt[1].type==="listItemPrefix"||ft===-1&&lt[0]==="exit"&&(lt[1].type==="listUnordered"||lt[1].type==="listOrdered")){if(RtLine truncated
`&&k$(r.stack,r.unsafe[a]))return/[ \t]/.test(n.before)?"":" ";return`\\
`}function P$(t,e){const r=String(t);let n=r.indexOf(e),a=n,i=0,s=0;if(typeof e!="string")throw new TypeError("Expected substring");for(;n!==-1;)n===a?++i>s&&(s=i):i=1,a=n+e.length,n=r.indexOf(e,a);return s}function A2(t,e){return!!(e.options.fences===!1&&t.value&&!t.lang&&/[^ \r\n]/.test(t.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(t.value))}function Bxe(t){const e=t.options.fence||"`";if(e!=="`"&&e!=="~")throw new Error("Cannot serialize code with `"+e+"` for `options.fence`, expected `` ` `` or `~`");return e}function Uxe(t,e,r,n){const a=Bxe(r),i=t.value||"",s=a==="`"?"GraveAccent":"Tilde";if(A2(t,r)){const d=r.enter("codeIndented"),h=r.indentLines(i,Gxe);return d(),h}const o=r.createTracker(n),l=a.repeat(Math.max(P$(i,a)+1,3)),c=r.enter("codeFenced");let u=o.move(l);if(t.lang){const d=r.enter(`codeFencedLang${s}`);u+=o.move(r.safe(t.lang,{before:u,after:" ",encode:["`"],...o.current()})),d()}if(t.lang&&t.meta){const d=r.enter(`codeFencedMeta${s}`);u+=o.move(" "),u+=o.move(r.safe(t.meta,{before:u,after:`
`,encode:["`"],...o.current()})),d()}return u+=o.move(`
`),i&&(u+=o.move(i+`
`)),u+=o.move(l),c(),u}function Dxe(r,e,t){return(t?"":" ")+r}function Kx(r){const e=r.options.quote||'"';if(e!=='"'&&e!=="'")throw new Error("Cannot serialize title with `"+e+"` for `options.quote`, expected `\"`, or `'`");return e}function Pxe(r,e,t,n){const a=Kx(t),i=a==='"'?"Quote":"Apostrophe",s=t.enter("definition");let o=t.enter("label");const l=t.createTracker(n);let c=l.move("[");return c+=l.move(t.safe(t.associationId(r),{before:c,after:"]",...l.current()})),c+=l.move("]: "),o(),!r.url||/[\0- \u007F]/.test(r.url)?(o=t.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(t.safe(r.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(o=t.enter("destinationRaw"),c+=l.move(t.safe(r.url,{before:c,after:r.title?" ":`
`,...l.current()}))),o(),r.title&&(o=t.enter(`title${i}`),c+=l.move(" "+a),c+=l.move(t.safe(r.title,{before:c,after:a,...l.current()})),c+=l.move(a),o()),s(),c}function Lxe(r){const e=r.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}function Gu(r){return"&#x"+r.toString(16).toUpperCase()+";"}function Bb(r,e,t){const n=$f(r),a=$f(e);return n===void 0?a===void 0?t==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:n===1?a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}kq.peek=Fxe;function kq(r,e,t,n){const a=Lxe(t),i=t.enter("emphasis"),s=t.createTracker(n),o=s.move(a);let l=s.move(t.containerPhrasing(r,{after:a,before:o,...s.current()}));const c=l.charCodeAt(0),u=Bb(n.before.charCodeAt(n.before.length-1),c,a);u.inside&&(l=Gu(c)+l.slice(1));const d=l.charCodeAt(l.length-1),h=Bb(n.after.charCodeAt(0),d,a);h.inside&&(l=l.slice(0,-1)+Gu(d));const p=s.move(a);return i(),t.attentionEncodeSurroundingInfo={after:h.outside,before:u.outside},o+l+p}function Fxe(r,e,t){return t.options.emphasis||"*"}const Og=function(r){if(r==null)return Gxe;if(typeof r=="function")return wy(r);if(typeof r=="object")return Array.isArray(r)?Bxe(r):Uxe(r);if(typeof r=="string")return $xe(r);throw new Error("Expected function, string, or object as test")};function Bxe(r){const e=[];let t=-1;for(;++t<r.length;)e[t]=Og(r[t]);return wy(n);function n(...a){let i=-1;for(;++i<e.length;)if(e[i].apply(this,a))return!0;return!1}}function Uxe(r){const e=r;return wy(t);function t(n){const a=n;let i;for(i in r)if(a[i]!==e[i])return!1;return!0}}function $xe(r){return wy(e);function e(t){return t&&t.type===r}}function wy(r){return e;function e(t,n,a){return!!(zxe(t)&&r.call(this,t,typeof n=="number"?n:void 0,a||void 0))}}function Gxe(){return!0}function zxe(r){return r!==null&&typeof r=="object"&&"type"in r}const Mq=[],qxe=!0,wA=!1,Dq="skip";function Ty(r,e,t,n){let a;typeof e=="function"&&typeof t!="function"?(n=t,t=e):a=e;const i=Og(a),s=n?-1:1;o(r,void 0,[])();function o(l,c,u){const d=l&&typeof l=="object"?l:{};if(typeof d.type=="string"){const p=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(p?"<"+p+">":""))+")"})}return h;function h(){let p=Mq,m,g,b;if((!e||i(l,c,u[u.length-1]||void 0))&&(p=Hxe(t(l,u)),p[0]===wA))return p;if("children"in l&&l.children){const _=l;if(_.children&&p[0]!==Dq)for(g=(n?_.children.length:-1)+s,b=u.concat(_);g>-1&&g<_.children.length;){const v=_.children[g];if(m=o(v,g,b)(),m[0]===wA)return m;g=typeof m[1]=="number"?m[1]:g+s}}return p}}}function Hxe(r){return Array.isArray(r)?r:typeof r=="number"?[qxe,r]:r==null?Mq:[r]}function eu(r,e,t,n){let a,i,s;typeof e=="function"&&typeof t!="function"?(i=void 0,s=e,a=t):(i=e,s=t,a=n),Ty(r,i,o,a);function o(l,c){const u=c[c.length-1],d=u?u.children.indexOf(l):void 0;return s(l,d,u)}}function Pq(r,e){let t=!1;return eu(r,function(n){if("value"in n&&/\r?\n|\r/.test(n.value)||n.type==="break")return t=!0,wA}),!!((!r.depth||r.depth<3)&&Yx(r)&&(e.options.setext||t))}function Vxe(r,e,t,n){const a=Math.max(Math.min(6,r.depth||1),1),i=t.createTracker(n);if(Pq(r,t)){const u=t.enter("headingSetext"),d=t.enter("phrasing"),h=t.containerPhrasing(r,{...i.current(),before:`
`)),u+=o.move(l),c(),u}function Gxe(t,e,r){return(r?"":" ")+t}function Jx(t){const e=t.options.quote||'"';if(e!=='"'&&e!=="'")throw new Error("Cannot serialize title with `"+e+"` for `options.quote`, expected `\"`, or `'`");return e}function qxe(t,e,r,n){const a=Jx(r),i=a==='"'?"Quote":"Apostrophe",s=r.enter("definition");let o=r.enter("label");const l=r.createTracker(n);let c=l.move("[");return c+=l.move(r.safe(r.associationId(t),{before:c,after:"]",...l.current()})),c+=l.move("]: "),o(),!t.url||/[\0- \u007F]/.test(t.url)?(o=r.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(r.safe(t.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(o=r.enter("destinationRaw"),c+=l.move(r.safe(t.url,{before:c,after:t.title?" ":`
`,...l.current()}))),o(),t.title&&(o=r.enter(`title${i}`),c+=l.move(" "+a),c+=l.move(r.safe(t.title,{before:c,after:a,...l.current()})),c+=l.move(a),o()),s(),c}function zxe(t){const e=t.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}function Wu(t){return"&#x"+t.toString(16).toUpperCase()+";"}function qb(t,e,r){const n=$p(t),a=$p(e);return n===void 0?a===void 0?r==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:n===1?a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}L$.peek=$xe;function L$(t,e,r,n){const a=zxe(r),i=r.enter("emphasis"),s=r.createTracker(n),o=s.move(a);let l=s.move(r.containerPhrasing(t,{after:a,before:o,...s.current()}));const c=l.charCodeAt(0),u=qb(n.before.charCodeAt(n.before.length-1),c,a);u.inside&&(l=Wu(c)+l.slice(1));const d=l.charCodeAt(l.length-1),h=qb(n.after.charCodeAt(0),d,a);h.inside&&(l=l.slice(0,-1)+Wu(d));const m=s.move(a);return i(),r.attentionEncodeSurroundingInfo={after:h.outside,before:u.outside},o+l+m}function $xe(t,e,r){return r.options.emphasis||"*"}const Dg=function(t){if(t==null)return Wxe;if(typeof t=="function")return AE(t);if(typeof t=="object")return Array.isArray(t)?Hxe(t):Yxe(t);if(typeof t=="string")return Vxe(t);throw new Error("Expected function, string, or object as test")};function Hxe(t){const e=[];let r=-1;for(;++r<t.length;)e[r]=Dg(t[r]);return AE(n);function n(...a){let i=-1;for(;++i<e.length;)if(e[i].apply(this,a))return!0;return!1}}function Yxe(t){const e=t;return AE(r);function r(n){const a=n;let i;for(i in t)if(a[i]!==e[i])return!1;return!0}}function Vxe(t){return AE(e);function e(r){return r&&r.type===t}}function AE(t){return e;function e(r,n,a){return!!(Kxe(r)&&t.call(this,r,typeof n=="number"?n:void 0,a||void 0))}}function Wxe(){return!0}function Kxe(t){return t!==null&&typeof t=="object"&&"type"in t}const F$=[],jxe=!0,R2=!1,B$="skip";function RE(t,e,r,n){let a;typeof e=="function"&&typeof r!="function"?(n=r,r=e):a=e;const i=Dg(a),s=n?-1:1;o(t,void 0,[])();function o(l,c,u){const d=l&&typeof l=="object"?l:{};if(typeof d.type=="string"){const m=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(m?"<"+m+">":""))+")"})}return h;function h(){let m=F$,f,g,b;if((!e||i(l,c,u[u.length-1]||void 0))&&(m=Qxe(r(l,u)),m[0]===R2))return m;if("children"in l&&l.children){const _=l;if(_.children&&m[0]!==B$)for(g=(n?_.children.length:-1)+s,b=u.concat(_);g>-1&&g<_.children.length;){const S=_.children[g];if(f=o(S,g,b)(),f[0]===R2)return f;g=typeof f[1]=="number"?f[1]:g+s}}return m}}}function Qxe(t){return Array.isArray(t)?t:typeof t=="number"?[jxe,t]:t==null?F$:[t]}function su(t,e,r,n){let a,i,s;typeof e=="function"&&typeof r!="function"?(i=void 0,s=e,a=r):(i=e,s=r,a=n),RE(t,i,o,a);function o(l,c){const u=c[c.length-1],d=u?u.children.indexOf(l):void 0;return s(l,d,u)}}function U$(t,e){let r=!1;return su(t,function(n){if("value"in n&&/\r?\n|\r/.test(n.value)||n.type==="break")return r=!0,R2}),!!((!t.depth||t.depth<3)&&Qx(t)&&(e.options.setext||r))}function Xxe(t,e,r,n){const a=Math.max(Math.min(6,t.depth||1),1),i=r.createTracker(n);if(U$(t,r)){const u=r.enter("headingSetext"),d=r.enter("phrasing"),h=r.containerPhrasing(t,{...i.current(),before:`
`,after:`
`});return d(),u(),h+`
`+(a===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
`))+1))}const s="#".repeat(a),o=t.enter("headingAtx"),l=t.enter("phrasing");i.move(s+" ");let c=t.containerPhrasing(r,{before:"# ",after:`
`,...i.current()});return/^[\t ]/.test(c)&&(c=Gu(c.charCodeAt(0))+c.slice(1)),c=c?s+" "+c:s,t.options.closeAtx&&(c+=" "+s),l(),o(),c}Lq.peek=Yxe;function Lq(r){return r.value||""}function Yxe(){return"<"}Fq.peek=Wxe;function Fq(r,e,t,n){const a=Kx(t),i=a==='"'?"Quote":"Apostrophe",s=t.enter("image");let o=t.enter("label");const l=t.createTracker(n);let c=l.move("![");return c+=l.move(t.safe(r.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),o(),!r.url&&r.title||/[\0- \u007F]/.test(r.url)?(o=t.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(t.safe(r.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(o=t.enter("destinationRaw"),c+=l.move(t.safe(r.url,{before:c,after:r.title?" ":")",...l.current()}))),o(),r.title&&(o=t.enter(`title${i}`),c+=l.move(" "+a),c+=l.move(t.safe(r.title,{before:c,after:a,...l.current()})),c+=l.move(a),o()),c+=l.move(")"),s(),c}function Wxe(){return"!"}Bq.peek=jxe;function Bq(r,e,t,n){const a=r.referenceType,i=t.enter("imageReference");let s=t.enter("label");const o=t.createTracker(n);let l=o.move("![");const c=t.safe(r.alt,{before:l,after:"]",...o.current()});l+=o.move(c+"]["),s();const u=t.stack;t.stack=[],s=t.enter("reference");const d=t.safe(t.associationId(r),{before:l,after:"]",...o.current()});return s(),t.stack=u,i(),a==="full"||!c||c!==d?l+=o.move(d+"]"):a==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function jxe(){return"!"}Uq.peek=Kxe;function Uq(r,e,t){let n=r.value||"",a="`",i=-1;for(;new RegExp("(^|[^`])"+a+"([^`]|$)").test(n);)a+="`";for(/[^ \r\n]/.test(n)&&(/^[ \r\n]/.test(n)&&/[ \r\n]$/.test(n)||/^`|`$/.test(n))&&(n=" "+n+" ");++i<t.unsafe.length;){const s=t.unsafe[i],o=t.compilePattern(s);let l;if(s.atBreak)for(;l=o.exec(n);){let c=l.index;n.charCodeAt(c)===10&&n.charCodeAt(c-1)===13&&c--,n=n.slice(0,c)+" "+n.slice(l.index+1)}}return a+n+a}function Kxe(){return"`"}function $q(r,e){const t=Yx(r);return!!(!e.options.resourceLink&&r.url&&!r.title&&r.children&&r.children.length===1&&r.children[0].type==="text"&&(t===r.url||"mailto:"+t===r.url)&&/^[a-z][a-z+.-]+:/i.test(r.url)&&!/[\0- <>\u007F]/.test(r.url))}Gq.peek=Xxe;function Gq(r,e,t,n){const a=Kx(t),i=a==='"'?"Quote":"Apostrophe",s=t.createTracker(n);let o,l;if($q(r,t)){const u=t.stack;t.stack=[],o=t.enter("autolink");let d=s.move("<");return d+=s.move(t.containerPhrasing(r,{before:d,after:">",...s.current()})),d+=s.move(">"),o(),t.stack=u,d}o=t.enter("link"),l=t.enter("label");let c=s.move("[");return c+=s.move(t.containerPhrasing(r,{before:c,after:"](",...s.current()})),c+=s.move("]("),l(),!r.url&&r.title||/[\0- \u007F]/.test(r.url)?(l=t.enter("destinationLiteral"),c+=s.move("<"),c+=s.move(t.safe(r.url,{before:c,after:">",...s.current()})),c+=s.move(">")):(l=t.enter("destinationRaw"),c+=s.move(t.safe(r.url,{before:c,after:r.title?" ":")",...s.current()}))),l(),r.title&&(l=t.enter(`title${i}`),c+=s.move(" "+a),c+=s.move(t.safe(r.title,{before:c,after:a,...s.current()})),c+=s.move(a),l()),c+=s.move(")"),o(),c}function Xxe(r,e,t){return $q(r,t)?"<":"["}zq.peek=Qxe;function zq(r,e,t,n){const a=r.referenceType,i=t.enter("linkReference");let s=t.enter("label");const o=t.createTracker(n);let l=o.move("[");const c=t.containerPhrasing(r,{before:l,after:"]",...o.current()});l+=o.move(c+"]["),s();const u=t.stack;t.stack=[],s=t.enter("reference");const d=t.safe(t.associationId(r),{before:l,after:"]",...o.current()});return s(),t.stack=u,i(),a==="full"||!c||c!==d?l+=o.move(d+"]"):a==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function Qxe(){return"["}function Xx(r){const e=r.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function Zxe(r){const e=Xx(r),t=r.options.bulletOther;if(!t)return e==="*"?"-":"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(t===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+t+"`) to be different");return t}function Jxe(r){const e=r.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function qq(r){const e=r.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function e6e(r,e,t,n){const a=t.enter("list"),i=t.bulletCurrent;let s=r.ordered?Jxe(t):Xx(t);const o=r.ordered?s==="."?")":".":Zxe(t);let l=e&&t.bulletLastUsed?s===t.bulletLastUsed:!1;if(!r.ordered){const u=r.children?r.children[0]:void 0;if((s==="*"||s==="-")&&u&&(!u.children||!u.children[0])&&t.stack[t.stack.length-1]==="list"&&t.stack[t.stack.length-2]==="listItem"&&t.stack[t.stack.length-3]==="list"&&t.stack[t.stack.length-4]==="listItem"&&t.indexStack[t.indexStack.length-1]===0&&t.indexStack[t.indexStack.length-2]===0&&t.indexStack[t.indexStack.length-3]===0&&(l=!0),qq(t)===s&&u){let d=-Line truncated
`,inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"!",after:"\\[",inConstruct:"phrasing",notInConstruct:Td},{character:'"',inConstruct:"titleQuote"},{atBreak:!0,character:"#"},{character:"#",inConstruct:"headingAtx",after:`(?:[\r
]|$)`},{character:"&",after:"[#A-Za-z]",inConstruct:"phrasing"},{character:"'",inConstruct:"titleApostrophe"},{character:"(",inConstruct:"destinationRaw"},{before:"\\]",character:"(",inConstruct:"phrasing",notInConstruct:Td},{atBreak:!0,before:"\\d+",character:")"},{character:")",inConstruct:"destinationRaw"},{atBreak:!0,character:"*",after:`(?:[ \r
*])`},{character:"*",inConstruct:"phrasing",notInConstruct:Td},{atBreak:!0,character:"+",after:`(?:[ \r
`))+1))}const s="#".repeat(a),o=r.enter("headingAtx"),l=r.enter("phrasing");i.move(s+" ");let c=r.containerPhrasing(t,{before:"# ",after:`
`,...i.current()});return/^[\t ]/.test(c)&&(c=Wu(c.charCodeAt(0))+c.slice(1)),c=c?s+" "+c:s,r.options.closeAtx&&(c+=" "+s),l(),o(),c}G$.peek=Zxe;function G$(t){return t.value||""}function Zxe(){return"<"}q$.peek=Jxe;function q$(t,e,r,n){const a=Jx(r),i=a==='"'?"Quote":"Apostrophe",s=r.enter("image");let o=r.enter("label");const l=r.createTracker(n);let c=l.move("![");return c+=l.move(r.safe(t.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),o(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(o=r.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(r.safe(t.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(o=r.enter("destinationRaw"),c+=l.move(r.safe(t.url,{before:c,after:t.title?" ":")",...l.current()}))),o(),t.title&&(o=r.enter(`title${i}`),c+=l.move(" "+a),c+=l.move(r.safe(t.title,{before:c,after:a,...l.current()})),c+=l.move(a),o()),c+=l.move(")"),s(),c}function Jxe(){return"!"}z$.peek=e3e;function z$(t,e,r,n){const a=t.referenceType,i=r.enter("imageReference");let s=r.enter("label");const o=r.createTracker(n);let l=o.move("![");const c=r.safe(t.alt,{before:l,after:"]",...o.current()});l+=o.move(c+"]["),s();const u=r.stack;r.stack=[],s=r.enter("reference");const d=r.safe(r.associationId(t),{before:l,after:"]",...o.current()});return s(),r.stack=u,i(),a==="full"||!c||c!==d?l+=o.move(d+"]"):a==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function e3e(){return"!"}$$.peek=t3e;function $$(t,e,r){let n=t.value||"",a="`",i=-1;for(;new RegExp("(^|[^`])"+a+"([^`]|$)").test(n);)a+="`";for(/[^ \r\n]/.test(n)&&(/^[ \r\n]/.test(n)&&/[ \r\n]$/.test(n)||/^`|`$/.test(n))&&(n=" "+n+" ");++i<r.unsafe.length;){const s=r.unsafe[i],o=r.compilePattern(s);let l;if(s.atBreak)for(;l=o.exec(n);){let c=l.index;n.charCodeAt(c)===10&&n.charCodeAt(c-1)===13&&c--,n=n.slice(0,c)+" "+n.slice(l.index+1)}}return a+n+a}function t3e(){return"`"}function H$(t,e){const r=Qx(t);return!!(!e.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(r===t.url||"mailto:"+r===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}Y$.peek=r3e;function Y$(t,e,r,n){const a=Jx(r),i=a==='"'?"Quote":"Apostrophe",s=r.createTracker(n);let o,l;if(H$(t,r)){const u=r.stack;r.stack=[],o=r.enter("autolink");let d=s.move("<");return d+=s.move(r.containerPhrasing(t,{before:d,after:">",...s.current()})),d+=s.move(">"),o(),r.stack=u,d}o=r.enter("link"),l=r.enter("label");let c=s.move("[");return c+=s.move(r.containerPhrasing(t,{before:c,after:"](",...s.current()})),c+=s.move("]("),l(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(l=r.enter("destinationLiteral"),c+=s.move("<"),c+=s.move(r.safe(t.url,{before:c,after:">",...s.current()})),c+=s.move(">")):(l=r.enter("destinationRaw"),c+=s.move(r.safe(t.url,{before:c,after:t.title?" ":")",...s.current()}))),l(),t.title&&(l=r.enter(`title${i}`),c+=s.move(" "+a),c+=s.move(r.safe(t.title,{before:c,after:a,...s.current()})),c+=s.move(a),l()),c+=s.move(")"),o(),c}function r3e(t,e,r){return H$(t,r)?"<":"["}V$.peek=n3e;function V$(t,e,r,n){const a=t.referenceType,i=r.enter("linkReference");let s=r.enter("label");const o=r.createTracker(n);let l=o.move("[");const c=r.containerPhrasing(t,{before:l,after:"]",...o.current()});l+=o.move(c+"]["),s();const u=r.stack;r.stack=[],s=r.enter("reference");const d=r.safe(r.associationId(t),{before:l,after:"]",...o.current()});return s(),r.stack=u,i(),a==="full"||!c||c!==d?l+=o.move(d+"]"):a==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function n3e(){return"["}function e3(t){const e=t.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function a3e(t){const e=e3(t),r=t.options.bulletOther;if(!r)return e==="*"?"-":"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(r===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+r+"`) to be different");return r}function i3e(t){const e=t.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function W$(t){const e=t.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function s3e(t,e,r,n){const a=r.enter("list"),i=r.bulletCurrent;let s=t.ordered?i3e(r):e3(r);const o=t.ordered?s==="."?")":".":a3e(r);let l=e&&r.bulletLastUsed?s===r.bulletLastUsed:!1;if(!t.ordered){const u=t.children?t.children[0]:void 0;if((s==="*"||s==="-")&&u&&(!u.children||!u.children[0])&&r.stack[r.stack.length-1]==="list"&&r.stack[r.stack.length-2]==="listItem"&&r.stack[r.stack.length-3]==="list"&&r.stack[r.stack.length-4]==="listItem"&&r.indexStack[r.indexStack.length-1]===0&&r.indexStack[r.indexStack.length-2]===0&&r.indexStack[r.indexStack.length-3]===0&&(l=!0),W$(r)===s&&u){let d=-Line truncated
`,inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"!",after:"\\[",inConstruct:"phrasing",notInConstruct:Id},{character:'"',inConstruct:"titleQuote"},{atBreak:!0,character:"#"},{character:"#",inConstruct:"headingAtx",after:`(?:[\r
]|$)`},{character:"&",after:"[#A-Za-z]",inConstruct:"phrasing"},{character:"'",inConstruct:"titleApostrophe"},{character:"(",inConstruct:"destinationRaw"},{before:"\\]",character:"(",inConstruct:"phrasing",notInConstruct:Id},{atBreak:!0,before:"\\d+",character:")"},{character:")",inConstruct:"destinationRaw"},{atBreak:!0,character:"*",after:`(?:[ \r
*])`},{character:"*",inConstruct:"phrasing",notInConstruct:Id},{atBreak:!0,character:"+",after:`(?:[ \r
])`},{atBreak:!0,character:"-",after:`(?:[ \r
-])`},{atBreak:!0,before:"\\d+",character:".",after:`(?:[ \r
]|$)`},{atBreak:!0,character:"<",after:"[!/?A-Za-z]"},{character:"<",after:"[!/?A-Za-z]",inConstruct:"phrasing",notInConstruct:Td},{character:"<",inConstruct:"destinationLiteral"},{atBreak:!0,character:"="},{atBreak:!0,character:">"},{character:">",inConstruct:"destinationLiteral"},{atBreak:!0,character:"["},{character:"[",inConstruct:"phrasing",notInConstruct:Td},{character:"[",inConstruct:["label","reference"]},{character:"\\",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"]",inConstruct:["label","reference"]},{atBreak:!0,character:"_"},{character:"_",inConstruct:"phrasing",notInConstruct:Td},{atBreak:!0,character:"`"},{character:"`",inConstruct:["codeFencedLangGraveAccent","codeFencedMetaGraveAccent"]},{character:"`",inConstruct:"phrasing",notInConstruct:Td},{atBreak:!0,character:"~"}];function p6e(r){return r.label||!r.identifier?r.label||"":Cq(r.identifier)}function m6e(r){if(!r._compiled){const e=(r.atBreak?"[\\r\\n][\\t ]*":"")+(r.before?"(?:"+r.before+")":"");r._compiled=new RegExp((e?"("+e+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(r.character)?"\\":"")+r.character+(r.after?"(?:"+r.after+")":""),"g")}return r._compiled}function g6e(r,e,t){const n=e.indexStack,a=r.children||[],i=[];let s=-1,o=t.before,l;n.push(-1);let c=e.createTracker(t);for(;++s<a.length;){const u=a[s];let d;if(n[n.length-1]=s,s+1<a.length){let m=e.handle.handlers[a[s+1].type];m&&m.peek&&(m=m.peek),d=m?m(a[s+1],r,e,{before:"",after:"",...c.current()}).charAt(0):""}else d=t.after;i.length>0&&(o==="\r"||o===`
`)&&u.type==="html"&&(i[i.length-1]=i[i.length-1].replace(/(\r?\n|\r)$/," "),o=" ",c=e.createTracker(t),c.move(i.join("")));let h=e.handle(u,r,e,{...c.current(),after:d,before:o});l&&l===h.slice(0,1)&&(h=Gu(l.charCodeAt(0))+h.slice(1));const p=e.attentionEncodeSurroundingInfo;e.attentionEncodeSurroundingInfo=void 0,l=void 0,p&&(i.length>0&&p.before&&o===i[i.length-1].slice(-1)&&(i[i.length-1]=i[i.length-1].slice(0,-1)+Gu(o.charCodeAt(0))),p.after&&(l=d)),c.move(h),i.push(h),o=h.slice(-1)}return n.pop(),i.join("")}function _6e(r,e,t){const n=e.indexStack,a=r.children||[],i=e.createTracker(t),s=[];let o=-1;for(n.push(-1);++o<a.length;){const l=a[o];n[n.length-1]=o,s.push(i.move(e.handle(l,r,e,{before:`
]|$)`},{atBreak:!0,character:"<",after:"[!/?A-Za-z]"},{character:"<",after:"[!/?A-Za-z]",inConstruct:"phrasing",notInConstruct:Id},{character:"<",inConstruct:"destinationLiteral"},{atBreak:!0,character:"="},{atBreak:!0,character:">"},{character:">",inConstruct:"destinationLiteral"},{atBreak:!0,character:"["},{character:"[",inConstruct:"phrasing",notInConstruct:Id},{character:"[",inConstruct:["label","reference"]},{character:"\\",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"]",inConstruct:["label","reference"]},{atBreak:!0,character:"_"},{character:"_",inConstruct:"phrasing",notInConstruct:Id},{atBreak:!0,character:"`"},{character:"`",inConstruct:["codeFencedLangGraveAccent","codeFencedMetaGraveAccent"]},{character:"`",inConstruct:"phrasing",notInConstruct:Id},{atBreak:!0,character:"~"}];function E3e(t){return t.label||!t.identifier?t.label||"":N$(t.identifier)}function v3e(t){if(!t._compiled){const e=(t.atBreak?"[\\r\\n][\\t ]*":"")+(t.before?"(?:"+t.before+")":"");t._compiled=new RegExp((e?"("+e+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(t.character)?"\\":"")+t.character+(t.after?"(?:"+t.after+")":""),"g")}return t._compiled}function y3e(t,e,r){const n=e.indexStack,a=t.children||[],i=[];let s=-1,o=r.before,l;n.push(-1);let c=e.createTracker(r);for(;++s<a.length;){const u=a[s];let d;if(n[n.length-1]=s,s+1<a.length){let f=e.handle.handlers[a[s+1].type];f&&f.peek&&(f=f.peek),d=f?f(a[s+1],t,e,{before:"",after:"",...c.current()}).charAt(0):""}else d=r.after;i.length>0&&(o==="\r"||o===`
`)&&u.type==="html"&&(i[i.length-1]=i[i.length-1].replace(/(\r?\n|\r)$/," "),o=" ",c=e.createTracker(r),c.move(i.join("")));let h=e.handle(u,t,e,{...c.current(),after:d,before:o});l&&l===h.slice(0,1)&&(h=Wu(l.charCodeAt(0))+h.slice(1));const m=e.attentionEncodeSurroundingInfo;e.attentionEncodeSurroundingInfo=void 0,l=void 0,m&&(i.length>0&&m.before&&o===i[i.length-1].slice(-1)&&(i[i.length-1]=i[i.length-1].slice(0,-1)+Wu(o.charCodeAt(0))),m.after&&(l=d)),c.move(h),i.push(h),o=h.slice(-1)}return n.pop(),i.join("")}function T3e(t,e,r){const n=e.indexStack,a=t.children||[],i=e.createTracker(r),s=[];let o=-1;for(n.push(-1);++o<a.length;){const l=a[o];n[n.length-1]=o,s.push(i.move(e.handle(l,t,e,{before:`
`,after:`
`,...i.current()}))),l.type!=="list"&&(e.bulletLastUsed=void 0),o<a.length-1&&s.push(i.move(b6e(l,a[o+1],r,e)))}return n.pop(),s.join("")}function b6e(r,e,t,n){let a=n.join.length;for(;a--;){const i=n.join[a](r,e,t,n);if(i===!0||i===1)break;if(typeof i=="number")return`
`,...i.current()}))),l.type!=="list"&&(e.bulletLastUsed=void 0),o<a.length-1&&s.push(i.move(C3e(l,a[o+1],t,e)))}return n.pop(),s.join("")}function C3e(t,e,r,n){let a=n.join.length;for(;a--;){const i=n.join[a](t,e,r,n);if(i===!0||i===1)break;if(typeof i=="number")return`
`.repeat(1+i);if(i===!1)return`
<!---->
`}return`
`}const v6e=/\r?\n|\r/g;function y6e(r,e){const t=[];let n=0,a=0,i;for(;i=v6e.exec(r);)s(r.slice(n,i.index)),t.push(i[0]),n=i.index+i[0].length,a++;return s(r.slice(n)),t.join("");function s(o){t.push(e(o,a,!o))}}function S6e(r,e,t){const n=(t.before||"")+(e||"")+(t.after||""),a=[],i=[],s={};let o=-1;for(;++o<r.unsafe.length;){const u=r.unsafe[o];if(!Nq(r.stack,u))continue;const d=r.compilePattern(u);let h;for(;h=d.exec(n);){const p="before"in u||!!u.atBreak,m="after"in u,g=h.index+(p?h[1].length:0);a.includes(g)?(s[g].before&&!p&&(s[g].before=!1),s[g].after&&!m&&(s[g].after=!1)):(a.push(g),s[g]={before:p,after:m})}}a.sort(E6e);let l=t.before?t.before.length:0;const c=n.length-(t.after?t.after.length:0);for(o=-1;++o<a.length;){const u=a[o];u<l||u>=c||u+1<c&&a[o+1]===u+1&&s[u].after&&!s[u+1].before&&!s[u+1].after||a[o-1]===u-1&&s[u].before&&!s[u-1].before&&!s[u-1].after||(l!==u&&i.push(mP(n.slice(l,u),"\\")),l=u,/[!-/:-@[-`{-~]/.test(n.charAt(u))&&(!t.encode||!t.encode.includes(n.charAt(u)))?i.push("\\"):(i.push(Gu(n.charCodeAt(u))),l++))}return i.push(mP(n.slice(l,c),t.after)),i.join("")}function E6e(r,e){return r-e}function mP(r,e){const t=/\\(?=[!-/:-@[-`{-~])/g,n=[],a=[],i=r+e;let s=-1,o=0,l;for(;l=t.exec(i);)n.push(l.index);for(;++s<n.length;)o!==n[s]&&a.push(r.slice(o,n[s])),a.push("\\"),o=n[s];return a.push(r.slice(o)),a.join("")}function w6e(r){const e=r||{},t=e.now||{};let n=e.lineShift||0,a=t.line||1,i=t.column||1;return{move:l,current:s,shift:o};function s(){return{now:{line:a,column:i},lineShift:n}}function o(c){n+=c}function l(c){const u=c||"",d=u.split(/\r?\n|\r/g),h=d[d.length-1];return a+=d.length-1,i=d.length===1?i+h.length:1+h.length+n,u}}function T6e(r,e){const t=e||{},n={associationId:p6e,containerPhrasing:R6e,containerFlow:O6e,createTracker:w6e,compilePattern:m6e,enter:i,handlers:{...Qx},handle:void 0,indentLines:y6e,indexStack:[],join:[...d6e],options:{},safe:N6e,stack:[],unsafe:[...f6e]};Oq(n,t),n.options.tightDefinitions&&n.join.push(x6e),n.handle=Rq("type",{invalid:C6e,unknown:A6e,handlers:n.handlers});let a=n.handle(r,void 0,n,{before:`
`}const w3e=/\r?\n|\r/g;function A3e(t,e){const r=[];let n=0,a=0,i;for(;i=w3e.exec(t);)s(t.slice(n,i.index)),r.push(i[0]),n=i.index+i[0].length,a++;return s(t.slice(n)),r.join("");function s(o){r.push(e(o,a,!o))}}function R3e(t,e,r){const n=(r.before||"")+(e||"")+(r.after||""),a=[],i=[],s={};let o=-1;for(;++o<t.unsafe.length;){const u=t.unsafe[o];if(!k$(t.stack,u))continue;const d=t.compilePattern(u);let h;for(;h=d.exec(n);){const m="before"in u||!!u.atBreak,f="after"in u,g=h.index+(m?h[1].length:0);a.includes(g)?(s[g].before&&!m&&(s[g].before=!1),s[g].after&&!f&&(s[g].after=!1)):(a.push(g),s[g]={before:m,after:f})}}a.sort(O3e);let l=r.before?r.before.length:0;const c=n.length-(r.after?r.after.length:0);for(o=-1;++o<a.length;){const u=a[o];u<l||u>=c||u+1<c&&a[o+1]===u+1&&s[u].after&&!s[u+1].before&&!s[u+1].after||a[o-1]===u-1&&s[u].before&&!s[u-1].before&&!s[u-1].after||(l!==u&&i.push(SL(n.slice(l,u),"\\")),l=u,/[!-/:-@[-`{-~]/.test(n.charAt(u))&&(!r.encode||!r.encode.includes(n.charAt(u)))?i.push("\\"):(i.push(Wu(n.charCodeAt(u))),l++))}return i.push(SL(n.slice(l,c),r.after)),i.join("")}function O3e(t,e){return t-e}function SL(t,e){const r=/\\(?=[!-/:-@[-`{-~])/g,n=[],a=[],i=t+e;let s=-1,o=0,l;for(;l=r.exec(i);)n.push(l.index);for(;++s<n.length;)o!==n[s]&&a.push(t.slice(o,n[s])),a.push("\\"),o=n[s];return a.push(t.slice(o)),a.join("")}function N3e(t){const e=t||{},r=e.now||{};let n=e.lineShift||0,a=r.line||1,i=r.column||1;return{move:l,current:s,shift:o};function s(){return{now:{line:a,column:i},lineShift:n}}function o(c){n+=c}function l(c){const u=c||"",d=u.split(/\r?\n|\r/g),h=d[d.length-1];return a+=d.length-1,i=d.length===1?i+h.length:1+h.length+n,u}}function I3e(t,e){const r=e||{},n={associationId:E3e,containerPhrasing:k3e,containerFlow:P3e,createTracker:N3e,compilePattern:v3e,enter:i,handlers:{...t3},handle:void 0,indentLines:A3e,indexStack:[],join:[..._3e],options:{},safe:L3e,stack:[],unsafe:[...S3e]};M$(n,r),n.options.tightDefinitions&&n.join.push(M3e),n.handle=D$("type",{invalid:x3e,unknown:D3e,handlers:n.handlers});let a=n.handle(t,void 0,n,{before:`
`,after:`
`,now:{line:1,column:1},lineShift:0});return a&&a.charCodeAt(a.length-1)!==10&&a.charCodeAt(a.length-1)!==13&&(a+=`
`),a;function i(s){return n.stack.push(s),o;function o(){n.stack.pop()}}}function C6e(r){throw new Error("Cannot handle value `"+r+"`, expected node")}function A6e(r){const e=r;throw new Error("Cannot handle unknown node `"+e.type+"`")}function x6e(r,e){if(r.type==="definition"&&r.type===e.type)return 0}function R6e(r,e){return g6e(r,this,e)}function O6e(r,e){return _6e(r,this,e)}function N6e(r,e){return S6e(this,r,e)}function I6e(r){const e=this;e.compiler=t;function t(n){return T6e(n,{...e.data("settings"),...r,extensions:e.data("toMarkdownExtensions")||[]})}}function gP(r){if(r)throw r}var GT,_P;function k6e(){if(_P)return GT;_P=1;var r=Object.prototype.hasOwnProperty,e=Object.prototype.toString,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,a=function(c){return typeof Array.isArray=="function"?Array.isArray(c):e.call(c)==="[object Array]"},i=function(c){if(!c||e.call(c)!=="[object Object]")return!1;var u=r.call(c,"constructor"),d=c.constructor&&c.constructor.prototype&&r.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!u&&!d)return!1;var h;for(h in c);return typeof h>"u"||r.call(c,h)},s=function(c,u){t&&u.name==="__proto__"?t(c,u.name,{enumerable:!0,configurable:!0,value:u.newValue,writable:!0}):c[u.name]=u.newValue},o=function(c,u){if(u==="__proto__")if(r.call(c,u)){if(n)return n(c,u).value}else return;return c[u]};return GT=function l(){var c,u,d,h,p,m,g=arguments[0],b=1,_=arguments.length,v=!1;for(typeof g=="boolean"&&(v=g,g=arguments[1]||{},b=2),(g==null||typeof g!="object"&&typeof g!="function")&&(g={});b<_;++b)if(c=arguments[b],c!=null)for(u in c)d=o(g,u),h=o(c,u),g!==h&&(v&&h&&(i(h)||(p=a(h)))?(p?(p=!1,m=d&&a(d)?d:[]):m=d&&i(d)?d:{},s(g,{name:u,newValue:l(v,m,h)})):typeof h<"u"&&s(g,{name:u,newValue:h}));return g},GT}var M6e=k6e();const zT=sh(M6e);function TA(r){if(typeof r!="object"||r===null)return!1;const e=Object.getPrototypeOf(r);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in r)&&!(Symbol.iterator in r)}function D6e(){const r=[],e={run:t,use:n};return e;function t(...a){let i=-1;const s=a.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);o(null,...a);function o(l,...c){const u=r[++i];let d=-1;if(l){s(l);return}for(;++d<a.length;)(c[d]===null||c[d]===void 0)&&(c[d]=a[d]);a=c,u?P6e(u,o)(...c):s(null,...c)}}function n(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return r.push(a),e}}function P6e(r,e){let t;return n;function n(...s){const o=r.length>s.length;let l;o&&s.push(a);try{l=r.apply(this,s)}catch(c){const u=c;if(o&&t)throw u;return a(u)}o||(l&&l.then&&typeof l.then=="function"?l.then(i,a):l instanceof Error?a(l):i(l))}function a(s,...o){t||(t=!0,e(s,...o))}function i(s){a(null,s)}}function L6e(r){return!r||typeof r!="object"?"":"position"in r||"type"in r?bP(r.position):"start"in r||"end"in r?bP(r):"line"in r||"column"in r?CA(r):""}function CA(r){return vP(r&&r.line)+":"+vP(r&&r.column)}function bP(r){return CA(r&&r.start)+"-"+CA(r&&r.end)}function vP(r){return r&&typeof r=="number"?r:1}class Ms extends Error{constructor(e,t,n){super(),typeof t=="string"&&(n=t,t=void 0);let a="",i={},s=!1;if(t&&("line"in t&&"column"in t?i={place:t}:"start"in t&&"end"in t?i={place:t}:"type"in t?i={ancestors:[t],place:t.position}:i={...t}),typeof e=="string"?a=e:!i.cause&&e&&(s=!0,a=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n=="string"){const l=n.indexOf(":");l===-1?i.ruleId=n:(i.source=n.slice(0,l),i.ruleId=n.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const o=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file,this.message=a,this.line=o?o.line:void 0,this.name=L6e(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=s&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual,this.expected,this.note,this.url}}Ms.prototype.file="";Ms.prototype.name="";Ms.prototype.reason="";Ms.prototype.message="";Ms.prototype.stack="";Ms.prototype.column=void 0;Ms.prototype.line=void 0;Ms.prototype.ancestors=void 0;Ms.prototype.cause=void 0;Ms.prototype.fatal=void 0;Ms.prototype.place=void 0;Ms.prototype.ruleId=void 0;Ms.prototype.source=void 0;const Sl={basename:F6e,dirname:B6e,extname:U6e,join:$6e,sep:"/"};function F6e(r,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');Ng(r);let t=0,n=-1,a=r.length,i;if(e===void 0||e.length===0||e.length>r.length){for(;a--;)if(r.codePointAt(a)===47){if(i){t=a+1;break}}else n<0&&(i=!0,n=a+1);return n<0?"":r.slice(t,n)}if(e===r)return"";let s=-1,o=e.length-1;for(;a--;)if(r.codePointAt(a)===47){if(i){t=a+1;break}}else s<0&&(i=!0,s=a+1),o>-1&&(r.codePointAt(a)===e.codePointAt(o--)?o<0&&(n= Line truncated
`:" ")+i.indentLines(i.containerFlow(n,o.current()),e?jq:kRe))),c(),l}}function kRe(r,e,t){return e===0?r:jq(r,e,t)}function jq(r,e,t){return(t?"":" ")+r}const MRe=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Kq.peek=BRe;function DRe(){return{canContainEols:["delete"],enter:{strikethrough:LRe},exit:{strikethrough:FRe}}}function PRe(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:MRe}],handlers:{delete:Kq}}}function LRe(r){this.enter({type:"delete",children:[]},r)}function FRe(r){this.exit(r)}function Kq(r,e,t,n){const a=t.createTracker(n),i=t.enter("strikethrough");let s=a.move("~~");return s+=t.containerPhrasing(r,{...a.current(),before:s,after:"~"}),s+=a.move("~~"),i(),s}function BRe(){return"~"}function URe(r){return r.length}function $Re(r,e){const t=e||{},n=(t.align||[]).concat(),a=t.stringLength||URe,i=[],s=[],o=[],l=[];let c=0,u=-1;for(;++u<r.length;){const g=[],b=[];let _=-1;for(r[u].length>c&&(c=r[u].length);++_<r[u].length;){const v=GRe(r[u][_]);if(t.alignDelimiters!==!1){const y=a(v);b[_]=y,(l[_]===void 0||y>l[_])&&(l[_]=y)}g.push(v)}s[u]=g,o[u]=b}let d=-1;if(typeof n=="object"&&"length"in n)for(;++d<c;)i[d]=wP(n[d]);else{const g=wP(n);for(;++d<c;)i[d]=g}d=-1;const h=[],p=[];for(;++d<c;){const g=i[d];let b="",_="";g===99?(b=":",_=":"):g===108?b=":":g===114&&(_=":");let v=t.alignDelimiters===!1?1:Math.max(1,l[d]-b.length-_.length);const y=b+"-".repeat(v)+_;t.alignDelimiters!==!1&&(v=b.length+v+_.length,v>l[d]&&(l[d]=v),p[d]=v),h[d]=y}s.splice(1,0,h),o.splice(1,0,p),u=-1;const m=[];for(;++u<s.length;){const g=s[u],b=o[u];d=-1;const _=[];for(;++d<c;){const v=g[d]||"";let y="",E="";if(t.alignDelimiters!==!1){const S=l[d]-(b[d]||0),w=i[d];w===114?y=" ".repeat(S):w===99?S%2?(y=" ".repeat(S/2+.5),E=" ".repeat(S/2-.5)):(y=" ".repeat(S/2),E=y):E=" ".repeat(S)}t.delimiterStart!==!1&&!d&&_.push("|"),t.padding!==!1&&!(t.alignDelimiters===!1&&v==="")&&(t.delimiterStart!==!1||d)&&_.push(" "),t.alignDelimiters!==!1&&_.push(y),_.push(v),t.alignDelimiters!==!1&&_.push(E),t.padding!==!1&&_.push(" "),(t.delimiterEnd!==!1||d!==c-1)&&_.push("|")}m.push(t.delimiterEnd===!1?_.join("").replace(/ +$/,""):_.join(""))}return m.join(`
`)}function GRe(r){return r==null?"":String(r)}function wP(r){const e=typeof r=="string"?r.codePointAt(0):0;return e===67||e===99?99:e===76||e===108?108:e===82||e===114?114:0}function zRe(){return{enter:{table:qRe,tableData:TP,tableHeader:TP,tableRow:VRe},exit:{codeText:YRe,table:HRe,tableData:ZT,tableHeader:ZT,tableRow:ZT}}}function qRe(r){const e=r._align;this.enter({type:"table",align:e.map(function(t){return t==="none"?null:t}),children:[]},r),this.data.inTable=!0}function HRe(r){this.exit(r),this.data.inTable=void 0}function VRe(r){this.enter({type:"tableRow",children:[]},r)}function ZT(r){this.exit(r)}function TP(r){this.enter({type:"tableCell",children:[]},r)}function YRe(r){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,WRe));const t=this.stack[this.stack.length-1];t.type,t.value=e,this.exit(r)}function WRe(r,e){return e==="|"?e:r}function jRe(r){const e=r||{},t=e.tableCellPadding,n=e.tablePipeAlign,a=e.stringLength,i=t?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:s,tableCell:l,tableRow:o}};function s(p,m,g,b){return c(u(p,g,b),p.align)}function o(p,m,g,b){const _=d(p,g,b),v=c([_]);return v.slice(0,v.indexOf(`
`))}function l(p,m,g,b){const _=g.enter("tableCell"),v=g.enter("phrasing"),y=g.containerPhrasing(p,{...b,before:i,after:i});return v(),_(),y}function c(p,m){return $Re(p,{align:m,alignDelimiters:n,padding:t,stringLength:a})}function u(p,m,g){const b=p.children;let _=-1;const v=[],y=m.enter("table");for(;++_<b.length;)v[_]=d(b[_],m,g);return y(),v}function d(p,m,g){const b=p.children;let _=-1;const v=[],y=m.enter("tableRow");for(;++_<b.length;)v[_]=l(b[_],p,m,g);return y(),v}function h(p,m,g){let b=Qx.inlineCode(p,m,g);return g.stack.includes("tableCell")&&(b=b.replace(/\|/g,"\\$&")),b}}function KRe(){return{exit:{taskListCheckValueChecked:CP,taskListCheckValueUnchecked:CP,paragraph:QRe}}}function XRe(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:ZRe}}}function CP(r){const e=this.stack[this.stack.length-2];e.type,e.checked=r.type==="taskListCheckValueChecked"}function QRe(r){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const t=this.stack[this.stack.length-1];t.type;const n=t.children[0];if(n&&n.type==="text"){const a=e.children;let i=-1,s;for(;++i<a.length;){const o=a[i];if(o.type==="paragraph"){s=o;break}}s===t&&(n.value=n.value.slice(1),n.value.length===0?t.children.shift():t.position&&n.position&&typeof n.position.start.offset=="number"&&(n.position.start.column++,n.position.start.offset++,t.position.start=Object.assign({},n.position.start)))}}this.exit(r)}function ZRe(r,e,t,n){const a=r.children[0],i=typeof r.checked=="boolean"&&a&&a.type==="paragraph",s="["+(r.checked?"x":" ")+"] ",o=t.createTracker(n);i&&o.move(s);let l=Qx.listItem(r,e,t,{...n,...o.current()});return i&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),l;function c(u){return u+s}}function JRe(){return[cRe(),NRe(),DRe(),zRe(),KRe()]}function eOe(r){return{extensions:[uRe(),IRe(r),PRe(),jRe(r),XRe()]}}const tOe={tokenize:oOe,partial:!0},Xq={tokenize:lOe,partial:!0},Qq={tokenize:cOe,partial:!0},Zq={tokenize:uOe,partial:!0},rOe={tokenize:dOe,partial:!0},Jq={name:"wwwAutolink",tokenize:iOe,previous:tH},eH={name:"protocolAutolink",tokenize:sOe,previous:rH},tu={name:"emailAutolink",tokenize:aOe,previous:nH},Wl={};function nOe(){return{text:Wl}}let Cd=48;for(;Cd<123;)Wl[Cd]=tu,Cd++,Cd===58?Cd=65:Cd===91&&(Cd=97);Wl[43]=tu;Wl[45]=tu;Wl[46]=tu;Wl[95]=tu;Wl[72]=[tu,eH];Wl[104]=[tu,eH];Wl[87]=[tu,Jq];Wl[119]=[tu,Jq];function aOe(r,e,t){const n=this;let a,i;return s;function s(d){return!xA(d)||!nH.call(n,n.previous)||Jx(n.events)?t(d):(r.enter("literalAutolink"),r.enter("literalAutolinkEmail"),o(d))}function o(d){return xA(d)?(r.consume(d),o):d===64?(r.consume(d),l):t(d)}function l(d){return d===46?r.check(rOe,u,c)(d):d===45||d===95||zi(d)?(i=!0,r.consume(d),l):u(d)}function c(d){return r.consume(d),a=!0,l}function u(d){return i&&a&&is(n.previous)?(r.exit("literalAutolinkEmail"),r.exit("literalAutolink"),e(d)):t(d)}}function iOe(r,e,t){const n=this;return a;function a(s){return s!==87&&s!==119||!tH.call(n,n.previous)||Jx(n.events)?t(s):(r.enter("literalAutolink"),r.enter("literalAutolinkWww"),r.check(tOe,r.attempt(Xq,r.attempt(Qq,i),t),t)(s))}function i(s){return r.exit("literalAutolinkWww"),r.exit("literalAutolink"),e(s)}}function sOe(r,e,t){const n=this;let a="",i=!1;return s;function s(d){return(d===72||d===104)&&rH.call(n,n.previous)&&!Jx(n.events)?(r.enter("literalAutolink"),r.enter("literalAutolinkHttp"),a+=String.fromCodePoint(d),r.consume(d),o):t(d)}function o(d){if(is(d)&&a.length<5)return a+=String.fromCodePoint(d),r.consume(d),o;if(d===58){const h=a.toLowerCase();if(h==="http"||h==="https")return r.consume(d),l}return t(d)}function l(d){return d===47?(r.consume(d),i?c:(i=!0,l)):t(d)}function c(d){return d===null||Fb(d)||ra(d)||th(d)||Sy(d)?t(d):r.attempt(Xq,r.attempt(Qq,u),t)(d)}function u(d){return r.exit("literalAutolinkHttp"),r.exit("literalAutolink"),e(d)}}function oOe(r,e,t){let n=0;return a;function a(s){return(s===87||s===119)&&n<3?(n++,r.consume(s),a):s===46&&n===3?(r.consume(s),i):t(s)}function i(s){return s===null?t(s):e(s)}}function lOe(r,e,t){let n,a,i;return s;function s(c){return c===46||c===95?r.check(Zq,l,o)(c):c===null||ra(c)||th(c)||c!==45&&Sy(c)?l(c):(i=!0,r.consume(c),s)}function o(c){return c===95?n=!0:(a=n,n=void 0),r.consume(c),s}function l(c){return a||n||!i?t(c):e(c)}}function cOe(r,e){let t=0,n=0;return a;function a(s){return s===40?(t++,r.consume(s),a):s===41&&n<t?i(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?r.check(Zq,e,i)(s):s===null||ra(s)||th(s)?e(s):(r.consume(s),a)}function i(s){return s===41&&n++,r.consume(s),a}}function uOe(r,e,t){return n;function n(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(r.consume(o),n):o===38?(r.consume(o),i):o===93?(r.consume(o),a):o===60||o===null||ra(o)||th(o)?e(o):t(o)}function a(o){return o===null||o===40||o===91||ra(o)||th(o)?e(o):n(o)}function i(o){ Line truncated
`,inConstruct:"mathFlowMeta"},{character:"$",after:e?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:t,inlineMath:n}};function t(i,s,o,l){const c=i.value||"",u=o.createTracker(l),d="$".repeat(Math.max(Iq(c,"$")+1,2)),h=o.enter("mathFlow");let p=u.move(d);if(i.meta){const m=o.enter("mathFlowMeta");p+=u.move(o.safe(i.meta,{after:`
`,before:p,encode:["$"],...u.current()})),m()}return p+=u.move(`
`),c&&(p+=u.move(c+`
`)),p+=u.move(d),h(),p}function n(i,s,o){let l=i.value||"",c=1;for(e||c++;new RegExp("(^|[^$])"+"\\$".repeat(c)+"([^$]|$)").test(l);)c++;const u="$".repeat(c);/[^ \r\n]/.test(l)&&(/^[ \r\n]/.test(l)&&/[ \r\n]$/.test(l)||/^\$|\$$/.test(l))&&(l=" "+l+" ");let d=-1;for(;++d<o.unsafe.length;){const h=o.unsafe[d];if(!h.atBreak)continue;const p=o.compilePattern(h);let m;for(;m=p.exec(l);){let g=m.index;l.codePointAt(g)===10&&l.codePointAt(g-1)===13&&g--,l=l.slice(0,g)+" "+l.slice(m.index+1)}}return u+l+u}function a(){return"$"}}const FOe={tokenize:BOe,concrete:!0,name:"mathFlow"},xP={tokenize:UOe,partial:!0};function BOe(r,e,t){const n=this,a=n.events[n.events.length-1],i=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0;let s=0;return o;function o(v){return r.enter("mathFlow"),r.enter("mathFlowFence"),r.enter("mathFlowFenceSequence"),l(v)}function l(v){return v===36?(r.consume(v),s++,l):s<2?t(v):(r.exit("mathFlowFenceSequence"),vn(r,c,"whitespace")(v))}function c(v){return v===null||Nr(v)?d(v):(r.enter("mathFlowFenceMeta"),r.enter("chunkString",{contentType:"string"}),u(v))}function u(v){return v===null||Nr(v)?(r.exit("chunkString"),r.exit("mathFlowFenceMeta"),d(v)):v===36?t(v):(r.consume(v),u)}function d(v){return r.exit("mathFlowFence"),n.interrupt?e(v):r.attempt(xP,h,b)(v)}function h(v){return r.attempt({tokenize:_,partial:!0},b,p)(v)}function p(v){return(i?vn(r,m,"linePrefix",i+1):m)(v)}function m(v){return v===null?b(v):Nr(v)?r.attempt(xP,h,b)(v):(r.enter("mathFlowValue"),g(v))}function g(v){return v===null||Nr(v)?(r.exit("mathFlowValue"),m(v)):(r.consume(v),g)}function b(v){return r.exit("mathFlow"),e(v)}function _(v,y,E){let S=0;return vn(v,w,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function w(N){return v.enter("mathFlowFence"),v.enter("mathFlowFenceSequence"),C(N)}function C(N){return N===36?(S++,v.consume(N),C):S<s?E(N):(v.exit("mathFlowFenceSequence"),vn(v,x,"whitespace")(N))}function x(N){return N===null||Nr(N)?(v.exit("mathFlowFence"),y(N)):E(N)}}}function UOe(r,e,t){const n=this;return a;function a(s){return s===null?e(s):(r.enter("lineEnding"),r.consume(s),r.exit("lineEnding"),i)}function i(s){return n.parser.lazy[n.now().line]?t(s):e(s)}}function $Oe(r){let t=(r||{}).singleDollarTextMath;return t==null&&(t=!0),{tokenize:n,resolve:GOe,previous:zOe,name:"mathText"};function n(a,i,s){let o=0,l,c;return u;function u(g){return a.enter("mathText"),a.enter("mathTextSequence"),d(g)}function d(g){return g===36?(a.consume(g),o++,d):o<2&&!t?s(g):(a.exit("mathTextSequence"),h(g))}function h(g){return g===null?s(g):g===36?(c=a.enter("mathTextSequence"),l=0,m(g)):g===32?(a.enter("space"),a.consume(g),a.exit("space"),h):Nr(g)?(a.enter("lineEnding"),a.consume(g),a.exit("lineEnding"),h):(a.enter("mathTextData"),p(g))}function p(g){return g===null||g===32||g===36||Nr(g)?(a.exit("mathTextData"),h(g)):(a.consume(g),p)}function m(g){return g===36?(a.consume(g),l++,m):l===o?(a.exit("mathTextSequence"),a.exit("mathText"),i(g)):(c.type="mathTextData",p(g))}}}function GOe(r){let e=r.length-4,t=3,n,a;if((r[t][1].type==="lineEnding"||r[t][1].type==="space")&&(r[e][1].type==="lineEnding"||r[e][1].type==="space")){for(n=t;++n<e;)if(r[n][1].type==="mathTextData"){r[e][1].type="mathTextPadding",r[t][1].type="mathTextPadding",t+=2,e-=2;break}}for(n=t-1,e++;++n<=e;)a===void 0?n!==e&&r[n][1].type!=="lineEnding"&&(a=n):(n===e||r[n][1].type==="lineEnding")&&(r[a][1].type="mathTextData",n!==a+2&&(r[a][1].end=r[n-1][1].end,r.splice(a+2,n-a-2),e-=n-a-2,n=a+2),a=void 0);return r}function zOe(r){return r!==36||this.events[this.events.length-1][1].type==="characterEscape"}function qOe(r){return{flow:{36:FOe},text:{36:$Oe(r)}}}class Ws{constructor(e,t,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=n}static range(e,t){return t?!e||!e.loc||!t.loc||e.loc.lexer!==t.loc.lexer?null:new Ws(e.loc.lexer,e.loc.start,t.loc.end):e&&e.loc}}class Oo{constructor(e,t){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=t}range(e,t){return new Oo(t,Ws.range(this,e))}}class $t{constructor(e,t){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var n="KaTeX parse error: "+e,a,i,s=t&&t.loc;if(s&&s.start<=s.end){var o=s.lexer.input;a=s.start,i=s.end,a===o.length?n+=" at end of input: ":n+=" at position "+(a+1)+": ";var l=o.slice(a,i).replace(/[^]/g,"$&̲"),c;a>15?c="…"+o.slice(a-15,a):c=o.slice(0,a);var u;i+15<o.length?u=o.slice(i,i+15)+"…":u=o.slice(i),n+=c+l+u}var d=new Error(n);return d.name="ParseError",d.__proto__=$t.prototype,d.position=a,a!=null&&i!=null&&(d.length=i-a),d.rawMessage=e,d}}$t.prototype.__proto__=Error.prototype;var HOe=function(e,t){return e.indexOf(t)!==-1},VOe=function(e,t){return e===void 0?t:e},YOe=/([A-Z])/g,WOe=function(e){return e.replace(YOe,"-$1").toLowerCase()},jOe={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},KOe=/[&><"']/g;function X Line truncated
`),a;function i(s){return n.stack.push(s),o;function o(){n.stack.pop()}}}function x3e(t){throw new Error("Cannot handle value `"+t+"`, expected node")}function D3e(t){const e=t;throw new Error("Cannot handle unknown node `"+e.type+"`")}function M3e(t,e){if(t.type==="definition"&&t.type===e.type)return 0}function k3e(t,e){return y3e(t,this,e)}function P3e(t,e){return T3e(t,this,e)}function L3e(t,e){return R3e(this,t,e)}function F3e(t){const e=this;e.compiler=r;function r(n){return I3e(n,{...e.data("settings"),...t,extensions:e.data("toMarkdownExtensions")||[]})}}function EL(t){if(t)throw t}var Hw,vL;function B3e(){if(vL)return Hw;vL=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,a=function(c){return typeof Array.isArray=="function"?Array.isArray(c):e.call(c)==="[object Array]"},i=function(c){if(!c||e.call(c)!=="[object Object]")return!1;var u=t.call(c,"constructor"),d=c.constructor&&c.constructor.prototype&&t.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!u&&!d)return!1;var h;for(h in c);return typeof h>"u"||t.call(c,h)},s=function(c,u){r&&u.name==="__proto__"?r(c,u.name,{enumerable:!0,configurable:!0,value:u.newValue,writable:!0}):c[u.name]=u.newValue},o=function(c,u){if(u==="__proto__")if(t.call(c,u)){if(n)return n(c,u).value}else return;return c[u]};return Hw=function l(){var c,u,d,h,m,f,g=arguments[0],b=1,_=arguments.length,S=!1;for(typeof g=="boolean"&&(S=g,g=arguments[1]||{},b=2),(g==null||typeof g!="object"&&typeof g!="function")&&(g={});b<_;++b)if(c=arguments[b],c!=null)for(u in c)d=o(g,u),h=o(c,u),g!==h&&(S&&h&&(i(h)||(m=a(h)))?(m?(m=!1,f=d&&a(d)?d:[]):f=d&&i(d)?d:{},s(g,{name:u,newValue:l(S,f,h)})):typeof h<"u"&&s(g,{name:u,newValue:h}));return g},Hw}var U3e=B3e();const Yw=ph(U3e);function O2(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function G3e(){const t=[],e={run:r,use:n};return e;function r(...a){let i=-1;const s=a.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);o(null,...a);function o(l,...c){const u=t[++i];let d=-1;if(l){s(l);return}for(;++d<a.length;)(c[d]===null||c[d]===void 0)&&(c[d]=a[d]);a=c,u?q3e(u,o)(...c):s(null,...c)}}function n(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return t.push(a),e}}function q3e(t,e){let r;return n;function n(...s){const o=t.length>s.length;let l;o&&s.push(a);try{l=t.apply(this,s)}catch(c){const u=c;if(o&&r)throw u;return a(u)}o||(l&&l.then&&typeof l.then=="function"?l.then(i,a):l instanceof Error?a(l):i(l))}function a(s,...o){r||(r=!0,e(s,...o))}function i(s){a(null,s)}}function z3e(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?yL(t.position):"start"in t||"end"in t?yL(t):"line"in t||"column"in t?N2(t):""}function N2(t){return TL(t&&t.line)+":"+TL(t&&t.column)}function yL(t){return N2(t&&t.start)+"-"+N2(t&&t.end)}function TL(t){return t&&typeof t=="number"?t:1}class ks extends Error{constructor(e,r,n){super(),typeof r=="string"&&(n=r,r=void 0);let a="",i={},s=!1;if(r&&("line"in r&&"column"in r?i={place:r}:"start"in r&&"end"in r?i={place:r}:"type"in r?i={ancestors:[r],place:r.position}:i={...r}),typeof e=="string"?a=e:!i.cause&&e&&(s=!0,a=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n=="string"){const l=n.indexOf(":");l===-1?i.ruleId=n:(i.source=n.slice(0,l),i.ruleId=n.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const o=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file,this.message=a,this.line=o?o.line:void 0,this.name=z3e(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=s&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual,this.expected,this.note,this.url}}ks.prototype.file="";ks.prototype.name="";ks.prototype.reason="";ks.prototype.message="";ks.prototype.stack="";ks.prototype.column=void 0;ks.prototype.line=void 0;ks.prototype.ancestors=void 0;ks.prototype.cause=void 0;ks.prototype.fatal=void 0;ks.prototype.place=void 0;ks.prototype.ruleId=void 0;ks.prototype.source=void 0;const Al={basename:$3e,dirname:H3e,extname:Y3e,join:V3e,sep:"/"};function $3e(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');Mg(t);let r=0,n=-1,a=t.length,i;if(e===void 0||e.length===0||e.length>t.length){for(;a--;)if(t.codePointAt(a)===47){if(i){r=a+1;break}}else n<0&&(i=!0,n=a+1);return n<0?"":t.slice(r,n)}if(e===t)return"";let s=-1,o=e.length-1;for(;a--;)if(t.codePointAt(a)===47){if(i){r=a+1;break}}else s<0&&(i=!0,s=a+1),o>-1&&(t.codePointAt(a)===e.codePointAt(o--)?o<0&&(n= Line truncated
`:" ")+i.indentLines(i.containerFlow(n,o.current()),e?Z$:BDe))),c(),l}}function BDe(t,e,r){return e===0?t:Z$(t,e,r)}function Z$(t,e,r){return(r?"":" ")+t}const UDe=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];J$.peek=HDe;function GDe(){return{canContainEols:["delete"],enter:{strikethrough:zDe},exit:{strikethrough:$De}}}function qDe(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:UDe}],handlers:{delete:J$}}}function zDe(t){this.enter({type:"delete",children:[]},t)}function $De(t){this.exit(t)}function J$(t,e,r,n){const a=r.createTracker(n),i=r.enter("strikethrough");let s=a.move("~~");return s+=r.containerPhrasing(t,{...a.current(),before:s,after:"~"}),s+=a.move("~~"),i(),s}function HDe(){return"~"}function YDe(t){return t.length}function VDe(t,e){const r=e||{},n=(r.align||[]).concat(),a=r.stringLength||YDe,i=[],s=[],o=[],l=[];let c=0,u=-1;for(;++u<t.length;){const g=[],b=[];let _=-1;for(t[u].length>c&&(c=t[u].length);++_<t[u].length;){const S=WDe(t[u][_]);if(r.alignDelimiters!==!1){const E=a(S);b[_]=E,(l[_]===void 0||E>l[_])&&(l[_]=E)}g.push(S)}s[u]=g,o[u]=b}let d=-1;if(typeof n=="object"&&"length"in n)for(;++d<c;)i[d]=RL(n[d]);else{const g=RL(n);for(;++d<c;)i[d]=g}d=-1;const h=[],m=[];for(;++d<c;){const g=i[d];let b="",_="";g===99?(b=":",_=":"):g===108?b=":":g===114&&(_=":");let S=r.alignDelimiters===!1?1:Math.max(1,l[d]-b.length-_.length);const E=b+"-".repeat(S)+_;r.alignDelimiters!==!1&&(S=b.length+S+_.length,S>l[d]&&(l[d]=S),m[d]=S),h[d]=E}s.splice(1,0,h),o.splice(1,0,m),u=-1;const f=[];for(;++u<s.length;){const g=s[u],b=o[u];d=-1;const _=[];for(;++d<c;){const S=g[d]||"";let E="",y="";if(r.alignDelimiters!==!1){const v=l[d]-(b[d]||0),T=i[d];T===114?E=" ".repeat(v):T===99?v%2?(E=" ".repeat(v/2+.5),y=" ".repeat(v/2-.5)):(E=" ".repeat(v/2),y=E):y=" ".repeat(v)}r.delimiterStart!==!1&&!d&&_.push("|"),r.padding!==!1&&!(r.alignDelimiters===!1&&S==="")&&(r.delimiterStart!==!1||d)&&_.push(" "),r.alignDelimiters!==!1&&_.push(E),_.push(S),r.alignDelimiters!==!1&&_.push(y),r.padding!==!1&&_.push(" "),(r.delimiterEnd!==!1||d!==c-1)&&_.push("|")}f.push(r.delimiterEnd===!1?_.join("").replace(/ +$/,""):_.join(""))}return f.join(`
`)}function WDe(t){return t==null?"":String(t)}function RL(t){const e=typeof t=="string"?t.codePointAt(0):0;return e===67||e===99?99:e===76||e===108?108:e===82||e===114?114:0}function KDe(){return{enter:{table:jDe,tableData:OL,tableHeader:OL,tableRow:XDe},exit:{codeText:ZDe,table:QDe,tableData:tA,tableHeader:tA,tableRow:tA}}}function jDe(t){const e=t._align;this.enter({type:"table",align:e.map(function(r){return r==="none"?null:r}),children:[]},t),this.data.inTable=!0}function QDe(t){this.exit(t),this.data.inTable=void 0}function XDe(t){this.enter({type:"tableRow",children:[]},t)}function tA(t){this.exit(t)}function OL(t){this.enter({type:"tableCell",children:[]},t)}function ZDe(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,JDe));const r=this.stack[this.stack.length-1];r.type,r.value=e,this.exit(t)}function JDe(t,e){return e==="|"?e:t}function e5e(t){const e=t||{},r=e.tableCellPadding,n=e.tablePipeAlign,a=e.stringLength,i=r?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:s,tableCell:l,tableRow:o}};function s(m,f,g,b){return c(u(m,g,b),m.align)}function o(m,f,g,b){const _=d(m,g,b),S=c([_]);return S.slice(0,S.indexOf(`
`))}function l(m,f,g,b){const _=g.enter("tableCell"),S=g.enter("phrasing"),E=g.containerPhrasing(m,{...b,before:i,after:i});return S(),_(),E}function c(m,f){return VDe(m,{align:f,alignDelimiters:n,padding:r,stringLength:a})}function u(m,f,g){const b=m.children;let _=-1;const S=[],E=f.enter("table");for(;++_<b.length;)S[_]=d(b[_],f,g);return E(),S}function d(m,f,g){const b=m.children;let _=-1;const S=[],E=f.enter("tableRow");for(;++_<b.length;)S[_]=l(b[_],m,f,g);return E(),S}function h(m,f,g){let b=t3.inlineCode(m,f,g);return g.stack.includes("tableCell")&&(b=b.replace(/\|/g,"\\$&")),b}}function t5e(){return{exit:{taskListCheckValueChecked:NL,taskListCheckValueUnchecked:NL,paragraph:n5e}}}function r5e(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:a5e}}}function NL(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function n5e(t){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const r=this.stack[this.stack.length-1];r.type;const n=r.children[0];if(n&&n.type==="text"){const a=e.children;let i=-1,s;for(;++i<a.length;){const o=a[i];if(o.type==="paragraph"){s=o;break}}s===r&&(n.value=n.value.slice(1),n.value.length===0?r.children.shift():r.position&&n.position&&typeof n.position.start.offset=="number"&&(n.position.start.column++,n.position.start.offset++,r.position.start=Object.assign({},n.position.start)))}}this.exit(t)}function a5e(t,e,r,n){const a=t.children[0],i=typeof t.checked=="boolean"&&a&&a.type==="paragraph",s="["+(t.checked?"x":" ")+"] ",o=r.createTracker(n);i&&o.move(s);let l=t3.listItem(t,e,r,{...n,...o.current()});return i&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),l;function c(u){return u+s}}function i5e(){return[fDe(),LDe(),GDe(),KDe(),t5e()]}function s5e(t){return{extensions:[gDe(),FDe(t),qDe(),e5e(t),r5e()]}}const o5e={tokenize:p5e,partial:!0},eH={tokenize:m5e,partial:!0},tH={tokenize:f5e,partial:!0},rH={tokenize:g5e,partial:!0},l5e={tokenize:_5e,partial:!0},nH={name:"wwwAutolink",tokenize:d5e,previous:iH},aH={name:"protocolAutolink",tokenize:h5e,previous:sH},ou={name:"emailAutolink",tokenize:u5e,previous:oH},Zl={};function c5e(){return{text:Zl}}let xd=48;for(;xd<123;)Zl[xd]=ou,xd++,xd===58?xd=65:xd===91&&(xd=97);Zl[43]=ou;Zl[45]=ou;Zl[46]=ou;Zl[95]=ou;Zl[72]=[ou,aH];Zl[104]=[ou,aH];Zl[87]=[ou,nH];Zl[119]=[ou,nH];function u5e(t,e,r){const n=this;let a,i;return s;function s(d){return!x2(d)||!oH.call(n,n.previous)||n3(n.events)?r(d):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),o(d))}function o(d){return x2(d)?(t.consume(d),o):d===64?(t.consume(d),l):r(d)}function l(d){return d===46?t.check(l5e,u,c)(d):d===45||d===95||Hi(d)?(i=!0,t.consume(d),l):u(d)}function c(d){return t.consume(d),a=!0,l}function u(d){return i&&a&&ls(n.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(d)):r(d)}}function d5e(t,e,r){const n=this;return a;function a(s){return s!==87&&s!==119||!iH.call(n,n.previous)||n3(n.events)?r(s):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(o5e,t.attempt(eH,t.attempt(tH,i),r),r)(s))}function i(s){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(s)}}function h5e(t,e,r){const n=this;let a="",i=!1;return s;function s(d){return(d===72||d===104)&&sH.call(n,n.previous)&&!n3(n.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),a+=String.fromCodePoint(d),t.consume(d),o):r(d)}function o(d){if(ls(d)&&a.length<5)return a+=String.fromCodePoint(d),t.consume(d),o;if(d===58){const h=a.toLowerCase();if(h==="http"||h==="https")return t.consume(d),l}return r(d)}function l(d){return d===47?(t.consume(d),i?c:(i=!0,l)):r(d)}function c(d){return d===null||Gb(d)||na(d)||lh(d)||CE(d)?r(d):t.attempt(eH,t.attempt(tH,u),r)(d)}function u(d){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(d)}}function p5e(t,e,r){let n=0;return a;function a(s){return(s===87||s===119)&&n<3?(n++,t.consume(s),a):s===46&&n===3?(t.consume(s),i):r(s)}function i(s){return s===null?r(s):e(s)}}function m5e(t,e,r){let n,a,i;return s;function s(c){return c===46||c===95?t.check(rH,l,o)(c):c===null||na(c)||lh(c)||c!==45&&CE(c)?l(c):(i=!0,t.consume(c),s)}function o(c){return c===95?n=!0:(a=n,n=void 0),t.consume(c),s}function l(c){return a||n||!i?r(c):e(c)}}function f5e(t,e){let r=0,n=0;return a;function a(s){return s===40?(r++,t.consume(s),a):s===41&&n<r?i(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?t.check(rH,e,i)(s):s===null||na(s)||lh(s)?e(s):(t.consume(s),a)}function i(s){return s===41&&n++,t.consume(s),a}}function g5e(t,e,r){return n;function n(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(t.consume(o),n):o===38?(t.consume(o),i):o===93?(t.consume(o),a):o===60||o===null||na(o)||lh(o)?e(o):r(o)}function a(o){return o===null||o===40||o===91||na(o)||lh(o)?e(o):n(o)}function i(o){ Line truncated
`,inConstruct:"mathFlowMeta"},{character:"$",after:e?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:r,inlineMath:n}};function r(i,s,o,l){const c=i.value||"",u=o.createTracker(l),d="$".repeat(Math.max(P$(c,"$")+1,2)),h=o.enter("mathFlow");let m=u.move(d);if(i.meta){const f=o.enter("mathFlowMeta");m+=u.move(o.safe(i.meta,{after:`
`,before:m,encode:["$"],...u.current()})),f()}return m+=u.move(`
`),c&&(m+=u.move(c+`
`)),m+=u.move(d),h(),m}function n(i,s,o){let l=i.value||"",c=1;for(e||c++;new RegExp("(^|[^$])"+"\\$".repeat(c)+"([^$]|$)").test(l);)c++;const u="$".repeat(c);/[^ \r\n]/.test(l)&&(/^[ \r\n]/.test(l)&&/[ \r\n]$/.test(l)||/^\$|\$$/.test(l))&&(l=" "+l+" ");let d=-1;for(;++d<o.unsafe.length;){const h=o.unsafe[d];if(!h.atBreak)continue;const m=o.compilePattern(h);let f;for(;f=m.exec(l);){let g=f.index;l.codePointAt(g)===10&&l.codePointAt(g-1)===13&&g--,l=l.slice(0,g)+" "+l.slice(f.index+1)}}return u+l+u}function a(){return"$"}}const $5e={tokenize:H5e,concrete:!0,name:"mathFlow"},xL={tokenize:Y5e,partial:!0};function H5e(t,e,r){const n=this,a=n.events[n.events.length-1],i=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0;let s=0;return o;function o(S){return t.enter("mathFlow"),t.enter("mathFlowFence"),t.enter("mathFlowFenceSequence"),l(S)}function l(S){return S===36?(t.consume(S),s++,l):s<2?r(S):(t.exit("mathFlowFenceSequence"),En(t,c,"whitespace")(S))}function c(S){return S===null||Ir(S)?d(S):(t.enter("mathFlowFenceMeta"),t.enter("chunkString",{contentType:"string"}),u(S))}function u(S){return S===null||Ir(S)?(t.exit("chunkString"),t.exit("mathFlowFenceMeta"),d(S)):S===36?r(S):(t.consume(S),u)}function d(S){return t.exit("mathFlowFence"),n.interrupt?e(S):t.attempt(xL,h,b)(S)}function h(S){return t.attempt({tokenize:_,partial:!0},b,m)(S)}function m(S){return(i?En(t,f,"linePrefix",i+1):f)(S)}function f(S){return S===null?b(S):Ir(S)?t.attempt(xL,h,b)(S):(t.enter("mathFlowValue"),g(S))}function g(S){return S===null||Ir(S)?(t.exit("mathFlowValue"),f(S)):(t.consume(S),g)}function b(S){return t.exit("mathFlow"),e(S)}function _(S,E,y){let v=0;return En(S,T,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function T(I){return S.enter("mathFlowFence"),S.enter("mathFlowFenceSequence"),w(I)}function w(I){return I===36?(v++,S.consume(I),w):v<s?y(I):(S.exit("mathFlowFenceSequence"),En(S,A,"whitespace")(I))}function A(I){return I===null||Ir(I)?(S.exit("mathFlowFence"),E(I)):y(I)}}}function Y5e(t,e,r){const n=this;return a;function a(s){return s===null?e(s):(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),i)}function i(s){return n.parser.lazy[n.now().line]?r(s):e(s)}}function V5e(t){let r=(t||{}).singleDollarTextMath;return r==null&&(r=!0),{tokenize:n,resolve:W5e,previous:K5e,name:"mathText"};function n(a,i,s){let o=0,l,c;return u;function u(g){return a.enter("mathText"),a.enter("mathTextSequence"),d(g)}function d(g){return g===36?(a.consume(g),o++,d):o<2&&!r?s(g):(a.exit("mathTextSequence"),h(g))}function h(g){return g===null?s(g):g===36?(c=a.enter("mathTextSequence"),l=0,f(g)):g===32?(a.enter("space"),a.consume(g),a.exit("space"),h):Ir(g)?(a.enter("lineEnding"),a.consume(g),a.exit("lineEnding"),h):(a.enter("mathTextData"),m(g))}function m(g){return g===null||g===32||g===36||Ir(g)?(a.exit("mathTextData"),h(g)):(a.consume(g),m)}function f(g){return g===36?(a.consume(g),l++,f):l===o?(a.exit("mathTextSequence"),a.exit("mathText"),i(g)):(c.type="mathTextData",m(g))}}}function W5e(t){let e=t.length-4,r=3,n,a;if((t[r][1].type==="lineEnding"||t[r][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(n=r;++n<e;)if(t[n][1].type==="mathTextData"){t[e][1].type="mathTextPadding",t[r][1].type="mathTextPadding",r+=2,e-=2;break}}for(n=r-1,e++;++n<=e;)a===void 0?n!==e&&t[n][1].type!=="lineEnding"&&(a=n):(n===e||t[n][1].type==="lineEnding")&&(t[a][1].type="mathTextData",n!==a+2&&(t[a][1].end=t[n-1][1].end,t.splice(a+2,n-a-2),e-=n-a-2,n=a+2),a=void 0);return t}function K5e(t){return t!==36||this.events[this.events.length-1][1].type==="characterEscape"}function j5e(t){return{flow:{36:$5e},text:{36:V5e(t)}}}class Qs{constructor(e,r,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=r,this.end=n}static range(e,r){return r?!e||!e.loc||!r.loc||e.loc.lexer!==r.loc.lexer?null:new Qs(e.loc.lexer,e.loc.start,r.loc.end):e&&e.loc}}class ko{constructor(e,r){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=r}range(e,r){return new ko(r,Qs.range(this,e))}}class qt{constructor(e,r){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var n="KaTeX parse error: "+e,a,i,s=r&&r.loc;if(s&&s.start<=s.end){var o=s.lexer.input;a=s.start,i=s.end,a===o.length?n+=" at end of input: ":n+=" at position "+(a+1)+": ";var l=o.slice(a,i).replace(/[^]/g,"$&̲"),c;a>15?c="…"+o.slice(a-15,a):c=o.slice(0,a);var u;i+15<o.length?u=o.slice(i,i+15)+"…":u=o.slice(i),n+=c+l+u}var d=new Error(n);return d.name="ParseError",d.__proto__=qt.prototype,d.position=a,a!=null&&i!=null&&(d.length=i-a),d.rawMessage=e,d}}qt.prototype.__proto__=Error.prototype;var Q5e=function(e,r){return e.indexOf(r)!==-1},X5e=function(e,r){return e===void 0?r:e},Z5e=/([A-Z])/g,J5e=function(e){return e.replace(Z5e,"-$1").toLowerCase()},eMe={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},tMe=/[&><"']/g;function r Line truncated
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
c44.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
@@ -193,7 +193,7 @@ c5.3,-9.3,12,-14,20,-14
H400000v`+(40+e)+`H845.2724
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
M`+(834+e)+" "+t+"h400000v"+(40+e)+"h-400000z"},cNe=function(e,t){return"M263,"+(601+e+t)+`c0.7,0,18,39.7,52,119
M`+(834+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},fMe=function(e,r){return"M263,"+(601+e+r)+`c0.7,0,18,39.7,52,119
c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
c340,-704.7,510.7,-1060.3,512,-1067
l`+e/2.084+" -"+e+`
@@ -203,7 +203,7 @@ s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,
c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
M`+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"},uNe=function(e,t){return"M983 "+(10+e+t)+`
M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},gMe=function(e,r){return"M983 "+(10+e+r)+`
l`+e/3.13+" -"+e+`
c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+`
H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
@@ -212,7 +212,7 @@ c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
c53.7,-170.3,84.5,-266.8,92.5,-289.5z
M`+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"},dNe=function(e,t){return"M424,"+(2398+e+t)+`
M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},_Me=function(e,r){return"M424,"+(2398+e+r)+`
c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
@@ -221,19 +221,19 @@ l`+e/4.223+" -"+e+`c4,-6.7,10,-10,18,-10 H400000
v`+(40+e)+`H1014.6
s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
c-2,6,-10,9,-24,9
c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+" "+t+`
h400000v`+(40+e)+"h-400000z"},hNe=function(e,t){return"M473,"+(2713+e+t)+`
c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+" "+r+`
h400000v`+(40+e)+"h-400000z"},bMe=function(e,r){return"M473,"+(2713+e+r)+`
c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+" -"+e+`
c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`H1017.7
s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
606zM`+(1001+e)+" "+t+"h400000v"+(40+e)+"H1017.7z"},fNe=function(e){var t=e/2;return"M400000 "+e+" H0 L"+t+" 0 l65 45 L145 "+(e-80)+" H400000z"},pNe=function(e,t,n){var a=n-54-t-e;return"M702 "+(e+t)+"H400000"+(40+e)+`
606zM`+(1001+e)+" "+r+"h400000v"+(40+e)+"H1017.7z"},SMe=function(e){var r=e/2;return"M400000 "+e+" H0 L"+r+" 0 l65 45 L145 "+(e-80)+" H400000z"},EMe=function(e,r,n){var a=n-54-r-e;return"M702 "+(e+r)+"H400000"+(40+e)+`
H742v`+a+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
219 661 l218 661zM702 `+t+"H400000v"+(40+e)+"H742z"},mNe=function(e,t,n){t=1e3*t;var a="";switch(e){case"sqrtMain":a=lNe(t,Mh);break;case"sqrtSize1":a=cNe(t,Mh);break;case"sqrtSize2":a=uNe(t,Mh);break;case"sqrtSize3":a=dNe(t,Mh);break;case"sqrtSize4":a=hNe(t,Mh);break;case"sqrtTall":a=pNe(t,Mh,n)}return a},gNe=function(e,t){switch(e){case"⎜":return"M291 0 H417 V"+t+" H291z M291 0 H417 V"+t+" H291z";case"∣":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145z";case"∥":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145z"+("M367 0 H410 V"+t+" H367z M367 0 H410 V"+t+" H367z");case"⎟":return"M457 0 H583 V"+t+" H457z M457 0 H583 V"+t+" H457z";case"⎢":return"M319 0 H403 V"+t+" H319z M319 0 H403 V"+t+" H319z";case"⎥":return"M263 0 H347 V"+t+" H263z M263 0 H347 V"+t+" H263z";case"⎪":return"M384 0 H504 V"+t+" H384z M384 0 H504 V"+t+" H384z";case"⏐":return"M312 0 H355 V"+t+" H312z M312 0 H355 V"+t+" H312z";case"‖":return"M257 0 H300 V"+t+" H257z M257 0 H300 V"+t+" H257z"+("M478 0 H521 V"+t+" H478z M478 0 H521 V"+t+" H478z");default:return""}},RP={doubleleftarrow:`M262 157
219 661 l218 661zM702 `+r+"H400000v"+(40+e)+"H742z"},vMe=function(e,r,n){r=1e3*r;var a="";switch(e){case"sqrtMain":a=mMe(r,Fh);break;case"sqrtSize1":a=fMe(r,Fh);break;case"sqrtSize2":a=gMe(r,Fh);break;case"sqrtSize3":a=_Me(r,Fh);break;case"sqrtSize4":a=bMe(r,Fh);break;case"sqrtTall":a=EMe(r,Fh,n)}return a},yMe=function(e,r){switch(e){case"⎜":return"M291 0 H417 V"+r+" H291z M291 0 H417 V"+r+" H291z";case"∣":return"M145 0 H188 V"+r+" H145z M145 0 H188 V"+r+" H145z";case"∥":return"M145 0 H188 V"+r+" H145z M145 0 H188 V"+r+" H145z"+("M367 0 H410 V"+r+" H367z M367 0 H410 V"+r+" H367z");case"⎟":return"M457 0 H583 V"+r+" H457z M457 0 H583 V"+r+" H457z";case"⎢":return"M319 0 H403 V"+r+" H319z M319 0 H403 V"+r+" H319z";case"⎥":return"M263 0 H347 V"+r+" H263z M263 0 H347 V"+r+" H263z";case"⎪":return"M384 0 H504 V"+r+" H384z M384 0 H504 V"+r+" H384z";case"⏐":return"M312 0 H355 V"+r+" H312z M312 0 H355 V"+r+" H312z";case"‖":return"M257 0 H300 V"+r+" H257z M257 0 H300 V"+r+" H257z"+("M478 0 H521 V"+r+" H478z M478 0 H521 V"+r+" H478z");default:return""}},DL={doubleleftarrow:`M262 157
l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
@@ -408,55 +408,60 @@ M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},_Ne=function(e,t){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+` v1759 h347 v-84
H403z M403 1759 V0 H319 V1759 v`+t+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+` v1759 H0 v84 H347z
M347 1759 V0 H263 V1759 v`+t+" v1759 h84z";case"vert":return"M145 15 v585 v"+t+` v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+" v585 h43z";case"doublevert":return"M145 15 v585 v"+t+` v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+` v585 h43z
M367 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+t+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+t+` v1715 h263 v84 H319z
MM319 602 V0 H403 V602 v`+t+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+t+` v1799 H0 v-84 H319z
MM319 602 V0 H403 V602 v`+t+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+` v602 h84z
M403 1759 V0 H319 V1759 v`+t+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+` v602 h84z
M347 1759 V0 h-84 V1759 v`+t+" v602 h84z";case"lparen":return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},TMe=function(e,r){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+r+` v1759 h347 v-84
H403z M403 1759 V0 H319 V1759 v`+r+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+r+` v1759 H0 v84 H347z
M347 1759 V0 H263 V1759 v`+r+" v1759 h84z";case"vert":return"M145 15 v585 v"+r+` v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v`+-r+` v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+r+" v585 h43z";case"doublevert":return"M145 15 v585 v"+r+` v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v`+-r+` v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+r+` v585 h43z
M367 15 v585 v`+r+` v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v`+-r+` v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+r+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+r+` v1715 h263 v84 H319z
MM319 602 V0 H403 V602 v`+r+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+r+` v1799 H0 v-84 H319z
MM319 602 V0 H403 V602 v`+r+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+r+` v602 h84z
M403 1759 V0 H319 V1759 v`+r+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+r+` v602 h84z
M347 1759 V0 h-84 V1759 v`+r+" v602 h84z";case"lparen":return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1
c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,
-36,557 l0,`+(t+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
-36,557 l0,`+(r+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9
c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,
-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
l0,-`+(t+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
l0,-`+(r+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case"rparen":return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,
63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(t+9)+`
c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(r+9)+`
c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664
c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11
c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17
c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};class Ig{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return Lr.contains(this.classes,e)}toNode(){for(var e=document.createDocumentFragment(),t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){for(var e="",t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e}toText(){var e=t=>t.toText();return this.children.map(e).join("")}}var Nl={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,. Line truncated
`+C+" children.");for(var D=0;D<C;D++){var H=new qu(y[D]),q=new Hc([H],{width:"400em",height:Xt(w),viewBox:"0 0 "+o+" "+S,preserveAspectRatio:N[D]+" slice"}),$=lt.makeSvgSpan([x[D]],[q],t);if(C===1)return{span:$,minWidth:E,height:w};$.style.height=Xt(w),_.push($)}return{span:lt.makeSpan(["stretchy"],_,t),minWidth:E,height:w}}}var{span:a,minWidth:i,height:s}=n();return a.height=s,a.style.height=Xt(s),i>0&&(a.style.minWidth=Xt(i)),a},rIe=function(e,t,n,a,i){var s,o=e.height+e.depth+n+a;if(/fbox|color|angl/.test(t)){if(s=lt.makeSpan(["stretchy",t],[],i),t==="fbox"){var l=i.color&&i.getColor();l&&(s.style.borderColor=l)}}else{var c=[];/^[bx]cancel$/.test(t)&&c.push(new NA({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&c.push(new NA({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var u=new Hc(c,{width:"100%",height:Xt(o)});s=lt.makeSvgSpan([],[u],i)}return s.height=o,s.style.height=Xt(o),s},Yc={encloseSpan:rIe,mathMLnode:ZNe,svgSpan:tIe};function on(r,e){if(!r||r.type!==e)throw new Error("Expected node of type "+e+", but got "+(r?"node of type "+r.type:String(r)));return r}function o6(r){var e=xy(r);if(!e)throw new Error("Expected node of symbol group type, but got "+(r?"node of type "+r.type:String(r)));return e}function xy(r){return r&&(r.type==="atom"||xNe.hasOwnProperty(r.type))?r:null}var l6=(r,e)=>{var t,n,a;r&&r.type==="supsub"?(n=on(r.base,"accent"),t=n.base,r.base=t,a=CNe(Bn(r,e)),r.base=n):(n=on(r,"accent"),t=n.base);var i=Bn(t,e.havingCrampedStyle()),s=n.isShifty&&Lr.isCharacterBox(t),o=0;if(s){var l=Lr.getBaseElem(t),c=Bn(l,e.havingCrampedStyle());o=kP(c).skew}var u=n.label==="\\c",d=u?i.height+i.depth:Math.min(i.height,e.fontMetrics().xHeight),h;if(n.isStretchy)h=Yc.svgSpan(n,e),h=lt.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"elem",elem:h,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+Xt(2*o)+")",marginLeft:Xt(2*o)}:void 0}]},e);else{var p,m;n.label==="\\vec"?(p=lt.staticSvg("vec",e),m=lt.svgData.vec[1]):(p=lt.makeOrd({mode:n.mode,text:n.label},e,"textord"),p=kP(p),p.italic=0,m=p.width,u&&(d+=p.depth)),h=lt.makeSpan(["accent-body"],[p]);var g=n.label==="\\textcircled";g&&(h.classes.push("accent-full"),d=i.height);var b=o;g||(b-=m/2),h.style.left=Xt(b),n.label==="\\textcircled"&&(h.style.top=".2em"),h=lt.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:-d},{type:"elem",elem:h}]},e)}var _=lt.makeSpan(["mord","accent"],[h],e);return a?(a.children[0]=_,a.height=Math.max(_.height,a.height),a.classes[0]="mord",a):_},yH=(r,e)=>{var t=r.isStretchy?Yc.mathMLnode(r.label):new Bt.MathNode("mo",[Do(r.label,r.mode)]),n=new Bt.MathNode("mover",[na(r.base,e),t]);return n.setAttribute("accent","true"),n},nIe=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(r=>"\\"+r).join("|"));ur({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(r,e)=>{var t=Hb(e[0]),n=!nIe.test(r.funcName),a=!n||r.funcName==="\\widehat"||r.funcName==="\\widetilde"||r.funcName==="\\widecheck";return{type:"accent",mode:r.parser.mode,label:r.funcName,isStretchy:n,isShifty:a,base:t}},htmlBuilder:l6,mathmlBuilder:yH});ur({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(r,e)=>{var t=e[0],n=r.parser.mode;return n==="math"&&(r.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+r.funcName+" works only in text mode"),n="text"),{type:"accent",mode:n,label:r.funcName,isStretchy:!1,isShifty:!0,base:t}},htmlBuilder:l6,mathmlBuilder:yH});ur({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(r,e)=>{var{parser:t,funcName:n}=r,a=e[0];return{type:"accentUnder",mode:t.mode,label:n,base:a}},htmlBuilder:(r,e)=>{var t=Bn(r.base,e),n=Yc.svgSpan(r,e),a=r.label==="\\utilde"?.12:0,i=lt.makeVList({positionType:"top",positionData:t.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:a},{type:"elem",elem:t}]},e);return lt.makeSpan(["mord","accentunder"],[i],e)},mathmlBuilder:(r,e)=>{var t=Yc.mathMLnode(r.label),n=new Bt.MathNode("munder",[na(r.base,e),t]);return n.setAttribute("accentunder","true"),n}});var r_=r=>{var e=new Bt.MathNode("mpadded",r?[r]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};ur({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLLine truncated
]`,NIe="\\\\[a-zA-Z@]+",IIe="\\\\[^\uD800-\uDFFF]",kIe="("+NIe+")"+WH+"*",MIe=`\\\\(
l0,-`+(r+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};class kg{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return Lr.contains(this.classes,e)}toNode(){for(var e=document.createDocumentFragment(),r=0;r<this.children.length;r++)e.appendChild(this.children[r].toNode());return e}toMarkup(){for(var e="",r=0;r<this.children.length;r++)e+=this.children[r].toMarkup();return e}toText(){var e=r=>r.toText();return this.children.map(e).join("")}}var Pl={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,. Line truncated
`+w+" children.");for(var D=0;D<w;D++){var $=new ju(E[D]),H=new Qc([$],{width:"400em",height:Xt(T),viewBox:"0 0 "+o+" "+v,preserveAspectRatio:I[D]+" slice"}),G=ct.makeSvgSpan([A[D]],[H],r);if(w===1)return{span:G,minWidth:y,height:T};G.style.height=Xt(T),_.push(G)}return{span:ct.makeSpan(["stretchy"],_,r),minWidth:y,height:T}}}var{span:a,minWidth:i,height:s}=n();return a.height=s,a.style.height=Xt(s),i>0&&(a.style.minWidth=Xt(i)),a},lke=function(e,r,n,a,i){var s,o=e.height+e.depth+n+a;if(/fbox|color|angl/.test(r)){if(s=ct.makeSpan(["stretchy",r],[],i),r==="fbox"){var l=i.color&&i.getColor();l&&(s.style.borderColor=l)}}else{var c=[];/^[bx]cancel$/.test(r)&&c.push(new k2({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(r)&&c.push(new k2({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var u=new Qc(c,{width:"100%",height:Xt(o)});s=ct.makeSvgSpan([],[u],i)}return s.height=o,s.style.height=Xt(o),s},Zc={encloseSpan:lke,mathMLnode:ake,svgSpan:oke};function on(t,e){if(!t||t.type!==e)throw new Error("Expected node of type "+e+", but got "+(t?"node of type "+t.type:String(t)));return t}function d3(t){var e=IE(t);if(!e)throw new Error("Expected node of symbol group type, but got "+(t?"node of type "+t.type:String(t)));return e}function IE(t){return t&&(t.type==="atom"||MMe.hasOwnProperty(t.type))?t:null}var h3=(t,e)=>{var r,n,a;t&&t.type==="supsub"?(n=on(t.base,"accent"),r=n.base,t.base=r,a=xMe(Gn(t,e)),t.base=n):(n=on(t,"accent"),r=n.base);var i=Gn(r,e.havingCrampedStyle()),s=n.isShifty&&Lr.isCharacterBox(r),o=0;if(s){var l=Lr.getBaseElem(r),c=Gn(l,e.havingCrampedStyle());o=LL(c).skew}var u=n.label==="\\c",d=u?i.height+i.depth:Math.min(i.height,e.fontMetrics().xHeight),h;if(n.isStretchy)h=Zc.svgSpan(n,e),h=ct.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"elem",elem:h,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+Xt(2*o)+")",marginLeft:Xt(2*o)}:void 0}]},e);else{var m,f;n.label==="\\vec"?(m=ct.staticSvg("vec",e),f=ct.svgData.vec[1]):(m=ct.makeOrd({mode:n.mode,text:n.label},e,"textord"),m=LL(m),m.italic=0,f=m.width,u&&(d+=m.depth)),h=ct.makeSpan(["accent-body"],[m]);var g=n.label==="\\textcircled";g&&(h.classes.push("accent-full"),d=i.height);var b=o;g||(b-=f/2),h.style.left=Xt(b),n.label==="\\textcircled"&&(h.style.top=".2em"),h=ct.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:-d},{type:"elem",elem:h}]},e)}var _=ct.makeSpan(["mord","accent"],[h],e);return a?(a.children[0]=_,a.height=Math.max(_.height,a.height),a.classes[0]="mord",a):_},CH=(t,e)=>{var r=t.isStretchy?Zc.mathMLnode(t.label):new Bt.MathNode("mo",[Uo(t.label,t.mode)]),n=new Bt.MathNode("mover",[aa(t.base,e),r]);return n.setAttribute("accent","true"),n},cke=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(t=>"\\"+t).join("|"));dr({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(t,e)=>{var r=Wb(e[0]),n=!cke.test(t.funcName),a=!n||t.funcName==="\\widehat"||t.funcName==="\\widetilde"||t.funcName==="\\widecheck";return{type:"accent",mode:t.parser.mode,label:t.funcName,isStretchy:n,isShifty:a,base:r}},htmlBuilder:h3,mathmlBuilder:CH});dr({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(t,e)=>{var r=e[0],n=t.parser.mode;return n==="math"&&(t.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+t.funcName+" works only in text mode"),n="text"),{type:"accent",mode:n,label:t.funcName,isStretchy:!1,isShifty:!0,base:r}},htmlBuilder:h3,mathmlBuilder:CH});dr({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(t,e)=>{var{parser:r,funcName:n}=t,a=e[0];return{type:"accentUnder",mode:r.mode,label:n,base:a}},htmlBuilder:(t,e)=>{var r=Gn(t.base,e),n=Zc.svgSpan(t,e),a=t.label==="\\utilde"?.12:0,i=ct.makeVList({positionType:"top",positionData:r.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:a},{type:"elem",elem:r}]},e);return ct.makeSpan(["mord","accentunder"],[i],e)},mathmlBuilder:(t,e)=>{var r=Zc.mathMLnode(t.label),n=new Bt.MathNode("munder",[aa(t.base,e),r]);return n.setAttribute("accentunder","true"),n}});var i1=t=>{var e=new Bt.MathNode("mpadded",t?[t]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};dr({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLLine truncated
]`,Lke="\\\\[a-zA-Z@]+",Fke="\\\\[^\uD800-\uDFFF]",Bke="("+Lke+")"+XH+"*",Uke=`\\\\(
|[ \r ]+
?)[ \r ]*`,LA="[̀-ͯ]",DIe=new RegExp(LA+"+$"),PIe="("+WH+"+)|"+(MIe+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(LA+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(LA+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+kIe)+("|"+IIe+")");class nL{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp(PIe,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new Oo("EOF",new Ws(this,t,t));var n=this.tokenRegex.exec(e);if(n===null||n.index!==t)throw new $t("Unexpected character: '"+e[t]+"'",new Oo(e[t],new Ws(this,t,t+1)));var a=n[6]||n[3]||(n[2]?"\\ ":" ");if(this.catcodes[a]===14){var i=e.indexOf(`
`,this.tokenRegex.lastIndex);return i===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=i+1,this.lex()}return new Oo(a,new Ws(this,t,this.tokenRegex.lastIndex))}}class LIe{constructor(e,t){e===void 0&&(e={}),t===void 0&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new $t("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var t in e)e.hasOwnProperty(t)&&(e[t]==null?delete this.current[t]:this.current[t]=e[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,t,n){if(n===void 0&&(n=!1),n){for(var a=0;a<this.undefStack.length;a++)delete this.undefStack[a][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(e)&&(i[e]=this.current[e])}t==null?delete this.current[e]:this.current[e]=t}}var FIe=LH;Se("\\noexpand",function(r){var e=r.popToken();return r.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});Se("\\expandafter",function(r){var e=r.popToken();return r.expandOnce(!0),{tokens:[e],numArgs:0}});Se("\\@firstoftwo",function(r){var e=r.consumeArgs(2);return{tokens:e[0],numArgs:0}});Se("\\@secondoftwo",function(r){var e=r.consumeArgs(2);return{tokens:e[1],numArgs:0}});Se("\\@ifnextchar",function(r){var e=r.consumeArgs(3);r.consumeSpaces();var t=r.future();return e[0].length===1&&e[0][0].text===t.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}});Se("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");Se("\\TextOrMath",function(r){var e=r.consumeArgs(2);return r.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var aL={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};Se("\\char",function(r){var e=r.popToken(),t,n="";if(e.text==="'")t=8,e=r.popToken();else if(e.text==='"')t=16,e=r.popToken();else if(e.text==="`")if(e=r.popToken(),e.text[0]==="\\")n=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new $t("\\char` missing argument");n=e.text.charCodeAt(0)}else t=10;if(t){if(n=aL[e.text],n==null||n>=t)throw new $t("Invalid base-"+t+" digit "+e.text);for(var a;(a=aL[r.future().text])!=null&&a<t;)n*=t,n+=a,r.popToken()}return"\\@char{"+n+"}"});var g6=(r,e,t,n)=>{var a=r.consumeArg().tokens;if(a.length!==1)throw new $t("\\newcommand's first argument must be a macro name");var i=a[0].text,s=r.isDefined(i);if(s&&!e)throw new $t("\\newcommand{"+i+"} attempting to redefine "+(i+"; use \\renewcommand"));if(!s&&!t)throw new $t("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");var o=0;if(a=r.consumeArg().tokens,a.length===1&&a[0].text==="["){for(var l="",c=r.expandNextToken();c.text!=="]"&&c.text!=="EOF";)l+=c.text,c=r.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new $t("Invalid number of arguments: "+l);o=parseInt(l),a=r.consumeArg().tokens}return s&&n||r.macros.set(i,{tokens:a,numArgs:o}),""};Se("\\newcommand",r=>g6(r,!1,!0,!1));Se("\\renewcommand",r=>g6(r,!0,!1,!1));Se("\\providecommand",r=>g6(r,!0,!0,!0));Se("\\message",r=>{var e=r.consumeArgs(1)[0];return console.log(e.reverse().map(t=>t.text).join("")),""});Se("\\errmessage",r=>{var e=r.consumeArgs(1)[0];return console.error(e.reverse().map(t=>t.text).join("")),""});Se("\\show",r=>{var e=r.popToken(),t=e.text;return console.log(e,r.macros.get(t),Tu[t],sa.math[t],sa.text[t]),""});Se("\\bgroup","{");Se("\\egroup","}");Se("~","\\nobreakspace");Se("\\lq","`");Se("\\rq","'");Se("\\aa","\\r a");Se("\\AA","\\r A");Se("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");Se("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");Se("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");Se("ℬ","\\mathscr{B}");Se("ℰ","\\mathscr{E}");Se("ℱ","\\mathscr{F}");Se("ℋ","\\mathscr{H}");Se("ℐ","\\mathscr{I}");Se("ℒ","\\mathscr{L}");Se("ℳ","\\mathscr{M}");Se("ℛ","\\mathscr{R}");Se("ℭ","\\mathfrak{C}");Se("ℌ","\\mathfrak{H}");Se("ℨ","\\mathfrak{Z}");Se("\\Bbbk","\\Bbb{k}");Se("·","\\cdotp");Se("\\llap","\\mathllap{\\textrm{#1}}");Se("\\rlap","\\mathrlap{\\textrm{#1}}");Se("\\clap","\\mathclap{\\textrm{#1}}");Se("\\mathstrut","\\vphantom{(}");Se("\\underbar","\\underline{\\text{#1}}");Se("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}');Se("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");Se("\\ne","\\neq");Se("≠","\\neq");Se("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\ms Line truncated
please report what input caused this bug`);return n=n.slice(1,-1),{type:"verb",mode:"text",body:n,star:a}}oL.hasOwnProperty(t[0])&&!sa[this.mode][t[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+t[0]+'" used in math mode',e),t=oL[t[0]]+t.slice(1));var i=DIe.exec(t);i&&(t=t.substring(0,i.index),t==="i"?t="ı":t==="j"&&(t="ȷ"));var s;if(sa[this.mode][t]){this.settings.strict&&this.mode==="math"&&IA.indexOf(t)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+t[0]+'" used in math mode',e);var o=sa[this.mode][t].group,l=Ws.range(e),c;if(ANe.hasOwnProperty(o)){var u=o;c={type:"atom",mode:this.mode,family:u,loc:l,text:t}}else c={type:o,mode:this.mode,loc:l,text:t};s=c}else if(t.charCodeAt(0)>=128)this.settings.strict&&(iH(t.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'"'+(" ("+t.charCodeAt(0)+")"),e)),s={type:"textord",mode:"text",loc:Ws.range(e),text:t};else return null;if(this.consume(),i)for(var d=0;d<i[0].length;d++){var h=i[0][d];if(!fC[h])throw new $t("Unknown accent ' "+h+"'",e);var p=fC[h][this.mode]||fC[h].text;if(!p)throw new $t("Accent "+h+" unsupported in "+this.mode+" mode",e);s={type:"accent",mode:this.mode,loc:Ws.range(e),label:p,isStretchy:!1,isShifty:!0,base:s}}return s}}Iy.endOfExpression=["}","\\endgroup","\\end","\\right","&"];var b6=function(e,t){if(!(typeof e=="string"||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var n=new Iy(e,t);delete n.gullet.macros.current["\\df@tag"];var a=n.parse();if(delete n.gullet.macros.current["\\current@color"],delete n.gullet.macros.current["\\color"],n.gullet.macros.get("\\df@tag")){if(!t.displayMode)throw new $t("\\tag works only in display equations");a=[{type:"tag",mode:"text",body:a,tag:n.subparse([new Oo("\\df@tag")])}]}return a},QH=function(e,t,n){t.textContent="";var a=v6(e,n).toNode();t.appendChild(a)};typeof document<"u"&&document.compatMode!=="CSS1Compat"&&(typeof console<"u"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),QH=function(){throw new $t("KaTeX doesn't work in quirks mode.")});var UIe=function(e,t){var n=v6(e,t).toMarkup();return n},$Ie=function(e,t){var n=new e6(t);return b6(e,n)},ZH=function(e,t,n){if(n.throwOnError||!(e instanceof $t))throw e;var a=lt.makeSpan(["katex-error"],[new Mo(t)]);return a.setAttribute("title",e.toString()),a.setAttribute("style","color:"+n.errorColor),a},v6=function(e,t){var n=new e6(t);try{var a=b6(e,n);return KNe(a,e,n)}catch(i){return ZH(i,e,n)}},GIe=function(e,t){var n=new e6(t);try{var a=b6(e,n);return XNe(a,e,n)}catch(i){return ZH(i,e,n)}},zIe="0.16.22",qIe={Span:kg,Anchor:n6,SymbolNode:Mo,SvgNode:Hc,PathNode:qu,LineNode:NA},lL={version:zIe,render:QH,renderToString:UIe,ParseError:$t,SETTINGS_SCHEMA:I_,__parse:$Ie,__renderToDomTree:v6,__renderToHTMLTree:GIe,__setFontMetrics:bNe,__defineSymbol:X,__defineFunction:ur,__defineMacro:Se,__domTree:qIe};const HIe={};function VIe(r){const e=this,t=r||HIe,n=e.data(),a=n.micromarkExtensions||(n.micromarkExtensions=[]),i=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),s=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);a.push(qOe(t)),i.push(POe()),s.push(LOe(t))}const cL=function(r,e,t){const n=Og(t);if(!r||!r.type||!r.children)throw new Error("Expected parent node");if(typeof e=="number"){if(e<0||e===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(e=r.children.indexOf(e),e<0)throw new Error("Expected child node or index");for(;++e<r.children.length;)if(n(r.children[e],e,r))return r.children[e]},mh=function(r){if(r==null)return jIe;if(typeof r=="string")return WIe(r);if(typeof r=="object")return YIe(r);if(typeof r=="function")return y6(r);throw new Error("Expected function, string, or array as `test`")};function YIe(r){const e=[];let t=-1;for(;++t<r.length;)e[t]=mh(r[t]);return y6(n);function n(...a){let i=-1;for(;++i<e.length;)if(e[i].apply(this,a))return!0;return!1}}function WIe(r){return y6(e);function e(t){return t.tagName===r}}function y6(r){return e;function e(t,n,a){return!!(KIe(t)&&r.call(this,t,typeof n=="number"?n:void 0,a||void 0))}}function jIe(r){return!!(r&&typeof r=="object"&&"type"in r&&r.type==="element"&&"tagName"in r&&typeof r.tagName=="string")}function KIe(r){return r!==null&&typeof r=="object"&&"type"in r&&"tagName"in r}const uL=/\n/g,dL=/[\t ]+/g,FA=mh("br"),hL=mh(r7e),XIe=mh("p"),fL=mh("tr"),QIe=mh(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",t7e,n7e]),JH=mh(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1" Line truncated
`.repeat(c)||" "),c=-1,l.push(u))}return l.join("")}function tV(r,e,t){return r.type==="element"?ZIe(r,e,t):r.type==="text"?t.whitespace==="normal"?rV(r,t):JIe(r):[]}function ZIe(r,e,t){const n=nV(r,t),a=r.children||[];let i=-1,s=[];if(QIe(r))return s;let o,l;for(FA(r)||fL(r)&&cL(e,r,fL)?l=`
`:XIe(r)?(o=2,l=2):JH(r)&&(o=1,l=1);++i<a.length;)s=s.concat(tV(a[i],r,{whitespace:n,breakBefore:i?void 0:o,breakAfter:i<a.length-1?FA(a[i+1]):l}));return hL(r)&&cL(e,r,hL)&&s.push(" "),o&&s.unshift(o),l&&s.push(l),s}function rV(r,e){const t=String(r.value),n=[],a=[];let i=0;for(;i<=t.length;){uL.lastIndex=i;const l=uL.exec(t),c=l&&"index"in l?l.index:t.length;n.push(e7e(t.slice(i,c).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),i===0?e.breakBefore:!0,c===t.length?e.breakAfter:!0)),i=c+1}let s=-1,o;for(;++s<n.length;)n[s].charCodeAt(n[s].length-1)===8203||s<n.length-1&&n[s+1].charCodeAt(0)===8203?(a.push(n[s]),o=void 0):n[s]?(typeof o=="number"&&a.push(o),a.push(n[s]),o=0):(s===0||s===n.length-1)&&a.push(0);return a}function JIe(r){return[String(r.value)]}function e7e(r,e,t){const n=[];let a=0,i;for(;a<r.length;){dL.lastIndex=a;const s=dL.exec(r);i=s?s.index:r.length,!a&&!i&&s&&!e&&n.push(""),a!==i&&n.push(r.slice(a,i)),a=s?i+s[0].length:i}return a!==i&&!t&&n.push(""),n.join(" ")}function nV(r,e){if(r.type==="element"){const t=r.properties||{};switch(r.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return t.wrap?"pre-wrap":"pre";case"td":case"th":return t.noWrap?"nowrap":e.whitespace;case"textarea":return"pre-wrap"}}return e.whitespace}function t7e(r){return!!(r.properties||{}).hidden}function r7e(r){return r.tagName==="td"||r.tagName==="th"}function n7e(r){return r.tagName==="dialog"&&!(r.properties||{}).open}function a7e(r){const e=r.regex,t=r.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),n="decltype\\(auto\\)",a="[a-zA-Z_]\\w*::",s="(?!struct)("+n+"|"+e.optional(a)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",o={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[r.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},r.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},u={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},d={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},r.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},t,r.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:e.optional(a)+r.IDENT_RE,relevance:0},p=e.optional(a)+r.IDENT_RE+"\\s*\\(",m=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],g=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],b=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],_=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fpu Line truncated
`},c]}}const k7e=r=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:r.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[r.APOS_STRING_MODE,r.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:r.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),M7e=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],D7e=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],P7e=[...M7e,...D7e],L7e=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),lV=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),cV=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),F7e=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-t Line truncated
]`,m={scope:"string",variants:[u,c,d,h]},g={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},b=["false","null","true"],_=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],v=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],E={keyword:_,literal:($=>{const K=[];return $.forEach(z=>{K.push(z),z.toLowerCase()===z?K.push(z.toUpperCase()):K.push(z.toLowerCase())}),K})(b),built_in:v},S=$=>$.map(K=>K.replace(/\|\d+$/,"")),w={variants:[{match:[/new/,e.concat(p,"+"),e.concat("(?!",S(v).join("\\b|"),"\\b)"),a],scope:{1:"keyword",4:"title.class"}}]},C=e.concat(n,"\\b(?!\\()"),x={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),C],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[a,e.concat(/::/,e.lookahead(/(?!class\b)/)),C],scope:{1:"title.class",3:"variable.constant"}},{match:[a,e.concat("::",e.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[a,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},N={scope:"attr",match:e.concat(n,e.lookahead(":"),e.lookahead(/(?!::)/))},I={relevance:0,begin:/\(/,end:/\)/,keywords:E,contains:[N,s,x,r.C_BLOCK_COMMENT_MODE,m,g,w]},D={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",S(_).join("\\b|"),"|",S(v).join("\\b|"),"\\b)"),n,e.concat(p,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[I]};I.contains.push(D);const H=[N,x,r.C_BLOCK_COMMENT_MODE,m,g,w],q={begin:e.concat(/#\[\s*\\?/,e.either(a,i)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:b,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:b,keyword:["new","array"]},contains:["self",...H]},...H,{scope:"meta",variants:[{match:a},{match:i}]}]};return{case_insensitive:!1,keywords:E,contains:[q,r.HASH_COMMENT_MODE,r.COMMENT("//","$"),r.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:r.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},o,{scope:"variable.language",match:/\$this\b/},s,D,x,{match:[/const/,/\s/,n],scope:{1:"keyword",3:"variable.constant"}},w,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},r.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:E,contains:["self",q,s,x,r.C_BLOCK_COMMENT_MODE,m,g]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"cl Line truncated
`}]}function P8e(r,e){const t=e.value?e.value+`
`:"",n={},a=e.lang?e.lang.split(/\s+/):[];a.length>0&&(n.className=["language-"+a[0]]);let i={type:"element",tagName:"code",properties:n,children:[{type:"text",value:t}]};return e.meta&&(i.data={meta:e.meta}),r.patch(e,i),i=r.applyData(e,i),i={type:"element",tagName:"pre",properties:{},children:[i]},r.patch(e,i),i}function L8e(r,e){const t={type:"element",tagName:"del",properties:{},children:r.all(e)};return r.patch(e,t),r.applyData(e,t)}function F8e(r,e){const t={type:"element",tagName:"em",properties:{},children:r.all(e)};return r.patch(e,t),r.applyData(e,t)}function B8e(r,e){const t=typeof r.options.clobberPrefix=="string"?r.options.clobberPrefix:"user-content-",n=String(e.identifier).toUpperCase(),a=op(n.toLowerCase()),i=r.footnoteOrder.indexOf(n);let s,o=r.footnoteCounts.get(n);o===void 0?(o=0,r.footnoteOrder.push(n),s=r.footnoteOrder.length):s=i+1,o+=1,r.footnoteCounts.set(n,o);const l={type:"element",tagName:"a",properties:{href:"#"+t+"fn-"+a,id:t+"fnref-"+a+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};r.patch(e,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return r.patch(e,c),r.applyData(e,c)}function U8e(r,e){const t={type:"element",tagName:"h"+e.depth,properties:{},children:r.all(e)};return r.patch(e,t),r.applyData(e,t)}function $8e(r,e){if(r.options.allowDangerousHtml){const t={type:"raw",value:e.value};return r.patch(e,t),r.applyData(e,t)}}function SV(r,e){const t=e.referenceType;let n="]";if(t==="collapsed"?n+="[]":t==="full"&&(n+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+n}];const a=r.all(e),i=a[0];i&&i.type==="text"?i.value="["+i.value:a.unshift({type:"text",value:"["});const s=a[a.length-1];return s&&s.type==="text"?s.value+=n:a.push({type:"text",value:n}),a}function G8e(r,e){const t=String(e.identifier).toUpperCase(),n=r.definitionById.get(t);if(!n)return SV(r,e);const a={src:op(n.url||""),alt:e.alt};n.title!==null&&n.title!==void 0&&(a.title=n.title);const i={type:"element",tagName:"img",properties:a,children:[]};return r.patch(e,i),r.applyData(e,i)}function z8e(r,e){const t={src:op(e.url)};e.alt!==null&&e.alt!==void 0&&(t.alt=e.alt),e.title!==null&&e.title!==void 0&&(t.title=e.title);const n={type:"element",tagName:"img",properties:t,children:[]};return r.patch(e,n),r.applyData(e,n)}function q8e(r,e){const t={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};r.patch(e,t);const n={type:"element",tagName:"code",properties:{},children:[t]};return r.patch(e,n),r.applyData(e,n)}function H8e(r,e){const t=String(e.identifier).toUpperCase(),n=r.definitionById.get(t);if(!n)return SV(r,e);const a={href:op(n.url||"")};n.title!==null&&n.title!==void 0&&(a.title=n.title);const i={type:"element",tagName:"a",properties:a,children:r.all(e)};return r.patch(e,i),r.applyData(e,i)}function V8e(r,e){const t={href:op(e.url)};e.title!==null&&e.title!==void 0&&(t.title=e.title);const n={type:"element",tagName:"a",properties:t,children:r.all(e)};return r.patch(e,n),r.applyData(e,n)}function Y8e(r,e,t){const n=r.all(e),a=t?W8e(t):EV(e),i={},s=[];if(typeof e.checked=="boolean"){const u=n[0];let d;u&&u.type==="element"&&u.tagName==="p"?d=u:(d={type:"element",tagName:"p",properties:{},children:[]},n.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let o=-1;for(;++o<n.length;){const u=n[o];(a||o!==0||u.type!=="element"||u.tagName!=="p")&&s.push({type:"text",value:`
?)[ \r ]*`,G2="[̀-ͯ]",Gke=new RegExp(G2+"+$"),qke="("+XH+"+)|"+(Uke+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(G2+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(G2+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+Bke)+("|"+Fke+")");class o8{constructor(e,r){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=r,this.tokenRegex=new RegExp(qke,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,r){this.catcodes[e]=r}lex(){var e=this.input,r=this.tokenRegex.lastIndex;if(r===e.length)return new ko("EOF",new Qs(this,r,r));var n=this.tokenRegex.exec(e);if(n===null||n.index!==r)throw new qt("Unexpected character: '"+e[r]+"'",new ko(e[r],new Qs(this,r,r+1)));var a=n[6]||n[3]||(n[2]?"\\ ":" ");if(this.catcodes[a]===14){var i=e.indexOf(`
`,this.tokenRegex.lastIndex);return i===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=i+1,this.lex()}return new ko(a,new Qs(this,r,this.tokenRegex.lastIndex))}}class zke{constructor(e,r){e===void 0&&(e={}),r===void 0&&(r={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=r,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new qt("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var r in e)e.hasOwnProperty(r)&&(e[r]==null?delete this.current[r]:this.current[r]=e[r])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,r,n){if(n===void 0&&(n=!1),n){for(var a=0;a<this.undefStack.length;a++)delete this.undefStack[a][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=r)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(e)&&(i[e]=this.current[e])}r==null?delete this.current[e]:this.current[e]=r}}var $ke=GH;ve("\\noexpand",function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});ve("\\expandafter",function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}});ve("\\@firstoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[0],numArgs:0}});ve("\\@secondoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[1],numArgs:0}});ve("\\@ifnextchar",function(t){var e=t.consumeArgs(3);t.consumeSpaces();var r=t.future();return e[0].length===1&&e[0][0].text===r.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}});ve("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");ve("\\TextOrMath",function(t){var e=t.consumeArgs(2);return t.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var l8={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};ve("\\char",function(t){var e=t.popToken(),r,n="";if(e.text==="'")r=8,e=t.popToken();else if(e.text==='"')r=16,e=t.popToken();else if(e.text==="`")if(e=t.popToken(),e.text[0]==="\\")n=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new qt("\\char` missing argument");n=e.text.charCodeAt(0)}else r=10;if(r){if(n=l8[e.text],n==null||n>=r)throw new qt("Invalid base-"+r+" digit "+e.text);for(var a;(a=l8[t.future().text])!=null&&a<r;)n*=r,n+=a,t.popToken()}return"\\@char{"+n+"}"});var E3=(t,e,r,n)=>{var a=t.consumeArg().tokens;if(a.length!==1)throw new qt("\\newcommand's first argument must be a macro name");var i=a[0].text,s=t.isDefined(i);if(s&&!e)throw new qt("\\newcommand{"+i+"} attempting to redefine "+(i+"; use \\renewcommand"));if(!s&&!r)throw new qt("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");var o=0;if(a=t.consumeArg().tokens,a.length===1&&a[0].text==="["){for(var l="",c=t.expandNextToken();c.text!=="]"&&c.text!=="EOF";)l+=c.text,c=t.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new qt("Invalid number of arguments: "+l);o=parseInt(l),a=t.consumeArg().tokens}return s&&n||t.macros.set(i,{tokens:a,numArgs:o}),""};ve("\\newcommand",t=>E3(t,!1,!0,!1));ve("\\renewcommand",t=>E3(t,!0,!1,!1));ve("\\providecommand",t=>E3(t,!0,!0,!0));ve("\\message",t=>{var e=t.consumeArgs(1)[0];return console.log(e.reverse().map(r=>r.text).join("")),""});ve("\\errmessage",t=>{var e=t.consumeArgs(1)[0];return console.error(e.reverse().map(r=>r.text).join("")),""});ve("\\show",t=>{var e=t.popToken(),r=e.text;return console.log(e,t.macros.get(r),Iu[r],la.math[r],la.text[r]),""});ve("\\bgroup","{");ve("\\egroup","}");ve("~","\\nobreakspace");ve("\\lq","`");ve("\\rq","'");ve("\\aa","\\r a");ve("\\AA","\\r A");ve("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");ve("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");ve("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");ve("ℬ","\\mathscr{B}");ve("ℰ","\\mathscr{E}");ve("ℱ","\\mathscr{F}");ve("ℋ","\\mathscr{H}");ve("ℐ","\\mathscr{I}");ve("ℒ","\\mathscr{L}");ve("ℳ","\\mathscr{M}");ve("ℛ","\\mathscr{R}");ve("ℭ","\\mathfrak{C}");ve("ℌ","\\mathfrak{H}");ve("ℨ","\\mathfrak{Z}");ve("\\Bbbk","\\Bbb{k}");ve("·","\\cdotp");ve("\\llap","\\mathllap{\\textrm{#1}}");ve("\\rlap","\\mathrlap{\\textrm{#1}}");ve("\\clap","\\mathclap{\\textrm{#1}}");ve("\\mathstrut","\\vphantom{(}");ve("\\underbar","\\underline{\\text{#1}}");ve("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}');ve("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");ve("\\ne","\\neq");ve("≠","\\neq");ve("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\ms Line truncated
please report what input caused this bug`);return n=n.slice(1,-1),{type:"verb",mode:"text",body:n,star:a}}d8.hasOwnProperty(r[0])&&!la[this.mode][r[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+r[0]+'" used in math mode',e),r=d8[r[0]]+r.slice(1));var i=Gke.exec(r);i&&(r=r.substring(0,i.index),r==="i"?r="ı":r==="j"&&(r="ȷ"));var s;if(la[this.mode][r]){this.settings.strict&&this.mode==="math"&&P2.indexOf(r)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+r[0]+'" used in math mode',e);var o=la[this.mode][r].group,l=Qs.range(e),c;if(DMe.hasOwnProperty(o)){var u=o;c={type:"atom",mode:this.mode,family:u,loc:l,text:r}}else c={type:o,mode:this.mode,loc:l,text:r};s=c}else if(r.charCodeAt(0)>=128)this.settings.strict&&(cH(r.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+r[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+r[0]+'"'+(" ("+r.charCodeAt(0)+")"),e)),s={type:"textord",mode:"text",loc:Qs.range(e),text:r};else return null;if(this.consume(),i)for(var d=0;d<i[0].length;d++){var h=i[0][d];if(!gA[h])throw new qt("Unknown accent ' "+h+"'",e);var m=gA[h][this.mode]||gA[h].text;if(!m)throw new qt("Accent "+h+" unsupported in "+this.mode+" mode",e);s={type:"accent",mode:this.mode,loc:Qs.range(e),label:m,isStretchy:!1,isShifty:!0,base:s}}return s}}kE.endOfExpression=["}","\\endgroup","\\end","\\right","&"];var y3=function(e,r){if(!(typeof e=="string"||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var n=new kE(e,r);delete n.gullet.macros.current["\\df@tag"];var a=n.parse();if(delete n.gullet.macros.current["\\current@color"],delete n.gullet.macros.current["\\color"],n.gullet.macros.get("\\df@tag")){if(!r.displayMode)throw new qt("\\tag works only in display equations");a=[{type:"tag",mode:"text",body:a,tag:n.subparse([new ko("\\df@tag")])}]}return a},tY=function(e,r,n){r.textContent="";var a=T3(e,n).toNode();r.appendChild(a)};typeof document<"u"&&document.compatMode!=="CSS1Compat"&&(typeof console<"u"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),tY=function(){throw new qt("KaTeX doesn't work in quirks mode.")});var Yke=function(e,r){var n=T3(e,r).toMarkup();return n},Vke=function(e,r){var n=new a3(r);return y3(e,n)},rY=function(e,r,n){if(n.throwOnError||!(e instanceof qt))throw e;var a=ct.makeSpan(["katex-error"],[new Bo(r)]);return a.setAttribute("title",e.toString()),a.setAttribute("style","color:"+n.errorColor),a},T3=function(e,r){var n=new a3(r);try{var a=y3(e,n);return tke(a,e,n)}catch(i){return rY(i,e,n)}},Wke=function(e,r){var n=new a3(r);try{var a=y3(e,n);return rke(a,e,n)}catch(i){return rY(i,e,n)}},Kke="0.16.22",jke={Span:Pg,Anchor:o3,SymbolNode:Bo,SvgNode:Qc,PathNode:ju,LineNode:k2},h8={version:Kke,render:tY,renderToString:Yke,ParseError:qt,SETTINGS_SCHEMA:k1,__parse:Vke,__renderToDomTree:T3,__renderToHTMLTree:Wke,__setFontMetrics:CMe,__defineSymbol:Q,__defineFunction:dr,__defineMacro:ve,__domTree:jke};const Qke={};function Xke(t){const e=this,r=t||Qke,n=e.data(),a=n.micromarkExtensions||(n.micromarkExtensions=[]),i=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),s=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);a.push(j5e(r)),i.push(q5e()),s.push(z5e(r))}const p8=function(t,e,r){const n=Dg(r);if(!t||!t.type||!t.children)throw new Error("Expected parent node");if(typeof e=="number"){if(e<0||e===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(e=t.children.indexOf(e),e<0)throw new Error("Expected child node or index");for(;++e<t.children.length;)if(n(t.children[e],e,t))return t.children[e]},yh=function(t){if(t==null)return e9e;if(typeof t=="string")return Jke(t);if(typeof t=="object")return Zke(t);if(typeof t=="function")return C3(t);throw new Error("Expected function, string, or array as `test`")};function Zke(t){const e=[];let r=-1;for(;++r<t.length;)e[r]=yh(t[r]);return C3(n);function n(...a){let i=-1;for(;++i<e.length;)if(e[i].apply(this,a))return!0;return!1}}function Jke(t){return C3(e);function e(r){return r.tagName===t}}function C3(t){return e;function e(r,n,a){return!!(t9e(r)&&t.call(this,r,typeof n=="number"?n:void 0,a||void 0))}}function e9e(t){return!!(t&&typeof t=="object"&&"type"in t&&t.type==="element"&&"tagName"in t&&typeof t.tagName=="string")}function t9e(t){return t!==null&&typeof t=="object"&&"type"in t&&"tagName"in t}const m8=/\n/g,f8=/[\t ]+/g,q2=yh("br"),g8=yh(l9e),r9e=yh("p"),_8=yh("tr"),n9e=yh(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",o9e,c9e]),nY=yh(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1" Line truncated
`.repeat(c)||" "),c=-1,l.push(u))}return l.join("")}function iY(t,e,r){return t.type==="element"?a9e(t,e,r):t.type==="text"?r.whitespace==="normal"?sY(t,r):i9e(t):[]}function a9e(t,e,r){const n=oY(t,r),a=t.children||[];let i=-1,s=[];if(n9e(t))return s;let o,l;for(q2(t)||_8(t)&&p8(e,t,_8)?l=`
`:r9e(t)?(o=2,l=2):nY(t)&&(o=1,l=1);++i<a.length;)s=s.concat(iY(a[i],t,{whitespace:n,breakBefore:i?void 0:o,breakAfter:i<a.length-1?q2(a[i+1]):l}));return g8(t)&&p8(e,t,g8)&&s.push(" "),o&&s.unshift(o),l&&s.push(l),s}function sY(t,e){const r=String(t.value),n=[],a=[];let i=0;for(;i<=r.length;){m8.lastIndex=i;const l=m8.exec(r),c=l&&"index"in l?l.index:r.length;n.push(s9e(r.slice(i,c).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),i===0?e.breakBefore:!0,c===r.length?e.breakAfter:!0)),i=c+1}let s=-1,o;for(;++s<n.length;)n[s].charCodeAt(n[s].length-1)===8203||s<n.length-1&&n[s+1].charCodeAt(0)===8203?(a.push(n[s]),o=void 0):n[s]?(typeof o=="number"&&a.push(o),a.push(n[s]),o=0):(s===0||s===n.length-1)&&a.push(0);return a}function i9e(t){return[String(t.value)]}function s9e(t,e,r){const n=[];let a=0,i;for(;a<t.length;){f8.lastIndex=a;const s=f8.exec(t);i=s?s.index:t.length,!a&&!i&&s&&!e&&n.push(""),a!==i&&n.push(t.slice(a,i)),a=s?i+s[0].length:i}return a!==i&&!r&&n.push(""),n.join(" ")}function oY(t,e){if(t.type==="element"){const r=t.properties||{};switch(t.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return r.wrap?"pre-wrap":"pre";case"td":case"th":return r.noWrap?"nowrap":e.whitespace;case"textarea":return"pre-wrap"}}return e.whitespace}function o9e(t){return!!(t.properties||{}).hidden}function l9e(t){return t.tagName==="td"||t.tagName==="th"}function c9e(t){return t.tagName==="dialog"&&!(t.properties||{}).open}function u9e(t){const e="[A-Za-zА-Яа-яёЁ_][A-Za-zА-Яа-яёЁ_0-9]+",a="далее "+"возврат вызватьисключение выполнить для если и из или иначе иначеесли исключение каждого конецесли конецпопытки конеццикла не новый перейти перем по пока попытка прервать продолжить тогда цикл экспорт ",o="загрузитьизфайла "+"вебклиент вместо внешнеесоединение клиент конецобласти мобильноеприложениеклиент мобильноеприложениесервер наклиенте наклиентенасервере наклиентенасерверебезконтекста насервере насерверебезконтекста область перед после сервер толстыйклиентобычноеприложение толстыйклиентуправляемоеприложение тонкийклиент ",h="разделительстраниц разделительстрок символтабуляции "+"ansitooem oemtoansi ввестивидсубконто ввестиперечисление ввестипериод ввестиплансчетов выбранныйплансчетов датагод датамесяц датачисло заголовоксистемы значениевстроку значениеизстроки каталогиб каталогпользователя кодсимв конгода конецпериодаби конецрассчитанногопериодаби конецстандартногоинтервала конквартала конмесяца коннедели лог лог10 максимальноеколичествосубконто названиеинтерфейса названиенабораправ назначитьвид назначитьсчет найтиссылки началопериодаби началостандартногоинтервала начгода начквартала начмесяца начнедели номерднягода номерднянедели номернеделигода обработкаожидания основнойжурналрасчетов основнойплансчетов основнойязык очиститьокносообщений периодстр получитьвремята получитьдатута получитьдокументта получитьзначенияотбора получитьпозициюта получитьпустоезначение получитьта префиксавтонумерации пропись пустоезначение разм разобратьпозициюдокумента рассчитатьрегистрына рассчитатьрегистрыпо симв создатьобъект статусвозврата стрколичествострок сформироватьпозициюдокумента счетпокоду текущеевремя типзначения типзначениястр установитьтана установитьтапо фиксшаблон шаблон "+"acos asin atan base64значение base64строка cos exp log log10 pow sin sqrt tan xmlзначение xmlстрока xmlтип xmlтипзнч актив Line truncated
]*;`,relevance:0},{begin:"[vp][0-9]+"}]}}function WPe(t){const e="[a-z][a-zA-Z0-9_]*",r={className:"string",begin:"\\$.{1}"},n={className:"symbol",begin:"#"+t.UNDERSCORE_IDENT_RE};return{name:"Smalltalk",aliases:["st"],keywords:["self","super","nil","true","false","thisContext"],contains:[t.COMMENT('"','"'),t.APOS_STRING_MODE,{className:"type",begin:"\\b[A-Z][A-Za-z0-9_]*",relevance:0},{begin:e+":",relevance:0},t.C_NUMBER_MODE,n,r,{begin:"\\|[ ]*"+e+"([ ]+"+e+")*[ ]*\\|",returnBegin:!0,end:/\|/,illegal:/\S/,contains:[{begin:"(\\|[ ]*)?"+e}]},{begin:"#\\(",end:"\\)",contains:[t.APOS_STRING_MODE,r,t.C_NUMBER_MODE,n]}]}}function KPe(t){return{name:"SML (Standard ML)",aliases:["ml"],keywords:{$pattern:"[a-z_]\\w*!?",keyword:"abstype and andalso as case datatype do else end eqtype exception fn fun functor handle if in include infix infixr let local nonfix of op open orelse raise rec sharing sig signature struct structure then type val with withtype where while",built_in:"array bool char exn int list option order real ref string substring vector unit word",literal:"true false NONE SOME LESS EQUAL GREATER nil"},illegal:/\/\/|>>/,contains:[{className:"literal",begin:/\[(\|\|)?\]|\(\)/,relevance:0},t.COMMENT("\\(\\*","\\*\\)",{contains:["self"]}),{className:"symbol",begin:"'[A-Za-z_](?!')[\\w']*"},{className:"type",begin:"`[A-Z][\\w']*"},{className:"type",begin:"\\b[A-Z][\\w']*",relevance:0},{begin:"[a-z_]\\w*'[\\w']*"},t.inherit(t.APOS_STRING_MODE,{className:"string",relevance:0}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null}),{className:"number",begin:"\\b(0[xX][a-fA-F0-9_]+[Lln]?|0[oO][0-7_]+[Lln]?|0[bB][01_]+[Lln]?|[0-9][0-9_]*([Lln]|(\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)",relevance:0},{begin:/[-=]>/}]}}function jPe(t){const e={className:"variable",begin:/\b_+[a-zA-Z]\w*/},r={className:"title",begin:/[a-zA-Z][a-zA-Z_0-9]*_fnc_[a-zA-Z_0-9]+/},n={className:"string",variants:[{begin:'"',end:'"',contains:[{begin:'""',relevance:0}]},{begin:"'",end:"'",contains:[{begin:"''",relevance:0}]}]},a=["break","breakWith","breakOut","breakTo","case","catch","continue","continueWith","default","do","else","exit","exitWith","for","forEach","from","if","local","private","switch","step","then","throw","to","try","waitUntil","while","with"],i=["blufor","civilian","configNull","controlNull","displayNull","diaryRecordNull","east","endl","false","grpNull","independent","lineBreak","locationNull","nil","objNull","opfor","pi","resistance","scriptNull","sideAmbientLife","sideEmpty","sideEnemy","sideFriendly","sideLogic","sideUnknown","taskNull","teamMemberNull","true","west"],s=["abs","accTime","acos","action","actionIDs","actionKeys","actionKeysEx","actionKeysImages","actionKeysNames","actionKeysNamesArray","actionName","actionParams","activateAddons","activatedAddons","activateKey","activeTitleEffectParams","add3DENConnection","add3DENEventHandler","add3DENLayer","addAction","addBackpack","addBackpackCargo","addBackpackCargoGlobal","addBackpackGlobal","addBinocularItem","addCamShake","addCuratorAddons","addCuratorCameraArea","addCuratorEditableObjects","addCuratorEditingArea","addCuratorPoints","addEditorObject","addEventHandler","addForce","addForceGeneratorRTD","addGoggles","addGroupIcon","addHandgunItem","addHeadgear","addItem","addItemCargo","addItemCargoGlobal","addItemPool","addItemToBackpack","addItemToUniform","addItemToVest","addLiveStats","addMagazine","addMagazineAmmoCargo","addMagazineCargo","addMagazineCargoGlobal","addMagazineGlobal","addMagazinePool","addMagazines","addMagazineTurret","addMenu","addMenuItem","addMissionEventHandler","addMPEventHandler","addMusicEventHandler","addonFiles","addOwnedMine","addPlayerScores","addPrimaryWeaponItem","addPublicVariableEventHandler","addRating","addResources","addScore","addScoreSide","addSecondaryWeaponItem","addSwitchableUnit","addTeamMember","addToRemainsCollector","addTorque","addUniform","addUserActionEventHandler","addVehicle","addVest","addWaypoint","addWeapon","addWeaponCargo","addWeaponCargoGlobal","addWeaponGlobal","addWeaponItem","addWeaponPool","addWeaponTurret","addWeaponWithAttachmentsCargo","addWeaponWithAttachmentsCargoGlobal","admin","agent","agents","AGLToASL","aimedAtTarget","aimPos","airDensityCurveRTD","airDensityRTD","airplaneThrottle","airportSide","AISFinishHeal","alive","all3DENEntities","allActiveTitleEffects","allAddonsInfo","allAirports","allControls","allCurators","allCutLayers","allDead","allDeadMen","allDiaryRecords","allDiarySubjects","allDisplays","allEnv3DSoundSources","allGroups","allLODs","allMapMarkers","allMines","allMissionObjects","allObjects","allow3DMode","allowCrewInImmobile","allowCuratorLogicIgnoreAreas","allowDamage","allowDammage","allowedService","allowFileOperations","allowFleeing","allowGetIn","allowService","allowSprint","allPlayers","allSimpleObjects","allSites","allTurrets","allUnits","allUnitsUAV","allUsers","allVariables","ambientTemperature","ammo","ammoOnPylon","and","animate","animateBay","animateDoor","animatePylon","animateLine truncated
]*?"'`},{begin:`"[^\r
"]*"`}]},{className:"built_in",variants:[{begin:"\\b(abs|acos|asin|atan|atan2|atanh|ceil|cloglog|comb|cos|digamma|exp|floor|invcloglog|invlogit|ln|lnfact|lnfactorial|lngamma|log|log10|max|min|mod|reldif|round|sign|sin|sqrt|sum|tan|tanh|trigamma|trunc|betaden|Binomial|binorm|binormal|chi2|chi2tail|dgammapda|dgammapdada|dgammapdadx|dgammapdx|dgammapdxdx|F|Fden|Ftail|gammaden|gammap|ibeta|invbinomial|invchi2|invchi2tail|invF|invFtail|invgammap|invibeta|invnchi2|invnFtail|invnibeta|invnorm|invnormal|invttail|nbetaden|nchi2|nFden|nFtail|nibeta|norm|normal|normalden|normd|npnchi2|tden|ttail|uniform|abbrev|char|index|indexnot|length|lower|ltrim|match|plural|proper|real|regexm|regexr|regexs|reverse|rtrim|string|strlen|strlower|strltrim|strmatch|strofreal|strpos|strproper|strreverse|strrtrim|strtrim|strupper|subinstr|subinword|substr|trim|upper|word|wordcount|_caller|autocode|byteorder|chop|clip|cond|e|epsdouble|epsfloat|group|inlist|inrange|irecode|matrix|maxbyte|maxdouble|maxfloat|maxint|maxlong|mi|minbyte|mindouble|minfloat|minint|minlong|missing|r|recode|replay|return|s|scalar|d|date|day|dow|doy|halfyear|mdy|month|quarter|week|year|d|daily|dofd|dofh|dofm|dofq|dofw|dofy|h|halfyearly|hofd|m|mofd|monthly|q|qofd|quarterly|tin|twithin|w|weekly|wofd|y|yearly|yh|ym|yofd|yq|yw|cholesky|colnumb|colsof|corr|det|diag|diag0cnt|el|get|hadamard|I|inv|invsym|issym|issymmetric|J|matmissing|matuniform|mreldif|nullmat|rownumb|rowsof|sweep|syminv|trace|vec|vecdiag)(?=\\()"}]},t.COMMENT("^[ ]*\\*.*$",!1),t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]}}function ZPe(t){return{name:"STEP Part 21",aliases:["p21","step","stp"],case_insensitive:!0,keywords:{$pattern:"[A-Z_][A-Z0-9_.]*",keyword:["HEADER","ENDSEC","DATA"]},contains:[{className:"meta",begin:"ISO-10303-21;",relevance:10},{className:"meta",begin:"END-ISO-10303-21;",relevance:10},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.COMMENT("/\\*\\*!","\\*/"),t.C_NUMBER_MODE,t.inherit(t.APOS_STRING_MODE,{illegal:null}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null}),{className:"string",begin:"'",end:"'"},{className:"symbol",variants:[{begin:"#",end:"\\d+",illegal:"\\W"}]}]}}const JPe=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),e6e=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],t6e=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],r6e=[...e6e,...t6e],n6e=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),a6e=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),i6e=["after","backdrop","before","cu Line truncated
(multipart)?`,end:`\\]
`},{className:"string",begin:"\\d{4}-\\d{2}-\\d{2}(\\s+)\\d{2}:\\d{2}:\\d{2}.\\d+Z"},{className:"string",begin:"(\\+|-)\\d+"},{className:"keyword",relevance:10,variants:[{begin:"^(test|testing|success|successful|failure|error|skip|xfail|uxsuccess)(:?)\\s+(test)?"},{begin:"^progress(:?)(\\s+)?(pop|push)?"},{begin:"^tags:"},{begin:"^time:"}]}]}}function c6e(t){return{name:"Tagger Script",contains:[{className:"comment",begin:/\$noop\(/,end:/\)/,contains:[{begin:/\\[()]/},{begin:/\(/,end:/\)/,contains:[{begin:/\\[()]/},"self"]}],relevance:10},{className:"keyword",begin:/\$[_a-zA-Z0-9]+(?=\()/},{className:"variable",begin:/%[_a-zA-Z0-9:]+%/},{className:"symbol",begin:/\\[\\nt$%,()]/},{className:"symbol",begin:/\\u[a-fA-F0-9]{4}/}]}}function u6e(t){return{name:"Test Anything Protocol",case_insensitive:!0,contains:[t.HASH_COMMENT_MODE,{className:"meta",variants:[{begin:"^TAP version (\\d+)$"},{begin:"^1\\.\\.(\\d+)$"}]},{begin:/---$/,end:"\\.\\.\\.$",subLanguage:"yaml",relevance:0},{className:"number",begin:" (\\d+) "},{className:"symbol",variants:[{begin:"^ok"},{begin:"^not ok"}]}]}}function d6e(t){const e=t.regex,r=/[a-zA-Z_][a-zA-Z0-9_]*/,n={className:"number",variants:[t.BINARY_NUMBER_MODE,t.C_NUMBER_MODE]};return{name:"Tcl",aliases:["tk"],keywords:["after","append","apply","array","auto_execok","auto_import","auto_load","auto_mkindex","auto_mkindex_old","auto_qualify","auto_reset","bgerror","binary","break","catch","cd","chan","clock","close","concat","continue","dde","dict","encoding","eof","error","eval","exec","exit","expr","fblocked","fconfigure","fcopy","file","fileevent","filename","flush","for","foreach","format","gets","glob","global","history","http","if","incr","info","interp","join","lappend|10","lassign|10","lindex|10","linsert|10","list","llength|10","load","lrange|10","lrepeat|10","lreplace|10","lreverse|10","lsearch|10","lset|10","lsort|10","mathfunc","mathop","memory","msgcat","namespace","open","package","parray","pid","pkg::create","pkg_mkIndex","platform","platform::shell","proc","puts","pwd","read","refchan","regexp","registry","regsub|10","rename","return","safe","scan","seek","set","socket","source","split","string","subst","switch","tcl_endOfWord","tcl_findLibrary","tcl_startOfNextWord","tcl_startOfPreviousWord","tcl_wordBreakAfter","tcl_wordBreakBefore","tcltest","tclvars","tell","time","tm","trace","unknown","unload","unset","update","uplevel","upvar","variable","vwait","while"],contains:[t.COMMENT(";[ \\t]*#","$"),t.COMMENT("^[ \\t]*#","$"),{beginKeywords:"proc",end:"[\\{]",excludeEnd:!0,contains:[{className:"title",begin:"[ \\t\\n\\r]+(::)?[a-zA-Z_]((::)?[a-zA-Z0-9_])*",end:"[ \\t\\n\\r]",endsWithParent:!0,excludeEnd:!0}]},{className:"variable",variants:[{begin:e.concat(/\$/,e.optional(/::/),r,"(::",r,")*")},{begin:"\\$\\{(::)?[a-zA-Z_]((::)?[a-zA-Z0-9_])*",end:"\\}",contains:[n]}]},{className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[t.inherit(t.QUOTE_STRING_MODE,{illegal:null})]},n]}}function h6e(t){const e=["bool","byte","i16","i32","i64","double","string","binary"];return{name:"Thrift",keywords:{keyword:["namespace","const","typedef","struct","enum","service","exception","void","oneway","set","list","map","required","optional"],type:e,literal:"true false"},contains:[t.QUOTE_STRING_MODE,t.NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"class",beginKeywords:"struct enum service exception",end:/\{/,illegal:/\n/,contains:[t.inherit(t.TITLE_MODE,{starts:{endsWithParent:!0,excludeEnd:!0}})]},{begin:"\\b(set|list|map)\\s*<",keywords:{type:[...e,"set","list","map"]},end:">",contains:["self"]}]}}function p6e(t){const e={className:"number",begin:"[1-9][0-9]*",relevance:0},r={className:"symbol",begin:":[^\\]]+"},n={className:"built_in",begin:"(AR|P|PAYLOAD|PR|R|SR|RSR|LBL|VR|UALM|MESSAGE|UTOOL|UFRAME|TIMER|TIMER_OVERFLOW|JOINT_MAX_SPEED|RESUME_PROG|DIAG_REC)\\[",end:"\\]",contains:["self",e,r]},a={className:"built_in",begin:"(AI|AO|DI|DO|F|RI|RO|UI|UO|GI|GO|SI|SO)\\[",end:"\\]",contains:["self",e,t.QUOTE_STRING_MODE,r]};return{name:"TP",keywords:{keyword:["ABORT","ACC","ADJUST","AND","AP_LD","BREAK","CALL","CNT","COL","CONDITION","CONFIG","DA","DB","DIV","DETECT","ELSE","END","ENDFOR","ERR_NUM","ERROR_PROG","FINE","FOR","GP","GUARD","INC","IF","JMP","LINEAR_MAX_SPEED","LOCK","MOD","MONITOR","OFFSET","Offset","OR","OVERRIDE","PAUSE","PREG","PTH","RT_LD","RUN","SELECT","SKIP","Skip","TA","TB","TO","TOOL_OFFSET","Tool_Offset","UF","UT","UFRAME_NUM","UTOOL_NUM","UNLOCK","WAIT","X","Y","Z","W","P","R","STRLEN","SUBSTR","FINDSTR","VOFFSET","PROG","ATTR","MN","POS"],literal:["ON","OFF","max_speed","LPOS","JPOS","ENABLE","DISABLE","START","STOP","RESET"]},contains:[n,a,{className:"keyword",begin:"/(PROG|ATTR|MN|POS|END)\\b"},{className:"keyword",begin:"(CALL|RUN|POINT_LOGIC|LBL)\\b"},{className:"keyword",begin:"\\b(ACC|CNT|Skip|Offset|PSPD|RT_LD|AP_LD|Tool_Offset)"},{className:"number",begin:"\\d+(sec|msec|mm/sec|cm/min|inch/min|deg/sec|mm|in|cm)?\\b",relevance:0},t.CO Line truncated
`},c]}}const e7e=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),t7e=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],r7e=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],n7e=[...t7e,...r7e],a7e=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),pY=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),mY=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),i7e=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-t Line truncated
]`,f={scope:"string",variants:[u,c,d,h]},g={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},b=["false","null","true"],_=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],S=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],y={keyword:_,literal:(G=>{const K=[];return G.forEach(z=>{K.push(z),z.toLowerCase()===z?K.push(z.toUpperCase()):K.push(z.toLowerCase())}),K})(b),built_in:S},v=G=>G.map(K=>K.replace(/\|\d+$/,"")),T={variants:[{match:[/new/,e.concat(m,"+"),e.concat("(?!",v(S).join("\\b|"),"\\b)"),a],scope:{1:"keyword",4:"title.class"}}]},w=e.concat(n,"\\b(?!\\()"),A={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),w],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[a,e.concat(/::/,e.lookahead(/(?!class\b)/)),w],scope:{1:"title.class",3:"variable.constant"}},{match:[a,e.concat("::",e.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[a,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},I={scope:"attr",match:e.concat(n,e.lookahead(":"),e.lookahead(/(?!::)/))},x={relevance:0,begin:/\(/,end:/\)/,keywords:y,contains:[I,s,A,t.C_BLOCK_COMMENT_MODE,f,g,T]},D={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",v(_).join("\\b|"),"|",v(S).join("\\b|"),"\\b)"),n,e.concat(m,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[x]};x.contains.push(D);const $=[I,A,t.C_BLOCK_COMMENT_MODE,f,g,T],H={begin:e.concat(/#\[\s*\\?/,e.either(a,i)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:b,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:b,keyword:["new","array"]},contains:["self",...$]},...$,{scope:"meta",variants:[{match:a},{match:i}]}]};return{case_insensitive:!1,keywords:y,contains:[H,t.HASH_COMMENT_MODE,t.COMMENT("//","$"),t.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:t.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},o,{scope:"variable.language",match:/\$this\b/},s,D,A,{match:[/const/,/\s/,n],scope:{1:"keyword",3:"variable.constant"}},T,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},t.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:y,contains:["self",H,s,A,t.C_BLOCK_COMMENT_MODE,f,g]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"cl Line truncated
`}]}function nLe(t,e){const r=e.value?e.value+`
`:"",n={},a=e.lang?e.lang.split(/\s+/):[];a.length>0&&(n.className=["language-"+a[0]]);let i={type:"element",tagName:"code",properties:n,children:[{type:"text",value:r}]};return e.meta&&(i.data={meta:e.meta}),t.patch(e,i),i=t.applyData(e,i),i={type:"element",tagName:"pre",properties:{},children:[i]},t.patch(e,i),i}function aLe(t,e){const r={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function iLe(t,e){const r={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function sLe(t,e){const r=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=String(e.identifier).toUpperCase(),a=um(n.toLowerCase()),i=t.footnoteOrder.indexOf(n);let s,o=t.footnoteCounts.get(n);o===void 0?(o=0,t.footnoteOrder.push(n),s=t.footnoteOrder.length):s=i+1,o+=1,t.footnoteCounts.set(n,o);const l={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+a,id:r+"fnref-"+a+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};t.patch(e,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return t.patch(e,c),t.applyData(e,c)}function oLe(t,e){const r={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function lLe(t,e){if(t.options.allowDangerousHtml){const r={type:"raw",value:e.value};return t.patch(e,r),t.applyData(e,r)}}function RY(t,e){const r=e.referenceType;let n="]";if(r==="collapsed"?n+="[]":r==="full"&&(n+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+n}];const a=t.all(e),i=a[0];i&&i.type==="text"?i.value="["+i.value:a.unshift({type:"text",value:"["});const s=a[a.length-1];return s&&s.type==="text"?s.value+=n:a.push({type:"text",value:n}),a}function cLe(t,e){const r=String(e.identifier).toUpperCase(),n=t.definitionById.get(r);if(!n)return RY(t,e);const a={src:um(n.url||""),alt:e.alt};n.title!==null&&n.title!==void 0&&(a.title=n.title);const i={type:"element",tagName:"img",properties:a,children:[]};return t.patch(e,i),t.applyData(e,i)}function uLe(t,e){const r={src:um(e.url)};e.alt!==null&&e.alt!==void 0&&(r.alt=e.alt),e.title!==null&&e.title!==void 0&&(r.title=e.title);const n={type:"element",tagName:"img",properties:r,children:[]};return t.patch(e,n),t.applyData(e,n)}function dLe(t,e){const r={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,r);const n={type:"element",tagName:"code",properties:{},children:[r]};return t.patch(e,n),t.applyData(e,n)}function hLe(t,e){const r=String(e.identifier).toUpperCase(),n=t.definitionById.get(r);if(!n)return RY(t,e);const a={href:um(n.url||"")};n.title!==null&&n.title!==void 0&&(a.title=n.title);const i={type:"element",tagName:"a",properties:a,children:t.all(e)};return t.patch(e,i),t.applyData(e,i)}function pLe(t,e){const r={href:um(e.url)};e.title!==null&&e.title!==void 0&&(r.title=e.title);const n={type:"element",tagName:"a",properties:r,children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function mLe(t,e,r){const n=t.all(e),a=r?fLe(r):OY(e),i={},s=[];if(typeof e.checked=="boolean"){const u=n[0];let d;u&&u.type==="element"&&u.tagName==="p"?d=u:(d={type:"element",tagName:"p",properties:{},children:[]},n.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let o=-1;for(;++o<n.length;){const u=n[o];(a||o!==0||u.type!=="element"||u.tagName!=="p")&&s.push({type:"text",value:`
`}),u.type==="element"&&u.tagName==="p"&&!a?s.push(...u.children):s.push(u)}const l=n[n.length-1];l&&(a||l.type!=="element"||l.tagName!=="p")&&s.push({type:"text",value:`
`});const c={type:"element",tagName:"li",properties:i,children:s};return r.patch(e,c),r.applyData(e,c)}function W8e(r){let e=!1;if(r.type==="list"){e=r.spread||!1;const t=r.children;let n=-1;for(;!e&&++n<t.length;)e=EV(t[n])}return e}function EV(r){const e=r.spread;return e??r.children.length>1}function j8e(r,e){const t={},n=r.all(e);let a=-1;for(typeof e.start=="number"&&e.start!==1&&(t.start=e.start);++a<n.length;){const s=n[a];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){t.className=["contains-task-list"];break}}const i={type:"element",tagName:e.ordered?"ol":"ul",properties:t,children:r.wrap(n,!0)};return r.patch(e,i),r.applyData(e,i)}function K8e(r,e){const t={type:"element",tagName:"p",properties:{},children:r.all(e)};return r.patch(e,t),r.applyData(e,t)}function X8e(r,e){const t={type:"root",children:r.wrap(r.all(e))};return r.patch(e,t),r.applyData(e,t)}function Q8e(r,e){const t={type:"element",tagName:"strong",properties:{},children:r.all(e)};return r.patch(e,t),r.applyData(e,t)}const wV=CV("end"),TV=CV("start");function CV(r){return e;function e(t){const n=t&&t.position&&t.position[r]||{};if(typeof n.line=="number"&&n.line>0&&typeof n.column=="number"&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset=="number"&&n.offset>-1?n.offset:void 0}}}function Z8e(r){const e=TV(r),t=wV(r);if(e&&t)return{start:e,end:t}}function J8e(r,e){const t=r.all(e),n=t.shift(),a=[];if(n){const s={type:"element",tagName:"thead",properties:{},children:r.wrap([n],!0)};r.patch(e.children[0],s),a.push(s)}if(t.length>0){const s={type:"element",tagName:"tbody",properties:{},children:r.wrap(t,!0)},o=TV(e.children[1]),l=wV(e.children[e.children.length-1]);o&&l&&(s.position={start:o,end:l}),a.push(s)}const i={type:"element",tagName:"table",properties:{},children:r.wrap(a,!0)};return r.patch(e,i),r.applyData(e,i)}function eke(r,e,t){const n=t?t.children:void 0,i=(n?n.indexOf(e):1)===0?"th":"td",s=t&&t.type==="table"?t.align:void 0,o=s?s.length:e.children.length;let l=-1;const c=[];for(;++l<o;){const d=e.children[l],h={},p=s?s[l]:void 0;p&&(h.align=p);let m={type:"element",tagName:i,properties:h,children:[]};d&&(m.children=r.all(d),r.patch(d,m),m=r.applyData(d,m)),c.push(m)}const u={type:"element",tagName:"tr",properties:{},children:r.wrap(c,!0)};return r.patch(e,u),r.applyData(e,u)}function tke(r,e){const t={type:"element",tagName:"td",properties:{},children:r.all(e)};return r.patch(e,t),r.applyData(e,t)}const yL=9,SL=32;function rke(r){const e=String(r),t=/\r?\n|\r/g;let n=t.exec(e),a=0;const i=[];for(;n;)i.push(EL(e.slice(a,n.index),a>0,!0),n[0]),a=n.index+n[0].length,n=t.exec(e);return i.push(EL(e.slice(a),a>0,!1)),i.join("")}function EL(r,e,t){let n=0,a=r.length;if(e){let i=r.codePointAt(n);for(;i===yL||i===SL;)n++,i=r.codePointAt(n)}if(t){let i=r.codePointAt(a-1);for(;i===yL||i===SL;)a--,i=r.codePointAt(a-1)}return a>n?r.slice(n,a):""}function nke(r,e){const t={type:"text",value:rke(String(e.value))};return r.patch(e,t),r.applyData(e,t)}function ake(r,e){const t={type:"element",tagName:"hr",properties:{},children:[]};return r.patch(e,t),r.applyData(e,t)}const ike={blockquote:M8e,break:D8e,code:P8e,delete:L8e,emphasis:F8e,footnoteReference:B8e,heading:U8e,html:$8e,imageReference:G8e,image:z8e,inlineCode:q8e,linkReference:H8e,link:V8e,listItem:Y8e,list:j8e,paragraph:K8e,root:X8e,strong:Q8e,table:J8e,tableCell:tke,tableRow:eke,text:nke,thematicBreak:ake,toml:u_,yaml:u_,definition:u_,footnoteDefinition:u_};function u_(){}const AV=-1,ky=0,dm=1,Wb=2,E6=3,w6=4,T6=5,C6=6,xV=7,RV=8,wL=typeof self=="object"?self:globalThis,ske=(r,e)=>{const t=(a,i)=>(r.set(i,a),a),n=a=>{if(r.has(a))return r.get(a);const[i,s]=e[a];switch(i){case ky:case AV:return t(s,a);case dm:{const o=t([],a);for(const l of s)o.push(n(l));return o}case Wb:{const o=t({},a);for(const[l,c]of s)o[n(l)]=n(c);return o}case E6:return t(new Date(s),a);case w6:{const{source:o,flags:l}=s;return t(new RegExp(o,l),a)}case T6:{const o=t(new Map,a);for(const[l,c]of s)o.set(n(l),n(c));return o}case C6:{const o=t(new Set,a);for(const l of s)o.add(n(l));return o}case xV:{const{name:o,message:l}=s;return t(new wL[o](l),a)}case RV:return t(BigInt(s),a);case"BigInt":return t(Object(BigInt(s)),a);case"ArrayBuffer":return t(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:o}=new Uint8Array(s);return t(new DataView(o),s)}}return t(new wL[i](s),a)};return n},TL=r=>ske(new Map,r)(0),Dh="",{toString:oke}={},{keys:lke}=Object,Bp=r=>{const e=typeof r;if(e!=="object"||!r)return[ky,e];const t=oke.call(r).slice(8,-1);switch(t){case"Array":return[dm,Dh];case"Object":return[Wb,Dh];case"Date":return[E6,Dh];case"RegExp":return[w6,Dh];case"Map":return[T6,Dh];case"Set":return[C6,Dh];case"DataView":return[dm,t]}return t.includes("Array")?[dm,t]:t.includes("Error")?[xV,t]:[Wb,t]},d_=([r,e])=>r===ky&&(e==="function"||e==="symbol"),cke=(r,e,t,n)=>{const a=(s,o)=>{const l=n.push(s)-1; Line truncated
`},{type:"element",tagName:"ol",properties:{},children:r.wrap(o,!0)},{type:"text",value:`
`}]}}const BA={}.hasOwnProperty,fke={};function pke(r,e){const t=e||fke,n=new Map,a=new Map,i=new Map,s={...ike,...t.handlers},o={all:c,applyData:gke,definitionById:n,footnoteById:a,footnoteCounts:i,footnoteOrder:[],handlers:s,one:l,options:t,patch:mke,wrap:bke};return eu(r,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const d=u.type==="definition"?n:a,h=String(u.identifier).toUpperCase();d.has(h)||d.set(h,u)}}),o;function l(u,d){const h=u.type,p=o.handlers[h];if(BA.call(o.handlers,h)&&p)return p(o,u,d);if(o.options.passThrough&&o.options.passThrough.includes(h)){if("children"in u){const{children:g,...b}=u,_=jb(b);return _.children=o.all(u),_}return jb(u)}return(o.options.unknownHandler||_ke)(o,u,d)}function c(u){const d=[];if("children"in u){const h=u.children;let p=-1;for(;++p<h.length;){const m=o.one(h[p],u);if(m){if(p&&h[p-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=AL(m.value)),!Array.isArray(m)&&m.type==="element")){const g=m.children[0];g&&g.type==="text"&&(g.value=AL(g.value))}Array.isArray(m)?d.push(...m):d.push(m)}}}return d}}function mke(r,e){r.position&&(e.position=Z8e(r))}function gke(r,e){let t=e;if(r&&r.data){const n=r.data.hName,a=r.data.hChildren,i=r.data.hProperties;if(typeof n=="string")if(t.type==="element")t.tagName=n;else{const s="children"in t?t.children:[t];t={type:"element",tagName:n,properties:{},children:s}}t.type==="element"&&i&&Object.assign(t.properties,jb(i)),"children"in t&&t.children&&a!==null&&a!==void 0&&(t.children=a)}return t}function _ke(r,e){const t=e.data||{},n="value"in e&&!(BA.call(t,"hProperties")||BA.call(t,"hChildren"))?{type:"text",value:e.value}:{type:"element",tagName:"div",properties:{},children:r.all(e)};return r.patch(e,n),r.applyData(e,n)}function bke(r,e){const t=[];let n=-1;for(e&&t.push({type:"text",value:`
`});++n<r.length;)n&&t.push({type:"text",value:`
`}),t.push(r[n]);return e&&r.length>0&&t.push({type:"text",value:`
`}),t}function AL(r){let e=0,t=r.charCodeAt(e);for(;t===9||t===32;)e++,t=r.charCodeAt(e);return r.slice(e)}function xL(r,e){const t=pke(r,e),n=t.one(r,void 0),a=hke(t),i=Array.isArray(n)?{type:"root",children:n}:n||{type:"root",children:[]};return a&&i.children.push({type:"text",value:`
`},a),i}function vke(r,e){return r&&"run"in r?async function(t,n){const a=xL(t,{file:n,...e});await r.run(a,n)}:function(t,n){return xL(t,{file:n,...r||e})}}class Dg{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}Dg.prototype.normal={};Dg.prototype.property={};Dg.prototype.space=void 0;function OV(r,e){const t={},n={};for(const a of r)Object.assign(t,a.property),Object.assign(n,a.normal);return new Dg(t,n,e)}function Gm(r){return r.toLowerCase()}class Ps{constructor(e,t){this.attribute=t,this.property=e}}Ps.prototype.attribute="";Ps.prototype.booleanish=!1;Ps.prototype.boolean=!1;Ps.prototype.commaOrSpaceSeparated=!1;Ps.prototype.commaSeparated=!1;Ps.prototype.defined=!1;Ps.prototype.mustUseProperty=!1;Ps.prototype.number=!1;Ps.prototype.overloadedBoolean=!1;Ps.prototype.property="";Ps.prototype.spaceSeparated=!1;Ps.prototype.space=void 0;let yke=0;const sn=gh(),Ya=gh(),UA=gh(),Yt=gh(),ia=gh(),_f=gh(),$s=gh();function gh(){return 2**++yke}const $A=Object.freeze(Object.defineProperty({__proto__:null,boolean:sn,booleanish:Ya,commaOrSpaceSeparated:$s,commaSeparated:_f,number:Yt,overloadedBoolean:UA,spaceSeparated:ia},Symbol.toStringTag,{value:"Module"})),gC=Object.keys($A);class A6 extends Ps{constructor(e,t,n,a){let i=-1;if(super(e,t),RL(this,"space",a),typeof n=="number")for(;++i<gC.length;){const s=gC[i];RL(this,gC[i],(n&$A[s])===$A[s])}}}A6.prototype.defined=!0;function RL(r,e,t){t&&(r[e]=t)}function up(r){const e={},t={};for(const[n,a]of Object.entries(r.properties)){const i=new A6(n,r.transform(r.attributes||{},n),a,r.space);r.mustUseProperty&&r.mustUseProperty.includes(n)&&(i.mustUseProperty=!0),e[n]=i,t[Gm(n)]=n,t[Gm(i.attribute)]=n}return new Dg(e,t,r.space)}const NV=up({properties:{ariaActiveDescendant:null,ariaAtomic:Ya,ariaAutoComplete:null,ariaBusy:Ya,ariaChecked:Ya,ariaColCount:Yt,ariaColIndex:Yt,ariaColSpan:Yt,ariaControls:ia,ariaCurrent:null,ariaDescribedBy:ia,ariaDetails:null,ariaDisabled:Ya,ariaDropEffect:ia,ariaErrorMessage:null,ariaExpanded:Ya,ariaFlowTo:ia,ariaGrabbed:Ya,ariaHasPopup:null,ariaHidden:Ya,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ia,ariaLevel:Yt,ariaLive:null,ariaModal:Ya,ariaMultiLine:Ya,ariaMultiSelectable:Ya,ariaOrientation:null,ariaOwns:ia,ariaPlaceholder:null,ariaPosInSet:Yt,ariaPressed:Ya,ariaReadOnly:Ya,ariaRelevant:null,ariaRequired:Ya,ariaRoleDescription:ia,ariaRowCount:Yt,ariaRowIndex:Yt,ariaRowSpan:Yt,ariaSelected:Ya,ariaSetSize:Yt,ariaSort:null,ariaValueMax:Yt,ariaValueMin:Yt,ariaValueNow:Yt,ariaValueText:null,role:null},transform(r,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function IV(r,e){return e in r?r[e]:e}function kV(r,e){return IV(r,e.toLowerCase())}const Ske=up({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:_f,acceptCharset:ia,accessKey:ia,action:null,allow:null,allowFullScreen:sn,allowPaymentRequest:sn,allowUserMedia:sn,alt:null,as:null,async:sn,autoCapitalize:null,autoComplete:ia,autoFocus:sn,autoPlay:sn,blocking:ia,capture:null,charSet:null,checked:sn,cite:null,className:ia,cols:Yt,colSpan:null,content:null,contentEditable:Ya,controls:sn,controlsList:ia,coords:Yt|_f,crossOrigin:null,data:null,dateTime:null,decoding:null,default:sn,defer:sn,dir:null,dirName:null,disabled:sn,download:UA,draggable:Ya,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:sn,formTarget:null,headers:ia,height:Yt,hidden:UA,high:Yt,href:null,hrefLang:null,htmlFor:ia,httpEquiv:ia,id:null,imageSizes:null,imageSrcSet:null,inert:sn,inputMode:null,integrity:null,is:null,isMap:sn,itemId:null,itemProp:ia,itemRef:ia,itemScope:sn,itemType:ia,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:sn,low:Yt,manifest:null,max:null,maxLength:Yt,media:null,method:null,min:null,minLength:Yt,multiple:sn,muted:sn,name:null,nonce:null,noModule:sn,noValidate:sn,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:n Line truncated
`});const c={type:"element",tagName:"li",properties:i,children:s};return t.patch(e,c),t.applyData(e,c)}function fLe(t){let e=!1;if(t.type==="list"){e=t.spread||!1;const r=t.children;let n=-1;for(;!e&&++n<r.length;)e=OY(r[n])}return e}function OY(t){const e=t.spread;return e??t.children.length>1}function gLe(t,e){const r={},n=t.all(e);let a=-1;for(typeof e.start=="number"&&e.start!==1&&(r.start=e.start);++a<n.length;){const s=n[a];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){r.className=["contains-task-list"];break}}const i={type:"element",tagName:e.ordered?"ol":"ul",properties:r,children:t.wrap(n,!0)};return t.patch(e,i),t.applyData(e,i)}function _Le(t,e){const r={type:"element",tagName:"p",properties:{},children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function bLe(t,e){const r={type:"root",children:t.wrap(t.all(e))};return t.patch(e,r),t.applyData(e,r)}function SLe(t,e){const r={type:"element",tagName:"strong",properties:{},children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}const NY=xY("end"),IY=xY("start");function xY(t){return e;function e(r){const n=r&&r.position&&r.position[t]||{};if(typeof n.line=="number"&&n.line>0&&typeof n.column=="number"&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset=="number"&&n.offset>-1?n.offset:void 0}}}function ELe(t){const e=IY(t),r=NY(t);if(e&&r)return{start:e,end:r}}function vLe(t,e){const r=t.all(e),n=r.shift(),a=[];if(n){const s={type:"element",tagName:"thead",properties:{},children:t.wrap([n],!0)};t.patch(e.children[0],s),a.push(s)}if(r.length>0){const s={type:"element",tagName:"tbody",properties:{},children:t.wrap(r,!0)},o=IY(e.children[1]),l=NY(e.children[e.children.length-1]);o&&l&&(s.position={start:o,end:l}),a.push(s)}const i={type:"element",tagName:"table",properties:{},children:t.wrap(a,!0)};return t.patch(e,i),t.applyData(e,i)}function yLe(t,e,r){const n=r?r.children:void 0,i=(n?n.indexOf(e):1)===0?"th":"td",s=r&&r.type==="table"?r.align:void 0,o=s?s.length:e.children.length;let l=-1;const c=[];for(;++l<o;){const d=e.children[l],h={},m=s?s[l]:void 0;m&&(h.align=m);let f={type:"element",tagName:i,properties:h,children:[]};d&&(f.children=t.all(d),t.patch(d,f),f=t.applyData(d,f)),c.push(f)}const u={type:"element",tagName:"tr",properties:{},children:t.wrap(c,!0)};return t.patch(e,u),t.applyData(e,u)}function TLe(t,e){const r={type:"element",tagName:"td",properties:{},children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}const C8=9,w8=32;function CLe(t){const e=String(t),r=/\r?\n|\r/g;let n=r.exec(e),a=0;const i=[];for(;n;)i.push(A8(e.slice(a,n.index),a>0,!0),n[0]),a=n.index+n[0].length,n=r.exec(e);return i.push(A8(e.slice(a),a>0,!1)),i.join("")}function A8(t,e,r){let n=0,a=t.length;if(e){let i=t.codePointAt(n);for(;i===C8||i===w8;)n++,i=t.codePointAt(n)}if(r){let i=t.codePointAt(a-1);for(;i===C8||i===w8;)a--,i=t.codePointAt(a-1)}return a>n?t.slice(n,a):""}function wLe(t,e){const r={type:"text",value:CLe(String(e.value))};return t.patch(e,r),t.applyData(e,r)}function ALe(t,e){const r={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,r),t.applyData(e,r)}const RLe={blockquote:tLe,break:rLe,code:nLe,delete:aLe,emphasis:iLe,footnoteReference:sLe,heading:oLe,html:lLe,imageReference:cLe,image:uLe,inlineCode:dLe,linkReference:hLe,link:pLe,listItem:mLe,list:gLe,paragraph:_Le,root:bLe,strong:SLe,table:vLe,tableCell:TLe,tableRow:yLe,text:wLe,thematicBreak:ALe,toml:p1,yaml:p1,definition:p1,footnoteDefinition:p1};function p1(){}const DY=-1,PE=0,mf=1,Qb=2,A3=3,R3=4,O3=5,N3=6,MY=7,kY=8,R8=typeof self=="object"?self:globalThis,OLe=(t,e)=>{const r=(a,i)=>(t.set(i,a),a),n=a=>{if(t.has(a))return t.get(a);const[i,s]=e[a];switch(i){case PE:case DY:return r(s,a);case mf:{const o=r([],a);for(const l of s)o.push(n(l));return o}case Qb:{const o=r({},a);for(const[l,c]of s)o[n(l)]=n(c);return o}case A3:return r(new Date(s),a);case R3:{const{source:o,flags:l}=s;return r(new RegExp(o,l),a)}case O3:{const o=r(new Map,a);for(const[l,c]of s)o.set(n(l),n(c));return o}case N3:{const o=r(new Set,a);for(const l of s)o.add(n(l));return o}case MY:{const{name:o,message:l}=s;return r(new R8[o](l),a)}case kY:return r(BigInt(s),a);case"BigInt":return r(Object(BigInt(s)),a);case"ArrayBuffer":return r(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:o}=new Uint8Array(s);return r(new DataView(o),s)}}return r(new R8[i](s),a)};return n},O8=t=>OLe(new Map,t)(0),Bh="",{toString:NLe}={},{keys:ILe}=Object,Gm=t=>{const e=typeof t;if(e!=="object"||!t)return[PE,e];const r=NLe.call(t).slice(8,-1);switch(r){case"Array":return[mf,Bh];case"Object":return[Qb,Bh];case"Date":return[A3,Bh];case"RegExp":return[R3,Bh];case"Map":return[O3,Bh];case"Set":return[N3,Bh];case"DataView":return[mf,r]}return r.includes("Array")?[mf,r]:r.includes("Error")?[MY,r]:[Qb,r]},m1=([t,e])=>t===PE&&(e==="function"||e==="symbol"),xLe=(t,e,r,n)=>{const a=(s,o)=>{const l=n.push(s)-1; Line truncated
`},{type:"element",tagName:"ol",properties:{},children:t.wrap(o,!0)},{type:"text",value:`
`}]}}const z2={}.hasOwnProperty,PLe={};function LLe(t,e){const r=e||PLe,n=new Map,a=new Map,i=new Map,s={...RLe,...r.handlers},o={all:c,applyData:BLe,definitionById:n,footnoteById:a,footnoteCounts:i,footnoteOrder:[],handlers:s,one:l,options:r,patch:FLe,wrap:GLe};return su(t,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const d=u.type==="definition"?n:a,h=String(u.identifier).toUpperCase();d.has(h)||d.set(h,u)}}),o;function l(u,d){const h=u.type,m=o.handlers[h];if(z2.call(o.handlers,h)&&m)return m(o,u,d);if(o.options.passThrough&&o.options.passThrough.includes(h)){if("children"in u){const{children:g,...b}=u,_=Xb(b);return _.children=o.all(u),_}return Xb(u)}return(o.options.unknownHandler||ULe)(o,u,d)}function c(u){const d=[];if("children"in u){const h=u.children;let m=-1;for(;++m<h.length;){const f=o.one(h[m],u);if(f){if(m&&h[m-1].type==="break"&&(!Array.isArray(f)&&f.type==="text"&&(f.value=I8(f.value)),!Array.isArray(f)&&f.type==="element")){const g=f.children[0];g&&g.type==="text"&&(g.value=I8(g.value))}Array.isArray(f)?d.push(...f):d.push(f)}}}return d}}function FLe(t,e){t.position&&(e.position=ELe(t))}function BLe(t,e){let r=e;if(t&&t.data){const n=t.data.hName,a=t.data.hChildren,i=t.data.hProperties;if(typeof n=="string")if(r.type==="element")r.tagName=n;else{const s="children"in r?r.children:[r];r={type:"element",tagName:n,properties:{},children:s}}r.type==="element"&&i&&Object.assign(r.properties,Xb(i)),"children"in r&&r.children&&a!==null&&a!==void 0&&(r.children=a)}return r}function ULe(t,e){const r=e.data||{},n="value"in e&&!(z2.call(r,"hProperties")||z2.call(r,"hChildren"))?{type:"text",value:e.value}:{type:"element",tagName:"div",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function GLe(t,e){const r=[];let n=-1;for(e&&r.push({type:"text",value:`
`});++n<t.length;)n&&r.push({type:"text",value:`
`}),r.push(t[n]);return e&&t.length>0&&r.push({type:"text",value:`
`}),r}function I8(t){let e=0,r=t.charCodeAt(e);for(;r===9||r===32;)e++,r=t.charCodeAt(e);return t.slice(e)}function x8(t,e){const r=LLe(t,e),n=r.one(t,void 0),a=kLe(r),i=Array.isArray(n)?{type:"root",children:n}:n||{type:"root",children:[]};return a&&i.children.push({type:"text",value:`
`},a),i}function qLe(t,e){return t&&"run"in t?async function(r,n){const a=x8(r,{file:n,...e});await t.run(a,n)}:function(r,n){return x8(r,{file:n,...t||e})}}class Fg{constructor(e,r,n){this.normal=r,this.property=e,n&&(this.space=n)}}Fg.prototype.normal={};Fg.prototype.property={};Fg.prototype.space=void 0;function PY(t,e){const r={},n={};for(const a of t)Object.assign(r,a.property),Object.assign(n,a.normal);return new Fg(r,n,e)}function Hf(t){return t.toLowerCase()}class Ls{constructor(e,r){this.attribute=r,this.property=e}}Ls.prototype.attribute="";Ls.prototype.booleanish=!1;Ls.prototype.boolean=!1;Ls.prototype.commaOrSpaceSeparated=!1;Ls.prototype.commaSeparated=!1;Ls.prototype.defined=!1;Ls.prototype.mustUseProperty=!1;Ls.prototype.number=!1;Ls.prototype.overloadedBoolean=!1;Ls.prototype.property="";Ls.prototype.spaceSeparated=!1;Ls.prototype.space=void 0;let zLe=0;const sn=Th(),Wa=Th(),$2=Th(),Vt=Th(),oa=Th(),Ep=Th(),$s=Th();function Th(){return 2**++zLe}const H2=Object.freeze(Object.defineProperty({__proto__:null,boolean:sn,booleanish:Wa,commaOrSpaceSeparated:$s,commaSeparated:Ep,number:Vt,overloadedBoolean:$2,spaceSeparated:oa},Symbol.toStringTag,{value:"Module"})),EA=Object.keys(H2);class I3 extends Ls{constructor(e,r,n,a){let i=-1;if(super(e,r),D8(this,"space",a),typeof n=="number")for(;++i<EA.length;){const s=EA[i];D8(this,EA[i],(n&H2[s])===H2[s])}}}I3.prototype.defined=!0;function D8(t,e,r){r&&(t[e]=r)}function pm(t){const e={},r={};for(const[n,a]of Object.entries(t.properties)){const i=new I3(n,t.transform(t.attributes||{},n),a,t.space);t.mustUseProperty&&t.mustUseProperty.includes(n)&&(i.mustUseProperty=!0),e[n]=i,r[Hf(n)]=n,r[Hf(i.attribute)]=n}return new Fg(e,r,t.space)}const LY=pm({properties:{ariaActiveDescendant:null,ariaAtomic:Wa,ariaAutoComplete:null,ariaBusy:Wa,ariaChecked:Wa,ariaColCount:Vt,ariaColIndex:Vt,ariaColSpan:Vt,ariaControls:oa,ariaCurrent:null,ariaDescribedBy:oa,ariaDetails:null,ariaDisabled:Wa,ariaDropEffect:oa,ariaErrorMessage:null,ariaExpanded:Wa,ariaFlowTo:oa,ariaGrabbed:Wa,ariaHasPopup:null,ariaHidden:Wa,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:oa,ariaLevel:Vt,ariaLive:null,ariaModal:Wa,ariaMultiLine:Wa,ariaMultiSelectable:Wa,ariaOrientation:null,ariaOwns:oa,ariaPlaceholder:null,ariaPosInSet:Vt,ariaPressed:Wa,ariaReadOnly:Wa,ariaRelevant:null,ariaRequired:Wa,ariaRoleDescription:oa,ariaRowCount:Vt,ariaRowIndex:Vt,ariaRowSpan:Vt,ariaSelected:Wa,ariaSetSize:Vt,ariaSort:null,ariaValueMax:Vt,ariaValueMin:Vt,ariaValueNow:Vt,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function FY(t,e){return e in t?t[e]:e}function BY(t,e){return FY(t,e.toLowerCase())}const $Le=pm({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ep,acceptCharset:oa,accessKey:oa,action:null,allow:null,allowFullScreen:sn,allowPaymentRequest:sn,allowUserMedia:sn,alt:null,as:null,async:sn,autoCapitalize:null,autoComplete:oa,autoFocus:sn,autoPlay:sn,blocking:oa,capture:null,charSet:null,checked:sn,cite:null,className:oa,cols:Vt,colSpan:null,content:null,contentEditable:Wa,controls:sn,controlsList:oa,coords:Vt|Ep,crossOrigin:null,data:null,dateTime:null,decoding:null,default:sn,defer:sn,dir:null,dirName:null,disabled:sn,download:$2,draggable:Wa,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:sn,formTarget:null,headers:oa,height:Vt,hidden:$2,high:Vt,href:null,hrefLang:null,htmlFor:oa,httpEquiv:oa,id:null,imageSizes:null,imageSrcSet:null,inert:sn,inputMode:null,integrity:null,is:null,isMap:sn,itemId:null,itemProp:oa,itemRef:oa,itemScope:sn,itemType:oa,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:sn,low:Vt,manifest:null,max:null,maxLength:Vt,media:null,method:null,min:null,minLength:Vt,multiple:sn,muted:sn,name:null,nonce:null,noModule:sn,noValidate:sn,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:n Line truncated
\f\r &/=>`.split(""),`
\f\r "&'/=>\``.split("")],[`\0
\f\r "&'/<=>`.split(""),`\0
@@ -464,6 +469,6 @@ l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
\f\r &>`.split(""),`\0
\f\r "&'<=>\``.split("")],[`\0
\f\r "&'<=>\``.split(""),`\0
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function FMe(r,e,t,n){const a=n.schema,i=a.space==="svg"?!1:n.settings.omitOptionalTags;let s=a.space==="svg"?n.settings.closeEmptyElements:n.settings.voids.includes(r.tagName.toLowerCase());const o=[];let l;a.space==="html"&&r.tagName==="svg"&&(n.schema=x6);const c=BMe(n,r.properties),u=n.all(a.space==="html"&&r.tagName==="template"?r.content:r);return n.schema=a,u&&(s=!1),(c||!i||!IMe(r,e,t))&&(o.push("<",r.tagName,c?" "+c:""),s&&(a.space==="svg"||n.settings.closeSelfClosing)&&(l=c.charAt(c.length-1),(!n.settings.tightSelfClosing||l==="/"||l&&l!=='"'&&l!=="'")&&o.push(" "),o.push("/")),o.push(">")),o.push(u),!s&&(!i||!O6(r,e,t))&&o.push("</"+r.tagName+">"),o.join("")}function BMe(r,e){const t=[];let n=-1,a;if(e){for(a in e)if(e[a]!==null&&e[a]!==void 0){const i=UMe(r,a,e[a]);i&&t.push(i)}}for(;++n<t.length;){const i=r.settings.tightAttributes?t[n].charAt(t[n].length-1):void 0;n!==t.length-1&&i!=='"'&&i!=="'"&&(t[n]+=" ")}return t.join("")}function UMe(r,e,t){const n=LV(r.schema,e),a=r.settings.allowParseErrors&&r.schema.space==="html"?0:1,i=r.settings.allowDangerousCharacters?0:1;let s=r.quote,o;if(n.overloadedBoolean&&(t===n.attribute||t==="")?t=!0:(n.boolean||n.overloadedBoolean)&&(typeof t!="string"||t===n.attribute||t==="")&&(t=!!t),t==null||t===!1||typeof t=="number"&&Number.isNaN(t))return"";const l=bf(n.attribute,Object.assign({},r.settings.characterReferences,{subset:f_.name[a][i]}));return t===!0||(t=Array.isArray(t)?(n.commaSeparated?xke:Oke)(t,{padLeft:!r.settings.tightCommaSeparatedLists}):String(t),r.settings.collapseEmptyAttributes&&!t)?l:(r.settings.preferUnquoted&&(o=bf(t,Object.assign({},r.settings.characterReferences,{attribute:!0,subset:f_.unquoted[a][i]}))),o!==t&&(r.settings.quoteSmart&&Ub(t,s)>Ub(t,r.alternative)&&(s=r.alternative),o=s+bf(t,Object.assign({},r.settings.characterReferences,{subset:(s==="'"?f_.single:f_.double)[a][i],attribute:!0}))+s),l+(o&&"="+o))}const $Me=["<","&"];function VV(r,e,t,n){return t&&t.type==="element"&&(t.tagName==="script"||t.tagName==="style")?r.value:bf(r.value,Object.assign({},n.settings.characterReferences,{subset:$Me}))}function GMe(r,e,t,n){return n.settings.allowDangerousHtml?r.value:VV(r,e,t,n)}function zMe(r,e,t,n){return n.all(r)}const qMe=Rq("type",{invalid:HMe,unknown:VMe,handlers:{comment:pMe,doctype:mMe,element:FMe,raw:GMe,root:zMe,text:VV}});function HMe(r){throw new Error("Expected node, not `"+r+"`")}function VMe(r){const e=r;throw new Error("Cannot compile unknown node `"+e.type+"`")}const YMe={},WMe={},jMe=[];function KMe(r,e){const t=e||YMe,n=t.quote||'"',a=n==='"'?"'":'"';if(n!=='"'&&n!=="'")throw new Error("Invalid quote `"+n+"`, expected `'` or `\"`");return{one:XMe,all:QMe,settings:{omitOptionalTags:t.omitOptionalTags||!1,allowParseErrors:t.allowParseErrors||!1,allowDangerousCharacters:t.allowDangerousCharacters||!1,quoteSmart:t.quoteSmart||!1,preferUnquoted:t.preferUnquoted||!1,tightAttributes:t.tightAttributes||!1,upperDoctype:t.upperDoctype||!1,tightDoctype:t.tightDoctype||!1,bogusComments:t.bogusComments||!1,tightCommaSeparatedLists:t.tightCommaSeparatedLists||!1,tightSelfClosing:t.tightSelfClosing||!1,collapseEmptyAttributes:t.collapseEmptyAttributes||!1,allowDangerousHtml:t.allowDangerousHtml||!1,voids:t.voids||jke,characterReferences:t.characterReferences||WMe,closeSelfClosing:t.closeSelfClosing||!1,closeEmptyElements:t.closeEmptyElements||!1},schema:t.space==="svg"?x6:FV,quote:n,alternative:a}.one(Array.isArray(r)?{type:"root",children:r}:r,void 0,void 0)}function XMe(r,e,t){return qMe(r,e,t,this)}function QMe(r){const e=[],t=r&&r.children||jMe;let n=-1;for(;++n<t.length;)e[n]=this.one(t[n],n,r);return e.join("")}function ZMe(r){const e=this,t={...e.data("settings"),...r};e.compiler=n;function n(a){return KMe(a,t)}}function YV(r){const e=[...r.matchAll(_ae)];if(!e.length)return[{type:"text",value:r}];const t=[];let n=0;for(const a of e)a.index>n&&t.push({type:"text",value:r.slice(n,a.index)}),t.push({type:"element",tagName:"br",properties:{},children:[]}),n=a.index+a[0].length;return n<r.length&&t.push({type:"text",value:r.slice(n)}),t}function JMe(r){const e=r.trim().match(bae);if(!e)return null;const t=e[1],n=[];let a=0;for(const i of t.matchAll(vae)){if(t.slice(a,i.index).trim())return null;n.push({type:"element",tagName:"li",properties:{},children:YV(i[1]??"")}),a=i.index+i[0].length}return!n.length||t.slice(a).trim()?null:{type:"element",tagName:"ul",properties:{},children:n}}function eDe(r){Ty(r,"text",(e,t)=>{const n=t[t.length-1];if(!n||n.type!=="element")return;const i=n.children,s=i.indexOf(e);if(s===-1)return;let o="",l=s;for(let d=s;d<i.length;d++){const h=i[d];if(h.type==="text")o+=h.value,l=d;else if(h.type==="element"&&h.tagName==="br")o+=`
`,l=d;else break}const c=JMe(o);if(c){i.splice(s,l-s+1,c);return}const u=YV(e.value);(u.length!==1||u[0]!==e)&&i.splice(s,1,...u)})}const tDe=()=>r=>{eu(r,"element",e=>{(e.tagName==="td"||e.tagName==="th")&&eDe(e)})},rDe=()=>r=>{eu(r,"element",e=>{if(e.tagName!=="a")return;const t=e.properties??{};t.href&&(t.target="_blank",t.rel="noopener noreferrer",e.properties=t)})},nDe='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-copy-icon lucide-copy"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/></svg>',aDe='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-eye lucide-eye-icon"><path d="M2.062 12.345a1 1 0 0 1 0-.69C3.5 7.73 7.36 5 12 5s8.5 2.73 9.938 6.655a1 1 0 0 1 0 .69C20.5 16.27 16.64 19 12 19s-8.5-2.73-9.938-6.655"/><circle cx="12" cy="12" r="3"/></svg>';function WV(r){return{type:"element",tagName:"span",properties:{},children:[{type:"raw",value:r}]}}function iDe(r){return{type:"element",tagName:"button",properties:{className:[Jre],"data-code-id":r,title:"Copy code",type:"button"},children:[WV(nDe)]}}function sDe(r){return{type:"element",tagName:"button",properties:{className:[ene],"data-code-id":r,title:"Preview code",type:"button"},children:[WV(aDe)]}}function oDe(r,e){const t=[iDe(e)];return r.toLowerCase()==="html"&&t.push(sDe(e)),{type:"element",tagName:"div",properties:{className:[Xre]},children:[{type:"element",tagName:"span",properties:{className:[Zre]},children:[{type:"text",value:r}]},{type:"element",tagName:"div",properties:{className:[Qre]},children:t}]}}function lDe(r){return{type:"element",tagName:"div",properties:{className:[jre]},children:[r]}}function cDe(r,e){return{type:"element",tagName:"div",properties:{className:[Kre,tne]},children:[r,lDe(e)]}}function uDe(r){const e=r.properties?.className;if(!Array.isArray(e))return"text";for(const t of e)if(typeof t=="string"&&t.startsWith("language-"))return t.replace("language-","");return"text"}function dDe(){return typeof window<"u"?`code-${window.idxCodeBlock=(window.idxCodeBlock??0)+1}`:`code-${Date.now()}-${Math.random().toString(36).slice(2,7)}`}const hDe=()=>r=>{eu(r,"element",(e,t,n)=>{if(e.tagName!=="pre"||!n||t===void 0)return;const a=e.children.find(c=>c.type==="element"&&c.tagName==="code");if(!a)return;const i=uDe(a),s=dDe();a.properties={...a.properties,"data-code-id":s};const o=oDe(i,s),l=cDe(o,e);n.children[t]=l})};function fDe(r){return e=>{eu(e,"element",t=>{if(t.tagName==="img"&&t.properties?.src){const n=String(t.properties.src);if(n.startsWith(lo.DATA)||n.startsWith(lo.HTTP))return;const a=r.attachments?.find(i=>i.type===Kr.IMAGE&&i.name===n);a?.base64Url&&(t.properties.src=a.base64Url)}})}}const pDe=()=>r=>{eu(r,"element",e=>{e.children&&e.children.length>0&&(e.properties={...e.properties,dir:"auto"})})};function mDe(r){let e=0,t="";for(;e<r.length;){const n=r[e];if(n===" "){t+=jU,e+=1;continue}if(n===" "){t+=Ane,e+=1;continue}break}return t+r.slice(e)}function gDe(r){const e=r.split(Tne),t=[];for(const[n,a]of e.entries())n>0&&t.push({type:"break"}),t.push({type:"text",value:mDe(a)});return t.length||t.push({type:"text",value:""}),t}const _De=()=>r=>{eu(r,"html",(e,t,n)=>{if(!n||typeof t!="number")return;const a=gDe(e.value);if(!Cne.has(n.type)){const i={type:"paragraph",children:a,data:{literalHtml:!0}},s=n.children;if(s.splice(t,1,i),t>0){const o=s[t-1];if(o?.type==="paragraph"&&o.data?.literalHtml){const l=o.children;return l.length&&l[l.length-1].type!=="break"&&l.push({type:"break"}),l.push(...i.children),s.splice(t,1),t}}return t+1}return n.children.splice(t,1,...a),t+a.length})},jV="pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#c9d1d9;background:#0d1117}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#ff7b72}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#d2a8ff}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-variable,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id{color:#79c0ff}.hljs-regexp,.hljs-string,.hljs-meta .hljs-string{color:#a5d6ff}.hljs-built_in,.hljs-symbol{color:#ffa657}.hljs-comment,.hljs-code,.hljs-formula{color:#8b949e}.hljs-name,.hljs-quote,.hljs-selector-tag,.hljs-selector-pseudo{color:#7ee787}.hljs-subst{color:#c9d1d9}.hljs-section{color:#1f6feb;font-weight:700}.hljs-bullet{color:#f2cc60}.hljs-emphasis{color:#c9d1d9;font-style:italic}.hljs-strong{color:#c9d1d9;font-weight:700}.hljs-addition{color:#aff5b4;background-color:#033a16}.hljs-deletion{color:#ffdcd7;background-color:#67060c}",KV="pre code. Line truncated
undone.`,1),QPe=G("<!> <!>",1),ZPe=G("<!> <!>",1),JPe=G("<!> <!>",1);function eLe(r,e){Ee(e,!0);let t=Y(e,"open",15);var n=se(),a=L(n);me(a,()=>ad,(i,s)=>{s(i,{get onOpenChange(){return e.onOpenChange},get open(){return t()},set open(o){t(o)},children:(o,l)=>{var c=se(),u=L(c);me(u,()=>rd,(d,h)=>{h(d,{children:(p,m)=>{var g=JPe(),b=L(g);me(b,()=>td,(v,y)=>{y(v,{children:(E,S)=>{var w=QPe(),C=L(w);me(C,()=>Ju,(N,I)=>{I(N,{children:(D,H)=>{et();var q=Ot("Delete Server");T(D,q)},$$slots:{default:!0}})});var x=ee(C,2);me(x,()=>nd,(N,I)=>{I(N,{children:(D,H)=>{et();var q=XPe(),$=ee(L(q)),K=j($,!0);V($),et(),Ce(()=>Ge(K,e.displayName)),T(D,q)},$$slots:{default:!0}})}),T(E,w)},$$slots:{default:!0}})});var _=ee(b,2);me(_,()=>ed,(v,y)=>{y(v,{children:(E,S)=>{var w=ZPe(),C=L(w);me(C,()=>Px,(N,I)=>{I(N,{children:(D,H)=>{et();var q=Ot("Cancel");T(D,q)},$$slots:{default:!0}})});var x=ee(C,2);me(x,()=>fh,(N,I)=>{I(N,{class:"text-destructive-foreground bg-destructive hover:bg-destructive/90",get onclick(){return e.onConfirm},children:(D,H)=>{et();var q=Ot("Delete");T(D,q)},$$slots:{default:!0}})}),T(E,w)},$$slots:{default:!0}})}),T(p,g)},$$slots:{default:!0}})}),T(o,c)},$$slots:{default:!0}})}),T(r,n),we()}var tLe=G('<div class="flex items-center justify-between gap-4"><div class="flex items-center gap-2"><!> <!> <!></div> <!></div> <div class="flex flex-wrap gap-1.5"><!> <!> <!></div> <div class="space-y-1.5"><!> <!></div> <!> <div class="flex justify-end gap-2"><!> <!> <!></div>',1);function rLe(r){Oc(r,{class:"grid gap-3 p-4",children:(e,t)=>{var n=tLe(),a=L(n),i=j(a),s=j(i);Fa(s,{class:"h-5 w-5 rounded"});var o=ee(s,2);Fa(o,{class:"h-5 w-28"});var l=ee(o,2);Fa(l,{class:"h-5 w-12 rounded-full"}),V(i);var c=ee(i,2);Fa(c,{class:"h-6 w-11 rounded-full"}),V(a);var u=ee(a,2),d=j(u);Fa(d,{class:"h-5 w-14 rounded-full"});var h=ee(d,2);Fa(h,{class:"h-5 w-12 rounded-full"});var p=ee(h,2);Fa(p,{class:"h-5 w-16 rounded-full"}),V(u);var m=ee(u,2),g=j(m);Fa(g,{class:"h-4 w-40"});var b=ee(g,2);Fa(b,{class:"h-4 w-52"}),V(m);var _=ee(m,2);Fa(_,{class:"h-3.5 w-36"});var v=ee(_,2),y=j(v);Fa(y,{class:"h-8 w-8 rounded"});var E=ee(y,2);Fa(E,{class:"h-8 w-8 rounded"});var S=ee(E,2);Fa(S,{class:"h-8 w-8 rounded"}),V(v),T(e,n)},$$slots:{default:!0}})}var nLe=G("<!> <span>Server instructions</span>",1),aLe=G('<p class="rounded bg-muted/50 p-2 text-xs text-muted-foreground"> </p>'),iLe=G("<!> <!>",1);function sLe(r,e){let t=_e(!1);var n=se(),a=L(n);{var i=s=>{var o=se(),l=L(o);me(l,()=>zf,(c,u)=>{u(c,{get class(){return e.class},get open(){return f(t)},set open(d){M(t,d,!0)},children:(d,h)=>{var p=iLe(),m=L(p);me(m,()=>qf,(b,_)=>{_(b,{class:"flex w-full items-center gap-1 text-xs text-muted-foreground hover:text-foreground",children:(v,y)=>{var E=nLe(),S=L(E);{var w=x=>{Uc(x,{class:"h-3.5 w-3.5"})},C=x=>{$c(x,{class:"h-3.5 w-3.5"})};le(S,x=>{f(t)?x(w):x(C,!1)})}et(2),T(v,E)},$$slots:{default:!0}})});var g=ee(m,2);me(g,()=>Hf,(b,_)=>{_(b,{class:"mt-2",children:(v,y)=>{var E=aLe(),S=j(E,!0);V(E),Ce(()=>Ge(S,e.instructions)),T(v,E)},$$slots:{default:!0}})}),T(d,p)},$$slots:{default:!0}})}),T(s,o)};le(a,s=>{e.instructions&&s(i)})}T(r,n)}var oLe=G('<div class="flex flex-col gap-2"><div class="mb-2 flex items-center gap-4"><!> <!></div> <h3 class="text-sm font-medium">Available resources</h3></div>');function lLe(r,e){Ee(e,!0);let t=Y(e,"searchQuery",3,"");var n=oLe(),a=j(n),i=j(a);My(i,{placeholder:"Search resources...",get value(){return t()},onInput:o=>e.onSearch?.(o)});var s=ee(i,2);kr(s,{variant:"ghost",size:"sm",class:"h-8 w-8 p-0",get onclick(){return e.onRefresh},get disabled(){return e.isLoading},title:"Refresh resources",children:(o,l)=>{var c=se(),u=L(c);{var d=p=>{Xa(p,{class:"h-4 w-4 animate-spin"})},h=p=>{Tc(p,{class:"h-4 w-4"})};le(u,p=>{e.isLoading?p(d):p(h,!1)})}T(o,c)},$$slots:{default:!0}}),V(a),et(2),V(n),T(r,n),we()}var cLe=G('<div class="py-4 text-center text-sm text-muted-foreground"><!></div>');function uLe(r,e){var t=cLe(),n=j(t);{var a=s=>{var o=Ot("Loading resources...");T(s,o)},i=s=>{var o=Ot("No resources available");T(s,o)};le(n,s=>{e.isLoading?s(a):s(i,!1)})}V(t),T(r,t)}function dLe(r,e){return r.title?.toLowerCase().includes(e)||r.uri.toLowerCase().includes(e)}function hLe(r,e,t){const n={name:"root",children:new Map};if(!t||!t.trim()){for(const s of r){const o=db(s.uri);let l=n;for(let u=0;u<o.length-1;u++){const d=o[u];l.children.has(d)||l.children.set(d,{name:d,children:new Map}),l=l.children.get(d)}const c=o[o.length-1]||s.name;l.children.set(s.uri,{name:c,resource:{...s,serverName:e},children:new Map})}return n}const a=t.toLowerCase();for(const s of r){if(!dLe(s,a))continue;const o=db(s.uri);let l=n;for(let u=0;u<o.length-1;u++){const d=o[u];l.children.has(d)||l.children.set(d,{name:d,children:new Map,isFiltered:!0}),l=l.children.get(d)}const c=o[o.length-1]||s.name;l.children.set(s.uri,{name:c,resource:{...s,serverName:e},children:new Map,isFiltered:!0})}function i(s){if(s.resource)return!0;const o=[];for(co Line truncated
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function iFe(t,e,r,n){const a=n.schema,i=a.space==="svg"?!1:n.settings.omitOptionalTags;let s=a.space==="svg"?n.settings.closeEmptyElements:n.settings.voids.includes(t.tagName.toLowerCase());const o=[];let l;a.space==="html"&&t.tagName==="svg"&&(n.schema=x3);const c=sFe(n,t.properties),u=n.all(a.space==="html"&&t.tagName==="template"?t.content:t);return n.schema=a,u&&(s=!1),(c||!i||!J8e(t,e,r))&&(o.push("<",t.tagName,c?" "+c:""),s&&(a.space==="svg"||n.settings.closeSelfClosing)&&(l=c.charAt(c.length-1),(!n.settings.tightSelfClosing||l==="/"||l&&l!=='"'&&l!=="'")&&o.push(" "),o.push("/")),o.push(">")),o.push(u),!s&&(!i||!M3(t,e,r))&&o.push("</"+t.tagName+">"),o.join("")}function sFe(t,e){const r=[];let n=-1,a;if(e){for(a in e)if(e[a]!==null&&e[a]!==void 0){const i=oFe(t,a,e[a]);i&&r.push(i)}}for(;++n<r.length;){const i=t.settings.tightAttributes?r[n].charAt(r[n].length-1):void 0;n!==r.length-1&&i!=='"'&&i!=="'"&&(r[n]+=" ")}return r.join("")}function oFe(t,e,r){const n=zY(t.schema,e),a=t.settings.allowParseErrors&&t.schema.space==="html"?0:1,i=t.settings.allowDangerousCharacters?0:1;let s=t.quote,o;if(n.overloadedBoolean&&(r===n.attribute||r==="")?r=!0:(n.boolean||n.overloadedBoolean)&&(typeof r!="string"||r===n.attribute||r==="")&&(r=!!r),r==null||r===!1||typeof r=="number"&&Number.isNaN(r))return"";const l=vp(n.attribute,Object.assign({},t.settings.characterReferences,{subset:g1.name[a][i]}));return r===!0||(r=Array.isArray(r)?(n.commaSeparated?jLe:XLe)(r,{padLeft:!t.settings.tightCommaSeparatedLists}):String(r),t.settings.collapseEmptyAttributes&&!r)?l:(t.settings.preferUnquoted&&(o=vp(r,Object.assign({},t.settings.characterReferences,{attribute:!0,subset:g1.unquoted[a][i]}))),o!==r&&(t.settings.quoteSmart&&zb(r,s)>zb(r,t.alternative)&&(s=t.alternative),o=s+vp(r,Object.assign({},t.settings.characterReferences,{subset:(s==="'"?g1.single:g1.double)[a][i],attribute:!0}))+s),l+(o&&"="+o))}const lFe=["<","&"];function XY(t,e,r,n){return r&&r.type==="element"&&(r.tagName==="script"||r.tagName==="style")?t.value:vp(t.value,Object.assign({},n.settings.characterReferences,{subset:lFe}))}function cFe(t,e,r,n){return n.settings.allowDangerousHtml?t.value:XY(t,e,r,n)}function uFe(t,e,r,n){return n.all(t)}const dFe=D$("type",{invalid:hFe,unknown:pFe,handlers:{comment:L8e,doctype:F8e,element:iFe,raw:cFe,root:uFe,text:XY}});function hFe(t){throw new Error("Expected node, not `"+t+"`")}function pFe(t){const e=t;throw new Error("Cannot compile unknown node `"+e.type+"`")}const mFe={},fFe={},gFe=[];function _Fe(t,e){const r=e||mFe,n=r.quote||'"',a=n==='"'?"'":'"';if(n!=='"'&&n!=="'")throw new Error("Invalid quote `"+n+"`, expected `'` or `\"`");return{one:bFe,all:SFe,settings:{omitOptionalTags:r.omitOptionalTags||!1,allowParseErrors:r.allowParseErrors||!1,allowDangerousCharacters:r.allowDangerousCharacters||!1,quoteSmart:r.quoteSmart||!1,preferUnquoted:r.preferUnquoted||!1,tightAttributes:r.tightAttributes||!1,upperDoctype:r.upperDoctype||!1,tightDoctype:r.tightDoctype||!1,bogusComments:r.bogusComments||!1,tightCommaSeparatedLists:r.tightCommaSeparatedLists||!1,tightSelfClosing:r.tightSelfClosing||!1,collapseEmptyAttributes:r.collapseEmptyAttributes||!1,allowDangerousHtml:r.allowDangerousHtml||!1,voids:r.voids||g8e,characterReferences:r.characterReferences||fFe,closeSelfClosing:r.closeSelfClosing||!1,closeEmptyElements:r.closeEmptyElements||!1},schema:r.space==="svg"?x3:$Y,quote:n,alternative:a}.one(Array.isArray(t)?{type:"root",children:t}:t,void 0,void 0)}function bFe(t,e,r){return dFe(t,e,r,this)}function SFe(t){const e=[],r=t&&t.children||gFe;let n=-1;for(;++n<r.length;)e[n]=this.one(r[n],n,t);return e.join("")}function EFe(t){const e=this,r={...e.data("settings"),...t};e.compiler=n;function n(a){return _Fe(a,r)}}function ZY(t){const e=[...t.matchAll(Tae)];if(!e.length)return[{type:"text",value:t}];const r=[];let n=0;for(const a of e)a.index>n&&r.push({type:"text",value:t.slice(n,a.index)}),r.push({type:"element",tagName:"br",properties:{},children:[]}),n=a.index+a[0].length;return n<t.length&&r.push({type:"text",value:t.slice(n)}),r}function vFe(t){const e=t.trim().match(Cae);if(!e)return null;const r=e[1],n=[];let a=0;for(const i of r.matchAll(wae)){if(r.slice(a,i.index).trim())return null;n.push({type:"element",tagName:"li",properties:{},children:ZY(i[1]??"")}),a=i.index+i[0].length}return!n.length||r.slice(a).trim()?null:{type:"element",tagName:"ul",properties:{},children:n}}function yFe(t){RE(t,"text",(e,r)=>{const n=r[r.length-1];if(!n||n.type!=="element")return;const i=n.children,s=i.indexOf(e);if(s===-1)return;let o="",l=s;for(let d=s;d<i.length;d++){const h=i[d];if(h.type==="text")o+=h.value,l=d;else if(h.type==="element"&&h.tagName==="br")o+=`
`,l=d;else break}const c=vFe(o);if(c){i.splice(s,l-s+1,c);return}const u=ZY(e.value);(u.length!==1||u[0]!==e)&&i.splice(s,1,...u)})}const TFe=()=>t=>{su(t,"element",e=>{(e.tagName==="td"||e.tagName==="th")&&yFe(e)})},CFe=()=>t=>{su(t,"element",e=>{if(e.tagName!=="a")return;const r=e.properties??{};r.href&&(r.target="_blank",r.rel="noopener noreferrer",e.properties=r)})},wFe='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-copy-icon lucide-copy"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/></svg>',AFe='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-eye lucide-eye-icon"><path d="M2.062 12.345a1 1 0 0 1 0-.69C3.5 7.73 7.36 5 12 5s8.5 2.73 9.938 6.655a1 1 0 0 1 0 .69C20.5 16.27 16.64 19 12 19s-8.5-2.73-9.938-6.655"/><circle cx="12" cy="12" r="3"/></svg>';function JY(t){return{type:"element",tagName:"span",properties:{},children:[{type:"raw",value:t}]}}function RFe(t){return{type:"element",tagName:"button",properties:{className:[ine],"data-code-id":t,title:"Copy code",type:"button"},children:[JY(wFe)]}}function OFe(t){return{type:"element",tagName:"button",properties:{className:[sne],"data-code-id":t,title:"Preview code",type:"button"},children:[JY(AFe)]}}function NFe(t,e){const r=[RFe(e)];return t.toLowerCase()==="html"&&r.push(OFe(e)),{type:"element",tagName:"div",properties:{className:[rne]},children:[{type:"element",tagName:"span",properties:{className:[ane]},children:[{type:"text",value:t}]},{type:"element",tagName:"div",properties:{className:[nne]},children:r}]}}function IFe(t){return{type:"element",tagName:"div",properties:{className:[ene]},children:[t]}}function xFe(t,e){return{type:"element",tagName:"div",properties:{className:[tne,one]},children:[t,IFe(e)]}}function DFe(t){const e=t.properties?.className;if(!Array.isArray(e))return"text";for(const r of e)if(typeof r=="string"&&r.startsWith("language-"))return r.replace("language-","");return"text"}function MFe(){return typeof window<"u"?`code-${window.idxCodeBlock=(window.idxCodeBlock??0)+1}`:`code-${Date.now()}-${Math.random().toString(36).slice(2,7)}`}const kFe=()=>t=>{su(t,"element",(e,r,n)=>{if(e.tagName!=="pre"||!n||r===void 0)return;const a=e.children.find(c=>c.type==="element"&&c.tagName==="code");if(!a)return;const i=DFe(a),s=MFe();a.properties={...a.properties,"data-code-id":s};const o=NFe(i,s),l=xFe(o,e);n.children[r]=l})};function PFe(t){return e=>{su(e,"element",r=>{if(r.tagName==="img"&&r.properties?.src){const n=String(r.properties.src);if(n.startsWith(ho.DATA)||n.startsWith(ho.HTTP))return;const a=t.attachments?.find(i=>i.type===Qr.IMAGE&&i.name===n);a?.base64Url&&(r.properties.src=a.base64Url)}})}}const LFe=()=>t=>{su(t,"element",e=>{e.children&&e.children.length>0&&(e.properties={...e.properties,dir:"auto"})})};function FFe(t){let e=0,r="";for(;e<t.length;){const n=t[e];if(n===" "){r+=ZU,e+=1;continue}if(n===" "){r+=Dne,e+=1;continue}break}return r+t.slice(e)}function BFe(t){const e=t.split(Ine),r=[];for(const[n,a]of e.entries())n>0&&r.push({type:"break"}),r.push({type:"text",value:FFe(a)});return r.length||r.push({type:"text",value:""}),r}const UFe=()=>t=>{su(t,"html",(e,r,n)=>{if(!n||typeof r!="number")return;const a=BFe(e.value);if(!xne.has(n.type)){const i={type:"paragraph",children:a,data:{literalHtml:!0}},s=n.children;if(s.splice(r,1,i),r>0){const o=s[r-1];if(o?.type==="paragraph"&&o.data?.literalHtml){const l=o.children;return l.length&&l[l.length-1].type!=="break"&&l.push({type:"break"}),l.push(...i.children),s.splice(r,1),r}}return r+1}return n.children.splice(r,1,...a),r+a.length})},eV="pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#c9d1d9;background:#0d1117}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#ff7b72}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#d2a8ff}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-variable,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id{color:#79c0ff}.hljs-regexp,.hljs-string,.hljs-meta .hljs-string{color:#a5d6ff}.hljs-built_in,.hljs-symbol{color:#ffa657}.hljs-comment,.hljs-code,.hljs-formula{color:#8b949e}.hljs-name,.hljs-quote,.hljs-selector-tag,.hljs-selector-pseudo{color:#7ee787}.hljs-subst{color:#c9d1d9}.hljs-section{color:#1f6feb;font-weight:700}.hljs-bullet{color:#f2cc60}.hljs-emphasis{color:#c9d1d9;font-style:italic}.hljs-strong{color:#c9d1d9;font-weight:700}.hljs-addition{color:#aff5b4;background-color:#033a16}.hljs-deletion{color:#ffdcd7;background-color:#67060c}",tV="pre code. Line truncated
undone.`,1),SUe=q("<!> <!>",1),EUe=q("<!> <!>",1),vUe=q("<!> <!>",1);function yUe(t,e){ye(e,!0);let r=V(e,"open",15);var n=se(),a=L(n);fe(a,()=>ud,(i,s)=>{s(i,{get onOpenChange(){return e.onOpenChange},get open(){return r()},set open(o){r(o)},children:(o,l)=>{var c=se(),u=L(c);fe(u,()=>ld,(d,h)=>{h(d,{children:(m,f)=>{var g=vUe(),b=L(g);fe(b,()=>od,(S,E)=>{E(S,{children:(y,v)=>{var T=SUe(),w=L(T);fe(w,()=>id,(I,x)=>{x(I,{children:(D,$)=>{et();var H=Nt("Delete Server");C(D,H)},$$slots:{default:!0}})});var A=te(w,2);fe(A,()=>cd,(I,x)=>{x(I,{children:(D,$)=>{et();var H=bUe(),G=te(L(H)),K=j(G,!0);Y(G),et(),we(()=>qe(K,e.displayName)),C(D,H)},$$slots:{default:!0}})}),C(y,T)},$$slots:{default:!0}})});var _=te(b,2);fe(_,()=>sd,(S,E)=>{E(S,{children:(y,v)=>{var T=EUe(),w=L(T);fe(w,()=>Ux,(I,x)=>{x(I,{children:(D,$)=>{et();var H=Nt("Cancel");C(D,H)},$$slots:{default:!0}})});var A=te(w,2);fe(A,()=>Eh,(I,x)=>{x(I,{class:"text-destructive-foreground bg-destructive hover:bg-destructive/90",get onclick(){return e.onConfirm},children:(D,$)=>{et();var H=Nt("Delete");C(D,H)},$$slots:{default:!0}})}),C(y,T)},$$slots:{default:!0}})}),C(m,g)},$$slots:{default:!0}})}),C(o,c)},$$slots:{default:!0}})}),C(t,n),Te()}var TUe=q('<div class="flex items-center justify-between gap-4"><div class="flex items-center gap-2"><!> <!> <!></div> <!></div> <div class="flex flex-wrap gap-1.5"><!> <!> <!></div> <div class="space-y-1.5"><!> <!></div> <!> <div class="flex justify-end gap-2"><!> <!> <!></div>',1);function CUe(t){Pc(t,{class:"grid gap-3 p-4",children:(e,r)=>{var n=TUe(),a=L(n),i=j(a),s=j(i);Fa(s,{class:"h-5 w-5 rounded"});var o=te(s,2);Fa(o,{class:"h-5 w-28"});var l=te(o,2);Fa(l,{class:"h-5 w-12 rounded-full"}),Y(i);var c=te(i,2);Fa(c,{class:"h-6 w-11 rounded-full"}),Y(a);var u=te(a,2),d=j(u);Fa(d,{class:"h-5 w-14 rounded-full"});var h=te(d,2);Fa(h,{class:"h-5 w-12 rounded-full"});var m=te(h,2);Fa(m,{class:"h-5 w-16 rounded-full"}),Y(u);var f=te(u,2),g=j(f);Fa(g,{class:"h-4 w-40"});var b=te(g,2);Fa(b,{class:"h-4 w-52"}),Y(f);var _=te(f,2);Fa(_,{class:"h-3.5 w-36"});var S=te(_,2),E=j(S);Fa(E,{class:"h-8 w-8 rounded"});var y=te(E,2);Fa(y,{class:"h-8 w-8 rounded"});var v=te(y,2);Fa(v,{class:"h-8 w-8 rounded"}),Y(S),C(e,n)},$$slots:{default:!0}})}var wUe=q("<!> <span>Server instructions</span>",1),AUe=q('<p class="rounded bg-muted/50 p-2 text-xs text-muted-foreground"> </p>'),RUe=q("<!> <!>",1);function OUe(t,e){let r=_e(!1);var n=se(),a=L(n);{var i=s=>{var o=se(),l=L(o);fe(l,()=>Yp,(c,u)=>{u(c,{get class(){return e.class},get open(){return p(r)},set open(d){k(r,d,!0)},children:(d,h)=>{var m=RUe(),f=L(m);fe(f,()=>Vp,(b,_)=>{_(b,{class:"flex w-full items-center gap-1 text-xs text-muted-foreground hover:text-foreground",children:(S,E)=>{var y=wUe(),v=L(y);{var T=A=>{Yc(A,{class:"h-3.5 w-3.5"})},w=A=>{Vc(A,{class:"h-3.5 w-3.5"})};le(v,A=>{p(r)?A(T):A(w,!1)})}et(2),C(S,y)},$$slots:{default:!0}})});var g=te(f,2);fe(g,()=>Wp,(b,_)=>{_(b,{class:"mt-2",children:(S,E)=>{var y=AUe(),v=j(y,!0);Y(y),we(()=>qe(v,e.instructions)),C(S,y)},$$slots:{default:!0}})}),C(d,m)},$$slots:{default:!0}})}),C(s,o)};le(a,s=>{e.instructions&&s(i)})}C(t,n)}var NUe=q('<div class="flex flex-col gap-2"><div class="mb-2 flex items-center gap-4"><!> <!></div> <h3 class="text-sm font-medium">Available resources</h3></div>');function IUe(t,e){ye(e,!0);let r=V(e,"searchQuery",3,"");var n=NUe(),a=j(n),i=j(a);LE(i,{placeholder:"Search resources...",get value(){return r()},onInput:o=>e.onSearch?.(o)});var s=te(i,2);Dr(s,{variant:"ghost",size:"sm",class:"h-8 w-8 p-0",get onclick(){return e.onRefresh},get disabled(){return e.isLoading},title:"Refresh resources",children:(o,l)=>{var c=se(),u=L(c);{var d=m=>{Xa(m,{class:"h-4 w-4 animate-spin"})},h=m=>{Ic(m,{class:"h-4 w-4"})};le(u,m=>{e.isLoading?m(d):m(h,!1)})}C(o,c)},$$slots:{default:!0}}),Y(a),et(2),Y(n),C(t,n),Te()}var xUe=q('<div class="py-4 text-center text-sm text-muted-foreground"><!></div>');function DUe(t,e){var r=xUe(),n=j(r);{var a=s=>{var o=Nt("Loading resources...");C(s,o)},i=s=>{var o=Nt("No resources available");C(s,o)};le(n,s=>{e.isLoading?s(a):s(i,!1)})}Y(r),C(t,r)}function MUe(t,e){return t.title?.toLowerCase().includes(e)||t.uri.toLowerCase().includes(e)}function kUe(t,e,r){const n={name:"root",children:new Map};if(!r||!r.trim()){for(const s of t){const o=mb(s.uri);let l=n;for(let u=0;u<o.length-1;u++){const d=o[u];l.children.has(d)||l.children.set(d,{name:d,children:new Map}),l=l.children.get(d)}const c=o[o.length-1]||s.name;l.children.set(s.uri,{name:c,resource:{...s,serverName:e},children:new Map})}return n}const a=r.toLowerCase();for(const s of t){if(!MUe(s,a))continue;const o=mb(s.uri);let l=n;for(let u=0;u<o.length-1;u++){const d=o[u];l.children.has(d)||l.children.set(d,{name:d,children:new Map,isFiltered:!0}),l=l.children.get(d)}const c=o[o.length-1]||s.name;l.children.set(s.uri,{name:c,resource:{...s,serverName:e},children:new Map,isFiltered:!0})}function i(s){if(s.resource)return!0;const o=[];for(co Line truncated
+1 -1
View File
@@ -18,7 +18,7 @@
<div style="display: contents">
<script>
{
__sveltekit_10avopp = {
__sveltekit_1ppa22i = {
base: new URL('.', location).pathname.slice(0, -1)
};
@@ -4,6 +4,7 @@
import remarkGfm from 'remark-gfm';
import remarkMath from 'remark-math';
import rehypeHighlight from 'rehype-highlight';
import { all as lowlightAll } from 'lowlight';
import remarkRehype from 'remark-rehype';
import rehypeKatex from 'rehype-katex';
import rehypeStringify from 'rehype-stringify';
@@ -96,6 +97,7 @@
return proc
.use(rehypeHighlight, {
languages: lowlightAll,
aliases: { [FileTypeText.XML]: [FileTypeText.SVELTE, FileTypeText.VUE] }
}) // Add syntax highlighting
.use(rehypeRestoreTableHtml) // Restore limited HTML (e.g., <br>, <ul>) inside Markdown tables