@decocms/mesh 1.0.0-alpha.3 → 1.0.0-alpha.31
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/README.md +287 -0
- package/dist/client/assets/{alert-dialog-Caf0mgW9.js → alert-dialog-lT7fjsnS.js} +3 -3
- package/dist/client/assets/app-name-gTETL9So.js +1 -0
- package/dist/client/assets/{auth-CGqqbEan.js → auth-B4DV4YJb.js} +1 -1
- package/dist/client/assets/{auth-catchall-Bw-KJI1v.js → auth-catchall-BXXli3-E.js} +1 -1
- package/dist/client/assets/{avatar-CdPaDOIs.js → avatar-DrbrX3Fb.js} +1 -1
- package/dist/client/assets/{badge-j-myHF25.js → badge-Sw-5Fjm_.js} +1 -1
- package/dist/client/assets/{button-DnKGwZ1P.js → button-De8TtfIc.js} +1 -1
- package/dist/client/assets/{card-I0CWqn2J.js → card-Clgs1Ler.js} +1 -1
- package/dist/client/assets/{checkbox-v3iP8MNg.js → checkbox-BZTG8MjG.js} +1 -1
- package/dist/client/assets/{circle-alert-CpqBZI3V.js → circle-alert-Bo6PdNJA.js} +1 -1
- package/dist/client/assets/collection-detail-bCm7IhzQ.js +1 -0
- package/dist/client/assets/collection-display-button-CANVxM78.js +1 -0
- package/dist/client/assets/collection-header-DWpT3ZvE.js +1 -0
- package/dist/client/assets/{collection-page-CkAonVNX.js → collection-page-BDYpmZx2.js} +1 -1
- package/dist/client/assets/{collection-search-Bd4XQ4_K.js → collection-search-7dvS8CPU.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-Dv4rgxdy.js → collection-table-wrapper-DFImlrAn.js} +1 -1
- package/dist/client/assets/connection-card-Dgd2qOAx.js +1 -0
- package/dist/client/assets/connection-detail-B5XIo4jJ.js +1 -0
- package/dist/client/assets/connections-DgVq2Zi4.js +1 -0
- package/dist/client/assets/core-6UZH86ZU.js +6 -0
- package/dist/client/assets/{create-organization-dialog-CWgFMDXV.js → create-organization-dialog-DpintAfW.js} +1 -1
- package/dist/client/assets/dialog-CcWkQ3-q.js +1 -0
- package/dist/client/assets/{dropdown-menu-BIeRR6rM.js → dropdown-menu-BMBTO1aI.js} +1 -1
- package/dist/client/assets/{empty-state-DV83eIhT.js → empty-state-WuOT2hFn.js} +1 -1
- package/dist/client/assets/{error-boundary-qOVcoWbq.js → error-boundary-Sj1-czrQ.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DzgXoQyz.js → extract-connection-data-q7cQAIMM.js} +1 -1
- package/dist/client/assets/{form-0C1lYHJ2.js → form-CTTDgzck.js} +1 -1
- package/dist/client/assets/gateway-detail-DrTM5RUx.js +1 -0
- package/dist/client/assets/gateways-C0TCQRt5.js +1 -0
- package/dist/client/assets/{home-B1IT0slW.js → home-Dy-_EeTf.js} +1 -1
- package/dist/client/assets/{icon-C1glN-Ga.js → icon-Dk9j-Z4d.js} +1 -1
- package/dist/client/assets/index-BMLzl8gY.css +1 -0
- package/dist/client/assets/index-BSuuYE7a.js +32 -0
- package/dist/client/assets/index-DIXLDBVl.js +118 -0
- package/dist/client/assets/{index-Chpp7zg0.js → index-Dss36SHE.js} +1 -1
- package/dist/client/assets/{index-D2ODleHN.js → index-GY3GXADp.js} +1 -1
- package/dist/client/assets/{input-DpAKmHHm.js → input-ByJBGfq3.js} +1 -1
- package/dist/client/assets/json-B2EH3aa6.js +1 -0
- package/dist/client/assets/json-BESjz4hO.js +1 -0
- package/dist/client/assets/layout-DRBUzMK7.js +1 -0
- package/dist/client/assets/lazy-highlighter-BZ3JTPPT.js +4 -0
- package/dist/client/assets/{localstorage-keys-DC7ymQmZ.js → localstorage-keys-CrXjwcSZ.js} +1 -1
- package/dist/client/assets/login-baVguqcM.js +1 -0
- package/dist/client/assets/mcp-oauth-Chn8Vl6o.js +1 -0
- package/dist/client/assets/members-BL6-e_ID.js +3 -0
- package/dist/client/assets/monitoring-DSGI33MK.js +1 -0
- package/dist/client/assets/oauth-callback-BxWJgxm-.js +1 -0
- package/dist/client/assets/page-BZV40eAE.css +1 -0
- package/dist/client/assets/page-D0r-m9VX.js +21 -0
- package/dist/client/assets/{popover-TCQphQTw.js → popover-C_H6Z3YS.js} +1 -1
- package/dist/client/assets/prism-light-CKU-zSUS.js +1 -0
- package/dist/client/assets/resource-tabs-Dptn276z.js +1 -0
- package/dist/client/assets/{schema-BLzWyGtx.js → schema-iWDGcZfv.js} +1 -1
- package/dist/client/assets/{select-fvQCifl4.js → select-KKeuY_8A.js} +1 -1
- package/dist/client/assets/settings-DOQRUeGN.js +1 -0
- package/dist/client/assets/shell-layout-DxFvs5RE.js +124 -0
- package/dist/client/assets/slugify-CEUa2lfQ.js +1 -0
- package/dist/client/assets/{spinner-Cck765yW.js → spinner-C5mTiECQ.js} +1 -1
- package/dist/client/assets/store-BsHJOv3r.js +1 -0
- package/dist/client/assets/store-app-detail-D8K1UJ66.js +1 -0
- package/dist/client/assets/switch-BN3gNP3v.js +1 -0
- package/dist/client/assets/{textarea--4iImQiq.js → textarea-DYrEFGVo.js} +1 -1
- package/dist/client/assets/tool-set-selector-BU0xXwDF.js +1 -0
- package/dist/client/assets/{tooltip-DjXyjtiH.js → tooltip-ZzCYSPeH.js} +1 -1
- package/dist/client/assets/types-DndJPAWa.js +45 -0
- package/dist/client/assets/{upload-DkfUhTLj.js → upload-CsXE0eHm.js} +1 -1
- package/dist/client/assets/{use-binding-BLIUV5ER.js → use-binding-CIVQUW9t.js} +2 -2
- package/dist/client/assets/use-connection-CgusccPZ.js +2 -0
- package/dist/client/assets/use-gateway-iwW9W997.js +1 -0
- package/dist/client/assets/{use-list-state-Bas0EIwN.js → use-list-state-B2svGg01.js} +1 -1
- package/dist/client/assets/use-mcp-ByPLvFZj.js +1 -0
- package/dist/client/assets/use-members-dzf6tzsH.js +1 -0
- package/dist/client/assets/{use-mobile-CxX0wu31.js → use-mobile-BqnROvZt.js} +1 -1
- package/dist/client/assets/{use-organization-settings-CpvpbwdB.js → use-organization-settings-DYa2j-qu.js} +1 -1
- package/dist/client/assets/{use-tool-call-p0lqBezD.js → use-tool-call-CFjw03Kh.js} +1 -1
- package/dist/client/assets/useQuery-B5H-PpIX.js +1 -0
- package/dist/client/assets/utils-Ny57I_y6.js +1 -0
- package/dist/client/assets/well-known-mcp-Dg77mwx9.js +1 -0
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +191 -211
- package/dist/server/migrate.js +204 -204
- package/dist/server/server.js +245 -267
- package/package.json +7 -5
- package/dist/client/assets/app-name-DQPOjnhR.js +0 -1
- package/dist/client/assets/chunk-2RRQPJJO-DGhxLrrR.js +0 -1
- package/dist/client/assets/collection-detail-BSfYYwzG.js +0 -1
- package/dist/client/assets/collection-display-button-Cws3c2TG.js +0 -1
- package/dist/client/assets/collection-header-CJC3zXGa.js +0 -1
- package/dist/client/assets/connection-card-CgJm9r5i.js +0 -1
- package/dist/client/assets/connection-detail-HAGAOVY9.js +0 -1
- package/dist/client/assets/connections-C8Z338-P.js +0 -1
- package/dist/client/assets/dialog-Qusr5Dgc.js +0 -1
- package/dist/client/assets/gateway-detail-mD14k5vr.js +0 -1
- package/dist/client/assets/gateways-BSGLH5Mc.js +0 -1
- package/dist/client/assets/index-B5e6fytH.js +0 -118
- package/dist/client/assets/index-C1xA8jg5.js +0 -1
- package/dist/client/assets/index-DqmRoUE9.js +0 -32
- package/dist/client/assets/index-feMggVqN.css +0 -1
- package/dist/client/assets/integration-icon-C_Dk6BbN.js +0 -1
- package/dist/client/assets/layout-BMHVtK0w.js +0 -1
- package/dist/client/assets/lazy-highlighter-9rAB2zZq.js +0 -1
- package/dist/client/assets/login-BMjQy3tL.js +0 -1
- package/dist/client/assets/members-k_V-Gxfi.js +0 -1
- package/dist/client/assets/monitoring-BG-rBDyv.js +0 -1
- package/dist/client/assets/monitoring-stats-row-PYfuhQHX.js +0 -42
- package/dist/client/assets/oauth-callback-CQ4D18kW.js +0 -10
- package/dist/client/assets/page-h-kmS-QS.js +0 -1
- package/dist/client/assets/prism-CcSucC56.js +0 -9
- package/dist/client/assets/resource-tabs-E4yf0eYT.js +0 -1
- package/dist/client/assets/settings-Bjk195Z6.js +0 -1
- package/dist/client/assets/shell-layout-B8oNCzSa.js +0 -124
- package/dist/client/assets/store-DD1aCoWU.js +0 -1
- package/dist/client/assets/store-app-detail-DZvzqAVf.js +0 -1
- package/dist/client/assets/tool-set-selector-Fu1vBXWK.js +0 -1
- package/dist/client/assets/use-connection-IMyxygAc.js +0 -2
- package/dist/client/assets/use-gateway-CuMrhcvh.js +0 -1
- package/dist/client/assets/use-members-DHcrnzKP.js +0 -1
- package/dist/client/assets/useQuery-BO2jzwkw.js +0 -1
- package/dist/client/assets/utils-BLBjpUfr.js +0 -1
- package/dist/client/assets/well-known-mcp-Dq2j3ucM.js +0 -1
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/lazy-highlighter-9rAB2zZq.js","assets/index-B5e6fytH.js","assets/index-feMggVqN.css","assets/prism-CcSucC56.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{$ as z,f as Rh,n as oa,g as ua,e as wr,h as Oh,i as ke,k as ws,p as an,l as ci,m as di,o as Lh,q as Dh,s as hl,t as pl,v as Wn,w as vs,x as Ph,y as Mh,z as cr,B as _r,C as Bh,D as la,E as ml,F as Fh,G as ee,c as F,H as zh,I as jh,J as Uh,_ as Hh,K as $h,L as Zh,M as Yh,O as qh,P as Vh,Q as Wh,R as Gh,T as Kh,U as Qh,V as gl,W as Xh,Z as le,X as ca,r as P,j as m,Y as Mn,a0 as bl,a1 as El,a2 as at,a3 as da,a4 as Jh,a5 as vr,a6 as ei,a as Rr,a7 as ep,a8 as tp,a9 as np,aa as rp,ab as ip,ac as sp,ad as ap,ae as op,af as up,ag as lp,d as xl,ah as cp,ai as dp,aj as fp,ak as hp,S as Tl,al as pp,am as mp,N as gp,an as bp,ao as _l}from"./index-B5e6fytH.js";import{E as Ep}from"./empty-state-DV83eIhT.js";import{U as yl,u as kl,c as Al,a as xp,b as Tp}from"./use-connection-IMyxygAc.js";import{E as _p,u as ro}from"./use-binding-BLIUV5ER.js";import{u as On,L as Or}from"./localstorage-keys-DC7ymQmZ.js";import{c as yp,T as Sl,a as Cl,b as Il,u as vt,d as kp,L as io,P as Ap,O as Sp}from"./tooltip-DjXyjtiH.js";import{B as ot,u as on}from"./button-DnKGwZ1P.js";import{I as fe}from"./icon-C1glN-Ga.js";import{S as Cp,a as Ip,b as Np,c as wp}from"./select-fvQCifl4.js";import{c as X}from"./utils-BLBjpUfr.js";import{u as Bn}from"./use-mobile-CxX0wu31.js";import{T as vp}from"./textarea--4iImQiq.js";import{C as Rp}from"./connection-card-CgJm9r5i.js";import{E as Rs}from"./error-boundary-qOVcoWbq.js";import{X as Op,D as Nl,a as wl,b as vl,c as Rl,d as Ol}from"./dialog-Qusr5Dgc.js";import{u as Ll,a as Lp}from"./use-organization-settings-CpvpbwdB.js";import{C as Dp}from"./create-organization-dialog-CWgFMDXV.js";import{I as Pp}from"./input-DpAKmHHm.js";import{P as Mp,a as Bp,b as Fp}from"./popover-TCQphQTw.js";import{A as Fn}from"./avatar-CdPaDOIs.js";import{D as zp,a as jp,b as Up,c as Hp,d as so}from"./dropdown-menu-BIeRR6rM.js";import"./auth-CGqqbEan.js";import"./useQuery-BO2jzwkw.js";import"./badge-j-myHF25.js";import"./card-I0CWqn2J.js";import"./integration-icon-C_Dk6BbN.js";import"./alert-dialog-Caf0mgW9.js";import"./form-0C1lYHJ2.js";import"./spinner-Cck765yW.js";const $p=/^[cC][^\s-]{8,}$/,Zp=/^[0-9a-z]+$/,Yp=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,qp=/^[0-9a-vA-V]{20}$/,Vp=/^[A-Za-z0-9]{27}$/,Wp=/^[a-zA-Z0-9_-]{21}$/,Gp=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Kp=/^([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})$/,ao=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[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)$/,Qp=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Xp="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Jp(){return new RegExp(Xp,"u")}const em=/^(?:(?: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])$/,tm=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,nm=/^((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])$/,rm=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,im=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Dl=/^[A-Za-z0-9_-]*$/,sm=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,am=/^\+(?:[0-9]){6,14}[0-9]$/,Pl="(?:(?:\\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])))",om=new RegExp(`^${Pl}$`);function Ml(t){const e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function um(t){return new RegExp(`^${Ml(t)}$`)}function lm(t){const e=Ml({precision:t.precision}),n=["Z"];t.local&&n.push(""),t.offset&&n.push("([+-]\\d{2}:\\d{2})");const r=`${e}(?:${n.join("|")})`;return new RegExp(`^${Pl}T(?:${r})$`)}const cm=t=>{const e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},dm=/^\d+$/,fm=/^-?\d+(?:\.\d+)?/i,hm=/true|false/i,pm=/null/i,mm=/^[^A-Z]*$/,gm=/^[^a-z]*$/,ut=z("$ZodCheck",(t,e)=>{var n;t._zod??(t._zod={}),t._zod.def=e,(n=t._zod).onattach??(n.onattach=[])}),Bl={number:"number",bigint:"bigint",object:"date"},Fl=z("$ZodCheckLessThan",(t,e)=>{ut.init(t,e);const n=Bl[typeof e.value];t._zod.onattach.push(r=>{const i=r._zod.bag,s=(e.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<s&&(e.inclusive?i.maximum=e.value:i.exclusiveMaximum=e.value)}),t._zod.check=r=>{(e.inclusive?r.value<=e.value:r.value<e.value)||r.issues.push({origin:n,code:"too_big",maximum:e.value,input:r.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),zl=z("$ZodCheckGreaterThan",(t,e)=>{ut.init(t,e);const n=Bl[typeof e.value];t._zod.onattach.push(r=>{const i=r._zod.bag,s=(e.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>s&&(e.inclusive?i.minimum=e.value:i.exclusiveMinimum=e.value)}),t._zod.check=r=>{(e.inclusive?r.value>=e.value:r.value>e.value)||r.issues.push({origin:n,code:"too_small",minimum:e.value,input:r.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),bm=z("$ZodCheckMultipleOf",(t,e)=>{ut.init(t,e),t._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=e.value)}),t._zod.check=n=>{if(typeof n.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%e.value===BigInt(0):Rh(n.value,e.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:e.value,input:n.value,inst:t,continue:!e.abort})}}),Em=z("$ZodCheckNumberFormat",(t,e)=>{ut.init(t,e),e.format=e.format||"float64";const n=e.format?.includes("int"),r=n?"int":"number",[i,s]=Oh[e.format];t._zod.onattach.push(a=>{const o=a._zod.bag;o.format=e.format,o.minimum=i,o.maximum=s,n&&(o.pattern=dm)}),t._zod.check=a=>{const o=a.value;if(n){if(!Number.isInteger(o)){a.issues.push({expected:r,format:e.format,code:"invalid_type",input:o,inst:t});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:t,origin:r,continue:!e.abort}):a.issues.push({input:o,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:r,continue:!e.abort});return}}o<i&&a.issues.push({origin:"number",input:o,code:"too_small",minimum:i,inclusive:!0,inst:t,continue:!e.abort}),o>s&&a.issues.push({origin:"number",input:o,code:"too_big",maximum:s,inst:t})}}),xm=z("$ZodCheckMaxLength",(t,e)=>{var n;ut.init(t,e),(n=t._zod.def).when??(n.when=r=>{const i=r.value;return!oa(i)&&i.length!==void 0}),t._zod.onattach.push(r=>{const i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<i&&(r._zod.bag.maximum=e.maximum)}),t._zod.check=r=>{const i=r.value;if(i.length<=e.maximum)return;const a=ua(i);r.issues.push({origin:a,code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),Tm=z("$ZodCheckMinLength",(t,e)=>{var n;ut.init(t,e),(n=t._zod.def).when??(n.when=r=>{const i=r.value;return!oa(i)&&i.length!==void 0}),t._zod.onattach.push(r=>{const i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>i&&(r._zod.bag.minimum=e.minimum)}),t._zod.check=r=>{const i=r.value;if(i.length>=e.minimum)return;const a=ua(i);r.issues.push({origin:a,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),_m=z("$ZodCheckLengthEquals",(t,e)=>{var n;ut.init(t,e),(n=t._zod.def).when??(n.when=r=>{const i=r.value;return!oa(i)&&i.length!==void 0}),t._zod.onattach.push(r=>{const i=r._zod.bag;i.minimum=e.length,i.maximum=e.length,i.length=e.length}),t._zod.check=r=>{const i=r.value,s=i.length;if(s===e.length)return;const a=ua(i),o=s>e.length;r.issues.push({origin:a,...o?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:r.value,inst:t,continue:!e.abort})}}),Ni=z("$ZodCheckStringFormat",(t,e)=>{var n,r;ut.init(t,e),t._zod.onattach.push(i=>{const s=i._zod.bag;s.format=e.format,e.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(e.pattern))}),e.pattern?(n=t._zod).check??(n.check=i=>{e.pattern.lastIndex=0,!e.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:e.format,input:i.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(r=t._zod).check??(r.check=()=>{})}),ym=z("$ZodCheckRegex",(t,e)=>{Ni.init(t,e),t._zod.check=n=>{e.pattern.lastIndex=0,!e.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),km=z("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=mm),Ni.init(t,e)}),Am=z("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=gm),Ni.init(t,e)}),Sm=z("$ZodCheckIncludes",(t,e)=>{ut.init(t,e);const n=wr(e.includes),r=new RegExp(typeof e.position=="number"?`^.{${e.position}}${n}`:n);e.pattern=r,t._zod.onattach.push(i=>{const s=i._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),t._zod.check=i=>{i.value.includes(e.includes,e.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:i.value,inst:t,continue:!e.abort})}}),Cm=z("$ZodCheckStartsWith",(t,e)=>{ut.init(t,e);const n=new RegExp(`^${wr(e.prefix)}.*`);e.pattern??(e.pattern=n),t._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),t._zod.check=r=>{r.value.startsWith(e.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:r.value,inst:t,continue:!e.abort})}}),Im=z("$ZodCheckEndsWith",(t,e)=>{ut.init(t,e);const n=new RegExp(`.*${wr(e.suffix)}$`);e.pattern??(e.pattern=n),t._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),t._zod.check=r=>{r.value.endsWith(e.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:r.value,inst:t,continue:!e.abort})}}),Nm=z("$ZodCheckOverwrite",(t,e)=>{ut.init(t,e),t._zod.check=n=>{n.value=e.tx(n.value)}});class wm{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}const r=e.split(`
|
|
3
|
-
`).filter(a=>a),i=Math.min(...r.map(a=>a.length-a.trimStart().length)),s=r.map(a=>a.slice(i)).map(a=>" ".repeat(this.indent*2)+a);for(const a of s)this.content.push(a)}compile(){const e=Function,n=this?.args,i=[...(this?.content??[""]).map(s=>` ${s}`)];return new e(...n,i.join(`
|
|
4
|
-
`))}}const vm={major:4,minor:0,patch:0},ve=z("$ZodType",(t,e)=>{var n;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=vm;const r=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&r.unshift(t);for(const i of r)for(const s of i._zod.onattach)s(t);if(r.length===0)(n=t._zod).deferred??(n.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{const i=(s,a,o)=>{let u=cr(s),l;for(const d of a){if(d._zod.def.when){if(!d._zod.def.when(s))continue}else if(u)continue;const c=s.issues.length,h=d._zod.check(s);if(h instanceof Promise&&o?.async===!1)throw new vs;if(l||h instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await h,s.issues.length!==c&&(u||(u=cr(s,c)))});else{if(s.issues.length===c)continue;u||(u=cr(s,c))}}return l?l.then(()=>s):s};t._zod.run=(s,a)=>{const o=t._zod.parse(s,a);if(o instanceof Promise){if(a.async===!1)throw new vs;return o.then(u=>i(u,r,a))}return i(o,r,a)}}t["~standard"]={validate:i=>{try{const s=Ph(t,i);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return Mh(t,i).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}}),fa=z("$ZodString",(t,e)=>{ve.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??cm(t._zod.bag),t._zod.parse=(n,r)=>{if(e.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:t}),n}}),De=z("$ZodStringFormat",(t,e)=>{Ni.init(t,e),fa.init(t,e)}),Rm=z("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=Kp),De.init(t,e)}),Om=z("$ZodUUID",(t,e)=>{if(e.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(r===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=ao(r))}else e.pattern??(e.pattern=ao());De.init(t,e)}),Lm=z("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=Qp),De.init(t,e)}),Dm=z("$ZodURL",(t,e)=>{De.init(t,e),t._zod.check=n=>{try{const r=n.value,i=new URL(r),s=i.href;e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(i.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:sm.source,input:n.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:n.value,inst:t,continue:!e.abort})),!r.endsWith("/")&&s.endsWith("/")?n.value=s.slice(0,-1):n.value=s;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:t,continue:!e.abort})}}}),Pm=z("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=Jp()),De.init(t,e)}),Mm=z("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=Wp),De.init(t,e)}),Bm=z("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=$p),De.init(t,e)}),Fm=z("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=Zp),De.init(t,e)}),zm=z("$ZodULID",(t,e)=>{e.pattern??(e.pattern=Yp),De.init(t,e)}),jm=z("$ZodXID",(t,e)=>{e.pattern??(e.pattern=qp),De.init(t,e)}),Um=z("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=Vp),De.init(t,e)}),Hm=z("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=lm(e)),De.init(t,e)}),$m=z("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=om),De.init(t,e)}),Zm=z("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=um(e)),De.init(t,e)}),Ym=z("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=Gp),De.init(t,e)}),qm=z("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=em),De.init(t,e),t._zod.onattach.push(n=>{const r=n._zod.bag;r.format="ipv4"})}),Vm=z("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=tm),De.init(t,e),t._zod.onattach.push(n=>{const r=n._zod.bag;r.format="ipv6"}),t._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:t,continue:!e.abort})}}}),Wm=z("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=nm),De.init(t,e)}),Gm=z("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=rm),De.init(t,e),t._zod.check=n=>{const[r,i]=n.value.split("/");try{if(!i)throw new Error;const s=Number(i);if(`${s}`!==i)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${r}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:t,continue:!e.abort})}}});function jl(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}const Km=z("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=im),De.init(t,e),t._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64"}),t._zod.check=n=>{jl(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:t,continue:!e.abort})}});function Qm(t){if(!Dl.test(t))return!1;const e=t.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=e.padEnd(Math.ceil(e.length/4)*4,"=");return jl(n)}const Xm=z("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=Dl),De.init(t,e),t._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64url"}),t._zod.check=n=>{Qm(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:t,continue:!e.abort})}}),Jm=z("$ZodE164",(t,e)=>{e.pattern??(e.pattern=am),De.init(t,e)});function e0(t,e=null){try{const n=t.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const i=JSON.parse(atob(r));return!("typ"in i&&i?.typ!=="JWT"||!i.alg||e&&(!("alg"in i)||i.alg!==e))}catch{return!1}}const t0=z("$ZodJWT",(t,e)=>{De.init(t,e),t._zod.check=n=>{e0(n.value,e.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:t,continue:!e.abort})}}),Ul=z("$ZodNumber",(t,e)=>{ve.init(t,e),t._zod.pattern=t._zod.bag.pattern??fm,t._zod.parse=(n,r)=>{if(e.coerce)try{n.value=Number(n.value)}catch{}const i=n.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return n;const s=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:t,...s?{received:s}:{}}),n}}),n0=z("$ZodNumber",(t,e)=>{Em.init(t,e),Ul.init(t,e)}),r0=z("$ZodBoolean",(t,e)=>{ve.init(t,e),t._zod.pattern=hm,t._zod.parse=(n,r)=>{if(e.coerce)try{n.value=!!n.value}catch{}const i=n.value;return typeof i=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:t}),n}}),i0=z("$ZodNull",(t,e)=>{ve.init(t,e),t._zod.pattern=pm,t._zod.values=new Set([null]),t._zod.parse=(n,r)=>{const i=n.value;return i===null||n.issues.push({expected:"null",code:"invalid_type",input:i,inst:t}),n}}),s0=z("$ZodUnknown",(t,e)=>{ve.init(t,e),t._zod.parse=n=>n}),a0=z("$ZodNever",(t,e)=>{ve.init(t,e),t._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:t}),n)});function oo(t,e,n){t.issues.length&&e.issues.push(...an(n,t.issues)),e.value[n]=t.value}const o0=z("$ZodArray",(t,e)=>{ve.init(t,e),t._zod.parse=(n,r)=>{const i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:t}),n;n.value=Array(i.length);const s=[];for(let a=0;a<i.length;a++){const o=i[a],u=e.element._zod.run({value:o,issues:[]},r);u instanceof Promise?s.push(u.then(l=>oo(l,n,a))):oo(u,n,a)}return s.length?Promise.all(s).then(()=>n):n}});function Zr(t,e,n){t.issues.length&&e.issues.push(...an(n,t.issues)),e.value[n]=t.value}function uo(t,e,n,r){t.issues.length?r[n]===void 0?n in r?e.value[n]=void 0:e.value[n]=t.value:e.issues.push(...an(n,t.issues)):t.value===void 0?n in r&&(e.value[n]=void 0):e.value[n]=t.value}const u0=z("$ZodObject",(t,e)=>{ve.init(t,e);const n=hl(()=>{const c=Object.keys(e.shape);for(const p of c)if(!(e.shape[p]instanceof ve))throw new Error(`Invalid element at key "${p}": expected a Zod schema`);const h=Bh(e.shape);return{shape:e.shape,keys:c,keySet:new Set(c),numKeys:c.length,optionalKeys:new Set(h)}});ke(t._zod,"propValues",()=>{const c=e.shape,h={};for(const p in c){const g=c[p]._zod;if(g.values){h[p]??(h[p]=new Set);for(const b of g.values)h[p].add(b)}}return h});const r=c=>{const h=new wm(["shape","payload","ctx"]),p=n.value,g=k=>{const y=Wn(k);return`shape[${y}]._zod.run({ value: input[${y}], issues: [] }, ctx)`};h.write("const input = payload.value;");const b=Object.create(null);let x=0;for(const k of p.keys)b[k]=`key_${x++}`;h.write("const newResult = {}");for(const k of p.keys)if(p.optionalKeys.has(k)){const y=b[k];h.write(`const ${y} = ${g(k)};`);const _=Wn(k);h.write(`
|
|
5
|
-
if (${y}.issues.length) {
|
|
6
|
-
if (input[${_}] === undefined) {
|
|
7
|
-
if (${_} in input) {
|
|
8
|
-
newResult[${_}] = undefined;
|
|
9
|
-
}
|
|
10
|
-
} else {
|
|
11
|
-
payload.issues = payload.issues.concat(
|
|
12
|
-
${y}.issues.map((iss) => ({
|
|
13
|
-
...iss,
|
|
14
|
-
path: iss.path ? [${_}, ...iss.path] : [${_}],
|
|
15
|
-
}))
|
|
16
|
-
);
|
|
17
|
-
}
|
|
18
|
-
} else if (${y}.value === undefined) {
|
|
19
|
-
if (${_} in input) newResult[${_}] = undefined;
|
|
20
|
-
} else {
|
|
21
|
-
newResult[${_}] = ${y}.value;
|
|
22
|
-
}
|
|
23
|
-
`)}else{const y=b[k];h.write(`const ${y} = ${g(k)};`),h.write(`
|
|
24
|
-
if (${y}.issues.length) payload.issues = payload.issues.concat(${y}.issues.map(iss => ({
|
|
25
|
-
...iss,
|
|
26
|
-
path: iss.path ? [${Wn(k)}, ...iss.path] : [${Wn(k)}]
|
|
27
|
-
})));`),h.write(`newResult[${Wn(k)}] = ${y}.value`)}h.write("payload.value = newResult;"),h.write("return payload;");const E=h.compile();return(k,y)=>E(c,k,y)};let i;const s=pl,a=!Lh.jitless,u=a&&Dh.value,l=e.catchall;let d;t._zod.parse=(c,h)=>{d??(d=n.value);const p=c.value;if(!s(p))return c.issues.push({expected:"object",code:"invalid_type",input:p,inst:t}),c;const g=[];if(a&&u&&h?.async===!1&&h.jitless!==!0)i||(i=r(e.shape)),c=i(c,h);else{c.value={};const y=d.shape;for(const _ of d.keys){const R=y[_],S=R._zod.run({value:p[_],issues:[]},h),w=R._zod.optin==="optional"&&R._zod.optout==="optional";S instanceof Promise?g.push(S.then(O=>w?uo(O,c,_,p):Zr(O,c,_))):w?uo(S,c,_,p):Zr(S,c,_)}}if(!l)return g.length?Promise.all(g).then(()=>c):c;const b=[],x=d.keySet,E=l._zod,k=E.def.type;for(const y of Object.keys(p)){if(x.has(y))continue;if(k==="never"){b.push(y);continue}const _=E.run({value:p[y],issues:[]},h);_ instanceof Promise?g.push(_.then(R=>Zr(R,c,y))):Zr(_,c,y)}return b.length&&c.issues.push({code:"unrecognized_keys",keys:b,input:p,inst:t}),g.length?Promise.all(g).then(()=>c):c}});function lo(t,e,n,r){for(const i of t)if(i.issues.length===0)return e.value=i.value,e;return e.issues.push({code:"invalid_union",input:e.value,inst:n,errors:t.map(i=>i.issues.map(s=>ci(s,r,di())))}),e}const Hl=z("$ZodUnion",(t,e)=>{ve.init(t,e),ke(t._zod,"optin",()=>e.options.some(n=>n._zod.optin==="optional")?"optional":void 0),ke(t._zod,"optout",()=>e.options.some(n=>n._zod.optout==="optional")?"optional":void 0),ke(t._zod,"values",()=>{if(e.options.every(n=>n._zod.values))return new Set(e.options.flatMap(n=>Array.from(n._zod.values)))}),ke(t._zod,"pattern",()=>{if(e.options.every(n=>n._zod.pattern)){const n=e.options.map(r=>r._zod.pattern);return new RegExp(`^(${n.map(r=>la(r.source)).join("|")})$`)}}),t._zod.parse=(n,r)=>{let i=!1;const s=[];for(const a of e.options){const o=a._zod.run({value:n.value,issues:[]},r);if(o instanceof Promise)s.push(o),i=!0;else{if(o.issues.length===0)return o;s.push(o)}}return i?Promise.all(s).then(a=>lo(a,n,t,r)):lo(s,n,t,r)}}),l0=z("$ZodDiscriminatedUnion",(t,e)=>{Hl.init(t,e);const n=t._zod.parse;ke(t._zod,"propValues",()=>{const i={};for(const s of e.options){const a=s._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(const[o,u]of Object.entries(a)){i[o]||(i[o]=new Set);for(const l of u)i[o].add(l)}}return i});const r=hl(()=>{const i=e.options,s=new Map;for(const a of i){const o=a._zod.propValues[e.discriminator];if(!o||o.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(a)}"`);for(const u of o){if(s.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);s.set(u,a)}}return s});t._zod.parse=(i,s)=>{const a=i.value;if(!pl(a))return i.issues.push({code:"invalid_type",expected:"object",input:a,inst:t}),i;const o=r.value.get(a?.[e.discriminator]);return o?o._zod.run(i,s):e.unionFallback?n(i,s):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:a,path:[e.discriminator],inst:t}),i)}}),c0=z("$ZodIntersection",(t,e)=>{ve.init(t,e),t._zod.parse=(n,r)=>{const i=n.value,s=e.left._zod.run({value:i,issues:[]},r),a=e.right._zod.run({value:i,issues:[]},r);return s instanceof Promise||a instanceof Promise?Promise.all([s,a]).then(([u,l])=>co(n,u,l)):co(n,s,a)}});function Os(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(ws(t)&&ws(e)){const n=Object.keys(e),r=Object.keys(t).filter(s=>n.indexOf(s)!==-1),i={...t,...e};for(const s of r){const a=Os(t[s],e[s]);if(!a.valid)return{valid:!1,mergeErrorPath:[s,...a.mergeErrorPath]};i[s]=a.data}return{valid:!0,data:i}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<t.length;r++){const i=t[r],s=e[r],a=Os(i,s);if(!a.valid)return{valid:!1,mergeErrorPath:[r,...a.mergeErrorPath]};n.push(a.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function co(t,e,n){if(e.issues.length&&t.issues.push(...e.issues),n.issues.length&&t.issues.push(...n.issues),cr(t))return t;const r=Os(e.value,n.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return t.value=r.data,t}const d0=z("$ZodRecord",(t,e)=>{ve.init(t,e),t._zod.parse=(n,r)=>{const i=n.value;if(!ws(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:t}),n;const s=[];if(e.keyType._zod.values){const a=e.keyType._zod.values;n.value={};for(const u of a)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){const l=e.valueType._zod.run({value:i[u],issues:[]},r);l instanceof Promise?s.push(l.then(d=>{d.issues.length&&n.issues.push(...an(u,d.issues)),n.value[u]=d.value})):(l.issues.length&&n.issues.push(...an(u,l.issues)),n.value[u]=l.value)}let o;for(const u in i)a.has(u)||(o=o??[],o.push(u));o&&o.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:t,keys:o})}else{n.value={};for(const a of Reflect.ownKeys(i)){if(a==="__proto__")continue;const o=e.keyType._zod.run({value:a,issues:[]},r);if(o instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(o.issues.length){n.issues.push({origin:"record",code:"invalid_key",issues:o.issues.map(l=>ci(l,r,di())),input:a,path:[a],inst:t}),n.value[o.value]=o.value;continue}const u=e.valueType._zod.run({value:i[a],issues:[]},r);u instanceof Promise?s.push(u.then(l=>{l.issues.length&&n.issues.push(...an(a,l.issues)),n.value[o.value]=l.value})):(u.issues.length&&n.issues.push(...an(a,u.issues)),n.value[o.value]=u.value)}}return s.length?Promise.all(s).then(()=>n):n}}),f0=z("$ZodEnum",(t,e)=>{ve.init(t,e);const n=ml(e.entries);t._zod.values=new Set(n),t._zod.pattern=new RegExp(`^(${n.filter(r=>Fh.has(typeof r)).map(r=>typeof r=="string"?wr(r):r.toString()).join("|")})$`),t._zod.parse=(r,i)=>{const s=r.value;return t._zod.values.has(s)||r.issues.push({code:"invalid_value",values:n,input:s,inst:t}),r}}),h0=z("$ZodLiteral",(t,e)=>{ve.init(t,e),t._zod.values=new Set(e.values),t._zod.pattern=new RegExp(`^(${e.values.map(n=>typeof n=="string"?wr(n):n?n.toString():String(n)).join("|")})$`),t._zod.parse=(n,r)=>{const i=n.value;return t._zod.values.has(i)||n.issues.push({code:"invalid_value",values:e.values,input:i,inst:t}),n}}),p0=z("$ZodTransform",(t,e)=>{ve.init(t,e),t._zod.parse=(n,r)=>{const i=e.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(a=>(n.value=a,n));if(i instanceof Promise)throw new vs;return n.value=i,n}}),m0=z("$ZodOptional",(t,e)=>{ve.init(t,e),t._zod.optin="optional",t._zod.optout="optional",ke(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),ke(t._zod,"pattern",()=>{const n=e.innerType._zod.pattern;return n?new RegExp(`^(${la(n.source)})?$`):void 0}),t._zod.parse=(n,r)=>e.innerType._zod.optin==="optional"?e.innerType._zod.run(n,r):n.value===void 0?n:e.innerType._zod.run(n,r)}),g0=z("$ZodNullable",(t,e)=>{ve.init(t,e),ke(t._zod,"optin",()=>e.innerType._zod.optin),ke(t._zod,"optout",()=>e.innerType._zod.optout),ke(t._zod,"pattern",()=>{const n=e.innerType._zod.pattern;return n?new RegExp(`^(${la(n.source)}|null)$`):void 0}),ke(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(n,r)=>n.value===null?n:e.innerType._zod.run(n,r)}),b0=z("$ZodDefault",(t,e)=>{ve.init(t,e),t._zod.optin="optional",ke(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,r)=>{if(n.value===void 0)return n.value=e.defaultValue,n;const i=e.innerType._zod.run(n,r);return i instanceof Promise?i.then(s=>fo(s,e)):fo(i,e)}});function fo(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}const E0=z("$ZodPrefault",(t,e)=>{ve.init(t,e),t._zod.optin="optional",ke(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,r)=>(n.value===void 0&&(n.value=e.defaultValue),e.innerType._zod.run(n,r))}),x0=z("$ZodNonOptional",(t,e)=>{ve.init(t,e),ke(t._zod,"values",()=>{const n=e.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),t._zod.parse=(n,r)=>{const i=e.innerType._zod.run(n,r);return i instanceof Promise?i.then(s=>ho(s,t)):ho(i,t)}});function ho(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}const T0=z("$ZodCatch",(t,e)=>{ve.init(t,e),t._zod.optin="optional",ke(t._zod,"optout",()=>e.innerType._zod.optout),ke(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,r)=>{const i=e.innerType._zod.run(n,r);return i instanceof Promise?i.then(s=>(n.value=s.value,s.issues.length&&(n.value=e.catchValue({...n,error:{issues:s.issues.map(a=>ci(a,r,di()))},input:n.value}),n.issues=[]),n)):(n.value=i.value,i.issues.length&&(n.value=e.catchValue({...n,error:{issues:i.issues.map(s=>ci(s,r,di()))},input:n.value}),n.issues=[]),n)}}),_0=z("$ZodPipe",(t,e)=>{ve.init(t,e),ke(t._zod,"values",()=>e.in._zod.values),ke(t._zod,"optin",()=>e.in._zod.optin),ke(t._zod,"optout",()=>e.out._zod.optout),t._zod.parse=(n,r)=>{const i=e.in._zod.run(n,r);return i instanceof Promise?i.then(s=>po(s,e,r)):po(i,e,r)}});function po(t,e,n){return cr(t)?t:e.out._zod.run({value:t.value,issues:t.issues},n)}const y0=z("$ZodReadonly",(t,e)=>{ve.init(t,e),ke(t._zod,"propValues",()=>e.innerType._zod.propValues),ke(t._zod,"values",()=>e.innerType._zod.values),ke(t._zod,"optin",()=>e.innerType._zod.optin),ke(t._zod,"optout",()=>e.innerType._zod.optout),t._zod.parse=(n,r)=>{const i=e.innerType._zod.run(n,r);return i instanceof Promise?i.then(mo):mo(i)}});function mo(t){return t.value=Object.freeze(t.value),t}const k0=z("$ZodLazy",(t,e)=>{ve.init(t,e),ke(t._zod,"innerType",()=>e.getter()),ke(t._zod,"pattern",()=>t._zod.innerType._zod.pattern),ke(t._zod,"propValues",()=>t._zod.innerType._zod.propValues),ke(t._zod,"optin",()=>t._zod.innerType._zod.optin),ke(t._zod,"optout",()=>t._zod.innerType._zod.optout),t._zod.parse=(n,r)=>t._zod.innerType._zod.run(n,r)}),A0=z("$ZodCustom",(t,e)=>{ut.init(t,e),ve.init(t,e),t._zod.parse=(n,r)=>n,t._zod.check=n=>{const r=n.value,i=e.fn(r);if(i instanceof Promise)return i.then(s=>go(s,n,r,t));go(i,n,r,t)}});function go(t,e,n,r){if(!t){const i={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(i.params=r._zod.def.params),e.issues.push(_r(i))}}class $l{constructor(){this._map=new Map,this._idmap=new Map}add(e,...n){const r=n[0];if(this._map.set(e,r),r&&typeof r=="object"&&"id"in r){if(this._idmap.has(r.id))throw new Error(`ID ${r.id} already exists in the registry`);this._idmap.set(r.id,e)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(e){const n=this._map.get(e);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(e),this}get(e){const n=e._zod.parent;if(n){const r={...this.get(n)??{}};return delete r.id,{...r,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}}function S0(){return new $l}const rr=S0();function C0(t,e){return new t({type:"string",...ee(e)})}function I0(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...ee(e)})}function bo(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...ee(e)})}function N0(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...ee(e)})}function w0(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ee(e)})}function v0(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ee(e)})}function R0(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ee(e)})}function O0(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...ee(e)})}function L0(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...ee(e)})}function D0(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...ee(e)})}function P0(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...ee(e)})}function M0(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...ee(e)})}function B0(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...ee(e)})}function F0(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...ee(e)})}function z0(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...ee(e)})}function j0(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...ee(e)})}function U0(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...ee(e)})}function H0(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ee(e)})}function $0(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ee(e)})}function Z0(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...ee(e)})}function Y0(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...ee(e)})}function q0(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...ee(e)})}function V0(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...ee(e)})}function W0(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ee(e)})}function G0(t,e){return new t({type:"string",format:"date",check:"string_format",...ee(e)})}function K0(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...ee(e)})}function Q0(t,e){return new t({type:"string",format:"duration",check:"string_format",...ee(e)})}function X0(t,e){return new t({type:"number",checks:[],...ee(e)})}function J0(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...ee(e)})}function e1(t,e){return new t({type:"boolean",...ee(e)})}function t1(t,e){return new t({type:"null",...ee(e)})}function n1(t){return new t({type:"unknown"})}function r1(t,e){return new t({type:"never",...ee(e)})}function Eo(t,e){return new Fl({check:"less_than",...ee(e),value:t,inclusive:!1})}function Qi(t,e){return new Fl({check:"less_than",...ee(e),value:t,inclusive:!0})}function xo(t,e){return new zl({check:"greater_than",...ee(e),value:t,inclusive:!1})}function Xi(t,e){return new zl({check:"greater_than",...ee(e),value:t,inclusive:!0})}function To(t,e){return new bm({check:"multiple_of",...ee(e),value:t})}function Zl(t,e){return new xm({check:"max_length",...ee(e),maximum:t})}function fi(t,e){return new Tm({check:"min_length",...ee(e),minimum:t})}function Yl(t,e){return new _m({check:"length_equals",...ee(e),length:t})}function i1(t,e){return new ym({check:"string_format",format:"regex",...ee(e),pattern:t})}function s1(t){return new km({check:"string_format",format:"lowercase",...ee(t)})}function a1(t){return new Am({check:"string_format",format:"uppercase",...ee(t)})}function o1(t,e){return new Sm({check:"string_format",format:"includes",...ee(e),includes:t})}function u1(t,e){return new Cm({check:"string_format",format:"starts_with",...ee(e),prefix:t})}function l1(t,e){return new Im({check:"string_format",format:"ends_with",...ee(e),suffix:t})}function Lr(t){return new Nm({check:"overwrite",tx:t})}function c1(t){return Lr(e=>e.normalize(t))}function d1(){return Lr(t=>t.trim())}function f1(){return Lr(t=>t.toLowerCase())}function h1(){return Lr(t=>t.toUpperCase())}function p1(t,e,n){return new t({type:"array",element:e,...ee(n)})}function m1(t,e,n){const r=ee(n);return r.abort??(r.abort=!0),new t({type:"custom",check:"custom",fn:e,...r})}function g1(t,e,n){return new t({type:"custom",check:"custom",fn:e,...ee(n)})}class _o{constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??rr,this.target=e?.target??"draft-2020-12",this.unrepresentable=e?.unrepresentable??"throw",this.override=e?.override??(()=>{}),this.io=e?.io??"output",this.seen=new Map}process(e,n={path:[],schemaPath:[]}){var r;const i=e._zod.def,s={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},a=this.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;const o={schema:{},count:1,cycle:void 0,path:n.path};this.seen.set(e,o);const u=e._zod.toJSONSchema?.();if(u)o.schema=u;else{const c={...n,schemaPath:[...n.schemaPath,e],path:n.path},h=e._zod.parent;if(h)o.ref=h,this.process(h,c),this.seen.get(h).isParent=!0;else{const p=o.schema;switch(i.type){case"string":{const g=p;g.type="string";const{minimum:b,maximum:x,format:E,patterns:k,contentEncoding:y}=e._zod.bag;if(typeof b=="number"&&(g.minLength=b),typeof x=="number"&&(g.maxLength=x),E&&(g.format=s[E]??E,g.format===""&&delete g.format),y&&(g.contentEncoding=y),k&&k.size>0){const _=[...k];_.length===1?g.pattern=_[0].source:_.length>1&&(o.schema.allOf=[..._.map(R=>({...this.target==="draft-7"?{type:"string"}:{},pattern:R.source}))])}break}case"number":{const g=p,{minimum:b,maximum:x,format:E,multipleOf:k,exclusiveMaximum:y,exclusiveMinimum:_}=e._zod.bag;typeof E=="string"&&E.includes("int")?g.type="integer":g.type="number",typeof _=="number"&&(g.exclusiveMinimum=_),typeof b=="number"&&(g.minimum=b,typeof _=="number"&&(_>=b?delete g.minimum:delete g.exclusiveMinimum)),typeof y=="number"&&(g.exclusiveMaximum=y),typeof x=="number"&&(g.maximum=x,typeof y=="number"&&(y<=x?delete g.maximum:delete g.exclusiveMaximum)),typeof k=="number"&&(g.multipleOf=k);break}case"boolean":{const g=p;g.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"null":{p.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"never":{p.not={};break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{const g=p,{minimum:b,maximum:x}=e._zod.bag;typeof b=="number"&&(g.minItems=b),typeof x=="number"&&(g.maxItems=x),g.type="array",g.items=this.process(i.element,{...c,path:[...c.path,"items"]});break}case"object":{const g=p;g.type="object",g.properties={};const b=i.shape;for(const k in b)g.properties[k]=this.process(b[k],{...c,path:[...c.path,"properties",k]});const x=new Set(Object.keys(b)),E=new Set([...x].filter(k=>{const y=i.shape[k]._zod;return this.io==="input"?y.optin===void 0:y.optout===void 0}));E.size>0&&(g.required=Array.from(E)),i.catchall?._zod.def.type==="never"?g.additionalProperties=!1:i.catchall?i.catchall&&(g.additionalProperties=this.process(i.catchall,{...c,path:[...c.path,"additionalProperties"]})):this.io==="output"&&(g.additionalProperties=!1);break}case"union":{const g=p;g.anyOf=i.options.map((b,x)=>this.process(b,{...c,path:[...c.path,"anyOf",x]}));break}case"intersection":{const g=p,b=this.process(i.left,{...c,path:[...c.path,"allOf",0]}),x=this.process(i.right,{...c,path:[...c.path,"allOf",1]}),E=y=>"allOf"in y&&Object.keys(y).length===1,k=[...E(b)?b.allOf:[b],...E(x)?x.allOf:[x]];g.allOf=k;break}case"tuple":{const g=p;g.type="array";const b=i.items.map((k,y)=>this.process(k,{...c,path:[...c.path,"prefixItems",y]}));if(this.target==="draft-2020-12"?g.prefixItems=b:g.items=b,i.rest){const k=this.process(i.rest,{...c,path:[...c.path,"items"]});this.target==="draft-2020-12"?g.items=k:g.additionalItems=k}i.rest&&(g.items=this.process(i.rest,{...c,path:[...c.path,"items"]}));const{minimum:x,maximum:E}=e._zod.bag;typeof x=="number"&&(g.minItems=x),typeof E=="number"&&(g.maxItems=E);break}case"record":{const g=p;g.type="object",g.propertyNames=this.process(i.keyType,{...c,path:[...c.path,"propertyNames"]}),g.additionalProperties=this.process(i.valueType,{...c,path:[...c.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{const g=p,b=ml(i.entries);b.every(x=>typeof x=="number")&&(g.type="number"),b.every(x=>typeof x=="string")&&(g.type="string"),g.enum=b;break}case"literal":{const g=p,b=[];for(const x of i.values)if(x===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof x=="bigint"){if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");b.push(Number(x))}else b.push(x);if(b.length!==0)if(b.length===1){const x=b[0];g.type=x===null?"null":typeof x,g.const=x}else b.every(x=>typeof x=="number")&&(g.type="number"),b.every(x=>typeof x=="string")&&(g.type="string"),b.every(x=>typeof x=="boolean")&&(g.type="string"),b.every(x=>x===null)&&(g.type="null"),g.enum=b;break}case"file":{const g=p,b={type:"string",format:"binary",contentEncoding:"binary"},{minimum:x,maximum:E,mime:k}=e._zod.bag;x!==void 0&&(b.minLength=x),E!==void 0&&(b.maxLength=E),k?k.length===1?(b.contentMediaType=k[0],Object.assign(g,b)):g.anyOf=k.map(y=>({...b,contentMediaType:y})):Object.assign(g,b);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{const g=this.process(i.innerType,c);p.anyOf=[g,{type:"null"}];break}case"nonoptional":{this.process(i.innerType,c),o.ref=i.innerType;break}case"success":{const g=p;g.type="boolean";break}case"default":{this.process(i.innerType,c),o.ref=i.innerType,p.default=JSON.parse(JSON.stringify(i.defaultValue));break}case"prefault":{this.process(i.innerType,c),o.ref=i.innerType,this.io==="input"&&(p._prefault=JSON.parse(JSON.stringify(i.defaultValue)));break}case"catch":{this.process(i.innerType,c),o.ref=i.innerType;let g;try{g=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}p.default=g;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{const g=p,b=e._zod.pattern;if(!b)throw new Error("Pattern not found in template literal");g.type="string",g.pattern=b.source;break}case"pipe":{const g=this.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;this.process(g,c),o.ref=g;break}case"readonly":{this.process(i.innerType,c),o.ref=i.innerType,p.readOnly=!0;break}case"promise":{this.process(i.innerType,c),o.ref=i.innerType;break}case"optional":{this.process(i.innerType,c),o.ref=i.innerType;break}case"lazy":{const g=e._zod.innerType;this.process(g,c),o.ref=g;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}}}}const l=this.metadataRegistry.get(e);return l&&Object.assign(o.schema,l),this.io==="input"&&Ze(e)&&(delete o.schema.examples,delete o.schema.default),this.io==="input"&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,this.seen.get(e).schema}emit(e,n){const r={cycles:n?.cycles??"ref",reused:n?.reused??"inline",external:n?.external??void 0},i=this.seen.get(e);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const s=d=>{const c=this.target==="draft-2020-12"?"$defs":"definitions";if(r.external){const b=r.external.registry.get(d[0])?.id,x=r.external.uri??(k=>k);if(b)return{ref:x(b)};const E=d[1].defId??d[1].schema.id??`schema${this.counter++}`;return d[1].defId=E,{defId:E,ref:`${x("__shared")}#/${c}/${E}`}}if(d[1]===i)return{ref:"#"};const p=`#/${c}/`,g=d[1].schema.id??`__schema${this.counter++}`;return{defId:g,ref:p+g}},a=d=>{if(d[1].schema.$ref)return;const c=d[1],{ref:h,defId:p}=s(d);c.def={...c.schema},p&&(c.defId=p);const g=c.schema;for(const b in g)delete g[b];g.$ref=h};if(r.cycles==="throw")for(const d of this.seen.entries()){const c=d[1];if(c.cycle)throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
|
|
28
|
-
|
|
29
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const d of this.seen.entries()){const c=d[1];if(e===d[0]){a(d);continue}if(r.external){const p=r.external.registry.get(d[0])?.id;if(e!==d[0]&&p){a(d);continue}}if(this.metadataRegistry.get(d[0])?.id){a(d);continue}if(c.cycle){a(d);continue}if(c.count>1&&r.reused==="ref"){a(d);continue}}const o=(d,c)=>{const h=this.seen.get(d),p=h.def??h.schema,g={...p};if(h.ref===null)return;const b=h.ref;if(h.ref=null,b){o(b,c);const x=this.seen.get(b).schema;x.$ref&&c.target==="draft-7"?(p.allOf=p.allOf??[],p.allOf.push(x)):(Object.assign(p,x),Object.assign(p,g))}h.isParent||this.override({zodSchema:d,jsonSchema:p,path:h.path??[]})};for(const d of[...this.seen.entries()].reverse())o(d[0],{target:this.target});const u={};if(this.target==="draft-2020-12"?u.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?u.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),r.external?.uri){const d=r.external.registry.get(e)?.id;if(!d)throw new Error("Schema is missing an `id` property");u.$id=r.external.uri(d)}Object.assign(u,i.def);const l=r.external?.defs??{};for(const d of this.seen.entries()){const c=d[1];c.def&&c.defId&&(l[c.defId]=c.def)}r.external||Object.keys(l).length>0&&(this.target==="draft-2020-12"?u.$defs=l:u.definitions=l);try{return JSON.parse(JSON.stringify(u))}catch{throw new Error("Error converting schema to JSON.")}}}function b1(t,e){if(t instanceof $l){const r=new _o(e),i={};for(const o of t._idmap.entries()){const[u,l]=o;r.process(l)}const s={},a={registry:t,uri:e?.uri,defs:i};for(const o of t._idmap.entries()){const[u,l]=o;s[u]=r.emit(l,{...e,external:a})}if(Object.keys(i).length>0){const o=r.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[o]:i}}return{schemas:s}}const n=new _o(e);return n.process(t),n.emit(t,e)}function Ze(t,e){const n=e??{seen:new Set};if(n.seen.has(t))return!1;n.seen.add(t);const i=t._zod.def;switch(i.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return Ze(i.element,n);case"object":{for(const s in i.shape)if(Ze(i.shape[s],n))return!0;return!1}case"union":{for(const s of i.options)if(Ze(s,n))return!0;return!1}case"intersection":return Ze(i.left,n)||Ze(i.right,n);case"tuple":{for(const s of i.items)if(Ze(s,n))return!0;return!!(i.rest&&Ze(i.rest,n))}case"record":return Ze(i.keyType,n)||Ze(i.valueType,n);case"map":return Ze(i.keyType,n)||Ze(i.valueType,n);case"set":return Ze(i.valueType,n);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return Ze(i.innerType,n);case"lazy":return Ze(i.getter(),n);case"default":return Ze(i.innerType,n);case"prefault":return Ze(i.innerType,n);case"custom":return!1;case"transform":return!0;case"pipe":return Ze(i.in,n)||Ze(i.out,n);case"success":return!1;case"catch":return!1}throw new Error(`Unknown schema type: ${i.type}`)}function E1(t,e){const n=F.c(4);let r;n[0]!==e?(r={},n[0]=e,n[1]=r):r=n[1];const i=r,s=t??yl;let a;return n[2]!==s?(a=Al(s),n[2]=s,n[3]=a):a=n[3],kl(s,"AGENT",a,i)}function x1(t,e){const n=F.c(4);let r;n[0]!==e?(r={},n[0]=e,n[1]=r):r=n[1];const i=r,s=t??yl;let a;return n[2]!==s?(a=Al(s),n[2]=s,n[3]=a):a=n[3],kl(s,"LLM",a,i)}function wi(){const t=F.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=Or.decoChatOpen(),t[0]=e):e=t[0];const[n,r]=On(e,T1);let i;return t[1]!==n||t[2]!==r?(i=[n,r],t[1]=n,t[2]=r,t[3]=i):i=t[3],i}function T1(t){return!!(t??!1)}var ql="vercel.ai.error",_1=Symbol.for(ql),Vl,y1=class Wl extends Error{constructor({name:e,message:n,cause:r}){super(n),this[Vl]=!0,this.name=e,this.cause=r}static isInstance(e){return Wl.hasMarker(e,ql)}static hasMarker(e,n){const r=Symbol.for(n);return e!=null&&typeof e=="object"&&r in e&&typeof e[r]=="boolean"&&e[r]===!0}};Vl=_1;var Vt=y1;function Gl(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var Kl="AI_InvalidArgumentError",Ql=`vercel.ai.error.${Kl}`,k1=Symbol.for(Ql),Xl,A1=class extends Vt{constructor({message:t,cause:e,argument:n}){super({name:Kl,message:t,cause:e}),this[Xl]=!0,this.argument=n}static isInstance(t){return Vt.hasMarker(t,Ql)}};Xl=k1;var Jl="AI_JSONParseError",ec=`vercel.ai.error.${Jl}`,S1=Symbol.for(ec),tc,yo=class extends Vt{constructor({text:t,cause:e}){super({name:Jl,message:`JSON parsing failed: Text: ${t}.
|
|
30
|
-
Error message: ${Gl(e)}`,cause:e}),this[tc]=!0,this.text=t}static isInstance(t){return Vt.hasMarker(t,ec)}};tc=S1;var nc="AI_TypeValidationError",rc=`vercel.ai.error.${nc}`,C1=Symbol.for(rc),ic,I1=class Ls extends Vt{constructor({value:e,cause:n}){super({name:nc,message:`Type validation failed: Value: ${JSON.stringify(e)}.
|
|
31
|
-
Error message: ${Gl(n)}`,cause:n}),this[ic]=!0,this.value=e}static isInstance(e){return Vt.hasMarker(e,rc)}static wrap({value:e,cause:n}){return Ls.isInstance(n)&&n.value===e?n:new Ls({value:e,cause:n})}};ic=C1;var hi=I1;const N1=z("ZodISODateTime",(t,e)=>{Hm.init(t,e),Fe.init(t,e)});function w1(t){return W0(N1,t)}const v1=z("ZodISODate",(t,e)=>{$m.init(t,e),Fe.init(t,e)});function R1(t){return G0(v1,t)}const O1=z("ZodISOTime",(t,e)=>{Zm.init(t,e),Fe.init(t,e)});function L1(t){return K0(O1,t)}const D1=z("ZodISODuration",(t,e)=>{Ym.init(t,e),Fe.init(t,e)});function P1(t){return Q0(D1,t)}const M1=(t,e)=>{zh.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:n=>Uh(t,n)},flatten:{value:n=>jh(t,n)},addIssue:{value:n=>t.issues.push(n)},addIssues:{value:n=>t.issues.push(...n)},isEmpty:{get(){return t.issues.length===0}}})},vi=z("ZodError",M1,{Parent:Error}),B1=Hh(vi),F1=Zh(vi),z1=$h(vi),sc=Yh(vi),Pe=z("ZodType",(t,e)=>(ve.init(t,e),t.def=e,Object.defineProperty(t,"_def",{value:e}),t.check=(...n)=>t.clone({...e,checks:[...e.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),t.clone=(n,r)=>Xh(t,n,r),t.brand=()=>t,t.register=((n,r)=>(n.add(t,r),t)),t.parse=(n,r)=>B1(t,n,r,{callee:t.parse}),t.safeParse=(n,r)=>z1(t,n,r),t.parseAsync=async(n,r)=>F1(t,n,r,{callee:t.parseAsync}),t.safeParseAsync=async(n,r)=>sc(t,n,r),t.spa=t.safeParseAsync,t.refine=(n,r)=>t.check(Dg(n,r)),t.superRefine=n=>t.check(Pg(n)),t.overwrite=n=>t.check(Lr(n)),t.optional=()=>So(t),t.nullable=()=>Co(t),t.nullish=()=>So(Co(t)),t.nonoptional=n=>Sg(t,n),t.array=()=>zn(t),t.or=n=>Et([t,n]),t.and=n=>mg(t,n),t.transform=n=>Io(t,xg(n)),t.default=n=>yg(t,n),t.prefault=n=>Ag(t,n),t.catch=n=>Ig(t,n),t.pipe=n=>Io(t,n),t.readonly=()=>vg(t),t.describe=n=>{const r=t.clone();return rr.add(r,{description:n}),r},Object.defineProperty(t,"description",{get(){return rr.get(t)?.description},configurable:!0}),t.meta=(...n)=>{if(n.length===0)return rr.get(t);const r=t.clone();return rr.add(r,n[0]),r},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t)),ac=z("_ZodString",(t,e)=>{fa.init(t,e),Pe.init(t,e);const n=t._zod.bag;t.format=n.format??null,t.minLength=n.minimum??null,t.maxLength=n.maximum??null,t.regex=(...r)=>t.check(i1(...r)),t.includes=(...r)=>t.check(o1(...r)),t.startsWith=(...r)=>t.check(u1(...r)),t.endsWith=(...r)=>t.check(l1(...r)),t.min=(...r)=>t.check(fi(...r)),t.max=(...r)=>t.check(Zl(...r)),t.length=(...r)=>t.check(Yl(...r)),t.nonempty=(...r)=>t.check(fi(1,...r)),t.lowercase=r=>t.check(s1(r)),t.uppercase=r=>t.check(a1(r)),t.trim=()=>t.check(d1()),t.normalize=(...r)=>t.check(c1(...r)),t.toLowerCase=()=>t.check(f1()),t.toUpperCase=()=>t.check(h1())}),j1=z("ZodString",(t,e)=>{fa.init(t,e),ac.init(t,e),t.email=n=>t.check(I0(U1,n)),t.url=n=>t.check(O0(H1,n)),t.jwt=n=>t.check(V0(rg,n)),t.emoji=n=>t.check(L0($1,n)),t.guid=n=>t.check(bo(ko,n)),t.uuid=n=>t.check(N0(Yr,n)),t.uuidv4=n=>t.check(w0(Yr,n)),t.uuidv6=n=>t.check(v0(Yr,n)),t.uuidv7=n=>t.check(R0(Yr,n)),t.nanoid=n=>t.check(D0(Z1,n)),t.guid=n=>t.check(bo(ko,n)),t.cuid=n=>t.check(P0(Y1,n)),t.cuid2=n=>t.check(M0(q1,n)),t.ulid=n=>t.check(B0(V1,n)),t.base64=n=>t.check(Z0(eg,n)),t.base64url=n=>t.check(Y0(tg,n)),t.xid=n=>t.check(F0(W1,n)),t.ksuid=n=>t.check(z0(G1,n)),t.ipv4=n=>t.check(j0(K1,n)),t.ipv6=n=>t.check(U0(Q1,n)),t.cidrv4=n=>t.check(H0(X1,n)),t.cidrv6=n=>t.check($0(J1,n)),t.e164=n=>t.check(q0(ng,n)),t.datetime=n=>t.check(w1(n)),t.date=n=>t.check(R1(n)),t.time=n=>t.check(L1(n)),t.duration=n=>t.check(P1(n))});function re(t){return C0(j1,t)}const Fe=z("ZodStringFormat",(t,e)=>{De.init(t,e),ac.init(t,e)}),U1=z("ZodEmail",(t,e)=>{Lm.init(t,e),Fe.init(t,e)}),ko=z("ZodGUID",(t,e)=>{Rm.init(t,e),Fe.init(t,e)}),Yr=z("ZodUUID",(t,e)=>{Om.init(t,e),Fe.init(t,e)}),H1=z("ZodURL",(t,e)=>{Dm.init(t,e),Fe.init(t,e)}),$1=z("ZodEmoji",(t,e)=>{Pm.init(t,e),Fe.init(t,e)}),Z1=z("ZodNanoID",(t,e)=>{Mm.init(t,e),Fe.init(t,e)}),Y1=z("ZodCUID",(t,e)=>{Bm.init(t,e),Fe.init(t,e)}),q1=z("ZodCUID2",(t,e)=>{Fm.init(t,e),Fe.init(t,e)}),V1=z("ZodULID",(t,e)=>{zm.init(t,e),Fe.init(t,e)}),W1=z("ZodXID",(t,e)=>{jm.init(t,e),Fe.init(t,e)}),G1=z("ZodKSUID",(t,e)=>{Um.init(t,e),Fe.init(t,e)}),K1=z("ZodIPv4",(t,e)=>{qm.init(t,e),Fe.init(t,e)}),Q1=z("ZodIPv6",(t,e)=>{Vm.init(t,e),Fe.init(t,e)}),X1=z("ZodCIDRv4",(t,e)=>{Wm.init(t,e),Fe.init(t,e)}),J1=z("ZodCIDRv6",(t,e)=>{Gm.init(t,e),Fe.init(t,e)}),eg=z("ZodBase64",(t,e)=>{Km.init(t,e),Fe.init(t,e)}),tg=z("ZodBase64URL",(t,e)=>{Xm.init(t,e),Fe.init(t,e)}),ng=z("ZodE164",(t,e)=>{Jm.init(t,e),Fe.init(t,e)}),rg=z("ZodJWT",(t,e)=>{t0.init(t,e),Fe.init(t,e)}),oc=z("ZodNumber",(t,e)=>{Ul.init(t,e),Pe.init(t,e),t.gt=(r,i)=>t.check(xo(r,i)),t.gte=(r,i)=>t.check(Xi(r,i)),t.min=(r,i)=>t.check(Xi(r,i)),t.lt=(r,i)=>t.check(Eo(r,i)),t.lte=(r,i)=>t.check(Qi(r,i)),t.max=(r,i)=>t.check(Qi(r,i)),t.int=r=>t.check(Ao(r)),t.safe=r=>t.check(Ao(r)),t.positive=r=>t.check(xo(0,r)),t.nonnegative=r=>t.check(Xi(0,r)),t.negative=r=>t.check(Eo(0,r)),t.nonpositive=r=>t.check(Qi(0,r)),t.multipleOf=(r,i)=>t.check(To(r,i)),t.step=(r,i)=>t.check(To(r,i)),t.finite=()=>t;const n=t._zod.bag;t.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),t.isFinite=!0,t.format=n.format??null});function ig(t){return X0(oc,t)}const sg=z("ZodNumberFormat",(t,e)=>{n0.init(t,e),oc.init(t,e)});function Ao(t){return J0(sg,t)}const ag=z("ZodBoolean",(t,e)=>{r0.init(t,e),Pe.init(t,e)});function st(t){return e1(ag,t)}const og=z("ZodNull",(t,e)=>{i0.init(t,e),Pe.init(t,e)});function ug(t){return t1(og,t)}const lg=z("ZodUnknown",(t,e)=>{s0.init(t,e),Pe.init(t,e)});function Nt(){return n1(lg)}const cg=z("ZodNever",(t,e)=>{a0.init(t,e),Pe.init(t,e)});function uc(t){return r1(cg,t)}const dg=z("ZodArray",(t,e)=>{o0.init(t,e),Pe.init(t,e),t.element=e.element,t.min=(n,r)=>t.check(fi(n,r)),t.nonempty=n=>t.check(fi(1,n)),t.max=(n,r)=>t.check(Zl(n,r)),t.length=(n,r)=>t.check(Yl(n,r)),t.unwrap=()=>t.element});function zn(t,e){return p1(dg,t,e)}const lc=z("ZodObject",(t,e)=>{u0.init(t,e),Pe.init(t,e),ke(t,"shape",()=>e.shape),t.keyof=()=>dc(Object.keys(t._zod.def.shape)),t.catchall=n=>t.clone({...t._zod.def,catchall:n}),t.passthrough=()=>t.clone({...t._zod.def,catchall:Nt()}),t.loose=()=>t.clone({...t._zod.def,catchall:Nt()}),t.strict=()=>t.clone({...t._zod.def,catchall:uc()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=n=>qh(t,n),t.merge=n=>Vh(t,n),t.pick=n=>Wh(t,n),t.omit=n=>Gh(t,n),t.partial=(...n)=>Kh(fc,t,n[0]),t.required=(...n)=>Qh(hc,t,n[0])});function We(t,e){const n={type:"object",get shape(){return gl(this,"shape",{...t}),this.shape},...ee(e)};return new lc(n)}function Be(t,e){return new lc({type:"object",get shape(){return gl(this,"shape",{...t}),this.shape},catchall:uc(),...ee(e)})}const cc=z("ZodUnion",(t,e)=>{Hl.init(t,e),Pe.init(t,e),t.options=e.options});function Et(t,e){return new cc({type:"union",options:t,...ee(e)})}const fg=z("ZodDiscriminatedUnion",(t,e)=>{cc.init(t,e),l0.init(t,e)});function hg(t,e,n){return new fg({type:"union",options:e,discriminator:t,...ee(n)})}const pg=z("ZodIntersection",(t,e)=>{c0.init(t,e),Pe.init(t,e)});function mg(t,e){return new pg({type:"intersection",left:t,right:e})}const gg=z("ZodRecord",(t,e)=>{d0.init(t,e),Pe.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});function Ds(t,e,n){return new gg({type:"record",keyType:t,valueType:e,...ee(n)})}const Ps=z("ZodEnum",(t,e)=>{f0.init(t,e),Pe.init(t,e),t.enum=e.entries,t.options=Object.values(e.entries);const n=new Set(Object.keys(e.entries));t.extract=(r,i)=>{const s={};for(const a of r)if(n.has(a))s[a]=e.entries[a];else throw new Error(`Key ${a} not found in enum`);return new Ps({...e,checks:[],...ee(i),entries:s})},t.exclude=(r,i)=>{const s={...e.entries};for(const a of r)if(n.has(a))delete s[a];else throw new Error(`Key ${a} not found in enum`);return new Ps({...e,checks:[],...ee(i),entries:s})}});function dc(t,e){const n=Array.isArray(t)?Object.fromEntries(t.map(r=>[r,r])):t;return new Ps({type:"enum",entries:n,...ee(e)})}const bg=z("ZodLiteral",(t,e)=>{h0.init(t,e),Pe.init(t,e),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function he(t,e){return new bg({type:"literal",values:Array.isArray(t)?t:[t],...ee(e)})}const Eg=z("ZodTransform",(t,e)=>{p0.init(t,e),Pe.init(t,e),t._zod.parse=(n,r)=>{n.addIssue=s=>{if(typeof s=="string")n.issues.push(_r(s,n.value,e));else{const a=s;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=n.value),a.inst??(a.inst=t),a.continue??(a.continue=!0),n.issues.push(_r(a))}};const i=e.transform(n.value,n);return i instanceof Promise?i.then(s=>(n.value=s,n)):(n.value=i,n)}});function xg(t){return new Eg({type:"transform",transform:t})}const fc=z("ZodOptional",(t,e)=>{m0.init(t,e),Pe.init(t,e),t.unwrap=()=>t._zod.def.innerType});function So(t){return new fc({type:"optional",innerType:t})}const Tg=z("ZodNullable",(t,e)=>{g0.init(t,e),Pe.init(t,e),t.unwrap=()=>t._zod.def.innerType});function Co(t){return new Tg({type:"nullable",innerType:t})}const _g=z("ZodDefault",(t,e)=>{b0.init(t,e),Pe.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function yg(t,e){return new _g({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}const kg=z("ZodPrefault",(t,e)=>{E0.init(t,e),Pe.init(t,e),t.unwrap=()=>t._zod.def.innerType});function Ag(t,e){return new kg({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}const hc=z("ZodNonOptional",(t,e)=>{x0.init(t,e),Pe.init(t,e),t.unwrap=()=>t._zod.def.innerType});function Sg(t,e){return new hc({type:"nonoptional",innerType:t,...ee(e)})}const Cg=z("ZodCatch",(t,e)=>{T0.init(t,e),Pe.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function Ig(t,e){return new Cg({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}const Ng=z("ZodPipe",(t,e)=>{_0.init(t,e),Pe.init(t,e),t.in=e.in,t.out=e.out});function Io(t,e){return new Ng({type:"pipe",in:t,out:e})}const wg=z("ZodReadonly",(t,e)=>{y0.init(t,e),Pe.init(t,e)});function vg(t){return new wg({type:"readonly",innerType:t})}const Rg=z("ZodLazy",(t,e)=>{k0.init(t,e),Pe.init(t,e),t.unwrap=()=>t._zod.def.getter()});function Og(t){return new Rg({type:"lazy",getter:t})}const ha=z("ZodCustom",(t,e)=>{A0.init(t,e),Pe.init(t,e)});function Lg(t){const e=new ut({check:"custom"});return e._zod.check=t,e}function pc(t,e){return m1(ha,t??(()=>!0),e)}function Dg(t,e={}){return g1(ha,t,e)}function Pg(t){const e=Lg(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(_r(r,n.value,e._zod.def));else{const i=r;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=e),i.continue??(i.continue=!e._zod.def.abort),n.issues.push(_r(i))}},t(n.value,n)));return e}function pi(t,e={error:`Input not instance of ${t.name}`}){const n=new ha({type:"custom",check:"custom",fn:r=>r instanceof t,abort:!0,...ee(e)});return n._zod.bag.Class=t,n}var Dr=({prefix:t,size:e=16,alphabet:n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const i=()=>{const s=n.length,a=new Array(e);for(let o=0;o<e;o++)a[o]=n[Math.random()*s|0];return a.join("")};if(t==null)return i;if(n.includes(r))throw new A1({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${n}".`});return()=>`${t}${r}${i()}`},Mg=Dr();function No(t=globalThis){var e,n,r;return t.window?"runtime/browser":(e=t.navigator)!=null&&e.userAgent?`runtime/${t.navigator.userAgent.toLowerCase()}`:(r=(n=t.process)==null?void 0:n.versions)!=null&&r.node?`runtime/node.js/${t.process.version.substring(0)}`:t.EdgeRuntime?"runtime/vercel-edge":"runtime/unknown"}function rn(t){if(t==null)return{};const e={};if(t instanceof Headers)t.forEach((n,r)=>{e[r.toLowerCase()]=n});else{Array.isArray(t)||(t=Object.entries(t));for(const[n,r]of t)r!=null&&(e[n.toLowerCase()]=r)}return e}function wo(t,...e){const n=new Headers(rn(t)),r=n.get("user-agent")||"";return n.set("user-agent",[r,...e].filter(Boolean).join(" ")),Object.fromEntries(n.entries())}var Bg=/"__proto__"\s*:/,Fg=/"constructor"\s*:/;function vo(t){const e=JSON.parse(t);return e===null||typeof e!="object"||Bg.test(t)===!1&&Fg.test(t)===!1?e:zg(e)}function zg(t){let e=[t];for(;e.length;){const n=e;e=[];for(const r of n){if(Object.prototype.hasOwnProperty.call(r,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(r,"constructor")&&Object.prototype.hasOwnProperty.call(r.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(const i in r){const s=r[i];s&&typeof s=="object"&&e.push(s)}}}return t}function jg(t){const{stackTraceLimit:e}=Error;try{Error.stackTraceLimit=0}catch{return vo(t)}try{return vo(t)}finally{Error.stackTraceLimit=e}}var mi=Symbol.for("vercel.ai.validator");function Ug(t){return{[mi]:!0,validate:t}}function Hg(t){return typeof t=="object"&&t!==null&&mi in t&&t[mi]===!0&&"validate"in t}function $g(t){let e;return()=>(e==null&&(e=t()),e)}function Zg(t){return Hg(t)?t:typeof t=="function"?t():Yg(t)}function Yg(t){return Ug(async e=>{const n=await t["~standard"].validate(e);return n.issues==null?{success:!0,value:n.value}:{success:!1,error:new hi({value:e,cause:n.issues})}})}async function Ro({value:t,schema:e}){const n=await pa({value:t,schema:e});if(!n.success)throw hi.wrap({value:t,cause:n.error});return n.value}async function pa({value:t,schema:e}){const n=Zg(e);try{if(n.validate==null)return{success:!0,value:t,rawValue:t};const r=await n.validate(t);return r.success?{success:!0,value:r.value,rawValue:t}:{success:!1,error:hi.wrap({value:t,cause:r.error}),rawValue:t}}catch(r){return{success:!1,error:hi.wrap({value:t,cause:r}),rawValue:t}}}async function gi({text:t,schema:e}){try{const n=jg(t);return e==null?{success:!0,value:n,rawValue:n}:await pa({value:n,schema:e})}catch(n){return{success:!1,error:yo.isInstance(n)?n:new yo({text:t,cause:n}),rawValue:void 0}}}function qg({stream:t,schema:e}){return t.pipeThrough(new TextDecoderStream).pipeThrough(new _p).pipeThrough(new TransformStream({async transform({data:n},r){n!=="[DONE]"&&r.enqueue(await gi({text:n,schema:e}))}}))}async function Tn(t){return typeof t=="function"&&(t=t()),Promise.resolve(t)}function ti(t){if(t.type==="object"){t.additionalProperties=!1;const e=t.properties;if(e!=null)for(const n in e)e[n]=ti(e[n])}return t.type==="array"&&t.items!=null&&(Array.isArray(t.items)?t.items=t.items.map(e=>ti(e)):t.items=ti(t.items)),t}var Vg=(t,e)=>{let n=0;for(;n<t.length&&n<e.length&&t[n]===e[n];n++);return[(t.length-n).toString(),...e.slice(n)].join("/")},Wg=Symbol("Let zodToJsonSchema decide on which parser to use"),Oo={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},Gg=t=>typeof t=="string"?{...Oo,name:t}:{...Oo,...t};function pt(){return{}}function Kg(t,e){var n,r,i;const s={type:"array"};return(n=t.type)!=null&&n._def&&((i=(r=t.type)==null?void 0:r._def)==null?void 0:i.typeName)!==le.ZodAny&&(s.items=Ce(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&(s.minItems=t.minLength.value),t.maxLength&&(s.maxItems=t.maxLength.value),t.exactLength&&(s.minItems=t.exactLength.value,s.maxItems=t.exactLength.value),s}function Qg(t){const e={type:"integer",format:"int64"};if(!t.checks)return e;for(const n of t.checks)switch(n.kind){case"min":n.inclusive?e.minimum=n.value:e.exclusiveMinimum=n.value;break;case"max":n.inclusive?e.maximum=n.value:e.exclusiveMaximum=n.value;break;case"multipleOf":e.multipleOf=n.value;break}return e}function Xg(){return{type:"boolean"}}function mc(t,e){return Ce(t.type._def,e)}var Jg=(t,e)=>Ce(t.innerType._def,e);function gc(t,e,n){const r=n??e.dateStrategy;if(Array.isArray(r))return{anyOf:r.map((i,s)=>gc(t,e,i))};switch(r){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return eb(t)}}var eb=t=>{const e={type:"integer",format:"unix-time"};for(const n of t.checks)switch(n.kind){case"min":e.minimum=n.value;break;case"max":e.maximum=n.value;break}return e};function tb(t,e){return{...Ce(t.innerType._def,e),default:t.defaultValue()}}function nb(t,e){return e.effectStrategy==="input"?Ce(t.schema._def,e):pt()}function rb(t){return{type:"string",enum:Array.from(t.values)}}var ib=t=>"type"in t&&t.type==="string"?!1:"allOf"in t;function sb(t,e){const n=[Ce(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),Ce(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(i=>!!i),r=[];return n.forEach(i=>{if(ib(i))r.push(...i.allOf);else{let s=i;if("additionalProperties"in i&&i.additionalProperties===!1){const{additionalProperties:a,...o}=i;s=o}r.push(s)}}),r.length?{allOf:r}:void 0}function ab(t){const e=typeof t.value;return e!=="bigint"&&e!=="number"&&e!=="boolean"&&e!=="string"?{type:Array.isArray(t.value)?"array":"object"}:{type:e==="bigint"?"integer":e,const:t.value}}var Ji=void 0,Tt={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(Ji===void 0&&(Ji=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Ji),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?: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])$/,ipv4Cidr:/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function bc(t,e){const n={type:"string"};if(t.checks)for(const r of t.checks)switch(r.kind){case"min":n.minLength=typeof n.minLength=="number"?Math.max(n.minLength,r.value):r.value;break;case"max":n.maxLength=typeof n.maxLength=="number"?Math.min(n.maxLength,r.value):r.value;break;case"email":switch(e.emailStrategy){case"format:email":_t(n,"email",r.message,e);break;case"format:idn-email":_t(n,"idn-email",r.message,e);break;case"pattern:zod":Je(n,Tt.email,r.message,e);break}break;case"url":_t(n,"uri",r.message,e);break;case"uuid":_t(n,"uuid",r.message,e);break;case"regex":Je(n,r.regex,r.message,e);break;case"cuid":Je(n,Tt.cuid,r.message,e);break;case"cuid2":Je(n,Tt.cuid2,r.message,e);break;case"startsWith":Je(n,RegExp(`^${es(r.value,e)}`),r.message,e);break;case"endsWith":Je(n,RegExp(`${es(r.value,e)}$`),r.message,e);break;case"datetime":_t(n,"date-time",r.message,e);break;case"date":_t(n,"date",r.message,e);break;case"time":_t(n,"time",r.message,e);break;case"duration":_t(n,"duration",r.message,e);break;case"length":n.minLength=typeof n.minLength=="number"?Math.max(n.minLength,r.value):r.value,n.maxLength=typeof n.maxLength=="number"?Math.min(n.maxLength,r.value):r.value;break;case"includes":{Je(n,RegExp(es(r.value,e)),r.message,e);break}case"ip":{r.version!=="v6"&&_t(n,"ipv4",r.message,e),r.version!=="v4"&&_t(n,"ipv6",r.message,e);break}case"base64url":Je(n,Tt.base64url,r.message,e);break;case"jwt":Je(n,Tt.jwt,r.message,e);break;case"cidr":{r.version!=="v6"&&Je(n,Tt.ipv4Cidr,r.message,e),r.version!=="v4"&&Je(n,Tt.ipv6Cidr,r.message,e);break}case"emoji":Je(n,Tt.emoji(),r.message,e);break;case"ulid":{Je(n,Tt.ulid,r.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{_t(n,"binary",r.message,e);break}case"contentEncoding:base64":{n.contentEncoding="base64";break}case"pattern:zod":{Je(n,Tt.base64,r.message,e);break}}break}case"nanoid":Je(n,Tt.nanoid,r.message,e)}return n}function es(t,e){return e.patternStrategy==="escape"?ub(t):t}var ob=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function ub(t){let e="";for(let n=0;n<t.length;n++)ob.has(t[n])||(e+="\\"),e+=t[n];return e}function _t(t,e,n,r){var i;t.format||(i=t.anyOf)!=null&&i.some(s=>s.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format}),delete t.format),t.anyOf.push({format:e,...n&&r.errorMessages&&{errorMessage:{format:n}}})):t.format=e}function Je(t,e,n,r){var i;t.pattern||(i=t.allOf)!=null&&i.some(s=>s.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern}),delete t.pattern),t.allOf.push({pattern:Lo(e,r),...n&&r.errorMessages&&{errorMessage:{pattern:n}}})):t.pattern=Lo(e,r)}function Lo(t,e){var n;if(!e.applyRegexFlags||!t.flags)return t.source;const r={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},i=r.i?t.source.toLowerCase():t.source;let s="",a=!1,o=!1,u=!1;for(let l=0;l<i.length;l++){if(a){s+=i[l],a=!1;continue}if(r.i){if(o){if(i[l].match(/[a-z]/)){u?(s+=i[l],s+=`${i[l-2]}-${i[l]}`.toUpperCase(),u=!1):i[l+1]==="-"&&((n=i[l+2])!=null&&n.match(/[a-z]/))?(s+=i[l],u=!0):s+=`${i[l]}${i[l].toUpperCase()}`;continue}}else if(i[l].match(/[a-z]/)){s+=`[${i[l]}${i[l].toUpperCase()}]`;continue}}if(r.m){if(i[l]==="^"){s+=`(^|(?<=[\r
|
|
32
|
-
]))`;continue}else if(i[l]==="$"){s+=`($|(?=[\r
|
|
33
|
-
]))`;continue}}if(r.s&&i[l]==="."){s+=o?`${i[l]}\r
|
|
34
|
-
`:`[${i[l]}\r
|
|
35
|
-
]`;continue}s+=i[l],i[l]==="\\"?a=!0:o&&i[l]==="]"?o=!1:!o&&i[l]==="["&&(o=!0)}try{new RegExp(s)}catch{return console.warn(`Could not convert regex pattern at ${e.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),t.source}return s}function Ec(t,e){var n,r,i,s,a,o;const u={type:"object",additionalProperties:(n=Ce(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]}))!=null?n:e.allowedAdditionalProperties};if(((r=t.keyType)==null?void 0:r._def.typeName)===le.ZodString&&((i=t.keyType._def.checks)!=null&&i.length)){const{type:l,...d}=bc(t.keyType._def,e);return{...u,propertyNames:d}}else{if(((s=t.keyType)==null?void 0:s._def.typeName)===le.ZodEnum)return{...u,propertyNames:{enum:t.keyType._def.values}};if(((a=t.keyType)==null?void 0:a._def.typeName)===le.ZodBranded&&t.keyType._def.type._def.typeName===le.ZodString&&((o=t.keyType._def.type._def.checks)!=null&&o.length)){const{type:l,...d}=mc(t.keyType._def,e);return{...u,propertyNames:d}}}return u}function lb(t,e){if(e.mapStrategy==="record")return Ec(t,e);const n=Ce(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||pt(),r=Ce(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||pt();return{type:"array",maxItems:125,items:{type:"array",items:[n,r],minItems:2,maxItems:2}}}function cb(t){const e=t.values,r=Object.keys(t.values).filter(s=>typeof e[e[s]]!="number").map(s=>e[s]),i=Array.from(new Set(r.map(s=>typeof s)));return{type:i.length===1?i[0]==="string"?"string":"number":["string","number"],enum:r}}function db(){return{not:pt()}}function fb(){return{type:"null"}}var Ms={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function hb(t,e){const n=t.options instanceof Map?Array.from(t.options.values()):t.options;if(n.every(r=>r._def.typeName in Ms&&(!r._def.checks||!r._def.checks.length))){const r=n.reduce((i,s)=>{const a=Ms[s._def.typeName];return a&&!i.includes(a)?[...i,a]:i},[]);return{type:r.length>1?r:r[0]}}else if(n.every(r=>r._def.typeName==="ZodLiteral"&&!r.description)){const r=n.reduce((i,s)=>{const a=typeof s._def.value;switch(a){case"string":case"number":case"boolean":return[...i,a];case"bigint":return[...i,"integer"];case"object":if(s._def.value===null)return[...i,"null"];default:return i}},[]);if(r.length===n.length){const i=r.filter((s,a,o)=>o.indexOf(s)===a);return{type:i.length>1?i:i[0],enum:n.reduce((s,a)=>s.includes(a._def.value)?s:[...s,a._def.value],[])}}}else if(n.every(r=>r._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((r,i)=>[...r,...i._def.values.filter(s=>!r.includes(s))],[])};return pb(t,e)}var pb=(t,e)=>{const n=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((r,i)=>Ce(r._def,{...e,currentPath:[...e.currentPath,"anyOf",`${i}`]})).filter(r=>!!r&&(!e.strictUnions||typeof r=="object"&&Object.keys(r).length>0));return n.length?{anyOf:n}:void 0};function mb(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return{type:[Ms[t.innerType._def.typeName],"null"]};const n=Ce(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}function gb(t){const e={type:"number"};if(!t.checks)return e;for(const n of t.checks)switch(n.kind){case"int":e.type="integer";break;case"min":n.inclusive?e.minimum=n.value:e.exclusiveMinimum=n.value;break;case"max":n.inclusive?e.maximum=n.value:e.exclusiveMaximum=n.value;break;case"multipleOf":e.multipleOf=n.value;break}return e}function bb(t,e){const n={type:"object",properties:{}},r=[],i=t.shape();for(const a in i){let o=i[a];if(o===void 0||o._def===void 0)continue;const u=xb(o),l=Ce(o._def,{...e,currentPath:[...e.currentPath,"properties",a],propertyPath:[...e.currentPath,"properties",a]});l!==void 0&&(n.properties[a]=l,u||r.push(a))}r.length&&(n.required=r);const s=Eb(t,e);return s!==void 0&&(n.additionalProperties=s),n}function Eb(t,e){if(t.catchall._def.typeName!=="ZodNever")return Ce(t.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]});switch(t.unknownKeys){case"passthrough":return e.allowedAdditionalProperties;case"strict":return e.rejectedAdditionalProperties;case"strip":return e.removeAdditionalStrategy==="strict"?e.allowedAdditionalProperties:e.rejectedAdditionalProperties}}function xb(t){try{return t.isOptional()}catch{return!0}}var Tb=(t,e)=>{var n;if(e.currentPath.toString()===((n=e.propertyPath)==null?void 0:n.toString()))return Ce(t.innerType._def,e);const r=Ce(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return r?{anyOf:[{not:pt()},r]}:pt()},_b=(t,e)=>{if(e.pipeStrategy==="input")return Ce(t.in._def,e);if(e.pipeStrategy==="output")return Ce(t.out._def,e);const n=Ce(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),r=Ce(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,r].filter(i=>i!==void 0)}};function yb(t,e){return Ce(t.type._def,e)}function kb(t,e){const r={type:"array",uniqueItems:!0,items:Ce(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&(r.minItems=t.minSize.value),t.maxSize&&(r.maxItems=t.maxSize.value),r}function Ab(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((n,r)=>Ce(n._def,{...e,currentPath:[...e.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[]),additionalItems:Ce(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((n,r)=>Ce(n._def,{...e,currentPath:[...e.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[])}}function Sb(){return{not:pt()}}function Cb(){return pt()}var Ib=(t,e)=>Ce(t.innerType._def,e),Nb=(t,e,n)=>{switch(e){case le.ZodString:return bc(t,n);case le.ZodNumber:return gb(t);case le.ZodObject:return bb(t,n);case le.ZodBigInt:return Qg(t);case le.ZodBoolean:return Xg();case le.ZodDate:return gc(t,n);case le.ZodUndefined:return Sb();case le.ZodNull:return fb();case le.ZodArray:return Kg(t,n);case le.ZodUnion:case le.ZodDiscriminatedUnion:return hb(t,n);case le.ZodIntersection:return sb(t,n);case le.ZodTuple:return Ab(t,n);case le.ZodRecord:return Ec(t,n);case le.ZodLiteral:return ab(t);case le.ZodEnum:return rb(t);case le.ZodNativeEnum:return cb(t);case le.ZodNullable:return mb(t,n);case le.ZodOptional:return Tb(t,n);case le.ZodMap:return lb(t,n);case le.ZodSet:return kb(t,n);case le.ZodLazy:return()=>t.getter()._def;case le.ZodPromise:return yb(t,n);case le.ZodNaN:case le.ZodNever:return db();case le.ZodEffects:return nb(t,n);case le.ZodAny:return pt();case le.ZodUnknown:return Cb();case le.ZodDefault:return tb(t,n);case le.ZodBranded:return mc(t,n);case le.ZodReadonly:return Ib(t,n);case le.ZodCatch:return Jg(t,n);case le.ZodPipeline:return _b(t,n);case le.ZodFunction:case le.ZodVoid:case le.ZodSymbol:return;default:return(r=>{})()}};function Ce(t,e,n=!1){var r;const i=e.seen.get(t);if(e.override){const u=(r=e.override)==null?void 0:r.call(e,t,e,i,n);if(u!==Wg)return u}if(i&&!n){const u=wb(i,e);if(u!==void 0)return u}const s={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,s);const a=Nb(t,t.typeName,e),o=typeof a=="function"?Ce(a(),e):a;if(o&&vb(t,e,o),e.postProcess){const u=e.postProcess(o,t,e);return s.jsonSchema=o,u}return s.jsonSchema=o,o}var wb=(t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:Vg(e.currentPath,t.path)};case"none":case"seen":return t.path.length<e.currentPath.length&&t.path.every((n,r)=>e.currentPath[r]===n)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),pt()):e.$refStrategy==="seen"?pt():void 0}},vb=(t,e,n)=>(t.description&&(n.description=t.description),n),Rb=t=>{const e=Gg(t),n=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([r,i])=>[i._def,{def:i._def,path:[...e.basePath,e.definitionPath,r],jsonSchema:void 0}]))}},Ob=(t,e)=>{var n;const r=Rb(e);let i=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((l,[d,c])=>{var h;return{...l,[d]:(h=Ce(c._def,{...r,currentPath:[...r.basePath,r.definitionPath,d]},!0))!=null?h:pt()}},{}):void 0;const s=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,a=(n=Ce(t._def,s===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,s]},!1))!=null?n:pt(),o=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;o!==void 0&&(a.title=o);const u=s===void 0?i?{...a,[r.definitionPath]:i}:a:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,s].join("/"),[r.definitionPath]:{...i,[s]:a}};return u.$schema="http://json-schema.org/draft-07/schema#",u},Lb=Ob;function Db(t,e){var n;const r=(n=void 0)!=null?n:!1;return ma(()=>Lb(t,{$refStrategy:r?"root":"none"}),{validate:async i=>{const s=await t.safeParseAsync(i);return s.success?{success:!0,value:s.data}:{success:!1,error:s.error}}})}function Pb(t,e){var n;const r=(n=void 0)!=null?n:!1;return ma(()=>ti(b1(t,{target:"draft-7",io:"input",reused:r?"ref":"inline"})),{validate:async i=>{const s=await sc(t,i);return s.success?{success:!0,value:s.data}:{success:!1,error:s.error}}})}function Mb(t){return"_zod"in t}function xc(t,e){return Mb(t)?Pb(t):Db(t)}var Bs=Symbol.for("vercel.ai.schema");function ma(t,{validate:e}={}){return{[Bs]:!0,_type:void 0,[mi]:!0,get jsonSchema(){return typeof t=="function"&&(t=t()),t},validate:e}}function Bb(t){return typeof t=="object"&&t!==null&&Bs in t&&t[Bs]===!0&&"jsonSchema"in t&&"validate"in t}function Fb(t){return t==null?ma({properties:{},additionalProperties:!1}):Bb(t)?t:typeof t=="function"?t():xc(t)}var zb=Object.defineProperty,jb=(t,e)=>{for(var n in e)zb(t,n,{get:e[n],enumerable:!0})},Tc="AI_NoObjectGeneratedError",_c=`vercel.ai.error.${Tc}`,Ub=Symbol.for(_c),yc,Do=class extends Vt{constructor({message:t="No object generated.",cause:e,text:n,response:r,usage:i,finishReason:s}){super({name:Tc,message:t,cause:e}),this[yc]=!0,this.text=n,this.response=r,this.usage=i,this.finishReason=s}static isInstance(t){return Vt.hasMarker(t,_c)}};yc=Ub;var Po="5.0.116",kc=Et([re(),pi(Uint8Array),pi(ArrayBuffer),pc(t=>{var e,n;return(n=(e=globalThis.Buffer)==null?void 0:e.isBuffer(t))!=null?n:!1},{message:"Must be a Buffer"})]),yr=Og(()=>Et([ug(),re(),ig(),st(),Ds(re(),yr),zn(yr)])),je=Ds(re(),Ds(re(),yr)),Ac=We({type:he("text"),text:re(),providerOptions:je.optional()}),Hb=We({type:he("image"),image:Et([kc,pi(URL)]),mediaType:re().optional(),providerOptions:je.optional()}),Sc=We({type:he("file"),data:Et([kc,pi(URL)]),filename:re().optional(),mediaType:re(),providerOptions:je.optional()}),$b=We({type:he("reasoning"),text:re(),providerOptions:je.optional()}),Zb=We({type:he("tool-call"),toolCallId:re(),toolName:re(),input:Nt(),providerOptions:je.optional(),providerExecuted:st().optional()}),Yb=hg("type",[We({type:he("text"),value:re()}),We({type:he("json"),value:yr}),We({type:he("error-text"),value:re()}),We({type:he("error-json"),value:yr}),We({type:he("content"),value:zn(Et([We({type:he("text"),text:re()}),We({type:he("media"),data:re(),mediaType:re()})]))})]),Cc=We({type:he("tool-result"),toolCallId:re(),toolName:re(),output:Yb,providerOptions:je.optional()}),qb=We({role:he("system"),content:re(),providerOptions:je.optional()}),Vb=We({role:he("user"),content:Et([re(),zn(Et([Ac,Hb,Sc]))]),providerOptions:je.optional()}),Wb=We({role:he("assistant"),content:Et([re(),zn(Et([Ac,Sc,$b,Zb,Cc]))]),providerOptions:je.optional()}),Gb=We({role:he("tool"),content:zn(Cc),providerOptions:je.optional()});Et([qb,Vb,Wb,Gb]);Dr({prefix:"aitxt",size:24});(class extends TransformStream{constructor(){super({transform(t,e){e.enqueue(`data: ${JSON.stringify(t)}
|
|
36
|
-
|
|
37
|
-
`)},flush(t){t.enqueue(`data: [DONE]
|
|
38
|
-
|
|
39
|
-
`)}})}});var Kb=$g(()=>xc(Et([Be({type:he("text-start"),id:re(),providerMetadata:je.optional()}),Be({type:he("text-delta"),id:re(),delta:re(),providerMetadata:je.optional()}),Be({type:he("text-end"),id:re(),providerMetadata:je.optional()}),Be({type:he("error"),errorText:re()}),Be({type:he("tool-input-start"),toolCallId:re(),toolName:re(),providerExecuted:st().optional(),dynamic:st().optional()}),Be({type:he("tool-input-delta"),toolCallId:re(),inputTextDelta:re()}),Be({type:he("tool-input-available"),toolCallId:re(),toolName:re(),input:Nt(),providerExecuted:st().optional(),providerMetadata:je.optional(),dynamic:st().optional()}),Be({type:he("tool-input-error"),toolCallId:re(),toolName:re(),input:Nt(),providerExecuted:st().optional(),providerMetadata:je.optional(),dynamic:st().optional(),errorText:re()}),Be({type:he("tool-output-available"),toolCallId:re(),output:Nt(),providerExecuted:st().optional(),dynamic:st().optional(),preliminary:st().optional()}),Be({type:he("tool-output-error"),toolCallId:re(),errorText:re(),providerExecuted:st().optional(),dynamic:st().optional()}),Be({type:he("reasoning-start"),id:re(),providerMetadata:je.optional()}),Be({type:he("reasoning-delta"),id:re(),delta:re(),providerMetadata:je.optional()}),Be({type:he("reasoning-end"),id:re(),providerMetadata:je.optional()}),Be({type:he("source-url"),sourceId:re(),url:re(),title:re().optional(),providerMetadata:je.optional()}),Be({type:he("source-document"),sourceId:re(),mediaType:re(),title:re(),filename:re().optional(),providerMetadata:je.optional()}),Be({type:he("file"),url:re(),mediaType:re(),providerMetadata:je.optional()}),Be({type:pc(t=>typeof t=="string"&&t.startsWith("data-"),{message:'Type must start with "data-"'}),id:re().optional(),data:Nt(),transient:st().optional()}),Be({type:he("start-step")}),Be({type:he("finish-step")}),Be({type:he("start"),messageId:re().optional(),messageMetadata:Nt().optional()}),Be({type:he("finish"),finishReason:dc(["stop","length","content-filter","tool-calls","error","other","unknown"]).optional(),messageMetadata:Nt().optional()}),Be({type:he("abort")}),Be({type:he("message-metadata"),messageMetadata:Nt()})])));function Qb(t){return t.type.startsWith("data-")}function Ic(t,e){if(t===void 0&&e===void 0)return;if(t===void 0)return e;if(e===void 0)return t;const n={...t};for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)){const i=e[r];if(i===void 0)continue;const s=r in t?t[r]:void 0,a=i!==null&&typeof i=="object"&&!Array.isArray(i)&&!(i instanceof Date)&&!(i instanceof RegExp),o=s!=null&&typeof s=="object"&&!Array.isArray(s)&&!(s instanceof Date)&&!(s instanceof RegExp);a&&o?n[r]=Ic(s,i):n[r]=i}return n}function Xb(t){const e=["ROOT"];let n=-1,r=null;function i(u,l,d){switch(u){case'"':{n=l,e.pop(),e.push(d),e.push("INSIDE_STRING");break}case"f":case"t":case"n":{n=l,r=l,e.pop(),e.push(d),e.push("INSIDE_LITERAL");break}case"-":{e.pop(),e.push(d),e.push("INSIDE_NUMBER");break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=l,e.pop(),e.push(d),e.push("INSIDE_NUMBER");break}case"{":{n=l,e.pop(),e.push(d),e.push("INSIDE_OBJECT_START");break}case"[":{n=l,e.pop(),e.push(d),e.push("INSIDE_ARRAY_START");break}}}function s(u,l){switch(u){case",":{e.pop(),e.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{n=l,e.pop();break}}}function a(u,l){switch(u){case",":{e.pop(),e.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=l,e.pop();break}}}for(let u=0;u<t.length;u++){const l=t[u];switch(e[e.length-1]){case"ROOT":i(l,u,"FINISH");break;case"INSIDE_OBJECT_START":{switch(l){case'"':{e.pop(),e.push("INSIDE_OBJECT_KEY");break}case"}":{n=u,e.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{l==='"'&&(e.pop(),e.push("INSIDE_OBJECT_KEY"));break}case"INSIDE_OBJECT_KEY":{l==='"'&&(e.pop(),e.push("INSIDE_OBJECT_AFTER_KEY"));break}case"INSIDE_OBJECT_AFTER_KEY":{l===":"&&(e.pop(),e.push("INSIDE_OBJECT_BEFORE_VALUE"));break}case"INSIDE_OBJECT_BEFORE_VALUE":{i(l,u,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{s(l,u);break}case"INSIDE_STRING":{switch(l){case'"':{e.pop(),n=u;break}case"\\":{e.push("INSIDE_STRING_ESCAPE");break}default:n=u}break}case"INSIDE_ARRAY_START":{l==="]"?(n=u,e.pop()):(n=u,i(l,u,"INSIDE_ARRAY_AFTER_VALUE"));break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(l){case",":{e.pop(),e.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=u,e.pop();break}default:{n=u;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{i(l,u,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{e.pop(),n=u;break}case"INSIDE_NUMBER":{switch(l){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=u;break}case"e":case"E":case"-":case".":break;case",":{e.pop(),e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&a(l,u),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&s(l,u);break}case"}":{e.pop(),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&s(l,u);break}case"]":{e.pop(),e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&a(l,u);break}default:{e.pop();break}}break}case"INSIDE_LITERAL":{const c=t.substring(r,u+1);!"false".startsWith(c)&&!"true".startsWith(c)&&!"null".startsWith(c)?(e.pop(),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?s(l,u):e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&a(l,u)):n=u;break}}}let o=t.slice(0,n+1);for(let u=e.length-1;u>=0;u--)switch(e[u]){case"INSIDE_STRING":{o+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{o+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{o+="]";break}case"INSIDE_LITERAL":{const d=t.substring(r,t.length);"true".startsWith(d)?o+="true".slice(d.length):"false".startsWith(d)?o+="false".slice(d.length):"null".startsWith(d)&&(o+="null".slice(d.length))}}return o}async function Nc(t){if(t===void 0)return{value:void 0,state:"undefined-input"};let e=await gi({text:t});return e.success?{value:e.value,state:"successful-parse"}:(e=await gi({text:Xb(t)}),e.success?{value:e.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}function ni(t){return t.type.startsWith("tool-")}function Jb(t){return t.type==="dynamic-tool"}function Mo(t){return ni(t)||Jb(t)}function Bo(t){return t.type.split("-").slice(1).join("-")}function eE({lastMessage:t,messageId:e}){return{message:t?.role==="assistant"?t:{id:e,metadata:void 0,role:"assistant",parts:[]},activeTextParts:{},activeReasoningParts:{},partialToolCalls:{}}}function tE({stream:t,messageMetadataSchema:e,dataPartSchemas:n,runUpdateMessageJob:r,onError:i,onToolCall:s,onData:a}){return t.pipeThrough(new TransformStream({async transform(o,u){await r(async({state:l,write:d})=>{var c,h,p,g;function b(_){const S=l.message.parts.filter(ni).find(w=>w.toolCallId===_);if(S==null)throw new Error("tool-output-error must be preceded by a tool-input-available");return S}function x(_){const S=l.message.parts.filter(w=>w.type==="dynamic-tool").find(w=>w.toolCallId===_);if(S==null)throw new Error("tool-output-error must be preceded by a tool-input-available");return S}function E(_){var R;const S=l.message.parts.find(D=>ni(D)&&D.toolCallId===_.toolCallId),w=_,O=S;S!=null?(S.state=_.state,O.input=w.input,O.output=w.output,O.errorText=w.errorText,O.rawInput=w.rawInput,O.preliminary=w.preliminary,O.providerExecuted=(R=w.providerExecuted)!=null?R:S.providerExecuted,w.providerMetadata!=null&&S.state==="input-available"&&(S.callProviderMetadata=w.providerMetadata)):l.message.parts.push({type:`tool-${_.toolName}`,toolCallId:_.toolCallId,state:_.state,input:w.input,output:w.output,rawInput:w.rawInput,errorText:w.errorText,providerExecuted:w.providerExecuted,preliminary:w.preliminary,...w.providerMetadata!=null?{callProviderMetadata:w.providerMetadata}:{}})}function k(_){var R,S;const w=l.message.parts.find(v=>v.type==="dynamic-tool"&&v.toolCallId===_.toolCallId),O=_,D=w;w!=null?(w.state=_.state,D.toolName=_.toolName,D.input=O.input,D.output=O.output,D.errorText=O.errorText,D.rawInput=(R=O.rawInput)!=null?R:D.rawInput,D.preliminary=O.preliminary,D.providerExecuted=(S=O.providerExecuted)!=null?S:w.providerExecuted,O.providerMetadata!=null&&w.state==="input-available"&&(w.callProviderMetadata=O.providerMetadata)):l.message.parts.push({type:"dynamic-tool",toolName:_.toolName,toolCallId:_.toolCallId,state:_.state,input:O.input,output:O.output,errorText:O.errorText,preliminary:O.preliminary,providerExecuted:O.providerExecuted,...O.providerMetadata!=null?{callProviderMetadata:O.providerMetadata}:{}})}async function y(_){if(_!=null){const R=l.message.metadata!=null?Ic(l.message.metadata,_):_;e!=null&&await Ro({value:R,schema:e}),l.message.metadata=R}}switch(o.type){case"text-start":{const _={type:"text",text:"",providerMetadata:o.providerMetadata,state:"streaming"};l.activeTextParts[o.id]=_,l.message.parts.push(_),d();break}case"text-delta":{const _=l.activeTextParts[o.id];_.text+=o.delta,_.providerMetadata=(c=o.providerMetadata)!=null?c:_.providerMetadata,d();break}case"text-end":{const _=l.activeTextParts[o.id];_.state="done",_.providerMetadata=(h=o.providerMetadata)!=null?h:_.providerMetadata,delete l.activeTextParts[o.id],d();break}case"reasoning-start":{const _={type:"reasoning",text:"",providerMetadata:o.providerMetadata,state:"streaming"};l.activeReasoningParts[o.id]=_,l.message.parts.push(_),d();break}case"reasoning-delta":{const _=l.activeReasoningParts[o.id];_.text+=o.delta,_.providerMetadata=(p=o.providerMetadata)!=null?p:_.providerMetadata,d();break}case"reasoning-end":{const _=l.activeReasoningParts[o.id];_.providerMetadata=(g=o.providerMetadata)!=null?g:_.providerMetadata,_.state="done",delete l.activeReasoningParts[o.id],d();break}case"file":{l.message.parts.push({type:"file",mediaType:o.mediaType,url:o.url}),d();break}case"source-url":{l.message.parts.push({type:"source-url",sourceId:o.sourceId,url:o.url,title:o.title,providerMetadata:o.providerMetadata}),d();break}case"source-document":{l.message.parts.push({type:"source-document",sourceId:o.sourceId,mediaType:o.mediaType,title:o.title,filename:o.filename,providerMetadata:o.providerMetadata}),d();break}case"tool-input-start":{const _=l.message.parts.filter(ni);l.partialToolCalls[o.toolCallId]={text:"",toolName:o.toolName,index:_.length,dynamic:o.dynamic},o.dynamic?k({toolCallId:o.toolCallId,toolName:o.toolName,state:"input-streaming",input:void 0,providerExecuted:o.providerExecuted}):E({toolCallId:o.toolCallId,toolName:o.toolName,state:"input-streaming",input:void 0,providerExecuted:o.providerExecuted}),d();break}case"tool-input-delta":{const _=l.partialToolCalls[o.toolCallId];_.text+=o.inputTextDelta;const{value:R}=await Nc(_.text);_.dynamic?k({toolCallId:o.toolCallId,toolName:_.toolName,state:"input-streaming",input:R}):E({toolCallId:o.toolCallId,toolName:_.toolName,state:"input-streaming",input:R}),d();break}case"tool-input-available":{o.dynamic?k({toolCallId:o.toolCallId,toolName:o.toolName,state:"input-available",input:o.input,providerExecuted:o.providerExecuted,providerMetadata:o.providerMetadata}):E({toolCallId:o.toolCallId,toolName:o.toolName,state:"input-available",input:o.input,providerExecuted:o.providerExecuted,providerMetadata:o.providerMetadata}),d(),s&&!o.providerExecuted&&await s({toolCall:o});break}case"tool-input-error":{o.dynamic?k({toolCallId:o.toolCallId,toolName:o.toolName,state:"output-error",input:o.input,errorText:o.errorText,providerExecuted:o.providerExecuted,providerMetadata:o.providerMetadata}):E({toolCallId:o.toolCallId,toolName:o.toolName,state:"output-error",input:void 0,rawInput:o.input,errorText:o.errorText,providerExecuted:o.providerExecuted,providerMetadata:o.providerMetadata}),d();break}case"tool-output-available":{if(o.dynamic){const _=x(o.toolCallId);k({toolCallId:o.toolCallId,toolName:_.toolName,state:"output-available",input:_.input,output:o.output,preliminary:o.preliminary})}else{const _=b(o.toolCallId);E({toolCallId:o.toolCallId,toolName:Bo(_),state:"output-available",input:_.input,output:o.output,providerExecuted:o.providerExecuted,preliminary:o.preliminary})}d();break}case"tool-output-error":{if(o.dynamic){const _=x(o.toolCallId);k({toolCallId:o.toolCallId,toolName:_.toolName,state:"output-error",input:_.input,errorText:o.errorText,providerExecuted:o.providerExecuted})}else{const _=b(o.toolCallId);E({toolCallId:o.toolCallId,toolName:Bo(_),state:"output-error",input:_.input,rawInput:_.rawInput,errorText:o.errorText,providerExecuted:o.providerExecuted})}d();break}case"start-step":{l.message.parts.push({type:"step-start"});break}case"finish-step":{l.activeTextParts={},l.activeReasoningParts={};break}case"start":{o.messageId!=null&&(l.message.id=o.messageId),await y(o.messageMetadata),(o.messageId!=null||o.messageMetadata!=null)&&d();break}case"finish":{o.finishReason!=null&&(l.finishReason=o.finishReason),await y(o.messageMetadata),o.messageMetadata!=null&&d();break}case"message-metadata":{await y(o.messageMetadata),o.messageMetadata!=null&&d();break}case"error":{i?.(new Error(o.errorText));break}default:if(Qb(o)){n?.[o.type]!=null&&await Ro({value:o.data,schema:n[o.type]});const _=o;if(_.transient){a?.(_);break}const R=_.id!=null?l.message.parts.find(S=>_.type===S.type&&_.id===S.id):void 0;R!=null?R.data=_.data:l.message.parts.push(_),a?.(_),d()}}u.enqueue(o)})}}))}async function nE({stream:t,onError:e}){const n=t.getReader();try{for(;;){const{done:r}=await n.read();if(r)break}}catch(r){e?.(r)}finally{n.releaseLock()}}Dr({prefix:"aitxt",size:24});Dr({prefix:"aiobj",size:24});var rE=class{constructor(){this.queue=[],this.isProcessing=!1}async processQueue(){if(!this.isProcessing){for(this.isProcessing=!0;this.queue.length>0;)await this.queue[0](),this.queue.shift();this.isProcessing=!1}}async run(t){return new Promise((e,n)=>{this.queue.push(async()=>{try{await t(),e()}catch(r){n(r)}}),this.processQueue()})}};Dr({prefix:"aiobj",size:24});var iE={};jb(iE,{object:()=>aE,text:()=>sE});var sE=()=>({type:"text",responseFormat:{type:"text"},async parsePartial({text:t}){return{partial:t}},async parseOutput({text:t}){return t}}),aE=({schema:t})=>{const e=Fb(t);return{type:"object",responseFormat:{type:"json",schema:e.jsonSchema},async parsePartial({text:n}){const r=await Nc(n);switch(r.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:r.value};default:{const i=r.state;throw new Error(`Unsupported parse state: ${i}`)}}},async parseOutput({text:n},r){const i=await gi({text:n});if(!i.success)throw new Do({message:"No object generated: could not parse the response.",cause:i.error,text:n,response:r.response,usage:r.usage,finishReason:r.finishReason});const s=await pa({value:i.value,schema:e});if(!s.success)throw new Do({message:"No object generated: response did not match schema.",cause:s.error,text:n,response:r.response,usage:r.usage,finishReason:r.finishReason});return s.value}}};async function oE(t){if(t==null)return[];if(!globalThis.FileList||!(t instanceof globalThis.FileList))throw new Error("FileList is not supported in the current environment");return Promise.all(Array.from(t).map(async e=>{const{name:n,type:r}=e,i=await new Promise((s,a)=>{const o=new FileReader;o.onload=u=>{var l;s((l=u.target)==null?void 0:l.result)},o.onerror=u=>a(u),o.readAsDataURL(e)});return{type:"file",mediaType:r,filename:n,url:i}}))}var uE=class{constructor({api:t="/api/chat",credentials:e,headers:n,body:r,fetch:i,prepareSendMessagesRequest:s,prepareReconnectToStreamRequest:a}){this.api=t,this.credentials=e,this.headers=n,this.body=r,this.fetch=i,this.prepareSendMessagesRequest=s,this.prepareReconnectToStreamRequest=a}async sendMessages({abortSignal:t,...e}){var n,r,i,s,a;const o=await Tn(this.body),u=await Tn(this.headers),l=await Tn(this.credentials),d={...rn(u),...rn(e.headers)},c=await((n=this.prepareSendMessagesRequest)==null?void 0:n.call(this,{api:this.api,id:e.chatId,messages:e.messages,body:{...o,...e.body},headers:d,credentials:l,requestMetadata:e.metadata,trigger:e.trigger,messageId:e.messageId})),h=(r=c?.api)!=null?r:this.api,p=c?.headers!==void 0?rn(c.headers):d,g=c?.body!==void 0?c.body:{...o,...e.body,id:e.chatId,messages:e.messages,trigger:e.trigger,messageId:e.messageId},b=(i=c?.credentials)!=null?i:l,E=await((s=this.fetch)!=null?s:globalThis.fetch)(h,{method:"POST",headers:wo({"Content-Type":"application/json",...p},`ai-sdk/${Po}`,No()),body:JSON.stringify(g),credentials:b,signal:t});if(!E.ok)throw new Error((a=await E.text())!=null?a:"Failed to fetch the chat response.");if(!E.body)throw new Error("The response body is empty.");return this.processResponseStream(E.body)}async reconnectToStream(t){var e,n,r,i,s;const a=await Tn(this.body),o=await Tn(this.headers),u=await Tn(this.credentials),l={...rn(o),...rn(t.headers)},d=await((e=this.prepareReconnectToStreamRequest)==null?void 0:e.call(this,{api:this.api,id:t.chatId,body:{...a,...t.body},headers:l,credentials:u,requestMetadata:t.metadata})),c=(n=d?.api)!=null?n:`${this.api}/${t.chatId}/stream`,h=d?.headers!==void 0?rn(d.headers):l,p=(r=d?.credentials)!=null?r:u,b=await((i=this.fetch)!=null?i:globalThis.fetch)(c,{method:"GET",headers:wo(h,`ai-sdk/${Po}`,No()),credentials:p});if(b.status===204)return null;if(!b.ok)throw new Error((s=await b.text())!=null?s:"Failed to fetch the chat response.");if(!b.body)throw new Error("The response body is empty.");return this.processResponseStream(b.body)}},wc=class extends uE{constructor(t={}){super(t)}processResponseStream(t){return qg({stream:t,schema:Kb}).pipeThrough(new TransformStream({async transform(e,n){if(!e.success)throw e.error;n.enqueue(e.value)}}))}},lE=class{constructor({generateId:t=Mg,id:e=t(),transport:n=new wc,messageMetadataSchema:r,dataPartSchemas:i,state:s,onError:a,onToolCall:o,onFinish:u,onData:l,sendAutomaticallyWhen:d}){this.activeResponse=void 0,this.jobExecutor=new rE,this.sendMessage=async(c,h)=>{var p,g,b,x;if(c==null){await this.makeRequest({trigger:"submit-message",messageId:(p=this.lastMessage)==null?void 0:p.id,...h});return}let E;if("text"in c||"files"in c?E={parts:[...Array.isArray(c.files)?c.files:await oE(c.files),..."text"in c&&c.text!=null?[{type:"text",text:c.text}]:[]]}:E=c,c.messageId!=null){const k=this.state.messages.findIndex(y=>y.id===c.messageId);if(k===-1)throw new Error(`message with id ${c.messageId} not found`);if(this.state.messages[k].role!=="user")throw new Error(`message with id ${c.messageId} is not a user message`);this.state.messages=this.state.messages.slice(0,k+1),this.state.replaceMessage(k,{...E,id:c.messageId,role:(g=E.role)!=null?g:"user",metadata:c.metadata})}else this.state.pushMessage({...E,id:(b=E.id)!=null?b:this.generateId(),role:(x=E.role)!=null?x:"user",metadata:c.metadata});await this.makeRequest({trigger:"submit-message",messageId:c.messageId,...h})},this.regenerate=async({messageId:c,...h}={})=>{const p=c==null?this.state.messages.length-1:this.state.messages.findIndex(g=>g.id===c);if(p===-1)throw new Error(`message ${c} not found`);this.state.messages=this.state.messages.slice(0,this.messages[p].role==="assistant"?p:p+1),await this.makeRequest({trigger:"regenerate-message",messageId:c,...h})},this.resumeStream=async(c={})=>{await this.makeRequest({trigger:"resume-stream",...c})},this.clearError=()=>{this.status==="error"&&(this.state.error=void 0,this.setStatus({status:"ready"}))},this.addToolOutput=async({state:c="output-available",tool:h,toolCallId:p,output:g,errorText:b})=>this.jobExecutor.run(async()=>{var x,E;const k=this.state.messages,y=k[k.length-1];this.state.replaceMessage(k.length-1,{...y,parts:y.parts.map(_=>Mo(_)&&_.toolCallId===p?{..._,state:c,output:g,errorText:b}:_)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(_=>Mo(_)&&_.toolCallId===p?{..._,state:c,output:g,errorText:b}:_)),this.status!=="streaming"&&this.status!=="submitted"&&((x=this.sendAutomaticallyWhen)!=null&&x.call(this,{messages:this.state.messages}))&&this.makeRequest({trigger:"submit-message",messageId:(E=this.lastMessage)==null?void 0:E.id})}),this.addToolResult=this.addToolOutput,this.stop=async()=>{var c;this.status!=="streaming"&&this.status!=="submitted"||(c=this.activeResponse)!=null&&c.abortController&&this.activeResponse.abortController.abort()},this.id=e,this.transport=n,this.generateId=t,this.messageMetadataSchema=r,this.dataPartSchemas=i,this.state=s,this.onError=a,this.onToolCall=o,this.onFinish=u,this.onData=l,this.sendAutomaticallyWhen=d}get status(){return this.state.status}setStatus({status:t,error:e}){this.status!==t&&(this.state.status=t,this.state.error=e)}get error(){return this.state.error}get messages(){return this.state.messages}get lastMessage(){return this.state.messages[this.state.messages.length-1]}set messages(t){this.state.messages=t}async makeRequest({trigger:t,metadata:e,headers:n,body:r,messageId:i}){var s,a,o,u;this.setStatus({status:"submitted",error:void 0});const l=this.lastMessage;let d=!1,c=!1,h=!1;try{const p={state:eE({lastMessage:this.state.snapshot(l),messageId:this.generateId()}),abortController:new AbortController};p.abortController.signal.addEventListener("abort",()=>{d=!0}),this.activeResponse=p;let g;if(t==="resume-stream"){const x=await this.transport.reconnectToStream({chatId:this.id,metadata:e,headers:n,body:r});if(x==null){this.setStatus({status:"ready"});return}g=x}else g=await this.transport.sendMessages({chatId:this.id,messages:this.state.messages,abortSignal:p.abortController.signal,metadata:e,headers:n,body:r,trigger:t,messageId:i});const b=x=>this.jobExecutor.run(()=>x({state:p.state,write:()=>{var E;this.setStatus({status:"streaming"}),p.state.message.id===((E=this.lastMessage)==null?void 0:E.id)?this.state.replaceMessage(this.state.messages.length-1,p.state.message):this.state.pushMessage(p.state.message)}}));await nE({stream:tE({stream:g,onToolCall:this.onToolCall,onData:this.onData,messageMetadataSchema:this.messageMetadataSchema,dataPartSchemas:this.dataPartSchemas,runUpdateMessageJob:b,onError:x=>{throw x}}),onError:x=>{throw x}}),this.setStatus({status:"ready"})}catch(p){if(d||p.name==="AbortError")return d=!0,this.setStatus({status:"ready"}),null;h=!0,p instanceof TypeError&&(p.message.toLowerCase().includes("fetch")||p.message.toLowerCase().includes("network"))&&(c=!0),this.onError&&p instanceof Error&&this.onError(p),this.setStatus({status:"error",error:p})}finally{try{(a=this.onFinish)==null||a.call(this,{message:this.activeResponse.state.message,messages:this.state.messages,isAbort:d,isDisconnect:c,isError:h,finishReason:(s=this.activeResponse)==null?void 0:s.state.finishReason})}catch(p){console.error(p)}this.activeResponse=void 0}(o=this.sendAutomaticallyWhen)!=null&&o.call(this,{messages:this.state.messages})&&!h&&await this.makeRequest({trigger:"submit-message",messageId:(u=this.lastMessage)==null?void 0:u.id,metadata:e,headers:n,body:r})}},ts,Fo;function cE(){if(Fo)return ts;Fo=1;function t(e,n){if(typeof e!="function")throw new TypeError(`Expected the first argument to be a \`function\`, got \`${typeof e}\`.`);let r,i=0;return function(...a){clearTimeout(r);const o=Date.now(),u=o-i,l=n-u;l<=0?(i=o,e.apply(this,a)):r=setTimeout(()=>{i=Date.now(),e.apply(this,a)},l)}}return ts=t,ts}var dE=cE();const fE=ca(dE);var vc=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},Oe=(t,e,n)=>(vc(t,e,"read from private field"),n?n.call(t):e.get(t)),St=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},Ht=(t,e,n,r)=>(vc(t,e,"write to private field"),e.set(t,n),n);function hE(t,e){return e!=null?fE(t,e):t}var mt,ri,ii,ir,sr,ar,An,Fs,zs,pE=class{constructor(t=[]){St(this,mt,void 0),St(this,ri,"ready"),St(this,ii,void 0),St(this,ir,new Set),St(this,sr,new Set),St(this,ar,new Set),this.pushMessage=e=>{Ht(this,mt,Oe(this,mt).concat(e)),Oe(this,An).call(this)},this.popMessage=()=>{Ht(this,mt,Oe(this,mt).slice(0,-1)),Oe(this,An).call(this)},this.replaceMessage=(e,n)=>{Ht(this,mt,[...Oe(this,mt).slice(0,e),this.snapshot(n),...Oe(this,mt).slice(e+1)]),Oe(this,An).call(this)},this.snapshot=e=>structuredClone(e),this["~registerMessagesCallback"]=(e,n)=>{const r=n?hE(e,n):e;return Oe(this,ir).add(r),()=>{Oe(this,ir).delete(r)}},this["~registerStatusCallback"]=e=>(Oe(this,sr).add(e),()=>{Oe(this,sr).delete(e)}),this["~registerErrorCallback"]=e=>(Oe(this,ar).add(e),()=>{Oe(this,ar).delete(e)}),St(this,An,()=>{Oe(this,ir).forEach(e=>e())}),St(this,Fs,()=>{Oe(this,sr).forEach(e=>e())}),St(this,zs,()=>{Oe(this,ar).forEach(e=>e())}),Ht(this,mt,t)}get status(){return Oe(this,ri)}set status(t){Ht(this,ri,t),Oe(this,Fs).call(this)}get error(){return Oe(this,ii)}set error(t){Ht(this,ii,t),Oe(this,zs).call(this)}get messages(){return Oe(this,mt)}set messages(t){Ht(this,mt,[...t]),Oe(this,An).call(this)}};mt=new WeakMap;ri=new WeakMap;ii=new WeakMap;ir=new WeakMap;sr=new WeakMap;ar=new WeakMap;An=new WeakMap;Fs=new WeakMap;zs=new WeakMap;var Sn,zo=class extends lE{constructor({messages:t,...e}){const n=new pE(t);super({...e,state:n}),St(this,Sn,void 0),this["~registerMessagesCallback"]=(r,i)=>Oe(this,Sn)["~registerMessagesCallback"](r,i),this["~registerStatusCallback"]=r=>Oe(this,Sn)["~registerStatusCallback"](r),this["~registerErrorCallback"]=r=>Oe(this,Sn)["~registerErrorCallback"](r),Ht(this,Sn,n)}};Sn=new WeakMap;function mE({experimental_throttle:t,resume:e=!1,...n}={}){const r=P.useRef("chat"in n?n.chat:new zo(n));("chat"in n&&n.chat!==r.current||"id"in n&&r.current.id!==n.id)&&(r.current="chat"in n?n.chat:new zo(n));const s=P.useCallback(d=>r.current["~registerMessagesCallback"](d,t),[t,r.current.id]),a=P.useSyncExternalStore(s,()=>r.current.messages,()=>r.current.messages),o=P.useSyncExternalStore(r.current["~registerStatusCallback"],()=>r.current.status,()=>r.current.status),u=P.useSyncExternalStore(r.current["~registerErrorCallback"],()=>r.current.error,()=>r.current.error),l=P.useCallback(d=>{typeof d=="function"&&(d=d(r.current.messages)),r.current.messages=d},[r]);return P.useEffect(()=>{e&&r.current.resumeStream()},[e,r]),{id:r.current.id,messages:a,setMessages:l,sendMessage:r.current.sendMessage,regenerate:r.current.regenerate,clearError:r.current.clearError,stop:r.current.stop,error:u,resumeStream:r.current.resumeStream,status:o,addToolResult:r.current.addToolOutput,addToolOutput:r.current.addToolOutput}}const gE=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],bE=yp("grip-vertical",gE);function Rc(t){const e=F.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(Mn.Root,{"data-slot":"drawer",...n}),e[2]=n,e[3]=r):r=e[3],r}function Oc(t){const e=F.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(Mn.Trigger,{"data-slot":"drawer-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function EE(t){const e=F.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(Mn.Portal,{"data-slot":"drawer-portal",...n}),e[2]=n,e[3]=r):r=e[3],r}function xE(t){const e=F.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=X("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=m.jsx(Mn.Overlay,{"data-slot":"drawer-overlay",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function Lc(t){const e=F.c(12);let n,r,i;e[0]!==t?({className:r,children:n,...i}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i):(n=e[1],r=e[2],i=e[3]);let s;e[4]===Symbol.for("react.memo_cache_sentinel")?(s=m.jsx(xE,{}),e[4]=s):s=e[4];let a;e[5]!==r?(a=X("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",r),e[5]=r,e[6]=a):a=e[6];let o;e[7]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),e[7]=o):o=e[7];let u;return e[8]!==n||e[9]!==i||e[10]!==a?(u=m.jsxs(EE,{"data-slot":"drawer-portal",children:[s,m.jsxs(Mn.Content,{"data-slot":"drawer-content",className:a,...i,children:[o,n]})]}),e[8]=n,e[9]=i,e[10]=a,e[11]=u):u=e[11],u}function Dc(t){const e=F.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=X("flex flex-col gap-1.5 px-4 py-2",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=m.jsx("div",{"data-slot":"drawer-header",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function Pc(t){const e=F.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=X("text-foreground font-semibold",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=m.jsx(Mn.Title,{"data-slot":"drawer-title",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function js({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,i]=TE({defaultProp:e,onChange:n}),s=t!==void 0,a=s?t:r,o=bl(n),u=P.useCallback(l=>{if(s){const c=typeof l=="function"?l(t):l;c!==t&&o(c)}else i(l)},[s,t,i,o]);return[a,u]}function TE({defaultProp:t,onChange:e}){const n=P.useState(t),[r]=n,i=P.useRef(r),s=bl(e);return P.useEffect(()=>{i.current!==r&&(s(r),i.current=r)},[r,i,s]),n}const Mc=P.createContext({isMobile:!1,setValue:()=>{}}),ga=()=>P.useContext(Mc),Bc=t=>{const e=F.c(37);let n,r,i,s,a,o,u,l;e[0]!==t?({children:n,defaultOpen:r,open:o,onOpenChange:s,defaultValue:i,value:l,onValueChange:a,...u}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=s,e[5]=a,e[6]=o,e[7]=u,e[8]=l):(n=e[1],r=e[2],i=e[3],s=e[4],a=e[5],o=e[6],u=e[7],l=e[8]);const d=Bn(),c=r??!1;let h;e[9]!==s||e[10]!==o||e[11]!==c?(h={prop:o,defaultProp:c,onChange:s},e[9]=s,e[10]=o,e[11]=c,e[12]=h):h=e[12];const[p,g]=js(h);let b;e[13]!==i||e[14]!==a||e[15]!==l?(b={prop:l,defaultProp:i,onChange:a},e[13]=i,e[14]=a,e[15]=l,e[16]=b):b=e[16];const[x,E]=js(b);let k;e[17]!==E?(k=O=>{O&&E(O)},e[17]=E,e[18]=k):k=e[18];const y=k;let _;e[19]!==d||e[20]!==y?(_={isMobile:d,setValue:y},e[19]=d,e[20]=y,e[21]=_):_=e[21];let R;e[22]!==n||e[23]!==p||e[24]!==u||e[25]!==g?(R=m.jsx(Rc,{open:p,onOpenChange:g,...u,children:n}),e[22]=n,e[23]=p,e[24]=u,e[25]=g,e[26]=R):R=e[26];let S;e[27]!==p||e[28]!==u||e[29]!==g||e[30]!==y||e[31]!==R||e[32]!==x?(S=m.jsx(wp,{open:p,onOpenChange:g,value:x,onValueChange:y,...u,children:R}),e[27]=p,e[28]=u,e[29]=g,e[30]=y,e[31]=R,e[32]=x,e[33]=S):S=e[33];let w;return e[34]!==_||e[35]!==S?(w=m.jsx(Mc.Provider,{value:_,children:S}),e[34]=_,e[35]=S,e[36]=w):w=e[36],w},Fc=t=>{const{children:e,title:n,headerActions:r,...i}=t,{isMobile:s}=ga(),{className:a,...o}=i;return s?m.jsxs(Lc,{...o,children:[m.jsxs(Dc,{className:X(r?"flex flex-row items-center justify-between":"hidden"),children:[m.jsx(Pc,{children:n}),r]}),m.jsx("div",{className:X("flex flex-col gap-2 p-2 py-4",a),children:e})]}):m.jsx(Np,{...i,children:e})},zc=t=>{const e=F.c(7);let n,r;e[0]!==t?({children:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);const{isMobile:i}=ga();let s;return e[3]!==n||e[4]!==i||e[5]!==r?(s=i?m.jsx(Oc,{asChild:!0,children:m.jsx(ot,{variant:"outline",...r,children:n})}):m.jsx(Ip,{...r,children:n}),e[3]=n,e[4]=i,e[5]=r,e[6]=s):s=e[6],s},jc=t=>{const e=F.c(7);let n,r;e[0]!==t?({children:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);const{isMobile:i}=ga();let s;return e[3]!==n||e[4]!==i||e[5]!==r?(s=i?m.jsx("span",{...r,children:n}):m.jsx(Cp,{...r,children:n}),e[3]=n,e[4]=i,e[5]=r,e[6]=s):s=e[6],s},_E=P.memo(function(e){const n=F.c(21),{agent:r,isSelected:i}=e,s=i&&"bg-accent";let a;n[0]!==s?(a=X("flex items-start gap-3 py-3 px-3 hover:bg-accent cursor-pointer rounded-xl",s),n[0]=s,n[1]=a):a=n[1];let o;n[2]!==r.avatar||n[3]!==r.name?(o=m.jsx("div",{className:"border border-border/10 relative rounded-xl shrink-0 size-10 overflow-hidden bg-muted",children:r.avatar?m.jsx("img",{src:r.avatar,alt:r.name,className:"size-full object-cover"}):m.jsx("div",{className:"size-full flex items-center justify-center text-muted-foreground",children:m.jsx(fe,{name:"robot",className:"size-5"})})}),n[2]=r.avatar,n[3]=r.name,n[4]=o):o=n[4];let u;n[5]!==r.name?(u=m.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:r.name}),n[5]=r.name,n[6]=u):u=n[6];let l;n[7]!==i?(l=i&&m.jsx(fe,{name:"check",className:"size-4 text-foreground shrink-0"}),n[7]=i,n[8]=l):l=n[8];let d;n[9]!==u||n[10]!==l?(d=m.jsxs("div",{className:"flex items-center justify-between",children:[u,l]}),n[9]=u,n[10]=l,n[11]=d):d=n[11];let c;n[12]!==r.description?(c=r.description&&m.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2 leading-relaxed",children:r.description}),n[12]=r.description,n[13]=c):c=n[13];let h;n[14]!==d||n[15]!==c?(h=m.jsxs("div",{className:"flex flex-col flex-1 min-w-0 gap-0.5",children:[d,c]}),n[14]=d,n[15]=c,n[16]=h):h=n[16];let p;return n[17]!==a||n[18]!==o||n[19]!==h?(p=m.jsxs("div",{className:a,children:[o,h]}),n[17]=a,n[18]=o,n[19]=h,n[20]=p):p=n[20],p});function yE(t){const e=F.c(9),{agent:n}=t;if(!n){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsx("span",{className:"text-sm text-muted-foreground",children:"Select agent"}),e[0]=a):a=e[0],a}let r;e[1]!==n.avatar||e[2]!==n.name?(r=n.avatar&&m.jsx("img",{src:n.avatar,alt:n.name,className:"size-5 rounded-md object-cover"}),e[1]=n.avatar,e[2]=n.name,e[3]=r):r=e[3];let i;e[4]!==n.name?(i=m.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:n.name}),e[4]=n.name,e[5]=i):i=e[5];let s;return e[6]!==r||e[7]!==i?(s=m.jsxs("div",{className:"flex items-center gap-2",children:[r,i]}),e[6]=r,e[7]=i,e[8]=s):s=e[8],s}function kE(t){const e=F.c(37),{agents:n,selectedAgentId:r,onAgentChange:i,variant:s,className:a,placeholder:o}=t,u=s===void 0?"bordered":s,l=o===void 0?"Select agent":o,[d,c]=P.useState(!1);let h;if(e[0]!==n||e[1]!==r){let B;e[3]!==r?(B=j=>j.id===r,e[3]=r,e[4]=B):B=e[4],h=n.find(B),e[0]=n,e[1]=r,e[2]=h}else h=e[2];const p=h;let g;e[5]!==i?(g=B=>{i(B),c(!1)},e[5]=i,e[6]=g):g=e[6];const b=g;if(n.length===0)return null;const x=r||"",E=u==="borderless"?"border-0 md:border-none":"border";let k;e[7]!==a||e[8]!==E?(k=X("h-8! text-sm hover:bg-accent rounded-lg py-1 px-2 gap-1 shadow-none cursor-pointer group focus-visible:ring-0 focus-visible:ring-offset-0",E,a),e[7]=a,e[8]=E,e[9]=k):k=e[9];let y;e[10]!==p?(y=m.jsx(yE,{agent:p}),e[10]=p,e[11]=y):y=e[11];let _;e[12]!==l||e[13]!==y?(_=m.jsx(jc,{placeholder:l,children:y}),e[12]=l,e[13]=y,e[14]=_):_=e[14];let R;e[15]!==k||e[16]!==_?(R=m.jsx(zc,{className:k,children:_}),e[15]=k,e[16]=_,e[17]=R):R=e[17];let S;e[18]===Symbol.for("react.memo_cache_sentinel")?(S=m.jsx("div",{className:"border-b px-4 py-3 bg-background/95 backdrop-blur sticky top-0 z-10",children:m.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[m.jsx(fe,{name:"search",className:"size-4"}),m.jsx("span",{className:"text-sm",children:"Search for an agent..."})]})}),e[18]=S):S=e[18];let w;if(e[19]!==n||e[20]!==b||e[21]!==r){let B;e[23]!==b||e[24]!==r?(B=j=>m.jsx("div",{onClick:()=>b(j.id),className:"outline-none",children:m.jsx(_E,{agent:j,isSelected:j.id===r})},j.id),e[23]=b,e[24]=r,e[25]=B):B=e[25],w=n.map(B),e[19]=n,e[20]=b,e[21]=r,e[22]=w}else w=e[22];let O;e[26]!==w?(O=m.jsxs("div",{className:"flex flex-col max-h-[400px]",children:[S,m.jsx("div",{className:"overflow-y-auto p-2 flex flex-col gap-1",children:w})]}),e[26]=w,e[27]=O):O=e[27];let D;e[28]!==l||e[29]!==O?(D=m.jsx(Fc,{title:l,className:"w-full md:w-[400px] p-0",children:O}),e[28]=l,e[29]=O,e[30]=D):D=e[30];let v;return e[31]!==b||e[32]!==d||e[33]!==R||e[34]!==D||e[35]!==x?(v=m.jsxs(Bc,{open:d,onOpenChange:c,value:x,onValueChange:b,children:[R,D]}),e[31]=b,e[32]=d,e[33]=R,e[34]=D,e[35]=x,e[36]=v):v=e[36],v}function AE(t){const e=F.c(5),{children:n,className:r}=t;let i;e[0]!==r?(i=X("flex flex-col h-full w-full bg-sidebar transform-[translateZ(0)]",r),e[0]=r,e[1]=i):i=e[1];let s;return e[2]!==n||e[3]!==i?(s=m.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=s):s=e[4],s}function SE(t){const e=F.c(5),{children:n,className:r}=t;let i;e[0]!==r?(i=X("flex h-12 items-center justify-between border-b border-border px-2 flex-none",r),e[0]=r,e[1]=i):i=e[1];let s;return e[2]!==n||e[3]!==i?(s=m.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=s):s=e[4],s}function CE(t){const e=F.c(5),{children:n,className:r}=t;let i;e[0]!==r?(i=X("flex-1 min-h-0 overflow-y-auto",r),e[0]=r,e[1]=i):i=e[1];let s;return e[2]!==n||e[3]!==i?(s=m.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=s):s=e[4],s}function IE(t){const e=F.c(5),{children:n,className:r}=t;let i;e[0]!==r?(i=X("flex-none w-full mx-auto p-2",r),e[0]=r,e[1]=i):i=e[1];let s;return e[2]!==n||e[3]!==i?(s=m.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=s):s=e[4],s}const en=Object.assign(AE,{Header:SE,Content:CE,Footer:IE});function NE(t){const e=F.c(13),{title:n,description:r,avatar:i,className:s}=t,a=n===void 0?"Start a conversation":n;let o;e[0]!==s?(o=X("flex flex-col items-center justify-center gap-4 p-8 text-center",s),e[0]=s,e[1]=o):o=e[1];let u;e[2]!==i?(u=i&&m.jsx("img",{src:i,alt:"Chat avatar",className:"size-[60px] rounded-[18px] border-[1.875px] border-border/10"}),e[2]=i,e[3]=u):u=e[3];let l;e[4]!==a?(l=a&&m.jsx("h3",{className:"text-xl font-medium text-foreground",children:a}),e[4]=a,e[5]=l):l=e[5];let d;e[6]!==r?(d=r&&m.jsx("div",{className:"text-muted-foreground text-center text-sm max-w-md",children:r}),e[6]=r,e[7]=d):d=e[7];let c;return e[8]!==o||e[9]!==u||e[10]!==l||e[11]!==d?(c=m.jsxs("div",{className:o,children:[u,l,d]}),e[8]=o,e[9]=u,e[10]=l,e[11]=d,e[12]=c):c=e[12],c}function wE(t){const e=F.c(68),{value:n,onChange:r,onSubmit:i,onStop:s,disabled:a,isStreaming:o,placeholder:u,className:l,centered:d,contextContent:c,leftActions:h,rightActions:p,maxTextHeight:g}=t,b=u===void 0?"Ask anything or @ for context":u,x=d===void 0?!1:d,E=g===void 0?"164px":g;let k;e[0]!==a||e[1]!==o||e[2]!==n?(k=!a&&!o&&n.trim().length>0,e[0]=a,e[1]=o,e[2]=n,e[3]=k):k=e[3];const y=k;let _;e[4]!==y||e[5]!==o||e[6]!==s||e[7]!==i?(_=$e=>{$e.preventDefault(),o&&s?s():y&&i()},e[4]=y,e[5]=o,e[6]=s,e[7]=i,e[8]=_):_=e[8];const R=_;let S;e[9]!==y||e[10]!==i?(S=$e=>{$e.key==="Enter"&&!$e.shiftKey&&($e.preventDefault(),y&&i())},e[9]=y,e[10]=i,e[11]=S):S=e[11];const w=S;let O;e[12]!==l?(O=X("w-full",l),e[12]=l,e[13]=O):O=e[13];const D=x?"shadow-md":"shadow-sm";let v;e[14]!==D?(v=X("relative rounded-xl border border-border bg-background w-full min-h-[130px] flex flex-col",D),e[14]=D,e[15]=v):v=e[15];let B;e[16]!==c?(B=c&&m.jsx("div",{className:"mb-1",children:c}),e[16]=c,e[17]=B):B=e[17];let j;e[18]!==E?(j={maxHeight:E},e[18]=E,e[19]=j):j=e[19];let G;e[20]!==r?(G=$e=>r($e.target.value),e[20]=r,e[21]=G):G=e[21];const Y=a||o;let H;e[22]===Symbol.for("react.memo_cache_sentinel")?(H=X("placeholder:text-muted-foreground resize-none focus-visible:ring-0 border-0 p-2 text-sm min-h-[20px] w-full","rounded-none shadow-none"),e[22]=H):H=e[22];let K;e[23]===Symbol.for("react.memo_cache_sentinel")?(K={minHeight:"20px",height:"auto",overflow:"hidden"},e[23]=K):K=e[23];let se;e[24]!==w||e[25]!==b||e[26]!==G||e[27]!==Y||e[28]!==n?(se=m.jsx(vp,{value:n,onChange:G,onKeyDown:w,placeholder:b,disabled:Y,className:H,rows:1,style:K}),e[24]=w,e[25]=b,e[26]=G,e[27]=Y,e[28]=n,e[29]=se):se=e[29];let pe;e[30]!==j||e[31]!==se?(pe=m.jsx("div",{className:"overflow-y-auto relative flex-1",style:j,children:se}),e[30]=j,e[31]=se,e[32]=pe):pe=e[32];let ce;e[33]!==B||e[34]!==pe?(ce=m.jsxs("div",{className:"relative flex flex-col gap-2 p-2.5 flex-1",children:[B,pe]}),e[33]=B,e[34]=pe,e[35]=ce):ce=e[35];let N;e[36]!==h?(N=m.jsx("div",{className:"flex items-center",children:h}),e[36]=h,e[37]=N):N=e[37];const Ee=o?"button":"submit";let xe;e[38]!==o||e[39]!==s?(xe=$e=>{o&&($e.preventDefault(),$e.stopPropagation(),s?.())},e[38]=o,e[39]=s,e[40]=xe):xe=e[40];const T=y||o?"default":"ghost",V=!y&&!o,te=!y&&!o&&"bg-muted text-muted-foreground hover:bg-muted hover:text-muted-foreground cursor-not-allowed";let Q;e[41]!==te?(Q=X("size-8 rounded-full transition-all",te),e[41]=te,e[42]=Q):Q=e[42];const J=o?"Stop generating":"Send message (Enter)",ne=o?"stop":"arrow_upward";let ae;e[43]!==o||e[44]!==ne?(ae=m.jsx(fe,{name:ne,size:20,filled:o}),e[43]=o,e[44]=ne,e[45]=ae):ae=e[45];let ge;e[46]!==Ee||e[47]!==xe||e[48]!==T||e[49]!==V||e[50]!==Q||e[51]!==J||e[52]!==ae?(ge=m.jsx(ot,{type:Ee,onClick:xe,variant:T,size:"icon",disabled:V,className:Q,title:J,children:ae}),e[46]=Ee,e[47]=xe,e[48]=T,e[49]=V,e[50]=Q,e[51]=J,e[52]=ae,e[53]=ge):ge=e[53];let Re;e[54]!==p||e[55]!==ge?(Re=m.jsxs("div",{className:"flex items-center gap-1",children:[p,ge]}),e[54]=p,e[55]=ge,e[56]=Re):Re=e[56];let Me;e[57]!==N||e[58]!==Re?(Me=m.jsxs("div",{className:"flex items-center justify-between px-2.5 pb-2.5",children:[N,Re]}),e[57]=N,e[58]=Re,e[59]=Me):Me=e[59];let ye;e[60]!==ce||e[61]!==Me||e[62]!==v?(ye=m.jsxs("div",{className:v,children:[ce,Me]}),e[60]=ce,e[61]=Me,e[62]=v,e[63]=ye):ye=e[63];let Ye;return e[64]!==R||e[65]!==ye||e[66]!==O?(Ye=m.jsx("form",{onSubmit:R,className:O,children:ye}),e[64]=R,e[65]=ye,e[66]=O,e[67]=Ye):Ye=e[67],Ye}const vE={reasoning:{icon:"neurology",bg:"bg-purple-100",text:"text-purple-700",label:"Reasoning"},"image-upload":{icon:"image",bg:"bg-teal-100",text:"text-teal-700",label:"Can analyze images"},"file-upload":{icon:"description",bg:"bg-blue-100",text:"text-blue-700",label:"Can analyze files"},"web-search":{icon:"search",bg:"bg-amber-100",text:"text-amber-700",label:"Can search the web to answer questions"}},Uc=P.memo(function(e){const n=F.c(14),{capability:r}=e,i=vE[r];let s;n[0]!==r||n[1]!==i?(s=i||{icon:"check",bg:"bg-slate-200",text:"text-slate-700",label:r},n[0]=r,n[1]=i,n[2]=s):s=n[2];const a=s,o=`flex items-center justify-center h-6 w-6 rounded-sm ${a.bg}`;let u;n[3]!==a.icon||n[4]!==a.text?(u=m.jsx(fe,{name:a.icon,className:a.text}),n[3]=a.icon,n[4]=a.text,n[5]=u):u=n[5];let l;n[6]!==o||n[7]!==u?(l=m.jsx(Cl,{asChild:!0,children:m.jsx("div",{className:o,children:u})}),n[6]=o,n[7]=u,n[8]=l):l=n[8];let d;n[9]!==a.label?(d=m.jsx(Sl,{children:m.jsx("p",{children:a.label})}),n[9]=a.label,n[10]=d):d=n[10];let c;return n[11]!==l||n[12]!==d?(c=m.jsxs(Il,{children:[l,d]}),n[11]=l,n[12]=d,n[13]=c):c=n[13],c}),jo=P.memo(function(e){const n=F.c(54),{model:r,compact:i}=e,s=i===void 0?!1:i;if(!r){let E;return n[0]===Symbol.for("react.memo_cache_sentinel")?(E=m.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"Hover to preview"}),n[0]=E):E=n[0],E}const a=r.contextWindow||r.inputCost||r.outputCost||r.outputLimit;if(!a&&!s){let E;n[1]!==r.logo||n[2]!==r.name?(E=r.logo&&m.jsx("img",{src:r.logo,className:"w-6 h-6",alt:r.name}),n[1]=r.logo,n[2]=r.name,n[3]=E):E=n[3];let k;n[4]!==r.name?(k=m.jsx("p",{className:"text-lg font-medium leading-7",children:r.name}),n[4]=r.name,n[5]=k):k=n[5];let y;n[6]!==E||n[7]!==k?(y=m.jsxs("div",{className:"flex items-center gap-3 py-2 px-0",children:[E,k]}),n[6]=E,n[7]=k,n[8]=y):y=n[8];let _;n[9]!==r.description?(_=r.description&&m.jsx("p",{className:"text-sm text-muted-foreground",children:r.description}),n[9]=r.description,n[10]=_):_=n[10];let R;return n[11]!==y||n[12]!==_?(R=m.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[y,_]}),n[11]=y,n[12]=_,n[13]=R):R=n[13],R}if(!a&&s)return null;if(s){let E;n[14]!==r.contextWindow?(E=r.contextWindow&&m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:"text-muted-foreground",children:"Context"}),m.jsxs("span",{className:"text-foreground font-medium",children:[r.contextWindow.toLocaleString()," tokens"]})]}),n[14]=r.contextWindow,n[15]=E):E=n[15];let k;n[16]!==r.inputCost?(k=r.inputCost&&m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:"text-muted-foreground",children:"Input cost"}),m.jsxs("span",{className:"text-foreground font-medium",children:["$",r.inputCost.toFixed(2)," / 1M"]})]}),n[16]=r.inputCost,n[17]=k):k=n[17];let y;n[18]!==r.outputCost?(y=r.outputCost&&m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:"text-muted-foreground",children:"Output cost"}),m.jsxs("span",{className:"text-foreground font-medium",children:["$",r.outputCost.toFixed(2)," / 1M"]})]}),n[18]=r.outputCost,n[19]=y):y=n[19];let _;n[20]!==r.outputLimit?(_=r.outputLimit&&m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:"text-muted-foreground",children:"Output limit"}),m.jsxs("span",{className:"text-foreground font-medium",children:[r.outputLimit.toLocaleString()," tokens"]})]}),n[20]=r.outputLimit,n[21]=_):_=n[21];let R;return n[22]!==E||n[23]!==k||n[24]!==y||n[25]!==_?(R=m.jsxs("div",{className:"flex flex-col gap-2.5 pt-3 pb-3 px-3 rounded-b-xl text-xs",children:[E,k,y,_]}),n[22]=E,n[23]=k,n[24]=y,n[25]=_,n[26]=R):R=n[26],R}let o;n[27]!==r.logo||n[28]!==r.name?(o=r.logo&&m.jsx("img",{src:r.logo,className:"w-6 h-6",alt:r.name}),n[27]=r.logo,n[28]=r.name,n[29]=o):o=n[29];let u;n[30]!==r.name?(u=m.jsx("p",{className:"text-lg font-medium leading-7",children:r.name}),n[30]=r.name,n[31]=u):u=n[31];let l;n[32]!==o||n[33]!==u?(l=m.jsxs("div",{className:"flex items-center gap-3",children:[o,u]}),n[32]=o,n[33]=u,n[34]=l):l=n[34];let d;n[35]!==r.capabilities?(d=r.capabilities&&r.capabilities.length>0&&m.jsx("div",{className:"flex items-center gap-2",children:r.capabilities.map(DE)}),n[35]=r.capabilities,n[36]=d):d=n[36];let c;n[37]!==l||n[38]!==d?(c=m.jsxs("div",{className:"flex flex-col gap-3 py-2 px-0",children:[l,d]}),n[37]=l,n[38]=d,n[39]=c):c=n[39];let h;n[40]!==r.contextWindow?(h=r.contextWindow&&m.jsxs("div",{className:"flex flex-col gap-1.5",children:[m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx(fe,{name:"widgets",className:"w-3.5 h-3.5 text-muted-foreground"}),m.jsx("p",{className:"text-sm text-foreground",children:"Context window"})]}),m.jsxs("p",{className:"text-sm text-muted-foreground",children:[r.contextWindow.toLocaleString()," tokens"]})]}),n[40]=r.contextWindow,n[41]=h):h=n[41];let p;n[42]!==r.inputCost||n[43]!==r.outputCost?(p=(r.inputCost||r.outputCost)&&m.jsxs("div",{className:"flex flex-col gap-1.5",children:[m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx(fe,{name:"attach_money",className:"w-3.5 h-3.5 text-muted-foreground"}),m.jsx("p",{className:"text-sm text-foreground",children:"Costs"})]}),m.jsxs("div",{className:"flex flex-col gap-0.5",children:[r.inputCost!==null&&r.inputCost!==void 0&&m.jsxs("p",{className:"text-sm text-muted-foreground",children:["$",r.inputCost.toFixed(2)," / 1M tokens (input)"]}),r.outputCost!==null&&r.outputCost!==void 0&&m.jsxs("p",{className:"text-sm text-muted-foreground",children:["$",r.outputCost.toFixed(2)," / 1M tokens (output)"]})]})]}),n[42]=r.inputCost,n[43]=r.outputCost,n[44]=p):p=n[44];let g;n[45]!==r.outputLimit?(g=r.outputLimit&&m.jsxs("div",{className:"flex flex-col gap-1.5",children:[m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx(fe,{name:"output",className:"w-4.5 h-4.5 text-muted-foreground/70"}),m.jsx("p",{className:"text-sm text-foreground",children:"Output limit"})]}),m.jsxs("p",{className:"text-sm text-muted-foreground",children:[r.outputLimit.toLocaleString()," token limit"]})]}),n[45]=r.outputLimit,n[46]=g):g=n[46];let b;n[47]!==h||n[48]!==p||n[49]!==g?(b=m.jsxs("div",{className:"flex flex-col gap-4",children:[h,p,g]}),n[47]=h,n[48]=p,n[49]=g,n[50]=b):b=n[50];let x;return n[51]!==b||n[52]!==c?(x=m.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[c,b]}),n[51]=b,n[52]=c,n[53]=x):x=n[53],x}),RE=P.memo(function(e){const n=F.c(27),{model:r,onHover:i,isSelected:s,hasExpandedInfo:a}=e,o=a?"rounded-t-xl":"rounded-xl";let u;n[0]!==o?(u=X("flex items-center gap-2 h-10 py-4 px-3 hover:bg-accent cursor-pointer",o),n[0]=o,n[1]=u):u=n[1];let l;n[2]!==r||n[3]!==i?(l=()=>i(r),n[2]=r,n[3]=i,n[4]=l):l=n[4];let d;n[5]!==r.logo||n[6]!==r.name?(d=r.logo&&m.jsx("img",{src:r.logo,className:"w-5 h-5 shrink-0",alt:r.name}),n[5]=r.logo,n[6]=r.name,n[7]=d):d=n[7];let c;n[8]!==r.name?(c=m.jsx("span",{className:"text-sm text-foreground",children:r.name}),n[8]=r.name,n[9]=c):c=n[9];let h;n[10]!==a||n[11]!==r.capabilities?(h=a&&r.capabilities&&r.capabilities.length>0&&m.jsx("div",{className:"md:hidden flex items-center gap-1.5 ml-auto",children:r.capabilities.map(PE)}),n[10]=a,n[11]=r.capabilities,n[12]=h):h=n[12];let p;n[13]!==a||n[14]!==s?(p=s&&!a&&m.jsx(fe,{name:"check",className:"w-4 h-4 text-foreground ml-auto"}),n[13]=a,n[14]=s,n[15]=p):p=n[15];let g;n[16]!==a||n[17]!==s?(g=s&&a&&m.jsx(fe,{name:"check",className:"w-4 h-4 text-foreground ml-2 shrink-0"}),n[16]=a,n[17]=s,n[18]=g):g=n[18];let b;return n[19]!==u||n[20]!==l||n[21]!==d||n[22]!==c||n[23]!==h||n[24]!==p||n[25]!==g?(b=m.jsxs("div",{className:u,onMouseEnter:l,children:[d,c,h,p,g]}),n[19]=u,n[20]=l,n[21]=d,n[22]=c,n[23]=h,n[24]=p,n[25]=g,n[26]=b):b=n[26],b});function OE(t){const e=F.c(9),{model:n}=t;if(!n){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsx("span",{className:"text-sm text-muted-foreground",children:"Select model"}),e[0]=a):a=e[0],a}let r;e[1]!==n.logo||e[2]!==n.name?(r=n.logo&&m.jsx("img",{src:n.logo,className:"w-4 h-4",alt:n.name}),e[1]=n.logo,e[2]=n.name,e[3]=r):r=e[3];let i;e[4]!==n.name?(i=m.jsx("span",{className:"text-sm text-muted-foreground group-hover:text-foreground transition-colors",children:n.name}),e[4]=n.name,e[5]=i):i=e[5];let s;return e[6]!==r||e[7]!==i?(s=m.jsxs("div",{className:"flex items-center gap-2",children:[r,i]}),e[6]=r,e[7]=i,e[8]=s):s=e[8],s}function LE(t){const e=F.c(53),{models:n,selectedModelId:r,onModelChange:i,variant:s,className:a,placeholder:o}=t,u=s===void 0?"borderless":s,l=o===void 0?"Select model":o,[d,c]=P.useState(!1),[h,p]=P.useState(null),[g,b]=P.useState(!1);let x;if(e[0]!==n||e[1]!==r){let xe;e[3]!==r?(xe=T=>T.id===r,e[3]=r,e[4]=xe):xe=e[4],x=n.find(xe),e[0]=n,e[1]=r,e[2]=x}else x=e[2];const E=x;let k;e[5]!==i?(k=xe=>{i(xe),c(!1)},e[5]=i,e[6]=k):k=e[6];const y=k;if(n.length===0)return null;const _=r||"",R=u==="borderless"&&"md:border-none";let S;e[7]!==a||e[8]!==R?(S=X("h-8! text-sm hover:bg-accent rounded-lg py-1 px-2 gap-1 shadow-none cursor-pointer border-0 group focus-visible:ring-0 focus-visible:ring-offset-0",R,a),e[7]=a,e[8]=R,e[9]=S):S=e[9];let w;e[10]!==E?(w=m.jsx(OE,{model:E}),e[10]=E,e[11]=w):w=e[11];let O;e[12]!==l||e[13]!==w?(O=m.jsx(jc,{placeholder:l,children:w}),e[12]=l,e[13]=w,e[14]=O):O=e[14];let D;e[15]!==S||e[16]!==O?(D=m.jsx(zc,{className:S,children:O}),e[15]=S,e[16]=O,e[17]=D):D=e[17];let v;e[18]!==g?(v=()=>b(!g),e[18]=g,e[19]=v):v=e[19];const B=g?"text-foreground":"text-muted-foreground";let j;e[20]!==B?(j=X("w-5 h-5 transition-colors",B),e[20]=B,e[21]=j):j=e[21];let G;e[22]!==j?(G=m.jsx(fe,{name:"info",className:j}),e[22]=j,e[23]=G):G=e[23];let Y;e[24]!==v||e[25]!==G?(Y=m.jsx("button",{type:"button",onClick:v,className:"md:hidden flex items-center justify-center h-8 w-8 rounded-lg hover:bg-accent transition-colors","aria-label":"Toggle model info",children:G}),e[24]=v,e[25]=G,e[26]=Y):Y=e[26];let H;if(e[27]!==y||e[28]!==n||e[29]!==r||e[30]!==g){let xe;e[32]!==y||e[33]!==r||e[34]!==g?(xe=T=>m.jsxs("div",{onClick:()=>y(T.id),className:X("rounded-xl mb-1",T.id===r&&"bg-accent"),children:[m.jsx(RE,{model:T,onHover:p,isSelected:T.id===r,hasExpandedInfo:g}),g&&m.jsx("div",{className:"md:hidden",children:m.jsx(jo,{model:T,compact:!0})})]},T.id),e[32]=y,e[33]=r,e[34]=g,e[35]=xe):xe=e[35],H=n.map(xe),e[27]=y,e[28]=n,e[29]=r,e[30]=g,e[31]=H}else H=e[31];let K;e[36]!==H?(K=m.jsx("div",{className:"flex-1 overflow-y-auto px-0.5 md:border-r",children:H}),e[36]=H,e[37]=K):K=e[37];const se=h||E||null;let pe;e[38]!==se?(pe=m.jsx("div",{className:"hidden md:block md:w-[300px] p-3",children:m.jsx(jo,{model:se})}),e[38]=se,e[39]=pe):pe=e[39];let ce;e[40]!==K||e[41]!==pe?(ce=m.jsxs("div",{className:"flex flex-col md:flex-row h-[350px]",children:[K,pe]}),e[40]=K,e[41]=pe,e[42]=ce):ce=e[42];let N;e[43]!==l||e[44]!==Y||e[45]!==ce?(N=m.jsx(Fc,{title:l,className:"w-full md:w-auto md:min-w-[600px] [&_button[aria-label='Scroll down']]:!hidden [&_button[aria-label='Scroll up']]:!hidden",headerActions:Y,children:ce}),e[43]=l,e[44]=Y,e[45]=ce,e[46]=N):N=e[46];let Ee;return e[47]!==y||e[48]!==d||e[49]!==D||e[50]!==N||e[51]!==_?(Ee=m.jsxs(Bc,{open:d,onOpenChange:c,value:_,onValueChange:y,children:[D,N]}),e[47]=y,e[48]=d,e[49]=D,e[50]=N,e[51]=_,e[52]=Ee):Ee=e[52],Ee}function DE(t){return m.jsx(Uc,{capability:t},t)}function PE(t){return m.jsx(Uc,{capability:t},t)}function dn(t){return new Promise((e,n)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>n(t.error)})}function ME(t,e){let n;const r=()=>{if(n)return n;const i=indexedDB.open(t);return i.onupgradeneeded=()=>i.result.createObjectStore(e),n=dn(i),n.then(s=>{s.onclose=()=>n=void 0},()=>{}),n};return(i,s)=>r().then(a=>s(a.transaction(e,i).objectStore(e)))}let ns;function Ri(){return ns||(ns=ME("keyval-store","keyval")),ns}function ba(t,e=Ri()){return e("readonly",n=>dn(n.get(t)))}function dr(t,e,n=Ri()){return n("readwrite",r=>(r.put(e,t),dn(r.transaction)))}function Hc(t,e=Ri()){return e("readwrite",n=>(n.delete(t),dn(n.transaction)))}function BE(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},dn(t.transaction)}function $c(t=Ri()){return t("readonly",e=>{if(e.getAll&&e.getAllKeys)return Promise.all([dn(e.getAllKeys()),dn(e.getAll())]).then(([r,i])=>r.map((s,a)=>[s,i[a]]));const n=[];return t("readonly",r=>BE(r,i=>n.push([i.key,i.value])).then(()=>n))})}function FE(t){const e=`${t}:threads:`;return $c().then(n=>n.filter(([r])=>typeof r=="string"&&r.startsWith(e)).map(([,r])=>r))}async function zE(t,e){const n=`${t}:threads:${e}`;return await ba(n)??null}function jE(t,e){const n=`${t}:messages:`;return $c().then(r=>r.filter(([s])=>typeof s=="string"&&s.startsWith(n)).map(([,s])=>s).filter(s=>s.metadata?.thread_id===e||s.threadId===e).sort((s,a)=>{const o=s.metadata?.created_at||s.createdAt||"",u=a.metadata?.created_at||a.createdAt||"";return String(o).localeCompare(String(u))}))}function UE(){const t=F.c(7),{locator:e}=vt();let n;t[0]!==e?(n=at.threads(e),t[0]=e,t[1]=n):n=t[1];let r;t[2]!==e?(r=()=>FE(e),t[2]=e,t[3]=r):r=t[3];let i;t[4]!==n||t[5]!==r?(i={queryKey:n,queryFn:r,staleTime:3e4},t[4]=n,t[5]=r,t[6]=i):i=t[6];const{data:s}=da(i);return s}function HE(t){const e=F.c(11),{locator:n}=vt();let r;e[0]!==n||e[1]!==t?(r=at.threadMessages(n,t),e[0]=n,e[1]=t,e[2]=r):r=e[2];let i;e[3]!==n||e[4]!==t?(i=()=>jE(n,t),e[3]=n,e[4]=t,e[5]=i):i=e[5];let s;e[6]!==r||e[7]!==i?(s={queryKey:r,queryFn:i,staleTime:3e4},e[6]=r,e[7]=i,e[8]=s):s=e[8];const{data:a}=da(s);let o;return e[9]!==a?(o=a??[],e[9]=a,e[10]=o):o=e[10],o}function Zc(){const t=F.c(28),{locator:e}=vt(),n=El();let r;t[0]!==e?(r=async x=>{const E=`${e}:threads:${x.id}`;return await dr(E,x),x},t[0]=e,t[1]=r):r=t[1];let i;t[2]!==e||t[3]!==n?(i=()=>{n.invalidateQueries({queryKey:at.threads(e)})},t[2]=e,t[3]=n,t[4]=i):i=t[4];let s;t[5]!==r||t[6]!==i?(s={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=s):s=t[7];const a=on(s);let o;t[8]!==e?(o=async x=>{const{id:E,updates:k}=x,y=`${e}:threads:${E}`,_=await ba(y);if(!_)throw new Error(`Thread ${E} not found`);const R={..._,...k};return await dr(y,R),R},t[8]=e,t[9]=o):o=t[9];let u;t[10]!==e||t[11]!==n?(u=x=>{n.invalidateQueries({queryKey:at.threads(e)}),n.invalidateQueries({queryKey:at.thread(e,x.id)})},t[10]=e,t[11]=n,t[12]=u):u=t[12];let l;t[13]!==o||t[14]!==u?(l={mutationFn:o,onSuccess:u},t[13]=o,t[14]=u,t[15]=l):l=t[15];const d=on(l);let c;t[16]!==e?(c=async x=>{const E=`${e}:threads:${x}`;return await Hc(E),x},t[16]=e,t[17]=c):c=t[17];let h;t[18]!==e||t[19]!==n?(h=()=>{n.invalidateQueries({queryKey:at.threads(e)})},t[18]=e,t[19]=n,t[20]=h):h=t[20];let p;t[21]!==c||t[22]!==h?(p={mutationFn:c,onSuccess:h},t[21]=c,t[22]=h,t[23]=p):p=t[23];const g=on(p);let b;return t[24]!==g||t[25]!==a||t[26]!==d?(b={insert:a,update:d,delete:g},t[24]=g,t[25]=a,t[26]=d,t[27]=b):b=t[27],b}function $E(){const t=F.c(37),{locator:e}=vt(),n=El();let r;t[0]!==e?(r=async _=>{const R=`${e}:messages:${_.id}`;return await dr(R,_),_},t[0]=e,t[1]=r):r=t[1];let i;t[2]!==e||t[3]!==n?(i=_=>{const R=_.metadata?.thread_id||_.threadId;R&&n.invalidateQueries({queryKey:at.threadMessages(e,R)}),n.invalidateQueries({queryKey:at.messages(e)})},t[2]=e,t[3]=n,t[4]=i):i=t[4];let s;t[5]!==r||t[6]!==i?(s={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=s):s=t[7];const a=on(s);let o;t[8]!==e?(o=async _=>(await Promise.all(_.map(R=>{const S=`${e}:messages:${R.id}`;return dr(S,R)})),_),t[8]=e,t[9]=o):o=t[9];let u;t[10]!==e||t[11]!==n?(u=_=>{const R=new Set;for(const S of _){const w=S.metadata?.thread_id||S.threadId;w&&R.add(w)}for(const S of R)n.invalidateQueries({queryKey:at.threadMessages(e,S)});n.invalidateQueries({queryKey:at.messages(e)})},t[10]=e,t[11]=n,t[12]=u):u=t[12];let l;t[13]!==o||t[14]!==u?(l={mutationFn:o,onSuccess:u},t[13]=o,t[14]=u,t[15]=l):l=t[15];const d=on(l);let c;t[16]!==e?(c=async _=>{const{id:R,updates:S}=_,w=`${e}:messages:${R}`,O=await ba(w);if(!O)throw new Error(`Message ${R} not found`);const D={...O,...S};return await dr(w,D),D},t[16]=e,t[17]=c):c=t[17];let h;t[18]!==e||t[19]!==n?(h=_=>{const R=_.metadata?.thread_id||_.threadId;R&&n.invalidateQueries({queryKey:at.threadMessages(e,R)}),n.invalidateQueries({queryKey:at.messages(e)})},t[18]=e,t[19]=n,t[20]=h):h=t[20];let p;t[21]!==c||t[22]!==h?(p={mutationFn:c,onSuccess:h},t[21]=c,t[22]=h,t[23]=p):p=t[23];const g=on(p);let b;t[24]!==e?(b=async _=>{const R=`${e}:messages:${_}`;return await Hc(R),_},t[24]=e,t[25]=b):b=t[25];let x;t[26]!==e||t[27]!==n?(x=()=>{n.invalidateQueries({queryKey:at.messages(e)})},t[26]=e,t[27]=n,t[28]=x):x=t[28];let E;t[29]!==x||t[30]!==b?(E={mutationFn:b,onSuccess:x},t[29]=x,t[30]=b,t[31]=E):E=t[31];const k=on(E);let y;return t[32]!==k||t[33]!==a||t[34]!==d||t[35]!==g?(y={insert:a,insertMany:d,update:g,delete:k},t[32]=k,t[33]=a,t[34]=d,t[35]=g,t[36]=y):y=t[36],y}const Yc=()=>crypto.randomUUID(),qc=P.createContext(null);function ZE(t){const e=F.c(15),{children:n}=t,{locator:r}=vt(),i=Zc(),[s,a]=On(Or.threadManagerState(r)+":active-id",YE);let o;e[0]!==a||e[1]!==i?(o=g=>{const b=g?.id||crypto.randomUUID(),x=new Date().toISOString(),E={id:b,title:g?.title||"",created_at:g?.created_at||x,updated_at:g?.updated_at||x,hidden:g?.hidden??!1};return i.insert.mutate(E),a(b),E},e[0]=a,e[1]=i,e[2]=o):o=e[2];const u=o;let l;e[3]!==s||e[4]!==a||e[5]!==i?(l=g=>{i.update.mutate({id:g,updates:{hidden:!0,updated_at:new Date().toISOString()}}),s===g&&a(Yc())},e[3]=s,e[4]=a,e[5]=i,e[6]=l):l=e[6];const d=l;let c;e[7]!==s||e[8]!==u||e[9]!==d||e[10]!==a?(c={activeThreadId:s,createThread:u,setActiveThreadId:a,hideThread:d},e[7]=s,e[8]=u,e[9]=d,e[10]=a,e[11]=c):c=e[11];const h=c;let p;return e[12]!==n||e[13]!==h?(p=m.jsx(qc.Provider,{value:h,children:n}),e[12]=n,e[13]=h,e[14]=p):p=e[14],p}function YE(t){return t||Yc()}function Ea(){const t=P.useContext(qc);if(!t)throw new Error("useChat must be used within a ChatProvider");return t}function xa(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var mn=xa();function Vc(t){mn=t}var fr={exec:()=>null};function Ae(t,e=""){let n=typeof t=="string"?t:t.source;const r={replace:(i,s)=>{let a=typeof s=="string"?s:s.source;return a=a.replace(tt.caret,"$1"),n=n.replace(i,a),r},getRegex:()=>new RegExp(n,e)};return r}var tt={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:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},qE=/^(?:[ \t]*(?:\n|$))+/,VE=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,WE=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Pr=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,GE=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ta=/(?:[*+-]|\d{1,9}[.)])/,Wc=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Gc=Ae(Wc).replace(/bull/g,Ta).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(),KE=Ae(Wc).replace(/bull/g,Ta).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(),_a=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,QE=/^[^\n]+/,ya=/(?!\s*\])(?:\\.|[^\[\]\\])+/,XE=Ae(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ya).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),JE=Ae(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ta).getRegex(),Oi="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",ka=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,e2=Ae("^ {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",ka).replace("tag",Oi).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Kc=Ae(_a).replace("hr",Pr).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",Oi).getRegex(),t2=Ae(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Kc).getRegex(),Aa={blockquote:t2,code:VE,def:XE,fences:WE,heading:GE,hr:Pr,html:e2,lheading:Gc,list:JE,newline:qE,paragraph:Kc,table:fr,text:QE},Uo=Ae("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Pr).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",Oi).getRegex(),n2={...Aa,lheading:KE,table:Uo,paragraph:Ae(_a).replace("hr",Pr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Uo).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",Oi).getRegex()},r2={...Aa,html:Ae(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ka).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:fr,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ae(_a).replace("hr",Pr).replace("heading",` *#{1,6} *[^
|
|
40
|
-
]`).replace("lheading",Gc).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},i2=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,s2=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Qc=/^( {2,}|\\)\n(?!\s*$)/,a2=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Li=/[\p{P}\p{S}]/u,Sa=/[\s\p{P}\p{S}]/u,Xc=/[^\s\p{P}\p{S}]/u,o2=Ae(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Sa).getRegex(),Jc=/(?!~)[\p{P}\p{S}]/u,u2=/(?!~)[\s\p{P}\p{S}]/u,l2=/(?:[^\s\p{P}\p{S}]|~)/u,c2=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,ed=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,d2=Ae(ed,"u").replace(/punct/g,Li).getRegex(),f2=Ae(ed,"u").replace(/punct/g,Jc).getRegex(),td="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",h2=Ae(td,"gu").replace(/notPunctSpace/g,Xc).replace(/punctSpace/g,Sa).replace(/punct/g,Li).getRegex(),p2=Ae(td,"gu").replace(/notPunctSpace/g,l2).replace(/punctSpace/g,u2).replace(/punct/g,Jc).getRegex(),m2=Ae("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Xc).replace(/punctSpace/g,Sa).replace(/punct/g,Li).getRegex(),g2=Ae(/\\(punct)/,"gu").replace(/punct/g,Li).getRegex(),b2=Ae(/^<(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(),E2=Ae(ka).replace("(?:-->|$)","-->").getRegex(),x2=Ae("^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",E2).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),bi=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,T2=Ae(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",bi).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),nd=Ae(/^!?\[(label)\]\[(ref)\]/).replace("label",bi).replace("ref",ya).getRegex(),rd=Ae(/^!?\[(ref)\](?:\[\])?/).replace("ref",ya).getRegex(),_2=Ae("reflink|nolink(?!\\()","g").replace("reflink",nd).replace("nolink",rd).getRegex(),Ca={_backpedal:fr,anyPunctuation:g2,autolink:b2,blockSkip:c2,br:Qc,code:s2,del:fr,emStrongLDelim:d2,emStrongRDelimAst:h2,emStrongRDelimUnd:m2,escape:i2,link:T2,nolink:rd,punctuation:o2,reflink:nd,reflinkSearch:_2,tag:x2,text:a2,url:fr},y2={...Ca,link:Ae(/^!?\[(label)\]\((.*?)\)/).replace("label",bi).getRegex(),reflink:Ae(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",bi).getRegex()},Us={...Ca,emStrongRDelimAst:p2,emStrongLDelim:f2,url:Ae(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/},k2={...Us,br:Ae(Qc).replace("{2,}","*").getRegex(),text:Ae(Us.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},qr={normal:Aa,gfm:n2,pedantic:r2},Gn={normal:Ca,gfm:Us,breaks:k2,pedantic:y2},A2={"&":"&","<":"<",">":">",'"':""","'":"'"},Ho=t=>A2[t];function Ct(t,e){if(e){if(tt.escapeTest.test(t))return t.replace(tt.escapeReplace,Ho)}else if(tt.escapeTestNoEncode.test(t))return t.replace(tt.escapeReplaceNoEncode,Ho);return t}function $o(t){try{t=encodeURI(t).replace(tt.percentDecode,"%")}catch{return null}return t}function Zo(t,e){const n=t.replace(tt.findPipe,(s,a,o)=>{let u=!1,l=a;for(;--l>=0&&o[l]==="\\";)u=!u;return u?"|":" |"}),r=n.split(tt.splitPipe);let i=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(tt.slashPipe,"|");return r}function Kn(t,e,n){const r=t.length;if(r===0)return"";let i=0;for(;i<r&&t.charAt(r-i-1)===e;)i++;return t.slice(0,r-i)}function S2(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let r=0;r<t.length;r++)if(t[r]==="\\")r++;else if(t[r]===e[0])n++;else if(t[r]===e[1]&&(n--,n<0))return r;return n>0?-2:-1}function Yo(t,e,n,r,i){const s=e.href,a=e.title||null,o=t[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;const u={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:s,title:a,text:o,tokens:r.inlineTokens(o)};return r.state.inLink=!1,u}function C2(t,e,n){const r=t.match(n.other.indentCodeCompensation);if(r===null)return e;const i=r[1];return e.split(`
|
|
41
|
-
`).map(s=>{const a=s.match(n.other.beginningSpace);if(a===null)return s;const[o]=a;return o.length>=i.length?s.slice(i.length):s}).join(`
|
|
42
|
-
`)}var Ei=class{options;rules;lexer;constructor(t){this.options=t||mn}space(t){const e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){const e=this.rules.block.code.exec(t);if(e){const n=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Kn(n,`
|
|
43
|
-
`)}}}fences(t){const e=this.rules.block.fences.exec(t);if(e){const n=e[0],r=C2(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:r}}}heading(t){const e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){const r=Kn(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){const e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:Kn(e[0],`
|
|
44
|
-
`)}}blockquote(t){const e=this.rules.block.blockquote.exec(t);if(e){let n=Kn(e[0],`
|
|
45
|
-
`).split(`
|
|
46
|
-
`),r="",i="";const s=[];for(;n.length>0;){let a=!1;const o=[];let u;for(u=0;u<n.length;u++)if(this.rules.other.blockquoteStart.test(n[u]))o.push(n[u]),a=!0;else if(!a)o.push(n[u]);else break;n=n.slice(u);const l=o.join(`
|
|
47
|
-
`),d=l.replace(this.rules.other.blockquoteSetextReplace,`
|
|
48
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
|
|
49
|
-
${l}`:l,i=i?`${i}
|
|
50
|
-
${d}`:d;const c=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(d,s,!0),this.lexer.state.top=c,n.length===0)break;const h=s.at(-1);if(h?.type==="code")break;if(h?.type==="blockquote"){const p=h,g=p.raw+`
|
|
51
|
-
`+n.join(`
|
|
52
|
-
`),b=this.blockquote(g);s[s.length-1]=b,r=r.substring(0,r.length-p.raw.length)+b.raw,i=i.substring(0,i.length-p.text.length)+b.text;break}else if(h?.type==="list"){const p=h,g=p.raw+`
|
|
53
|
-
`+n.join(`
|
|
54
|
-
`),b=this.list(g);s[s.length-1]=b,r=r.substring(0,r.length-h.raw.length)+b.raw,i=i.substring(0,i.length-p.raw.length)+b.raw,n=g.substring(s.at(-1).raw.length).split(`
|
|
55
|
-
`);continue}}return{type:"blockquote",raw:r,tokens:s,text:i}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim();const r=n.length>1,i={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 s=this.rules.other.listItemRegex(n);let a=!1;for(;t;){let u=!1,l="",d="";if(!(e=s.exec(t))||this.rules.block.hr.test(t))break;l=e[0],t=t.substring(l.length);let c=e[2].split(`
|
|
56
|
-
`,1)[0].replace(this.rules.other.listReplaceTabs,E=>" ".repeat(3*E.length)),h=t.split(`
|
|
57
|
-
`,1)[0],p=!c.trim(),g=0;if(this.options.pedantic?(g=2,d=c.trimStart()):p?g=e[1].length+1:(g=e[2].search(this.rules.other.nonSpaceChar),g=g>4?1:g,d=c.slice(g),g+=e[1].length),p&&this.rules.other.blankLine.test(h)&&(l+=h+`
|
|
58
|
-
`,t=t.substring(h.length+1),u=!0),!u){const E=this.rules.other.nextBulletRegex(g),k=this.rules.other.hrRegex(g),y=this.rules.other.fencesBeginRegex(g),_=this.rules.other.headingBeginRegex(g),R=this.rules.other.htmlBeginRegex(g);for(;t;){const S=t.split(`
|
|
59
|
-
`,1)[0];let w;if(h=S,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),w=h):w=h.replace(this.rules.other.tabCharGlobal," "),y.test(h)||_.test(h)||R.test(h)||E.test(h)||k.test(h))break;if(w.search(this.rules.other.nonSpaceChar)>=g||!h.trim())d+=`
|
|
60
|
-
`+w.slice(g);else{if(p||c.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||y.test(c)||_.test(c)||k.test(c))break;d+=`
|
|
61
|
-
`+h}!p&&!h.trim()&&(p=!0),l+=S+`
|
|
62
|
-
`,t=t.substring(S.length+1),c=w.slice(g)}}i.loose||(a?i.loose=!0:this.rules.other.doubleBlankLine.test(l)&&(a=!0));let b=null,x;this.options.gfm&&(b=this.rules.other.listIsTask.exec(d),b&&(x=b[0]!=="[ ] ",d=d.replace(this.rules.other.listReplaceTask,""))),i.items.push({type:"list_item",raw:l,task:!!b,checked:x,loose:!1,text:d,tokens:[]}),i.raw+=l}const o=i.items.at(-1);if(o)o.raw=o.raw.trimEnd(),o.text=o.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let u=0;u<i.items.length;u++)if(this.lexer.state.top=!1,i.items[u].tokens=this.lexer.blockTokens(i.items[u].text,[]),!i.loose){const l=i.items[u].tokens.filter(c=>c.type==="space"),d=l.length>0&&l.some(c=>this.rules.other.anyLine.test(c.raw));i.loose=d}if(i.loose)for(let u=0;u<i.items.length;u++)i.items[u].loose=!0;return i}}html(t){const e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(t){const e=this.rules.block.def.exec(t);if(e){const n=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:e[0],href:r,title:i}}}table(t){const e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;const n=Zo(e[1]),r=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
63
|
-
`):[],s={type:"table",raw:e[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const a of r)this.rules.other.tableAlignRight.test(a)?s.align.push("right"):this.rules.other.tableAlignCenter.test(a)?s.align.push("center"):this.rules.other.tableAlignLeft.test(a)?s.align.push("left"):s.align.push(null);for(let a=0;a<n.length;a++)s.header.push({text:n[a],tokens:this.lexer.inline(n[a]),header:!0,align:s.align[a]});for(const a of i)s.rows.push(Zo(a,s.header.length).map((o,u)=>({text:o,tokens:this.lexer.inline(o),header:!1,align:s.align[u]})));return s}}lheading(t){const e=this.rules.block.lheading.exec(t);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(t){const e=this.rules.block.paragraph.exec(t);if(e){const n=e[1].charAt(e[1].length-1)===`
|
|
64
|
-
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){const e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){const e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){const e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){const e=this.rules.inline.link.exec(t);if(e){const n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;const s=Kn(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{const s=S2(e[2],"()");if(s===-2)return;if(s>-1){const o=(e[0].indexOf("!")===0?5:4)+e[1].length+s;e[2]=e[2].substring(0,s),e[0]=e[0].substring(0,o).trim(),e[3]=""}}let r=e[2],i="";if(this.options.pedantic){const s=this.rules.other.pedanticHrefTitle.exec(r);s&&(r=s[1],i=s[3])}else i=e[3]?e[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)),Yo(e,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){const r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=e[r.toLowerCase()];if(!i){const s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return Yo(n,i,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let r=this.rules.inline.emStrongLDelim.exec(t);if(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const s=[...r[0]].length-1;let a,o,u=s,l=0;const d=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,e=e.slice(-1*t.length+s);(r=d.exec(e))!=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]){u+=o;continue}else if((r[5]||r[6])&&s%3&&!((s+o)%3)){l+=o;continue}if(u-=o,u>0)continue;o=Math.min(o,o+u+l);const c=[...r[0]][0].length,h=t.slice(0,s+r.index+c+o);if(Math.min(s,o)%2){const g=h.slice(1,-1);return{type:"em",raw:h,text:g,tokens:this.lexer.inlineTokens(g)}}const p=h.slice(2,-2);return{type:"strong",raw:h,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(t){const e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," ");const r=this.rules.other.nonSpaceChar.test(n),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&i&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(t){const e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t){const e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(t){const e=this.rules.inline.autolink.exec(t);if(e){let n,r;return e[2]==="@"?(n=e[1],r="mailto:"+n):(n=e[1],r=n),{type:"link",raw:e[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let n,r;if(e[2]==="@")n=e[0],r="mailto:"+n;else{let i;do i=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(i!==e[0]);n=e[0],e[1]==="www."?r="http://"+e[0]:r=e[0]}return{type:"link",raw:e[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){const e=this.rules.inline.text.exec(t);if(e){const n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:n}}}},Bt=class Hs{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||mn,this.options.tokenizer=this.options.tokenizer||new Ei,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:tt,block:qr.normal,inline:Gn.normal};this.options.pedantic?(n.block=qr.pedantic,n.inline=Gn.pedantic):this.options.gfm&&(n.block=qr.gfm,this.options.breaks?n.inline=Gn.breaks:n.inline=Gn.gfm),this.tokenizer.rules=n}static get rules(){return{block:qr,inline:Gn}}static lex(e,n){return new Hs(n).lex(e)}static lexInline(e,n){return new Hs(n).inlineTokens(e)}lex(e){e=e.replace(tt.carriageReturn,`
|
|
65
|
-
`),this.blockTokens(e,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(e,n=[],r=!1){for(this.options.pedantic&&(e=e.replace(tt.tabCharGlobal," ").replace(tt.spaceLine,""));e;){let i;if(this.options.extensions?.block?.some(a=>(i=a.call({lexer:this},e,n))?(e=e.substring(i.raw.length),n.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);const a=n.at(-1);i.raw.length===1&&a!==void 0?a.raw+=`
|
|
66
|
-
`:n.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);const a=n.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=`
|
|
67
|
-
`+i.raw,a.text+=`
|
|
68
|
-
`+i.text,this.inlineQueue.at(-1).src=a.text):n.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);const a=n.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=`
|
|
69
|
-
`+i.raw,a.text+=`
|
|
70
|
-
`+i.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title});continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),n.push(i);continue}let s=e;if(this.options.extensions?.startBlock){let a=1/0;const o=e.slice(1);let u;this.options.extensions.startBlock.forEach(l=>{u=l.call({lexer:this},o),typeof u=="number"&&u>=0&&(a=Math.min(a,u))}),a<1/0&&a>=0&&(s=e.substring(0,a+1))}if(this.state.top&&(i=this.tokenizer.paragraph(s))){const a=n.at(-1);r&&a?.type==="paragraph"?(a.raw+=`
|
|
71
|
-
`+i.raw,a.text+=`
|
|
72
|
-
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(i),r=s.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);const a=n.at(-1);a?.type==="text"?(a.raw+=`
|
|
73
|
-
`+i.raw,a.text+=`
|
|
74
|
-
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(i);continue}if(e){const a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){let r=e,i=null;if(this.tokens.links){const o=Object.keys(this.tokens.links);if(o.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)o.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,i.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(i=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)r=r.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let s=!1,a="";for(;e;){s||(a=""),s=!1;let o;if(this.options.extensions?.inline?.some(l=>(o=l.call({lexer:this},e,n))?(e=e.substring(o.raw.length),n.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);const l=n.at(-1);o.type==="text"&&l?.type==="text"?(l.raw+=o.raw,l.text+=o.text):n.push(o);continue}if(o=this.tokenizer.emStrong(e,r,a)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.del(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),n.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),n.push(o);continue}let u=e;if(this.options.extensions?.startInline){let l=1/0;const d=e.slice(1);let c;this.options.extensions.startInline.forEach(h=>{c=h.call({lexer:this},d),typeof c=="number"&&c>=0&&(l=Math.min(l,c))}),l<1/0&&l>=0&&(u=e.substring(0,l+1))}if(o=this.tokenizer.inlineText(u)){e=e.substring(o.raw.length),o.raw.slice(-1)!=="_"&&(a=o.raw.slice(-1)),s=!0;const l=n.at(-1);l?.type==="text"?(l.raw+=o.raw,l.text+=o.text):n.push(o);continue}if(e){const l="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return n}},xi=class{options;parser;constructor(t){this.options=t||mn}space(t){return""}code({text:t,lang:e,escaped:n}){const r=(e||"").match(tt.notSpaceStart)?.[0],i=t.replace(tt.endingNewline,"")+`
|
|
75
|
-
`;return r?'<pre><code class="language-'+Ct(r)+'">'+(n?i:Ct(i,!0))+`</code></pre>
|
|
76
|
-
`:"<pre><code>"+(n?i:Ct(i,!0))+`</code></pre>
|
|
77
|
-
`}blockquote({tokens:t}){return`<blockquote>
|
|
78
|
-
${this.parser.parse(t)}</blockquote>
|
|
79
|
-
`}html({text:t}){return t}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
|
|
80
|
-
`}hr(t){return`<hr>
|
|
81
|
-
`}list(t){const e=t.ordered,n=t.start;let r="";for(let a=0;a<t.items.length;a++){const o=t.items[a];r+=this.listitem(o)}const i=e?"ol":"ul",s=e&&n!==1?' start="'+n+'"':"";return"<"+i+s+`>
|
|
82
|
-
`+r+"</"+i+`>
|
|
83
|
-
`}listitem(t){let e="";if(t.task){const n=this.checkbox({checked:!!t.checked});t.loose?t.tokens[0]?.type==="paragraph"?(t.tokens[0].text=n+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=n+" "+Ct(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:n+" ",text:n+" ",escaped:!0}):e+=n+" "}return e+=this.parser.parse(t.tokens,!!t.loose),`<li>${e}</li>
|
|
84
|
-
`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
|
|
85
|
-
`}table(t){let e="",n="";for(let i=0;i<t.header.length;i++)n+=this.tablecell(t.header[i]);e+=this.tablerow({text:n});let r="";for(let i=0;i<t.rows.length;i++){const s=t.rows[i];n="";for(let a=0;a<s.length;a++)n+=this.tablecell(s[a]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
|
|
86
|
-
<thead>
|
|
87
|
-
`+e+`</thead>
|
|
88
|
-
`+r+`</table>
|
|
89
|
-
`}tablerow({text:t}){return`<tr>
|
|
90
|
-
${t}</tr>
|
|
91
|
-
`}tablecell(t){const e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
|
|
92
|
-
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${Ct(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:n}){const r=this.parser.parseInline(n),i=$o(t);if(i===null)return r;t=i;let s='<a href="'+t+'"';return e&&(s+=' title="'+Ct(e)+'"'),s+=">"+r+"</a>",s}image({href:t,title:e,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));const i=$o(t);if(i===null)return Ct(n);t=i;let s=`<img src="${t}" alt="${n}"`;return e&&(s+=` title="${Ct(e)}"`),s+=">",s}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Ct(t.text)}},Ia=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},Ft=class $s{options;renderer;textRenderer;constructor(e){this.options=e||mn,this.options.renderer=this.options.renderer||new xi,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ia}static parse(e,n){return new $s(n).parse(e)}static parseInline(e,n){return new $s(n).parseInline(e)}parse(e,n=!0){let r="";for(let i=0;i<e.length;i++){const s=e[i];if(this.options.extensions?.renderers?.[s.type]){const o=s,u=this.options.extensions.renderers[o.type].call({parser:this},o);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(o.type)){r+=u||"";continue}}const a=s;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,u=this.renderer.text(o);for(;i+1<e.length&&e[i+1].type==="text";)o=e[++i],u+=`
|
|
93
|
-
`+this.renderer.text(o);n?r+=this.renderer.paragraph({type:"paragraph",raw:u,text:u,tokens:[{type:"text",raw:u,text:u,escaped:!0}]}):r+=u;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(e,n=this.renderer){let r="";for(let i=0;i<e.length;i++){const s=e[i];if(this.options.extensions?.renderers?.[s.type]){const o=this.options.extensions.renderers[s.type].call({parser:this},s);if(o!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){r+=o||"";continue}}const a=s;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}},si=class{options;block;constructor(t){this.options=t||mn}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}provideLexer(){return this.block?Bt.lex:Bt.lexInline}provideParser(){return this.block?Ft.parse:Ft.parseInline}},I2=class{defaults=xa();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Ft;Renderer=xi;TextRenderer=Ia;Lexer=Bt;Tokenizer=Ei;Hooks=si;constructor(...t){this.use(...t)}walkTokens(t,e){let n=[];for(const r of t)switch(n=n.concat(e.call(this,r)),r.type){case"table":{const i=r;for(const s of i.header)n=n.concat(this.walkTokens(s.tokens,e));for(const s of i.rows)for(const a of s)n=n.concat(this.walkTokens(a.tokens,e));break}case"list":{const i=r;n=n.concat(this.walkTokens(i.items,e));break}default:{const i=r;this.defaults.extensions?.childTokens?.[i.type]?this.defaults.extensions.childTokens[i.type].forEach(s=>{const a=i[s].flat(1/0);n=n.concat(this.walkTokens(a,e))}):i.tokens&&(n=n.concat(this.walkTokens(i.tokens,e)))}}return n}use(...t){const e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{const r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){const s=e.renderers[i.name];s?e.renderers[i.name]=function(...a){let o=i.renderer.apply(this,a);return o===!1&&(o=s.apply(this,a)),o}:e.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const s=e[i.level];s?s.unshift(i.tokenizer):e[i.level]=[i.tokenizer],i.start&&(i.level==="block"?e.startBlock?e.startBlock.push(i.start):e.startBlock=[i.start]:i.level==="inline"&&(e.startInline?e.startInline.push(i.start):e.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(e.childTokens[i.name]=i.childTokens)}),r.extensions=e),n.renderer){const i=this.defaults.renderer||new xi(this.defaults);for(const s in n.renderer){if(!(s in i))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;const a=s,o=n.renderer[a],u=i[a];i[a]=(...l)=>{let d=o.apply(i,l);return d===!1&&(d=u.apply(i,l)),d||""}}r.renderer=i}if(n.tokenizer){const i=this.defaults.tokenizer||new Ei(this.defaults);for(const s in n.tokenizer){if(!(s in i))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;const a=s,o=n.tokenizer[a],u=i[a];i[a]=(...l)=>{let d=o.apply(i,l);return d===!1&&(d=u.apply(i,l)),d}}r.tokenizer=i}if(n.hooks){const i=this.defaults.hooks||new si;for(const s in n.hooks){if(!(s in i))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;const a=s,o=n.hooks[a],u=i[a];si.passThroughHooks.has(s)?i[a]=l=>{if(this.defaults.async)return Promise.resolve(o.call(i,l)).then(c=>u.call(i,c));const d=o.call(i,l);return u.call(i,d)}:i[a]=(...l)=>{let d=o.apply(i,l);return d===!1&&(d=u.apply(i,l)),d}}r.hooks=i}if(n.walkTokens){const i=this.defaults.walkTokens,s=n.walkTokens;r.walkTokens=function(a){let o=[];return o.push(s.call(this,a)),i&&(o=o.concat(i.call(this,a))),o}}this.defaults={...this.defaults,...r}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return Bt.lex(t,e??this.defaults)}parser(t,e){return Ft.parse(t,e??this.defaults)}parseMarkdown(t){return(n,r)=>{const i={...r},s={...this.defaults,...i},a=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&i.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"));s.hooks&&(s.hooks.options=s,s.hooks.block=t);const o=s.hooks?s.hooks.provideLexer():t?Bt.lex:Bt.lexInline,u=s.hooks?s.hooks.provideParser():t?Ft.parse:Ft.parseInline;if(s.async)return Promise.resolve(s.hooks?s.hooks.preprocess(n):n).then(l=>o(l,s)).then(l=>s.hooks?s.hooks.processAllTokens(l):l).then(l=>s.walkTokens?Promise.all(this.walkTokens(l,s.walkTokens)).then(()=>l):l).then(l=>u(l,s)).then(l=>s.hooks?s.hooks.postprocess(l):l).catch(a);try{s.hooks&&(n=s.hooks.preprocess(n));let l=o(n,s);s.hooks&&(l=s.hooks.processAllTokens(l)),s.walkTokens&&this.walkTokens(l,s.walkTokens);let d=u(l,s);return s.hooks&&(d=s.hooks.postprocess(d)),d}catch(l){return a(l)}}}onError(t,e){return n=>{if(n.message+=`
|
|
94
|
-
Please report this to https://github.com/markedjs/marked.`,t){const r="<p>An error occurred:</p><pre>"+Ct(n.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(n);throw n}}},fn=new I2;function Se(t,e){return fn.parse(t,e)}Se.options=Se.setOptions=function(t){return fn.setOptions(t),Se.defaults=fn.defaults,Vc(Se.defaults),Se};Se.getDefaults=xa;Se.defaults=mn;Se.use=function(...t){return fn.use(...t),Se.defaults=fn.defaults,Vc(Se.defaults),Se};Se.walkTokens=function(t,e){return fn.walkTokens(t,e)};Se.parseInline=fn.parseInline;Se.Parser=Ft;Se.parser=Ft.parse;Se.Renderer=xi;Se.TextRenderer=Ia;Se.Lexer=Bt;Se.lexer=Bt.lex;Se.Tokenizer=Ei;Se.Hooks=si;Se.parse=Se;Se.options;Se.setOptions;Se.use;Se.walkTokens;Se.parseInline;Ft.parse;Bt.lex;function qo(t){const e=[],n=String(t||"");let r=n.indexOf(","),i=0,s=!1;for(;!s;){r===-1&&(r=n.length,s=!0);const a=n.slice(i,r).trim();(a||!s)&&e.push(a),i=r+1,r=n.indexOf(",",i)}return e}function id(t,e){const n={};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const N2=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,w2=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,v2={};function Vo(t,e){return(v2.jsx?w2:N2).test(t)}const R2=/[ \t\n\f\r]/g;function O2(t){return typeof t=="object"?t.type==="text"?Wo(t.value):!1:Wo(t)}function Wo(t){return t.replace(R2,"")===""}class Mr{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}}Mr.prototype.normal={};Mr.prototype.property={};Mr.prototype.space=void 0;function sd(t,e){const n={},r={};for(const i of t)Object.assign(n,i.property),Object.assign(r,i.normal);return new Mr(n,r,e)}function kr(t){return t.toLowerCase()}class lt{constructor(e,n){this.attribute=n,this.property=e}}lt.prototype.attribute="";lt.prototype.booleanish=!1;lt.prototype.boolean=!1;lt.prototype.commaOrSpaceSeparated=!1;lt.prototype.commaSeparated=!1;lt.prototype.defined=!1;lt.prototype.mustUseProperty=!1;lt.prototype.number=!1;lt.prototype.overloadedBoolean=!1;lt.prototype.property="";lt.prototype.spaceSeparated=!1;lt.prototype.space=void 0;let L2=0;const ue=gn(),He=gn(),Zs=gn(),q=gn(),we=gn(),vn=gn(),dt=gn();function gn(){return 2**++L2}const Ys=Object.freeze(Object.defineProperty({__proto__:null,boolean:ue,booleanish:He,commaOrSpaceSeparated:dt,commaSeparated:vn,number:q,overloadedBoolean:Zs,spaceSeparated:we},Symbol.toStringTag,{value:"Module"})),rs=Object.keys(Ys);class Na extends lt{constructor(e,n,r,i){let s=-1;if(super(e,n),Go(this,"space",i),typeof r=="number")for(;++s<rs.length;){const a=rs[s];Go(this,rs[s],(r&Ys[a])===Ys[a])}}}Na.prototype.defined=!0;function Go(t,e,n){n&&(t[e]=n)}function jn(t){const e={},n={};for(const[r,i]of Object.entries(t.properties)){const s=new Na(r,t.transform(t.attributes||{},r),i,t.space);t.mustUseProperty&&t.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),e[r]=s,n[kr(r)]=r,n[kr(s.attribute)]=r}return new Mr(e,n,t.space)}const ad=jn({properties:{ariaActiveDescendant:null,ariaAtomic:He,ariaAutoComplete:null,ariaBusy:He,ariaChecked:He,ariaColCount:q,ariaColIndex:q,ariaColSpan:q,ariaControls:we,ariaCurrent:null,ariaDescribedBy:we,ariaDetails:null,ariaDisabled:He,ariaDropEffect:we,ariaErrorMessage:null,ariaExpanded:He,ariaFlowTo:we,ariaGrabbed:He,ariaHasPopup:null,ariaHidden:He,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:we,ariaLevel:q,ariaLive:null,ariaModal:He,ariaMultiLine:He,ariaMultiSelectable:He,ariaOrientation:null,ariaOwns:we,ariaPlaceholder:null,ariaPosInSet:q,ariaPressed:He,ariaReadOnly:He,ariaRelevant:null,ariaRequired:He,ariaRoleDescription:we,ariaRowCount:q,ariaRowIndex:q,ariaRowSpan:q,ariaSelected:He,ariaSetSize:q,ariaSort:null,ariaValueMax:q,ariaValueMin:q,ariaValueNow:q,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function od(t,e){return e in t?t[e]:e}function ud(t,e){return od(t,e.toLowerCase())}const D2=jn({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:vn,acceptCharset:we,accessKey:we,action:null,allow:null,allowFullScreen:ue,allowPaymentRequest:ue,allowUserMedia:ue,alt:null,as:null,async:ue,autoCapitalize:null,autoComplete:we,autoFocus:ue,autoPlay:ue,blocking:we,capture:null,charSet:null,checked:ue,cite:null,className:we,cols:q,colSpan:null,content:null,contentEditable:He,controls:ue,controlsList:we,coords:q|vn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ue,defer:ue,dir:null,dirName:null,disabled:ue,download:Zs,draggable:He,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ue,formTarget:null,headers:we,height:q,hidden:Zs,high:q,href:null,hrefLang:null,htmlFor:we,httpEquiv:we,id:null,imageSizes:null,imageSrcSet:null,inert:ue,inputMode:null,integrity:null,is:null,isMap:ue,itemId:null,itemProp:we,itemRef:we,itemScope:ue,itemType:we,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ue,low:q,manifest:null,max:null,maxLength:q,media:null,method:null,min:null,minLength:q,multiple:ue,muted:ue,name:null,nonce:null,noModule:ue,noValidate:ue,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ue,optimum:q,pattern:null,ping:we,placeholder:null,playsInline:ue,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ue,referrerPolicy:null,rel:we,required:ue,reversed:ue,rows:q,rowSpan:q,sandbox:we,scope:null,scoped:ue,seamless:ue,selected:ue,shadowRootClonable:ue,shadowRootDelegatesFocus:ue,shadowRootMode:null,shape:null,size:q,sizes:null,slot:null,span:q,spellCheck:He,src:null,srcDoc:null,srcLang:null,srcSet:null,start:q,step:null,style:null,tabIndex:q,target:null,title:null,translate:null,type:null,typeMustMatch:ue,useMap:null,value:He,width:q,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:we,axis:null,background:null,bgColor:null,border:q,borderColor:null,bottomMargin:q,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ue,declare:ue,event:null,face:null,frame:null,frameBorder:null,hSpace:q,leftMargin:q,link:null,longDesc:null,lowSrc:null,marginHeight:q,marginWidth:q,noResize:ue,noHref:ue,noShade:ue,noWrap:ue,object:null,profile:null,prompt:null,rev:null,rightMargin:q,rules:null,scheme:null,scrolling:He,standby:null,summary:null,text:null,topMargin:q,valueType:null,version:null,vAlign:null,vLink:null,vSpace:q,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ue,disableRemotePlayback:ue,prefix:null,property:null,results:q,security:null,unselectable:null},space:"html",transform:ud}),P2=jn({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:dt,accentHeight:q,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:q,amplitude:q,arabicForm:null,ascent:q,attributeName:null,attributeType:null,azimuth:q,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:q,by:null,calcMode:null,capHeight:q,className:we,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:q,diffuseConstant:q,direction:null,display:null,dur:null,divisor:q,dominantBaseline:null,download:ue,dx:null,dy:null,edgeMode:null,editable:null,elevation:q,enableBackground:null,end:null,event:null,exponent:q,externalResourcesRequired:null,fill:null,fillOpacity:q,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:vn,g2:vn,glyphName:vn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:q,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:q,horizOriginX:q,horizOriginY:q,id:null,ideographic:q,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:q,k:q,k1:q,k2:q,k3:q,k4:q,kernelMatrix:dt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:q,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:q,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:q,overlineThickness:q,paintOrder:null,panose1:null,path:null,pathLength:q,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:we,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:q,pointsAtY:q,pointsAtZ:q,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:dt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:dt,rev:dt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:dt,requiredFeatures:dt,requiredFonts:dt,requiredFormats:dt,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:q,specularExponent:q,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:q,strikethroughThickness:q,string:null,stroke:null,strokeDashArray:dt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:q,strokeOpacity:q,strokeWidth:null,style:null,surfaceScale:q,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:dt,tabIndex:q,tableValues:null,target:null,targetX:q,targetY:q,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:dt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:q,underlineThickness:q,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:q,values:null,vAlphabetic:q,vMathematical:q,vectorEffect:null,vHanging:q,vIdeographic:q,version:null,vertAdvY:q,vertOriginX:q,vertOriginY:q,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:q,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:od}),ld=jn({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),cd=jn({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:ud}),dd=jn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),M2={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},B2=/[A-Z]/g,Ko=/-[a-z]/g,F2=/^data[-\w.:]+$/i;function Di(t,e){const n=kr(e);let r=e,i=lt;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&F2.test(e)){if(e.charAt(4)==="-"){const s=e.slice(5).replace(Ko,j2);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=e.slice(4);if(!Ko.test(s)){let a=s.replace(B2,z2);a.charAt(0)!=="-"&&(a="-"+a),e="data"+a}}i=Na}return new i(r,e)}function z2(t){return"-"+t.toLowerCase()}function j2(t){return t.charAt(1).toUpperCase()}const Br=sd([ad,D2,ld,cd,dd],"html"),Wt=sd([ad,P2,ld,cd,dd],"svg");function Qo(t){const e=String(t||"").trim();return e?e.split(/[ \t\n\r\f]+/g):[]}function fd(t){return t.join(" ").trim()}var _n={},is,Xo;function U2(){if(Xo)return is;Xo=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,o=/^\s+|\s+$/g,u=`
|
|
95
|
-
`,l="/",d="*",c="",h="comment",p="declaration";function g(x,E){if(typeof x!="string")throw new TypeError("First argument must be a string");if(!x)return[];E=E||{};var k=1,y=1;function _(Y){var H=Y.match(e);H&&(k+=H.length);var K=Y.lastIndexOf(u);y=~K?Y.length-K:y+Y.length}function R(){var Y={line:k,column:y};return function(H){return H.position=new S(Y),D(),H}}function S(Y){this.start=Y,this.end={line:k,column:y},this.source=E.source}S.prototype.content=x;function w(Y){var H=new Error(E.source+":"+k+":"+y+": "+Y);if(H.reason=Y,H.filename=E.source,H.line=k,H.column=y,H.source=x,!E.silent)throw H}function O(Y){var H=Y.exec(x);if(H){var K=H[0];return _(K),x=x.slice(K.length),H}}function D(){O(n)}function v(Y){var H;for(Y=Y||[];H=B();)H!==!1&&Y.push(H);return Y}function B(){var Y=R();if(!(l!=x.charAt(0)||d!=x.charAt(1))){for(var H=2;c!=x.charAt(H)&&(d!=x.charAt(H)||l!=x.charAt(H+1));)++H;if(H+=2,c===x.charAt(H-1))return w("End of comment missing");var K=x.slice(2,H-2);return y+=2,_(K),x=x.slice(H),y+=2,Y({type:h,comment:K})}}function j(){var Y=R(),H=O(r);if(H){if(B(),!O(i))return w("property missing ':'");var K=O(s),se=Y({type:p,property:b(H[0].replace(t,c)),value:K?b(K[0].replace(t,c)):c});return O(a),se}}function G(){var Y=[];v(Y);for(var H;H=j();)H!==!1&&(Y.push(H),v(Y));return Y}return D(),G()}function b(x){return x?x.replace(o,c):c}return is=g,is}var Jo;function H2(){if(Jo)return _n;Jo=1;var t=_n&&_n.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(_n,"__esModule",{value:!0}),_n.default=n;const e=t(U2());function n(r,i){let s=null;if(!r||typeof r!="string")return s;const a=(0,e.default)(r),o=typeof i=="function";return a.forEach(u=>{if(u.type!=="declaration")return;const{property:l,value:d}=u;o?i(l,d,u):d&&(s=s||{},s[l]=d)}),s}return _n}var Qn={},eu;function $2(){if(eu)return Qn;eu=1,Object.defineProperty(Qn,"__esModule",{value:!0}),Qn.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,s=function(l){return!l||n.test(l)||t.test(l)},a=function(l,d){return d.toUpperCase()},o=function(l,d){return"".concat(d,"-")},u=function(l,d){return d===void 0&&(d={}),s(l)?l:(l=l.toLowerCase(),d.reactCompat?l=l.replace(i,o):l=l.replace(r,o),l.replace(e,a))};return Qn.camelCase=u,Qn}var Xn,tu;function Z2(){if(tu)return Xn;tu=1;var t=Xn&&Xn.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},e=t(H2()),n=$2();function r(i,s){var a={};return!i||typeof i!="string"||(0,e.default)(i,function(o,u){o&&u&&(a[(0,n.camelCase)(o,s)]=u)}),a}return r.default=r,Xn=r,Xn}var Y2=Z2();const q2=ca(Y2),Pi=hd("end"),Rt=hd("start");function hd(t){return e;function e(n){const r=n&&n.position&&n.position[t]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function V2(t){const e=Rt(t),n=Pi(t);if(e&&n)return{start:e,end:n}}function hr(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?nu(t.position):"start"in t||"end"in t?nu(t):"line"in t||"column"in t?qs(t):""}function qs(t){return ru(t&&t.line)+":"+ru(t&&t.column)}function nu(t){return qs(t&&t.start)+"-"+qs(t&&t.end)}function ru(t){return t&&typeof t=="number"?t:1}class Qe extends Error{constructor(e,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},a=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof e=="string"?i=e:!s.cause&&e&&(a=!0,i=e.message,s.cause=e),!s.ruleId&&!s.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?s.ruleId=r:(s.source=r.slice(0,u),s.ruleId=r.slice(u+1))}if(!s.place&&s.ancestors&&s.ancestors){const u=s.ancestors[s.ancestors.length-1];u&&(s.place=u.position)}const o=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=o?o.line:void 0,this.name=hr(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=a&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Qe.prototype.file="";Qe.prototype.name="";Qe.prototype.reason="";Qe.prototype.message="";Qe.prototype.stack="";Qe.prototype.column=void 0;Qe.prototype.line=void 0;Qe.prototype.ancestors=void 0;Qe.prototype.cause=void 0;Qe.prototype.fatal=void 0;Qe.prototype.place=void 0;Qe.prototype.ruleId=void 0;Qe.prototype.source=void 0;const wa={}.hasOwnProperty,W2=new Map,G2=/[A-Z]/g,K2=new Set(["table","tbody","thead","tfoot","tr"]),Q2=new Set(["td","th"]),pd="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function X2(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=e.filePath||void 0;let r;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=ax(n,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=sx(n,e.jsx,e.jsxs)}const i={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:r,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?Wt:Br,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},s=md(i,t,void 0);return s&&typeof s!="string"?s:i.create(t,i.Fragment,{children:s||void 0},void 0)}function md(t,e,n){if(e.type==="element")return J2(t,e,n);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return ex(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return nx(t,e,n);if(e.type==="mdxjsEsm")return tx(t,e);if(e.type==="root")return rx(t,e,n);if(e.type==="text")return ix(t,e)}function J2(t,e,n){const r=t.schema;let i=r;e.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Wt,t.schema=i),t.ancestors.push(e);const s=bd(t,e.tagName,!1),a=ox(t,e);let o=Ra(t,e);return K2.has(e.tagName)&&(o=o.filter(function(u){return typeof u=="string"?!O2(u):!0})),gd(t,a,s,e),va(a,o),t.ancestors.pop(),t.schema=r,t.create(e,s,a,n)}function ex(t,e){if(e.data&&e.data.estree&&t.evaluater){const r=e.data.estree.body[0];return r.type,t.evaluater.evaluateExpression(r.expression)}Ar(t,e.position)}function tx(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);Ar(t,e.position)}function nx(t,e,n){const r=t.schema;let i=r;e.name==="svg"&&r.space==="html"&&(i=Wt,t.schema=i),t.ancestors.push(e);const s=e.name===null?t.Fragment:bd(t,e.name,!0),a=ux(t,e),o=Ra(t,e);return gd(t,a,s,e),va(a,o),t.ancestors.pop(),t.schema=r,t.create(e,s,a,n)}function rx(t,e,n){const r={};return va(r,Ra(t,e)),t.create(e,t.Fragment,r,n)}function ix(t,e){return e.value}function gd(t,e,n,r){typeof n!="string"&&n!==t.Fragment&&t.passNode&&(e.node=r)}function va(t,e){if(e.length>0){const n=e.length>1?e:e[0];n&&(t.children=n)}}function sx(t,e,n){return r;function r(i,s,a,o){const l=Array.isArray(a.children)?n:e;return o?l(s,a,o):l(s,a)}}function ax(t,e){return n;function n(r,i,s,a){const o=Array.isArray(s.children),u=Rt(r);return e(i,s,a,o,{columnNumber:u?u.column-1:void 0,fileName:t,lineNumber:u?u.line:void 0},void 0)}}function ox(t,e){const n={};let r,i;for(i in e.properties)if(i!=="children"&&wa.call(e.properties,i)){const s=lx(t,i,e.properties[i]);if(s){const[a,o]=s;t.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&Q2.has(e.tagName)?r=o:n[a]=o}}if(r){const s=n.style||(n.style={});s[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function ux(t,e){const n={};for(const r of e.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&t.evaluater){const s=r.data.estree.body[0];s.type;const a=s.expression;a.type;const o=a.properties[0];o.type,Object.assign(n,t.evaluater.evaluateExpression(o.argument))}else Ar(t,e.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&t.evaluater){const o=r.value.data.estree.body[0];o.type,s=t.evaluater.evaluateExpression(o.expression)}else Ar(t,e.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function Ra(t,e){const n=[];let r=-1;const i=t.passKeys?new Map:W2;for(;++r<e.children.length;){const s=e.children[r];let a;if(t.passKeys){const u=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(u){const l=i.get(u)||0;a=u+"-"+l,i.set(u,l+1)}}const o=md(t,s,a);o!==void 0&&n.push(o)}return n}function lx(t,e,n){const r=Di(t.schema,e);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?id(n):fd(n)),r.property==="style"){let i=typeof n=="object"?n:cx(t,String(n));return t.stylePropertyNameCase==="css"&&(i=dx(i)),["style",i]}return[t.elementAttributeNameCase==="react"&&r.space?M2[r.property]||r.property:r.attribute,n]}}function cx(t,e){try{return q2(e,{reactCompat:!0})}catch(n){if(t.ignoreInvalidStyle)return{};const r=n,i=new Qe("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=t.filePath||void 0,i.url=pd+"#cannot-parse-style-attribute",i}}function bd(t,e,n){let r;if(!n)r={type:"Literal",value:e};else if(e.includes(".")){const i=e.split(".");let s=-1,a;for(;++s<i.length;){const o=Vo(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};a=a?{type:"MemberExpression",object:a,property:o,computed:!!(s&&o.type==="Literal"),optional:!1}:o}r=a}else r=Vo(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(r.type==="Literal"){const i=r.value;return wa.call(t.components,i)?t.components[i]:i}if(t.evaluater)return t.evaluater.evaluateExpression(r);Ar(t)}function Ar(t,e){const n=new Qe("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=t.filePath||void 0,n.url=pd+"#cannot-handle-mdx-estrees-without-createevaluater",n}function dx(t){const e={};let n;for(n in t)wa.call(t,n)&&(e[fx(n)]=t[n]);return e}function fx(t){let e=t.replace(G2,hx);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function hx(t){return"-"+t.toLowerCase()}const ss={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},px={};function Oa(t,e){const n=px,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Ed(t,r,i)}function Ed(t,e,n){if(mx(t)){if("value"in t)return t.type==="html"&&!n?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return iu(t.children,e,n)}return Array.isArray(t)?iu(t,e,n):""}function iu(t,e,n){const r=[];let i=-1;for(;++i<t.length;)r[i]=Ed(t[i],e,n);return r.join("")}function mx(t){return!!(t&&typeof t=="object")}const su=document.createElement("i");function La(t){const e="&"+t+";";su.innerHTML=e;const n=su.textContent;return n.charCodeAt(n.length-1)===59&&t!=="semi"||n===e?!1:n}function ht(t,e,n,r){const i=t.length;let s=0,a;if(e<0?e=-e>i?0:i+e:e=e>i?i:e,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(e,n),t.splice(...a);else for(n&&t.splice(e,n);s<r.length;)a=r.slice(s,s+1e4),a.unshift(e,0),t.splice(...a),s+=1e4,e+=1e4}function gt(t,e){return t.length>0?(ht(t,t.length,0,e),t):e}const au={}.hasOwnProperty;function xd(t){const e={};let n=-1;for(;++n<t.length;)gx(e,t[n]);return e}function gx(t,e){let n;for(n in e){const i=(au.call(t,n)?t[n]:void 0)||(t[n]={}),s=e[n];let a;if(s)for(a in s){au.call(i,a)||(i[a]=[]);const o=s[a];bx(i[a],Array.isArray(o)?o:o?[o]:[])}}}function bx(t,e){let n=-1;const r=[];for(;++n<e.length;)(e[n].add==="after"?t:r).push(e[n]);ht(t,0,0,r)}function Td(t,e){const n=Number.parseInt(t,e);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function yt(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const et=Gt(/[A-Za-z]/),Ke=Gt(/[\dA-Za-z]/),Ex=Gt(/[#-'*+\--9=?A-Z^-~]/);function Ti(t){return t!==null&&(t<32||t===127)}const Vs=Gt(/\d/),xx=Gt(/[\dA-Fa-f]/),Tx=Gt(/[!-/:-@[-`{-~]/);function ie(t){return t!==null&&t<-2}function Ne(t){return t!==null&&(t<0||t===32)}function be(t){return t===-2||t===-1||t===32}const Mi=Gt(new RegExp("\\p{P}|\\p{S}","u")),hn=Gt(/\s/);function Gt(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function Un(t){const e=[];let n=-1,r=0,i=0;for(;++n<t.length;){const s=t.charCodeAt(n);let a="";if(s===37&&Ke(t.charCodeAt(n+1))&&Ke(t.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(a=String.fromCharCode(s));else if(s>55295&&s<57344){const o=t.charCodeAt(n+1);s<56320&&o>56319&&o<57344?(a=String.fromCharCode(s,o),i=1):a="�"}else a=String.fromCharCode(s);a&&(e.push(t.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return e.join("")+t.slice(r)}function _e(t,e,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return a;function a(u){return be(u)?(t.enter(n),o(u)):e(u)}function o(u){return be(u)&&s++<i?(t.consume(u),o):(t.exit(n),e(u))}}const _x={tokenize:yx};function yx(t){const e=t.attempt(this.parser.constructs.contentInitial,r,i);let n;return e;function r(o){if(o===null){t.consume(o);return}return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),_e(t,e,"linePrefix")}function i(o){return t.enter("paragraph"),s(o)}function s(o){const u=t.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,a(o)}function a(o){if(o===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(o);return}return ie(o)?(t.consume(o),t.exit("chunkText"),s):(t.consume(o),a)}}const kx={tokenize:Ax},ou={tokenize:Sx};function Ax(t){const e=this,n=[];let r=0,i,s,a;return o;function o(y){if(r<n.length){const _=n[r];return e.containerState=_[1],t.attempt(_[0].continuation,u,l)(y)}return l(y)}function u(y){if(r++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,i&&k();const _=e.events.length;let R=_,S;for(;R--;)if(e.events[R][0]==="exit"&&e.events[R][1].type==="chunkFlow"){S=e.events[R][1].end;break}E(r);let w=_;for(;w<e.events.length;)e.events[w][1].end={...S},w++;return ht(e.events,R+1,0,e.events.slice(_)),e.events.length=w,l(y)}return o(y)}function l(y){if(r===n.length){if(!i)return h(y);if(i.currentConstruct&&i.currentConstruct.concrete)return g(y);e.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(ou,d,c)(y)}function d(y){return i&&k(),E(r),h(y)}function c(y){return e.parser.lazy[e.now().line]=r!==n.length,a=e.now().offset,g(y)}function h(y){return e.containerState={},t.attempt(ou,p,g)(y)}function p(y){return r++,n.push([e.currentConstruct,e.containerState]),h(y)}function g(y){if(y===null){i&&k(),E(0),t.consume(y);return}return i=i||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),b(y)}function b(y){if(y===null){x(t.exit("chunkFlow"),!0),E(0),t.consume(y);return}return ie(y)?(t.consume(y),x(t.exit("chunkFlow")),r=0,e.interrupt=void 0,o):(t.consume(y),b)}function x(y,_){const R=e.sliceStream(y);if(_&&R.push(null),y.previous=s,s&&(s.next=y),s=y,i.defineSkip(y.start),i.write(R),e.parser.lazy[y.start.line]){let S=i.events.length;for(;S--;)if(i.events[S][1].start.offset<a&&(!i.events[S][1].end||i.events[S][1].end.offset>a))return;const w=e.events.length;let O=w,D,v;for(;O--;)if(e.events[O][0]==="exit"&&e.events[O][1].type==="chunkFlow"){if(D){v=e.events[O][1].end;break}D=!0}for(E(r),S=w;S<e.events.length;)e.events[S][1].end={...v},S++;ht(e.events,O+1,0,e.events.slice(w)),e.events.length=S}}function E(y){let _=n.length;for(;_-- >y;){const R=n[_];e.containerState=R[1],R[0].exit.call(e,t)}n.length=y}function k(){i.write([null]),s=void 0,i=void 0,e.containerState._closeFlow=void 0}}function Sx(t,e,n){return _e(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ln(t){if(t===null||Ne(t)||hn(t))return 1;if(Mi(t))return 2}function Bi(t,e,n){const r=[];let i=-1;for(;++i<t.length;){const s=t[i].resolveAll;s&&!r.includes(s)&&(e=s(e,n),r.push(s))}return e}const Ws={name:"attention",resolveAll:Cx,tokenize:Ix};function Cx(t,e){let n=-1,r,i,s,a,o,u,l,d;for(;++n<t.length;)if(t[n][0]==="enter"&&t[n][1].type==="attentionSequence"&&t[n][1]._close){for(r=n;r--;)if(t[r][0]==="exit"&&t[r][1].type==="attentionSequence"&&t[r][1]._open&&e.sliceSerialize(t[r][1]).charCodeAt(0)===e.sliceSerialize(t[n][1]).charCodeAt(0)){if((t[r][1]._close||t[n][1]._open)&&(t[n][1].end.offset-t[n][1].start.offset)%3&&!((t[r][1].end.offset-t[r][1].start.offset+t[n][1].end.offset-t[n][1].start.offset)%3))continue;u=t[r][1].end.offset-t[r][1].start.offset>1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const c={...t[r][1].end},h={...t[n][1].start};uu(c,-u),uu(h,u),a={type:u>1?"strongSequence":"emphasisSequence",start:c,end:{...t[r][1].end}},o={type:u>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:h},s={type:u>1?"strongText":"emphasisText",start:{...t[r][1].end},end:{...t[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...a.start},end:{...o.end}},t[r][1].end={...a.start},t[n][1].start={...o.end},l=[],t[r][1].end.offset-t[r][1].start.offset&&(l=gt(l,[["enter",t[r][1],e],["exit",t[r][1],e]])),l=gt(l,[["enter",i,e],["enter",a,e],["exit",a,e],["enter",s,e]]),l=gt(l,Bi(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),l=gt(l,[["exit",s,e],["enter",o,e],["exit",o,e],["exit",i,e]]),t[n][1].end.offset-t[n][1].start.offset?(d=2,l=gt(l,[["enter",t[n][1],e],["exit",t[n][1],e]])):d=0,ht(t,r-1,n-r+3,l),n=r+l.length-d-2;break}}for(n=-1;++n<t.length;)t[n][1].type==="attentionSequence"&&(t[n][1].type="data");return t}function Ix(t,e){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Ln(r);let s;return a;function a(u){return s=u,t.enter("attentionSequence"),o(u)}function o(u){if(u===s)return t.consume(u),o;const l=t.exit("attentionSequence"),d=Ln(u),c=!d||d===2&&i||n.includes(u),h=!i||i===2&&d||n.includes(r);return l._open=!!(s===42?c:c&&(i||!h)),l._close=!!(s===42?h:h&&(d||!c)),e(u)}}function uu(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const Nx={name:"autolink",tokenize:wx};function wx(t,e,n){let r=0;return i;function i(p){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(p),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),s}function s(p){return et(p)?(t.consume(p),a):p===64?n(p):l(p)}function a(p){return p===43||p===45||p===46||Ke(p)?(r=1,o(p)):l(p)}function o(p){return p===58?(t.consume(p),r=0,u):(p===43||p===45||p===46||Ke(p))&&r++<32?(t.consume(p),o):(r=0,l(p))}function u(p){return p===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(p),t.exit("autolinkMarker"),t.exit("autolink"),e):p===null||p===32||p===60||Ti(p)?n(p):(t.consume(p),u)}function l(p){return p===64?(t.consume(p),d):Ex(p)?(t.consume(p),l):n(p)}function d(p){return Ke(p)?c(p):n(p)}function c(p){return p===46?(t.consume(p),r=0,d):p===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(p),t.exit("autolinkMarker"),t.exit("autolink"),e):h(p)}function h(p){if((p===45||Ke(p))&&r++<63){const g=p===45?h:c;return t.consume(p),g}return n(p)}}const Fr={partial:!0,tokenize:vx};function vx(t,e,n){return r;function r(s){return be(s)?_e(t,i,"linePrefix")(s):i(s)}function i(s){return s===null||ie(s)?e(s):n(s)}}const _d={continuation:{tokenize:Ox},exit:Lx,name:"blockQuote",tokenize:Rx};function Rx(t,e,n){const r=this;return i;function i(a){if(a===62){const o=r.containerState;return o.open||(t.enter("blockQuote",{_container:!0}),o.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(a),t.exit("blockQuoteMarker"),s}return n(a)}function s(a){return be(a)?(t.enter("blockQuotePrefixWhitespace"),t.consume(a),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(a))}}function Ox(t,e,n){const r=this;return i;function i(a){return be(a)?_e(t,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):s(a)}function s(a){return t.attempt(_d,e,n)(a)}}function Lx(t){t.exit("blockQuote")}const yd={name:"characterEscape",tokenize:Dx};function Dx(t,e,n){return r;function r(s){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(s),t.exit("escapeMarker"),i}function i(s){return Tx(s)?(t.enter("characterEscapeValue"),t.consume(s),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):n(s)}}const kd={name:"characterReference",tokenize:Px};function Px(t,e,n){const r=this;let i=0,s,a;return o;function o(c){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(c),t.exit("characterReferenceMarker"),u}function u(c){return c===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(c),t.exit("characterReferenceMarkerNumeric"),l):(t.enter("characterReferenceValue"),s=31,a=Ke,d(c))}function l(c){return c===88||c===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(c),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),s=6,a=xx,d):(t.enter("characterReferenceValue"),s=7,a=Vs,d(c))}function d(c){if(c===59&&i){const h=t.exit("characterReferenceValue");return a===Ke&&!La(r.sliceSerialize(h))?n(c):(t.enter("characterReferenceMarker"),t.consume(c),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return a(c)&&i++<s?(t.consume(c),d):n(c)}}const lu={partial:!0,tokenize:Bx},cu={concrete:!0,name:"codeFenced",tokenize:Mx};function Mx(t,e,n){const r=this,i={partial:!0,tokenize:R};let s=0,a=0,o;return u;function u(S){return l(S)}function l(S){const w=r.events[r.events.length-1];return s=w&&w[1].type==="linePrefix"?w[2].sliceSerialize(w[1],!0).length:0,o=S,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),d(S)}function d(S){return S===o?(a++,t.consume(S),d):a<3?n(S):(t.exit("codeFencedFenceSequence"),be(S)?_e(t,c,"whitespace")(S):c(S))}function c(S){return S===null||ie(S)?(t.exit("codeFencedFence"),r.interrupt?e(S):t.check(lu,b,_)(S)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),h(S))}function h(S){return S===null||ie(S)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),c(S)):be(S)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),_e(t,p,"whitespace")(S)):S===96&&S===o?n(S):(t.consume(S),h)}function p(S){return S===null||ie(S)?c(S):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),g(S))}function g(S){return S===null||ie(S)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),c(S)):S===96&&S===o?n(S):(t.consume(S),g)}function b(S){return t.attempt(i,_,x)(S)}function x(S){return t.enter("lineEnding"),t.consume(S),t.exit("lineEnding"),E}function E(S){return s>0&&be(S)?_e(t,k,"linePrefix",s+1)(S):k(S)}function k(S){return S===null||ie(S)?t.check(lu,b,_)(S):(t.enter("codeFlowValue"),y(S))}function y(S){return S===null||ie(S)?(t.exit("codeFlowValue"),k(S)):(t.consume(S),y)}function _(S){return t.exit("codeFenced"),e(S)}function R(S,w,O){let D=0;return v;function v(H){return S.enter("lineEnding"),S.consume(H),S.exit("lineEnding"),B}function B(H){return S.enter("codeFencedFence"),be(H)?_e(S,j,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H):j(H)}function j(H){return H===o?(S.enter("codeFencedFenceSequence"),G(H)):O(H)}function G(H){return H===o?(D++,S.consume(H),G):D>=a?(S.exit("codeFencedFenceSequence"),be(H)?_e(S,Y,"whitespace")(H):Y(H)):O(H)}function Y(H){return H===null||ie(H)?(S.exit("codeFencedFence"),w(H)):O(H)}}}function Bx(t,e,n){const r=this;return i;function i(a){return a===null?n(a):(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),s)}function s(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}const as={name:"codeIndented",tokenize:zx},Fx={partial:!0,tokenize:jx};function zx(t,e,n){const r=this;return i;function i(l){return t.enter("codeIndented"),_e(t,s,"linePrefix",5)(l)}function s(l){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?a(l):n(l)}function a(l){return l===null?u(l):ie(l)?t.attempt(Fx,a,u)(l):(t.enter("codeFlowValue"),o(l))}function o(l){return l===null||ie(l)?(t.exit("codeFlowValue"),a(l)):(t.consume(l),o)}function u(l){return t.exit("codeIndented"),e(l)}}function jx(t,e,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):ie(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),i):_e(t,s,"linePrefix",5)(a)}function s(a){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?e(a):ie(a)?i(a):n(a)}}const Ux={name:"codeText",previous:$x,resolve:Hx,tokenize:Zx};function Hx(t){let e=t.length-4,n=3,r,i;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r<e;)if(t[r][1].type==="codeTextData"){t[n][1].type="codeTextPadding",t[e][1].type="codeTextPadding",n+=2,e-=2;break}}for(r=n-1,e++;++r<=e;)i===void 0?r!==e&&t[r][1].type!=="lineEnding"&&(i=r):(r===e||t[r][1].type==="lineEnding")&&(t[i][1].type="codeTextData",r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),e-=r-i-2,r=i+2),i=void 0);return t}function $x(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Zx(t,e,n){let r=0,i,s;return a;function a(c){return t.enter("codeText"),t.enter("codeTextSequence"),o(c)}function o(c){return c===96?(t.consume(c),r++,o):(t.exit("codeTextSequence"),u(c))}function u(c){return c===null?n(c):c===32?(t.enter("space"),t.consume(c),t.exit("space"),u):c===96?(s=t.enter("codeTextSequence"),i=0,d(c)):ie(c)?(t.enter("lineEnding"),t.consume(c),t.exit("lineEnding"),u):(t.enter("codeTextData"),l(c))}function l(c){return c===null||c===32||c===96||ie(c)?(t.exit("codeTextData"),u(c)):(t.consume(c),l)}function d(c){return c===96?(t.consume(c),i++,d):i===r?(t.exit("codeTextSequence"),t.exit("codeText"),e(c)):(s.type="codeTextData",l(c))}}class Yx{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(e,r):e>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(e,n,r){const i=n||0;this.setCursor(Math.trunc(e));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Jn(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),Jn(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Jn(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const n=this.left.splice(e,Number.POSITIVE_INFINITY);Jn(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);Jn(this.left,n.reverse())}}}function Jn(t,e){let n=0;if(e.length<1e4)t.push(...e);else for(;n<e.length;)t.push(...e.slice(n,n+1e4)),n+=1e4}function Ad(t){const e={};let n=-1,r,i,s,a,o,u,l;const d=new Yx(t);for(;++n<d.length;){for(;n in e;)n=e[n];if(r=d.get(n),n&&r[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,s=0,s<u.length&&u[s][1].type==="lineEndingBlank"&&(s+=2),s<u.length&&u[s][1].type==="content"))for(;++s<u.length&&u[s][1].type!=="content";)u[s][1].type==="chunkText"&&(u[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(e,qx(d,n)),n=e[n],l=!0);else if(r[1]._container){for(s=n,i=void 0;s--;)if(a=d.get(s),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(d.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=s);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...d.get(i)[1].start},o=d.slice(i,n),o.unshift(r),d.splice(i,n-i+1,o))}}return ht(t,0,Number.POSITIVE_INFINITY,d.slice(0)),!l}function qx(t,e){const n=t.get(e)[1],r=t.get(e)[2];let i=e-1;const s=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const o=a.events,u=[],l={};let d,c,h=-1,p=n,g=0,b=0;const x=[b];for(;p;){for(;t.get(++i)[1]!==p;);s.push(i),p._tokenizer||(d=r.sliceStream(p),p.next||d.push(null),c&&a.defineSkip(p.start),p._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(d),p._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),c=p,p=p.next}for(p=n;++h<o.length;)o[h][0]==="exit"&&o[h-1][0]==="enter"&&o[h][1].type===o[h-1][1].type&&o[h][1].start.line!==o[h][1].end.line&&(b=h+1,x.push(b),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(a.events=[],p?(p._tokenizer=void 0,p.previous=void 0):x.pop(),h=x.length;h--;){const E=o.slice(x[h],x[h+1]),k=s.pop();u.push([k,k+E.length-1]),t.splice(k,2,E)}for(u.reverse(),h=-1;++h<u.length;)l[g+u[h][0]]=g+u[h][1],g+=u[h][1]-u[h][0]-1;return l}const Vx={resolve:Gx,tokenize:Kx},Wx={partial:!0,tokenize:Qx};function Gx(t){return Ad(t),t}function Kx(t,e){let n;return r;function r(o){return t.enter("content"),n=t.enter("chunkContent",{contentType:"content"}),i(o)}function i(o){return o===null?s(o):ie(o)?t.check(Wx,a,s)(o):(t.consume(o),i)}function s(o){return t.exit("chunkContent"),t.exit("content"),e(o)}function a(o){return t.consume(o),t.exit("chunkContent"),n.next=t.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function Qx(t,e,n){const r=this;return i;function i(a){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),_e(t,s,"linePrefix")}function s(a){if(a===null||ie(a))return n(a);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?e(a):t.interrupt(r.parser.constructs.flow,n,e)(a)}}function Sd(t,e,n,r,i,s,a,o,u){const l=u||Number.POSITIVE_INFINITY;let d=0;return c;function c(E){return E===60?(t.enter(r),t.enter(i),t.enter(s),t.consume(E),t.exit(s),h):E===null||E===32||E===41||Ti(E)?n(E):(t.enter(r),t.enter(a),t.enter(o),t.enter("chunkString",{contentType:"string"}),b(E))}function h(E){return E===62?(t.enter(s),t.consume(E),t.exit(s),t.exit(i),t.exit(r),e):(t.enter(o),t.enter("chunkString",{contentType:"string"}),p(E))}function p(E){return E===62?(t.exit("chunkString"),t.exit(o),h(E)):E===null||E===60||ie(E)?n(E):(t.consume(E),E===92?g:p)}function g(E){return E===60||E===62||E===92?(t.consume(E),p):p(E)}function b(E){return!d&&(E===null||E===41||Ne(E))?(t.exit("chunkString"),t.exit(o),t.exit(a),t.exit(r),e(E)):d<l&&E===40?(t.consume(E),d++,b):E===41?(t.consume(E),d--,b):E===null||E===32||E===40||Ti(E)?n(E):(t.consume(E),E===92?x:b)}function x(E){return E===40||E===41||E===92?(t.consume(E),b):b(E)}}function Cd(t,e,n,r,i,s){const a=this;let o=0,u;return l;function l(p){return t.enter(r),t.enter(i),t.consume(p),t.exit(i),t.enter(s),d}function d(p){return o>999||p===null||p===91||p===93&&!u||p===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?n(p):p===93?(t.exit(s),t.enter(i),t.consume(p),t.exit(i),t.exit(r),e):ie(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),d):(t.enter("chunkString",{contentType:"string"}),c(p))}function c(p){return p===null||p===91||p===93||ie(p)||o++>999?(t.exit("chunkString"),d(p)):(t.consume(p),u||(u=!be(p)),p===92?h:c)}function h(p){return p===91||p===92||p===93?(t.consume(p),o++,c):c(p)}}function Id(t,e,n,r,i,s){let a;return o;function o(h){return h===34||h===39||h===40?(t.enter(r),t.enter(i),t.consume(h),t.exit(i),a=h===40?41:h,u):n(h)}function u(h){return h===a?(t.enter(i),t.consume(h),t.exit(i),t.exit(r),e):(t.enter(s),l(h))}function l(h){return h===a?(t.exit(s),u(a)):h===null?n(h):ie(h)?(t.enter("lineEnding"),t.consume(h),t.exit("lineEnding"),_e(t,l,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===a||h===null||ie(h)?(t.exit("chunkString"),l(h)):(t.consume(h),h===92?c:d)}function c(h){return h===a||h===92?(t.consume(h),d):d(h)}}function pr(t,e){let n;return r;function r(i){return ie(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),n=!0,r):be(i)?_e(t,r,n?"linePrefix":"lineSuffix")(i):e(i)}}const Xx={name:"definition",tokenize:eT},Jx={partial:!0,tokenize:tT};function eT(t,e,n){const r=this;let i;return s;function s(p){return t.enter("definition"),a(p)}function a(p){return Cd.call(r,t,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function o(p){return i=yt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(t.enter("definitionMarker"),t.consume(p),t.exit("definitionMarker"),u):n(p)}function u(p){return Ne(p)?pr(t,l)(p):l(p)}function l(p){return Sd(t,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return t.attempt(Jx,c,c)(p)}function c(p){return be(p)?_e(t,h,"whitespace")(p):h(p)}function h(p){return p===null||ie(p)?(t.exit("definition"),r.parser.defined.push(i),e(p)):n(p)}}function tT(t,e,n){return r;function r(o){return Ne(o)?pr(t,i)(o):n(o)}function i(o){return Id(t,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function s(o){return be(o)?_e(t,a,"whitespace")(o):a(o)}function a(o){return o===null||ie(o)?e(o):n(o)}}const nT={name:"hardBreakEscape",tokenize:rT};function rT(t,e,n){return r;function r(s){return t.enter("hardBreakEscape"),t.consume(s),i}function i(s){return ie(s)?(t.exit("hardBreakEscape"),e(s)):n(s)}}const iT={name:"headingAtx",resolve:sT,tokenize:aT};function sT(t,e){let n=t.length-2,r=3,i,s;return t[r][1].type==="whitespace"&&(r+=2),n-2>r&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&t[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:t[r][1].start,end:t[n][1].end},s={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"},ht(t,r,n-r+1,[["enter",i,e],["enter",s,e],["exit",s,e],["exit",i,e]])),t}function aT(t,e,n){let r=0;return i;function i(d){return t.enter("atxHeading"),s(d)}function s(d){return t.enter("atxHeadingSequence"),a(d)}function a(d){return d===35&&r++<6?(t.consume(d),a):d===null||Ne(d)?(t.exit("atxHeadingSequence"),o(d)):n(d)}function o(d){return d===35?(t.enter("atxHeadingSequence"),u(d)):d===null||ie(d)?(t.exit("atxHeading"),e(d)):be(d)?_e(t,o,"whitespace")(d):(t.enter("atxHeadingText"),l(d))}function u(d){return d===35?(t.consume(d),u):(t.exit("atxHeadingSequence"),o(d))}function l(d){return d===null||d===35||Ne(d)?(t.exit("atxHeadingText"),o(d)):(t.consume(d),l)}}const oT=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],du=["pre","script","style","textarea"],uT={concrete:!0,name:"htmlFlow",resolveTo:dT,tokenize:fT},lT={partial:!0,tokenize:pT},cT={partial:!0,tokenize:hT};function dT(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function fT(t,e,n){const r=this;let i,s,a,o,u;return l;function l(T){return d(T)}function d(T){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(T),c}function c(T){return T===33?(t.consume(T),h):T===47?(t.consume(T),s=!0,b):T===63?(t.consume(T),i=3,r.interrupt?e:N):et(T)?(t.consume(T),a=String.fromCharCode(T),x):n(T)}function h(T){return T===45?(t.consume(T),i=2,p):T===91?(t.consume(T),i=5,o=0,g):et(T)?(t.consume(T),i=4,r.interrupt?e:N):n(T)}function p(T){return T===45?(t.consume(T),r.interrupt?e:N):n(T)}function g(T){const V="CDATA[";return T===V.charCodeAt(o++)?(t.consume(T),o===V.length?r.interrupt?e:j:g):n(T)}function b(T){return et(T)?(t.consume(T),a=String.fromCharCode(T),x):n(T)}function x(T){if(T===null||T===47||T===62||Ne(T)){const V=T===47,te=a.toLowerCase();return!V&&!s&&du.includes(te)?(i=1,r.interrupt?e(T):j(T)):oT.includes(a.toLowerCase())?(i=6,V?(t.consume(T),E):r.interrupt?e(T):j(T)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(T):s?k(T):y(T))}return T===45||Ke(T)?(t.consume(T),a+=String.fromCharCode(T),x):n(T)}function E(T){return T===62?(t.consume(T),r.interrupt?e:j):n(T)}function k(T){return be(T)?(t.consume(T),k):v(T)}function y(T){return T===47?(t.consume(T),v):T===58||T===95||et(T)?(t.consume(T),_):be(T)?(t.consume(T),y):v(T)}function _(T){return T===45||T===46||T===58||T===95||Ke(T)?(t.consume(T),_):R(T)}function R(T){return T===61?(t.consume(T),S):be(T)?(t.consume(T),R):y(T)}function S(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(t.consume(T),u=T,w):be(T)?(t.consume(T),S):O(T)}function w(T){return T===u?(t.consume(T),u=null,D):T===null||ie(T)?n(T):(t.consume(T),w)}function O(T){return T===null||T===34||T===39||T===47||T===60||T===61||T===62||T===96||Ne(T)?R(T):(t.consume(T),O)}function D(T){return T===47||T===62||be(T)?y(T):n(T)}function v(T){return T===62?(t.consume(T),B):n(T)}function B(T){return T===null||ie(T)?j(T):be(T)?(t.consume(T),B):n(T)}function j(T){return T===45&&i===2?(t.consume(T),K):T===60&&i===1?(t.consume(T),se):T===62&&i===4?(t.consume(T),Ee):T===63&&i===3?(t.consume(T),N):T===93&&i===5?(t.consume(T),ce):ie(T)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(lT,xe,G)(T)):T===null||ie(T)?(t.exit("htmlFlowData"),G(T)):(t.consume(T),j)}function G(T){return t.check(cT,Y,xe)(T)}function Y(T){return t.enter("lineEnding"),t.consume(T),t.exit("lineEnding"),H}function H(T){return T===null||ie(T)?G(T):(t.enter("htmlFlowData"),j(T))}function K(T){return T===45?(t.consume(T),N):j(T)}function se(T){return T===47?(t.consume(T),a="",pe):j(T)}function pe(T){if(T===62){const V=a.toLowerCase();return du.includes(V)?(t.consume(T),Ee):j(T)}return et(T)&&a.length<8?(t.consume(T),a+=String.fromCharCode(T),pe):j(T)}function ce(T){return T===93?(t.consume(T),N):j(T)}function N(T){return T===62?(t.consume(T),Ee):T===45&&i===2?(t.consume(T),N):j(T)}function Ee(T){return T===null||ie(T)?(t.exit("htmlFlowData"),xe(T)):(t.consume(T),Ee)}function xe(T){return t.exit("htmlFlow"),e(T)}}function hT(t,e,n){const r=this;return i;function i(a){return ie(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),s):n(a)}function s(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}function pT(t,e,n){return r;function r(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(Fr,e,n)}}const mT={name:"htmlText",tokenize:gT};function gT(t,e,n){const r=this;let i,s,a;return o;function o(N){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(N),u}function u(N){return N===33?(t.consume(N),l):N===47?(t.consume(N),R):N===63?(t.consume(N),y):et(N)?(t.consume(N),O):n(N)}function l(N){return N===45?(t.consume(N),d):N===91?(t.consume(N),s=0,g):et(N)?(t.consume(N),k):n(N)}function d(N){return N===45?(t.consume(N),p):n(N)}function c(N){return N===null?n(N):N===45?(t.consume(N),h):ie(N)?(a=c,se(N)):(t.consume(N),c)}function h(N){return N===45?(t.consume(N),p):c(N)}function p(N){return N===62?K(N):N===45?h(N):c(N)}function g(N){const Ee="CDATA[";return N===Ee.charCodeAt(s++)?(t.consume(N),s===Ee.length?b:g):n(N)}function b(N){return N===null?n(N):N===93?(t.consume(N),x):ie(N)?(a=b,se(N)):(t.consume(N),b)}function x(N){return N===93?(t.consume(N),E):b(N)}function E(N){return N===62?K(N):N===93?(t.consume(N),E):b(N)}function k(N){return N===null||N===62?K(N):ie(N)?(a=k,se(N)):(t.consume(N),k)}function y(N){return N===null?n(N):N===63?(t.consume(N),_):ie(N)?(a=y,se(N)):(t.consume(N),y)}function _(N){return N===62?K(N):y(N)}function R(N){return et(N)?(t.consume(N),S):n(N)}function S(N){return N===45||Ke(N)?(t.consume(N),S):w(N)}function w(N){return ie(N)?(a=w,se(N)):be(N)?(t.consume(N),w):K(N)}function O(N){return N===45||Ke(N)?(t.consume(N),O):N===47||N===62||Ne(N)?D(N):n(N)}function D(N){return N===47?(t.consume(N),K):N===58||N===95||et(N)?(t.consume(N),v):ie(N)?(a=D,se(N)):be(N)?(t.consume(N),D):K(N)}function v(N){return N===45||N===46||N===58||N===95||Ke(N)?(t.consume(N),v):B(N)}function B(N){return N===61?(t.consume(N),j):ie(N)?(a=B,se(N)):be(N)?(t.consume(N),B):D(N)}function j(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(t.consume(N),i=N,G):ie(N)?(a=j,se(N)):be(N)?(t.consume(N),j):(t.consume(N),Y)}function G(N){return N===i?(t.consume(N),i=void 0,H):N===null?n(N):ie(N)?(a=G,se(N)):(t.consume(N),G)}function Y(N){return N===null||N===34||N===39||N===60||N===61||N===96?n(N):N===47||N===62||Ne(N)?D(N):(t.consume(N),Y)}function H(N){return N===47||N===62||Ne(N)?D(N):n(N)}function K(N){return N===62?(t.consume(N),t.exit("htmlTextData"),t.exit("htmlText"),e):n(N)}function se(N){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(N),t.exit("lineEnding"),pe}function pe(N){return be(N)?_e(t,ce,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):ce(N)}function ce(N){return t.enter("htmlTextData"),a(N)}}const Da={name:"labelEnd",resolveAll:TT,resolveTo:_T,tokenize:yT},bT={tokenize:kT},ET={tokenize:AT},xT={tokenize:ST};function TT(t){let e=-1;const n=[];for(;++e<t.length;){const r=t[e][1];if(n.push(t[e]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",e+=i}}return t.length!==n.length&&ht(t,0,t.length,n),t}function _T(t,e){let n=t.length,r=0,i,s,a,o;for(;n--;)if(i=t[n][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;t[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(t[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=n);const u={type:t[s][1].type==="labelLink"?"link":"image",start:{...t[s][1].start},end:{...t[t.length-1][1].end}},l={type:"label",start:{...t[s][1].start},end:{...t[a][1].end}},d={type:"labelText",start:{...t[s+r+2][1].end},end:{...t[a-2][1].start}};return o=[["enter",u,e],["enter",l,e]],o=gt(o,t.slice(s+1,s+r+3)),o=gt(o,[["enter",d,e]]),o=gt(o,Bi(e.parser.constructs.insideSpan.null,t.slice(s+r+4,a-3),e)),o=gt(o,[["exit",d,e],t[a-2],t[a-1],["exit",l,e]]),o=gt(o,t.slice(a+1)),o=gt(o,[["exit",u,e]]),ht(t,s,t.length,o),t}function yT(t,e,n){const r=this;let i=r.events.length,s,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return o;function o(h){return s?s._inactive?c(h):(a=r.parser.defined.includes(yt(r.sliceSerialize({start:s.end,end:r.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(h),t.exit("labelMarker"),t.exit("labelEnd"),u):n(h)}function u(h){return h===40?t.attempt(bT,d,a?d:c)(h):h===91?t.attempt(ET,d,a?l:c)(h):a?d(h):c(h)}function l(h){return t.attempt(xT,d,c)(h)}function d(h){return e(h)}function c(h){return s._balanced=!0,n(h)}}function kT(t,e,n){return r;function r(c){return t.enter("resource"),t.enter("resourceMarker"),t.consume(c),t.exit("resourceMarker"),i}function i(c){return Ne(c)?pr(t,s)(c):s(c)}function s(c){return c===41?d(c):Sd(t,a,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function a(c){return Ne(c)?pr(t,u)(c):d(c)}function o(c){return n(c)}function u(c){return c===34||c===39||c===40?Id(t,l,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):d(c)}function l(c){return Ne(c)?pr(t,d)(c):d(c)}function d(c){return c===41?(t.enter("resourceMarker"),t.consume(c),t.exit("resourceMarker"),t.exit("resource"),e):n(c)}}function AT(t,e,n){const r=this;return i;function i(o){return Cd.call(r,t,s,a,"reference","referenceMarker","referenceString")(o)}function s(o){return r.parser.defined.includes(yt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?e(o):n(o)}function a(o){return n(o)}}function ST(t,e,n){return r;function r(s){return t.enter("reference"),t.enter("referenceMarker"),t.consume(s),t.exit("referenceMarker"),i}function i(s){return s===93?(t.enter("referenceMarker"),t.consume(s),t.exit("referenceMarker"),t.exit("reference"),e):n(s)}}const CT={name:"labelStartImage",resolveAll:Da.resolveAll,tokenize:IT};function IT(t,e,n){const r=this;return i;function i(o){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(o),t.exit("labelImageMarker"),s}function s(o){return o===91?(t.enter("labelMarker"),t.consume(o),t.exit("labelMarker"),t.exit("labelImage"),a):n(o)}function a(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):e(o)}}const NT={name:"labelStartLink",resolveAll:Da.resolveAll,tokenize:wT};function wT(t,e,n){const r=this;return i;function i(a){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(a),t.exit("labelMarker"),t.exit("labelLink"),s}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):e(a)}}const os={name:"lineEnding",tokenize:vT};function vT(t,e){return n;function n(r){return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),_e(t,e,"linePrefix")}}const ai={name:"thematicBreak",tokenize:RT};function RT(t,e,n){let r=0,i;return s;function s(l){return t.enter("thematicBreak"),a(l)}function a(l){return i=l,o(l)}function o(l){return l===i?(t.enter("thematicBreakSequence"),u(l)):r>=3&&(l===null||ie(l))?(t.exit("thematicBreak"),e(l)):n(l)}function u(l){return l===i?(t.consume(l),r++,u):(t.exit("thematicBreakSequence"),be(l)?_e(t,o,"whitespace")(l):o(l))}}const rt={continuation:{tokenize:PT},exit:BT,name:"list",tokenize:DT},OT={partial:!0,tokenize:FT},LT={partial:!0,tokenize:MT};function DT(t,e,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return o;function o(p){const g=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:Vs(p)){if(r.containerState.type||(r.containerState.type=g,t.enter(g,{_container:!0})),g==="listUnordered")return t.enter("listItemPrefix"),p===42||p===45?t.check(ai,n,l)(p):l(p);if(!r.interrupt||p===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),u(p)}return n(p)}function u(p){return Vs(p)&&++a<10?(t.consume(p),u):(!r.interrupt||a<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(t.exit("listItemValue"),l(p)):n(p)}function l(p){return t.enter("listItemMarker"),t.consume(p),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,t.check(Fr,r.interrupt?n:d,t.attempt(OT,h,c))}function d(p){return r.containerState.initialBlankLine=!0,s++,h(p)}function c(p){return be(p)?(t.enter("listItemPrefixWhitespace"),t.consume(p),t.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return r.containerState.size=s+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(p)}}function PT(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(Fr,i,s);function i(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,_e(t,e,"listItemIndent",r.containerState.size+1)(o)}function s(o){return r.containerState.furtherBlankLines||!be(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(LT,e,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,_e(t,t.attempt(rt,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function MT(t,e,n){const r=this;return _e(t,i,"listItemIndent",r.containerState.size+1);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?e(s):n(s)}}function BT(t){t.exit(this.containerState.type)}function FT(t,e,n){const r=this;return _e(t,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const a=r.events[r.events.length-1];return!be(s)&&a&&a[1].type==="listItemPrefixWhitespace"?e(s):n(s)}}const fu={name:"setextUnderline",resolveTo:zT,tokenize:jT};function zT(t,e){let n=t.length,r,i,s;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){r=n;break}t[n][1].type==="paragraph"&&(i=n)}else t[n][1].type==="content"&&t.splice(n,1),!s&&t[n][1].type==="definition"&&(s=n);const a={type:"setextHeading",start:{...t[r][1].start},end:{...t[t.length-1][1].end}};return t[i][1].type="setextHeadingText",s?(t.splice(i,0,["enter",a,e]),t.splice(s+1,0,["exit",t[r][1],e]),t[r][1].end={...t[s][1].end}):t[r][1]=a,t.push(["exit",a,e]),t}function jT(t,e,n){const r=this;let i;return s;function s(l){let d=r.events.length,c;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){c=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(t.enter("setextHeadingLine"),i=l,a(l)):n(l)}function a(l){return t.enter("setextHeadingLineSequence"),o(l)}function o(l){return l===i?(t.consume(l),o):(t.exit("setextHeadingLineSequence"),be(l)?_e(t,u,"lineSuffix")(l):u(l))}function u(l){return l===null||ie(l)?(t.exit("setextHeadingLine"),e(l)):n(l)}}const UT={tokenize:HT};function HT(t){const e=this,n=t.attempt(Fr,r,t.attempt(this.parser.constructs.flowInitial,i,_e(t,t.attempt(this.parser.constructs.flow,i,t.attempt(Vx,i)),"linePrefix")));return n;function r(s){if(s===null){t.consume(s);return}return t.enter("lineEndingBlank"),t.consume(s),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function i(s){if(s===null){t.consume(s);return}return t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const $T={resolveAll:wd()},ZT=Nd("string"),YT=Nd("text");function Nd(t){return{resolveAll:wd(t==="text"?qT:void 0),tokenize:e};function e(n){const r=this,i=this.parser.constructs[t],s=n.attempt(i,a,o);return a;function a(d){return l(d)?s(d):o(d)}function o(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),u}function u(d){return l(d)?(n.exit("data"),s(d)):(n.consume(d),u)}function l(d){if(d===null)return!0;const c=i[d];let h=-1;if(c)for(;++h<c.length;){const p=c[h];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function wd(t){return e;function e(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return t?t(n,r):n}}function qT(t,e){let n=0;for(;++n<=t.length;)if((n===t.length||t[n][1].type==="lineEnding")&&t[n-1][1].type==="data"){const r=t[n-1][1],i=e.sliceStream(r);let s=i.length,a=-1,o=0,u;for(;s--;){const l=i[s];if(typeof l=="string"){for(a=l.length;l.charCodeAt(a-1)===32;)o++,a--;if(a)break;a=-1}else if(l===-2)u=!0,o++;else if(l!==-1){s++;break}}if(e._contentTypeTextTrailing&&n===t.length&&(o=0),o){const l={type:n===t.length||u||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?a:r.start._bufferIndex+a,_index:r.start._index+s,line:r.end.line,column:r.end.column-o,offset:r.end.offset-o},end:{...r.end}};r.end={...l.start},r.start.offset===r.end.offset?Object.assign(r,l):(t.splice(n,0,["enter",l,e],["exit",l,e]),n+=2)}n++}return t}const VT={42:rt,43:rt,45:rt,48:rt,49:rt,50:rt,51:rt,52:rt,53:rt,54:rt,55:rt,56:rt,57:rt,62:_d},WT={91:Xx},GT={[-2]:as,[-1]:as,32:as},KT={35:iT,42:ai,45:[fu,ai],60:uT,61:fu,95:ai,96:cu,126:cu},QT={38:kd,92:yd},XT={[-5]:os,[-4]:os,[-3]:os,33:CT,38:kd,42:Ws,60:[Nx,mT],91:NT,92:[nT,yd],93:Da,95:Ws,96:Ux},JT={null:[Ws,$T]},e_={null:[42,95]},t_={null:[]},n_=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:e_,contentInitial:WT,disable:t_,document:VT,flow:KT,flowInitial:GT,insideSpan:JT,string:QT,text:XT},Symbol.toStringTag,{value:"Module"}));function r_(t,e,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},s=[];let a=[],o=[];const u={attempt:w(R),check:w(S),consume:k,enter:y,exit:_,interrupt:w(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:b,events:[],now:g,parser:t,previous:null,sliceSerialize:h,sliceStream:p,write:c};let d=e.tokenize.call(l,u);return e.resolveAll&&s.push(e),l;function c(B){return a=gt(a,B),x(),a[a.length-1]!==null?[]:(O(e,0),l.events=Bi(s,l.events,l),l.events)}function h(B,j){return s_(p(B),j)}function p(B){return i_(a,B)}function g(){const{_bufferIndex:B,_index:j,line:G,column:Y,offset:H}=r;return{_bufferIndex:B,_index:j,line:G,column:Y,offset:H}}function b(B){i[B.line]=B.column,v()}function x(){let B;for(;r._index<a.length;){const j=a[r._index];if(typeof j=="string")for(B=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===B&&r._bufferIndex<j.length;)E(j.charCodeAt(r._bufferIndex));else E(j)}}function E(B){d=d(B)}function k(B){ie(B)?(r.line++,r.column=1,r.offset+=B===-3?2:1,v()):B!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=B}function y(B,j){const G=j||{};return G.type=B,G.start=g(),l.events.push(["enter",G,l]),o.push(G),G}function _(B){const j=o.pop();return j.end=g(),l.events.push(["exit",j,l]),j}function R(B,j){O(B,j.from)}function S(B,j){j.restore()}function w(B,j){return G;function G(Y,H,K){let se,pe,ce,N;return Array.isArray(Y)?xe(Y):"tokenize"in Y?xe([Y]):Ee(Y);function Ee(Q){return J;function J(ne){const ae=ne!==null&&Q[ne],ge=ne!==null&&Q.null,Re=[...Array.isArray(ae)?ae:ae?[ae]:[],...Array.isArray(ge)?ge:ge?[ge]:[]];return xe(Re)(ne)}}function xe(Q){return se=Q,pe=0,Q.length===0?K:T(Q[pe])}function T(Q){return J;function J(ne){return N=D(),ce=Q,Q.partial||(l.currentConstruct=Q),Q.name&&l.parser.constructs.disable.null.includes(Q.name)?te():Q.tokenize.call(j?Object.assign(Object.create(l),j):l,u,V,te)(ne)}}function V(Q){return B(ce,N),H}function te(Q){return N.restore(),++pe<se.length?T(se[pe]):K}}}function O(B,j){B.resolveAll&&!s.includes(B)&&s.push(B),B.resolve&&ht(l.events,j,l.events.length-j,B.resolve(l.events.slice(j),l)),B.resolveTo&&(l.events=B.resolveTo(l.events,l))}function D(){const B=g(),j=l.previous,G=l.currentConstruct,Y=l.events.length,H=Array.from(o);return{from:Y,restore:K};function K(){r=B,l.previous=j,l.currentConstruct=G,l.events.length=Y,o=H,v()}}function v(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function i_(t,e){const n=e.start._index,r=e.start._bufferIndex,i=e.end._index,s=e.end._bufferIndex;let a;if(n===i)a=[t[n].slice(r,s)];else{if(a=t.slice(n,i),r>-1){const o=a[0];typeof o=="string"?a[0]=o.slice(r):a.shift()}s>0&&a.push(t[i].slice(0,s))}return a}function s_(t,e){let n=-1;const r=[];let i;for(;++n<t.length;){const s=t[n];let a;if(typeof s=="string")a=s;else switch(s){case-5:{a="\r";break}case-4:{a=`
|
|
96
|
-
`;break}case-3:{a=`\r
|
|
97
|
-
`;break}case-2:{a=e?" ":" ";break}case-1:{if(!e&&i)continue;a=" ";break}default:a=String.fromCharCode(s)}i=s===-2,r.push(a)}return r.join("")}function a_(t){const r={constructs:xd([n_,...(t||{}).extensions||[]]),content:i(_x),defined:[],document:i(kx),flow:i(UT),lazy:{},string:i(ZT),text:i(YT)};return r;function i(s){return a;function a(o){return r_(r,s,o)}}}function o_(t){for(;!Ad(t););return t}const hu=/[\0\t\n\r]/g;function u_(){let t=1,e="",n=!0,r;return i;function i(s,a,o){const u=[];let l,d,c,h,p;for(s=e+(typeof s=="string"?s.toString():new TextDecoder(a||void 0).decode(s)),c=0,e="",n&&(s.charCodeAt(0)===65279&&c++,n=void 0);c<s.length;){if(hu.lastIndex=c,l=hu.exec(s),h=l&&l.index!==void 0?l.index:s.length,p=s.charCodeAt(h),!l){e=s.slice(c);break}if(p===10&&c===h&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),c<h&&(u.push(s.slice(c,h)),t+=h-c),p){case 0:{u.push(65533),t++;break}case 9:{for(d=Math.ceil(t/4)*4,u.push(-2);t++<d;)u.push(-1);break}case 10:{u.push(-4),t=1;break}default:r=!0,t=1}c=h+1}return o&&(r&&u.push(-5),e&&u.push(e),u.push(null)),u}}const l_=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function c_(t){return t.replace(l_,d_)}function d_(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return Td(n.slice(s?2:1),s?16:10)}return La(n)||t}const vd={}.hasOwnProperty;function f_(t,e,n){return typeof e!="string"&&(n=e,e=void 0),h_(n)(o_(a_(n).document().write(u_()(t,e,!0))))}function h_(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Yn),autolinkProtocol:D,autolinkEmail:D,atxHeading:s($e),blockQuote:s(ge),characterEscape:D,characterReference:D,codeFenced:s(Re),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:s(Re,a),codeText:s(Me,a),codeTextData:D,data:D,codeFlowValue:D,definition:s(ye),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:s(Ye),hardBreakEscape:s(Qt),hardBreakTrailing:s(Qt),htmlFlow:s(En,a),htmlFlowData:D,htmlText:s(En,a),htmlTextData:D,image:s(Ge),label:a,link:s(Yn),listItem:s(Xt),listItemValue:h,listOrdered:s(Hr,c),listUnordered:s(Hr),paragraph:s($r),reference:T,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:s($e),strong:s(Ki),thematicBreak:s(vh)},exit:{atxHeading:u(),atxHeadingSequence:R,autolink:u(),autolinkEmail:ae,autolinkProtocol:ne,blockQuote:u(),characterEscapeValue:v,characterReferenceMarkerHexadecimal:te,characterReferenceMarkerNumeric:te,characterReferenceValue:Q,characterReference:J,codeFenced:u(x),codeFencedFence:b,codeFencedFenceInfo:p,codeFencedFenceMeta:g,codeFlowValue:v,codeIndented:u(E),codeText:u(H),codeTextData:v,data:v,definition:u(),definitionDestinationString:_,definitionLabelString:k,definitionTitleString:y,emphasis:u(),hardBreakEscape:u(j),hardBreakTrailing:u(j),htmlFlow:u(G),htmlFlowData:v,htmlText:u(Y),htmlTextData:v,image:u(se),label:ce,labelText:pe,lineEnding:B,link:u(K),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:V,resourceDestinationString:N,resourceTitleString:Ee,resource:xe,setextHeading:u(O),setextHeadingLineSequence:w,setextHeadingText:S,strong:u(),thematicBreak:u()}};Rd(e,(t||{}).mdastExtensions||[]);const n={};return r;function r(U){let W={type:"root",children:[]};const oe={stack:[W],tokenStack:[],config:e,enter:o,exit:l,buffer:a,resume:d,data:n},Te=[];let Ie=-1;for(;++Ie<U.length;)if(U[Ie][1].type==="listOrdered"||U[Ie][1].type==="listUnordered")if(U[Ie][0]==="enter")Te.push(Ie);else{const xt=Te.pop();Ie=i(U,xt,Ie)}for(Ie=-1;++Ie<U.length;){const xt=e[U[Ie][0]];vd.call(xt,U[Ie][1].type)&&xt[U[Ie][1].type].call(Object.assign({sliceSerialize:U[Ie][2].sliceSerialize},oe),U[Ie][1])}if(oe.tokenStack.length>0){const xt=oe.tokenStack[oe.tokenStack.length-1];(xt[1]||pu).call(oe,void 0,xt[0])}for(W.position={start:jt(U.length>0?U[0][1].start:{line:1,column:1,offset:0}),end:jt(U.length>0?U[U.length-2][1].end:{line:1,column:1,offset:0})},Ie=-1;++Ie<e.transforms.length;)W=e.transforms[Ie](W)||W;return W}function i(U,W,oe){let Te=W-1,Ie=-1,xt=!1,Jt,Lt,qn,Vn;for(;++Te<=oe;){const ct=U[Te];switch(ct[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ct[0]==="enter"?Ie++:Ie--,Vn=void 0;break}case"lineEndingBlank":{ct[0]==="enter"&&(Jt&&!Vn&&!Ie&&!qn&&(qn=Te),Vn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Vn=void 0}if(!Ie&&ct[0]==="enter"&&ct[1].type==="listItemPrefix"||Ie===-1&&ct[0]==="exit"&&(ct[1].type==="listUnordered"||ct[1].type==="listOrdered")){if(Jt){let xn=Te;for(Lt=void 0;xn--;){const Dt=U[xn];if(Dt[1].type==="lineEnding"||Dt[1].type==="lineEndingBlank"){if(Dt[0]==="exit")continue;Lt&&(U[Lt][1].type="lineEndingBlank",xt=!0),Dt[1].type="lineEnding",Lt=xn}else if(!(Dt[1].type==="linePrefix"||Dt[1].type==="blockQuotePrefix"||Dt[1].type==="blockQuotePrefixWhitespace"||Dt[1].type==="blockQuoteMarker"||Dt[1].type==="listItemIndent"))break}qn&&(!Lt||qn<Lt)&&(Jt._spread=!0),Jt.end=Object.assign({},Lt?U[Lt][1].start:ct[1].end),U.splice(Lt||Te,0,["exit",Jt,ct[2]]),Te++,oe++}if(ct[1].type==="listItemPrefix"){const xn={type:"listItem",_spread:!1,start:Object.assign({},ct[1].start),end:void 0};Jt=xn,U.splice(Te,0,["enter",xn,ct[2]]),Te++,oe++,qn=void 0,Vn=!0}}}return U[W][1]._spread=xt,oe}function s(U,W){return oe;function oe(Te){o.call(this,U(Te),Te),W&&W.call(this,Te)}}function a(){this.stack.push({type:"fragment",children:[]})}function o(U,W,oe){this.stack[this.stack.length-1].children.push(U),this.stack.push(U),this.tokenStack.push([W,oe||void 0]),U.position={start:jt(W.start),end:void 0}}function u(U){return W;function W(oe){U&&U.call(this,oe),l.call(this,oe)}}function l(U,W){const oe=this.stack.pop(),Te=this.tokenStack.pop();if(Te)Te[0].type!==U.type&&(W?W.call(this,U,Te[0]):(Te[1]||pu).call(this,U,Te[0]));else throw new Error("Cannot close `"+U.type+"` ("+hr({start:U.start,end:U.end})+"): it’s not open");oe.position.end=jt(U.end)}function d(){return Oa(this.stack.pop())}function c(){this.data.expectingFirstListItemValue=!0}function h(U){if(this.data.expectingFirstListItemValue){const W=this.stack[this.stack.length-2];W.start=Number.parseInt(this.sliceSerialize(U),10),this.data.expectingFirstListItemValue=void 0}}function p(){const U=this.resume(),W=this.stack[this.stack.length-1];W.lang=U}function g(){const U=this.resume(),W=this.stack[this.stack.length-1];W.meta=U}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function x(){const U=this.resume(),W=this.stack[this.stack.length-1];W.value=U.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function E(){const U=this.resume(),W=this.stack[this.stack.length-1];W.value=U.replace(/(\r?\n|\r)$/g,"")}function k(U){const W=this.resume(),oe=this.stack[this.stack.length-1];oe.label=W,oe.identifier=yt(this.sliceSerialize(U)).toLowerCase()}function y(){const U=this.resume(),W=this.stack[this.stack.length-1];W.title=U}function _(){const U=this.resume(),W=this.stack[this.stack.length-1];W.url=U}function R(U){const W=this.stack[this.stack.length-1];if(!W.depth){const oe=this.sliceSerialize(U).length;W.depth=oe}}function S(){this.data.setextHeadingSlurpLineEnding=!0}function w(U){const W=this.stack[this.stack.length-1];W.depth=this.sliceSerialize(U).codePointAt(0)===61?1:2}function O(){this.data.setextHeadingSlurpLineEnding=void 0}function D(U){const oe=this.stack[this.stack.length-1].children;let Te=oe[oe.length-1];(!Te||Te.type!=="text")&&(Te=wh(),Te.position={start:jt(U.start),end:void 0},oe.push(Te)),this.stack.push(Te)}function v(U){const W=this.stack.pop();W.value+=this.sliceSerialize(U),W.position.end=jt(U.end)}function B(U){const W=this.stack[this.stack.length-1];if(this.data.atHardBreak){const oe=W.children[W.children.length-1];oe.position.end=jt(U.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(W.type)&&(D.call(this,U),v.call(this,U))}function j(){this.data.atHardBreak=!0}function G(){const U=this.resume(),W=this.stack[this.stack.length-1];W.value=U}function Y(){const U=this.resume(),W=this.stack[this.stack.length-1];W.value=U}function H(){const U=this.resume(),W=this.stack[this.stack.length-1];W.value=U}function K(){const U=this.stack[this.stack.length-1];if(this.data.inReference){const W=this.data.referenceType||"shortcut";U.type+="Reference",U.referenceType=W,delete U.url,delete U.title}else delete U.identifier,delete U.label;this.data.referenceType=void 0}function se(){const U=this.stack[this.stack.length-1];if(this.data.inReference){const W=this.data.referenceType||"shortcut";U.type+="Reference",U.referenceType=W,delete U.url,delete U.title}else delete U.identifier,delete U.label;this.data.referenceType=void 0}function pe(U){const W=this.sliceSerialize(U),oe=this.stack[this.stack.length-2];oe.label=c_(W),oe.identifier=yt(W).toLowerCase()}function ce(){const U=this.stack[this.stack.length-1],W=this.resume(),oe=this.stack[this.stack.length-1];if(this.data.inReference=!0,oe.type==="link"){const Te=U.children;oe.children=Te}else oe.alt=W}function N(){const U=this.resume(),W=this.stack[this.stack.length-1];W.url=U}function Ee(){const U=this.resume(),W=this.stack[this.stack.length-1];W.title=U}function xe(){this.data.inReference=void 0}function T(){this.data.referenceType="collapsed"}function V(U){const W=this.resume(),oe=this.stack[this.stack.length-1];oe.label=W,oe.identifier=yt(this.sliceSerialize(U)).toLowerCase(),this.data.referenceType="full"}function te(U){this.data.characterReferenceType=U.type}function Q(U){const W=this.sliceSerialize(U),oe=this.data.characterReferenceType;let Te;oe?(Te=Td(W,oe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Te=La(W);const Ie=this.stack[this.stack.length-1];Ie.value+=Te}function J(U){const W=this.stack.pop();W.position.end=jt(U.end)}function ne(U){v.call(this,U);const W=this.stack[this.stack.length-1];W.url=this.sliceSerialize(U)}function ae(U){v.call(this,U);const W=this.stack[this.stack.length-1];W.url="mailto:"+this.sliceSerialize(U)}function ge(){return{type:"blockquote",children:[]}}function Re(){return{type:"code",lang:null,meta:null,value:""}}function Me(){return{type:"inlineCode",value:""}}function ye(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ye(){return{type:"emphasis",children:[]}}function $e(){return{type:"heading",depth:0,children:[]}}function Qt(){return{type:"break"}}function En(){return{type:"html",value:""}}function Ge(){return{type:"image",title:null,url:"",alt:null}}function Yn(){return{type:"link",title:null,url:"",children:[]}}function Hr(U){return{type:"list",ordered:U.type==="listOrdered",start:null,spread:U._spread,children:[]}}function Xt(U){return{type:"listItem",spread:U._spread,checked:null,children:[]}}function $r(){return{type:"paragraph",children:[]}}function Ki(){return{type:"strong",children:[]}}function wh(){return{type:"text",value:""}}function vh(){return{type:"thematicBreak"}}}function jt(t){return{line:t.line,column:t.column,offset:t.offset}}function Rd(t,e){let n=-1;for(;++n<e.length;){const r=e[n];Array.isArray(r)?Rd(t,r):p_(t,r)}}function p_(t,e){let n;for(n in e)if(vd.call(e,n))switch(n){case"canContainEols":{const r=e[n];r&&t[n].push(...r);break}case"transforms":{const r=e[n];r&&t[n].push(...r);break}case"enter":case"exit":{const r=e[n];r&&Object.assign(t[n],r);break}}}function pu(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+hr({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+hr({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+hr({start:e.start,end:e.end})+") is still open")}function m_(t){const e=this;e.parser=n;function n(r){return f_(r,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function g_(t,e){const n={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(e),!0)};return t.patch(e,n),t.applyData(e,n)}function b_(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:`
|
|
98
|
-
`}]}function E_(t,e){const n=e.value?e.value+`
|
|
99
|
-
`:"",r={},i=e.lang?e.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return e.meta&&(s.data={meta:e.meta}),t.patch(e,s),s=t.applyData(e,s),s={type:"element",tagName:"pre",properties:{},children:[s]},t.patch(e,s),s}function x_(t,e){const n={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function T_(t,e){const n={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function __(t,e){const n=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",r=String(e.identifier).toUpperCase(),i=Un(r.toLowerCase()),s=t.footnoteOrder.indexOf(r);let a,o=t.footnoteCounts.get(r);o===void 0?(o=0,t.footnoteOrder.push(r),a=t.footnoteOrder.length):a=s+1,o+=1,t.footnoteCounts.set(r,o);const u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};t.patch(e,u);const l={type:"element",tagName:"sup",properties:{},children:[u]};return t.patch(e,l),t.applyData(e,l)}function y_(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function k_(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}}function Od(t,e){const n=e.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+r}];const i=t.all(e),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function A_(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return Od(t,e);const i={src:Un(r.url||""),alt:e.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return t.patch(e,s),t.applyData(e,s)}function S_(t,e){const n={src:Un(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,r),t.applyData(e,r)}function C_(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,r),t.applyData(e,r)}function I_(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return Od(t,e);const i={href:Un(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:t.all(e)};return t.patch(e,s),t.applyData(e,s)}function N_(t,e){const n={href:Un(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function w_(t,e,n){const r=t.all(e),i=n?v_(n):Ld(e),s={},a=[];if(typeof e.checked=="boolean"){const d=r[0];let c;d&&d.type==="element"&&d.tagName==="p"?c=d:(c={type:"element",tagName:"p",properties:{},children:[]},r.unshift(c)),c.children.length>0&&c.children.unshift({type:"text",value:" "}),c.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let o=-1;for(;++o<r.length;){const d=r[o];(i||o!==0||d.type!=="element"||d.tagName!=="p")&&a.push({type:"text",value:`
|
|
100
|
-
`}),d.type==="element"&&d.tagName==="p"&&!i?a.push(...d.children):a.push(d)}const u=r[r.length-1];u&&(i||u.type!=="element"||u.tagName!=="p")&&a.push({type:"text",value:`
|
|
101
|
-
`});const l={type:"element",tagName:"li",properties:s,children:a};return t.patch(e,l),t.applyData(e,l)}function v_(t){let e=!1;if(t.type==="list"){e=t.spread||!1;const n=t.children;let r=-1;for(;!e&&++r<n.length;)e=Ld(n[r])}return e}function Ld(t){const e=t.spread;return e??t.children.length>1}function R_(t,e){const n={},r=t.all(e);let i=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++i<r.length;){const a=r[i];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:e.ordered?"ol":"ul",properties:n,children:t.wrap(r,!0)};return t.patch(e,s),t.applyData(e,s)}function O_(t,e){const n={type:"element",tagName:"p",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function L_(t,e){const n={type:"root",children:t.wrap(t.all(e))};return t.patch(e,n),t.applyData(e,n)}function D_(t,e){const n={type:"element",tagName:"strong",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function P_(t,e){const n=t.all(e),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:t.wrap([r],!0)};t.patch(e.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},o=Rt(e.children[1]),u=Pi(e.children[e.children.length-1]);o&&u&&(a.position={start:o,end:u}),i.push(a)}const s={type:"element",tagName:"table",properties:{},children:t.wrap(i,!0)};return t.patch(e,s),t.applyData(e,s)}function M_(t,e,n){const r=n?n.children:void 0,s=(r?r.indexOf(e):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,o=a?a.length:e.children.length;let u=-1;const l=[];for(;++u<o;){const c=e.children[u],h={},p=a?a[u]:void 0;p&&(h.align=p);let g={type:"element",tagName:s,properties:h,children:[]};c&&(g.children=t.all(c),t.patch(c,g),g=t.applyData(c,g)),l.push(g)}const d={type:"element",tagName:"tr",properties:{},children:t.wrap(l,!0)};return t.patch(e,d),t.applyData(e,d)}function B_(t,e){const n={type:"element",tagName:"td",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}const mu=9,gu=32;function F_(t){const e=String(t),n=/\r?\n|\r/g;let r=n.exec(e),i=0;const s=[];for(;r;)s.push(bu(e.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(e);return s.push(bu(e.slice(i),i>0,!1)),s.join("")}function bu(t,e,n){let r=0,i=t.length;if(e){let s=t.codePointAt(r);for(;s===mu||s===gu;)r++,s=t.codePointAt(r)}if(n){let s=t.codePointAt(i-1);for(;s===mu||s===gu;)i--,s=t.codePointAt(i-1)}return i>r?t.slice(r,i):""}function z_(t,e){const n={type:"text",value:F_(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function j_(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const U_={blockquote:g_,break:b_,code:E_,delete:x_,emphasis:T_,footnoteReference:__,heading:y_,html:k_,imageReference:A_,image:S_,inlineCode:C_,linkReference:I_,link:N_,listItem:w_,list:R_,paragraph:O_,root:L_,strong:D_,table:P_,tableCell:B_,tableRow:M_,text:z_,thematicBreak:j_,toml:Vr,yaml:Vr,definition:Vr,footnoteDefinition:Vr};function Vr(){}const Dd=-1,Fi=0,mr=1,_i=2,Pa=3,Ma=4,Ba=5,Fa=6,Pd=7,Md=8,Eu=typeof self=="object"?self:globalThis,H_=(t,e)=>{const n=(i,s)=>(t.set(s,i),i),r=i=>{if(t.has(i))return t.get(i);const[s,a]=e[i];switch(s){case Fi:case Dd:return n(a,i);case mr:{const o=n([],i);for(const u of a)o.push(r(u));return o}case _i:{const o=n({},i);for(const[u,l]of a)o[r(u)]=r(l);return o}case Pa:return n(new Date(a),i);case Ma:{const{source:o,flags:u}=a;return n(new RegExp(o,u),i)}case Ba:{const o=n(new Map,i);for(const[u,l]of a)o.set(r(u),r(l));return o}case Fa:{const o=n(new Set,i);for(const u of a)o.add(r(u));return o}case Pd:{const{name:o,message:u}=a;return n(new Eu[o](u),i)}case Md:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:o}=new Uint8Array(a);return n(new DataView(o),a)}}return n(new Eu[s](a),i)};return r},xu=t=>H_(new Map,t)(0),yn="",{toString:$_}={},{keys:Z_}=Object,er=t=>{const e=typeof t;if(e!=="object"||!t)return[Fi,e];const n=$_.call(t).slice(8,-1);switch(n){case"Array":return[mr,yn];case"Object":return[_i,yn];case"Date":return[Pa,yn];case"RegExp":return[Ma,yn];case"Map":return[Ba,yn];case"Set":return[Fa,yn];case"DataView":return[mr,n]}return n.includes("Array")?[mr,n]:n.includes("Error")?[Pd,n]:[_i,n]},Wr=([t,e])=>t===Fi&&(e==="function"||e==="symbol"),Y_=(t,e,n,r)=>{const i=(a,o)=>{const u=r.push(a)-1;return n.set(o,u),u},s=a=>{if(n.has(a))return n.get(a);let[o,u]=er(a);switch(o){case Fi:{let d=a;switch(u){case"bigint":o=Md,d=a.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+u);d=null;break;case"undefined":return i([Dd],a)}return i([o,d],a)}case mr:{if(u){let h=a;return u==="DataView"?h=new Uint8Array(a.buffer):u==="ArrayBuffer"&&(h=new Uint8Array(a)),i([u,[...h]],a)}const d=[],c=i([o,d],a);for(const h of a)d.push(s(h));return c}case _i:{if(u)switch(u){case"BigInt":return i([u,a.toString()],a);case"Boolean":case"Number":case"String":return i([u,a.valueOf()],a)}if(e&&"toJSON"in a)return s(a.toJSON());const d=[],c=i([o,d],a);for(const h of Z_(a))(t||!Wr(er(a[h])))&&d.push([s(h),s(a[h])]);return c}case Pa:return i([o,a.toISOString()],a);case Ma:{const{source:d,flags:c}=a;return i([o,{source:d,flags:c}],a)}case Ba:{const d=[],c=i([o,d],a);for(const[h,p]of a)(t||!(Wr(er(h))||Wr(er(p))))&&d.push([s(h),s(p)]);return c}case Fa:{const d=[],c=i([o,d],a);for(const h of a)(t||!Wr(er(h)))&&d.push(s(h));return c}}const{message:l}=a;return i([o,{name:u,message:l}],a)};return s},Tu=(t,{json:e,lossy:n}={})=>{const r=[];return Y_(!(e||n),!!e,new Map,r)(t),r},Dn=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?xu(Tu(t,e)):structuredClone(t):(t,e)=>xu(Tu(t,e));function q_(t,e){const n=[{type:"text",value:"↩"}];return e>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),n}function V_(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function W_(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=t.options.footnoteBackContent||q_,r=t.options.footnoteBackLabel||V_,i=t.options.footnoteLabel||"Footnotes",s=t.options.footnoteLabelTagName||"h2",a=t.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let u=-1;for(;++u<t.footnoteOrder.length;){const l=t.footnoteById.get(t.footnoteOrder[u]);if(!l)continue;const d=t.all(l),c=String(l.identifier).toUpperCase(),h=Un(c.toLowerCase());let p=0;const g=[],b=t.footnoteCounts.get(c);for(;b!==void 0&&++p<=b;){g.length>0&&g.push({type:"text",value:" "});let k=typeof n=="string"?n:n(u,p);typeof k=="string"&&(k={type:"text",value:k}),g.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+h+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,p),className:["data-footnote-backref"]},children:Array.isArray(k)?k:[k]})}const x=d[d.length-1];if(x&&x.type==="element"&&x.tagName==="p"){const k=x.children[x.children.length-1];k&&k.type==="text"?k.value+=" ":x.children.push({type:"text",value:" "}),x.children.push(...g)}else d.push(...g);const E={type:"element",tagName:"li",properties:{id:e+"fn-"+h},children:t.wrap(d,!0)};t.patch(l,E),o.push(E)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...Dn(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
102
|
-
`},{type:"element",tagName:"ol",properties:{},children:t.wrap(o,!0)},{type:"text",value:`
|
|
103
|
-
`}]}}const zi=(function(t){if(t==null)return X_;if(typeof t=="function")return ji(t);if(typeof t=="object")return Array.isArray(t)?G_(t):K_(t);if(typeof t=="string")return Q_(t);throw new Error("Expected function, string, or object as test")});function G_(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=zi(t[n]);return ji(r);function r(...i){let s=-1;for(;++s<e.length;)if(e[s].apply(this,i))return!0;return!1}}function K_(t){const e=t;return ji(n);function n(r){const i=r;let s;for(s in t)if(i[s]!==e[s])return!1;return!0}}function Q_(t){return ji(e);function e(n){return n&&n.type===t}}function ji(t){return e;function e(n,r,i){return!!(J_(n)&&t.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function X_(){return!0}function J_(t){return t!==null&&typeof t=="object"&&"type"in t}const Bd=[],ey=!0,Gs=!1,ty="skip";function Fd(t,e,n,r){let i;typeof e=="function"&&typeof n!="function"?(r=n,n=e):i=e;const s=zi(i),a=r?-1:1;o(t,void 0,[])();function o(u,l,d){const c=u&&typeof u=="object"?u:{};if(typeof c.type=="string"){const p=typeof c.tagName=="string"?c.tagName:typeof c.name=="string"?c.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(u.type+(p?"<"+p+">":""))+")"})}return h;function h(){let p=Bd,g,b,x;if((!e||s(u,l,d[d.length-1]||void 0))&&(p=ny(n(u,d)),p[0]===Gs))return p;if("children"in u&&u.children){const E=u;if(E.children&&p[0]!==ty)for(b=(r?E.children.length:-1)+a,x=d.concat(E);b>-1&&b<E.children.length;){const k=E.children[b];if(g=o(k,b,x)(),g[0]===Gs)return g;b=typeof g[1]=="number"?g[1]:b+a}}return p}}}function ny(t){return Array.isArray(t)?t:typeof t=="number"?[ey,t]:t==null?Bd:[t]}function Ui(t,e,n,r){let i,s,a;typeof e=="function"&&typeof n!="function"?(s=void 0,a=e,i=n):(s=e,a=n,i=r),Fd(t,s,o,i);function o(u,l){const d=l[l.length-1],c=d?d.children.indexOf(u):void 0;return a(u,c,d)}}const Ks={}.hasOwnProperty,ry={};function iy(t,e){const n=e||ry,r=new Map,i=new Map,s=new Map,a={...U_,...n.handlers},o={all:l,applyData:ay,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:a,one:u,options:n,patch:sy,wrap:uy};return Ui(t,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const c=d.type==="definition"?r:i,h=String(d.identifier).toUpperCase();c.has(h)||c.set(h,d)}}),o;function u(d,c){const h=d.type,p=o.handlers[h];if(Ks.call(o.handlers,h)&&p)return p(o,d,c);if(o.options.passThrough&&o.options.passThrough.includes(h)){if("children"in d){const{children:b,...x}=d,E=Dn(x);return E.children=o.all(d),E}return Dn(d)}return(o.options.unknownHandler||oy)(o,d,c)}function l(d){const c=[];if("children"in d){const h=d.children;let p=-1;for(;++p<h.length;){const g=o.one(h[p],d);if(g){if(p&&h[p-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=_u(g.value)),!Array.isArray(g)&&g.type==="element")){const b=g.children[0];b&&b.type==="text"&&(b.value=_u(b.value))}Array.isArray(g)?c.push(...g):c.push(g)}}}return c}}function sy(t,e){t.position&&(e.position=V2(t))}function ay(t,e){let n=e;if(t&&t.data){const r=t.data.hName,i=t.data.hChildren,s=t.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const a="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:a}}n.type==="element"&&s&&Object.assign(n.properties,Dn(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function oy(t,e){const n=e.data||{},r="value"in e&&!(Ks.call(n,"hProperties")||Ks.call(n,"hChildren"))?{type:"text",value:e.value}:{type:"element",tagName:"div",properties:{},children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function uy(t,e){const n=[];let r=-1;for(e&&n.push({type:"text",value:`
|
|
104
|
-
`});++r<t.length;)r&&n.push({type:"text",value:`
|
|
105
|
-
`}),n.push(t[r]);return e&&t.length>0&&n.push({type:"text",value:`
|
|
106
|
-
`}),n}function _u(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function yu(t,e){const n=iy(t,e),r=n.one(t,void 0),i=W_(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
|
|
107
|
-
`},i),s}function ly(t,e){return t&&"run"in t?async function(n,r){const i=yu(n,{file:r,...e});await t.run(i,r)}:function(n,r){return yu(n,{file:r,...t||e})}}function ku(t){if(t)throw t}var us,Au;function cy(){if(Au)return us;Au=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(l){return typeof Array.isArray=="function"?Array.isArray(l):e.call(l)==="[object Array]"},s=function(l){if(!l||e.call(l)!=="[object Object]")return!1;var d=t.call(l,"constructor"),c=l.constructor&&l.constructor.prototype&&t.call(l.constructor.prototype,"isPrototypeOf");if(l.constructor&&!d&&!c)return!1;var h;for(h in l);return typeof h>"u"||t.call(l,h)},a=function(l,d){n&&d.name==="__proto__"?n(l,d.name,{enumerable:!0,configurable:!0,value:d.newValue,writable:!0}):l[d.name]=d.newValue},o=function(l,d){if(d==="__proto__")if(t.call(l,d)){if(r)return r(l,d).value}else return;return l[d]};return us=function u(){var l,d,c,h,p,g,b=arguments[0],x=1,E=arguments.length,k=!1;for(typeof b=="boolean"&&(k=b,b=arguments[1]||{},x=2),(b==null||typeof b!="object"&&typeof b!="function")&&(b={});x<E;++x)if(l=arguments[x],l!=null)for(d in l)c=o(b,d),h=o(l,d),b!==h&&(k&&h&&(s(h)||(p=i(h)))?(p?(p=!1,g=c&&i(c)?c:[]):g=c&&s(c)?c:{},a(b,{name:d,newValue:u(k,g,h)})):typeof h<"u"&&a(b,{name:d,newValue:h}));return b},us}var dy=cy();const ls=ca(dy);function Qs(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function fy(){const t=[],e={run:n,use:r};return e;function n(...i){let s=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);o(null,...i);function o(u,...l){const d=t[++s];let c=-1;if(u){a(u);return}for(;++c<i.length;)(l[c]===null||l[c]===void 0)&&(l[c]=i[c]);i=l,d?hy(d,o)(...l):a(null,...l)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return t.push(i),e}}function hy(t,e){let n;return r;function r(...a){const o=t.length>a.length;let u;o&&a.push(i);try{u=t.apply(this,a)}catch(l){const d=l;if(o&&n)throw d;return i(d)}o||(u&&u.then&&typeof u.then=="function"?u.then(s,i):u instanceof Error?i(u):s(u))}function i(a,...o){n||(n=!0,e(a,...o))}function s(a){i(null,a)}}const It={basename:py,dirname:my,extname:gy,join:by,sep:"/"};function py(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');zr(t);let n=0,r=-1,i=t.length,s;if(e===void 0||e.length===0||e.length>t.length){for(;i--;)if(t.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":t.slice(n,r)}if(e===t)return"";let a=-1,o=e.length-1;for(;i--;)if(t.codePointAt(i)===47){if(s){n=i+1;break}}else a<0&&(s=!0,a=i+1),o>-1&&(t.codePointAt(i)===e.codePointAt(o--)?o<0&&(r=i):(o=-1,r=a));return n===r?r=a:r<0&&(r=t.length),t.slice(n,r)}function my(t){if(zr(t),t.length===0)return".";let e=-1,n=t.length,r;for(;--n;)if(t.codePointAt(n)===47){if(r){e=n;break}}else r||(r=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function gy(t){zr(t);let e=t.length,n=-1,r=0,i=-1,s=0,a;for(;e--;){const o=t.codePointAt(e);if(o===47){if(a){r=e+1;break}continue}n<0&&(a=!0,n=e+1),o===46?i<0?i=e:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":t.slice(i,n)}function by(...t){let e=-1,n;for(;++e<t.length;)zr(t[e]),t[e]&&(n=n===void 0?t[e]:n+"/"+t[e]);return n===void 0?".":Ey(n)}function Ey(t){zr(t);const e=t.codePointAt(0)===47;let n=xy(t,!e);return n.length===0&&!e&&(n="."),n.length>0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function xy(t,e){let n="",r=0,i=-1,s=0,a=-1,o,u;for(;++a<=t.length;){if(a<t.length)o=t.codePointAt(a);else{if(o===47)break;o=47}if(o===47){if(!(i===a-1||s===1))if(i!==a-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=a,s=0;continue}}else if(n.length>0){n="",r=0,i=a,s=0;continue}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(i+1,a):n=t.slice(i+1,a),r=a-i-1;i=a,s=0}else o===46&&s>-1?s++:s=-1}return n}function zr(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const Ty={cwd:_y};function _y(){return"/"}function Xs(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function yy(t){if(typeof t=="string")t=new URL(t);else if(!Xs(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return ky(t)}function ky(t){if(t.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const e=t.pathname;let n=-1;for(;++n<e.length;)if(e.codePointAt(n)===37&&e.codePointAt(n+1)===50){const r=e.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(e)}const cs=["history","path","basename","stem","extname","dirname"];class zd{constructor(e){let n;e?Xs(e)?n={path:e}:typeof e=="string"||Ay(e)?n={value:e}:n=e:n={},this.cwd="cwd"in n?"":Ty.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<cs.length;){const s=cs[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)cs.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?It.basename(this.path):void 0}set basename(e){fs(e,"basename"),ds(e,"basename"),this.path=It.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?It.dirname(this.path):void 0}set dirname(e){Su(this.basename,"dirname"),this.path=It.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?It.extname(this.path):void 0}set extname(e){if(ds(e,"extname"),Su(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=It.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){Xs(e)&&(e=yy(e)),fs(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?It.basename(this.path,this.extname):void 0}set stem(e){fs(e,"stem"),ds(e,"stem"),this.path=It.join(this.dirname||"",e+(this.extname||""))}fail(e,n,r){const i=this.message(e,n,r);throw i.fatal=!0,i}info(e,n,r){const i=this.message(e,n,r);return i.fatal=void 0,i}message(e,n,r){const i=new Qe(e,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function ds(t,e){if(t&&t.includes(It.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+It.sep+"`")}function fs(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function Su(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}function Ay(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const Sy=(function(t){const r=this.constructor.prototype,i=r[t],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s}),Cy={}.hasOwnProperty;class za extends Sy{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=fy()}copy(){const e=new za;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];e.use(...r)}return e.data(ls(!0,{},this.namespace)),e}data(e,n){return typeof e=="string"?arguments.length===2?(ms("data",this.frozen),this.namespace[e]=n,this):Cy.call(this.namespace,e)&&this.namespace[e]||void 0:e?(ms("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(e,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const n=Gr(e),r=this.parser||this.Parser;return hs("parse",r),r(String(n),n)}process(e,n){const r=this;return this.freeze(),hs("process",this.parser||this.Parser),ps("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,a){const o=Gr(e),u=r.parse(o);r.run(u,o,function(d,c,h){if(d||!c||!h)return l(d);const p=c,g=r.stringify(p,h);wy(g)?h.value=g:h.result=g,l(d,h)});function l(d,c){d||!c?a(d):s?s(c):n(void 0,c)}}}processSync(e){let n=!1,r;return this.freeze(),hs("processSync",this.parser||this.Parser),ps("processSync",this.compiler||this.Compiler),this.process(e,i),Iu("processSync","process",n),r;function i(s,a){n=!0,ku(s),r=a}}run(e,n,r){Cu(e),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(a,o){const u=Gr(n);i.run(e,u,l);function l(d,c,h){const p=c||e;d?o(d):a?a(p):r(void 0,p,h)}}}runSync(e,n){let r=!1,i;return this.run(e,n,s),Iu("runSync","run",r),i;function s(a,o){ku(a),i=o,r=!0}}stringify(e,n){this.freeze();const r=Gr(n),i=this.compiler||this.Compiler;return ps("stringify",i),Cu(e),i(e,r)}use(e,...n){const r=this.attachers,i=this.namespace;if(ms("use",this.frozen),e!=null)if(typeof e=="function")u(e,n);else if(typeof e=="object")Array.isArray(e)?o(e):a(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function s(l){if(typeof l=="function")u(l,[]);else if(typeof l=="object")if(Array.isArray(l)){const[d,...c]=l;u(d,c)}else a(l);else throw new TypeError("Expected usable value, not `"+l+"`")}function a(l){if(!("plugins"in l)&&!("settings"in l))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(l.plugins),l.settings&&(i.settings=ls(!0,i.settings,l.settings))}function o(l){let d=-1;if(l!=null)if(Array.isArray(l))for(;++d<l.length;){const c=l[d];s(c)}else throw new TypeError("Expected a list of plugins, not `"+l+"`")}function u(l,d){let c=-1,h=-1;for(;++c<r.length;)if(r[c][0]===l){h=c;break}if(h===-1)r.push([l,...d]);else if(d.length>0){let[p,...g]=d;const b=r[h][1];Qs(b)&&Qs(p)&&(p=ls(!0,b,p)),r[h]=[l,p,...g]}}}}const Iy=new za().freeze();function hs(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function ps(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function ms(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Cu(t){if(!Qs(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function Iu(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function Gr(t){return Ny(t)?t:new zd(t)}function Ny(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function wy(t){return typeof t=="string"||vy(t)}function vy(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const Ry="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Nu=[],wu={allowDangerousHtml:!0},Oy=/^(https?|ircs?|mailto|xmpp)$/i,Ly=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Dy(t){const e=Py(t),n=My(t);return By(e.runSync(e.parse(n),n),t)}function Py(t){const e=t.rehypePlugins||Nu,n=t.remarkPlugins||Nu,r=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...wu}:wu;return Iy().use(m_).use(n).use(ly,r).use(e)}function My(t){const e=t.children||"",n=new zd;return typeof e=="string"&&(n.value=e),n}function By(t,e){const n=e.allowedElements,r=e.allowElement,i=e.components,s=e.disallowedElements,a=e.skipHtml,o=e.unwrapDisallowed,u=e.urlTransform||Fy;for(const d of Ly)Object.hasOwn(e,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+Ry+d.id,void 0);return e.className&&(t={type:"element",tagName:"div",properties:{className:e.className},children:t.type==="root"?t.children:[t]}),Ui(t,l),X2(t,{Fragment:m.Fragment,components:i,ignoreInvalidStyle:!0,jsx:m.jsx,jsxs:m.jsxs,passKeys:!0,passNode:!0});function l(d,c,h){if(d.type==="raw"&&h&&typeof c=="number")return a?h.children.splice(c,1):h.children[c]={type:"text",value:d.value},c;if(d.type==="element"){let p;for(p in ss)if(Object.hasOwn(ss,p)&&Object.hasOwn(d.properties,p)){const g=d.properties[p],b=ss[p];(b===null||b.includes(d.tagName))&&(d.properties[p]=u(String(g||""),p,d))}}if(d.type==="element"){let p=n?!n.includes(d.tagName):s?s.includes(d.tagName):!1;if(!p&&r&&typeof c=="number"&&(p=!r(d,c,h)),p&&h&&typeof c=="number")return o&&d.children?h.children.splice(c,1,...d.children):h.children.splice(c,1),c}}}function Fy(t){const e=t.indexOf(":"),n=t.indexOf("?"),r=t.indexOf("#"),i=t.indexOf("/");return e===-1||i!==-1&&e>i||n!==-1&&e>n||r!==-1&&e>r||Oy.test(t.slice(0,e))?t:""}const vu=/[#.]/g;function zy(t,e){const n=t||"",r={};let i=0,s,a;for(;i<n.length;){vu.lastIndex=i;const o=vu.exec(n),u=n.slice(i,o?o.index:n.length);u&&(s?s==="#"?r.id=u:Array.isArray(r.className)?r.className.push(u):r.className=[u]:a=u,i+=u.length),o&&(s=o[0],i++)}return{type:"element",tagName:a||e||"div",properties:r,children:[]}}function jd(t,e,n){const r=n?$y(n):void 0;function i(s,a,...o){let u;if(s==null){u={type:"root",children:[]};const l=a;o.unshift(l)}else{u=zy(s,e);const l=u.tagName.toLowerCase(),d=r?r.get(l):void 0;if(u.tagName=d||l,jy(a))o.unshift(a);else for(const[c,h]of Object.entries(a))Uy(t,u.properties,c,h)}for(const l of o)Js(u.children,l);return u.type==="element"&&u.tagName==="template"&&(u.content={type:"root",children:u.children},u.children=[]),u}return i}function jy(t){if(t===null||typeof t!="object"||Array.isArray(t))return!0;if(typeof t.type!="string")return!1;const e=t,n=Object.keys(t);for(const r of n){const i=e[r];if(i&&typeof i=="object"){if(!Array.isArray(i))return!0;const s=i;for(const a of s)if(typeof a!="number"&&typeof a!="string")return!0}}return!!("children"in t&&Array.isArray(t.children))}function Uy(t,e,n,r){const i=Di(t,n);let s;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;s=r}else typeof r=="boolean"?s=r:typeof r=="string"?i.spaceSeparated?s=Qo(r):i.commaSeparated?s=qo(r):i.commaOrSpaceSeparated?s=Qo(qo(r).join(" ")):s=Ru(i,i.property,r):Array.isArray(r)?s=[...r]:s=i.property==="style"?Hy(r):String(r);if(Array.isArray(s)){const a=[];for(const o of s)a.push(Ru(i,i.property,o));s=a}i.property==="className"&&Array.isArray(e.className)&&(s=e.className.concat(s)),e[i.property]=s}}function Js(t,e){if(e!=null)if(typeof e=="number"||typeof e=="string")t.push({type:"text",value:String(e)});else if(Array.isArray(e))for(const n of e)Js(t,n);else if(typeof e=="object"&&"type"in e)e.type==="root"?Js(t,e.children):t.push(e);else throw new Error("Expected node, nodes, or string, got `"+e+"`")}function Ru(t,e,n){if(typeof n=="string"){if(t.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((t.boolean||t.overloadedBoolean)&&(n===""||kr(n)===kr(e)))return!0}return n}function Hy(t){const e=[];for(const[n,r]of Object.entries(t))e.push([n,r].join(": "));return e.join("; ")}function $y(t){const e=new Map;for(const n of t)e.set(n.toLowerCase(),n);return e}const Zy=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],Yy=jd(Br,"div"),qy=jd(Wt,"g",Zy);function Vy(t){const e=String(t),n=[];return{toOffset:i,toPoint:r};function r(s){if(typeof s=="number"&&s>-1&&s<=e.length){let a=0;for(;;){let o=n[a];if(o===void 0){const u=Ou(e,n[a-1]);o=u===-1?e.length+1:u+1,n[a]=o}if(o>s)return{line:a+1,column:s-(a>0?n[a-1]:0)+1,offset:s};a++}}}function i(s){if(s&&typeof s.line=="number"&&typeof s.column=="number"&&!Number.isNaN(s.line)&&!Number.isNaN(s.column)){for(;n.length<s.line;){const o=n[n.length-1],u=Ou(e,o),l=u===-1?e.length+1:u+1;if(o===l)break;n.push(l)}const a=(s.line>1?n[s.line-2]:0)+s.column-1;if(a<n[s.line-1])return a}}}function Ou(t,e){const n=t.indexOf("\r",e),r=t.indexOf(`
|
|
108
|
-
`,e);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const un={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},Ud={}.hasOwnProperty,Wy=Object.prototype;function Gy(t,e){const n=e||{};return ja({file:n.file||void 0,location:!1,schema:n.space==="svg"?Wt:Br,verbose:n.verbose||!1},t)}function ja(t,e){let n;switch(e.nodeName){case"#comment":{const r=e;return n={type:"comment",value:r.data},oi(t,r,n),n}case"#document":case"#document-fragment":{const r=e,i="mode"in r?r.mode==="quirks"||r.mode==="limited-quirks":!1;if(n={type:"root",children:Hd(t,e.childNodes),data:{quirksMode:i}},t.file&&t.location){const s=String(t.file),a=Vy(s),o=a.toPoint(0),u=a.toPoint(s.length);n.position={start:o,end:u}}return n}case"#documentType":{const r=e;return n={type:"doctype"},oi(t,r,n),n}case"#text":{const r=e;return n={type:"text",value:r.value},oi(t,r,n),n}default:return n=Ky(t,e),n}}function Hd(t,e){let n=-1;const r=[];for(;++n<e.length;){const i=ja(t,e[n]);r.push(i)}return r}function Ky(t,e){const n=t.schema;t.schema=e.namespaceURI===un.svg?Wt:Br;let r=-1;const i={};for(;++r<e.attrs.length;){const o=e.attrs[r],u=(o.prefix?o.prefix+":":"")+o.name;Ud.call(Wy,u)||(i[u]=o.value)}const a=(t.schema.space==="svg"?qy:Yy)(e.tagName,i,Hd(t,e.childNodes));if(oi(t,e,a),a.tagName==="template"){const o=e,u=o.sourceCodeLocation,l=u&&u.startTag&&Nn(u.startTag),d=u&&u.endTag&&Nn(u.endTag),c=ja(t,o.content);l&&d&&t.file&&(c.position={start:l.end,end:d.start}),a.content=c}return t.schema=n,a}function oi(t,e,n){if("sourceCodeLocation"in e&&e.sourceCodeLocation&&t.file){const r=Qy(t,n,e.sourceCodeLocation);r&&(t.location=!0,n.position=r)}}function Qy(t,e,n){const r=Nn(n);if(e.type==="element"){const i=e.children[e.children.length-1];if(r&&!n.endTag&&i&&i.position&&i.position.end&&(r.end=Object.assign({},i.position.end)),t.verbose){const s={};let a;if(n.attrs)for(a in n.attrs)Ud.call(n.attrs,a)&&(s[Di(t.schema,a).property]=Nn(n.attrs[a]));n.startTag;const o=Nn(n.startTag),u=n.endTag?Nn(n.endTag):void 0,l={opening:o};u&&(l.closing=u),l.properties=s,e.data={position:l}}}return r}function Nn(t){const e=Lu({line:t.startLine,column:t.startCol,offset:t.startOffset}),n=Lu({line:t.endLine,column:t.endCol,offset:t.endOffset});return e||n?{start:e,end:n}:void 0}function Lu(t){return t.line&&t.column?t:void 0}const Du={}.hasOwnProperty;function $d(t,e){const n=e||{};function r(i,...s){let a=r.invalid;const o=r.handlers;if(i&&Du.call(i,t)){const u=String(i[t]);a=Du.call(o,u)?o[u]:r.unknown}if(a)return a.call(this,i,...s)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const Xy={},Jy={}.hasOwnProperty,Zd=$d("type",{handlers:{root:t3,element:a3,text:i3,comment:s3,doctype:r3}});function e3(t,e){const r=(e||Xy).space;return Zd(t,r==="svg"?Wt:Br)}function t3(t,e){const n={nodeName:"#document",mode:(t.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=Ua(t.children,n,e),Hn(t,n),n}function n3(t,e){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=Ua(t.children,n,e),Hn(t,n),n}function r3(t){const e={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return Hn(t,e),e}function i3(t){const e={nodeName:"#text",value:t.value,parentNode:null};return Hn(t,e),e}function s3(t){const e={nodeName:"#comment",data:t.value,parentNode:null};return Hn(t,e),e}function a3(t,e){const n=e;let r=n;t.type==="element"&&t.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=Wt);const i=[];let s;if(t.properties){for(s in t.properties)if(s!=="children"&&Jy.call(t.properties,s)){const u=o3(r,s,t.properties[s]);u&&i.push(u)}}const a=r.space,o={nodeName:t.tagName,tagName:t.tagName,attrs:i,namespaceURI:un[a],childNodes:[],parentNode:null};return o.childNodes=Ua(t.children,o,r),Hn(t,o),t.tagName==="template"&&t.content&&(o.content=n3(t.content,r)),o}function o3(t,e,n){const r=Di(t,e);if(n===!1||n===null||n===void 0||typeof n=="number"&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?id(n):fd(n));const i={name:r.attribute,value:n===!0?"":String(n)};if(r.space&&r.space!=="html"&&r.space!=="svg"){const s=i.name.indexOf(":");s<0?i.prefix="":(i.name=i.name.slice(s+1),i.prefix=r.attribute.slice(0,s)),i.namespace=un[r.space]}return i}function Ua(t,e,n){let r=-1;const i=[];if(t)for(;++r<t.length;){const s=Zd(t[r],n);s.parentNode=e,i.push(s)}return i}function Hn(t,e){const n=t.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,e.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}const u3=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],l3=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),Le="�";var A;(function(t){t[t.EOF=-1]="EOF",t[t.NULL=0]="NULL",t[t.TABULATION=9]="TABULATION",t[t.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",t[t.LINE_FEED=10]="LINE_FEED",t[t.FORM_FEED=12]="FORM_FEED",t[t.SPACE=32]="SPACE",t[t.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",t[t.QUOTATION_MARK=34]="QUOTATION_MARK",t[t.AMPERSAND=38]="AMPERSAND",t[t.APOSTROPHE=39]="APOSTROPHE",t[t.HYPHEN_MINUS=45]="HYPHEN_MINUS",t[t.SOLIDUS=47]="SOLIDUS",t[t.DIGIT_0=48]="DIGIT_0",t[t.DIGIT_9=57]="DIGIT_9",t[t.SEMICOLON=59]="SEMICOLON",t[t.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",t[t.EQUALS_SIGN=61]="EQUALS_SIGN",t[t.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",t[t.QUESTION_MARK=63]="QUESTION_MARK",t[t.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",t[t.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",t[t.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",t[t.GRAVE_ACCENT=96]="GRAVE_ACCENT",t[t.LATIN_SMALL_A=97]="LATIN_SMALL_A",t[t.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(A||(A={}));const nt={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function Yd(t){return t>=55296&&t<=57343}function c3(t){return t>=56320&&t<=57343}function d3(t,e){return(t-55296)*1024+9216+e}function qd(t){return t!==32&&t!==10&&t!==13&&t!==9&&t!==12&&t>=1&&t<=31||t>=127&&t<=159}function Vd(t){return t>=64976&&t<=65007||l3.has(t)}var M;(function(t){t.controlCharacterInInputStream="control-character-in-input-stream",t.noncharacterInInputStream="noncharacter-in-input-stream",t.surrogateInInputStream="surrogate-in-input-stream",t.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",t.endTagWithAttributes="end-tag-with-attributes",t.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",t.unexpectedSolidusInTag="unexpected-solidus-in-tag",t.unexpectedNullCharacter="unexpected-null-character",t.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",t.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",t.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",t.missingEndTagName="missing-end-tag-name",t.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",t.unknownNamedCharacterReference="unknown-named-character-reference",t.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",t.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",t.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",t.eofBeforeTagName="eof-before-tag-name",t.eofInTag="eof-in-tag",t.missingAttributeValue="missing-attribute-value",t.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",t.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",t.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",t.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",t.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",t.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",t.missingDoctypePublicIdentifier="missing-doctype-public-identifier",t.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",t.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",t.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",t.cdataInHtmlContent="cdata-in-html-content",t.incorrectlyOpenedComment="incorrectly-opened-comment",t.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",t.eofInDoctype="eof-in-doctype",t.nestedComment="nested-comment",t.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",t.eofInComment="eof-in-comment",t.incorrectlyClosedComment="incorrectly-closed-comment",t.eofInCdata="eof-in-cdata",t.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",t.nullCharacterReference="null-character-reference",t.surrogateCharacterReference="surrogate-character-reference",t.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",t.controlCharacterReference="control-character-reference",t.noncharacterCharacterReference="noncharacter-character-reference",t.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",t.missingDoctypeName="missing-doctype-name",t.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",t.duplicateAttribute="duplicate-attribute",t.nonConformingDoctype="non-conforming-doctype",t.missingDoctype="missing-doctype",t.misplacedDoctype="misplaced-doctype",t.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",t.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",t.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",t.openElementsLeftAfterEof="open-elements-left-after-eof",t.abandonedHeadElementChild="abandoned-head-element-child",t.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",t.nestedNoscriptInHead="nested-noscript-in-head",t.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(M||(M={}));const f3=65536;class h3{constructor(e){this.handler=e,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=f3,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e,n){const{line:r,col:i,offset:s}=this,a=i+n,o=s+n;return{code:e,startLine:r,endLine:r,startCol:a,endCol:a,startOffset:o,endOffset:o}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(c3(n))return this.pos++,this._addGap(),d3(e,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,A.EOF;return this._err(M.surrogateInInputStream),e}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(e,n){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,n){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(e,this.pos);for(let r=0;r<e.length;r++)if((this.html.charCodeAt(this.pos+r)|32)!==e.charCodeAt(r))return!1;return!0}peek(e){const n=this.pos+e;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,A.EOF;const r=this.html.charCodeAt(n);return r===A.CARRIAGE_RETURN?A.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,A.EOF;let e=this.html.charCodeAt(this.pos);return e===A.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,A.LINE_FEED):e===A.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,Yd(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===A.LINE_FEED||e===A.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){qd(e)?this._err(M.controlCharacterInInputStream):Vd(e)&&this._err(M.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var me;(function(t){t[t.CHARACTER=0]="CHARACTER",t[t.NULL_CHARACTER=1]="NULL_CHARACTER",t[t.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",t[t.START_TAG=3]="START_TAG",t[t.END_TAG=4]="END_TAG",t[t.COMMENT=5]="COMMENT",t[t.DOCTYPE=6]="DOCTYPE",t[t.EOF=7]="EOF",t[t.HIBERNATION=8]="HIBERNATION"})(me||(me={}));function Wd(t,e){for(let n=t.attrs.length-1;n>=0;n--)if(t.attrs[n].name===e)return t.attrs[n].value;return null}const p3=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(t=>t.charCodeAt(0))),m3=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function g3(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=m3.get(t))!==null&&e!==void 0?e:t}var Ve;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(Ve||(Ve={}));const b3=32;var qt;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(qt||(qt={}));function ea(t){return t>=Ve.ZERO&&t<=Ve.NINE}function E3(t){return t>=Ve.UPPER_A&&t<=Ve.UPPER_F||t>=Ve.LOWER_A&&t<=Ve.LOWER_F}function x3(t){return t>=Ve.UPPER_A&&t<=Ve.UPPER_Z||t>=Ve.LOWER_A&&t<=Ve.LOWER_Z||ea(t)}function T3(t){return t===Ve.EQUALS||x3(t)}var qe;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(qe||(qe={}));var Pt;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(Pt||(Pt={}));class _3{constructor(e,n,r){this.decodeTree=e,this.emitCodePoint=n,this.errors=r,this.state=qe.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Pt.Strict}startEntity(e){this.decodeMode=e,this.state=qe.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,n){switch(this.state){case qe.EntityStart:return e.charCodeAt(n)===Ve.NUM?(this.state=qe.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=qe.NamedEntity,this.stateNamedEntity(e,n));case qe.NumericStart:return this.stateNumericStart(e,n);case qe.NumericDecimal:return this.stateNumericDecimal(e,n);case qe.NumericHex:return this.stateNumericHex(e,n);case qe.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|b3)===Ve.LOWER_X?(this.state=qe.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=qe.NumericDecimal,this.stateNumericDecimal(e,n))}addToNumericResult(e,n,r,i){if(n!==r){const s=r-n;this.result=this.result*Math.pow(i,s)+Number.parseInt(e.substr(n,s),i),this.consumed+=s}}stateNumericHex(e,n){const r=n;for(;n<e.length;){const i=e.charCodeAt(n);if(ea(i)||E3(i))n+=1;else return this.addToNumericResult(e,r,n,16),this.emitNumericEntity(i,3)}return this.addToNumericResult(e,r,n,16),-1}stateNumericDecimal(e,n){const r=n;for(;n<e.length;){const i=e.charCodeAt(n);if(ea(i))n+=1;else return this.addToNumericResult(e,r,n,10),this.emitNumericEntity(i,2)}return this.addToNumericResult(e,r,n,10),-1}emitNumericEntity(e,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===Ve.SEMI)this.consumed+=1;else if(this.decodeMode===Pt.Strict)return 0;return this.emitCodePoint(g3(this.result),this.consumed),this.errors&&(e!==Ve.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,n){const{decodeTree:r}=this;let i=r[this.treeIndex],s=(i&qt.VALUE_LENGTH)>>14;for(;n<e.length;n++,this.excess++){const a=e.charCodeAt(n);if(this.treeIndex=y3(r,i,this.treeIndex+Math.max(1,s),a),this.treeIndex<0)return this.result===0||this.decodeMode===Pt.Attribute&&(s===0||T3(a))?0:this.emitNotTerminatedNamedEntity();if(i=r[this.treeIndex],s=(i&qt.VALUE_LENGTH)>>14,s!==0){if(a===Ve.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==Pt.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:n,decodeTree:r}=this,i=(r[n]&qt.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,n,r){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[e]&~qt.VALUE_LENGTH:i[e+1],r),n===3&&this.emitCodePoint(i[e+2],r),r}end(){var e;switch(this.state){case qe.NamedEntity:return this.result!==0&&(this.decodeMode!==Pt.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case qe.NumericDecimal:return this.emitNumericEntity(0,2);case qe.NumericHex:return this.emitNumericEntity(0,3);case qe.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case qe.EntityStart:return 0}}}function y3(t,e,n,r){const i=(e&qt.BRANCH_LENGTH)>>7,s=e&qt.JUMP_TABLE;if(i===0)return s!==0&&r===s?n:-1;if(s){const u=r-s;return u<0||u>=i?-1:t[n+u]-1}let a=n,o=a+i-1;for(;a<=o;){const u=a+o>>>1,l=t[u];if(l<r)a=u+1;else if(l>r)o=u-1;else return t[u+i]}return-1}var $;(function(t){t.HTML="http://www.w3.org/1999/xhtml",t.MATHML="http://www.w3.org/1998/Math/MathML",t.SVG="http://www.w3.org/2000/svg",t.XLINK="http://www.w3.org/1999/xlink",t.XML="http://www.w3.org/XML/1998/namespace",t.XMLNS="http://www.w3.org/2000/xmlns/"})($||($={}));var ln;(function(t){t.TYPE="type",t.ACTION="action",t.ENCODING="encoding",t.PROMPT="prompt",t.NAME="name",t.COLOR="color",t.FACE="face",t.SIZE="size"})(ln||(ln={}));var bt;(function(t){t.NO_QUIRKS="no-quirks",t.QUIRKS="quirks",t.LIMITED_QUIRKS="limited-quirks"})(bt||(bt={}));var L;(function(t){t.A="a",t.ADDRESS="address",t.ANNOTATION_XML="annotation-xml",t.APPLET="applet",t.AREA="area",t.ARTICLE="article",t.ASIDE="aside",t.B="b",t.BASE="base",t.BASEFONT="basefont",t.BGSOUND="bgsound",t.BIG="big",t.BLOCKQUOTE="blockquote",t.BODY="body",t.BR="br",t.BUTTON="button",t.CAPTION="caption",t.CENTER="center",t.CODE="code",t.COL="col",t.COLGROUP="colgroup",t.DD="dd",t.DESC="desc",t.DETAILS="details",t.DIALOG="dialog",t.DIR="dir",t.DIV="div",t.DL="dl",t.DT="dt",t.EM="em",t.EMBED="embed",t.FIELDSET="fieldset",t.FIGCAPTION="figcaption",t.FIGURE="figure",t.FONT="font",t.FOOTER="footer",t.FOREIGN_OBJECT="foreignObject",t.FORM="form",t.FRAME="frame",t.FRAMESET="frameset",t.H1="h1",t.H2="h2",t.H3="h3",t.H4="h4",t.H5="h5",t.H6="h6",t.HEAD="head",t.HEADER="header",t.HGROUP="hgroup",t.HR="hr",t.HTML="html",t.I="i",t.IMG="img",t.IMAGE="image",t.INPUT="input",t.IFRAME="iframe",t.KEYGEN="keygen",t.LABEL="label",t.LI="li",t.LINK="link",t.LISTING="listing",t.MAIN="main",t.MALIGNMARK="malignmark",t.MARQUEE="marquee",t.MATH="math",t.MENU="menu",t.META="meta",t.MGLYPH="mglyph",t.MI="mi",t.MO="mo",t.MN="mn",t.MS="ms",t.MTEXT="mtext",t.NAV="nav",t.NOBR="nobr",t.NOFRAMES="noframes",t.NOEMBED="noembed",t.NOSCRIPT="noscript",t.OBJECT="object",t.OL="ol",t.OPTGROUP="optgroup",t.OPTION="option",t.P="p",t.PARAM="param",t.PLAINTEXT="plaintext",t.PRE="pre",t.RB="rb",t.RP="rp",t.RT="rt",t.RTC="rtc",t.RUBY="ruby",t.S="s",t.SCRIPT="script",t.SEARCH="search",t.SECTION="section",t.SELECT="select",t.SOURCE="source",t.SMALL="small",t.SPAN="span",t.STRIKE="strike",t.STRONG="strong",t.STYLE="style",t.SUB="sub",t.SUMMARY="summary",t.SUP="sup",t.TABLE="table",t.TBODY="tbody",t.TEMPLATE="template",t.TEXTAREA="textarea",t.TFOOT="tfoot",t.TD="td",t.TH="th",t.THEAD="thead",t.TITLE="title",t.TR="tr",t.TRACK="track",t.TT="tt",t.U="u",t.UL="ul",t.SVG="svg",t.VAR="var",t.WBR="wbr",t.XMP="xmp"})(L||(L={}));var f;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.A=1]="A",t[t.ADDRESS=2]="ADDRESS",t[t.ANNOTATION_XML=3]="ANNOTATION_XML",t[t.APPLET=4]="APPLET",t[t.AREA=5]="AREA",t[t.ARTICLE=6]="ARTICLE",t[t.ASIDE=7]="ASIDE",t[t.B=8]="B",t[t.BASE=9]="BASE",t[t.BASEFONT=10]="BASEFONT",t[t.BGSOUND=11]="BGSOUND",t[t.BIG=12]="BIG",t[t.BLOCKQUOTE=13]="BLOCKQUOTE",t[t.BODY=14]="BODY",t[t.BR=15]="BR",t[t.BUTTON=16]="BUTTON",t[t.CAPTION=17]="CAPTION",t[t.CENTER=18]="CENTER",t[t.CODE=19]="CODE",t[t.COL=20]="COL",t[t.COLGROUP=21]="COLGROUP",t[t.DD=22]="DD",t[t.DESC=23]="DESC",t[t.DETAILS=24]="DETAILS",t[t.DIALOG=25]="DIALOG",t[t.DIR=26]="DIR",t[t.DIV=27]="DIV",t[t.DL=28]="DL",t[t.DT=29]="DT",t[t.EM=30]="EM",t[t.EMBED=31]="EMBED",t[t.FIELDSET=32]="FIELDSET",t[t.FIGCAPTION=33]="FIGCAPTION",t[t.FIGURE=34]="FIGURE",t[t.FONT=35]="FONT",t[t.FOOTER=36]="FOOTER",t[t.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",t[t.FORM=38]="FORM",t[t.FRAME=39]="FRAME",t[t.FRAMESET=40]="FRAMESET",t[t.H1=41]="H1",t[t.H2=42]="H2",t[t.H3=43]="H3",t[t.H4=44]="H4",t[t.H5=45]="H5",t[t.H6=46]="H6",t[t.HEAD=47]="HEAD",t[t.HEADER=48]="HEADER",t[t.HGROUP=49]="HGROUP",t[t.HR=50]="HR",t[t.HTML=51]="HTML",t[t.I=52]="I",t[t.IMG=53]="IMG",t[t.IMAGE=54]="IMAGE",t[t.INPUT=55]="INPUT",t[t.IFRAME=56]="IFRAME",t[t.KEYGEN=57]="KEYGEN",t[t.LABEL=58]="LABEL",t[t.LI=59]="LI",t[t.LINK=60]="LINK",t[t.LISTING=61]="LISTING",t[t.MAIN=62]="MAIN",t[t.MALIGNMARK=63]="MALIGNMARK",t[t.MARQUEE=64]="MARQUEE",t[t.MATH=65]="MATH",t[t.MENU=66]="MENU",t[t.META=67]="META",t[t.MGLYPH=68]="MGLYPH",t[t.MI=69]="MI",t[t.MO=70]="MO",t[t.MN=71]="MN",t[t.MS=72]="MS",t[t.MTEXT=73]="MTEXT",t[t.NAV=74]="NAV",t[t.NOBR=75]="NOBR",t[t.NOFRAMES=76]="NOFRAMES",t[t.NOEMBED=77]="NOEMBED",t[t.NOSCRIPT=78]="NOSCRIPT",t[t.OBJECT=79]="OBJECT",t[t.OL=80]="OL",t[t.OPTGROUP=81]="OPTGROUP",t[t.OPTION=82]="OPTION",t[t.P=83]="P",t[t.PARAM=84]="PARAM",t[t.PLAINTEXT=85]="PLAINTEXT",t[t.PRE=86]="PRE",t[t.RB=87]="RB",t[t.RP=88]="RP",t[t.RT=89]="RT",t[t.RTC=90]="RTC",t[t.RUBY=91]="RUBY",t[t.S=92]="S",t[t.SCRIPT=93]="SCRIPT",t[t.SEARCH=94]="SEARCH",t[t.SECTION=95]="SECTION",t[t.SELECT=96]="SELECT",t[t.SOURCE=97]="SOURCE",t[t.SMALL=98]="SMALL",t[t.SPAN=99]="SPAN",t[t.STRIKE=100]="STRIKE",t[t.STRONG=101]="STRONG",t[t.STYLE=102]="STYLE",t[t.SUB=103]="SUB",t[t.SUMMARY=104]="SUMMARY",t[t.SUP=105]="SUP",t[t.TABLE=106]="TABLE",t[t.TBODY=107]="TBODY",t[t.TEMPLATE=108]="TEMPLATE",t[t.TEXTAREA=109]="TEXTAREA",t[t.TFOOT=110]="TFOOT",t[t.TD=111]="TD",t[t.TH=112]="TH",t[t.THEAD=113]="THEAD",t[t.TITLE=114]="TITLE",t[t.TR=115]="TR",t[t.TRACK=116]="TRACK",t[t.TT=117]="TT",t[t.U=118]="U",t[t.UL=119]="UL",t[t.SVG=120]="SVG",t[t.VAR=121]="VAR",t[t.WBR=122]="WBR",t[t.XMP=123]="XMP"})(f||(f={}));const k3=new Map([[L.A,f.A],[L.ADDRESS,f.ADDRESS],[L.ANNOTATION_XML,f.ANNOTATION_XML],[L.APPLET,f.APPLET],[L.AREA,f.AREA],[L.ARTICLE,f.ARTICLE],[L.ASIDE,f.ASIDE],[L.B,f.B],[L.BASE,f.BASE],[L.BASEFONT,f.BASEFONT],[L.BGSOUND,f.BGSOUND],[L.BIG,f.BIG],[L.BLOCKQUOTE,f.BLOCKQUOTE],[L.BODY,f.BODY],[L.BR,f.BR],[L.BUTTON,f.BUTTON],[L.CAPTION,f.CAPTION],[L.CENTER,f.CENTER],[L.CODE,f.CODE],[L.COL,f.COL],[L.COLGROUP,f.COLGROUP],[L.DD,f.DD],[L.DESC,f.DESC],[L.DETAILS,f.DETAILS],[L.DIALOG,f.DIALOG],[L.DIR,f.DIR],[L.DIV,f.DIV],[L.DL,f.DL],[L.DT,f.DT],[L.EM,f.EM],[L.EMBED,f.EMBED],[L.FIELDSET,f.FIELDSET],[L.FIGCAPTION,f.FIGCAPTION],[L.FIGURE,f.FIGURE],[L.FONT,f.FONT],[L.FOOTER,f.FOOTER],[L.FOREIGN_OBJECT,f.FOREIGN_OBJECT],[L.FORM,f.FORM],[L.FRAME,f.FRAME],[L.FRAMESET,f.FRAMESET],[L.H1,f.H1],[L.H2,f.H2],[L.H3,f.H3],[L.H4,f.H4],[L.H5,f.H5],[L.H6,f.H6],[L.HEAD,f.HEAD],[L.HEADER,f.HEADER],[L.HGROUP,f.HGROUP],[L.HR,f.HR],[L.HTML,f.HTML],[L.I,f.I],[L.IMG,f.IMG],[L.IMAGE,f.IMAGE],[L.INPUT,f.INPUT],[L.IFRAME,f.IFRAME],[L.KEYGEN,f.KEYGEN],[L.LABEL,f.LABEL],[L.LI,f.LI],[L.LINK,f.LINK],[L.LISTING,f.LISTING],[L.MAIN,f.MAIN],[L.MALIGNMARK,f.MALIGNMARK],[L.MARQUEE,f.MARQUEE],[L.MATH,f.MATH],[L.MENU,f.MENU],[L.META,f.META],[L.MGLYPH,f.MGLYPH],[L.MI,f.MI],[L.MO,f.MO],[L.MN,f.MN],[L.MS,f.MS],[L.MTEXT,f.MTEXT],[L.NAV,f.NAV],[L.NOBR,f.NOBR],[L.NOFRAMES,f.NOFRAMES],[L.NOEMBED,f.NOEMBED],[L.NOSCRIPT,f.NOSCRIPT],[L.OBJECT,f.OBJECT],[L.OL,f.OL],[L.OPTGROUP,f.OPTGROUP],[L.OPTION,f.OPTION],[L.P,f.P],[L.PARAM,f.PARAM],[L.PLAINTEXT,f.PLAINTEXT],[L.PRE,f.PRE],[L.RB,f.RB],[L.RP,f.RP],[L.RT,f.RT],[L.RTC,f.RTC],[L.RUBY,f.RUBY],[L.S,f.S],[L.SCRIPT,f.SCRIPT],[L.SEARCH,f.SEARCH],[L.SECTION,f.SECTION],[L.SELECT,f.SELECT],[L.SOURCE,f.SOURCE],[L.SMALL,f.SMALL],[L.SPAN,f.SPAN],[L.STRIKE,f.STRIKE],[L.STRONG,f.STRONG],[L.STYLE,f.STYLE],[L.SUB,f.SUB],[L.SUMMARY,f.SUMMARY],[L.SUP,f.SUP],[L.TABLE,f.TABLE],[L.TBODY,f.TBODY],[L.TEMPLATE,f.TEMPLATE],[L.TEXTAREA,f.TEXTAREA],[L.TFOOT,f.TFOOT],[L.TD,f.TD],[L.TH,f.TH],[L.THEAD,f.THEAD],[L.TITLE,f.TITLE],[L.TR,f.TR],[L.TRACK,f.TRACK],[L.TT,f.TT],[L.U,f.U],[L.UL,f.UL],[L.SVG,f.SVG],[L.VAR,f.VAR],[L.WBR,f.WBR],[L.XMP,f.XMP]]);function $n(t){var e;return(e=k3.get(t))!==null&&e!==void 0?e:f.UNKNOWN}const Z=f,A3={[$.HTML]:new Set([Z.ADDRESS,Z.APPLET,Z.AREA,Z.ARTICLE,Z.ASIDE,Z.BASE,Z.BASEFONT,Z.BGSOUND,Z.BLOCKQUOTE,Z.BODY,Z.BR,Z.BUTTON,Z.CAPTION,Z.CENTER,Z.COL,Z.COLGROUP,Z.DD,Z.DETAILS,Z.DIR,Z.DIV,Z.DL,Z.DT,Z.EMBED,Z.FIELDSET,Z.FIGCAPTION,Z.FIGURE,Z.FOOTER,Z.FORM,Z.FRAME,Z.FRAMESET,Z.H1,Z.H2,Z.H3,Z.H4,Z.H5,Z.H6,Z.HEAD,Z.HEADER,Z.HGROUP,Z.HR,Z.HTML,Z.IFRAME,Z.IMG,Z.INPUT,Z.LI,Z.LINK,Z.LISTING,Z.MAIN,Z.MARQUEE,Z.MENU,Z.META,Z.NAV,Z.NOEMBED,Z.NOFRAMES,Z.NOSCRIPT,Z.OBJECT,Z.OL,Z.P,Z.PARAM,Z.PLAINTEXT,Z.PRE,Z.SCRIPT,Z.SECTION,Z.SELECT,Z.SOURCE,Z.STYLE,Z.SUMMARY,Z.TABLE,Z.TBODY,Z.TD,Z.TEMPLATE,Z.TEXTAREA,Z.TFOOT,Z.TH,Z.THEAD,Z.TITLE,Z.TR,Z.TRACK,Z.UL,Z.WBR,Z.XMP]),[$.MATHML]:new Set([Z.MI,Z.MO,Z.MN,Z.MS,Z.MTEXT,Z.ANNOTATION_XML]),[$.SVG]:new Set([Z.TITLE,Z.FOREIGN_OBJECT,Z.DESC]),[$.XLINK]:new Set,[$.XML]:new Set,[$.XMLNS]:new Set},ta=new Set([Z.H1,Z.H2,Z.H3,Z.H4,Z.H5,Z.H6]);L.STYLE,L.SCRIPT,L.XMP,L.IFRAME,L.NOEMBED,L.NOFRAMES,L.PLAINTEXT;var C;(function(t){t[t.DATA=0]="DATA",t[t.RCDATA=1]="RCDATA",t[t.RAWTEXT=2]="RAWTEXT",t[t.SCRIPT_DATA=3]="SCRIPT_DATA",t[t.PLAINTEXT=4]="PLAINTEXT",t[t.TAG_OPEN=5]="TAG_OPEN",t[t.END_TAG_OPEN=6]="END_TAG_OPEN",t[t.TAG_NAME=7]="TAG_NAME",t[t.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",t[t.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",t[t.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",t[t.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",t[t.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",t[t.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",t[t.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",t[t.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",t[t.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",t[t.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",t[t.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",t[t.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",t[t.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",t[t.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",t[t.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",t[t.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",t[t.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",t[t.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",t[t.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",t[t.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",t[t.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",t[t.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",t[t.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",t[t.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",t[t.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",t[t.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",t[t.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",t[t.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",t[t.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",t[t.BOGUS_COMMENT=40]="BOGUS_COMMENT",t[t.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",t[t.COMMENT_START=42]="COMMENT_START",t[t.COMMENT_START_DASH=43]="COMMENT_START_DASH",t[t.COMMENT=44]="COMMENT",t[t.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",t[t.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",t[t.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",t[t.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",t[t.COMMENT_END_DASH=49]="COMMENT_END_DASH",t[t.COMMENT_END=50]="COMMENT_END",t[t.COMMENT_END_BANG=51]="COMMENT_END_BANG",t[t.DOCTYPE=52]="DOCTYPE",t[t.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",t[t.DOCTYPE_NAME=54]="DOCTYPE_NAME",t[t.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",t[t.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",t[t.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",t[t.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",t[t.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",t[t.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",t[t.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",t[t.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",t[t.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",t[t.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",t[t.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",t[t.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",t[t.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",t[t.CDATA_SECTION=68]="CDATA_SECTION",t[t.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",t[t.CDATA_SECTION_END=70]="CDATA_SECTION_END",t[t.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",t[t.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(C||(C={}));const Ue={DATA:C.DATA,RCDATA:C.RCDATA,RAWTEXT:C.RAWTEXT,SCRIPT_DATA:C.SCRIPT_DATA,PLAINTEXT:C.PLAINTEXT,CDATA_SECTION:C.CDATA_SECTION};function S3(t){return t>=A.DIGIT_0&&t<=A.DIGIT_9}function or(t){return t>=A.LATIN_CAPITAL_A&&t<=A.LATIN_CAPITAL_Z}function C3(t){return t>=A.LATIN_SMALL_A&&t<=A.LATIN_SMALL_Z}function $t(t){return C3(t)||or(t)}function Pu(t){return $t(t)||S3(t)}function Kr(t){return t+32}function Gd(t){return t===A.SPACE||t===A.LINE_FEED||t===A.TABULATION||t===A.FORM_FEED}function Mu(t){return Gd(t)||t===A.SOLIDUS||t===A.GREATER_THAN_SIGN}function I3(t){return t===A.NULL?M.nullCharacterReference:t>1114111?M.characterReferenceOutsideUnicodeRange:Yd(t)?M.surrogateCharacterReference:Vd(t)?M.noncharacterCharacterReference:qd(t)||t===A.CARRIAGE_RETURN?M.controlCharacterReference:null}class N3{constructor(e,n){this.options=e,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=C.DATA,this.returnState=C.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new h3(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new _3(p3,(r,i)=>{this.preprocessor.pos=this.entityStartPos+i-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(M.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(M.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const i=I3(r);i&&this._err(i,1)}}:void 0)}_err(e,n=0){var r,i;(i=(r=this.handler).onParseError)===null||i===void 0||i.call(r,this.preprocessor.getError(e,n))}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||e?.())}write(e,n,r){this.active=!0,this.preprocessor.write(e,n),this._runParsingLoop(),this.paused||r?.()}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(e){this.consumedAfterSnapshot+=e;for(let n=0;n<e;n++)this.preprocessor.advance()}_consumeSequenceIfMatch(e,n){return this.preprocessor.startsWith(e,n)?(this._advanceBy(e.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:me.START_TAG,tagName:"",tagID:f.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:me.END_TAG,tagName:"",tagID:f.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:me.COMMENT,data:"",location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:me.DOCTYPE,name:e,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(e,n){this.currentCharacterToken={type:e,chars:n,location:this.currentLocation}}_createAttr(e){this.currentAttr={name:e,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var e,n;const r=this.currentToken;if(Wd(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const i=(e=(n=r.location).attrs)!==null&&e!==void 0?e:n.attrs=Object.create(null);i[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(M.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(e){this._emitCurrentCharacterToken(e.location),this.currentToken=null,e.location&&(e.location.endLine=this.preprocessor.line,e.location.endCol=this.preprocessor.col+1,e.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const e=this.currentToken;this.prepareToken(e),e.tagID=$n(e.tagName),e.type===me.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(M.endTagWithAttributes),e.selfClosing&&this._err(M.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case me.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case me.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case me.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:me.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===e){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(e,n)}_emitCodePoint(e){const n=Gd(e)?me.WHITESPACE_CHARACTER:e===A.NULL?me.NULL_CHARACTER:me.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(me.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=C.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?Pt.Attribute:Pt.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===C.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===C.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===C.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case C.DATA:{this._stateData(e);break}case C.RCDATA:{this._stateRcdata(e);break}case C.RAWTEXT:{this._stateRawtext(e);break}case C.SCRIPT_DATA:{this._stateScriptData(e);break}case C.PLAINTEXT:{this._statePlaintext(e);break}case C.TAG_OPEN:{this._stateTagOpen(e);break}case C.END_TAG_OPEN:{this._stateEndTagOpen(e);break}case C.TAG_NAME:{this._stateTagName(e);break}case C.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(e);break}case C.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(e);break}case C.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(e);break}case C.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(e);break}case C.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(e);break}case C.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(e);break}case C.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(e);break}case C.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(e);break}case C.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(e);break}case C.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(e);break}case C.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(e);break}case C.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(e);break}case C.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(e);break}case C.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(e);break}case C.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(e);break}case C.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(e);break}case C.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(e);break}case C.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(e);break}case C.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(e);break}case C.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(e);break}case C.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(e);break}case C.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(e);break}case C.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(e);break}case C.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(e);break}case C.ATTRIBUTE_NAME:{this._stateAttributeName(e);break}case C.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(e);break}case C.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(e);break}case C.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(e);break}case C.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(e);break}case C.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(e);break}case C.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(e);break}case C.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(e);break}case C.BOGUS_COMMENT:{this._stateBogusComment(e);break}case C.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(e);break}case C.COMMENT_START:{this._stateCommentStart(e);break}case C.COMMENT_START_DASH:{this._stateCommentStartDash(e);break}case C.COMMENT:{this._stateComment(e);break}case C.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(e);break}case C.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(e);break}case C.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(e);break}case C.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(e);break}case C.COMMENT_END_DASH:{this._stateCommentEndDash(e);break}case C.COMMENT_END:{this._stateCommentEnd(e);break}case C.COMMENT_END_BANG:{this._stateCommentEndBang(e);break}case C.DOCTYPE:{this._stateDoctype(e);break}case C.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(e);break}case C.DOCTYPE_NAME:{this._stateDoctypeName(e);break}case C.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(e);break}case C.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(e);break}case C.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(e);break}case C.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(e);break}case C.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(e);break}case C.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(e);break}case C.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break}case C.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(e);break}case C.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(e);break}case C.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(e);break}case C.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(e);break}case C.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(e);break}case C.BOGUS_DOCTYPE:{this._stateBogusDoctype(e);break}case C.CDATA_SECTION:{this._stateCdataSection(e);break}case C.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(e);break}case C.CDATA_SECTION_END:{this._stateCdataSectionEnd(e);break}case C.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case C.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(e);break}default:throw new Error("Unknown state")}}_stateData(e){switch(e){case A.LESS_THAN_SIGN:{this.state=C.TAG_OPEN;break}case A.AMPERSAND:{this._startCharacterReference();break}case A.NULL:{this._err(M.unexpectedNullCharacter),this._emitCodePoint(e);break}case A.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case A.AMPERSAND:{this._startCharacterReference();break}case A.LESS_THAN_SIGN:{this.state=C.RCDATA_LESS_THAN_SIGN;break}case A.NULL:{this._err(M.unexpectedNullCharacter),this._emitChars(Le);break}case A.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case A.LESS_THAN_SIGN:{this.state=C.RAWTEXT_LESS_THAN_SIGN;break}case A.NULL:{this._err(M.unexpectedNullCharacter),this._emitChars(Le);break}case A.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case A.LESS_THAN_SIGN:{this.state=C.SCRIPT_DATA_LESS_THAN_SIGN;break}case A.NULL:{this._err(M.unexpectedNullCharacter),this._emitChars(Le);break}case A.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case A.NULL:{this._err(M.unexpectedNullCharacter),this._emitChars(Le);break}case A.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateTagOpen(e){if($t(e))this._createStartTagToken(),this.state=C.TAG_NAME,this._stateTagName(e);else switch(e){case A.EXCLAMATION_MARK:{this.state=C.MARKUP_DECLARATION_OPEN;break}case A.SOLIDUS:{this.state=C.END_TAG_OPEN;break}case A.QUESTION_MARK:{this._err(M.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=C.BOGUS_COMMENT,this._stateBogusComment(e);break}case A.EOF:{this._err(M.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(M.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=C.DATA,this._stateData(e)}}_stateEndTagOpen(e){if($t(e))this._createEndTagToken(),this.state=C.TAG_NAME,this._stateTagName(e);else switch(e){case A.GREATER_THAN_SIGN:{this._err(M.missingEndTagName),this.state=C.DATA;break}case A.EOF:{this._err(M.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(M.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=C.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){const n=this.currentToken;switch(e){case A.SPACE:case A.LINE_FEED:case A.TABULATION:case A.FORM_FEED:{this.state=C.BEFORE_ATTRIBUTE_NAME;break}case A.SOLIDUS:{this.state=C.SELF_CLOSING_START_TAG;break}case A.GREATER_THAN_SIGN:{this.state=C.DATA,this.emitCurrentTagToken();break}case A.NULL:{this._err(M.unexpectedNullCharacter),n.tagName+=Le;break}case A.EOF:{this._err(M.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(or(e)?Kr(e):e)}}_stateRcdataLessThanSign(e){e===A.SOLIDUS?this.state=C.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=C.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){$t(e)?(this.state=C.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars("</"),this.state=C.RCDATA,this._stateRcdata(e))}handleSpecialEndTag(e){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const n=this.currentToken;switch(n.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case A.SPACE:case A.LINE_FEED:case A.TABULATION:case A.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=C.BEFORE_ATTRIBUTE_NAME,!1;case A.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=C.SELF_CLOSING_START_TAG,!1;case A.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=C.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=C.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===A.SOLIDUS?this.state=C.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=C.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){$t(e)?(this.state=C.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars("</"),this.state=C.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=C.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case A.SOLIDUS:{this.state=C.SCRIPT_DATA_END_TAG_OPEN;break}case A.EXCLAMATION_MARK:{this.state=C.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=C.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){$t(e)?(this.state=C.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars("</"),this.state=C.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=C.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===A.HYPHEN_MINUS?(this.state=C.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=C.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===A.HYPHEN_MINUS?(this.state=C.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=C.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case A.HYPHEN_MINUS:{this.state=C.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case A.LESS_THAN_SIGN:{this.state=C.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case A.NULL:{this._err(M.unexpectedNullCharacter),this._emitChars(Le);break}case A.EOF:{this._err(M.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case A.HYPHEN_MINUS:{this.state=C.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case A.LESS_THAN_SIGN:{this.state=C.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case A.NULL:{this._err(M.unexpectedNullCharacter),this.state=C.SCRIPT_DATA_ESCAPED,this._emitChars(Le);break}case A.EOF:{this._err(M.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=C.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case A.HYPHEN_MINUS:{this._emitChars("-");break}case A.LESS_THAN_SIGN:{this.state=C.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case A.GREATER_THAN_SIGN:{this.state=C.SCRIPT_DATA,this._emitChars(">");break}case A.NULL:{this._err(M.unexpectedNullCharacter),this.state=C.SCRIPT_DATA_ESCAPED,this._emitChars(Le);break}case A.EOF:{this._err(M.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=C.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===A.SOLIDUS?this.state=C.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:$t(e)?(this._emitChars("<"),this.state=C.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars("<"),this.state=C.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){$t(e)?(this.state=C.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars("</"),this.state=C.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=C.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(nt.SCRIPT,!1)&&Mu(this.preprocessor.peek(nt.SCRIPT.length))){this._emitCodePoint(e);for(let n=0;n<nt.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=C.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=C.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case A.HYPHEN_MINUS:{this.state=C.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case A.LESS_THAN_SIGN:{this.state=C.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case A.NULL:{this._err(M.unexpectedNullCharacter),this._emitChars(Le);break}case A.EOF:{this._err(M.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case A.HYPHEN_MINUS:{this.state=C.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case A.LESS_THAN_SIGN:{this.state=C.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case A.NULL:{this._err(M.unexpectedNullCharacter),this.state=C.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Le);break}case A.EOF:{this._err(M.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=C.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case A.HYPHEN_MINUS:{this._emitChars("-");break}case A.LESS_THAN_SIGN:{this.state=C.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case A.GREATER_THAN_SIGN:{this.state=C.SCRIPT_DATA,this._emitChars(">");break}case A.NULL:{this._err(M.unexpectedNullCharacter),this.state=C.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Le);break}case A.EOF:{this._err(M.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=C.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===A.SOLIDUS?(this.state=C.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=C.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(nt.SCRIPT,!1)&&Mu(this.preprocessor.peek(nt.SCRIPT.length))){this._emitCodePoint(e);for(let n=0;n<nt.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=C.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=C.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case A.SPACE:case A.LINE_FEED:case A.TABULATION:case A.FORM_FEED:break;case A.SOLIDUS:case A.GREATER_THAN_SIGN:case A.EOF:{this.state=C.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case A.EQUALS_SIGN:{this._err(M.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=C.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=C.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case A.SPACE:case A.LINE_FEED:case A.TABULATION:case A.FORM_FEED:case A.SOLIDUS:case A.GREATER_THAN_SIGN:case A.EOF:{this._leaveAttrName(),this.state=C.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case A.EQUALS_SIGN:{this._leaveAttrName(),this.state=C.BEFORE_ATTRIBUTE_VALUE;break}case A.QUOTATION_MARK:case A.APOSTROPHE:case A.LESS_THAN_SIGN:{this._err(M.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break}case A.NULL:{this._err(M.unexpectedNullCharacter),this.currentAttr.name+=Le;break}default:this.currentAttr.name+=String.fromCodePoint(or(e)?Kr(e):e)}}_stateAfterAttributeName(e){switch(e){case A.SPACE:case A.LINE_FEED:case A.TABULATION:case A.FORM_FEED:break;case A.SOLIDUS:{this.state=C.SELF_CLOSING_START_TAG;break}case A.EQUALS_SIGN:{this.state=C.BEFORE_ATTRIBUTE_VALUE;break}case A.GREATER_THAN_SIGN:{this.state=C.DATA,this.emitCurrentTagToken();break}case A.EOF:{this._err(M.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=C.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case A.SPACE:case A.LINE_FEED:case A.TABULATION:case A.FORM_FEED:break;case A.QUOTATION_MARK:{this.state=C.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case A.APOSTROPHE:{this.state=C.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case A.GREATER_THAN_SIGN:{this._err(M.missingAttributeValue),this.state=C.DATA,this.emitCurrentTagToken();break}default:this.state=C.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case A.QUOTATION_MARK:{this.state=C.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case A.AMPERSAND:{this._startCharacterReference();break}case A.NULL:{this._err(M.unexpectedNullCharacter),this.currentAttr.value+=Le;break}case A.EOF:{this._err(M.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case A.APOSTROPHE:{this.state=C.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case A.AMPERSAND:{this._startCharacterReference();break}case A.NULL:{this._err(M.unexpectedNullCharacter),this.currentAttr.value+=Le;break}case A.EOF:{this._err(M.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case A.SPACE:case A.LINE_FEED:case A.TABULATION:case A.FORM_FEED:{this._leaveAttrValue(),this.state=C.BEFORE_ATTRIBUTE_NAME;break}case A.AMPERSAND:{this._startCharacterReference();break}case A.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=C.DATA,this.emitCurrentTagToken();break}case A.NULL:{this._err(M.unexpectedNullCharacter),this.currentAttr.value+=Le;break}case A.QUOTATION_MARK:case A.APOSTROPHE:case A.LESS_THAN_SIGN:case A.EQUALS_SIGN:case A.GRAVE_ACCENT:{this._err(M.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break}case A.EOF:{this._err(M.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case A.SPACE:case A.LINE_FEED:case A.TABULATION:case A.FORM_FEED:{this._leaveAttrValue(),this.state=C.BEFORE_ATTRIBUTE_NAME;break}case A.SOLIDUS:{this._leaveAttrValue(),this.state=C.SELF_CLOSING_START_TAG;break}case A.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=C.DATA,this.emitCurrentTagToken();break}case A.EOF:{this._err(M.eofInTag),this._emitEOFToken();break}default:this._err(M.missingWhitespaceBetweenAttributes),this.state=C.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case A.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=C.DATA,this.emitCurrentTagToken();break}case A.EOF:{this._err(M.eofInTag),this._emitEOFToken();break}default:this._err(M.unexpectedSolidusInTag),this.state=C.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){const n=this.currentToken;switch(e){case A.GREATER_THAN_SIGN:{this.state=C.DATA,this.emitCurrentComment(n);break}case A.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case A.NULL:{this._err(M.unexpectedNullCharacter),n.data+=Le;break}default:n.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(nt.DASH_DASH,!0)?(this._createCommentToken(nt.DASH_DASH.length+1),this.state=C.COMMENT_START):this._consumeSequenceIfMatch(nt.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(nt.DOCTYPE.length+1),this.state=C.DOCTYPE):this._consumeSequenceIfMatch(nt.CDATA_START,!0)?this.inForeignNode?this.state=C.CDATA_SECTION:(this._err(M.cdataInHtmlContent),this._createCommentToken(nt.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=C.BOGUS_COMMENT):this._ensureHibernation()||(this._err(M.incorrectlyOpenedComment),this._createCommentToken(2),this.state=C.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case A.HYPHEN_MINUS:{this.state=C.COMMENT_START_DASH;break}case A.GREATER_THAN_SIGN:{this._err(M.abruptClosingOfEmptyComment),this.state=C.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=C.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){const n=this.currentToken;switch(e){case A.HYPHEN_MINUS:{this.state=C.COMMENT_END;break}case A.GREATER_THAN_SIGN:{this._err(M.abruptClosingOfEmptyComment),this.state=C.DATA,this.emitCurrentComment(n);break}case A.EOF:{this._err(M.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=C.COMMENT,this._stateComment(e)}}_stateComment(e){const n=this.currentToken;switch(e){case A.HYPHEN_MINUS:{this.state=C.COMMENT_END_DASH;break}case A.LESS_THAN_SIGN:{n.data+="<",this.state=C.COMMENT_LESS_THAN_SIGN;break}case A.NULL:{this._err(M.unexpectedNullCharacter),n.data+=Le;break}case A.EOF:{this._err(M.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){const n=this.currentToken;switch(e){case A.EXCLAMATION_MARK:{n.data+="!",this.state=C.COMMENT_LESS_THAN_SIGN_BANG;break}case A.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=C.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===A.HYPHEN_MINUS?this.state=C.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=C.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===A.HYPHEN_MINUS?this.state=C.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=C.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==A.GREATER_THAN_SIGN&&e!==A.EOF&&this._err(M.nestedComment),this.state=C.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){const n=this.currentToken;switch(e){case A.HYPHEN_MINUS:{this.state=C.COMMENT_END;break}case A.EOF:{this._err(M.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=C.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){const n=this.currentToken;switch(e){case A.GREATER_THAN_SIGN:{this.state=C.DATA,this.emitCurrentComment(n);break}case A.EXCLAMATION_MARK:{this.state=C.COMMENT_END_BANG;break}case A.HYPHEN_MINUS:{n.data+="-";break}case A.EOF:{this._err(M.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=C.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){const n=this.currentToken;switch(e){case A.HYPHEN_MINUS:{n.data+="--!",this.state=C.COMMENT_END_DASH;break}case A.GREATER_THAN_SIGN:{this._err(M.incorrectlyClosedComment),this.state=C.DATA,this.emitCurrentComment(n);break}case A.EOF:{this._err(M.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=C.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case A.SPACE:case A.LINE_FEED:case A.TABULATION:case A.FORM_FEED:{this.state=C.BEFORE_DOCTYPE_NAME;break}case A.GREATER_THAN_SIGN:{this.state=C.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break}case A.EOF:{this._err(M.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(M.missingWhitespaceBeforeDoctypeName),this.state=C.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(or(e))this._createDoctypeToken(String.fromCharCode(Kr(e))),this.state=C.DOCTYPE_NAME;else switch(e){case A.SPACE:case A.LINE_FEED:case A.TABULATION:case A.FORM_FEED:break;case A.NULL:{this._err(M.unexpectedNullCharacter),this._createDoctypeToken(Le),this.state=C.DOCTYPE_NAME;break}case A.GREATER_THAN_SIGN:{this._err(M.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=C.DATA;break}case A.EOF:{this._err(M.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(e)),this.state=C.DOCTYPE_NAME}}_stateDoctypeName(e){const n=this.currentToken;switch(e){case A.SPACE:case A.LINE_FEED:case A.TABULATION:case A.FORM_FEED:{this.state=C.AFTER_DOCTYPE_NAME;break}case A.GREATER_THAN_SIGN:{this.state=C.DATA,this.emitCurrentDoctype(n);break}case A.NULL:{this._err(M.unexpectedNullCharacter),n.name+=Le;break}case A.EOF:{this._err(M.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(or(e)?Kr(e):e)}}_stateAfterDoctypeName(e){const n=this.currentToken;switch(e){case A.SPACE:case A.LINE_FEED:case A.TABULATION:case A.FORM_FEED:break;case A.GREATER_THAN_SIGN:{this.state=C.DATA,this.emitCurrentDoctype(n);break}case A.EOF:{this._err(M.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(nt.PUBLIC,!1)?this.state=C.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(nt.SYSTEM,!1)?this.state=C.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(M.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=C.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){const n=this.currentToken;switch(e){case A.SPACE:case A.LINE_FEED:case A.TABULATION:case A.FORM_FEED:{this.state=C.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case A.QUOTATION_MARK:{this._err(M.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=C.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case A.APOSTROPHE:{this._err(M.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=C.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case A.GREATER_THAN_SIGN:{this._err(M.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=C.DATA,this.emitCurrentDoctype(n);break}case A.EOF:{this._err(M.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(M.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=C.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){const n=this.currentToken;switch(e){case A.SPACE:case A.LINE_FEED:case A.TABULATION:case A.FORM_FEED:break;case A.QUOTATION_MARK:{n.publicId="",this.state=C.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case A.APOSTROPHE:{n.publicId="",this.state=C.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case A.GREATER_THAN_SIGN:{this._err(M.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=C.DATA,this.emitCurrentDoctype(n);break}case A.EOF:{this._err(M.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(M.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=C.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){const n=this.currentToken;switch(e){case A.QUOTATION_MARK:{this.state=C.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case A.NULL:{this._err(M.unexpectedNullCharacter),n.publicId+=Le;break}case A.GREATER_THAN_SIGN:{this._err(M.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=C.DATA;break}case A.EOF:{this._err(M.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(e)}}_stateDoctypePublicIdentifierSingleQuoted(e){const n=this.currentToken;switch(e){case A.APOSTROPHE:{this.state=C.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case A.NULL:{this._err(M.unexpectedNullCharacter),n.publicId+=Le;break}case A.GREATER_THAN_SIGN:{this._err(M.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=C.DATA;break}case A.EOF:{this._err(M.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(e)}}_stateAfterDoctypePublicIdentifier(e){const n=this.currentToken;switch(e){case A.SPACE:case A.LINE_FEED:case A.TABULATION:case A.FORM_FEED:{this.state=C.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case A.GREATER_THAN_SIGN:{this.state=C.DATA,this.emitCurrentDoctype(n);break}case A.QUOTATION_MARK:{this._err(M.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=C.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case A.APOSTROPHE:{this._err(M.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=C.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case A.EOF:{this._err(M.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(M.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=C.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){const n=this.currentToken;switch(e){case A.SPACE:case A.LINE_FEED:case A.TABULATION:case A.FORM_FEED:break;case A.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=C.DATA;break}case A.QUOTATION_MARK:{n.systemId="",this.state=C.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case A.APOSTROPHE:{n.systemId="",this.state=C.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case A.EOF:{this._err(M.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(M.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=C.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){const n=this.currentToken;switch(e){case A.SPACE:case A.LINE_FEED:case A.TABULATION:case A.FORM_FEED:{this.state=C.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case A.QUOTATION_MARK:{this._err(M.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=C.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case A.APOSTROPHE:{this._err(M.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=C.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case A.GREATER_THAN_SIGN:{this._err(M.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=C.DATA,this.emitCurrentDoctype(n);break}case A.EOF:{this._err(M.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(M.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=C.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){const n=this.currentToken;switch(e){case A.SPACE:case A.LINE_FEED:case A.TABULATION:case A.FORM_FEED:break;case A.QUOTATION_MARK:{n.systemId="",this.state=C.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case A.APOSTROPHE:{n.systemId="",this.state=C.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case A.GREATER_THAN_SIGN:{this._err(M.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=C.DATA,this.emitCurrentDoctype(n);break}case A.EOF:{this._err(M.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(M.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=C.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){const n=this.currentToken;switch(e){case A.QUOTATION_MARK:{this.state=C.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case A.NULL:{this._err(M.unexpectedNullCharacter),n.systemId+=Le;break}case A.GREATER_THAN_SIGN:{this._err(M.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=C.DATA;break}case A.EOF:{this._err(M.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(e)}}_stateDoctypeSystemIdentifierSingleQuoted(e){const n=this.currentToken;switch(e){case A.APOSTROPHE:{this.state=C.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case A.NULL:{this._err(M.unexpectedNullCharacter),n.systemId+=Le;break}case A.GREATER_THAN_SIGN:{this._err(M.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=C.DATA;break}case A.EOF:{this._err(M.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(e)}}_stateAfterDoctypeSystemIdentifier(e){const n=this.currentToken;switch(e){case A.SPACE:case A.LINE_FEED:case A.TABULATION:case A.FORM_FEED:break;case A.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=C.DATA;break}case A.EOF:{this._err(M.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(M.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=C.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){const n=this.currentToken;switch(e){case A.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=C.DATA;break}case A.NULL:{this._err(M.unexpectedNullCharacter);break}case A.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(e){switch(e){case A.RIGHT_SQUARE_BRACKET:{this.state=C.CDATA_SECTION_BRACKET;break}case A.EOF:{this._err(M.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===A.RIGHT_SQUARE_BRACKET?this.state=C.CDATA_SECTION_END:(this._emitChars("]"),this.state=C.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case A.GREATER_THAN_SIGN:{this.state=C.DATA;break}case A.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=C.CDATA_SECTION,this._stateCdataSection(e)}}_stateCharacterReference(){let e=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(e<0)if(this.preprocessor.lastChunkWritten)e=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}e===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(A.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&Pu(this.preprocessor.peek(1))?C.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(e){Pu(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===A.SEMICOLON&&this._err(M.unknownNamedCharacterReference),this.state=this.returnState,this._callState(e))}}const Kd=new Set([f.DD,f.DT,f.LI,f.OPTGROUP,f.OPTION,f.P,f.RB,f.RP,f.RT,f.RTC]),Bu=new Set([...Kd,f.CAPTION,f.COLGROUP,f.TBODY,f.TD,f.TFOOT,f.TH,f.THEAD,f.TR]),yi=new Set([f.APPLET,f.CAPTION,f.HTML,f.MARQUEE,f.OBJECT,f.TABLE,f.TD,f.TEMPLATE,f.TH]),w3=new Set([...yi,f.OL,f.UL]),v3=new Set([...yi,f.BUTTON]),Fu=new Set([f.ANNOTATION_XML,f.MI,f.MN,f.MO,f.MS,f.MTEXT]),zu=new Set([f.DESC,f.FOREIGN_OBJECT,f.TITLE]),R3=new Set([f.TR,f.TEMPLATE,f.HTML]),O3=new Set([f.TBODY,f.TFOOT,f.THEAD,f.TEMPLATE,f.HTML]),L3=new Set([f.TABLE,f.TEMPLATE,f.HTML]),D3=new Set([f.TD,f.TH]);class P3{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(e,n,r){this.treeAdapter=n,this.handler=r,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=f.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===f.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===$.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(e,n){this.stackTop++,this.items[this.stackTop]=e,this.current=e,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(e,n,!0)}pop(){const e=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,n){const r=this._indexOf(e);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(e,n,r){const i=this._indexOf(e)+1;this.items.splice(i,0,n),this.tagIDs.splice(i,0,r),this.stackTop++,i===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,i===this.stackTop)}popUntilTagNamePopped(e){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(e,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==$.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(e){for(;this.stackTop>=e;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop<e)}}popUntilElementPopped(e){const n=this._indexOf(e);this.shortenToLength(Math.max(n,0))}popUntilPopped(e,n){const r=this._indexOfTagNames(e,n);this.shortenToLength(Math.max(r,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(ta,$.HTML)}popUntilTableCellPopped(){this.popUntilPopped(D3,$.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(e,n){for(let r=this.stackTop;r>=0;r--)if(e.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(e,n){const r=this._indexOfTagNames(e,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(L3,$.HTML)}clearBackToTableBodyContext(){this.clearBackTo(O3,$.HTML)}clearBackToTableRowContext(){this.clearBackTo(R3,$.HTML)}remove(e){const n=this._indexOf(e);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===f.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){const n=this._indexOf(e)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===f.HTML}hasInDynamicScope(e,n){for(let r=this.stackTop;r>=0;r--){const i=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case $.HTML:{if(i===e)return!0;if(n.has(i))return!1;break}case $.SVG:{if(zu.has(i))return!1;break}case $.MATHML:{if(Fu.has(i))return!1;break}}}return!0}hasInScope(e){return this.hasInDynamicScope(e,yi)}hasInListItemScope(e){return this.hasInDynamicScope(e,w3)}hasInButtonScope(e){return this.hasInDynamicScope(e,v3)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){const n=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case $.HTML:{if(ta.has(n))return!0;if(yi.has(n))return!1;break}case $.SVG:{if(zu.has(n))return!1;break}case $.MATHML:{if(Fu.has(n))return!1;break}}}return!0}hasInTableScope(e){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===$.HTML)switch(this.tagIDs[n]){case e:return!0;case f.TABLE:case f.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===$.HTML)switch(this.tagIDs[e]){case f.TBODY:case f.THEAD:case f.TFOOT:return!0;case f.TABLE:case f.HTML:return!1}return!0}hasInSelectScope(e){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===$.HTML)switch(this.tagIDs[n]){case e:return!0;case f.OPTION:case f.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&Kd.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&Bu.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&Bu.has(this.currentTagId);)this.pop()}}const gs=3;var wt;(function(t){t[t.Marker=0]="Marker",t[t.Element=1]="Element"})(wt||(wt={}));const ju={type:wt.Marker};class M3{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,n){const r=[],i=n.length,s=this.treeAdapter.getTagName(e),a=this.treeAdapter.getNamespaceURI(e);for(let o=0;o<this.entries.length;o++){const u=this.entries[o];if(u.type===wt.Marker)break;const{element:l}=u;if(this.treeAdapter.getTagName(l)===s&&this.treeAdapter.getNamespaceURI(l)===a){const d=this.treeAdapter.getAttrList(l);d.length===i&&r.push({idx:o,attrs:d})}}return r}_ensureNoahArkCondition(e){if(this.entries.length<gs)return;const n=this.treeAdapter.getAttrList(e),r=this._getNoahArkConditionCandidates(e,n);if(r.length<gs)return;const i=new Map(n.map(a=>[a.name,a.value]));let s=0;for(let a=0;a<r.length;a++){const o=r[a];o.attrs.every(u=>i.get(u.name)===u.value)&&(s+=1,s>=gs&&this.entries.splice(o.idx,1))}}insertMarker(){this.entries.unshift(ju)}pushElement(e,n){this._ensureNoahArkCondition(e),this.entries.unshift({type:wt.Element,element:e,token:n})}insertElementAfterBookmark(e,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:wt.Element,element:e,token:n})}removeEntry(e){const n=this.entries.indexOf(e);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const e=this.entries.indexOf(ju);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){const n=this.entries.find(r=>r.type===wt.Marker||this.treeAdapter.getTagName(r.element)===e);return n&&n.type===wt.Element?n:null}getElementEntry(e){return this.entries.find(n=>n.type===wt.Element&&n.element===e)}}const Zt={createDocument(){return{nodeName:"#document",mode:bt.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(t,e,n){return{nodeName:t,tagName:t,attrs:n,namespaceURI:e,childNodes:[],parentNode:null}},createCommentNode(t){return{nodeName:"#comment",data:t,parentNode:null}},createTextNode(t){return{nodeName:"#text",value:t,parentNode:null}},appendChild(t,e){t.childNodes.push(e),e.parentNode=t},insertBefore(t,e,n){const r=t.childNodes.indexOf(n);t.childNodes.splice(r,0,e),e.parentNode=t},setTemplateContent(t,e){t.content=e},getTemplateContent(t){return t.content},setDocumentType(t,e,n,r){const i=t.childNodes.find(s=>s.nodeName==="#documentType");if(i)i.name=e,i.publicId=n,i.systemId=r;else{const s={nodeName:"#documentType",name:e,publicId:n,systemId:r,parentNode:null};Zt.appendChild(t,s)}},setDocumentMode(t,e){t.mode=e},getDocumentMode(t){return t.mode},detachNode(t){if(t.parentNode){const e=t.parentNode.childNodes.indexOf(t);t.parentNode.childNodes.splice(e,1),t.parentNode=null}},insertText(t,e){if(t.childNodes.length>0){const n=t.childNodes[t.childNodes.length-1];if(Zt.isTextNode(n)){n.value+=e;return}}Zt.appendChild(t,Zt.createTextNode(e))},insertTextBefore(t,e,n){const r=t.childNodes[t.childNodes.indexOf(n)-1];r&&Zt.isTextNode(r)?r.value+=e:Zt.insertBefore(t,Zt.createTextNode(e),n)},adoptAttributes(t,e){const n=new Set(t.attrs.map(r=>r.name));for(let r=0;r<e.length;r++)n.has(e[r].name)||t.attrs.push(e[r])},getFirstChild(t){return t.childNodes[0]},getChildNodes(t){return t.childNodes},getParentNode(t){return t.parentNode},getAttrList(t){return t.attrs},getTagName(t){return t.tagName},getNamespaceURI(t){return t.namespaceURI},getTextNodeContent(t){return t.value},getCommentNodeContent(t){return t.data},getDocumentTypeNodeName(t){return t.name},getDocumentTypeNodePublicId(t){return t.publicId},getDocumentTypeNodeSystemId(t){return t.systemId},isTextNode(t){return t.nodeName==="#text"},isCommentNode(t){return t.nodeName==="#comment"},isDocumentTypeNode(t){return t.nodeName==="#documentType"},isElementNode(t){return Object.prototype.hasOwnProperty.call(t,"tagName")},setNodeSourceCodeLocation(t,e){t.sourceCodeLocation=e},getNodeSourceCodeLocation(t){return t.sourceCodeLocation},updateNodeSourceCodeLocation(t,e){t.sourceCodeLocation={...t.sourceCodeLocation,...e}}},Qd="html",B3="about:legacy-compat",F3="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",Xd=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],z3=[...Xd,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],j3=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),Jd=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],U3=[...Jd,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function Uu(t,e){return e.some(n=>t.startsWith(n))}function H3(t){return t.name===Qd&&t.publicId===null&&(t.systemId===null||t.systemId===B3)}function $3(t){if(t.name!==Qd)return bt.QUIRKS;const{systemId:e}=t;if(e&&e.toLowerCase()===F3)return bt.QUIRKS;let{publicId:n}=t;if(n!==null){if(n=n.toLowerCase(),j3.has(n))return bt.QUIRKS;let r=e===null?z3:Xd;if(Uu(n,r))return bt.QUIRKS;if(r=e===null?Jd:U3,Uu(n,r))return bt.LIMITED_QUIRKS}return bt.NO_QUIRKS}const Hu={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},Z3="definitionurl",Y3="definitionURL",q3=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(t=>[t.toLowerCase(),t])),V3=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:$.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:$.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:$.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:$.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:$.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:$.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:$.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:$.XML}],["xml:space",{prefix:"xml",name:"space",namespace:$.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:$.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:$.XMLNS}]]),W3=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(t=>[t.toLowerCase(),t])),G3=new Set([f.B,f.BIG,f.BLOCKQUOTE,f.BODY,f.BR,f.CENTER,f.CODE,f.DD,f.DIV,f.DL,f.DT,f.EM,f.EMBED,f.H1,f.H2,f.H3,f.H4,f.H5,f.H6,f.HEAD,f.HR,f.I,f.IMG,f.LI,f.LISTING,f.MENU,f.META,f.NOBR,f.OL,f.P,f.PRE,f.RUBY,f.S,f.SMALL,f.SPAN,f.STRONG,f.STRIKE,f.SUB,f.SUP,f.TABLE,f.TT,f.U,f.UL,f.VAR]);function K3(t){const e=t.tagID;return e===f.FONT&&t.attrs.some(({name:r})=>r===ln.COLOR||r===ln.SIZE||r===ln.FACE)||G3.has(e)}function ef(t){for(let e=0;e<t.attrs.length;e++)if(t.attrs[e].name===Z3){t.attrs[e].name=Y3;break}}function tf(t){for(let e=0;e<t.attrs.length;e++){const n=q3.get(t.attrs[e].name);n!=null&&(t.attrs[e].name=n)}}function Ha(t){for(let e=0;e<t.attrs.length;e++){const n=V3.get(t.attrs[e].name);n&&(t.attrs[e].prefix=n.prefix,t.attrs[e].name=n.name,t.attrs[e].namespace=n.namespace)}}function Q3(t){const e=W3.get(t.tagName);e!=null&&(t.tagName=e,t.tagID=$n(t.tagName))}function X3(t,e){return e===$.MATHML&&(t===f.MI||t===f.MO||t===f.MN||t===f.MS||t===f.MTEXT)}function J3(t,e,n){if(e===$.MATHML&&t===f.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===ln.ENCODING){const i=n[r].value.toLowerCase();return i===Hu.TEXT_HTML||i===Hu.APPLICATION_XML}}return e===$.SVG&&(t===f.FOREIGN_OBJECT||t===f.DESC||t===f.TITLE)}function ek(t,e,n,r){return(!r||r===$.HTML)&&J3(t,e,n)||(!r||r===$.MATHML)&&X3(t,e)}const tk="hidden",nk=8,rk=3;var I;(function(t){t[t.INITIAL=0]="INITIAL",t[t.BEFORE_HTML=1]="BEFORE_HTML",t[t.BEFORE_HEAD=2]="BEFORE_HEAD",t[t.IN_HEAD=3]="IN_HEAD",t[t.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",t[t.AFTER_HEAD=5]="AFTER_HEAD",t[t.IN_BODY=6]="IN_BODY",t[t.TEXT=7]="TEXT",t[t.IN_TABLE=8]="IN_TABLE",t[t.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",t[t.IN_CAPTION=10]="IN_CAPTION",t[t.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",t[t.IN_TABLE_BODY=12]="IN_TABLE_BODY",t[t.IN_ROW=13]="IN_ROW",t[t.IN_CELL=14]="IN_CELL",t[t.IN_SELECT=15]="IN_SELECT",t[t.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",t[t.IN_TEMPLATE=17]="IN_TEMPLATE",t[t.AFTER_BODY=18]="AFTER_BODY",t[t.IN_FRAMESET=19]="IN_FRAMESET",t[t.AFTER_FRAMESET=20]="AFTER_FRAMESET",t[t.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",t[t.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(I||(I={}));const ik={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},nf=new Set([f.TABLE,f.TBODY,f.TFOOT,f.THEAD,f.TR]),$u={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:Zt,onParseError:null};class Zu{constructor(e,n,r=null,i=null){this.fragmentContext=r,this.scriptHandler=i,this.currentToken=null,this.stopped=!1,this.insertionMode=I.INITIAL,this.originalInsertionMode=I.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...$u,...e},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=n??this.treeAdapter.createDocument(),this.tokenizer=new N3(this.options,this),this.activeFormattingElements=new M3(this.treeAdapter),this.fragmentContextID=r?$n(this.treeAdapter.getTagName(r)):f.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new P3(this.document,this.treeAdapter,this)}static parse(e,n){const r=new this(n);return r.tokenizer.write(e,!0),r.document}static getFragmentParser(e,n){const r={...$u,...n};e??(e=r.treeAdapter.createElement(L.TEMPLATE,$.HTML,[]));const i=r.treeAdapter.createElement("documentmock",$.HTML,[]),s=new this(r,i,e);return s.fragmentContextID===f.TEMPLATE&&s.tmplInsertionModeStack.unshift(I.IN_TEMPLATE),s._initTokenizerForFragmentParsing(),s._insertFakeRootElement(),s._resetInsertionMode(),s._findFormInFragmentContext(),s}getFragment(){const e=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(e,n),n}_err(e,n,r){var i;if(!this.onParseError)return;const s=(i=e.location)!==null&&i!==void 0?i:ik,a={code:n,startLine:s.startLine,startCol:s.startCol,startOffset:s.startOffset,endLine:r?s.startLine:s.endLine,endCol:r?s.startCol:s.endCol,endOffset:r?s.startOffset:s.endOffset};this.onParseError(a)}onItemPush(e,n,r){var i,s;(s=(i=this.treeAdapter).onItemPush)===null||s===void 0||s.call(i,e),r&&this.openElements.stackTop>0&&this._setContextModes(e,n)}onItemPop(e,n){var r,i;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),(i=(r=this.treeAdapter).onItemPop)===null||i===void 0||i.call(r,e,this.openElements.current),n){let s,a;this.openElements.stackTop===0&&this.fragmentContext?(s=this.fragmentContext,a=this.fragmentContextID):{current:s,currentTagId:a}=this.openElements,this._setContextModes(s,a)}}_setContextModes(e,n){const r=e===this.document||e&&this.treeAdapter.getNamespaceURI(e)===$.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&e!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,e)}_switchToTextParsing(e,n){this._insertElement(e,$.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=I.TEXT}switchToPlaintextParsing(){this.insertionMode=I.TEXT,this.originalInsertionMode=I.IN_BODY,this.tokenizer.state=Ue.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;for(;e;){if(this.treeAdapter.getTagName(e)===L.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==$.HTML))switch(this.fragmentContextID){case f.TITLE:case f.TEXTAREA:{this.tokenizer.state=Ue.RCDATA;break}case f.STYLE:case f.XMP:case f.IFRAME:case f.NOEMBED:case f.NOFRAMES:case f.NOSCRIPT:{this.tokenizer.state=Ue.RAWTEXT;break}case f.SCRIPT:{this.tokenizer.state=Ue.SCRIPT_DATA;break}case f.PLAINTEXT:{this.tokenizer.state=Ue.PLAINTEXT;break}}}_setDocumentType(e){const n=e.name||"",r=e.publicId||"",i=e.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,i),e.location){const a=this.treeAdapter.getChildNodes(this.document).find(o=>this.treeAdapter.isDocumentTypeNode(o));a&&this.treeAdapter.setNodeSourceCodeLocation(a,e.location)}}_attachElementToTree(e,n){if(this.options.sourceCodeLocationInfo){const r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(e,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r??this.document,e)}}_appendElement(e,n){const r=this.treeAdapter.createElement(e.tagName,n,e.attrs);this._attachElementToTree(r,e.location)}_insertElement(e,n){const r=this.treeAdapter.createElement(e.tagName,n,e.attrs);this._attachElementToTree(r,e.location),this.openElements.push(r,e.tagID)}_insertFakeElement(e,n){const r=this.treeAdapter.createElement(e,$.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(e){const n=this.treeAdapter.createElement(e.tagName,$.HTML,e.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,e.location),this.openElements.push(n,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const e=this.treeAdapter.createElement(L.HTML,$.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,f.HTML)}_appendCommentNode(e,n){const r=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,e.location)}_insertCharacters(e){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,e.chars,r):this.treeAdapter.insertText(n,e.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,e.chars)),!e.location)return;const i=this.treeAdapter.getChildNodes(n),s=r?i.lastIndexOf(r):i.length,a=i[s-1];if(this.treeAdapter.getNodeSourceCodeLocation(a)){const{endLine:u,endCol:l,endOffset:d}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(a,{endLine:u,endCol:l,endOffset:d})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(a,e.location)}_adoptNodes(e,n){for(let r=this.treeAdapter.getFirstChild(e);r;r=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(e,n){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&n.location){const r=n.location,i=this.treeAdapter.getTagName(e),s=n.type===me.END_TAG&&i===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,s)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,e.tagID===f.SVG&&this.treeAdapter.getTagName(n)===L.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===$.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===f.MGLYPH||e.tagID===f.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,$.HTML)}_processToken(e){switch(e.type){case me.CHARACTER:{this.onCharacter(e);break}case me.NULL_CHARACTER:{this.onNullCharacter(e);break}case me.COMMENT:{this.onComment(e);break}case me.DOCTYPE:{this.onDoctype(e);break}case me.START_TAG:{this._processStartTag(e);break}case me.END_TAG:{this.onEndTag(e);break}case me.EOF:{this.onEof(e);break}case me.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(e);break}}}_isIntegrationPoint(e,n,r){const i=this.treeAdapter.getNamespaceURI(n),s=this.treeAdapter.getAttrList(n);return ek(e,i,s,r)}_reconstructActiveFormattingElements(){const e=this.activeFormattingElements.entries.length;if(e){const n=this.activeFormattingElements.entries.findIndex(i=>i.type===wt.Marker||this.openElements.contains(i.element)),r=n===-1?e-1:n-1;for(let i=r;i>=0;i--){const s=this.activeFormattingElements.entries[i];this._insertElement(s.token,this.treeAdapter.getNamespaceURI(s.element)),s.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=I.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(f.P),this.openElements.popUntilTagNamePopped(f.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case f.TR:{this.insertionMode=I.IN_ROW;return}case f.TBODY:case f.THEAD:case f.TFOOT:{this.insertionMode=I.IN_TABLE_BODY;return}case f.CAPTION:{this.insertionMode=I.IN_CAPTION;return}case f.COLGROUP:{this.insertionMode=I.IN_COLUMN_GROUP;return}case f.TABLE:{this.insertionMode=I.IN_TABLE;return}case f.BODY:{this.insertionMode=I.IN_BODY;return}case f.FRAMESET:{this.insertionMode=I.IN_FRAMESET;return}case f.SELECT:{this._resetInsertionModeForSelect(e);return}case f.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case f.HTML:{this.insertionMode=this.headElement?I.AFTER_HEAD:I.BEFORE_HEAD;return}case f.TD:case f.TH:{if(e>0){this.insertionMode=I.IN_CELL;return}break}case f.HEAD:{if(e>0){this.insertionMode=I.IN_HEAD;return}break}}this.insertionMode=I.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let n=e-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===f.TEMPLATE)break;if(r===f.TABLE){this.insertionMode=I.IN_SELECT_IN_TABLE;return}}this.insertionMode=I.IN_SELECT}_isElementCausesFosterParenting(e){return nf.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){const n=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case f.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===$.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case f.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[e-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,e,n.beforeElement):this.treeAdapter.appendChild(n.parent,e)}_isSpecialElement(e,n){const r=this.treeAdapter.getNamespaceURI(e);return A3[r].has(n)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){DA(this,e);return}switch(this.insertionMode){case I.INITIAL:{tr(this,e);break}case I.BEFORE_HTML:{gr(this,e);break}case I.BEFORE_HEAD:{br(this,e);break}case I.IN_HEAD:{Er(this,e);break}case I.IN_HEAD_NO_SCRIPT:{xr(this,e);break}case I.AFTER_HEAD:{Tr(this,e);break}case I.IN_BODY:case I.IN_CAPTION:case I.IN_CELL:case I.IN_TEMPLATE:{sf(this,e);break}case I.TEXT:case I.IN_SELECT:case I.IN_SELECT_IN_TABLE:{this._insertCharacters(e);break}case I.IN_TABLE:case I.IN_TABLE_BODY:case I.IN_ROW:{bs(this,e);break}case I.IN_TABLE_TEXT:{df(this,e);break}case I.IN_COLUMN_GROUP:{ki(this,e);break}case I.AFTER_BODY:{Ai(this,e);break}case I.AFTER_AFTER_BODY:{ui(this,e);break}}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){LA(this,e);return}switch(this.insertionMode){case I.INITIAL:{tr(this,e);break}case I.BEFORE_HTML:{gr(this,e);break}case I.BEFORE_HEAD:{br(this,e);break}case I.IN_HEAD:{Er(this,e);break}case I.IN_HEAD_NO_SCRIPT:{xr(this,e);break}case I.AFTER_HEAD:{Tr(this,e);break}case I.TEXT:{this._insertCharacters(e);break}case I.IN_TABLE:case I.IN_TABLE_BODY:case I.IN_ROW:{bs(this,e);break}case I.IN_COLUMN_GROUP:{ki(this,e);break}case I.AFTER_BODY:{Ai(this,e);break}case I.AFTER_AFTER_BODY:{ui(this,e);break}}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){na(this,e);return}switch(this.insertionMode){case I.INITIAL:case I.BEFORE_HTML:case I.BEFORE_HEAD:case I.IN_HEAD:case I.IN_HEAD_NO_SCRIPT:case I.AFTER_HEAD:case I.IN_BODY:case I.IN_TABLE:case I.IN_CAPTION:case I.IN_COLUMN_GROUP:case I.IN_TABLE_BODY:case I.IN_ROW:case I.IN_CELL:case I.IN_SELECT:case I.IN_SELECT_IN_TABLE:case I.IN_TEMPLATE:case I.IN_FRAMESET:case I.AFTER_FRAMESET:{na(this,e);break}case I.IN_TABLE_TEXT:{nr(this,e);break}case I.AFTER_BODY:{dk(this,e);break}case I.AFTER_AFTER_BODY:case I.AFTER_AFTER_FRAMESET:{fk(this,e);break}}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case I.INITIAL:{hk(this,e);break}case I.BEFORE_HEAD:case I.IN_HEAD:case I.IN_HEAD_NO_SCRIPT:case I.AFTER_HEAD:{this._err(e,M.misplacedDoctype);break}case I.IN_TABLE_TEXT:{nr(this,e);break}}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,M.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?PA(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case I.INITIAL:{tr(this,e);break}case I.BEFORE_HTML:{pk(this,e);break}case I.BEFORE_HEAD:{gk(this,e);break}case I.IN_HEAD:{At(this,e);break}case I.IN_HEAD_NO_SCRIPT:{xk(this,e);break}case I.AFTER_HEAD:{_k(this,e);break}case I.IN_BODY:{Xe(this,e);break}case I.IN_TABLE:{Pn(this,e);break}case I.IN_TABLE_TEXT:{nr(this,e);break}case I.IN_CAPTION:{bA(this,e);break}case I.IN_COLUMN_GROUP:{Ya(this,e);break}case I.IN_TABLE_BODY:{Zi(this,e);break}case I.IN_ROW:{Yi(this,e);break}case I.IN_CELL:{TA(this,e);break}case I.IN_SELECT:{pf(this,e);break}case I.IN_SELECT_IN_TABLE:{yA(this,e);break}case I.IN_TEMPLATE:{AA(this,e);break}case I.AFTER_BODY:{CA(this,e);break}case I.IN_FRAMESET:{IA(this,e);break}case I.AFTER_FRAMESET:{wA(this,e);break}case I.AFTER_AFTER_BODY:{RA(this,e);break}case I.AFTER_AFTER_FRAMESET:{OA(this,e);break}}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?MA(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case I.INITIAL:{tr(this,e);break}case I.BEFORE_HTML:{mk(this,e);break}case I.BEFORE_HEAD:{bk(this,e);break}case I.IN_HEAD:{Ek(this,e);break}case I.IN_HEAD_NO_SCRIPT:{Tk(this,e);break}case I.AFTER_HEAD:{yk(this,e);break}case I.IN_BODY:{$i(this,e);break}case I.TEXT:{oA(this,e);break}case I.IN_TABLE:{Sr(this,e);break}case I.IN_TABLE_TEXT:{nr(this,e);break}case I.IN_CAPTION:{EA(this,e);break}case I.IN_COLUMN_GROUP:{xA(this,e);break}case I.IN_TABLE_BODY:{ra(this,e);break}case I.IN_ROW:{hf(this,e);break}case I.IN_CELL:{_A(this,e);break}case I.IN_SELECT:{mf(this,e);break}case I.IN_SELECT_IN_TABLE:{kA(this,e);break}case I.IN_TEMPLATE:{SA(this,e);break}case I.AFTER_BODY:{bf(this,e);break}case I.IN_FRAMESET:{NA(this,e);break}case I.AFTER_FRAMESET:{vA(this,e);break}case I.AFTER_AFTER_BODY:{ui(this,e);break}}}onEof(e){switch(this.insertionMode){case I.INITIAL:{tr(this,e);break}case I.BEFORE_HTML:{gr(this,e);break}case I.BEFORE_HEAD:{br(this,e);break}case I.IN_HEAD:{Er(this,e);break}case I.IN_HEAD_NO_SCRIPT:{xr(this,e);break}case I.AFTER_HEAD:{Tr(this,e);break}case I.IN_BODY:case I.IN_TABLE:case I.IN_CAPTION:case I.IN_COLUMN_GROUP:case I.IN_TABLE_BODY:case I.IN_ROW:case I.IN_CELL:case I.IN_SELECT:case I.IN_SELECT_IN_TABLE:{lf(this,e);break}case I.TEXT:{uA(this,e);break}case I.IN_TABLE_TEXT:{nr(this,e);break}case I.IN_TEMPLATE:{gf(this,e);break}case I.AFTER_BODY:case I.IN_FRAMESET:case I.AFTER_FRAMESET:case I.AFTER_AFTER_BODY:case I.AFTER_AFTER_FRAMESET:{Za(this,e);break}}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===A.LINE_FEED)){if(e.chars.length===1)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(e);return}switch(this.insertionMode){case I.IN_HEAD:case I.IN_HEAD_NO_SCRIPT:case I.AFTER_HEAD:case I.TEXT:case I.IN_COLUMN_GROUP:case I.IN_SELECT:case I.IN_SELECT_IN_TABLE:case I.IN_FRAMESET:case I.AFTER_FRAMESET:{this._insertCharacters(e);break}case I.IN_BODY:case I.IN_CAPTION:case I.IN_CELL:case I.IN_TEMPLATE:case I.AFTER_BODY:case I.AFTER_AFTER_BODY:case I.AFTER_AFTER_FRAMESET:{rf(this,e);break}case I.IN_TABLE:case I.IN_TABLE_BODY:case I.IN_ROW:{bs(this,e);break}case I.IN_TABLE_TEXT:{cf(this,e);break}}}}function sk(t,e){let n=t.activeFormattingElements.getElementEntryInScopeWithTagName(e.tagName);return n?t.openElements.contains(n.element)?t.openElements.hasInScope(e.tagID)||(n=null):(t.activeFormattingElements.removeEntry(n),n=null):uf(t,e),n}function ak(t,e){let n=null,r=t.openElements.stackTop;for(;r>=0;r--){const i=t.openElements.items[r];if(i===e.element)break;t._isSpecialElement(i,t.openElements.tagIDs[r])&&(n=i)}return n||(t.openElements.shortenToLength(Math.max(r,0)),t.activeFormattingElements.removeEntry(e)),n}function ok(t,e,n){let r=e,i=t.openElements.getCommonAncestor(e);for(let s=0,a=i;a!==n;s++,a=i){i=t.openElements.getCommonAncestor(a);const o=t.activeFormattingElements.getElementEntry(a),u=o&&s>=rk;!o||u?(u&&t.activeFormattingElements.removeEntry(o),t.openElements.remove(a)):(a=uk(t,o),r===e&&(t.activeFormattingElements.bookmark=o),t.treeAdapter.detachNode(r),t.treeAdapter.appendChild(a,r),r=a)}return r}function uk(t,e){const n=t.treeAdapter.getNamespaceURI(e.element),r=t.treeAdapter.createElement(e.token.tagName,n,e.token.attrs);return t.openElements.replace(e.element,r),e.element=r,r}function lk(t,e,n){const r=t.treeAdapter.getTagName(e),i=$n(r);if(t._isElementCausesFosterParenting(i))t._fosterParentElement(n);else{const s=t.treeAdapter.getNamespaceURI(e);i===f.TEMPLATE&&s===$.HTML&&(e=t.treeAdapter.getTemplateContent(e)),t.treeAdapter.appendChild(e,n)}}function ck(t,e,n){const r=t.treeAdapter.getNamespaceURI(n.element),{token:i}=n,s=t.treeAdapter.createElement(i.tagName,r,i.attrs);t._adoptNodes(e,s),t.treeAdapter.appendChild(e,s),t.activeFormattingElements.insertElementAfterBookmark(s,i),t.activeFormattingElements.removeEntry(n),t.openElements.remove(n.element),t.openElements.insertAfter(e,s,i.tagID)}function $a(t,e){for(let n=0;n<nk;n++){const r=sk(t,e);if(!r)break;const i=ak(t,r);if(!i)break;t.activeFormattingElements.bookmark=r;const s=ok(t,i,r.element),a=t.openElements.getCommonAncestor(r.element);t.treeAdapter.detachNode(s),a&&lk(t,a,s),ck(t,i,r)}}function na(t,e){t._appendCommentNode(e,t.openElements.currentTmplContentOrNode)}function dk(t,e){t._appendCommentNode(e,t.openElements.items[0])}function fk(t,e){t._appendCommentNode(e,t.document)}function Za(t,e){if(t.stopped=!0,e.location){const n=t.fragmentContext?0:2;for(let r=t.openElements.stackTop;r>=n;r--)t._setEndLocation(t.openElements.items[r],e);if(!t.fragmentContext&&t.openElements.stackTop>=0){const r=t.openElements.items[0],i=t.treeAdapter.getNodeSourceCodeLocation(r);if(i&&!i.endTag&&(t._setEndLocation(r,e),t.openElements.stackTop>=1)){const s=t.openElements.items[1],a=t.treeAdapter.getNodeSourceCodeLocation(s);a&&!a.endTag&&t._setEndLocation(s,e)}}}}function hk(t,e){t._setDocumentType(e);const n=e.forceQuirks?bt.QUIRKS:$3(e);H3(e)||t._err(e,M.nonConformingDoctype),t.treeAdapter.setDocumentMode(t.document,n),t.insertionMode=I.BEFORE_HTML}function tr(t,e){t._err(e,M.missingDoctype,!0),t.treeAdapter.setDocumentMode(t.document,bt.QUIRKS),t.insertionMode=I.BEFORE_HTML,t._processToken(e)}function pk(t,e){e.tagID===f.HTML?(t._insertElement(e,$.HTML),t.insertionMode=I.BEFORE_HEAD):gr(t,e)}function mk(t,e){const n=e.tagID;(n===f.HTML||n===f.HEAD||n===f.BODY||n===f.BR)&&gr(t,e)}function gr(t,e){t._insertFakeRootElement(),t.insertionMode=I.BEFORE_HEAD,t._processToken(e)}function gk(t,e){switch(e.tagID){case f.HTML:{Xe(t,e);break}case f.HEAD:{t._insertElement(e,$.HTML),t.headElement=t.openElements.current,t.insertionMode=I.IN_HEAD;break}default:br(t,e)}}function bk(t,e){const n=e.tagID;n===f.HEAD||n===f.BODY||n===f.HTML||n===f.BR?br(t,e):t._err(e,M.endTagWithoutMatchingOpenElement)}function br(t,e){t._insertFakeElement(L.HEAD,f.HEAD),t.headElement=t.openElements.current,t.insertionMode=I.IN_HEAD,t._processToken(e)}function At(t,e){switch(e.tagID){case f.HTML:{Xe(t,e);break}case f.BASE:case f.BASEFONT:case f.BGSOUND:case f.LINK:case f.META:{t._appendElement(e,$.HTML),e.ackSelfClosing=!0;break}case f.TITLE:{t._switchToTextParsing(e,Ue.RCDATA);break}case f.NOSCRIPT:{t.options.scriptingEnabled?t._switchToTextParsing(e,Ue.RAWTEXT):(t._insertElement(e,$.HTML),t.insertionMode=I.IN_HEAD_NO_SCRIPT);break}case f.NOFRAMES:case f.STYLE:{t._switchToTextParsing(e,Ue.RAWTEXT);break}case f.SCRIPT:{t._switchToTextParsing(e,Ue.SCRIPT_DATA);break}case f.TEMPLATE:{t._insertTemplate(e),t.activeFormattingElements.insertMarker(),t.framesetOk=!1,t.insertionMode=I.IN_TEMPLATE,t.tmplInsertionModeStack.unshift(I.IN_TEMPLATE);break}case f.HEAD:{t._err(e,M.misplacedStartTagForHeadElement);break}default:Er(t,e)}}function Ek(t,e){switch(e.tagID){case f.HEAD:{t.openElements.pop(),t.insertionMode=I.AFTER_HEAD;break}case f.BODY:case f.BR:case f.HTML:{Er(t,e);break}case f.TEMPLATE:{bn(t,e);break}default:t._err(e,M.endTagWithoutMatchingOpenElement)}}function bn(t,e){t.openElements.tmplCount>0?(t.openElements.generateImpliedEndTagsThoroughly(),t.openElements.currentTagId!==f.TEMPLATE&&t._err(e,M.closingOfElementWithOpenChildElements),t.openElements.popUntilTagNamePopped(f.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode()):t._err(e,M.endTagWithoutMatchingOpenElement)}function Er(t,e){t.openElements.pop(),t.insertionMode=I.AFTER_HEAD,t._processToken(e)}function xk(t,e){switch(e.tagID){case f.HTML:{Xe(t,e);break}case f.BASEFONT:case f.BGSOUND:case f.HEAD:case f.LINK:case f.META:case f.NOFRAMES:case f.STYLE:{At(t,e);break}case f.NOSCRIPT:{t._err(e,M.nestedNoscriptInHead);break}default:xr(t,e)}}function Tk(t,e){switch(e.tagID){case f.NOSCRIPT:{t.openElements.pop(),t.insertionMode=I.IN_HEAD;break}case f.BR:{xr(t,e);break}default:t._err(e,M.endTagWithoutMatchingOpenElement)}}function xr(t,e){const n=e.type===me.EOF?M.openElementsLeftAfterEof:M.disallowedContentInNoscriptInHead;t._err(e,n),t.openElements.pop(),t.insertionMode=I.IN_HEAD,t._processToken(e)}function _k(t,e){switch(e.tagID){case f.HTML:{Xe(t,e);break}case f.BODY:{t._insertElement(e,$.HTML),t.framesetOk=!1,t.insertionMode=I.IN_BODY;break}case f.FRAMESET:{t._insertElement(e,$.HTML),t.insertionMode=I.IN_FRAMESET;break}case f.BASE:case f.BASEFONT:case f.BGSOUND:case f.LINK:case f.META:case f.NOFRAMES:case f.SCRIPT:case f.STYLE:case f.TEMPLATE:case f.TITLE:{t._err(e,M.abandonedHeadElementChild),t.openElements.push(t.headElement,f.HEAD),At(t,e),t.openElements.remove(t.headElement);break}case f.HEAD:{t._err(e,M.misplacedStartTagForHeadElement);break}default:Tr(t,e)}}function yk(t,e){switch(e.tagID){case f.BODY:case f.HTML:case f.BR:{Tr(t,e);break}case f.TEMPLATE:{bn(t,e);break}default:t._err(e,M.endTagWithoutMatchingOpenElement)}}function Tr(t,e){t._insertFakeElement(L.BODY,f.BODY),t.insertionMode=I.IN_BODY,Hi(t,e)}function Hi(t,e){switch(e.type){case me.CHARACTER:{sf(t,e);break}case me.WHITESPACE_CHARACTER:{rf(t,e);break}case me.COMMENT:{na(t,e);break}case me.START_TAG:{Xe(t,e);break}case me.END_TAG:{$i(t,e);break}case me.EOF:{lf(t,e);break}}}function rf(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e)}function sf(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e),t.framesetOk=!1}function kk(t,e){t.openElements.tmplCount===0&&t.treeAdapter.adoptAttributes(t.openElements.items[0],e.attrs)}function Ak(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t.openElements.tmplCount===0&&(t.framesetOk=!1,t.treeAdapter.adoptAttributes(n,e.attrs))}function Sk(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();t.framesetOk&&n&&(t.treeAdapter.detachNode(n),t.openElements.popAllUpToHtmlElement(),t._insertElement(e,$.HTML),t.insertionMode=I.IN_FRAMESET)}function Ck(t,e){t.openElements.hasInButtonScope(f.P)&&t._closePElement(),t._insertElement(e,$.HTML)}function Ik(t,e){t.openElements.hasInButtonScope(f.P)&&t._closePElement(),t.openElements.currentTagId!==void 0&&ta.has(t.openElements.currentTagId)&&t.openElements.pop(),t._insertElement(e,$.HTML)}function Nk(t,e){t.openElements.hasInButtonScope(f.P)&&t._closePElement(),t._insertElement(e,$.HTML),t.skipNextNewLine=!0,t.framesetOk=!1}function wk(t,e){const n=t.openElements.tmplCount>0;(!t.formElement||n)&&(t.openElements.hasInButtonScope(f.P)&&t._closePElement(),t._insertElement(e,$.HTML),n||(t.formElement=t.openElements.current))}function vk(t,e){t.framesetOk=!1;const n=e.tagID;for(let r=t.openElements.stackTop;r>=0;r--){const i=t.openElements.tagIDs[r];if(n===f.LI&&i===f.LI||(n===f.DD||n===f.DT)&&(i===f.DD||i===f.DT)){t.openElements.generateImpliedEndTagsWithExclusion(i),t.openElements.popUntilTagNamePopped(i);break}if(i!==f.ADDRESS&&i!==f.DIV&&i!==f.P&&t._isSpecialElement(t.openElements.items[r],i))break}t.openElements.hasInButtonScope(f.P)&&t._closePElement(),t._insertElement(e,$.HTML)}function Rk(t,e){t.openElements.hasInButtonScope(f.P)&&t._closePElement(),t._insertElement(e,$.HTML),t.tokenizer.state=Ue.PLAINTEXT}function Ok(t,e){t.openElements.hasInScope(f.BUTTON)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(f.BUTTON)),t._reconstructActiveFormattingElements(),t._insertElement(e,$.HTML),t.framesetOk=!1}function Lk(t,e){const n=t.activeFormattingElements.getElementEntryInScopeWithTagName(L.A);n&&($a(t,e),t.openElements.remove(n.element),t.activeFormattingElements.removeEntry(n)),t._reconstructActiveFormattingElements(),t._insertElement(e,$.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function Dk(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,$.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function Pk(t,e){t._reconstructActiveFormattingElements(),t.openElements.hasInScope(f.NOBR)&&($a(t,e),t._reconstructActiveFormattingElements()),t._insertElement(e,$.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function Mk(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,$.HTML),t.activeFormattingElements.insertMarker(),t.framesetOk=!1}function Bk(t,e){t.treeAdapter.getDocumentMode(t.document)!==bt.QUIRKS&&t.openElements.hasInButtonScope(f.P)&&t._closePElement(),t._insertElement(e,$.HTML),t.framesetOk=!1,t.insertionMode=I.IN_TABLE}function af(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,$.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function of(t){const e=Wd(t,ln.TYPE);return e!=null&&e.toLowerCase()===tk}function Fk(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,$.HTML),of(e)||(t.framesetOk=!1),e.ackSelfClosing=!0}function zk(t,e){t._appendElement(e,$.HTML),e.ackSelfClosing=!0}function jk(t,e){t.openElements.hasInButtonScope(f.P)&&t._closePElement(),t._appendElement(e,$.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function Uk(t,e){e.tagName=L.IMG,e.tagID=f.IMG,af(t,e)}function Hk(t,e){t._insertElement(e,$.HTML),t.skipNextNewLine=!0,t.tokenizer.state=Ue.RCDATA,t.originalInsertionMode=t.insertionMode,t.framesetOk=!1,t.insertionMode=I.TEXT}function $k(t,e){t.openElements.hasInButtonScope(f.P)&&t._closePElement(),t._reconstructActiveFormattingElements(),t.framesetOk=!1,t._switchToTextParsing(e,Ue.RAWTEXT)}function Zk(t,e){t.framesetOk=!1,t._switchToTextParsing(e,Ue.RAWTEXT)}function Yu(t,e){t._switchToTextParsing(e,Ue.RAWTEXT)}function Yk(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,$.HTML),t.framesetOk=!1,t.insertionMode=t.insertionMode===I.IN_TABLE||t.insertionMode===I.IN_CAPTION||t.insertionMode===I.IN_TABLE_BODY||t.insertionMode===I.IN_ROW||t.insertionMode===I.IN_CELL?I.IN_SELECT_IN_TABLE:I.IN_SELECT}function qk(t,e){t.openElements.currentTagId===f.OPTION&&t.openElements.pop(),t._reconstructActiveFormattingElements(),t._insertElement(e,$.HTML)}function Vk(t,e){t.openElements.hasInScope(f.RUBY)&&t.openElements.generateImpliedEndTags(),t._insertElement(e,$.HTML)}function Wk(t,e){t.openElements.hasInScope(f.RUBY)&&t.openElements.generateImpliedEndTagsWithExclusion(f.RTC),t._insertElement(e,$.HTML)}function Gk(t,e){t._reconstructActiveFormattingElements(),ef(e),Ha(e),e.selfClosing?t._appendElement(e,$.MATHML):t._insertElement(e,$.MATHML),e.ackSelfClosing=!0}function Kk(t,e){t._reconstructActiveFormattingElements(),tf(e),Ha(e),e.selfClosing?t._appendElement(e,$.SVG):t._insertElement(e,$.SVG),e.ackSelfClosing=!0}function qu(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,$.HTML)}function Xe(t,e){switch(e.tagID){case f.I:case f.S:case f.B:case f.U:case f.EM:case f.TT:case f.BIG:case f.CODE:case f.FONT:case f.SMALL:case f.STRIKE:case f.STRONG:{Dk(t,e);break}case f.A:{Lk(t,e);break}case f.H1:case f.H2:case f.H3:case f.H4:case f.H5:case f.H6:{Ik(t,e);break}case f.P:case f.DL:case f.OL:case f.UL:case f.DIV:case f.DIR:case f.NAV:case f.MAIN:case f.MENU:case f.ASIDE:case f.CENTER:case f.FIGURE:case f.FOOTER:case f.HEADER:case f.HGROUP:case f.DIALOG:case f.DETAILS:case f.ADDRESS:case f.ARTICLE:case f.SEARCH:case f.SECTION:case f.SUMMARY:case f.FIELDSET:case f.BLOCKQUOTE:case f.FIGCAPTION:{Ck(t,e);break}case f.LI:case f.DD:case f.DT:{vk(t,e);break}case f.BR:case f.IMG:case f.WBR:case f.AREA:case f.EMBED:case f.KEYGEN:{af(t,e);break}case f.HR:{jk(t,e);break}case f.RB:case f.RTC:{Vk(t,e);break}case f.RT:case f.RP:{Wk(t,e);break}case f.PRE:case f.LISTING:{Nk(t,e);break}case f.XMP:{$k(t,e);break}case f.SVG:{Kk(t,e);break}case f.HTML:{kk(t,e);break}case f.BASE:case f.LINK:case f.META:case f.STYLE:case f.TITLE:case f.SCRIPT:case f.BGSOUND:case f.BASEFONT:case f.TEMPLATE:{At(t,e);break}case f.BODY:{Ak(t,e);break}case f.FORM:{wk(t,e);break}case f.NOBR:{Pk(t,e);break}case f.MATH:{Gk(t,e);break}case f.TABLE:{Bk(t,e);break}case f.INPUT:{Fk(t,e);break}case f.PARAM:case f.TRACK:case f.SOURCE:{zk(t,e);break}case f.IMAGE:{Uk(t,e);break}case f.BUTTON:{Ok(t,e);break}case f.APPLET:case f.OBJECT:case f.MARQUEE:{Mk(t,e);break}case f.IFRAME:{Zk(t,e);break}case f.SELECT:{Yk(t,e);break}case f.OPTION:case f.OPTGROUP:{qk(t,e);break}case f.NOEMBED:case f.NOFRAMES:{Yu(t,e);break}case f.FRAMESET:{Sk(t,e);break}case f.TEXTAREA:{Hk(t,e);break}case f.NOSCRIPT:{t.options.scriptingEnabled?Yu(t,e):qu(t,e);break}case f.PLAINTEXT:{Rk(t,e);break}case f.COL:case f.TH:case f.TD:case f.TR:case f.HEAD:case f.FRAME:case f.TBODY:case f.TFOOT:case f.THEAD:case f.CAPTION:case f.COLGROUP:break;default:qu(t,e)}}function Qk(t,e){if(t.openElements.hasInScope(f.BODY)&&(t.insertionMode=I.AFTER_BODY,t.options.sourceCodeLocationInfo)){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t._setEndLocation(n,e)}}function Xk(t,e){t.openElements.hasInScope(f.BODY)&&(t.insertionMode=I.AFTER_BODY,bf(t,e))}function Jk(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n))}function eA(t){const e=t.openElements.tmplCount>0,{formElement:n}=t;e||(t.formElement=null),(n||e)&&t.openElements.hasInScope(f.FORM)&&(t.openElements.generateImpliedEndTags(),e?t.openElements.popUntilTagNamePopped(f.FORM):n&&t.openElements.remove(n))}function tA(t){t.openElements.hasInButtonScope(f.P)||t._insertFakeElement(L.P,f.P),t._closePElement()}function nA(t){t.openElements.hasInListItemScope(f.LI)&&(t.openElements.generateImpliedEndTagsWithExclusion(f.LI),t.openElements.popUntilTagNamePopped(f.LI))}function rA(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTagsWithExclusion(n),t.openElements.popUntilTagNamePopped(n))}function iA(t){t.openElements.hasNumberedHeaderInScope()&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilNumberedHeaderPopped())}function sA(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker())}function aA(t){t._reconstructActiveFormattingElements(),t._insertFakeElement(L.BR,f.BR),t.openElements.pop(),t.framesetOk=!1}function uf(t,e){const n=e.tagName,r=e.tagID;for(let i=t.openElements.stackTop;i>0;i--){const s=t.openElements.items[i],a=t.openElements.tagIDs[i];if(r===a&&(r!==f.UNKNOWN||t.treeAdapter.getTagName(s)===n)){t.openElements.generateImpliedEndTagsWithExclusion(r),t.openElements.stackTop>=i&&t.openElements.shortenToLength(i);break}if(t._isSpecialElement(s,a))break}}function $i(t,e){switch(e.tagID){case f.A:case f.B:case f.I:case f.S:case f.U:case f.EM:case f.TT:case f.BIG:case f.CODE:case f.FONT:case f.NOBR:case f.SMALL:case f.STRIKE:case f.STRONG:{$a(t,e);break}case f.P:{tA(t);break}case f.DL:case f.UL:case f.OL:case f.DIR:case f.DIV:case f.NAV:case f.PRE:case f.MAIN:case f.MENU:case f.ASIDE:case f.BUTTON:case f.CENTER:case f.FIGURE:case f.FOOTER:case f.HEADER:case f.HGROUP:case f.DIALOG:case f.ADDRESS:case f.ARTICLE:case f.DETAILS:case f.SEARCH:case f.SECTION:case f.SUMMARY:case f.LISTING:case f.FIELDSET:case f.BLOCKQUOTE:case f.FIGCAPTION:{Jk(t,e);break}case f.LI:{nA(t);break}case f.DD:case f.DT:{rA(t,e);break}case f.H1:case f.H2:case f.H3:case f.H4:case f.H5:case f.H6:{iA(t);break}case f.BR:{aA(t);break}case f.BODY:{Qk(t,e);break}case f.HTML:{Xk(t,e);break}case f.FORM:{eA(t);break}case f.APPLET:case f.OBJECT:case f.MARQUEE:{sA(t,e);break}case f.TEMPLATE:{bn(t,e);break}default:uf(t,e)}}function lf(t,e){t.tmplInsertionModeStack.length>0?gf(t,e):Za(t,e)}function oA(t,e){var n;e.tagID===f.SCRIPT&&((n=t.scriptHandler)===null||n===void 0||n.call(t,t.openElements.current)),t.openElements.pop(),t.insertionMode=t.originalInsertionMode}function uA(t,e){t._err(e,M.eofInElementThatCanContainOnlyText),t.openElements.pop(),t.insertionMode=t.originalInsertionMode,t.onEof(e)}function bs(t,e){if(t.openElements.currentTagId!==void 0&&nf.has(t.openElements.currentTagId))switch(t.pendingCharacterTokens.length=0,t.hasNonWhitespacePendingCharacterToken=!1,t.originalInsertionMode=t.insertionMode,t.insertionMode=I.IN_TABLE_TEXT,e.type){case me.CHARACTER:{df(t,e);break}case me.WHITESPACE_CHARACTER:{cf(t,e);break}}else jr(t,e)}function lA(t,e){t.openElements.clearBackToTableContext(),t.activeFormattingElements.insertMarker(),t._insertElement(e,$.HTML),t.insertionMode=I.IN_CAPTION}function cA(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,$.HTML),t.insertionMode=I.IN_COLUMN_GROUP}function dA(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(L.COLGROUP,f.COLGROUP),t.insertionMode=I.IN_COLUMN_GROUP,Ya(t,e)}function fA(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,$.HTML),t.insertionMode=I.IN_TABLE_BODY}function hA(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(L.TBODY,f.TBODY),t.insertionMode=I.IN_TABLE_BODY,Zi(t,e)}function pA(t,e){t.openElements.hasInTableScope(f.TABLE)&&(t.openElements.popUntilTagNamePopped(f.TABLE),t._resetInsertionMode(),t._processStartTag(e))}function mA(t,e){of(e)?t._appendElement(e,$.HTML):jr(t,e),e.ackSelfClosing=!0}function gA(t,e){!t.formElement&&t.openElements.tmplCount===0&&(t._insertElement(e,$.HTML),t.formElement=t.openElements.current,t.openElements.pop())}function Pn(t,e){switch(e.tagID){case f.TD:case f.TH:case f.TR:{hA(t,e);break}case f.STYLE:case f.SCRIPT:case f.TEMPLATE:{At(t,e);break}case f.COL:{dA(t,e);break}case f.FORM:{gA(t,e);break}case f.TABLE:{pA(t,e);break}case f.TBODY:case f.TFOOT:case f.THEAD:{fA(t,e);break}case f.INPUT:{mA(t,e);break}case f.CAPTION:{lA(t,e);break}case f.COLGROUP:{cA(t,e);break}default:jr(t,e)}}function Sr(t,e){switch(e.tagID){case f.TABLE:{t.openElements.hasInTableScope(f.TABLE)&&(t.openElements.popUntilTagNamePopped(f.TABLE),t._resetInsertionMode());break}case f.TEMPLATE:{bn(t,e);break}case f.BODY:case f.CAPTION:case f.COL:case f.COLGROUP:case f.HTML:case f.TBODY:case f.TD:case f.TFOOT:case f.TH:case f.THEAD:case f.TR:break;default:jr(t,e)}}function jr(t,e){const n=t.fosterParentingEnabled;t.fosterParentingEnabled=!0,Hi(t,e),t.fosterParentingEnabled=n}function cf(t,e){t.pendingCharacterTokens.push(e)}function df(t,e){t.pendingCharacterTokens.push(e),t.hasNonWhitespacePendingCharacterToken=!0}function nr(t,e){let n=0;if(t.hasNonWhitespacePendingCharacterToken)for(;n<t.pendingCharacterTokens.length;n++)jr(t,t.pendingCharacterTokens[n]);else for(;n<t.pendingCharacterTokens.length;n++)t._insertCharacters(t.pendingCharacterTokens[n]);t.insertionMode=t.originalInsertionMode,t._processToken(e)}const ff=new Set([f.CAPTION,f.COL,f.COLGROUP,f.TBODY,f.TD,f.TFOOT,f.TH,f.THEAD,f.TR]);function bA(t,e){const n=e.tagID;ff.has(n)?t.openElements.hasInTableScope(f.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(f.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=I.IN_TABLE,Pn(t,e)):Xe(t,e)}function EA(t,e){const n=e.tagID;switch(n){case f.CAPTION:case f.TABLE:{t.openElements.hasInTableScope(f.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(f.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=I.IN_TABLE,n===f.TABLE&&Sr(t,e));break}case f.BODY:case f.COL:case f.COLGROUP:case f.HTML:case f.TBODY:case f.TD:case f.TFOOT:case f.TH:case f.THEAD:case f.TR:break;default:$i(t,e)}}function Ya(t,e){switch(e.tagID){case f.HTML:{Xe(t,e);break}case f.COL:{t._appendElement(e,$.HTML),e.ackSelfClosing=!0;break}case f.TEMPLATE:{At(t,e);break}default:ki(t,e)}}function xA(t,e){switch(e.tagID){case f.COLGROUP:{t.openElements.currentTagId===f.COLGROUP&&(t.openElements.pop(),t.insertionMode=I.IN_TABLE);break}case f.TEMPLATE:{bn(t,e);break}case f.COL:break;default:ki(t,e)}}function ki(t,e){t.openElements.currentTagId===f.COLGROUP&&(t.openElements.pop(),t.insertionMode=I.IN_TABLE,t._processToken(e))}function Zi(t,e){switch(e.tagID){case f.TR:{t.openElements.clearBackToTableBodyContext(),t._insertElement(e,$.HTML),t.insertionMode=I.IN_ROW;break}case f.TH:case f.TD:{t.openElements.clearBackToTableBodyContext(),t._insertFakeElement(L.TR,f.TR),t.insertionMode=I.IN_ROW,Yi(t,e);break}case f.CAPTION:case f.COL:case f.COLGROUP:case f.TBODY:case f.TFOOT:case f.THEAD:{t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=I.IN_TABLE,Pn(t,e));break}default:Pn(t,e)}}function ra(t,e){const n=e.tagID;switch(e.tagID){case f.TBODY:case f.TFOOT:case f.THEAD:{t.openElements.hasInTableScope(n)&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=I.IN_TABLE);break}case f.TABLE:{t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=I.IN_TABLE,Sr(t,e));break}case f.BODY:case f.CAPTION:case f.COL:case f.COLGROUP:case f.HTML:case f.TD:case f.TH:case f.TR:break;default:Sr(t,e)}}function Yi(t,e){switch(e.tagID){case f.TH:case f.TD:{t.openElements.clearBackToTableRowContext(),t._insertElement(e,$.HTML),t.insertionMode=I.IN_CELL,t.activeFormattingElements.insertMarker();break}case f.CAPTION:case f.COL:case f.COLGROUP:case f.TBODY:case f.TFOOT:case f.THEAD:case f.TR:{t.openElements.hasInTableScope(f.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=I.IN_TABLE_BODY,Zi(t,e));break}default:Pn(t,e)}}function hf(t,e){switch(e.tagID){case f.TR:{t.openElements.hasInTableScope(f.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=I.IN_TABLE_BODY);break}case f.TABLE:{t.openElements.hasInTableScope(f.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=I.IN_TABLE_BODY,ra(t,e));break}case f.TBODY:case f.TFOOT:case f.THEAD:{(t.openElements.hasInTableScope(e.tagID)||t.openElements.hasInTableScope(f.TR))&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=I.IN_TABLE_BODY,ra(t,e));break}case f.BODY:case f.CAPTION:case f.COL:case f.COLGROUP:case f.HTML:case f.TD:case f.TH:break;default:Sr(t,e)}}function TA(t,e){const n=e.tagID;ff.has(n)?(t.openElements.hasInTableScope(f.TD)||t.openElements.hasInTableScope(f.TH))&&(t._closeTableCell(),Yi(t,e)):Xe(t,e)}function _A(t,e){const n=e.tagID;switch(n){case f.TD:case f.TH:{t.openElements.hasInTableScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=I.IN_ROW);break}case f.TABLE:case f.TBODY:case f.TFOOT:case f.THEAD:case f.TR:{t.openElements.hasInTableScope(n)&&(t._closeTableCell(),hf(t,e));break}case f.BODY:case f.CAPTION:case f.COL:case f.COLGROUP:case f.HTML:break;default:$i(t,e)}}function pf(t,e){switch(e.tagID){case f.HTML:{Xe(t,e);break}case f.OPTION:{t.openElements.currentTagId===f.OPTION&&t.openElements.pop(),t._insertElement(e,$.HTML);break}case f.OPTGROUP:{t.openElements.currentTagId===f.OPTION&&t.openElements.pop(),t.openElements.currentTagId===f.OPTGROUP&&t.openElements.pop(),t._insertElement(e,$.HTML);break}case f.HR:{t.openElements.currentTagId===f.OPTION&&t.openElements.pop(),t.openElements.currentTagId===f.OPTGROUP&&t.openElements.pop(),t._appendElement(e,$.HTML),e.ackSelfClosing=!0;break}case f.INPUT:case f.KEYGEN:case f.TEXTAREA:case f.SELECT:{t.openElements.hasInSelectScope(f.SELECT)&&(t.openElements.popUntilTagNamePopped(f.SELECT),t._resetInsertionMode(),e.tagID!==f.SELECT&&t._processStartTag(e));break}case f.SCRIPT:case f.TEMPLATE:{At(t,e);break}}}function mf(t,e){switch(e.tagID){case f.OPTGROUP:{t.openElements.stackTop>0&&t.openElements.currentTagId===f.OPTION&&t.openElements.tagIDs[t.openElements.stackTop-1]===f.OPTGROUP&&t.openElements.pop(),t.openElements.currentTagId===f.OPTGROUP&&t.openElements.pop();break}case f.OPTION:{t.openElements.currentTagId===f.OPTION&&t.openElements.pop();break}case f.SELECT:{t.openElements.hasInSelectScope(f.SELECT)&&(t.openElements.popUntilTagNamePopped(f.SELECT),t._resetInsertionMode());break}case f.TEMPLATE:{bn(t,e);break}}}function yA(t,e){const n=e.tagID;n===f.CAPTION||n===f.TABLE||n===f.TBODY||n===f.TFOOT||n===f.THEAD||n===f.TR||n===f.TD||n===f.TH?(t.openElements.popUntilTagNamePopped(f.SELECT),t._resetInsertionMode(),t._processStartTag(e)):pf(t,e)}function kA(t,e){const n=e.tagID;n===f.CAPTION||n===f.TABLE||n===f.TBODY||n===f.TFOOT||n===f.THEAD||n===f.TR||n===f.TD||n===f.TH?t.openElements.hasInTableScope(n)&&(t.openElements.popUntilTagNamePopped(f.SELECT),t._resetInsertionMode(),t.onEndTag(e)):mf(t,e)}function AA(t,e){switch(e.tagID){case f.BASE:case f.BASEFONT:case f.BGSOUND:case f.LINK:case f.META:case f.NOFRAMES:case f.SCRIPT:case f.STYLE:case f.TEMPLATE:case f.TITLE:{At(t,e);break}case f.CAPTION:case f.COLGROUP:case f.TBODY:case f.TFOOT:case f.THEAD:{t.tmplInsertionModeStack[0]=I.IN_TABLE,t.insertionMode=I.IN_TABLE,Pn(t,e);break}case f.COL:{t.tmplInsertionModeStack[0]=I.IN_COLUMN_GROUP,t.insertionMode=I.IN_COLUMN_GROUP,Ya(t,e);break}case f.TR:{t.tmplInsertionModeStack[0]=I.IN_TABLE_BODY,t.insertionMode=I.IN_TABLE_BODY,Zi(t,e);break}case f.TD:case f.TH:{t.tmplInsertionModeStack[0]=I.IN_ROW,t.insertionMode=I.IN_ROW,Yi(t,e);break}default:t.tmplInsertionModeStack[0]=I.IN_BODY,t.insertionMode=I.IN_BODY,Xe(t,e)}}function SA(t,e){e.tagID===f.TEMPLATE&&bn(t,e)}function gf(t,e){t.openElements.tmplCount>0?(t.openElements.popUntilTagNamePopped(f.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode(),t.onEof(e)):Za(t,e)}function CA(t,e){e.tagID===f.HTML?Xe(t,e):Ai(t,e)}function bf(t,e){var n;if(e.tagID===f.HTML){if(t.fragmentContext||(t.insertionMode=I.AFTER_AFTER_BODY),t.options.sourceCodeLocationInfo&&t.openElements.tagIDs[0]===f.HTML){t._setEndLocation(t.openElements.items[0],e);const r=t.openElements.items[1];r&&!(!((n=t.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&t._setEndLocation(r,e)}}else Ai(t,e)}function Ai(t,e){t.insertionMode=I.IN_BODY,Hi(t,e)}function IA(t,e){switch(e.tagID){case f.HTML:{Xe(t,e);break}case f.FRAMESET:{t._insertElement(e,$.HTML);break}case f.FRAME:{t._appendElement(e,$.HTML),e.ackSelfClosing=!0;break}case f.NOFRAMES:{At(t,e);break}}}function NA(t,e){e.tagID===f.FRAMESET&&!t.openElements.isRootHtmlElementCurrent()&&(t.openElements.pop(),!t.fragmentContext&&t.openElements.currentTagId!==f.FRAMESET&&(t.insertionMode=I.AFTER_FRAMESET))}function wA(t,e){switch(e.tagID){case f.HTML:{Xe(t,e);break}case f.NOFRAMES:{At(t,e);break}}}function vA(t,e){e.tagID===f.HTML&&(t.insertionMode=I.AFTER_AFTER_FRAMESET)}function RA(t,e){e.tagID===f.HTML?Xe(t,e):ui(t,e)}function ui(t,e){t.insertionMode=I.IN_BODY,Hi(t,e)}function OA(t,e){switch(e.tagID){case f.HTML:{Xe(t,e);break}case f.NOFRAMES:{At(t,e);break}}}function LA(t,e){e.chars=Le,t._insertCharacters(e)}function DA(t,e){t._insertCharacters(e),t.framesetOk=!1}function Ef(t){for(;t.treeAdapter.getNamespaceURI(t.openElements.current)!==$.HTML&&t.openElements.currentTagId!==void 0&&!t._isIntegrationPoint(t.openElements.currentTagId,t.openElements.current);)t.openElements.pop()}function PA(t,e){if(K3(e))Ef(t),t._startTagOutsideForeignContent(e);else{const n=t._getAdjustedCurrentElement(),r=t.treeAdapter.getNamespaceURI(n);r===$.MATHML?ef(e):r===$.SVG&&(Q3(e),tf(e)),Ha(e),e.selfClosing?t._appendElement(e,r):t._insertElement(e,r),e.ackSelfClosing=!0}}function MA(t,e){if(e.tagID===f.P||e.tagID===f.BR){Ef(t),t._endTagOutsideForeignContent(e);return}for(let n=t.openElements.stackTop;n>0;n--){const r=t.openElements.items[n];if(t.treeAdapter.getNamespaceURI(r)===$.HTML){t._endTagOutsideForeignContent(e);break}const i=t.treeAdapter.getTagName(r);if(i.toLowerCase()===e.tagName){e.tagName=i,t.openElements.shortenToLength(n);break}}}L.AREA,L.BASE,L.BASEFONT,L.BGSOUND,L.BR,L.COL,L.EMBED,L.FRAME,L.HR,L.IMG,L.INPUT,L.KEYGEN,L.LINK,L.META,L.PARAM,L.SOURCE,L.TRACK,L.WBR;const BA=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,FA=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),Vu={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function xf(t,e){const n=WA(t),r=$d("type",{handlers:{root:zA,element:jA,text:UA,comment:_f,doctype:HA,raw:ZA},unknown:YA}),i={parser:n?new Zu(Vu):Zu.getFragmentParser(void 0,Vu),handle(o){r(o,i)},stitches:!1,options:e||{}};r(t,i),Zn(i,Rt());const s=n?i.parser.document:i.parser.getFragment(),a=Gy(s,{file:i.options.file});return i.stitches&&Ui(a,"comment",function(o,u,l){const d=o;if(d.value.stitch&&l&&u!==void 0){const c=l.children;return c[u]=d.value.stitch,u}}),a.type==="root"&&a.children.length===1&&a.children[0].type===t.type?a.children[0]:a}function Tf(t,e){let n=-1;if(t)for(;++n<t.length;)e.handle(t[n])}function zA(t,e){Tf(t.children,e)}function jA(t,e){qA(t,e),Tf(t.children,e),VA(t,e)}function UA(t,e){e.parser.tokenizer.state>4&&(e.parser.tokenizer.state=0);const n={type:me.CHARACTER,chars:t.value,location:Ur(t)};Zn(e,Rt(t)),e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)}function HA(t,e){const n={type:me.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:Ur(t)};Zn(e,Rt(t)),e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)}function $A(t,e){e.stitches=!0;const n=GA(t);if("children"in t&&"children"in n){const r=xf({type:"root",children:t.children},e.options);n.children=r.children}_f({type:"comment",value:{stitch:n}},e)}function _f(t,e){const n=t.value,r={type:me.COMMENT,data:n,location:Ur(t)};Zn(e,Rt(t)),e.parser.currentToken=r,e.parser._processToken(e.parser.currentToken)}function ZA(t,e){if(e.parser.tokenizer.preprocessor.html="",e.parser.tokenizer.preprocessor.pos=-1,e.parser.tokenizer.preprocessor.lastGapPos=-2,e.parser.tokenizer.preprocessor.gapStack=[],e.parser.tokenizer.preprocessor.skipNextNewLine=!1,e.parser.tokenizer.preprocessor.lastChunkWritten=!1,e.parser.tokenizer.preprocessor.endOfChunkHit=!1,e.parser.tokenizer.preprocessor.isEol=!1,yf(e,Rt(t)),e.parser.tokenizer.write(e.options.tagfilter?t.value.replace(BA,"<$1$2"):t.value,!1),e.parser.tokenizer._runParsingLoop(),e.parser.tokenizer.state===72||e.parser.tokenizer.state===78){e.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=e.parser.tokenizer._consume();e.parser.tokenizer._callState(n)}}function YA(t,e){const n=t;if(e.options.passThrough&&e.options.passThrough.includes(n.type))$A(n,e);else{let r="";throw FA.has(n.type)&&(r=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+r)}}function Zn(t,e){yf(t,e);const n=t.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=t.parser.tokenizer.preprocessor.line,n.location.endCol=t.parser.tokenizer.preprocessor.col+1,n.location.endOffset=t.parser.tokenizer.preprocessor.offset+1,t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)),t.parser.tokenizer.paused=!1,t.parser.tokenizer.inLoop=!1,t.parser.tokenizer.active=!1,t.parser.tokenizer.returnState=Ue.DATA,t.parser.tokenizer.charRefCode=-1,t.parser.tokenizer.consumedAfterSnapshot=-1,t.parser.tokenizer.currentLocation=null,t.parser.tokenizer.currentCharacterToken=null,t.parser.tokenizer.currentToken=null,t.parser.tokenizer.currentAttr={name:"",value:""}}function yf(t,e){if(e&&e.offset!==void 0){const n={startLine:e.line,startCol:e.column,startOffset:e.offset,endLine:-1,endCol:-1,endOffset:-1};t.parser.tokenizer.preprocessor.lineStartPos=-e.column+1,t.parser.tokenizer.preprocessor.droppedBufferSize=e.offset,t.parser.tokenizer.preprocessor.line=e.line,t.parser.tokenizer.currentLocation=n}}function qA(t,e){const n=t.tagName.toLowerCase();if(e.parser.tokenizer.state===Ue.PLAINTEXT)return;Zn(e,Rt(t));const r=e.parser.openElements.current;let i="namespaceURI"in r?r.namespaceURI:un.html;i===un.html&&n==="svg"&&(i=un.svg);const s=e3({...t,children:[]},{space:i===un.svg?"svg":"html"}),a={type:me.START_TAG,tagName:n,tagID:$n(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in s?s.attrs:[],location:Ur(t)};e.parser.currentToken=a,e.parser._processToken(e.parser.currentToken),e.parser.tokenizer.lastStartTagName=n}function VA(t,e){const n=t.tagName.toLowerCase();if(!e.parser.tokenizer.inForeignNode&&u3.includes(n)||e.parser.tokenizer.state===Ue.PLAINTEXT)return;Zn(e,Pi(t));const r={type:me.END_TAG,tagName:n,tagID:$n(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:Ur(t)};e.parser.currentToken=r,e.parser._processToken(e.parser.currentToken),n===e.parser.tokenizer.lastStartTagName&&(e.parser.tokenizer.state===Ue.RCDATA||e.parser.tokenizer.state===Ue.RAWTEXT||e.parser.tokenizer.state===Ue.SCRIPT_DATA)&&(e.parser.tokenizer.state=Ue.DATA)}function WA(t){const e=t.type==="root"?t.children[0]:t;return!!(e&&(e.type==="doctype"||e.type==="element"&&e.tagName.toLowerCase()==="html"))}function Ur(t){const e=Rt(t)||{line:void 0,column:void 0,offset:void 0},n=Pi(t)||{line:void 0,column:void 0,offset:void 0};return{startLine:e.line,startCol:e.column,startOffset:e.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function GA(t){return"children"in t?Dn({...t,children:[]}):Dn(t)}function KA(t){return function(e,n){return xf(e,{...t,file:n})}}function Wu(t,e){const n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(e);for(;i!==-1;)r++,i=n.indexOf(e,i+e.length);return r}function QA(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function XA(t,e,n){const i=zi((n||{}).ignore||[]),s=JA(e);let a=-1;for(;++a<s.length;)Fd(t,"text",o);function o(l,d){let c=-1,h;for(;++c<d.length;){const p=d[c],g=h?h.children:void 0;if(i(p,g?g.indexOf(p):void 0,h))return;h=p}if(h)return u(l,d)}function u(l,d){const c=d[d.length-1],h=s[a][0],p=s[a][1];let g=0;const x=c.children.indexOf(l);let E=!1,k=[];h.lastIndex=0;let y=h.exec(l.value);for(;y;){const _=y.index,R={index:y.index,input:y.input,stack:[...d,l]};let S=p(...y,R);if(typeof S=="string"&&(S=S.length>0?{type:"text",value:S}:void 0),S===!1?h.lastIndex=_+1:(g!==_&&k.push({type:"text",value:l.value.slice(g,_)}),Array.isArray(S)?k.push(...S):S&&k.push(S),g=_+y[0].length,E=!0),!h.global)break;y=h.exec(l.value)}return E?(g<l.value.length&&k.push({type:"text",value:l.value.slice(g)}),c.children.splice(x,1,...k)):k=[l],x+k.length}}function JA(t){const e=[];if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!t[0]||Array.isArray(t[0])?t:[t];let r=-1;for(;++r<n.length;){const i=n[r];e.push([eS(i[0]),tS(i[1])])}return e}function eS(t){return typeof t=="string"?new RegExp(QA(t),"g"):t}function tS(t){return typeof t=="function"?t:function(){return t}}const Es="phrasing",xs=["autolink","link","image","label"];function nS(){return{transforms:[lS],enter:{literalAutolink:iS,literalAutolinkEmail:Ts,literalAutolinkHttp:Ts,literalAutolinkWww:Ts},exit:{literalAutolink:uS,literalAutolinkEmail:oS,literalAutolinkHttp:sS,literalAutolinkWww:aS}}}function rS(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Es,notInConstruct:xs},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Es,notInConstruct:xs},{character:":",before:"[ps]",after:"\\/",inConstruct:Es,notInConstruct:xs}]}}function iS(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function Ts(t){this.config.enter.autolinkProtocol.call(this,t)}function sS(t){this.config.exit.autolinkProtocol.call(this,t)}function aS(t){this.config.exit.data.call(this,t);const e=this.stack[this.stack.length-1];e.type,e.url="http://"+this.sliceSerialize(t)}function oS(t){this.config.exit.autolinkEmail.call(this,t)}function uS(t){this.exit(t)}function lS(t){XA(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,cS],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),dS]],{ignore:["link","linkReference"]})}function cS(t,e,n,r,i){let s="";if(!kf(i)||(/^w/i.test(e)&&(n=e+n,e="",s="http://"),!fS(n)))return!1;const a=hS(n+r);if(!a[0])return!1;const o={type:"link",title:null,url:s+e+a[0],children:[{type:"text",value:e+a[0]}]};return a[1]?[o,{type:"text",value:a[1]}]:o}function dS(t,e,n,r){return!kf(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+e+"@"+n,children:[{type:"text",value:e+"@"+n}]}}function fS(t){const e=t.split(".");return!(e.length<2||e[e.length-1]&&(/_/.test(e[e.length-1])||!/[a-zA-Z\d]/.test(e[e.length-1]))||e[e.length-2]&&(/_/.test(e[e.length-2])||!/[a-zA-Z\d]/.test(e[e.length-2])))}function hS(t){const e=/[!"&'),.:;<>?\]}]+$/.exec(t);if(!e)return[t,void 0];t=t.slice(0,e.index);let n=e[0],r=n.indexOf(")");const i=Wu(t,"(");let s=Wu(t,")");for(;r!==-1&&i>s;)t+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[t,n]}function kf(t,e){const n=t.input.charCodeAt(t.index-1);return(t.index===0||hn(n)||Mi(n))&&(!e||n!==47)}Af.peek=yS;function pS(){this.buffer()}function mS(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function gS(){this.buffer()}function bS(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function ES(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=yt(this.sliceSerialize(t)).toLowerCase(),n.label=e}function xS(t){this.exit(t)}function TS(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=yt(this.sliceSerialize(t)).toLowerCase(),n.label=e}function _S(t){this.exit(t)}function yS(){return"["}function Af(t,e,n,r){const i=n.createTracker(r);let s=i.move("[^");const a=n.enter("footnoteReference"),o=n.enter("reference");return s+=i.move(n.safe(n.associationId(t),{after:"]",before:s})),o(),a(),s+=i.move("]"),s}function kS(){return{enter:{gfmFootnoteCallString:pS,gfmFootnoteCall:mS,gfmFootnoteDefinitionLabelString:gS,gfmFootnoteDefinition:bS},exit:{gfmFootnoteCallString:ES,gfmFootnoteCall:xS,gfmFootnoteDefinitionLabelString:TS,gfmFootnoteDefinition:_S}}}function AS(t){let e=!1;return t&&t.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:n,footnoteReference:Af},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,s,a){const o=s.createTracker(a);let u=o.move("[^");const l=s.enter("footnoteDefinition"),d=s.enter("label");return u+=o.move(s.safe(s.associationId(r),{before:u,after:"]"})),d(),u+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),u+=o.move((e?`
|
|
109
|
-
`:" ")+s.indentLines(s.containerFlow(r,o.current()),e?Sf:SS))),l(),u}}function SS(t,e,n){return e===0?t:Sf(t,e,n)}function Sf(t,e,n){return(n?"":" ")+t}const CS=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Cf.peek=RS;function IS(){return{canContainEols:["delete"],enter:{strikethrough:wS},exit:{strikethrough:vS}}}function NS(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:CS}],handlers:{delete:Cf}}}function wS(t){this.enter({type:"delete",children:[]},t)}function vS(t){this.exit(t)}function Cf(t,e,n,r){const i=n.createTracker(r),s=n.enter("strikethrough");let a=i.move("~~");return a+=n.containerPhrasing(t,{...i.current(),before:a,after:"~"}),a+=i.move("~~"),s(),a}function RS(){return"~"}function OS(t){return t.length}function LS(t,e){const n=e||{},r=(n.align||[]).concat(),i=n.stringLength||OS,s=[],a=[],o=[],u=[];let l=0,d=-1;for(;++d<t.length;){const b=[],x=[];let E=-1;for(t[d].length>l&&(l=t[d].length);++E<t[d].length;){const k=DS(t[d][E]);if(n.alignDelimiters!==!1){const y=i(k);x[E]=y,(u[E]===void 0||y>u[E])&&(u[E]=y)}b.push(k)}a[d]=b,o[d]=x}let c=-1;if(typeof r=="object"&&"length"in r)for(;++c<l;)s[c]=Gu(r[c]);else{const b=Gu(r);for(;++c<l;)s[c]=b}c=-1;const h=[],p=[];for(;++c<l;){const b=s[c];let x="",E="";b===99?(x=":",E=":"):b===108?x=":":b===114&&(E=":");let k=n.alignDelimiters===!1?1:Math.max(1,u[c]-x.length-E.length);const y=x+"-".repeat(k)+E;n.alignDelimiters!==!1&&(k=x.length+k+E.length,k>u[c]&&(u[c]=k),p[c]=k),h[c]=y}a.splice(1,0,h),o.splice(1,0,p),d=-1;const g=[];for(;++d<a.length;){const b=a[d],x=o[d];c=-1;const E=[];for(;++c<l;){const k=b[c]||"";let y="",_="";if(n.alignDelimiters!==!1){const R=u[c]-(x[c]||0),S=s[c];S===114?y=" ".repeat(R):S===99?R%2?(y=" ".repeat(R/2+.5),_=" ".repeat(R/2-.5)):(y=" ".repeat(R/2),_=y):_=" ".repeat(R)}n.delimiterStart!==!1&&!c&&E.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&k==="")&&(n.delimiterStart!==!1||c)&&E.push(" "),n.alignDelimiters!==!1&&E.push(y),E.push(k),n.alignDelimiters!==!1&&E.push(_),n.padding!==!1&&E.push(" "),(n.delimiterEnd!==!1||c!==l-1)&&E.push("|")}g.push(n.delimiterEnd===!1?E.join("").replace(/ +$/,""):E.join(""))}return g.join(`
|
|
110
|
-
`)}function DS(t){return t==null?"":String(t)}function Gu(t){const e=typeof t=="string"?t.codePointAt(0):0;return e===67||e===99?99:e===76||e===108?108:e===82||e===114?114:0}function PS(t,e,n,r){const i=n.enter("blockquote"),s=n.createTracker(r);s.move("> "),s.shift(2);const a=n.indentLines(n.containerFlow(t,s.current()),MS);return i(),a}function MS(t,e,n){return">"+(n?"":" ")+t}function BS(t,e){return Ku(t,e.inConstruct,!0)&&!Ku(t,e.notInConstruct,!1)}function Ku(t,e,n){if(typeof e=="string"&&(e=[e]),!e||e.length===0)return n;let r=-1;for(;++r<e.length;)if(t.includes(e[r]))return!0;return!1}function Qu(t,e,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
111
|
-
`&&BS(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
112
|
-
`}function FS(t,e){const n=String(t);let r=n.indexOf(e),i=r,s=0,a=0;if(typeof e!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++s>a&&(a=s):s=1,i=r+e.length,r=n.indexOf(e,i);return a}function zS(t,e){return!!(e.options.fences===!1&&t.value&&!t.lang&&/[^ \r\n]/.test(t.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(t.value))}function jS(t){const e=t.options.fence||"`";if(e!=="`"&&e!=="~")throw new Error("Cannot serialize code with `"+e+"` for `options.fence`, expected `` ` `` or `~`");return e}function US(t,e,n,r){const i=jS(n),s=t.value||"",a=i==="`"?"GraveAccent":"Tilde";if(zS(t,n)){const c=n.enter("codeIndented"),h=n.indentLines(s,HS);return c(),h}const o=n.createTracker(r),u=i.repeat(Math.max(FS(s,i)+1,3)),l=n.enter("codeFenced");let d=o.move(u);if(t.lang){const c=n.enter(`codeFencedLang${a}`);d+=o.move(n.safe(t.lang,{before:d,after:" ",encode:["`"],...o.current()})),c()}if(t.lang&&t.meta){const c=n.enter(`codeFencedMeta${a}`);d+=o.move(" "),d+=o.move(n.safe(t.meta,{before:d,after:`
|
|
113
|
-
`,encode:["`"],...o.current()})),c()}return d+=o.move(`
|
|
114
|
-
`),s&&(d+=o.move(s+`
|
|
115
|
-
`)),d+=o.move(u),l(),d}function HS(t,e,n){return(n?"":" ")+t}function qa(t){const e=t.options.quote||'"';if(e!=='"'&&e!=="'")throw new Error("Cannot serialize title with `"+e+"` for `options.quote`, expected `\"`, or `'`");return e}function $S(t,e,n,r){const i=qa(n),s=i==='"'?"Quote":"Apostrophe",a=n.enter("definition");let o=n.enter("label");const u=n.createTracker(r);let l=u.move("[");return l+=u.move(n.safe(n.associationId(t),{before:l,after:"]",...u.current()})),l+=u.move("]: "),o(),!t.url||/[\0- \u007F]/.test(t.url)?(o=n.enter("destinationLiteral"),l+=u.move("<"),l+=u.move(n.safe(t.url,{before:l,after:">",...u.current()})),l+=u.move(">")):(o=n.enter("destinationRaw"),l+=u.move(n.safe(t.url,{before:l,after:t.title?" ":`
|
|
116
|
-
`,...u.current()}))),o(),t.title&&(o=n.enter(`title${s}`),l+=u.move(" "+i),l+=u.move(n.safe(t.title,{before:l,after:i,...u.current()})),l+=u.move(i),o()),a(),l}function ZS(t){const e=t.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}function Cr(t){return"&#x"+t.toString(16).toUpperCase()+";"}function Si(t,e,n){const r=Ln(t),i=Ln(e);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}If.peek=YS;function If(t,e,n,r){const i=ZS(n),s=n.enter("emphasis"),a=n.createTracker(r),o=a.move(i);let u=a.move(n.containerPhrasing(t,{after:i,before:o,...a.current()}));const l=u.charCodeAt(0),d=Si(r.before.charCodeAt(r.before.length-1),l,i);d.inside&&(u=Cr(l)+u.slice(1));const c=u.charCodeAt(u.length-1),h=Si(r.after.charCodeAt(0),c,i);h.inside&&(u=u.slice(0,-1)+Cr(c));const p=a.move(i);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},o+u+p}function YS(t,e,n){return n.options.emphasis||"*"}function qS(t,e){let n=!1;return Ui(t,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Gs}),!!((!t.depth||t.depth<3)&&Oa(t)&&(e.options.setext||n))}function VS(t,e,n,r){const i=Math.max(Math.min(6,t.depth||1),1),s=n.createTracker(r);if(qS(t,n)){const d=n.enter("headingSetext"),c=n.enter("phrasing"),h=n.containerPhrasing(t,{...s.current(),before:`
|
|
117
|
-
`,after:`
|
|
118
|
-
`});return c(),d(),h+`
|
|
119
|
-
`+(i===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
|
|
120
|
-
`))+1))}const a="#".repeat(i),o=n.enter("headingAtx"),u=n.enter("phrasing");s.move(a+" ");let l=n.containerPhrasing(t,{before:"# ",after:`
|
|
121
|
-
`,...s.current()});return/^[\t ]/.test(l)&&(l=Cr(l.charCodeAt(0))+l.slice(1)),l=l?a+" "+l:a,n.options.closeAtx&&(l+=" "+a),u(),o(),l}Nf.peek=WS;function Nf(t){return t.value||""}function WS(){return"<"}wf.peek=GS;function wf(t,e,n,r){const i=qa(n),s=i==='"'?"Quote":"Apostrophe",a=n.enter("image");let o=n.enter("label");const u=n.createTracker(r);let l=u.move("![");return l+=u.move(n.safe(t.alt,{before:l,after:"]",...u.current()})),l+=u.move("]("),o(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(o=n.enter("destinationLiteral"),l+=u.move("<"),l+=u.move(n.safe(t.url,{before:l,after:">",...u.current()})),l+=u.move(">")):(o=n.enter("destinationRaw"),l+=u.move(n.safe(t.url,{before:l,after:t.title?" ":")",...u.current()}))),o(),t.title&&(o=n.enter(`title${s}`),l+=u.move(" "+i),l+=u.move(n.safe(t.title,{before:l,after:i,...u.current()})),l+=u.move(i),o()),l+=u.move(")"),a(),l}function GS(){return"!"}vf.peek=KS;function vf(t,e,n,r){const i=t.referenceType,s=n.enter("imageReference");let a=n.enter("label");const o=n.createTracker(r);let u=o.move("![");const l=n.safe(t.alt,{before:u,after:"]",...o.current()});u+=o.move(l+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const c=n.safe(n.associationId(t),{before:u,after:"]",...o.current()});return a(),n.stack=d,s(),i==="full"||!l||l!==c?u+=o.move(c+"]"):i==="shortcut"?u=u.slice(0,-1):u+=o.move("]"),u}function KS(){return"!"}Rf.peek=QS;function Rf(t,e,n){let r=t.value||"",i="`",s=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s<n.unsafe.length;){const a=n.unsafe[s],o=n.compilePattern(a);let u;if(a.atBreak)for(;u=o.exec(r);){let l=u.index;r.charCodeAt(l)===10&&r.charCodeAt(l-1)===13&&l--,r=r.slice(0,l)+" "+r.slice(u.index+1)}}return i+r+i}function QS(){return"`"}function Of(t,e){const n=Oa(t);return!!(!e.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(n===t.url||"mailto:"+n===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}Lf.peek=XS;function Lf(t,e,n,r){const i=qa(n),s=i==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let o,u;if(Of(t,n)){const d=n.stack;n.stack=[],o=n.enter("autolink");let c=a.move("<");return c+=a.move(n.containerPhrasing(t,{before:c,after:">",...a.current()})),c+=a.move(">"),o(),n.stack=d,c}o=n.enter("link"),u=n.enter("label");let l=a.move("[");return l+=a.move(n.containerPhrasing(t,{before:l,after:"](",...a.current()})),l+=a.move("]("),u(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(u=n.enter("destinationLiteral"),l+=a.move("<"),l+=a.move(n.safe(t.url,{before:l,after:">",...a.current()})),l+=a.move(">")):(u=n.enter("destinationRaw"),l+=a.move(n.safe(t.url,{before:l,after:t.title?" ":")",...a.current()}))),u(),t.title&&(u=n.enter(`title${s}`),l+=a.move(" "+i),l+=a.move(n.safe(t.title,{before:l,after:i,...a.current()})),l+=a.move(i),u()),l+=a.move(")"),o(),l}function XS(t,e,n){return Of(t,n)?"<":"["}Df.peek=JS;function Df(t,e,n,r){const i=t.referenceType,s=n.enter("linkReference");let a=n.enter("label");const o=n.createTracker(r);let u=o.move("[");const l=n.containerPhrasing(t,{before:u,after:"]",...o.current()});u+=o.move(l+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const c=n.safe(n.associationId(t),{before:u,after:"]",...o.current()});return a(),n.stack=d,s(),i==="full"||!l||l!==c?u+=o.move(c+"]"):i==="shortcut"?u=u.slice(0,-1):u+=o.move("]"),u}function JS(){return"["}function Va(t){const e=t.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function eC(t){const e=Va(t),n=t.options.bulletOther;if(!n)return e==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+n+"`) to be different");return n}function tC(t){const e=t.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function Pf(t){const e=t.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function nC(t,e,n,r){const i=n.enter("list"),s=n.bulletCurrent;let a=t.ordered?tC(n):Va(n);const o=t.ordered?a==="."?")":".":eC(n);let u=e&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!t.ordered){const d=t.children?t.children[0]:void 0;if((a==="*"||a==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(u=!0),Pf(n)===a&&d){let c=-1;for(;++c<t.children.length;){const h=t.children[c];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(a=o),n.bulletCurrent=a;const l=n.containerFlow(t,r);return n.bulletLastUsed=a,n.bulletCurrent=s,i(),l}function rC(t){const e=t.options.listItemIndent||"one";if(e!=="tab"&&e!=="one"&&e!=="mixed")throw new Error("Cannot serialize items with `"+e+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return e}function iC(t,e,n,r){const i=rC(n);let s=n.bulletCurrent||Va(n);e&&e.type==="list"&&e.ordered&&(s=(typeof e.start=="number"&&e.start>-1?e.start:1)+(n.options.incrementListMarker===!1?0:e.children.indexOf(t))+s);let a=s.length+1;(i==="tab"||i==="mixed"&&(e&&e.type==="list"&&e.spread||t.spread))&&(a=Math.ceil(a/4)*4);const o=n.createTracker(r);o.move(s+" ".repeat(a-s.length)),o.shift(a);const u=n.enter("listItem"),l=n.indentLines(n.containerFlow(t,o.current()),d);return u(),l;function d(c,h,p){return h?(p?"":" ".repeat(a))+c:(p?s:s+" ".repeat(a-s.length))+c}}function sC(t,e,n,r){const i=n.enter("paragraph"),s=n.enter("phrasing"),a=n.containerPhrasing(t,r);return s(),i(),a}const aC=zi(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function oC(t,e,n,r){return(t.children.some(function(a){return aC(a)})?n.containerPhrasing:n.containerFlow).call(n,t,r)}function uC(t){const e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}Mf.peek=lC;function Mf(t,e,n,r){const i=uC(n),s=n.enter("strong"),a=n.createTracker(r),o=a.move(i+i);let u=a.move(n.containerPhrasing(t,{after:i,before:o,...a.current()}));const l=u.charCodeAt(0),d=Si(r.before.charCodeAt(r.before.length-1),l,i);d.inside&&(u=Cr(l)+u.slice(1));const c=u.charCodeAt(u.length-1),h=Si(r.after.charCodeAt(0),c,i);h.inside&&(u=u.slice(0,-1)+Cr(c));const p=a.move(i+i);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},o+u+p}function lC(t,e,n){return n.options.strong||"*"}function cC(t,e,n,r){return n.safe(t.value,r)}function dC(t){const e=t.options.ruleRepetition||3;if(e<3)throw new Error("Cannot serialize rules with repetition `"+e+"` for `options.ruleRepetition`, expected `3` or more");return e}function fC(t,e,n){const r=(Pf(n)+(n.options.ruleSpaces?" ":"")).repeat(dC(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Bf={blockquote:PS,break:Qu,code:US,definition:$S,emphasis:If,hardBreak:Qu,heading:VS,html:Nf,image:wf,imageReference:vf,inlineCode:Rf,link:Lf,linkReference:Df,list:nC,listItem:iC,paragraph:sC,root:oC,strong:Mf,text:cC,thematicBreak:fC};function hC(){return{enter:{table:pC,tableData:Xu,tableHeader:Xu,tableRow:gC},exit:{codeText:bC,table:mC,tableData:_s,tableHeader:_s,tableRow:_s}}}function pC(t){const e=t._align;this.enter({type:"table",align:e.map(function(n){return n==="none"?null:n}),children:[]},t),this.data.inTable=!0}function mC(t){this.exit(t),this.data.inTable=void 0}function gC(t){this.enter({type:"tableRow",children:[]},t)}function _s(t){this.exit(t)}function Xu(t){this.enter({type:"tableCell",children:[]},t)}function bC(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,EC));const n=this.stack[this.stack.length-1];n.type,n.value=e,this.exit(t)}function EC(t,e){return e==="|"?e:t}function xC(t){const e=t||{},n=e.tableCellPadding,r=e.tablePipeAlign,i=e.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
122
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:a,tableCell:u,tableRow:o}};function a(p,g,b,x){return l(d(p,b,x),p.align)}function o(p,g,b,x){const E=c(p,b,x),k=l([E]);return k.slice(0,k.indexOf(`
|
|
123
|
-
`))}function u(p,g,b,x){const E=b.enter("tableCell"),k=b.enter("phrasing"),y=b.containerPhrasing(p,{...x,before:s,after:s});return k(),E(),y}function l(p,g){return LS(p,{align:g,alignDelimiters:r,padding:n,stringLength:i})}function d(p,g,b){const x=p.children;let E=-1;const k=[],y=g.enter("table");for(;++E<x.length;)k[E]=c(x[E],g,b);return y(),k}function c(p,g,b){const x=p.children;let E=-1;const k=[],y=g.enter("tableRow");for(;++E<x.length;)k[E]=u(x[E],p,g,b);return y(),k}function h(p,g,b){let x=Bf.inlineCode(p,g,b);return b.stack.includes("tableCell")&&(x=x.replace(/\|/g,"\\$&")),x}}function TC(){return{exit:{taskListCheckValueChecked:Ju,taskListCheckValueUnchecked:Ju,paragraph:yC}}}function _C(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:kC}}}function Ju(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function yC(t){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=e.children;let s=-1,a;for(;++s<i.length;){const o=i[s];if(o.type==="paragraph"){a=o;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(t)}function kC(t,e,n,r){const i=t.children[0],s=typeof t.checked=="boolean"&&i&&i.type==="paragraph",a="["+(t.checked?"x":" ")+"] ",o=n.createTracker(r);s&&o.move(a);let u=Bf.listItem(t,e,n,{...r,...o.current()});return s&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),u;function l(d){return d+a}}function AC(){return[nS(),kS(),IS(),hC(),TC()]}function SC(t){return{extensions:[rS(),AS(t),NS(),xC(t),_C()]}}const CC={tokenize:OC,partial:!0},Ff={tokenize:LC,partial:!0},zf={tokenize:DC,partial:!0},jf={tokenize:PC,partial:!0},IC={tokenize:MC,partial:!0},Uf={name:"wwwAutolink",tokenize:vC,previous:$f},Hf={name:"protocolAutolink",tokenize:RC,previous:Zf},zt={name:"emailAutolink",tokenize:wC,previous:Yf},Ot={};function NC(){return{text:Ot}}let tn=48;for(;tn<123;)Ot[tn]=zt,tn++,tn===58?tn=65:tn===91&&(tn=97);Ot[43]=zt;Ot[45]=zt;Ot[46]=zt;Ot[95]=zt;Ot[72]=[zt,Hf];Ot[104]=[zt,Hf];Ot[87]=[zt,Uf];Ot[119]=[zt,Uf];function wC(t,e,n){const r=this;let i,s;return a;function a(c){return!ia(c)||!Yf.call(r,r.previous)||Wa(r.events)?n(c):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),o(c))}function o(c){return ia(c)?(t.consume(c),o):c===64?(t.consume(c),u):n(c)}function u(c){return c===46?t.check(IC,d,l)(c):c===45||c===95||Ke(c)?(s=!0,t.consume(c),u):d(c)}function l(c){return t.consume(c),i=!0,u}function d(c){return s&&i&&et(r.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(c)):n(c)}}function vC(t,e,n){const r=this;return i;function i(a){return a!==87&&a!==119||!$f.call(r,r.previous)||Wa(r.events)?n(a):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(CC,t.attempt(Ff,t.attempt(zf,s),n),n)(a))}function s(a){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(a)}}function RC(t,e,n){const r=this;let i="",s=!1;return a;function a(c){return(c===72||c===104)&&Zf.call(r,r.previous)&&!Wa(r.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),i+=String.fromCodePoint(c),t.consume(c),o):n(c)}function o(c){if(et(c)&&i.length<5)return i+=String.fromCodePoint(c),t.consume(c),o;if(c===58){const h=i.toLowerCase();if(h==="http"||h==="https")return t.consume(c),u}return n(c)}function u(c){return c===47?(t.consume(c),s?l:(s=!0,u)):n(c)}function l(c){return c===null||Ti(c)||Ne(c)||hn(c)||Mi(c)?n(c):t.attempt(Ff,t.attempt(zf,d),n)(c)}function d(c){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(c)}}function OC(t,e,n){let r=0;return i;function i(a){return(a===87||a===119)&&r<3?(r++,t.consume(a),i):a===46&&r===3?(t.consume(a),s):n(a)}function s(a){return a===null?n(a):e(a)}}function LC(t,e,n){let r,i,s;return a;function a(l){return l===46||l===95?t.check(jf,u,o)(l):l===null||Ne(l)||hn(l)||l!==45&&Mi(l)?u(l):(s=!0,t.consume(l),a)}function o(l){return l===95?r=!0:(i=r,r=void 0),t.consume(l),a}function u(l){return i||r||!s?n(l):e(l)}}function DC(t,e){let n=0,r=0;return i;function i(a){return a===40?(n++,t.consume(a),i):a===41&&r<n?s(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?t.check(jf,e,s)(a):a===null||Ne(a)||hn(a)?e(a):(t.consume(a),i)}function s(a){return a===41&&r++,t.consume(a),i}}function PC(t,e,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(t.consume(o),r):o===38?(t.consume(o),s):o===93?(t.consume(o),i):o===60||o===null||Ne(o)||hn(o)?e(o):n(o)}function i(o){return o===null||o===40||o===91||Ne(o)||hn(o)?e(o):r(o)}function s(o){return et(o)?a(o):n(o)}function a(o){return o===59?(t.consume(o),r):et(o)?(t.consume(o),a):n(o)}}function MC(t,e,n){return r;function r(s){return t.consume(s),i}function i(s){return Ke(s)?n(s):e(s)}}function $f(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||Ne(t)}function Zf(t){return!et(t)}function Yf(t){return!(t===47||ia(t))}function ia(t){return t===43||t===45||t===46||t===95||Ke(t)}function Wa(t){let e=t.length,n=!1;for(;e--;){const r=t[e][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return t.length>0&&!n&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const BC={tokenize:YC,partial:!0};function FC(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:HC,continuation:{tokenize:$C},exit:ZC}},text:{91:{name:"gfmFootnoteCall",tokenize:UC},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:zC,resolveTo:jC}}}}function zC(t,e,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){a=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return o;function o(u){if(!a||!a._balanced)return n(u);const l=yt(r.sliceSerialize({start:a.end,end:r.now()}));return l.codePointAt(0)!==94||!s.includes(l.slice(1))?n(u):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(u),t.exit("gfmFootnoteCallLabelMarker"),e(u))}}function jC(t,e){let n=t.length;for(;n--;)if(t[n][1].type==="labelImage"&&t[n][0]==="enter"){t[n][1];break}t[n+1][1].type="data",t[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},t[n+3][1].start),end:Object.assign({},t[t.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},t[n+3][1].end),end:Object.assign({},t[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},t[t.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},o=[t[n+1],t[n+2],["enter",r,e],t[n+3],t[n+4],["enter",i,e],["exit",i,e],["enter",s,e],["enter",a,e],["exit",a,e],["exit",s,e],t[t.length-2],t[t.length-1],["exit",r,e]];return t.splice(n,t.length-n+1,...o),t}function UC(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,a;return o;function o(c){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(c),t.exit("gfmFootnoteCallLabelMarker"),u}function u(c){return c!==94?n(c):(t.enter("gfmFootnoteCallMarker"),t.consume(c),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",l)}function l(c){if(s>999||c===93&&!a||c===null||c===91||Ne(c))return n(c);if(c===93){t.exit("chunkString");const h=t.exit("gfmFootnoteCallString");return i.includes(yt(r.sliceSerialize(h)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(c),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(c)}return Ne(c)||(a=!0),s++,t.consume(c),c===92?d:l}function d(c){return c===91||c===92||c===93?(t.consume(c),s++,l):l(c)}}function HC(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,a=0,o;return u;function u(g){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionLabelMarker"),l}function l(g){return g===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",d):n(g)}function d(g){if(a>999||g===93&&!o||g===null||g===91||Ne(g))return n(g);if(g===93){t.exit("chunkString");const b=t.exit("gfmFootnoteDefinitionLabelString");return s=yt(r.sliceSerialize(b)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),h}return Ne(g)||(o=!0),a++,t.consume(g),g===92?c:d}function c(g){return g===91||g===92||g===93?(t.consume(g),a++,d):d(g)}function h(g){return g===58?(t.enter("definitionMarker"),t.consume(g),t.exit("definitionMarker"),i.includes(s)||i.push(s),_e(t,p,"gfmFootnoteDefinitionWhitespace")):n(g)}function p(g){return e(g)}}function $C(t,e,n){return t.check(Fr,e,t.attempt(BC,e,n))}function ZC(t){t.exit("gfmFootnoteDefinition")}function YC(t,e,n){const r=this;return _e(t,i,"gfmFootnoteDefinitionIndent",5);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?e(s):n(s)}}function qC(t){let n=(t||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(a,o){let u=-1;for(;++u<a.length;)if(a[u][0]==="enter"&&a[u][1].type==="strikethroughSequenceTemporary"&&a[u][1]._close){let l=u;for(;l--;)if(a[l][0]==="exit"&&a[l][1].type==="strikethroughSequenceTemporary"&&a[l][1]._open&&a[u][1].end.offset-a[u][1].start.offset===a[l][1].end.offset-a[l][1].start.offset){a[u][1].type="strikethroughSequence",a[l][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},a[l][1].start),end:Object.assign({},a[u][1].end)},c={type:"strikethroughText",start:Object.assign({},a[l][1].end),end:Object.assign({},a[u][1].start)},h=[["enter",d,o],["enter",a[l][1],o],["exit",a[l][1],o],["enter",c,o]],p=o.parser.constructs.insideSpan.null;p&&ht(h,h.length,0,Bi(p,a.slice(l+1,u),o)),ht(h,h.length,0,[["exit",c,o],["enter",a[u][1],o],["exit",a[u][1],o],["exit",d,o]]),ht(a,l-1,u-l+3,h),u=l+h.length-2;break}}for(u=-1;++u<a.length;)a[u][1].type==="strikethroughSequenceTemporary"&&(a[u][1].type="data");return a}function s(a,o,u){const l=this.previous,d=this.events;let c=0;return h;function h(g){return l===126&&d[d.length-1][1].type!=="characterEscape"?u(g):(a.enter("strikethroughSequenceTemporary"),p(g))}function p(g){const b=Ln(l);if(g===126)return c>1?u(g):(a.consume(g),c++,p);if(c<2&&!n)return u(g);const x=a.exit("strikethroughSequenceTemporary"),E=Ln(g);return x._open=!E||E===2&&!!b,x._close=!b||b===2&&!!E,o(g)}}}class VC{constructor(){this.map=[]}add(e,n,r){WC(this,e,n,r)}consume(e){if(this.map.sort(function(s,a){return s[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(e.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),e.length=this.map[n][0];r.push(e.slice()),e.length=0;let i=r.pop();for(;i;){for(const s of i)e.push(s);i=r.pop()}this.map.length=0}}function WC(t,e,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<t.map.length;){if(t.map[i][0]===e){t.map[i][1]+=n,t.map[i][2].push(...r);return}i+=1}t.map.push([e,n,r])}}function GC(t,e){let n=!1;const r=[];for(;e<t.length;){const i=t[e];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);e+=1}return r}function KC(){return{flow:{null:{name:"table",tokenize:QC,resolveAll:XC}}}}function QC(t,e,n){const r=this;let i=0,s=0,a;return o;function o(v){let B=r.events.length-1;for(;B>-1;){const Y=r.events[B][1].type;if(Y==="lineEnding"||Y==="linePrefix")B--;else break}const j=B>-1?r.events[B][1].type:null,G=j==="tableHead"||j==="tableRow"?S:u;return G===S&&r.parser.lazy[r.now().line]?n(v):G(v)}function u(v){return t.enter("tableHead"),t.enter("tableRow"),l(v)}function l(v){return v===124||(a=!0,s+=1),d(v)}function d(v){return v===null?n(v):ie(v)?s>1?(s=0,r.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(v),t.exit("lineEnding"),p):n(v):be(v)?_e(t,d,"whitespace")(v):(s+=1,a&&(a=!1,i+=1),v===124?(t.enter("tableCellDivider"),t.consume(v),t.exit("tableCellDivider"),a=!0,d):(t.enter("data"),c(v)))}function c(v){return v===null||v===124||Ne(v)?(t.exit("data"),d(v)):(t.consume(v),v===92?h:c)}function h(v){return v===92||v===124?(t.consume(v),c):c(v)}function p(v){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(v):(t.enter("tableDelimiterRow"),a=!1,be(v)?_e(t,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(v):g(v))}function g(v){return v===45||v===58?x(v):v===124?(a=!0,t.enter("tableCellDivider"),t.consume(v),t.exit("tableCellDivider"),b):R(v)}function b(v){return be(v)?_e(t,x,"whitespace")(v):x(v)}function x(v){return v===58?(s+=1,a=!0,t.enter("tableDelimiterMarker"),t.consume(v),t.exit("tableDelimiterMarker"),E):v===45?(s+=1,E(v)):v===null||ie(v)?_(v):R(v)}function E(v){return v===45?(t.enter("tableDelimiterFiller"),k(v)):R(v)}function k(v){return v===45?(t.consume(v),k):v===58?(a=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(v),t.exit("tableDelimiterMarker"),y):(t.exit("tableDelimiterFiller"),y(v))}function y(v){return be(v)?_e(t,_,"whitespace")(v):_(v)}function _(v){return v===124?g(v):v===null||ie(v)?!a||i!==s?R(v):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(v)):R(v)}function R(v){return n(v)}function S(v){return t.enter("tableRow"),w(v)}function w(v){return v===124?(t.enter("tableCellDivider"),t.consume(v),t.exit("tableCellDivider"),w):v===null||ie(v)?(t.exit("tableRow"),e(v)):be(v)?_e(t,w,"whitespace")(v):(t.enter("data"),O(v))}function O(v){return v===null||v===124||Ne(v)?(t.exit("data"),w(v)):(t.consume(v),v===92?D:O)}function D(v){return v===92||v===124?(t.consume(v),O):O(v)}}function XC(t,e){let n=-1,r=!0,i=0,s=[0,0,0,0],a=[0,0,0,0],o=!1,u=0,l,d,c;const h=new VC;for(;++n<t.length;){const p=t[n],g=p[1];p[0]==="enter"?g.type==="tableHead"?(o=!1,u!==0&&(el(h,e,u,l,d),d=void 0,u=0),l={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},h.add(n,0,[["enter",l,e]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,c=void 0,s=[0,0,0,0],a=[0,n+1,0,0],o&&(o=!1,d={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},h.add(n,0,[["enter",d,e]])),i=g.type==="tableDelimiterRow"?2:d?3:1):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(s[1]!==0&&(a[0]=a[1],c=Qr(h,e,s,i,void 0,c),s=[0,0,0,0]),a[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(a[0]=a[1],c=Qr(h,e,s,i,void 0,c)),s=a,a=[s[1],n,0,0])):g.type==="tableHead"?(o=!0,u=n):g.type==="tableRow"||g.type==="tableDelimiterRow"?(u=n,s[1]!==0?(a[0]=a[1],c=Qr(h,e,s,i,n,c)):a[1]!==0&&(c=Qr(h,e,a,i,n,c)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(a[3]=n)}for(u!==0&&el(h,e,u,l,d),h.consume(e.events),n=-1;++n<e.events.length;){const p=e.events[n];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=GC(e.events,n))}return t}function Qr(t,e,n,r,i,s){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(s.end=Object.assign({},Cn(e.events,n[0])),t.add(n[0],0,[["exit",s,e]]));const u=Cn(e.events,n[1]);if(s={type:a,start:Object.assign({},u),end:Object.assign({},u)},t.add(n[1],0,[["enter",s,e]]),n[2]!==0){const l=Cn(e.events,n[2]),d=Cn(e.events,n[3]),c={type:o,start:Object.assign({},l),end:Object.assign({},d)};if(t.add(n[2],0,[["enter",c,e]]),r!==2){const h=e.events[n[2]],p=e.events[n[3]];if(h[1].end=Object.assign({},p[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const g=n[2]+1,b=n[3]-n[2]-1;t.add(g,b,[])}}t.add(n[3]+1,0,[["exit",c,e]])}return i!==void 0&&(s.end=Object.assign({},Cn(e.events,i)),t.add(i,0,[["exit",s,e]]),s=void 0),s}function el(t,e,n,r,i){const s=[],a=Cn(e.events,n);i&&(i.end=Object.assign({},a),s.push(["exit",i,e])),r.end=Object.assign({},a),s.push(["exit",r,e]),t.add(n+1,0,s)}function Cn(t,e){const n=t[e],r=n[0]==="enter"?"start":"end";return n[1][r]}const JC={name:"tasklistCheck",tokenize:tI};function eI(){return{text:{91:JC}}}function tI(t,e,n){const r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(u),t.exit("taskListCheckMarker"),s)}function s(u){return Ne(u)?(t.enter("taskListCheckValueUnchecked"),t.consume(u),t.exit("taskListCheckValueUnchecked"),a):u===88||u===120?(t.enter("taskListCheckValueChecked"),t.consume(u),t.exit("taskListCheckValueChecked"),a):n(u)}function a(u){return u===93?(t.enter("taskListCheckMarker"),t.consume(u),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),o):n(u)}function o(u){return ie(u)?e(u):be(u)?t.check({tokenize:nI},e,n)(u):n(u)}}function nI(t,e,n){return _e(t,r,"whitespace");function r(i){return i===null?n(i):e(i)}}function rI(t){return xd([NC(),FC(),qC(t),KC(),eI()])}const iI={};function sI(t){const e=this,n=t||iI,r=e.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(rI(n)),s.push(AC()),a.push(SC(n))}const aI=P.lazy(()=>Jh(()=>import("./lazy-highlighter-9rAB2zZq.js"),__vite__mapDeps([0,1,2,3])));function qf(){const t=F.c(3),[e,n]=P.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=async a=>{await navigator.clipboard.writeText(a),n(!0),setTimeout(()=>n(!1),2e3)},t[0]=r):r=t[0];const i=r;let s;return t[1]!==e?(s={handleCopy:i,copied:e},t[1]=e,t[2]=s):s=t[2],s}function oI(){const t=F.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=[85,70],t[0]=e):e=t[0];const n=e;let r;return t[1]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsx("div",{className:"p-4 font-mono text-sm",style:{background:"#2d2d2d",borderRadius:"0 0 0.5rem 0.5rem",overflow:"auto",minHeight:"4rem"},children:n.map(uI)}),t[1]=r):r=t[1],r}function uI(t,e){return m.jsxs("div",{className:"flex gap-2 items-center my-1",children:[e>2&&e<7&&m.jsx("div",{className:"w-4 h-4 rounded-sm opacity-40 animate-pulse",style:{background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.1}s`}}),e%4===0&&m.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:"3rem",background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.12}s`}}),e%3===1&&m.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:"2.5rem",background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.14}s`}}),m.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:`${t}%`,background:"rgba(255, 255, 255, 0.1)",animationDelay:`${e*.1}s`}}),e%5===2&&m.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:"4rem",background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.16}s`}})]},e)}function lI(t){const e=F.c(12),n=P.useRef(null),{handleCopy:r,copied:i}=qf(),s=cI;let a;e[0]!==r?(a=async()=>{const p=s(n.current);await r(p)},e[0]=r,e[1]=a):a=e[1];const o=a,u=i?"check":"content_copy";let l;e[2]!==u?(l=m.jsx(fe,{name:u,size:12}),e[2]=u,e[3]=l):l=e[3];let d;e[4]!==o||e[5]!==l?(d=m.jsx("div",{className:"flex justify-end items-center",children:m.jsxs(ot,{variant:"ghost",onClick:o,"aria-label":"Copy as CSV",className:"text-muted-foreground hover:text-foreground h-6 text-[10px]",type:"button",children:["Copy as CSV",l]})}),e[4]=o,e[5]=l,e[6]=d):d=e[6];let c;e[7]!==t?(c=m.jsx("div",{className:"overflow-x-auto mb-4 rounded-lg border border-border",children:m.jsx("table",{ref:n,...t,className:"min-w-full border-collapse text-sm",children:t.children})}),e[7]=t,e[8]=c):c=e[8];let h;return e[9]!==d||e[10]!==c?(h=m.jsxs(m.Fragment,{children:[d,c]}),e[9]=d,e[10]=c,e[11]=h):h=e[11],h}function cI(t){return t?Array.from(t.querySelectorAll("tr")).map(dI).join(`
|
|
124
|
-
`):""}function dI(t){return Array.from(t.querySelectorAll("th,td")).map(fI).join(",")}function fI(t){let e=t.textContent||"";return e=e.replace(/"/g,'""'),e.search(/([",\n])/g)>=0&&(e=`"${e}"`),e}const hI=[sI],pI=[KA],mI={p:t=>m.jsx("p",{...t,className:"leading-relaxed text-[0.9375rem]"}),strong:t=>m.jsx("strong",{...t,className:"font-bold"}),em:t=>m.jsx("em",{...t,className:"italic"}),a:t=>m.jsx("a",{...t,target:"_blank",rel:"noopener noreferrer",className:"text-primary-dark hover:underline break-all font-medium"}),ul:t=>m.jsx("ul",{...t,className:"list-disc ml-6 my-4 space-y-2"}),ol:t=>m.jsx("ol",{...t,className:"list-decimal ml-6 my-4 space-y-2"}),li:t=>m.jsx("li",{...t,className:"leading-relaxed text-[0.9375rem]"}),code:t=>m.jsx("code",{...t,className:"px-1 py-0.5 bg-muted rounded text-sm font-mono break-all"}),pre:t=>m.jsx("pre",{...t,className:"flex w-full min-w-0 my-4 bg-muted rounded overflow-hidden",children:m.jsx("code",{className:"flex-1 min-w-0 p-4 text-sm font-mono whitespace-pre overflow-x-auto",children:t.children})}),table:t=>m.jsx(lI,{...t}),thead:t=>m.jsx("thead",{...t,className:"bg-muted",children:t.children}),tr:t=>m.jsx("tr",{...t,className:"even:bg-muted/50 border-b border-border last:border-0"}),th:t=>m.jsx("th",{...t,className:"px-4 py-2 text-left font-semibold text-muted-foreground border-b border-border"}),td:t=>m.jsx("td",{...t,className:"px-4 py-2 border-b border-border"})},Vf=P.memo(t=>{const e=F.c(2),{content:n}=t;let r;return e[0]!==n?(r=m.jsx(Dy,{remarkPlugins:hI,rehypePlugins:pI,components:mI,children:n}),e[0]=n,e[1]=r):r=e[1],r},(t,e)=>t.content===e.content);function gI(t){const e=F.c(20),{language:n,content:r}=t,{handleCopy:i,copied:s}=qf(),a=n||"text";let o;e[0]!==a?(o=m.jsx("span",{className:"text-xs font-mono uppercase text-muted-foreground tracking-widest select-none",children:a}),e[0]=a,e[1]=o):o=e[1];let u;e[2]!==r||e[3]!==i?(u=()=>i(r),e[2]=r,e[3]=i,e[4]=u):u=e[4];const l=s?"check":"content_copy";let d;e[5]!==l?(d=m.jsx(fe,{name:l,size:14}),e[5]=l,e[6]=d):d=e[6];let c;e[7]!==u||e[8]!==d?(c=m.jsx(ot,{size:"icon",variant:"ghost",onClick:u,"aria-label":"Copy code",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:d}),e[7]=u,e[8]=d,e[9]=c):c=e[9];let h;e[10]!==o||e[11]!==c?(h=m.jsxs("div",{className:"flex items-center justify-between p-1 pl-4 bg-muted border-b border-border",children:[o,c]}),e[10]=o,e[11]=c,e[12]=h):h=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=m.jsx(oI,{}),e[13]=p):p=e[13];let g;e[14]!==r||e[15]!==n?(g=m.jsx(P.Suspense,{fallback:p,children:m.jsx(aI,{language:n,content:r})}),e[14]=r,e[15]=n,e[16]=g):g=e[16];let b;return e[17]!==h||e[18]!==g?(b=m.jsxs("div",{className:"my-4 rounded-lg bg-muted overflow-hidden border border-border grid min-w-0",children:[h,g]}),e[17]=h,e[18]=g,e[19]=b):b=e[19],b}Vf.displayName="MemoizedMarkdownBlock";const Ga=t=>{const e=F.c(7),{id:n,text:r}=t;let i;e[0]!==r?(i=Se.lexer(r),e[0]=r,e[1]=i):i=e[1];const s=i;let a;if(e[2]!==s||e[3]!==n){let o;e[5]!==n?(o=(u,l)=>u.type==="code"?m.jsx(gI,{language:u.lang,content:u.text},`${n}-block_${l}`):m.jsx(Vf,{content:u.raw},`${n}-block_${l}`),e[5]=n,e[6]=o):o=e[6],a=s.map(o),e[2]=s,e[3]=n,e[4]=a}else a=e[4];return a};Ga.displayName="MemoizedMarkdown";function bI(t,e){switch(e.type){case"TOGGLE":return{isExpanded:!t.isExpanded,wasManuallyToggled:!0};case"SET_EXPANDED":return t.wasManuallyToggled?t:{...t,isExpanded:e.payload};default:return t}}function EI(t){const e=F.c(38),{part:n,id:r}=t,{state:i}=n,s=i==="streaming";let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={isExpanded:!1,wasManuallyToggled:!1},e[0]=a):a=e[0];const[o,u]=P.useReducer(bI,a),{isExpanded:l}=o;let d,c;e[1]!==s?(d=()=>{u({type:"SET_EXPANDED",payload:s})},c=[s],e[1]=s,e[2]=d,e[3]=c):(d=e[2],c=e[3]),P.useEffect(d,c);let h;e[4]===Symbol.for("react.memo_cache_sentinel")?(h=()=>{u({type:"TOGGLE"})},e[4]=h):h=e[4];const p=h,g=s&&"animate-pulse";let b;e[5]!==g?(b=X("text-muted-foreground transition-opacity",g),e[5]=g,e[6]=b):b=e[6];let x;e[7]!==b?(x=m.jsx(fe,{name:"psychology",className:b}),e[7]=b,e[8]=x):x=e[8];const E=s&&"text-shimmer";let k;e[9]!==E?(k=X("text-sm font-medium text-muted-foreground",E),e[9]=E,e[10]=k):k=e[10];let y;e[11]!==k?(y=m.jsx("span",{className:k,children:"Agent thinking"}),e[11]=k,e[12]=y):y=e[12];const _=l?"rotate-180":"";let R;e[13]!==_?(R=X("text-muted-foreground transition-transform duration-200",_),e[13]=_,e[14]=R):R=e[14];let S;e[15]!==R?(S=m.jsx(fe,{name:"expand_more",className:R}),e[15]=R,e[16]=S):S=e[16];let w;e[17]!==y||e[18]!==S||e[19]!==x?(w=m.jsxs("button",{type:"button",onClick:p,className:"flex items-center gap-2 py-2 transition-colors cursor-pointer",children:[x,y,S]}),e[17]=y,e[18]=S,e[19]=x,e[20]=w):w=e[20];const O=l?s?"max-h-[400px] opacity-100":"max-h-[200px] opacity-80":"max-h-0 opacity-0 overflow-hidden";let D;e[21]!==O?(D=X("transition-all duration-200 ease-in-out",O),e[21]=O,e[22]=D):D=e[22];const v=s?"max-h-[400px]":"max-h-[200px]";let B;e[23]!==v?(B=X("border-l-2 pl-4 overflow-y-auto",v),e[23]=v,e[24]=B):B=e[24];let j;e[25]===Symbol.for("react.memo_cache_sentinel")?(j=X("text-muted-foreground markdown-sm pb-2"),e[25]=j):j=e[25];let G;e[26]!==r||e[27]!==n.text?(G=m.jsx("div",{className:j,children:m.jsx(Ga,{id:r,text:n.text})}),e[26]=r,e[27]=n.text,e[28]=G):G=e[28];let Y;e[29]!==B||e[30]!==G?(Y=m.jsx("div",{className:B,children:G}),e[29]=B,e[30]=G,e[31]=Y):Y=e[31];let H;e[32]!==D||e[33]!==Y?(H=m.jsx("div",{className:D,children:Y}),e[32]=D,e[33]=Y,e[34]=H):H=e[34];let K;return e[35]!==w||e[36]!==H?(K=m.jsxs("div",{className:"flex flex-col",children:[w,H]}),e[35]=w,e[36]=H,e[37]=K):K=e[37],K}function xI(){const t=F.c(3),[e,n]=P.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=async a=>{await navigator.clipboard.writeText(a),n(!0),setTimeout(()=>n(!1),2e3)},t[0]=r):r=t[0];const i=r;let s;return t[1]!==e?(s={handleCopy:i,copied:e},t[1]=e,t[2]=s):s=t[2],s}function Wf(t){const e=F.c(13),{id:n,text:r,copyable:i}=t,s=i===void 0?!1:i,{handleCopy:a}=xI(),[o,u]=P.useState(!1);let l;e[0]!==a||e[1]!==r?(l=async()=>{await a(r),u(!0),setTimeout(()=>u(!1),2e3)},e[0]=a,e[1]=r,e[2]=l):l=e[2];const d=l;let c;e[3]!==n||e[4]!==r?(c=m.jsx(Ga,{id:n,text:r}),e[3]=n,e[4]=r,e[5]=c):c=e[5];let h;e[6]!==s||e[7]!==d||e[8]!==o?(h=s&&m.jsx("div",{className:"flex w-full items-center justify-end gap-2 text-xs text-muted-foreground opacity-0 pointer-events-none transition-all duration-200 group-hover/part:opacity-100 group-hover/part:pointer-events-auto",children:m.jsx("div",{className:"flex gap-1",children:m.jsx(ot,{onClick:d,variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-foreground px-2 py-1 h-auto whitespace-nowrap",children:o?m.jsx(m.Fragment,{children:m.jsx(fe,{name:"check",className:"mr-1 text-sm"})}):m.jsx(m.Fragment,{children:m.jsx(fe,{name:"content_copy",className:"mr-1 text-sm"})})})})}),e[6]=s,e[7]=d,e[8]=o,e[9]=h):h=e[9];let p;return e[10]!==c||e[11]!==h?(p=m.jsxs("div",{className:"group/part relative",children:[c,h]}),e[10]=c,e[11]=h,e[12]=p):p=e[12],p}function TI(t){const e=F.c(30),{toolName:n,input:r,output:i,isError:s}=t;if(n==="READ_MCP_TOOLS"){const u=r?.id;if(u){let l;return e[0]!==u?(l=m.jsx(tl,{connectionId:u}),e[0]=u,e[1]=l):l=e[1],l}}if(n==="CALL_MCP_TOOL"){const u=r?.connectionId;let l;e[2]!==u?(l=u&&m.jsx(tl,{connectionId:u,compact:!0}),e[2]=u,e[3]=l):l=e[3];let d;e[4]!==i?(d=JSON.stringify(i,null,2),e[4]=i,e[5]=d):d=e[5];let c;e[6]!==d?(c=m.jsx("div",{className:"absolute top-1 right-1 z-10",children:m.jsx(_I,{text:d})}),e[6]=d,e[7]=c):c=e[7];let h;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=m.jsx("div",{className:"font-semibold text-muted-foreground mb-0.5 text-[10px] uppercase tracking-wider",children:"Input"}),e[8]=h):h=e[8];let p;e[9]!==r?(p=JSON.stringify(r,null,2),e[9]=r,e[10]=p):p=e[10];let g;e[11]!==p?(g=m.jsx("pre",{className:"whitespace-pre-wrap break-all text-muted-foreground mb-2",children:p}),e[11]=p,e[12]=g):g=e[12];let b;e[13]===Symbol.for("react.memo_cache_sentinel")?(b=m.jsx("div",{className:"font-semibold text-muted-foreground mb-0.5 text-[10px] uppercase tracking-wider",children:"Output"}),e[13]=b):b=e[13];const x=`whitespace-pre-wrap break-all ${s?"text-destructive":"text-foreground"}`;let E;e[14]!==i?(E=JSON.stringify(i,null,2),e[14]=i,e[15]=E):E=e[15];let k;e[16]!==x||e[17]!==E?(k=m.jsx("pre",{className:x,children:E}),e[16]=x,e[17]=E,e[18]=k):k=e[18];let y;e[19]!==k||e[20]!==c||e[21]!==g?(y=m.jsxs("div",{className:"relative bg-muted rounded-md p-2 text-xs font-mono overflow-auto max-h-[200px]",children:[c,h,g,b,k]}),e[19]=k,e[20]=c,e[21]=g,e[22]=y):y=e[22];let _;return e[23]!==l||e[24]!==y?(_=m.jsxs("div",{className:"flex flex-col gap-2",children:[l,y]}),e[23]=l,e[24]=y,e[25]=_):_=e[25],_}let a;e[26]!==i?(a=JSON.stringify(i,null,2),e[26]=i,e[27]=a):a=e[27];let o;return e[28]!==a?(o=m.jsx("div",{className:"bg-muted rounded-md p-2 text-xs font-mono overflow-auto max-h-[200px]",children:m.jsx("pre",{className:"whitespace-pre-wrap break-all",children:a})}),e[28]=a,e[29]=o):o=e[29],o}function tl(t){const e=F.c(15),{connectionId:n,compact:r}=t,i=xp(n),{org:s}=vt(),{slug:a}=s,o=vr();if(!i)return null;let u;e[0]!==i.id||e[1]!==o||e[2]!==a?(u=()=>{o({to:"/$org/mcps/$connectionId",params:{org:a,connectionId:i.id}})},e[0]=i.id,e[1]=o,e[2]=a,e[3]=u):u=e[3];const l=u;if(r){let c;e[4]!==i.title?(c=m.jsx("span",{className:"font-medium text-foreground",children:i.title}),e[4]=i.title,e[5]=c):c=e[5];let h;e[6]===Symbol.for("react.memo_cache_sentinel")?(h=m.jsx(fe,{name:"open_in_new",size:12}),e[6]=h):h=e[6];let p;e[7]!==l?(p=m.jsx("button",{type:"button",onClick:l,className:"hover:text-foreground transition-colors",title:"Open connection",children:h}),e[7]=l,e[8]=p):p=e[8];let g;return e[9]!==c||e[10]!==p?(g=m.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground bg-muted/50 px-2 py-1 rounded-md w-fit",children:[c,p]}),e[9]=c,e[10]=p,e[11]=g):g=e[11],g}let d;return e[12]!==i||e[13]!==l?(d=m.jsx(Rp,{connection:i,onClick:l}),e[12]=i,e[13]=l,e[14]=d):d=e[14],d}function _I({text:t}){const e=async()=>{try{if(navigator.clipboard)await navigator.clipboard.writeText(t),ei.success("Copied to clipboard");else throw new Error("Clipboard API unavailable")}catch(n){try{const r=document.createElement("textarea");r.value=t,r.style.position="fixed",r.style.left="-9999px",r.style.top="0",document.body.appendChild(r),r.focus(),r.select();const i=document.execCommand("copy");if(document.body.removeChild(r),i)ei.success("Copied to clipboard");else throw new Error("Fallback copy failed")}catch(r){console.error("Copy failed",n,r),ei.error("Failed to copy to clipboard")}}};return m.jsx(ot,{size:"icon",variant:"ghost",className:"h-5 w-5 hover:bg-background/50",onClick:e,children:m.jsx(fe,{name:"content_copy",size:12})})}function yI(t){const e=F.c(42),{part:n}=t;let r;e[0]!==n.type?(r=n.type.replace("tool-",""),e[0]=n.type,e[1]=r):r=e[1];const i=r,{state:s}=n,a=s==="output-error"?"error":"terminal",o=s==="output-error"&&"text-destructive";let u;e[2]!==o?(u=X("h-3.5 w-3.5",o),e[2]=o,e[3]=u):u=e[3];let l;e[4]!==a||e[5]!==u?(l=m.jsx(fe,{name:a,className:u}),e[4]=a,e[5]=u,e[6]=l):l=e[6];const d=s==="output-error"&&"text-destructive/90";let c;e[7]!==d?(c=X(d),e[7]=d,e[8]=c):c=e[8];const h=s==="input-streaming"&&`Streaming ${i} arguments...`,p=s==="input-available"&&`Calling ${i}...`,g=s==="output-available"&&`Called ${i}`,b=s==="output-error"&&`Error calling ${i}`;let x;e[9]!==g||e[10]!==b||e[11]!==c||e[12]!==h||e[13]!==p?(x=m.jsxs("span",{className:c,children:[h,p,g,b]}),e[9]=g,e[10]=b,e[11]=c,e[12]=h,e[13]=p,e[14]=x):x=e[14];let E;e[15]!==s?(E=(s==="input-streaming"||s==="input-available")&&m.jsx("span",{className:"animate-pulse",children:"..."}),e[15]=s,e[16]=E):E=e[16];let k;e[17]!==x||e[18]!==E||e[19]!==l?(k=m.jsxs("div",{className:"flex items-center gap-2 text-xs font-medium text-muted-foreground",children:[l,x,E]}),e[17]=x,e[18]=E,e[19]=l,e[20]=k):k=e[20];const y=s==="output-error"?"border-destructive/50":"border-border";let _;e[21]!==y?(_=X("transition-all duration-200 ease-in-out","border-l-2 pl-3",y),e[21]=y,e[22]=_):_=e[22];let R;e[23]!==n.input||e[24]!==s?(R=(s==="input-streaming"||s==="input-available")&&!!n.input&&m.jsx("div",{className:"text-xs font-mono text-muted-foreground bg-muted/30 p-2 rounded",children:JSON.stringify(n.input,null,2)}),e[23]=n.input,e[24]=s,e[25]=R):R=e[25];let S;e[26]!==n.input||e[27]!==n.output||e[28]!==s||e[29]!==i?(S=s==="output-available"&&m.jsx(TI,{toolName:i,input:n.input,output:n.output}),e[26]=n.input,e[27]=n.output,e[28]=s,e[29]=i,e[30]=S):S=e[30];let w;e[31]!==n||e[32]!==s?(w=s==="output-error"&&m.jsx("div",{className:"text-xs font-mono bg-destructive/10 text-destructive p-2 rounded border border-destructive/20",children:"errorText"in n&&typeof n.errorText=="string"?n.errorText:"An unknown error occurred"}),e[31]=n,e[32]=s,e[33]=w):w=e[33];let O;e[34]!==_||e[35]!==R||e[36]!==S||e[37]!==w?(O=m.jsxs("div",{className:_,children:[R,S,w]}),e[34]=_,e[35]=R,e[36]=S,e[37]=w,e[38]=O):O=e[38];let D;return e[39]!==k||e[40]!==O?(D=m.jsxs("div",{className:"flex flex-col gap-1.5 py-1",children:[k,O]}),e[39]=k,e[40]=O,e[41]=D):D=e[41],D}const kI={planning:{icon:"track_changes",label:"Planning next moves"},thinking:{icon:"psychology",label:"Thinking"}},AI=1200;function SI(){const t=F.c(9),[e,n]=P.useState("planning");let r,i;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=()=>{const l=setTimeout(()=>{n("thinking")},AI);return()=>{clearTimeout(l)}},i=[],t[0]=r,t[1]=i):(r=t[0],i=t[1]),P.useEffect(r,i);const s=kI[e];let a;t[2]!==s.icon?(a=m.jsx(fe,{name:s.icon,className:"text-muted-foreground animate-pulse",size:20}),t[2]=s.icon,t[3]=a):a=t[3];let o;t[4]!==s.label?(o=m.jsxs("span",{className:"text-sm font-medium text-muted-foreground text-shimmer",children:[s.label,"..."]}),t[4]=s.label,t[5]=o):o=t[5];let u;return t[6]!==a||t[7]!==o?(u=m.jsxs("div",{className:"flex items-center gap-2 py-2",children:[a,o]}),t[6]=a,t[7]=o,t[8]=u):u=t[8],u}function CI(t){const e=F.c(5),{duration:n}=t,r=n/1e3;let i;e[0]!==r?(i=r.toFixed(1),e[0]=r,e[1]=i):i=e[1];const s=i;let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsx(fe,{name:"lightbulb",className:"text-muted-foreground",size:16}),e[2]=a):a=e[2];let o;return e[3]!==s?(o=m.jsxs("div",{className:"flex items-center gap-2 py-2 opacity-60",children:[a,m.jsxs("span",{className:"text-xs text-muted-foreground",children:["Thought · ",s,"s"]})]}),e[3]=s,e[4]=o):o=e[4],o}function II(t){const e=F.c(24),{message:n,status:r,className:i}=t,{id:s,parts:a}=n,l=r==="streaming"||r==="submitted",d=P.useRef(null);let c;e[0]!==s?(c=()=>{const O=localStorage.getItem(`msg-duration-${s}`);return O?Number(O):null},e[0]=s,e[1]=c):c=e[1];const[h,p]=P.useState(c);let g,b;e[2]!==l?(g=()=>{l&&d.current===null&&(d.current=Date.now())},b=[l],e[2]=l,e[3]=g,e[4]=b):(g=e[3],b=e[4]),P.useEffect(g,b);let x,E;e[5]!==h||e[6]!==s||e[7]!==a.length?(x=()=>{if(a.length>0&&h===null&&d.current!==null){const O=Date.now()-d.current;p(O),localStorage.setItem(`msg-duration-${s}`,O.toString())}},E=[a.length,h,s],e[5]=h,e[6]=s,e[7]=a.length,e[8]=x,e[9]=E):(x=e[8],E=e[9]),P.useEffect(x,E);const k=a.length>0,y=k&&!l&&h!==null;let _;e[10]!==i?(_=X("w-full min-w-0 group relative flex items-start gap-4 px-8 z-20 text-foreground flex-row",i),e[10]=i,e[11]=_):_=e[11];let R;e[12]!==h||e[13]!==k||e[14]!==s||e[15]!==l||e[16]!==a||e[17]!==y?(R=k?m.jsxs(m.Fragment,{children:[y&&m.jsx(CI,{duration:h}),a.map((O,D)=>O.type==="text"?m.jsx(Wf,{id:s,text:O.text,copyable:!0},`${s}-${D}`):O.type==="reasoning"?m.jsx(EI,{part:O,id:s},`${s}-${D}`):O.type.startsWith("tool-")?m.jsx(yI,{part:O,id:s},`${s}-${D}`):null)]}):l?m.jsx(SI,{}):null,e[12]=h,e[13]=k,e[14]=s,e[15]=l,e[16]=a,e[17]=y,e[18]=R):R=e[18];let S;e[19]!==R?(S=m.jsx("div",{className:"flex flex-col gap-2 min-w-0 w-full items-start",children:m.jsx("div",{className:"w-full min-w-0 not-only:rounded-2xl text-[0.9375rem] wrap-break-word overflow-wrap-anywhere bg-transparent",children:R})}),e[19]=R,e[20]=S):S=e[20];let w;return e[21]!==_||e[22]!==S?(w=m.jsx("div",{className:_,children:S}),e[21]=_,e[22]=S,e[23]=w):w=e[23],w}const Gf=P.createContext(null);function Kf(t){const e=F.c(2),{children:n}=t;let r;return e[0]!==n?(r=m.jsx(m.Fragment,{children:n}),e[0]=n,e[1]=r):r=e[1],r}function NI(t){const e=[];for(let n=0;n<t.length;n++){const r=t[n];if(!P.isValidElement(r))continue;if(r.props?.message?.role==="assistant"){const s=t[n-1],a=P.isValidElement(s)&&s.props?.message?.role,o=s&&P.isValidElement(s)&&a==="user"?s:null;e.push({user:o,assistant:r})}}return e}function wI(t){const e=F.c(27),{children:n,className:r,minHeightOffset:i}=t,s=P.useRef(null);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=[],e[0]=a):a=e[0];const o=P.useRef(a);let u,l,d,c,h,p,g;if(e[1]!==n||e[2]!==r||e[3]!==i){const k=P.Children.toArray(n),y=k[k.length-1];l=y&&P.isValidElement(y)&&y.type===Kf?y:null;const _=l?k.slice(0,-1):k,R=NI(_);let S;e[11]===Symbol.for("react.memo_cache_sentinel")?(S=O=>{const D=o.current[O];if(D&&s.current){const v=s.current.offsetTop,B=D.offsetTop;s.current.scrollTo({top:B-v,behavior:"smooth"})}},e[11]=S):S=e[11];const w=S;u=Gf.Provider,e[12]===Symbol.for("react.memo_cache_sentinel")?(g={scrollToPair:w},e[12]=g):g=e[12],h=s,e[13]!==r?(p=X("w-full min-w-0 max-w-full overflow-y-auto h-full overflow-x-hidden",r),e[13]=r,e[14]=p):p=e[14],d="flex flex-col min-w-0 max-w-2xl mx-auto w-full",c=R.map((O,D)=>{const v=D===R.length-1;return m.jsxs("div",{ref:B=>{o.current[D]=B},className:"flex flex-col gap-2 py-2",style:v&&i?{minHeight:`calc(100vh - ${i}px)`}:void 0,children:[m.jsx("div",{className:"sticky top-0 z-50 bg-background w-full h-2"}),m.jsx("div",{className:"sticky top-2 z-50",children:O.user&&P.isValidElement(O.user)?P.cloneElement(O.user,{pairIndex:D}):O.user}),O.assistant]},D)}),e[1]=n,e[2]=r,e[3]=i,e[4]=u,e[5]=l,e[6]=d,e[7]=c,e[8]=h,e[9]=p,e[10]=g}else u=e[4],l=e[5],d=e[6],c=e[7],h=e[8],p=e[9],g=e[10];let b;e[15]!==l||e[16]!==d||e[17]!==c?(b=m.jsxs("div",{className:d,children:[c,l]}),e[15]=l,e[16]=d,e[17]=c,e[18]=b):b=e[18];let x;e[19]!==h||e[20]!==p||e[21]!==b?(x=m.jsx("div",{ref:h,className:p,children:b}),e[19]=h,e[20]=p,e[21]=b,e[22]=x):x=e[22];let E;return e[23]!==u||e[24]!==g||e[25]!==x?(E=m.jsx(u,{value:g,children:x}),e[23]=u,e[24]=g,e[25]=x,e[26]=E):E=e[26],E}function vI(t){const e=F.c(29),{message:n,className:r,pairIndex:i}=t,{id:s,parts:a}=n,o=P.useRef(null),u=P.useContext(Gf),[l,d]=P.useState(!1);if(!a||a.length===0)return null;const h=a.reduce(RI,0)>60;let p;e[0]!==u||e[1]!==i?(p=()=>{i!==void 0&&u?.scrollToPair(i)},e[0]=u,e[1]=i,e[2]=p):p=e[2];const g=p;let b;e[3]!==r?(b=X("message-block w-full min-w-0 group relative flex items-start gap-4 px-4 text-foreground flex-row-reverse",r),e[3]=r,e[4]=b):b=e[4];const x=h&&!l&&"overflow-hidden relative max-h-[60px]";let E;e[5]!==x?(E=X(x),e[5]=x,e[6]=E):E=e[6];let k;if(e[7]!==s||e[8]!==a){let O;e[10]!==s?(O=(D,v)=>D.type==="text"?m.jsx(Wf,{id:s,text:D.text},`${s}-${v}`):null,e[10]=s,e[11]=O):O=e[11],k=a.map(O),e[7]=s,e[8]=a,e[9]=k}else k=e[9];let y;e[12]!==l||e[13]!==h?(y=h&&!l&&m.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-12 bg-gradient-to-t from-muted to-transparent pointer-events-none"}),e[12]=l,e[13]=h,e[14]=y):y=e[14];let _;e[15]!==E||e[16]!==k||e[17]!==y?(_=m.jsxs("div",{className:E,children:[k,y]}),e[15]=E,e[16]=k,e[17]=y,e[18]=_):_=e[18];let R;e[19]!==l||e[20]!==h?(R=h&&m.jsx("div",{className:"flex justify-center",children:m.jsx(ot,{onClick:O=>{O.stopPropagation(),d(!l)},variant:"ghost",size:"xs",className:"text-xs w-full text-muted-foreground hover:text-foreground",children:m.jsx(fe,{name:l?"expand_less":"expand_more",className:"text-sm"})})}),e[19]=l,e[20]=h,e[21]=R):R=e[21];let S;e[22]!==g||e[23]!==_||e[24]!==R?(S=m.jsxs("div",{onClick:g,className:"w-full border min-w-0 shadow-[0_3px_6px_-1px_rgba(0,0,0,0.1)] rounded-lg text-[0.9375rem] break-words overflow-wrap-anywhere bg-muted px-4 py-2 cursor-pointer transition-colors",children:[_,R]}),e[22]=g,e[23]=_,e[24]=R,e[25]=S):S=e[25];let w;return e[26]!==b||e[27]!==S?(w=m.jsxs("div",{ref:o,className:b,children:[" ",S]}),e[26]=b,e[27]=S,e[28]=w):w=e[28],w}function RI(t,e){return e.type==="text"?t+e.text.length:t}const nl="https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png",OI=t=>new wc({api:`/api/${t}/models/stream`,credentials:"include",prepareSendMessagesRequest:({messages:e,requestMetadata:n})=>({body:{messages:e,stream:!0,...n}})});function LI(t){const e=F.c(12),{onSubmit:n,onStop:r,disabled:i,isStreaming:s,placeholder:a,leftActions:o}=t,[u,l]=P.useState("");let d;e[0]!==u||e[1]!==s||e[2]!==n?(d=async p=>{if(p?.preventDefault(),!u?.trim()||s)return;const g=u.trim();try{await n(g),l("")}catch(b){const x=b;console.error("Failed to send message:",x);const E=x instanceof Error?x.message:"Failed to send message";ei.error(E)}},e[0]=u,e[1]=s,e[2]=n,e[3]=d):d=e[3];const c=d;let h;return e[4]!==i||e[5]!==c||e[6]!==u||e[7]!==s||e[8]!==o||e[9]!==r||e[10]!==a?(h=m.jsx(wE,{value:u,onChange:l,onSubmit:c,onStop:r,disabled:i,isStreaming:s,placeholder:a,leftActions:o}),e[4]=i,e[5]=c,e[6]=u,e[7]=s,e[8]=o,e[9]=r,e[10]=a,e[11]=h):h=e[11],h}function DI(){const{data:t}=Rr.useSession(),e=t?.user,{org:n,locator:r}=vt(),[,i]=wi(),s=vr(),{createThread:a,activeThreadId:o}=Ea(),u=P.useRef(null),l=Zc(),d=$E(),c=HE(o),[h,p]=On(Or.chatSelectedModel(r),T=>T??null),[g,b]=On(`${r}:selected-agent`,()=>null),x=OI(n.slug),y=mE({id:o,messages:c,transport:x,onFinish:async T=>{const{finishReason:V,messages:te,isAbort:Q,isDisconnect:J,isError:ne}=T;if(V!=="stop"||Q||J||ne)return;const ae=te.slice(-2).filter(Boolean);if(ae.length===2){d.insertMany.mutate(ae);const ge=ae.find(Me=>Me.parts?.find(ye=>ye.type==="text"))?.parts?.find(Me=>Me.type==="text")?.text.slice(0,100)||"",Re=await zE(r,o);Re?l.update.mutate({id:o,updates:{title:Re.title||ge,updated_at:new Date().toISOString()}}):a({id:o,title:ge})}},onError:T=>{console.error("[deco-chat] Chat error:",T)}}),{status:_}=y,R=Tp(),[S]=ro({connections:R,binding:"LLMS"}),[w]=ro({connections:R,binding:"AGENTS"}),O=x1(S?.id),D=E1(w?.id),v=!O||!S?[]:O.map(T=>({...T,name:T.title,contextWindow:T.limits?.contextWindow,outputLimit:T.limits?.maxOutputTokens,inputCost:T.costs?.input,outputCost:T.costs?.output,provider:T.provider,connectionId:S.id,connectionName:S.title})).sort((T,V)=>T.name.localeCompare(V.name)),B=!D||!w?[]:D.map(T=>({...T,connectionId:w.id,connectionName:w.title}));P.useEffect(()=>{if(v.length>0&&!h){const T=v[0];T&&p({id:T.id,connectionId:T.connectionId})}},[O,S,h,p]),P.useEffect(()=>{if(B.length>0&&!g){const T=B[0];T&&b({agentId:T.id,connectionId:T.connectionId})}},[D,w,g,b]);const j=v.find(T=>T.id===h?.id&&T.connectionId===h?.connectionId),G=B.find(T=>T.id===g?.agentId&&T.connectionId===g?.connectionId),Y=y.messages.length===0,H=P.useRef(y.messages.length),K=P.useRef(0);y.messages.length>H.current&&K.current!==y.messages.length&&queueMicrotask(()=>{u.current&&(u.current.scrollIntoView({behavior:"smooth",block:"start"}),K.current=y.messages.length)}),H.current=y.messages.length;const se=B.map(T=>({id:`${T.connectionId}:${T.id}`,name:T.title,avatar:T.avatar,description:T.description})),pe=async T=>{if(!T?.trim()||_==="submitted"||_==="streaming")return;if(!j){console.error("No model configured");return}const V={created_at:new Date().toISOString(),thread_id:o,model:j,agent:G??void 0,user:{avatar:e?.image??void 0,name:e?.name??"you"}};await y.sendMessage({id:crypto.randomUUID(),role:"user",parts:[{type:"text",text:T}],metadata:V},{metadata:V})},ce=()=>{y.stop?.()},N=!!S,Ee=!!w;if(!(N&&Ee)){let T,V;return!N&&!Ee?(T="Connect your providers",V="Connect MCP Servers with llm and agents to unlock AI-powered features."):N?(T="No agents configured",V="Connect to an agents provider to use AI assistants."):(T="No model provider connected",V="Connect to a model provider to unlock AI-powered features."),m.jsxs(en,{className:"h-full",children:[m.jsxs(en.Header,{children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("img",{src:nl,alt:"deco chat",className:"size-5 rounded"}),m.jsx("span",{className:"text-sm font-medium",children:"deco chat"})]}),m.jsx("div",{className:"flex items-center gap-1",children:m.jsx("button",{type:"button",onClick:()=>i(!1),className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent transition-colors group cursor-pointer",title:"Close chat",children:m.jsx(fe,{name:"close",size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"})})})]}),m.jsx(en.Content,{className:"flex flex-col items-center",children:m.jsx(Ep,{title:T,description:V,actions:m.jsx(ot,{variant:"outline",onClick:()=>s({to:"/$org/mcps",params:{org:n.slug},search:{action:"create"}}),children:"Add connection"})})})]})}return m.jsxs(en,{className:"h-full",children:[m.jsxs(en.Header,{children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("img",{src:G?.avatar||nl,alt:"deco chat",className:"size-5 rounded"}),m.jsx("span",{className:"text-sm font-medium",children:G?.title||"deco chat"})]}),m.jsxs("div",{className:"flex items-center gap-1",children:[!Y&&m.jsx("button",{type:"button",onClick:()=>{a()},className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent group cursor-pointer",title:"New chat",children:m.jsx(fe,{name:"add",size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"})}),m.jsx("button",{type:"button",onClick:()=>i(!1),className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent transition-colors group cursor-pointer",title:"Close chat",children:m.jsx(fe,{name:"close",size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"})})]})]}),m.jsx(en.Content,{children:Y?m.jsx(NE,{title:G?.title||"Ask deco chat",description:G?.description||"Ask anything about configuring model providers or using MCP Mesh.",avatar:G?.avatar||"https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png"}):m.jsxs(wI,{minHeightOffset:240,children:[y.messages.map((T,V)=>T.role==="user"?m.jsx(vI,{message:T},T.id):T.role==="assistant"?m.jsx(II,{message:T,status:V===y.messages.length-1?_:void 0},T.id):null),m.jsx(Kf,{children:m.jsx("div",{ref:u,className:"h-0"})})]})}),m.jsx(en.Footer,{children:m.jsx(LI,{onSubmit:pe,onStop:ce,disabled:v.length===0||!h,isStreaming:_==="submitted"||_==="streaming",placeholder:v.length===0?"Add an LLM binding connection to start chatting":"Ask anything or @ for context",leftActions:m.jsxs("div",{className:"flex items-center gap-2",children:[B.length>0&&m.jsx(kE,{agents:se,selectedAgentId:g?`${g.connectionId}:${g.agentId}`:void 0,onAgentChange:T=>{if(!T)return;const[V,te]=T.split(":");V&&te&&b({agentId:te,connectionId:V})},placeholder:"Agent",variant:"bordered"}),v.length>0&&m.jsx(LE,{models:v,selectedModelId:h?.id,onModelChange:T=>{if(!T)return;const V=v.find(te=>te.id===T);V&&p({id:V.id,connectionId:V.connectionId})},placeholder:"Model",variant:"borderless"})]})})})]})}function Qf(t){const e=F.c(12);let n,r,i,s;e[0]!==t?({className:n,orientation:i,decorative:s,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=s):(n=e[1],r=e[2],i=e[3],s=e[4]);const a=i===void 0?"horizontal":i,o=s===void 0?!0:s;let u;e[5]!==n?(u=X("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",n),e[5]=n,e[6]=u):u=e[6];let l;return e[7]!==o||e[8]!==a||e[9]!==r||e[10]!==u?(l=m.jsx(ep,{"data-slot":"separator-root",decorative:o,orientation:a,className:u,...r}),e[7]=o,e[8]=a,e[9]=r,e[10]=u,e[11]=l):l=e[11],l}function PI(t){const e=F.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(tp,{"data-slot":"sheet",...n}),e[2]=n,e[3]=r):r=e[3],r}function MI(t){const e=F.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(sp,{"data-slot":"sheet-portal",...n}),e[2]=n,e[3]=r):r=e[3],r}function BI(t){const e=F.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=X("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=m.jsx(op,{"data-slot":"sheet-overlay",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function FI(t){const e=F.c(17);let n,r,i,s;e[0]!==t?({className:r,children:n,side:s,...i}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=s):(n=e[1],r=e[2],i=e[3],s=e[4]);const a=s===void 0?"right":s;let o;e[5]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsx(BI,{}),e[5]=o):o=e[5];const u=a==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",l=a==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",d=a==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",c=a==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t";let h;e[6]!==r||e[7]!==u||e[8]!==l||e[9]!==d||e[10]!==c?(h=X("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",u,l,d,c,r),e[6]=r,e[7]=u,e[8]=l,e[9]=d,e[10]=c,e[11]=h):h=e[11];let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=m.jsxs(ap,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[m.jsx(Op,{className:"size-4"}),m.jsx("span",{className:"sr-only",children:"Close"})]}),e[12]=p):p=e[12];let g;return e[13]!==n||e[14]!==i||e[15]!==h?(g=m.jsxs(MI,{children:[o,m.jsxs(ip,{"data-slot":"sheet-content",className:h,...i,children:[n,p]})]}),e[13]=n,e[14]=i,e[15]=h,e[16]=g):g=e[16],g}function zI(t){const e=F.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=X("flex flex-col gap-1.5 p-4",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=m.jsx("div",{"data-slot":"sheet-header",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function jI(t){const e=F.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=X("text-foreground font-semibold",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=m.jsx(np,{"data-slot":"sheet-title",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function UI(t){const e=F.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=X("text-muted-foreground text-sm",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=m.jsx(rp,{"data-slot":"sheet-description",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function Ka(t){const e=F.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=X("bg-accent animate-pulse rounded-md",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=m.jsx("div",{"data-slot":"skeleton",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}const HI="sidebar_state",$I=3600*24*7,ZI="16rem",YI="18rem",qI="3rem",VI="b",Xf=P.createContext(null);function Qa(){const t=P.useContext(Xf);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function WI(t){const e=F.c(21),{defaultOpen:n,open:r,onOpenChange:i,children:s}=t,a=n===void 0?!0:n,o=Bn(),[u,l]=P.useState(!1),[d,c]=P.useState(a),h=r??d;let p;e[0]!==h||e[1]!==i?(p=O=>{const D=typeof O=="function"?O(h):O;i?i(D):c(D),document.cookie=`${HI}=${D}; path=/; max-age=${$I}`},e[0]=h,e[1]=i,e[2]=p):p=e[2];const g=p;let b;e[3]!==o||e[4]!==g?(b=()=>o?l(KI):g(GI),e[3]=o,e[4]=g,e[5]=b):b=e[5];const x=b;let E,k;e[6]!==x?(E=()=>{const O=D=>{if(D.key===VI&&(D.metaKey||D.ctrlKey)){const v=D.target;if(v.tagName==="INPUT"||v.tagName==="TEXTAREA"||v.isContentEditable)return;D.preventDefault(),x()}};return globalThis.addEventListener("keydown",O),()=>globalThis.removeEventListener("keydown",O)},k=[x],e[6]=x,e[7]=E,e[8]=k):(E=e[7],k=e[8]),P.useEffect(E,k);const y=h?"expanded":"collapsed";let _;e[9]!==o||e[10]!==h||e[11]!==u||e[12]!==g||e[13]!==y||e[14]!==x?(_={state:y,open:h,setOpen:g,isMobile:o,openMobile:u,setOpenMobile:l,toggleSidebar:x},e[9]=o,e[10]=h,e[11]=u,e[12]=g,e[13]=y,e[14]=x,e[15]=_):_=e[15];const R=_;let S;e[16]!==s?(S=m.jsx(kp,{delayDuration:0,children:s}),e[16]=s,e[17]=S):S=e[17];let w;return e[18]!==R||e[19]!==S?(w=m.jsx(Xf.Provider,{value:R,children:S}),e[18]=R,e[19]=S,e[20]=w):w=e[20],w}function GI(t){return!t}function KI(t){return!t}function QI(t){const e=F.c(14);let n,r,i,s;e[0]!==t?({className:r,style:s,children:n,...i}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=s):(n=e[1],r=e[2],i=e[3],s=e[4]);let a;e[5]!==s?(a={"--sidebar-width":ZI,"--sidebar-width-icon":qI,...s},e[5]=s,e[6]=a):a=e[6];const o=a;let u;e[7]!==r?(u=X("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex h-full w-full",r),e[7]=r,e[8]=u):u=e[8];let l;return e[9]!==n||e[10]!==i||e[11]!==o||e[12]!==u?(l=m.jsx("div",{"data-slot":"sidebar-wrapper",style:o,className:u,...i,children:n}),e[9]=n,e[10]=i,e[11]=o,e[12]=u,e[13]=l):l=e[13],l}function XI(t){const e=F.c(46);let n,r,i,s,a,o;e[0]!==t?({side:s,variant:a,collapsible:o,className:r,children:n,...i}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=s,e[5]=a,e[6]=o):(n=e[1],r=e[2],i=e[3],s=e[4],a=e[5],o=e[6]);const u=s===void 0?"left":s,l=a===void 0?"sidebar":a,d=o===void 0?"offcanvas":o,{isMobile:c,state:h,openMobile:p,setOpenMobile:g}=Qa();if(d==="none"){let D;e[7]!==r?(D=X("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",r),e[7]=r,e[8]=D):D=e[8];let v;return e[9]!==n||e[10]!==i||e[11]!==D?(v=m.jsx("div",{"data-slot":"sidebar",className:D,...i,children:n}),e[9]=n,e[10]=i,e[11]=D,e[12]=v):v=e[12],v}if(c){let D;e[13]===Symbol.for("react.memo_cache_sentinel")?(D={"--sidebar-width":YI},e[13]=D):D=e[13];let v;e[14]===Symbol.for("react.memo_cache_sentinel")?(v=m.jsxs(zI,{className:"sr-only",children:[m.jsx(jI,{children:"Sidebar"}),m.jsx(UI,{children:"Displays the mobile sidebar."})]}),e[14]=v):v=e[14];let B;e[15]!==n?(B=m.jsx("div",{className:"flex h-full w-full flex-col",children:n}),e[15]=n,e[16]=B):B=e[16];let j;e[17]!==u||e[18]!==B?(j=m.jsxs(FI,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:D,side:u,children:[v,B]}),e[17]=u,e[18]=B,e[19]=j):j=e[19];let G;return e[20]!==p||e[21]!==i||e[22]!==g||e[23]!==j?(G=m.jsx(PI,{open:p,onOpenChange:g,...i,children:j}),e[20]=p,e[21]=i,e[22]=g,e[23]=j,e[24]=G):G=e[24],G}const b=h==="collapsed"?d:"",x=l==="floating"||l==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)";let E;e[25]!==x?(E=X("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",x),e[25]=x,e[26]=E):E=e[26];let k;e[27]!==E?(k=m.jsx("div",{"data-slot":"sidebar-gap",className:E}),e[27]=E,e[28]=k):k=e[28];const y=u==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",_=l==="floating"||l==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)";let R;e[29]!==r||e[30]!==y||e[31]!==_?(R=X("fixed top-12 bottom-0 z-10 hidden w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",y,_,r),e[29]=r,e[30]=y,e[31]=_,e[32]=R):R=e[32];let S;e[33]!==n?(S=m.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border py-2 flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:n}),e[33]=n,e[34]=S):S=e[34];let w;e[35]!==i||e[36]!==R||e[37]!==S?(w=m.jsx("div",{"data-slot":"sidebar-container",className:R,...i,children:S}),e[35]=i,e[36]=R,e[37]=S,e[38]=w):w=e[38];let O;return e[39]!==u||e[40]!==h||e[41]!==w||e[42]!==b||e[43]!==k||e[44]!==l?(O=m.jsxs("div",{className:"group peer text-foreground hidden md:block border-r","data-state":h,"data-collapsible":b,"data-variant":l,"data-side":u,"data-slot":"sidebar",children:[k,w]}),e[39]=u,e[40]=h,e[41]=w,e[42]=b,e[43]=k,e[44]=l,e[45]=O):O=e[45],O}function JI(t){const e=F.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=X("bg-background relative flex w-full flex-1 flex-col min-w-0","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=m.jsx("main",{"data-slot":"sidebar-inset",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function Jf(t){const e=F.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=X("bg-border mx-4 w-full",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=m.jsx(Qf,{"data-slot":"sidebar-separator","data-sidebar":"separator",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function eN(t){const e=F.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=X("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=m.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function tN(t){const e=F.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=X("relative flex w-full min-w-0 flex-col px-2 py-2 md:py-0",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=m.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function nN(t){const e=F.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=X("w-full text-sm",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=m.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function rN(t){const e=F.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=X("flex w-full min-w-0 flex-col gap-1",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=m.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function Kt(t){const e=F.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=X("group/menu-item relative",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=m.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}const iN=up("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-lg px-2 py-1.5 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding,colors] transition-colors duration-150 ease-out hover:transition-none focus-visible:ring-2 active:bg-sidebar-accent/75 disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent/75 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-[18px] [&>svg]:shrink-0 [&>svg]:text-muted-foreground/75",{variants:{variant:{default:"hover:bg-sidebar-accent text-sidebar-foreground/80 active:text-sidebar-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Xa(t){const e=F.c(28);let n,r,i,s,a,o,u;e[0]!==t?({asChild:i,isActive:s,variant:a,size:o,tooltip:u,className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=s,e[5]=a,e[6]=o,e[7]=u):(n=e[1],r=e[2],i=e[3],s=e[4],a=e[5],o=e[6],u=e[7]);const l=i===void 0?!1:i,d=s===void 0?!1:s,c=a===void 0?"default":a,h=o===void 0?"default":o,p=l?lp:"button",{isMobile:g,state:b}=Qa();let x;e[8]!==n||e[9]!==h||e[10]!==c?(x=X(iN({variant:c,size:h}),n),e[8]=n,e[9]=h,e[10]=c,e[11]=x):x=e[11];let E;e[12]!==p||e[13]!==d||e[14]!==r||e[15]!==h||e[16]!==x?(E=m.jsx(p,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":h,"data-active":d,className:x,...r}),e[12]=p,e[13]=d,e[14]=r,e[15]=h,e[16]=x,e[17]=E):E=e[17];const k=E;if(!u)return k;if(typeof u=="string"){let w;e[18]!==u?(w={children:u},e[18]=u,e[19]=w):w=e[19],u=w}let y;e[20]!==k?(y=m.jsx(Cl,{asChild:!0,children:k}),e[20]=k,e[21]=y):y=e[21];const _=b!=="collapsed"||g;let R;e[22]!==_||e[23]!==u?(R=m.jsx(Sl,{side:"right",align:"center",hidden:_,...u}),e[22]=_,e[23]=u,e[24]=R):R=e[24];let S;return e[25]!==y||e[26]!==R?(S=m.jsxs(Il,{children:[y,R]}),e[25]=y,e[26]=R,e[27]=S):S=e[27],S}function sN(t){const e=F.c(25),{item:n}=t,r=vr(),{org:i}=vt(),s=Ll(i.id),a=Lp(i.id);let o;e[0]!==a.update||e[1]!==n.url||e[2]!==s?.sidebar_items?(o=async()=>{const y=(s?.sidebar_items||[]).filter(_=>_.url!==n.url);await a.update.mutateAsync({sidebar_items:y})},e[0]=a.update,e[1]=n.url,e[2]=s?.sidebar_items,e[3]=o):o=e[3];const u=o;let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=/^https?:\/\/.+/,e[4]=l):l=e[4];let d;e[5]!==n.icon?(d=l.test(n.icon),e[5]=n.icon,e[6]=d):d=e[6];const c=d;let h;e[7]!==n.url||e[8]!==r?(h=()=>{r({to:n.url})},e[7]=n.url,e[8]=r,e[9]=h):h=e[9];let p;e[10]!==c||e[11]!==n.icon||e[12]!==n.title?(p=m.jsx("div",{className:"flex items-center justify-center shrink-0 mr-2",children:c?m.jsx("img",{src:n.icon,alt:n.title,className:"h-4 w-4 rounded object-cover"}):m.jsx(fe,{name:n.icon,size:16,className:"text-muted-foreground"})}),e[10]=c,e[11]=n.icon,e[12]=n.title,e[13]=p):p=e[13];let g;e[14]!==n.title?(g=n.title.toLocaleLowerCase(),e[14]=n.title,e[15]=g):g=e[15];let b;e[16]!==g?(b=m.jsx("div",{className:"flex-1 min-w-0 flex flex-col items-start",children:m.jsx("span",{className:"truncate text-sm w-full capitalize",children:g})}),e[16]=g,e[17]=b):b=e[17];let x;e[18]!==u?(x=m.jsx(fe,{name:"close",size:16,className:"text-muted-foreground opacity-0 group-hover/item:opacity-50 hover:opacity-100 cursor-pointer",onClick:k=>{k.preventDefault(),k.stopPropagation(),u()}}),e[18]=u,e[19]=x):x=e[19];let E;return e[20]!==h||e[21]!==p||e[22]!==b||e[23]!==x?(E=m.jsx(Kt,{children:m.jsxs(Xa,{className:"w-full pr-2 group/item relative cursor-pointer",onClick:h,children:[p,b,x]})}),e[20]=h,e[21]=p,e[22]=b,e[23]=x,e[24]=E):E=e[24],E}function aN(){const t=F.c(4),{org:e}=vt(),r=Ll(e.id)?.sidebar_items;if(!r?.length)return null;let i;t[0]!==r?(i=r.map(oN),t[0]=r,t[1]=i):i=t[1];let s;return t[2]!==i?(s=m.jsx(eh,{children:i}),t[2]=i,t[3]=s):s=t[3],s}function oN(t){return m.jsx(sN,{item:t},t.url)}function rl(){const t=F.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=m.jsx(Kt,{children:m.jsx("div",{className:"flex items-center gap-2 px-4 py-2",children:m.jsx(Ka,{className:"h-4 flex-1"})})}),t[0]=e):e=t[0],e}function eh(t){const e=F.c(4),{children:n}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsx(Jf,{className:"my-2 -ml-1"}),e[0]=r):r=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=m.jsx(Kt,{children:m.jsx("div",{className:"px-2 py-0 text-xs font-medium text-muted-foreground flex items-center justify-between",children:m.jsx("span",{children:"Pinned Views"})})}),e[1]=i):i=e[1];let s;return e[2]!==n?(s=m.jsxs(m.Fragment,{children:[r,i,n]}),e[2]=n,e[3]=s):s=e[3],s}function uN(){const t=F.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=m.jsx(P.Suspense,{fallback:m.jsxs(eh,{children:[m.jsx(rl,{}),m.jsx(rl,{})]}),children:m.jsx(aN,{})}),t[0]=e):e=t[0],e}function lN(t){const e=F.c(18),{thread:n,isActive:r}=t,{setActiveThreadId:i,hideThread:s}=Ea(),[,a]=wi();let o;e[0]!==n.created_at||e[1]!==n.title?(o=n.title||`Chat ${new Date(n.created_at).toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}`,e[0]=n.created_at,e[1]=n.title,e[2]=o):o=e[2];const u=o,l=`w-full pr-2 group/thread relative cursor-pointer ${r?"bg-accent":""}`;let d;e[3]!==i||e[4]!==a||e[5]!==n.id?(d=()=>{i(n.id),a(!0)},e[3]=i,e[4]=a,e[5]=n.id,e[6]=d):d=e[6];let c;e[7]!==u?(c=m.jsx("div",{className:"flex-1 min-w-0 flex flex-col items-start",children:m.jsx("span",{className:"truncate text-sm w-full",children:u})}),e[7]=u,e[8]=c):c=e[8];let h;e[9]!==s||e[10]!==r||e[11]!==n.id?(h=!r&&m.jsx(fe,{name:"close",size:16,className:"text-muted-foreground opacity-0 group-hover/thread:opacity-50 hover:opacity-100 cursor-pointer",onClick:g=>{g.preventDefault(),g.stopPropagation(),s(n.id)}}),e[9]=s,e[10]=r,e[11]=n.id,e[12]=h):h=e[12];let p;return e[13]!==l||e[14]!==d||e[15]!==c||e[16]!==h?(p=m.jsx(Kt,{children:m.jsxs(Xa,{className:l,onClick:d,children:[c,h]})}),e[13]=l,e[14]=d,e[15]=c,e[16]=h,e[17]=p):p=e[17],p}const cN=5;function dN(){const t=F.c(9),{activeThreadId:e}=Ea(),n=UE();let r,i;if(t[0]!==e||t[1]!==n){i=Symbol.for("react.early_return_sentinel");e:{const a=n.filter(hN).sort(fN).slice(0,cN);if(a.length===0){let u;t[4]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsx(Kt,{children:m.jsx("div",{className:"px-4 py-2 text-xs text-muted-foreground text-center",children:"No recent chats"})}),t[4]=u):u=t[4],i=u;break e}let o;t[5]!==e?(o=u=>m.jsx(lN,{thread:u,isActive:u.id===e},u.id),t[5]=e,t[6]=o):o=t[6],r=a.map(o)}t[0]=e,t[1]=n,t[2]=r,t[3]=i}else r=t[2],i=t[3];if(i!==Symbol.for("react.early_return_sentinel"))return i;let s;return t[7]!==r?(s=m.jsx(m.Fragment,{children:r}),t[7]=r,t[8]=s):s=t[8],s}function fN(t,e){const n=new Date(t.updated_at).getTime();return new Date(e.updated_at).getTime()-n}function hN(t){return!t.hidden}function ys(){const t=F.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=m.jsx(Kt,{children:m.jsx("div",{className:"flex items-center gap-2 px-4 py-2",children:m.jsx(Ka,{className:"h-4 flex-1"})})}),t[0]=e):e=t[0],e}function pN(){const t=F.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=m.jsx(Jf,{className:"my-2 -ml-1"}),t[0]=e):e=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=m.jsx(Kt,{children:m.jsx("div",{className:"px-2 py-0 text-xs font-medium text-muted-foreground flex items-center justify-between",children:m.jsx("span",{children:"Recent Threads"})})}),t[1]=n):n=t[1];let r;return t[2]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsxs(m.Fragment,{children:[e,n,m.jsx(P.Suspense,{fallback:m.jsxs(m.Fragment,{children:[m.jsx(ys,{}),m.jsx(ys,{}),m.jsx(ys,{})]}),children:m.jsx(dN,{})})]}),t[2]=r):r=t[2],r}function mN(){const t=F.c(36),{locator:e}=vt(),n=vr();let r;t[0]!==e?(r=io.parse(e),t[0]=e,t[1]=r):r=t[1];const{org:i}=r;let s;t[2]!==e?(s=io.isOrgAdminProject(e),t[2]=e,t[3]=s):s=t[3];const a=s;let o;t[4]!==n||t[5]!==i?(o={key:"home",label:"Home",icon:"home",onClick:()=>n({to:"/$org",params:{org:i}})},t[4]=n,t[5]=i,t[6]=o):o=t[6];let u;t[7]!==n||t[8]!==i?(u={key:"store",label:"Store",icon:"shopping_bag",onClick:()=>n({to:"/$org/store",params:{org:i}})},t[7]=n,t[8]=i,t[9]=u):u=t[9];let l;t[10]!==n||t[11]!==i?(l={key:"mcps",label:"MCP Servers",icon:"extension",onClick:()=>n({to:"/$org/mcps",params:{org:i}})},t[10]=n,t[11]=i,t[12]=l):l=t[12];let d;t[13]!==n||t[14]!==i?(d={key:"gateways",label:"MCP Gateways",icon:"network_node",onClick:()=>n({to:"/$org/gateways",params:{org:i}})},t[13]=n,t[14]=i,t[15]=d):d=t[15];let c;t[16]!==n||t[17]!==i?(c={key:"monitoring",label:"Monitoring",icon:"monitoring",onClick:()=>n({to:"/$org/monitoring",params:{org:i}})},t[16]=n,t[17]=i,t[18]=c):c=t[18];let h;t[19]!==n||t[20]!==i?(h={key:"members",label:"Members",icon:"group",onClick:()=>n({to:"/$org/members",params:{org:i}})},t[19]=n,t[20]=i,t[21]=h):h=t[21];let p;t[22]!==n||t[23]!==i?(p={key:"settings",label:"Settings",icon:"settings",onClick:()=>n({to:"/$org/settings",params:{org:i}})},t[22]=n,t[23]=i,t[24]=p):p=t[24];let g;t[25]!==o||t[26]!==u||t[27]!==l||t[28]!==d||t[29]!==c||t[30]!==h||t[31]!==p?(g=[o,u,l,d,c,h,p],t[25]=o,t[26]=u,t[27]=l,t[28]=d,t[29]=c,t[30]=h,t[31]=p,t[32]=g):g=t[32];const b=g;let x;return t[33]!==b||t[34]!==a?(x=a?b:[],t[33]=b,t[34]=a,t[35]=x):x=t[35],x}function th(t){const e=F.c(9),{navigationItems:n,footer:r,additionalContent:i,variant:s}=t,a=s===void 0?"sidebar":s;let o;e[0]!==n?(o=n.map(gN),e[0]=n,e[1]=o):o=e[1];let u;e[2]!==i||e[3]!==o?(u=m.jsx(eN,{className:"flex-1 overflow-x-hidden",children:m.jsx(tN,{className:"font-medium",children:m.jsx(nN,{children:m.jsxs(rN,{className:"gap-0.5",children:[o,i]})})})}),e[2]=i,e[3]=o,e[4]=u):u=e[4];let l;return e[5]!==r||e[6]!==u||e[7]!==a?(l=m.jsxs(XI,{variant:a,children:[u,r]}),e[5]=r,e[6]=u,e[7]=a,e[8]=l):l=e[8],l}function gN(t){return m.jsx(Kt,{children:m.jsxs(Xa,{className:"cursor-pointer",onClick:t.onClick,isActive:t.isActive,children:[m.jsx(fe,{name:t.icon,size:20,className:"text-muted-foreground/75"}),m.jsx("span",{className:"truncate",children:t.label})]})},t.key)}th.Skeleton=function(){return m.jsx("div",{className:"flex flex-col gap-0.5",children:Array.from({length:8}).map((e,n)=>m.jsx("div",{className:"w-full h-8",children:m.jsx(Ka,{className:"h-full bg-sidebar-accent rounded-md"})},n))})};function bN(){const t=F.c(4),e=mN();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=m.jsx(Rs,{children:m.jsx(P.Suspense,{fallback:null,children:m.jsx(uN,{})})}),t[0]=n):n=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsxs(m.Fragment,{children:[n,m.jsx(Rs,{children:m.jsx(P.Suspense,{fallback:null,children:m.jsx(pN,{})})})]}),t[1]=r):r=t[1];let i;return t[2]!==e?(i=m.jsx(th,{navigationItems:e,additionalContent:r}),t[2]=e,t[3]=i):i=t[3],i}const nh=P.createContext(null);function EN(){const t=P.useContext(nh);if(!t)throw new Error("TopbarSwitcher compound components must be used within TopbarSwitcher.Root");return t}function xN(t){const e=F.c(10),{children:n,onItemHover:r}=t,[i,s]=P.useState(null);let a;e[0]!==r?(a=c=>{s(c),r?.(c)},e[0]=r,e[1]=a):a=e[1];const o=a;let u;e[2]!==i||e[3]!==o?(u={hoveredItem:i,setHoveredItem:o},e[2]=i,e[3]=o,e[4]=u):u=e[4];let l;e[5]!==n?(l=m.jsx(Mp,{children:n}),e[5]=n,e[6]=l):l=e[6];let d;return e[7]!==u||e[8]!==l?(d=m.jsx(nh.Provider,{value:u,children:l}),e[7]=u,e[8]=l,e[9]=d):d=e[9],d}function TN(t){const e=F.c(6),{children:n,onClick:r}=t;let i;e[0]!==n||e[1]!==r?(i=m.jsx(ot,{variant:"link",className:"p-0.5 h-auto",onClick:r,type:"button",children:n}),e[0]=n,e[1]=r,e[2]=i):i=e[2];let s;e[3]===Symbol.for("react.memo_cache_sentinel")?(s=m.jsx(Bp,{asChild:!0,children:m.jsx(ot,{size:"icon",variant:"ghost",className:"w-6 h-6 p-0",children:m.jsx(fe,{name:"expand_all",size:16,className:"opacity-50"})})}),e[3]=s):s=e[3];let a;return e[4]!==i?(a=m.jsxs("div",{className:"flex items-center gap-1",children:[i,s]}),e[4]=i,e[5]=a):a=e[5],a}function _N(t){const e=F.c(8),{item:n,fallback:r}=t,i=r===void 0?"":r,s=n?.avatarUrl??"",a=n?.name??i;let o;e[0]!==s||e[1]!==a?(o=m.jsx(Fn,{url:s,fallback:a,size:"xs",objectFit:"contain"}),e[0]=s,e[1]=a,e[2]=o):o=e[2];const u=n?.name??i;let l;e[3]!==u?(l=m.jsx("span",{children:u}),e[3]=u,e[4]=l):l=e[4];let d;return e[5]!==o||e[6]!==l?(d=m.jsxs("div",{className:"flex items-center gap-2",children:[o,l]}),e[5]=o,e[6]=l,e[7]=d):d=e[7],d}function yN(t){const e=F.c(6),{children:n,align:r}=t,i=r===void 0?"start":r,a=P.Children.toArray(n).filter(kN).length===1?"280px":"480px";let o;e[0]!==a?(o={width:a},e[0]=a,e[1]=o):o=e[1];let u;return e[2]!==i||e[3]!==n||e[4]!==o?(u=m.jsx(Fp,{align:i,className:"p-0 flex items-start",style:o,children:n}),e[2]=i,e[3]=n,e[4]=o,e[5]=u):u=e[5],u}function kN(t){return P.isValidElement(t)&&(t.type===ih||t.type===rh)}function rh(t){const e=F.c(5),{children:n,className:r}=t;let i;e[0]!==r?(i=X("flex flex-col border-border w-[240px] border-r last:border-r-0 last:w-full",r),e[0]=r,e[1]=i):i=e[1];let s;return e[2]!==n||e[3]!==i?(s=m.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=s):s=e[4],s}const ih=rh;function AN(t){const e=F.c(6),{placeholder:n,value:r,onChange:i}=t,s=n===void 0?"Search...":n;let a;e[0]!==i?(a=u=>i(u.target.value),e[0]=i,e[1]=a):a=e[1];let o;return e[2]!==s||e[3]!==a||e[4]!==r?(o=m.jsx(Pp,{placeholder:s,value:r,onChange:a,className:"rounded-none border-t-0 border-x-0 focus-visible:border-border focus-visible:ring-0"}),e[2]=s,e[3]=a,e[4]=r,e[5]=o):o=e[5],o}function SN(t){const e=F.c(6),{children:n,emptyMessage:r}=t,i=r===void 0?"No items found.":r,s=P.Children.count(n)>0;let a;e[0]!==i||e[1]!==s?(a=!s&&m.jsx("div",{className:"text-muted-foreground text-sm px-1 py-8 text-center",children:i}),e[0]=i,e[1]=s,e[2]=a):a=e[2];let o;return e[3]!==n||e[4]!==a?(o=m.jsxs("div",{className:"flex flex-col gap-0.5 p-1 max-h-44 overflow-y-auto",children:[a,n]}),e[3]=n,e[4]=a,e[5]=o):o=e[5],o}function CN(t){const e=F.c(15),{item:n,onClick:r,onHover:i,children:s}=t,a=EN();let o;e[0]!==a||e[1]!==n||e[2]!==i?(o=()=>{a.setHoveredItem(n.slug),i?.(n)},e[0]=a,e[1]=n,e[2]=i,e[3]=o):o=e[3];const u=o;let l;e[4]!==n||e[5]!==r?(l=()=>r(n),e[4]=n,e[5]=r,e[6]=l):l=e[6];let d;e[7]!==s||e[8]!==n.avatarUrl||e[9]!==n.name?(d=s||m.jsxs(m.Fragment,{children:[m.jsx(Fn,{url:n.avatarUrl??"",fallback:n.name,size:"xs",className:"w-[22px]! h-[22px]!",objectFit:"contain"}),m.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:n.name})]}),e[7]=s,e[8]=n.avatarUrl,e[9]=n.name,e[10]=d):d=e[10];let c;return e[11]!==u||e[12]!==l||e[13]!==d?(c=m.jsx(ot,{onClick:l,onMouseEnter:u,variant:"ghost",size:"sm",className:"w-full justify-start font-normal",children:d}),e[11]=u,e[12]=l,e[13]=d,e[14]=c):c=e[14],c}function IN(t){const e=F.c(2),{children:n}=t;let r;return e[0]!==n?(r=m.jsx("div",{className:"px-1 pb-1 pt-0.5",children:n}),e[0]=n,e[1]=r):r=e[1],r}function NN(t){const e=F.c(11),{onClick:n,icon:r,children:i,variant:s}=t,o=(s===void 0?"default":s)==="muted"&&"text-muted-foreground";let u;e[0]!==o?(u=X("w-full justify-start font-normal",o),e[0]=o,e[1]=u):u=e[1];let l;e[2]!==r?(l=r&&m.jsx(fe,{name:r,size:16}),e[2]=r,e[3]=l):l=e[3];let d;e[4]!==i?(d=m.jsx("span",{children:i}),e[4]=i,e[5]=d):d=e[5];let c;return e[6]!==n||e[7]!==u||e[8]!==l||e[9]!==d?(c=m.jsxs(ot,{variant:"ghost",size:"sm",className:u,onClick:n,children:[l,d]}),e[6]=n,e[7]=u,e[8]=l,e[9]=d,e[10]=c):c=e[10],c}function wN(){const t=F.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=m.jsx(Qf,{}),t[0]=e):e=t[0],e}function vN(){const t=F.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=m.jsx("div",{className:"h-4 w-16 bg-accent rounded-full animate-pulse"}),t[0]=e):e=t[0],e}const it=Object.assign(xN,{Trigger:TN,CurrentItem:_N,Content:yN,Panel:ih,Search:AN,Items:SN,Item:CN,Actions:IN,Action:NN,Separator:wN,Skeleton:vN});function sa(){const t=F.c(56);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const{org:n}=xl(e),{data:r}=Rr.useListOrganizations(),i=vr();let s;t[1]!==n||t[2]!==r?(s=r?.find(j=>j.slug===n),t[1]=n,t[2]=r,t[3]=s):s=t[3];const a=s,[o,u]=P.useState(""),[l,d]=P.useState(!1);let c,h,p,g,b,x,E,k;if(t[4]!==a||t[5]!==i||t[6]!==n||t[7]!==o||t[8]!==r){const G=(r?(()=>{const ce=r.filter(N=>N.name.toLowerCase().includes(o.toLowerCase()));if(n){const N=ce.findIndex(Ee=>Ee.slug===n);if(N>0){const Ee=ce[N];Ee&&(ce.splice(N,1),ce.unshift(Ee))}}return ce})():[]).map(RN);let Y;t[17]!==a?(Y=a?{slug:a.slug,name:a.name,avatarUrl:a.logo}:void 0,t[17]=a,t[18]=Y):Y=t[18];const H=Y;g=it;let K;t[19]!==i||t[20]!==n?(K=()=>i({to:"/$org",params:{org:n??""}}),t[19]=i,t[20]=n,t[21]=K):K=t[21];let se;t[22]!==H?(se=m.jsx(it.CurrentItem,{item:H}),t[22]=H,t[23]=se):se=t[23],t[24]!==K||t[25]!==se?(k=m.jsx(it.Trigger,{onClick:K,children:se}),t[24]=K,t[25]=se,t[26]=k):k=t[26],p=it.Content,h=it.Panel,t[27]!==o?(E=m.jsx(it.Search,{placeholder:"Search organizations...",value:o,onChange:u}),t[27]=o,t[28]=E):E=t[28],c=it.Items,b="No organizations found.";let pe;t[29]!==i?(pe=ce=>m.jsx(it.Item,{item:ce,onClick:N=>i({to:"/$org",params:{org:N.slug}})},ce.slug),t[29]=i,t[30]=pe):pe=t[30],x=G.map(pe),t[4]=a,t[5]=i,t[6]=n,t[7]=o,t[8]=r,t[9]=c,t[10]=h,t[11]=p,t[12]=g,t[13]=b,t[14]=x,t[15]=E,t[16]=k}else c=t[9],h=t[10],p=t[11],g=t[12],b=t[13],x=t[14],E=t[15],k=t[16];let y;t[31]!==c||t[32]!==b||t[33]!==x?(y=m.jsx(c,{emptyMessage:b,children:x}),t[31]=c,t[32]=b,t[33]=x,t[34]=y):y=t[34];let _,R;t[35]===Symbol.for("react.memo_cache_sentinel")?(_=m.jsx(it.Actions,{children:m.jsx(it.Action,{onClick:()=>d(!0),variant:"muted",children:"+ Create organization"})}),R=m.jsx(it.Separator,{}),t[35]=_,t[36]=R):(_=t[35],R=t[36]);let S;t[37]!==i?(S=m.jsx(it.Actions,{children:m.jsx(it.Action,{onClick:()=>i({to:"/"}),icon:"grid_view",children:"See all organizations"})}),t[37]=i,t[38]=S):S=t[38];let w;t[39]!==h||t[40]!==E||t[41]!==y||t[42]!==S?(w=m.jsxs(h,{children:[E,y,_,R,S]}),t[39]=h,t[40]=E,t[41]=y,t[42]=S,t[43]=w):w=t[43];let O;t[44]!==p||t[45]!==w?(O=m.jsx(p,{children:w}),t[44]=p,t[45]=w,t[46]=O):O=t[46];let D;t[47]!==g||t[48]!==O||t[49]!==k?(D=m.jsxs(g,{children:[k,O]}),t[47]=g,t[48]=O,t[49]=k,t[50]=D):D=t[50];let v;t[51]!==l?(v=m.jsx(Dp,{open:l,onOpenChange:d}),t[51]=l,t[52]=v):v=t[52];let B;return t[53]!==D||t[54]!==v?(B=m.jsxs(m.Fragment,{children:[D,v]}),t[53]=D,t[54]=v,t[55]=B):B=t[55],B}function RN(t){return{slug:t.slug,name:t.name,avatarUrl:t.logo}}sa.Skeleton=it.Skeleton;const sh=P.createContext({setOpen:()=>{}}),ON=()=>P.useContext(sh),LN=t=>{const e=F.c(25);let n,r,i,s,a;e[0]!==t?({children:n,defaultOpen:r,open:s,onOpenChange:i,...a}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=s,e[5]=a):(n=e[1],r=e[2],i=e[3],s=e[4],a=e[5]);const o=r??!1;let u;e[6]!==i||e[7]!==s||e[8]!==o?(u={prop:s,defaultProp:o,onChange:i},e[6]=i,e[7]=s,e[8]=o,e[9]=u):u=e[9];const[l,d]=js(u);let c;e[10]!==d?(c={setOpen:d},e[10]=d,e[11]=c):c=e[11];let h;e[12]!==n||e[13]!==l||e[14]!==a||e[15]!==d?(h=m.jsx(Rc,{open:l,onOpenChange:d,...a,children:n}),e[12]=n,e[13]=l,e[14]=a,e[15]=d,e[16]=h):h=e[16];let p;e[17]!==l||e[18]!==a||e[19]!==d||e[20]!==h?(p=m.jsx(Up,{open:l,onOpenChange:d,...a,children:h}),e[17]=l,e[18]=a,e[19]=d,e[20]=h,e[21]=p):p=e[21];let g;return e[22]!==c||e[23]!==p?(g=m.jsx(sh.Provider,{value:c,children:p}),e[22]=c,e[23]=p,e[24]=g):g=e[24],g},DN=t=>{const{children:e,title:n,...r}=t,i=Bn(),{className:s,...a}=r;return i?m.jsxs(Lc,{...a,children:[m.jsx(Dc,{className:"hidden",children:m.jsx(Pc,{children:n})}),m.jsx("div",{className:X("flex flex-col gap-2 p-2 py-4",s),children:e})]}):m.jsx(jp,{...r,children:e})},PN=t=>{const{children:e,...n}=t,{setOpen:r}=ON(),i=Bn(),{className:s,...a}=n;return i?m.jsx("div",{...a,onClick:o=>{r(!1);const{onClick:u}=a;u?.(o)},className:X("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),children:e}):m.jsx(Hp,{...n,children:e})},MN=t=>{const e=F.c(7);let n,r;e[0]!==t?({children:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);const i=Bn();let s;return e[3]!==n||e[4]!==i||e[5]!==r?(s=i?m.jsx(Oc,{asChild:!0,children:n}):m.jsx(zp,{...r,children:n}),e[3]=n,e[4]=i,e[5]=r,e[6]=s):s=e[6],s},BN=t=>{const e=F.c(7);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);const i=Bn();let s;return e[3]!==n||e[4]!==i||e[5]!==r?(s=i?m.jsx(so,{className:X(n),...r}):m.jsx(so,{className:X(n),...r}),e[3]=n,e[4]=i,e[5]=r,e[6]=s):s=e[6],s};function FN(t){const e=F.c(11),{user:n,trigger:r,align:i,children:s}=t,a=i===void 0?"start":i;let o;e[0]!==r||e[1]!==n?(o=r(n),e[0]=r,e[1]=n,e[2]=o):o=e[2];let u;e[3]!==o?(u=m.jsx(MN,{asChild:!0,children:m.jsx("div",{children:o})}),e[3]=o,e[4]=u):u=e[4];let l;e[5]!==a||e[6]!==s?(l=m.jsx(DN,{side:"top",align:a,className:"md:w-[240px]",children:s}),e[5]=a,e[6]=s,e[7]=l):l=e[7];let d;return e[8]!==u||e[9]!==l?(d=m.jsxs(LN,{children:[u,l]}),e[8]=u,e[9]=l,e[10]=d):d=e[10],d}function zN(t){const e=F.c(8),{children:n,onClick:r,className:i,asChild:s}=t;let a;e[0]!==s||e[1]!==n||e[2]!==r?(a=s?n:m.jsx("button",{type:"button",className:"flex items-center gap-2 text-sm w-full cursor-pointer",onClick:r,children:n}),e[0]=s,e[1]=n,e[2]=r,e[3]=a):a=e[3];let o;return e[4]!==s||e[5]!==i||e[6]!==a?(o=m.jsx(PN,{asChild:s,className:i,children:a}),e[4]=s,e[5]=i,e[6]=a,e[7]=o):o=e[7],o}function jN(t){const e=F.c(2),{className:n}=t;let r;return e[0]!==n?(r=m.jsx(BN,{className:n}),e[0]=n,e[1]=r):r=e[1],r}function UN(){const t=F.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=m.jsx("div",{className:"w-8 h-8 bg-muted rounded-full animate-pulse"}),t[0]=e):e=t[0],e}const Ut=Object.assign(FN,{Item:zN,Separator:jN,Skeleton:UN});function HN(t){const e=F.c(33),{open:n,onOpenChange:r,user:i,userImage:s}=t,[a,o]=P.useState(!1);let u;e[0]!==i.id?(u=()=>{navigator.clipboard.writeText(i.id),o(!0),setTimeout(()=>o(!1),2e3)},e[0]=i.id,e[1]=u):u=e[1];const l=u;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=m.jsxs(Nl,{children:[m.jsx(wl,{children:"Profile"}),m.jsx(vl,{children:"Your account information"})]}),e[2]=d):d=e[2];const c=i.name||i.email||"U";let h;e[3]!==c||e[4]!==s?(h=m.jsx(Fn,{url:s,fallback:c,shape:"circle",size:"2xl"}),e[3]=c,e[4]=s,e[5]=h):h=e[5];const p=i.name||i.email;let g;e[6]!==p?(g=m.jsx("div",{className:"text-lg font-semibold text-center",children:p}),e[6]=p,e[7]=g):g=e[7];let b;e[8]!==i.email?(b=m.jsx("div",{className:"text-sm text-muted-foreground text-center",children:i.email}),e[8]=i.email,e[9]=b):b=e[9];let x;e[10]!==g||e[11]!==b?(x=m.jsxs("div",{className:"flex flex-col items-center gap-2 w-full",children:[g,b]}),e[10]=g,e[11]=b,e[12]=x):x=e[12];let E;e[13]===Symbol.for("react.memo_cache_sentinel")?(E=m.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"User ID"}),e[13]=E):E=e[13];let k;e[14]!==i.id?(k=m.jsxs("div",{className:"flex flex-col gap-1 min-w-0 flex-1",children:[E,m.jsx("span",{className:"text-sm font-mono truncate",children:i.id})]}),e[14]=i.id,e[15]=k):k=e[15];const y=a?"check":"content_copy",_=a?"text-green-600":"text-muted-foreground";let R;e[16]!==y||e[17]!==_?(R=m.jsx(fe,{name:y,size:16,className:_}),e[16]=y,e[17]=_,e[18]=R):R=e[18];let S;e[19]!==l||e[20]!==R?(S=m.jsx("button",{type:"button",onClick:l,className:"flex-shrink-0 p-2 hover:bg-background rounded-md transition-colors","aria-label":"Copy user ID",children:R}),e[19]=l,e[20]=R,e[21]=S):S=e[21];let w;e[22]!==k||e[23]!==S?(w=m.jsxs("div",{className:"flex items-center justify-between gap-3 w-full px-4 py-3 rounded-lg bg-muted/50 border border-border",children:[k,S]}),e[22]=k,e[23]=S,e[24]=w):w=e[24];let O;e[25]!==w||e[26]!==h||e[27]!==x?(O=m.jsxs(Rl,{className:"sm:max-w-md",children:[d,m.jsxs("div",{className:"flex flex-col items-center gap-6 py-4",children:[h,x,w]})]}),e[25]=w,e[26]=h,e[27]=x,e[28]=O):O=e[28];let D;return e[29]!==r||e[30]!==n||e[31]!==O?(D=m.jsx(Ol,{open:n,onOpenChange:r,children:O}),e[29]=r,e[30]=n,e[31]=O,e[32]=D):D=e[32],D}function $N(t){const e=F.c(5),{open:n,onOpenChange:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=m.jsxs(Nl,{children:[m.jsx(wl,{children:"Invitations"}),m.jsx(vl,{children:"Your pending organization invitations"})]}),e[0]=i):i=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=m.jsxs(Rl,{className:"sm:max-w-lg",children:[i,m.jsx("div",{className:"max-h-[420px] overflow-auto pr-1",children:m.jsx(fp,{})})]}),e[1]=s):s=e[1];let a;return e[2]!==r||e[3]!==n?(a=m.jsx(Ol,{open:n,onOpenChange:r,children:s}),e[2]=r,e[3]=n,e[4]=a):a=e[4],a}function ZN(t){const e=F.c(31),{user:n,userImage:r,hasInvites:i,showInvitesItem:s}=t,[a,o]=P.useState(!1),[u,l]=P.useState(!1);let d;e[0]!==i||e[1]!==n.email||e[2]!==n.name||e[3]!==r?(d=()=>m.jsxs("div",{className:"relative",children:[m.jsx(Fn,{url:r,fallback:n.name||n.email||"U",shape:"circle",size:"sm",className:"cursor-pointer hover:ring-2 ring-muted-foreground transition-all"}),i&&m.jsx("span",{className:"absolute -top-0.5 -right-0.5 h-2.5 w-2.5 rounded-full bg-destructive ring-2 ring-background"})]}),e[0]=i,e[1]=n.email,e[2]=n.name,e[3]=r,e[4]=d):d=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=m.jsxs(Ut.Item,{onClick:()=>o(!0),children:[m.jsx(fe,{name:"account_circle",className:"text-muted-foreground"}),"Profile"]}),e[5]=c):c=e[5];let h;e[6]!==i||e[7]!==s?(h=s&&m.jsxs(Ut.Item,{onClick:()=>l(!0),children:[m.jsx(fe,{name:"mail",className:"text-muted-foreground"}),"Invitations",i&&m.jsx("span",{className:"ml-auto h-2 w-2 rounded-full bg-destructive"})]}),e[6]=i,e[7]=s,e[8]=h):h=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=m.jsx(Ut.Separator,{}),e[9]=p):p=e[9];let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=m.jsx(dp,{className:"w-4 h-4 text-muted-foreground"}),e[10]=g):g=e[10];let b;e[11]===Symbol.for("react.memo_cache_sentinel")?(b=m.jsx(Ut.Item,{asChild:!0,children:m.jsxs("a",{href:"https://github.com/decocms/admin",target:"_blank",rel:"noopener noreferrer",className:"flex w-full items-center gap-2 text-sm cursor-pointer",children:[g,"decocms/admin",m.jsx(fe,{name:"arrow_outward",size:18,className:"text-muted-foreground ml-auto"})]})}),e[11]=b):b=e[11];let x;e[12]===Symbol.for("react.memo_cache_sentinel")?(x=m.jsx(fe,{name:"language",className:"text-muted-foreground"}),e[12]=x):x=e[12];let E,k;e[13]===Symbol.for("react.memo_cache_sentinel")?(E=m.jsx(Ut.Item,{asChild:!0,children:m.jsxs("a",{href:"https://decocms.com",target:"_blank",rel:"noopener noreferrer",className:"flex w-full items-center gap-2 text-sm cursor-pointer",children:[x,"Homepage",m.jsx(fe,{name:"arrow_outward",size:18,className:"ml-auto text-muted-foreground"})]})}),k=m.jsx(Ut.Separator,{}),e[13]=E,e[14]=k):(E=e[13],k=e[14]);let y;e[15]===Symbol.for("react.memo_cache_sentinel")?(y=m.jsxs(Ut.Item,{onClick:YN,children:[m.jsx(fe,{name:"logout",size:18,className:"text-muted-foreground"}),"Log out"]}),e[15]=y):y=e[15];let _;e[16]!==d||e[17]!==h||e[18]!==n?(_=m.jsxs(Ut,{user:n,trigger:d,align:"end",children:[c,h,p,b,E,k,y]}),e[16]=d,e[17]=h,e[18]=n,e[19]=_):_=e[19];let R;e[20]!==a||e[21]!==n||e[22]!==r?(R=a&&m.jsx(HN,{open:a,onOpenChange:o,user:n,userImage:r}),e[20]=a,e[21]=n,e[22]=r,e[23]=R):R=e[23];let S;e[24]!==u||e[25]!==s?(S=s&&u&&m.jsx($N,{open:u,onOpenChange:l}),e[24]=u,e[25]=s,e[26]=S):S=e[26];let w;return e[27]!==_||e[28]!==R||e[29]!==S?(w=m.jsxs(m.Fragment,{children:[_,R,S]}),e[27]=_,e[28]=R,e[29]=S,e[30]=w):w=e[30],w}function YN(){return Rr.signOut()}function qN(){const{data:t}=Rr.useSession(),e=P.useContext(cp),{data:n}=e.hooks.useListUserInvitations(),i=(n??[]).length>0;if(!t?.user)return m.jsx(Fn,{url:void 0,fallback:"U",shape:"circle",size:"sm",className:"cursor-pointer",muted:!0});const s=t.user,a={...s,name:s.name??void 0},o=s.image;return m.jsx(ZN,{user:a,userImage:o,hasInvites:i,showInvitesItem:!0})}function VN(t){const e=F.c(6),{children:n}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsx(hp,{children:m.jsx(Tl,{})}),e[0]=r):r=e[0];let i;e[1]!==n?(i=m.jsx(pp,{children:n}),e[1]=n,e[2]=i):i=e[2];let s;e[3]===Symbol.for("react.memo_cache_sentinel")?(s=m.jsx(mp,{children:m.jsx(gp,{to:"/login",replace:!0})}),e[3]=s):s=e[3];let a;return e[4]!==i?(a=m.jsxs(m.Fragment,{children:[r,i,s]}),e[4]=i,e[5]=a):a=e[5],a}function WN(t){const e=F.c(5),{children:n,className:r}=t;let i;e[0]!==r?(i=X("fixed top-0 left-0 right-0 z-20 bg-sidebar flex items-center justify-between w-full px-2.5 h-12 border-b border-border",r),e[0]=r,e[1]=i):i=e[1];let s;return e[2]!==n||e[3]!==i?(s=m.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=s):s=e[4],s}function GN(t){const e=F.c(5),{children:n,className:r}=t;let i;e[0]!==r?(i=X("flex items-center gap-2",r),e[0]=r,e[1]=i):i=e[1];let s;return e[2]!==n||e[3]!==i?(s=m.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=s):s=e[4],s}function KN(t){const e=F.c(5),{children:n,className:r}=t;let i;e[0]!==r?(i=X("flex items-center gap-2",r),e[0]=r,e[1]=i):i=e[1];let s;return e[2]!==n||e[3]!==i?(s=m.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=s):s=e[4],s}function QN(){const t=F.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("div",{className:"w-8 h-8 bg-muted rounded-md animate-pulse"}),m.jsx("div",{className:"w-32 h-6 bg-muted rounded-md animate-pulse"})]}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=m.jsxs("div",{className:"fixed top-0 left-0 right-0 z-20 bg-sidebar flex items-center justify-between w-full px-4 h-12 border-b border-border",children:[e,m.jsx("div",{className:"flex items-center gap-2",children:m.jsx("div",{className:"w-8 h-8 bg-muted rounded-full animate-pulse"})})]}),t[1]=n):n=t[1],n}const ks=Object.assign(WN,{Left:GN,Right:KN,Skeleton:QN});function XN(){const t=F.c(7);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=m.jsx("div",{className:"size-10 rounded-xl bg-muted animate-pulse"}),t[0]=e):e=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=m.jsxs("div",{className:"flex items-center gap-3",children:[e,m.jsxs("div",{className:"flex flex-col gap-2",children:[m.jsx("div",{className:"h-4 w-24 rounded bg-muted animate-pulse"}),m.jsx("div",{className:"h-3 w-32 rounded bg-muted/60 animate-pulse"})]})]}),t[1]=n):n=t[1];let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsx("div",{className:"flex-none border-b border-border/80 px-5 pb-4 pt-6",children:m.jsxs("div",{className:"flex items-start justify-between gap-3",children:[n,m.jsxs("div",{className:"flex flex-col items-end gap-2",children:[m.jsx("div",{className:"h-5 w-20 rounded-full bg-muted animate-pulse"}),m.jsx("div",{className:"h-8 w-48 rounded-lg bg-muted animate-pulse"})]})]})}),t[2]=r):r=t[2];let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=m.jsx("div",{className:"flex-1 overflow-hidden px-4 py-4",children:m.jsxs("div",{className:"mx-auto flex max-w-2xl flex-col gap-4",children:[m.jsx(Xr,{align:"right",width:"w-3/4"}),m.jsx(Xr,{align:"left",width:"w-full",lines:3}),m.jsx(Xr,{align:"right",width:"w-2/3"}),m.jsx(Xr,{align:"left",width:"w-5/6",lines:2})]})}),t[3]=i):i=t[3];let s;t[4]===Symbol.for("react.memo_cache_sentinel")?(s=m.jsx("div",{className:"relative flex flex-1 flex-col gap-2 p-2.5",children:m.jsx("div",{className:"relative flex-1",children:m.jsxs("div",{className:"space-y-2 p-2",children:[m.jsx("div",{className:"h-3 w-full rounded bg-muted/40 animate-pulse"}),m.jsx("div",{className:"h-3 w-4/5 rounded bg-muted/40 animate-pulse"})]})})}),t[4]=s):s=t[4];let a;t[5]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsx("div",{className:"flex items-center gap-1",children:m.jsx("div",{className:"size-8 rounded-full bg-muted/60 animate-pulse"})}),t[5]=a):a=t[5];let o;return t[6]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsxs("div",{className:"flex h-full w-full flex-col bg-sidebar",children:[r,i,m.jsx("div",{className:"flex-none border-t border-border/80 px-5 py-4",children:m.jsx("div",{className:"space-y-3",children:m.jsxs("div",{className:"relative flex min-h-[130px] flex-col rounded-xl border border-border bg-background shadow-sm",children:[s,m.jsxs("div",{className:"flex items-center justify-between px-2.5 pb-2.5",children:[a,m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx("div",{className:"h-8 w-32 rounded-lg bg-muted/60 animate-pulse"}),m.jsx("div",{className:"size-8 rounded-full bg-muted animate-pulse"})]})]})]})})})]}),t[6]=o):o=t[6],o}function Xr(t){const e=F.c(22),{align:n,width:r,lines:i}=t,s=r===void 0?"w-full":r,a=i===void 0?1:i,o=n==="right"?"flex-row-reverse":"flex-row";let u;e[0]!==o?(u=X("flex w-full gap-4 px-4 py-2",o),e[0]=o,e[1]=u):u=e[1];const l=n==="right"?"ml-auto max-w-3/4 items-end":"w-full items-start";let d;e[2]!==l?(d=X("flex min-w-0 flex-col gap-2",l),e[2]=l,e[3]=d):d=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=m.jsx("div",{className:"h-3 w-16 rounded bg-muted/40 animate-pulse"}),e[4]=c):c=e[4];const h=n==="right"?"bg-muted":"bg-transparent border border-border/40";let p;e[5]!==h||e[6]!==s?(p=X("min-w-0 rounded-2xl p-4",h,s),e[5]=h,e[6]=s,e[7]=p):p=e[7];let g;e[8]!==a?(g=Array.from({length:a}),e[8]=a,e[9]=g):g=e[9];let b;e[10]!==a||e[11]!==g?(b=m.jsx("div",{className:"space-y-2",children:g.map((y,_)=>m.jsx("div",{className:X("h-3 rounded bg-muted-foreground/20 animate-pulse",_===a-1?"w-3/4":"w-full"),style:{animationDelay:`${_*.1}s`}},_))}),e[10]=a,e[11]=g,e[12]=b):b=e[12];let x;e[13]!==b||e[14]!==p?(x=m.jsx("div",{className:p,children:b}),e[13]=b,e[14]=p,e[15]=x):x=e[15];let E;e[16]!==x||e[17]!==d?(E=m.jsxs("div",{className:d,children:[c,x]}),e[16]=x,e[17]=d,e[18]=E):E=e[18];let k;return e[19]!==E||e[20]!==u?(k=m.jsx("div",{className:u,children:E}),e[19]=E,e[20]=u,e[21]=k):k=e[21],k}const qi=P.createContext(null);qi.displayName="PanelGroupContext";const ze={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},Ja=10,cn=P.useLayoutEffect,il=bp.useId,JN=typeof il=="function"?il:()=>null;let e6=0;function eo(t=null){const e=JN(),n=P.useRef(t||e||null);return n.current===null&&(n.current=""+e6++),t??n.current}function ah({children:t,className:e="",collapsedSize:n,collapsible:r,defaultSize:i,forwardedRef:s,id:a,maxSize:o,minSize:u,onCollapse:l,onExpand:d,onResize:c,order:h,style:p,tagName:g="div",...b}){const x=P.useContext(qi);if(x===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:E,expandPanel:k,getPanelSize:y,getPanelStyle:_,groupId:R,isPanelCollapsed:S,reevaluatePanelConstraints:w,registerPanel:O,resizePanel:D,unregisterPanel:v}=x,B=eo(a),j=P.useRef({callbacks:{onCollapse:l,onExpand:d,onResize:c},constraints:{collapsedSize:n,collapsible:r,defaultSize:i,maxSize:o,minSize:u},id:B,idIsFromProps:a!==void 0,order:h});P.useRef({didLogMissingDefaultSizeWarning:!1}),cn(()=>{const{callbacks:Y,constraints:H}=j.current,K={...H};j.current.id=B,j.current.idIsFromProps=a!==void 0,j.current.order=h,Y.onCollapse=l,Y.onExpand=d,Y.onResize=c,H.collapsedSize=n,H.collapsible=r,H.defaultSize=i,H.maxSize=o,H.minSize=u,(K.collapsedSize!==H.collapsedSize||K.collapsible!==H.collapsible||K.maxSize!==H.maxSize||K.minSize!==H.minSize)&&w(j.current,K)}),cn(()=>{const Y=j.current;return O(Y),()=>{v(Y)}},[h,B,O,v]),P.useImperativeHandle(s,()=>({collapse:()=>{E(j.current)},expand:Y=>{k(j.current,Y)},getId(){return B},getSize(){return y(j.current)},isCollapsed(){return S(j.current)},isExpanded(){return!S(j.current)},resize:Y=>{D(j.current,Y)}}),[E,k,y,S,B,D]);const G=_(j.current,i);return P.createElement(g,{...b,children:t,className:e,id:B,style:{...G,...p},[ze.groupId]:R,[ze.panel]:"",[ze.panelCollapsible]:r||void 0,[ze.panelId]:B,[ze.panelSize]:parseFloat(""+G.flexGrow).toFixed(1)})}const oh=P.forwardRef((t,e)=>P.createElement(ah,{...t,forwardedRef:e}));ah.displayName="Panel";oh.displayName="forwardRef(Panel)";let aa=null,li=-1,Yt=null;function t6(t,e){if(e){const n=(e&fh)!==0,r=(e&hh)!==0,i=(e&ph)!==0,s=(e&mh)!==0;if(n)return i?"se-resize":s?"ne-resize":"e-resize";if(r)return i?"sw-resize":s?"nw-resize":"w-resize";if(i)return"s-resize";if(s)return"n-resize"}switch(t){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function n6(){Yt!==null&&(document.head.removeChild(Yt),aa=null,Yt=null,li=-1)}function As(t,e){var n,r;const i=t6(t,e);if(aa!==i){if(aa=i,Yt===null&&(Yt=document.createElement("style"),document.head.appendChild(Yt)),li>=0){var s;(s=Yt.sheet)===null||s===void 0||s.removeRule(li)}li=(n=(r=Yt.sheet)===null||r===void 0?void 0:r.insertRule(`*{cursor: ${i} !important;}`))!==null&&n!==void 0?n:-1}}function uh(t){return t.type==="keydown"}function lh(t){return t.type.startsWith("pointer")}function ch(t){return t.type.startsWith("mouse")}function Vi(t){if(lh(t)){if(t.isPrimary)return{x:t.clientX,y:t.clientY}}else if(ch(t))return{x:t.clientX,y:t.clientY};return{x:1/0,y:1/0}}function r6(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function i6(t,e,n){return t.x<e.x+e.width&&t.x+t.width>e.x&&t.y<e.y+e.height&&t.y+t.height>e.y}function s6(t,e){if(t===e)throw new Error("Cannot compare node with itself");const n={a:ol(t),b:ol(e)};let r;for(;n.a.at(-1)===n.b.at(-1);)t=n.a.pop(),e=n.b.pop(),r=t;de(r,"Stacking order can only be calculated for elements with a common ancestor");const i={a:al(sl(n.a)),b:al(sl(n.b))};if(i.a===i.b){const s=r.childNodes,a={a:n.a.at(-1),b:n.b.at(-1)};let o=s.length;for(;o--;){const u=s[o];if(u===a.a)return 1;if(u===a.b)return-1}}return Math.sign(i.a-i.b)}const a6=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function o6(t){var e;const n=getComputedStyle((e=dh(t))!==null&&e!==void 0?e:t).display;return n==="flex"||n==="inline-flex"}function u6(t){const e=getComputedStyle(t);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||o6(t))||+e.opacity<1||"transform"in e&&e.transform!=="none"||"webkitTransform"in e&&e.webkitTransform!=="none"||"mixBlendMode"in e&&e.mixBlendMode!=="normal"||"filter"in e&&e.filter!=="none"||"webkitFilter"in e&&e.webkitFilter!=="none"||"isolation"in e&&e.isolation==="isolate"||a6.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function sl(t){let e=t.length;for(;e--;){const n=t[e];if(de(n,"Missing node"),u6(n))return n}return null}function al(t){return t&&Number(getComputedStyle(t).zIndex)||0}function ol(t){const e=[];for(;t;)e.push(t),t=dh(t);return e}function dh(t){const{parentNode:e}=t;return e&&e instanceof ShadowRoot?e.host:e}const fh=1,hh=2,ph=4,mh=8,l6=r6()==="coarse";let kt=[],Rn=!1,sn=new Map,Wi=new Map;const Ir=new Set;function c6(t,e,n,r,i){var s;const{ownerDocument:a}=e,o={direction:n,element:e,hitAreaMargins:r,setResizeHandlerState:i},u=(s=sn.get(a))!==null&&s!==void 0?s:0;return sn.set(a,u+1),Ir.add(o),Ci(),function(){var d;Wi.delete(t),Ir.delete(o);const c=(d=sn.get(a))!==null&&d!==void 0?d:1;if(sn.set(a,c-1),Ci(),c===1&&sn.delete(a),kt.includes(o)){const h=kt.indexOf(o);h>=0&&kt.splice(h,1),no(),i("up",!0,null)}}}function d6(t){const{target:e}=t,{x:n,y:r}=Vi(t);Rn=!0,to({target:e,x:n,y:r}),Ci(),kt.length>0&&(Ii("down",t),t.preventDefault(),gh(e)||t.stopImmediatePropagation())}function Ss(t){const{x:e,y:n}=Vi(t);if(Rn&&t.buttons===0&&(Rn=!1,Ii("up",t)),!Rn){const{target:r}=t;to({target:r,x:e,y:n})}Ii("move",t),no(),kt.length>0&&t.preventDefault()}function Cs(t){const{target:e}=t,{x:n,y:r}=Vi(t);Wi.clear(),Rn=!1,kt.length>0&&(t.preventDefault(),gh(e)||t.stopImmediatePropagation()),Ii("up",t),to({target:e,x:n,y:r}),no(),Ci()}function gh(t){let e=t;for(;e;){if(e.hasAttribute(ze.resizeHandle))return!0;e=e.parentElement}return!1}function to({target:t,x:e,y:n}){kt.splice(0);let r=null;(t instanceof HTMLElement||t instanceof SVGElement)&&(r=t),Ir.forEach(i=>{const{element:s,hitAreaMargins:a}=i,o=s.getBoundingClientRect(),{bottom:u,left:l,right:d,top:c}=o,h=l6?a.coarse:a.fine;if(e>=l-h&&e<=d+h&&n>=c-h&&n<=u+h){if(r!==null&&document.contains(r)&&s!==r&&!s.contains(r)&&!r.contains(s)&&s6(r,s)>0){let g=r,b=!1;for(;g&&!g.contains(s);){if(i6(g.getBoundingClientRect(),o)){b=!0;break}g=g.parentElement}if(b)return}kt.push(i)}})}function Is(t,e){Wi.set(t,e)}function no(){let t=!1,e=!1;kt.forEach(r=>{const{direction:i}=r;i==="horizontal"?t=!0:e=!0});let n=0;Wi.forEach(r=>{n|=r}),t&&e?As("intersection",n):t?As("horizontal",n):e?As("vertical",n):n6()}let Ns=new AbortController;function Ci(){Ns.abort(),Ns=new AbortController;const t={capture:!0,signal:Ns.signal};Ir.size&&(Rn?(kt.length>0&&sn.forEach((e,n)=>{const{body:r}=n;e>0&&(r.addEventListener("contextmenu",Cs,t),r.addEventListener("pointerleave",Ss,t),r.addEventListener("pointermove",Ss,t))}),window.addEventListener("pointerup",Cs,t),window.addEventListener("pointercancel",Cs,t)):sn.forEach((e,n)=>{const{body:r}=n;e>0&&(r.addEventListener("pointerdown",d6,t),r.addEventListener("pointermove",Ss,t))}))}function Ii(t,e){Ir.forEach(n=>{const{setResizeHandlerState:r}=n,i=kt.includes(n);r(t,i,e)})}function f6(){const[t,e]=P.useState(0);return P.useCallback(()=>e(n=>n+1),[])}function de(t,e){if(!t)throw console.error(e),Error(e)}function pn(t,e,n=Ja){return t.toFixed(n)===e.toFixed(n)?0:t>e?1:-1}function Mt(t,e,n=Ja){return pn(t,e,n)===0}function ft(t,e,n){return pn(t,e,n)===0}function h6(t,e,n){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++){const i=t[r],s=e[r];if(!ft(i,s,n))return!1}return!0}function wn({panelConstraints:t,panelIndex:e,size:n}){const r=t[e];de(r!=null,`Panel constraints not found for index ${e}`);let{collapsedSize:i=0,collapsible:s,maxSize:a=100,minSize:o=0}=r;if(pn(n,o)<0)if(s){const u=(i+o)/2;pn(n,u)<0?n=i:n=o}else n=o;return n=Math.min(a,n),n=parseFloat(n.toFixed(Ja)),n}function ur({delta:t,initialLayout:e,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:s}){if(ft(t,0))return e;const a=[...e],[o,u]=r;de(o!=null,"Invalid first pivot index"),de(u!=null,"Invalid second pivot index");let l=0;if(s==="keyboard"){{const c=t<0?u:o,h=n[c];de(h,`Panel constraints not found for index ${c}`);const{collapsedSize:p=0,collapsible:g,minSize:b=0}=h;if(g){const x=e[c];if(de(x!=null,`Previous layout not found for panel index ${c}`),ft(x,p)){const E=b-x;pn(E,Math.abs(t))>0&&(t=t<0?0-E:E)}}}{const c=t<0?o:u,h=n[c];de(h,`No panel constraints found for index ${c}`);const{collapsedSize:p=0,collapsible:g,minSize:b=0}=h;if(g){const x=e[c];if(de(x!=null,`Previous layout not found for panel index ${c}`),ft(x,b)){const E=x-p;pn(E,Math.abs(t))>0&&(t=t<0?0-E:E)}}}}{const c=t<0?1:-1;let h=t<0?u:o,p=0;for(;;){const b=e[h];de(b!=null,`Previous layout not found for panel index ${h}`);const E=wn({panelConstraints:n,panelIndex:h,size:100})-b;if(p+=E,h+=c,h<0||h>=n.length)break}const g=Math.min(Math.abs(t),Math.abs(p));t=t<0?0-g:g}{let h=t<0?o:u;for(;h>=0&&h<n.length;){const p=Math.abs(t)-Math.abs(l),g=e[h];de(g!=null,`Previous layout not found for panel index ${h}`);const b=g-p,x=wn({panelConstraints:n,panelIndex:h,size:b});if(!ft(g,x)&&(l+=g-x,a[h]=x,l.toPrecision(3).localeCompare(Math.abs(t).toPrecision(3),void 0,{numeric:!0})>=0))break;t<0?h--:h++}}if(h6(i,a))return i;{const c=t<0?u:o,h=e[c];de(h!=null,`Previous layout not found for panel index ${c}`);const p=h+l,g=wn({panelConstraints:n,panelIndex:c,size:p});if(a[c]=g,!ft(g,p)){let b=p-g,E=t<0?u:o;for(;E>=0&&E<n.length;){const k=a[E];de(k!=null,`Previous layout not found for panel index ${E}`);const y=k+b,_=wn({panelConstraints:n,panelIndex:E,size:y});if(ft(k,_)||(b-=_-k,a[E]=_),ft(b,0))break;t>0?E--:E++}}}const d=a.reduce((c,h)=>h+c,0);return ft(d,100)?a:i}function p6({layout:t,panelsArray:e,pivotIndices:n}){let r=0,i=100,s=0,a=0;const o=n[0];de(o!=null,"No pivot index found"),e.forEach((c,h)=>{const{constraints:p}=c,{maxSize:g=100,minSize:b=0}=p;h===o?(r=b,i=g):(s+=b,a+=g)});const u=Math.min(i,100-s),l=Math.max(r,100-a),d=t[o];return{valueMax:u,valueMin:l,valueNow:d}}function Nr(t,e=document){return Array.from(e.querySelectorAll(`[${ze.resizeHandleId}][data-panel-group-id="${t}"]`))}function bh(t,e,n=document){const i=Nr(t,n).findIndex(s=>s.getAttribute(ze.resizeHandleId)===e);return i??null}function Eh(t,e,n){const r=bh(t,e,n);return r!=null?[r,r+1]:[-1,-1]}function xh(t,e=document){var n;if(e instanceof HTMLElement&&(e==null||(n=e.dataset)===null||n===void 0?void 0:n.panelGroupId)==t)return e;const r=e.querySelector(`[data-panel-group][data-panel-group-id="${t}"]`);return r||null}function Gi(t,e=document){const n=e.querySelector(`[${ze.resizeHandleId}="${t}"]`);return n||null}function m6(t,e,n,r=document){var i,s,a,o;const u=Gi(e,r),l=Nr(t,r),d=u?l.indexOf(u):-1,c=(i=(s=n[d])===null||s===void 0?void 0:s.id)!==null&&i!==void 0?i:null,h=(a=(o=n[d+1])===null||o===void 0?void 0:o.id)!==null&&a!==void 0?a:null;return[c,h]}function g6({committedValuesRef:t,eagerValuesRef:e,groupId:n,layout:r,panelDataArray:i,panelGroupElement:s,setLayout:a}){P.useRef({didWarnAboutMissingResizeHandle:!1}),cn(()=>{if(!s)return;const o=Nr(n,s);for(let u=0;u<i.length-1;u++){const{valueMax:l,valueMin:d,valueNow:c}=p6({layout:r,panelsArray:i,pivotIndices:[u,u+1]}),h=o[u];if(h!=null){const p=i[u];de(p,`No panel data found for index "${u}"`),h.setAttribute("aria-controls",p.id),h.setAttribute("aria-valuemax",""+Math.round(l)),h.setAttribute("aria-valuemin",""+Math.round(d)),h.setAttribute("aria-valuenow",c!=null?""+Math.round(c):"")}}return()=>{o.forEach((u,l)=>{u.removeAttribute("aria-controls"),u.removeAttribute("aria-valuemax"),u.removeAttribute("aria-valuemin"),u.removeAttribute("aria-valuenow")})}},[n,r,i,s]),P.useEffect(()=>{if(!s)return;const o=e.current;de(o,"Eager values not found");const{panelDataArray:u}=o,l=xh(n,s);de(l!=null,`No group found for id "${n}"`);const d=Nr(n,s);de(d,`No resize handles found for group id "${n}"`);const c=d.map(h=>{const p=h.getAttribute(ze.resizeHandleId);de(p,"Resize handle element has no handle id attribute");const[g,b]=m6(n,p,u,s);if(g==null||b==null)return()=>{};const x=E=>{if(!E.defaultPrevented)switch(E.key){case"Enter":{E.preventDefault();const k=u.findIndex(y=>y.id===g);if(k>=0){const y=u[k];de(y,`No panel data found for index ${k}`);const _=r[k],{collapsedSize:R=0,collapsible:S,minSize:w=0}=y.constraints;if(_!=null&&S){const O=ur({delta:ft(_,R)?w-R:R-_,initialLayout:r,panelConstraints:u.map(D=>D.constraints),pivotIndices:Eh(n,p,s),prevLayout:r,trigger:"keyboard"});r!==O&&a(O)}}break}}};return h.addEventListener("keydown",x),()=>{h.removeEventListener("keydown",x)}});return()=>{c.forEach(h=>h())}},[s,t,e,n,r,i,a])}function ul(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function Th(t,e){const n=t==="horizontal",{x:r,y:i}=Vi(e);return n?r:i}function b6(t,e,n,r,i){const s=n==="horizontal",a=Gi(e,i);de(a,`No resize handle element found for id "${e}"`);const o=a.getAttribute(ze.groupId);de(o,"Resize handle element has no group id attribute");let{initialCursorPosition:u}=r;const l=Th(n,t),d=xh(o,i);de(d,`No group element found for id "${o}"`);const c=d.getBoundingClientRect(),h=s?c.width:c.height;return(l-u)/h*100}function E6(t,e,n,r,i,s){if(uh(t)){const a=n==="horizontal";let o=0;t.shiftKey?o=100:i!=null?o=i:o=10;let u=0;switch(t.key){case"ArrowDown":u=a?0:o;break;case"ArrowLeft":u=a?-o:0;break;case"ArrowRight":u=a?o:0;break;case"ArrowUp":u=a?0:-o;break;case"End":u=100;break;case"Home":u=-100;break}return u}else return r==null?0:b6(t,e,n,r,s)}function x6({panelDataArray:t}){const e=Array(t.length),n=t.map(s=>s.constraints);let r=0,i=100;for(let s=0;s<t.length;s++){const a=n[s];de(a,`Panel constraints not found for index ${s}`);const{defaultSize:o}=a;o!=null&&(r++,e[s]=o,i-=o)}for(let s=0;s<t.length;s++){const a=n[s];de(a,`Panel constraints not found for index ${s}`);const{defaultSize:o}=a;if(o!=null)continue;const u=t.length-r,l=i/u;r++,e[s]=l,i-=l}return e}function kn(t,e,n){e.forEach((r,i)=>{const s=t[i];de(s,`Panel data not found for index ${i}`);const{callbacks:a,constraints:o,id:u}=s,{collapsedSize:l=0,collapsible:d}=o,c=n[u];if(c==null||r!==c){n[u]=r;const{onCollapse:h,onExpand:p,onResize:g}=a;g&&g(r,c),d&&(h||p)&&(p&&(c==null||Mt(c,l))&&!Mt(r,l)&&p(),h&&(c==null||!Mt(c,l))&&Mt(r,l)&&h())}})}function Jr(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n])return!1;return!0}function T6({defaultSize:t,dragState:e,layout:n,panelData:r,panelIndex:i,precision:s=3}){const a=n[i];let o;return a==null?o=t!=null?t.toPrecision(s):"1":r.length===1?o="1":o=a.toPrecision(s),{flexBasis:0,flexGrow:o,flexShrink:1,overflow:"hidden",pointerEvents:e!==null?"none":void 0}}function _6(t,e=10){let n=null;return(...i)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{t(...i)},e)}}function ll(t){try{if(typeof localStorage<"u")t.getItem=e=>localStorage.getItem(e),t.setItem=(e,n)=>{localStorage.setItem(e,n)};else throw new Error("localStorage not supported in this environment")}catch(e){console.error(e),t.getItem=()=>null,t.setItem=()=>{}}}function _h(t){return`react-resizable-panels:${t}`}function yh(t){return t.map(e=>{const{constraints:n,id:r,idIsFromProps:i,order:s}=e;return i?r:s?`${s}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((e,n)=>e.localeCompare(n)).join(",")}function kh(t,e){try{const n=_h(t),r=e.getItem(n);if(r){const i=JSON.parse(r);if(typeof i=="object"&&i!=null)return i}}catch{}return null}function y6(t,e,n){var r,i;const s=(r=kh(t,n))!==null&&r!==void 0?r:{},a=yh(e);return(i=s[a])!==null&&i!==void 0?i:null}function k6(t,e,n,r,i){var s;const a=_h(t),o=yh(e),u=(s=kh(t,i))!==null&&s!==void 0?s:{};u[o]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{i.setItem(a,JSON.stringify(u))}catch(l){console.error(l)}}function cl({layout:t,panelConstraints:e}){const n=[...t],r=n.reduce((s,a)=>s+a,0);if(n.length!==e.length)throw Error(`Invalid ${e.length} panel layout: ${n.map(s=>`${s}%`).join(", ")}`);if(!ft(r,100)&&n.length>0)for(let s=0;s<e.length;s++){const a=n[s];de(a!=null,`No layout data found for index ${s}`);const o=100/r*a;n[s]=o}let i=0;for(let s=0;s<e.length;s++){const a=n[s];de(a!=null,`No layout data found for index ${s}`);const o=wn({panelConstraints:e,panelIndex:s,size:a});a!=o&&(i+=a-o,n[s]=o)}if(!ft(i,0))for(let s=0;s<e.length;s++){const a=n[s];de(a!=null,`No layout data found for index ${s}`);const o=a+i,u=wn({panelConstraints:e,panelIndex:s,size:o});if(a!==u&&(i-=u-a,n[s]=u,ft(i,0)))break}return n}const A6=100,lr={getItem:t=>(ll(lr),lr.getItem(t)),setItem:(t,e)=>{ll(lr),lr.setItem(t,e)}},dl={};function Ah({autoSaveId:t=null,children:e,className:n="",direction:r,forwardedRef:i,id:s=null,onLayout:a=null,keyboardResizeBy:o=null,storage:u=lr,style:l,tagName:d="div",...c}){const h=eo(s),p=P.useRef(null),[g,b]=P.useState(null),[x,E]=P.useState([]),k=f6(),y=P.useRef({}),_=P.useRef(new Map),R=P.useRef(0),S=P.useRef({autoSaveId:t,direction:r,dragState:g,id:h,keyboardResizeBy:o,onLayout:a,storage:u}),w=P.useRef({layout:x,panelDataArray:[],panelDataArrayChanged:!1});P.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),P.useImperativeHandle(i,()=>({getId:()=>S.current.id,getLayout:()=>{const{layout:T}=w.current;return T},setLayout:T=>{const{onLayout:V}=S.current,{layout:te,panelDataArray:Q}=w.current,J=cl({layout:T,panelConstraints:Q.map(ne=>ne.constraints)});ul(te,J)||(E(J),w.current.layout=J,V&&V(J),kn(Q,J,y.current))}}),[]),cn(()=>{S.current.autoSaveId=t,S.current.direction=r,S.current.dragState=g,S.current.id=h,S.current.onLayout=a,S.current.storage=u}),g6({committedValuesRef:S,eagerValuesRef:w,groupId:h,layout:x,panelDataArray:w.current.panelDataArray,setLayout:E,panelGroupElement:p.current}),P.useEffect(()=>{const{panelDataArray:T}=w.current;if(t){if(x.length===0||x.length!==T.length)return;let V=dl[t];V==null&&(V=_6(k6,A6),dl[t]=V);const te=[...T],Q=new Map(_.current);V(t,te,Q,x,u)}},[t,x,u]),P.useEffect(()=>{});const O=P.useCallback(T=>{const{onLayout:V}=S.current,{layout:te,panelDataArray:Q}=w.current;if(T.constraints.collapsible){const J=Q.map(Re=>Re.constraints),{collapsedSize:ne=0,panelSize:ae,pivotIndices:ge}=nn(Q,T,te);if(de(ae!=null,`Panel size not found for panel "${T.id}"`),!Mt(ae,ne)){_.current.set(T.id,ae);const Me=In(Q,T)===Q.length-1?ae-ne:ne-ae,ye=ur({delta:Me,initialLayout:te,panelConstraints:J,pivotIndices:ge,prevLayout:te,trigger:"imperative-api"});Jr(te,ye)||(E(ye),w.current.layout=ye,V&&V(ye),kn(Q,ye,y.current))}}},[]),D=P.useCallback((T,V)=>{const{onLayout:te}=S.current,{layout:Q,panelDataArray:J}=w.current;if(T.constraints.collapsible){const ne=J.map(Ye=>Ye.constraints),{collapsedSize:ae=0,panelSize:ge=0,minSize:Re=0,pivotIndices:Me}=nn(J,T,Q),ye=V??Re;if(Mt(ge,ae)){const Ye=_.current.get(T.id),$e=Ye!=null&&Ye>=ye?Ye:ye,En=In(J,T)===J.length-1?ge-$e:$e-ge,Ge=ur({delta:En,initialLayout:Q,panelConstraints:ne,pivotIndices:Me,prevLayout:Q,trigger:"imperative-api"});Jr(Q,Ge)||(E(Ge),w.current.layout=Ge,te&&te(Ge),kn(J,Ge,y.current))}}},[]),v=P.useCallback(T=>{const{layout:V,panelDataArray:te}=w.current,{panelSize:Q}=nn(te,T,V);return de(Q!=null,`Panel size not found for panel "${T.id}"`),Q},[]),B=P.useCallback((T,V)=>{const{panelDataArray:te}=w.current,Q=In(te,T);return T6({defaultSize:V,dragState:g,layout:x,panelData:te,panelIndex:Q})},[g,x]),j=P.useCallback(T=>{const{layout:V,panelDataArray:te}=w.current,{collapsedSize:Q=0,collapsible:J,panelSize:ne}=nn(te,T,V);return de(ne!=null,`Panel size not found for panel "${T.id}"`),J===!0&&Mt(ne,Q)},[]),G=P.useCallback(T=>{const{layout:V,panelDataArray:te}=w.current,{collapsedSize:Q=0,collapsible:J,panelSize:ne}=nn(te,T,V);return de(ne!=null,`Panel size not found for panel "${T.id}"`),!J||pn(ne,Q)>0},[]),Y=P.useCallback(T=>{const{panelDataArray:V}=w.current;V.push(T),V.sort((te,Q)=>{const J=te.order,ne=Q.order;return J==null&&ne==null?0:J==null?-1:ne==null?1:J-ne}),w.current.panelDataArrayChanged=!0,k()},[k]);cn(()=>{if(w.current.panelDataArrayChanged){w.current.panelDataArrayChanged=!1;const{autoSaveId:T,onLayout:V,storage:te}=S.current,{layout:Q,panelDataArray:J}=w.current;let ne=null;if(T){const ge=y6(T,J,te);ge&&(_.current=new Map(Object.entries(ge.expandToSizes)),ne=ge.layout)}ne==null&&(ne=x6({panelDataArray:J}));const ae=cl({layout:ne,panelConstraints:J.map(ge=>ge.constraints)});ul(Q,ae)||(E(ae),w.current.layout=ae,V&&V(ae),kn(J,ae,y.current))}}),cn(()=>{const T=w.current;return()=>{T.layout=[]}},[]);const H=P.useCallback(T=>{let V=!1;const te=p.current;return te&&window.getComputedStyle(te,null).getPropertyValue("direction")==="rtl"&&(V=!0),function(J){J.preventDefault();const ne=p.current;if(!ne)return()=>null;const{direction:ae,dragState:ge,id:Re,keyboardResizeBy:Me,onLayout:ye}=S.current,{layout:Ye,panelDataArray:$e}=w.current,{initialLayout:Qt}=ge??{},En=Eh(Re,T,ne);let Ge=E6(J,T,ae,ge,Me,ne);const Yn=ae==="horizontal";Yn&&V&&(Ge=-Ge);const Hr=$e.map(Ki=>Ki.constraints),Xt=ur({delta:Ge,initialLayout:Qt??Ye,panelConstraints:Hr,pivotIndices:En,prevLayout:Ye,trigger:uh(J)?"keyboard":"mouse-or-touch"}),$r=!Jr(Ye,Xt);(lh(J)||ch(J))&&R.current!=Ge&&(R.current=Ge,!$r&&Ge!==0?Yn?Is(T,Ge<0?fh:hh):Is(T,Ge<0?ph:mh):Is(T,0)),$r&&(E(Xt),w.current.layout=Xt,ye&&ye(Xt),kn($e,Xt,y.current))}},[]),K=P.useCallback((T,V)=>{const{onLayout:te}=S.current,{layout:Q,panelDataArray:J}=w.current,ne=J.map(Ye=>Ye.constraints),{panelSize:ae,pivotIndices:ge}=nn(J,T,Q);de(ae!=null,`Panel size not found for panel "${T.id}"`);const Me=In(J,T)===J.length-1?ae-V:V-ae,ye=ur({delta:Me,initialLayout:Q,panelConstraints:ne,pivotIndices:ge,prevLayout:Q,trigger:"imperative-api"});Jr(Q,ye)||(E(ye),w.current.layout=ye,te&&te(ye),kn(J,ye,y.current))},[]),se=P.useCallback((T,V)=>{const{layout:te,panelDataArray:Q}=w.current,{collapsedSize:J=0,collapsible:ne}=V,{collapsedSize:ae=0,collapsible:ge,maxSize:Re=100,minSize:Me=0}=T.constraints,{panelSize:ye}=nn(Q,T,te);ye!=null&&(ne&&ge&&Mt(ye,J)?Mt(J,ae)||K(T,ae):ye<Me?K(T,Me):ye>Re&&K(T,Re))},[K]),pe=P.useCallback((T,V)=>{const{direction:te}=S.current,{layout:Q}=w.current;if(!p.current)return;const J=Gi(T,p.current);de(J,`Drag handle element not found for id "${T}"`);const ne=Th(te,V);b({dragHandleId:T,dragHandleRect:J.getBoundingClientRect(),initialCursorPosition:ne,initialLayout:Q})},[]),ce=P.useCallback(()=>{b(null)},[]),N=P.useCallback(T=>{const{panelDataArray:V}=w.current,te=In(V,T);te>=0&&(V.splice(te,1),delete y.current[T.id],w.current.panelDataArrayChanged=!0,k())},[k]),Ee=P.useMemo(()=>({collapsePanel:O,direction:r,dragState:g,expandPanel:D,getPanelSize:v,getPanelStyle:B,groupId:h,isPanelCollapsed:j,isPanelExpanded:G,reevaluatePanelConstraints:se,registerPanel:Y,registerResizeHandle:H,resizePanel:K,startDragging:pe,stopDragging:ce,unregisterPanel:N,panelGroupElement:p.current}),[O,g,r,D,v,B,h,j,G,se,Y,H,K,pe,ce,N]),xe={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return P.createElement(qi.Provider,{value:Ee},P.createElement(d,{...c,children:e,className:n,id:s,ref:p,style:{...xe,...l},[ze.group]:"",[ze.groupDirection]:r,[ze.groupId]:h}))}const Sh=P.forwardRef((t,e)=>P.createElement(Ah,{...t,forwardedRef:e}));Ah.displayName="PanelGroup";Sh.displayName="forwardRef(PanelGroup)";function In(t,e){return t.findIndex(n=>n===e||n.id===e.id)}function nn(t,e,n){const r=In(t,e),s=r===t.length-1?[r-1,r]:[r,r+1],a=n[r];return{...e.constraints,panelSize:a,pivotIndices:s}}function S6({disabled:t,handleId:e,resizeHandler:n,panelGroupElement:r}){P.useEffect(()=>{if(t||n==null||r==null)return;const i=Gi(e,r);if(i==null)return;const s=a=>{if(!a.defaultPrevented)switch(a.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{a.preventDefault(),n(a);break}case"F6":{a.preventDefault();const o=i.getAttribute(ze.groupId);de(o,`No group element found for id "${o}"`);const u=Nr(o,r),l=bh(o,e,r);de(l!==null,`No resize element found for id "${e}"`);const d=a.shiftKey?l>0?l-1:u.length-1:l+1<u.length?l+1:0;u[d].focus();break}}};return i.addEventListener("keydown",s),()=>{i.removeEventListener("keydown",s)}},[r,t,e,n])}function Ch({children:t=null,className:e="",disabled:n=!1,hitAreaMargins:r,id:i,onBlur:s,onClick:a,onDragging:o,onFocus:u,onPointerDown:l,onPointerUp:d,style:c={},tabIndex:h=0,tagName:p="div",...g}){var b,x;const E=P.useRef(null),k=P.useRef({onClick:a,onDragging:o,onPointerDown:l,onPointerUp:d});P.useEffect(()=>{k.current.onClick=a,k.current.onDragging=o,k.current.onPointerDown=l,k.current.onPointerUp=d});const y=P.useContext(qi);if(y===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:_,groupId:R,registerResizeHandle:S,startDragging:w,stopDragging:O,panelGroupElement:D}=y,v=eo(i),[B,j]=P.useState("inactive"),[G,Y]=P.useState(!1),[H,K]=P.useState(null),se=P.useRef({state:B});cn(()=>{se.current.state=B}),P.useEffect(()=>{if(n)K(null);else{const Ee=S(v);K(()=>Ee)}},[n,v,S]);const pe=(b=r?.coarse)!==null&&b!==void 0?b:15,ce=(x=r?.fine)!==null&&x!==void 0?x:5;P.useEffect(()=>{if(n||H==null)return;const Ee=E.current;de(Ee,"Element ref not attached");let xe=!1;return c6(v,Ee,_,{coarse:pe,fine:ce},(V,te,Q)=>{if(!te){j("inactive");return}switch(V){case"down":{j("drag"),xe=!1,de(Q,'Expected event to be defined for "down" action'),w(v,Q);const{onDragging:J,onPointerDown:ne}=k.current;J?.(!0),ne?.();break}case"move":{const{state:J}=se.current;xe=!0,J!=="drag"&&j("hover"),de(Q,'Expected event to be defined for "move" action'),H(Q);break}case"up":{j("hover"),O();const{onClick:J,onDragging:ne,onPointerUp:ae}=k.current;ne?.(!1),ae?.(),xe||J?.();break}}})},[pe,_,n,ce,S,v,H,w,O]),S6({disabled:n,handleId:v,resizeHandler:H,panelGroupElement:D});const N={touchAction:"none",userSelect:"none"};return P.createElement(p,{...g,children:t,className:e,id:i,onBlur:()=>{Y(!1),s?.()},onFocus:()=>{Y(!0),u?.()},ref:E,role:"separator",style:{...N,...c},tabIndex:h,[ze.groupDirection]:_,[ze.groupId]:R,[ze.resizeHandle]:"",[ze.resizeHandleActive]:B==="drag"?"pointer":G?"keyboard":void 0,[ze.resizeHandleEnabled]:!n,[ze.resizeHandleId]:v,[ze.resizeHandleState]:B})}Ch.displayName="PanelResizeHandle";function C6(t){const e=F.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=X("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=m.jsx(Sh,{"data-slot":"resizable-panel-group",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function Ih(t){const e=F.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(oh,{"data-slot":"resizable-panel",...n}),e[2]=n,e[3]=r):r=e[3],r}function I6(t){const e=F.c(12);let n,r,i;e[0]!==t?({withHandle:i,className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i):(n=e[1],r=e[2],i=e[3]);let s;e[4]!==n?(s=X("bg-border focus-visible:ring-ring relative flex w-[0.5px] items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",n),e[4]=n,e[5]=s):s=e[5];let a;e[6]!==i?(a=i&&m.jsx("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:m.jsx(bE,{className:"size-2.5"})}),e[6]=i,e[7]=a):a=e[7];let o;return e[8]!==r||e[9]!==s||e[10]!==a?(o=m.jsx(Ch,{"data-slot":"resizable-handle",className:s,...r,children:a}),e[8]=r,e[9]=s,e[10]=a,e[11]=o):o=e[11],o}function Nh(){const t=F.c(6),{toggleSidebar:e}=Qa();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=m.jsx(fe,{name:"dock_to_right",className:"text-muted-foreground",size:20}),t[0]=n):n=t[0];let r;t[1]!==e?(r=m.jsx(ot,{onClick:e,size:"icon",variant:"ghost",className:"w-8 h-8 rounded-md",children:n}),t[1]=e,t[2]=r):r=t[2];let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=m.jsx("div",{className:"h-8 w-px bg-border"}),t[3]=i):i=t[3];let s;return t[4]!==r?(s=m.jsxs(m.Fragment,{children:[r,i]}),t[4]=r,t[5]=s):s=t[5],s}Nh.Skeleton=function(){return m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"w-8 h-8 bg-muted rounded-md animate-pulse"}),m.jsx("div",{className:"h-8 w-px bg-border"})]})};const N6="https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png";function fl(t){const e=F.c(18),{showSidebarToggle:n,showOrgSwitcher:r,showDecoChat:i}=t,s=n===void 0?!1:n,a=r===void 0?!1:r,o=i===void 0?!1:i,[,u]=wi();let l;e[0]!==u?(l=()=>u(w6),e[0]=u,e[1]=l):l=e[1];const d=l;let c;e[2]!==s?(c=s&&m.jsx(Nh,{}),e[2]=s,e[3]=c):c=e[3];let h;e[4]!==a?(h=a&&m.jsx(P.Suspense,{fallback:m.jsx(sa.Skeleton,{}),children:m.jsx(sa,{})}),e[4]=a,e[5]=h):h=e[5];let p;e[6]!==c||e[7]!==h?(p=m.jsxs(ks.Left,{children:[c,h]}),e[6]=c,e[7]=h,e[8]=p):p=e[8];let g;e[9]!==o||e[10]!==d?(g=o&&m.jsxs(ot,{size:"sm",variant:"default",onClick:d,children:[m.jsx(Fn,{url:N6,fallback:"DC",size:"2xs",className:"rounded-sm"}),"deco chat"]}),e[9]=o,e[10]=d,e[11]=g):g=e[11];let b;e[12]===Symbol.for("react.memo_cache_sentinel")?(b=m.jsx(qN,{}),e[12]=b):b=e[12];let x;e[13]!==g?(x=m.jsxs(ks.Right,{className:"gap-2",children:[g,b]}),e[13]=g,e[14]=x):x=e[14];let E;return e[15]!==x||e[16]!==p?(E=m.jsxs(ks,{children:[p,x]}),e[15]=x,e[16]=p,e[17]=E):E=e[17],E}function w6(t){return!t}function v6(t){const e=F.c(10),{children:n,className:r}=t,[,i]=P.useTransition();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=Or.decoChatPanelWidth(),e[0]=s):s=e[0];const[a,o]=On(s,30);let u;e[1]!==o?(u=h=>i(()=>o(h)),e[1]=o,e[2]=u):u=e[2];const l=u;let d;e[3]!==r?(d=X("min-w-0",r),e[3]=r,e[4]=d):d=e[4];let c;return e[5]!==a||e[6]!==n||e[7]!==l||e[8]!==d?(c=m.jsx(Ih,{defaultSize:a,minSize:20,className:d,onResize:l,children:n}),e[5]=a,e[6]=n,e[7]=l,e[8]=d,e[9]=c):c=e[9],c}function R6(t){const e=F.c(5),{children:n}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=Or.sidebarOpen(),e[0]=r):r=e[0];const[i,s]=On(r,!0);let a;return e[1]!==n||e[2]!==s||e[3]!==i?(a=m.jsx(WI,{open:i,onOpenChange:s,children:n}),e[1]=n,e[2]=s,e[3]=i,e[4]=a):a=e[4],a}function O6(){const t=F.c(9),[e]=wi();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=m.jsx(Ih,{className:"bg-background",children:m.jsx(_l,{})}),t[0]=n):n=t[0];let r;t[1]!==e?(r=m.jsx(I6,{withHandle:e}),t[1]=e,t[2]=r):r=t[2];const i=e?"max-w-none":"max-w-0";let s;t[3]===Symbol.for("react.memo_cache_sentinel")?(s=m.jsx(Rs,{children:m.jsx(P.Suspense,{fallback:m.jsx(XN,{}),children:m.jsx(DI,{})})}),t[3]=s):s=t[3];let a;t[4]!==i?(a=m.jsx(v6,{className:i,children:s}),t[4]=i,t[5]=a):a=t[5];let o;return t[6]!==r||t[7]!==a?(o=m.jsxs(C6,{direction:"horizontal",children:[n,r,a]}),t[6]=r,t[7]=a,t[8]=o):o=t[8],o}function L6(){const t=F.c(19);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const{org:n}=xl(e);let r;t[1]!==n?(r=at.activeOrganization(n),t[1]=n,t[2]=r):r=t[2];let i;t[3]!==n?(i=async()=>{if(!n)return null;const{data:p}=await Rr.organization.setActive({organizationSlug:n});return{org:p,project:{slug:Sp}}},t[3]=n,t[4]=i):i=t[4];let s;t[5]!==r||t[6]!==i?(s={queryKey:r,queryFn:i,gcTime:1/0,staleTime:1/0,refetchOnWindowFocus:!1,refetchOnMount:!1},t[5]=r,t[6]=i,t[7]=s):s=t[7];const{data:a}=da(s);if(!a){let p;t[8]===Symbol.for("react.memo_cache_sentinel")?(p=m.jsx(fl,{}),t[8]=p):p=t[8];let g;return t[9]===Symbol.for("react.memo_cache_sentinel")?(g=m.jsxs("div",{className:"min-h-screen bg-background",children:[p,m.jsx("div",{className:"pt-12",children:m.jsx(_l,{})})]}),t[9]=g):g=t[9],g}let o;t[10]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsx(fl,{showSidebarToggle:!0,showOrgSwitcher:!0,showDecoChat:!0}),t[10]=o):o=t[10];let u;t[11]===Symbol.for("react.memo_cache_sentinel")?(u={"--sidebar-width":"13rem","--sidebar-width-mobile":"11rem"},t[11]=u):u=t[11];let l;t[12]===Symbol.for("react.memo_cache_sentinel")?(l=m.jsx(bN,{}),t[12]=l):l=t[12];let d;t[13]===Symbol.for("react.memo_cache_sentinel")?(d=m.jsx(R6,{children:m.jsxs("div",{className:"flex flex-col h-screen",children:[o,m.jsxs(QI,{className:"flex-1 bg-sidebar",style:u,children:[l,m.jsx(JI,{className:"pt-12",children:m.jsx(O6,{})})]})]})}),t[13]=d):d=t[13];let c;t[14]!==a.org.slug?(c=m.jsx(ZE,{children:d},a.org.slug),t[14]=a.org.slug,t[15]=c):c=t[15];let h;return t[16]!==a||t[17]!==c?(h=m.jsx(Ap,{...a,children:c}),t[16]=a,t[17]=c,t[18]=h):h=t[18],h}function l4(){const t=F.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=m.jsx(VN,{children:m.jsx(P.Suspense,{fallback:m.jsx(Tl,{}),children:m.jsx(L6,{})})}),t[0]=e):e=t[0],e}export{l4 as default};
|