@task-handoff/controlled-instance 0.0.65 → 0.0.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/controlled-instance-cli.js +6 -6
- package/dist/opencode-story-plugin.mjs +1 -1
- package/package.json +1 -1
- package/ui/assets/{abnfDiagram-VRR7QNED-DFBdqSvu.js → abnfDiagram-VRR7QNED-4Nbga3TV.js} +1 -1
- package/ui/assets/{arc-t8uFvpBL.js → arc-GXMcA4Ug.js} +1 -1
- package/ui/assets/{architectureDiagram-ZJ3FMSHR-Bokx3Sab.js → architectureDiagram-ZJ3FMSHR-BsqO5BCv.js} +1 -1
- package/ui/assets/{blockDiagram-677ZJIJ3-BEcrXXFl.js → blockDiagram-677ZJIJ3-4sFL5quJ.js} +1 -1
- package/ui/assets/{c4Diagram-LMCZKHZV-Dygrf-fy.js → c4Diagram-LMCZKHZV-C3ukGPZ_.js} +1 -1
- package/ui/assets/channel-BBEwbXzl.js +1 -0
- package/ui/assets/{chunk-2Q5K7J3B-UHP7kwhk.js → chunk-2Q5K7J3B-BbQEQNFn.js} +1 -1
- package/ui/assets/{chunk-32BRIVSS-Bv0rLdAk.js → chunk-32BRIVSS-BjBUUPse.js} +1 -1
- package/ui/assets/{chunk-5VM5RSS4-CciRB8_R.js → chunk-5VM5RSS4-sHudRoVW.js} +1 -1
- package/ui/assets/{chunk-EX3LRPZG-D6pV84xS.js → chunk-EX3LRPZG-bdHG455G.js} +1 -1
- package/ui/assets/{chunk-JWPE2WC7-vaUCMiXE.js → chunk-JWPE2WC7-B4_JRE2S.js} +1 -1
- package/ui/assets/{chunk-MOJQB5TN-CKZKh7tl.js → chunk-MOJQB5TN-dPIia7Sl.js} +1 -1
- package/ui/assets/{chunk-RYQCIY6F-CIRvAb7o.js → chunk-RYQCIY6F-C9S6Uo4K.js} +1 -1
- package/ui/assets/{chunk-V7JOEXUC-C_iz46Vd.js → chunk-V7JOEXUC-DXkoZ6rm.js} +1 -1
- package/ui/assets/{chunk-VR4S4FIN-Deg9CbXq.js → chunk-VR4S4FIN-DzQnInIq.js} +1 -1
- package/ui/assets/{chunk-XXDRQBXY-B2c1fud-.js → chunk-XXDRQBXY-3UI-IUo3.js} +1 -1
- package/ui/assets/classDiagram-OUVF2IWQ-CppW58j9.js +1 -0
- package/ui/assets/classDiagram-v2-EOCWNBFH-CppW58j9.js +1 -0
- package/ui/assets/{cose-bilkent-JH36ORCC-BNBdsm9O.js → cose-bilkent-JH36ORCC-C1d-eQ7F.js} +1 -1
- package/ui/assets/{cynefin-VYW2F7L2-DWwhi8x_.js → cynefin-VYW2F7L2-BFykbVVR.js} +1 -1
- package/ui/assets/{cynefinDiagram-TSTJHNR4-CUlzZCV1.js → cynefinDiagram-TSTJHNR4-CHmD_MKr.js} +1 -1
- package/ui/assets/{dagre-VKFMJZFB-DV4zk7vn.js → dagre-VKFMJZFB-Cqd824qk.js} +1 -1
- package/ui/assets/{diagram-FQU43EPY-NfHes2_G.js → diagram-FQU43EPY-BgIzm-M2.js} +1 -1
- package/ui/assets/{diagram-G47NLZAW-Bk-Fz8Nx.js → diagram-G47NLZAW-BJPgA8px.js} +1 -1
- package/ui/assets/{diagram-NH7WQ7WH-BDMPIHfI.js → diagram-NH7WQ7WH-zis6V_9R.js} +1 -1
- package/ui/assets/{diagram-OA4YK3LP-Czl5Kftp.js → diagram-OA4YK3LP-DXZmaRMJ.js} +1 -1
- package/ui/assets/{diagram-WEI45ONY-B1ul-SKc.js → diagram-WEI45ONY-GQ2TZQeF.js} +1 -1
- package/ui/assets/{ebnfDiagram-CCIWWBDH-BhwMpvV_.js → ebnfDiagram-CCIWWBDH-BE3udvPk.js} +1 -1
- package/ui/assets/{erDiagram-Q63AITRT-CQ927K-6.js → erDiagram-Q63AITRT-DFFHIktE.js} +1 -1
- package/ui/assets/{flowDiagram-23GEKE2U-Cw_ZHU7N.js → flowDiagram-23GEKE2U-2_nymzEm.js} +1 -1
- package/ui/assets/{ganttDiagram-NO4QXBWP-BsCF5II7.js → ganttDiagram-NO4QXBWP-CFfuDXfh.js} +1 -1
- package/ui/assets/{gitGraphDiagram-IHSO6WYX-B4Yl92T9.js → gitGraphDiagram-IHSO6WYX-BpXq5XW2.js} +1 -1
- package/ui/assets/{index-CGZZBmID.js → index-6-o5T9ul.js} +58 -57
- package/ui/assets/{index-DNwrk0eJ.css → index-DS8CKhZS.css} +1 -1
- package/ui/assets/{infoDiagram-FWYZ7A6U-CTW0M6Zt.js → infoDiagram-FWYZ7A6U-zcklkWZr.js} +1 -1
- package/ui/assets/{ishikawaDiagram-FXEZZL3T-DXpnq6cA.js → ishikawaDiagram-FXEZZL3T-cBhU0o2A.js} +1 -1
- package/ui/assets/{journeyDiagram-5HDEW3XC-DhlqMmX3.js → journeyDiagram-5HDEW3XC-7tKZ87Qk.js} +1 -1
- package/ui/assets/{kanban-definition-HUTT4EX6-HyZPYqKf.js → kanban-definition-HUTT4EX6-oaEQYc9A.js} +1 -1
- package/ui/assets/{linear-BOBTZMoW.js → linear-C2DmfWFF.js} +1 -1
- package/ui/assets/{mermaid.core-CWTrOXge.js → mermaid.core-D9RSZOdA.js} +4 -4
- package/ui/assets/{mindmap-definition-LN4V7U3C-DbKlkx_m.js → mindmap-definition-LN4V7U3C-CNkccGf5.js} +1 -1
- package/ui/assets/{pegDiagram-2B236MQR-BFRq7u8G.js → pegDiagram-2B236MQR-B8D8OvVP.js} +1 -1
- package/ui/assets/{pieDiagram-ENE6RG2P-DBa5QlaA.js → pieDiagram-ENE6RG2P-YcXC7Z--.js} +1 -1
- package/ui/assets/{quadrantDiagram-ABIIQ3AL-BtFfu8GK.js → quadrantDiagram-ABIIQ3AL-Bq05AUb7.js} +1 -1
- package/ui/assets/{railroadDiagram-RFXS5EU6-iyjb-Htb.js → railroadDiagram-RFXS5EU6-BecNkcF4.js} +1 -1
- package/ui/assets/{requirementDiagram-TGXJPOKE-CNUxwqlD.js → requirementDiagram-TGXJPOKE-DHdqbL4U.js} +1 -1
- package/ui/assets/{sankeyDiagram-HTMAVEWB-CA1uhP77.js → sankeyDiagram-HTMAVEWB-yMhFC9Kb.js} +1 -1
- package/ui/assets/{sequenceDiagram-DBY2YBRQ-0ym7r3H9.js → sequenceDiagram-DBY2YBRQ-CQ6j1HQT.js} +1 -1
- package/ui/assets/{sizeCapture-X5ZJPWSS-CBoDiE78.js → sizeCapture-X5ZJPWSS-BfP0H_N2.js} +1 -1
- package/ui/assets/{stateDiagram-2N3HPSRC-Yx6P-rtI.js → stateDiagram-2N3HPSRC-Dj8aJdUR.js} +1 -1
- package/ui/assets/stateDiagram-v2-6OUMAXLB-FIV3lZdJ.js +1 -0
- package/ui/assets/{swimlanes-5IMT3BWC-Dc_pcRGt.js → swimlanes-5IMT3BWC-CnuSR1EW.js} +2 -2
- package/ui/assets/swimlanesDiagram-G3AALYLV-CKaultOg.js +8 -0
- package/ui/assets/{timeline-definition-FHXFAJF6-DEwqgWk_.js → timeline-definition-FHXFAJF6-BOOodl9p.js} +1 -1
- package/ui/assets/{vennDiagram-L72KCM5P-BG4pg9Ry.js → vennDiagram-L72KCM5P-CfVXupe7.js} +1 -1
- package/ui/assets/{wardleyDiagram-EHGQE667-8QlaGdtE.js → wardleyDiagram-EHGQE667-qfn-3sfg.js} +1 -1
- package/ui/assets/{xychartDiagram-FW5EYKEG-a-EylgLj.js → xychartDiagram-FW5EYKEG-Cxn8Bud1.js} +1 -1
- package/ui/index.html +2 -2
- package/ui/assets/channel-CJR5QT2X.js +0 -1
- package/ui/assets/classDiagram-OUVF2IWQ-GRZ-aS8k.js +0 -1
- package/ui/assets/classDiagram-v2-EOCWNBFH-GRZ-aS8k.js +0 -1
- package/ui/assets/stateDiagram-v2-6OUMAXLB-C2H43Org.js +0 -1
- package/ui/assets/swimlanesDiagram-G3AALYLV-BoHED9v0.js +0 -8
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import{_ as wh,a5 as rs,a4 as Sh,at as _4,ai as Yr,a9 as ur,au as xh,a7 as kh,al as Oe,$ as E4,af as _h,O as we,a3 as Rr,aD as pn,a2 as Eh,av as g,ap as Ah,aq as A4,ak as T4,Z as Re,ag as O,U as Se,aF as $,an as Ve,aa as At,P as I4,aj as Vt,p as R4,a8 as It,Y as T,q as C4,o as O4,r as N4,S as M4,az as Wn,N as z4,ab as Cn,a0 as Qn,ah as Qa,M as $4,ay as hr,L as D4,a1 as Wi,c as P4,b as B4,C as L4,a as F4,d as U4,e as q4,m as H4,l as V4,H as j4,n as G4,W as j,F as lt,am as Ht,R as x,ao as js,as as Z,V as pe,aI as en,j as Z4,h as K4,f as W4,D as Q4,i as J4,g as Y4,k as X4,J as ev,T as tv,I as nv,K as rv,aB as Th,aG as No,aC as Mo,y as sv,s as iv,G as av,x as ov,u as lv,v as cv,w as uv,z as dv,A as fv,t as hv,B as pv,E as mv,X as fe,ad as zo,ae as nc,ax as gv,aH as Qs,aE as Pn,aw as vv,ac as Ja,a6 as _i,aA as bv,ar as yv,Q as wv}from"./ui-vendor-CYGfnfwU.js";import{D as Sv,L as xv,o as kv}from"./xterm-C0x2rdqx.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();let Ih;const $o=e=>Ih=e,Rh=Symbol();function rc(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}var Bi;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(Bi||(Bi={}));function _v(){const e=wh(!0),t=e.run(()=>Oe({}));let n=[],r=[];const s=kh({install(i){$o(s),s._a=i,i.provide(Rh,s),i.config.globalProperties.$pinia=s,r.forEach(a=>n.push(a)),r=[]},use(i){return this._a?n.push(i):r.push(i),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return s}const Ch=()=>{};function Pu(e,t,n,r=Ch){e.add(t);const s=()=>{e.delete(t)&&r()};return!n&&E4()&&_h(s),s}function qs(e,...t){e.forEach(n=>{n(...t)})}const Ev=e=>e(),Bu=Symbol(),vl=Symbol();function sc(e,t){e instanceof Map&&t instanceof Map?t.forEach((n,r)=>e.set(r,n)):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const n in t){if(!t.hasOwnProperty(n))continue;const r=t[n],s=e[n];rc(s)&&rc(r)&&e.hasOwnProperty(n)&&!rs(r)&&!Sh(r)?e[n]=sc(s,r):e[n]=r}return e}const Av=Symbol();function Tv(e){return!rc(e)||!Object.prototype.hasOwnProperty.call(e,Av)}const{assign:Zr}=Object;function Iv(e){return!!(rs(e)&&e.effect)}function Rv(e,t,n,r){const{state:s,actions:i,getters:a}=t,o=n.state.value[e];let l;function c(){o||(n.state.value[e]=s?s():{});const u=xh(n.state.value[e]);return Zr(u,i,Object.keys(a||{}).reduce((f,m)=>(f[m]=kh(we(()=>{$o(n);const h=n._s.get(e);return a[m].call(h,h)})),f),{}))}return l=Oh(e,c,t,n,r,!0),l}function Oh(e,t,n={},r,s,i){let a;const o=Zr({actions:{}},n),l={deep:!0};let c,u,f=new Set,m=new Set,h;const y=r.state.value[e];!i&&!y&&(r.state.value[e]={});let b;function S(N){let G;c=u=!1,typeof N=="function"?(N(r.state.value[e]),G={type:Bi.patchFunction,storeId:e,events:h}):(sc(r.state.value[e],N),G={type:Bi.patchObject,payload:N,storeId:e,events:h});const D=b=Symbol();ur().then(()=>{b===D&&(c=!0)}),u=!0,qs(f,G,r.state.value[e])}const k=i?function(){const{state:G}=n,D=G?G():{};this.$patch(W=>{Zr(W,D)})}:Ch;function P(){a.stop(),f.clear(),m.clear(),r._s.delete(e)}const z=(N,G="")=>{if(Bu in N)return N[vl]=G,N;const D=function(){$o(r);const W=Array.from(arguments),q=new Set,X=new Set;function ne(se){q.add(se)}function he(se){X.add(se)}qs(m,{args:W,name:D[vl],store:E,after:ne,onError:he});let Ae;try{Ae=N.apply(this&&this.$id===e?this:E,W)}catch(se){throw qs(X,se),se}return Ae instanceof Promise?Ae.then(se=>(qs(q,se),se)).catch(se=>(qs(X,se),Promise.reject(se))):(qs(q,Ae),Ae)};return D[Bu]=!0,D[vl]=G,D},I={_p:r,$id:e,$onAction:Pu.bind(null,m),$patch:S,$reset:k,$subscribe(N,G={}){const D=Pu(f,N,G.detached,()=>W()),W=a.run(()=>pn(()=>r.state.value[e],q=>{(G.flush==="sync"?u:c)&&N({storeId:e,type:Bi.direct,events:h},q)},Zr({},l,G)));return D},$dispose:P},E=Yr(I);r._s.set(e,E);const L=(r._a&&r._a.runWithContext||Ev)(()=>r._e.run(()=>(a=wh()).run(()=>t({action:z}))));for(const N in L){const G=L[N];if(rs(G)&&!Iv(G)||Sh(G))i||(y&&Tv(G)&&(rs(G)?G.value=y[N]:sc(G,y[N])),r.state.value[e][N]=G);else if(typeof G=="function"){const D=z(G,N);L[N]=D,o.actions[N]=G}}return Zr(E,L),Zr(_4(E),L),Object.defineProperty(E,"$state",{get:()=>r.state.value[e],set:N=>{S(G=>{Zr(G,N)})}}),r._p.forEach(N=>{Zr(E,a.run(()=>N({store:E,app:r._a,pinia:r,options:o})))}),y&&i&&n.hydrate&&n.hydrate(E.$state,y),c=!0,u=!0,E}function l0(e,t,n){let r;const s=typeof t=="function";r=s?n:t;function i(a,o){const l=Eh();return a=a||(l?Rr(Rh,null):null),a&&$o(a),a=Ih,a._s.has(e)||(s?Oh(e,t,r,a):Rv(e,r,a)),a._s.get(e)}return i.$id=e,i}var ua=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Cv=class extends ua{#n;#t;#r;constructor(){super(),this.#r=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#n!==e&&(this.#n=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#n=="boolean"?this.#n:globalThis.document?.visibilityState!=="hidden"}},c0=new Cv,Ov={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Nv=class{#n=Ov;#t=!1;setTimeoutProvider(e){this.#n=e}setTimeout(e,t){return this.#n.setTimeout(e,t)}clearTimeout(e){this.#n.clearTimeout(e)}setInterval(e,t){return this.#n.setInterval(e,t)}clearInterval(e){this.#n.clearInterval(e)}},_s=new Nv;function Mv(e){setTimeout(e,0)}var zv=typeof window>"u"||"Deno"in globalThis;function Dn(){}function $v(e,t){return typeof e=="function"?e(t):e}function ic(e){return typeof e=="number"&&e>=0&&e!==1/0}function Nh(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Xr(e,t){return typeof e=="function"?e(t):e}function En(e,t){return typeof e=="function"?e(t):e}function Lu(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:a,stale:o}=e;if(a){if(r){if(t.queryHash!==u0(a,t.options))return!1}else if(!Ji(t.queryKey,a))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof o=="boolean"&&t.isStale()!==o||s&&s!==t.state.fetchStatus||i&&!i(t))}function Fu(e,t){const{exact:n,status:r,predicate:s,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(Qi(t.options.mutationKey)!==Qi(i))return!1}else if(!Ji(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function u0(e,t){return(t?.queryKeyHashFn||Qi)(e)}function Qi(e){return JSON.stringify(e,(t,n)=>oc(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Ji(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Ji(e[n],t[n])):!1}var Dv=Object.prototype.hasOwnProperty;function Mh(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=Uu(e)&&Uu(t);if(!r&&!(oc(e)&&oc(t)))return t;const i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,l=r?new Array(o):{};let c=0;for(let u=0;u<o;u++){const f=r?u:a[u],m=e[f],h=t[f];if(m===h){l[f]=m,(r?u<i:Dv.call(e,f))&&c++;continue}if(m===null||h===null||typeof m!="object"||typeof h!="object"){l[f]=h;continue}const y=Mh(m,h,n+1);l[f]=y,y===m&&c++}return i===o&&c===i?e:l}function ac(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Uu(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function oc(e){if(!qu(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!qu(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function qu(e){return Object.prototype.toString.call(e)==="[object Object]"}function Pv(e){return new Promise(t=>{_s.setTimeout(t,e)})}function lc(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Mh(e,t):t}function Bv(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Lv(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var d0=Symbol();function zh(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===d0?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Hu(e,t){return typeof e=="function"?e(...t):!!e}function Fv(e,t,n){let r=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??=t(),r||(r=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),e}var Yi=(()=>{let e=()=>zv;return{isServer(){return e()},setIsServer(t){e=t}}})();function cc(){let e,t;const n=new Promise((s,i)=>{e=s,t=i});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),e(s)},n.reject=s=>{r({status:"rejected",reason:s}),t(s)},n}var Uv=Mv;function qv(){let e=[],t=0,n=o=>{o()},r=o=>{o()},s=Uv;const i=o=>{t?e.push(o):s(()=>{n(o)})},a=()=>{const o=e;e=[],o.length&&s(()=>{r(()=>{o.forEach(l=>{n(l)})})})};return{batch:o=>{let l;t++;try{l=o()}finally{t--,t||a()}return l},batchCalls:o=>(...l)=>{i(()=>{o(...l)})},schedule:i,setNotifyFunction:o=>{n=o},setBatchNotifyFunction:o=>{r=o},setScheduler:o=>{s=o}}}var an=qv(),Hv=class extends ua{#n=!0;#t;#r;constructor(){super(),this.#r=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#n!==e&&(this.#n=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#n}},so=new Hv;function Vv(e){return Math.min(1e3*2**e,3e4)}function $h(e){return(e??"online")==="online"?so.isOnline():!0}var uc=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Dh(e){let t=!1,n=0,r;const s=cc(),i=()=>s.status!=="pending",a=b=>{if(!i()){const S=new uc(b);m(S),e.onCancel?.(S)}},o=()=>{t=!0},l=()=>{t=!1},c=()=>c0.isFocused()&&(e.networkMode==="always"||so.isOnline())&&e.canRun(),u=()=>$h(e.networkMode)&&e.canRun(),f=b=>{i()||(r?.(),s.resolve(b))},m=b=>{i()||(r?.(),s.reject(b))},h=()=>new Promise(b=>{r=S=>{(i()||c())&&b(S)},e.onPause?.()}).then(()=>{r=void 0,i()||e.onContinue?.()}),y=()=>{if(i())return;let b;const S=n===0?e.initialPromise:void 0;try{b=S??e.fn()}catch(k){b=Promise.reject(k)}Promise.resolve(b).then(f).catch(k=>{if(i())return;const P=e.retry??(Yi.isServer()?0:3),z=e.retryDelay??Vv,I=typeof z=="function"?z(n,k):z,E=P===!0||typeof P=="number"&&n<P||typeof P=="function"&&P(n,k);if(t||!E){m(k);return}n++,e.onFail?.(n,k),Pv(I).then(()=>c()?void 0:h()).then(()=>{t?m(k):y()})})};return{promise:s,status:()=>s.status,cancel:a,continue:()=>(r?.(),s),cancelRetry:o,continueRetry:l,canStart:u,start:()=>(u()?y():h().then(y),s)}}var Ph=class{#n;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ic(this.gcTime)&&(this.#n=_s.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Yi.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#n!==void 0&&(_s.clearTimeout(this.#n),this.#n=void 0)}};function jv(e){return{onFetch:(t,n)=>{const r=t.options,s=t.fetchOptions?.meta?.fetchMore?.direction,i=t.state.data?.pages||[],a=t.state.data?.pageParams||[];let o={pages:[],pageParams:[]},l=0;const c=async()=>{let u=!1;const f=y=>{Fv(y,()=>t.signal,()=>u=!0)},m=zh(t.options,t.fetchOptions),h=async(y,b,S)=>{if(u)return Promise.reject(t.signal.reason);if(b==null&&y.pages.length)return Promise.resolve(y);const P=(()=>{const _={client:t.client,queryKey:t.queryKey,pageParam:b,direction:S?"backward":"forward",meta:t.options.meta};return f(_),_})(),z=await m(P),{maxPages:I}=t.options,E=S?Lv:Bv;return{pages:E(y.pages,z,I),pageParams:E(y.pageParams,b,I)}};if(s&&i.length){const y=s==="backward",b=y?Gv:Vu,S={pages:i,pageParams:a},k=b(r,S);o=await h(S,k,y)}else{const y=e??i.length;do{const b=l===0?a[0]??r.initialPageParam:Vu(r,o);if(l>0&&b==null)break;o=await h(o,b),l++}while(l<y)}return o};t.options.persister?t.fetchFn=()=>t.options.persister?.(c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=c}}}function Vu(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Gv(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Zv=class extends Ph{#n;#t;#r;#s;#e;#i;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#e=e.client,this.#s=this.#e.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=Gu(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#n}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#a,...e},e?._type&&(this.#n=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=Gu(this.options);t.data!==void 0&&(this.setState(ju(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#s.remove(this)}setData(e,t){const n=lc(this.state.data,e,this.options);return this.#l({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:"setState",state:e})}cancel(e){const t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(Dn).catch(Dn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>En(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===d0||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Xr(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!Nh(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#i&&(this.#o||this.#d()?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#s.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#d(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#l({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#i?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(e&&this.setOptions(e),!this.options.queryFn){const l=this.observers.find(c=>c.options.queryFn);l&&this.setOptions(l.options)}const n=new AbortController,r=l=>{Object.defineProperty(l,"signal",{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},s=()=>{const l=zh(this.options,t),u=(()=>{const f={client:this.#e,queryKey:this.queryKey,meta:this.meta};return r(f),f})();return this.#o=!1,this.options.persister?this.options.persister(l,u,this):l(u)},a=(()=>{const l={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#e,state:this.state,fetchFn:s};return r(l),l})();(this.#n==="infinite"?jv(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#r=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:"fetch",meta:a.fetchOptions?.meta}),this.#i=Dh({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:l=>{l instanceof uc&&l.revert&&this.setState({...this.#r,fetchStatus:"idle"}),n.abort()},onFail:(l,c)=>{this.#l({type:"failed",failureCount:l,error:c})},onPause:()=>{this.#l({type:"pause"})},onContinue:()=>{this.#l({type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{const l=await this.#i.start();if(l===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(l),this.#s.config.onSuccess?.(l,this),this.#s.config.onSettled?.(l,this.state.error,this),l}catch(l){if(l instanceof uc){if(l.silent)return this.#i.promise;if(l.revert){if(this.state.data===void 0)throw l;return this.state.data}}throw this.#l({type:"error",error:l}),this.#s.config.onError?.(l,this),this.#s.config.onSettled?.(this.state.data,l,this),l}finally{this.scheduleGc()}}#l(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Bh(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...ju(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#r=e.manual?r:void 0,r;case"error":const s=e.error;return{...n,error:s,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),an.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#s.notify({query:this,type:"updated",action:e})})}};function Bh(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:$h(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function ju(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Gu(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Kv=class extends ua{constructor(e,t){super(),this.options=t,this.#n=e,this.#o=null,this.#a=cc(),this.bindMethods(),this.setOptions(t)}#n;#t=void 0;#r=void 0;#s=void 0;#e;#i;#a;#o;#d;#l;#p;#f;#c;#h;#g=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Zu(this.#t,this.options)?this.#u():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return dc(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return dc(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#w(),this.#S(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,n=this.#t;if(this.options=this.#n.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof En(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#x(),this.#t.setOptions(this.options),t._defaulted&&!ac(this.options,t)&&this.#n.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&Ku(this.#t,n,this.options,t)&&this.#u(),this.updateResult(),r&&(this.#t!==n||En(this.options.enabled,this.#t)!==En(t.enabled,this.#t)||Xr(this.options.staleTime,this.#t)!==Xr(t.staleTime,this.#t))&&this.#m();const s=this.#v();r&&(this.#t!==n||En(this.options.enabled,this.#t)!==En(t.enabled,this.#t)||s!==this.#h)&&this.#b(s)}getOptimisticResult(e){const t=this.#n.getQueryCache().build(this.#n,e),n=this.createResult(t,e);return Qv(this,n)&&(this.#s=n,this.#i=this.options,this.#e=this.#t.state),n}getCurrentResult(){return this.#s}trackResult(e,t){return new Proxy(e,{get:(n,r)=>(this.trackProp(r),t?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#a.status==="pending"&&this.#a.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,r))})}trackProp(e){this.#g.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#n.defaultQueryOptions(e),n=this.#n.getQueryCache().build(this.#n,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#u({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#s))}#u(e){this.#x();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Dn)),t}#m(){this.#w();const e=Xr(this.options.staleTime,this.#t);if(Yi.isServer()||this.#s.isStale||!ic(e))return;const n=Nh(this.#s.dataUpdatedAt,e)+1;this.#f=_s.setTimeout(()=>{this.#s.isStale||this.updateResult()},n)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#b(e){this.#S(),this.#h=e,!(Yi.isServer()||En(this.options.enabled,this.#t)===!1||!ic(this.#h)||this.#h===0)&&(this.#c=_s.setInterval(()=>{(this.options.refetchIntervalInBackground||c0.isFocused())&&this.#u()},this.#h))}#y(){this.#m(),this.#b(this.#v())}#w(){this.#f!==void 0&&(_s.clearTimeout(this.#f),this.#f=void 0)}#S(){this.#c!==void 0&&(_s.clearInterval(this.#c),this.#c=void 0)}createResult(e,t){const n=this.#t,r=this.options,s=this.#s,i=this.#e,a=this.#i,l=e!==n?e.state:this.#r,{state:c}=e;let u={...c},f=!1,m;if(t._optimisticResults){const N=this.hasListeners(),G=!N&&Zu(e,t),D=N&&Ku(e,n,t,r);(G||D)&&(u={...u,...Bh(c.data,e.options)}),t._optimisticResults==="isRestoring"&&(u.fetchStatus="idle")}let{error:h,errorUpdatedAt:y,status:b}=u;m=u.data;let S=!1;if(t.placeholderData!==void 0&&m===void 0&&b==="pending"){let N;s?.isPlaceholderData&&t.placeholderData===a?.placeholderData?(N=s.data,S=!0):N=typeof t.placeholderData=="function"?t.placeholderData(this.#p?.state.data,this.#p):t.placeholderData,N!==void 0&&(b="success",m=lc(s?.data,N,t),f=!0)}if(t.select&&m!==void 0&&!S)if(s&&m===i?.data&&t.select===this.#d)m=this.#l;else try{this.#d=t.select,m=t.select(m),m=lc(s?.data,m,t),this.#l=m,this.#o=null}catch(N){this.#o=N}this.#o&&(h=this.#o,m=this.#l,y=Date.now(),b="error");const k=u.fetchStatus==="fetching",P=b==="pending",z=b==="error",I=P&&k,E=m!==void 0,L={status:b,fetchStatus:u.fetchStatus,isPending:P,isSuccess:b==="success",isError:z,isInitialLoading:I,isLoading:I,data:m,dataUpdatedAt:u.dataUpdatedAt,error:h,errorUpdatedAt:y,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:u.dataUpdateCount>l.dataUpdateCount||u.errorUpdateCount>l.errorUpdateCount,isFetching:k,isRefetching:k&&!P,isLoadingError:z&&!E,isPaused:u.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:z&&E,isStale:f0(e,t),refetch:this.refetch,promise:this.#a,isEnabled:En(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const N=L.data!==void 0,G=L.status==="error"&&!N,D=X=>{G?X.reject(L.error):N&&X.resolve(L.data)},W=()=>{const X=this.#a=L.promise=cc();D(X)},q=this.#a;switch(q.status){case"pending":e.queryHash===n.queryHash&&D(q);break;case"fulfilled":(G||L.data!==q.value)&&W();break;case"rejected":(!G||L.error!==q.reason)&&W();break}}return L}updateResult(){const e=this.#s,t=this.createResult(this.#t,this.options);if(this.#e=this.#t.state,this.#i=this.options,this.#e.data!==void 0&&(this.#p=this.#t),ac(t,e))return;this.#s=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,s=typeof r=="function"?r():r;if(s==="all"||!s&&!this.#g.size)return!0;const i=new Set(s??this.#g);return this.options.throwOnError&&i.add("error"),Object.keys(this.#s).some(a=>{const o=a;return this.#s[o]!==e[o]&&i.has(o)})};this.#k({listeners:n()})}#x(){const e=this.#n.getQueryCache().build(this.#n,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#r=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#k(e){an.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#s)}),this.#n.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function Wv(e,t){return En(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&En(t.retryOnMount,e)===!1)}function Zu(e,t){return Wv(e,t)||e.state.data!==void 0&&dc(e,t,t.refetchOnMount)}function dc(e,t,n){if(En(t.enabled,e)!==!1&&Xr(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&f0(e,t)}return!1}function Ku(e,t,n,r){return(e!==t||En(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&f0(e,n)}function f0(e,t){return En(t.enabled,e)!==!1&&e.isStaleByTime(Xr(t.staleTime,e))}function Qv(e,t){return!ac(e.getCurrentResult(),t)}var Jv=class extends Ph{#n;#t;#r;#s;constructor(e){super(),this.#n=e.client,this.mutationId=e.mutationId,this.#r=e.mutationCache,this.#t=[],this.state=e.state||Yv(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#r.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#r.remove(this))}continue(){return this.#s?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#e({type:"continue"})},n={client:this.#n,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#s=Dh({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(i,a)=>{this.#e({type:"failed",failureCount:i,error:a})},onPause:()=>{this.#e({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#r.canRun(this)});const r=this.state.status==="pending",s=!this.#s.canStart();try{if(r)t();else{this.#e({type:"pending",variables:e,isPaused:s}),this.#r.config.onMutate&&await this.#r.config.onMutate(e,this,n);const a=await this.options.onMutate?.(e,n);a!==this.state.context&&this.#e({type:"pending",context:a,variables:e,isPaused:s})}const i=await this.#s.start();return await this.#r.config.onSuccess?.(i,e,this.state.context,this,n),await this.options.onSuccess?.(i,e,this.state.context,n),await this.#r.config.onSettled?.(i,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(i,null,e,this.state.context,n),this.#e({type:"success",data:i}),i}catch(i){try{await this.#r.config.onError?.(i,e,this.state.context,this,n)}catch(a){Promise.reject(a)}try{await this.options.onError?.(i,e,this.state.context,n)}catch(a){Promise.reject(a)}try{await this.#r.config.onSettled?.(void 0,i,this.state.variables,this.state.context,this,n)}catch(a){Promise.reject(a)}try{await this.options.onSettled?.(void 0,i,e,this.state.context,n)}catch(a){Promise.reject(a)}throw this.#e({type:"error",error:i}),i}finally{this.#r.runNext(this)}}#e(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),an.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#r.notify({mutation:this,type:"updated",action:e})})}};function Yv(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Lh=class extends ua{constructor(t={}){super(),this.config=t,this.#n=new Set,this.#t=new Map,this.#r=0}#n;#t;#r;build(t,n,r){const s=new Jv({client:t,mutationCache:this,mutationId:++this.#r,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){this.#n.add(t);const n=xa(t);if(typeof n=="string"){const r=this.#t.get(n);r?r.push(t):this.#t.set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#n.delete(t)){const n=xa(t);if(typeof n=="string"){const r=this.#t.get(n);if(r)if(r.length>1){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}else r[0]===t&&this.#t.delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=xa(t);if(typeof n=="string"){const s=this.#t.get(n)?.find(i=>i.state.status==="pending");return!s||s===t}else return!0}runNext(t){const n=xa(t);return typeof n=="string"?this.#t.get(n)?.find(s=>s!==t&&s.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){an.batch(()=>{this.#n.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#n.clear(),this.#t.clear()})}getAll(){return Array.from(this.#n)}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Fu(n,r))}findAll(t={}){return this.getAll().filter(n=>Fu(t,n))}notify(t){an.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return an.batch(()=>Promise.all(t.map(n=>n.continue().catch(Dn))))}};function xa(e){return e.options.scope?.id}var Fh=class extends ua{constructor(t={}){super(),this.config=t,this.#n=new Map}#n;build(t,n,r){const s=n.queryKey,i=n.queryHash??u0(s,n);let a=this.get(i);return a||(a=new Zv({client:t,queryKey:s,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(a)),a}add(t){this.#n.has(t.queryHash)||(this.#n.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=this.#n.get(t.queryHash);n&&(t.destroy(),n===t&&this.#n.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){an.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#n.get(t)}getAll(){return[...this.#n.values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Lu(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Lu(t,r)):n}notify(t){an.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){an.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){an.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Xv=class{#n;#t;#r;#s;#e;#i;#a;#o;constructor(t={}){this.#n=t.queryCache||new Fh,this.#t=t.mutationCache||new Lh,this.#r=t.defaultOptions||{},this.#s=new Map,this.#e=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#a=c0.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#n.onFocus())}),this.#o=so.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#n.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#a?.(),this.#a=void 0,this.#o?.(),this.#o=void 0)}isFetching(t){return this.#n.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#t.findAll({...t,status:"pending"}).length}getQueryData(t){const n=this.defaultQueryOptions({queryKey:t});return this.#n.get(n.queryHash)?.state.data}ensureQueryData(t){const n=this.defaultQueryOptions(t),r=this.#n.build(this,n),s=r.state.data;return s===void 0?this.fetchQuery(t):(t.revalidateIfStale&&r.isStaleByTime(Xr(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(s))}getQueriesData(t){return this.#n.findAll(t).map(({queryKey:n,state:r})=>{const s=r.data;return[n,s]})}setQueryData(t,n,r){const s=this.defaultQueryOptions({queryKey:t}),a=this.#n.get(s.queryHash)?.state.data,o=$v(n,a);if(o!==void 0)return this.#n.build(this,s).setData(o,{...r,manual:!0})}setQueriesData(t,n,r){return an.batch(()=>this.#n.findAll(t).map(({queryKey:s})=>[s,this.setQueryData(s,n,r)]))}getQueryState(t){const n=this.defaultQueryOptions({queryKey:t});return this.#n.get(n.queryHash)?.state}removeQueries(t){const n=this.#n;an.batch(()=>{n.findAll(t).forEach(r=>{n.remove(r)})})}resetQueries(t,n){const r=this.#n;return an.batch(()=>(r.findAll(t).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...t},n)))}cancelQueries(t,n={}){const r={revert:!0,...n},s=an.batch(()=>this.#n.findAll(t).map(i=>i.cancel(r)));return Promise.all(s).then(Dn).catch(Dn)}invalidateQueries(t,n={}){return an.batch(()=>(this.#n.findAll(t).forEach(r=>{r.invalidate()}),t?.refetchType==="none"?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},n)))}refetchQueries(t,n={}){const r={...n,cancelRefetch:n.cancelRefetch??!0},s=an.batch(()=>this.#n.findAll(t).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let a=i.fetch(void 0,r);return r.throwOnError||(a=a.catch(Dn)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(s).then(Dn)}fetchQuery(t){const n=this.defaultQueryOptions(t);n.retry===void 0&&(n.retry=!1);const r=this.#n.build(this,n);return r.isStaleByTime(Xr(n.staleTime,r))?r.fetch(n):Promise.resolve(r.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Dn).catch(Dn)}fetchInfiniteQuery(t){return t._type="infinite",this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Dn).catch(Dn)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return so.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#n}getMutationCache(){return this.#t}getDefaultOptions(){return this.#r}setDefaultOptions(t){this.#r=t}setQueryDefaults(t,n){this.#s.set(Qi(t),{queryKey:t,defaultOptions:n})}getQueryDefaults(t){const n=[...this.#s.values()],r={};return n.forEach(s=>{Ji(t,s.queryKey)&&Object.assign(r,s.defaultOptions)}),r}setMutationDefaults(t,n){this.#e.set(Qi(t),{mutationKey:t,defaultOptions:n})}getMutationDefaults(t){const n=[...this.#e.values()],r={};return n.forEach(s=>{Ji(t,s.mutationKey)&&Object.assign(r,s.defaultOptions)}),r}defaultQueryOptions(t){if(t._defaulted)return t;const n={...this.#r.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return n.queryHash||(n.queryHash=u0(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===d0&&(n.enabled=!1),n}defaultMutationOptions(t){return t?._defaulted?t:{...this.#r.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#n.clear(),this.#t.clear()}},e2="VUE_QUERY_CLIENT";function Uh(e){const t=e?`:${e}`:"";return`${e2}${t}`}function Wu(e,t){Object.keys(e).forEach(n=>{e[n]=t[n]})}function fc(e,t,n="",r=0){if(t){const s=t(e,n,r);if(s===void 0&&rs(e)||s!==void 0)return s}if(Array.isArray(e))return e.map((s,i)=>fc(s,t,String(i),r+1));if(typeof e=="object"&&n2(e)){const s=Object.entries(e).map(([i,a])=>[i,fc(a,t,i,r+1)]);return Object.fromEntries(s)}return e}function t2(e,t){return fc(e,t)}function tt(e,t=!1){return t2(e,(n,r,s)=>{if(s===1&&r==="queryKey")return tt(n,!0);if(t&&r2(n))return tt(n(),t);if(rs(n))return tt(g(n),t)})}function n2(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function r2(e){return typeof e=="function"}function ds(e=""){if(!Eh())throw new Error("vue-query hooks can only be used inside setup() function or functions that support injection context.");const t=Uh(e),n=Rr(t);if(!n)throw new Error("No 'queryClient' found in Vue context, use 'VueQueryPlugin' to properly initialize the library.");return n}var s2=class extends Fh{find(e){return super.find(tt(e))}findAll(e={}){return super.findAll(tt(e))}},i2=class extends Lh{find(e){return super.find(tt(e))}findAll(e={}){return super.findAll(tt(e))}},a2=class extends Xv{constructor(e={}){const t={defaultOptions:e.defaultOptions,queryCache:e.queryCache||new s2,mutationCache:e.mutationCache||new i2};super(t),this.isRestoring=Oe(!1)}isFetching(e={}){return super.isFetching(tt(e))}isMutating(e={}){return super.isMutating(tt(e))}getQueryData(e){return super.getQueryData(tt(e))}ensureQueryData(e){return super.ensureQueryData(tt(e))}getQueriesData(e){return super.getQueriesData(tt(e))}setQueryData(e,t,n={}){return super.setQueryData(tt(e),t,tt(n))}setQueriesData(e,t,n={}){return super.setQueriesData(tt(e),t,tt(n))}getQueryState(e){return super.getQueryState(tt(e))}removeQueries(e={}){return super.removeQueries(tt(e))}resetQueries(e={},t={}){return super.resetQueries(tt(e),tt(t))}cancelQueries(e={},t={}){return super.cancelQueries(tt(e),tt(t))}invalidateQueries(e={},t={}){const n=tt(e),r=tt(t);if(super.invalidateQueries({...n,refetchType:"none"},r),n.refetchType==="none")return Promise.resolve();const s={...n,type:n.refetchType??n.type??"active"};return ur().then(()=>super.refetchQueries(s,r))}refetchQueries(e={},t={}){return super.refetchQueries(tt(e),tt(t))}fetchQuery(e){return super.fetchQuery(tt(e))}prefetchQuery(e){return super.prefetchQuery(tt(e))}fetchInfiniteQuery(e){return super.fetchInfiniteQuery(tt(e))}prefetchInfiniteQuery(e){return super.prefetchInfiniteQuery(tt(e))}setDefaultOptions(e){super.setDefaultOptions(tt(e))}setQueryDefaults(e,t){super.setQueryDefaults(tt(e),tt(t))}getQueryDefaults(e){return super.getQueryDefaults(tt(e))}setMutationDefaults(e,t){super.setMutationDefaults(tt(e),tt(t))}getMutationDefaults(e){return super.getMutationDefaults(tt(e))}},o2={install:(e,t={})=>{const n=Uh(t.queryClientKey);let r;if("queryClient"in t&&t.queryClient)r=t.queryClient;else{const a="queryClientConfig"in t?t.queryClientConfig:void 0;r=new a2(a)}Yi.isServer()||r.mount();let s=()=>{};if(t.clientPersister){r.isRestoring&&(r.isRestoring.value=!0);const[a,o]=t.clientPersister(r);s=a,o.then(()=>{r.isRestoring&&(r.isRestoring.value=!1),t.clientPersisterOnSuccess?.(r)})}const i=()=>{r.unmount(),s()};if(e.onUnmount)e.onUnmount(i);else{const a=e.unmount;e.unmount=function(){i(),a()}}e.provide(n,r)}};function l2(e,t,n){const r=ds(),s=we(()=>{let h=t;typeof h=="function"&&(h=h());const y=tt(h);typeof y.enabled=="function"&&(y.enabled=y.enabled());const b=r.defaultQueryOptions(y);return b._optimisticResults=r.isRestoring?.value?"isRestoring":"optimistic",b}),i=new e(r,s.value),a=s.value.shallow?Ah(i.getCurrentResult()):Yr(i.getCurrentResult());let o=()=>{};r.isRestoring&&pn(r.isRestoring,h=>{h||(o(),o=i.subscribe(y=>{Wu(a,y)}))},{immediate:!0});const l=()=>{i.setOptions(s.value),Wu(a,i.getCurrentResult())};pn(s,l),_h(()=>{o()});const c=(...h)=>(l(),a.refetch(...h)),u=()=>new Promise((h,y)=>{let b=()=>{};const S=()=>{if(s.value.enabled!==!1){i.setOptions(s.value);const k=i.getOptimisticResult(s.value);k.isStale?(b(),i.fetchOptimistic(s.value).then(h,P=>{Hu(s.value.throwOnError,[P,i.getCurrentQuery()])?y(P):h(i.getCurrentResult())})):(b(),h(k))}};S(),b=pn(s,S)});pn(()=>a.error,h=>{if(a.isError&&!a.isFetching&&Hu(s.value.throwOnError,[h,i.getCurrentQuery()]))throw h});const f=s.value.shallow?A4(a):T4(a),m=xh(f);for(const h in a)typeof a[h]=="function"&&(m[h]=a[h]);return m.suspense=u,m.refetch=c,m}function pr(e,t){return l2(Kv,e)}function qh(){return typeof window>"u"?"":(window.__TASK_HANDOFF_PUBLIC_BASE__||"").replace(/\/$/,"")}function jn(e){if(!e||/^[a-z][a-z\d+.-]*:/i.test(e))return e;const t=e.startsWith("/")?e:`/${e}`;return`${qh()}${t}`}function io(e){return jn(e).replace(/^\//,"")}function c2(){return jn("/api")}function Hh(e,t=""){const n=window.location.protocol==="https:"?"wss:":"ws:",r=new URL(jn(e),window.location.origin);return r.protocol=n,t&&r.searchParams.set("token",t),r.toString()}class hc extends Error{response;request;options;constructor(t,n,r){const s=t.status||t.status===0?t.status:"",i=t.statusText??"",a=`${s} ${i}`.trim(),o=a?`status code ${a}`:"an unknown error";super(`Request failed with ${o}: ${n.method} ${n.url}`),this.name="HTTPError",this.response=t,this.request=n,this.options=r}}class Vh extends Error{name="NonError";value;constructor(t){let n="Non-error value was thrown";try{typeof t=="string"?n=t:t&&typeof t=="object"&&"message"in t&&typeof t.message=="string"&&(n=t.message)}catch{}super(n),this.value=t}}class bl extends Error{name="ForceRetryError";customDelay;code;customRequest;constructor(t){const n=t?.cause?t.cause instanceof Error?t.cause:new Vh(t.cause):void 0;super(t?.code?`Forced retry: ${t.code}`:"Forced retry",n?{cause:n}:void 0),this.customDelay=t?.delay,this.code=t?.code,this.customRequest=t?.request}}const Qu=(()=>{let e=!1,t=!1;const n=typeof globalThis.ReadableStream=="function",r=typeof globalThis.Request=="function";if(n&&r)try{t=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type")}catch(s){if(s instanceof Error&&s.message==="unsupported BodyInit type")return!1;throw s}return e&&!t})(),u2=typeof globalThis.AbortController=="function",jh=typeof globalThis.AbortSignal=="function"&&typeof globalThis.AbortSignal.any=="function",d2=typeof globalThis.ReadableStream=="function",f2=typeof globalThis.FormData=="function",Gh=["get","post","put","patch","head","delete"],h2={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},yl=2147483647,p2=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,Zh=Symbol("stop");class Kh{options;constructor(t){this.options=t}}const m2=e=>new Kh(e),g2={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},v2={next:!0},b2={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0},y2=e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(const[n,r]of e)t+=p2,t+=new TextEncoder().encode(`Content-Disposition: form-data; name="${n}"`).length,t+=typeof r=="string"?new TextEncoder().encode(r).length:r.size;return t}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength;if(typeof e=="string")return new TextEncoder().encode(e).length;if(e instanceof URLSearchParams)return new TextEncoder().encode(e.toString()).length;if("byteLength"in e)return e.byteLength;if(typeof e=="object"&&e!==null)try{const t=JSON.stringify(e);return new TextEncoder().encode(t).length}catch{return 0}return 0},Wh=(e,t,n)=>{let r,s=0;return e.pipeThrough(new TransformStream({transform(i,a){if(a.enqueue(i),r){s+=r.byteLength;let o=t===0?0:s/t;o>=1&&(o=1-Number.EPSILON),n?.({percent:o,totalBytes:Math.max(t,s),transferredBytes:s},r)}r=i},flush(){r&&(s+=r.byteLength,n?.({percent:1,totalBytes:Math.max(t,s),transferredBytes:s},r))}}))},w2=(e,t)=>{if(!e.body)return e;if(e.status===204)return new Response(null,{status:e.status,statusText:e.statusText,headers:e.headers});const n=Math.max(0,Number(e.headers.get("content-length"))||0);return new Response(Wh(e.body,n,t),{status:e.status,statusText:e.statusText,headers:e.headers})},S2=(e,t,n)=>{if(!e.body)return e;const r=y2(n??e.body);return new Request(e,{duplex:"half",body:Wh(e.body,r,t)})},xs=e=>e!==null&&typeof e=="object",ka=(...e)=>{for(const t of e)if((!xs(t)||Array.isArray(t))&&t!==void 0)throw new TypeError("The `options` argument must be an object");return h0({},...e)},Qh=(e={},t={})=>{const n=new globalThis.Headers(e),r=t instanceof globalThis.Headers,s=new globalThis.Headers(t);for(const[i,a]of s.entries())r&&a==="undefined"||a===void 0?n.delete(i):n.set(i,a);return n};function _a(e,t,n){return Object.hasOwn(t,n)&&t[n]===void 0?[]:h0(e[n]??[],t[n]??[])}const Jh=(e={},t={})=>({beforeRequest:_a(e,t,"beforeRequest"),beforeRetry:_a(e,t,"beforeRetry"),afterResponse:_a(e,t,"afterResponse"),beforeError:_a(e,t,"beforeError")}),x2=(e,t)=>{const n=new URLSearchParams;for(const r of[e,t])if(r!==void 0)if(r instanceof URLSearchParams)for(const[s,i]of r.entries())n.append(s,i);else if(Array.isArray(r))for(const s of r){if(!Array.isArray(s)||s.length!==2)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");n.append(String(s[0]),String(s[1]))}else if(xs(r))for(const[s,i]of Object.entries(r))i!==void 0&&n.append(s,String(i));else{const s=new URLSearchParams(r);for(const[i,a]of s.entries())n.append(i,a)}return n},h0=(...e)=>{let t={},n={},r={},s;const i=[];for(const a of e)if(Array.isArray(a))Array.isArray(t)||(t=[]),t=[...t,...a];else if(xs(a)){for(let[o,l]of Object.entries(a)){if(o==="signal"&&l instanceof globalThis.AbortSignal){i.push(l);continue}if(o==="context"){if(l!=null&&(!xs(l)||Array.isArray(l)))throw new TypeError("The `context` option must be an object");t={...t,context:l==null?{}:{...t.context,...l}};continue}if(o==="searchParams"){l==null?s=void 0:s=s===void 0?l:x2(s,l);continue}xs(l)&&o in t&&(l=h0(t[o],l)),t={...t,[o]:l}}xs(a.hooks)&&(r=Jh(r,a.hooks),t.hooks=r),xs(a.headers)&&(n=Qh(n,a.headers),t.headers=n)}return s!==void 0&&(t.searchParams=s),i.length>0&&(i.length===1?t.signal=i[0]:jh?t.signal=AbortSignal.any(i):t.signal=i.at(-1)),t},k2=e=>Gh.includes(e)?e.toUpperCase():e,_2=["get","put","head","delete","options","trace"],E2=[408,413,429,500,502,503,504],A2=[413,429,503],Ju={limit:2,methods:_2,statusCodes:E2,afterStatusCodes:A2,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3,jitter:void 0,retryOnTimeout:!1},T2=(e={})=>{if(typeof e=="number")return{...Ju,limit:e};if(e.methods&&!Array.isArray(e.methods))throw new Error("retry.methods must be an array");if(e.methods&&=e.methods.map(n=>n.toLowerCase()),e.statusCodes&&!Array.isArray(e.statusCodes))throw new Error("retry.statusCodes must be an array");const t=Object.fromEntries(Object.entries(e).filter(([,n])=>n!==void 0));return{...Ju,...t}};class pc extends Error{request;constructor(t){super(`Request timed out: ${t.method} ${t.url}`),this.name="TimeoutError",this.request=t}}async function I2(e,t,n,r){return new Promise((s,i)=>{const a=setTimeout(()=>{n&&n.abort(),i(new pc(e))},r.timeout);r.fetch(e,t).then(s).catch(i).then(()=>{clearTimeout(a)})})}async function R2(e,{signal:t}){return new Promise((n,r)=>{t&&(t.throwIfAborted(),t.addEventListener("abort",s,{once:!0}));function s(){clearTimeout(i),r(t.reason)}const i=setTimeout(()=>{t?.removeEventListener("abort",s),n()},e)})}const C2=(e,t)=>{const n={};for(const r in t)Object.hasOwn(t,r)&&!(r in b2)&&!(r in g2)&&(!(r in e)||r in v2)&&(n[r]=t[r]);return n},O2=e=>e===void 0?!1:Array.isArray(e)?e.length>0:e instanceof URLSearchParams?e.size>0:typeof e=="object"?Object.keys(e).length>0:typeof e=="string"?e.trim().length>0:!!e;function N2(e){return e instanceof hc||e?.name===hc.name}function M2(e){return e instanceof pc||e?.name===pc.name}class Xi{static create(t,n){const r=new Xi(t,n),s=async()=>{if(typeof r.#e.timeout=="number"&&r.#e.timeout>yl)throw new RangeError(`The \`timeout\` option cannot be greater than ${yl}`);await Promise.resolve();let a=await r.#g();for(const o of r.#e.hooks.afterResponse){const l=r.#p(a.clone());let c;try{c=await o(r.request,r.#u(),l,{retryCount:r.#r})}catch(f){throw r.#c(l),r.#c(a),f}if(c instanceof Kh)throw r.#c(l),r.#c(a),new bl(c.options);const u=c instanceof globalThis.Response?c:a;l!==u&&r.#c(l),a!==u&&r.#c(a),a=u}if(r.#p(a),!a.ok&&(typeof r.#e.throwHttpErrors=="function"?r.#e.throwHttpErrors(a.status):r.#e.throwHttpErrors)){let o=new hc(a,r.request,r.#u());for(const l of r.#e.hooks.beforeError)o=await l(o,{retryCount:r.#r});throw o}if(r.#e.onDownloadProgress){if(typeof r.#e.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!d2)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");const o=a.clone();return r.#c(a),w2(o,r.#e.onDownloadProgress)}return a},i=r.#h(s).finally(()=>{const a=r.#i;r.#f(a?.body??void 0),r.#f(r.request.body??void 0)});for(const[a,o]of Object.entries(h2))a==="bytes"&&typeof globalThis.Response?.prototype?.bytes!="function"||(i[a]=async()=>{r.request.headers.set("accept",r.request.headers.get("accept")||o);const l=await i;if(a==="json"){if(l.status===204)return"";const c=await l.text();return c===""?"":n.parseJson?n.parseJson(c):JSON.parse(c)}return l[a]()});return i}static#n(t){return t&&typeof t=="object"&&!Array.isArray(t)&&!(t instanceof URLSearchParams)?Object.fromEntries(Object.entries(t).filter(([,n])=>n!==void 0)):t}request;#t;#r=0;#s;#e;#i;#a;#o;constructor(t,n={}){if(this.#s=t,this.#e={...n,headers:Qh(this.#s.headers,n.headers),hooks:Jh({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},n.hooks),method:k2(n.method??this.#s.method??"GET"),prefixUrl:String(n.prefixUrl||""),retry:T2(n.retry),throwHttpErrors:n.throwHttpErrors??!0,timeout:n.timeout??1e4,fetch:n.fetch??globalThis.fetch.bind(globalThis),context:n.context??{}},typeof this.#s!="string"&&!(this.#s instanceof URL||this.#s instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this.#e.prefixUrl&&typeof this.#s=="string"){if(this.#s.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this.#e.prefixUrl.endsWith("/")||(this.#e.prefixUrl+="/"),this.#s=this.#e.prefixUrl+this.#s}u2&&jh&&(this.#a=this.#e.signal??this.#s.signal,this.#t=new globalThis.AbortController,this.#e.signal=this.#a?AbortSignal.any([this.#a,this.#t.signal]):this.#t.signal),Qu&&(this.#e.duplex="half"),this.#e.json!==void 0&&(this.#e.body=this.#e.stringifyJson?.(this.#e.json)??JSON.stringify(this.#e.json),this.#e.headers.set("content-type",this.#e.headers.get("content-type")??"application/json"));const r=n.headers&&new globalThis.Headers(n.headers).has("content-type");if(this.#s instanceof globalThis.Request&&(f2&&this.#e.body instanceof globalThis.FormData||this.#e.body instanceof URLSearchParams)&&!r&&this.#e.headers.delete("content-type"),this.request=new globalThis.Request(this.#s,this.#e),O2(this.#e.searchParams)){const i="?"+(typeof this.#e.searchParams=="string"?this.#e.searchParams.replace(/^\?/,""):new URLSearchParams(Xi.#n(this.#e.searchParams)).toString()),a=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,i);this.request=new globalThis.Request(a,this.#e)}if(this.#e.onUploadProgress){if(typeof this.#e.onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");if(!Qu)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request=this.#v(this.request,this.#e.body??void 0)}}#d(){const t=this.#e.retry.delay(this.#r);let n=t;this.#e.retry.jitter===!0?n=Math.random()*t:typeof this.#e.retry.jitter=="function"&&(n=this.#e.retry.jitter(t),(!Number.isFinite(n)||n<0)&&(n=t));const r=this.#e.retry.backoffLimit??Number.POSITIVE_INFINITY;return Math.min(r,n)}async#l(t){if(this.#r++,this.#r>this.#e.retry.limit)throw t;const n=t instanceof Error?t:new Vh(t);if(n instanceof bl)return n.customDelay??this.#d();if(!this.#e.retry.methods.includes(this.request.method.toLowerCase()))throw t;if(this.#e.retry.shouldRetry!==void 0){const r=await this.#e.retry.shouldRetry({error:n,retryCount:this.#r});if(r===!1)throw t;if(r===!0)return this.#d()}if(M2(t)&&!this.#e.retry.retryOnTimeout)throw t;if(N2(t)){if(!this.#e.retry.statusCodes.includes(t.response.status))throw t;const r=t.response.headers.get("Retry-After")??t.response.headers.get("RateLimit-Reset")??t.response.headers.get("X-RateLimit-Retry-After")??t.response.headers.get("X-RateLimit-Reset")??t.response.headers.get("X-Rate-Limit-Reset");if(r&&this.#e.retry.afterStatusCodes.includes(t.response.status)){let s=Number(r)*1e3;Number.isNaN(s)?s=Date.parse(r)-Date.now():s>=Date.parse("2024-01-01")&&(s-=Date.now());const i=this.#e.retry.maxRetryAfter??s;return s<i?s:i}if(t.response.status===413)throw t}return this.#d()}#p(t){return this.#e.parseJson&&(t.json=async()=>this.#e.parseJson(await t.text())),t}#f(t){t&&t.cancel().catch(()=>{})}#c(t){this.#f(t.body??void 0)}async#h(t){try{return await t()}catch(n){const r=Math.min(await this.#l(n),yl);if(this.#r<1)throw n;if(await R2(r,this.#a?{signal:this.#a}:{}),n instanceof bl&&n.customRequest){const s=this.#e.signal?new globalThis.Request(n.customRequest,{signal:this.#e.signal}):new globalThis.Request(n.customRequest);this.#m(s)}for(const s of this.#e.hooks.beforeRetry){const i=await s({request:this.request,options:this.#u(),error:n,retryCount:this.#r});if(i instanceof globalThis.Request){this.#m(i);break}if(i instanceof globalThis.Response)return i;if(i===Zh)return}return this.#h(t)}}async#g(){this.#t?.signal.aborted&&(this.#t=new globalThis.AbortController,this.#e.signal=this.#a?AbortSignal.any([this.#a,this.#t.signal]):this.#t.signal,this.request=new globalThis.Request(this.request,{signal:this.#e.signal}));for(const n of this.#e.hooks.beforeRequest){const r=await n(this.request,this.#u(),{retryCount:this.#r});if(r instanceof Response)return r;if(r instanceof globalThis.Request){this.#m(r);break}}const t=C2(this.request,this.#e);return this.#i=this.request,this.request=this.#i.clone(),this.#e.timeout===!1?this.#e.fetch(this.#i,t):I2(this.#i,t,this.#t,this.#e)}#u(){if(!this.#o){const{hooks:t,...n}=this.#e;this.#o=Object.freeze(n)}return this.#o}#m(t){this.#o=void 0,this.request=this.#v(t)}#v(t,n){return!this.#e.onUploadProgress||!t.body?t:S2(t,this.#e.onUploadProgress,n??this.#e.body??void 0)}}const mc=e=>{const t=(n,r)=>Xi.create(n,ka(e,r));for(const n of Gh)t[n]=(r,s)=>Xi.create(r,ka(e,s,{method:n}));return t.create=n=>mc(ka(n)),t.extend=n=>(typeof n=="function"&&(n=n(e??{})),mc(ka(e,n))),t.stop=Zh,t.retry=m2,t},z2=mc(),wl="task-handoff-web-token",$s=l0("auth",{state:()=>({token:localStorage.getItem(wl)||""}),actions:{setToken(e){this.token=e,e?localStorage.setItem(wl,e):localStorage.removeItem(wl)}}}),Do=z2.create({prefixUrl:c2(),timeout:3e4,hooks:{beforeRequest:[e=>{const t=$s().token;t&&e.headers.set("Authorization",`Bearer ${t}`)}]}});class Ya extends Error{code;status;constructor(t,n="API_ERROR",r){super(t),this.name="ApiError",this.code=n,this.status=r}}async function Po(e){try{return await e}catch(t){if(t&&typeof t=="object"&&"response"in t){const n=t.response;try{const r=await n.clone().json(),s=r.error?.message||`${n.status} ${n.statusText}`;throw new Ya(s,r.error?.code,n.status)}catch(r){if(r instanceof Ya)throw r}throw new Ya(`${n.status} ${n.statusText}`,"HTTP_ERROR",n.status)}throw t}}async function Jn(e){return(await Po(Do.get(e).json())).data}async function Un(e,t){return(await Po(Do.post(e,{json:t??{}}).json())).data}async function Yh(e,t){return(await Po(Do.patch(e,{json:t??{}}).json())).data}async function p0(e){return(await Po(Do.delete(e).json())).data}function Nr(e=!0){const t=$s(),n=ep();return we(()=>!g(e)||!n.data.value?!1:!n.data.value.enabled||!!t.token)}function Ds(e,t){return!(t instanceof Ya&&t.status===401)&&e<3}function Xh(){return pr({queryKey:["status"],queryFn:()=>Jn("status"),enabled:Nr(),refetchInterval:1e4,retry:Ds})}function ep(){return pr({queryKey:["auth-status"],queryFn:()=>Jn("auth/status")})}function $2(){return pr({queryKey:["diagnostics"],queryFn:()=>Jn("diagnostics"),enabled:Nr(),refetchInterval:15e3,retry:Ds})}function tp(){return pr({queryKey:["app-catalog"],queryFn:()=>Jn("apps/catalog"),enabled:Nr(),retry:Ds})}function np(){return pr({queryKey:["app-catalog-custom"],queryFn:()=>Jn("apps/catalog/custom"),enabled:Nr(),retry:!1})}function Ys(e){return Yh("apps/catalog/custom",{items:e})}function di(){return pr({queryKey:["app-sessions"],queryFn:async()=>(await Jn("apps/sessions")).snapshot.sessions,enabled:Nr(),retry:Ds})}function rp(){return pr({queryKey:["ai-sessions"],queryFn:async()=>(await Jn("ai-sessions")).snapshot,enabled:Nr(),retry:Ds})}function Yu(e,t,n){return Un(`ai-sessions/${e}/messages`,{message:t,mode:n})}function D2(e,t){return Un(`ai-sessions/${e}/queue/${t}/steer`)}function P2(e,t){return Un(`ai-sessions/${e}/queue/${t}/retry`)}function B2(e,t){return p0(`ai-sessions/${e}/queue/${t}`)}function L2(e,t){return Un(`ai-sessions/${e}/approval`,{decision:t})}function F2(){return pr({queryKey:["triggers"],queryFn:()=>Jn("triggers"),enabled:Nr(),retry:Ds})}function U2(e){return Un("triggers",e)}function q2(e){return Un(`triggers/${e}/enable`)}function H2(e){return Un(`triggers/${e}/disable`)}function V2(e,t){return Un(`triggers/${e}/run`,{})}function j2(e){return p0(`triggers/${e}`)}function G2(e){return Un(`ai-sessions/${e}/interrupt`)}function Z2(e){return pr({queryKey:["app-session-logs",e],queryFn:()=>Jn(`apps/sessions/${e}/logs`),enabled:Nr(!!e),refetchInterval:5e3,retry:Ds})}function K2(e,t=!0){return pr({queryKey:["app-session-automation",e],queryFn:()=>Jn(`apps/sessions/${e}/automation`),enabled:Nr(!!e&&t),refetchInterval:5e3,retry:!1})}function sp(e,t={}){return Un("apps/sessions",{appId:e,...t})}function Cs(e){return Un(`apps/sessions/${e}/stop`)}function m0(e){return Un(`apps/sessions/${e}/restart`)}function W2(e,t){return Yh(`apps/sessions/${e}`,{title:t})}function ip(e){return p0(`apps/sessions/${e}`)}function ap(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=ap(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function op(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=ap(e))&&(r&&(r+=" "),r+=t);return r}const Xu=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,ed=op,g0=(e,t)=>n=>{var r;if(t?.variants==null)return ed(e,n?.class,n?.className);const{variants:s,defaultVariants:i}=t,a=Object.keys(s).map(c=>{const u=n?.[c],f=i?.[c];if(u===null)return null;const m=Xu(u)||Xu(f);return s[c][m]}),o=n&&Object.entries(n).reduce((c,u)=>{let[f,m]=u;return m===void 0||(c[f]=m),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:f,className:m,...h}=u;return Object.entries(h).every(y=>{let[b,S]=y;return Array.isArray(S)?S.includes({...i,...o}[b]):{...i,...o}[b]===S})?[...c,f,m]:c},[]);return ed(e,a,l,n?.class,n?.className)},Q2=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},J2=(e,t)=>({classGroupId:e,validator:t}),lp=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),ao="-",td=[],Y2="arbitrary..",X2=e=>{const t=tb(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return eb(a);const o=a.split(ao),l=o[0]===""&&o.length>1?1:0;return cp(o,l,t)},getConflictingClassGroupIds:(a,o)=>{if(o){const l=r[a],c=n[a];return l?c?Q2(c,l):l:c||td}return n[a]||td}}},cp=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],i=n.nextPart.get(s);if(i){const c=cp(e,t+1,i);if(c)return c}const a=n.validators;if(a===null)return;const o=t===0?e.join(ao):e.slice(t).join(ao),l=a.length;for(let c=0;c<l;c++){const u=a[c];if(u.validator(o))return u.classGroupId}},eb=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?Y2+r:void 0})(),tb=e=>{const{theme:t,classGroups:n}=e;return nb(n,t)},nb=(e,t)=>{const n=lp();for(const r in e){const s=e[r];v0(s,n,r,t)}return n},v0=(e,t,n,r)=>{const s=e.length;for(let i=0;i<s;i++){const a=e[i];rb(a,t,n,r)}},rb=(e,t,n,r)=>{if(typeof e=="string"){sb(e,t,n);return}if(typeof e=="function"){ib(e,t,n,r);return}ab(e,t,n,r)},sb=(e,t,n)=>{const r=e===""?t:up(t,e);r.classGroupId=n},ib=(e,t,n,r)=>{if(ob(e)){v0(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(J2(n,e))},ab=(e,t,n,r)=>{const s=Object.entries(e),i=s.length;for(let a=0;a<i;a++){const[o,l]=s[a];v0(l,up(t,o),n,r)}},up=(e,t)=>{let n=e;const r=t.split(ao),s=r.length;for(let i=0;i<s;i++){const a=r[i];let o=n.nextPart.get(a);o||(o=lp(),n.nextPart.set(a,o)),n=o}return n},ob=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,lb=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const s=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(i){let a=n[i];if(a!==void 0)return a;if((a=r[i])!==void 0)return s(i,a),a},set(i,a){i in n?n[i]=a:s(i,a)}}},gc="!",nd=":",cb=[],rd=(e,t,n,r,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),ub=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=s=>{const i=[];let a=0,o=0,l=0,c;const u=s.length;for(let b=0;b<u;b++){const S=s[b];if(a===0&&o===0){if(S===nd){i.push(s.slice(l,b)),l=b+1;continue}if(S==="/"){c=b;continue}}S==="["?a++:S==="]"?a--:S==="("?o++:S===")"&&o--}const f=i.length===0?s:s.slice(l);let m=f,h=!1;f.endsWith(gc)?(m=f.slice(0,-1),h=!0):f.startsWith(gc)&&(m=f.slice(1),h=!0);const y=c&&c>l?c-l:void 0;return rd(i,h,m,y)};if(t){const s=t+nd,i=r;r=a=>a.startsWith(s)?i(a.slice(s.length)):rd(cb,!1,a,void 0,!0)}if(n){const s=r;r=i=>n({className:i,parseClassName:s})}return r},db=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let i=0;i<n.length;i++){const a=n[i],o=a[0]==="[",l=t.has(a);o||l?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(a)):s.push(a)}return s.length>0&&(s.sort(),r.push(...s)),r}},fb=e=>({cache:lb(e.cacheSize),parseClassName:ub(e),sortModifiers:db(e),postfixLookupClassGroupIds:hb(e),...X2(e)}),hb=e=>{const t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let r=0;r<n.length;r++)t[n[r]]=!0;return t},pb=/\s+/,mb=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i,postfixLookupClassGroupIds:a}=t,o=[],l=e.trim().split(pb);let c="";for(let u=l.length-1;u>=0;u-=1){const f=l[u],{isExternal:m,modifiers:h,hasImportantModifier:y,baseClassName:b,maybePostfixModifierPosition:S}=n(f);if(m){c=f+(c.length>0?" "+c:c);continue}let k=!!S,P;if(k){const L=b.substring(0,S);P=r(L);const N=P&&a[P]?r(b):void 0;N&&N!==P&&(P=N,k=!1)}else P=r(b);if(!P){if(!k){c=f+(c.length>0?" "+c:c);continue}if(P=r(b),!P){c=f+(c.length>0?" "+c:c);continue}k=!1}const z=h.length===0?"":h.length===1?h[0]:i(h).join(":"),I=y?z+gc:z,E=I+P;if(o.indexOf(E)>-1)continue;o.push(E);const _=s(P,k);for(let L=0;L<_.length;++L){const N=_[L];o.push(I+N)}c=f+(c.length>0?" "+c:c)}return c},gb=(...e)=>{let t=0,n,r,s="";for(;t<e.length;)(n=e[t++])&&(r=dp(n))&&(s&&(s+=" "),s+=r);return s},dp=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=dp(e[r]))&&(n&&(n+=" "),n+=t);return n},vb=(e,...t)=>{let n,r,s,i;const a=l=>{const c=t.reduce((u,f)=>f(u),e());return n=fb(c),r=n.cache.get,s=n.cache.set,i=o,o(l)},o=l=>{const c=r(l);if(c)return c;const u=mb(l,n);return s(l,u),u};return i=a,(...l)=>i(gb(...l))},bb=[],Jt=e=>{const t=n=>n[e]||bb;return t.isThemeGetter=!0,t},fp=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,hp=/^\((?:(\w[\w-]*):)?(.+)\)$/i,yb=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,wb=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Sb=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,xb=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,kb=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,_b=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,qr=e=>yb.test(e),et=e=>!!e&&!Number.isNaN(Number(e)),nr=e=>!!e&&Number.isInteger(Number(e)),Sl=e=>e.endsWith("%")&&et(e.slice(0,-1)),wr=e=>wb.test(e),pp=()=>!0,Eb=e=>Sb.test(e)&&!xb.test(e),b0=()=>!1,Ab=e=>kb.test(e),Tb=e=>_b.test(e),Ib=e=>!xe(e)&&!ke(e),Rb=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),Cb=e=>fs(e,vp,b0),xe=e=>fp.test(e),ys=e=>fs(e,bp,Eb),sd=e=>fs(e,Bb,et),Ob=e=>fs(e,wp,pp),Nb=e=>fs(e,yp,b0),id=e=>fs(e,mp,b0),Mb=e=>fs(e,gp,Tb),Ea=e=>fs(e,Sp,Ab),ke=e=>hp.test(e),Ei=e=>Ps(e,bp),zb=e=>Ps(e,yp),ad=e=>Ps(e,mp),$b=e=>Ps(e,vp),Db=e=>Ps(e,gp),Aa=e=>Ps(e,Sp,!0),Pb=e=>Ps(e,wp,!0),fs=(e,t,n)=>{const r=fp.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Ps=(e,t,n=!1)=>{const r=hp.exec(e);return r?r[1]?t(r[1]):n:!1},mp=e=>e==="position"||e==="percentage",gp=e=>e==="image"||e==="url",vp=e=>e==="length"||e==="size"||e==="bg-size",bp=e=>e==="length",Bb=e=>e==="number",yp=e=>e==="family-name",wp=e=>e==="number"||e==="weight",Sp=e=>e==="shadow",Lb=()=>{const e=Jt("color"),t=Jt("font"),n=Jt("text"),r=Jt("font-weight"),s=Jt("tracking"),i=Jt("leading"),a=Jt("breakpoint"),o=Jt("container"),l=Jt("spacing"),c=Jt("radius"),u=Jt("shadow"),f=Jt("inset-shadow"),m=Jt("text-shadow"),h=Jt("drop-shadow"),y=Jt("blur"),b=Jt("perspective"),S=Jt("aspect"),k=Jt("ease"),P=Jt("animate"),z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],I=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...I(),ke,xe],_=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto","contain","none"],N=()=>[ke,xe,l],G=()=>[qr,"full","auto",...N()],D=()=>[nr,"none","subgrid",ke,xe],W=()=>["auto",{span:["full",nr,ke,xe]},nr,ke,xe],q=()=>[nr,"auto",ke,xe],X=()=>["auto","min","max","fr",ke,xe],ne=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],he=()=>["start","end","center","stretch","center-safe","end-safe"],Ae=()=>["auto",...N()],se=()=>[qr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...N()],re=()=>[qr,"screen","full","dvw","lvw","svw","min","max","fit",...N()],ze=()=>[qr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...N()],ie=()=>[e,ke,xe],je=()=>[...I(),ad,id,{position:[ke,xe]}],rt=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ot=()=>["auto","cover","contain",$b,Cb,{size:[ke,xe]}],Ft=()=>[Sl,Ei,ys],st=()=>["","none","full",c,ke,xe],at=()=>["",et,Ei,ys],C=()=>["solid","dashed","dotted","double"],le=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Q=()=>[et,Sl,ad,id],de=()=>["","none",y,ke,xe],Ie=()=>["none",et,ke,xe],Ge=()=>["none",et,ke,xe],Be=()=>[et,ke,xe],Te=()=>[qr,"full",...N()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[wr],breakpoint:[wr],color:[pp],container:[wr],"drop-shadow":[wr],ease:["in","out","in-out"],font:[Ib],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[wr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[wr],shadow:[wr],spacing:["px",et],text:[wr],"text-shadow":[wr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",qr,xe,ke,S]}],container:["container"],"container-type":[{"@container":["","normal","size",ke,xe]}],"container-named":[Rb],columns:[{columns:[et,xe,ke,o]}],"break-after":[{"break-after":z()}],"break-before":[{"break-before":z()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:E()}],overflow:[{overflow:_()}],"overflow-x":[{"overflow-x":_()}],"overflow-y":[{"overflow-y":_()}],overscroll:[{overscroll:L()}],"overscroll-x":[{"overscroll-x":L()}],"overscroll-y":[{"overscroll-y":L()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:G()}],"inset-x":[{"inset-x":G()}],"inset-y":[{"inset-y":G()}],start:[{"inset-s":G(),start:G()}],end:[{"inset-e":G(),end:G()}],"inset-bs":[{"inset-bs":G()}],"inset-be":[{"inset-be":G()}],top:[{top:G()}],right:[{right:G()}],bottom:[{bottom:G()}],left:[{left:G()}],visibility:["visible","invisible","collapse"],z:[{z:[nr,"auto",ke,xe]}],basis:[{basis:[qr,"full","auto",o,...N()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[et,qr,"auto","initial","none",xe]}],grow:[{grow:["",et,ke,xe]}],shrink:[{shrink:["",et,ke,xe]}],order:[{order:[nr,"first","last","none",ke,xe]}],"grid-cols":[{"grid-cols":D()}],"col-start-end":[{col:W()}],"col-start":[{"col-start":q()}],"col-end":[{"col-end":q()}],"grid-rows":[{"grid-rows":D()}],"row-start-end":[{row:W()}],"row-start":[{"row-start":q()}],"row-end":[{"row-end":q()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":X()}],"auto-rows":[{"auto-rows":X()}],gap:[{gap:N()}],"gap-x":[{"gap-x":N()}],"gap-y":[{"gap-y":N()}],"justify-content":[{justify:[...ne(),"normal"]}],"justify-items":[{"justify-items":[...he(),"normal"]}],"justify-self":[{"justify-self":["auto",...he()]}],"align-content":[{content:["normal",...ne()]}],"align-items":[{items:[...he(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...he(),{baseline:["","last"]}]}],"place-content":[{"place-content":ne()}],"place-items":[{"place-items":[...he(),"baseline"]}],"place-self":[{"place-self":["auto",...he()]}],p:[{p:N()}],px:[{px:N()}],py:[{py:N()}],ps:[{ps:N()}],pe:[{pe:N()}],pbs:[{pbs:N()}],pbe:[{pbe:N()}],pt:[{pt:N()}],pr:[{pr:N()}],pb:[{pb:N()}],pl:[{pl:N()}],m:[{m:Ae()}],mx:[{mx:Ae()}],my:[{my:Ae()}],ms:[{ms:Ae()}],me:[{me:Ae()}],mbs:[{mbs:Ae()}],mbe:[{mbe:Ae()}],mt:[{mt:Ae()}],mr:[{mr:Ae()}],mb:[{mb:Ae()}],ml:[{ml:Ae()}],"space-x":[{"space-x":N()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":N()}],"space-y-reverse":["space-y-reverse"],size:[{size:se()}],"inline-size":[{inline:["auto",...re()]}],"min-inline-size":[{"min-inline":["auto",...re()]}],"max-inline-size":[{"max-inline":["none",...re()]}],"block-size":[{block:["auto",...ze()]}],"min-block-size":[{"min-block":["auto",...ze()]}],"max-block-size":[{"max-block":["none",...ze()]}],w:[{w:[o,"screen",...se()]}],"min-w":[{"min-w":[o,"screen","none",...se()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[a]},...se()]}],h:[{h:["screen","lh",...se()]}],"min-h":[{"min-h":["screen","lh","none",...se()]}],"max-h":[{"max-h":["screen","lh",...se()]}],"font-size":[{text:["base",n,Ei,ys]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Pb,Ob]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Sl,xe]}],"font-family":[{font:[zb,Nb,t]}],"font-features":[{"font-features":[xe]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,ke,xe]}],"line-clamp":[{"line-clamp":[et,"none",ke,sd]}],leading:[{leading:[i,...N()]}],"list-image":[{"list-image":["none",ke,xe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ke,xe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:ie()}],"text-color":[{text:ie()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...C(),"wavy"]}],"text-decoration-thickness":[{decoration:[et,"from-font","auto",ke,ys]}],"text-decoration-color":[{decoration:ie()}],"underline-offset":[{"underline-offset":[et,"auto",ke,xe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:N()}],"tab-size":[{tab:[nr,ke,xe]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ke,xe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ke,xe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:je()}],"bg-repeat":[{bg:rt()}],"bg-size":[{bg:ot()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},nr,ke,xe],radial:["",ke,xe],conic:[nr,ke,xe]},Db,Mb]}],"bg-color":[{bg:ie()}],"gradient-from-pos":[{from:Ft()}],"gradient-via-pos":[{via:Ft()}],"gradient-to-pos":[{to:Ft()}],"gradient-from":[{from:ie()}],"gradient-via":[{via:ie()}],"gradient-to":[{to:ie()}],rounded:[{rounded:st()}],"rounded-s":[{"rounded-s":st()}],"rounded-e":[{"rounded-e":st()}],"rounded-t":[{"rounded-t":st()}],"rounded-r":[{"rounded-r":st()}],"rounded-b":[{"rounded-b":st()}],"rounded-l":[{"rounded-l":st()}],"rounded-ss":[{"rounded-ss":st()}],"rounded-se":[{"rounded-se":st()}],"rounded-ee":[{"rounded-ee":st()}],"rounded-es":[{"rounded-es":st()}],"rounded-tl":[{"rounded-tl":st()}],"rounded-tr":[{"rounded-tr":st()}],"rounded-br":[{"rounded-br":st()}],"rounded-bl":[{"rounded-bl":st()}],"border-w":[{border:at()}],"border-w-x":[{"border-x":at()}],"border-w-y":[{"border-y":at()}],"border-w-s":[{"border-s":at()}],"border-w-e":[{"border-e":at()}],"border-w-bs":[{"border-bs":at()}],"border-w-be":[{"border-be":at()}],"border-w-t":[{"border-t":at()}],"border-w-r":[{"border-r":at()}],"border-w-b":[{"border-b":at()}],"border-w-l":[{"border-l":at()}],"divide-x":[{"divide-x":at()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":at()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...C(),"hidden","none"]}],"divide-style":[{divide:[...C(),"hidden","none"]}],"border-color":[{border:ie()}],"border-color-x":[{"border-x":ie()}],"border-color-y":[{"border-y":ie()}],"border-color-s":[{"border-s":ie()}],"border-color-e":[{"border-e":ie()}],"border-color-bs":[{"border-bs":ie()}],"border-color-be":[{"border-be":ie()}],"border-color-t":[{"border-t":ie()}],"border-color-r":[{"border-r":ie()}],"border-color-b":[{"border-b":ie()}],"border-color-l":[{"border-l":ie()}],"divide-color":[{divide:ie()}],"outline-style":[{outline:[...C(),"none","hidden"]}],"outline-offset":[{"outline-offset":[et,ke,xe]}],"outline-w":[{outline:["",et,Ei,ys]}],"outline-color":[{outline:ie()}],shadow:[{shadow:["","none",u,Aa,Ea]}],"shadow-color":[{shadow:ie()}],"inset-shadow":[{"inset-shadow":["none",f,Aa,Ea]}],"inset-shadow-color":[{"inset-shadow":ie()}],"ring-w":[{ring:at()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:ie()}],"ring-offset-w":[{"ring-offset":[et,ys]}],"ring-offset-color":[{"ring-offset":ie()}],"inset-ring-w":[{"inset-ring":at()}],"inset-ring-color":[{"inset-ring":ie()}],"text-shadow":[{"text-shadow":["none",m,Aa,Ea]}],"text-shadow-color":[{"text-shadow":ie()}],opacity:[{opacity:[et,ke,xe]}],"mix-blend":[{"mix-blend":[...le(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":le()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[et]}],"mask-image-linear-from-pos":[{"mask-linear-from":Q()}],"mask-image-linear-to-pos":[{"mask-linear-to":Q()}],"mask-image-linear-from-color":[{"mask-linear-from":ie()}],"mask-image-linear-to-color":[{"mask-linear-to":ie()}],"mask-image-t-from-pos":[{"mask-t-from":Q()}],"mask-image-t-to-pos":[{"mask-t-to":Q()}],"mask-image-t-from-color":[{"mask-t-from":ie()}],"mask-image-t-to-color":[{"mask-t-to":ie()}],"mask-image-r-from-pos":[{"mask-r-from":Q()}],"mask-image-r-to-pos":[{"mask-r-to":Q()}],"mask-image-r-from-color":[{"mask-r-from":ie()}],"mask-image-r-to-color":[{"mask-r-to":ie()}],"mask-image-b-from-pos":[{"mask-b-from":Q()}],"mask-image-b-to-pos":[{"mask-b-to":Q()}],"mask-image-b-from-color":[{"mask-b-from":ie()}],"mask-image-b-to-color":[{"mask-b-to":ie()}],"mask-image-l-from-pos":[{"mask-l-from":Q()}],"mask-image-l-to-pos":[{"mask-l-to":Q()}],"mask-image-l-from-color":[{"mask-l-from":ie()}],"mask-image-l-to-color":[{"mask-l-to":ie()}],"mask-image-x-from-pos":[{"mask-x-from":Q()}],"mask-image-x-to-pos":[{"mask-x-to":Q()}],"mask-image-x-from-color":[{"mask-x-from":ie()}],"mask-image-x-to-color":[{"mask-x-to":ie()}],"mask-image-y-from-pos":[{"mask-y-from":Q()}],"mask-image-y-to-pos":[{"mask-y-to":Q()}],"mask-image-y-from-color":[{"mask-y-from":ie()}],"mask-image-y-to-color":[{"mask-y-to":ie()}],"mask-image-radial":[{"mask-radial":[ke,xe]}],"mask-image-radial-from-pos":[{"mask-radial-from":Q()}],"mask-image-radial-to-pos":[{"mask-radial-to":Q()}],"mask-image-radial-from-color":[{"mask-radial-from":ie()}],"mask-image-radial-to-color":[{"mask-radial-to":ie()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":I()}],"mask-image-conic-pos":[{"mask-conic":[et]}],"mask-image-conic-from-pos":[{"mask-conic-from":Q()}],"mask-image-conic-to-pos":[{"mask-conic-to":Q()}],"mask-image-conic-from-color":[{"mask-conic-from":ie()}],"mask-image-conic-to-color":[{"mask-conic-to":ie()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:je()}],"mask-repeat":[{mask:rt()}],"mask-size":[{mask:ot()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ke,xe]}],filter:[{filter:["","none",ke,xe]}],blur:[{blur:de()}],brightness:[{brightness:[et,ke,xe]}],contrast:[{contrast:[et,ke,xe]}],"drop-shadow":[{"drop-shadow":["","none",h,Aa,Ea]}],"drop-shadow-color":[{"drop-shadow":ie()}],grayscale:[{grayscale:["",et,ke,xe]}],"hue-rotate":[{"hue-rotate":[et,ke,xe]}],invert:[{invert:["",et,ke,xe]}],saturate:[{saturate:[et,ke,xe]}],sepia:[{sepia:["",et,ke,xe]}],"backdrop-filter":[{"backdrop-filter":["","none",ke,xe]}],"backdrop-blur":[{"backdrop-blur":de()}],"backdrop-brightness":[{"backdrop-brightness":[et,ke,xe]}],"backdrop-contrast":[{"backdrop-contrast":[et,ke,xe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",et,ke,xe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[et,ke,xe]}],"backdrop-invert":[{"backdrop-invert":["",et,ke,xe]}],"backdrop-opacity":[{"backdrop-opacity":[et,ke,xe]}],"backdrop-saturate":[{"backdrop-saturate":[et,ke,xe]}],"backdrop-sepia":[{"backdrop-sepia":["",et,ke,xe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":N()}],"border-spacing-x":[{"border-spacing-x":N()}],"border-spacing-y":[{"border-spacing-y":N()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ke,xe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[et,"initial",ke,xe]}],ease:[{ease:["linear","initial",k,ke,xe]}],delay:[{delay:[et,ke,xe]}],animate:[{animate:["none",P,ke,xe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,ke,xe]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:Ie()}],"rotate-x":[{"rotate-x":Ie()}],"rotate-y":[{"rotate-y":Ie()}],"rotate-z":[{"rotate-z":Ie()}],scale:[{scale:Ge()}],"scale-x":[{"scale-x":Ge()}],"scale-y":[{"scale-y":Ge()}],"scale-z":[{"scale-z":Ge()}],"scale-3d":["scale-3d"],skew:[{skew:Be()}],"skew-x":[{"skew-x":Be()}],"skew-y":[{"skew-y":Be()}],transform:[{transform:[ke,xe,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Te()}],"translate-x":[{"translate-x":Te()}],"translate-y":[{"translate-y":Te()}],"translate-z":[{"translate-z":Te()}],"translate-none":["translate-none"],zoom:[{zoom:[nr,ke,xe]}],accent:[{accent:ie()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:ie()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ke,xe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":ie()}],"scrollbar-track-color":[{"scrollbar-track":ie()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":N()}],"scroll-mx":[{"scroll-mx":N()}],"scroll-my":[{"scroll-my":N()}],"scroll-ms":[{"scroll-ms":N()}],"scroll-me":[{"scroll-me":N()}],"scroll-mbs":[{"scroll-mbs":N()}],"scroll-mbe":[{"scroll-mbe":N()}],"scroll-mt":[{"scroll-mt":N()}],"scroll-mr":[{"scroll-mr":N()}],"scroll-mb":[{"scroll-mb":N()}],"scroll-ml":[{"scroll-ml":N()}],"scroll-p":[{"scroll-p":N()}],"scroll-px":[{"scroll-px":N()}],"scroll-py":[{"scroll-py":N()}],"scroll-ps":[{"scroll-ps":N()}],"scroll-pe":[{"scroll-pe":N()}],"scroll-pbs":[{"scroll-pbs":N()}],"scroll-pbe":[{"scroll-pbe":N()}],"scroll-pt":[{"scroll-pt":N()}],"scroll-pr":[{"scroll-pr":N()}],"scroll-pb":[{"scroll-pb":N()}],"scroll-pl":[{"scroll-pl":N()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ke,xe]}],fill:[{fill:["none",...ie()]}],"stroke-w":[{stroke:[et,Ei,ys,sd]}],stroke:[{stroke:["none",...ie()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Fb=vb(Lb);function pt(...e){return Fb(op(e))}const nt=Re({__name:"Button",props:{variant:{},size:{},class:{type:[Boolean,null,String,Object,Array]},asChild:{type:Boolean},as:{default:"button"}},setup(e){const t=e;return(n,r)=>(O(),Se(g(I4),{as:e.as,"as-child":e.asChild,class:At(g(pt)(g(Ub)({variant:e.variant,size:e.size}),t.class))},{default:$(()=>[Ve(n.$slots,"default")]),_:3},8,["as","as-child","class"]))}}),Ub=g0("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",xs:"h-7 rounded px-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}}),od=Re({__name:"ScrollBar",props:{orientation:{default:"vertical"},forceMount:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,n=Vt(t,"class");return(r,s)=>(O(),Se(g(R4),It(g(n),{class:g(pt)("flex touch-none select-none transition-colors",e.orientation==="vertical"&&"h-full w-2.5 p-px",e.orientation==="horizontal"&&"h-2.5 flex-col p-px",t.class)}),{default:$(()=>[T(g(C4),{class:"relative flex-1 rounded-full bg-[var(--scrollbar-thumb)] transition-colors hover:bg-[var(--scrollbar-thumb-hover)]"})]),_:1},16,["class"]))}}),In=Re({__name:"ScrollArea",props:{type:{},dir:{},scrollHideDelay:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]},style:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,n=Vt(t,"class","style");return(r,s)=>(O(),Se(g(O4),It(g(n),{class:g(pt)("relative overflow-hidden",t.class),style:t.style}),{default:$(()=>[T(g(N4),{class:"h-full w-full rounded-[inherit]"},{default:$(()=>[Ve(r.$slots,"default")]),_:3}),T(od),T(od,{orientation:"horizontal"}),T(g(M4))]),_:3},16,["class","style"]))}}),xp=Re({__name:"Toggle",props:{defaultValue:{type:Boolean},modelValue:{type:[Boolean,null]},disabled:{type:Boolean,default:!1},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean},class:{type:[Boolean,null,String,Object,Array]},variant:{default:"default"},size:{default:"default"}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=t,s=Vt(n,"class","size","variant"),i=Wn(s,r);return(a,o)=>(O(),Se(g(z4),It(g(i),{class:g(pt)(g(kp)({variant:e.variant,size:e.size}),n.class)}),{default:$(l=>[Ve(a.$slots,"default",Cn(Qn(l)))]),_:3},16,["class"]))}}),kp=g0("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}}),_p=Re({__name:"ToggleGroup",props:{rovingFocus:{type:Boolean},disabled:{type:Boolean},orientation:{},dir:{},loop:{type:Boolean},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean},type:{},modelValue:{},defaultValue:{},class:{type:[Boolean,null,String,Object,Array]},variant:{},size:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=t;Qa("toggleGroup",{variant:n.variant,size:n.size});const s=Vt(n,"class"),i=Wn(s,r);return(a,o)=>(O(),Se(g($4),It(g(i),{class:g(pt)("flex items-center justify-center gap-1",n.class)}),{default:$(l=>[Ve(a.$slots,"default",Cn(Qn(l)))]),_:3},16,["class"]))}}),oo=Re({__name:"ToggleGroupItem",props:{value:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]},variant:{},size:{}},setup(e){const t=e,n=Rr("toggleGroup"),r=Vt(t,"class","size","variant"),s=hr(r);return(i,a)=>(O(),Se(g(D4),It(g(s),{class:g(pt)(g(kp)({variant:g(n)?.variant||e.variant,size:g(n)?.size||e.size}),t.class)}),{default:$(o=>[Ve(i.$slots,"default",Cn(Qn(o)))]),_:3},16,["class"]))}});const ld=e=>e==="";const qb=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();const cd=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const Hb=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());const Vb=e=>{const t=Hb(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Hs={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};const jb=Symbol("lucide-icons");function Gb(){return Rr(jb,{})}const Zb=({name:e,iconNode:t,absoluteStrokeWidth:n,"absolute-stroke-width":r,strokeWidth:s,"stroke-width":i,size:a,color:o,...l},{slots:c})=>{const{size:u,color:f,strokeWidth:m=2,absoluteStrokeWidth:h=!1,class:y=""}=Gb(),b=we(()=>{const S=ld(n)||ld(r)||n===!0||r===!0||h===!0,k=s||i||m||Hs["stroke-width"];return S?Number(k)*24/Number(a??u??Hs.width):k});return Wi("svg",{...Hs,...l,width:a??u??Hs.width,height:a??u??Hs.height,stroke:o??f??Hs.stroke,"stroke-width":b.value,class:qb("lucide",y,...e?[`lucide-${cd(Vb(e))}-icon`,`lucide-${cd(e)}`]:["lucide-icon"])},[...t.map(S=>Wi(...S)),...c.default?[c.default()]:[]])};const St=(e,t)=>(n,{slots:r,attrs:s})=>Wi(Zb,{...s,...n,iconNode:t,name:e},r.default?{default:r.default}:void 0);const Kb=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Wb=St("activity",Kb);const Qb=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Jb=St("arrow-up",Qb);const Yb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}]],Xb=St("ban",Yb);const ey=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],ty=St("bot",ey);const ny=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Ep=St("check",ny);const ry=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ap=St("chevron-down",ry);const sy=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],iy=St("chevron-left",sy);const ay=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],oy=St("chevron-right",ay);const ly=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],cy=St("chevron-up",ly);const uy=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],dy=St("circle-alert",uy);const fy=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],hy=St("circle-check",fy);const py=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],my=St("code-xml",py);const gy=[["path",{d:"m15 10 5 5-5 5",key:"qqa56n"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]],vy=St("corner-down-right",gy);const by=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Tp=St("external-link",by);const yy=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],wy=St("globe",yy);const Sy=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],xy=St("info",Sy);const ky=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],_y=St("loader-circle",ky);const Ey=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],ud=St("monitor",Ey);const Ay=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],Ty=St("play",Ay);const Iy=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],vc=St("plus",Iy);const Ry=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]],dd=St("puzzle",Ry);const Cy=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 9H3",key:"1338ky"}],["path",{d:"M21 15H3",key:"9uk58r"}]],fd=St("rows-3",Cy);const Oy=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Ny=St("settings",Oy);const My=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],zy=St("sparkles",My);const $y=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],Dy=St("square-terminal",$y);const Py=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],By=St("square",Py);const Ly=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Fy=St("triangle-alert",Ly);const Uy=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Os=St("x",Uy),Ip=Re({__name:"ContextMenu",props:{pressOpenDelay:{},dir:{},modal:{type:Boolean}},emits:["update:open"],setup(e,{emit:t}){const s=Wn(e,t);return(i,a)=>(O(),Se(g(P4),Cn(Qn(g(s))),{default:$(()=>[Ve(i.$slots,"default")]),_:3},16))}}),Rp=Re({__name:"ContextMenuContent",props:{forceMount:{type:Boolean},loop:{type:Boolean},sideFlip:{type:Boolean},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},hideShiftedArrow:{type:Boolean},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","closeAutoFocus"],setup(e,{emit:t}){const n=e,r=t,s=Vt(n,"class"),i=Wn(s,r);return(a,o)=>(O(),Se(g(B4),null,{default:$(()=>[T(g(L4),It(g(i),{class:g(pt)("z-50 min-w-32 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n.class)}),{default:$(()=>[Ve(a.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),Gs=Re({__name:"ContextMenuItem",props:{disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]},inset:{type:Boolean}},emits:["select"],setup(e,{emit:t}){const n=e,r=t,s=Vt(n,"class"),i=Wn(s,r);return(a,o)=>(O(),Se(g(F4),It(g(i),{class:g(pt)("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e.inset&&"pl-8",n.class)}),{default:$(()=>[Ve(a.$slots,"default")]),_:3},16,["class"]))}}),xl=Re({__name:"ContextMenuSeparator",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,n=Vt(t,"class");return(r,s)=>(O(),Se(g(U4),It(g(n),{class:g(pt)("-mx-1 my-1 h-px bg-border",t.class)}),null,16,["class"]))}}),Cp=Re({__name:"ContextMenuTrigger",props:{disabled:{type:Boolean},asChild:{type:Boolean},as:{}},setup(e){const n=hr(e);return(r,s)=>(O(),Se(g(q4),Cn(Qn(g(n))),{default:$(()=>[Ve(r.$slots,"default")]),_:3},16))}}),qy=Re({__name:"HoverCard",props:{defaultOpen:{type:Boolean},open:{type:Boolean},openDelay:{},closeDelay:{}},emits:["update:open"],setup(e,{emit:t}){const s=Wn(e,t);return(i,a)=>(O(),Se(g(H4),Cn(Qn(g(s))),{default:$(()=>[Ve(i.$slots,"default")]),_:3},16))}}),Hy=Re({__name:"HoverCardContent",props:{forceMount:{type:Boolean},side:{},sideOffset:{default:4},sideFlip:{type:Boolean},align:{},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},hideShiftedArrow:{type:Boolean},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,n=Vt(t,"class"),r=hr(n);return(s,i)=>(O(),Se(g(V4),null,{default:$(()=>[T(g(j4),It(g(r),{class:g(pt)("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t.class)}),{default:$(()=>[Ve(s.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),Vy=Re({__name:"HoverCardTrigger",props:{reference:{},asChild:{type:Boolean},as:{}},setup(e){const t=e;return(n,r)=>(O(),Se(g(G4),Cn(Qn(t)),{default:$(()=>[Ve(n.$slots,"default")]),_:3},16))}}),Op="task-handoff-workspace-tabs",Np="task-handoff-workspace-settings",jy={type:"ai-sessions",id:"ai-sessions",title:"AI Sessions"};function da(e){if(e.kind==="gui"){const t=w0(e);return t?{type:"shared-vnc",id:`shared-vnc:${t}`,sessionId:e.id,displaySessionId:t,title:Gy(t)}:{type:"app-vnc",id:`vnc:${e.id}`,sessionId:e.id,title:e.title}}return e.kind==="web"?{type:"app-web",id:`web:${e.id}`,sessionId:e.id,title:e.title}:{type:"app-tty",id:`tty:${e.id}`,sessionId:e.id,title:e.title}}function y0(e,t){if(e&&e.type!=="ai-sessions")return e.type==="shared-vnc"?Zy(t.filter(n=>n.status==="running"&&n.kind==="gui"&&!!n.vnc&&w0(n)===e.displaySessionId))||t.find(n=>n.id===e.sessionId):t.find(n=>n.id===e.sessionId)}function ti(e){return new Set(e.map(t=>t.status==="running"?w0(t):void 0).filter(t=>!!t))}function w0(e){return e.display?.mode==="shared"?e.display.displaySessionId||"main":void 0}function Gy(e){return e==="main"?"Shared Screen":`Shared ${e}`}function Zy(e){return[...e].sort((t,n)=>(n.updatedAt||n.createdAt).localeCompare(t.updatedAt||t.createdAt))[0]}function hd(){try{const e=JSON.parse(localStorage.getItem(Op)||"[]");return Array.isArray(e)?e:[]}catch{return[]}}function Ai(e){localStorage.setItem(Op,JSON.stringify(e))}function Ky(){try{const e=JSON.parse(localStorage.getItem(Np)||"{}");return{guiHidpi:typeof e.guiHidpi=="boolean"?e.guiHidpi:!0}}catch{return{guiHidpi:!0}}}function Wy(e){localStorage.setItem(Np,JSON.stringify(e))}const fi=l0("workspace",{state:()=>({tabs:hd(),activeTabId:hd()[0]?.id||"",vncResizeMode:"scale",guiHidpi:Ky().guiHidpi}),actions:{open(e){const t=this.tabs.find(n=>n.id===e.id);t?Object.assign(t,e):this.tabs.push(e),this.activeTabId=e.id,Ai(this.tabs)},close(e){const t=this.tabs.findIndex(n=>n.id===e);t!==-1&&(this.tabs.splice(t,1),this.activeTabId===e&&(this.activeTabId=this.tabs[Math.max(0,t-1)]?.id||this.tabs[0]?.id||""),Ai(this.tabs))},setActive(e){this.tabs.some(t=>t.id===e)&&(this.activeTabId=e)},setVncResizeMode(e){this.vncResizeMode=e},setGuiHidpi(e){this.guiHidpi=e,Wy({guiHidpi:this.guiHidpi})},moveTab(e,t,n="before"){if(e===t)return;const r=this.tabs.findIndex(o=>o.id===e);if(r===-1||!this.tabs.some(o=>o.id===t))return;const[s]=this.tabs.splice(r,1),i=this.tabs.findIndex(o=>o.id===t),a=n==="after"?i+1:i;this.tabs.splice(a,0,s),Ai(this.tabs)},syncSessionTitles(e){const t=new Map(e.map(r=>[r.id,r.title]));let n=!1;for(const r of this.tabs){if(r.type==="ai-sessions"||r.type==="shared-vnc")continue;const s=t.get(r.sessionId);if(!s)continue;const i=r.type==="logs"?`${s} logs`:s;r.title!==i&&(r.title=i,n=!0)}n&&Ai(this.tabs)},pruneSession(e,t=new Set){const n=this.tabs.filter(r=>r.type==="ai-sessions"?!0:r.type==="shared-vnc"&&t.has(r.displaySessionId)||e.has(r.sessionId));n.length!==this.tabs.length&&(this.tabs=n,this.tabs.some(r=>r.id===this.activeTabId)||(this.activeTabId=this.tabs[0]?.id||""),Ai(this.tabs))}}}),Qy={class:"desktop-launcher","aria-label":"App launcher"},Jy={class:"launcher-item"},Yy=["title","disabled","onClick"],Xy={class:"launcher-icon"},e3={class:"launcher-label"},t3={key:0,class:"launcher-running"},n3={class:"launcher-popover-content"},r3={class:"launcher-popover-head"},s3={class:"launcher-popover-meta"},i3=["disabled","onClick"],a3=["onClick"],o3={class:"launcher-session-title"},l3={class:"launcher-session-meta"},c3=["onClick"],u3={key:0,class:"launcher-session-empty"},d3={class:"launcher-icon"},f3={class:"launcher-icon"},h3={class:"launcher-icon"},p3={class:"launcher-icon"},m3=Re({__name:"LauncherView",emits:["open-settings"],setup(e){const t=ds(),n=tp(),r=di(),s=fi(),i=Oe(""),a=[{label:"New 1280 x 720",width:1280,height:720,depth:24},{label:"New 1440 x 900",width:1440,height:900,depth:24},{label:"New 1920 x 1080",width:1920,height:1080,depth:24}],o=we(()=>{const _=["vscode-web","chromium","terminal-tty","codex","claude","terminal-gui"],L=n.data.value||[];return[..._.map(N=>L.find(G=>G.id===N)).filter(N=>!!N),...L.filter(N=>!_.includes(N.id))]});function l(_,L){return _==="vscode-web"||L==="web"?my:_==="chromium"?wy:_==="terminal-tty"?Dy:_==="codex"?ty:_==="claude"?zy:_==="terminal-gui"||L==="gui"?ud:dd}function c(_){return(r.data.value||[]).filter(L=>L.appId===_&&L.status==="running")}function u(_){return[...c(_)].sort((L,N)=>(N.updatedAt||N.createdAt).localeCompare(L.updatedAt||L.createdAt))[0]}function f(_){return _.replace(/^app_/,"").slice(0,12)}async function m(_){const L=u(_.id);if(L){I(L);return}await h(_)}async function h(_,L={}){i.value=_.id;try{const N=await sp(_.id,y(_,L));I(N),await t.invalidateQueries({queryKey:["status"]})}finally{i.value=""}}function y(_,L){if(_.kind!=="gui")return L;const N=s.guiHidpi?b():1,G={...L.env||{}};G.TASK_HANDOFF_GUI_SCALE||(G.TASK_HANDOFF_GUI_SCALE=S(N));const D=k(L.display||_.display,N);return{...L,env:G,...D?{display:D}:{}}}function b(){const _=typeof window>"u"?1:window.devicePixelRatio||1;return Math.min(3,Math.max(1,_))}function S(_){return _.toFixed(2).replace(/\.?0+$/,"")}function k(_,L){return!_?.width||!_.height?_:{..._,width:Math.round(_.width*L),height:Math.round(_.height*L)}}async function P(_){const L=c(_.id);if(!L.length)return;await Promise.all(L.map(D=>Cs(D.id)));const N=new Set(L.map(D=>D.id)),G=(r.data.value||[]).filter(D=>!N.has(D.id));s.pruneSession(new Set(G.map(D=>D.id)),ti(G)),await t.invalidateQueries({queryKey:["status"]})}async function z(_){await Cs(_.id);const L=(r.data.value||[]).filter(N=>N.id!==_.id);s.pruneSession(new Set(L.map(N=>N.id)),ti(L)),await t.invalidateQueries({queryKey:["status"]})}function I(_){s.open(da(_))}function E(){s.open(jy)}return(_,L)=>(O(),j("aside",Qy,[(O(!0),j(lt,null,Ht(o.value,N=>(O(),Se(g(Ip),{key:N.id},{default:$(()=>[T(g(qy),{"open-delay":250,"close-delay":150},{default:$(()=>[T(g(Cp),{"as-child":""},{default:$(()=>[T(g(Vy),{"as-child":""},{default:$(()=>[x("div",Jy,[x("button",{type:"button",class:"launcher-button",title:N.name,disabled:i.value===N.id,onClick:G=>m(N)},[x("span",Xy,[(O(),Se(js(l(N.id,N.kind)),{size:22}))]),x("span",e3,Z(N.name),1),c(N.id).length?(O(),j("span",t3,Z(c(N.id).length),1)):pe("",!0)],8,Yy)])]),_:2},1024)]),_:2},1024),T(g(Hy),{class:"launcher-popover p-0",side:"right",align:"start","side-offset":8},{default:$(()=>[x("div",n3,[x("div",r3,[x("strong",null,Z(N.name),1),x("div",s3,[x("span",null,Z(c(N.id).length)+" running",1),x("button",{type:"button",class:"launcher-new-instance",title:"New instance","aria-label":"New instance",disabled:i.value===N.id,onClick:en(G=>h(N),["stop"])},[T(g(vc),{size:14,"stroke-width":2.2})],8,i3)])]),(O(!0),j(lt,null,Ht(c(N.id),G=>(O(),j("div",{key:G.id,class:"launcher-session",role:"menuitem"},[x("button",{type:"button",class:"launcher-session-open",onClick:D=>I(G)},[x("span",o3,Z(G.title),1),x("span",l3,Z(G.kind)+" · "+Z(f(G.id)),1)],8,a3),x("button",{type:"button",class:"launcher-session-close",title:"Stop session","aria-label":"Stop session",onClick:en(D=>z(G),["stop"])},[T(g(Os),{size:14,"stroke-width":2.2})],8,c3)]))),128)),c(N.id).length?pe("",!0):(O(),j("div",u3,"No running sessions"))])]),_:2},1024)]),_:2},1024),T(g(Rp),{class:"launcher-context-menu"},{default:$(()=>[T(g(Gs),{class:"launcher-context-item",onSelect:G=>m(N)},{default:$(()=>[T(g(Ty),{size:15}),L[3]||(L[3]=x("span",null,"Open",-1))]),_:1},8,["onSelect"]),T(g(Gs),{class:"launcher-context-item",onSelect:G=>h(N)},{default:$(()=>[T(g(vc),{size:15}),L[4]||(L[4]=x("span",null,"New Instance",-1))]),_:1},8,["onSelect"]),N.kind==="gui"?(O(),j(lt,{key:0},[T(g(xl)),T(g(Gs),{class:"launcher-context-item",onSelect:G=>h(N,{displayTarget:{mode:"shared",id:"main",autoCreate:!0}})},{default:$(()=>[T(g(fd),{size:15}),L[5]||(L[5]=x("span",null,"Open Shared Screen",-1))]),_:1},8,["onSelect"]),T(g(xl)),(O(),j(lt,null,Ht(a,G=>T(g(Gs),{key:G.label,class:"launcher-context-item",onSelect:D=>h(N,{displayTarget:{mode:"isolated"},display:{width:G.width,height:G.height,depth:G.depth}})},{default:$(()=>[T(g(ud),{size:15}),x("span",null,Z(G.label),1)]),_:2},1032,["onSelect"])),64))],64)):pe("",!0),c(N.id).length?(O(),j(lt,{key:1},[T(g(xl)),T(g(Gs),{class:"launcher-context-item danger",onSelect:G=>P(N)},{default:$(()=>[T(g(Os),{size:15}),L[6]||(L[6]=x("span",null,"Close All",-1))]),_:1},8,["onSelect"])],64)):pe("",!0)]),_:2},1024)]),_:2},1024))),128)),L[11]||(L[11]=x("div",{class:"launcher-spacer"},null,-1)),x("button",{type:"button",class:"launcher-button",title:"AI Sessions",onClick:E},[x("span",d3,[T(g(Wb),{size:22})]),L[7]||(L[7]=x("span",{class:"launcher-label"},"AI",-1))]),x("button",{type:"button",class:"launcher-button",title:"Custom Apps",onClick:L[0]||(L[0]=N=>_.$emit("open-settings","apps"))},[x("span",f3,[T(g(dd),{size:22})]),L[8]||(L[8]=x("span",{class:"launcher-label"},"Apps",-1))]),x("button",{type:"button",class:"launcher-button",title:"Sessions",onClick:L[1]||(L[1]=N=>_.$emit("open-settings","sessions"))},[x("span",h3,[T(g(fd),{size:22})]),L[9]||(L[9]=x("span",{class:"launcher-label"},"Sessions",-1))]),x("button",{type:"button",class:"launcher-button",title:"Settings",onClick:L[2]||(L[2]=N=>_.$emit("open-settings","general"))},[x("span",p3,[T(g(Ny),{size:22})]),L[10]||(L[10]=x("span",{class:"launcher-label"},"Settings",-1))])]))}}),Mp=Re({__name:"Dialog",props:{open:{type:Boolean},defaultOpen:{type:Boolean},modal:{type:Boolean}},emits:["update:open"],setup(e,{emit:t}){const s=Wn(e,t);return(i,a)=>(O(),Se(g(Z4),Cn(Qn(g(s))),{default:$(()=>[Ve(i.$slots,"default")]),_:3},16))}}),zp=Re({__name:"DialogContent",props:{forceMount:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]},style:{type:[Boolean,null,String,Object,Array]}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const n=e,r=t,s=Vt(n,"class","style"),i=Wn(s,r);return(a,o)=>(O(),Se(g(J4),null,{default:$(()=>[T(g(K4),{class:"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"}),T(g(W4),It(g(i),{style:n.style,class:g(pt)("fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border bg-background p-4 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",n.class)}),{default:$(()=>[Ve(a.$slots,"default"),T(g(Q4),{class:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground"},{default:$(()=>[T(g(Os),{class:"w-4 h-4"}),o[0]||(o[0]=x("span",{class:"sr-only"},"Close",-1))]),_:1})]),_:3},16,["style","class"])]),_:3}))}}),$p=Re({__name:"DialogDescription",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,n=Vt(t,"class"),r=hr(n);return(s,i)=>(O(),Se(g(Y4),It(g(r),{class:g(pt)("text-sm text-muted-foreground",t.class)}),{default:$(()=>[Ve(s.$slots,"default")]),_:3},16,["class"]))}}),Dp=Re({__name:"DialogTitle",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,n=Vt(t,"class"),r=hr(n);return(s,i)=>(O(),Se(g(X4),It(g(r),{class:g(pt)("text-lg font-semibold leading-none tracking-tight",t.class)}),{default:$(()=>[Ve(s.$slots,"default")]),_:3},16,["class"]))}}),g3=Re({__name:"Tabs",props:{defaultValue:{},orientation:{},dir:{},activationMode:{},modelValue:{},unmountOnHide:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["update:modelValue"],setup(e,{emit:t}){const s=Wn(e,t);return(i,a)=>(O(),Se(g(ev),Cn(Qn(g(s))),{default:$(()=>[Ve(i.$slots,"default")]),_:3},16))}}),kl=Re({__name:"TabsContent",props:{value:{},forceMount:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,n=Vt(t,"class");return(r,s)=>(O(),Se(g(tv),It({class:g(pt)("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t.class)},g(n)),{default:$(()=>[Ve(r.$slots,"default")]),_:3},16,["class"]))}}),v3=Re({__name:"TabsList",props:{loop:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,n=Vt(t,"class");return(r,s)=>(O(),Se(g(nv),It(g(n),{class:g(pt)("inline-flex items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",t.class)}),{default:$(()=>[Ve(r.$slots,"default")]),_:3},16,["class"]))}}),b3={class:"truncate"},y3=Re({__name:"TabsTrigger",props:{value:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,n=Vt(t,"class"),r=hr(n);return(s,i)=>(O(),Se(g(rv),It(g(r),{class:g(pt)("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",t.class)}),{default:$(()=>[x("span",b3,[Ve(s.$slots,"default")])]),_:3},16,["class"]))}}),w3={class:"panel"},S3={key:0,class:"stats"},x3={key:1,class:"diagnostics-grid"},k3={class:"diagnostics-card"},_3={class:"diagnostics-card"},E3={class:"diagnostics-list"},A3={class:"diagnostics-card diagnostics-wide"},T3={class:"diagnostics-list storage-list"},Pp=Re({__name:"DashboardView",setup(e){const t=Xh(),n=$2();function r(s){const i=new Date(s);return Number.isNaN(i.getTime())?s:i.toLocaleString()}return(s,i)=>(O(),j("section",w3,[i[10]||(i[10]=x("h1",null,"Dashboard",-1)),g(t).data.value?(O(),j("dl",S3,[x("div",null,[i[0]||(i[0]=x("dt",null,"Running apps",-1)),x("dd",null,Z(g(t).data.value.runningAppCount),1)]),x("div",null,[i[1]||(i[1]=x("dt",null,"Version",-1)),x("dd",null,Z(g(t).data.value.version),1)]),x("div",null,[i[2]||(i[2]=x("dt",null,"Started",-1)),x("dd",null,Z(r(g(t).data.value.startedAt)),1)])])):pe("",!0),g(n).data.value?(O(),j("section",x3,[x("div",k3,[i[7]||(i[7]=x("h2",null,"Runtime",-1)),x("dl",null,[x("div",null,[i[3]||(i[3]=x("dt",null,"Platform",-1)),x("dd",null,Z(g(n).data.value.runtime.platform)+" / "+Z(g(n).data.value.runtime.arch),1)]),x("div",null,[i[4]||(i[4]=x("dt",null,"Linux runtime",-1)),x("dd",null,Z(g(n).data.value.runtime.linuxRuntime?"ready":"unsupported"),1)]),x("div",null,[i[5]||(i[5]=x("dt",null,"Node",-1)),x("dd",null,Z(g(n).data.value.runtime.node),1)]),x("div",null,[i[6]||(i[6]=x("dt",null,"noVNC",-1)),x("dd",null,Z(g(n).data.value.noVnc.available?g(n).data.value.noVnc.root:"missing"),1)])])]),x("div",_3,[i[8]||(i[8]=x("h2",null,"Commands",-1)),x("ul",E3,[(O(!0),j(lt,null,Ht(g(n).data.value.commands,a=>(O(),j("li",{key:a.name},[x("span",{class:At(a.available?"dot-ok":"dot-bad")},null,2),x("div",null,[x("strong",null,Z(a.name),1),x("small",null,Z(a.available?a.path:a.requiredFor.join(", ")),1)])]))),128))])]),x("div",A3,[i[9]||(i[9]=x("h2",null,"Storage",-1)),x("ul",T3,[(O(!0),j(lt,null,Ht(g(n).data.value.storage,a=>(O(),j("li",{key:a.key},[x("span",{class:At(a.writable?"dot-ok":"dot-bad")},null,2),x("div",null,[x("strong",null,Z(a.key),1),x("small",null,Z(a.writable?"writable":"not writable")+" · "+Z(a.path),1)])]))),128))])])])):pe("",!0)]))}}),es=Re({__name:"Badge",props:{variant:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(n,r)=>(O(),j("div",{class:At(g(pt)(g(I3)({variant:e.variant}),t.class))},[Ve(n.$slots,"default")],2))}}),I3=g0("inline-flex gap-1 items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}}),Tr=Re({__name:"Card",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(n,r)=>(O(),j("div",{class:At(g(pt)("rounded-xl border bg-card text-card-foreground shadow",t.class))},[Ve(n.$slots,"default")],2))}}),An=Re({__name:"CardContent",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(n,r)=>(O(),j("div",{class:At(g(pt)("p-6 pt-0",t.class))},[Ve(n.$slots,"default")],2))}}),Li=Re({__name:"CardDescription",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(n,r)=>(O(),j("p",{class:At(g(pt)("text-sm text-muted-foreground",t.class))},[Ve(n.$slots,"default")],2))}}),S0=Re({__name:"CardFooter",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(n,r)=>(O(),j("div",{class:At(g(pt)("flex items-center p-6 pt-0",t.class))},[Ve(n.$slots,"default")],2))}}),Fi=Re({__name:"CardHeader",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(n,r)=>(O(),j("div",{class:At(g(pt)("flex flex-col gap-y-1.5 p-6",t.class))},[Ve(n.$slots,"default")],2))}}),Ui=Re({__name:"CardTitle",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(n,r)=>(O(),j("h3",{class:At(g(pt)("font-semibold leading-none tracking-tight",t.class))},[Ve(n.$slots,"default")],2))}}),Et=Re({__name:"Input",props:{defaultValue:{},modelValue:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,s=Th(n,"modelValue",t,{passive:!0,defaultValue:n.defaultValue});return(i,a)=>No((O(),j("input",{"onUpdate:modelValue":a[0]||(a[0]=o=>rs(s)?s.value=o:null),class:At(g(pt)("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",n.class))},null,2)),[[Mo,g(s)]])}}),lo=Re({__name:"Select",props:{open:{type:Boolean},defaultOpen:{type:Boolean},defaultValue:{},modelValue:{},by:{type:[String,Function]},dir:{},multiple:{type:Boolean},autocomplete:{},disabled:{type:Boolean},name:{},required:{type:Boolean}},emits:["update:modelValue","update:open"],setup(e,{emit:t}){const s=Wn(e,t);return(i,a)=>(O(),Se(g(sv),Cn(Qn(g(s))),{default:$(()=>[Ve(i.$slots,"default")]),_:3},16))}}),co=Re({inheritAttrs:!1,__name:"SelectContent",props:{forceMount:{type:Boolean},position:{default:"popper"},bodyLock:{type:Boolean},side:{},sideOffset:{},sideFlip:{type:Boolean},align:{},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},hideShiftedArrow:{type:Boolean},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},disableOutsidePointerEvents:{type:Boolean},class:{type:[Boolean,null,String,Object,Array]}},emits:["closeAutoFocus","escapeKeyDown","pointerDownOutside"],setup(e,{emit:t}){const n=e,r=t,s=Vt(n,"class"),i=Wn(s,r);return(a,o)=>(O(),Se(g(ov),null,{default:$(()=>[T(g(iv),It({...g(i),...a.$attrs},{class:g(pt)("relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e.position==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",n.class)}),{default:$(()=>[T(g(O3)),T(g(av),{class:At(g(pt)("p-1",e.position==="popper"&&"h-(--reka-select-trigger-height) w-full min-w-(--reka-select-trigger-width)"))},{default:$(()=>[Ve(a.$slots,"default")]),_:3},8,["class"]),T(g(C3))]),_:3},16,["class"])]),_:3}))}}),R3={class:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center"},Qr=Re({__name:"SelectItem",props:{value:{},disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,n=Vt(t,"class"),r=hr(n);return(s,i)=>(O(),Se(g(uv),It(g(r),{class:g(pt)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t.class)}),{default:$(()=>[x("span",R3,[T(g(lv),null,{default:$(()=>[T(g(Ep),{class:"h-4 w-4"})]),_:1})]),T(g(cv),null,{default:$(()=>[Ve(s.$slots,"default")]),_:3})]),_:3},16,["class"]))}}),C3=Re({__name:"SelectScrollDownButton",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,n=Vt(t,"class"),r=hr(n);return(s,i)=>(O(),Se(g(dv),It(g(r),{class:g(pt)("flex cursor-default items-center justify-center py-1",t.class)}),{default:$(()=>[Ve(s.$slots,"default",{},()=>[T(g(Ap))])]),_:3},16,["class"]))}}),O3=Re({__name:"SelectScrollUpButton",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,n=Vt(t,"class"),r=hr(n);return(s,i)=>(O(),Se(g(fv),It(g(r),{class:g(pt)("flex cursor-default items-center justify-center py-1",t.class)}),{default:$(()=>[Ve(s.$slots,"default",{},()=>[T(g(cy))])]),_:3},16,["class"]))}}),uo=Re({__name:"SelectTrigger",props:{disabled:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,n=Vt(t,"class"),r=hr(n);return(s,i)=>(O(),Se(g(pv),It(g(r),{class:g(pt)("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:truncate text-start",t.class)}),{default:$(()=>[Ve(s.$slots,"default"),T(g(hv),{"as-child":""},{default:$(()=>[T(g(Ap),{class:"w-4 h-4 opacity-50 shrink-0"})]),_:1})]),_:3},16,["class"]))}}),fo=Re({__name:"SelectValue",props:{placeholder:{},asChild:{type:Boolean},as:{}},setup(e){const t=e;return(n,r)=>(O(),Se(g(mv),Cn(Qn(t)),{default:$(()=>[Ve(n.$slots,"default")]),_:3},16))}}),or=Re({__name:"Textarea",props:{class:{type:[Boolean,null,String,Object,Array]},defaultValue:{},modelValue:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,s=Th(n,"modelValue",t,{passive:!0,defaultValue:n.defaultValue});return(i,a)=>No((O(),j("textarea",{"onUpdate:modelValue":a[0]||(a[0]=o=>rs(s)?s.value=o:null),class:At(g(pt)("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",n.class))},null,2)),[[Mo,g(s)]])}}),N3={class:"settings-pane"},M3={class:"section-head"},z3={key:0},$3={class:"custom-app-form"},D3={key:0,class:"display-fields"},P3={class:"catalog-actions"},B3={key:0,class:"form-error"},L3={class:"form-error"},F3={class:"settings-list"},U3={class:"catalog-head"},q3={class:"item-title"},H3={class:"item-meta"},V3={class:"catalog-actions"},j3=Re({__name:"CustomAppsSettings",setup(e){const t=ds(),n=np(),r=Oe("[]"),s=Oe(""),i=Oe(""),a=Yr({id:"",name:"",description:"",kind:"tty",command:"",args:"",cwd:"",envJson:"{}",width:"",height:"",depth:""}),o=we(()=>{const z=n.error.value;return z?`Custom app catalog is invalid: ${z instanceof Error?z.message:String(z)}`:""});pn(()=>n.data.value?.items,z=>{r.value=JSON.stringify(z||[],null,2)},{immediate:!0});function l(z,I,E){const _=z.trim();if(!_)return I;try{return JSON.parse(_)}catch(L){throw new Error(`${E} is invalid JSON: ${L instanceof Error?L.message:String(L)}`)}}function c(z){const I=z.trim();if(!I)return;const E=Number(I);if(!Number.isInteger(E)||E<=0)throw new Error("Display values must be positive integers.");return E}function u(z){return(z.match(/"[^"]*"|'[^']*'|\S+/g)||[]).map(E=>E.replace(/^(['"])(.*)\1$/,"$2"))}function f(){const z=JSON.parse(r.value||"[]");if(!Array.isArray(z))throw new Error("Custom Apps JSON must be an array.");return z}function m(){const z=a.id.trim(),I=a.name.trim(),E=a.command.trim();if(!z||!I||!E)throw new Error("Custom app id, name, and command are required.");const _={id:z,name:I,kind:a.kind,command:E};a.description.trim()&&(_.description=a.description.trim());const L=u(a.args);L.length&&(_.args=L),a.cwd.trim()&&(_.cwd=a.cwd.trim());const N=l(a.envJson,{},"Custom app env");if(!N||typeof N!="object"||Array.isArray(N)||Object.values(N).some(G=>typeof G!="string"))throw new Error("Custom app env JSON must be an object with string values.");if(Object.keys(N).length&&(_.env=N),a.kind==="gui"){const G={width:c(a.width),height:c(a.height),depth:c(a.depth)},D=Object.fromEntries(Object.entries(G).filter(([,W])=>W!==void 0));Object.keys(D).length&&(_.display=D)}return _}function h(){i.value="",Object.assign(a,{id:"",name:"",description:"",kind:"tty",command:"",args:"",cwd:"",envJson:"{}",width:"",height:"",depth:""})}function y(z){i.value=z.id,Object.assign(a,{id:z.id,name:z.name,description:z.description||"",kind:z.kind==="gui"?"gui":"tty",command:z.command||"",args:(z.args||[]).map(I=>/\s/.test(I)?JSON.stringify(I):I).join(" "),cwd:z.cwd||"",envJson:JSON.stringify(z.env||{},null,2),width:z.display?.width===void 0?"":String(z.display.width),height:z.display?.height===void 0?"":String(z.display.height),depth:z.display?.depth===void 0?"":String(z.display.depth)})}async function b(){s.value="";try{const z=f(),I=m();if(!i.value&&z.some(_=>_.id===I.id))throw new Error("Custom app id already exists.");if(i.value&&I.id!==i.value&&z.some(_=>_.id===I.id))throw new Error("Custom app id already exists.");const E=i.value?z.map(_=>_.id===i.value?I:_):[...z,I];await Ys(E),r.value=JSON.stringify(E,null,2),h(),await t.invalidateQueries({queryKey:["app-catalog"]}),await t.invalidateQueries({queryKey:["app-catalog-custom"]})}catch(z){s.value=z instanceof Error?z.message:String(z)}}async function S(z){s.value="";try{const I=f().filter(E=>E.id!==z);await Ys(I),r.value=JSON.stringify(I,null,2),i.value===z&&h(),await t.invalidateQueries({queryKey:["app-catalog"]}),await t.invalidateQueries({queryKey:["app-catalog-custom"]})}catch(I){s.value=I instanceof Error?I.message:String(I)}}function k(){s.value="",r.value=JSON.stringify(n.data.value?.items||[],null,2)}async function P(){s.value="";try{await Ys(f()),await t.invalidateQueries({queryKey:["app-catalog"]}),await t.invalidateQueries({queryKey:["app-catalog-custom"]})}catch(z){s.value=z instanceof Error?z.message:String(z)}}return(z,I)=>(O(),j("section",N3,[x("div",M3,[I[12]||(I[12]=x("h2",null,"Custom Apps",-1)),g(n).data.value?(O(),j("span",z3,Z(g(n).data.value.path),1)):pe("",!0)]),T(g(Tr),null,{default:$(()=>[T(g(An),null,{default:$(()=>[x("div",$3,[T(g(Et),{modelValue:a.id,"onUpdate:modelValue":I[0]||(I[0]=E=>a.id=E),placeholder:"id"},null,8,["modelValue"]),T(g(Et),{modelValue:a.name,"onUpdate:modelValue":I[1]||(I[1]=E=>a.name=E),placeholder:"name"},null,8,["modelValue"]),T(g(or),{modelValue:a.description,"onUpdate:modelValue":I[2]||(I[2]=E=>a.description=E),class:"launch-json",spellcheck:"false",placeholder:"description"},null,8,["modelValue"]),T(g(lo),{modelValue:a.kind,"onUpdate:modelValue":I[3]||(I[3]=E=>a.kind=E)},{default:$(()=>[T(g(uo),{class:"native-select"},{default:$(()=>[T(g(fo),{placeholder:"App kind"})]),_:1}),T(g(co),null,{default:$(()=>[T(g(Qr),{value:"tty"},{default:$(()=>[...I[13]||(I[13]=[fe("TTY",-1)])]),_:1}),T(g(Qr),{value:"gui"},{default:$(()=>[...I[14]||(I[14]=[fe("GUI",-1)])]),_:1})]),_:1})]),_:1},8,["modelValue"]),T(g(Et),{modelValue:a.command,"onUpdate:modelValue":I[4]||(I[4]=E=>a.command=E),placeholder:"/usr/bin/app"},null,8,["modelValue"]),T(g(Et),{modelValue:a.args,"onUpdate:modelValue":I[5]||(I[5]=E=>a.args=E),placeholder:'args, e.g. --new-window "https://example.com"'},null,8,["modelValue"]),T(g(Et),{modelValue:a.cwd,"onUpdate:modelValue":I[6]||(I[6]=E=>a.cwd=E),placeholder:"/workspace"},null,8,["modelValue"]),T(g(or),{modelValue:a.envJson,"onUpdate:modelValue":I[7]||(I[7]=E=>a.envJson=E),class:"launch-json",spellcheck:"false",placeholder:'env JSON, e.g. {"LANG":"C.UTF-8"}'},null,8,["modelValue"]),a.kind==="gui"?(O(),j("div",D3,[T(g(Et),{modelValue:a.width,"onUpdate:modelValue":I[8]||(I[8]=E=>a.width=E),inputmode:"numeric",placeholder:"width"},null,8,["modelValue"]),T(g(Et),{modelValue:a.height,"onUpdate:modelValue":I[9]||(I[9]=E=>a.height=E),inputmode:"numeric",placeholder:"height"},null,8,["modelValue"]),T(g(Et),{modelValue:a.depth,"onUpdate:modelValue":I[10]||(I[10]=E=>a.depth=E),inputmode:"numeric",placeholder:"depth"},null,8,["modelValue"])])):pe("",!0),x("div",P3,[T(g(nt),{size:"sm",onClick:b},{default:$(()=>[fe(Z(i.value?"Update App":"Add App"),1)]),_:1}),i.value?(O(),Se(g(nt),{key:0,variant:"outline",size:"sm",onClick:h},{default:$(()=>[...I[15]||(I[15]=[fe("Cancel",-1)])]),_:1})):pe("",!0)])])]),_:1}),T(g(An),null,{default:$(()=>[T(g(or),{modelValue:r.value,"onUpdate:modelValue":I[11]||(I[11]=E=>r.value=E),class:"catalog-json",spellcheck:"false"},null,8,["modelValue"]),o.value?(O(),j("p",B3,Z(o.value),1)):pe("",!0)]),_:1}),T(g(S0),{class:"editor-actions"},{default:$(()=>[T(g(nt),{variant:"outline",size:"sm",onClick:k},{default:$(()=>[...I[16]||(I[16]=[fe("Reset",-1)])]),_:1}),T(g(nt),{size:"sm",onClick:P},{default:$(()=>[...I[17]||(I[17]=[fe("Save",-1)])]),_:1})]),_:1}),s.value?(O(),Se(g(An),{key:0},{default:$(()=>[x("p",L3,Z(s.value),1)]),_:1})):pe("",!0)]),_:1}),x("div",F3,[(O(!0),j(lt,null,Ht(g(n).data.value?.items||[],E=>(O(),Se(g(Tr),{key:E.id},{default:$(()=>[T(g(An),{class:"catalog-item"},{default:$(()=>[x("div",U3,[x("div",null,[x("div",q3,Z(E.name),1),x("div",H3,[T(g(es),{variant:"secondary"},{default:$(()=>[fe(Z(E.kind),1)]),_:2},1024),x("span",null,Z(E.command),1)])]),x("div",V3,[T(g(nt),{variant:"outline",size:"sm",onClick:_=>y(E)},{default:$(()=>[...I[18]||(I[18]=[fe("Edit",-1)])]),_:1},8,["onClick"]),T(g(nt),{variant:"outline",size:"sm",onClick:_=>S(E.id)},{default:$(()=>[...I[19]||(I[19]=[fe("Remove",-1)])]),_:1},8,["onClick"])])])]),_:2},1024)]),_:2},1024))),128))])]))}}),G3={class:"settings-pane"},Z3={class:"section-head"},K3={class:"section-actions"},W3={class:"settings-list"},Q3={class:"session-actions"},J3={key:0,class:"session-error"},Y3={class:"session-metadata"},X3={key:0},e5={key:1},t5={key:2},n5={key:0},r5={key:1},s5={key:3},i5={key:0},a5=Re({__name:"SessionsSettings",setup(e){const t=ds(),n=di(),r=fi(),s=Oe(!1),i=we(()=>(n.data.value||[]).filter(c)),a=we(()=>s.value?n.data.value||[]:(n.data.value||[]).filter(b=>!c(b)));function o(b){const S=new Date(b);return Number.isNaN(S.getTime())?b:S.toLocaleString()}function l(b){return b.status==="running"&&(b.kind==="tty"||b.kind==="gui"&&!!b.vnc)}function c(b){return b.error?.code==="APP_SESSION_RESTORED_WITHOUT_PROCESS"}function u(b){if(!l(b)){f(b);return}r.open(da(b))}function f(b){r.open({type:"logs",id:`logs:${b.id}`,sessionId:b.id,title:`${b.title} logs`})}async function m(b){await Cs(b),await t.invalidateQueries({queryKey:["status"]})}async function h(b){const S=await m0(b);u(S),await t.invalidateQueries({queryKey:["status"]})}async function y(b){await ip(b);const S=(n.data.value||[]).filter(k=>k.id!==b);r.pruneSession(new Set(S.map(k=>k.id)),ti(S)),await t.invalidateQueries({queryKey:["status"]})}return(b,S)=>(O(),j("section",G3,[x("div",Z3,[S[1]||(S[1]=x("h2",null,"Sessions",-1)),x("div",K3,[x("span",null,Z(a.value.length)+" sessions",1),i.value.length?(O(),Se(g(nt),{key:0,variant:"outline",size:"sm",onClick:S[0]||(S[0]=k=>s.value=!s.value)},{default:$(()=>[fe(Z(s.value?"Hide restored":`Show restored (${i.value.length})`),1)]),_:1})):pe("",!0)])]),x("div",W3,[(O(!0),j(lt,null,Ht(a.value,k=>(O(),Se(g(Tr),{key:k.id},{default:$(()=>[T(g(Fi),{class:"session-header"},{default:$(()=>[x("div",null,[T(g(Ui),null,{default:$(()=>[fe(Z(k.title),1)]),_:2},1024),T(g(Li),null,{default:$(()=>[fe(Z(k.appId)+" · "+Z(o(k.updatedAt)),1)]),_:2},1024)]),x("div",Q3,[T(g(es),{variant:k.status==="running"?"default":"secondary"},{default:$(()=>[fe(Z(k.status),1)]),_:2},1032,["variant"]),T(g(nt),{variant:"outline",size:"sm",disabled:k.status!=="running",onClick:P=>m(k.id)},{default:$(()=>[...S[2]||(S[2]=[fe("Stop",-1)])]),_:1},8,["disabled","onClick"]),T(g(nt),{variant:"outline",size:"sm",onClick:P=>h(k.id)},{default:$(()=>[...S[3]||(S[3]=[fe("Restart",-1)])]),_:1},8,["onClick"]),T(g(nt),{variant:"outline",size:"sm",disabled:!l(k),onClick:P=>u(k)},{default:$(()=>[...S[4]||(S[4]=[fe("Open",-1)])]),_:1},8,["disabled","onClick"]),T(g(nt),{variant:"outline",size:"sm",onClick:P=>f(k)},{default:$(()=>[...S[5]||(S[5]=[fe("Logs",-1)])]),_:1},8,["onClick"]),T(g(nt),{variant:"outline",size:"sm",onClick:P=>y(k.id)},{default:$(()=>[...S[6]||(S[6]=[fe("Delete",-1)])]),_:1},8,["onClick"])])]),_:2},1024),T(g(An),null,{default:$(()=>[k.error?(O(),j("p",J3,Z(k.error.code)+": "+Z(k.error.message),1)):pe("",!0),x("dl",Y3,[k.tty?.cwd||k.launch?.cwd?(O(),j("div",X3,[S[7]||(S[7]=x("dt",null,"CWD",-1)),x("dd",null,Z(k.launch?.cwd||k.tty?.cwd),1)])):pe("",!0),k.display?(O(),j("div",e5,[S[8]||(S[8]=x("dt",null,"Display",-1)),x("dd",null,Z(k.display.display)+" "+Z(k.display.width)+"x"+Z(k.display.height)+"x"+Z(k.display.depth),1)])):pe("",!0),k.vnc?(O(),j("div",t5,[S[9]||(S[9]=x("dt",null,"Ports",-1)),x("dd",null,[fe(Z(k.vnc.backend==="kasmvnc"?"kasmvnc":"vnc")+" "+Z(k.vnc.port),1),k.vnc.websockifyPort?(O(),j("span",n5," · ws "+Z(k.vnc.websockifyPort),1)):pe("",!0),k.automation?(O(),j("span",r5," · cdp "+Z(k.automation.port),1)):pe("",!0)])])):pe("",!0),k.process?(O(),j("div",s5,[S[10]||(S[10]=x("dt",null,"Process",-1)),x("dd",null,[fe(Z(k.process.command),1),k.process.pid?(O(),j("span",i5," · pid "+Z(k.process.pid),1)):pe("",!0)])])):pe("",!0)])]),_:2},1024)]),_:2},1024))),128))])]))}}),o5={class:"modal-header"},l5={class:"settings-content-inner"},c5=Re({__name:"SettingsModal",props:{section:{}},emits:["close"],setup(e){const t=e,n=Oe(t.section||"general"),r=[{id:"general",label:"General"},{id:"apps",label:"Apps"},{id:"sessions",label:"Sessions"}];function s(i){n.value=String(i)}return pn(()=>t.section,i=>{n.value=i||"general"}),(i,a)=>(O(),Se(g(Mp),{open:!0,"onUpdate:open":a[0]||(a[0]=o=>!o&&i.$emit("close"))},{default:$(()=>[T(g(zp),{class:"settings-modal gap-0 p-0",style:{width:"min(1280px, calc(100vw - 48px))","max-width":"calc(100vw - 48px)"}},{default:$(()=>[x("header",o5,[T(g(Dp),null,{default:$(()=>[...a[1]||(a[1]=[fe("Settings",-1)])]),_:1}),T(g($p),{class:"sr-only"},{default:$(()=>[...a[2]||(a[2]=[fe("Configure the controlled instance runtime, applications, and sessions.",-1)])]),_:1})]),T(g(g3),{"model-value":n.value,class:"settings-modal-body",orientation:"vertical","onUpdate:modelValue":s},{default:$(()=>[T(g(v3),{class:"settings-nav"},{default:$(()=>[(O(),j(lt,null,Ht(r,o=>T(g(y3),{key:o.id,value:o.id,class:At({active:n.value===o.id}),onClick:l=>n.value=o.id},{default:$(()=>[fe(Z(o.label),1)]),_:2},1032,["value","class","onClick"])),64))]),_:1}),T(g(In),{class:"settings-content"},{default:$(()=>[x("main",l5,[T(g(kl),{value:"general"},{default:$(()=>[T(Pp)]),_:1}),T(g(kl),{value:"apps"},{default:$(()=>[T(j3)]),_:1}),T(g(kl),{value:"sessions"},{default:$(()=>[T(a5)]),_:1})])]),_:1})]),_:1},8,["model-value"])]),_:1})]),_:1}))}}),u5={class:"logs-panel"},d5={class:"logs-meta"},f5={key:0,class:"logs-empty"},h5={key:1,class:"logs-empty"},Bp=Re({__name:"SessionLogs",props:{session:{}},setup(e){const n=Z2(e.session.id);function r(s){return s<1024?`${s} B`:s<1024*1024?`${(s/1024).toFixed(1)} KB`:`${(s/1024/1024).toFixed(1)} MB`}return(s,i)=>(O(),j("div",u5,[x("div",d5,Z(g(n).data.value?.logDir||e.session.paths.logDir),1),g(n).isLoading.value?(O(),j("div",f5,"Loading logs...")):g(n).data.value?.files.length?(O(!0),j(lt,{key:2},Ht(g(n).data.value?.files||[],a=>(O(),j("section",{key:a.name,class:"log-file"},[x("header",null,[x("strong",null,Z(a.name),1),x("span",null,[fe(Z(r(a.size))+" · "+Z(a.updatedAt),1),a.truncated?(O(),j(lt,{key:0},[fe(" · tail")],64)):pe("",!0)])]),T(g(In),{class:"log-file-content"},{default:$(()=>[x("pre",null,Z(a.content||"(empty)"),1)]),_:2},1024)]))),128)):(O(),j("div",h5,"No log files yet."))]))}}),p5={class:"terminal-panel"},m5={class:"terminal-canvas-shell"},g5={class:"terminal-status"},Lp=Re({__name:"TerminalSession",props:{session:{}},setup(e){const t=e,n=$s(),r=Oe(null),s=Oe("connecting");let i,a,o,l,c,u,f=!1;const m=we(()=>Hh(`/api/apps/sessions/${t.session.id}/tty`,n.token));function h(){f||!i||o?.readyState!==WebSocket.OPEN||o.send(JSON.stringify({type:"resize",cols:i.cols,rows:i.rows}))}function y(){if(!f)try{a?.fit(),i&&i.rows>0&&i.refresh(0,i.rows-1),h()}catch{}}function b(){c!==void 0&&window.cancelAnimationFrame(c),u!==void 0&&window.clearTimeout(u);const z=()=>{c=void 0,y()};c=window.requestAnimationFrame(z),u=window.setTimeout(()=>{u=void 0,y()},80)}function S(){const z=window.getComputedStyle(document.documentElement);return{background:z.getPropertyValue("--terminal-surface").trim(),foreground:z.getPropertyValue("--terminal-text").trim(),cursor:z.getPropertyValue("--text").trim(),selectionBackground:z.getPropertyValue("--terminal-selection").trim()}}function k(){c!==void 0&&(window.cancelAnimationFrame(c),c=void 0),u!==void 0&&(window.clearTimeout(u),u=void 0),l?.disconnect(),l=void 0,o?.close(),o=void 0,i?.dispose(),i=void 0,a=void 0}async function P(){k(),await ur(),r.value&&(i=new Sv({cursorBlink:!0,convertEol:!0,fontFamily:'ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace',fontSize:13,theme:S()}),a=new kv,i.loadAddon(a),i.loadAddon(new xv),i.open(r.value),b(),o=new WebSocket(m.value),o.addEventListener("open",()=>{s.value="connected",b()}),o.addEventListener("message",z=>{const I=JSON.parse(String(z.data||"{}"));I.type==="snapshot"?(f=!0,Number.isInteger(I.cols)&&Number.isInteger(I.rows)&&I.cols>0&&I.rows>0&&i?.resize(I.cols,I.rows),i?.reset(),i?.write(`${String(I.data||"")}${String(I.pendingEscape||"")}`,()=>{f=!1,b()})):I.type==="output"?i?.write(String(I.data||"")):I.type==="connected"?s.value="connected":I.type==="exit"?(s.value="exited",i?.writeln(`\r
|
|
1
|
+
import{_ as xh,a5 as ss,a4 as kh,at as N4,ai as Xr,a9 as ur,au as _h,a7 as Eh,al as Oe,$ as z4,af as Ah,O as Se,a3 as Cr,aD as on,a2 as Th,av as g,ap as Ih,aq as $4,ak as D4,Z as Re,ag as O,U as xe,aF as D,an as Ve,aa as At,P as P4,aj as Vt,p as B4,a8 as It,Y as T,q as L4,o as F4,r as U4,S as q4,az as Wn,N as H4,ab as On,a0 as Qn,ah as Qa,M as V4,ay as hr,L as j4,a1 as Wi,c as G4,b as Z4,C as K4,a as W4,d as Q4,e as J4,m as Y4,l as X4,H as ev,n as tv,W as j,F as lt,am as Ht,R as k,ao as js,as as K,V as pe,aI as en,j as nv,h as rv,f as sv,D as iv,i as av,g as ov,k as lv,J as cv,T as uv,I as dv,K as fv,aB as Rh,aG as Mo,aC as No,y as hv,s as pv,G as mv,x as gv,u as vv,v as bv,w as yv,z as wv,A as Sv,t as xv,B as kv,E as _v,X as fe,ad as zo,ae as nc,ax as Ev,aH as Qs,aE as Bn,aw as Av,ac as Ja,a6 as _i,aA as Tv,ar as Iv,Q as Rv}from"./ui-vendor-CYGfnfwU.js";import{D as Cv,L as Ov,o as Mv}from"./xterm-C0x2rdqx.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();let Ch;const $o=e=>Ch=e,Oh=Symbol();function rc(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}var Bi;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(Bi||(Bi={}));function Nv(){const e=xh(!0),t=e.run(()=>Oe({}));let n=[],r=[];const s=Eh({install(i){$o(s),s._a=i,i.provide(Oh,s),i.config.globalProperties.$pinia=s,r.forEach(a=>n.push(a)),r=[]},use(i){return this._a?n.push(i):r.push(i),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return s}const Mh=()=>{};function Bu(e,t,n,r=Mh){e.add(t);const s=()=>{e.delete(t)&&r()};return!n&&z4()&&Ah(s),s}function qs(e,...t){e.forEach(n=>{n(...t)})}const zv=e=>e(),Lu=Symbol(),vl=Symbol();function sc(e,t){e instanceof Map&&t instanceof Map?t.forEach((n,r)=>e.set(r,n)):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const n in t){if(!t.hasOwnProperty(n))continue;const r=t[n],s=e[n];rc(s)&&rc(r)&&e.hasOwnProperty(n)&&!ss(r)&&!kh(r)?e[n]=sc(s,r):e[n]=r}return e}const $v=Symbol();function Dv(e){return!rc(e)||!Object.prototype.hasOwnProperty.call(e,$v)}const{assign:Kr}=Object;function Pv(e){return!!(ss(e)&&e.effect)}function Bv(e,t,n,r){const{state:s,actions:i,getters:a}=t,o=n.state.value[e];let l;function c(){o||(n.state.value[e]=s?s():{});const u=_h(n.state.value[e]);return Kr(u,i,Object.keys(a||{}).reduce((p,m)=>(p[m]=Eh(Se(()=>{$o(n);const f=n._s.get(e);return a[m].call(f,f)})),p),{}))}return l=Nh(e,c,t,n,r,!0),l}function Nh(e,t,n={},r,s,i){let a;const o=Kr({actions:{}},n),l={deep:!0};let c,u,p=new Set,m=new Set,f;const y=r.state.value[e];!i&&!y&&(r.state.value[e]={});let b;function x(M){let G;c=u=!1,typeof M=="function"?(M(r.state.value[e]),G={type:Bi.patchFunction,storeId:e,events:f}):(sc(r.state.value[e],M),G={type:Bi.patchObject,payload:M,storeId:e,events:f});const P=b=Symbol();ur().then(()=>{b===P&&(c=!0)}),u=!0,qs(p,G,r.state.value[e])}const S=i?function(){const{state:G}=n,P=G?G():{};this.$patch(W=>{Kr(W,P)})}:Mh;function N(){a.stop(),p.clear(),m.clear(),r._s.delete(e)}const z=(M,G="")=>{if(Lu in M)return M[vl]=G,M;const P=function(){$o(r);const W=Array.from(arguments),q=new Set,X=new Set;function ne(se){q.add(se)}function he(se){X.add(se)}qs(m,{args:W,name:P[vl],store:E,after:ne,onError:he});let Ae;try{Ae=M.apply(this&&this.$id===e?this:E,W)}catch(se){throw qs(X,se),se}return Ae instanceof Promise?Ae.then(se=>(qs(q,se),se)).catch(se=>(qs(X,se),Promise.reject(se))):(qs(q,Ae),Ae)};return P[Lu]=!0,P[vl]=G,P},I={_p:r,$id:e,$onAction:Bu.bind(null,m),$patch:x,$reset:S,$subscribe(M,G={}){const P=Bu(p,M,G.detached,()=>W()),W=a.run(()=>on(()=>r.state.value[e],q=>{(G.flush==="sync"?u:c)&&M({storeId:e,type:Bi.direct,events:f},q)},Kr({},l,G)));return P},$dispose:N},E=Xr(I);r._s.set(e,E);const L=(r._a&&r._a.runWithContext||zv)(()=>r._e.run(()=>(a=xh()).run(()=>t({action:z}))));for(const M in L){const G=L[M];if(ss(G)&&!Pv(G)||kh(G))i||(y&&Dv(G)&&(ss(G)?G.value=y[M]:sc(G,y[M])),r.state.value[e][M]=G);else if(typeof G=="function"){const P=z(G,M);L[M]=P,o.actions[M]=G}}return Kr(E,L),Kr(N4(E),L),Object.defineProperty(E,"$state",{get:()=>r.state.value[e],set:M=>{x(G=>{Kr(G,M)})}}),r._p.forEach(M=>{Kr(E,a.run(()=>M({store:E,app:r._a,pinia:r,options:o})))}),y&&i&&n.hydrate&&n.hydrate(E.$state,y),c=!0,u=!0,E}function l0(e,t,n){let r;const s=typeof t=="function";r=s?n:t;function i(a,o){const l=Th();return a=a||(l?Cr(Oh,null):null),a&&$o(a),a=Ch,a._s.has(e)||(s?Nh(e,t,r,a):Bv(e,r,a)),a._s.get(e)}return i.$id=e,i}var ua=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Lv=class extends ua{#n;#t;#r;constructor(){super(),this.#r=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#n!==e&&(this.#n=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#n=="boolean"?this.#n:globalThis.document?.visibilityState!=="hidden"}},c0=new Lv,Fv={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Uv=class{#n=Fv;#t=!1;setTimeoutProvider(e){this.#n=e}setTimeout(e,t){return this.#n.setTimeout(e,t)}clearTimeout(e){this.#n.clearTimeout(e)}setInterval(e,t){return this.#n.setInterval(e,t)}clearInterval(e){this.#n.clearInterval(e)}},As=new Uv;function qv(e){setTimeout(e,0)}var Hv=typeof window>"u"||"Deno"in globalThis;function Pn(){}function Vv(e,t){return typeof e=="function"?e(t):e}function ic(e){return typeof e=="number"&&e>=0&&e!==1/0}function zh(e,t){return Math.max(e+(t||0)-Date.now(),0)}function es(e,t){return typeof e=="function"?e(t):e}function En(e,t){return typeof e=="function"?e(t):e}function Fu(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:a,stale:o}=e;if(a){if(r){if(t.queryHash!==u0(a,t.options))return!1}else if(!Ji(t.queryKey,a))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof o=="boolean"&&t.isStale()!==o||s&&s!==t.state.fetchStatus||i&&!i(t))}function Uu(e,t){const{exact:n,status:r,predicate:s,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(Qi(t.options.mutationKey)!==Qi(i))return!1}else if(!Ji(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function u0(e,t){return(t?.queryKeyHashFn||Qi)(e)}function Qi(e){return JSON.stringify(e,(t,n)=>oc(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Ji(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Ji(e[n],t[n])):!1}var jv=Object.prototype.hasOwnProperty;function $h(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=qu(e)&&qu(t);if(!r&&!(oc(e)&&oc(t)))return t;const i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,l=r?new Array(o):{};let c=0;for(let u=0;u<o;u++){const p=r?u:a[u],m=e[p],f=t[p];if(m===f){l[p]=m,(r?u<i:jv.call(e,p))&&c++;continue}if(m===null||f===null||typeof m!="object"||typeof f!="object"){l[p]=f;continue}const y=$h(m,f,n+1);l[p]=y,y===m&&c++}return i===o&&c===i?e:l}function ac(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function qu(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function oc(e){if(!Hu(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Hu(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Hu(e){return Object.prototype.toString.call(e)==="[object Object]"}function Gv(e){return new Promise(t=>{As.setTimeout(t,e)})}function lc(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?$h(e,t):t}function Zv(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Kv(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var d0=Symbol();function Dh(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===d0?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Vu(e,t){return typeof e=="function"?e(...t):!!e}function Wv(e,t,n){let r=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??=t(),r||(r=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),e}var Yi=(()=>{let e=()=>Hv;return{isServer(){return e()},setIsServer(t){e=t}}})();function cc(){let e,t;const n=new Promise((s,i)=>{e=s,t=i});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),e(s)},n.reject=s=>{r({status:"rejected",reason:s}),t(s)},n}var Qv=qv;function Jv(){let e=[],t=0,n=o=>{o()},r=o=>{o()},s=Qv;const i=o=>{t?e.push(o):s(()=>{n(o)})},a=()=>{const o=e;e=[],o.length&&s(()=>{r(()=>{o.forEach(l=>{n(l)})})})};return{batch:o=>{let l;t++;try{l=o()}finally{t--,t||a()}return l},batchCalls:o=>(...l)=>{i(()=>{o(...l)})},schedule:i,setNotifyFunction:o=>{n=o},setBatchNotifyFunction:o=>{r=o},setScheduler:o=>{s=o}}}var an=Jv(),Yv=class extends ua{#n=!0;#t;#r;constructor(){super(),this.#r=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#n!==e&&(this.#n=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#n}},so=new Yv;function Xv(e){return Math.min(1e3*2**e,3e4)}function Ph(e){return(e??"online")==="online"?so.isOnline():!0}var uc=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Bh(e){let t=!1,n=0,r;const s=cc(),i=()=>s.status!=="pending",a=b=>{if(!i()){const x=new uc(b);m(x),e.onCancel?.(x)}},o=()=>{t=!0},l=()=>{t=!1},c=()=>c0.isFocused()&&(e.networkMode==="always"||so.isOnline())&&e.canRun(),u=()=>Ph(e.networkMode)&&e.canRun(),p=b=>{i()||(r?.(),s.resolve(b))},m=b=>{i()||(r?.(),s.reject(b))},f=()=>new Promise(b=>{r=x=>{(i()||c())&&b(x)},e.onPause?.()}).then(()=>{r=void 0,i()||e.onContinue?.()}),y=()=>{if(i())return;let b;const x=n===0?e.initialPromise:void 0;try{b=x??e.fn()}catch(S){b=Promise.reject(S)}Promise.resolve(b).then(p).catch(S=>{if(i())return;const N=e.retry??(Yi.isServer()?0:3),z=e.retryDelay??Xv,I=typeof z=="function"?z(n,S):z,E=N===!0||typeof N=="number"&&n<N||typeof N=="function"&&N(n,S);if(t||!E){m(S);return}n++,e.onFail?.(n,S),Gv(I).then(()=>c()?void 0:f()).then(()=>{t?m(S):y()})})};return{promise:s,status:()=>s.status,cancel:a,continue:()=>(r?.(),s),cancelRetry:o,continueRetry:l,canStart:u,start:()=>(u()?y():f().then(y),s)}}var Lh=class{#n;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ic(this.gcTime)&&(this.#n=As.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Yi.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#n!==void 0&&(As.clearTimeout(this.#n),this.#n=void 0)}};function e2(e){return{onFetch:(t,n)=>{const r=t.options,s=t.fetchOptions?.meta?.fetchMore?.direction,i=t.state.data?.pages||[],a=t.state.data?.pageParams||[];let o={pages:[],pageParams:[]},l=0;const c=async()=>{let u=!1;const p=y=>{Wv(y,()=>t.signal,()=>u=!0)},m=Dh(t.options,t.fetchOptions),f=async(y,b,x)=>{if(u)return Promise.reject(t.signal.reason);if(b==null&&y.pages.length)return Promise.resolve(y);const N=(()=>{const _={client:t.client,queryKey:t.queryKey,pageParam:b,direction:x?"backward":"forward",meta:t.options.meta};return p(_),_})(),z=await m(N),{maxPages:I}=t.options,E=x?Kv:Zv;return{pages:E(y.pages,z,I),pageParams:E(y.pageParams,b,I)}};if(s&&i.length){const y=s==="backward",b=y?t2:ju,x={pages:i,pageParams:a},S=b(r,x);o=await f(x,S,y)}else{const y=e??i.length;do{const b=l===0?a[0]??r.initialPageParam:ju(r,o);if(l>0&&b==null)break;o=await f(o,b),l++}while(l<y)}return o};t.options.persister?t.fetchFn=()=>t.options.persister?.(c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=c}}}function ju(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function t2(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var n2=class extends Lh{#n;#t;#r;#s;#e;#i;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#e=e.client,this.#s=this.#e.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=Zu(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#n}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#a,...e},e?._type&&(this.#n=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=Zu(this.options);t.data!==void 0&&(this.setState(Gu(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#s.remove(this)}setData(e,t){const n=lc(this.state.data,e,this.options);return this.#l({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:"setState",state:e})}cancel(e){const t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(Pn).catch(Pn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>En(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===d0||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>es(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!zh(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#i&&(this.#o||this.#d()?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#s.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#d(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#l({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#i?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(e&&this.setOptions(e),!this.options.queryFn){const l=this.observers.find(c=>c.options.queryFn);l&&this.setOptions(l.options)}const n=new AbortController,r=l=>{Object.defineProperty(l,"signal",{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},s=()=>{const l=Dh(this.options,t),u=(()=>{const p={client:this.#e,queryKey:this.queryKey,meta:this.meta};return r(p),p})();return this.#o=!1,this.options.persister?this.options.persister(l,u,this):l(u)},a=(()=>{const l={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#e,state:this.state,fetchFn:s};return r(l),l})();(this.#n==="infinite"?e2(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#r=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:"fetch",meta:a.fetchOptions?.meta}),this.#i=Bh({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:l=>{l instanceof uc&&l.revert&&this.setState({...this.#r,fetchStatus:"idle"}),n.abort()},onFail:(l,c)=>{this.#l({type:"failed",failureCount:l,error:c})},onPause:()=>{this.#l({type:"pause"})},onContinue:()=>{this.#l({type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{const l=await this.#i.start();if(l===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(l),this.#s.config.onSuccess?.(l,this),this.#s.config.onSettled?.(l,this.state.error,this),l}catch(l){if(l instanceof uc){if(l.silent)return this.#i.promise;if(l.revert){if(this.state.data===void 0)throw l;return this.state.data}}throw this.#l({type:"error",error:l}),this.#s.config.onError?.(l,this),this.#s.config.onSettled?.(this.state.data,l,this),l}finally{this.scheduleGc()}}#l(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Fh(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...Gu(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#r=e.manual?r:void 0,r;case"error":const s=e.error;return{...n,error:s,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),an.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#s.notify({query:this,type:"updated",action:e})})}};function Fh(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ph(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Gu(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Zu(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var r2=class extends ua{constructor(e,t){super(),this.options=t,this.#n=e,this.#o=null,this.#a=cc(),this.bindMethods(),this.setOptions(t)}#n;#t=void 0;#r=void 0;#s=void 0;#e;#i;#a;#o;#d;#l;#p;#f;#c;#h;#g=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Ku(this.#t,this.options)?this.#u():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return dc(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return dc(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#w(),this.#S(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,n=this.#t;if(this.options=this.#n.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof En(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#x(),this.#t.setOptions(this.options),t._defaulted&&!ac(this.options,t)&&this.#n.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&Wu(this.#t,n,this.options,t)&&this.#u(),this.updateResult(),r&&(this.#t!==n||En(this.options.enabled,this.#t)!==En(t.enabled,this.#t)||es(this.options.staleTime,this.#t)!==es(t.staleTime,this.#t))&&this.#m();const s=this.#v();r&&(this.#t!==n||En(this.options.enabled,this.#t)!==En(t.enabled,this.#t)||s!==this.#h)&&this.#b(s)}getOptimisticResult(e){const t=this.#n.getQueryCache().build(this.#n,e),n=this.createResult(t,e);return i2(this,n)&&(this.#s=n,this.#i=this.options,this.#e=this.#t.state),n}getCurrentResult(){return this.#s}trackResult(e,t){return new Proxy(e,{get:(n,r)=>(this.trackProp(r),t?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#a.status==="pending"&&this.#a.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,r))})}trackProp(e){this.#g.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#n.defaultQueryOptions(e),n=this.#n.getQueryCache().build(this.#n,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#u({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#s))}#u(e){this.#x();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Pn)),t}#m(){this.#w();const e=es(this.options.staleTime,this.#t);if(Yi.isServer()||this.#s.isStale||!ic(e))return;const n=zh(this.#s.dataUpdatedAt,e)+1;this.#f=As.setTimeout(()=>{this.#s.isStale||this.updateResult()},n)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#b(e){this.#S(),this.#h=e,!(Yi.isServer()||En(this.options.enabled,this.#t)===!1||!ic(this.#h)||this.#h===0)&&(this.#c=As.setInterval(()=>{(this.options.refetchIntervalInBackground||c0.isFocused())&&this.#u()},this.#h))}#y(){this.#m(),this.#b(this.#v())}#w(){this.#f!==void 0&&(As.clearTimeout(this.#f),this.#f=void 0)}#S(){this.#c!==void 0&&(As.clearInterval(this.#c),this.#c=void 0)}createResult(e,t){const n=this.#t,r=this.options,s=this.#s,i=this.#e,a=this.#i,l=e!==n?e.state:this.#r,{state:c}=e;let u={...c},p=!1,m;if(t._optimisticResults){const M=this.hasListeners(),G=!M&&Ku(e,t),P=M&&Wu(e,n,t,r);(G||P)&&(u={...u,...Fh(c.data,e.options)}),t._optimisticResults==="isRestoring"&&(u.fetchStatus="idle")}let{error:f,errorUpdatedAt:y,status:b}=u;m=u.data;let x=!1;if(t.placeholderData!==void 0&&m===void 0&&b==="pending"){let M;s?.isPlaceholderData&&t.placeholderData===a?.placeholderData?(M=s.data,x=!0):M=typeof t.placeholderData=="function"?t.placeholderData(this.#p?.state.data,this.#p):t.placeholderData,M!==void 0&&(b="success",m=lc(s?.data,M,t),p=!0)}if(t.select&&m!==void 0&&!x)if(s&&m===i?.data&&t.select===this.#d)m=this.#l;else try{this.#d=t.select,m=t.select(m),m=lc(s?.data,m,t),this.#l=m,this.#o=null}catch(M){this.#o=M}this.#o&&(f=this.#o,m=this.#l,y=Date.now(),b="error");const S=u.fetchStatus==="fetching",N=b==="pending",z=b==="error",I=N&&S,E=m!==void 0,L={status:b,fetchStatus:u.fetchStatus,isPending:N,isSuccess:b==="success",isError:z,isInitialLoading:I,isLoading:I,data:m,dataUpdatedAt:u.dataUpdatedAt,error:f,errorUpdatedAt:y,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:u.dataUpdateCount>l.dataUpdateCount||u.errorUpdateCount>l.errorUpdateCount,isFetching:S,isRefetching:S&&!N,isLoadingError:z&&!E,isPaused:u.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:z&&E,isStale:f0(e,t),refetch:this.refetch,promise:this.#a,isEnabled:En(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const M=L.data!==void 0,G=L.status==="error"&&!M,P=X=>{G?X.reject(L.error):M&&X.resolve(L.data)},W=()=>{const X=this.#a=L.promise=cc();P(X)},q=this.#a;switch(q.status){case"pending":e.queryHash===n.queryHash&&P(q);break;case"fulfilled":(G||L.data!==q.value)&&W();break;case"rejected":(!G||L.error!==q.reason)&&W();break}}return L}updateResult(){const e=this.#s,t=this.createResult(this.#t,this.options);if(this.#e=this.#t.state,this.#i=this.options,this.#e.data!==void 0&&(this.#p=this.#t),ac(t,e))return;this.#s=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,s=typeof r=="function"?r():r;if(s==="all"||!s&&!this.#g.size)return!0;const i=new Set(s??this.#g);return this.options.throwOnError&&i.add("error"),Object.keys(this.#s).some(a=>{const o=a;return this.#s[o]!==e[o]&&i.has(o)})};this.#k({listeners:n()})}#x(){const e=this.#n.getQueryCache().build(this.#n,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#r=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#k(e){an.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#s)}),this.#n.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function s2(e,t){return En(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&En(t.retryOnMount,e)===!1)}function Ku(e,t){return s2(e,t)||e.state.data!==void 0&&dc(e,t,t.refetchOnMount)}function dc(e,t,n){if(En(t.enabled,e)!==!1&&es(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&f0(e,t)}return!1}function Wu(e,t,n,r){return(e!==t||En(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&f0(e,n)}function f0(e,t){return En(t.enabled,e)!==!1&&e.isStaleByTime(es(t.staleTime,e))}function i2(e,t){return!ac(e.getCurrentResult(),t)}var a2=class extends Lh{#n;#t;#r;#s;constructor(e){super(),this.#n=e.client,this.mutationId=e.mutationId,this.#r=e.mutationCache,this.#t=[],this.state=e.state||o2(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#r.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#r.remove(this))}continue(){return this.#s?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#e({type:"continue"})},n={client:this.#n,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#s=Bh({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(i,a)=>{this.#e({type:"failed",failureCount:i,error:a})},onPause:()=>{this.#e({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#r.canRun(this)});const r=this.state.status==="pending",s=!this.#s.canStart();try{if(r)t();else{this.#e({type:"pending",variables:e,isPaused:s}),this.#r.config.onMutate&&await this.#r.config.onMutate(e,this,n);const a=await this.options.onMutate?.(e,n);a!==this.state.context&&this.#e({type:"pending",context:a,variables:e,isPaused:s})}const i=await this.#s.start();return await this.#r.config.onSuccess?.(i,e,this.state.context,this,n),await this.options.onSuccess?.(i,e,this.state.context,n),await this.#r.config.onSettled?.(i,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(i,null,e,this.state.context,n),this.#e({type:"success",data:i}),i}catch(i){try{await this.#r.config.onError?.(i,e,this.state.context,this,n)}catch(a){Promise.reject(a)}try{await this.options.onError?.(i,e,this.state.context,n)}catch(a){Promise.reject(a)}try{await this.#r.config.onSettled?.(void 0,i,this.state.variables,this.state.context,this,n)}catch(a){Promise.reject(a)}try{await this.options.onSettled?.(void 0,i,e,this.state.context,n)}catch(a){Promise.reject(a)}throw this.#e({type:"error",error:i}),i}finally{this.#r.runNext(this)}}#e(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),an.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#r.notify({mutation:this,type:"updated",action:e})})}};function o2(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Uh=class extends ua{constructor(t={}){super(),this.config=t,this.#n=new Set,this.#t=new Map,this.#r=0}#n;#t;#r;build(t,n,r){const s=new a2({client:t,mutationCache:this,mutationId:++this.#r,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){this.#n.add(t);const n=xa(t);if(typeof n=="string"){const r=this.#t.get(n);r?r.push(t):this.#t.set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#n.delete(t)){const n=xa(t);if(typeof n=="string"){const r=this.#t.get(n);if(r)if(r.length>1){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}else r[0]===t&&this.#t.delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=xa(t);if(typeof n=="string"){const s=this.#t.get(n)?.find(i=>i.state.status==="pending");return!s||s===t}else return!0}runNext(t){const n=xa(t);return typeof n=="string"?this.#t.get(n)?.find(s=>s!==t&&s.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){an.batch(()=>{this.#n.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#n.clear(),this.#t.clear()})}getAll(){return Array.from(this.#n)}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Uu(n,r))}findAll(t={}){return this.getAll().filter(n=>Uu(t,n))}notify(t){an.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return an.batch(()=>Promise.all(t.map(n=>n.continue().catch(Pn))))}};function xa(e){return e.options.scope?.id}var qh=class extends ua{constructor(t={}){super(),this.config=t,this.#n=new Map}#n;build(t,n,r){const s=n.queryKey,i=n.queryHash??u0(s,n);let a=this.get(i);return a||(a=new n2({client:t,queryKey:s,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(a)),a}add(t){this.#n.has(t.queryHash)||(this.#n.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=this.#n.get(t.queryHash);n&&(t.destroy(),n===t&&this.#n.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){an.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#n.get(t)}getAll(){return[...this.#n.values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Fu(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Fu(t,r)):n}notify(t){an.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){an.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){an.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},l2=class{#n;#t;#r;#s;#e;#i;#a;#o;constructor(t={}){this.#n=t.queryCache||new qh,this.#t=t.mutationCache||new Uh,this.#r=t.defaultOptions||{},this.#s=new Map,this.#e=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#a=c0.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#n.onFocus())}),this.#o=so.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#n.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#a?.(),this.#a=void 0,this.#o?.(),this.#o=void 0)}isFetching(t){return this.#n.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#t.findAll({...t,status:"pending"}).length}getQueryData(t){const n=this.defaultQueryOptions({queryKey:t});return this.#n.get(n.queryHash)?.state.data}ensureQueryData(t){const n=this.defaultQueryOptions(t),r=this.#n.build(this,n),s=r.state.data;return s===void 0?this.fetchQuery(t):(t.revalidateIfStale&&r.isStaleByTime(es(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(s))}getQueriesData(t){return this.#n.findAll(t).map(({queryKey:n,state:r})=>{const s=r.data;return[n,s]})}setQueryData(t,n,r){const s=this.defaultQueryOptions({queryKey:t}),a=this.#n.get(s.queryHash)?.state.data,o=Vv(n,a);if(o!==void 0)return this.#n.build(this,s).setData(o,{...r,manual:!0})}setQueriesData(t,n,r){return an.batch(()=>this.#n.findAll(t).map(({queryKey:s})=>[s,this.setQueryData(s,n,r)]))}getQueryState(t){const n=this.defaultQueryOptions({queryKey:t});return this.#n.get(n.queryHash)?.state}removeQueries(t){const n=this.#n;an.batch(()=>{n.findAll(t).forEach(r=>{n.remove(r)})})}resetQueries(t,n){const r=this.#n;return an.batch(()=>(r.findAll(t).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...t},n)))}cancelQueries(t,n={}){const r={revert:!0,...n},s=an.batch(()=>this.#n.findAll(t).map(i=>i.cancel(r)));return Promise.all(s).then(Pn).catch(Pn)}invalidateQueries(t,n={}){return an.batch(()=>(this.#n.findAll(t).forEach(r=>{r.invalidate()}),t?.refetchType==="none"?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},n)))}refetchQueries(t,n={}){const r={...n,cancelRefetch:n.cancelRefetch??!0},s=an.batch(()=>this.#n.findAll(t).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let a=i.fetch(void 0,r);return r.throwOnError||(a=a.catch(Pn)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(s).then(Pn)}fetchQuery(t){const n=this.defaultQueryOptions(t);n.retry===void 0&&(n.retry=!1);const r=this.#n.build(this,n);return r.isStaleByTime(es(n.staleTime,r))?r.fetch(n):Promise.resolve(r.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Pn).catch(Pn)}fetchInfiniteQuery(t){return t._type="infinite",this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Pn).catch(Pn)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return so.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#n}getMutationCache(){return this.#t}getDefaultOptions(){return this.#r}setDefaultOptions(t){this.#r=t}setQueryDefaults(t,n){this.#s.set(Qi(t),{queryKey:t,defaultOptions:n})}getQueryDefaults(t){const n=[...this.#s.values()],r={};return n.forEach(s=>{Ji(t,s.queryKey)&&Object.assign(r,s.defaultOptions)}),r}setMutationDefaults(t,n){this.#e.set(Qi(t),{mutationKey:t,defaultOptions:n})}getMutationDefaults(t){const n=[...this.#e.values()],r={};return n.forEach(s=>{Ji(t,s.mutationKey)&&Object.assign(r,s.defaultOptions)}),r}defaultQueryOptions(t){if(t._defaulted)return t;const n={...this.#r.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return n.queryHash||(n.queryHash=u0(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===d0&&(n.enabled=!1),n}defaultMutationOptions(t){return t?._defaulted?t:{...this.#r.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#n.clear(),this.#t.clear()}},c2="VUE_QUERY_CLIENT";function Hh(e){const t=e?`:${e}`:"";return`${c2}${t}`}function Qu(e,t){Object.keys(e).forEach(n=>{e[n]=t[n]})}function fc(e,t,n="",r=0){if(t){const s=t(e,n,r);if(s===void 0&&ss(e)||s!==void 0)return s}if(Array.isArray(e))return e.map((s,i)=>fc(s,t,String(i),r+1));if(typeof e=="object"&&d2(e)){const s=Object.entries(e).map(([i,a])=>[i,fc(a,t,i,r+1)]);return Object.fromEntries(s)}return e}function u2(e,t){return fc(e,t)}function tt(e,t=!1){return u2(e,(n,r,s)=>{if(s===1&&r==="queryKey")return tt(n,!0);if(t&&f2(n))return tt(n(),t);if(ss(n))return tt(g(n),t)})}function d2(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function f2(e){return typeof e=="function"}function hs(e=""){if(!Th())throw new Error("vue-query hooks can only be used inside setup() function or functions that support injection context.");const t=Hh(e),n=Cr(t);if(!n)throw new Error("No 'queryClient' found in Vue context, use 'VueQueryPlugin' to properly initialize the library.");return n}var h2=class extends qh{find(e){return super.find(tt(e))}findAll(e={}){return super.findAll(tt(e))}},p2=class extends Uh{find(e){return super.find(tt(e))}findAll(e={}){return super.findAll(tt(e))}},m2=class extends l2{constructor(e={}){const t={defaultOptions:e.defaultOptions,queryCache:e.queryCache||new h2,mutationCache:e.mutationCache||new p2};super(t),this.isRestoring=Oe(!1)}isFetching(e={}){return super.isFetching(tt(e))}isMutating(e={}){return super.isMutating(tt(e))}getQueryData(e){return super.getQueryData(tt(e))}ensureQueryData(e){return super.ensureQueryData(tt(e))}getQueriesData(e){return super.getQueriesData(tt(e))}setQueryData(e,t,n={}){return super.setQueryData(tt(e),t,tt(n))}setQueriesData(e,t,n={}){return super.setQueriesData(tt(e),t,tt(n))}getQueryState(e){return super.getQueryState(tt(e))}removeQueries(e={}){return super.removeQueries(tt(e))}resetQueries(e={},t={}){return super.resetQueries(tt(e),tt(t))}cancelQueries(e={},t={}){return super.cancelQueries(tt(e),tt(t))}invalidateQueries(e={},t={}){const n=tt(e),r=tt(t);if(super.invalidateQueries({...n,refetchType:"none"},r),n.refetchType==="none")return Promise.resolve();const s={...n,type:n.refetchType??n.type??"active"};return ur().then(()=>super.refetchQueries(s,r))}refetchQueries(e={},t={}){return super.refetchQueries(tt(e),tt(t))}fetchQuery(e){return super.fetchQuery(tt(e))}prefetchQuery(e){return super.prefetchQuery(tt(e))}fetchInfiniteQuery(e){return super.fetchInfiniteQuery(tt(e))}prefetchInfiniteQuery(e){return super.prefetchInfiniteQuery(tt(e))}setDefaultOptions(e){super.setDefaultOptions(tt(e))}setQueryDefaults(e,t){super.setQueryDefaults(tt(e),tt(t))}getQueryDefaults(e){return super.getQueryDefaults(tt(e))}setMutationDefaults(e,t){super.setMutationDefaults(tt(e),tt(t))}getMutationDefaults(e){return super.getMutationDefaults(tt(e))}},g2={install:(e,t={})=>{const n=Hh(t.queryClientKey);let r;if("queryClient"in t&&t.queryClient)r=t.queryClient;else{const a="queryClientConfig"in t?t.queryClientConfig:void 0;r=new m2(a)}Yi.isServer()||r.mount();let s=()=>{};if(t.clientPersister){r.isRestoring&&(r.isRestoring.value=!0);const[a,o]=t.clientPersister(r);s=a,o.then(()=>{r.isRestoring&&(r.isRestoring.value=!1),t.clientPersisterOnSuccess?.(r)})}const i=()=>{r.unmount(),s()};if(e.onUnmount)e.onUnmount(i);else{const a=e.unmount;e.unmount=function(){i(),a()}}e.provide(n,r)}};function v2(e,t,n){const r=hs(),s=Se(()=>{let f=t;typeof f=="function"&&(f=f());const y=tt(f);typeof y.enabled=="function"&&(y.enabled=y.enabled());const b=r.defaultQueryOptions(y);return b._optimisticResults=r.isRestoring?.value?"isRestoring":"optimistic",b}),i=new e(r,s.value),a=s.value.shallow?Ih(i.getCurrentResult()):Xr(i.getCurrentResult());let o=()=>{};r.isRestoring&&on(r.isRestoring,f=>{f||(o(),o=i.subscribe(y=>{Qu(a,y)}))},{immediate:!0});const l=()=>{i.setOptions(s.value),Qu(a,i.getCurrentResult())};on(s,l),Ah(()=>{o()});const c=(...f)=>(l(),a.refetch(...f)),u=()=>new Promise((f,y)=>{let b=()=>{};const x=()=>{if(s.value.enabled!==!1){i.setOptions(s.value);const S=i.getOptimisticResult(s.value);S.isStale?(b(),i.fetchOptimistic(s.value).then(f,N=>{Vu(s.value.throwOnError,[N,i.getCurrentQuery()])?y(N):f(i.getCurrentResult())})):(b(),f(S))}};x(),b=on(s,x)});on(()=>a.error,f=>{if(a.isError&&!a.isFetching&&Vu(s.value.throwOnError,[f,i.getCurrentQuery()]))throw f});const p=s.value.shallow?$4(a):D4(a),m=_h(p);for(const f in a)typeof a[f]=="function"&&(m[f]=a[f]);return m.suspense=u,m.refetch=c,m}function pr(e,t){return v2(r2,e)}function Vh(){return typeof window>"u"?"":(window.__TASK_HANDOFF_PUBLIC_BASE__||"").replace(/\/$/,"")}function jn(e){if(!e||/^[a-z][a-z\d+.-]*:/i.test(e))return e;const t=e.startsWith("/")?e:`/${e}`;return`${Vh()}${t}`}function io(e){return jn(e).replace(/^\//,"")}function b2(){return jn("/api")}function jh(e,t=""){const n=window.location.protocol==="https:"?"wss:":"ws:",r=new URL(jn(e),window.location.origin);return r.protocol=n,t&&r.searchParams.set("token",t),r.toString()}class hc extends Error{response;request;options;constructor(t,n,r){const s=t.status||t.status===0?t.status:"",i=t.statusText??"",a=`${s} ${i}`.trim(),o=a?`status code ${a}`:"an unknown error";super(`Request failed with ${o}: ${n.method} ${n.url}`),this.name="HTTPError",this.response=t,this.request=n,this.options=r}}class Gh extends Error{name="NonError";value;constructor(t){let n="Non-error value was thrown";try{typeof t=="string"?n=t:t&&typeof t=="object"&&"message"in t&&typeof t.message=="string"&&(n=t.message)}catch{}super(n),this.value=t}}class bl extends Error{name="ForceRetryError";customDelay;code;customRequest;constructor(t){const n=t?.cause?t.cause instanceof Error?t.cause:new Gh(t.cause):void 0;super(t?.code?`Forced retry: ${t.code}`:"Forced retry",n?{cause:n}:void 0),this.customDelay=t?.delay,this.code=t?.code,this.customRequest=t?.request}}const Ju=(()=>{let e=!1,t=!1;const n=typeof globalThis.ReadableStream=="function",r=typeof globalThis.Request=="function";if(n&&r)try{t=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type")}catch(s){if(s instanceof Error&&s.message==="unsupported BodyInit type")return!1;throw s}return e&&!t})(),y2=typeof globalThis.AbortController=="function",Zh=typeof globalThis.AbortSignal=="function"&&typeof globalThis.AbortSignal.any=="function",w2=typeof globalThis.ReadableStream=="function",S2=typeof globalThis.FormData=="function",Kh=["get","post","put","patch","head","delete"],x2={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},yl=2147483647,k2=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,Wh=Symbol("stop");class Qh{options;constructor(t){this.options=t}}const _2=e=>new Qh(e),E2={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},A2={next:!0},T2={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0},I2=e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(const[n,r]of e)t+=k2,t+=new TextEncoder().encode(`Content-Disposition: form-data; name="${n}"`).length,t+=typeof r=="string"?new TextEncoder().encode(r).length:r.size;return t}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength;if(typeof e=="string")return new TextEncoder().encode(e).length;if(e instanceof URLSearchParams)return new TextEncoder().encode(e.toString()).length;if("byteLength"in e)return e.byteLength;if(typeof e=="object"&&e!==null)try{const t=JSON.stringify(e);return new TextEncoder().encode(t).length}catch{return 0}return 0},Jh=(e,t,n)=>{let r,s=0;return e.pipeThrough(new TransformStream({transform(i,a){if(a.enqueue(i),r){s+=r.byteLength;let o=t===0?0:s/t;o>=1&&(o=1-Number.EPSILON),n?.({percent:o,totalBytes:Math.max(t,s),transferredBytes:s},r)}r=i},flush(){r&&(s+=r.byteLength,n?.({percent:1,totalBytes:Math.max(t,s),transferredBytes:s},r))}}))},R2=(e,t)=>{if(!e.body)return e;if(e.status===204)return new Response(null,{status:e.status,statusText:e.statusText,headers:e.headers});const n=Math.max(0,Number(e.headers.get("content-length"))||0);return new Response(Jh(e.body,n,t),{status:e.status,statusText:e.statusText,headers:e.headers})},C2=(e,t,n)=>{if(!e.body)return e;const r=I2(n??e.body);return new Request(e,{duplex:"half",body:Jh(e.body,r,t)})},_s=e=>e!==null&&typeof e=="object",ka=(...e)=>{for(const t of e)if((!_s(t)||Array.isArray(t))&&t!==void 0)throw new TypeError("The `options` argument must be an object");return h0({},...e)},Yh=(e={},t={})=>{const n=new globalThis.Headers(e),r=t instanceof globalThis.Headers,s=new globalThis.Headers(t);for(const[i,a]of s.entries())r&&a==="undefined"||a===void 0?n.delete(i):n.set(i,a);return n};function _a(e,t,n){return Object.hasOwn(t,n)&&t[n]===void 0?[]:h0(e[n]??[],t[n]??[])}const Xh=(e={},t={})=>({beforeRequest:_a(e,t,"beforeRequest"),beforeRetry:_a(e,t,"beforeRetry"),afterResponse:_a(e,t,"afterResponse"),beforeError:_a(e,t,"beforeError")}),O2=(e,t)=>{const n=new URLSearchParams;for(const r of[e,t])if(r!==void 0)if(r instanceof URLSearchParams)for(const[s,i]of r.entries())n.append(s,i);else if(Array.isArray(r))for(const s of r){if(!Array.isArray(s)||s.length!==2)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");n.append(String(s[0]),String(s[1]))}else if(_s(r))for(const[s,i]of Object.entries(r))i!==void 0&&n.append(s,String(i));else{const s=new URLSearchParams(r);for(const[i,a]of s.entries())n.append(i,a)}return n},h0=(...e)=>{let t={},n={},r={},s;const i=[];for(const a of e)if(Array.isArray(a))Array.isArray(t)||(t=[]),t=[...t,...a];else if(_s(a)){for(let[o,l]of Object.entries(a)){if(o==="signal"&&l instanceof globalThis.AbortSignal){i.push(l);continue}if(o==="context"){if(l!=null&&(!_s(l)||Array.isArray(l)))throw new TypeError("The `context` option must be an object");t={...t,context:l==null?{}:{...t.context,...l}};continue}if(o==="searchParams"){l==null?s=void 0:s=s===void 0?l:O2(s,l);continue}_s(l)&&o in t&&(l=h0(t[o],l)),t={...t,[o]:l}}_s(a.hooks)&&(r=Xh(r,a.hooks),t.hooks=r),_s(a.headers)&&(n=Yh(n,a.headers),t.headers=n)}return s!==void 0&&(t.searchParams=s),i.length>0&&(i.length===1?t.signal=i[0]:Zh?t.signal=AbortSignal.any(i):t.signal=i.at(-1)),t},M2=e=>Kh.includes(e)?e.toUpperCase():e,N2=["get","put","head","delete","options","trace"],z2=[408,413,429,500,502,503,504],$2=[413,429,503],Yu={limit:2,methods:N2,statusCodes:z2,afterStatusCodes:$2,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3,jitter:void 0,retryOnTimeout:!1},D2=(e={})=>{if(typeof e=="number")return{...Yu,limit:e};if(e.methods&&!Array.isArray(e.methods))throw new Error("retry.methods must be an array");if(e.methods&&=e.methods.map(n=>n.toLowerCase()),e.statusCodes&&!Array.isArray(e.statusCodes))throw new Error("retry.statusCodes must be an array");const t=Object.fromEntries(Object.entries(e).filter(([,n])=>n!==void 0));return{...Yu,...t}};class pc extends Error{request;constructor(t){super(`Request timed out: ${t.method} ${t.url}`),this.name="TimeoutError",this.request=t}}async function P2(e,t,n,r){return new Promise((s,i)=>{const a=setTimeout(()=>{n&&n.abort(),i(new pc(e))},r.timeout);r.fetch(e,t).then(s).catch(i).then(()=>{clearTimeout(a)})})}async function B2(e,{signal:t}){return new Promise((n,r)=>{t&&(t.throwIfAborted(),t.addEventListener("abort",s,{once:!0}));function s(){clearTimeout(i),r(t.reason)}const i=setTimeout(()=>{t?.removeEventListener("abort",s),n()},e)})}const L2=(e,t)=>{const n={};for(const r in t)Object.hasOwn(t,r)&&!(r in T2)&&!(r in E2)&&(!(r in e)||r in A2)&&(n[r]=t[r]);return n},F2=e=>e===void 0?!1:Array.isArray(e)?e.length>0:e instanceof URLSearchParams?e.size>0:typeof e=="object"?Object.keys(e).length>0:typeof e=="string"?e.trim().length>0:!!e;function U2(e){return e instanceof hc||e?.name===hc.name}function q2(e){return e instanceof pc||e?.name===pc.name}class Xi{static create(t,n){const r=new Xi(t,n),s=async()=>{if(typeof r.#e.timeout=="number"&&r.#e.timeout>yl)throw new RangeError(`The \`timeout\` option cannot be greater than ${yl}`);await Promise.resolve();let a=await r.#g();for(const o of r.#e.hooks.afterResponse){const l=r.#p(a.clone());let c;try{c=await o(r.request,r.#u(),l,{retryCount:r.#r})}catch(p){throw r.#c(l),r.#c(a),p}if(c instanceof Qh)throw r.#c(l),r.#c(a),new bl(c.options);const u=c instanceof globalThis.Response?c:a;l!==u&&r.#c(l),a!==u&&r.#c(a),a=u}if(r.#p(a),!a.ok&&(typeof r.#e.throwHttpErrors=="function"?r.#e.throwHttpErrors(a.status):r.#e.throwHttpErrors)){let o=new hc(a,r.request,r.#u());for(const l of r.#e.hooks.beforeError)o=await l(o,{retryCount:r.#r});throw o}if(r.#e.onDownloadProgress){if(typeof r.#e.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!w2)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");const o=a.clone();return r.#c(a),R2(o,r.#e.onDownloadProgress)}return a},i=r.#h(s).finally(()=>{const a=r.#i;r.#f(a?.body??void 0),r.#f(r.request.body??void 0)});for(const[a,o]of Object.entries(x2))a==="bytes"&&typeof globalThis.Response?.prototype?.bytes!="function"||(i[a]=async()=>{r.request.headers.set("accept",r.request.headers.get("accept")||o);const l=await i;if(a==="json"){if(l.status===204)return"";const c=await l.text();return c===""?"":n.parseJson?n.parseJson(c):JSON.parse(c)}return l[a]()});return i}static#n(t){return t&&typeof t=="object"&&!Array.isArray(t)&&!(t instanceof URLSearchParams)?Object.fromEntries(Object.entries(t).filter(([,n])=>n!==void 0)):t}request;#t;#r=0;#s;#e;#i;#a;#o;constructor(t,n={}){if(this.#s=t,this.#e={...n,headers:Yh(this.#s.headers,n.headers),hooks:Xh({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},n.hooks),method:M2(n.method??this.#s.method??"GET"),prefixUrl:String(n.prefixUrl||""),retry:D2(n.retry),throwHttpErrors:n.throwHttpErrors??!0,timeout:n.timeout??1e4,fetch:n.fetch??globalThis.fetch.bind(globalThis),context:n.context??{}},typeof this.#s!="string"&&!(this.#s instanceof URL||this.#s instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this.#e.prefixUrl&&typeof this.#s=="string"){if(this.#s.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this.#e.prefixUrl.endsWith("/")||(this.#e.prefixUrl+="/"),this.#s=this.#e.prefixUrl+this.#s}y2&&Zh&&(this.#a=this.#e.signal??this.#s.signal,this.#t=new globalThis.AbortController,this.#e.signal=this.#a?AbortSignal.any([this.#a,this.#t.signal]):this.#t.signal),Ju&&(this.#e.duplex="half"),this.#e.json!==void 0&&(this.#e.body=this.#e.stringifyJson?.(this.#e.json)??JSON.stringify(this.#e.json),this.#e.headers.set("content-type",this.#e.headers.get("content-type")??"application/json"));const r=n.headers&&new globalThis.Headers(n.headers).has("content-type");if(this.#s instanceof globalThis.Request&&(S2&&this.#e.body instanceof globalThis.FormData||this.#e.body instanceof URLSearchParams)&&!r&&this.#e.headers.delete("content-type"),this.request=new globalThis.Request(this.#s,this.#e),F2(this.#e.searchParams)){const i="?"+(typeof this.#e.searchParams=="string"?this.#e.searchParams.replace(/^\?/,""):new URLSearchParams(Xi.#n(this.#e.searchParams)).toString()),a=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,i);this.request=new globalThis.Request(a,this.#e)}if(this.#e.onUploadProgress){if(typeof this.#e.onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");if(!Ju)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request=this.#v(this.request,this.#e.body??void 0)}}#d(){const t=this.#e.retry.delay(this.#r);let n=t;this.#e.retry.jitter===!0?n=Math.random()*t:typeof this.#e.retry.jitter=="function"&&(n=this.#e.retry.jitter(t),(!Number.isFinite(n)||n<0)&&(n=t));const r=this.#e.retry.backoffLimit??Number.POSITIVE_INFINITY;return Math.min(r,n)}async#l(t){if(this.#r++,this.#r>this.#e.retry.limit)throw t;const n=t instanceof Error?t:new Gh(t);if(n instanceof bl)return n.customDelay??this.#d();if(!this.#e.retry.methods.includes(this.request.method.toLowerCase()))throw t;if(this.#e.retry.shouldRetry!==void 0){const r=await this.#e.retry.shouldRetry({error:n,retryCount:this.#r});if(r===!1)throw t;if(r===!0)return this.#d()}if(q2(t)&&!this.#e.retry.retryOnTimeout)throw t;if(U2(t)){if(!this.#e.retry.statusCodes.includes(t.response.status))throw t;const r=t.response.headers.get("Retry-After")??t.response.headers.get("RateLimit-Reset")??t.response.headers.get("X-RateLimit-Retry-After")??t.response.headers.get("X-RateLimit-Reset")??t.response.headers.get("X-Rate-Limit-Reset");if(r&&this.#e.retry.afterStatusCodes.includes(t.response.status)){let s=Number(r)*1e3;Number.isNaN(s)?s=Date.parse(r)-Date.now():s>=Date.parse("2024-01-01")&&(s-=Date.now());const i=this.#e.retry.maxRetryAfter??s;return s<i?s:i}if(t.response.status===413)throw t}return this.#d()}#p(t){return this.#e.parseJson&&(t.json=async()=>this.#e.parseJson(await t.text())),t}#f(t){t&&t.cancel().catch(()=>{})}#c(t){this.#f(t.body??void 0)}async#h(t){try{return await t()}catch(n){const r=Math.min(await this.#l(n),yl);if(this.#r<1)throw n;if(await B2(r,this.#a?{signal:this.#a}:{}),n instanceof bl&&n.customRequest){const s=this.#e.signal?new globalThis.Request(n.customRequest,{signal:this.#e.signal}):new globalThis.Request(n.customRequest);this.#m(s)}for(const s of this.#e.hooks.beforeRetry){const i=await s({request:this.request,options:this.#u(),error:n,retryCount:this.#r});if(i instanceof globalThis.Request){this.#m(i);break}if(i instanceof globalThis.Response)return i;if(i===Wh)return}return this.#h(t)}}async#g(){this.#t?.signal.aborted&&(this.#t=new globalThis.AbortController,this.#e.signal=this.#a?AbortSignal.any([this.#a,this.#t.signal]):this.#t.signal,this.request=new globalThis.Request(this.request,{signal:this.#e.signal}));for(const n of this.#e.hooks.beforeRequest){const r=await n(this.request,this.#u(),{retryCount:this.#r});if(r instanceof Response)return r;if(r instanceof globalThis.Request){this.#m(r);break}}const t=L2(this.request,this.#e);return this.#i=this.request,this.request=this.#i.clone(),this.#e.timeout===!1?this.#e.fetch(this.#i,t):P2(this.#i,t,this.#t,this.#e)}#u(){if(!this.#o){const{hooks:t,...n}=this.#e;this.#o=Object.freeze(n)}return this.#o}#m(t){this.#o=void 0,this.request=this.#v(t)}#v(t,n){return!this.#e.onUploadProgress||!t.body?t:C2(t,this.#e.onUploadProgress,n??this.#e.body??void 0)}}const mc=e=>{const t=(n,r)=>Xi.create(n,ka(e,r));for(const n of Kh)t[n]=(r,s)=>Xi.create(r,ka(e,s,{method:n}));return t.create=n=>mc(ka(n)),t.extend=n=>(typeof n=="function"&&(n=n(e??{})),mc(ka(e,n))),t.stop=Wh,t.retry=_2,t},H2=mc(),wl="task-handoff-web-token",$s=l0("auth",{state:()=>({token:localStorage.getItem(wl)||""}),actions:{setToken(e){this.token=e,e?localStorage.setItem(wl,e):localStorage.removeItem(wl)}}}),Do=H2.create({prefixUrl:b2(),timeout:3e4,hooks:{beforeRequest:[e=>{const t=$s().token;t&&e.headers.set("Authorization",`Bearer ${t}`)}]}});class Ya extends Error{code;status;constructor(t,n="API_ERROR",r){super(t),this.name="ApiError",this.code=n,this.status=r}}async function Po(e){try{return await e}catch(t){if(t&&typeof t=="object"&&"response"in t){const n=t.response;try{const r=await n.clone().json(),s=r.error?.message||`${n.status} ${n.statusText}`;throw new Ya(s,r.error?.code,n.status)}catch(r){if(r instanceof Ya)throw r}throw new Ya(`${n.status} ${n.statusText}`,"HTTP_ERROR",n.status)}throw t}}async function Jn(e){return(await Po(Do.get(e).json())).data}async function Un(e,t){return(await Po(Do.post(e,{json:t??{}}).json())).data}async function ep(e,t){return(await Po(Do.patch(e,{json:t??{}}).json())).data}async function p0(e){return(await Po(Do.delete(e).json())).data}function Nr(e=!0){const t=$s(),n=np();return Se(()=>!g(e)||!n.data.value?!1:!n.data.value.enabled||!!t.token)}function Ds(e,t){return!(t instanceof Ya&&t.status===401)&&e<3}function tp(){return pr({queryKey:["status"],queryFn:()=>Jn("status"),enabled:Nr(),refetchInterval:1e4,retry:Ds})}function np(){return pr({queryKey:["auth-status"],queryFn:()=>Jn("auth/status")})}function V2(){return pr({queryKey:["diagnostics"],queryFn:()=>Jn("diagnostics"),enabled:Nr(),refetchInterval:15e3,retry:Ds})}function rp(){return pr({queryKey:["app-catalog"],queryFn:()=>Jn("apps/catalog"),enabled:Nr(),retry:Ds})}function sp(){return pr({queryKey:["app-catalog-custom"],queryFn:()=>Jn("apps/catalog/custom"),enabled:Nr(),retry:!1})}function Ys(e){return ep("apps/catalog/custom",{items:e})}function di(){return pr({queryKey:["app-sessions"],queryFn:async()=>(await Jn("apps/sessions")).snapshot.sessions,enabled:Nr(),retry:Ds})}function ip(){return pr({queryKey:["ai-sessions"],queryFn:async()=>(await Jn("ai-sessions")).snapshot,enabled:Nr(),retry:Ds})}function Xu(e,t,n){return Un(`ai-sessions/${e}/messages`,{message:t,mode:n})}function j2(e,t){return Un(`ai-sessions/${e}/queue/${t}/steer`)}function G2(e,t){return Un(`ai-sessions/${e}/queue/${t}/retry`)}function Z2(e,t){return p0(`ai-sessions/${e}/queue/${t}`)}function K2(e,t){return Un(`ai-sessions/${e}/approval`,{decision:t})}function W2(){return pr({queryKey:["triggers"],queryFn:()=>Jn("triggers"),enabled:Nr(),retry:Ds})}function Q2(e){return Un("triggers",e)}function J2(e){return Un(`triggers/${e}/enable`)}function Y2(e){return Un(`triggers/${e}/disable`)}function X2(e,t){return Un(`triggers/${e}/run`,{})}function eb(e){return p0(`triggers/${e}`)}function tb(e){return Un(`ai-sessions/${e}/interrupt`)}function nb(e){return pr({queryKey:["app-session-logs",e],queryFn:()=>Jn(`apps/sessions/${e}/logs`),enabled:Nr(!!e),refetchInterval:5e3,retry:Ds})}function rb(e,t=!0){return pr({queryKey:["app-session-automation",e],queryFn:()=>Jn(`apps/sessions/${e}/automation`),enabled:Nr(!!e&&t),refetchInterval:5e3,retry:!1})}function ap(e,t={}){return Un("apps/sessions",{appId:e,...t})}function Os(e){return Un(`apps/sessions/${e}/stop`)}function m0(e){return Un(`apps/sessions/${e}/restart`)}function sb(e,t){return ep(`apps/sessions/${e}`,{title:t})}function op(e){return p0(`apps/sessions/${e}`)}function lp(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=lp(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function cp(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=lp(e))&&(r&&(r+=" "),r+=t);return r}const ed=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,td=cp,g0=(e,t)=>n=>{var r;if(t?.variants==null)return td(e,n?.class,n?.className);const{variants:s,defaultVariants:i}=t,a=Object.keys(s).map(c=>{const u=n?.[c],p=i?.[c];if(u===null)return null;const m=ed(u)||ed(p);return s[c][m]}),o=n&&Object.entries(n).reduce((c,u)=>{let[p,m]=u;return m===void 0||(c[p]=m),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:p,className:m,...f}=u;return Object.entries(f).every(y=>{let[b,x]=y;return Array.isArray(x)?x.includes({...i,...o}[b]):{...i,...o}[b]===x})?[...c,p,m]:c},[]);return td(e,a,l,n?.class,n?.className)},ib=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},ab=(e,t)=>({classGroupId:e,validator:t}),up=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),ao="-",nd=[],ob="arbitrary..",lb=e=>{const t=ub(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return cb(a);const o=a.split(ao),l=o[0]===""&&o.length>1?1:0;return dp(o,l,t)},getConflictingClassGroupIds:(a,o)=>{if(o){const l=r[a],c=n[a];return l?c?ib(c,l):l:c||nd}return n[a]||nd}}},dp=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],i=n.nextPart.get(s);if(i){const c=dp(e,t+1,i);if(c)return c}const a=n.validators;if(a===null)return;const o=t===0?e.join(ao):e.slice(t).join(ao),l=a.length;for(let c=0;c<l;c++){const u=a[c];if(u.validator(o))return u.classGroupId}},cb=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?ob+r:void 0})(),ub=e=>{const{theme:t,classGroups:n}=e;return db(n,t)},db=(e,t)=>{const n=up();for(const r in e){const s=e[r];v0(s,n,r,t)}return n},v0=(e,t,n,r)=>{const s=e.length;for(let i=0;i<s;i++){const a=e[i];fb(a,t,n,r)}},fb=(e,t,n,r)=>{if(typeof e=="string"){hb(e,t,n);return}if(typeof e=="function"){pb(e,t,n,r);return}mb(e,t,n,r)},hb=(e,t,n)=>{const r=e===""?t:fp(t,e);r.classGroupId=n},pb=(e,t,n,r)=>{if(gb(e)){v0(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(ab(n,e))},mb=(e,t,n,r)=>{const s=Object.entries(e),i=s.length;for(let a=0;a<i;a++){const[o,l]=s[a];v0(l,fp(t,o),n,r)}},fp=(e,t)=>{let n=e;const r=t.split(ao),s=r.length;for(let i=0;i<s;i++){const a=r[i];let o=n.nextPart.get(a);o||(o=up(),n.nextPart.set(a,o)),n=o}return n},gb=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,vb=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const s=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(i){let a=n[i];if(a!==void 0)return a;if((a=r[i])!==void 0)return s(i,a),a},set(i,a){i in n?n[i]=a:s(i,a)}}},gc="!",rd=":",bb=[],sd=(e,t,n,r,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),yb=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=s=>{const i=[];let a=0,o=0,l=0,c;const u=s.length;for(let b=0;b<u;b++){const x=s[b];if(a===0&&o===0){if(x===rd){i.push(s.slice(l,b)),l=b+1;continue}if(x==="/"){c=b;continue}}x==="["?a++:x==="]"?a--:x==="("?o++:x===")"&&o--}const p=i.length===0?s:s.slice(l);let m=p,f=!1;p.endsWith(gc)?(m=p.slice(0,-1),f=!0):p.startsWith(gc)&&(m=p.slice(1),f=!0);const y=c&&c>l?c-l:void 0;return sd(i,f,m,y)};if(t){const s=t+rd,i=r;r=a=>a.startsWith(s)?i(a.slice(s.length)):sd(bb,!1,a,void 0,!0)}if(n){const s=r;r=i=>n({className:i,parseClassName:s})}return r},wb=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let i=0;i<n.length;i++){const a=n[i],o=a[0]==="[",l=t.has(a);o||l?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(a)):s.push(a)}return s.length>0&&(s.sort(),r.push(...s)),r}},Sb=e=>({cache:vb(e.cacheSize),parseClassName:yb(e),sortModifiers:wb(e),postfixLookupClassGroupIds:xb(e),...lb(e)}),xb=e=>{const t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let r=0;r<n.length;r++)t[n[r]]=!0;return t},kb=/\s+/,_b=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i,postfixLookupClassGroupIds:a}=t,o=[],l=e.trim().split(kb);let c="";for(let u=l.length-1;u>=0;u-=1){const p=l[u],{isExternal:m,modifiers:f,hasImportantModifier:y,baseClassName:b,maybePostfixModifierPosition:x}=n(p);if(m){c=p+(c.length>0?" "+c:c);continue}let S=!!x,N;if(S){const L=b.substring(0,x);N=r(L);const M=N&&a[N]?r(b):void 0;M&&M!==N&&(N=M,S=!1)}else N=r(b);if(!N){if(!S){c=p+(c.length>0?" "+c:c);continue}if(N=r(b),!N){c=p+(c.length>0?" "+c:c);continue}S=!1}const z=f.length===0?"":f.length===1?f[0]:i(f).join(":"),I=y?z+gc:z,E=I+N;if(o.indexOf(E)>-1)continue;o.push(E);const _=s(N,S);for(let L=0;L<_.length;++L){const M=_[L];o.push(I+M)}c=p+(c.length>0?" "+c:c)}return c},Eb=(...e)=>{let t=0,n,r,s="";for(;t<e.length;)(n=e[t++])&&(r=hp(n))&&(s&&(s+=" "),s+=r);return s},hp=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=hp(e[r]))&&(n&&(n+=" "),n+=t);return n},Ab=(e,...t)=>{let n,r,s,i;const a=l=>{const c=t.reduce((u,p)=>p(u),e());return n=Sb(c),r=n.cache.get,s=n.cache.set,i=o,o(l)},o=l=>{const c=r(l);if(c)return c;const u=_b(l,n);return s(l,u),u};return i=a,(...l)=>i(Eb(...l))},Tb=[],Jt=e=>{const t=n=>n[e]||Tb;return t.isThemeGetter=!0,t},pp=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,mp=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ib=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Rb=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Cb=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Ob=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Mb=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Nb=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Hr=e=>Ib.test(e),et=e=>!!e&&!Number.isNaN(Number(e)),nr=e=>!!e&&Number.isInteger(Number(e)),Sl=e=>e.endsWith("%")&&et(e.slice(0,-1)),wr=e=>Rb.test(e),gp=()=>!0,zb=e=>Cb.test(e)&&!Ob.test(e),b0=()=>!1,$b=e=>Mb.test(e),Db=e=>Nb.test(e),Pb=e=>!ke(e)&&!_e(e),Bb=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),Lb=e=>ps(e,yp,b0),ke=e=>pp.test(e),Ss=e=>ps(e,wp,zb),id=e=>ps(e,Zb,et),Fb=e=>ps(e,xp,gp),Ub=e=>ps(e,Sp,b0),ad=e=>ps(e,vp,b0),qb=e=>ps(e,bp,Db),Ea=e=>ps(e,kp,$b),_e=e=>mp.test(e),Ei=e=>Ps(e,wp),Hb=e=>Ps(e,Sp),od=e=>Ps(e,vp),Vb=e=>Ps(e,yp),jb=e=>Ps(e,bp),Aa=e=>Ps(e,kp,!0),Gb=e=>Ps(e,xp,!0),ps=(e,t,n)=>{const r=pp.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Ps=(e,t,n=!1)=>{const r=mp.exec(e);return r?r[1]?t(r[1]):n:!1},vp=e=>e==="position"||e==="percentage",bp=e=>e==="image"||e==="url",yp=e=>e==="length"||e==="size"||e==="bg-size",wp=e=>e==="length",Zb=e=>e==="number",Sp=e=>e==="family-name",xp=e=>e==="number"||e==="weight",kp=e=>e==="shadow",Kb=()=>{const e=Jt("color"),t=Jt("font"),n=Jt("text"),r=Jt("font-weight"),s=Jt("tracking"),i=Jt("leading"),a=Jt("breakpoint"),o=Jt("container"),l=Jt("spacing"),c=Jt("radius"),u=Jt("shadow"),p=Jt("inset-shadow"),m=Jt("text-shadow"),f=Jt("drop-shadow"),y=Jt("blur"),b=Jt("perspective"),x=Jt("aspect"),S=Jt("ease"),N=Jt("animate"),z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],I=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...I(),_e,ke],_=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto","contain","none"],M=()=>[_e,ke,l],G=()=>[Hr,"full","auto",...M()],P=()=>[nr,"none","subgrid",_e,ke],W=()=>["auto",{span:["full",nr,_e,ke]},nr,_e,ke],q=()=>[nr,"auto",_e,ke],X=()=>["auto","min","max","fr",_e,ke],ne=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],he=()=>["start","end","center","stretch","center-safe","end-safe"],Ae=()=>["auto",...M()],se=()=>[Hr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...M()],re=()=>[Hr,"screen","full","dvw","lvw","svw","min","max","fit",...M()],ze=()=>[Hr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...M()],ie=()=>[e,_e,ke],je=()=>[...I(),od,ad,{position:[_e,ke]}],rt=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ot=()=>["auto","cover","contain",Vb,Lb,{size:[_e,ke]}],Ft=()=>[Sl,Ei,Ss],st=()=>["","none","full",c,_e,ke],at=()=>["",et,Ei,Ss],C=()=>["solid","dashed","dotted","double"],le=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Q=()=>[et,Sl,od,ad],de=()=>["","none",y,_e,ke],Ie=()=>["none",et,_e,ke],Ge=()=>["none",et,_e,ke],Le=()=>[et,_e,ke],Te=()=>[Hr,"full",...M()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[wr],breakpoint:[wr],color:[gp],container:[wr],"drop-shadow":[wr],ease:["in","out","in-out"],font:[Pb],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[wr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[wr],shadow:[wr],spacing:["px",et],text:[wr],"text-shadow":[wr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Hr,ke,_e,x]}],container:["container"],"container-type":[{"@container":["","normal","size",_e,ke]}],"container-named":[Bb],columns:[{columns:[et,ke,_e,o]}],"break-after":[{"break-after":z()}],"break-before":[{"break-before":z()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:E()}],overflow:[{overflow:_()}],"overflow-x":[{"overflow-x":_()}],"overflow-y":[{"overflow-y":_()}],overscroll:[{overscroll:L()}],"overscroll-x":[{"overscroll-x":L()}],"overscroll-y":[{"overscroll-y":L()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:G()}],"inset-x":[{"inset-x":G()}],"inset-y":[{"inset-y":G()}],start:[{"inset-s":G(),start:G()}],end:[{"inset-e":G(),end:G()}],"inset-bs":[{"inset-bs":G()}],"inset-be":[{"inset-be":G()}],top:[{top:G()}],right:[{right:G()}],bottom:[{bottom:G()}],left:[{left:G()}],visibility:["visible","invisible","collapse"],z:[{z:[nr,"auto",_e,ke]}],basis:[{basis:[Hr,"full","auto",o,...M()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[et,Hr,"auto","initial","none",ke]}],grow:[{grow:["",et,_e,ke]}],shrink:[{shrink:["",et,_e,ke]}],order:[{order:[nr,"first","last","none",_e,ke]}],"grid-cols":[{"grid-cols":P()}],"col-start-end":[{col:W()}],"col-start":[{"col-start":q()}],"col-end":[{"col-end":q()}],"grid-rows":[{"grid-rows":P()}],"row-start-end":[{row:W()}],"row-start":[{"row-start":q()}],"row-end":[{"row-end":q()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":X()}],"auto-rows":[{"auto-rows":X()}],gap:[{gap:M()}],"gap-x":[{"gap-x":M()}],"gap-y":[{"gap-y":M()}],"justify-content":[{justify:[...ne(),"normal"]}],"justify-items":[{"justify-items":[...he(),"normal"]}],"justify-self":[{"justify-self":["auto",...he()]}],"align-content":[{content:["normal",...ne()]}],"align-items":[{items:[...he(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...he(),{baseline:["","last"]}]}],"place-content":[{"place-content":ne()}],"place-items":[{"place-items":[...he(),"baseline"]}],"place-self":[{"place-self":["auto",...he()]}],p:[{p:M()}],px:[{px:M()}],py:[{py:M()}],ps:[{ps:M()}],pe:[{pe:M()}],pbs:[{pbs:M()}],pbe:[{pbe:M()}],pt:[{pt:M()}],pr:[{pr:M()}],pb:[{pb:M()}],pl:[{pl:M()}],m:[{m:Ae()}],mx:[{mx:Ae()}],my:[{my:Ae()}],ms:[{ms:Ae()}],me:[{me:Ae()}],mbs:[{mbs:Ae()}],mbe:[{mbe:Ae()}],mt:[{mt:Ae()}],mr:[{mr:Ae()}],mb:[{mb:Ae()}],ml:[{ml:Ae()}],"space-x":[{"space-x":M()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":M()}],"space-y-reverse":["space-y-reverse"],size:[{size:se()}],"inline-size":[{inline:["auto",...re()]}],"min-inline-size":[{"min-inline":["auto",...re()]}],"max-inline-size":[{"max-inline":["none",...re()]}],"block-size":[{block:["auto",...ze()]}],"min-block-size":[{"min-block":["auto",...ze()]}],"max-block-size":[{"max-block":["none",...ze()]}],w:[{w:[o,"screen",...se()]}],"min-w":[{"min-w":[o,"screen","none",...se()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[a]},...se()]}],h:[{h:["screen","lh",...se()]}],"min-h":[{"min-h":["screen","lh","none",...se()]}],"max-h":[{"max-h":["screen","lh",...se()]}],"font-size":[{text:["base",n,Ei,Ss]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Gb,Fb]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Sl,ke]}],"font-family":[{font:[Hb,Ub,t]}],"font-features":[{"font-features":[ke]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,_e,ke]}],"line-clamp":[{"line-clamp":[et,"none",_e,id]}],leading:[{leading:[i,...M()]}],"list-image":[{"list-image":["none",_e,ke]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",_e,ke]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:ie()}],"text-color":[{text:ie()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...C(),"wavy"]}],"text-decoration-thickness":[{decoration:[et,"from-font","auto",_e,Ss]}],"text-decoration-color":[{decoration:ie()}],"underline-offset":[{"underline-offset":[et,"auto",_e,ke]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"tab-size":[{tab:[nr,_e,ke]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",_e,ke]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",_e,ke]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:je()}],"bg-repeat":[{bg:rt()}],"bg-size":[{bg:ot()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},nr,_e,ke],radial:["",_e,ke],conic:[nr,_e,ke]},jb,qb]}],"bg-color":[{bg:ie()}],"gradient-from-pos":[{from:Ft()}],"gradient-via-pos":[{via:Ft()}],"gradient-to-pos":[{to:Ft()}],"gradient-from":[{from:ie()}],"gradient-via":[{via:ie()}],"gradient-to":[{to:ie()}],rounded:[{rounded:st()}],"rounded-s":[{"rounded-s":st()}],"rounded-e":[{"rounded-e":st()}],"rounded-t":[{"rounded-t":st()}],"rounded-r":[{"rounded-r":st()}],"rounded-b":[{"rounded-b":st()}],"rounded-l":[{"rounded-l":st()}],"rounded-ss":[{"rounded-ss":st()}],"rounded-se":[{"rounded-se":st()}],"rounded-ee":[{"rounded-ee":st()}],"rounded-es":[{"rounded-es":st()}],"rounded-tl":[{"rounded-tl":st()}],"rounded-tr":[{"rounded-tr":st()}],"rounded-br":[{"rounded-br":st()}],"rounded-bl":[{"rounded-bl":st()}],"border-w":[{border:at()}],"border-w-x":[{"border-x":at()}],"border-w-y":[{"border-y":at()}],"border-w-s":[{"border-s":at()}],"border-w-e":[{"border-e":at()}],"border-w-bs":[{"border-bs":at()}],"border-w-be":[{"border-be":at()}],"border-w-t":[{"border-t":at()}],"border-w-r":[{"border-r":at()}],"border-w-b":[{"border-b":at()}],"border-w-l":[{"border-l":at()}],"divide-x":[{"divide-x":at()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":at()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...C(),"hidden","none"]}],"divide-style":[{divide:[...C(),"hidden","none"]}],"border-color":[{border:ie()}],"border-color-x":[{"border-x":ie()}],"border-color-y":[{"border-y":ie()}],"border-color-s":[{"border-s":ie()}],"border-color-e":[{"border-e":ie()}],"border-color-bs":[{"border-bs":ie()}],"border-color-be":[{"border-be":ie()}],"border-color-t":[{"border-t":ie()}],"border-color-r":[{"border-r":ie()}],"border-color-b":[{"border-b":ie()}],"border-color-l":[{"border-l":ie()}],"divide-color":[{divide:ie()}],"outline-style":[{outline:[...C(),"none","hidden"]}],"outline-offset":[{"outline-offset":[et,_e,ke]}],"outline-w":[{outline:["",et,Ei,Ss]}],"outline-color":[{outline:ie()}],shadow:[{shadow:["","none",u,Aa,Ea]}],"shadow-color":[{shadow:ie()}],"inset-shadow":[{"inset-shadow":["none",p,Aa,Ea]}],"inset-shadow-color":[{"inset-shadow":ie()}],"ring-w":[{ring:at()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:ie()}],"ring-offset-w":[{"ring-offset":[et,Ss]}],"ring-offset-color":[{"ring-offset":ie()}],"inset-ring-w":[{"inset-ring":at()}],"inset-ring-color":[{"inset-ring":ie()}],"text-shadow":[{"text-shadow":["none",m,Aa,Ea]}],"text-shadow-color":[{"text-shadow":ie()}],opacity:[{opacity:[et,_e,ke]}],"mix-blend":[{"mix-blend":[...le(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":le()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[et]}],"mask-image-linear-from-pos":[{"mask-linear-from":Q()}],"mask-image-linear-to-pos":[{"mask-linear-to":Q()}],"mask-image-linear-from-color":[{"mask-linear-from":ie()}],"mask-image-linear-to-color":[{"mask-linear-to":ie()}],"mask-image-t-from-pos":[{"mask-t-from":Q()}],"mask-image-t-to-pos":[{"mask-t-to":Q()}],"mask-image-t-from-color":[{"mask-t-from":ie()}],"mask-image-t-to-color":[{"mask-t-to":ie()}],"mask-image-r-from-pos":[{"mask-r-from":Q()}],"mask-image-r-to-pos":[{"mask-r-to":Q()}],"mask-image-r-from-color":[{"mask-r-from":ie()}],"mask-image-r-to-color":[{"mask-r-to":ie()}],"mask-image-b-from-pos":[{"mask-b-from":Q()}],"mask-image-b-to-pos":[{"mask-b-to":Q()}],"mask-image-b-from-color":[{"mask-b-from":ie()}],"mask-image-b-to-color":[{"mask-b-to":ie()}],"mask-image-l-from-pos":[{"mask-l-from":Q()}],"mask-image-l-to-pos":[{"mask-l-to":Q()}],"mask-image-l-from-color":[{"mask-l-from":ie()}],"mask-image-l-to-color":[{"mask-l-to":ie()}],"mask-image-x-from-pos":[{"mask-x-from":Q()}],"mask-image-x-to-pos":[{"mask-x-to":Q()}],"mask-image-x-from-color":[{"mask-x-from":ie()}],"mask-image-x-to-color":[{"mask-x-to":ie()}],"mask-image-y-from-pos":[{"mask-y-from":Q()}],"mask-image-y-to-pos":[{"mask-y-to":Q()}],"mask-image-y-from-color":[{"mask-y-from":ie()}],"mask-image-y-to-color":[{"mask-y-to":ie()}],"mask-image-radial":[{"mask-radial":[_e,ke]}],"mask-image-radial-from-pos":[{"mask-radial-from":Q()}],"mask-image-radial-to-pos":[{"mask-radial-to":Q()}],"mask-image-radial-from-color":[{"mask-radial-from":ie()}],"mask-image-radial-to-color":[{"mask-radial-to":ie()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":I()}],"mask-image-conic-pos":[{"mask-conic":[et]}],"mask-image-conic-from-pos":[{"mask-conic-from":Q()}],"mask-image-conic-to-pos":[{"mask-conic-to":Q()}],"mask-image-conic-from-color":[{"mask-conic-from":ie()}],"mask-image-conic-to-color":[{"mask-conic-to":ie()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:je()}],"mask-repeat":[{mask:rt()}],"mask-size":[{mask:ot()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",_e,ke]}],filter:[{filter:["","none",_e,ke]}],blur:[{blur:de()}],brightness:[{brightness:[et,_e,ke]}],contrast:[{contrast:[et,_e,ke]}],"drop-shadow":[{"drop-shadow":["","none",f,Aa,Ea]}],"drop-shadow-color":[{"drop-shadow":ie()}],grayscale:[{grayscale:["",et,_e,ke]}],"hue-rotate":[{"hue-rotate":[et,_e,ke]}],invert:[{invert:["",et,_e,ke]}],saturate:[{saturate:[et,_e,ke]}],sepia:[{sepia:["",et,_e,ke]}],"backdrop-filter":[{"backdrop-filter":["","none",_e,ke]}],"backdrop-blur":[{"backdrop-blur":de()}],"backdrop-brightness":[{"backdrop-brightness":[et,_e,ke]}],"backdrop-contrast":[{"backdrop-contrast":[et,_e,ke]}],"backdrop-grayscale":[{"backdrop-grayscale":["",et,_e,ke]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[et,_e,ke]}],"backdrop-invert":[{"backdrop-invert":["",et,_e,ke]}],"backdrop-opacity":[{"backdrop-opacity":[et,_e,ke]}],"backdrop-saturate":[{"backdrop-saturate":[et,_e,ke]}],"backdrop-sepia":[{"backdrop-sepia":["",et,_e,ke]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":M()}],"border-spacing-x":[{"border-spacing-x":M()}],"border-spacing-y":[{"border-spacing-y":M()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",_e,ke]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[et,"initial",_e,ke]}],ease:[{ease:["linear","initial",S,_e,ke]}],delay:[{delay:[et,_e,ke]}],animate:[{animate:["none",N,_e,ke]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,_e,ke]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:Ie()}],"rotate-x":[{"rotate-x":Ie()}],"rotate-y":[{"rotate-y":Ie()}],"rotate-z":[{"rotate-z":Ie()}],scale:[{scale:Ge()}],"scale-x":[{"scale-x":Ge()}],"scale-y":[{"scale-y":Ge()}],"scale-z":[{"scale-z":Ge()}],"scale-3d":["scale-3d"],skew:[{skew:Le()}],"skew-x":[{"skew-x":Le()}],"skew-y":[{"skew-y":Le()}],transform:[{transform:[_e,ke,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Te()}],"translate-x":[{"translate-x":Te()}],"translate-y":[{"translate-y":Te()}],"translate-z":[{"translate-z":Te()}],"translate-none":["translate-none"],zoom:[{zoom:[nr,_e,ke]}],accent:[{accent:ie()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:ie()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",_e,ke]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":ie()}],"scrollbar-track-color":[{"scrollbar-track":ie()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mbs":[{"scroll-mbs":M()}],"scroll-mbe":[{"scroll-mbe":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pbs":[{"scroll-pbs":M()}],"scroll-pbe":[{"scroll-pbe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",_e,ke]}],fill:[{fill:["none",...ie()]}],"stroke-w":[{stroke:[et,Ei,Ss,id]}],stroke:[{stroke:["none",...ie()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Wb=Ab(Kb);function pt(...e){return Wb(cp(e))}const nt=Re({__name:"Button",props:{variant:{},size:{},class:{type:[Boolean,null,String,Object,Array]},asChild:{type:Boolean},as:{default:"button"}},setup(e){const t=e;return(n,r)=>(O(),xe(g(P4),{as:e.as,"as-child":e.asChild,class:At(g(pt)(g(Qb)({variant:e.variant,size:e.size}),t.class))},{default:D(()=>[Ve(n.$slots,"default")]),_:3},8,["as","as-child","class"]))}}),Qb=g0("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",xs:"h-7 rounded px-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}}),ld=Re({__name:"ScrollBar",props:{orientation:{default:"vertical"},forceMount:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,n=Vt(t,"class");return(r,s)=>(O(),xe(g(B4),It(g(n),{class:g(pt)("flex touch-none select-none transition-colors",e.orientation==="vertical"&&"h-full w-2.5 p-px",e.orientation==="horizontal"&&"h-2.5 flex-col p-px",t.class)}),{default:D(()=>[T(g(L4),{class:"relative flex-1 rounded-full bg-[var(--scrollbar-thumb)] transition-colors hover:bg-[var(--scrollbar-thumb-hover)]"})]),_:1},16,["class"]))}}),Rn=Re({__name:"ScrollArea",props:{type:{},dir:{},scrollHideDelay:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]},style:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,n=Vt(t,"class","style");return(r,s)=>(O(),xe(g(F4),It(g(n),{class:g(pt)("relative overflow-hidden",t.class),style:t.style}),{default:D(()=>[T(g(U4),{class:"h-full w-full rounded-[inherit]"},{default:D(()=>[Ve(r.$slots,"default")]),_:3}),T(ld),T(ld,{orientation:"horizontal"}),T(g(q4))]),_:3},16,["class","style"]))}}),_p=Re({__name:"Toggle",props:{defaultValue:{type:Boolean},modelValue:{type:[Boolean,null]},disabled:{type:Boolean,default:!1},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean},class:{type:[Boolean,null,String,Object,Array]},variant:{default:"default"},size:{default:"default"}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=t,s=Vt(n,"class","size","variant"),i=Wn(s,r);return(a,o)=>(O(),xe(g(H4),It(g(i),{class:g(pt)(g(Ep)({variant:e.variant,size:e.size}),n.class)}),{default:D(l=>[Ve(a.$slots,"default",On(Qn(l)))]),_:3},16,["class"]))}}),Ep=g0("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}}),Ap=Re({__name:"ToggleGroup",props:{rovingFocus:{type:Boolean},disabled:{type:Boolean},orientation:{},dir:{},loop:{type:Boolean},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean},type:{},modelValue:{},defaultValue:{},class:{type:[Boolean,null,String,Object,Array]},variant:{},size:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=t;Qa("toggleGroup",{variant:n.variant,size:n.size});const s=Vt(n,"class"),i=Wn(s,r);return(a,o)=>(O(),xe(g(V4),It(g(i),{class:g(pt)("flex items-center justify-center gap-1",n.class)}),{default:D(l=>[Ve(a.$slots,"default",On(Qn(l)))]),_:3},16,["class"]))}}),oo=Re({__name:"ToggleGroupItem",props:{value:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]},variant:{},size:{}},setup(e){const t=e,n=Cr("toggleGroup"),r=Vt(t,"class","size","variant"),s=hr(r);return(i,a)=>(O(),xe(g(j4),It(g(s),{class:g(pt)(g(Ep)({variant:g(n)?.variant||e.variant,size:g(n)?.size||e.size}),t.class)}),{default:D(o=>[Ve(i.$slots,"default",On(Qn(o)))]),_:3},16,["class"]))}});const cd=e=>e==="";const Jb=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();const ud=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const Yb=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());const Xb=e=>{const t=Yb(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Hs={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};const ey=Symbol("lucide-icons");function ty(){return Cr(ey,{})}const ny=({name:e,iconNode:t,absoluteStrokeWidth:n,"absolute-stroke-width":r,strokeWidth:s,"stroke-width":i,size:a,color:o,...l},{slots:c})=>{const{size:u,color:p,strokeWidth:m=2,absoluteStrokeWidth:f=!1,class:y=""}=ty(),b=Se(()=>{const x=cd(n)||cd(r)||n===!0||r===!0||f===!0,S=s||i||m||Hs["stroke-width"];return x?Number(S)*24/Number(a??u??Hs.width):S});return Wi("svg",{...Hs,...l,width:a??u??Hs.width,height:a??u??Hs.height,stroke:o??p??Hs.stroke,"stroke-width":b.value,class:Jb("lucide",y,...e?[`lucide-${ud(Xb(e))}-icon`,`lucide-${ud(e)}`]:["lucide-icon"])},[...t.map(x=>Wi(...x)),...c.default?[c.default()]:[]])};const St=(e,t)=>(n,{slots:r,attrs:s})=>Wi(ny,{...s,...n,iconNode:t,name:e},r.default?{default:r.default}:void 0);const ry=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],sy=St("activity",ry);const iy=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],ay=St("arrow-up",iy);const oy=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}]],ly=St("ban",oy);const cy=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],uy=St("bot",cy);const dy=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Tp=St("check",dy);const fy=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ip=St("chevron-down",fy);const hy=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],py=St("chevron-left",hy);const my=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],gy=St("chevron-right",my);const vy=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],by=St("chevron-up",vy);const yy=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],wy=St("circle-alert",yy);const Sy=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],xy=St("circle-check",Sy);const ky=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],_y=St("code-xml",ky);const Ey=[["path",{d:"m15 10 5 5-5 5",key:"qqa56n"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]],Ay=St("corner-down-right",Ey);const Ty=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Rp=St("external-link",Ty);const Iy=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],Ry=St("globe",Iy);const Cy=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Oy=St("info",Cy);const My=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Ny=St("loader-circle",My);const zy=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],dd=St("monitor",zy);const $y=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],Dy=St("play",$y);const Py=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],vc=St("plus",Py);const By=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]],fd=St("puzzle",By);const Ly=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 9H3",key:"1338ky"}],["path",{d:"M21 15H3",key:"9uk58r"}]],hd=St("rows-3",Ly);const Fy=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Uy=St("settings",Fy);const qy=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],Hy=St("sparkles",qy);const Vy=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],jy=St("square-terminal",Vy);const Gy=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Zy=St("square",Gy);const Ky=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Wy=St("triangle-alert",Ky);const Qy=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ms=St("x",Qy),Cp=Re({__name:"ContextMenu",props:{pressOpenDelay:{},dir:{},modal:{type:Boolean}},emits:["update:open"],setup(e,{emit:t}){const s=Wn(e,t);return(i,a)=>(O(),xe(g(G4),On(Qn(g(s))),{default:D(()=>[Ve(i.$slots,"default")]),_:3},16))}}),Op=Re({__name:"ContextMenuContent",props:{forceMount:{type:Boolean},loop:{type:Boolean},sideFlip:{type:Boolean},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},hideShiftedArrow:{type:Boolean},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","closeAutoFocus"],setup(e,{emit:t}){const n=e,r=t,s=Vt(n,"class"),i=Wn(s,r);return(a,o)=>(O(),xe(g(Z4),null,{default:D(()=>[T(g(K4),It(g(i),{class:g(pt)("z-50 min-w-32 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n.class)}),{default:D(()=>[Ve(a.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),Gs=Re({__name:"ContextMenuItem",props:{disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]},inset:{type:Boolean}},emits:["select"],setup(e,{emit:t}){const n=e,r=t,s=Vt(n,"class"),i=Wn(s,r);return(a,o)=>(O(),xe(g(W4),It(g(i),{class:g(pt)("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e.inset&&"pl-8",n.class)}),{default:D(()=>[Ve(a.$slots,"default")]),_:3},16,["class"]))}}),xl=Re({__name:"ContextMenuSeparator",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,n=Vt(t,"class");return(r,s)=>(O(),xe(g(Q4),It(g(n),{class:g(pt)("-mx-1 my-1 h-px bg-border",t.class)}),null,16,["class"]))}}),Mp=Re({__name:"ContextMenuTrigger",props:{disabled:{type:Boolean},asChild:{type:Boolean},as:{}},setup(e){const n=hr(e);return(r,s)=>(O(),xe(g(J4),On(Qn(g(n))),{default:D(()=>[Ve(r.$slots,"default")]),_:3},16))}}),Jy=Re({__name:"HoverCard",props:{defaultOpen:{type:Boolean},open:{type:Boolean},openDelay:{},closeDelay:{}},emits:["update:open"],setup(e,{emit:t}){const s=Wn(e,t);return(i,a)=>(O(),xe(g(Y4),On(Qn(g(s))),{default:D(()=>[Ve(i.$slots,"default")]),_:3},16))}}),Yy=Re({__name:"HoverCardContent",props:{forceMount:{type:Boolean},side:{},sideOffset:{default:4},sideFlip:{type:Boolean},align:{},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},hideShiftedArrow:{type:Boolean},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,n=Vt(t,"class"),r=hr(n);return(s,i)=>(O(),xe(g(X4),null,{default:D(()=>[T(g(ev),It(g(r),{class:g(pt)("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t.class)}),{default:D(()=>[Ve(s.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),Xy=Re({__name:"HoverCardTrigger",props:{reference:{},asChild:{type:Boolean},as:{}},setup(e){const t=e;return(n,r)=>(O(),xe(g(tv),On(Qn(t)),{default:D(()=>[Ve(n.$slots,"default")]),_:3},16))}}),Np="task-handoff-workspace-tabs",zp="task-handoff-workspace-settings",e3={type:"ai-sessions",id:"ai-sessions",title:"AI Sessions"};function da(e){if(e.kind==="gui"){const t=w0(e);return t?{type:"shared-vnc",id:`shared-vnc:${t}`,sessionId:e.id,displaySessionId:t,title:t3(t)}:{type:"app-vnc",id:`vnc:${e.id}`,sessionId:e.id,title:e.title}}return e.kind==="web"?{type:"app-web",id:`web:${e.id}`,sessionId:e.id,title:e.title}:{type:"app-tty",id:`tty:${e.id}`,sessionId:e.id,title:e.title}}function y0(e,t){if(e&&e.type!=="ai-sessions")return e.type==="shared-vnc"?n3(t.filter(n=>n.status==="running"&&n.kind==="gui"&&!!n.vnc&&w0(n)===e.displaySessionId))||t.find(n=>n.id===e.sessionId):t.find(n=>n.id===e.sessionId)}function ti(e){return new Set(e.map(t=>t.status==="running"?w0(t):void 0).filter(t=>!!t))}function w0(e){return e.display?.mode==="shared"?e.display.displaySessionId||"main":void 0}function t3(e){return e==="main"?"Shared Screen":`Shared ${e}`}function n3(e){return[...e].sort((t,n)=>(n.updatedAt||n.createdAt).localeCompare(t.updatedAt||t.createdAt))[0]}function pd(){try{const e=JSON.parse(localStorage.getItem(Np)||"[]");return Array.isArray(e)?e:[]}catch{return[]}}function Ai(e){localStorage.setItem(Np,JSON.stringify(e))}function r3(){try{const e=JSON.parse(localStorage.getItem(zp)||"{}");return{guiHidpi:typeof e.guiHidpi=="boolean"?e.guiHidpi:!0}}catch{return{guiHidpi:!0}}}function s3(e){localStorage.setItem(zp,JSON.stringify(e))}const fi=l0("workspace",{state:()=>({tabs:pd(),activeTabId:pd()[0]?.id||"",vncResizeMode:"scale",guiHidpi:r3().guiHidpi}),actions:{open(e){const t=this.tabs.find(n=>n.id===e.id);t?Object.assign(t,e):this.tabs.push(e),this.activeTabId=e.id,Ai(this.tabs)},close(e){const t=this.tabs.findIndex(n=>n.id===e);t!==-1&&(this.tabs.splice(t,1),this.activeTabId===e&&(this.activeTabId=this.tabs[Math.max(0,t-1)]?.id||this.tabs[0]?.id||""),Ai(this.tabs))},setActive(e){this.tabs.some(t=>t.id===e)&&(this.activeTabId=e)},setVncResizeMode(e){this.vncResizeMode=e},setGuiHidpi(e){this.guiHidpi=e,s3({guiHidpi:this.guiHidpi})},moveTab(e,t,n="before"){if(e===t)return;const r=this.tabs.findIndex(o=>o.id===e);if(r===-1||!this.tabs.some(o=>o.id===t))return;const[s]=this.tabs.splice(r,1),i=this.tabs.findIndex(o=>o.id===t),a=n==="after"?i+1:i;this.tabs.splice(a,0,s),Ai(this.tabs)},syncSessionTitles(e){const t=new Map(e.map(r=>[r.id,r.title]));let n=!1;for(const r of this.tabs){if(r.type==="ai-sessions"||r.type==="shared-vnc")continue;const s=t.get(r.sessionId);if(!s)continue;const i=r.type==="logs"?`${s} logs`:s;r.title!==i&&(r.title=i,n=!0)}n&&Ai(this.tabs)},pruneSession(e,t=new Set){const n=this.tabs.filter(r=>r.type==="ai-sessions"?!0:r.type==="shared-vnc"&&t.has(r.displaySessionId)||e.has(r.sessionId));n.length!==this.tabs.length&&(this.tabs=n,this.tabs.some(r=>r.id===this.activeTabId)||(this.activeTabId=this.tabs[0]?.id||""),Ai(this.tabs))}}}),i3={class:"desktop-launcher","aria-label":"App launcher"},a3={class:"launcher-item"},o3=["title","disabled","onClick"],l3={class:"launcher-icon"},c3={class:"launcher-label"},u3={key:0,class:"launcher-running"},d3={class:"launcher-popover-content"},f3={class:"launcher-popover-head"},h3={class:"launcher-popover-meta"},p3=["disabled","onClick"],m3=["onClick"],g3={class:"launcher-session-title"},v3={class:"launcher-session-meta"},b3=["onClick"],y3={key:0,class:"launcher-session-empty"},w3={class:"launcher-icon"},S3={class:"launcher-icon"},x3={class:"launcher-icon"},k3={class:"launcher-icon"},_3=Re({__name:"LauncherView",emits:["open-settings"],setup(e){const t=hs(),n=rp(),r=di(),s=fi(),i=Oe(""),a=[{label:"New 1280 x 720",width:1280,height:720,depth:24},{label:"New 1440 x 900",width:1440,height:900,depth:24},{label:"New 1920 x 1080",width:1920,height:1080,depth:24}],o=Se(()=>{const _=["vscode-web","chromium","terminal-tty","codex","claude","terminal-gui"],L=n.data.value||[];return[..._.map(M=>L.find(G=>G.id===M)).filter(M=>!!M),...L.filter(M=>!_.includes(M.id))]});function l(_,L){return _==="vscode-web"||L==="web"?_y:_==="chromium"?Ry:_==="terminal-tty"?jy:_==="codex"?uy:_==="claude"?Hy:_==="terminal-gui"||L==="gui"?dd:fd}function c(_){return(r.data.value||[]).filter(L=>L.appId===_&&L.status==="running")}function u(_){return[...c(_)].sort((L,M)=>(M.updatedAt||M.createdAt).localeCompare(L.updatedAt||L.createdAt))[0]}function p(_){return _.replace(/^app_/,"").slice(0,12)}async function m(_){const L=u(_.id);if(L){I(L);return}await f(_)}async function f(_,L={}){i.value=_.id;try{const M=await ap(_.id,y(_,L));I(M),await t.invalidateQueries({queryKey:["status"]})}finally{i.value=""}}function y(_,L){if(_.kind!=="gui")return L;const M=s.guiHidpi?b():1,G={...L.env||{}};G.TASK_HANDOFF_GUI_SCALE||(G.TASK_HANDOFF_GUI_SCALE=x(M));const P=S(L.display||_.display,M);return{...L,env:G,...P?{display:P}:{}}}function b(){const _=typeof window>"u"?1:window.devicePixelRatio||1;return Math.min(3,Math.max(1,_))}function x(_){return _.toFixed(2).replace(/\.?0+$/,"")}function S(_,L){return!_?.width||!_.height?_:{..._,width:Math.round(_.width*L),height:Math.round(_.height*L)}}async function N(_){const L=c(_.id);if(!L.length)return;await Promise.all(L.map(P=>Os(P.id)));const M=new Set(L.map(P=>P.id)),G=(r.data.value||[]).filter(P=>!M.has(P.id));s.pruneSession(new Set(G.map(P=>P.id)),ti(G)),await t.invalidateQueries({queryKey:["status"]})}async function z(_){await Os(_.id);const L=(r.data.value||[]).filter(M=>M.id!==_.id);s.pruneSession(new Set(L.map(M=>M.id)),ti(L)),await t.invalidateQueries({queryKey:["status"]})}function I(_){s.open(da(_))}function E(){s.open(e3)}return(_,L)=>(O(),j("aside",i3,[(O(!0),j(lt,null,Ht(o.value,M=>(O(),xe(g(Cp),{key:M.id},{default:D(()=>[T(g(Jy),{"open-delay":250,"close-delay":150},{default:D(()=>[T(g(Mp),{"as-child":""},{default:D(()=>[T(g(Xy),{"as-child":""},{default:D(()=>[k("div",a3,[k("button",{type:"button",class:"launcher-button",title:M.name,disabled:i.value===M.id,onClick:G=>m(M)},[k("span",l3,[(O(),xe(js(l(M.id,M.kind)),{size:22}))]),k("span",c3,K(M.name),1),c(M.id).length?(O(),j("span",u3,K(c(M.id).length),1)):pe("",!0)],8,o3)])]),_:2},1024)]),_:2},1024),T(g(Yy),{class:"launcher-popover p-0",side:"right",align:"start","side-offset":8},{default:D(()=>[k("div",d3,[k("div",f3,[k("strong",null,K(M.name),1),k("div",h3,[k("span",null,K(c(M.id).length)+" running",1),k("button",{type:"button",class:"launcher-new-instance",title:"New instance","aria-label":"New instance",disabled:i.value===M.id,onClick:en(G=>f(M),["stop"])},[T(g(vc),{size:14,"stroke-width":2.2})],8,p3)])]),(O(!0),j(lt,null,Ht(c(M.id),G=>(O(),j("div",{key:G.id,class:"launcher-session",role:"menuitem"},[k("button",{type:"button",class:"launcher-session-open",onClick:P=>I(G)},[k("span",g3,K(G.title),1),k("span",v3,K(G.kind)+" · "+K(p(G.id)),1)],8,m3),k("button",{type:"button",class:"launcher-session-close",title:"Stop session","aria-label":"Stop session",onClick:en(P=>z(G),["stop"])},[T(g(Ms),{size:14,"stroke-width":2.2})],8,b3)]))),128)),c(M.id).length?pe("",!0):(O(),j("div",y3,"No running sessions"))])]),_:2},1024)]),_:2},1024),T(g(Op),{class:"launcher-context-menu"},{default:D(()=>[T(g(Gs),{class:"launcher-context-item",onSelect:G=>m(M)},{default:D(()=>[T(g(Dy),{size:15}),L[3]||(L[3]=k("span",null,"Open",-1))]),_:1},8,["onSelect"]),T(g(Gs),{class:"launcher-context-item",onSelect:G=>f(M)},{default:D(()=>[T(g(vc),{size:15}),L[4]||(L[4]=k("span",null,"New Instance",-1))]),_:1},8,["onSelect"]),M.kind==="gui"?(O(),j(lt,{key:0},[T(g(xl)),T(g(Gs),{class:"launcher-context-item",onSelect:G=>f(M,{displayTarget:{mode:"shared",id:"main",autoCreate:!0}})},{default:D(()=>[T(g(hd),{size:15}),L[5]||(L[5]=k("span",null,"Open Shared Screen",-1))]),_:1},8,["onSelect"]),T(g(xl)),(O(),j(lt,null,Ht(a,G=>T(g(Gs),{key:G.label,class:"launcher-context-item",onSelect:P=>f(M,{displayTarget:{mode:"isolated"},display:{width:G.width,height:G.height,depth:G.depth}})},{default:D(()=>[T(g(dd),{size:15}),k("span",null,K(G.label),1)]),_:2},1032,["onSelect"])),64))],64)):pe("",!0),c(M.id).length?(O(),j(lt,{key:1},[T(g(xl)),T(g(Gs),{class:"launcher-context-item danger",onSelect:G=>N(M)},{default:D(()=>[T(g(Ms),{size:15}),L[6]||(L[6]=k("span",null,"Close All",-1))]),_:1},8,["onSelect"])],64)):pe("",!0)]),_:2},1024)]),_:2},1024))),128)),L[11]||(L[11]=k("div",{class:"launcher-spacer"},null,-1)),k("button",{type:"button",class:"launcher-button",title:"AI Sessions",onClick:E},[k("span",w3,[T(g(sy),{size:22})]),L[7]||(L[7]=k("span",{class:"launcher-label"},"AI",-1))]),k("button",{type:"button",class:"launcher-button",title:"Custom Apps",onClick:L[0]||(L[0]=M=>_.$emit("open-settings","apps"))},[k("span",S3,[T(g(fd),{size:22})]),L[8]||(L[8]=k("span",{class:"launcher-label"},"Apps",-1))]),k("button",{type:"button",class:"launcher-button",title:"Sessions",onClick:L[1]||(L[1]=M=>_.$emit("open-settings","sessions"))},[k("span",x3,[T(g(hd),{size:22})]),L[9]||(L[9]=k("span",{class:"launcher-label"},"Sessions",-1))]),k("button",{type:"button",class:"launcher-button",title:"Settings",onClick:L[2]||(L[2]=M=>_.$emit("open-settings","general"))},[k("span",k3,[T(g(Uy),{size:22})]),L[10]||(L[10]=k("span",{class:"launcher-label"},"Settings",-1))])]))}}),$p=Re({__name:"Dialog",props:{open:{type:Boolean},defaultOpen:{type:Boolean},modal:{type:Boolean}},emits:["update:open"],setup(e,{emit:t}){const s=Wn(e,t);return(i,a)=>(O(),xe(g(nv),On(Qn(g(s))),{default:D(()=>[Ve(i.$slots,"default")]),_:3},16))}}),Dp=Re({__name:"DialogContent",props:{forceMount:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]},style:{type:[Boolean,null,String,Object,Array]}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const n=e,r=t,s=Vt(n,"class","style"),i=Wn(s,r);return(a,o)=>(O(),xe(g(av),null,{default:D(()=>[T(g(rv),{class:"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"}),T(g(sv),It(g(i),{style:n.style,class:g(pt)("fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border bg-background p-4 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",n.class)}),{default:D(()=>[Ve(a.$slots,"default"),T(g(iv),{class:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground"},{default:D(()=>[T(g(Ms),{class:"w-4 h-4"}),o[0]||(o[0]=k("span",{class:"sr-only"},"Close",-1))]),_:1})]),_:3},16,["style","class"])]),_:3}))}}),Pp=Re({__name:"DialogDescription",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,n=Vt(t,"class"),r=hr(n);return(s,i)=>(O(),xe(g(ov),It(g(r),{class:g(pt)("text-sm text-muted-foreground",t.class)}),{default:D(()=>[Ve(s.$slots,"default")]),_:3},16,["class"]))}}),Bp=Re({__name:"DialogTitle",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,n=Vt(t,"class"),r=hr(n);return(s,i)=>(O(),xe(g(lv),It(g(r),{class:g(pt)("text-lg font-semibold leading-none tracking-tight",t.class)}),{default:D(()=>[Ve(s.$slots,"default")]),_:3},16,["class"]))}}),E3=Re({__name:"Tabs",props:{defaultValue:{},orientation:{},dir:{},activationMode:{},modelValue:{},unmountOnHide:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["update:modelValue"],setup(e,{emit:t}){const s=Wn(e,t);return(i,a)=>(O(),xe(g(cv),On(Qn(g(s))),{default:D(()=>[Ve(i.$slots,"default")]),_:3},16))}}),kl=Re({__name:"TabsContent",props:{value:{},forceMount:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,n=Vt(t,"class");return(r,s)=>(O(),xe(g(uv),It({class:g(pt)("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t.class)},g(n)),{default:D(()=>[Ve(r.$slots,"default")]),_:3},16,["class"]))}}),A3=Re({__name:"TabsList",props:{loop:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,n=Vt(t,"class");return(r,s)=>(O(),xe(g(dv),It(g(n),{class:g(pt)("inline-flex items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",t.class)}),{default:D(()=>[Ve(r.$slots,"default")]),_:3},16,["class"]))}}),T3={class:"truncate"},I3=Re({__name:"TabsTrigger",props:{value:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,n=Vt(t,"class"),r=hr(n);return(s,i)=>(O(),xe(g(fv),It(g(r),{class:g(pt)("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",t.class)}),{default:D(()=>[k("span",T3,[Ve(s.$slots,"default")])]),_:3},16,["class"]))}}),R3={class:"panel"},C3={key:0,class:"stats"},O3={key:1,class:"diagnostics-grid"},M3={class:"diagnostics-card"},N3={class:"diagnostics-card"},z3={class:"diagnostics-list"},$3={class:"diagnostics-card diagnostics-wide"},D3={class:"diagnostics-list storage-list"},Lp=Re({__name:"DashboardView",setup(e){const t=tp(),n=V2();function r(s){const i=new Date(s);return Number.isNaN(i.getTime())?s:i.toLocaleString()}return(s,i)=>(O(),j("section",R3,[i[10]||(i[10]=k("h1",null,"Dashboard",-1)),g(t).data.value?(O(),j("dl",C3,[k("div",null,[i[0]||(i[0]=k("dt",null,"Running apps",-1)),k("dd",null,K(g(t).data.value.runningAppCount),1)]),k("div",null,[i[1]||(i[1]=k("dt",null,"Version",-1)),k("dd",null,K(g(t).data.value.version),1)]),k("div",null,[i[2]||(i[2]=k("dt",null,"Started",-1)),k("dd",null,K(r(g(t).data.value.startedAt)),1)])])):pe("",!0),g(n).data.value?(O(),j("section",O3,[k("div",M3,[i[7]||(i[7]=k("h2",null,"Runtime",-1)),k("dl",null,[k("div",null,[i[3]||(i[3]=k("dt",null,"Platform",-1)),k("dd",null,K(g(n).data.value.runtime.platform)+" / "+K(g(n).data.value.runtime.arch),1)]),k("div",null,[i[4]||(i[4]=k("dt",null,"Linux runtime",-1)),k("dd",null,K(g(n).data.value.runtime.linuxRuntime?"ready":"unsupported"),1)]),k("div",null,[i[5]||(i[5]=k("dt",null,"Node",-1)),k("dd",null,K(g(n).data.value.runtime.node),1)]),k("div",null,[i[6]||(i[6]=k("dt",null,"noVNC",-1)),k("dd",null,K(g(n).data.value.noVnc.available?g(n).data.value.noVnc.root:"missing"),1)])])]),k("div",N3,[i[8]||(i[8]=k("h2",null,"Commands",-1)),k("ul",z3,[(O(!0),j(lt,null,Ht(g(n).data.value.commands,a=>(O(),j("li",{key:a.name},[k("span",{class:At(a.available?"dot-ok":"dot-bad")},null,2),k("div",null,[k("strong",null,K(a.name),1),k("small",null,K(a.available?a.path:a.requiredFor.join(", ")),1)])]))),128))])]),k("div",$3,[i[9]||(i[9]=k("h2",null,"Storage",-1)),k("ul",D3,[(O(!0),j(lt,null,Ht(g(n).data.value.storage,a=>(O(),j("li",{key:a.key},[k("span",{class:At(a.writable?"dot-ok":"dot-bad")},null,2),k("div",null,[k("strong",null,K(a.key),1),k("small",null,K(a.writable?"writable":"not writable")+" · "+K(a.path),1)])]))),128))])])])):pe("",!0)]))}}),ts=Re({__name:"Badge",props:{variant:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(n,r)=>(O(),j("div",{class:At(g(pt)(g(P3)({variant:e.variant}),t.class))},[Ve(n.$slots,"default")],2))}}),P3=g0("inline-flex gap-1 items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}}),Tr=Re({__name:"Card",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(n,r)=>(O(),j("div",{class:At(g(pt)("rounded-xl border bg-card text-card-foreground shadow",t.class))},[Ve(n.$slots,"default")],2))}}),An=Re({__name:"CardContent",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(n,r)=>(O(),j("div",{class:At(g(pt)("p-6 pt-0",t.class))},[Ve(n.$slots,"default")],2))}}),Li=Re({__name:"CardDescription",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(n,r)=>(O(),j("p",{class:At(g(pt)("text-sm text-muted-foreground",t.class))},[Ve(n.$slots,"default")],2))}}),S0=Re({__name:"CardFooter",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(n,r)=>(O(),j("div",{class:At(g(pt)("flex items-center p-6 pt-0",t.class))},[Ve(n.$slots,"default")],2))}}),Fi=Re({__name:"CardHeader",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(n,r)=>(O(),j("div",{class:At(g(pt)("flex flex-col gap-y-1.5 p-6",t.class))},[Ve(n.$slots,"default")],2))}}),Ui=Re({__name:"CardTitle",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(n,r)=>(O(),j("h3",{class:At(g(pt)("font-semibold leading-none tracking-tight",t.class))},[Ve(n.$slots,"default")],2))}}),Et=Re({__name:"Input",props:{defaultValue:{},modelValue:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,s=Rh(n,"modelValue",t,{passive:!0,defaultValue:n.defaultValue});return(i,a)=>Mo((O(),j("input",{"onUpdate:modelValue":a[0]||(a[0]=o=>ss(s)?s.value=o:null),class:At(g(pt)("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",n.class))},null,2)),[[No,g(s)]])}}),lo=Re({__name:"Select",props:{open:{type:Boolean},defaultOpen:{type:Boolean},defaultValue:{},modelValue:{},by:{type:[String,Function]},dir:{},multiple:{type:Boolean},autocomplete:{},disabled:{type:Boolean},name:{},required:{type:Boolean}},emits:["update:modelValue","update:open"],setup(e,{emit:t}){const s=Wn(e,t);return(i,a)=>(O(),xe(g(hv),On(Qn(g(s))),{default:D(()=>[Ve(i.$slots,"default")]),_:3},16))}}),co=Re({inheritAttrs:!1,__name:"SelectContent",props:{forceMount:{type:Boolean},position:{default:"popper"},bodyLock:{type:Boolean},side:{},sideOffset:{},sideFlip:{type:Boolean},align:{},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},hideShiftedArrow:{type:Boolean},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},disableOutsidePointerEvents:{type:Boolean},class:{type:[Boolean,null,String,Object,Array]}},emits:["closeAutoFocus","escapeKeyDown","pointerDownOutside"],setup(e,{emit:t}){const n=e,r=t,s=Vt(n,"class"),i=Wn(s,r);return(a,o)=>(O(),xe(g(gv),null,{default:D(()=>[T(g(pv),It({...g(i),...a.$attrs},{class:g(pt)("relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e.position==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",n.class)}),{default:D(()=>[T(g(F3)),T(g(mv),{class:At(g(pt)("p-1",e.position==="popper"&&"h-(--reka-select-trigger-height) w-full min-w-(--reka-select-trigger-width)"))},{default:D(()=>[Ve(a.$slots,"default")]),_:3},8,["class"]),T(g(L3))]),_:3},16,["class"])]),_:3}))}}),B3={class:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center"},Jr=Re({__name:"SelectItem",props:{value:{},disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,n=Vt(t,"class"),r=hr(n);return(s,i)=>(O(),xe(g(yv),It(g(r),{class:g(pt)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t.class)}),{default:D(()=>[k("span",B3,[T(g(vv),null,{default:D(()=>[T(g(Tp),{class:"h-4 w-4"})]),_:1})]),T(g(bv),null,{default:D(()=>[Ve(s.$slots,"default")]),_:3})]),_:3},16,["class"]))}}),L3=Re({__name:"SelectScrollDownButton",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,n=Vt(t,"class"),r=hr(n);return(s,i)=>(O(),xe(g(wv),It(g(r),{class:g(pt)("flex cursor-default items-center justify-center py-1",t.class)}),{default:D(()=>[Ve(s.$slots,"default",{},()=>[T(g(Ip))])]),_:3},16,["class"]))}}),F3=Re({__name:"SelectScrollUpButton",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,n=Vt(t,"class"),r=hr(n);return(s,i)=>(O(),xe(g(Sv),It(g(r),{class:g(pt)("flex cursor-default items-center justify-center py-1",t.class)}),{default:D(()=>[Ve(s.$slots,"default",{},()=>[T(g(by))])]),_:3},16,["class"]))}}),uo=Re({__name:"SelectTrigger",props:{disabled:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,n=Vt(t,"class"),r=hr(n);return(s,i)=>(O(),xe(g(kv),It(g(r),{class:g(pt)("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:truncate text-start",t.class)}),{default:D(()=>[Ve(s.$slots,"default"),T(g(xv),{"as-child":""},{default:D(()=>[T(g(Ip),{class:"w-4 h-4 opacity-50 shrink-0"})]),_:1})]),_:3},16,["class"]))}}),fo=Re({__name:"SelectValue",props:{placeholder:{},asChild:{type:Boolean},as:{}},setup(e){const t=e;return(n,r)=>(O(),xe(g(_v),On(Qn(t)),{default:D(()=>[Ve(n.$slots,"default")]),_:3},16))}}),or=Re({__name:"Textarea",props:{class:{type:[Boolean,null,String,Object,Array]},defaultValue:{},modelValue:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,s=Rh(n,"modelValue",t,{passive:!0,defaultValue:n.defaultValue});return(i,a)=>Mo((O(),j("textarea",{"onUpdate:modelValue":a[0]||(a[0]=o=>ss(s)?s.value=o:null),class:At(g(pt)("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",n.class))},null,2)),[[No,g(s)]])}}),U3={class:"settings-pane"},q3={class:"section-head"},H3={key:0},V3={class:"custom-app-form"},j3={key:0,class:"display-fields"},G3={class:"catalog-actions"},Z3={key:0,class:"form-error"},K3={class:"form-error"},W3={class:"settings-list"},Q3={class:"catalog-head"},J3={class:"item-title"},Y3={class:"item-meta"},X3={class:"catalog-actions"},e5=Re({__name:"CustomAppsSettings",setup(e){const t=hs(),n=sp(),r=Oe("[]"),s=Oe(""),i=Oe(""),a=Xr({id:"",name:"",description:"",kind:"tty",command:"",args:"",cwd:"",envJson:"{}",width:"",height:"",depth:""}),o=Se(()=>{const z=n.error.value;return z?`Custom app catalog is invalid: ${z instanceof Error?z.message:String(z)}`:""});on(()=>n.data.value?.items,z=>{r.value=JSON.stringify(z||[],null,2)},{immediate:!0});function l(z,I,E){const _=z.trim();if(!_)return I;try{return JSON.parse(_)}catch(L){throw new Error(`${E} is invalid JSON: ${L instanceof Error?L.message:String(L)}`)}}function c(z){const I=z.trim();if(!I)return;const E=Number(I);if(!Number.isInteger(E)||E<=0)throw new Error("Display values must be positive integers.");return E}function u(z){return(z.match(/"[^"]*"|'[^']*'|\S+/g)||[]).map(E=>E.replace(/^(['"])(.*)\1$/,"$2"))}function p(){const z=JSON.parse(r.value||"[]");if(!Array.isArray(z))throw new Error("Custom Apps JSON must be an array.");return z}function m(){const z=a.id.trim(),I=a.name.trim(),E=a.command.trim();if(!z||!I||!E)throw new Error("Custom app id, name, and command are required.");const _={id:z,name:I,kind:a.kind,command:E};a.description.trim()&&(_.description=a.description.trim());const L=u(a.args);L.length&&(_.args=L),a.cwd.trim()&&(_.cwd=a.cwd.trim());const M=l(a.envJson,{},"Custom app env");if(!M||typeof M!="object"||Array.isArray(M)||Object.values(M).some(G=>typeof G!="string"))throw new Error("Custom app env JSON must be an object with string values.");if(Object.keys(M).length&&(_.env=M),a.kind==="gui"){const G={width:c(a.width),height:c(a.height),depth:c(a.depth)},P=Object.fromEntries(Object.entries(G).filter(([,W])=>W!==void 0));Object.keys(P).length&&(_.display=P)}return _}function f(){i.value="",Object.assign(a,{id:"",name:"",description:"",kind:"tty",command:"",args:"",cwd:"",envJson:"{}",width:"",height:"",depth:""})}function y(z){i.value=z.id,Object.assign(a,{id:z.id,name:z.name,description:z.description||"",kind:z.kind==="gui"?"gui":"tty",command:z.command||"",args:(z.args||[]).map(I=>/\s/.test(I)?JSON.stringify(I):I).join(" "),cwd:z.cwd||"",envJson:JSON.stringify(z.env||{},null,2),width:z.display?.width===void 0?"":String(z.display.width),height:z.display?.height===void 0?"":String(z.display.height),depth:z.display?.depth===void 0?"":String(z.display.depth)})}async function b(){s.value="";try{const z=p(),I=m();if(!i.value&&z.some(_=>_.id===I.id))throw new Error("Custom app id already exists.");if(i.value&&I.id!==i.value&&z.some(_=>_.id===I.id))throw new Error("Custom app id already exists.");const E=i.value?z.map(_=>_.id===i.value?I:_):[...z,I];await Ys(E),r.value=JSON.stringify(E,null,2),f(),await t.invalidateQueries({queryKey:["app-catalog"]}),await t.invalidateQueries({queryKey:["app-catalog-custom"]})}catch(z){s.value=z instanceof Error?z.message:String(z)}}async function x(z){s.value="";try{const I=p().filter(E=>E.id!==z);await Ys(I),r.value=JSON.stringify(I,null,2),i.value===z&&f(),await t.invalidateQueries({queryKey:["app-catalog"]}),await t.invalidateQueries({queryKey:["app-catalog-custom"]})}catch(I){s.value=I instanceof Error?I.message:String(I)}}function S(){s.value="",r.value=JSON.stringify(n.data.value?.items||[],null,2)}async function N(){s.value="";try{await Ys(p()),await t.invalidateQueries({queryKey:["app-catalog"]}),await t.invalidateQueries({queryKey:["app-catalog-custom"]})}catch(z){s.value=z instanceof Error?z.message:String(z)}}return(z,I)=>(O(),j("section",U3,[k("div",q3,[I[12]||(I[12]=k("h2",null,"Custom Apps",-1)),g(n).data.value?(O(),j("span",H3,K(g(n).data.value.path),1)):pe("",!0)]),T(g(Tr),null,{default:D(()=>[T(g(An),null,{default:D(()=>[k("div",V3,[T(g(Et),{modelValue:a.id,"onUpdate:modelValue":I[0]||(I[0]=E=>a.id=E),placeholder:"id"},null,8,["modelValue"]),T(g(Et),{modelValue:a.name,"onUpdate:modelValue":I[1]||(I[1]=E=>a.name=E),placeholder:"name"},null,8,["modelValue"]),T(g(or),{modelValue:a.description,"onUpdate:modelValue":I[2]||(I[2]=E=>a.description=E),class:"launch-json",spellcheck:"false",placeholder:"description"},null,8,["modelValue"]),T(g(lo),{modelValue:a.kind,"onUpdate:modelValue":I[3]||(I[3]=E=>a.kind=E)},{default:D(()=>[T(g(uo),{class:"native-select"},{default:D(()=>[T(g(fo),{placeholder:"App kind"})]),_:1}),T(g(co),null,{default:D(()=>[T(g(Jr),{value:"tty"},{default:D(()=>[...I[13]||(I[13]=[fe("TTY",-1)])]),_:1}),T(g(Jr),{value:"gui"},{default:D(()=>[...I[14]||(I[14]=[fe("GUI",-1)])]),_:1})]),_:1})]),_:1},8,["modelValue"]),T(g(Et),{modelValue:a.command,"onUpdate:modelValue":I[4]||(I[4]=E=>a.command=E),placeholder:"/usr/bin/app"},null,8,["modelValue"]),T(g(Et),{modelValue:a.args,"onUpdate:modelValue":I[5]||(I[5]=E=>a.args=E),placeholder:'args, e.g. --new-window "https://example.com"'},null,8,["modelValue"]),T(g(Et),{modelValue:a.cwd,"onUpdate:modelValue":I[6]||(I[6]=E=>a.cwd=E),placeholder:"/workspace"},null,8,["modelValue"]),T(g(or),{modelValue:a.envJson,"onUpdate:modelValue":I[7]||(I[7]=E=>a.envJson=E),class:"launch-json",spellcheck:"false",placeholder:'env JSON, e.g. {"LANG":"C.UTF-8"}'},null,8,["modelValue"]),a.kind==="gui"?(O(),j("div",j3,[T(g(Et),{modelValue:a.width,"onUpdate:modelValue":I[8]||(I[8]=E=>a.width=E),inputmode:"numeric",placeholder:"width"},null,8,["modelValue"]),T(g(Et),{modelValue:a.height,"onUpdate:modelValue":I[9]||(I[9]=E=>a.height=E),inputmode:"numeric",placeholder:"height"},null,8,["modelValue"]),T(g(Et),{modelValue:a.depth,"onUpdate:modelValue":I[10]||(I[10]=E=>a.depth=E),inputmode:"numeric",placeholder:"depth"},null,8,["modelValue"])])):pe("",!0),k("div",G3,[T(g(nt),{size:"sm",onClick:b},{default:D(()=>[fe(K(i.value?"Update App":"Add App"),1)]),_:1}),i.value?(O(),xe(g(nt),{key:0,variant:"outline",size:"sm",onClick:f},{default:D(()=>[...I[15]||(I[15]=[fe("Cancel",-1)])]),_:1})):pe("",!0)])])]),_:1}),T(g(An),null,{default:D(()=>[T(g(or),{modelValue:r.value,"onUpdate:modelValue":I[11]||(I[11]=E=>r.value=E),class:"catalog-json",spellcheck:"false"},null,8,["modelValue"]),o.value?(O(),j("p",Z3,K(o.value),1)):pe("",!0)]),_:1}),T(g(S0),{class:"editor-actions"},{default:D(()=>[T(g(nt),{variant:"outline",size:"sm",onClick:S},{default:D(()=>[...I[16]||(I[16]=[fe("Reset",-1)])]),_:1}),T(g(nt),{size:"sm",onClick:N},{default:D(()=>[...I[17]||(I[17]=[fe("Save",-1)])]),_:1})]),_:1}),s.value?(O(),xe(g(An),{key:0},{default:D(()=>[k("p",K3,K(s.value),1)]),_:1})):pe("",!0)]),_:1}),k("div",W3,[(O(!0),j(lt,null,Ht(g(n).data.value?.items||[],E=>(O(),xe(g(Tr),{key:E.id},{default:D(()=>[T(g(An),{class:"catalog-item"},{default:D(()=>[k("div",Q3,[k("div",null,[k("div",J3,K(E.name),1),k("div",Y3,[T(g(ts),{variant:"secondary"},{default:D(()=>[fe(K(E.kind),1)]),_:2},1024),k("span",null,K(E.command),1)])]),k("div",X3,[T(g(nt),{variant:"outline",size:"sm",onClick:_=>y(E)},{default:D(()=>[...I[18]||(I[18]=[fe("Edit",-1)])]),_:1},8,["onClick"]),T(g(nt),{variant:"outline",size:"sm",onClick:_=>x(E.id)},{default:D(()=>[...I[19]||(I[19]=[fe("Remove",-1)])]),_:1},8,["onClick"])])])]),_:2},1024)]),_:2},1024))),128))])]))}}),t5={class:"settings-pane"},n5={class:"section-head"},r5={class:"section-actions"},s5={class:"settings-list"},i5={class:"session-actions"},a5={key:0,class:"session-error"},o5={class:"session-metadata"},l5={key:0},c5={key:1},u5={key:2},d5={key:0},f5={key:1},h5={key:3},p5={key:0},m5=Re({__name:"SessionsSettings",setup(e){const t=hs(),n=di(),r=fi(),s=Oe(!1),i=Se(()=>(n.data.value||[]).filter(c)),a=Se(()=>s.value?n.data.value||[]:(n.data.value||[]).filter(b=>!c(b)));function o(b){const x=new Date(b);return Number.isNaN(x.getTime())?b:x.toLocaleString()}function l(b){return b.status==="running"&&(b.kind==="tty"||b.kind==="gui"&&!!b.vnc)}function c(b){return b.error?.code==="APP_SESSION_RESTORED_WITHOUT_PROCESS"}function u(b){if(!l(b)){p(b);return}r.open(da(b))}function p(b){r.open({type:"logs",id:`logs:${b.id}`,sessionId:b.id,title:`${b.title} logs`})}async function m(b){await Os(b),await t.invalidateQueries({queryKey:["status"]})}async function f(b){const x=await m0(b);u(x),await t.invalidateQueries({queryKey:["status"]})}async function y(b){await op(b);const x=(n.data.value||[]).filter(S=>S.id!==b);r.pruneSession(new Set(x.map(S=>S.id)),ti(x)),await t.invalidateQueries({queryKey:["status"]})}return(b,x)=>(O(),j("section",t5,[k("div",n5,[x[1]||(x[1]=k("h2",null,"Sessions",-1)),k("div",r5,[k("span",null,K(a.value.length)+" sessions",1),i.value.length?(O(),xe(g(nt),{key:0,variant:"outline",size:"sm",onClick:x[0]||(x[0]=S=>s.value=!s.value)},{default:D(()=>[fe(K(s.value?"Hide restored":`Show restored (${i.value.length})`),1)]),_:1})):pe("",!0)])]),k("div",s5,[(O(!0),j(lt,null,Ht(a.value,S=>(O(),xe(g(Tr),{key:S.id},{default:D(()=>[T(g(Fi),{class:"session-header"},{default:D(()=>[k("div",null,[T(g(Ui),null,{default:D(()=>[fe(K(S.title),1)]),_:2},1024),T(g(Li),null,{default:D(()=>[fe(K(S.appId)+" · "+K(o(S.updatedAt)),1)]),_:2},1024)]),k("div",i5,[T(g(ts),{variant:S.status==="running"?"default":"secondary"},{default:D(()=>[fe(K(S.status),1)]),_:2},1032,["variant"]),T(g(nt),{variant:"outline",size:"sm",disabled:S.status!=="running",onClick:N=>m(S.id)},{default:D(()=>[...x[2]||(x[2]=[fe("Stop",-1)])]),_:1},8,["disabled","onClick"]),T(g(nt),{variant:"outline",size:"sm",onClick:N=>f(S.id)},{default:D(()=>[...x[3]||(x[3]=[fe("Restart",-1)])]),_:1},8,["onClick"]),T(g(nt),{variant:"outline",size:"sm",disabled:!l(S),onClick:N=>u(S)},{default:D(()=>[...x[4]||(x[4]=[fe("Open",-1)])]),_:1},8,["disabled","onClick"]),T(g(nt),{variant:"outline",size:"sm",onClick:N=>p(S)},{default:D(()=>[...x[5]||(x[5]=[fe("Logs",-1)])]),_:1},8,["onClick"]),T(g(nt),{variant:"outline",size:"sm",onClick:N=>y(S.id)},{default:D(()=>[...x[6]||(x[6]=[fe("Delete",-1)])]),_:1},8,["onClick"])])]),_:2},1024),T(g(An),null,{default:D(()=>[S.error?(O(),j("p",a5,K(S.error.code)+": "+K(S.error.message),1)):pe("",!0),k("dl",o5,[S.tty?.cwd||S.launch?.cwd?(O(),j("div",l5,[x[7]||(x[7]=k("dt",null,"CWD",-1)),k("dd",null,K(S.launch?.cwd||S.tty?.cwd),1)])):pe("",!0),S.display?(O(),j("div",c5,[x[8]||(x[8]=k("dt",null,"Display",-1)),k("dd",null,K(S.display.display)+" "+K(S.display.width)+"x"+K(S.display.height)+"x"+K(S.display.depth),1)])):pe("",!0),S.vnc?(O(),j("div",u5,[x[9]||(x[9]=k("dt",null,"Ports",-1)),k("dd",null,[fe(K(S.vnc.backend==="kasmvnc"?"kasmvnc":"vnc")+" "+K(S.vnc.port),1),S.vnc.websockifyPort?(O(),j("span",d5," · ws "+K(S.vnc.websockifyPort),1)):pe("",!0),S.automation?(O(),j("span",f5," · cdp "+K(S.automation.port),1)):pe("",!0)])])):pe("",!0),S.process?(O(),j("div",h5,[x[10]||(x[10]=k("dt",null,"Process",-1)),k("dd",null,[fe(K(S.process.command),1),S.process.pid?(O(),j("span",p5," · pid "+K(S.process.pid),1)):pe("",!0)])])):pe("",!0)])]),_:2},1024)]),_:2},1024))),128))])]))}}),g5={class:"modal-header"},v5={class:"settings-content-inner"},b5=Re({__name:"SettingsModal",props:{section:{}},emits:["close"],setup(e){const t=e,n=Oe(t.section||"general"),r=[{id:"general",label:"General"},{id:"apps",label:"Apps"},{id:"sessions",label:"Sessions"}];function s(i){n.value=String(i)}return on(()=>t.section,i=>{n.value=i||"general"}),(i,a)=>(O(),xe(g($p),{open:!0,"onUpdate:open":a[0]||(a[0]=o=>!o&&i.$emit("close"))},{default:D(()=>[T(g(Dp),{class:"settings-modal gap-0 p-0",style:{width:"min(1280px, calc(100vw - 48px))","max-width":"calc(100vw - 48px)"}},{default:D(()=>[k("header",g5,[T(g(Bp),null,{default:D(()=>[...a[1]||(a[1]=[fe("Settings",-1)])]),_:1}),T(g(Pp),{class:"sr-only"},{default:D(()=>[...a[2]||(a[2]=[fe("Configure the controlled instance runtime, applications, and sessions.",-1)])]),_:1})]),T(g(E3),{"model-value":n.value,class:"settings-modal-body",orientation:"vertical","onUpdate:modelValue":s},{default:D(()=>[T(g(A3),{class:"settings-nav"},{default:D(()=>[(O(),j(lt,null,Ht(r,o=>T(g(I3),{key:o.id,value:o.id,class:At({active:n.value===o.id}),onClick:l=>n.value=o.id},{default:D(()=>[fe(K(o.label),1)]),_:2},1032,["value","class","onClick"])),64))]),_:1}),T(g(Rn),{class:"settings-content"},{default:D(()=>[k("main",v5,[T(g(kl),{value:"general"},{default:D(()=>[T(Lp)]),_:1}),T(g(kl),{value:"apps"},{default:D(()=>[T(e5)]),_:1}),T(g(kl),{value:"sessions"},{default:D(()=>[T(m5)]),_:1})])]),_:1})]),_:1},8,["model-value"])]),_:1})]),_:1}))}}),y5={class:"logs-panel"},w5={class:"logs-meta"},S5={key:0,class:"logs-empty"},x5={key:1,class:"logs-empty"},Fp=Re({__name:"SessionLogs",props:{session:{}},setup(e){const n=nb(e.session.id);function r(s){return s<1024?`${s} B`:s<1024*1024?`${(s/1024).toFixed(1)} KB`:`${(s/1024/1024).toFixed(1)} MB`}return(s,i)=>(O(),j("div",y5,[k("div",w5,K(g(n).data.value?.logDir||e.session.paths.logDir),1),g(n).isLoading.value?(O(),j("div",S5,"Loading logs...")):g(n).data.value?.files.length?(O(!0),j(lt,{key:2},Ht(g(n).data.value?.files||[],a=>(O(),j("section",{key:a.name,class:"log-file"},[k("header",null,[k("strong",null,K(a.name),1),k("span",null,[fe(K(r(a.size))+" · "+K(a.updatedAt),1),a.truncated?(O(),j(lt,{key:0},[fe(" · tail")],64)):pe("",!0)])]),T(g(Rn),{class:"log-file-content"},{default:D(()=>[k("pre",null,K(a.content||"(empty)"),1)]),_:2},1024)]))),128)):(O(),j("div",x5,"No log files yet."))]))}}),k5={class:"terminal-panel"},_5={class:"terminal-canvas-shell"},E5={class:"terminal-status"},Up=Re({__name:"TerminalSession",props:{session:{}},setup(e){const t=e,n=$s(),r=Oe(null),s=Oe("connecting");let i,a,o,l,c,u,p=!1;const m=Se(()=>jh(`/api/apps/sessions/${t.session.id}/tty`,n.token));function f(){p||!i||o?.readyState!==WebSocket.OPEN||o.send(JSON.stringify({type:"resize",cols:i.cols,rows:i.rows}))}function y(){if(!p)try{a?.fit(),i&&i.rows>0&&i.refresh(0,i.rows-1),f()}catch{}}function b(){c!==void 0&&window.cancelAnimationFrame(c),u!==void 0&&window.clearTimeout(u);const z=()=>{c=void 0,y()};c=window.requestAnimationFrame(z),u=window.setTimeout(()=>{u=void 0,y()},80)}function x(){const z=window.getComputedStyle(document.documentElement);return{background:z.getPropertyValue("--terminal-surface").trim(),foreground:z.getPropertyValue("--terminal-text").trim(),cursor:z.getPropertyValue("--text").trim(),selectionBackground:z.getPropertyValue("--terminal-selection").trim()}}function S(){c!==void 0&&(window.cancelAnimationFrame(c),c=void 0),u!==void 0&&(window.clearTimeout(u),u=void 0),l?.disconnect(),l=void 0,o?.close(),o=void 0,i?.dispose(),i=void 0,a=void 0}async function N(){S(),await ur(),r.value&&(i=new Cv({cursorBlink:!0,convertEol:!0,fontFamily:'ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace',fontSize:13,theme:x()}),a=new Mv,i.loadAddon(a),i.loadAddon(new Ov),i.open(r.value),b(),o=new WebSocket(m.value),o.addEventListener("open",()=>{s.value="connected",b()}),o.addEventListener("message",z=>{const I=JSON.parse(String(z.data||"{}"));I.type==="snapshot"?(p=!0,Number.isInteger(I.cols)&&Number.isInteger(I.rows)&&I.cols>0&&I.rows>0&&i?.resize(I.cols,I.rows),i?.reset(),i?.write(`${String(I.data||"")}${String(I.pendingEscape||"")}`,()=>{p=!1,b()})):I.type==="output"?i?.write(String(I.data||"")):I.type==="connected"?s.value="connected":I.type==="exit"?(s.value="exited",i?.writeln(`\r
|
|
2
2
|
[process exited]`)):I.type==="error"&&(s.value="error",i?.writeln(`\r
|
|
3
|
-
[error] ${I.message}`))}),o.addEventListener("close",()=>{s.value=s.value==="exited"?"exited":"disconnected"}),o.addEventListener("error",()=>{s.value="error"}),i.onData(z=>{o?.readyState===WebSocket.OPEN&&o.send(JSON.stringify({type:"input",data:z}))}),l=new ResizeObserver(y),l.observe(r.value),b())}return pn(()=>t.session.id,P,{immediate:!0}),zo(k),(z,I)=>(O(),j("div",p5,[x("div",m5,[x("div",{ref_key:"terminalEl",ref:r,class:"terminal-canvas"},null,512)]),x("div",g5,[x("span",null,Z(s.value)+" · "+Z(e.session.tty?.mode||"pty"),1)])]))}});function v5(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var _l,pd;function b5(){if(pd)return _l;pd=1;function e(M){return M instanceof Map?M.clear=M.delete=M.set=function(){throw new Error("map is read-only")}:M instanceof Set&&(M.add=M.clear=M.delete=function(){throw new Error("set is read-only")}),Object.freeze(M),Object.getOwnPropertyNames(M).forEach(Y=>{const me=M[Y],We=typeof me;(We==="object"||We==="function")&&!Object.isFrozen(me)&&e(me)}),M}class t{constructor(Y){Y.data===void 0&&(Y.data={}),this.data=Y.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function n(M){return M.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function r(M,...Y){const me=Object.create(null);for(const We in M)me[We]=M[We];return Y.forEach(function(We){for(const Ut in We)me[Ut]=We[Ut]}),me}const s="</span>",i=M=>!!M.scope,a=(M,{prefix:Y})=>{if(M.startsWith("language:"))return M.replace("language:","language-");if(M.includes(".")){const me=M.split(".");return[`${Y}${me.shift()}`,...me.map((We,Ut)=>`${We}${"_".repeat(Ut+1)}`)].join(" ")}return`${Y}${M}`};class o{constructor(Y,me){this.buffer="",this.classPrefix=me.classPrefix,Y.walk(this)}addText(Y){this.buffer+=n(Y)}openNode(Y){if(!i(Y))return;const me=a(Y.scope,{prefix:this.classPrefix});this.span(me)}closeNode(Y){i(Y)&&(this.buffer+=s)}value(){return this.buffer}span(Y){this.buffer+=`<span class="${Y}">`}}const l=(M={})=>{const Y={children:[]};return Object.assign(Y,M),Y};class c{constructor(){this.rootNode=l(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(Y){this.top.children.push(Y)}openNode(Y){const me=l({scope:Y});this.add(me),this.stack.push(me)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(Y){return this.constructor._walk(Y,this.rootNode)}static _walk(Y,me){return typeof me=="string"?Y.addText(me):me.children&&(Y.openNode(me),me.children.forEach(We=>this._walk(Y,We)),Y.closeNode(me)),Y}static _collapse(Y){typeof Y!="string"&&Y.children&&(Y.children.every(me=>typeof me=="string")?Y.children=[Y.children.join("")]:Y.children.forEach(me=>{c._collapse(me)}))}}class u extends c{constructor(Y){super(),this.options=Y}addText(Y){Y!==""&&this.add(Y)}startScope(Y){this.openNode(Y)}endScope(){this.closeNode()}__addSublanguage(Y,me){const We=Y.root;me&&(We.scope=`language:${me}`),this.add(We)}toHTML(){return new o(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function f(M){return M?typeof M=="string"?M:M.source:null}function m(M){return b("(?=",M,")")}function h(M){return b("(?:",M,")*")}function y(M){return b("(?:",M,")?")}function b(...M){return M.map(me=>f(me)).join("")}function S(M){const Y=M[M.length-1];return typeof Y=="object"&&Y.constructor===Object?(M.splice(M.length-1,1),Y):{}}function k(...M){return"("+(S(M).capture?"":"?:")+M.map(We=>f(We)).join("|")+")"}function P(M){return new RegExp(M.toString()+"|").exec("").length-1}function z(M,Y){const me=M&&M.exec(Y);return me&&me.index===0}const I=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function E(M,{joinWith:Y}){let me=0;return M.map(We=>{me+=1;const Ut=me;let qt=f(We),Ce="";for(;qt.length>0;){const _e=I.exec(qt);if(!_e){Ce+=qt;break}Ce+=qt.substring(0,_e.index),qt=qt.substring(_e.index+_e[0].length),_e[0][0]==="\\"&&_e[1]?Ce+="\\"+String(Number(_e[1])+Ut):(Ce+=_e[0],_e[0]==="("&&me++)}return Ce}).map(We=>`(${We})`).join(Y)}const _=/\b\B/,L="[a-zA-Z]\\w*",N="[a-zA-Z_]\\w*",G="\\b\\d+(\\.\\d+)?",D="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",W="\\b(0b[01]+)",q="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",X=(M={})=>{const Y=/^#![ ]*\//;return M.binary&&(M.begin=b(Y,/.*\b/,M.binary,/\b.*/)),r({scope:"meta",begin:Y,end:/$/,relevance:0,"on:begin":(me,We)=>{me.index!==0&&We.ignoreMatch()}},M)},ne={begin:"\\\\[\\s\\S]",relevance:0},he={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[ne]},Ae={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[ne]},se={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},re=function(M,Y,me={}){const We=r({scope:"comment",begin:M,end:Y,contains:[]},me);We.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const Ut=k("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return We.contains.push({begin:b(/[ ]+/,"(",Ut,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),We},ze=re("//","$"),ie=re("/\\*","\\*/"),je=re("#","$"),rt={scope:"number",begin:G,relevance:0},ot={scope:"number",begin:D,relevance:0},Ft={scope:"number",begin:W,relevance:0},st={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[ne,{begin:/\[/,end:/\]/,relevance:0,contains:[ne]}]},at={scope:"title",begin:L,relevance:0},C={scope:"title",begin:N,relevance:0},le={begin:"\\.\\s*"+N,relevance:0};var de=Object.freeze({__proto__:null,APOS_STRING_MODE:he,BACKSLASH_ESCAPE:ne,BINARY_NUMBER_MODE:Ft,BINARY_NUMBER_RE:W,COMMENT:re,C_BLOCK_COMMENT_MODE:ie,C_LINE_COMMENT_MODE:ze,C_NUMBER_MODE:ot,C_NUMBER_RE:D,END_SAME_AS_BEGIN:function(M){return Object.assign(M,{"on:begin":(Y,me)=>{me.data._beginMatch=Y[1]},"on:end":(Y,me)=>{me.data._beginMatch!==Y[1]&&me.ignoreMatch()}})},HASH_COMMENT_MODE:je,IDENT_RE:L,MATCH_NOTHING_RE:_,METHOD_GUARD:le,NUMBER_MODE:rt,NUMBER_RE:G,PHRASAL_WORDS_MODE:se,QUOTE_STRING_MODE:Ae,REGEXP_MODE:st,RE_STARTERS_RE:q,SHEBANG:X,TITLE_MODE:at,UNDERSCORE_IDENT_RE:N,UNDERSCORE_TITLE_MODE:C});function Ie(M,Y){M.input[M.index-1]==="."&&Y.ignoreMatch()}function Ge(M,Y){M.className!==void 0&&(M.scope=M.className,delete M.className)}function Be(M,Y){Y&&M.beginKeywords&&(M.begin="\\b("+M.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",M.__beforeBegin=Ie,M.keywords=M.keywords||M.beginKeywords,delete M.beginKeywords,M.relevance===void 0&&(M.relevance=0))}function Te(M,Y){Array.isArray(M.illegal)&&(M.illegal=k(...M.illegal))}function yt(M,Y){if(M.match){if(M.begin||M.end)throw new Error("begin & end are not supported with match");M.begin=M.match,delete M.match}}function Ye(M,Y){M.relevance===void 0&&(M.relevance=1)}const Tt=(M,Y)=>{if(!M.beforeMatch)return;if(M.starts)throw new Error("beforeMatch cannot be used with starts");const me=Object.assign({},M);Object.keys(M).forEach(We=>{delete M[We]}),M.keywords=me.keywords,M.begin=b(me.beforeMatch,m(me.begin)),M.starts={relevance:0,contains:[Object.assign(me,{endsParent:!0})]},M.relevance=0,delete me.beforeMatch},bn=["of","and","for","in","not","or","if","then","parent","list","value"],Yn="keyword";function br(M,Y,me=Yn){const We=Object.create(null);return typeof M=="string"?Ut(me,M.split(" ")):Array.isArray(M)?Ut(me,M):Object.keys(M).forEach(function(qt){Object.assign(We,br(M[qt],Y,qt))}),We;function Ut(qt,Ce){Y&&(Ce=Ce.map(_e=>_e.toLowerCase())),Ce.forEach(function(_e){const He=_e.split("|");We[He[0]]=[qt,Si(He[0],He[1])]})}}function Si(M,Y){return Y?Number(Y):xi(M)?0:1}function xi(M){return bn.includes(M.toLowerCase())}const Lr={},zn=M=>{console.error(M)},vs=(M,...Y)=>{console.log(`WARN: ${M}`,...Y)},Xn=(M,Y)=>{Lr[`${M}/${Y}`]||(console.log(`Deprecated as of ${M}. ${Y}`),Lr[`${M}/${Y}`]=!0)},V=new Error;function F(M,Y,{key:me}){let We=0;const Ut=M[me],qt={},Ce={};for(let _e=1;_e<=Y.length;_e++)Ce[_e+We]=Ut[_e],qt[_e+We]=!0,We+=P(Y[_e-1]);M[me]=Ce,M[me]._emit=qt,M[me]._multi=!0}function U(M){if(Array.isArray(M.begin)){if(M.skip||M.excludeBegin||M.returnBegin)throw zn("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),V;if(typeof M.beginScope!="object"||M.beginScope===null)throw zn("beginScope must be object"),V;F(M,M.begin,{key:"beginScope"}),M.begin=E(M.begin,{joinWith:""})}}function De(M){if(Array.isArray(M.end)){if(M.skip||M.excludeEnd||M.returnEnd)throw zn("skip, excludeEnd, returnEnd not compatible with endScope: {}"),V;if(typeof M.endScope!="object"||M.endScope===null)throw zn("endScope must be object"),V;F(M,M.end,{key:"endScope"}),M.end=E(M.end,{joinWith:""})}}function mt(M){M.scope&&typeof M.scope=="object"&&M.scope!==null&&(M.beginScope=M.scope,delete M.scope)}function ln(M){mt(M),typeof M.beginScope=="string"&&(M.beginScope={_wrap:M.beginScope}),typeof M.endScope=="string"&&(M.endScope={_wrap:M.endScope}),U(M),De(M)}function $n(M){function Y(Ce,_e){return new RegExp(f(Ce),"m"+(M.case_insensitive?"i":"")+(M.unicodeRegex?"u":"")+(_e?"g":""))}class me{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(_e,He){He.position=this.position++,this.matchIndexes[this.matchAt]=He,this.regexes.push([He,_e]),this.matchAt+=P(_e)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const _e=this.regexes.map(He=>He[1]);this.matcherRe=Y(E(_e,{joinWith:"|"}),!0),this.lastIndex=0}exec(_e){this.matcherRe.lastIndex=this.lastIndex;const He=this.matcherRe.exec(_e);if(!He)return null;const nn=He.findIndex((ki,dl)=>dl>0&&ki!==void 0),jt=this.matchIndexes[nn];return He.splice(0,nn),Object.assign(He,jt)}}class We{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(_e){if(this.multiRegexes[_e])return this.multiRegexes[_e];const He=new me;return this.rules.slice(_e).forEach(([nn,jt])=>He.addRule(nn,jt)),He.compile(),this.multiRegexes[_e]=He,He}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(_e,He){this.rules.push([_e,He]),He.type==="begin"&&this.count++}exec(_e){const He=this.getMatcher(this.regexIndex);He.lastIndex=this.lastIndex;let nn=He.exec(_e);if(this.resumingScanAtSamePosition()&&!(nn&&nn.index===this.lastIndex)){const jt=this.getMatcher(0);jt.lastIndex=this.lastIndex+1,nn=jt.exec(_e)}return nn&&(this.regexIndex+=nn.position+1,this.regexIndex===this.count&&this.considerAll()),nn}}function Ut(Ce){const _e=new We;return Ce.contains.forEach(He=>_e.addRule(He.begin,{rule:He,type:"begin"})),Ce.terminatorEnd&&_e.addRule(Ce.terminatorEnd,{type:"end"}),Ce.illegal&&_e.addRule(Ce.illegal,{type:"illegal"}),_e}function qt(Ce,_e){const He=Ce;if(Ce.isCompiled)return He;[Ge,yt,ln,Tt].forEach(jt=>jt(Ce,_e)),M.compilerExtensions.forEach(jt=>jt(Ce,_e)),Ce.__beforeBegin=null,[Be,Te,Ye].forEach(jt=>jt(Ce,_e)),Ce.isCompiled=!0;let nn=null;return typeof Ce.keywords=="object"&&Ce.keywords.$pattern&&(Ce.keywords=Object.assign({},Ce.keywords),nn=Ce.keywords.$pattern,delete Ce.keywords.$pattern),nn=nn||/\w+/,Ce.keywords&&(Ce.keywords=br(Ce.keywords,M.case_insensitive)),He.keywordPatternRe=Y(nn,!0),_e&&(Ce.begin||(Ce.begin=/\B|\b/),He.beginRe=Y(He.begin),!Ce.end&&!Ce.endsWithParent&&(Ce.end=/\B|\b/),Ce.end&&(He.endRe=Y(He.end)),He.terminatorEnd=f(He.end)||"",Ce.endsWithParent&&_e.terminatorEnd&&(He.terminatorEnd+=(Ce.end?"|":"")+_e.terminatorEnd)),Ce.illegal&&(He.illegalRe=Y(Ce.illegal)),Ce.contains||(Ce.contains=[]),Ce.contains=[].concat(...Ce.contains.map(function(jt){return cl(jt==="self"?Ce:jt)})),Ce.contains.forEach(function(jt){qt(jt,He)}),Ce.starts&&qt(Ce.starts,_e),He.matcher=Ut(He),He}if(M.compilerExtensions||(M.compilerExtensions=[]),M.contains&&M.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return M.classNameAliases=r(M.classNameAliases||{}),qt(M)}function Hn(M){return M?M.endsWithParent||Hn(M.starts):!1}function cl(M){return M.variants&&!M.cachedVariants&&(M.cachedVariants=M.variants.map(function(Y){return r(M,{variants:null},Y)})),M.cachedVariants?M.cachedVariants:Hn(M)?r(M,{starts:M.starts?r(M.starts):null}):Object.isFrozen(M)?r(M):M}var r4="11.11.1";class s4 extends Error{constructor(Y,me){super(Y),this.name="HTMLInjectionError",this.html=me}}const ul=n,Au=r,Tu=Symbol("nomatch"),i4=7,Iu=function(M){const Y=Object.create(null),me=Object.create(null),We=[];let Ut=!0;const qt="Could not find the language '{}', did you forget to load/include a language module?",Ce={disableAutodetect:!0,name:"Plain text",contains:[]};let _e={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:u};function He(ce){return _e.noHighlightRe.test(ce)}function nn(ce){let Pe=ce.className+" ";Pe+=ce.parentNode?ce.parentNode.className:"";const it=_e.languageDetectRe.exec(Pe);if(it){const kt=Fr(it[1]);return kt||(vs(qt.replace("{}",it[1])),vs("Falling back to no-highlight mode for this block.",ce)),kt?it[1]:"no-highlight"}return Pe.split(/\s+/).find(kt=>He(kt)||Fr(kt))}function jt(ce,Pe,it){let kt="",Qt="";typeof Pe=="object"?(kt=ce,it=Pe.ignoreIllegals,Qt=Pe.language):(Xn("10.7.0","highlight(lang, code, ...args) has been deprecated."),Xn("10.7.0",`Please use highlight(code, options) instead.
|
|
4
|
-
https://github.com/highlightjs/highlight.js/issues/2277`),Qt=ce,kt=Pe),it===void 0&&(it=!0);const Vn={code:kt,language:Qt};ba("before:highlight",Vn);const
|
|
5
|
-
`,1;if(ml>1e5&&ml>$e.index*3)throw new Error("potential infinite loop, way more iterations than matches");return _t+=Xe,Xe.length}const tr=Fr(ce);if(!tr)throw zn(qt.replace("{}",ce)),new Error('Unknown language: "'+ce+'"');const S4=$n(tr);let pl="",Qe=kt||S4;const Du={},rn=new _e.__emitter(_e);w4();let _t="",Sa=0,bs=0,ml=0,gl=!1;try{if(tr.__emitTokens)tr.__emitTokens(Pe,rn);else{for(Qe.matcher.considerAll();;){ml++,gl?gl=!1:Qe.matcher.considerAll(),Qe.matcher.lastIndex=bs;const ve=Qe.matcher.exec(Pe);if(!ve)break;const $e=Pe.substring(bs,ve.index),Xe=$u($e,ve);bs=ve.index+Xe}$u(Pe.substring(bs))}return rn.finalize(),pl=rn.toHTML(),{language:ce,value:pl,relevance:Sa,illegal:!1,_emitter:rn,_top:Qe}}catch(ve){if(ve.message&&ve.message.includes("Illegal"))return{language:ce,value:ul(Pe),illegal:!0,relevance:0,_illegalBy:{message:ve.message,index:bs,context:Pe.slice(bs-100,bs+100),mode:ve.mode,resultSoFar:pl},_emitter:rn};if(Ut)return{language:ce,value:ul(Pe),illegal:!1,relevance:0,errorRaised:ve,_emitter:rn,_top:Qe};throw ve}}function dl(ce){const Pe={value:ul(ce),illegal:!1,relevance:0,_top:Ce,_emitter:new _e.__emitter(_e)};return Pe._emitter.addText(ce),Pe}function fl(ce,Pe){Pe=Pe||_e.languages||Object.keys(Y);const it=dl(ce),kt=Pe.filter(Fr).filter(Ou).map(kn=>ki(kn,ce,!1));kt.unshift(it);const Qt=kt.sort((kn,er)=>{if(kn.relevance!==er.relevance)return er.relevance-kn.relevance;if(kn.language&&er.language){if(Fr(kn.language).supersetOf===er.language)return 1;if(Fr(er.language).supersetOf===kn.language)return-1}return 0}),[Vn,Ur]=Qt,ya=Vn;return ya.secondBest=Ur,ya}function a4(ce,Pe,it){const kt=Pe&&me[Pe]||it;ce.classList.add("hljs"),ce.classList.add(`language-${kt}`)}function hl(ce){let Pe=null;const it=nn(ce);if(He(it))return;if(ba("before:highlightElement",{el:ce,language:it}),ce.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",ce);return}if(ce.children.length>0&&(_e.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(ce)),_e.throwUnescapedHTML))throw new s4("One of your code blocks includes unescaped HTML.",ce.innerHTML);Pe=ce;const kt=Pe.textContent,Qt=it?jt(kt,{language:it,ignoreIllegals:!0}):fl(kt);ce.innerHTML=Qt.value,ce.dataset.highlighted="yes",a4(ce,it,Qt.language),ce.result={language:Qt.language,re:Qt.relevance,relevance:Qt.relevance},Qt.secondBest&&(ce.secondBest={language:Qt.secondBest.language,relevance:Qt.secondBest.relevance}),ba("after:highlightElement",{el:ce,result:Qt,text:kt})}function o4(ce){_e=Au(_e,ce)}const l4=()=>{va(),Xn("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function c4(){va(),Xn("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Ru=!1;function va(){function ce(){va()}if(document.readyState==="loading"){Ru||window.addEventListener("DOMContentLoaded",ce,!1),Ru=!0;return}document.querySelectorAll(_e.cssSelector).forEach(hl)}function u4(ce,Pe){let it=null;try{it=Pe(M)}catch(kt){if(zn("Language definition for '{}' could not be registered.".replace("{}",ce)),Ut)zn(kt);else throw kt;it=Ce}it.name||(it.name=ce),Y[ce]=it,it.rawDefinition=Pe.bind(null,M),it.aliases&&Cu(it.aliases,{languageName:ce})}function d4(ce){delete Y[ce];for(const Pe of Object.keys(me))me[Pe]===ce&&delete me[Pe]}function f4(){return Object.keys(Y)}function Fr(ce){return ce=(ce||"").toLowerCase(),Y[ce]||Y[me[ce]]}function Cu(ce,{languageName:Pe}){typeof ce=="string"&&(ce=[ce]),ce.forEach(it=>{me[it.toLowerCase()]=Pe})}function Ou(ce){const Pe=Fr(ce);return Pe&&!Pe.disableAutodetect}function h4(ce){ce["before:highlightBlock"]&&!ce["before:highlightElement"]&&(ce["before:highlightElement"]=Pe=>{ce["before:highlightBlock"](Object.assign({block:Pe.el},Pe))}),ce["after:highlightBlock"]&&!ce["after:highlightElement"]&&(ce["after:highlightElement"]=Pe=>{ce["after:highlightBlock"](Object.assign({block:Pe.el},Pe))})}function p4(ce){h4(ce),We.push(ce)}function m4(ce){const Pe=We.indexOf(ce);Pe!==-1&&We.splice(Pe,1)}function ba(ce,Pe){const it=ce;We.forEach(function(kt){kt[it]&&kt[it](Pe)})}function g4(ce){return Xn("10.7.0","highlightBlock will be removed entirely in v12.0"),Xn("10.7.0","Please use highlightElement now."),hl(ce)}Object.assign(M,{highlight:jt,highlightAuto:fl,highlightAll:va,highlightElement:hl,highlightBlock:g4,configure:o4,initHighlighting:l4,initHighlightingOnLoad:c4,registerLanguage:u4,unregisterLanguage:d4,listLanguages:f4,getLanguage:Fr,registerAliases:Cu,autoDetection:Ou,inherit:Au,addPlugin:p4,removePlugin:m4}),M.debugMode=function(){Ut=!1},M.safeMode=function(){Ut=!0},M.versionString=r4,M.regex={concat:b,lookahead:m,either:k,optional:y,anyNumberOfTimes:h};for(const ce in de)typeof de[ce]=="object"&&e(de[ce]);return Object.assign(M,de),M},Us=Iu({});return Us.newInstance=()=>Iu({}),_l=Us,Us.HighlightJS=Us,Us.default=Us,_l}var y5=b5();const ho=v5(y5);function w5(e){const t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const s={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},i=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),a={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},o={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,s]};s.contains.push(o);const l={match:/\\"/},c={className:"string",begin:/'/,end:/'/},u={match:/\\'/},f={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},m=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],h=e.SHEBANG({binary:`(${m.join("|")})`,relevance:10}),y={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},b=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],S=["true","false"],k={match:/(\/[a-z._-]+)+/},P=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],z=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],I=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],E=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:b,literal:S,built_in:[...P,...z,"set","shopt",...I,...E]},contains:[h,e.SHEBANG(),y,f,i,a,k,o,l,c,u,n]}}function S5(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",s="[a-zA-Z_]\\w*::",a="(?!struct)("+r+"|"+t.optional(s)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",o={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.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:"."},e.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},f={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},e.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},m={className:"title",begin:t.optional(s)+e.IDENT_RE,relevance:0},h=t.optional(s)+e.IDENT_RE+"\\s*\\(",y=["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"],b=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],S=["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"],k=["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","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],I={type:b,keyword:y,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:S},E={className:"function.dispatch",relevance:0,keywords:{_hint:k},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},_=[E,f,o,n,e.C_BLOCK_COMMENT_MODE,u,c],L={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:I,contains:_.concat([{begin:/\(/,end:/\)/,keywords:I,contains:_.concat(["self"]),relevance:0}]),relevance:0},N={className:"function",begin:"("+a+"[\\*&\\s]+)+"+h,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:I,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:I,relevance:0},{begin:h,returnBegin:!0,contains:[m],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,u]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:I,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,c,u,o,{begin:/\(/,end:/\)/,keywords:I,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,c,u,o]}]},o,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:I,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(L,N,E,_,[f,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:I,contains:["self",o]},{begin:e.IDENT_RE+"::",keywords:I},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function x5(e){const t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],s=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],i=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],a={keyword:s.concat(i),built_in:t,literal:r},o=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),l={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},c={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},u={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},f=e.inherit(u,{illegal:/\n/}),m={className:"subst",begin:/\{/,end:/\}/,keywords:a},h=e.inherit(m,{illegal:/\n/}),y={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,h]},b={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},m]},S=e.inherit(b,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]});m.contains=[b,y,u,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,l,e.C_BLOCK_COMMENT_MODE],h.contains=[S,y,f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,l,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const k={variants:[c,b,y,u,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},P={begin:"<",end:">",contains:[{beginKeywords:"in out"},o]},z=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",I={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:a,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},k,l,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},o,P,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[o,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[o,P,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+z+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:a,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,P],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,relevance:0,contains:[k,l,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},I]}}const k5=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.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:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.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_-]*/}}),_5=["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"],E5=["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"],A5=[..._5,...E5],T5=["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(),I5=["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(),R5=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),C5=["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-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function O5(e){const t=e.regex,n=k5(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},s="and or not only",i=/@-?\w[\w]*(-\w+)*/,a="[a-zA-Z-][a-zA-Z0-9_-]*",o=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+a,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+I5.join("|")+")"},{begin:":(:)?("+R5.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+C5.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...o,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...o,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:i},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:s,attribute:T5.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...o,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+A5.join("|")+")\\b"}]}}function N5(e){return{name:"Dockerfile",aliases:["docker"],case_insensitive:!0,keywords:["from","maintainer","expose","env","arg","user","onbuild","stopsignal"],contains:[e.HASH_COMMENT_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{beginKeywords:"run cmd entrypoint volume add copy workdir label healthcheck shell",starts:{end:/[^\\]$/,subLanguage:"bash"}}],illegal:"</"}}function M5(e){const i={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:i,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:i,illegal:/["']/}]}]}}var Zs="[0-9](_*[0-9])*",Ta=`\\.(${Zs})`,Ia="[0-9a-fA-F](_*[0-9a-fA-F])*",md={className:"number",variants:[{begin:`(\\b(${Zs})((${Ta})|\\.)?|(${Ta}))[eE][+-]?(${Zs})[fFdD]?\\b`},{begin:`\\b(${Zs})((${Ta})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Ta})[fFdD]?\\b`},{begin:`\\b(${Zs})[fFdD]\\b`},{begin:`\\b0[xX]((${Ia})\\.?|(${Ia})?\\.(${Ia}))[pP][+-]?(${Zs})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Ia})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Fp(e,t,n){return n===-1?"":e.replace(t,r=>Fp(e,t,n-1))}function z5(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+Fp("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),l={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},c={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},u={className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:l,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[u,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:l,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[c,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,md,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},md,c]}}const gd="[A-Za-z$_][0-9A-Za-z$_]*",$5=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],D5=["true","false","null","undefined","NaN","Infinity"],Up=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],qp=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Hp=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],P5=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],B5=[].concat(Hp,Up,qp);function L5(e){const t=e.regex,n=(re,{after:ze})=>{const ie="</"+re[0].slice(1);return re.input.indexOf(ie,ze)!==-1},r=gd,s={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(re,ze)=>{const ie=re[0].length+re.index,je=re.input[ie];if(je==="<"||je===","){ze.ignoreMatch();return}je===">"&&(n(re,{after:ie})||ze.ignoreMatch());let rt;const ot=re.input.substring(ie);if(rt=ot.match(/^\s*=/)){ze.ignoreMatch();return}if((rt=ot.match(/^\s+extends\s+/))&&rt.index===0){ze.ignoreMatch();return}}},o={$pattern:gd,keyword:$5,literal:D5,built_in:B5,"variable.language":P5},l="[0-9](_?[0-9])*",c=`\\.(${l})`,u="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${u})((${c})|\\.)?|(${c}))[eE][+-]?(${l})\\b`},{begin:`\\b(${u})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},m={className:"subst",begin:"\\$\\{",end:"\\}",keywords:o,contains:[]},h={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,m],subLanguage:"xml"}},y={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,m],subLanguage:"css"}},b={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,m],subLanguage:"graphql"}},S={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,m]},P={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},z=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,y,b,S,{match:/\$\d+/},f];m.contains=z.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(z)});const I=[].concat(P,m.contains),E=I.concat([{begin:/(\s*)\(/,end:/\)/,keywords:o,contains:["self"].concat(I)}]),_={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:E},L={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},N={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Up,...qp]}},G={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},D={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[_],illegal:/%/},W={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function q(re){return t.concat("(?!",re.join("|"),")")}const X={match:t.concat(/\b/,q([...Hp,"super","import"].map(re=>`${re}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},ne={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},he={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},_]},Ae="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",se={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(Ae)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[_]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:E,CLASS_REFERENCE:N},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),G,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,y,b,S,P,{match:/\$\d+/},f,N,{scope:"attr",match:r+t.lookahead(":"),relevance:0},se,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[P,e.REGEXP_MODE,{className:"function",begin:Ae,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:E}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:i},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},D,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[_,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},ne,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[_]},X,W,L,he,{match:/\$[(.]/}]}}function F5(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],s={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,s,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var Ks="[0-9](_*[0-9])*",Ra=`\\.(${Ks})`,Ca="[0-9a-fA-F](_*[0-9a-fA-F])*",U5={className:"number",variants:[{begin:`(\\b(${Ks})((${Ra})|\\.)?|(${Ra}))[eE][+-]?(${Ks})[fFdD]?\\b`},{begin:`\\b(${Ks})((${Ra})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Ra})[fFdD]?\\b`},{begin:`\\b(${Ks})[fFdD]\\b`},{begin:`\\b0[xX]((${Ca})\\.?|(${Ca})?\\.(${Ca}))[pP][+-]?(${Ks})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Ca})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function q5(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},r={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},s={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},i={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},a={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[i,s]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,i,s]}]};s.contains.push(a);const o={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},l={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(a,{className:"string"}),"self"]}]},c=U5,u=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),f={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},m=f;return m.variants[1].contains=[f],f.variants[1].contains=[m],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,u,n,r,o,l,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[f,e.C_LINE_COMMENT_MODE,u],relevance:0},e.C_LINE_COMMENT_MODE,u,o,l,a,e.C_NUMBER_MODE]},u]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},o,l]},a,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
|
|
6
|
-
`},c]}}function
|
|
7
|
-
]`,y={scope:"string",variants:[u,c,f,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},S=["false","null","true"],k=["__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"],P=["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"],I={keyword:k,literal:(ne=>{const he=[];return ne.forEach(Ae=>{he.push(Ae),Ae.toLowerCase()===Ae?he.push(Ae.toUpperCase()):he.push(Ae.toLowerCase())}),he})(S),built_in:P},E=ne=>ne.map(he=>he.replace(/\|\d+$/,"")),_={variants:[{match:[/new/,t.concat(h,"+"),t.concat("(?!",E(P).join("\\b|"),"\\b)"),s],scope:{1:"keyword",4:"title.class"}}]},L=t.concat(r,"\\b(?!\\()"),N={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),L],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[s,t.concat(/::/,t.lookahead(/(?!class\b)/)),L],scope:{1:"title.class",3:"variable.constant"}},{match:[s,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[s,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},G={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},D={relevance:0,begin:/\(/,end:/\)/,keywords:I,contains:[G,a,N,e.C_BLOCK_COMMENT_MODE,y,b,_]},W={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",E(k).join("\\b|"),"|",E(P).join("\\b|"),"\\b)"),r,t.concat(h,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[D]};D.contains.push(W);const q=[G,N,e.C_BLOCK_COMMENT_MODE,y,b,_],X={begin:t.concat(/#\[\s*\\?/,t.either(s,i)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:S,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:S,keyword:["new","array"]},contains:["self",...q]},...q,{scope:"meta",variants:[{match:s},{match:i}]}]};return{case_insensitive:!1,keywords:I,contains:[X,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}]}},o,{scope:"variable.language",match:/\$this\b/},a,W,N,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},_,{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:I,contains:["self",X,a,N,e.C_BLOCK_COMMENT_MODE,y,b]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},y,b]}}function j5(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],o={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},l={className:"meta",begin:/^(>>>|\.\.\.) /},c={className:"subst",begin:/\{/,end:/\}/,keywords:o,illegal:/#/},u={begin:/\{\{/,relevance:0},f={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l,u,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l,u,c]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,u,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,u,c]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},m="[0-9](_?[0-9])*",h=`(\\b(${m}))?\\.(${m})|\\b(${m})\\.`,y=`\\b|${r.join("|")}`,b={className:"number",relevance:0,variants:[{begin:`(\\b(${m})|(${h}))[eE][+-]?(${m})[jJ]?(?=${y})`},{begin:`(${h})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${y})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${y})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${y})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${y})`},{begin:`\\b(${m})[jJ](?=${y})`}]},S={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:o,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},k={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:["self",l,b,f,e.HASH_COMMENT_MODE]}]};return c.contains=[f,b,l],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:o,illegal:/(<\/|\?)|=>/,contains:[l,b,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,S,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[k]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[b,k,f]}]}}function G5(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),s=t.concat(r,/(::\w+)*/),a={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},o={className:"doctag",begin:"@[A-Za-z]+"},l={begin:"#<",end:">"},c=[e.COMMENT("#","$",{contains:[o]}),e.COMMENT("^=begin","^=end",{contains:[o],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],u={className:"subst",begin:/#\{/,end:/\}/,keywords:a},f={className:"string",contains:[e.BACKSLASH_ESCAPE,u],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,u]})]}]},m="[1-9](_?[0-9])*|0",h="[0-9](_?[0-9])*",y={className:"number",relevance:0,variants:[{begin:`\\b(${m})(\\.(${h}))?([eE][+-]?(${h})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},b={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:a}]},_=[f,{variants:[{match:[/class\s+/,s,/\s+<\s+/,s]},{match:[/\b(class|module)\s+/,s]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:a},{match:[/(include|extend)\s+/,s],scope:{2:"title.class"},keywords:a},{relevance:0,match:[s,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[b]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[f,{begin:n}],relevance:0},y,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:a},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,u],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(l,c),relevance:0}].concat(l,c);u.contains=_,b.contains=_;const D=[{begin:/^\s*=>/,starts:{end:"$",contains:_}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:a,contains:_}}];return c.unshift(l),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:a,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(D).concat(c).concat(_)}}function Z5(e){const t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),s=t.concat(n,e.IDENT_RE),i={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,s,t.lookahead(/\s*\(/))},a="([ui](8|16|32|64|128|size)|f(32|64))?",o=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],l=["true","false","Some","None","Ok","Err"],c=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],u=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:u,keyword:o,literal:l,built_in:c},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+a},{begin:"\\b0o([0-7_]+)"+a},{begin:"\\b0x([A-Fa-f0-9_]+)"+a},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+a}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:c,type:u}},{className:"punctuation",begin:"->"},i]}}function K5(e){const t=e.regex,n=e.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},s={begin:/"/,end:/"/,contains:[{match:/""/}]},i=["true","false","unknown"],a=["double precision","large object","with timezone","without timezone"],o=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],l=["add","asc","collation","desc","final","first","last","view"],c=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],u=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],f=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],m=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],h=u,y=[...c,...l].filter(E=>!u.includes(E)),b={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},S={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},k={match:t.concat(/\b/,t.either(...h),/\s*\(/),relevance:0,keywords:{built_in:h}};function P(E){return t.concat(/\b/,t.either(...E.map(_=>_.replace(/\s+/,"\\s+"))),/\b/)}const z={scope:"keyword",match:P(m),relevance:0};function I(E,{exceptions:_,when:L}={}){const N=L;return _=_||[],E.map(G=>G.match(/\|\d+$/)||_.includes(G)?G:N(G)?`${G}|0`:G)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:I(y,{when:E=>E.length<3}),literal:i,type:o,built_in:f},contains:[{scope:"type",match:P(a)},z,k,b,r,s,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,S]}}function Vp(e){return e?typeof e=="string"?e:e.source:null}function Ti(e){return wt("(?=",e,")")}function wt(...e){return e.map(n=>Vp(n)).join("")}function W5(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function dn(...e){return"("+(W5(e).capture?"":"?:")+e.map(r=>Vp(r)).join("|")+")"}const x0=e=>wt(/\b/,e,/\w$/.test(e)?/\b/:/\B/),Q5=["Protocol","Type"].map(x0),vd=["init","self"].map(x0),J5=["Any","Self"],El=["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"],bd=["false","nil","true"],Y5=["assignment","associativity","higherThan","left","lowerThan","none","right"],X5=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],yd=["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"],jp=dn(/[/=\-+!*%<>&|^~?]/,/[\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]/),Gp=dn(jp,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Al=wt(jp,Gp,"*"),Zp=dn(/[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]/),po=dn(Zp,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),rr=wt(Zp,po,"*"),Oa=wt(/[A-Z]/,po,"*"),e6=["attached","autoclosure",wt(/convention\(/,dn("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",wt(/objc\(/,rr,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],t6=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function n6(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,n],s={match:[/\./,dn(...Q5,...vd)],className:{2:"keyword"}},i={match:wt(/\./,dn(...El)),relevance:0},a=El.filter(Ye=>typeof Ye=="string").concat(["_|0"]),o=El.filter(Ye=>typeof Ye!="string").concat(J5).map(x0),l={variants:[{className:"keyword",match:dn(...o,...vd)}]},c={$pattern:dn(/\b\w+/,/#\w+/),keyword:a.concat(X5),literal:bd},u=[s,i,l],f={match:wt(/\./,dn(...yd)),relevance:0},m={className:"built_in",match:wt(/\b/,dn(...yd),/(?=\()/)},h=[f,m],y={match:/->/,relevance:0},b={className:"operator",relevance:0,variants:[{match:Al},{match:`\\.(\\.|${Gp})+`}]},S=[y,b],k="([0-9]_*)+",P="([0-9a-fA-F]_*)+",z={className:"number",relevance:0,variants:[{match:`\\b(${k})(\\.(${k}))?([eE][+-]?(${k}))?\\b`},{match:`\\b0x(${P})(\\.(${P}))?([pP][+-]?(${k}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},I=(Ye="")=>({className:"subst",variants:[{match:wt(/\\/,Ye,/[0\\tnr"']/)},{match:wt(/\\/,Ye,/u\{[0-9a-fA-F]{1,8}\}/)}]}),E=(Ye="")=>({className:"subst",match:wt(/\\/,Ye,/[\t ]*(?:[\r\n]|\r\n)/)}),_=(Ye="")=>({className:"subst",label:"interpol",begin:wt(/\\/,Ye,/\(/),end:/\)/}),L=(Ye="")=>({begin:wt(Ye,/"""/),end:wt(/"""/,Ye),contains:[I(Ye),E(Ye),_(Ye)]}),N=(Ye="")=>({begin:wt(Ye,/"/),end:wt(/"/,Ye),contains:[I(Ye),_(Ye)]}),G={className:"string",variants:[L(),L("#"),L("##"),L("###"),N(),N("#"),N("##"),N("###")]},D=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],W={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:D},q=Ye=>{const Tt=wt(Ye,/\//),bn=wt(/\//,Ye);return{begin:Tt,end:bn,contains:[...D,{scope:"comment",begin:`#(?!.*${bn})`,end:/$/}]}},X={scope:"regexp",variants:[q("###"),q("##"),q("#"),W]},ne={match:wt(/`/,rr,/`/)},he={className:"variable",match:/\$\d+/},Ae={className:"variable",match:`\\$${po}+`},se=[ne,he,Ae],re={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:t6,contains:[...S,z,G]}]}},ze={scope:"keyword",match:wt(/@/,dn(...e6),Ti(dn(/\(/,/\s+/)))},ie={scope:"meta",match:wt(/@/,rr)},je=[re,ze,ie],rt={match:Ti(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:wt(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,po,"+")},{className:"type",match:Oa,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:wt(/\s+&\s+/,Ti(Oa)),relevance:0}]},ot={begin:/</,end:/>/,keywords:c,contains:[...r,...u,...je,y,rt]};rt.contains.push(ot);const Ft={match:wt(rr,/\s*:/),keywords:"_|0",relevance:0},st={begin:/\(/,end:/\)/,relevance:0,keywords:c,contains:["self",Ft,...r,X,...u,...h,...S,z,G,...se,...je,rt]},at={begin:/</,end:/>/,keywords:"repeat each",contains:[...r,rt]},C={begin:dn(Ti(wt(rr,/\s*:/)),Ti(wt(rr,/\s+/,rr,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:rr}]},le={begin:/\(/,end:/\)/,keywords:c,contains:[C,...r,...u,...S,z,G,...je,rt,st],endsParent:!0,illegal:/["']/},Q={match:[/(func|macro)/,/\s+/,dn(ne.match,rr,Al)],className:{1:"keyword",3:"title.function"},contains:[at,le,t],illegal:[/\[/,/%/]},de={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[at,le,t],illegal:/\[|%/},Ie={match:[/operator/,/\s+/,Al],className:{1:"keyword",3:"title"}},Ge={begin:[/precedencegroup/,/\s+/,Oa],className:{1:"keyword",3:"title"},contains:[rt],keywords:[...Y5,...bd],end:/}/},Be={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Te={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},yt={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,rr,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:c,contains:[at,...u,{begin:/:/,end:/\{/,keywords:c,contains:[{scope:"title.class.inherited",match:Oa},...u],relevance:0}]};for(const Ye of G.variants){const Tt=Ye.contains.find(Yn=>Yn.label==="interpol");Tt.keywords=c;const bn=[...u,...h,...S,z,G,...se];Tt.contains=[...bn,{begin:/\(/,end:/\)/,contains:["self",...bn]}]}return{name:"Swift",keywords:c,contains:[...r,Q,de,Be,Te,yt,Ie,Ge,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},X,...u,...h,...S,z,G,...se,...je,rt,st]}}const mo="[A-Za-z$_][0-9A-Za-z$_]*",Kp=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],Wp=["true","false","null","undefined","NaN","Infinity"],Qp=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Jp=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Yp=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Xp=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],em=[].concat(Yp,Qp,Jp);function r6(e){const t=e.regex,n=(re,{after:ze})=>{const ie="</"+re[0].slice(1);return re.input.indexOf(ie,ze)!==-1},r=mo,s={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(re,ze)=>{const ie=re[0].length+re.index,je=re.input[ie];if(je==="<"||je===","){ze.ignoreMatch();return}je===">"&&(n(re,{after:ie})||ze.ignoreMatch());let rt;const ot=re.input.substring(ie);if(rt=ot.match(/^\s*=/)){ze.ignoreMatch();return}if((rt=ot.match(/^\s+extends\s+/))&&rt.index===0){ze.ignoreMatch();return}}},o={$pattern:mo,keyword:Kp,literal:Wp,built_in:em,"variable.language":Xp},l="[0-9](_?[0-9])*",c=`\\.(${l})`,u="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${u})((${c})|\\.)?|(${c}))[eE][+-]?(${l})\\b`},{begin:`\\b(${u})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},m={className:"subst",begin:"\\$\\{",end:"\\}",keywords:o,contains:[]},h={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,m],subLanguage:"xml"}},y={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,m],subLanguage:"css"}},b={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,m],subLanguage:"graphql"}},S={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,m]},P={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},z=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,y,b,S,{match:/\$\d+/},f];m.contains=z.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(z)});const I=[].concat(P,m.contains),E=I.concat([{begin:/(\s*)\(/,end:/\)/,keywords:o,contains:["self"].concat(I)}]),_={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:E},L={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},N={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Qp,...Jp]}},G={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},D={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[_],illegal:/%/},W={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function q(re){return t.concat("(?!",re.join("|"),")")}const X={match:t.concat(/\b/,q([...Yp,"super","import"].map(re=>`${re}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},ne={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},he={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},_]},Ae="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",se={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(Ae)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[_]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:E,CLASS_REFERENCE:N},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),G,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,y,b,S,P,{match:/\$\d+/},f,N,{scope:"attr",match:r+t.lookahead(":"),relevance:0},se,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[P,e.REGEXP_MODE,{className:"function",begin:Ae,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:E}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:i},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},D,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[_,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},ne,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[_]},X,W,L,he,{match:/\$[(.]/}]}}function s6(e){const t=e.regex,n=r6(e),r=mo,s=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],i={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},a={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:s},contains:[n.exports.CLASS_REFERENCE]},o={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},l=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],c={$pattern:mo,keyword:Kp.concat(l),literal:Wp,built_in:em.concat(s),"variable.language":Xp},u={className:"meta",begin:"@"+r},f=(b,S,k)=>{const P=b.contains.findIndex(z=>z.label===S);if(P===-1)throw new Error("can not find mode to replace");b.contains.splice(P,1,k)};Object.assign(n.keywords,c),n.exports.PARAMS_CONTAINS.push(u);const m=n.contains.find(b=>b.scope==="attr"),h=Object.assign({},m,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,m,h]),n.contains=n.contains.concat([u,i,a,h]),f(n,"shebang",e.SHEBANG()),f(n,"use_strict",o);const y=n.contains.find(b=>b.label==="func.def");return y.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function i6(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,s={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},i={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},a=e.inherit(i,{begin:/\(/,end:/\)/}),o=e.inherit(e.APOS_STRING_MODE,{className:"string"}),l=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),c={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[s]},{begin:/'/,end:/'/,contains:[s]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[i,l,o,a,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[i,a,l,o]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},s,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[l]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[c],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[c],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:c}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function a6(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},s={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},i={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},a={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,s]},o=e.inherit(a,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),m={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},h={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},y={begin:/\{/,end:/\}/,contains:[h],illegal:"\\n",relevance:0},b={begin:"\\[",end:"\\]",contains:[h],illegal:"\\n",relevance:0},S=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},m,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},y,b,i,a],k=[...S];return k.pop(),k.push(o),h.contains=k,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:S}}function k0(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Bs=k0();function tm(e){Bs=e}var qi={exec:()=>null};function vt(e,t=""){let n=typeof e=="string"?e:e.source;const r={replace:(s,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(mn.caret,"$1"),n=n.replace(s,a),r},getRegex:()=>new RegExp(n,t)};return r}var mn={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},o6=/^(?:[ \t]*(?:\n|$))+/,l6=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,c6=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,fa=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,u6=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,_0=/(?:[*+-]|\d{1,9}[.)])/,nm=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,rm=vt(nm).replace(/bull/g,_0).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),d6=vt(nm).replace(/bull/g,_0).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),E0=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,f6=/^[^\n]+/,A0=/(?!\s*\])(?:\\.|[^\[\]\\])+/,h6=vt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",A0).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),p6=vt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,_0).getRegex(),Bo="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",T0=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,m6=vt("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",T0).replace("tag",Bo).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),sm=vt(E0).replace("hr",fa).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Bo).getRegex(),g6=vt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",sm).getRegex(),I0={blockquote:g6,code:l6,def:h6,fences:c6,heading:u6,hr:fa,html:m6,lheading:rm,list:p6,newline:o6,paragraph:sm,table:qi,text:f6},wd=vt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",fa).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Bo).getRegex(),v6={...I0,lheading:d6,table:wd,paragraph:vt(E0).replace("hr",fa).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",wd).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Bo).getRegex()},b6={...I0,html:vt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",T0).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:qi,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:vt(E0).replace("hr",fa).replace("heading",` *#{1,6} *[^
|
|
8
|
-
]`).replace("lheading",
|
|
3
|
+
[error] ${I.message}`))}),o.addEventListener("close",()=>{s.value=s.value==="exited"?"exited":"disconnected"}),o.addEventListener("error",()=>{s.value="error"}),i.onData(z=>{o?.readyState===WebSocket.OPEN&&o.send(JSON.stringify({type:"input",data:z}))}),l=new ResizeObserver(y),l.observe(r.value),b())}return on(()=>t.session.id,N,{immediate:!0}),zo(S),(z,I)=>(O(),j("div",k5,[k("div",_5,[k("div",{ref_key:"terminalEl",ref:r,class:"terminal-canvas"},null,512)]),k("div",E5,[k("span",null,K(s.value)+" · "+K(e.session.tty?.mode||"pty"),1)])]))}});function A5(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var _l,md;function T5(){if(md)return _l;md=1;function e($){return $ instanceof Map?$.clear=$.delete=$.set=function(){throw new Error("map is read-only")}:$ instanceof Set&&($.add=$.clear=$.delete=function(){throw new Error("set is read-only")}),Object.freeze($),Object.getOwnPropertyNames($).forEach(Y=>{const ge=$[Y],We=typeof ge;(We==="object"||We==="function")&&!Object.isFrozen(ge)&&e(ge)}),$}class t{constructor(Y){Y.data===void 0&&(Y.data={}),this.data=Y.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function n($){return $.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function r($,...Y){const ge=Object.create(null);for(const We in $)ge[We]=$[We];return Y.forEach(function(We){for(const Ut in We)ge[Ut]=We[Ut]}),ge}const s="</span>",i=$=>!!$.scope,a=($,{prefix:Y})=>{if($.startsWith("language:"))return $.replace("language:","language-");if($.includes(".")){const ge=$.split(".");return[`${Y}${ge.shift()}`,...ge.map((We,Ut)=>`${We}${"_".repeat(Ut+1)}`)].join(" ")}return`${Y}${$}`};class o{constructor(Y,ge){this.buffer="",this.classPrefix=ge.classPrefix,Y.walk(this)}addText(Y){this.buffer+=n(Y)}openNode(Y){if(!i(Y))return;const ge=a(Y.scope,{prefix:this.classPrefix});this.span(ge)}closeNode(Y){i(Y)&&(this.buffer+=s)}value(){return this.buffer}span(Y){this.buffer+=`<span class="${Y}">`}}const l=($={})=>{const Y={children:[]};return Object.assign(Y,$),Y};class c{constructor(){this.rootNode=l(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(Y){this.top.children.push(Y)}openNode(Y){const ge=l({scope:Y});this.add(ge),this.stack.push(ge)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(Y){return this.constructor._walk(Y,this.rootNode)}static _walk(Y,ge){return typeof ge=="string"?Y.addText(ge):ge.children&&(Y.openNode(ge),ge.children.forEach(We=>this._walk(Y,We)),Y.closeNode(ge)),Y}static _collapse(Y){typeof Y!="string"&&Y.children&&(Y.children.every(ge=>typeof ge=="string")?Y.children=[Y.children.join("")]:Y.children.forEach(ge=>{c._collapse(ge)}))}}class u extends c{constructor(Y){super(),this.options=Y}addText(Y){Y!==""&&this.add(Y)}startScope(Y){this.openNode(Y)}endScope(){this.closeNode()}__addSublanguage(Y,ge){const We=Y.root;ge&&(We.scope=`language:${ge}`),this.add(We)}toHTML(){return new o(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function p($){return $?typeof $=="string"?$:$.source:null}function m($){return b("(?=",$,")")}function f($){return b("(?:",$,")*")}function y($){return b("(?:",$,")?")}function b(...$){return $.map(ge=>p(ge)).join("")}function x($){const Y=$[$.length-1];return typeof Y=="object"&&Y.constructor===Object?($.splice($.length-1,1),Y):{}}function S(...$){return"("+(x($).capture?"":"?:")+$.map(We=>p(We)).join("|")+")"}function N($){return new RegExp($.toString()+"|").exec("").length-1}function z($,Y){const ge=$&&$.exec(Y);return ge&&ge.index===0}const I=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function E($,{joinWith:Y}){let ge=0;return $.map(We=>{ge+=1;const Ut=ge;let qt=p(We),Ce="";for(;qt.length>0;){const Ee=I.exec(qt);if(!Ee){Ce+=qt;break}Ce+=qt.substring(0,Ee.index),qt=qt.substring(Ee.index+Ee[0].length),Ee[0][0]==="\\"&&Ee[1]?Ce+="\\"+String(Number(Ee[1])+Ut):(Ce+=Ee[0],Ee[0]==="("&&ge++)}return Ce}).map(We=>`(${We})`).join(Y)}const _=/\b\B/,L="[a-zA-Z]\\w*",M="[a-zA-Z_]\\w*",G="\\b\\d+(\\.\\d+)?",P="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",W="\\b(0b[01]+)",q="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",X=($={})=>{const Y=/^#![ ]*\//;return $.binary&&($.begin=b(Y,/.*\b/,$.binary,/\b.*/)),r({scope:"meta",begin:Y,end:/$/,relevance:0,"on:begin":(ge,We)=>{ge.index!==0&&We.ignoreMatch()}},$)},ne={begin:"\\\\[\\s\\S]",relevance:0},he={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[ne]},Ae={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[ne]},se={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},re=function($,Y,ge={}){const We=r({scope:"comment",begin:$,end:Y,contains:[]},ge);We.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const Ut=S("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return We.contains.push({begin:b(/[ ]+/,"(",Ut,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),We},ze=re("//","$"),ie=re("/\\*","\\*/"),je=re("#","$"),rt={scope:"number",begin:G,relevance:0},ot={scope:"number",begin:P,relevance:0},Ft={scope:"number",begin:W,relevance:0},st={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[ne,{begin:/\[/,end:/\]/,relevance:0,contains:[ne]}]},at={scope:"title",begin:L,relevance:0},C={scope:"title",begin:M,relevance:0},le={begin:"\\.\\s*"+M,relevance:0};var de=Object.freeze({__proto__:null,APOS_STRING_MODE:he,BACKSLASH_ESCAPE:ne,BINARY_NUMBER_MODE:Ft,BINARY_NUMBER_RE:W,COMMENT:re,C_BLOCK_COMMENT_MODE:ie,C_LINE_COMMENT_MODE:ze,C_NUMBER_MODE:ot,C_NUMBER_RE:P,END_SAME_AS_BEGIN:function($){return Object.assign($,{"on:begin":(Y,ge)=>{ge.data._beginMatch=Y[1]},"on:end":(Y,ge)=>{ge.data._beginMatch!==Y[1]&&ge.ignoreMatch()}})},HASH_COMMENT_MODE:je,IDENT_RE:L,MATCH_NOTHING_RE:_,METHOD_GUARD:le,NUMBER_MODE:rt,NUMBER_RE:G,PHRASAL_WORDS_MODE:se,QUOTE_STRING_MODE:Ae,REGEXP_MODE:st,RE_STARTERS_RE:q,SHEBANG:X,TITLE_MODE:at,UNDERSCORE_IDENT_RE:M,UNDERSCORE_TITLE_MODE:C});function Ie($,Y){$.input[$.index-1]==="."&&Y.ignoreMatch()}function Ge($,Y){$.className!==void 0&&($.scope=$.className,delete $.className)}function Le($,Y){Y&&$.beginKeywords&&($.begin="\\b("+$.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",$.__beforeBegin=Ie,$.keywords=$.keywords||$.beginKeywords,delete $.beginKeywords,$.relevance===void 0&&($.relevance=0))}function Te($,Y){Array.isArray($.illegal)&&($.illegal=S(...$.illegal))}function yt($,Y){if($.match){if($.begin||$.end)throw new Error("begin & end are not supported with match");$.begin=$.match,delete $.match}}function Ye($,Y){$.relevance===void 0&&($.relevance=1)}const Tt=($,Y)=>{if(!$.beforeMatch)return;if($.starts)throw new Error("beforeMatch cannot be used with starts");const ge=Object.assign({},$);Object.keys($).forEach(We=>{delete $[We]}),$.keywords=ge.keywords,$.begin=b(ge.beforeMatch,m(ge.begin)),$.starts={relevance:0,contains:[Object.assign(ge,{endsParent:!0})]},$.relevance=0,delete ge.beforeMatch},bn=["of","and","for","in","not","or","if","then","parent","list","value"],Yn="keyword";function br($,Y,ge=Yn){const We=Object.create(null);return typeof $=="string"?Ut(ge,$.split(" ")):Array.isArray($)?Ut(ge,$):Object.keys($).forEach(function(qt){Object.assign(We,br($[qt],Y,qt))}),We;function Ut(qt,Ce){Y&&(Ce=Ce.map(Ee=>Ee.toLowerCase())),Ce.forEach(function(Ee){const He=Ee.split("|");We[He[0]]=[qt,Si(He[0],He[1])]})}}function Si($,Y){return Y?Number(Y):xi($)?0:1}function xi($){return bn.includes($.toLowerCase())}const Fr={},$n=$=>{console.error($)},ys=($,...Y)=>{console.log(`WARN: ${$}`,...Y)},Xn=($,Y)=>{Fr[`${$}/${Y}`]||(console.log(`Deprecated as of ${$}. ${Y}`),Fr[`${$}/${Y}`]=!0)},V=new Error;function F($,Y,{key:ge}){let We=0;const Ut=$[ge],qt={},Ce={};for(let Ee=1;Ee<=Y.length;Ee++)Ce[Ee+We]=Ut[Ee],qt[Ee+We]=!0,We+=N(Y[Ee-1]);$[ge]=Ce,$[ge]._emit=qt,$[ge]._multi=!0}function U($){if(Array.isArray($.begin)){if($.skip||$.excludeBegin||$.returnBegin)throw $n("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),V;if(typeof $.beginScope!="object"||$.beginScope===null)throw $n("beginScope must be object"),V;F($,$.begin,{key:"beginScope"}),$.begin=E($.begin,{joinWith:""})}}function De($){if(Array.isArray($.end)){if($.skip||$.excludeEnd||$.returnEnd)throw $n("skip, excludeEnd, returnEnd not compatible with endScope: {}"),V;if(typeof $.endScope!="object"||$.endScope===null)throw $n("endScope must be object"),V;F($,$.end,{key:"endScope"}),$.end=E($.end,{joinWith:""})}}function mt($){$.scope&&typeof $.scope=="object"&&$.scope!==null&&($.beginScope=$.scope,delete $.scope)}function cn($){mt($),typeof $.beginScope=="string"&&($.beginScope={_wrap:$.beginScope}),typeof $.endScope=="string"&&($.endScope={_wrap:$.endScope}),U($),De($)}function Dn($){function Y(Ce,Ee){return new RegExp(p(Ce),"m"+($.case_insensitive?"i":"")+($.unicodeRegex?"u":"")+(Ee?"g":""))}class ge{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Ee,He){He.position=this.position++,this.matchIndexes[this.matchAt]=He,this.regexes.push([He,Ee]),this.matchAt+=N(Ee)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Ee=this.regexes.map(He=>He[1]);this.matcherRe=Y(E(Ee,{joinWith:"|"}),!0),this.lastIndex=0}exec(Ee){this.matcherRe.lastIndex=this.lastIndex;const He=this.matcherRe.exec(Ee);if(!He)return null;const nn=He.findIndex((ki,dl)=>dl>0&&ki!==void 0),jt=this.matchIndexes[nn];return He.splice(0,nn),Object.assign(He,jt)}}class We{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(Ee){if(this.multiRegexes[Ee])return this.multiRegexes[Ee];const He=new ge;return this.rules.slice(Ee).forEach(([nn,jt])=>He.addRule(nn,jt)),He.compile(),this.multiRegexes[Ee]=He,He}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Ee,He){this.rules.push([Ee,He]),He.type==="begin"&&this.count++}exec(Ee){const He=this.getMatcher(this.regexIndex);He.lastIndex=this.lastIndex;let nn=He.exec(Ee);if(this.resumingScanAtSamePosition()&&!(nn&&nn.index===this.lastIndex)){const jt=this.getMatcher(0);jt.lastIndex=this.lastIndex+1,nn=jt.exec(Ee)}return nn&&(this.regexIndex+=nn.position+1,this.regexIndex===this.count&&this.considerAll()),nn}}function Ut(Ce){const Ee=new We;return Ce.contains.forEach(He=>Ee.addRule(He.begin,{rule:He,type:"begin"})),Ce.terminatorEnd&&Ee.addRule(Ce.terminatorEnd,{type:"end"}),Ce.illegal&&Ee.addRule(Ce.illegal,{type:"illegal"}),Ee}function qt(Ce,Ee){const He=Ce;if(Ce.isCompiled)return He;[Ge,yt,cn,Tt].forEach(jt=>jt(Ce,Ee)),$.compilerExtensions.forEach(jt=>jt(Ce,Ee)),Ce.__beforeBegin=null,[Le,Te,Ye].forEach(jt=>jt(Ce,Ee)),Ce.isCompiled=!0;let nn=null;return typeof Ce.keywords=="object"&&Ce.keywords.$pattern&&(Ce.keywords=Object.assign({},Ce.keywords),nn=Ce.keywords.$pattern,delete Ce.keywords.$pattern),nn=nn||/\w+/,Ce.keywords&&(Ce.keywords=br(Ce.keywords,$.case_insensitive)),He.keywordPatternRe=Y(nn,!0),Ee&&(Ce.begin||(Ce.begin=/\B|\b/),He.beginRe=Y(He.begin),!Ce.end&&!Ce.endsWithParent&&(Ce.end=/\B|\b/),Ce.end&&(He.endRe=Y(He.end)),He.terminatorEnd=p(He.end)||"",Ce.endsWithParent&&Ee.terminatorEnd&&(He.terminatorEnd+=(Ce.end?"|":"")+Ee.terminatorEnd)),Ce.illegal&&(He.illegalRe=Y(Ce.illegal)),Ce.contains||(Ce.contains=[]),Ce.contains=[].concat(...Ce.contains.map(function(jt){return cl(jt==="self"?Ce:jt)})),Ce.contains.forEach(function(jt){qt(jt,He)}),Ce.starts&&qt(Ce.starts,Ee),He.matcher=Ut(He),He}if($.compilerExtensions||($.compilerExtensions=[]),$.contains&&$.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return $.classNameAliases=r($.classNameAliases||{}),qt($)}function Hn($){return $?$.endsWithParent||Hn($.starts):!1}function cl($){return $.variants&&!$.cachedVariants&&($.cachedVariants=$.variants.map(function(Y){return r($,{variants:null},Y)})),$.cachedVariants?$.cachedVariants:Hn($)?r($,{starts:$.starts?r($.starts):null}):Object.isFrozen($)?r($):$}var f4="11.11.1";class h4 extends Error{constructor(Y,ge){super(Y),this.name="HTMLInjectionError",this.html=ge}}const ul=n,Tu=r,Iu=Symbol("nomatch"),p4=7,Ru=function($){const Y=Object.create(null),ge=Object.create(null),We=[];let Ut=!0;const qt="Could not find the language '{}', did you forget to load/include a language module?",Ce={disableAutodetect:!0,name:"Plain text",contains:[]};let Ee={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:u};function He(ce){return Ee.noHighlightRe.test(ce)}function nn(ce){let Pe=ce.className+" ";Pe+=ce.parentNode?ce.parentNode.className:"";const it=Ee.languageDetectRe.exec(Pe);if(it){const kt=Ur(it[1]);return kt||(ys(qt.replace("{}",it[1])),ys("Falling back to no-highlight mode for this block.",ce)),kt?it[1]:"no-highlight"}return Pe.split(/\s+/).find(kt=>He(kt)||Ur(kt))}function jt(ce,Pe,it){let kt="",Qt="";typeof Pe=="object"?(kt=ce,it=Pe.ignoreIllegals,Qt=Pe.language):(Xn("10.7.0","highlight(lang, code, ...args) has been deprecated."),Xn("10.7.0",`Please use highlight(code, options) instead.
|
|
4
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),Qt=ce,kt=Pe),it===void 0&&(it=!0);const Vn={code:kt,language:Qt};ba("before:highlight",Vn);const qr=Vn.result?Vn.result:ki(Vn.language,Vn.code,it);return qr.code=Vn.code,ba("after:highlight",qr),qr}function ki(ce,Pe,it,kt){const Qt=Object.create(null);function Vn(ve,$e){return ve.keywords[$e]}function qr(){if(!Qe.keywords){rn.addText(_t);return}let ve=0;Qe.keywordPatternRe.lastIndex=0;let $e=Qe.keywordPatternRe.exec(_t),Xe="";for(;$e;){Xe+=_t.substring(ve,$e.index);const bt=tr.case_insensitive?$e[0].toLowerCase():$e[0],sn=Vn(Qe,bt);if(sn){const[yr,O4]=sn;if(rn.addText(Xe),Xe="",Qt[bt]=(Qt[bt]||0)+1,Qt[bt]<=p4&&(Sa+=O4),yr.startsWith("_"))Xe+=$e[0];else{const M4=tr.classNameAliases[yr]||yr;er($e[0],M4)}}else Xe+=$e[0];ve=Qe.keywordPatternRe.lastIndex,$e=Qe.keywordPatternRe.exec(_t)}Xe+=_t.substring(ve),rn.addText(Xe)}function ya(){if(_t==="")return;let ve=null;if(typeof Qe.subLanguage=="string"){if(!Y[Qe.subLanguage]){rn.addText(_t);return}ve=ki(Qe.subLanguage,_t,!0,Pu[Qe.subLanguage]),Pu[Qe.subLanguage]=ve._top}else ve=fl(_t,Qe.subLanguage.length?Qe.subLanguage:null);Qe.relevance>0&&(Sa+=ve.relevance),rn.__addSublanguage(ve._emitter,ve.language)}function kn(){Qe.subLanguage!=null?ya():qr(),_t=""}function er(ve,$e){ve!==""&&(rn.startScope($e),rn.addText(ve),rn.endScope())}function Nu(ve,$e){let Xe=1;const bt=$e.length-1;for(;Xe<=bt;){if(!ve._emit[Xe]){Xe++;continue}const sn=tr.classNameAliases[ve[Xe]]||ve[Xe],yr=$e[Xe];sn?er(yr,sn):(_t=yr,qr(),_t=""),Xe++}}function zu(ve,$e){return ve.scope&&typeof ve.scope=="string"&&rn.openNode(tr.classNameAliases[ve.scope]||ve.scope),ve.beginScope&&(ve.beginScope._wrap?(er(_t,tr.classNameAliases[ve.beginScope._wrap]||ve.beginScope._wrap),_t=""):ve.beginScope._multi&&(Nu(ve.beginScope,$e),_t="")),Qe=Object.create(ve,{parent:{value:Qe}}),Qe}function $u(ve,$e,Xe){let bt=z(ve.endRe,Xe);if(bt){if(ve["on:end"]){const sn=new t(ve);ve["on:end"]($e,sn),sn.isMatchIgnored&&(bt=!1)}if(bt){for(;ve.endsParent&&ve.parent;)ve=ve.parent;return ve}}if(ve.endsWithParent)return $u(ve.parent,$e,Xe)}function A4(ve){return Qe.matcher.regexIndex===0?(_t+=ve[0],1):(gl=!0,0)}function T4(ve){const $e=ve[0],Xe=ve.rule,bt=new t(Xe),sn=[Xe.__beforeBegin,Xe["on:begin"]];for(const yr of sn)if(yr&&(yr(ve,bt),bt.isMatchIgnored))return A4($e);return Xe.skip?_t+=$e:(Xe.excludeBegin&&(_t+=$e),kn(),!Xe.returnBegin&&!Xe.excludeBegin&&(_t=$e)),zu(Xe,ve),Xe.returnBegin?0:$e.length}function I4(ve){const $e=ve[0],Xe=Pe.substring(ve.index),bt=$u(Qe,ve,Xe);if(!bt)return Iu;const sn=Qe;Qe.endScope&&Qe.endScope._wrap?(kn(),er($e,Qe.endScope._wrap)):Qe.endScope&&Qe.endScope._multi?(kn(),Nu(Qe.endScope,ve)):sn.skip?_t+=$e:(sn.returnEnd||sn.excludeEnd||(_t+=$e),kn(),sn.excludeEnd&&(_t=$e));do Qe.scope&&rn.closeNode(),!Qe.skip&&!Qe.subLanguage&&(Sa+=Qe.relevance),Qe=Qe.parent;while(Qe!==bt.parent);return bt.starts&&zu(bt.starts,ve),sn.returnEnd?0:$e.length}function R4(){const ve=[];for(let $e=Qe;$e!==tr;$e=$e.parent)$e.scope&&ve.unshift($e.scope);ve.forEach($e=>rn.openNode($e))}let wa={};function Du(ve,$e){const Xe=$e&&$e[0];if(_t+=ve,Xe==null)return kn(),0;if(wa.type==="begin"&&$e.type==="end"&&wa.index===$e.index&&Xe===""){if(_t+=Pe.slice($e.index,$e.index+1),!Ut){const bt=new Error(`0 width match regex (${ce})`);throw bt.languageName=ce,bt.badRule=wa.rule,bt}return 1}if(wa=$e,$e.type==="begin")return T4($e);if($e.type==="illegal"&&!it){const bt=new Error('Illegal lexeme "'+Xe+'" for mode "'+(Qe.scope||"<unnamed>")+'"');throw bt.mode=Qe,bt}else if($e.type==="end"){const bt=I4($e);if(bt!==Iu)return bt}if($e.type==="illegal"&&Xe==="")return _t+=`
|
|
5
|
+
`,1;if(ml>1e5&&ml>$e.index*3)throw new Error("potential infinite loop, way more iterations than matches");return _t+=Xe,Xe.length}const tr=Ur(ce);if(!tr)throw $n(qt.replace("{}",ce)),new Error('Unknown language: "'+ce+'"');const C4=Dn(tr);let pl="",Qe=kt||C4;const Pu={},rn=new Ee.__emitter(Ee);R4();let _t="",Sa=0,ws=0,ml=0,gl=!1;try{if(tr.__emitTokens)tr.__emitTokens(Pe,rn);else{for(Qe.matcher.considerAll();;){ml++,gl?gl=!1:Qe.matcher.considerAll(),Qe.matcher.lastIndex=ws;const ve=Qe.matcher.exec(Pe);if(!ve)break;const $e=Pe.substring(ws,ve.index),Xe=Du($e,ve);ws=ve.index+Xe}Du(Pe.substring(ws))}return rn.finalize(),pl=rn.toHTML(),{language:ce,value:pl,relevance:Sa,illegal:!1,_emitter:rn,_top:Qe}}catch(ve){if(ve.message&&ve.message.includes("Illegal"))return{language:ce,value:ul(Pe),illegal:!0,relevance:0,_illegalBy:{message:ve.message,index:ws,context:Pe.slice(ws-100,ws+100),mode:ve.mode,resultSoFar:pl},_emitter:rn};if(Ut)return{language:ce,value:ul(Pe),illegal:!1,relevance:0,errorRaised:ve,_emitter:rn,_top:Qe};throw ve}}function dl(ce){const Pe={value:ul(ce),illegal:!1,relevance:0,_top:Ce,_emitter:new Ee.__emitter(Ee)};return Pe._emitter.addText(ce),Pe}function fl(ce,Pe){Pe=Pe||Ee.languages||Object.keys(Y);const it=dl(ce),kt=Pe.filter(Ur).filter(Mu).map(kn=>ki(kn,ce,!1));kt.unshift(it);const Qt=kt.sort((kn,er)=>{if(kn.relevance!==er.relevance)return er.relevance-kn.relevance;if(kn.language&&er.language){if(Ur(kn.language).supersetOf===er.language)return 1;if(Ur(er.language).supersetOf===kn.language)return-1}return 0}),[Vn,qr]=Qt,ya=Vn;return ya.secondBest=qr,ya}function m4(ce,Pe,it){const kt=Pe&&ge[Pe]||it;ce.classList.add("hljs"),ce.classList.add(`language-${kt}`)}function hl(ce){let Pe=null;const it=nn(ce);if(He(it))return;if(ba("before:highlightElement",{el:ce,language:it}),ce.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",ce);return}if(ce.children.length>0&&(Ee.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(ce)),Ee.throwUnescapedHTML))throw new h4("One of your code blocks includes unescaped HTML.",ce.innerHTML);Pe=ce;const kt=Pe.textContent,Qt=it?jt(kt,{language:it,ignoreIllegals:!0}):fl(kt);ce.innerHTML=Qt.value,ce.dataset.highlighted="yes",m4(ce,it,Qt.language),ce.result={language:Qt.language,re:Qt.relevance,relevance:Qt.relevance},Qt.secondBest&&(ce.secondBest={language:Qt.secondBest.language,relevance:Qt.secondBest.relevance}),ba("after:highlightElement",{el:ce,result:Qt,text:kt})}function g4(ce){Ee=Tu(Ee,ce)}const v4=()=>{va(),Xn("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function b4(){va(),Xn("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Cu=!1;function va(){function ce(){va()}if(document.readyState==="loading"){Cu||window.addEventListener("DOMContentLoaded",ce,!1),Cu=!0;return}document.querySelectorAll(Ee.cssSelector).forEach(hl)}function y4(ce,Pe){let it=null;try{it=Pe($)}catch(kt){if($n("Language definition for '{}' could not be registered.".replace("{}",ce)),Ut)$n(kt);else throw kt;it=Ce}it.name||(it.name=ce),Y[ce]=it,it.rawDefinition=Pe.bind(null,$),it.aliases&&Ou(it.aliases,{languageName:ce})}function w4(ce){delete Y[ce];for(const Pe of Object.keys(ge))ge[Pe]===ce&&delete ge[Pe]}function S4(){return Object.keys(Y)}function Ur(ce){return ce=(ce||"").toLowerCase(),Y[ce]||Y[ge[ce]]}function Ou(ce,{languageName:Pe}){typeof ce=="string"&&(ce=[ce]),ce.forEach(it=>{ge[it.toLowerCase()]=Pe})}function Mu(ce){const Pe=Ur(ce);return Pe&&!Pe.disableAutodetect}function x4(ce){ce["before:highlightBlock"]&&!ce["before:highlightElement"]&&(ce["before:highlightElement"]=Pe=>{ce["before:highlightBlock"](Object.assign({block:Pe.el},Pe))}),ce["after:highlightBlock"]&&!ce["after:highlightElement"]&&(ce["after:highlightElement"]=Pe=>{ce["after:highlightBlock"](Object.assign({block:Pe.el},Pe))})}function k4(ce){x4(ce),We.push(ce)}function _4(ce){const Pe=We.indexOf(ce);Pe!==-1&&We.splice(Pe,1)}function ba(ce,Pe){const it=ce;We.forEach(function(kt){kt[it]&&kt[it](Pe)})}function E4(ce){return Xn("10.7.0","highlightBlock will be removed entirely in v12.0"),Xn("10.7.0","Please use highlightElement now."),hl(ce)}Object.assign($,{highlight:jt,highlightAuto:fl,highlightAll:va,highlightElement:hl,highlightBlock:E4,configure:g4,initHighlighting:v4,initHighlightingOnLoad:b4,registerLanguage:y4,unregisterLanguage:w4,listLanguages:S4,getLanguage:Ur,registerAliases:Ou,autoDetection:Mu,inherit:Tu,addPlugin:k4,removePlugin:_4}),$.debugMode=function(){Ut=!1},$.safeMode=function(){Ut=!0},$.versionString=f4,$.regex={concat:b,lookahead:m,either:S,optional:y,anyNumberOfTimes:f};for(const ce in de)typeof de[ce]=="object"&&e(de[ce]);return Object.assign($,de),$},Us=Ru({});return Us.newInstance=()=>Ru({}),_l=Us,Us.HighlightJS=Us,Us.default=Us,_l}var I5=T5();const ho=A5(I5);function R5(e){const t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const s={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},i=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),a={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},o={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,s]};s.contains.push(o);const l={match:/\\"/},c={className:"string",begin:/'/,end:/'/},u={match:/\\'/},p={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},m=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],f=e.SHEBANG({binary:`(${m.join("|")})`,relevance:10}),y={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},b=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],x=["true","false"],S={match:/(\/[a-z._-]+)+/},N=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],z=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],I=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],E=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:b,literal:x,built_in:[...N,...z,"set","shopt",...I,...E]},contains:[f,e.SHEBANG(),y,p,i,a,S,o,l,c,u,n]}}function C5(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",s="[a-zA-Z_]\\w*::",a="(?!struct)("+r+"|"+t.optional(s)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",o={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.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:"."},e.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},p={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},e.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},m={className:"title",begin:t.optional(s)+e.IDENT_RE,relevance:0},f=t.optional(s)+e.IDENT_RE+"\\s*\\(",y=["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"],b=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],x=["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"],S=["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","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],I={type:b,keyword:y,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:x},E={className:"function.dispatch",relevance:0,keywords:{_hint:S},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},_=[E,p,o,n,e.C_BLOCK_COMMENT_MODE,u,c],L={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:I,contains:_.concat([{begin:/\(/,end:/\)/,keywords:I,contains:_.concat(["self"]),relevance:0}]),relevance:0},M={className:"function",begin:"("+a+"[\\*&\\s]+)+"+f,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:I,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:I,relevance:0},{begin:f,returnBegin:!0,contains:[m],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,u]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:I,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,c,u,o,{begin:/\(/,end:/\)/,keywords:I,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,c,u,o]}]},o,n,e.C_BLOCK_COMMENT_MODE,p]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:I,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(L,M,E,_,[p,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:I,contains:["self",o]},{begin:e.IDENT_RE+"::",keywords:I},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function O5(e){const t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],s=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],i=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],a={keyword:s.concat(i),built_in:t,literal:r},o=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),l={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},c={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},u={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},p=e.inherit(u,{illegal:/\n/}),m={className:"subst",begin:/\{/,end:/\}/,keywords:a},f=e.inherit(m,{illegal:/\n/}),y={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,f]},b={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},m]},x=e.inherit(b,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},f]});m.contains=[b,y,u,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,l,e.C_BLOCK_COMMENT_MODE],f.contains=[x,y,p,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,l,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const S={variants:[c,b,y,u,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},N={begin:"<",end:">",contains:[{beginKeywords:"in out"},o]},z=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",I={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:a,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},S,l,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},o,N,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[o,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[o,N,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+z+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:a,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,N],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,relevance:0,contains:[S,l,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},I]}}const M5=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.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:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.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_-]*/}}),N5=["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"],z5=["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"],$5=[...N5,...z5],D5=["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(),P5=["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(),B5=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),L5=["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-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function F5(e){const t=e.regex,n=M5(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},s="and or not only",i=/@-?\w[\w]*(-\w+)*/,a="[a-zA-Z-][a-zA-Z0-9_-]*",o=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+a,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+P5.join("|")+")"},{begin:":(:)?("+B5.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+L5.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...o,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...o,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:i},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:s,attribute:D5.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...o,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+$5.join("|")+")\\b"}]}}function U5(e){return{name:"Dockerfile",aliases:["docker"],case_insensitive:!0,keywords:["from","maintainer","expose","env","arg","user","onbuild","stopsignal"],contains:[e.HASH_COMMENT_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{beginKeywords:"run cmd entrypoint volume add copy workdir label healthcheck shell",starts:{end:/[^\\]$/,subLanguage:"bash"}}],illegal:"</"}}function q5(e){const i={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:i,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:i,illegal:/["']/}]}]}}var Zs="[0-9](_*[0-9])*",Ta=`\\.(${Zs})`,Ia="[0-9a-fA-F](_*[0-9a-fA-F])*",gd={className:"number",variants:[{begin:`(\\b(${Zs})((${Ta})|\\.)?|(${Ta}))[eE][+-]?(${Zs})[fFdD]?\\b`},{begin:`\\b(${Zs})((${Ta})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Ta})[fFdD]?\\b`},{begin:`\\b(${Zs})[fFdD]\\b`},{begin:`\\b0[xX]((${Ia})\\.?|(${Ia})?\\.(${Ia}))[pP][+-]?(${Zs})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Ia})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function qp(e,t,n){return n===-1?"":e.replace(t,r=>qp(e,t,n-1))}function H5(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+qp("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),l={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},c={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},u={className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:l,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[u,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:l,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[c,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,gd,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},gd,c]}}const vd="[A-Za-z$_][0-9A-Za-z$_]*",V5=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],j5=["true","false","null","undefined","NaN","Infinity"],Hp=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Vp=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],jp=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],G5=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Z5=[].concat(jp,Hp,Vp);function K5(e){const t=e.regex,n=(re,{after:ze})=>{const ie="</"+re[0].slice(1);return re.input.indexOf(ie,ze)!==-1},r=vd,s={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(re,ze)=>{const ie=re[0].length+re.index,je=re.input[ie];if(je==="<"||je===","){ze.ignoreMatch();return}je===">"&&(n(re,{after:ie})||ze.ignoreMatch());let rt;const ot=re.input.substring(ie);if(rt=ot.match(/^\s*=/)){ze.ignoreMatch();return}if((rt=ot.match(/^\s+extends\s+/))&&rt.index===0){ze.ignoreMatch();return}}},o={$pattern:vd,keyword:V5,literal:j5,built_in:Z5,"variable.language":G5},l="[0-9](_?[0-9])*",c=`\\.(${l})`,u="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${u})((${c})|\\.)?|(${c}))[eE][+-]?(${l})\\b`},{begin:`\\b(${u})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},m={className:"subst",begin:"\\$\\{",end:"\\}",keywords:o,contains:[]},f={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,m],subLanguage:"xml"}},y={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,m],subLanguage:"css"}},b={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,m],subLanguage:"graphql"}},x={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,m]},N={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},z=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,y,b,x,{match:/\$\d+/},p];m.contains=z.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(z)});const I=[].concat(N,m.contains),E=I.concat([{begin:/(\s*)\(/,end:/\)/,keywords:o,contains:["self"].concat(I)}]),_={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:E},L={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},M={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Hp,...Vp]}},G={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},P={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[_],illegal:/%/},W={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function q(re){return t.concat("(?!",re.join("|"),")")}const X={match:t.concat(/\b/,q([...jp,"super","import"].map(re=>`${re}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},ne={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},he={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},_]},Ae="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",se={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(Ae)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[_]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:E,CLASS_REFERENCE:M},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),G,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,y,b,x,N,{match:/\$\d+/},p,M,{scope:"attr",match:r+t.lookahead(":"),relevance:0},se,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[N,e.REGEXP_MODE,{className:"function",begin:Ae,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:E}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:i},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},P,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[_,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},ne,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[_]},X,W,L,he,{match:/\$[(.]/}]}}function W5(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],s={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,s,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var Ks="[0-9](_*[0-9])*",Ra=`\\.(${Ks})`,Ca="[0-9a-fA-F](_*[0-9a-fA-F])*",Q5={className:"number",variants:[{begin:`(\\b(${Ks})((${Ra})|\\.)?|(${Ra}))[eE][+-]?(${Ks})[fFdD]?\\b`},{begin:`\\b(${Ks})((${Ra})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Ra})[fFdD]?\\b`},{begin:`\\b(${Ks})[fFdD]\\b`},{begin:`\\b0[xX]((${Ca})\\.?|(${Ca})?\\.(${Ca}))[pP][+-]?(${Ks})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Ca})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function J5(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},r={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},s={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},i={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},a={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[i,s]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,i,s]}]};s.contains.push(a);const o={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},l={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(a,{className:"string"}),"self"]}]},c=Q5,u=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),p={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},m=p;return m.variants[1].contains=[p],p.variants[1].contains=[m],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,u,n,r,o,l,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[p,e.C_LINE_COMMENT_MODE,u],relevance:0},e.C_LINE_COMMENT_MODE,u,o,l,a,e.C_NUMBER_MODE]},u]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},o,l]},a,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
|
|
6
|
+
`},c]}}function Y5(e){const t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},s={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},i={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},a={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},o=/[A-Za-z][A-Za-z0-9+.-]*/,l={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,o,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},c={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},u={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},p=e.inherit(c,{contains:[]}),m=e.inherit(u,{contains:[]});c.contains.push(m),u.contains.push(p);let f=[n,l];return[c,u,p,m].forEach(S=>{S.contains=S.contains.concat(f)}),f=f.concat(c,u),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:f},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:f}]}]},n,i,c,u,{className:"quote",begin:"^>\\s+",contains:f,end:"$"},s,r,l,a,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function X5(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,r=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),s=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),i=t.concat(/[A-Z]+/,n),a={scope:"variable",match:"\\$+"+r},o={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},l={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},c=e.inherit(e.APOS_STRING_MODE,{illegal:null}),u=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(l)}),p={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(l),"on:begin":(ne,he)=>{he.data._beginMatch=ne[1]||ne[2]},"on:end":(ne,he)=>{he.data._beginMatch!==ne[1]&&he.ignoreMatch()}},m=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),f=`[
|
|
7
|
+
]`,y={scope:"string",variants:[u,c,p,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},x=["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"],N=["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"],I={keyword:S,literal:(ne=>{const he=[];return ne.forEach(Ae=>{he.push(Ae),Ae.toLowerCase()===Ae?he.push(Ae.toUpperCase()):he.push(Ae.toLowerCase())}),he})(x),built_in:N},E=ne=>ne.map(he=>he.replace(/\|\d+$/,"")),_={variants:[{match:[/new/,t.concat(f,"+"),t.concat("(?!",E(N).join("\\b|"),"\\b)"),s],scope:{1:"keyword",4:"title.class"}}]},L=t.concat(r,"\\b(?!\\()"),M={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),L],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[s,t.concat(/::/,t.lookahead(/(?!class\b)/)),L],scope:{1:"title.class",3:"variable.constant"}},{match:[s,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[s,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},G={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},P={relevance:0,begin:/\(/,end:/\)/,keywords:I,contains:[G,a,M,e.C_BLOCK_COMMENT_MODE,y,b,_]},W={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",E(S).join("\\b|"),"|",E(N).join("\\b|"),"\\b)"),r,t.concat(f,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[P]};P.contains.push(W);const q=[G,M,e.C_BLOCK_COMMENT_MODE,y,b,_],X={begin:t.concat(/#\[\s*\\?/,t.either(s,i)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:x,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:x,keyword:["new","array"]},contains:["self",...q]},...q,{scope:"meta",variants:[{match:s},{match:i}]}]};return{case_insensitive:!1,keywords:I,contains:[X,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}]}},o,{scope:"variable.language",match:/\$this\b/},a,W,M,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},_,{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:I,contains:["self",X,a,M,e.C_BLOCK_COMMENT_MODE,y,b]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},y,b]}}function e6(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],o={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},l={className:"meta",begin:/^(>>>|\.\.\.) /},c={className:"subst",begin:/\{/,end:/\}/,keywords:o,illegal:/#/},u={begin:/\{\{/,relevance:0},p={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l,u,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l,u,c]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,u,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,u,c]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},m="[0-9](_?[0-9])*",f=`(\\b(${m}))?\\.(${m})|\\b(${m})\\.`,y=`\\b|${r.join("|")}`,b={className:"number",relevance:0,variants:[{begin:`(\\b(${m})|(${f}))[eE][+-]?(${m})[jJ]?(?=${y})`},{begin:`(${f})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${y})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${y})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${y})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${y})`},{begin:`\\b(${m})[jJ](?=${y})`}]},x={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:o,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},S={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:["self",l,b,p,e.HASH_COMMENT_MODE]}]};return c.contains=[p,b,l],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:o,illegal:/(<\/|\?)|=>/,contains:[l,b,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},p,x,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[S]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[b,S,p]}]}}function t6(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),s=t.concat(r,/(::\w+)*/),a={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},o={className:"doctag",begin:"@[A-Za-z]+"},l={begin:"#<",end:">"},c=[e.COMMENT("#","$",{contains:[o]}),e.COMMENT("^=begin","^=end",{contains:[o],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],u={className:"subst",begin:/#\{/,end:/\}/,keywords:a},p={className:"string",contains:[e.BACKSLASH_ESCAPE,u],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,u]})]}]},m="[1-9](_?[0-9])*|0",f="[0-9](_?[0-9])*",y={className:"number",relevance:0,variants:[{begin:`\\b(${m})(\\.(${f}))?([eE][+-]?(${f})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},b={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:a}]},_=[p,{variants:[{match:[/class\s+/,s,/\s+<\s+/,s]},{match:[/\b(class|module)\s+/,s]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:a},{match:[/(include|extend)\s+/,s],scope:{2:"title.class"},keywords:a},{relevance:0,match:[s,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[b]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[p,{begin:n}],relevance:0},y,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:a},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,u],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(l,c),relevance:0}].concat(l,c);u.contains=_,b.contains=_;const P=[{begin:/^\s*=>/,starts:{end:"$",contains:_}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:a,contains:_}}];return c.unshift(l),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:a,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(P).concat(c).concat(_)}}function n6(e){const t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),s=t.concat(n,e.IDENT_RE),i={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,s,t.lookahead(/\s*\(/))},a="([ui](8|16|32|64|128|size)|f(32|64))?",o=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],l=["true","false","Some","None","Ok","Err"],c=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],u=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:u,keyword:o,literal:l,built_in:c},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+a},{begin:"\\b0o([0-7_]+)"+a},{begin:"\\b0x([A-Fa-f0-9_]+)"+a},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+a}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:c,type:u}},{className:"punctuation",begin:"->"},i]}}function r6(e){const t=e.regex,n=e.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},s={begin:/"/,end:/"/,contains:[{match:/""/}]},i=["true","false","unknown"],a=["double precision","large object","with timezone","without timezone"],o=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],l=["add","asc","collation","desc","final","first","last","view"],c=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],u=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],p=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],m=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],f=u,y=[...c,...l].filter(E=>!u.includes(E)),b={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},x={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},S={match:t.concat(/\b/,t.either(...f),/\s*\(/),relevance:0,keywords:{built_in:f}};function N(E){return t.concat(/\b/,t.either(...E.map(_=>_.replace(/\s+/,"\\s+"))),/\b/)}const z={scope:"keyword",match:N(m),relevance:0};function I(E,{exceptions:_,when:L}={}){const M=L;return _=_||[],E.map(G=>G.match(/\|\d+$/)||_.includes(G)?G:M(G)?`${G}|0`:G)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:I(y,{when:E=>E.length<3}),literal:i,type:o,built_in:p},contains:[{scope:"type",match:N(a)},z,S,b,r,s,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,x]}}function Gp(e){return e?typeof e=="string"?e:e.source:null}function Ti(e){return wt("(?=",e,")")}function wt(...e){return e.map(n=>Gp(n)).join("")}function s6(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function fn(...e){return"("+(s6(e).capture?"":"?:")+e.map(r=>Gp(r)).join("|")+")"}const x0=e=>wt(/\b/,e,/\w$/.test(e)?/\b/:/\B/),i6=["Protocol","Type"].map(x0),bd=["init","self"].map(x0),a6=["Any","Self"],El=["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"],yd=["false","nil","true"],o6=["assignment","associativity","higherThan","left","lowerThan","none","right"],l6=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],wd=["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"],Zp=fn(/[/=\-+!*%<>&|^~?]/,/[\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]/),Kp=fn(Zp,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Al=wt(Zp,Kp,"*"),Wp=fn(/[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]/),po=fn(Wp,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),rr=wt(Wp,po,"*"),Oa=wt(/[A-Z]/,po,"*"),c6=["attached","autoclosure",wt(/convention\(/,fn("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",wt(/objc\(/,rr,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],u6=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function d6(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,n],s={match:[/\./,fn(...i6,...bd)],className:{2:"keyword"}},i={match:wt(/\./,fn(...El)),relevance:0},a=El.filter(Ye=>typeof Ye=="string").concat(["_|0"]),o=El.filter(Ye=>typeof Ye!="string").concat(a6).map(x0),l={variants:[{className:"keyword",match:fn(...o,...bd)}]},c={$pattern:fn(/\b\w+/,/#\w+/),keyword:a.concat(l6),literal:yd},u=[s,i,l],p={match:wt(/\./,fn(...wd)),relevance:0},m={className:"built_in",match:wt(/\b/,fn(...wd),/(?=\()/)},f=[p,m],y={match:/->/,relevance:0},b={className:"operator",relevance:0,variants:[{match:Al},{match:`\\.(\\.|${Kp})+`}]},x=[y,b],S="([0-9]_*)+",N="([0-9a-fA-F]_*)+",z={className:"number",relevance:0,variants:[{match:`\\b(${S})(\\.(${S}))?([eE][+-]?(${S}))?\\b`},{match:`\\b0x(${N})(\\.(${N}))?([pP][+-]?(${S}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},I=(Ye="")=>({className:"subst",variants:[{match:wt(/\\/,Ye,/[0\\tnr"']/)},{match:wt(/\\/,Ye,/u\{[0-9a-fA-F]{1,8}\}/)}]}),E=(Ye="")=>({className:"subst",match:wt(/\\/,Ye,/[\t ]*(?:[\r\n]|\r\n)/)}),_=(Ye="")=>({className:"subst",label:"interpol",begin:wt(/\\/,Ye,/\(/),end:/\)/}),L=(Ye="")=>({begin:wt(Ye,/"""/),end:wt(/"""/,Ye),contains:[I(Ye),E(Ye),_(Ye)]}),M=(Ye="")=>({begin:wt(Ye,/"/),end:wt(/"/,Ye),contains:[I(Ye),_(Ye)]}),G={className:"string",variants:[L(),L("#"),L("##"),L("###"),M(),M("#"),M("##"),M("###")]},P=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],W={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:P},q=Ye=>{const Tt=wt(Ye,/\//),bn=wt(/\//,Ye);return{begin:Tt,end:bn,contains:[...P,{scope:"comment",begin:`#(?!.*${bn})`,end:/$/}]}},X={scope:"regexp",variants:[q("###"),q("##"),q("#"),W]},ne={match:wt(/`/,rr,/`/)},he={className:"variable",match:/\$\d+/},Ae={className:"variable",match:`\\$${po}+`},se=[ne,he,Ae],re={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:u6,contains:[...x,z,G]}]}},ze={scope:"keyword",match:wt(/@/,fn(...c6),Ti(fn(/\(/,/\s+/)))},ie={scope:"meta",match:wt(/@/,rr)},je=[re,ze,ie],rt={match:Ti(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:wt(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,po,"+")},{className:"type",match:Oa,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:wt(/\s+&\s+/,Ti(Oa)),relevance:0}]},ot={begin:/</,end:/>/,keywords:c,contains:[...r,...u,...je,y,rt]};rt.contains.push(ot);const Ft={match:wt(rr,/\s*:/),keywords:"_|0",relevance:0},st={begin:/\(/,end:/\)/,relevance:0,keywords:c,contains:["self",Ft,...r,X,...u,...f,...x,z,G,...se,...je,rt]},at={begin:/</,end:/>/,keywords:"repeat each",contains:[...r,rt]},C={begin:fn(Ti(wt(rr,/\s*:/)),Ti(wt(rr,/\s+/,rr,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:rr}]},le={begin:/\(/,end:/\)/,keywords:c,contains:[C,...r,...u,...x,z,G,...je,rt,st],endsParent:!0,illegal:/["']/},Q={match:[/(func|macro)/,/\s+/,fn(ne.match,rr,Al)],className:{1:"keyword",3:"title.function"},contains:[at,le,t],illegal:[/\[/,/%/]},de={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[at,le,t],illegal:/\[|%/},Ie={match:[/operator/,/\s+/,Al],className:{1:"keyword",3:"title"}},Ge={begin:[/precedencegroup/,/\s+/,Oa],className:{1:"keyword",3:"title"},contains:[rt],keywords:[...o6,...yd],end:/}/},Le={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Te={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},yt={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,rr,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:c,contains:[at,...u,{begin:/:/,end:/\{/,keywords:c,contains:[{scope:"title.class.inherited",match:Oa},...u],relevance:0}]};for(const Ye of G.variants){const Tt=Ye.contains.find(Yn=>Yn.label==="interpol");Tt.keywords=c;const bn=[...u,...f,...x,z,G,...se];Tt.contains=[...bn,{begin:/\(/,end:/\)/,contains:["self",...bn]}]}return{name:"Swift",keywords:c,contains:[...r,Q,de,Le,Te,yt,Ie,Ge,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},X,...u,...f,...x,z,G,...se,...je,rt,st]}}const mo="[A-Za-z$_][0-9A-Za-z$_]*",Qp=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],Jp=["true","false","null","undefined","NaN","Infinity"],Yp=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Xp=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],em=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],tm=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],nm=[].concat(em,Yp,Xp);function f6(e){const t=e.regex,n=(re,{after:ze})=>{const ie="</"+re[0].slice(1);return re.input.indexOf(ie,ze)!==-1},r=mo,s={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(re,ze)=>{const ie=re[0].length+re.index,je=re.input[ie];if(je==="<"||je===","){ze.ignoreMatch();return}je===">"&&(n(re,{after:ie})||ze.ignoreMatch());let rt;const ot=re.input.substring(ie);if(rt=ot.match(/^\s*=/)){ze.ignoreMatch();return}if((rt=ot.match(/^\s+extends\s+/))&&rt.index===0){ze.ignoreMatch();return}}},o={$pattern:mo,keyword:Qp,literal:Jp,built_in:nm,"variable.language":tm},l="[0-9](_?[0-9])*",c=`\\.(${l})`,u="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${u})((${c})|\\.)?|(${c}))[eE][+-]?(${l})\\b`},{begin:`\\b(${u})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},m={className:"subst",begin:"\\$\\{",end:"\\}",keywords:o,contains:[]},f={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,m],subLanguage:"xml"}},y={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,m],subLanguage:"css"}},b={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,m],subLanguage:"graphql"}},x={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,m]},N={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},z=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,y,b,x,{match:/\$\d+/},p];m.contains=z.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(z)});const I=[].concat(N,m.contains),E=I.concat([{begin:/(\s*)\(/,end:/\)/,keywords:o,contains:["self"].concat(I)}]),_={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:E},L={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},M={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Yp,...Xp]}},G={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},P={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[_],illegal:/%/},W={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function q(re){return t.concat("(?!",re.join("|"),")")}const X={match:t.concat(/\b/,q([...em,"super","import"].map(re=>`${re}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},ne={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},he={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},_]},Ae="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",se={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(Ae)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[_]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:E,CLASS_REFERENCE:M},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),G,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,y,b,x,N,{match:/\$\d+/},p,M,{scope:"attr",match:r+t.lookahead(":"),relevance:0},se,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[N,e.REGEXP_MODE,{className:"function",begin:Ae,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:E}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:i},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},P,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[_,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},ne,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[_]},X,W,L,he,{match:/\$[(.]/}]}}function h6(e){const t=e.regex,n=f6(e),r=mo,s=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],i={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},a={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:s},contains:[n.exports.CLASS_REFERENCE]},o={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},l=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],c={$pattern:mo,keyword:Qp.concat(l),literal:Jp,built_in:nm.concat(s),"variable.language":tm},u={className:"meta",begin:"@"+r},p=(b,x,S)=>{const N=b.contains.findIndex(z=>z.label===x);if(N===-1)throw new Error("can not find mode to replace");b.contains.splice(N,1,S)};Object.assign(n.keywords,c),n.exports.PARAMS_CONTAINS.push(u);const m=n.contains.find(b=>b.scope==="attr"),f=Object.assign({},m,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,m,f]),n.contains=n.contains.concat([u,i,a,f]),p(n,"shebang",e.SHEBANG()),p(n,"use_strict",o);const y=n.contains.find(b=>b.label==="func.def");return y.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function p6(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,s={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},i={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},a=e.inherit(i,{begin:/\(/,end:/\)/}),o=e.inherit(e.APOS_STRING_MODE,{className:"string"}),l=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),c={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[s]},{begin:/'/,end:/'/,contains:[s]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[i,l,o,a,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[i,a,l,o]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},s,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[l]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[c],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[c],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:c}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function m6(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},s={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},i={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},a={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,s]},o=e.inherit(a,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),m={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},f={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},y={begin:/\{/,end:/\}/,contains:[f],illegal:"\\n",relevance:0},b={begin:"\\[",end:"\\]",contains:[f],illegal:"\\n",relevance:0},x=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},m,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},y,b,i,a],S=[...x];return S.pop(),S.push(o),f.contains=S,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:x}}function k0(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Bs=k0();function rm(e){Bs=e}var qi={exec:()=>null};function vt(e,t=""){let n=typeof e=="string"?e:e.source;const r={replace:(s,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(mn.caret,"$1"),n=n.replace(s,a),r},getRegex:()=>new RegExp(n,t)};return r}var mn={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},g6=/^(?:[ \t]*(?:\n|$))+/,v6=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,b6=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,fa=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,y6=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,_0=/(?:[*+-]|\d{1,9}[.)])/,sm=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,im=vt(sm).replace(/bull/g,_0).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),w6=vt(sm).replace(/bull/g,_0).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),E0=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,S6=/^[^\n]+/,A0=/(?!\s*\])(?:\\.|[^\[\]\\])+/,x6=vt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",A0).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),k6=vt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,_0).getRegex(),Bo="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",T0=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,_6=vt("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",T0).replace("tag",Bo).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),am=vt(E0).replace("hr",fa).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Bo).getRegex(),E6=vt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",am).getRegex(),I0={blockquote:E6,code:v6,def:x6,fences:b6,heading:y6,hr:fa,html:_6,lheading:im,list:k6,newline:g6,paragraph:am,table:qi,text:S6},Sd=vt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",fa).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Bo).getRegex(),A6={...I0,lheading:w6,table:Sd,paragraph:vt(E0).replace("hr",fa).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Sd).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Bo).getRegex()},T6={...I0,html:vt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",T0).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:qi,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:vt(E0).replace("hr",fa).replace("heading",` *#{1,6} *[^
|
|
8
|
+
]`).replace("lheading",im).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},I6=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,R6=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,om=/^( {2,}|\\)\n(?!\s*$)/,C6=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Lo=/[\p{P}\p{S}]/u,R0=/[\s\p{P}\p{S}]/u,lm=/[^\s\p{P}\p{S}]/u,O6=vt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,R0).getRegex(),cm=/(?!~)[\p{P}\p{S}]/u,M6=/(?!~)[\s\p{P}\p{S}]/u,N6=/(?:[^\s\p{P}\p{S}]|~)/u,z6=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,um=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,$6=vt(um,"u").replace(/punct/g,Lo).getRegex(),D6=vt(um,"u").replace(/punct/g,cm).getRegex(),dm="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",P6=vt(dm,"gu").replace(/notPunctSpace/g,lm).replace(/punctSpace/g,R0).replace(/punct/g,Lo).getRegex(),B6=vt(dm,"gu").replace(/notPunctSpace/g,N6).replace(/punctSpace/g,M6).replace(/punct/g,cm).getRegex(),L6=vt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,lm).replace(/punctSpace/g,R0).replace(/punct/g,Lo).getRegex(),F6=vt(/\\(punct)/,"gu").replace(/punct/g,Lo).getRegex(),U6=vt(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),q6=vt(T0).replace("(?:-->|$)","-->").getRegex(),H6=vt("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",q6).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),go=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,V6=vt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",go).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),fm=vt(/^!?\[(label)\]\[(ref)\]/).replace("label",go).replace("ref",A0).getRegex(),hm=vt(/^!?\[(ref)\](?:\[\])?/).replace("ref",A0).getRegex(),j6=vt("reflink|nolink(?!\\()","g").replace("reflink",fm).replace("nolink",hm).getRegex(),C0={_backpedal:qi,anyPunctuation:F6,autolink:U6,blockSkip:z6,br:om,code:R6,del:qi,emStrongLDelim:$6,emStrongRDelimAst:P6,emStrongRDelimUnd:L6,escape:I6,link:V6,nolink:hm,punctuation:O6,reflink:fm,reflinkSearch:j6,tag:H6,text:C6,url:qi},G6={...C0,link:vt(/^!?\[(label)\]\((.*?)\)/).replace("label",go).getRegex(),reflink:vt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",go).getRegex()},bc={...C0,emStrongRDelimAst:B6,emStrongLDelim:D6,url:vt(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Z6={...bc,br:vt(om).replace("{2,}","*").getRegex(),text:vt(bc.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ma={normal:I0,gfm:A6,pedantic:T6},Ii={normal:C0,gfm:bc,breaks:Z6,pedantic:G6},K6={"&":"&","<":"<",">":">",'"':""","'":"'"},xd=e=>K6[e];function sr(e,t){if(t){if(mn.escapeTest.test(e))return e.replace(mn.escapeReplace,xd)}else if(mn.escapeTestNoEncode.test(e))return e.replace(mn.escapeReplaceNoEncode,xd);return e}function kd(e){try{e=encodeURI(e).replace(mn.percentDecode,"%")}catch{return null}return e}function _d(e,t){const n=e.replace(mn.findPipe,(i,a,o)=>{let l=!1,c=a;for(;--c>=0&&o[c]==="\\";)l=!l;return l?"|":" |"}),r=n.split(mn.splitPipe);let s=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;s<r.length;s++)r[s]=r[s].trim().replace(mn.slashPipe,"|");return r}function Ri(e,t,n){const r=e.length;if(r===0)return"";let s=0;for(;s<r&&e.charAt(r-s-1)===t;)s++;return e.slice(0,r-s)}function W6(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function Ed(e,t,n,r,s){const i=t.href,a=t.title||null,o=e[1].replace(s.other.outputLinkReplace,"$1");r.state.inLink=!0;const l={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:i,title:a,text:o,tokens:r.inlineTokens(o)};return r.state.inLink=!1,l}function Q6(e,t,n){const r=e.match(n.other.indentCodeCompensation);if(r===null)return t;const s=r[1];return t.split(`
|
|
9
9
|
`).map(i=>{const a=i.match(n.other.beginningSpace);if(a===null)return i;const[o]=a;return o.length>=s.length?i.slice(s.length):i}).join(`
|
|
10
10
|
`)}var vo=class{options;rules;lexer;constructor(e){this.options=e||Bs}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Ri(n,`
|
|
11
|
-
`)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const n=t[0],r=
|
|
11
|
+
`)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const n=t[0],r=Q6(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){const r=Ri(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Ri(t[0],`
|
|
12
12
|
`)}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let n=Ri(t[0],`
|
|
13
13
|
`).split(`
|
|
14
14
|
`),r="",s="";const i=[];for(;n.length>0;){let a=!1;const o=[];let l;for(l=0;l<n.length;l++)if(this.rules.other.blockquoteStart.test(n[l]))o.push(n[l]),a=!0;else if(!a)o.push(n[l]);else break;n=n.slice(l);const c=o.join(`
|
|
15
15
|
`),u=c.replace(this.rules.other.blockquoteSetextReplace,`
|
|
16
16
|
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
|
|
17
17
|
${c}`:c,s=s?`${s}
|
|
18
|
-
${u}`:u;const
|
|
18
|
+
${u}`:u;const p=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(u,i,!0),this.lexer.state.top=p,n.length===0)break;const m=i.at(-1);if(m?.type==="code")break;if(m?.type==="blockquote"){const f=m,y=f.raw+`
|
|
19
19
|
`+n.join(`
|
|
20
|
-
`),b=this.blockquote(y);i[i.length-1]=b,r=r.substring(0,r.length-
|
|
20
|
+
`),b=this.blockquote(y);i[i.length-1]=b,r=r.substring(0,r.length-f.raw.length)+b.raw,s=s.substring(0,s.length-f.text.length)+b.text;break}else if(m?.type==="list"){const f=m,y=f.raw+`
|
|
21
21
|
`+n.join(`
|
|
22
|
-
`),b=this.list(y);i[i.length-1]=b,r=r.substring(0,r.length-m.raw.length)+b.raw,s=s.substring(0,s.length-
|
|
23
|
-
`);continue}}return{type:"blockquote",raw:r,tokens:i,text:s}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const r=n.length>1,s={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");const i=this.rules.other.listItemRegex(n);let a=!1;for(;e;){let l=!1,c="",u="";if(!(t=i.exec(e))||this.rules.block.hr.test(e))break;c=t[0],e=e.substring(c.length);let
|
|
24
|
-
`,1)[0].replace(this.rules.other.listReplaceTabs,
|
|
25
|
-
`,1)[0],
|
|
26
|
-
`,e=e.substring(m.length+1),l=!0),!l){const
|
|
27
|
-
`,1)[0];let L;if(m=_,this.options.pedantic?(m=m.replace(this.rules.other.listReplaceNesting," "),L=m):L=m.replace(this.rules.other.tabCharGlobal," "),z.test(m)||I.test(m)||E.test(m)||
|
|
28
|
-
`+L.slice(y);else{if(
|
|
29
|
-
`+m}!
|
|
30
|
-
`,e=e.substring(_.length+1),
|
|
31
|
-
`):[],i={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const a of r)this.rules.other.tableAlignRight.test(a)?i.align.push("right"):this.rules.other.tableAlignCenter.test(a)?i.align.push("center"):this.rules.other.tableAlignLeft.test(a)?i.align.push("left"):i.align.push(null);for(let a=0;a<n.length;a++)i.header.push({text:n[a],tokens:this.lexer.inline(n[a]),header:!0,align:i.align[a]});for(const a of s)i.rows.push(
|
|
32
|
-
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;const i=Ri(n.slice(0,-1),"\\");if((n.length-i.length)%2===0)return}else{const i=
|
|
22
|
+
`),b=this.list(y);i[i.length-1]=b,r=r.substring(0,r.length-m.raw.length)+b.raw,s=s.substring(0,s.length-f.raw.length)+b.raw,n=y.substring(i.at(-1).raw.length).split(`
|
|
23
|
+
`);continue}}return{type:"blockquote",raw:r,tokens:i,text:s}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const r=n.length>1,s={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");const i=this.rules.other.listItemRegex(n);let a=!1;for(;e;){let l=!1,c="",u="";if(!(t=i.exec(e))||this.rules.block.hr.test(e))break;c=t[0],e=e.substring(c.length);let p=t[2].split(`
|
|
24
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,S=>" ".repeat(3*S.length)),m=e.split(`
|
|
25
|
+
`,1)[0],f=!p.trim(),y=0;if(this.options.pedantic?(y=2,u=p.trimStart()):f?y=t[1].length+1:(y=t[2].search(this.rules.other.nonSpaceChar),y=y>4?1:y,u=p.slice(y),y+=t[1].length),f&&this.rules.other.blankLine.test(m)&&(c+=m+`
|
|
26
|
+
`,e=e.substring(m.length+1),l=!0),!l){const S=this.rules.other.nextBulletRegex(y),N=this.rules.other.hrRegex(y),z=this.rules.other.fencesBeginRegex(y),I=this.rules.other.headingBeginRegex(y),E=this.rules.other.htmlBeginRegex(y);for(;e;){const _=e.split(`
|
|
27
|
+
`,1)[0];let L;if(m=_,this.options.pedantic?(m=m.replace(this.rules.other.listReplaceNesting," "),L=m):L=m.replace(this.rules.other.tabCharGlobal," "),z.test(m)||I.test(m)||E.test(m)||S.test(m)||N.test(m))break;if(L.search(this.rules.other.nonSpaceChar)>=y||!m.trim())u+=`
|
|
28
|
+
`+L.slice(y);else{if(f||p.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||z.test(p)||I.test(p)||N.test(p))break;u+=`
|
|
29
|
+
`+m}!f&&!m.trim()&&(f=!0),c+=_+`
|
|
30
|
+
`,e=e.substring(_.length+1),p=L.slice(y)}}s.loose||(a?s.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(a=!0));let b=null,x;this.options.gfm&&(b=this.rules.other.listIsTask.exec(u),b&&(x=b[0]!=="[ ] ",u=u.replace(this.rules.other.listReplaceTask,""))),s.items.push({type:"list_item",raw:c,task:!!b,checked:x,loose:!1,text:u,tokens:[]}),s.raw+=c}const o=s.items.at(-1);if(o)o.raw=o.raw.trimEnd(),o.text=o.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let l=0;l<s.items.length;l++)if(this.lexer.state.top=!1,s.items[l].tokens=this.lexer.blockTokens(s.items[l].text,[]),!s.loose){const c=s.items[l].tokens.filter(p=>p.type==="space"),u=c.length>0&&c.some(p=>this.rules.other.anyLine.test(p.raw));s.loose=u}if(s.loose)for(let l=0;l<s.items.length;l++)s.items[l].loose=!0;return s}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:r,title:s}}}table(e){const t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;const n=_d(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
31
|
+
`):[],i={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const a of r)this.rules.other.tableAlignRight.test(a)?i.align.push("right"):this.rules.other.tableAlignCenter.test(a)?i.align.push("center"):this.rules.other.tableAlignLeft.test(a)?i.align.push("left"):i.align.push(null);for(let a=0;a<n.length;a++)i.header.push({text:n[a],tokens:this.lexer.inline(n[a]),header:!0,align:i.align[a]});for(const a of s)i.rows.push(_d(a,i.header.length).map((o,l)=>({text:o,tokens:this.lexer.inline(o),header:!1,align:i.align[l]})));return i}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const n=t[1].charAt(t[1].length-1)===`
|
|
32
|
+
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;const i=Ri(n.slice(0,-1),"\\");if((n.length-i.length)%2===0)return}else{const i=W6(t[2],"()");if(i===-2)return;if(i>-1){const o=(t[0].indexOf("!")===0?5:4)+t[1].length+i;t[2]=t[2].substring(0,i),t[0]=t[0].substring(0,o).trim(),t[3]=""}}let r=t[2],s="";if(this.options.pedantic){const i=this.rules.other.pedanticHrefTitle.exec(r);i&&(r=i[1],s=i[3])}else s=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),Ed(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=t[r.toLowerCase()];if(!s){const i=n[0].charAt(0);return{type:"text",raw:i,text:i}}return Ed(n,s,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const i=[...r[0]].length-1;let a,o,l=i,c=0;const u=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,t=t.slice(-1*e.length+i);(r=u.exec(t))!=null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){l+=o;continue}else if((r[5]||r[6])&&i%3&&!((i+o)%3)){c+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l+c);const p=[...r[0]][0].length,m=e.slice(0,i+r.index+p+o);if(Math.min(i,o)%2){const y=m.slice(1,-1);return{type:"em",raw:m,text:y,tokens:this.lexer.inlineTokens(y)}}const f=m.slice(2,-2);return{type:"strong",raw:m,text:f,tokens:this.lexer.inlineTokens(f)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," ");const r=this.rules.other.nonSpaceChar.test(n),s=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&s&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let n,r;return t[2]==="@"?(n=t[1],r="mailto:"+n):(n=t[1],r=n),{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let n,r;if(t[2]==="@")n=t[0],r="mailto:"+n;else{let s;do s=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(s!==t[0]);n=t[0],t[1]==="www."?r="http://"+t[0]:r=t[0]}return{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){const n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}},_r=class yc{tokens;options;state;tokenizer;inlineQueue;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Bs,this.options.tokenizer=this.options.tokenizer||new vo,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const n={other:mn,block:Ma.normal,inline:Ii.normal};this.options.pedantic?(n.block=Ma.pedantic,n.inline=Ii.pedantic):this.options.gfm&&(n.block=Ma.gfm,this.options.breaks?n.inline=Ii.breaks:n.inline=Ii.gfm),this.tokenizer.rules=n}static get rules(){return{block:Ma,inline:Ii}}static lex(t,n){return new yc(n).lex(t)}static lexInline(t,n){return new yc(n).inlineTokens(t)}lex(t){t=t.replace(mn.carriageReturn,`
|
|
33
33
|
`),this.blockTokens(t,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){const r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,n=[],r=!1){for(this.options.pedantic&&(t=t.replace(mn.tabCharGlobal," ").replace(mn.spaceLine,""));t;){let s;if(this.options.extensions?.block?.some(a=>(s=a.call({lexer:this},t,n))?(t=t.substring(s.raw.length),n.push(s),!0):!1))continue;if(s=this.tokenizer.space(t)){t=t.substring(s.raw.length);const a=n.at(-1);s.raw.length===1&&a!==void 0?a.raw+=`
|
|
34
34
|
`:n.push(s);continue}if(s=this.tokenizer.code(t)){t=t.substring(s.raw.length);const a=n.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=`
|
|
35
35
|
`+s.raw,a.text+=`
|
|
@@ -39,7 +39,7 @@ ${u}`:u;const f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.block
|
|
|
39
39
|
`+s.raw,a.text+=`
|
|
40
40
|
`+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(s),r=i.length!==t.length,t=t.substring(s.raw.length);continue}if(s=this.tokenizer.text(t)){t=t.substring(s.raw.length);const a=n.at(-1);a?.type==="text"?(a.raw+=`
|
|
41
41
|
`+s.raw,a.text+=`
|
|
42
|
-
`+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(s);continue}if(t){const a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){let r=t,s=null;if(this.tokens.links){const o=Object.keys(this.tokens.links);if(o.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)o.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,s.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(s=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let i=!1,a="";for(;t;){i||(a=""),i=!1;let o;if(this.options.extensions?.inline?.some(c=>(o=c.call({lexer:this},t,n))?(t=t.substring(o.raw.length),n.push(o),!0):!1))continue;if(o=this.tokenizer.escape(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.tag(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.link(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(o.raw.length);const c=n.at(-1);o.type==="text"&&c?.type==="text"?(c.raw+=o.raw,c.text+=o.text):n.push(o);continue}if(o=this.tokenizer.emStrong(t,r,a)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.codespan(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.br(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.del(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.autolink(t)){t=t.substring(o.raw.length),n.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(t))){t=t.substring(o.raw.length),n.push(o);continue}let l=t;if(this.options.extensions?.startInline){let c=1/0;const u=t.slice(1);let
|
|
42
|
+
`+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(s);continue}if(t){const a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){let r=t,s=null;if(this.tokens.links){const o=Object.keys(this.tokens.links);if(o.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)o.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,s.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(s=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let i=!1,a="";for(;t;){i||(a=""),i=!1;let o;if(this.options.extensions?.inline?.some(c=>(o=c.call({lexer:this},t,n))?(t=t.substring(o.raw.length),n.push(o),!0):!1))continue;if(o=this.tokenizer.escape(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.tag(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.link(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(o.raw.length);const c=n.at(-1);o.type==="text"&&c?.type==="text"?(c.raw+=o.raw,c.text+=o.text):n.push(o);continue}if(o=this.tokenizer.emStrong(t,r,a)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.codespan(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.br(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.del(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.autolink(t)){t=t.substring(o.raw.length),n.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(t))){t=t.substring(o.raw.length),n.push(o);continue}let l=t;if(this.options.extensions?.startInline){let c=1/0;const u=t.slice(1);let p;this.options.extensions.startInline.forEach(m=>{p=m.call({lexer:this},u),typeof p=="number"&&p>=0&&(c=Math.min(c,p))}),c<1/0&&c>=0&&(l=t.substring(0,c+1))}if(o=this.tokenizer.inlineText(l)){t=t.substring(o.raw.length),o.raw.slice(-1)!=="_"&&(a=o.raw.slice(-1)),i=!0;const c=n.at(-1);c?.type==="text"?(c.raw+=o.raw,c.text+=o.text):n.push(o);continue}if(t){const c="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return n}},Ir=class{options;parser;constructor(e){this.options=e||Bs}space(e){return""}code({text:e,lang:t,escaped:n}){const r=(t||"").match(mn.notSpaceStart)?.[0],s=e.replace(mn.endingNewline,"")+`
|
|
43
43
|
`;return r?'<pre><code class="language-'+sr(r)+'">'+(n?s:sr(s,!0))+`</code></pre>
|
|
44
44
|
`:"<pre><code>"+(n?s:sr(s,!0))+`</code></pre>
|
|
45
45
|
`}blockquote({tokens:e}){return`<blockquote>
|
|
@@ -57,9 +57,9 @@ ${this.parser.parse(e)}</blockquote>
|
|
|
57
57
|
`}tablerow({text:e}){return`<tr>
|
|
58
58
|
${e}</tr>
|
|
59
59
|
`}tablecell(e){const t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
60
|
-
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${sr(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){const r=this.parser.parseInline(n),s=
|
|
61
|
-
`+this.renderer.text(o);n?r+=this.renderer.paragraph({type:"paragraph",raw:l,text:l,tokens:[{type:"text",raw:l,text:l,escaped:!0}]}):r+=l;continue}default:{const o='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return r}parseInline(t,n=this.renderer){let r="";for(let s=0;s<t.length;s++){const i=t[s];if(this.options.extensions?.renderers?.[i.type]){const o=this.options.extensions.renderers[i.type].call({parser:this},i);if(o!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){r+=o||"";continue}}const a=i;switch(a.type){case"escape":{r+=n.text(a);break}case"html":{r+=n.html(a);break}case"link":{r+=n.link(a);break}case"image":{r+=n.image(a);break}case"strong":{r+=n.strong(a);break}case"em":{r+=n.em(a);break}case"codespan":{r+=n.codespan(a);break}case"br":{r+=n.br(a);break}case"del":{r+=n.del(a);break}case"text":{r+=n.text(a);break}default:{const o='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return r}},Xa=class{options;block;constructor(e){this.options=e||Bs}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?_r.lex:_r.lexInline}provideParser(){return this.block?Er.parse:Er.parseInline}},
|
|
62
|
-
Please report this to https://github.com/markedjs/marked.`,e){const r="<p>An error occurred:</p><pre>"+sr(n.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}},Ns=new
|
|
60
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${sr(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){const r=this.parser.parseInline(n),s=kd(e);if(s===null)return r;e=s;let i='<a href="'+e+'"';return t&&(i+=' title="'+sr(t)+'"'),i+=">"+r+"</a>",i}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));const s=kd(e);if(s===null)return sr(n);e=s;let i=`<img src="${e}" alt="${n}"`;return t&&(i+=` title="${sr(t)}"`),i+=">",i}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:sr(e.text)}},O0=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},Er=class wc{options;renderer;textRenderer;constructor(t){this.options=t||Bs,this.options.renderer=this.options.renderer||new Ir,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new O0}static parse(t,n){return new wc(n).parse(t)}static parseInline(t,n){return new wc(n).parseInline(t)}parse(t,n=!0){let r="";for(let s=0;s<t.length;s++){const i=t[s];if(this.options.extensions?.renderers?.[i.type]){const o=i,l=this.options.extensions.renderers[o.type].call({parser:this},o);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(o.type)){r+=l||"";continue}}const a=i;switch(a.type){case"space":{r+=this.renderer.space(a);continue}case"hr":{r+=this.renderer.hr(a);continue}case"heading":{r+=this.renderer.heading(a);continue}case"code":{r+=this.renderer.code(a);continue}case"table":{r+=this.renderer.table(a);continue}case"blockquote":{r+=this.renderer.blockquote(a);continue}case"list":{r+=this.renderer.list(a);continue}case"html":{r+=this.renderer.html(a);continue}case"paragraph":{r+=this.renderer.paragraph(a);continue}case"text":{let o=a,l=this.renderer.text(o);for(;s+1<t.length&&t[s+1].type==="text";)o=t[++s],l+=`
|
|
61
|
+
`+this.renderer.text(o);n?r+=this.renderer.paragraph({type:"paragraph",raw:l,text:l,tokens:[{type:"text",raw:l,text:l,escaped:!0}]}):r+=l;continue}default:{const o='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return r}parseInline(t,n=this.renderer){let r="";for(let s=0;s<t.length;s++){const i=t[s];if(this.options.extensions?.renderers?.[i.type]){const o=this.options.extensions.renderers[i.type].call({parser:this},i);if(o!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){r+=o||"";continue}}const a=i;switch(a.type){case"escape":{r+=n.text(a);break}case"html":{r+=n.html(a);break}case"link":{r+=n.link(a);break}case"image":{r+=n.image(a);break}case"strong":{r+=n.strong(a);break}case"em":{r+=n.em(a);break}case"codespan":{r+=n.codespan(a);break}case"br":{r+=n.br(a);break}case"del":{r+=n.del(a);break}case"text":{r+=n.text(a);break}default:{const o='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return r}},Xa=class{options;block;constructor(e){this.options=e||Bs}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?_r.lex:_r.lexInline}provideParser(){return this.block?Er.parse:Er.parseInline}},J6=class{defaults=k0();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Er;Renderer=Ir;TextRenderer=O0;Lexer=_r;Tokenizer=vo;Hooks=Xa;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(const r of e)switch(n=n.concat(t.call(this,r)),r.type){case"table":{const s=r;for(const i of s.header)n=n.concat(this.walkTokens(i.tokens,t));for(const i of s.rows)for(const a of i)n=n.concat(this.walkTokens(a.tokens,t));break}case"list":{const s=r;n=n.concat(this.walkTokens(s.items,t));break}default:{const s=r;this.defaults.extensions?.childTokens?.[s.type]?this.defaults.extensions.childTokens[s.type].forEach(i=>{const a=s[i].flat(1/0);n=n.concat(this.walkTokens(a,t))}):s.tokens&&(n=n.concat(this.walkTokens(s.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{const r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){const i=t.renderers[s.name];i?t.renderers[s.name]=function(...a){let o=s.renderer.apply(this,a);return o===!1&&(o=i.apply(this,a)),o}:t.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const i=t[s.level];i?i.unshift(s.tokenizer):t[s.level]=[s.tokenizer],s.start&&(s.level==="block"?t.startBlock?t.startBlock.push(s.start):t.startBlock=[s.start]:s.level==="inline"&&(t.startInline?t.startInline.push(s.start):t.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(t.childTokens[s.name]=s.childTokens)}),r.extensions=t),n.renderer){const s=this.defaults.renderer||new Ir(this.defaults);for(const i in n.renderer){if(!(i in s))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;const a=i,o=n.renderer[a],l=s[a];s[a]=(...c)=>{let u=o.apply(s,c);return u===!1&&(u=l.apply(s,c)),u||""}}r.renderer=s}if(n.tokenizer){const s=this.defaults.tokenizer||new vo(this.defaults);for(const i in n.tokenizer){if(!(i in s))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;const a=i,o=n.tokenizer[a],l=s[a];s[a]=(...c)=>{let u=o.apply(s,c);return u===!1&&(u=l.apply(s,c)),u}}r.tokenizer=s}if(n.hooks){const s=this.defaults.hooks||new Xa;for(const i in n.hooks){if(!(i in s))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;const a=i,o=n.hooks[a],l=s[a];Xa.passThroughHooks.has(i)?s[a]=c=>{if(this.defaults.async)return Promise.resolve(o.call(s,c)).then(p=>l.call(s,p));const u=o.call(s,c);return l.call(s,u)}:s[a]=(...c)=>{let u=o.apply(s,c);return u===!1&&(u=l.apply(s,c)),u}}r.hooks=s}if(n.walkTokens){const s=this.defaults.walkTokens,i=n.walkTokens;r.walkTokens=function(a){let o=[];return o.push(i.call(this,a)),s&&(o=o.concat(s.call(this,a))),o}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return _r.lex(e,t??this.defaults)}parser(e,t){return Er.parse(e,t??this.defaults)}parseMarkdown(e){return(n,r)=>{const s={...r},i={...this.defaults,...s},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&s.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));i.hooks&&(i.hooks.options=i,i.hooks.block=e);const o=i.hooks?i.hooks.provideLexer():e?_r.lex:_r.lexInline,l=i.hooks?i.hooks.provideParser():e?Er.parse:Er.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(n):n).then(c=>o(c,i)).then(c=>i.hooks?i.hooks.processAllTokens(c):c).then(c=>i.walkTokens?Promise.all(this.walkTokens(c,i.walkTokens)).then(()=>c):c).then(c=>l(c,i)).then(c=>i.hooks?i.hooks.postprocess(c):c).catch(a);try{i.hooks&&(n=i.hooks.preprocess(n));let c=o(n,i);i.hooks&&(c=i.hooks.processAllTokens(c)),i.walkTokens&&this.walkTokens(c,i.walkTokens);let u=l(c,i);return i.hooks&&(u=i.hooks.postprocess(u)),u}catch(c){return a(c)}}}onError(e,t){return n=>{if(n.message+=`
|
|
62
|
+
Please report this to https://github.com/markedjs/marked.`,e){const r="<p>An error occurred:</p><pre>"+sr(n.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}},Ns=new J6;function ct(e,t){return Ns.parse(e,t)}ct.options=ct.setOptions=function(e){return Ns.setOptions(e),ct.defaults=Ns.defaults,rm(ct.defaults),ct};ct.getDefaults=k0;ct.defaults=Bs;ct.use=function(...e){return Ns.use(...e),ct.defaults=Ns.defaults,rm(ct.defaults),ct};ct.walkTokens=function(e,t){return Ns.walkTokens(e,t)};ct.parseInline=Ns.parseInline;ct.Parser=Er;ct.parser=Er.parse;ct.Renderer=Ir;ct.TextRenderer=O0;ct.Lexer=_r;ct.lexer=_r.lex;ct.Tokenizer=vo;ct.Hooks=Xa;ct.parse=ct;ct.options;ct.setOptions;ct.use;ct.walkTokens;ct.parseInline;Er.parse;_r.lex;class ae extends Error{constructor(t,n){var r="KaTeX parse error: "+t,s,i,a=n&&n.loc;if(a&&a.start<=a.end){var o=a.lexer.input;s=a.start,i=a.end,s===o.length?r+=" at end of input: ":r+=" at position "+(s+1)+": ";var l=o.slice(s,i).replace(/[^]/g,"$&̲"),c;s>15?c="…"+o.slice(s-15,s):c=o.slice(0,s);var u;i+15<o.length?u=o.slice(i,i+15)+"…":u=o.slice(i),r+=c+l+u}super(r),this.name="ParseError",this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,ae.prototype),this.position=s,s!=null&&i!=null&&(this.length=i-s),this.rawMessage=t}}var Y6=/([A-Z])/g,X6=e=>e.replace(Y6,"-$1").toLowerCase(),e7={"&":"&",">":">","<":"<",'"':""","'":"'"},t7=/[&><"']/g,ln=e=>String(e).replace(t7,t=>e7[t]),eo=e=>e.type==="ordgroup"||e.type==="color"?e.body.length===1?eo(e.body[0]):e:e.type==="font"?eo(e.body):e,n7=new Set(["mathord","textord","atom"]),zr=e=>n7.has(eo(e).type),r7=e=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return t?t[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():"_relative"},Sc={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand <n>",cliProcessor:e=>e==="Infinity"?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function s7(e){if(typeof e!="string")return e.enum[0];switch(e){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}function i7(e){if(e.default!==void 0)return e.default;var t=Array.isArray(e.type)?e.type[0]:e.type;return s7(t)}function a7(e,t,n,r){var s=n[t];e[t]=s!==void 0?r.processor?r.processor(s):s:i7(r)}class M0{constructor(t){t===void 0&&(t={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,t=t||{};for(var n of Object.keys(Sc)){var r=Sc[n];r&&a7(this,n,t,r)}}reportNonstrict(t,n,r){var s=this.strict;if(typeof s=="function"&&(s=s(t,n,r)),!(!s||s==="ignore")){if(s===!0||s==="error")throw new ae("LaTeX-incompatible input and strict mode is set to 'error': "+(n+" ["+t+"]"),r);s==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+t+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+s+"': "+n+" ["+t+"]"))}}useStrictBehavior(t,n,r){var s=this.strict;if(typeof s=="function")try{s=s(t,n,r)}catch{s="error"}return!s||s==="ignore"?!1:s===!0||s==="error"?!0:s==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+t+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+s+"': "+n+" ["+t+"]")),!1)}isTrusted(t){if("url"in t&&t.url&&!t.protocol){var n=r7(t.url);if(n==null)return!1;t.protocol=n}var r=typeof this.trust=="function"?this.trust(t):this.trust;return!!r}}class Vr{constructor(t,n,r){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=t,this.size=n,this.cramped=r}sup(){return ir[o7[this.id]]}sub(){return ir[l7[this.id]]}fracNum(){return ir[c7[this.id]]}fracDen(){return ir[u7[this.id]]}cramp(){return ir[d7[this.id]]}text(){return ir[f7[this.id]]}isTight(){return this.size>=2}}var N0=0,bo=1,Xs=2,Rr=3,ea=4,Ln=5,ni=6,gn=7,ir=[new Vr(N0,0,!1),new Vr(bo,0,!0),new Vr(Xs,1,!1),new Vr(Rr,1,!0),new Vr(ea,2,!1),new Vr(Ln,2,!0),new Vr(ni,3,!1),new Vr(gn,3,!0)],o7=[ea,Ln,ea,Ln,ni,gn,ni,gn],l7=[Ln,Ln,Ln,Ln,gn,gn,gn,gn],c7=[Xs,Rr,ea,Ln,ni,gn,ni,gn],u7=[Rr,Rr,Ln,Ln,gn,gn,gn,gn],d7=[bo,bo,Rr,Rr,Ln,Ln,gn,gn],f7=[N0,bo,Xs,Rr,Xs,Rr,Xs,Rr],Ze={DISPLAY:ir[N0],TEXT:ir[Xs],SCRIPT:ir[ea],SCRIPTSCRIPT:ir[ni]},xc=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function h7(e){for(var t=0;t<xc.length;t++)for(var n=xc[t],r=0;r<n.blocks.length;r++){var s=n.blocks[r];if(e>=s[0]&&e<=s[1])return n.name}return null}var to=[];xc.forEach(e=>e.blocks.forEach(t=>to.push(...t)));function pm(e){for(var t=0;t<to.length;t+=2)if(e>=to[t]&&e<=to[t+1])return!0;return!1}var Xt=e=>e+" "+e,Vs=80,p7=function(t,n){return"M95,"+(622+t+n)+`
|
|
63
63
|
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
|
|
64
64
|
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
|
|
65
65
|
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
|
|
@@ -70,7 +70,7 @@ c5.3,-9.3,12,-14,20,-14
|
|
|
70
70
|
H400000v`+(40+t)+`H845.2724
|
|
71
71
|
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
|
|
72
72
|
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
|
|
73
|
-
M`+(834+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},
|
|
73
|
+
M`+(834+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},m7=function(t,n){return"M263,"+(601+t+n)+`c0.7,0,18,39.7,52,119
|
|
74
74
|
c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
|
|
75
75
|
c340,-704.7,510.7,-1060.3,512,-1067
|
|
76
76
|
l`+t/2.084+" -"+t+`
|
|
@@ -80,7 +80,7 @@ s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,
|
|
|
80
80
|
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
|
|
81
81
|
s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
|
|
82
82
|
c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
|
|
83
|
-
M`+(1001+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},
|
|
83
|
+
M`+(1001+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},g7=function(t,n){return"M983 "+(10+t+n)+`
|
|
84
84
|
l`+t/3.13+" -"+t+`
|
|
85
85
|
c4,-6.7,10,-10,18,-10 H400000v`+(40+t)+`
|
|
86
86
|
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
|
|
@@ -89,7 +89,7 @@ c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
|
|
|
89
89
|
c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
|
|
90
90
|
c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
|
|
91
91
|
c53.7,-170.3,84.5,-266.8,92.5,-289.5z
|
|
92
|
-
M`+(1001+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},
|
|
92
|
+
M`+(1001+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},v7=function(t,n){return"M424,"+(2398+t+n)+`
|
|
93
93
|
c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
|
|
94
94
|
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
|
|
95
95
|
s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
|
|
@@ -99,18 +99,18 @@ v`+(40+t)+`H1014.6
|
|
|
99
99
|
s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
|
|
100
100
|
c-2,6,-10,9,-24,9
|
|
101
101
|
c-8,0,-12,-0.7,-12,-2z M`+(1001+t)+" "+n+`
|
|
102
|
-
h400000v`+(40+t)+"h-400000z"},
|
|
102
|
+
h400000v`+(40+t)+"h-400000z"},b7=function(t,n){return"M473,"+(2713+t+n)+`
|
|
103
103
|
c339.3,-1799.3,509.3,-2700,510,-2702 l`+t/5.298+" -"+t+`
|
|
104
104
|
c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+t)+`H1017.7
|
|
105
105
|
s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
|
|
106
106
|
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
|
|
107
107
|
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
|
|
108
108
|
s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
|
|
109
|
-
606zM`+(1001+t)+" "+n+"h400000v"+(40+t)+"H1017.7z"},
|
|
109
|
+
606zM`+(1001+t)+" "+n+"h400000v"+(40+t)+"H1017.7z"},y7=function(t){var n=t/2;return"M400000 "+t+" H0 L"+n+" 0 l65 45 L145 "+(t-80)+" H400000z"},w7=function(t,n,r){var s=r-54-n-t;return"M702 "+(t+n)+"H400000"+(40+t)+`
|
|
110
110
|
H742v`+s+`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
|
|
111
111
|
h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
|
|
112
112
|
c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
|
|
113
|
-
219 661 l218 661zM702 `+n+"H400000v"+(40+t)+"H742z"},
|
|
113
|
+
219 661 l218 661zM702 `+n+"H400000v"+(40+t)+"H742z"},S7=function(t,n,r){n=1e3*n;var s="";switch(t){case"sqrtMain":s=p7(n,Vs);break;case"sqrtSize1":s=m7(n,Vs);break;case"sqrtSize2":s=g7(n,Vs);break;case"sqrtSize3":s=v7(n,Vs);break;case"sqrtSize4":s=b7(n,Vs);break;case"sqrtTall":s=w7(n,Vs,r)}return s},x7=function(t,n){switch(t){case"⎜":return Xt("M291 0 H417 V"+n+" H291z");case"∣":return Xt("M145 0 H188 V"+n+" H145z");case"∥":return Xt("M145 0 H188 V"+n+" H145z")+Xt("M367 0 H410 V"+n+" H367z");case"⎟":return Xt("M457 0 H583 V"+n+" H457z");case"⎢":return Xt("M319 0 H403 V"+n+" H319z");case"⎥":return Xt("M263 0 H347 V"+n+" H263z");case"⎪":return Xt("M384 0 H504 V"+n+" H384z");case"⏐":return Xt("M312 0 H355 V"+n+" H312z");case"‖":return Xt("M257 0 H300 V"+n+" H257z")+Xt("M478 0 H521 V"+n+" H478z");default:return""}},Ad={doubleleftarrow:`M262 157
|
|
114
114
|
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
|
|
115
115
|
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
|
|
116
116
|
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
|
|
@@ -281,7 +281,7 @@ M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`
|
|
|
281
281
|
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,
|
|
282
282
|
-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
|
|
283
283
|
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
|
|
284
|
-
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},
|
|
284
|
+
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},k7=function(t,n){switch(t){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v1759 v84 h347 v-84
|
|
285
285
|
H403z M403 1759 V0 H319 V1759 v`+n+" v1759 v84 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v1759 H0 v84 H347z
|
|
286
286
|
M347 1759 V0 H263 V1759 v`+n+" v1759 h84z";case"vert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15
|
|
287
287
|
c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
|
@@ -309,23 +309,24 @@ 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
|
|
|
309
309
|
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
|
|
310
310
|
c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
|
|
311
311
|
l0,-`+(n+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
|
|
312
|
-
-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.")}};function m7(e){return"toText"in e}class hi{constructor(t){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=t,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(t){return this.classes.includes(t)}toNode(){for(var t=document.createDocumentFragment(),n=0;n<this.children.length;n++)t.appendChild(this.children[n].toNode());return t}toMarkup(){for(var t="",n=0;n<this.children.length;n++)t+=this.children[n].toMarkup();return t}toText(){return this.children.map(t=>{if(m7(t))return t.toText();throw new Error("Expected MathDomNode with toText, got "+t.constructor.name)}).join("")}}var kc={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},g7={ex:!0,em:!0,mu:!0},hm=function(t){return typeof t!="string"&&(t=t.unit),t in kc||t in g7||t==="ex"},Mt=function(t,n){var r;if(t.unit in kc)r=kc[t.unit]/n.fontMetrics().ptPerEm/n.sizeMultiplier;else if(t.unit==="mu")r=n.fontMetrics().cssEmPerMu;else{var s;if(n.style.isTight()?s=n.havingStyle(n.style.text()):s=n,t.unit==="ex")r=s.fontMetrics().xHeight;else if(t.unit==="em")r=s.fontMetrics().quad;else throw new ae("Invalid unit: '"+t.unit+"'");s!==n&&(r*=s.sizeMultiplier/n.sizeMultiplier)}return Math.min(t.number*r,n.maxSize)},ue=function(t){return+t.toFixed(4)+"em"},ss=function(t){return t.filter(n=>n).join(" ")},z0=function(t){var n="";for(var r of Object.keys(t)){var s=t[r];s!==void 0&&(n+=V6(r)+":"+s+";")}return n},pm=function(t,n,r){if(this.classes=t||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=r||{},n){n.style.isTight()&&this.classes.push("mtight");var s=n.getColor();s&&(this.style.color=s)}},mm=function(t){var n=document.createElement(t);n.className=ss(this.classes),Object.assign(n.style,this.style);for(var r of Object.keys(this.attributes))n.setAttribute(r,this.attributes[r]);for(var s=0;s<this.children.length;s++)n.appendChild(this.children[s].toNode());return n},v7=/[\s"'>/=\x00-\x1f]/,gm=function(t){var n="<"+t;this.classes.length&&(n+=' class="'+on(ss(this.classes))+'"');var r=z0(this.style);r&&(n+=' style="'+on(r)+'"');for(var s of Object.keys(this.attributes)){if(v7.test(s))throw new ae("Invalid attribute name '"+s+"'");n+=" "+s+'="'+on(this.attributes[s])+'"'}n+=">";for(var i=0;i<this.children.length;i++)n+=this.children[i].toMarkup();return n+="</"+t+">",n};class pi{constructor(t,n,r,s){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,pm.call(this,t,r,s),this.children=n||[]}setAttribute(t,n){this.attributes[t]=n}hasClass(t){return this.classes.includes(t)}toNode(){return mm.call(this,"span")}toMarkup(){return gm.call(this,"span")}}class Fo{constructor(t,n,r,s){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,pm.call(this,n,s),this.children=r||[],this.setAttribute("href",t)}setAttribute(t,n){this.attributes[t]=n}hasClass(t){return this.classes.includes(t)}toNode(){return mm.call(this,"a")}toMarkup(){return gm.call(this,"a")}}class b7{constructor(t,n,r){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=n,this.src=t,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=r}hasClass(t){return this.classes.includes(t)}toNode(){var t=document.createElement("img");return t.src=this.src,t.alt=this.alt,t.className="mord",Object.assign(t.style,this.style),t}toMarkup(){var t='<img src="'+on(this.src)+'"'+(' alt="'+on(this.alt)+'"'),n=z0(this.style);return n&&(t+=' style="'+on(n)+'"'),t+="'/>",t}}var y7={î:"ı̂",ï:"ı̈",í:"ı́",ì:"ı̀"};class On{constructor(t,n,r,s,i,a,o,l){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=t,this.height=n||0,this.depth=r||0,this.italic=s||0,this.skew=i||0,this.width=a||0,this.classes=o||[],this.style=l||{},this.maxFontSize=0;var c=s7(this.text.charCodeAt(0));c&&this.classes.push(c+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=y7[this.text])}hasClass(t){return this.classes.includes(t)}toNode(){var t=document.createTextNode(this.text),n=null;return this.italic>0&&(n=document.createElement("span"),n.style.marginRight=ue(this.italic)),this.classes.length>0&&(n=n||document.createElement("span"),n.className=ss(this.classes)),Object.keys(this.style).length>0&&(n=n||document.createElement("span"),Object.assign(n.style,this.style)),n?(n.appendChild(t),n):t}toMarkup(){var t=!1,n="<span";this.classes.length&&(t=!0,n+=' class="',n+=on(ss(this.classes)),n+='"');var r="";this.italic>0&&(r+="margin-right:"+ue(this.italic)+";"),r+=z0(this.style),r&&(t=!0,n+=' style="'+on(r)+'"');var s=on(this.text);return t?(n+=">",n+=s,n+="</span>",n):s}}class Cr{constructor(t,n){this.children=void 0,this.attributes=void 0,this.children=t||[],this.attributes=n||{}}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");for(var r of Object.keys(this.attributes))n.setAttribute(r,this.attributes[r]);for(var s=0;s<this.children.length;s++)n.appendChild(this.children[s].toNode());return n}toMarkup(){var t='<svg xmlns="http://www.w3.org/2000/svg"';for(var n of Object.keys(this.attributes))t+=" "+n+'="'+on(this.attributes[n])+'"';t+=">";for(var r=0;r<this.children.length;r++)t+=this.children[r].toMarkup();return t+="</svg>",t}}class is{constructor(t,n){this.pathName=void 0,this.alternate=void 0,this.pathName=t,this.alternate=n}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"path");return this.alternate?n.setAttribute("d",this.alternate):n.setAttribute("d",Ed[this.pathName]),n}toMarkup(){return this.alternate?'<path d="'+on(this.alternate)+'"/>':'<path d="'+on(Ed[this.pathName])+'"/>'}}class _c{constructor(t){this.attributes=void 0,this.attributes=t||{}}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"line");for(var r of Object.keys(this.attributes))n.setAttribute(r,this.attributes[r]);return n}toMarkup(){var t="<line";for(var n of Object.keys(this.attributes))t+=" "+n+'="'+on(this.attributes[n])+'"';return t+="/>",t}}function w7(e){if(e instanceof On)return e;throw new Error("Expected symbolNode but got "+String(e)+".")}function S7(e){if(e instanceof pi)return e;throw new Error("Expected span<HtmlDomNode> but got "+String(e)+".")}var x7=e=>e instanceof pi||e instanceof Fo||e instanceof hi,cr={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},Ma={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},Ad={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function k7(e,t){cr[e]=t}function $0(e,t,n){if(!cr[t])throw new Error("Font metrics not found for font: "+t+".");var r=e.charCodeAt(0),s=cr[t][r];if(!s&&e[0]in Ad&&(r=Ad[e[0]].charCodeAt(0),s=cr[t][r]),!s&&n==="text"&&fm(r)&&(s=cr[t][77]),s)return{depth:s[0],height:s[1],italic:s[2],skew:s[3],width:s[4]}}var Tl={};function _7(e){var t;if(e>=5?t=0:e>=3?t=1:t=2,!Tl[t]){var n=Tl[t]={cssEmPerMu:Ma.quad[t]/18};for(var r in Ma)Ma.hasOwnProperty(r)&&(n[r]=Ma[r][t])}return Tl[t]}var Rt={math:{},text:{}};function d(e,t,n,r,s,i){Rt[e][s]={font:t,group:n,replace:r},i&&r&&(Rt[e][r]=Rt[e][s])}var p="math",ee="text",v="main",A="ams",Ct="accent-token",ye="bin",vn="close",mi="inner",Le="mathord",Wt="op-token",Nn="open",ha="punct",R="rel",zr="spacing",B="textord";d(p,v,R,"≡","\\equiv",!0);d(p,v,R,"≺","\\prec",!0);d(p,v,R,"≻","\\succ",!0);d(p,v,R,"∼","\\sim",!0);d(p,v,R,"⊥","\\perp");d(p,v,R,"⪯","\\preceq",!0);d(p,v,R,"⪰","\\succeq",!0);d(p,v,R,"≃","\\simeq",!0);d(p,v,R,"∣","\\mid",!0);d(p,v,R,"≪","\\ll",!0);d(p,v,R,"≫","\\gg",!0);d(p,v,R,"≍","\\asymp",!0);d(p,v,R,"∥","\\parallel");d(p,v,R,"⋈","\\bowtie",!0);d(p,v,R,"⌣","\\smile",!0);d(p,v,R,"⊑","\\sqsubseteq",!0);d(p,v,R,"⊒","\\sqsupseteq",!0);d(p,v,R,"≐","\\doteq",!0);d(p,v,R,"⌢","\\frown",!0);d(p,v,R,"∋","\\ni",!0);d(p,v,R,"∝","\\propto",!0);d(p,v,R,"⊢","\\vdash",!0);d(p,v,R,"⊣","\\dashv",!0);d(p,v,R,"∋","\\owns");d(p,v,ha,".","\\ldotp");d(p,v,ha,"⋅","\\cdotp");d(p,v,ha,"⋅","·");d(ee,v,B,"⋅","·");d(p,v,B,"#","\\#");d(ee,v,B,"#","\\#");d(p,v,B,"&","\\&");d(ee,v,B,"&","\\&");d(p,v,B,"ℵ","\\aleph",!0);d(p,v,B,"∀","\\forall",!0);d(p,v,B,"ℏ","\\hbar",!0);d(p,v,B,"∃","\\exists",!0);d(p,v,B,"∇","\\nabla",!0);d(p,v,B,"♭","\\flat",!0);d(p,v,B,"ℓ","\\ell",!0);d(p,v,B,"♮","\\natural",!0);d(p,v,B,"♣","\\clubsuit",!0);d(p,v,B,"℘","\\wp",!0);d(p,v,B,"♯","\\sharp",!0);d(p,v,B,"♢","\\diamondsuit",!0);d(p,v,B,"ℜ","\\Re",!0);d(p,v,B,"♡","\\heartsuit",!0);d(p,v,B,"ℑ","\\Im",!0);d(p,v,B,"♠","\\spadesuit",!0);d(p,v,B,"§","\\S",!0);d(ee,v,B,"§","\\S");d(p,v,B,"¶","\\P",!0);d(ee,v,B,"¶","\\P");d(p,v,B,"†","\\dag");d(ee,v,B,"†","\\dag");d(ee,v,B,"†","\\textdagger");d(p,v,B,"‡","\\ddag");d(ee,v,B,"‡","\\ddag");d(ee,v,B,"‡","\\textdaggerdbl");d(p,v,vn,"⎱","\\rmoustache",!0);d(p,v,Nn,"⎰","\\lmoustache",!0);d(p,v,vn,"⟯","\\rgroup",!0);d(p,v,Nn,"⟮","\\lgroup",!0);d(p,v,ye,"∓","\\mp",!0);d(p,v,ye,"⊖","\\ominus",!0);d(p,v,ye,"⊎","\\uplus",!0);d(p,v,ye,"⊓","\\sqcap",!0);d(p,v,ye,"∗","\\ast");d(p,v,ye,"⊔","\\sqcup",!0);d(p,v,ye,"◯","\\bigcirc",!0);d(p,v,ye,"∙","\\bullet",!0);d(p,v,ye,"‡","\\ddagger");d(p,v,ye,"≀","\\wr",!0);d(p,v,ye,"⨿","\\amalg");d(p,v,ye,"&","\\And");d(p,v,R,"⟵","\\longleftarrow",!0);d(p,v,R,"⇐","\\Leftarrow",!0);d(p,v,R,"⟸","\\Longleftarrow",!0);d(p,v,R,"⟶","\\longrightarrow",!0);d(p,v,R,"⇒","\\Rightarrow",!0);d(p,v,R,"⟹","\\Longrightarrow",!0);d(p,v,R,"↔","\\leftrightarrow",!0);d(p,v,R,"⟷","\\longleftrightarrow",!0);d(p,v,R,"⇔","\\Leftrightarrow",!0);d(p,v,R,"⟺","\\Longleftrightarrow",!0);d(p,v,R,"↦","\\mapsto",!0);d(p,v,R,"⟼","\\longmapsto",!0);d(p,v,R,"↗","\\nearrow",!0);d(p,v,R,"↩","\\hookleftarrow",!0);d(p,v,R,"↪","\\hookrightarrow",!0);d(p,v,R,"↘","\\searrow",!0);d(p,v,R,"↼","\\leftharpoonup",!0);d(p,v,R,"⇀","\\rightharpoonup",!0);d(p,v,R,"↙","\\swarrow",!0);d(p,v,R,"↽","\\leftharpoondown",!0);d(p,v,R,"⇁","\\rightharpoondown",!0);d(p,v,R,"↖","\\nwarrow",!0);d(p,v,R,"⇌","\\rightleftharpoons",!0);d(p,A,R,"≮","\\nless",!0);d(p,A,R,"","\\@nleqslant");d(p,A,R,"","\\@nleqq");d(p,A,R,"⪇","\\lneq",!0);d(p,A,R,"≨","\\lneqq",!0);d(p,A,R,"","\\@lvertneqq");d(p,A,R,"⋦","\\lnsim",!0);d(p,A,R,"⪉","\\lnapprox",!0);d(p,A,R,"⊀","\\nprec",!0);d(p,A,R,"⋠","\\npreceq",!0);d(p,A,R,"⋨","\\precnsim",!0);d(p,A,R,"⪹","\\precnapprox",!0);d(p,A,R,"≁","\\nsim",!0);d(p,A,R,"","\\@nshortmid");d(p,A,R,"∤","\\nmid",!0);d(p,A,R,"⊬","\\nvdash",!0);d(p,A,R,"⊭","\\nvDash",!0);d(p,A,R,"⋪","\\ntriangleleft");d(p,A,R,"⋬","\\ntrianglelefteq",!0);d(p,A,R,"⊊","\\subsetneq",!0);d(p,A,R,"","\\@varsubsetneq");d(p,A,R,"⫋","\\subsetneqq",!0);d(p,A,R,"","\\@varsubsetneqq");d(p,A,R,"≯","\\ngtr",!0);d(p,A,R,"","\\@ngeqslant");d(p,A,R,"","\\@ngeqq");d(p,A,R,"⪈","\\gneq",!0);d(p,A,R,"≩","\\gneqq",!0);d(p,A,R,"","\\@gvertneqq");d(p,A,R,"⋧","\\gnsim",!0);d(p,A,R,"⪊","\\gnapprox",!0);d(p,A,R,"⊁","\\nsucc",!0);d(p,A,R,"⋡","\\nsucceq",!0);d(p,A,R,"⋩","\\succnsim",!0);d(p,A,R,"⪺","\\succnapprox",!0);d(p,A,R,"≆","\\ncong",!0);d(p,A,R,"","\\@nshortparallel");d(p,A,R,"∦","\\nparallel",!0);d(p,A,R,"⊯","\\nVDash",!0);d(p,A,R,"⋫","\\ntriangleright");d(p,A,R,"⋭","\\ntrianglerighteq",!0);d(p,A,R,"","\\@nsupseteqq");d(p,A,R,"⊋","\\supsetneq",!0);d(p,A,R,"","\\@varsupsetneq");d(p,A,R,"⫌","\\supsetneqq",!0);d(p,A,R,"","\\@varsupsetneqq");d(p,A,R,"⊮","\\nVdash",!0);d(p,A,R,"⪵","\\precneqq",!0);d(p,A,R,"⪶","\\succneqq",!0);d(p,A,R,"","\\@nsubseteqq");d(p,A,ye,"⊴","\\unlhd");d(p,A,ye,"⊵","\\unrhd");d(p,A,R,"↚","\\nleftarrow",!0);d(p,A,R,"↛","\\nrightarrow",!0);d(p,A,R,"⇍","\\nLeftarrow",!0);d(p,A,R,"⇏","\\nRightarrow",!0);d(p,A,R,"↮","\\nleftrightarrow",!0);d(p,A,R,"⇎","\\nLeftrightarrow",!0);d(p,A,R,"△","\\vartriangle");d(p,A,B,"ℏ","\\hslash");d(p,A,B,"▽","\\triangledown");d(p,A,B,"◊","\\lozenge");d(p,A,B,"Ⓢ","\\circledS");d(p,A,B,"®","\\circledR");d(ee,A,B,"®","\\circledR");d(p,A,B,"∡","\\measuredangle",!0);d(p,A,B,"∄","\\nexists");d(p,A,B,"℧","\\mho");d(p,A,B,"Ⅎ","\\Finv",!0);d(p,A,B,"⅁","\\Game",!0);d(p,A,B,"‵","\\backprime");d(p,A,B,"▲","\\blacktriangle");d(p,A,B,"▼","\\blacktriangledown");d(p,A,B,"■","\\blacksquare");d(p,A,B,"⧫","\\blacklozenge");d(p,A,B,"★","\\bigstar");d(p,A,B,"∢","\\sphericalangle",!0);d(p,A,B,"∁","\\complement",!0);d(p,A,B,"ð","\\eth",!0);d(ee,v,B,"ð","ð");d(p,A,B,"╱","\\diagup");d(p,A,B,"╲","\\diagdown");d(p,A,B,"□","\\square");d(p,A,B,"□","\\Box");d(p,A,B,"◊","\\Diamond");d(p,A,B,"¥","\\yen",!0);d(ee,A,B,"¥","\\yen",!0);d(p,A,B,"✓","\\checkmark",!0);d(ee,A,B,"✓","\\checkmark");d(p,A,B,"ℶ","\\beth",!0);d(p,A,B,"ℸ","\\daleth",!0);d(p,A,B,"ℷ","\\gimel",!0);d(p,A,B,"ϝ","\\digamma",!0);d(p,A,B,"ϰ","\\varkappa");d(p,A,Nn,"┌","\\@ulcorner",!0);d(p,A,vn,"┐","\\@urcorner",!0);d(p,A,Nn,"└","\\@llcorner",!0);d(p,A,vn,"┘","\\@lrcorner",!0);d(p,A,R,"≦","\\leqq",!0);d(p,A,R,"⩽","\\leqslant",!0);d(p,A,R,"⪕","\\eqslantless",!0);d(p,A,R,"≲","\\lesssim",!0);d(p,A,R,"⪅","\\lessapprox",!0);d(p,A,R,"≊","\\approxeq",!0);d(p,A,ye,"⋖","\\lessdot");d(p,A,R,"⋘","\\lll",!0);d(p,A,R,"≶","\\lessgtr",!0);d(p,A,R,"⋚","\\lesseqgtr",!0);d(p,A,R,"⪋","\\lesseqqgtr",!0);d(p,A,R,"≑","\\doteqdot");d(p,A,R,"≓","\\risingdotseq",!0);d(p,A,R,"≒","\\fallingdotseq",!0);d(p,A,R,"∽","\\backsim",!0);d(p,A,R,"⋍","\\backsimeq",!0);d(p,A,R,"⫅","\\subseteqq",!0);d(p,A,R,"⋐","\\Subset",!0);d(p,A,R,"⊏","\\sqsubset",!0);d(p,A,R,"≼","\\preccurlyeq",!0);d(p,A,R,"⋞","\\curlyeqprec",!0);d(p,A,R,"≾","\\precsim",!0);d(p,A,R,"⪷","\\precapprox",!0);d(p,A,R,"⊲","\\vartriangleleft");d(p,A,R,"⊴","\\trianglelefteq");d(p,A,R,"⊨","\\vDash",!0);d(p,A,R,"⊪","\\Vvdash",!0);d(p,A,R,"⌣","\\smallsmile");d(p,A,R,"⌢","\\smallfrown");d(p,A,R,"≏","\\bumpeq",!0);d(p,A,R,"≎","\\Bumpeq",!0);d(p,A,R,"≧","\\geqq",!0);d(p,A,R,"⩾","\\geqslant",!0);d(p,A,R,"⪖","\\eqslantgtr",!0);d(p,A,R,"≳","\\gtrsim",!0);d(p,A,R,"⪆","\\gtrapprox",!0);d(p,A,ye,"⋗","\\gtrdot");d(p,A,R,"⋙","\\ggg",!0);d(p,A,R,"≷","\\gtrless",!0);d(p,A,R,"⋛","\\gtreqless",!0);d(p,A,R,"⪌","\\gtreqqless",!0);d(p,A,R,"≖","\\eqcirc",!0);d(p,A,R,"≗","\\circeq",!0);d(p,A,R,"≜","\\triangleq",!0);d(p,A,R,"∼","\\thicksim");d(p,A,R,"≈","\\thickapprox");d(p,A,R,"⫆","\\supseteqq",!0);d(p,A,R,"⋑","\\Supset",!0);d(p,A,R,"⊐","\\sqsupset",!0);d(p,A,R,"≽","\\succcurlyeq",!0);d(p,A,R,"⋟","\\curlyeqsucc",!0);d(p,A,R,"≿","\\succsim",!0);d(p,A,R,"⪸","\\succapprox",!0);d(p,A,R,"⊳","\\vartriangleright");d(p,A,R,"⊵","\\trianglerighteq");d(p,A,R,"⊩","\\Vdash",!0);d(p,A,R,"∣","\\shortmid");d(p,A,R,"∥","\\shortparallel");d(p,A,R,"≬","\\between",!0);d(p,A,R,"⋔","\\pitchfork",!0);d(p,A,R,"∝","\\varpropto");d(p,A,R,"◀","\\blacktriangleleft");d(p,A,R,"∴","\\therefore",!0);d(p,A,R,"∍","\\backepsilon");d(p,A,R,"▶","\\blacktriangleright");d(p,A,R,"∵","\\because",!0);d(p,A,R,"⋘","\\llless");d(p,A,R,"⋙","\\gggtr");d(p,A,ye,"⊲","\\lhd");d(p,A,ye,"⊳","\\rhd");d(p,A,R,"≂","\\eqsim",!0);d(p,v,R,"⋈","\\Join");d(p,A,R,"≑","\\Doteq",!0);d(p,A,ye,"∔","\\dotplus",!0);d(p,A,ye,"∖","\\smallsetminus");d(p,A,ye,"⋒","\\Cap",!0);d(p,A,ye,"⋓","\\Cup",!0);d(p,A,ye,"⩞","\\doublebarwedge",!0);d(p,A,ye,"⊟","\\boxminus",!0);d(p,A,ye,"⊞","\\boxplus",!0);d(p,A,ye,"⋇","\\divideontimes",!0);d(p,A,ye,"⋉","\\ltimes",!0);d(p,A,ye,"⋊","\\rtimes",!0);d(p,A,ye,"⋋","\\leftthreetimes",!0);d(p,A,ye,"⋌","\\rightthreetimes",!0);d(p,A,ye,"⋏","\\curlywedge",!0);d(p,A,ye,"⋎","\\curlyvee",!0);d(p,A,ye,"⊝","\\circleddash",!0);d(p,A,ye,"⊛","\\circledast",!0);d(p,A,ye,"⋅","\\centerdot");d(p,A,ye,"⊺","\\intercal",!0);d(p,A,ye,"⋒","\\doublecap");d(p,A,ye,"⋓","\\doublecup");d(p,A,ye,"⊠","\\boxtimes",!0);d(p,A,R,"⇢","\\dashrightarrow",!0);d(p,A,R,"⇠","\\dashleftarrow",!0);d(p,A,R,"⇇","\\leftleftarrows",!0);d(p,A,R,"⇆","\\leftrightarrows",!0);d(p,A,R,"⇚","\\Lleftarrow",!0);d(p,A,R,"↞","\\twoheadleftarrow",!0);d(p,A,R,"↢","\\leftarrowtail",!0);d(p,A,R,"↫","\\looparrowleft",!0);d(p,A,R,"⇋","\\leftrightharpoons",!0);d(p,A,R,"↶","\\curvearrowleft",!0);d(p,A,R,"↺","\\circlearrowleft",!0);d(p,A,R,"↰","\\Lsh",!0);d(p,A,R,"⇈","\\upuparrows",!0);d(p,A,R,"↿","\\upharpoonleft",!0);d(p,A,R,"⇃","\\downharpoonleft",!0);d(p,v,R,"⊶","\\origof",!0);d(p,v,R,"⊷","\\imageof",!0);d(p,A,R,"⊸","\\multimap",!0);d(p,A,R,"↭","\\leftrightsquigarrow",!0);d(p,A,R,"⇉","\\rightrightarrows",!0);d(p,A,R,"⇄","\\rightleftarrows",!0);d(p,A,R,"↠","\\twoheadrightarrow",!0);d(p,A,R,"↣","\\rightarrowtail",!0);d(p,A,R,"↬","\\looparrowright",!0);d(p,A,R,"↷","\\curvearrowright",!0);d(p,A,R,"↻","\\circlearrowright",!0);d(p,A,R,"↱","\\Rsh",!0);d(p,A,R,"⇊","\\downdownarrows",!0);d(p,A,R,"↾","\\upharpoonright",!0);d(p,A,R,"⇂","\\downharpoonright",!0);d(p,A,R,"⇝","\\rightsquigarrow",!0);d(p,A,R,"⇝","\\leadsto");d(p,A,R,"⇛","\\Rrightarrow",!0);d(p,A,R,"↾","\\restriction");d(p,v,B,"‘","`");d(p,v,B,"$","\\$");d(ee,v,B,"$","\\$");d(ee,v,B,"$","\\textdollar");d(p,v,B,"%","\\%");d(ee,v,B,"%","\\%");d(p,v,B,"_","\\_");d(ee,v,B,"_","\\_");d(ee,v,B,"_","\\textunderscore");d(p,v,B,"∠","\\angle",!0);d(p,v,B,"∞","\\infty",!0);d(p,v,B,"′","\\prime");d(p,v,B,"△","\\triangle");d(p,v,B,"Γ","\\Gamma",!0);d(p,v,B,"Δ","\\Delta",!0);d(p,v,B,"Θ","\\Theta",!0);d(p,v,B,"Λ","\\Lambda",!0);d(p,v,B,"Ξ","\\Xi",!0);d(p,v,B,"Π","\\Pi",!0);d(p,v,B,"Σ","\\Sigma",!0);d(p,v,B,"Υ","\\Upsilon",!0);d(p,v,B,"Φ","\\Phi",!0);d(p,v,B,"Ψ","\\Psi",!0);d(p,v,B,"Ω","\\Omega",!0);d(p,v,B,"A","Α");d(p,v,B,"B","Β");d(p,v,B,"E","Ε");d(p,v,B,"Z","Ζ");d(p,v,B,"H","Η");d(p,v,B,"I","Ι");d(p,v,B,"K","Κ");d(p,v,B,"M","Μ");d(p,v,B,"N","Ν");d(p,v,B,"O","Ο");d(p,v,B,"P","Ρ");d(p,v,B,"T","Τ");d(p,v,B,"X","Χ");d(p,v,B,"¬","\\neg",!0);d(p,v,B,"¬","\\lnot");d(p,v,B,"⊤","\\top");d(p,v,B,"⊥","\\bot");d(p,v,B,"∅","\\emptyset");d(p,A,B,"∅","\\varnothing");d(p,v,Le,"α","\\alpha",!0);d(p,v,Le,"β","\\beta",!0);d(p,v,Le,"γ","\\gamma",!0);d(p,v,Le,"δ","\\delta",!0);d(p,v,Le,"ϵ","\\epsilon",!0);d(p,v,Le,"ζ","\\zeta",!0);d(p,v,Le,"η","\\eta",!0);d(p,v,Le,"θ","\\theta",!0);d(p,v,Le,"ι","\\iota",!0);d(p,v,Le,"κ","\\kappa",!0);d(p,v,Le,"λ","\\lambda",!0);d(p,v,Le,"μ","\\mu",!0);d(p,v,Le,"ν","\\nu",!0);d(p,v,Le,"ξ","\\xi",!0);d(p,v,Le,"ο","\\omicron",!0);d(p,v,Le,"π","\\pi",!0);d(p,v,Le,"ρ","\\rho",!0);d(p,v,Le,"σ","\\sigma",!0);d(p,v,Le,"τ","\\tau",!0);d(p,v,Le,"υ","\\upsilon",!0);d(p,v,Le,"ϕ","\\phi",!0);d(p,v,Le,"χ","\\chi",!0);d(p,v,Le,"ψ","\\psi",!0);d(p,v,Le,"ω","\\omega",!0);d(p,v,Le,"ε","\\varepsilon",!0);d(p,v,Le,"ϑ","\\vartheta",!0);d(p,v,Le,"ϖ","\\varpi",!0);d(p,v,Le,"ϱ","\\varrho",!0);d(p,v,Le,"ς","\\varsigma",!0);d(p,v,Le,"φ","\\varphi",!0);d(p,v,ye,"∗","*",!0);d(p,v,ye,"+","+");d(p,v,ye,"−","-",!0);d(p,v,ye,"⋅","\\cdot",!0);d(p,v,ye,"∘","\\circ",!0);d(p,v,ye,"÷","\\div",!0);d(p,v,ye,"±","\\pm",!0);d(p,v,ye,"×","\\times",!0);d(p,v,ye,"∩","\\cap",!0);d(p,v,ye,"∪","\\cup",!0);d(p,v,ye,"∖","\\setminus",!0);d(p,v,ye,"∧","\\land");d(p,v,ye,"∨","\\lor");d(p,v,ye,"∧","\\wedge",!0);d(p,v,ye,"∨","\\vee",!0);d(p,v,B,"√","\\surd");d(p,v,Nn,"⟨","\\langle",!0);d(p,v,Nn,"∣","\\lvert");d(p,v,Nn,"∥","\\lVert");d(p,v,vn,"?","?");d(p,v,vn,"!","!");d(p,v,vn,"⟩","\\rangle",!0);d(p,v,vn,"∣","\\rvert");d(p,v,vn,"∥","\\rVert");d(p,v,R,"=","=");d(p,v,R,":",":");d(p,v,R,"≈","\\approx",!0);d(p,v,R,"≅","\\cong",!0);d(p,v,R,"≥","\\ge");d(p,v,R,"≥","\\geq",!0);d(p,v,R,"←","\\gets");d(p,v,R,">","\\gt",!0);d(p,v,R,"∈","\\in",!0);d(p,v,R,"","\\@not");d(p,v,R,"⊂","\\subset",!0);d(p,v,R,"⊃","\\supset",!0);d(p,v,R,"⊆","\\subseteq",!0);d(p,v,R,"⊇","\\supseteq",!0);d(p,A,R,"⊈","\\nsubseteq",!0);d(p,A,R,"⊉","\\nsupseteq",!0);d(p,v,R,"⊨","\\models");d(p,v,R,"←","\\leftarrow",!0);d(p,v,R,"≤","\\le");d(p,v,R,"≤","\\leq",!0);d(p,v,R,"<","\\lt",!0);d(p,v,R,"→","\\rightarrow",!0);d(p,v,R,"→","\\to");d(p,A,R,"≱","\\ngeq",!0);d(p,A,R,"≰","\\nleq",!0);d(p,v,zr," ","\\ ");d(p,v,zr," ","\\space");d(p,v,zr," ","\\nobreakspace");d(ee,v,zr," ","\\ ");d(ee,v,zr," "," ");d(ee,v,zr," ","\\space");d(ee,v,zr," ","\\nobreakspace");d(p,v,zr,"","\\nobreak");d(p,v,zr,"","\\allowbreak");d(p,v,ha,",",",");d(p,v,ha,";",";");d(p,A,ye,"⊼","\\barwedge",!0);d(p,A,ye,"⊻","\\veebar",!0);d(p,v,ye,"⊙","\\odot",!0);d(p,v,ye,"⊕","\\oplus",!0);d(p,v,ye,"⊗","\\otimes",!0);d(p,v,B,"∂","\\partial",!0);d(p,v,ye,"⊘","\\oslash",!0);d(p,A,ye,"⊚","\\circledcirc",!0);d(p,A,ye,"⊡","\\boxdot",!0);d(p,v,ye,"△","\\bigtriangleup");d(p,v,ye,"▽","\\bigtriangledown");d(p,v,ye,"†","\\dagger");d(p,v,ye,"⋄","\\diamond");d(p,v,ye,"⋆","\\star");d(p,v,ye,"◃","\\triangleleft");d(p,v,ye,"▹","\\triangleright");d(p,v,Nn,"{","\\{");d(ee,v,B,"{","\\{");d(ee,v,B,"{","\\textbraceleft");d(p,v,vn,"}","\\}");d(ee,v,B,"}","\\}");d(ee,v,B,"}","\\textbraceright");d(p,v,Nn,"{","\\lbrace");d(p,v,vn,"}","\\rbrace");d(p,v,Nn,"[","\\lbrack",!0);d(ee,v,B,"[","\\lbrack",!0);d(p,v,vn,"]","\\rbrack",!0);d(ee,v,B,"]","\\rbrack",!0);d(p,v,Nn,"(","\\lparen",!0);d(p,v,vn,")","\\rparen",!0);d(ee,v,B,"<","\\textless",!0);d(ee,v,B,">","\\textgreater",!0);d(p,v,Nn,"⌊","\\lfloor",!0);d(p,v,vn,"⌋","\\rfloor",!0);d(p,v,Nn,"⌈","\\lceil",!0);d(p,v,vn,"⌉","\\rceil",!0);d(p,v,B,"\\","\\backslash");d(p,v,B,"∣","|");d(p,v,B,"∣","\\vert");d(ee,v,B,"|","\\textbar",!0);d(p,v,B,"∥","\\|");d(p,v,B,"∥","\\Vert");d(ee,v,B,"∥","\\textbardbl");d(ee,v,B,"~","\\textasciitilde");d(ee,v,B,"\\","\\textbackslash");d(ee,v,B,"^","\\textasciicircum");d(p,v,R,"↑","\\uparrow",!0);d(p,v,R,"⇑","\\Uparrow",!0);d(p,v,R,"↓","\\downarrow",!0);d(p,v,R,"⇓","\\Downarrow",!0);d(p,v,R,"↕","\\updownarrow",!0);d(p,v,R,"⇕","\\Updownarrow",!0);d(p,v,Wt,"∐","\\coprod");d(p,v,Wt,"⋁","\\bigvee");d(p,v,Wt,"⋀","\\bigwedge");d(p,v,Wt,"⨄","\\biguplus");d(p,v,Wt,"⋂","\\bigcap");d(p,v,Wt,"⋃","\\bigcup");d(p,v,Wt,"∫","\\int");d(p,v,Wt,"∫","\\intop");d(p,v,Wt,"∬","\\iint");d(p,v,Wt,"∭","\\iiint");d(p,v,Wt,"∏","\\prod");d(p,v,Wt,"∑","\\sum");d(p,v,Wt,"⨂","\\bigotimes");d(p,v,Wt,"⨁","\\bigoplus");d(p,v,Wt,"⨀","\\bigodot");d(p,v,Wt,"∮","\\oint");d(p,v,Wt,"∯","\\oiint");d(p,v,Wt,"∰","\\oiiint");d(p,v,Wt,"⨆","\\bigsqcup");d(p,v,Wt,"∫","\\smallint");d(ee,v,mi,"…","\\textellipsis");d(p,v,mi,"…","\\mathellipsis");d(ee,v,mi,"…","\\ldots",!0);d(p,v,mi,"…","\\ldots",!0);d(p,v,mi,"⋯","\\@cdots",!0);d(p,v,mi,"⋱","\\ddots",!0);d(p,v,B,"⋮","\\varvdots");d(ee,v,B,"⋮","\\varvdots");d(p,v,Ct,"ˊ","\\acute");d(p,v,Ct,"ˋ","\\grave");d(p,v,Ct,"¨","\\ddot");d(p,v,Ct,"~","\\tilde");d(p,v,Ct,"ˉ","\\bar");d(p,v,Ct,"˘","\\breve");d(p,v,Ct,"ˇ","\\check");d(p,v,Ct,"^","\\hat");d(p,v,Ct,"⃗","\\vec");d(p,v,Ct,"˙","\\dot");d(p,v,Ct,"˚","\\mathring");d(p,v,Le,"","\\@imath");d(p,v,Le,"","\\@jmath");d(p,v,B,"ı","ı");d(p,v,B,"ȷ","ȷ");d(ee,v,B,"ı","\\i",!0);d(ee,v,B,"ȷ","\\j",!0);d(ee,v,B,"ß","\\ss",!0);d(ee,v,B,"æ","\\ae",!0);d(ee,v,B,"œ","\\oe",!0);d(ee,v,B,"ø","\\o",!0);d(ee,v,B,"Æ","\\AE",!0);d(ee,v,B,"Œ","\\OE",!0);d(ee,v,B,"Ø","\\O",!0);d(ee,v,Ct,"ˊ","\\'");d(ee,v,Ct,"ˋ","\\`");d(ee,v,Ct,"ˆ","\\^");d(ee,v,Ct,"˜","\\~");d(ee,v,Ct,"ˉ","\\=");d(ee,v,Ct,"˘","\\u");d(ee,v,Ct,"˙","\\.");d(ee,v,Ct,"¸","\\c");d(ee,v,Ct,"˚","\\r");d(ee,v,Ct,"ˇ","\\v");d(ee,v,Ct,"¨",'\\"');d(ee,v,Ct,"˝","\\H");d(ee,v,Ct,"◯","\\textcircled");var vm={"--":!0,"---":!0,"``":!0,"''":!0};d(ee,v,B,"–","--",!0);d(ee,v,B,"–","\\textendash");d(ee,v,B,"—","---",!0);d(ee,v,B,"—","\\textemdash");d(ee,v,B,"‘","`",!0);d(ee,v,B,"‘","\\textquoteleft");d(ee,v,B,"’","'",!0);d(ee,v,B,"’","\\textquoteright");d(ee,v,B,"“","``",!0);d(ee,v,B,"“","\\textquotedblleft");d(ee,v,B,"”","''",!0);d(ee,v,B,"”","\\textquotedblright");d(p,v,B,"°","\\degree",!0);d(ee,v,B,"°","\\degree");d(ee,v,B,"°","\\textdegree",!0);d(p,v,B,"£","\\pounds");d(p,v,B,"£","\\mathsterling",!0);d(ee,v,B,"£","\\pounds");d(ee,v,B,"£","\\textsterling",!0);d(p,A,B,"✠","\\maltese");d(ee,A,B,"✠","\\maltese");var Td='0123456789/@."';for(var Il=0;Il<Td.length;Il++){var Id=Td.charAt(Il);d(p,v,B,Id,Id)}var Rd='0123456789!@*()-=+";:?/.,';for(var Rl=0;Rl<Rd.length;Rl++){var Cd=Rd.charAt(Rl);d(ee,v,B,Cd,Cd)}var yo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(var Cl=0;Cl<yo.length;Cl++){var za=yo.charAt(Cl);d(p,v,Le,za,za),d(ee,v,B,za,za)}d(p,A,B,"C","ℂ");d(ee,A,B,"C","ℂ");d(p,A,B,"H","ℍ");d(ee,A,B,"H","ℍ");d(p,A,B,"N","ℕ");d(ee,A,B,"N","ℕ");d(p,A,B,"P","ℙ");d(ee,A,B,"P","ℙ");d(p,A,B,"Q","ℚ");d(ee,A,B,"Q","ℚ");d(p,A,B,"R","ℝ");d(ee,A,B,"R","ℝ");d(p,A,B,"Z","ℤ");d(ee,A,B,"Z","ℤ");d(p,v,Le,"h","ℎ");d(ee,v,Le,"h","ℎ");var qe;for(var cn=0;cn<yo.length;cn++){var Pt=yo.charAt(cn);qe=String.fromCharCode(55349,56320+cn),d(p,v,Le,Pt,qe),d(ee,v,B,Pt,qe),qe=String.fromCharCode(55349,56372+cn),d(p,v,Le,Pt,qe),d(ee,v,B,Pt,qe),qe=String.fromCharCode(55349,56424+cn),d(p,v,Le,Pt,qe),d(ee,v,B,Pt,qe),qe=String.fromCharCode(55349,56580+cn),d(p,v,Le,Pt,qe),d(ee,v,B,Pt,qe),qe=String.fromCharCode(55349,56684+cn),d(p,v,Le,Pt,qe),d(ee,v,B,Pt,qe),qe=String.fromCharCode(55349,56736+cn),d(p,v,Le,Pt,qe),d(ee,v,B,Pt,qe),qe=String.fromCharCode(55349,56788+cn),d(p,v,Le,Pt,qe),d(ee,v,B,Pt,qe),qe=String.fromCharCode(55349,56840+cn),d(p,v,Le,Pt,qe),d(ee,v,B,Pt,qe),qe=String.fromCharCode(55349,56944+cn),d(p,v,Le,Pt,qe),d(ee,v,B,Pt,qe),cn<26&&(qe=String.fromCharCode(55349,56632+cn),d(p,v,Le,Pt,qe),d(ee,v,B,Pt,qe),qe=String.fromCharCode(55349,56476+cn),d(p,v,Le,Pt,qe),d(ee,v,B,Pt,qe))}qe="𝕜";d(p,v,Le,"k",qe);d(ee,v,B,"k",qe);for(var ws=0;ws<10;ws++){var Vr=ws.toString();qe=String.fromCharCode(55349,57294+ws),d(p,v,Le,Vr,qe),d(ee,v,B,Vr,qe),qe=String.fromCharCode(55349,57314+ws),d(p,v,Le,Vr,qe),d(ee,v,B,Vr,qe),qe=String.fromCharCode(55349,57324+ws),d(p,v,Le,Vr,qe),d(ee,v,B,Vr,qe),qe=String.fromCharCode(55349,57334+ws),d(p,v,Le,Vr,qe),d(ee,v,B,Vr,qe)}var Ec="ÐÞþ";for(var Ol=0;Ol<Ec.length;Ol++){var $a=Ec.charAt(Ol);d(p,v,Le,$a,$a),d(ee,v,B,$a,$a)}var Ac={mathClass:"mathbf",textClass:"textbf",font:"Main-Bold"},Od={mathClass:"mathnormal",textClass:"textit",font:"Math-Italic"},Nd={mathClass:"boldsymbol",textClass:"boldsymbol",font:"Main-BoldItalic"},E7={mathClass:"mathscr",textClass:"textscr",font:"Script-Regular"},ks={mathClass:"",textClass:"",font:""},Md={mathClass:"mathfrak",textClass:"textfrak",font:"Fraktur-Regular"},zd={mathClass:"mathbb",textClass:"textbb",font:"AMS-Regular"},$d={mathClass:"mathboldfrak",textClass:"textboldfrak",font:"Fraktur-Regular"},Tc={mathClass:"mathsf",textClass:"textsf",font:"SansSerif-Regular"},Ic={mathClass:"mathboldsf",textClass:"textboldsf",font:"SansSerif-Bold"},Dd={mathClass:"mathitsf",textClass:"textitsf",font:"SansSerif-Italic"},Rc={mathClass:"mathtt",textClass:"texttt",font:"Typewriter-Regular"},Pd=[Ac,Ac,Od,Od,Nd,Nd,E7,ks,ks,ks,Md,Md,zd,zd,$d,$d,Tc,Tc,Ic,Ic,Dd,Dd,ks,ks,Rc,Rc],A7=[Ac,ks,Tc,Ic,Rc],T7=e=>{var t=e.charCodeAt(0),n=e.charCodeAt(1),r=(t-55296)*1024+(n-56320)+65536;if(119808<=r&&r<120484){var s=Math.floor((r-119808)/26);return Pd[s]}else if(120782<=r&&r<=120831){var i=Math.floor((r-120782)/10);return A7[i]}else{if(r===120485||r===120486)return Pd[0];if(120486<r&&r<120782)return ks;throw new ae("Unsupported character: "+e)}},Uo=function(t,n,r){if(Rt[r][t]){var s=Rt[r][t].replace;s&&(t=s)}return{value:t,metrics:$0(t,n,r)}},hn=function(t,n,r,s,i){var a=Uo(t,n,r),o=a.metrics;t=a.value;var l;if(o){var c=o.italic;(r==="text"||s&&s.font==="mathit")&&(c=0),l=new On(t,o.height,o.depth,c,o.skew,o.width,i)}else typeof console<"u"&&console.warn("No character metrics "+("for '"+t+"' in style '"+n+"' and mode '"+r+"'")),l=new On(t,0,0,0,0,0,i);if(s){l.maxFontSize=s.sizeMultiplier,s.style.isTight()&&l.classes.push("mtight");var u=s.getColor();u&&(l.style.color=u)}return l},D0=function(t,n,r,s){return s===void 0&&(s=[]),r.font==="boldsymbol"&&Uo(t,"Main-Bold",n).metrics?hn(t,"Main-Bold",n,r,s.concat(["mathbf"])):t==="\\"||Rt[n][t].font==="main"?hn(t,"Main-Regular",n,r,s):hn(t,"AMS-Regular",n,r,s.concat(["amsrm"]))},I7=function(t,n,r){return r!=="textord"&&Uo(t,"Math-BoldItalic",n).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}},qo=function(t,n){var r=t.type==="mathord"?"mathord":"textord",s=t.mode,i=t.text,a=["mord"],{font:o,fontFamily:l,fontWeight:c,fontShape:u}=n,f=s==="math"||s==="text"&&!!o,m=f?o:l,h="",y="";if(i.charCodeAt(0)===55349){var b=T7(i);h=b.font,y=b[s+"Class"]}if(h)return hn(i,h,s,n,a.concat(y));if(m){var S,k;if(m==="boldsymbol"){var P=I7(i,s,r);S=P.fontName,k=[P.fontClass]}else f?(S=Cc[o].fontName,k=[o]):(S=Da(l,c,u),k=[l,c,u]);if(Uo(i,S,s).metrics)return hn(i,S,s,n,a.concat(k));if(vm.hasOwnProperty(i)&&S.slice(0,10)==="Typewriter"){for(var z=[],I=0;I<i.length;I++)z.push(hn(i[I],S,s,n,a.concat(k)));return $r(z)}}if(r==="mathord")return hn(i,"Math-Italic",s,n,a.concat(["mathnormal"]));if(r==="textord"){var E=Rt[s][i]&&Rt[s][i].font;if(E==="ams"){var _=Da("amsrm",c,u);return hn(i,_,s,n,a.concat("amsrm",c,u))}else if(E==="main"||!E){var L=Da("textrm",c,u);return hn(i,L,s,n,a.concat(c,u))}else{var N=Da(E,c,u);return hn(i,N,s,n,a.concat(N,c,u))}}else throw new Error("unexpected type: "+r+" in makeOrd")},R7=(e,t)=>{if(ss(e.classes)!==ss(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize||e.italic!==0&&e.hasClass("mathnormal"))return!1;if(e.classes.length===1){var n=e.classes[0];if(n==="mbin"||n==="mord")return!1}for(var r of Object.keys(e.style))if(e.style[r]!==t.style[r])return!1;for(var s of Object.keys(t.style))if(e.style[s]!==t.style[s])return!1;return!0},bm=e=>{for(var t=0;t<e.length-1;t++){var n=e[t],r=e[t+1];n instanceof On&&r instanceof On&&R7(n,r)&&(n.text+=r.text,n.height=Math.max(n.height,r.height),n.depth=Math.max(n.depth,r.depth),n.italic=r.italic,e.splice(t+1,1),t--)}return e},P0=function(t){for(var n=0,r=0,s=0,i=0;i<t.children.length;i++){var a=t.children[i];a.height>n&&(n=a.height),a.depth>r&&(r=a.depth),a.maxFontSize>s&&(s=a.maxFontSize)}t.height=n,t.depth=r,t.maxFontSize=s},te=function(t,n,r,s){var i=new pi(t,n,r,s);return P0(i),i},as=(e,t,n,r)=>new pi(e,t,n,r),ri=function(t,n,r){var s=te([t],[],n);return s.height=Math.max(r||n.fontMetrics().defaultRuleThickness,n.minRuleThickness),s.style.borderBottomWidth=ue(s.height),s.maxFontSize=1,s},C7=function(t,n,r,s){var i=new Fo(t,n,r,s);return P0(i),i},$r=function(t){var n=new hi(t);return P0(n),n},si=function(t,n){return t instanceof hi?te([],[t],n):t},O7=function(t){if(t.positionType==="individualShift"){for(var n=t.children,r=[n[0]],s=-n[0].shift-n[0].elem.depth,i=s,a=1;a<n.length;a++){var o=-n[a].shift-i-n[a].elem.depth,l=o-(n[a-1].elem.height+n[a-1].elem.depth);i=i+o,r.push({type:"kern",size:l}),r.push(n[a])}return{children:r,depth:s}}var c;if(t.positionType==="top"){for(var u=t.positionData,f=0;f<t.children.length;f++){var m=t.children[f];u-=m.type==="kern"?m.size:m.elem.height+m.elem.depth}c=u}else if(t.positionType==="bottom")c=-t.positionData;else{var h=t.children[0];if(h.type!=="elem")throw new Error('First child must have type "elem".');if(t.positionType==="shift")c=-h.elem.depth-t.positionData;else if(t.positionType==="firstBaseline")c=-h.elem.depth;else throw new Error("Invalid positionType "+t.positionType+".")}return{children:t.children,depth:c}},dt=function(t,n){for(var{children:r,depth:s}=O7(t),i=0,a=0;a<r.length;a++){var o=r[a];if(o.type==="elem"){var l=o.elem;i=Math.max(i,l.maxFontSize,l.height)}}i+=2;var c=te(["pstrut"],[]);c.style.height=ue(i);for(var u=[],f=s,m=s,h=s,y=0;y<r.length;y++){var b=r[y];if(b.type==="kern")h+=b.size;else{var S=b.elem,k=b.wrapperClasses||[],P=b.wrapperStyle||{},z=te(k,[c,S],void 0,P);z.style.top=ue(-i-h-S.depth),b.marginLeft&&(z.style.marginLeft=b.marginLeft),b.marginRight&&(z.style.marginRight=b.marginRight),u.push(z),h+=S.height+S.depth}f=Math.min(f,h),m=Math.max(m,h)}var I=te(["vlist"],u);I.style.height=ue(m);var E;if(f<0){var _=te([],[]),L=te(["vlist"],[_]);L.style.height=ue(-f);var N=te(["vlist-s"],[new On("")]);E=[te(["vlist-r"],[I,N]),te(["vlist-r"],[L])]}else E=[te(["vlist-r"],[I])];var G=te(["vlist-t"],E);return E.length===2&&G.classes.push("vlist-t2"),G.height=m,G.depth=-f,G},ym=(e,t)=>{var n=te(["mspace"],[],t),r=Mt(e,t);return n.style.marginRight=ue(r),n},Da=(e,t,n)=>{var r,s;switch(e){case"amsrm":r="AMS";break;case"textrm":r="Main";break;case"textsf":r="SansSerif";break;case"texttt":r="Typewriter";break;default:r=e}return t==="textbf"&&n==="textit"?s="BoldItalic":t==="textbf"?s="Bold":n==="textit"?s="Italic":s="Regular",r+"-"+s},Cc={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},wm={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},Sm=function(t,n){var[r,s,i]=wm[t],a=new is(r),o=new Cr([a],{width:ue(s),height:ue(i),style:"width:"+ue(s),viewBox:"0 0 "+1e3*s+" "+1e3*i,preserveAspectRatio:"xMinYMin"}),l=as(["overlay"],[o],n);return l.height=i,l.style.height=ue(i),l.style.width=ue(s),l},Nt={number:3,unit:"mu"},Ss={number:4,unit:"mu"},Sr={number:5,unit:"mu"},N7={mord:{mop:Nt,mbin:Ss,mrel:Sr,minner:Nt},mop:{mord:Nt,mop:Nt,mrel:Sr,minner:Nt},mbin:{mord:Ss,mop:Ss,mopen:Ss,minner:Ss},mrel:{mord:Sr,mop:Sr,mopen:Sr,minner:Sr},mopen:{},mclose:{mop:Nt,mbin:Ss,mrel:Sr,minner:Nt},mpunct:{mord:Nt,mop:Nt,mrel:Sr,mopen:Nt,mclose:Nt,mpunct:Nt,minner:Nt},minner:{mord:Nt,mop:Nt,mbin:Ss,mrel:Sr,mopen:Nt,mpunct:Nt,minner:Nt}},M7={mord:{mop:Nt},mop:{mord:Nt,mop:Nt},mbin:{},mrel:{},mopen:{},mclose:{mop:Nt},mpunct:{},minner:{mop:Nt}},xm={},ta={},na={};function be(e){for(var{type:t,names:n,htmlBuilder:r,mathmlBuilder:s}=e,i=0;i<n.length;++i)xm[n[i]]=e;t&&(r&&(ta[t]=r),s&&(na[t]=s))}function Ls(e){var{type:t,htmlBuilder:n,mathmlBuilder:r}=e;n&&(ta[t]=n),r&&(na[t]=r)}var wo=function(t){return t.type==="ordgroup"&&t.body.length===1?t.body[0]:t},Gt=function(t){return t.type==="ordgroup"?t.body:[t]},z7=new Set(["leftmost","mbin","mopen","mrel","mop","mpunct"]),$7=new Set(["rightmost","mrel","mclose","mpunct"]),D7={display:Ze.DISPLAY,text:Ze.TEXT,script:Ze.SCRIPT,scriptscript:Ze.SCRIPTSCRIPT},P7={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},tn=function(t,n,r,s){s===void 0&&(s=[null,null]);for(var i=[],a=0;a<t.length;a++){var o=ht(t[a],n);if(o instanceof hi){var l=o.children;i.push(...l)}else i.push(o)}if(bm(i),!r)return i;var c=n;if(t.length===1){var u=t[0];u.type==="sizing"?c=n.havingSize(u.size):u.type==="styling"&&(c=n.havingStyle(D7[u.style]))}var f=te([s[0]||"leftmost"],[],n),m=te([s[1]||"rightmost"],[],n),h=r==="root";return Oc(i,(y,b)=>{var S=b.classes[0],k=y.classes[0];S==="mbin"&&$7.has(k)?b.classes[0]="mord":k==="mbin"&&z7.has(S)&&(y.classes[0]="mord")},{node:f},m,h),Oc(i,(y,b)=>{var S,k,P=Mc(b),z=Mc(y),I=P&&z?y.hasClass("mtight")?(S=M7[P])==null?void 0:S[z]:(k=N7[P])==null?void 0:k[z]:null;if(I)return ym(I,c)},{node:f},m,h),i},Oc=function(t,n,r,s,i){s&&t.push(s);for(var a=0;a<t.length;a++){var o=t[a],l=km(o);if(l){Oc(l.children,n,r,null,i);continue}var c=!o.hasClass("mspace");if(c){var u=n(o,r.node);u&&(r.insertAfter?r.insertAfter(u):(t.unshift(u),a++))}c?r.node=o:i&&o.hasClass("newline")&&(r.node=te(["leftmost"])),r.insertAfter=(f=>m=>{t.splice(f+1,0,m),a++})(a)}s&&t.pop()},km=function(t){return t instanceof hi||t instanceof Fo||t instanceof pi&&t.hasClass("enclosing")?t:null},Nc=function(t,n){var r=km(t);if(r){var s=r.children;if(s.length){if(n==="right")return Nc(s[s.length-1],"right");if(n==="left")return Nc(s[0],"left")}}return t},Mc=function(t,n){if(!t)return null;n&&(t=Nc(t,n));var r=t.classes[0];return P7[r]||null},ra=function(t,n){var r=["nulldelimiter"].concat(t.baseSizingClasses());return te(n.concat(r))},ht=function(t,n,r){if(!t)return te();if(ta[t.type]){var s=ta[t.type](t,n);if(r&&n.size!==r.size){s=te(n.sizingClasses(r),[s],n);var i=n.sizeMultiplier/r.sizeMultiplier;s.height*=i,s.depth*=i}return s}else throw new ae("Got group of unknown type: '"+t.type+"'")};function Pa(e,t){var n=te(["base"],e,t),r=te(["strut"]);return r.style.height=ue(n.height+n.depth),n.depth&&(r.style.verticalAlign=ue(-n.depth)),n.children.unshift(r),n}function zc(e,t){var n=null;e.length===1&&e[0].type==="tag"&&(n=e[0].tag,e=e[0].body);var r=tn(e,t,"root"),s;r.length===2&&r[1].hasClass("tag")&&(s=r.pop());for(var i=[],a=[],o=0;o<r.length;o++)if(a.push(r[o]),r[o].hasClass("mbin")||r[o].hasClass("mrel")||r[o].hasClass("allowbreak")){for(var l=!1;o<r.length-1&&r[o+1].hasClass("mspace")&&!r[o+1].hasClass("newline");)o++,a.push(r[o]),r[o].hasClass("nobreak")&&(l=!0);l||(i.push(Pa(a,t)),a=[])}else r[o].hasClass("newline")&&(a.pop(),a.length>0&&(i.push(Pa(a,t)),a=[]),i.push(r[o]));a.length>0&&i.push(Pa(a,t));var c;n?(c=Pa(tn(n,t,!0),t),c.classes=["tag"],i.push(c)):s&&i.push(s);var u=te(["katex-html"],i);if(u.setAttribute("aria-hidden","true"),c){var f=c.children[0];f.style.height=ue(u.height+u.depth),u.depth&&(f.style.verticalAlign=ue(-u.depth))}return u}function _m(e){return new hi(e)}class oe{constructor(t,n,r){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=t,this.attributes={},this.children=n||[],this.classes=r||[]}setAttribute(t,n){this.attributes[t]=n}getAttribute(t){return this.attributes[t]}toNode(){var t=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&t.setAttribute(n,this.attributes[n]);this.classes.length>0&&(t.className=ss(this.classes));for(var r=0;r<this.children.length;r++)if(this.children[r]instanceof Zt&&this.children[r+1]instanceof Zt){for(var s=this.children[r].toText()+this.children[++r].toText();this.children[r+1]instanceof Zt;)s+=this.children[++r].toText();t.appendChild(new Zt(s).toNode())}else t.appendChild(this.children[r].toNode());return t}toMarkup(){var t="<"+this.type;for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&(t+=" "+n+'="',t+=on(this.attributes[n]),t+='"');this.classes.length>0&&(t+=' class ="'+on(ss(this.classes))+'"'),t+=">";for(var r=0;r<this.children.length;r++)t+=this.children[r].toMarkup();return t+="</"+this.type+">",t}toText(){return this.children.map(t=>t.toText()).join("")}}class Zt{constructor(t){this.text=void 0,this.text=t}toNode(){return document.createTextNode(this.text)}toMarkup(){return on(this.toText())}toText(){return this.text}}class Em{constructor(t){this.width=void 0,this.character=void 0,this.width=t,t>=.05555&&t<=.05556?this.character=" ":t>=.1666&&t<=.1667?this.character=" ":t>=.2222&&t<=.2223?this.character=" ":t>=.2777&&t<=.2778?this.character=" ":t>=-.05556&&t<=-.05555?this.character=" ":t>=-.1667&&t<=-.1666?this.character=" ":t>=-.2223&&t<=-.2222?this.character=" ":t>=-.2778&&t<=-.2777?this.character=" ":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var t=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return t.setAttribute("width",ue(this.width)),t}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+ue(this.width)+'"/>'}toText(){return this.character?this.character:" "}}var B7=new Set(["\\imath","\\jmath"]),L7=new Set(["mrow","mtable"]),Fn=function(t,n,r){return Rt[n][t]&&Rt[n][t].replace&&t.charCodeAt(0)!==55349&&!(vm.hasOwnProperty(t)&&r&&(r.fontFamily&&r.fontFamily.slice(4,6)==="tt"||r.font&&r.font.slice(4,6)==="tt"))&&(t=Rt[n][t].replace),new Zt(t)},B0=function(t){return t.length===1?t[0]:new oe("mrow",t)},F7={mathit:"italic",boldsymbol:e=>e.type==="textord"?"bold":"bold-italic",mathbf:"bold",mathbb:"double-struck",mathsfit:"sans-serif-italic",mathfrak:"fraktur",mathscr:"script",mathcal:"script",mathsf:"sans-serif",mathtt:"monospace"},L0=(e,t)=>{if(e.mode==="text"){if(t.fontFamily==="texttt")return"monospace";if(t.fontFamily==="textsf")return t.fontShape==="textit"&&t.fontWeight==="textbf"?"sans-serif-bold-italic":t.fontShape==="textit"?"sans-serif-italic":t.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(t.fontShape==="textit"&&t.fontWeight==="textbf")return"bold-italic";if(t.fontShape==="textit")return"italic";if(t.fontWeight==="textbf")return"bold"}var n=t.font;if(!n||n==="mathnormal")return null;var r=e.mode,s=F7[n];if(s)return typeof s=="function"?s(e):s;var i=e.text;if(B7.has(i))return null;if(Rt[r][i]){var a=Rt[r][i].replace;a&&(i=a)}var o=Cc[n].fontName;return $0(i,o,r)?Cc[n].variant:null};function Nl(e){if(!e)return!1;if(e.type==="mi"&&e.children.length===1){var t=e.children[0];return t instanceof Zt&&t.text==="."}else if(e.type==="mo"&&e.children.length===1&&e.getAttribute("separator")==="true"&&e.getAttribute("lspace")==="0em"&&e.getAttribute("rspace")==="0em"){var n=e.children[0];return n instanceof Zt&&n.text===","}else return!1}var Mn=function(t,n,r){if(t.length===1){var s=xt(t[0],n);return r&&s instanceof oe&&s.type==="mo"&&(s.setAttribute("lspace","0em"),s.setAttribute("rspace","0em")),[s]}for(var i=[],a,o=0;o<t.length;o++){var l=xt(t[o],n);if(l instanceof oe&&a instanceof oe){if(l.type==="mtext"&&a.type==="mtext"&&l.getAttribute("mathvariant")===a.getAttribute("mathvariant")){a.children.push(...l.children);continue}else if(l.type==="mn"&&a.type==="mn"){a.children.push(...l.children);continue}else if(Nl(l)&&a.type==="mn"){a.children.push(...l.children);continue}else if(l.type==="mn"&&Nl(a))l.children=[...a.children,...l.children],i.pop();else if((l.type==="msup"||l.type==="msub")&&l.children.length>=1&&(a.type==="mn"||Nl(a))){var c=l.children[0];c instanceof oe&&c.type==="mn"&&(c.children=[...a.children,...c.children],i.pop())}else if(a.type==="mi"&&a.children.length===1){var u=a.children[0];if(u instanceof Zt&&u.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var f=l.children[0];f instanceof Zt&&f.text.length>0&&(f.text=f.text.slice(0,1)+"̸"+f.text.slice(1),i.pop())}}}i.push(l),a=l}return i},os=function(t,n,r){return B0(Mn(t,n,r))},xt=function(t,n){if(!t)return new oe("mrow");if(na[t.type])return na[t.type](t,n);throw new ae("Got group of unknown type: '"+t.type+"'")};function Bd(e,t,n,r,s){var i=Mn(e,n),a;i.length===1&&i[0]instanceof oe&&L7.has(i[0].type)?a=i[0]:a=new oe("mrow",i);var o=new oe("annotation",[new Zt(t)]);o.setAttribute("encoding","application/x-tex");var l=new oe("semantics",[a,o]),c=new oe("math",[l]);c.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&c.setAttribute("display","block");var u=s?"katex":"katex-mathml";return te([u],[c])}var U7=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],Ld=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Fd=function(t,n){return n.size<2?t:U7[t-1][n.size-1]};class kr{constructor(t){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=t.style,this.color=t.color,this.size=t.size||kr.BASESIZE,this.textSize=t.textSize||this.size,this.phantom=!!t.phantom,this.font=t.font||"",this.fontFamily=t.fontFamily||"",this.fontWeight=t.fontWeight||"",this.fontShape=t.fontShape||"",this.sizeMultiplier=Ld[this.size-1],this.maxSize=t.maxSize,this.minRuleThickness=t.minRuleThickness,this._fontMetrics=void 0}extend(t){var n={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(n,t),new kr(n)}havingStyle(t){return this.style===t?this:this.extend({style:t,size:Fd(this.textSize,t)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(t){return this.size===t&&this.textSize===t?this:this.extend({style:this.style.text(),size:t,textSize:t,sizeMultiplier:Ld[t-1]})}havingBaseStyle(t){t=t||this.style.text();var n=Fd(kr.BASESIZE,t);return this.size===n&&this.textSize===kr.BASESIZE&&this.style===t?this:this.extend({style:t,size:n})}havingBaseSizing(){var t;switch(this.style.id){case 4:case 5:t=3;break;case 6:case 7:t=1;break;default:t=6}return this.extend({style:this.style.text(),size:t})}withColor(t){return this.extend({color:t})}withPhantom(){return this.extend({phantom:!0})}withFont(t){return this.extend({font:t})}withTextFontFamily(t){return this.extend({fontFamily:t,font:""})}withTextFontWeight(t){return this.extend({fontWeight:t,font:""})}withTextFontShape(t){return this.extend({fontShape:t,font:""})}sizingClasses(t){return t.size!==this.size?["sizing","reset-size"+t.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==kr.BASESIZE?["sizing","reset-size"+this.size,"size"+kr.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=_7(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}kr.BASESIZE=6;var Am=function(t){return new kr({style:t.displayMode?Ze.DISPLAY:Ze.TEXT,maxSize:t.maxSize,minRuleThickness:t.minRuleThickness})},Tm=function(t,n){if(n.displayMode){var r=["katex-display"];n.leqno&&r.push("leqno"),n.fleqn&&r.push("fleqn"),t=te(r,[t])}return t},q7=function(t,n,r){var s=Am(r),i;if(r.output==="mathml")return Bd(t,n,s,r.displayMode,!0);if(r.output==="html"){var a=zc(t,s);i=te(["katex"],[a])}else{var o=Bd(t,n,s,r.displayMode,!1),l=zc(t,s);i=te(["katex"],[o,l])}return Tm(i,r)},H7=function(t,n,r){var s=Am(r),i=zc(t,s),a=te(["katex"],[i]);return Tm(a,r)},V7={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",underbracket:"⎵",overbracket:"⎴",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},Ho=function(t){var n=new oe("mo",[new Zt(V7[t.replace(/^\\/,"")])]);return n.setAttribute("stretchy","true"),n},j7={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overbracket:[["leftbracketover","rightbracketover"],1.6,440],underbracket:[["leftbracketunder","rightbracketunder"],1.6,410],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},G7=new Set(["widehat","widecheck","widetilde","utilde"]),Vo=function(t,n){function r(){var o=4e5,l=t.label.slice(1);if(G7.has(l)&&"base"in t){var c=t.base.type==="ordgroup"?t.base.body.length:1,u,f,m;if(c>5)l==="widehat"||l==="widecheck"?(u=420,o=2364,m=.42,f=l+"4"):(u=312,o=2340,m=.34,f="tilde4");else{var h=[1,1,2,2,3,3][c];l==="widehat"||l==="widecheck"?(o=[0,1062,2364,2364,2364][h],u=[0,239,300,360,420][h],m=[0,.24,.3,.3,.36,.42][h],f=l+h):(o=[0,600,1033,2339,2340][h],u=[0,260,286,306,312][h],m=[0,.26,.286,.3,.306,.34][h],f="tilde"+h)}var y=new is(f),b=new Cr([y],{width:"100%",height:ue(m),viewBox:"0 0 "+o+" "+u,preserveAspectRatio:"none"});return{span:as([],[b],n),minWidth:0,height:m}}else{var S=[],k=j7[l];if(!k)throw new Error('No SVG data for "'+l+'".');var[P,z,I]=k,E=I/1e3,_=P.length,L,N;if(_===1){if(k.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+l+'".');L=["hide-tail"],N=[k[3]]}else if(_===2)L=["halfarrow-left","halfarrow-right"],N=["xMinYMin","xMaxYMin"];else if(_===3)L=["brace-left","brace-center","brace-right"],N=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support
|
|
313
|
-
`+_+" children.");for(var G=0;G<_;G++){var D=new is(P[G]),W=new Cr([D],{width:"400em",height:ue(E),viewBox:"0 0 "+o+" "+I,preserveAspectRatio:N[G]+" slice"}),q=as([L[G]],[W],n);if(_===1)return{span:q,minWidth:z,height:E};q.style.height=ue(E),S.push(q)}return{span:te(["stretchy"],S,n),minWidth:z,height:E}}}var{span:s,minWidth:i,height:a}=r();return s.height=a,s.style.height=ue(a),i>0&&(s.style.minWidth=ue(i)),s},Z7=function(t,n,r,s,i){var a,o=t.height+t.depth+r+s;if(/fbox|color|angl/.test(n)){if(a=te(["stretchy",n],[],i),n==="fbox"){var l=i.color&&i.getColor();l&&(a.style.borderColor=l)}}else{var c=[];/^[bx]cancel$/.test(n)&&c.push(new _c({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(n)&&c.push(new _c({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var u=new Cr(c,{width:"100%",height:ue(o)});a=as([],[u],i)}return a.height=o,a.style.height=ue(o),a},K7={bin:1,close:1,inner:1,open:1,punct:1,rel:1},W7={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function Q7(e){return e in K7}function Je(e,t){if(!e||e.type!==t)throw new Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)));return e}function jo(e){var t=Go(e);if(!t)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return t}function Go(e){return e&&(e.type==="atom"||W7.hasOwnProperty(e.type))?e:null}var Im=e=>{if(e instanceof On)return e;if(x7(e)&&e.children.length===1)return Im(e.children[0])},Rm=(e,t)=>{var n,r,s;e&&e.type==="supsub"?(r=Je(e.base,"accent"),n=r.base,e.base=n,s=S7(ht(e,t)),e.base=r):(r=Je(e,"accent"),n=r.base);var i=ht(n,t.havingCrampedStyle()),a=r.isShifty&&Mr(n),o=0;if(a){var l,c;o=(l=(c=Im(i))==null?void 0:c.skew)!=null?l:0}var u=r.label==="\\c",f=u?i.height+i.depth:Math.min(i.height,t.fontMetrics().xHeight),m;if(r.isStretchy)m=Vo(r,t),m=dt({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"elem",elem:m,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+ue(2*o)+")",marginLeft:ue(2*o)}:void 0}]});else{var h,y;r.label==="\\vec"?(h=Sm("vec",t),y=wm.vec[1]):(h=qo({type:"textord",mode:r.mode,text:r.label},t),h=w7(h),h.italic=0,y=h.width,u&&(f+=h.depth)),m=te(["accent-body"],[h]);var b=r.label==="\\textcircled";b&&(m.classes.push("accent-full"),f=i.height);var S=o;b||(S-=y/2),m.style.left=ue(S),r.label==="\\textcircled"&&(m.style.top=".2em"),m=dt({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:-f},{type:"elem",elem:m}]})}var k=te(["mord","accent"],[m],t);return s?(s.children[0]=k,s.height=Math.max(k.height,s.height),s.classes[0]="mord",s):k},J7=(e,t)=>{var n=e.isStretchy?Ho(e.label):new oe("mo",[Fn(e.label,e.mode)]),r=new oe("mover",[xt(e.base,t),n]);return r.setAttribute("accent","true"),r},Y7=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));be({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"],numArgs:1,handler:(e,t)=>{var n=wo(t[0]),r=!Y7.test(e.funcName),s=!r||e.funcName==="\\widehat"||e.funcName==="\\widetilde"||e.funcName==="\\widecheck";return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:s,base:n}},htmlBuilder:Rm,mathmlBuilder:J7});be({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"],handler:(e,t)=>{var n=t[0],r=e.parser.mode;return r==="math"&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}}});be({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],numArgs:1,handler:(e,t)=>{var{parser:n,funcName:r}=e,s=t[0];return{type:"accentUnder",mode:n.mode,label:r,base:s}},htmlBuilder:(e,t)=>{var n=ht(e.base,t),r=Vo(e,t),s=e.label==="\\utilde"?.12:0,i=dt({positionType:"top",positionData:n.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:s},{type:"elem",elem:n}]});return te(["mord","accentunder"],[i],t)},mathmlBuilder:(e,t)=>{var n=Ho(e.label),r=new oe("munder",[xt(e.base,t),n]);return r.setAttribute("accentunder","true"),r}});var Ba=e=>{var t=new oe("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};be({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],numArgs:1,numOptionalArgs:1,handler(e,t,n){var{parser:r,funcName:s}=e;return{type:"xArrow",mode:r.mode,label:s,body:t[0],below:n[0]}},htmlBuilder(e,t){var n=t.style,r=t.havingStyle(n.sup()),s=si(ht(e.body,r,t),t),i=e.label.slice(0,2)==="\\x"?"x":"cd";s.classes.push(i+"-arrow-pad");var a;e.below&&(r=t.havingStyle(n.sub()),a=si(ht(e.below,r,t),t),a.classes.push(i+"-arrow-pad"));var o=Vo(e,t),l=-t.fontMetrics().axisHeight+.5*o.height,c=-t.fontMetrics().axisHeight-.5*o.height-.111;(s.depth>.25||e.label==="\\xleftequilibrium")&&(c-=s.depth);var u;if(a){var f=-t.fontMetrics().axisHeight+a.height+.5*o.height+.111;u=dt({positionType:"individualShift",children:[{type:"elem",elem:s,shift:c},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]},{type:"elem",elem:a,shift:f}]})}else u=dt({positionType:"individualShift",children:[{type:"elem",elem:s,shift:c},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]}]});return te(["mrel","x-arrow"],[u],t)},mathmlBuilder(e,t){var n=Ho(e.label);n.setAttribute("minsize",e.label.charAt(0)==="x"?"1.75em":"3.0em");var r;if(e.body){var s=Ba(xt(e.body,t));if(e.below){var i=Ba(xt(e.below,t));r=new oe("munderover",[n,i,s])}else r=new oe("mover",[n,s])}else if(e.below){var a=Ba(xt(e.below,t));r=new oe("munder",[n,a])}else r=Ba(),r=new oe("mover",[n,r]);return r}});function X7(e,t){var n=tn(e.body,t,!0);return te([e.mclass],n,t)}function e8(e,t){var n,r=Mn(e.body,t);return e.mclass==="minner"?n=new oe("mpadded",r):e.mclass==="mord"?e.isCharacterBox?(n=r[0],n.type="mi"):n=new oe("mi",r):(e.isCharacterBox?(n=r[0],n.type="mo"):n=new oe("mo",r),e.mclass==="mbin"?(n.attributes.lspace="0.22em",n.attributes.rspace="0.22em"):e.mclass==="mpunct"?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):(e.mclass==="mopen"||e.mclass==="mclose")&&(n.attributes.lspace="0em",n.attributes.rspace="0em")),n}be({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],numArgs:1,primitive:!0,handler(e,t){var{parser:n,funcName:r}=e,s=t[0];return{type:"mclass",mode:n.mode,mclass:"m"+r.slice(5),body:Gt(s),isCharacterBox:Mr(s)}},htmlBuilder:X7,mathmlBuilder:e8});var Zo=e=>{var t=e.type==="ordgroup"&&e.body.length?e.body[0]:e;return t.type==="atom"&&(t.family==="bin"||t.family==="rel")?"m"+t.family:"mord"};be({type:"mclass",names:["\\@binrel"],numArgs:2,handler(e,t){var{parser:n}=e;return{type:"mclass",mode:n.mode,mclass:Zo(t[0]),body:Gt(t[1]),isCharacterBox:Mr(t[1])}}});be({type:"mclass",names:["\\stackrel","\\overset","\\underset"],numArgs:2,handler(e,t){var{parser:n,funcName:r}=e,s=t[1],i=t[0],a;r!=="\\stackrel"?a=Zo(s):a="mrel";var o={type:"op",mode:s.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!=="\\stackrel",body:Gt(s)},l=r==="\\underset"?{type:"supsub",mode:i.mode,base:o,sub:i}:{type:"supsub",mode:i.mode,base:o,sup:i};return{type:"mclass",mode:n.mode,mclass:a,body:[l],isCharacterBox:Mr(l)}}});be({type:"pmb",names:["\\pmb"],numArgs:1,allowedInText:!0,handler(e,t){var{parser:n}=e;return{type:"pmb",mode:n.mode,mclass:Zo(t[0]),body:Gt(t[0])}},htmlBuilder(e,t){var n=tn(e.body,t,!0),r=te([e.mclass],n,t);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(e,t){var n=Mn(e.body,t),r=new oe("mstyle",n);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var t8={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},Ud=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),qd=e=>e.type==="textord"&&e.text==="@",n8=(e,t)=>(e.type==="mathord"||e.type==="atom")&&e.text===t;function r8(e,t,n){var r=t8[e];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(r,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":{var s=n.callFunction("\\\\cdleft",[t[0]],[]),i={type:"atom",text:r,mode:"math",family:"rel"},a=n.callFunction("\\Big",[i],[]),o=n.callFunction("\\\\cdright",[t[1]],[]),l={type:"ordgroup",mode:"math",body:[s,a,o]};return n.callFunction("\\\\cdparent",[l],[])}case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var c={type:"textord",text:"\\Vert",mode:"math"};return n.callFunction("\\Big",[c],[])}default:return{type:"textord",text:" ",mode:"math"}}}function s8(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if(n==="&"||n==="\\\\")e.consume();else if(n==="\\end"){t[t.length-1].length===0&&t.pop();break}else throw new ae("Expected \\\\ or \\cr or \\end",e.nextToken)}for(var r=[],s=[r],i=0;i<t.length;i++){for(var a=t[i],o=Ud(),l=0;l<a.length;l++)if(!qd(a[l]))o.body.push(a[l]);else{r.push(o),l+=1;var c=jo(a[l]).text,u=new Array(2);if(u[0]={type:"ordgroup",mode:"math",body:[]},u[1]={type:"ordgroup",mode:"math",body:[]},!"=|.".includes(c))if("<>AV".includes(c))for(var f=0;f<2;f++){for(var m=!0,h=l+1;h<a.length;h++){if(n8(a[h],c)){m=!1,l=h;break}if(qd(a[h]))throw new ae("Missing a "+c+" character to complete a CD arrow.",a[h]);u[f].body.push(a[h])}if(m)throw new ae("Missing a "+c+" character to complete a CD arrow.",a[l])}else throw new ae('Expected one of "<>AV=|." after @',a[l]);var y=r8(c,u,e),b={type:"styling",body:[y],mode:"math",style:"display",resetFont:!0};r.push(b),o=Ud()}i%2===0?r.push(o):r.shift(),r=[],s.push(r)}e.gullet.endGroup(),e.gullet.endGroup();var S=new Array(s[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:s,arraystretch:1,addJot:!0,rowGaps:[null],cols:S,colSeparationType:"CD",hLinesBeforeRow:new Array(s.length+1).fill([])}}be({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],numArgs:1,handler(e,t){var{parser:n,funcName:r}=e;return{type:"cdlabel",mode:n.mode,side:r.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),r=si(ht(e.label,n,t),t);return r.classes.push("cd-label-"+e.side),r.style.bottom=ue(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,t){var n=new oe("mrow",[xt(e.label,t)]);return n=new oe("mpadded",[n]),n.setAttribute("width","0"),e.side==="left"&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),n=new oe("mstyle",[n]),n.setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}});be({type:"cdlabelparent",names:["\\\\cdparent"],numArgs:1,handler(e,t){var{parser:n}=e;return{type:"cdlabelparent",mode:n.mode,fragment:t[0]}},htmlBuilder(e,t){var n=si(ht(e.fragment,t),t);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder(e,t){return new oe("mrow",[xt(e.fragment,t)])}});be({type:"textord",names:["\\@char"],numArgs:1,allowedInText:!0,handler(e,t){for(var{parser:n}=e,r=Je(t[0],"ordgroup"),s=r.body,i="",a=0;a<s.length;a++){var o=Je(s[a],"textord");i+=o.text}var l=parseInt(i),c;if(isNaN(l))throw new ae("\\@char has non-numeric argument "+i);if(l<0||l>=1114111)throw new ae("\\@char with invalid code point "+i);return l<=65535?c=String.fromCharCode(l):(l-=65536,c=String.fromCharCode((l>>10)+55296,(l&1023)+56320)),{type:"textord",mode:n.mode,text:c}}});var i8=(e,t)=>{var n=tn(e.body,t.withColor(e.color),!1);return $r(n)},a8=(e,t)=>{var n=Mn(e.body,t.withColor(e.color)),r=new oe("mstyle",n);return r.setAttribute("mathcolor",e.color),r};be({type:"color",names:["\\textcolor"],numArgs:2,allowedInText:!0,argTypes:["color","original"],handler(e,t){var{parser:n}=e,r=Je(t[0],"color-token").color,s=t[1];return{type:"color",mode:n.mode,color:r,body:Gt(s)}},htmlBuilder:i8,mathmlBuilder:a8});be({type:"color",names:["\\color"],numArgs:1,allowedInText:!0,argTypes:["color"],handler(e,t){var{parser:n,breakOnTokenText:r}=e,s=Je(t[0],"color-token").color;n.gullet.macros.set("\\current@color",s);var i=n.parseExpression(!0,r);return{type:"color",mode:n.mode,color:s,body:i}}});be({type:"cr",names:["\\\\"],numArgs:0,numOptionalArgs:0,allowedInText:!0,handler(e,t,n){var{parser:r}=e,s=r.gullet.future().text==="["?r.parseSizeGroup(!0):null,i=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:i,size:s&&Je(s,"size").value}},htmlBuilder(e,t){var n=te(["mspace"],[],t);return e.newLine&&(n.classes.push("newline"),e.size&&(n.style.marginTop=ue(Mt(e.size,t)))),n},mathmlBuilder(e,t){var n=new oe("mspace");return e.newLine&&(n.setAttribute("linebreak","newline"),e.size&&n.setAttribute("height",ue(Mt(e.size,t)))),n}});var $c={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},Cm=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new ae("Expected a control sequence",e);return t},o8=e=>{var t=e.gullet.popToken();return t.text==="="&&(t=e.gullet.popToken(),t.text===" "&&(t=e.gullet.popToken())),t},Om=(e,t,n,r)=>{var s=e.gullet.macros.get(n.text);s==null&&(n.noexpand=!0,s={tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,s,r)};be({type:"internal",names:["\\global","\\long","\\\\globallong"],numArgs:0,allowedInText:!0,handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var r=t.fetch();if($c[r.text])return(n==="\\global"||n==="\\\\globallong")&&(r.text=$c[r.text]),Je(t.parseFunction(),"internal");throw new ae("Invalid token after macro prefix",r)}});be({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],numArgs:0,allowedInText:!0,primitive:!0,handler(e){var{parser:t,funcName:n}=e,r=t.gullet.popToken(),s=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(s))throw new ae("Expected a control sequence",r);for(var i=0,a,o=[[]];t.gullet.future().text!=="{";)if(r=t.gullet.popToken(),r.text==="#"){if(t.gullet.future().text==="{"){a=t.gullet.future(),o[i].push("{");break}if(r=t.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new ae('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==i+1)throw new ae('Argument number "'+r.text+'" out of order');i++,o.push([])}else{if(r.text==="EOF")throw new ae("Expected a macro definition");o[i].push(r.text)}var{tokens:l}=t.gullet.consumeArg();return a&&l.unshift(a),(n==="\\edef"||n==="\\xdef")&&(l=t.gullet.expandTokens(l),l.reverse()),t.gullet.macros.set(s,{tokens:l,numArgs:i,delimiters:o},n===$c[n]),{type:"internal",mode:t.mode}}});be({type:"internal",names:["\\let","\\\\globallet"],numArgs:0,allowedInText:!0,primitive:!0,handler(e){var{parser:t,funcName:n}=e,r=Cm(t.gullet.popToken());t.gullet.consumeSpaces();var s=o8(t);return Om(t,r,s,n==="\\\\globallet"),{type:"internal",mode:t.mode}}});be({type:"internal",names:["\\futurelet","\\\\globalfuture"],numArgs:0,allowedInText:!0,primitive:!0,handler(e){var{parser:t,funcName:n}=e,r=Cm(t.gullet.popToken()),s=t.gullet.popToken(),i=t.gullet.popToken();return Om(t,r,i,n==="\\\\globalfuture"),t.gullet.pushToken(i),t.gullet.pushToken(s),{type:"internal",mode:t.mode}}});var $i=function(t,n,r){var s=Rt.math[t]&&Rt.math[t].replace,i=$0(s||t,n,r);if(!i)throw new Error("Unsupported symbol "+t+" and font size "+n+".");return i},F0=function(t,n,r,s){var i=r.havingBaseStyle(n),a=te(s.concat(i.sizingClasses(r)),[t],r),o=i.sizeMultiplier/r.sizeMultiplier;return a.height*=o,a.depth*=o,a.maxFontSize=i.sizeMultiplier,a},Nm=function(t,n,r){var s=n.havingBaseStyle(r),i=(1-n.sizeMultiplier/s.sizeMultiplier)*n.fontMetrics().axisHeight;t.classes.push("delimcenter"),t.style.top=ue(i),t.height-=i,t.depth+=i},l8=function(t,n,r,s,i,a){var o=hn(t,"Main-Regular",i,s),l=F0(o,n,s,a);return Nm(l,s,n),l},c8=function(t,n,r,s){return hn(t,"Size"+n+"-Regular",r,s)},Mm=function(t,n,r,s,i,a){var o=c8(t,n,i,s),l=F0(te(["delimsizing","size"+n],[o],s),Ze.TEXT,s,a);return r&&Nm(l,s,Ze.TEXT),l},Ml=function(t,n,r){var s;n==="Size1-Regular"?s="delim-size1":s="delim-size4";var i=te(["delimsizinginner",s],[te([],[hn(t,n,r)])]);return{type:"elem",elem:i}},zl=function(t,n,r){var s=cr["Size4-Regular"][t.charCodeAt(0)]?cr["Size4-Regular"][t.charCodeAt(0)][4]:cr["Size1-Regular"][t.charCodeAt(0)][4],i=new is("inner",h7(t,Math.round(1e3*n))),a=new Cr([i],{width:ue(s),height:ue(n),style:"width:"+ue(s),viewBox:"0 0 "+1e3*s+" "+Math.round(1e3*n),preserveAspectRatio:"xMinYMin"}),o=as([],[a],r);return o.height=n,o.style.height=ue(n),o.style.width=ue(s),{type:"elem",elem:o}},Dc=.008,La={type:"kern",size:-1*Dc},u8=new Set(["|","\\lvert","\\rvert","\\vert"]),d8=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),zm=function(t,n,r,s,i,a){var o,l,c,u,f="",m=0;o=c=u=t,l=null;var h="Size1-Regular";t==="\\uparrow"?c=u="⏐":t==="\\Uparrow"?c=u="‖":t==="\\downarrow"?o=c="⏐":t==="\\Downarrow"?o=c="‖":t==="\\updownarrow"?(o="\\uparrow",c="⏐",u="\\downarrow"):t==="\\Updownarrow"?(o="\\Uparrow",c="‖",u="\\Downarrow"):u8.has(t)?(c="∣",f="vert",m=333):d8.has(t)?(c="∥",f="doublevert",m=556):t==="["||t==="\\lbrack"?(o="⎡",c="⎢",u="⎣",h="Size4-Regular",f="lbrack",m=667):t==="]"||t==="\\rbrack"?(o="⎤",c="⎥",u="⎦",h="Size4-Regular",f="rbrack",m=667):t==="\\lfloor"||t==="⌊"?(c=o="⎢",u="⎣",h="Size4-Regular",f="lfloor",m=667):t==="\\lceil"||t==="⌈"?(o="⎡",c=u="⎢",h="Size4-Regular",f="lceil",m=667):t==="\\rfloor"||t==="⌋"?(c=o="⎥",u="⎦",h="Size4-Regular",f="rfloor",m=667):t==="\\rceil"||t==="⌉"?(o="⎤",c=u="⎥",h="Size4-Regular",f="rceil",m=667):t==="("||t==="\\lparen"?(o="⎛",c="⎜",u="⎝",h="Size4-Regular",f="lparen",m=875):t===")"||t==="\\rparen"?(o="⎞",c="⎟",u="⎠",h="Size4-Regular",f="rparen",m=875):t==="\\{"||t==="\\lbrace"?(o="⎧",l="⎨",u="⎩",c="⎪",h="Size4-Regular"):t==="\\}"||t==="\\rbrace"?(o="⎫",l="⎬",u="⎭",c="⎪",h="Size4-Regular"):t==="\\lgroup"||t==="⟮"?(o="⎧",u="⎩",c="⎪",h="Size4-Regular"):t==="\\rgroup"||t==="⟯"?(o="⎫",u="⎭",c="⎪",h="Size4-Regular"):t==="\\lmoustache"||t==="⎰"?(o="⎧",u="⎭",c="⎪",h="Size4-Regular"):(t==="\\rmoustache"||t==="⎱")&&(o="⎫",u="⎩",c="⎪",h="Size4-Regular");var y=$i(o,h,i),b=y.height+y.depth,S=$i(c,h,i),k=S.height+S.depth,P=$i(u,h,i),z=P.height+P.depth,I=0,E=1;if(l!==null){var _=$i(l,h,i);I=_.height+_.depth,E=2}var L=b+z+I,N=Math.max(0,Math.ceil((n-L)/(E*k))),G=L+N*E*k,D=s.fontMetrics().axisHeight;r&&(D*=s.sizeMultiplier);var W=G/2-D,q=[];if(f.length>0){var X=G-b-z,ne=Math.round(G*1e3),he=p7(f,Math.round(X*1e3)),Ae=new is(f,he),se=ue(m/1e3),re=ue(ne/1e3),ze=new Cr([Ae],{width:se,height:re,viewBox:"0 0 "+m+" "+ne}),ie=as([],[ze],s);ie.height=ne/1e3,ie.style.width=se,ie.style.height=re,q.push({type:"elem",elem:ie})}else{if(q.push(Ml(u,h,i)),q.push(La),l===null){var je=G-b-z+2*Dc;q.push(zl(c,je,s))}else{var rt=(G-b-z-I)/2+2*Dc;q.push(zl(c,rt,s)),q.push(La),q.push(Ml(l,h,i)),q.push(La),q.push(zl(c,rt,s))}q.push(La),q.push(Ml(o,h,i))}var ot=s.havingBaseStyle(Ze.TEXT),Ft=dt({positionType:"bottom",positionData:W,children:q});return F0(te(["delimsizing","mult"],[Ft],ot),Ze.TEXT,s,a)},$l=80,Dl=.08,Pl=function(t,n,r,s,i){var a=f7(t,s,r),o=new is(t,a),l=new Cr([o],{width:"400em",height:ue(n),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return as(["hide-tail"],[l],i)},f8=function(t,n){var r=n.havingBaseSizing(),s=Lm("\\surd",t*r.sizeMultiplier,Bm,r),i=r.sizeMultiplier,a=Math.max(0,n.minRuleThickness-n.fontMetrics().sqrtRuleThickness),o,l,c,u,f;return s.type==="small"?(u=1e3+1e3*a+$l,t<1?i=1:t<1.4&&(i=.7),l=(1+a+Dl)/i,c=(1+a)/i,o=Pl("sqrtMain",l,u,a,n),o.style.minWidth="0.853em",f=.833/i):s.type==="large"?(u=(1e3+$l)*Hi[s.size],c=(Hi[s.size]+a)/i,l=(Hi[s.size]+a+Dl)/i,o=Pl("sqrtSize"+s.size,l,u,a,n),o.style.minWidth="1.02em",f=1/i):(l=t+a+Dl,c=t+a,u=Math.floor(1e3*t+a)+$l,o=Pl("sqrtTall",l,u,a,n),o.style.minWidth="0.742em",f=1.056),o.height=c,o.style.height=ue(l),{span:o,advanceWidth:f,ruleWidth:(n.fontMetrics().sqrtRuleThickness+a)*i}},$m=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),h8=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),Dm=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),Hi=[0,1.2,1.8,2.4,3],Pm=function(t,n,r,s,i){if(t==="<"||t==="\\lt"||t==="⟨"?t="\\langle":(t===">"||t==="\\gt"||t==="⟩")&&(t="\\rangle"),$m.has(t)||Dm.has(t))return Mm(t,n,!1,r,s,i);if(h8.has(t))return zm(t,Hi[n],!1,r,s,i);throw new ae("Illegal delimiter: '"+t+"'")},p8=[{type:"small",style:Ze.SCRIPTSCRIPT},{type:"small",style:Ze.SCRIPT},{type:"small",style:Ze.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],m8=[{type:"small",style:Ze.SCRIPTSCRIPT},{type:"small",style:Ze.SCRIPT},{type:"small",style:Ze.TEXT},{type:"stack"}],Bm=[{type:"small",style:Ze.SCRIPTSCRIPT},{type:"small",style:Ze.SCRIPT},{type:"small",style:Ze.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],g8=function(t){if(t.type==="small")return"Main-Regular";if(t.type==="large")return"Size"+t.size+"-Regular";if(t.type==="stack")return"Size4-Regular";var n=t.type;throw new Error("Add support for delim type '"+n+"' here.")},Lm=function(t,n,r,s){for(var i=Math.min(2,3-s.style.size),a=i;a<r.length;a++){var o=r[a];if(o.type==="stack")break;var l=$i(t,g8(o),"math"),c=l.height+l.depth;if(o.type==="small"){var u=s.havingBaseStyle(o.style);c*=u.sizeMultiplier}if(c>n)return o}return r[r.length-1]},Pc=function(t,n,r,s,i,a){t==="<"||t==="\\lt"||t==="⟨"?t="\\langle":(t===">"||t==="\\gt"||t==="⟩")&&(t="\\rangle");var o;Dm.has(t)?o=p8:$m.has(t)?o=Bm:o=m8;var l=Lm(t,n,o,s);return l.type==="small"?l8(t,l.style,r,s,i,a):l.type==="large"?Mm(t,l.size,r,s,i,a):zm(t,n,r,s,i,a)},Bl=function(t,n,r,s,i,a){var o=s.fontMetrics().axisHeight*s.sizeMultiplier,l=901,c=5/s.fontMetrics().ptPerEm,u=Math.max(n-o,r+o),f=Math.max(u/500*l,2*u-c);return Pc(t,f,!0,s,i,a)},Hd={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},v8=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."]);function Vd(e){return"isMiddle"in e}function Ko(e,t){var n=Go(e);if(n&&v8.has(n.text))return n;throw n?new ae("Invalid delimiter '"+n.text+"' after '"+t.funcName+"'",e):new ae("Invalid delimiter type '"+e.type+"'",e)}be({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],numArgs:1,argTypes:["primitive"],handler:(e,t)=>{var n=Ko(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:Hd[e.funcName].size,mclass:Hd[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>e.delim==="."?te([e.mclass]):Pm(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];e.delim!=="."&&t.push(Fn(e.delim,e.mode));var n=new oe("mo",t);e.mclass==="mopen"||e.mclass==="mclose"?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var r=ue(Hi[e.size]);return n.setAttribute("minsize",r),n.setAttribute("maxsize",r),n}});function jd(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}be({type:"leftright-right",names:["\\right"],numArgs:1,primitive:!0,handler:(e,t)=>{var n=e.parser.gullet.macros.get("\\current@color");if(n&&typeof n!="string")throw new ae("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:Ko(t[0],e).text,color:n}}});be({type:"leftright",names:["\\left"],numArgs:1,primitive:!0,handler:(e,t)=>{var n=Ko(t[0],e),r=e.parser;++r.leftrightDepth;var s=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var i=Je(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:s,left:n.text,right:i.delim,rightColor:i.color}},htmlBuilder:(e,t)=>{jd(e);for(var n=tn(e.body,t,!0,["mopen","mclose"]),r=0,s=0,i=!1,a=0;a<n.length;a++){var o=n[a];Vd(o)?i=!0:(r=Math.max(n[a].height,r),s=Math.max(n[a].depth,s))}r*=t.sizeMultiplier,s*=t.sizeMultiplier;var l;if(e.left==="."?l=ra(t,["mopen"]):l=Bl(e.left,r,s,t,e.mode,["mopen"]),n.unshift(l),i)for(var c=1;c<n.length;c++){var u=n[c];if(Vd(u)){var f=u.isMiddle;n[c]=Bl(f.delim,r,s,f.options,e.mode,[])}}var m;if(e.right===".")m=ra(t,["mclose"]);else{var h=e.rightColor?t.withColor(e.rightColor):t;m=Bl(e.right,r,s,h,e.mode,["mclose"])}return n.push(m),te(["minner"],n,t)},mathmlBuilder:(e,t)=>{jd(e);var n=Mn(e.body,t);if(e.left!=="."){var r=new oe("mo",[Fn(e.left,e.mode)]);r.setAttribute("fence","true"),n.unshift(r)}if(e.right!=="."){var s=new oe("mo",[Fn(e.right,e.mode)]);s.setAttribute("fence","true"),e.rightColor&&s.setAttribute("mathcolor",e.rightColor),n.push(s)}return B0(n)}});be({type:"middle",names:["\\middle"],numArgs:1,primitive:!0,handler:(e,t)=>{var n=Ko(t[0],e);if(!e.parser.leftrightDepth)throw new ae("\\middle without preceding \\left",n);return{type:"middle",mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;return e.delim==="."?n=ra(t,[]):(n=Pm(e.delim,1,t,e.mode,[]),n.isMiddle={delim:e.delim,options:t}),n},mathmlBuilder:(e,t)=>{var n=e.delim==="\\vert"||e.delim==="|"?Fn("|","text"):Fn(e.delim,e.mode),r=new oe("mo",[n]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var b8=(e,t)=>{var n=si(ht(e.body,t),t),r=e.label.slice(1),s=t.sizeMultiplier,i,a,o=Mr(e.body);if(r==="sout")i=te(["stretchy","sout"]),i.height=t.fontMetrics().defaultRuleThickness/s,a=-.5*t.fontMetrics().xHeight;else if(r==="phase"){var l=Mt({number:.6,unit:"pt"},t),c=Mt({number:.35,unit:"ex"},t),u=t.havingBaseSizing();s=s/u.sizeMultiplier;var f=n.height+n.depth+l+c;n.style.paddingLeft=ue(f/2+l);var m=Math.floor(1e3*f*s),h=u7(m),y=new Cr([new is("phase",h)],{width:"400em",height:ue(m/1e3),viewBox:"0 0 400000 "+m,preserveAspectRatio:"xMinYMin slice"});i=as(["hide-tail"],[y],t),i.style.height=ue(f),a=n.depth+l+c}else{/cancel/.test(r)?o||n.classes.push("cancel-pad"):r==="angl"?n.classes.push("anglpad"):n.classes.push("boxpad");var b,S,k=0;/box/.test(r)?(k=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),b=t.fontMetrics().fboxsep+(r==="colorbox"?0:k),S=b):r==="angl"?(k=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness),b=4*k,S=Math.max(0,.25-n.depth)):(b=o?.2:0,S=b),i=Z7(n,r,b,S,t),/fbox|boxed|fcolorbox/.test(r)?(i.style.borderStyle="solid",i.style.borderWidth=ue(k)):r==="angl"&&k!==.049&&(i.style.borderTopWidth=ue(k),i.style.borderRightWidth=ue(k)),a=n.depth+S,e.backgroundColor&&(i.style.backgroundColor=e.backgroundColor,e.borderColor&&(i.style.borderColor=e.borderColor))}var P;if(e.backgroundColor)P=dt({positionType:"individualShift",children:[{type:"elem",elem:i,shift:a},{type:"elem",elem:n,shift:0}]});else{var z=/cancel|phase/.test(r)?["svg-align"]:[];P=dt({positionType:"individualShift",children:[{type:"elem",elem:n,shift:0},{type:"elem",elem:i,shift:a,wrapperClasses:z}]})}return/cancel/.test(r)&&(P.height=n.height,P.depth=n.depth),/cancel/.test(r)&&!o?te(["mord","cancel-lap"],[P],t):te(["mord"],[P],t)},y8=(e,t)=>{var n,r=new oe(e.label.includes("colorbox")?"mpadded":"menclose",[xt(e.body,t)]);switch(e.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*n+"pt"),r.setAttribute("height","+"+2*n+"pt"),r.setAttribute("lspace",n+"pt"),r.setAttribute("voffset",n+"pt"),e.label==="\\fcolorbox"){var s=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);r.setAttribute("style","border: "+ue(s)+" solid "+e.borderColor)}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return e.backgroundColor&&r.setAttribute("mathbackground",e.backgroundColor),r};be({type:"enclose",names:["\\colorbox"],numArgs:2,allowedInText:!0,argTypes:["color","hbox"],handler(e,t,n){var{parser:r,funcName:s}=e,i=Je(t[0],"color-token").color,a=t[1];return{type:"enclose",mode:r.mode,label:s,backgroundColor:i,body:a}},htmlBuilder:b8,mathmlBuilder:y8});be({type:"enclose",names:["\\fcolorbox"],numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"],handler(e,t,n){var{parser:r,funcName:s}=e,i=Je(t[0],"color-token").color,a=Je(t[1],"color-token").color,o=t[2];return{type:"enclose",mode:r.mode,label:s,backgroundColor:a,borderColor:i,body:o}}});be({type:"enclose",names:["\\fbox"],numArgs:1,argTypes:["hbox"],allowedInText:!0,handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\fbox",body:t[0]}}});be({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],numArgs:1,handler(e,t){var{parser:n,funcName:r}=e,s=t[0];return{type:"enclose",mode:n.mode,label:r,body:s}}});be({type:"enclose",names:["\\sout"],numArgs:1,allowedInText:!0,handler(e,t){var{parser:n,funcName:r}=e;n.mode==="math"&&n.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var s=t[0];return{type:"enclose",mode:n.mode,label:r,body:s}}});be({type:"enclose",names:["\\angl"],numArgs:1,argTypes:["hbox"],allowedInText:!1,handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\angl",body:t[0]}}});var Fm={};function mr(e){for(var{type:t,names:n,props:r,handler:s,htmlBuilder:i,mathmlBuilder:a}=e,o={type:t,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:s},l=0;l<n.length;++l)Fm[n[l]]=o;i&&(ta[t]=i),a&&(na[t]=a)}var Um={};function w(e,t){Um[e]=t}class wn{constructor(t,n,r){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=t,this.start=n,this.end=r}static range(t,n){return n?!t||!t.loc||!n.loc||t.loc.lexer!==n.loc.lexer?null:new wn(t.loc.lexer,t.loc.start,n.loc.end):t&&t.loc}}class Rn{constructor(t,n){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=t,this.loc=n}range(t,n){return new Rn(n,wn.range(this,t))}}function Gd(e){var t=[];e.consumeSpaces();var n=e.fetch().text;for(n==="\\relax"&&(e.consume(),e.consumeSpaces(),n=e.fetch().text);n==="\\hline"||n==="\\hdashline";)e.consume(),t.push(n==="\\hdashline"),e.consumeSpaces(),n=e.fetch().text;return t}var Wo=e=>{var t=e.parser.settings;if(!t.displayMode)throw new ae("{"+e.envName+"} can be used only in display mode.")},w8=new Set(["gather","gather*"]);function U0(e){if(!e.includes("ed"))return!e.includes("*")}function hs(e,t,n){var{hskipBeforeAndAfter:r,addJot:s,cols:i,arraystretch:a,colSeparationType:o,autoTag:l,singleRow:c,emptySingleRow:u,maxNumCols:f,leqno:m}=t;if(e.gullet.beginGroup(),c||e.gullet.macros.set("\\cr","\\\\\\relax"),!a){var h=e.gullet.expandMacroAsText("\\arraystretch");if(h==null)a=1;else if(a=parseFloat(h),!a||a<0)throw new ae("Invalid \\arraystretch: "+h)}e.gullet.beginGroup();var y=[],b=[y],S=[],k=[],P=l!=null?[]:void 0;function z(){l&&e.gullet.macros.set("\\@eqnsw","1",!0)}function I(){P&&(e.gullet.macros.get("\\df@tag")?(P.push(e.subparse([new Rn("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):P.push(!!l&&e.gullet.macros.get("\\@eqnsw")==="1"))}for(z(),k.push(Gd(e));;){var E=e.parseExpression(!1,c?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup();var _={type:"ordgroup",mode:e.mode,body:E};n&&(_={type:"styling",mode:e.mode,style:n,resetFont:!0,body:[_]}),y.push(_);var L=e.fetch().text;if(L==="&"){if(f&&y.length===f){if(c||o)throw new ae("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else if(L==="\\end"){I(),y.length===1&&_.type==="styling"&&_.body.length===1&&_.body[0].type==="ordgroup"&&_.body[0].body.length===0&&(b.length>1||!u)&&b.pop(),k.length<b.length+1&&k.push([]);break}else if(L==="\\\\"){e.consume();var N=void 0;e.gullet.future().text!==" "&&(N=e.parseSizeGroup(!0)),S.push(N?N.value:null),I(),k.push(Gd(e)),y=[],b.push(y),z()}else throw new ae("Expected & or \\\\ or \\cr or \\end",e.nextToken)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:e.mode,addJot:s,arraystretch:a,body:b,cols:i,rowGaps:S,hskipBeforeAndAfter:r,hLinesBeforeRow:k,colSeparationType:o,tags:P,leqno:m}}function q0(e){return e.slice(0,1)==="d"?"display":"text"}var gr=function(t,n){var r,s,i=t.body.length,a=t.hLinesBeforeRow,o=0,l=new Array(i),c=[],u=Math.max(n.fontMetrics().arrayRuleWidth,n.minRuleThickness),f=1/n.fontMetrics().ptPerEm,m=5*f;if(t.colSeparationType&&t.colSeparationType==="small"){var h=n.havingStyle(Ze.SCRIPT).sizeMultiplier;m=.2778*(h/n.sizeMultiplier)}var y=t.colSeparationType==="CD"?Mt({number:3,unit:"ex"},n):12*f,b=3*f,S=t.arraystretch*y,k=.7*S,P=.3*S,z=0;function I(F){for(var U=0;U<F.length;++U)U>0&&(z+=.25),c.push({pos:z,isDashed:F[U]})}for(I(a[0]),r=0;r<t.body.length;++r){var E=t.body[r],_=k,L=P;o<E.length&&(o=E.length);var N={cells:new Array(E.length),height:0,depth:0,pos:0};for(s=0;s<E.length;++s){var G=ht(E[s],n);L<G.depth&&(L=G.depth),_<G.height&&(_=G.height),N.cells[s]=G}var D=t.rowGaps[r],W=0;D&&(W=Mt(D,n),W>0&&(W+=P,L<W&&(L=W),W=0)),t.addJot&&r<t.body.length-1&&(L+=b),N.height=_,N.depth=L,z+=_,N.pos=z,z+=L+W,l[r]=N,I(a[r+1])}var q=z/2+n.fontMetrics().axisHeight,X=t.cols||[],ne=[],he,Ae,se=[];if(t.tags&&t.tags.some(F=>F))for(r=0;r<i;++r){var re=l[r],ze=re.pos-q,ie=t.tags[r],je=void 0;ie===!0?je=te(["eqn-num"],[],n):ie===!1?je=te([],[],n):je=te([],tn(ie,n,!0),n),je.depth=re.depth,je.height=re.height,se.push({type:"elem",elem:je,shift:ze})}for(s=0,Ae=0;s<o||Ae<X.length;++s,++Ae){for(var rt,ot=X[Ae],Ft=!0;((st=ot)==null?void 0:st.type)==="separator";){var st;if(Ft||(he=te(["arraycolsep"],[]),he.style.width=ue(n.fontMetrics().doubleRuleSep),ne.push(he)),ot.separator==="|"||ot.separator===":"){var at=ot.separator==="|"?"solid":"dashed",C=te(["vertical-separator"],[],n);C.style.height=ue(z),C.style.borderRightWidth=ue(u),C.style.borderRightStyle=at,C.style.margin="0 "+ue(-u/2);var le=z-q;le&&(C.style.verticalAlign=ue(-le)),ne.push(C)}else throw new ae("Invalid separator type: "+ot.separator);Ae++,ot=X[Ae],Ft=!1}if(!(s>=o)){var Q=void 0;if(s>0||t.hskipBeforeAndAfter){var de,Ie;Q=(de=(Ie=ot)==null?void 0:Ie.pregap)!=null?de:m,Q!==0&&(he=te(["arraycolsep"],[]),he.style.width=ue(Q),ne.push(he))}var Ge=[];for(r=0;r<i;++r){var Be=l[r],Te=Be.cells[s];if(Te){var yt=Be.pos-q;Te.depth=Be.depth,Te.height=Be.height,Ge.push({type:"elem",elem:Te,shift:yt})}}var Ye=dt({positionType:"individualShift",children:Ge}),Tt=te(["col-align-"+(((rt=ot)==null?void 0:rt.align)||"c")],[Ye]);if(ne.push(Tt),s<o-1||t.hskipBeforeAndAfter){var bn,Yn;Q=(bn=(Yn=ot)==null?void 0:Yn.postgap)!=null?bn:m,Q!==0&&(he=te(["arraycolsep"],[]),he.style.width=ue(Q),ne.push(he))}}}var br=te(["mtable"],ne);if(c.length>0){for(var Si=ri("hline",n,u),xi=ri("hdashline",n,u),Lr=[{type:"elem",elem:br,shift:0}];c.length>0;){var zn=c.pop(),vs=zn.pos-q;zn.isDashed?Lr.push({type:"elem",elem:xi,shift:vs}):Lr.push({type:"elem",elem:Si,shift:vs})}br=dt({positionType:"individualShift",children:Lr})}if(se.length===0)return te(["mord"],[br],n);var Xn=dt({positionType:"individualShift",children:se}),V=te(["tag"],[Xn],n);return $r([br,V])},S8={c:"center ",l:"left ",r:"right "},vr=function(t,n){for(var r=[],s=new oe("mtd",[],["mtr-glue"]),i=new oe("mtd",[],["mml-eqn-num"]),a=0;a<t.body.length;a++){for(var o=t.body[a],l=[],c=0;c<o.length;c++)l.push(new oe("mtd",[xt(o[c],n)]));t.tags&&t.tags[a]&&(l.unshift(s),l.push(s),t.leqno?l.unshift(i):l.push(i)),r.push(new oe("mtr",l))}var u=new oe("mtable",r),f=t.arraystretch===.5?.1:.16+t.arraystretch-1+(t.addJot?.09:0);u.setAttribute("rowspacing",ue(f));var m="",h="";if(t.cols&&t.cols.length>0){var y=t.cols,b="",S=!1,k=0,P=y.length;y[0].type==="separator"&&(m+="top ",k=1),y[y.length-1].type==="separator"&&(m+="bottom ",P-=1);for(var z=k;z<P;z++){var I=y[z];I.type==="align"?(h+=S8[I.align],S&&(b+="none "),S=!0):I.type==="separator"&&S&&(b+=I.separator==="|"?"solid ":"dashed ",S=!1)}u.setAttribute("columnalign",h.trim()),/[sd]/.test(b)&&u.setAttribute("columnlines",b.trim())}if(t.colSeparationType==="align"){for(var E=t.cols||[],_="",L=1;L<E.length;L++)_+=L%2?"0em ":"1em ";u.setAttribute("columnspacing",_.trim())}else t.colSeparationType==="alignat"||t.colSeparationType==="gather"?u.setAttribute("columnspacing","0em"):t.colSeparationType==="small"?u.setAttribute("columnspacing","0.2778em"):t.colSeparationType==="CD"?u.setAttribute("columnspacing","0.5em"):u.setAttribute("columnspacing","1em");var N="",G=t.hLinesBeforeRow;m+=G[0].length>0?"left ":"",m+=G[G.length-1].length>0?"right ":"";for(var D=1;D<G.length-1;D++)N+=G[D].length===0?"none ":G[D][0]?"dashed ":"solid ";return/[sd]/.test(N)&&u.setAttribute("rowlines",N.trim()),m!==""&&(u=new oe("menclose",[u]),u.setAttribute("notation",m.trim())),t.arraystretch&&t.arraystretch<1&&(u=new oe("mstyle",[u]),u.setAttribute("scriptlevel","1")),u},qm=function(t,n){t.envName.includes("ed")||Wo(t);var r=[],s=t.envName==="split",i=hs(t.parser,{cols:r,addJot:!0,autoTag:s?void 0:U0(t.envName),emptySingleRow:!0,colSeparationType:t.envName.includes("at")?"alignat":"align",maxNumCols:s?2:void 0,leqno:t.parser.settings.leqno},"display"),a=0,o=0,l={type:"ordgroup",mode:t.mode,body:[]};if(n[0]&&n[0].type==="ordgroup"){for(var c="",u=0;u<n[0].body.length;u++){var f=Je(n[0].body[u],"textord");c+=f.text}a=Number(c),o=a*2}var m=!o;i.body.forEach(function(S){for(var k=1;k<S.length;k+=2){var P=Je(S[k],"styling"),z=Je(P.body[0],"ordgroup");z.body.unshift(l)}if(m)o<S.length&&(o=S.length);else{var I=S.length/2;if(a<I)throw new ae("Too many math in a row: "+("expected "+a+", but got "+I),S[0])}});for(var h=0;h<o;++h){var y="r",b=0;h%2===1?y="l":h>0&&m&&(b=1),r[h]={type:"align",align:y,pregap:b,postgap:0}}return i.colSeparationType=m?"align":"alignat",i};mr({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){var n=Go(t[0]),r=n?[t[0]]:Je(t[0],"ordgroup").body,s=r.map(function(a){var o=jo(a),l=o.text;if("lcr".includes(l))return{type:"align",align:l};if(l==="|")return{type:"separator",separator:"|"};if(l===":")return{type:"separator",separator:":"};throw new ae("Unknown column alignment: "+l,a)}),i={cols:s,hskipBeforeAndAfter:!0,maxNumCols:s.length};return hs(e.parser,i,q0(e.envName))},htmlBuilder:gr,mathmlBuilder:vr});mr({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],n="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if(e.envName.charAt(e.envName.length-1)==="*"){var s=e.parser;if(s.consumeSpaces(),s.fetch().text==="["){if(s.consume(),s.consumeSpaces(),n=s.fetch().text,!"lcr".includes(n))throw new ae("Expected l or c or r",s.nextToken);s.consume(),s.consumeSpaces(),s.expect("]"),s.consume(),r.cols=[{type:"align",align:n}]}}var i=hs(e.parser,r,q0(e.envName)),a=Math.max(0,...i.body.map(o=>o.length));return i.cols=new Array(a).fill({type:"align",align:n}),t?{type:"leftright",mode:e.mode,body:[i],left:t[0],right:t[1],rightColor:void 0}:i},htmlBuilder:gr,mathmlBuilder:vr});mr({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var t={arraystretch:.5},n=hs(e.parser,t,"script");return n.colSeparationType="small",n},htmlBuilder:gr,mathmlBuilder:vr});mr({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){var n=Go(t[0]),r=n?[t[0]]:Je(t[0],"ordgroup").body,s=r.map(function(o){var l=jo(o),c=l.text;if("lc".includes(c))return{type:"align",align:c};throw new ae("Unknown column alignment: "+c,o)});if(s.length>1)throw new ae("{subarray} can contain only one column");var i={cols:s,hskipBeforeAndAfter:!1,arraystretch:.5},a=hs(e.parser,i,"script");if(a.body.length>0&&a.body[0].length>1)throw new ae("{subarray} can contain only one column");return a},htmlBuilder:gr,mathmlBuilder:vr});mr({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var t={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},n=hs(e.parser,t,q0(e.envName));return{type:"leftright",mode:e.mode,body:[n],left:e.envName.includes("r")?".":"\\{",right:e.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:gr,mathmlBuilder:vr});mr({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:qm,htmlBuilder:gr,mathmlBuilder:vr});mr({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){w8.has(e.envName)&&Wo(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:U0(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return hs(e.parser,t,"display")},htmlBuilder:gr,mathmlBuilder:vr});mr({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:qm,htmlBuilder:gr,mathmlBuilder:vr});mr({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){Wo(e);var t={autoTag:U0(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return hs(e.parser,t,"display")},htmlBuilder:gr,mathmlBuilder:vr});mr({type:"array",names:["CD"],props:{numArgs:0},handler(e){return Wo(e),s8(e.parser)},htmlBuilder:gr,mathmlBuilder:vr});w("\\nonumber","\\gdef\\@eqnsw{0}");w("\\notag","\\nonumber");be({type:"text",names:["\\hline","\\hdashline"],numArgs:0,allowedInText:!0,allowedInMath:!0,handler(e,t){throw new ae(e.funcName+" valid only within array environment")}});var Zd=Fm;be({type:"environment",names:["\\begin","\\end"],numArgs:1,argTypes:["text"],handler(e,t){var{parser:n,funcName:r}=e,s=t[0];if(s.type!=="ordgroup")throw new ae("Invalid environment name",s);for(var i="",a=0;a<s.body.length;++a)i+=Je(s.body[a],"textord").text;if(r==="\\begin"){if(!Zd.hasOwnProperty(i))throw new ae("No such environment: "+i,s);var o=Zd[i],{args:l,optArgs:c}=n.parseArguments("\\begin{"+i+"}",o),u={mode:n.mode,envName:i,parser:n},f=o.handler(u,l,c);n.expect("\\end",!1);var m=n.nextToken,h=Je(n.parseFunction(),"environment");if(h.name!==i)throw new ae("Mismatch: \\begin{"+i+"} matched by \\end{"+h.name+"}",m);return f}return{type:"environment",mode:n.mode,name:i,nameGroup:s}}});var x8=(e,t)=>{var n=e.font,r=t.withFont(n);return ht(e.body,r)},k8=(e,t)=>{var n=e.font,r=t.withFont(n);return xt(e.body,r)},Kd={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};be({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],numArgs:1,allowedInArgument:!0,handler:(e,t)=>{var{parser:n,funcName:r}=e,s=wo(t[0]),i=r in Kd?Kd[r]:r;return{type:"font",mode:n.mode,font:i.slice(1),body:s}},htmlBuilder:x8,mathmlBuilder:k8});be({type:"mclass",names:["\\boldsymbol","\\bm"],numArgs:1,handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"mclass",mode:n.mode,mclass:Zo(r),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:r}],isCharacterBox:Mr(r)}}});be({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],numArgs:0,allowedInText:!0,handler:(e,t)=>{var{parser:n,funcName:r,breakOnTokenText:s}=e,{mode:i}=n,a=n.parseExpression(!0,s);return{type:"font",mode:i,font:"math"+r.slice(1),body:{type:"ordgroup",mode:n.mode,body:a}}}});var _8=(e,t)=>{var n=t.style,r=n.fracNum(),s=n.fracDen(),i;i=t.havingStyle(r);var a=ht(e.numer,i,t);if(e.continued){var o=8.5/t.fontMetrics().ptPerEm,l=3.5/t.fontMetrics().ptPerEm;a.height=a.height<o?o:a.height,a.depth=a.depth<l?l:a.depth}i=t.havingStyle(s);var c=ht(e.denom,i,t),u,f,m;e.hasBarLine?(e.barSize?(f=Mt(e.barSize,t),u=ri("frac-line",t,f)):u=ri("frac-line",t),f=u.height,m=u.height):(u=null,f=0,m=t.fontMetrics().defaultRuleThickness);var h,y,b;n.size===Ze.DISPLAY.size?(h=t.fontMetrics().num1,f>0?y=3*m:y=7*m,b=t.fontMetrics().denom1):(f>0?(h=t.fontMetrics().num2,y=m):(h=t.fontMetrics().num3,y=3*m),b=t.fontMetrics().denom2);var S;if(u){var P=t.fontMetrics().axisHeight;h-a.depth-(P+.5*f)<y&&(h+=y-(h-a.depth-(P+.5*f))),P-.5*f-(c.height-b)<y&&(b+=y-(P-.5*f-(c.height-b)));var z=-(P-.5*f);S=dt({positionType:"individualShift",children:[{type:"elem",elem:c,shift:b},{type:"elem",elem:u,shift:z},{type:"elem",elem:a,shift:-h}]})}else{var k=h-a.depth-(c.height-b);k<y&&(h+=.5*(y-k),b+=.5*(y-k)),S=dt({positionType:"individualShift",children:[{type:"elem",elem:c,shift:b},{type:"elem",elem:a,shift:-h}]})}i=t.havingStyle(n),S.height*=i.sizeMultiplier/t.sizeMultiplier,S.depth*=i.sizeMultiplier/t.sizeMultiplier;var I;n.size===Ze.DISPLAY.size?I=t.fontMetrics().delim1:n.size===Ze.SCRIPTSCRIPT.size?I=t.havingStyle(Ze.SCRIPT).fontMetrics().delim2:I=t.fontMetrics().delim2;var E,_;return e.leftDelim==null?E=ra(t,["mopen"]):E=Pc(e.leftDelim,I,!0,t.havingStyle(n),e.mode,["mopen"]),e.continued?_=te([]):e.rightDelim==null?_=ra(t,["mclose"]):_=Pc(e.rightDelim,I,!0,t.havingStyle(n),e.mode,["mclose"]),te(["mord"].concat(i.sizingClasses(t)),[E,te(["mfrac"],[S]),_],t)},E8=(e,t)=>{var n=new oe("mfrac",[xt(e.numer,t),xt(e.denom,t)]);if(!e.hasBarLine)n.setAttribute("linethickness","0px");else if(e.barSize){var r=Mt(e.barSize,t);n.setAttribute("linethickness",ue(r))}if(e.leftDelim!=null||e.rightDelim!=null){var s=[];if(e.leftDelim!=null){var i=new oe("mo",[new Zt(e.leftDelim.replace("\\",""))]);i.setAttribute("fence","true"),s.push(i)}if(s.push(n),e.rightDelim!=null){var a=new oe("mo",[new Zt(e.rightDelim.replace("\\",""))]);a.setAttribute("fence","true"),s.push(a)}return B0(s)}return n},Hm=(e,t)=>{if(!t)return e;var n={type:"styling",mode:e.mode,style:t,body:[e]};return n};be({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],numArgs:2,allowedInArgument:!0,handler:(e,t)=>{var{parser:n,funcName:r}=e,s=t[0],i=t[1],a,o=null,l=null;switch(r){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":a=!0;break;case"\\\\atopfrac":a=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":a=!1,o="(",l=")";break;case"\\\\bracefrac":a=!1,o="\\{",l="\\}";break;case"\\\\brackfrac":a=!1,o="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}var c=r==="\\cfrac",u=null;return c||r.startsWith("\\d")?u="display":r.startsWith("\\t")&&(u="text"),Hm({type:"genfrac",mode:n.mode,numer:s,denom:i,continued:c,hasBarLine:a,leftDelim:o,rightDelim:l,barSize:null},u)},htmlBuilder:_8,mathmlBuilder:E8});be({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],numArgs:0,infix:!0,handler(e){var{parser:t,funcName:n,token:r}=e,s;switch(n){case"\\over":s="\\frac";break;case"\\choose":s="\\binom";break;case"\\atop":s="\\\\atopfrac";break;case"\\brace":s="\\\\bracefrac";break;case"\\brack":s="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:t.mode,replaceWith:s,token:r}}});var Wd=["display","text","script","scriptscript"],Qd=function(t){var n=null;return t.length>0&&(n=t,n=n==="."?null:n),n};be({type:"genfrac",names:["\\genfrac"],numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"],handler(e,t){var{parser:n}=e,r=t[4],s=t[5],i=wo(t[0]),a=i.type==="atom"&&i.family==="open"?Qd(i.text):null,o=wo(t[1]),l=o.type==="atom"&&o.family==="close"?Qd(o.text):null,c=Je(t[2],"size"),u,f=null;c.isBlank?u=!0:(f=c.value,u=f.number>0);var m=null,h=t[3];if(h.type==="ordgroup"){if(h.body.length>0){var y=Je(h.body[0],"textord");m=Wd[Number(y.text)]}}else h=Je(h,"textord"),m=Wd[Number(h.text)];return Hm({type:"genfrac",mode:n.mode,numer:r,denom:s,continued:!1,hasBarLine:u,barSize:f,leftDelim:a,rightDelim:l},m)}});be({type:"infix",names:["\\above"],numArgs:1,argTypes:["size"],infix:!0,handler(e,t){var{parser:n,funcName:r,token:s}=e;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:Je(t[0],"size").value,token:s}}});be({type:"genfrac",names:["\\\\abovefrac"],numArgs:3,argTypes:["math","size","math"],handler:(e,t)=>{var{parser:n,funcName:r}=e,s=t[0],i=Je(t[1],"infix").size;if(!i)throw new Error("\\\\abovefrac expected size, but got "+String(i));var a=t[2],o=i.number>0;return{type:"genfrac",mode:n.mode,numer:s,denom:a,continued:!1,hasBarLine:o,barSize:i,leftDelim:null,rightDelim:null}}});var Vm=(e,t)=>{var n=t.style,r,s;e.type==="supsub"?(r=e.sup?ht(e.sup,t.havingStyle(n.sup()),t):ht(e.sub,t.havingStyle(n.sub()),t),s=Je(e.base,"horizBrace")):s=Je(e,"horizBrace");var i=ht(s.base,t.havingBaseStyle(Ze.DISPLAY)),a=Vo(s,t),o;if(s.isOver?o=dt({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:.1},{type:"elem",elem:a,wrapperClasses:["svg-align"]}]}):o=dt({positionType:"bottom",positionData:i.depth+.1+a.height,children:[{type:"elem",elem:a,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:i}]}),r){var l=te(["minner",s.isOver?"mover":"munder"],[o],t);s.isOver?o=dt({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:r}]}):o=dt({positionType:"bottom",positionData:l.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:l}]})}return te(["minner",s.isOver?"mover":"munder"],[o],t)},A8=(e,t)=>{var n=Ho(e.label);return new oe(e.isOver?"mover":"munder",[xt(e.base,t),n])};be({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],numArgs:1,handler(e,t){var{parser:n,funcName:r}=e;return{type:"horizBrace",mode:n.mode,label:r,isOver:r.includes("\\over"),base:t[0]}},htmlBuilder:Vm,mathmlBuilder:A8});be({type:"href",names:["\\href"],numArgs:2,argTypes:["url","original"],allowedInText:!0,handler:(e,t)=>{var{parser:n}=e,r=t[1],s=Je(t[0],"url").url;return n.settings.isTrusted({command:"\\href",url:s})?{type:"href",mode:n.mode,href:s,body:Gt(r)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(e,t)=>{var n=tn(e.body,t,!1);return C7(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=os(e.body,t);return n instanceof oe||(n=new oe("mrow",[n])),n.setAttribute("href",e.href),n}});be({type:"href",names:["\\url"],numArgs:1,argTypes:["url"],allowedInText:!0,handler:(e,t)=>{var{parser:n}=e,r=Je(t[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:r}))return n.formatUnsupportedCmd("\\url");for(var s=[],i=0;i<r.length;i++){var a=r[i];a==="~"&&(a="\\textasciitilde"),s.push({type:"textord",mode:"text",text:a})}var o={type:"text",mode:n.mode,font:"\\texttt",body:s};return{type:"href",mode:n.mode,href:r,body:Gt(o)}}});be({type:"hbox",names:["\\hbox"],numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0,handler(e,t){var{parser:n}=e;return{type:"hbox",mode:n.mode,body:Gt(t[0])}},htmlBuilder(e,t){var n=tn(e.body,t.withFont(""),!1);return $r(n)},mathmlBuilder(e,t){return new oe("mrow",Mn(e.body,t.withFont("")))}});be({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],numArgs:2,argTypes:["raw","original"],allowedInText:!0,handler:(e,t)=>{var{parser:n,funcName:r,token:s}=e,i=Je(t[0],"raw").string,a=t[1];n.settings.strict&&n.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var o,l={};switch(r){case"\\htmlClass":l.class=i,o={command:"\\htmlClass",class:i};break;case"\\htmlId":l.id=i,o={command:"\\htmlId",id:i};break;case"\\htmlStyle":l.style=i,o={command:"\\htmlStyle",style:i};break;case"\\htmlData":{for(var c=i.split(","),u=0;u<c.length;u++){var f=c[u],m=f.indexOf("=");if(m<0)throw new ae("\\htmlData key/value '"+f+"' missing equals sign");var h=f.slice(0,m),y=f.slice(m+1);l["data-"+h.trim()]=y}o={command:"\\htmlData",attributes:l};break}default:throw new Error("Unrecognized html command")}return n.settings.isTrusted(o)?{type:"html",mode:n.mode,attributes:l,body:Gt(a)}:n.formatUnsupportedCmd(r)},htmlBuilder:(e,t)=>{var n=tn(e.body,t,!1),r=["enclosing"];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var s=te(r,n,t);for(var i in e.attributes)i!=="class"&&e.attributes.hasOwnProperty(i)&&s.setAttribute(i,e.attributes[i]);return s},mathmlBuilder:(e,t)=>os(e.body,t)});be({type:"htmlmathml",names:["\\html@mathml"],numArgs:2,allowedInArgument:!0,allowedInText:!0,handler:(e,t)=>{var{parser:n}=e;return{type:"htmlmathml",mode:n.mode,html:Gt(t[0]),mathml:Gt(t[1])}},htmlBuilder:(e,t)=>{var n=tn(e.html,t,!1);return $r(n)},mathmlBuilder:(e,t)=>os(e.mathml,t)});var Ll=function(t){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(t))return{number:+t,unit:"bp"};var n=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t);if(!n)throw new ae("Invalid size: '"+t+"' in \\includegraphics");var r={number:+(n[1]+n[2]),unit:n[3]};if(!hm(r))throw new ae("Invalid unit: '"+r.unit+"' in \\includegraphics.");return r};be({type:"includegraphics",names:["\\includegraphics"],numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1,handler:(e,t,n)=>{var{parser:r}=e,s={number:0,unit:"em"},i={number:.9,unit:"em"},a={number:0,unit:"em"},o="";if(n[0])for(var l=Je(n[0],"raw").string,c=l.split(","),u=0;u<c.length;u++){var f=c[u].split("=");if(f.length===2){var m=f[1].trim();switch(f[0].trim()){case"alt":o=m;break;case"width":s=Ll(m);break;case"height":i=Ll(m);break;case"totalheight":a=Ll(m);break;default:throw new ae("Invalid key: '"+f[0]+"' in \\includegraphics.")}}}var h=Je(t[0],"url").url;return o===""&&(o=h,o=o.replace(/^.*[\\/]/,""),o=o.substring(0,o.lastIndexOf("."))),r.settings.isTrusted({command:"\\includegraphics",url:h})?{type:"includegraphics",mode:r.mode,alt:o,width:s,height:i,totalheight:a,src:h}:r.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(e,t)=>{var n=Mt(e.height,t),r=0;e.totalheight.number>0&&(r=Mt(e.totalheight,t)-n);var s=0;e.width.number>0&&(s=Mt(e.width,t));var i={height:ue(n+r)};s>0&&(i.width=ue(s)),r>0&&(i.verticalAlign=ue(-r));var a=new b7(e.src,e.alt,i);return a.height=n,a.depth=r,a},mathmlBuilder:(e,t)=>{var n=new oe("mglyph",[]);n.setAttribute("alt",e.alt);var r=Mt(e.height,t),s=0;if(e.totalheight.number>0&&(s=Mt(e.totalheight,t)-r,n.setAttribute("valign",ue(-s))),n.setAttribute("height",ue(r+s)),e.width.number>0){var i=Mt(e.width,t);n.setAttribute("width",ue(i))}return n.setAttribute("src",e.src),n}});be({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0,handler(e,t){var{parser:n,funcName:r}=e,s=Je(t[0],"size");if(n.settings.strict){var i=r[1]==="m",a=s.value.unit==="mu";i?(a||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, "+("not "+s.value.unit+" units")),n.mode!=="math"&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):a&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:s.value}},htmlBuilder(e,t){return ym(e.dimension,t)},mathmlBuilder(e,t){var n=Mt(e.dimension,t);return new Em(n)}});be({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],numArgs:1,allowedInText:!0,handler:(e,t)=>{var{parser:n,funcName:r}=e,s=t[0];return{type:"lap",mode:n.mode,alignment:r.slice(5),body:s}},htmlBuilder:(e,t)=>{var n;e.alignment==="clap"?(n=te([],[ht(e.body,t)]),n=te(["inner"],[n],t)):n=te(["inner"],[ht(e.body,t)]);var r=te(["fix"],[]),s=te([e.alignment],[n,r],t),i=te(["strut"]);return i.style.height=ue(s.height+s.depth),s.depth&&(i.style.verticalAlign=ue(-s.depth)),s.children.unshift(i),s=te(["thinbox"],[s],t),te(["mord","vbox"],[s],t)},mathmlBuilder:(e,t)=>{var n=new oe("mpadded",[xt(e.body,t)]);if(e.alignment!=="rlap"){var r=e.alignment==="llap"?"-1":"-0.5";n.setAttribute("lspace",r+"width")}return n.setAttribute("width","0px"),n}});be({type:"styling",names:["\\(","$"],numArgs:0,allowedInText:!0,allowedInMath:!1,handler(e,t){var{funcName:n,parser:r}=e,s=r.mode;r.switchMode("math");var i=n==="\\("?"\\)":"$",a=r.parseExpression(!1,i);return r.expect(i),r.switchMode(s),{type:"styling",mode:r.mode,style:"text",resetFont:!0,body:a}}});be({type:"text",names:["\\)","\\]"],numArgs:0,allowedInText:!0,allowedInMath:!1,handler(e,t){throw new ae("Mismatched "+e.funcName)}});var Jd=(e,t)=>{switch(t.style.size){case Ze.DISPLAY.size:return e.display;case Ze.TEXT.size:return e.text;case Ze.SCRIPT.size:return e.script;case Ze.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};be({type:"mathchoice",names:["\\mathchoice"],numArgs:4,primitive:!0,handler:(e,t)=>{var{parser:n}=e;return{type:"mathchoice",mode:n.mode,display:Gt(t[0]),text:Gt(t[1]),script:Gt(t[2]),scriptscript:Gt(t[3])}},htmlBuilder:(e,t)=>{var n=Jd(e,t),r=tn(n,t,!1);return $r(r)},mathmlBuilder:(e,t)=>{var n=Jd(e,t);return os(n,t)}});var jm=(e,t,n,r,s,i,a)=>{e=te([],[e]);var o=n&&Mr(n),l,c;if(t){var u=ht(t,r.havingStyle(s.sup()),r);c={elem:u,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-u.depth)}}if(n){var f=ht(n,r.havingStyle(s.sub()),r);l={elem:f,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-f.height)}}var m;if(c&&l){var h=r.fontMetrics().bigOpSpacing5+l.elem.height+l.elem.depth+l.kern+e.depth+a;m=dt({positionType:"bottom",positionData:h,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:ue(-i)},{type:"kern",size:l.kern},{type:"elem",elem:e},{type:"kern",size:c.kern},{type:"elem",elem:c.elem,marginLeft:ue(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else if(l){var y=e.height-a;m=dt({positionType:"top",positionData:y,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:ue(-i)},{type:"kern",size:l.kern},{type:"elem",elem:e}]})}else if(c){var b=e.depth+a;m=dt({positionType:"bottom",positionData:b,children:[{type:"elem",elem:e},{type:"kern",size:c.kern},{type:"elem",elem:c.elem,marginLeft:ue(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else return e;var S=[m];if(l&&i!==0&&!o){var k=te(["mspace"],[],r);k.style.marginRight=ue(i),S.unshift(k)}return te(["mop","op-limits"],S,r)},Gm=new Set(["\\smallint"]),Zm=(e,t)=>{var n,r,s=!1,i;e.type==="supsub"?(n=e.sup,r=e.sub,i=Je(e.base,"op"),s=!0):i=Je(e,"op");var a=t.style,o=!1;a.size===Ze.DISPLAY.size&&i.symbol&&!Gm.has(i.name)&&(o=!0);var l,c;if(i.symbol){var u=o?"Size2-Regular":"Size1-Regular",f="";if((i.name==="\\oiint"||i.name==="\\oiiint")&&(f=i.name.slice(1),i.name=f==="oiint"?"\\iint":"\\iiint"),l=hn(i.name,u,"math",t,["mop","op-symbol",o?"large-op":"small-op"]),c=l.italic,f.length>0){var m=Sm(f+"Size"+(o?"2":"1"),t);l=dt({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:m,shift:o?.08:0}]}),i.name="\\"+f,l.classes.unshift("mop"),l.italic=c}}else if(i.body){var h=tn(i.body,t,!0);h.length===1&&h[0]instanceof On?(l=h[0],l.classes[0]="mop"):l=te(["mop"],h,t)}else{for(var y=[],b=1;b<i.name.length;b++)y.push(D0(i.name[b],i.mode,t));l=te(["mop"],y,t)}var S=0,k=0;if((l instanceof On||i.name==="\\oiint"||i.name==="\\oiiint")&&!i.suppressBaseShift){var P;S=(l.height-l.depth)/2-t.fontMetrics().axisHeight,k=(P=l.italic)!=null?P:0}return s?jm(l,n,r,t,a,k,S):(S&&(l.style.position="relative",l.style.top=ue(S)),l)},T8=(e,t)=>{var n;if(e.symbol)n=new oe("mo",[Fn(e.name,e.mode)]),Gm.has(e.name)&&n.setAttribute("largeop","false");else if(e.body)n=new oe("mo",Mn(e.body,t));else{n=new oe("mi",[new Zt(e.name.slice(1))]);var r=new oe("mo",[Fn("","text")]);e.parentIsSupSub?n=new oe("mrow",[n,r]):n=_m([n,r])}return n},I8={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};be({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],numArgs:0,handler:(e,t)=>{var{parser:n,funcName:r}=e,s=r;return s.length===1&&(s=I8[s]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:s}},htmlBuilder:Zm,mathmlBuilder:T8});be({type:"op",names:["\\mathop"],numArgs:1,primitive:!0,handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Gt(r)}}});var R8={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};be({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],numArgs:0,handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}}});be({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],numArgs:0,handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}}});be({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],numArgs:0,allowedInArgument:!0,handler(e){var{parser:t,funcName:n}=e,r=n;return r.length===1&&(r=R8[r]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}}});var Km=(e,t)=>{var n,r,s=!1,i;e.type==="supsub"?(n=e.sup,r=e.sub,i=Je(e.base,"operatorname"),s=!0):i=Je(e,"operatorname");var a;if(i.body.length>0){for(var o=i.body.map(f=>{var m="text"in f?f.text:void 0;return typeof m=="string"?{type:"textord",mode:f.mode,text:m}:f}),l=tn(o,t.withFont("mathrm"),!0),c=0;c<l.length;c++){var u=l[c];u instanceof On&&(u.text=u.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}a=te(["mop"],l,t)}else a=te(["mop"],[],t);return s?jm(a,n,r,t,t.style,0,0):a},C8=(e,t)=>{for(var n=Mn(e.body,t.withFont("mathrm")),r=!0,s=0;s<n.length;s++){var i=n[s];if(!(i instanceof Em))if(i instanceof oe)switch(i.type){case"mi":case"mn":case"mspace":case"mtext":break;case"mo":{var a=i.children[0];i.children.length===1&&a instanceof Zt?a.text=a.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):r=!1;break}default:r=!1}else r=!1}if(r){var o=n.map(u=>u.toText()).join("");n=[new Zt(o)]}var l=new oe("mi",n);l.setAttribute("mathvariant","normal");var c=new oe("mo",[Fn("","text")]);return e.parentIsSupSub?new oe("mrow",[l,c]):_m([l,c])};be({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],numArgs:1,handler:(e,t)=>{var{parser:n,funcName:r}=e,s=t[0];return{type:"operatorname",mode:n.mode,body:Gt(s),alwaysHandleSupSub:r==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:Km,mathmlBuilder:C8});w("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");Ls({type:"ordgroup",htmlBuilder(e,t){return e.semisimple?$r(tn(e.body,t,!1)):te(["mord"],tn(e.body,t,!0),t)},mathmlBuilder(e,t){return os(e.body,t,!0)}});be({type:"overline",names:["\\overline"],numArgs:1,handler(e,t){var{parser:n}=e,r=t[0];return{type:"overline",mode:n.mode,body:r}},htmlBuilder(e,t){var n=ht(e.body,t.havingCrampedStyle()),r=ri("overline-line",t),s=t.fontMetrics().defaultRuleThickness,i=dt({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*s},{type:"elem",elem:r},{type:"kern",size:s}]});return te(["mord","overline"],[i],t)},mathmlBuilder(e,t){var n=new oe("mo",[new Zt("‾")]);n.setAttribute("stretchy","true");var r=new oe("mover",[xt(e.body,t),n]);return r.setAttribute("accent","true"),r}});be({type:"phantom",names:["\\phantom"],numArgs:1,allowedInText:!0,handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"phantom",mode:n.mode,body:Gt(r)}},htmlBuilder:(e,t)=>{var n=tn(e.body,t.withPhantom(),!1);return $r(n)},mathmlBuilder:(e,t)=>{var n=Mn(e.body,t);return new oe("mphantom",n)}});w("\\hphantom","\\smash{\\phantom{#1}}");be({type:"vphantom",names:["\\vphantom"],numArgs:1,allowedInText:!0,handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"vphantom",mode:n.mode,body:r}},htmlBuilder:(e,t)=>{var n=te(["inner"],[ht(e.body,t.withPhantom())]),r=te(["fix"],[]);return te(["mord","rlap"],[n,r],t)},mathmlBuilder:(e,t)=>{var n=Mn(Gt(e.body),t),r=new oe("mphantom",n),s=new oe("mpadded",[r]);return s.setAttribute("width","0px"),s}});be({type:"raisebox",names:["\\raisebox"],numArgs:2,argTypes:["size","hbox"],allowedInText:!0,handler(e,t){var{parser:n}=e,r=Je(t[0],"size").value,s=t[1];return{type:"raisebox",mode:n.mode,dy:r,body:s}},htmlBuilder(e,t){var n=ht(e.body,t),r=Mt(e.dy,t);return dt({positionType:"shift",positionData:-r,children:[{type:"elem",elem:n}]})},mathmlBuilder(e,t){var n=new oe("mpadded",[xt(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute("voffset",r),n}});be({type:"internal",names:["\\relax"],numArgs:0,allowedInText:!0,allowedInArgument:!0,handler(e){var{parser:t}=e;return{type:"internal",mode:t.mode}}});be({type:"rule",names:["\\rule"],numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"],handler(e,t,n){var{parser:r}=e,s=n[0],i=Je(t[0],"size"),a=Je(t[1],"size");return{type:"rule",mode:r.mode,shift:s&&Je(s,"size").value,width:i.value,height:a.value}},htmlBuilder(e,t){var n=te(["mord","rule"],[],t),r=Mt(e.width,t),s=Mt(e.height,t),i=e.shift?Mt(e.shift,t):0;return n.style.borderRightWidth=ue(r),n.style.borderTopWidth=ue(s),n.style.bottom=ue(i),n.width=r,n.height=s+i,n.depth=-i,n.maxFontSize=s*1.125*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=Mt(e.width,t),r=Mt(e.height,t),s=e.shift?Mt(e.shift,t):0,i=t.color&&t.getColor()||"black",a=new oe("mspace");a.setAttribute("mathbackground",i),a.setAttribute("width",ue(n)),a.setAttribute("height",ue(r));var o=new oe("mpadded",[a]);return s>=0?o.setAttribute("height",ue(s)):(o.setAttribute("height",ue(s)),o.setAttribute("depth",ue(-s))),o.setAttribute("voffset",ue(s)),o}});function Wm(e,t,n){for(var r=tn(e,t,!1),s=t.sizeMultiplier/n.sizeMultiplier,i=0;i<r.length;i++){var a=r[i].classes.indexOf("sizing");a<0?Array.prototype.push.apply(r[i].classes,t.sizingClasses(n)):r[i].classes[a+1]==="reset-size"+t.size&&(r[i].classes[a+1]="reset-size"+n.size),r[i].height*=s,r[i].depth*=s}return $r(r)}var Yd=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],O8=(e,t)=>{var n=t.havingSize(e.size);return Wm(e.body,n,t)};be({type:"sizing",names:Yd,numArgs:0,allowedInText:!0,handler:(e,t)=>{var{breakOnTokenText:n,funcName:r,parser:s}=e,i=s.parseExpression(!1,n);return{type:"sizing",mode:s.mode,size:Yd.indexOf(r)+1,body:i}},htmlBuilder:O8,mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=Mn(e.body,n),s=new oe("mstyle",r);return s.setAttribute("mathsize",ue(n.sizeMultiplier)),s}});be({type:"smash",names:["\\smash"],numArgs:1,numOptionalArgs:1,allowedInText:!0,handler:(e,t,n)=>{var{parser:r}=e,s=!1,i=!1,a=n[0]&&Je(n[0],"ordgroup");if(a)for(var o,l=0;l<a.body.length;++l){var c=a.body[l];if(o=jo(c).text,o==="t")s=!0;else if(o==="b")i=!0;else{s=!1,i=!1;break}}else s=!0,i=!0;var u=t[0];return{type:"smash",mode:r.mode,body:u,smashHeight:s,smashDepth:i}},htmlBuilder:(e,t)=>{var n=te([],[ht(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0),e.smashDepth&&(n.depth=0),e.smashHeight&&e.smashDepth)return te(["mord","smash"],[n],t);if(n.children)for(var r=0;r<n.children.length;r++)e.smashHeight&&(n.children[r].height=0),e.smashDepth&&(n.children[r].depth=0);var s=dt({positionType:"firstBaseline",children:[{type:"elem",elem:n}]});return te(["mord"],[s],t)},mathmlBuilder:(e,t)=>{var n=new oe("mpadded",[xt(e.body,t)]);return e.smashHeight&&n.setAttribute("height","0px"),e.smashDepth&&n.setAttribute("depth","0px"),n}});be({type:"sqrt",names:["\\sqrt"],numArgs:1,numOptionalArgs:1,handler(e,t,n){var{parser:r}=e,s=n[0],i=t[0];return{type:"sqrt",mode:r.mode,body:i,index:s}},htmlBuilder(e,t){var n=ht(e.body,t.havingCrampedStyle());n.height===0&&(n.height=t.fontMetrics().xHeight),n=si(n,t);var r=t.fontMetrics(),s=r.defaultRuleThickness,i=s;t.style.id<Ze.TEXT.id&&(i=t.fontMetrics().xHeight);var a=s+i/4,o=n.height+n.depth+a+s,{span:l,ruleWidth:c,advanceWidth:u}=f8(o,t),f=l.height-c;f>n.height+n.depth+a&&(a=(a+f-n.height-n.depth)/2);var m=l.height-n.height-a-c;n.style.paddingLeft=ue(u);var h=dt({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+m)},{type:"elem",elem:l},{type:"kern",size:c}]});if(e.index){var y=t.havingStyle(Ze.SCRIPTSCRIPT),b=ht(e.index,y,t),S=.6*(h.height-h.depth),k=dt({positionType:"shift",positionData:-S,children:[{type:"elem",elem:b}]}),P=te(["root"],[k]);return te(["mord","sqrt"],[P,h],t)}else return te(["mord","sqrt"],[h],t)},mathmlBuilder(e,t){var{body:n,index:r}=e;return r?new oe("mroot",[xt(n,t),xt(r,t)]):new oe("msqrt",[xt(n,t)])}});var Bc={display:Ze.DISPLAY,text:Ze.TEXT,script:Ze.SCRIPT,scriptscript:Ze.SCRIPTSCRIPT};function N8(e){return e in Bc}be({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],numArgs:0,allowedInText:!0,primitive:!0,handler(e,t){var{breakOnTokenText:n,funcName:r,parser:s}=e,i=s.parseExpression(!0,n),a=r.slice(1,r.length-5);if(!N8(a))throw new Error("Unknown style: "+a);return{type:"styling",mode:s.mode,style:a,body:i}},htmlBuilder(e,t){var n=Bc[e.style],r=t.havingStyle(n);return e.resetFont&&(r=r.withFont("")),Wm(e.body,r,t)},mathmlBuilder(e,t){var n=Bc[e.style],r=t.havingStyle(n);e.resetFont&&(r=r.withFont(""));var s=Mn(e.body,r),i=new oe("mstyle",s),a={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},o=a[e.style];return i.setAttribute("scriptlevel",o[0]),i.setAttribute("displaystyle",o[1]),i}});var M8=function(t,n){var r=t.base;if(r)if(r.type==="op"){var s=r.limits&&(n.style.size===Ze.DISPLAY.size||r.alwaysHandleSupSub);return s?Zm:null}else if(r.type==="operatorname"){var i=r.alwaysHandleSupSub&&(n.style.size===Ze.DISPLAY.size||r.limits);return i?Km:null}else{if(r.type==="accent")return Mr(r.base)?Rm:null;if(r.type==="horizBrace"){var a=!t.sub;return a===r.isOver?Vm:null}else return null}else return null};Ls({type:"supsub",htmlBuilder(e,t){var n=M8(e,t);if(n)return n(e,t);var{base:r,sup:s,sub:i}=e,a=ht(r,t),o,l,c=t.fontMetrics(),u=0,f=0,m=r&&Mr(r);if(s){var h=t.havingStyle(t.style.sup());o=ht(s,h,t),m||(u=a.height-h.fontMetrics().supDrop*h.sizeMultiplier/t.sizeMultiplier)}if(i){var y=t.havingStyle(t.style.sub());l=ht(i,y,t),m||(f=a.depth+y.fontMetrics().subDrop*y.sizeMultiplier/t.sizeMultiplier)}var b;t.style===Ze.DISPLAY?b=c.sup1:t.style.cramped?b=c.sup3:b=c.sup2;var S=t.sizeMultiplier,k=ue(.5/c.ptPerEm/S),P=null;if(l){var z=e.base&&e.base.type==="op"&&e.base.name&&(e.base.name==="\\oiint"||e.base.name==="\\oiiint");if(a instanceof On||z){var I;P=ue(-((I=a.italic)!=null?I:0))}}var E;if(o&&l){u=Math.max(u,b,o.depth+.25*c.xHeight),f=Math.max(f,c.sub2);var _=c.defaultRuleThickness,L=4*_;if(u-o.depth-(l.height-f)<L){f=L-(u-o.depth)+l.height;var N=.8*c.xHeight-(u-o.depth);N>0&&(u+=N,f-=N)}var G=[{type:"elem",elem:l,shift:f,marginRight:k,marginLeft:P},{type:"elem",elem:o,shift:-u,marginRight:k}];E=dt({positionType:"individualShift",children:G})}else if(l){f=Math.max(f,c.sub1,l.height-.8*c.xHeight);var D=[{type:"elem",elem:l,marginLeft:P,marginRight:k}];E=dt({positionType:"shift",positionData:f,children:D})}else if(o)u=Math.max(u,b,o.depth+.25*c.xHeight),E=dt({positionType:"shift",positionData:-u,children:[{type:"elem",elem:o,marginRight:k}]});else throw new Error("supsub must have either sup or sub.");var W=Mc(a,"right")||"mord";return te([W],[a,te(["msupsub"],[E])],t)},mathmlBuilder(e,t){var n=!1,r,s;e.base&&e.base.type==="horizBrace"&&(s=!!e.sup,s===e.base.isOver&&(n=!0,r=e.base.isOver)),e.base&&(e.base.type==="op"||e.base.type==="operatorname")&&(e.base.parentIsSupSub=!0);var i=[xt(e.base,t)];e.sub&&i.push(xt(e.sub,t)),e.sup&&i.push(xt(e.sup,t));var a;if(n)a=r?"mover":"munder";else if(e.sub)if(e.sup){var c=e.base;c&&c.type==="op"&&c.limits&&t.style===Ze.DISPLAY||c&&c.type==="operatorname"&&c.alwaysHandleSupSub&&(t.style===Ze.DISPLAY||c.limits)?a="munderover":a="msubsup"}else{var l=e.base;l&&l.type==="op"&&l.limits&&(t.style===Ze.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||t.style===Ze.DISPLAY)?a="munder":a="msub"}else{var o=e.base;o&&o.type==="op"&&o.limits&&(t.style===Ze.DISPLAY||o.alwaysHandleSupSub)||o&&o.type==="operatorname"&&o.alwaysHandleSupSub&&(o.limits||t.style===Ze.DISPLAY)?a="mover":a="msup"}return new oe(a,i)}});Ls({type:"atom",htmlBuilder(e,t){return D0(e.text,e.mode,t,["m"+e.family])},mathmlBuilder(e,t){var n=new oe("mo",[Fn(e.text,e.mode)]);if(e.family==="bin"){var r=L0(e,t);r==="bold-italic"&&n.setAttribute("mathvariant",r)}else e.family==="punct"?n.setAttribute("separator","true"):(e.family==="open"||e.family==="close")&&n.setAttribute("stretchy","false");return n}});var Qm={mi:"italic",mn:"normal",mtext:"normal"};Ls({type:"mathord",htmlBuilder(e,t){return qo(e,t)},mathmlBuilder(e,t){var n=new oe("mi",[Fn(e.text,e.mode,t)]),r=L0(e,t)||"italic";return r!==Qm[n.type]&&n.setAttribute("mathvariant",r),n}});Ls({type:"textord",htmlBuilder(e,t){return qo(e,t)},mathmlBuilder(e,t){var n=Fn(e.text,e.mode,t),r=L0(e,t)||"normal",s;return e.mode==="text"?s=new oe("mtext",[n]):/[0-9]/.test(e.text)?s=new oe("mn",[n]):e.text==="\\prime"?s=new oe("mo",[n]):s=new oe("mi",[n]),r!==Qm[s.type]&&s.setAttribute("mathvariant",r),s}});var Fl={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Ul={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Ls({type:"spacing",htmlBuilder(e,t){if(Ul.hasOwnProperty(e.text)){var n=Ul[e.text].className||"";if(e.mode==="text"){var r=qo(e,t);return r.classes.push(n),r}else return te(["mspace",n],[D0(e.text,e.mode,t)],t)}else{if(Fl.hasOwnProperty(e.text))return te(["mspace",Fl[e.text]],[],t);throw new ae('Unknown type of space "'+e.text+'"')}},mathmlBuilder(e,t){var n;if(Ul.hasOwnProperty(e.text))n=new oe("mtext",[new Zt(" ")]);else{if(Fl.hasOwnProperty(e.text))return new oe("mspace");throw new ae('Unknown type of space "'+e.text+'"')}return n}});var Xd=()=>{var e=new oe("mtd",[]);return e.setAttribute("width","50%"),e};Ls({type:"tag",mathmlBuilder(e,t){var n=new oe("mtable",[new oe("mtr",[Xd(),new oe("mtd",[os(e.body,t)]),Xd(),new oe("mtd",[os(e.tag,t)])])]);return n.setAttribute("width","100%"),n}});var ef={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},tf={"\\textbf":"textbf","\\textmd":"textmd"},z8={"\\textit":"textit","\\textup":"textup"},nf=(e,t)=>{var n=e.font;if(n){if(ef[n])return t.withTextFontFamily(ef[n]);if(tf[n])return t.withTextFontWeight(tf[n]);if(n==="\\emph")return t.fontShape==="textit"?t.withTextFontShape("textup"):t.withTextFontShape("textit")}else return t;return t.withTextFontShape(z8[n])};be({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0,handler(e,t){var{parser:n,funcName:r}=e,s=t[0];return{type:"text",mode:n.mode,body:Gt(s),font:r}},htmlBuilder(e,t){var n=nf(e,t),r=tn(e.body,n,!0);return te(["mord","text"],r,n)},mathmlBuilder(e,t){var n=nf(e,t);return os(e.body,n)}});be({type:"underline",names:["\\underline"],numArgs:1,allowedInText:!0,handler(e,t){var{parser:n}=e;return{type:"underline",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=ht(e.body,t),r=ri("underline-line",t),s=t.fontMetrics().defaultRuleThickness,i=dt({positionType:"top",positionData:n.height,children:[{type:"kern",size:s},{type:"elem",elem:r},{type:"kern",size:3*s},{type:"elem",elem:n}]});return te(["mord","underline"],[i],t)},mathmlBuilder(e,t){var n=new oe("mo",[new Zt("‾")]);n.setAttribute("stretchy","true");var r=new oe("munder",[xt(e.body,t),n]);return r.setAttribute("accentunder","true"),r}});be({type:"vcenter",names:["\\vcenter"],numArgs:1,argTypes:["original"],allowedInText:!1,handler(e,t){var{parser:n}=e;return{type:"vcenter",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=ht(e.body,t),r=t.fontMetrics().axisHeight,s=.5*(n.height-r-(n.depth+r));return dt({positionType:"shift",positionData:s,children:[{type:"elem",elem:n}]})},mathmlBuilder(e,t){var n=new oe("mpadded",[xt(e.body,t)],["vcenter"]);return new oe("mrow",[n])}});be({type:"verb",names:["\\verb"],numArgs:0,allowedInText:!0,handler(e,t,n){throw new ae("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){for(var n=rf(e),r=[],s=t.havingStyle(t.style.text()),i=0;i<n.length;i++){var a=n[i];a==="~"&&(a="\\textasciitilde"),r.push(hn(a,"Typewriter-Regular",e.mode,s,["mord","texttt"]))}return te(["mord","text"].concat(s.sizingClasses(t)),bm(r),s)},mathmlBuilder(e,t){var n=new Zt(rf(e)),r=new oe("mtext",[n]);return r.setAttribute("mathvariant","monospace"),r}});var rf=e=>e.body.replace(/ /g,e.star?"␣":" "),Jr=xm,Jm=`[ \r
|
|
314
|
-
]
|
|
312
|
+
-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.")}};function _7(e){return"toText"in e}class hi{constructor(t){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=t,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(t){return this.classes.includes(t)}toNode(){for(var t=document.createDocumentFragment(),n=0;n<this.children.length;n++)t.appendChild(this.children[n].toNode());return t}toMarkup(){for(var t="",n=0;n<this.children.length;n++)t+=this.children[n].toMarkup();return t}toText(){return this.children.map(t=>{if(_7(t))return t.toText();throw new Error("Expected MathDomNode with toText, got "+t.constructor.name)}).join("")}}var kc={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},E7={ex:!0,em:!0,mu:!0},mm=function(t){return typeof t!="string"&&(t=t.unit),t in kc||t in E7||t==="ex"},zt=function(t,n){var r;if(t.unit in kc)r=kc[t.unit]/n.fontMetrics().ptPerEm/n.sizeMultiplier;else if(t.unit==="mu")r=n.fontMetrics().cssEmPerMu;else{var s;if(n.style.isTight()?s=n.havingStyle(n.style.text()):s=n,t.unit==="ex")r=s.fontMetrics().xHeight;else if(t.unit==="em")r=s.fontMetrics().quad;else throw new ae("Invalid unit: '"+t.unit+"'");s!==n&&(r*=s.sizeMultiplier/n.sizeMultiplier)}return Math.min(t.number*r,n.maxSize)},ue=function(t){return+t.toFixed(4)+"em"},is=function(t){return t.filter(n=>n).join(" ")},z0=function(t){var n="";for(var r of Object.keys(t)){var s=t[r];s!==void 0&&(n+=X6(r)+":"+s+";")}return n},gm=function(t,n,r){if(this.classes=t||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=r||{},n){n.style.isTight()&&this.classes.push("mtight");var s=n.getColor();s&&(this.style.color=s)}},vm=function(t){var n=document.createElement(t);n.className=is(this.classes),Object.assign(n.style,this.style);for(var r of Object.keys(this.attributes))n.setAttribute(r,this.attributes[r]);for(var s=0;s<this.children.length;s++)n.appendChild(this.children[s].toNode());return n},A7=/[\s"'>/=\x00-\x1f]/,bm=function(t){var n="<"+t;this.classes.length&&(n+=' class="'+ln(is(this.classes))+'"');var r=z0(this.style);r&&(n+=' style="'+ln(r)+'"');for(var s of Object.keys(this.attributes)){if(A7.test(s))throw new ae("Invalid attribute name '"+s+"'");n+=" "+s+'="'+ln(this.attributes[s])+'"'}n+=">";for(var i=0;i<this.children.length;i++)n+=this.children[i].toMarkup();return n+="</"+t+">",n};class pi{constructor(t,n,r,s){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,gm.call(this,t,r,s),this.children=n||[]}setAttribute(t,n){this.attributes[t]=n}hasClass(t){return this.classes.includes(t)}toNode(){return vm.call(this,"span")}toMarkup(){return bm.call(this,"span")}}class Fo{constructor(t,n,r,s){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,gm.call(this,n,s),this.children=r||[],this.setAttribute("href",t)}setAttribute(t,n){this.attributes[t]=n}hasClass(t){return this.classes.includes(t)}toNode(){return vm.call(this,"a")}toMarkup(){return bm.call(this,"a")}}class T7{constructor(t,n,r){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=n,this.src=t,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=r}hasClass(t){return this.classes.includes(t)}toNode(){var t=document.createElement("img");return t.src=this.src,t.alt=this.alt,t.className="mord",Object.assign(t.style,this.style),t}toMarkup(){var t='<img src="'+ln(this.src)+'"'+(' alt="'+ln(this.alt)+'"'),n=z0(this.style);return n&&(t+=' style="'+ln(n)+'"'),t+="'/>",t}}var I7={î:"ı̂",ï:"ı̈",í:"ı́",ì:"ı̀"};class Mn{constructor(t,n,r,s,i,a,o,l){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=t,this.height=n||0,this.depth=r||0,this.italic=s||0,this.skew=i||0,this.width=a||0,this.classes=o||[],this.style=l||{},this.maxFontSize=0;var c=h7(this.text.charCodeAt(0));c&&this.classes.push(c+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=I7[this.text])}hasClass(t){return this.classes.includes(t)}toNode(){var t=document.createTextNode(this.text),n=null;return this.italic>0&&(n=document.createElement("span"),n.style.marginRight=ue(this.italic)),this.classes.length>0&&(n=n||document.createElement("span"),n.className=is(this.classes)),Object.keys(this.style).length>0&&(n=n||document.createElement("span"),Object.assign(n.style,this.style)),n?(n.appendChild(t),n):t}toMarkup(){var t=!1,n="<span";this.classes.length&&(t=!0,n+=' class="',n+=ln(is(this.classes)),n+='"');var r="";this.italic>0&&(r+="margin-right:"+ue(this.italic)+";"),r+=z0(this.style),r&&(t=!0,n+=' style="'+ln(r)+'"');var s=ln(this.text);return t?(n+=">",n+=s,n+="</span>",n):s}}class Or{constructor(t,n){this.children=void 0,this.attributes=void 0,this.children=t||[],this.attributes=n||{}}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");for(var r of Object.keys(this.attributes))n.setAttribute(r,this.attributes[r]);for(var s=0;s<this.children.length;s++)n.appendChild(this.children[s].toNode());return n}toMarkup(){var t='<svg xmlns="http://www.w3.org/2000/svg"';for(var n of Object.keys(this.attributes))t+=" "+n+'="'+ln(this.attributes[n])+'"';t+=">";for(var r=0;r<this.children.length;r++)t+=this.children[r].toMarkup();return t+="</svg>",t}}class as{constructor(t,n){this.pathName=void 0,this.alternate=void 0,this.pathName=t,this.alternate=n}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"path");return this.alternate?n.setAttribute("d",this.alternate):n.setAttribute("d",Ad[this.pathName]),n}toMarkup(){return this.alternate?'<path d="'+ln(this.alternate)+'"/>':'<path d="'+ln(Ad[this.pathName])+'"/>'}}class _c{constructor(t){this.attributes=void 0,this.attributes=t||{}}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"line");for(var r of Object.keys(this.attributes))n.setAttribute(r,this.attributes[r]);return n}toMarkup(){var t="<line";for(var n of Object.keys(this.attributes))t+=" "+n+'="'+ln(this.attributes[n])+'"';return t+="/>",t}}function R7(e){if(e instanceof Mn)return e;throw new Error("Expected symbolNode but got "+String(e)+".")}function C7(e){if(e instanceof pi)return e;throw new Error("Expected span<HtmlDomNode> but got "+String(e)+".")}var O7=e=>e instanceof pi||e instanceof Fo||e instanceof hi,cr={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},Na={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},Td={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function M7(e,t){cr[e]=t}function $0(e,t,n){if(!cr[t])throw new Error("Font metrics not found for font: "+t+".");var r=e.charCodeAt(0),s=cr[t][r];if(!s&&e[0]in Td&&(r=Td[e[0]].charCodeAt(0),s=cr[t][r]),!s&&n==="text"&&pm(r)&&(s=cr[t][77]),s)return{depth:s[0],height:s[1],italic:s[2],skew:s[3],width:s[4]}}var Tl={};function N7(e){var t;if(e>=5?t=0:e>=3?t=1:t=2,!Tl[t]){var n=Tl[t]={cssEmPerMu:Na.quad[t]/18};for(var r in Na)Na.hasOwnProperty(r)&&(n[r]=Na[r][t])}return Tl[t]}var Rt={math:{},text:{}};function d(e,t,n,r,s,i){Rt[e][s]={font:t,group:n,replace:r},i&&r&&(Rt[e][r]=Rt[e][s])}var h="math",ee="text",v="main",A="ams",Ct="accent-token",we="bin",vn="close",mi="inner",Fe="mathord",Wt="op-token",Nn="open",ha="punct",R="rel",$r="spacing",B="textord";d(h,v,R,"≡","\\equiv",!0);d(h,v,R,"≺","\\prec",!0);d(h,v,R,"≻","\\succ",!0);d(h,v,R,"∼","\\sim",!0);d(h,v,R,"⊥","\\perp");d(h,v,R,"⪯","\\preceq",!0);d(h,v,R,"⪰","\\succeq",!0);d(h,v,R,"≃","\\simeq",!0);d(h,v,R,"∣","\\mid",!0);d(h,v,R,"≪","\\ll",!0);d(h,v,R,"≫","\\gg",!0);d(h,v,R,"≍","\\asymp",!0);d(h,v,R,"∥","\\parallel");d(h,v,R,"⋈","\\bowtie",!0);d(h,v,R,"⌣","\\smile",!0);d(h,v,R,"⊑","\\sqsubseteq",!0);d(h,v,R,"⊒","\\sqsupseteq",!0);d(h,v,R,"≐","\\doteq",!0);d(h,v,R,"⌢","\\frown",!0);d(h,v,R,"∋","\\ni",!0);d(h,v,R,"∝","\\propto",!0);d(h,v,R,"⊢","\\vdash",!0);d(h,v,R,"⊣","\\dashv",!0);d(h,v,R,"∋","\\owns");d(h,v,ha,".","\\ldotp");d(h,v,ha,"⋅","\\cdotp");d(h,v,ha,"⋅","·");d(ee,v,B,"⋅","·");d(h,v,B,"#","\\#");d(ee,v,B,"#","\\#");d(h,v,B,"&","\\&");d(ee,v,B,"&","\\&");d(h,v,B,"ℵ","\\aleph",!0);d(h,v,B,"∀","\\forall",!0);d(h,v,B,"ℏ","\\hbar",!0);d(h,v,B,"∃","\\exists",!0);d(h,v,B,"∇","\\nabla",!0);d(h,v,B,"♭","\\flat",!0);d(h,v,B,"ℓ","\\ell",!0);d(h,v,B,"♮","\\natural",!0);d(h,v,B,"♣","\\clubsuit",!0);d(h,v,B,"℘","\\wp",!0);d(h,v,B,"♯","\\sharp",!0);d(h,v,B,"♢","\\diamondsuit",!0);d(h,v,B,"ℜ","\\Re",!0);d(h,v,B,"♡","\\heartsuit",!0);d(h,v,B,"ℑ","\\Im",!0);d(h,v,B,"♠","\\spadesuit",!0);d(h,v,B,"§","\\S",!0);d(ee,v,B,"§","\\S");d(h,v,B,"¶","\\P",!0);d(ee,v,B,"¶","\\P");d(h,v,B,"†","\\dag");d(ee,v,B,"†","\\dag");d(ee,v,B,"†","\\textdagger");d(h,v,B,"‡","\\ddag");d(ee,v,B,"‡","\\ddag");d(ee,v,B,"‡","\\textdaggerdbl");d(h,v,vn,"⎱","\\rmoustache",!0);d(h,v,Nn,"⎰","\\lmoustache",!0);d(h,v,vn,"⟯","\\rgroup",!0);d(h,v,Nn,"⟮","\\lgroup",!0);d(h,v,we,"∓","\\mp",!0);d(h,v,we,"⊖","\\ominus",!0);d(h,v,we,"⊎","\\uplus",!0);d(h,v,we,"⊓","\\sqcap",!0);d(h,v,we,"∗","\\ast");d(h,v,we,"⊔","\\sqcup",!0);d(h,v,we,"◯","\\bigcirc",!0);d(h,v,we,"∙","\\bullet",!0);d(h,v,we,"‡","\\ddagger");d(h,v,we,"≀","\\wr",!0);d(h,v,we,"⨿","\\amalg");d(h,v,we,"&","\\And");d(h,v,R,"⟵","\\longleftarrow",!0);d(h,v,R,"⇐","\\Leftarrow",!0);d(h,v,R,"⟸","\\Longleftarrow",!0);d(h,v,R,"⟶","\\longrightarrow",!0);d(h,v,R,"⇒","\\Rightarrow",!0);d(h,v,R,"⟹","\\Longrightarrow",!0);d(h,v,R,"↔","\\leftrightarrow",!0);d(h,v,R,"⟷","\\longleftrightarrow",!0);d(h,v,R,"⇔","\\Leftrightarrow",!0);d(h,v,R,"⟺","\\Longleftrightarrow",!0);d(h,v,R,"↦","\\mapsto",!0);d(h,v,R,"⟼","\\longmapsto",!0);d(h,v,R,"↗","\\nearrow",!0);d(h,v,R,"↩","\\hookleftarrow",!0);d(h,v,R,"↪","\\hookrightarrow",!0);d(h,v,R,"↘","\\searrow",!0);d(h,v,R,"↼","\\leftharpoonup",!0);d(h,v,R,"⇀","\\rightharpoonup",!0);d(h,v,R,"↙","\\swarrow",!0);d(h,v,R,"↽","\\leftharpoondown",!0);d(h,v,R,"⇁","\\rightharpoondown",!0);d(h,v,R,"↖","\\nwarrow",!0);d(h,v,R,"⇌","\\rightleftharpoons",!0);d(h,A,R,"≮","\\nless",!0);d(h,A,R,"","\\@nleqslant");d(h,A,R,"","\\@nleqq");d(h,A,R,"⪇","\\lneq",!0);d(h,A,R,"≨","\\lneqq",!0);d(h,A,R,"","\\@lvertneqq");d(h,A,R,"⋦","\\lnsim",!0);d(h,A,R,"⪉","\\lnapprox",!0);d(h,A,R,"⊀","\\nprec",!0);d(h,A,R,"⋠","\\npreceq",!0);d(h,A,R,"⋨","\\precnsim",!0);d(h,A,R,"⪹","\\precnapprox",!0);d(h,A,R,"≁","\\nsim",!0);d(h,A,R,"","\\@nshortmid");d(h,A,R,"∤","\\nmid",!0);d(h,A,R,"⊬","\\nvdash",!0);d(h,A,R,"⊭","\\nvDash",!0);d(h,A,R,"⋪","\\ntriangleleft");d(h,A,R,"⋬","\\ntrianglelefteq",!0);d(h,A,R,"⊊","\\subsetneq",!0);d(h,A,R,"","\\@varsubsetneq");d(h,A,R,"⫋","\\subsetneqq",!0);d(h,A,R,"","\\@varsubsetneqq");d(h,A,R,"≯","\\ngtr",!0);d(h,A,R,"","\\@ngeqslant");d(h,A,R,"","\\@ngeqq");d(h,A,R,"⪈","\\gneq",!0);d(h,A,R,"≩","\\gneqq",!0);d(h,A,R,"","\\@gvertneqq");d(h,A,R,"⋧","\\gnsim",!0);d(h,A,R,"⪊","\\gnapprox",!0);d(h,A,R,"⊁","\\nsucc",!0);d(h,A,R,"⋡","\\nsucceq",!0);d(h,A,R,"⋩","\\succnsim",!0);d(h,A,R,"⪺","\\succnapprox",!0);d(h,A,R,"≆","\\ncong",!0);d(h,A,R,"","\\@nshortparallel");d(h,A,R,"∦","\\nparallel",!0);d(h,A,R,"⊯","\\nVDash",!0);d(h,A,R,"⋫","\\ntriangleright");d(h,A,R,"⋭","\\ntrianglerighteq",!0);d(h,A,R,"","\\@nsupseteqq");d(h,A,R,"⊋","\\supsetneq",!0);d(h,A,R,"","\\@varsupsetneq");d(h,A,R,"⫌","\\supsetneqq",!0);d(h,A,R,"","\\@varsupsetneqq");d(h,A,R,"⊮","\\nVdash",!0);d(h,A,R,"⪵","\\precneqq",!0);d(h,A,R,"⪶","\\succneqq",!0);d(h,A,R,"","\\@nsubseteqq");d(h,A,we,"⊴","\\unlhd");d(h,A,we,"⊵","\\unrhd");d(h,A,R,"↚","\\nleftarrow",!0);d(h,A,R,"↛","\\nrightarrow",!0);d(h,A,R,"⇍","\\nLeftarrow",!0);d(h,A,R,"⇏","\\nRightarrow",!0);d(h,A,R,"↮","\\nleftrightarrow",!0);d(h,A,R,"⇎","\\nLeftrightarrow",!0);d(h,A,R,"△","\\vartriangle");d(h,A,B,"ℏ","\\hslash");d(h,A,B,"▽","\\triangledown");d(h,A,B,"◊","\\lozenge");d(h,A,B,"Ⓢ","\\circledS");d(h,A,B,"®","\\circledR");d(ee,A,B,"®","\\circledR");d(h,A,B,"∡","\\measuredangle",!0);d(h,A,B,"∄","\\nexists");d(h,A,B,"℧","\\mho");d(h,A,B,"Ⅎ","\\Finv",!0);d(h,A,B,"⅁","\\Game",!0);d(h,A,B,"‵","\\backprime");d(h,A,B,"▲","\\blacktriangle");d(h,A,B,"▼","\\blacktriangledown");d(h,A,B,"■","\\blacksquare");d(h,A,B,"⧫","\\blacklozenge");d(h,A,B,"★","\\bigstar");d(h,A,B,"∢","\\sphericalangle",!0);d(h,A,B,"∁","\\complement",!0);d(h,A,B,"ð","\\eth",!0);d(ee,v,B,"ð","ð");d(h,A,B,"╱","\\diagup");d(h,A,B,"╲","\\diagdown");d(h,A,B,"□","\\square");d(h,A,B,"□","\\Box");d(h,A,B,"◊","\\Diamond");d(h,A,B,"¥","\\yen",!0);d(ee,A,B,"¥","\\yen",!0);d(h,A,B,"✓","\\checkmark",!0);d(ee,A,B,"✓","\\checkmark");d(h,A,B,"ℶ","\\beth",!0);d(h,A,B,"ℸ","\\daleth",!0);d(h,A,B,"ℷ","\\gimel",!0);d(h,A,B,"ϝ","\\digamma",!0);d(h,A,B,"ϰ","\\varkappa");d(h,A,Nn,"┌","\\@ulcorner",!0);d(h,A,vn,"┐","\\@urcorner",!0);d(h,A,Nn,"└","\\@llcorner",!0);d(h,A,vn,"┘","\\@lrcorner",!0);d(h,A,R,"≦","\\leqq",!0);d(h,A,R,"⩽","\\leqslant",!0);d(h,A,R,"⪕","\\eqslantless",!0);d(h,A,R,"≲","\\lesssim",!0);d(h,A,R,"⪅","\\lessapprox",!0);d(h,A,R,"≊","\\approxeq",!0);d(h,A,we,"⋖","\\lessdot");d(h,A,R,"⋘","\\lll",!0);d(h,A,R,"≶","\\lessgtr",!0);d(h,A,R,"⋚","\\lesseqgtr",!0);d(h,A,R,"⪋","\\lesseqqgtr",!0);d(h,A,R,"≑","\\doteqdot");d(h,A,R,"≓","\\risingdotseq",!0);d(h,A,R,"≒","\\fallingdotseq",!0);d(h,A,R,"∽","\\backsim",!0);d(h,A,R,"⋍","\\backsimeq",!0);d(h,A,R,"⫅","\\subseteqq",!0);d(h,A,R,"⋐","\\Subset",!0);d(h,A,R,"⊏","\\sqsubset",!0);d(h,A,R,"≼","\\preccurlyeq",!0);d(h,A,R,"⋞","\\curlyeqprec",!0);d(h,A,R,"≾","\\precsim",!0);d(h,A,R,"⪷","\\precapprox",!0);d(h,A,R,"⊲","\\vartriangleleft");d(h,A,R,"⊴","\\trianglelefteq");d(h,A,R,"⊨","\\vDash",!0);d(h,A,R,"⊪","\\Vvdash",!0);d(h,A,R,"⌣","\\smallsmile");d(h,A,R,"⌢","\\smallfrown");d(h,A,R,"≏","\\bumpeq",!0);d(h,A,R,"≎","\\Bumpeq",!0);d(h,A,R,"≧","\\geqq",!0);d(h,A,R,"⩾","\\geqslant",!0);d(h,A,R,"⪖","\\eqslantgtr",!0);d(h,A,R,"≳","\\gtrsim",!0);d(h,A,R,"⪆","\\gtrapprox",!0);d(h,A,we,"⋗","\\gtrdot");d(h,A,R,"⋙","\\ggg",!0);d(h,A,R,"≷","\\gtrless",!0);d(h,A,R,"⋛","\\gtreqless",!0);d(h,A,R,"⪌","\\gtreqqless",!0);d(h,A,R,"≖","\\eqcirc",!0);d(h,A,R,"≗","\\circeq",!0);d(h,A,R,"≜","\\triangleq",!0);d(h,A,R,"∼","\\thicksim");d(h,A,R,"≈","\\thickapprox");d(h,A,R,"⫆","\\supseteqq",!0);d(h,A,R,"⋑","\\Supset",!0);d(h,A,R,"⊐","\\sqsupset",!0);d(h,A,R,"≽","\\succcurlyeq",!0);d(h,A,R,"⋟","\\curlyeqsucc",!0);d(h,A,R,"≿","\\succsim",!0);d(h,A,R,"⪸","\\succapprox",!0);d(h,A,R,"⊳","\\vartriangleright");d(h,A,R,"⊵","\\trianglerighteq");d(h,A,R,"⊩","\\Vdash",!0);d(h,A,R,"∣","\\shortmid");d(h,A,R,"∥","\\shortparallel");d(h,A,R,"≬","\\between",!0);d(h,A,R,"⋔","\\pitchfork",!0);d(h,A,R,"∝","\\varpropto");d(h,A,R,"◀","\\blacktriangleleft");d(h,A,R,"∴","\\therefore",!0);d(h,A,R,"∍","\\backepsilon");d(h,A,R,"▶","\\blacktriangleright");d(h,A,R,"∵","\\because",!0);d(h,A,R,"⋘","\\llless");d(h,A,R,"⋙","\\gggtr");d(h,A,we,"⊲","\\lhd");d(h,A,we,"⊳","\\rhd");d(h,A,R,"≂","\\eqsim",!0);d(h,v,R,"⋈","\\Join");d(h,A,R,"≑","\\Doteq",!0);d(h,A,we,"∔","\\dotplus",!0);d(h,A,we,"∖","\\smallsetminus");d(h,A,we,"⋒","\\Cap",!0);d(h,A,we,"⋓","\\Cup",!0);d(h,A,we,"⩞","\\doublebarwedge",!0);d(h,A,we,"⊟","\\boxminus",!0);d(h,A,we,"⊞","\\boxplus",!0);d(h,A,we,"⋇","\\divideontimes",!0);d(h,A,we,"⋉","\\ltimes",!0);d(h,A,we,"⋊","\\rtimes",!0);d(h,A,we,"⋋","\\leftthreetimes",!0);d(h,A,we,"⋌","\\rightthreetimes",!0);d(h,A,we,"⋏","\\curlywedge",!0);d(h,A,we,"⋎","\\curlyvee",!0);d(h,A,we,"⊝","\\circleddash",!0);d(h,A,we,"⊛","\\circledast",!0);d(h,A,we,"⋅","\\centerdot");d(h,A,we,"⊺","\\intercal",!0);d(h,A,we,"⋒","\\doublecap");d(h,A,we,"⋓","\\doublecup");d(h,A,we,"⊠","\\boxtimes",!0);d(h,A,R,"⇢","\\dashrightarrow",!0);d(h,A,R,"⇠","\\dashleftarrow",!0);d(h,A,R,"⇇","\\leftleftarrows",!0);d(h,A,R,"⇆","\\leftrightarrows",!0);d(h,A,R,"⇚","\\Lleftarrow",!0);d(h,A,R,"↞","\\twoheadleftarrow",!0);d(h,A,R,"↢","\\leftarrowtail",!0);d(h,A,R,"↫","\\looparrowleft",!0);d(h,A,R,"⇋","\\leftrightharpoons",!0);d(h,A,R,"↶","\\curvearrowleft",!0);d(h,A,R,"↺","\\circlearrowleft",!0);d(h,A,R,"↰","\\Lsh",!0);d(h,A,R,"⇈","\\upuparrows",!0);d(h,A,R,"↿","\\upharpoonleft",!0);d(h,A,R,"⇃","\\downharpoonleft",!0);d(h,v,R,"⊶","\\origof",!0);d(h,v,R,"⊷","\\imageof",!0);d(h,A,R,"⊸","\\multimap",!0);d(h,A,R,"↭","\\leftrightsquigarrow",!0);d(h,A,R,"⇉","\\rightrightarrows",!0);d(h,A,R,"⇄","\\rightleftarrows",!0);d(h,A,R,"↠","\\twoheadrightarrow",!0);d(h,A,R,"↣","\\rightarrowtail",!0);d(h,A,R,"↬","\\looparrowright",!0);d(h,A,R,"↷","\\curvearrowright",!0);d(h,A,R,"↻","\\circlearrowright",!0);d(h,A,R,"↱","\\Rsh",!0);d(h,A,R,"⇊","\\downdownarrows",!0);d(h,A,R,"↾","\\upharpoonright",!0);d(h,A,R,"⇂","\\downharpoonright",!0);d(h,A,R,"⇝","\\rightsquigarrow",!0);d(h,A,R,"⇝","\\leadsto");d(h,A,R,"⇛","\\Rrightarrow",!0);d(h,A,R,"↾","\\restriction");d(h,v,B,"‘","`");d(h,v,B,"$","\\$");d(ee,v,B,"$","\\$");d(ee,v,B,"$","\\textdollar");d(h,v,B,"%","\\%");d(ee,v,B,"%","\\%");d(h,v,B,"_","\\_");d(ee,v,B,"_","\\_");d(ee,v,B,"_","\\textunderscore");d(h,v,B,"∠","\\angle",!0);d(h,v,B,"∞","\\infty",!0);d(h,v,B,"′","\\prime");d(h,v,B,"△","\\triangle");d(h,v,B,"Γ","\\Gamma",!0);d(h,v,B,"Δ","\\Delta",!0);d(h,v,B,"Θ","\\Theta",!0);d(h,v,B,"Λ","\\Lambda",!0);d(h,v,B,"Ξ","\\Xi",!0);d(h,v,B,"Π","\\Pi",!0);d(h,v,B,"Σ","\\Sigma",!0);d(h,v,B,"Υ","\\Upsilon",!0);d(h,v,B,"Φ","\\Phi",!0);d(h,v,B,"Ψ","\\Psi",!0);d(h,v,B,"Ω","\\Omega",!0);d(h,v,B,"A","Α");d(h,v,B,"B","Β");d(h,v,B,"E","Ε");d(h,v,B,"Z","Ζ");d(h,v,B,"H","Η");d(h,v,B,"I","Ι");d(h,v,B,"K","Κ");d(h,v,B,"M","Μ");d(h,v,B,"N","Ν");d(h,v,B,"O","Ο");d(h,v,B,"P","Ρ");d(h,v,B,"T","Τ");d(h,v,B,"X","Χ");d(h,v,B,"¬","\\neg",!0);d(h,v,B,"¬","\\lnot");d(h,v,B,"⊤","\\top");d(h,v,B,"⊥","\\bot");d(h,v,B,"∅","\\emptyset");d(h,A,B,"∅","\\varnothing");d(h,v,Fe,"α","\\alpha",!0);d(h,v,Fe,"β","\\beta",!0);d(h,v,Fe,"γ","\\gamma",!0);d(h,v,Fe,"δ","\\delta",!0);d(h,v,Fe,"ϵ","\\epsilon",!0);d(h,v,Fe,"ζ","\\zeta",!0);d(h,v,Fe,"η","\\eta",!0);d(h,v,Fe,"θ","\\theta",!0);d(h,v,Fe,"ι","\\iota",!0);d(h,v,Fe,"κ","\\kappa",!0);d(h,v,Fe,"λ","\\lambda",!0);d(h,v,Fe,"μ","\\mu",!0);d(h,v,Fe,"ν","\\nu",!0);d(h,v,Fe,"ξ","\\xi",!0);d(h,v,Fe,"ο","\\omicron",!0);d(h,v,Fe,"π","\\pi",!0);d(h,v,Fe,"ρ","\\rho",!0);d(h,v,Fe,"σ","\\sigma",!0);d(h,v,Fe,"τ","\\tau",!0);d(h,v,Fe,"υ","\\upsilon",!0);d(h,v,Fe,"ϕ","\\phi",!0);d(h,v,Fe,"χ","\\chi",!0);d(h,v,Fe,"ψ","\\psi",!0);d(h,v,Fe,"ω","\\omega",!0);d(h,v,Fe,"ε","\\varepsilon",!0);d(h,v,Fe,"ϑ","\\vartheta",!0);d(h,v,Fe,"ϖ","\\varpi",!0);d(h,v,Fe,"ϱ","\\varrho",!0);d(h,v,Fe,"ς","\\varsigma",!0);d(h,v,Fe,"φ","\\varphi",!0);d(h,v,we,"∗","*",!0);d(h,v,we,"+","+");d(h,v,we,"−","-",!0);d(h,v,we,"⋅","\\cdot",!0);d(h,v,we,"∘","\\circ",!0);d(h,v,we,"÷","\\div",!0);d(h,v,we,"±","\\pm",!0);d(h,v,we,"×","\\times",!0);d(h,v,we,"∩","\\cap",!0);d(h,v,we,"∪","\\cup",!0);d(h,v,we,"∖","\\setminus",!0);d(h,v,we,"∧","\\land");d(h,v,we,"∨","\\lor");d(h,v,we,"∧","\\wedge",!0);d(h,v,we,"∨","\\vee",!0);d(h,v,B,"√","\\surd");d(h,v,Nn,"⟨","\\langle",!0);d(h,v,Nn,"∣","\\lvert");d(h,v,Nn,"∥","\\lVert");d(h,v,vn,"?","?");d(h,v,vn,"!","!");d(h,v,vn,"⟩","\\rangle",!0);d(h,v,vn,"∣","\\rvert");d(h,v,vn,"∥","\\rVert");d(h,v,R,"=","=");d(h,v,R,":",":");d(h,v,R,"≈","\\approx",!0);d(h,v,R,"≅","\\cong",!0);d(h,v,R,"≥","\\ge");d(h,v,R,"≥","\\geq",!0);d(h,v,R,"←","\\gets");d(h,v,R,">","\\gt",!0);d(h,v,R,"∈","\\in",!0);d(h,v,R,"","\\@not");d(h,v,R,"⊂","\\subset",!0);d(h,v,R,"⊃","\\supset",!0);d(h,v,R,"⊆","\\subseteq",!0);d(h,v,R,"⊇","\\supseteq",!0);d(h,A,R,"⊈","\\nsubseteq",!0);d(h,A,R,"⊉","\\nsupseteq",!0);d(h,v,R,"⊨","\\models");d(h,v,R,"←","\\leftarrow",!0);d(h,v,R,"≤","\\le");d(h,v,R,"≤","\\leq",!0);d(h,v,R,"<","\\lt",!0);d(h,v,R,"→","\\rightarrow",!0);d(h,v,R,"→","\\to");d(h,A,R,"≱","\\ngeq",!0);d(h,A,R,"≰","\\nleq",!0);d(h,v,$r," ","\\ ");d(h,v,$r," ","\\space");d(h,v,$r," ","\\nobreakspace");d(ee,v,$r," ","\\ ");d(ee,v,$r," "," ");d(ee,v,$r," ","\\space");d(ee,v,$r," ","\\nobreakspace");d(h,v,$r,"","\\nobreak");d(h,v,$r,"","\\allowbreak");d(h,v,ha,",",",");d(h,v,ha,";",";");d(h,A,we,"⊼","\\barwedge",!0);d(h,A,we,"⊻","\\veebar",!0);d(h,v,we,"⊙","\\odot",!0);d(h,v,we,"⊕","\\oplus",!0);d(h,v,we,"⊗","\\otimes",!0);d(h,v,B,"∂","\\partial",!0);d(h,v,we,"⊘","\\oslash",!0);d(h,A,we,"⊚","\\circledcirc",!0);d(h,A,we,"⊡","\\boxdot",!0);d(h,v,we,"△","\\bigtriangleup");d(h,v,we,"▽","\\bigtriangledown");d(h,v,we,"†","\\dagger");d(h,v,we,"⋄","\\diamond");d(h,v,we,"⋆","\\star");d(h,v,we,"◃","\\triangleleft");d(h,v,we,"▹","\\triangleright");d(h,v,Nn,"{","\\{");d(ee,v,B,"{","\\{");d(ee,v,B,"{","\\textbraceleft");d(h,v,vn,"}","\\}");d(ee,v,B,"}","\\}");d(ee,v,B,"}","\\textbraceright");d(h,v,Nn,"{","\\lbrace");d(h,v,vn,"}","\\rbrace");d(h,v,Nn,"[","\\lbrack",!0);d(ee,v,B,"[","\\lbrack",!0);d(h,v,vn,"]","\\rbrack",!0);d(ee,v,B,"]","\\rbrack",!0);d(h,v,Nn,"(","\\lparen",!0);d(h,v,vn,")","\\rparen",!0);d(ee,v,B,"<","\\textless",!0);d(ee,v,B,">","\\textgreater",!0);d(h,v,Nn,"⌊","\\lfloor",!0);d(h,v,vn,"⌋","\\rfloor",!0);d(h,v,Nn,"⌈","\\lceil",!0);d(h,v,vn,"⌉","\\rceil",!0);d(h,v,B,"\\","\\backslash");d(h,v,B,"∣","|");d(h,v,B,"∣","\\vert");d(ee,v,B,"|","\\textbar",!0);d(h,v,B,"∥","\\|");d(h,v,B,"∥","\\Vert");d(ee,v,B,"∥","\\textbardbl");d(ee,v,B,"~","\\textasciitilde");d(ee,v,B,"\\","\\textbackslash");d(ee,v,B,"^","\\textasciicircum");d(h,v,R,"↑","\\uparrow",!0);d(h,v,R,"⇑","\\Uparrow",!0);d(h,v,R,"↓","\\downarrow",!0);d(h,v,R,"⇓","\\Downarrow",!0);d(h,v,R,"↕","\\updownarrow",!0);d(h,v,R,"⇕","\\Updownarrow",!0);d(h,v,Wt,"∐","\\coprod");d(h,v,Wt,"⋁","\\bigvee");d(h,v,Wt,"⋀","\\bigwedge");d(h,v,Wt,"⨄","\\biguplus");d(h,v,Wt,"⋂","\\bigcap");d(h,v,Wt,"⋃","\\bigcup");d(h,v,Wt,"∫","\\int");d(h,v,Wt,"∫","\\intop");d(h,v,Wt,"∬","\\iint");d(h,v,Wt,"∭","\\iiint");d(h,v,Wt,"∏","\\prod");d(h,v,Wt,"∑","\\sum");d(h,v,Wt,"⨂","\\bigotimes");d(h,v,Wt,"⨁","\\bigoplus");d(h,v,Wt,"⨀","\\bigodot");d(h,v,Wt,"∮","\\oint");d(h,v,Wt,"∯","\\oiint");d(h,v,Wt,"∰","\\oiiint");d(h,v,Wt,"⨆","\\bigsqcup");d(h,v,Wt,"∫","\\smallint");d(ee,v,mi,"…","\\textellipsis");d(h,v,mi,"…","\\mathellipsis");d(ee,v,mi,"…","\\ldots",!0);d(h,v,mi,"…","\\ldots",!0);d(h,v,mi,"⋯","\\@cdots",!0);d(h,v,mi,"⋱","\\ddots",!0);d(h,v,B,"⋮","\\varvdots");d(ee,v,B,"⋮","\\varvdots");d(h,v,Ct,"ˊ","\\acute");d(h,v,Ct,"ˋ","\\grave");d(h,v,Ct,"¨","\\ddot");d(h,v,Ct,"~","\\tilde");d(h,v,Ct,"ˉ","\\bar");d(h,v,Ct,"˘","\\breve");d(h,v,Ct,"ˇ","\\check");d(h,v,Ct,"^","\\hat");d(h,v,Ct,"⃗","\\vec");d(h,v,Ct,"˙","\\dot");d(h,v,Ct,"˚","\\mathring");d(h,v,Fe,"","\\@imath");d(h,v,Fe,"","\\@jmath");d(h,v,B,"ı","ı");d(h,v,B,"ȷ","ȷ");d(ee,v,B,"ı","\\i",!0);d(ee,v,B,"ȷ","\\j",!0);d(ee,v,B,"ß","\\ss",!0);d(ee,v,B,"æ","\\ae",!0);d(ee,v,B,"œ","\\oe",!0);d(ee,v,B,"ø","\\o",!0);d(ee,v,B,"Æ","\\AE",!0);d(ee,v,B,"Œ","\\OE",!0);d(ee,v,B,"Ø","\\O",!0);d(ee,v,Ct,"ˊ","\\'");d(ee,v,Ct,"ˋ","\\`");d(ee,v,Ct,"ˆ","\\^");d(ee,v,Ct,"˜","\\~");d(ee,v,Ct,"ˉ","\\=");d(ee,v,Ct,"˘","\\u");d(ee,v,Ct,"˙","\\.");d(ee,v,Ct,"¸","\\c");d(ee,v,Ct,"˚","\\r");d(ee,v,Ct,"ˇ","\\v");d(ee,v,Ct,"¨",'\\"');d(ee,v,Ct,"˝","\\H");d(ee,v,Ct,"◯","\\textcircled");var ym={"--":!0,"---":!0,"``":!0,"''":!0};d(ee,v,B,"–","--",!0);d(ee,v,B,"–","\\textendash");d(ee,v,B,"—","---",!0);d(ee,v,B,"—","\\textemdash");d(ee,v,B,"‘","`",!0);d(ee,v,B,"‘","\\textquoteleft");d(ee,v,B,"’","'",!0);d(ee,v,B,"’","\\textquoteright");d(ee,v,B,"“","``",!0);d(ee,v,B,"“","\\textquotedblleft");d(ee,v,B,"”","''",!0);d(ee,v,B,"”","\\textquotedblright");d(h,v,B,"°","\\degree",!0);d(ee,v,B,"°","\\degree");d(ee,v,B,"°","\\textdegree",!0);d(h,v,B,"£","\\pounds");d(h,v,B,"£","\\mathsterling",!0);d(ee,v,B,"£","\\pounds");d(ee,v,B,"£","\\textsterling",!0);d(h,A,B,"✠","\\maltese");d(ee,A,B,"✠","\\maltese");var Id='0123456789/@."';for(var Il=0;Il<Id.length;Il++){var Rd=Id.charAt(Il);d(h,v,B,Rd,Rd)}var Cd='0123456789!@*()-=+";:?/.,';for(var Rl=0;Rl<Cd.length;Rl++){var Od=Cd.charAt(Rl);d(ee,v,B,Od,Od)}var yo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(var Cl=0;Cl<yo.length;Cl++){var za=yo.charAt(Cl);d(h,v,Fe,za,za),d(ee,v,B,za,za)}d(h,A,B,"C","ℂ");d(ee,A,B,"C","ℂ");d(h,A,B,"H","ℍ");d(ee,A,B,"H","ℍ");d(h,A,B,"N","ℕ");d(ee,A,B,"N","ℕ");d(h,A,B,"P","ℙ");d(ee,A,B,"P","ℙ");d(h,A,B,"Q","ℚ");d(ee,A,B,"Q","ℚ");d(h,A,B,"R","ℝ");d(ee,A,B,"R","ℝ");d(h,A,B,"Z","ℤ");d(ee,A,B,"Z","ℤ");d(h,v,Fe,"h","ℎ");d(ee,v,Fe,"h","ℎ");var qe;for(var un=0;un<yo.length;un++){var Bt=yo.charAt(un);qe=String.fromCharCode(55349,56320+un),d(h,v,Fe,Bt,qe),d(ee,v,B,Bt,qe),qe=String.fromCharCode(55349,56372+un),d(h,v,Fe,Bt,qe),d(ee,v,B,Bt,qe),qe=String.fromCharCode(55349,56424+un),d(h,v,Fe,Bt,qe),d(ee,v,B,Bt,qe),qe=String.fromCharCode(55349,56580+un),d(h,v,Fe,Bt,qe),d(ee,v,B,Bt,qe),qe=String.fromCharCode(55349,56684+un),d(h,v,Fe,Bt,qe),d(ee,v,B,Bt,qe),qe=String.fromCharCode(55349,56736+un),d(h,v,Fe,Bt,qe),d(ee,v,B,Bt,qe),qe=String.fromCharCode(55349,56788+un),d(h,v,Fe,Bt,qe),d(ee,v,B,Bt,qe),qe=String.fromCharCode(55349,56840+un),d(h,v,Fe,Bt,qe),d(ee,v,B,Bt,qe),qe=String.fromCharCode(55349,56944+un),d(h,v,Fe,Bt,qe),d(ee,v,B,Bt,qe),un<26&&(qe=String.fromCharCode(55349,56632+un),d(h,v,Fe,Bt,qe),d(ee,v,B,Bt,qe),qe=String.fromCharCode(55349,56476+un),d(h,v,Fe,Bt,qe),d(ee,v,B,Bt,qe))}qe="𝕜";d(h,v,Fe,"k",qe);d(ee,v,B,"k",qe);for(var xs=0;xs<10;xs++){var jr=xs.toString();qe=String.fromCharCode(55349,57294+xs),d(h,v,Fe,jr,qe),d(ee,v,B,jr,qe),qe=String.fromCharCode(55349,57314+xs),d(h,v,Fe,jr,qe),d(ee,v,B,jr,qe),qe=String.fromCharCode(55349,57324+xs),d(h,v,Fe,jr,qe),d(ee,v,B,jr,qe),qe=String.fromCharCode(55349,57334+xs),d(h,v,Fe,jr,qe),d(ee,v,B,jr,qe)}var Ec="ÐÞþ";for(var Ol=0;Ol<Ec.length;Ol++){var $a=Ec.charAt(Ol);d(h,v,Fe,$a,$a),d(ee,v,B,$a,$a)}var Ac={mathClass:"mathbf",textClass:"textbf",font:"Main-Bold"},Md={mathClass:"mathnormal",textClass:"textit",font:"Math-Italic"},Nd={mathClass:"boldsymbol",textClass:"boldsymbol",font:"Main-BoldItalic"},z7={mathClass:"mathscr",textClass:"textscr",font:"Script-Regular"},Es={mathClass:"",textClass:"",font:""},zd={mathClass:"mathfrak",textClass:"textfrak",font:"Fraktur-Regular"},$d={mathClass:"mathbb",textClass:"textbb",font:"AMS-Regular"},Dd={mathClass:"mathboldfrak",textClass:"textboldfrak",font:"Fraktur-Regular"},Tc={mathClass:"mathsf",textClass:"textsf",font:"SansSerif-Regular"},Ic={mathClass:"mathboldsf",textClass:"textboldsf",font:"SansSerif-Bold"},Pd={mathClass:"mathitsf",textClass:"textitsf",font:"SansSerif-Italic"},Rc={mathClass:"mathtt",textClass:"texttt",font:"Typewriter-Regular"},Bd=[Ac,Ac,Md,Md,Nd,Nd,z7,Es,Es,Es,zd,zd,$d,$d,Dd,Dd,Tc,Tc,Ic,Ic,Pd,Pd,Es,Es,Rc,Rc],$7=[Ac,Es,Tc,Ic,Rc],D7=e=>{var t=e.charCodeAt(0),n=e.charCodeAt(1),r=(t-55296)*1024+(n-56320)+65536;if(119808<=r&&r<120484){var s=Math.floor((r-119808)/26);return Bd[s]}else if(120782<=r&&r<=120831){var i=Math.floor((r-120782)/10);return $7[i]}else{if(r===120485||r===120486)return Bd[0];if(120486<r&&r<120782)return Es;throw new ae("Unsupported character: "+e)}},Uo=function(t,n,r){if(Rt[r][t]){var s=Rt[r][t].replace;s&&(t=s)}return{value:t,metrics:$0(t,n,r)}},pn=function(t,n,r,s,i){var a=Uo(t,n,r),o=a.metrics;t=a.value;var l;if(o){var c=o.italic;(r==="text"||s&&s.font==="mathit")&&(c=0),l=new Mn(t,o.height,o.depth,c,o.skew,o.width,i)}else typeof console<"u"&&console.warn("No character metrics "+("for '"+t+"' in style '"+n+"' and mode '"+r+"'")),l=new Mn(t,0,0,0,0,0,i);if(s){l.maxFontSize=s.sizeMultiplier,s.style.isTight()&&l.classes.push("mtight");var u=s.getColor();u&&(l.style.color=u)}return l},D0=function(t,n,r,s){return s===void 0&&(s=[]),r.font==="boldsymbol"&&Uo(t,"Main-Bold",n).metrics?pn(t,"Main-Bold",n,r,s.concat(["mathbf"])):t==="\\"||Rt[n][t].font==="main"?pn(t,"Main-Regular",n,r,s):pn(t,"AMS-Regular",n,r,s.concat(["amsrm"]))},P7=function(t,n,r){return r!=="textord"&&Uo(t,"Math-BoldItalic",n).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}},qo=function(t,n){var r=t.type==="mathord"?"mathord":"textord",s=t.mode,i=t.text,a=["mord"],{font:o,fontFamily:l,fontWeight:c,fontShape:u}=n,p=s==="math"||s==="text"&&!!o,m=p?o:l,f="",y="";if(i.charCodeAt(0)===55349){var b=D7(i);f=b.font,y=b[s+"Class"]}if(f)return pn(i,f,s,n,a.concat(y));if(m){var x,S;if(m==="boldsymbol"){var N=P7(i,s,r);x=N.fontName,S=[N.fontClass]}else p?(x=Cc[o].fontName,S=[o]):(x=Da(l,c,u),S=[l,c,u]);if(Uo(i,x,s).metrics)return pn(i,x,s,n,a.concat(S));if(ym.hasOwnProperty(i)&&x.slice(0,10)==="Typewriter"){for(var z=[],I=0;I<i.length;I++)z.push(pn(i[I],x,s,n,a.concat(S)));return Dr(z)}}if(r==="mathord")return pn(i,"Math-Italic",s,n,a.concat(["mathnormal"]));if(r==="textord"){var E=Rt[s][i]&&Rt[s][i].font;if(E==="ams"){var _=Da("amsrm",c,u);return pn(i,_,s,n,a.concat("amsrm",c,u))}else if(E==="main"||!E){var L=Da("textrm",c,u);return pn(i,L,s,n,a.concat(c,u))}else{var M=Da(E,c,u);return pn(i,M,s,n,a.concat(M,c,u))}}else throw new Error("unexpected type: "+r+" in makeOrd")},B7=(e,t)=>{if(is(e.classes)!==is(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize||e.italic!==0&&e.hasClass("mathnormal"))return!1;if(e.classes.length===1){var n=e.classes[0];if(n==="mbin"||n==="mord")return!1}for(var r of Object.keys(e.style))if(e.style[r]!==t.style[r])return!1;for(var s of Object.keys(t.style))if(e.style[s]!==t.style[s])return!1;return!0},wm=e=>{for(var t=0;t<e.length-1;t++){var n=e[t],r=e[t+1];n instanceof Mn&&r instanceof Mn&&B7(n,r)&&(n.text+=r.text,n.height=Math.max(n.height,r.height),n.depth=Math.max(n.depth,r.depth),n.italic=r.italic,e.splice(t+1,1),t--)}return e},P0=function(t){for(var n=0,r=0,s=0,i=0;i<t.children.length;i++){var a=t.children[i];a.height>n&&(n=a.height),a.depth>r&&(r=a.depth),a.maxFontSize>s&&(s=a.maxFontSize)}t.height=n,t.depth=r,t.maxFontSize=s},te=function(t,n,r,s){var i=new pi(t,n,r,s);return P0(i),i},os=(e,t,n,r)=>new pi(e,t,n,r),ri=function(t,n,r){var s=te([t],[],n);return s.height=Math.max(r||n.fontMetrics().defaultRuleThickness,n.minRuleThickness),s.style.borderBottomWidth=ue(s.height),s.maxFontSize=1,s},L7=function(t,n,r,s){var i=new Fo(t,n,r,s);return P0(i),i},Dr=function(t){var n=new hi(t);return P0(n),n},si=function(t,n){return t instanceof hi?te([],[t],n):t},F7=function(t){if(t.positionType==="individualShift"){for(var n=t.children,r=[n[0]],s=-n[0].shift-n[0].elem.depth,i=s,a=1;a<n.length;a++){var o=-n[a].shift-i-n[a].elem.depth,l=o-(n[a-1].elem.height+n[a-1].elem.depth);i=i+o,r.push({type:"kern",size:l}),r.push(n[a])}return{children:r,depth:s}}var c;if(t.positionType==="top"){for(var u=t.positionData,p=0;p<t.children.length;p++){var m=t.children[p];u-=m.type==="kern"?m.size:m.elem.height+m.elem.depth}c=u}else if(t.positionType==="bottom")c=-t.positionData;else{var f=t.children[0];if(f.type!=="elem")throw new Error('First child must have type "elem".');if(t.positionType==="shift")c=-f.elem.depth-t.positionData;else if(t.positionType==="firstBaseline")c=-f.elem.depth;else throw new Error("Invalid positionType "+t.positionType+".")}return{children:t.children,depth:c}},dt=function(t,n){for(var{children:r,depth:s}=F7(t),i=0,a=0;a<r.length;a++){var o=r[a];if(o.type==="elem"){var l=o.elem;i=Math.max(i,l.maxFontSize,l.height)}}i+=2;var c=te(["pstrut"],[]);c.style.height=ue(i);for(var u=[],p=s,m=s,f=s,y=0;y<r.length;y++){var b=r[y];if(b.type==="kern")f+=b.size;else{var x=b.elem,S=b.wrapperClasses||[],N=b.wrapperStyle||{},z=te(S,[c,x],void 0,N);z.style.top=ue(-i-f-x.depth),b.marginLeft&&(z.style.marginLeft=b.marginLeft),b.marginRight&&(z.style.marginRight=b.marginRight),u.push(z),f+=x.height+x.depth}p=Math.min(p,f),m=Math.max(m,f)}var I=te(["vlist"],u);I.style.height=ue(m);var E;if(p<0){var _=te([],[]),L=te(["vlist"],[_]);L.style.height=ue(-p);var M=te(["vlist-s"],[new Mn("")]);E=[te(["vlist-r"],[I,M]),te(["vlist-r"],[L])]}else E=[te(["vlist-r"],[I])];var G=te(["vlist-t"],E);return E.length===2&&G.classes.push("vlist-t2"),G.height=m,G.depth=-p,G},Sm=(e,t)=>{var n=te(["mspace"],[],t),r=zt(e,t);return n.style.marginRight=ue(r),n},Da=(e,t,n)=>{var r,s;switch(e){case"amsrm":r="AMS";break;case"textrm":r="Main";break;case"textsf":r="SansSerif";break;case"texttt":r="Typewriter";break;default:r=e}return t==="textbf"&&n==="textit"?s="BoldItalic":t==="textbf"?s="Bold":n==="textit"?s="Italic":s="Regular",r+"-"+s},Cc={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},xm={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},km=function(t,n){var[r,s,i]=xm[t],a=new as(r),o=new Or([a],{width:ue(s),height:ue(i),style:"width:"+ue(s),viewBox:"0 0 "+1e3*s+" "+1e3*i,preserveAspectRatio:"xMinYMin"}),l=os(["overlay"],[o],n);return l.height=i,l.style.height=ue(i),l.style.width=ue(s),l},Mt={number:3,unit:"mu"},ks={number:4,unit:"mu"},Sr={number:5,unit:"mu"},U7={mord:{mop:Mt,mbin:ks,mrel:Sr,minner:Mt},mop:{mord:Mt,mop:Mt,mrel:Sr,minner:Mt},mbin:{mord:ks,mop:ks,mopen:ks,minner:ks},mrel:{mord:Sr,mop:Sr,mopen:Sr,minner:Sr},mopen:{},mclose:{mop:Mt,mbin:ks,mrel:Sr,minner:Mt},mpunct:{mord:Mt,mop:Mt,mrel:Sr,mopen:Mt,mclose:Mt,mpunct:Mt,minner:Mt},minner:{mord:Mt,mop:Mt,mbin:ks,mrel:Sr,mopen:Mt,mpunct:Mt,minner:Mt}},q7={mord:{mop:Mt},mop:{mord:Mt,mop:Mt},mbin:{},mrel:{},mopen:{},mclose:{mop:Mt},mpunct:{},minner:{mop:Mt}},_m={},ta={},na={};function be(e){for(var{type:t,names:n,htmlBuilder:r,mathmlBuilder:s}=e,i=0;i<n.length;++i)_m[n[i]]=e;t&&(r&&(ta[t]=r),s&&(na[t]=s))}function Ls(e){var{type:t,htmlBuilder:n,mathmlBuilder:r}=e;n&&(ta[t]=n),r&&(na[t]=r)}var wo=function(t){return t.type==="ordgroup"&&t.body.length===1?t.body[0]:t},Gt=function(t){return t.type==="ordgroup"?t.body:[t]},H7=new Set(["leftmost","mbin","mopen","mrel","mop","mpunct"]),V7=new Set(["rightmost","mrel","mclose","mpunct"]),j7={display:Ze.DISPLAY,text:Ze.TEXT,script:Ze.SCRIPT,scriptscript:Ze.SCRIPTSCRIPT},G7={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},tn=function(t,n,r,s){s===void 0&&(s=[null,null]);for(var i=[],a=0;a<t.length;a++){var o=ht(t[a],n);if(o instanceof hi){var l=o.children;i.push(...l)}else i.push(o)}if(wm(i),!r)return i;var c=n;if(t.length===1){var u=t[0];u.type==="sizing"?c=n.havingSize(u.size):u.type==="styling"&&(c=n.havingStyle(j7[u.style]))}var p=te([s[0]||"leftmost"],[],n),m=te([s[1]||"rightmost"],[],n),f=r==="root";return Oc(i,(y,b)=>{var x=b.classes[0],S=y.classes[0];x==="mbin"&&V7.has(S)?b.classes[0]="mord":S==="mbin"&&H7.has(x)&&(y.classes[0]="mord")},{node:p},m,f),Oc(i,(y,b)=>{var x,S,N=Nc(b),z=Nc(y),I=N&&z?y.hasClass("mtight")?(x=q7[N])==null?void 0:x[z]:(S=U7[N])==null?void 0:S[z]:null;if(I)return Sm(I,c)},{node:p},m,f),i},Oc=function(t,n,r,s,i){s&&t.push(s);for(var a=0;a<t.length;a++){var o=t[a],l=Em(o);if(l){Oc(l.children,n,r,null,i);continue}var c=!o.hasClass("mspace");if(c){var u=n(o,r.node);u&&(r.insertAfter?r.insertAfter(u):(t.unshift(u),a++))}c?r.node=o:i&&o.hasClass("newline")&&(r.node=te(["leftmost"])),r.insertAfter=(p=>m=>{t.splice(p+1,0,m),a++})(a)}s&&t.pop()},Em=function(t){return t instanceof hi||t instanceof Fo||t instanceof pi&&t.hasClass("enclosing")?t:null},Mc=function(t,n){var r=Em(t);if(r){var s=r.children;if(s.length){if(n==="right")return Mc(s[s.length-1],"right");if(n==="left")return Mc(s[0],"left")}}return t},Nc=function(t,n){if(!t)return null;n&&(t=Mc(t,n));var r=t.classes[0];return G7[r]||null},ra=function(t,n){var r=["nulldelimiter"].concat(t.baseSizingClasses());return te(n.concat(r))},ht=function(t,n,r){if(!t)return te();if(ta[t.type]){var s=ta[t.type](t,n);if(r&&n.size!==r.size){s=te(n.sizingClasses(r),[s],n);var i=n.sizeMultiplier/r.sizeMultiplier;s.height*=i,s.depth*=i}return s}else throw new ae("Got group of unknown type: '"+t.type+"'")};function Pa(e,t){var n=te(["base"],e,t),r=te(["strut"]);return r.style.height=ue(n.height+n.depth),n.depth&&(r.style.verticalAlign=ue(-n.depth)),n.children.unshift(r),n}function zc(e,t){var n=null;e.length===1&&e[0].type==="tag"&&(n=e[0].tag,e=e[0].body);var r=tn(e,t,"root"),s;r.length===2&&r[1].hasClass("tag")&&(s=r.pop());for(var i=[],a=[],o=0;o<r.length;o++)if(a.push(r[o]),r[o].hasClass("mbin")||r[o].hasClass("mrel")||r[o].hasClass("allowbreak")){for(var l=!1;o<r.length-1&&r[o+1].hasClass("mspace")&&!r[o+1].hasClass("newline");)o++,a.push(r[o]),r[o].hasClass("nobreak")&&(l=!0);l||(i.push(Pa(a,t)),a=[])}else r[o].hasClass("newline")&&(a.pop(),a.length>0&&(i.push(Pa(a,t)),a=[]),i.push(r[o]));a.length>0&&i.push(Pa(a,t));var c;n?(c=Pa(tn(n,t,!0),t),c.classes=["tag"],i.push(c)):s&&i.push(s);var u=te(["katex-html"],i);if(u.setAttribute("aria-hidden","true"),c){var p=c.children[0];p.style.height=ue(u.height+u.depth),u.depth&&(p.style.verticalAlign=ue(-u.depth))}return u}function Am(e){return new hi(e)}class oe{constructor(t,n,r){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=t,this.attributes={},this.children=n||[],this.classes=r||[]}setAttribute(t,n){this.attributes[t]=n}getAttribute(t){return this.attributes[t]}toNode(){var t=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&t.setAttribute(n,this.attributes[n]);this.classes.length>0&&(t.className=is(this.classes));for(var r=0;r<this.children.length;r++)if(this.children[r]instanceof Zt&&this.children[r+1]instanceof Zt){for(var s=this.children[r].toText()+this.children[++r].toText();this.children[r+1]instanceof Zt;)s+=this.children[++r].toText();t.appendChild(new Zt(s).toNode())}else t.appendChild(this.children[r].toNode());return t}toMarkup(){var t="<"+this.type;for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&(t+=" "+n+'="',t+=ln(this.attributes[n]),t+='"');this.classes.length>0&&(t+=' class ="'+ln(is(this.classes))+'"'),t+=">";for(var r=0;r<this.children.length;r++)t+=this.children[r].toMarkup();return t+="</"+this.type+">",t}toText(){return this.children.map(t=>t.toText()).join("")}}class Zt{constructor(t){this.text=void 0,this.text=t}toNode(){return document.createTextNode(this.text)}toMarkup(){return ln(this.toText())}toText(){return this.text}}class Tm{constructor(t){this.width=void 0,this.character=void 0,this.width=t,t>=.05555&&t<=.05556?this.character=" ":t>=.1666&&t<=.1667?this.character=" ":t>=.2222&&t<=.2223?this.character=" ":t>=.2777&&t<=.2778?this.character=" ":t>=-.05556&&t<=-.05555?this.character=" ":t>=-.1667&&t<=-.1666?this.character=" ":t>=-.2223&&t<=-.2222?this.character=" ":t>=-.2778&&t<=-.2777?this.character=" ":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var t=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return t.setAttribute("width",ue(this.width)),t}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+ue(this.width)+'"/>'}toText(){return this.character?this.character:" "}}var Z7=new Set(["\\imath","\\jmath"]),K7=new Set(["mrow","mtable"]),Fn=function(t,n,r){return Rt[n][t]&&Rt[n][t].replace&&t.charCodeAt(0)!==55349&&!(ym.hasOwnProperty(t)&&r&&(r.fontFamily&&r.fontFamily.slice(4,6)==="tt"||r.font&&r.font.slice(4,6)==="tt"))&&(t=Rt[n][t].replace),new Zt(t)},B0=function(t){return t.length===1?t[0]:new oe("mrow",t)},W7={mathit:"italic",boldsymbol:e=>e.type==="textord"?"bold":"bold-italic",mathbf:"bold",mathbb:"double-struck",mathsfit:"sans-serif-italic",mathfrak:"fraktur",mathscr:"script",mathcal:"script",mathsf:"sans-serif",mathtt:"monospace"},L0=(e,t)=>{if(e.mode==="text"){if(t.fontFamily==="texttt")return"monospace";if(t.fontFamily==="textsf")return t.fontShape==="textit"&&t.fontWeight==="textbf"?"sans-serif-bold-italic":t.fontShape==="textit"?"sans-serif-italic":t.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(t.fontShape==="textit"&&t.fontWeight==="textbf")return"bold-italic";if(t.fontShape==="textit")return"italic";if(t.fontWeight==="textbf")return"bold"}var n=t.font;if(!n||n==="mathnormal")return null;var r=e.mode,s=W7[n];if(s)return typeof s=="function"?s(e):s;var i=e.text;if(Z7.has(i))return null;if(Rt[r][i]){var a=Rt[r][i].replace;a&&(i=a)}var o=Cc[n].fontName;return $0(i,o,r)?Cc[n].variant:null};function Ml(e){if(!e)return!1;if(e.type==="mi"&&e.children.length===1){var t=e.children[0];return t instanceof Zt&&t.text==="."}else if(e.type==="mo"&&e.children.length===1&&e.getAttribute("separator")==="true"&&e.getAttribute("lspace")==="0em"&&e.getAttribute("rspace")==="0em"){var n=e.children[0];return n instanceof Zt&&n.text===","}else return!1}var zn=function(t,n,r){if(t.length===1){var s=xt(t[0],n);return r&&s instanceof oe&&s.type==="mo"&&(s.setAttribute("lspace","0em"),s.setAttribute("rspace","0em")),[s]}for(var i=[],a,o=0;o<t.length;o++){var l=xt(t[o],n);if(l instanceof oe&&a instanceof oe){if(l.type==="mtext"&&a.type==="mtext"&&l.getAttribute("mathvariant")===a.getAttribute("mathvariant")){a.children.push(...l.children);continue}else if(l.type==="mn"&&a.type==="mn"){a.children.push(...l.children);continue}else if(Ml(l)&&a.type==="mn"){a.children.push(...l.children);continue}else if(l.type==="mn"&&Ml(a))l.children=[...a.children,...l.children],i.pop();else if((l.type==="msup"||l.type==="msub")&&l.children.length>=1&&(a.type==="mn"||Ml(a))){var c=l.children[0];c instanceof oe&&c.type==="mn"&&(c.children=[...a.children,...c.children],i.pop())}else if(a.type==="mi"&&a.children.length===1){var u=a.children[0];if(u instanceof Zt&&u.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var p=l.children[0];p instanceof Zt&&p.text.length>0&&(p.text=p.text.slice(0,1)+"̸"+p.text.slice(1),i.pop())}}}i.push(l),a=l}return i},ls=function(t,n,r){return B0(zn(t,n,r))},xt=function(t,n){if(!t)return new oe("mrow");if(na[t.type])return na[t.type](t,n);throw new ae("Got group of unknown type: '"+t.type+"'")};function Ld(e,t,n,r,s){var i=zn(e,n),a;i.length===1&&i[0]instanceof oe&&K7.has(i[0].type)?a=i[0]:a=new oe("mrow",i);var o=new oe("annotation",[new Zt(t)]);o.setAttribute("encoding","application/x-tex");var l=new oe("semantics",[a,o]),c=new oe("math",[l]);c.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&c.setAttribute("display","block");var u=s?"katex":"katex-mathml";return te([u],[c])}var Q7=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],Fd=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Ud=function(t,n){return n.size<2?t:Q7[t-1][n.size-1]};class kr{constructor(t){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=t.style,this.color=t.color,this.size=t.size||kr.BASESIZE,this.textSize=t.textSize||this.size,this.phantom=!!t.phantom,this.font=t.font||"",this.fontFamily=t.fontFamily||"",this.fontWeight=t.fontWeight||"",this.fontShape=t.fontShape||"",this.sizeMultiplier=Fd[this.size-1],this.maxSize=t.maxSize,this.minRuleThickness=t.minRuleThickness,this._fontMetrics=void 0}extend(t){var n={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(n,t),new kr(n)}havingStyle(t){return this.style===t?this:this.extend({style:t,size:Ud(this.textSize,t)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(t){return this.size===t&&this.textSize===t?this:this.extend({style:this.style.text(),size:t,textSize:t,sizeMultiplier:Fd[t-1]})}havingBaseStyle(t){t=t||this.style.text();var n=Ud(kr.BASESIZE,t);return this.size===n&&this.textSize===kr.BASESIZE&&this.style===t?this:this.extend({style:t,size:n})}havingBaseSizing(){var t;switch(this.style.id){case 4:case 5:t=3;break;case 6:case 7:t=1;break;default:t=6}return this.extend({style:this.style.text(),size:t})}withColor(t){return this.extend({color:t})}withPhantom(){return this.extend({phantom:!0})}withFont(t){return this.extend({font:t})}withTextFontFamily(t){return this.extend({fontFamily:t,font:""})}withTextFontWeight(t){return this.extend({fontWeight:t,font:""})}withTextFontShape(t){return this.extend({fontShape:t,font:""})}sizingClasses(t){return t.size!==this.size?["sizing","reset-size"+t.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==kr.BASESIZE?["sizing","reset-size"+this.size,"size"+kr.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=N7(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}kr.BASESIZE=6;var Im=function(t){return new kr({style:t.displayMode?Ze.DISPLAY:Ze.TEXT,maxSize:t.maxSize,minRuleThickness:t.minRuleThickness})},Rm=function(t,n){if(n.displayMode){var r=["katex-display"];n.leqno&&r.push("leqno"),n.fleqn&&r.push("fleqn"),t=te(r,[t])}return t},J7=function(t,n,r){var s=Im(r),i;if(r.output==="mathml")return Ld(t,n,s,r.displayMode,!0);if(r.output==="html"){var a=zc(t,s);i=te(["katex"],[a])}else{var o=Ld(t,n,s,r.displayMode,!1),l=zc(t,s);i=te(["katex"],[o,l])}return Rm(i,r)},Y7=function(t,n,r){var s=Im(r),i=zc(t,s),a=te(["katex"],[i]);return Rm(a,r)},X7={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",underbracket:"⎵",overbracket:"⎴",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},Ho=function(t){var n=new oe("mo",[new Zt(X7[t.replace(/^\\/,"")])]);return n.setAttribute("stretchy","true"),n},e8={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overbracket:[["leftbracketover","rightbracketover"],1.6,440],underbracket:[["leftbracketunder","rightbracketunder"],1.6,410],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},t8=new Set(["widehat","widecheck","widetilde","utilde"]),Vo=function(t,n){function r(){var o=4e5,l=t.label.slice(1);if(t8.has(l)&&"base"in t){var c=t.base.type==="ordgroup"?t.base.body.length:1,u,p,m;if(c>5)l==="widehat"||l==="widecheck"?(u=420,o=2364,m=.42,p=l+"4"):(u=312,o=2340,m=.34,p="tilde4");else{var f=[1,1,2,2,3,3][c];l==="widehat"||l==="widecheck"?(o=[0,1062,2364,2364,2364][f],u=[0,239,300,360,420][f],m=[0,.24,.3,.3,.36,.42][f],p=l+f):(o=[0,600,1033,2339,2340][f],u=[0,260,286,306,312][f],m=[0,.26,.286,.3,.306,.34][f],p="tilde"+f)}var y=new as(p),b=new Or([y],{width:"100%",height:ue(m),viewBox:"0 0 "+o+" "+u,preserveAspectRatio:"none"});return{span:os([],[b],n),minWidth:0,height:m}}else{var x=[],S=e8[l];if(!S)throw new Error('No SVG data for "'+l+'".');var[N,z,I]=S,E=I/1e3,_=N.length,L,M;if(_===1){if(S.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+l+'".');L=["hide-tail"],M=[S[3]]}else if(_===2)L=["halfarrow-left","halfarrow-right"],M=["xMinYMin","xMaxYMin"];else if(_===3)L=["brace-left","brace-center","brace-right"],M=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support
|
|
313
|
+
`+_+" children.");for(var G=0;G<_;G++){var P=new as(N[G]),W=new Or([P],{width:"400em",height:ue(E),viewBox:"0 0 "+o+" "+I,preserveAspectRatio:M[G]+" slice"}),q=os([L[G]],[W],n);if(_===1)return{span:q,minWidth:z,height:E};q.style.height=ue(E),x.push(q)}return{span:te(["stretchy"],x,n),minWidth:z,height:E}}}var{span:s,minWidth:i,height:a}=r();return s.height=a,s.style.height=ue(a),i>0&&(s.style.minWidth=ue(i)),s},n8=function(t,n,r,s,i){var a,o=t.height+t.depth+r+s;if(/fbox|color|angl/.test(n)){if(a=te(["stretchy",n],[],i),n==="fbox"){var l=i.color&&i.getColor();l&&(a.style.borderColor=l)}}else{var c=[];/^[bx]cancel$/.test(n)&&c.push(new _c({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(n)&&c.push(new _c({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var u=new Or(c,{width:"100%",height:ue(o)});a=os([],[u],i)}return a.height=o,a.style.height=ue(o),a},r8={bin:1,close:1,inner:1,open:1,punct:1,rel:1},s8={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function i8(e){return e in r8}function Je(e,t){if(!e||e.type!==t)throw new Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)));return e}function jo(e){var t=Go(e);if(!t)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return t}function Go(e){return e&&(e.type==="atom"||s8.hasOwnProperty(e.type))?e:null}var Cm=e=>{if(e instanceof Mn)return e;if(O7(e)&&e.children.length===1)return Cm(e.children[0])},Om=(e,t)=>{var n,r,s;e&&e.type==="supsub"?(r=Je(e.base,"accent"),n=r.base,e.base=n,s=C7(ht(e,t)),e.base=r):(r=Je(e,"accent"),n=r.base);var i=ht(n,t.havingCrampedStyle()),a=r.isShifty&&zr(n),o=0;if(a){var l,c;o=(l=(c=Cm(i))==null?void 0:c.skew)!=null?l:0}var u=r.label==="\\c",p=u?i.height+i.depth:Math.min(i.height,t.fontMetrics().xHeight),m;if(r.isStretchy)m=Vo(r,t),m=dt({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"elem",elem:m,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+ue(2*o)+")",marginLeft:ue(2*o)}:void 0}]});else{var f,y;r.label==="\\vec"?(f=km("vec",t),y=xm.vec[1]):(f=qo({type:"textord",mode:r.mode,text:r.label},t),f=R7(f),f.italic=0,y=f.width,u&&(p+=f.depth)),m=te(["accent-body"],[f]);var b=r.label==="\\textcircled";b&&(m.classes.push("accent-full"),p=i.height);var x=o;b||(x-=y/2),m.style.left=ue(x),r.label==="\\textcircled"&&(m.style.top=".2em"),m=dt({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:-p},{type:"elem",elem:m}]})}var S=te(["mord","accent"],[m],t);return s?(s.children[0]=S,s.height=Math.max(S.height,s.height),s.classes[0]="mord",s):S},a8=(e,t)=>{var n=e.isStretchy?Ho(e.label):new oe("mo",[Fn(e.label,e.mode)]),r=new oe("mover",[xt(e.base,t),n]);return r.setAttribute("accent","true"),r},o8=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));be({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"],numArgs:1,handler:(e,t)=>{var n=wo(t[0]),r=!o8.test(e.funcName),s=!r||e.funcName==="\\widehat"||e.funcName==="\\widetilde"||e.funcName==="\\widecheck";return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:s,base:n}},htmlBuilder:Om,mathmlBuilder:a8});be({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"],handler:(e,t)=>{var n=t[0],r=e.parser.mode;return r==="math"&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}}});be({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],numArgs:1,handler:(e,t)=>{var{parser:n,funcName:r}=e,s=t[0];return{type:"accentUnder",mode:n.mode,label:r,base:s}},htmlBuilder:(e,t)=>{var n=ht(e.base,t),r=Vo(e,t),s=e.label==="\\utilde"?.12:0,i=dt({positionType:"top",positionData:n.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:s},{type:"elem",elem:n}]});return te(["mord","accentunder"],[i],t)},mathmlBuilder:(e,t)=>{var n=Ho(e.label),r=new oe("munder",[xt(e.base,t),n]);return r.setAttribute("accentunder","true"),r}});var Ba=e=>{var t=new oe("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};be({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],numArgs:1,numOptionalArgs:1,handler(e,t,n){var{parser:r,funcName:s}=e;return{type:"xArrow",mode:r.mode,label:s,body:t[0],below:n[0]}},htmlBuilder(e,t){var n=t.style,r=t.havingStyle(n.sup()),s=si(ht(e.body,r,t),t),i=e.label.slice(0,2)==="\\x"?"x":"cd";s.classes.push(i+"-arrow-pad");var a;e.below&&(r=t.havingStyle(n.sub()),a=si(ht(e.below,r,t),t),a.classes.push(i+"-arrow-pad"));var o=Vo(e,t),l=-t.fontMetrics().axisHeight+.5*o.height,c=-t.fontMetrics().axisHeight-.5*o.height-.111;(s.depth>.25||e.label==="\\xleftequilibrium")&&(c-=s.depth);var u;if(a){var p=-t.fontMetrics().axisHeight+a.height+.5*o.height+.111;u=dt({positionType:"individualShift",children:[{type:"elem",elem:s,shift:c},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]},{type:"elem",elem:a,shift:p}]})}else u=dt({positionType:"individualShift",children:[{type:"elem",elem:s,shift:c},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]}]});return te(["mrel","x-arrow"],[u],t)},mathmlBuilder(e,t){var n=Ho(e.label);n.setAttribute("minsize",e.label.charAt(0)==="x"?"1.75em":"3.0em");var r;if(e.body){var s=Ba(xt(e.body,t));if(e.below){var i=Ba(xt(e.below,t));r=new oe("munderover",[n,i,s])}else r=new oe("mover",[n,s])}else if(e.below){var a=Ba(xt(e.below,t));r=new oe("munder",[n,a])}else r=Ba(),r=new oe("mover",[n,r]);return r}});function l8(e,t){var n=tn(e.body,t,!0);return te([e.mclass],n,t)}function c8(e,t){var n,r=zn(e.body,t);return e.mclass==="minner"?n=new oe("mpadded",r):e.mclass==="mord"?e.isCharacterBox?(n=r[0],n.type="mi"):n=new oe("mi",r):(e.isCharacterBox?(n=r[0],n.type="mo"):n=new oe("mo",r),e.mclass==="mbin"?(n.attributes.lspace="0.22em",n.attributes.rspace="0.22em"):e.mclass==="mpunct"?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):(e.mclass==="mopen"||e.mclass==="mclose")&&(n.attributes.lspace="0em",n.attributes.rspace="0em")),n}be({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],numArgs:1,primitive:!0,handler(e,t){var{parser:n,funcName:r}=e,s=t[0];return{type:"mclass",mode:n.mode,mclass:"m"+r.slice(5),body:Gt(s),isCharacterBox:zr(s)}},htmlBuilder:l8,mathmlBuilder:c8});var Zo=e=>{var t=e.type==="ordgroup"&&e.body.length?e.body[0]:e;return t.type==="atom"&&(t.family==="bin"||t.family==="rel")?"m"+t.family:"mord"};be({type:"mclass",names:["\\@binrel"],numArgs:2,handler(e,t){var{parser:n}=e;return{type:"mclass",mode:n.mode,mclass:Zo(t[0]),body:Gt(t[1]),isCharacterBox:zr(t[1])}}});be({type:"mclass",names:["\\stackrel","\\overset","\\underset"],numArgs:2,handler(e,t){var{parser:n,funcName:r}=e,s=t[1],i=t[0],a;r!=="\\stackrel"?a=Zo(s):a="mrel";var o={type:"op",mode:s.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!=="\\stackrel",body:Gt(s)},l=r==="\\underset"?{type:"supsub",mode:i.mode,base:o,sub:i}:{type:"supsub",mode:i.mode,base:o,sup:i};return{type:"mclass",mode:n.mode,mclass:a,body:[l],isCharacterBox:zr(l)}}});be({type:"pmb",names:["\\pmb"],numArgs:1,allowedInText:!0,handler(e,t){var{parser:n}=e;return{type:"pmb",mode:n.mode,mclass:Zo(t[0]),body:Gt(t[0])}},htmlBuilder(e,t){var n=tn(e.body,t,!0),r=te([e.mclass],n,t);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(e,t){var n=zn(e.body,t),r=new oe("mstyle",n);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var u8={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},qd=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),Hd=e=>e.type==="textord"&&e.text==="@",d8=(e,t)=>(e.type==="mathord"||e.type==="atom")&&e.text===t;function f8(e,t,n){var r=u8[e];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(r,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":{var s=n.callFunction("\\\\cdleft",[t[0]],[]),i={type:"atom",text:r,mode:"math",family:"rel"},a=n.callFunction("\\Big",[i],[]),o=n.callFunction("\\\\cdright",[t[1]],[]),l={type:"ordgroup",mode:"math",body:[s,a,o]};return n.callFunction("\\\\cdparent",[l],[])}case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var c={type:"textord",text:"\\Vert",mode:"math"};return n.callFunction("\\Big",[c],[])}default:return{type:"textord",text:" ",mode:"math"}}}function h8(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if(n==="&"||n==="\\\\")e.consume();else if(n==="\\end"){t[t.length-1].length===0&&t.pop();break}else throw new ae("Expected \\\\ or \\cr or \\end",e.nextToken)}for(var r=[],s=[r],i=0;i<t.length;i++){for(var a=t[i],o=qd(),l=0;l<a.length;l++)if(!Hd(a[l]))o.body.push(a[l]);else{r.push(o),l+=1;var c=jo(a[l]).text,u=new Array(2);if(u[0]={type:"ordgroup",mode:"math",body:[]},u[1]={type:"ordgroup",mode:"math",body:[]},!"=|.".includes(c))if("<>AV".includes(c))for(var p=0;p<2;p++){for(var m=!0,f=l+1;f<a.length;f++){if(d8(a[f],c)){m=!1,l=f;break}if(Hd(a[f]))throw new ae("Missing a "+c+" character to complete a CD arrow.",a[f]);u[p].body.push(a[f])}if(m)throw new ae("Missing a "+c+" character to complete a CD arrow.",a[l])}else throw new ae('Expected one of "<>AV=|." after @',a[l]);var y=f8(c,u,e),b={type:"styling",body:[y],mode:"math",style:"display",resetFont:!0};r.push(b),o=qd()}i%2===0?r.push(o):r.shift(),r=[],s.push(r)}e.gullet.endGroup(),e.gullet.endGroup();var x=new Array(s[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:s,arraystretch:1,addJot:!0,rowGaps:[null],cols:x,colSeparationType:"CD",hLinesBeforeRow:new Array(s.length+1).fill([])}}be({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],numArgs:1,handler(e,t){var{parser:n,funcName:r}=e;return{type:"cdlabel",mode:n.mode,side:r.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),r=si(ht(e.label,n,t),t);return r.classes.push("cd-label-"+e.side),r.style.bottom=ue(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,t){var n=new oe("mrow",[xt(e.label,t)]);return n=new oe("mpadded",[n]),n.setAttribute("width","0"),e.side==="left"&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),n=new oe("mstyle",[n]),n.setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}});be({type:"cdlabelparent",names:["\\\\cdparent"],numArgs:1,handler(e,t){var{parser:n}=e;return{type:"cdlabelparent",mode:n.mode,fragment:t[0]}},htmlBuilder(e,t){var n=si(ht(e.fragment,t),t);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder(e,t){return new oe("mrow",[xt(e.fragment,t)])}});be({type:"textord",names:["\\@char"],numArgs:1,allowedInText:!0,handler(e,t){for(var{parser:n}=e,r=Je(t[0],"ordgroup"),s=r.body,i="",a=0;a<s.length;a++){var o=Je(s[a],"textord");i+=o.text}var l=parseInt(i),c;if(isNaN(l))throw new ae("\\@char has non-numeric argument "+i);if(l<0||l>=1114111)throw new ae("\\@char with invalid code point "+i);return l<=65535?c=String.fromCharCode(l):(l-=65536,c=String.fromCharCode((l>>10)+55296,(l&1023)+56320)),{type:"textord",mode:n.mode,text:c}}});var p8=(e,t)=>{var n=tn(e.body,t.withColor(e.color),!1);return Dr(n)},m8=(e,t)=>{var n=zn(e.body,t.withColor(e.color)),r=new oe("mstyle",n);return r.setAttribute("mathcolor",e.color),r};be({type:"color",names:["\\textcolor"],numArgs:2,allowedInText:!0,argTypes:["color","original"],handler(e,t){var{parser:n}=e,r=Je(t[0],"color-token").color,s=t[1];return{type:"color",mode:n.mode,color:r,body:Gt(s)}},htmlBuilder:p8,mathmlBuilder:m8});be({type:"color",names:["\\color"],numArgs:1,allowedInText:!0,argTypes:["color"],handler(e,t){var{parser:n,breakOnTokenText:r}=e,s=Je(t[0],"color-token").color;n.gullet.macros.set("\\current@color",s);var i=n.parseExpression(!0,r);return{type:"color",mode:n.mode,color:s,body:i}}});be({type:"cr",names:["\\\\"],numArgs:0,numOptionalArgs:0,allowedInText:!0,handler(e,t,n){var{parser:r}=e,s=r.gullet.future().text==="["?r.parseSizeGroup(!0):null,i=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:i,size:s&&Je(s,"size").value}},htmlBuilder(e,t){var n=te(["mspace"],[],t);return e.newLine&&(n.classes.push("newline"),e.size&&(n.style.marginTop=ue(zt(e.size,t)))),n},mathmlBuilder(e,t){var n=new oe("mspace");return e.newLine&&(n.setAttribute("linebreak","newline"),e.size&&n.setAttribute("height",ue(zt(e.size,t)))),n}});var $c={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},Mm=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new ae("Expected a control sequence",e);return t},g8=e=>{var t=e.gullet.popToken();return t.text==="="&&(t=e.gullet.popToken(),t.text===" "&&(t=e.gullet.popToken())),t},Nm=(e,t,n,r)=>{var s=e.gullet.macros.get(n.text);s==null&&(n.noexpand=!0,s={tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,s,r)};be({type:"internal",names:["\\global","\\long","\\\\globallong"],numArgs:0,allowedInText:!0,handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var r=t.fetch();if($c[r.text])return(n==="\\global"||n==="\\\\globallong")&&(r.text=$c[r.text]),Je(t.parseFunction(),"internal");throw new ae("Invalid token after macro prefix",r)}});be({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],numArgs:0,allowedInText:!0,primitive:!0,handler(e){var{parser:t,funcName:n}=e,r=t.gullet.popToken(),s=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(s))throw new ae("Expected a control sequence",r);for(var i=0,a,o=[[]];t.gullet.future().text!=="{";)if(r=t.gullet.popToken(),r.text==="#"){if(t.gullet.future().text==="{"){a=t.gullet.future(),o[i].push("{");break}if(r=t.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new ae('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==i+1)throw new ae('Argument number "'+r.text+'" out of order');i++,o.push([])}else{if(r.text==="EOF")throw new ae("Expected a macro definition");o[i].push(r.text)}var{tokens:l}=t.gullet.consumeArg();return a&&l.unshift(a),(n==="\\edef"||n==="\\xdef")&&(l=t.gullet.expandTokens(l),l.reverse()),t.gullet.macros.set(s,{tokens:l,numArgs:i,delimiters:o},n===$c[n]),{type:"internal",mode:t.mode}}});be({type:"internal",names:["\\let","\\\\globallet"],numArgs:0,allowedInText:!0,primitive:!0,handler(e){var{parser:t,funcName:n}=e,r=Mm(t.gullet.popToken());t.gullet.consumeSpaces();var s=g8(t);return Nm(t,r,s,n==="\\\\globallet"),{type:"internal",mode:t.mode}}});be({type:"internal",names:["\\futurelet","\\\\globalfuture"],numArgs:0,allowedInText:!0,primitive:!0,handler(e){var{parser:t,funcName:n}=e,r=Mm(t.gullet.popToken()),s=t.gullet.popToken(),i=t.gullet.popToken();return Nm(t,r,i,n==="\\\\globalfuture"),t.gullet.pushToken(i),t.gullet.pushToken(s),{type:"internal",mode:t.mode}}});var $i=function(t,n,r){var s=Rt.math[t]&&Rt.math[t].replace,i=$0(s||t,n,r);if(!i)throw new Error("Unsupported symbol "+t+" and font size "+n+".");return i},F0=function(t,n,r,s){var i=r.havingBaseStyle(n),a=te(s.concat(i.sizingClasses(r)),[t],r),o=i.sizeMultiplier/r.sizeMultiplier;return a.height*=o,a.depth*=o,a.maxFontSize=i.sizeMultiplier,a},zm=function(t,n,r){var s=n.havingBaseStyle(r),i=(1-n.sizeMultiplier/s.sizeMultiplier)*n.fontMetrics().axisHeight;t.classes.push("delimcenter"),t.style.top=ue(i),t.height-=i,t.depth+=i},v8=function(t,n,r,s,i,a){var o=pn(t,"Main-Regular",i,s),l=F0(o,n,s,a);return zm(l,s,n),l},b8=function(t,n,r,s){return pn(t,"Size"+n+"-Regular",r,s)},$m=function(t,n,r,s,i,a){var o=b8(t,n,i,s),l=F0(te(["delimsizing","size"+n],[o],s),Ze.TEXT,s,a);return r&&zm(l,s,Ze.TEXT),l},Nl=function(t,n,r){var s;n==="Size1-Regular"?s="delim-size1":s="delim-size4";var i=te(["delimsizinginner",s],[te([],[pn(t,n,r)])]);return{type:"elem",elem:i}},zl=function(t,n,r){var s=cr["Size4-Regular"][t.charCodeAt(0)]?cr["Size4-Regular"][t.charCodeAt(0)][4]:cr["Size1-Regular"][t.charCodeAt(0)][4],i=new as("inner",x7(t,Math.round(1e3*n))),a=new Or([i],{width:ue(s),height:ue(n),style:"width:"+ue(s),viewBox:"0 0 "+1e3*s+" "+Math.round(1e3*n),preserveAspectRatio:"xMinYMin"}),o=os([],[a],r);return o.height=n,o.style.height=ue(n),o.style.width=ue(s),{type:"elem",elem:o}},Dc=.008,La={type:"kern",size:-1*Dc},y8=new Set(["|","\\lvert","\\rvert","\\vert"]),w8=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),Dm=function(t,n,r,s,i,a){var o,l,c,u,p="",m=0;o=c=u=t,l=null;var f="Size1-Regular";t==="\\uparrow"?c=u="⏐":t==="\\Uparrow"?c=u="‖":t==="\\downarrow"?o=c="⏐":t==="\\Downarrow"?o=c="‖":t==="\\updownarrow"?(o="\\uparrow",c="⏐",u="\\downarrow"):t==="\\Updownarrow"?(o="\\Uparrow",c="‖",u="\\Downarrow"):y8.has(t)?(c="∣",p="vert",m=333):w8.has(t)?(c="∥",p="doublevert",m=556):t==="["||t==="\\lbrack"?(o="⎡",c="⎢",u="⎣",f="Size4-Regular",p="lbrack",m=667):t==="]"||t==="\\rbrack"?(o="⎤",c="⎥",u="⎦",f="Size4-Regular",p="rbrack",m=667):t==="\\lfloor"||t==="⌊"?(c=o="⎢",u="⎣",f="Size4-Regular",p="lfloor",m=667):t==="\\lceil"||t==="⌈"?(o="⎡",c=u="⎢",f="Size4-Regular",p="lceil",m=667):t==="\\rfloor"||t==="⌋"?(c=o="⎥",u="⎦",f="Size4-Regular",p="rfloor",m=667):t==="\\rceil"||t==="⌉"?(o="⎤",c=u="⎥",f="Size4-Regular",p="rceil",m=667):t==="("||t==="\\lparen"?(o="⎛",c="⎜",u="⎝",f="Size4-Regular",p="lparen",m=875):t===")"||t==="\\rparen"?(o="⎞",c="⎟",u="⎠",f="Size4-Regular",p="rparen",m=875):t==="\\{"||t==="\\lbrace"?(o="⎧",l="⎨",u="⎩",c="⎪",f="Size4-Regular"):t==="\\}"||t==="\\rbrace"?(o="⎫",l="⎬",u="⎭",c="⎪",f="Size4-Regular"):t==="\\lgroup"||t==="⟮"?(o="⎧",u="⎩",c="⎪",f="Size4-Regular"):t==="\\rgroup"||t==="⟯"?(o="⎫",u="⎭",c="⎪",f="Size4-Regular"):t==="\\lmoustache"||t==="⎰"?(o="⎧",u="⎭",c="⎪",f="Size4-Regular"):(t==="\\rmoustache"||t==="⎱")&&(o="⎫",u="⎩",c="⎪",f="Size4-Regular");var y=$i(o,f,i),b=y.height+y.depth,x=$i(c,f,i),S=x.height+x.depth,N=$i(u,f,i),z=N.height+N.depth,I=0,E=1;if(l!==null){var _=$i(l,f,i);I=_.height+_.depth,E=2}var L=b+z+I,M=Math.max(0,Math.ceil((n-L)/(E*S))),G=L+M*E*S,P=s.fontMetrics().axisHeight;r&&(P*=s.sizeMultiplier);var W=G/2-P,q=[];if(p.length>0){var X=G-b-z,ne=Math.round(G*1e3),he=k7(p,Math.round(X*1e3)),Ae=new as(p,he),se=ue(m/1e3),re=ue(ne/1e3),ze=new Or([Ae],{width:se,height:re,viewBox:"0 0 "+m+" "+ne}),ie=os([],[ze],s);ie.height=ne/1e3,ie.style.width=se,ie.style.height=re,q.push({type:"elem",elem:ie})}else{if(q.push(Nl(u,f,i)),q.push(La),l===null){var je=G-b-z+2*Dc;q.push(zl(c,je,s))}else{var rt=(G-b-z-I)/2+2*Dc;q.push(zl(c,rt,s)),q.push(La),q.push(Nl(l,f,i)),q.push(La),q.push(zl(c,rt,s))}q.push(La),q.push(Nl(o,f,i))}var ot=s.havingBaseStyle(Ze.TEXT),Ft=dt({positionType:"bottom",positionData:W,children:q});return F0(te(["delimsizing","mult"],[Ft],ot),Ze.TEXT,s,a)},$l=80,Dl=.08,Pl=function(t,n,r,s,i){var a=S7(t,s,r),o=new as(t,a),l=new Or([o],{width:"400em",height:ue(n),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return os(["hide-tail"],[l],i)},S8=function(t,n){var r=n.havingBaseSizing(),s=Um("\\surd",t*r.sizeMultiplier,Fm,r),i=r.sizeMultiplier,a=Math.max(0,n.minRuleThickness-n.fontMetrics().sqrtRuleThickness),o,l,c,u,p;return s.type==="small"?(u=1e3+1e3*a+$l,t<1?i=1:t<1.4&&(i=.7),l=(1+a+Dl)/i,c=(1+a)/i,o=Pl("sqrtMain",l,u,a,n),o.style.minWidth="0.853em",p=.833/i):s.type==="large"?(u=(1e3+$l)*Hi[s.size],c=(Hi[s.size]+a)/i,l=(Hi[s.size]+a+Dl)/i,o=Pl("sqrtSize"+s.size,l,u,a,n),o.style.minWidth="1.02em",p=1/i):(l=t+a+Dl,c=t+a,u=Math.floor(1e3*t+a)+$l,o=Pl("sqrtTall",l,u,a,n),o.style.minWidth="0.742em",p=1.056),o.height=c,o.style.height=ue(l),{span:o,advanceWidth:p,ruleWidth:(n.fontMetrics().sqrtRuleThickness+a)*i}},Pm=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),x8=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),Bm=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),Hi=[0,1.2,1.8,2.4,3],Lm=function(t,n,r,s,i){if(t==="<"||t==="\\lt"||t==="⟨"?t="\\langle":(t===">"||t==="\\gt"||t==="⟩")&&(t="\\rangle"),Pm.has(t)||Bm.has(t))return $m(t,n,!1,r,s,i);if(x8.has(t))return Dm(t,Hi[n],!1,r,s,i);throw new ae("Illegal delimiter: '"+t+"'")},k8=[{type:"small",style:Ze.SCRIPTSCRIPT},{type:"small",style:Ze.SCRIPT},{type:"small",style:Ze.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],_8=[{type:"small",style:Ze.SCRIPTSCRIPT},{type:"small",style:Ze.SCRIPT},{type:"small",style:Ze.TEXT},{type:"stack"}],Fm=[{type:"small",style:Ze.SCRIPTSCRIPT},{type:"small",style:Ze.SCRIPT},{type:"small",style:Ze.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],E8=function(t){if(t.type==="small")return"Main-Regular";if(t.type==="large")return"Size"+t.size+"-Regular";if(t.type==="stack")return"Size4-Regular";var n=t.type;throw new Error("Add support for delim type '"+n+"' here.")},Um=function(t,n,r,s){for(var i=Math.min(2,3-s.style.size),a=i;a<r.length;a++){var o=r[a];if(o.type==="stack")break;var l=$i(t,E8(o),"math"),c=l.height+l.depth;if(o.type==="small"){var u=s.havingBaseStyle(o.style);c*=u.sizeMultiplier}if(c>n)return o}return r[r.length-1]},Pc=function(t,n,r,s,i,a){t==="<"||t==="\\lt"||t==="⟨"?t="\\langle":(t===">"||t==="\\gt"||t==="⟩")&&(t="\\rangle");var o;Bm.has(t)?o=k8:Pm.has(t)?o=Fm:o=_8;var l=Um(t,n,o,s);return l.type==="small"?v8(t,l.style,r,s,i,a):l.type==="large"?$m(t,l.size,r,s,i,a):Dm(t,n,r,s,i,a)},Bl=function(t,n,r,s,i,a){var o=s.fontMetrics().axisHeight*s.sizeMultiplier,l=901,c=5/s.fontMetrics().ptPerEm,u=Math.max(n-o,r+o),p=Math.max(u/500*l,2*u-c);return Pc(t,p,!0,s,i,a)},Vd={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},A8=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."]);function jd(e){return"isMiddle"in e}function Ko(e,t){var n=Go(e);if(n&&A8.has(n.text))return n;throw n?new ae("Invalid delimiter '"+n.text+"' after '"+t.funcName+"'",e):new ae("Invalid delimiter type '"+e.type+"'",e)}be({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],numArgs:1,argTypes:["primitive"],handler:(e,t)=>{var n=Ko(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:Vd[e.funcName].size,mclass:Vd[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>e.delim==="."?te([e.mclass]):Lm(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];e.delim!=="."&&t.push(Fn(e.delim,e.mode));var n=new oe("mo",t);e.mclass==="mopen"||e.mclass==="mclose"?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var r=ue(Hi[e.size]);return n.setAttribute("minsize",r),n.setAttribute("maxsize",r),n}});function Gd(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}be({type:"leftright-right",names:["\\right"],numArgs:1,primitive:!0,handler:(e,t)=>{var n=e.parser.gullet.macros.get("\\current@color");if(n&&typeof n!="string")throw new ae("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:Ko(t[0],e).text,color:n}}});be({type:"leftright",names:["\\left"],numArgs:1,primitive:!0,handler:(e,t)=>{var n=Ko(t[0],e),r=e.parser;++r.leftrightDepth;var s=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var i=Je(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:s,left:n.text,right:i.delim,rightColor:i.color}},htmlBuilder:(e,t)=>{Gd(e);for(var n=tn(e.body,t,!0,["mopen","mclose"]),r=0,s=0,i=!1,a=0;a<n.length;a++){var o=n[a];jd(o)?i=!0:(r=Math.max(n[a].height,r),s=Math.max(n[a].depth,s))}r*=t.sizeMultiplier,s*=t.sizeMultiplier;var l;if(e.left==="."?l=ra(t,["mopen"]):l=Bl(e.left,r,s,t,e.mode,["mopen"]),n.unshift(l),i)for(var c=1;c<n.length;c++){var u=n[c];if(jd(u)){var p=u.isMiddle;n[c]=Bl(p.delim,r,s,p.options,e.mode,[])}}var m;if(e.right===".")m=ra(t,["mclose"]);else{var f=e.rightColor?t.withColor(e.rightColor):t;m=Bl(e.right,r,s,f,e.mode,["mclose"])}return n.push(m),te(["minner"],n,t)},mathmlBuilder:(e,t)=>{Gd(e);var n=zn(e.body,t);if(e.left!=="."){var r=new oe("mo",[Fn(e.left,e.mode)]);r.setAttribute("fence","true"),n.unshift(r)}if(e.right!=="."){var s=new oe("mo",[Fn(e.right,e.mode)]);s.setAttribute("fence","true"),e.rightColor&&s.setAttribute("mathcolor",e.rightColor),n.push(s)}return B0(n)}});be({type:"middle",names:["\\middle"],numArgs:1,primitive:!0,handler:(e,t)=>{var n=Ko(t[0],e);if(!e.parser.leftrightDepth)throw new ae("\\middle without preceding \\left",n);return{type:"middle",mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;return e.delim==="."?n=ra(t,[]):(n=Lm(e.delim,1,t,e.mode,[]),n.isMiddle={delim:e.delim,options:t}),n},mathmlBuilder:(e,t)=>{var n=e.delim==="\\vert"||e.delim==="|"?Fn("|","text"):Fn(e.delim,e.mode),r=new oe("mo",[n]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var T8=(e,t)=>{var n=si(ht(e.body,t),t),r=e.label.slice(1),s=t.sizeMultiplier,i,a,o=zr(e.body);if(r==="sout")i=te(["stretchy","sout"]),i.height=t.fontMetrics().defaultRuleThickness/s,a=-.5*t.fontMetrics().xHeight;else if(r==="phase"){var l=zt({number:.6,unit:"pt"},t),c=zt({number:.35,unit:"ex"},t),u=t.havingBaseSizing();s=s/u.sizeMultiplier;var p=n.height+n.depth+l+c;n.style.paddingLeft=ue(p/2+l);var m=Math.floor(1e3*p*s),f=y7(m),y=new Or([new as("phase",f)],{width:"400em",height:ue(m/1e3),viewBox:"0 0 400000 "+m,preserveAspectRatio:"xMinYMin slice"});i=os(["hide-tail"],[y],t),i.style.height=ue(p),a=n.depth+l+c}else{/cancel/.test(r)?o||n.classes.push("cancel-pad"):r==="angl"?n.classes.push("anglpad"):n.classes.push("boxpad");var b,x,S=0;/box/.test(r)?(S=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),b=t.fontMetrics().fboxsep+(r==="colorbox"?0:S),x=b):r==="angl"?(S=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness),b=4*S,x=Math.max(0,.25-n.depth)):(b=o?.2:0,x=b),i=n8(n,r,b,x,t),/fbox|boxed|fcolorbox/.test(r)?(i.style.borderStyle="solid",i.style.borderWidth=ue(S)):r==="angl"&&S!==.049&&(i.style.borderTopWidth=ue(S),i.style.borderRightWidth=ue(S)),a=n.depth+x,e.backgroundColor&&(i.style.backgroundColor=e.backgroundColor,e.borderColor&&(i.style.borderColor=e.borderColor))}var N;if(e.backgroundColor)N=dt({positionType:"individualShift",children:[{type:"elem",elem:i,shift:a},{type:"elem",elem:n,shift:0}]});else{var z=/cancel|phase/.test(r)?["svg-align"]:[];N=dt({positionType:"individualShift",children:[{type:"elem",elem:n,shift:0},{type:"elem",elem:i,shift:a,wrapperClasses:z}]})}return/cancel/.test(r)&&(N.height=n.height,N.depth=n.depth),/cancel/.test(r)&&!o?te(["mord","cancel-lap"],[N],t):te(["mord"],[N],t)},I8=(e,t)=>{var n,r=new oe(e.label.includes("colorbox")?"mpadded":"menclose",[xt(e.body,t)]);switch(e.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*n+"pt"),r.setAttribute("height","+"+2*n+"pt"),r.setAttribute("lspace",n+"pt"),r.setAttribute("voffset",n+"pt"),e.label==="\\fcolorbox"){var s=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);r.setAttribute("style","border: "+ue(s)+" solid "+e.borderColor)}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return e.backgroundColor&&r.setAttribute("mathbackground",e.backgroundColor),r};be({type:"enclose",names:["\\colorbox"],numArgs:2,allowedInText:!0,argTypes:["color","hbox"],handler(e,t,n){var{parser:r,funcName:s}=e,i=Je(t[0],"color-token").color,a=t[1];return{type:"enclose",mode:r.mode,label:s,backgroundColor:i,body:a}},htmlBuilder:T8,mathmlBuilder:I8});be({type:"enclose",names:["\\fcolorbox"],numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"],handler(e,t,n){var{parser:r,funcName:s}=e,i=Je(t[0],"color-token").color,a=Je(t[1],"color-token").color,o=t[2];return{type:"enclose",mode:r.mode,label:s,backgroundColor:a,borderColor:i,body:o}}});be({type:"enclose",names:["\\fbox"],numArgs:1,argTypes:["hbox"],allowedInText:!0,handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\fbox",body:t[0]}}});be({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],numArgs:1,handler(e,t){var{parser:n,funcName:r}=e,s=t[0];return{type:"enclose",mode:n.mode,label:r,body:s}}});be({type:"enclose",names:["\\sout"],numArgs:1,allowedInText:!0,handler(e,t){var{parser:n,funcName:r}=e;n.mode==="math"&&n.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var s=t[0];return{type:"enclose",mode:n.mode,label:r,body:s}}});be({type:"enclose",names:["\\angl"],numArgs:1,argTypes:["hbox"],allowedInText:!1,handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\angl",body:t[0]}}});var qm={};function mr(e){for(var{type:t,names:n,props:r,handler:s,htmlBuilder:i,mathmlBuilder:a}=e,o={type:t,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:s},l=0;l<n.length;++l)qm[n[l]]=o;i&&(ta[t]=i),a&&(na[t]=a)}var Hm={};function w(e,t){Hm[e]=t}class wn{constructor(t,n,r){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=t,this.start=n,this.end=r}static range(t,n){return n?!t||!t.loc||!n.loc||t.loc.lexer!==n.loc.lexer?null:new wn(t.loc.lexer,t.loc.start,n.loc.end):t&&t.loc}}class Cn{constructor(t,n){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=t,this.loc=n}range(t,n){return new Cn(n,wn.range(this,t))}}function Zd(e){var t=[];e.consumeSpaces();var n=e.fetch().text;for(n==="\\relax"&&(e.consume(),e.consumeSpaces(),n=e.fetch().text);n==="\\hline"||n==="\\hdashline";)e.consume(),t.push(n==="\\hdashline"),e.consumeSpaces(),n=e.fetch().text;return t}var Wo=e=>{var t=e.parser.settings;if(!t.displayMode)throw new ae("{"+e.envName+"} can be used only in display mode.")},R8=new Set(["gather","gather*"]);function U0(e){if(!e.includes("ed"))return!e.includes("*")}function ms(e,t,n){var{hskipBeforeAndAfter:r,addJot:s,cols:i,arraystretch:a,colSeparationType:o,autoTag:l,singleRow:c,emptySingleRow:u,maxNumCols:p,leqno:m}=t;if(e.gullet.beginGroup(),c||e.gullet.macros.set("\\cr","\\\\\\relax"),!a){var f=e.gullet.expandMacroAsText("\\arraystretch");if(f==null)a=1;else if(a=parseFloat(f),!a||a<0)throw new ae("Invalid \\arraystretch: "+f)}e.gullet.beginGroup();var y=[],b=[y],x=[],S=[],N=l!=null?[]:void 0;function z(){l&&e.gullet.macros.set("\\@eqnsw","1",!0)}function I(){N&&(e.gullet.macros.get("\\df@tag")?(N.push(e.subparse([new Cn("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):N.push(!!l&&e.gullet.macros.get("\\@eqnsw")==="1"))}for(z(),S.push(Zd(e));;){var E=e.parseExpression(!1,c?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup();var _={type:"ordgroup",mode:e.mode,body:E};n&&(_={type:"styling",mode:e.mode,style:n,resetFont:!0,body:[_]}),y.push(_);var L=e.fetch().text;if(L==="&"){if(p&&y.length===p){if(c||o)throw new ae("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else if(L==="\\end"){I(),y.length===1&&_.type==="styling"&&_.body.length===1&&_.body[0].type==="ordgroup"&&_.body[0].body.length===0&&(b.length>1||!u)&&b.pop(),S.length<b.length+1&&S.push([]);break}else if(L==="\\\\"){e.consume();var M=void 0;e.gullet.future().text!==" "&&(M=e.parseSizeGroup(!0)),x.push(M?M.value:null),I(),S.push(Zd(e)),y=[],b.push(y),z()}else throw new ae("Expected & or \\\\ or \\cr or \\end",e.nextToken)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:e.mode,addJot:s,arraystretch:a,body:b,cols:i,rowGaps:x,hskipBeforeAndAfter:r,hLinesBeforeRow:S,colSeparationType:o,tags:N,leqno:m}}function q0(e){return e.slice(0,1)==="d"?"display":"text"}var gr=function(t,n){var r,s,i=t.body.length,a=t.hLinesBeforeRow,o=0,l=new Array(i),c=[],u=Math.max(n.fontMetrics().arrayRuleWidth,n.minRuleThickness),p=1/n.fontMetrics().ptPerEm,m=5*p;if(t.colSeparationType&&t.colSeparationType==="small"){var f=n.havingStyle(Ze.SCRIPT).sizeMultiplier;m=.2778*(f/n.sizeMultiplier)}var y=t.colSeparationType==="CD"?zt({number:3,unit:"ex"},n):12*p,b=3*p,x=t.arraystretch*y,S=.7*x,N=.3*x,z=0;function I(F){for(var U=0;U<F.length;++U)U>0&&(z+=.25),c.push({pos:z,isDashed:F[U]})}for(I(a[0]),r=0;r<t.body.length;++r){var E=t.body[r],_=S,L=N;o<E.length&&(o=E.length);var M={cells:new Array(E.length),height:0,depth:0,pos:0};for(s=0;s<E.length;++s){var G=ht(E[s],n);L<G.depth&&(L=G.depth),_<G.height&&(_=G.height),M.cells[s]=G}var P=t.rowGaps[r],W=0;P&&(W=zt(P,n),W>0&&(W+=N,L<W&&(L=W),W=0)),t.addJot&&r<t.body.length-1&&(L+=b),M.height=_,M.depth=L,z+=_,M.pos=z,z+=L+W,l[r]=M,I(a[r+1])}var q=z/2+n.fontMetrics().axisHeight,X=t.cols||[],ne=[],he,Ae,se=[];if(t.tags&&t.tags.some(F=>F))for(r=0;r<i;++r){var re=l[r],ze=re.pos-q,ie=t.tags[r],je=void 0;ie===!0?je=te(["eqn-num"],[],n):ie===!1?je=te([],[],n):je=te([],tn(ie,n,!0),n),je.depth=re.depth,je.height=re.height,se.push({type:"elem",elem:je,shift:ze})}for(s=0,Ae=0;s<o||Ae<X.length;++s,++Ae){for(var rt,ot=X[Ae],Ft=!0;((st=ot)==null?void 0:st.type)==="separator";){var st;if(Ft||(he=te(["arraycolsep"],[]),he.style.width=ue(n.fontMetrics().doubleRuleSep),ne.push(he)),ot.separator==="|"||ot.separator===":"){var at=ot.separator==="|"?"solid":"dashed",C=te(["vertical-separator"],[],n);C.style.height=ue(z),C.style.borderRightWidth=ue(u),C.style.borderRightStyle=at,C.style.margin="0 "+ue(-u/2);var le=z-q;le&&(C.style.verticalAlign=ue(-le)),ne.push(C)}else throw new ae("Invalid separator type: "+ot.separator);Ae++,ot=X[Ae],Ft=!1}if(!(s>=o)){var Q=void 0;if(s>0||t.hskipBeforeAndAfter){var de,Ie;Q=(de=(Ie=ot)==null?void 0:Ie.pregap)!=null?de:m,Q!==0&&(he=te(["arraycolsep"],[]),he.style.width=ue(Q),ne.push(he))}var Ge=[];for(r=0;r<i;++r){var Le=l[r],Te=Le.cells[s];if(Te){var yt=Le.pos-q;Te.depth=Le.depth,Te.height=Le.height,Ge.push({type:"elem",elem:Te,shift:yt})}}var Ye=dt({positionType:"individualShift",children:Ge}),Tt=te(["col-align-"+(((rt=ot)==null?void 0:rt.align)||"c")],[Ye]);if(ne.push(Tt),s<o-1||t.hskipBeforeAndAfter){var bn,Yn;Q=(bn=(Yn=ot)==null?void 0:Yn.postgap)!=null?bn:m,Q!==0&&(he=te(["arraycolsep"],[]),he.style.width=ue(Q),ne.push(he))}}}var br=te(["mtable"],ne);if(c.length>0){for(var Si=ri("hline",n,u),xi=ri("hdashline",n,u),Fr=[{type:"elem",elem:br,shift:0}];c.length>0;){var $n=c.pop(),ys=$n.pos-q;$n.isDashed?Fr.push({type:"elem",elem:xi,shift:ys}):Fr.push({type:"elem",elem:Si,shift:ys})}br=dt({positionType:"individualShift",children:Fr})}if(se.length===0)return te(["mord"],[br],n);var Xn=dt({positionType:"individualShift",children:se}),V=te(["tag"],[Xn],n);return Dr([br,V])},C8={c:"center ",l:"left ",r:"right "},vr=function(t,n){for(var r=[],s=new oe("mtd",[],["mtr-glue"]),i=new oe("mtd",[],["mml-eqn-num"]),a=0;a<t.body.length;a++){for(var o=t.body[a],l=[],c=0;c<o.length;c++)l.push(new oe("mtd",[xt(o[c],n)]));t.tags&&t.tags[a]&&(l.unshift(s),l.push(s),t.leqno?l.unshift(i):l.push(i)),r.push(new oe("mtr",l))}var u=new oe("mtable",r),p=t.arraystretch===.5?.1:.16+t.arraystretch-1+(t.addJot?.09:0);u.setAttribute("rowspacing",ue(p));var m="",f="";if(t.cols&&t.cols.length>0){var y=t.cols,b="",x=!1,S=0,N=y.length;y[0].type==="separator"&&(m+="top ",S=1),y[y.length-1].type==="separator"&&(m+="bottom ",N-=1);for(var z=S;z<N;z++){var I=y[z];I.type==="align"?(f+=C8[I.align],x&&(b+="none "),x=!0):I.type==="separator"&&x&&(b+=I.separator==="|"?"solid ":"dashed ",x=!1)}u.setAttribute("columnalign",f.trim()),/[sd]/.test(b)&&u.setAttribute("columnlines",b.trim())}if(t.colSeparationType==="align"){for(var E=t.cols||[],_="",L=1;L<E.length;L++)_+=L%2?"0em ":"1em ";u.setAttribute("columnspacing",_.trim())}else t.colSeparationType==="alignat"||t.colSeparationType==="gather"?u.setAttribute("columnspacing","0em"):t.colSeparationType==="small"?u.setAttribute("columnspacing","0.2778em"):t.colSeparationType==="CD"?u.setAttribute("columnspacing","0.5em"):u.setAttribute("columnspacing","1em");var M="",G=t.hLinesBeforeRow;m+=G[0].length>0?"left ":"",m+=G[G.length-1].length>0?"right ":"";for(var P=1;P<G.length-1;P++)M+=G[P].length===0?"none ":G[P][0]?"dashed ":"solid ";return/[sd]/.test(M)&&u.setAttribute("rowlines",M.trim()),m!==""&&(u=new oe("menclose",[u]),u.setAttribute("notation",m.trim())),t.arraystretch&&t.arraystretch<1&&(u=new oe("mstyle",[u]),u.setAttribute("scriptlevel","1")),u},Vm=function(t,n){t.envName.includes("ed")||Wo(t);var r=[],s=t.envName==="split",i=ms(t.parser,{cols:r,addJot:!0,autoTag:s?void 0:U0(t.envName),emptySingleRow:!0,colSeparationType:t.envName.includes("at")?"alignat":"align",maxNumCols:s?2:void 0,leqno:t.parser.settings.leqno},"display"),a=0,o=0,l={type:"ordgroup",mode:t.mode,body:[]};if(n[0]&&n[0].type==="ordgroup"){for(var c="",u=0;u<n[0].body.length;u++){var p=Je(n[0].body[u],"textord");c+=p.text}a=Number(c),o=a*2}var m=!o;i.body.forEach(function(x){for(var S=1;S<x.length;S+=2){var N=Je(x[S],"styling"),z=Je(N.body[0],"ordgroup");z.body.unshift(l)}if(m)o<x.length&&(o=x.length);else{var I=x.length/2;if(a<I)throw new ae("Too many math in a row: "+("expected "+a+", but got "+I),x[0])}});for(var f=0;f<o;++f){var y="r",b=0;f%2===1?y="l":f>0&&m&&(b=1),r[f]={type:"align",align:y,pregap:b,postgap:0}}return i.colSeparationType=m?"align":"alignat",i};mr({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){var n=Go(t[0]),r=n?[t[0]]:Je(t[0],"ordgroup").body,s=r.map(function(a){var o=jo(a),l=o.text;if("lcr".includes(l))return{type:"align",align:l};if(l==="|")return{type:"separator",separator:"|"};if(l===":")return{type:"separator",separator:":"};throw new ae("Unknown column alignment: "+l,a)}),i={cols:s,hskipBeforeAndAfter:!0,maxNumCols:s.length};return ms(e.parser,i,q0(e.envName))},htmlBuilder:gr,mathmlBuilder:vr});mr({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],n="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if(e.envName.charAt(e.envName.length-1)==="*"){var s=e.parser;if(s.consumeSpaces(),s.fetch().text==="["){if(s.consume(),s.consumeSpaces(),n=s.fetch().text,!"lcr".includes(n))throw new ae("Expected l or c or r",s.nextToken);s.consume(),s.consumeSpaces(),s.expect("]"),s.consume(),r.cols=[{type:"align",align:n}]}}var i=ms(e.parser,r,q0(e.envName)),a=Math.max(0,...i.body.map(o=>o.length));return i.cols=new Array(a).fill({type:"align",align:n}),t?{type:"leftright",mode:e.mode,body:[i],left:t[0],right:t[1],rightColor:void 0}:i},htmlBuilder:gr,mathmlBuilder:vr});mr({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var t={arraystretch:.5},n=ms(e.parser,t,"script");return n.colSeparationType="small",n},htmlBuilder:gr,mathmlBuilder:vr});mr({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){var n=Go(t[0]),r=n?[t[0]]:Je(t[0],"ordgroup").body,s=r.map(function(o){var l=jo(o),c=l.text;if("lc".includes(c))return{type:"align",align:c};throw new ae("Unknown column alignment: "+c,o)});if(s.length>1)throw new ae("{subarray} can contain only one column");var i={cols:s,hskipBeforeAndAfter:!1,arraystretch:.5},a=ms(e.parser,i,"script");if(a.body.length>0&&a.body[0].length>1)throw new ae("{subarray} can contain only one column");return a},htmlBuilder:gr,mathmlBuilder:vr});mr({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var t={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},n=ms(e.parser,t,q0(e.envName));return{type:"leftright",mode:e.mode,body:[n],left:e.envName.includes("r")?".":"\\{",right:e.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:gr,mathmlBuilder:vr});mr({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:Vm,htmlBuilder:gr,mathmlBuilder:vr});mr({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){R8.has(e.envName)&&Wo(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:U0(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return ms(e.parser,t,"display")},htmlBuilder:gr,mathmlBuilder:vr});mr({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:Vm,htmlBuilder:gr,mathmlBuilder:vr});mr({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){Wo(e);var t={autoTag:U0(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return ms(e.parser,t,"display")},htmlBuilder:gr,mathmlBuilder:vr});mr({type:"array",names:["CD"],props:{numArgs:0},handler(e){return Wo(e),h8(e.parser)},htmlBuilder:gr,mathmlBuilder:vr});w("\\nonumber","\\gdef\\@eqnsw{0}");w("\\notag","\\nonumber");be({type:"text",names:["\\hline","\\hdashline"],numArgs:0,allowedInText:!0,allowedInMath:!0,handler(e,t){throw new ae(e.funcName+" valid only within array environment")}});var Kd=qm;be({type:"environment",names:["\\begin","\\end"],numArgs:1,argTypes:["text"],handler(e,t){var{parser:n,funcName:r}=e,s=t[0];if(s.type!=="ordgroup")throw new ae("Invalid environment name",s);for(var i="",a=0;a<s.body.length;++a)i+=Je(s.body[a],"textord").text;if(r==="\\begin"){if(!Kd.hasOwnProperty(i))throw new ae("No such environment: "+i,s);var o=Kd[i],{args:l,optArgs:c}=n.parseArguments("\\begin{"+i+"}",o),u={mode:n.mode,envName:i,parser:n},p=o.handler(u,l,c);n.expect("\\end",!1);var m=n.nextToken,f=Je(n.parseFunction(),"environment");if(f.name!==i)throw new ae("Mismatch: \\begin{"+i+"} matched by \\end{"+f.name+"}",m);return p}return{type:"environment",mode:n.mode,name:i,nameGroup:s}}});var O8=(e,t)=>{var n=e.font,r=t.withFont(n);return ht(e.body,r)},M8=(e,t)=>{var n=e.font,r=t.withFont(n);return xt(e.body,r)},Wd={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};be({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],numArgs:1,allowedInArgument:!0,handler:(e,t)=>{var{parser:n,funcName:r}=e,s=wo(t[0]),i=r in Wd?Wd[r]:r;return{type:"font",mode:n.mode,font:i.slice(1),body:s}},htmlBuilder:O8,mathmlBuilder:M8});be({type:"mclass",names:["\\boldsymbol","\\bm"],numArgs:1,handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"mclass",mode:n.mode,mclass:Zo(r),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:r}],isCharacterBox:zr(r)}}});be({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],numArgs:0,allowedInText:!0,handler:(e,t)=>{var{parser:n,funcName:r,breakOnTokenText:s}=e,{mode:i}=n,a=n.parseExpression(!0,s);return{type:"font",mode:i,font:"math"+r.slice(1),body:{type:"ordgroup",mode:n.mode,body:a}}}});var N8=(e,t)=>{var n=t.style,r=n.fracNum(),s=n.fracDen(),i;i=t.havingStyle(r);var a=ht(e.numer,i,t);if(e.continued){var o=8.5/t.fontMetrics().ptPerEm,l=3.5/t.fontMetrics().ptPerEm;a.height=a.height<o?o:a.height,a.depth=a.depth<l?l:a.depth}i=t.havingStyle(s);var c=ht(e.denom,i,t),u,p,m;e.hasBarLine?(e.barSize?(p=zt(e.barSize,t),u=ri("frac-line",t,p)):u=ri("frac-line",t),p=u.height,m=u.height):(u=null,p=0,m=t.fontMetrics().defaultRuleThickness);var f,y,b;n.size===Ze.DISPLAY.size?(f=t.fontMetrics().num1,p>0?y=3*m:y=7*m,b=t.fontMetrics().denom1):(p>0?(f=t.fontMetrics().num2,y=m):(f=t.fontMetrics().num3,y=3*m),b=t.fontMetrics().denom2);var x;if(u){var N=t.fontMetrics().axisHeight;f-a.depth-(N+.5*p)<y&&(f+=y-(f-a.depth-(N+.5*p))),N-.5*p-(c.height-b)<y&&(b+=y-(N-.5*p-(c.height-b)));var z=-(N-.5*p);x=dt({positionType:"individualShift",children:[{type:"elem",elem:c,shift:b},{type:"elem",elem:u,shift:z},{type:"elem",elem:a,shift:-f}]})}else{var S=f-a.depth-(c.height-b);S<y&&(f+=.5*(y-S),b+=.5*(y-S)),x=dt({positionType:"individualShift",children:[{type:"elem",elem:c,shift:b},{type:"elem",elem:a,shift:-f}]})}i=t.havingStyle(n),x.height*=i.sizeMultiplier/t.sizeMultiplier,x.depth*=i.sizeMultiplier/t.sizeMultiplier;var I;n.size===Ze.DISPLAY.size?I=t.fontMetrics().delim1:n.size===Ze.SCRIPTSCRIPT.size?I=t.havingStyle(Ze.SCRIPT).fontMetrics().delim2:I=t.fontMetrics().delim2;var E,_;return e.leftDelim==null?E=ra(t,["mopen"]):E=Pc(e.leftDelim,I,!0,t.havingStyle(n),e.mode,["mopen"]),e.continued?_=te([]):e.rightDelim==null?_=ra(t,["mclose"]):_=Pc(e.rightDelim,I,!0,t.havingStyle(n),e.mode,["mclose"]),te(["mord"].concat(i.sizingClasses(t)),[E,te(["mfrac"],[x]),_],t)},z8=(e,t)=>{var n=new oe("mfrac",[xt(e.numer,t),xt(e.denom,t)]);if(!e.hasBarLine)n.setAttribute("linethickness","0px");else if(e.barSize){var r=zt(e.barSize,t);n.setAttribute("linethickness",ue(r))}if(e.leftDelim!=null||e.rightDelim!=null){var s=[];if(e.leftDelim!=null){var i=new oe("mo",[new Zt(e.leftDelim.replace("\\",""))]);i.setAttribute("fence","true"),s.push(i)}if(s.push(n),e.rightDelim!=null){var a=new oe("mo",[new Zt(e.rightDelim.replace("\\",""))]);a.setAttribute("fence","true"),s.push(a)}return B0(s)}return n},jm=(e,t)=>{if(!t)return e;var n={type:"styling",mode:e.mode,style:t,body:[e]};return n};be({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],numArgs:2,allowedInArgument:!0,handler:(e,t)=>{var{parser:n,funcName:r}=e,s=t[0],i=t[1],a,o=null,l=null;switch(r){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":a=!0;break;case"\\\\atopfrac":a=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":a=!1,o="(",l=")";break;case"\\\\bracefrac":a=!1,o="\\{",l="\\}";break;case"\\\\brackfrac":a=!1,o="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}var c=r==="\\cfrac",u=null;return c||r.startsWith("\\d")?u="display":r.startsWith("\\t")&&(u="text"),jm({type:"genfrac",mode:n.mode,numer:s,denom:i,continued:c,hasBarLine:a,leftDelim:o,rightDelim:l,barSize:null},u)},htmlBuilder:N8,mathmlBuilder:z8});be({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],numArgs:0,infix:!0,handler(e){var{parser:t,funcName:n,token:r}=e,s;switch(n){case"\\over":s="\\frac";break;case"\\choose":s="\\binom";break;case"\\atop":s="\\\\atopfrac";break;case"\\brace":s="\\\\bracefrac";break;case"\\brack":s="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:t.mode,replaceWith:s,token:r}}});var Qd=["display","text","script","scriptscript"],Jd=function(t){var n=null;return t.length>0&&(n=t,n=n==="."?null:n),n};be({type:"genfrac",names:["\\genfrac"],numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"],handler(e,t){var{parser:n}=e,r=t[4],s=t[5],i=wo(t[0]),a=i.type==="atom"&&i.family==="open"?Jd(i.text):null,o=wo(t[1]),l=o.type==="atom"&&o.family==="close"?Jd(o.text):null,c=Je(t[2],"size"),u,p=null;c.isBlank?u=!0:(p=c.value,u=p.number>0);var m=null,f=t[3];if(f.type==="ordgroup"){if(f.body.length>0){var y=Je(f.body[0],"textord");m=Qd[Number(y.text)]}}else f=Je(f,"textord"),m=Qd[Number(f.text)];return jm({type:"genfrac",mode:n.mode,numer:r,denom:s,continued:!1,hasBarLine:u,barSize:p,leftDelim:a,rightDelim:l},m)}});be({type:"infix",names:["\\above"],numArgs:1,argTypes:["size"],infix:!0,handler(e,t){var{parser:n,funcName:r,token:s}=e;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:Je(t[0],"size").value,token:s}}});be({type:"genfrac",names:["\\\\abovefrac"],numArgs:3,argTypes:["math","size","math"],handler:(e,t)=>{var{parser:n,funcName:r}=e,s=t[0],i=Je(t[1],"infix").size;if(!i)throw new Error("\\\\abovefrac expected size, but got "+String(i));var a=t[2],o=i.number>0;return{type:"genfrac",mode:n.mode,numer:s,denom:a,continued:!1,hasBarLine:o,barSize:i,leftDelim:null,rightDelim:null}}});var Gm=(e,t)=>{var n=t.style,r,s;e.type==="supsub"?(r=e.sup?ht(e.sup,t.havingStyle(n.sup()),t):ht(e.sub,t.havingStyle(n.sub()),t),s=Je(e.base,"horizBrace")):s=Je(e,"horizBrace");var i=ht(s.base,t.havingBaseStyle(Ze.DISPLAY)),a=Vo(s,t),o;if(s.isOver?o=dt({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:.1},{type:"elem",elem:a,wrapperClasses:["svg-align"]}]}):o=dt({positionType:"bottom",positionData:i.depth+.1+a.height,children:[{type:"elem",elem:a,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:i}]}),r){var l=te(["minner",s.isOver?"mover":"munder"],[o],t);s.isOver?o=dt({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:r}]}):o=dt({positionType:"bottom",positionData:l.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:l}]})}return te(["minner",s.isOver?"mover":"munder"],[o],t)},$8=(e,t)=>{var n=Ho(e.label);return new oe(e.isOver?"mover":"munder",[xt(e.base,t),n])};be({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],numArgs:1,handler(e,t){var{parser:n,funcName:r}=e;return{type:"horizBrace",mode:n.mode,label:r,isOver:r.includes("\\over"),base:t[0]}},htmlBuilder:Gm,mathmlBuilder:$8});be({type:"href",names:["\\href"],numArgs:2,argTypes:["url","original"],allowedInText:!0,handler:(e,t)=>{var{parser:n}=e,r=t[1],s=Je(t[0],"url").url;return n.settings.isTrusted({command:"\\href",url:s})?{type:"href",mode:n.mode,href:s,body:Gt(r)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(e,t)=>{var n=tn(e.body,t,!1);return L7(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=ls(e.body,t);return n instanceof oe||(n=new oe("mrow",[n])),n.setAttribute("href",e.href),n}});be({type:"href",names:["\\url"],numArgs:1,argTypes:["url"],allowedInText:!0,handler:(e,t)=>{var{parser:n}=e,r=Je(t[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:r}))return n.formatUnsupportedCmd("\\url");for(var s=[],i=0;i<r.length;i++){var a=r[i];a==="~"&&(a="\\textasciitilde"),s.push({type:"textord",mode:"text",text:a})}var o={type:"text",mode:n.mode,font:"\\texttt",body:s};return{type:"href",mode:n.mode,href:r,body:Gt(o)}}});be({type:"hbox",names:["\\hbox"],numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0,handler(e,t){var{parser:n}=e;return{type:"hbox",mode:n.mode,body:Gt(t[0])}},htmlBuilder(e,t){var n=tn(e.body,t.withFont(""),!1);return Dr(n)},mathmlBuilder(e,t){return new oe("mrow",zn(e.body,t.withFont("")))}});be({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],numArgs:2,argTypes:["raw","original"],allowedInText:!0,handler:(e,t)=>{var{parser:n,funcName:r,token:s}=e,i=Je(t[0],"raw").string,a=t[1];n.settings.strict&&n.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var o,l={};switch(r){case"\\htmlClass":l.class=i,o={command:"\\htmlClass",class:i};break;case"\\htmlId":l.id=i,o={command:"\\htmlId",id:i};break;case"\\htmlStyle":l.style=i,o={command:"\\htmlStyle",style:i};break;case"\\htmlData":{for(var c=i.split(","),u=0;u<c.length;u++){var p=c[u],m=p.indexOf("=");if(m<0)throw new ae("\\htmlData key/value '"+p+"' missing equals sign");var f=p.slice(0,m),y=p.slice(m+1);l["data-"+f.trim()]=y}o={command:"\\htmlData",attributes:l};break}default:throw new Error("Unrecognized html command")}return n.settings.isTrusted(o)?{type:"html",mode:n.mode,attributes:l,body:Gt(a)}:n.formatUnsupportedCmd(r)},htmlBuilder:(e,t)=>{var n=tn(e.body,t,!1),r=["enclosing"];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var s=te(r,n,t);for(var i in e.attributes)i!=="class"&&e.attributes.hasOwnProperty(i)&&s.setAttribute(i,e.attributes[i]);return s},mathmlBuilder:(e,t)=>ls(e.body,t)});be({type:"htmlmathml",names:["\\html@mathml"],numArgs:2,allowedInArgument:!0,allowedInText:!0,handler:(e,t)=>{var{parser:n}=e;return{type:"htmlmathml",mode:n.mode,html:Gt(t[0]),mathml:Gt(t[1])}},htmlBuilder:(e,t)=>{var n=tn(e.html,t,!1);return Dr(n)},mathmlBuilder:(e,t)=>ls(e.mathml,t)});var Ll=function(t){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(t))return{number:+t,unit:"bp"};var n=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t);if(!n)throw new ae("Invalid size: '"+t+"' in \\includegraphics");var r={number:+(n[1]+n[2]),unit:n[3]};if(!mm(r))throw new ae("Invalid unit: '"+r.unit+"' in \\includegraphics.");return r};be({type:"includegraphics",names:["\\includegraphics"],numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1,handler:(e,t,n)=>{var{parser:r}=e,s={number:0,unit:"em"},i={number:.9,unit:"em"},a={number:0,unit:"em"},o="";if(n[0])for(var l=Je(n[0],"raw").string,c=l.split(","),u=0;u<c.length;u++){var p=c[u].split("=");if(p.length===2){var m=p[1].trim();switch(p[0].trim()){case"alt":o=m;break;case"width":s=Ll(m);break;case"height":i=Ll(m);break;case"totalheight":a=Ll(m);break;default:throw new ae("Invalid key: '"+p[0]+"' in \\includegraphics.")}}}var f=Je(t[0],"url").url;return o===""&&(o=f,o=o.replace(/^.*[\\/]/,""),o=o.substring(0,o.lastIndexOf("."))),r.settings.isTrusted({command:"\\includegraphics",url:f})?{type:"includegraphics",mode:r.mode,alt:o,width:s,height:i,totalheight:a,src:f}:r.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(e,t)=>{var n=zt(e.height,t),r=0;e.totalheight.number>0&&(r=zt(e.totalheight,t)-n);var s=0;e.width.number>0&&(s=zt(e.width,t));var i={height:ue(n+r)};s>0&&(i.width=ue(s)),r>0&&(i.verticalAlign=ue(-r));var a=new T7(e.src,e.alt,i);return a.height=n,a.depth=r,a},mathmlBuilder:(e,t)=>{var n=new oe("mglyph",[]);n.setAttribute("alt",e.alt);var r=zt(e.height,t),s=0;if(e.totalheight.number>0&&(s=zt(e.totalheight,t)-r,n.setAttribute("valign",ue(-s))),n.setAttribute("height",ue(r+s)),e.width.number>0){var i=zt(e.width,t);n.setAttribute("width",ue(i))}return n.setAttribute("src",e.src),n}});be({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0,handler(e,t){var{parser:n,funcName:r}=e,s=Je(t[0],"size");if(n.settings.strict){var i=r[1]==="m",a=s.value.unit==="mu";i?(a||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, "+("not "+s.value.unit+" units")),n.mode!=="math"&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):a&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:s.value}},htmlBuilder(e,t){return Sm(e.dimension,t)},mathmlBuilder(e,t){var n=zt(e.dimension,t);return new Tm(n)}});be({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],numArgs:1,allowedInText:!0,handler:(e,t)=>{var{parser:n,funcName:r}=e,s=t[0];return{type:"lap",mode:n.mode,alignment:r.slice(5),body:s}},htmlBuilder:(e,t)=>{var n;e.alignment==="clap"?(n=te([],[ht(e.body,t)]),n=te(["inner"],[n],t)):n=te(["inner"],[ht(e.body,t)]);var r=te(["fix"],[]),s=te([e.alignment],[n,r],t),i=te(["strut"]);return i.style.height=ue(s.height+s.depth),s.depth&&(i.style.verticalAlign=ue(-s.depth)),s.children.unshift(i),s=te(["thinbox"],[s],t),te(["mord","vbox"],[s],t)},mathmlBuilder:(e,t)=>{var n=new oe("mpadded",[xt(e.body,t)]);if(e.alignment!=="rlap"){var r=e.alignment==="llap"?"-1":"-0.5";n.setAttribute("lspace",r+"width")}return n.setAttribute("width","0px"),n}});be({type:"styling",names:["\\(","$"],numArgs:0,allowedInText:!0,allowedInMath:!1,handler(e,t){var{funcName:n,parser:r}=e,s=r.mode;r.switchMode("math");var i=n==="\\("?"\\)":"$",a=r.parseExpression(!1,i);return r.expect(i),r.switchMode(s),{type:"styling",mode:r.mode,style:"text",resetFont:!0,body:a}}});be({type:"text",names:["\\)","\\]"],numArgs:0,allowedInText:!0,allowedInMath:!1,handler(e,t){throw new ae("Mismatched "+e.funcName)}});var Yd=(e,t)=>{switch(t.style.size){case Ze.DISPLAY.size:return e.display;case Ze.TEXT.size:return e.text;case Ze.SCRIPT.size:return e.script;case Ze.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};be({type:"mathchoice",names:["\\mathchoice"],numArgs:4,primitive:!0,handler:(e,t)=>{var{parser:n}=e;return{type:"mathchoice",mode:n.mode,display:Gt(t[0]),text:Gt(t[1]),script:Gt(t[2]),scriptscript:Gt(t[3])}},htmlBuilder:(e,t)=>{var n=Yd(e,t),r=tn(n,t,!1);return Dr(r)},mathmlBuilder:(e,t)=>{var n=Yd(e,t);return ls(n,t)}});var Zm=(e,t,n,r,s,i,a)=>{e=te([],[e]);var o=n&&zr(n),l,c;if(t){var u=ht(t,r.havingStyle(s.sup()),r);c={elem:u,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-u.depth)}}if(n){var p=ht(n,r.havingStyle(s.sub()),r);l={elem:p,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-p.height)}}var m;if(c&&l){var f=r.fontMetrics().bigOpSpacing5+l.elem.height+l.elem.depth+l.kern+e.depth+a;m=dt({positionType:"bottom",positionData:f,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:ue(-i)},{type:"kern",size:l.kern},{type:"elem",elem:e},{type:"kern",size:c.kern},{type:"elem",elem:c.elem,marginLeft:ue(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else if(l){var y=e.height-a;m=dt({positionType:"top",positionData:y,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:ue(-i)},{type:"kern",size:l.kern},{type:"elem",elem:e}]})}else if(c){var b=e.depth+a;m=dt({positionType:"bottom",positionData:b,children:[{type:"elem",elem:e},{type:"kern",size:c.kern},{type:"elem",elem:c.elem,marginLeft:ue(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else return e;var x=[m];if(l&&i!==0&&!o){var S=te(["mspace"],[],r);S.style.marginRight=ue(i),x.unshift(S)}return te(["mop","op-limits"],x,r)},Km=new Set(["\\smallint"]),Wm=(e,t)=>{var n,r,s=!1,i;e.type==="supsub"?(n=e.sup,r=e.sub,i=Je(e.base,"op"),s=!0):i=Je(e,"op");var a=t.style,o=!1;a.size===Ze.DISPLAY.size&&i.symbol&&!Km.has(i.name)&&(o=!0);var l,c;if(i.symbol){var u=o?"Size2-Regular":"Size1-Regular",p="";if((i.name==="\\oiint"||i.name==="\\oiiint")&&(p=i.name.slice(1),i.name=p==="oiint"?"\\iint":"\\iiint"),l=pn(i.name,u,"math",t,["mop","op-symbol",o?"large-op":"small-op"]),c=l.italic,p.length>0){var m=km(p+"Size"+(o?"2":"1"),t);l=dt({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:m,shift:o?.08:0}]}),i.name="\\"+p,l.classes.unshift("mop"),l.italic=c}}else if(i.body){var f=tn(i.body,t,!0);f.length===1&&f[0]instanceof Mn?(l=f[0],l.classes[0]="mop"):l=te(["mop"],f,t)}else{for(var y=[],b=1;b<i.name.length;b++)y.push(D0(i.name[b],i.mode,t));l=te(["mop"],y,t)}var x=0,S=0;if((l instanceof Mn||i.name==="\\oiint"||i.name==="\\oiiint")&&!i.suppressBaseShift){var N;x=(l.height-l.depth)/2-t.fontMetrics().axisHeight,S=(N=l.italic)!=null?N:0}return s?Zm(l,n,r,t,a,S,x):(x&&(l.style.position="relative",l.style.top=ue(x)),l)},D8=(e,t)=>{var n;if(e.symbol)n=new oe("mo",[Fn(e.name,e.mode)]),Km.has(e.name)&&n.setAttribute("largeop","false");else if(e.body)n=new oe("mo",zn(e.body,t));else{n=new oe("mi",[new Zt(e.name.slice(1))]);var r=new oe("mo",[Fn("","text")]);e.parentIsSupSub?n=new oe("mrow",[n,r]):n=Am([n,r])}return n},P8={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};be({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],numArgs:0,handler:(e,t)=>{var{parser:n,funcName:r}=e,s=r;return s.length===1&&(s=P8[s]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:s}},htmlBuilder:Wm,mathmlBuilder:D8});be({type:"op",names:["\\mathop"],numArgs:1,primitive:!0,handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Gt(r)}}});var B8={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};be({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],numArgs:0,handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}}});be({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],numArgs:0,handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}}});be({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],numArgs:0,allowedInArgument:!0,handler(e){var{parser:t,funcName:n}=e,r=n;return r.length===1&&(r=B8[r]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}}});var Qm=(e,t)=>{var n,r,s=!1,i;e.type==="supsub"?(n=e.sup,r=e.sub,i=Je(e.base,"operatorname"),s=!0):i=Je(e,"operatorname");var a;if(i.body.length>0){for(var o=i.body.map(p=>{var m="text"in p?p.text:void 0;return typeof m=="string"?{type:"textord",mode:p.mode,text:m}:p}),l=tn(o,t.withFont("mathrm"),!0),c=0;c<l.length;c++){var u=l[c];u instanceof Mn&&(u.text=u.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}a=te(["mop"],l,t)}else a=te(["mop"],[],t);return s?Zm(a,n,r,t,t.style,0,0):a},L8=(e,t)=>{for(var n=zn(e.body,t.withFont("mathrm")),r=!0,s=0;s<n.length;s++){var i=n[s];if(!(i instanceof Tm))if(i instanceof oe)switch(i.type){case"mi":case"mn":case"mspace":case"mtext":break;case"mo":{var a=i.children[0];i.children.length===1&&a instanceof Zt?a.text=a.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):r=!1;break}default:r=!1}else r=!1}if(r){var o=n.map(u=>u.toText()).join("");n=[new Zt(o)]}var l=new oe("mi",n);l.setAttribute("mathvariant","normal");var c=new oe("mo",[Fn("","text")]);return e.parentIsSupSub?new oe("mrow",[l,c]):Am([l,c])};be({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],numArgs:1,handler:(e,t)=>{var{parser:n,funcName:r}=e,s=t[0];return{type:"operatorname",mode:n.mode,body:Gt(s),alwaysHandleSupSub:r==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:Qm,mathmlBuilder:L8});w("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");Ls({type:"ordgroup",htmlBuilder(e,t){return e.semisimple?Dr(tn(e.body,t,!1)):te(["mord"],tn(e.body,t,!0),t)},mathmlBuilder(e,t){return ls(e.body,t,!0)}});be({type:"overline",names:["\\overline"],numArgs:1,handler(e,t){var{parser:n}=e,r=t[0];return{type:"overline",mode:n.mode,body:r}},htmlBuilder(e,t){var n=ht(e.body,t.havingCrampedStyle()),r=ri("overline-line",t),s=t.fontMetrics().defaultRuleThickness,i=dt({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*s},{type:"elem",elem:r},{type:"kern",size:s}]});return te(["mord","overline"],[i],t)},mathmlBuilder(e,t){var n=new oe("mo",[new Zt("‾")]);n.setAttribute("stretchy","true");var r=new oe("mover",[xt(e.body,t),n]);return r.setAttribute("accent","true"),r}});be({type:"phantom",names:["\\phantom"],numArgs:1,allowedInText:!0,handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"phantom",mode:n.mode,body:Gt(r)}},htmlBuilder:(e,t)=>{var n=tn(e.body,t.withPhantom(),!1);return Dr(n)},mathmlBuilder:(e,t)=>{var n=zn(e.body,t);return new oe("mphantom",n)}});w("\\hphantom","\\smash{\\phantom{#1}}");be({type:"vphantom",names:["\\vphantom"],numArgs:1,allowedInText:!0,handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"vphantom",mode:n.mode,body:r}},htmlBuilder:(e,t)=>{var n=te(["inner"],[ht(e.body,t.withPhantom())]),r=te(["fix"],[]);return te(["mord","rlap"],[n,r],t)},mathmlBuilder:(e,t)=>{var n=zn(Gt(e.body),t),r=new oe("mphantom",n),s=new oe("mpadded",[r]);return s.setAttribute("width","0px"),s}});be({type:"raisebox",names:["\\raisebox"],numArgs:2,argTypes:["size","hbox"],allowedInText:!0,handler(e,t){var{parser:n}=e,r=Je(t[0],"size").value,s=t[1];return{type:"raisebox",mode:n.mode,dy:r,body:s}},htmlBuilder(e,t){var n=ht(e.body,t),r=zt(e.dy,t);return dt({positionType:"shift",positionData:-r,children:[{type:"elem",elem:n}]})},mathmlBuilder(e,t){var n=new oe("mpadded",[xt(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute("voffset",r),n}});be({type:"internal",names:["\\relax"],numArgs:0,allowedInText:!0,allowedInArgument:!0,handler(e){var{parser:t}=e;return{type:"internal",mode:t.mode}}});be({type:"rule",names:["\\rule"],numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"],handler(e,t,n){var{parser:r}=e,s=n[0],i=Je(t[0],"size"),a=Je(t[1],"size");return{type:"rule",mode:r.mode,shift:s&&Je(s,"size").value,width:i.value,height:a.value}},htmlBuilder(e,t){var n=te(["mord","rule"],[],t),r=zt(e.width,t),s=zt(e.height,t),i=e.shift?zt(e.shift,t):0;return n.style.borderRightWidth=ue(r),n.style.borderTopWidth=ue(s),n.style.bottom=ue(i),n.width=r,n.height=s+i,n.depth=-i,n.maxFontSize=s*1.125*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=zt(e.width,t),r=zt(e.height,t),s=e.shift?zt(e.shift,t):0,i=t.color&&t.getColor()||"black",a=new oe("mspace");a.setAttribute("mathbackground",i),a.setAttribute("width",ue(n)),a.setAttribute("height",ue(r));var o=new oe("mpadded",[a]);return s>=0?o.setAttribute("height",ue(s)):(o.setAttribute("height",ue(s)),o.setAttribute("depth",ue(-s))),o.setAttribute("voffset",ue(s)),o}});function Jm(e,t,n){for(var r=tn(e,t,!1),s=t.sizeMultiplier/n.sizeMultiplier,i=0;i<r.length;i++){var a=r[i].classes.indexOf("sizing");a<0?Array.prototype.push.apply(r[i].classes,t.sizingClasses(n)):r[i].classes[a+1]==="reset-size"+t.size&&(r[i].classes[a+1]="reset-size"+n.size),r[i].height*=s,r[i].depth*=s}return Dr(r)}var Xd=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],F8=(e,t)=>{var n=t.havingSize(e.size);return Jm(e.body,n,t)};be({type:"sizing",names:Xd,numArgs:0,allowedInText:!0,handler:(e,t)=>{var{breakOnTokenText:n,funcName:r,parser:s}=e,i=s.parseExpression(!1,n);return{type:"sizing",mode:s.mode,size:Xd.indexOf(r)+1,body:i}},htmlBuilder:F8,mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=zn(e.body,n),s=new oe("mstyle",r);return s.setAttribute("mathsize",ue(n.sizeMultiplier)),s}});be({type:"smash",names:["\\smash"],numArgs:1,numOptionalArgs:1,allowedInText:!0,handler:(e,t,n)=>{var{parser:r}=e,s=!1,i=!1,a=n[0]&&Je(n[0],"ordgroup");if(a)for(var o,l=0;l<a.body.length;++l){var c=a.body[l];if(o=jo(c).text,o==="t")s=!0;else if(o==="b")i=!0;else{s=!1,i=!1;break}}else s=!0,i=!0;var u=t[0];return{type:"smash",mode:r.mode,body:u,smashHeight:s,smashDepth:i}},htmlBuilder:(e,t)=>{var n=te([],[ht(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0),e.smashDepth&&(n.depth=0),e.smashHeight&&e.smashDepth)return te(["mord","smash"],[n],t);if(n.children)for(var r=0;r<n.children.length;r++)e.smashHeight&&(n.children[r].height=0),e.smashDepth&&(n.children[r].depth=0);var s=dt({positionType:"firstBaseline",children:[{type:"elem",elem:n}]});return te(["mord"],[s],t)},mathmlBuilder:(e,t)=>{var n=new oe("mpadded",[xt(e.body,t)]);return e.smashHeight&&n.setAttribute("height","0px"),e.smashDepth&&n.setAttribute("depth","0px"),n}});be({type:"sqrt",names:["\\sqrt"],numArgs:1,numOptionalArgs:1,handler(e,t,n){var{parser:r}=e,s=n[0],i=t[0];return{type:"sqrt",mode:r.mode,body:i,index:s}},htmlBuilder(e,t){var n=ht(e.body,t.havingCrampedStyle());n.height===0&&(n.height=t.fontMetrics().xHeight),n=si(n,t);var r=t.fontMetrics(),s=r.defaultRuleThickness,i=s;t.style.id<Ze.TEXT.id&&(i=t.fontMetrics().xHeight);var a=s+i/4,o=n.height+n.depth+a+s,{span:l,ruleWidth:c,advanceWidth:u}=S8(o,t),p=l.height-c;p>n.height+n.depth+a&&(a=(a+p-n.height-n.depth)/2);var m=l.height-n.height-a-c;n.style.paddingLeft=ue(u);var f=dt({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+m)},{type:"elem",elem:l},{type:"kern",size:c}]});if(e.index){var y=t.havingStyle(Ze.SCRIPTSCRIPT),b=ht(e.index,y,t),x=.6*(f.height-f.depth),S=dt({positionType:"shift",positionData:-x,children:[{type:"elem",elem:b}]}),N=te(["root"],[S]);return te(["mord","sqrt"],[N,f],t)}else return te(["mord","sqrt"],[f],t)},mathmlBuilder(e,t){var{body:n,index:r}=e;return r?new oe("mroot",[xt(n,t),xt(r,t)]):new oe("msqrt",[xt(n,t)])}});var Bc={display:Ze.DISPLAY,text:Ze.TEXT,script:Ze.SCRIPT,scriptscript:Ze.SCRIPTSCRIPT};function U8(e){return e in Bc}be({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],numArgs:0,allowedInText:!0,primitive:!0,handler(e,t){var{breakOnTokenText:n,funcName:r,parser:s}=e,i=s.parseExpression(!0,n),a=r.slice(1,r.length-5);if(!U8(a))throw new Error("Unknown style: "+a);return{type:"styling",mode:s.mode,style:a,body:i}},htmlBuilder(e,t){var n=Bc[e.style],r=t.havingStyle(n);return e.resetFont&&(r=r.withFont("")),Jm(e.body,r,t)},mathmlBuilder(e,t){var n=Bc[e.style],r=t.havingStyle(n);e.resetFont&&(r=r.withFont(""));var s=zn(e.body,r),i=new oe("mstyle",s),a={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},o=a[e.style];return i.setAttribute("scriptlevel",o[0]),i.setAttribute("displaystyle",o[1]),i}});var q8=function(t,n){var r=t.base;if(r)if(r.type==="op"){var s=r.limits&&(n.style.size===Ze.DISPLAY.size||r.alwaysHandleSupSub);return s?Wm:null}else if(r.type==="operatorname"){var i=r.alwaysHandleSupSub&&(n.style.size===Ze.DISPLAY.size||r.limits);return i?Qm:null}else{if(r.type==="accent")return zr(r.base)?Om:null;if(r.type==="horizBrace"){var a=!t.sub;return a===r.isOver?Gm:null}else return null}else return null};Ls({type:"supsub",htmlBuilder(e,t){var n=q8(e,t);if(n)return n(e,t);var{base:r,sup:s,sub:i}=e,a=ht(r,t),o,l,c=t.fontMetrics(),u=0,p=0,m=r&&zr(r);if(s){var f=t.havingStyle(t.style.sup());o=ht(s,f,t),m||(u=a.height-f.fontMetrics().supDrop*f.sizeMultiplier/t.sizeMultiplier)}if(i){var y=t.havingStyle(t.style.sub());l=ht(i,y,t),m||(p=a.depth+y.fontMetrics().subDrop*y.sizeMultiplier/t.sizeMultiplier)}var b;t.style===Ze.DISPLAY?b=c.sup1:t.style.cramped?b=c.sup3:b=c.sup2;var x=t.sizeMultiplier,S=ue(.5/c.ptPerEm/x),N=null;if(l){var z=e.base&&e.base.type==="op"&&e.base.name&&(e.base.name==="\\oiint"||e.base.name==="\\oiiint");if(a instanceof Mn||z){var I;N=ue(-((I=a.italic)!=null?I:0))}}var E;if(o&&l){u=Math.max(u,b,o.depth+.25*c.xHeight),p=Math.max(p,c.sub2);var _=c.defaultRuleThickness,L=4*_;if(u-o.depth-(l.height-p)<L){p=L-(u-o.depth)+l.height;var M=.8*c.xHeight-(u-o.depth);M>0&&(u+=M,p-=M)}var G=[{type:"elem",elem:l,shift:p,marginRight:S,marginLeft:N},{type:"elem",elem:o,shift:-u,marginRight:S}];E=dt({positionType:"individualShift",children:G})}else if(l){p=Math.max(p,c.sub1,l.height-.8*c.xHeight);var P=[{type:"elem",elem:l,marginLeft:N,marginRight:S}];E=dt({positionType:"shift",positionData:p,children:P})}else if(o)u=Math.max(u,b,o.depth+.25*c.xHeight),E=dt({positionType:"shift",positionData:-u,children:[{type:"elem",elem:o,marginRight:S}]});else throw new Error("supsub must have either sup or sub.");var W=Nc(a,"right")||"mord";return te([W],[a,te(["msupsub"],[E])],t)},mathmlBuilder(e,t){var n=!1,r,s;e.base&&e.base.type==="horizBrace"&&(s=!!e.sup,s===e.base.isOver&&(n=!0,r=e.base.isOver)),e.base&&(e.base.type==="op"||e.base.type==="operatorname")&&(e.base.parentIsSupSub=!0);var i=[xt(e.base,t)];e.sub&&i.push(xt(e.sub,t)),e.sup&&i.push(xt(e.sup,t));var a;if(n)a=r?"mover":"munder";else if(e.sub)if(e.sup){var c=e.base;c&&c.type==="op"&&c.limits&&t.style===Ze.DISPLAY||c&&c.type==="operatorname"&&c.alwaysHandleSupSub&&(t.style===Ze.DISPLAY||c.limits)?a="munderover":a="msubsup"}else{var l=e.base;l&&l.type==="op"&&l.limits&&(t.style===Ze.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||t.style===Ze.DISPLAY)?a="munder":a="msub"}else{var o=e.base;o&&o.type==="op"&&o.limits&&(t.style===Ze.DISPLAY||o.alwaysHandleSupSub)||o&&o.type==="operatorname"&&o.alwaysHandleSupSub&&(o.limits||t.style===Ze.DISPLAY)?a="mover":a="msup"}return new oe(a,i)}});Ls({type:"atom",htmlBuilder(e,t){return D0(e.text,e.mode,t,["m"+e.family])},mathmlBuilder(e,t){var n=new oe("mo",[Fn(e.text,e.mode)]);if(e.family==="bin"){var r=L0(e,t);r==="bold-italic"&&n.setAttribute("mathvariant",r)}else e.family==="punct"?n.setAttribute("separator","true"):(e.family==="open"||e.family==="close")&&n.setAttribute("stretchy","false");return n}});var Ym={mi:"italic",mn:"normal",mtext:"normal"};Ls({type:"mathord",htmlBuilder(e,t){return qo(e,t)},mathmlBuilder(e,t){var n=new oe("mi",[Fn(e.text,e.mode,t)]),r=L0(e,t)||"italic";return r!==Ym[n.type]&&n.setAttribute("mathvariant",r),n}});Ls({type:"textord",htmlBuilder(e,t){return qo(e,t)},mathmlBuilder(e,t){var n=Fn(e.text,e.mode,t),r=L0(e,t)||"normal",s;return e.mode==="text"?s=new oe("mtext",[n]):/[0-9]/.test(e.text)?s=new oe("mn",[n]):e.text==="\\prime"?s=new oe("mo",[n]):s=new oe("mi",[n]),r!==Ym[s.type]&&s.setAttribute("mathvariant",r),s}});var Fl={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Ul={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Ls({type:"spacing",htmlBuilder(e,t){if(Ul.hasOwnProperty(e.text)){var n=Ul[e.text].className||"";if(e.mode==="text"){var r=qo(e,t);return r.classes.push(n),r}else return te(["mspace",n],[D0(e.text,e.mode,t)],t)}else{if(Fl.hasOwnProperty(e.text))return te(["mspace",Fl[e.text]],[],t);throw new ae('Unknown type of space "'+e.text+'"')}},mathmlBuilder(e,t){var n;if(Ul.hasOwnProperty(e.text))n=new oe("mtext",[new Zt(" ")]);else{if(Fl.hasOwnProperty(e.text))return new oe("mspace");throw new ae('Unknown type of space "'+e.text+'"')}return n}});var ef=()=>{var e=new oe("mtd",[]);return e.setAttribute("width","50%"),e};Ls({type:"tag",mathmlBuilder(e,t){var n=new oe("mtable",[new oe("mtr",[ef(),new oe("mtd",[ls(e.body,t)]),ef(),new oe("mtd",[ls(e.tag,t)])])]);return n.setAttribute("width","100%"),n}});var tf={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},nf={"\\textbf":"textbf","\\textmd":"textmd"},H8={"\\textit":"textit","\\textup":"textup"},rf=(e,t)=>{var n=e.font;if(n){if(tf[n])return t.withTextFontFamily(tf[n]);if(nf[n])return t.withTextFontWeight(nf[n]);if(n==="\\emph")return t.fontShape==="textit"?t.withTextFontShape("textup"):t.withTextFontShape("textit")}else return t;return t.withTextFontShape(H8[n])};be({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0,handler(e,t){var{parser:n,funcName:r}=e,s=t[0];return{type:"text",mode:n.mode,body:Gt(s),font:r}},htmlBuilder(e,t){var n=rf(e,t),r=tn(e.body,n,!0);return te(["mord","text"],r,n)},mathmlBuilder(e,t){var n=rf(e,t);return ls(e.body,n)}});be({type:"underline",names:["\\underline"],numArgs:1,allowedInText:!0,handler(e,t){var{parser:n}=e;return{type:"underline",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=ht(e.body,t),r=ri("underline-line",t),s=t.fontMetrics().defaultRuleThickness,i=dt({positionType:"top",positionData:n.height,children:[{type:"kern",size:s},{type:"elem",elem:r},{type:"kern",size:3*s},{type:"elem",elem:n}]});return te(["mord","underline"],[i],t)},mathmlBuilder(e,t){var n=new oe("mo",[new Zt("‾")]);n.setAttribute("stretchy","true");var r=new oe("munder",[xt(e.body,t),n]);return r.setAttribute("accentunder","true"),r}});be({type:"vcenter",names:["\\vcenter"],numArgs:1,argTypes:["original"],allowedInText:!1,handler(e,t){var{parser:n}=e;return{type:"vcenter",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=ht(e.body,t),r=t.fontMetrics().axisHeight,s=.5*(n.height-r-(n.depth+r));return dt({positionType:"shift",positionData:s,children:[{type:"elem",elem:n}]})},mathmlBuilder(e,t){var n=new oe("mpadded",[xt(e.body,t)],["vcenter"]);return new oe("mrow",[n])}});be({type:"verb",names:["\\verb"],numArgs:0,allowedInText:!0,handler(e,t,n){throw new ae("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){for(var n=sf(e),r=[],s=t.havingStyle(t.style.text()),i=0;i<n.length;i++){var a=n[i];a==="~"&&(a="\\textasciitilde"),r.push(pn(a,"Typewriter-Regular",e.mode,s,["mord","texttt"]))}return te(["mord","text"].concat(s.sizingClasses(t)),wm(r),s)},mathmlBuilder(e,t){var n=new Zt(sf(e)),r=new oe("mtext",[n]);return r.setAttribute("mathvariant","monospace"),r}});var sf=e=>e.body.replace(/ /g,e.star?"␣":" "),Yr=_m,Xm=`[ \r
|
|
314
|
+
]`,V8="\\\\[a-zA-Z@]+",j8="\\\\[^\uD800-\uDFFF]",G8="("+V8+")"+Xm+"*",Z8=`\\\\(
|
|
315
315
|
|[ \r ]+
|
|
316
|
-
?)[ \r ]*`,Lc="[̀-ͯ]",
|
|
317
|
-
`,this.tokenRegex.lastIndex);return i===-1?(this.tokenRegex.lastIndex=t.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 Rn(s,new wn(this,n,this.tokenRegex.lastIndex))}}class U8{constructor(t,n){t===void 0&&(t={}),n===void 0&&(n={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=n,this.builtins=t,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new ae("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var t=this.undefStack.pop();for(var n in t)t.hasOwnProperty(n)&&(t[n]==null?delete this.current[n]:this.current[n]=t[n])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(t){return this.current.hasOwnProperty(t)||this.builtins.hasOwnProperty(t)}get(t){return this.current.hasOwnProperty(t)?this.current[t]:this.builtins[t]}set(t,n,r){if(r===void 0&&(r=!1),r){for(var s=0;s<this.undefStack.length;s++)delete this.undefStack[s][t];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][t]=n)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(t)&&(i[t]=this.current[t])}n==null?delete this.current[t]:this.current[t]=n}}var q8=Um;w("\\noexpand",function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}});w("\\expandafter",function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}});w("\\@firstoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[0],numArgs:0}});w("\\@secondoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[1],numArgs:0}});w("\\@ifnextchar",function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return t[0].length===1&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}});w("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");w("\\TextOrMath",function(e){var t=e.consumeArgs(2);return e.mode==="text"?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var af={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};w("\\char",function(e){var t=e.popToken(),n,r=0;if(t.text==="'")n=8,t=e.popToken();else if(t.text==='"')n=16,t=e.popToken();else if(t.text==="`")if(t=e.popToken(),t.text[0]==="\\")r=t.text.charCodeAt(1);else{if(t.text==="EOF")throw new ae("\\char` missing argument");r=t.text.charCodeAt(0)}else n=10;if(n){if(r=af[t.text],r==null||r>=n)throw new ae("Invalid base-"+n+" digit "+t.text);for(var s;(s=af[e.future().text])!=null&&s<n;)r*=n,r+=s,e.popToken()}return"\\@char{"+r+"}"});var H0=(e,t,n,r)=>{var s=e.consumeArg().tokens;if(s.length!==1)throw new ae("\\newcommand's first argument must be a macro name");var i=s[0].text,a=e.isDefined(i);if(a&&!t)throw new ae("\\newcommand{"+i+"} attempting to redefine "+(i+"; use \\renewcommand"));if(!a&&!n)throw new ae("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");var o=0;if(s=e.consumeArg().tokens,s.length===1&&s[0].text==="["){for(var l="",c=e.expandNextToken();c.text!=="]"&&c.text!=="EOF";)l+=c.text,c=e.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new ae("Invalid number of arguments: "+l);o=parseInt(l),s=e.consumeArg().tokens}return a&&r||e.macros.set(i,{tokens:s,numArgs:o}),""};w("\\newcommand",e=>H0(e,!1,!0,!1));w("\\renewcommand",e=>H0(e,!0,!1,!1));w("\\providecommand",e=>H0(e,!0,!0,!0));w("\\message",e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(n=>n.text).join("")),""});w("\\errmessage",e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(n=>n.text).join("")),""});w("\\show",e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),Jr[n],Rt.math[n],Rt.text[n]),""});w("\\bgroup","{");w("\\egroup","}");w("~","\\nobreakspace");w("\\lq","`");w("\\rq","'");w("\\aa","\\r a");w("\\AA","\\r A");w("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");w("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");w("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");w("ℬ","\\mathscr{B}");w("ℰ","\\mathscr{E}");w("ℱ","\\mathscr{F}");w("ℋ","\\mathscr{H}");w("ℐ","\\mathscr{I}");w("ℒ","\\mathscr{L}");w("ℳ","\\mathscr{M}");w("ℛ","\\mathscr{R}");w("ℭ","\\mathfrak{C}");w("ℌ","\\mathfrak{H}");w("ℨ","\\mathfrak{Z}");w("\\Bbbk","\\Bbb{k}");w("\\llap","\\mathllap{\\textrm{#1}}");w("\\rlap","\\mathrlap{\\textrm{#1}}");w("\\clap","\\mathclap{\\textrm{#1}}");w("\\mathstrut","\\vphantom{(}");w("\\underbar","\\underline{\\text{#1}}");w("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');w("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");w("\\ne","\\neq");w("≠","\\neq");w("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");w("∉","\\notin");w("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");w("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");w("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");w("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");w("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");w("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");w("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");w("⟂","\\perp");w("‼","\\mathclose{!\\mkern-0.8mu!}");w("∌","\\notni");w("⌜","\\ulcorner");w("⌝","\\urcorner");w("⌞","\\llcorner");w("⌟","\\lrcorner");w("©","\\copyright");w("®","\\textregistered");w("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');w("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');w("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');w("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');w("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");w("⋮","\\vdots");w("\\varGamma","\\mathit{\\Gamma}");w("\\varDelta","\\mathit{\\Delta}");w("\\varTheta","\\mathit{\\Theta}");w("\\varLambda","\\mathit{\\Lambda}");w("\\varXi","\\mathit{\\Xi}");w("\\varPi","\\mathit{\\Pi}");w("\\varSigma","\\mathit{\\Sigma}");w("\\varUpsilon","\\mathit{\\Upsilon}");w("\\varPhi","\\mathit{\\Phi}");w("\\varPsi","\\mathit{\\Psi}");w("\\varOmega","\\mathit{\\Omega}");w("\\substack","\\begin{subarray}{c}#1\\end{subarray}");w("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");w("\\boxed","\\fbox{$\\displaystyle{#1}$}");w("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");w("\\implies","\\DOTSB\\;\\Longrightarrow\\;");w("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");w("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");w("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var of={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"},H8=new Set(["bin","rel"]);w("\\dots",function(e){var t="\\dotso",n=e.expandAfterFuture().text;return n in of?t=of[n]:(n.slice(0,4)==="\\not"||n in Rt.math&&H8.has(Rt.math[n].group))&&(t="\\dotsb"),t});var V0={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};w("\\dotso",function(e){var t=e.future().text;return t in V0?"\\ldots\\,":"\\ldots"});w("\\dotsc",function(e){var t=e.future().text;return t in V0&&t!==","?"\\ldots\\,":"\\ldots"});w("\\cdots",function(e){var t=e.future().text;return t in V0?"\\@cdots\\,":"\\@cdots"});w("\\dotsb","\\cdots");w("\\dotsm","\\cdots");w("\\dotsi","\\!\\cdots");w("\\dotsx","\\ldots\\,");w("\\DOTSI","\\relax");w("\\DOTSB","\\relax");w("\\DOTSX","\\relax");w("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");w("\\,","\\tmspace+{3mu}{.1667em}");w("\\thinspace","\\,");w("\\>","\\mskip{4mu}");w("\\:","\\tmspace+{4mu}{.2222em}");w("\\medspace","\\:");w("\\;","\\tmspace+{5mu}{.2777em}");w("\\thickspace","\\;");w("\\!","\\tmspace-{3mu}{.1667em}");w("\\negthinspace","\\!");w("\\negmedspace","\\tmspace-{4mu}{.2222em}");w("\\negthickspace","\\tmspace-{5mu}{.277em}");w("\\enspace","\\kern.5em ");w("\\enskip","\\hskip.5em\\relax");w("\\quad","\\hskip1em\\relax");w("\\qquad","\\hskip2em\\relax");w("\\tag","\\@ifstar\\tag@literal\\tag@paren");w("\\tag@paren","\\tag@literal{({#1})}");w("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new ae("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});w("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");w("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");w("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");w("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");w("\\newline","\\\\\\relax");w("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var Ym=ue(cr["Main-Regular"][84][1]-.7*cr["Main-Regular"][65][1]);w("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+Ym+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");w("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+Ym+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");w("\\hspace","\\@ifstar\\@hspacer\\@hspace");w("\\@hspace","\\hskip #1\\relax");w("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");w("\\ordinarycolon",":");w("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");w("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');w("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');w("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');w("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');w("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');w("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');w("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');w("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');w("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');w("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');w("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');w("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');w("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');w("∷","\\dblcolon");w("∹","\\eqcolon");w("≔","\\coloneqq");w("≕","\\eqqcolon");w("⩴","\\Coloneqq");w("\\ratio","\\vcentcolon");w("\\coloncolon","\\dblcolon");w("\\colonequals","\\coloneqq");w("\\coloncolonequals","\\Coloneqq");w("\\equalscolon","\\eqqcolon");w("\\equalscoloncolon","\\Eqqcolon");w("\\colonminus","\\coloneq");w("\\coloncolonminus","\\Coloneq");w("\\minuscolon","\\eqcolon");w("\\minuscoloncolon","\\Eqcolon");w("\\coloncolonapprox","\\Colonapprox");w("\\coloncolonsim","\\Colonsim");w("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");w("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");w("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");w("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");w("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");w("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");w("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");w("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");w("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");w("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");w("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");w("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");w("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");w("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");w("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");w("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");w("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");w("\\nleqq","\\html@mathml{\\@nleqq}{≰}");w("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");w("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");w("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");w("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");w("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");w("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");w("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");w("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");w("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");w("\\imath","\\html@mathml{\\@imath}{ı}");w("\\jmath","\\html@mathml{\\@jmath}{ȷ}");w("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");w("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");w("⟦","\\llbracket");w("⟧","\\rrbracket");w("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");w("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");w("⦃","\\lBrace");w("⦄","\\rBrace");w("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");w("⦵","\\minuso");w("\\darr","\\downarrow");w("\\dArr","\\Downarrow");w("\\Darr","\\Downarrow");w("\\lang","\\langle");w("\\rang","\\rangle");w("\\uarr","\\uparrow");w("\\uArr","\\Uparrow");w("\\Uarr","\\Uparrow");w("\\N","\\mathbb{N}");w("\\R","\\mathbb{R}");w("\\Z","\\mathbb{Z}");w("\\alef","\\aleph");w("\\alefsym","\\aleph");w("\\Alpha","\\mathrm{A}");w("\\Beta","\\mathrm{B}");w("\\bull","\\bullet");w("\\Chi","\\mathrm{X}");w("\\clubs","\\clubsuit");w("\\cnums","\\mathbb{C}");w("\\Complex","\\mathbb{C}");w("\\Dagger","\\ddagger");w("\\diamonds","\\diamondsuit");w("\\empty","\\emptyset");w("\\Epsilon","\\mathrm{E}");w("\\Eta","\\mathrm{H}");w("\\exist","\\exists");w("\\harr","\\leftrightarrow");w("\\hArr","\\Leftrightarrow");w("\\Harr","\\Leftrightarrow");w("\\hearts","\\heartsuit");w("\\image","\\Im");w("\\infin","\\infty");w("\\Iota","\\mathrm{I}");w("\\isin","\\in");w("\\Kappa","\\mathrm{K}");w("\\larr","\\leftarrow");w("\\lArr","\\Leftarrow");w("\\Larr","\\Leftarrow");w("\\lrarr","\\leftrightarrow");w("\\lrArr","\\Leftrightarrow");w("\\Lrarr","\\Leftrightarrow");w("\\Mu","\\mathrm{M}");w("\\natnums","\\mathbb{N}");w("\\Nu","\\mathrm{N}");w("\\Omicron","\\mathrm{O}");w("\\plusmn","\\pm");w("\\rarr","\\rightarrow");w("\\rArr","\\Rightarrow");w("\\Rarr","\\Rightarrow");w("\\real","\\Re");w("\\reals","\\mathbb{R}");w("\\Reals","\\mathbb{R}");w("\\Rho","\\mathrm{P}");w("\\sdot","\\cdot");w("\\sect","\\S");w("\\spades","\\spadesuit");w("\\sub","\\subset");w("\\sube","\\subseteq");w("\\supe","\\supseteq");w("\\Tau","\\mathrm{T}");w("\\thetasym","\\vartheta");w("\\weierp","\\wp");w("\\Zeta","\\mathrm{Z}");w("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");w("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");w("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");w("\\bra","\\mathinner{\\langle{#1}|}");w("\\ket","\\mathinner{|{#1}\\rangle}");w("\\braket","\\mathinner{\\langle{#1}\\rangle}");w("\\Bra","\\left\\langle#1\\right|");w("\\Ket","\\left|#1\\right\\rangle");var Xm=e=>t=>{var n=t.consumeArg().tokens,r=t.consumeArg().tokens,s=t.consumeArg().tokens,i=t.consumeArg().tokens,a=t.macros.get("|"),o=t.macros.get("\\|");t.macros.beginGroup();var l=f=>m=>{e&&(m.macros.set("|",a),s.length&&m.macros.set("\\|",o));var h=f;if(!f&&s.length){var y=m.future();y.text==="|"&&(m.popToken(),h=!0)}return{tokens:h?s:r,numArgs:0}};t.macros.set("|",l(!1)),s.length&&t.macros.set("\\|",l(!0));var c=t.consumeArg().tokens,u=t.expandTokens([...i,...c,...n]);return t.macros.endGroup(),{tokens:u.reverse(),numArgs:0}};w("\\bra@ket",Xm(!1));w("\\bra@set",Xm(!0));w("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");w("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");w("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");w("\\angln","{\\angl n}");w("\\blue","\\textcolor{##6495ed}{#1}");w("\\orange","\\textcolor{##ffa500}{#1}");w("\\pink","\\textcolor{##ff00af}{#1}");w("\\red","\\textcolor{##df0030}{#1}");w("\\green","\\textcolor{##28ae7b}{#1}");w("\\gray","\\textcolor{gray}{#1}");w("\\purple","\\textcolor{##9d38bd}{#1}");w("\\blueA","\\textcolor{##ccfaff}{#1}");w("\\blueB","\\textcolor{##80f6ff}{#1}");w("\\blueC","\\textcolor{##63d9ea}{#1}");w("\\blueD","\\textcolor{##11accd}{#1}");w("\\blueE","\\textcolor{##0c7f99}{#1}");w("\\tealA","\\textcolor{##94fff5}{#1}");w("\\tealB","\\textcolor{##26edd5}{#1}");w("\\tealC","\\textcolor{##01d1c1}{#1}");w("\\tealD","\\textcolor{##01a995}{#1}");w("\\tealE","\\textcolor{##208170}{#1}");w("\\greenA","\\textcolor{##b6ffb0}{#1}");w("\\greenB","\\textcolor{##8af281}{#1}");w("\\greenC","\\textcolor{##74cf70}{#1}");w("\\greenD","\\textcolor{##1fab54}{#1}");w("\\greenE","\\textcolor{##0d923f}{#1}");w("\\goldA","\\textcolor{##ffd0a9}{#1}");w("\\goldB","\\textcolor{##ffbb71}{#1}");w("\\goldC","\\textcolor{##ff9c39}{#1}");w("\\goldD","\\textcolor{##e07d10}{#1}");w("\\goldE","\\textcolor{##a75a05}{#1}");w("\\redA","\\textcolor{##fca9a9}{#1}");w("\\redB","\\textcolor{##ff8482}{#1}");w("\\redC","\\textcolor{##f9685d}{#1}");w("\\redD","\\textcolor{##e84d39}{#1}");w("\\redE","\\textcolor{##bc2612}{#1}");w("\\maroonA","\\textcolor{##ffbde0}{#1}");w("\\maroonB","\\textcolor{##ff92c6}{#1}");w("\\maroonC","\\textcolor{##ed5fa6}{#1}");w("\\maroonD","\\textcolor{##ca337c}{#1}");w("\\maroonE","\\textcolor{##9e034e}{#1}");w("\\purpleA","\\textcolor{##ddd7ff}{#1}");w("\\purpleB","\\textcolor{##c6b9fc}{#1}");w("\\purpleC","\\textcolor{##aa87ff}{#1}");w("\\purpleD","\\textcolor{##7854ab}{#1}");w("\\purpleE","\\textcolor{##543b78}{#1}");w("\\mintA","\\textcolor{##f5f9e8}{#1}");w("\\mintB","\\textcolor{##edf2df}{#1}");w("\\mintC","\\textcolor{##e0e5cc}{#1}");w("\\grayA","\\textcolor{##f6f7f7}{#1}");w("\\grayB","\\textcolor{##f0f1f2}{#1}");w("\\grayC","\\textcolor{##e3e5e6}{#1}");w("\\grayD","\\textcolor{##d6d8da}{#1}");w("\\grayE","\\textcolor{##babec2}{#1}");w("\\grayF","\\textcolor{##888d93}{#1}");w("\\grayG","\\textcolor{##626569}{#1}");w("\\grayH","\\textcolor{##3b3e40}{#1}");w("\\grayI","\\textcolor{##21242c}{#1}");w("\\kaBlue","\\textcolor{##314453}{#1}");w("\\kaGreen","\\textcolor{##71B307}{#1}");var e1={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class V8{constructor(t,n,r){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=n,this.expansionCount=0,this.feed(t),this.macros=new U8(q8,n.macros),this.mode=r,this.stack=[]}feed(t){this.lexer=new sf(t,this.settings)}switchMode(t){this.mode=t}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(t){this.stack.push(t)}pushTokens(t){this.stack.push(...t)}scanArgument(t){var n,r,s;if(t){if(this.consumeSpaces(),this.future().text!=="[")return null;n=this.popToken(),{tokens:s,end:r}=this.consumeArg(["]"])}else({tokens:s,start:n,end:r}=this.consumeArg());return this.pushToken(new Rn("EOF",r.loc)),this.pushTokens(s),new Rn("",wn.range(n,r))}consumeSpaces(){for(;;){var t=this.future();if(t.text===" ")this.stack.pop();else break}}consumeArg(t){var n=[],r=t&&t.length>0;r||this.consumeSpaces();var s=this.future(),i,a=0,o=0;do{if(i=this.popToken(),n.push(i),i.text==="{")++a;else if(i.text==="}"){if(--a,a===-1)throw new ae("Extra }",i)}else if(i.text==="EOF")throw new ae("Unexpected end of input in a macro argument, expected '"+(t&&r?t[o]:"}")+"'",i);if(t&&r)if((a===0||a===1&&t[o]==="{")&&i.text===t[o]){if(++o,o===t.length){n.splice(-o,o);break}}else o=0}while(a!==0||r);return s.text==="{"&&n[n.length-1].text==="}"&&(n.pop(),n.shift()),n.reverse(),{tokens:n,start:s,end:i}}consumeArgs(t,n){if(n){if(n.length!==t+1)throw new ae("The length of delimiters doesn't match the number of args!");for(var r=n[0],s=0;s<r.length;s++){var i=this.popToken();if(r[s]!==i.text)throw new ae("Use of the macro doesn't match its definition",i)}}for(var a=[],o=0;o<t;o++)a.push(this.consumeArg(n&&n[o+1]).tokens);return a}countExpansion(t){if(this.expansionCount+=t,this.expansionCount>this.settings.maxExpand)throw new ae("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(t){var n=this.popToken(),r=n.text,s=n.noexpand?null:this._getExpansion(r);if(s==null||t&&s.unexpandable){if(t&&s==null&&r[0]==="\\"&&!this.isDefined(r))throw new ae("Undefined control sequence: "+r);return this.pushToken(n),!1}this.countExpansion(1);var i=s.tokens,a=this.consumeArgs(s.numArgs,s.delimiters);if(s.numArgs){i=i.slice();for(var o=i.length-1;o>=0;--o){var l=i[o];if(l.text==="#"){if(o===0)throw new ae("Incomplete placeholder at end of macro body",l);if(l=i[--o],l.text==="#")i.splice(o+1,1);else if(/^[1-9]$/.test(l.text))i.splice(o,2,...a[+l.text-1]);else throw new ae("Not a valid argument number",l)}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var t=this.stack.pop();return t.treatAsRelax&&(t.text="\\relax"),t}}expandMacro(t){return this.macros.has(t)?this.expandTokens([new Rn(t)]):void 0}expandTokens(t){var n=[],r=this.stack.length;for(this.pushTokens(t);this.stack.length>r;)if(this.expandOnce(!0)===!1){var s=this.stack.pop();s.treatAsRelax&&(s.noexpand=!1,s.treatAsRelax=!1),n.push(s)}return this.countExpansion(n.length),n}expandMacroAsText(t){var n=this.expandMacro(t);return n&&n.map(r=>r.text).join("")}_getExpansion(t){var n=this.macros.get(t);if(n==null)return n;if(t.length===1){var r=this.lexer.catcodes[t];if(r!=null&&r!==13)return}var s=typeof n=="function"?n(this):n;if(typeof s=="string"){var i=0;if(s.includes("#"))for(var a=s.replace(/##/g,"");a.includes("#"+(i+1));)++i;for(var o=new sf(s,this.settings),l=[],c=o.lex();c.text!=="EOF";)l.push(c),c=o.lex();l.reverse();var u={tokens:l,numArgs:i};return u}return s}isDefined(t){return this.macros.has(t)||Jr.hasOwnProperty(t)||Rt.math.hasOwnProperty(t)||Rt.text.hasOwnProperty(t)||e1.hasOwnProperty(t)}isExpandable(t){var n=this.macros.get(t);return n!=null?typeof n=="string"||typeof n=="function"||!n.unexpandable:Jr.hasOwnProperty(t)&&!Jr[t].primitive}}var lf=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,Fa=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),ql={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},cf={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class Qo{constructor(t,n){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new V8(t,n,this.mode),this.settings=n,this.leftrightDepth=0,this.nextToken=null}expect(t,n){if(n===void 0&&(n=!0),this.fetch().text!==t)throw new ae("Expected '"+t+"', got '"+this.fetch().text+"'",this.fetch());n&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(t){this.mode=t,this.gullet.switchMode(t)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var t=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),t}finally{this.gullet.endGroups()}}subparse(t){var n=this.nextToken;this.consume(),this.gullet.pushToken(new Rn("}")),this.gullet.pushTokens(t);var r=this.parseExpression(!1);return this.expect("}"),this.nextToken=n,r}parseExpression(t,n){for(var r=[];;){this.mode==="math"&&this.consumeSpaces();var s=this.fetch();if(Qo.endOfExpression.has(s.text)||n&&s.text===n||t&&Jr[s.text]&&Jr[s.text].infix)break;var i=this.parseAtom(n);if(i){if(i.type==="internal")continue}else break;r.push(i)}return this.mode==="text"&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(t){for(var n=-1,r,s=0;s<t.length;s++){var i=t[s];if(i.type==="infix"){if(n!==-1)throw new ae("only one infix operator per group",i.token);n=s,r=i.replaceWith}}if(n!==-1&&r){var a,o,l=t.slice(0,n),c=t.slice(n+1);l.length===1&&l[0].type==="ordgroup"?a=l[0]:a={type:"ordgroup",mode:this.mode,body:l},c.length===1&&c[0].type==="ordgroup"?o=c[0]:o={type:"ordgroup",mode:this.mode,body:c};var u;return r==="\\\\abovefrac"?u=this.callFunction(r,[a,t[n],o],[]):u=this.callFunction(r,[a,o],[]),[u]}else return t}handleSupSubscript(t){var n=this.fetch(),r=n.text;this.consume(),this.consumeSpaces();var s;do{var i;s=this.parseGroup(t)}while(((i=s)==null?void 0:i.type)==="internal");if(!s)throw new ae("Expected group after '"+r+"'",n);return s}formatUnsupportedCmd(t){for(var n=[],r=0;r<t.length;r++)n.push({type:"textord",mode:"text",text:t[r]});var s={type:"text",mode:this.mode,body:n},i={type:"color",mode:this.mode,color:this.settings.errorColor,body:[s]};return i}parseAtom(t){var n=this.parseGroup("atom",t);if(n?.type==="internal"||this.mode==="text")return n;for(var r,s;;){this.consumeSpaces();var i=this.fetch();if(i.text==="\\limits"||i.text==="\\nolimits"){if(n&&n.type==="op")n.limits=i.text==="\\limits",n.alwaysHandleSupSub=!0;else if(n&&n.type==="operatorname")n.alwaysHandleSupSub&&(n.limits=i.text==="\\limits");else throw new ae("Limit controls must follow a math operator",i);this.consume()}else if(i.text==="^"){if(r)throw new ae("Double superscript",i);r=this.handleSupSubscript("superscript")}else if(i.text==="_"){if(s)throw new ae("Double subscript",i);s=this.handleSupSubscript("subscript")}else if(i.text==="'"){if(r)throw new ae("Double superscript",i);var a={type:"textord",mode:this.mode,text:"\\prime"},o=[a];for(this.consume();this.fetch().text==="'";)o.push(a),this.consume();this.fetch().text==="^"&&o.push(this.handleSupSubscript("superscript")),r={type:"ordgroup",mode:this.mode,body:o}}else if(Fa[i.text]){var l=lf.test(i.text),c=[];for(c.push(new Rn(Fa[i.text])),this.consume();;){var u=this.fetch().text;if(!Fa[u]||lf.test(u)!==l)break;c.unshift(new Rn(Fa[u])),this.consume()}var f=this.subparse(c);l?s={type:"ordgroup",mode:"math",body:f}:r={type:"ordgroup",mode:"math",body:f}}else break}return r&&s?{type:"supsub",mode:this.mode,base:n,sup:r,sub:s}:r?{type:"supsub",mode:this.mode,base:n,sup:r}:s?{type:"supsub",mode:this.mode,base:n,sub:s}:n}parseFunction(t,n){var r=this.fetch(),s=r.text,i=Jr[s];if(!i)return null;if(this.consume(),n&&n!=="atom"&&!i.allowedInArgument)throw new ae("Got function '"+s+"' with no arguments"+(n?" as "+n:""),r);if(this.mode==="text"&&!i.allowedInText)throw new ae("Can't use function '"+s+"' in text mode",r);if(this.mode==="math"&&i.allowedInMath===!1)throw new ae("Can't use function '"+s+"' in math mode",r);var{args:a,optArgs:o}=this.parseArguments(s,i);return this.callFunction(s,a,o,r,t)}callFunction(t,n,r,s,i){var a={funcName:t,parser:this,token:s,breakOnTokenText:i},o=Jr[t];if(o&&o.handler)return o.handler(a,n,r);throw new ae("No function handler for "+t)}parseArguments(t,n){var r,s=(r=n.numOptionalArgs)!=null?r:0,i=n.numArgs+s;if(i===0)return{args:[],optArgs:[]};for(var a=[],o=[],l=0;l<i;l++){var c,u=(c=n.argTypes)==null?void 0:c[l],f=l<s;("primitive"in n&&n.primitive&&u==null||n.type==="sqrt"&&l===1&&o[0]==null)&&(u="primitive");var m=this.parseGroupOfType("argument to '"+t+"'",u,f);if(f)o.push(m);else if(m!=null)a.push(m);else throw new ae("Null argument, please report this as a bug")}return{args:a,optArgs:o}}parseGroupOfType(t,n,r){switch(n){case"color":return this.parseColorGroup(r);case"size":return this.parseSizeGroup(r);case"url":return this.parseUrlGroup(r);case"math":case"text":return this.parseArgumentGroup(r,n);case"hbox":{var s=this.parseArgumentGroup(r,"text");return s!=null?{type:"styling",mode:s.mode,body:[s],style:"text",resetFont:!0}:null}case"raw":{var i=this.parseStringGroup(r);return i!=null?{type:"raw",mode:"text",string:i.text}:null}case"primitive":{if(r)throw new ae("A primitive argument cannot be optional");var a=this.parseGroup(t);if(a==null)throw new ae("Expected group as "+t,this.fetch());return a}case"original":case void 0:return this.parseArgumentGroup(r);default:throw new ae("Unknown group type as "+t,this.fetch())}}consumeSpaces(){for(;this.fetch().text===" ";)this.consume()}parseStringGroup(t){var n=this.gullet.scanArgument(t);if(n==null)return null;for(var r="",s;(s=this.fetch()).text!=="EOF";)r+=s.text,this.consume();return this.consume(),n.text=r,n}parseRegexGroup(t,n){for(var r=this.fetch(),s=r,i="",a;(a=this.fetch()).text!=="EOF"&&t.test(i+a.text);)s=a,i+=s.text,this.consume();if(i==="")throw new ae("Invalid "+n+": '"+r.text+"'",r);return r.range(s,i)}parseColorGroup(t){var n=this.parseStringGroup(t);if(n==null)return null;var r=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(n.text);if(!r)throw new ae("Invalid color: '"+n.text+"'",n);var s=r[0];return/^[0-9a-f]{6}$/i.test(s)&&(s="#"+s),{type:"color-token",mode:this.mode,color:s}}parseSizeGroup(t){var n,r=!1;if(this.gullet.consumeSpaces(),!t&&this.gullet.future().text!=="{"?n=this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size"):n=this.parseStringGroup(t),!n)return null;!t&&n.text.length===0&&(n.text="0pt",r=!0);var s=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(n.text);if(!s)throw new ae("Invalid size: '"+n.text+"'",n);var i={number:+(s[1]+s[2]),unit:s[3]};if(!hm(i))throw new ae("Invalid unit: '"+i.unit+"'",n);return{type:"size",mode:this.mode,value:i,isBlank:r}}parseUrlGroup(t){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var n=this.parseStringGroup(t);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),n==null)return null;var r=n.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:r}}parseArgumentGroup(t,n){var r=this.gullet.scanArgument(t);if(r==null)return null;var s=this.mode;n&&this.switchMode(n),this.gullet.beginGroup();var i=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var a={type:"ordgroup",mode:this.mode,loc:r.loc,body:i};return n&&this.switchMode(s),a}parseGroup(t,n){var r=this.fetch(),s=r.text,i;if(s==="{"||s==="\\begingroup"){this.consume();var a=s==="{"?"}":"\\endgroup";this.gullet.beginGroup();var o=this.parseExpression(!1,a),l=this.fetch();this.expect(a),this.gullet.endGroup(),i={type:"ordgroup",mode:this.mode,loc:wn.range(r,l),body:o,semisimple:s==="\\begingroup"||void 0}}else if(i=this.parseFunction(n,t)||this.parseSymbol(),i==null&&s[0]==="\\"&&!e1.hasOwnProperty(s)){if(this.settings.throwOnError)throw new ae("Undefined control sequence: "+s,r);i=this.formatUnsupportedCmd(s),this.consume()}return i}formLigatures(t){for(var n=t.length-1,r=0;r<n;++r){var s=t[r];if(s.type==="textord"){var i=s.text,a=t[r+1];if(!(!a||a.type!=="textord")){if(i==="-"&&a.text==="-"){var o=t[r+2];r+1<n&&o&&o.type==="textord"&&o.text==="-"?(t.splice(r,3,{type:"textord",mode:"text",loc:wn.range(s,o),text:"---"}),n-=2):(t.splice(r,2,{type:"textord",mode:"text",loc:wn.range(s,a),text:"--"}),n-=1)}(i==="'"||i==="`")&&a.text===i&&(t.splice(r,2,{type:"textord",mode:"text",loc:wn.range(s,a),text:i+i}),n-=1)}}}}parseSymbol(){var t=this.fetch(),n=t.text;if(/^\\verb[^a-zA-Z]/.test(n)){this.consume();var r=n.slice(5),s=r.charAt(0)==="*";if(s&&(r=r.slice(1)),r.length<2||r.charAt(0)!==r.slice(-1))throw new ae(`\\verb assertion failed --
|
|
318
|
-
please report what input caused this bug`);return r=r.slice(1,-1),{type:"verb",mode:"text",body:r,star:s}}
|
|
319
|
-
`:"")}function
|
|
320
|
-
`;const i=
|
|
321
|
-
`;const c=
|
|
322
|
-
`}function
|
|
323
|
-
`},t.code=({text:n,lang:r})=>
|
|
324
|
-
`).trim();return n?ut.parse(n,{async:!1,renderer:lw(t)}):""}const Hl=new WeakMap;async function uw(e){const t=e.target instanceof Element?e.target.closest(".markdown-code-copy"):void 0;if(!t)return!1;const n=t.closest(".markdown-code-block")?.querySelector("pre code")?.textContent;if(n===void 0||typeof navigator>"u"||!navigator.clipboard?.writeText)return!1;try{await navigator.clipboard.writeText(n)}catch{return!1}const r=t.dataset.copyLabel||t.textContent||"",s=t.dataset.copiedLabel||r;t.textContent=s,t.setAttribute("aria-label",s);const i=Hl.get(t);return i&&clearTimeout(i),Hl.set(t,setTimeout(()=>{t.isConnected&&(t.textContent=r,t.setAttribute("aria-label",r),Hl.delete(t))},1600)),!0}const dw="modulepreload",fw=function(e,t){return new URL(e,t).href},df={},hw=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){let c=function(u){return Promise.all(u.map(f=>Promise.resolve(f).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};const a=document.getElementsByTagName("link"),o=document.querySelector("meta[property=csp-nonce]"),l=o?.nonce||o?.getAttribute("nonce");s=c(n.map(u=>{if(u=fw(u,r),u in df)return;df[u]=!0;const f=u.endsWith(".css"),m=f?'[rel="stylesheet"]':"";if(r)for(let y=a.length-1;y>=0;y--){const b=a[y];if(b.href===u&&(!f||b.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${u}"]${m}`))return;const h=document.createElement("link");if(h.rel=f?"stylesheet":dw,f||(h.as="script"),h.crossOrigin="",h.href=u,l&&h.setAttribute("nonce",l),document.head.appendChild(h),f)return new Promise((y,b)=>{h.addEventListener("load",y),h.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${u}`)))})}))}function i(a){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=a,window.dispatchEvent(o),!o.defaultPrevented)throw a}return s.then(a=>{for(const o of a||[])o.status==="rejected"&&i(o.reason);return t().catch(i)})};let ff=0,hf=Promise.resolve();function pw(e,t){const n=hf.then(async()=>{const{default:r}=await hw(async()=>{const{default:s}=await import("./mermaid.core-CWTrOXge.js").then(i=>i.aJ);return{default:s}},[],import.meta.url);return r.initialize({flowchart:{htmlLabels:!1},securityLevel:"strict",startOnLoad:!1,suppressErrorRendering:!0,theme:t}),ff+=1,r.render(`markdown-mermaid-${ff}`,e)});return hf=n.then(()=>{},()=>{}),n}const mw=["innerHTML"],gw=Re({__name:"MarkdownContent",props:{codeTools:{},content:{},resolveImageSrc:{type:Function}},setup(e){const t=e,n=Oe(),r=we(()=>cw(t.content,{codeTools:t.codeTools,resolveImageSrc:t.resolveImageSrc})),s=new WeakMap;let i=0,a;async function o(f){const m=f.target instanceof Element?f.target.closest("a[href]"):void 0;if(m&&typeof window<"u"&&ow(m.getAttribute("href"),window.location.href)){f.preventDefault(),window.open(m.href,"_blank","noopener,noreferrer");return}await uw(f)}function l(){const f=document.documentElement.dataset.theme;return f==="dark"?"dark":f==="light"?"default":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"default"}function c(f,m,h){const y=document.createElement("pre"),b=document.createElement("code");if(b.textContent=m,y.append(b),f.replaceChildren(y),h){const S=document.createElement("small");S.className="markdown-mermaid-error",S.textContent=h,f.append(S)}}async function u(){i+=1;const f=i;await ur();const m=n.value;if(!m)return;const h=Array.from(m.querySelectorAll(".markdown-mermaid")),y=l();for(const b of h){const S=s.get(b)??b.querySelector("code")?.textContent??"";s.set(b,S),b.dataset.mermaidState="loading";try{const k=await pw(S,y);if(f!==i||!b.isConnected)return;b.innerHTML=k.svg,k.bindFunctions?.(b),b.dataset.mermaidState="rendered"}catch(k){if(f!==i||!b.isConnected)return;c(b,S,k instanceof Error?k.message:"Mermaid diagram could not be rendered."),b.dataset.mermaidState="error"}}}return pn(r,()=>{u()},{flush:"post"}),nc(()=>{u(),a=new MutationObserver(()=>{u()}),a.observe(document.documentElement,{attributeFilter:["class","data-theme"],attributes:!0})}),zo(()=>{i+=1,a?.disconnect()}),(f,m)=>(O(),j("div",{ref_key:"root",ref:n,class:"markdown-content",innerHTML:r.value,onClick:o},null,8,mw))}}),pa=(e,t)=>{const n=e.__vccOpts||e;for(const[r,s]of t)n[r]=s;return n},Vi=pa(gw,[["__scopeId","data-v-10978998"]]),vw={class:"ai-session-composer__toolbar"},bw={class:"ai-session-composer__actions"},yw=["data-action","disabled","title"],ww={key:0,class:"ai-session-composer__error"},Sw=Re({__name:"AiSessionComposer",props:{modelValue:{},busy:{type:Boolean},canInterrupt:{type:Boolean},error:{},placeholder:{}},emits:["update:modelValue","add-context","run","steer"],setup(e,{emit:t}){const n=e,r=t,s=we({get:()=>n.modelValue,set:m=>r("update:modelValue",String(m))}),i=we(()=>n.modelValue.trim().length>0),a=we(()=>i.value||!n.canInterrupt?"send":"stop"),o=we(()=>i.value||!n.busy&&n.canInterrupt),l=we(()=>n.busy&&i.value),c=we(()=>a.value==="stop"?"Stop current AI turn":"Send message");function u(){o.value&&r("run")}function f(m){m.key!=="Enter"||m.shiftKey||m.isComposing||(m.preventDefault(),i.value&&u())}return(m,h)=>(O(),j("form",{class:"ai-session-composer",onSubmit:en(u,["prevent"])},[T(g(or),{modelValue:s.value,"onUpdate:modelValue":h[0]||(h[0]=y=>s.value=y),class:"ai-session-composer__input",placeholder:e.placeholder||"Ask for follow-up changes",rows:"4",onKeydown:f},null,8,["modelValue","placeholder"]),x("div",vw,[x("button",{type:"button",class:"ai-session-composer__tool",title:"Add context",onClick:h[1]||(h[1]=y=>r("add-context"))},[T(g(vc),{size:18})]),x("div",bw,[l.value?(O(),j("button",{key:0,type:"button",class:"ai-session-composer__tool",title:"Steer current AI turn",onClick:h[2]||(h[2]=y=>r("steer"))},[T(g(vy),{size:18})])):pe("",!0),x("button",{type:"submit",class:"ai-session-composer__primary","data-action":a.value,disabled:!o.value,title:c.value},[a.value==="send"?(O(),Se(g(Jb),{key:0,size:18})):(O(),Se(g(By),{key:1,size:16}))],8,yw)])]),e.error?(O(),j("p",ww,Z(e.error),1)):pe("",!0)],32))}}),xw=pa(Sw,[["__scopeId","data-v-5417f399"]]);function kw(){const e=Oe({});function t(a){return a.turnCount??i1(a).length}function n(a){const o=t(a);if(!o)return 0;const l=e.value[a.id];return!l||l.index>=l.count-1&&o!==l.count?o-1:Math.min(Math.max(l.index,0),o-1)}function r(a,o){const l=t(a);l&&(e.value={...e.value,[a.id]:{index:(o+l)%l,count:l}})}function s(a){r(a,n(a)-1)}function i(a){r(a,n(a)+1)}return{nextPrompt:i,previousPrompt:s,promptCount:t,promptIndexFor:n}}function _w(){const e=Oe();function t(a,o){const l=e.value;e.value=l?.sessionId===a&&l.kind===o?void 0:{sessionId:a,kind:o}}function n(a){t(a,"prompt")}function r(a){t(a,"message")}function s(){e.value=void 0}function i(a){const o=a.target instanceof Element?a.target:void 0;!o||o.closest(".ai-session-expanded-preview")||o.closest("[data-ai-preview-trigger]")||(e.value=void 0)}return gv(document,"click",i,{capture:!0}),{collapseExpandedPreview:s,expandMessage:r,expandedPreview:e,expandPrompt:n}}function r1(e){if(!e)return"";const t=Math.max(0,Math.round((Date.now()-Date.parse(e))/1e3));if(t<60)return`${t}s ago`;const n=Math.round(t/60);return n<60?`${n}m ago`:`${Math.round(n/60)}h ago`}function Ew(e){return[...e].sort((t,n)=>pf(n)-pf(t)||mf(t).localeCompare(mf(n)))}function pf(e){return e.status==="waiting"?4:e.status==="failed"?3:e.status==="running"?2:e.status==="idle"?1:0}function mf(e){return[e.cwd||"",e.agent||"",e.providerSessionId||e.id].join("\0")}function s1(e){return e?e.status==="waiting"?e.phase==="approval"?"waiting for approval":"waiting":e.status==="running"?e.currentTool?.name?`running · ${e.currentTool.name}`:e.phase==="tool"?"running · tool":e.phase==="editing"?"running · editing":e.phase==="responding"?"running · responding":"running":e.status==="failed"?"failed":"idle":"idle"}function Fc(e,t){if(!e)return"No recent AI activity";const n=a1(e);if(n.length&&t!==void 0){const s=Math.min(Math.max(t,0),n.length-1),i=n[s];return i?.lastMessage?.trim()?i.lastMessage:i?.summary?.trim()?i.summary:Vl(e)}const r=n.at(-1);return r&&!r.lastMessage?.trim()&&!r.summary?.trim()?Vl(e):e.lastMessage?.trim()?e.lastMessage:e.summary?.trim()?e.summary:Vl(e)}function i1(e){return e?a1(e).map(t=>t.userPrompt?.trim()||"").filter(Boolean):[]}function Aw(e){return(e?.turns||[]).filter(t=>t.userPrompt?.trim()||t.lastMessage?.trim()||t.summary?.trim())}function a1(e){if(!e)return[];const t=Aw(e),n=e.userPrompt?.trim();if(!n)return t;const r=e.activeTurnId?t.find(i=>i.id===e.activeTurnId):void 0;if(r)return(e.status==="running"||e.status==="waiting")&&r.userPrompt?.trim()===n?[...t.filter(i=>i.id!==r.id),r]:t;const s=t.at(-1);if(s?.userPrompt?.trim()===n&&!s.lastMessage?.trim()&&!s.summary?.trim())return t;if(e.status==="running"||e.status==="waiting"){const i={id:e.activeTurnId||`${e.id}:active`,userPrompt:n,status:e.status==="waiting"?"waiting":"running",phase:e.phase,revision:0,updatedAt:e.updatedAt};return[...t,i]}return t}function Vl(e){return e.currentTool?.name?e.currentTool.inputPreview?`${e.currentTool.name}: ${e.currentTool.inputPreview}`:e.currentTool.name:e.status==="running"?"Running...":e.status==="waiting"?e.phase==="approval"?"Waiting for approval.":"Waiting...":"-"}function Uc(e,t){if(!e)return"No AI session selected";const n=i1(e);if(n.length){const r=t===void 0?n.length-1:Math.min(Math.max(t,0),n.length-1);return n[r]}return"-"}function Tw(e){const t=Iw(e.cwd),n=Rw(e.providerSessionId||e.id);return t&&n?`${t} · ${n}`:t||n||e.agent}function Iw(e){return e?e.split(/[\\/]/).filter(Boolean).at(-1)||e:""}function Rw(e){return e?e.length>12?e.slice(0,12):e:""}function Cw(e){return{active:e.filter(t=>t.status==="running").length,idle:e.filter(t=>t.status==="idle").length,waiting:e.filter(t=>t.status==="waiting").length}}function So(e){const t=e.agent==="claude"&&typeof e.providerMeta?.short=="string";return!!((e.activeTurnId||t)&&(e.status==="running"||e.status==="waiting"))}function o1(e){return e.status==="waiting"&&e.phase==="approval"}const Ow={class:"ai-session-detail-content"},Nw={class:"ai-session-detail-block ai-session-detail-block-user"},Mw={class:"ai-session-detail-block ai-session-detail-block-assistant"},zw={key:0,class:"ai-session-approval-actions"},$w=["disabled"],Dw=["disabled"],Pw=["disabled"],Bw={key:1,class:"ai-session-detail-block ai-session-queue"},Lw={class:"ai-session-queue-list"},Fw=["data-state"],Uw={key:0},qw=["disabled","onClick"],Hw=["disabled","onClick"],Vw=["disabled","onClick"],jw={key:2,class:"ai-session-tool"},Gw={key:0},Zw={class:"ai-session-meta"},Kw=Re({__name:"AiSessionDetail",props:{busy:{type:Boolean},error:{},hasAppSession:{type:Boolean},messageDraft:{},promptIndex:{},session:{},sessionTitle:{}},emits:["open-app-session","remove-queued","resolve-approval","retry-queued","run-action","steer-draft","steer-queued","update:messageDraft"],setup(e){return(t,n)=>(O(),Se(g(In),{class:"ai-session-detail","aria-label":"AI session detail"},{default:$(()=>[x("aside",Ow,[x("header",null,[x("div",null,[x("span",null,Z(e.sessionTitle),1),x("strong",null,Z(g(s1)(e.session)),1)]),x("small",null,Z(g(r1)(e.session.updatedAt)),1)]),x("section",Nw,[n[7]||(n[7]=x("span",null,"User Message",-1)),T(g(In),{class:"ai-session-detail-block-scroll"},{default:$(()=>[T(Vi,{content:g(Uc)(e.session,e.promptIndex)},null,8,["content"])]),_:1})]),x("section",Mw,[n[8]||(n[8]=x("span",null,"AI Response / Progress",-1)),T(g(In),{class:"ai-session-detail-block-scroll"},{default:$(()=>[T(Vi,{content:g(Fc)(e.session,e.promptIndex)},null,8,["content"])]),_:1})]),g(o1)(e.session)?(O(),j("div",zw,[x("button",{type:"button",disabled:e.busy,onClick:n[0]||(n[0]=r=>t.$emit("resolve-approval","allow"))},[T(g(Ep),{size:14}),n[9]||(n[9]=x("span",null,"Allow",-1))],8,$w),x("button",{type:"button",disabled:e.busy,onClick:n[1]||(n[1]=r=>t.$emit("resolve-approval","skip"))},[T(g(Xb),{size:14}),n[10]||(n[10]=x("span",null,"Skip",-1))],8,Dw),x("button",{type:"button",disabled:e.busy,onClick:n[2]||(n[2]=r=>t.$emit("resolve-approval","deny"))},[T(g(Os),{size:14}),n[11]||(n[11]=x("span",null,"Deny",-1))],8,Pw)])):pe("",!0),e.session.queue?.items.length?(O(),j("section",Bw,[x("span",null,"Queue · "+Z(e.session.queue.pendingCount),1),x("div",Lw,[(O(!0),j(lt,null,Ht(e.session.queue.items,r=>(O(),j("article",{key:r.id,class:"ai-session-queue-item","data-state":r.status},[x("p",null,Z(r.message),1),r.error?(O(),j("small",Uw,Z(r.error),1)):pe("",!0),x("div",null,[x("button",{type:"button",disabled:e.busy||!g(So)(e.session),onClick:s=>t.$emit("steer-queued",r.id)},"Steer",8,qw),r.status==="failed"?(O(),j("button",{key:0,type:"button",disabled:e.busy,onClick:s=>t.$emit("retry-queued",r.id)},"Retry",8,Hw)):pe("",!0),x("button",{type:"button",disabled:e.busy,onClick:s=>t.$emit("remove-queued",r.id)},"Remove",8,Vw)])],8,Fw))),128))])])):pe("",!0),T(xw,{"model-value":e.messageDraft,class:"ai-session-compose",busy:e.busy,"can-interrupt":g(So)(e.session),error:e.error,"onUpdate:modelValue":n[3]||(n[3]=r=>t.$emit("update:messageDraft",r)),onRun:n[4]||(n[4]=r=>t.$emit("run-action")),onSteer:n[5]||(n[5]=r=>t.$emit("steer-draft"))},null,8,["model-value","busy","can-interrupt","error"]),e.session.currentTool?.name?(O(),j("div",jw,[n[12]||(n[12]=x("span",null,"Current Tool",-1)),x("strong",null,Z(e.session.currentTool.name),1),e.session.currentTool.inputPreview?(O(),j("small",Gw,Z(e.session.currentTool.inputPreview),1)):pe("",!0)])):pe("",!0),x("dl",Zw,[x("div",null,[n[13]||(n[13]=x("dt",null,"Workspace",-1)),x("dd",null,Z(e.session.cwd||"Unknown"),1)]),x("div",null,[n[14]||(n[14]=x("dt",null,"Session",-1)),x("dd",null,Z(e.session.providerSessionId||e.session.id),1)]),x("div",null,[n[15]||(n[15]=x("dt",null,"App Binding",-1)),x("dd",null,Z(e.session.appSessionId||"Not bound"),1)])]),e.hasAppSession?(O(),j("button",{key:3,type:"button",class:"ai-session-detail-open",onClick:n[6]||(n[6]=r=>t.$emit("open-app-session",e.session))},[T(g(Tp),{size:14}),n[16]||(n[16]=x("span",null,"Open App Session",-1))])):pe("",!0)])]),_:1}))}}),Ww=pa(Kw,[["__scopeId","data-v-5ae5e9eb"]]),Qw=["data-state","data-selected","data-expanded"],Jw={class:"ai-session-status"},Yw={class:"ai-session-card-meta"},Xw={class:"ai-session-context"},e9={key:0,class:"ai-session-turn-nav"},t9=["aria-label"],n9=["aria-label"],r9={class:"ai-session-expanded-head"},s9={class:"ai-session-card-tools","aria-label":"AI session card controls"},i9=["aria-label"],a9=Re({__name:"AiSessionListRow",props:{expandedPreview:{},hasAppSession:{type:Boolean},promptCount:{},promptIndex:{},selected:{type:Boolean},session:{},sessionTitle:{}},emits:["collapse-expanded-preview","expand-message","expand-prompt","next-prompt","open-app-session","previous-prompt","select"],setup(e){const t=e;function n(){return t.expandedPreview?.kind==="prompt"?Uc(t.session,t.promptIndex):Fc(t.session,t.promptIndex)}return(r,s)=>(O(),j("article",{class:"ai-session-row","data-state":e.session.status,"data-selected":e.selected,"data-expanded":e.expandedPreview?.sessionId===e.session.id?e.expandedPreview.kind:void 0},[x("div",{class:"ai-session-select",role:"button",tabindex:"0",onClick:s[4]||(s[4]=i=>r.$emit("select",e.session.id)),onKeydown:[s[5]||(s[5]=Qs(en(i=>r.$emit("select",e.session.id),["prevent"]),["enter"])),s[6]||(s[6]=Qs(en(i=>r.$emit("select",e.session.id),["prevent"]),["space"]))]},[x("div",Jw,[s[9]||(s[9]=x("span",{class:"ai-session-dot"},null,-1)),x("strong",null,Z(e.sessionTitle),1),x("small",null,Z(g(s1)(e.session)),1)]),x("div",{class:"ai-session-preview-field ai-session-preview-field-user","data-ai-preview-trigger":"",onClick:s[0]||(s[0]=en(i=>r.$emit("expand-prompt",e.session.id),["stop"]))},[T(Vi,{class:"ai-session-question",content:g(Uc)(e.session,e.promptIndex)},null,8,["content"]),s[10]||(s[10]=x("small",null,"展开用户消息",-1))]),x("div",{class:"ai-session-preview-field ai-session-preview-field-assistant","data-ai-preview-trigger":"",onClick:s[1]||(s[1]=en(i=>r.$emit("expand-message",e.session.id),["stop"]))},[T(Vi,{class:"ai-session-message",content:g(Fc)(e.session,e.promptIndex)},null,8,["content"]),s[11]||(s[11]=x("small",null,"展开 AI 进展",-1))]),x("div",Yw,[x("small",Xw,Z(g(Tw)(e.session)),1),e.promptCount>1?(O(),j("span",e9,[x("button",{type:"button","aria-label":`Previous user message for ${e.session.agent}`,onClick:s[2]||(s[2]=en(i=>r.$emit("previous-prompt",e.session),["stop"]))},[T(g(iy),{size:13})],8,t9),x("small",null,Z(e.promptIndex+1)+" / "+Z(e.promptCount),1),x("button",{type:"button","aria-label":`Next user message for ${e.session.agent}`,onClick:s[3]||(s[3]=en(i=>r.$emit("next-prompt",e.session),["stop"]))},[T(g(oy),{size:13})],8,n9)])):pe("",!0)])],32),e.expandedPreview?.sessionId===e.session.id?(O(),j("div",{key:0,class:"ai-session-expanded-preview",onClick:s[7]||(s[7]=en(i=>r.$emit("collapse-expanded-preview"),["stop"]))},[x("div",r9,[x("strong",null,Z(e.expandedPreview.kind==="prompt"?"User Message":"AI Response / Progress"),1),s[12]||(s[12]=x("small",null,"滚动查看完整内容",-1))]),T(g(In),{class:"ai-session-expanded-content"},{default:$(()=>[T(Vi,{class:"ai-session-expanded-content-inner",content:n()},null,8,["content"])]),_:1})])):pe("",!0),x("div",s9,[e.hasAppSession?(O(),j("button",{key:0,type:"button",class:"ai-session-open","aria-label":`Open app session for ${e.session.agent}`,title:"Open app session",onClick:s[8]||(s[8]=i=>r.$emit("open-app-session",e.session))},[T(g(Tp),{size:14})],8,i9)):pe("",!0)])],8,Qw))}}),o9=pa(a9,[["__scopeId","data-v-1a5bafd9"]]),l9={class:"ai-sessions-panel","aria-label":"AI sessions"},c9={class:"ai-sessions-head"},u9={class:"ai-session-chips","aria-label":"AI session counts"},d9={"data-tone":"active"},f9={"data-tone":"idle"},h9={"data-tone":"waiting"},p9={key:0,class:"ai-sessions-empty"},m9={key:1,class:"ai-sessions-empty"},g9={key:2,class:"ai-session-workspace"},v9={class:"ai-session-list-content"},b9=Re({__name:"AiSessionsPanel",setup(e){const t=rp(),n=di(),r=fi(),s=we(()=>Ew(t.data.value?.sessions||[])),i=Oe(""),a=we(()=>s.value.find(se=>se.id===i.value)||s.value[0]),{nextPrompt:o,previousPrompt:l,promptCount:c,promptIndexFor:u}=kw(),{collapseExpandedPreview:f,expandMessage:m,expandedPreview:h,expandPrompt:y}=_w(),b=Oe(""),S=Oe(!1),k=Oe(""),P=we(()=>Cw(s.value)),z=we(()=>{const se=t.data.value?.updatedAt;return se?`updated ${r1(se)}`:""});pn(s,se=>{if(!se.length){i.value="";return}se.some(re=>re.id===i.value)||(i.value=se[0].id)},{immediate:!0}),pn(a,()=>{k.value=""});function I(se){f(),i.value=se}function E(se){const re=he(se);re&&r.open(da(re))}async function _(){const se=a.value;if(!(!se||S.value||!b.value.trim()&&!So(se))){if(b.value.trim()){await L();return}await X()}}async function L(){const se=a.value,re=b.value.trim();if(!(!se||!re||S.value)){S.value=!0,k.value="";try{await Yu(se.id,re),b.value=""}catch(ze){k.value=ze instanceof Error?ze.message:String(ze)}finally{S.value=!1}}}async function N(){const se=a.value,re=b.value.trim();if(!(!se||!re||S.value)){S.value=!0,k.value="";try{await Yu(se.id,re,"steer"),b.value="",await t.refetch()}catch(ze){k.value=ze instanceof Error?ze.message:String(ze)}finally{S.value=!1}}}async function G(se){const re=a.value;re&&await q(()=>D2(re.id,se))}async function D(se){const re=a.value;re&&await q(()=>P2(re.id,se))}async function W(se){const re=a.value;re&&await q(()=>B2(re.id,se))}async function q(se){if(!S.value){S.value=!0,k.value="";try{await se(),await t.refetch()}catch(re){k.value=re instanceof Error?re.message:String(re)}finally{S.value=!1}}}async function X(){const se=a.value;if(!(!se||!So(se)||S.value||b.value.trim())){S.value=!0,k.value="";try{await G2(se.id),await t.refetch()}catch(re){k.value=re instanceof Error?re.message:String(re)}finally{S.value=!1}}}async function ne(se){const re=a.value;if(!(!re||!o1(re)||S.value)){S.value=!0,k.value="";try{await L2(re.id,se),await t.refetch()}catch(ze){k.value=ze instanceof Error?ze.message:String(ze)}finally{S.value=!1}}}function he(se){const re=n.data.value||[];if(se.appSessionId){const ie=re.find(je=>je.id===se.appSessionId&&je.status==="running");if(ie)return ie}const ze=typeof se.providerMeta?.short=="string"?se.providerMeta.short:"";return ze?re.find(ie=>ie.status==="running"&&ie.ai?.claude?.short===ze):void 0}function Ae(se){return he(se)?.title||se.agent}return(se,re)=>(O(),j("section",l9,[x("header",c9,[x("div",null,[re[1]||(re[1]=x("span",null,"AI Sessions",-1)),x("span",u9,[x("strong",d9,Z(P.value.active)+" Active",1),x("strong",f9,Z(P.value.idle)+" Idle",1),x("strong",h9,Z(P.value.waiting)+" Waiting",1)])]),x("small",null,Z(z.value),1)]),g(t).isLoading.value?(O(),j("div",p9,"Loading sessions...")):s.value.length?(O(),j("div",g9,[T(g(In),{class:"ai-session-list",role:"listbox","aria-label":"AI session list"},{default:$(()=>[x("div",v9,[(O(!0),j(lt,null,Ht(s.value,ze=>(O(),Se(o9,{key:ze.id,"expanded-preview":g(h),"has-app-session":!!he(ze),"prompt-count":g(c)(ze),"prompt-index":g(u)(ze),selected:a.value?.id===ze.id,session:ze,"session-title":Ae(ze),onCollapseExpandedPreview:g(f),onExpandMessage:g(m),onExpandPrompt:g(y),onNextPrompt:g(o),onOpenAppSession:E,onPreviousPrompt:g(l),onSelect:I},null,8,["expanded-preview","has-app-session","prompt-count","prompt-index","selected","session","session-title","onCollapseExpandedPreview","onExpandMessage","onExpandPrompt","onNextPrompt","onPreviousPrompt"]))),128))])]),_:1}),a.value?(O(),Se(Ww,{key:0,"message-draft":b.value,"onUpdate:messageDraft":re[0]||(re[0]=ze=>b.value=ze),busy:S.value,error:k.value,"has-app-session":!!he(a.value),"prompt-index":g(u)(a.value),session:a.value,"session-title":Ae(a.value),onOpenAppSession:E,onRemoveQueued:W,onResolveApproval:ne,onRetryQueued:D,onRunAction:_,onSteerDraft:N,onSteerQueued:G},null,8,["message-draft","busy","error","has-app-session","prompt-index","session","session-title"])):pe("",!0)])):(O(),j("div",m9,"No AI sessions yet."))]))}}),y9=pa(b9,[["__scopeId","data-v-28f6ca67"]]),w9={class:"desktop-workspace"},S9={key:0,class:"desktop-tabs"},x9={class:"workspace-workbar"},k9={class:"workspace-tab-list"},_9=["draggable","onClick","onKeydown","onDragstart","onDrop"],E9=["aria-invalid","disabled","title","onKeydown","onBlur"],A9={key:1,class:"workspace-tab-title"},T9={class:"tab-kind"},I9=["onClick"],R9=["src","title"],C9={key:2,class:"gui-session"},O9=["src","title"],N9={key:1,class:"logs-empty"},M9={key:4,class:"logs-empty"},z9={key:2,class:"logs-empty"},$9={key:1,class:"desktop-empty"},D9=Re({__name:"WorkspaceTabs",setup(e){const t=ds(),n=$s(),r=fi(),s=di(),i=we(()=>r.tabs.find(q=>q.id===r.activeTabId)),a=we(()=>y0(i.value,s.data.value||[])),o=Oe(""),l=Oe(""),c=Oe(""),u=Oe(""),f=Oe(!1),m=Oe();function h(q){m.value=q instanceof HTMLInputElement?q:void 0}Pn(()=>{if(!s.data.value)return;const q=s.data.value||[];r.pruneSession(new Set(q.map(X=>X.id)),ti(q)),r.syncSessionTitles(q)});function y(q){return q.type==="app-vnc"||q.type==="app-web"||q.type==="app-tty"}function b(q){y(q)&&(r.setActive(q.id),l.value=q.id,c.value=q.title,u.value="",f.value=!1,ur(()=>m.value?.select()))}function S(){l.value="",c.value="",u.value="",f.value=!1}async function k(q){if(l.value!==q.id||!y(q)||f.value)return;const X=c.value.trim();if(!X){u.value="Session title is required.",ur(()=>m.value?.focus());return}if(X===q.title){S();return}f.value=!0;try{const ne=await W2(q.sessionId,X);r.syncSessionTitles([ne]),S()}catch(ne){f.value=!1,u.value=ne instanceof Error?ne.message:String(ne),ur(()=>m.value?.focus())}}function P(q){if(q.vnc?.backend==="kasmvnc"){const Ae=r.guiHidpi?E():1,se=new URLSearchParams({path:io(`/api/apps/sessions/${q.id}/web/websockify`),autoconnect:"1",resize:r.vncResizeMode,enable_hidpi:r.guiHidpi&&Ae>1?"1":"0",show_control_bar:"1"}),re=I(q,Ae);return r.vncResizeMode==="scale"&&re&&(se.set("forced_resolution_x",String(re.width)),se.set("forced_resolution_y",String(re.height))),n.token&&se.set("token",n.token),`${jn(q.vnc.webPath)}?${se.toString()}`}const X=n.token?`?token=${encodeURIComponent(n.token)}`:"",ne=q.vnc?.webPath?`${io(q.vnc.webPath)}${X}`:"",he=new URLSearchParams({path:ne,autoconnect:"1",resize:r.vncResizeMode});return jn(`/api/novnc/vnc.html?${he.toString()}`)}function z(q,X){if(X.vnc?.backend!=="kasmvnc")return;const ne=q.target;if(!(ne instanceof HTMLIFrameElement))return;ne.contentWindow?.postMessage({action:"resize",value:r.vncResizeMode},"*");const he=I(X,r.guiHidpi?E():1);r.vncResizeMode==="scale"&&he&&ne.contentWindow?.postMessage({action:"set_resolution",value_x:he.width,value_y:he.height},"*")}function I(q,X){if(!q.display)return;const ne=X>1?X:1;return{width:Math.max(1,Math.round(q.display.width/ne)),height:Math.max(1,Math.round(q.display.height/ne))}}function E(){return typeof window>"u"?1:window.devicePixelRatio||1}function _(q){const X=jn(q.web?.webPath||"");return n.token?`${X}${X.includes("?")?"&":"?"}token=${encodeURIComponent(n.token)}`:X}function L(q){return q.type==="ai-sessions"?"ai":q.type==="logs"?"logs":q.type==="shared-vnc"?"shared":q.type==="app-vnc"?"vnc":q.type==="app-web"?"web":"tty"}function N(q,X){o.value=X.id,q.dataTransfer?.setData("text/plain",X.id),q.dataTransfer&&(q.dataTransfer.effectAllowed="move")}function G(q,X){if(o.value){const he=(q.currentTarget instanceof HTMLElement?q.currentTarget:void 0)?.getBoundingClientRect(),Ae=he&&q.clientX>he.left+he.width/2?"after":"before";r.moveTab(o.value,X.id,Ae)}D()}function D(){o.value=""}async function W(q){if(q.type==="ai-sessions"){r.close(q.id);return}if(q.type==="app-vnc"||q.type==="app-web"||q.type==="app-tty"){await Cs(q.sessionId),r.close(q.id),await t.invalidateQueries({queryKey:["status"]});return}r.close(q.id)}return(q,X)=>(O(),j("section",w9,[g(r).tabs.length?(O(),j("div",S9,[x("div",x9,[T(g(In),{class:"workspace-tab-list-scroll"},{default:$(()=>[x("div",k9,[(O(!0),j(lt,null,Ht(g(r).tabs,ne=>(O(),Se(g(Ip),{key:ne.id},{default:$(()=>[T(g(Cp),{"as-child":""},{default:$(()=>[x("div",{class:At(["workspace-tab",{active:g(r).activeTabId===ne.id,dragging:o.value===ne.id,editing:l.value===ne.id}]),role:"button",tabindex:"0",draggable:l.value!==ne.id,onClick:he=>g(r).setActive(ne.id),onKeydown:[Qs(he=>g(r).setActive(ne.id),["enter"]),Qs(en(he=>g(r).setActive(ne.id),["prevent"]),["space"])],onDragstart:he=>N(he,ne),onDragover:X[2]||(X[2]=en(()=>{},["prevent"])),onDragenter:X[3]||(X[3]=en(()=>{},["prevent"])),onDrop:en(he=>G(he,ne),["prevent"]),onDragend:D},[l.value===ne.id?No((O(),j("input",{key:0,ref_for:!0,ref:h,"onUpdate:modelValue":X[0]||(X[0]=he=>c.value=he),class:"workspace-tab-title-input","aria-invalid":!!u.value,disabled:f.value,title:u.value,maxlength:"120",onClick:X[1]||(X[1]=en(()=>{},["stop"])),onKeydown:[Qs(en(he=>k(ne),["stop","prevent"]),["enter"]),Qs(en(S,["stop","prevent"]),["escape"])],onBlur:he=>k(ne)},null,40,E9)),[[Mo,c.value]]):(O(),j("span",A9,Z(ne.title),1)),x("span",T9,Z(L(ne)),1),x("span",{class:"tab-close",title:"Close tab","aria-label":"Close tab",onClick:en(he=>W(ne),["stop"])},[T(g(Os),{size:13,"stroke-width":2.2})],8,I9)],42,_9)]),_:2},1024),T(g(Rp),null,{default:$(()=>[T(g(Gs),{disabled:!y(ne),onSelect:he=>b(ne)},{default:$(()=>[...X[5]||(X[5]=[fe("Rename session",-1)])]),_:1},8,["disabled","onSelect"])]),_:2},1024)]),_:2},1024))),128))])]),_:1})]),x("div",{class:At(["workspace-tab-panel desktop-tab-panel",{"workspace-log-panel":i.value?.type==="logs","workspace-ai-panel":i.value?.type==="ai-sessions"}])},[i.value?.type==="ai-sessions"?(O(),Se(y9,{key:0})):a.value&&i.value?(O(),j(lt,{key:1},[i.value.type==="app-tty"&&a.value.status==="running"?(O(),Se(Lp,{key:0,session:a.value},null,8,["session"])):i.value.type==="app-web"&&a.value.status==="running"&&a.value.web?(O(),j("iframe",{key:1,class:"web-frame",src:_(a.value),title:a.value.title,allow:"clipboard-read; clipboard-write; fullscreen"},null,8,R9)):i.value.type==="app-vnc"||i.value.type==="shared-vnc"?(O(),j("div",C9,[a.value.vnc?(O(),j("iframe",{key:`${a.value.id}:${g(r).vncResizeMode}:${g(r).guiHidpi?"hidpi":"1x"}`,class:"vnc-frame workspace-vnc-frame",src:P(a.value),title:`${i.value.title} VNC`,allow:"clipboard-read; clipboard-write; fullscreen",onLoad:X[4]||(X[4]=ne=>z(ne,a.value))},null,40,O9)):(O(),j("p",N9,"VNC is unavailable for this session."))])):i.value.type==="logs"?(O(),Se(g(In),{key:3,class:"workspace-log-scroll"},{default:$(()=>[T(Bp,{session:a.value},null,8,["session"])]),_:1})):(O(),j("p",M9,"Runtime view is unavailable for this session state."))],64)):(O(),j("p",z9,"The selected workspace tab no longer has a running session."))],2)])):(O(),j("div",$9,[...X[6]||(X[6]=[x("h1",null,"TaskHandoff Desktop",-1),x("p",null,"Launch an app from the dock.",-1)])]))]))}});function qc(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,s])=>t.indexOf(+r)===-1).map(([r,s])=>s)}function gf(e,t="|"){return e.map(n=>f1(n)).join(t)}function Hc(e,t){return typeof t=="bigint"?t.toString():t}class P9{constructor(t){this._getter=t,this._value=void 0}get value(){const t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}}function Jo(e){return new P9(e)}function B9(e){return e==null}function Z0(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function L9(e,t){const n=e/t,r=Math.round(n),s=4*Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-r)<s?0:n-r}function Dr(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function K0(e){const t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function Or(e){return K0(e._zod.def)??e._zod.def.shape}function l1(e,t,n){Object.defineProperty(e,t,{get(){const r=n();return Dr(this,t,r),r},enumerable:!0,configurable:!0})}function c1(e,t,n){t in e?Dr(e,t,n):e[t]=n}function Ms(e,t,n,r){const s=Or(t);for(const i of n){const a=Object.getOwnPropertyDescriptor(s,i);a.enumerable&&(a.get?l1(e,i,()=>{const o=t._zod.def.shape[i];return r?r(o,i):o}):c1(e,i,r?r(a.value,i):a.value))}}function F9(e,t){for(const n of Reflect.ownKeys(t)){const r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?l1(e,n,()=>t[n]):c1(e,n,r.value))}}function Tn(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function U9(e){return JSON.stringify(e)}function q9(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const u1="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function sa(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const H9=Jo(()=>{if(Zn.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function ii(e){if(sa(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(sa(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function d1(e){return ii(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const V9=new Set(["string","number","symbol"]);function ai(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ps(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function Me(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function f1(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function j9(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}const h1={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},G9={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Z9(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const i={};return Ms(i,e,Yo(e,t)),ps(e,Tn(n,{shape:i,checks:[]}))}function Yo(e,t){const n=Or(e),r=[];for(const s of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,s)?.enumerable)throw new Error(`Unrecognized key: "${String(s)}"`);t[s]&&r.push(s)}return r}function K9(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const i=new Set(Yo(e,t)),a={};return Ms(a,e,Reflect.ownKeys(Or(e)).filter(o=>!i.has(o))),ps(e,Tn(n,{shape:a,checks:[]}))}function W9(e,t){if(!ii(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const s=Or(e);for(const i of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(s,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return ps(e,Tn(e._zod.def,{shape:p1(e,t)}))}function p1(e,t){const n={};return Ms(n,e,Reflect.ownKeys(Or(e))),F9(n,t),n}function Q9(e,t){if(!ii(t))throw new Error("Invalid input to safeExtend: expected a plain object");return ps(e,Tn(e._zod.def,{shape:p1(e,t)}))}function J9(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const n={};Ms(n,e,Reflect.ownKeys(Or(e))),Ms(n,t,Reflect.ownKeys(Or(t)));const r=Tn(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return ps(e,r)}function vf(e,t,n,r="partial"){const i=t._zod.def.checks;if(i&&i.length>0)throw new Error(`.${r}() cannot be used on object schemas containing refinements`);const o=n?new Set(Yo(t,n)):void 0,l={};return Ms(l,t,Reflect.ownKeys(Or(t)),e&&((c,u)=>o&&!o.has(u)?c:new e({type:"optional",innerType:c}))),ps(t,Tn(t._zod.def,{shape:l,checks:[]}))}function Y9(e,t,n){const r=n?new Set(Yo(t,n)):void 0,s={};return Ms(s,t,Reflect.ownKeys(Or(t)),(i,a)=>r&&!r.has(a)?i:new e({type:"nonoptional",innerType:i})),ps(t,Tn(t._zod.def,{shape:s}))}function Ar(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function X9(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Js(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function Ci(e){return typeof e=="string"?e:e?.message}function bf(e){const t=[];for(const n of e??[]){const r=n._zod.def;if(!/_(length|size)$|_equals$/.test(r.check))break;const s=r.maximum??r.length??r.size;s>=0&&t.push([s,n])}return t}function Vc(e,t,n){var r;for(let s=t;s<e.length;s++)(r=e[s]).schema??(r.schema=n)}function ls(e,t,n){var r;const s=e.inst?._zod?.traits;s?.has("$ZodType")&&(s.has("$ZodCheck")?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);const i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,a=e.message?e.message:Ci(e.inst?._zod.def?.error?.(e))??Ci(i?.(e))??Ci(t?.error?.(e))??Ci(n.customError?.(e))??Ci(n.localeError?.(e))??"Invalid input",o={};for(const l of Object.keys(e))l==="inst"||l==="schema"||l==="continue"||l==="input"||l==="__proto__"||(o[l]=e[l]);return o.path??(o.path=[]),o.message=a,t?.reportInput&&(o.input=e.input),o}const eS=/[\uD800-\uDBFF]/;function W0(e){const t=e.length;if(!eS.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)===55296&&(e.charCodeAt(r+1)&64512)===56320&&(n--,r++);return n}function Q0(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function tS(e){const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";const n=e;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return t}function ia(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}function nS(e,t){for(const n in t){const r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):rS(e,n,r.value)}}function cs(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function m1(e,t,n){return cs(e,t,n,!1)}function g1(e,t){for(const n in e){const r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return cs(this,n,r(this))},set(s){cs(this,n,s)}})}return t}function rS(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:cs(this,t,n.bind(this))},set(r){cs(this,t,r)}})}function sS(e,t){const n=Object.getPrototypeOf(e);return t in n?void 0:n}let jl,Kr=!1;const iS={configurable:!0,get(){Kr=!0}};function ft(e,t,n){const r=Object.getPrototypeOf(e._zod);if(t in r&&jl!==e._zod){jl=void 0;return}jl=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,iS);const s=Kr;Kr=!1;try{const i=n(this);return Kr?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:i}),Kr=Kr||s,i}catch(i){throw delete this[t],Kr=Kr||s,i}},set(s){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:s})}})}function aS(e,t,n,r){const s=sS(e,t);s&&Object.defineProperty(s,t,{configurable:!0,get(){const i={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,i),i.value=n(this),Object.defineProperty(this,t,i),i.value},set(i){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:i})}})}const oS="~constantCatch";function lS(e){const t=()=>e;return t[oS]=!0,t}var yf;const Gl={value:void 0,enumerable:!1};let wf="captureStackTrace"in Error?Error:null;function cS(e){const t=wf;if(t){const n=t.stackTraceLimit;if(typeof n=="number"){try{t.stackTraceLimit=0}catch{return wf=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function J(e,t,n,r){const s={};function i(m){this.def=m,this.constr=f,this.traits=new Set}i.prototype=s;const a=n,o=a&&new WeakSet;function l(m,h){if(m._zod){if(m._zod.traits.has(e))return}else{Gl.value=new i(h);try{Object.defineProperty(m,"_zod",Gl)}finally{Gl.value=void 0}}if(m._zod.traits.add(e),t(m,h),o){const b=Object.getPrototypeOf(m),S=m._zod.constr.prototype;let k=b;for(;k&&k!==S;)k=Object.getPrototypeOf(k);const P=k??b;o.has(P)||(o.add(P),nS(P,a))}const y=f.prototype;for(const b in y)Object.prototype.hasOwnProperty.call(y,b)&&(b in m||(m[b]=y[b].bind(m)))}const c=r?.Parent??Object;class u extends c{}Object.defineProperty(u,"name",{value:e});function f(m){const h=r?.Parent?cS(u):this;l(h,m);const y=h._zod.deferred;if(y){for(const S of y)S();h._zod.deferred=void 0}const b=globalThis.__zod_globalConfig?.postProcessor;return b&&b(h),h}return Object.defineProperty(f,"init",{value:l}),Object.defineProperty(f,Symbol.hasInstance,{value:m=>r?.Parent&&m instanceof r.Parent?!0:m?._zod?.traits?.has(e)}),Object.defineProperty(f,"name",{value:e}),f}class Rs extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class v1 extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(yf=globalThis).__zod_globalConfig??(yf.__zod_globalConfig={});const Zn=globalThis.__zod_globalConfig;function dr(e){return e&&Object.assign(Zn,e),Zn}function uS(){const e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Hc,2)),e.message}function dS(e){this._zod.message=e}const fS={get:uS,set:dS,enumerable:!0,configurable:!0},Zl={value:void 0,enumerable:!1},Sf=new WeakSet([Object.prototype,Error.prototype]),hS=(e,t)=>{e.name="$ZodError",Zl.value=t,Object.defineProperty(e,"issues",Zl),Zl.value=void 0,Object.defineProperty(e,"message",fS);const n=Object.getPrototypeOf(e);Sf.has(n)||(Sf.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){const r=()=>this.message;return Object.defineProperty(this,"toString",{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,"toString",{value:r,configurable:!0,writable:!0})}}))},pS=J("$ZodError",hS);function mS(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function gS(e,t=n=>n.message){const n={},r=[];for(const s of e.issues)s.path.length>0?mS(n,s.path[0],()=>[]).push(t(s)):r.push(t(s));return{formErrors:r,fieldErrors:n}}function vS(e,t=n=>n.message){const n={_errors:[]},r=(s,i=[])=>{for(const a of s.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(o=>r({issues:o},[...i,...a.path]));else if(a.code==="invalid_key")r({issues:a.issues},[...i,...a.path]);else if(a.code==="invalid_element")r({issues:a.issues},[...i,...a.path]);else{const o=[...i,...a.path];if(o.length===0)n._errors.push(t(a));else{let l=n,c=0;for(;c<o.length;){const u=o[c],f=c===o.length-1;if(u==="_errors"){f&&l._errors.push(t(a)),c++;continue}Object.prototype.hasOwnProperty.call(l,u)||Object.defineProperty(l,u,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});const m=l[u];f&&m._errors.push(t(a)),l=m,c++}}}};return r(e),n}function Xo(e,t){return{callee:t?.callee??e,Err:t?.Err}}const J0=e=>{const t=(n,r,s,i)=>{const a=s?{...s,async:!1}:{async:!1},o=n._zod.run({value:r,issues:[]},a);if(o instanceof Promise)throw new Rs;if(o.issues.length){const l=new(i?.Err??e)(o.issues.map(c=>ls(c,a,dr())));throw u1(l,i?.callee??t),l}return o.value};return t},Y0=e=>{const t=async(n,r,s,i)=>{const a=s?{...s,async:!0}:{async:!0};let o=n._zod.run({value:r,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){const l=new(i?.Err??e)(o.issues.map(c=>ls(c,a,dr())));throw u1(l,i?.callee??t),l}return o.value};return t},X0=e=>(t,n,r)=>{const s=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise)throw new Rs;return i.issues.length?b1(e,i.issues,s):{success:!0,data:i.value}};function b1(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(s=>ls(s,n,dr()))),t=void 0,n=void 0),r},set error(s){r=s,t=void 0,n=void 0}}}const eu=e=>async(t,n,r)=>{const s=r?{...r,async:!0}:{async:!0};let i=t._zod.run({value:n,issues:[]},s);return i instanceof Promise&&(i=await i),i.issues.length?b1(e,i.issues,s):{success:!0,data:i.value}},bS=Symbol.for("zod.compile.invalid"),yS=Symbol.for("zod.compile.fallback"),wS=((e,t,n)=>{const r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==bS)return!0;if(r.definite===!0&&n===void 0)return!1}return SS(e,t,n)});function SS(e,t,n){const r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},s=e._zod.bag.fallbackRun;let i;if(s?(r[yS]=!0,i=s({value:t,issues:[]},r)):i=e._zod.run({value:t,issues:[]},r),i instanceof Promise)throw new Rs;return i.issues.length===0}const xS=async(e,t,n)=>{const r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0};let s=e._zod.run({value:t,issues:[]},r);return s instanceof Promise&&(s=await s),s.issues.length===0},kS=e=>{const t=J0(e),n=(r,s,i,a)=>{const o=i?{...i,direction:"backward"}:{direction:"backward"};return t(r,s,o,Xo(n,a))};return n},_S=e=>{const t=J0(e),n=(r,s,i,a)=>t(r,s,i,Xo(n,a));return n},ES=e=>{const t=Y0(e),n=async(r,s,i,a)=>{const o=i?{...i,direction:"backward"}:{direction:"backward"};return await t(r,s,o,Xo(n,a))};return n},AS=e=>{const t=Y0(e),n=async(r,s,i,a)=>await t(r,s,i,Xo(n,a));return n},TS=e=>(t,n,r)=>{const s=r?{...r,direction:"backward"}:{direction:"backward"};return X0(e)(t,n,s)},IS=e=>(t,n,r)=>X0(e)(t,n,r),RS=e=>async(t,n,r)=>{const s=r?{...r,direction:"backward"}:{direction:"backward"};return eu(e)(t,n,s)},CS=e=>async(t,n,r)=>eu(e)(t,n,r),OS=/^[cC][0-9a-z]{6,}$/,NS=/^[0-9a-z]+$/,MS=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,zS=/^[0-9a-vA-V]{20}$/,$S=/^[A-Za-z0-9]{27}$/,DS=/^[a-zA-Z0-9_-]{21}$/;function PS(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}const BS=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,LS=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,xf=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,FS=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,US="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function qS(){return new RegExp(US,"u")}const HS=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,VS=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,jS=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,GS=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ZS=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,KS=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,WS=/^https?$/,QS=/^\+[1-9]\d{6,14}$/,y1="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";function JS(e){return new RegExp(`^${e}$`)}const YS=JS(y1);function jc(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function XS(e){return new RegExp(`^${jc(e)}$`)}function ex(e){const t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${jc({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,r=e.local?`${n}|${jc({precision:e.precision})}`:n;return new RegExp(`^${y1}T(?:${r})$`)}const tx=/^[\s\S]{0,}$/,nx=/^-?\d+$/,tu=/^-?\d+(?:\.\d+)?$/,rx=/^(?:true|false)$/i,sx=/^[^A-Z]*$/,ix=/^[^a-z]*$/,Sn=J("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),nu=e=>{const t=e.value;return!B9(t)&&t.length!==void 0},xo={number:"number",bigint:"bigint",object:"date"},w1=J("$ZodCheckLessThan",(e,t)=>{Sn.init(e,t);const n=xo[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:xo[typeof r.value]??n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),S1=J("$ZodCheckGreaterThan",(e,t)=>{Sn.init(e,t);const n=xo[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:xo[typeof r.value]??n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ax=J("$ZodCheckMultipleOf",(e,t)=>{Sn.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):L9(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),ox=J("$ZodCheckNumberFormat",(e,t)=>{Sn.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[s,i]=h1[t.format];e._zod.check=a=>{const o=a.value;if(n){if(!Number.isInteger(o)){a.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:o,inst:e});return}if(!Number.isSafeInteger(o)){o>0?a.issues.push({input:o,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):a.issues.push({input:o,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}o<s&&a.issues.push({origin:"number",input:o,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),o>i&&a.issues.push({origin:"number",input:o,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),lx=J("$ZodCheckMaxLength",(e,t)=>{var n;Sn.init(e,t),(n=e._zod.def).when??(n.when=nu),e._zod.check=r=>{const s=r.value,i=s.length;if((typeof s=="string"&&i>t.maximum?W0(s):i)<=t.maximum)return;const o=Q0(s);r.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),cx=J("$ZodCheckMinLength",(e,t)=>{var n;Sn.init(e,t),(n=e._zod.def).when??(n.when=nu),e._zod.check=r=>{const s=r.value,i=s.length;if((typeof s=="string"&&i>=t.minimum&&i<t.minimum*2?W0(s):i)>=t.minimum)return;const o=Q0(s);r.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),ux=J("$ZodCheckLengthEquals",(e,t)=>{var n;Sn.init(e,t),(n=e._zod.def).when??(n.when=nu),e._zod.check=r=>{const s=r.value,i=s.length,a=typeof s=="string"&&i>=t.length&&i<=t.length*2?W0(s):i;if(a===t.length)return;const o=Q0(s),l=a>t.length;r.issues.push({origin:o,...l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),el=J("$ZodCheckStringFormat",(e,t)=>{var n,r;Sn.init(e,t),t.pattern?(n=e._zod).check??(n.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:t.format,input:s.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),dx=J("$ZodCheckRegex",(e,t)=>{el.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),fx=J("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=sx),el.init(e,t)}),hx=J("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=ix),el.init(e,t)}),px=J("$ZodCheckIncludes",(e,t)=>{Sn.init(e,t);const n=ai(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position},}${n}`:n);t.pattern=r,e._zod.check=s=>{s.value.includes(t.includes,t.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:s.value,inst:e,continue:!t.abort})}}),mx=J("$ZodCheckStartsWith",(e,t)=>{Sn.init(e,t);const n=new RegExp(`^${ai(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),gx=J("$ZodCheckEndsWith",(e,t)=>{Sn.init(e,t);const n=new RegExp(`.*${ai(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),vx=J("$ZodCheckOverwrite",(e,t)=>{Sn.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class bx{constructor(t=[],n={}){this.content=[],this.indent=0,this.args=t,this.closed=n}indented(t){this.indent+=1;try{t(this)}finally{this.indent-=1}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
|
|
316
|
+
?)[ \r ]*`,Lc="[̀-ͯ]",K8=new RegExp(Lc+"+$"),W8="("+Xm+"+)|"+(Z8+"|")+"([!-\\[\\]-‧-豈-]"+(Lc+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(Lc+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+G8)+("|"+j8+")");class af{constructor(t,n){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=t,this.settings=n,this.tokenRegex=new RegExp(W8,"g"),this.catcodes={"%":14,"~":13}}setCatcode(t,n){this.catcodes[t]=n}lex(){var t=this.input,n=this.tokenRegex.lastIndex;if(n===t.length)return new Cn("EOF",new wn(this,n,n));var r=this.tokenRegex.exec(t);if(r===null||r.index!==n)throw new ae("Unexpected character: '"+t[n]+"'",new Cn(t[n],new wn(this,n,n+1)));var s=r[6]||r[3]||(r[2]?"\\ ":" ");if(this.catcodes[s]===14){var i=t.indexOf(`
|
|
317
|
+
`,this.tokenRegex.lastIndex);return i===-1?(this.tokenRegex.lastIndex=t.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 Cn(s,new wn(this,n,this.tokenRegex.lastIndex))}}class Q8{constructor(t,n){t===void 0&&(t={}),n===void 0&&(n={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=n,this.builtins=t,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new ae("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var t=this.undefStack.pop();for(var n in t)t.hasOwnProperty(n)&&(t[n]==null?delete this.current[n]:this.current[n]=t[n])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(t){return this.current.hasOwnProperty(t)||this.builtins.hasOwnProperty(t)}get(t){return this.current.hasOwnProperty(t)?this.current[t]:this.builtins[t]}set(t,n,r){if(r===void 0&&(r=!1),r){for(var s=0;s<this.undefStack.length;s++)delete this.undefStack[s][t];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][t]=n)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(t)&&(i[t]=this.current[t])}n==null?delete this.current[t]:this.current[t]=n}}var J8=Hm;w("\\noexpand",function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}});w("\\expandafter",function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}});w("\\@firstoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[0],numArgs:0}});w("\\@secondoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[1],numArgs:0}});w("\\@ifnextchar",function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return t[0].length===1&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}});w("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");w("\\TextOrMath",function(e){var t=e.consumeArgs(2);return e.mode==="text"?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var of={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};w("\\char",function(e){var t=e.popToken(),n,r=0;if(t.text==="'")n=8,t=e.popToken();else if(t.text==='"')n=16,t=e.popToken();else if(t.text==="`")if(t=e.popToken(),t.text[0]==="\\")r=t.text.charCodeAt(1);else{if(t.text==="EOF")throw new ae("\\char` missing argument");r=t.text.charCodeAt(0)}else n=10;if(n){if(r=of[t.text],r==null||r>=n)throw new ae("Invalid base-"+n+" digit "+t.text);for(var s;(s=of[e.future().text])!=null&&s<n;)r*=n,r+=s,e.popToken()}return"\\@char{"+r+"}"});var H0=(e,t,n,r)=>{var s=e.consumeArg().tokens;if(s.length!==1)throw new ae("\\newcommand's first argument must be a macro name");var i=s[0].text,a=e.isDefined(i);if(a&&!t)throw new ae("\\newcommand{"+i+"} attempting to redefine "+(i+"; use \\renewcommand"));if(!a&&!n)throw new ae("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");var o=0;if(s=e.consumeArg().tokens,s.length===1&&s[0].text==="["){for(var l="",c=e.expandNextToken();c.text!=="]"&&c.text!=="EOF";)l+=c.text,c=e.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new ae("Invalid number of arguments: "+l);o=parseInt(l),s=e.consumeArg().tokens}return a&&r||e.macros.set(i,{tokens:s,numArgs:o}),""};w("\\newcommand",e=>H0(e,!1,!0,!1));w("\\renewcommand",e=>H0(e,!0,!1,!1));w("\\providecommand",e=>H0(e,!0,!0,!0));w("\\message",e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(n=>n.text).join("")),""});w("\\errmessage",e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(n=>n.text).join("")),""});w("\\show",e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),Yr[n],Rt.math[n],Rt.text[n]),""});w("\\bgroup","{");w("\\egroup","}");w("~","\\nobreakspace");w("\\lq","`");w("\\rq","'");w("\\aa","\\r a");w("\\AA","\\r A");w("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");w("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");w("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");w("ℬ","\\mathscr{B}");w("ℰ","\\mathscr{E}");w("ℱ","\\mathscr{F}");w("ℋ","\\mathscr{H}");w("ℐ","\\mathscr{I}");w("ℒ","\\mathscr{L}");w("ℳ","\\mathscr{M}");w("ℛ","\\mathscr{R}");w("ℭ","\\mathfrak{C}");w("ℌ","\\mathfrak{H}");w("ℨ","\\mathfrak{Z}");w("\\Bbbk","\\Bbb{k}");w("\\llap","\\mathllap{\\textrm{#1}}");w("\\rlap","\\mathrlap{\\textrm{#1}}");w("\\clap","\\mathclap{\\textrm{#1}}");w("\\mathstrut","\\vphantom{(}");w("\\underbar","\\underline{\\text{#1}}");w("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');w("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");w("\\ne","\\neq");w("≠","\\neq");w("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");w("∉","\\notin");w("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");w("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");w("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");w("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");w("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");w("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");w("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");w("⟂","\\perp");w("‼","\\mathclose{!\\mkern-0.8mu!}");w("∌","\\notni");w("⌜","\\ulcorner");w("⌝","\\urcorner");w("⌞","\\llcorner");w("⌟","\\lrcorner");w("©","\\copyright");w("®","\\textregistered");w("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');w("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');w("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');w("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');w("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");w("⋮","\\vdots");w("\\varGamma","\\mathit{\\Gamma}");w("\\varDelta","\\mathit{\\Delta}");w("\\varTheta","\\mathit{\\Theta}");w("\\varLambda","\\mathit{\\Lambda}");w("\\varXi","\\mathit{\\Xi}");w("\\varPi","\\mathit{\\Pi}");w("\\varSigma","\\mathit{\\Sigma}");w("\\varUpsilon","\\mathit{\\Upsilon}");w("\\varPhi","\\mathit{\\Phi}");w("\\varPsi","\\mathit{\\Psi}");w("\\varOmega","\\mathit{\\Omega}");w("\\substack","\\begin{subarray}{c}#1\\end{subarray}");w("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");w("\\boxed","\\fbox{$\\displaystyle{#1}$}");w("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");w("\\implies","\\DOTSB\\;\\Longrightarrow\\;");w("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");w("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");w("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var lf={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"},Y8=new Set(["bin","rel"]);w("\\dots",function(e){var t="\\dotso",n=e.expandAfterFuture().text;return n in lf?t=lf[n]:(n.slice(0,4)==="\\not"||n in Rt.math&&Y8.has(Rt.math[n].group))&&(t="\\dotsb"),t});var V0={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};w("\\dotso",function(e){var t=e.future().text;return t in V0?"\\ldots\\,":"\\ldots"});w("\\dotsc",function(e){var t=e.future().text;return t in V0&&t!==","?"\\ldots\\,":"\\ldots"});w("\\cdots",function(e){var t=e.future().text;return t in V0?"\\@cdots\\,":"\\@cdots"});w("\\dotsb","\\cdots");w("\\dotsm","\\cdots");w("\\dotsi","\\!\\cdots");w("\\dotsx","\\ldots\\,");w("\\DOTSI","\\relax");w("\\DOTSB","\\relax");w("\\DOTSX","\\relax");w("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");w("\\,","\\tmspace+{3mu}{.1667em}");w("\\thinspace","\\,");w("\\>","\\mskip{4mu}");w("\\:","\\tmspace+{4mu}{.2222em}");w("\\medspace","\\:");w("\\;","\\tmspace+{5mu}{.2777em}");w("\\thickspace","\\;");w("\\!","\\tmspace-{3mu}{.1667em}");w("\\negthinspace","\\!");w("\\negmedspace","\\tmspace-{4mu}{.2222em}");w("\\negthickspace","\\tmspace-{5mu}{.277em}");w("\\enspace","\\kern.5em ");w("\\enskip","\\hskip.5em\\relax");w("\\quad","\\hskip1em\\relax");w("\\qquad","\\hskip2em\\relax");w("\\tag","\\@ifstar\\tag@literal\\tag@paren");w("\\tag@paren","\\tag@literal{({#1})}");w("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new ae("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});w("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");w("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");w("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");w("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");w("\\newline","\\\\\\relax");w("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var e1=ue(cr["Main-Regular"][84][1]-.7*cr["Main-Regular"][65][1]);w("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+e1+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");w("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+e1+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");w("\\hspace","\\@ifstar\\@hspacer\\@hspace");w("\\@hspace","\\hskip #1\\relax");w("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");w("\\ordinarycolon",":");w("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");w("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');w("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');w("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');w("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');w("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');w("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');w("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');w("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');w("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');w("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');w("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');w("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');w("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');w("∷","\\dblcolon");w("∹","\\eqcolon");w("≔","\\coloneqq");w("≕","\\eqqcolon");w("⩴","\\Coloneqq");w("\\ratio","\\vcentcolon");w("\\coloncolon","\\dblcolon");w("\\colonequals","\\coloneqq");w("\\coloncolonequals","\\Coloneqq");w("\\equalscolon","\\eqqcolon");w("\\equalscoloncolon","\\Eqqcolon");w("\\colonminus","\\coloneq");w("\\coloncolonminus","\\Coloneq");w("\\minuscolon","\\eqcolon");w("\\minuscoloncolon","\\Eqcolon");w("\\coloncolonapprox","\\Colonapprox");w("\\coloncolonsim","\\Colonsim");w("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");w("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");w("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");w("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");w("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");w("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");w("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");w("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");w("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");w("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");w("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");w("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");w("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");w("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");w("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");w("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");w("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");w("\\nleqq","\\html@mathml{\\@nleqq}{≰}");w("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");w("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");w("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");w("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");w("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");w("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");w("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");w("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");w("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");w("\\imath","\\html@mathml{\\@imath}{ı}");w("\\jmath","\\html@mathml{\\@jmath}{ȷ}");w("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");w("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");w("⟦","\\llbracket");w("⟧","\\rrbracket");w("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");w("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");w("⦃","\\lBrace");w("⦄","\\rBrace");w("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");w("⦵","\\minuso");w("\\darr","\\downarrow");w("\\dArr","\\Downarrow");w("\\Darr","\\Downarrow");w("\\lang","\\langle");w("\\rang","\\rangle");w("\\uarr","\\uparrow");w("\\uArr","\\Uparrow");w("\\Uarr","\\Uparrow");w("\\N","\\mathbb{N}");w("\\R","\\mathbb{R}");w("\\Z","\\mathbb{Z}");w("\\alef","\\aleph");w("\\alefsym","\\aleph");w("\\Alpha","\\mathrm{A}");w("\\Beta","\\mathrm{B}");w("\\bull","\\bullet");w("\\Chi","\\mathrm{X}");w("\\clubs","\\clubsuit");w("\\cnums","\\mathbb{C}");w("\\Complex","\\mathbb{C}");w("\\Dagger","\\ddagger");w("\\diamonds","\\diamondsuit");w("\\empty","\\emptyset");w("\\Epsilon","\\mathrm{E}");w("\\Eta","\\mathrm{H}");w("\\exist","\\exists");w("\\harr","\\leftrightarrow");w("\\hArr","\\Leftrightarrow");w("\\Harr","\\Leftrightarrow");w("\\hearts","\\heartsuit");w("\\image","\\Im");w("\\infin","\\infty");w("\\Iota","\\mathrm{I}");w("\\isin","\\in");w("\\Kappa","\\mathrm{K}");w("\\larr","\\leftarrow");w("\\lArr","\\Leftarrow");w("\\Larr","\\Leftarrow");w("\\lrarr","\\leftrightarrow");w("\\lrArr","\\Leftrightarrow");w("\\Lrarr","\\Leftrightarrow");w("\\Mu","\\mathrm{M}");w("\\natnums","\\mathbb{N}");w("\\Nu","\\mathrm{N}");w("\\Omicron","\\mathrm{O}");w("\\plusmn","\\pm");w("\\rarr","\\rightarrow");w("\\rArr","\\Rightarrow");w("\\Rarr","\\Rightarrow");w("\\real","\\Re");w("\\reals","\\mathbb{R}");w("\\Reals","\\mathbb{R}");w("\\Rho","\\mathrm{P}");w("\\sdot","\\cdot");w("\\sect","\\S");w("\\spades","\\spadesuit");w("\\sub","\\subset");w("\\sube","\\subseteq");w("\\supe","\\supseteq");w("\\Tau","\\mathrm{T}");w("\\thetasym","\\vartheta");w("\\weierp","\\wp");w("\\Zeta","\\mathrm{Z}");w("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");w("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");w("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");w("\\bra","\\mathinner{\\langle{#1}|}");w("\\ket","\\mathinner{|{#1}\\rangle}");w("\\braket","\\mathinner{\\langle{#1}\\rangle}");w("\\Bra","\\left\\langle#1\\right|");w("\\Ket","\\left|#1\\right\\rangle");var t1=e=>t=>{var n=t.consumeArg().tokens,r=t.consumeArg().tokens,s=t.consumeArg().tokens,i=t.consumeArg().tokens,a=t.macros.get("|"),o=t.macros.get("\\|");t.macros.beginGroup();var l=p=>m=>{e&&(m.macros.set("|",a),s.length&&m.macros.set("\\|",o));var f=p;if(!p&&s.length){var y=m.future();y.text==="|"&&(m.popToken(),f=!0)}return{tokens:f?s:r,numArgs:0}};t.macros.set("|",l(!1)),s.length&&t.macros.set("\\|",l(!0));var c=t.consumeArg().tokens,u=t.expandTokens([...i,...c,...n]);return t.macros.endGroup(),{tokens:u.reverse(),numArgs:0}};w("\\bra@ket",t1(!1));w("\\bra@set",t1(!0));w("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");w("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");w("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");w("\\angln","{\\angl n}");w("\\blue","\\textcolor{##6495ed}{#1}");w("\\orange","\\textcolor{##ffa500}{#1}");w("\\pink","\\textcolor{##ff00af}{#1}");w("\\red","\\textcolor{##df0030}{#1}");w("\\green","\\textcolor{##28ae7b}{#1}");w("\\gray","\\textcolor{gray}{#1}");w("\\purple","\\textcolor{##9d38bd}{#1}");w("\\blueA","\\textcolor{##ccfaff}{#1}");w("\\blueB","\\textcolor{##80f6ff}{#1}");w("\\blueC","\\textcolor{##63d9ea}{#1}");w("\\blueD","\\textcolor{##11accd}{#1}");w("\\blueE","\\textcolor{##0c7f99}{#1}");w("\\tealA","\\textcolor{##94fff5}{#1}");w("\\tealB","\\textcolor{##26edd5}{#1}");w("\\tealC","\\textcolor{##01d1c1}{#1}");w("\\tealD","\\textcolor{##01a995}{#1}");w("\\tealE","\\textcolor{##208170}{#1}");w("\\greenA","\\textcolor{##b6ffb0}{#1}");w("\\greenB","\\textcolor{##8af281}{#1}");w("\\greenC","\\textcolor{##74cf70}{#1}");w("\\greenD","\\textcolor{##1fab54}{#1}");w("\\greenE","\\textcolor{##0d923f}{#1}");w("\\goldA","\\textcolor{##ffd0a9}{#1}");w("\\goldB","\\textcolor{##ffbb71}{#1}");w("\\goldC","\\textcolor{##ff9c39}{#1}");w("\\goldD","\\textcolor{##e07d10}{#1}");w("\\goldE","\\textcolor{##a75a05}{#1}");w("\\redA","\\textcolor{##fca9a9}{#1}");w("\\redB","\\textcolor{##ff8482}{#1}");w("\\redC","\\textcolor{##f9685d}{#1}");w("\\redD","\\textcolor{##e84d39}{#1}");w("\\redE","\\textcolor{##bc2612}{#1}");w("\\maroonA","\\textcolor{##ffbde0}{#1}");w("\\maroonB","\\textcolor{##ff92c6}{#1}");w("\\maroonC","\\textcolor{##ed5fa6}{#1}");w("\\maroonD","\\textcolor{##ca337c}{#1}");w("\\maroonE","\\textcolor{##9e034e}{#1}");w("\\purpleA","\\textcolor{##ddd7ff}{#1}");w("\\purpleB","\\textcolor{##c6b9fc}{#1}");w("\\purpleC","\\textcolor{##aa87ff}{#1}");w("\\purpleD","\\textcolor{##7854ab}{#1}");w("\\purpleE","\\textcolor{##543b78}{#1}");w("\\mintA","\\textcolor{##f5f9e8}{#1}");w("\\mintB","\\textcolor{##edf2df}{#1}");w("\\mintC","\\textcolor{##e0e5cc}{#1}");w("\\grayA","\\textcolor{##f6f7f7}{#1}");w("\\grayB","\\textcolor{##f0f1f2}{#1}");w("\\grayC","\\textcolor{##e3e5e6}{#1}");w("\\grayD","\\textcolor{##d6d8da}{#1}");w("\\grayE","\\textcolor{##babec2}{#1}");w("\\grayF","\\textcolor{##888d93}{#1}");w("\\grayG","\\textcolor{##626569}{#1}");w("\\grayH","\\textcolor{##3b3e40}{#1}");w("\\grayI","\\textcolor{##21242c}{#1}");w("\\kaBlue","\\textcolor{##314453}{#1}");w("\\kaGreen","\\textcolor{##71B307}{#1}");var n1={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class X8{constructor(t,n,r){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=n,this.expansionCount=0,this.feed(t),this.macros=new Q8(J8,n.macros),this.mode=r,this.stack=[]}feed(t){this.lexer=new af(t,this.settings)}switchMode(t){this.mode=t}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(t){this.stack.push(t)}pushTokens(t){this.stack.push(...t)}scanArgument(t){var n,r,s;if(t){if(this.consumeSpaces(),this.future().text!=="[")return null;n=this.popToken(),{tokens:s,end:r}=this.consumeArg(["]"])}else({tokens:s,start:n,end:r}=this.consumeArg());return this.pushToken(new Cn("EOF",r.loc)),this.pushTokens(s),new Cn("",wn.range(n,r))}consumeSpaces(){for(;;){var t=this.future();if(t.text===" ")this.stack.pop();else break}}consumeArg(t){var n=[],r=t&&t.length>0;r||this.consumeSpaces();var s=this.future(),i,a=0,o=0;do{if(i=this.popToken(),n.push(i),i.text==="{")++a;else if(i.text==="}"){if(--a,a===-1)throw new ae("Extra }",i)}else if(i.text==="EOF")throw new ae("Unexpected end of input in a macro argument, expected '"+(t&&r?t[o]:"}")+"'",i);if(t&&r)if((a===0||a===1&&t[o]==="{")&&i.text===t[o]){if(++o,o===t.length){n.splice(-o,o);break}}else o=0}while(a!==0||r);return s.text==="{"&&n[n.length-1].text==="}"&&(n.pop(),n.shift()),n.reverse(),{tokens:n,start:s,end:i}}consumeArgs(t,n){if(n){if(n.length!==t+1)throw new ae("The length of delimiters doesn't match the number of args!");for(var r=n[0],s=0;s<r.length;s++){var i=this.popToken();if(r[s]!==i.text)throw new ae("Use of the macro doesn't match its definition",i)}}for(var a=[],o=0;o<t;o++)a.push(this.consumeArg(n&&n[o+1]).tokens);return a}countExpansion(t){if(this.expansionCount+=t,this.expansionCount>this.settings.maxExpand)throw new ae("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(t){var n=this.popToken(),r=n.text,s=n.noexpand?null:this._getExpansion(r);if(s==null||t&&s.unexpandable){if(t&&s==null&&r[0]==="\\"&&!this.isDefined(r))throw new ae("Undefined control sequence: "+r);return this.pushToken(n),!1}this.countExpansion(1);var i=s.tokens,a=this.consumeArgs(s.numArgs,s.delimiters);if(s.numArgs){i=i.slice();for(var o=i.length-1;o>=0;--o){var l=i[o];if(l.text==="#"){if(o===0)throw new ae("Incomplete placeholder at end of macro body",l);if(l=i[--o],l.text==="#")i.splice(o+1,1);else if(/^[1-9]$/.test(l.text))i.splice(o,2,...a[+l.text-1]);else throw new ae("Not a valid argument number",l)}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var t=this.stack.pop();return t.treatAsRelax&&(t.text="\\relax"),t}}expandMacro(t){return this.macros.has(t)?this.expandTokens([new Cn(t)]):void 0}expandTokens(t){var n=[],r=this.stack.length;for(this.pushTokens(t);this.stack.length>r;)if(this.expandOnce(!0)===!1){var s=this.stack.pop();s.treatAsRelax&&(s.noexpand=!1,s.treatAsRelax=!1),n.push(s)}return this.countExpansion(n.length),n}expandMacroAsText(t){var n=this.expandMacro(t);return n&&n.map(r=>r.text).join("")}_getExpansion(t){var n=this.macros.get(t);if(n==null)return n;if(t.length===1){var r=this.lexer.catcodes[t];if(r!=null&&r!==13)return}var s=typeof n=="function"?n(this):n;if(typeof s=="string"){var i=0;if(s.includes("#"))for(var a=s.replace(/##/g,"");a.includes("#"+(i+1));)++i;for(var o=new af(s,this.settings),l=[],c=o.lex();c.text!=="EOF";)l.push(c),c=o.lex();l.reverse();var u={tokens:l,numArgs:i};return u}return s}isDefined(t){return this.macros.has(t)||Yr.hasOwnProperty(t)||Rt.math.hasOwnProperty(t)||Rt.text.hasOwnProperty(t)||n1.hasOwnProperty(t)}isExpandable(t){var n=this.macros.get(t);return n!=null?typeof n=="string"||typeof n=="function"||!n.unexpandable:Yr.hasOwnProperty(t)&&!Yr[t].primitive}}var cf=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,Fa=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),ql={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},uf={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class Qo{constructor(t,n){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new X8(t,n,this.mode),this.settings=n,this.leftrightDepth=0,this.nextToken=null}expect(t,n){if(n===void 0&&(n=!0),this.fetch().text!==t)throw new ae("Expected '"+t+"', got '"+this.fetch().text+"'",this.fetch());n&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(t){this.mode=t,this.gullet.switchMode(t)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var t=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),t}finally{this.gullet.endGroups()}}subparse(t){var n=this.nextToken;this.consume(),this.gullet.pushToken(new Cn("}")),this.gullet.pushTokens(t);var r=this.parseExpression(!1);return this.expect("}"),this.nextToken=n,r}parseExpression(t,n){for(var r=[];;){this.mode==="math"&&this.consumeSpaces();var s=this.fetch();if(Qo.endOfExpression.has(s.text)||n&&s.text===n||t&&Yr[s.text]&&Yr[s.text].infix)break;var i=this.parseAtom(n);if(i){if(i.type==="internal")continue}else break;r.push(i)}return this.mode==="text"&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(t){for(var n=-1,r,s=0;s<t.length;s++){var i=t[s];if(i.type==="infix"){if(n!==-1)throw new ae("only one infix operator per group",i.token);n=s,r=i.replaceWith}}if(n!==-1&&r){var a,o,l=t.slice(0,n),c=t.slice(n+1);l.length===1&&l[0].type==="ordgroup"?a=l[0]:a={type:"ordgroup",mode:this.mode,body:l},c.length===1&&c[0].type==="ordgroup"?o=c[0]:o={type:"ordgroup",mode:this.mode,body:c};var u;return r==="\\\\abovefrac"?u=this.callFunction(r,[a,t[n],o],[]):u=this.callFunction(r,[a,o],[]),[u]}else return t}handleSupSubscript(t){var n=this.fetch(),r=n.text;this.consume(),this.consumeSpaces();var s;do{var i;s=this.parseGroup(t)}while(((i=s)==null?void 0:i.type)==="internal");if(!s)throw new ae("Expected group after '"+r+"'",n);return s}formatUnsupportedCmd(t){for(var n=[],r=0;r<t.length;r++)n.push({type:"textord",mode:"text",text:t[r]});var s={type:"text",mode:this.mode,body:n},i={type:"color",mode:this.mode,color:this.settings.errorColor,body:[s]};return i}parseAtom(t){var n=this.parseGroup("atom",t);if(n?.type==="internal"||this.mode==="text")return n;for(var r,s;;){this.consumeSpaces();var i=this.fetch();if(i.text==="\\limits"||i.text==="\\nolimits"){if(n&&n.type==="op")n.limits=i.text==="\\limits",n.alwaysHandleSupSub=!0;else if(n&&n.type==="operatorname")n.alwaysHandleSupSub&&(n.limits=i.text==="\\limits");else throw new ae("Limit controls must follow a math operator",i);this.consume()}else if(i.text==="^"){if(r)throw new ae("Double superscript",i);r=this.handleSupSubscript("superscript")}else if(i.text==="_"){if(s)throw new ae("Double subscript",i);s=this.handleSupSubscript("subscript")}else if(i.text==="'"){if(r)throw new ae("Double superscript",i);var a={type:"textord",mode:this.mode,text:"\\prime"},o=[a];for(this.consume();this.fetch().text==="'";)o.push(a),this.consume();this.fetch().text==="^"&&o.push(this.handleSupSubscript("superscript")),r={type:"ordgroup",mode:this.mode,body:o}}else if(Fa[i.text]){var l=cf.test(i.text),c=[];for(c.push(new Cn(Fa[i.text])),this.consume();;){var u=this.fetch().text;if(!Fa[u]||cf.test(u)!==l)break;c.unshift(new Cn(Fa[u])),this.consume()}var p=this.subparse(c);l?s={type:"ordgroup",mode:"math",body:p}:r={type:"ordgroup",mode:"math",body:p}}else break}return r&&s?{type:"supsub",mode:this.mode,base:n,sup:r,sub:s}:r?{type:"supsub",mode:this.mode,base:n,sup:r}:s?{type:"supsub",mode:this.mode,base:n,sub:s}:n}parseFunction(t,n){var r=this.fetch(),s=r.text,i=Yr[s];if(!i)return null;if(this.consume(),n&&n!=="atom"&&!i.allowedInArgument)throw new ae("Got function '"+s+"' with no arguments"+(n?" as "+n:""),r);if(this.mode==="text"&&!i.allowedInText)throw new ae("Can't use function '"+s+"' in text mode",r);if(this.mode==="math"&&i.allowedInMath===!1)throw new ae("Can't use function '"+s+"' in math mode",r);var{args:a,optArgs:o}=this.parseArguments(s,i);return this.callFunction(s,a,o,r,t)}callFunction(t,n,r,s,i){var a={funcName:t,parser:this,token:s,breakOnTokenText:i},o=Yr[t];if(o&&o.handler)return o.handler(a,n,r);throw new ae("No function handler for "+t)}parseArguments(t,n){var r,s=(r=n.numOptionalArgs)!=null?r:0,i=n.numArgs+s;if(i===0)return{args:[],optArgs:[]};for(var a=[],o=[],l=0;l<i;l++){var c,u=(c=n.argTypes)==null?void 0:c[l],p=l<s;("primitive"in n&&n.primitive&&u==null||n.type==="sqrt"&&l===1&&o[0]==null)&&(u="primitive");var m=this.parseGroupOfType("argument to '"+t+"'",u,p);if(p)o.push(m);else if(m!=null)a.push(m);else throw new ae("Null argument, please report this as a bug")}return{args:a,optArgs:o}}parseGroupOfType(t,n,r){switch(n){case"color":return this.parseColorGroup(r);case"size":return this.parseSizeGroup(r);case"url":return this.parseUrlGroup(r);case"math":case"text":return this.parseArgumentGroup(r,n);case"hbox":{var s=this.parseArgumentGroup(r,"text");return s!=null?{type:"styling",mode:s.mode,body:[s],style:"text",resetFont:!0}:null}case"raw":{var i=this.parseStringGroup(r);return i!=null?{type:"raw",mode:"text",string:i.text}:null}case"primitive":{if(r)throw new ae("A primitive argument cannot be optional");var a=this.parseGroup(t);if(a==null)throw new ae("Expected group as "+t,this.fetch());return a}case"original":case void 0:return this.parseArgumentGroup(r);default:throw new ae("Unknown group type as "+t,this.fetch())}}consumeSpaces(){for(;this.fetch().text===" ";)this.consume()}parseStringGroup(t){var n=this.gullet.scanArgument(t);if(n==null)return null;for(var r="",s;(s=this.fetch()).text!=="EOF";)r+=s.text,this.consume();return this.consume(),n.text=r,n}parseRegexGroup(t,n){for(var r=this.fetch(),s=r,i="",a;(a=this.fetch()).text!=="EOF"&&t.test(i+a.text);)s=a,i+=s.text,this.consume();if(i==="")throw new ae("Invalid "+n+": '"+r.text+"'",r);return r.range(s,i)}parseColorGroup(t){var n=this.parseStringGroup(t);if(n==null)return null;var r=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(n.text);if(!r)throw new ae("Invalid color: '"+n.text+"'",n);var s=r[0];return/^[0-9a-f]{6}$/i.test(s)&&(s="#"+s),{type:"color-token",mode:this.mode,color:s}}parseSizeGroup(t){var n,r=!1;if(this.gullet.consumeSpaces(),!t&&this.gullet.future().text!=="{"?n=this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size"):n=this.parseStringGroup(t),!n)return null;!t&&n.text.length===0&&(n.text="0pt",r=!0);var s=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(n.text);if(!s)throw new ae("Invalid size: '"+n.text+"'",n);var i={number:+(s[1]+s[2]),unit:s[3]};if(!mm(i))throw new ae("Invalid unit: '"+i.unit+"'",n);return{type:"size",mode:this.mode,value:i,isBlank:r}}parseUrlGroup(t){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var n=this.parseStringGroup(t);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),n==null)return null;var r=n.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:r}}parseArgumentGroup(t,n){var r=this.gullet.scanArgument(t);if(r==null)return null;var s=this.mode;n&&this.switchMode(n),this.gullet.beginGroup();var i=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var a={type:"ordgroup",mode:this.mode,loc:r.loc,body:i};return n&&this.switchMode(s),a}parseGroup(t,n){var r=this.fetch(),s=r.text,i;if(s==="{"||s==="\\begingroup"){this.consume();var a=s==="{"?"}":"\\endgroup";this.gullet.beginGroup();var o=this.parseExpression(!1,a),l=this.fetch();this.expect(a),this.gullet.endGroup(),i={type:"ordgroup",mode:this.mode,loc:wn.range(r,l),body:o,semisimple:s==="\\begingroup"||void 0}}else if(i=this.parseFunction(n,t)||this.parseSymbol(),i==null&&s[0]==="\\"&&!n1.hasOwnProperty(s)){if(this.settings.throwOnError)throw new ae("Undefined control sequence: "+s,r);i=this.formatUnsupportedCmd(s),this.consume()}return i}formLigatures(t){for(var n=t.length-1,r=0;r<n;++r){var s=t[r];if(s.type==="textord"){var i=s.text,a=t[r+1];if(!(!a||a.type!=="textord")){if(i==="-"&&a.text==="-"){var o=t[r+2];r+1<n&&o&&o.type==="textord"&&o.text==="-"?(t.splice(r,3,{type:"textord",mode:"text",loc:wn.range(s,o),text:"---"}),n-=2):(t.splice(r,2,{type:"textord",mode:"text",loc:wn.range(s,a),text:"--"}),n-=1)}(i==="'"||i==="`")&&a.text===i&&(t.splice(r,2,{type:"textord",mode:"text",loc:wn.range(s,a),text:i+i}),n-=1)}}}}parseSymbol(){var t=this.fetch(),n=t.text;if(/^\\verb[^a-zA-Z]/.test(n)){this.consume();var r=n.slice(5),s=r.charAt(0)==="*";if(s&&(r=r.slice(1)),r.length<2||r.charAt(0)!==r.slice(-1))throw new ae(`\\verb assertion failed --
|
|
318
|
+
please report what input caused this bug`);return r=r.slice(1,-1),{type:"verb",mode:"text",body:r,star:s}}uf.hasOwnProperty(n[0])&&!Rt[this.mode][n[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+n[0]+'" used in math mode',t),n=uf[n[0]]+n.slice(1));var i=K8.exec(n);i&&(n=n.substring(0,i.index),n==="i"?n="ı":n==="j"&&(n="ȷ"));var a;if(Rt[this.mode][n]){this.settings.strict&&this.mode==="math"&&Ec.includes(n)&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+n[0]+'" used in math mode',t);var o=Rt[this.mode][n].group,l=wn.range(t),c;i8(o)?c={type:"atom",mode:this.mode,family:o,loc:l,text:n}:c={type:o,mode:this.mode,loc:l,text:n},a=c}else if(n.charCodeAt(0)>=128)this.settings.strict&&(pm(n.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+n[0]+'" used in math mode',t):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+n[0]+'"'+(" ("+n.charCodeAt(0)+")"),t)),a={type:"textord",mode:"text",loc:wn.range(t),text:n};else return null;if(this.consume(),i)for(var u=0;u<i[0].length;u++){var p=i[0][u];if(!ql[p])throw new ae("Unknown accent ' "+p+"'",t);var m=ql[p][this.mode]||ql[p].text;if(!m)throw new ae("Accent "+p+" unsupported in "+this.mode+" mode",t);a={type:"accent",mode:this.mode,loc:wn.range(t),label:m,isStretchy:!1,isShifty:!0,base:a}}return a}}Qo.endOfExpression=new Set(["}","\\endgroup","\\end","\\right","&"]);var j0=function(t,n){if(!(typeof t=="string"||t instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var r=new Qo(t,n);delete r.gullet.macros.current["\\df@tag"];var s=r.parse();if(delete r.gullet.macros.current["\\current@color"],delete r.gullet.macros.current["\\color"],r.gullet.macros.get("\\df@tag")){if(!n.displayMode)throw new ae("\\tag works only in display equations");s=[{type:"tag",mode:"text",body:s,tag:r.subparse([new Cn("\\df@tag")])}]}return s},r1=function(t,n,r){n.textContent="";var s=G0(t,r).toNode();n.appendChild(s)};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."),r1=function(){throw new ae("KaTeX doesn't work in quirks mode.")});var ew=function(t,n){var r=G0(t,n).toMarkup();return r},tw=function(t,n){var r=new M0(n);return j0(t,r)},s1=function(t,n,r){if(r.throwOnError||!(t instanceof ae))throw t;var s=te(["katex-error"],[new Mn(n)]);return s.setAttribute("title",t.toString()),s.setAttribute("style","color:"+r.errorColor),s},G0=function(t,n){var r=new M0(n);try{var s=j0(t,r);return J7(s,t,r)}catch(i){return s1(i,t,r)}},nw=function(t,n){var r=new M0(n);try{var s=j0(t,r);return Y7(s,t,r)}catch(i){return s1(i,t,r)}},rw="0.17.0",sw={Span:pi,Anchor:Fo,SymbolNode:Mn,SvgNode:Or,PathNode:as,LineNode:_c},iw={version:rw,render:r1,renderToString:ew,ParseError:ae,SETTINGS_SCHEMA:Sc,__parse:tw,__renderToDomTree:G0,__renderToHTMLTree:nw,__setFontMetrics:M7,__defineSymbol:d,__defineFunction:be,__defineMacro:w,__domTree:sw};const aw=/^(\${1,2})(?!\$)((?:\\.|[^\\\n])*?(?:\\.|[^\\\n\$]))\1(?=[\s?!\.,:?!。,:]|$)/,ow=/^(\${1,2})(?!\$)((?:\\.|[^\\\n])*?(?:\\.|[^\\\n\$]))\1/,lw=/^(\${1,2})\n((?:\\[^]|[^\\])+?)\n\1(?:\n|$)/;function cw(e={}){return{extensions:[uw(e,df(e,!1)),dw(e,df(e,!0))]}}function df(e,t){return n=>iw.renderToString(n.text,{...e,displayMode:n.displayMode})+(t?`
|
|
319
|
+
`:"")}function uw(e,t){const n=e&&e.nonStandard,r=n?ow:aw;return{name:"inlineKatex",level:"inline",start(s){let i,a=s;for(;a;){if(i=a.indexOf("$"),i===-1)return;if((n?i>-1:i===0||a.charAt(i-1)===" ")&&a.substring(i).match(r))return i;a=a.substring(i+1).replace(/^\$+/,"")}},tokenizer(s,i){const a=s.match(r);if(a)return{type:"inlineKatex",raw:a[0],text:a[2].trim(),displayMode:a[1].length===2}},renderer:t}}function dw(e,t){return{name:"blockKatex",level:"block",tokenizer(n,r){const s=n.match(lw);if(s)return{type:"blockKatex",raw:s[0],text:s[2].trim(),displayMode:s[1].length===2}},renderer:t}}function Tn(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}const fw={bash:R5,cpp:C5,csharp:O5,css:F5,dockerfile:U5,go:q5,java:H5,javascript:K5,json:W5,kotlin:J5,markdown:Y5,php:X5,python:e6,ruby:t6,rust:n6,sql:r6,swift:d6,typescript:h6,xml:p6,yaml:m6};for(const[e,t]of Object.entries(fw))ho.registerLanguage(e,t);function hw(e,t){if(!t)return;const n=e||t.plainTextLabel;return`<div class="markdown-code-toolbar"><span class="markdown-code-language">${Tn(n)}</span><button type="button" class="markdown-code-copy" aria-label="${Tn(t.copyLabel)}" data-copy-label="${Tn(t.copyLabel)}" data-copied-label="${Tn(t.copiedLabel)}">${Tn(t.copyLabel)}</button></div>`}function pw(e,t,n){const r=String(e??""),s=String(t??"").trim().split(/\s+/,1)[0].toLowerCase();if(s==="mermaid")return`<div class="markdown-mermaid" data-mermaid-state="pending"><pre><code>${Tn(r)}</code></pre></div>
|
|
320
|
+
`;const i=hw(s,n),a=i?`<div class="markdown-code-block">${i}`:"",o=i?"</div>":"",l=s?` data-language="${Tn(s)}"`:"";if(!s||!ho.getLanguage(s))return`${a}<pre${l}><code>${Tn(r)}</code></pre>${o}
|
|
321
|
+
`;const c=mw(r,s);return`${a}<pre${l}><code class="hljs language-${Tn(s)}">${c}</code></pre>${o}
|
|
322
|
+
`}function mw(e,t){const n=String(e??""),r=String(t??"").trim().toLowerCase();return!r||!ho.getLanguage(r)?Tn(n):ho.highlight(n,{language:r,ignoreIllegals:!0}).value}function gw(e,t){const n=String(e??"").trim();if(!n)return!1;let r;try{r=t?new URL(n,t):new URL(n)}catch{return!1}if(r.protocol!=="http:"&&r.protocol!=="https:")return!1;if(!t)return!0;try{return r.origin!==new URL(t).origin}catch{return!0}}function i1(e={}){const t=new Ir;return t.html=({text:n})=>Tn(n),t.table=function(n){return`<div class="markdown-table-wrapper">${Reflect.apply(Ir.prototype.table,this,[n])}</div>
|
|
323
|
+
`},t.code=({text:n,lang:r})=>pw(n,r,e.codeTools),e.resolveImageSrc&&(t.image=function(n){const r=e.resolveImageSrc(n.href);return r?Reflect.apply(Ir.prototype.image,this,[{...n,href:r}]):Tn(n.text)}),t}ct.use(cw({nonStandard:!0,strict:"warn",throwOnError:!1}));ct.use({async:!1,breaks:!0,gfm:!0});function a1(e,t={}){const n=String(e??"").replace(/\r\n?/g,`
|
|
324
|
+
`).trim();return n?ct.parse(n,{async:!1,renderer:i1(t)}):""}function vw(e,t,n={}){const r=a1(e,n);if(!t.length)return r;let s=0;for(;e.includes(`${s}:`);)s+=1;const i=`${s}:`,a=S=>`${i}${S}`,o=new RegExp(`${i}(\\d+)`,"g");let l=0,c="";const u=[];for(const{start:S,end:N}of t){if(!Number.isInteger(S)||!Number.isInteger(N)||S<l||N<=S||N>e.length)return r;u.push(Tn(e.slice(S,N))),c+=e.slice(l,S)+a(u.length-1),l=N}c+=e.slice(l);const p=i1(n);let m=!1;p.link=function(S){const N=m;m=!0;try{return Ir.prototype.link.call(this,S)}finally{m=N}};const f=S=>`<span data-markdown-inline-slot="${S}"></span>`;p.text=function(S){const N=Ir.prototype.text.call(this,S);return m||"tokens"in S&&S.tokens?N:N.replace(o,(z,I)=>f(I))};const y=ct.parse(c.replace(/\r\n?/g,`
|
|
325
|
+
`).trim(),{async:!1,renderer:p}),b=S=>S.replace(o,(N,z)=>u[Number(z)]??N),x=y.replace(/<span data-markdown-inline-slot="(\d+)"><\/span>/g,(S,N)=>a(Number(N)));return b(x)===r?b(y):r}const Hl=new WeakMap;async function bw(e){const t=e.target instanceof Element?e.target.closest(".markdown-code-copy"):void 0;if(!t)return!1;const n=t.closest(".markdown-code-block")?.querySelector("pre code")?.textContent;if(n===void 0||typeof navigator>"u"||!navigator.clipboard?.writeText)return!1;try{await navigator.clipboard.writeText(n)}catch{return!1}const r=t.dataset.copyLabel||t.textContent||"",s=t.dataset.copiedLabel||r;t.textContent=s,t.setAttribute("aria-label",s);const i=Hl.get(t);return i&&clearTimeout(i),Hl.set(t,setTimeout(()=>{t.isConnected&&(t.textContent=r,t.setAttribute("aria-label",r),Hl.delete(t))},1600)),!0}const yw="modulepreload",ww=function(e,t){return new URL(e,t).href},ff={},Sw=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){let c=function(u){return Promise.all(u.map(p=>Promise.resolve(p).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};const a=document.getElementsByTagName("link"),o=document.querySelector("meta[property=csp-nonce]"),l=o?.nonce||o?.getAttribute("nonce");s=c(n.map(u=>{if(u=ww(u,r),u in ff)return;ff[u]=!0;const p=u.endsWith(".css"),m=p?'[rel="stylesheet"]':"";if(r)for(let y=a.length-1;y>=0;y--){const b=a[y];if(b.href===u&&(!p||b.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${u}"]${m}`))return;const f=document.createElement("link");if(f.rel=p?"stylesheet":yw,p||(f.as="script"),f.crossOrigin="",f.href=u,l&&f.setAttribute("nonce",l),document.head.appendChild(f),p)return new Promise((y,b)=>{f.addEventListener("load",y),f.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${u}`)))})}))}function i(a){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=a,window.dispatchEvent(o),!o.defaultPrevented)throw a}return s.then(a=>{for(const o of a||[])o.status==="rejected"&&i(o.reason);return t().catch(i)})};let hf=0,pf=Promise.resolve();function xw(e,t){const n=pf.then(async()=>{const{default:r}=await Sw(async()=>{const{default:s}=await import("./mermaid.core-D9RSZOdA.js").then(i=>i.aJ);return{default:s}},[],import.meta.url);return r.initialize({flowchart:{htmlLabels:!1},securityLevel:"strict",startOnLoad:!1,suppressErrorRendering:!0,theme:t}),hf+=1,r.render(`markdown-mermaid-${hf}`,e)});return pf=n.then(()=>{},()=>{}),n}const kw=["innerHTML"],_w=Re({__name:"MarkdownContent",props:{codeTools:{},content:{},resolveImageSrc:{type:Function},inlineSlots:{}},emits:["inlineTargets"],setup(e,{emit:t}){const n=e,r=t,s=Oe(),i=Se(()=>{const f={codeTools:n.codeTools,resolveImageSrc:n.resolveImageSrc};return n.inlineSlots?.length&&typeof n.content=="string"?vw(n.content,n.inlineSlots,f):a1(n.content,f)});on([s,i,()=>!!n.inlineSlots?.length],([f,y,b],x)=>{!b&&!x[2]||r("inlineTargets",b&&f?[...f.querySelectorAll("[data-markdown-inline-slot]")].map(S=>({index:Number(S.dataset.markdownInlineSlot),element:S})):[])},{flush:"post"});const a=new WeakMap;let o=0,l;async function c(f){const y=f.target instanceof Element?f.target.closest("a[href]"):void 0;if(y&&typeof window<"u"&&gw(y.getAttribute("href"),window.location.href)){f.preventDefault(),window.open(y.href,"_blank","noopener,noreferrer");return}await bw(f)}function u(){const f=document.documentElement.dataset.theme;return f==="dark"?"dark":f==="light"?"default":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"default"}function p(f,y,b){const x=document.createElement("pre"),S=document.createElement("code");if(S.textContent=y,x.append(S),f.replaceChildren(x),b){const N=document.createElement("small");N.className="markdown-mermaid-error",N.textContent=b,f.append(N)}}async function m(){o+=1;const f=o;await ur();const y=s.value;if(!y)return;const b=Array.from(y.querySelectorAll(".markdown-mermaid")),x=u();for(const S of b){const N=a.get(S)??S.querySelector("code")?.textContent??"";a.set(S,N),S.dataset.mermaidState="loading";try{const z=await xw(N,x);if(f!==o||!S.isConnected)return;S.innerHTML=z.svg,z.bindFunctions?.(S),S.dataset.mermaidState="rendered"}catch(z){if(f!==o||!S.isConnected)return;p(S,N,z instanceof Error?z.message:"Mermaid diagram could not be rendered."),S.dataset.mermaidState="error"}}}return on(i,()=>{m()},{flush:"post"}),nc(()=>{m(),l=new MutationObserver(()=>{m()}),l.observe(document.documentElement,{attributeFilter:["class","data-theme"],attributes:!0})}),zo(()=>{o+=1,l?.disconnect()}),(f,y)=>(O(),j("div",{ref_key:"root",ref:s,class:"markdown-content",innerHTML:i.value,onClick:c},null,8,kw))}}),pa=(e,t)=>{const n=e.__vccOpts||e;for(const[r,s]of t)n[r]=s;return n},Vi=pa(_w,[["__scopeId","data-v-7695a449"]]),Ew={class:"ai-session-composer__toolbar"},Aw={class:"ai-session-composer__actions"},Tw=["data-action","disabled","title"],Iw={key:0,class:"ai-session-composer__error"},Rw=Re({__name:"AiSessionComposer",props:{modelValue:{},busy:{type:Boolean},canInterrupt:{type:Boolean},error:{},placeholder:{}},emits:["update:modelValue","add-context","run","steer"],setup(e,{emit:t}){const n=e,r=t,s=Se({get:()=>n.modelValue,set:m=>r("update:modelValue",String(m))}),i=Se(()=>n.modelValue.trim().length>0),a=Se(()=>i.value||!n.canInterrupt?"send":"stop"),o=Se(()=>i.value||!n.busy&&n.canInterrupt),l=Se(()=>n.busy&&i.value),c=Se(()=>a.value==="stop"?"Stop current AI turn":"Send message");function u(){o.value&&r("run")}function p(m){m.key!=="Enter"||m.shiftKey||m.isComposing||(m.preventDefault(),i.value&&u())}return(m,f)=>(O(),j("form",{class:"ai-session-composer",onSubmit:en(u,["prevent"])},[T(g(or),{modelValue:s.value,"onUpdate:modelValue":f[0]||(f[0]=y=>s.value=y),class:"ai-session-composer__input",placeholder:e.placeholder||"Ask for follow-up changes",rows:"4",onKeydown:p},null,8,["modelValue","placeholder"]),k("div",Ew,[k("button",{type:"button",class:"ai-session-composer__tool",title:"Add context",onClick:f[1]||(f[1]=y=>r("add-context"))},[T(g(vc),{size:18})]),k("div",Aw,[l.value?(O(),j("button",{key:0,type:"button",class:"ai-session-composer__tool",title:"Steer current AI turn",onClick:f[2]||(f[2]=y=>r("steer"))},[T(g(Ay),{size:18})])):pe("",!0),k("button",{type:"submit",class:"ai-session-composer__primary","data-action":a.value,disabled:!o.value,title:c.value},[a.value==="send"?(O(),xe(g(ay),{key:0,size:18})):(O(),xe(g(Zy),{key:1,size:16}))],8,Tw)])]),e.error?(O(),j("p",Iw,K(e.error),1)):pe("",!0)],32))}}),Cw=pa(Rw,[["__scopeId","data-v-5417f399"]]);function Ow(){const e=Oe({});function t(a){return a.turnCount??c1(a).length}function n(a){const o=t(a);if(!o)return 0;const l=e.value[a.id];return!l||l.index>=l.count-1&&o!==l.count?o-1:Math.min(Math.max(l.index,0),o-1)}function r(a,o){const l=t(a);l&&(e.value={...e.value,[a.id]:{index:(o+l)%l,count:l}})}function s(a){r(a,n(a)-1)}function i(a){r(a,n(a)+1)}return{nextPrompt:i,previousPrompt:s,promptCount:t,promptIndexFor:n}}function Mw(){const e=Oe();function t(a,o){const l=e.value;e.value=l?.sessionId===a&&l.kind===o?void 0:{sessionId:a,kind:o}}function n(a){t(a,"prompt")}function r(a){t(a,"message")}function s(){e.value=void 0}function i(a){const o=a.target instanceof Element?a.target:void 0;!o||o.closest(".ai-session-expanded-preview")||o.closest("[data-ai-preview-trigger]")||(e.value=void 0)}return Ev(document,"click",i,{capture:!0}),{collapseExpandedPreview:s,expandMessage:r,expandedPreview:e,expandPrompt:n}}function o1(e){if(!e)return"";const t=Math.max(0,Math.round((Date.now()-Date.parse(e))/1e3));if(t<60)return`${t}s ago`;const n=Math.round(t/60);return n<60?`${n}m ago`:`${Math.round(n/60)}h ago`}function Nw(e){return[...e].sort((t,n)=>mf(n)-mf(t)||gf(t).localeCompare(gf(n)))}function mf(e){return e.status==="waiting"?4:e.status==="failed"?3:e.status==="running"?2:e.status==="idle"?1:0}function gf(e){return[e.cwd||"",e.agent||"",e.providerSessionId||e.id].join("\0")}function l1(e){return e?e.status==="waiting"?e.phase==="approval"?"waiting for approval":"waiting":e.status==="running"?e.currentTool?.name?`running · ${e.currentTool.name}`:e.phase==="tool"?"running · tool":e.phase==="editing"?"running · editing":e.phase==="responding"?"running · responding":"running":e.status==="failed"?"failed":"idle":"idle"}function Fc(e,t){if(!e)return"No recent AI activity";const n=u1(e);if(n.length&&t!==void 0){const s=Math.min(Math.max(t,0),n.length-1),i=n[s];return i?.lastMessage?.trim()?i.lastMessage:i?.summary?.trim()?i.summary:Vl(e)}const r=n.at(-1);return r&&!r.lastMessage?.trim()&&!r.summary?.trim()?Vl(e):e.lastMessage?.trim()?e.lastMessage:e.summary?.trim()?e.summary:Vl(e)}function c1(e){return e?u1(e).map(t=>t.userPrompt?.trim()||"").filter(Boolean):[]}function zw(e){return(e?.turns||[]).filter(t=>t.userPrompt?.trim()||t.lastMessage?.trim()||t.summary?.trim())}function u1(e){if(!e)return[];const t=zw(e),n=e.userPrompt?.trim();if(!n)return t;const r=e.activeTurnId?t.find(i=>i.id===e.activeTurnId):void 0;if(r)return(e.status==="running"||e.status==="waiting")&&r.userPrompt?.trim()===n?[...t.filter(i=>i.id!==r.id),r]:t;const s=t.at(-1);if(s?.userPrompt?.trim()===n&&!s.lastMessage?.trim()&&!s.summary?.trim())return t;if(e.status==="running"||e.status==="waiting"){const i={id:e.activeTurnId||`${e.id}:active`,userPrompt:n,status:e.status==="waiting"?"waiting":"running",phase:e.phase,revision:0,updatedAt:e.updatedAt};return[...t,i]}return t}function Vl(e){return e.currentTool?.name?e.currentTool.inputPreview?`${e.currentTool.name}: ${e.currentTool.inputPreview}`:e.currentTool.name:e.status==="running"?"Running...":e.status==="waiting"?e.phase==="approval"?"Waiting for approval.":"Waiting...":"-"}function Uc(e,t){if(!e)return"No AI session selected";const n=c1(e);if(n.length){const r=t===void 0?n.length-1:Math.min(Math.max(t,0),n.length-1);return n[r]}return"-"}function $w(e){const t=Dw(e.cwd),n=Pw(e.providerSessionId||e.id);return t&&n?`${t} · ${n}`:t||n||e.agent}function Dw(e){return e?e.split(/[\\/]/).filter(Boolean).at(-1)||e:""}function Pw(e){return e?e.length>12?e.slice(0,12):e:""}function Bw(e){return{active:e.filter(t=>t.status==="running").length,idle:e.filter(t=>t.status==="idle").length,waiting:e.filter(t=>t.status==="waiting").length}}function So(e){const t=e.agent==="claude"&&typeof e.providerMeta?.short=="string";return!!((e.activeTurnId||t)&&(e.status==="running"||e.status==="waiting"))}function d1(e){return e.status==="waiting"&&e.phase==="approval"}const Lw={class:"ai-session-detail-content"},Fw={class:"ai-session-detail-block ai-session-detail-block-user"},Uw={class:"ai-session-detail-block ai-session-detail-block-assistant"},qw={key:0,class:"ai-session-approval-actions"},Hw=["disabled"],Vw=["disabled"],jw=["disabled"],Gw={key:1,class:"ai-session-detail-block ai-session-queue"},Zw={class:"ai-session-queue-list"},Kw=["data-state"],Ww={key:0},Qw=["disabled","onClick"],Jw=["disabled","onClick"],Yw=["disabled","onClick"],Xw={key:2,class:"ai-session-tool"},e9={key:0},t9={class:"ai-session-meta"},n9=Re({__name:"AiSessionDetail",props:{busy:{type:Boolean},error:{},hasAppSession:{type:Boolean},messageDraft:{},promptIndex:{},session:{},sessionTitle:{}},emits:["open-app-session","remove-queued","resolve-approval","retry-queued","run-action","steer-draft","steer-queued","update:messageDraft"],setup(e){return(t,n)=>(O(),xe(g(Rn),{class:"ai-session-detail","aria-label":"AI session detail"},{default:D(()=>[k("aside",Lw,[k("header",null,[k("div",null,[k("span",null,K(e.sessionTitle),1),k("strong",null,K(g(l1)(e.session)),1)]),k("small",null,K(g(o1)(e.session.updatedAt)),1)]),k("section",Fw,[n[7]||(n[7]=k("span",null,"User Message",-1)),T(g(Rn),{class:"ai-session-detail-block-scroll"},{default:D(()=>[T(Vi,{content:g(Uc)(e.session,e.promptIndex)},null,8,["content"])]),_:1})]),k("section",Uw,[n[8]||(n[8]=k("span",null,"AI Response / Progress",-1)),T(g(Rn),{class:"ai-session-detail-block-scroll"},{default:D(()=>[T(Vi,{content:g(Fc)(e.session,e.promptIndex)},null,8,["content"])]),_:1})]),g(d1)(e.session)?(O(),j("div",qw,[k("button",{type:"button",disabled:e.busy,onClick:n[0]||(n[0]=r=>t.$emit("resolve-approval","allow"))},[T(g(Tp),{size:14}),n[9]||(n[9]=k("span",null,"Allow",-1))],8,Hw),k("button",{type:"button",disabled:e.busy,onClick:n[1]||(n[1]=r=>t.$emit("resolve-approval","skip"))},[T(g(ly),{size:14}),n[10]||(n[10]=k("span",null,"Skip",-1))],8,Vw),k("button",{type:"button",disabled:e.busy,onClick:n[2]||(n[2]=r=>t.$emit("resolve-approval","deny"))},[T(g(Ms),{size:14}),n[11]||(n[11]=k("span",null,"Deny",-1))],8,jw)])):pe("",!0),e.session.queue?.items.length?(O(),j("section",Gw,[k("span",null,"Queue · "+K(e.session.queue.pendingCount),1),k("div",Zw,[(O(!0),j(lt,null,Ht(e.session.queue.items,r=>(O(),j("article",{key:r.id,class:"ai-session-queue-item","data-state":r.status},[k("p",null,K(r.message),1),r.error?(O(),j("small",Ww,K(r.error),1)):pe("",!0),k("div",null,[k("button",{type:"button",disabled:e.busy||!g(So)(e.session),onClick:s=>t.$emit("steer-queued",r.id)},"Steer",8,Qw),r.status==="failed"?(O(),j("button",{key:0,type:"button",disabled:e.busy,onClick:s=>t.$emit("retry-queued",r.id)},"Retry",8,Jw)):pe("",!0),k("button",{type:"button",disabled:e.busy,onClick:s=>t.$emit("remove-queued",r.id)},"Remove",8,Yw)])],8,Kw))),128))])])):pe("",!0),T(Cw,{"model-value":e.messageDraft,class:"ai-session-compose",busy:e.busy,"can-interrupt":g(So)(e.session),error:e.error,"onUpdate:modelValue":n[3]||(n[3]=r=>t.$emit("update:messageDraft",r)),onRun:n[4]||(n[4]=r=>t.$emit("run-action")),onSteer:n[5]||(n[5]=r=>t.$emit("steer-draft"))},null,8,["model-value","busy","can-interrupt","error"]),e.session.currentTool?.name?(O(),j("div",Xw,[n[12]||(n[12]=k("span",null,"Current Tool",-1)),k("strong",null,K(e.session.currentTool.name),1),e.session.currentTool.inputPreview?(O(),j("small",e9,K(e.session.currentTool.inputPreview),1)):pe("",!0)])):pe("",!0),k("dl",t9,[k("div",null,[n[13]||(n[13]=k("dt",null,"Workspace",-1)),k("dd",null,K(e.session.cwd||"Unknown"),1)]),k("div",null,[n[14]||(n[14]=k("dt",null,"Session",-1)),k("dd",null,K(e.session.providerSessionId||e.session.id),1)]),k("div",null,[n[15]||(n[15]=k("dt",null,"App Binding",-1)),k("dd",null,K(e.session.appSessionId||"Not bound"),1)])]),e.hasAppSession?(O(),j("button",{key:3,type:"button",class:"ai-session-detail-open",onClick:n[6]||(n[6]=r=>t.$emit("open-app-session",e.session))},[T(g(Rp),{size:14}),n[16]||(n[16]=k("span",null,"Open App Session",-1))])):pe("",!0)])]),_:1}))}}),r9=pa(n9,[["__scopeId","data-v-5ae5e9eb"]]),s9=["data-state","data-selected","data-expanded"],i9={class:"ai-session-status"},a9={class:"ai-session-card-meta"},o9={class:"ai-session-context"},l9={key:0,class:"ai-session-turn-nav"},c9=["aria-label"],u9=["aria-label"],d9={class:"ai-session-expanded-head"},f9={class:"ai-session-card-tools","aria-label":"AI session card controls"},h9=["aria-label"],p9=Re({__name:"AiSessionListRow",props:{expandedPreview:{},hasAppSession:{type:Boolean},promptCount:{},promptIndex:{},selected:{type:Boolean},session:{},sessionTitle:{}},emits:["collapse-expanded-preview","expand-message","expand-prompt","next-prompt","open-app-session","previous-prompt","select"],setup(e){const t=e;function n(){return t.expandedPreview?.kind==="prompt"?Uc(t.session,t.promptIndex):Fc(t.session,t.promptIndex)}return(r,s)=>(O(),j("article",{class:"ai-session-row","data-state":e.session.status,"data-selected":e.selected,"data-expanded":e.expandedPreview?.sessionId===e.session.id?e.expandedPreview.kind:void 0},[k("div",{class:"ai-session-select",role:"button",tabindex:"0",onClick:s[4]||(s[4]=i=>r.$emit("select",e.session.id)),onKeydown:[s[5]||(s[5]=Qs(en(i=>r.$emit("select",e.session.id),["prevent"]),["enter"])),s[6]||(s[6]=Qs(en(i=>r.$emit("select",e.session.id),["prevent"]),["space"]))]},[k("div",i9,[s[9]||(s[9]=k("span",{class:"ai-session-dot"},null,-1)),k("strong",null,K(e.sessionTitle),1),k("small",null,K(g(l1)(e.session)),1)]),k("div",{class:"ai-session-preview-field ai-session-preview-field-user","data-ai-preview-trigger":"",onClick:s[0]||(s[0]=en(i=>r.$emit("expand-prompt",e.session.id),["stop"]))},[T(Vi,{class:"ai-session-question",content:g(Uc)(e.session,e.promptIndex)},null,8,["content"]),s[10]||(s[10]=k("small",null,"展开用户消息",-1))]),k("div",{class:"ai-session-preview-field ai-session-preview-field-assistant","data-ai-preview-trigger":"",onClick:s[1]||(s[1]=en(i=>r.$emit("expand-message",e.session.id),["stop"]))},[T(Vi,{class:"ai-session-message",content:g(Fc)(e.session,e.promptIndex)},null,8,["content"]),s[11]||(s[11]=k("small",null,"展开 AI 进展",-1))]),k("div",a9,[k("small",o9,K(g($w)(e.session)),1),e.promptCount>1?(O(),j("span",l9,[k("button",{type:"button","aria-label":`Previous user message for ${e.session.agent}`,onClick:s[2]||(s[2]=en(i=>r.$emit("previous-prompt",e.session),["stop"]))},[T(g(py),{size:13})],8,c9),k("small",null,K(e.promptIndex+1)+" / "+K(e.promptCount),1),k("button",{type:"button","aria-label":`Next user message for ${e.session.agent}`,onClick:s[3]||(s[3]=en(i=>r.$emit("next-prompt",e.session),["stop"]))},[T(g(gy),{size:13})],8,u9)])):pe("",!0)])],32),e.expandedPreview?.sessionId===e.session.id?(O(),j("div",{key:0,class:"ai-session-expanded-preview",onClick:s[7]||(s[7]=en(i=>r.$emit("collapse-expanded-preview"),["stop"]))},[k("div",d9,[k("strong",null,K(e.expandedPreview.kind==="prompt"?"User Message":"AI Response / Progress"),1),s[12]||(s[12]=k("small",null,"滚动查看完整内容",-1))]),T(g(Rn),{class:"ai-session-expanded-content"},{default:D(()=>[T(Vi,{class:"ai-session-expanded-content-inner",content:n()},null,8,["content"])]),_:1})])):pe("",!0),k("div",f9,[e.hasAppSession?(O(),j("button",{key:0,type:"button",class:"ai-session-open","aria-label":`Open app session for ${e.session.agent}`,title:"Open app session",onClick:s[8]||(s[8]=i=>r.$emit("open-app-session",e.session))},[T(g(Rp),{size:14})],8,h9)):pe("",!0)])],8,s9))}}),m9=pa(p9,[["__scopeId","data-v-1a5bafd9"]]),g9={class:"ai-sessions-panel","aria-label":"AI sessions"},v9={class:"ai-sessions-head"},b9={class:"ai-session-chips","aria-label":"AI session counts"},y9={"data-tone":"active"},w9={"data-tone":"idle"},S9={"data-tone":"waiting"},x9={key:0,class:"ai-sessions-empty"},k9={key:1,class:"ai-sessions-empty"},_9={key:2,class:"ai-session-workspace"},E9={class:"ai-session-list-content"},A9=Re({__name:"AiSessionsPanel",setup(e){const t=ip(),n=di(),r=fi(),s=Se(()=>Nw(t.data.value?.sessions||[])),i=Oe(""),a=Se(()=>s.value.find(se=>se.id===i.value)||s.value[0]),{nextPrompt:o,previousPrompt:l,promptCount:c,promptIndexFor:u}=Ow(),{collapseExpandedPreview:p,expandMessage:m,expandedPreview:f,expandPrompt:y}=Mw(),b=Oe(""),x=Oe(!1),S=Oe(""),N=Se(()=>Bw(s.value)),z=Se(()=>{const se=t.data.value?.updatedAt;return se?`updated ${o1(se)}`:""});on(s,se=>{if(!se.length){i.value="";return}se.some(re=>re.id===i.value)||(i.value=se[0].id)},{immediate:!0}),on(a,()=>{S.value=""});function I(se){p(),i.value=se}function E(se){const re=he(se);re&&r.open(da(re))}async function _(){const se=a.value;if(!(!se||x.value||!b.value.trim()&&!So(se))){if(b.value.trim()){await L();return}await X()}}async function L(){const se=a.value,re=b.value.trim();if(!(!se||!re||x.value)){x.value=!0,S.value="";try{await Xu(se.id,re),b.value=""}catch(ze){S.value=ze instanceof Error?ze.message:String(ze)}finally{x.value=!1}}}async function M(){const se=a.value,re=b.value.trim();if(!(!se||!re||x.value)){x.value=!0,S.value="";try{await Xu(se.id,re,"steer"),b.value="",await t.refetch()}catch(ze){S.value=ze instanceof Error?ze.message:String(ze)}finally{x.value=!1}}}async function G(se){const re=a.value;re&&await q(()=>j2(re.id,se))}async function P(se){const re=a.value;re&&await q(()=>G2(re.id,se))}async function W(se){const re=a.value;re&&await q(()=>Z2(re.id,se))}async function q(se){if(!x.value){x.value=!0,S.value="";try{await se(),await t.refetch()}catch(re){S.value=re instanceof Error?re.message:String(re)}finally{x.value=!1}}}async function X(){const se=a.value;if(!(!se||!So(se)||x.value||b.value.trim())){x.value=!0,S.value="";try{await tb(se.id),await t.refetch()}catch(re){S.value=re instanceof Error?re.message:String(re)}finally{x.value=!1}}}async function ne(se){const re=a.value;if(!(!re||!d1(re)||x.value)){x.value=!0,S.value="";try{await K2(re.id,se),await t.refetch()}catch(ze){S.value=ze instanceof Error?ze.message:String(ze)}finally{x.value=!1}}}function he(se){const re=n.data.value||[];if(se.appSessionId){const ie=re.find(je=>je.id===se.appSessionId&&je.status==="running");if(ie)return ie}const ze=typeof se.providerMeta?.short=="string"?se.providerMeta.short:"";return ze?re.find(ie=>ie.status==="running"&&ie.ai?.claude?.short===ze):void 0}function Ae(se){return he(se)?.title||se.agent}return(se,re)=>(O(),j("section",g9,[k("header",v9,[k("div",null,[re[1]||(re[1]=k("span",null,"AI Sessions",-1)),k("span",b9,[k("strong",y9,K(N.value.active)+" Active",1),k("strong",w9,K(N.value.idle)+" Idle",1),k("strong",S9,K(N.value.waiting)+" Waiting",1)])]),k("small",null,K(z.value),1)]),g(t).isLoading.value?(O(),j("div",x9,"Loading sessions...")):s.value.length?(O(),j("div",_9,[T(g(Rn),{class:"ai-session-list",role:"listbox","aria-label":"AI session list"},{default:D(()=>[k("div",E9,[(O(!0),j(lt,null,Ht(s.value,ze=>(O(),xe(m9,{key:ze.id,"expanded-preview":g(f),"has-app-session":!!he(ze),"prompt-count":g(c)(ze),"prompt-index":g(u)(ze),selected:a.value?.id===ze.id,session:ze,"session-title":Ae(ze),onCollapseExpandedPreview:g(p),onExpandMessage:g(m),onExpandPrompt:g(y),onNextPrompt:g(o),onOpenAppSession:E,onPreviousPrompt:g(l),onSelect:I},null,8,["expanded-preview","has-app-session","prompt-count","prompt-index","selected","session","session-title","onCollapseExpandedPreview","onExpandMessage","onExpandPrompt","onNextPrompt","onPreviousPrompt"]))),128))])]),_:1}),a.value?(O(),xe(r9,{key:0,"message-draft":b.value,"onUpdate:messageDraft":re[0]||(re[0]=ze=>b.value=ze),busy:x.value,error:S.value,"has-app-session":!!he(a.value),"prompt-index":g(u)(a.value),session:a.value,"session-title":Ae(a.value),onOpenAppSession:E,onRemoveQueued:W,onResolveApproval:ne,onRetryQueued:P,onRunAction:_,onSteerDraft:M,onSteerQueued:G},null,8,["message-draft","busy","error","has-app-session","prompt-index","session","session-title"])):pe("",!0)])):(O(),j("div",k9,"No AI sessions yet."))]))}}),T9=pa(A9,[["__scopeId","data-v-28f6ca67"]]),I9={class:"desktop-workspace"},R9={key:0,class:"desktop-tabs"},C9={class:"workspace-workbar"},O9={class:"workspace-tab-list"},M9=["draggable","onClick","onKeydown","onDragstart","onDrop"],N9=["aria-invalid","disabled","title","onKeydown","onBlur"],z9={key:1,class:"workspace-tab-title"},$9={class:"tab-kind"},D9=["onClick"],P9=["src","title"],B9={key:2,class:"gui-session"},L9=["src","title"],F9={key:1,class:"logs-empty"},U9={key:4,class:"logs-empty"},q9={key:2,class:"logs-empty"},H9={key:1,class:"desktop-empty"},V9=Re({__name:"WorkspaceTabs",setup(e){const t=hs(),n=$s(),r=fi(),s=di(),i=Se(()=>r.tabs.find(q=>q.id===r.activeTabId)),a=Se(()=>y0(i.value,s.data.value||[])),o=Oe(""),l=Oe(""),c=Oe(""),u=Oe(""),p=Oe(!1),m=Oe();function f(q){m.value=q instanceof HTMLInputElement?q:void 0}Bn(()=>{if(!s.data.value)return;const q=s.data.value||[];r.pruneSession(new Set(q.map(X=>X.id)),ti(q)),r.syncSessionTitles(q)});function y(q){return q.type==="app-vnc"||q.type==="app-web"||q.type==="app-tty"}function b(q){y(q)&&(r.setActive(q.id),l.value=q.id,c.value=q.title,u.value="",p.value=!1,ur(()=>m.value?.select()))}function x(){l.value="",c.value="",u.value="",p.value=!1}async function S(q){if(l.value!==q.id||!y(q)||p.value)return;const X=c.value.trim();if(!X){u.value="Session title is required.",ur(()=>m.value?.focus());return}if(X===q.title){x();return}p.value=!0;try{const ne=await sb(q.sessionId,X);r.syncSessionTitles([ne]),x()}catch(ne){p.value=!1,u.value=ne instanceof Error?ne.message:String(ne),ur(()=>m.value?.focus())}}function N(q){if(q.vnc?.backend==="kasmvnc"){const Ae=r.guiHidpi?E():1,se=new URLSearchParams({path:io(`/api/apps/sessions/${q.id}/web/websockify`),autoconnect:"1",resize:r.vncResizeMode,enable_hidpi:r.guiHidpi&&Ae>1?"1":"0",show_control_bar:"1"}),re=I(q,Ae);return r.vncResizeMode==="scale"&&re&&(se.set("forced_resolution_x",String(re.width)),se.set("forced_resolution_y",String(re.height))),n.token&&se.set("token",n.token),`${jn(q.vnc.webPath)}?${se.toString()}`}const X=n.token?`?token=${encodeURIComponent(n.token)}`:"",ne=q.vnc?.webPath?`${io(q.vnc.webPath)}${X}`:"",he=new URLSearchParams({path:ne,autoconnect:"1",resize:r.vncResizeMode});return jn(`/api/novnc/vnc.html?${he.toString()}`)}function z(q,X){if(X.vnc?.backend!=="kasmvnc")return;const ne=q.target;if(!(ne instanceof HTMLIFrameElement))return;ne.contentWindow?.postMessage({action:"resize",value:r.vncResizeMode},"*");const he=I(X,r.guiHidpi?E():1);r.vncResizeMode==="scale"&&he&&ne.contentWindow?.postMessage({action:"set_resolution",value_x:he.width,value_y:he.height},"*")}function I(q,X){if(!q.display)return;const ne=X>1?X:1;return{width:Math.max(1,Math.round(q.display.width/ne)),height:Math.max(1,Math.round(q.display.height/ne))}}function E(){return typeof window>"u"?1:window.devicePixelRatio||1}function _(q){const X=jn(q.web?.webPath||"");return n.token?`${X}${X.includes("?")?"&":"?"}token=${encodeURIComponent(n.token)}`:X}function L(q){return q.type==="ai-sessions"?"ai":q.type==="logs"?"logs":q.type==="shared-vnc"?"shared":q.type==="app-vnc"?"vnc":q.type==="app-web"?"web":"tty"}function M(q,X){o.value=X.id,q.dataTransfer?.setData("text/plain",X.id),q.dataTransfer&&(q.dataTransfer.effectAllowed="move")}function G(q,X){if(o.value){const he=(q.currentTarget instanceof HTMLElement?q.currentTarget:void 0)?.getBoundingClientRect(),Ae=he&&q.clientX>he.left+he.width/2?"after":"before";r.moveTab(o.value,X.id,Ae)}P()}function P(){o.value=""}async function W(q){if(q.type==="ai-sessions"){r.close(q.id);return}if(q.type==="app-vnc"||q.type==="app-web"||q.type==="app-tty"){await Os(q.sessionId),r.close(q.id),await t.invalidateQueries({queryKey:["status"]});return}r.close(q.id)}return(q,X)=>(O(),j("section",I9,[g(r).tabs.length?(O(),j("div",R9,[k("div",C9,[T(g(Rn),{class:"workspace-tab-list-scroll"},{default:D(()=>[k("div",O9,[(O(!0),j(lt,null,Ht(g(r).tabs,ne=>(O(),xe(g(Cp),{key:ne.id},{default:D(()=>[T(g(Mp),{"as-child":""},{default:D(()=>[k("div",{class:At(["workspace-tab",{active:g(r).activeTabId===ne.id,dragging:o.value===ne.id,editing:l.value===ne.id}]),role:"button",tabindex:"0",draggable:l.value!==ne.id,onClick:he=>g(r).setActive(ne.id),onKeydown:[Qs(he=>g(r).setActive(ne.id),["enter"]),Qs(en(he=>g(r).setActive(ne.id),["prevent"]),["space"])],onDragstart:he=>M(he,ne),onDragover:X[2]||(X[2]=en(()=>{},["prevent"])),onDragenter:X[3]||(X[3]=en(()=>{},["prevent"])),onDrop:en(he=>G(he,ne),["prevent"]),onDragend:P},[l.value===ne.id?Mo((O(),j("input",{key:0,ref_for:!0,ref:f,"onUpdate:modelValue":X[0]||(X[0]=he=>c.value=he),class:"workspace-tab-title-input","aria-invalid":!!u.value,disabled:p.value,title:u.value,maxlength:"120",onClick:X[1]||(X[1]=en(()=>{},["stop"])),onKeydown:[Qs(en(he=>S(ne),["stop","prevent"]),["enter"]),Qs(en(x,["stop","prevent"]),["escape"])],onBlur:he=>S(ne)},null,40,N9)),[[No,c.value]]):(O(),j("span",z9,K(ne.title),1)),k("span",$9,K(L(ne)),1),k("span",{class:"tab-close",title:"Close tab","aria-label":"Close tab",onClick:en(he=>W(ne),["stop"])},[T(g(Ms),{size:13,"stroke-width":2.2})],8,D9)],42,M9)]),_:2},1024),T(g(Op),null,{default:D(()=>[T(g(Gs),{disabled:!y(ne),onSelect:he=>b(ne)},{default:D(()=>[...X[5]||(X[5]=[fe("Rename session",-1)])]),_:1},8,["disabled","onSelect"])]),_:2},1024)]),_:2},1024))),128))])]),_:1})]),k("div",{class:At(["workspace-tab-panel desktop-tab-panel",{"workspace-log-panel":i.value?.type==="logs","workspace-ai-panel":i.value?.type==="ai-sessions"}])},[i.value?.type==="ai-sessions"?(O(),xe(T9,{key:0})):a.value&&i.value?(O(),j(lt,{key:1},[i.value.type==="app-tty"&&a.value.status==="running"?(O(),xe(Up,{key:0,session:a.value},null,8,["session"])):i.value.type==="app-web"&&a.value.status==="running"&&a.value.web?(O(),j("iframe",{key:1,class:"web-frame",src:_(a.value),title:a.value.title,allow:"clipboard-read; clipboard-write; fullscreen"},null,8,P9)):i.value.type==="app-vnc"||i.value.type==="shared-vnc"?(O(),j("div",B9,[a.value.vnc?(O(),j("iframe",{key:`${a.value.id}:${g(r).vncResizeMode}:${g(r).guiHidpi?"hidpi":"1x"}`,class:"vnc-frame workspace-vnc-frame",src:N(a.value),title:`${i.value.title} VNC`,allow:"clipboard-read; clipboard-write; fullscreen",onLoad:X[4]||(X[4]=ne=>z(ne,a.value))},null,40,L9)):(O(),j("p",F9,"VNC is unavailable for this session."))])):i.value.type==="logs"?(O(),xe(g(Rn),{key:3,class:"workspace-log-scroll"},{default:D(()=>[T(Fp,{session:a.value},null,8,["session"])]),_:1})):(O(),j("p",U9,"Runtime view is unavailable for this session state."))],64)):(O(),j("p",q9,"The selected workspace tab no longer has a running session."))],2)])):(O(),j("div",H9,[...X[6]||(X[6]=[k("h1",null,"TaskHandoff Desktop",-1),k("p",null,"Launch an app from the dock.",-1)])]))]))}});function qc(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,s])=>t.indexOf(+r)===-1).map(([r,s])=>s)}function vf(e,t="|"){return e.map(n=>g1(n)).join(t)}function Hc(e,t){return typeof t=="bigint"?t.toString():t}class j9{constructor(t){this._getter=t,this._value=void 0}get value(){const t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}}function Jo(e){return new j9(e)}function G9(e){return e==null}function Z0(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function Z9(e,t){const n=e/t,r=Math.round(n),s=4*Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-r)<s?0:n-r}function Pr(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function K0(e){const t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function Mr(e){return K0(e._zod.def)??e._zod.def.shape}function f1(e,t,n){Object.defineProperty(e,t,{get(){const r=n();return Pr(this,t,r),r},enumerable:!0,configurable:!0})}function h1(e,t,n){t in e?Pr(e,t,n):e[t]=n}function zs(e,t,n,r){const s=Mr(t);for(const i of n){const a=Object.getOwnPropertyDescriptor(s,i);a.enumerable&&(a.get?f1(e,i,()=>{const o=t._zod.def.shape[i];return r?r(o,i):o}):h1(e,i,r?r(a.value,i):a.value))}}function K9(e,t){for(const n of Reflect.ownKeys(t)){const r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?f1(e,n,()=>t[n]):h1(e,n,r.value))}}function In(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function W9(e){return JSON.stringify(e)}function Q9(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const p1="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function sa(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const J9=Jo(()=>{if(Zn.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function ii(e){if(sa(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(sa(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function m1(e){return ii(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const Y9=new Set(["string","number","symbol"]);function ai(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function gs(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function Ne(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function g1(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function X9(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}const v1={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},eS={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function tS(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const i={};return zs(i,e,Yo(e,t)),gs(e,In(n,{shape:i,checks:[]}))}function Yo(e,t){const n=Mr(e),r=[];for(const s of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,s)?.enumerable)throw new Error(`Unrecognized key: "${String(s)}"`);t[s]&&r.push(s)}return r}function nS(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const i=new Set(Yo(e,t)),a={};return zs(a,e,Reflect.ownKeys(Mr(e)).filter(o=>!i.has(o))),gs(e,In(n,{shape:a,checks:[]}))}function rS(e,t){if(!ii(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const s=Mr(e);for(const i of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(s,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return gs(e,In(e._zod.def,{shape:b1(e,t)}))}function b1(e,t){const n={};return zs(n,e,Reflect.ownKeys(Mr(e))),K9(n,t),n}function sS(e,t){if(!ii(t))throw new Error("Invalid input to safeExtend: expected a plain object");return gs(e,In(e._zod.def,{shape:b1(e,t)}))}function iS(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const n={};zs(n,e,Reflect.ownKeys(Mr(e))),zs(n,t,Reflect.ownKeys(Mr(t)));const r=In(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return gs(e,r)}function bf(e,t,n,r="partial"){const i=t._zod.def.checks;if(i&&i.length>0)throw new Error(`.${r}() cannot be used on object schemas containing refinements`);const o=n?new Set(Yo(t,n)):void 0,l={};return zs(l,t,Reflect.ownKeys(Mr(t)),e&&((c,u)=>o&&!o.has(u)?c:new e({type:"optional",innerType:c}))),gs(t,In(t._zod.def,{shape:l,checks:[]}))}function aS(e,t,n){const r=n?new Set(Yo(t,n)):void 0,s={};return zs(s,t,Reflect.ownKeys(Mr(t)),(i,a)=>r&&!r.has(a)?i:new e({type:"nonoptional",innerType:i})),gs(t,In(t._zod.def,{shape:s}))}function Ar(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function oS(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Js(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function Ci(e){return typeof e=="string"?e:e?.message}function yf(e){const t=[];for(const n of e??[]){const r=n._zod.def;if(!/_(length|size)$|_equals$/.test(r.check))break;const s=r.maximum??r.length??r.size;s>=0&&t.push([s,n])}return t}function Vc(e,t,n){var r;for(let s=t;s<e.length;s++)(r=e[s]).schema??(r.schema=n)}function cs(e,t,n){var r;const s=e.inst?._zod?.traits;s?.has("$ZodType")&&(s.has("$ZodCheck")?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);const i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,a=e.message?e.message:Ci(e.inst?._zod.def?.error?.(e))??Ci(i?.(e))??Ci(t?.error?.(e))??Ci(n.customError?.(e))??Ci(n.localeError?.(e))??"Invalid input",o={};for(const l of Object.keys(e))l==="inst"||l==="schema"||l==="continue"||l==="input"||l==="__proto__"||(o[l]=e[l]);return o.path??(o.path=[]),o.message=a,t?.reportInput&&(o.input=e.input),o}const lS=/[\uD800-\uDBFF]/;function W0(e){const t=e.length;if(!lS.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)===55296&&(e.charCodeAt(r+1)&64512)===56320&&(n--,r++);return n}function Q0(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function cS(e){const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";const n=e;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return t}function ia(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}function uS(e,t){for(const n in t){const r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):dS(e,n,r.value)}}function us(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function y1(e,t,n){return us(e,t,n,!1)}function w1(e,t){for(const n in e){const r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return us(this,n,r(this))},set(s){us(this,n,s)}})}return t}function dS(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:us(this,t,n.bind(this))},set(r){us(this,t,r)}})}function fS(e,t){const n=Object.getPrototypeOf(e);return t in n?void 0:n}let jl,Wr=!1;const hS={configurable:!0,get(){Wr=!0}};function ft(e,t,n){const r=Object.getPrototypeOf(e._zod);if(t in r&&jl!==e._zod){jl=void 0;return}jl=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,hS);const s=Wr;Wr=!1;try{const i=n(this);return Wr?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:i}),Wr=Wr||s,i}catch(i){throw delete this[t],Wr=Wr||s,i}},set(s){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:s})}})}function pS(e,t,n,r){const s=fS(e,t);s&&Object.defineProperty(s,t,{configurable:!0,get(){const i={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,i),i.value=n(this),Object.defineProperty(this,t,i),i.value},set(i){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:i})}})}const mS="~constantCatch";function gS(e){const t=()=>e;return t[mS]=!0,t}var wf;const Gl={value:void 0,enumerable:!1};let Sf="captureStackTrace"in Error?Error:null;function vS(e){const t=Sf;if(t){const n=t.stackTraceLimit;if(typeof n=="number"){try{t.stackTraceLimit=0}catch{return Sf=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function J(e,t,n,r){const s={};function i(m){this.def=m,this.constr=p,this.traits=new Set}i.prototype=s;const a=n,o=a&&new WeakSet;function l(m,f){if(m._zod){if(m._zod.traits.has(e))return}else{Gl.value=new i(f);try{Object.defineProperty(m,"_zod",Gl)}finally{Gl.value=void 0}}if(m._zod.traits.add(e),t(m,f),o){const b=Object.getPrototypeOf(m),x=m._zod.constr.prototype;let S=b;for(;S&&S!==x;)S=Object.getPrototypeOf(S);const N=S??b;o.has(N)||(o.add(N),uS(N,a))}const y=p.prototype;for(const b in y)Object.prototype.hasOwnProperty.call(y,b)&&(b in m||(m[b]=y[b].bind(m)))}const c=r?.Parent??Object;class u extends c{}Object.defineProperty(u,"name",{value:e});function p(m){const f=r?.Parent?vS(u):this;l(f,m);const y=f._zod.deferred;if(y){for(const x of y)x();f._zod.deferred=void 0}const b=globalThis.__zod_globalConfig?.postProcessor;return b&&b(f),f}return Object.defineProperty(p,"init",{value:l}),Object.defineProperty(p,Symbol.hasInstance,{value:m=>r?.Parent&&m instanceof r.Parent?!0:m?._zod?.traits?.has(e)}),Object.defineProperty(p,"name",{value:e}),p}class Cs extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class S1 extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(wf=globalThis).__zod_globalConfig??(wf.__zod_globalConfig={});const Zn=globalThis.__zod_globalConfig;function dr(e){return e&&Object.assign(Zn,e),Zn}function bS(){const e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Hc,2)),e.message}function yS(e){this._zod.message=e}const wS={get:bS,set:yS,enumerable:!0,configurable:!0},Zl={value:void 0,enumerable:!1},xf=new WeakSet([Object.prototype,Error.prototype]),SS=(e,t)=>{e.name="$ZodError",Zl.value=t,Object.defineProperty(e,"issues",Zl),Zl.value=void 0,Object.defineProperty(e,"message",wS);const n=Object.getPrototypeOf(e);xf.has(n)||(xf.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){const r=()=>this.message;return Object.defineProperty(this,"toString",{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,"toString",{value:r,configurable:!0,writable:!0})}}))},xS=J("$ZodError",SS);function kS(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function _S(e,t=n=>n.message){const n={},r=[];for(const s of e.issues)s.path.length>0?kS(n,s.path[0],()=>[]).push(t(s)):r.push(t(s));return{formErrors:r,fieldErrors:n}}function ES(e,t=n=>n.message){const n={_errors:[]},r=(s,i=[])=>{for(const a of s.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(o=>r({issues:o},[...i,...a.path]));else if(a.code==="invalid_key")r({issues:a.issues},[...i,...a.path]);else if(a.code==="invalid_element")r({issues:a.issues},[...i,...a.path]);else{const o=[...i,...a.path];if(o.length===0)n._errors.push(t(a));else{let l=n,c=0;for(;c<o.length;){const u=o[c],p=c===o.length-1;if(u==="_errors"){p&&l._errors.push(t(a)),c++;continue}Object.prototype.hasOwnProperty.call(l,u)||Object.defineProperty(l,u,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});const m=l[u];p&&m._errors.push(t(a)),l=m,c++}}}};return r(e),n}function Xo(e,t){return{callee:t?.callee??e,Err:t?.Err}}const J0=e=>{const t=(n,r,s,i)=>{const a=s?{...s,async:!1}:{async:!1},o=n._zod.run({value:r,issues:[]},a);if(o instanceof Promise)throw new Cs;if(o.issues.length){const l=new(i?.Err??e)(o.issues.map(c=>cs(c,a,dr())));throw p1(l,i?.callee??t),l}return o.value};return t},Y0=e=>{const t=async(n,r,s,i)=>{const a=s?{...s,async:!0}:{async:!0};let o=n._zod.run({value:r,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){const l=new(i?.Err??e)(o.issues.map(c=>cs(c,a,dr())));throw p1(l,i?.callee??t),l}return o.value};return t},X0=e=>(t,n,r)=>{const s=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise)throw new Cs;return i.issues.length?x1(e,i.issues,s):{success:!0,data:i.value}};function x1(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(s=>cs(s,n,dr()))),t=void 0,n=void 0),r},set error(s){r=s,t=void 0,n=void 0}}}const eu=e=>async(t,n,r)=>{const s=r?{...r,async:!0}:{async:!0};let i=t._zod.run({value:n,issues:[]},s);return i instanceof Promise&&(i=await i),i.issues.length?x1(e,i.issues,s):{success:!0,data:i.value}},AS=Symbol.for("zod.compile.invalid"),TS=Symbol.for("zod.compile.fallback"),IS=((e,t,n)=>{const r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==AS)return!0;if(r.definite===!0&&n===void 0)return!1}return RS(e,t,n)});function RS(e,t,n){const r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},s=e._zod.bag.fallbackRun;let i;if(s?(r[TS]=!0,i=s({value:t,issues:[]},r)):i=e._zod.run({value:t,issues:[]},r),i instanceof Promise)throw new Cs;return i.issues.length===0}const CS=async(e,t,n)=>{const r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0};let s=e._zod.run({value:t,issues:[]},r);return s instanceof Promise&&(s=await s),s.issues.length===0},OS=e=>{const t=J0(e),n=(r,s,i,a)=>{const o=i?{...i,direction:"backward"}:{direction:"backward"};return t(r,s,o,Xo(n,a))};return n},MS=e=>{const t=J0(e),n=(r,s,i,a)=>t(r,s,i,Xo(n,a));return n},NS=e=>{const t=Y0(e),n=async(r,s,i,a)=>{const o=i?{...i,direction:"backward"}:{direction:"backward"};return await t(r,s,o,Xo(n,a))};return n},zS=e=>{const t=Y0(e),n=async(r,s,i,a)=>await t(r,s,i,Xo(n,a));return n},$S=e=>(t,n,r)=>{const s=r?{...r,direction:"backward"}:{direction:"backward"};return X0(e)(t,n,s)},DS=e=>(t,n,r)=>X0(e)(t,n,r),PS=e=>async(t,n,r)=>{const s=r?{...r,direction:"backward"}:{direction:"backward"};return eu(e)(t,n,s)},BS=e=>async(t,n,r)=>eu(e)(t,n,r),LS=/^[cC][0-9a-z]{6,}$/,FS=/^[0-9a-z]+$/,US=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,qS=/^[0-9a-vA-V]{20}$/,HS=/^[A-Za-z0-9]{27}$/,VS=/^[a-zA-Z0-9_-]{21}$/;function jS(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}const GS=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ZS=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,kf=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,KS=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,WS="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function QS(){return new RegExp(WS,"u")}const JS=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,YS=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,XS=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,ex=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,tx=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,nx=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,rx=/^https?$/,sx=/^\+[1-9]\d{6,14}$/,k1="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";function ix(e){return new RegExp(`^${e}$`)}const ax=ix(k1);function jc(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function ox(e){return new RegExp(`^${jc(e)}$`)}function lx(e){const t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${jc({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,r=e.local?`${n}|${jc({precision:e.precision})}`:n;return new RegExp(`^${k1}T(?:${r})$`)}const cx=/^[\s\S]{0,}$/,ux=/^-?\d+$/,tu=/^-?\d+(?:\.\d+)?$/,dx=/^(?:true|false)$/i,fx=/^[^A-Z]*$/,hx=/^[^a-z]*$/,Sn=J("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),nu=e=>{const t=e.value;return!G9(t)&&t.length!==void 0},xo={number:"number",bigint:"bigint",object:"date"},_1=J("$ZodCheckLessThan",(e,t)=>{Sn.init(e,t);const n=xo[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:xo[typeof r.value]??n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),E1=J("$ZodCheckGreaterThan",(e,t)=>{Sn.init(e,t);const n=xo[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:xo[typeof r.value]??n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),px=J("$ZodCheckMultipleOf",(e,t)=>{Sn.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):Z9(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),mx=J("$ZodCheckNumberFormat",(e,t)=>{Sn.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[s,i]=v1[t.format];e._zod.check=a=>{const o=a.value;if(n){if(!Number.isInteger(o)){a.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:o,inst:e});return}if(!Number.isSafeInteger(o)){o>0?a.issues.push({input:o,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):a.issues.push({input:o,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}o<s&&a.issues.push({origin:"number",input:o,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),o>i&&a.issues.push({origin:"number",input:o,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),gx=J("$ZodCheckMaxLength",(e,t)=>{var n;Sn.init(e,t),(n=e._zod.def).when??(n.when=nu),e._zod.check=r=>{const s=r.value,i=s.length;if((typeof s=="string"&&i>t.maximum?W0(s):i)<=t.maximum)return;const o=Q0(s);r.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),vx=J("$ZodCheckMinLength",(e,t)=>{var n;Sn.init(e,t),(n=e._zod.def).when??(n.when=nu),e._zod.check=r=>{const s=r.value,i=s.length;if((typeof s=="string"&&i>=t.minimum&&i<t.minimum*2?W0(s):i)>=t.minimum)return;const o=Q0(s);r.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),bx=J("$ZodCheckLengthEquals",(e,t)=>{var n;Sn.init(e,t),(n=e._zod.def).when??(n.when=nu),e._zod.check=r=>{const s=r.value,i=s.length,a=typeof s=="string"&&i>=t.length&&i<=t.length*2?W0(s):i;if(a===t.length)return;const o=Q0(s),l=a>t.length;r.issues.push({origin:o,...l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),el=J("$ZodCheckStringFormat",(e,t)=>{var n,r;Sn.init(e,t),t.pattern?(n=e._zod).check??(n.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:t.format,input:s.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),yx=J("$ZodCheckRegex",(e,t)=>{el.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),wx=J("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=fx),el.init(e,t)}),Sx=J("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=hx),el.init(e,t)}),xx=J("$ZodCheckIncludes",(e,t)=>{Sn.init(e,t);const n=ai(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position},}${n}`:n);t.pattern=r,e._zod.check=s=>{s.value.includes(t.includes,t.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:s.value,inst:e,continue:!t.abort})}}),kx=J("$ZodCheckStartsWith",(e,t)=>{Sn.init(e,t);const n=new RegExp(`^${ai(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),_x=J("$ZodCheckEndsWith",(e,t)=>{Sn.init(e,t);const n=new RegExp(`.*${ai(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),Ex=J("$ZodCheckOverwrite",(e,t)=>{Sn.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class Ax{constructor(t=[],n={}){this.content=[],this.indent=0,this.args=t,this.closed=n}indented(t){this.indent+=1;try{t(this)}finally{this.indent-=1}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
|
|
325
326
|
`).filter(a=>a),s=Math.min(...r.map(a=>a.length-a.trimStart().length)),i=r.map(a=>a.slice(s)).map(a=>" ".repeat(this.indent*2)+a);for(const a of i)this.content.push(a)}compile(){const t=Function,n=this?.content??[""];return new t(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
326
327
|
${n.join(`
|
|
327
328
|
`)}
|
|
328
|
-
};`)(...Object.values(this.closed))}}const yx={major:4,minor:6,patch:7},zt=J("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=yx;const r=e._zod.def.checks,s=e._zod.traits.has("$ZodCheck")?[e,...r??[]]:r?.length?[...r]:[];for(const i of s)for(const a of i._zod.onattach)a(e);if(s.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const i=(o,l,c)=>{if(o.memo)return o;let u=Ar(o),f;for(const m of l){if(m._zod.def.when){if(X9(o)||!m._zod.def.when(o))continue}else if(u)continue;const h=o.issues.length,y=m._zod.check(o);if(y instanceof Promise&&c?.async===!1)throw new Rs;if(f||y instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await y,o.issues.length!==h&&(Vc(o.issues,h,e),u||(u=Ar(o,h)))});else{if(o.issues.length===h)continue;Vc(o.issues,h,e),u||(u=Ar(o,h))}}return f?f.then(()=>o):o},a=(o,l,c)=>{if(Ar(o))return o.aborted=!0,o;const u=i(l,s,c);if(u instanceof Promise){if(c.async===!1)throw new Rs;return u.then(f=>e._zod.parse(f,c))}return e._zod.parse(u,c)};e._zod.run=(o,l)=>{if(l.skipChecks)return e._zod.parse(o,l);if(l.direction==="backward"){const u=e._zod.parse({value:o.value,issues:[]},{...l,skipChecks:!0});return u instanceof Promise?u.then(f=>a(f,o,l)):a(u,o,l)}const c=e._zod.parse(o,l);if(c instanceof Promise){if(l.async===!1)throw new Rs;return c.then(u=>i(u,s,l))}return i(c,s,l)}}},{get"~standard"(){return m1(this,"~standard",k1(this))},set"~standard"(e){cs(this,"~standard",e)}}),x1=(e,t)=>e.issues.length?{issues:e.issues.map(n=>ls(n,t,dr()))}:{value:e.value};async function wx(e,t){const n={async:!0};return x1(await e._zod.run({value:t,issues:[]},n),n)}function k1(e){return{validate:t=>{const n={async:!1};try{const r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return x1(r,n)}catch{}return wx(e,t)},vendor:"zod",version:1}}const ru=J("$ZodString",(e,t)=>{zt.init(e,t),e._zod.pattern=t.pattern??tx,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Ot=J("$ZodStringFormat",(e,t)=>{el.init(e,t),ru.init(e,t)}),Sx=J("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=LS),Ot.init(e,t)}),xx=J("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=xf(r))}else t.pattern??(t.pattern=xf());Ot.init(e,t)}),kx=J("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=FS),Ot.init(e,t)}),_1=1,ko=2;function E1(e){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function _x(e,t){return!("normalize"in t)&&!("hostname"in t)&&!("protocol"in t)?E1(e)||ko:Ex(e,t)}function Ex(e,t){if(!t.normalize&&t.protocol?.source===WS.source&&!/^https?:\/\//i.test(e))return _1;try{if(typeof URL<"u"){const n=URL;if(typeof n.parse=="function")return n.parse(e)??ko}return new URL(e)}catch{return ko}}const Ax=/[\t\n\r]/g;function kf(e){return e.replace(Ax,"")}function Tx(e,t){return t.lastIndex=0,t.test(e.hostname)}function Ix(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}const Rx=J("$ZodURL",(e,t)=>{Ot.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),s=_x(r,t);if(s===_1){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});return}if(s===ko){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort});return}if(s===!0){n.value=kf(r);return}t.hostname&&!Tx(s,t.hostname)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!Ix(s,t.protocol)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?s.href:kf(r);return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),Cx=J("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=qS()),Ot.init(e,t)}),Ox=J("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw new Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?DS:PS(t.length)),Ot.init(e,t)}),Nx=J("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=OS),Ot.init(e,t)}),Mx=J("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=NS),Ot.init(e,t)}),zx=J("$ZodULID",(e,t)=>{t.pattern??(t.pattern=MS),Ot.init(e,t)}),$x=J("$ZodXID",(e,t)=>{t.pattern??(t.pattern=zS),Ot.init(e,t)}),Dx=J("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=$S),Ot.init(e,t)}),Px=J("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=ex(t)),Ot.init(e,t)}),Bx=J("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=YS),Ot.init(e,t)}),Lx=J("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=XS(t)),Ot.init(e,t)}),Fx=J("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=BS),Ot.init(e,t)}),Ux=J("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=HS),Ot.init(e,t)}),qx=/^[0-9a-fA-F:.]+$/;function A1(e){return qx.test(e)?E1(`http://[${e}]`):!1}const Hx=J("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=VS),Ot.init(e,t),e._zod.check=n=>{A1(n.value)||n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}),Vx=J("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=jS),Ot.init(e,t)});function jx(e){const t=e.split("/");if(t.length!==2)return!1;const[n,r]=t;if(!r)return!1;const s=Number(r);return`${s}`!==r||s<0||s>128?!1:A1(n)}const Gx=J("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=GS),Ot.init(e,t),e._zod.check=n=>{jx(n.value)||n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}});function T1(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const I1=/^[0-9a-zA-Z+/]*={0,2}$/,Zx=J("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=I1),Ot.init(e,t),e._zod.check=n=>{T1(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}}),su=/^[A-Za-z0-9_-]*$/;function Kx(e){if(!su.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return T1(n)}const Wx=J("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=su),Ot.init(e,t),e._zod.check=n=>{Kx(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Qx=J("$ZodE164",(e,t)=>{t.pattern??(t.pattern=QS),Ot.init(e,t)});function Jx(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const s=JSON.parse(atob(r));return!("typ"in s&&s?.typ!=="JWT"||!s.alg||t&&(!("alg"in s)||s.alg!==t))}catch{return!1}}const Yx=J("$ZodJWT",(e,t)=>{Ot.init(e,t),e._zod.check=n=>{Jx(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),R1=J("$ZodNumber",(e,t)=>{zt.init(e,t),e._zod.pattern=tu,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const s=n.value;if(typeof s=="number"&&!Number.isNaN(s)&&Number.isFinite(s))return n;const i=typeof s=="number"?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:String(s):void 0;return n.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...i?{received:i}:{}}),n}}),Xx=J("$ZodNumberFormat",(e,t)=>{ox.init(e,t),R1.init(e,t)}),ek=J("$ZodBoolean",(e,t)=>{zt.init(e,t),e._zod.pattern=rx,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const s=n.value;return typeof s=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),n}}),tk=J("$ZodUnknown",(e,t)=>{zt.init(e,t),e._zod.parse=n=>n}),nk=J("$ZodNever",(e,t)=>{zt.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function rk(e,t){const n=bf(e._zod.def.checks);if(!n.length)return;const r=Math.min(...n.map(i=>i[0])),s=e._zod.parse;e._zod.parse=(i,a)=>{const o=t(i.value);if(o>r&&!a?.skipChecks&&a?.direction!=="backward"){for(const[l,c]of bf(e._zod.def.checks))if(o>l&&c._zod.def.when(i)){const u=i.issues.length;return c._zod.check(i),i.issues[u].continue=!1,Vc(i.issues,u,e),i}}return s(i,a)}}const sk=e=>Array.isArray(e)?e.length:-1;function _f(e,t,n){e.issues.length&&t.issues.push(...Js(n,e.issues)),t.value[n]=e.value}const ik=J("$ZodArray",(e,t)=>{zt.init(e,t);const n=Zn.memoizer;n?.attach(e),e._zod.parse=(r,s)=>{const i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=n?n.alloc(e,r,Array(i.length),s):Array(i.length);const a=[],o=s?.abortEarly;for(let l=0;l<i.length;l++){const c=i[l],u=t.element._zod.run({value:c,issues:[]},s);if(u instanceof Promise)a.push(u.then(f=>_f(f,r,l)));else if(_f(u,r,l),o&&u.issues.length!==0&&Ar(u))break}return a.length?Promise.all(a).then(()=>r):r},rk(e,sk)});function _o(e,t,n,r,s,i){const a=n in r,o=i==="optional";if(!(!a&&o&&s==="optional")){if(e.issues.length){if(s!==void 0&&o&&!a)return;t.issues.push(...Js(n,e.issues))}if(!a&&s===void 0){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}e.value===void 0?(a||s==="defaulted"&&!o)&&(t.value[n]=void 0):t.value[n]=e.value}}const ak=[];function C1(e){const t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:ak,s=r.length?[...t,...r]:t;for(const a of s)if(!e.shape?.[a]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(a)}": expected a Zod schema`);const i=j9(e.shape);return{...e,allKeys:s,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(i)}}function O1(e,t,n,r,s,i,a){const o=[],l=s.keySet,c=s.catchall._zod,u=c.def.type,f=c.optin,m=c.optout;let h=0;for(const y in t){if(a&&n.issues.length!==h){if(Ar(n,h))break;h=n.issues.length}if(l.has(y))continue;if(y==="__proto__"){u==="never"&&o.push(y);continue}if(u==="never"){o.push(y);continue}const b=c.run({value:t[y],issues:[]},r);b instanceof Promise?e.push(b.then(S=>_o(S,n,y,t,f,m))):_o(b,n,y,t,f,m)}return o.length&&n.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:i,continue:!0}),e.length?Promise.all(e).then(()=>n):n}const ok=J("$ZodObject",(e,t)=>{zt.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape"),r=n?.get?n.get.raw:t.shape??{};if(r){const c=()=>{const u={...r};return Object.defineProperty(t,"shape",{value:u}),c.raw=u,u};c.raw=r,Object.defineProperty(t,"shape",{get:c})}const s=Jo(()=>C1(t));ft(e,"propValues",c=>{const u=c.def.shape,f={};for(const m in u){const h=u[m]._zod;if(h.values){Object.prototype.hasOwnProperty.call(f,m)||Dr(f,m,new Set);for(const y of h.values)f[m].add(y);h.optin!==void 0&&f[m].add(void 0)}}return f});const i=sa,a=t.catchall;let o;const l=Zn.memoizer;l?.attach(e),e._zod.parse=(c,u)=>{o??(o=s.value);const f=c.value;if(!i(f))return c.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),c;c.value=l?l.alloc(e,c,{},u):{};const m=[],h=o.shape,y=u?.abortEarly;let b=c.issues.length;for(const S of o.allKeys){if(y&&c.issues.length!==b){if(Ar(c,b))break;b=c.issues.length}if(S==="__proto__")continue;const k=h[S],P=k._zod.optin,z=k._zod.optout,I=k._zod.run({value:f[S],issues:[]},u);I instanceof Promise?m.push(I.then(E=>_o(E,c,S,f,P,z))):_o(I,c,S,f,P,z)}return a?O1(m,f,c,u,s.value,e,y===!0):m.length?Promise.all(m).then(()=>c):c}}),lk=J("$ZodObjectJIT",(e,t)=>{ok.init(e,t);const n=e._zod.parse,r=Jo(()=>C1(t)),s=Zn.memoizer,i=h=>{const y=r.value,b=y.symbolKeys,S=new bx(["payload","ctx"],{shape:h,inst:e,memo:s,syms:b}),k=E=>`shape[${E}]._zod.run({ value: input[${E}], issues: [] }, ctx)`,P=(E,_)=>`
|
|
329
|
+
};`)(...Object.values(this.closed))}}const Tx={major:4,minor:6,patch:7},$t=J("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Tx;const r=e._zod.def.checks,s=e._zod.traits.has("$ZodCheck")?[e,...r??[]]:r?.length?[...r]:[];for(const i of s)for(const a of i._zod.onattach)a(e);if(s.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const i=(o,l,c)=>{if(o.memo)return o;let u=Ar(o),p;for(const m of l){if(m._zod.def.when){if(oS(o)||!m._zod.def.when(o))continue}else if(u)continue;const f=o.issues.length,y=m._zod.check(o);if(y instanceof Promise&&c?.async===!1)throw new Cs;if(p||y instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await y,o.issues.length!==f&&(Vc(o.issues,f,e),u||(u=Ar(o,f)))});else{if(o.issues.length===f)continue;Vc(o.issues,f,e),u||(u=Ar(o,f))}}return p?p.then(()=>o):o},a=(o,l,c)=>{if(Ar(o))return o.aborted=!0,o;const u=i(l,s,c);if(u instanceof Promise){if(c.async===!1)throw new Cs;return u.then(p=>e._zod.parse(p,c))}return e._zod.parse(u,c)};e._zod.run=(o,l)=>{if(l.skipChecks)return e._zod.parse(o,l);if(l.direction==="backward"){const u=e._zod.parse({value:o.value,issues:[]},{...l,skipChecks:!0});return u instanceof Promise?u.then(p=>a(p,o,l)):a(u,o,l)}const c=e._zod.parse(o,l);if(c instanceof Promise){if(l.async===!1)throw new Cs;return c.then(u=>i(u,s,l))}return i(c,s,l)}}},{get"~standard"(){return y1(this,"~standard",T1(this))},set"~standard"(e){us(this,"~standard",e)}}),A1=(e,t)=>e.issues.length?{issues:e.issues.map(n=>cs(n,t,dr()))}:{value:e.value};async function Ix(e,t){const n={async:!0};return A1(await e._zod.run({value:t,issues:[]},n),n)}function T1(e){return{validate:t=>{const n={async:!1};try{const r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return A1(r,n)}catch{}return Ix(e,t)},vendor:"zod",version:1}}const ru=J("$ZodString",(e,t)=>{$t.init(e,t),e._zod.pattern=t.pattern??cx,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Ot=J("$ZodStringFormat",(e,t)=>{el.init(e,t),ru.init(e,t)}),Rx=J("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=ZS),Ot.init(e,t)}),Cx=J("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=kf(r))}else t.pattern??(t.pattern=kf());Ot.init(e,t)}),Ox=J("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=KS),Ot.init(e,t)}),I1=1,ko=2;function R1(e){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function Mx(e,t){return!("normalize"in t)&&!("hostname"in t)&&!("protocol"in t)?R1(e)||ko:Nx(e,t)}function Nx(e,t){if(!t.normalize&&t.protocol?.source===rx.source&&!/^https?:\/\//i.test(e))return I1;try{if(typeof URL<"u"){const n=URL;if(typeof n.parse=="function")return n.parse(e)??ko}return new URL(e)}catch{return ko}}const zx=/[\t\n\r]/g;function _f(e){return e.replace(zx,"")}function $x(e,t){return t.lastIndex=0,t.test(e.hostname)}function Dx(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}const Px=J("$ZodURL",(e,t)=>{Ot.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),s=Mx(r,t);if(s===I1){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});return}if(s===ko){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort});return}if(s===!0){n.value=_f(r);return}t.hostname&&!$x(s,t.hostname)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!Dx(s,t.protocol)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?s.href:_f(r);return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),Bx=J("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=QS()),Ot.init(e,t)}),Lx=J("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw new Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?VS:jS(t.length)),Ot.init(e,t)}),Fx=J("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=LS),Ot.init(e,t)}),Ux=J("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=FS),Ot.init(e,t)}),qx=J("$ZodULID",(e,t)=>{t.pattern??(t.pattern=US),Ot.init(e,t)}),Hx=J("$ZodXID",(e,t)=>{t.pattern??(t.pattern=qS),Ot.init(e,t)}),Vx=J("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=HS),Ot.init(e,t)}),jx=J("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=lx(t)),Ot.init(e,t)}),Gx=J("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=ax),Ot.init(e,t)}),Zx=J("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=ox(t)),Ot.init(e,t)}),Kx=J("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=GS),Ot.init(e,t)}),Wx=J("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=JS),Ot.init(e,t)}),Qx=/^[0-9a-fA-F:.]+$/;function C1(e){return Qx.test(e)?R1(`http://[${e}]`):!1}const Jx=J("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=YS),Ot.init(e,t),e._zod.check=n=>{C1(n.value)||n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}),Yx=J("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=XS),Ot.init(e,t)});function Xx(e){const t=e.split("/");if(t.length!==2)return!1;const[n,r]=t;if(!r)return!1;const s=Number(r);return`${s}`!==r||s<0||s>128?!1:C1(n)}const ek=J("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=ex),Ot.init(e,t),e._zod.check=n=>{Xx(n.value)||n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}});function O1(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const M1=/^[0-9a-zA-Z+/]*={0,2}$/,tk=J("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=M1),Ot.init(e,t),e._zod.check=n=>{O1(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}}),su=/^[A-Za-z0-9_-]*$/;function nk(e){if(!su.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return O1(n)}const rk=J("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=su),Ot.init(e,t),e._zod.check=n=>{nk(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),sk=J("$ZodE164",(e,t)=>{t.pattern??(t.pattern=sx),Ot.init(e,t)});function ik(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const s=JSON.parse(atob(r));return!("typ"in s&&s?.typ!=="JWT"||!s.alg||t&&(!("alg"in s)||s.alg!==t))}catch{return!1}}const ak=J("$ZodJWT",(e,t)=>{Ot.init(e,t),e._zod.check=n=>{ik(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),N1=J("$ZodNumber",(e,t)=>{$t.init(e,t),e._zod.pattern=tu,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const s=n.value;if(typeof s=="number"&&!Number.isNaN(s)&&Number.isFinite(s))return n;const i=typeof s=="number"?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:String(s):void 0;return n.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...i?{received:i}:{}}),n}}),ok=J("$ZodNumberFormat",(e,t)=>{mx.init(e,t),N1.init(e,t)}),lk=J("$ZodBoolean",(e,t)=>{$t.init(e,t),e._zod.pattern=dx,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const s=n.value;return typeof s=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),n}}),ck=J("$ZodUnknown",(e,t)=>{$t.init(e,t),e._zod.parse=n=>n}),uk=J("$ZodNever",(e,t)=>{$t.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function dk(e,t){const n=yf(e._zod.def.checks);if(!n.length)return;const r=Math.min(...n.map(i=>i[0])),s=e._zod.parse;e._zod.parse=(i,a)=>{const o=t(i.value);if(o>r&&!a?.skipChecks&&a?.direction!=="backward"){for(const[l,c]of yf(e._zod.def.checks))if(o>l&&c._zod.def.when(i)){const u=i.issues.length;return c._zod.check(i),i.issues[u].continue=!1,Vc(i.issues,u,e),i}}return s(i,a)}}const fk=e=>Array.isArray(e)?e.length:-1;function Ef(e,t,n){e.issues.length&&t.issues.push(...Js(n,e.issues)),t.value[n]=e.value}const hk=J("$ZodArray",(e,t)=>{$t.init(e,t);const n=Zn.memoizer;n?.attach(e),e._zod.parse=(r,s)=>{const i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=n?n.alloc(e,r,Array(i.length),s):Array(i.length);const a=[],o=s?.abortEarly;for(let l=0;l<i.length;l++){const c=i[l],u=t.element._zod.run({value:c,issues:[]},s);if(u instanceof Promise)a.push(u.then(p=>Ef(p,r,l)));else if(Ef(u,r,l),o&&u.issues.length!==0&&Ar(u))break}return a.length?Promise.all(a).then(()=>r):r},dk(e,fk)});function _o(e,t,n,r,s,i){const a=n in r,o=i==="optional";if(!(!a&&o&&s==="optional")){if(e.issues.length){if(s!==void 0&&o&&!a)return;t.issues.push(...Js(n,e.issues))}if(!a&&s===void 0){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}e.value===void 0?(a||s==="defaulted"&&!o)&&(t.value[n]=void 0):t.value[n]=e.value}}const pk=[];function z1(e){const t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:pk,s=r.length?[...t,...r]:t;for(const a of s)if(!e.shape?.[a]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(a)}": expected a Zod schema`);const i=X9(e.shape);return{...e,allKeys:s,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(i)}}function $1(e,t,n,r,s,i,a){const o=[],l=s.keySet,c=s.catchall._zod,u=c.def.type,p=c.optin,m=c.optout;let f=0;for(const y in t){if(a&&n.issues.length!==f){if(Ar(n,f))break;f=n.issues.length}if(l.has(y))continue;if(y==="__proto__"){u==="never"&&o.push(y);continue}if(u==="never"){o.push(y);continue}const b=c.run({value:t[y],issues:[]},r);b instanceof Promise?e.push(b.then(x=>_o(x,n,y,t,p,m))):_o(b,n,y,t,p,m)}return o.length&&n.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:i,continue:!0}),e.length?Promise.all(e).then(()=>n):n}const mk=J("$ZodObject",(e,t)=>{$t.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape"),r=n?.get?n.get.raw:t.shape??{};if(r){const c=()=>{const u={...r};return Object.defineProperty(t,"shape",{value:u}),c.raw=u,u};c.raw=r,Object.defineProperty(t,"shape",{get:c})}const s=Jo(()=>z1(t));ft(e,"propValues",c=>{const u=c.def.shape,p={};for(const m in u){const f=u[m]._zod;if(f.values){Object.prototype.hasOwnProperty.call(p,m)||Pr(p,m,new Set);for(const y of f.values)p[m].add(y);f.optin!==void 0&&p[m].add(void 0)}}return p});const i=sa,a=t.catchall;let o;const l=Zn.memoizer;l?.attach(e),e._zod.parse=(c,u)=>{o??(o=s.value);const p=c.value;if(!i(p))return c.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),c;c.value=l?l.alloc(e,c,{},u):{};const m=[],f=o.shape,y=u?.abortEarly;let b=c.issues.length;for(const x of o.allKeys){if(y&&c.issues.length!==b){if(Ar(c,b))break;b=c.issues.length}if(x==="__proto__")continue;const S=f[x],N=S._zod.optin,z=S._zod.optout,I=S._zod.run({value:p[x],issues:[]},u);I instanceof Promise?m.push(I.then(E=>_o(E,c,x,p,N,z))):_o(I,c,x,p,N,z)}return a?$1(m,p,c,u,s.value,e,y===!0):m.length?Promise.all(m).then(()=>c):c}}),gk=J("$ZodObjectJIT",(e,t)=>{mk.init(e,t);const n=e._zod.parse,r=Jo(()=>z1(t)),s=Zn.memoizer,i=f=>{const y=r.value,b=y.symbolKeys,x=new Ax(["payload","ctx"],{shape:f,inst:e,memo:s,syms:b}),S=E=>`shape[${E}]._zod.run({ value: input[${E}], issues: [] }, ctx)`,N=(E,_)=>`
|
|
329
330
|
let ${E}_ab = false;
|
|
330
331
|
for (let i = 0; i < ${E}.issues.length; i++) {
|
|
331
332
|
const iss = ${E}.issues[i];
|
|
@@ -336,10 +337,10 @@ ${n.join(`
|
|
|
336
337
|
if (${E}_ab && ctx && ctx.abortEarly) {
|
|
337
338
|
payload.value = newResult;
|
|
338
339
|
return payload;
|
|
339
|
-
}`;
|
|
340
|
-
const ${_}_present = ${
|
|
340
|
+
}`;x.write("const input = payload.value;");const z=Object.create(null);let I=0;for(const E of y.allKeys)z[E]=`key_${I++}`;x.write(s?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(const E of y.allKeys){if(E==="__proto__")continue;const _=z[E],L=typeof E=="symbol"?`syms[${b.indexOf(E)}]`:W9(E),M=`${L} in input`,G=f[E],P=G?._zod?.optin,W=P!==void 0,q=G?._zod?.optout==="optional";if(x.write(`const ${_} = ${S(L)};`),W&&q){const X=P==="optional"?`${_}_present`:`${_}.value !== undefined || ${_}_present`;x.write(`
|
|
341
|
+
const ${_}_present = ${M};
|
|
341
342
|
if (!${_}.issues.length || ${_}_present) {
|
|
342
|
-
if (${_}.issues.length) {${
|
|
343
|
+
if (${_}.issues.length) {${N(_,L)}
|
|
343
344
|
}
|
|
344
345
|
|
|
345
346
|
if (${X}) {
|
|
@@ -347,16 +348,16 @@ ${n.join(`
|
|
|
347
348
|
}
|
|
348
349
|
}
|
|
349
350
|
|
|
350
|
-
`)}else W?(
|
|
351
|
-
if (${_}.issues.length) {${
|
|
351
|
+
`)}else W?(x.write(`
|
|
352
|
+
if (${_}.issues.length) {${N(_,L)}
|
|
352
353
|
}
|
|
353
|
-
`),
|
|
354
|
-
if (${_}.value !== undefined || ${
|
|
354
|
+
`),P==="defaulted"?x.write(`newResult[${L}] = ${_}.value;`):x.write(`
|
|
355
|
+
if (${_}.value !== undefined || ${M}) {
|
|
355
356
|
newResult[${L}] = ${_}.value;
|
|
356
357
|
}
|
|
357
|
-
`)):
|
|
358
|
-
const ${_}_present = ${
|
|
359
|
-
if (${_}.issues.length) {${
|
|
358
|
+
`)):x.write(`
|
|
359
|
+
const ${_}_present = ${M};
|
|
360
|
+
if (${_}.issues.length) {${N(_,L)}
|
|
360
361
|
}
|
|
361
362
|
if (!${_}_present && !${_}.issues.length) {
|
|
362
363
|
payload.issues.push({
|
|
@@ -375,6 +376,6 @@ ${n.join(`
|
|
|
375
376
|
newResult[${L}] = ${_}.value;
|
|
376
377
|
}
|
|
377
378
|
|
|
378
|
-
`)}return S.write("payload.value = newResult;"),S.write("return payload;"),S.compile()};let a;const o=sa,l=!Zn.jitless,u=l&&H9.value,f=t.catchall;let m;e._zod.parse=(h,y)=>{m??(m=r.value);const b=h.value;return o(b)?l&&u&&y?.async===!1&&y.jitless!==!0?(a||(a=i(t.shape)),h=a(h,y),f?O1([],b,h,y,m,e,y?.abortEarly===!0):h):n(h,y):(h.issues.push({expected:"object",code:"invalid_type",input:b,inst:e}),h)}});function Ef(e,t,n,r){for(const i of e)if(i.issues.length===0)return t.value=i.value,t;const s=e.filter(i=>!Ar(i));return s.length===1?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(i=>i.issues.map(a=>ls(a,r,dr())))}),t)}const N1=J("$ZodUnion",(e,t)=>{zt.init(e,t),ft(e,"optin",r=>r.def.options.some(s=>s._zod.optin==="defaulted")?"defaulted":r.def.options.some(s=>s._zod.optin!==void 0)?"optional":void 0),ft(e,"optout",r=>r.def.options.some(s=>s._zod.optout==="optional")?"optional":void 0),ft(e,"values",r=>{if(r.def.options.every(s=>s._zod.values))return new Set(r.def.options.flatMap(s=>Array.from(s._zod.values)))}),ft(e,"pattern",r=>{if(r.def.options.every(s=>s._zod.pattern)){const s=r.def.options.map(i=>i._zod.pattern);return new RegExp(`^(${s.map(i=>Z0(i.source)).join("|")})$`)}});const n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,s)=>{if(n)return n(r,s);let i=!1;const a=[];for(const o of t.options){const l=o._zod.run({value:r.value,issues:[]},s);if(l instanceof Promise)a.push(l),i=!0;else{if(l.issues.length===0)return l;a.push(l)}}return i?Promise.all(a).then(o=>Ef(o,r,e,s)):Ef(a,r,e,s)}});function ck(e){const t=new Map;for(const n of e.options){const r=n._zod.propValues?.[e.discriminator];if(!r||r.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(n)}"`);for(const s of r)if(t.has(s)){if(s!==void 0)throw new Error(`Duplicate discriminator value "${String(s)}"`);t.set(s,null)}else t.set(s,n)}return t}const uk=J("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,N1.init(e,t);const n=e._zod.parse;ft(e,"propValues",s=>{const i={};let a=0;for(const o of s.def.options){const l=o._zod.propValues;if(!l||Object.keys(l).length===0)throw new Error(`Invalid discriminated union option at index "${s.def.options.indexOf(o)}"`);l[s.def.discriminator]?.has(void 0)&&a++;for(const[c,u]of Object.entries(l)){Object.prototype.hasOwnProperty.call(i,c)||Dr(i,c,new Set);for(const f of u)i[c].add(f)}}return!s.def.unionFallback&&a>1&&i[s.def.discriminator]?.delete(void 0),i}),t.options.forEach((s,i)=>{const a=K0(s._zod.def);if(a&&!Object.prototype.hasOwnProperty.call(a,t.discriminator))throw new Error(`Invalid discriminated union option at index "${i}"`)});const r=Jo(()=>ck(t));e._zod.parse=(s,i)=>{const a=s.value;if(!sa(a))return s.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),s;const o=a?.[t.discriminator],l=r.value.get(o);return l&&(o!==void 0||i.direction!=="backward")?l._zod.run(s,i):t.unionFallback||i.direction==="backward"?n(s,i):(s.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(r.value.keys()).filter(c=>r.value.get(c)!==null),input:a,path:[t.discriminator],inst:e}),s)}}),dk=J("$ZodIntersection",(e,t)=>{zt.init(e,t),e._zod.parse=(n,r)=>{const s=n.value,i=t.left._zod.run({value:s,issues:[]},r),a=t.right._zod.run({value:s,issues:[]},r);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([l,c])=>Af(n,l,c)):Af(n,i,a)}});function Gc(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ii(e)&&ii(t)){const n=Object.keys(t),r=Object.keys(e).filter(i=>n.indexOf(i)!==-1),s={...e,...t};Object.prototype.hasOwnProperty.call(s,"__proto__")&&delete s.__proto__;for(const i of r){if(i==="__proto__")continue;const a=Gc(e[i],t[i]);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};s[i]=a.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const s=e[r],i=t[r],a=Gc(s,i);if(!a.valid)return{valid:!1,mergeErrorPath:[r,...a.mergeErrorPath]};n.push(a.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Af(e,t,n){const r=new Map;let s;const i=new Map,a=(c,u)=>{let f;if(c.code==="unrecognized_keys"&&!c.path?.length)s??(s=c),f=c.keys;else if(c.code==="invalid_key"&&c.origin==="record"&&c.path?.length===1){const m=String(c.path[0]);i.has(m)||i.set(m,c),f=[m]}else return!1;for(const m of f)r.has(m)||r.set(m,{}),r.get(m)[u]=!0;return!0};for(const c of t.issues)a(c,"l")||e.issues.push(c);for(const c of n.issues)a(c,"r")||e.issues.push(c);const o=[...r].filter(([,c])=>c.l&&c.r).map(([c])=>c);if(o.length){const c=s?o.filter(u=>s.keys.includes(u)):[];c.length&&e.issues.push({...s,keys:c});for(const u of o)!c.includes(u)&&i.has(u)&&e.issues.push(i.get(u))}const l=Gc(t.value,n.value);if(!l.valid){if(Ar(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(l.mergeErrorPath)}`)}return e.value=l.data,e}const fk=J("$ZodRecord",(e,t)=>{zt.init(e,t);const n=Zn.memoizer;n?.attach(e),e._zod.parse=(r,s)=>{const i=r.value;if(!ii(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;const a=[],o=t.keyType._zod.values;if(o&&!t.partial){r.value=n?n.alloc(e,r,{},s):{};const l=new Set;for(const u of o)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){if(l.add(typeof u=="number"?u.toString():u),u==="__proto__")continue;const f=t.keyType._zod.run({value:u,issues:[]},s);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(f.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(y=>ls(y,s,dr())),input:u,path:[u],inst:e});continue}const m=f.value;if(m==="__proto__")continue;const h=t.valueType._zod.run({value:i[u],issues:[]},s);h instanceof Promise?a.push(h.then(y=>{y.issues.length&&r.issues.push(...Js(u,y.issues)),r.value[m]=y.value})):(h.issues.length&&r.issues.push(...Js(u,h.issues)),r.value[m]=h.value)}let c;for(const u in i)if(!l.has(u))if(t.mode==="loose"){if(u==="__proto__")continue;r.value[u]=i[u]}else c=c??[],c.push(u);c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:c,continue:!0})}else{r.value=n?n.alloc(e,r,{},s):{};let l;for(const c of Reflect.ownKeys(i)){if(c==="__proto__"||!Object.prototype.propertyIsEnumerable.call(i,c))continue;let u=t.keyType._zod.run({value:c,issues:[]},s);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof c=="string"&&tu.test(c)&&u.issues.length){const y=t.keyType._zod.run({value:Number(c),issues:[]},s);if(y instanceof Promise)throw new Error("Async schemas not supported in object keys currently");y.issues.length===0&&(u=y)}if(u.issues.length){t.mode==="loose"?r.value[c]=i[c]:o?(l=l??[],l.push(c)):r.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(y=>ls(y,s,dr())),input:c,path:[c],inst:e});continue}const m=u.value;if(m==="__proto__")continue;const h=t.valueType._zod.run({value:i[c],issues:[]},s);h instanceof Promise?a.push(h.then(y=>{y.issues.length&&r.issues.push(...Js(c,y.issues)),r.value[m]=y.value})):(h.issues.length&&r.issues.push(...Js(c,h.issues)),r.value[m]=h.value)}l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:l,continue:!0})}return a.length?Promise.all(a).then(()=>r):r}}),hk=J("$ZodEnum",(e,t)=>{zt.init(e,t);const n=qc(t.entries),r=new Set(n);e._zod.values=r,ft(e,"pattern",s=>{const i=qc(s.def.entries).filter(a=>V9.has(typeof a));return new RegExp(i.length?`^(${i.map(a=>ai(a.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(s,i)=>{const a=s.value;return r.has(a)||s.issues.push({code:"invalid_value",values:n,input:a,inst:e}),s}}),pk=J("$ZodLiteral",(e,t)=>{zt.init(e,t);const n=new Set(t.values);e._zod.values=n,ft(e,"pattern",r=>{const s=r.def.values;return new RegExp(s.length?`^(${s.map(i=>typeof i=="string"?ai(i):i?ai(i.toString()):String(i)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(r,s)=>{const i=r.value;return n.has(i)||r.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),r}}),mk=J("$ZodTransform",(e,t)=>{zt.init(e,t),e._zod.optin="optional",Zn.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new v1(e.constructor.name);const s=t.transform(n.value,n);if(r.async)return(s instanceof Promise?s:Promise.resolve(s)).then(a=>(n.value=a,n));if(s instanceof Promise)throw new Rs;return n.value=s,n}});function Tf(e,t){return e.value=t.issues.length?void 0:t.value,e}const M1=J("$ZodOptional",(e,t)=>{zt.init(e,t),ft(e,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",ft(e,"values",n=>{const r=n.def.innerType._zod.values;return r?new Set([...r,void 0]):void 0}),ft(e,"pattern",n=>{const r=n.def.innerType._zod.pattern;return r?new RegExp(`^(${Z0(r.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(n.value===void 0){if(t.innerType._zod.optin!=="defaulted")return n;const s=t.innerType._zod.run({value:n.value,issues:[]},r);return s instanceof Promise?s.then(i=>Tf(n,i)):Tf(n,s)}return t.innerType._zod.run(n,r)}}),gk=J("$ZodExactOptional",(e,t)=>{M1.init(e,t),ft(e,"values",n=>n.def.innerType._zod.values),ft(e,"pattern",n=>n.def.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),vk=J("$ZodNullable",(e,t)=>{zt.init(e,t),ft(e,"optin",n=>n.def.innerType._zod.optin),ft(e,"optout",n=>n.def.innerType._zod.optout),ft(e,"pattern",n=>{const r=n.def.innerType._zod.pattern;return r?new RegExp(`^(${Z0(r.source)}|null)$`):void 0}),ft(e,"values",n=>n.def.innerType._zod.values?new Set([...n.def.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),bk=J("$ZodDefault",(e,t)=>{zt.init(e,t),e._zod.optin="defaulted",ft(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>If(i,t)):If(s,t)}});function If(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const yk=J("$ZodPrefault",(e,t)=>{zt.init(e,t),e._zod.optin="defaulted",ft(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),wk=J("$ZodNonOptional",(e,t)=>{zt.init(e,t),ft(e,"values",n=>{const r=n.def.innerType._zod.values;return r?new Set([...r].filter(s=>s!==void 0)):void 0}),e._zod.parse=(n,r)=>{const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>Rf(i,e)):Rf(s,e)}});function Rf(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function Cf(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(s=>ls(s,r,dr()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}const Sk=J("$ZodCatch",(e,t)=>{zt.init(e,t),ft(e,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),ft(e,"optout",n=>n.def.innerType._zod.optout),ft(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const s=t.innerType._zod.run({value:n.value,issues:[]},r);return s instanceof Promise?s.then(i=>Cf(n,i,t,r)):Cf(n,s,t,r)}}),z1=J("$ZodPipe",(e,t)=>{zt.init(e,t),ft(e,"values",n=>n.def.in._zod.values),ft(e,"optin",n=>n.def.in._zod.optin),ft(e,"optout",n=>n.def.out._zod.optout),ft(e,"propValues",n=>n.def.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const i=t.out._zod.run(n,r);return i instanceof Promise?i.then(a=>Ua(a,t.in,r)):Ua(i,t.in,r)}const s=t.in._zod.run(n,r);return s instanceof Promise?s.then(i=>Ua(i,t.out,r)):Ua(s,t.out,r)}});function Ua(e,t,n){return e.issues.some(r=>r.code!=="unrecognized_keys")?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const xk=J("$ZodPreprocess",(e,t)=>{z1.init(e,t)}),kk=J("$ZodReadonly",(e,t)=>{zt.init(e,t),ft(e,"propValues",n=>n.def.innerType._zod.propValues),ft(e,"values",n=>n.def.innerType._zod.values),ft(e,"optin",n=>n.def.innerType?._zod?.optin),ft(e,"optout",n=>n.def.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(Of):Of(s)}});function Of(e){return e.memo||(e.value=Object.freeze(e.value)),e}const _k=J("$ZodCustom",(e,t)=>{Sn.init(e,t),zt.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,s=t.fn(r);if(s instanceof Promise)return s.then(i=>Nf(i,n,r,e));Nf(s,n,r,e)}});function Nf(e,t,n,r){if(!e){const s={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(s.params=r._zod.def.params),t.issues.push(ia(s))}}class Ek extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}}const Zc="~memo",Mf=[];function $1(e){return e!==null&&typeof e=="object"}function Kl(e){return e.map(t=>t.path?{...t,path:t.path.slice()}:{...t})}const D1=new WeakMap,Di=0,no=1,ji=2;function ro(e,t,n){const r=D1.get(e);if(r!==void 0)return r?ji:Di;if(t.has(e))return ji;t.add(e);let s=Di;const i=u=>{if(s!==ji&&u?._zod){const f=ro(u,t);f>s&&(s=f)}},a=(u,f)=>{let m=Di;for(const h of Reflect.ownKeys(u)){const y=Object.getOwnPropertyDescriptor(u,h);if(!y.enumerable)continue;const b=y.get?no:y.value?._zod?ro(y.value,t):Di;b>m&&(m=b)}return m},o=u=>{u>s&&(s=u)},l=e._zod.def;switch(l.type){case"object":{const u=K0(l);o(u?a(u):no),i(l.catchall);break}case"array":i(l.element);break;case"tuple":for(const u of l.items)i(u);i(l.rest);break;case"record":case"map":i(l.keyType),i(l.valueType);break;case"set":i(l.valueType);break;case"union":for(const u of l.options)i(u);break;case"intersection":i(l.left),i(l.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":i(l.innerType);break;case"pipe":i(l.in),i(l.out);break;case"function":i(l.input),i(l.output);break;case"lazy":{const u=l._cachedInner??void 0;o(u?ro(u,t):no);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(const u in l){const f=Object.getOwnPropertyDescriptor(l,u);if(!f||f.get)continue;const m=f.value;if(!(!m||typeof m!="object")){if(m._zod)i(m);else if(Array.isArray(m))for(const h of m)i(h)}}}return t.delete(e),Ak(e,s)}function Ak(e,t){return t!==no&&D1.set(e,t===ji),t}function Tk(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}let qa;const Ha=[],Ik={alloc(e,t,n){const r=qa;if(!r)return n;qa=void 0;const s={value:n,issues:null};return r.set(t.value,s),Ha.push(s),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{const n=e._zod.parse,r=(s,i)=>{if(i.direction!=="backward"&&Ck(i,s.value))throw new Ek;return n(s,i)};e._zod.parse=r,e._zod.run===n&&(e._zod.run=r)})},attach(e){var t;let n,r=!1,s,i;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{const a=e._zod.parse,o=(l,c)=>{if(n===void 0){const k=ro(e,new Set);if(k===Di)return e._zod.parse=a,e._zod.run===o&&(e._zod.run=a),a(l,c);k===ji||r?n=!0:r=!0}const u=l.value;if(!$1(u))return a(l,c);let f=c[Zc];f||(f={buckets:new WeakMap,backEdges:void 0},c[Zc]=f);let m;s===c?m=i:(m=Tk(f,e),s=c,i=m);const h=m.get(u);if(h)return l.value=h.value,h.issues?h.issues.length&&l.issues.push(...Kl(h.issues)):(l.memo=!0,f.backEdges??(f.backEdges=new WeakSet),f.backEdges.add(h.value)),l;qa=m;const y=Ha.length,b=a(l,c);qa=void 0;const S=Ha.length>y?Ha.pop():void 0;return b instanceof Promise?b.then(k=>(S&&(S.issues=k.issues.length?Kl(k.issues):Mf),k)):(S&&(S.issues=b.issues.length?Kl(b.issues):Mf),b)};e._zod.parse=o,e._zod.run===a&&(e._zod.run=o)})}};function Rk(){return Ik}function Ck(e,t){const n=e[Zc]?.backEdges;return n!==void 0&&$1(t)&&n.has(t)}const Ok=()=>{const e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(i){return e[i]??null}const n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};function s(i,a){return i==="number"&&typeof a=="number"&&!Number.isFinite(a)?String(a):r[i]??i}return i=>{switch(i.code){case"invalid_type":{const a=s(i.expected),o=tS(i.input),l=s(o,i.input);return`Invalid input: expected ${a}, received ${l}`}case"invalid_value":return i.values.length===1?`Invalid input: expected ${f1(i.values[0])}`:`Invalid option: expected one of ${gf(i.values,"|")}`;case"too_big":{const a=i.exact?"exactly ":i.inclusive?"<=":"<",o=t(i.origin);return o?`Too big: expected ${i.origin??"value"} to have ${a}${i.maximum.toString()} ${o.unit??"elements"}`:`Too big: expected ${i.origin??"value"} to be ${a}${i.maximum.toString()}`}case"too_small":{const a=i.exact?"exactly ":i.inclusive?">=":">",o=t(i.origin);return o?`Too small: expected ${i.origin} to have ${a}${i.minimum.toString()} ${o.unit}`:`Too small: expected ${i.origin} to be ${a}${i.minimum.toString()}`}case"invalid_format":{const a=i;return a.format==="starts_with"?`Invalid string: must start with "${a.prefix}"`:a.format==="ends_with"?`Invalid string: must end with "${a.suffix}"`:a.format==="includes"?`Invalid string: must include "${a.includes}"`:a.format==="regex"?`Invalid string: must match pattern ${a.pattern}`:`Invalid ${n[a.format]??i.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${gf(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":return i.options&&Array.isArray(i.options)&&i.options.length>0?`Invalid discriminator value. Expected ${i.options.map(o=>`'${o}'`).join(" | ")}`:i.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}};function Nk(){return{localeError:Ok()}}var zf;class Mk{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const s={...r,...this._map.get(t)};return Object.keys(s).length?s:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function zk(){return new Mk}(zf=globalThis).__zod_globalRegistry??(zf.__zod_globalRegistry=zk());const Pi=globalThis.__zod_globalRegistry;function iu(e){return e.checks&&(e.checks=[...e.checks]),e}function $k(e,t){return new e(iu({type:"string",...Me(t)}))}function Dk(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Me(t)})}function Pk(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Me(t)})}function Bk(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Me(t)})}function Lk(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Me(t)})}function Fk(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Me(t)})}function Uk(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Me(t)})}function qk(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Me(t)})}function Hk(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Me(t)})}function Vk(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Me(t)})}function jk(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Me(t)})}function Gk(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Me(t)})}function Zk(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Me(t)})}function Kk(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Me(t)})}function Wk(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Me(t)})}function Qk(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Me(t)})}function Jk(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Me(t)})}function Yk(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Me(t)})}function Xk(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Me(t)})}function e_(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Me(t)})}function t_(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Me(t)})}function n_(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Me(t)})}function r_(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Me(t)})}function s_(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Me(t)})}function i_(e,t){return new e({type:"string",format:"date",check:"string_format",...Me(t)})}function a_(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Me(t)})}function o_(e,t){return new e({type:"string",format:"duration",check:"string_format",...Me(t)})}function l_(e,t){return new e(iu({type:"number",checks:[],...Me(t)}))}function c_(e,t){return new e(iu({type:"number",coerce:!0,checks:[],...Me(t)}))}function u_(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Me(t)})}function d_(e,t){return new e({type:"boolean",...Me(t)})}function f_(e){return new e({type:"unknown"})}function h_(e,t){return new e({type:"never",...Me(t)})}function $f(e,t){return new w1({check:"less_than",...Me(t),value:e,inclusive:!1})}function Wl(e,t){return new w1({check:"less_than",...Me(t),value:e,inclusive:!0})}function Df(e,t){return new S1({check:"greater_than",...Me(t),value:e,inclusive:!1})}function Ql(e,t){return new S1({check:"greater_than",...Me(t),value:e,inclusive:!0})}function Pf(e,t){return new ax({check:"multiple_of",...Me(t),value:e})}function P1(e,t){return new lx({check:"max_length",...Me(t),maximum:e})}function Eo(e,t){return new cx({check:"min_length",...Me(t),minimum:e})}function B1(e,t){return new ux({check:"length_equals",...Me(t),length:e})}function p_(e,t){return new dx({check:"string_format",format:"regex",...Me(t),pattern:e})}function m_(e){return new fx({check:"string_format",format:"lowercase",...Me(e)})}function g_(e){return new hx({check:"string_format",format:"uppercase",...Me(e)})}function v_(e,t){return new px({check:"string_format",format:"includes",...Me(t),includes:e})}function b_(e,t){return new mx({check:"string_format",format:"starts_with",...Me(t),prefix:e})}function y_(e,t){return new gx({check:"string_format",format:"ends_with",...Me(t),suffix:e})}function gi(e){return new vx({check:"overwrite",tx:e})}function w_(e){return gi(t=>t.normalize(e))}function S_(){return gi(e=>e.trim())}function x_(){return gi(e=>e.toLowerCase())}function k_(){return gi(e=>e.toUpperCase())}function __(){return gi(e=>q9(e))}function E_(e,t,n){return new e({type:"array",element:t,...Me(n)})}function A_(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Me(n)})}function T_(e,t){const n=I_(r=>(r.addIssue=s=>{if(typeof s=="string")r.issues.push(ia(s,r.value,n._zod.def));else{const i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),"input"in i||(i.input=r.value),i.inst??(i.inst=n),i.continue??(i.continue=!n._zod.def.abort),r.issues.push(ia(i))}},e(r.value,r)),t);return n}function I_(e,t){const n=new Sn({check:"custom",...Me(t)});return n._zod.check=e,n}function Gi(e,...t){for(const n of t)for(const r of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,r)&&Dr(e,r,n[r]);return e}function L1(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Pi,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function us(e,t,n,r,s){const i=typeof t.unrepresentable=="function"?t.unrepresentable({zodSchema:e,path:r.path,message:s}):t.unrepresentable;if(i==="any")return!1;if(i===void 0||i==="throw")throw new Error(s);return Object.assign(n,i),!0}function Kt(e,t,n={path:[],schemaPath:[]}){var r;const s=e._zod.def,i=t.seen.get(e);if(i)return i.count++,n.schemaPath.includes(e)&&(i.cycle=n.path),i.schema;const a={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,a),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;const o=e._zod.toJSONSchema?.();if(o)a.schema=o;else{const u={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,u);else{const m=a.schema,h=t.processors[s.type];if(!h)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);h(e,t,m,u)}const f=e._zod.parent;f&&(a.ref||(a.ref=f),Kt(f,t,u),t.seen.get(f).isParent=!0)}const l=t.metadataRegistry.get(e);return l&&Gi(a.schema,l),t.io==="input"&&un(e)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&"_prefault"in a.schema&&((r=a.schema).default??(r.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function Bf(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function F1(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;const r=new Map;for(const a of e.seen.entries()){const o=e.metadataRegistry.get(a[0])?.id;if(o){const l=r.get(o);if(l&&l!==a[0])throw new Error(`Duplicate schema id "${o}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(o,a[0])}}const s=a=>{const o=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const f=e.external.registry.get(a[0])?.id,m=e.external.uri??(y=>y);if(f)return{ref:m(f)};const h=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=h,{defId:h,ref:`${m("__shared")}#/${o}/${Bf(h)}`}}const l="#",c=`${l}/${o}/`;if(a[1]===n&&!a[1].schema.id)return{ref:l};const u=a[1].schema.id??`__schema${e.counter++}`;return{defId:u,ref:c+Bf(u)}},i=a=>{if(a[1].schema.$ref)return;const o=a[1],{ref:l,defId:c}=s(a);o.def={...o.schema},c&&(o.defId=c);const u=o.schema;for(const f in u)delete u[f];u.$ref=l};if(e.cycles==="throw")for(const a of e.seen.entries()){const o=a[1];if(o.cycle)throw new Error(`Cycle detected: #/${o.cycle?.join("/")}/<root>
|
|
379
|
+
`)}return x.write("payload.value = newResult;"),x.write("return payload;"),x.compile()};let a;const o=sa,l=!Zn.jitless,u=l&&J9.value,p=t.catchall;let m;e._zod.parse=(f,y)=>{m??(m=r.value);const b=f.value;return o(b)?l&&u&&y?.async===!1&&y.jitless!==!0?(a||(a=i(t.shape)),f=a(f,y),p?$1([],b,f,y,m,e,y?.abortEarly===!0):f):n(f,y):(f.issues.push({expected:"object",code:"invalid_type",input:b,inst:e}),f)}});function Af(e,t,n,r){for(const i of e)if(i.issues.length===0)return t.value=i.value,t;const s=e.filter(i=>!Ar(i));return s.length===1?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(i=>i.issues.map(a=>cs(a,r,dr())))}),t)}const D1=J("$ZodUnion",(e,t)=>{$t.init(e,t),ft(e,"optin",r=>r.def.options.some(s=>s._zod.optin==="defaulted")?"defaulted":r.def.options.some(s=>s._zod.optin!==void 0)?"optional":void 0),ft(e,"optout",r=>r.def.options.some(s=>s._zod.optout==="optional")?"optional":void 0),ft(e,"values",r=>{if(r.def.options.every(s=>s._zod.values))return new Set(r.def.options.flatMap(s=>Array.from(s._zod.values)))}),ft(e,"pattern",r=>{if(r.def.options.every(s=>s._zod.pattern)){const s=r.def.options.map(i=>i._zod.pattern);return new RegExp(`^(${s.map(i=>Z0(i.source)).join("|")})$`)}});const n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,s)=>{if(n)return n(r,s);let i=!1;const a=[];for(const o of t.options){const l=o._zod.run({value:r.value,issues:[]},s);if(l instanceof Promise)a.push(l),i=!0;else{if(l.issues.length===0)return l;a.push(l)}}return i?Promise.all(a).then(o=>Af(o,r,e,s)):Af(a,r,e,s)}});function vk(e){const t=new Map;for(const n of e.options){const r=n._zod.propValues?.[e.discriminator];if(!r||r.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(n)}"`);for(const s of r)if(t.has(s)){if(s!==void 0)throw new Error(`Duplicate discriminator value "${String(s)}"`);t.set(s,null)}else t.set(s,n)}return t}const bk=J("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,D1.init(e,t);const n=e._zod.parse;ft(e,"propValues",s=>{const i={};let a=0;for(const o of s.def.options){const l=o._zod.propValues;if(!l||Object.keys(l).length===0)throw new Error(`Invalid discriminated union option at index "${s.def.options.indexOf(o)}"`);l[s.def.discriminator]?.has(void 0)&&a++;for(const[c,u]of Object.entries(l)){Object.prototype.hasOwnProperty.call(i,c)||Pr(i,c,new Set);for(const p of u)i[c].add(p)}}return!s.def.unionFallback&&a>1&&i[s.def.discriminator]?.delete(void 0),i}),t.options.forEach((s,i)=>{const a=K0(s._zod.def);if(a&&!Object.prototype.hasOwnProperty.call(a,t.discriminator))throw new Error(`Invalid discriminated union option at index "${i}"`)});const r=Jo(()=>vk(t));e._zod.parse=(s,i)=>{const a=s.value;if(!sa(a))return s.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),s;const o=a?.[t.discriminator],l=r.value.get(o);return l&&(o!==void 0||i.direction!=="backward")?l._zod.run(s,i):t.unionFallback||i.direction==="backward"?n(s,i):(s.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(r.value.keys()).filter(c=>r.value.get(c)!==null),input:a,path:[t.discriminator],inst:e}),s)}}),yk=J("$ZodIntersection",(e,t)=>{$t.init(e,t),e._zod.parse=(n,r)=>{const s=n.value,i=t.left._zod.run({value:s,issues:[]},r),a=t.right._zod.run({value:s,issues:[]},r);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([l,c])=>Tf(n,l,c)):Tf(n,i,a)}});function Gc(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ii(e)&&ii(t)){const n=Object.keys(t),r=Object.keys(e).filter(i=>n.indexOf(i)!==-1),s={...e,...t};Object.prototype.hasOwnProperty.call(s,"__proto__")&&delete s.__proto__;for(const i of r){if(i==="__proto__")continue;const a=Gc(e[i],t[i]);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};s[i]=a.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const s=e[r],i=t[r],a=Gc(s,i);if(!a.valid)return{valid:!1,mergeErrorPath:[r,...a.mergeErrorPath]};n.push(a.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Tf(e,t,n){const r=new Map;let s;const i=new Map,a=(c,u)=>{let p;if(c.code==="unrecognized_keys"&&!c.path?.length)s??(s=c),p=c.keys;else if(c.code==="invalid_key"&&c.origin==="record"&&c.path?.length===1){const m=String(c.path[0]);i.has(m)||i.set(m,c),p=[m]}else return!1;for(const m of p)r.has(m)||r.set(m,{}),r.get(m)[u]=!0;return!0};for(const c of t.issues)a(c,"l")||e.issues.push(c);for(const c of n.issues)a(c,"r")||e.issues.push(c);const o=[...r].filter(([,c])=>c.l&&c.r).map(([c])=>c);if(o.length){const c=s?o.filter(u=>s.keys.includes(u)):[];c.length&&e.issues.push({...s,keys:c});for(const u of o)!c.includes(u)&&i.has(u)&&e.issues.push(i.get(u))}const l=Gc(t.value,n.value);if(!l.valid){if(Ar(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(l.mergeErrorPath)}`)}return e.value=l.data,e}const wk=J("$ZodRecord",(e,t)=>{$t.init(e,t);const n=Zn.memoizer;n?.attach(e),e._zod.parse=(r,s)=>{const i=r.value;if(!ii(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;const a=[],o=t.keyType._zod.values;if(o&&!t.partial){r.value=n?n.alloc(e,r,{},s):{};const l=new Set;for(const u of o)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){if(l.add(typeof u=="number"?u.toString():u),u==="__proto__")continue;const p=t.keyType._zod.run({value:u,issues:[]},s);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(p.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:p.issues.map(y=>cs(y,s,dr())),input:u,path:[u],inst:e});continue}const m=p.value;if(m==="__proto__")continue;const f=t.valueType._zod.run({value:i[u],issues:[]},s);f instanceof Promise?a.push(f.then(y=>{y.issues.length&&r.issues.push(...Js(u,y.issues)),r.value[m]=y.value})):(f.issues.length&&r.issues.push(...Js(u,f.issues)),r.value[m]=f.value)}let c;for(const u in i)if(!l.has(u))if(t.mode==="loose"){if(u==="__proto__")continue;r.value[u]=i[u]}else c=c??[],c.push(u);c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:c,continue:!0})}else{r.value=n?n.alloc(e,r,{},s):{};let l;for(const c of Reflect.ownKeys(i)){if(c==="__proto__"||!Object.prototype.propertyIsEnumerable.call(i,c))continue;let u=t.keyType._zod.run({value:c,issues:[]},s);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof c=="string"&&tu.test(c)&&u.issues.length){const y=t.keyType._zod.run({value:Number(c),issues:[]},s);if(y instanceof Promise)throw new Error("Async schemas not supported in object keys currently");y.issues.length===0&&(u=y)}if(u.issues.length){t.mode==="loose"?r.value[c]=i[c]:o?(l=l??[],l.push(c)):r.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(y=>cs(y,s,dr())),input:c,path:[c],inst:e});continue}const m=u.value;if(m==="__proto__")continue;const f=t.valueType._zod.run({value:i[c],issues:[]},s);f instanceof Promise?a.push(f.then(y=>{y.issues.length&&r.issues.push(...Js(c,y.issues)),r.value[m]=y.value})):(f.issues.length&&r.issues.push(...Js(c,f.issues)),r.value[m]=f.value)}l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:l,continue:!0})}return a.length?Promise.all(a).then(()=>r):r}}),Sk=J("$ZodEnum",(e,t)=>{$t.init(e,t);const n=qc(t.entries),r=new Set(n);e._zod.values=r,ft(e,"pattern",s=>{const i=qc(s.def.entries).filter(a=>Y9.has(typeof a));return new RegExp(i.length?`^(${i.map(a=>ai(a.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(s,i)=>{const a=s.value;return r.has(a)||s.issues.push({code:"invalid_value",values:n,input:a,inst:e}),s}}),xk=J("$ZodLiteral",(e,t)=>{$t.init(e,t);const n=new Set(t.values);e._zod.values=n,ft(e,"pattern",r=>{const s=r.def.values;return new RegExp(s.length?`^(${s.map(i=>typeof i=="string"?ai(i):i?ai(i.toString()):String(i)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(r,s)=>{const i=r.value;return n.has(i)||r.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),r}}),kk=J("$ZodTransform",(e,t)=>{$t.init(e,t),e._zod.optin="optional",Zn.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new S1(e.constructor.name);const s=t.transform(n.value,n);if(r.async)return(s instanceof Promise?s:Promise.resolve(s)).then(a=>(n.value=a,n));if(s instanceof Promise)throw new Cs;return n.value=s,n}});function If(e,t){return e.value=t.issues.length?void 0:t.value,e}const P1=J("$ZodOptional",(e,t)=>{$t.init(e,t),ft(e,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",ft(e,"values",n=>{const r=n.def.innerType._zod.values;return r?new Set([...r,void 0]):void 0}),ft(e,"pattern",n=>{const r=n.def.innerType._zod.pattern;return r?new RegExp(`^(${Z0(r.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(n.value===void 0){if(t.innerType._zod.optin!=="defaulted")return n;const s=t.innerType._zod.run({value:n.value,issues:[]},r);return s instanceof Promise?s.then(i=>If(n,i)):If(n,s)}return t.innerType._zod.run(n,r)}}),_k=J("$ZodExactOptional",(e,t)=>{P1.init(e,t),ft(e,"values",n=>n.def.innerType._zod.values),ft(e,"pattern",n=>n.def.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),Ek=J("$ZodNullable",(e,t)=>{$t.init(e,t),ft(e,"optin",n=>n.def.innerType._zod.optin),ft(e,"optout",n=>n.def.innerType._zod.optout),ft(e,"pattern",n=>{const r=n.def.innerType._zod.pattern;return r?new RegExp(`^(${Z0(r.source)}|null)$`):void 0}),ft(e,"values",n=>n.def.innerType._zod.values?new Set([...n.def.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),Ak=J("$ZodDefault",(e,t)=>{$t.init(e,t),e._zod.optin="defaulted",ft(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>Rf(i,t)):Rf(s,t)}});function Rf(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Tk=J("$ZodPrefault",(e,t)=>{$t.init(e,t),e._zod.optin="defaulted",ft(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),Ik=J("$ZodNonOptional",(e,t)=>{$t.init(e,t),ft(e,"values",n=>{const r=n.def.innerType._zod.values;return r?new Set([...r].filter(s=>s!==void 0)):void 0}),e._zod.parse=(n,r)=>{const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>Cf(i,e)):Cf(s,e)}});function Cf(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function Of(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(s=>cs(s,r,dr()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}const Rk=J("$ZodCatch",(e,t)=>{$t.init(e,t),ft(e,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),ft(e,"optout",n=>n.def.innerType._zod.optout),ft(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const s=t.innerType._zod.run({value:n.value,issues:[]},r);return s instanceof Promise?s.then(i=>Of(n,i,t,r)):Of(n,s,t,r)}}),B1=J("$ZodPipe",(e,t)=>{$t.init(e,t),ft(e,"values",n=>n.def.in._zod.values),ft(e,"optin",n=>n.def.in._zod.optin),ft(e,"optout",n=>n.def.out._zod.optout),ft(e,"propValues",n=>n.def.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const i=t.out._zod.run(n,r);return i instanceof Promise?i.then(a=>Ua(a,t.in,r)):Ua(i,t.in,r)}const s=t.in._zod.run(n,r);return s instanceof Promise?s.then(i=>Ua(i,t.out,r)):Ua(s,t.out,r)}});function Ua(e,t,n){return e.issues.some(r=>r.code!=="unrecognized_keys")?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Ck=J("$ZodPreprocess",(e,t)=>{B1.init(e,t)}),Ok=J("$ZodReadonly",(e,t)=>{$t.init(e,t),ft(e,"propValues",n=>n.def.innerType._zod.propValues),ft(e,"values",n=>n.def.innerType._zod.values),ft(e,"optin",n=>n.def.innerType?._zod?.optin),ft(e,"optout",n=>n.def.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(Mf):Mf(s)}});function Mf(e){return e.memo||(e.value=Object.freeze(e.value)),e}const Mk=J("$ZodCustom",(e,t)=>{Sn.init(e,t),$t.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,s=t.fn(r);if(s instanceof Promise)return s.then(i=>Nf(i,n,r,e));Nf(s,n,r,e)}});function Nf(e,t,n,r){if(!e){const s={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(s.params=r._zod.def.params),t.issues.push(ia(s))}}class Nk extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}}const Zc="~memo",zf=[];function L1(e){return e!==null&&typeof e=="object"}function Kl(e){return e.map(t=>t.path?{...t,path:t.path.slice()}:{...t})}const F1=new WeakMap,Di=0,no=1,ji=2;function ro(e,t,n){const r=F1.get(e);if(r!==void 0)return r?ji:Di;if(t.has(e))return ji;t.add(e);let s=Di;const i=u=>{if(s!==ji&&u?._zod){const p=ro(u,t);p>s&&(s=p)}},a=(u,p)=>{let m=Di;for(const f of Reflect.ownKeys(u)){const y=Object.getOwnPropertyDescriptor(u,f);if(!y.enumerable)continue;const b=y.get?no:y.value?._zod?ro(y.value,t):Di;b>m&&(m=b)}return m},o=u=>{u>s&&(s=u)},l=e._zod.def;switch(l.type){case"object":{const u=K0(l);o(u?a(u):no),i(l.catchall);break}case"array":i(l.element);break;case"tuple":for(const u of l.items)i(u);i(l.rest);break;case"record":case"map":i(l.keyType),i(l.valueType);break;case"set":i(l.valueType);break;case"union":for(const u of l.options)i(u);break;case"intersection":i(l.left),i(l.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":i(l.innerType);break;case"pipe":i(l.in),i(l.out);break;case"function":i(l.input),i(l.output);break;case"lazy":{const u=l._cachedInner??void 0;o(u?ro(u,t):no);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(const u in l){const p=Object.getOwnPropertyDescriptor(l,u);if(!p||p.get)continue;const m=p.value;if(!(!m||typeof m!="object")){if(m._zod)i(m);else if(Array.isArray(m))for(const f of m)i(f)}}}return t.delete(e),zk(e,s)}function zk(e,t){return t!==no&&F1.set(e,t===ji),t}function $k(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}let qa;const Ha=[],Dk={alloc(e,t,n){const r=qa;if(!r)return n;qa=void 0;const s={value:n,issues:null};return r.set(t.value,s),Ha.push(s),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{const n=e._zod.parse,r=(s,i)=>{if(i.direction!=="backward"&&Bk(i,s.value))throw new Nk;return n(s,i)};e._zod.parse=r,e._zod.run===n&&(e._zod.run=r)})},attach(e){var t;let n,r=!1,s,i;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{const a=e._zod.parse,o=(l,c)=>{if(n===void 0){const S=ro(e,new Set);if(S===Di)return e._zod.parse=a,e._zod.run===o&&(e._zod.run=a),a(l,c);S===ji||r?n=!0:r=!0}const u=l.value;if(!L1(u))return a(l,c);let p=c[Zc];p||(p={buckets:new WeakMap,backEdges:void 0},c[Zc]=p);let m;s===c?m=i:(m=$k(p,e),s=c,i=m);const f=m.get(u);if(f)return l.value=f.value,f.issues?f.issues.length&&l.issues.push(...Kl(f.issues)):(l.memo=!0,p.backEdges??(p.backEdges=new WeakSet),p.backEdges.add(f.value)),l;qa=m;const y=Ha.length,b=a(l,c);qa=void 0;const x=Ha.length>y?Ha.pop():void 0;return b instanceof Promise?b.then(S=>(x&&(x.issues=S.issues.length?Kl(S.issues):zf),S)):(x&&(x.issues=b.issues.length?Kl(b.issues):zf),b)};e._zod.parse=o,e._zod.run===a&&(e._zod.run=o)})}};function Pk(){return Dk}function Bk(e,t){const n=e[Zc]?.backEdges;return n!==void 0&&L1(t)&&n.has(t)}const Lk=()=>{const e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(i){return e[i]??null}const n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};function s(i,a){return i==="number"&&typeof a=="number"&&!Number.isFinite(a)?String(a):r[i]??i}return i=>{switch(i.code){case"invalid_type":{const a=s(i.expected),o=cS(i.input),l=s(o,i.input);return`Invalid input: expected ${a}, received ${l}`}case"invalid_value":return i.values.length===1?`Invalid input: expected ${g1(i.values[0])}`:`Invalid option: expected one of ${vf(i.values,"|")}`;case"too_big":{const a=i.exact?"exactly ":i.inclusive?"<=":"<",o=t(i.origin);return o?`Too big: expected ${i.origin??"value"} to have ${a}${i.maximum.toString()} ${o.unit??"elements"}`:`Too big: expected ${i.origin??"value"} to be ${a}${i.maximum.toString()}`}case"too_small":{const a=i.exact?"exactly ":i.inclusive?">=":">",o=t(i.origin);return o?`Too small: expected ${i.origin} to have ${a}${i.minimum.toString()} ${o.unit}`:`Too small: expected ${i.origin} to be ${a}${i.minimum.toString()}`}case"invalid_format":{const a=i;return a.format==="starts_with"?`Invalid string: must start with "${a.prefix}"`:a.format==="ends_with"?`Invalid string: must end with "${a.suffix}"`:a.format==="includes"?`Invalid string: must include "${a.includes}"`:a.format==="regex"?`Invalid string: must match pattern ${a.pattern}`:`Invalid ${n[a.format]??i.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${vf(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":return i.options&&Array.isArray(i.options)&&i.options.length>0?`Invalid discriminator value. Expected ${i.options.map(o=>`'${o}'`).join(" | ")}`:i.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}};function Fk(){return{localeError:Lk()}}var $f;class Uk{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const s={...r,...this._map.get(t)};return Object.keys(s).length?s:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function qk(){return new Uk}($f=globalThis).__zod_globalRegistry??($f.__zod_globalRegistry=qk());const Pi=globalThis.__zod_globalRegistry;function iu(e){return e.checks&&(e.checks=[...e.checks]),e}function Hk(e,t){return new e(iu({type:"string",...Ne(t)}))}function Vk(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ne(t)})}function jk(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ne(t)})}function Gk(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ne(t)})}function Zk(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ne(t)})}function Kk(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ne(t)})}function Wk(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ne(t)})}function Qk(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ne(t)})}function Jk(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ne(t)})}function Yk(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ne(t)})}function Xk(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ne(t)})}function e_(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ne(t)})}function t_(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ne(t)})}function n_(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ne(t)})}function r_(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ne(t)})}function s_(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ne(t)})}function i_(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ne(t)})}function a_(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ne(t)})}function o_(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ne(t)})}function l_(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ne(t)})}function c_(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ne(t)})}function u_(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ne(t)})}function d_(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ne(t)})}function f_(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ne(t)})}function h_(e,t){return new e({type:"string",format:"date",check:"string_format",...Ne(t)})}function p_(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ne(t)})}function m_(e,t){return new e({type:"string",format:"duration",check:"string_format",...Ne(t)})}function g_(e,t){return new e(iu({type:"number",checks:[],...Ne(t)}))}function v_(e,t){return new e(iu({type:"number",coerce:!0,checks:[],...Ne(t)}))}function b_(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Ne(t)})}function y_(e,t){return new e({type:"boolean",...Ne(t)})}function w_(e){return new e({type:"unknown"})}function S_(e,t){return new e({type:"never",...Ne(t)})}function Df(e,t){return new _1({check:"less_than",...Ne(t),value:e,inclusive:!1})}function Wl(e,t){return new _1({check:"less_than",...Ne(t),value:e,inclusive:!0})}function Pf(e,t){return new E1({check:"greater_than",...Ne(t),value:e,inclusive:!1})}function Ql(e,t){return new E1({check:"greater_than",...Ne(t),value:e,inclusive:!0})}function Bf(e,t){return new px({check:"multiple_of",...Ne(t),value:e})}function U1(e,t){return new gx({check:"max_length",...Ne(t),maximum:e})}function Eo(e,t){return new vx({check:"min_length",...Ne(t),minimum:e})}function q1(e,t){return new bx({check:"length_equals",...Ne(t),length:e})}function x_(e,t){return new yx({check:"string_format",format:"regex",...Ne(t),pattern:e})}function k_(e){return new wx({check:"string_format",format:"lowercase",...Ne(e)})}function __(e){return new Sx({check:"string_format",format:"uppercase",...Ne(e)})}function E_(e,t){return new xx({check:"string_format",format:"includes",...Ne(t),includes:e})}function A_(e,t){return new kx({check:"string_format",format:"starts_with",...Ne(t),prefix:e})}function T_(e,t){return new _x({check:"string_format",format:"ends_with",...Ne(t),suffix:e})}function gi(e){return new Ex({check:"overwrite",tx:e})}function I_(e){return gi(t=>t.normalize(e))}function R_(){return gi(e=>e.trim())}function C_(){return gi(e=>e.toLowerCase())}function O_(){return gi(e=>e.toUpperCase())}function M_(){return gi(e=>Q9(e))}function N_(e,t,n){return new e({type:"array",element:t,...Ne(n)})}function z_(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Ne(n)})}function $_(e,t){const n=D_(r=>(r.addIssue=s=>{if(typeof s=="string")r.issues.push(ia(s,r.value,n._zod.def));else{const i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),"input"in i||(i.input=r.value),i.inst??(i.inst=n),i.continue??(i.continue=!n._zod.def.abort),r.issues.push(ia(i))}},e(r.value,r)),t);return n}function D_(e,t){const n=new Sn({check:"custom",...Ne(t)});return n._zod.check=e,n}function Gi(e,...t){for(const n of t)for(const r of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,r)&&Pr(e,r,n[r]);return e}function H1(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Pi,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function ds(e,t,n,r,s){const i=typeof t.unrepresentable=="function"?t.unrepresentable({zodSchema:e,path:r.path,message:s}):t.unrepresentable;if(i==="any")return!1;if(i===void 0||i==="throw")throw new Error(s);return Object.assign(n,i),!0}function Kt(e,t,n={path:[],schemaPath:[]}){var r;const s=e._zod.def,i=t.seen.get(e);if(i)return i.count++,n.schemaPath.includes(e)&&(i.cycle=n.path),i.schema;const a={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,a),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;const o=e._zod.toJSONSchema?.();if(o)a.schema=o;else{const u={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,u);else{const m=a.schema,f=t.processors[s.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);f(e,t,m,u)}const p=e._zod.parent;p&&(a.ref||(a.ref=p),Kt(p,t,u),t.seen.get(p).isParent=!0)}const l=t.metadataRegistry.get(e);return l&&Gi(a.schema,l),t.io==="input"&&dn(e)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&"_prefault"in a.schema&&((r=a.schema).default??(r.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function Lf(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function V1(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;const r=new Map;for(const a of e.seen.entries()){const o=e.metadataRegistry.get(a[0])?.id;if(o){const l=r.get(o);if(l&&l!==a[0])throw new Error(`Duplicate schema id "${o}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(o,a[0])}}const s=a=>{const o=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const p=e.external.registry.get(a[0])?.id,m=e.external.uri??(y=>y);if(p)return{ref:m(p)};const f=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=f,{defId:f,ref:`${m("__shared")}#/${o}/${Lf(f)}`}}const l="#",c=`${l}/${o}/`;if(a[1]===n&&!a[1].schema.id)return{ref:l};const u=a[1].schema.id??`__schema${e.counter++}`;return{defId:u,ref:c+Lf(u)}},i=a=>{if(a[1].schema.$ref)return;const o=a[1],{ref:l,defId:c}=s(a);o.def={...o.schema},c&&(o.defId=c);const u=o.schema;for(const p in u)delete u[p];u.$ref=l};if(e.cycles==="throw")for(const a of e.seen.entries()){const o=a[1];if(o.cycle)throw new Error(`Cycle detected: #/${o.cycle?.join("/")}/<root>
|
|
379
380
|
|
|
380
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const a of e.seen.entries()){const o=a[1];if(t===a[0]){i(a);continue}if(e.external){const c=e.external.registry.get(a[0])?.id;if(t!==a[0]&&c){i(a);continue}}if(e.metadataRegistry.get(a[0])?.id){i(a);continue}if(o.cycle){i(a);continue}o.count>1&&e.reused==="ref"&&i(a)}e.external&&(e.sharedDefsExtractedFor=e.external)}function U1(e){const t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;const n=[];for(const r of t){if(!r||typeof r!="object")return;U1(r);const s=Object.keys(r);if(s.length!==1||s[0]!=="type")return;const i=r.type;for(const a of Array.isArray(i)?i:[i]){if(typeof a!="string")return;n.includes(a)||n.push(a)}}delete e.anyOf,e.type=n.length===1?n[0]:n}const q1=new Set(["type","properties","required","additionalProperties"]),Lf=["oneOf","anyOf"];function Ff(e){const t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function Kc(e){const t=[];for(const i of e){if(typeof i!="object"||i.type!=="object")return null;for(const a in i)if(!q1.has(a))return null;t.push(i)}const n={},r=new Set;for(const i of t){for(const a in i.properties){if(Object.prototype.hasOwnProperty.call(n,a))continue;const o=[];for(const c of t){const u=c.properties?.[a]??Ff(c);u!=null&&(o.some(f=>JSON.stringify(f)===JSON.stringify(u))||o.push(u))}const l=o.length===1?o[0]:Kc(o)??{allOf:o};Dr(n,a,l)}for(const a of i.required??[])r.add(a)}const s={type:"object",properties:n};if(r.size&&(s.required=[...r]),t.every(i=>i.additionalProperties===!1))s.additionalProperties=!1;else{const i=[];for(const a of t){const o=Ff(a);o&&!i.some(l=>JSON.stringify(l)===JSON.stringify(o))&&i.push(o)}i.length===1?s.additionalProperties=i[0]:i.length>1&&(s.additionalProperties={allOf:i})}return s}function R_(e){const t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(const s of q1)if(s in e)return;const n=t.filter(s=>Lf.some(i=>Array.isArray(s[i])));let r=null;if(!n.length)r=Kc(t);else{const s=n[0],i=Lf.find(l=>Array.isArray(s[l]));if(Object.keys(s).length!==1)return;const a=t.filter(l=>l!==s),o=s[i].map(l=>Kc([...a,l]));if(o.some(l=>!l))return;r={[i]:o}}r&&(delete e.allOf,Gi(e,r))}function H1(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=o=>{const l=e.seen.get(o);if(l.ref===null)return;const c=l.def??l.schema,u={...c},f=l.ref;if(l.ref=null,f){r(f);const h=e.seen.get(f),y=h.schema;if(y.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(y)):Gi(c,y),Gi(c,u),o._zod.parent===f)for(const S in c)S==="$ref"||S==="allOf"||S in u||delete c[S];if(y.$ref&&h.def)for(const S in c)S==="$ref"||S==="allOf"||S in h.def&&JSON.stringify(c[S])===JSON.stringify(h.def[S])&&delete c[S]}const m=o._zod.parent;if(m&&m!==f){r(m);const h=e.seen.get(m);if(h?.schema.$ref&&(c.$ref=h.schema.$ref,h.def))for(const y in c)y==="$ref"||y==="allOf"||y in h.def&&JSON.stringify(c[y])===JSON.stringify(h.def[y])&&delete c[y]}e.override({zodSchema:o,jsonSchema:c,path:l.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(const o of[...e.seen.entries()].reverse())r(o[0]);if(e.target!=="openapi-3.0")for(const o of e.seen.entries())U1(o[1].def??o[1].schema);for(const o of e.deferred)o();if(e.intersections.length){const o=new Map;for(const l of e.seen.values())for(const c of[l.schema,l.def]){const u=c?.allOf;if(!Array.isArray(u))continue;const f=o.get(u);f?f.push(c):o.set(u,[c])}for(const l of e.intersections)for(const c of o.get(l)??[])R_(c)}}const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const o=e.external.registry.get(t)?.id;if(!o)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(o)}Gi(s,n.defId?n.schema:n.def??n.schema);const i=e.metadataRegistry.get(t)?.id;i!==void 0&&s.id===i&&delete s.id;const a=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(const o of e.seen.entries()){const l=o[1];l.def&&l.defId&&(l.def.id===l.defId&&delete l.def.id,Dr(a,l.defId,l.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?s.$defs=a:s.definitions=a);try{const o=JSON.parse(JSON.stringify(s));return Object.defineProperty(o,"~standard",{value:{...t["~standard"],jsonSchema:{input:Ao(t,"input",e.processors),output:Ao(t,"output",e.processors)}},enumerable:!1,writable:!1}),o}catch{throw new Error("Error converting schema to JSON.")}}function un(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return un(r.element,n);if(r.type==="set")return un(r.valueType,n);if(r.type==="lazy")return un(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault"||r.type==="catch")return un(r.innerType,n);if(r.type==="intersection")return un(r.left,n)||un(r.right,n);if(r.type==="record"||r.type==="map")return un(r.keyType,n)||un(r.valueType,n);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:un(r.in,n)||un(r.out,n);if(r.type==="object"){for(const s in r.shape)if(un(r.shape[s],n))return!0;return!1}if(r.type==="union"){for(const s of r.options)if(un(s,n))return!0;return!1}if(r.type==="tuple"){for(const s of r.items)if(un(s,n))return!0;return!!(r.rest&&un(r.rest,n))}return!1}const C_=(e,t={})=>n=>{const r=L1({...n,processors:t});return Kt(e,r),F1(r,e),H1(r,e)},Ao=(e,t,n={})=>r=>{const{libraryOptions:s,target:i}=r??{},a=L1({...s??{},target:i,io:t,processors:n});return Kt(e,a),F1(a,e),H1(a,e)},oi=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},li=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},Uf=(e,t)=>{oi(e,"minimum",t),li(e,"maximum",t)},V1=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},j1=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},G1=(e,t)=>{e.mime=e.mime?e.mime.filter(n=>t.includes(n)):[...t]},Z1=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},qf=(e,t)=>oi(e,"minimum",t.minimum),Hf=(e,t)=>li(e,"maximum",t.maximum),Vf=e=>(t,n)=>{Z1(t,n.format);const[r,s]=e[n.format];oi(t,"minimum",r),li(t,"maximum",s)},O_={greater_than:(e,t)=>oi(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>li(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>V1(e,t.value),number_format:Vf(h1),bigint_format:Vf(G9),min_length:qf,max_length:Hf,length_equals:(e,t)=>Uf(e,t.length),min_size:qf,max_size:Hf,size_equals:(e,t)=>Uf(e,t.size),string_format:(e,t)=>{Z1(e,t.format),t.pattern&&j1(e,t.pattern),(t.format==="base64"||t.format==="base64url")&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>G1(e,t.mime)};function Gn(e){const t={},n=e._zod.def,r=e._zod.traits.has("$ZodCheck")?[e,...n.checks??[]]:n.checks??[];for(const i of r)O_[i._zod.def.check]?.(t,i._zod.def);const s=e._zod.bag;s.minimum!==void 0&&oi(t,"minimum",s.minimum),s.exclusiveMinimum!==void 0&&oi(t,"exclusiveMinimum",s.exclusiveMinimum),s.maximum!==void 0&&li(t,"maximum",s.maximum),s.exclusiveMaximum!==void 0&&li(t,"exclusiveMaximum",s.exclusiveMaximum),s.multipleOf!==void 0&&V1(t,s.multipleOf),s.format!==void 0&&(t.format??(t.format=s.format),s.format.includes("int")&&(t.isInt=!0)),s.mime&&G1(t,s.mime);for(const i of s.patterns??[])j1(t,i);return t}const N_={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},M_=new Map([[I1,ZS],[su,KS]]),K1=e=>M_.get(e)??e,z_=(e,t,n,r)=>{const s=n;s.type="string";const{minimum:i,maximum:a,format:o,patterns:l,contentEncoding:c,laxFormat:u}=Gn(e);if(typeof i=="number"&&(s.minLength=i),typeof a=="number"&&(s.maxLength=a),o&&(s.format=N_[o]??o,s.format===""&&delete s.format,(o==="time"||u)&&delete s.format),c&&(s.contentEncoding=c),l&&l.size>0){const f=[...l].map(K1);f.length===1?s.pattern=f[0].source:f.length>1&&(s.allOf=[...f.map(m=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},$_=(e,t,n,r)=>{const s=n,{minimum:i,maximum:a,multipleOf:o,exclusiveMaximum:l,exclusiveMinimum:c,isInt:u}=Gn(e);s.type=u?"integer":"number";const f=typeof c=="number"&&c>=(i??Number.NEGATIVE_INFINITY),m=typeof l=="number"&&l<=(a??Number.POSITIVE_INFINITY),h=t.target==="draft-04"||t.target==="openapi-3.0";if(f?h?(s.minimum=c,s.exclusiveMinimum=!0):s.exclusiveMinimum=c:typeof i=="number"&&(s.minimum=i),m?h?(s.maximum=l,s.exclusiveMaximum=!0):s.exclusiveMaximum=l:typeof a=="number"&&(s.maximum=a),o){const y=new Set;for(const k of o)Number.isFinite(k)&&k!==0?y.add(Math.abs(k)):us(e,t,s,r,`A multipleOf divisor of ${k} cannot be represented in JSON Schema`);const[b,...S]=y;b!==void 0&&(s.multipleOf=b),S.length&&(s.allOf=[...s.allOf??[],...S.map(k=>({multipleOf:k}))])}},D_=(e,t,n,r)=>{n.type="boolean"},P_=(e,t,n,r)=>{n.not={}},B_=(e,t,n,r)=>{},L_=(e,t,n,r)=>{const s=e._zod.def,i=qc(s.entries);if(i.length===0){n.not={};return}i.every(a=>typeof a=="number")&&(n.type="number"),i.every(a=>typeof a=="string")&&(n.type="string"),n.enum=i},F_=(e,t,n,r)=>{const s=e._zod.def;if(s.values.length===0){n.not={};return}const i=[];for(const a of s.values)if(a===void 0){if(us(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof a=="bigint"){if(us(e,t,n,r,"BigInt literals cannot be represented in JSON Schema"))return;i.push(Number(a))}else i.push(a);if(i.length!==0)if(i.length===1){const a=i[0];n.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[a]:n.const=a}else i.every(a=>typeof a=="number")&&(n.type="number"),i.every(a=>typeof a=="string")&&(n.type="string"),i.every(a=>typeof a=="boolean")&&(n.type="boolean"),i.every(a=>a===null)&&(n.type="null"),n.enum=i},U_=(e,t,n,r)=>{us(e,t,n,r,"Custom types cannot be represented in JSON Schema")},q_=(e,t,n,r)=>{us(e,t,n,r,"Transforms cannot be represented in JSON Schema")},H_=(e,t,n,r)=>{const s=n,i=e._zod.def,{minimum:a,maximum:o}=Gn(e);typeof a=="number"&&(s.minItems=a),typeof o=="number"&&(s.maxItems=o),s.type="array",s.items=Kt(i.element,t,{...r,path:[...r.path,"items"]})};function To(e){const t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?To(t.out):t.type==="catch"?To(t.innerType):e._zod.optin}const V_=(e,t,n,r)=>{const s=n,i=e._zod.def,a=i.shape;if(Object.getOwnPropertySymbols(a).length&&us(e,t,s,r,"Symbol keys cannot be represented in JSON Schema"))return;s.type="object",s.properties={};for(const c in a)Dr(s.properties,c,Kt(a[c],t,{...r,path:[...r.path,"properties",c]}));const l=[];for(const c of Object.keys(a)){const u=i.shape[c];(t.io==="input"?To(u)===void 0:u._zod.optout===void 0)&&l.push(c)}l.length>0&&(s.required=l),i.catchall?._zod.def.type==="never"?s.additionalProperties=!1:i.catchall?i.catchall&&(s.additionalProperties=Kt(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},j_=(e,t,n,r)=>{const s=e._zod.def,i=s.inclusive===!1,a=s.options.map((o,l)=>Kt(o,t,{...r,path:[...r.path,i?"oneOf":"anyOf",l]}));i?n.oneOf=a:n.anyOf=a},G_=(e,t,n,r)=>{const s=e._zod.def,i=Kt(s.left,t,{...r,path:[...r.path,"allOf",0]}),a=Kt(s.right,t,{...r,path:[...r.path,"allOf",1]}),o=c=>"allOf"in c&&Object.keys(c).length===1,l=[...o(i)?i.allOf:[i],...o(a)?a.allOf:[a]];n.allOf=l,t.intersections.push(l)};function Wc(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);const y=e.get(t)?.def;if(!y)return t;const b=Wc(e,y,n);return b===y?t:b}for(const y of["anyOf","oneOf"]){const b=t[y];if(!Array.isArray(b))continue;const S=b.map(k=>Wc(e,k,n));S.some((k,P)=>k!==b[P])&&(t={...t,[y]:S})}const r=Array.isArray(t.type)?t.type:[t.type],s=!r.includes("string")&&r.some(y=>y==="number"||y==="integer"),i=t.enum??(t.const!==void 0?[t.const]:void 0);if(!s&&!i?.some(y=>typeof y=="number"))return t;const{minimum:a,maximum:o,exclusiveMinimum:l,exclusiveMaximum:c,multipleOf:u,format:f,id:m,...h}=t;return h.enum?h.enum=h.enum.map(y=>typeof y=="number"?String(y):y):typeof h.const=="number"&&(h.const=String(h.const)),s&&(h.type="string",i||(h.pattern=(r.includes("number")?tu:nx).source)),h}const Qc=new WeakMap;function Z_(e){const t=new Map;for(const r of e.seen.values())r.def&&!t.has(r.schema)&&t.set(r.schema,r);const n=new Map;for(const r of Qc.get(e)??[]){const s=e.seen.get(r),i=(s?.def??s?.schema)?.propertyNames;if(!i||i===!0||n.has(i))continue;const a=Wc(t,i,new Set);a!==i&&n.set(i,a)}if(n.size)for(const r of e.seen.values())for(const s of[r.schema,r.def]){const i=s&&n.get(s.propertyNames);i&&(s.propertyNames=i)}}const K_=(e,t,n,r)=>{const s=n,i=e._zod.def;s.type="object";const a=i.keyType,o=Gn(a).patterns;if(i.mode==="loose"&&o&&o.size>0){const u=Kt(i.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});s.patternProperties={};for(const f of o)Dr(s.patternProperties,K1(f).source,u)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){s.propertyNames=Kt(i.keyType,t,{...r,path:[...r.path,"propertyNames"]});let u=Qc.get(t);u||(u=[],Qc.set(t,u),t.deferred.push(()=>Z_(t))),u.push(e)}s.additionalProperties=Kt(i.valueType,t,{...r,path:[...r.path,"additionalProperties"]})}const l=a._zod.values,c=t.io==="input"&&To(i.valueType)!==void 0;if(l&&!i.partial&&!c){const u=[...l].filter(f=>typeof f=="string"||typeof f=="number");u.length>0&&(s.required=u.map(String))}},W_=(e,t,n,r)=>{const s=e._zod.def,i=Kt(s.innerType,t,r),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=s.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]},Q_=(e,t,n,r)=>{const s=e._zod.def;Kt(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType},au=Symbol();function W1(e,t,n,r,s){let i=!1;const a=JSON.stringify(e,(o,l)=>typeof l!="bigint"?l:(i=!0,null));return i?(us(t,n,r,s,"BigInt defaults cannot be represented in JSON Schema"),au):JSON.parse(a)}const J_=(e,t,n,r)=>{const s=e._zod.def;Kt(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType;const a=W1(s.defaultValue,e,t,n,r);a!==au&&(n.default=a)},Y_=(e,t,n,r)=>{const s=e._zod.def;Kt(s.innerType,t,r);const i=t.seen.get(e);if(i.ref=s.innerType,t.io!=="input")return;const a=W1(s.defaultValue,e,t,n,r);a!==au&&(n._prefault=a)},X_=(e,t,n,r)=>{const s=e._zod.def;Kt(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType;let a;try{a=s.catchValue(void 0)}catch{us(e,t,n,r,"Dynamic catch values are not supported in JSON Schema");return}n.default=a},eE=(e,t,n,r)=>{const s=e._zod.def,i=s.in._zod.traits.has("$ZodTransform"),a=t.io==="input"?i?s.out:s.in:s.out;Kt(a,t,r);const o=t.seen.get(e);o.ref=a},tE=(e,t,n,r)=>{const s=e._zod.def;Kt(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType,n.readOnly=!0},Q1=(e,t,n,r)=>{const s=e._zod.def;Kt(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType},jf=new WeakSet([Object.prototype,Error.prototype]);function Va(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){const r=n(this);return Object.defineProperty(this,t,{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,t,{value:r,configurable:!0,writable:!0})}})}const nE=(e,t)=>{pS.init(e,t),e.name="ZodError";const n=Object.getPrototypeOf(e);jf.has(n)||(jf.add(n),Va(n,"format",r=>s=>vS(r,s)),Va(n,"flatten",r=>s=>gS(r,s)),Va(n,"addIssue",r=>s=>{r.issues.push(s),r.message=JSON.stringify(r.issues,Hc,2)}),Va(n,"addIssues",r=>s=>{r.issues.push(...s),r.message=JSON.stringify(r.issues,Hc,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},qn=J("ZodError",nE,void 0,{Parent:Error}),rE=J0(qn),sE=Y0(qn),iE=X0(qn),aE=eu(qn),oE=kS(qn),lE=_S(qn),cE=ES(qn),uE=AS(qn),dE=TS(qn),fE=IS(qn),hE=RS(qn),pE=CS(qn);function mE(){Zn.localeError||dr(Nk())}function tl(){Zn.memoizer||dr({memoizer:Rk()})}const $t=J("ZodType",(e,t)=>(mE(),zt.init(e,t),e.def=t,e.type=t.type,e),{check(...e){const t=this.def;return this.clone(Tn(t,{checks:[...t.checks??[],...e.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return ps(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(uA(e,t))},superRefine(e,t){return this.check(dA(e,t))},overwrite(e){return this.check(gi(e))},optional(){return Kf(this)},exactOptional(){return JE(this)},nullable(){return Wf(this)},nullish(){return Kf(Wf(this))},nonoptional(e){return rA(this,e)},array(){return Ue(this)},or(e){return vi([this,e])},and(e){return KE(this,e)},transform(e){return Qf(this,X1(e))},default(e){return eA(this,e)},prefault(e){return nA(this,e)},catch(e){return iA(this,e)},pipe(e){return Qf(this,e)},readonly(){return lA(this)},describe(e){const t=this.clone();return Pi.add(t,{description:e}),t},meta(...e){if(e.length===0)return Pi.get(this);const t=this.clone();return Pi.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return m1(this,"~standard",{...k1(this),jsonSchema:{input:Ao(this,"input"),output:Ao(this,"output")}})},set"~standard"(e){cs(this,"~standard",e)},parse:function e(t,n){return rE(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await sE(this,t,n,{callee:e})},safeParse(e,t){return iE(this,e,t)},async safeParseAsync(e,t){return aE(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){cs(this,"spa",e)},validate(e,t){return wS(this,e,t)},validateAsync(e,t){return xS(this,e,t)},encode:function e(t,n){return oE(this,t,n,{callee:e})},decode:function e(t,n){return lE(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await cE(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await uE(this,t,n,{callee:e})},safeEncode(e,t){return dE(this,e,t)},safeDecode(e,t){return fE(this,e,t)},async safeEncodeAsync(e,t){return hE(this,e,t)},async safeDecodeAsync(e,t){return pE(this,e,t)},toJSONSchema(e){return C_(this,{})(e)},get description(){return Pi.get(this)?.description},get _def(){return this._zod.def}}),J1=J("_ZodString",(e,t)=>{ru.init(e,t),$t.init(e,t),e._zod.processJSONSchema=(n,r,s)=>z_(e,n,r)},g1({format:e=>Gn(e).format??null,minLength:e=>Gn(e).minimum??null,maxLength:e=>Gn(e).maximum??null},{regex(...e){return this.check(p_(...e))},includes(...e){return this.check(v_(...e))},startsWith(...e){return this.check(b_(...e))},endsWith(...e){return this.check(y_(...e))},min(...e){return this.check(Eo(...e))},max(...e){return this.check(P1(...e))},length(...e){return this.check(B1(...e))},nonempty(...e){return this.check(Eo(1,...e))},lowercase(e){return this.check(m_(e))},uppercase(e){return this.check(g_(e))},trim(){return this.check(S_())},normalize(...e){return this.check(w_(...e))},toLowerCase(){return this.check(x_())},toUpperCase(){return this.check(k_())},slugify(){return this.check(__())}})),gE=J("ZodString",(e,t)=>{ru.init(e,t),J1.init(e,t)},{email(e){return this.check(Dk(SE,e))},url(e){return this.check(qk(kE,e))},jwt(e){return this.check(r_(BE,e))},emoji(e){return this.check(Hk(_E,e))},guid(e){return this.check(Pk(xE,e))},uuid(e){return this.check(Bk(ja,e))},uuidv4(e){return this.check(Lk(ja,e))},uuidv6(e){return this.check(Fk(ja,e))},uuidv7(e){return this.check(Uk(ja,e))},nanoid(e){return this.check(Vk(EE,e))},cuid(e){return this.check(jk(AE,e))},cuid2(e){return this.check(Gk(TE,e))},ulid(e){return this.check(Zk(IE,e))},base64(e){return this.check(e_($E,e))},base64url(e){return this.check(t_(DE,e))},xid(e){return this.check(Kk(RE,e))},ksuid(e){return this.check(Wk(CE,e))},ipv4(e){return this.check(Qk(OE,e))},ipv6(e){return this.check(Jk(NE,e))},cidrv4(e){return this.check(Yk(ME,e))},cidrv6(e){return this.check(Xk(zE,e))},e164(e){return this.check(n_(PE,e))},datetime(e){return this.check(s_(vE,e))},date(e){return this.check(i_(bE,e))},time(e){return this.check(a_(yE,e))},duration(e){return this.check(o_(wE,e))}});function ge(e){return $k(gE,e)}const Dt=J("ZodStringFormat",(e,t)=>{Ot.init(e,t),J1.init(e,t)}),vE=J("ZodISODateTime",(e,t)=>{Px.init(e,t),Dt.init(e,t)}),bE=J("ZodISODate",(e,t)=>{Bx.init(e,t),Dt.init(e,t)}),yE=J("ZodISOTime",(e,t)=>{Lx.init(e,t),Dt.init(e,t)}),wE=J("ZodISODuration",(e,t)=>{Fx.init(e,t),Dt.init(e,t)}),SE=J("ZodEmail",(e,t)=>{kx.init(e,t),Dt.init(e,t)}),xE=J("ZodGUID",(e,t)=>{Sx.init(e,t),Dt.init(e,t)}),ja=J("ZodUUID",(e,t)=>{xx.init(e,t),Dt.init(e,t)}),kE=J("ZodURL",(e,t)=>{Rx.init(e,t),Dt.init(e,t)}),_E=J("ZodEmoji",(e,t)=>{Cx.init(e,t),Dt.init(e,t)}),EE=J("ZodNanoID",(e,t)=>{Ox.init(e,t),Dt.init(e,t)}),AE=J("ZodCUID",(e,t)=>{Nx.init(e,t),Dt.init(e,t)}),TE=J("ZodCUID2",(e,t)=>{Mx.init(e,t),Dt.init(e,t)}),IE=J("ZodULID",(e,t)=>{zx.init(e,t),Dt.init(e,t)}),RE=J("ZodXID",(e,t)=>{$x.init(e,t),Dt.init(e,t)}),CE=J("ZodKSUID",(e,t)=>{Dx.init(e,t),Dt.init(e,t)}),OE=J("ZodIPv4",(e,t)=>{Ux.init(e,t),Dt.init(e,t)}),NE=J("ZodIPv6",(e,t)=>{Hx.init(e,t),Dt.init(e,t)}),ME=J("ZodCIDRv4",(e,t)=>{Vx.init(e,t),Dt.init(e,t)}),zE=J("ZodCIDRv6",(e,t)=>{Gx.init(e,t),Dt.init(e,t)}),$E=J("ZodBase64",(e,t)=>{Zx.init(e,t),Dt.init(e,t)}),DE=J("ZodBase64URL",(e,t)=>{Wx.init(e,t),Dt.init(e,t)}),PE=J("ZodE164",(e,t)=>{Qx.init(e,t),Dt.init(e,t)}),BE=J("ZodJWT",(e,t)=>{Yx.init(e,t),Dt.init(e,t)}),ou=J("ZodNumber",(e,t)=>{R1.init(e,t),$t.init(e,t),e._zod.processJSONSchema=(n,r,s)=>$_(e,n,r,s),e.isFinite=!0},g1({minValue:e=>{const{minimum:t,exclusiveMinimum:n}=Gn(e);return Math.max(t??Number.NEGATIVE_INFINITY,n??Number.NEGATIVE_INFINITY)},maxValue:e=>{const{maximum:t,exclusiveMaximum:n}=Gn(e);return Math.min(t??Number.POSITIVE_INFINITY,n??Number.POSITIVE_INFINITY)},isInt:e=>{const{isInt:t,multipleOf:n}=Gn(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>Gn(e).format??null},{gt(e,t){return this.check(Df(e,t))},gte(e,t){return this.check(Ql(e,t))},min(e,t){return this.check(Ql(e,t))},lt(e,t){return this.check($f(e,t))},lte(e,t){return this.check(Wl(e,t))},max(e,t){return this.check(Wl(e,t))},int(e){return this.check(Gf(e))},safe(e){return this.check(Gf(e))},positive(e){return this.check(Df(0,e))},nonnegative(e){return this.check(Ql(0,e))},negative(e){return this.check($f(0,e))},nonpositive(e){return this.check(Wl(0,e))},multipleOf(e,t){return this.check(Pf(e,t))},step(e,t){return this.check(Pf(e,t))},finite(){return this}}));function Ee(e){return l_(ou,e)}const LE=J("ZodNumberFormat",(e,t)=>{Xx.init(e,t),ou.init(e,t)});function Gf(e){return u_(LE,e)}const FE=J("ZodBoolean",(e,t)=>{ek.init(e,t),$t.init(e,t),e._zod.processJSONSchema=(n,r,s)=>D_(e,n,r)});function Lt(e){return d_(FE,e)}const UE=J("ZodUnknown",(e,t)=>{tk.init(e,t),$t.init(e,t),e._zod.processJSONSchema=(n,r,s)=>B_()});function zs(){return f_(UE)}const qE=J("ZodNever",(e,t)=>{nk.init(e,t),$t.init(e,t),e._zod.processJSONSchema=(n,r,s)=>P_(e,n,r)});function HE(e){return h_(qE,e)}const VE=J("ZodArray",(e,t)=>{tl(),ik.init(e,t),$t.init(e,t),e._zod.processJSONSchema=(n,r,s)=>H_(e,n,r,s),e.element=t.element},{min(e,t){return this.check(Eo(e,t))},nonempty(e){return this.check(Eo(1,e))},max(e,t){return this.check(P1(e,t))},length(e,t){return this.check(B1(e,t))},unwrap(){return this.element}});function Ue(e,t){return E_(VE,e,t)}const jE=J("ZodObject",(e,t)=>{tl(),lk.init(e,t),$t.init(e,t),e._zod.processJSONSchema=(n,r,s)=>V_(e,n,r,s),aS(e,"shape",n=>n._zod.def.shape,!1)},{keyof(){return Ke(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(Tn(this._zod.def,{catchall:e}))},passthrough(){return this.clone(Tn(this._zod.def,{catchall:zs()}))},loose(){return this.clone(Tn(this._zod.def,{catchall:zs()}))},strict(){return this.clone(Tn(this._zod.def,{catchall:HE()}))},strip(){return this.clone(Tn(this._zod.def,{catchall:void 0}))},extend(e){return W9(this,e)},safeExtend(e){return Q9(this,e)},merge(e){return J9(this,e)},pick(e){return Z9(this,e)},omit(e){return K9(this,e)},partial(...e){return vf(eg,this,e[0])},exactPartial(...e){return vf(tg,this,e[0],"exactPartial")},required(...e){return Y9(ng,this,e[0])}});function K(e,t){const n={type:"object",shape:e??{},...Me(t)};return new jE(n)}const Y1=J("ZodUnion",(e,t)=>{N1.init(e,t),$t.init(e,t),e._zod.processJSONSchema=(n,r,s)=>j_(e,n,r,s),e.options=t.options});function vi(e,t){return new Y1({type:"union",options:e,...Me(t)})}const GE=J("ZodDiscriminatedUnion",(e,t)=>{Y1.init(e,t),uk.init(e,t)});function xn(e,t,n){return new GE({type:"union",options:t,discriminator:e,...Me(n)})}const ZE=J("ZodIntersection",(e,t)=>{dk.init(e,t),$t.init(e,t),e._zod.processJSONSchema=(n,r,s)=>G_(e,n,r,s)});function KE(e,t){return new ZE({type:"intersection",left:e,right:t})}const Zf=J("ZodRecord",(e,t)=>{tl(),fk.init(e,t),$t.init(e,t),e._zod.processJSONSchema=(n,r,s)=>K_(e,n,r,s),e.keyType=t.keyType,e.valueType=t.valueType});function lu(e,t,n){return!t||!t._zod?new Zf({type:"record",keyType:ge(),valueType:e,...Me(t)}):new Zf({type:"record",keyType:e,valueType:t,...Me(n)})}const Jc=J("ZodEnum",(e,t)=>{hk.init(e,t),$t.init(e,t),e._zod.processJSONSchema=(r,s,i)=>L_(e,r,s),e.enum=t.entries,e.options=[...e._zod.values];const n=new Set(Object.keys(t.entries));e.extract=(r,s)=>{const i={};for(const a of r)if(n.has(a))i[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new Jc({...t,checks:[],...Me(s),entries:i})},e.exclude=(r,s)=>{const i={...t.entries};for(const a of r)if(n.has(a))delete i[a];else throw new Error(`Key ${a} not found in enum`);return new Jc({...t,checks:[],...Me(s),entries:i})}});function Ke(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Jc({type:"enum",entries:n,...Me(t)})}const WE=J("ZodLiteral",(e,t)=>{pk.init(e,t),$t.init(e,t),e._zod.processJSONSchema=(n,r,s)=>F_(e,n,r,s),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Fe(e,t){return new WE({type:"literal",values:Array.isArray(e)?e:[e],...Me(t)})}const QE=J("ZodTransform",(e,t)=>{tl(),mk.init(e,t),$t.init(e,t),e._zod.processJSONSchema=(n,r,s)=>q_(e,n,r,s),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new v1(e.constructor.name);n.addIssue=i=>{if(typeof i=="string")n.issues.push(ia(i,n.value,t));else{const a=i;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),"input"in a||(a.input=n.value),a.inst??(a.inst=e),n.issues.push(ia(a))}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(i=>(n.value=i,n)):(n.value=s,n)}});function X1(e){return new QE({type:"transform",transform:e})}const eg=J("ZodOptional",(e,t)=>{M1.init(e,t),$t.init(e,t),e._zod.processJSONSchema=(n,r,s)=>Q1(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function Kf(e){return new eg({type:"optional",innerType:e})}const tg=J("ZodExactOptional",(e,t)=>{gk.init(e,t),$t.init(e,t),e._zod.processJSONSchema=(n,r,s)=>Q1(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function JE(e){return new tg({type:"optional",innerType:e})}const YE=J("ZodNullable",(e,t)=>{vk.init(e,t),$t.init(e,t),e._zod.processJSONSchema=(n,r,s)=>W_(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function Wf(e){return new YE({type:"nullable",innerType:e})}const XE=J("ZodDefault",(e,t)=>{bk.init(e,t),$t.init(e,t),e._zod.processJSONSchema=(n,r,s)=>J_(e,n,r,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function eA(e,t){return new XE({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():d1(t)}})}const tA=J("ZodPrefault",(e,t)=>{yk.init(e,t),$t.init(e,t),e._zod.processJSONSchema=(n,r,s)=>Y_(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function nA(e,t){return new tA({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():d1(t)}})}const ng=J("ZodNonOptional",(e,t)=>{wk.init(e,t),$t.init(e,t),e._zod.processJSONSchema=(n,r,s)=>Q_(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function rA(e,t){return new ng({type:"nonoptional",innerType:e,...Me(t)})}const sA=J("ZodCatch",(e,t)=>{Sk.init(e,t),$t.init(e,t),e._zod.processJSONSchema=(n,r,s)=>X_(e,n,r,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function iA(e,t){return new sA({type:"catch",innerType:e,catchValue:typeof t=="function"?t:lS(t)})}const rg=J("ZodPipe",(e,t)=>{z1.init(e,t),$t.init(e,t),e._zod.processJSONSchema=(n,r,s)=>eE(e,n,r,s),e.in=t.in,e.out=t.out});function Qf(e,t){return new rg({type:"pipe",in:e,out:t})}const aA=J("ZodPreprocess",(e,t)=>{rg.init(e,t),xk.init(e,t)}),oA=J("ZodReadonly",(e,t)=>{kk.init(e,t),$t.init(e,t),e._zod.processJSONSchema=(n,r,s)=>tE(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function lA(e){return new oA({type:"readonly",innerType:e})}const cA=J("ZodCustom",(e,t)=>{_k.init(e,t),$t.init(e,t),e._zod.processJSONSchema=(n,r,s)=>U_(e,n,r,s)});function uA(e,t={}){return A_(cA,e,t)}function dA(e,t){return T_(e,t)}function fA(e,t){return new aA({type:"pipe",in:X1(e),out:t})}const aa={custom:"custom"};function sg(e){return c_(ou,e)}const Ne=ge().trim(),H=Ne.min(1),ct=ge().datetime(),hA=160,Pr=ge().trim().min(1).max(hA),pA=Pr.optional(),Fs=ge().trim().min(1).max(120),bi=6,mA=20,nl=20*1024*1024,gA=500*1024,Jf=40*1024*1024,ts={Snapshot:"ai-session.snapshot",Patch:"ai-session.patch",Removed:"ai-session.removed"},rl=H.max(80),yi=Ke(["app-session","ai-session"]),oa=Ke(["image","file"]),ig={scopeType:Ke(["session","create-request"]),scopeId:H.max(160),kind:oa,name:H.max(240),mime:H.max(120)};K({...ig,size:sg().int().positive().max(nl)}).strict();const cu=ge().regex(/^cia_[a-f0-9]{24}$/);K({attachmentId:cu,...ig,size:Ee().int().positive().max(nl)}).strict();K({offset:sg().int().nonnegative()}).strict();K({attachmentId:cu,offset:Ee().int().nonnegative()});K({id:cu,kind:oa,name:H.max(240),mime:H.max(120),size:Ee().int().positive().max(nl),expiresAt:ct});const Io=K({id:H.max(120),kind:oa,name:H.max(240),mime:H.max(120),size:Ee().int().min(0).max(Number.MAX_SAFE_INTEGER)}),vA=Ke(["available","expired","missing"]),ag=Io.extend({contentState:vA.default("available")}).strict(),og=K({id:H.max(240),text:ge(),attachments:Ue(ag).max(bi).default([])}).strict(),uu=Ke(["running","waiting","idle","failed"]),sl=Ke(["thinking","tool","editing","approval","responding","unknown"]),du=K({id:H.max(240).optional(),kind:H.max(80).optional(),name:H.max(120),inputPreview:Ne.max(500).optional(),startedAt:ct.optional()}).strict(),bA=Ke(["running","completed","failed","waiting"]),fu=K({id:H.max(240),turnId:H.max(240)}).strict(),yA=fu.extend({type:Fe("user-message"),text:ge(),attachments:Ue(ag).max(bi).optional()}).strict(),wA=fu.extend({type:Fe("ai-message"),text:ge()}).strict(),lg=fu.extend({type:Fe("activity"),activityKind:H.max(120),title:H.max(240),status:bA.optional(),summary:ge().max(4e3).optional(),input:ge().max(1e5).optional(),output:ge().max(1e6).optional(),paths:Ue(H.max(4096)).max(500).optional(),exitCode:Ee().int().optional(),durationMs:Ee().int().nonnegative().optional()}).strict(),il=xn("type",[yA,wA,lg]),SA=K({sessionId:H.max(120),providerSessionId:H.max(240),items:Ue(il),generatedAt:ct}).strict(),xA=K({sessionId:H.max(120),turnId:H.max(240),items:Ue(il),generatedAt:ct}).strict(),kA=50;K({sessionId:H.max(120),turnId:H.max(240),revision:H.max(64),boundaryItemId:H.max(240).optional(),items:Ue(lg).max(kA),total:Ee().int().min(0),truncated:Lt(),generatedAt:ct}).strict();const _A=Ke(["pending-init","running","interrupted","completed","errored","shutdown","not-found"]),EA=Ke(["started","interacted","interrupted"]),AA=K({threadId:H.max(240),path:Ne.max(4096).optional(),status:_A,activity:EA.optional(),message:Ne.max(1e3).optional(),updatedAt:ct}).strict();function TA(e){return e.status!=="completed"}const hu=Ue(AA).max(50).transform(e=>e.filter(TA)),IA=K({toolCalls:Ee().int().min(0).default(0),edits:Ee().int().min(0).default(0),approvals:Ee().int().min(0).default(0)}).strict().default({toolCalls:0,edits:0,approvals:0}),RA=Ke(["active","paused","blocked","usageLimited","budgetLimited","complete"]),pu=K({objective:H.max(4e3),status:RA,tokenBudget:Ee().int().positive().max(Number.MAX_SAFE_INTEGER).nullable(),tokensUsed:Ee().int().min(0).max(Number.MAX_SAFE_INTEGER),timeUsedSeconds:Ee().int().min(0).max(Number.MAX_SAFE_INTEGER)}).strict(),cg=Ke(["allow","deny","skip"]),ug=K({id:H.max(120),decisions:Ue(cg).min(1).max(3)}),dg=K({send:Lt().optional(),interrupt:Lt().optional(),approval:Lt().optional(),approvalRequest:ug.optional(),fork:Lt().optional(),rename:Lt().optional(),openApp:Lt().optional(),close:Lt().optional()}),Yf=H.max(240),Ro=xn("kind",[K({kind:Fe("fork"),parentProviderSessionId:Yf,throughTurnId:H.max(240).optional()}).strict(),K({kind:Fe("subagent"),parentProviderSessionId:Yf}).strict()]);function CA(e){if(!e||typeof e!="object"||Array.isArray(e))return;const t=e;if(t.kind==="fork"){const n=Ro.safeParse({kind:"fork",parentProviderSessionId:t.parentProviderSessionId,...typeof t.throughTurnId=="string"?{throughTurnId:t.throughTurnId}:{}});return n.success?n.data:void 0}if(t.kind==="subagent"){const n=Ro.safeParse({kind:"subagent",parentProviderSessionId:t.parentProviderSessionId});return n.success?n.data:void 0}}const fg=fA(CA,Ro.optional()),OA=vi([Io.extend({source:K({type:Fe("inline"),encoding:Fe("base64"),data:ge().min(1).max(30*1024*1024)}).strict()}).strict().superRefine((e,t)=>{const n=e.kind==="image"?nl:gA;(e.size<=0||(e.kind==="file"?e.size>=n:e.size>n))&&t.addIssue({code:aa.custom,path:["size"],message:`Inline ${e.kind} must be between 1 byte and ${n} bytes.`})}),Io.extend({source:K({type:Fe("runtime-path"),path:H.max(4096)}).strict()}).strict()]),NA=Io.extend({sourceType:Ke(["inline","runtime-path"])}).strict(),hg=vi([K({id:H.max(120),kind:oa.optional(),source:K({type:Fe("upload-ref")}).strict().default({type:"upload-ref"})}).strict(),K({id:H.max(120),kind:oa,name:H.max(240),mime:H.max(120),size:Ee().int().min(0).max(Number.MAX_SAFE_INTEGER),source:K({type:Fe("runtime-path"),path:H.max(4096)}).strict()}).strict()]),MA=Ke(["auto","queue","steer","immediate"]),pg=Ke(["ask","auto-review","full-access"]);function mu(e){return!!(e.message.trim()||e.attachments?.length||e.references?.length)}const mg=Ke(["review","rename","goal","compact"]);K({command:mg,argument:Ne.max(4e3).optional()}).strict().superRefine((e,t)=>{e.command==="rename"&&!e.argument&&t.addIssue({code:"custom",path:["argument"],message:"Rename requires a thread name."}),(e.command==="review"||e.command==="compact")&&e.argument&&t.addIssue({code:"custom",path:["argument"],message:`${e.command} does not accept an argument.`})});K({command:mg,value:ge().max(4e3).optional(),turnId:H.max(240).optional()}).strict();K({title:Ne.max(120),expectedTitle:Ne.max(240).optional(),clientRequestId:Pr}).strict();K({disposition:Ke(["renamed","already-named"]),aiSessionId:H.max(120),appSessionId:H.max(120).optional(),title:Ne.max(120)}).strict();Ke(["skill","app","plugin","file","directory"]);function gg(e){return!e||e.includes("\\")||e.includes("\0")||e.startsWith("/")||/^[A-Za-z]:/.test(e)?!1:e.split("/").every(t=>t!==""&&t!=="."&&t!=="..")}const Xf=H.max(4096).refine(gg,"File and directory paths must be relative to the session cwd."),Oi=K({name:H.max(240),path:H.max(4096)}),zA=xn("kind",[Oi.extend({kind:Fe("skill"),path:H.max(4096).refine(e=>e.startsWith("/"),"Skill paths must be absolute.")}).strict(),Oi.extend({kind:Fe("app"),path:Ne.min(7).max(4096).regex(/^app:\/\/[^\s/]+$/,"App paths must use app://<id>.")}).strict(),Oi.extend({kind:Fe("plugin"),path:Ne.min(10).max(4096).regex(/^plugin:\/\/[^\s/]+$/,"Plugin paths must use plugin://<id>.")}).strict(),Oi.extend({kind:Fe("file"),path:Xf}).strict(),Oi.extend({kind:Fe("directory"),path:Xf}).strict()]),gu=Ue(zA).max(mA).default([]),$A=Ke(["plugin","skill","file","directory","app"]),DA=1e3,vu=K({kind:$A,name:H.max(240),description:Ne.max(DA).optional(),path:H.max(4096),icon:Ne.max(4096).optional()}).strict().superRefine((e,t)=>{e.kind==="skill"&&!e.path.startsWith("/")&&t.addIssue({code:"custom",path:["path"],message:"Skill paths must be absolute."}),e.kind==="app"&&!/^app:\/\/[^\s/]+$/.test(e.path)&&t.addIssue({code:"custom",path:["path"],message:"App paths must use app://<id>."}),e.kind==="plugin"&&!/^plugin:\/\/[^\s/]+$/.test(e.path)&&t.addIssue({code:"custom",path:["path"],message:"Plugin paths must use plugin://<id>."}),(e.kind==="file"||e.kind==="directory")&&!gg(e.path)&&t.addIssue({code:"custom",path:["path"],message:"File and directory paths must be relative to the session cwd."})}),PA=K({category:Ke(["skills","plugins","apps","files"]),code:H.max(160),message:H.max(2e3)}).strict();K({sessionId:H.max(120),providerSessionId:H.max(240),cwd:H.max(4096),candidates:Ue(vu).max(1e3).default([]),diagnostics:Ue(PA).max(20).default([])}).strict();K({query:Ne.max(240).default("")}).strict();K({sessionId:H.max(120),cwd:H.max(4096),query:Ne.max(240),requestId:H.max(160),candidates:Ue(vu.refine(e=>e.kind==="file"||e.kind==="directory","File search only returns files and directories.")).max(200).default([]),complete:Lt().default(!1)}).strict();K({cwd:H.max(4096),query:Ne.max(240),requestId:H.max(160),candidates:Ue(vu.refine(e=>e.kind==="file"||e.kind==="directory","File search only returns files and directories.")).max(200).default([]),complete:Lt().default(!1)}).strict();const vg=K({message:Ne.max(2e4),mode:MA.optional(),permissionMode:pg.optional(),clientRequestId:pA}),BA=vg.extend({attachments:Ue(OA).max(bi).default([]),references:gu}).strict().superRefine((e,t)=>{mu(e)||t.addIssue({code:aa.custom,path:["message"],message:"A message, attachment, or reference is required."}),e.attachments.reduce((r,s)=>r+(s.source.type==="inline"?s.size:0),0)>Jf&&t.addIssue({code:aa.custom,path:["attachments"],message:`Inline attachments must be ${Jf} bytes or less in total.`})}),LA=vg.extend({attachments:Ue(hg).max(bi).default([]),references:gu}).strict().superRefine((e,t)=>{mu(e)||t.addIssue({code:aa.custom,path:["message"],message:"A message, attachment, or reference is required."})}),FA=K({type:Fe("runtime-path"),path:H.max(4096).refine(e=>e.startsWith("/")||/^[A-Za-z]:[\\/]/.test(e),"Runtime paths must be absolute in the target controlled instance.")}).strict(),ms=K({modelEntityId:H.max(120),modelName:H.max(240),modelUpstreamName:H.max(240).optional()}).strict(),bg=["none","minimal","low","medium","high","xhigh","max","ultra"],gs=Ke(bg);Ke(["session",...bg]);const yg=xn("type",[K({type:Fe("current-folder"),branch:H.max(1024)}).strict(),K({type:Fe("existing-worktree"),repositoryContextId:H.max(160),worktreeId:H.max(160)}).strict(),K({type:Fe("new-worktree"),branchName:H.max(255),startRef:H.max(2048),expectedSnapshotId:H.max(160)}).strict()]),wg=K({mode:Ke(["current-folder","worktree"]),branch:H.max(1024)}).strict();BA.safeExtend({agent:rl,cwd:FA,cwdFolderId:H.max(120).optional(),gitSelection:wg.optional(),workspaceSelection:yg.optional(),clientRequestId:Pr,modelSelection:ms.optional(),reasoningEffort:gs.optional(),storyId:Fs.optional()}).strict();LA.safeExtend({agent:rl,cwdFolderId:H.max(120).optional(),gitSelection:wg.optional(),workspaceSelection:yg.optional(),clientRequestId:Pr,modelSelection:ms.optional(),reasoningEffort:gs.optional(),storyId:Fs.optional()}).strict();K({clientRequestId:Pr,modelSelection:ms}).strict();K({sessionId:H.max(120),accepted:Fe(!0)}).strict();K({clientRequestId:Pr,reasoningEffort:gs}).strict();K({cwdFolderId:H.max(120).optional(),branch:H.max(1024)}).strict();K({sessionId:H.max(120),accepted:Fe(!0)}).strict();K({storyId:Fs.nullable()}).strict();K({sessionId:H.max(120),storyId:Fs.optional()}).strict();K({sessionId:H.max(120),unread:Lt()}).strict();K({path:H.max(4096),lineCount:Ee().int().nonnegative(),tail:ge()}).strict();K({disposition:Ke(["created","already-created"]),aiSessionId:H.max(120),providerSessionId:H.max(240),creationSource:Fe("ai-session")}).strict();const UA=K({mode:Ke(["current","managed-worktree"]).default("current")}).strict().default({mode:"current"});K({clientRequestId:Pr,throughTurnId:H.max(240).optional(),workspace:UA.optional().default({mode:"current"})}).strict();K({disposition:Ke(["created","already-created"]),aiSessionId:H.max(120),providerSessionId:H.max(240),creationSource:Fe("ai-session")}).strict();K({clientRequestId:Pr}).strict();K({disposition:Ke(["opened","already-open"]),aiSessionId:H.max(120),providerSessionId:H.max(240),appSessionId:H.max(120),creationSource:yi}).strict();K({clientRequestId:Pr}).strict();K({disposition:Ke(["closed","already-closed"]),aiSessionId:H.max(120),providerSessionId:H.max(240),creationSource:yi}).strict();K({disposition:Ke(["cleared","already-cleared"]),aiSessionId:H.max(120),clearedSessionIds:Ue(H.max(120))}).strict();K({code:Ke(["invalid-request","not-found","unsupported","provider-unavailable","materialization-failed","open-app-failed","close-failed","conflict"]),message:H.max(4e3),retryable:Lt().default(!1),aiSessionId:H.max(120).optional(),providerSessionId:H.max(240).optional()}).strict();K({decision:cg,approvalRequestId:H.max(120).optional()}).strict();K({expectedRevision:Ee().int().min(0),queueIds:Ue(H.max(120)).max(100)}).strict();K({paused:Lt()}).strict();K({expectedRevision:Ee().int().min(0),message:Ne.max(2e4),attachments:Ue(vi([K({id:H.max(120),source:K({type:Fe("retained")}).strict()}).strict(),hg])).max(bi).optional()}).strict();K({code:H.max(160),message:ge(),instanceId:H.max(160).optional(),nodeId:H.max(160).optional(),route:H.max(4096).optional()}).strict();const qA=K({id:H.max(120),messageId:H.max(240).optional(),message:Ne.max(2e4),attachments:Ue(NA).max(bi).default([]),references:gu,permissionMode:pg.optional(),status:Ke(["queued","sending","failed"]).default("queued"),createdAt:ct,updatedAt:ct,error:Ne.max(4e3).optional()}).strict().superRefine((e,t)=>{mu(e)||t.addIssue({code:aa.custom,path:["message"],message:"A message, attachment, or reference is required."})}),HA=K({revision:Ee().int().min(0).default(0),pendingCount:Ee().int().min(0).default(0),paused:Lt().optional(),items:Ue(qA).max(100).default([])}).strict().default({revision:0,pendingCount:0,items:[]}),Sg=Ke(["control","realtime","adapter-snapshot","transcript-tail","transcript-scan","process-scan","app-session"]),xg=K({id:H.max(240),status:Ke(["running","completed"]),startedAt:ct.optional(),completedAt:ct.optional()}).strict(),Br=K({id:H.max(240),providerTurnId:Ne.max(240).optional(),source:Sg.optional(),userPrompt:Ne.optional(),userMessages:Ue(og).max(100).optional(),status:Ke(["queued","running","waiting","completed","failed"]).default("running"),phase:sl.optional(),summary:Ne.max(1e3).optional(),lastMessage:Ne.optional(),lastMessageItemId:Ne.max(240).optional(),contextCompactions:Ue(xg).max(20).optional(),revision:Ee().int().min(0).default(0),sourcePriority:Ee().int().min(0).max(100).optional(),snapshotVersion:Ee().int().min(0).optional(),observedAt:ct.optional(),startedAt:ct.optional(),updatedAt:ct.optional(),completedAt:ct.optional()}).strict(),eh=160,VA=1e3,kg=K({text:Ne.min(1).refine(e=>!/[\r\n]/u.test(e),"Next input suggestion must be a single line").refine(e=>Array.from(e).length<=eh,`Next input suggestion must be at most ${eh} characters`),turnId:Br.shape.id,generatedAt:ct}).strict(),_g=K({code:Ne.max(120).optional(),message:H.max(VA),turnId:Br.shape.id,generatedAt:ct}).strict(),jA=Br.pick({id:!0,providerTurnId:!0,userPrompt:!0,userMessages:!0,status:!0,phase:!0,summary:!0,lastMessage:!0,contextCompactions:!0,startedAt:!0,updatedAt:!0,completedAt:!0}).strict(),bu=K({id:H.max(120),agent:rl,creationSource:yi.default("app-session"),appSessionId:Ne.max(120).optional(),appId:Ne.max(120).optional(),providerSessionId:Ne.max(240).optional(),lineage:fg,providerMeta:lu(ge(),zs()).optional(),modelSelection:ms.optional(),reasoningEffort:gs.optional(),storyId:Fs.optional(),appBindingKeys:Ue(H.max(240)).max(20).optional(),actions:dg.optional(),activeTurnId:Ne.max(240).optional(),title:Ne.max(240).optional(),cwd:Ne.max(4096).optional(),cwdFolderId:H.max(120).optional(),userPrompt:Ne.optional(),turns:Ue(Br).max(50).optional(),status:uu.default("running"),phase:sl.default("unknown"),summary:Ne.max(1e3).optional(),lastMessage:Ne.optional(),lastMessageItemId:Ne.max(240).optional(),currentTool:du.optional(),toolCallsSinceLastMessage:Ee().int().min(0).default(0),subAgents:hu.default([]),goal:pu.optional(),transcriptPath:Ne.max(4096).optional(),transcriptSize:Ee().int().min(0).optional(),startedAt:ct,updatedAt:ct,completedAt:ct.optional(),error:Ne.max(4e3).optional(),counters:IA,queue:HA,nextInputSuggestion:kg.optional(),nextInputSuggestionError:_g.optional(),unread:Lt().default(!1)}).strict(),GA=bu.pick({id:!0,appBindingKeys:!0,cwd:!0,error:!0,providerMeta:!0,modelSelection:!0,reasoningEffort:!0,queue:!0,subAgents:!0}).strict(),ZA=Br.pick({id:!0,providerTurnId:!0,status:!0,phase:!0,revision:!0,startedAt:!0,updatedAt:!0,completedAt:!0}).extend({bodyRevision:H.max(64)}).strict(),KA=K({sessionId:H.max(120),revision:H.max(64),turns:Ue(ZA).max(50)}).strict(),WA=K({sessionId:H.max(120),revision:H.max(64),turn:Br}).strict(),fr=H.max(64),wi=K({kind:Fe("not-modified"),revision:fr}).strict();xn("kind",[wi,K({kind:Fe("updated"),revision:fr,detail:GA}).strict()]);xn("kind",[wi,K({kind:Fe("updated"),revision:fr,index:KA}).strict()]);xn("kind",[wi,K({kind:Fe("updated"),revision:fr,body:WA}).strict()]);xn("kind",[wi,K({kind:Fe("updated"),revision:fr,timeline:SA}).strict()]);xn("kind",[wi,K({kind:Fe("updated"),revision:fr,timeline:xA}).strict()]);const QA=K({id:H.max(240),revision:fr}).strict(),th=K({revision:fr,item:il}).strict();K({knownItems:Ue(QA).max(1e4).default([])}).strict();xn("kind",[wi,K({kind:Fe("snapshot"),revision:fr,items:Ue(th)}).strict(),K({kind:Fe("delta"),revision:fr,upserted:Ue(th),removed:Ue(H.max(240)),order:Ue(H.max(240)).optional()}).strict()]);const Eg=K({session:bu,provider:H.max(80),action:Ke(["send","queue","steer","interrupt","approval"]),decision:Ke(["allow","deny","skip"]).optional(),turnId:H.max(240).optional(),providerTurnId:H.max(240).optional(),queueId:H.max(120).optional()}).strict(),Ag=Eg.omit({session:!0}).extend({sessionId:H.max(120),messageId:H.max(240).optional()}).strict();K({sessionId:H.max(120),queueRevision:Ee().int().min(0),action:Ke(["retry","remove","edit","reorder","pause"]),queueId:H.max(120).optional()}).strict();function JA(e){const t=e.session.turns?.at(-1),r=(e.queueId?e.session.queue?.items.find(s=>s.id===e.queueId)?.messageId:void 0)||(e.action==="send"||e.action==="queue"||e.action==="steer"?t?.userMessages?.at(-1)?.id:void 0);return Ag.parse({sessionId:e.session.id,provider:e.provider,action:e.action,...e.decision?{decision:e.decision}:{},...e.turnId||e.session.activeTurnId||t?.id?{turnId:e.turnId||e.session.activeTurnId||t?.id}:{},...e.providerTurnId||t?.providerTurnId?{providerTurnId:e.providerTurnId||t?.providerTurnId}:{},...e.queueId?{queueId:e.queueId}:{},...r?{messageId:r}:{}})}vi([Ag,Eg.transform(JA)]);const Tg=1e4,yu=K({id:H.max(120),agent:rl,creationSource:yi,providerSessionId:H.max(240),lineage:fg,modelSelection:ms.optional(),reasoningEffort:gs.optional(),storyId:Fs.optional(),title:Ne.max(240).optional(),userPrompt:Ne.optional(),lastMessage:Ne.optional(),cwd:H.max(4096),cwdFolderId:H.max(120).optional(),lastActiveAt:ct,archivedAt:ct}).strict();K({schemaVersion:Fe(1).default(1),items:Ue(yu).max(Tg).default([])}).strict();K({items:Ue(yu).max(Tg).default([])}).strict();K({item:yu,turns:Ue(jA).max(50).default([])}).strict();K({modelSelection:ms.optional(),reasoningEffort:gs.optional()}).strict();K({disposition:Ke(["resumed","already-open"]),aiSessionId:H.max(120),providerSessionId:H.max(240),appSessionId:H.max(120).optional(),creationSource:yi}).strict();const YA=Br.omit({userMessages:!0}),Ig=bu.pick({id:!0,agent:!0,creationSource:!0,appSessionId:!0,appId:!0,providerSessionId:!0,lineage:!0,providerMeta:!0,modelSelection:!0,reasoningEffort:!0,storyId:!0,appBindingKeys:!0,actions:!0,activeTurnId:!0,title:!0,cwd:!0,cwdFolderId:!0,userPrompt:!0,turns:!0,status:!0,phase:!0,summary:!0,lastMessage:!0,lastMessageItemId:!0,currentTool:!0,toolCallsSinceLastMessage:!0,subAgents:!0,goal:!0,queue:!0,startedAt:!0,updatedAt:!0,error:!0,unread:!0,nextInputSuggestion:!0,nextInputSuggestionError:!0}).extend({turns:Ue(YA).max(50).optional(),detailRevision:H.max(64).optional(),turnsRevision:H.max(64).optional(),latestTurnRef:K({id:Br.shape.id,bodyRevision:H.max(64)}).strict().optional(),turnCount:Ee().int().min(0).optional(),subAgentCount:Ee().int().min(0).optional(),lastUserMessageAt:ct.optional()}).strict(),ma=K({runningCount:Ee().int().min(0).default(0),waitingCount:Ee().int().min(0).default(0),staleCount:Ee().int().min(0).default(0),sessions:Ue(Ig).default([]),updatedAt:ct}).strict(),Yc=K({streamId:H.max(240),revision:Ee().int().min(0),lastEventAt:ct,snapshot:ma}).strict();ma.pick({runningCount:!0,waitingCount:!0,staleCount:!0,updatedAt:!0}).extend({idleCount:Ee().int().min(0).default(0),problemCount:Ee().int().min(0).default(0),revision:Ee().int().min(0).optional()});const XA=Ke(["provider-event","app-session-created","app-session-updated","app-session-deleted","discovery-scan","control-action","heartbeat-sync","next-input-suggestion","startup"]),wu=K({streamId:H.max(240),instanceId:H.max(160),nodeId:H.max(160).optional(),revision:Ee().int().min(0),previousRevision:Ee().int().min(0).optional(),traceId:H.max(160),generatedAt:ct,reason:XA}).strict(),eT=K({meta:wu,snapshot:ma}).strict(),tT=K({meta:wu,upserted:Ue(Ig).default([]),removed:Ue(H.max(120)).default([])}).strict(),nT=K({meta:wu,sessionIds:Ue(H.max(120)).default([]),expiresAt:ct}).strict(),rT=K({instanceId:H.max(160),nodeId:H.max(160).optional(),sessionId:H.max(120),providerSessionId:H.max(240).optional(),turnId:H.max(240),itemId:H.max(240),delta:ge().min(1),generatedAt:ct}).strict();rT.omit({instanceId:!0,nodeId:!0,providerSessionId:!0}).strict();K({instanceId:H.max(160),nodeId:H.max(160).optional(),sessionId:H.max(120),providerSessionId:H.max(240),item:il,generatedAt:ct}).strict();const sT=K({instanceId:H.max(160),nodeId:H.max(160).optional(),sessionId:H.max(120),providerSessionId:H.max(240).optional(),turnId:H.max(240),itemId:H.max(240),field:Fe("output"),delta:ge().min(1),generatedAt:ct}).strict();sT.omit({instanceId:!0,nodeId:!0,providerSessionId:!0}).strict();const Rg=K({streamId:H.max(240),instanceId:H.max(160),sinceRevision:Ee().int().min(0),latestRevision:Ee().int().min(0),earliestRetainedRevision:Ee().int().min(0),syncRequired:Lt().default(!1),events:Ue(xn("type",[K({type:Fe(ts.Snapshot),payload:eT}).strict(),K({type:Fe(ts.Patch),payload:tT}).strict(),K({type:Fe(ts.Removed),payload:nT}).strict()])).default([])}).strict(),iT=K({instanceId:H.max(160),streamId:H.max(240),aiSessions:ma,revision:Ee().int().min(0),lastEventAt:ct}).strict();K({instances:Ue(K({instanceId:H.max(160),streamId:H.max(240),revision:Ee().int().min(0)}).strict()).max(200).default([])}).strict();K({updatedAt:ct,instances:Ue(vi([iT,K({instanceId:H.max(160),streamId:H.max(240),delta:Rg}).strict()])).default([]),removedInstanceIds:Ue(H.max(160)).default([])}).strict();function Cg(e,t){const{meta:n}=t.payload;if(t.type===ts.Snapshot)return e?.streamId===n.streamId&&n.revision===e.revision?{kind:"duplicate",projection:e}:e?.streamId===n.streamId&&n.revision<e.revision?{kind:"stale",projection:e}:{kind:"applied",projection:Yc.parse({streamId:n.streamId,revision:n.revision,lastEventAt:n.generatedAt,snapshot:t.payload.snapshot})};if(!e||e.streamId!==n.streamId)return{kind:"snapshot-required",projection:e,streamId:n.streamId};if(n.revision===e.revision)return{kind:"duplicate",projection:e};if(n.revision<e.revision)return{kind:"stale",projection:e};if(n.revision!==e.revision+1||n.previousRevision!==e.revision)return{kind:"gap",projection:e,expectedRevision:e.revision+1,receivedRevision:n.revision};const r=new Map(e.snapshot.sessions.map(a=>[a.id,a]));if(t.type===ts.Patch){for(const a of t.payload.upserted)r.set(a.id,a);for(const a of t.payload.removed)r.delete(a)}else for(const a of t.payload.sessionIds)r.delete(a);const s=[...r.values()],i=ma.parse({runningCount:s.filter(a=>a.status==="running").length,waitingCount:s.filter(a=>a.status==="waiting").length,staleCount:e.snapshot.staleCount,sessions:s,updatedAt:n.generatedAt});return{kind:"applied",projection:Yc.parse({streamId:n.streamId,revision:n.revision,lastEventAt:n.generatedAt,snapshot:i})}}const Og=K({source:Sg,sourcePriority:Ee().int().min(0).max(100).optional(),observedAt:ct.optional(),snapshotVersion:Ee().int().min(0).optional()}).strict(),aT=Og.extend({type:Fe("snapshot"),agent:H.max(80),creationSource:yi.optional(),appSessionId:Ne.max(120).optional(),appId:Ne.max(120).optional(),providerSessionId:Ne.max(240).optional(),lineage:Ro.optional(),providerMeta:lu(ge(),zs()).optional(),modelSelection:ms.optional(),reasoningEffort:gs.optional(),storyId:Fs.optional(),appBindingKeys:Ue(H.max(240)).max(20).optional(),actions:dg.optional(),title:Ne.max(240).optional(),cwd:Ne.max(4096).optional(),cwdFolderId:H.max(120).optional(),activeTurnId:Ne.max(240).optional(),userPrompt:Ne.optional(),turns:Ue(Br).max(50).optional(),status:uu.optional(),phase:sl.optional(),summary:Ne.max(1e3).optional(),lastMessage:Ne.optional(),lastMessageItemId:Ne.max(240).optional(),error:Ne.max(4e3).optional(),currentTool:du.optional(),toolCallsSinceLastMessage:Ee().int().min(0).optional(),subAgents:hu.optional(),goal:pu.nullable().optional(),transcriptPath:Ne.max(4096).optional(),transcriptSize:Ee().int().min(0).optional(),replaceActivity:Lt().optional()}).strict(),oT=Og.extend({type:Fe("event"),sessionId:H.max(120),kind:Ke(["lifecycle","send-ack","turn-started","user-message","assistant-message","approval-requested","turn-completed","session-error","tool-activity","sub-agent-activity","context-compaction","model-selection","reasoning-effort","goal","next-input-suggestion"]),approvalRequest:ug.optional(),modelSelection:ms.optional(),reasoningEffort:gs.optional(),activeTurnId:Ne.max(240).optional(),providerTurnId:Ne.max(240).optional(),userPrompt:Ne.optional(),userMessage:og.optional(),text:ge().optional(),itemId:Ne.max(240).optional(),status:uu.optional(),phase:sl.optional(),summary:Ne.max(1e3).optional(),error:Ne.max(4e3).optional(),currentTool:du.nullable().optional(),toolCallsSinceLastMessage:Ee().int().min(0).optional(),subAgents:hu.optional(),contextCompaction:xg.optional(),goal:pu.nullable().optional(),suggestion:kg.nullable().optional(),suggestionError:_g.nullable().optional(),counters:K({toolCalls:Ee().int().min(0).optional(),edits:Ee().int().min(0).optional(),approvals:Ee().int().min(0).optional()}).strict().optional()}).strict().superRefine((e,t)=>{if(e.kind==="model-selection"?e.modelSelection||t.addIssue({code:"custom",path:["modelSelection"],message:"model-selection events require modelSelection"}):e.modelSelection!==void 0&&t.addIssue({code:"custom",path:["modelSelection"],message:"modelSelection is only valid for model-selection events"}),e.kind==="reasoning-effort"?e.reasoningEffort||t.addIssue({code:"custom",path:["reasoningEffort"],message:"reasoning-effort events require reasoningEffort"}):e.reasoningEffort!==void 0&&t.addIssue({code:"custom",path:["reasoningEffort"],message:"reasoningEffort is only valid for reasoning-effort events"}),e.kind==="session-error"&&!e.error&&t.addIssue({code:"custom",path:["error"],message:"session-error events require error"}),e.kind==="goal"?Object.prototype.hasOwnProperty.call(e,"goal")||t.addIssue({code:"custom",path:["goal"],message:"goal events require goal (use null when cleared)"}):e.goal!==void 0&&t.addIssue({code:"custom",path:["goal"],message:"goal is only valid for goal events"}),e.kind==="next-input-suggestion"){const n=Object.prototype.hasOwnProperty.call(e,"suggestion"),r=Object.prototype.hasOwnProperty.call(e,"suggestionError");!n&&!r&&t.addIssue({code:"custom",path:["suggestion"],message:"next-input-suggestion events require suggestion or suggestionError (use null when cleared)"}),e.suggestion&&e.suggestionError&&t.addIssue({code:"custom",path:["suggestionError"],message:"suggestion and suggestionError are mutually exclusive"})}else(e.suggestion!==void 0||e.suggestionError!==void 0)&&t.addIssue({code:"custom",path:["suggestion"],message:"suggestion is only valid for next-input-suggestion events"});if(e.kind==="context-compaction"?e.contextCompaction||t.addIssue({code:"custom",path:["contextCompaction"],message:"context-compaction events require contextCompaction"}):e.contextCompaction!==void 0&&t.addIssue({code:"custom",path:["contextCompaction"],message:"contextCompaction is only valid for context-compaction events"}),e.kind!=="send-ack"&&e.kind!=="user-message"&&e.userMessage!==void 0&&t.addIssue({code:"custom",path:["userMessage"],message:"userMessage is only valid for send-ack and user-message events"}),e.kind==="sub-agent-activity"?e.subAgents||t.addIssue({code:"custom",path:["subAgents"],message:"sub-agent-activity events require subAgents"}):e.subAgents!==void 0&&t.addIssue({code:"custom",path:["subAgents"],message:"subAgents is only valid for sub-agent-activity events"}),e.kind!=="tool-activity"){e.currentTool!==void 0&&t.addIssue({code:"custom",path:["currentTool"],message:"currentTool is only valid for tool-activity events"}),e.toolCallsSinceLastMessage!==void 0&&t.addIssue({code:"custom",path:["toolCallsSinceLastMessage"],message:"toolCallsSinceLastMessage is only valid for tool-activity events"});return}"currentTool"in e||t.addIssue({code:"custom",path:["currentTool"],message:"tool-activity events require currentTool"}),e.toolCallsSinceLastMessage===void 0&&t.addIssue({code:"custom",path:["toolCallsSinceLastMessage"],message:"tool-activity events require toolCallsSinceLastMessage"})});xn("type",[aT,oT]);K({type:Fe("snapshot"),data:ge(),pendingEscape:ge(),cols:Ee().int().positive(),rows:Ee().int().positive()}).passthrough();const ns={Snapshot:"app-session.snapshot",Patch:"app-session.patch",Removed:"app-session.removed"},Ng=Ke(["created","starting","running","stopping","stopped","exited","failed","closed","terminated","unknown"]),lT=Ke(["tty","vnc","web"]);K({mode:lT,url:ge().trim().min(1).max(4096),token:ge().trim().min(1).max(512),expiresAt:ge().datetime()}).strict();K({revoked:Lt()}).strict();const cT=K({name:ge().trim().min(1).max(240),size:Ee().int().nonnegative(),updatedAt:ge().datetime(),truncated:Lt(),content:ge()}).strict();K({sessionId:ge().trim().min(1).max(160),logDir:ge().trim().min(1).max(1024),maxBytes:Ee().int().positive(),files:Ue(cT).max(256)}).strict();const uT=new Set(["stopped","failed","exited","closed","terminated"]),Mg=K({type:Ke(["app-session","provider-session","adapter-key"]),id:ge().trim().min(1).max(240),agent:ge().trim().min(1).max(80).optional(),adapter:ge().trim().min(1).max(80).optional(),key:ge().trim().min(1).max(240).optional()}).strict(),al=lu(ge(),zs()).and(K({id:ge().trim().min(1).max(160),appId:ge().trim().min(1).max(160).optional(),title:ge().trim().max(240).optional(),kind:ge().trim().max(80).optional(),status:Ng.default("unknown"),bindings:Ue(Mg).max(40).default([]),workspace:K({cwd:ge().trim().max(4096).optional()}).strict().optional(),createdAt:ge().datetime().optional(),updatedAt:ge().datetime().optional()})),ol=K({runningCount:Ee().int().min(0).default(0),problemCount:Ee().int().min(0).default(0),sessions:Ue(al).default([]),updatedAt:ge().datetime()}).strict(),Xc=K({streamId:ge().trim().min(1).max(240),revision:Ee().int().min(0),lastEventAt:ge().datetime(),snapshot:ol}).strict();ol.pick({runningCount:!0,problemCount:!0,updatedAt:!0}).extend({revision:Ee().int().min(0).optional()});const dT=Ke(["app-session-created","app-session-updated","app-session-deleted","app-session-recovered","control-action","heartbeat-sync","startup"]),Su=K({streamId:ge().trim().min(1).max(240),instanceId:ge().trim().min(1).max(160),nodeId:ge().trim().min(1).max(160).optional(),revision:Ee().int().min(0),previousRevision:Ee().int().min(0).optional(),traceId:ge().trim().min(1).max(160),generatedAt:ge().datetime(),reason:dT}).strict(),fT=K({meta:Su,snapshot:ol}).strict(),hT=K({meta:Su,session:al}).strict(),pT=K({meta:Su,sessionId:ge().trim().min(1).max(160),tombstone:al.optional(),expiresAt:ge().datetime().optional()}).strict(),mT=K({streamId:ge().trim().min(1).max(240),instanceId:ge().trim().min(1).max(160),sinceRevision:Ee().int().min(0),latestRevision:Ee().int().min(0),earliestRetainedRevision:Ee().int().min(0),syncRequired:Lt().default(!1),events:Ue(xn("type",[K({type:Fe(ns.Snapshot),payload:fT}).strict(),K({type:Fe(ns.Patch),payload:hT}).strict(),K({type:Fe(ns.Removed),payload:pT}).strict()])).default([])}).strict();function zg(e,t){const{meta:n}=t.payload;if(t.type===ns.Snapshot)return e?.streamId===n.streamId&&n.revision===e.revision?{kind:"duplicate",projection:e}:e?.streamId===n.streamId&&n.revision<e.revision?{kind:"stale",projection:e}:{kind:"applied",projection:Xc.parse({streamId:n.streamId,revision:n.revision,lastEventAt:n.generatedAt,snapshot:gT(t.payload.snapshot.sessions,t.payload.snapshot.updatedAt)})};if(!e||e.streamId!==n.streamId)return{kind:"snapshot-required",projection:e,streamId:n.streamId};if(n.revision===e.revision)return{kind:"duplicate",projection:e};if(n.revision<e.revision)return{kind:"stale",projection:e};if(n.revision!==e.revision+1||n.previousRevision!==e.revision)return{kind:"gap",projection:e,expectedRevision:e.revision+1,receivedRevision:n.revision};const r=[...e.snapshot.sessions];if(t.type===ns.Patch){const i=r.findIndex(a=>a.id===t.payload.session.id);Pg(t.payload.session.status)?i<0?r.push(t.payload.session):r[i]=t.payload.session:i>=0&&r.splice(i,1)}else{const i=r.findIndex(a=>a.id===t.payload.sessionId);i>=0&&r.splice(i,1)}const s=$g(r,n.generatedAt);return{kind:"applied",projection:Xc.parse({streamId:n.streamId,revision:n.revision,lastEventAt:n.generatedAt,snapshot:s})}}function $g(e,t=new Date().toISOString()){const n=e.map(r=>vT(r));return ol.parse({runningCount:n.filter(r=>r.status==="running").length,problemCount:n.filter(r=>r.status==="failed").length,sessions:n,updatedAt:t})}function gT(e,t=new Date().toISOString()){return $g(e.filter(n=>Pg(typeof n.status=="string"?n.status:void 0)),t)}function vT(e){const t=Dg(typeof e.status=="string"?e.status:void 0),n=typeof e.id=="string"?e.id:"",r=ST(e),{workspace:s,...i}=e;return al.parse({...i,status:t,bindings:xT([...yT(e.bindings),...n?[{type:"app-session",id:n}]:[],...wT(e)]),...r?{workspace:r}:{}})}function Dg(e){const t=(e||"unknown").trim().toLowerCase();return t==="ended"?"closed":t==="terminating"?"stopping":Ng.options.includes(t)?t:"unknown"}function Pg(e){return!uT.has(Dg(e))}function bT(e){return e.type==="app-session"?`app:${e.id}`:e.type==="provider-session"?`provider:${e.agent||""}:${e.id}`:`adapter:${e.adapter||""}:${e.key||e.id}`}function yT(e){return Array.isArray(e)?e.flatMap(t=>{const n=Mg.safeParse(t);return n.success?[n.data]:[]}):[]}function wT(e){const t=lr(e.ai),n=lr(t.claude),r=lr(t.appServer),s=lr(e.launch),i=lr(s.aiSessionResume),a=[],o=ar(i.providerSessionId),l=e.appId==="codex"||e.appId==="claude"||e.appId==="opencode"?e.appId:void 0;l&&o&&a.push({type:"provider-session",agent:l,id:o});const c=ar(n.short);c&&a.push({type:"adapter-key",adapter:"claude",agent:"claude",id:`short:${c}`,key:`short:${c}`});const u=ar(n.providerSessionId);u&&a.push({type:"provider-session",agent:"claude",id:u});const f=Array.isArray(t.threadIds)?t.threadIds.filter(S=>typeof S=="string"&&!!S.trim()):[],m=ar(t.activeThreadId);for(const S of[...new Set([m,...f].filter(Boolean))])a.push({type:"provider-session",agent:"codex",id:S});const h=ar(r.socketPath),y=ar(r.endpoint),b=h?`socket:${h}`:y?`endpoint:${y}`:"";return b&&a.push({type:"adapter-key",adapter:"codex-app-server",agent:"codex",id:b,key:b}),a}function ST(e){const t=lr(e.workspace),n=lr(e.tty),r=lr(e.launch),s=lr(e.ai),i=lr(s.claude),a=ar(t.cwd)||ar(n.cwd)||ar(i.cwd)||ar(r.cwd);return a?{cwd:a}:void 0}function xT(e){const t=new Map;for(const n of e)t.set(bT(n),n);return[...t.values()]}function lr(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}function ar(e){return typeof e=="string"&&e.trim()?e.trim():""}function Bg(e,t){let n=t0(t);for(let r=0;r<100;r+=1){const s=e.safeParse(n);if(s.success)return s;const i=Lg(s.error.issues);let a=!1;for(const o of i){const l=kT(n,o.path);if(!(!l||typeof l!="object"||Array.isArray(l)))for(const c of o.keys)Object.prototype.hasOwnProperty.call(l,c)&&(delete l[c],a=!0)}if(!a)return s}return e.safeParse(n)}function Co(e,t){const n=Bg(e,t);if(!n.success)throw n.error;return n.data}function Lg(e,t=[]){const n=[];for(const r of e){if(r.code==="unrecognized_keys"){n.push({code:"unrecognized_keys",keys:r.keys,path:[...t,...r.path]});continue}if(r.code!=="invalid_union"||!Array.isArray(r.errors))continue;const s=r.errors.filter(a=>Array.isArray(a));if(!s.length)continue;const i=s.reduce((a,o)=>e0(o)<e0(a)?o:a);n.push(...Lg(i,[...t,...r.path]))}return n}function e0(e){return e.reduce((t,n)=>{if(n.code==="unrecognized_keys")return t;if(n.code!=="invalid_union"||!Array.isArray(n.errors))return t+1;const r=n.errors.filter(s=>Array.isArray(s));return t+(r.length?Math.min(...r.map(e0)):1)},0)}function kT(e,t){let n=e;for(const r of t){if(!n||typeof n!="object")return;n=n[r]}return n}function t0(e){return Array.isArray(e)?e.map(t0):!e||typeof e!="object"||Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null?e:Object.fromEntries(Object.entries(e).map(([t,n])=>[t,t0(n)]))}const _T="2026-08-25",Fg=K({nodeId:ge().optional(),instanceId:ge().optional()}).passthrough(),ET=K({v:Fe(1),id:ge().min(1),seq:Ee().finite(),type:ge().min(1),topic:ge().min(1),createdAt:ge().datetime(),payload:zs(),replay:Fe(!0).optional(),scope:Fg.optional()}).passthrough(),AT=K({v:Fe(_T),id:ge().min(1),type:ge().min(1),createdAt:ge().datetime(),payload:zs(),topic:ge().min(1).optional(),replay:Fe(!0).optional(),scope:Fg.optional()}).passthrough();xn("v",[ET,AT]);K({v:Fe(1),type:Fe("ping"),sentAt:ge().datetime()}).strict();K({v:Fe(1),type:Fe("pong"),sentAt:ge().datetime(),receivedAt:ge().datetime()}).strict();K({replaySince:ge().datetime().optional(),messageDeltas:K({allInstances:Lt().default(!1),instanceIds:Ue(ge().trim().min(1).max(160)).max(1e3).default([])}).default({allInstances:!1,instanceIds:[]}),timelineAllSessions:Lt().default(!1),timelineSessions:Ue(K({instanceId:ge().trim().min(1).max(160),sessionId:ge().trim().min(1).max(120)})).max(1e3).default([])});const TT=1,IT=Ke(["ai.sessions","app.sessions"]),RT=K({topic:IT,instanceId:ge().trim().min(1).max(160),streamId:ge().trim().min(1).max(240),latestRevision:Ee().int().min(0),earliestRetainedRevision:Ee().int().min(0)}).strict(),CT=K({protocolVersion:Fe(TT),streams:Ue(RT)}).strict(),OT="streams.hello";let _n,Ni,Ga=0,Za=!1,Ka=!1,Es,As;const la=new Map,Zi=new Map,ei=new Map;let Oo=Jn;function NT(e){return Hh("/api/events",e)}function MT(e){return e.startsWith("trigger.")?[["triggers"],["status"]]:[]}function xu(e,t){Es=t,e.setQueryData(["ai-sessions"],t.snapshot);for(const n of t.snapshot.sessions)e.setQueryData(["ai-session",n.id],n)}function ku(e,t){As=t,e.setQueryData(["app-sessions"],t.snapshot.sessions)}function zT(e){const t=e.payload&&typeof e.payload=="object"?e.payload:{},n=t.meta&&typeof t.meta=="object"?t.meta:{};return{streamId:typeof n.streamId=="string"?n.streamId:"",revision:typeof n.revision=="number"?n.revision:0}}function nh(e,t){const n=la.get(e),r=zT(t);if(!n||r.streamId!==n.streamId)return;const s=ei.get(e);ei.set(e,{streamId:n.streamId,revision:Math.max(s?.streamId===n.streamId?s.revision:0,r.revision)})}function $T(e,t){if(t.type===ts.Snapshot||t.type===ts.Patch||t.type===ts.Removed){if(Zi.has("ai.sessions"))return nh("ai.sessions",t),!0;const n=Cg(Es,{type:t.type,payload:t.payload});return n.kind==="applied"&&xu(e,n.projection),(n.kind==="gap"||n.kind==="snapshot-required")&&n0("ai.sessions",e),!0}if(t.type===ns.Snapshot||t.type===ns.Patch||t.type===ns.Removed){if(Zi.has("app.sessions"))return nh("app.sessions",t),!0;const n=zg(As,{type:t.type,payload:t.payload});return n.kind==="applied"&&ku(e,n.projection),(n.kind==="gap"||n.kind==="snapshot-required")&&n0("app.sessions",e),!0}return!1}async function Mi(e,t){if(e==="ai.sessions"){const r=Co(Yc,await Oo("ai-sessions"));return xu(t,r),r.revision}const n=Co(Xc,await Oo("apps/sessions"));return ku(t,n),n.revision}async function DT(e,t,n){if(e==="ai.sessions"&&Es?.streamId===t.streamId){const r=Co(Rg,await Oo(`ai-sessions?streamId=${encodeURIComponent(t.streamId)}&sinceRevision=${Es.revision}`));if(r.syncRequired)return Mi(e,n);for(const s of r.events){const i=Cg(Es,s);if(i.kind!=="applied"&&i.kind!=="duplicate")return Mi(e,n);xu(n,i.projection)}return Es?.revision||0}if(e==="app.sessions"&&As?.streamId===t.streamId){const r=Co(mT,await Oo(`apps/sessions?streamId=${encodeURIComponent(t.streamId)}&sinceRevision=${As.revision}`));if(r.syncRequired)return Mi(e,n);for(const s of r.events){const i=zg(As,s);if(i.kind!=="applied"&&i.kind!=="duplicate")return Mi(e,n);ku(n,i.projection)}return As?.revision||0}return Mi(e,n)}function n0(e,t){const n=Zi.get(e);if(n)return n;const r=Promise.resolve().then(async()=>{try{for(;;){const s=la.get(e);if(!s)return;const i=e==="ai.sessions"?Es:As,a=ei.get(e),o=Math.max(s.latestRevision,a?.streamId===s.streamId?a.revision:0);if(i?.streamId===s.streamId&&i.revision>=o){ei.get(e)?.streamId===s.streamId&&ei.delete(e);return}await DT(e,s,t)}}finally{Zi.delete(e)}});return Zi.set(e,r),r}function PT(e,t){const n=la.get(e.topic);return n&&n.streamId!==e.streamId&&ei.delete(e.topic),la.set(e.topic,e),n0(e.topic,t)}const BT=l0("events",{state:()=>({connectionState:"idle",streamStates:{"ai.sessions":"disconnected","app.sessions":"disconnected"},reconnects:0,lastEventAt:"",events:[]}),actions:{connect(e){if(_n&&(_n.readyState===WebSocket.CONNECTING||_n.readyState===WebSocket.OPEN))return;clearTimeout(Ni),this.connectionState="connecting";const t=$s();_n=new WebSocket(NT(t.token)),_n.addEventListener("open",()=>{Ga=0,this.connectionState="connected"}),_n.addEventListener("message",n=>{try{const r=JSON.parse(String(n.data));if(this.lastEventAt=r.createdAt,this.events=[r,...this.events].slice(0,50),r.type===OT&&e){const s=Bg(CT,r.payload);if(!s.success){Ka=!0,this.connectionState="error",console.error("SESSION_STREAM_PROTOCOL_INCOMPATIBLE",s.error.issues),_n?.close(1002,"Incompatible session stream protocol.");return}const i=s.data;for(const a of i.streams)this.streamStates[a.topic]="recovering",PT(a,e).then(()=>{this.streamStates[a.topic]="live"});return}if(e&&$T(e,r))return;for(const s of MT(r.type))e?.invalidateQueries({queryKey:s})}catch{this.connectionState="error"}}),_n.addEventListener("close",()=>{if(this.streamStates["ai.sessions"]="disconnected",this.streamStates["app.sessions"]="disconnected",Za||Ka){Za=!1,this.connectionState=Ka?"error":"idle";return}this.connectionState="disconnected",this.scheduleReconnect(e)}),_n.addEventListener("error",()=>{this.connectionState="error"})},disconnect(){clearTimeout(Ni),Ni=void 0,_n?(Za=!0,_n.close()):Za=!1,_n=void 0,la.clear(),Ka=!1,Ga=0,this.connectionState="idle"},scheduleReconnect(e){clearTimeout(Ni);const t=Math.min(3e4,1e3*2**Ga),n=Math.min(3e4,Math.round(t*(.75+Math.random()*.5)));Ga+=1,Ni=setTimeout(()=>{this.reconnects+=1,_n=void 0,this.connect(e)},n)}}}),LT={class:"app-shell"},FT={class:"workspace"},UT={class:"topbar"},qT={class:"topbar-status"},HT=["data-state"],VT={key:0,class:"last-event"},jT={class:"topbar-right-content"},GT={id:"topbar-session-actions",class:"topbar-session-slot"},ZT={key:0,class:"workspace-session-actions"},KT={class:"workspace-session-status"},WT={key:1,class:"segmented-control"},QT={class:"topbar-actions"},JT=Re({__name:"ControlledInstanceShell",setup(e){const t=ds(),n=$s(),r=BT(),s=fi(),i=ep(),a=Xh(),o=di(),l=Oe(n.token),c=Oe(!1),u=Oe("general"),f=we(()=>a.data.value?"Instance ready":"Web server ready"),m=we(()=>`last event ${G(r.lastEventAt)}`),h=we(()=>!!n.token),y=we(()=>s.tabs.find(D=>D.id===s.activeTabId)),b=we(()=>y0(y.value,o.data.value||[])),S=we(()=>{const D=i.data.value;return!!(D&&(!D.enabled||h.value))});Pn(()=>{l.value=n.token}),pn([S,()=>n.token],([D])=>{r.disconnect(),D&&r.connect(t)},{immediate:!0}),zo(()=>{r.disconnect()});function k(){n.setToken(l.value)}function P(D){u.value=D,c.value=!0}function z(D){s.open({type:"logs",id:`logs:${D.id}`,sessionId:D.id,title:`${D.title} logs`})}function I(D){const W=new URLSearchParams;n.token&&W.set("token",n.token);const q=W.toString()?`?${W.toString()}`:"";return jn(`/api/apps/sessions/${D.id}/screenshot${q}`)}async function E(D){await Cs(D),await t.invalidateQueries({queryKey:["status"]})}async function _(D){const W=await m0(D);s.open(da(W)),await t.invalidateQueries({queryKey:["status"]})}function L(D){s.setVncResizeMode(D)}function N(D){s.setGuiHidpi(D)}function G(D){if(!D)return"";const W=new Date(D);return Number.isNaN(W.getTime())?D:W.toLocaleTimeString()}return(D,W)=>(O(),j("div",LT,[T(m3,{onOpenSettings:P}),x("main",FT,[x("header",UT,[x("div",qT,[W[6]||(W[6]=x("span",{class:"brand"},"TaskHandoff",-1)),x("span",null,Z(f.value),1),x("span",{class:"event-state","data-state":g(r).connectionState},Z(g(r).connectionState),9,HT),g(r).lastEventAt?(O(),j("span",VT,Z(m.value),1)):pe("",!0)]),T(g(In),{class:"topbar-right"},{default:$(()=>[x("div",jT,[x("div",GT,[b.value?(O(),j("div",ZT,[x("span",KT,Z(b.value.appId)+" · "+Z(b.value.status),1),T(g(nt),{variant:"outline",size:"sm",onClick:W[0]||(W[0]=q=>z(b.value))},{default:$(()=>[...W[7]||(W[7]=[fe("Logs",-1)])]),_:1}),b.value.kind==="gui"&&b.value.status==="running"?(O(),Se(g(nt),{key:0,variant:"outline",size:"sm",as:"a",href:I(b.value),target:"_blank",rel:"noreferrer"},{default:$(()=>[...W[8]||(W[8]=[fe("Screenshot",-1)])]),_:1},8,["href"])):pe("",!0),b.value.kind==="gui"&&b.value.status==="running"?(O(),j("div",WT,[T(g(_p),{type:"single","model-value":g(s).vncResizeMode,"aria-label":"VNC resize mode","onUpdate:modelValue":W[1]||(W[1]=q=>q&&L(q))},{default:$(()=>[T(g(oo),{value:"scale"},{default:$(()=>[...W[9]||(W[9]=[fe("Scale",-1)])]),_:1}),T(g(oo),{value:"remote"},{default:$(()=>[...W[10]||(W[10]=[fe("Resize",-1)])]),_:1})]),_:1},8,["model-value"]),T(g(xp),{"model-value":g(s).guiHidpi,"aria-label":"Toggle HiDPI","onUpdate:modelValue":N},{default:$(()=>[...W[11]||(W[11]=[fe("HiDPI",-1)])]),_:1},8,["model-value"])])):pe("",!0),T(g(nt),{variant:"outline",size:"sm",disabled:b.value.status!=="running",onClick:W[2]||(W[2]=q=>E(b.value.id))},{default:$(()=>[...W[12]||(W[12]=[fe("Stop",-1)])]),_:1},8,["disabled"]),T(g(nt),{variant:"outline",size:"sm",onClick:W[3]||(W[3]=q=>_(b.value.id))},{default:$(()=>[...W[13]||(W[13]=[fe("Restart",-1)])]),_:1})])):pe("",!0)]),x("div",QT,[g(i).data.value?.enabled?No((O(),j("input",{key:0,"onUpdate:modelValue":W[4]||(W[4]=q=>l.value=q),class:"token-input",type:"password",placeholder:"Web token",onChange:k},null,544)),[[Mo,l.value]]):pe("",!0)])])]),_:1})]),T(D9)]),c.value?(O(),Se(c5,{key:0,section:u.value,onClose:W[5]||(W[5]=q=>c.value=!1)},null,8,["section"])):pe("",!0)]))}});let r0=1;var YT=class{subscribers;toasts;dismissedToasts;constructor(){this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}subscribe=e=>(this.subscribers.push(e),()=>{const t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)});publish=e=>{this.subscribers.forEach(t=>t(e))};addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]};create=e=>{const{message:t,...n}=e,r=typeof e.id=="number"||e.id&&e.id?.length>0?e.id:r0++,s=this.toasts.find(a=>a.id===r),i=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),s?this.toasts=this.toasts.map(a=>a.id===r?(this.publish({...a,...e,id:r,title:t}),{...a,...e,id:r,dismissible:i,title:t}):a):this.addToast({title:t,...n,dismissible:i,id:r}),r};dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),e);message=(e,t)=>this.create({...t,message:e,type:"default"});error=(e,t)=>this.create({...t,type:"error",message:e});success=(e,t)=>this.create({...t,type:"success",message:e});info=(e,t)=>this.create({...t,type:"info",message:e});warning=(e,t)=>this.create({...t,type:"warning",message:e});loading=(e,t)=>this.create({...t,type:"loading",message:e});promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));const r=Promise.resolve(e instanceof Function?e():e);let s=n!==void 0,i;const a=r.then(async l=>{if(i=["resolve",l],_i(l))s=!1,this.create({id:n,type:"default",message:l});else if(eI(l)&&!l.ok){s=!1;const u=typeof t.error=="function"?await t.error(`HTTP error! status: ${l.status}`):t.error,f=typeof t.description=="function"?await t.description(`HTTP error! status: ${l.status}`):t.description,h=typeof u=="object"&&!_i(u)?u:{message:u||"",id:n||""};this.create({id:n,type:"error",description:f,...h})}else if(l instanceof Error){s=!1;const u=typeof t.error=="function"?await t.error(l):t.error,f=typeof t.description=="function"?await t.description(l):t.description,h=typeof u=="object"&&!_i(u)?u:{message:u||"",id:n||""};this.create({id:n,type:"error",description:f,...h})}else if(t.success!==void 0){s=!1;const u=typeof t.success=="function"?await t.success(l):t.success,f=typeof t.description=="function"?await t.description(l):t.description,h=typeof u=="object"&&!_i(u)?u:{message:u||"",id:n||""};this.create({id:n,type:"success",description:f,...h})}}).catch(async l=>{if(i=["reject",l],t.error!==void 0){s=!1;const c=typeof t.error=="function"?await t.error(l):t.error,u=typeof t.description=="function"?await t.description(l):t.description,m=typeof c=="object"&&!_i(c)?c:{message:c||"",id:n||""};this.create({id:n,type:"error",description:u,...m})}}).finally(()=>{s&&(this.dismiss(n),n=void 0),t.finally?.()}),o=()=>new Promise((l,c)=>a.then(()=>i[0]==="reject"?c(i[1]):l(i[1])).catch(c));return typeof n!="string"&&typeof n!="number"?{unwrap:o}:Object.assign(n,{unwrap:o})};custom=(e,t)=>{const n=t?.id||r0++,r=this.toasts.find(i=>i.id===n),s=t?.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(n)&&this.dismissedToasts.delete(n),r?this.toasts=this.toasts.map(i=>i.id===n?(this.publish({...i,component:e,dismissible:s,id:n,...t}),{...i,component:e,dismissible:s,id:n,...t}):i):this.addToast({component:e,dismissible:s,id:n,...t}),n};getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id))};const yn=new YT;function XT(e,t){const n=t?.id||r0++;return yn.create({message:e,id:n,type:"default",...t}),n}const eI=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",tI=XT,nI=()=>yn.toasts,rI=()=>yn.getActiveToasts();Object.assign(tI,{success:yn.success,info:yn.info,warning:yn.warning,error:yn.error,custom:yn.custom,message:yn.message,promise:yn.promise,dismiss:yn.dismiss,loading:yn.loading},{getHistory:nI,getToasts:rI});function Wa(e){return e.label!==void 0}const sI=3,Ug="24px",qg="16px",rh=4e3,iI=356,aI=14,oI=45,Hg=200;function lI(){const e=Oe(!1);return Pn(()=>{const t=()=>{e.value=document.hidden};return document.addEventListener("visibilitychange",t),()=>window.removeEventListener("visibilitychange",t)}),{isDocumentHidden:e}}function jr(...e){return e.filter(Boolean).join(" ")}function cI(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}function uI(e,t){const n={};return[e,t].forEach((r,s)=>{const i=s===1,a=i?"--mobile-offset":"--offset",o=i?qg:Ug;function l(c){["top","right","bottom","left"].forEach(u=>{n[`${a}-${u}`]=typeof c=="number"?`${c}px`:c})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(c=>{r[c]===void 0?n[`${a}-${c}`]=o:n[`${a}-${c}`]=typeof r[c]=="number"?`${r[c]}px`:r[c]}):l(o)}),n}const dI=["data-rich-colors","data-styled","data-mounted","data-promise","data-swiped","data-removed","data-visible","data-y-position","data-x-position","data-index","data-front","data-swiping","data-dismissible","data-type","data-invert","data-swipe-out","data-swipe-direction","data-expanded","data-testid"],fI=["aria-label","data-disabled","data-close-button-position"];var hI=Re({__name:"Toast",props:{toast:{},toasts:{},index:{},swipeDirections:{},expanded:{type:Boolean},invert:{type:Boolean},heights:{},gap:{},position:{},closeButtonPosition:{},visibleToasts:{},expandByDefault:{type:Boolean},closeButton:{type:Boolean},interacting:{type:Boolean},style:{},cancelButtonStyle:{},actionButtonStyle:{},duration:{},class:{},unstyled:{type:Boolean},descriptionClass:{},loadingIcon:{},classes:{},icons:{},closeButtonAriaLabel:{},defaultRichColors:{type:Boolean}},emits:["update:heights","update:height","removeToast"],setup(e,{emit:t}){const n=e,r=t,s=Oe(null),i=Oe(null),a=Oe(!1),o=Oe(!1),l=Oe(!1),c=Oe(!1),u=Oe(!1),f=Oe(0),m=Oe(0),h=Oe(n.toast.duration||n.duration||rh),y=Oe(null),b=Oe(null),S=we(()=>n.index===0),k=we(()=>n.index+1<=n.visibleToasts),P=we(()=>n.toast.type),z=we(()=>n.toast.dismissible!==!1),I=we(()=>n.toast.class||""),E=we(()=>n.descriptionClass||""),_=we(()=>{const C=n.toast.position||n.position,Q=n.heights.filter(de=>de.position===C).findIndex(de=>de.toastId===n.toast.id);return Q>=0?Q:0}),L=we(()=>{const C=n.toast.position||n.position;return n.heights.filter(Q=>Q.position===C).reduce((Q,de,Ie)=>Ie>=_.value?Q:Q+de.height,0)}),N=we(()=>_.value*n.gap+L.value||0),G=we(()=>n.toast.closeButton??n.closeButton),D=we(()=>n.toast.duration||n.duration||rh),W=Oe(0),q=Oe(0),X=Oe(null),ne=we(()=>n.position.split("-")),he=we(()=>ne.value[0]),Ae=we(()=>ne.value[1]),se=we(()=>typeof n.toast.title!="string"),re=we(()=>typeof n.toast.description!="string"),{isDocumentHidden:ze}=lI(),ie=we(()=>P.value&&P.value==="loading");nc(()=>{a.value=!0,h.value=D.value}),Pn(async()=>{if(!a.value||!b.value)return;await ur();const C=b.value,le=C.style.height;C.style.height="auto";const Q=C.getBoundingClientRect().height;C.style.height=le,m.value=Q,r("update:height",{toastId:n.toast.id,height:Q,position:n.toast.position||n.position})});function je(){o.value=!0,f.value=N.value,setTimeout(()=>{r("removeToast",n.toast)},Hg)}function rt(){if(ie.value||!z.value)return{};je(),n.toast.onDismiss?.(n.toast)}function ot(C){C.button!==2&&(ie.value||!z.value||(y.value=new Date,f.value=N.value,C.target.setPointerCapture(C.pointerId),C.target.tagName!=="BUTTON"&&(l.value=!0,X.value={x:C.clientX,y:C.clientY})))}function Ft(){if(c.value||!z.value)return;X.value=null;const C=Number(b.value?.style.getPropertyValue("--swipe-amount-x").replace("px","")||0),le=Number(b.value?.style.getPropertyValue("--swipe-amount-y").replace("px","")||0),Q=new Date().getTime()-(y.value?.getTime()||0),de=s.value==="x"?C:le,Ie=Math.abs(de)/Q;if(Math.abs(de)>=oI||Ie>.11){f.value=N.value,n.toast.onDismiss?.(n.toast),s.value==="x"?i.value=C>0?"right":"left":i.value=le>0?"down":"up",je(),c.value=!0;return}else b.value?.style.setProperty("--swipe-amount-x","0px"),b.value?.style.setProperty("--swipe-amount-y","0px");u.value=!1,l.value=!1,s.value=null}function st(C){if(!X.value||!z.value||(window?.getSelection()?.toString()?.length??!1))return;const Q=C.clientY-X.value.y,de=C.clientX-X.value.x,Ie=n.swipeDirections??cI(n.position);!s.value&&(Math.abs(de)>1||Math.abs(Q)>1)&&(s.value=Math.abs(de)>Math.abs(Q)?"x":"y");let Ge={x:0,y:0};const Be=Te=>1/(1.5+Math.abs(Te)/20);if(s.value==="y"){if(Ie.includes("top")||Ie.includes("bottom"))if(Ie.includes("top")&&Q<0||Ie.includes("bottom")&&Q>0)Ge.y=Q;else{const Te=Q*Be(Q);Ge.y=Math.abs(Te)<Math.abs(Q)?Te:Q}}else if(s.value==="x"&&(Ie.includes("left")||Ie.includes("right")))if(Ie.includes("left")&&de<0||Ie.includes("right")&&de>0)Ge.x=de;else{const Te=de*Be(de);Ge.x=Math.abs(Te)<Math.abs(de)?Te:de}(Math.abs(Ge.x)>0||Math.abs(Ge.y)>0)&&(u.value=!0),b.value?.style.setProperty("--swipe-amount-x",`${Ge.x}px`),b.value?.style.setProperty("--swipe-amount-y",`${Ge.y}px`)}nc(()=>{if(a.value=!0,!b.value)return;const C=b.value.getBoundingClientRect().height;m.value=C;const le=[{toastId:n.toast.id,height:C,position:n.toast.position},...n.heights];r("update:heights",le)}),zo(()=>{b.value&&r("removeToast",n.toast)}),Pn(C=>{if(n.toast.promise&&P.value==="loading"||n.toast.duration===1/0||n.toast.type==="loading")return;let le;const Q=()=>{if(q.value<W.value){const Ie=new Date().getTime()-W.value;h.value=h.value-Ie}q.value=new Date().getTime()},de=()=>{h.value!==1/0&&(W.value=new Date().getTime(),le=setTimeout(()=>{n.toast.onAutoClose?.(n.toast),je()},h.value))};n.expanded||n.interacting||ze.value?Q():de(),C(()=>{clearTimeout(le)})}),pn(()=>n.toast.delete,C=>{C!==void 0&&C&&(je(),n.toast.onDismiss?.(n.toast))},{deep:!0});function at(){l.value=!1,s.value=null,X.value=null}return(C,le)=>(O(),j("li",{tabindex:"0",ref_key:"toastRef",ref:b,class:At(g(jr)(n.class,I.value,C.classes?.toast,C.toast.classes?.toast,C.classes?.[P.value],C.toast?.classes?.[P.value])),"data-sonner-toast":"","data-rich-colors":C.toast.richColors??C.defaultRichColors,"data-styled":!(C.toast.component||C.toast?.unstyled||C.unstyled),"data-mounted":a.value,"data-promise":!!C.toast.promise,"data-swiped":u.value,"data-removed":o.value,"data-visible":k.value,"data-y-position":he.value,"data-x-position":Ae.value,"data-index":C.index,"data-front":S.value,"data-swiping":l.value,"data-dismissible":z.value,"data-type":P.value,"data-invert":C.toast.invert||C.invert,"data-swipe-out":c.value,"data-swipe-direction":i.value,"data-expanded":!!(C.expanded||C.expandByDefault&&a.value),"data-testid":C.toast.testId,style:Ja({"--index":C.index,"--toasts-before":C.index,"--z-index":C.toasts.length-C.index,"--offset":`${o.value?f.value:N.value}px`,"--initial-height":C.expandByDefault?"auto":`${m.value}px`,...C.style,...n.toast.style}),onDragend:at,onPointerdown:ot,onPointerup:Ft,onPointermove:st},[G.value&&!C.toast.component&&P.value!=="loading"?(O(),j("button",{key:0,"aria-label":C.closeButtonAriaLabel||"Close toast","data-disabled":ie.value,"data-close-button":"true","data-close-button-position":C.closeButtonPosition,class:At(g(jr)(C.classes?.closeButton,C.toast?.classes?.closeButton)),onClick:rt},[C.icons?.close?(O(),Se(js(C.icons?.close),{key:0})):Ve(C.$slots,"close-icon",{key:1})],10,fI)):pe("v-if",!0),C.toast.component?(O(),Se(js(C.toast.component),It({key:1},C.toast.componentProps,{onCloseToast:rt,isPaused:C.$props.expanded||C.$props.interacting||g(ze)}),null,16,["isPaused"])):(O(),j(lt,{key:2},[P.value!=="default"||C.toast.icon||C.toast.promise?(O(),j("div",{key:0,"data-icon":"",class:At(g(jr)(C.classes?.icon,C.toast?.classes?.icon))},[C.toast.icon?(O(),Se(js(C.toast.icon),{key:0})):(O(),j(lt,{key:1},[P.value==="loading"?Ve(C.$slots,"loading-icon",{key:0}):P.value==="success"?Ve(C.$slots,"success-icon",{key:1}):P.value==="error"?Ve(C.$slots,"error-icon",{key:2}):P.value==="warning"?Ve(C.$slots,"warning-icon",{key:3}):P.value==="info"?Ve(C.$slots,"info-icon",{key:4}):pe("v-if",!0)],64))],2)):pe("v-if",!0),x("div",{"data-content":"",class:At(g(jr)(C.classes?.content,C.toast?.classes?.content))},[x("div",{"data-title":"",class:At(g(jr)(C.classes?.title,C.toast.classes?.title))},[se.value?(O(),Se(js(C.toast.title),Cn(It({key:0},C.toast.componentProps)),null,16)):(O(),j(lt,{key:1},[fe(Z(C.toast.title),1)],64))],2),C.toast.description?(O(),j("div",{key:0,"data-description":"",class:At(g(jr)(C.descriptionClass,E.value,C.classes?.description,C.toast.classes?.description))},[re.value?(O(),Se(js(C.toast.description),Cn(It({key:0},C.toast.componentProps)),null,16)):(O(),j(lt,{key:1},[fe(Z(C.toast.description),1)],64))],2)):pe("v-if",!0)],2),C.toast.cancel?(O(),j("button",{key:1,style:Ja(C.toast.cancelButtonStyle||C.cancelButtonStyle),class:At(g(jr)(C.classes?.cancelButton,C.toast.classes?.cancelButton)),"data-button":"","data-cancel":"",onClick:le[0]||(le[0]=Q=>{g(Wa)(C.toast.cancel)&&z.value&&(C.toast.cancel.onClick?.(Q),je())})},Z(g(Wa)(C.toast.cancel)?C.toast.cancel?.label:C.toast.cancel),7)):pe("v-if",!0),C.toast.action?(O(),j("button",{key:2,style:Ja(C.toast.actionButtonStyle||C.actionButtonStyle),class:At(g(jr)(C.classes?.actionButton,C.toast.classes?.actionButton)),"data-button":"","data-action":"",onClick:le[1]||(le[1]=Q=>{g(Wa)(C.toast.action)&&(C.toast.action.onClick?.(Q),!Q.defaultPrevented&&je())})},Z(g(Wa)(C.toast.action)?C.toast.action?.label:C.toast.action),7)):pe("v-if",!0)],64))],46,dI))}}),pI=hI,ga=(e,t)=>{const n=e.__vccOpts||e;for(const[r,s]of t)n[r]=s;return n};const mI={},gI={xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stoke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"};function vI(e,t){return O(),j("svg",gI,t[0]||(t[0]=[x("line",{x1:"18",y1:"6",x2:"6",y2:"18"},null,-1),x("line",{x1:"6",y1:"6",x2:"18",y2:"18"},null,-1)]))}var bI=ga(mI,[["render",vI]]);const yI=["data-visible"],wI={class:"sonner-spinner"};var SI=Re({__name:"Loader",props:{visible:{type:Boolean}},setup(e){const t=Array(12).fill(0);return(n,r)=>(O(),j("div",{class:"sonner-loading-wrapper","data-visible":n.visible},[x("div",wI,[(O(!0),j(lt,null,Ht(g(t),s=>(O(),j("div",{key:`spinner-bar-${s}`,class:"sonner-loading-bar"}))),128))])],8,yI))}}),xI=SI;const kI={},_I={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"};function EI(e,t){return O(),j("svg",_I,t[0]||(t[0]=[x("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z","clip-rule":"evenodd"},null,-1)]))}var AI=ga(kI,[["render",EI]]);const TI={},II={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"};function RI(e,t){return O(),j("svg",II,t[0]||(t[0]=[x("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z","clip-rule":"evenodd"},null,-1)]))}var CI=ga(TI,[["render",RI]]);const OI={},NI={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"};function MI(e,t){return O(),j("svg",NI,t[0]||(t[0]=[x("path",{"fill-rule":"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z","clip-rule":"evenodd"},null,-1)]))}var zI=ga(OI,[["render",MI]]);const $I={},DI={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"};function PI(e,t){return O(),j("svg",DI,t[0]||(t[0]=[x("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z","clip-rule":"evenodd"},null,-1)]))}var BI=ga($I,[["render",PI]]);const LI=["aria-label"],FI=["data-sonner-theme","dir","data-theme","data-rich-colors","data-y-position","data-x-position"],UI=typeof window<"u"&&typeof document<"u";function qI(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}var HI=Re({name:"Toaster",inheritAttrs:!1,__name:"Toaster",props:{id:{},invert:{type:Boolean,default:!1},theme:{default:"light"},position:{default:"bottom-right"},closeButtonPosition:{default:"top-left"},hotkey:{default:()=>["altKey","KeyT"]},richColors:{type:Boolean,default:!1},expand:{type:Boolean,default:!1},duration:{},gap:{default:aI},visibleToasts:{default:sI},closeButton:{type:Boolean,default:!1},toastOptions:{default:()=>({})},class:{default:""},style:{},offset:{default:Ug},mobileOffset:{default:qg},dir:{default:"auto"},swipeDirections:{},icons:{},containerAriaLabel:{default:"Notifications"}},setup(e){const t=e,n=vv(),r=Oe([]),s=we(()=>t.id?r.value.filter(D=>D.toasterId===t.id):r.value.filter(D=>!D.toasterId));function i(D,W){return s.value.filter(q=>!q.position&&W===0||q.position===D)}const a=we(()=>{const D=s.value.filter(W=>W.position).map(W=>W.position);return D.length>0?Array.from(new Set([t.position].concat(D))):[t.position]}),o=we(()=>{const D={};return a.value.forEach(W=>{D[W]=r.value.filter(q=>q.position===W)}),D}),l=Oe([]),c=Oe({}),u=Oe(!1);Pn(()=>{a.value.forEach(D=>{D in c.value||(c.value[D]=!1)})});const f=Oe(t.theme!=="system"?t.theme:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),m=Oe(null),h=Oe(null),y=Oe(!1),b=t.hotkey.join("+").replace(/Key/g,"").replace(/Digit/g,"");function S(D){r.value.find(W=>W.id===D.id)?.delete||yn.dismiss(D.id),r.value=r.value.filter(({id:W})=>W!==D.id),setTimeout(()=>{r.value.find(W=>W.id===D.id)||(l.value=l.value.filter(W=>W.toastId!==D.id))},Hg+50)}function k(D){y.value&&!D.currentTarget?.contains?.(D.relatedTarget)&&(y.value=!1,h.value&&(h.value.focus({preventScroll:!0}),h.value=null))}function P(D){D.target instanceof HTMLElement&&D.target.dataset.dismissible==="false"||y.value||(y.value=!0,h.value=D.relatedTarget)}function z(D){D.target&&D.target instanceof HTMLElement&&D.target.dataset.dismissible==="false"||(u.value=!0)}Pn(D=>{const W=yn.subscribe(q=>{if(q.dismiss){requestAnimationFrame(()=>{r.value=r.value.map(X=>X.id===q.id?{...X,delete:!0}:X)});return}ur(()=>{const X=r.value.findIndex(ne=>ne.id===q.id);X!==-1?r.value=[...r.value.slice(0,X),{...r.value[X],...q},...r.value.slice(X+1)]:r.value=[q,...r.value]})});D(W)}),Pn(D=>{if(typeof window>"u")return;if(t.theme!=="system"){f.value=t.theme;return}const W=window.matchMedia("(prefers-color-scheme: dark)"),q=ne=>{f.value=ne?"dark":"light"};q(W.matches);const X=ne=>{q(ne.matches)};try{W.addEventListener("change",X)}catch{W.addListener(X)}D(()=>{try{W.removeEventListener("change",X)}catch{W.removeListener(X)}})}),Pn(()=>{m.value&&h.value&&(h.value.focus({preventScroll:!0}),h.value=null,y.value=!1)}),Pn(()=>{r.value.length<=1&&Object.keys(c.value).forEach(D=>{c.value[D]=!1})}),Pn(D=>{function W(q){const X=t.hotkey.every(Ae=>q[Ae]||q.code===Ae),ne=Array.isArray(m.value)?m.value[0]:m.value;X&&(a.value.forEach(Ae=>{c.value[Ae]=!0}),ne?.focus());const he=document.activeElement===m.value||ne?.contains(document.activeElement);q.code==="Escape"&&he&&a.value.forEach(Ae=>{c.value[Ae]=!1})}UI&&(document.addEventListener("keydown",W),D(()=>{document.removeEventListener("keydown",W)}))});function I(D){const W=D.currentTarget,q=W.getAttribute("data-y-position")+"-"+W.getAttribute("data-x-position");c.value[q]=!0}function E(D){if(!u.value){const W=D.currentTarget,q=W.getAttribute("data-y-position")+"-"+W.getAttribute("data-x-position");c.value[q]=!1}}function _(){Object.keys(c.value).forEach(D=>{c.value[D]=!1})}function L(){u.value=!1}function N(D){l.value=D}function G(D){const W=l.value.findIndex(q=>q.toastId===D.toastId);if(W!==-1)l.value[W]=D;else{const q=l.value.findIndex(X=>X.position===D.position);q!==-1?l.value.splice(q,0,D):l.value.unshift(D)}}return(D,W)=>(O(),j(lt,null,[pe(" Remove item from normal navigation flow, only available via hotkey "),x("section",{"aria-label":`${D.containerAriaLabel} ${g(b)}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false"},[(O(!0),j(lt,null,Ht(a.value,(q,X)=>(O(),j("ol",It({key:q,ref_for:!0,ref_key:"listRef",ref:m,"data-sonner-toaster":"","data-sonner-theme":f.value,class:t.class,dir:D.dir==="auto"?qI():D.dir,tabIndex:-1,"data-theme":D.theme,"data-rich-colors":D.richColors,"data-y-position":q.split("-")[0],"data-x-position":q.split("-")[1],style:{"--front-toast-height":`${l.value[0]?.height||0}px`,"--width":`${g(iI)}px`,"--gap":`${D.gap}px`,...D.style,...g(n).style,...g(uI)(D.offset,D.mobileOffset)}},{ref_for:!0},D.$attrs,{onBlur:k,onFocus:P,onMouseenter:I,onMousemove:I,onMouseleave:E,onDragend:_,onPointerdown:z,onPointerup:L}),[(O(!0),j(lt,null,Ht(i(q,X),(ne,he)=>(O(),Se(pI,{key:ne.id,heights:l.value,icons:D.icons,index:he,toast:ne,defaultRichColors:D.richColors,duration:D.toastOptions?.duration??D.duration,class:At(D.toastOptions?.class??""),descriptionClass:D.toastOptions?.descriptionClass,invert:D.invert,visibleToasts:D.visibleToasts,closeButton:D.toastOptions?.closeButton??D.closeButton,interacting:u.value,position:q,closeButtonPosition:D.toastOptions?.closeButtonPosition??D.closeButtonPosition,style:Ja(D.toastOptions?.style),unstyled:D.toastOptions?.unstyled,classes:D.toastOptions?.classes,cancelButtonStyle:D.toastOptions?.cancelButtonStyle,actionButtonStyle:D.toastOptions?.actionButtonStyle,"close-button-aria-label":D.toastOptions?.closeButtonAriaLabel,toasts:o.value[q],expandByDefault:D.expand,gap:D.gap,expanded:c.value[q]||!1,swipeDirections:t.swipeDirections,"onUpdate:heights":N,"onUpdate:height":G,onRemoveToast:S},{"close-icon":$(()=>[Ve(D.$slots,"close-icon",{},()=>[T(bI)])]),"loading-icon":$(()=>[Ve(D.$slots,"loading-icon",{},()=>[T(xI,{visible:ne.type==="loading"},null,8,["visible"])])]),"success-icon":$(()=>[Ve(D.$slots,"success-icon",{},()=>[T(AI)])]),"error-icon":$(()=>[Ve(D.$slots,"error-icon",{},()=>[T(BI)])]),"warning-icon":$(()=>[Ve(D.$slots,"warning-icon",{},()=>[T(zI)])]),"info-icon":$(()=>[Ve(D.$slots,"info-icon",{},()=>[T(CI)])]),_:2},1032,["heights","icons","index","toast","defaultRichColors","duration","class","descriptionClass","invert","visibleToasts","closeButton","interacting","position","closeButtonPosition","style","unstyled","classes","cancelButtonStyle","actionButtonStyle","close-button-aria-label","toasts","expandByDefault","gap","expanded","swipeDirections"]))),128))],16,FI))),128))],8,LI)],2112))}}),VI=HI;const jI=Re({__name:"Sonner",props:{id:{},invert:{type:Boolean},theme:{},position:{},closeButtonPosition:{},hotkey:{},richColors:{type:Boolean},expand:{type:Boolean},duration:{},gap:{},visibleToasts:{},closeButton:{type:Boolean},toastOptions:{},class:{},style:{},offset:{},mobileOffset:{},dir:{},swipeDirections:{},icons:{},containerAriaLabel:{}},setup(e){const t=e,n=Vt(t,"toastOptions"),r=Oe("light");function s(){r.value=document.documentElement.classList.contains("dark")?"dark":"light"}return s(),bv(document.documentElement,s,{attributes:!0,attributeFilter:["class","data-theme"]}),(i,a)=>(O(),Se(g(VI),It({class:"toaster group","toast-options":{unstyled:!0,classes:{toast:"task-handoff-toast",title:"task-handoff-toast-title",description:"task-handoff-toast-description",icon:"task-handoff-toast-icon",closeButton:"task-handoff-toast-close",actionButton:"task-handoff-toast-action",cancelButton:"task-handoff-toast-cancel",success:"is-success",error:"is-error",warning:"is-warning",info:"is-info"}}},g(n),{theme:t.theme??r.value}),{"success-icon":$(()=>[T(g(hy),{class:"size-4"})]),"info-icon":$(()=>[T(g(xy),{class:"size-4"})]),"warning-icon":$(()=>[T(g(Fy),{class:"size-4"})]),"error-icon":$(()=>[T(g(dy),{class:"size-4"})]),"loading-icon":$(()=>[x("div",null,[T(g(_y),{class:"size-4 animate-spin"})])]),"close-icon":$(()=>[T(g(Os),{class:"size-4"})]),_:1},16,["theme"]))}}),GI=Re({__name:"App",setup(e){return(t,n)=>(O(),j(lt,null,[T(JT),T(g(jI),{position:"top-right","rich-colors":""})],64))}});const Ws=typeof document<"u";function Vg(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function ZI(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&Vg(e.default)}const gt=Object.assign;function Jl(e,t){const n={};for(const r in t){const s=t[r];n[r]=Kn(s)?s.map(e):e(s)}return n}const Ki=()=>{},Kn=Array.isArray;function sh(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}const jg=/#/g,KI=/&/g,WI=/\//g,QI=/=/g,JI=/\?/g,Gg=/\+/g,YI=/%5B/g,XI=/%5D/g,Zg=/%5E/g,eR=/%60/g,Kg=/%7B/g,tR=/%7C/g,Wg=/%7D/g,nR=/%20/g;function _u(e){return e==null?"":encodeURI(""+e).replace(tR,"|").replace(YI,"[").replace(XI,"]")}function rR(e){return _u(e).replace(Kg,"{").replace(Wg,"}").replace(Zg,"^")}function s0(e){return _u(e).replace(Gg,"%2B").replace(nR,"+").replace(jg,"%23").replace(KI,"%26").replace(eR,"`").replace(Kg,"{").replace(Wg,"}").replace(Zg,"^")}function sR(e){return s0(e).replace(QI,"%3D")}function iR(e){return _u(e).replace(jg,"%23").replace(JI,"%3F")}function aR(e){return iR(e).replace(WI,"%2F")}function ca(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const oR=/\/$/,lR=e=>e.replace(oR,"");function Yl(e,t,n="/"){let r,s={},i="",a="";const o=t.indexOf("#");let l=t.indexOf("?");return l=o>=0&&l>o?-1:l,l>=0&&(r=t.slice(0,l),i=t.slice(l,o>0?o:t.length),s=e(i.slice(1))),o>=0&&(r=r||t.slice(0,o),a=t.slice(o,t.length)),r=fR(r??t,n),{fullPath:r+i+a,path:r,query:s,hash:ca(a)}}function cR(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function ih(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function uR(e,t,n){const r=t.matched.length-1,s=n.matched.length-1;return r>-1&&r===s&&ci(t.matched[r],n.matched[s])&&Qg(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function ci(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Qg(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!dR(e[n],t[n]))return!1;return!0}function dR(e,t){return Kn(e)?ah(e,t):Kn(t)?ah(t,e):e?.valueOf()===t?.valueOf()}function ah(e,t){return Kn(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function fR(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),r=e.split("/"),s=r[r.length-1];(s===".."||s===".")&&r.push("");let i=n.length-1,a,o;for(a=0;a<r.length;a++)if(o=r[a],o!==".")if(o==="..")i>1&&i--;else break;return n.slice(0,i).join("/")+"/"+r.slice(a).join("/")}const Gr={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let i0=(function(e){return e.pop="pop",e.push="push",e})({}),Xl=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function hR(e){if(!e)if(Ws){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),lR(e)}const pR=/^[^#]+#/;function mR(e,t){return e.replace(pR,"#")+t}function gR(e,t){const n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}const ll=()=>({left:window.scrollX,top:window.scrollY});function vR(e){let t;if("el"in e){const n=e.el,r=typeof n=="string"&&n.startsWith("#"),s=typeof n=="string"?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!s)return;t=gR(s,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function oh(e,t){return(history.state?history.state.position-t:-1)+e}const a0=new Map;function bR(e,t){a0.set(e,t)}function yR(e){const t=a0.get(e);return a0.delete(e),t}function wR(e){return typeof e=="string"||e&&typeof e=="object"}function Jg(e){return typeof e=="string"||typeof e=="symbol"}let Bt=(function(e){return e[e.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",e[e.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",e[e.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",e[e.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",e[e.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",e})({});const Yg=Symbol("");Bt.MATCHER_NOT_FOUND+"",Bt.NAVIGATION_GUARD_REDIRECT+"",Bt.NAVIGATION_ABORTED+"",Bt.NAVIGATION_CANCELLED+"",Bt.NAVIGATION_DUPLICATED+"";function ui(e,t){return gt(new Error,{type:e,[Yg]:!0},t)}function xr(e,t){return e instanceof Error&&Yg in e&&(t==null||!!(e.type&t))}const SR=["params","query","hash"];function xR(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of SR)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function kR(e){const t={};if(e===""||e==="?")return t;const n=(e[0]==="?"?e.slice(1):e).split("&");for(let r=0;r<n.length;++r){const s=n[r].replace(Gg," "),i=s.indexOf("="),a=ca(i<0?s:s.slice(0,i)),o=i<0?null:ca(s.slice(i+1));if(a in t){let l=t[a];Kn(l)||(l=t[a]=[l]),l.push(o)}else t[a]=o}return t}function lh(e){let t="";for(let n in e){const r=e[n];if(n=sR(n),r==null){r!==void 0&&(t+=(t.length?"&":"")+n);continue}(Kn(r)?r.map(s=>s&&s0(s)):[r&&s0(r)]).forEach(s=>{s!==void 0&&(t+=(t.length?"&":"")+n,s!=null&&(t+="="+s))})}return t}function _R(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=Kn(r)?r.map(s=>s==null?null:""+s):r==null?r:""+r)}return t}const ER=Symbol(""),ch=Symbol(""),Eu=Symbol(""),Xg=Symbol(""),o0=Symbol("");function zi(){let e=[];function t(r){return e.push(r),()=>{const s=e.indexOf(r);s>-1&&e.splice(s,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function Wr(e,t,n,r,s,i=a=>a()){const a=r&&(r.enterCallbacks[s]=r.enterCallbacks[s]||[]);return()=>new Promise((o,l)=>{const c=m=>{m===!1?l(ui(Bt.NAVIGATION_ABORTED,{from:n,to:t})):m instanceof Error?l(m):wR(m)?l(ui(Bt.NAVIGATION_GUARD_REDIRECT,{from:t,to:m})):(a&&r.enterCallbacks[s]===a&&typeof m=="function"&&a.push(m),o())},u=i(()=>e.call(r&&r.instances[s],t,n,c));let f=Promise.resolve(u);e.length<3&&(f=f.then(c)),f.catch(m=>l(m))})}function ec(e,t,n,r,s=i=>i()){const i=[];for(const a of e)for(const o in a.components){let l=a.components[o];if(!(t!=="beforeRouteEnter"&&!a.instances[o]))if(Vg(l)){const c=(l.__vccOpts||l)[t];c&&i.push(Wr(c,n,r,a,o,s))}else{let c=l();i.push(()=>c.then(u=>{if(!u)throw new Error(`Couldn't resolve component "${o}" at "${a.path}"`);const f=ZI(u)?u.default:u;a.mods[o]=u,a.components[o]=f;const m=(f.__vccOpts||f)[t];return m&&Wr(m,n,r,a,o,s)()}))}}return i}function AR(e,t){const n=[],r=[],s=[],i=Math.max(t.matched.length,e.matched.length);for(let a=0;a<i;a++){const o=t.matched[a];o&&(e.matched.find(c=>ci(c,o))?r.push(o):n.push(o));const l=e.matched[a];l&&(t.matched.find(c=>ci(c,l))||s.push(l))}return[n,r,s]}let TR=()=>location.protocol+"//"+location.host;function e4(e,t){const{pathname:n,search:r,hash:s}=t,i=e.indexOf("#");if(i>-1){let a=s.includes(e.slice(i))?e.slice(i).length:1,o=s.slice(a);return o[0]!=="/"&&(o="/"+o),ih(o,"")}return ih(n,e)+r+s}function IR(e,t,n,r){let s=[],i=[],a=null;const o=({state:m})=>{const h=e4(e,location),y=n.value,b=t.value;let S=0;if(m){if(n.value=h,t.value=m,a&&a===y){a=null;return}S=b?m.position-b.position:0}else r(h);s.forEach(k=>{k(n.value,y,{delta:S,type:i0.pop,direction:S?S>0?Xl.forward:Xl.back:Xl.unknown})})};function l(){a=n.value}function c(m){s.push(m);const h=()=>{const y=s.indexOf(m);y>-1&&s.splice(y,1)};return i.push(h),h}function u(){if(document.visibilityState==="hidden"){const{history:m}=window;if(!m.state)return;m.replaceState(gt({},m.state,{scroll:ll()}),"")}}function f(){for(const m of i)m();i=[],window.removeEventListener("popstate",o),window.removeEventListener("pagehide",u),document.removeEventListener("visibilitychange",u)}return window.addEventListener("popstate",o),window.addEventListener("pagehide",u),document.addEventListener("visibilitychange",u),{pauseListeners:l,listen:c,destroy:f}}function uh(e,t,n,r=!1,s=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:s?ll():null}}function RR(e){const{history:t,location:n}=window,r={value:e4(e,n)},s={value:t.state};s.value||i(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function i(l,c,u){const f=e.indexOf("#"),m=f>-1?(n.host&&document.querySelector("base")?e:e.slice(f))+l:TR()+e+l;try{t[u?"replaceState":"pushState"](c,"",m),s.value=c}catch(h){console.error(h),n[u?"replace":"assign"](m)}}function a(l,c){i(l,gt({},t.state,uh(s.value.back,l,s.value.forward,!0),c,{position:s.value.position}),!0),r.value=l}function o(l,c){const u=gt({},s.value,t.state,{forward:l,scroll:ll()});i(u.current,u,!0),i(l,gt({},uh(r.value,l,null),{position:u.position+1},c),!1),r.value=l}return{location:r,state:s,push:o,replace:a}}function CR(e){e=hR(e);const t=RR(e),n=IR(e,t.state,t.location,t.replace);function r(i,a=!0){a||n.pauseListeners(),history.go(i)}const s=gt({location:"",base:e,go:r,createHref:mR.bind(null,e)},t,n);return Object.defineProperty(s,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(s,"state",{enumerable:!0,get:()=>t.state.value}),s}let Ts=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var Yt=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e})(Yt||{});const OR={type:Ts.Static,value:""},NR=/[a-zA-Z0-9_]/;function MR(e){if(!e)return[[]];if(e==="/")return[[OR]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(h){throw new Error(`ERR (${n})/"${c}": ${h}`)}let n=Yt.Static,r=n;const s=[];let i;function a(){i&&s.push(i),i=[]}let o=0,l,c="",u="";function f(){c&&(n===Yt.Static?i.push({type:Ts.Static,value:c}):n===Yt.Param||n===Yt.ParamRegExp||n===Yt.ParamRegExpEnd?(i.length>1&&(l==="*"||l==="+")&&t(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),i.push({type:Ts.Param,value:c,regexp:u,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):t("Invalid state to consume buffer"),c="")}function m(){c+=l}for(;o<e.length;){if(l=e[o++],l==="\\"&&n!==Yt.ParamRegExp){r=n,n=Yt.EscapeNext;continue}switch(n){case Yt.Static:l==="/"?(c&&f(),a()):l===":"?(f(),n=Yt.Param):m();break;case Yt.EscapeNext:m(),n=r;break;case Yt.Param:l==="("?n=Yt.ParamRegExp:NR.test(l)?m():(f(),n=Yt.Static,l!=="*"&&l!=="?"&&l!=="+"&&o--);break;case Yt.ParamRegExp:l===")"?u[u.length-1]=="\\"?u=u.slice(0,-1)+l:n=Yt.ParamRegExpEnd:u+=l;break;case Yt.ParamRegExpEnd:f(),n=Yt.Static,l!=="*"&&l!=="?"&&l!=="+"&&o--,u="";break;default:t("Unknown state");break}}return n===Yt.ParamRegExp&&t(`Unfinished custom RegExp for param "${c}"`),f(),a(),s}const dh="[^/]+?",zR={sensitive:!1,strict:!1,start:!0,end:!0};var fn=(function(e){return e[e._multiplier=10]="_multiplier",e[e.Root=90]="Root",e[e.Segment=40]="Segment",e[e.SubSegment=30]="SubSegment",e[e.Static=40]="Static",e[e.Dynamic=20]="Dynamic",e[e.BonusCustomRegExp=10]="BonusCustomRegExp",e[e.BonusWildcard=-50]="BonusWildcard",e[e.BonusRepeatable=-20]="BonusRepeatable",e[e.BonusOptional=-8]="BonusOptional",e[e.BonusStrict=.7000000000000001]="BonusStrict",e[e.BonusCaseSensitive=.25]="BonusCaseSensitive",e})(fn||{});const $R=/[.+*?^${}()[\]/\\]/g;function DR(e,t){const n=gt({},zR,t),r=[];let s=n.start?"^":"";const i=[];for(const c of e){const u=c.length?[]:[fn.Root];n.strict&&!c.length&&(s+="/");for(let f=0;f<c.length;f++){const m=c[f];let h=fn.Segment+(n.sensitive?fn.BonusCaseSensitive:0);if(m.type===Ts.Static)f||(s+="/"),s+=m.value.replace($R,"\\$&"),h+=fn.Static;else if(m.type===Ts.Param){const{value:y,repeatable:b,optional:S,regexp:k}=m;i.push({name:y,repeatable:b,optional:S});const P=k||dh;if(P!==dh){h+=fn.BonusCustomRegExp;try{`${P}`}catch(I){throw new Error(`Invalid custom RegExp for param "${y}" (${P}): `+I.message)}}let z=b?`((?:${P})(?:/(?:${P}))*)`:`(${P})`;f||(z=S&&c.length<2?`(?:/${z})`:"/"+z),S&&(z+="?"),s+=z,h+=fn.Dynamic,S&&(h+=fn.BonusOptional),b&&(h+=fn.BonusRepeatable),P===".*"&&(h+=fn.BonusWildcard)}u.push(h)}r.push(u)}if(n.strict&&n.end){const c=r.length-1;r[c][r[c].length-1]+=fn.BonusStrict}n.strict||(s+="/?"),n.end?s+="$":n.strict&&!s.endsWith("/")&&(s+="(?:/|$)");const a=new RegExp(s,n.sensitive?"":"i");function o(c){const u=c.match(a),f={};if(!u)return null;for(let m=1;m<u.length;m++){const h=u[m]||"",y=i[m-1];f[y.name]=h&&y.repeatable?h.split("/"):h}return f}function l(c){let u="",f=!1;for(const m of e){(!f||!u.endsWith("/"))&&(u+="/"),f=!1;for(const h of m)if(h.type===Ts.Static)u+=h.value;else if(h.type===Ts.Param){const{value:y,repeatable:b,optional:S}=h,k=y in c?c[y]:"";if(Kn(k)&&!b)throw new Error(`Provided param "${y}" is an array but it is not repeatable (* or + modifiers)`);const P=Kn(k)?k.join("/"):k;if(!P)if(S)m.length<2&&(u.endsWith("/")?u=u.slice(0,-1):f=!0);else throw new Error(`Missing required param "${y}"`);u+=P}}return u||"/"}return{re:a,score:r,keys:i,parse:o,stringify:l}}function PR(e,t){let n=0;for(;n<e.length&&n<t.length;){const r=t[n]-e[n];if(r)return r;n++}return e.length<t.length?e.length===1&&e[0]===fn.Static+fn.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===fn.Static+fn.Segment?1:-1:0}function t4(e,t){let n=0;const r=e.score,s=t.score;for(;n<r.length&&n<s.length;){const i=PR(r[n],s[n]);if(i)return i;n++}if(Math.abs(s.length-r.length)===1){if(fh(r))return 1;if(fh(s))return-1}return s.length-r.length}function fh(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const BR={strict:!1,end:!0,sensitive:!1};function LR(e,t,n){const r=DR(MR(e.path),n),s=gt(r,{record:e,parent:t,children:[],alias:[]});return t&&!s.record.aliasOf==!t.record.aliasOf&&t.children.push(s),s}function FR(e,t){const n=[],r=new Map;t=sh(BR,t);function s(f){return r.get(f)}function i(f,m,h){const y=!h,b=ph(f);b.aliasOf=h&&h.record;const S=sh(t,f),k=[b];if("alias"in f){const I=typeof f.alias=="string"?[f.alias]:f.alias;for(const E of I)k.push(ph(gt({},b,{components:h?h.record.components:b.components,path:E,aliasOf:h?h.record:b})))}let P,z;for(const I of k){const{path:E}=I;if(m&&E[0]!=="/"){const _=m.record.path,L=_[_.length-1]==="/"?"":"/";I.path=m.record.path+(E&&L+E)}if(P=LR(I,m,S),h?h.alias.push(P):(z=z||P,z!==P&&z.alias.push(P),y&&f.name&&!mh(P)&&a(f.name)),n4(P)&&l(P),b.children){const _=b.children;for(let L=0;L<_.length;L++)i(_[L],P,h&&h.children[L])}h=h||P}return z?()=>{a(z)}:Ki}function a(f){if(Jg(f)){const m=r.get(f);m&&(r.delete(f),n.splice(n.indexOf(m),1),m.children.forEach(a),m.alias.forEach(a))}else{const m=n.indexOf(f);m>-1&&(n.splice(m,1),f.record.name&&r.delete(f.record.name),f.children.forEach(a),f.alias.forEach(a))}}function o(){return n}function l(f){const m=HR(f,n);n.splice(m,0,f),f.record.name&&!mh(f)&&r.set(f.record.name,f)}function c(f,m){let h,y={},b,S;if("name"in f&&f.name){if(h=r.get(f.name),!h)throw ui(Bt.MATCHER_NOT_FOUND,{location:f});S=h.record.name,y=gt(hh(m.params,h.keys.filter(z=>!z.optional).concat(h.parent?h.parent.keys.filter(z=>z.optional):[]).map(z=>z.name)),f.params&&hh(f.params,h.keys.map(z=>z.name))),b=h.stringify(y)}else if(f.path!=null)b=f.path,h=n.find(z=>z.re.test(b)),h&&(y=h.parse(b),S=h.record.name);else{if(h=m.name?r.get(m.name):n.find(z=>z.re.test(m.path)),!h)throw ui(Bt.MATCHER_NOT_FOUND,{location:f,currentLocation:m});S=h.record.name,y=gt({},m.params,f.params),b=h.stringify(y)}const k=[];let P=h;for(;P;)k.unshift(P.record),P=P.parent;return{name:S,path:b,params:y,matched:k,meta:qR(k)}}e.forEach(f=>i(f));function u(){n.length=0,r.clear()}return{addRoute:i,resolve:c,removeRoute:a,clearRoutes:u,getRoutes:o,getRecordMatcher:s}}function hh(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function ph(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:UR(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function UR(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const r in e.components)t[r]=typeof n=="object"?n[r]:n;return t}function mh(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function qR(e){return e.reduce((t,n)=>gt(t,n.meta),{})}function HR(e,t){let n=0,r=t.length;for(;n!==r;){const i=n+r>>1;t4(e,t[i])<0?r=i:n=i+1}const s=VR(e);return s&&(r=t.lastIndexOf(s,r-1)),r}function VR(e){let t=e;for(;t=t.parent;)if(n4(t)&&t4(e,t)===0)return t}function n4({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function gh(e){const t=Rr(Eu),n=Rr(Xg),r=we(()=>{const l=g(e.to);return t.resolve(l)}),s=we(()=>{const{matched:l}=r.value,{length:c}=l,u=l[c-1],f=n.matched;if(!u||!f.length)return-1;const m=f.findIndex(ci.bind(null,u));if(m>-1)return m;const h=vh(l[c-2]);return c>1&&vh(u)===h&&f[f.length-1].path!==h?f.findIndex(ci.bind(null,l[c-2])):m}),i=we(()=>s.value>-1&&WR(n.params,r.value.params)),a=we(()=>s.value>-1&&s.value===n.matched.length-1&&Qg(n.params,r.value.params));function o(l={}){if(KR(l)){const c=t[g(e.replace)?"replace":"push"](g(e.to)).catch(Ki);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>c),c}return Promise.resolve()}return{route:r,href:we(()=>r.value.href),isActive:i,isExactActive:a,navigate:o}}function jR(e){return e.length===1?e[0]:e}const GR=Re({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:gh,setup(e,{slots:t}){const n=Yr(gh(e)),{options:r}=Rr(Eu),s=we(()=>({[bh(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[bh(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const i=t.default&&jR(t.default(n));return e.custom?i:Wi("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:s.value},i)}}}),ZR=GR;function KR(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function WR(e,t){for(const n in t){const r=t[n],s=e[n];if(typeof r=="string"){if(r!==s)return!1}else if(!Kn(s)||s.length!==r.length||r.some((i,a)=>i.valueOf()!==s[a].valueOf()))return!1}return!0}function vh(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const bh=(e,t,n)=>e??t??n,QR=Re({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=Rr(o0),s=we(()=>e.route||r.value),i=Rr(ch,0),a=we(()=>{let c=g(i);const{matched:u}=s.value;let f;for(;(f=u[c])&&!f.components;)c++;return c}),o=we(()=>s.value.matched[a.value]);Qa(ch,we(()=>a.value+1)),Qa(ER,o),Qa(o0,s);const l=Oe();return pn(()=>[l.value,o.value,e.name],([c,u,f],[m,h,y])=>{u&&(u.instances[f]=c,h&&h!==u&&c&&c===m&&(u.leaveGuards.size||(u.leaveGuards=h.leaveGuards),u.updateGuards.size||(u.updateGuards=h.updateGuards))),c&&u&&(!h||!ci(u,h)||!m)&&(u.enterCallbacks[f]||[]).forEach(b=>b(c))},{flush:"post"}),()=>{const c=s.value,u=e.name,f=o.value,m=f&&f.components[u];if(!m)return yh(n.default,{Component:m,route:c});const h=f.props[u],y=h?h===!0?c.params:typeof h=="function"?h(c):h:null,S=Wi(m,gt({},y,t,{onVnodeUnmounted:k=>{k.component.isUnmounted&&(f.instances[u]=null)},ref:l}));return yh(n.default,{Component:S,route:c})||S}}});function yh(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const JR=QR;function YR(e){const t=FR(e.routes,e),n=e.parseQuery||kR,r=e.stringifyQuery||lh,s=e.history,i=zi(),a=zi(),o=zi(),l=yv(Gr);let c=Gr;Ws&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=Jl.bind(null,C=>""+C),f=Jl.bind(null,aR),m=Jl.bind(null,ca);function h(C,le){let Q,de;return Jg(C)?(Q=t.getRecordMatcher(C),de=le):de=C,t.addRoute(de,Q)}function y(C){const le=t.getRecordMatcher(C);le&&t.removeRoute(le)}function b(){return t.getRoutes().map(C=>C.record)}function S(C){return!!t.getRecordMatcher(C)}function k(C,le){if(le=gt({},le||l.value),typeof C=="string"){const Te=Yl(n,C,le.path),yt=t.resolve({path:Te.path},le),Ye=s.createHref(Te.fullPath);return gt(Te,yt,{params:m(yt.params),hash:ca(Te.hash),redirectedFrom:void 0,href:Ye})}let Q;if(C.path!=null)Q=gt({},C,{path:Yl(n,C.path,le.path).path});else{const Te=gt({},C.params);for(const yt in Te)Te[yt]==null&&delete Te[yt];Q=gt({},C,{params:f(Te)}),le.params=f(le.params)}const de=t.resolve(Q,le),Ie=C.hash||"";de.params=u(m(de.params));const Ge=cR(r,gt({},C,{hash:rR(Ie),path:de.path})),Be=s.createHref(Ge);return gt({fullPath:Ge,hash:Ie,query:r===lh?_R(C.query):C.query||{}},de,{redirectedFrom:void 0,href:Be})}function P(C){return typeof C=="string"?Yl(n,C,l.value.path):gt({},C)}function z(C,le){if(c!==C)return ui(Bt.NAVIGATION_CANCELLED,{from:le,to:C})}function I(C){return L(C)}function E(C){return I(gt(P(C),{replace:!0}))}function _(C,le){const Q=C.matched[C.matched.length-1];if(Q&&Q.redirect){const{redirect:de}=Q;let Ie=typeof de=="function"?de(C,le):de;return typeof Ie=="string"&&(Ie=Ie.includes("?")||Ie.includes("#")?Ie=P(Ie):{path:Ie},Ie.params={}),gt({query:C.query,hash:C.hash,params:Ie.path!=null?{}:C.params},Ie)}}function L(C,le){const Q=c=k(C),de=l.value,Ie=C.state,Ge=C.force,Be=C.replace===!0,Te=_(Q,de);if(Te)return L(gt(P(Te),{state:typeof Te=="object"?gt({},Ie,Te.state):Ie,force:Ge,replace:Be}),le||Q);const yt=Q;yt.redirectedFrom=le;let Ye;return!Ge&&uR(r,de,Q)&&(Ye=ui(Bt.NAVIGATION_DUPLICATED,{to:yt,from:de}),je(de,de,!0,!1)),(Ye?Promise.resolve(Ye):D(yt,de)).catch(Tt=>xr(Tt)?xr(Tt,Bt.NAVIGATION_GUARD_REDIRECT)?Tt:ie(Tt):re(Tt,yt,de)).then(Tt=>{if(Tt){if(xr(Tt,Bt.NAVIGATION_GUARD_REDIRECT))return L(gt({replace:Be},P(Tt.to),{state:typeof Tt.to=="object"?gt({},Ie,Tt.to.state):Ie,force:Ge}),le||yt)}else Tt=q(yt,de,!0,Be,Ie);return W(yt,de,Tt),Tt})}function N(C,le){const Q=z(C,le);return Q?Promise.reject(Q):Promise.resolve()}function G(C){const le=Ft.values().next().value;return le&&typeof le.runWithContext=="function"?le.runWithContext(C):C()}function D(C,le){let Q;const[de,Ie,Ge]=AR(C,le);Q=ec(de.reverse(),"beforeRouteLeave",C,le);for(const Te of de)Te.leaveGuards.forEach(yt=>{Q.push(Wr(yt,C,le))});const Be=N.bind(null,C,le);return Q.push(Be),at(Q).then(()=>{Q=[];for(const Te of i.list())Q.push(Wr(Te,C,le));return Q.push(Be),at(Q)}).then(()=>{Q=ec(Ie,"beforeRouteUpdate",C,le);for(const Te of Ie)Te.updateGuards.forEach(yt=>{Q.push(Wr(yt,C,le))});return Q.push(Be),at(Q)}).then(()=>{Q=[];for(const Te of Ge)if(Te.beforeEnter)if(Kn(Te.beforeEnter))for(const yt of Te.beforeEnter)Q.push(Wr(yt,C,le));else Q.push(Wr(Te.beforeEnter,C,le));return Q.push(Be),at(Q)}).then(()=>(C.matched.forEach(Te=>Te.enterCallbacks={}),Q=ec(Ge,"beforeRouteEnter",C,le,G),Q.push(Be),at(Q))).then(()=>{Q=[];for(const Te of a.list())Q.push(Wr(Te,C,le));return Q.push(Be),at(Q)}).catch(Te=>xr(Te,Bt.NAVIGATION_CANCELLED)?Te:Promise.reject(Te))}function W(C,le,Q){o.list().forEach(de=>G(()=>de(C,le,Q)))}function q(C,le,Q,de,Ie){const Ge=z(C,le);if(Ge)return Ge;const Be=le===Gr,Te=Ws?history.state:{};Q&&(de||Be?s.replace(C.fullPath,gt({scroll:Be&&Te&&Te.scroll},Ie)):s.push(C.fullPath,Ie)),l.value=C,je(C,le,Q,Be),ie()}let X;function ne(){X||(X=s.listen((C,le,Q)=>{if(!st.listening)return;const de=k(C),Ie=_(de,st.currentRoute.value);if(Ie){L(gt(Ie,{replace:!0,force:!0}),de).catch(Ki);return}c=de;const Ge=l.value;Ws&&bR(oh(Ge.fullPath,Q.delta),ll()),D(de,Ge).catch(Be=>xr(Be,Bt.NAVIGATION_ABORTED|Bt.NAVIGATION_CANCELLED)?Be:xr(Be,Bt.NAVIGATION_GUARD_REDIRECT)?(L(gt(P(Be.to),{force:!0}),de).then(Te=>{xr(Te,Bt.NAVIGATION_ABORTED|Bt.NAVIGATION_DUPLICATED)&&!Q.delta&&Q.type===i0.pop&&s.go(-1,!1)}).catch(Ki),Promise.reject()):(Q.delta&&s.go(-Q.delta,!1),re(Be,de,Ge))).then(Be=>{Be=Be||q(de,Ge,!1),Be&&(Q.delta&&!xr(Be,Bt.NAVIGATION_CANCELLED)?s.go(-Q.delta,!1):Q.type===i0.pop&&xr(Be,Bt.NAVIGATION_ABORTED|Bt.NAVIGATION_DUPLICATED)&&s.go(-1,!1)),W(de,Ge,Be)}).catch(Ki)}))}let he=zi(),Ae=zi(),se;function re(C,le,Q){ie(C);const de=Ae.list();return de.length?de.forEach(Ie=>Ie(C,le,Q)):console.error(C),Promise.reject(C)}function ze(){return se&&l.value!==Gr?Promise.resolve():new Promise((C,le)=>{he.add([C,le])})}function ie(C){return se||(se=!C,ne(),he.list().forEach(([le,Q])=>C?Q(C):le()),he.reset()),C}function je(C,le,Q,de){const{scrollBehavior:Ie}=e;if(!Ws||!Ie)return Promise.resolve();const Ge=!Q&&yR(oh(C.fullPath,0))||(de||!Q)&&history.state&&history.state.scroll||null;return ur().then(()=>Ie(C,le,Ge)).then(Be=>Be&&vR(Be)).catch(Be=>re(Be,C,le))}const rt=C=>s.go(C);let ot;const Ft=new Set,st={currentRoute:l,listening:!0,addRoute:h,removeRoute:y,clearRoutes:t.clearRoutes,hasRoute:S,getRoutes:b,resolve:k,options:e,push:I,replace:E,go:rt,back:()=>rt(-1),forward:()=>rt(1),beforeEach:i.add,beforeResolve:a.add,afterEach:o.add,onError:Ae.add,isReady:ze,install(C){C.component("RouterLink",ZR),C.component("RouterView",JR),C.config.globalProperties.$router=st,Object.defineProperty(C.config.globalProperties,"$route",{enumerable:!0,get:()=>g(l)}),Ws&&!ot&&l.value===Gr&&(ot=!0,I(s.location).catch(de=>{}));const le={};for(const de in Gr)Object.defineProperty(le,de,{get:()=>l.value[de],enumerable:!0});C.provide(Eu,st),C.provide(Xg,Ah(le)),C.provide(o0,l);const Q=C.unmount;Ft.add(C),C.unmount=function(){Ft.delete(C),Ft.size<1&&(c=Gr,X&&X(),X=null,l.value=Gr,ot=!1,se=!1),Q()}}};function at(C){return C.reduce((le,Q)=>le.then(()=>G(Q)),Promise.resolve())}return st}const XR={class:"panel triggers-view"},eC={class:"triggers-head"},tC={class:"triggers-layout"},nC={class:"field-row"},rC={class:"field-row"},sC={key:0,class:"field-row"},iC={key:1,class:"field-row"},aC={key:2,class:"field-row"},oC={key:3,class:"field-row"},lC={class:"field-row"},cC={class:"field-row trigger-wide"},uC={key:0,class:"form-error"},dC={key:0,class:"trigger-list"},fC={class:"trigger-card-head"},hC={class:"trigger-title"},pC={class:"trigger-meta"},mC={class:"trigger-actions"},gC={class:"trigger-prompt"},vC={key:0,class:"form-error"},bC={key:1,class:"logs-empty"},yC={key:0,class:"trigger-run-list"},wC={key:0,class:"form-error"},SC={key:1,class:"logs-empty"},xC=Re({__name:"TriggersView",setup(e){const t=ds(),n=F2(),r=rp(),s=Oe(""),i=Yr({name:"",sourceType:"schedule",intervalMs:"3600000",roots:"/workspace",globs:"**/*",statuses:"idle,failed",aiSessionId:"",promptTemplate:"Please review the current context and continue with the next useful step."}),a=we(()=>n.error.value instanceof Error?n.error.value.message:""),o=we(()=>{const I=n.data.value;return I?I.deployments.map(E=>({deployment:E,config:I.configs.find(_=>_.configHash===E.configHash),runtime:I.runtime.find(_=>_.configHash===E.configHash&&(_.deploymentId||_.configHash)===(E.deploymentId||E.configHash))})).filter(E=>!!E.config):[]});function l(){return i.sourceType==="file-change"?{type:"file-change",roots:u(i.roots),globs:u(i.globs),debounceMs:1500}:i.sourceType==="ai-session"?{type:"ai-session",statuses:u(i.statuses)}:{type:"schedule",intervalMs:Math.max(1e3,Number(i.intervalMs)||36e5)}}function c(){if(!i.aiSessionId)throw new Error("Select an AI session target.");return{type:"ai-session",aiSessionId:i.aiSessionId}}function u(I){return I.split(",").map(E=>E.trim()).filter(Boolean)}async function f(){await t.invalidateQueries({queryKey:["triggers"]}),await t.invalidateQueries({queryKey:["status"]})}async function m(){s.value="";try{await U2({name:i.name.trim()||"Untitled trigger",source:l(),action:{promptTemplate:i.promptTemplate},policy:{maxConcurrentRuns:1,whenBusy:"skip"},deployment:{origin:"controlled-instance",target:c()}}),i.name="",await f()}catch(I){s.value=I instanceof Error?I.message:String(I)}}async function h(I){await V2(I),await f()}async function y(I){await q2(I),await f()}async function b(I){await H2(I),await f()}async function S(I){await j2(I),await f()}function k(I){return I.length>14?`${I.slice(0,10)}...`:I}function P(I){return`AI session ${I.aiSessionId}`}function z(I){const E=new Date(I);return Number.isNaN(E.getTime())?I:E.toLocaleString()}return(I,E)=>(O(),j("section",XR,[x("header",eC,[x("div",null,[E[8]||(E[8]=x("h1",null,"Triggers",-1)),x("p",null,Z(g(n).data.value?.configs.length||0)+" configs · "+Z(g(n).data.value?.deployments.length||0)+" deployments",1)])]),x("div",tC,[T(g(Tr),null,{default:$(()=>[T(g(Fi),null,{default:$(()=>[T(g(Ui),null,{default:$(()=>[...E[9]||(E[9]=[fe("Create Local Trigger",-1)])]),_:1}),T(g(Li),null,{default:$(()=>[...E[10]||(E[10]=[fe("Triggers send prompts directly to an AI session.",-1)])]),_:1})]),_:1}),T(g(An),{class:"trigger-form"},{default:$(()=>[x("label",nC,[E[11]||(E[11]=x("span",null,"Name",-1)),T(g(Et),{modelValue:i.name,"onUpdate:modelValue":E[0]||(E[0]=_=>i.name=_),placeholder:"Review changed files"},null,8,["modelValue"])]),x("label",rC,[E[15]||(E[15]=x("span",null,"Source",-1)),T(g(lo),{modelValue:i.sourceType,"onUpdate:modelValue":E[1]||(E[1]=_=>i.sourceType=_)},{default:$(()=>[T(g(uo),{class:"select-input"},{default:$(()=>[T(g(fo))]),_:1}),T(g(co),null,{default:$(()=>[T(g(Qr),{value:"schedule"},{default:$(()=>[...E[12]||(E[12]=[fe("schedule",-1)])]),_:1}),T(g(Qr),{value:"file-change"},{default:$(()=>[...E[13]||(E[13]=[fe("file-change",-1)])]),_:1}),T(g(Qr),{value:"ai-session"},{default:$(()=>[...E[14]||(E[14]=[fe("ai-session",-1)])]),_:1})]),_:1})]),_:1},8,["modelValue"])]),i.sourceType==="schedule"?(O(),j("label",sC,[E[16]||(E[16]=x("span",null,"Interval ms",-1)),T(g(Et),{modelValue:i.intervalMs,"onUpdate:modelValue":E[2]||(E[2]=_=>i.intervalMs=_),inputmode:"numeric"},null,8,["modelValue"])])):pe("",!0),i.sourceType==="file-change"?(O(),j("label",iC,[E[17]||(E[17]=x("span",null,"Roots",-1)),T(g(Et),{modelValue:i.roots,"onUpdate:modelValue":E[3]||(E[3]=_=>i.roots=_),placeholder:"/workspace"},null,8,["modelValue"])])):pe("",!0),i.sourceType==="file-change"?(O(),j("label",aC,[E[18]||(E[18]=x("span",null,"Globs",-1)),T(g(Et),{modelValue:i.globs,"onUpdate:modelValue":E[4]||(E[4]=_=>i.globs=_),placeholder:"**/*"},null,8,["modelValue"])])):pe("",!0),i.sourceType==="ai-session"?(O(),j("label",oC,[E[19]||(E[19]=x("span",null,"Status",-1)),T(g(Et),{modelValue:i.statuses,"onUpdate:modelValue":E[5]||(E[5]=_=>i.statuses=_),placeholder:"idle,failed"},null,8,["modelValue"])])):pe("",!0),x("label",lC,[E[20]||(E[20]=x("span",null,"AI session",-1)),T(g(lo),{modelValue:i.aiSessionId,"onUpdate:modelValue":E[6]||(E[6]=_=>i.aiSessionId=_)},{default:$(()=>[T(g(uo),{class:"select-input"},{default:$(()=>[T(g(fo),{placeholder:"Select a session"})]),_:1}),T(g(co),null,{default:$(()=>[(O(!0),j(lt,null,Ht(g(r).data.value?.sessions||[],_=>(O(),Se(g(Qr),{key:_.id,value:_.id},{default:$(()=>[fe(Z(_.title||_.id)+" · "+Z(_.agent),1)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["modelValue"])]),x("label",cC,[E[21]||(E[21]=x("span",null,"Prompt",-1)),T(g(or),{modelValue:i.promptTemplate,"onUpdate:modelValue":E[7]||(E[7]=_=>i.promptTemplate=_),rows:"8"},null,8,["modelValue"])])]),_:1}),T(g(S0),{class:"editor-actions"},{default:$(()=>[s.value?(O(),j("p",uC,Z(s.value),1)):pe("",!0),T(g(nt),{size:"sm",disabled:!i.aiSessionId,onClick:m},{default:$(()=>[...E[22]||(E[22]=[fe("Create",-1)])]),_:1},8,["disabled"])]),_:1})]),_:1}),T(g(Tr),null,{default:$(()=>[T(g(Fi),null,{default:$(()=>[T(g(Ui),null,{default:$(()=>[...E[23]||(E[23]=[fe("Deployments",-1)])]),_:1}),T(g(Li),null,{default:$(()=>[fe(Z(a.value||"Local and Control Plane applied triggers on this instance."),1)]),_:1})]),_:1}),T(g(An),null,{default:$(()=>[o.value.length?(O(),j("div",dC,[(O(!0),j(lt,null,Ht(o.value,_=>(O(),j("section",{key:_.deployment.deploymentId||_.config.configHash,class:"trigger-card"},[x("header",fC,[x("div",null,[x("div",hC,[fe(Z(_.config.name)+" ",1),T(g(es),{variant:"secondary"},{default:$(()=>[fe(Z(_.config.source.type),1)]),_:2},1024),T(g(es),null,{default:$(()=>[fe(Z(_.deployment.origin),1)]),_:2},1024)]),x("div",pC,[x("span",null,Z(k(_.config.configHash)),1),x("span",null,Z(_.runtime?.status||(_.deployment.enabled?"idle":"disabled")),1),x("span",null,Z(P(_.deployment.target)),1)])]),x("div",mC,[T(g(nt),{variant:"outline",size:"sm",onClick:L=>h(_.config.configHash)},{default:$(()=>[...E[24]||(E[24]=[fe("Run",-1)])]),_:1},8,["onClick"]),_.deployment.enabled?(O(),Se(g(nt),{key:0,variant:"outline",size:"sm",onClick:L=>b(_.config.configHash)},{default:$(()=>[...E[25]||(E[25]=[fe("Disable",-1)])]),_:1},8,["onClick"])):(O(),Se(g(nt),{key:1,variant:"outline",size:"sm",onClick:L=>y(_.config.configHash)},{default:$(()=>[...E[26]||(E[26]=[fe("Enable",-1)])]),_:1},8,["onClick"])),T(g(nt),{variant:"outline",size:"sm",onClick:L=>S(_.config.configHash)},{default:$(()=>[...E[27]||(E[27]=[fe("Delete",-1)])]),_:1},8,["onClick"])])]),x("pre",gC,Z(_.config.action.promptTemplate),1),_.runtime?.lastError?(O(),j("p",vC,Z(_.runtime.lastError),1)):pe("",!0)]))),128))])):(O(),j("p",bC,"No triggers yet."))]),_:1})]),_:1})]),T(g(Tr),null,{default:$(()=>[T(g(Fi),null,{default:$(()=>[T(g(Ui),null,{default:$(()=>[...E[28]||(E[28]=[fe("Recent Runs",-1)])]),_:1}),T(g(Li),null,{default:$(()=>[fe(Z(g(n).data.value?.recentRuns.length||0)+" runs",1)]),_:1})]),_:1}),T(g(An),null,{default:$(()=>[g(n).data.value?.recentRuns.length?(O(),j("div",yC,[(O(!0),j(lt,null,Ht(g(n).data.value.recentRuns,_=>(O(),j("div",{key:_.id,class:"trigger-run-row"},[T(g(es),{variant:_.status==="failed"?"destructive":"secondary"},{default:$(()=>[fe(Z(_.status),1)]),_:2},1032,["variant"]),x("span",null,Z(k(_.configHash)),1),x("span",null,Z(_.eventType),1),x("span",null,Z(z(_.startedAt)),1),_.error?(O(),j("span",wC,Z(_.error),1)):pe("",!0)]))),128))])):(O(),j("p",SC,"No trigger runs yet."))]),_:1})]),_:1})]))}}),kC={class:"automation-status"},_C=Re({__name:"AutomationStatus",props:{session:{}},setup(e){const t=e,n=K2(t.session.id,t.session.status==="running"&&!!t.session.automation),r=we(()=>n.isLoading.value?"checking":n.data.value?.ready?"ready":"not ready"),s=we(()=>{const i=n.data.value;return i?i.ready?[i.browser,i.protocolVersion?`protocol ${i.protocolVersion}`:void 0].filter(Boolean).join(" · "):i.error?.message||i.endpoint:t.session.automation?.endpoint||""});return(i,a)=>(O(),j("div",kC,[T(g(es),{variant:g(n).data.value?.ready?"default":"secondary"},{default:$(()=>[fe(Z(r.value),1)]),_:1},8,["variant"]),x("span",null,Z(s.value),1)]))}}),EC={class:"panel"},AC={class:"apps-layout"},TC={class:"catalog-content"},IC={class:"section-head"},RC={class:"catalog-head"},CC={class:"item-title"},OC={class:"item-meta"},NC={key:0},MC={class:"catalog-actions"},zC={class:"launch-form"},$C={key:0,class:"display-fields"},DC={key:1,class:"form-error"},PC={class:"section-head sessions-head"},BC={class:"section-actions"},LC={class:"session-actions"},FC={key:0,class:"session-error"},UC={class:"session-metadata"},qC={key:0},HC={key:1},VC={key:2},jC={key:3},GC={key:4},ZC={key:0},KC={key:1},WC={key:5},QC={key:6},JC={key:0},YC={key:1},XC={class:"sessions"},eO={key:0,class:"workspace-tabs"},tO={class:"workspace-tab-list"},nO=["onClick"],rO={class:"tab-kind"},sO=["onClick"],iO={key:0,class:"desktop-tab-toolbar"},aO={key:0,class:"segmented-control"},oO={class:"workspace-tab-panel"},lO=["src","title"],cO={key:2,class:"gui-session"},uO=["src","title"],dO={key:1,class:"logs-empty"},fO={key:4,class:"logs-empty"},hO={key:1,class:"logs-empty"},pO={key:1,class:"logs-empty"},mO={class:"modal-header"},gO={key:0},vO={class:"modal-scroll-content"},bO={class:"custom-app-form"},yO={key:0,class:"display-fields"},wO={class:"catalog-actions"},SO={key:0,class:"form-error"},xO={class:"form-error"},kO=Re({__name:"AppsView",setup(e){const t=ds(),n=tp(),r=np(),s=di(),i=$s(),a=fi(),o=Oe("[]"),l=Oe(""),c=Oe(""),u=Oe(!1),f=Oe(!1),m=Oe("scale"),h=Yr({id:"",name:"",description:"",kind:"tty",command:"",args:"",cwd:"",envJson:"{}",width:"",height:"",depth:""}),y=Yr({}),b=Yr({}),S=we(()=>a.tabs.find(V=>V.id===a.activeTabId)),k=we(()=>y0(S.value,s.data.value||[])),P=we(()=>new Set((r.data.value?.items||[]).map(V=>V.id))),z=we(()=>(s.data.value||[]).filter(ie)),I=we(()=>f.value?s.data.value||[]:(s.data.value||[]).filter(V=>!ie(V))),E=we(()=>{const V=r.error.value;return V?`Custom app catalog is invalid: ${V instanceof Error?V.message:String(V)}`:""});pn(()=>r.data.value?.items,V=>{o.value=JSON.stringify(V||[],null,2)},{immediate:!0}),Pn(()=>{if(!s.data.value)return;const V=s.data.value||[];a.pruneSession(new Set(V.map(F=>F.id)),ti(V))});function _(V){return y[V]||={title:"",cwd:"",argsJson:"[]",envJson:"{}",width:"",height:"",depth:""},y[V]}function L(V,F,U){const De=V.trim();if(!De)return F;try{return JSON.parse(De)}catch(mt){throw new Error(`${U} is invalid JSON: ${mt instanceof Error?mt.message:String(mt)}`)}}function N(V){const F=_(V.id),U={},De=L(F.argsJson,[],"Args"),mt=L(F.envJson,{},"Env");if(!Array.isArray(De)||De.some(Hn=>typeof Hn!="string"))throw new Error("Args JSON must be an array of strings.");if(!mt||typeof mt!="object"||Array.isArray(mt)||Object.values(mt).some(Hn=>typeof Hn!="string"))throw new Error("Env JSON must be an object with string values.");F.title.trim()&&(U.title=F.title.trim()),F.cwd.trim()&&(U.cwd=F.cwd.trim()),De.length&&(U.args=De),Object.keys(mt).length&&(U.env=mt);const ln={width:G(F.width),height:G(F.height),depth:G(F.depth)},$n=Object.fromEntries(Object.entries(ln).filter(([,Hn])=>Hn!==void 0));return V.kind==="gui"&&Object.keys($n).length&&(U.display=$n),U}function G(V){const F=V.trim();if(!F)return;const U=Number(F);if(!Number.isInteger(U)||U<=0)throw new Error("Display values must be positive integers.");return U}function D(V){if(V.vnc?.backend==="kasmvnc"){const mt=a.guiHidpi?st():1,ln=new URLSearchParams({path:io(`/api/apps/sessions/${V.id}/web/websockify`),autoconnect:"1",resize:m.value,enable_hidpi:a.guiHidpi&&mt>1?"1":"0",show_control_bar:"1"}),$n=q(V,mt);return m.value==="scale"&&$n&&(ln.set("forced_resolution_x",String($n.width)),ln.set("forced_resolution_y",String($n.height))),i.token&&ln.set("token",i.token),`${jn(V.vnc.webPath)}?${ln.toString()}`}const F=i.token?`?token=${encodeURIComponent(i.token)}`:"",U=V.vnc?.webPath?`${io(V.vnc.webPath)}${F}`:"",De=new URLSearchParams({path:U,autoconnect:"1",resize:m.value});return jn(`/api/novnc/vnc.html?${De.toString()}`)}function W(V,F){if(F.vnc?.backend!=="kasmvnc")return;const U=V.target;if(!(U instanceof HTMLIFrameElement))return;U.contentWindow?.postMessage({action:"resize",value:m.value},"*");const De=q(F,a.guiHidpi?st():1);m.value==="scale"&&De&&U.contentWindow?.postMessage({action:"set_resolution",value_x:De.width,value_y:De.height},"*")}function q(V,F){if(!V.display)return;const U=F>1?F:1;return{width:Math.max(1,Math.round(V.display.width/U)),height:Math.max(1,Math.round(V.display.height/U))}}function X(V){m.value=V}function ne(V){a.setGuiHidpi(V)}function he(V){const F=new URLSearchParams;i.token&&F.set("token",i.token);const U=F.toString()?`?${F.toString()}`:"";return jn(`/api/apps/sessions/${V.id}/screenshot${U}`)}function Ae(V){const F=jn(V.web?.webPath||"");return i.token?`${F}${F.includes("?")?"&":"?"}token=${encodeURIComponent(i.token)}`:F}function se(V){return V.type==="logs"?"logs":V.type==="shared-vnc"?"shared":V.type==="app-vnc"?"vnc":V.type==="app-web"?"web":"tty"}function re(V){return V.status==="running"}function ze(V){return re(V)&&(V.kind==="tty"||V.kind==="web"&&!!V.web||V.kind==="gui"&&!!V.vnc)}function ie(V){return V.error?.code==="APP_SESSION_RESTORED_WITHOUT_PROCESS"}function je(V){const F=new Date(V);return Number.isNaN(F.getTime())?V:F.toLocaleString()}function rt(V){return Object.keys(V).sort().join(", ")}async function ot(V){b[V.id]="";try{const F=await sp(V.id,Ft(V,N(V)));Be(F),Ge(F),await t.invalidateQueries({queryKey:["app-sessions"]}),await t.invalidateQueries({queryKey:["status"]})}catch(F){b[V.id]=F instanceof Error?F.message:String(F)}}function Ft(V,F){if(V.kind!=="gui")return F;const U=a.guiHidpi?st():1,De={...F.env||{}};De.TASK_HANDOFF_GUI_SCALE||(De.TASK_HANDOFF_GUI_SCALE=at(U));const mt=C(F.display||V.display,U);return{...F,env:De,...mt?{display:mt}:{}}}function st(){const V=typeof window>"u"?1:window.devicePixelRatio||1;return Math.min(3,Math.max(1,V))}function at(V){return V.toFixed(2).replace(/\.?0+$/,"")}function C(V,F){return!V?.width||!V.height?V:{...V,width:Math.round(V.width*F),height:Math.round(V.height*F)}}async function le(V){await Cs(V),await t.invalidateQueries({queryKey:["app-sessions"]}),await t.invalidateQueries({queryKey:["status"]})}async function Q(V){if(V.type==="app-vnc"||V.type==="app-web"||V.type==="app-tty"){await Cs(V.sessionId),a.close(V.id),await t.invalidateQueries({queryKey:["app-sessions"]}),await t.invalidateQueries({queryKey:["status"]});return}a.close(V.id)}async function de(V){const F=await m0(V);Be(F),Ge(F),await t.invalidateQueries({queryKey:["app-sessions"]}),await t.invalidateQueries({queryKey:["status"]})}async function Ie(V){await ip(V);const F=(s.data.value||[]).filter(U=>U.id!==V);a.pruneSession(new Set(F.map(U=>U.id)),ti(F)),await t.invalidateQueries({queryKey:["app-sessions"]}),await t.invalidateQueries({queryKey:["status"]})}function Ge(V){if(!ze(V)){Te(V);return}a.open(da(V))}function Be(V){t.setQueryData(["app-sessions"],(F=[])=>[V,...F.filter(U=>U.id!==V.id)])}function Te(V){a.open({type:"logs",id:`logs:${V.id}`,sessionId:V.id,title:`${V.title} logs`})}function yt(){l.value="",o.value=JSON.stringify(r.data.value?.items||[],null,2)}function Ye(V){return P.value.has(V)}function Tt(V){return(V.match(/"[^"]*"|'[^']*'|\S+/g)||[]).map(U=>U.replace(/^(['"])(.*)\1$/,"$2"))}function bn(){const V=JSON.parse(o.value||"[]");if(!Array.isArray(V))throw new Error("Custom Apps JSON must be an array.");return V}function Yn(){c.value="",h.id="",h.name="",h.description="",h.kind="tty",h.command="",h.args="",h.cwd="",h.envJson="{}",h.width="",h.height="",h.depth=""}function br(V){c.value=V.id,h.id=V.id,h.name=V.name,h.description=V.description||"",h.kind=V.kind==="gui"?"gui":"tty",h.command=V.command||"",h.args=(V.args||[]).map(F=>/\s/.test(F)?JSON.stringify(F):F).join(" "),h.cwd=V.cwd||"",h.envJson=JSON.stringify(V.env||{},null,2),h.width=V.display?.width===void 0?"":String(V.display.width),h.height=V.display?.height===void 0?"":String(V.display.height),h.depth=V.display?.depth===void 0?"":String(V.display.depth)}function Si(V){l.value="",br(V)}function xi(){l.value="",Yn()}function Lr(){const V=h.id.trim(),F=h.name.trim(),U=h.command.trim();if(!V||!F||!U)throw new Error("Custom app id, name, and command are required.");const De={id:V,name:F,kind:h.kind,command:U};h.description.trim()&&(De.description=h.description.trim());const mt=Tt(h.args);mt.length&&(De.args=mt),h.cwd.trim()&&(De.cwd=h.cwd.trim());const ln=L(h.envJson,{},"Custom app env");if(!ln||typeof ln!="object"||Array.isArray(ln)||Object.values(ln).some($n=>typeof $n!="string"))throw new Error("Custom app env JSON must be an object with string values.");if(Object.keys(ln).length&&(De.env=ln),h.kind==="gui"){const $n={width:G(h.width),height:G(h.height),depth:G(h.depth)},Hn=Object.fromEntries(Object.entries($n).filter(([,cl])=>cl!==void 0));Object.keys(Hn).length&&(De.display=Hn)}return De}async function zn(){l.value="";try{const V=bn(),F=Lr(),U=c.value;if(!U&&V.some(mt=>mt.id===F.id))throw new Error("Custom app id already exists.");if(U&&F.id!==U&&V.some(mt=>mt.id===F.id))throw new Error("Custom app id already exists.");if(U&&!V.some(mt=>mt.id===U))throw new Error("Custom app was not found.");const De=U?V.map(mt=>mt.id===U?F:mt):[...V,F];await Ys(De),o.value=JSON.stringify(De,null,2),Yn(),await t.invalidateQueries({queryKey:["app-catalog"]}),await t.invalidateQueries({queryKey:["app-catalog-custom"]})}catch(V){l.value=V instanceof Error?V.message:String(V)}}async function vs(V){l.value="";try{const F=bn(),U=F.filter(De=>De.id!==V);if(U.length===F.length)throw new Error("Custom app was not found.");await Ys(U),o.value=JSON.stringify(U,null,2),c.value===V&&Yn(),await t.invalidateQueries({queryKey:["app-catalog"]}),await t.invalidateQueries({queryKey:["app-catalog-custom"]})}catch(F){l.value=F instanceof Error?F.message:String(F)}}async function Xn(){l.value="";try{const V=bn();await Ys(V),await t.invalidateQueries({queryKey:["app-catalog"]}),await t.invalidateQueries({queryKey:["app-catalog-custom"]}),l.value=""}catch(V){l.value=V instanceof Error?V.message:String(V)}}return(V,F)=>(O(),j("section",EC,[F[49]||(F[49]=x("h1",null,"Desktop",-1)),x("div",AC,[T(g(In),{class:"catalog"},{default:$(()=>[x("aside",TC,[x("div",IC,[F[18]||(F[18]=x("h2",null,"Apps",-1)),T(g(nt),{variant:"outline",size:"sm",onClick:F[0]||(F[0]=U=>u.value=!0)},{default:$(()=>[...F[17]||(F[17]=[fe("Custom Apps",-1)])]),_:1})]),(O(!0),j(lt,null,Ht(g(n).data.value||[],U=>(O(),Se(g(Tr),{key:U.id},{default:$(()=>[T(g(An),{class:"catalog-item"},{default:$(()=>[x("div",RC,[x("div",null,[x("div",CC,Z(U.name),1),x("div",OC,[T(g(es),{variant:"secondary"},{default:$(()=>[fe(Z(U.kind),1)]),_:2},1024),U.command?(O(),j("span",NC,Z(U.command),1)):pe("",!0)])]),x("div",MC,[T(g(nt),{size:"sm",onClick:De=>ot(U)},{default:$(()=>[...F[19]||(F[19]=[fe("Launch",-1)])]),_:1},8,["onClick"]),Ye(U.id)?(O(),Se(g(nt),{key:0,variant:"outline",size:"sm",onClick:De=>Si(U)},{default:$(()=>[...F[20]||(F[20]=[fe("Edit",-1)])]),_:1},8,["onClick"])):pe("",!0),Ye(U.id)?(O(),Se(g(nt),{key:1,variant:"outline",size:"sm",onClick:De=>vs(U.id)},{default:$(()=>[...F[21]||(F[21]=[fe("Remove",-1)])]),_:1},8,["onClick"])):pe("",!0)])]),x("div",zC,[T(g(Et),{modelValue:_(U.id).title,"onUpdate:modelValue":De=>_(U.id).title=De,placeholder:"title"},null,8,["modelValue","onUpdate:modelValue"]),T(g(Et),{modelValue:_(U.id).cwd,"onUpdate:modelValue":De=>_(U.id).cwd=De,placeholder:"/workspace"},null,8,["modelValue","onUpdate:modelValue"]),U.kind==="gui"?(O(),j("div",$C,[T(g(Et),{modelValue:_(U.id).width,"onUpdate:modelValue":De=>_(U.id).width=De,inputmode:"numeric",placeholder:"width"},null,8,["modelValue","onUpdate:modelValue"]),T(g(Et),{modelValue:_(U.id).height,"onUpdate:modelValue":De=>_(U.id).height=De,inputmode:"numeric",placeholder:"height"},null,8,["modelValue","onUpdate:modelValue"]),T(g(Et),{modelValue:_(U.id).depth,"onUpdate:modelValue":De=>_(U.id).depth=De,inputmode:"numeric",placeholder:"depth"},null,8,["modelValue","onUpdate:modelValue"])])):pe("",!0),T(g(or),{modelValue:_(U.id).argsJson,"onUpdate:modelValue":De=>_(U.id).argsJson=De,class:"launch-json",spellcheck:"false",placeholder:'args JSON, e.g. ["https://example.com"]'},null,8,["modelValue","onUpdate:modelValue"]),T(g(or),{modelValue:_(U.id).envJson,"onUpdate:modelValue":De=>_(U.id).envJson=De,class:"launch-json",spellcheck:"false",placeholder:'env JSON, e.g. {"LANG":"C.UTF-8"}'},null,8,["modelValue","onUpdate:modelValue"]),b[U.id]?(O(),j("p",DC,Z(b[U.id]),1)):pe("",!0)])]),_:2},1024)]),_:2},1024))),128)),x("div",PC,[F[22]||(F[22]=x("h2",null,"Sessions",-1)),x("div",BC,[x("span",null,Z(I.value.length),1),z.value.length?(O(),Se(g(nt),{key:0,variant:"outline",size:"sm",onClick:F[1]||(F[1]=U=>f.value=!f.value)},{default:$(()=>[fe(Z(f.value?"Hide restored":`Show restored (${z.value.length})`),1)]),_:1})):pe("",!0)])]),(O(!0),j(lt,null,Ht(I.value,U=>(O(),Se(g(Tr),{key:U.id,class:"session-card"},{default:$(()=>[T(g(Fi),{class:"session-header"},{default:$(()=>[x("div",null,[T(g(Ui),null,{default:$(()=>[fe(Z(U.title),1)]),_:2},1024),T(g(Li),null,{default:$(()=>[fe(Z(U.appId)+" · "+Z(je(U.updatedAt)),1)]),_:2},1024)]),x("div",LC,[T(g(es),{variant:U.status==="running"?"default":"secondary"},{default:$(()=>[fe(Z(U.status),1)]),_:2},1032,["variant"]),T(g(nt),{variant:"outline",size:"sm",disabled:!re(U),onClick:De=>le(U.id)},{default:$(()=>[...F[23]||(F[23]=[fe("Stop",-1)])]),_:1},8,["disabled","onClick"]),T(g(nt),{variant:"outline",size:"sm",onClick:De=>de(U.id)},{default:$(()=>[...F[24]||(F[24]=[fe("Restart",-1)])]),_:1},8,["onClick"]),T(g(nt),{variant:"outline",size:"sm",disabled:!ze(U),onClick:De=>Ge(U)},{default:$(()=>[...F[25]||(F[25]=[fe("Open",-1)])]),_:1},8,["disabled","onClick"]),T(g(nt),{variant:"outline",size:"sm",onClick:De=>Te(U)},{default:$(()=>[...F[26]||(F[26]=[fe("Logs",-1)])]),_:1},8,["onClick"]),U.kind==="gui"&&re(U)?(O(),Se(g(nt),{key:0,variant:"outline",size:"sm",as:"a",href:he(U),target:"_blank",rel:"noreferrer"},{default:$(()=>[...F[27]||(F[27]=[fe("Screenshot",-1)])]),_:1},8,["href"])):pe("",!0),T(g(nt),{variant:"outline",size:"sm",onClick:De=>Ie(U.id)},{default:$(()=>[...F[28]||(F[28]=[fe("Delete",-1)])]),_:1},8,["onClick"])])]),_:2},1024),T(g(An),null,{default:$(()=>[U.error?(O(),j("p",FC,Z(U.error.code)+": "+Z(U.error.message),1)):pe("",!0),x("dl",UC,[x("div",null,[F[29]||(F[29]=x("dt",null,"Created",-1)),x("dd",null,Z(je(U.createdAt)),1)]),x("div",null,[F[30]||(F[30]=x("dt",null,"Updated",-1)),x("dd",null,Z(je(U.updatedAt)),1)]),U.tty?.cwd||U.launch?.cwd?(O(),j("div",qC,[F[31]||(F[31]=x("dt",null,"CWD",-1)),x("dd",null,Z(U.launch?.cwd||U.tty?.cwd),1)])):pe("",!0),U.launch?.args?.length?(O(),j("div",HC,[F[32]||(F[32]=x("dt",null,"Args",-1)),x("dd",null,Z(U.launch.args.join(" ")),1)])):pe("",!0),U.launch?.env&&Object.keys(U.launch.env).length?(O(),j("div",VC,[F[33]||(F[33]=x("dt",null,"Env",-1)),x("dd",null,Z(rt(U.launch.env)),1)])):pe("",!0),U.display?(O(),j("div",jC,[F[34]||(F[34]=x("dt",null,"Display",-1)),x("dd",null,Z(U.display.display)+" "+Z(U.display.width)+"x"+Z(U.display.height)+"x"+Z(U.display.depth),1)])):pe("",!0),U.vnc?(O(),j("div",GC,[F[35]||(F[35]=x("dt",null,"Ports",-1)),x("dd",null,[fe(Z(U.vnc.backend==="kasmvnc"?"kasmvnc":"vnc")+" "+Z(U.vnc.port),1),U.vnc.websockifyPort?(O(),j("span",ZC," · ws "+Z(U.vnc.websockifyPort),1)):pe("",!0),U.automation?(O(),j("span",KC," · cdp "+Z(U.automation.port),1)):pe("",!0)])])):pe("",!0),U.automation?(O(),j("div",WC,[F[36]||(F[36]=x("dt",null,"Automation",-1)),x("dd",null,[T(_C,{session:U},null,8,["session"])])])):pe("",!0),U.process?(O(),j("div",QC,[F[37]||(F[37]=x("dt",null,"Process",-1)),x("dd",null,[fe(Z(U.process.command),1),U.process.pid?(O(),j("span",JC," · pid "+Z(U.process.pid),1)):pe("",!0),U.process.exitCode!==void 0&&U.process.exitCode!==null?(O(),j("span",YC," · exit "+Z(U.process.exitCode),1)):pe("",!0)])])):pe("",!0)])]),_:2},1024)]),_:2},1024))),128))])]),_:1}),x("section",XC,[F[41]||(F[41]=x("h2",null,"Workspace",-1)),g(a).tabs.length?(O(),j("div",eO,[T(g(In),{class:"workspace-tab-list-scroll"},{default:$(()=>[x("div",tO,[(O(!0),j(lt,null,Ht(g(a).tabs,U=>(O(),j("button",{key:U.id,type:"button",class:At({active:g(a).activeTabId===U.id}),onClick:De=>g(a).setActive(U.id)},[x("span",null,Z(U.title),1),x("span",rO,Z(se(U)),1),x("span",{class:"tab-close",title:"Close tab","aria-label":"Close tab",onClick:en(De=>Q(U),["stop"])},[T(g(Os),{size:13,"stroke-width":2.2})],8,sO)],10,nO))),128))])]),_:1}),k.value?(O(),j("div",iO,[x("span",null,Z(k.value.appId)+" · "+Z(k.value.status),1),x("div",null,[k.value.kind==="gui"&&k.value.status==="running"?(O(),j("div",aO,[T(g(_p),{type:"single","model-value":m.value,"aria-label":"VNC resize mode","onUpdate:modelValue":F[2]||(F[2]=U=>U&&X(U))},{default:$(()=>[T(g(oo),{value:"scale"},{default:$(()=>[...F[38]||(F[38]=[fe("Scale",-1)])]),_:1}),T(g(oo),{value:"remote"},{default:$(()=>[...F[39]||(F[39]=[fe("Resize",-1)])]),_:1})]),_:1},8,["model-value"]),T(g(xp),{"model-value":g(a).guiHidpi,"aria-label":"Toggle HiDPI","onUpdate:modelValue":ne},{default:$(()=>[...F[40]||(F[40]=[fe("HiDPI",-1)])]),_:1},8,["model-value"])])):pe("",!0)])])):pe("",!0),x("div",oO,[k.value&&S.value?(O(),j(lt,{key:0},[S.value.type==="app-tty"&&k.value.status==="running"?(O(),Se(Lp,{key:0,session:k.value},null,8,["session"])):S.value.type==="app-web"&&k.value.status==="running"&&k.value.web?(O(),j("iframe",{key:1,class:"web-frame",src:Ae(k.value),title:k.value.title,allow:"clipboard-read; clipboard-write; fullscreen"},null,8,lO)):S.value.type==="app-vnc"||S.value.type==="shared-vnc"?(O(),j("div",cO,[k.value.vnc?(O(),j("iframe",{key:`${k.value.id}:${m.value}:${g(a).guiHidpi?"hidpi":"1x"}`,class:"vnc-frame workspace-vnc-frame",src:D(k.value),title:`${S.value.title} VNC`,allow:"clipboard-read; clipboard-write; fullscreen",onLoad:F[3]||(F[3]=U=>W(U,k.value))},null,40,uO)):(O(),j("p",dO,"VNC is unavailable for this session."))])):S.value.type==="logs"?(O(),Se(Bp,{key:3,session:k.value},null,8,["session"])):(O(),j("p",fO,"Runtime view is unavailable for this session state."))],64)):(O(),j("p",hO,"The selected workspace tab no longer has a running session."))])])):(O(),j("p",pO,"Open a running app to create a workspace tab."))])]),T(g(Mp),{open:u.value,"onUpdate:open":F[16]||(F[16]=U=>u.value=U)},{default:$(()=>[T(g(zp),{class:"modal-panel gap-0 p-0",style:{width:"min(1180px, calc(100vw - 48px))","max-width":"calc(100vw - 48px)"}},{default:$(()=>[x("header",mO,[x("div",null,[T(g(Dp),null,{default:$(()=>[...F[42]||(F[42]=[fe("Custom Apps",-1)])]),_:1}),T(g($p),{class:"sr-only"},{default:$(()=>[...F[43]||(F[43]=[fe("Create and manage custom applications available in this controlled instance.",-1)])]),_:1}),g(r).data.value?(O(),j("p",gO,Z(g(r).data.value.path),1)):pe("",!0)])]),T(g(In),{class:"modal-scroll"},{default:$(()=>[x("div",vO,[T(g(Tr),{class:"catalog-editor"},{default:$(()=>[T(g(An),null,{default:$(()=>[x("div",bO,[T(g(Et),{modelValue:h.id,"onUpdate:modelValue":F[4]||(F[4]=U=>h.id=U),placeholder:"id"},null,8,["modelValue"]),T(g(Et),{modelValue:h.name,"onUpdate:modelValue":F[5]||(F[5]=U=>h.name=U),placeholder:"name"},null,8,["modelValue"]),T(g(or),{modelValue:h.description,"onUpdate:modelValue":F[6]||(F[6]=U=>h.description=U),class:"launch-json",spellcheck:"false",placeholder:"description"},null,8,["modelValue"]),T(g(lo),{modelValue:h.kind,"onUpdate:modelValue":F[7]||(F[7]=U=>h.kind=U)},{default:$(()=>[T(g(uo),{class:"native-select"},{default:$(()=>[T(g(fo),{placeholder:"App kind"})]),_:1}),T(g(co),null,{default:$(()=>[T(g(Qr),{value:"tty"},{default:$(()=>[...F[44]||(F[44]=[fe("TTY",-1)])]),_:1}),T(g(Qr),{value:"gui"},{default:$(()=>[...F[45]||(F[45]=[fe("GUI",-1)])]),_:1})]),_:1})]),_:1},8,["modelValue"]),T(g(Et),{modelValue:h.command,"onUpdate:modelValue":F[8]||(F[8]=U=>h.command=U),placeholder:"/usr/bin/app"},null,8,["modelValue"]),T(g(Et),{modelValue:h.args,"onUpdate:modelValue":F[9]||(F[9]=U=>h.args=U),placeholder:'args, e.g. --new-window "https://example.com"'},null,8,["modelValue"]),T(g(Et),{modelValue:h.cwd,"onUpdate:modelValue":F[10]||(F[10]=U=>h.cwd=U),placeholder:"/workspace"},null,8,["modelValue"]),T(g(or),{modelValue:h.envJson,"onUpdate:modelValue":F[11]||(F[11]=U=>h.envJson=U),class:"launch-json",spellcheck:"false",placeholder:'env JSON, e.g. {"LANG":"C.UTF-8"}'},null,8,["modelValue"]),h.kind==="gui"?(O(),j("div",yO,[T(g(Et),{modelValue:h.width,"onUpdate:modelValue":F[12]||(F[12]=U=>h.width=U),inputmode:"numeric",placeholder:"width"},null,8,["modelValue"]),T(g(Et),{modelValue:h.height,"onUpdate:modelValue":F[13]||(F[13]=U=>h.height=U),inputmode:"numeric",placeholder:"height"},null,8,["modelValue"]),T(g(Et),{modelValue:h.depth,"onUpdate:modelValue":F[14]||(F[14]=U=>h.depth=U),inputmode:"numeric",placeholder:"depth"},null,8,["modelValue"])])):pe("",!0),x("div",wO,[T(g(nt),{size:"sm",onClick:zn},{default:$(()=>[fe(Z(c.value?"Update App":"Add App"),1)]),_:1}),c.value?(O(),Se(g(nt),{key:0,variant:"outline",size:"sm",onClick:xi},{default:$(()=>[...F[46]||(F[46]=[fe("Cancel",-1)])]),_:1})):pe("",!0)])])]),_:1}),T(g(An),null,{default:$(()=>[T(g(or),{modelValue:o.value,"onUpdate:modelValue":F[15]||(F[15]=U=>o.value=U),class:"catalog-json",spellcheck:"false"},null,8,["modelValue"]),E.value?(O(),j("p",SO,Z(E.value),1)):pe("",!0)]),_:1}),T(g(S0),{class:"editor-actions"},{default:$(()=>[T(g(nt),{variant:"outline",size:"sm",onClick:yt},{default:$(()=>[...F[47]||(F[47]=[fe("Reset",-1)])]),_:1}),T(g(nt),{size:"sm",onClick:Xn},{default:$(()=>[...F[48]||(F[48]=[fe("Save",-1)])]),_:1})]),_:1}),l.value?(O(),Se(g(An),{key:0},{default:$(()=>[x("p",xO,Z(l.value),1)]),_:1})):pe("",!0)]),_:1})])]),_:1})]),_:1})]),_:1},8,["open"])]))}}),_O=YR({history:CR(qh()||"/"),routes:[{path:"/",component:Pp},{path:"/triggers",component:xC},{path:"/apps",component:kO},{path:"/:pathMatch(.*)*",redirect:"/"}]}),EO="task-handoff.theme",tc="dark";function AO(){if(typeof window>"u")return tc;try{const e=window.localStorage.getItem(EO);return e==="light"||e==="dark"?e:tc}catch{return tc}}function TO(e){document.documentElement.dataset.theme=e,document.documentElement.classList.toggle("dark",e==="dark")}function IO(){TO(AO())}IO();const RO=window,CO=!!RO.taskHandoffDesktop||navigator.userAgent.includes("Electron");CO&&navigator.platform.toLowerCase().includes("mac")&&document.documentElement.classList.add("native-macos-titlebar");wv(GI).use(_v()).use(o2).use(_O).mount("#app");export{hw as _,v5 as g};
|
|
381
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const a of e.seen.entries()){const o=a[1];if(t===a[0]){i(a);continue}if(e.external){const c=e.external.registry.get(a[0])?.id;if(t!==a[0]&&c){i(a);continue}}if(e.metadataRegistry.get(a[0])?.id){i(a);continue}if(o.cycle){i(a);continue}o.count>1&&e.reused==="ref"&&i(a)}e.external&&(e.sharedDefsExtractedFor=e.external)}function j1(e){const t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;const n=[];for(const r of t){if(!r||typeof r!="object")return;j1(r);const s=Object.keys(r);if(s.length!==1||s[0]!=="type")return;const i=r.type;for(const a of Array.isArray(i)?i:[i]){if(typeof a!="string")return;n.includes(a)||n.push(a)}}delete e.anyOf,e.type=n.length===1?n[0]:n}const G1=new Set(["type","properties","required","additionalProperties"]),Ff=["oneOf","anyOf"];function Uf(e){const t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function Kc(e){const t=[];for(const i of e){if(typeof i!="object"||i.type!=="object")return null;for(const a in i)if(!G1.has(a))return null;t.push(i)}const n={},r=new Set;for(const i of t){for(const a in i.properties){if(Object.prototype.hasOwnProperty.call(n,a))continue;const o=[];for(const c of t){const u=c.properties?.[a]??Uf(c);u!=null&&(o.some(p=>JSON.stringify(p)===JSON.stringify(u))||o.push(u))}const l=o.length===1?o[0]:Kc(o)??{allOf:o};Pr(n,a,l)}for(const a of i.required??[])r.add(a)}const s={type:"object",properties:n};if(r.size&&(s.required=[...r]),t.every(i=>i.additionalProperties===!1))s.additionalProperties=!1;else{const i=[];for(const a of t){const o=Uf(a);o&&!i.some(l=>JSON.stringify(l)===JSON.stringify(o))&&i.push(o)}i.length===1?s.additionalProperties=i[0]:i.length>1&&(s.additionalProperties={allOf:i})}return s}function P_(e){const t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(const s of G1)if(s in e)return;const n=t.filter(s=>Ff.some(i=>Array.isArray(s[i])));let r=null;if(!n.length)r=Kc(t);else{const s=n[0],i=Ff.find(l=>Array.isArray(s[l]));if(Object.keys(s).length!==1)return;const a=t.filter(l=>l!==s),o=s[i].map(l=>Kc([...a,l]));if(o.some(l=>!l))return;r={[i]:o}}r&&(delete e.allOf,Gi(e,r))}function Z1(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=o=>{const l=e.seen.get(o);if(l.ref===null)return;const c=l.def??l.schema,u={...c},p=l.ref;if(l.ref=null,p){r(p);const f=e.seen.get(p),y=f.schema;if(y.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(y)):Gi(c,y),Gi(c,u),o._zod.parent===p)for(const x in c)x==="$ref"||x==="allOf"||x in u||delete c[x];if(y.$ref&&f.def)for(const x in c)x==="$ref"||x==="allOf"||x in f.def&&JSON.stringify(c[x])===JSON.stringify(f.def[x])&&delete c[x]}const m=o._zod.parent;if(m&&m!==p){r(m);const f=e.seen.get(m);if(f?.schema.$ref&&(c.$ref=f.schema.$ref,f.def))for(const y in c)y==="$ref"||y==="allOf"||y in f.def&&JSON.stringify(c[y])===JSON.stringify(f.def[y])&&delete c[y]}e.override({zodSchema:o,jsonSchema:c,path:l.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(const o of[...e.seen.entries()].reverse())r(o[0]);if(e.target!=="openapi-3.0")for(const o of e.seen.entries())j1(o[1].def??o[1].schema);for(const o of e.deferred)o();if(e.intersections.length){const o=new Map;for(const l of e.seen.values())for(const c of[l.schema,l.def]){const u=c?.allOf;if(!Array.isArray(u))continue;const p=o.get(u);p?p.push(c):o.set(u,[c])}for(const l of e.intersections)for(const c of o.get(l)??[])P_(c)}}const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const o=e.external.registry.get(t)?.id;if(!o)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(o)}Gi(s,n.defId?n.schema:n.def??n.schema);const i=e.metadataRegistry.get(t)?.id;i!==void 0&&s.id===i&&delete s.id;const a=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(const o of e.seen.entries()){const l=o[1];l.def&&l.defId&&(l.def.id===l.defId&&delete l.def.id,Pr(a,l.defId,l.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?s.$defs=a:s.definitions=a);try{const o=JSON.parse(JSON.stringify(s));return Object.defineProperty(o,"~standard",{value:{...t["~standard"],jsonSchema:{input:Ao(t,"input",e.processors),output:Ao(t,"output",e.processors)}},enumerable:!1,writable:!1}),o}catch{throw new Error("Error converting schema to JSON.")}}function dn(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return dn(r.element,n);if(r.type==="set")return dn(r.valueType,n);if(r.type==="lazy")return dn(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault"||r.type==="catch")return dn(r.innerType,n);if(r.type==="intersection")return dn(r.left,n)||dn(r.right,n);if(r.type==="record"||r.type==="map")return dn(r.keyType,n)||dn(r.valueType,n);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:dn(r.in,n)||dn(r.out,n);if(r.type==="object"){for(const s in r.shape)if(dn(r.shape[s],n))return!0;return!1}if(r.type==="union"){for(const s of r.options)if(dn(s,n))return!0;return!1}if(r.type==="tuple"){for(const s of r.items)if(dn(s,n))return!0;return!!(r.rest&&dn(r.rest,n))}return!1}const B_=(e,t={})=>n=>{const r=H1({...n,processors:t});return Kt(e,r),V1(r,e),Z1(r,e)},Ao=(e,t,n={})=>r=>{const{libraryOptions:s,target:i}=r??{},a=H1({...s??{},target:i,io:t,processors:n});return Kt(e,a),V1(a,e),Z1(a,e)},oi=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},li=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},qf=(e,t)=>{oi(e,"minimum",t),li(e,"maximum",t)},K1=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},W1=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},Q1=(e,t)=>{e.mime=e.mime?e.mime.filter(n=>t.includes(n)):[...t]},J1=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},Hf=(e,t)=>oi(e,"minimum",t.minimum),Vf=(e,t)=>li(e,"maximum",t.maximum),jf=e=>(t,n)=>{J1(t,n.format);const[r,s]=e[n.format];oi(t,"minimum",r),li(t,"maximum",s)},L_={greater_than:(e,t)=>oi(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>li(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>K1(e,t.value),number_format:jf(v1),bigint_format:jf(eS),min_length:Hf,max_length:Vf,length_equals:(e,t)=>qf(e,t.length),min_size:Hf,max_size:Vf,size_equals:(e,t)=>qf(e,t.size),string_format:(e,t)=>{J1(e,t.format),t.pattern&&W1(e,t.pattern),(t.format==="base64"||t.format==="base64url")&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>Q1(e,t.mime)};function Gn(e){const t={},n=e._zod.def,r=e._zod.traits.has("$ZodCheck")?[e,...n.checks??[]]:n.checks??[];for(const i of r)L_[i._zod.def.check]?.(t,i._zod.def);const s=e._zod.bag;s.minimum!==void 0&&oi(t,"minimum",s.minimum),s.exclusiveMinimum!==void 0&&oi(t,"exclusiveMinimum",s.exclusiveMinimum),s.maximum!==void 0&&li(t,"maximum",s.maximum),s.exclusiveMaximum!==void 0&&li(t,"exclusiveMaximum",s.exclusiveMaximum),s.multipleOf!==void 0&&K1(t,s.multipleOf),s.format!==void 0&&(t.format??(t.format=s.format),s.format.includes("int")&&(t.isInt=!0)),s.mime&&Q1(t,s.mime);for(const i of s.patterns??[])W1(t,i);return t}const F_={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},U_=new Map([[M1,tx],[su,nx]]),Y1=e=>U_.get(e)??e,q_=(e,t,n,r)=>{const s=n;s.type="string";const{minimum:i,maximum:a,format:o,patterns:l,contentEncoding:c,laxFormat:u}=Gn(e);if(typeof i=="number"&&(s.minLength=i),typeof a=="number"&&(s.maxLength=a),o&&(s.format=F_[o]??o,s.format===""&&delete s.format,(o==="time"||u)&&delete s.format),c&&(s.contentEncoding=c),l&&l.size>0){const p=[...l].map(Y1);p.length===1?s.pattern=p[0].source:p.length>1&&(s.allOf=[...p.map(m=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},H_=(e,t,n,r)=>{const s=n,{minimum:i,maximum:a,multipleOf:o,exclusiveMaximum:l,exclusiveMinimum:c,isInt:u}=Gn(e);s.type=u?"integer":"number";const p=typeof c=="number"&&c>=(i??Number.NEGATIVE_INFINITY),m=typeof l=="number"&&l<=(a??Number.POSITIVE_INFINITY),f=t.target==="draft-04"||t.target==="openapi-3.0";if(p?f?(s.minimum=c,s.exclusiveMinimum=!0):s.exclusiveMinimum=c:typeof i=="number"&&(s.minimum=i),m?f?(s.maximum=l,s.exclusiveMaximum=!0):s.exclusiveMaximum=l:typeof a=="number"&&(s.maximum=a),o){const y=new Set;for(const S of o)Number.isFinite(S)&&S!==0?y.add(Math.abs(S)):ds(e,t,s,r,`A multipleOf divisor of ${S} cannot be represented in JSON Schema`);const[b,...x]=y;b!==void 0&&(s.multipleOf=b),x.length&&(s.allOf=[...s.allOf??[],...x.map(S=>({multipleOf:S}))])}},V_=(e,t,n,r)=>{n.type="boolean"},j_=(e,t,n,r)=>{n.not={}},G_=(e,t,n,r)=>{},Z_=(e,t,n,r)=>{const s=e._zod.def,i=qc(s.entries);if(i.length===0){n.not={};return}i.every(a=>typeof a=="number")&&(n.type="number"),i.every(a=>typeof a=="string")&&(n.type="string"),n.enum=i},K_=(e,t,n,r)=>{const s=e._zod.def;if(s.values.length===0){n.not={};return}const i=[];for(const a of s.values)if(a===void 0){if(ds(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof a=="bigint"){if(ds(e,t,n,r,"BigInt literals cannot be represented in JSON Schema"))return;i.push(Number(a))}else i.push(a);if(i.length!==0)if(i.length===1){const a=i[0];n.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[a]:n.const=a}else i.every(a=>typeof a=="number")&&(n.type="number"),i.every(a=>typeof a=="string")&&(n.type="string"),i.every(a=>typeof a=="boolean")&&(n.type="boolean"),i.every(a=>a===null)&&(n.type="null"),n.enum=i},W_=(e,t,n,r)=>{ds(e,t,n,r,"Custom types cannot be represented in JSON Schema")},Q_=(e,t,n,r)=>{ds(e,t,n,r,"Transforms cannot be represented in JSON Schema")},J_=(e,t,n,r)=>{const s=n,i=e._zod.def,{minimum:a,maximum:o}=Gn(e);typeof a=="number"&&(s.minItems=a),typeof o=="number"&&(s.maxItems=o),s.type="array",s.items=Kt(i.element,t,{...r,path:[...r.path,"items"]})};function To(e){const t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?To(t.out):t.type==="catch"?To(t.innerType):e._zod.optin}const Y_=(e,t,n,r)=>{const s=n,i=e._zod.def,a=i.shape;if(Object.getOwnPropertySymbols(a).length&&ds(e,t,s,r,"Symbol keys cannot be represented in JSON Schema"))return;s.type="object",s.properties={};for(const c in a)Pr(s.properties,c,Kt(a[c],t,{...r,path:[...r.path,"properties",c]}));const l=[];for(const c of Object.keys(a)){const u=i.shape[c];(t.io==="input"?To(u)===void 0:u._zod.optout===void 0)&&l.push(c)}l.length>0&&(s.required=l),i.catchall?._zod.def.type==="never"?s.additionalProperties=!1:i.catchall?i.catchall&&(s.additionalProperties=Kt(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},X_=(e,t,n,r)=>{const s=e._zod.def,i=s.inclusive===!1,a=s.options.map((o,l)=>Kt(o,t,{...r,path:[...r.path,i?"oneOf":"anyOf",l]}));i?n.oneOf=a:n.anyOf=a},eE=(e,t,n,r)=>{const s=e._zod.def,i=Kt(s.left,t,{...r,path:[...r.path,"allOf",0]}),a=Kt(s.right,t,{...r,path:[...r.path,"allOf",1]}),o=c=>"allOf"in c&&Object.keys(c).length===1,l=[...o(i)?i.allOf:[i],...o(a)?a.allOf:[a]];n.allOf=l,t.intersections.push(l)};function Wc(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);const y=e.get(t)?.def;if(!y)return t;const b=Wc(e,y,n);return b===y?t:b}for(const y of["anyOf","oneOf"]){const b=t[y];if(!Array.isArray(b))continue;const x=b.map(S=>Wc(e,S,n));x.some((S,N)=>S!==b[N])&&(t={...t,[y]:x})}const r=Array.isArray(t.type)?t.type:[t.type],s=!r.includes("string")&&r.some(y=>y==="number"||y==="integer"),i=t.enum??(t.const!==void 0?[t.const]:void 0);if(!s&&!i?.some(y=>typeof y=="number"))return t;const{minimum:a,maximum:o,exclusiveMinimum:l,exclusiveMaximum:c,multipleOf:u,format:p,id:m,...f}=t;return f.enum?f.enum=f.enum.map(y=>typeof y=="number"?String(y):y):typeof f.const=="number"&&(f.const=String(f.const)),s&&(f.type="string",i||(f.pattern=(r.includes("number")?tu:ux).source)),f}const Qc=new WeakMap;function tE(e){const t=new Map;for(const r of e.seen.values())r.def&&!t.has(r.schema)&&t.set(r.schema,r);const n=new Map;for(const r of Qc.get(e)??[]){const s=e.seen.get(r),i=(s?.def??s?.schema)?.propertyNames;if(!i||i===!0||n.has(i))continue;const a=Wc(t,i,new Set);a!==i&&n.set(i,a)}if(n.size)for(const r of e.seen.values())for(const s of[r.schema,r.def]){const i=s&&n.get(s.propertyNames);i&&(s.propertyNames=i)}}const nE=(e,t,n,r)=>{const s=n,i=e._zod.def;s.type="object";const a=i.keyType,o=Gn(a).patterns;if(i.mode==="loose"&&o&&o.size>0){const u=Kt(i.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});s.patternProperties={};for(const p of o)Pr(s.patternProperties,Y1(p).source,u)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){s.propertyNames=Kt(i.keyType,t,{...r,path:[...r.path,"propertyNames"]});let u=Qc.get(t);u||(u=[],Qc.set(t,u),t.deferred.push(()=>tE(t))),u.push(e)}s.additionalProperties=Kt(i.valueType,t,{...r,path:[...r.path,"additionalProperties"]})}const l=a._zod.values,c=t.io==="input"&&To(i.valueType)!==void 0;if(l&&!i.partial&&!c){const u=[...l].filter(p=>typeof p=="string"||typeof p=="number");u.length>0&&(s.required=u.map(String))}},rE=(e,t,n,r)=>{const s=e._zod.def,i=Kt(s.innerType,t,r),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=s.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]},sE=(e,t,n,r)=>{const s=e._zod.def;Kt(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType},au=Symbol();function X1(e,t,n,r,s){let i=!1;const a=JSON.stringify(e,(o,l)=>typeof l!="bigint"?l:(i=!0,null));return i?(ds(t,n,r,s,"BigInt defaults cannot be represented in JSON Schema"),au):JSON.parse(a)}const iE=(e,t,n,r)=>{const s=e._zod.def;Kt(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType;const a=X1(s.defaultValue,e,t,n,r);a!==au&&(n.default=a)},aE=(e,t,n,r)=>{const s=e._zod.def;Kt(s.innerType,t,r);const i=t.seen.get(e);if(i.ref=s.innerType,t.io!=="input")return;const a=X1(s.defaultValue,e,t,n,r);a!==au&&(n._prefault=a)},oE=(e,t,n,r)=>{const s=e._zod.def;Kt(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType;let a;try{a=s.catchValue(void 0)}catch{ds(e,t,n,r,"Dynamic catch values are not supported in JSON Schema");return}n.default=a},lE=(e,t,n,r)=>{const s=e._zod.def,i=s.in._zod.traits.has("$ZodTransform"),a=t.io==="input"?i?s.out:s.in:s.out;Kt(a,t,r);const o=t.seen.get(e);o.ref=a},cE=(e,t,n,r)=>{const s=e._zod.def;Kt(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType,n.readOnly=!0},eg=(e,t,n,r)=>{const s=e._zod.def;Kt(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType},Gf=new WeakSet([Object.prototype,Error.prototype]);function Va(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){const r=n(this);return Object.defineProperty(this,t,{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,t,{value:r,configurable:!0,writable:!0})}})}const uE=(e,t)=>{xS.init(e,t),e.name="ZodError";const n=Object.getPrototypeOf(e);Gf.has(n)||(Gf.add(n),Va(n,"format",r=>s=>ES(r,s)),Va(n,"flatten",r=>s=>_S(r,s)),Va(n,"addIssue",r=>s=>{r.issues.push(s),r.message=JSON.stringify(r.issues,Hc,2)}),Va(n,"addIssues",r=>s=>{r.issues.push(...s),r.message=JSON.stringify(r.issues,Hc,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},qn=J("ZodError",uE,void 0,{Parent:Error}),dE=J0(qn),fE=Y0(qn),hE=X0(qn),pE=eu(qn),mE=OS(qn),gE=MS(qn),vE=NS(qn),bE=zS(qn),yE=$S(qn),wE=DS(qn),SE=PS(qn),xE=BS(qn);function kE(){Zn.localeError||dr(Fk())}function tl(){Zn.memoizer||dr({memoizer:Pk()})}const Dt=J("ZodType",(e,t)=>(kE(),$t.init(e,t),e.def=t,e.type=t.type,e),{check(...e){const t=this.def;return this.clone(In(t,{checks:[...t.checks??[],...e.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return gs(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(bA(e,t))},superRefine(e,t){return this.check(yA(e,t))},overwrite(e){return this.check(gi(e))},optional(){return Wf(this)},exactOptional(){return iA(this)},nullable(){return Qf(this)},nullish(){return Wf(Qf(this))},nonoptional(e){return dA(this,e)},array(){return Be(this)},or(e){return vi([this,e])},and(e){return nA(this,e)},transform(e){return Jf(this,rg(e))},default(e){return lA(this,e)},prefault(e){return uA(this,e)},catch(e){return hA(this,e)},pipe(e){return Jf(this,e)},readonly(){return gA(this)},describe(e){const t=this.clone();return Pi.add(t,{description:e}),t},meta(...e){if(e.length===0)return Pi.get(this);const t=this.clone();return Pi.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return y1(this,"~standard",{...T1(this),jsonSchema:{input:Ao(this,"input"),output:Ao(this,"output")}})},set"~standard"(e){us(this,"~standard",e)},parse:function e(t,n){return dE(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await fE(this,t,n,{callee:e})},safeParse(e,t){return hE(this,e,t)},async safeParseAsync(e,t){return pE(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){us(this,"spa",e)},validate(e,t){return IS(this,e,t)},validateAsync(e,t){return CS(this,e,t)},encode:function e(t,n){return mE(this,t,n,{callee:e})},decode:function e(t,n){return gE(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await vE(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await bE(this,t,n,{callee:e})},safeEncode(e,t){return yE(this,e,t)},safeDecode(e,t){return wE(this,e,t)},async safeEncodeAsync(e,t){return SE(this,e,t)},async safeDecodeAsync(e,t){return xE(this,e,t)},toJSONSchema(e){return B_(this,{})(e)},get description(){return Pi.get(this)?.description},get _def(){return this._zod.def}}),tg=J("_ZodString",(e,t)=>{ru.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>q_(e,n,r)},w1({format:e=>Gn(e).format??null,minLength:e=>Gn(e).minimum??null,maxLength:e=>Gn(e).maximum??null},{regex(...e){return this.check(x_(...e))},includes(...e){return this.check(E_(...e))},startsWith(...e){return this.check(A_(...e))},endsWith(...e){return this.check(T_(...e))},min(...e){return this.check(Eo(...e))},max(...e){return this.check(U1(...e))},length(...e){return this.check(q1(...e))},nonempty(...e){return this.check(Eo(1,...e))},lowercase(e){return this.check(k_(e))},uppercase(e){return this.check(__(e))},trim(){return this.check(R_())},normalize(...e){return this.check(I_(...e))},toLowerCase(){return this.check(C_())},toUpperCase(){return this.check(O_())},slugify(){return this.check(M_())}})),_E=J("ZodString",(e,t)=>{ru.init(e,t),tg.init(e,t)},{email(e){return this.check(Vk(RE,e))},url(e){return this.check(Qk(OE,e))},jwt(e){return this.check(d_(GE,e))},emoji(e){return this.check(Jk(ME,e))},guid(e){return this.check(jk(CE,e))},uuid(e){return this.check(Gk(ja,e))},uuidv4(e){return this.check(Zk(ja,e))},uuidv6(e){return this.check(Kk(ja,e))},uuidv7(e){return this.check(Wk(ja,e))},nanoid(e){return this.check(Yk(NE,e))},cuid(e){return this.check(Xk(zE,e))},cuid2(e){return this.check(e_($E,e))},ulid(e){return this.check(t_(DE,e))},base64(e){return this.check(l_(HE,e))},base64url(e){return this.check(c_(VE,e))},xid(e){return this.check(n_(PE,e))},ksuid(e){return this.check(r_(BE,e))},ipv4(e){return this.check(s_(LE,e))},ipv6(e){return this.check(i_(FE,e))},cidrv4(e){return this.check(a_(UE,e))},cidrv6(e){return this.check(o_(qE,e))},e164(e){return this.check(u_(jE,e))},datetime(e){return this.check(f_(EE,e))},date(e){return this.check(h_(AE,e))},time(e){return this.check(p_(TE,e))},duration(e){return this.check(m_(IE,e))}});function me(e){return Hk(_E,e)}const Pt=J("ZodStringFormat",(e,t)=>{Ot.init(e,t),tg.init(e,t)}),EE=J("ZodISODateTime",(e,t)=>{jx.init(e,t),Pt.init(e,t)}),AE=J("ZodISODate",(e,t)=>{Gx.init(e,t),Pt.init(e,t)}),TE=J("ZodISOTime",(e,t)=>{Zx.init(e,t),Pt.init(e,t)}),IE=J("ZodISODuration",(e,t)=>{Kx.init(e,t),Pt.init(e,t)}),RE=J("ZodEmail",(e,t)=>{Ox.init(e,t),Pt.init(e,t)}),CE=J("ZodGUID",(e,t)=>{Rx.init(e,t),Pt.init(e,t)}),ja=J("ZodUUID",(e,t)=>{Cx.init(e,t),Pt.init(e,t)}),OE=J("ZodURL",(e,t)=>{Px.init(e,t),Pt.init(e,t)}),ME=J("ZodEmoji",(e,t)=>{Bx.init(e,t),Pt.init(e,t)}),NE=J("ZodNanoID",(e,t)=>{Lx.init(e,t),Pt.init(e,t)}),zE=J("ZodCUID",(e,t)=>{Fx.init(e,t),Pt.init(e,t)}),$E=J("ZodCUID2",(e,t)=>{Ux.init(e,t),Pt.init(e,t)}),DE=J("ZodULID",(e,t)=>{qx.init(e,t),Pt.init(e,t)}),PE=J("ZodXID",(e,t)=>{Hx.init(e,t),Pt.init(e,t)}),BE=J("ZodKSUID",(e,t)=>{Vx.init(e,t),Pt.init(e,t)}),LE=J("ZodIPv4",(e,t)=>{Wx.init(e,t),Pt.init(e,t)}),FE=J("ZodIPv6",(e,t)=>{Jx.init(e,t),Pt.init(e,t)}),UE=J("ZodCIDRv4",(e,t)=>{Yx.init(e,t),Pt.init(e,t)}),qE=J("ZodCIDRv6",(e,t)=>{ek.init(e,t),Pt.init(e,t)}),HE=J("ZodBase64",(e,t)=>{tk.init(e,t),Pt.init(e,t)}),VE=J("ZodBase64URL",(e,t)=>{rk.init(e,t),Pt.init(e,t)}),jE=J("ZodE164",(e,t)=>{sk.init(e,t),Pt.init(e,t)}),GE=J("ZodJWT",(e,t)=>{ak.init(e,t),Pt.init(e,t)}),ou=J("ZodNumber",(e,t)=>{N1.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>H_(e,n,r,s),e.isFinite=!0},w1({minValue:e=>{const{minimum:t,exclusiveMinimum:n}=Gn(e);return Math.max(t??Number.NEGATIVE_INFINITY,n??Number.NEGATIVE_INFINITY)},maxValue:e=>{const{maximum:t,exclusiveMaximum:n}=Gn(e);return Math.min(t??Number.POSITIVE_INFINITY,n??Number.POSITIVE_INFINITY)},isInt:e=>{const{isInt:t,multipleOf:n}=Gn(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>Gn(e).format??null},{gt(e,t){return this.check(Pf(e,t))},gte(e,t){return this.check(Ql(e,t))},min(e,t){return this.check(Ql(e,t))},lt(e,t){return this.check(Df(e,t))},lte(e,t){return this.check(Wl(e,t))},max(e,t){return this.check(Wl(e,t))},int(e){return this.check(Zf(e))},safe(e){return this.check(Zf(e))},positive(e){return this.check(Pf(0,e))},nonnegative(e){return this.check(Ql(0,e))},negative(e){return this.check(Df(0,e))},nonpositive(e){return this.check(Wl(0,e))},multipleOf(e,t){return this.check(Bf(e,t))},step(e,t){return this.check(Bf(e,t))},finite(){return this}}));function ye(e){return g_(ou,e)}const ZE=J("ZodNumberFormat",(e,t)=>{ok.init(e,t),ou.init(e,t)});function Zf(e){return b_(ZE,e)}const KE=J("ZodBoolean",(e,t)=>{lk.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>V_(e,n,r)});function Nt(e){return y_(KE,e)}const WE=J("ZodUnknown",(e,t)=>{ck.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>G_()});function fs(){return w_(WE)}const QE=J("ZodNever",(e,t)=>{uk.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>j_(e,n,r)});function JE(e){return S_(QE,e)}const YE=J("ZodArray",(e,t)=>{tl(),hk.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>J_(e,n,r,s),e.element=t.element},{min(e,t){return this.check(Eo(e,t))},nonempty(e){return this.check(Eo(1,e))},max(e,t){return this.check(U1(e,t))},length(e,t){return this.check(q1(e,t))},unwrap(){return this.element}});function Be(e,t){return N_(YE,e,t)}const XE=J("ZodObject",(e,t)=>{tl(),gk.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>Y_(e,n,r,s),pS(e,"shape",n=>n._zod.def.shape,!1)},{keyof(){return Ke(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(In(this._zod.def,{catchall:e}))},passthrough(){return this.clone(In(this._zod.def,{catchall:fs()}))},loose(){return this.clone(In(this._zod.def,{catchall:fs()}))},strict(){return this.clone(In(this._zod.def,{catchall:JE()}))},strip(){return this.clone(In(this._zod.def,{catchall:void 0}))},extend(e){return rS(this,e)},safeExtend(e){return sS(this,e)},merge(e){return iS(this,e)},pick(e){return tS(this,e)},omit(e){return nS(this,e)},partial(...e){return bf(sg,this,e[0])},exactPartial(...e){return bf(ig,this,e[0],"exactPartial")},required(...e){return aS(ag,this,e[0])}});function Z(e,t){const n={type:"object",shape:e??{},...Ne(t)};return new XE(n)}const ng=J("ZodUnion",(e,t)=>{D1.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>X_(e,n,r,s),e.options=t.options});function vi(e,t){return new ng({type:"union",options:e,...Ne(t)})}const eA=J("ZodDiscriminatedUnion",(e,t)=>{ng.init(e,t),bk.init(e,t)});function xn(e,t,n){return new eA({type:"union",options:t,discriminator:e,...Ne(n)})}const tA=J("ZodIntersection",(e,t)=>{yk.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>eE(e,n,r,s)});function nA(e,t){return new tA({type:"intersection",left:e,right:t})}const Kf=J("ZodRecord",(e,t)=>{tl(),wk.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>nE(e,n,r,s),e.keyType=t.keyType,e.valueType=t.valueType});function lu(e,t,n){return!t||!t._zod?new Kf({type:"record",keyType:me(),valueType:e,...Ne(t)}):new Kf({type:"record",keyType:e,valueType:t,...Ne(n)})}const Jc=J("ZodEnum",(e,t)=>{Sk.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(r,s,i)=>Z_(e,r,s),e.enum=t.entries,e.options=[...e._zod.values];const n=new Set(Object.keys(t.entries));e.extract=(r,s)=>{const i={};for(const a of r)if(n.has(a))i[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new Jc({...t,checks:[],...Ne(s),entries:i})},e.exclude=(r,s)=>{const i={...t.entries};for(const a of r)if(n.has(a))delete i[a];else throw new Error(`Key ${a} not found in enum`);return new Jc({...t,checks:[],...Ne(s),entries:i})}});function Ke(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Jc({type:"enum",entries:n,...Ne(t)})}const rA=J("ZodLiteral",(e,t)=>{xk.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>K_(e,n,r,s),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Ue(e,t){return new rA({type:"literal",values:Array.isArray(e)?e:[e],...Ne(t)})}const sA=J("ZodTransform",(e,t)=>{tl(),kk.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>Q_(e,n,r,s),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new S1(e.constructor.name);n.addIssue=i=>{if(typeof i=="string")n.issues.push(ia(i,n.value,t));else{const a=i;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),"input"in a||(a.input=n.value),a.inst??(a.inst=e),n.issues.push(ia(a))}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(i=>(n.value=i,n)):(n.value=s,n)}});function rg(e){return new sA({type:"transform",transform:e})}const sg=J("ZodOptional",(e,t)=>{P1.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>eg(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function Wf(e){return new sg({type:"optional",innerType:e})}const ig=J("ZodExactOptional",(e,t)=>{_k.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>eg(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function iA(e){return new ig({type:"optional",innerType:e})}const aA=J("ZodNullable",(e,t)=>{Ek.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>rE(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function Qf(e){return new aA({type:"nullable",innerType:e})}const oA=J("ZodDefault",(e,t)=>{Ak.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>iE(e,n,r,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function lA(e,t){return new oA({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():m1(t)}})}const cA=J("ZodPrefault",(e,t)=>{Tk.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>aE(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function uA(e,t){return new cA({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():m1(t)}})}const ag=J("ZodNonOptional",(e,t)=>{Ik.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>sE(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function dA(e,t){return new ag({type:"nonoptional",innerType:e,...Ne(t)})}const fA=J("ZodCatch",(e,t)=>{Rk.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>oE(e,n,r,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function hA(e,t){return new fA({type:"catch",innerType:e,catchValue:typeof t=="function"?t:gS(t)})}const og=J("ZodPipe",(e,t)=>{B1.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>lE(e,n,r,s),e.in=t.in,e.out=t.out});function Jf(e,t){return new og({type:"pipe",in:e,out:t})}const pA=J("ZodPreprocess",(e,t)=>{og.init(e,t),Ck.init(e,t)}),mA=J("ZodReadonly",(e,t)=>{Ok.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>cE(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function gA(e){return new mA({type:"readonly",innerType:e})}const vA=J("ZodCustom",(e,t)=>{Mk.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>W_(e,n,r,s)});function bA(e,t={}){return z_(vA,e,t)}function yA(e,t){return $_(e,t)}function wA(e,t){return new pA({type:"pipe",in:rg(e),out:t})}const aa={custom:"custom"};function lg(e){return v_(ou,e)}const Me=me().trim(),H=Me.min(1),ut=me().datetime(),SA=160,Br=me().trim().min(1).max(SA),xA=Br.optional(),Fs=me().trim().min(1).max(120),bi=6,kA=20,cg=100,nl=20*1024*1024,_A=500*1024,Yf=40*1024*1024,ns={Snapshot:"ai-session.snapshot",Patch:"ai-session.patch",Removed:"ai-session.removed"},rl=H.max(80),yi=Ke(["app-session","ai-session"]),oa=Ke(["image","file"]),ug={scopeType:Ke(["session","create-request"]),scopeId:H.max(160),kind:oa,name:H.max(240),mime:H.max(120)};Z({...ug,size:lg().int().positive().max(nl)}).strict();const cu=me().regex(/^cia_[a-f0-9]{24}$/);Z({attachmentId:cu,...ug,size:ye().int().positive().max(nl)}).strict();Z({offset:lg().int().nonnegative()}).strict();Z({attachmentId:cu,offset:ye().int().nonnegative()});Z({id:cu,kind:oa,name:H.max(240),mime:H.max(120),size:ye().int().positive().max(nl),expiresAt:ut});const Io=Z({id:H.max(120),kind:oa,name:H.max(240),mime:H.max(120),size:ye().int().min(0).max(Number.MAX_SAFE_INTEGER)}),EA=Ke(["available","expired","missing"]),dg=Io.extend({contentState:EA.default("available")}).strict(),uu=Ke(["running","waiting","idle","failed"]),sl=Ke(["thinking","tool","editing","approval","responding","unknown"]),du=Z({id:H.max(240).optional(),kind:H.max(80).optional(),name:H.max(120),inputPreview:Me.max(500).optional(),startedAt:ut.optional()}).strict(),AA=Ke(["running","completed","failed","waiting"]),fu=Z({id:H.max(240),turnId:H.max(240)}).strict(),TA=fu.extend({type:Ue("user-message"),text:me(),attachments:Be(dg).max(bi).optional()}).strict(),IA=fu.extend({type:Ue("ai-message"),text:me()}).strict(),fg=fu.extend({type:Ue("activity"),activityKind:H.max(120),title:H.max(240),status:AA.optional(),summary:me().max(4e3).optional(),input:me().max(1e5).optional(),output:me().max(1e6).optional(),paths:Be(H.max(4096)).max(500).optional(),exitCode:ye().int().optional(),durationMs:ye().int().nonnegative().optional()}).strict(),il=xn("type",[TA,IA,fg]),RA=Z({sessionId:H.max(120),providerSessionId:H.max(240),items:Be(il),generatedAt:ut}).strict(),CA=Z({sessionId:H.max(120),turnId:H.max(240),items:Be(il),generatedAt:ut}).strict(),OA=50;Z({sessionId:H.max(120),turnId:H.max(240),revision:H.max(64),boundaryItemId:H.max(240).optional(),items:Be(fg).max(OA),total:ye().int().min(0),truncated:Nt(),generatedAt:ut}).strict();const MA=Ke(["pending-init","running","interrupted","completed","errored","shutdown","not-found"]),NA=Ke(["started","interacted","interrupted"]),zA=Z({threadId:H.max(240),path:Me.max(4096).optional(),status:MA,activity:NA.optional(),message:Me.max(1e3).optional(),updatedAt:ut}).strict();function $A(e){return e.status!=="completed"}const hu=Be(zA).max(50).transform(e=>e.filter($A)),DA=Z({toolCalls:ye().int().min(0).default(0),edits:ye().int().min(0).default(0),approvals:ye().int().min(0).default(0)}).strict().default({toolCalls:0,edits:0,approvals:0}),PA=Ke(["active","paused","blocked","usageLimited","budgetLimited","complete"]),pu=Z({objective:H.max(4e3),status:PA,tokenBudget:ye().int().positive().max(Number.MAX_SAFE_INTEGER).nullable(),tokensUsed:ye().int().min(0).max(Number.MAX_SAFE_INTEGER),timeUsedSeconds:ye().int().min(0).max(Number.MAX_SAFE_INTEGER)}).strict(),hg=Ke(["allow","deny","skip"]),pg=Z({id:H.max(120),decisions:Be(hg).min(1).max(3)}),mg=Z({send:Nt().optional(),interrupt:Nt().optional(),approval:Nt().optional(),approvalRequest:pg.optional(),fork:Nt().optional(),rename:Nt().optional(),openApp:Nt().optional(),close:Nt().optional()}),Xf=H.max(240),Ro=xn("kind",[Z({kind:Ue("fork"),parentProviderSessionId:Xf,throughTurnId:H.max(240).optional()}).strict(),Z({kind:Ue("subagent"),parentProviderSessionId:Xf}).strict()]);function BA(e){if(!e||typeof e!="object"||Array.isArray(e))return;const t=e;if(t.kind==="fork"){const n=Ro.safeParse({kind:"fork",parentProviderSessionId:t.parentProviderSessionId,...typeof t.throughTurnId=="string"?{throughTurnId:t.throughTurnId}:{}});return n.success?n.data:void 0}if(t.kind==="subagent"){const n=Ro.safeParse({kind:"subagent",parentProviderSessionId:t.parentProviderSessionId});return n.success?n.data:void 0}}const gg=wA(BA,Ro.optional()),LA=vi([Io.extend({source:Z({type:Ue("inline"),encoding:Ue("base64"),data:me().min(1).max(30*1024*1024)}).strict()}).strict().superRefine((e,t)=>{const n=e.kind==="image"?nl:_A;(e.size<=0||(e.kind==="file"?e.size>=n:e.size>n))&&t.addIssue({code:aa.custom,path:["size"],message:`Inline ${e.kind} must be between 1 byte and ${n} bytes.`})}),Io.extend({source:Z({type:Ue("runtime-path"),path:H.max(4096)}).strict()}).strict()]),FA=Io.extend({sourceType:Ke(["inline","runtime-path"])}).strict(),vg=vi([Z({id:H.max(120),kind:oa.optional(),source:Z({type:Ue("upload-ref")}).strict().default({type:"upload-ref"})}).strict(),Z({id:H.max(120),kind:oa,name:H.max(240),mime:H.max(120),size:ye().int().min(0).max(Number.MAX_SAFE_INTEGER),source:Z({type:Ue("runtime-path"),path:H.max(4096)}).strict()}).strict()]),UA=Ke(["auto","queue","steer","immediate"]),bg=Ke(["ask","auto-review","full-access"]);function mu(e){return!!(e.message.trim()||e.attachments?.length||e.references?.length)}const yg=Ke(["review","rename","goal","compact"]);Z({command:yg,argument:Me.max(4e3).optional()}).strict().superRefine((e,t)=>{e.command==="rename"&&!e.argument&&t.addIssue({code:"custom",path:["argument"],message:"Rename requires a thread name."}),(e.command==="review"||e.command==="compact")&&e.argument&&t.addIssue({code:"custom",path:["argument"],message:`${e.command} does not accept an argument.`})});Z({command:yg,value:me().max(4e3).optional(),turnId:H.max(240).optional()}).strict();Z({title:Me.max(120),expectedTitle:Me.max(240).optional(),clientRequestId:Br}).strict();Z({disposition:Ke(["renamed","already-named"]),aiSessionId:H.max(120),appSessionId:H.max(120).optional(),title:Me.max(120)}).strict();Ke(["skill","app","plugin","file","directory"]);function wg(e){return!e||e.includes("\\")||e.includes("\0")||e.startsWith("/")||/^[A-Za-z]:/.test(e)?!1:e.split("/").every(t=>t!==""&&t!=="."&&t!=="..")}const eh=H.max(4096).refine(wg,"File and directory paths must be relative to the session cwd."),Oi=Z({name:H.max(240),path:H.max(4096)}),Sg=xn("kind",[Oi.extend({kind:Ue("skill"),path:H.max(4096).refine(e=>e.startsWith("/"),"Skill paths must be absolute.")}).strict(),Oi.extend({kind:Ue("app"),path:Me.min(7).max(4096).regex(/^app:\/\/[^\s/]+$/,"App paths must use app://<id>.")}).strict(),Oi.extend({kind:Ue("plugin"),path:Me.min(10).max(4096).regex(/^plugin:\/\/[^\s/]+$/,"Plugin paths must use plugin://<id>.")}).strict(),Oi.extend({kind:Ue("file"),path:eh}).strict(),Oi.extend({kind:Ue("directory"),path:eh}).strict()]),gu=Be(Sg).max(kA).default([]),qA=Z({start:ye().int().nonnegative(),end:ye().int().positive(),reference:Sg}).strict(),vu=Be(qA).max(cg);function th(e,t){const n=e.charCodeAt(t-1),r=e.charCodeAt(t);return n>=55296&&n<=56319&&r>=56320&&r<=57343}function xg(e,t){if(t.length>cg)return!1;let n=0;for(const{start:r,end:s}of t){if(!Number.isInteger(r)||!Number.isInteger(s)||r<n||s<=r||s>e.length||th(e,r)||th(e,s))return!1;const i=e.slice(r,s);if(!i.trim()||/[\r\n]/.test(i))return!1;n=s}return!0}function HA(e){const t=[],n=new Set;for(const{reference:r}of e){const s=`${r.kind}\0${r.path}`;n.has(s)||(n.add(s),t.push(r))}return t}function VA(e,t){const n=vu.safeParse(t);return n.success&&n.data.length&&xg(e,n.data)?n.data:void 0}const kg=Z({id:H.max(240),text:me(),attachments:Be(dg).max(bi).default([]),mentions:fs().optional()}).strict().transform(({mentions:e,...t})=>{const n=VA(t.text,e);return{...t,...n?{mentions:n}:{}}}),_g=(e,t)=>{if(!e.mentions?.length)return;const n=new Set(e.references.map(s=>`${s.kind}\0${s.path}`)),r=HA(e.mentions);(!xg(e.message,e.mentions)||r.length!==n.size||r.some(s=>!n.has(`${s.kind}\0${s.path}`)))&&t.addIssue({code:"custom",path:["mentions"],message:"Mention ranges must match the message and its references."})},jA=Ke(["plugin","skill","file","directory","app"]),GA=1e3,bu=Z({kind:jA,name:H.max(240),description:Me.max(GA).optional(),path:H.max(4096),icon:Me.max(4096).optional()}).strict().superRefine((e,t)=>{e.kind==="skill"&&!e.path.startsWith("/")&&t.addIssue({code:"custom",path:["path"],message:"Skill paths must be absolute."}),e.kind==="app"&&!/^app:\/\/[^\s/]+$/.test(e.path)&&t.addIssue({code:"custom",path:["path"],message:"App paths must use app://<id>."}),e.kind==="plugin"&&!/^plugin:\/\/[^\s/]+$/.test(e.path)&&t.addIssue({code:"custom",path:["path"],message:"Plugin paths must use plugin://<id>."}),(e.kind==="file"||e.kind==="directory")&&!wg(e.path)&&t.addIssue({code:"custom",path:["path"],message:"File and directory paths must be relative to the session cwd."})}),ZA=Z({category:Ke(["skills","plugins","apps","files"]),code:H.max(160),message:H.max(2e3)}).strict();Z({sessionId:H.max(120),providerSessionId:H.max(240),cwd:H.max(4096),candidates:Be(bu).max(1e3).default([]),diagnostics:Be(ZA).max(20).default([])}).strict();Z({query:Me.max(240).default("")}).strict();Z({sessionId:H.max(120),cwd:H.max(4096),query:Me.max(240),requestId:H.max(160),candidates:Be(bu.refine(e=>e.kind==="file"||e.kind==="directory","File search only returns files and directories.")).max(200).default([]),complete:Nt().default(!1)}).strict();Z({cwd:H.max(4096),query:Me.max(240),requestId:H.max(160),candidates:Be(bu.refine(e=>e.kind==="file"||e.kind==="directory","File search only returns files and directories.")).max(200).default([]),complete:Nt().default(!1)}).strict();const Eg=Z({message:Me.max(2e4),mentions:vu.optional(),mode:UA.optional(),permissionMode:bg.optional(),clientRequestId:xA}),KA=Eg.extend({attachments:Be(LA).max(bi).default([]),references:gu}).strict().superRefine((e,t)=>{_g(e,t),mu(e)||t.addIssue({code:aa.custom,path:["message"],message:"A message, attachment, or reference is required."}),e.attachments.reduce((r,s)=>r+(s.source.type==="inline"?s.size:0),0)>Yf&&t.addIssue({code:aa.custom,path:["attachments"],message:`Inline attachments must be ${Yf} bytes or less in total.`})}),WA=Eg.extend({attachments:Be(vg).max(bi).default([]),references:gu}).strict().superRefine((e,t)=>{_g(e,t),mu(e)||t.addIssue({code:aa.custom,path:["message"],message:"A message, attachment, or reference is required."})}),QA=Z({type:Ue("runtime-path"),path:H.max(4096).refine(e=>e.startsWith("/")||/^[A-Za-z]:[\\/]/.test(e),"Runtime paths must be absolute in the target controlled instance.")}).strict(),vs=Z({modelEntityId:H.max(120),modelName:H.max(240),modelUpstreamName:H.max(240).optional()}).strict(),Ag=["none","minimal","low","medium","high","xhigh","max","ultra"],bs=Ke(Ag);Ke(["session",...Ag]);const Tg=xn("type",[Z({type:Ue("current-folder"),branch:H.max(1024)}).strict(),Z({type:Ue("existing-worktree"),repositoryContextId:H.max(160),worktreeId:H.max(160)}).strict(),Z({type:Ue("new-worktree"),branchName:H.max(255),startRef:H.max(2048),expectedSnapshotId:H.max(160)}).strict()]),Ig=Z({mode:Ke(["current-folder","worktree"]),branch:H.max(1024)}).strict();KA.safeExtend({agent:rl,cwd:QA,cwdFolderId:H.max(120).optional(),gitSelection:Ig.optional(),workspaceSelection:Tg.optional(),clientRequestId:Br,modelSelection:vs.optional(),reasoningEffort:bs.optional(),storyId:Fs.optional()}).strict();WA.safeExtend({agent:rl,cwdFolderId:H.max(120).optional(),gitSelection:Ig.optional(),workspaceSelection:Tg.optional(),clientRequestId:Br,modelSelection:vs.optional(),reasoningEffort:bs.optional(),storyId:Fs.optional()}).strict();Z({clientRequestId:Br,modelSelection:vs}).strict();Z({sessionId:H.max(120),accepted:Ue(!0)}).strict();Z({clientRequestId:Br,reasoningEffort:bs}).strict();Z({cwdFolderId:H.max(120).optional(),branch:H.max(1024)}).strict();Z({sessionId:H.max(120),accepted:Ue(!0)}).strict();Z({storyId:Fs.nullable()}).strict();Z({sessionId:H.max(120),storyId:Fs.optional()}).strict();Z({sessionId:H.max(120),unread:Nt()}).strict();Z({path:H.max(4096),lineCount:ye().int().nonnegative(),tail:me()}).strict();Z({disposition:Ke(["created","already-created"]),aiSessionId:H.max(120),providerSessionId:H.max(240),creationSource:Ue("ai-session")}).strict();const JA=Z({mode:Ke(["current","managed-worktree"]).default("current")}).strict().default({mode:"current"});Z({clientRequestId:Br,throughTurnId:H.max(240).optional(),workspace:JA.optional().default({mode:"current"})}).strict();Z({disposition:Ke(["created","already-created"]),aiSessionId:H.max(120),providerSessionId:H.max(240),creationSource:Ue("ai-session")}).strict();Z({clientRequestId:Br}).strict();Z({disposition:Ke(["opened","already-open"]),aiSessionId:H.max(120),providerSessionId:H.max(240),appSessionId:H.max(120),creationSource:yi}).strict();Z({clientRequestId:Br}).strict();Z({disposition:Ke(["closed","already-closed"]),aiSessionId:H.max(120),providerSessionId:H.max(240),creationSource:yi}).strict();Z({disposition:Ke(["cleared","already-cleared"]),aiSessionId:H.max(120),clearedSessionIds:Be(H.max(120))}).strict();Z({code:Ke(["invalid-request","not-found","unsupported","provider-unavailable","materialization-failed","open-app-failed","close-failed","conflict"]),message:H.max(4e3),retryable:Nt().default(!1),aiSessionId:H.max(120).optional(),providerSessionId:H.max(240).optional()}).strict();Z({decision:hg,approvalRequestId:H.max(120).optional()}).strict();Z({expectedRevision:ye().int().min(0),queueIds:Be(H.max(120)).max(100)}).strict();Z({paused:Nt()}).strict();Z({expectedRevision:ye().int().min(0),message:Me.max(2e4),attachments:Be(vi([Z({id:H.max(120),source:Z({type:Ue("retained")}).strict()}).strict(),vg])).max(bi).optional()}).strict();Z({code:H.max(160),message:me(),instanceId:H.max(160).optional(),nodeId:H.max(160).optional(),route:H.max(4096).optional()}).strict();const YA=Z({id:H.max(120),messageId:H.max(240).optional(),message:Me.max(2e4),attachments:Be(FA).max(bi).default([]),references:gu,mentions:vu.optional(),permissionMode:bg.optional(),status:Ke(["queued","sending","failed"]).default("queued"),createdAt:ut,updatedAt:ut,error:Me.max(4e3).optional()}).strict().superRefine((e,t)=>{mu(e)||t.addIssue({code:aa.custom,path:["message"],message:"A message, attachment, or reference is required."})}),XA=Z({revision:ye().int().min(0).default(0),pendingCount:ye().int().min(0).default(0),paused:Nt().optional(),items:Be(YA).max(100).default([])}).strict().default({revision:0,pendingCount:0,items:[]}),Rg=Ke(["control","realtime","adapter-snapshot","transcript-tail","transcript-scan","process-scan","app-session"]),Cg=Z({id:H.max(240),status:Ke(["running","completed"]),startedAt:ut.optional(),completedAt:ut.optional()}).strict(),Lr=Z({id:H.max(240),providerTurnId:Me.max(240).optional(),source:Rg.optional(),userPrompt:Me.optional(),userMessages:Be(kg).max(100).optional(),status:Ke(["queued","running","waiting","completed","failed"]).default("running"),phase:sl.optional(),summary:Me.max(1e3).optional(),lastMessage:Me.optional(),lastMessageItemId:Me.max(240).optional(),contextCompactions:Be(Cg).max(20).optional(),revision:ye().int().min(0).default(0),sourcePriority:ye().int().min(0).max(100).optional(),snapshotVersion:ye().int().min(0).optional(),observedAt:ut.optional(),startedAt:ut.optional(),updatedAt:ut.optional(),completedAt:ut.optional()}).strict(),nh=160,eT=1e3,Og=Z({text:Me.min(1).refine(e=>!/[\r\n]/u.test(e),"Next input suggestion must be a single line").refine(e=>Array.from(e).length<=nh,`Next input suggestion must be at most ${nh} characters`),turnId:Lr.shape.id,generatedAt:ut}).strict(),Mg=Z({code:Me.max(120).optional(),message:H.max(eT),turnId:Lr.shape.id,generatedAt:ut}).strict(),tT=Lr.pick({id:!0,providerTurnId:!0,userPrompt:!0,userMessages:!0,status:!0,phase:!0,summary:!0,lastMessage:!0,contextCompactions:!0,startedAt:!0,updatedAt:!0,completedAt:!0}).strict(),yu=Z({id:H.max(120),agent:rl,creationSource:yi.default("app-session"),appSessionId:Me.max(120).optional(),appId:Me.max(120).optional(),providerSessionId:Me.max(240).optional(),lineage:gg,providerMeta:lu(me(),fs()).optional(),modelSelection:vs.optional(),reasoningEffort:bs.optional(),storyId:Fs.optional(),appBindingKeys:Be(H.max(240)).max(20).optional(),actions:mg.optional(),activeTurnId:Me.max(240).optional(),title:Me.max(240).optional(),cwd:Me.max(4096).optional(),cwdFolderId:H.max(120).optional(),userPrompt:Me.optional(),turns:Be(Lr).max(50).optional(),status:uu.default("running"),phase:sl.default("unknown"),summary:Me.max(1e3).optional(),lastMessage:Me.optional(),lastMessageItemId:Me.max(240).optional(),currentTool:du.optional(),toolCallsSinceLastMessage:ye().int().min(0).default(0),subAgents:hu.default([]),goal:pu.optional(),transcriptPath:Me.max(4096).optional(),transcriptSize:ye().int().min(0).optional(),startedAt:ut,updatedAt:ut,completedAt:ut.optional(),error:Me.max(4e3).optional(),counters:DA,queue:XA,nextInputSuggestion:Og.optional(),nextInputSuggestionError:Mg.optional(),unread:Nt().default(!1)}).strict(),nT=yu.pick({id:!0,appBindingKeys:!0,cwd:!0,error:!0,providerMeta:!0,modelSelection:!0,reasoningEffort:!0,queue:!0,subAgents:!0}).strict(),rT=Lr.pick({id:!0,providerTurnId:!0,status:!0,phase:!0,revision:!0,startedAt:!0,updatedAt:!0,completedAt:!0}).extend({bodyRevision:H.max(64)}).strict(),sT=Z({sessionId:H.max(120),revision:H.max(64),turns:Be(rT).max(50)}).strict(),iT=Z({sessionId:H.max(120),revision:H.max(64),turn:Lr}).strict(),fr=H.max(64),wi=Z({kind:Ue("not-modified"),revision:fr}).strict();xn("kind",[wi,Z({kind:Ue("updated"),revision:fr,detail:nT}).strict()]);xn("kind",[wi,Z({kind:Ue("updated"),revision:fr,index:sT}).strict()]);xn("kind",[wi,Z({kind:Ue("updated"),revision:fr,body:iT}).strict()]);xn("kind",[wi,Z({kind:Ue("updated"),revision:fr,timeline:RA}).strict()]);xn("kind",[wi,Z({kind:Ue("updated"),revision:fr,timeline:CA}).strict()]);const aT=Z({id:H.max(240),revision:fr}).strict(),rh=Z({revision:fr,item:il}).strict();Z({knownItems:Be(aT).max(1e4).default([])}).strict();xn("kind",[wi,Z({kind:Ue("snapshot"),revision:fr,items:Be(rh)}).strict(),Z({kind:Ue("delta"),revision:fr,upserted:Be(rh),removed:Be(H.max(240)),order:Be(H.max(240)).optional()}).strict()]);const Ng=Z({session:yu,provider:H.max(80),action:Ke(["send","queue","steer","interrupt","approval"]),decision:Ke(["allow","deny","skip"]).optional(),turnId:H.max(240).optional(),providerTurnId:H.max(240).optional(),queueId:H.max(120).optional()}).strict(),zg=Ng.omit({session:!0}).extend({sessionId:H.max(120),messageId:H.max(240).optional()}).strict();Z({sessionId:H.max(120),queueRevision:ye().int().min(0),action:Ke(["retry","remove","edit","reorder","pause"]),queueId:H.max(120).optional()}).strict();function oT(e){const t=e.session.turns?.at(-1),r=(e.queueId?e.session.queue?.items.find(s=>s.id===e.queueId)?.messageId:void 0)||(e.action==="send"||e.action==="queue"||e.action==="steer"?t?.userMessages?.at(-1)?.id:void 0);return zg.parse({sessionId:e.session.id,provider:e.provider,action:e.action,...e.decision?{decision:e.decision}:{},...e.turnId||e.session.activeTurnId||t?.id?{turnId:e.turnId||e.session.activeTurnId||t?.id}:{},...e.providerTurnId||t?.providerTurnId?{providerTurnId:e.providerTurnId||t?.providerTurnId}:{},...e.queueId?{queueId:e.queueId}:{},...r?{messageId:r}:{}})}vi([zg,Ng.transform(oT)]);const $g=1e4,wu=Z({id:H.max(120),agent:rl,creationSource:yi,providerSessionId:H.max(240),lineage:gg,modelSelection:vs.optional(),reasoningEffort:bs.optional(),storyId:Fs.optional(),title:Me.max(240).optional(),userPrompt:Me.optional(),lastMessage:Me.optional(),cwd:H.max(4096),cwdFolderId:H.max(120).optional(),lastActiveAt:ut,archivedAt:ut}).strict();Z({schemaVersion:Ue(1).default(1),items:Be(wu).max($g).default([])}).strict();Z({items:Be(wu).max($g).default([])}).strict();Z({item:wu,turns:Be(tT).max(50).default([])}).strict();Z({modelSelection:vs.optional(),reasoningEffort:bs.optional()}).strict();Z({disposition:Ke(["resumed","already-open"]),aiSessionId:H.max(120),providerSessionId:H.max(240),appSessionId:H.max(120).optional(),creationSource:yi}).strict();const lT=Lr.omit({userMessages:!0}),Dg=yu.pick({id:!0,agent:!0,creationSource:!0,appSessionId:!0,appId:!0,providerSessionId:!0,lineage:!0,providerMeta:!0,modelSelection:!0,reasoningEffort:!0,storyId:!0,appBindingKeys:!0,actions:!0,activeTurnId:!0,title:!0,cwd:!0,cwdFolderId:!0,userPrompt:!0,turns:!0,status:!0,phase:!0,summary:!0,lastMessage:!0,lastMessageItemId:!0,currentTool:!0,toolCallsSinceLastMessage:!0,subAgents:!0,goal:!0,queue:!0,startedAt:!0,updatedAt:!0,error:!0,unread:!0,nextInputSuggestion:!0,nextInputSuggestionError:!0}).extend({turns:Be(lT).max(50).optional(),detailRevision:H.max(64).optional(),turnsRevision:H.max(64).optional(),latestTurnRef:Z({id:Lr.shape.id,bodyRevision:H.max(64)}).strict().optional(),turnCount:ye().int().min(0).optional(),subAgentCount:ye().int().min(0).optional(),lastUserMessageAt:ut.optional()}).strict(),ma=Z({runningCount:ye().int().min(0).default(0),waitingCount:ye().int().min(0).default(0),staleCount:ye().int().min(0).default(0),sessions:Be(Dg).default([]),updatedAt:ut}).strict(),Yc=Z({streamId:H.max(240),revision:ye().int().min(0),lastEventAt:ut,snapshot:ma}).strict();ma.pick({runningCount:!0,waitingCount:!0,staleCount:!0,updatedAt:!0}).extend({idleCount:ye().int().min(0).default(0),problemCount:ye().int().min(0).default(0),revision:ye().int().min(0).optional()});const cT=Ke(["provider-event","app-session-created","app-session-updated","app-session-deleted","discovery-scan","control-action","heartbeat-sync","next-input-suggestion","startup"]),Su=Z({streamId:H.max(240),instanceId:H.max(160),nodeId:H.max(160).optional(),revision:ye().int().min(0),previousRevision:ye().int().min(0).optional(),traceId:H.max(160),generatedAt:ut,reason:cT}).strict(),uT=Z({meta:Su,snapshot:ma}).strict(),dT=Z({meta:Su,upserted:Be(Dg).default([]),removed:Be(H.max(120)).default([])}).strict(),fT=Z({meta:Su,sessionIds:Be(H.max(120)).default([]),expiresAt:ut}).strict(),hT=Z({instanceId:H.max(160),nodeId:H.max(160).optional(),sessionId:H.max(120),providerSessionId:H.max(240).optional(),turnId:H.max(240),itemId:H.max(240),delta:me().min(1),generatedAt:ut}).strict(),pT=Z({streamId:H.max(240),itemSequence:ye().int().positive(),offset:ye().int().nonnegative()});Z({message:Z({turnId:H.max(240),itemId:H.max(240),text:me(),position:pT}).nullable()});hT.omit({instanceId:!0,nodeId:!0,providerSessionId:!0}).strict();Z({instanceId:H.max(160),nodeId:H.max(160).optional(),sessionId:H.max(120),providerSessionId:H.max(240),item:il,generatedAt:ut}).strict();const mT=Z({instanceId:H.max(160),nodeId:H.max(160).optional(),sessionId:H.max(120),providerSessionId:H.max(240).optional(),turnId:H.max(240),itemId:H.max(240),field:Ue("output"),delta:me().min(1),generatedAt:ut}).strict();mT.omit({instanceId:!0,nodeId:!0,providerSessionId:!0}).strict();const Pg=Z({streamId:H.max(240),instanceId:H.max(160),sinceRevision:ye().int().min(0),latestRevision:ye().int().min(0),earliestRetainedRevision:ye().int().min(0),syncRequired:Nt().default(!1),events:Be(xn("type",[Z({type:Ue(ns.Snapshot),payload:uT}).strict(),Z({type:Ue(ns.Patch),payload:dT}).strict(),Z({type:Ue(ns.Removed),payload:fT}).strict()])).default([])}).strict(),gT=Z({instanceId:H.max(160),streamId:H.max(240),aiSessions:ma,revision:ye().int().min(0),lastEventAt:ut}).strict();Z({instances:Be(Z({instanceId:H.max(160),streamId:H.max(240),revision:ye().int().min(0)}).strict()).max(200).default([])}).strict();Z({updatedAt:ut,instances:Be(vi([gT,Z({instanceId:H.max(160),streamId:H.max(240),delta:Pg}).strict()])).default([]),removedInstanceIds:Be(H.max(160)).default([])}).strict();function Bg(e,t){const{meta:n}=t.payload;if(t.type===ns.Snapshot)return e?.streamId===n.streamId&&n.revision===e.revision?{kind:"duplicate",projection:e}:e?.streamId===n.streamId&&n.revision<e.revision?{kind:"stale",projection:e}:{kind:"applied",projection:Yc.parse({streamId:n.streamId,revision:n.revision,lastEventAt:n.generatedAt,snapshot:t.payload.snapshot})};if(!e||e.streamId!==n.streamId)return{kind:"snapshot-required",projection:e,streamId:n.streamId};if(n.revision===e.revision)return{kind:"duplicate",projection:e};if(n.revision<e.revision)return{kind:"stale",projection:e};if(n.revision!==e.revision+1||n.previousRevision!==e.revision)return{kind:"gap",projection:e,expectedRevision:e.revision+1,receivedRevision:n.revision};const r=new Map(e.snapshot.sessions.map(a=>[a.id,a]));if(t.type===ns.Patch){for(const a of t.payload.upserted)r.set(a.id,a);for(const a of t.payload.removed)r.delete(a)}else for(const a of t.payload.sessionIds)r.delete(a);const s=[...r.values()],i=ma.parse({runningCount:s.filter(a=>a.status==="running").length,waitingCount:s.filter(a=>a.status==="waiting").length,staleCount:e.snapshot.staleCount,sessions:s,updatedAt:n.generatedAt});return{kind:"applied",projection:Yc.parse({streamId:n.streamId,revision:n.revision,lastEventAt:n.generatedAt,snapshot:i})}}const Lg=Z({source:Rg,sourcePriority:ye().int().min(0).max(100).optional(),observedAt:ut.optional(),snapshotVersion:ye().int().min(0).optional()}).strict(),vT=Lg.extend({type:Ue("snapshot"),agent:H.max(80),creationSource:yi.optional(),appSessionId:Me.max(120).optional(),appId:Me.max(120).optional(),providerSessionId:Me.max(240).optional(),lineage:Ro.optional(),providerMeta:lu(me(),fs()).optional(),modelSelection:vs.optional(),reasoningEffort:bs.optional(),storyId:Fs.optional(),appBindingKeys:Be(H.max(240)).max(20).optional(),actions:mg.optional(),title:Me.max(240).optional(),cwd:Me.max(4096).optional(),cwdFolderId:H.max(120).optional(),activeTurnId:Me.max(240).optional(),userPrompt:Me.optional(),turns:Be(Lr).max(50).optional(),status:uu.optional(),phase:sl.optional(),summary:Me.max(1e3).optional(),lastMessage:Me.optional(),lastMessageItemId:Me.max(240).optional(),error:Me.max(4e3).optional(),currentTool:du.optional(),toolCallsSinceLastMessage:ye().int().min(0).optional(),subAgents:hu.optional(),goal:pu.nullable().optional(),transcriptPath:Me.max(4096).optional(),transcriptSize:ye().int().min(0).optional(),replaceActivity:Nt().optional()}).strict(),bT=Lg.extend({type:Ue("event"),sessionId:H.max(120),kind:Ke(["lifecycle","send-ack","turn-started","user-message","assistant-message","approval-requested","turn-completed","session-error","tool-activity","sub-agent-activity","context-compaction","model-selection","reasoning-effort","goal","next-input-suggestion"]),approvalRequest:pg.optional(),modelSelection:vs.optional(),reasoningEffort:bs.optional(),activeTurnId:Me.max(240).optional(),providerTurnId:Me.max(240).optional(),userPrompt:Me.optional(),userMessage:kg.optional(),text:me().optional(),itemId:Me.max(240).optional(),status:uu.optional(),phase:sl.optional(),summary:Me.max(1e3).optional(),error:Me.max(4e3).optional(),currentTool:du.nullable().optional(),toolCallsSinceLastMessage:ye().int().min(0).optional(),subAgents:hu.optional(),contextCompaction:Cg.optional(),goal:pu.nullable().optional(),suggestion:Og.nullable().optional(),suggestionError:Mg.nullable().optional(),counters:Z({toolCalls:ye().int().min(0).optional(),edits:ye().int().min(0).optional(),approvals:ye().int().min(0).optional()}).strict().optional()}).strict().superRefine((e,t)=>{if(e.kind==="model-selection"?e.modelSelection||t.addIssue({code:"custom",path:["modelSelection"],message:"model-selection events require modelSelection"}):e.modelSelection!==void 0&&t.addIssue({code:"custom",path:["modelSelection"],message:"modelSelection is only valid for model-selection events"}),e.kind==="reasoning-effort"?e.reasoningEffort||t.addIssue({code:"custom",path:["reasoningEffort"],message:"reasoning-effort events require reasoningEffort"}):e.reasoningEffort!==void 0&&t.addIssue({code:"custom",path:["reasoningEffort"],message:"reasoningEffort is only valid for reasoning-effort events"}),e.kind==="session-error"&&!e.error&&t.addIssue({code:"custom",path:["error"],message:"session-error events require error"}),e.kind==="goal"?Object.prototype.hasOwnProperty.call(e,"goal")||t.addIssue({code:"custom",path:["goal"],message:"goal events require goal (use null when cleared)"}):e.goal!==void 0&&t.addIssue({code:"custom",path:["goal"],message:"goal is only valid for goal events"}),e.kind==="next-input-suggestion"){const n=Object.prototype.hasOwnProperty.call(e,"suggestion"),r=Object.prototype.hasOwnProperty.call(e,"suggestionError");!n&&!r&&t.addIssue({code:"custom",path:["suggestion"],message:"next-input-suggestion events require suggestion or suggestionError (use null when cleared)"}),e.suggestion&&e.suggestionError&&t.addIssue({code:"custom",path:["suggestionError"],message:"suggestion and suggestionError are mutually exclusive"})}else(e.suggestion!==void 0||e.suggestionError!==void 0)&&t.addIssue({code:"custom",path:["suggestion"],message:"suggestion is only valid for next-input-suggestion events"});if(e.kind==="context-compaction"?e.contextCompaction||t.addIssue({code:"custom",path:["contextCompaction"],message:"context-compaction events require contextCompaction"}):e.contextCompaction!==void 0&&t.addIssue({code:"custom",path:["contextCompaction"],message:"contextCompaction is only valid for context-compaction events"}),e.kind!=="send-ack"&&e.kind!=="user-message"&&e.userMessage!==void 0&&t.addIssue({code:"custom",path:["userMessage"],message:"userMessage is only valid for send-ack and user-message events"}),e.kind==="sub-agent-activity"?e.subAgents||t.addIssue({code:"custom",path:["subAgents"],message:"sub-agent-activity events require subAgents"}):e.subAgents!==void 0&&t.addIssue({code:"custom",path:["subAgents"],message:"subAgents is only valid for sub-agent-activity events"}),e.kind!=="tool-activity"){e.currentTool!==void 0&&t.addIssue({code:"custom",path:["currentTool"],message:"currentTool is only valid for tool-activity events"}),e.toolCallsSinceLastMessage!==void 0&&t.addIssue({code:"custom",path:["toolCallsSinceLastMessage"],message:"toolCallsSinceLastMessage is only valid for tool-activity events"});return}"currentTool"in e||t.addIssue({code:"custom",path:["currentTool"],message:"tool-activity events require currentTool"}),e.toolCallsSinceLastMessage===void 0&&t.addIssue({code:"custom",path:["toolCallsSinceLastMessage"],message:"tool-activity events require toolCallsSinceLastMessage"})});xn("type",[vT,bT]);Z({type:Ue("snapshot"),data:me(),pendingEscape:me(),cols:ye().int().positive(),rows:ye().int().positive()}).passthrough();const rs={Snapshot:"app-session.snapshot",Patch:"app-session.patch",Removed:"app-session.removed"},Fg=Ke(["created","starting","running","stopping","stopped","exited","failed","closed","terminated","unknown"]),yT=Ke(["tty","vnc","web"]);Z({mode:yT,url:me().trim().min(1).max(4096),token:me().trim().min(1).max(512),expiresAt:me().datetime()}).strict();Z({revoked:Nt()}).strict();const wT=Z({name:me().trim().min(1).max(240),size:ye().int().nonnegative(),updatedAt:me().datetime(),truncated:Nt(),content:me()}).strict();Z({sessionId:me().trim().min(1).max(160),logDir:me().trim().min(1).max(1024),maxBytes:ye().int().positive(),files:Be(wT).max(256)}).strict();const ST=new Set(["stopped","failed","exited","closed","terminated"]),Ug=Z({type:Ke(["app-session","provider-session","adapter-key"]),id:me().trim().min(1).max(240),agent:me().trim().min(1).max(80).optional(),adapter:me().trim().min(1).max(80).optional(),key:me().trim().min(1).max(240).optional()}).strict(),al=lu(me(),fs()).and(Z({id:me().trim().min(1).max(160),appId:me().trim().min(1).max(160).optional(),title:me().trim().max(240).optional(),kind:me().trim().max(80).optional(),status:Fg.default("unknown"),bindings:Be(Ug).max(40).default([]),workspace:Z({cwd:me().trim().max(4096).optional()}).strict().optional(),createdAt:me().datetime().optional(),updatedAt:me().datetime().optional()})),ol=Z({runningCount:ye().int().min(0).default(0),problemCount:ye().int().min(0).default(0),sessions:Be(al).default([]),updatedAt:me().datetime()}).strict(),Xc=Z({streamId:me().trim().min(1).max(240),revision:ye().int().min(0),lastEventAt:me().datetime(),snapshot:ol}).strict();ol.pick({runningCount:!0,problemCount:!0,updatedAt:!0}).extend({revision:ye().int().min(0).optional()});const xT=Ke(["app-session-created","app-session-updated","app-session-deleted","app-session-recovered","control-action","heartbeat-sync","startup"]),xu=Z({streamId:me().trim().min(1).max(240),instanceId:me().trim().min(1).max(160),nodeId:me().trim().min(1).max(160).optional(),revision:ye().int().min(0),previousRevision:ye().int().min(0).optional(),traceId:me().trim().min(1).max(160),generatedAt:me().datetime(),reason:xT}).strict(),kT=Z({meta:xu,snapshot:ol}).strict(),_T=Z({meta:xu,session:al}).strict(),ET=Z({meta:xu,sessionId:me().trim().min(1).max(160),tombstone:al.optional(),expiresAt:me().datetime().optional()}).strict(),AT=Z({streamId:me().trim().min(1).max(240),instanceId:me().trim().min(1).max(160),sinceRevision:ye().int().min(0),latestRevision:ye().int().min(0),earliestRetainedRevision:ye().int().min(0),syncRequired:Nt().default(!1),events:Be(xn("type",[Z({type:Ue(rs.Snapshot),payload:kT}).strict(),Z({type:Ue(rs.Patch),payload:_T}).strict(),Z({type:Ue(rs.Removed),payload:ET}).strict()])).default([])}).strict();function qg(e,t){const{meta:n}=t.payload;if(t.type===rs.Snapshot)return e?.streamId===n.streamId&&n.revision===e.revision?{kind:"duplicate",projection:e}:e?.streamId===n.streamId&&n.revision<e.revision?{kind:"stale",projection:e}:{kind:"applied",projection:Xc.parse({streamId:n.streamId,revision:n.revision,lastEventAt:n.generatedAt,snapshot:TT(t.payload.snapshot.sessions,t.payload.snapshot.updatedAt)})};if(!e||e.streamId!==n.streamId)return{kind:"snapshot-required",projection:e,streamId:n.streamId};if(n.revision===e.revision)return{kind:"duplicate",projection:e};if(n.revision<e.revision)return{kind:"stale",projection:e};if(n.revision!==e.revision+1||n.previousRevision!==e.revision)return{kind:"gap",projection:e,expectedRevision:e.revision+1,receivedRevision:n.revision};const r=[...e.snapshot.sessions];if(t.type===rs.Patch){const i=r.findIndex(a=>a.id===t.payload.session.id);jg(t.payload.session.status)?i<0?r.push(t.payload.session):r[i]=t.payload.session:i>=0&&r.splice(i,1)}else{const i=r.findIndex(a=>a.id===t.payload.sessionId);i>=0&&r.splice(i,1)}const s=Hg(r,n.generatedAt);return{kind:"applied",projection:Xc.parse({streamId:n.streamId,revision:n.revision,lastEventAt:n.generatedAt,snapshot:s})}}function Hg(e,t=new Date().toISOString()){const n=e.map(r=>IT(r));return ol.parse({runningCount:n.filter(r=>r.status==="running").length,problemCount:n.filter(r=>r.status==="failed").length,sessions:n,updatedAt:t})}function TT(e,t=new Date().toISOString()){return Hg(e.filter(n=>jg(typeof n.status=="string"?n.status:void 0)),t)}function IT(e){const t=Vg(typeof e.status=="string"?e.status:void 0),n=typeof e.id=="string"?e.id:"",r=MT(e),{workspace:s,...i}=e;return al.parse({...i,status:t,bindings:NT([...CT(e.bindings),...n?[{type:"app-session",id:n}]:[],...OT(e)]),...r?{workspace:r}:{}})}function Vg(e){const t=(e||"unknown").trim().toLowerCase();return t==="ended"?"closed":t==="terminating"?"stopping":Fg.options.includes(t)?t:"unknown"}function jg(e){return!ST.has(Vg(e))}function RT(e){return e.type==="app-session"?`app:${e.id}`:e.type==="provider-session"?`provider:${e.agent||""}:${e.id}`:`adapter:${e.adapter||""}:${e.key||e.id}`}function CT(e){return Array.isArray(e)?e.flatMap(t=>{const n=Ug.safeParse(t);return n.success?[n.data]:[]}):[]}function OT(e){const t=lr(e.ai),n=lr(t.claude),r=lr(t.appServer),s=lr(e.launch),i=lr(s.aiSessionResume),a=[],o=ar(i.providerSessionId),l=e.appId==="codex"||e.appId==="claude"||e.appId==="opencode"?e.appId:void 0;l&&o&&a.push({type:"provider-session",agent:l,id:o});const c=ar(n.short);c&&a.push({type:"adapter-key",adapter:"claude",agent:"claude",id:`short:${c}`,key:`short:${c}`});const u=ar(n.providerSessionId);u&&a.push({type:"provider-session",agent:"claude",id:u});const p=Array.isArray(t.threadIds)?t.threadIds.filter(x=>typeof x=="string"&&!!x.trim()):[],m=ar(t.activeThreadId);for(const x of[...new Set([m,...p].filter(Boolean))])a.push({type:"provider-session",agent:"codex",id:x});const f=ar(r.socketPath),y=ar(r.endpoint),b=f?`socket:${f}`:y?`endpoint:${y}`:"";return b&&a.push({type:"adapter-key",adapter:"codex-app-server",agent:"codex",id:b,key:b}),a}function MT(e){const t=lr(e.workspace),n=lr(e.tty),r=lr(e.launch),s=lr(e.ai),i=lr(s.claude),a=ar(t.cwd)||ar(n.cwd)||ar(i.cwd)||ar(r.cwd);return a?{cwd:a}:void 0}function NT(e){const t=new Map;for(const n of e)t.set(RT(n),n);return[...t.values()]}function lr(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}function ar(e){return typeof e=="string"&&e.trim()?e.trim():""}function Gg(e,t){let n=t0(t);for(let r=0;r<100;r+=1){const s=e.safeParse(n);if(s.success)return s;const i=Zg(s.error.issues);let a=!1;for(const o of i){const l=zT(n,o.path);if(!(!l||typeof l!="object"||Array.isArray(l)))for(const c of o.keys)Object.prototype.hasOwnProperty.call(l,c)&&(delete l[c],a=!0)}if(!a)return s}return e.safeParse(n)}function Co(e,t){const n=Gg(e,t);if(!n.success)throw n.error;return n.data}function Zg(e,t=[]){const n=[];for(const r of e){if(r.code==="unrecognized_keys"){n.push({code:"unrecognized_keys",keys:r.keys,path:[...t,...r.path]});continue}if(r.code!=="invalid_union"||!Array.isArray(r.errors))continue;const s=r.errors.filter(a=>Array.isArray(a));if(!s.length)continue;const i=s.reduce((a,o)=>e0(o)<e0(a)?o:a);n.push(...Zg(i,[...t,...r.path]))}return n}function e0(e){return e.reduce((t,n)=>{if(n.code==="unrecognized_keys")return t;if(n.code!=="invalid_union"||!Array.isArray(n.errors))return t+1;const r=n.errors.filter(s=>Array.isArray(s));return t+(r.length?Math.min(...r.map(e0)):1)},0)}function zT(e,t){let n=e;for(const r of t){if(!n||typeof n!="object")return;n=n[r]}return n}function t0(e){return Array.isArray(e)?e.map(t0):!e||typeof e!="object"||Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null?e:Object.fromEntries(Object.entries(e).map(([t,n])=>[t,t0(n)]))}const $T="2026-08-25",Kg=Z({nodeId:me().optional(),instanceId:me().optional()}).passthrough(),DT=Z({v:Ue(1),id:me().min(1),seq:ye().finite(),type:me().min(1),topic:me().min(1),createdAt:me().datetime(),payload:fs(),replay:Ue(!0).optional(),scope:Kg.optional()}).passthrough(),PT=Z({v:Ue($T),id:me().min(1),type:me().min(1),createdAt:me().datetime(),payload:fs(),topic:me().min(1).optional(),replay:Ue(!0).optional(),scope:Kg.optional()}).passthrough();xn("v",[DT,PT]);Z({v:Ue(1),type:Ue("ping"),sentAt:me().datetime()}).strict();Z({v:Ue(1),type:Ue("pong"),sentAt:me().datetime(),receivedAt:me().datetime()}).strict();const Wg=Z({instanceId:me().trim().min(1).max(160),sessionId:me().trim().min(1).max(120).optional(),requestId:me().regex(/^[0-9a-f]{32}$/)});Wg.extend({hasActiveMessage:Nt().optional()});Z({replaySince:me().datetime().optional(),messageDeltas:Z({allInstances:Nt().default(!1),instanceIds:Be(me().trim().min(1).max(160)).max(1e3).default([])}).default({allInstances:!1,instanceIds:[]}),messageSubscriptionRequests:Be(Wg).max(1e3).optional(),timelineAllSessions:Nt().default(!1),timelineSessions:Be(Z({instanceId:me().trim().min(1).max(160),sessionId:me().trim().min(1).max(120)})).max(1e3).default([])});const BT=1,LT=Ke(["ai.sessions","app.sessions"]),FT=Z({topic:LT,instanceId:me().trim().min(1).max(160),streamId:me().trim().min(1).max(240),latestRevision:ye().int().min(0),earliestRetainedRevision:ye().int().min(0)}).strict(),UT=Z({protocolVersion:Ue(BT),streams:Be(FT)}).strict(),qT="streams.hello";let _n,Mi,Ga=0,Za=!1,Ka=!1,Ts,Is;const la=new Map,Zi=new Map,ei=new Map;let Oo=Jn;function HT(e){return jh("/api/events",e)}function VT(e){return e.startsWith("trigger.")?[["triggers"],["status"]]:[]}function ku(e,t){Ts=t,e.setQueryData(["ai-sessions"],t.snapshot);for(const n of t.snapshot.sessions)e.setQueryData(["ai-session",n.id],n)}function _u(e,t){Is=t,e.setQueryData(["app-sessions"],t.snapshot.sessions)}function jT(e){const t=e.payload&&typeof e.payload=="object"?e.payload:{},n=t.meta&&typeof t.meta=="object"?t.meta:{};return{streamId:typeof n.streamId=="string"?n.streamId:"",revision:typeof n.revision=="number"?n.revision:0}}function sh(e,t){const n=la.get(e),r=jT(t);if(!n||r.streamId!==n.streamId)return;const s=ei.get(e);ei.set(e,{streamId:n.streamId,revision:Math.max(s?.streamId===n.streamId?s.revision:0,r.revision)})}function GT(e,t){if(t.type===ns.Snapshot||t.type===ns.Patch||t.type===ns.Removed){if(Zi.has("ai.sessions"))return sh("ai.sessions",t),!0;const n=Bg(Ts,{type:t.type,payload:t.payload});return n.kind==="applied"&&ku(e,n.projection),(n.kind==="gap"||n.kind==="snapshot-required")&&n0("ai.sessions",e),!0}if(t.type===rs.Snapshot||t.type===rs.Patch||t.type===rs.Removed){if(Zi.has("app.sessions"))return sh("app.sessions",t),!0;const n=qg(Is,{type:t.type,payload:t.payload});return n.kind==="applied"&&_u(e,n.projection),(n.kind==="gap"||n.kind==="snapshot-required")&&n0("app.sessions",e),!0}return!1}async function Ni(e,t){if(e==="ai.sessions"){const r=Co(Yc,await Oo("ai-sessions"));return ku(t,r),r.revision}const n=Co(Xc,await Oo("apps/sessions"));return _u(t,n),n.revision}async function ZT(e,t,n){if(e==="ai.sessions"&&Ts?.streamId===t.streamId){const r=Co(Pg,await Oo(`ai-sessions?streamId=${encodeURIComponent(t.streamId)}&sinceRevision=${Ts.revision}`));if(r.syncRequired)return Ni(e,n);for(const s of r.events){const i=Bg(Ts,s);if(i.kind!=="applied"&&i.kind!=="duplicate")return Ni(e,n);ku(n,i.projection)}return Ts?.revision||0}if(e==="app.sessions"&&Is?.streamId===t.streamId){const r=Co(AT,await Oo(`apps/sessions?streamId=${encodeURIComponent(t.streamId)}&sinceRevision=${Is.revision}`));if(r.syncRequired)return Ni(e,n);for(const s of r.events){const i=qg(Is,s);if(i.kind!=="applied"&&i.kind!=="duplicate")return Ni(e,n);_u(n,i.projection)}return Is?.revision||0}return Ni(e,n)}function n0(e,t){const n=Zi.get(e);if(n)return n;const r=Promise.resolve().then(async()=>{try{for(;;){const s=la.get(e);if(!s)return;const i=e==="ai.sessions"?Ts:Is,a=ei.get(e),o=Math.max(s.latestRevision,a?.streamId===s.streamId?a.revision:0);if(i?.streamId===s.streamId&&i.revision>=o){ei.get(e)?.streamId===s.streamId&&ei.delete(e);return}await ZT(e,s,t)}}finally{Zi.delete(e)}});return Zi.set(e,r),r}function KT(e,t){const n=la.get(e.topic);return n&&n.streamId!==e.streamId&&ei.delete(e.topic),la.set(e.topic,e),n0(e.topic,t)}const WT=l0("events",{state:()=>({connectionState:"idle",streamStates:{"ai.sessions":"disconnected","app.sessions":"disconnected"},reconnects:0,lastEventAt:"",events:[]}),actions:{connect(e){if(_n&&(_n.readyState===WebSocket.CONNECTING||_n.readyState===WebSocket.OPEN))return;clearTimeout(Mi),this.connectionState="connecting";const t=$s();_n=new WebSocket(HT(t.token)),_n.addEventListener("open",()=>{Ga=0,this.connectionState="connected"}),_n.addEventListener("message",n=>{try{const r=JSON.parse(String(n.data));if(this.lastEventAt=r.createdAt,this.events=[r,...this.events].slice(0,50),r.type===qT&&e){const s=Gg(UT,r.payload);if(!s.success){Ka=!0,this.connectionState="error",console.error("SESSION_STREAM_PROTOCOL_INCOMPATIBLE",s.error.issues),_n?.close(1002,"Incompatible session stream protocol.");return}const i=s.data;for(const a of i.streams)this.streamStates[a.topic]="recovering",KT(a,e).then(()=>{this.streamStates[a.topic]="live"});return}if(e&>(e,r))return;for(const s of VT(r.type))e?.invalidateQueries({queryKey:s})}catch{this.connectionState="error"}}),_n.addEventListener("close",()=>{if(this.streamStates["ai.sessions"]="disconnected",this.streamStates["app.sessions"]="disconnected",Za||Ka){Za=!1,this.connectionState=Ka?"error":"idle";return}this.connectionState="disconnected",this.scheduleReconnect(e)}),_n.addEventListener("error",()=>{this.connectionState="error"})},disconnect(){clearTimeout(Mi),Mi=void 0,_n?(Za=!0,_n.close()):Za=!1,_n=void 0,la.clear(),Ka=!1,Ga=0,this.connectionState="idle"},scheduleReconnect(e){clearTimeout(Mi);const t=Math.min(3e4,1e3*2**Ga),n=Math.min(3e4,Math.round(t*(.75+Math.random()*.5)));Ga+=1,Mi=setTimeout(()=>{this.reconnects+=1,_n=void 0,this.connect(e)},n)}}}),QT={class:"app-shell"},JT={class:"workspace"},YT={class:"topbar"},XT={class:"topbar-status"},eI=["data-state"],tI={key:0,class:"last-event"},nI={class:"topbar-right-content"},rI={id:"topbar-session-actions",class:"topbar-session-slot"},sI={key:0,class:"workspace-session-actions"},iI={class:"workspace-session-status"},aI={key:1,class:"segmented-control"},oI={class:"topbar-actions"},lI=Re({__name:"ControlledInstanceShell",setup(e){const t=hs(),n=$s(),r=WT(),s=fi(),i=np(),a=tp(),o=di(),l=Oe(n.token),c=Oe(!1),u=Oe("general"),p=Se(()=>a.data.value?"Instance ready":"Web server ready"),m=Se(()=>`last event ${G(r.lastEventAt)}`),f=Se(()=>!!n.token),y=Se(()=>s.tabs.find(P=>P.id===s.activeTabId)),b=Se(()=>y0(y.value,o.data.value||[])),x=Se(()=>{const P=i.data.value;return!!(P&&(!P.enabled||f.value))});Bn(()=>{l.value=n.token}),on([x,()=>n.token],([P])=>{r.disconnect(),P&&r.connect(t)},{immediate:!0}),zo(()=>{r.disconnect()});function S(){n.setToken(l.value)}function N(P){u.value=P,c.value=!0}function z(P){s.open({type:"logs",id:`logs:${P.id}`,sessionId:P.id,title:`${P.title} logs`})}function I(P){const W=new URLSearchParams;n.token&&W.set("token",n.token);const q=W.toString()?`?${W.toString()}`:"";return jn(`/api/apps/sessions/${P.id}/screenshot${q}`)}async function E(P){await Os(P),await t.invalidateQueries({queryKey:["status"]})}async function _(P){const W=await m0(P);s.open(da(W)),await t.invalidateQueries({queryKey:["status"]})}function L(P){s.setVncResizeMode(P)}function M(P){s.setGuiHidpi(P)}function G(P){if(!P)return"";const W=new Date(P);return Number.isNaN(W.getTime())?P:W.toLocaleTimeString()}return(P,W)=>(O(),j("div",QT,[T(_3,{onOpenSettings:N}),k("main",JT,[k("header",YT,[k("div",XT,[W[6]||(W[6]=k("span",{class:"brand"},"TaskHandoff",-1)),k("span",null,K(p.value),1),k("span",{class:"event-state","data-state":g(r).connectionState},K(g(r).connectionState),9,eI),g(r).lastEventAt?(O(),j("span",tI,K(m.value),1)):pe("",!0)]),T(g(Rn),{class:"topbar-right"},{default:D(()=>[k("div",nI,[k("div",rI,[b.value?(O(),j("div",sI,[k("span",iI,K(b.value.appId)+" · "+K(b.value.status),1),T(g(nt),{variant:"outline",size:"sm",onClick:W[0]||(W[0]=q=>z(b.value))},{default:D(()=>[...W[7]||(W[7]=[fe("Logs",-1)])]),_:1}),b.value.kind==="gui"&&b.value.status==="running"?(O(),xe(g(nt),{key:0,variant:"outline",size:"sm",as:"a",href:I(b.value),target:"_blank",rel:"noreferrer"},{default:D(()=>[...W[8]||(W[8]=[fe("Screenshot",-1)])]),_:1},8,["href"])):pe("",!0),b.value.kind==="gui"&&b.value.status==="running"?(O(),j("div",aI,[T(g(Ap),{type:"single","model-value":g(s).vncResizeMode,"aria-label":"VNC resize mode","onUpdate:modelValue":W[1]||(W[1]=q=>q&&L(q))},{default:D(()=>[T(g(oo),{value:"scale"},{default:D(()=>[...W[9]||(W[9]=[fe("Scale",-1)])]),_:1}),T(g(oo),{value:"remote"},{default:D(()=>[...W[10]||(W[10]=[fe("Resize",-1)])]),_:1})]),_:1},8,["model-value"]),T(g(_p),{"model-value":g(s).guiHidpi,"aria-label":"Toggle HiDPI","onUpdate:modelValue":M},{default:D(()=>[...W[11]||(W[11]=[fe("HiDPI",-1)])]),_:1},8,["model-value"])])):pe("",!0),T(g(nt),{variant:"outline",size:"sm",disabled:b.value.status!=="running",onClick:W[2]||(W[2]=q=>E(b.value.id))},{default:D(()=>[...W[12]||(W[12]=[fe("Stop",-1)])]),_:1},8,["disabled"]),T(g(nt),{variant:"outline",size:"sm",onClick:W[3]||(W[3]=q=>_(b.value.id))},{default:D(()=>[...W[13]||(W[13]=[fe("Restart",-1)])]),_:1})])):pe("",!0)]),k("div",oI,[g(i).data.value?.enabled?Mo((O(),j("input",{key:0,"onUpdate:modelValue":W[4]||(W[4]=q=>l.value=q),class:"token-input",type:"password",placeholder:"Web token",onChange:S},null,544)),[[No,l.value]]):pe("",!0)])])]),_:1})]),T(V9)]),c.value?(O(),xe(b5,{key:0,section:u.value,onClose:W[5]||(W[5]=q=>c.value=!1)},null,8,["section"])):pe("",!0)]))}});let r0=1;var cI=class{subscribers;toasts;dismissedToasts;constructor(){this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}subscribe=e=>(this.subscribers.push(e),()=>{const t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)});publish=e=>{this.subscribers.forEach(t=>t(e))};addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]};create=e=>{const{message:t,...n}=e,r=typeof e.id=="number"||e.id&&e.id?.length>0?e.id:r0++,s=this.toasts.find(a=>a.id===r),i=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),s?this.toasts=this.toasts.map(a=>a.id===r?(this.publish({...a,...e,id:r,title:t}),{...a,...e,id:r,dismissible:i,title:t}):a):this.addToast({title:t,...n,dismissible:i,id:r}),r};dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),e);message=(e,t)=>this.create({...t,message:e,type:"default"});error=(e,t)=>this.create({...t,type:"error",message:e});success=(e,t)=>this.create({...t,type:"success",message:e});info=(e,t)=>this.create({...t,type:"info",message:e});warning=(e,t)=>this.create({...t,type:"warning",message:e});loading=(e,t)=>this.create({...t,type:"loading",message:e});promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));const r=Promise.resolve(e instanceof Function?e():e);let s=n!==void 0,i;const a=r.then(async l=>{if(i=["resolve",l],_i(l))s=!1,this.create({id:n,type:"default",message:l});else if(dI(l)&&!l.ok){s=!1;const u=typeof t.error=="function"?await t.error(`HTTP error! status: ${l.status}`):t.error,p=typeof t.description=="function"?await t.description(`HTTP error! status: ${l.status}`):t.description,f=typeof u=="object"&&!_i(u)?u:{message:u||"",id:n||""};this.create({id:n,type:"error",description:p,...f})}else if(l instanceof Error){s=!1;const u=typeof t.error=="function"?await t.error(l):t.error,p=typeof t.description=="function"?await t.description(l):t.description,f=typeof u=="object"&&!_i(u)?u:{message:u||"",id:n||""};this.create({id:n,type:"error",description:p,...f})}else if(t.success!==void 0){s=!1;const u=typeof t.success=="function"?await t.success(l):t.success,p=typeof t.description=="function"?await t.description(l):t.description,f=typeof u=="object"&&!_i(u)?u:{message:u||"",id:n||""};this.create({id:n,type:"success",description:p,...f})}}).catch(async l=>{if(i=["reject",l],t.error!==void 0){s=!1;const c=typeof t.error=="function"?await t.error(l):t.error,u=typeof t.description=="function"?await t.description(l):t.description,m=typeof c=="object"&&!_i(c)?c:{message:c||"",id:n||""};this.create({id:n,type:"error",description:u,...m})}}).finally(()=>{s&&(this.dismiss(n),n=void 0),t.finally?.()}),o=()=>new Promise((l,c)=>a.then(()=>i[0]==="reject"?c(i[1]):l(i[1])).catch(c));return typeof n!="string"&&typeof n!="number"?{unwrap:o}:Object.assign(n,{unwrap:o})};custom=(e,t)=>{const n=t?.id||r0++,r=this.toasts.find(i=>i.id===n),s=t?.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(n)&&this.dismissedToasts.delete(n),r?this.toasts=this.toasts.map(i=>i.id===n?(this.publish({...i,component:e,dismissible:s,id:n,...t}),{...i,component:e,dismissible:s,id:n,...t}):i):this.addToast({component:e,dismissible:s,id:n,...t}),n};getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id))};const yn=new cI;function uI(e,t){const n=t?.id||r0++;return yn.create({message:e,id:n,type:"default",...t}),n}const dI=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",fI=uI,hI=()=>yn.toasts,pI=()=>yn.getActiveToasts();Object.assign(fI,{success:yn.success,info:yn.info,warning:yn.warning,error:yn.error,custom:yn.custom,message:yn.message,promise:yn.promise,dismiss:yn.dismiss,loading:yn.loading},{getHistory:hI,getToasts:pI});function Wa(e){return e.label!==void 0}const mI=3,Qg="24px",Jg="16px",ih=4e3,gI=356,vI=14,bI=45,Yg=200;function yI(){const e=Oe(!1);return Bn(()=>{const t=()=>{e.value=document.hidden};return document.addEventListener("visibilitychange",t),()=>window.removeEventListener("visibilitychange",t)}),{isDocumentHidden:e}}function Gr(...e){return e.filter(Boolean).join(" ")}function wI(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}function SI(e,t){const n={};return[e,t].forEach((r,s)=>{const i=s===1,a=i?"--mobile-offset":"--offset",o=i?Jg:Qg;function l(c){["top","right","bottom","left"].forEach(u=>{n[`${a}-${u}`]=typeof c=="number"?`${c}px`:c})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(c=>{r[c]===void 0?n[`${a}-${c}`]=o:n[`${a}-${c}`]=typeof r[c]=="number"?`${r[c]}px`:r[c]}):l(o)}),n}const xI=["data-rich-colors","data-styled","data-mounted","data-promise","data-swiped","data-removed","data-visible","data-y-position","data-x-position","data-index","data-front","data-swiping","data-dismissible","data-type","data-invert","data-swipe-out","data-swipe-direction","data-expanded","data-testid"],kI=["aria-label","data-disabled","data-close-button-position"];var _I=Re({__name:"Toast",props:{toast:{},toasts:{},index:{},swipeDirections:{},expanded:{type:Boolean},invert:{type:Boolean},heights:{},gap:{},position:{},closeButtonPosition:{},visibleToasts:{},expandByDefault:{type:Boolean},closeButton:{type:Boolean},interacting:{type:Boolean},style:{},cancelButtonStyle:{},actionButtonStyle:{},duration:{},class:{},unstyled:{type:Boolean},descriptionClass:{},loadingIcon:{},classes:{},icons:{},closeButtonAriaLabel:{},defaultRichColors:{type:Boolean}},emits:["update:heights","update:height","removeToast"],setup(e,{emit:t}){const n=e,r=t,s=Oe(null),i=Oe(null),a=Oe(!1),o=Oe(!1),l=Oe(!1),c=Oe(!1),u=Oe(!1),p=Oe(0),m=Oe(0),f=Oe(n.toast.duration||n.duration||ih),y=Oe(null),b=Oe(null),x=Se(()=>n.index===0),S=Se(()=>n.index+1<=n.visibleToasts),N=Se(()=>n.toast.type),z=Se(()=>n.toast.dismissible!==!1),I=Se(()=>n.toast.class||""),E=Se(()=>n.descriptionClass||""),_=Se(()=>{const C=n.toast.position||n.position,Q=n.heights.filter(de=>de.position===C).findIndex(de=>de.toastId===n.toast.id);return Q>=0?Q:0}),L=Se(()=>{const C=n.toast.position||n.position;return n.heights.filter(Q=>Q.position===C).reduce((Q,de,Ie)=>Ie>=_.value?Q:Q+de.height,0)}),M=Se(()=>_.value*n.gap+L.value||0),G=Se(()=>n.toast.closeButton??n.closeButton),P=Se(()=>n.toast.duration||n.duration||ih),W=Oe(0),q=Oe(0),X=Oe(null),ne=Se(()=>n.position.split("-")),he=Se(()=>ne.value[0]),Ae=Se(()=>ne.value[1]),se=Se(()=>typeof n.toast.title!="string"),re=Se(()=>typeof n.toast.description!="string"),{isDocumentHidden:ze}=yI(),ie=Se(()=>N.value&&N.value==="loading");nc(()=>{a.value=!0,f.value=P.value}),Bn(async()=>{if(!a.value||!b.value)return;await ur();const C=b.value,le=C.style.height;C.style.height="auto";const Q=C.getBoundingClientRect().height;C.style.height=le,m.value=Q,r("update:height",{toastId:n.toast.id,height:Q,position:n.toast.position||n.position})});function je(){o.value=!0,p.value=M.value,setTimeout(()=>{r("removeToast",n.toast)},Yg)}function rt(){if(ie.value||!z.value)return{};je(),n.toast.onDismiss?.(n.toast)}function ot(C){C.button!==2&&(ie.value||!z.value||(y.value=new Date,p.value=M.value,C.target.setPointerCapture(C.pointerId),C.target.tagName!=="BUTTON"&&(l.value=!0,X.value={x:C.clientX,y:C.clientY})))}function Ft(){if(c.value||!z.value)return;X.value=null;const C=Number(b.value?.style.getPropertyValue("--swipe-amount-x").replace("px","")||0),le=Number(b.value?.style.getPropertyValue("--swipe-amount-y").replace("px","")||0),Q=new Date().getTime()-(y.value?.getTime()||0),de=s.value==="x"?C:le,Ie=Math.abs(de)/Q;if(Math.abs(de)>=bI||Ie>.11){p.value=M.value,n.toast.onDismiss?.(n.toast),s.value==="x"?i.value=C>0?"right":"left":i.value=le>0?"down":"up",je(),c.value=!0;return}else b.value?.style.setProperty("--swipe-amount-x","0px"),b.value?.style.setProperty("--swipe-amount-y","0px");u.value=!1,l.value=!1,s.value=null}function st(C){if(!X.value||!z.value||(window?.getSelection()?.toString()?.length??!1))return;const Q=C.clientY-X.value.y,de=C.clientX-X.value.x,Ie=n.swipeDirections??wI(n.position);!s.value&&(Math.abs(de)>1||Math.abs(Q)>1)&&(s.value=Math.abs(de)>Math.abs(Q)?"x":"y");let Ge={x:0,y:0};const Le=Te=>1/(1.5+Math.abs(Te)/20);if(s.value==="y"){if(Ie.includes("top")||Ie.includes("bottom"))if(Ie.includes("top")&&Q<0||Ie.includes("bottom")&&Q>0)Ge.y=Q;else{const Te=Q*Le(Q);Ge.y=Math.abs(Te)<Math.abs(Q)?Te:Q}}else if(s.value==="x"&&(Ie.includes("left")||Ie.includes("right")))if(Ie.includes("left")&&de<0||Ie.includes("right")&&de>0)Ge.x=de;else{const Te=de*Le(de);Ge.x=Math.abs(Te)<Math.abs(de)?Te:de}(Math.abs(Ge.x)>0||Math.abs(Ge.y)>0)&&(u.value=!0),b.value?.style.setProperty("--swipe-amount-x",`${Ge.x}px`),b.value?.style.setProperty("--swipe-amount-y",`${Ge.y}px`)}nc(()=>{if(a.value=!0,!b.value)return;const C=b.value.getBoundingClientRect().height;m.value=C;const le=[{toastId:n.toast.id,height:C,position:n.toast.position},...n.heights];r("update:heights",le)}),zo(()=>{b.value&&r("removeToast",n.toast)}),Bn(C=>{if(n.toast.promise&&N.value==="loading"||n.toast.duration===1/0||n.toast.type==="loading")return;let le;const Q=()=>{if(q.value<W.value){const Ie=new Date().getTime()-W.value;f.value=f.value-Ie}q.value=new Date().getTime()},de=()=>{f.value!==1/0&&(W.value=new Date().getTime(),le=setTimeout(()=>{n.toast.onAutoClose?.(n.toast),je()},f.value))};n.expanded||n.interacting||ze.value?Q():de(),C(()=>{clearTimeout(le)})}),on(()=>n.toast.delete,C=>{C!==void 0&&C&&(je(),n.toast.onDismiss?.(n.toast))},{deep:!0});function at(){l.value=!1,s.value=null,X.value=null}return(C,le)=>(O(),j("li",{tabindex:"0",ref_key:"toastRef",ref:b,class:At(g(Gr)(n.class,I.value,C.classes?.toast,C.toast.classes?.toast,C.classes?.[N.value],C.toast?.classes?.[N.value])),"data-sonner-toast":"","data-rich-colors":C.toast.richColors??C.defaultRichColors,"data-styled":!(C.toast.component||C.toast?.unstyled||C.unstyled),"data-mounted":a.value,"data-promise":!!C.toast.promise,"data-swiped":u.value,"data-removed":o.value,"data-visible":S.value,"data-y-position":he.value,"data-x-position":Ae.value,"data-index":C.index,"data-front":x.value,"data-swiping":l.value,"data-dismissible":z.value,"data-type":N.value,"data-invert":C.toast.invert||C.invert,"data-swipe-out":c.value,"data-swipe-direction":i.value,"data-expanded":!!(C.expanded||C.expandByDefault&&a.value),"data-testid":C.toast.testId,style:Ja({"--index":C.index,"--toasts-before":C.index,"--z-index":C.toasts.length-C.index,"--offset":`${o.value?p.value:M.value}px`,"--initial-height":C.expandByDefault?"auto":`${m.value}px`,...C.style,...n.toast.style}),onDragend:at,onPointerdown:ot,onPointerup:Ft,onPointermove:st},[G.value&&!C.toast.component&&N.value!=="loading"?(O(),j("button",{key:0,"aria-label":C.closeButtonAriaLabel||"Close toast","data-disabled":ie.value,"data-close-button":"true","data-close-button-position":C.closeButtonPosition,class:At(g(Gr)(C.classes?.closeButton,C.toast?.classes?.closeButton)),onClick:rt},[C.icons?.close?(O(),xe(js(C.icons?.close),{key:0})):Ve(C.$slots,"close-icon",{key:1})],10,kI)):pe("v-if",!0),C.toast.component?(O(),xe(js(C.toast.component),It({key:1},C.toast.componentProps,{onCloseToast:rt,isPaused:C.$props.expanded||C.$props.interacting||g(ze)}),null,16,["isPaused"])):(O(),j(lt,{key:2},[N.value!=="default"||C.toast.icon||C.toast.promise?(O(),j("div",{key:0,"data-icon":"",class:At(g(Gr)(C.classes?.icon,C.toast?.classes?.icon))},[C.toast.icon?(O(),xe(js(C.toast.icon),{key:0})):(O(),j(lt,{key:1},[N.value==="loading"?Ve(C.$slots,"loading-icon",{key:0}):N.value==="success"?Ve(C.$slots,"success-icon",{key:1}):N.value==="error"?Ve(C.$slots,"error-icon",{key:2}):N.value==="warning"?Ve(C.$slots,"warning-icon",{key:3}):N.value==="info"?Ve(C.$slots,"info-icon",{key:4}):pe("v-if",!0)],64))],2)):pe("v-if",!0),k("div",{"data-content":"",class:At(g(Gr)(C.classes?.content,C.toast?.classes?.content))},[k("div",{"data-title":"",class:At(g(Gr)(C.classes?.title,C.toast.classes?.title))},[se.value?(O(),xe(js(C.toast.title),On(It({key:0},C.toast.componentProps)),null,16)):(O(),j(lt,{key:1},[fe(K(C.toast.title),1)],64))],2),C.toast.description?(O(),j("div",{key:0,"data-description":"",class:At(g(Gr)(C.descriptionClass,E.value,C.classes?.description,C.toast.classes?.description))},[re.value?(O(),xe(js(C.toast.description),On(It({key:0},C.toast.componentProps)),null,16)):(O(),j(lt,{key:1},[fe(K(C.toast.description),1)],64))],2)):pe("v-if",!0)],2),C.toast.cancel?(O(),j("button",{key:1,style:Ja(C.toast.cancelButtonStyle||C.cancelButtonStyle),class:At(g(Gr)(C.classes?.cancelButton,C.toast.classes?.cancelButton)),"data-button":"","data-cancel":"",onClick:le[0]||(le[0]=Q=>{g(Wa)(C.toast.cancel)&&z.value&&(C.toast.cancel.onClick?.(Q),je())})},K(g(Wa)(C.toast.cancel)?C.toast.cancel?.label:C.toast.cancel),7)):pe("v-if",!0),C.toast.action?(O(),j("button",{key:2,style:Ja(C.toast.actionButtonStyle||C.actionButtonStyle),class:At(g(Gr)(C.classes?.actionButton,C.toast.classes?.actionButton)),"data-button":"","data-action":"",onClick:le[1]||(le[1]=Q=>{g(Wa)(C.toast.action)&&(C.toast.action.onClick?.(Q),!Q.defaultPrevented&&je())})},K(g(Wa)(C.toast.action)?C.toast.action?.label:C.toast.action),7)):pe("v-if",!0)],64))],46,xI))}}),EI=_I,ga=(e,t)=>{const n=e.__vccOpts||e;for(const[r,s]of t)n[r]=s;return n};const AI={},TI={xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stoke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"};function II(e,t){return O(),j("svg",TI,t[0]||(t[0]=[k("line",{x1:"18",y1:"6",x2:"6",y2:"18"},null,-1),k("line",{x1:"6",y1:"6",x2:"18",y2:"18"},null,-1)]))}var RI=ga(AI,[["render",II]]);const CI=["data-visible"],OI={class:"sonner-spinner"};var MI=Re({__name:"Loader",props:{visible:{type:Boolean}},setup(e){const t=Array(12).fill(0);return(n,r)=>(O(),j("div",{class:"sonner-loading-wrapper","data-visible":n.visible},[k("div",OI,[(O(!0),j(lt,null,Ht(g(t),s=>(O(),j("div",{key:`spinner-bar-${s}`,class:"sonner-loading-bar"}))),128))])],8,CI))}}),NI=MI;const zI={},$I={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"};function DI(e,t){return O(),j("svg",$I,t[0]||(t[0]=[k("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z","clip-rule":"evenodd"},null,-1)]))}var PI=ga(zI,[["render",DI]]);const BI={},LI={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"};function FI(e,t){return O(),j("svg",LI,t[0]||(t[0]=[k("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z","clip-rule":"evenodd"},null,-1)]))}var UI=ga(BI,[["render",FI]]);const qI={},HI={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"};function VI(e,t){return O(),j("svg",HI,t[0]||(t[0]=[k("path",{"fill-rule":"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z","clip-rule":"evenodd"},null,-1)]))}var jI=ga(qI,[["render",VI]]);const GI={},ZI={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"};function KI(e,t){return O(),j("svg",ZI,t[0]||(t[0]=[k("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z","clip-rule":"evenodd"},null,-1)]))}var WI=ga(GI,[["render",KI]]);const QI=["aria-label"],JI=["data-sonner-theme","dir","data-theme","data-rich-colors","data-y-position","data-x-position"],YI=typeof window<"u"&&typeof document<"u";function XI(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}var eR=Re({name:"Toaster",inheritAttrs:!1,__name:"Toaster",props:{id:{},invert:{type:Boolean,default:!1},theme:{default:"light"},position:{default:"bottom-right"},closeButtonPosition:{default:"top-left"},hotkey:{default:()=>["altKey","KeyT"]},richColors:{type:Boolean,default:!1},expand:{type:Boolean,default:!1},duration:{},gap:{default:vI},visibleToasts:{default:mI},closeButton:{type:Boolean,default:!1},toastOptions:{default:()=>({})},class:{default:""},style:{},offset:{default:Qg},mobileOffset:{default:Jg},dir:{default:"auto"},swipeDirections:{},icons:{},containerAriaLabel:{default:"Notifications"}},setup(e){const t=e,n=Av(),r=Oe([]),s=Se(()=>t.id?r.value.filter(P=>P.toasterId===t.id):r.value.filter(P=>!P.toasterId));function i(P,W){return s.value.filter(q=>!q.position&&W===0||q.position===P)}const a=Se(()=>{const P=s.value.filter(W=>W.position).map(W=>W.position);return P.length>0?Array.from(new Set([t.position].concat(P))):[t.position]}),o=Se(()=>{const P={};return a.value.forEach(W=>{P[W]=r.value.filter(q=>q.position===W)}),P}),l=Oe([]),c=Oe({}),u=Oe(!1);Bn(()=>{a.value.forEach(P=>{P in c.value||(c.value[P]=!1)})});const p=Oe(t.theme!=="system"?t.theme:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),m=Oe(null),f=Oe(null),y=Oe(!1),b=t.hotkey.join("+").replace(/Key/g,"").replace(/Digit/g,"");function x(P){r.value.find(W=>W.id===P.id)?.delete||yn.dismiss(P.id),r.value=r.value.filter(({id:W})=>W!==P.id),setTimeout(()=>{r.value.find(W=>W.id===P.id)||(l.value=l.value.filter(W=>W.toastId!==P.id))},Yg+50)}function S(P){y.value&&!P.currentTarget?.contains?.(P.relatedTarget)&&(y.value=!1,f.value&&(f.value.focus({preventScroll:!0}),f.value=null))}function N(P){P.target instanceof HTMLElement&&P.target.dataset.dismissible==="false"||y.value||(y.value=!0,f.value=P.relatedTarget)}function z(P){P.target&&P.target instanceof HTMLElement&&P.target.dataset.dismissible==="false"||(u.value=!0)}Bn(P=>{const W=yn.subscribe(q=>{if(q.dismiss){requestAnimationFrame(()=>{r.value=r.value.map(X=>X.id===q.id?{...X,delete:!0}:X)});return}ur(()=>{const X=r.value.findIndex(ne=>ne.id===q.id);X!==-1?r.value=[...r.value.slice(0,X),{...r.value[X],...q},...r.value.slice(X+1)]:r.value=[q,...r.value]})});P(W)}),Bn(P=>{if(typeof window>"u")return;if(t.theme!=="system"){p.value=t.theme;return}const W=window.matchMedia("(prefers-color-scheme: dark)"),q=ne=>{p.value=ne?"dark":"light"};q(W.matches);const X=ne=>{q(ne.matches)};try{W.addEventListener("change",X)}catch{W.addListener(X)}P(()=>{try{W.removeEventListener("change",X)}catch{W.removeListener(X)}})}),Bn(()=>{m.value&&f.value&&(f.value.focus({preventScroll:!0}),f.value=null,y.value=!1)}),Bn(()=>{r.value.length<=1&&Object.keys(c.value).forEach(P=>{c.value[P]=!1})}),Bn(P=>{function W(q){const X=t.hotkey.every(Ae=>q[Ae]||q.code===Ae),ne=Array.isArray(m.value)?m.value[0]:m.value;X&&(a.value.forEach(Ae=>{c.value[Ae]=!0}),ne?.focus());const he=document.activeElement===m.value||ne?.contains(document.activeElement);q.code==="Escape"&&he&&a.value.forEach(Ae=>{c.value[Ae]=!1})}YI&&(document.addEventListener("keydown",W),P(()=>{document.removeEventListener("keydown",W)}))});function I(P){const W=P.currentTarget,q=W.getAttribute("data-y-position")+"-"+W.getAttribute("data-x-position");c.value[q]=!0}function E(P){if(!u.value){const W=P.currentTarget,q=W.getAttribute("data-y-position")+"-"+W.getAttribute("data-x-position");c.value[q]=!1}}function _(){Object.keys(c.value).forEach(P=>{c.value[P]=!1})}function L(){u.value=!1}function M(P){l.value=P}function G(P){const W=l.value.findIndex(q=>q.toastId===P.toastId);if(W!==-1)l.value[W]=P;else{const q=l.value.findIndex(X=>X.position===P.position);q!==-1?l.value.splice(q,0,P):l.value.unshift(P)}}return(P,W)=>(O(),j(lt,null,[pe(" Remove item from normal navigation flow, only available via hotkey "),k("section",{"aria-label":`${P.containerAriaLabel} ${g(b)}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false"},[(O(!0),j(lt,null,Ht(a.value,(q,X)=>(O(),j("ol",It({key:q,ref_for:!0,ref_key:"listRef",ref:m,"data-sonner-toaster":"","data-sonner-theme":p.value,class:t.class,dir:P.dir==="auto"?XI():P.dir,tabIndex:-1,"data-theme":P.theme,"data-rich-colors":P.richColors,"data-y-position":q.split("-")[0],"data-x-position":q.split("-")[1],style:{"--front-toast-height":`${l.value[0]?.height||0}px`,"--width":`${g(gI)}px`,"--gap":`${P.gap}px`,...P.style,...g(n).style,...g(SI)(P.offset,P.mobileOffset)}},{ref_for:!0},P.$attrs,{onBlur:S,onFocus:N,onMouseenter:I,onMousemove:I,onMouseleave:E,onDragend:_,onPointerdown:z,onPointerup:L}),[(O(!0),j(lt,null,Ht(i(q,X),(ne,he)=>(O(),xe(EI,{key:ne.id,heights:l.value,icons:P.icons,index:he,toast:ne,defaultRichColors:P.richColors,duration:P.toastOptions?.duration??P.duration,class:At(P.toastOptions?.class??""),descriptionClass:P.toastOptions?.descriptionClass,invert:P.invert,visibleToasts:P.visibleToasts,closeButton:P.toastOptions?.closeButton??P.closeButton,interacting:u.value,position:q,closeButtonPosition:P.toastOptions?.closeButtonPosition??P.closeButtonPosition,style:Ja(P.toastOptions?.style),unstyled:P.toastOptions?.unstyled,classes:P.toastOptions?.classes,cancelButtonStyle:P.toastOptions?.cancelButtonStyle,actionButtonStyle:P.toastOptions?.actionButtonStyle,"close-button-aria-label":P.toastOptions?.closeButtonAriaLabel,toasts:o.value[q],expandByDefault:P.expand,gap:P.gap,expanded:c.value[q]||!1,swipeDirections:t.swipeDirections,"onUpdate:heights":M,"onUpdate:height":G,onRemoveToast:x},{"close-icon":D(()=>[Ve(P.$slots,"close-icon",{},()=>[T(RI)])]),"loading-icon":D(()=>[Ve(P.$slots,"loading-icon",{},()=>[T(NI,{visible:ne.type==="loading"},null,8,["visible"])])]),"success-icon":D(()=>[Ve(P.$slots,"success-icon",{},()=>[T(PI)])]),"error-icon":D(()=>[Ve(P.$slots,"error-icon",{},()=>[T(WI)])]),"warning-icon":D(()=>[Ve(P.$slots,"warning-icon",{},()=>[T(jI)])]),"info-icon":D(()=>[Ve(P.$slots,"info-icon",{},()=>[T(UI)])]),_:2},1032,["heights","icons","index","toast","defaultRichColors","duration","class","descriptionClass","invert","visibleToasts","closeButton","interacting","position","closeButtonPosition","style","unstyled","classes","cancelButtonStyle","actionButtonStyle","close-button-aria-label","toasts","expandByDefault","gap","expanded","swipeDirections"]))),128))],16,JI))),128))],8,QI)],2112))}}),tR=eR;const nR=Re({__name:"Sonner",props:{id:{},invert:{type:Boolean},theme:{},position:{},closeButtonPosition:{},hotkey:{},richColors:{type:Boolean},expand:{type:Boolean},duration:{},gap:{},visibleToasts:{},closeButton:{type:Boolean},toastOptions:{},class:{},style:{},offset:{},mobileOffset:{},dir:{},swipeDirections:{},icons:{},containerAriaLabel:{}},setup(e){const t=e,n=Vt(t,"toastOptions"),r=Oe("light");function s(){r.value=document.documentElement.classList.contains("dark")?"dark":"light"}return s(),Tv(document.documentElement,s,{attributes:!0,attributeFilter:["class","data-theme"]}),(i,a)=>(O(),xe(g(tR),It({class:"toaster group","toast-options":{unstyled:!0,classes:{toast:"task-handoff-toast",title:"task-handoff-toast-title",description:"task-handoff-toast-description",icon:"task-handoff-toast-icon",closeButton:"task-handoff-toast-close",actionButton:"task-handoff-toast-action",cancelButton:"task-handoff-toast-cancel",success:"is-success",error:"is-error",warning:"is-warning",info:"is-info"}}},g(n),{theme:t.theme??r.value}),{"success-icon":D(()=>[T(g(xy),{class:"size-4"})]),"info-icon":D(()=>[T(g(Oy),{class:"size-4"})]),"warning-icon":D(()=>[T(g(Wy),{class:"size-4"})]),"error-icon":D(()=>[T(g(wy),{class:"size-4"})]),"loading-icon":D(()=>[k("div",null,[T(g(Ny),{class:"size-4 animate-spin"})])]),"close-icon":D(()=>[T(g(Ms),{class:"size-4"})]),_:1},16,["theme"]))}}),rR=Re({__name:"App",setup(e){return(t,n)=>(O(),j(lt,null,[T(lI),T(g(nR),{position:"top-right","rich-colors":""})],64))}});const Ws=typeof document<"u";function Xg(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function sR(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&Xg(e.default)}const gt=Object.assign;function Jl(e,t){const n={};for(const r in t){const s=t[r];n[r]=Kn(s)?s.map(e):e(s)}return n}const Ki=()=>{},Kn=Array.isArray;function ah(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}const e4=/#/g,iR=/&/g,aR=/\//g,oR=/=/g,lR=/\?/g,t4=/\+/g,cR=/%5B/g,uR=/%5D/g,n4=/%5E/g,dR=/%60/g,r4=/%7B/g,fR=/%7C/g,s4=/%7D/g,hR=/%20/g;function Eu(e){return e==null?"":encodeURI(""+e).replace(fR,"|").replace(cR,"[").replace(uR,"]")}function pR(e){return Eu(e).replace(r4,"{").replace(s4,"}").replace(n4,"^")}function s0(e){return Eu(e).replace(t4,"%2B").replace(hR,"+").replace(e4,"%23").replace(iR,"%26").replace(dR,"`").replace(r4,"{").replace(s4,"}").replace(n4,"^")}function mR(e){return s0(e).replace(oR,"%3D")}function gR(e){return Eu(e).replace(e4,"%23").replace(lR,"%3F")}function vR(e){return gR(e).replace(aR,"%2F")}function ca(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const bR=/\/$/,yR=e=>e.replace(bR,"");function Yl(e,t,n="/"){let r,s={},i="",a="";const o=t.indexOf("#");let l=t.indexOf("?");return l=o>=0&&l>o?-1:l,l>=0&&(r=t.slice(0,l),i=t.slice(l,o>0?o:t.length),s=e(i.slice(1))),o>=0&&(r=r||t.slice(0,o),a=t.slice(o,t.length)),r=kR(r??t,n),{fullPath:r+i+a,path:r,query:s,hash:ca(a)}}function wR(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function oh(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function SR(e,t,n){const r=t.matched.length-1,s=n.matched.length-1;return r>-1&&r===s&&ci(t.matched[r],n.matched[s])&&i4(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function ci(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function i4(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!xR(e[n],t[n]))return!1;return!0}function xR(e,t){return Kn(e)?lh(e,t):Kn(t)?lh(t,e):e?.valueOf()===t?.valueOf()}function lh(e,t){return Kn(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function kR(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),r=e.split("/"),s=r[r.length-1];(s===".."||s===".")&&r.push("");let i=n.length-1,a,o;for(a=0;a<r.length;a++)if(o=r[a],o!==".")if(o==="..")i>1&&i--;else break;return n.slice(0,i).join("/")+"/"+r.slice(a).join("/")}const Zr={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let i0=(function(e){return e.pop="pop",e.push="push",e})({}),Xl=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function _R(e){if(!e)if(Ws){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),yR(e)}const ER=/^[^#]+#/;function AR(e,t){return e.replace(ER,"#")+t}function TR(e,t){const n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}const ll=()=>({left:window.scrollX,top:window.scrollY});function IR(e){let t;if("el"in e){const n=e.el,r=typeof n=="string"&&n.startsWith("#"),s=typeof n=="string"?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!s)return;t=TR(s,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function ch(e,t){return(history.state?history.state.position-t:-1)+e}const a0=new Map;function RR(e,t){a0.set(e,t)}function CR(e){const t=a0.get(e);return a0.delete(e),t}function OR(e){return typeof e=="string"||e&&typeof e=="object"}function a4(e){return typeof e=="string"||typeof e=="symbol"}let Lt=(function(e){return e[e.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",e[e.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",e[e.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",e[e.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",e[e.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",e})({});const o4=Symbol("");Lt.MATCHER_NOT_FOUND+"",Lt.NAVIGATION_GUARD_REDIRECT+"",Lt.NAVIGATION_ABORTED+"",Lt.NAVIGATION_CANCELLED+"",Lt.NAVIGATION_DUPLICATED+"";function ui(e,t){return gt(new Error,{type:e,[o4]:!0},t)}function xr(e,t){return e instanceof Error&&o4 in e&&(t==null||!!(e.type&t))}const MR=["params","query","hash"];function NR(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of MR)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function zR(e){const t={};if(e===""||e==="?")return t;const n=(e[0]==="?"?e.slice(1):e).split("&");for(let r=0;r<n.length;++r){const s=n[r].replace(t4," "),i=s.indexOf("="),a=ca(i<0?s:s.slice(0,i)),o=i<0?null:ca(s.slice(i+1));if(a in t){let l=t[a];Kn(l)||(l=t[a]=[l]),l.push(o)}else t[a]=o}return t}function uh(e){let t="";for(let n in e){const r=e[n];if(n=mR(n),r==null){r!==void 0&&(t+=(t.length?"&":"")+n);continue}(Kn(r)?r.map(s=>s&&s0(s)):[r&&s0(r)]).forEach(s=>{s!==void 0&&(t+=(t.length?"&":"")+n,s!=null&&(t+="="+s))})}return t}function $R(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=Kn(r)?r.map(s=>s==null?null:""+s):r==null?r:""+r)}return t}const DR=Symbol(""),dh=Symbol(""),Au=Symbol(""),l4=Symbol(""),o0=Symbol("");function zi(){let e=[];function t(r){return e.push(r),()=>{const s=e.indexOf(r);s>-1&&e.splice(s,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function Qr(e,t,n,r,s,i=a=>a()){const a=r&&(r.enterCallbacks[s]=r.enterCallbacks[s]||[]);return()=>new Promise((o,l)=>{const c=m=>{m===!1?l(ui(Lt.NAVIGATION_ABORTED,{from:n,to:t})):m instanceof Error?l(m):OR(m)?l(ui(Lt.NAVIGATION_GUARD_REDIRECT,{from:t,to:m})):(a&&r.enterCallbacks[s]===a&&typeof m=="function"&&a.push(m),o())},u=i(()=>e.call(r&&r.instances[s],t,n,c));let p=Promise.resolve(u);e.length<3&&(p=p.then(c)),p.catch(m=>l(m))})}function ec(e,t,n,r,s=i=>i()){const i=[];for(const a of e)for(const o in a.components){let l=a.components[o];if(!(t!=="beforeRouteEnter"&&!a.instances[o]))if(Xg(l)){const c=(l.__vccOpts||l)[t];c&&i.push(Qr(c,n,r,a,o,s))}else{let c=l();i.push(()=>c.then(u=>{if(!u)throw new Error(`Couldn't resolve component "${o}" at "${a.path}"`);const p=sR(u)?u.default:u;a.mods[o]=u,a.components[o]=p;const m=(p.__vccOpts||p)[t];return m&&Qr(m,n,r,a,o,s)()}))}}return i}function PR(e,t){const n=[],r=[],s=[],i=Math.max(t.matched.length,e.matched.length);for(let a=0;a<i;a++){const o=t.matched[a];o&&(e.matched.find(c=>ci(c,o))?r.push(o):n.push(o));const l=e.matched[a];l&&(t.matched.find(c=>ci(c,l))||s.push(l))}return[n,r,s]}let BR=()=>location.protocol+"//"+location.host;function c4(e,t){const{pathname:n,search:r,hash:s}=t,i=e.indexOf("#");if(i>-1){let a=s.includes(e.slice(i))?e.slice(i).length:1,o=s.slice(a);return o[0]!=="/"&&(o="/"+o),oh(o,"")}return oh(n,e)+r+s}function LR(e,t,n,r){let s=[],i=[],a=null;const o=({state:m})=>{const f=c4(e,location),y=n.value,b=t.value;let x=0;if(m){if(n.value=f,t.value=m,a&&a===y){a=null;return}x=b?m.position-b.position:0}else r(f);s.forEach(S=>{S(n.value,y,{delta:x,type:i0.pop,direction:x?x>0?Xl.forward:Xl.back:Xl.unknown})})};function l(){a=n.value}function c(m){s.push(m);const f=()=>{const y=s.indexOf(m);y>-1&&s.splice(y,1)};return i.push(f),f}function u(){if(document.visibilityState==="hidden"){const{history:m}=window;if(!m.state)return;m.replaceState(gt({},m.state,{scroll:ll()}),"")}}function p(){for(const m of i)m();i=[],window.removeEventListener("popstate",o),window.removeEventListener("pagehide",u),document.removeEventListener("visibilitychange",u)}return window.addEventListener("popstate",o),window.addEventListener("pagehide",u),document.addEventListener("visibilitychange",u),{pauseListeners:l,listen:c,destroy:p}}function fh(e,t,n,r=!1,s=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:s?ll():null}}function FR(e){const{history:t,location:n}=window,r={value:c4(e,n)},s={value:t.state};s.value||i(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function i(l,c,u){const p=e.indexOf("#"),m=p>-1?(n.host&&document.querySelector("base")?e:e.slice(p))+l:BR()+e+l;try{t[u?"replaceState":"pushState"](c,"",m),s.value=c}catch(f){console.error(f),n[u?"replace":"assign"](m)}}function a(l,c){i(l,gt({},t.state,fh(s.value.back,l,s.value.forward,!0),c,{position:s.value.position}),!0),r.value=l}function o(l,c){const u=gt({},s.value,t.state,{forward:l,scroll:ll()});i(u.current,u,!0),i(l,gt({},fh(r.value,l,null),{position:u.position+1},c),!1),r.value=l}return{location:r,state:s,push:o,replace:a}}function UR(e){e=_R(e);const t=FR(e),n=LR(e,t.state,t.location,t.replace);function r(i,a=!0){a||n.pauseListeners(),history.go(i)}const s=gt({location:"",base:e,go:r,createHref:AR.bind(null,e)},t,n);return Object.defineProperty(s,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(s,"state",{enumerable:!0,get:()=>t.state.value}),s}let Rs=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var Yt=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e})(Yt||{});const qR={type:Rs.Static,value:""},HR=/[a-zA-Z0-9_]/;function VR(e){if(!e)return[[]];if(e==="/")return[[qR]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(f){throw new Error(`ERR (${n})/"${c}": ${f}`)}let n=Yt.Static,r=n;const s=[];let i;function a(){i&&s.push(i),i=[]}let o=0,l,c="",u="";function p(){c&&(n===Yt.Static?i.push({type:Rs.Static,value:c}):n===Yt.Param||n===Yt.ParamRegExp||n===Yt.ParamRegExpEnd?(i.length>1&&(l==="*"||l==="+")&&t(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),i.push({type:Rs.Param,value:c,regexp:u,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):t("Invalid state to consume buffer"),c="")}function m(){c+=l}for(;o<e.length;){if(l=e[o++],l==="\\"&&n!==Yt.ParamRegExp){r=n,n=Yt.EscapeNext;continue}switch(n){case Yt.Static:l==="/"?(c&&p(),a()):l===":"?(p(),n=Yt.Param):m();break;case Yt.EscapeNext:m(),n=r;break;case Yt.Param:l==="("?n=Yt.ParamRegExp:HR.test(l)?m():(p(),n=Yt.Static,l!=="*"&&l!=="?"&&l!=="+"&&o--);break;case Yt.ParamRegExp:l===")"?u[u.length-1]=="\\"?u=u.slice(0,-1)+l:n=Yt.ParamRegExpEnd:u+=l;break;case Yt.ParamRegExpEnd:p(),n=Yt.Static,l!=="*"&&l!=="?"&&l!=="+"&&o--,u="";break;default:t("Unknown state");break}}return n===Yt.ParamRegExp&&t(`Unfinished custom RegExp for param "${c}"`),p(),a(),s}const hh="[^/]+?",jR={sensitive:!1,strict:!1,start:!0,end:!0};var hn=(function(e){return e[e._multiplier=10]="_multiplier",e[e.Root=90]="Root",e[e.Segment=40]="Segment",e[e.SubSegment=30]="SubSegment",e[e.Static=40]="Static",e[e.Dynamic=20]="Dynamic",e[e.BonusCustomRegExp=10]="BonusCustomRegExp",e[e.BonusWildcard=-50]="BonusWildcard",e[e.BonusRepeatable=-20]="BonusRepeatable",e[e.BonusOptional=-8]="BonusOptional",e[e.BonusStrict=.7000000000000001]="BonusStrict",e[e.BonusCaseSensitive=.25]="BonusCaseSensitive",e})(hn||{});const GR=/[.+*?^${}()[\]/\\]/g;function ZR(e,t){const n=gt({},jR,t),r=[];let s=n.start?"^":"";const i=[];for(const c of e){const u=c.length?[]:[hn.Root];n.strict&&!c.length&&(s+="/");for(let p=0;p<c.length;p++){const m=c[p];let f=hn.Segment+(n.sensitive?hn.BonusCaseSensitive:0);if(m.type===Rs.Static)p||(s+="/"),s+=m.value.replace(GR,"\\$&"),f+=hn.Static;else if(m.type===Rs.Param){const{value:y,repeatable:b,optional:x,regexp:S}=m;i.push({name:y,repeatable:b,optional:x});const N=S||hh;if(N!==hh){f+=hn.BonusCustomRegExp;try{`${N}`}catch(I){throw new Error(`Invalid custom RegExp for param "${y}" (${N}): `+I.message)}}let z=b?`((?:${N})(?:/(?:${N}))*)`:`(${N})`;p||(z=x&&c.length<2?`(?:/${z})`:"/"+z),x&&(z+="?"),s+=z,f+=hn.Dynamic,x&&(f+=hn.BonusOptional),b&&(f+=hn.BonusRepeatable),N===".*"&&(f+=hn.BonusWildcard)}u.push(f)}r.push(u)}if(n.strict&&n.end){const c=r.length-1;r[c][r[c].length-1]+=hn.BonusStrict}n.strict||(s+="/?"),n.end?s+="$":n.strict&&!s.endsWith("/")&&(s+="(?:/|$)");const a=new RegExp(s,n.sensitive?"":"i");function o(c){const u=c.match(a),p={};if(!u)return null;for(let m=1;m<u.length;m++){const f=u[m]||"",y=i[m-1];p[y.name]=f&&y.repeatable?f.split("/"):f}return p}function l(c){let u="",p=!1;for(const m of e){(!p||!u.endsWith("/"))&&(u+="/"),p=!1;for(const f of m)if(f.type===Rs.Static)u+=f.value;else if(f.type===Rs.Param){const{value:y,repeatable:b,optional:x}=f,S=y in c?c[y]:"";if(Kn(S)&&!b)throw new Error(`Provided param "${y}" is an array but it is not repeatable (* or + modifiers)`);const N=Kn(S)?S.join("/"):S;if(!N)if(x)m.length<2&&(u.endsWith("/")?u=u.slice(0,-1):p=!0);else throw new Error(`Missing required param "${y}"`);u+=N}}return u||"/"}return{re:a,score:r,keys:i,parse:o,stringify:l}}function KR(e,t){let n=0;for(;n<e.length&&n<t.length;){const r=t[n]-e[n];if(r)return r;n++}return e.length<t.length?e.length===1&&e[0]===hn.Static+hn.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===hn.Static+hn.Segment?1:-1:0}function u4(e,t){let n=0;const r=e.score,s=t.score;for(;n<r.length&&n<s.length;){const i=KR(r[n],s[n]);if(i)return i;n++}if(Math.abs(s.length-r.length)===1){if(ph(r))return 1;if(ph(s))return-1}return s.length-r.length}function ph(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const WR={strict:!1,end:!0,sensitive:!1};function QR(e,t,n){const r=ZR(VR(e.path),n),s=gt(r,{record:e,parent:t,children:[],alias:[]});return t&&!s.record.aliasOf==!t.record.aliasOf&&t.children.push(s),s}function JR(e,t){const n=[],r=new Map;t=ah(WR,t);function s(p){return r.get(p)}function i(p,m,f){const y=!f,b=gh(p);b.aliasOf=f&&f.record;const x=ah(t,p),S=[b];if("alias"in p){const I=typeof p.alias=="string"?[p.alias]:p.alias;for(const E of I)S.push(gh(gt({},b,{components:f?f.record.components:b.components,path:E,aliasOf:f?f.record:b})))}let N,z;for(const I of S){const{path:E}=I;if(m&&E[0]!=="/"){const _=m.record.path,L=_[_.length-1]==="/"?"":"/";I.path=m.record.path+(E&&L+E)}if(N=QR(I,m,x),f?f.alias.push(N):(z=z||N,z!==N&&z.alias.push(N),y&&p.name&&!vh(N)&&a(p.name)),d4(N)&&l(N),b.children){const _=b.children;for(let L=0;L<_.length;L++)i(_[L],N,f&&f.children[L])}f=f||N}return z?()=>{a(z)}:Ki}function a(p){if(a4(p)){const m=r.get(p);m&&(r.delete(p),n.splice(n.indexOf(m),1),m.children.forEach(a),m.alias.forEach(a))}else{const m=n.indexOf(p);m>-1&&(n.splice(m,1),p.record.name&&r.delete(p.record.name),p.children.forEach(a),p.alias.forEach(a))}}function o(){return n}function l(p){const m=eC(p,n);n.splice(m,0,p),p.record.name&&!vh(p)&&r.set(p.record.name,p)}function c(p,m){let f,y={},b,x;if("name"in p&&p.name){if(f=r.get(p.name),!f)throw ui(Lt.MATCHER_NOT_FOUND,{location:p});x=f.record.name,y=gt(mh(m.params,f.keys.filter(z=>!z.optional).concat(f.parent?f.parent.keys.filter(z=>z.optional):[]).map(z=>z.name)),p.params&&mh(p.params,f.keys.map(z=>z.name))),b=f.stringify(y)}else if(p.path!=null)b=p.path,f=n.find(z=>z.re.test(b)),f&&(y=f.parse(b),x=f.record.name);else{if(f=m.name?r.get(m.name):n.find(z=>z.re.test(m.path)),!f)throw ui(Lt.MATCHER_NOT_FOUND,{location:p,currentLocation:m});x=f.record.name,y=gt({},m.params,p.params),b=f.stringify(y)}const S=[];let N=f;for(;N;)S.unshift(N.record),N=N.parent;return{name:x,path:b,params:y,matched:S,meta:XR(S)}}e.forEach(p=>i(p));function u(){n.length=0,r.clear()}return{addRoute:i,resolve:c,removeRoute:a,clearRoutes:u,getRoutes:o,getRecordMatcher:s}}function mh(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function gh(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:YR(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function YR(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const r in e.components)t[r]=typeof n=="object"?n[r]:n;return t}function vh(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function XR(e){return e.reduce((t,n)=>gt(t,n.meta),{})}function eC(e,t){let n=0,r=t.length;for(;n!==r;){const i=n+r>>1;u4(e,t[i])<0?r=i:n=i+1}const s=tC(e);return s&&(r=t.lastIndexOf(s,r-1)),r}function tC(e){let t=e;for(;t=t.parent;)if(d4(t)&&u4(e,t)===0)return t}function d4({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function bh(e){const t=Cr(Au),n=Cr(l4),r=Se(()=>{const l=g(e.to);return t.resolve(l)}),s=Se(()=>{const{matched:l}=r.value,{length:c}=l,u=l[c-1],p=n.matched;if(!u||!p.length)return-1;const m=p.findIndex(ci.bind(null,u));if(m>-1)return m;const f=yh(l[c-2]);return c>1&&yh(u)===f&&p[p.length-1].path!==f?p.findIndex(ci.bind(null,l[c-2])):m}),i=Se(()=>s.value>-1&&aC(n.params,r.value.params)),a=Se(()=>s.value>-1&&s.value===n.matched.length-1&&i4(n.params,r.value.params));function o(l={}){if(iC(l)){const c=t[g(e.replace)?"replace":"push"](g(e.to)).catch(Ki);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>c),c}return Promise.resolve()}return{route:r,href:Se(()=>r.value.href),isActive:i,isExactActive:a,navigate:o}}function nC(e){return e.length===1?e[0]:e}const rC=Re({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:bh,setup(e,{slots:t}){const n=Xr(bh(e)),{options:r}=Cr(Au),s=Se(()=>({[wh(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[wh(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const i=t.default&&nC(t.default(n));return e.custom?i:Wi("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:s.value},i)}}}),sC=rC;function iC(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function aC(e,t){for(const n in t){const r=t[n],s=e[n];if(typeof r=="string"){if(r!==s)return!1}else if(!Kn(s)||s.length!==r.length||r.some((i,a)=>i.valueOf()!==s[a].valueOf()))return!1}return!0}function yh(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const wh=(e,t,n)=>e??t??n,oC=Re({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=Cr(o0),s=Se(()=>e.route||r.value),i=Cr(dh,0),a=Se(()=>{let c=g(i);const{matched:u}=s.value;let p;for(;(p=u[c])&&!p.components;)c++;return c}),o=Se(()=>s.value.matched[a.value]);Qa(dh,Se(()=>a.value+1)),Qa(DR,o),Qa(o0,s);const l=Oe();return on(()=>[l.value,o.value,e.name],([c,u,p],[m,f,y])=>{u&&(u.instances[p]=c,f&&f!==u&&c&&c===m&&(u.leaveGuards.size||(u.leaveGuards=f.leaveGuards),u.updateGuards.size||(u.updateGuards=f.updateGuards))),c&&u&&(!f||!ci(u,f)||!m)&&(u.enterCallbacks[p]||[]).forEach(b=>b(c))},{flush:"post"}),()=>{const c=s.value,u=e.name,p=o.value,m=p&&p.components[u];if(!m)return Sh(n.default,{Component:m,route:c});const f=p.props[u],y=f?f===!0?c.params:typeof f=="function"?f(c):f:null,x=Wi(m,gt({},y,t,{onVnodeUnmounted:S=>{S.component.isUnmounted&&(p.instances[u]=null)},ref:l}));return Sh(n.default,{Component:x,route:c})||x}}});function Sh(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const lC=oC;function cC(e){const t=JR(e.routes,e),n=e.parseQuery||zR,r=e.stringifyQuery||uh,s=e.history,i=zi(),a=zi(),o=zi(),l=Iv(Zr);let c=Zr;Ws&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=Jl.bind(null,C=>""+C),p=Jl.bind(null,vR),m=Jl.bind(null,ca);function f(C,le){let Q,de;return a4(C)?(Q=t.getRecordMatcher(C),de=le):de=C,t.addRoute(de,Q)}function y(C){const le=t.getRecordMatcher(C);le&&t.removeRoute(le)}function b(){return t.getRoutes().map(C=>C.record)}function x(C){return!!t.getRecordMatcher(C)}function S(C,le){if(le=gt({},le||l.value),typeof C=="string"){const Te=Yl(n,C,le.path),yt=t.resolve({path:Te.path},le),Ye=s.createHref(Te.fullPath);return gt(Te,yt,{params:m(yt.params),hash:ca(Te.hash),redirectedFrom:void 0,href:Ye})}let Q;if(C.path!=null)Q=gt({},C,{path:Yl(n,C.path,le.path).path});else{const Te=gt({},C.params);for(const yt in Te)Te[yt]==null&&delete Te[yt];Q=gt({},C,{params:p(Te)}),le.params=p(le.params)}const de=t.resolve(Q,le),Ie=C.hash||"";de.params=u(m(de.params));const Ge=wR(r,gt({},C,{hash:pR(Ie),path:de.path})),Le=s.createHref(Ge);return gt({fullPath:Ge,hash:Ie,query:r===uh?$R(C.query):C.query||{}},de,{redirectedFrom:void 0,href:Le})}function N(C){return typeof C=="string"?Yl(n,C,l.value.path):gt({},C)}function z(C,le){if(c!==C)return ui(Lt.NAVIGATION_CANCELLED,{from:le,to:C})}function I(C){return L(C)}function E(C){return I(gt(N(C),{replace:!0}))}function _(C,le){const Q=C.matched[C.matched.length-1];if(Q&&Q.redirect){const{redirect:de}=Q;let Ie=typeof de=="function"?de(C,le):de;return typeof Ie=="string"&&(Ie=Ie.includes("?")||Ie.includes("#")?Ie=N(Ie):{path:Ie},Ie.params={}),gt({query:C.query,hash:C.hash,params:Ie.path!=null?{}:C.params},Ie)}}function L(C,le){const Q=c=S(C),de=l.value,Ie=C.state,Ge=C.force,Le=C.replace===!0,Te=_(Q,de);if(Te)return L(gt(N(Te),{state:typeof Te=="object"?gt({},Ie,Te.state):Ie,force:Ge,replace:Le}),le||Q);const yt=Q;yt.redirectedFrom=le;let Ye;return!Ge&&SR(r,de,Q)&&(Ye=ui(Lt.NAVIGATION_DUPLICATED,{to:yt,from:de}),je(de,de,!0,!1)),(Ye?Promise.resolve(Ye):P(yt,de)).catch(Tt=>xr(Tt)?xr(Tt,Lt.NAVIGATION_GUARD_REDIRECT)?Tt:ie(Tt):re(Tt,yt,de)).then(Tt=>{if(Tt){if(xr(Tt,Lt.NAVIGATION_GUARD_REDIRECT))return L(gt({replace:Le},N(Tt.to),{state:typeof Tt.to=="object"?gt({},Ie,Tt.to.state):Ie,force:Ge}),le||yt)}else Tt=q(yt,de,!0,Le,Ie);return W(yt,de,Tt),Tt})}function M(C,le){const Q=z(C,le);return Q?Promise.reject(Q):Promise.resolve()}function G(C){const le=Ft.values().next().value;return le&&typeof le.runWithContext=="function"?le.runWithContext(C):C()}function P(C,le){let Q;const[de,Ie,Ge]=PR(C,le);Q=ec(de.reverse(),"beforeRouteLeave",C,le);for(const Te of de)Te.leaveGuards.forEach(yt=>{Q.push(Qr(yt,C,le))});const Le=M.bind(null,C,le);return Q.push(Le),at(Q).then(()=>{Q=[];for(const Te of i.list())Q.push(Qr(Te,C,le));return Q.push(Le),at(Q)}).then(()=>{Q=ec(Ie,"beforeRouteUpdate",C,le);for(const Te of Ie)Te.updateGuards.forEach(yt=>{Q.push(Qr(yt,C,le))});return Q.push(Le),at(Q)}).then(()=>{Q=[];for(const Te of Ge)if(Te.beforeEnter)if(Kn(Te.beforeEnter))for(const yt of Te.beforeEnter)Q.push(Qr(yt,C,le));else Q.push(Qr(Te.beforeEnter,C,le));return Q.push(Le),at(Q)}).then(()=>(C.matched.forEach(Te=>Te.enterCallbacks={}),Q=ec(Ge,"beforeRouteEnter",C,le,G),Q.push(Le),at(Q))).then(()=>{Q=[];for(const Te of a.list())Q.push(Qr(Te,C,le));return Q.push(Le),at(Q)}).catch(Te=>xr(Te,Lt.NAVIGATION_CANCELLED)?Te:Promise.reject(Te))}function W(C,le,Q){o.list().forEach(de=>G(()=>de(C,le,Q)))}function q(C,le,Q,de,Ie){const Ge=z(C,le);if(Ge)return Ge;const Le=le===Zr,Te=Ws?history.state:{};Q&&(de||Le?s.replace(C.fullPath,gt({scroll:Le&&Te&&Te.scroll},Ie)):s.push(C.fullPath,Ie)),l.value=C,je(C,le,Q,Le),ie()}let X;function ne(){X||(X=s.listen((C,le,Q)=>{if(!st.listening)return;const de=S(C),Ie=_(de,st.currentRoute.value);if(Ie){L(gt(Ie,{replace:!0,force:!0}),de).catch(Ki);return}c=de;const Ge=l.value;Ws&&RR(ch(Ge.fullPath,Q.delta),ll()),P(de,Ge).catch(Le=>xr(Le,Lt.NAVIGATION_ABORTED|Lt.NAVIGATION_CANCELLED)?Le:xr(Le,Lt.NAVIGATION_GUARD_REDIRECT)?(L(gt(N(Le.to),{force:!0}),de).then(Te=>{xr(Te,Lt.NAVIGATION_ABORTED|Lt.NAVIGATION_DUPLICATED)&&!Q.delta&&Q.type===i0.pop&&s.go(-1,!1)}).catch(Ki),Promise.reject()):(Q.delta&&s.go(-Q.delta,!1),re(Le,de,Ge))).then(Le=>{Le=Le||q(de,Ge,!1),Le&&(Q.delta&&!xr(Le,Lt.NAVIGATION_CANCELLED)?s.go(-Q.delta,!1):Q.type===i0.pop&&xr(Le,Lt.NAVIGATION_ABORTED|Lt.NAVIGATION_DUPLICATED)&&s.go(-1,!1)),W(de,Ge,Le)}).catch(Ki)}))}let he=zi(),Ae=zi(),se;function re(C,le,Q){ie(C);const de=Ae.list();return de.length?de.forEach(Ie=>Ie(C,le,Q)):console.error(C),Promise.reject(C)}function ze(){return se&&l.value!==Zr?Promise.resolve():new Promise((C,le)=>{he.add([C,le])})}function ie(C){return se||(se=!C,ne(),he.list().forEach(([le,Q])=>C?Q(C):le()),he.reset()),C}function je(C,le,Q,de){const{scrollBehavior:Ie}=e;if(!Ws||!Ie)return Promise.resolve();const Ge=!Q&&CR(ch(C.fullPath,0))||(de||!Q)&&history.state&&history.state.scroll||null;return ur().then(()=>Ie(C,le,Ge)).then(Le=>Le&&IR(Le)).catch(Le=>re(Le,C,le))}const rt=C=>s.go(C);let ot;const Ft=new Set,st={currentRoute:l,listening:!0,addRoute:f,removeRoute:y,clearRoutes:t.clearRoutes,hasRoute:x,getRoutes:b,resolve:S,options:e,push:I,replace:E,go:rt,back:()=>rt(-1),forward:()=>rt(1),beforeEach:i.add,beforeResolve:a.add,afterEach:o.add,onError:Ae.add,isReady:ze,install(C){C.component("RouterLink",sC),C.component("RouterView",lC),C.config.globalProperties.$router=st,Object.defineProperty(C.config.globalProperties,"$route",{enumerable:!0,get:()=>g(l)}),Ws&&!ot&&l.value===Zr&&(ot=!0,I(s.location).catch(de=>{}));const le={};for(const de in Zr)Object.defineProperty(le,de,{get:()=>l.value[de],enumerable:!0});C.provide(Au,st),C.provide(l4,Ih(le)),C.provide(o0,l);const Q=C.unmount;Ft.add(C),C.unmount=function(){Ft.delete(C),Ft.size<1&&(c=Zr,X&&X(),X=null,l.value=Zr,ot=!1,se=!1),Q()}}};function at(C){return C.reduce((le,Q)=>le.then(()=>G(Q)),Promise.resolve())}return st}const uC={class:"panel triggers-view"},dC={class:"triggers-head"},fC={class:"triggers-layout"},hC={class:"field-row"},pC={class:"field-row"},mC={key:0,class:"field-row"},gC={key:1,class:"field-row"},vC={key:2,class:"field-row"},bC={key:3,class:"field-row"},yC={class:"field-row"},wC={class:"field-row trigger-wide"},SC={key:0,class:"form-error"},xC={key:0,class:"trigger-list"},kC={class:"trigger-card-head"},_C={class:"trigger-title"},EC={class:"trigger-meta"},AC={class:"trigger-actions"},TC={class:"trigger-prompt"},IC={key:0,class:"form-error"},RC={key:1,class:"logs-empty"},CC={key:0,class:"trigger-run-list"},OC={key:0,class:"form-error"},MC={key:1,class:"logs-empty"},NC=Re({__name:"TriggersView",setup(e){const t=hs(),n=W2(),r=ip(),s=Oe(""),i=Xr({name:"",sourceType:"schedule",intervalMs:"3600000",roots:"/workspace",globs:"**/*",statuses:"idle,failed",aiSessionId:"",promptTemplate:"Please review the current context and continue with the next useful step."}),a=Se(()=>n.error.value instanceof Error?n.error.value.message:""),o=Se(()=>{const I=n.data.value;return I?I.deployments.map(E=>({deployment:E,config:I.configs.find(_=>_.configHash===E.configHash),runtime:I.runtime.find(_=>_.configHash===E.configHash&&(_.deploymentId||_.configHash)===(E.deploymentId||E.configHash))})).filter(E=>!!E.config):[]});function l(){return i.sourceType==="file-change"?{type:"file-change",roots:u(i.roots),globs:u(i.globs),debounceMs:1500}:i.sourceType==="ai-session"?{type:"ai-session",statuses:u(i.statuses)}:{type:"schedule",intervalMs:Math.max(1e3,Number(i.intervalMs)||36e5)}}function c(){if(!i.aiSessionId)throw new Error("Select an AI session target.");return{type:"ai-session",aiSessionId:i.aiSessionId}}function u(I){return I.split(",").map(E=>E.trim()).filter(Boolean)}async function p(){await t.invalidateQueries({queryKey:["triggers"]}),await t.invalidateQueries({queryKey:["status"]})}async function m(){s.value="";try{await Q2({name:i.name.trim()||"Untitled trigger",source:l(),action:{promptTemplate:i.promptTemplate},policy:{maxConcurrentRuns:1,whenBusy:"skip"},deployment:{origin:"controlled-instance",target:c()}}),i.name="",await p()}catch(I){s.value=I instanceof Error?I.message:String(I)}}async function f(I){await X2(I),await p()}async function y(I){await J2(I),await p()}async function b(I){await Y2(I),await p()}async function x(I){await eb(I),await p()}function S(I){return I.length>14?`${I.slice(0,10)}...`:I}function N(I){return`AI session ${I.aiSessionId}`}function z(I){const E=new Date(I);return Number.isNaN(E.getTime())?I:E.toLocaleString()}return(I,E)=>(O(),j("section",uC,[k("header",dC,[k("div",null,[E[8]||(E[8]=k("h1",null,"Triggers",-1)),k("p",null,K(g(n).data.value?.configs.length||0)+" configs · "+K(g(n).data.value?.deployments.length||0)+" deployments",1)])]),k("div",fC,[T(g(Tr),null,{default:D(()=>[T(g(Fi),null,{default:D(()=>[T(g(Ui),null,{default:D(()=>[...E[9]||(E[9]=[fe("Create Local Trigger",-1)])]),_:1}),T(g(Li),null,{default:D(()=>[...E[10]||(E[10]=[fe("Triggers send prompts directly to an AI session.",-1)])]),_:1})]),_:1}),T(g(An),{class:"trigger-form"},{default:D(()=>[k("label",hC,[E[11]||(E[11]=k("span",null,"Name",-1)),T(g(Et),{modelValue:i.name,"onUpdate:modelValue":E[0]||(E[0]=_=>i.name=_),placeholder:"Review changed files"},null,8,["modelValue"])]),k("label",pC,[E[15]||(E[15]=k("span",null,"Source",-1)),T(g(lo),{modelValue:i.sourceType,"onUpdate:modelValue":E[1]||(E[1]=_=>i.sourceType=_)},{default:D(()=>[T(g(uo),{class:"select-input"},{default:D(()=>[T(g(fo))]),_:1}),T(g(co),null,{default:D(()=>[T(g(Jr),{value:"schedule"},{default:D(()=>[...E[12]||(E[12]=[fe("schedule",-1)])]),_:1}),T(g(Jr),{value:"file-change"},{default:D(()=>[...E[13]||(E[13]=[fe("file-change",-1)])]),_:1}),T(g(Jr),{value:"ai-session"},{default:D(()=>[...E[14]||(E[14]=[fe("ai-session",-1)])]),_:1})]),_:1})]),_:1},8,["modelValue"])]),i.sourceType==="schedule"?(O(),j("label",mC,[E[16]||(E[16]=k("span",null,"Interval ms",-1)),T(g(Et),{modelValue:i.intervalMs,"onUpdate:modelValue":E[2]||(E[2]=_=>i.intervalMs=_),inputmode:"numeric"},null,8,["modelValue"])])):pe("",!0),i.sourceType==="file-change"?(O(),j("label",gC,[E[17]||(E[17]=k("span",null,"Roots",-1)),T(g(Et),{modelValue:i.roots,"onUpdate:modelValue":E[3]||(E[3]=_=>i.roots=_),placeholder:"/workspace"},null,8,["modelValue"])])):pe("",!0),i.sourceType==="file-change"?(O(),j("label",vC,[E[18]||(E[18]=k("span",null,"Globs",-1)),T(g(Et),{modelValue:i.globs,"onUpdate:modelValue":E[4]||(E[4]=_=>i.globs=_),placeholder:"**/*"},null,8,["modelValue"])])):pe("",!0),i.sourceType==="ai-session"?(O(),j("label",bC,[E[19]||(E[19]=k("span",null,"Status",-1)),T(g(Et),{modelValue:i.statuses,"onUpdate:modelValue":E[5]||(E[5]=_=>i.statuses=_),placeholder:"idle,failed"},null,8,["modelValue"])])):pe("",!0),k("label",yC,[E[20]||(E[20]=k("span",null,"AI session",-1)),T(g(lo),{modelValue:i.aiSessionId,"onUpdate:modelValue":E[6]||(E[6]=_=>i.aiSessionId=_)},{default:D(()=>[T(g(uo),{class:"select-input"},{default:D(()=>[T(g(fo),{placeholder:"Select a session"})]),_:1}),T(g(co),null,{default:D(()=>[(O(!0),j(lt,null,Ht(g(r).data.value?.sessions||[],_=>(O(),xe(g(Jr),{key:_.id,value:_.id},{default:D(()=>[fe(K(_.title||_.id)+" · "+K(_.agent),1)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["modelValue"])]),k("label",wC,[E[21]||(E[21]=k("span",null,"Prompt",-1)),T(g(or),{modelValue:i.promptTemplate,"onUpdate:modelValue":E[7]||(E[7]=_=>i.promptTemplate=_),rows:"8"},null,8,["modelValue"])])]),_:1}),T(g(S0),{class:"editor-actions"},{default:D(()=>[s.value?(O(),j("p",SC,K(s.value),1)):pe("",!0),T(g(nt),{size:"sm",disabled:!i.aiSessionId,onClick:m},{default:D(()=>[...E[22]||(E[22]=[fe("Create",-1)])]),_:1},8,["disabled"])]),_:1})]),_:1}),T(g(Tr),null,{default:D(()=>[T(g(Fi),null,{default:D(()=>[T(g(Ui),null,{default:D(()=>[...E[23]||(E[23]=[fe("Deployments",-1)])]),_:1}),T(g(Li),null,{default:D(()=>[fe(K(a.value||"Local and Control Plane applied triggers on this instance."),1)]),_:1})]),_:1}),T(g(An),null,{default:D(()=>[o.value.length?(O(),j("div",xC,[(O(!0),j(lt,null,Ht(o.value,_=>(O(),j("section",{key:_.deployment.deploymentId||_.config.configHash,class:"trigger-card"},[k("header",kC,[k("div",null,[k("div",_C,[fe(K(_.config.name)+" ",1),T(g(ts),{variant:"secondary"},{default:D(()=>[fe(K(_.config.source.type),1)]),_:2},1024),T(g(ts),null,{default:D(()=>[fe(K(_.deployment.origin),1)]),_:2},1024)]),k("div",EC,[k("span",null,K(S(_.config.configHash)),1),k("span",null,K(_.runtime?.status||(_.deployment.enabled?"idle":"disabled")),1),k("span",null,K(N(_.deployment.target)),1)])]),k("div",AC,[T(g(nt),{variant:"outline",size:"sm",onClick:L=>f(_.config.configHash)},{default:D(()=>[...E[24]||(E[24]=[fe("Run",-1)])]),_:1},8,["onClick"]),_.deployment.enabled?(O(),xe(g(nt),{key:0,variant:"outline",size:"sm",onClick:L=>b(_.config.configHash)},{default:D(()=>[...E[25]||(E[25]=[fe("Disable",-1)])]),_:1},8,["onClick"])):(O(),xe(g(nt),{key:1,variant:"outline",size:"sm",onClick:L=>y(_.config.configHash)},{default:D(()=>[...E[26]||(E[26]=[fe("Enable",-1)])]),_:1},8,["onClick"])),T(g(nt),{variant:"outline",size:"sm",onClick:L=>x(_.config.configHash)},{default:D(()=>[...E[27]||(E[27]=[fe("Delete",-1)])]),_:1},8,["onClick"])])]),k("pre",TC,K(_.config.action.promptTemplate),1),_.runtime?.lastError?(O(),j("p",IC,K(_.runtime.lastError),1)):pe("",!0)]))),128))])):(O(),j("p",RC,"No triggers yet."))]),_:1})]),_:1})]),T(g(Tr),null,{default:D(()=>[T(g(Fi),null,{default:D(()=>[T(g(Ui),null,{default:D(()=>[...E[28]||(E[28]=[fe("Recent Runs",-1)])]),_:1}),T(g(Li),null,{default:D(()=>[fe(K(g(n).data.value?.recentRuns.length||0)+" runs",1)]),_:1})]),_:1}),T(g(An),null,{default:D(()=>[g(n).data.value?.recentRuns.length?(O(),j("div",CC,[(O(!0),j(lt,null,Ht(g(n).data.value.recentRuns,_=>(O(),j("div",{key:_.id,class:"trigger-run-row"},[T(g(ts),{variant:_.status==="failed"?"destructive":"secondary"},{default:D(()=>[fe(K(_.status),1)]),_:2},1032,["variant"]),k("span",null,K(S(_.configHash)),1),k("span",null,K(_.eventType),1),k("span",null,K(z(_.startedAt)),1),_.error?(O(),j("span",OC,K(_.error),1)):pe("",!0)]))),128))])):(O(),j("p",MC,"No trigger runs yet."))]),_:1})]),_:1})]))}}),zC={class:"automation-status"},$C=Re({__name:"AutomationStatus",props:{session:{}},setup(e){const t=e,n=rb(t.session.id,t.session.status==="running"&&!!t.session.automation),r=Se(()=>n.isLoading.value?"checking":n.data.value?.ready?"ready":"not ready"),s=Se(()=>{const i=n.data.value;return i?i.ready?[i.browser,i.protocolVersion?`protocol ${i.protocolVersion}`:void 0].filter(Boolean).join(" · "):i.error?.message||i.endpoint:t.session.automation?.endpoint||""});return(i,a)=>(O(),j("div",zC,[T(g(ts),{variant:g(n).data.value?.ready?"default":"secondary"},{default:D(()=>[fe(K(r.value),1)]),_:1},8,["variant"]),k("span",null,K(s.value),1)]))}}),DC={class:"panel"},PC={class:"apps-layout"},BC={class:"catalog-content"},LC={class:"section-head"},FC={class:"catalog-head"},UC={class:"item-title"},qC={class:"item-meta"},HC={key:0},VC={class:"catalog-actions"},jC={class:"launch-form"},GC={key:0,class:"display-fields"},ZC={key:1,class:"form-error"},KC={class:"section-head sessions-head"},WC={class:"section-actions"},QC={class:"session-actions"},JC={key:0,class:"session-error"},YC={class:"session-metadata"},XC={key:0},eO={key:1},tO={key:2},nO={key:3},rO={key:4},sO={key:0},iO={key:1},aO={key:5},oO={key:6},lO={key:0},cO={key:1},uO={class:"sessions"},dO={key:0,class:"workspace-tabs"},fO={class:"workspace-tab-list"},hO=["onClick"],pO={class:"tab-kind"},mO=["onClick"],gO={key:0,class:"desktop-tab-toolbar"},vO={key:0,class:"segmented-control"},bO={class:"workspace-tab-panel"},yO=["src","title"],wO={key:2,class:"gui-session"},SO=["src","title"],xO={key:1,class:"logs-empty"},kO={key:4,class:"logs-empty"},_O={key:1,class:"logs-empty"},EO={key:1,class:"logs-empty"},AO={class:"modal-header"},TO={key:0},IO={class:"modal-scroll-content"},RO={class:"custom-app-form"},CO={key:0,class:"display-fields"},OO={class:"catalog-actions"},MO={key:0,class:"form-error"},NO={class:"form-error"},zO=Re({__name:"AppsView",setup(e){const t=hs(),n=rp(),r=sp(),s=di(),i=$s(),a=fi(),o=Oe("[]"),l=Oe(""),c=Oe(""),u=Oe(!1),p=Oe(!1),m=Oe("scale"),f=Xr({id:"",name:"",description:"",kind:"tty",command:"",args:"",cwd:"",envJson:"{}",width:"",height:"",depth:""}),y=Xr({}),b=Xr({}),x=Se(()=>a.tabs.find(V=>V.id===a.activeTabId)),S=Se(()=>y0(x.value,s.data.value||[])),N=Se(()=>new Set((r.data.value?.items||[]).map(V=>V.id))),z=Se(()=>(s.data.value||[]).filter(ie)),I=Se(()=>p.value?s.data.value||[]:(s.data.value||[]).filter(V=>!ie(V))),E=Se(()=>{const V=r.error.value;return V?`Custom app catalog is invalid: ${V instanceof Error?V.message:String(V)}`:""});on(()=>r.data.value?.items,V=>{o.value=JSON.stringify(V||[],null,2)},{immediate:!0}),Bn(()=>{if(!s.data.value)return;const V=s.data.value||[];a.pruneSession(new Set(V.map(F=>F.id)),ti(V))});function _(V){return y[V]||={title:"",cwd:"",argsJson:"[]",envJson:"{}",width:"",height:"",depth:""},y[V]}function L(V,F,U){const De=V.trim();if(!De)return F;try{return JSON.parse(De)}catch(mt){throw new Error(`${U} is invalid JSON: ${mt instanceof Error?mt.message:String(mt)}`)}}function M(V){const F=_(V.id),U={},De=L(F.argsJson,[],"Args"),mt=L(F.envJson,{},"Env");if(!Array.isArray(De)||De.some(Hn=>typeof Hn!="string"))throw new Error("Args JSON must be an array of strings.");if(!mt||typeof mt!="object"||Array.isArray(mt)||Object.values(mt).some(Hn=>typeof Hn!="string"))throw new Error("Env JSON must be an object with string values.");F.title.trim()&&(U.title=F.title.trim()),F.cwd.trim()&&(U.cwd=F.cwd.trim()),De.length&&(U.args=De),Object.keys(mt).length&&(U.env=mt);const cn={width:G(F.width),height:G(F.height),depth:G(F.depth)},Dn=Object.fromEntries(Object.entries(cn).filter(([,Hn])=>Hn!==void 0));return V.kind==="gui"&&Object.keys(Dn).length&&(U.display=Dn),U}function G(V){const F=V.trim();if(!F)return;const U=Number(F);if(!Number.isInteger(U)||U<=0)throw new Error("Display values must be positive integers.");return U}function P(V){if(V.vnc?.backend==="kasmvnc"){const mt=a.guiHidpi?st():1,cn=new URLSearchParams({path:io(`/api/apps/sessions/${V.id}/web/websockify`),autoconnect:"1",resize:m.value,enable_hidpi:a.guiHidpi&&mt>1?"1":"0",show_control_bar:"1"}),Dn=q(V,mt);return m.value==="scale"&&Dn&&(cn.set("forced_resolution_x",String(Dn.width)),cn.set("forced_resolution_y",String(Dn.height))),i.token&&cn.set("token",i.token),`${jn(V.vnc.webPath)}?${cn.toString()}`}const F=i.token?`?token=${encodeURIComponent(i.token)}`:"",U=V.vnc?.webPath?`${io(V.vnc.webPath)}${F}`:"",De=new URLSearchParams({path:U,autoconnect:"1",resize:m.value});return jn(`/api/novnc/vnc.html?${De.toString()}`)}function W(V,F){if(F.vnc?.backend!=="kasmvnc")return;const U=V.target;if(!(U instanceof HTMLIFrameElement))return;U.contentWindow?.postMessage({action:"resize",value:m.value},"*");const De=q(F,a.guiHidpi?st():1);m.value==="scale"&&De&&U.contentWindow?.postMessage({action:"set_resolution",value_x:De.width,value_y:De.height},"*")}function q(V,F){if(!V.display)return;const U=F>1?F:1;return{width:Math.max(1,Math.round(V.display.width/U)),height:Math.max(1,Math.round(V.display.height/U))}}function X(V){m.value=V}function ne(V){a.setGuiHidpi(V)}function he(V){const F=new URLSearchParams;i.token&&F.set("token",i.token);const U=F.toString()?`?${F.toString()}`:"";return jn(`/api/apps/sessions/${V.id}/screenshot${U}`)}function Ae(V){const F=jn(V.web?.webPath||"");return i.token?`${F}${F.includes("?")?"&":"?"}token=${encodeURIComponent(i.token)}`:F}function se(V){return V.type==="logs"?"logs":V.type==="shared-vnc"?"shared":V.type==="app-vnc"?"vnc":V.type==="app-web"?"web":"tty"}function re(V){return V.status==="running"}function ze(V){return re(V)&&(V.kind==="tty"||V.kind==="web"&&!!V.web||V.kind==="gui"&&!!V.vnc)}function ie(V){return V.error?.code==="APP_SESSION_RESTORED_WITHOUT_PROCESS"}function je(V){const F=new Date(V);return Number.isNaN(F.getTime())?V:F.toLocaleString()}function rt(V){return Object.keys(V).sort().join(", ")}async function ot(V){b[V.id]="";try{const F=await ap(V.id,Ft(V,M(V)));Le(F),Ge(F),await t.invalidateQueries({queryKey:["app-sessions"]}),await t.invalidateQueries({queryKey:["status"]})}catch(F){b[V.id]=F instanceof Error?F.message:String(F)}}function Ft(V,F){if(V.kind!=="gui")return F;const U=a.guiHidpi?st():1,De={...F.env||{}};De.TASK_HANDOFF_GUI_SCALE||(De.TASK_HANDOFF_GUI_SCALE=at(U));const mt=C(F.display||V.display,U);return{...F,env:De,...mt?{display:mt}:{}}}function st(){const V=typeof window>"u"?1:window.devicePixelRatio||1;return Math.min(3,Math.max(1,V))}function at(V){return V.toFixed(2).replace(/\.?0+$/,"")}function C(V,F){return!V?.width||!V.height?V:{...V,width:Math.round(V.width*F),height:Math.round(V.height*F)}}async function le(V){await Os(V),await t.invalidateQueries({queryKey:["app-sessions"]}),await t.invalidateQueries({queryKey:["status"]})}async function Q(V){if(V.type==="app-vnc"||V.type==="app-web"||V.type==="app-tty"){await Os(V.sessionId),a.close(V.id),await t.invalidateQueries({queryKey:["app-sessions"]}),await t.invalidateQueries({queryKey:["status"]});return}a.close(V.id)}async function de(V){const F=await m0(V);Le(F),Ge(F),await t.invalidateQueries({queryKey:["app-sessions"]}),await t.invalidateQueries({queryKey:["status"]})}async function Ie(V){await op(V);const F=(s.data.value||[]).filter(U=>U.id!==V);a.pruneSession(new Set(F.map(U=>U.id)),ti(F)),await t.invalidateQueries({queryKey:["app-sessions"]}),await t.invalidateQueries({queryKey:["status"]})}function Ge(V){if(!ze(V)){Te(V);return}a.open(da(V))}function Le(V){t.setQueryData(["app-sessions"],(F=[])=>[V,...F.filter(U=>U.id!==V.id)])}function Te(V){a.open({type:"logs",id:`logs:${V.id}`,sessionId:V.id,title:`${V.title} logs`})}function yt(){l.value="",o.value=JSON.stringify(r.data.value?.items||[],null,2)}function Ye(V){return N.value.has(V)}function Tt(V){return(V.match(/"[^"]*"|'[^']*'|\S+/g)||[]).map(U=>U.replace(/^(['"])(.*)\1$/,"$2"))}function bn(){const V=JSON.parse(o.value||"[]");if(!Array.isArray(V))throw new Error("Custom Apps JSON must be an array.");return V}function Yn(){c.value="",f.id="",f.name="",f.description="",f.kind="tty",f.command="",f.args="",f.cwd="",f.envJson="{}",f.width="",f.height="",f.depth=""}function br(V){c.value=V.id,f.id=V.id,f.name=V.name,f.description=V.description||"",f.kind=V.kind==="gui"?"gui":"tty",f.command=V.command||"",f.args=(V.args||[]).map(F=>/\s/.test(F)?JSON.stringify(F):F).join(" "),f.cwd=V.cwd||"",f.envJson=JSON.stringify(V.env||{},null,2),f.width=V.display?.width===void 0?"":String(V.display.width),f.height=V.display?.height===void 0?"":String(V.display.height),f.depth=V.display?.depth===void 0?"":String(V.display.depth)}function Si(V){l.value="",br(V)}function xi(){l.value="",Yn()}function Fr(){const V=f.id.trim(),F=f.name.trim(),U=f.command.trim();if(!V||!F||!U)throw new Error("Custom app id, name, and command are required.");const De={id:V,name:F,kind:f.kind,command:U};f.description.trim()&&(De.description=f.description.trim());const mt=Tt(f.args);mt.length&&(De.args=mt),f.cwd.trim()&&(De.cwd=f.cwd.trim());const cn=L(f.envJson,{},"Custom app env");if(!cn||typeof cn!="object"||Array.isArray(cn)||Object.values(cn).some(Dn=>typeof Dn!="string"))throw new Error("Custom app env JSON must be an object with string values.");if(Object.keys(cn).length&&(De.env=cn),f.kind==="gui"){const Dn={width:G(f.width),height:G(f.height),depth:G(f.depth)},Hn=Object.fromEntries(Object.entries(Dn).filter(([,cl])=>cl!==void 0));Object.keys(Hn).length&&(De.display=Hn)}return De}async function $n(){l.value="";try{const V=bn(),F=Fr(),U=c.value;if(!U&&V.some(mt=>mt.id===F.id))throw new Error("Custom app id already exists.");if(U&&F.id!==U&&V.some(mt=>mt.id===F.id))throw new Error("Custom app id already exists.");if(U&&!V.some(mt=>mt.id===U))throw new Error("Custom app was not found.");const De=U?V.map(mt=>mt.id===U?F:mt):[...V,F];await Ys(De),o.value=JSON.stringify(De,null,2),Yn(),await t.invalidateQueries({queryKey:["app-catalog"]}),await t.invalidateQueries({queryKey:["app-catalog-custom"]})}catch(V){l.value=V instanceof Error?V.message:String(V)}}async function ys(V){l.value="";try{const F=bn(),U=F.filter(De=>De.id!==V);if(U.length===F.length)throw new Error("Custom app was not found.");await Ys(U),o.value=JSON.stringify(U,null,2),c.value===V&&Yn(),await t.invalidateQueries({queryKey:["app-catalog"]}),await t.invalidateQueries({queryKey:["app-catalog-custom"]})}catch(F){l.value=F instanceof Error?F.message:String(F)}}async function Xn(){l.value="";try{const V=bn();await Ys(V),await t.invalidateQueries({queryKey:["app-catalog"]}),await t.invalidateQueries({queryKey:["app-catalog-custom"]}),l.value=""}catch(V){l.value=V instanceof Error?V.message:String(V)}}return(V,F)=>(O(),j("section",DC,[F[49]||(F[49]=k("h1",null,"Desktop",-1)),k("div",PC,[T(g(Rn),{class:"catalog"},{default:D(()=>[k("aside",BC,[k("div",LC,[F[18]||(F[18]=k("h2",null,"Apps",-1)),T(g(nt),{variant:"outline",size:"sm",onClick:F[0]||(F[0]=U=>u.value=!0)},{default:D(()=>[...F[17]||(F[17]=[fe("Custom Apps",-1)])]),_:1})]),(O(!0),j(lt,null,Ht(g(n).data.value||[],U=>(O(),xe(g(Tr),{key:U.id},{default:D(()=>[T(g(An),{class:"catalog-item"},{default:D(()=>[k("div",FC,[k("div",null,[k("div",UC,K(U.name),1),k("div",qC,[T(g(ts),{variant:"secondary"},{default:D(()=>[fe(K(U.kind),1)]),_:2},1024),U.command?(O(),j("span",HC,K(U.command),1)):pe("",!0)])]),k("div",VC,[T(g(nt),{size:"sm",onClick:De=>ot(U)},{default:D(()=>[...F[19]||(F[19]=[fe("Launch",-1)])]),_:1},8,["onClick"]),Ye(U.id)?(O(),xe(g(nt),{key:0,variant:"outline",size:"sm",onClick:De=>Si(U)},{default:D(()=>[...F[20]||(F[20]=[fe("Edit",-1)])]),_:1},8,["onClick"])):pe("",!0),Ye(U.id)?(O(),xe(g(nt),{key:1,variant:"outline",size:"sm",onClick:De=>ys(U.id)},{default:D(()=>[...F[21]||(F[21]=[fe("Remove",-1)])]),_:1},8,["onClick"])):pe("",!0)])]),k("div",jC,[T(g(Et),{modelValue:_(U.id).title,"onUpdate:modelValue":De=>_(U.id).title=De,placeholder:"title"},null,8,["modelValue","onUpdate:modelValue"]),T(g(Et),{modelValue:_(U.id).cwd,"onUpdate:modelValue":De=>_(U.id).cwd=De,placeholder:"/workspace"},null,8,["modelValue","onUpdate:modelValue"]),U.kind==="gui"?(O(),j("div",GC,[T(g(Et),{modelValue:_(U.id).width,"onUpdate:modelValue":De=>_(U.id).width=De,inputmode:"numeric",placeholder:"width"},null,8,["modelValue","onUpdate:modelValue"]),T(g(Et),{modelValue:_(U.id).height,"onUpdate:modelValue":De=>_(U.id).height=De,inputmode:"numeric",placeholder:"height"},null,8,["modelValue","onUpdate:modelValue"]),T(g(Et),{modelValue:_(U.id).depth,"onUpdate:modelValue":De=>_(U.id).depth=De,inputmode:"numeric",placeholder:"depth"},null,8,["modelValue","onUpdate:modelValue"])])):pe("",!0),T(g(or),{modelValue:_(U.id).argsJson,"onUpdate:modelValue":De=>_(U.id).argsJson=De,class:"launch-json",spellcheck:"false",placeholder:'args JSON, e.g. ["https://example.com"]'},null,8,["modelValue","onUpdate:modelValue"]),T(g(or),{modelValue:_(U.id).envJson,"onUpdate:modelValue":De=>_(U.id).envJson=De,class:"launch-json",spellcheck:"false",placeholder:'env JSON, e.g. {"LANG":"C.UTF-8"}'},null,8,["modelValue","onUpdate:modelValue"]),b[U.id]?(O(),j("p",ZC,K(b[U.id]),1)):pe("",!0)])]),_:2},1024)]),_:2},1024))),128)),k("div",KC,[F[22]||(F[22]=k("h2",null,"Sessions",-1)),k("div",WC,[k("span",null,K(I.value.length),1),z.value.length?(O(),xe(g(nt),{key:0,variant:"outline",size:"sm",onClick:F[1]||(F[1]=U=>p.value=!p.value)},{default:D(()=>[fe(K(p.value?"Hide restored":`Show restored (${z.value.length})`),1)]),_:1})):pe("",!0)])]),(O(!0),j(lt,null,Ht(I.value,U=>(O(),xe(g(Tr),{key:U.id,class:"session-card"},{default:D(()=>[T(g(Fi),{class:"session-header"},{default:D(()=>[k("div",null,[T(g(Ui),null,{default:D(()=>[fe(K(U.title),1)]),_:2},1024),T(g(Li),null,{default:D(()=>[fe(K(U.appId)+" · "+K(je(U.updatedAt)),1)]),_:2},1024)]),k("div",QC,[T(g(ts),{variant:U.status==="running"?"default":"secondary"},{default:D(()=>[fe(K(U.status),1)]),_:2},1032,["variant"]),T(g(nt),{variant:"outline",size:"sm",disabled:!re(U),onClick:De=>le(U.id)},{default:D(()=>[...F[23]||(F[23]=[fe("Stop",-1)])]),_:1},8,["disabled","onClick"]),T(g(nt),{variant:"outline",size:"sm",onClick:De=>de(U.id)},{default:D(()=>[...F[24]||(F[24]=[fe("Restart",-1)])]),_:1},8,["onClick"]),T(g(nt),{variant:"outline",size:"sm",disabled:!ze(U),onClick:De=>Ge(U)},{default:D(()=>[...F[25]||(F[25]=[fe("Open",-1)])]),_:1},8,["disabled","onClick"]),T(g(nt),{variant:"outline",size:"sm",onClick:De=>Te(U)},{default:D(()=>[...F[26]||(F[26]=[fe("Logs",-1)])]),_:1},8,["onClick"]),U.kind==="gui"&&re(U)?(O(),xe(g(nt),{key:0,variant:"outline",size:"sm",as:"a",href:he(U),target:"_blank",rel:"noreferrer"},{default:D(()=>[...F[27]||(F[27]=[fe("Screenshot",-1)])]),_:1},8,["href"])):pe("",!0),T(g(nt),{variant:"outline",size:"sm",onClick:De=>Ie(U.id)},{default:D(()=>[...F[28]||(F[28]=[fe("Delete",-1)])]),_:1},8,["onClick"])])]),_:2},1024),T(g(An),null,{default:D(()=>[U.error?(O(),j("p",JC,K(U.error.code)+": "+K(U.error.message),1)):pe("",!0),k("dl",YC,[k("div",null,[F[29]||(F[29]=k("dt",null,"Created",-1)),k("dd",null,K(je(U.createdAt)),1)]),k("div",null,[F[30]||(F[30]=k("dt",null,"Updated",-1)),k("dd",null,K(je(U.updatedAt)),1)]),U.tty?.cwd||U.launch?.cwd?(O(),j("div",XC,[F[31]||(F[31]=k("dt",null,"CWD",-1)),k("dd",null,K(U.launch?.cwd||U.tty?.cwd),1)])):pe("",!0),U.launch?.args?.length?(O(),j("div",eO,[F[32]||(F[32]=k("dt",null,"Args",-1)),k("dd",null,K(U.launch.args.join(" ")),1)])):pe("",!0),U.launch?.env&&Object.keys(U.launch.env).length?(O(),j("div",tO,[F[33]||(F[33]=k("dt",null,"Env",-1)),k("dd",null,K(rt(U.launch.env)),1)])):pe("",!0),U.display?(O(),j("div",nO,[F[34]||(F[34]=k("dt",null,"Display",-1)),k("dd",null,K(U.display.display)+" "+K(U.display.width)+"x"+K(U.display.height)+"x"+K(U.display.depth),1)])):pe("",!0),U.vnc?(O(),j("div",rO,[F[35]||(F[35]=k("dt",null,"Ports",-1)),k("dd",null,[fe(K(U.vnc.backend==="kasmvnc"?"kasmvnc":"vnc")+" "+K(U.vnc.port),1),U.vnc.websockifyPort?(O(),j("span",sO," · ws "+K(U.vnc.websockifyPort),1)):pe("",!0),U.automation?(O(),j("span",iO," · cdp "+K(U.automation.port),1)):pe("",!0)])])):pe("",!0),U.automation?(O(),j("div",aO,[F[36]||(F[36]=k("dt",null,"Automation",-1)),k("dd",null,[T($C,{session:U},null,8,["session"])])])):pe("",!0),U.process?(O(),j("div",oO,[F[37]||(F[37]=k("dt",null,"Process",-1)),k("dd",null,[fe(K(U.process.command),1),U.process.pid?(O(),j("span",lO," · pid "+K(U.process.pid),1)):pe("",!0),U.process.exitCode!==void 0&&U.process.exitCode!==null?(O(),j("span",cO," · exit "+K(U.process.exitCode),1)):pe("",!0)])])):pe("",!0)])]),_:2},1024)]),_:2},1024))),128))])]),_:1}),k("section",uO,[F[41]||(F[41]=k("h2",null,"Workspace",-1)),g(a).tabs.length?(O(),j("div",dO,[T(g(Rn),{class:"workspace-tab-list-scroll"},{default:D(()=>[k("div",fO,[(O(!0),j(lt,null,Ht(g(a).tabs,U=>(O(),j("button",{key:U.id,type:"button",class:At({active:g(a).activeTabId===U.id}),onClick:De=>g(a).setActive(U.id)},[k("span",null,K(U.title),1),k("span",pO,K(se(U)),1),k("span",{class:"tab-close",title:"Close tab","aria-label":"Close tab",onClick:en(De=>Q(U),["stop"])},[T(g(Ms),{size:13,"stroke-width":2.2})],8,mO)],10,hO))),128))])]),_:1}),S.value?(O(),j("div",gO,[k("span",null,K(S.value.appId)+" · "+K(S.value.status),1),k("div",null,[S.value.kind==="gui"&&S.value.status==="running"?(O(),j("div",vO,[T(g(Ap),{type:"single","model-value":m.value,"aria-label":"VNC resize mode","onUpdate:modelValue":F[2]||(F[2]=U=>U&&X(U))},{default:D(()=>[T(g(oo),{value:"scale"},{default:D(()=>[...F[38]||(F[38]=[fe("Scale",-1)])]),_:1}),T(g(oo),{value:"remote"},{default:D(()=>[...F[39]||(F[39]=[fe("Resize",-1)])]),_:1})]),_:1},8,["model-value"]),T(g(_p),{"model-value":g(a).guiHidpi,"aria-label":"Toggle HiDPI","onUpdate:modelValue":ne},{default:D(()=>[...F[40]||(F[40]=[fe("HiDPI",-1)])]),_:1},8,["model-value"])])):pe("",!0)])])):pe("",!0),k("div",bO,[S.value&&x.value?(O(),j(lt,{key:0},[x.value.type==="app-tty"&&S.value.status==="running"?(O(),xe(Up,{key:0,session:S.value},null,8,["session"])):x.value.type==="app-web"&&S.value.status==="running"&&S.value.web?(O(),j("iframe",{key:1,class:"web-frame",src:Ae(S.value),title:S.value.title,allow:"clipboard-read; clipboard-write; fullscreen"},null,8,yO)):x.value.type==="app-vnc"||x.value.type==="shared-vnc"?(O(),j("div",wO,[S.value.vnc?(O(),j("iframe",{key:`${S.value.id}:${m.value}:${g(a).guiHidpi?"hidpi":"1x"}`,class:"vnc-frame workspace-vnc-frame",src:P(S.value),title:`${x.value.title} VNC`,allow:"clipboard-read; clipboard-write; fullscreen",onLoad:F[3]||(F[3]=U=>W(U,S.value))},null,40,SO)):(O(),j("p",xO,"VNC is unavailable for this session."))])):x.value.type==="logs"?(O(),xe(Fp,{key:3,session:S.value},null,8,["session"])):(O(),j("p",kO,"Runtime view is unavailable for this session state."))],64)):(O(),j("p",_O,"The selected workspace tab no longer has a running session."))])])):(O(),j("p",EO,"Open a running app to create a workspace tab."))])]),T(g($p),{open:u.value,"onUpdate:open":F[16]||(F[16]=U=>u.value=U)},{default:D(()=>[T(g(Dp),{class:"modal-panel gap-0 p-0",style:{width:"min(1180px, calc(100vw - 48px))","max-width":"calc(100vw - 48px)"}},{default:D(()=>[k("header",AO,[k("div",null,[T(g(Bp),null,{default:D(()=>[...F[42]||(F[42]=[fe("Custom Apps",-1)])]),_:1}),T(g(Pp),{class:"sr-only"},{default:D(()=>[...F[43]||(F[43]=[fe("Create and manage custom applications available in this controlled instance.",-1)])]),_:1}),g(r).data.value?(O(),j("p",TO,K(g(r).data.value.path),1)):pe("",!0)])]),T(g(Rn),{class:"modal-scroll"},{default:D(()=>[k("div",IO,[T(g(Tr),{class:"catalog-editor"},{default:D(()=>[T(g(An),null,{default:D(()=>[k("div",RO,[T(g(Et),{modelValue:f.id,"onUpdate:modelValue":F[4]||(F[4]=U=>f.id=U),placeholder:"id"},null,8,["modelValue"]),T(g(Et),{modelValue:f.name,"onUpdate:modelValue":F[5]||(F[5]=U=>f.name=U),placeholder:"name"},null,8,["modelValue"]),T(g(or),{modelValue:f.description,"onUpdate:modelValue":F[6]||(F[6]=U=>f.description=U),class:"launch-json",spellcheck:"false",placeholder:"description"},null,8,["modelValue"]),T(g(lo),{modelValue:f.kind,"onUpdate:modelValue":F[7]||(F[7]=U=>f.kind=U)},{default:D(()=>[T(g(uo),{class:"native-select"},{default:D(()=>[T(g(fo),{placeholder:"App kind"})]),_:1}),T(g(co),null,{default:D(()=>[T(g(Jr),{value:"tty"},{default:D(()=>[...F[44]||(F[44]=[fe("TTY",-1)])]),_:1}),T(g(Jr),{value:"gui"},{default:D(()=>[...F[45]||(F[45]=[fe("GUI",-1)])]),_:1})]),_:1})]),_:1},8,["modelValue"]),T(g(Et),{modelValue:f.command,"onUpdate:modelValue":F[8]||(F[8]=U=>f.command=U),placeholder:"/usr/bin/app"},null,8,["modelValue"]),T(g(Et),{modelValue:f.args,"onUpdate:modelValue":F[9]||(F[9]=U=>f.args=U),placeholder:'args, e.g. --new-window "https://example.com"'},null,8,["modelValue"]),T(g(Et),{modelValue:f.cwd,"onUpdate:modelValue":F[10]||(F[10]=U=>f.cwd=U),placeholder:"/workspace"},null,8,["modelValue"]),T(g(or),{modelValue:f.envJson,"onUpdate:modelValue":F[11]||(F[11]=U=>f.envJson=U),class:"launch-json",spellcheck:"false",placeholder:'env JSON, e.g. {"LANG":"C.UTF-8"}'},null,8,["modelValue"]),f.kind==="gui"?(O(),j("div",CO,[T(g(Et),{modelValue:f.width,"onUpdate:modelValue":F[12]||(F[12]=U=>f.width=U),inputmode:"numeric",placeholder:"width"},null,8,["modelValue"]),T(g(Et),{modelValue:f.height,"onUpdate:modelValue":F[13]||(F[13]=U=>f.height=U),inputmode:"numeric",placeholder:"height"},null,8,["modelValue"]),T(g(Et),{modelValue:f.depth,"onUpdate:modelValue":F[14]||(F[14]=U=>f.depth=U),inputmode:"numeric",placeholder:"depth"},null,8,["modelValue"])])):pe("",!0),k("div",OO,[T(g(nt),{size:"sm",onClick:$n},{default:D(()=>[fe(K(c.value?"Update App":"Add App"),1)]),_:1}),c.value?(O(),xe(g(nt),{key:0,variant:"outline",size:"sm",onClick:xi},{default:D(()=>[...F[46]||(F[46]=[fe("Cancel",-1)])]),_:1})):pe("",!0)])])]),_:1}),T(g(An),null,{default:D(()=>[T(g(or),{modelValue:o.value,"onUpdate:modelValue":F[15]||(F[15]=U=>o.value=U),class:"catalog-json",spellcheck:"false"},null,8,["modelValue"]),E.value?(O(),j("p",MO,K(E.value),1)):pe("",!0)]),_:1}),T(g(S0),{class:"editor-actions"},{default:D(()=>[T(g(nt),{variant:"outline",size:"sm",onClick:yt},{default:D(()=>[...F[47]||(F[47]=[fe("Reset",-1)])]),_:1}),T(g(nt),{size:"sm",onClick:Xn},{default:D(()=>[...F[48]||(F[48]=[fe("Save",-1)])]),_:1})]),_:1}),l.value?(O(),xe(g(An),{key:0},{default:D(()=>[k("p",NO,K(l.value),1)]),_:1})):pe("",!0)]),_:1})])]),_:1})]),_:1})]),_:1},8,["open"])]))}}),$O=cC({history:UR(Vh()||"/"),routes:[{path:"/",component:Lp},{path:"/triggers",component:NC},{path:"/apps",component:zO},{path:"/:pathMatch(.*)*",redirect:"/"}]}),DO="task-handoff.theme",tc="dark";function PO(){if(typeof window>"u")return tc;try{const e=window.localStorage.getItem(DO);return e==="light"||e==="dark"?e:tc}catch{return tc}}function BO(e){document.documentElement.dataset.theme=e,document.documentElement.classList.toggle("dark",e==="dark")}function LO(){BO(PO())}LO();const FO=window,UO=!!FO.taskHandoffDesktop||navigator.userAgent.includes("Electron");UO&&navigator.platform.toLowerCase().includes("mac")&&document.documentElement.classList.add("native-macos-titlebar");Rv(rR).use(Nv()).use(g2).use($O).mount("#app");export{Sw as _,A5 as g};
|