@decocms/mesh 1.13.2 → 1.13.4
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/client/assets/{AlertCircle-C7jPyF1i.js → AlertCircle-CmTLFfTW.js} +1 -1
- package/dist/client/assets/{ArrowLeft-BsEq7RkN.js → ArrowLeft-kUb-nLpp.js} +1 -1
- package/dist/client/assets/{ChevronDown-CTU5QhlY.js → ChevronDown-BIixgdXr.js} +1 -1
- package/dist/client/assets/{ChevronRight-UyghVUW5.js → ChevronRight-XFvS51AW.js} +1 -1
- package/dist/client/assets/{Copy01-2N4PsOoQ.js → Copy01-Bbnq-cRP.js} +1 -1
- package/dist/client/assets/{DotsHorizontal-K1DaKZpH.js → DotsHorizontal-Wp9Jfd-l.js} +1 -1
- package/dist/client/assets/{DotsVertical-7n0u_WMH.js → DotsVertical-BWJddsCE.js} +1 -1
- package/dist/client/assets/{File06-B-4AkckK.js → File06-AO49hgxj.js} +1 -1
- package/dist/client/assets/{FilterLines-3KXsEQsL.js → FilterLines-D_oBG_mT.js} +1 -1
- package/dist/client/assets/{FlipBackward-C2XOXx8C.js → FlipBackward-v3DJy5dX.js} +1 -1
- package/dist/client/assets/{GitBranch01-C5iAlTnG.js → GitBranch01-Bg8OxNYr.js} +1 -1
- package/dist/client/assets/{Grid01-CJPihD4i.js → Grid01-D8szKORD.js} +1 -1
- package/dist/client/assets/{Inbox01-BnO6gOQP.js → Inbox01-DKJqmGhJ.js} +1 -1
- package/dist/client/assets/{InfoCircle-CALL1u00.js → InfoCircle-DQgIwXgE.js} +1 -1
- package/dist/client/assets/{Key01-B0l-5fMc.js → Key01-j8Px8dQ3.js} +1 -1
- package/dist/client/assets/{LinkExternal01--B-xlI11.js → LinkExternal01-DtwuKg3k.js} +1 -1
- package/dist/client/assets/{Loading01-BIZwCiUc.js → Loading01-BFMDuD9f.js} +1 -1
- package/dist/client/assets/{Lock01-DOOxUber.js → Lock01-B2Dlj0_A.js} +1 -1
- package/dist/client/assets/{Play-DtfCRxAy.js → Play-DZwkJO6F.js} +1 -1
- package/dist/client/assets/{Plus-DjZGP-Iq.js → Plus-DCJuRkSA.js} +1 -1
- package/dist/client/assets/{Terminal-CRoqjoNr.js → Terminal-BgBiWCRz.js} +1 -1
- package/dist/client/assets/{Trash01-BSvmxP0N.js → Trash01-DXJjsatW.js} +1 -1
- package/dist/client/assets/{X-PqPoM3vz.js → X-DO5JCiO9.js} +1 -1
- package/dist/client/assets/{XClose-BIM9TZ-N.js → XClose-yLguPztf.js} +1 -1
- package/dist/client/assets/{alert-dialog-BFA_XwNs.js → alert-dialog-BFj8FHOj.js} +1 -1
- package/dist/client/assets/{auth-oN0yIABg.js → auth-CS1Cey1o.js} +1 -1
- package/dist/client/assets/{auth-catchall-DSafll23.js → auth-catchall-BbJfiMLS.js} +1 -1
- package/dist/client/assets/avatar-Cw7f7Fm7.js +1 -0
- package/dist/client/assets/badge-cip1W12x.js +1 -0
- package/dist/client/assets/card-D7kEypvP.js +1 -0
- package/dist/client/assets/checkbox-DWLQD46M.js +1 -0
- package/dist/client/assets/{collection-detail-DKY5TkgR.js → collection-detail-BnPZ4P9Q.js} +2 -2
- package/dist/client/assets/collection-display-button-6se5sKw0.js +1 -0
- package/dist/client/assets/{collection-header-Cq2y0kMK.js → collection-header-BAGohiuL.js} +1 -1
- package/dist/client/assets/{collection-page-DzdXojp0.js → collection-page-BIjUaFrN.js} +1 -1
- package/dist/client/assets/collection-search-Bt7hJb44.js +1 -0
- package/dist/client/assets/collection-tab-DofbhRON.js +1 -0
- package/dist/client/assets/collection-table-wrapper-Nus9WkY9.js +1 -0
- package/dist/client/assets/connection-card-D6p9Apdb.js +1 -0
- package/dist/client/assets/connection-detail-CkpomsVk.js +1 -0
- package/dist/client/assets/connections-X3ifJgj8.js +1 -0
- package/dist/client/assets/constants-B627FiQ3.js +1 -0
- package/dist/client/assets/create-organization-dialog-D4ZZBa08.js +1 -0
- package/dist/client/assets/dialog-BPRbMnap.js +1 -0
- package/dist/client/assets/dropdown-menu-DH78LFXJ.js +1 -0
- package/dist/client/assets/empty-state-ZbNFSrHa.js +1 -0
- package/dist/client/assets/env-vars-editor-HOD_p6bM.js +1 -0
- package/dist/client/assets/error-boundary-CSDpN3IU.js +1 -0
- package/dist/client/assets/{extract-connection-data-u9kLLue9.js → extract-connection-data-BVRaMREC.js} +1 -1
- package/dist/client/assets/form-BWvfCr5W.js +1 -0
- package/dist/client/assets/{formatDistanceToNow-C2AI0RE1.js → formatDistanceToNow-CUtIwGZO.js} +1 -1
- package/dist/client/assets/gateway-detail-BVUnhnv6.js +1 -0
- package/dist/client/assets/gateway-selector-C6BhGNmC.js +1 -0
- package/dist/client/assets/gateways-CUY_RF0g.js +1 -0
- package/dist/client/assets/home-BDMCtoFs.js +1 -0
- package/dist/client/assets/{index-ChqW8s3_.js → index-2YBxks23.js} +2 -2
- package/dist/client/assets/index-B1wnL3pV.css +1 -0
- package/dist/client/assets/{index-CcOnUPVc.js → index-CFqw5CAk.js} +2 -2
- package/dist/client/assets/{index-79P7ggRz.js → index-m-YmB4ph.js} +1 -1
- package/dist/client/assets/{button-Dr2OfS67.js → input-BSDBSyke.js} +1 -1
- package/dist/client/assets/layout-C_WJLL2S.js +1 -0
- package/dist/client/assets/{lazy-highlighter-rbKuYd4Y.js → lazy-highlighter-QHCwZ7Bv.js} +1 -1
- package/dist/client/assets/localstorage-keys-DnYi5wZr.js +1 -0
- package/dist/client/assets/login-unmsX_CR.js +1 -0
- package/dist/client/assets/{mcp-oauth-CLB05bqO.js → mcp-oauth-D1oibR_i.js} +1 -1
- package/dist/client/assets/mcp-server-detail-5ueNKLNi.js +1 -0
- package/dist/client/assets/members-CgDxC8dY.js +3 -0
- package/dist/client/assets/{monaco-editor-BWGnuKvS.js → monaco-editor-18l2E7lk.js} +1 -1
- package/dist/client/assets/{monitoring-Daq8j1mw.js → monitoring-BS_WM-ML.js} +5 -5
- package/dist/client/assets/{oauth-callback-yMv-isiq.js → oauth-callback-tcEVQW2m.js} +1 -1
- package/dist/client/assets/page-Bm0QzKLN.js +1 -0
- package/dist/client/assets/{page-DkLEvKFr.js → page-C_wcQFSa.js} +1 -1
- package/dist/client/assets/pin-to-sidebar-button-rUjoaKt7.js +1 -0
- package/dist/client/assets/popover-DGwJ1U8B.js +1 -0
- package/dist/client/assets/project-context-provider-C7-HmBKu.js +1 -0
- package/dist/client/assets/resizable-BkJdAL7l.js +1 -0
- package/dist/client/assets/resource-tabs-DhNIXHvE.js +1 -0
- package/dist/client/assets/select-DLPmxXDW.js +1 -0
- package/dist/client/assets/settings-Dg4J4piv.js +1 -0
- package/dist/client/assets/shell-layout-CW_3D6wx.js +19 -0
- package/dist/client/assets/spinner-PGFal9m1.js +1 -0
- package/dist/client/assets/switch-Fn7If0Ti.js +1 -0
- package/dist/client/assets/textarea-CbNfP826.js +1 -0
- package/dist/client/assets/{thread-history-popover-BqhOXgTV.js → thread-history-popover-BW6o5miO.js} +45 -45
- package/dist/client/assets/{tools-list-wGfEy4CM.js → tools-list-BMbd7IEa.js} +1 -1
- package/dist/client/assets/{use-binding-DaAdA88g.js → use-binding-D77gExDp.js} +1 -1
- package/dist/client/assets/{use-connection-Dmp9OF3a.js → use-connection-BPzhCo7m.js} +1 -1
- package/dist/client/assets/{use-connection-resources-BB8wUxFy.js → use-connection-resources-CQGT27SN.js} +1 -1
- package/dist/client/assets/{use-gateway-CqHSf00q.js → use-gateway-C8QVevg7.js} +1 -1
- package/dist/client/assets/{use-list-state-OO7JJFHk.js → use-list-state-BzeiRpp0.js} +1 -1
- package/dist/client/assets/{use-mcp-DA1ttZCi.js → use-mcp-D2cijL_p.js} +1 -1
- package/dist/client/assets/{use-members-CU5bDeq-.js → use-members-CTyXRW-K.js} +1 -1
- package/dist/client/assets/{use-mobile-DJYJGOHZ.js → use-mobile-BTxzaR4j.js} +1 -1
- package/dist/client/assets/use-organization-settings-aN8k0KJJ.js +1 -0
- package/dist/client/assets/use-tool-call-C4GcZMyW.js +1 -0
- package/dist/client/assets/useQuery-DV_L-E86.js +1 -0
- package/dist/client/assets/value-DVG0CnkT.js +1 -0
- package/dist/client/assets/view-mode-toggle-DPmK0pgy.js +1 -0
- package/dist/client/assets/workflow-Dkm9OUwf.js +1 -0
- package/dist/client/index.html +2 -2
- package/package.json +1 -1
- package/dist/client/assets/avatar-DWNKzJTz.js +0 -1
- package/dist/client/assets/badge-CMDsV8CJ.js +0 -1
- package/dist/client/assets/card-DGWmxOab.js +0 -1
- package/dist/client/assets/checkbox-CH_lW5sL.js +0 -1
- package/dist/client/assets/collection-display-button-CF5VNEyr.js +0 -1
- package/dist/client/assets/collection-search-5HSGaGGt.js +0 -1
- package/dist/client/assets/collection-tab-DfUfYU59.js +0 -1
- package/dist/client/assets/collection-table-wrapper-BcST91H1.js +0 -1
- package/dist/client/assets/connection-card-BYX60RAK.js +0 -1
- package/dist/client/assets/connection-detail-BIJapkB_.js +0 -1
- package/dist/client/assets/connections-iA0KSF8d.js +0 -1
- package/dist/client/assets/constants-Dj4zd5B9.js +0 -1
- package/dist/client/assets/create-organization-dialog-CrdjEf0i.js +0 -1
- package/dist/client/assets/dialog-Didf1Cm0.js +0 -1
- package/dist/client/assets/dropdown-menu-DW5iGKOq.js +0 -1
- package/dist/client/assets/empty-state-BN60qDU7.js +0 -1
- package/dist/client/assets/env-vars-editor-Bp_8Hwo3.js +0 -1
- package/dist/client/assets/error-boundary-BiqKDyx1.js +0 -1
- package/dist/client/assets/form-BXN-QLni.js +0 -1
- package/dist/client/assets/gateway-detail-B4v6dTjK.js +0 -1
- package/dist/client/assets/gateway-selector-QHaVxB2n.js +0 -1
- package/dist/client/assets/gateways-Cx9ti1Cv.js +0 -1
- package/dist/client/assets/home-CJdYeB-M.js +0 -1
- package/dist/client/assets/index-BjKus4OW.css +0 -1
- package/dist/client/assets/input-DBy5GvSG.js +0 -1
- package/dist/client/assets/layout-C4lOtZCC.js +0 -1
- package/dist/client/assets/localstorage-keys-D9YX3_IT.js +0 -1
- package/dist/client/assets/login-fLYNz1_K.js +0 -1
- package/dist/client/assets/mcp-server-detail-CcpTBZ0r.js +0 -1
- package/dist/client/assets/members-zUvSLEug.js +0 -3
- package/dist/client/assets/page-CqtvajVn.js +0 -1
- package/dist/client/assets/pin-to-sidebar-button-BiLL5QoJ.js +0 -1
- package/dist/client/assets/popover-BD8rPm7n.js +0 -1
- package/dist/client/assets/project-context-provider-CRa6hysF.js +0 -1
- package/dist/client/assets/resizable-CGOknEmg.js +0 -1
- package/dist/client/assets/resource-tabs-BPp4Cr-n.js +0 -1
- package/dist/client/assets/select-Bw9i3g8J.js +0 -1
- package/dist/client/assets/settings-DXlkaFxL.js +0 -1
- package/dist/client/assets/shell-layout-DBkPG18-.js +0 -19
- package/dist/client/assets/spinner-DhLOJDf8.js +0 -1
- package/dist/client/assets/switch-BTv42t3b.js +0 -1
- package/dist/client/assets/textarea-C3UNaEli.js +0 -1
- package/dist/client/assets/use-organization-settings-BGtwqtxs.js +0 -1
- package/dist/client/assets/use-tool-call-xMn-Ysup.js +0 -1
- package/dist/client/assets/useQuery-u2B_27A6.js +0 -1
- package/dist/client/assets/value-IcpA2Nq4.js +0 -1
- package/dist/client/assets/view-mode-toggle-Di5d2VZX.js +0 -1
- package/dist/client/assets/workflow-UoaX4VGc.js +0 -1
package/dist/client/assets/{thread-history-popover-BqhOXgTV.js → thread-history-popover-BW6o5miO.js}
RENAMED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/lazy-highlighter-
|
|
2
|
-
import{r as V,c as W,j as m,B as Bi,p as Fi,K as Oe,d as yc,t as di,E as Ac,F as kc,H as $e,v as q,_ as pr,I as hu,J as Cc,L as Ic,M as Sc,Q as Be,V as Bn,W as qn,s as be,X,Y as Tt,Z as Nc,$ as ye,a0 as wc,a1 as Ui,a2 as Rc,h as Oc}from"./index-CcOnUPVc.js";import{c as ce,u as vt,B as Ye}from"./button-Dr2OfS67.js";import{u as St,c as an,b as sn,T as un,a as pu,i as Jt}from"./project-context-provider-CRa6hysF.js";import{E as Lc,u as Dc}from"./use-binding-DaAdA88g.js";import{P as mu,a as gu,b as Eu}from"./popover-BD8rPm7n.js";import{i as bu}from"./AlertCircle-C7jPyF1i.js";import{i as vc}from"./error-boundary-BiqKDyx1.js";import{i as Pc}from"./X-PqPoM3vz.js";import{i as Mc,c as Bc}from"./Grid01-CJPihD4i.js";import{i as Fc,R as Uc,f as Hc,g as jc,h as zc}from"./gateway-selector-QHaVxB2n.js";import{T as $c}from"./textarea-C3UNaEli.js";import{u as Yc,L as qc}from"./localstorage-keys-D9YX3_IT.js";import{i as Tu}from"./ChevronRight-UyghVUW5.js";import{a as Hi}from"./Copy01-2N4PsOoQ.js";import{i as Vc}from"./Terminal-CRoqjoNr.js";import{M as xu,s as Sa}from"./monaco-editor-BWGnuKvS.js";import{b as Wc,c as Qc,d as Gc,A as Xc,a as Zc,e as Kc,g as Jc,f as ed}from"./alert-dialog-BFA_XwNs.js";import{i as td}from"./File06-B-4AkckK.js";import{i as nd}from"./InfoCircle-CALL1u00.js";import{U as rd,a as id,c as ad,u as sd,i as _u,b as ud,E as od}from"./use-connection-Dmp9OF3a.js";import{O as ld,a as cd,g as dd}from"./well-known-mcp-D13f-8h2.js";import{g as fd}from"./generate-id-Dyweu44Y.js";import{s as hd}from"./Trash01-BSvmxP0N.js";const yu=({size:t=24,color:e="currentColor",...n})=>V.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},V.createElement("path",{d:"M15.938 15.938A7.001 7.001 0 0 0 15 2a7.001 7.001 0 0 0-6.938 6.062M16 15a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z"}));yu.displayName="Coins01";const Au=({size:t=24,color:e="currentColor",...n})=>V.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},V.createElement("path",{d:"M9 14 4 9m0 0 5-5M4 9h6.4c3.36 0 5.04 0 6.324.654a6 6 0 0 1 2.622 2.622C20 13.56 20 15.24 20 18.6V20"}));Au.displayName="CornerUpLeft";const ku=({size:t=24,color:e="currentColor",...n})=>V.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},V.createElement("path",{d:"M6 16a4 4 0 0 0 4 4h4a4 4 0 0 0 0-8h-4a4 4 0 0 1 0-8h4a4 4 0 0 1 4 4m-6-6v20"}));ku.displayName="CurrencyDollar";const Cu=({size:t=24,color:e="currentColor",...n})=>V.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},V.createElement("path",{d:"m18 10-4-4M2.5 21.5l3.384-.376c.414-.046.62-.069.814-.131a2 2 0 0 0 .485-.234c.17-.111.317-.259.61-.553L21 7a2.828 2.828 0 1 0-4-4L3.794 16.206c-.294.294-.442.442-.553.611a2 2 0 0 0-.234.485c-.062.193-.085.4-.131.814L2.5 21.5Z"}));Cu.displayName="Edit02";const Iu=({size:t=24,color:e="currentColor",...n})=>V.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},V.createElement("path",{d:"M16.2 21H6.931c-.605 0-.908 0-1.049-.12a.5.5 0 0 1-.173-.42c.014-.183.228-.397.657-.826l8.503-8.503c.396-.396.594-.594.822-.668a1 1 0 0 1 .618 0c.228.074.426.272.822.668L21 15v1.2M16.2 21c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C21 18.72 21 17.88 21 16.2M16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4M10.5 8.5a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z"}));Iu.displayName="Image01";const Su=({size:t=24,color:e="currentColor",...n})=>V.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},V.createElement("path",{d:"M15 16.5V19c0 .932 0 1.398-.152 1.765a2 2 0 0 1-1.083 1.083C13.398 22 12.932 22 12 22c-.932 0-1.398 0-1.765-.152a2 2 0 0 1-1.083-1.083C9 20.398 9 19.932 9 19v-2.5m6 0c2.649-1.157 4.5-3.925 4.5-7a7.5 7.5 0 0 0-15 0c0 3.075 1.851 5.843 4.5 7m6 0H9"}));Su.displayName="Lightbulb01";const Nu=({size:t=24,color:e="currentColor",...n})=>V.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},V.createElement("path",{d:"m18 8 4 4m0 0-4 4m4-4H9m6-7.796A8.383 8.383 0 0 0 10.667 3C5.88 3 2 7.03 2 12s3.88 9 8.667 9A8.384 8.384 0 0 0 15 19.796"}));Nu.displayName="LogOut04";const Cr=({size:t=24,color:e="currentColor",...n})=>V.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},V.createElement("path",{d:"m6.5 13 .784 1.569c.266.53.399.796.576 1.026a3 3 0 0 0 .545.545c.23.177.495.31 1.026.575L11 17.5l-1.569.785c-.53.265-.796.398-1.026.575a3 3 0 0 0-.545.545c-.177.23-.31.495-.576 1.026L6.5 22l-.784-1.569c-.266-.53-.399-.796-.576-1.026a3 3 0 0 0-.545-.545c-.23-.177-.495-.31-1.026-.575L2 17.5l1.569-.785c.53-.265.796-.398 1.026-.575a3 3 0 0 0 .545-.545c.177-.23.31-.495.576-1.026L6.5 13ZM15 2l1.179 3.064c.282.734.423 1.1.642 1.409a3 3 0 0 0 .706.706c.309.22.675.36 1.409.642L22 9l-3.064 1.179c-.734.282-1.1.423-1.409.642a3 3 0 0 0-.706.706c-.22.309-.36.675-.642 1.409L15 16l-1.179-3.064c-.282-.734-.423-1.1-.642-1.409a3 3 0 0 0-.706-.706c-.309-.22-.675-.36-1.409-.642L8 9l3.064-1.179c.734-.282 1.1-.423 1.409-.642a3 3 0 0 0 .706-.706c.22-.309.36-.675.642-1.409L15 2Z"}));Cr.displayName="Stars01";const wu=({size:t=24,color:e="currentColor",...n})=>V.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},V.createElement("path",{d:"M16 8V5l3-3 1 2 2 1-3 3h-3Zm0 0-4 4m10 0c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2m5 10a5 5 0 1 1-5-5"}));wu.displayName="Target04";function i_(){const t=W.c(7);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=m.jsx("div",{className:"size-6 rounded-lg 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-3.5 w-28 rounded bg-muted animate-pulse"}),m.jsx("div",{className:"h-3 w-40 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 items-center h-12 flex-none border-b border-border/80 px-4",children:m.jsxs("div",{className:"flex items-center justify-between gap-3 w-full",children:[n,m.jsxs("div",{className:"flex items-end gap-2",children:[m.jsx("div",{className:"h-6 w-6 rounded-full bg-muted animate-pulse"}),m.jsx("div",{className:"h-6 w-6 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 w-full max-w-2xl flex-col gap-4",children:[m.jsx(tr,{align:"right",width:"w-3/4"}),m.jsx(tr,{align:"left",width:"w-full",lines:3}),m.jsx(tr,{align:"right",width:"w-2/3"}),m.jsx(tr,{align:"left",width:"w-5/6",lines:2})]})}),t[3]=i):i=t[3];let a;t[4]===Symbol.for("react.memo_cache_sentinel")?(a=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]=a):a=t[4];let s;t[5]===Symbol.for("react.memo_cache_sentinel")?(s=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]=s):s=t[5];let u;return t[6]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsxs("div",{className:"flex h-full w-full flex-col bg-sidebar",children:[r,i,m.jsx("div",{className:"px-4 py-4",children:m.jsx("div",{className:"mx-auto w-full max-w-2xl",children:m.jsxs("div",{className:"relative flex min-h-[130px] flex-col rounded-xl border border-border bg-background shadow-sm",children:[a,m.jsxs("div",{className:"flex items-center justify-between px-2.5 pb-2.5",children:[s,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]=u):u=t[6],u}function tr(t){const e=W.c(22),{align:n,width:r,lines:i}=t,a=r===void 0?"w-full":r,s=i===void 0?1:i,u=n==="right"?"flex-row-reverse":"flex-row";let o;e[0]!==u?(o=ce("flex w-full gap-4 px-4 py-2",u),e[0]=u,e[1]=o):o=e[1];const l=n==="right"?"ml-auto max-w-3/4 items-end":"w-full items-start";let d;e[2]!==l?(d=ce("flex min-w-0 flex-col gap-2",l),e[2]=l,e[3]=d):d=e[3];let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=m.jsx("div",{className:"h-3 w-16 rounded bg-muted/40 animate-pulse"}),e[4]=f):f=e[4];const p=n==="right"?"bg-muted":"bg-transparent border border-border/40";let h;e[5]!==p||e[6]!==a?(h=ce("min-w-0 rounded-2xl p-4",p,a),e[5]=p,e[6]=a,e[7]=h):h=e[7];let g;e[8]!==s?(g=Array.from({length:s}),e[8]=s,e[9]=g):g=e[9];let _;e[10]!==s||e[11]!==g?(_=m.jsx("div",{className:"space-y-2",children:g.map((E,R)=>m.jsx("div",{className:ce("h-3 rounded bg-muted-foreground/20 animate-pulse",R===s-1?"w-3/4":"w-full"),style:{animationDelay:`${R*.1}s`}},R))}),e[10]=s,e[11]=g,e[12]=_):_=e[12];let y;e[13]!==_||e[14]!==h?(y=m.jsx("div",{className:h,children:_}),e[13]=_,e[14]=h,e[15]=y):y=e[15];let T;e[16]!==y||e[17]!==d?(T=m.jsxs("div",{className:d,children:[f,y]}),e[16]=y,e[17]=d,e[18]=T):T=e[18];let S;return e[19]!==T||e[20]!==o?(S=m.jsx("div",{className:o,children:T}),e[19]=T,e[20]=o,e[21]=S):S=e[21],S}var Fn;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const a={};for(const s of i)a[s]=s;return a},t.getValidEnumValues=i=>{const a=t.objectKeys(i).filter(u=>typeof i[i[u]]!="number"),s={};for(const u of a)s[u]=i[u];return t.objectValues(s)},t.objectValues=i=>t.objectKeys(i).map(function(a){return i[a]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const a=[];for(const s in i)Object.prototype.hasOwnProperty.call(i,s)&&a.push(s);return a},t.find=(i,a)=>{for(const s of i)if(a(s))return s},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,a=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(a)}t.joinValues=r,t.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(Fn||(Fn={}));var Na;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(Na||(Na={}));Fn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);Fn.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class mr extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(a){return a.message},r={_errors:[]},i=a=>{for(const s of a.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let u=r,o=0;for(;o<s.path.length;){const l=s.path[o];o===s.path.length-1?(u[l]=u[l]||{_errors:[]},u[l]._errors.push(n(s))):u[l]=u[l]||{_errors:[]},u=u[l],o++}}};return i(this),r}static assert(e){if(!(e instanceof mr))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Fn.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n=Object.create(null),r=[];for(const i of this.issues)if(i.path.length>0){const a=i.path[0];n[a]=n[a]||[],n[a].push(e(i))}else r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}mr.create=t=>new mr(t);var wa;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(wa||(wa={}));var ee;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(ee||(ee={}));function Bt(t){return new Promise((e,n)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>n(t.error)})}function pd(t,e){let n;const r=()=>{if(n)return n;const i=indexedDB.open(t);return i.onupgradeneeded=()=>i.result.createObjectStore(e),n=Bt(i),n.then(a=>{a.onclose=()=>n=void 0},()=>{}),n};return(i,a)=>r().then(s=>a(s.transaction(e,i).objectStore(e)))}let zr;function Ir(){return zr||(zr=pd("keyval-store","keyval")),zr}function ji(t,e=Ir()){return e("readonly",n=>Bt(n.get(t)))}function Sn(t,e,n=Ir()){return n("readwrite",r=>(r.put(e,t),Bt(r.transaction)))}function Ru(t,e=Ir()){return e("readwrite",n=>(n.delete(t),Bt(n.transaction)))}function md(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},Bt(t.transaction)}function Ou(t=Ir()){return t("readonly",e=>{if(e.getAll&&e.getAllKeys)return Promise.all([Bt(e.getAllKeys()),Bt(e.getAll())]).then(([r,i])=>r.map((a,s)=>[a,i[s]]));const n=[];return t("readonly",r=>md(r,i=>n.push([i.key,i.value])).then(()=>n))})}async function gd(t,e){const n=`${t}:threads:${e}`;return await ji(n)??null}async function Ed(t){const e=`${t}:threads:`;return(await Ou()).filter(([i])=>typeof i=="string"&&i.startsWith(e)).map(([,i])=>i).filter(i=>!i.hidden).sort((i,a)=>String(a.updated_at).localeCompare(String(i.updated_at)))}function Lu(t,e){const n=`${t}:messages:`;return Ou().then(r=>r.filter(([a])=>typeof a=="string"&&a.startsWith(n)).map(([,a])=>a).filter(a=>a.metadata?.thread_id===e||a.threadId===e).sort((a,s)=>{const u=a.metadata?.created_at||a.createdAt||"",o=s.metadata?.created_at||s.createdAt||"";return String(u).localeCompare(String(o))}))}function a_(t){const e=W.c(14),{locator:n}=St(),r=t?.gatewayId;let i;e[0]!==r||e[1]!==n?(i=Oe.threads(n),e[0]=r,e[1]=n,e[2]=i):i=e[2];let a;e[3]!==r||e[4]!==n?(a=async()=>await Ed(n),e[3]=r,e[4]=n,e[5]=a):a=e[5];let s;e[6]!==i||e[7]!==a?(s={queryKey:i,queryFn:a,staleTime:3e4},e[6]=i,e[7]=a,e[8]=s):s=e[8];const{data:u,refetch:o}=Fi(s);let l;e[9]!==u?(l=u??[],e[9]=u,e[10]=l):l=e[10];let d;return e[11]!==o||e[12]!==l?(d={threads:l,refetch:o},e[11]=o,e[12]=l,e[13]=d):d=e[13],d}function bd(t){const e=W.c(11),{locator:n}=St();let r;e[0]!==n||e[1]!==t?(r=Oe.threadMessages(n,t),e[0]=n,e[1]=t,e[2]=r):r=e[2];let i;e[3]!==n||e[4]!==t?(i=()=>Lu(n,t),e[3]=n,e[4]=t,e[5]=i):i=e[5];let a;e[6]!==r||e[7]!==i?(a={queryKey:r,queryFn:i,staleTime:3e4},e[6]=r,e[7]=i,e[8]=a):a=e[8];const{data:s}=Fi(a);let u;return e[9]!==s?(u=s??[],e[9]=s,e[10]=u):u=e[10],u}function zi(){const t=W.c(28),{locator:e}=St(),n=Bi();let r;t[0]!==e?(r=async y=>{const T=`${e}:threads:${y.id}`;return await Sn(T,y),y},t[0]=e,t[1]=r):r=t[1];let i;t[2]!==e||t[3]!==n?(i=y=>{n.invalidateQueries({queryKey:Oe.threads(e)}),y.gatewayId&&n.invalidateQueries({queryKey:Oe.gatewayThreads(e,y.gatewayId)})},t[2]=e,t[3]=n,t[4]=i):i=t[4];let a;t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7];const s=vt(a);let u;t[8]!==e?(u=async y=>{const{id:T,updates:S}=y,E=`${e}:threads:${T}`,R=await ji(E);if(!R)throw new Error(`Thread ${T} not found`);const O={...R,...S};return await Sn(E,O),O},t[8]=e,t[9]=u):u=t[9];let o;t[10]!==e||t[11]!==n?(o=y=>{n.invalidateQueries({queryKey:Oe.threads(e)}),n.invalidateQueries({queryKey:Oe.thread(e,y.id)}),y.gatewayId&&n.invalidateQueries({queryKey:Oe.gatewayThreads(e,y.gatewayId)})},t[10]=e,t[11]=n,t[12]=o):o=t[12];let l;t[13]!==u||t[14]!==o?(l={mutationFn:u,onSuccess:o},t[13]=u,t[14]=o,t[15]=l):l=t[15];const d=vt(l);let f;t[16]!==e?(f=async y=>{const T=`${e}:threads:${y}`;return await Ru(T),y},t[16]=e,t[17]=f):f=t[17];let p;t[18]!==e||t[19]!==n?(p=()=>{n.invalidateQueries({queryKey:Oe.threads(e)})},t[18]=e,t[19]=n,t[20]=p):p=t[20];let h;t[21]!==f||t[22]!==p?(h={mutationFn:f,onSuccess:p},t[21]=f,t[22]=p,t[23]=h):h=t[23];const g=vt(h);let _;return t[24]!==g||t[25]!==s||t[26]!==d?(_={insert:s,update:d,delete:g},t[24]=g,t[25]=s,t[26]=d,t[27]=_):_=t[27],_}function Du(){const t=W.c(37),{locator:e}=St(),n=Bi();let r;t[0]!==e?(r=async R=>{const O=`${e}:messages:${R.id}`;return await Sn(O,R),R},t[0]=e,t[1]=r):r=t[1];let i;t[2]!==e||t[3]!==n?(i=R=>{const O=R.metadata?.thread_id||R.threadId;O&&n.invalidateQueries({queryKey:Oe.threadMessages(e,O)}),n.invalidateQueries({queryKey:Oe.messages(e)})},t[2]=e,t[3]=n,t[4]=i):i=t[4];let a;t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7];const s=vt(a);let u;t[8]!==e?(u=async R=>(await Promise.all(R.map(O=>{const I=`${e}:messages:${O.id}`;return Sn(I,O)})),R),t[8]=e,t[9]=u):u=t[9];let o;t[10]!==e||t[11]!==n?(o=R=>{const O=new Set;for(const I of R){const v=I.metadata?.thread_id||I.threadId;v&&O.add(v)}for(const I of O)n.invalidateQueries({queryKey:Oe.threadMessages(e,I)});n.invalidateQueries({queryKey:Oe.messages(e)})},t[10]=e,t[11]=n,t[12]=o):o=t[12];let l;t[13]!==u||t[14]!==o?(l={mutationFn:u,onSuccess:o},t[13]=u,t[14]=o,t[15]=l):l=t[15];const d=vt(l);let f;t[16]!==e?(f=async R=>{const{id:O,updates:I}=R,v=`${e}:messages:${O}`,B=await ji(v);if(!B)throw new Error(`Message ${O} not found`);const z={...B,...I};return await Sn(v,z),z},t[16]=e,t[17]=f):f=t[17];let p;t[18]!==e||t[19]!==n?(p=R=>{const O=R.metadata?.thread_id||R.threadId;O&&n.invalidateQueries({queryKey:Oe.threadMessages(e,O)}),n.invalidateQueries({queryKey:Oe.messages(e)})},t[18]=e,t[19]=n,t[20]=p):p=t[20];let h;t[21]!==f||t[22]!==p?(h={mutationFn:f,onSuccess:p},t[21]=f,t[22]=p,t[23]=h):h=t[23];const g=vt(h);let _;t[24]!==e?(_=async R=>{const O=`${e}:messages:${R}`;return await Ru(O),R},t[24]=e,t[25]=_):_=t[25];let y;t[26]!==e||t[27]!==n?(y=()=>{n.invalidateQueries({queryKey:Oe.messages(e)})},t[26]=e,t[27]=n,t[28]=y):y=t[28];let T;t[29]!==y||t[30]!==_?(T={mutationFn:_,onSuccess:y},t[29]=y,t[30]=_,t[31]=T):T=t[31];const S=vt(T);let E;return t[32]!==S||t[33]!==s||t[34]!==d||t[35]!==g?(E={insert:s,insertMany:d,update:g,delete:S},t[32]=S,t[33]=s,t[34]=d,t[35]=g,t[36]=E):E=t[36],E}function s_(){const t=W.c(5),e=Bi(),{org:n}=St();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},t[0]=r):r=t[0];const i=yc(r);let a;return t[1]!==n||t[2]!==i||t[3]!==e?(a=s=>{const o=s.toolCall.toolName.match(/^COLLECTION_([A-Z_]+)_(CREATE|UPDATE|DELETE)$/);if(!o||!o[1])return;const l=o[1],d=i.connectionId;if(!d)return;e.invalidateQueries({queryKey:Oe.collection(n.slug,d,l)});const f=l.toLowerCase().replace(/_/g," ");di.success(`${f} updated`)},t[1]=n,t[2]=i,t[3]=e,t[4]=a):a=t[4],a}var vu="vercel.ai.error",Td=Symbol.for(vu),Ra,Oa,It=class Pu extends(Oa=Error,Ra=Td,Oa){constructor({name:e,message:n,cause:r}){super(n),this[Ra]=!0,this.name=e,this.cause=r}static isInstance(e){return Pu.hasMarker(e,vu)}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}};function Mu(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var Bu="AI_InvalidArgumentError",Fu=`vercel.ai.error.${Bu}`,xd=Symbol.for(Fu),La,Da,_d=class extends(Da=It,La=xd,Da){constructor({message:t,cause:e,argument:n}){super({name:Bu,message:t,cause:e}),this[La]=!0,this.argument=n}static isInstance(t){return It.hasMarker(t,Fu)}},Uu="AI_JSONParseError",Hu=`vercel.ai.error.${Uu}`,yd=Symbol.for(Hu),va,Pa,Ma=class extends(Pa=It,va=yd,Pa){constructor({text:t,cause:e}){super({name:Uu,message:`JSON parsing failed: Text: ${t}.
|
|
3
|
-
Error message: ${
|
|
4
|
-
Error message: ${Mu(n)}`,cause:n}),this[Ba]=!0,this.value=e}static isInstance(e){return It.hasMarker(e,zu)}static wrap({value:e,cause:n}){return fi.isInstance(n)&&n.value===e?n:new fi({value:e,cause:n})}},Vn=({prefix:t,size:e=16,alphabet:n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const i=()=>{const a=n.length,s=new Array(e);for(let u=0;u<e;u++)s[u]=n[Math.random()*a|0];return s.join("")};if(t==null)return i;if(n.includes(r))throw new _d({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${n}".`});return()=>`${t}${r}${i()}`},kd=Vn();function Ua(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 Dt(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 Ha(t,...e){const n=new Headers(Dt(t)),r=n.get("user-agent")||"";return n.set("user-agent",[r,...e].filter(Boolean).join(" ")),Object.fromEntries(n.entries())}var Cd=/"__proto__"\s*:/,Id=/"constructor"\s*:/;function ja(t){const e=JSON.parse(t);return e===null||typeof e!="object"||Cd.test(t)===!1&&Id.test(t)===!1?e:Sd(e)}function Sd(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 a=r[i];a&&typeof a=="object"&&e.push(a)}}}return t}function Nd(t){const{stackTraceLimit:e}=Error;try{Error.stackTraceLimit=0}catch{return ja(t)}try{return ja(t)}finally{Error.stackTraceLimit=e}}function $u(t){if(t.type==="object"||Array.isArray(t.type)&&t.type.includes("object")){t.additionalProperties=!1;const{properties:n}=t;if(n!=null)for(const r of Object.keys(n))n[r]=Ot(n[r])}t.items!=null&&(t.items=Array.isArray(t.items)?t.items.map(Ot):Ot(t.items)),t.anyOf!=null&&(t.anyOf=t.anyOf.map(Ot)),t.allOf!=null&&(t.allOf=t.allOf.map(Ot)),t.oneOf!=null&&(t.oneOf=t.oneOf.map(Ot));const{definitions:e}=t;if(e!=null)for(const n of Object.keys(e))e[n]=Ot(e[n]);return t}function Ot(t){return typeof t=="boolean"?t:$u(t)}var wd=Symbol("Let zodToJsonSchema decide on which parser to use"),za={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"},Rd=t=>typeof t=="string"?{...za,name:t}:{...za,...t};function Xe(){return{}}function Od(t,e){var n,r,i;const a={type:"array"};return(n=t.type)!=null&&n._def&&((i=(r=t.type)==null?void 0:r._def)==null?void 0:i.typeName)!==ee.ZodAny&&(a.items=pe(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&(a.minItems=t.minLength.value),t.maxLength&&(a.maxItems=t.maxLength.value),t.exactLength&&(a.minItems=t.exactLength.value,a.maxItems=t.exactLength.value),a}function Ld(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 Dd(){return{type:"boolean"}}function Yu(t,e){return pe(t.type._def,e)}var vd=(t,e)=>pe(t.innerType._def,e);function qu(t,e,n){const r=n??e.dateStrategy;if(Array.isArray(r))return{anyOf:r.map((i,a)=>qu(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 Pd(t)}}var Pd=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 Md(t,e){return{...pe(t.innerType._def,e),default:t.defaultValue()}}function Bd(t,e){return e.effectStrategy==="input"?pe(t.schema._def,e):Xe()}function Fd(t){return{type:"string",enum:Array.from(t.values)}}var Ud=t=>"type"in t&&t.type==="string"?!1:"allOf"in t;function Hd(t,e){const n=[pe(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),pe(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(i=>!!i),r=[];return n.forEach(i=>{if(Ud(i))r.push(...i.allOf);else{let a=i;if("additionalProperties"in i&&i.additionalProperties===!1){const{additionalProperties:s,...u}=i;a=u}r.push(a)}}),r.length?{allOf:r}:void 0}function jd(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 $r=void 0,nt={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:()=>($r===void 0&&($r=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),$r),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 Vu(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":rt(n,"email",r.message,e);break;case"format:idn-email":rt(n,"idn-email",r.message,e);break;case"pattern:zod":Me(n,nt.email,r.message,e);break}break;case"url":rt(n,"uri",r.message,e);break;case"uuid":rt(n,"uuid",r.message,e);break;case"regex":Me(n,r.regex,r.message,e);break;case"cuid":Me(n,nt.cuid,r.message,e);break;case"cuid2":Me(n,nt.cuid2,r.message,e);break;case"startsWith":Me(n,RegExp(`^${Yr(r.value,e)}`),r.message,e);break;case"endsWith":Me(n,RegExp(`${Yr(r.value,e)}$`),r.message,e);break;case"datetime":rt(n,"date-time",r.message,e);break;case"date":rt(n,"date",r.message,e);break;case"time":rt(n,"time",r.message,e);break;case"duration":rt(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":{Me(n,RegExp(Yr(r.value,e)),r.message,e);break}case"ip":{r.version!=="v6"&&rt(n,"ipv4",r.message,e),r.version!=="v4"&&rt(n,"ipv6",r.message,e);break}case"base64url":Me(n,nt.base64url,r.message,e);break;case"jwt":Me(n,nt.jwt,r.message,e);break;case"cidr":{r.version!=="v6"&&Me(n,nt.ipv4Cidr,r.message,e),r.version!=="v4"&&Me(n,nt.ipv6Cidr,r.message,e);break}case"emoji":Me(n,nt.emoji(),r.message,e);break;case"ulid":{Me(n,nt.ulid,r.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{rt(n,"binary",r.message,e);break}case"contentEncoding:base64":{n.contentEncoding="base64";break}case"pattern:zod":{Me(n,nt.base64,r.message,e);break}}break}case"nanoid":Me(n,nt.nanoid,r.message,e)}return n}function Yr(t,e){return e.patternStrategy==="escape"?$d(t):t}var zd=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function $d(t){let e="";for(let n=0;n<t.length;n++)zd.has(t[n])||(e+="\\"),e+=t[n];return e}function rt(t,e,n,r){var i;t.format||(i=t.anyOf)!=null&&i.some(a=>a.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 Me(t,e,n,r){var i;t.pattern||(i=t.allOf)!=null&&i.some(a=>a.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern}),delete t.pattern),t.allOf.push({pattern:$a(e,r),...n&&r.errorMessages&&{errorMessage:{pattern:n}}})):t.pattern=$a(e,r)}function $a(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 a="",s=!1,u=!1,o=!1;for(let l=0;l<i.length;l++){if(s){a+=i[l],s=!1;continue}if(r.i){if(u){if(i[l].match(/[a-z]/)){o?(a+=i[l],a+=`${i[l-2]}-${i[l]}`.toUpperCase(),o=!1):i[l+1]==="-"&&((n=i[l+2])!=null&&n.match(/[a-z]/))?(a+=i[l],o=!0):a+=`${i[l]}${i[l].toUpperCase()}`;continue}}else if(i[l].match(/[a-z]/)){a+=`[${i[l]}${i[l].toUpperCase()}]`;continue}}if(r.m){if(i[l]==="^"){a+=`(^|(?<=[\r
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/lazy-highlighter-QHCwZ7Bv.js","assets/index-CFqw5CAk.js","assets/index-B1wnL3pV.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as V,c as W,j as m,B as $i,p as Yi,K as Me,d as yc,t as Ei,E as Ac,F as kc,H as Ve,v as Y,_ as xr,I as gu,J as Cc,L as Ic,M as Sc,Q as je,V as $n,W as Zn,s as Ee,X as G,Y as Ct,Z as Nc,$ as ye,a0 as wc,a1 as qi,a2 as Rc,h as Oc}from"./index-CFqw5CAk.js";import{c as le,u as jt,B as We,I as Lc}from"./input-BSDBSyke.js";import{u as Dt,c as dn,b as fn,T as hn,a as Eu,i as sn}from"./project-context-provider-C7-HmBKu.js";import{E as Dc,u as vc}from"./use-binding-D77gExDp.js";import{P as bu,a as Tu,b as xu}from"./popover-DGwJ1U8B.js";import{i as _u}from"./AlertCircle-CmTLFfTW.js";import{i as Pc}from"./error-boundary-CSDpN3IU.js";import{i as Mc}from"./X-DO5JCiO9.js";import{i as Bc,c as Fc}from"./Grid01-D8szKORD.js";import{i as Uc,R as Hc,f as jc,g as zc,h as $c}from"./gateway-selector-C6BhGNmC.js";import{T as Yc}from"./textarea-CbNfP826.js";import{u as qc,L as Vc}from"./localstorage-keys-DnYi5wZr.js";import{i as yu}from"./ChevronRight-XFvS51AW.js";import{a as Vi}from"./Copy01-Bbnq-cRP.js";import{i as Wc}from"./Terminal-BgBiWCRz.js";import{M as Au,s as Ra}from"./monaco-editor-18l2E7lk.js";import{b as Qc,c as Gc,d as Xc,A as Zc,a as Kc,e as Jc,g as ed,f as td}from"./alert-dialog-BFj8FHOj.js";import{i as nd}from"./File06-AO49hgxj.js";import{i as rd}from"./InfoCircle-DQgIwXgE.js";import{U as id,a as ad,c as sd,u as ud,i as Wi,b as od,E as ld}from"./use-connection-BPzhCo7m.js";import{O as cd,a as dd,g as fd}from"./well-known-mcp-D13f-8h2.js";import{g as hd}from"./generate-id-Dyweu44Y.js";import{s as pd}from"./Trash01-DXJjsatW.js";const ku=({size:t=24,color:e="currentColor",...n})=>V.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},V.createElement("path",{d:"M15.938 15.938A7.001 7.001 0 0 0 15 2a7.001 7.001 0 0 0-6.938 6.062M16 15a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z"}));ku.displayName="Coins01";const Cu=({size:t=24,color:e="currentColor",...n})=>V.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},V.createElement("path",{d:"M9 14 4 9m0 0 5-5M4 9h6.4c3.36 0 5.04 0 6.324.654a6 6 0 0 1 2.622 2.622C20 13.56 20 15.24 20 18.6V20"}));Cu.displayName="CornerUpLeft";const Iu=({size:t=24,color:e="currentColor",...n})=>V.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},V.createElement("path",{d:"M6 16a4 4 0 0 0 4 4h4a4 4 0 0 0 0-8h-4a4 4 0 0 1 0-8h4a4 4 0 0 1 4 4m-6-6v20"}));Iu.displayName="CurrencyDollar";const Su=({size:t=24,color:e="currentColor",...n})=>V.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},V.createElement("path",{d:"m18 10-4-4M2.5 21.5l3.384-.376c.414-.046.62-.069.814-.131a2 2 0 0 0 .485-.234c.17-.111.317-.259.61-.553L21 7a2.828 2.828 0 1 0-4-4L3.794 16.206c-.294.294-.442.442-.553.611a2 2 0 0 0-.234.485c-.062.193-.085.4-.131.814L2.5 21.5Z"}));Su.displayName="Edit02";const Nu=({size:t=24,color:e="currentColor",...n})=>V.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},V.createElement("path",{d:"M16.2 21H6.931c-.605 0-.908 0-1.049-.12a.5.5 0 0 1-.173-.42c.014-.183.228-.397.657-.826l8.503-8.503c.396-.396.594-.594.822-.668a1 1 0 0 1 .618 0c.228.074.426.272.822.668L21 15v1.2M16.2 21c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C21 18.72 21 17.88 21 16.2M16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4M10.5 8.5a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z"}));Nu.displayName="Image01";const wu=({size:t=24,color:e="currentColor",...n})=>V.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},V.createElement("path",{d:"M15 16.5V19c0 .932 0 1.398-.152 1.765a2 2 0 0 1-1.083 1.083C13.398 22 12.932 22 12 22c-.932 0-1.398 0-1.765-.152a2 2 0 0 1-1.083-1.083C9 20.398 9 19.932 9 19v-2.5m6 0c2.649-1.157 4.5-3.925 4.5-7a7.5 7.5 0 0 0-15 0c0 3.075 1.851 5.843 4.5 7m6 0H9"}));wu.displayName="Lightbulb01";const Ru=({size:t=24,color:e="currentColor",...n})=>V.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},V.createElement("path",{d:"m18 8 4 4m0 0-4 4m4-4H9m6-7.796A8.383 8.383 0 0 0 10.667 3C5.88 3 2 7.03 2 12s3.88 9 8.667 9A8.384 8.384 0 0 0 15 19.796"}));Ru.displayName="LogOut04";const Or=({size:t=24,color:e="currentColor",...n})=>V.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},V.createElement("path",{d:"m6.5 13 .784 1.569c.266.53.399.796.576 1.026a3 3 0 0 0 .545.545c.23.177.495.31 1.026.575L11 17.5l-1.569.785c-.53.265-.796.398-1.026.575a3 3 0 0 0-.545.545c-.177.23-.31.495-.576 1.026L6.5 22l-.784-1.569c-.266-.53-.399-.796-.576-1.026a3 3 0 0 0-.545-.545c-.23-.177-.495-.31-1.026-.575L2 17.5l1.569-.785c.53-.265.796-.398 1.026-.575a3 3 0 0 0 .545-.545c.177-.23.31-.495.576-1.026L6.5 13ZM15 2l1.179 3.064c.282.734.423 1.1.642 1.409a3 3 0 0 0 .706.706c.309.22.675.36 1.409.642L22 9l-3.064 1.179c-.734.282-1.1.423-1.409.642a3 3 0 0 0-.706.706c-.22.309-.36.675-.642 1.409L15 16l-1.179-3.064c-.282-.734-.423-1.1-.642-1.409a3 3 0 0 0-.706-.706c-.309-.22-.675-.36-1.409-.642L8 9l3.064-1.179c.734-.282 1.1-.423 1.409-.642a3 3 0 0 0 .706-.706c.22-.309.36-.675.642-1.409L15 2Z"}));Or.displayName="Stars01";const Ou=({size:t=24,color:e="currentColor",...n})=>V.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},V.createElement("path",{d:"M16 8V5l3-3 1 2 2 1-3 3h-3Zm0 0-4 4m10 0c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2m5 10a5 5 0 1 1-5-5"}));Ou.displayName="Target04";function a_(){const t=W.c(7);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=m.jsx("div",{className:"size-6 rounded-lg 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-3.5 w-28 rounded bg-muted animate-pulse"}),m.jsx("div",{className:"h-3 w-40 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 items-center h-12 flex-none border-b border-border/80 px-4",children:m.jsxs("div",{className:"flex items-center justify-between gap-3 w-full",children:[n,m.jsxs("div",{className:"flex items-end gap-2",children:[m.jsx("div",{className:"h-6 w-6 rounded-full bg-muted animate-pulse"}),m.jsx("div",{className:"h-6 w-6 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 w-full max-w-2xl flex-col gap-4",children:[m.jsx(ur,{align:"right",width:"w-3/4"}),m.jsx(ur,{align:"left",width:"w-full",lines:3}),m.jsx(ur,{align:"right",width:"w-2/3"}),m.jsx(ur,{align:"left",width:"w-5/6",lines:2})]})}),t[3]=i):i=t[3];let a;t[4]===Symbol.for("react.memo_cache_sentinel")?(a=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]=a):a=t[4];let s;t[5]===Symbol.for("react.memo_cache_sentinel")?(s=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]=s):s=t[5];let u;return t[6]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsxs("div",{className:"flex h-full w-full flex-col bg-sidebar",children:[r,i,m.jsx("div",{className:"px-4 py-4",children:m.jsx("div",{className:"mx-auto w-full max-w-2xl",children:m.jsxs("div",{className:"relative flex min-h-[130px] flex-col rounded-xl border border-border bg-background shadow-sm",children:[a,m.jsxs("div",{className:"flex items-center justify-between px-2.5 pb-2.5",children:[s,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]=u):u=t[6],u}function ur(t){const e=W.c(22),{align:n,width:r,lines:i}=t,a=r===void 0?"w-full":r,s=i===void 0?1:i,u=n==="right"?"flex-row-reverse":"flex-row";let o;e[0]!==u?(o=le("flex w-full gap-4 px-4 py-2",u),e[0]=u,e[1]=o):o=e[1];const l=n==="right"?"ml-auto max-w-3/4 items-end":"w-full items-start";let d;e[2]!==l?(d=le("flex min-w-0 flex-col gap-2",l),e[2]=l,e[3]=d):d=e[3];let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=m.jsx("div",{className:"h-3 w-16 rounded bg-muted/40 animate-pulse"}),e[4]=f):f=e[4];const p=n==="right"?"bg-muted":"bg-transparent border border-border/40";let h;e[5]!==p||e[6]!==a?(h=le("min-w-0 rounded-2xl p-4",p,a),e[5]=p,e[6]=a,e[7]=h):h=e[7];let g;e[8]!==s?(g=Array.from({length:s}),e[8]=s,e[9]=g):g=e[9];let _;e[10]!==s||e[11]!==g?(_=m.jsx("div",{className:"space-y-2",children:g.map((E,R)=>m.jsx("div",{className:le("h-3 rounded bg-muted-foreground/20 animate-pulse",R===s-1?"w-3/4":"w-full"),style:{animationDelay:`${R*.1}s`}},R))}),e[10]=s,e[11]=g,e[12]=_):_=e[12];let y;e[13]!==_||e[14]!==h?(y=m.jsx("div",{className:h,children:_}),e[13]=_,e[14]=h,e[15]=y):y=e[15];let T;e[16]!==y||e[17]!==d?(T=m.jsxs("div",{className:d,children:[f,y]}),e[16]=y,e[17]=d,e[18]=T):T=e[18];let I;return e[19]!==T||e[20]!==o?(I=m.jsx("div",{className:o,children:T}),e[19]=T,e[20]=o,e[21]=I):I=e[21],I}var Yn;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const a={};for(const s of i)a[s]=s;return a},t.getValidEnumValues=i=>{const a=t.objectKeys(i).filter(u=>typeof i[i[u]]!="number"),s={};for(const u of a)s[u]=i[u];return t.objectValues(s)},t.objectValues=i=>t.objectKeys(i).map(function(a){return i[a]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const a=[];for(const s in i)Object.prototype.hasOwnProperty.call(i,s)&&a.push(s);return a},t.find=(i,a)=>{for(const s of i)if(a(s))return s},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,a=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(a)}t.joinValues=r,t.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(Yn||(Yn={}));var Oa;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(Oa||(Oa={}));Yn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);Yn.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class _r extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(a){return a.message},r={_errors:[]},i=a=>{for(const s of a.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let u=r,o=0;for(;o<s.path.length;){const l=s.path[o];o===s.path.length-1?(u[l]=u[l]||{_errors:[]},u[l]._errors.push(n(s))):u[l]=u[l]||{_errors:[]},u=u[l],o++}}};return i(this),r}static assert(e){if(!(e instanceof _r))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Yn.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n=Object.create(null),r=[];for(const i of this.issues)if(i.path.length>0){const a=i.path[0];n[a]=n[a]||[],n[a].push(e(i))}else r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}_r.create=t=>new _r(t);var La;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(La||(La={}));var ee;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(ee||(ee={}));function Yt(t){return new Promise((e,n)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>n(t.error)})}function md(t,e){let n;const r=()=>{if(n)return n;const i=indexedDB.open(t);return i.onupgradeneeded=()=>i.result.createObjectStore(e),n=Yt(i),n.then(a=>{a.onclose=()=>n=void 0},()=>{}),n};return(i,a)=>r().then(s=>a(s.transaction(e,i).objectStore(e)))}let Qr;function Lr(){return Qr||(Qr=md("keyval-store","keyval")),Qr}function Qi(t,e=Lr()){return e("readonly",n=>Yt(n.get(t)))}function Dn(t,e,n=Lr()){return n("readwrite",r=>(r.put(e,t),Yt(r.transaction)))}function Lu(t,e=Lr()){return e("readwrite",n=>(n.delete(t),Yt(n.transaction)))}function gd(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},Yt(t.transaction)}function Du(t=Lr()){return t("readonly",e=>{if(e.getAll&&e.getAllKeys)return Promise.all([Yt(e.getAllKeys()),Yt(e.getAll())]).then(([r,i])=>r.map((a,s)=>[a,i[s]]));const n=[];return t("readonly",r=>gd(r,i=>n.push([i.key,i.value])).then(()=>n))})}async function Ed(t,e){const n=`${t}:threads:${e}`;return await Qi(n)??null}async function bd(t){const e=`${t}:threads:`;return(await Du()).filter(([i])=>typeof i=="string"&&i.startsWith(e)).map(([,i])=>i).filter(i=>!i.hidden).sort((i,a)=>String(a.updated_at).localeCompare(String(i.updated_at)))}function vu(t,e){const n=`${t}:messages:`;return Du().then(r=>r.filter(([a])=>typeof a=="string"&&a.startsWith(n)).map(([,a])=>a).filter(a=>a.metadata?.thread_id===e||a.threadId===e).sort((a,s)=>{const u=a.metadata?.created_at||a.createdAt||"",o=s.metadata?.created_at||s.createdAt||"";return String(u).localeCompare(String(o))}))}function s_(t){const e=W.c(14),{locator:n}=Dt(),r=t?.gatewayId;let i;e[0]!==r||e[1]!==n?(i=Me.threads(n),e[0]=r,e[1]=n,e[2]=i):i=e[2];let a;e[3]!==r||e[4]!==n?(a=async()=>await bd(n),e[3]=r,e[4]=n,e[5]=a):a=e[5];let s;e[6]!==i||e[7]!==a?(s={queryKey:i,queryFn:a,staleTime:3e4},e[6]=i,e[7]=a,e[8]=s):s=e[8];const{data:u,refetch:o}=Yi(s);let l;e[9]!==u?(l=u??[],e[9]=u,e[10]=l):l=e[10];let d;return e[11]!==o||e[12]!==l?(d={threads:l,refetch:o},e[11]=o,e[12]=l,e[13]=d):d=e[13],d}function Td(t){const e=W.c(11),{locator:n}=Dt();let r;e[0]!==n||e[1]!==t?(r=Me.threadMessages(n,t),e[0]=n,e[1]=t,e[2]=r):r=e[2];let i;e[3]!==n||e[4]!==t?(i=()=>vu(n,t),e[3]=n,e[4]=t,e[5]=i):i=e[5];let a;e[6]!==r||e[7]!==i?(a={queryKey:r,queryFn:i,staleTime:3e4},e[6]=r,e[7]=i,e[8]=a):a=e[8];const{data:s}=Yi(a);let u;return e[9]!==s?(u=s??[],e[9]=s,e[10]=u):u=e[10],u}function Gi(){const t=W.c(28),{locator:e}=Dt(),n=$i();let r;t[0]!==e?(r=async y=>{const T=`${e}:threads:${y.id}`;return await Dn(T,y),y},t[0]=e,t[1]=r):r=t[1];let i;t[2]!==e||t[3]!==n?(i=y=>{n.invalidateQueries({queryKey:Me.threads(e)}),y.gatewayId&&n.invalidateQueries({queryKey:Me.gatewayThreads(e,y.gatewayId)})},t[2]=e,t[3]=n,t[4]=i):i=t[4];let a;t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7];const s=jt(a);let u;t[8]!==e?(u=async y=>{const{id:T,updates:I}=y,E=`${e}:threads:${T}`,R=await Qi(E);if(!R)throw new Error(`Thread ${T} not found`);const O={...R,...I};return await Dn(E,O),O},t[8]=e,t[9]=u):u=t[9];let o;t[10]!==e||t[11]!==n?(o=y=>{n.invalidateQueries({queryKey:Me.threads(e)}),n.invalidateQueries({queryKey:Me.thread(e,y.id)}),y.gatewayId&&n.invalidateQueries({queryKey:Me.gatewayThreads(e,y.gatewayId)})},t[10]=e,t[11]=n,t[12]=o):o=t[12];let l;t[13]!==u||t[14]!==o?(l={mutationFn:u,onSuccess:o},t[13]=u,t[14]=o,t[15]=l):l=t[15];const d=jt(l);let f;t[16]!==e?(f=async y=>{const T=`${e}:threads:${y}`;return await Lu(T),y},t[16]=e,t[17]=f):f=t[17];let p;t[18]!==e||t[19]!==n?(p=()=>{n.invalidateQueries({queryKey:Me.threads(e)})},t[18]=e,t[19]=n,t[20]=p):p=t[20];let h;t[21]!==f||t[22]!==p?(h={mutationFn:f,onSuccess:p},t[21]=f,t[22]=p,t[23]=h):h=t[23];const g=jt(h);let _;return t[24]!==g||t[25]!==s||t[26]!==d?(_={insert:s,update:d,delete:g},t[24]=g,t[25]=s,t[26]=d,t[27]=_):_=t[27],_}function Pu(){const t=W.c(37),{locator:e}=Dt(),n=$i();let r;t[0]!==e?(r=async R=>{const O=`${e}:messages:${R.id}`;return await Dn(O,R),R},t[0]=e,t[1]=r):r=t[1];let i;t[2]!==e||t[3]!==n?(i=R=>{const O=R.metadata?.thread_id||R.threadId;O&&n.invalidateQueries({queryKey:Me.threadMessages(e,O)}),n.invalidateQueries({queryKey:Me.messages(e)})},t[2]=e,t[3]=n,t[4]=i):i=t[4];let a;t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7];const s=jt(a);let u;t[8]!==e?(u=async R=>(await Promise.all(R.map(O=>{const S=`${e}:messages:${O.id}`;return Dn(S,O)})),R),t[8]=e,t[9]=u):u=t[9];let o;t[10]!==e||t[11]!==n?(o=R=>{const O=new Set;for(const S of R){const v=S.metadata?.thread_id||S.threadId;v&&O.add(v)}for(const S of O)n.invalidateQueries({queryKey:Me.threadMessages(e,S)});n.invalidateQueries({queryKey:Me.messages(e)})},t[10]=e,t[11]=n,t[12]=o):o=t[12];let l;t[13]!==u||t[14]!==o?(l={mutationFn:u,onSuccess:o},t[13]=u,t[14]=o,t[15]=l):l=t[15];const d=jt(l);let f;t[16]!==e?(f=async R=>{const{id:O,updates:S}=R,v=`${e}:messages:${O}`,B=await Qi(v);if(!B)throw new Error(`Message ${O} not found`);const z={...B,...S};return await Dn(v,z),z},t[16]=e,t[17]=f):f=t[17];let p;t[18]!==e||t[19]!==n?(p=R=>{const O=R.metadata?.thread_id||R.threadId;O&&n.invalidateQueries({queryKey:Me.threadMessages(e,O)}),n.invalidateQueries({queryKey:Me.messages(e)})},t[18]=e,t[19]=n,t[20]=p):p=t[20];let h;t[21]!==f||t[22]!==p?(h={mutationFn:f,onSuccess:p},t[21]=f,t[22]=p,t[23]=h):h=t[23];const g=jt(h);let _;t[24]!==e?(_=async R=>{const O=`${e}:messages:${R}`;return await Lu(O),R},t[24]=e,t[25]=_):_=t[25];let y;t[26]!==e||t[27]!==n?(y=()=>{n.invalidateQueries({queryKey:Me.messages(e)})},t[26]=e,t[27]=n,t[28]=y):y=t[28];let T;t[29]!==y||t[30]!==_?(T={mutationFn:_,onSuccess:y},t[29]=y,t[30]=_,t[31]=T):T=t[31];const I=jt(T);let E;return t[32]!==I||t[33]!==s||t[34]!==d||t[35]!==g?(E={insert:s,insertMany:d,update:g,delete:I},t[32]=I,t[33]=s,t[34]=d,t[35]=g,t[36]=E):E=t[36],E}function u_(){const t=W.c(5),e=$i(),{org:n}=Dt();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},t[0]=r):r=t[0];const i=yc(r);let a;return t[1]!==n||t[2]!==i||t[3]!==e?(a=s=>{const o=s.toolCall.toolName.match(/^COLLECTION_([A-Z_]+)_(CREATE|UPDATE|DELETE)$/);if(!o||!o[1])return;const l=o[1],d=i.connectionId;if(!d)return;e.invalidateQueries({queryKey:Me.collection(n.slug,d,l)});const f=l.toLowerCase().replace(/_/g," ");Ei.success(`${f} updated`)},t[1]=n,t[2]=i,t[3]=e,t[4]=a):a=t[4],a}var Mu="vercel.ai.error",xd=Symbol.for(Mu),Da,va,Lt=class Bu extends(va=Error,Da=xd,va){constructor({name:e,message:n,cause:r}){super(n),this[Da]=!0,this.name=e,this.cause=r}static isInstance(e){return Bu.hasMarker(e,Mu)}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}};function Fu(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var Uu="AI_InvalidArgumentError",Hu=`vercel.ai.error.${Uu}`,_d=Symbol.for(Hu),Pa,Ma,yd=class extends(Ma=Lt,Pa=_d,Ma){constructor({message:t,cause:e,argument:n}){super({name:Uu,message:t,cause:e}),this[Pa]=!0,this.argument=n}static isInstance(t){return Lt.hasMarker(t,Hu)}},ju="AI_JSONParseError",zu=`vercel.ai.error.${ju}`,Ad=Symbol.for(zu),Ba,Fa,Ua=class extends(Fa=Lt,Ba=Ad,Fa){constructor({text:t,cause:e}){super({name:ju,message:`JSON parsing failed: Text: ${t}.
|
|
3
|
+
Error message: ${Fu(e)}`,cause:e}),this[Ba]=!0,this.text=t}static isInstance(t){return Lt.hasMarker(t,zu)}},$u="AI_TypeValidationError",Yu=`vercel.ai.error.${$u}`,kd=Symbol.for(Yu),Ha,ja,un=class bi extends(ja=Lt,Ha=kd,ja){constructor({value:e,cause:n}){super({name:$u,message:`Type validation failed: Value: ${JSON.stringify(e)}.
|
|
4
|
+
Error message: ${Fu(n)}`,cause:n}),this[Ha]=!0,this.value=e}static isInstance(e){return Lt.hasMarker(e,Yu)}static wrap({value:e,cause:n}){return bi.isInstance(n)&&n.value===e?n:new bi({value:e,cause:n})}},Kn=({prefix:t,size:e=16,alphabet:n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const i=()=>{const a=n.length,s=new Array(e);for(let u=0;u<e;u++)s[u]=n[Math.random()*a|0];return s.join("")};if(t==null)return i;if(n.includes(r))throw new yd({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${n}".`});return()=>`${t}${r}${i()}`},Cd=Kn();function za(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 Ht(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 $a(t,...e){const n=new Headers(Ht(t)),r=n.get("user-agent")||"";return n.set("user-agent",[r,...e].filter(Boolean).join(" ")),Object.fromEntries(n.entries())}var Id=/"__proto__"\s*:/,Sd=/"constructor"\s*:/;function Ya(t){const e=JSON.parse(t);return e===null||typeof e!="object"||Id.test(t)===!1&&Sd.test(t)===!1?e:Nd(e)}function Nd(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 a=r[i];a&&typeof a=="object"&&e.push(a)}}}return t}function wd(t){const{stackTraceLimit:e}=Error;try{Error.stackTraceLimit=0}catch{return Ya(t)}try{return Ya(t)}finally{Error.stackTraceLimit=e}}function qu(t){if(t.type==="object"||Array.isArray(t.type)&&t.type.includes("object")){t.additionalProperties=!1;const{properties:n}=t;if(n!=null)for(const r of Object.keys(n))n[r]=Ft(n[r])}t.items!=null&&(t.items=Array.isArray(t.items)?t.items.map(Ft):Ft(t.items)),t.anyOf!=null&&(t.anyOf=t.anyOf.map(Ft)),t.allOf!=null&&(t.allOf=t.allOf.map(Ft)),t.oneOf!=null&&(t.oneOf=t.oneOf.map(Ft));const{definitions:e}=t;if(e!=null)for(const n of Object.keys(e))e[n]=Ft(e[n]);return t}function Ft(t){return typeof t=="boolean"?t:qu(t)}var Rd=Symbol("Let zodToJsonSchema decide on which parser to use"),qa={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"},Od=t=>typeof t=="string"?{...qa,name:t}:{...qa,...t};function Ke(){return{}}function Ld(t,e){var n,r,i;const a={type:"array"};return(n=t.type)!=null&&n._def&&((i=(r=t.type)==null?void 0:r._def)==null?void 0:i.typeName)!==ee.ZodAny&&(a.items=pe(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&(a.minItems=t.minLength.value),t.maxLength&&(a.maxItems=t.maxLength.value),t.exactLength&&(a.minItems=t.exactLength.value,a.maxItems=t.exactLength.value),a}function Dd(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 vd(){return{type:"boolean"}}function Vu(t,e){return pe(t.type._def,e)}var Pd=(t,e)=>pe(t.innerType._def,e);function Wu(t,e,n){const r=n??e.dateStrategy;if(Array.isArray(r))return{anyOf:r.map((i,a)=>Wu(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 Md(t)}}var Md=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 Bd(t,e){return{...pe(t.innerType._def,e),default:t.defaultValue()}}function Fd(t,e){return e.effectStrategy==="input"?pe(t.schema._def,e):Ke()}function Ud(t){return{type:"string",enum:Array.from(t.values)}}var Hd=t=>"type"in t&&t.type==="string"?!1:"allOf"in t;function jd(t,e){const n=[pe(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),pe(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(i=>!!i),r=[];return n.forEach(i=>{if(Hd(i))r.push(...i.allOf);else{let a=i;if("additionalProperties"in i&&i.additionalProperties===!1){const{additionalProperties:s,...u}=i;a=u}r.push(a)}}),r.length?{allOf:r}:void 0}function zd(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 Gr=void 0,it={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:()=>(Gr===void 0&&(Gr=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Gr),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 Qu(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":at(n,"email",r.message,e);break;case"format:idn-email":at(n,"idn-email",r.message,e);break;case"pattern:zod":He(n,it.email,r.message,e);break}break;case"url":at(n,"uri",r.message,e);break;case"uuid":at(n,"uuid",r.message,e);break;case"regex":He(n,r.regex,r.message,e);break;case"cuid":He(n,it.cuid,r.message,e);break;case"cuid2":He(n,it.cuid2,r.message,e);break;case"startsWith":He(n,RegExp(`^${Xr(r.value,e)}`),r.message,e);break;case"endsWith":He(n,RegExp(`${Xr(r.value,e)}$`),r.message,e);break;case"datetime":at(n,"date-time",r.message,e);break;case"date":at(n,"date",r.message,e);break;case"time":at(n,"time",r.message,e);break;case"duration":at(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":{He(n,RegExp(Xr(r.value,e)),r.message,e);break}case"ip":{r.version!=="v6"&&at(n,"ipv4",r.message,e),r.version!=="v4"&&at(n,"ipv6",r.message,e);break}case"base64url":He(n,it.base64url,r.message,e);break;case"jwt":He(n,it.jwt,r.message,e);break;case"cidr":{r.version!=="v6"&&He(n,it.ipv4Cidr,r.message,e),r.version!=="v4"&&He(n,it.ipv6Cidr,r.message,e);break}case"emoji":He(n,it.emoji(),r.message,e);break;case"ulid":{He(n,it.ulid,r.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{at(n,"binary",r.message,e);break}case"contentEncoding:base64":{n.contentEncoding="base64";break}case"pattern:zod":{He(n,it.base64,r.message,e);break}}break}case"nanoid":He(n,it.nanoid,r.message,e)}return n}function Xr(t,e){return e.patternStrategy==="escape"?Yd(t):t}var $d=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function Yd(t){let e="";for(let n=0;n<t.length;n++)$d.has(t[n])||(e+="\\"),e+=t[n];return e}function at(t,e,n,r){var i;t.format||(i=t.anyOf)!=null&&i.some(a=>a.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 He(t,e,n,r){var i;t.pattern||(i=t.allOf)!=null&&i.some(a=>a.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern}),delete t.pattern),t.allOf.push({pattern:Va(e,r),...n&&r.errorMessages&&{errorMessage:{pattern:n}}})):t.pattern=Va(e,r)}function Va(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 a="",s=!1,u=!1,o=!1;for(let l=0;l<i.length;l++){if(s){a+=i[l],s=!1;continue}if(r.i){if(u){if(i[l].match(/[a-z]/)){o?(a+=i[l],a+=`${i[l-2]}-${i[l]}`.toUpperCase(),o=!1):i[l+1]==="-"&&((n=i[l+2])!=null&&n.match(/[a-z]/))?(a+=i[l],o=!0):a+=`${i[l]}${i[l].toUpperCase()}`;continue}}else if(i[l].match(/[a-z]/)){a+=`[${i[l]}${i[l].toUpperCase()}]`;continue}}if(r.m){if(i[l]==="^"){a+=`(^|(?<=[\r
|
|
5
5
|
]))`;continue}else if(i[l]==="$"){a+=`($|(?=[\r
|
|
6
6
|
]))`;continue}}if(r.s&&i[l]==="."){a+=u?`${i[l]}\r
|
|
7
7
|
`:`[${i[l]}\r
|
|
8
|
-
]`;continue}a+=i[l],i[l]==="\\"?s=!0:u&&i[l]==="]"?u=!1:!u&&i[l]==="["&&(u=!0)}try{new RegExp(a)}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 a}function Wu(t,e){var n,r,i,a,s,u;const o={type:"object",additionalProperties:(n=pe(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]}))!=null?n:e.allowedAdditionalProperties};if(((r=t.keyType)==null?void 0:r._def.typeName)===ee.ZodString&&((i=t.keyType._def.checks)!=null&&i.length)){const{type:l,...d}=Vu(t.keyType._def,e);return{...o,propertyNames:d}}else{if(((a=t.keyType)==null?void 0:a._def.typeName)===ee.ZodEnum)return{...o,propertyNames:{enum:t.keyType._def.values}};if(((s=t.keyType)==null?void 0:s._def.typeName)===ee.ZodBranded&&t.keyType._def.type._def.typeName===ee.ZodString&&((u=t.keyType._def.type._def.checks)!=null&&u.length)){const{type:l,...d}=Yu(t.keyType._def,e);return{...o,propertyNames:d}}}return o}function Yd(t,e){if(e.mapStrategy==="record")return Wu(t,e);const n=pe(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||Xe(),r=pe(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||Xe();return{type:"array",maxItems:125,items:{type:"array",items:[n,r],minItems:2,maxItems:2}}}function qd(t){const e=t.values,r=Object.keys(t.values).filter(a=>typeof e[e[a]]!="number").map(a=>e[a]),i=Array.from(new Set(r.map(a=>typeof a)));return{type:i.length===1?i[0]==="string"?"string":"number":["string","number"],enum:r}}function Vd(){return{not:Xe()}}function Wd(){return{type:"null"}}var hi={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function Qd(t,e){const n=t.options instanceof Map?Array.from(t.options.values()):t.options;if(n.every(r=>r._def.typeName in hi&&(!r._def.checks||!r._def.checks.length))){const r=n.reduce((i,a)=>{const s=hi[a._def.typeName];return s&&!i.includes(s)?[...i,s]: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,a)=>{const s=typeof a._def.value;switch(s){case"string":case"number":case"boolean":return[...i,s];case"bigint":return[...i,"integer"];case"object":if(a._def.value===null)return[...i,"null"];default:return i}},[]);if(r.length===n.length){const i=r.filter((a,s,u)=>u.indexOf(a)===s);return{type:i.length>1?i:i[0],enum:n.reduce((a,s)=>a.includes(s._def.value)?a:[...a,s._def.value],[])}}}else if(n.every(r=>r._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((r,i)=>[...r,...i._def.values.filter(a=>!r.includes(a))],[])};return Gd(t,e)}var Gd=(t,e)=>{const n=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((r,i)=>pe(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 Xd(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return{type:[hi[t.innerType._def.typeName],"null"]};const n=pe(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}function Zd(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 Kd(t,e){const n={type:"object",properties:{}},r=[],i=t.shape();for(const s in i){let u=i[s];if(u===void 0||u._def===void 0)continue;const o=ef(u),l=pe(u._def,{...e,currentPath:[...e.currentPath,"properties",s],propertyPath:[...e.currentPath,"properties",s]});l!==void 0&&(n.properties[s]=l,o||r.push(s))}r.length&&(n.required=r);const a=Jd(t,e);return a!==void 0&&(n.additionalProperties=a),n}function Jd(t,e){if(t.catchall._def.typeName!=="ZodNever")return pe(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 ef(t){try{return t.isOptional()}catch{return!0}}var tf=(t,e)=>{var n;if(e.currentPath.toString()===((n=e.propertyPath)==null?void 0:n.toString()))return pe(t.innerType._def,e);const r=pe(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return r?{anyOf:[{not:Xe()},r]}:Xe()},nf=(t,e)=>{if(e.pipeStrategy==="input")return pe(t.in._def,e);if(e.pipeStrategy==="output")return pe(t.out._def,e);const n=pe(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),r=pe(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,r].filter(i=>i!==void 0)}};function rf(t,e){return pe(t.type._def,e)}function af(t,e){const r={type:"array",uniqueItems:!0,items:pe(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 sf(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((n,r)=>pe(n._def,{...e,currentPath:[...e.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[]),additionalItems:pe(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((n,r)=>pe(n._def,{...e,currentPath:[...e.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[])}}function uf(){return{not:Xe()}}function of(){return Xe()}var lf=(t,e)=>pe(t.innerType._def,e),cf=(t,e,n)=>{switch(e){case ee.ZodString:return Vu(t,n);case ee.ZodNumber:return Zd(t);case ee.ZodObject:return Kd(t,n);case ee.ZodBigInt:return Ld(t);case ee.ZodBoolean:return Dd();case ee.ZodDate:return qu(t,n);case ee.ZodUndefined:return uf();case ee.ZodNull:return Wd();case ee.ZodArray:return Od(t,n);case ee.ZodUnion:case ee.ZodDiscriminatedUnion:return Qd(t,n);case ee.ZodIntersection:return Hd(t,n);case ee.ZodTuple:return sf(t,n);case ee.ZodRecord:return Wu(t,n);case ee.ZodLiteral:return jd(t);case ee.ZodEnum:return Fd(t);case ee.ZodNativeEnum:return qd(t);case ee.ZodNullable:return Xd(t,n);case ee.ZodOptional:return tf(t,n);case ee.ZodMap:return Yd(t,n);case ee.ZodSet:return af(t,n);case ee.ZodLazy:return()=>t.getter()._def;case ee.ZodPromise:return rf(t,n);case ee.ZodNaN:case ee.ZodNever:return Vd();case ee.ZodEffects:return Bd(t,n);case ee.ZodAny:return Xe();case ee.ZodUnknown:return of();case ee.ZodDefault:return Md(t,n);case ee.ZodBranded:return Yu(t,n);case ee.ZodReadonly:return lf(t,n);case ee.ZodCatch:return vd(t,n);case ee.ZodPipeline:return nf(t,n);case ee.ZodFunction:case ee.ZodVoid:case ee.ZodSymbol:return;default:return(r=>{})()}},df=(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("/")};function pe(t,e,n=!1){var r;const i=e.seen.get(t);if(e.override){const o=(r=e.override)==null?void 0:r.call(e,t,e,i,n);if(o!==wd)return o}if(i&&!n){const o=ff(i,e);if(o!==void 0)return o}const a={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,a);const s=cf(t,t.typeName,e),u=typeof s=="function"?pe(s(),e):s;if(u&&hf(t,e,u),e.postProcess){const o=e.postProcess(u,t,e);return a.jsonSchema=u,o}return a.jsonSchema=u,u}var ff=(t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:df(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`),Xe()):e.$refStrategy==="seen"?Xe():void 0}},hf=(t,e,n)=>(t.description&&(n.description=t.description),n),pf=t=>{const e=Rd(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}]))}},mf=(t,e)=>{var n;const r=pf(e);let i=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((l,[d,f])=>{var p;return{...l,[d]:(p=pe(f._def,{...r,currentPath:[...r.basePath,r.definitionPath,d]},!0))!=null?p:Xe()}},{}):void 0;const a=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,s=(n=pe(t._def,a===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,a]},!1))!=null?n:Xe(),u=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;u!==void 0&&(s.title=u);const o=a===void 0?i?{...s,[r.definitionPath]:i}:s:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,a].join("/"),[r.definitionPath]:{...i,[a]:s}};return o.$schema="http://json-schema.org/draft-07/schema#",o},pi=Symbol.for("vercel.ai.schema");function gf(t){let e;return()=>(e==null&&(e=t()),e)}function Sr(t,{validate:e}={}){return{[pi]:!0,_type:void 0,get jsonSchema(){return typeof t=="function"&&(t=t()),t},validate:e}}function Ef(t){return typeof t=="object"&&t!==null&&pi in t&&t[pi]===!0&&"jsonSchema"in t&&"validate"in t}function $i(t){return t==null?Sr({properties:{},additionalProperties:!1}):Ef(t)?t:"~standard"in t?t["~standard"].vendor==="zod"?Qu(t):bf(t):t()}function bf(t){return Sr(()=>t["~standard"].jsonSchema.input({target:"draft-07"}),{validate:async e=>{const n=await t["~standard"].validate(e);return"value"in n?{success:!0,value:n.value}:{success:!1,error:new en({value:e,cause:n.issues})}}})}function Tf(t,e){var n;const r=(n=void 0)!=null?n:!1;return Sr(()=>mf(t,{$refStrategy:r?"root":"none"}),{validate:async i=>{const a=await t.safeParseAsync(i);return a.success?{success:!0,value:a.data}:{success:!1,error:a.error}}})}function xf(t,e){var n;const r=(n=void 0)!=null?n:!1;return Sr(()=>$u(kc(t,{target:"draft-7",io:"input",reused:r?"ref":"inline"})),{validate:async i=>{const a=await Ac(t,i);return a.success?{success:!0,value:a.data}:{success:!1,error:a.error}}})}function _f(t){return"_zod"in t}function Qu(t,e){return _f(t)?xf(t):Tf(t)}async function Ya({value:t,schema:e}){const n=await Un({value:t,schema:e});if(!n.success)throw en.wrap({value:t,cause:n.error});return n.value}async function Un({value:t,schema:e}){const n=$i(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:en.wrap({value:t,cause:r.error}),rawValue:t}}catch(r){return{success:!1,error:en.wrap({value:t,cause:r}),rawValue:t}}}async function Ft({text:t,schema:e}){try{const n=Nd(t);return e==null?{success:!0,value:n,rawValue:n}:await Un({value:n,schema:e})}catch(n){return{success:!1,error:Ma.isInstance(n)?n:new Ma({text:t,cause:n}),rawValue:void 0}}}function yf({stream:t,schema:e}){return t.pipeThrough(new TextDecoderStream).pipeThrough(new Lc).pipeThrough(new TransformStream({async transform({data:n},r){n!=="[DONE]"&&r.enqueue(await Ft({text:n,schema:e}))}}))}async function At(t){return typeof t=="function"&&(t=t()),Promise.resolve(t)}var Af=Object.defineProperty,kf=(t,e)=>{for(var n in e)Af(t,n,{get:e[n],enumerable:!0})},Gu="AI_NoObjectGeneratedError",Xu=`vercel.ai.error.${Gu}`,Cf=Symbol.for(Xu),Zu,Ct=class extends It{constructor({message:t="No object generated.",cause:e,text:n,response:r,usage:i,finishReason:a}){super({name:Gu,message:t,cause:e}),this[Zu]=!0,this.text=n,this.response=r,this.usage=i,this.finishReason=a}static isInstance(t){return It.hasMarker(t,Xu)}};Zu=Cf;var qa="6.0.23",Ku=$e([q(),pr(Uint8Array),pr(ArrayBuffer),hu(t=>{var e,n;return(n=(e=globalThis.Buffer)==null?void 0:e.isBuffer(t))!=null?n:!1},{message:"Must be a Buffer"})]),Hn=Cc(()=>$e([Ic(),q(),Sc(),Be(),Bn(q(),Hn.optional()),qn(Hn)])),ue=Bn(q(),Bn(q(),Hn.optional())),Ju=be({type:X("text"),text:q(),providerOptions:ue.optional()}),If=be({type:X("image"),image:$e([Ku,pr(URL)]),mediaType:q().optional(),providerOptions:ue.optional()}),eo=be({type:X("file"),data:$e([Ku,pr(URL)]),filename:q().optional(),mediaType:q(),providerOptions:ue.optional()}),Sf=be({type:X("reasoning"),text:q(),providerOptions:ue.optional()}),Nf=be({type:X("tool-call"),toolCallId:q(),toolName:q(),input:Tt(),providerOptions:ue.optional(),providerExecuted:Be().optional()}),wf=Nc("type",[be({type:X("text"),value:q(),providerOptions:ue.optional()}),be({type:X("json"),value:Hn,providerOptions:ue.optional()}),be({type:X("execution-denied"),reason:q().optional(),providerOptions:ue.optional()}),be({type:X("error-text"),value:q(),providerOptions:ue.optional()}),be({type:X("error-json"),value:Hn,providerOptions:ue.optional()}),be({type:X("content"),value:qn($e([be({type:X("text"),text:q(),providerOptions:ue.optional()}),be({type:X("media"),data:q(),mediaType:q()}),be({type:X("file-data"),data:q(),mediaType:q(),filename:q().optional(),providerOptions:ue.optional()}),be({type:X("file-url"),url:q(),providerOptions:ue.optional()}),be({type:X("file-id"),fileId:$e([q(),Bn(q(),q())]),providerOptions:ue.optional()}),be({type:X("image-data"),data:q(),mediaType:q(),providerOptions:ue.optional()}),be({type:X("image-url"),url:q(),providerOptions:ue.optional()}),be({type:X("image-file-id"),fileId:$e([q(),Bn(q(),q())]),providerOptions:ue.optional()}),be({type:X("custom"),providerOptions:ue.optional()})]))})]),to=be({type:X("tool-result"),toolCallId:q(),toolName:q(),output:wf,providerOptions:ue.optional()}),Rf=be({type:X("tool-approval-request"),approvalId:q(),toolCallId:q()}),Of=be({type:X("tool-approval-response"),approvalId:q(),approved:Be(),reason:q().optional()}),Lf=be({role:X("system"),content:q(),providerOptions:ue.optional()}),Df=be({role:X("user"),content:$e([q(),qn($e([Ju,If,eo]))]),providerOptions:ue.optional()}),vf=be({role:X("assistant"),content:$e([q(),qn($e([Ju,eo,Sf,Nf,to,Rf]))]),providerOptions:ue.optional()}),Pf=be({role:X("tool"),content:qn($e([to,Of])),providerOptions:ue.optional()});$e([Lf,Df,vf,Pf]);function no(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 a=r in t?t[r]:void 0,s=i!==null&&typeof i=="object"&&!Array.isArray(i)&&!(i instanceof Date)&&!(i instanceof RegExp),u=a!=null&&typeof a=="object"&&!Array.isArray(a)&&!(a instanceof Date)&&!(a instanceof RegExp);s&&u?n[r]=no(a,i):n[r]=i}return n}var Mf={};kf(Mf,{array:()=>Hf,choice:()=>jf,json:()=>zf,object:()=>Uf,text:()=>Ff});function Bf(t){const e=["ROOT"];let n=-1,r=null;function i(o,l,d){switch(o){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 a(o,l){switch(o){case",":{e.pop(),e.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{n=l,e.pop();break}}}function s(o,l){switch(o){case",":{e.pop(),e.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=l,e.pop();break}}}for(let o=0;o<t.length;o++){const l=t[o];switch(e[e.length-1]){case"ROOT":i(l,o,"FINISH");break;case"INSIDE_OBJECT_START":{switch(l){case'"':{e.pop(),e.push("INSIDE_OBJECT_KEY");break}case"}":{n=o,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,o,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{a(l,o);break}case"INSIDE_STRING":{switch(l){case'"':{e.pop(),n=o;break}case"\\":{e.push("INSIDE_STRING_ESCAPE");break}default:n=o}break}case"INSIDE_ARRAY_START":{l==="]"?(n=o,e.pop()):(n=o,i(l,o,"INSIDE_ARRAY_AFTER_VALUE"));break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(l){case",":{e.pop(),e.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=o,e.pop();break}default:{n=o;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{i(l,o,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{e.pop(),n=o;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=o;break}case"e":case"E":case"-":case".":break;case",":{e.pop(),e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&s(l,o),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&a(l,o);break}case"}":{e.pop(),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&a(l,o);break}case"]":{e.pop(),e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&s(l,o);break}default:{e.pop();break}}break}case"INSIDE_LITERAL":{const f=t.substring(r,o+1);!"false".startsWith(f)&&!"true".startsWith(f)&&!"null".startsWith(f)?(e.pop(),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?a(l,o):e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&s(l,o)):n=o;break}}}let u=t.slice(0,n+1);for(let o=e.length-1;o>=0;o--)switch(e[o]){case"INSIDE_STRING":{u+='"';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":{u+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{u+="]";break}case"INSIDE_LITERAL":{const d=t.substring(r,t.length);"true".startsWith(d)?u+="true".slice(d.length):"false".startsWith(d)?u+="false".slice(d.length):"null".startsWith(d)&&(u+="null".slice(d.length))}}return u}async function Wn(t){if(t===void 0)return{value:void 0,state:"undefined-input"};let e=await Ft({text:t});return e.success?{value:e.value,state:"successful-parse"}:(e=await Ft({text:Bf(t)}),e.success?{value:e.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}var Ff=()=>({responseFormat:Promise.resolve({type:"text"}),async parseCompleteOutput({text:t}){return t},async parsePartialOutput({text:t}){return{partial:t}}}),Uf=({schema:t,name:e,description:n})=>{const r=$i(t);return{responseFormat:At(r.jsonSchema).then(i=>({type:"json",schema:i,...e!=null&&{name:e},...n!=null&&{description:n}})),async parseCompleteOutput({text:i},a){const s=await Ft({text:i});if(!s.success)throw new Ct({message:"No object generated: could not parse the response.",cause:s.error,text:i,response:a.response,usage:a.usage,finishReason:a.finishReason});const u=await Un({value:s.value,schema:r});if(!u.success)throw new Ct({message:"No object generated: response did not match schema.",cause:u.error,text:i,response:a.response,usage:a.usage,finishReason:a.finishReason});return u.value},async parsePartialOutput({text:i}){const a=await Wn(i);switch(a.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:a.value}}}}},Hf=({element:t,name:e,description:n})=>{const r=$i(t);return{responseFormat:At(r.jsonSchema).then(i=>{const{$schema:a,...s}=i;return{type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{elements:{type:"array",items:s}},required:["elements"],additionalProperties:!1},...e!=null&&{name:e},...n!=null&&{description:n}}}),async parseCompleteOutput({text:i},a){const s=await Ft({text:i});if(!s.success)throw new Ct({message:"No object generated: could not parse the response.",cause:s.error,text:i,response:a.response,usage:a.usage,finishReason:a.finishReason});const u=s.value;if(u==null||typeof u!="object"||!("elements"in u)||!Array.isArray(u.elements))throw new Ct({message:"No object generated: response did not match schema.",cause:new en({value:u,cause:"response must be an object with an elements array"}),text:i,response:a.response,usage:a.usage,finishReason:a.finishReason});for(const o of u.elements){const l=await Un({value:o,schema:r});if(!l.success)throw new Ct({message:"No object generated: response did not match schema.",cause:l.error,text:i,response:a.response,usage:a.usage,finishReason:a.finishReason})}return u.elements},async parsePartialOutput({text:i}){const a=await Wn(i);switch(a.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const s=a.value;if(s==null||typeof s!="object"||!("elements"in s)||!Array.isArray(s.elements))return;const u=a.state==="repaired-parse"&&s.elements.length>0?s.elements.slice(0,-1):s.elements,o=[];for(const l of u){const d=await Un({value:l,schema:r});d.success&&o.push(d.value)}return{partial:o}}}}}},jf=({options:t,name:e,description:n})=>({responseFormat:Promise.resolve({type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{result:{type:"string",enum:t}},required:["result"],additionalProperties:!1},...e!=null&&{name:e},...n!=null&&{description:n}}),async parseCompleteOutput({text:r},i){const a=await Ft({text:r});if(!a.success)throw new Ct({message:"No object generated: could not parse the response.",cause:a.error,text:r,response:i.response,usage:i.usage,finishReason:i.finishReason});const s=a.value;if(s==null||typeof s!="object"||!("result"in s)||typeof s.result!="string"||!t.includes(s.result))throw new Ct({message:"No object generated: response did not match schema.",cause:new en({value:s,cause:"response must be an object that contains a choice value."}),text:r,response:i.response,usage:i.usage,finishReason:i.finishReason});return s.result},async parsePartialOutput({text:r}){const i=await Wn(r);switch(i.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const a=i.value;if(a==null||typeof a!="object"||!("result"in a)||typeof a.result!="string")return;const s=t.filter(u=>u.startsWith(a.result));return i.state==="successful-parse"?s.includes(a.result)?{partial:a.result}:void 0:s.length===1?{partial:s[0]}:void 0}}}}),zf=({name:t,description:e}={})=>({responseFormat:Promise.resolve({type:"json",...t!=null&&{name:t},...e!=null&&{description:e}}),async parseCompleteOutput({text:n},r){const i=await Ft({text:n});if(!i.success)throw new Ct({message:"No object generated: could not parse the response.",cause:i.error,text:n,response:r.response,usage:r.usage,finishReason:r.finishReason});return i.value},async parsePartialOutput({text:n}){const r=await Wn(n);switch(r.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return r.value===void 0?void 0:{partial:r.value}}}});Vn({prefix:"aitxt",size:24});(class extends TransformStream{constructor(){super({transform(t,e){e.enqueue(`data: ${JSON.stringify(t)}
|
|
8
|
+
]`;continue}a+=i[l],i[l]==="\\"?s=!0:u&&i[l]==="]"?u=!1:!u&&i[l]==="["&&(u=!0)}try{new RegExp(a)}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 a}function Gu(t,e){var n,r,i,a,s,u;const o={type:"object",additionalProperties:(n=pe(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]}))!=null?n:e.allowedAdditionalProperties};if(((r=t.keyType)==null?void 0:r._def.typeName)===ee.ZodString&&((i=t.keyType._def.checks)!=null&&i.length)){const{type:l,...d}=Qu(t.keyType._def,e);return{...o,propertyNames:d}}else{if(((a=t.keyType)==null?void 0:a._def.typeName)===ee.ZodEnum)return{...o,propertyNames:{enum:t.keyType._def.values}};if(((s=t.keyType)==null?void 0:s._def.typeName)===ee.ZodBranded&&t.keyType._def.type._def.typeName===ee.ZodString&&((u=t.keyType._def.type._def.checks)!=null&&u.length)){const{type:l,...d}=Vu(t.keyType._def,e);return{...o,propertyNames:d}}}return o}function qd(t,e){if(e.mapStrategy==="record")return Gu(t,e);const n=pe(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||Ke(),r=pe(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||Ke();return{type:"array",maxItems:125,items:{type:"array",items:[n,r],minItems:2,maxItems:2}}}function Vd(t){const e=t.values,r=Object.keys(t.values).filter(a=>typeof e[e[a]]!="number").map(a=>e[a]),i=Array.from(new Set(r.map(a=>typeof a)));return{type:i.length===1?i[0]==="string"?"string":"number":["string","number"],enum:r}}function Wd(){return{not:Ke()}}function Qd(){return{type:"null"}}var Ti={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function Gd(t,e){const n=t.options instanceof Map?Array.from(t.options.values()):t.options;if(n.every(r=>r._def.typeName in Ti&&(!r._def.checks||!r._def.checks.length))){const r=n.reduce((i,a)=>{const s=Ti[a._def.typeName];return s&&!i.includes(s)?[...i,s]: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,a)=>{const s=typeof a._def.value;switch(s){case"string":case"number":case"boolean":return[...i,s];case"bigint":return[...i,"integer"];case"object":if(a._def.value===null)return[...i,"null"];default:return i}},[]);if(r.length===n.length){const i=r.filter((a,s,u)=>u.indexOf(a)===s);return{type:i.length>1?i:i[0],enum:n.reduce((a,s)=>a.includes(s._def.value)?a:[...a,s._def.value],[])}}}else if(n.every(r=>r._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((r,i)=>[...r,...i._def.values.filter(a=>!r.includes(a))],[])};return Xd(t,e)}var Xd=(t,e)=>{const n=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((r,i)=>pe(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 Zd(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return{type:[Ti[t.innerType._def.typeName],"null"]};const n=pe(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}function Kd(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 Jd(t,e){const n={type:"object",properties:{}},r=[],i=t.shape();for(const s in i){let u=i[s];if(u===void 0||u._def===void 0)continue;const o=tf(u),l=pe(u._def,{...e,currentPath:[...e.currentPath,"properties",s],propertyPath:[...e.currentPath,"properties",s]});l!==void 0&&(n.properties[s]=l,o||r.push(s))}r.length&&(n.required=r);const a=ef(t,e);return a!==void 0&&(n.additionalProperties=a),n}function ef(t,e){if(t.catchall._def.typeName!=="ZodNever")return pe(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 tf(t){try{return t.isOptional()}catch{return!0}}var nf=(t,e)=>{var n;if(e.currentPath.toString()===((n=e.propertyPath)==null?void 0:n.toString()))return pe(t.innerType._def,e);const r=pe(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return r?{anyOf:[{not:Ke()},r]}:Ke()},rf=(t,e)=>{if(e.pipeStrategy==="input")return pe(t.in._def,e);if(e.pipeStrategy==="output")return pe(t.out._def,e);const n=pe(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),r=pe(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,r].filter(i=>i!==void 0)}};function af(t,e){return pe(t.type._def,e)}function sf(t,e){const r={type:"array",uniqueItems:!0,items:pe(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 uf(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((n,r)=>pe(n._def,{...e,currentPath:[...e.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[]),additionalItems:pe(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((n,r)=>pe(n._def,{...e,currentPath:[...e.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[])}}function of(){return{not:Ke()}}function lf(){return Ke()}var cf=(t,e)=>pe(t.innerType._def,e),df=(t,e,n)=>{switch(e){case ee.ZodString:return Qu(t,n);case ee.ZodNumber:return Kd(t);case ee.ZodObject:return Jd(t,n);case ee.ZodBigInt:return Dd(t);case ee.ZodBoolean:return vd();case ee.ZodDate:return Wu(t,n);case ee.ZodUndefined:return of();case ee.ZodNull:return Qd();case ee.ZodArray:return Ld(t,n);case ee.ZodUnion:case ee.ZodDiscriminatedUnion:return Gd(t,n);case ee.ZodIntersection:return jd(t,n);case ee.ZodTuple:return uf(t,n);case ee.ZodRecord:return Gu(t,n);case ee.ZodLiteral:return zd(t);case ee.ZodEnum:return Ud(t);case ee.ZodNativeEnum:return Vd(t);case ee.ZodNullable:return Zd(t,n);case ee.ZodOptional:return nf(t,n);case ee.ZodMap:return qd(t,n);case ee.ZodSet:return sf(t,n);case ee.ZodLazy:return()=>t.getter()._def;case ee.ZodPromise:return af(t,n);case ee.ZodNaN:case ee.ZodNever:return Wd();case ee.ZodEffects:return Fd(t,n);case ee.ZodAny:return Ke();case ee.ZodUnknown:return lf();case ee.ZodDefault:return Bd(t,n);case ee.ZodBranded:return Vu(t,n);case ee.ZodReadonly:return cf(t,n);case ee.ZodCatch:return Pd(t,n);case ee.ZodPipeline:return rf(t,n);case ee.ZodFunction:case ee.ZodVoid:case ee.ZodSymbol:return;default:return(r=>{})()}},ff=(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("/")};function pe(t,e,n=!1){var r;const i=e.seen.get(t);if(e.override){const o=(r=e.override)==null?void 0:r.call(e,t,e,i,n);if(o!==Rd)return o}if(i&&!n){const o=hf(i,e);if(o!==void 0)return o}const a={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,a);const s=df(t,t.typeName,e),u=typeof s=="function"?pe(s(),e):s;if(u&&pf(t,e,u),e.postProcess){const o=e.postProcess(u,t,e);return a.jsonSchema=u,o}return a.jsonSchema=u,u}var hf=(t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:ff(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`),Ke()):e.$refStrategy==="seen"?Ke():void 0}},pf=(t,e,n)=>(t.description&&(n.description=t.description),n),mf=t=>{const e=Od(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}]))}},gf=(t,e)=>{var n;const r=mf(e);let i=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((l,[d,f])=>{var p;return{...l,[d]:(p=pe(f._def,{...r,currentPath:[...r.basePath,r.definitionPath,d]},!0))!=null?p:Ke()}},{}):void 0;const a=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,s=(n=pe(t._def,a===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,a]},!1))!=null?n:Ke(),u=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;u!==void 0&&(s.title=u);const o=a===void 0?i?{...s,[r.definitionPath]:i}:s:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,a].join("/"),[r.definitionPath]:{...i,[a]:s}};return o.$schema="http://json-schema.org/draft-07/schema#",o},xi=Symbol.for("vercel.ai.schema");function Ef(t){let e;return()=>(e==null&&(e=t()),e)}function Dr(t,{validate:e}={}){return{[xi]:!0,_type:void 0,get jsonSchema(){return typeof t=="function"&&(t=t()),t},validate:e}}function bf(t){return typeof t=="object"&&t!==null&&xi in t&&t[xi]===!0&&"jsonSchema"in t&&"validate"in t}function Xi(t){return t==null?Dr({properties:{},additionalProperties:!1}):bf(t)?t:"~standard"in t?t["~standard"].vendor==="zod"?Xu(t):Tf(t):t()}function Tf(t){return Dr(()=>t["~standard"].jsonSchema.input({target:"draft-07"}),{validate:async e=>{const n=await t["~standard"].validate(e);return"value"in n?{success:!0,value:n.value}:{success:!1,error:new un({value:e,cause:n.issues})}}})}function xf(t,e){var n;const r=(n=void 0)!=null?n:!1;return Dr(()=>gf(t,{$refStrategy:r?"root":"none"}),{validate:async i=>{const a=await t.safeParseAsync(i);return a.success?{success:!0,value:a.data}:{success:!1,error:a.error}}})}function _f(t,e){var n;const r=(n=void 0)!=null?n:!1;return Dr(()=>qu(kc(t,{target:"draft-7",io:"input",reused:r?"ref":"inline"})),{validate:async i=>{const a=await Ac(t,i);return a.success?{success:!0,value:a.data}:{success:!1,error:a.error}}})}function yf(t){return"_zod"in t}function Xu(t,e){return yf(t)?_f(t):xf(t)}async function Wa({value:t,schema:e}){const n=await qn({value:t,schema:e});if(!n.success)throw un.wrap({value:t,cause:n.error});return n.value}async function qn({value:t,schema:e}){const n=Xi(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:un.wrap({value:t,cause:r.error}),rawValue:t}}catch(r){return{success:!1,error:un.wrap({value:t,cause:r}),rawValue:t}}}async function qt({text:t,schema:e}){try{const n=wd(t);return e==null?{success:!0,value:n,rawValue:n}:await qn({value:n,schema:e})}catch(n){return{success:!1,error:Ua.isInstance(n)?n:new Ua({text:t,cause:n}),rawValue:void 0}}}function Af({stream:t,schema:e}){return t.pipeThrough(new TextDecoderStream).pipeThrough(new Dc).pipeThrough(new TransformStream({async transform({data:n},r){n!=="[DONE]"&&r.enqueue(await qt({text:n,schema:e}))}}))}async function wt(t){return typeof t=="function"&&(t=t()),Promise.resolve(t)}var kf=Object.defineProperty,Cf=(t,e)=>{for(var n in e)kf(t,n,{get:e[n],enumerable:!0})},Zu="AI_NoObjectGeneratedError",Ku=`vercel.ai.error.${Zu}`,If=Symbol.for(Ku),Ju,Ot=class extends Lt{constructor({message:t="No object generated.",cause:e,text:n,response:r,usage:i,finishReason:a}){super({name:Zu,message:t,cause:e}),this[Ju]=!0,this.text=n,this.response=r,this.usage=i,this.finishReason=a}static isInstance(t){return Lt.hasMarker(t,Ku)}};Ju=If;var Qa="6.0.23",eo=Ve([Y(),xr(Uint8Array),xr(ArrayBuffer),gu(t=>{var e,n;return(n=(e=globalThis.Buffer)==null?void 0:e.isBuffer(t))!=null?n:!1},{message:"Must be a Buffer"})]),Vn=Cc(()=>Ve([Ic(),Y(),Sc(),je(),$n(Y(),Vn.optional()),Zn(Vn)])),ue=$n(Y(),$n(Y(),Vn.optional())),to=Ee({type:G("text"),text:Y(),providerOptions:ue.optional()}),Sf=Ee({type:G("image"),image:Ve([eo,xr(URL)]),mediaType:Y().optional(),providerOptions:ue.optional()}),no=Ee({type:G("file"),data:Ve([eo,xr(URL)]),filename:Y().optional(),mediaType:Y(),providerOptions:ue.optional()}),Nf=Ee({type:G("reasoning"),text:Y(),providerOptions:ue.optional()}),wf=Ee({type:G("tool-call"),toolCallId:Y(),toolName:Y(),input:Ct(),providerOptions:ue.optional(),providerExecuted:je().optional()}),Rf=Nc("type",[Ee({type:G("text"),value:Y(),providerOptions:ue.optional()}),Ee({type:G("json"),value:Vn,providerOptions:ue.optional()}),Ee({type:G("execution-denied"),reason:Y().optional(),providerOptions:ue.optional()}),Ee({type:G("error-text"),value:Y(),providerOptions:ue.optional()}),Ee({type:G("error-json"),value:Vn,providerOptions:ue.optional()}),Ee({type:G("content"),value:Zn(Ve([Ee({type:G("text"),text:Y(),providerOptions:ue.optional()}),Ee({type:G("media"),data:Y(),mediaType:Y()}),Ee({type:G("file-data"),data:Y(),mediaType:Y(),filename:Y().optional(),providerOptions:ue.optional()}),Ee({type:G("file-url"),url:Y(),providerOptions:ue.optional()}),Ee({type:G("file-id"),fileId:Ve([Y(),$n(Y(),Y())]),providerOptions:ue.optional()}),Ee({type:G("image-data"),data:Y(),mediaType:Y(),providerOptions:ue.optional()}),Ee({type:G("image-url"),url:Y(),providerOptions:ue.optional()}),Ee({type:G("image-file-id"),fileId:Ve([Y(),$n(Y(),Y())]),providerOptions:ue.optional()}),Ee({type:G("custom"),providerOptions:ue.optional()})]))})]),ro=Ee({type:G("tool-result"),toolCallId:Y(),toolName:Y(),output:Rf,providerOptions:ue.optional()}),Of=Ee({type:G("tool-approval-request"),approvalId:Y(),toolCallId:Y()}),Lf=Ee({type:G("tool-approval-response"),approvalId:Y(),approved:je(),reason:Y().optional()}),Df=Ee({role:G("system"),content:Y(),providerOptions:ue.optional()}),vf=Ee({role:G("user"),content:Ve([Y(),Zn(Ve([to,Sf,no]))]),providerOptions:ue.optional()}),Pf=Ee({role:G("assistant"),content:Ve([Y(),Zn(Ve([to,no,Nf,wf,ro,Of]))]),providerOptions:ue.optional()}),Mf=Ee({role:G("tool"),content:Zn(Ve([ro,Lf])),providerOptions:ue.optional()});Ve([Df,vf,Pf,Mf]);function io(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 a=r in t?t[r]:void 0,s=i!==null&&typeof i=="object"&&!Array.isArray(i)&&!(i instanceof Date)&&!(i instanceof RegExp),u=a!=null&&typeof a=="object"&&!Array.isArray(a)&&!(a instanceof Date)&&!(a instanceof RegExp);s&&u?n[r]=io(a,i):n[r]=i}return n}var Bf={};Cf(Bf,{array:()=>jf,choice:()=>zf,json:()=>$f,object:()=>Hf,text:()=>Uf});function Ff(t){const e=["ROOT"];let n=-1,r=null;function i(o,l,d){switch(o){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 a(o,l){switch(o){case",":{e.pop(),e.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{n=l,e.pop();break}}}function s(o,l){switch(o){case",":{e.pop(),e.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=l,e.pop();break}}}for(let o=0;o<t.length;o++){const l=t[o];switch(e[e.length-1]){case"ROOT":i(l,o,"FINISH");break;case"INSIDE_OBJECT_START":{switch(l){case'"':{e.pop(),e.push("INSIDE_OBJECT_KEY");break}case"}":{n=o,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,o,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{a(l,o);break}case"INSIDE_STRING":{switch(l){case'"':{e.pop(),n=o;break}case"\\":{e.push("INSIDE_STRING_ESCAPE");break}default:n=o}break}case"INSIDE_ARRAY_START":{l==="]"?(n=o,e.pop()):(n=o,i(l,o,"INSIDE_ARRAY_AFTER_VALUE"));break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(l){case",":{e.pop(),e.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=o,e.pop();break}default:{n=o;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{i(l,o,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{e.pop(),n=o;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=o;break}case"e":case"E":case"-":case".":break;case",":{e.pop(),e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&s(l,o),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&a(l,o);break}case"}":{e.pop(),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&a(l,o);break}case"]":{e.pop(),e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&s(l,o);break}default:{e.pop();break}}break}case"INSIDE_LITERAL":{const f=t.substring(r,o+1);!"false".startsWith(f)&&!"true".startsWith(f)&&!"null".startsWith(f)?(e.pop(),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?a(l,o):e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&s(l,o)):n=o;break}}}let u=t.slice(0,n+1);for(let o=e.length-1;o>=0;o--)switch(e[o]){case"INSIDE_STRING":{u+='"';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":{u+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{u+="]";break}case"INSIDE_LITERAL":{const d=t.substring(r,t.length);"true".startsWith(d)?u+="true".slice(d.length):"false".startsWith(d)?u+="false".slice(d.length):"null".startsWith(d)&&(u+="null".slice(d.length))}}return u}async function Jn(t){if(t===void 0)return{value:void 0,state:"undefined-input"};let e=await qt({text:t});return e.success?{value:e.value,state:"successful-parse"}:(e=await qt({text:Ff(t)}),e.success?{value:e.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}var Uf=()=>({responseFormat:Promise.resolve({type:"text"}),async parseCompleteOutput({text:t}){return t},async parsePartialOutput({text:t}){return{partial:t}}}),Hf=({schema:t,name:e,description:n})=>{const r=Xi(t);return{responseFormat:wt(r.jsonSchema).then(i=>({type:"json",schema:i,...e!=null&&{name:e},...n!=null&&{description:n}})),async parseCompleteOutput({text:i},a){const s=await qt({text:i});if(!s.success)throw new Ot({message:"No object generated: could not parse the response.",cause:s.error,text:i,response:a.response,usage:a.usage,finishReason:a.finishReason});const u=await qn({value:s.value,schema:r});if(!u.success)throw new Ot({message:"No object generated: response did not match schema.",cause:u.error,text:i,response:a.response,usage:a.usage,finishReason:a.finishReason});return u.value},async parsePartialOutput({text:i}){const a=await Jn(i);switch(a.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:a.value}}}}},jf=({element:t,name:e,description:n})=>{const r=Xi(t);return{responseFormat:wt(r.jsonSchema).then(i=>{const{$schema:a,...s}=i;return{type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{elements:{type:"array",items:s}},required:["elements"],additionalProperties:!1},...e!=null&&{name:e},...n!=null&&{description:n}}}),async parseCompleteOutput({text:i},a){const s=await qt({text:i});if(!s.success)throw new Ot({message:"No object generated: could not parse the response.",cause:s.error,text:i,response:a.response,usage:a.usage,finishReason:a.finishReason});const u=s.value;if(u==null||typeof u!="object"||!("elements"in u)||!Array.isArray(u.elements))throw new Ot({message:"No object generated: response did not match schema.",cause:new un({value:u,cause:"response must be an object with an elements array"}),text:i,response:a.response,usage:a.usage,finishReason:a.finishReason});for(const o of u.elements){const l=await qn({value:o,schema:r});if(!l.success)throw new Ot({message:"No object generated: response did not match schema.",cause:l.error,text:i,response:a.response,usage:a.usage,finishReason:a.finishReason})}return u.elements},async parsePartialOutput({text:i}){const a=await Jn(i);switch(a.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const s=a.value;if(s==null||typeof s!="object"||!("elements"in s)||!Array.isArray(s.elements))return;const u=a.state==="repaired-parse"&&s.elements.length>0?s.elements.slice(0,-1):s.elements,o=[];for(const l of u){const d=await qn({value:l,schema:r});d.success&&o.push(d.value)}return{partial:o}}}}}},zf=({options:t,name:e,description:n})=>({responseFormat:Promise.resolve({type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{result:{type:"string",enum:t}},required:["result"],additionalProperties:!1},...e!=null&&{name:e},...n!=null&&{description:n}}),async parseCompleteOutput({text:r},i){const a=await qt({text:r});if(!a.success)throw new Ot({message:"No object generated: could not parse the response.",cause:a.error,text:r,response:i.response,usage:i.usage,finishReason:i.finishReason});const s=a.value;if(s==null||typeof s!="object"||!("result"in s)||typeof s.result!="string"||!t.includes(s.result))throw new Ot({message:"No object generated: response did not match schema.",cause:new un({value:s,cause:"response must be an object that contains a choice value."}),text:r,response:i.response,usage:i.usage,finishReason:i.finishReason});return s.result},async parsePartialOutput({text:r}){const i=await Jn(r);switch(i.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const a=i.value;if(a==null||typeof a!="object"||!("result"in a)||typeof a.result!="string")return;const s=t.filter(u=>u.startsWith(a.result));return i.state==="successful-parse"?s.includes(a.result)?{partial:a.result}:void 0:s.length===1?{partial:s[0]}:void 0}}}}),$f=({name:t,description:e}={})=>({responseFormat:Promise.resolve({type:"json",...t!=null&&{name:t},...e!=null&&{description:e}}),async parseCompleteOutput({text:n},r){const i=await qt({text:n});if(!i.success)throw new Ot({message:"No object generated: could not parse the response.",cause:i.error,text:n,response:r.response,usage:r.usage,finishReason:r.finishReason});return i.value},async parsePartialOutput({text:n}){const r=await Jn(n);switch(r.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return r.value===void 0?void 0:{partial:r.value}}}});Kn({prefix:"aitxt",size:24});(class extends TransformStream{constructor(){super({transform(t,e){e.enqueue(`data: ${JSON.stringify(t)}
|
|
9
9
|
|
|
10
10
|
`)},flush(t){t.enqueue(`data: [DONE]
|
|
11
11
|
|
|
12
|
-
`)}})}});var $f=gf(()=>Qu($e([ye({type:X("text-start"),id:q(),providerMetadata:ue.optional()}),ye({type:X("text-delta"),id:q(),delta:q(),providerMetadata:ue.optional()}),ye({type:X("text-end"),id:q(),providerMetadata:ue.optional()}),ye({type:X("error"),errorText:q()}),ye({type:X("tool-input-start"),toolCallId:q(),toolName:q(),providerExecuted:Be().optional(),dynamic:Be().optional(),title:q().optional()}),ye({type:X("tool-input-delta"),toolCallId:q(),inputTextDelta:q()}),ye({type:X("tool-input-available"),toolCallId:q(),toolName:q(),input:Tt(),providerExecuted:Be().optional(),providerMetadata:ue.optional(),dynamic:Be().optional(),title:q().optional()}),ye({type:X("tool-input-error"),toolCallId:q(),toolName:q(),input:Tt(),providerExecuted:Be().optional(),providerMetadata:ue.optional(),dynamic:Be().optional(),errorText:q(),title:q().optional()}),ye({type:X("tool-approval-request"),approvalId:q(),toolCallId:q()}),ye({type:X("tool-output-available"),toolCallId:q(),output:Tt(),providerExecuted:Be().optional(),dynamic:Be().optional(),preliminary:Be().optional()}),ye({type:X("tool-output-error"),toolCallId:q(),errorText:q(),providerExecuted:Be().optional(),dynamic:Be().optional()}),ye({type:X("tool-output-denied"),toolCallId:q()}),ye({type:X("reasoning-start"),id:q(),providerMetadata:ue.optional()}),ye({type:X("reasoning-delta"),id:q(),delta:q(),providerMetadata:ue.optional()}),ye({type:X("reasoning-end"),id:q(),providerMetadata:ue.optional()}),ye({type:X("source-url"),sourceId:q(),url:q(),title:q().optional(),providerMetadata:ue.optional()}),ye({type:X("source-document"),sourceId:q(),mediaType:q(),title:q(),filename:q().optional(),providerMetadata:ue.optional()}),ye({type:X("file"),url:q(),mediaType:q(),providerMetadata:ue.optional()}),ye({type:hu(t=>typeof t=="string"&&t.startsWith("data-"),{message:'Type must start with "data-"'}),id:q().optional(),data:Tt(),transient:Be().optional()}),ye({type:X("start-step")}),ye({type:X("finish-step")}),ye({type:X("start"),messageId:q().optional(),messageMetadata:Tt().optional()}),ye({type:X("finish"),finishReason:wc(["stop","length","content-filter","tool-calls","error","other"]).optional(),messageMetadata:Tt().optional()}),ye({type:X("abort"),reason:q().optional()}),ye({type:X("message-metadata"),messageMetadata:Tt()})])));function Yf(t){return t.type.startsWith("data-")}function mi(t){return t.type.startsWith("tool-")}function qf(t){return t.type==="dynamic-tool"}function gi(t){return mi(t)||qf(t)}function Va(t){return t.type.split("-").slice(1).join("-")}function Vf({lastMessage:t,messageId:e}){return{message:t?.role==="assistant"?t:{id:e,metadata:void 0,role:"assistant",parts:[]},activeTextParts:{},activeReasoningParts:{},partialToolCalls:{}}}function Wf({stream:t,messageMetadataSchema:e,dataPartSchemas:n,runUpdateMessageJob:r,onError:i,onToolCall:a,onData:s}){return t.pipeThrough(new TransformStream({async transform(u,o){await r(async({state:l,write:d})=>{var f,p,h,g;function _(E){const O=l.message.parts.filter(gi).find(I=>I.toolCallId===E);if(O==null)throw new Error(`no tool invocation found for tool call ${E}`);return O}function y(E){var R;const O=l.message.parts.find(B=>mi(B)&&B.toolCallId===E.toolCallId),I=E,v=O;O!=null?(O.state=E.state,v.input=I.input,v.output=I.output,v.errorText=I.errorText,v.rawInput=I.rawInput,v.preliminary=I.preliminary,E.title!==void 0&&(v.title=E.title),v.providerExecuted=(R=I.providerExecuted)!=null?R:O.providerExecuted,I.providerMetadata!=null&&O.state==="input-available"&&(O.callProviderMetadata=I.providerMetadata)):l.message.parts.push({type:`tool-${E.toolName}`,toolCallId:E.toolCallId,state:E.state,title:E.title,input:I.input,output:I.output,rawInput:I.rawInput,errorText:I.errorText,providerExecuted:I.providerExecuted,preliminary:I.preliminary,...I.providerMetadata!=null?{callProviderMetadata:I.providerMetadata}:{}})}function T(E){var R,O;const I=l.message.parts.find(z=>z.type==="dynamic-tool"&&z.toolCallId===E.toolCallId),v=E,B=I;I!=null?(I.state=E.state,B.toolName=E.toolName,B.input=v.input,B.output=v.output,B.errorText=v.errorText,B.rawInput=(R=v.rawInput)!=null?R:B.rawInput,B.preliminary=v.preliminary,E.title!==void 0&&(B.title=E.title),B.providerExecuted=(O=v.providerExecuted)!=null?O:I.providerExecuted,v.providerMetadata!=null&&I.state==="input-available"&&(I.callProviderMetadata=v.providerMetadata)):l.message.parts.push({type:"dynamic-tool",toolName:E.toolName,toolCallId:E.toolCallId,state:E.state,input:v.input,output:v.output,errorText:v.errorText,preliminary:v.preliminary,providerExecuted:v.providerExecuted,title:E.title,...v.providerMetadata!=null?{callProviderMetadata:v.providerMetadata}:{}})}async function S(E){if(E!=null){const R=l.message.metadata!=null?no(l.message.metadata,E):E;e!=null&&await Ya({value:R,schema:e}),l.message.metadata=R}}switch(u.type){case"text-start":{const E={type:"text",text:"",providerMetadata:u.providerMetadata,state:"streaming"};l.activeTextParts[u.id]=E,l.message.parts.push(E),d();break}case"text-delta":{const E=l.activeTextParts[u.id];E.text+=u.delta,E.providerMetadata=(f=u.providerMetadata)!=null?f:E.providerMetadata,d();break}case"text-end":{const E=l.activeTextParts[u.id];E.state="done",E.providerMetadata=(p=u.providerMetadata)!=null?p:E.providerMetadata,delete l.activeTextParts[u.id],d();break}case"reasoning-start":{const E={type:"reasoning",text:"",providerMetadata:u.providerMetadata,state:"streaming"};l.activeReasoningParts[u.id]=E,l.message.parts.push(E),d();break}case"reasoning-delta":{const E=l.activeReasoningParts[u.id];E.text+=u.delta,E.providerMetadata=(h=u.providerMetadata)!=null?h:E.providerMetadata,d();break}case"reasoning-end":{const E=l.activeReasoningParts[u.id];E.providerMetadata=(g=u.providerMetadata)!=null?g:E.providerMetadata,E.state="done",delete l.activeReasoningParts[u.id],d();break}case"file":{l.message.parts.push({type:"file",mediaType:u.mediaType,url:u.url}),d();break}case"source-url":{l.message.parts.push({type:"source-url",sourceId:u.sourceId,url:u.url,title:u.title,providerMetadata:u.providerMetadata}),d();break}case"source-document":{l.message.parts.push({type:"source-document",sourceId:u.sourceId,mediaType:u.mediaType,title:u.title,filename:u.filename,providerMetadata:u.providerMetadata}),d();break}case"tool-input-start":{const E=l.message.parts.filter(mi);l.partialToolCalls[u.toolCallId]={text:"",toolName:u.toolName,index:E.length,dynamic:u.dynamic,title:u.title},u.dynamic?T({toolCallId:u.toolCallId,toolName:u.toolName,state:"input-streaming",input:void 0,providerExecuted:u.providerExecuted,title:u.title}):y({toolCallId:u.toolCallId,toolName:u.toolName,state:"input-streaming",input:void 0,providerExecuted:u.providerExecuted,title:u.title}),d();break}case"tool-input-delta":{const E=l.partialToolCalls[u.toolCallId];E.text+=u.inputTextDelta;const{value:R}=await Wn(E.text);E.dynamic?T({toolCallId:u.toolCallId,toolName:E.toolName,state:"input-streaming",input:R,title:E.title}):y({toolCallId:u.toolCallId,toolName:E.toolName,state:"input-streaming",input:R,title:E.title}),d();break}case"tool-input-available":{u.dynamic?T({toolCallId:u.toolCallId,toolName:u.toolName,state:"input-available",input:u.input,providerExecuted:u.providerExecuted,providerMetadata:u.providerMetadata,title:u.title}):y({toolCallId:u.toolCallId,toolName:u.toolName,state:"input-available",input:u.input,providerExecuted:u.providerExecuted,providerMetadata:u.providerMetadata,title:u.title}),d(),a&&!u.providerExecuted&&await a({toolCall:u});break}case"tool-input-error":{u.dynamic?T({toolCallId:u.toolCallId,toolName:u.toolName,state:"output-error",input:u.input,errorText:u.errorText,providerExecuted:u.providerExecuted,providerMetadata:u.providerMetadata}):y({toolCallId:u.toolCallId,toolName:u.toolName,state:"output-error",input:void 0,rawInput:u.input,errorText:u.errorText,providerExecuted:u.providerExecuted,providerMetadata:u.providerMetadata}),d();break}case"tool-approval-request":{const E=_(u.toolCallId);E.state="approval-requested",E.approval={id:u.approvalId},d();break}case"tool-output-denied":{const E=_(u.toolCallId);E.state="output-denied",d();break}case"tool-output-available":{const E=_(u.toolCallId);E.type==="dynamic-tool"?T({toolCallId:u.toolCallId,toolName:E.toolName,state:"output-available",input:E.input,output:u.output,preliminary:u.preliminary,providerExecuted:u.providerExecuted,title:E.title}):y({toolCallId:u.toolCallId,toolName:Va(E),state:"output-available",input:E.input,output:u.output,providerExecuted:u.providerExecuted,preliminary:u.preliminary,title:E.title}),d();break}case"tool-output-error":{const E=_(u.toolCallId);E.type==="dynamic-tool"?T({toolCallId:u.toolCallId,toolName:E.toolName,state:"output-error",input:E.input,errorText:u.errorText,providerExecuted:u.providerExecuted,title:E.title}):y({toolCallId:u.toolCallId,toolName:Va(E),state:"output-error",input:E.input,rawInput:E.rawInput,errorText:u.errorText,providerExecuted:u.providerExecuted,title:E.title}),d();break}case"start-step":{l.message.parts.push({type:"step-start"});break}case"finish-step":{l.activeTextParts={},l.activeReasoningParts={};break}case"start":{u.messageId!=null&&(l.message.id=u.messageId),await S(u.messageMetadata),(u.messageId!=null||u.messageMetadata!=null)&&d();break}case"finish":{u.finishReason!=null&&(l.finishReason=u.finishReason),await S(u.messageMetadata),u.messageMetadata!=null&&d();break}case"message-metadata":{await S(u.messageMetadata),u.messageMetadata!=null&&d();break}case"error":{i?.(new Error(u.errorText));break}default:if(Yf(u)){n?.[u.type]!=null&&await Ya({value:u.data,schema:n[u.type]});const E=u;if(E.transient){s?.(E);break}const R=E.id!=null?l.message.parts.find(O=>E.type===O.type&&E.id===O.id):void 0;R!=null?R.data=E.data:l.message.parts.push(E),s?.(E),d()}}o.enqueue(u)})}}))}async function Qf({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()}}Vn({prefix:"aitxt",size:24});Vn({prefix:"aiobj",size:24});var Gf=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()})}};Vn({prefix:"aiobj",size:24});async function Xf(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((a,s)=>{const u=new FileReader;u.onload=o=>{var l;a((l=o.target)==null?void 0:l.result)},u.onerror=o=>s(o),u.readAsDataURL(e)});return{type:"file",mediaType:r,filename:n,url:i}}))}var Zf=class{constructor({api:t="/api/chat",credentials:e,headers:n,body:r,fetch:i,prepareSendMessagesRequest:a,prepareReconnectToStreamRequest:s}){this.api=t,this.credentials=e,this.headers=n,this.body=r,this.fetch=i,this.prepareSendMessagesRequest=a,this.prepareReconnectToStreamRequest=s}async sendMessages({abortSignal:t,...e}){var n,r,i,a,s;const u=await At(this.body),o=await At(this.headers),l=await At(this.credentials),d={...Dt(o),...Dt(e.headers)},f=await((n=this.prepareSendMessagesRequest)==null?void 0:n.call(this,{api:this.api,id:e.chatId,messages:e.messages,body:{...u,...e.body},headers:d,credentials:l,requestMetadata:e.metadata,trigger:e.trigger,messageId:e.messageId})),p=(r=f?.api)!=null?r:this.api,h=f?.headers!==void 0?Dt(f.headers):d,g=f?.body!==void 0?f.body:{...u,...e.body,id:e.chatId,messages:e.messages,trigger:e.trigger,messageId:e.messageId},_=(i=f?.credentials)!=null?i:l,T=await((a=this.fetch)!=null?a:globalThis.fetch)(p,{method:"POST",headers:Ha({"Content-Type":"application/json",...h},`ai-sdk/${qa}`,Ua()),body:JSON.stringify(g),credentials:_,signal:t});if(!T.ok)throw new Error((s=await T.text())!=null?s:"Failed to fetch the chat response.");if(!T.body)throw new Error("The response body is empty.");return this.processResponseStream(T.body)}async reconnectToStream(t){var e,n,r,i,a;const s=await At(this.body),u=await At(this.headers),o=await At(this.credentials),l={...Dt(u),...Dt(t.headers)},d=await((e=this.prepareReconnectToStreamRequest)==null?void 0:e.call(this,{api:this.api,id:t.chatId,body:{...s,...t.body},headers:l,credentials:o,requestMetadata:t.metadata})),f=(n=d?.api)!=null?n:`${this.api}/${t.chatId}/stream`,p=d?.headers!==void 0?Dt(d.headers):l,h=(r=d?.credentials)!=null?r:o,_=await((i=this.fetch)!=null?i:globalThis.fetch)(f,{method:"GET",headers:Ha(p,`ai-sdk/${qa}`,Ua()),credentials:h});if(_.status===204)return null;if(!_.ok)throw new Error((a=await _.text())!=null?a:"Failed to fetch the chat response.");if(!_.body)throw new Error("The response body is empty.");return this.processResponseStream(_.body)}},ro=class extends Zf{constructor(t={}){super(t)}processResponseStream(t){return yf({stream:t,schema:$f}).pipeThrough(new TransformStream({async transform(e,n){if(!e.success)throw e.error;n.enqueue(e.value)}}))}},Kf=class{constructor({generateId:t=kd,id:e=t(),transport:n=new ro,messageMetadataSchema:r,dataPartSchemas:i,state:a,onError:s,onToolCall:u,onFinish:o,onData:l,sendAutomaticallyWhen:d}){this.activeResponse=void 0,this.jobExecutor=new Gf,this.sendMessage=async(f,p)=>{var h,g,_,y;if(f==null){await this.makeRequest({trigger:"submit-message",messageId:(h=this.lastMessage)==null?void 0:h.id,...p});return}let T;if("text"in f||"files"in f?T={parts:[...Array.isArray(f.files)?f.files:await Xf(f.files),..."text"in f&&f.text!=null?[{type:"text",text:f.text}]:[]]}:T=f,f.messageId!=null){const S=this.state.messages.findIndex(E=>E.id===f.messageId);if(S===-1)throw new Error(`message with id ${f.messageId} not found`);if(this.state.messages[S].role!=="user")throw new Error(`message with id ${f.messageId} is not a user message`);this.state.messages=this.state.messages.slice(0,S+1),this.state.replaceMessage(S,{...T,id:f.messageId,role:(g=T.role)!=null?g:"user",metadata:f.metadata})}else this.state.pushMessage({...T,id:(_=T.id)!=null?_:this.generateId(),role:(y=T.role)!=null?y:"user",metadata:f.metadata});await this.makeRequest({trigger:"submit-message",messageId:f.messageId,...p})},this.regenerate=async({messageId:f,...p}={})=>{const h=f==null?this.state.messages.length-1:this.state.messages.findIndex(g=>g.id===f);if(h===-1)throw new Error(`message ${f} not found`);this.state.messages=this.state.messages.slice(0,this.messages[h].role==="assistant"?h:h+1),await this.makeRequest({trigger:"regenerate-message",messageId:f,...p})},this.resumeStream=async(f={})=>{await this.makeRequest({trigger:"resume-stream",...f})},this.clearError=()=>{this.status==="error"&&(this.state.error=void 0,this.setStatus({status:"ready"}))},this.addToolApprovalResponse=async({id:f,approved:p,reason:h})=>this.jobExecutor.run(async()=>{var g,_;const y=this.state.messages,T=y[y.length-1],S=E=>gi(E)&&E.state==="approval-requested"&&E.approval.id===f?{...E,state:"approval-responded",approval:{id:f,approved:p,reason:h}}:E;this.state.replaceMessage(y.length-1,{...T,parts:T.parts.map(S)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(S)),this.status!=="streaming"&&this.status!=="submitted"&&((g=this.sendAutomaticallyWhen)!=null&&g.call(this,{messages:this.state.messages}))&&this.makeRequest({trigger:"submit-message",messageId:(_=this.lastMessage)==null?void 0:_.id})}),this.addToolOutput=async({state:f="output-available",tool:p,toolCallId:h,output:g,errorText:_})=>this.jobExecutor.run(async()=>{var y,T;const S=this.state.messages,E=S[S.length-1],R=O=>gi(O)&&O.toolCallId===h?{...O,state:f,output:g,errorText:_}:O;this.state.replaceMessage(S.length-1,{...E,parts:E.parts.map(R)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(R)),this.status!=="streaming"&&this.status!=="submitted"&&((y=this.sendAutomaticallyWhen)!=null&&y.call(this,{messages:this.state.messages}))&&this.makeRequest({trigger:"submit-message",messageId:(T=this.lastMessage)==null?void 0:T.id})}),this.addToolResult=this.addToolOutput,this.stop=async()=>{var f;this.status!=="streaming"&&this.status!=="submitted"||(f=this.activeResponse)!=null&&f.abortController&&this.activeResponse.abortController.abort()},this.id=e,this.transport=n,this.generateId=t,this.messageMetadataSchema=r,this.dataPartSchemas=i,this.state=a,this.onError=s,this.onToolCall=u,this.onFinish=o,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 a,s,u,o;this.setStatus({status:"submitted",error:void 0});const l=this.lastMessage;let d=!1,f=!1,p=!1;try{const h={state:Vf({lastMessage:this.state.snapshot(l),messageId:this.generateId()}),abortController:new AbortController};h.abortController.signal.addEventListener("abort",()=>{d=!0}),this.activeResponse=h;let g;if(t==="resume-stream"){const y=await this.transport.reconnectToStream({chatId:this.id,metadata:e,headers:n,body:r});if(y==null){this.setStatus({status:"ready"});return}g=y}else g=await this.transport.sendMessages({chatId:this.id,messages:this.state.messages,abortSignal:h.abortController.signal,metadata:e,headers:n,body:r,trigger:t,messageId:i});const _=y=>this.jobExecutor.run(()=>y({state:h.state,write:()=>{var T;this.setStatus({status:"streaming"}),h.state.message.id===((T=this.lastMessage)==null?void 0:T.id)?this.state.replaceMessage(this.state.messages.length-1,h.state.message):this.state.pushMessage(h.state.message)}}));await Qf({stream:Wf({stream:g,onToolCall:this.onToolCall,onData:this.onData,messageMetadataSchema:this.messageMetadataSchema,dataPartSchemas:this.dataPartSchemas,runUpdateMessageJob:_,onError:y=>{throw y}}),onError:y=>{throw y}}),this.setStatus({status:"ready"})}catch(h){if(d||h.name==="AbortError")return d=!0,this.setStatus({status:"ready"}),null;p=!0,h instanceof TypeError&&(h.message.toLowerCase().includes("fetch")||h.message.toLowerCase().includes("network"))&&(f=!0),this.onError&&h instanceof Error&&this.onError(h),this.setStatus({status:"error",error:h})}finally{try{(s=this.onFinish)==null||s.call(this,{message:this.activeResponse.state.message,messages:this.state.messages,isAbort:d,isDisconnect:f,isError:p,finishReason:(a=this.activeResponse)==null?void 0:a.state.finishReason})}catch(h){console.error(h)}this.activeResponse=void 0}(u=this.sendAutomaticallyWhen)!=null&&u.call(this,{messages:this.state.messages})&&!p&&await this.makeRequest({trigger:"submit-message",messageId:(o=this.lastMessage)==null?void 0:o.id,metadata:e,headers:n,body:r})}},qr,Wa;function Jf(){if(Wa)return qr;Wa=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(...s){clearTimeout(r);const u=Date.now(),o=u-i,l=n-o;l<=0?(i=u,e.apply(this,s)):r=setTimeout(()=>{i=Date.now(),e.apply(this,s)},l)}}return qr=t,qr}var eh=Jf();const th=Ui(eh);var io=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},Ae=(t,e,n)=>(io(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)},xt=(t,e,n,r)=>(io(t,e,"write to private field"),e.set(t,n),n);function nh(t,e){return e!=null?th(t,e):t}var Ke,or,lr,An,kn,Cn,Qt,Ei,bi,rh=class{constructor(t=[]){st(this,Ke,void 0),st(this,or,"ready"),st(this,lr,void 0),st(this,An,new Set),st(this,kn,new Set),st(this,Cn,new Set),this.pushMessage=e=>{xt(this,Ke,Ae(this,Ke).concat(e)),Ae(this,Qt).call(this)},this.popMessage=()=>{xt(this,Ke,Ae(this,Ke).slice(0,-1)),Ae(this,Qt).call(this)},this.replaceMessage=(e,n)=>{xt(this,Ke,[...Ae(this,Ke).slice(0,e),this.snapshot(n),...Ae(this,Ke).slice(e+1)]),Ae(this,Qt).call(this)},this.snapshot=e=>structuredClone(e),this["~registerMessagesCallback"]=(e,n)=>{const r=n?nh(e,n):e;return Ae(this,An).add(r),()=>{Ae(this,An).delete(r)}},this["~registerStatusCallback"]=e=>(Ae(this,kn).add(e),()=>{Ae(this,kn).delete(e)}),this["~registerErrorCallback"]=e=>(Ae(this,Cn).add(e),()=>{Ae(this,Cn).delete(e)}),st(this,Qt,()=>{Ae(this,An).forEach(e=>e())}),st(this,Ei,()=>{Ae(this,kn).forEach(e=>e())}),st(this,bi,()=>{Ae(this,Cn).forEach(e=>e())}),xt(this,Ke,t)}get status(){return Ae(this,or)}set status(t){xt(this,or,t),Ae(this,Ei).call(this)}get error(){return Ae(this,lr)}set error(t){xt(this,lr,t),Ae(this,bi).call(this)}get messages(){return Ae(this,Ke)}set messages(t){xt(this,Ke,[...t]),Ae(this,Qt).call(this)}};Ke=new WeakMap;or=new WeakMap;lr=new WeakMap;An=new WeakMap;kn=new WeakMap;Cn=new WeakMap;Qt=new WeakMap;Ei=new WeakMap;bi=new WeakMap;var Gt,Qa=class extends Kf{constructor({messages:e,...n}){const r=new rh(e);super({...n,state:r}),st(this,Gt,void 0),this["~registerMessagesCallback"]=(i,a)=>Ae(this,Gt)["~registerMessagesCallback"](i,a),this["~registerStatusCallback"]=i=>Ae(this,Gt)["~registerStatusCallback"](i),this["~registerErrorCallback"]=i=>Ae(this,Gt)["~registerErrorCallback"](i),xt(this,Gt,r)}};Gt=new WeakMap;function ih({experimental_throttle:t,resume:e=!1,...n}={}){const r=V.useRef("chat"in n?n.chat:new Qa(n));("chat"in n&&n.chat!==r.current||"id"in n&&r.current.id!==n.id)&&(r.current="chat"in n?n.chat:new Qa(n));const a=V.useCallback(d=>r.current["~registerMessagesCallback"](d,t),[t,r.current.id]),s=V.useSyncExternalStore(a,()=>r.current.messages,()=>r.current.messages),u=V.useSyncExternalStore(r.current["~registerStatusCallback"],()=>r.current.status,()=>r.current.status),o=V.useSyncExternalStore(r.current["~registerErrorCallback"],()=>r.current.error,()=>r.current.error),l=V.useCallback(d=>{typeof d=="function"&&(d=d(r.current.messages)),r.current.messages=d},[r]);return V.useEffect(()=>{e&&r.current.resumeStream()},[e,r]),{id:r.current.id,messages:s,setMessages:l,sendMessage:r.current.sendMessage,regenerate:r.current.regenerate,clearError:r.current.clearError,stop:r.current.stop,error:o,resumeStream:r.current.resumeStream,status:u,addToolResult:r.current.addToolOutput,addToolOutput:r.current.addToolOutput,addToolApprovalResponse:r.current.addToolApprovalResponse}}const ah="You are a helpful assistant.",sh=t=>new ro({api:`/api/${t}/models/stream`,credentials:"include",prepareSendMessagesRequest:({messages:e,requestMetadata:n})=>({body:{messages:e,stream:!0,...n}})});function o_(t){const e=W.c(37),{threadId:n,systemPrompt:r,onCreateThread:i,onError:a,onToolCall:s}=t,{org:u,locator:o}=St(),{slug:l}=u,d=zi(),f=Du(),[p,h]=V.useState(null),g=bd(n),_=r||ah;let y;e[0]!==_?(y={id:"system",role:"system",parts:[{type:"text",text:_}]},e[0]=_,e[1]=y):y=e[1];const S=y;let E;e[2]!==g||e[3]!==S?(E=[S,...g],e[2]=g,e[3]=S,e[4]=E):E=e[4];const R=E,O=`${n}:${_}`;let I;e[5]!==l?(I=sh(l),e[5]=l,e[6]=I):I=e[6];const v=I;let B;e[7]!==o||e[8]!==f||e[9]!==i||e[10]!==d||e[11]!==n?(B=async ae=>{const{finishReason:me,messages:C,isAbort:le,isDisconnect:de,isError:_e}=ae;if(h(me??null),me!=="stop"||le||de||_e)return;const Re=C.slice(-2).filter(Boolean);if(Re.length!==2){console.warn("[chat] Expected 2 messages, got",Re.length);return}f.insertMany.mutate(Re);const Se=Re.find(oh)?.parts?.find(uh)?.text.slice(0,100)||"";if(!await gd(o,n)){if(i)i({id:n,title:Se});else{const Le=new Date().toISOString(),Ve={id:n,title:Se,created_at:Le,updated_at:Le,hidden:!1};d.insert.mutate(Ve)}return}d.update.mutate({id:n,updates:{updated_at:new Date().toISOString()}})},e[7]=o,e[8]=f,e[9]=i,e[10]=d,e[11]=n,e[12]=B):B=e[12];const z=B;let N;e[13]!==a?(N=ae=>{console.error("[chat] Chat error:",ae),a?.(ae)},e[13]=a,e[14]=N):N=e[14];let F;e[15]!==R||e[16]!==O||e[17]!==z||e[18]!==s||e[19]!==N||e[20]!==v?(F={id:O,messages:R,transport:v,onFinish:z,onToolCall:s,onError:N},e[15]=R,e[16]=O,e[17]=z,e[18]=s,e[19]=N,e[20]=v,e[21]=F):F=e[21];const P=ih(F);let Z;e[22]!==P?(Z=async(ae,me)=>{!ae?.trim()||P.status==="submitted"||P.status==="streaming"||(h(null),await P.sendMessage({id:crypto.randomUUID(),role:"user",parts:[{type:"text",text:ae}],metadata:me},{metadata:me}))},e[22]=P,e[23]=Z):Z=e[23];const $=Z,H=P.messages[0]?.role==="system"?P.messages.length===1:P.messages.length===0,Q=P.messages,te=P.status;let K;e[24]!==P?(K=P.stop.bind(P),e[24]=P,e[25]=K):K=e[25];let ge;e[26]===Symbol.for("react.memo_cache_sentinel")?(ge=()=>h(null),e[26]=ge):ge=e[26];let k;return e[27]!==P.clearError||e[28]!==P.error||e[29]!==P.messages||e[30]!==P.setMessages||e[31]!==P.status||e[32]!==p||e[33]!==H||e[34]!==$||e[35]!==K?(k={messages:Q,status:te,sendMessage:$,stop:K,setMessages:P.setMessages,isEmpty:H,error:P.error,clearError:P.clearError,finishReason:p,clearFinishReason:ge},e[27]=P.clearError,e[28]=P.error,e[29]=P.messages,e[30]=P.setMessages,e[31]=P.status,e[32]=p,e[33]=H,e[34]=$,e[35]=K,e[36]=k):k=e[36],k}function uh(t){return t.type==="text"}function oh(t){return t.parts?.find(lh)}function lh(t){return t.type==="text"}const ao={inputValue:"",branchContext:null,pendingSubmit:!1};function ch(t,e){switch(e.type){case"SET_INPUT":return{...t,inputValue:e.payload};case"START_BRANCH":return{...t,branchContext:e.payload};case"CLEAR_BRANCH":return{...t,branchContext:null};case"SET_PENDING_SUBMIT":return{...t,pendingSubmit:e.payload};case"RESET":return ao;default:return t}}const so=V.createContext(null),uo=()=>crypto.randomUUID();function dh(t){const e=W.c(16),{children:n}=t,{locator:r}=St(),[i,a]=V.useReducer(ch,ao),s=zi(),[u,o]=Yc(qc.threadManagerState(r)+":active-id",fh);let l;e[0]!==o||e[1]!==s?(l=y=>{const T=y?.id||crypto.randomUUID(),S=new Date().toISOString(),E={id:T,title:y?.title||"",created_at:y?.created_at||S,updated_at:y?.updated_at||S,hidden:y?.hidden??!1,gatewayId:y?.gatewayId};return s.insert.mutate(E),o(T),E},e[0]=o,e[1]=s,e[2]=l):l=e[2];const d=l;let f;e[3]!==u||e[4]!==o||e[5]!==s?(f=y=>{s.update.mutate({id:y,updates:{hidden:!0,updated_at:new Date().toISOString()}}),u===y&&o(uo())},e[3]=u,e[4]=o,e[5]=s,e[6]=f):f=e[6];const p=f;let h;e[7]!==u||e[8]!==d||e[9]!==p||e[10]!==i||e[11]!==o?(h={interactionState:i,interactionDispatch:a,activeThreadId:u,createThread:d,setActiveThreadId:o,hideThread:p},e[7]=u,e[8]=d,e[9]=p,e[10]=i,e[11]=o,e[12]=h):h=e[12];const g=h;let _;return e[13]!==n||e[14]!==g?(_=m.jsx(so.Provider,{value:g,children:n}),e[13]=n,e[14]=g,e[15]=_):_=e[15],_}function fh(t){return t||uo()}function hh(){const t=W.c(19),e=V.useContext(so);if(!e)throw new Error("useChat must be used within a ChatProvider");const{interactionState:n,interactionDispatch:r}=e;let i,a,s,u,o;t[0]!==r?(i=d=>r({type:"SET_INPUT",payload:d}),a=d=>r({type:"START_BRANCH",payload:d}),s=()=>r({type:"CLEAR_BRANCH"}),u=d=>r({type:"SET_PENDING_SUBMIT",payload:d}),o=()=>r({type:"RESET"}),t[0]=r,t[1]=i,t[2]=a,t[3]=s,t[4]=u,t[5]=o):(i=t[1],a=t[2],s=t[3],u=t[4],o=t[5]);let l;return t[6]!==e.activeThreadId||t[7]!==e.createThread||t[8]!==e.hideThread||t[9]!==e.setActiveThreadId||t[10]!==n.branchContext||t[11]!==n.inputValue||t[12]!==n.pendingSubmit||t[13]!==i||t[14]!==a||t[15]!==s||t[16]!==u||t[17]!==o?(l={inputValue:n.inputValue,branchContext:n.branchContext,pendingSubmit:n.pendingSubmit,setInputValue:i,startBranch:a,clearBranch:s,setPendingSubmit:u,reset:o,activeThreadId:e.activeThreadId,createThread:e.createThread,setActiveThreadId:e.setActiveThreadId,hideThread:e.hideThread},t[6]=e.activeThreadId,t[7]=e.createThread,t[8]=e.hideThread,t[9]=e.setActiveThreadId,t[10]=n.branchContext,t[11]=n.inputValue,t[12]=n.pendingSubmit,t[13]=i,t[14]=a,t[15]=s,t[16]=u,t[17]=o,t[18]=l):l=t[18],l}const Ga=3;function ph(t){const e=W.c(14),{prompt:n,onSelect:r}=t,i=n.description??n.name;let a;e[0]!==r||e[1]!==n?(a=()=>r(n),e[0]=r,e[1]=n,e[2]=a):a=e[2];const s=n.title??n.name;let u;if(e[3]!==s){let f;e[5]===Symbol.for("react.memo_cache_sentinel")?(f=/_/g,e[5]=f):f=e[5],u=s.replace(f," "),e[3]=s,e[4]=u}else u=e[4];let o;e[6]!==a||e[7]!==u?(o=m.jsx(sn,{asChild:!0,children:m.jsx("button",{type:"button",onClick:a,className:"px-3 py-1.5 text-xs text-muted-foreground hover:text-foreground border border-border rounded-full hover:bg-accent/50 transition-colors cursor-pointer",children:u})}),e[6]=a,e[7]=u,e[8]=o):o=e[8];let l;e[9]!==i?(l=m.jsx(un,{side:"bottom",className:"max-w-xs",children:m.jsx("p",{className:"text-xs",children:i})}),e[9]=i,e[10]=l):l=e[10];let d;return e[11]!==o||e[12]!==l?(d=m.jsxs(an,{children:[o,l]}),e[11]=o,e[12]=l,e[13]=d):d=e[13],d}function mh(t){const e=W.c(20),{prompts:n,onSelect:r,className:i}=t;if(n.length===0)return null;let a,s,u,o,l;if(e[0]!==i||e[1]!==r||e[2]!==n){const p=n.slice(0,Ga),h=n.slice(Ga),g=h.length>0;a=pu,l=300,e[8]!==i?(s=ce("flex flex-wrap items-center justify-center gap-2",i),e[8]=i,e[9]=s):s=e[9];let _;e[10]!==r?(_=y=>m.jsx(ph,{prompt:y,onSelect:r},y.name),e[10]=r,e[11]=_):_=e[11],u=p.map(_),o=g&&m.jsxs(mu,{children:[m.jsx(gu,{asChild:!0,children:m.jsxs("button",{type:"button",className:"size-7 flex items-center justify-center text-xs text-muted-foreground hover:text-foreground border border-border rounded-full hover:bg-accent/50 transition-colors cursor-pointer",children:["+",h.length]})}),m.jsx(Eu,{side:"bottom",align:"center",className:"w-auto p-2",children:m.jsx("div",{className:"flex flex-col gap-1",children:h.map(y=>{const T=y.description??y.name;return m.jsxs(an,{children:[m.jsx(sn,{asChild:!0,children:m.jsx("button",{type:"button",onClick:()=>r(y),className:"px-3 py-1.5 text-xs text-muted-foreground hover:text-foreground hover:bg-accent/50 rounded-md transition-colors cursor-pointer text-left",children:(y.title??y.name).replace(/_/g," ")})}),m.jsx(un,{side:"right",className:"max-w-xs",children:m.jsx("p",{className:"text-xs",children:T})})]},y.name)})})})]}),e[0]=i,e[1]=r,e[2]=n,e[3]=a,e[4]=s,e[5]=u,e[6]=o,e[7]=l}else a=e[3],s=e[4],u=e[5],o=e[6],l=e[7];let d;e[12]!==s||e[13]!==u||e[14]!==o?(d=m.jsxs("div",{className:s,children:[u,o]}),e[12]=s,e[13]=u,e[14]=o,e[15]=d):d=e[15];let f;return e[16]!==a||e[17]!==l||e[18]!==d?(f=m.jsx(a,{delayDuration:l,children:d}),e[16]=a,e[17]=l,e[18]=d,e[19]=f):f=e[19],f}async function gh(t){const e=`/mcp/gateway/${t}`,n={"Content-Type":"application/json",Accept:"application/json, text/event-stream"};try{const r=await fetch(e,{method:"POST",headers:n,body:JSON.stringify({jsonrpc:"2.0",id:1,method:"initialize",params:{protocolVersion:"2025-06-18",capabilities:{},clientInfo:{name:"mesh-chat",version:"1.0.0"}}})});if(!r.ok)return[];if((await r.json()).error)return[];const a=await fetch(e,{method:"POST",headers:n,body:JSON.stringify({jsonrpc:"2.0",id:2,method:"prompts/list",params:{}})});if(!a.ok)return[];const s=await a.json();return s.error?[]:s.result?.prompts||[]}catch{return[]}}function Eh(t){const e=W.c(7);let n;e[0]!==t?(n=Oe.gatewayPrompts(t),e[0]=t,e[1]=n):n=e[1];let r;e[2]!==t?(r=()=>gh(t),e[2]=t,e[3]=r):r=e[3];let i;return e[4]!==n||e[5]!==r?(i={queryKey:n,queryFn:r,staleTime:6e4,retry:!1},e[4]=n,e[5]=r,e[6]=i):i=e[6],Fi(i)}function l_(t){const e=W.c(4),{gatewayId:n,onSelect:r,className:i}=t,a=i===void 0?"mt-6":i,{data:s}=Eh(n);if(s.length===0)return null;let u;return e[0]!==a||e[1]!==r||e[2]!==s?(u=m.jsx(mh,{prompts:s,onSelect:r,className:a}),e[0]=a,e[1]=r,e[2]=s,e[3]=u):u=e[3],u}function bh(t){const e=W.c(66),{value:n,onChange:r,onSubmit:i,onStop:a,disabled:s,isStreaming:u,placeholder:o,className:l,centered:d,contextContent:f,leftActions:p,rightActions:h,maxTextHeight:g,children:_}=t,y=o===void 0?"Ask anything or @ for context":o,T=g===void 0?"164px":g;let S;e[0]!==s||e[1]!==u||e[2]!==n?(S=!s&&!u&&n.trim().length>0,e[0]=s,e[1]=u,e[2]=n,e[3]=S):S=e[3];const E=S;let R;e[4]!==E||e[5]!==u||e[6]!==a||e[7]!==i?(R=Ze=>{Ze.preventDefault(),u&&a?a():E&&i()},e[4]=E,e[5]=u,e[6]=a,e[7]=i,e[8]=R):R=e[8];const O=R;let I;e[9]!==E||e[10]!==i?(I=Ze=>{Ze.key==="Enter"&&!Ze.shiftKey&&(Ze.preventDefault(),E&&i())},e[9]=E,e[10]=i,e[11]=I):I=e[11];const v=I;let B;e[12]!==l?(B=ce("w-full",l),e[12]=l,e[13]=B):B=e[13];let z;e[14]===Symbol.for("react.memo_cache_sentinel")?(z=ce("relative rounded-xl border border-border bg-background w-full min-h-[130px] flex flex-col"),e[14]=z):z=e[14];let N;e[15]!==f?(N=f&&m.jsx("div",{className:"mb-1",children:f}),e[15]=f,e[16]=N):N=e[16];let F;e[17]!==T?(F={maxHeight:T},e[17]=T,e[18]=F):F=e[18];let P;e[19]!==r?(P=Ze=>r(Ze.target.value),e[19]=r,e[20]=P):P=e[20];const Z=s||u;let $;e[21]===Symbol.for("react.memo_cache_sentinel")?($=ce("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[21]=$):$=e[21];let H;e[22]===Symbol.for("react.memo_cache_sentinel")?(H={minHeight:"20px",height:"auto",overflow:"hidden"},e[22]=H):H=e[22];let Q;e[23]!==v||e[24]!==y||e[25]!==P||e[26]!==Z||e[27]!==n?(Q=m.jsx($c,{value:n,onChange:P,onKeyDown:v,placeholder:y,disabled:Z,className:$,rows:1,style:H}),e[23]=v,e[24]=y,e[25]=P,e[26]=Z,e[27]=n,e[28]=Q):Q=e[28];let te;e[29]!==F||e[30]!==Q?(te=m.jsx("div",{className:"overflow-y-auto relative flex-1",style:F,children:Q}),e[29]=F,e[30]=Q,e[31]=te):te=e[31];let K;e[32]!==te||e[33]!==N?(K=m.jsxs("div",{className:"relative flex flex-col gap-2 p-2.5 flex-1",children:[N,te]}),e[32]=te,e[33]=N,e[34]=K):K=e[34];let ge;e[35]!==_||e[36]!==p?(ge=m.jsxs("div",{className:"flex items-center overflow-hidden gap-2 min-w-0",children:[p,_]}),e[35]=_,e[36]=p,e[37]=ge):ge=e[37];const k=u?"button":"submit";let ae;e[38]!==u||e[39]!==a?(ae=Ze=>{u&&(Ze.preventDefault(),Ze.stopPropagation(),a?.())},e[38]=u,e[39]=a,e[40]=ae):ae=e[40];const me=E||u?"default":"ghost",C=!E&&!u,le=!E&&!u&&"bg-muted text-muted-foreground hover:bg-muted hover:text-muted-foreground cursor-not-allowed";let de;e[41]!==le?(de=ce("size-8 rounded-full transition-all",le),e[41]=le,e[42]=de):de=e[42];const _e=u?"Stop generating":"Send message (Enter)";let Re;e[43]!==u?(Re=u?m.jsx(Fc,{size:20}):m.jsx(Mc,{size:20}),e[43]=u,e[44]=Re):Re=e[44];let Se;e[45]!==k||e[46]!==ae||e[47]!==me||e[48]!==C||e[49]!==de||e[50]!==_e||e[51]!==Re?(Se=m.jsx(Ye,{type:k,onClick:ae,variant:me,size:"icon",disabled:C,className:de,title:_e,children:Re}),e[45]=k,e[46]=ae,e[47]=me,e[48]=C,e[49]=de,e[50]=_e,e[51]=Re,e[52]=Se):Se=e[52];let He;e[53]!==h||e[54]!==Se?(He=m.jsxs("div",{className:"flex items-center gap-1",children:[h,Se]}),e[53]=h,e[54]=Se,e[55]=He):He=e[55];let Le;e[56]!==ge||e[57]!==He?(Le=m.jsxs("div",{className:"flex items-center justify-between p-2.5",children:[ge,He]}),e[56]=ge,e[57]=He,e[58]=Le):Le=e[58];let Ve;e[59]!==K||e[60]!==Le?(Ve=m.jsxs("div",{className:z,children:[K,Le]}),e[59]=K,e[60]=Le,e[61]=Ve):Ve=e[61];let Yt;return e[62]!==O||e[63]!==Ve||e[64]!==B?(Yt=m.jsx("form",{onSubmit:O,className:B,children:Ve}),e[62]=O,e[63]=Ve,e[64]=B,e[65]=Yt):Yt=e[65],Yt}function Th(){const t=W.c(3),[e,n]=V.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=async s=>{await navigator.clipboard.writeText(s),n(!0),setTimeout(()=>n(!1),2e3)},t[0]=r):r=t[0];const i=r;let a;return t[1]!==e?(a={handleCopy:i,copied:e},t[1]=e,t[2]=a):a=t[2],a}function Yi(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var jt=Yi();function oo(t){jt=t}var Nn={exec:()=>null};function fe(t,e=""){let n=typeof t=="string"?t:t.source;const r={replace:(i,a)=>{let s=typeof a=="string"?a:a.source;return s=s.replace(Ue.caret,"$1"),n=n.replace(i,s),r},getRegex:()=>new RegExp(n,e)};return r}var Ue={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")},xh=/^(?:[ \t]*(?:\n|$))+/,_h=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,yh=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Qn=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Ah=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,qi=/(?:[*+-]|\d{1,9}[.)])/,lo=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,co=fe(lo).replace(/bull/g,qi).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(),kh=fe(lo).replace(/bull/g,qi).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(),Vi=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Ch=/^[^\n]+/,Wi=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Ih=fe(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Wi).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Sh=fe(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,qi).getRegex(),Nr="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",Qi=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Nh=fe("^ {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",Qi).replace("tag",Nr).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),fo=fe(Vi).replace("hr",Qn).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",Nr).getRegex(),wh=fe(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",fo).getRegex(),Gi={blockquote:wh,code:_h,def:Ih,fences:yh,heading:Ah,hr:Qn,html:Nh,lheading:co,list:Sh,newline:xh,paragraph:fo,table:Nn,text:Ch},Xa=fe("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Qn).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",Nr).getRegex(),Rh={...Gi,lheading:kh,table:Xa,paragraph:fe(Vi).replace("hr",Qn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Xa).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",Nr).getRegex()},Oh={...Gi,html:fe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Qi).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:Nn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:fe(Vi).replace("hr",Qn).replace("heading",` *#{1,6} *[^
|
|
13
|
-
]`).replace("lheading",
|
|
12
|
+
`)}})}});var Yf=Ef(()=>Xu(Ve([ye({type:G("text-start"),id:Y(),providerMetadata:ue.optional()}),ye({type:G("text-delta"),id:Y(),delta:Y(),providerMetadata:ue.optional()}),ye({type:G("text-end"),id:Y(),providerMetadata:ue.optional()}),ye({type:G("error"),errorText:Y()}),ye({type:G("tool-input-start"),toolCallId:Y(),toolName:Y(),providerExecuted:je().optional(),dynamic:je().optional(),title:Y().optional()}),ye({type:G("tool-input-delta"),toolCallId:Y(),inputTextDelta:Y()}),ye({type:G("tool-input-available"),toolCallId:Y(),toolName:Y(),input:Ct(),providerExecuted:je().optional(),providerMetadata:ue.optional(),dynamic:je().optional(),title:Y().optional()}),ye({type:G("tool-input-error"),toolCallId:Y(),toolName:Y(),input:Ct(),providerExecuted:je().optional(),providerMetadata:ue.optional(),dynamic:je().optional(),errorText:Y(),title:Y().optional()}),ye({type:G("tool-approval-request"),approvalId:Y(),toolCallId:Y()}),ye({type:G("tool-output-available"),toolCallId:Y(),output:Ct(),providerExecuted:je().optional(),dynamic:je().optional(),preliminary:je().optional()}),ye({type:G("tool-output-error"),toolCallId:Y(),errorText:Y(),providerExecuted:je().optional(),dynamic:je().optional()}),ye({type:G("tool-output-denied"),toolCallId:Y()}),ye({type:G("reasoning-start"),id:Y(),providerMetadata:ue.optional()}),ye({type:G("reasoning-delta"),id:Y(),delta:Y(),providerMetadata:ue.optional()}),ye({type:G("reasoning-end"),id:Y(),providerMetadata:ue.optional()}),ye({type:G("source-url"),sourceId:Y(),url:Y(),title:Y().optional(),providerMetadata:ue.optional()}),ye({type:G("source-document"),sourceId:Y(),mediaType:Y(),title:Y(),filename:Y().optional(),providerMetadata:ue.optional()}),ye({type:G("file"),url:Y(),mediaType:Y(),providerMetadata:ue.optional()}),ye({type:gu(t=>typeof t=="string"&&t.startsWith("data-"),{message:'Type must start with "data-"'}),id:Y().optional(),data:Ct(),transient:je().optional()}),ye({type:G("start-step")}),ye({type:G("finish-step")}),ye({type:G("start"),messageId:Y().optional(),messageMetadata:Ct().optional()}),ye({type:G("finish"),finishReason:wc(["stop","length","content-filter","tool-calls","error","other"]).optional(),messageMetadata:Ct().optional()}),ye({type:G("abort"),reason:Y().optional()}),ye({type:G("message-metadata"),messageMetadata:Ct()})])));function qf(t){return t.type.startsWith("data-")}function _i(t){return t.type.startsWith("tool-")}function Vf(t){return t.type==="dynamic-tool"}function yi(t){return _i(t)||Vf(t)}function Ga(t){return t.type.split("-").slice(1).join("-")}function Wf({lastMessage:t,messageId:e}){return{message:t?.role==="assistant"?t:{id:e,metadata:void 0,role:"assistant",parts:[]},activeTextParts:{},activeReasoningParts:{},partialToolCalls:{}}}function Qf({stream:t,messageMetadataSchema:e,dataPartSchemas:n,runUpdateMessageJob:r,onError:i,onToolCall:a,onData:s}){return t.pipeThrough(new TransformStream({async transform(u,o){await r(async({state:l,write:d})=>{var f,p,h,g;function _(E){const O=l.message.parts.filter(yi).find(S=>S.toolCallId===E);if(O==null)throw new Error(`no tool invocation found for tool call ${E}`);return O}function y(E){var R;const O=l.message.parts.find(B=>_i(B)&&B.toolCallId===E.toolCallId),S=E,v=O;O!=null?(O.state=E.state,v.input=S.input,v.output=S.output,v.errorText=S.errorText,v.rawInput=S.rawInput,v.preliminary=S.preliminary,E.title!==void 0&&(v.title=E.title),v.providerExecuted=(R=S.providerExecuted)!=null?R:O.providerExecuted,S.providerMetadata!=null&&O.state==="input-available"&&(O.callProviderMetadata=S.providerMetadata)):l.message.parts.push({type:`tool-${E.toolName}`,toolCallId:E.toolCallId,state:E.state,title:E.title,input:S.input,output:S.output,rawInput:S.rawInput,errorText:S.errorText,providerExecuted:S.providerExecuted,preliminary:S.preliminary,...S.providerMetadata!=null?{callProviderMetadata:S.providerMetadata}:{}})}function T(E){var R,O;const S=l.message.parts.find(z=>z.type==="dynamic-tool"&&z.toolCallId===E.toolCallId),v=E,B=S;S!=null?(S.state=E.state,B.toolName=E.toolName,B.input=v.input,B.output=v.output,B.errorText=v.errorText,B.rawInput=(R=v.rawInput)!=null?R:B.rawInput,B.preliminary=v.preliminary,E.title!==void 0&&(B.title=E.title),B.providerExecuted=(O=v.providerExecuted)!=null?O:S.providerExecuted,v.providerMetadata!=null&&S.state==="input-available"&&(S.callProviderMetadata=v.providerMetadata)):l.message.parts.push({type:"dynamic-tool",toolName:E.toolName,toolCallId:E.toolCallId,state:E.state,input:v.input,output:v.output,errorText:v.errorText,preliminary:v.preliminary,providerExecuted:v.providerExecuted,title:E.title,...v.providerMetadata!=null?{callProviderMetadata:v.providerMetadata}:{}})}async function I(E){if(E!=null){const R=l.message.metadata!=null?io(l.message.metadata,E):E;e!=null&&await Wa({value:R,schema:e}),l.message.metadata=R}}switch(u.type){case"text-start":{const E={type:"text",text:"",providerMetadata:u.providerMetadata,state:"streaming"};l.activeTextParts[u.id]=E,l.message.parts.push(E),d();break}case"text-delta":{const E=l.activeTextParts[u.id];E.text+=u.delta,E.providerMetadata=(f=u.providerMetadata)!=null?f:E.providerMetadata,d();break}case"text-end":{const E=l.activeTextParts[u.id];E.state="done",E.providerMetadata=(p=u.providerMetadata)!=null?p:E.providerMetadata,delete l.activeTextParts[u.id],d();break}case"reasoning-start":{const E={type:"reasoning",text:"",providerMetadata:u.providerMetadata,state:"streaming"};l.activeReasoningParts[u.id]=E,l.message.parts.push(E),d();break}case"reasoning-delta":{const E=l.activeReasoningParts[u.id];E.text+=u.delta,E.providerMetadata=(h=u.providerMetadata)!=null?h:E.providerMetadata,d();break}case"reasoning-end":{const E=l.activeReasoningParts[u.id];E.providerMetadata=(g=u.providerMetadata)!=null?g:E.providerMetadata,E.state="done",delete l.activeReasoningParts[u.id],d();break}case"file":{l.message.parts.push({type:"file",mediaType:u.mediaType,url:u.url}),d();break}case"source-url":{l.message.parts.push({type:"source-url",sourceId:u.sourceId,url:u.url,title:u.title,providerMetadata:u.providerMetadata}),d();break}case"source-document":{l.message.parts.push({type:"source-document",sourceId:u.sourceId,mediaType:u.mediaType,title:u.title,filename:u.filename,providerMetadata:u.providerMetadata}),d();break}case"tool-input-start":{const E=l.message.parts.filter(_i);l.partialToolCalls[u.toolCallId]={text:"",toolName:u.toolName,index:E.length,dynamic:u.dynamic,title:u.title},u.dynamic?T({toolCallId:u.toolCallId,toolName:u.toolName,state:"input-streaming",input:void 0,providerExecuted:u.providerExecuted,title:u.title}):y({toolCallId:u.toolCallId,toolName:u.toolName,state:"input-streaming",input:void 0,providerExecuted:u.providerExecuted,title:u.title}),d();break}case"tool-input-delta":{const E=l.partialToolCalls[u.toolCallId];E.text+=u.inputTextDelta;const{value:R}=await Jn(E.text);E.dynamic?T({toolCallId:u.toolCallId,toolName:E.toolName,state:"input-streaming",input:R,title:E.title}):y({toolCallId:u.toolCallId,toolName:E.toolName,state:"input-streaming",input:R,title:E.title}),d();break}case"tool-input-available":{u.dynamic?T({toolCallId:u.toolCallId,toolName:u.toolName,state:"input-available",input:u.input,providerExecuted:u.providerExecuted,providerMetadata:u.providerMetadata,title:u.title}):y({toolCallId:u.toolCallId,toolName:u.toolName,state:"input-available",input:u.input,providerExecuted:u.providerExecuted,providerMetadata:u.providerMetadata,title:u.title}),d(),a&&!u.providerExecuted&&await a({toolCall:u});break}case"tool-input-error":{u.dynamic?T({toolCallId:u.toolCallId,toolName:u.toolName,state:"output-error",input:u.input,errorText:u.errorText,providerExecuted:u.providerExecuted,providerMetadata:u.providerMetadata}):y({toolCallId:u.toolCallId,toolName:u.toolName,state:"output-error",input:void 0,rawInput:u.input,errorText:u.errorText,providerExecuted:u.providerExecuted,providerMetadata:u.providerMetadata}),d();break}case"tool-approval-request":{const E=_(u.toolCallId);E.state="approval-requested",E.approval={id:u.approvalId},d();break}case"tool-output-denied":{const E=_(u.toolCallId);E.state="output-denied",d();break}case"tool-output-available":{const E=_(u.toolCallId);E.type==="dynamic-tool"?T({toolCallId:u.toolCallId,toolName:E.toolName,state:"output-available",input:E.input,output:u.output,preliminary:u.preliminary,providerExecuted:u.providerExecuted,title:E.title}):y({toolCallId:u.toolCallId,toolName:Ga(E),state:"output-available",input:E.input,output:u.output,providerExecuted:u.providerExecuted,preliminary:u.preliminary,title:E.title}),d();break}case"tool-output-error":{const E=_(u.toolCallId);E.type==="dynamic-tool"?T({toolCallId:u.toolCallId,toolName:E.toolName,state:"output-error",input:E.input,errorText:u.errorText,providerExecuted:u.providerExecuted,title:E.title}):y({toolCallId:u.toolCallId,toolName:Ga(E),state:"output-error",input:E.input,rawInput:E.rawInput,errorText:u.errorText,providerExecuted:u.providerExecuted,title:E.title}),d();break}case"start-step":{l.message.parts.push({type:"step-start"});break}case"finish-step":{l.activeTextParts={},l.activeReasoningParts={};break}case"start":{u.messageId!=null&&(l.message.id=u.messageId),await I(u.messageMetadata),(u.messageId!=null||u.messageMetadata!=null)&&d();break}case"finish":{u.finishReason!=null&&(l.finishReason=u.finishReason),await I(u.messageMetadata),u.messageMetadata!=null&&d();break}case"message-metadata":{await I(u.messageMetadata),u.messageMetadata!=null&&d();break}case"error":{i?.(new Error(u.errorText));break}default:if(qf(u)){n?.[u.type]!=null&&await Wa({value:u.data,schema:n[u.type]});const E=u;if(E.transient){s?.(E);break}const R=E.id!=null?l.message.parts.find(O=>E.type===O.type&&E.id===O.id):void 0;R!=null?R.data=E.data:l.message.parts.push(E),s?.(E),d()}}o.enqueue(u)})}}))}async function Gf({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()}}Kn({prefix:"aitxt",size:24});Kn({prefix:"aiobj",size:24});var Xf=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()})}};Kn({prefix:"aiobj",size:24});async function Zf(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((a,s)=>{const u=new FileReader;u.onload=o=>{var l;a((l=o.target)==null?void 0:l.result)},u.onerror=o=>s(o),u.readAsDataURL(e)});return{type:"file",mediaType:r,filename:n,url:i}}))}var Kf=class{constructor({api:t="/api/chat",credentials:e,headers:n,body:r,fetch:i,prepareSendMessagesRequest:a,prepareReconnectToStreamRequest:s}){this.api=t,this.credentials=e,this.headers=n,this.body=r,this.fetch=i,this.prepareSendMessagesRequest=a,this.prepareReconnectToStreamRequest=s}async sendMessages({abortSignal:t,...e}){var n,r,i,a,s;const u=await wt(this.body),o=await wt(this.headers),l=await wt(this.credentials),d={...Ht(o),...Ht(e.headers)},f=await((n=this.prepareSendMessagesRequest)==null?void 0:n.call(this,{api:this.api,id:e.chatId,messages:e.messages,body:{...u,...e.body},headers:d,credentials:l,requestMetadata:e.metadata,trigger:e.trigger,messageId:e.messageId})),p=(r=f?.api)!=null?r:this.api,h=f?.headers!==void 0?Ht(f.headers):d,g=f?.body!==void 0?f.body:{...u,...e.body,id:e.chatId,messages:e.messages,trigger:e.trigger,messageId:e.messageId},_=(i=f?.credentials)!=null?i:l,T=await((a=this.fetch)!=null?a:globalThis.fetch)(p,{method:"POST",headers:$a({"Content-Type":"application/json",...h},`ai-sdk/${Qa}`,za()),body:JSON.stringify(g),credentials:_,signal:t});if(!T.ok)throw new Error((s=await T.text())!=null?s:"Failed to fetch the chat response.");if(!T.body)throw new Error("The response body is empty.");return this.processResponseStream(T.body)}async reconnectToStream(t){var e,n,r,i,a;const s=await wt(this.body),u=await wt(this.headers),o=await wt(this.credentials),l={...Ht(u),...Ht(t.headers)},d=await((e=this.prepareReconnectToStreamRequest)==null?void 0:e.call(this,{api:this.api,id:t.chatId,body:{...s,...t.body},headers:l,credentials:o,requestMetadata:t.metadata})),f=(n=d?.api)!=null?n:`${this.api}/${t.chatId}/stream`,p=d?.headers!==void 0?Ht(d.headers):l,h=(r=d?.credentials)!=null?r:o,_=await((i=this.fetch)!=null?i:globalThis.fetch)(f,{method:"GET",headers:$a(p,`ai-sdk/${Qa}`,za()),credentials:h});if(_.status===204)return null;if(!_.ok)throw new Error((a=await _.text())!=null?a:"Failed to fetch the chat response.");if(!_.body)throw new Error("The response body is empty.");return this.processResponseStream(_.body)}},ao=class extends Kf{constructor(t={}){super(t)}processResponseStream(t){return Af({stream:t,schema:Yf}).pipeThrough(new TransformStream({async transform(e,n){if(!e.success)throw e.error;n.enqueue(e.value)}}))}},Jf=class{constructor({generateId:t=Cd,id:e=t(),transport:n=new ao,messageMetadataSchema:r,dataPartSchemas:i,state:a,onError:s,onToolCall:u,onFinish:o,onData:l,sendAutomaticallyWhen:d}){this.activeResponse=void 0,this.jobExecutor=new Xf,this.sendMessage=async(f,p)=>{var h,g,_,y;if(f==null){await this.makeRequest({trigger:"submit-message",messageId:(h=this.lastMessage)==null?void 0:h.id,...p});return}let T;if("text"in f||"files"in f?T={parts:[...Array.isArray(f.files)?f.files:await Zf(f.files),..."text"in f&&f.text!=null?[{type:"text",text:f.text}]:[]]}:T=f,f.messageId!=null){const I=this.state.messages.findIndex(E=>E.id===f.messageId);if(I===-1)throw new Error(`message with id ${f.messageId} not found`);if(this.state.messages[I].role!=="user")throw new Error(`message with id ${f.messageId} is not a user message`);this.state.messages=this.state.messages.slice(0,I+1),this.state.replaceMessage(I,{...T,id:f.messageId,role:(g=T.role)!=null?g:"user",metadata:f.metadata})}else this.state.pushMessage({...T,id:(_=T.id)!=null?_:this.generateId(),role:(y=T.role)!=null?y:"user",metadata:f.metadata});await this.makeRequest({trigger:"submit-message",messageId:f.messageId,...p})},this.regenerate=async({messageId:f,...p}={})=>{const h=f==null?this.state.messages.length-1:this.state.messages.findIndex(g=>g.id===f);if(h===-1)throw new Error(`message ${f} not found`);this.state.messages=this.state.messages.slice(0,this.messages[h].role==="assistant"?h:h+1),await this.makeRequest({trigger:"regenerate-message",messageId:f,...p})},this.resumeStream=async(f={})=>{await this.makeRequest({trigger:"resume-stream",...f})},this.clearError=()=>{this.status==="error"&&(this.state.error=void 0,this.setStatus({status:"ready"}))},this.addToolApprovalResponse=async({id:f,approved:p,reason:h})=>this.jobExecutor.run(async()=>{var g,_;const y=this.state.messages,T=y[y.length-1],I=E=>yi(E)&&E.state==="approval-requested"&&E.approval.id===f?{...E,state:"approval-responded",approval:{id:f,approved:p,reason:h}}:E;this.state.replaceMessage(y.length-1,{...T,parts:T.parts.map(I)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(I)),this.status!=="streaming"&&this.status!=="submitted"&&((g=this.sendAutomaticallyWhen)!=null&&g.call(this,{messages:this.state.messages}))&&this.makeRequest({trigger:"submit-message",messageId:(_=this.lastMessage)==null?void 0:_.id})}),this.addToolOutput=async({state:f="output-available",tool:p,toolCallId:h,output:g,errorText:_})=>this.jobExecutor.run(async()=>{var y,T;const I=this.state.messages,E=I[I.length-1],R=O=>yi(O)&&O.toolCallId===h?{...O,state:f,output:g,errorText:_}:O;this.state.replaceMessage(I.length-1,{...E,parts:E.parts.map(R)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(R)),this.status!=="streaming"&&this.status!=="submitted"&&((y=this.sendAutomaticallyWhen)!=null&&y.call(this,{messages:this.state.messages}))&&this.makeRequest({trigger:"submit-message",messageId:(T=this.lastMessage)==null?void 0:T.id})}),this.addToolResult=this.addToolOutput,this.stop=async()=>{var f;this.status!=="streaming"&&this.status!=="submitted"||(f=this.activeResponse)!=null&&f.abortController&&this.activeResponse.abortController.abort()},this.id=e,this.transport=n,this.generateId=t,this.messageMetadataSchema=r,this.dataPartSchemas=i,this.state=a,this.onError=s,this.onToolCall=u,this.onFinish=o,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 a,s,u,o;this.setStatus({status:"submitted",error:void 0});const l=this.lastMessage;let d=!1,f=!1,p=!1;try{const h={state:Wf({lastMessage:this.state.snapshot(l),messageId:this.generateId()}),abortController:new AbortController};h.abortController.signal.addEventListener("abort",()=>{d=!0}),this.activeResponse=h;let g;if(t==="resume-stream"){const y=await this.transport.reconnectToStream({chatId:this.id,metadata:e,headers:n,body:r});if(y==null){this.setStatus({status:"ready"});return}g=y}else g=await this.transport.sendMessages({chatId:this.id,messages:this.state.messages,abortSignal:h.abortController.signal,metadata:e,headers:n,body:r,trigger:t,messageId:i});const _=y=>this.jobExecutor.run(()=>y({state:h.state,write:()=>{var T;this.setStatus({status:"streaming"}),h.state.message.id===((T=this.lastMessage)==null?void 0:T.id)?this.state.replaceMessage(this.state.messages.length-1,h.state.message):this.state.pushMessage(h.state.message)}}));await Gf({stream:Qf({stream:g,onToolCall:this.onToolCall,onData:this.onData,messageMetadataSchema:this.messageMetadataSchema,dataPartSchemas:this.dataPartSchemas,runUpdateMessageJob:_,onError:y=>{throw y}}),onError:y=>{throw y}}),this.setStatus({status:"ready"})}catch(h){if(d||h.name==="AbortError")return d=!0,this.setStatus({status:"ready"}),null;p=!0,h instanceof TypeError&&(h.message.toLowerCase().includes("fetch")||h.message.toLowerCase().includes("network"))&&(f=!0),this.onError&&h instanceof Error&&this.onError(h),this.setStatus({status:"error",error:h})}finally{try{(s=this.onFinish)==null||s.call(this,{message:this.activeResponse.state.message,messages:this.state.messages,isAbort:d,isDisconnect:f,isError:p,finishReason:(a=this.activeResponse)==null?void 0:a.state.finishReason})}catch(h){console.error(h)}this.activeResponse=void 0}(u=this.sendAutomaticallyWhen)!=null&&u.call(this,{messages:this.state.messages})&&!p&&await this.makeRequest({trigger:"submit-message",messageId:(o=this.lastMessage)==null?void 0:o.id,metadata:e,headers:n,body:r})}},Zr,Xa;function eh(){if(Xa)return Zr;Xa=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(...s){clearTimeout(r);const u=Date.now(),o=u-i,l=n-o;l<=0?(i=u,e.apply(this,s)):r=setTimeout(()=>{i=Date.now(),e.apply(this,s)},l)}}return Zr=t,Zr}var th=eh();const nh=qi(th);var so=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},Ae=(t,e,n)=>(so(t,e,"read from private field"),n?n.call(t):e.get(t)),lt=(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)},It=(t,e,n,r)=>(so(t,e,"write to private field"),e.set(t,n),n);function rh(t,e){return e!=null?nh(t,e):t}var et,pr,mr,wn,Rn,On,en,Ai,ki,ih=class{constructor(t=[]){lt(this,et,void 0),lt(this,pr,"ready"),lt(this,mr,void 0),lt(this,wn,new Set),lt(this,Rn,new Set),lt(this,On,new Set),this.pushMessage=e=>{It(this,et,Ae(this,et).concat(e)),Ae(this,en).call(this)},this.popMessage=()=>{It(this,et,Ae(this,et).slice(0,-1)),Ae(this,en).call(this)},this.replaceMessage=(e,n)=>{It(this,et,[...Ae(this,et).slice(0,e),this.snapshot(n),...Ae(this,et).slice(e+1)]),Ae(this,en).call(this)},this.snapshot=e=>structuredClone(e),this["~registerMessagesCallback"]=(e,n)=>{const r=n?rh(e,n):e;return Ae(this,wn).add(r),()=>{Ae(this,wn).delete(r)}},this["~registerStatusCallback"]=e=>(Ae(this,Rn).add(e),()=>{Ae(this,Rn).delete(e)}),this["~registerErrorCallback"]=e=>(Ae(this,On).add(e),()=>{Ae(this,On).delete(e)}),lt(this,en,()=>{Ae(this,wn).forEach(e=>e())}),lt(this,Ai,()=>{Ae(this,Rn).forEach(e=>e())}),lt(this,ki,()=>{Ae(this,On).forEach(e=>e())}),It(this,et,t)}get status(){return Ae(this,pr)}set status(t){It(this,pr,t),Ae(this,Ai).call(this)}get error(){return Ae(this,mr)}set error(t){It(this,mr,t),Ae(this,ki).call(this)}get messages(){return Ae(this,et)}set messages(t){It(this,et,[...t]),Ae(this,en).call(this)}};et=new WeakMap;pr=new WeakMap;mr=new WeakMap;wn=new WeakMap;Rn=new WeakMap;On=new WeakMap;en=new WeakMap;Ai=new WeakMap;ki=new WeakMap;var tn,Za=class extends Jf{constructor({messages:e,...n}){const r=new ih(e);super({...n,state:r}),lt(this,tn,void 0),this["~registerMessagesCallback"]=(i,a)=>Ae(this,tn)["~registerMessagesCallback"](i,a),this["~registerStatusCallback"]=i=>Ae(this,tn)["~registerStatusCallback"](i),this["~registerErrorCallback"]=i=>Ae(this,tn)["~registerErrorCallback"](i),It(this,tn,r)}};tn=new WeakMap;function ah({experimental_throttle:t,resume:e=!1,...n}={}){const r=V.useRef("chat"in n?n.chat:new Za(n));("chat"in n&&n.chat!==r.current||"id"in n&&r.current.id!==n.id)&&(r.current="chat"in n?n.chat:new Za(n));const a=V.useCallback(d=>r.current["~registerMessagesCallback"](d,t),[t,r.current.id]),s=V.useSyncExternalStore(a,()=>r.current.messages,()=>r.current.messages),u=V.useSyncExternalStore(r.current["~registerStatusCallback"],()=>r.current.status,()=>r.current.status),o=V.useSyncExternalStore(r.current["~registerErrorCallback"],()=>r.current.error,()=>r.current.error),l=V.useCallback(d=>{typeof d=="function"&&(d=d(r.current.messages)),r.current.messages=d},[r]);return V.useEffect(()=>{e&&r.current.resumeStream()},[e,r]),{id:r.current.id,messages:s,setMessages:l,sendMessage:r.current.sendMessage,regenerate:r.current.regenerate,clearError:r.current.clearError,stop:r.current.stop,error:o,resumeStream:r.current.resumeStream,status:u,addToolResult:r.current.addToolOutput,addToolOutput:r.current.addToolOutput,addToolApprovalResponse:r.current.addToolApprovalResponse}}const sh="You are a helpful assistant.",uh=t=>new ao({api:`/api/${t}/models/stream`,credentials:"include",prepareSendMessagesRequest:({messages:e,requestMetadata:n})=>({body:{messages:e,stream:!0,...n}})});function l_(t){const e=W.c(37),{threadId:n,systemPrompt:r,onCreateThread:i,onError:a,onToolCall:s}=t,{org:u,locator:o}=Dt(),{slug:l}=u,d=Gi(),f=Pu(),[p,h]=V.useState(null),g=Td(n),_=r||sh;let y;e[0]!==_?(y={id:"system",role:"system",parts:[{type:"text",text:_}]},e[0]=_,e[1]=y):y=e[1];const I=y;let E;e[2]!==g||e[3]!==I?(E=[I,...g],e[2]=g,e[3]=I,e[4]=E):E=e[4];const R=E,O=`${n}:${_}`;let S;e[5]!==l?(S=uh(l),e[5]=l,e[6]=S):S=e[6];const v=S;let B;e[7]!==o||e[8]!==f||e[9]!==i||e[10]!==d||e[11]!==n?(B=async ae=>{const{finishReason:xe,messages:C,isAbort:ke,isDisconnect:Ie,isError:me}=ae;if(h(xe??null),xe!=="stop"||ke||Ie||me)return;const Ne=C.slice(-2).filter(Boolean);if(Ne.length!==2){console.warn("[chat] Expected 2 messages, got",Ne.length);return}f.insertMany.mutate(Ne);const _e=Ne.find(lh)?.parts?.find(oh)?.text.slice(0,100)||"";if(!await Ed(o,n)){if(i)i({id:n,title:_e});else{const Se=new Date().toISOString(),Oe={id:n,title:_e,created_at:Se,updated_at:Se,hidden:!1};d.insert.mutate(Oe)}return}d.update.mutate({id:n,updates:{updated_at:new Date().toISOString()}})},e[7]=o,e[8]=f,e[9]=i,e[10]=d,e[11]=n,e[12]=B):B=e[12];const z=B;let N;e[13]!==a?(N=ae=>{console.error("[chat] Chat error:",ae),a?.(ae)},e[13]=a,e[14]=N):N=e[14];let F;e[15]!==R||e[16]!==O||e[17]!==z||e[18]!==s||e[19]!==N||e[20]!==v?(F={id:O,messages:R,transport:v,onFinish:z,onToolCall:s,onError:N},e[15]=R,e[16]=O,e[17]=z,e[18]=s,e[19]=N,e[20]=v,e[21]=F):F=e[21];const P=ah(F);let X;e[22]!==P?(X=async(ae,xe)=>{!ae?.trim()||P.status==="submitted"||P.status==="streaming"||(h(null),await P.sendMessage({id:crypto.randomUUID(),role:"user",parts:[{type:"text",text:ae}],metadata:xe},{metadata:xe}))},e[22]=P,e[23]=X):X=e[23];const q=X,j=P.messages[0]?.role==="system"?P.messages.length===1:P.messages.length===0,Z=P.messages,te=P.status;let K;e[24]!==P?(K=P.stop.bind(P),e[24]=P,e[25]=K):K=e[25];let ce;e[26]===Symbol.for("react.memo_cache_sentinel")?(ce=()=>h(null),e[26]=ce):ce=e[26];let k;return e[27]!==P.clearError||e[28]!==P.error||e[29]!==P.messages||e[30]!==P.setMessages||e[31]!==P.status||e[32]!==p||e[33]!==j||e[34]!==q||e[35]!==K?(k={messages:Z,status:te,sendMessage:q,stop:K,setMessages:P.setMessages,isEmpty:j,error:P.error,clearError:P.clearError,finishReason:p,clearFinishReason:ce},e[27]=P.clearError,e[28]=P.error,e[29]=P.messages,e[30]=P.setMessages,e[31]=P.status,e[32]=p,e[33]=j,e[34]=q,e[35]=K,e[36]=k):k=e[36],k}function oh(t){return t.type==="text"}function lh(t){return t.parts?.find(ch)}function ch(t){return t.type==="text"}const uo={inputValue:"",branchContext:null,pendingSubmit:!1};function dh(t,e){switch(e.type){case"SET_INPUT":return{...t,inputValue:e.payload};case"START_BRANCH":return{...t,branchContext:e.payload};case"CLEAR_BRANCH":return{...t,branchContext:null};case"SET_PENDING_SUBMIT":return{...t,pendingSubmit:e.payload};case"RESET":return uo;default:return t}}const oo=V.createContext(null),lo=()=>crypto.randomUUID();function fh(t){const e=W.c(16),{children:n}=t,{locator:r}=Dt(),[i,a]=V.useReducer(dh,uo),s=Gi(),[u,o]=qc(Vc.threadManagerState(r)+":active-id",hh);let l;e[0]!==o||e[1]!==s?(l=y=>{const T=y?.id||crypto.randomUUID(),I=new Date().toISOString(),E={id:T,title:y?.title||"",created_at:y?.created_at||I,updated_at:y?.updated_at||I,hidden:y?.hidden??!1,gatewayId:y?.gatewayId};return s.insert.mutate(E),o(T),E},e[0]=o,e[1]=s,e[2]=l):l=e[2];const d=l;let f;e[3]!==u||e[4]!==o||e[5]!==s?(f=y=>{s.update.mutate({id:y,updates:{hidden:!0,updated_at:new Date().toISOString()}}),u===y&&o(lo())},e[3]=u,e[4]=o,e[5]=s,e[6]=f):f=e[6];const p=f;let h;e[7]!==u||e[8]!==d||e[9]!==p||e[10]!==i||e[11]!==o?(h={interactionState:i,interactionDispatch:a,activeThreadId:u,createThread:d,setActiveThreadId:o,hideThread:p},e[7]=u,e[8]=d,e[9]=p,e[10]=i,e[11]=o,e[12]=h):h=e[12];const g=h;let _;return e[13]!==n||e[14]!==g?(_=m.jsx(oo.Provider,{value:g,children:n}),e[13]=n,e[14]=g,e[15]=_):_=e[15],_}function hh(t){return t||lo()}function ph(){const t=W.c(19),e=V.useContext(oo);if(!e)throw new Error("useChat must be used within a ChatProvider");const{interactionState:n,interactionDispatch:r}=e;let i,a,s,u,o;t[0]!==r?(i=d=>r({type:"SET_INPUT",payload:d}),a=d=>r({type:"START_BRANCH",payload:d}),s=()=>r({type:"CLEAR_BRANCH"}),u=d=>r({type:"SET_PENDING_SUBMIT",payload:d}),o=()=>r({type:"RESET"}),t[0]=r,t[1]=i,t[2]=a,t[3]=s,t[4]=u,t[5]=o):(i=t[1],a=t[2],s=t[3],u=t[4],o=t[5]);let l;return t[6]!==e.activeThreadId||t[7]!==e.createThread||t[8]!==e.hideThread||t[9]!==e.setActiveThreadId||t[10]!==n.branchContext||t[11]!==n.inputValue||t[12]!==n.pendingSubmit||t[13]!==i||t[14]!==a||t[15]!==s||t[16]!==u||t[17]!==o?(l={inputValue:n.inputValue,branchContext:n.branchContext,pendingSubmit:n.pendingSubmit,setInputValue:i,startBranch:a,clearBranch:s,setPendingSubmit:u,reset:o,activeThreadId:e.activeThreadId,createThread:e.createThread,setActiveThreadId:e.setActiveThreadId,hideThread:e.hideThread},t[6]=e.activeThreadId,t[7]=e.createThread,t[8]=e.hideThread,t[9]=e.setActiveThreadId,t[10]=n.branchContext,t[11]=n.inputValue,t[12]=n.pendingSubmit,t[13]=i,t[14]=a,t[15]=s,t[16]=u,t[17]=o,t[18]=l):l=t[18],l}const Ka=3;function mh(t){const e=W.c(14),{prompt:n,onSelect:r}=t,i=n.description??n.name;let a;e[0]!==r||e[1]!==n?(a=()=>r(n),e[0]=r,e[1]=n,e[2]=a):a=e[2];const s=n.title??n.name;let u;if(e[3]!==s){let f;e[5]===Symbol.for("react.memo_cache_sentinel")?(f=/_/g,e[5]=f):f=e[5],u=s.replace(f," "),e[3]=s,e[4]=u}else u=e[4];let o;e[6]!==a||e[7]!==u?(o=m.jsx(fn,{asChild:!0,children:m.jsx("button",{type:"button",onClick:a,className:"px-3 py-1.5 text-xs text-muted-foreground hover:text-foreground border border-border rounded-full hover:bg-accent/50 transition-colors cursor-pointer",children:u})}),e[6]=a,e[7]=u,e[8]=o):o=e[8];let l;e[9]!==i?(l=m.jsx(hn,{side:"bottom",className:"max-w-xs",children:m.jsx("p",{className:"text-xs",children:i})}),e[9]=i,e[10]=l):l=e[10];let d;return e[11]!==o||e[12]!==l?(d=m.jsxs(dn,{children:[o,l]}),e[11]=o,e[12]=l,e[13]=d):d=e[13],d}function gh(t){const e=W.c(20),{prompts:n,onSelect:r,className:i}=t;if(n.length===0)return null;let a,s,u,o,l;if(e[0]!==i||e[1]!==r||e[2]!==n){const p=n.slice(0,Ka),h=n.slice(Ka),g=h.length>0;a=Eu,l=300,e[8]!==i?(s=le("flex flex-wrap items-center justify-center gap-2",i),e[8]=i,e[9]=s):s=e[9];let _;e[10]!==r?(_=y=>m.jsx(mh,{prompt:y,onSelect:r},y.name),e[10]=r,e[11]=_):_=e[11],u=p.map(_),o=g&&m.jsxs(bu,{children:[m.jsx(Tu,{asChild:!0,children:m.jsxs("button",{type:"button",className:"size-7 flex items-center justify-center text-xs text-muted-foreground hover:text-foreground border border-border rounded-full hover:bg-accent/50 transition-colors cursor-pointer",children:["+",h.length]})}),m.jsx(xu,{side:"bottom",align:"center",className:"w-auto p-2",children:m.jsx("div",{className:"flex flex-col gap-1",children:h.map(y=>{const T=y.description??y.name;return m.jsxs(dn,{children:[m.jsx(fn,{asChild:!0,children:m.jsx("button",{type:"button",onClick:()=>r(y),className:"px-3 py-1.5 text-xs text-muted-foreground hover:text-foreground hover:bg-accent/50 rounded-md transition-colors cursor-pointer text-left",children:(y.title??y.name).replace(/_/g," ")})}),m.jsx(hn,{side:"right",className:"max-w-xs",children:m.jsx("p",{className:"text-xs",children:T})})]},y.name)})})})]}),e[0]=i,e[1]=r,e[2]=n,e[3]=a,e[4]=s,e[5]=u,e[6]=o,e[7]=l}else a=e[3],s=e[4],u=e[5],o=e[6],l=e[7];let d;e[12]!==s||e[13]!==u||e[14]!==o?(d=m.jsxs("div",{className:s,children:[u,o]}),e[12]=s,e[13]=u,e[14]=o,e[15]=d):d=e[15];let f;return e[16]!==a||e[17]!==l||e[18]!==d?(f=m.jsx(a,{delayDuration:l,children:d}),e[16]=a,e[17]=l,e[18]=d,e[19]=f):f=e[19],f}async function Eh(t){const e=`/mcp/gateway/${t}`,n={"Content-Type":"application/json",Accept:"application/json, text/event-stream"};try{const r=await fetch(e,{method:"POST",headers:n,body:JSON.stringify({jsonrpc:"2.0",id:1,method:"initialize",params:{protocolVersion:"2025-06-18",capabilities:{},clientInfo:{name:"mesh-chat",version:"1.0.0"}}})});if(!r.ok)return[];if((await r.json()).error)return[];const a=await fetch(e,{method:"POST",headers:n,body:JSON.stringify({jsonrpc:"2.0",id:2,method:"prompts/list",params:{}})});if(!a.ok)return[];const s=await a.json();return s.error?[]:s.result?.prompts||[]}catch{return[]}}function bh(t){const e=W.c(7);let n;e[0]!==t?(n=Me.gatewayPrompts(t),e[0]=t,e[1]=n):n=e[1];let r;e[2]!==t?(r=()=>Eh(t),e[2]=t,e[3]=r):r=e[3];let i;return e[4]!==n||e[5]!==r?(i={queryKey:n,queryFn:r,staleTime:6e4,retry:!1},e[4]=n,e[5]=r,e[6]=i):i=e[6],Yi(i)}function c_(t){const e=W.c(4),{gatewayId:n,onSelect:r,className:i}=t,a=i===void 0?"mt-6":i,{data:s}=bh(n);if(s.length===0)return null;let u;return e[0]!==a||e[1]!==r||e[2]!==s?(u=m.jsx(gh,{prompts:s,onSelect:r,className:a}),e[0]=a,e[1]=r,e[2]=s,e[3]=u):u=e[3],u}function Th(t){const e=W.c(66),{value:n,onChange:r,onSubmit:i,onStop:a,disabled:s,isStreaming:u,placeholder:o,className:l,centered:d,contextContent:f,leftActions:p,rightActions:h,maxTextHeight:g,children:_}=t,y=o===void 0?"Ask anything or @ for context":o,T=g===void 0?"164px":g;let I;e[0]!==s||e[1]!==u||e[2]!==n?(I=!s&&!u&&n.trim().length>0,e[0]=s,e[1]=u,e[2]=n,e[3]=I):I=e[3];const E=I;let R;e[4]!==E||e[5]!==u||e[6]!==a||e[7]!==i?(R=De=>{De.preventDefault(),u&&a?a():E&&i()},e[4]=E,e[5]=u,e[6]=a,e[7]=i,e[8]=R):R=e[8];const O=R;let S;e[9]!==E||e[10]!==i?(S=De=>{De.key==="Enter"&&!De.shiftKey&&(De.preventDefault(),E&&i())},e[9]=E,e[10]=i,e[11]=S):S=e[11];const v=S;let B;e[12]!==l?(B=le("w-full",l),e[12]=l,e[13]=B):B=e[13];let z;e[14]===Symbol.for("react.memo_cache_sentinel")?(z=le("relative rounded-xl border border-border bg-background w-full min-h-[130px] flex flex-col"),e[14]=z):z=e[14];let N;e[15]!==f?(N=f&&m.jsx("div",{className:"mb-1",children:f}),e[15]=f,e[16]=N):N=e[16];let F;e[17]!==T?(F={maxHeight:T},e[17]=T,e[18]=F):F=e[18];let P;e[19]!==r?(P=De=>r(De.target.value),e[19]=r,e[20]=P):P=e[20];const X=s||u;let q;e[21]===Symbol.for("react.memo_cache_sentinel")?(q=le("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[21]=q):q=e[21];let j;e[22]===Symbol.for("react.memo_cache_sentinel")?(j={minHeight:"20px",height:"auto",overflow:"hidden"},e[22]=j):j=e[22];let Z;e[23]!==v||e[24]!==y||e[25]!==P||e[26]!==X||e[27]!==n?(Z=m.jsx(Yc,{value:n,onChange:P,onKeyDown:v,placeholder:y,disabled:X,className:q,rows:1,style:j}),e[23]=v,e[24]=y,e[25]=P,e[26]=X,e[27]=n,e[28]=Z):Z=e[28];let te;e[29]!==F||e[30]!==Z?(te=m.jsx("div",{className:"overflow-y-auto relative flex-1",style:F,children:Z}),e[29]=F,e[30]=Z,e[31]=te):te=e[31];let K;e[32]!==te||e[33]!==N?(K=m.jsxs("div",{className:"relative flex flex-col gap-2 p-2.5 flex-1",children:[N,te]}),e[32]=te,e[33]=N,e[34]=K):K=e[34];let ce;e[35]!==_||e[36]!==p?(ce=m.jsxs("div",{className:"flex items-center overflow-hidden gap-2 min-w-0",children:[p,_]}),e[35]=_,e[36]=p,e[37]=ce):ce=e[37];const k=u?"button":"submit";let ae;e[38]!==u||e[39]!==a?(ae=De=>{u&&(De.preventDefault(),De.stopPropagation(),a?.())},e[38]=u,e[39]=a,e[40]=ae):ae=e[40];const xe=E||u?"default":"ghost",C=!E&&!u,ke=!E&&!u&&"bg-muted text-muted-foreground hover:bg-muted hover:text-muted-foreground cursor-not-allowed";let Ie;e[41]!==ke?(Ie=le("size-8 rounded-full transition-all",ke),e[41]=ke,e[42]=Ie):Ie=e[42];const me=u?"Stop generating":"Send message (Enter)";let Ne;e[43]!==u?(Ne=u?m.jsx(Uc,{size:20}):m.jsx(Bc,{size:20}),e[43]=u,e[44]=Ne):Ne=e[44];let _e;e[45]!==k||e[46]!==ae||e[47]!==xe||e[48]!==C||e[49]!==Ie||e[50]!==me||e[51]!==Ne?(_e=m.jsx(We,{type:k,onClick:ae,variant:xe,size:"icon",disabled:C,className:Ie,title:me,children:Ne}),e[45]=k,e[46]=ae,e[47]=xe,e[48]=C,e[49]=Ie,e[50]=me,e[51]=Ne,e[52]=_e):_e=e[52];let we;e[53]!==h||e[54]!==_e?(we=m.jsxs("div",{className:"flex items-center gap-1",children:[h,_e]}),e[53]=h,e[54]=_e,e[55]=we):we=e[55];let Se;e[56]!==ce||e[57]!==we?(Se=m.jsxs("div",{className:"flex items-center justify-between p-2.5",children:[ce,we]}),e[56]=ce,e[57]=we,e[58]=Se):Se=e[58];let Oe;e[59]!==K||e[60]!==Se?(Oe=m.jsxs("div",{className:z,children:[K,Se]}),e[59]=K,e[60]=Se,e[61]=Oe):Oe=e[61];let ot;return e[62]!==O||e[63]!==Oe||e[64]!==B?(ot=m.jsx("form",{onSubmit:O,className:B,children:Oe}),e[62]=O,e[63]=Oe,e[64]=B,e[65]=ot):ot=e[65],ot}function xh(){const t=W.c(3),[e,n]=V.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=async s=>{await navigator.clipboard.writeText(s),n(!0),setTimeout(()=>n(!1),2e3)},t[0]=r):r=t[0];const i=r;let a;return t[1]!==e?(a={handleCopy:i,copied:e},t[1]=e,t[2]=a):a=t[2],a}function Zi(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Qt=Zi();function co(t){Qt=t}var vn={exec:()=>null};function de(t,e=""){let n=typeof t=="string"?t:t.source;const r={replace:(i,a)=>{let s=typeof a=="string"?a:a.source;return s=s.replace($e.caret,"$1"),n=n.replace(i,s),r},getRegex:()=>new RegExp(n,e)};return r}var $e={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")},_h=/^(?:[ \t]*(?:\n|$))+/,yh=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Ah=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,er=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,kh=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ki=/(?:[*+-]|\d{1,9}[.)])/,fo=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ho=de(fo).replace(/bull/g,Ki).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(),Ch=de(fo).replace(/bull/g,Ki).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(),Ji=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Ih=/^[^\n]+/,ea=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Sh=de(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ea).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Nh=de(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ki).getRegex(),vr="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",ta=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,wh=de("^ {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",ta).replace("tag",vr).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),po=de(Ji).replace("hr",er).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",vr).getRegex(),Rh=de(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",po).getRegex(),na={blockquote:Rh,code:yh,def:Sh,fences:Ah,heading:kh,hr:er,html:wh,lheading:ho,list:Nh,newline:_h,paragraph:po,table:vn,text:Ih},Ja=de("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",er).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",vr).getRegex(),Oh={...na,lheading:Ch,table:Ja,paragraph:de(Ji).replace("hr",er).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ja).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",vr).getRegex()},Lh={...na,html:de(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ta).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:vn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:de(Ji).replace("hr",er).replace("heading",` *#{1,6} *[^
|
|
13
|
+
]`).replace("lheading",ho).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Dh=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,vh=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,mo=/^( {2,}|\\)\n(?!\s*$)/,Ph=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Pr=/[\p{P}\p{S}]/u,ra=/[\s\p{P}\p{S}]/u,go=/[^\s\p{P}\p{S}]/u,Mh=de(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ra).getRegex(),Eo=/(?!~)[\p{P}\p{S}]/u,Bh=/(?!~)[\s\p{P}\p{S}]/u,Fh=/(?:[^\s\p{P}\p{S}]|~)/u,Uh=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,bo=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Hh=de(bo,"u").replace(/punct/g,Pr).getRegex(),jh=de(bo,"u").replace(/punct/g,Eo).getRegex(),To="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",zh=de(To,"gu").replace(/notPunctSpace/g,go).replace(/punctSpace/g,ra).replace(/punct/g,Pr).getRegex(),$h=de(To,"gu").replace(/notPunctSpace/g,Fh).replace(/punctSpace/g,Bh).replace(/punct/g,Eo).getRegex(),Yh=de("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,go).replace(/punctSpace/g,ra).replace(/punct/g,Pr).getRegex(),qh=de(/\\(punct)/,"gu").replace(/punct/g,Pr).getRegex(),Vh=de(/^<(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(),Wh=de(ta).replace("(?:-->|$)","-->").getRegex(),Qh=de("^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",Wh).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),yr=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Gh=de(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",yr).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),xo=de(/^!?\[(label)\]\[(ref)\]/).replace("label",yr).replace("ref",ea).getRegex(),_o=de(/^!?\[(ref)\](?:\[\])?/).replace("ref",ea).getRegex(),Xh=de("reflink|nolink(?!\\()","g").replace("reflink",xo).replace("nolink",_o).getRegex(),ia={_backpedal:vn,anyPunctuation:qh,autolink:Vh,blockSkip:Uh,br:mo,code:vh,del:vn,emStrongLDelim:Hh,emStrongRDelimAst:zh,emStrongRDelimUnd:Yh,escape:Dh,link:Gh,nolink:_o,punctuation:Mh,reflink:xo,reflinkSearch:Xh,tag:Qh,text:Ph,url:vn},Zh={...ia,link:de(/^!?\[(label)\]\((.*?)\)/).replace("label",yr).getRegex(),reflink:de(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",yr).getRegex()},Ci={...ia,emStrongRDelimAst:$h,emStrongLDelim:jh,url:de(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/},Kh={...Ci,br:de(mo).replace("{2,}","*").getRegex(),text:de(Ci.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},or={normal:na,gfm:Oh,pedantic:Lh},_n={normal:ia,gfm:Ci,breaks:Kh,pedantic:Zh},Jh={"&":"&","<":"<",">":">",'"':""","'":"'"},es=t=>Jh[t];function ct(t,e){if(e){if($e.escapeTest.test(t))return t.replace($e.escapeReplace,es)}else if($e.escapeTestNoEncode.test(t))return t.replace($e.escapeReplaceNoEncode,es);return t}function ts(t){try{t=encodeURI(t).replace($e.percentDecode,"%")}catch{return null}return t}function ns(t,e){const n=t.replace($e.findPipe,(a,s,u)=>{let o=!1,l=s;for(;--l>=0&&u[l]==="\\";)o=!o;return o?"|":" |"}),r=n.split($e.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($e.slashPipe,"|");return r}function yn(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 e0(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 rs(t,e,n,r,i){const a=e.href,s=e.title||null,u=t[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;const o={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:a,title:s,text:u,tokens:r.inlineTokens(u)};return r.state.inLink=!1,o}function t0(t,e,n){const r=t.match(n.other.indentCodeCompensation);if(r===null)return e;const i=r[1];return e.split(`
|
|
14
14
|
`).map(a=>{const s=a.match(n.other.beginningSpace);if(s===null)return a;const[u]=s;return u.length>=i.length?a.slice(i.length):a}).join(`
|
|
15
|
-
`)}var
|
|
16
|
-
`)}}}fences(t){const e=this.rules.block.fences.exec(t);if(e){const n=e[0],r=
|
|
17
|
-
`)}}blockquote(t){const e=this.rules.block.blockquote.exec(t);if(e){let n=
|
|
15
|
+
`)}var Ar=class{options;rules;lexer;constructor(t){this.options=t||Qt}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:yn(n,`
|
|
16
|
+
`)}}}fences(t){const e=this.rules.block.fences.exec(t);if(e){const n=e[0],r=t0(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=yn(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:yn(e[0],`
|
|
17
|
+
`)}}blockquote(t){const e=this.rules.block.blockquote.exec(t);if(e){let n=yn(e[0],`
|
|
18
18
|
`).split(`
|
|
19
19
|
`),r="",i="";const a=[];for(;n.length>0;){let s=!1;const u=[];let o;for(o=0;o<n.length;o++)if(this.rules.other.blockquoteStart.test(n[o]))u.push(n[o]),s=!0;else if(!s)u.push(n[o]);else break;n=n.slice(o);const l=u.join(`
|
|
20
20
|
`),d=l.replace(this.rules.other.blockquoteSetextReplace,`
|
|
@@ -28,14 +28,14 @@ ${d}`:d;const f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.block
|
|
|
28
28
|
`);continue}}return{type:"blockquote",raw:r,tokens:a,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 a=this.rules.other.listItemRegex(n);let s=!1;for(;t;){let o=!1,l="",d="";if(!(e=a.exec(t))||this.rules.block.hr.test(t))break;l=e[0],t=t.substring(l.length);let f=e[2].split(`
|
|
29
29
|
`,1)[0].replace(this.rules.other.listReplaceTabs,T=>" ".repeat(3*T.length)),p=t.split(`
|
|
30
30
|
`,1)[0],h=!f.trim(),g=0;if(this.options.pedantic?(g=2,d=f.trimStart()):h?g=e[1].length+1:(g=e[2].search(this.rules.other.nonSpaceChar),g=g>4?1:g,d=f.slice(g),g+=e[1].length),h&&this.rules.other.blankLine.test(p)&&(l+=p+`
|
|
31
|
-
`,t=t.substring(p.length+1),o=!0),!o){const T=this.rules.other.nextBulletRegex(g),
|
|
32
|
-
`,1)[0];let v;if(p=
|
|
33
|
-
`+v.slice(g);else{if(h||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||E.test(f)||R.test(f)||
|
|
34
|
-
`+p}!h&&!p.trim()&&(h=!0),l+=
|
|
35
|
-
`,t=t.substring(
|
|
36
|
-
`):[],a={type:"table",raw:e[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const s of r)this.rules.other.tableAlignRight.test(s)?a.align.push("right"):this.rules.other.tableAlignCenter.test(s)?a.align.push("center"):this.rules.other.tableAlignLeft.test(s)?a.align.push("left"):a.align.push(null);for(let s=0;s<n.length;s++)a.header.push({text:n[s],tokens:this.lexer.inline(n[s]),header:!0,align:a.align[s]});for(const s of i)a.rows.push(
|
|
37
|
-
`?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 a=
|
|
38
|
-
`),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(
|
|
31
|
+
`,t=t.substring(p.length+1),o=!0),!o){const T=this.rules.other.nextBulletRegex(g),I=this.rules.other.hrRegex(g),E=this.rules.other.fencesBeginRegex(g),R=this.rules.other.headingBeginRegex(g),O=this.rules.other.htmlBeginRegex(g);for(;t;){const S=t.split(`
|
|
32
|
+
`,1)[0];let v;if(p=S,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting," "),v=p):v=p.replace(this.rules.other.tabCharGlobal," "),E.test(p)||R.test(p)||O.test(p)||T.test(p)||I.test(p))break;if(v.search(this.rules.other.nonSpaceChar)>=g||!p.trim())d+=`
|
|
33
|
+
`+v.slice(g);else{if(h||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||E.test(f)||R.test(f)||I.test(f))break;d+=`
|
|
34
|
+
`+p}!h&&!p.trim()&&(h=!0),l+=S+`
|
|
35
|
+
`,t=t.substring(S.length+1),f=v.slice(g)}}i.loose||(s?i.loose=!0:this.rules.other.doubleBlankLine.test(l)&&(s=!0));let _=null,y;this.options.gfm&&(_=this.rules.other.listIsTask.exec(d),_&&(y=_[0]!=="[ ] ",d=d.replace(this.rules.other.listReplaceTask,""))),i.items.push({type:"list_item",raw:l,task:!!_,checked:y,loose:!1,text:d,tokens:[]}),i.raw+=l}const u=i.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let o=0;o<i.items.length;o++)if(this.lexer.state.top=!1,i.items[o].tokens=this.lexer.blockTokens(i.items[o].text,[]),!i.loose){const l=i.items[o].tokens.filter(f=>f.type==="space"),d=l.length>0&&l.some(f=>this.rules.other.anyLine.test(f.raw));i.loose=d}if(i.loose)for(let o=0;o<i.items.length;o++)i.items[o].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=ns(e[1]),r=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
36
|
+
`):[],a={type:"table",raw:e[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const s of r)this.rules.other.tableAlignRight.test(s)?a.align.push("right"):this.rules.other.tableAlignCenter.test(s)?a.align.push("center"):this.rules.other.tableAlignLeft.test(s)?a.align.push("left"):a.align.push(null);for(let s=0;s<n.length;s++)a.header.push({text:n[s],tokens:this.lexer.inline(n[s]),header:!0,align:a.align[s]});for(const s of i)a.rows.push(ns(s,a.header.length).map((u,o)=>({text:u,tokens:this.lexer.inline(u),header:!1,align:a.align[o]})));return a}}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)===`
|
|
37
|
+
`?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 a=yn(n.slice(0,-1),"\\");if((n.length-a.length)%2===0)return}else{const a=e0(e[2],"()");if(a===-2)return;if(a>-1){const u=(e[0].indexOf("!")===0?5:4)+e[1].length+a;e[2]=e[2].substring(0,a),e[0]=e[0].substring(0,u).trim(),e[3]=""}}let r=e[2],i="";if(this.options.pedantic){const a=this.rules.other.pedanticHrefTitle.exec(r);a&&(r=a[1],i=a[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)),rs(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 a=n[0].charAt(0);return{type:"text",raw:a,text:a}}return rs(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 a=[...r[0]].length-1;let s,u,o=a,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+a);(r=d.exec(e))!=null;){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s)continue;if(u=[...s].length,r[3]||r[4]){o+=u;continue}else if((r[5]||r[6])&&a%3&&!((a+u)%3)){l+=u;continue}if(o-=u,o>0)continue;u=Math.min(u,u+o+l);const f=[...r[0]][0].length,p=t.slice(0,a+r.index+f+u);if(Math.min(a,u)%2){const g=p.slice(1,-1);return{type:"em",raw:p,text:g,tokens:this.lexer.inlineTokens(g)}}const h=p.slice(2,-2);return{type:"strong",raw:p,text:h,tokens:this.lexer.inlineTokens(h)}}}}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}}}},Tt=class Ii{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Qt,this.options.tokenizer=this.options.tokenizer||new Ar,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:$e,block:or.normal,inline:_n.normal};this.options.pedantic?(n.block=or.pedantic,n.inline=_n.pedantic):this.options.gfm&&(n.block=or.gfm,this.options.breaks?n.inline=_n.breaks:n.inline=_n.gfm),this.tokenizer.rules=n}static get rules(){return{block:or,inline:_n}}static lex(e,n){return new Ii(n).lex(e)}static lexInline(e,n){return new Ii(n).inlineTokens(e)}lex(e){e=e.replace($e.carriageReturn,`
|
|
38
|
+
`),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($e.tabCharGlobal," ").replace($e.spaceLine,""));e;){let i;if(this.options.extensions?.block?.some(s=>(i=s.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 s=n.at(-1);i.raw.length===1&&s!==void 0?s.raw+=`
|
|
39
39
|
`:n.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);const s=n.at(-1);s?.type==="paragraph"||s?.type==="text"?(s.raw+=`
|
|
40
40
|
`+i.raw,s.text+=`
|
|
41
41
|
`+i.text,this.inlineQueue.at(-1).src=s.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 s=n.at(-1);s?.type==="paragraph"||s?.type==="text"?(s.raw+=`
|
|
@@ -44,16 +44,16 @@ ${d}`:d;const f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.block
|
|
|
44
44
|
`+i.raw,s.text+=`
|
|
45
45
|
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):n.push(i),r=a.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);const s=n.at(-1);s?.type==="text"?(s.raw+=`
|
|
46
46
|
`+i.raw,s.text+=`
|
|
47
|
-
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):n.push(i);continue}if(e){const s="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(s);break}else throw new Error(s)}}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 u=Object.keys(this.tokens.links);if(u.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)u.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 a=!1,s="";for(;e;){a||(s=""),a=!1;let u;if(this.options.extensions?.inline?.some(l=>(u=l.call({lexer:this},e,n))?(e=e.substring(u.raw.length),n.push(u),!0):!1))continue;if(u=this.tokenizer.escape(e)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.tag(e)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.link(e)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(u.raw.length);const l=n.at(-1);u.type==="text"&&l?.type==="text"?(l.raw+=u.raw,l.text+=u.text):n.push(u);continue}if(u=this.tokenizer.emStrong(e,r,s)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.codespan(e)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.br(e)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.del(e)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.autolink(e)){e=e.substring(u.raw.length),n.push(u);continue}if(!this.state.inLink&&(u=this.tokenizer.url(e))){e=e.substring(u.raw.length),n.push(u);continue}let o=e;if(this.options.extensions?.startInline){let l=1/0;const d=e.slice(1);let f;this.options.extensions.startInline.forEach(p=>{f=p.call({lexer:this},d),typeof f=="number"&&f>=0&&(l=Math.min(l,f))}),l<1/0&&l>=0&&(o=e.substring(0,l+1))}if(u=this.tokenizer.inlineText(o)){e=e.substring(u.raw.length),u.raw.slice(-1)!=="_"&&(s=u.raw.slice(-1)),a=!0;const l=n.at(-1);l?.type==="text"?(l.raw+=u.raw,l.text+=u.text):n.push(u);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}},
|
|
48
|
-
`;return r?'<pre><code class="language-'+
|
|
49
|
-
`:"<pre><code>"+(n?i:
|
|
47
|
+
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):n.push(i);continue}if(e){const s="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(s);break}else throw new Error(s)}}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 u=Object.keys(this.tokens.links);if(u.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)u.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 a=!1,s="";for(;e;){a||(s=""),a=!1;let u;if(this.options.extensions?.inline?.some(l=>(u=l.call({lexer:this},e,n))?(e=e.substring(u.raw.length),n.push(u),!0):!1))continue;if(u=this.tokenizer.escape(e)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.tag(e)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.link(e)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(u.raw.length);const l=n.at(-1);u.type==="text"&&l?.type==="text"?(l.raw+=u.raw,l.text+=u.text):n.push(u);continue}if(u=this.tokenizer.emStrong(e,r,s)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.codespan(e)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.br(e)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.del(e)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.autolink(e)){e=e.substring(u.raw.length),n.push(u);continue}if(!this.state.inLink&&(u=this.tokenizer.url(e))){e=e.substring(u.raw.length),n.push(u);continue}let o=e;if(this.options.extensions?.startInline){let l=1/0;const d=e.slice(1);let f;this.options.extensions.startInline.forEach(p=>{f=p.call({lexer:this},d),typeof f=="number"&&f>=0&&(l=Math.min(l,f))}),l<1/0&&l>=0&&(o=e.substring(0,l+1))}if(u=this.tokenizer.inlineText(o)){e=e.substring(u.raw.length),u.raw.slice(-1)!=="_"&&(s=u.raw.slice(-1)),a=!0;const l=n.at(-1);l?.type==="text"?(l.raw+=u.raw,l.text+=u.text):n.push(u);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}},kr=class{options;parser;constructor(t){this.options=t||Qt}space(t){return""}code({text:t,lang:e,escaped:n}){const r=(e||"").match($e.notSpaceStart)?.[0],i=t.replace($e.endingNewline,"")+`
|
|
48
|
+
`;return r?'<pre><code class="language-'+ct(r)+'">'+(n?i:ct(i,!0))+`</code></pre>
|
|
49
|
+
`:"<pre><code>"+(n?i:ct(i,!0))+`</code></pre>
|
|
50
50
|
`}blockquote({tokens:t}){return`<blockquote>
|
|
51
51
|
${this.parser.parse(t)}</blockquote>
|
|
52
52
|
`}html({text:t}){return t}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
|
|
53
53
|
`}hr(t){return`<hr>
|
|
54
54
|
`}list(t){const e=t.ordered,n=t.start;let r="";for(let s=0;s<t.items.length;s++){const u=t.items[s];r+=this.listitem(u)}const i=e?"ol":"ul",a=e&&n!==1?' start="'+n+'"':"";return"<"+i+a+`>
|
|
55
55
|
`+r+"</"+i+`>
|
|
56
|
-
`}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+" "+
|
|
56
|
+
`}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>
|
|
57
57
|
`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
|
|
58
58
|
`}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 a=t.rows[i];n="";for(let s=0;s<a.length;s++)n+=this.tablecell(a[s]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
|
|
59
59
|
<thead>
|
|
@@ -62,37 +62,37 @@ ${this.parser.parse(t)}</blockquote>
|
|
|
62
62
|
`}tablerow({text:t}){return`<tr>
|
|
63
63
|
${t}</tr>
|
|
64
64
|
`}tablecell(t){const e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
|
|
65
|
-
`}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>${
|
|
66
|
-
`+this.renderer.text(u);n?r+=this.renderer.paragraph({type:"paragraph",raw:o,text:o,tokens:[{type:"text",raw:o,text:o,escaped:!0}]}):r+=o;continue}default:{const u='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return r}parseInline(e,n=this.renderer){let r="";for(let i=0;i<e.length;i++){const a=e[i];if(this.options.extensions?.renderers?.[a.type]){const u=this.options.extensions.renderers[a.type].call({parser:this},a);if(u!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){r+=u||"";continue}}const s=a;switch(s.type){case"escape":{r+=n.text(s);break}case"html":{r+=n.html(s);break}case"link":{r+=n.link(s);break}case"image":{r+=n.image(s);break}case"strong":{r+=n.strong(s);break}case"em":{r+=n.em(s);break}case"codespan":{r+=n.codespan(s);break}case"br":{r+=n.br(s);break}case"del":{r+=n.del(s);break}case"text":{r+=n.text(s);break}default:{const u='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return r}},
|
|
67
|
-
Please report this to https://github.com/markedjs/marked.`,t){const r="<p>An error occurred:</p><pre>"+ut(n.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(n);throw n}}},Ut=new t0;function he(t,e){return Ut.parse(t,e)}he.options=he.setOptions=function(t){return Ut.setOptions(t),he.defaults=Ut.defaults,oo(he.defaults),he};he.getDefaults=Yi;he.defaults=jt;he.use=function(...t){return Ut.use(...t),he.defaults=Ut.defaults,oo(he.defaults),he};he.walkTokens=function(t,e){return Ut.walkTokens(t,e)};he.parseInline=Ut.parseInline;he.Parser=gt;he.parser=gt.parse;he.Renderer=br;he.TextRenderer=Ki;he.Lexer=mt;he.lexer=mt.lex;he.Tokenizer=Er;he.Hooks=cr;he.parse=he;he.options;he.setOptions;he.use;he.walkTokens;he.parseInline;gt.parse;mt.lex;function ts(t){const e=[],n=String(t||"");let r=n.indexOf(","),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);const s=n.slice(i,r).trim();(s||!a)&&e.push(s),i=r+1,r=n.indexOf(",",i)}return e}function xo(t,e){const n={};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const n0=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,r0=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,i0={};function ns(t,e){return(i0.jsx?r0:n0).test(t)}const a0=/[ \t\n\f\r]/g;function s0(t){return typeof t=="object"?t.type==="text"?rs(t.value):!1:rs(t)}function rs(t){return t.replace(a0,"")===""}class Gn{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}}Gn.prototype.normal={};Gn.prototype.property={};Gn.prototype.space=void 0;function _o(t,e){const n={},r={};for(const i of t)Object.assign(n,i.property),Object.assign(r,i.normal);return new Gn(n,r,e)}function jn(t){return t.toLowerCase()}class qe{constructor(e,n){this.attribute=n,this.property=e}}qe.prototype.attribute="";qe.prototype.booleanish=!1;qe.prototype.boolean=!1;qe.prototype.commaOrSpaceSeparated=!1;qe.prototype.commaSeparated=!1;qe.prototype.defined=!1;qe.prototype.mustUseProperty=!1;qe.prototype.number=!1;qe.prototype.overloadedBoolean=!1;qe.prototype.property="";qe.prototype.spaceSeparated=!1;qe.prototype.space=void 0;let u0=0;const ne=zt(),Ie=zt(),yi=zt(),j=zt(),xe=zt(),Kt=zt(),Qe=zt();function zt(){return 2**++u0}const Ai=Object.freeze(Object.defineProperty({__proto__:null,boolean:ne,booleanish:Ie,commaOrSpaceSeparated:Qe,commaSeparated:Kt,number:j,overloadedBoolean:yi,spaceSeparated:xe},Symbol.toStringTag,{value:"Module"})),Vr=Object.keys(Ai);class Ji extends qe{constructor(e,n,r,i){let a=-1;if(super(e,n),is(this,"space",i),typeof r=="number")for(;++a<Vr.length;){const s=Vr[a];is(this,Vr[a],(r&Ai[s])===Ai[s])}}}Ji.prototype.defined=!0;function is(t,e,n){n&&(t[e]=n)}function on(t){const e={},n={};for(const[r,i]of Object.entries(t.properties)){const a=new Ji(r,t.transform(t.attributes||{},r),i,t.space);t.mustUseProperty&&t.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),e[r]=a,n[jn(r)]=r,n[jn(a.attribute)]=r}return new Gn(e,n,t.space)}const yo=on({properties:{ariaActiveDescendant:null,ariaAtomic:Ie,ariaAutoComplete:null,ariaBusy:Ie,ariaChecked:Ie,ariaColCount:j,ariaColIndex:j,ariaColSpan:j,ariaControls:xe,ariaCurrent:null,ariaDescribedBy:xe,ariaDetails:null,ariaDisabled:Ie,ariaDropEffect:xe,ariaErrorMessage:null,ariaExpanded:Ie,ariaFlowTo:xe,ariaGrabbed:Ie,ariaHasPopup:null,ariaHidden:Ie,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:xe,ariaLevel:j,ariaLive:null,ariaModal:Ie,ariaMultiLine:Ie,ariaMultiSelectable:Ie,ariaOrientation:null,ariaOwns:xe,ariaPlaceholder:null,ariaPosInSet:j,ariaPressed:Ie,ariaReadOnly:Ie,ariaRelevant:null,ariaRequired:Ie,ariaRoleDescription:xe,ariaRowCount:j,ariaRowIndex:j,ariaRowSpan:j,ariaSelected:Ie,ariaSetSize:j,ariaSort:null,ariaValueMax:j,ariaValueMin:j,ariaValueNow:j,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function Ao(t,e){return e in t?t[e]:e}function ko(t,e){return Ao(t,e.toLowerCase())}const o0=on({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Kt,acceptCharset:xe,accessKey:xe,action:null,allow:null,allowFullScreen:ne,allowPaymentRequest:ne,allowUserMedia:ne,alt:null,as:null,async:ne,autoCapitalize:null,autoComplete:xe,autoFocus:ne,autoPlay:ne,blocking:xe,capture:null,charSet:null,checked:ne,cite:null,className:xe,cols:j,colSpan:null,content:null,contentEditable:Ie,controls:ne,controlsList:xe,coords:j|Kt,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ne,defer:ne,dir:null,dirName:null,disabled:ne,download:yi,draggable:Ie,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ne,formTarget:null,headers:xe,height:j,hidden:yi,high:j,href:null,hrefLang:null,htmlFor:xe,httpEquiv:xe,id:null,imageSizes:null,imageSrcSet:null,inert:ne,inputMode:null,integrity:null,is:null,isMap:ne,itemId:null,itemProp:xe,itemRef:xe,itemScope:ne,itemType:xe,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ne,low:j,manifest:null,max:null,maxLength:j,media:null,method:null,min:null,minLength:j,multiple:ne,muted:ne,name:null,nonce:null,noModule:ne,noValidate:ne,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:ne,optimum:j,pattern:null,ping:xe,placeholder:null,playsInline:ne,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ne,referrerPolicy:null,rel:xe,required:ne,reversed:ne,rows:j,rowSpan:j,sandbox:xe,scope:null,scoped:ne,seamless:ne,selected:ne,shadowRootClonable:ne,shadowRootDelegatesFocus:ne,shadowRootMode:null,shape:null,size:j,sizes:null,slot:null,span:j,spellCheck:Ie,src:null,srcDoc:null,srcLang:null,srcSet:null,start:j,step:null,style:null,tabIndex:j,target:null,title:null,translate:null,type:null,typeMustMatch:ne,useMap:null,value:Ie,width:j,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:xe,axis:null,background:null,bgColor:null,border:j,borderColor:null,bottomMargin:j,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ne,declare:ne,event:null,face:null,frame:null,frameBorder:null,hSpace:j,leftMargin:j,link:null,longDesc:null,lowSrc:null,marginHeight:j,marginWidth:j,noResize:ne,noHref:ne,noShade:ne,noWrap:ne,object:null,profile:null,prompt:null,rev:null,rightMargin:j,rules:null,scheme:null,scrolling:Ie,standby:null,summary:null,text:null,topMargin:j,valueType:null,version:null,vAlign:null,vLink:null,vSpace:j,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ne,disableRemotePlayback:ne,prefix:null,property:null,results:j,security:null,unselectable:null},space:"html",transform:ko}),l0=on({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:Qe,accentHeight:j,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:j,amplitude:j,arabicForm:null,ascent:j,attributeName:null,attributeType:null,azimuth:j,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:j,by:null,calcMode:null,capHeight:j,className:xe,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:j,diffuseConstant:j,direction:null,display:null,dur:null,divisor:j,dominantBaseline:null,download:ne,dx:null,dy:null,edgeMode:null,editable:null,elevation:j,enableBackground:null,end:null,event:null,exponent:j,externalResourcesRequired:null,fill:null,fillOpacity:j,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:Kt,g2:Kt,glyphName:Kt,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:j,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:j,horizOriginX:j,horizOriginY:j,id:null,ideographic:j,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:j,k:j,k1:j,k2:j,k3:j,k4:j,kernelMatrix:Qe,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:j,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:j,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:j,overlineThickness:j,paintOrder:null,panose1:null,path:null,pathLength:j,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:xe,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:j,pointsAtY:j,pointsAtZ:j,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Qe,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Qe,rev:Qe,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Qe,requiredFeatures:Qe,requiredFonts:Qe,requiredFormats:Qe,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:j,specularExponent:j,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:j,strikethroughThickness:j,string:null,stroke:null,strokeDashArray:Qe,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:j,strokeOpacity:j,strokeWidth:null,style:null,surfaceScale:j,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Qe,tabIndex:j,tableValues:null,target:null,targetX:j,targetY:j,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Qe,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:j,underlineThickness:j,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:j,values:null,vAlphabetic:j,vMathematical:j,vectorEffect:null,vHanging:j,vIdeographic:j,version:null,vertAdvY:j,vertOriginX:j,vertOriginY:j,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:j,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Ao}),Co=on({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()}}),Io=on({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:ko}),So=on({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),c0={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"},d0=/[A-Z]/g,as=/-[a-z]/g,f0=/^data[-\w.:]+$/i;function Rr(t,e){const n=jn(e);let r=e,i=qe;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&f0.test(e)){if(e.charAt(4)==="-"){const a=e.slice(5).replace(as,p0);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=e.slice(4);if(!as.test(a)){let s=a.replace(d0,h0);s.charAt(0)!=="-"&&(s="-"+s),e="data"+s}}i=Ji}return new i(r,e)}function h0(t){return"-"+t.toLowerCase()}function p0(t){return t.charAt(1).toUpperCase()}const Xn=_o([yo,o0,Co,Io,So],"html"),Nt=_o([yo,l0,Co,Io,So],"svg");function ss(t){const e=String(t||"").trim();return e?e.split(/[ \t\n\r\f]+/g):[]}function No(t){return t.join(" ").trim()}var Vt={},Wr,us;function m0(){if(us)return Wr;us=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,u=/^\s+|\s+$/g,o=`
|
|
68
|
-
`,l="/",d="*",f="",p="comment",h="declaration";function g(y,T){if(typeof y!="string")throw new TypeError("First argument must be a string");if(!y)return[];T=T||{};var S=1,E=1;function R($){var H=$.match(e);H&&(S+=H.length);var Q=$.lastIndexOf(o);E=~Q?$.length-Q:E+$.length}function O(){var $={line:S,column:E};return function(H){return H.position=new I($),z(),H}}function I($){this.start=$,this.end={line:S,column:E},this.source=T.source}I.prototype.content=y;function v($){var H=new Error(T.source+":"+S+":"+E+": "+$);if(H.reason=$,H.filename=T.source,H.line=S,H.column=E,H.source=y,!T.silent)throw H}function B($){var H=$.exec(y);if(H){var Q=H[0];return R(Q),y=y.slice(Q.length),H}}function z(){B(n)}function N($){var H;for($=$||[];H=F();)H!==!1&&$.push(H);return $}function F(){var $=O();if(!(l!=y.charAt(0)||d!=y.charAt(1))){for(var H=2;f!=y.charAt(H)&&(d!=y.charAt(H)||l!=y.charAt(H+1));)++H;if(H+=2,f===y.charAt(H-1))return v("End of comment missing");var Q=y.slice(2,H-2);return E+=2,R(Q),y=y.slice(H),E+=2,$({type:p,comment:Q})}}function P(){var $=O(),H=B(r);if(H){if(F(),!B(i))return v("property missing ':'");var Q=B(a),te=$({type:h,property:_(H[0].replace(t,f)),value:Q?_(Q[0].replace(t,f)):f});return B(s),te}}function Z(){var $=[];N($);for(var H;H=P();)H!==!1&&($.push(H),N($));return $}return z(),Z()}function _(y){return y?y.replace(u,f):f}return Wr=g,Wr}var os;function g0(){if(os)return Vt;os=1;var t=Vt&&Vt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Vt,"__esModule",{value:!0}),Vt.default=n;const e=t(m0());function n(r,i){let a=null;if(!r||typeof r!="string")return a;const s=(0,e.default)(r),u=typeof i=="function";return s.forEach(o=>{if(o.type!=="declaration")return;const{property:l,value:d}=o;u?i(l,d,o):d&&(a=a||{},a[l]=d)}),a}return Vt}var En={},ls;function E0(){if(ls)return En;ls=1,Object.defineProperty(En,"__esModule",{value:!0}),En.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,a=function(l){return!l||n.test(l)||t.test(l)},s=function(l,d){return d.toUpperCase()},u=function(l,d){return"".concat(d,"-")},o=function(l,d){return d===void 0&&(d={}),a(l)?l:(l=l.toLowerCase(),d.reactCompat?l=l.replace(i,u):l=l.replace(r,u),l.replace(e,s))};return En.camelCase=o,En}var bn,cs;function b0(){if(cs)return bn;cs=1;var t=bn&&bn.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},e=t(g0()),n=E0();function r(i,a){var s={};return!i||typeof i!="string"||(0,e.default)(i,function(u,o){u&&o&&(s[(0,n.camelCase)(u,a)]=o)}),s}return r.default=r,bn=r,bn}var T0=b0();const x0=Ui(T0),Or=wo("end"),ct=wo("start");function wo(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 _0(t){const e=ct(t),n=Or(t);if(e&&n)return{start:e,end:n}}function wn(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?ds(t.position):"start"in t||"end"in t?ds(t):"line"in t||"column"in t?ki(t):""}function ki(t){return fs(t&&t.line)+":"+fs(t&&t.column)}function ds(t){return ki(t&&t.start)+"-"+ki(t&&t.end)}function fs(t){return t&&typeof t=="number"?t:1}class ve extends Error{constructor(e,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",a={},s=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof e=="string"?i=e:!a.cause&&e&&(s=!0,i=e.message,a.cause=e),!a.ruleId&&!a.source&&typeof r=="string"){const o=r.indexOf(":");o===-1?a.ruleId=r:(a.source=r.slice(0,o),a.ruleId=r.slice(o+1))}if(!a.place&&a.ancestors&&a.ancestors){const o=a.ancestors[a.ancestors.length-1];o&&(a.place=o.position)}const u=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=u?u.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=u?u.line:void 0,this.name=wn(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=s&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ve.prototype.file="";ve.prototype.name="";ve.prototype.reason="";ve.prototype.message="";ve.prototype.stack="";ve.prototype.column=void 0;ve.prototype.line=void 0;ve.prototype.ancestors=void 0;ve.prototype.cause=void 0;ve.prototype.fatal=void 0;ve.prototype.place=void 0;ve.prototype.ruleId=void 0;ve.prototype.source=void 0;const ea={}.hasOwnProperty,y0=new Map,A0=/[A-Z]/g,k0=new Set(["table","tbody","thead","tfoot","tr"]),C0=new Set(["td","th"]),Ro="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function I0(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=v0(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=D0(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"?Nt:Xn,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},a=Oo(i,t,void 0);return a&&typeof a!="string"?a:i.create(t,i.Fragment,{children:a||void 0},void 0)}function Oo(t,e,n){if(e.type==="element")return S0(t,e,n);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return N0(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return R0(t,e,n);if(e.type==="mdxjsEsm")return w0(t,e);if(e.type==="root")return O0(t,e,n);if(e.type==="text")return L0(t,e)}function S0(t,e,n){const r=t.schema;let i=r;e.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Nt,t.schema=i),t.ancestors.push(e);const a=Do(t,e.tagName,!1),s=P0(t,e);let u=na(t,e);return k0.has(e.tagName)&&(u=u.filter(function(o){return typeof o=="string"?!s0(o):!0})),Lo(t,s,a,e),ta(s,u),t.ancestors.pop(),t.schema=r,t.create(e,a,s,n)}function N0(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)}zn(t,e.position)}function w0(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);zn(t,e.position)}function R0(t,e,n){const r=t.schema;let i=r;e.name==="svg"&&r.space==="html"&&(i=Nt,t.schema=i),t.ancestors.push(e);const a=e.name===null?t.Fragment:Do(t,e.name,!0),s=M0(t,e),u=na(t,e);return Lo(t,s,a,e),ta(s,u),t.ancestors.pop(),t.schema=r,t.create(e,a,s,n)}function O0(t,e,n){const r={};return ta(r,na(t,e)),t.create(e,t.Fragment,r,n)}function L0(t,e){return e.value}function Lo(t,e,n,r){typeof n!="string"&&n!==t.Fragment&&t.passNode&&(e.node=r)}function ta(t,e){if(e.length>0){const n=e.length>1?e:e[0];n&&(t.children=n)}}function D0(t,e,n){return r;function r(i,a,s,u){const l=Array.isArray(s.children)?n:e;return u?l(a,s,u):l(a,s)}}function v0(t,e){return n;function n(r,i,a,s){const u=Array.isArray(a.children),o=ct(r);return e(i,a,s,u,{columnNumber:o?o.column-1:void 0,fileName:t,lineNumber:o?o.line:void 0},void 0)}}function P0(t,e){const n={};let r,i;for(i in e.properties)if(i!=="children"&&ea.call(e.properties,i)){const a=B0(t,i,e.properties[i]);if(a){const[s,u]=a;t.tableCellAlignToStyle&&s==="align"&&typeof u=="string"&&C0.has(e.tagName)?r=u:n[s]=u}}if(r){const a=n.style||(n.style={});a[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function M0(t,e){const n={};for(const r of e.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&t.evaluater){const a=r.data.estree.body[0];a.type;const s=a.expression;s.type;const u=s.properties[0];u.type,Object.assign(n,t.evaluater.evaluateExpression(u.argument))}else zn(t,e.position);else{const i=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&t.evaluater){const u=r.value.data.estree.body[0];u.type,a=t.evaluater.evaluateExpression(u.expression)}else zn(t,e.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function na(t,e){const n=[];let r=-1;const i=t.passKeys?new Map:y0;for(;++r<e.children.length;){const a=e.children[r];let s;if(t.passKeys){const o=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(o){const l=i.get(o)||0;s=o+"-"+l,i.set(o,l+1)}}const u=Oo(t,a,s);u!==void 0&&n.push(u)}return n}function B0(t,e,n){const r=Rr(t.schema,e);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?xo(n):No(n)),r.property==="style"){let i=typeof n=="object"?n:F0(t,String(n));return t.stylePropertyNameCase==="css"&&(i=U0(i)),["style",i]}return[t.elementAttributeNameCase==="react"&&r.space?c0[r.property]||r.property:r.attribute,n]}}function F0(t,e){try{return x0(e,{reactCompat:!0})}catch(n){if(t.ignoreInvalidStyle)return{};const r=n,i=new ve("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=Ro+"#cannot-parse-style-attribute",i}}function Do(t,e,n){let r;if(!n)r={type:"Literal",value:e};else if(e.includes(".")){const i=e.split(".");let a=-1,s;for(;++a<i.length;){const u=ns(i[a])?{type:"Identifier",name:i[a]}:{type:"Literal",value:i[a]};s=s?{type:"MemberExpression",object:s,property:u,computed:!!(a&&u.type==="Literal"),optional:!1}:u}r=s}else r=ns(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(r.type==="Literal"){const i=r.value;return ea.call(t.components,i)?t.components[i]:i}if(t.evaluater)return t.evaluater.evaluateExpression(r);zn(t)}function zn(t,e){const n=new ve("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=Ro+"#cannot-handle-mdx-estrees-without-createevaluater",n}function U0(t){const e={};let n;for(n in t)ea.call(t,n)&&(e[H0(n)]=t[n]);return e}function H0(t){let e=t.replace(A0,j0);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function j0(t){return"-"+t.toLowerCase()}const Qr={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"]},z0={};function ra(t,e){const n=z0,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return vo(t,r,i)}function vo(t,e,n){if($0(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 hs(t.children,e,n)}return Array.isArray(t)?hs(t,e,n):""}function hs(t,e,n){const r=[];let i=-1;for(;++i<t.length;)r[i]=vo(t[i],e,n);return r.join("")}function $0(t){return!!(t&&typeof t=="object")}const ps=document.createElement("i");function ia(t){const e="&"+t+";";ps.innerHTML=e;const n=ps.textContent;return n.charCodeAt(n.length-1)===59&&t!=="semi"||n===e?!1:n}function Ge(t,e,n,r){const i=t.length;let a=0,s;if(e<0?e=-e>i?0:i+e:e=e>i?i:e,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(e,n),t.splice(...s);else for(n&&t.splice(e,n);a<r.length;)s=r.slice(a,a+1e4),s.unshift(e,0),t.splice(...s),a+=1e4,e+=1e4}function Je(t,e){return t.length>0?(Ge(t,t.length,0,e),t):e}const ms={}.hasOwnProperty;function Po(t){const e={};let n=-1;for(;++n<t.length;)Y0(e,t[n]);return e}function Y0(t,e){let n;for(n in e){const i=(ms.call(t,n)?t[n]:void 0)||(t[n]={}),a=e[n];let s;if(a)for(s in a){ms.call(i,s)||(i[s]=[]);const u=a[s];q0(i[s],Array.isArray(u)?u:u?[u]:[])}}}function q0(t,e){let n=-1;const r=[];for(;++n<e.length;)(e[n].add==="after"?t:r).push(e[n]);Ge(t,0,0,r)}function Mo(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 it(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Fe=wt(/[A-Za-z]/),De=wt(/[\dA-Za-z]/),V0=wt(/[#-'*+\--9=?A-Z^-~]/);function Tr(t){return t!==null&&(t<32||t===127)}const Ci=wt(/\d/),W0=wt(/[\dA-Fa-f]/),Q0=wt(/[!-/:-@[-`{-~]/);function G(t){return t!==null&&t<-2}function Te(t){return t!==null&&(t<0||t===32)}function ie(t){return t===-2||t===-1||t===32}const Lr=wt(new RegExp("\\p{P}|\\p{S}","u")),Ht=wt(/\s/);function wt(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function ln(t){const e=[];let n=-1,r=0,i=0;for(;++n<t.length;){const a=t.charCodeAt(n);let s="";if(a===37&&De(t.charCodeAt(n+1))&&De(t.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(s=String.fromCharCode(a));else if(a>55295&&a<57344){const u=t.charCodeAt(n+1);a<56320&&u>56319&&u<57344?(s=String.fromCharCode(a,u),i=1):s="�"}else s=String.fromCharCode(a);s&&(e.push(t.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return e.join("")+t.slice(r)}function oe(t,e,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return s;function s(o){return ie(o)?(t.enter(n),u(o)):e(o)}function u(o){return ie(o)&&a++<i?(t.consume(o),u):(t.exit(n),e(o))}}const G0={tokenize:X0};function X0(t){const e=t.attempt(this.parser.constructs.contentInitial,r,i);let n;return e;function r(u){if(u===null){t.consume(u);return}return t.enter("lineEnding"),t.consume(u),t.exit("lineEnding"),oe(t,e,"linePrefix")}function i(u){return t.enter("paragraph"),a(u)}function a(u){const o=t.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=o),n=o,s(u)}function s(u){if(u===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(u);return}return G(u)?(t.consume(u),t.exit("chunkText"),a):(t.consume(u),s)}}const Z0={tokenize:K0},gs={tokenize:J0};function K0(t){const e=this,n=[];let r=0,i,a,s;return u;function u(E){if(r<n.length){const R=n[r];return e.containerState=R[1],t.attempt(R[0].continuation,o,l)(E)}return l(E)}function o(E){if(r++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,i&&S();const R=e.events.length;let O=R,I;for(;O--;)if(e.events[O][0]==="exit"&&e.events[O][1].type==="chunkFlow"){I=e.events[O][1].end;break}T(r);let v=R;for(;v<e.events.length;)e.events[v][1].end={...I},v++;return Ge(e.events,O+1,0,e.events.slice(R)),e.events.length=v,l(E)}return u(E)}function l(E){if(r===n.length){if(!i)return p(E);if(i.currentConstruct&&i.currentConstruct.concrete)return g(E);e.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(gs,d,f)(E)}function d(E){return i&&S(),T(r),p(E)}function f(E){return e.parser.lazy[e.now().line]=r!==n.length,s=e.now().offset,g(E)}function p(E){return e.containerState={},t.attempt(gs,h,g)(E)}function h(E){return r++,n.push([e.currentConstruct,e.containerState]),p(E)}function g(E){if(E===null){i&&S(),T(0),t.consume(E);return}return i=i||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:a}),_(E)}function _(E){if(E===null){y(t.exit("chunkFlow"),!0),T(0),t.consume(E);return}return G(E)?(t.consume(E),y(t.exit("chunkFlow")),r=0,e.interrupt=void 0,u):(t.consume(E),_)}function y(E,R){const O=e.sliceStream(E);if(R&&O.push(null),E.previous=a,a&&(a.next=E),a=E,i.defineSkip(E.start),i.write(O),e.parser.lazy[E.start.line]){let I=i.events.length;for(;I--;)if(i.events[I][1].start.offset<s&&(!i.events[I][1].end||i.events[I][1].end.offset>s))return;const v=e.events.length;let B=v,z,N;for(;B--;)if(e.events[B][0]==="exit"&&e.events[B][1].type==="chunkFlow"){if(z){N=e.events[B][1].end;break}z=!0}for(T(r),I=v;I<e.events.length;)e.events[I][1].end={...N},I++;Ge(e.events,B+1,0,e.events.slice(v)),e.events.length=I}}function T(E){let R=n.length;for(;R-- >E;){const O=n[R];e.containerState=O[1],O[0].exit.call(e,t)}n.length=E}function S(){i.write([null]),a=void 0,i=void 0,e.containerState._closeFlow=void 0}}function J0(t,e,n){return oe(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function tn(t){if(t===null||Te(t)||Ht(t))return 1;if(Lr(t))return 2}function Dr(t,e,n){const r=[];let i=-1;for(;++i<t.length;){const a=t[i].resolveAll;a&&!r.includes(a)&&(e=a(e,n),r.push(a))}return e}const Ii={name:"attention",resolveAll:ep,tokenize:tp};function ep(t,e){let n=-1,r,i,a,s,u,o,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;o=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 f={...t[r][1].end},p={...t[n][1].start};Es(f,-o),Es(p,o),s={type:o>1?"strongSequence":"emphasisSequence",start:f,end:{...t[r][1].end}},u={type:o>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:p},a={type:o>1?"strongText":"emphasisText",start:{...t[r][1].end},end:{...t[n][1].start}},i={type:o>1?"strong":"emphasis",start:{...s.start},end:{...u.end}},t[r][1].end={...s.start},t[n][1].start={...u.end},l=[],t[r][1].end.offset-t[r][1].start.offset&&(l=Je(l,[["enter",t[r][1],e],["exit",t[r][1],e]])),l=Je(l,[["enter",i,e],["enter",s,e],["exit",s,e],["enter",a,e]]),l=Je(l,Dr(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),l=Je(l,[["exit",a,e],["enter",u,e],["exit",u,e],["exit",i,e]]),t[n][1].end.offset-t[n][1].start.offset?(d=2,l=Je(l,[["enter",t[n][1],e],["exit",t[n][1],e]])):d=0,Ge(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 tp(t,e){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=tn(r);let a;return s;function s(o){return a=o,t.enter("attentionSequence"),u(o)}function u(o){if(o===a)return t.consume(o),u;const l=t.exit("attentionSequence"),d=tn(o),f=!d||d===2&&i||n.includes(o),p=!i||i===2&&d||n.includes(r);return l._open=!!(a===42?f:f&&(i||!p)),l._close=!!(a===42?p:p&&(d||!f)),e(o)}}function Es(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const np={name:"autolink",tokenize:rp};function rp(t,e,n){let r=0;return i;function i(h){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(h),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),a}function a(h){return Fe(h)?(t.consume(h),s):h===64?n(h):l(h)}function s(h){return h===43||h===45||h===46||De(h)?(r=1,u(h)):l(h)}function u(h){return h===58?(t.consume(h),r=0,o):(h===43||h===45||h===46||De(h))&&r++<32?(t.consume(h),u):(r=0,l(h))}function o(h){return h===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(h),t.exit("autolinkMarker"),t.exit("autolink"),e):h===null||h===32||h===60||Tr(h)?n(h):(t.consume(h),o)}function l(h){return h===64?(t.consume(h),d):V0(h)?(t.consume(h),l):n(h)}function d(h){return De(h)?f(h):n(h)}function f(h){return h===46?(t.consume(h),r=0,d):h===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(h),t.exit("autolinkMarker"),t.exit("autolink"),e):p(h)}function p(h){if((h===45||De(h))&&r++<63){const g=h===45?p:f;return t.consume(h),g}return n(h)}}const Zn={partial:!0,tokenize:ip};function ip(t,e,n){return r;function r(a){return ie(a)?oe(t,i,"linePrefix")(a):i(a)}function i(a){return a===null||G(a)?e(a):n(a)}}const Bo={continuation:{tokenize:sp},exit:up,name:"blockQuote",tokenize:ap};function ap(t,e,n){const r=this;return i;function i(s){if(s===62){const u=r.containerState;return u.open||(t.enter("blockQuote",{_container:!0}),u.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(s),t.exit("blockQuoteMarker"),a}return n(s)}function a(s){return ie(s)?(t.enter("blockQuotePrefixWhitespace"),t.consume(s),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(s))}}function sp(t,e,n){const r=this;return i;function i(s){return ie(s)?oe(t,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):a(s)}function a(s){return t.attempt(Bo,e,n)(s)}}function up(t){t.exit("blockQuote")}const Fo={name:"characterEscape",tokenize:op};function op(t,e,n){return r;function r(a){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(a),t.exit("escapeMarker"),i}function i(a){return Q0(a)?(t.enter("characterEscapeValue"),t.consume(a),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):n(a)}}const Uo={name:"characterReference",tokenize:lp};function lp(t,e,n){const r=this;let i=0,a,s;return u;function u(f){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(f),t.exit("characterReferenceMarker"),o}function o(f){return f===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(f),t.exit("characterReferenceMarkerNumeric"),l):(t.enter("characterReferenceValue"),a=31,s=De,d(f))}function l(f){return f===88||f===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(f),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),a=6,s=W0,d):(t.enter("characterReferenceValue"),a=7,s=Ci,d(f))}function d(f){if(f===59&&i){const p=t.exit("characterReferenceValue");return s===De&&!ia(r.sliceSerialize(p))?n(f):(t.enter("characterReferenceMarker"),t.consume(f),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return s(f)&&i++<a?(t.consume(f),d):n(f)}}const bs={partial:!0,tokenize:dp},Ts={concrete:!0,name:"codeFenced",tokenize:cp};function cp(t,e,n){const r=this,i={partial:!0,tokenize:O};let a=0,s=0,u;return o;function o(I){return l(I)}function l(I){const v=r.events[r.events.length-1];return a=v&&v[1].type==="linePrefix"?v[2].sliceSerialize(v[1],!0).length:0,u=I,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),d(I)}function d(I){return I===u?(s++,t.consume(I),d):s<3?n(I):(t.exit("codeFencedFenceSequence"),ie(I)?oe(t,f,"whitespace")(I):f(I))}function f(I){return I===null||G(I)?(t.exit("codeFencedFence"),r.interrupt?e(I):t.check(bs,_,R)(I)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),p(I))}function p(I){return I===null||G(I)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),f(I)):ie(I)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),oe(t,h,"whitespace")(I)):I===96&&I===u?n(I):(t.consume(I),p)}function h(I){return I===null||G(I)?f(I):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),g(I))}function g(I){return I===null||G(I)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),f(I)):I===96&&I===u?n(I):(t.consume(I),g)}function _(I){return t.attempt(i,R,y)(I)}function y(I){return t.enter("lineEnding"),t.consume(I),t.exit("lineEnding"),T}function T(I){return a>0&&ie(I)?oe(t,S,"linePrefix",a+1)(I):S(I)}function S(I){return I===null||G(I)?t.check(bs,_,R)(I):(t.enter("codeFlowValue"),E(I))}function E(I){return I===null||G(I)?(t.exit("codeFlowValue"),S(I)):(t.consume(I),E)}function R(I){return t.exit("codeFenced"),e(I)}function O(I,v,B){let z=0;return N;function N(H){return I.enter("lineEnding"),I.consume(H),I.exit("lineEnding"),F}function F(H){return I.enter("codeFencedFence"),ie(H)?oe(I,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H):P(H)}function P(H){return H===u?(I.enter("codeFencedFenceSequence"),Z(H)):B(H)}function Z(H){return H===u?(z++,I.consume(H),Z):z>=s?(I.exit("codeFencedFenceSequence"),ie(H)?oe(I,$,"whitespace")(H):$(H)):B(H)}function $(H){return H===null||G(H)?(I.exit("codeFencedFence"),v(H)):B(H)}}}function dp(t,e,n){const r=this;return i;function i(s){return s===null?n(s):(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),a)}function a(s){return r.parser.lazy[r.now().line]?n(s):e(s)}}const Gr={name:"codeIndented",tokenize:hp},fp={partial:!0,tokenize:pp};function hp(t,e,n){const r=this;return i;function i(l){return t.enter("codeIndented"),oe(t,a,"linePrefix",5)(l)}function a(l){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?s(l):n(l)}function s(l){return l===null?o(l):G(l)?t.attempt(fp,s,o)(l):(t.enter("codeFlowValue"),u(l))}function u(l){return l===null||G(l)?(t.exit("codeFlowValue"),s(l)):(t.consume(l),u)}function o(l){return t.exit("codeIndented"),e(l)}}function pp(t,e,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):G(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),i):oe(t,a,"linePrefix",5)(s)}function a(s){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?e(s):G(s)?i(s):n(s)}}const mp={name:"codeText",previous:Ep,resolve:gp,tokenize:bp};function gp(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 Ep(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function bp(t,e,n){let r=0,i,a;return s;function s(f){return t.enter("codeText"),t.enter("codeTextSequence"),u(f)}function u(f){return f===96?(t.consume(f),r++,u):(t.exit("codeTextSequence"),o(f))}function o(f){return f===null?n(f):f===32?(t.enter("space"),t.consume(f),t.exit("space"),o):f===96?(a=t.enter("codeTextSequence"),i=0,d(f)):G(f)?(t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),o):(t.enter("codeTextData"),l(f))}function l(f){return f===null||f===32||f===96||G(f)?(t.exit("codeTextData"),o(f)):(t.consume(f),l)}function d(f){return f===96?(t.consume(f),i++,d):i===r?(t.exit("codeTextSequence"),t.exit("codeText"),e(f)):(a.type="codeTextData",l(f))}}class Tp{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 a=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Tn(this.left,r),a.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),Tn(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Tn(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);Tn(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);Tn(this.left,n.reverse())}}}function Tn(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 Ho(t){const e={};let n=-1,r,i,a,s,u,o,l;const d=new Tp(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"&&(o=r[1]._tokenizer.events,a=0,a<o.length&&o[a][1].type==="lineEndingBlank"&&(a+=2),a<o.length&&o[a][1].type==="content"))for(;++a<o.length&&o[a][1].type!=="content";)o[a][1].type==="chunkText"&&(o[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(e,xp(d,n)),n=e[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(s=d.get(a),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(d.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=a);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(r[1].end={...d.get(i)[1].start},u=d.slice(i,n),u.unshift(r),d.splice(i,n-i+1,u))}}return Ge(t,0,Number.POSITIVE_INFINITY,d.slice(0)),!l}function xp(t,e){const n=t.get(e)[1],r=t.get(e)[2];let i=e-1;const a=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const u=s.events,o=[],l={};let d,f,p=-1,h=n,g=0,_=0;const y=[_];for(;h;){for(;t.get(++i)[1]!==h;);a.push(i),h._tokenizer||(d=r.sliceStream(h),h.next||d.push(null),f&&s.defineSkip(h.start),h._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(d),h._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),f=h,h=h.next}for(h=n;++p<u.length;)u[p][0]==="exit"&&u[p-1][0]==="enter"&&u[p][1].type===u[p-1][1].type&&u[p][1].start.line!==u[p][1].end.line&&(_=p+1,y.push(_),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(s.events=[],h?(h._tokenizer=void 0,h.previous=void 0):y.pop(),p=y.length;p--;){const T=u.slice(y[p],y[p+1]),S=a.pop();o.push([S,S+T.length-1]),t.splice(S,2,T)}for(o.reverse(),p=-1;++p<o.length;)l[g+o[p][0]]=g+o[p][1],g+=o[p][1]-o[p][0]-1;return l}const _p={resolve:Ap,tokenize:kp},yp={partial:!0,tokenize:Cp};function Ap(t){return Ho(t),t}function kp(t,e){let n;return r;function r(u){return t.enter("content"),n=t.enter("chunkContent",{contentType:"content"}),i(u)}function i(u){return u===null?a(u):G(u)?t.check(yp,s,a)(u):(t.consume(u),i)}function a(u){return t.exit("chunkContent"),t.exit("content"),e(u)}function s(u){return t.consume(u),t.exit("chunkContent"),n.next=t.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function Cp(t,e,n){const r=this;return i;function i(s){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),oe(t,a,"linePrefix")}function a(s){if(s===null||G(s))return n(s);const u=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?e(s):t.interrupt(r.parser.constructs.flow,n,e)(s)}}function jo(t,e,n,r,i,a,s,u,o){const l=o||Number.POSITIVE_INFINITY;let d=0;return f;function f(T){return T===60?(t.enter(r),t.enter(i),t.enter(a),t.consume(T),t.exit(a),p):T===null||T===32||T===41||Tr(T)?n(T):(t.enter(r),t.enter(s),t.enter(u),t.enter("chunkString",{contentType:"string"}),_(T))}function p(T){return T===62?(t.enter(a),t.consume(T),t.exit(a),t.exit(i),t.exit(r),e):(t.enter(u),t.enter("chunkString",{contentType:"string"}),h(T))}function h(T){return T===62?(t.exit("chunkString"),t.exit(u),p(T)):T===null||T===60||G(T)?n(T):(t.consume(T),T===92?g:h)}function g(T){return T===60||T===62||T===92?(t.consume(T),h):h(T)}function _(T){return!d&&(T===null||T===41||Te(T))?(t.exit("chunkString"),t.exit(u),t.exit(s),t.exit(r),e(T)):d<l&&T===40?(t.consume(T),d++,_):T===41?(t.consume(T),d--,_):T===null||T===32||T===40||Tr(T)?n(T):(t.consume(T),T===92?y:_)}function y(T){return T===40||T===41||T===92?(t.consume(T),_):_(T)}}function zo(t,e,n,r,i,a){const s=this;let u=0,o;return l;function l(h){return t.enter(r),t.enter(i),t.consume(h),t.exit(i),t.enter(a),d}function d(h){return u>999||h===null||h===91||h===93&&!o||h===94&&!u&&"_hiddenFootnoteSupport"in s.parser.constructs?n(h):h===93?(t.exit(a),t.enter(i),t.consume(h),t.exit(i),t.exit(r),e):G(h)?(t.enter("lineEnding"),t.consume(h),t.exit("lineEnding"),d):(t.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===null||h===91||h===93||G(h)||u++>999?(t.exit("chunkString"),d(h)):(t.consume(h),o||(o=!ie(h)),h===92?p:f)}function p(h){return h===91||h===92||h===93?(t.consume(h),u++,f):f(h)}}function $o(t,e,n,r,i,a){let s;return u;function u(p){return p===34||p===39||p===40?(t.enter(r),t.enter(i),t.consume(p),t.exit(i),s=p===40?41:p,o):n(p)}function o(p){return p===s?(t.enter(i),t.consume(p),t.exit(i),t.exit(r),e):(t.enter(a),l(p))}function l(p){return p===s?(t.exit(a),o(s)):p===null?n(p):G(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),oe(t,l,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===s||p===null||G(p)?(t.exit("chunkString"),l(p)):(t.consume(p),p===92?f:d)}function f(p){return p===s||p===92?(t.consume(p),d):d(p)}}function Rn(t,e){let n;return r;function r(i){return G(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),n=!0,r):ie(i)?oe(t,r,n?"linePrefix":"lineSuffix")(i):e(i)}}const Ip={name:"definition",tokenize:Np},Sp={partial:!0,tokenize:wp};function Np(t,e,n){const r=this;let i;return a;function a(h){return t.enter("definition"),s(h)}function s(h){return zo.call(r,t,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function u(h){return i=it(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(t.enter("definitionMarker"),t.consume(h),t.exit("definitionMarker"),o):n(h)}function o(h){return Te(h)?Rn(t,l)(h):l(h)}function l(h){return jo(t,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function d(h){return t.attempt(Sp,f,f)(h)}function f(h){return ie(h)?oe(t,p,"whitespace")(h):p(h)}function p(h){return h===null||G(h)?(t.exit("definition"),r.parser.defined.push(i),e(h)):n(h)}}function wp(t,e,n){return r;function r(u){return Te(u)?Rn(t,i)(u):n(u)}function i(u){return $o(t,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function a(u){return ie(u)?oe(t,s,"whitespace")(u):s(u)}function s(u){return u===null||G(u)?e(u):n(u)}}const Rp={name:"hardBreakEscape",tokenize:Op};function Op(t,e,n){return r;function r(a){return t.enter("hardBreakEscape"),t.consume(a),i}function i(a){return G(a)?(t.exit("hardBreakEscape"),e(a)):n(a)}}const Lp={name:"headingAtx",resolve:Dp,tokenize:vp};function Dp(t,e){let n=t.length-2,r=3,i,a;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},a={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"},Ge(t,r,n-r+1,[["enter",i,e],["enter",a,e],["exit",a,e],["exit",i,e]])),t}function vp(t,e,n){let r=0;return i;function i(d){return t.enter("atxHeading"),a(d)}function a(d){return t.enter("atxHeadingSequence"),s(d)}function s(d){return d===35&&r++<6?(t.consume(d),s):d===null||Te(d)?(t.exit("atxHeadingSequence"),u(d)):n(d)}function u(d){return d===35?(t.enter("atxHeadingSequence"),o(d)):d===null||G(d)?(t.exit("atxHeading"),e(d)):ie(d)?oe(t,u,"whitespace")(d):(t.enter("atxHeadingText"),l(d))}function o(d){return d===35?(t.consume(d),o):(t.exit("atxHeadingSequence"),u(d))}function l(d){return d===null||d===35||Te(d)?(t.exit("atxHeadingText"),u(d)):(t.consume(d),l)}}const Pp=["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"],xs=["pre","script","style","textarea"],Mp={concrete:!0,name:"htmlFlow",resolveTo:Up,tokenize:Hp},Bp={partial:!0,tokenize:zp},Fp={partial:!0,tokenize:jp};function Up(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 Hp(t,e,n){const r=this;let i,a,s,u,o;return l;function l(C){return d(C)}function d(C){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(C),f}function f(C){return C===33?(t.consume(C),p):C===47?(t.consume(C),a=!0,_):C===63?(t.consume(C),i=3,r.interrupt?e:k):Fe(C)?(t.consume(C),s=String.fromCharCode(C),y):n(C)}function p(C){return C===45?(t.consume(C),i=2,h):C===91?(t.consume(C),i=5,u=0,g):Fe(C)?(t.consume(C),i=4,r.interrupt?e:k):n(C)}function h(C){return C===45?(t.consume(C),r.interrupt?e:k):n(C)}function g(C){const le="CDATA[";return C===le.charCodeAt(u++)?(t.consume(C),u===le.length?r.interrupt?e:P:g):n(C)}function _(C){return Fe(C)?(t.consume(C),s=String.fromCharCode(C),y):n(C)}function y(C){if(C===null||C===47||C===62||Te(C)){const le=C===47,de=s.toLowerCase();return!le&&!a&&xs.includes(de)?(i=1,r.interrupt?e(C):P(C)):Pp.includes(s.toLowerCase())?(i=6,le?(t.consume(C),T):r.interrupt?e(C):P(C)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(C):a?S(C):E(C))}return C===45||De(C)?(t.consume(C),s+=String.fromCharCode(C),y):n(C)}function T(C){return C===62?(t.consume(C),r.interrupt?e:P):n(C)}function S(C){return ie(C)?(t.consume(C),S):N(C)}function E(C){return C===47?(t.consume(C),N):C===58||C===95||Fe(C)?(t.consume(C),R):ie(C)?(t.consume(C),E):N(C)}function R(C){return C===45||C===46||C===58||C===95||De(C)?(t.consume(C),R):O(C)}function O(C){return C===61?(t.consume(C),I):ie(C)?(t.consume(C),O):E(C)}function I(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(t.consume(C),o=C,v):ie(C)?(t.consume(C),I):B(C)}function v(C){return C===o?(t.consume(C),o=null,z):C===null||G(C)?n(C):(t.consume(C),v)}function B(C){return C===null||C===34||C===39||C===47||C===60||C===61||C===62||C===96||Te(C)?O(C):(t.consume(C),B)}function z(C){return C===47||C===62||ie(C)?E(C):n(C)}function N(C){return C===62?(t.consume(C),F):n(C)}function F(C){return C===null||G(C)?P(C):ie(C)?(t.consume(C),F):n(C)}function P(C){return C===45&&i===2?(t.consume(C),Q):C===60&&i===1?(t.consume(C),te):C===62&&i===4?(t.consume(C),ae):C===63&&i===3?(t.consume(C),k):C===93&&i===5?(t.consume(C),ge):G(C)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(Bp,me,Z)(C)):C===null||G(C)?(t.exit("htmlFlowData"),Z(C)):(t.consume(C),P)}function Z(C){return t.check(Fp,$,me)(C)}function $(C){return t.enter("lineEnding"),t.consume(C),t.exit("lineEnding"),H}function H(C){return C===null||G(C)?Z(C):(t.enter("htmlFlowData"),P(C))}function Q(C){return C===45?(t.consume(C),k):P(C)}function te(C){return C===47?(t.consume(C),s="",K):P(C)}function K(C){if(C===62){const le=s.toLowerCase();return xs.includes(le)?(t.consume(C),ae):P(C)}return Fe(C)&&s.length<8?(t.consume(C),s+=String.fromCharCode(C),K):P(C)}function ge(C){return C===93?(t.consume(C),k):P(C)}function k(C){return C===62?(t.consume(C),ae):C===45&&i===2?(t.consume(C),k):P(C)}function ae(C){return C===null||G(C)?(t.exit("htmlFlowData"),me(C)):(t.consume(C),ae)}function me(C){return t.exit("htmlFlow"),e(C)}}function jp(t,e,n){const r=this;return i;function i(s){return G(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),a):n(s)}function a(s){return r.parser.lazy[r.now().line]?n(s):e(s)}}function zp(t,e,n){return r;function r(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(Zn,e,n)}}const $p={name:"htmlText",tokenize:Yp};function Yp(t,e,n){const r=this;let i,a,s;return u;function u(k){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(k),o}function o(k){return k===33?(t.consume(k),l):k===47?(t.consume(k),O):k===63?(t.consume(k),E):Fe(k)?(t.consume(k),B):n(k)}function l(k){return k===45?(t.consume(k),d):k===91?(t.consume(k),a=0,g):Fe(k)?(t.consume(k),S):n(k)}function d(k){return k===45?(t.consume(k),h):n(k)}function f(k){return k===null?n(k):k===45?(t.consume(k),p):G(k)?(s=f,te(k)):(t.consume(k),f)}function p(k){return k===45?(t.consume(k),h):f(k)}function h(k){return k===62?Q(k):k===45?p(k):f(k)}function g(k){const ae="CDATA[";return k===ae.charCodeAt(a++)?(t.consume(k),a===ae.length?_:g):n(k)}function _(k){return k===null?n(k):k===93?(t.consume(k),y):G(k)?(s=_,te(k)):(t.consume(k),_)}function y(k){return k===93?(t.consume(k),T):_(k)}function T(k){return k===62?Q(k):k===93?(t.consume(k),T):_(k)}function S(k){return k===null||k===62?Q(k):G(k)?(s=S,te(k)):(t.consume(k),S)}function E(k){return k===null?n(k):k===63?(t.consume(k),R):G(k)?(s=E,te(k)):(t.consume(k),E)}function R(k){return k===62?Q(k):E(k)}function O(k){return Fe(k)?(t.consume(k),I):n(k)}function I(k){return k===45||De(k)?(t.consume(k),I):v(k)}function v(k){return G(k)?(s=v,te(k)):ie(k)?(t.consume(k),v):Q(k)}function B(k){return k===45||De(k)?(t.consume(k),B):k===47||k===62||Te(k)?z(k):n(k)}function z(k){return k===47?(t.consume(k),Q):k===58||k===95||Fe(k)?(t.consume(k),N):G(k)?(s=z,te(k)):ie(k)?(t.consume(k),z):Q(k)}function N(k){return k===45||k===46||k===58||k===95||De(k)?(t.consume(k),N):F(k)}function F(k){return k===61?(t.consume(k),P):G(k)?(s=F,te(k)):ie(k)?(t.consume(k),F):z(k)}function P(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(t.consume(k),i=k,Z):G(k)?(s=P,te(k)):ie(k)?(t.consume(k),P):(t.consume(k),$)}function Z(k){return k===i?(t.consume(k),i=void 0,H):k===null?n(k):G(k)?(s=Z,te(k)):(t.consume(k),Z)}function $(k){return k===null||k===34||k===39||k===60||k===61||k===96?n(k):k===47||k===62||Te(k)?z(k):(t.consume(k),$)}function H(k){return k===47||k===62||Te(k)?z(k):n(k)}function Q(k){return k===62?(t.consume(k),t.exit("htmlTextData"),t.exit("htmlText"),e):n(k)}function te(k){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(k),t.exit("lineEnding"),K}function K(k){return ie(k)?oe(t,ge,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):ge(k)}function ge(k){return t.enter("htmlTextData"),s(k)}}const aa={name:"labelEnd",resolveAll:Qp,resolveTo:Gp,tokenize:Xp},qp={tokenize:Zp},Vp={tokenize:Kp},Wp={tokenize:Jp};function Qp(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&&Ge(t,0,t.length,n),t}function Gp(t,e){let n=t.length,r=0,i,a,s,u;for(;n--;)if(i=t[n][1],a){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;t[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(t[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(a=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const o={type:t[a][1].type==="labelLink"?"link":"image",start:{...t[a][1].start},end:{...t[t.length-1][1].end}},l={type:"label",start:{...t[a][1].start},end:{...t[s][1].end}},d={type:"labelText",start:{...t[a+r+2][1].end},end:{...t[s-2][1].start}};return u=[["enter",o,e],["enter",l,e]],u=Je(u,t.slice(a+1,a+r+3)),u=Je(u,[["enter",d,e]]),u=Je(u,Dr(e.parser.constructs.insideSpan.null,t.slice(a+r+4,s-3),e)),u=Je(u,[["exit",d,e],t[s-2],t[s-1],["exit",l,e]]),u=Je(u,t.slice(s+1)),u=Je(u,[["exit",o,e]]),Ge(t,a,t.length,u),t}function Xp(t,e,n){const r=this;let i=r.events.length,a,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){a=r.events[i][1];break}return u;function u(p){return a?a._inactive?f(p):(s=r.parser.defined.includes(it(r.sliceSerialize({start:a.end,end:r.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(p),t.exit("labelMarker"),t.exit("labelEnd"),o):n(p)}function o(p){return p===40?t.attempt(qp,d,s?d:f)(p):p===91?t.attempt(Vp,d,s?l:f)(p):s?d(p):f(p)}function l(p){return t.attempt(Wp,d,f)(p)}function d(p){return e(p)}function f(p){return a._balanced=!0,n(p)}}function Zp(t,e,n){return r;function r(f){return t.enter("resource"),t.enter("resourceMarker"),t.consume(f),t.exit("resourceMarker"),i}function i(f){return Te(f)?Rn(t,a)(f):a(f)}function a(f){return f===41?d(f):jo(t,s,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function s(f){return Te(f)?Rn(t,o)(f):d(f)}function u(f){return n(f)}function o(f){return f===34||f===39||f===40?$o(t,l,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):d(f)}function l(f){return Te(f)?Rn(t,d)(f):d(f)}function d(f){return f===41?(t.enter("resourceMarker"),t.consume(f),t.exit("resourceMarker"),t.exit("resource"),e):n(f)}}function Kp(t,e,n){const r=this;return i;function i(u){return zo.call(r,t,a,s,"reference","referenceMarker","referenceString")(u)}function a(u){return r.parser.defined.includes(it(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?e(u):n(u)}function s(u){return n(u)}}function Jp(t,e,n){return r;function r(a){return t.enter("reference"),t.enter("referenceMarker"),t.consume(a),t.exit("referenceMarker"),i}function i(a){return a===93?(t.enter("referenceMarker"),t.consume(a),t.exit("referenceMarker"),t.exit("reference"),e):n(a)}}const em={name:"labelStartImage",resolveAll:aa.resolveAll,tokenize:tm};function tm(t,e,n){const r=this;return i;function i(u){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(u),t.exit("labelImageMarker"),a}function a(u){return u===91?(t.enter("labelMarker"),t.consume(u),t.exit("labelMarker"),t.exit("labelImage"),s):n(u)}function s(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):e(u)}}const nm={name:"labelStartLink",resolveAll:aa.resolveAll,tokenize:rm};function rm(t,e,n){const r=this;return i;function i(s){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(s),t.exit("labelMarker"),t.exit("labelLink"),a}function a(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):e(s)}}const Xr={name:"lineEnding",tokenize:im};function im(t,e){return n;function n(r){return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),oe(t,e,"linePrefix")}}const dr={name:"thematicBreak",tokenize:am};function am(t,e,n){let r=0,i;return a;function a(l){return t.enter("thematicBreak"),s(l)}function s(l){return i=l,u(l)}function u(l){return l===i?(t.enter("thematicBreakSequence"),o(l)):r>=3&&(l===null||G(l))?(t.exit("thematicBreak"),e(l)):n(l)}function o(l){return l===i?(t.consume(l),r++,o):(t.exit("thematicBreakSequence"),ie(l)?oe(t,u,"whitespace")(l):u(l))}}const ze={continuation:{tokenize:lm},exit:dm,name:"list",tokenize:om},sm={partial:!0,tokenize:fm},um={partial:!0,tokenize:cm};function om(t,e,n){const r=this,i=r.events[r.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return u;function u(h){const g=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:Ci(h)){if(r.containerState.type||(r.containerState.type=g,t.enter(g,{_container:!0})),g==="listUnordered")return t.enter("listItemPrefix"),h===42||h===45?t.check(dr,n,l)(h):l(h);if(!r.interrupt||h===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),o(h)}return n(h)}function o(h){return Ci(h)&&++s<10?(t.consume(h),o):(!r.interrupt||s<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(t.exit("listItemValue"),l(h)):n(h)}function l(h){return t.enter("listItemMarker"),t.consume(h),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,t.check(Zn,r.interrupt?n:d,t.attempt(sm,p,f))}function d(h){return r.containerState.initialBlankLine=!0,a++,p(h)}function f(h){return ie(h)?(t.enter("listItemPrefixWhitespace"),t.consume(h),t.exit("listItemPrefixWhitespace"),p):n(h)}function p(h){return r.containerState.size=a+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(h)}}function lm(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(Zn,i,a);function i(u){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,oe(t,e,"listItemIndent",r.containerState.size+1)(u)}function a(u){return r.containerState.furtherBlankLines||!ie(u)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(u)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(um,e,s)(u))}function s(u){return r.containerState._closeFlow=!0,r.interrupt=void 0,oe(t,t.attempt(ze,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function cm(t,e,n){const r=this;return oe(t,i,"listItemIndent",r.containerState.size+1);function i(a){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?e(a):n(a)}}function dm(t){t.exit(this.containerState.type)}function fm(t,e,n){const r=this;return oe(t,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const s=r.events[r.events.length-1];return!ie(a)&&s&&s[1].type==="listItemPrefixWhitespace"?e(a):n(a)}}const _s={name:"setextUnderline",resolveTo:hm,tokenize:pm};function hm(t,e){let n=t.length,r,i,a;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),!a&&t[n][1].type==="definition"&&(a=n);const s={type:"setextHeading",start:{...t[r][1].start},end:{...t[t.length-1][1].end}};return t[i][1].type="setextHeadingText",a?(t.splice(i,0,["enter",s,e]),t.splice(a+1,0,["exit",t[r][1],e]),t[r][1].end={...t[a][1].end}):t[r][1]=s,t.push(["exit",s,e]),t}function pm(t,e,n){const r=this;let i;return a;function a(l){let d=r.events.length,f;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){f=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(t.enter("setextHeadingLine"),i=l,s(l)):n(l)}function s(l){return t.enter("setextHeadingLineSequence"),u(l)}function u(l){return l===i?(t.consume(l),u):(t.exit("setextHeadingLineSequence"),ie(l)?oe(t,o,"lineSuffix")(l):o(l))}function o(l){return l===null||G(l)?(t.exit("setextHeadingLine"),e(l)):n(l)}}const mm={tokenize:gm};function gm(t){const e=this,n=t.attempt(Zn,r,t.attempt(this.parser.constructs.flowInitial,i,oe(t,t.attempt(this.parser.constructs.flow,i,t.attempt(_p,i)),"linePrefix")));return n;function r(a){if(a===null){t.consume(a);return}return t.enter("lineEndingBlank"),t.consume(a),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function i(a){if(a===null){t.consume(a);return}return t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const Em={resolveAll:qo()},bm=Yo("string"),Tm=Yo("text");function Yo(t){return{resolveAll:qo(t==="text"?xm:void 0),tokenize:e};function e(n){const r=this,i=this.parser.constructs[t],a=n.attempt(i,s,u);return s;function s(d){return l(d)?a(d):u(d)}function u(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),o}function o(d){return l(d)?(n.exit("data"),a(d)):(n.consume(d),o)}function l(d){if(d===null)return!0;const f=i[d];let p=-1;if(f)for(;++p<f.length;){const h=f[p];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function qo(t){return e;function e(n,r){let i=-1,a;for(;++i<=n.length;)a===void 0?n[i]&&n[i][1].type==="data"&&(a=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==a+2&&(n[a][1].end=n[i-1][1].end,n.splice(a+2,i-a-2),i=a+2),a=void 0);return t?t(n,r):n}}function xm(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 a=i.length,s=-1,u=0,o;for(;a--;){const l=i[a];if(typeof l=="string"){for(s=l.length;l.charCodeAt(s-1)===32;)u++,s--;if(s)break;s=-1}else if(l===-2)o=!0,u++;else if(l!==-1){a++;break}}if(e._contentTypeTextTrailing&&n===t.length&&(u=0),u){const l={type:n===t.length||o||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?s:r.start._bufferIndex+s,_index:r.start._index+a,line:r.end.line,column:r.end.column-u,offset:r.end.offset-u},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 _m={42:ze,43:ze,45:ze,48:ze,49:ze,50:ze,51:ze,52:ze,53:ze,54:ze,55:ze,56:ze,57:ze,62:Bo},ym={91:Ip},Am={[-2]:Gr,[-1]:Gr,32:Gr},km={35:Lp,42:dr,45:[_s,dr],60:Mp,61:_s,95:dr,96:Ts,126:Ts},Cm={38:Uo,92:Fo},Im={[-5]:Xr,[-4]:Xr,[-3]:Xr,33:em,38:Uo,42:Ii,60:[np,$p],91:nm,92:[Rp,Fo],93:aa,95:Ii,96:mp},Sm={null:[Ii,Em]},Nm={null:[42,95]},wm={null:[]},Rm=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Nm,contentInitial:ym,disable:wm,document:_m,flow:km,flowInitial:Am,insideSpan:Sm,string:Cm,text:Im},Symbol.toStringTag,{value:"Module"}));function Om(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={},a=[];let s=[],u=[];const o={attempt:v(O),check:v(I),consume:S,enter:E,exit:R,interrupt:v(I,{interrupt:!0})},l={code:null,containerState:{},defineSkip:_,events:[],now:g,parser:t,previous:null,sliceSerialize:p,sliceStream:h,write:f};let d=e.tokenize.call(l,o);return e.resolveAll&&a.push(e),l;function f(F){return s=Je(s,F),y(),s[s.length-1]!==null?[]:(B(e,0),l.events=Dr(a,l.events,l),l.events)}function p(F,P){return Dm(h(F),P)}function h(F){return Lm(s,F)}function g(){const{_bufferIndex:F,_index:P,line:Z,column:$,offset:H}=r;return{_bufferIndex:F,_index:P,line:Z,column:$,offset:H}}function _(F){i[F.line]=F.column,N()}function y(){let F;for(;r._index<s.length;){const P=s[r._index];if(typeof P=="string")for(F=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===F&&r._bufferIndex<P.length;)T(P.charCodeAt(r._bufferIndex));else T(P)}}function T(F){d=d(F)}function S(F){G(F)?(r.line++,r.column=1,r.offset+=F===-3?2:1,N()):F!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=F}function E(F,P){const Z=P||{};return Z.type=F,Z.start=g(),l.events.push(["enter",Z,l]),u.push(Z),Z}function R(F){const P=u.pop();return P.end=g(),l.events.push(["exit",P,l]),P}function O(F,P){B(F,P.from)}function I(F,P){P.restore()}function v(F,P){return Z;function Z($,H,Q){let te,K,ge,k;return Array.isArray($)?me($):"tokenize"in $?me([$]):ae($);function ae(_e){return Re;function Re(Se){const He=Se!==null&&_e[Se],Le=Se!==null&&_e.null,Ve=[...Array.isArray(He)?He:He?[He]:[],...Array.isArray(Le)?Le:Le?[Le]:[]];return me(Ve)(Se)}}function me(_e){return te=_e,K=0,_e.length===0?Q:C(_e[K])}function C(_e){return Re;function Re(Se){return k=z(),ge=_e,_e.partial||(l.currentConstruct=_e),_e.name&&l.parser.constructs.disable.null.includes(_e.name)?de():_e.tokenize.call(P?Object.assign(Object.create(l),P):l,o,le,de)(Se)}}function le(_e){return F(ge,k),H}function de(_e){return k.restore(),++K<te.length?C(te[K]):Q}}}function B(F,P){F.resolveAll&&!a.includes(F)&&a.push(F),F.resolve&&Ge(l.events,P,l.events.length-P,F.resolve(l.events.slice(P),l)),F.resolveTo&&(l.events=F.resolveTo(l.events,l))}function z(){const F=g(),P=l.previous,Z=l.currentConstruct,$=l.events.length,H=Array.from(u);return{from:$,restore:Q};function Q(){r=F,l.previous=P,l.currentConstruct=Z,l.events.length=$,u=H,N()}}function N(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Lm(t,e){const n=e.start._index,r=e.start._bufferIndex,i=e.end._index,a=e.end._bufferIndex;let s;if(n===i)s=[t[n].slice(r,a)];else{if(s=t.slice(n,i),r>-1){const u=s[0];typeof u=="string"?s[0]=u.slice(r):s.shift()}a>0&&s.push(t[i].slice(0,a))}return s}function Dm(t,e){let n=-1;const r=[];let i;for(;++n<t.length;){const a=t[n];let s;if(typeof a=="string")s=a;else switch(a){case-5:{s="\r";break}case-4:{s=`
|
|
65
|
+
`}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=ts(t);if(i===null)return r;t=i;let a='<a href="'+t+'"';return e&&(a+=' title="'+ct(e)+'"'),a+=">"+r+"</a>",a}image({href:t,title:e,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));const i=ts(t);if(i===null)return ct(n);t=i;let a=`<img src="${t}" alt="${n}"`;return e&&(a+=` title="${ct(e)}"`),a+=">",a}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:ct(t.text)}},aa=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""}},xt=class Si{options;renderer;textRenderer;constructor(e){this.options=e||Qt,this.options.renderer=this.options.renderer||new kr,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new aa}static parse(e,n){return new Si(n).parse(e)}static parseInline(e,n){return new Si(n).parseInline(e)}parse(e,n=!0){let r="";for(let i=0;i<e.length;i++){const a=e[i];if(this.options.extensions?.renderers?.[a.type]){const u=a,o=this.options.extensions.renderers[u.type].call({parser:this},u);if(o!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(u.type)){r+=o||"";continue}}const s=a;switch(s.type){case"space":{r+=this.renderer.space(s);continue}case"hr":{r+=this.renderer.hr(s);continue}case"heading":{r+=this.renderer.heading(s);continue}case"code":{r+=this.renderer.code(s);continue}case"table":{r+=this.renderer.table(s);continue}case"blockquote":{r+=this.renderer.blockquote(s);continue}case"list":{r+=this.renderer.list(s);continue}case"html":{r+=this.renderer.html(s);continue}case"paragraph":{r+=this.renderer.paragraph(s);continue}case"text":{let u=s,o=this.renderer.text(u);for(;i+1<e.length&&e[i+1].type==="text";)u=e[++i],o+=`
|
|
66
|
+
`+this.renderer.text(u);n?r+=this.renderer.paragraph({type:"paragraph",raw:o,text:o,tokens:[{type:"text",raw:o,text:o,escaped:!0}]}):r+=o;continue}default:{const u='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return r}parseInline(e,n=this.renderer){let r="";for(let i=0;i<e.length;i++){const a=e[i];if(this.options.extensions?.renderers?.[a.type]){const u=this.options.extensions.renderers[a.type].call({parser:this},a);if(u!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){r+=u||"";continue}}const s=a;switch(s.type){case"escape":{r+=n.text(s);break}case"html":{r+=n.html(s);break}case"link":{r+=n.link(s);break}case"image":{r+=n.image(s);break}case"strong":{r+=n.strong(s);break}case"em":{r+=n.em(s);break}case"codespan":{r+=n.codespan(s);break}case"br":{r+=n.br(s);break}case"del":{r+=n.del(s);break}case"text":{r+=n.text(s);break}default:{const u='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return r}},gr=class{options;block;constructor(t){this.options=t||Qt}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}provideLexer(){return this.block?Tt.lex:Tt.lexInline}provideParser(){return this.block?xt.parse:xt.parseInline}},n0=class{defaults=Zi();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=xt;Renderer=kr;TextRenderer=aa;Lexer=Tt;Tokenizer=Ar;Hooks=gr;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 a of i.header)n=n.concat(this.walkTokens(a.tokens,e));for(const a of i.rows)for(const s of a)n=n.concat(this.walkTokens(s.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(a=>{const s=i[a].flat(1/0);n=n.concat(this.walkTokens(s,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 a=e.renderers[i.name];a?e.renderers[i.name]=function(...s){let u=i.renderer.apply(this,s);return u===!1&&(u=a.apply(this,s)),u}: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 a=e[i.level];a?a.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 kr(this.defaults);for(const a in n.renderer){if(!(a in i))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;const s=a,u=n.renderer[s],o=i[s];i[s]=(...l)=>{let d=u.apply(i,l);return d===!1&&(d=o.apply(i,l)),d||""}}r.renderer=i}if(n.tokenizer){const i=this.defaults.tokenizer||new Ar(this.defaults);for(const a in n.tokenizer){if(!(a in i))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;const s=a,u=n.tokenizer[s],o=i[s];i[s]=(...l)=>{let d=u.apply(i,l);return d===!1&&(d=o.apply(i,l)),d}}r.tokenizer=i}if(n.hooks){const i=this.defaults.hooks||new gr;for(const a in n.hooks){if(!(a in i))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;const s=a,u=n.hooks[s],o=i[s];gr.passThroughHooks.has(a)?i[s]=l=>{if(this.defaults.async)return Promise.resolve(u.call(i,l)).then(f=>o.call(i,f));const d=u.call(i,l);return o.call(i,d)}:i[s]=(...l)=>{let d=u.apply(i,l);return d===!1&&(d=o.apply(i,l)),d}}r.hooks=i}if(n.walkTokens){const i=this.defaults.walkTokens,a=n.walkTokens;r.walkTokens=function(s){let u=[];return u.push(a.call(this,s)),i&&(u=u.concat(i.call(this,s))),u}}this.defaults={...this.defaults,...r}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return Tt.lex(t,e??this.defaults)}parser(t,e){return xt.parse(t,e??this.defaults)}parseMarkdown(t){return(n,r)=>{const i={...r},a={...this.defaults,...i},s=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&i.async===!1)return s(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 s(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));a.hooks&&(a.hooks.options=a,a.hooks.block=t);const u=a.hooks?a.hooks.provideLexer():t?Tt.lex:Tt.lexInline,o=a.hooks?a.hooks.provideParser():t?xt.parse:xt.parseInline;if(a.async)return Promise.resolve(a.hooks?a.hooks.preprocess(n):n).then(l=>u(l,a)).then(l=>a.hooks?a.hooks.processAllTokens(l):l).then(l=>a.walkTokens?Promise.all(this.walkTokens(l,a.walkTokens)).then(()=>l):l).then(l=>o(l,a)).then(l=>a.hooks?a.hooks.postprocess(l):l).catch(s);try{a.hooks&&(n=a.hooks.preprocess(n));let l=u(n,a);a.hooks&&(l=a.hooks.processAllTokens(l)),a.walkTokens&&this.walkTokens(l,a.walkTokens);let d=o(l,a);return a.hooks&&(d=a.hooks.postprocess(d)),d}catch(l){return s(l)}}}onError(t,e){return n=>{if(n.message+=`
|
|
67
|
+
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}}},Vt=new n0;function he(t,e){return Vt.parse(t,e)}he.options=he.setOptions=function(t){return Vt.setOptions(t),he.defaults=Vt.defaults,co(he.defaults),he};he.getDefaults=Zi;he.defaults=Qt;he.use=function(...t){return Vt.use(...t),he.defaults=Vt.defaults,co(he.defaults),he};he.walkTokens=function(t,e){return Vt.walkTokens(t,e)};he.parseInline=Vt.parseInline;he.Parser=xt;he.parser=xt.parse;he.Renderer=kr;he.TextRenderer=aa;he.Lexer=Tt;he.lexer=Tt.lex;he.Tokenizer=Ar;he.Hooks=gr;he.parse=he;he.options;he.setOptions;he.use;he.walkTokens;he.parseInline;xt.parse;Tt.lex;function is(t){const e=[],n=String(t||"");let r=n.indexOf(","),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);const s=n.slice(i,r).trim();(s||!a)&&e.push(s),i=r+1,r=n.indexOf(",",i)}return e}function yo(t,e){const n={};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const r0=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,i0=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,a0={};function as(t,e){return(a0.jsx?i0:r0).test(t)}const s0=/[ \t\n\f\r]/g;function u0(t){return typeof t=="object"?t.type==="text"?ss(t.value):!1:ss(t)}function ss(t){return t.replace(s0,"")===""}class tr{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}}tr.prototype.normal={};tr.prototype.property={};tr.prototype.space=void 0;function Ao(t,e){const n={},r={};for(const i of t)Object.assign(n,i.property),Object.assign(r,i.normal);return new tr(n,r,e)}function Wn(t){return t.toLowerCase()}class Qe{constructor(e,n){this.attribute=n,this.property=e}}Qe.prototype.attribute="";Qe.prototype.booleanish=!1;Qe.prototype.boolean=!1;Qe.prototype.commaOrSpaceSeparated=!1;Qe.prototype.commaSeparated=!1;Qe.prototype.defined=!1;Qe.prototype.mustUseProperty=!1;Qe.prototype.number=!1;Qe.prototype.overloadedBoolean=!1;Qe.prototype.property="";Qe.prototype.spaceSeparated=!1;Qe.prototype.space=void 0;let o0=0;const ne=Gt(),Le=Gt(),Ni=Gt(),H=Gt(),Te=Gt(),an=Gt(),Xe=Gt();function Gt(){return 2**++o0}const wi=Object.freeze(Object.defineProperty({__proto__:null,boolean:ne,booleanish:Le,commaOrSpaceSeparated:Xe,commaSeparated:an,number:H,overloadedBoolean:Ni,spaceSeparated:Te},Symbol.toStringTag,{value:"Module"})),Kr=Object.keys(wi);class sa extends Qe{constructor(e,n,r,i){let a=-1;if(super(e,n),us(this,"space",i),typeof r=="number")for(;++a<Kr.length;){const s=Kr[a];us(this,Kr[a],(r&wi[s])===wi[s])}}}sa.prototype.defined=!0;function us(t,e,n){n&&(t[e]=n)}function pn(t){const e={},n={};for(const[r,i]of Object.entries(t.properties)){const a=new sa(r,t.transform(t.attributes||{},r),i,t.space);t.mustUseProperty&&t.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),e[r]=a,n[Wn(r)]=r,n[Wn(a.attribute)]=r}return new tr(e,n,t.space)}const ko=pn({properties:{ariaActiveDescendant:null,ariaAtomic:Le,ariaAutoComplete:null,ariaBusy:Le,ariaChecked:Le,ariaColCount:H,ariaColIndex:H,ariaColSpan:H,ariaControls:Te,ariaCurrent:null,ariaDescribedBy:Te,ariaDetails:null,ariaDisabled:Le,ariaDropEffect:Te,ariaErrorMessage:null,ariaExpanded:Le,ariaFlowTo:Te,ariaGrabbed:Le,ariaHasPopup:null,ariaHidden:Le,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Te,ariaLevel:H,ariaLive:null,ariaModal:Le,ariaMultiLine:Le,ariaMultiSelectable:Le,ariaOrientation:null,ariaOwns:Te,ariaPlaceholder:null,ariaPosInSet:H,ariaPressed:Le,ariaReadOnly:Le,ariaRelevant:null,ariaRequired:Le,ariaRoleDescription:Te,ariaRowCount:H,ariaRowIndex:H,ariaRowSpan:H,ariaSelected:Le,ariaSetSize:H,ariaSort:null,ariaValueMax:H,ariaValueMin:H,ariaValueNow:H,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function Co(t,e){return e in t?t[e]:e}function Io(t,e){return Co(t,e.toLowerCase())}const l0=pn({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:an,acceptCharset:Te,accessKey:Te,action:null,allow:null,allowFullScreen:ne,allowPaymentRequest:ne,allowUserMedia:ne,alt:null,as:null,async:ne,autoCapitalize:null,autoComplete:Te,autoFocus:ne,autoPlay:ne,blocking:Te,capture:null,charSet:null,checked:ne,cite:null,className:Te,cols:H,colSpan:null,content:null,contentEditable:Le,controls:ne,controlsList:Te,coords:H|an,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ne,defer:ne,dir:null,dirName:null,disabled:ne,download:Ni,draggable:Le,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ne,formTarget:null,headers:Te,height:H,hidden:Ni,high:H,href:null,hrefLang:null,htmlFor:Te,httpEquiv:Te,id:null,imageSizes:null,imageSrcSet:null,inert:ne,inputMode:null,integrity:null,is:null,isMap:ne,itemId:null,itemProp:Te,itemRef:Te,itemScope:ne,itemType:Te,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ne,low:H,manifest:null,max:null,maxLength:H,media:null,method:null,min:null,minLength:H,multiple:ne,muted:ne,name:null,nonce:null,noModule:ne,noValidate:ne,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:ne,optimum:H,pattern:null,ping:Te,placeholder:null,playsInline:ne,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ne,referrerPolicy:null,rel:Te,required:ne,reversed:ne,rows:H,rowSpan:H,sandbox:Te,scope:null,scoped:ne,seamless:ne,selected:ne,shadowRootClonable:ne,shadowRootDelegatesFocus:ne,shadowRootMode:null,shape:null,size:H,sizes:null,slot:null,span:H,spellCheck:Le,src:null,srcDoc:null,srcLang:null,srcSet:null,start:H,step:null,style:null,tabIndex:H,target:null,title:null,translate:null,type:null,typeMustMatch:ne,useMap:null,value:Le,width:H,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Te,axis:null,background:null,bgColor:null,border:H,borderColor:null,bottomMargin:H,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ne,declare:ne,event:null,face:null,frame:null,frameBorder:null,hSpace:H,leftMargin:H,link:null,longDesc:null,lowSrc:null,marginHeight:H,marginWidth:H,noResize:ne,noHref:ne,noShade:ne,noWrap:ne,object:null,profile:null,prompt:null,rev:null,rightMargin:H,rules:null,scheme:null,scrolling:Le,standby:null,summary:null,text:null,topMargin:H,valueType:null,version:null,vAlign:null,vLink:null,vSpace:H,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ne,disableRemotePlayback:ne,prefix:null,property:null,results:H,security:null,unselectable:null},space:"html",transform:Io}),c0=pn({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:Xe,accentHeight:H,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:H,amplitude:H,arabicForm:null,ascent:H,attributeName:null,attributeType:null,azimuth:H,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:H,by:null,calcMode:null,capHeight:H,className:Te,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:H,diffuseConstant:H,direction:null,display:null,dur:null,divisor:H,dominantBaseline:null,download:ne,dx:null,dy:null,edgeMode:null,editable:null,elevation:H,enableBackground:null,end:null,event:null,exponent:H,externalResourcesRequired:null,fill:null,fillOpacity:H,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:an,g2:an,glyphName:an,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:H,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:H,horizOriginX:H,horizOriginY:H,id:null,ideographic:H,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:H,k:H,k1:H,k2:H,k3:H,k4:H,kernelMatrix:Xe,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:H,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:H,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:H,overlineThickness:H,paintOrder:null,panose1:null,path:null,pathLength:H,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Te,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:H,pointsAtY:H,pointsAtZ:H,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Xe,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Xe,rev:Xe,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Xe,requiredFeatures:Xe,requiredFonts:Xe,requiredFormats:Xe,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:H,specularExponent:H,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:H,strikethroughThickness:H,string:null,stroke:null,strokeDashArray:Xe,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:H,strokeOpacity:H,strokeWidth:null,style:null,surfaceScale:H,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Xe,tabIndex:H,tableValues:null,target:null,targetX:H,targetY:H,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Xe,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:H,underlineThickness:H,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:H,values:null,vAlphabetic:H,vMathematical:H,vectorEffect:null,vHanging:H,vIdeographic:H,version:null,vertAdvY:H,vertOriginX:H,vertOriginY:H,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:H,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Co}),So=pn({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()}}),No=pn({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Io}),wo=pn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),d0={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"},f0=/[A-Z]/g,os=/-[a-z]/g,h0=/^data[-\w.:]+$/i;function Mr(t,e){const n=Wn(e);let r=e,i=Qe;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&h0.test(e)){if(e.charAt(4)==="-"){const a=e.slice(5).replace(os,m0);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=e.slice(4);if(!os.test(a)){let s=a.replace(f0,p0);s.charAt(0)!=="-"&&(s="-"+s),e="data"+s}}i=sa}return new i(r,e)}function p0(t){return"-"+t.toLowerCase()}function m0(t){return t.charAt(1).toUpperCase()}const nr=Ao([ko,l0,So,No,wo],"html"),vt=Ao([ko,c0,So,No,wo],"svg");function ls(t){const e=String(t||"").trim();return e?e.split(/[ \t\n\r\f]+/g):[]}function Ro(t){return t.join(" ").trim()}var Kt={},Jr,cs;function g0(){if(cs)return Jr;cs=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,u=/^\s+|\s+$/g,o=`
|
|
68
|
+
`,l="/",d="*",f="",p="comment",h="declaration";function g(y,T){if(typeof y!="string")throw new TypeError("First argument must be a string");if(!y)return[];T=T||{};var I=1,E=1;function R(q){var j=q.match(e);j&&(I+=j.length);var Z=q.lastIndexOf(o);E=~Z?q.length-Z:E+q.length}function O(){var q={line:I,column:E};return function(j){return j.position=new S(q),z(),j}}function S(q){this.start=q,this.end={line:I,column:E},this.source=T.source}S.prototype.content=y;function v(q){var j=new Error(T.source+":"+I+":"+E+": "+q);if(j.reason=q,j.filename=T.source,j.line=I,j.column=E,j.source=y,!T.silent)throw j}function B(q){var j=q.exec(y);if(j){var Z=j[0];return R(Z),y=y.slice(Z.length),j}}function z(){B(n)}function N(q){var j;for(q=q||[];j=F();)j!==!1&&q.push(j);return q}function F(){var q=O();if(!(l!=y.charAt(0)||d!=y.charAt(1))){for(var j=2;f!=y.charAt(j)&&(d!=y.charAt(j)||l!=y.charAt(j+1));)++j;if(j+=2,f===y.charAt(j-1))return v("End of comment missing");var Z=y.slice(2,j-2);return E+=2,R(Z),y=y.slice(j),E+=2,q({type:p,comment:Z})}}function P(){var q=O(),j=B(r);if(j){if(F(),!B(i))return v("property missing ':'");var Z=B(a),te=q({type:h,property:_(j[0].replace(t,f)),value:Z?_(Z[0].replace(t,f)):f});return B(s),te}}function X(){var q=[];N(q);for(var j;j=P();)j!==!1&&(q.push(j),N(q));return q}return z(),X()}function _(y){return y?y.replace(u,f):f}return Jr=g,Jr}var ds;function E0(){if(ds)return Kt;ds=1;var t=Kt&&Kt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Kt,"__esModule",{value:!0}),Kt.default=n;const e=t(g0());function n(r,i){let a=null;if(!r||typeof r!="string")return a;const s=(0,e.default)(r),u=typeof i=="function";return s.forEach(o=>{if(o.type!=="declaration")return;const{property:l,value:d}=o;u?i(l,d,o):d&&(a=a||{},a[l]=d)}),a}return Kt}var An={},fs;function b0(){if(fs)return An;fs=1,Object.defineProperty(An,"__esModule",{value:!0}),An.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,a=function(l){return!l||n.test(l)||t.test(l)},s=function(l,d){return d.toUpperCase()},u=function(l,d){return"".concat(d,"-")},o=function(l,d){return d===void 0&&(d={}),a(l)?l:(l=l.toLowerCase(),d.reactCompat?l=l.replace(i,u):l=l.replace(r,u),l.replace(e,s))};return An.camelCase=o,An}var kn,hs;function T0(){if(hs)return kn;hs=1;var t=kn&&kn.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},e=t(E0()),n=b0();function r(i,a){var s={};return!i||typeof i!="string"||(0,e.default)(i,function(u,o){u&&o&&(s[(0,n.camelCase)(u,a)]=o)}),s}return r.default=r,kn=r,kn}var x0=T0();const _0=qi(x0),Br=Oo("end"),ht=Oo("start");function Oo(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 y0(t){const e=ht(t),n=Br(t);if(e&&n)return{start:e,end:n}}function Pn(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?ps(t.position):"start"in t||"end"in t?ps(t):"line"in t||"column"in t?Ri(t):""}function Ri(t){return ms(t&&t.line)+":"+ms(t&&t.column)}function ps(t){return Ri(t&&t.start)+"-"+Ri(t&&t.end)}function ms(t){return t&&typeof t=="number"?t:1}class Fe extends Error{constructor(e,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",a={},s=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof e=="string"?i=e:!a.cause&&e&&(s=!0,i=e.message,a.cause=e),!a.ruleId&&!a.source&&typeof r=="string"){const o=r.indexOf(":");o===-1?a.ruleId=r:(a.source=r.slice(0,o),a.ruleId=r.slice(o+1))}if(!a.place&&a.ancestors&&a.ancestors){const o=a.ancestors[a.ancestors.length-1];o&&(a.place=o.position)}const u=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=u?u.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=u?u.line:void 0,this.name=Pn(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=s&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Fe.prototype.file="";Fe.prototype.name="";Fe.prototype.reason="";Fe.prototype.message="";Fe.prototype.stack="";Fe.prototype.column=void 0;Fe.prototype.line=void 0;Fe.prototype.ancestors=void 0;Fe.prototype.cause=void 0;Fe.prototype.fatal=void 0;Fe.prototype.place=void 0;Fe.prototype.ruleId=void 0;Fe.prototype.source=void 0;const ua={}.hasOwnProperty,A0=new Map,k0=/[A-Z]/g,C0=new Set(["table","tbody","thead","tfoot","tr"]),I0=new Set(["td","th"]),Lo="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function S0(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=P0(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=v0(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"?vt:nr,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},a=Do(i,t,void 0);return a&&typeof a!="string"?a:i.create(t,i.Fragment,{children:a||void 0},void 0)}function Do(t,e,n){if(e.type==="element")return N0(t,e,n);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return w0(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return O0(t,e,n);if(e.type==="mdxjsEsm")return R0(t,e);if(e.type==="root")return L0(t,e,n);if(e.type==="text")return D0(t,e)}function N0(t,e,n){const r=t.schema;let i=r;e.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=vt,t.schema=i),t.ancestors.push(e);const a=Po(t,e.tagName,!1),s=M0(t,e);let u=la(t,e);return C0.has(e.tagName)&&(u=u.filter(function(o){return typeof o=="string"?!u0(o):!0})),vo(t,s,a,e),oa(s,u),t.ancestors.pop(),t.schema=r,t.create(e,a,s,n)}function w0(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)}Qn(t,e.position)}function R0(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);Qn(t,e.position)}function O0(t,e,n){const r=t.schema;let i=r;e.name==="svg"&&r.space==="html"&&(i=vt,t.schema=i),t.ancestors.push(e);const a=e.name===null?t.Fragment:Po(t,e.name,!0),s=B0(t,e),u=la(t,e);return vo(t,s,a,e),oa(s,u),t.ancestors.pop(),t.schema=r,t.create(e,a,s,n)}function L0(t,e,n){const r={};return oa(r,la(t,e)),t.create(e,t.Fragment,r,n)}function D0(t,e){return e.value}function vo(t,e,n,r){typeof n!="string"&&n!==t.Fragment&&t.passNode&&(e.node=r)}function oa(t,e){if(e.length>0){const n=e.length>1?e:e[0];n&&(t.children=n)}}function v0(t,e,n){return r;function r(i,a,s,u){const l=Array.isArray(s.children)?n:e;return u?l(a,s,u):l(a,s)}}function P0(t,e){return n;function n(r,i,a,s){const u=Array.isArray(a.children),o=ht(r);return e(i,a,s,u,{columnNumber:o?o.column-1:void 0,fileName:t,lineNumber:o?o.line:void 0},void 0)}}function M0(t,e){const n={};let r,i;for(i in e.properties)if(i!=="children"&&ua.call(e.properties,i)){const a=F0(t,i,e.properties[i]);if(a){const[s,u]=a;t.tableCellAlignToStyle&&s==="align"&&typeof u=="string"&&I0.has(e.tagName)?r=u:n[s]=u}}if(r){const a=n.style||(n.style={});a[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function B0(t,e){const n={};for(const r of e.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&t.evaluater){const a=r.data.estree.body[0];a.type;const s=a.expression;s.type;const u=s.properties[0];u.type,Object.assign(n,t.evaluater.evaluateExpression(u.argument))}else Qn(t,e.position);else{const i=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&t.evaluater){const u=r.value.data.estree.body[0];u.type,a=t.evaluater.evaluateExpression(u.expression)}else Qn(t,e.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function la(t,e){const n=[];let r=-1;const i=t.passKeys?new Map:A0;for(;++r<e.children.length;){const a=e.children[r];let s;if(t.passKeys){const o=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(o){const l=i.get(o)||0;s=o+"-"+l,i.set(o,l+1)}}const u=Do(t,a,s);u!==void 0&&n.push(u)}return n}function F0(t,e,n){const r=Mr(t.schema,e);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?yo(n):Ro(n)),r.property==="style"){let i=typeof n=="object"?n:U0(t,String(n));return t.stylePropertyNameCase==="css"&&(i=H0(i)),["style",i]}return[t.elementAttributeNameCase==="react"&&r.space?d0[r.property]||r.property:r.attribute,n]}}function U0(t,e){try{return _0(e,{reactCompat:!0})}catch(n){if(t.ignoreInvalidStyle)return{};const r=n,i=new Fe("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=Lo+"#cannot-parse-style-attribute",i}}function Po(t,e,n){let r;if(!n)r={type:"Literal",value:e};else if(e.includes(".")){const i=e.split(".");let a=-1,s;for(;++a<i.length;){const u=as(i[a])?{type:"Identifier",name:i[a]}:{type:"Literal",value:i[a]};s=s?{type:"MemberExpression",object:s,property:u,computed:!!(a&&u.type==="Literal"),optional:!1}:u}r=s}else r=as(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(r.type==="Literal"){const i=r.value;return ua.call(t.components,i)?t.components[i]:i}if(t.evaluater)return t.evaluater.evaluateExpression(r);Qn(t)}function Qn(t,e){const n=new Fe("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=Lo+"#cannot-handle-mdx-estrees-without-createevaluater",n}function H0(t){const e={};let n;for(n in t)ua.call(t,n)&&(e[j0(n)]=t[n]);return e}function j0(t){let e=t.replace(k0,z0);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function z0(t){return"-"+t.toLowerCase()}const ei={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"]},$0={};function ca(t,e){const n=$0,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Mo(t,r,i)}function Mo(t,e,n){if(Y0(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 gs(t.children,e,n)}return Array.isArray(t)?gs(t,e,n):""}function gs(t,e,n){const r=[];let i=-1;for(;++i<t.length;)r[i]=Mo(t[i],e,n);return r.join("")}function Y0(t){return!!(t&&typeof t=="object")}const Es=document.createElement("i");function da(t){const e="&"+t+";";Es.innerHTML=e;const n=Es.textContent;return n.charCodeAt(n.length-1)===59&&t!=="semi"||n===e?!1:n}function Ze(t,e,n,r){const i=t.length;let a=0,s;if(e<0?e=-e>i?0:i+e:e=e>i?i:e,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(e,n),t.splice(...s);else for(n&&t.splice(e,n);a<r.length;)s=r.slice(a,a+1e4),s.unshift(e,0),t.splice(...s),a+=1e4,e+=1e4}function tt(t,e){return t.length>0?(Ze(t,t.length,0,e),t):e}const bs={}.hasOwnProperty;function Bo(t){const e={};let n=-1;for(;++n<t.length;)q0(e,t[n]);return e}function q0(t,e){let n;for(n in e){const i=(bs.call(t,n)?t[n]:void 0)||(t[n]={}),a=e[n];let s;if(a)for(s in a){bs.call(i,s)||(i[s]=[]);const u=a[s];V0(i[s],Array.isArray(u)?u:u?[u]:[])}}}function V0(t,e){let n=-1;const r=[];for(;++n<e.length;)(e[n].add==="after"?t:r).push(e[n]);Ze(t,0,0,r)}function Fo(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 st(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ze=Pt(/[A-Za-z]/),Be=Pt(/[\dA-Za-z]/),W0=Pt(/[#-'*+\--9=?A-Z^-~]/);function Cr(t){return t!==null&&(t<32||t===127)}const Oi=Pt(/\d/),Q0=Pt(/[\dA-Fa-f]/),G0=Pt(/[!-/:-@[-`{-~]/);function Q(t){return t!==null&&t<-2}function be(t){return t!==null&&(t<0||t===32)}function ie(t){return t===-2||t===-1||t===32}const Fr=Pt(new RegExp("\\p{P}|\\p{S}","u")),Wt=Pt(/\s/);function Pt(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function mn(t){const e=[];let n=-1,r=0,i=0;for(;++n<t.length;){const a=t.charCodeAt(n);let s="";if(a===37&&Be(t.charCodeAt(n+1))&&Be(t.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(s=String.fromCharCode(a));else if(a>55295&&a<57344){const u=t.charCodeAt(n+1);a<56320&&u>56319&&u<57344?(s=String.fromCharCode(a,u),i=1):s="�"}else s=String.fromCharCode(a);s&&(e.push(t.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return e.join("")+t.slice(r)}function oe(t,e,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return s;function s(o){return ie(o)?(t.enter(n),u(o)):e(o)}function u(o){return ie(o)&&a++<i?(t.consume(o),u):(t.exit(n),e(o))}}const X0={tokenize:Z0};function Z0(t){const e=t.attempt(this.parser.constructs.contentInitial,r,i);let n;return e;function r(u){if(u===null){t.consume(u);return}return t.enter("lineEnding"),t.consume(u),t.exit("lineEnding"),oe(t,e,"linePrefix")}function i(u){return t.enter("paragraph"),a(u)}function a(u){const o=t.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=o),n=o,s(u)}function s(u){if(u===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(u);return}return Q(u)?(t.consume(u),t.exit("chunkText"),a):(t.consume(u),s)}}const K0={tokenize:J0},Ts={tokenize:ep};function J0(t){const e=this,n=[];let r=0,i,a,s;return u;function u(E){if(r<n.length){const R=n[r];return e.containerState=R[1],t.attempt(R[0].continuation,o,l)(E)}return l(E)}function o(E){if(r++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,i&&I();const R=e.events.length;let O=R,S;for(;O--;)if(e.events[O][0]==="exit"&&e.events[O][1].type==="chunkFlow"){S=e.events[O][1].end;break}T(r);let v=R;for(;v<e.events.length;)e.events[v][1].end={...S},v++;return Ze(e.events,O+1,0,e.events.slice(R)),e.events.length=v,l(E)}return u(E)}function l(E){if(r===n.length){if(!i)return p(E);if(i.currentConstruct&&i.currentConstruct.concrete)return g(E);e.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(Ts,d,f)(E)}function d(E){return i&&I(),T(r),p(E)}function f(E){return e.parser.lazy[e.now().line]=r!==n.length,s=e.now().offset,g(E)}function p(E){return e.containerState={},t.attempt(Ts,h,g)(E)}function h(E){return r++,n.push([e.currentConstruct,e.containerState]),p(E)}function g(E){if(E===null){i&&I(),T(0),t.consume(E);return}return i=i||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:a}),_(E)}function _(E){if(E===null){y(t.exit("chunkFlow"),!0),T(0),t.consume(E);return}return Q(E)?(t.consume(E),y(t.exit("chunkFlow")),r=0,e.interrupt=void 0,u):(t.consume(E),_)}function y(E,R){const O=e.sliceStream(E);if(R&&O.push(null),E.previous=a,a&&(a.next=E),a=E,i.defineSkip(E.start),i.write(O),e.parser.lazy[E.start.line]){let S=i.events.length;for(;S--;)if(i.events[S][1].start.offset<s&&(!i.events[S][1].end||i.events[S][1].end.offset>s))return;const v=e.events.length;let B=v,z,N;for(;B--;)if(e.events[B][0]==="exit"&&e.events[B][1].type==="chunkFlow"){if(z){N=e.events[B][1].end;break}z=!0}for(T(r),S=v;S<e.events.length;)e.events[S][1].end={...N},S++;Ze(e.events,B+1,0,e.events.slice(v)),e.events.length=S}}function T(E){let R=n.length;for(;R-- >E;){const O=n[R];e.containerState=O[1],O[0].exit.call(e,t)}n.length=E}function I(){i.write([null]),a=void 0,i=void 0,e.containerState._closeFlow=void 0}}function ep(t,e,n){return oe(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function on(t){if(t===null||be(t)||Wt(t))return 1;if(Fr(t))return 2}function Ur(t,e,n){const r=[];let i=-1;for(;++i<t.length;){const a=t[i].resolveAll;a&&!r.includes(a)&&(e=a(e,n),r.push(a))}return e}const Li={name:"attention",resolveAll:tp,tokenize:np};function tp(t,e){let n=-1,r,i,a,s,u,o,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;o=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 f={...t[r][1].end},p={...t[n][1].start};xs(f,-o),xs(p,o),s={type:o>1?"strongSequence":"emphasisSequence",start:f,end:{...t[r][1].end}},u={type:o>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:p},a={type:o>1?"strongText":"emphasisText",start:{...t[r][1].end},end:{...t[n][1].start}},i={type:o>1?"strong":"emphasis",start:{...s.start},end:{...u.end}},t[r][1].end={...s.start},t[n][1].start={...u.end},l=[],t[r][1].end.offset-t[r][1].start.offset&&(l=tt(l,[["enter",t[r][1],e],["exit",t[r][1],e]])),l=tt(l,[["enter",i,e],["enter",s,e],["exit",s,e],["enter",a,e]]),l=tt(l,Ur(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),l=tt(l,[["exit",a,e],["enter",u,e],["exit",u,e],["exit",i,e]]),t[n][1].end.offset-t[n][1].start.offset?(d=2,l=tt(l,[["enter",t[n][1],e],["exit",t[n][1],e]])):d=0,Ze(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 np(t,e){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=on(r);let a;return s;function s(o){return a=o,t.enter("attentionSequence"),u(o)}function u(o){if(o===a)return t.consume(o),u;const l=t.exit("attentionSequence"),d=on(o),f=!d||d===2&&i||n.includes(o),p=!i||i===2&&d||n.includes(r);return l._open=!!(a===42?f:f&&(i||!p)),l._close=!!(a===42?p:p&&(d||!f)),e(o)}}function xs(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const rp={name:"autolink",tokenize:ip};function ip(t,e,n){let r=0;return i;function i(h){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(h),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),a}function a(h){return ze(h)?(t.consume(h),s):h===64?n(h):l(h)}function s(h){return h===43||h===45||h===46||Be(h)?(r=1,u(h)):l(h)}function u(h){return h===58?(t.consume(h),r=0,o):(h===43||h===45||h===46||Be(h))&&r++<32?(t.consume(h),u):(r=0,l(h))}function o(h){return h===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(h),t.exit("autolinkMarker"),t.exit("autolink"),e):h===null||h===32||h===60||Cr(h)?n(h):(t.consume(h),o)}function l(h){return h===64?(t.consume(h),d):W0(h)?(t.consume(h),l):n(h)}function d(h){return Be(h)?f(h):n(h)}function f(h){return h===46?(t.consume(h),r=0,d):h===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(h),t.exit("autolinkMarker"),t.exit("autolink"),e):p(h)}function p(h){if((h===45||Be(h))&&r++<63){const g=h===45?p:f;return t.consume(h),g}return n(h)}}const rr={partial:!0,tokenize:ap};function ap(t,e,n){return r;function r(a){return ie(a)?oe(t,i,"linePrefix")(a):i(a)}function i(a){return a===null||Q(a)?e(a):n(a)}}const Uo={continuation:{tokenize:up},exit:op,name:"blockQuote",tokenize:sp};function sp(t,e,n){const r=this;return i;function i(s){if(s===62){const u=r.containerState;return u.open||(t.enter("blockQuote",{_container:!0}),u.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(s),t.exit("blockQuoteMarker"),a}return n(s)}function a(s){return ie(s)?(t.enter("blockQuotePrefixWhitespace"),t.consume(s),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(s))}}function up(t,e,n){const r=this;return i;function i(s){return ie(s)?oe(t,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):a(s)}function a(s){return t.attempt(Uo,e,n)(s)}}function op(t){t.exit("blockQuote")}const Ho={name:"characterEscape",tokenize:lp};function lp(t,e,n){return r;function r(a){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(a),t.exit("escapeMarker"),i}function i(a){return G0(a)?(t.enter("characterEscapeValue"),t.consume(a),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):n(a)}}const jo={name:"characterReference",tokenize:cp};function cp(t,e,n){const r=this;let i=0,a,s;return u;function u(f){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(f),t.exit("characterReferenceMarker"),o}function o(f){return f===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(f),t.exit("characterReferenceMarkerNumeric"),l):(t.enter("characterReferenceValue"),a=31,s=Be,d(f))}function l(f){return f===88||f===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(f),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),a=6,s=Q0,d):(t.enter("characterReferenceValue"),a=7,s=Oi,d(f))}function d(f){if(f===59&&i){const p=t.exit("characterReferenceValue");return s===Be&&!da(r.sliceSerialize(p))?n(f):(t.enter("characterReferenceMarker"),t.consume(f),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return s(f)&&i++<a?(t.consume(f),d):n(f)}}const _s={partial:!0,tokenize:fp},ys={concrete:!0,name:"codeFenced",tokenize:dp};function dp(t,e,n){const r=this,i={partial:!0,tokenize:O};let a=0,s=0,u;return o;function o(S){return l(S)}function l(S){const v=r.events[r.events.length-1];return a=v&&v[1].type==="linePrefix"?v[2].sliceSerialize(v[1],!0).length:0,u=S,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),d(S)}function d(S){return S===u?(s++,t.consume(S),d):s<3?n(S):(t.exit("codeFencedFenceSequence"),ie(S)?oe(t,f,"whitespace")(S):f(S))}function f(S){return S===null||Q(S)?(t.exit("codeFencedFence"),r.interrupt?e(S):t.check(_s,_,R)(S)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),p(S))}function p(S){return S===null||Q(S)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),f(S)):ie(S)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),oe(t,h,"whitespace")(S)):S===96&&S===u?n(S):(t.consume(S),p)}function h(S){return S===null||Q(S)?f(S):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),g(S))}function g(S){return S===null||Q(S)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),f(S)):S===96&&S===u?n(S):(t.consume(S),g)}function _(S){return t.attempt(i,R,y)(S)}function y(S){return t.enter("lineEnding"),t.consume(S),t.exit("lineEnding"),T}function T(S){return a>0&&ie(S)?oe(t,I,"linePrefix",a+1)(S):I(S)}function I(S){return S===null||Q(S)?t.check(_s,_,R)(S):(t.enter("codeFlowValue"),E(S))}function E(S){return S===null||Q(S)?(t.exit("codeFlowValue"),I(S)):(t.consume(S),E)}function R(S){return t.exit("codeFenced"),e(S)}function O(S,v,B){let z=0;return N;function N(j){return S.enter("lineEnding"),S.consume(j),S.exit("lineEnding"),F}function F(j){return S.enter("codeFencedFence"),ie(j)?oe(S,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):P(j)}function P(j){return j===u?(S.enter("codeFencedFenceSequence"),X(j)):B(j)}function X(j){return j===u?(z++,S.consume(j),X):z>=s?(S.exit("codeFencedFenceSequence"),ie(j)?oe(S,q,"whitespace")(j):q(j)):B(j)}function q(j){return j===null||Q(j)?(S.exit("codeFencedFence"),v(j)):B(j)}}}function fp(t,e,n){const r=this;return i;function i(s){return s===null?n(s):(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),a)}function a(s){return r.parser.lazy[r.now().line]?n(s):e(s)}}const ti={name:"codeIndented",tokenize:pp},hp={partial:!0,tokenize:mp};function pp(t,e,n){const r=this;return i;function i(l){return t.enter("codeIndented"),oe(t,a,"linePrefix",5)(l)}function a(l){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?s(l):n(l)}function s(l){return l===null?o(l):Q(l)?t.attempt(hp,s,o)(l):(t.enter("codeFlowValue"),u(l))}function u(l){return l===null||Q(l)?(t.exit("codeFlowValue"),s(l)):(t.consume(l),u)}function o(l){return t.exit("codeIndented"),e(l)}}function mp(t,e,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):Q(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),i):oe(t,a,"linePrefix",5)(s)}function a(s){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?e(s):Q(s)?i(s):n(s)}}const gp={name:"codeText",previous:bp,resolve:Ep,tokenize:Tp};function Ep(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 bp(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Tp(t,e,n){let r=0,i,a;return s;function s(f){return t.enter("codeText"),t.enter("codeTextSequence"),u(f)}function u(f){return f===96?(t.consume(f),r++,u):(t.exit("codeTextSequence"),o(f))}function o(f){return f===null?n(f):f===32?(t.enter("space"),t.consume(f),t.exit("space"),o):f===96?(a=t.enter("codeTextSequence"),i=0,d(f)):Q(f)?(t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),o):(t.enter("codeTextData"),l(f))}function l(f){return f===null||f===32||f===96||Q(f)?(t.exit("codeTextData"),o(f)):(t.consume(f),l)}function d(f){return f===96?(t.consume(f),i++,d):i===r?(t.exit("codeTextSequence"),t.exit("codeText"),e(f)):(a.type="codeTextData",l(f))}}class xp{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 a=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Cn(this.left,r),a.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),Cn(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Cn(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);Cn(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);Cn(this.left,n.reverse())}}}function Cn(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 zo(t){const e={};let n=-1,r,i,a,s,u,o,l;const d=new xp(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"&&(o=r[1]._tokenizer.events,a=0,a<o.length&&o[a][1].type==="lineEndingBlank"&&(a+=2),a<o.length&&o[a][1].type==="content"))for(;++a<o.length&&o[a][1].type!=="content";)o[a][1].type==="chunkText"&&(o[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(e,_p(d,n)),n=e[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(s=d.get(a),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(d.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=a);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(r[1].end={...d.get(i)[1].start},u=d.slice(i,n),u.unshift(r),d.splice(i,n-i+1,u))}}return Ze(t,0,Number.POSITIVE_INFINITY,d.slice(0)),!l}function _p(t,e){const n=t.get(e)[1],r=t.get(e)[2];let i=e-1;const a=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const u=s.events,o=[],l={};let d,f,p=-1,h=n,g=0,_=0;const y=[_];for(;h;){for(;t.get(++i)[1]!==h;);a.push(i),h._tokenizer||(d=r.sliceStream(h),h.next||d.push(null),f&&s.defineSkip(h.start),h._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(d),h._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),f=h,h=h.next}for(h=n;++p<u.length;)u[p][0]==="exit"&&u[p-1][0]==="enter"&&u[p][1].type===u[p-1][1].type&&u[p][1].start.line!==u[p][1].end.line&&(_=p+1,y.push(_),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(s.events=[],h?(h._tokenizer=void 0,h.previous=void 0):y.pop(),p=y.length;p--;){const T=u.slice(y[p],y[p+1]),I=a.pop();o.push([I,I+T.length-1]),t.splice(I,2,T)}for(o.reverse(),p=-1;++p<o.length;)l[g+o[p][0]]=g+o[p][1],g+=o[p][1]-o[p][0]-1;return l}const yp={resolve:kp,tokenize:Cp},Ap={partial:!0,tokenize:Ip};function kp(t){return zo(t),t}function Cp(t,e){let n;return r;function r(u){return t.enter("content"),n=t.enter("chunkContent",{contentType:"content"}),i(u)}function i(u){return u===null?a(u):Q(u)?t.check(Ap,s,a)(u):(t.consume(u),i)}function a(u){return t.exit("chunkContent"),t.exit("content"),e(u)}function s(u){return t.consume(u),t.exit("chunkContent"),n.next=t.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function Ip(t,e,n){const r=this;return i;function i(s){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),oe(t,a,"linePrefix")}function a(s){if(s===null||Q(s))return n(s);const u=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?e(s):t.interrupt(r.parser.constructs.flow,n,e)(s)}}function $o(t,e,n,r,i,a,s,u,o){const l=o||Number.POSITIVE_INFINITY;let d=0;return f;function f(T){return T===60?(t.enter(r),t.enter(i),t.enter(a),t.consume(T),t.exit(a),p):T===null||T===32||T===41||Cr(T)?n(T):(t.enter(r),t.enter(s),t.enter(u),t.enter("chunkString",{contentType:"string"}),_(T))}function p(T){return T===62?(t.enter(a),t.consume(T),t.exit(a),t.exit(i),t.exit(r),e):(t.enter(u),t.enter("chunkString",{contentType:"string"}),h(T))}function h(T){return T===62?(t.exit("chunkString"),t.exit(u),p(T)):T===null||T===60||Q(T)?n(T):(t.consume(T),T===92?g:h)}function g(T){return T===60||T===62||T===92?(t.consume(T),h):h(T)}function _(T){return!d&&(T===null||T===41||be(T))?(t.exit("chunkString"),t.exit(u),t.exit(s),t.exit(r),e(T)):d<l&&T===40?(t.consume(T),d++,_):T===41?(t.consume(T),d--,_):T===null||T===32||T===40||Cr(T)?n(T):(t.consume(T),T===92?y:_)}function y(T){return T===40||T===41||T===92?(t.consume(T),_):_(T)}}function Yo(t,e,n,r,i,a){const s=this;let u=0,o;return l;function l(h){return t.enter(r),t.enter(i),t.consume(h),t.exit(i),t.enter(a),d}function d(h){return u>999||h===null||h===91||h===93&&!o||h===94&&!u&&"_hiddenFootnoteSupport"in s.parser.constructs?n(h):h===93?(t.exit(a),t.enter(i),t.consume(h),t.exit(i),t.exit(r),e):Q(h)?(t.enter("lineEnding"),t.consume(h),t.exit("lineEnding"),d):(t.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===null||h===91||h===93||Q(h)||u++>999?(t.exit("chunkString"),d(h)):(t.consume(h),o||(o=!ie(h)),h===92?p:f)}function p(h){return h===91||h===92||h===93?(t.consume(h),u++,f):f(h)}}function qo(t,e,n,r,i,a){let s;return u;function u(p){return p===34||p===39||p===40?(t.enter(r),t.enter(i),t.consume(p),t.exit(i),s=p===40?41:p,o):n(p)}function o(p){return p===s?(t.enter(i),t.consume(p),t.exit(i),t.exit(r),e):(t.enter(a),l(p))}function l(p){return p===s?(t.exit(a),o(s)):p===null?n(p):Q(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),oe(t,l,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===s||p===null||Q(p)?(t.exit("chunkString"),l(p)):(t.consume(p),p===92?f:d)}function f(p){return p===s||p===92?(t.consume(p),d):d(p)}}function Mn(t,e){let n;return r;function r(i){return Q(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),n=!0,r):ie(i)?oe(t,r,n?"linePrefix":"lineSuffix")(i):e(i)}}const Sp={name:"definition",tokenize:wp},Np={partial:!0,tokenize:Rp};function wp(t,e,n){const r=this;let i;return a;function a(h){return t.enter("definition"),s(h)}function s(h){return Yo.call(r,t,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function u(h){return i=st(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(t.enter("definitionMarker"),t.consume(h),t.exit("definitionMarker"),o):n(h)}function o(h){return be(h)?Mn(t,l)(h):l(h)}function l(h){return $o(t,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function d(h){return t.attempt(Np,f,f)(h)}function f(h){return ie(h)?oe(t,p,"whitespace")(h):p(h)}function p(h){return h===null||Q(h)?(t.exit("definition"),r.parser.defined.push(i),e(h)):n(h)}}function Rp(t,e,n){return r;function r(u){return be(u)?Mn(t,i)(u):n(u)}function i(u){return qo(t,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function a(u){return ie(u)?oe(t,s,"whitespace")(u):s(u)}function s(u){return u===null||Q(u)?e(u):n(u)}}const Op={name:"hardBreakEscape",tokenize:Lp};function Lp(t,e,n){return r;function r(a){return t.enter("hardBreakEscape"),t.consume(a),i}function i(a){return Q(a)?(t.exit("hardBreakEscape"),e(a)):n(a)}}const Dp={name:"headingAtx",resolve:vp,tokenize:Pp};function vp(t,e){let n=t.length-2,r=3,i,a;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},a={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"},Ze(t,r,n-r+1,[["enter",i,e],["enter",a,e],["exit",a,e],["exit",i,e]])),t}function Pp(t,e,n){let r=0;return i;function i(d){return t.enter("atxHeading"),a(d)}function a(d){return t.enter("atxHeadingSequence"),s(d)}function s(d){return d===35&&r++<6?(t.consume(d),s):d===null||be(d)?(t.exit("atxHeadingSequence"),u(d)):n(d)}function u(d){return d===35?(t.enter("atxHeadingSequence"),o(d)):d===null||Q(d)?(t.exit("atxHeading"),e(d)):ie(d)?oe(t,u,"whitespace")(d):(t.enter("atxHeadingText"),l(d))}function o(d){return d===35?(t.consume(d),o):(t.exit("atxHeadingSequence"),u(d))}function l(d){return d===null||d===35||be(d)?(t.exit("atxHeadingText"),u(d)):(t.consume(d),l)}}const Mp=["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"],As=["pre","script","style","textarea"],Bp={concrete:!0,name:"htmlFlow",resolveTo:Hp,tokenize:jp},Fp={partial:!0,tokenize:$p},Up={partial:!0,tokenize:zp};function Hp(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 jp(t,e,n){const r=this;let i,a,s,u,o;return l;function l(C){return d(C)}function d(C){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(C),f}function f(C){return C===33?(t.consume(C),p):C===47?(t.consume(C),a=!0,_):C===63?(t.consume(C),i=3,r.interrupt?e:k):ze(C)?(t.consume(C),s=String.fromCharCode(C),y):n(C)}function p(C){return C===45?(t.consume(C),i=2,h):C===91?(t.consume(C),i=5,u=0,g):ze(C)?(t.consume(C),i=4,r.interrupt?e:k):n(C)}function h(C){return C===45?(t.consume(C),r.interrupt?e:k):n(C)}function g(C){const ke="CDATA[";return C===ke.charCodeAt(u++)?(t.consume(C),u===ke.length?r.interrupt?e:P:g):n(C)}function _(C){return ze(C)?(t.consume(C),s=String.fromCharCode(C),y):n(C)}function y(C){if(C===null||C===47||C===62||be(C)){const ke=C===47,Ie=s.toLowerCase();return!ke&&!a&&As.includes(Ie)?(i=1,r.interrupt?e(C):P(C)):Mp.includes(s.toLowerCase())?(i=6,ke?(t.consume(C),T):r.interrupt?e(C):P(C)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(C):a?I(C):E(C))}return C===45||Be(C)?(t.consume(C),s+=String.fromCharCode(C),y):n(C)}function T(C){return C===62?(t.consume(C),r.interrupt?e:P):n(C)}function I(C){return ie(C)?(t.consume(C),I):N(C)}function E(C){return C===47?(t.consume(C),N):C===58||C===95||ze(C)?(t.consume(C),R):ie(C)?(t.consume(C),E):N(C)}function R(C){return C===45||C===46||C===58||C===95||Be(C)?(t.consume(C),R):O(C)}function O(C){return C===61?(t.consume(C),S):ie(C)?(t.consume(C),O):E(C)}function S(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(t.consume(C),o=C,v):ie(C)?(t.consume(C),S):B(C)}function v(C){return C===o?(t.consume(C),o=null,z):C===null||Q(C)?n(C):(t.consume(C),v)}function B(C){return C===null||C===34||C===39||C===47||C===60||C===61||C===62||C===96||be(C)?O(C):(t.consume(C),B)}function z(C){return C===47||C===62||ie(C)?E(C):n(C)}function N(C){return C===62?(t.consume(C),F):n(C)}function F(C){return C===null||Q(C)?P(C):ie(C)?(t.consume(C),F):n(C)}function P(C){return C===45&&i===2?(t.consume(C),Z):C===60&&i===1?(t.consume(C),te):C===62&&i===4?(t.consume(C),ae):C===63&&i===3?(t.consume(C),k):C===93&&i===5?(t.consume(C),ce):Q(C)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(Fp,xe,X)(C)):C===null||Q(C)?(t.exit("htmlFlowData"),X(C)):(t.consume(C),P)}function X(C){return t.check(Up,q,xe)(C)}function q(C){return t.enter("lineEnding"),t.consume(C),t.exit("lineEnding"),j}function j(C){return C===null||Q(C)?X(C):(t.enter("htmlFlowData"),P(C))}function Z(C){return C===45?(t.consume(C),k):P(C)}function te(C){return C===47?(t.consume(C),s="",K):P(C)}function K(C){if(C===62){const ke=s.toLowerCase();return As.includes(ke)?(t.consume(C),ae):P(C)}return ze(C)&&s.length<8?(t.consume(C),s+=String.fromCharCode(C),K):P(C)}function ce(C){return C===93?(t.consume(C),k):P(C)}function k(C){return C===62?(t.consume(C),ae):C===45&&i===2?(t.consume(C),k):P(C)}function ae(C){return C===null||Q(C)?(t.exit("htmlFlowData"),xe(C)):(t.consume(C),ae)}function xe(C){return t.exit("htmlFlow"),e(C)}}function zp(t,e,n){const r=this;return i;function i(s){return Q(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),a):n(s)}function a(s){return r.parser.lazy[r.now().line]?n(s):e(s)}}function $p(t,e,n){return r;function r(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(rr,e,n)}}const Yp={name:"htmlText",tokenize:qp};function qp(t,e,n){const r=this;let i,a,s;return u;function u(k){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(k),o}function o(k){return k===33?(t.consume(k),l):k===47?(t.consume(k),O):k===63?(t.consume(k),E):ze(k)?(t.consume(k),B):n(k)}function l(k){return k===45?(t.consume(k),d):k===91?(t.consume(k),a=0,g):ze(k)?(t.consume(k),I):n(k)}function d(k){return k===45?(t.consume(k),h):n(k)}function f(k){return k===null?n(k):k===45?(t.consume(k),p):Q(k)?(s=f,te(k)):(t.consume(k),f)}function p(k){return k===45?(t.consume(k),h):f(k)}function h(k){return k===62?Z(k):k===45?p(k):f(k)}function g(k){const ae="CDATA[";return k===ae.charCodeAt(a++)?(t.consume(k),a===ae.length?_:g):n(k)}function _(k){return k===null?n(k):k===93?(t.consume(k),y):Q(k)?(s=_,te(k)):(t.consume(k),_)}function y(k){return k===93?(t.consume(k),T):_(k)}function T(k){return k===62?Z(k):k===93?(t.consume(k),T):_(k)}function I(k){return k===null||k===62?Z(k):Q(k)?(s=I,te(k)):(t.consume(k),I)}function E(k){return k===null?n(k):k===63?(t.consume(k),R):Q(k)?(s=E,te(k)):(t.consume(k),E)}function R(k){return k===62?Z(k):E(k)}function O(k){return ze(k)?(t.consume(k),S):n(k)}function S(k){return k===45||Be(k)?(t.consume(k),S):v(k)}function v(k){return Q(k)?(s=v,te(k)):ie(k)?(t.consume(k),v):Z(k)}function B(k){return k===45||Be(k)?(t.consume(k),B):k===47||k===62||be(k)?z(k):n(k)}function z(k){return k===47?(t.consume(k),Z):k===58||k===95||ze(k)?(t.consume(k),N):Q(k)?(s=z,te(k)):ie(k)?(t.consume(k),z):Z(k)}function N(k){return k===45||k===46||k===58||k===95||Be(k)?(t.consume(k),N):F(k)}function F(k){return k===61?(t.consume(k),P):Q(k)?(s=F,te(k)):ie(k)?(t.consume(k),F):z(k)}function P(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(t.consume(k),i=k,X):Q(k)?(s=P,te(k)):ie(k)?(t.consume(k),P):(t.consume(k),q)}function X(k){return k===i?(t.consume(k),i=void 0,j):k===null?n(k):Q(k)?(s=X,te(k)):(t.consume(k),X)}function q(k){return k===null||k===34||k===39||k===60||k===61||k===96?n(k):k===47||k===62||be(k)?z(k):(t.consume(k),q)}function j(k){return k===47||k===62||be(k)?z(k):n(k)}function Z(k){return k===62?(t.consume(k),t.exit("htmlTextData"),t.exit("htmlText"),e):n(k)}function te(k){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(k),t.exit("lineEnding"),K}function K(k){return ie(k)?oe(t,ce,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):ce(k)}function ce(k){return t.enter("htmlTextData"),s(k)}}const fa={name:"labelEnd",resolveAll:Gp,resolveTo:Xp,tokenize:Zp},Vp={tokenize:Kp},Wp={tokenize:Jp},Qp={tokenize:em};function Gp(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&&Ze(t,0,t.length,n),t}function Xp(t,e){let n=t.length,r=0,i,a,s,u;for(;n--;)if(i=t[n][1],a){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;t[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(t[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(a=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const o={type:t[a][1].type==="labelLink"?"link":"image",start:{...t[a][1].start},end:{...t[t.length-1][1].end}},l={type:"label",start:{...t[a][1].start},end:{...t[s][1].end}},d={type:"labelText",start:{...t[a+r+2][1].end},end:{...t[s-2][1].start}};return u=[["enter",o,e],["enter",l,e]],u=tt(u,t.slice(a+1,a+r+3)),u=tt(u,[["enter",d,e]]),u=tt(u,Ur(e.parser.constructs.insideSpan.null,t.slice(a+r+4,s-3),e)),u=tt(u,[["exit",d,e],t[s-2],t[s-1],["exit",l,e]]),u=tt(u,t.slice(s+1)),u=tt(u,[["exit",o,e]]),Ze(t,a,t.length,u),t}function Zp(t,e,n){const r=this;let i=r.events.length,a,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){a=r.events[i][1];break}return u;function u(p){return a?a._inactive?f(p):(s=r.parser.defined.includes(st(r.sliceSerialize({start:a.end,end:r.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(p),t.exit("labelMarker"),t.exit("labelEnd"),o):n(p)}function o(p){return p===40?t.attempt(Vp,d,s?d:f)(p):p===91?t.attempt(Wp,d,s?l:f)(p):s?d(p):f(p)}function l(p){return t.attempt(Qp,d,f)(p)}function d(p){return e(p)}function f(p){return a._balanced=!0,n(p)}}function Kp(t,e,n){return r;function r(f){return t.enter("resource"),t.enter("resourceMarker"),t.consume(f),t.exit("resourceMarker"),i}function i(f){return be(f)?Mn(t,a)(f):a(f)}function a(f){return f===41?d(f):$o(t,s,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function s(f){return be(f)?Mn(t,o)(f):d(f)}function u(f){return n(f)}function o(f){return f===34||f===39||f===40?qo(t,l,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):d(f)}function l(f){return be(f)?Mn(t,d)(f):d(f)}function d(f){return f===41?(t.enter("resourceMarker"),t.consume(f),t.exit("resourceMarker"),t.exit("resource"),e):n(f)}}function Jp(t,e,n){const r=this;return i;function i(u){return Yo.call(r,t,a,s,"reference","referenceMarker","referenceString")(u)}function a(u){return r.parser.defined.includes(st(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?e(u):n(u)}function s(u){return n(u)}}function em(t,e,n){return r;function r(a){return t.enter("reference"),t.enter("referenceMarker"),t.consume(a),t.exit("referenceMarker"),i}function i(a){return a===93?(t.enter("referenceMarker"),t.consume(a),t.exit("referenceMarker"),t.exit("reference"),e):n(a)}}const tm={name:"labelStartImage",resolveAll:fa.resolveAll,tokenize:nm};function nm(t,e,n){const r=this;return i;function i(u){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(u),t.exit("labelImageMarker"),a}function a(u){return u===91?(t.enter("labelMarker"),t.consume(u),t.exit("labelMarker"),t.exit("labelImage"),s):n(u)}function s(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):e(u)}}const rm={name:"labelStartLink",resolveAll:fa.resolveAll,tokenize:im};function im(t,e,n){const r=this;return i;function i(s){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(s),t.exit("labelMarker"),t.exit("labelLink"),a}function a(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):e(s)}}const ni={name:"lineEnding",tokenize:am};function am(t,e){return n;function n(r){return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),oe(t,e,"linePrefix")}}const Er={name:"thematicBreak",tokenize:sm};function sm(t,e,n){let r=0,i;return a;function a(l){return t.enter("thematicBreak"),s(l)}function s(l){return i=l,u(l)}function u(l){return l===i?(t.enter("thematicBreakSequence"),o(l)):r>=3&&(l===null||Q(l))?(t.exit("thematicBreak"),e(l)):n(l)}function o(l){return l===i?(t.consume(l),r++,o):(t.exit("thematicBreakSequence"),ie(l)?oe(t,u,"whitespace")(l):u(l))}}const qe={continuation:{tokenize:cm},exit:fm,name:"list",tokenize:lm},um={partial:!0,tokenize:hm},om={partial:!0,tokenize:dm};function lm(t,e,n){const r=this,i=r.events[r.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return u;function u(h){const g=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:Oi(h)){if(r.containerState.type||(r.containerState.type=g,t.enter(g,{_container:!0})),g==="listUnordered")return t.enter("listItemPrefix"),h===42||h===45?t.check(Er,n,l)(h):l(h);if(!r.interrupt||h===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),o(h)}return n(h)}function o(h){return Oi(h)&&++s<10?(t.consume(h),o):(!r.interrupt||s<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(t.exit("listItemValue"),l(h)):n(h)}function l(h){return t.enter("listItemMarker"),t.consume(h),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,t.check(rr,r.interrupt?n:d,t.attempt(um,p,f))}function d(h){return r.containerState.initialBlankLine=!0,a++,p(h)}function f(h){return ie(h)?(t.enter("listItemPrefixWhitespace"),t.consume(h),t.exit("listItemPrefixWhitespace"),p):n(h)}function p(h){return r.containerState.size=a+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(h)}}function cm(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(rr,i,a);function i(u){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,oe(t,e,"listItemIndent",r.containerState.size+1)(u)}function a(u){return r.containerState.furtherBlankLines||!ie(u)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(u)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(om,e,s)(u))}function s(u){return r.containerState._closeFlow=!0,r.interrupt=void 0,oe(t,t.attempt(qe,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function dm(t,e,n){const r=this;return oe(t,i,"listItemIndent",r.containerState.size+1);function i(a){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?e(a):n(a)}}function fm(t){t.exit(this.containerState.type)}function hm(t,e,n){const r=this;return oe(t,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const s=r.events[r.events.length-1];return!ie(a)&&s&&s[1].type==="listItemPrefixWhitespace"?e(a):n(a)}}const ks={name:"setextUnderline",resolveTo:pm,tokenize:mm};function pm(t,e){let n=t.length,r,i,a;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),!a&&t[n][1].type==="definition"&&(a=n);const s={type:"setextHeading",start:{...t[r][1].start},end:{...t[t.length-1][1].end}};return t[i][1].type="setextHeadingText",a?(t.splice(i,0,["enter",s,e]),t.splice(a+1,0,["exit",t[r][1],e]),t[r][1].end={...t[a][1].end}):t[r][1]=s,t.push(["exit",s,e]),t}function mm(t,e,n){const r=this;let i;return a;function a(l){let d=r.events.length,f;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){f=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(t.enter("setextHeadingLine"),i=l,s(l)):n(l)}function s(l){return t.enter("setextHeadingLineSequence"),u(l)}function u(l){return l===i?(t.consume(l),u):(t.exit("setextHeadingLineSequence"),ie(l)?oe(t,o,"lineSuffix")(l):o(l))}function o(l){return l===null||Q(l)?(t.exit("setextHeadingLine"),e(l)):n(l)}}const gm={tokenize:Em};function Em(t){const e=this,n=t.attempt(rr,r,t.attempt(this.parser.constructs.flowInitial,i,oe(t,t.attempt(this.parser.constructs.flow,i,t.attempt(yp,i)),"linePrefix")));return n;function r(a){if(a===null){t.consume(a);return}return t.enter("lineEndingBlank"),t.consume(a),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function i(a){if(a===null){t.consume(a);return}return t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const bm={resolveAll:Wo()},Tm=Vo("string"),xm=Vo("text");function Vo(t){return{resolveAll:Wo(t==="text"?_m:void 0),tokenize:e};function e(n){const r=this,i=this.parser.constructs[t],a=n.attempt(i,s,u);return s;function s(d){return l(d)?a(d):u(d)}function u(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),o}function o(d){return l(d)?(n.exit("data"),a(d)):(n.consume(d),o)}function l(d){if(d===null)return!0;const f=i[d];let p=-1;if(f)for(;++p<f.length;){const h=f[p];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function Wo(t){return e;function e(n,r){let i=-1,a;for(;++i<=n.length;)a===void 0?n[i]&&n[i][1].type==="data"&&(a=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==a+2&&(n[a][1].end=n[i-1][1].end,n.splice(a+2,i-a-2),i=a+2),a=void 0);return t?t(n,r):n}}function _m(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 a=i.length,s=-1,u=0,o;for(;a--;){const l=i[a];if(typeof l=="string"){for(s=l.length;l.charCodeAt(s-1)===32;)u++,s--;if(s)break;s=-1}else if(l===-2)o=!0,u++;else if(l!==-1){a++;break}}if(e._contentTypeTextTrailing&&n===t.length&&(u=0),u){const l={type:n===t.length||o||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?s:r.start._bufferIndex+s,_index:r.start._index+a,line:r.end.line,column:r.end.column-u,offset:r.end.offset-u},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 ym={42:qe,43:qe,45:qe,48:qe,49:qe,50:qe,51:qe,52:qe,53:qe,54:qe,55:qe,56:qe,57:qe,62:Uo},Am={91:Sp},km={[-2]:ti,[-1]:ti,32:ti},Cm={35:Dp,42:Er,45:[ks,Er],60:Bp,61:ks,95:Er,96:ys,126:ys},Im={38:jo,92:Ho},Sm={[-5]:ni,[-4]:ni,[-3]:ni,33:tm,38:jo,42:Li,60:[rp,Yp],91:rm,92:[Op,Ho],93:fa,95:Li,96:gp},Nm={null:[Li,bm]},wm={null:[42,95]},Rm={null:[]},Om=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:wm,contentInitial:Am,disable:Rm,document:ym,flow:Cm,flowInitial:km,insideSpan:Nm,string:Im,text:Sm},Symbol.toStringTag,{value:"Module"}));function Lm(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={},a=[];let s=[],u=[];const o={attempt:v(O),check:v(S),consume:I,enter:E,exit:R,interrupt:v(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:_,events:[],now:g,parser:t,previous:null,sliceSerialize:p,sliceStream:h,write:f};let d=e.tokenize.call(l,o);return e.resolveAll&&a.push(e),l;function f(F){return s=tt(s,F),y(),s[s.length-1]!==null?[]:(B(e,0),l.events=Ur(a,l.events,l),l.events)}function p(F,P){return vm(h(F),P)}function h(F){return Dm(s,F)}function g(){const{_bufferIndex:F,_index:P,line:X,column:q,offset:j}=r;return{_bufferIndex:F,_index:P,line:X,column:q,offset:j}}function _(F){i[F.line]=F.column,N()}function y(){let F;for(;r._index<s.length;){const P=s[r._index];if(typeof P=="string")for(F=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===F&&r._bufferIndex<P.length;)T(P.charCodeAt(r._bufferIndex));else T(P)}}function T(F){d=d(F)}function I(F){Q(F)?(r.line++,r.column=1,r.offset+=F===-3?2:1,N()):F!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=F}function E(F,P){const X=P||{};return X.type=F,X.start=g(),l.events.push(["enter",X,l]),u.push(X),X}function R(F){const P=u.pop();return P.end=g(),l.events.push(["exit",P,l]),P}function O(F,P){B(F,P.from)}function S(F,P){P.restore()}function v(F,P){return X;function X(q,j,Z){let te,K,ce,k;return Array.isArray(q)?xe(q):"tokenize"in q?xe([q]):ae(q);function ae(me){return Ne;function Ne(_e){const we=_e!==null&&me[_e],Se=_e!==null&&me.null,Oe=[...Array.isArray(we)?we:we?[we]:[],...Array.isArray(Se)?Se:Se?[Se]:[]];return xe(Oe)(_e)}}function xe(me){return te=me,K=0,me.length===0?Z:C(me[K])}function C(me){return Ne;function Ne(_e){return k=z(),ce=me,me.partial||(l.currentConstruct=me),me.name&&l.parser.constructs.disable.null.includes(me.name)?Ie():me.tokenize.call(P?Object.assign(Object.create(l),P):l,o,ke,Ie)(_e)}}function ke(me){return F(ce,k),j}function Ie(me){return k.restore(),++K<te.length?C(te[K]):Z}}}function B(F,P){F.resolveAll&&!a.includes(F)&&a.push(F),F.resolve&&Ze(l.events,P,l.events.length-P,F.resolve(l.events.slice(P),l)),F.resolveTo&&(l.events=F.resolveTo(l.events,l))}function z(){const F=g(),P=l.previous,X=l.currentConstruct,q=l.events.length,j=Array.from(u);return{from:q,restore:Z};function Z(){r=F,l.previous=P,l.currentConstruct=X,l.events.length=q,u=j,N()}}function N(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Dm(t,e){const n=e.start._index,r=e.start._bufferIndex,i=e.end._index,a=e.end._bufferIndex;let s;if(n===i)s=[t[n].slice(r,a)];else{if(s=t.slice(n,i),r>-1){const u=s[0];typeof u=="string"?s[0]=u.slice(r):s.shift()}a>0&&s.push(t[i].slice(0,a))}return s}function vm(t,e){let n=-1;const r=[];let i;for(;++n<t.length;){const a=t[n];let s;if(typeof a=="string")s=a;else switch(a){case-5:{s="\r";break}case-4:{s=`
|
|
69
69
|
`;break}case-3:{s=`\r
|
|
70
|
-
`;break}case-2:{s=e?" ":" ";break}case-1:{if(!e&&i)continue;s=" ";break}default:s=String.fromCharCode(a)}i=a===-2,r.push(s)}return r.join("")}function vm(t){const r={constructs:Po([Rm,...(t||{}).extensions||[]]),content:i(G0),defined:[],document:i(Z0),flow:i(mm),lazy:{},string:i(bm),text:i(Tm)};return r;function i(a){return s;function s(u){return Om(r,a,u)}}}function Pm(t){for(;!Ho(t););return t}const ys=/[\0\t\n\r]/g;function Mm(){let t=1,e="",n=!0,r;return i;function i(a,s,u){const o=[];let l,d,f,p,h;for(a=e+(typeof a=="string"?a.toString():new TextDecoder(s||void 0).decode(a)),f=0,e="",n&&(a.charCodeAt(0)===65279&&f++,n=void 0);f<a.length;){if(ys.lastIndex=f,l=ys.exec(a),p=l&&l.index!==void 0?l.index:a.length,h=a.charCodeAt(p),!l){e=a.slice(f);break}if(h===10&&f===p&&r)o.push(-3),r=void 0;else switch(r&&(o.push(-5),r=void 0),f<p&&(o.push(a.slice(f,p)),t+=p-f),h){case 0:{o.push(65533),t++;break}case 9:{for(d=Math.ceil(t/4)*4,o.push(-2);t++<d;)o.push(-1);break}case 10:{o.push(-4),t=1;break}default:r=!0,t=1}f=p+1}return u&&(r&&o.push(-5),e&&o.push(e),o.push(null)),o}}const Bm=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Fm(t){return t.replace(Bm,Um)}function Um(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return Mo(n.slice(a?2:1),a?16:10)}return ia(n)||t}const Vo={}.hasOwnProperty;function Hm(t,e,n){return typeof e!="string"&&(n=e,e=void 0),jm(n)(Pm(vm(n).document().write(Mm()(t,e,!0))))}function jm(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Ca),autolinkProtocol:z,autolinkEmail:z,atxHeading:a(ya),blockQuote:a(Le),characterEscape:z,characterReference:z,codeFenced:a(Ve),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:a(Ve,s),codeText:a(Yt,s),codeTextData:z,data:z,codeFlowValue:z,definition:a(Ze),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:a(mc),hardBreakEscape:a(Aa),hardBreakTrailing:a(Aa),htmlFlow:a(ka,s),htmlFlowData:z,htmlText:a(ka,s),htmlTextData:z,image:a(gc),label:s,link:a(Ca),listItem:a(Ec),listItemValue:p,listOrdered:a(Ia,f),listUnordered:a(Ia),paragraph:a(bc),reference:C,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:a(ya),strong:a(Tc),thematicBreak:a(_c)},exit:{atxHeading:o(),atxHeadingSequence:O,autolink:o(),autolinkEmail:He,autolinkProtocol:Se,blockQuote:o(),characterEscapeValue:N,characterReferenceMarkerHexadecimal:de,characterReferenceMarkerNumeric:de,characterReferenceValue:_e,characterReference:Re,codeFenced:o(y),codeFencedFence:_,codeFencedFenceInfo:h,codeFencedFenceMeta:g,codeFlowValue:N,codeIndented:o(T),codeText:o(H),codeTextData:N,data:N,definition:o(),definitionDestinationString:R,definitionLabelString:S,definitionTitleString:E,emphasis:o(),hardBreakEscape:o(P),hardBreakTrailing:o(P),htmlFlow:o(Z),htmlFlowData:N,htmlText:o($),htmlTextData:N,image:o(te),label:ge,labelText:K,lineEnding:F,link:o(Q),listItem:o(),listOrdered:o(),listUnordered:o(),paragraph:o(),referenceString:le,resourceDestinationString:k,resourceTitleString:ae,resource:me,setextHeading:o(B),setextHeadingLineSequence:v,setextHeadingText:I,strong:o(),thematicBreak:o()}};Wo(e,(t||{}).mdastExtensions||[]);const n={};return r;function r(D){let Y={type:"root",children:[]};const J={stack:[Y],tokenStack:[],config:e,enter:u,exit:l,buffer:s,resume:d,data:n},se=[];let Ee=-1;for(;++Ee<D.length;)if(D[Ee][1].type==="listOrdered"||D[Ee][1].type==="listUnordered")if(D[Ee][0]==="enter")se.push(Ee);else{const tt=se.pop();Ee=i(D,tt,Ee)}for(Ee=-1;++Ee<D.length;){const tt=e[D[Ee][0]];Vo.call(tt,D[Ee][1].type)&&tt[D[Ee][1].type].call(Object.assign({sliceSerialize:D[Ee][2].sliceSerialize},J),D[Ee][1])}if(J.tokenStack.length>0){const tt=J.tokenStack[J.tokenStack.length-1];(tt[1]||As).call(J,void 0,tt[0])}for(Y.position={start:bt(D.length>0?D[0][1].start:{line:1,column:1,offset:0}),end:bt(D.length>0?D[D.length-2][1].end:{line:1,column:1,offset:0})},Ee=-1;++Ee<e.transforms.length;)Y=e.transforms[Ee](Y)||Y;return Y}function i(D,Y,J){let se=Y-1,Ee=-1,tt=!1,Rt,ft,hn,pn;for(;++se<=J;){const We=D[se];switch(We[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{We[0]==="enter"?Ee++:Ee--,pn=void 0;break}case"lineEndingBlank":{We[0]==="enter"&&(Rt&&!pn&&!Ee&&!hn&&(hn=se),pn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:pn=void 0}if(!Ee&&We[0]==="enter"&&We[1].type==="listItemPrefix"||Ee===-1&&We[0]==="exit"&&(We[1].type==="listUnordered"||We[1].type==="listOrdered")){if(Rt){let qt=se;for(ft=void 0;qt--;){const ht=D[qt];if(ht[1].type==="lineEnding"||ht[1].type==="lineEndingBlank"){if(ht[0]==="exit")continue;ft&&(D[ft][1].type="lineEndingBlank",tt=!0),ht[1].type="lineEnding",ft=qt}else if(!(ht[1].type==="linePrefix"||ht[1].type==="blockQuotePrefix"||ht[1].type==="blockQuotePrefixWhitespace"||ht[1].type==="blockQuoteMarker"||ht[1].type==="listItemIndent"))break}hn&&(!ft||hn<ft)&&(Rt._spread=!0),Rt.end=Object.assign({},ft?D[ft][1].start:We[1].end),D.splice(ft||se,0,["exit",Rt,We[2]]),se++,J++}if(We[1].type==="listItemPrefix"){const qt={type:"listItem",_spread:!1,start:Object.assign({},We[1].start),end:void 0};Rt=qt,D.splice(se,0,["enter",qt,We[2]]),se++,J++,hn=void 0,pn=!0}}}return D[Y][1]._spread=tt,J}function a(D,Y){return J;function J(se){u.call(this,D(se),se),Y&&Y.call(this,se)}}function s(){this.stack.push({type:"fragment",children:[]})}function u(D,Y,J){this.stack[this.stack.length-1].children.push(D),this.stack.push(D),this.tokenStack.push([Y,J||void 0]),D.position={start:bt(Y.start),end:void 0}}function o(D){return Y;function Y(J){D&&D.call(this,J),l.call(this,J)}}function l(D,Y){const J=this.stack.pop(),se=this.tokenStack.pop();if(se)se[0].type!==D.type&&(Y?Y.call(this,D,se[0]):(se[1]||As).call(this,D,se[0]));else throw new Error("Cannot close `"+D.type+"` ("+wn({start:D.start,end:D.end})+"): it’s not open");J.position.end=bt(D.end)}function d(){return ra(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(D){if(this.data.expectingFirstListItemValue){const Y=this.stack[this.stack.length-2];Y.start=Number.parseInt(this.sliceSerialize(D),10),this.data.expectingFirstListItemValue=void 0}}function h(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.lang=D}function g(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.meta=D}function _(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.value=D.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function T(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.value=D.replace(/(\r?\n|\r)$/g,"")}function S(D){const Y=this.resume(),J=this.stack[this.stack.length-1];J.label=Y,J.identifier=it(this.sliceSerialize(D)).toLowerCase()}function E(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.title=D}function R(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.url=D}function O(D){const Y=this.stack[this.stack.length-1];if(!Y.depth){const J=this.sliceSerialize(D).length;Y.depth=J}}function I(){this.data.setextHeadingSlurpLineEnding=!0}function v(D){const Y=this.stack[this.stack.length-1];Y.depth=this.sliceSerialize(D).codePointAt(0)===61?1:2}function B(){this.data.setextHeadingSlurpLineEnding=void 0}function z(D){const J=this.stack[this.stack.length-1].children;let se=J[J.length-1];(!se||se.type!=="text")&&(se=xc(),se.position={start:bt(D.start),end:void 0},J.push(se)),this.stack.push(se)}function N(D){const Y=this.stack.pop();Y.value+=this.sliceSerialize(D),Y.position.end=bt(D.end)}function F(D){const Y=this.stack[this.stack.length-1];if(this.data.atHardBreak){const J=Y.children[Y.children.length-1];J.position.end=bt(D.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(Y.type)&&(z.call(this,D),N.call(this,D))}function P(){this.data.atHardBreak=!0}function Z(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.value=D}function $(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.value=D}function H(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.value=D}function Q(){const D=this.stack[this.stack.length-1];if(this.data.inReference){const Y=this.data.referenceType||"shortcut";D.type+="Reference",D.referenceType=Y,delete D.url,delete D.title}else delete D.identifier,delete D.label;this.data.referenceType=void 0}function te(){const D=this.stack[this.stack.length-1];if(this.data.inReference){const Y=this.data.referenceType||"shortcut";D.type+="Reference",D.referenceType=Y,delete D.url,delete D.title}else delete D.identifier,delete D.label;this.data.referenceType=void 0}function K(D){const Y=this.sliceSerialize(D),J=this.stack[this.stack.length-2];J.label=Fm(Y),J.identifier=it(Y).toLowerCase()}function ge(){const D=this.stack[this.stack.length-1],Y=this.resume(),J=this.stack[this.stack.length-1];if(this.data.inReference=!0,J.type==="link"){const se=D.children;J.children=se}else J.alt=Y}function k(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.url=D}function ae(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.title=D}function me(){this.data.inReference=void 0}function C(){this.data.referenceType="collapsed"}function le(D){const Y=this.resume(),J=this.stack[this.stack.length-1];J.label=Y,J.identifier=it(this.sliceSerialize(D)).toLowerCase(),this.data.referenceType="full"}function de(D){this.data.characterReferenceType=D.type}function _e(D){const Y=this.sliceSerialize(D),J=this.data.characterReferenceType;let se;J?(se=Mo(Y,J==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):se=ia(Y);const Ee=this.stack[this.stack.length-1];Ee.value+=se}function Re(D){const Y=this.stack.pop();Y.position.end=bt(D.end)}function Se(D){N.call(this,D);const Y=this.stack[this.stack.length-1];Y.url=this.sliceSerialize(D)}function He(D){N.call(this,D);const Y=this.stack[this.stack.length-1];Y.url="mailto:"+this.sliceSerialize(D)}function Le(){return{type:"blockquote",children:[]}}function Ve(){return{type:"code",lang:null,meta:null,value:""}}function Yt(){return{type:"inlineCode",value:""}}function Ze(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function mc(){return{type:"emphasis",children:[]}}function ya(){return{type:"heading",depth:0,children:[]}}function Aa(){return{type:"break"}}function ka(){return{type:"html",value:""}}function gc(){return{type:"image",title:null,url:"",alt:null}}function Ca(){return{type:"link",title:null,url:"",children:[]}}function Ia(D){return{type:"list",ordered:D.type==="listOrdered",start:null,spread:D._spread,children:[]}}function Ec(D){return{type:"listItem",spread:D._spread,checked:null,children:[]}}function bc(){return{type:"paragraph",children:[]}}function Tc(){return{type:"strong",children:[]}}function xc(){return{type:"text",value:""}}function _c(){return{type:"thematicBreak"}}}function bt(t){return{line:t.line,column:t.column,offset:t.offset}}function Wo(t,e){let n=-1;for(;++n<e.length;){const r=e[n];Array.isArray(r)?Wo(t,r):zm(t,r)}}function zm(t,e){let n;for(n in e)if(Vo.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 As(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+wn({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+wn({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+wn({start:e.start,end:e.end})+") is still open")}function $m(t){const e=this;e.parser=n;function n(r){return Hm(r,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function Ym(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 qm(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:`
|
|
71
|
-
`}]}function
|
|
72
|
-
`:"",r={},i=e.lang?e.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return e.meta&&(a.data={meta:e.meta}),t.patch(e,a),a=t.applyData(e,a),a={type:"element",tagName:"pre",properties:{},children:[a]},t.patch(e,a),a}function
|
|
70
|
+
`;break}case-2:{s=e?" ":" ";break}case-1:{if(!e&&i)continue;s=" ";break}default:s=String.fromCharCode(a)}i=a===-2,r.push(s)}return r.join("")}function Pm(t){const r={constructs:Bo([Om,...(t||{}).extensions||[]]),content:i(X0),defined:[],document:i(K0),flow:i(gm),lazy:{},string:i(Tm),text:i(xm)};return r;function i(a){return s;function s(u){return Lm(r,a,u)}}}function Mm(t){for(;!zo(t););return t}const Cs=/[\0\t\n\r]/g;function Bm(){let t=1,e="",n=!0,r;return i;function i(a,s,u){const o=[];let l,d,f,p,h;for(a=e+(typeof a=="string"?a.toString():new TextDecoder(s||void 0).decode(a)),f=0,e="",n&&(a.charCodeAt(0)===65279&&f++,n=void 0);f<a.length;){if(Cs.lastIndex=f,l=Cs.exec(a),p=l&&l.index!==void 0?l.index:a.length,h=a.charCodeAt(p),!l){e=a.slice(f);break}if(h===10&&f===p&&r)o.push(-3),r=void 0;else switch(r&&(o.push(-5),r=void 0),f<p&&(o.push(a.slice(f,p)),t+=p-f),h){case 0:{o.push(65533),t++;break}case 9:{for(d=Math.ceil(t/4)*4,o.push(-2);t++<d;)o.push(-1);break}case 10:{o.push(-4),t=1;break}default:r=!0,t=1}f=p+1}return u&&(r&&o.push(-5),e&&o.push(e),o.push(null)),o}}const Fm=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Um(t){return t.replace(Fm,Hm)}function Hm(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return Fo(n.slice(a?2:1),a?16:10)}return da(n)||t}const Qo={}.hasOwnProperty;function jm(t,e,n){return typeof e!="string"&&(n=e,e=void 0),zm(n)(Mm(Pm(n).document().write(Bm()(t,e,!0))))}function zm(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(At),autolinkProtocol:z,autolinkEmail:z,atxHeading:a(mt),blockQuote:a(Se),characterEscape:z,characterReference:z,codeFenced:a(Oe),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:a(Oe,s),codeText:a(ot,s),codeTextData:z,data:z,codeFlowValue:z,definition:a(De),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:a(yt),hardBreakEscape:a(Mt),hardBreakTrailing:a(Mt),htmlFlow:a(fe,s),htmlFlowData:z,htmlText:a(fe,s),htmlTextData:z,image:a(Je),label:s,link:a(At),listItem:a(Ec),listItemValue:p,listOrdered:a(wa,f),listUnordered:a(wa),paragraph:a(bc),reference:C,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:a(mt),strong:a(Tc),thematicBreak:a(_c)},exit:{atxHeading:o(),atxHeadingSequence:O,autolink:o(),autolinkEmail:we,autolinkProtocol:_e,blockQuote:o(),characterEscapeValue:N,characterReferenceMarkerHexadecimal:Ie,characterReferenceMarkerNumeric:Ie,characterReferenceValue:me,characterReference:Ne,codeFenced:o(y),codeFencedFence:_,codeFencedFenceInfo:h,codeFencedFenceMeta:g,codeFlowValue:N,codeIndented:o(T),codeText:o(j),codeTextData:N,data:N,definition:o(),definitionDestinationString:R,definitionLabelString:I,definitionTitleString:E,emphasis:o(),hardBreakEscape:o(P),hardBreakTrailing:o(P),htmlFlow:o(X),htmlFlowData:N,htmlText:o(q),htmlTextData:N,image:o(te),label:ce,labelText:K,lineEnding:F,link:o(Z),listItem:o(),listOrdered:o(),listUnordered:o(),paragraph:o(),referenceString:ke,resourceDestinationString:k,resourceTitleString:ae,resource:xe,setextHeading:o(B),setextHeadingLineSequence:v,setextHeadingText:S,strong:o(),thematicBreak:o()}};Go(e,(t||{}).mdastExtensions||[]);const n={};return r;function r(D){let $={type:"root",children:[]};const J={stack:[$],tokenStack:[],config:e,enter:u,exit:l,buffer:s,resume:d,data:n},se=[];let ge=-1;for(;++ge<D.length;)if(D[ge][1].type==="listOrdered"||D[ge][1].type==="listUnordered")if(D[ge][0]==="enter")se.push(ge);else{const rt=se.pop();ge=i(D,rt,ge)}for(ge=-1;++ge<D.length;){const rt=e[D[ge][0]];Qo.call(rt,D[ge][1].type)&&rt[D[ge][1].type].call(Object.assign({sliceSerialize:D[ge][2].sliceSerialize},J),D[ge][1])}if(J.tokenStack.length>0){const rt=J.tokenStack[J.tokenStack.length-1];(rt[1]||Is).call(J,void 0,rt[0])}for($.position={start:kt(D.length>0?D[0][1].start:{line:1,column:1,offset:0}),end:kt(D.length>0?D[D.length-2][1].end:{line:1,column:1,offset:0})},ge=-1;++ge<e.transforms.length;)$=e.transforms[ge]($)||$;return $}function i(D,$,J){let se=$-1,ge=-1,rt=!1,Bt,gt,Tn,xn;for(;++se<=J;){const Ge=D[se];switch(Ge[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ge[0]==="enter"?ge++:ge--,xn=void 0;break}case"lineEndingBlank":{Ge[0]==="enter"&&(Bt&&!xn&&!ge&&!Tn&&(Tn=se),xn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:xn=void 0}if(!ge&&Ge[0]==="enter"&&Ge[1].type==="listItemPrefix"||ge===-1&&Ge[0]==="exit"&&(Ge[1].type==="listUnordered"||Ge[1].type==="listOrdered")){if(Bt){let Zt=se;for(gt=void 0;Zt--;){const Et=D[Zt];if(Et[1].type==="lineEnding"||Et[1].type==="lineEndingBlank"){if(Et[0]==="exit")continue;gt&&(D[gt][1].type="lineEndingBlank",rt=!0),Et[1].type="lineEnding",gt=Zt}else if(!(Et[1].type==="linePrefix"||Et[1].type==="blockQuotePrefix"||Et[1].type==="blockQuotePrefixWhitespace"||Et[1].type==="blockQuoteMarker"||Et[1].type==="listItemIndent"))break}Tn&&(!gt||Tn<gt)&&(Bt._spread=!0),Bt.end=Object.assign({},gt?D[gt][1].start:Ge[1].end),D.splice(gt||se,0,["exit",Bt,Ge[2]]),se++,J++}if(Ge[1].type==="listItemPrefix"){const Zt={type:"listItem",_spread:!1,start:Object.assign({},Ge[1].start),end:void 0};Bt=Zt,D.splice(se,0,["enter",Zt,Ge[2]]),se++,J++,Tn=void 0,xn=!0}}}return D[$][1]._spread=rt,J}function a(D,$){return J;function J(se){u.call(this,D(se),se),$&&$.call(this,se)}}function s(){this.stack.push({type:"fragment",children:[]})}function u(D,$,J){this.stack[this.stack.length-1].children.push(D),this.stack.push(D),this.tokenStack.push([$,J||void 0]),D.position={start:kt($.start),end:void 0}}function o(D){return $;function $(J){D&&D.call(this,J),l.call(this,J)}}function l(D,$){const J=this.stack.pop(),se=this.tokenStack.pop();if(se)se[0].type!==D.type&&($?$.call(this,D,se[0]):(se[1]||Is).call(this,D,se[0]));else throw new Error("Cannot close `"+D.type+"` ("+Pn({start:D.start,end:D.end})+"): it’s not open");J.position.end=kt(D.end)}function d(){return ca(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(D){if(this.data.expectingFirstListItemValue){const $=this.stack[this.stack.length-2];$.start=Number.parseInt(this.sliceSerialize(D),10),this.data.expectingFirstListItemValue=void 0}}function h(){const D=this.resume(),$=this.stack[this.stack.length-1];$.lang=D}function g(){const D=this.resume(),$=this.stack[this.stack.length-1];$.meta=D}function _(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const D=this.resume(),$=this.stack[this.stack.length-1];$.value=D.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function T(){const D=this.resume(),$=this.stack[this.stack.length-1];$.value=D.replace(/(\r?\n|\r)$/g,"")}function I(D){const $=this.resume(),J=this.stack[this.stack.length-1];J.label=$,J.identifier=st(this.sliceSerialize(D)).toLowerCase()}function E(){const D=this.resume(),$=this.stack[this.stack.length-1];$.title=D}function R(){const D=this.resume(),$=this.stack[this.stack.length-1];$.url=D}function O(D){const $=this.stack[this.stack.length-1];if(!$.depth){const J=this.sliceSerialize(D).length;$.depth=J}}function S(){this.data.setextHeadingSlurpLineEnding=!0}function v(D){const $=this.stack[this.stack.length-1];$.depth=this.sliceSerialize(D).codePointAt(0)===61?1:2}function B(){this.data.setextHeadingSlurpLineEnding=void 0}function z(D){const J=this.stack[this.stack.length-1].children;let se=J[J.length-1];(!se||se.type!=="text")&&(se=xc(),se.position={start:kt(D.start),end:void 0},J.push(se)),this.stack.push(se)}function N(D){const $=this.stack.pop();$.value+=this.sliceSerialize(D),$.position.end=kt(D.end)}function F(D){const $=this.stack[this.stack.length-1];if(this.data.atHardBreak){const J=$.children[$.children.length-1];J.position.end=kt(D.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes($.type)&&(z.call(this,D),N.call(this,D))}function P(){this.data.atHardBreak=!0}function X(){const D=this.resume(),$=this.stack[this.stack.length-1];$.value=D}function q(){const D=this.resume(),$=this.stack[this.stack.length-1];$.value=D}function j(){const D=this.resume(),$=this.stack[this.stack.length-1];$.value=D}function Z(){const D=this.stack[this.stack.length-1];if(this.data.inReference){const $=this.data.referenceType||"shortcut";D.type+="Reference",D.referenceType=$,delete D.url,delete D.title}else delete D.identifier,delete D.label;this.data.referenceType=void 0}function te(){const D=this.stack[this.stack.length-1];if(this.data.inReference){const $=this.data.referenceType||"shortcut";D.type+="Reference",D.referenceType=$,delete D.url,delete D.title}else delete D.identifier,delete D.label;this.data.referenceType=void 0}function K(D){const $=this.sliceSerialize(D),J=this.stack[this.stack.length-2];J.label=Um($),J.identifier=st($).toLowerCase()}function ce(){const D=this.stack[this.stack.length-1],$=this.resume(),J=this.stack[this.stack.length-1];if(this.data.inReference=!0,J.type==="link"){const se=D.children;J.children=se}else J.alt=$}function k(){const D=this.resume(),$=this.stack[this.stack.length-1];$.url=D}function ae(){const D=this.resume(),$=this.stack[this.stack.length-1];$.title=D}function xe(){this.data.inReference=void 0}function C(){this.data.referenceType="collapsed"}function ke(D){const $=this.resume(),J=this.stack[this.stack.length-1];J.label=$,J.identifier=st(this.sliceSerialize(D)).toLowerCase(),this.data.referenceType="full"}function Ie(D){this.data.characterReferenceType=D.type}function me(D){const $=this.sliceSerialize(D),J=this.data.characterReferenceType;let se;J?(se=Fo($,J==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):se=da($);const ge=this.stack[this.stack.length-1];ge.value+=se}function Ne(D){const $=this.stack.pop();$.position.end=kt(D.end)}function _e(D){N.call(this,D);const $=this.stack[this.stack.length-1];$.url=this.sliceSerialize(D)}function we(D){N.call(this,D);const $=this.stack[this.stack.length-1];$.url="mailto:"+this.sliceSerialize(D)}function Se(){return{type:"blockquote",children:[]}}function Oe(){return{type:"code",lang:null,meta:null,value:""}}function ot(){return{type:"inlineCode",value:""}}function De(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function yt(){return{type:"emphasis",children:[]}}function mt(){return{type:"heading",depth:0,children:[]}}function Mt(){return{type:"break"}}function fe(){return{type:"html",value:""}}function Je(){return{type:"image",title:null,url:"",alt:null}}function At(){return{type:"link",title:null,url:"",children:[]}}function wa(D){return{type:"list",ordered:D.type==="listOrdered",start:null,spread:D._spread,children:[]}}function Ec(D){return{type:"listItem",spread:D._spread,checked:null,children:[]}}function bc(){return{type:"paragraph",children:[]}}function Tc(){return{type:"strong",children:[]}}function xc(){return{type:"text",value:""}}function _c(){return{type:"thematicBreak"}}}function kt(t){return{line:t.line,column:t.column,offset:t.offset}}function Go(t,e){let n=-1;for(;++n<e.length;){const r=e[n];Array.isArray(r)?Go(t,r):$m(t,r)}}function $m(t,e){let n;for(n in e)if(Qo.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 Is(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+Pn({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+Pn({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+Pn({start:e.start,end:e.end})+") is still open")}function Ym(t){const e=this;e.parser=n;function n(r){return jm(r,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function qm(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 Vm(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:`
|
|
71
|
+
`}]}function Wm(t,e){const n=e.value?e.value+`
|
|
72
|
+
`:"",r={},i=e.lang?e.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return e.meta&&(a.data={meta:e.meta}),t.patch(e,a),a=t.applyData(e,a),a={type:"element",tagName:"pre",properties:{},children:[a]},t.patch(e,a),a}function Qm(t,e){const n={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Gm(t,e){const n={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Xm(t,e){const n=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",r=String(e.identifier).toUpperCase(),i=mn(r.toLowerCase()),a=t.footnoteOrder.indexOf(r);let s,u=t.footnoteCounts.get(r);u===void 0?(u=0,t.footnoteOrder.push(r),s=t.footnoteOrder.length):s=a+1,u+=1,t.footnoteCounts.set(r,u);const o={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(u>1?"-"+u:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};t.patch(e,o);const l={type:"element",tagName:"sup",properties:{},children:[o]};return t.patch(e,l),t.applyData(e,l)}function Zm(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 Km(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}}function Xo(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),a=i[0];a&&a.type==="text"?a.value="["+a.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function Jm(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return Xo(t,e);const i={src:mn(r.url||""),alt:e.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"img",properties:i,children:[]};return t.patch(e,a),t.applyData(e,a)}function e1(t,e){const n={src:mn(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 t1(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 n1(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return Xo(t,e);const i={href:mn(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"a",properties:i,children:t.all(e)};return t.patch(e,a),t.applyData(e,a)}function r1(t,e){const n={href:mn(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 i1(t,e,n){const r=t.all(e),i=n?a1(n):Zo(e),a={},s=[];if(typeof e.checked=="boolean"){const d=r[0];let f;d&&d.type==="element"&&d.tagName==="p"?f=d:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let u=-1;for(;++u<r.length;){const d=r[u];(i||u!==0||d.type!=="element"||d.tagName!=="p")&&s.push({type:"text",value:`
|
|
73
73
|
`}),d.type==="element"&&d.tagName==="p"&&!i?s.push(...d.children):s.push(d)}const o=r[r.length-1];o&&(i||o.type!=="element"||o.tagName!=="p")&&s.push({type:"text",value:`
|
|
74
|
-
`});const l={type:"element",tagName:"li",properties:a,children:s};return t.patch(e,l),t.applyData(e,l)}function
|
|
74
|
+
`});const l={type:"element",tagName:"li",properties:a,children:s};return t.patch(e,l),t.applyData(e,l)}function a1(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=Zo(n[r])}return e}function Zo(t){const e=t.spread;return e??t.children.length>1}function s1(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 s=r[i];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const a={type:"element",tagName:e.ordered?"ol":"ul",properties:n,children:t.wrap(r,!0)};return t.patch(e,a),t.applyData(e,a)}function u1(t,e){const n={type:"element",tagName:"p",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function o1(t,e){const n={type:"root",children:t.wrap(t.all(e))};return t.patch(e,n),t.applyData(e,n)}function l1(t,e){const n={type:"element",tagName:"strong",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function c1(t,e){const n=t.all(e),r=n.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:t.wrap([r],!0)};t.patch(e.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},u=ht(e.children[1]),o=Br(e.children[e.children.length-1]);u&&o&&(s.position={start:u,end:o}),i.push(s)}const a={type:"element",tagName:"table",properties:{},children:t.wrap(i,!0)};return t.patch(e,a),t.applyData(e,a)}function d1(t,e,n){const r=n?n.children:void 0,a=(r?r.indexOf(e):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,u=s?s.length:e.children.length;let o=-1;const l=[];for(;++o<u;){const f=e.children[o],p={},h=s?s[o]:void 0;h&&(p.align=h);let g={type:"element",tagName:a,properties:p,children:[]};f&&(g.children=t.all(f),t.patch(f,g),g=t.applyData(f,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 f1(t,e){const n={type:"element",tagName:"td",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}const Ss=9,Ns=32;function h1(t){const e=String(t),n=/\r?\n|\r/g;let r=n.exec(e),i=0;const a=[];for(;r;)a.push(ws(e.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(e);return a.push(ws(e.slice(i),i>0,!1)),a.join("")}function ws(t,e,n){let r=0,i=t.length;if(e){let a=t.codePointAt(r);for(;a===Ss||a===Ns;)r++,a=t.codePointAt(r)}if(n){let a=t.codePointAt(i-1);for(;a===Ss||a===Ns;)i--,a=t.codePointAt(i-1)}return i>r?t.slice(r,i):""}function p1(t,e){const n={type:"text",value:h1(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function m1(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const g1={blockquote:qm,break:Vm,code:Wm,delete:Qm,emphasis:Gm,footnoteReference:Xm,heading:Zm,html:Km,imageReference:Jm,image:e1,inlineCode:t1,linkReference:n1,link:r1,listItem:i1,list:s1,paragraph:u1,root:o1,strong:l1,table:c1,tableCell:f1,tableRow:d1,text:p1,thematicBreak:m1,toml:lr,yaml:lr,definition:lr,footnoteDefinition:lr};function lr(){}const Ko=-1,Hr=0,Bn=1,Ir=2,ha=3,pa=4,ma=5,ga=6,Jo=7,el=8,Rs=typeof self=="object"?self:globalThis,E1=(t,e)=>{const n=(i,a)=>(t.set(a,i),i),r=i=>{if(t.has(i))return t.get(i);const[a,s]=e[i];switch(a){case Hr:case Ko:return n(s,i);case Bn:{const u=n([],i);for(const o of s)u.push(r(o));return u}case Ir:{const u=n({},i);for(const[o,l]of s)u[r(o)]=r(l);return u}case ha:return n(new Date(s),i);case pa:{const{source:u,flags:o}=s;return n(new RegExp(u,o),i)}case ma:{const u=n(new Map,i);for(const[o,l]of s)u.set(r(o),r(l));return u}case ga:{const u=n(new Set,i);for(const o of s)u.add(r(o));return u}case Jo:{const{name:u,message:o}=s;return n(new Rs[u](o),i)}case el:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:u}=new Uint8Array(s);return n(new DataView(u),s)}}return n(new Rs[a](s),i)};return r},Os=t=>E1(new Map,t)(0),Jt="",{toString:b1}={},{keys:T1}=Object,In=t=>{const e=typeof t;if(e!=="object"||!t)return[Hr,e];const n=b1.call(t).slice(8,-1);switch(n){case"Array":return[Bn,Jt];case"Object":return[Ir,Jt];case"Date":return[ha,Jt];case"RegExp":return[pa,Jt];case"Map":return[ma,Jt];case"Set":return[ga,Jt];case"DataView":return[Bn,n]}return n.includes("Array")?[Bn,n]:n.includes("Error")?[Jo,n]:[Ir,n]},cr=([t,e])=>t===Hr&&(e==="function"||e==="symbol"),x1=(t,e,n,r)=>{const i=(s,u)=>{const o=r.push(s)-1;return n.set(u,o),o},a=s=>{if(n.has(s))return n.get(s);let[u,o]=In(s);switch(u){case Hr:{let d=s;switch(o){case"bigint":u=el,d=s.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+o);d=null;break;case"undefined":return i([Ko],s)}return i([u,d],s)}case Bn:{if(o){let p=s;return o==="DataView"?p=new Uint8Array(s.buffer):o==="ArrayBuffer"&&(p=new Uint8Array(s)),i([o,[...p]],s)}const d=[],f=i([u,d],s);for(const p of s)d.push(a(p));return f}case Ir:{if(o)switch(o){case"BigInt":return i([o,s.toString()],s);case"Boolean":case"Number":case"String":return i([o,s.valueOf()],s)}if(e&&"toJSON"in s)return a(s.toJSON());const d=[],f=i([u,d],s);for(const p of T1(s))(t||!cr(In(s[p])))&&d.push([a(p),a(s[p])]);return f}case ha:return i([u,s.toISOString()],s);case pa:{const{source:d,flags:f}=s;return i([u,{source:d,flags:f}],s)}case ma:{const d=[],f=i([u,d],s);for(const[p,h]of s)(t||!(cr(In(p))||cr(In(h))))&&d.push([a(p),a(h)]);return f}case ga:{const d=[],f=i([u,d],s);for(const p of s)(t||!cr(In(p)))&&d.push(a(p));return f}}const{message:l}=s;return i([u,{name:o,message:l}],s)};return a},Ls=(t,{json:e,lossy:n}={})=>{const r=[];return x1(!(e||n),!!e,new Map,r)(t),r},ln=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?Os(Ls(t,e)):structuredClone(t):(t,e)=>Os(Ls(t,e));function _1(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 y1(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function A1(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=t.options.footnoteBackContent||_1,r=t.options.footnoteBackLabel||y1,i=t.options.footnoteLabel||"Footnotes",a=t.options.footnoteLabelTagName||"h2",s=t.options.footnoteLabelProperties||{className:["sr-only"]},u=[];let o=-1;for(;++o<t.footnoteOrder.length;){const l=t.footnoteById.get(t.footnoteOrder[o]);if(!l)continue;const d=t.all(l),f=String(l.identifier).toUpperCase(),p=mn(f.toLowerCase());let h=0;const g=[],_=t.footnoteCounts.get(f);for(;_!==void 0&&++h<=_;){g.length>0&&g.push({type:"text",value:" "});let I=typeof n=="string"?n:n(o,h);typeof I=="string"&&(I={type:"text",value:I}),g.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+p+(h>1?"-"+h:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(o,h),className:["data-footnote-backref"]},children:Array.isArray(I)?I:[I]})}const y=d[d.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const I=y.children[y.children.length-1];I&&I.type==="text"?I.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...g)}else d.push(...g);const T={type:"element",tagName:"li",properties:{id:e+"fn-"+p},children:t.wrap(d,!0)};t.patch(l,T),u.push(T)}if(u.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...ln(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
75
75
|
`},{type:"element",tagName:"ol",properties:{},children:t.wrap(u,!0)},{type:"text",value:`
|
|
76
|
-
`}]}}const
|
|
76
|
+
`}]}}const jr=(function(t){if(t==null)return S1;if(typeof t=="function")return zr(t);if(typeof t=="object")return Array.isArray(t)?k1(t):C1(t);if(typeof t=="string")return I1(t);throw new Error("Expected function, string, or object as test")});function k1(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=jr(t[n]);return zr(r);function r(...i){let a=-1;for(;++a<e.length;)if(e[a].apply(this,i))return!0;return!1}}function C1(t){const e=t;return zr(n);function n(r){const i=r;let a;for(a in t)if(i[a]!==e[a])return!1;return!0}}function I1(t){return zr(e);function e(n){return n&&n.type===t}}function zr(t){return e;function e(n,r,i){return!!(N1(n)&&t.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function S1(){return!0}function N1(t){return t!==null&&typeof t=="object"&&"type"in t}const tl=[],w1=!0,Di=!1,R1="skip";function nl(t,e,n,r){let i;typeof e=="function"&&typeof n!="function"?(r=n,n=e):i=e;const a=jr(i),s=r?-1:1;u(t,void 0,[])();function u(o,l,d){const f=o&&typeof o=="object"?o:{};if(typeof f.type=="string"){const h=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(o.type+(h?"<"+h+">":""))+")"})}return p;function p(){let h=tl,g,_,y;if((!e||a(o,l,d[d.length-1]||void 0))&&(h=O1(n(o,d)),h[0]===Di))return h;if("children"in o&&o.children){const T=o;if(T.children&&h[0]!==R1)for(_=(r?T.children.length:-1)+s,y=d.concat(T);_>-1&&_<T.children.length;){const I=T.children[_];if(g=u(I,_,y)(),g[0]===Di)return g;_=typeof g[1]=="number"?g[1]:_+s}}return h}}}function O1(t){return Array.isArray(t)?t:typeof t=="number"?[w1,t]:t==null?tl:[t]}function $r(t,e,n,r){let i,a,s;typeof e=="function"&&typeof n!="function"?(a=void 0,s=e,i=n):(a=e,s=n,i=r),nl(t,a,u,i);function u(o,l){const d=l[l.length-1],f=d?d.children.indexOf(o):void 0;return s(o,f,d)}}const vi={}.hasOwnProperty,L1={};function D1(t,e){const n=e||L1,r=new Map,i=new Map,a=new Map,s={...g1,...n.handlers},u={all:l,applyData:P1,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:s,one:o,options:n,patch:v1,wrap:B1};return $r(t,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const f=d.type==="definition"?r:i,p=String(d.identifier).toUpperCase();f.has(p)||f.set(p,d)}}),u;function o(d,f){const p=d.type,h=u.handlers[p];if(vi.call(u.handlers,p)&&h)return h(u,d,f);if(u.options.passThrough&&u.options.passThrough.includes(p)){if("children"in d){const{children:_,...y}=d,T=ln(y);return T.children=u.all(d),T}return ln(d)}return(u.options.unknownHandler||M1)(u,d,f)}function l(d){const f=[];if("children"in d){const p=d.children;let h=-1;for(;++h<p.length;){const g=u.one(p[h],d);if(g){if(h&&p[h-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=Ds(g.value)),!Array.isArray(g)&&g.type==="element")){const _=g.children[0];_&&_.type==="text"&&(_.value=Ds(_.value))}Array.isArray(g)?f.push(...g):f.push(g)}}}return f}}function v1(t,e){t.position&&(e.position=y0(t))}function P1(t,e){let n=e;if(t&&t.data){const r=t.data.hName,i=t.data.hChildren,a=t.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&a&&Object.assign(n.properties,ln(a)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function M1(t,e){const n=e.data||{},r="value"in e&&!(vi.call(n,"hProperties")||vi.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 B1(t,e){const n=[];let r=-1;for(e&&n.push({type:"text",value:`
|
|
77
77
|
`});++r<t.length;)r&&n.push({type:"text",value:`
|
|
78
78
|
`}),n.push(t[r]);return e&&t.length>0&&n.push({type:"text",value:`
|
|
79
|
-
`}),n}function
|
|
80
|
-
`},i),a}function B1(t,e){return t&&"run"in t?async function(n,r){const i=Os(n,{file:r,...e});await t.run(i,r)}:function(n,r){return Os(n,{file:r,...t||e})}}function Ls(t){if(t)throw t}var Zr,Ds;function F1(){if(Ds)return Zr;Ds=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]"},a=function(l){if(!l||e.call(l)!=="[object Object]")return!1;var d=t.call(l,"constructor"),f=l.constructor&&l.constructor.prototype&&t.call(l.constructor.prototype,"isPrototypeOf");if(l.constructor&&!d&&!f)return!1;var p;for(p in l);return typeof p>"u"||t.call(l,p)},s=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},u=function(l,d){if(d==="__proto__")if(t.call(l,d)){if(r)return r(l,d).value}else return;return l[d]};return Zr=function o(){var l,d,f,p,h,g,_=arguments[0],y=1,T=arguments.length,S=!1;for(typeof _=="boolean"&&(S=_,_=arguments[1]||{},y=2),(_==null||typeof _!="object"&&typeof _!="function")&&(_={});y<T;++y)if(l=arguments[y],l!=null)for(d in l)f=u(_,d),p=u(l,d),_!==p&&(S&&p&&(a(p)||(h=i(p)))?(h?(h=!1,g=f&&i(f)?f:[]):g=f&&a(f)?f:{},s(_,{name:d,newValue:o(S,g,p)})):typeof p<"u"&&s(_,{name:d,newValue:p}));return _},Zr}var U1=F1();const Kr=Ui(U1);function wi(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 H1(){const t=[],e={run:n,use:r};return e;function n(...i){let a=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);u(null,...i);function u(o,...l){const d=t[++a];let f=-1;if(o){s(o);return}for(;++f<i.length;)(l[f]===null||l[f]===void 0)&&(l[f]=i[f]);i=l,d?j1(d,u)(...l):s(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 j1(t,e){let n;return r;function r(...s){const u=t.length>s.length;let o;u&&s.push(i);try{o=t.apply(this,s)}catch(l){const d=l;if(u&&n)throw d;return i(d)}u||(o&&o.then&&typeof o.then=="function"?o.then(a,i):o instanceof Error?i(o):a(o))}function i(s,...u){n||(n=!0,e(s,...u))}function a(s){i(null,s)}}const ot={basename:z1,dirname:$1,extname:Y1,join:q1,sep:"/"};function z1(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');Kn(t);let n=0,r=-1,i=t.length,a;if(e===void 0||e.length===0||e.length>t.length){for(;i--;)if(t.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?"":t.slice(n,r)}if(e===t)return"";let s=-1,u=e.length-1;for(;i--;)if(t.codePointAt(i)===47){if(a){n=i+1;break}}else s<0&&(a=!0,s=i+1),u>-1&&(t.codePointAt(i)===e.codePointAt(u--)?u<0&&(r=i):(u=-1,r=s));return n===r?r=s:r<0&&(r=t.length),t.slice(n,r)}function $1(t){if(Kn(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 Y1(t){Kn(t);let e=t.length,n=-1,r=0,i=-1,a=0,s;for(;e--;){const u=t.codePointAt(e);if(u===47){if(s){r=e+1;break}continue}n<0&&(s=!0,n=e+1),u===46?i<0?i=e:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?"":t.slice(i,n)}function q1(...t){let e=-1,n;for(;++e<t.length;)Kn(t[e]),t[e]&&(n=n===void 0?t[e]:n+"/"+t[e]);return n===void 0?".":V1(n)}function V1(t){Kn(t);const e=t.codePointAt(0)===47;let n=W1(t,!e);return n.length===0&&!e&&(n="."),n.length>0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function W1(t,e){let n="",r=0,i=-1,a=0,s=-1,u,o;for(;++s<=t.length;){if(s<t.length)u=t.codePointAt(s);else{if(u===47)break;u=47}if(u===47){if(!(i===s-1||a===1))if(i!==s-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(o=n.lastIndexOf("/"),o!==n.length-1){o<0?(n="",r=0):(n=n.slice(0,o),r=n.length-1-n.lastIndexOf("/")),i=s,a=0;continue}}else if(n.length>0){n="",r=0,i=s,a=0;continue}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(i+1,s):n=t.slice(i+1,s),r=s-i-1;i=s,a=0}else u===46&&a>-1?a++:a=-1}return n}function Kn(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const Q1={cwd:G1};function G1(){return"/"}function Ri(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function X1(t){if(typeof t=="string")t=new URL(t);else if(!Ri(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 Z1(t)}function Z1(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 Jr=["history","path","basename","stem","extname","dirname"];class tl{constructor(e){let n;e?Ri(e)?n={path:e}:typeof e=="string"||K1(e)?n={value:e}:n=e:n={},this.cwd="cwd"in n?"":Q1.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Jr.length;){const a=Jr[r];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let i;for(i in n)Jr.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?ot.basename(this.path):void 0}set basename(e){ti(e,"basename"),ei(e,"basename"),this.path=ot.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?ot.dirname(this.path):void 0}set dirname(e){vs(this.basename,"dirname"),this.path=ot.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?ot.extname(this.path):void 0}set extname(e){if(ei(e,"extname"),vs(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=ot.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){Ri(e)&&(e=X1(e)),ti(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?ot.basename(this.path,this.extname):void 0}set stem(e){ti(e,"stem"),ei(e,"stem"),this.path=ot.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 ve(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 ei(t,e){if(t&&t.includes(ot.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+ot.sep+"`")}function ti(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function vs(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}function K1(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const J1=(function(t){const r=this.constructor.prototype,i=r[t],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),eg={}.hasOwnProperty;class ca extends J1{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=H1()}copy(){const e=new ca;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];e.use(...r)}return e.data(Kr(!0,{},this.namespace)),e}data(e,n){return typeof e=="string"?arguments.length===2?(ii("data",this.frozen),this.namespace[e]=n,this):eg.call(this.namespace,e)&&this.namespace[e]||void 0:e?(ii("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=ar(e),r=this.parser||this.Parser;return ni("parse",r),r(String(n),n)}process(e,n){const r=this;return this.freeze(),ni("process",this.parser||this.Parser),ri("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(a,s){const u=ar(e),o=r.parse(u);r.run(o,u,function(d,f,p){if(d||!f||!p)return l(d);const h=f,g=r.stringify(h,p);rg(g)?p.value=g:p.result=g,l(d,p)});function l(d,f){d||!f?s(d):a?a(f):n(void 0,f)}}}processSync(e){let n=!1,r;return this.freeze(),ni("processSync",this.parser||this.Parser),ri("processSync",this.compiler||this.Compiler),this.process(e,i),Ms("processSync","process",n),r;function i(a,s){n=!0,Ls(a),r=s}}run(e,n,r){Ps(e),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(s,u){const o=ar(n);i.run(e,o,l);function l(d,f,p){const h=f||e;d?u(d):s?s(h):r(void 0,h,p)}}}runSync(e,n){let r=!1,i;return this.run(e,n,a),Ms("runSync","run",r),i;function a(s,u){Ls(s),i=u,r=!0}}stringify(e,n){this.freeze();const r=ar(n),i=this.compiler||this.Compiler;return ri("stringify",i),Ps(e),i(e,r)}use(e,...n){const r=this.attachers,i=this.namespace;if(ii("use",this.frozen),e!=null)if(typeof e=="function")o(e,n);else if(typeof e=="object")Array.isArray(e)?u(e):s(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function a(l){if(typeof l=="function")o(l,[]);else if(typeof l=="object")if(Array.isArray(l)){const[d,...f]=l;o(d,f)}else s(l);else throw new TypeError("Expected usable value, not `"+l+"`")}function s(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");u(l.plugins),l.settings&&(i.settings=Kr(!0,i.settings,l.settings))}function u(l){let d=-1;if(l!=null)if(Array.isArray(l))for(;++d<l.length;){const f=l[d];a(f)}else throw new TypeError("Expected a list of plugins, not `"+l+"`")}function o(l,d){let f=-1,p=-1;for(;++f<r.length;)if(r[f][0]===l){p=f;break}if(p===-1)r.push([l,...d]);else if(d.length>0){let[h,...g]=d;const _=r[p][1];wi(_)&&wi(h)&&(h=Kr(!0,_,h)),r[p]=[l,h,...g]}}}}const tg=new ca().freeze();function ni(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function ri(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function ii(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 Ps(t){if(!wi(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function Ms(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function ar(t){return ng(t)?t:new tl(t)}function ng(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function rg(t){return typeof t=="string"||ig(t)}function ig(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const ag="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Bs=[],Fs={allowDangerousHtml:!0},sg=/^(https?|ircs?|mailto|xmpp)$/i,ug=[{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 og(t){const e=lg(t),n=cg(t);return dg(e.runSync(e.parse(n),n),t)}function lg(t){const e=t.rehypePlugins||Bs,n=t.remarkPlugins||Bs,r=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...Fs}:Fs;return tg().use($m).use(n).use(B1,r).use(e)}function cg(t){const e=t.children||"",n=new tl;return typeof e=="string"&&(n.value=e),n}function dg(t,e){const n=e.allowedElements,r=e.allowElement,i=e.components,a=e.disallowedElements,s=e.skipHtml,u=e.unwrapDisallowed,o=e.urlTransform||fg;for(const d of ug)Object.hasOwn(e,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+ag+d.id,void 0);return e.className&&(t={type:"element",tagName:"div",properties:{className:e.className},children:t.type==="root"?t.children:[t]}),Br(t,l),I0(t,{Fragment:m.Fragment,components:i,ignoreInvalidStyle:!0,jsx:m.jsx,jsxs:m.jsxs,passKeys:!0,passNode:!0});function l(d,f,p){if(d.type==="raw"&&p&&typeof f=="number")return s?p.children.splice(f,1):p.children[f]={type:"text",value:d.value},f;if(d.type==="element"){let h;for(h in Qr)if(Object.hasOwn(Qr,h)&&Object.hasOwn(d.properties,h)){const g=d.properties[h],_=Qr[h];(_===null||_.includes(d.tagName))&&(d.properties[h]=o(String(g||""),h,d))}}if(d.type==="element"){let h=n?!n.includes(d.tagName):a?a.includes(d.tagName):!1;if(!h&&r&&typeof f=="number"&&(h=!r(d,f,p)),h&&p&&typeof f=="number")return u&&d.children?p.children.splice(f,1,...d.children):p.children.splice(f,1),f}}}function fg(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||sg.test(t.slice(0,e))?t:""}const Us=/[#.]/g;function hg(t,e){const n=t||"",r={};let i=0,a,s;for(;i<n.length;){Us.lastIndex=i;const u=Us.exec(n),o=n.slice(i,u?u.index:n.length);o&&(a?a==="#"?r.id=o:Array.isArray(r.className)?r.className.push(o):r.className=[o]:s=o,i+=o.length),u&&(a=u[0],i++)}return{type:"element",tagName:s||e||"div",properties:r,children:[]}}function nl(t,e,n){const r=n?Eg(n):void 0;function i(a,s,...u){let o;if(a==null){o={type:"root",children:[]};const l=s;u.unshift(l)}else{o=hg(a,e);const l=o.tagName.toLowerCase(),d=r?r.get(l):void 0;if(o.tagName=d||l,pg(s))u.unshift(s);else for(const[f,p]of Object.entries(s))mg(t,o.properties,f,p)}for(const l of u)Oi(o.children,l);return o.type==="element"&&o.tagName==="template"&&(o.content={type:"root",children:o.children},o.children=[]),o}return i}function pg(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 a=i;for(const s of a)if(typeof s!="number"&&typeof s!="string")return!0}}return!!("children"in t&&Array.isArray(t.children))}function mg(t,e,n,r){const i=Rr(t,n);let a;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;a=r}else typeof r=="boolean"?a=r:typeof r=="string"?i.spaceSeparated?a=ss(r):i.commaSeparated?a=ts(r):i.commaOrSpaceSeparated?a=ss(ts(r).join(" ")):a=Hs(i,i.property,r):Array.isArray(r)?a=[...r]:a=i.property==="style"?gg(r):String(r);if(Array.isArray(a)){const s=[];for(const u of a)s.push(Hs(i,i.property,u));a=s}i.property==="className"&&Array.isArray(e.className)&&(a=e.className.concat(a)),e[i.property]=a}}function Oi(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)Oi(t,n);else if(typeof e=="object"&&"type"in e)e.type==="root"?Oi(t,e.children):t.push(e);else throw new Error("Expected node, nodes, or string, got `"+e+"`")}function Hs(t,e,n){if(typeof n=="string"){if(t.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((t.boolean||t.overloadedBoolean)&&(n===""||jn(n)===jn(e)))return!0}return n}function gg(t){const e=[];for(const[n,r]of Object.entries(t))e.push([n,r].join(": "));return e.join("; ")}function Eg(t){const e=new Map;for(const n of t)e.set(n.toLowerCase(),n);return e}const bg=["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"],Tg=nl(Xn,"div"),xg=nl(Nt,"g",bg);function _g(t){const e=String(t),n=[];return{toOffset:i,toPoint:r};function r(a){if(typeof a=="number"&&a>-1&&a<=e.length){let s=0;for(;;){let u=n[s];if(u===void 0){const o=js(e,n[s-1]);u=o===-1?e.length+1:o+1,n[s]=u}if(u>a)return{line:s+1,column:a-(s>0?n[s-1]:0)+1,offset:a};s++}}}function i(a){if(a&&typeof a.line=="number"&&typeof a.column=="number"&&!Number.isNaN(a.line)&&!Number.isNaN(a.column)){for(;n.length<a.line;){const u=n[n.length-1],o=js(e,u),l=o===-1?e.length+1:o+1;if(u===l)break;n.push(l)}const s=(a.line>1?n[a.line-2]:0)+a.column-1;if(s<n[a.line-1])return s}}}function js(t,e){const n=t.indexOf("\r",e),r=t.indexOf(`
|
|
81
|
-
`,e);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const Pt={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/"},rl={}.hasOwnProperty,yg=Object.prototype;function Ag(t,e){const n=e||{};return da({file:n.file||void 0,location:!1,schema:n.space==="svg"?Nt:Xn,verbose:n.verbose||!1},t)}function da(t,e){let n;switch(e.nodeName){case"#comment":{const r=e;return n={type:"comment",value:r.data},fr(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:il(t,e.childNodes),data:{quirksMode:i}},t.file&&t.location){const a=String(t.file),s=_g(a),u=s.toPoint(0),o=s.toPoint(a.length);n.position={start:u,end:o}}return n}case"#documentType":{const r=e;return n={type:"doctype"},fr(t,r,n),n}case"#text":{const r=e;return n={type:"text",value:r.value},fr(t,r,n),n}default:return n=kg(t,e),n}}function il(t,e){let n=-1;const r=[];for(;++n<e.length;){const i=da(t,e[n]);r.push(i)}return r}function kg(t,e){const n=t.schema;t.schema=e.namespaceURI===Pt.svg?Nt:Xn;let r=-1;const i={};for(;++r<e.attrs.length;){const u=e.attrs[r],o=(u.prefix?u.prefix+":":"")+u.name;rl.call(yg,o)||(i[o]=u.value)}const s=(t.schema.space==="svg"?xg:Tg)(e.tagName,i,il(t,e.childNodes));if(fr(t,e,s),s.tagName==="template"){const u=e,o=u.sourceCodeLocation,l=o&&o.startTag&&Zt(o.startTag),d=o&&o.endTag&&Zt(o.endTag),f=da(t,u.content);l&&d&&t.file&&(f.position={start:l.end,end:d.start}),s.content=f}return t.schema=n,s}function fr(t,e,n){if("sourceCodeLocation"in e&&e.sourceCodeLocation&&t.file){const r=Cg(t,n,e.sourceCodeLocation);r&&(t.location=!0,n.position=r)}}function Cg(t,e,n){const r=Zt(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 a={};let s;if(n.attrs)for(s in n.attrs)rl.call(n.attrs,s)&&(a[Rr(t.schema,s).property]=Zt(n.attrs[s]));n.startTag;const u=Zt(n.startTag),o=n.endTag?Zt(n.endTag):void 0,l={opening:u};o&&(l.closing=o),l.properties=a,e.data={position:l}}}return r}function Zt(t){const e=zs({line:t.startLine,column:t.startCol,offset:t.startOffset}),n=zs({line:t.endLine,column:t.endCol,offset:t.endOffset});return e||n?{start:e,end:n}:void 0}function zs(t){return t.line&&t.column?t:void 0}const $s={}.hasOwnProperty;function al(t,e){const n=e||{};function r(i,...a){let s=r.invalid;const u=r.handlers;if(i&&$s.call(i,t)){const o=String(i[t]);s=$s.call(u,o)?u[o]:r.unknown}if(s)return s.call(this,i,...a)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const Ig={},Sg={}.hasOwnProperty,sl=al("type",{handlers:{root:wg,element:vg,text:Lg,comment:Dg,doctype:Og}});function Ng(t,e){const r=(e||Ig).space;return sl(t,r==="svg"?Nt:Xn)}function wg(t,e){const n={nodeName:"#document",mode:(t.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=fa(t.children,n,e),cn(t,n),n}function Rg(t,e){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=fa(t.children,n,e),cn(t,n),n}function Og(t){const e={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return cn(t,e),e}function Lg(t){const e={nodeName:"#text",value:t.value,parentNode:null};return cn(t,e),e}function Dg(t){const e={nodeName:"#comment",data:t.value,parentNode:null};return cn(t,e),e}function vg(t,e){const n=e;let r=n;t.type==="element"&&t.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=Nt);const i=[];let a;if(t.properties){for(a in t.properties)if(a!=="children"&&Sg.call(t.properties,a)){const o=Pg(r,a,t.properties[a]);o&&i.push(o)}}const s=r.space,u={nodeName:t.tagName,tagName:t.tagName,attrs:i,namespaceURI:Pt[s],childNodes:[],parentNode:null};return u.childNodes=fa(t.children,u,r),cn(t,u),t.tagName==="template"&&t.content&&(u.content=Rg(t.content,r)),u}function Pg(t,e,n){const r=Rr(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?xo(n):No(n));const i={name:r.attribute,value:n===!0?"":String(n)};if(r.space&&r.space!=="html"&&r.space!=="svg"){const a=i.name.indexOf(":");a<0?i.prefix="":(i.name=i.name.slice(a+1),i.prefix=r.attribute.slice(0,a)),i.namespace=Pt[r.space]}return i}function fa(t,e,n){let r=-1;const i=[];if(t)for(;++r<t.length;){const a=sl(t[r],n);a.parentNode=e,i.push(a)}return i}function cn(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 Mg=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],Bg=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]),ke="�";var b;(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"})(b||(b={}));const je={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function ul(t){return t>=55296&&t<=57343}function Fg(t){return t>=56320&&t<=57343}function Ug(t,e){return(t-55296)*1024+9216+e}function ol(t){return t!==32&&t!==10&&t!==13&&t!==9&&t!==12&&t>=1&&t<=31||t>=127&&t<=159}function ll(t){return t>=64976&&t<=65007||Bg.has(t)}var L;(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"})(L||(L={}));const Hg=65536;class jg{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=Hg,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:a}=this,s=i+n,u=a+n;return{code:e,startLine:r,endLine:r,startCol:s,endCol:s,startOffset:u,endOffset:u}}_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(Fg(n))return this.pos++,this._addGap(),Ug(e,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,b.EOF;return this._err(L.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,b.EOF;const r=this.html.charCodeAt(n);return r===b.CARRIAGE_RETURN?b.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,b.EOF;let e=this.html.charCodeAt(this.pos);return e===b.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,b.LINE_FEED):e===b.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,ul(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===b.LINE_FEED||e===b.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){ol(e)?this._err(L.controlCharacterInInputStream):ll(e)&&this._err(L.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var re;(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"})(re||(re={}));function cl(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 zg=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))),$g=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 Yg(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=$g.get(t))!==null&&e!==void 0?e:t}var we;(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"})(we||(we={}));const qg=32;var kt;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(kt||(kt={}));function Li(t){return t>=we.ZERO&&t<=we.NINE}function Vg(t){return t>=we.UPPER_A&&t<=we.UPPER_F||t>=we.LOWER_A&&t<=we.LOWER_F}function Wg(t){return t>=we.UPPER_A&&t<=we.UPPER_Z||t>=we.LOWER_A&&t<=we.LOWER_Z||Li(t)}function Qg(t){return t===we.EQUALS||Wg(t)}var Ne;(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"})(Ne||(Ne={}));var pt;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(pt||(pt={}));class Gg{constructor(e,n,r){this.decodeTree=e,this.emitCodePoint=n,this.errors=r,this.state=Ne.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=pt.Strict}startEntity(e){this.decodeMode=e,this.state=Ne.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,n){switch(this.state){case Ne.EntityStart:return e.charCodeAt(n)===we.NUM?(this.state=Ne.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=Ne.NamedEntity,this.stateNamedEntity(e,n));case Ne.NumericStart:return this.stateNumericStart(e,n);case Ne.NumericDecimal:return this.stateNumericDecimal(e,n);case Ne.NumericHex:return this.stateNumericHex(e,n);case Ne.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|qg)===we.LOWER_X?(this.state=Ne.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=Ne.NumericDecimal,this.stateNumericDecimal(e,n))}addToNumericResult(e,n,r,i){if(n!==r){const a=r-n;this.result=this.result*Math.pow(i,a)+Number.parseInt(e.substr(n,a),i),this.consumed+=a}}stateNumericHex(e,n){const r=n;for(;n<e.length;){const i=e.charCodeAt(n);if(Li(i)||Vg(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(Li(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===we.SEMI)this.consumed+=1;else if(this.decodeMode===pt.Strict)return 0;return this.emitCodePoint(Yg(this.result),this.consumed),this.errors&&(e!==we.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,n){const{decodeTree:r}=this;let i=r[this.treeIndex],a=(i&kt.VALUE_LENGTH)>>14;for(;n<e.length;n++,this.excess++){const s=e.charCodeAt(n);if(this.treeIndex=Xg(r,i,this.treeIndex+Math.max(1,a),s),this.treeIndex<0)return this.result===0||this.decodeMode===pt.Attribute&&(a===0||Qg(s))?0:this.emitNotTerminatedNamedEntity();if(i=r[this.treeIndex],a=(i&kt.VALUE_LENGTH)>>14,a!==0){if(s===we.SEMI)return this.emitNamedEntityData(this.treeIndex,a,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]&kt.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]&~kt.VALUE_LENGTH:i[e+1],r),n===3&&this.emitCodePoint(i[e+2],r),r}end(){var e;switch(this.state){case Ne.NamedEntity:return this.result!==0&&(this.decodeMode!==pt.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Ne.NumericDecimal:return this.emitNumericEntity(0,2);case Ne.NumericHex:return this.emitNumericEntity(0,3);case Ne.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Ne.EntityStart:return 0}}}function Xg(t,e,n,r){const i=(e&kt.BRANCH_LENGTH)>>7,a=e&kt.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){const o=r-a;return o<0||o>=i?-1:t[n+o]-1}let s=n,u=s+i-1;for(;s<=u;){const o=s+u>>>1,l=t[o];if(l<r)s=o+1;else if(l>r)u=o-1;else return t[o+i]}return-1}var M;(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/"})(M||(M={}));var Mt;(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"})(Mt||(Mt={}));var et;(function(t){t.NO_QUIRKS="no-quirks",t.QUIRKS="quirks",t.LIMITED_QUIRKS="limited-quirks"})(et||(et={}));var w;(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"})(w||(w={}));var c;(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"})(c||(c={}));const Zg=new Map([[w.A,c.A],[w.ADDRESS,c.ADDRESS],[w.ANNOTATION_XML,c.ANNOTATION_XML],[w.APPLET,c.APPLET],[w.AREA,c.AREA],[w.ARTICLE,c.ARTICLE],[w.ASIDE,c.ASIDE],[w.B,c.B],[w.BASE,c.BASE],[w.BASEFONT,c.BASEFONT],[w.BGSOUND,c.BGSOUND],[w.BIG,c.BIG],[w.BLOCKQUOTE,c.BLOCKQUOTE],[w.BODY,c.BODY],[w.BR,c.BR],[w.BUTTON,c.BUTTON],[w.CAPTION,c.CAPTION],[w.CENTER,c.CENTER],[w.CODE,c.CODE],[w.COL,c.COL],[w.COLGROUP,c.COLGROUP],[w.DD,c.DD],[w.DESC,c.DESC],[w.DETAILS,c.DETAILS],[w.DIALOG,c.DIALOG],[w.DIR,c.DIR],[w.DIV,c.DIV],[w.DL,c.DL],[w.DT,c.DT],[w.EM,c.EM],[w.EMBED,c.EMBED],[w.FIELDSET,c.FIELDSET],[w.FIGCAPTION,c.FIGCAPTION],[w.FIGURE,c.FIGURE],[w.FONT,c.FONT],[w.FOOTER,c.FOOTER],[w.FOREIGN_OBJECT,c.FOREIGN_OBJECT],[w.FORM,c.FORM],[w.FRAME,c.FRAME],[w.FRAMESET,c.FRAMESET],[w.H1,c.H1],[w.H2,c.H2],[w.H3,c.H3],[w.H4,c.H4],[w.H5,c.H5],[w.H6,c.H6],[w.HEAD,c.HEAD],[w.HEADER,c.HEADER],[w.HGROUP,c.HGROUP],[w.HR,c.HR],[w.HTML,c.HTML],[w.I,c.I],[w.IMG,c.IMG],[w.IMAGE,c.IMAGE],[w.INPUT,c.INPUT],[w.IFRAME,c.IFRAME],[w.KEYGEN,c.KEYGEN],[w.LABEL,c.LABEL],[w.LI,c.LI],[w.LINK,c.LINK],[w.LISTING,c.LISTING],[w.MAIN,c.MAIN],[w.MALIGNMARK,c.MALIGNMARK],[w.MARQUEE,c.MARQUEE],[w.MATH,c.MATH],[w.MENU,c.MENU],[w.META,c.META],[w.MGLYPH,c.MGLYPH],[w.MI,c.MI],[w.MO,c.MO],[w.MN,c.MN],[w.MS,c.MS],[w.MTEXT,c.MTEXT],[w.NAV,c.NAV],[w.NOBR,c.NOBR],[w.NOFRAMES,c.NOFRAMES],[w.NOEMBED,c.NOEMBED],[w.NOSCRIPT,c.NOSCRIPT],[w.OBJECT,c.OBJECT],[w.OL,c.OL],[w.OPTGROUP,c.OPTGROUP],[w.OPTION,c.OPTION],[w.P,c.P],[w.PARAM,c.PARAM],[w.PLAINTEXT,c.PLAINTEXT],[w.PRE,c.PRE],[w.RB,c.RB],[w.RP,c.RP],[w.RT,c.RT],[w.RTC,c.RTC],[w.RUBY,c.RUBY],[w.S,c.S],[w.SCRIPT,c.SCRIPT],[w.SEARCH,c.SEARCH],[w.SECTION,c.SECTION],[w.SELECT,c.SELECT],[w.SOURCE,c.SOURCE],[w.SMALL,c.SMALL],[w.SPAN,c.SPAN],[w.STRIKE,c.STRIKE],[w.STRONG,c.STRONG],[w.STYLE,c.STYLE],[w.SUB,c.SUB],[w.SUMMARY,c.SUMMARY],[w.SUP,c.SUP],[w.TABLE,c.TABLE],[w.TBODY,c.TBODY],[w.TEMPLATE,c.TEMPLATE],[w.TEXTAREA,c.TEXTAREA],[w.TFOOT,c.TFOOT],[w.TD,c.TD],[w.TH,c.TH],[w.THEAD,c.THEAD],[w.TITLE,c.TITLE],[w.TR,c.TR],[w.TRACK,c.TRACK],[w.TT,c.TT],[w.U,c.U],[w.UL,c.UL],[w.SVG,c.SVG],[w.VAR,c.VAR],[w.WBR,c.WBR],[w.XMP,c.XMP]]);function dn(t){var e;return(e=Zg.get(t))!==null&&e!==void 0?e:c.UNKNOWN}const U=c,Kg={[M.HTML]:new Set([U.ADDRESS,U.APPLET,U.AREA,U.ARTICLE,U.ASIDE,U.BASE,U.BASEFONT,U.BGSOUND,U.BLOCKQUOTE,U.BODY,U.BR,U.BUTTON,U.CAPTION,U.CENTER,U.COL,U.COLGROUP,U.DD,U.DETAILS,U.DIR,U.DIV,U.DL,U.DT,U.EMBED,U.FIELDSET,U.FIGCAPTION,U.FIGURE,U.FOOTER,U.FORM,U.FRAME,U.FRAMESET,U.H1,U.H2,U.H3,U.H4,U.H5,U.H6,U.HEAD,U.HEADER,U.HGROUP,U.HR,U.HTML,U.IFRAME,U.IMG,U.INPUT,U.LI,U.LINK,U.LISTING,U.MAIN,U.MARQUEE,U.MENU,U.META,U.NAV,U.NOEMBED,U.NOFRAMES,U.NOSCRIPT,U.OBJECT,U.OL,U.P,U.PARAM,U.PLAINTEXT,U.PRE,U.SCRIPT,U.SECTION,U.SELECT,U.SOURCE,U.STYLE,U.SUMMARY,U.TABLE,U.TBODY,U.TD,U.TEMPLATE,U.TEXTAREA,U.TFOOT,U.TH,U.THEAD,U.TITLE,U.TR,U.TRACK,U.UL,U.WBR,U.XMP]),[M.MATHML]:new Set([U.MI,U.MO,U.MN,U.MS,U.MTEXT,U.ANNOTATION_XML]),[M.SVG]:new Set([U.TITLE,U.FOREIGN_OBJECT,U.DESC]),[M.XLINK]:new Set,[M.XML]:new Set,[M.XMLNS]:new Set},Di=new Set([U.H1,U.H2,U.H3,U.H4,U.H5,U.H6]);w.STYLE,w.SCRIPT,w.XMP,w.IFRAME,w.NOEMBED,w.NOFRAMES,w.PLAINTEXT;var x;(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"})(x||(x={}));const Ce={DATA:x.DATA,RCDATA:x.RCDATA,RAWTEXT:x.RAWTEXT,SCRIPT_DATA:x.SCRIPT_DATA,PLAINTEXT:x.PLAINTEXT,CDATA_SECTION:x.CDATA_SECTION};function Jg(t){return t>=b.DIGIT_0&&t<=b.DIGIT_9}function In(t){return t>=b.LATIN_CAPITAL_A&&t<=b.LATIN_CAPITAL_Z}function eE(t){return t>=b.LATIN_SMALL_A&&t<=b.LATIN_SMALL_Z}function _t(t){return eE(t)||In(t)}function Ys(t){return _t(t)||Jg(t)}function sr(t){return t+32}function dl(t){return t===b.SPACE||t===b.LINE_FEED||t===b.TABULATION||t===b.FORM_FEED}function qs(t){return dl(t)||t===b.SOLIDUS||t===b.GREATER_THAN_SIGN}function tE(t){return t===b.NULL?L.nullCharacterReference:t>1114111?L.characterReferenceOutsideUnicodeRange:ul(t)?L.surrogateCharacterReference:ll(t)?L.noncharacterCharacterReference:ol(t)||t===b.CARRIAGE_RETURN?L.controlCharacterReference:null}class nE{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=x.DATA,this.returnState=x.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new jg(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new Gg(zg,(r,i)=>{this.preprocessor.pos=this.entityStartPos+i-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(L.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(L.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const i=tE(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:re.START_TAG,tagName:"",tagID:c.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:re.END_TAG,tagName:"",tagID:c.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:re.COMMENT,data:"",location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:re.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(cl(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(L.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=dn(e.tagName),e.type===re.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(L.endTagWithAttributes),e.selfClosing&&this._err(L.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 re.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case re.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case re.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:re.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=dl(e)?re.WHITESPACE_CHARACTER:e===b.NULL?re.NULL_CHARACTER:re.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(re.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=x.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?pt.Attribute:pt.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===x.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===x.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===x.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case x.DATA:{this._stateData(e);break}case x.RCDATA:{this._stateRcdata(e);break}case x.RAWTEXT:{this._stateRawtext(e);break}case x.SCRIPT_DATA:{this._stateScriptData(e);break}case x.PLAINTEXT:{this._statePlaintext(e);break}case x.TAG_OPEN:{this._stateTagOpen(e);break}case x.END_TAG_OPEN:{this._stateEndTagOpen(e);break}case x.TAG_NAME:{this._stateTagName(e);break}case x.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(e);break}case x.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(e);break}case x.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(e);break}case x.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(e);break}case x.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(e);break}case x.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(e);break}case x.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(e);break}case x.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(e);break}case x.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(e);break}case x.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(e);break}case x.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(e);break}case x.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(e);break}case x.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(e);break}case x.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(e);break}case x.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(e);break}case x.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(e);break}case x.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(e);break}case x.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(e);break}case x.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(e);break}case x.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(e);break}case x.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(e);break}case x.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(e);break}case x.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(e);break}case x.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(e);break}case x.ATTRIBUTE_NAME:{this._stateAttributeName(e);break}case x.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(e);break}case x.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(e);break}case x.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(e);break}case x.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(e);break}case x.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(e);break}case x.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(e);break}case x.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(e);break}case x.BOGUS_COMMENT:{this._stateBogusComment(e);break}case x.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(e);break}case x.COMMENT_START:{this._stateCommentStart(e);break}case x.COMMENT_START_DASH:{this._stateCommentStartDash(e);break}case x.COMMENT:{this._stateComment(e);break}case x.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(e);break}case x.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(e);break}case x.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(e);break}case x.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(e);break}case x.COMMENT_END_DASH:{this._stateCommentEndDash(e);break}case x.COMMENT_END:{this._stateCommentEnd(e);break}case x.COMMENT_END_BANG:{this._stateCommentEndBang(e);break}case x.DOCTYPE:{this._stateDoctype(e);break}case x.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(e);break}case x.DOCTYPE_NAME:{this._stateDoctypeName(e);break}case x.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(e);break}case x.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(e);break}case x.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(e);break}case x.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(e);break}case x.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(e);break}case x.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(e);break}case x.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break}case x.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(e);break}case x.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(e);break}case x.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(e);break}case x.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(e);break}case x.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(e);break}case x.BOGUS_DOCTYPE:{this._stateBogusDoctype(e);break}case x.CDATA_SECTION:{this._stateCdataSection(e);break}case x.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(e);break}case x.CDATA_SECTION_END:{this._stateCdataSectionEnd(e);break}case x.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case x.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(e);break}default:throw new Error("Unknown state")}}_stateData(e){switch(e){case b.LESS_THAN_SIGN:{this.state=x.TAG_OPEN;break}case b.AMPERSAND:{this._startCharacterReference();break}case b.NULL:{this._err(L.unexpectedNullCharacter),this._emitCodePoint(e);break}case b.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case b.AMPERSAND:{this._startCharacterReference();break}case b.LESS_THAN_SIGN:{this.state=x.RCDATA_LESS_THAN_SIGN;break}case b.NULL:{this._err(L.unexpectedNullCharacter),this._emitChars(ke);break}case b.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case b.LESS_THAN_SIGN:{this.state=x.RAWTEXT_LESS_THAN_SIGN;break}case b.NULL:{this._err(L.unexpectedNullCharacter),this._emitChars(ke);break}case b.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case b.LESS_THAN_SIGN:{this.state=x.SCRIPT_DATA_LESS_THAN_SIGN;break}case b.NULL:{this._err(L.unexpectedNullCharacter),this._emitChars(ke);break}case b.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case b.NULL:{this._err(L.unexpectedNullCharacter),this._emitChars(ke);break}case b.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateTagOpen(e){if(_t(e))this._createStartTagToken(),this.state=x.TAG_NAME,this._stateTagName(e);else switch(e){case b.EXCLAMATION_MARK:{this.state=x.MARKUP_DECLARATION_OPEN;break}case b.SOLIDUS:{this.state=x.END_TAG_OPEN;break}case b.QUESTION_MARK:{this._err(L.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=x.BOGUS_COMMENT,this._stateBogusComment(e);break}case b.EOF:{this._err(L.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(L.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=x.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(_t(e))this._createEndTagToken(),this.state=x.TAG_NAME,this._stateTagName(e);else switch(e){case b.GREATER_THAN_SIGN:{this._err(L.missingEndTagName),this.state=x.DATA;break}case b.EOF:{this._err(L.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(L.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=x.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){const n=this.currentToken;switch(e){case b.SPACE:case b.LINE_FEED:case b.TABULATION:case b.FORM_FEED:{this.state=x.BEFORE_ATTRIBUTE_NAME;break}case b.SOLIDUS:{this.state=x.SELF_CLOSING_START_TAG;break}case b.GREATER_THAN_SIGN:{this.state=x.DATA,this.emitCurrentTagToken();break}case b.NULL:{this._err(L.unexpectedNullCharacter),n.tagName+=ke;break}case b.EOF:{this._err(L.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(In(e)?sr(e):e)}}_stateRcdataLessThanSign(e){e===b.SOLIDUS?this.state=x.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=x.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){_t(e)?(this.state=x.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars("</"),this.state=x.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 b.SPACE:case b.LINE_FEED:case b.TABULATION:case b.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=x.BEFORE_ATTRIBUTE_NAME,!1;case b.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=x.SELF_CLOSING_START_TAG,!1;case b.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=x.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=x.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===b.SOLIDUS?this.state=x.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=x.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){_t(e)?(this.state=x.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars("</"),this.state=x.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=x.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case b.SOLIDUS:{this.state=x.SCRIPT_DATA_END_TAG_OPEN;break}case b.EXCLAMATION_MARK:{this.state=x.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=x.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){_t(e)?(this.state=x.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars("</"),this.state=x.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=x.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===b.HYPHEN_MINUS?(this.state=x.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=x.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===b.HYPHEN_MINUS?(this.state=x.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=x.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case b.HYPHEN_MINUS:{this.state=x.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case b.LESS_THAN_SIGN:{this.state=x.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case b.NULL:{this._err(L.unexpectedNullCharacter),this._emitChars(ke);break}case b.EOF:{this._err(L.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case b.HYPHEN_MINUS:{this.state=x.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case b.LESS_THAN_SIGN:{this.state=x.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case b.NULL:{this._err(L.unexpectedNullCharacter),this.state=x.SCRIPT_DATA_ESCAPED,this._emitChars(ke);break}case b.EOF:{this._err(L.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=x.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case b.HYPHEN_MINUS:{this._emitChars("-");break}case b.LESS_THAN_SIGN:{this.state=x.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case b.GREATER_THAN_SIGN:{this.state=x.SCRIPT_DATA,this._emitChars(">");break}case b.NULL:{this._err(L.unexpectedNullCharacter),this.state=x.SCRIPT_DATA_ESCAPED,this._emitChars(ke);break}case b.EOF:{this._err(L.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=x.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===b.SOLIDUS?this.state=x.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:_t(e)?(this._emitChars("<"),this.state=x.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars("<"),this.state=x.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){_t(e)?(this.state=x.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars("</"),this.state=x.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=x.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(je.SCRIPT,!1)&&qs(this.preprocessor.peek(je.SCRIPT.length))){this._emitCodePoint(e);for(let n=0;n<je.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=x.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case b.HYPHEN_MINUS:{this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case b.LESS_THAN_SIGN:{this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case b.NULL:{this._err(L.unexpectedNullCharacter),this._emitChars(ke);break}case b.EOF:{this._err(L.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case b.HYPHEN_MINUS:{this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case b.LESS_THAN_SIGN:{this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case b.NULL:{this._err(L.unexpectedNullCharacter),this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(ke);break}case b.EOF:{this._err(L.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case b.HYPHEN_MINUS:{this._emitChars("-");break}case b.LESS_THAN_SIGN:{this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case b.GREATER_THAN_SIGN:{this.state=x.SCRIPT_DATA,this._emitChars(">");break}case b.NULL:{this._err(L.unexpectedNullCharacter),this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(ke);break}case b.EOF:{this._err(L.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===b.SOLIDUS?(this.state=x.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(je.SCRIPT,!1)&&qs(this.preprocessor.peek(je.SCRIPT.length))){this._emitCodePoint(e);for(let n=0;n<je.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=x.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case b.SPACE:case b.LINE_FEED:case b.TABULATION:case b.FORM_FEED:break;case b.SOLIDUS:case b.GREATER_THAN_SIGN:case b.EOF:{this.state=x.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case b.EQUALS_SIGN:{this._err(L.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=x.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=x.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case b.SPACE:case b.LINE_FEED:case b.TABULATION:case b.FORM_FEED:case b.SOLIDUS:case b.GREATER_THAN_SIGN:case b.EOF:{this._leaveAttrName(),this.state=x.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case b.EQUALS_SIGN:{this._leaveAttrName(),this.state=x.BEFORE_ATTRIBUTE_VALUE;break}case b.QUOTATION_MARK:case b.APOSTROPHE:case b.LESS_THAN_SIGN:{this._err(L.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break}case b.NULL:{this._err(L.unexpectedNullCharacter),this.currentAttr.name+=ke;break}default:this.currentAttr.name+=String.fromCodePoint(In(e)?sr(e):e)}}_stateAfterAttributeName(e){switch(e){case b.SPACE:case b.LINE_FEED:case b.TABULATION:case b.FORM_FEED:break;case b.SOLIDUS:{this.state=x.SELF_CLOSING_START_TAG;break}case b.EQUALS_SIGN:{this.state=x.BEFORE_ATTRIBUTE_VALUE;break}case b.GREATER_THAN_SIGN:{this.state=x.DATA,this.emitCurrentTagToken();break}case b.EOF:{this._err(L.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=x.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case b.SPACE:case b.LINE_FEED:case b.TABULATION:case b.FORM_FEED:break;case b.QUOTATION_MARK:{this.state=x.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case b.APOSTROPHE:{this.state=x.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case b.GREATER_THAN_SIGN:{this._err(L.missingAttributeValue),this.state=x.DATA,this.emitCurrentTagToken();break}default:this.state=x.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case b.QUOTATION_MARK:{this.state=x.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case b.AMPERSAND:{this._startCharacterReference();break}case b.NULL:{this._err(L.unexpectedNullCharacter),this.currentAttr.value+=ke;break}case b.EOF:{this._err(L.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case b.APOSTROPHE:{this.state=x.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case b.AMPERSAND:{this._startCharacterReference();break}case b.NULL:{this._err(L.unexpectedNullCharacter),this.currentAttr.value+=ke;break}case b.EOF:{this._err(L.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case b.SPACE:case b.LINE_FEED:case b.TABULATION:case b.FORM_FEED:{this._leaveAttrValue(),this.state=x.BEFORE_ATTRIBUTE_NAME;break}case b.AMPERSAND:{this._startCharacterReference();break}case b.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=x.DATA,this.emitCurrentTagToken();break}case b.NULL:{this._err(L.unexpectedNullCharacter),this.currentAttr.value+=ke;break}case b.QUOTATION_MARK:case b.APOSTROPHE:case b.LESS_THAN_SIGN:case b.EQUALS_SIGN:case b.GRAVE_ACCENT:{this._err(L.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break}case b.EOF:{this._err(L.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case b.SPACE:case b.LINE_FEED:case b.TABULATION:case b.FORM_FEED:{this._leaveAttrValue(),this.state=x.BEFORE_ATTRIBUTE_NAME;break}case b.SOLIDUS:{this._leaveAttrValue(),this.state=x.SELF_CLOSING_START_TAG;break}case b.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=x.DATA,this.emitCurrentTagToken();break}case b.EOF:{this._err(L.eofInTag),this._emitEOFToken();break}default:this._err(L.missingWhitespaceBetweenAttributes),this.state=x.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case b.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=x.DATA,this.emitCurrentTagToken();break}case b.EOF:{this._err(L.eofInTag),this._emitEOFToken();break}default:this._err(L.unexpectedSolidusInTag),this.state=x.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){const n=this.currentToken;switch(e){case b.GREATER_THAN_SIGN:{this.state=x.DATA,this.emitCurrentComment(n);break}case b.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case b.NULL:{this._err(L.unexpectedNullCharacter),n.data+=ke;break}default:n.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(je.DASH_DASH,!0)?(this._createCommentToken(je.DASH_DASH.length+1),this.state=x.COMMENT_START):this._consumeSequenceIfMatch(je.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(je.DOCTYPE.length+1),this.state=x.DOCTYPE):this._consumeSequenceIfMatch(je.CDATA_START,!0)?this.inForeignNode?this.state=x.CDATA_SECTION:(this._err(L.cdataInHtmlContent),this._createCommentToken(je.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=x.BOGUS_COMMENT):this._ensureHibernation()||(this._err(L.incorrectlyOpenedComment),this._createCommentToken(2),this.state=x.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case b.HYPHEN_MINUS:{this.state=x.COMMENT_START_DASH;break}case b.GREATER_THAN_SIGN:{this._err(L.abruptClosingOfEmptyComment),this.state=x.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=x.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){const n=this.currentToken;switch(e){case b.HYPHEN_MINUS:{this.state=x.COMMENT_END;break}case b.GREATER_THAN_SIGN:{this._err(L.abruptClosingOfEmptyComment),this.state=x.DATA,this.emitCurrentComment(n);break}case b.EOF:{this._err(L.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=x.COMMENT,this._stateComment(e)}}_stateComment(e){const n=this.currentToken;switch(e){case b.HYPHEN_MINUS:{this.state=x.COMMENT_END_DASH;break}case b.LESS_THAN_SIGN:{n.data+="<",this.state=x.COMMENT_LESS_THAN_SIGN;break}case b.NULL:{this._err(L.unexpectedNullCharacter),n.data+=ke;break}case b.EOF:{this._err(L.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){const n=this.currentToken;switch(e){case b.EXCLAMATION_MARK:{n.data+="!",this.state=x.COMMENT_LESS_THAN_SIGN_BANG;break}case b.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=x.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===b.HYPHEN_MINUS?this.state=x.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=x.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===b.HYPHEN_MINUS?this.state=x.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=x.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==b.GREATER_THAN_SIGN&&e!==b.EOF&&this._err(L.nestedComment),this.state=x.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){const n=this.currentToken;switch(e){case b.HYPHEN_MINUS:{this.state=x.COMMENT_END;break}case b.EOF:{this._err(L.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=x.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){const n=this.currentToken;switch(e){case b.GREATER_THAN_SIGN:{this.state=x.DATA,this.emitCurrentComment(n);break}case b.EXCLAMATION_MARK:{this.state=x.COMMENT_END_BANG;break}case b.HYPHEN_MINUS:{n.data+="-";break}case b.EOF:{this._err(L.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=x.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){const n=this.currentToken;switch(e){case b.HYPHEN_MINUS:{n.data+="--!",this.state=x.COMMENT_END_DASH;break}case b.GREATER_THAN_SIGN:{this._err(L.incorrectlyClosedComment),this.state=x.DATA,this.emitCurrentComment(n);break}case b.EOF:{this._err(L.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=x.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case b.SPACE:case b.LINE_FEED:case b.TABULATION:case b.FORM_FEED:{this.state=x.BEFORE_DOCTYPE_NAME;break}case b.GREATER_THAN_SIGN:{this.state=x.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break}case b.EOF:{this._err(L.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(L.missingWhitespaceBeforeDoctypeName),this.state=x.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(In(e))this._createDoctypeToken(String.fromCharCode(sr(e))),this.state=x.DOCTYPE_NAME;else switch(e){case b.SPACE:case b.LINE_FEED:case b.TABULATION:case b.FORM_FEED:break;case b.NULL:{this._err(L.unexpectedNullCharacter),this._createDoctypeToken(ke),this.state=x.DOCTYPE_NAME;break}case b.GREATER_THAN_SIGN:{this._err(L.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=x.DATA;break}case b.EOF:{this._err(L.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=x.DOCTYPE_NAME}}_stateDoctypeName(e){const n=this.currentToken;switch(e){case b.SPACE:case b.LINE_FEED:case b.TABULATION:case b.FORM_FEED:{this.state=x.AFTER_DOCTYPE_NAME;break}case b.GREATER_THAN_SIGN:{this.state=x.DATA,this.emitCurrentDoctype(n);break}case b.NULL:{this._err(L.unexpectedNullCharacter),n.name+=ke;break}case b.EOF:{this._err(L.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(In(e)?sr(e):e)}}_stateAfterDoctypeName(e){const n=this.currentToken;switch(e){case b.SPACE:case b.LINE_FEED:case b.TABULATION:case b.FORM_FEED:break;case b.GREATER_THAN_SIGN:{this.state=x.DATA,this.emitCurrentDoctype(n);break}case b.EOF:{this._err(L.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(je.PUBLIC,!1)?this.state=x.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(je.SYSTEM,!1)?this.state=x.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(L.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=x.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){const n=this.currentToken;switch(e){case b.SPACE:case b.LINE_FEED:case b.TABULATION:case b.FORM_FEED:{this.state=x.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case b.QUOTATION_MARK:{this._err(L.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=x.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case b.APOSTROPHE:{this._err(L.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=x.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case b.GREATER_THAN_SIGN:{this._err(L.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=x.DATA,this.emitCurrentDoctype(n);break}case b.EOF:{this._err(L.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(L.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=x.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){const n=this.currentToken;switch(e){case b.SPACE:case b.LINE_FEED:case b.TABULATION:case b.FORM_FEED:break;case b.QUOTATION_MARK:{n.publicId="",this.state=x.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case b.APOSTROPHE:{n.publicId="",this.state=x.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case b.GREATER_THAN_SIGN:{this._err(L.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=x.DATA,this.emitCurrentDoctype(n);break}case b.EOF:{this._err(L.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(L.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=x.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){const n=this.currentToken;switch(e){case b.QUOTATION_MARK:{this.state=x.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case b.NULL:{this._err(L.unexpectedNullCharacter),n.publicId+=ke;break}case b.GREATER_THAN_SIGN:{this._err(L.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=x.DATA;break}case b.EOF:{this._err(L.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 b.APOSTROPHE:{this.state=x.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case b.NULL:{this._err(L.unexpectedNullCharacter),n.publicId+=ke;break}case b.GREATER_THAN_SIGN:{this._err(L.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=x.DATA;break}case b.EOF:{this._err(L.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 b.SPACE:case b.LINE_FEED:case b.TABULATION:case b.FORM_FEED:{this.state=x.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case b.GREATER_THAN_SIGN:{this.state=x.DATA,this.emitCurrentDoctype(n);break}case b.QUOTATION_MARK:{this._err(L.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=x.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case b.APOSTROPHE:{this._err(L.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=x.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case b.EOF:{this._err(L.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(L.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=x.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){const n=this.currentToken;switch(e){case b.SPACE:case b.LINE_FEED:case b.TABULATION:case b.FORM_FEED:break;case b.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=x.DATA;break}case b.QUOTATION_MARK:{n.systemId="",this.state=x.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case b.APOSTROPHE:{n.systemId="",this.state=x.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case b.EOF:{this._err(L.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(L.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=x.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){const n=this.currentToken;switch(e){case b.SPACE:case b.LINE_FEED:case b.TABULATION:case b.FORM_FEED:{this.state=x.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case b.QUOTATION_MARK:{this._err(L.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=x.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case b.APOSTROPHE:{this._err(L.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=x.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case b.GREATER_THAN_SIGN:{this._err(L.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=x.DATA,this.emitCurrentDoctype(n);break}case b.EOF:{this._err(L.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(L.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=x.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){const n=this.currentToken;switch(e){case b.SPACE:case b.LINE_FEED:case b.TABULATION:case b.FORM_FEED:break;case b.QUOTATION_MARK:{n.systemId="",this.state=x.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case b.APOSTROPHE:{n.systemId="",this.state=x.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case b.GREATER_THAN_SIGN:{this._err(L.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=x.DATA,this.emitCurrentDoctype(n);break}case b.EOF:{this._err(L.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(L.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=x.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){const n=this.currentToken;switch(e){case b.QUOTATION_MARK:{this.state=x.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case b.NULL:{this._err(L.unexpectedNullCharacter),n.systemId+=ke;break}case b.GREATER_THAN_SIGN:{this._err(L.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=x.DATA;break}case b.EOF:{this._err(L.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 b.APOSTROPHE:{this.state=x.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case b.NULL:{this._err(L.unexpectedNullCharacter),n.systemId+=ke;break}case b.GREATER_THAN_SIGN:{this._err(L.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=x.DATA;break}case b.EOF:{this._err(L.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 b.SPACE:case b.LINE_FEED:case b.TABULATION:case b.FORM_FEED:break;case b.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=x.DATA;break}case b.EOF:{this._err(L.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(L.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=x.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){const n=this.currentToken;switch(e){case b.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=x.DATA;break}case b.NULL:{this._err(L.unexpectedNullCharacter);break}case b.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(e){switch(e){case b.RIGHT_SQUARE_BRACKET:{this.state=x.CDATA_SECTION_BRACKET;break}case b.EOF:{this._err(L.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===b.RIGHT_SQUARE_BRACKET?this.state=x.CDATA_SECTION_END:(this._emitChars("]"),this.state=x.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case b.GREATER_THAN_SIGN:{this.state=x.DATA;break}case b.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=x.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(b.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&Ys(this.preprocessor.peek(1))?x.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(e){Ys(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===b.SEMICOLON&&this._err(L.unknownNamedCharacterReference),this.state=this.returnState,this._callState(e))}}const fl=new Set([c.DD,c.DT,c.LI,c.OPTGROUP,c.OPTION,c.P,c.RB,c.RP,c.RT,c.RTC]),Vs=new Set([...fl,c.CAPTION,c.COLGROUP,c.TBODY,c.TD,c.TFOOT,c.TH,c.THEAD,c.TR]),_r=new Set([c.APPLET,c.CAPTION,c.HTML,c.MARQUEE,c.OBJECT,c.TABLE,c.TD,c.TEMPLATE,c.TH]),rE=new Set([..._r,c.OL,c.UL]),iE=new Set([..._r,c.BUTTON]),Ws=new Set([c.ANNOTATION_XML,c.MI,c.MN,c.MO,c.MS,c.MTEXT]),Qs=new Set([c.DESC,c.FOREIGN_OBJECT,c.TITLE]),aE=new Set([c.TR,c.TEMPLATE,c.HTML]),sE=new Set([c.TBODY,c.TFOOT,c.THEAD,c.TEMPLATE,c.HTML]),uE=new Set([c.TABLE,c.TEMPLATE,c.HTML]),oE=new Set([c.TD,c.TH]);class lE{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=c.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===c.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===M.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])!==M.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(Di,M.HTML)}popUntilTableCellPopped(){this.popUntilPopped(oE,M.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(uE,M.HTML)}clearBackToTableBodyContext(){this.clearBackTo(sE,M.HTML)}clearBackToTableRowContext(){this.clearBackTo(aE,M.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]===c.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]===c.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 M.HTML:{if(i===e)return!0;if(n.has(i))return!1;break}case M.SVG:{if(Qs.has(i))return!1;break}case M.MATHML:{if(Ws.has(i))return!1;break}}}return!0}hasInScope(e){return this.hasInDynamicScope(e,_r)}hasInListItemScope(e){return this.hasInDynamicScope(e,rE)}hasInButtonScope(e){return this.hasInDynamicScope(e,iE)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){const n=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case M.HTML:{if(Di.has(n))return!0;if(_r.has(n))return!1;break}case M.SVG:{if(Qs.has(n))return!1;break}case M.MATHML:{if(Ws.has(n))return!1;break}}}return!0}hasInTableScope(e){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===M.HTML)switch(this.tagIDs[n]){case e:return!0;case c.TABLE:case c.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===M.HTML)switch(this.tagIDs[e]){case c.TBODY:case c.THEAD:case c.TFOOT:return!0;case c.TABLE:case c.HTML:return!1}return!0}hasInSelectScope(e){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===M.HTML)switch(this.tagIDs[n]){case e:return!0;case c.OPTION:case c.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&fl.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&Vs.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&Vs.has(this.currentTagId);)this.pop()}}const ai=3;var lt;(function(t){t[t.Marker=0]="Marker",t[t.Element=1]="Element"})(lt||(lt={}));const Gs={type:lt.Marker};class cE{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,n){const r=[],i=n.length,a=this.treeAdapter.getTagName(e),s=this.treeAdapter.getNamespaceURI(e);for(let u=0;u<this.entries.length;u++){const o=this.entries[u];if(o.type===lt.Marker)break;const{element:l}=o;if(this.treeAdapter.getTagName(l)===a&&this.treeAdapter.getNamespaceURI(l)===s){const d=this.treeAdapter.getAttrList(l);d.length===i&&r.push({idx:u,attrs:d})}}return r}_ensureNoahArkCondition(e){if(this.entries.length<ai)return;const n=this.treeAdapter.getAttrList(e),r=this._getNoahArkConditionCandidates(e,n);if(r.length<ai)return;const i=new Map(n.map(s=>[s.name,s.value]));let a=0;for(let s=0;s<r.length;s++){const u=r[s];u.attrs.every(o=>i.get(o.name)===o.value)&&(a+=1,a>=ai&&this.entries.splice(u.idx,1))}}insertMarker(){this.entries.unshift(Gs)}pushElement(e,n){this._ensureNoahArkCondition(e),this.entries.unshift({type:lt.Element,element:e,token:n})}insertElementAfterBookmark(e,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:lt.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(Gs);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){const n=this.entries.find(r=>r.type===lt.Marker||this.treeAdapter.getTagName(r.element)===e);return n&&n.type===lt.Element?n:null}getElementEntry(e){return this.entries.find(n=>n.type===lt.Element&&n.element===e)}}const yt={createDocument(){return{nodeName:"#document",mode:et.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(a=>a.nodeName==="#documentType");if(i)i.name=e,i.publicId=n,i.systemId=r;else{const a={nodeName:"#documentType",name:e,publicId:n,systemId:r,parentNode:null};yt.appendChild(t,a)}},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(yt.isTextNode(n)){n.value+=e;return}}yt.appendChild(t,yt.createTextNode(e))},insertTextBefore(t,e,n){const r=t.childNodes[t.childNodes.indexOf(n)-1];r&&yt.isTextNode(r)?r.value+=e:yt.insertBefore(t,yt.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}}},hl="html",dE="about:legacy-compat",fE="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",pl=["+//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//"],hE=[...pl,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],pE=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),ml=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],mE=[...ml,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function Xs(t,e){return e.some(n=>t.startsWith(n))}function gE(t){return t.name===hl&&t.publicId===null&&(t.systemId===null||t.systemId===dE)}function EE(t){if(t.name!==hl)return et.QUIRKS;const{systemId:e}=t;if(e&&e.toLowerCase()===fE)return et.QUIRKS;let{publicId:n}=t;if(n!==null){if(n=n.toLowerCase(),pE.has(n))return et.QUIRKS;let r=e===null?hE:pl;if(Xs(n,r))return et.QUIRKS;if(r=e===null?ml:mE,Xs(n,r))return et.LIMITED_QUIRKS}return et.NO_QUIRKS}const Zs={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},bE="definitionurl",TE="definitionURL",xE=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])),_E=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:M.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:M.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:M.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:M.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:M.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:M.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:M.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:M.XML}],["xml:space",{prefix:"xml",name:"space",namespace:M.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:M.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:M.XMLNS}]]),yE=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])),AE=new Set([c.B,c.BIG,c.BLOCKQUOTE,c.BODY,c.BR,c.CENTER,c.CODE,c.DD,c.DIV,c.DL,c.DT,c.EM,c.EMBED,c.H1,c.H2,c.H3,c.H4,c.H5,c.H6,c.HEAD,c.HR,c.I,c.IMG,c.LI,c.LISTING,c.MENU,c.META,c.NOBR,c.OL,c.P,c.PRE,c.RUBY,c.S,c.SMALL,c.SPAN,c.STRONG,c.STRIKE,c.SUB,c.SUP,c.TABLE,c.TT,c.U,c.UL,c.VAR]);function kE(t){const e=t.tagID;return e===c.FONT&&t.attrs.some(({name:r})=>r===Mt.COLOR||r===Mt.SIZE||r===Mt.FACE)||AE.has(e)}function gl(t){for(let e=0;e<t.attrs.length;e++)if(t.attrs[e].name===bE){t.attrs[e].name=TE;break}}function El(t){for(let e=0;e<t.attrs.length;e++){const n=xE.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=_E.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 CE(t){const e=yE.get(t.tagName);e!=null&&(t.tagName=e,t.tagID=dn(t.tagName))}function IE(t,e){return e===M.MATHML&&(t===c.MI||t===c.MO||t===c.MN||t===c.MS||t===c.MTEXT)}function SE(t,e,n){if(e===M.MATHML&&t===c.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===Mt.ENCODING){const i=n[r].value.toLowerCase();return i===Zs.TEXT_HTML||i===Zs.APPLICATION_XML}}return e===M.SVG&&(t===c.FOREIGN_OBJECT||t===c.DESC||t===c.TITLE)}function NE(t,e,n,r){return(!r||r===M.HTML)&&SE(t,e,n)||(!r||r===M.MATHML)&&IE(t,e)}const wE="hidden",RE=8,OE=3;var A;(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"})(A||(A={}));const LE={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},bl=new Set([c.TABLE,c.TBODY,c.TFOOT,c.THEAD,c.TR]),Ks={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:yt,onParseError:null};class Js{constructor(e,n,r=null,i=null){this.fragmentContext=r,this.scriptHandler=i,this.currentToken=null,this.stopped=!1,this.insertionMode=A.INITIAL,this.originalInsertionMode=A.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={...Ks,...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 nE(this.options,this),this.activeFormattingElements=new cE(this.treeAdapter),this.fragmentContextID=r?dn(this.treeAdapter.getTagName(r)):c.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new lE(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={...Ks,...n};e??(e=r.treeAdapter.createElement(w.TEMPLATE,M.HTML,[]));const i=r.treeAdapter.createElement("documentmock",M.HTML,[]),a=new this(r,i,e);return a.fragmentContextID===c.TEMPLATE&&a.tmplInsertionModeStack.unshift(A.IN_TEMPLATE),a._initTokenizerForFragmentParsing(),a._insertFakeRootElement(),a._resetInsertionMode(),a._findFormInFragmentContext(),a}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 a=(i=e.location)!==null&&i!==void 0?i:LE,s={code:n,startLine:a.startLine,startCol:a.startCol,startOffset:a.startOffset,endLine:r?a.startLine:a.endLine,endCol:r?a.startCol:a.endCol,endOffset:r?a.startOffset:a.endOffset};this.onParseError(s)}onItemPush(e,n,r){var i,a;(a=(i=this.treeAdapter).onItemPush)===null||a===void 0||a.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 a,s;this.openElements.stackTop===0&&this.fragmentContext?(a=this.fragmentContext,s=this.fragmentContextID):{current:a,currentTagId:s}=this.openElements,this._setContextModes(a,s)}}_setContextModes(e,n){const r=e===this.document||e&&this.treeAdapter.getNamespaceURI(e)===M.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&e!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,e)}_switchToTextParsing(e,n){this._insertElement(e,M.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=A.TEXT}switchToPlaintextParsing(){this.insertionMode=A.TEXT,this.originalInsertionMode=A.IN_BODY,this.tokenizer.state=Ce.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)===w.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==M.HTML))switch(this.fragmentContextID){case c.TITLE:case c.TEXTAREA:{this.tokenizer.state=Ce.RCDATA;break}case c.STYLE:case c.XMP:case c.IFRAME:case c.NOEMBED:case c.NOFRAMES:case c.NOSCRIPT:{this.tokenizer.state=Ce.RAWTEXT;break}case c.SCRIPT:{this.tokenizer.state=Ce.SCRIPT_DATA;break}case c.PLAINTEXT:{this.tokenizer.state=Ce.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 s=this.treeAdapter.getChildNodes(this.document).find(u=>this.treeAdapter.isDocumentTypeNode(u));s&&this.treeAdapter.setNodeSourceCodeLocation(s,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,M.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(e){const n=this.treeAdapter.createElement(e.tagName,M.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(w.HTML,M.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,c.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),a=r?i.lastIndexOf(r):i.length,s=i[a-1];if(this.treeAdapter.getNodeSourceCodeLocation(s)){const{endLine:o,endCol:l,endOffset:d}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(s,{endLine:o,endCol:l,endOffset:d})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(s,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),a=n.type===re.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,a)}}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===c.SVG&&this.treeAdapter.getTagName(n)===w.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===M.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===c.MGLYPH||e.tagID===c.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,M.HTML)}_processToken(e){switch(e.type){case re.CHARACTER:{this.onCharacter(e);break}case re.NULL_CHARACTER:{this.onNullCharacter(e);break}case re.COMMENT:{this.onComment(e);break}case re.DOCTYPE:{this.onDoctype(e);break}case re.START_TAG:{this._processStartTag(e);break}case re.END_TAG:{this.onEndTag(e);break}case re.EOF:{this.onEof(e);break}case re.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(e);break}}}_isIntegrationPoint(e,n,r){const i=this.treeAdapter.getNamespaceURI(n),a=this.treeAdapter.getAttrList(n);return NE(e,i,a,r)}_reconstructActiveFormattingElements(){const e=this.activeFormattingElements.entries.length;if(e){const n=this.activeFormattingElements.entries.findIndex(i=>i.type===lt.Marker||this.openElements.contains(i.element)),r=n===-1?e-1:n-1;for(let i=r;i>=0;i--){const a=this.activeFormattingElements.entries[i];this._insertElement(a.token,this.treeAdapter.getNamespaceURI(a.element)),a.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=A.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(c.P),this.openElements.popUntilTagNamePopped(c.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case c.TR:{this.insertionMode=A.IN_ROW;return}case c.TBODY:case c.THEAD:case c.TFOOT:{this.insertionMode=A.IN_TABLE_BODY;return}case c.CAPTION:{this.insertionMode=A.IN_CAPTION;return}case c.COLGROUP:{this.insertionMode=A.IN_COLUMN_GROUP;return}case c.TABLE:{this.insertionMode=A.IN_TABLE;return}case c.BODY:{this.insertionMode=A.IN_BODY;return}case c.FRAMESET:{this.insertionMode=A.IN_FRAMESET;return}case c.SELECT:{this._resetInsertionModeForSelect(e);return}case c.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case c.HTML:{this.insertionMode=this.headElement?A.AFTER_HEAD:A.BEFORE_HEAD;return}case c.TD:case c.TH:{if(e>0){this.insertionMode=A.IN_CELL;return}break}case c.HEAD:{if(e>0){this.insertionMode=A.IN_HEAD;return}break}}this.insertionMode=A.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let n=e-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===c.TEMPLATE)break;if(r===c.TABLE){this.insertionMode=A.IN_SELECT_IN_TABLE;return}}this.insertionMode=A.IN_SELECT}_isElementCausesFosterParenting(e){return bl.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 c.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===M.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case c.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 Kg[r].has(n)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){o2(this,e);return}switch(this.insertionMode){case A.INITIAL:{_n(this,e);break}case A.BEFORE_HTML:{Ln(this,e);break}case A.BEFORE_HEAD:{Dn(this,e);break}case A.IN_HEAD:{vn(this,e);break}case A.IN_HEAD_NO_SCRIPT:{Pn(this,e);break}case A.AFTER_HEAD:{Mn(this,e);break}case A.IN_BODY:case A.IN_CAPTION:case A.IN_CELL:case A.IN_TEMPLATE:{xl(this,e);break}case A.TEXT:case A.IN_SELECT:case A.IN_SELECT_IN_TABLE:{this._insertCharacters(e);break}case A.IN_TABLE:case A.IN_TABLE_BODY:case A.IN_ROW:{si(this,e);break}case A.IN_TABLE_TEXT:{Il(this,e);break}case A.IN_COLUMN_GROUP:{yr(this,e);break}case A.AFTER_BODY:{Ar(this,e);break}case A.AFTER_AFTER_BODY:{hr(this,e);break}}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){u2(this,e);return}switch(this.insertionMode){case A.INITIAL:{_n(this,e);break}case A.BEFORE_HTML:{Ln(this,e);break}case A.BEFORE_HEAD:{Dn(this,e);break}case A.IN_HEAD:{vn(this,e);break}case A.IN_HEAD_NO_SCRIPT:{Pn(this,e);break}case A.AFTER_HEAD:{Mn(this,e);break}case A.TEXT:{this._insertCharacters(e);break}case A.IN_TABLE:case A.IN_TABLE_BODY:case A.IN_ROW:{si(this,e);break}case A.IN_COLUMN_GROUP:{yr(this,e);break}case A.AFTER_BODY:{Ar(this,e);break}case A.AFTER_AFTER_BODY:{hr(this,e);break}}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){vi(this,e);return}switch(this.insertionMode){case A.INITIAL:case A.BEFORE_HTML:case A.BEFORE_HEAD:case A.IN_HEAD:case A.IN_HEAD_NO_SCRIPT:case A.AFTER_HEAD:case A.IN_BODY:case A.IN_TABLE:case A.IN_CAPTION:case A.IN_COLUMN_GROUP:case A.IN_TABLE_BODY:case A.IN_ROW:case A.IN_CELL:case A.IN_SELECT:case A.IN_SELECT_IN_TABLE:case A.IN_TEMPLATE:case A.IN_FRAMESET:case A.AFTER_FRAMESET:{vi(this,e);break}case A.IN_TABLE_TEXT:{yn(this,e);break}case A.AFTER_BODY:{UE(this,e);break}case A.AFTER_AFTER_BODY:case A.AFTER_AFTER_FRAMESET:{HE(this,e);break}}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case A.INITIAL:{jE(this,e);break}case A.BEFORE_HEAD:case A.IN_HEAD:case A.IN_HEAD_NO_SCRIPT:case A.AFTER_HEAD:{this._err(e,L.misplacedDoctype);break}case A.IN_TABLE_TEXT:{yn(this,e);break}}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,L.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?l2(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case A.INITIAL:{_n(this,e);break}case A.BEFORE_HTML:{zE(this,e);break}case A.BEFORE_HEAD:{YE(this,e);break}case A.IN_HEAD:{at(this,e);break}case A.IN_HEAD_NO_SCRIPT:{WE(this,e);break}case A.AFTER_HEAD:{GE(this,e);break}case A.IN_BODY:{Pe(this,e);break}case A.IN_TABLE:{rn(this,e);break}case A.IN_TABLE_TEXT:{yn(this,e);break}case A.IN_CAPTION:{qb(this,e);break}case A.IN_COLUMN_GROUP:{ga(this,e);break}case A.IN_TABLE_BODY:{Hr(this,e);break}case A.IN_ROW:{jr(this,e);break}case A.IN_CELL:{Qb(this,e);break}case A.IN_SELECT:{wl(this,e);break}case A.IN_SELECT_IN_TABLE:{Xb(this,e);break}case A.IN_TEMPLATE:{Kb(this,e);break}case A.AFTER_BODY:{e2(this,e);break}case A.IN_FRAMESET:{t2(this,e);break}case A.AFTER_FRAMESET:{r2(this,e);break}case A.AFTER_AFTER_BODY:{a2(this,e);break}case A.AFTER_AFTER_FRAMESET:{s2(this,e);break}}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?c2(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case A.INITIAL:{_n(this,e);break}case A.BEFORE_HTML:{$E(this,e);break}case A.BEFORE_HEAD:{qE(this,e);break}case A.IN_HEAD:{VE(this,e);break}case A.IN_HEAD_NO_SCRIPT:{QE(this,e);break}case A.AFTER_HEAD:{XE(this,e);break}case A.IN_BODY:{Ur(this,e);break}case A.TEXT:{Pb(this,e);break}case A.IN_TABLE:{$n(this,e);break}case A.IN_TABLE_TEXT:{yn(this,e);break}case A.IN_CAPTION:{Vb(this,e);break}case A.IN_COLUMN_GROUP:{Wb(this,e);break}case A.IN_TABLE_BODY:{Pi(this,e);break}case A.IN_ROW:{Nl(this,e);break}case A.IN_CELL:{Gb(this,e);break}case A.IN_SELECT:{Rl(this,e);break}case A.IN_SELECT_IN_TABLE:{Zb(this,e);break}case A.IN_TEMPLATE:{Jb(this,e);break}case A.AFTER_BODY:{Ll(this,e);break}case A.IN_FRAMESET:{n2(this,e);break}case A.AFTER_FRAMESET:{i2(this,e);break}case A.AFTER_AFTER_BODY:{hr(this,e);break}}}onEof(e){switch(this.insertionMode){case A.INITIAL:{_n(this,e);break}case A.BEFORE_HTML:{Ln(this,e);break}case A.BEFORE_HEAD:{Dn(this,e);break}case A.IN_HEAD:{vn(this,e);break}case A.IN_HEAD_NO_SCRIPT:{Pn(this,e);break}case A.AFTER_HEAD:{Mn(this,e);break}case A.IN_BODY:case A.IN_TABLE:case A.IN_CAPTION:case A.IN_COLUMN_GROUP:case A.IN_TABLE_BODY:case A.IN_ROW:case A.IN_CELL:case A.IN_SELECT:case A.IN_SELECT_IN_TABLE:{kl(this,e);break}case A.TEXT:{Mb(this,e);break}case A.IN_TABLE_TEXT:{yn(this,e);break}case A.IN_TEMPLATE:{Ol(this,e);break}case A.AFTER_BODY:case A.IN_FRAMESET:case A.AFTER_FRAMESET:case A.AFTER_AFTER_BODY:case A.AFTER_AFTER_FRAMESET:{ma(this,e);break}}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===b.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 A.IN_HEAD:case A.IN_HEAD_NO_SCRIPT:case A.AFTER_HEAD:case A.TEXT:case A.IN_COLUMN_GROUP:case A.IN_SELECT:case A.IN_SELECT_IN_TABLE:case A.IN_FRAMESET:case A.AFTER_FRAMESET:{this._insertCharacters(e);break}case A.IN_BODY:case A.IN_CAPTION:case A.IN_CELL:case A.IN_TEMPLATE:case A.AFTER_BODY:case A.AFTER_AFTER_BODY:case A.AFTER_AFTER_FRAMESET:{Tl(this,e);break}case A.IN_TABLE:case A.IN_TABLE_BODY:case A.IN_ROW:{si(this,e);break}case A.IN_TABLE_TEXT:{Cl(this,e);break}}}}function DE(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):Al(t,e),n}function vE(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 PE(t,e,n){let r=e,i=t.openElements.getCommonAncestor(e);for(let a=0,s=i;s!==n;a++,s=i){i=t.openElements.getCommonAncestor(s);const u=t.activeFormattingElements.getElementEntry(s),o=u&&a>=OE;!u||o?(o&&t.activeFormattingElements.removeEntry(u),t.openElements.remove(s)):(s=ME(t,u),r===e&&(t.activeFormattingElements.bookmark=u),t.treeAdapter.detachNode(r),t.treeAdapter.appendChild(s,r),r=s)}return r}function ME(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 BE(t,e,n){const r=t.treeAdapter.getTagName(e),i=dn(r);if(t._isElementCausesFosterParenting(i))t._fosterParentElement(n);else{const a=t.treeAdapter.getNamespaceURI(e);i===c.TEMPLATE&&a===M.HTML&&(e=t.treeAdapter.getTemplateContent(e)),t.treeAdapter.appendChild(e,n)}}function FE(t,e,n){const r=t.treeAdapter.getNamespaceURI(n.element),{token:i}=n,a=t.treeAdapter.createElement(i.tagName,r,i.attrs);t._adoptNodes(e,a),t.treeAdapter.appendChild(e,a),t.activeFormattingElements.insertElementAfterBookmark(a,i),t.activeFormattingElements.removeEntry(n),t.openElements.remove(n.element),t.openElements.insertAfter(e,a,i.tagID)}function pa(t,e){for(let n=0;n<RE;n++){const r=DE(t,e);if(!r)break;const i=vE(t,r);if(!i)break;t.activeFormattingElements.bookmark=r;const a=PE(t,i,r.element),s=t.openElements.getCommonAncestor(r.element);t.treeAdapter.detachNode(a),s&&BE(t,s,a),FE(t,i,r)}}function vi(t,e){t._appendCommentNode(e,t.openElements.currentTmplContentOrNode)}function UE(t,e){t._appendCommentNode(e,t.openElements.items[0])}function HE(t,e){t._appendCommentNode(e,t.document)}function ma(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 a=t.openElements.items[1],s=t.treeAdapter.getNodeSourceCodeLocation(a);s&&!s.endTag&&t._setEndLocation(a,e)}}}}function jE(t,e){t._setDocumentType(e);const n=e.forceQuirks?et.QUIRKS:EE(e);gE(e)||t._err(e,L.nonConformingDoctype),t.treeAdapter.setDocumentMode(t.document,n),t.insertionMode=A.BEFORE_HTML}function _n(t,e){t._err(e,L.missingDoctype,!0),t.treeAdapter.setDocumentMode(t.document,et.QUIRKS),t.insertionMode=A.BEFORE_HTML,t._processToken(e)}function zE(t,e){e.tagID===c.HTML?(t._insertElement(e,M.HTML),t.insertionMode=A.BEFORE_HEAD):Ln(t,e)}function $E(t,e){const n=e.tagID;(n===c.HTML||n===c.HEAD||n===c.BODY||n===c.BR)&&Ln(t,e)}function Ln(t,e){t._insertFakeRootElement(),t.insertionMode=A.BEFORE_HEAD,t._processToken(e)}function YE(t,e){switch(e.tagID){case c.HTML:{Pe(t,e);break}case c.HEAD:{t._insertElement(e,M.HTML),t.headElement=t.openElements.current,t.insertionMode=A.IN_HEAD;break}default:Dn(t,e)}}function qE(t,e){const n=e.tagID;n===c.HEAD||n===c.BODY||n===c.HTML||n===c.BR?Dn(t,e):t._err(e,L.endTagWithoutMatchingOpenElement)}function Dn(t,e){t._insertFakeElement(w.HEAD,c.HEAD),t.headElement=t.openElements.current,t.insertionMode=A.IN_HEAD,t._processToken(e)}function at(t,e){switch(e.tagID){case c.HTML:{Pe(t,e);break}case c.BASE:case c.BASEFONT:case c.BGSOUND:case c.LINK:case c.META:{t._appendElement(e,M.HTML),e.ackSelfClosing=!0;break}case c.TITLE:{t._switchToTextParsing(e,Ce.RCDATA);break}case c.NOSCRIPT:{t.options.scriptingEnabled?t._switchToTextParsing(e,Ce.RAWTEXT):(t._insertElement(e,M.HTML),t.insertionMode=A.IN_HEAD_NO_SCRIPT);break}case c.NOFRAMES:case c.STYLE:{t._switchToTextParsing(e,Ce.RAWTEXT);break}case c.SCRIPT:{t._switchToTextParsing(e,Ce.SCRIPT_DATA);break}case c.TEMPLATE:{t._insertTemplate(e),t.activeFormattingElements.insertMarker(),t.framesetOk=!1,t.insertionMode=A.IN_TEMPLATE,t.tmplInsertionModeStack.unshift(A.IN_TEMPLATE);break}case c.HEAD:{t._err(e,L.misplacedStartTagForHeadElement);break}default:vn(t,e)}}function VE(t,e){switch(e.tagID){case c.HEAD:{t.openElements.pop(),t.insertionMode=A.AFTER_HEAD;break}case c.BODY:case c.BR:case c.HTML:{vn(t,e);break}case c.TEMPLATE:{$t(t,e);break}default:t._err(e,L.endTagWithoutMatchingOpenElement)}}function $t(t,e){t.openElements.tmplCount>0?(t.openElements.generateImpliedEndTagsThoroughly(),t.openElements.currentTagId!==c.TEMPLATE&&t._err(e,L.closingOfElementWithOpenChildElements),t.openElements.popUntilTagNamePopped(c.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode()):t._err(e,L.endTagWithoutMatchingOpenElement)}function vn(t,e){t.openElements.pop(),t.insertionMode=A.AFTER_HEAD,t._processToken(e)}function WE(t,e){switch(e.tagID){case c.HTML:{Pe(t,e);break}case c.BASEFONT:case c.BGSOUND:case c.HEAD:case c.LINK:case c.META:case c.NOFRAMES:case c.STYLE:{at(t,e);break}case c.NOSCRIPT:{t._err(e,L.nestedNoscriptInHead);break}default:Pn(t,e)}}function QE(t,e){switch(e.tagID){case c.NOSCRIPT:{t.openElements.pop(),t.insertionMode=A.IN_HEAD;break}case c.BR:{Pn(t,e);break}default:t._err(e,L.endTagWithoutMatchingOpenElement)}}function Pn(t,e){const n=e.type===re.EOF?L.openElementsLeftAfterEof:L.disallowedContentInNoscriptInHead;t._err(e,n),t.openElements.pop(),t.insertionMode=A.IN_HEAD,t._processToken(e)}function GE(t,e){switch(e.tagID){case c.HTML:{Pe(t,e);break}case c.BODY:{t._insertElement(e,M.HTML),t.framesetOk=!1,t.insertionMode=A.IN_BODY;break}case c.FRAMESET:{t._insertElement(e,M.HTML),t.insertionMode=A.IN_FRAMESET;break}case c.BASE:case c.BASEFONT:case c.BGSOUND:case c.LINK:case c.META:case c.NOFRAMES:case c.SCRIPT:case c.STYLE:case c.TEMPLATE:case c.TITLE:{t._err(e,L.abandonedHeadElementChild),t.openElements.push(t.headElement,c.HEAD),at(t,e),t.openElements.remove(t.headElement);break}case c.HEAD:{t._err(e,L.misplacedStartTagForHeadElement);break}default:Mn(t,e)}}function XE(t,e){switch(e.tagID){case c.BODY:case c.HTML:case c.BR:{Mn(t,e);break}case c.TEMPLATE:{$t(t,e);break}default:t._err(e,L.endTagWithoutMatchingOpenElement)}}function Mn(t,e){t._insertFakeElement(w.BODY,c.BODY),t.insertionMode=A.IN_BODY,Fr(t,e)}function Fr(t,e){switch(e.type){case re.CHARACTER:{xl(t,e);break}case re.WHITESPACE_CHARACTER:{Tl(t,e);break}case re.COMMENT:{vi(t,e);break}case re.START_TAG:{Pe(t,e);break}case re.END_TAG:{Ur(t,e);break}case re.EOF:{kl(t,e);break}}}function Tl(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e)}function xl(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e),t.framesetOk=!1}function ZE(t,e){t.openElements.tmplCount===0&&t.treeAdapter.adoptAttributes(t.openElements.items[0],e.attrs)}function KE(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t.openElements.tmplCount===0&&(t.framesetOk=!1,t.treeAdapter.adoptAttributes(n,e.attrs))}function JE(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();t.framesetOk&&n&&(t.treeAdapter.detachNode(n),t.openElements.popAllUpToHtmlElement(),t._insertElement(e,M.HTML),t.insertionMode=A.IN_FRAMESET)}function eb(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,M.HTML)}function tb(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t.openElements.currentTagId!==void 0&&Di.has(t.openElements.currentTagId)&&t.openElements.pop(),t._insertElement(e,M.HTML)}function nb(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,M.HTML),t.skipNextNewLine=!0,t.framesetOk=!1}function rb(t,e){const n=t.openElements.tmplCount>0;(!t.formElement||n)&&(t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,M.HTML),n||(t.formElement=t.openElements.current))}function ib(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===c.LI&&i===c.LI||(n===c.DD||n===c.DT)&&(i===c.DD||i===c.DT)){t.openElements.generateImpliedEndTagsWithExclusion(i),t.openElements.popUntilTagNamePopped(i);break}if(i!==c.ADDRESS&&i!==c.DIV&&i!==c.P&&t._isSpecialElement(t.openElements.items[r],i))break}t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,M.HTML)}function ab(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,M.HTML),t.tokenizer.state=Ce.PLAINTEXT}function sb(t,e){t.openElements.hasInScope(c.BUTTON)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(c.BUTTON)),t._reconstructActiveFormattingElements(),t._insertElement(e,M.HTML),t.framesetOk=!1}function ub(t,e){const n=t.activeFormattingElements.getElementEntryInScopeWithTagName(w.A);n&&(pa(t,e),t.openElements.remove(n.element),t.activeFormattingElements.removeEntry(n)),t._reconstructActiveFormattingElements(),t._insertElement(e,M.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function ob(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,M.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function lb(t,e){t._reconstructActiveFormattingElements(),t.openElements.hasInScope(c.NOBR)&&(pa(t,e),t._reconstructActiveFormattingElements()),t._insertElement(e,M.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function cb(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,M.HTML),t.activeFormattingElements.insertMarker(),t.framesetOk=!1}function db(t,e){t.treeAdapter.getDocumentMode(t.document)!==et.QUIRKS&&t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,M.HTML),t.framesetOk=!1,t.insertionMode=A.IN_TABLE}function _l(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,M.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function yl(t){const e=cl(t,Mt.TYPE);return e!=null&&e.toLowerCase()===wE}function fb(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,M.HTML),yl(e)||(t.framesetOk=!1),e.ackSelfClosing=!0}function hb(t,e){t._appendElement(e,M.HTML),e.ackSelfClosing=!0}function pb(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._appendElement(e,M.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function mb(t,e){e.tagName=w.IMG,e.tagID=c.IMG,_l(t,e)}function gb(t,e){t._insertElement(e,M.HTML),t.skipNextNewLine=!0,t.tokenizer.state=Ce.RCDATA,t.originalInsertionMode=t.insertionMode,t.framesetOk=!1,t.insertionMode=A.TEXT}function Eb(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._reconstructActiveFormattingElements(),t.framesetOk=!1,t._switchToTextParsing(e,Ce.RAWTEXT)}function bb(t,e){t.framesetOk=!1,t._switchToTextParsing(e,Ce.RAWTEXT)}function eu(t,e){t._switchToTextParsing(e,Ce.RAWTEXT)}function Tb(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,M.HTML),t.framesetOk=!1,t.insertionMode=t.insertionMode===A.IN_TABLE||t.insertionMode===A.IN_CAPTION||t.insertionMode===A.IN_TABLE_BODY||t.insertionMode===A.IN_ROW||t.insertionMode===A.IN_CELL?A.IN_SELECT_IN_TABLE:A.IN_SELECT}function xb(t,e){t.openElements.currentTagId===c.OPTION&&t.openElements.pop(),t._reconstructActiveFormattingElements(),t._insertElement(e,M.HTML)}function _b(t,e){t.openElements.hasInScope(c.RUBY)&&t.openElements.generateImpliedEndTags(),t._insertElement(e,M.HTML)}function yb(t,e){t.openElements.hasInScope(c.RUBY)&&t.openElements.generateImpliedEndTagsWithExclusion(c.RTC),t._insertElement(e,M.HTML)}function Ab(t,e){t._reconstructActiveFormattingElements(),gl(e),ha(e),e.selfClosing?t._appendElement(e,M.MATHML):t._insertElement(e,M.MATHML),e.ackSelfClosing=!0}function kb(t,e){t._reconstructActiveFormattingElements(),El(e),ha(e),e.selfClosing?t._appendElement(e,M.SVG):t._insertElement(e,M.SVG),e.ackSelfClosing=!0}function tu(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,M.HTML)}function Pe(t,e){switch(e.tagID){case c.I:case c.S:case c.B:case c.U:case c.EM:case c.TT:case c.BIG:case c.CODE:case c.FONT:case c.SMALL:case c.STRIKE:case c.STRONG:{ob(t,e);break}case c.A:{ub(t,e);break}case c.H1:case c.H2:case c.H3:case c.H4:case c.H5:case c.H6:{tb(t,e);break}case c.P:case c.DL:case c.OL:case c.UL:case c.DIV:case c.DIR:case c.NAV:case c.MAIN:case c.MENU:case c.ASIDE:case c.CENTER:case c.FIGURE:case c.FOOTER:case c.HEADER:case c.HGROUP:case c.DIALOG:case c.DETAILS:case c.ADDRESS:case c.ARTICLE:case c.SEARCH:case c.SECTION:case c.SUMMARY:case c.FIELDSET:case c.BLOCKQUOTE:case c.FIGCAPTION:{eb(t,e);break}case c.LI:case c.DD:case c.DT:{ib(t,e);break}case c.BR:case c.IMG:case c.WBR:case c.AREA:case c.EMBED:case c.KEYGEN:{_l(t,e);break}case c.HR:{pb(t,e);break}case c.RB:case c.RTC:{_b(t,e);break}case c.RT:case c.RP:{yb(t,e);break}case c.PRE:case c.LISTING:{nb(t,e);break}case c.XMP:{Eb(t,e);break}case c.SVG:{kb(t,e);break}case c.HTML:{ZE(t,e);break}case c.BASE:case c.LINK:case c.META:case c.STYLE:case c.TITLE:case c.SCRIPT:case c.BGSOUND:case c.BASEFONT:case c.TEMPLATE:{at(t,e);break}case c.BODY:{KE(t,e);break}case c.FORM:{rb(t,e);break}case c.NOBR:{lb(t,e);break}case c.MATH:{Ab(t,e);break}case c.TABLE:{db(t,e);break}case c.INPUT:{fb(t,e);break}case c.PARAM:case c.TRACK:case c.SOURCE:{hb(t,e);break}case c.IMAGE:{mb(t,e);break}case c.BUTTON:{sb(t,e);break}case c.APPLET:case c.OBJECT:case c.MARQUEE:{cb(t,e);break}case c.IFRAME:{bb(t,e);break}case c.SELECT:{Tb(t,e);break}case c.OPTION:case c.OPTGROUP:{xb(t,e);break}case c.NOEMBED:case c.NOFRAMES:{eu(t,e);break}case c.FRAMESET:{JE(t,e);break}case c.TEXTAREA:{gb(t,e);break}case c.NOSCRIPT:{t.options.scriptingEnabled?eu(t,e):tu(t,e);break}case c.PLAINTEXT:{ab(t,e);break}case c.COL:case c.TH:case c.TD:case c.TR:case c.HEAD:case c.FRAME:case c.TBODY:case c.TFOOT:case c.THEAD:case c.CAPTION:case c.COLGROUP:break;default:tu(t,e)}}function Cb(t,e){if(t.openElements.hasInScope(c.BODY)&&(t.insertionMode=A.AFTER_BODY,t.options.sourceCodeLocationInfo)){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t._setEndLocation(n,e)}}function Ib(t,e){t.openElements.hasInScope(c.BODY)&&(t.insertionMode=A.AFTER_BODY,Ll(t,e))}function Sb(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n))}function Nb(t){const e=t.openElements.tmplCount>0,{formElement:n}=t;e||(t.formElement=null),(n||e)&&t.openElements.hasInScope(c.FORM)&&(t.openElements.generateImpliedEndTags(),e?t.openElements.popUntilTagNamePopped(c.FORM):n&&t.openElements.remove(n))}function wb(t){t.openElements.hasInButtonScope(c.P)||t._insertFakeElement(w.P,c.P),t._closePElement()}function Rb(t){t.openElements.hasInListItemScope(c.LI)&&(t.openElements.generateImpliedEndTagsWithExclusion(c.LI),t.openElements.popUntilTagNamePopped(c.LI))}function Ob(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTagsWithExclusion(n),t.openElements.popUntilTagNamePopped(n))}function Lb(t){t.openElements.hasNumberedHeaderInScope()&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilNumberedHeaderPopped())}function Db(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker())}function vb(t){t._reconstructActiveFormattingElements(),t._insertFakeElement(w.BR,c.BR),t.openElements.pop(),t.framesetOk=!1}function Al(t,e){const n=e.tagName,r=e.tagID;for(let i=t.openElements.stackTop;i>0;i--){const a=t.openElements.items[i],s=t.openElements.tagIDs[i];if(r===s&&(r!==c.UNKNOWN||t.treeAdapter.getTagName(a)===n)){t.openElements.generateImpliedEndTagsWithExclusion(r),t.openElements.stackTop>=i&&t.openElements.shortenToLength(i);break}if(t._isSpecialElement(a,s))break}}function Ur(t,e){switch(e.tagID){case c.A:case c.B:case c.I:case c.S:case c.U:case c.EM:case c.TT:case c.BIG:case c.CODE:case c.FONT:case c.NOBR:case c.SMALL:case c.STRIKE:case c.STRONG:{pa(t,e);break}case c.P:{wb(t);break}case c.DL:case c.UL:case c.OL:case c.DIR:case c.DIV:case c.NAV:case c.PRE:case c.MAIN:case c.MENU:case c.ASIDE:case c.BUTTON:case c.CENTER:case c.FIGURE:case c.FOOTER:case c.HEADER:case c.HGROUP:case c.DIALOG:case c.ADDRESS:case c.ARTICLE:case c.DETAILS:case c.SEARCH:case c.SECTION:case c.SUMMARY:case c.LISTING:case c.FIELDSET:case c.BLOCKQUOTE:case c.FIGCAPTION:{Sb(t,e);break}case c.LI:{Rb(t);break}case c.DD:case c.DT:{Ob(t,e);break}case c.H1:case c.H2:case c.H3:case c.H4:case c.H5:case c.H6:{Lb(t);break}case c.BR:{vb(t);break}case c.BODY:{Cb(t,e);break}case c.HTML:{Ib(t,e);break}case c.FORM:{Nb(t);break}case c.APPLET:case c.OBJECT:case c.MARQUEE:{Db(t,e);break}case c.TEMPLATE:{$t(t,e);break}default:Al(t,e)}}function kl(t,e){t.tmplInsertionModeStack.length>0?Ol(t,e):ma(t,e)}function Pb(t,e){var n;e.tagID===c.SCRIPT&&((n=t.scriptHandler)===null||n===void 0||n.call(t,t.openElements.current)),t.openElements.pop(),t.insertionMode=t.originalInsertionMode}function Mb(t,e){t._err(e,L.eofInElementThatCanContainOnlyText),t.openElements.pop(),t.insertionMode=t.originalInsertionMode,t.onEof(e)}function si(t,e){if(t.openElements.currentTagId!==void 0&&bl.has(t.openElements.currentTagId))switch(t.pendingCharacterTokens.length=0,t.hasNonWhitespacePendingCharacterToken=!1,t.originalInsertionMode=t.insertionMode,t.insertionMode=A.IN_TABLE_TEXT,e.type){case re.CHARACTER:{Il(t,e);break}case re.WHITESPACE_CHARACTER:{Cl(t,e);break}}else Jn(t,e)}function Bb(t,e){t.openElements.clearBackToTableContext(),t.activeFormattingElements.insertMarker(),t._insertElement(e,M.HTML),t.insertionMode=A.IN_CAPTION}function Fb(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,M.HTML),t.insertionMode=A.IN_COLUMN_GROUP}function Ub(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(w.COLGROUP,c.COLGROUP),t.insertionMode=A.IN_COLUMN_GROUP,ga(t,e)}function Hb(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,M.HTML),t.insertionMode=A.IN_TABLE_BODY}function jb(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(w.TBODY,c.TBODY),t.insertionMode=A.IN_TABLE_BODY,Hr(t,e)}function zb(t,e){t.openElements.hasInTableScope(c.TABLE)&&(t.openElements.popUntilTagNamePopped(c.TABLE),t._resetInsertionMode(),t._processStartTag(e))}function $b(t,e){yl(e)?t._appendElement(e,M.HTML):Jn(t,e),e.ackSelfClosing=!0}function Yb(t,e){!t.formElement&&t.openElements.tmplCount===0&&(t._insertElement(e,M.HTML),t.formElement=t.openElements.current,t.openElements.pop())}function rn(t,e){switch(e.tagID){case c.TD:case c.TH:case c.TR:{jb(t,e);break}case c.STYLE:case c.SCRIPT:case c.TEMPLATE:{at(t,e);break}case c.COL:{Ub(t,e);break}case c.FORM:{Yb(t,e);break}case c.TABLE:{zb(t,e);break}case c.TBODY:case c.TFOOT:case c.THEAD:{Hb(t,e);break}case c.INPUT:{$b(t,e);break}case c.CAPTION:{Bb(t,e);break}case c.COLGROUP:{Fb(t,e);break}default:Jn(t,e)}}function $n(t,e){switch(e.tagID){case c.TABLE:{t.openElements.hasInTableScope(c.TABLE)&&(t.openElements.popUntilTagNamePopped(c.TABLE),t._resetInsertionMode());break}case c.TEMPLATE:{$t(t,e);break}case c.BODY:case c.CAPTION:case c.COL:case c.COLGROUP:case c.HTML:case c.TBODY:case c.TD:case c.TFOOT:case c.TH:case c.THEAD:case c.TR:break;default:Jn(t,e)}}function Jn(t,e){const n=t.fosterParentingEnabled;t.fosterParentingEnabled=!0,Fr(t,e),t.fosterParentingEnabled=n}function Cl(t,e){t.pendingCharacterTokens.push(e)}function Il(t,e){t.pendingCharacterTokens.push(e),t.hasNonWhitespacePendingCharacterToken=!0}function yn(t,e){let n=0;if(t.hasNonWhitespacePendingCharacterToken)for(;n<t.pendingCharacterTokens.length;n++)Jn(t,t.pendingCharacterTokens[n]);else for(;n<t.pendingCharacterTokens.length;n++)t._insertCharacters(t.pendingCharacterTokens[n]);t.insertionMode=t.originalInsertionMode,t._processToken(e)}const Sl=new Set([c.CAPTION,c.COL,c.COLGROUP,c.TBODY,c.TD,c.TFOOT,c.TH,c.THEAD,c.TR]);function qb(t,e){const n=e.tagID;Sl.has(n)?t.openElements.hasInTableScope(c.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(c.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=A.IN_TABLE,rn(t,e)):Pe(t,e)}function Vb(t,e){const n=e.tagID;switch(n){case c.CAPTION:case c.TABLE:{t.openElements.hasInTableScope(c.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(c.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=A.IN_TABLE,n===c.TABLE&&$n(t,e));break}case c.BODY:case c.COL:case c.COLGROUP:case c.HTML:case c.TBODY:case c.TD:case c.TFOOT:case c.TH:case c.THEAD:case c.TR:break;default:Ur(t,e)}}function ga(t,e){switch(e.tagID){case c.HTML:{Pe(t,e);break}case c.COL:{t._appendElement(e,M.HTML),e.ackSelfClosing=!0;break}case c.TEMPLATE:{at(t,e);break}default:yr(t,e)}}function Wb(t,e){switch(e.tagID){case c.COLGROUP:{t.openElements.currentTagId===c.COLGROUP&&(t.openElements.pop(),t.insertionMode=A.IN_TABLE);break}case c.TEMPLATE:{$t(t,e);break}case c.COL:break;default:yr(t,e)}}function yr(t,e){t.openElements.currentTagId===c.COLGROUP&&(t.openElements.pop(),t.insertionMode=A.IN_TABLE,t._processToken(e))}function Hr(t,e){switch(e.tagID){case c.TR:{t.openElements.clearBackToTableBodyContext(),t._insertElement(e,M.HTML),t.insertionMode=A.IN_ROW;break}case c.TH:case c.TD:{t.openElements.clearBackToTableBodyContext(),t._insertFakeElement(w.TR,c.TR),t.insertionMode=A.IN_ROW,jr(t,e);break}case c.CAPTION:case c.COL:case c.COLGROUP:case c.TBODY:case c.TFOOT:case c.THEAD:{t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=A.IN_TABLE,rn(t,e));break}default:rn(t,e)}}function Pi(t,e){const n=e.tagID;switch(e.tagID){case c.TBODY:case c.TFOOT:case c.THEAD:{t.openElements.hasInTableScope(n)&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=A.IN_TABLE);break}case c.TABLE:{t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=A.IN_TABLE,$n(t,e));break}case c.BODY:case c.CAPTION:case c.COL:case c.COLGROUP:case c.HTML:case c.TD:case c.TH:case c.TR:break;default:$n(t,e)}}function jr(t,e){switch(e.tagID){case c.TH:case c.TD:{t.openElements.clearBackToTableRowContext(),t._insertElement(e,M.HTML),t.insertionMode=A.IN_CELL,t.activeFormattingElements.insertMarker();break}case c.CAPTION:case c.COL:case c.COLGROUP:case c.TBODY:case c.TFOOT:case c.THEAD:case c.TR:{t.openElements.hasInTableScope(c.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=A.IN_TABLE_BODY,Hr(t,e));break}default:rn(t,e)}}function Nl(t,e){switch(e.tagID){case c.TR:{t.openElements.hasInTableScope(c.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=A.IN_TABLE_BODY);break}case c.TABLE:{t.openElements.hasInTableScope(c.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=A.IN_TABLE_BODY,Pi(t,e));break}case c.TBODY:case c.TFOOT:case c.THEAD:{(t.openElements.hasInTableScope(e.tagID)||t.openElements.hasInTableScope(c.TR))&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=A.IN_TABLE_BODY,Pi(t,e));break}case c.BODY:case c.CAPTION:case c.COL:case c.COLGROUP:case c.HTML:case c.TD:case c.TH:break;default:$n(t,e)}}function Qb(t,e){const n=e.tagID;Sl.has(n)?(t.openElements.hasInTableScope(c.TD)||t.openElements.hasInTableScope(c.TH))&&(t._closeTableCell(),jr(t,e)):Pe(t,e)}function Gb(t,e){const n=e.tagID;switch(n){case c.TD:case c.TH:{t.openElements.hasInTableScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=A.IN_ROW);break}case c.TABLE:case c.TBODY:case c.TFOOT:case c.THEAD:case c.TR:{t.openElements.hasInTableScope(n)&&(t._closeTableCell(),Nl(t,e));break}case c.BODY:case c.CAPTION:case c.COL:case c.COLGROUP:case c.HTML:break;default:Ur(t,e)}}function wl(t,e){switch(e.tagID){case c.HTML:{Pe(t,e);break}case c.OPTION:{t.openElements.currentTagId===c.OPTION&&t.openElements.pop(),t._insertElement(e,M.HTML);break}case c.OPTGROUP:{t.openElements.currentTagId===c.OPTION&&t.openElements.pop(),t.openElements.currentTagId===c.OPTGROUP&&t.openElements.pop(),t._insertElement(e,M.HTML);break}case c.HR:{t.openElements.currentTagId===c.OPTION&&t.openElements.pop(),t.openElements.currentTagId===c.OPTGROUP&&t.openElements.pop(),t._appendElement(e,M.HTML),e.ackSelfClosing=!0;break}case c.INPUT:case c.KEYGEN:case c.TEXTAREA:case c.SELECT:{t.openElements.hasInSelectScope(c.SELECT)&&(t.openElements.popUntilTagNamePopped(c.SELECT),t._resetInsertionMode(),e.tagID!==c.SELECT&&t._processStartTag(e));break}case c.SCRIPT:case c.TEMPLATE:{at(t,e);break}}}function Rl(t,e){switch(e.tagID){case c.OPTGROUP:{t.openElements.stackTop>0&&t.openElements.currentTagId===c.OPTION&&t.openElements.tagIDs[t.openElements.stackTop-1]===c.OPTGROUP&&t.openElements.pop(),t.openElements.currentTagId===c.OPTGROUP&&t.openElements.pop();break}case c.OPTION:{t.openElements.currentTagId===c.OPTION&&t.openElements.pop();break}case c.SELECT:{t.openElements.hasInSelectScope(c.SELECT)&&(t.openElements.popUntilTagNamePopped(c.SELECT),t._resetInsertionMode());break}case c.TEMPLATE:{$t(t,e);break}}}function Xb(t,e){const n=e.tagID;n===c.CAPTION||n===c.TABLE||n===c.TBODY||n===c.TFOOT||n===c.THEAD||n===c.TR||n===c.TD||n===c.TH?(t.openElements.popUntilTagNamePopped(c.SELECT),t._resetInsertionMode(),t._processStartTag(e)):wl(t,e)}function Zb(t,e){const n=e.tagID;n===c.CAPTION||n===c.TABLE||n===c.TBODY||n===c.TFOOT||n===c.THEAD||n===c.TR||n===c.TD||n===c.TH?t.openElements.hasInTableScope(n)&&(t.openElements.popUntilTagNamePopped(c.SELECT),t._resetInsertionMode(),t.onEndTag(e)):Rl(t,e)}function Kb(t,e){switch(e.tagID){case c.BASE:case c.BASEFONT:case c.BGSOUND:case c.LINK:case c.META:case c.NOFRAMES:case c.SCRIPT:case c.STYLE:case c.TEMPLATE:case c.TITLE:{at(t,e);break}case c.CAPTION:case c.COLGROUP:case c.TBODY:case c.TFOOT:case c.THEAD:{t.tmplInsertionModeStack[0]=A.IN_TABLE,t.insertionMode=A.IN_TABLE,rn(t,e);break}case c.COL:{t.tmplInsertionModeStack[0]=A.IN_COLUMN_GROUP,t.insertionMode=A.IN_COLUMN_GROUP,ga(t,e);break}case c.TR:{t.tmplInsertionModeStack[0]=A.IN_TABLE_BODY,t.insertionMode=A.IN_TABLE_BODY,Hr(t,e);break}case c.TD:case c.TH:{t.tmplInsertionModeStack[0]=A.IN_ROW,t.insertionMode=A.IN_ROW,jr(t,e);break}default:t.tmplInsertionModeStack[0]=A.IN_BODY,t.insertionMode=A.IN_BODY,Pe(t,e)}}function Jb(t,e){e.tagID===c.TEMPLATE&&$t(t,e)}function Ol(t,e){t.openElements.tmplCount>0?(t.openElements.popUntilTagNamePopped(c.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode(),t.onEof(e)):ma(t,e)}function e2(t,e){e.tagID===c.HTML?Pe(t,e):Ar(t,e)}function Ll(t,e){var n;if(e.tagID===c.HTML){if(t.fragmentContext||(t.insertionMode=A.AFTER_AFTER_BODY),t.options.sourceCodeLocationInfo&&t.openElements.tagIDs[0]===c.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 Ar(t,e)}function Ar(t,e){t.insertionMode=A.IN_BODY,Fr(t,e)}function t2(t,e){switch(e.tagID){case c.HTML:{Pe(t,e);break}case c.FRAMESET:{t._insertElement(e,M.HTML);break}case c.FRAME:{t._appendElement(e,M.HTML),e.ackSelfClosing=!0;break}case c.NOFRAMES:{at(t,e);break}}}function n2(t,e){e.tagID===c.FRAMESET&&!t.openElements.isRootHtmlElementCurrent()&&(t.openElements.pop(),!t.fragmentContext&&t.openElements.currentTagId!==c.FRAMESET&&(t.insertionMode=A.AFTER_FRAMESET))}function r2(t,e){switch(e.tagID){case c.HTML:{Pe(t,e);break}case c.NOFRAMES:{at(t,e);break}}}function i2(t,e){e.tagID===c.HTML&&(t.insertionMode=A.AFTER_AFTER_FRAMESET)}function a2(t,e){e.tagID===c.HTML?Pe(t,e):hr(t,e)}function hr(t,e){t.insertionMode=A.IN_BODY,Fr(t,e)}function s2(t,e){switch(e.tagID){case c.HTML:{Pe(t,e);break}case c.NOFRAMES:{at(t,e);break}}}function u2(t,e){e.chars=ke,t._insertCharacters(e)}function o2(t,e){t._insertCharacters(e),t.framesetOk=!1}function Dl(t){for(;t.treeAdapter.getNamespaceURI(t.openElements.current)!==M.HTML&&t.openElements.currentTagId!==void 0&&!t._isIntegrationPoint(t.openElements.currentTagId,t.openElements.current);)t.openElements.pop()}function l2(t,e){if(kE(e))Dl(t),t._startTagOutsideForeignContent(e);else{const n=t._getAdjustedCurrentElement(),r=t.treeAdapter.getNamespaceURI(n);r===M.MATHML?gl(e):r===M.SVG&&(CE(e),El(e)),ha(e),e.selfClosing?t._appendElement(e,r):t._insertElement(e,r),e.ackSelfClosing=!0}}function c2(t,e){if(e.tagID===c.P||e.tagID===c.BR){Dl(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)===M.HTML){t._endTagOutsideForeignContent(e);break}const i=t.treeAdapter.getTagName(r);if(i.toLowerCase()===e.tagName){e.tagName=i,t.openElements.shortenToLength(n);break}}}w.AREA,w.BASE,w.BASEFONT,w.BGSOUND,w.BR,w.COL,w.EMBED,w.FRAME,w.HR,w.IMG,w.INPUT,w.KEYGEN,w.LINK,w.META,w.PARAM,w.SOURCE,w.TRACK,w.WBR;const d2=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,f2=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),nu={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function vl(t,e){const n=y2(t),r=al("type",{handlers:{root:h2,element:p2,text:m2,comment:Ml,doctype:g2,raw:b2},unknown:T2}),i={parser:n?new Js(nu):Js.getFragmentParser(void 0,nu),handle(u){r(u,i)},stitches:!1,options:e||{}};r(t,i),fn(i,ct());const a=n?i.parser.document:i.parser.getFragment(),s=Ag(a,{file:i.options.file});return i.stitches&&Br(s,"comment",function(u,o,l){const d=u;if(d.value.stitch&&l&&o!==void 0){const f=l.children;return f[o]=d.value.stitch,o}}),s.type==="root"&&s.children.length===1&&s.children[0].type===t.type?s.children[0]:s}function Pl(t,e){let n=-1;if(t)for(;++n<t.length;)e.handle(t[n])}function h2(t,e){Pl(t.children,e)}function p2(t,e){x2(t,e),Pl(t.children,e),_2(t,e)}function m2(t,e){e.parser.tokenizer.state>4&&(e.parser.tokenizer.state=0);const n={type:re.CHARACTER,chars:t.value,location:er(t)};fn(e,ct(t)),e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)}function g2(t,e){const n={type:re.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:er(t)};fn(e,ct(t)),e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)}function E2(t,e){e.stitches=!0;const n=A2(t);if("children"in t&&"children"in n){const r=vl({type:"root",children:t.children},e.options);n.children=r.children}Ml({type:"comment",value:{stitch:n}},e)}function Ml(t,e){const n=t.value,r={type:re.COMMENT,data:n,location:er(t)};fn(e,ct(t)),e.parser.currentToken=r,e.parser._processToken(e.parser.currentToken)}function b2(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,Bl(e,ct(t)),e.parser.tokenizer.write(e.options.tagfilter?t.value.replace(d2,"<$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 T2(t,e){const n=t;if(e.options.passThrough&&e.options.passThrough.includes(n.type))E2(n,e);else{let r="";throw f2.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 fn(t,e){Bl(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=Ce.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 Bl(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 x2(t,e){const n=t.tagName.toLowerCase();if(e.parser.tokenizer.state===Ce.PLAINTEXT)return;fn(e,ct(t));const r=e.parser.openElements.current;let i="namespaceURI"in r?r.namespaceURI:Pt.html;i===Pt.html&&n==="svg"&&(i=Pt.svg);const a=Ng({...t,children:[]},{space:i===Pt.svg?"svg":"html"}),s={type:re.START_TAG,tagName:n,tagID:dn(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in a?a.attrs:[],location:er(t)};e.parser.currentToken=s,e.parser._processToken(e.parser.currentToken),e.parser.tokenizer.lastStartTagName=n}function _2(t,e){const n=t.tagName.toLowerCase();if(!e.parser.tokenizer.inForeignNode&&Mg.includes(n)||e.parser.tokenizer.state===Ce.PLAINTEXT)return;fn(e,Or(t));const r={type:re.END_TAG,tagName:n,tagID:dn(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:er(t)};e.parser.currentToken=r,e.parser._processToken(e.parser.currentToken),n===e.parser.tokenizer.lastStartTagName&&(e.parser.tokenizer.state===Ce.RCDATA||e.parser.tokenizer.state===Ce.RAWTEXT||e.parser.tokenizer.state===Ce.SCRIPT_DATA)&&(e.parser.tokenizer.state=Ce.DATA)}function y2(t){const e=t.type==="root"?t.children[0]:t;return!!(e&&(e.type==="doctype"||e.type==="element"&&e.tagName.toLowerCase()==="html"))}function er(t){const e=ct(t)||{line:void 0,column:void 0,offset:void 0},n=Or(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 A2(t){return"children"in t?nn({...t,children:[]}):nn(t)}function k2(t){return function(e,n){return vl(e,{...t,file:n})}}function ru(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 C2(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function I2(t,e,n){const i=Pr((n||{}).ignore||[]),a=S2(e);let s=-1;for(;++s<a.length;)el(t,"text",u);function u(l,d){let f=-1,p;for(;++f<d.length;){const h=d[f],g=p?p.children:void 0;if(i(h,g?g.indexOf(h):void 0,p))return;p=h}if(p)return o(l,d)}function o(l,d){const f=d[d.length-1],p=a[s][0],h=a[s][1];let g=0;const y=f.children.indexOf(l);let T=!1,S=[];p.lastIndex=0;let E=p.exec(l.value);for(;E;){const R=E.index,O={index:E.index,input:E.input,stack:[...d,l]};let I=h(...E,O);if(typeof I=="string"&&(I=I.length>0?{type:"text",value:I}:void 0),I===!1?p.lastIndex=R+1:(g!==R&&S.push({type:"text",value:l.value.slice(g,R)}),Array.isArray(I)?S.push(...I):I&&S.push(I),g=R+E[0].length,T=!0),!p.global)break;E=p.exec(l.value)}return T?(g<l.value.length&&S.push({type:"text",value:l.value.slice(g)}),f.children.splice(y,1,...S)):S=[l],y+S.length}}function S2(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([N2(i[0]),w2(i[1])])}return e}function N2(t){return typeof t=="string"?new RegExp(C2(t),"g"):t}function w2(t){return typeof t=="function"?t:function(){return t}}const ui="phrasing",oi=["autolink","link","image","label"];function R2(){return{transforms:[B2],enter:{literalAutolink:L2,literalAutolinkEmail:li,literalAutolinkHttp:li,literalAutolinkWww:li},exit:{literalAutolink:M2,literalAutolinkEmail:P2,literalAutolinkHttp:D2,literalAutolinkWww:v2}}}function O2(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:ui,notInConstruct:oi},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:ui,notInConstruct:oi},{character:":",before:"[ps]",after:"\\/",inConstruct:ui,notInConstruct:oi}]}}function L2(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function li(t){this.config.enter.autolinkProtocol.call(this,t)}function D2(t){this.config.exit.autolinkProtocol.call(this,t)}function v2(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 P2(t){this.config.exit.autolinkEmail.call(this,t)}function M2(t){this.exit(t)}function B2(t){I2(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,F2],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),U2]],{ignore:["link","linkReference"]})}function F2(t,e,n,r,i){let a="";if(!Fl(i)||(/^w/i.test(e)&&(n=e+n,e="",a="http://"),!H2(n)))return!1;const s=j2(n+r);if(!s[0])return!1;const u={type:"link",title:null,url:a+e+s[0],children:[{type:"text",value:e+s[0]}]};return s[1]?[u,{type:"text",value:s[1]}]:u}function U2(t,e,n,r){return!Fl(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+e+"@"+n,children:[{type:"text",value:e+"@"+n}]}}function H2(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 j2(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=ru(t,"(");let a=ru(t,")");for(;r!==-1&&i>a;)t+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[t,n]}function Fl(t,e){const n=t.input.charCodeAt(t.index-1);return(t.index===0||Ht(n)||Lr(n))&&(!e||n!==47)}Ul.peek=X2;function z2(){this.buffer()}function $2(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function Y2(){this.buffer()}function q2(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function V2(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=it(this.sliceSerialize(t)).toLowerCase(),n.label=e}function W2(t){this.exit(t)}function Q2(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=it(this.sliceSerialize(t)).toLowerCase(),n.label=e}function G2(t){this.exit(t)}function X2(){return"["}function Ul(t,e,n,r){const i=n.createTracker(r);let a=i.move("[^");const s=n.enter("footnoteReference"),u=n.enter("reference");return a+=i.move(n.safe(n.associationId(t),{after:"]",before:a})),u(),s(),a+=i.move("]"),a}function Z2(){return{enter:{gfmFootnoteCallString:z2,gfmFootnoteCall:$2,gfmFootnoteDefinitionLabelString:Y2,gfmFootnoteDefinition:q2},exit:{gfmFootnoteCallString:V2,gfmFootnoteCall:W2,gfmFootnoteDefinitionLabelString:Q2,gfmFootnoteDefinition:G2}}}function K2(t){let e=!1;return t&&t.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:n,footnoteReference:Ul},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,a,s){const u=a.createTracker(s);let o=u.move("[^");const l=a.enter("footnoteDefinition"),d=a.enter("label");return o+=u.move(a.safe(a.associationId(r),{before:o,after:"]"})),d(),o+=u.move("]:"),r.children&&r.children.length>0&&(u.shift(4),o+=u.move((e?`
|
|
82
|
-
`:" ")+a.indentLines(a.containerFlow(r,u.current()),e?
|
|
83
|
-
`)}function
|
|
84
|
-
`&&
|
|
85
|
-
`}function
|
|
79
|
+
`}),n}function Ds(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function vs(t,e){const n=D1(t,e),r=n.one(t,void 0),i=A1(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&a.children.push({type:"text",value:`
|
|
80
|
+
`},i),a}function F1(t,e){return t&&"run"in t?async function(n,r){const i=vs(n,{file:r,...e});await t.run(i,r)}:function(n,r){return vs(n,{file:r,...t||e})}}function Ps(t){if(t)throw t}var ri,Ms;function U1(){if(Ms)return ri;Ms=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]"},a=function(l){if(!l||e.call(l)!=="[object Object]")return!1;var d=t.call(l,"constructor"),f=l.constructor&&l.constructor.prototype&&t.call(l.constructor.prototype,"isPrototypeOf");if(l.constructor&&!d&&!f)return!1;var p;for(p in l);return typeof p>"u"||t.call(l,p)},s=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},u=function(l,d){if(d==="__proto__")if(t.call(l,d)){if(r)return r(l,d).value}else return;return l[d]};return ri=function o(){var l,d,f,p,h,g,_=arguments[0],y=1,T=arguments.length,I=!1;for(typeof _=="boolean"&&(I=_,_=arguments[1]||{},y=2),(_==null||typeof _!="object"&&typeof _!="function")&&(_={});y<T;++y)if(l=arguments[y],l!=null)for(d in l)f=u(_,d),p=u(l,d),_!==p&&(I&&p&&(a(p)||(h=i(p)))?(h?(h=!1,g=f&&i(f)?f:[]):g=f&&a(f)?f:{},s(_,{name:d,newValue:o(I,g,p)})):typeof p<"u"&&s(_,{name:d,newValue:p}));return _},ri}var H1=U1();const ii=qi(H1);function Pi(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 j1(){const t=[],e={run:n,use:r};return e;function n(...i){let a=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);u(null,...i);function u(o,...l){const d=t[++a];let f=-1;if(o){s(o);return}for(;++f<i.length;)(l[f]===null||l[f]===void 0)&&(l[f]=i[f]);i=l,d?z1(d,u)(...l):s(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 z1(t,e){let n;return r;function r(...s){const u=t.length>s.length;let o;u&&s.push(i);try{o=t.apply(this,s)}catch(l){const d=l;if(u&&n)throw d;return i(d)}u||(o&&o.then&&typeof o.then=="function"?o.then(a,i):o instanceof Error?i(o):a(o))}function i(s,...u){n||(n=!0,e(s,...u))}function a(s){i(null,s)}}const dt={basename:$1,dirname:Y1,extname:q1,join:V1,sep:"/"};function $1(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');ir(t);let n=0,r=-1,i=t.length,a;if(e===void 0||e.length===0||e.length>t.length){for(;i--;)if(t.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?"":t.slice(n,r)}if(e===t)return"";let s=-1,u=e.length-1;for(;i--;)if(t.codePointAt(i)===47){if(a){n=i+1;break}}else s<0&&(a=!0,s=i+1),u>-1&&(t.codePointAt(i)===e.codePointAt(u--)?u<0&&(r=i):(u=-1,r=s));return n===r?r=s:r<0&&(r=t.length),t.slice(n,r)}function Y1(t){if(ir(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 q1(t){ir(t);let e=t.length,n=-1,r=0,i=-1,a=0,s;for(;e--;){const u=t.codePointAt(e);if(u===47){if(s){r=e+1;break}continue}n<0&&(s=!0,n=e+1),u===46?i<0?i=e:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?"":t.slice(i,n)}function V1(...t){let e=-1,n;for(;++e<t.length;)ir(t[e]),t[e]&&(n=n===void 0?t[e]:n+"/"+t[e]);return n===void 0?".":W1(n)}function W1(t){ir(t);const e=t.codePointAt(0)===47;let n=Q1(t,!e);return n.length===0&&!e&&(n="."),n.length>0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function Q1(t,e){let n="",r=0,i=-1,a=0,s=-1,u,o;for(;++s<=t.length;){if(s<t.length)u=t.codePointAt(s);else{if(u===47)break;u=47}if(u===47){if(!(i===s-1||a===1))if(i!==s-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(o=n.lastIndexOf("/"),o!==n.length-1){o<0?(n="",r=0):(n=n.slice(0,o),r=n.length-1-n.lastIndexOf("/")),i=s,a=0;continue}}else if(n.length>0){n="",r=0,i=s,a=0;continue}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(i+1,s):n=t.slice(i+1,s),r=s-i-1;i=s,a=0}else u===46&&a>-1?a++:a=-1}return n}function ir(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const G1={cwd:X1};function X1(){return"/"}function Mi(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function Z1(t){if(typeof t=="string")t=new URL(t);else if(!Mi(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 K1(t)}function K1(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 ai=["history","path","basename","stem","extname","dirname"];class rl{constructor(e){let n;e?Mi(e)?n={path:e}:typeof e=="string"||J1(e)?n={value:e}:n=e:n={},this.cwd="cwd"in n?"":G1.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<ai.length;){const a=ai[r];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let i;for(i in n)ai.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?dt.basename(this.path):void 0}set basename(e){ui(e,"basename"),si(e,"basename"),this.path=dt.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?dt.dirname(this.path):void 0}set dirname(e){Bs(this.basename,"dirname"),this.path=dt.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?dt.extname(this.path):void 0}set extname(e){if(si(e,"extname"),Bs(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=dt.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){Mi(e)&&(e=Z1(e)),ui(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?dt.basename(this.path,this.extname):void 0}set stem(e){ui(e,"stem"),si(e,"stem"),this.path=dt.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 Fe(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 si(t,e){if(t&&t.includes(dt.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+dt.sep+"`")}function ui(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function Bs(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}function J1(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const eg=(function(t){const r=this.constructor.prototype,i=r[t],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),tg={}.hasOwnProperty;class Ea extends eg{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=j1()}copy(){const e=new Ea;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];e.use(...r)}return e.data(ii(!0,{},this.namespace)),e}data(e,n){return typeof e=="string"?arguments.length===2?(ci("data",this.frozen),this.namespace[e]=n,this):tg.call(this.namespace,e)&&this.namespace[e]||void 0:e?(ci("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=dr(e),r=this.parser||this.Parser;return oi("parse",r),r(String(n),n)}process(e,n){const r=this;return this.freeze(),oi("process",this.parser||this.Parser),li("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(a,s){const u=dr(e),o=r.parse(u);r.run(o,u,function(d,f,p){if(d||!f||!p)return l(d);const h=f,g=r.stringify(h,p);ig(g)?p.value=g:p.result=g,l(d,p)});function l(d,f){d||!f?s(d):a?a(f):n(void 0,f)}}}processSync(e){let n=!1,r;return this.freeze(),oi("processSync",this.parser||this.Parser),li("processSync",this.compiler||this.Compiler),this.process(e,i),Us("processSync","process",n),r;function i(a,s){n=!0,Ps(a),r=s}}run(e,n,r){Fs(e),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(s,u){const o=dr(n);i.run(e,o,l);function l(d,f,p){const h=f||e;d?u(d):s?s(h):r(void 0,h,p)}}}runSync(e,n){let r=!1,i;return this.run(e,n,a),Us("runSync","run",r),i;function a(s,u){Ps(s),i=u,r=!0}}stringify(e,n){this.freeze();const r=dr(n),i=this.compiler||this.Compiler;return li("stringify",i),Fs(e),i(e,r)}use(e,...n){const r=this.attachers,i=this.namespace;if(ci("use",this.frozen),e!=null)if(typeof e=="function")o(e,n);else if(typeof e=="object")Array.isArray(e)?u(e):s(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function a(l){if(typeof l=="function")o(l,[]);else if(typeof l=="object")if(Array.isArray(l)){const[d,...f]=l;o(d,f)}else s(l);else throw new TypeError("Expected usable value, not `"+l+"`")}function s(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");u(l.plugins),l.settings&&(i.settings=ii(!0,i.settings,l.settings))}function u(l){let d=-1;if(l!=null)if(Array.isArray(l))for(;++d<l.length;){const f=l[d];a(f)}else throw new TypeError("Expected a list of plugins, not `"+l+"`")}function o(l,d){let f=-1,p=-1;for(;++f<r.length;)if(r[f][0]===l){p=f;break}if(p===-1)r.push([l,...d]);else if(d.length>0){let[h,...g]=d;const _=r[p][1];Pi(_)&&Pi(h)&&(h=ii(!0,_,h)),r[p]=[l,h,...g]}}}}const ng=new Ea().freeze();function oi(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function li(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function ci(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 Fs(t){if(!Pi(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function Us(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function dr(t){return rg(t)?t:new rl(t)}function rg(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function ig(t){return typeof t=="string"||ag(t)}function ag(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const sg="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Hs=[],js={allowDangerousHtml:!0},ug=/^(https?|ircs?|mailto|xmpp)$/i,og=[{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 lg(t){const e=cg(t),n=dg(t);return fg(e.runSync(e.parse(n),n),t)}function cg(t){const e=t.rehypePlugins||Hs,n=t.remarkPlugins||Hs,r=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...js}:js;return ng().use(Ym).use(n).use(F1,r).use(e)}function dg(t){const e=t.children||"",n=new rl;return typeof e=="string"&&(n.value=e),n}function fg(t,e){const n=e.allowedElements,r=e.allowElement,i=e.components,a=e.disallowedElements,s=e.skipHtml,u=e.unwrapDisallowed,o=e.urlTransform||hg;for(const d of og)Object.hasOwn(e,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+sg+d.id,void 0);return e.className&&(t={type:"element",tagName:"div",properties:{className:e.className},children:t.type==="root"?t.children:[t]}),$r(t,l),S0(t,{Fragment:m.Fragment,components:i,ignoreInvalidStyle:!0,jsx:m.jsx,jsxs:m.jsxs,passKeys:!0,passNode:!0});function l(d,f,p){if(d.type==="raw"&&p&&typeof f=="number")return s?p.children.splice(f,1):p.children[f]={type:"text",value:d.value},f;if(d.type==="element"){let h;for(h in ei)if(Object.hasOwn(ei,h)&&Object.hasOwn(d.properties,h)){const g=d.properties[h],_=ei[h];(_===null||_.includes(d.tagName))&&(d.properties[h]=o(String(g||""),h,d))}}if(d.type==="element"){let h=n?!n.includes(d.tagName):a?a.includes(d.tagName):!1;if(!h&&r&&typeof f=="number"&&(h=!r(d,f,p)),h&&p&&typeof f=="number")return u&&d.children?p.children.splice(f,1,...d.children):p.children.splice(f,1),f}}}function hg(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||ug.test(t.slice(0,e))?t:""}const zs=/[#.]/g;function pg(t,e){const n=t||"",r={};let i=0,a,s;for(;i<n.length;){zs.lastIndex=i;const u=zs.exec(n),o=n.slice(i,u?u.index:n.length);o&&(a?a==="#"?r.id=o:Array.isArray(r.className)?r.className.push(o):r.className=[o]:s=o,i+=o.length),u&&(a=u[0],i++)}return{type:"element",tagName:s||e||"div",properties:r,children:[]}}function il(t,e,n){const r=n?bg(n):void 0;function i(a,s,...u){let o;if(a==null){o={type:"root",children:[]};const l=s;u.unshift(l)}else{o=pg(a,e);const l=o.tagName.toLowerCase(),d=r?r.get(l):void 0;if(o.tagName=d||l,mg(s))u.unshift(s);else for(const[f,p]of Object.entries(s))gg(t,o.properties,f,p)}for(const l of u)Bi(o.children,l);return o.type==="element"&&o.tagName==="template"&&(o.content={type:"root",children:o.children},o.children=[]),o}return i}function mg(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 a=i;for(const s of a)if(typeof s!="number"&&typeof s!="string")return!0}}return!!("children"in t&&Array.isArray(t.children))}function gg(t,e,n,r){const i=Mr(t,n);let a;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;a=r}else typeof r=="boolean"?a=r:typeof r=="string"?i.spaceSeparated?a=ls(r):i.commaSeparated?a=is(r):i.commaOrSpaceSeparated?a=ls(is(r).join(" ")):a=$s(i,i.property,r):Array.isArray(r)?a=[...r]:a=i.property==="style"?Eg(r):String(r);if(Array.isArray(a)){const s=[];for(const u of a)s.push($s(i,i.property,u));a=s}i.property==="className"&&Array.isArray(e.className)&&(a=e.className.concat(a)),e[i.property]=a}}function Bi(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)Bi(t,n);else if(typeof e=="object"&&"type"in e)e.type==="root"?Bi(t,e.children):t.push(e);else throw new Error("Expected node, nodes, or string, got `"+e+"`")}function $s(t,e,n){if(typeof n=="string"){if(t.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((t.boolean||t.overloadedBoolean)&&(n===""||Wn(n)===Wn(e)))return!0}return n}function Eg(t){const e=[];for(const[n,r]of Object.entries(t))e.push([n,r].join(": "));return e.join("; ")}function bg(t){const e=new Map;for(const n of t)e.set(n.toLowerCase(),n);return e}const Tg=["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"],xg=il(nr,"div"),_g=il(vt,"g",Tg);function yg(t){const e=String(t),n=[];return{toOffset:i,toPoint:r};function r(a){if(typeof a=="number"&&a>-1&&a<=e.length){let s=0;for(;;){let u=n[s];if(u===void 0){const o=Ys(e,n[s-1]);u=o===-1?e.length+1:o+1,n[s]=u}if(u>a)return{line:s+1,column:a-(s>0?n[s-1]:0)+1,offset:a};s++}}}function i(a){if(a&&typeof a.line=="number"&&typeof a.column=="number"&&!Number.isNaN(a.line)&&!Number.isNaN(a.column)){for(;n.length<a.line;){const u=n[n.length-1],o=Ys(e,u),l=o===-1?e.length+1:o+1;if(u===l)break;n.push(l)}const s=(a.line>1?n[a.line-2]:0)+a.column-1;if(s<n[a.line-1])return s}}}function Ys(t,e){const n=t.indexOf("\r",e),r=t.indexOf(`
|
|
81
|
+
`,e);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const zt={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/"},al={}.hasOwnProperty,Ag=Object.prototype;function kg(t,e){const n=e||{};return ba({file:n.file||void 0,location:!1,schema:n.space==="svg"?vt:nr,verbose:n.verbose||!1},t)}function ba(t,e){let n;switch(e.nodeName){case"#comment":{const r=e;return n={type:"comment",value:r.data},br(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:sl(t,e.childNodes),data:{quirksMode:i}},t.file&&t.location){const a=String(t.file),s=yg(a),u=s.toPoint(0),o=s.toPoint(a.length);n.position={start:u,end:o}}return n}case"#documentType":{const r=e;return n={type:"doctype"},br(t,r,n),n}case"#text":{const r=e;return n={type:"text",value:r.value},br(t,r,n),n}default:return n=Cg(t,e),n}}function sl(t,e){let n=-1;const r=[];for(;++n<e.length;){const i=ba(t,e[n]);r.push(i)}return r}function Cg(t,e){const n=t.schema;t.schema=e.namespaceURI===zt.svg?vt:nr;let r=-1;const i={};for(;++r<e.attrs.length;){const u=e.attrs[r],o=(u.prefix?u.prefix+":":"")+u.name;al.call(Ag,o)||(i[o]=u.value)}const s=(t.schema.space==="svg"?_g:xg)(e.tagName,i,sl(t,e.childNodes));if(br(t,e,s),s.tagName==="template"){const u=e,o=u.sourceCodeLocation,l=o&&o.startTag&&rn(o.startTag),d=o&&o.endTag&&rn(o.endTag),f=ba(t,u.content);l&&d&&t.file&&(f.position={start:l.end,end:d.start}),s.content=f}return t.schema=n,s}function br(t,e,n){if("sourceCodeLocation"in e&&e.sourceCodeLocation&&t.file){const r=Ig(t,n,e.sourceCodeLocation);r&&(t.location=!0,n.position=r)}}function Ig(t,e,n){const r=rn(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 a={};let s;if(n.attrs)for(s in n.attrs)al.call(n.attrs,s)&&(a[Mr(t.schema,s).property]=rn(n.attrs[s]));n.startTag;const u=rn(n.startTag),o=n.endTag?rn(n.endTag):void 0,l={opening:u};o&&(l.closing=o),l.properties=a,e.data={position:l}}}return r}function rn(t){const e=qs({line:t.startLine,column:t.startCol,offset:t.startOffset}),n=qs({line:t.endLine,column:t.endCol,offset:t.endOffset});return e||n?{start:e,end:n}:void 0}function qs(t){return t.line&&t.column?t:void 0}const Vs={}.hasOwnProperty;function ul(t,e){const n=e||{};function r(i,...a){let s=r.invalid;const u=r.handlers;if(i&&Vs.call(i,t)){const o=String(i[t]);s=Vs.call(u,o)?u[o]:r.unknown}if(s)return s.call(this,i,...a)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const Sg={},Ng={}.hasOwnProperty,ol=ul("type",{handlers:{root:Rg,element:Pg,text:Dg,comment:vg,doctype:Lg}});function wg(t,e){const r=(e||Sg).space;return ol(t,r==="svg"?vt:nr)}function Rg(t,e){const n={nodeName:"#document",mode:(t.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=Ta(t.children,n,e),gn(t,n),n}function Og(t,e){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=Ta(t.children,n,e),gn(t,n),n}function Lg(t){const e={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return gn(t,e),e}function Dg(t){const e={nodeName:"#text",value:t.value,parentNode:null};return gn(t,e),e}function vg(t){const e={nodeName:"#comment",data:t.value,parentNode:null};return gn(t,e),e}function Pg(t,e){const n=e;let r=n;t.type==="element"&&t.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=vt);const i=[];let a;if(t.properties){for(a in t.properties)if(a!=="children"&&Ng.call(t.properties,a)){const o=Mg(r,a,t.properties[a]);o&&i.push(o)}}const s=r.space,u={nodeName:t.tagName,tagName:t.tagName,attrs:i,namespaceURI:zt[s],childNodes:[],parentNode:null};return u.childNodes=Ta(t.children,u,r),gn(t,u),t.tagName==="template"&&t.content&&(u.content=Og(t.content,r)),u}function Mg(t,e,n){const r=Mr(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?yo(n):Ro(n));const i={name:r.attribute,value:n===!0?"":String(n)};if(r.space&&r.space!=="html"&&r.space!=="svg"){const a=i.name.indexOf(":");a<0?i.prefix="":(i.name=i.name.slice(a+1),i.prefix=r.attribute.slice(0,a)),i.namespace=zt[r.space]}return i}function Ta(t,e,n){let r=-1;const i=[];if(t)for(;++r<t.length;){const a=ol(t[r],n);a.parentNode=e,i.push(a)}return i}function gn(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 Bg=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],Fg=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]),Ce="�";var b;(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"})(b||(b={}));const Ye={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function ll(t){return t>=55296&&t<=57343}function Ug(t){return t>=56320&&t<=57343}function Hg(t,e){return(t-55296)*1024+9216+e}function cl(t){return t!==32&&t!==10&&t!==13&&t!==9&&t!==12&&t>=1&&t<=31||t>=127&&t<=159}function dl(t){return t>=64976&&t<=65007||Fg.has(t)}var L;(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"})(L||(L={}));const jg=65536;class zg{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=jg,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:a}=this,s=i+n,u=a+n;return{code:e,startLine:r,endLine:r,startCol:s,endCol:s,startOffset:u,endOffset:u}}_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(Ug(n))return this.pos++,this._addGap(),Hg(e,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,b.EOF;return this._err(L.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,b.EOF;const r=this.html.charCodeAt(n);return r===b.CARRIAGE_RETURN?b.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,b.EOF;let e=this.html.charCodeAt(this.pos);return e===b.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,b.LINE_FEED):e===b.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,ll(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===b.LINE_FEED||e===b.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){cl(e)?this._err(L.controlCharacterInInputStream):dl(e)&&this._err(L.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var re;(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"})(re||(re={}));function fl(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 $g=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))),Yg=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 qg(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=Yg.get(t))!==null&&e!==void 0?e:t}var Pe;(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"})(Pe||(Pe={}));const Vg=32;var Rt;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(Rt||(Rt={}));function Fi(t){return t>=Pe.ZERO&&t<=Pe.NINE}function Wg(t){return t>=Pe.UPPER_A&&t<=Pe.UPPER_F||t>=Pe.LOWER_A&&t<=Pe.LOWER_F}function Qg(t){return t>=Pe.UPPER_A&&t<=Pe.UPPER_Z||t>=Pe.LOWER_A&&t<=Pe.LOWER_Z||Fi(t)}function Gg(t){return t===Pe.EQUALS||Qg(t)}var ve;(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"})(ve||(ve={}));var bt;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(bt||(bt={}));class Xg{constructor(e,n,r){this.decodeTree=e,this.emitCodePoint=n,this.errors=r,this.state=ve.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=bt.Strict}startEntity(e){this.decodeMode=e,this.state=ve.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,n){switch(this.state){case ve.EntityStart:return e.charCodeAt(n)===Pe.NUM?(this.state=ve.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=ve.NamedEntity,this.stateNamedEntity(e,n));case ve.NumericStart:return this.stateNumericStart(e,n);case ve.NumericDecimal:return this.stateNumericDecimal(e,n);case ve.NumericHex:return this.stateNumericHex(e,n);case ve.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|Vg)===Pe.LOWER_X?(this.state=ve.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=ve.NumericDecimal,this.stateNumericDecimal(e,n))}addToNumericResult(e,n,r,i){if(n!==r){const a=r-n;this.result=this.result*Math.pow(i,a)+Number.parseInt(e.substr(n,a),i),this.consumed+=a}}stateNumericHex(e,n){const r=n;for(;n<e.length;){const i=e.charCodeAt(n);if(Fi(i)||Wg(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(Fi(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===Pe.SEMI)this.consumed+=1;else if(this.decodeMode===bt.Strict)return 0;return this.emitCodePoint(qg(this.result),this.consumed),this.errors&&(e!==Pe.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,n){const{decodeTree:r}=this;let i=r[this.treeIndex],a=(i&Rt.VALUE_LENGTH)>>14;for(;n<e.length;n++,this.excess++){const s=e.charCodeAt(n);if(this.treeIndex=Zg(r,i,this.treeIndex+Math.max(1,a),s),this.treeIndex<0)return this.result===0||this.decodeMode===bt.Attribute&&(a===0||Gg(s))?0:this.emitNotTerminatedNamedEntity();if(i=r[this.treeIndex],a=(i&Rt.VALUE_LENGTH)>>14,a!==0){if(s===Pe.SEMI)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);this.decodeMode!==bt.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]&Rt.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]&~Rt.VALUE_LENGTH:i[e+1],r),n===3&&this.emitCodePoint(i[e+2],r),r}end(){var e;switch(this.state){case ve.NamedEntity:return this.result!==0&&(this.decodeMode!==bt.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case ve.NumericDecimal:return this.emitNumericEntity(0,2);case ve.NumericHex:return this.emitNumericEntity(0,3);case ve.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case ve.EntityStart:return 0}}}function Zg(t,e,n,r){const i=(e&Rt.BRANCH_LENGTH)>>7,a=e&Rt.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){const o=r-a;return o<0||o>=i?-1:t[n+o]-1}let s=n,u=s+i-1;for(;s<=u;){const o=s+u>>>1,l=t[o];if(l<r)s=o+1;else if(l>r)u=o-1;else return t[o+i]}return-1}var M;(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/"})(M||(M={}));var $t;(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"})($t||($t={}));var nt;(function(t){t.NO_QUIRKS="no-quirks",t.QUIRKS="quirks",t.LIMITED_QUIRKS="limited-quirks"})(nt||(nt={}));var w;(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"})(w||(w={}));var c;(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"})(c||(c={}));const Kg=new Map([[w.A,c.A],[w.ADDRESS,c.ADDRESS],[w.ANNOTATION_XML,c.ANNOTATION_XML],[w.APPLET,c.APPLET],[w.AREA,c.AREA],[w.ARTICLE,c.ARTICLE],[w.ASIDE,c.ASIDE],[w.B,c.B],[w.BASE,c.BASE],[w.BASEFONT,c.BASEFONT],[w.BGSOUND,c.BGSOUND],[w.BIG,c.BIG],[w.BLOCKQUOTE,c.BLOCKQUOTE],[w.BODY,c.BODY],[w.BR,c.BR],[w.BUTTON,c.BUTTON],[w.CAPTION,c.CAPTION],[w.CENTER,c.CENTER],[w.CODE,c.CODE],[w.COL,c.COL],[w.COLGROUP,c.COLGROUP],[w.DD,c.DD],[w.DESC,c.DESC],[w.DETAILS,c.DETAILS],[w.DIALOG,c.DIALOG],[w.DIR,c.DIR],[w.DIV,c.DIV],[w.DL,c.DL],[w.DT,c.DT],[w.EM,c.EM],[w.EMBED,c.EMBED],[w.FIELDSET,c.FIELDSET],[w.FIGCAPTION,c.FIGCAPTION],[w.FIGURE,c.FIGURE],[w.FONT,c.FONT],[w.FOOTER,c.FOOTER],[w.FOREIGN_OBJECT,c.FOREIGN_OBJECT],[w.FORM,c.FORM],[w.FRAME,c.FRAME],[w.FRAMESET,c.FRAMESET],[w.H1,c.H1],[w.H2,c.H2],[w.H3,c.H3],[w.H4,c.H4],[w.H5,c.H5],[w.H6,c.H6],[w.HEAD,c.HEAD],[w.HEADER,c.HEADER],[w.HGROUP,c.HGROUP],[w.HR,c.HR],[w.HTML,c.HTML],[w.I,c.I],[w.IMG,c.IMG],[w.IMAGE,c.IMAGE],[w.INPUT,c.INPUT],[w.IFRAME,c.IFRAME],[w.KEYGEN,c.KEYGEN],[w.LABEL,c.LABEL],[w.LI,c.LI],[w.LINK,c.LINK],[w.LISTING,c.LISTING],[w.MAIN,c.MAIN],[w.MALIGNMARK,c.MALIGNMARK],[w.MARQUEE,c.MARQUEE],[w.MATH,c.MATH],[w.MENU,c.MENU],[w.META,c.META],[w.MGLYPH,c.MGLYPH],[w.MI,c.MI],[w.MO,c.MO],[w.MN,c.MN],[w.MS,c.MS],[w.MTEXT,c.MTEXT],[w.NAV,c.NAV],[w.NOBR,c.NOBR],[w.NOFRAMES,c.NOFRAMES],[w.NOEMBED,c.NOEMBED],[w.NOSCRIPT,c.NOSCRIPT],[w.OBJECT,c.OBJECT],[w.OL,c.OL],[w.OPTGROUP,c.OPTGROUP],[w.OPTION,c.OPTION],[w.P,c.P],[w.PARAM,c.PARAM],[w.PLAINTEXT,c.PLAINTEXT],[w.PRE,c.PRE],[w.RB,c.RB],[w.RP,c.RP],[w.RT,c.RT],[w.RTC,c.RTC],[w.RUBY,c.RUBY],[w.S,c.S],[w.SCRIPT,c.SCRIPT],[w.SEARCH,c.SEARCH],[w.SECTION,c.SECTION],[w.SELECT,c.SELECT],[w.SOURCE,c.SOURCE],[w.SMALL,c.SMALL],[w.SPAN,c.SPAN],[w.STRIKE,c.STRIKE],[w.STRONG,c.STRONG],[w.STYLE,c.STYLE],[w.SUB,c.SUB],[w.SUMMARY,c.SUMMARY],[w.SUP,c.SUP],[w.TABLE,c.TABLE],[w.TBODY,c.TBODY],[w.TEMPLATE,c.TEMPLATE],[w.TEXTAREA,c.TEXTAREA],[w.TFOOT,c.TFOOT],[w.TD,c.TD],[w.TH,c.TH],[w.THEAD,c.THEAD],[w.TITLE,c.TITLE],[w.TR,c.TR],[w.TRACK,c.TRACK],[w.TT,c.TT],[w.U,c.U],[w.UL,c.UL],[w.SVG,c.SVG],[w.VAR,c.VAR],[w.WBR,c.WBR],[w.XMP,c.XMP]]);function En(t){var e;return(e=Kg.get(t))!==null&&e!==void 0?e:c.UNKNOWN}const U=c,Jg={[M.HTML]:new Set([U.ADDRESS,U.APPLET,U.AREA,U.ARTICLE,U.ASIDE,U.BASE,U.BASEFONT,U.BGSOUND,U.BLOCKQUOTE,U.BODY,U.BR,U.BUTTON,U.CAPTION,U.CENTER,U.COL,U.COLGROUP,U.DD,U.DETAILS,U.DIR,U.DIV,U.DL,U.DT,U.EMBED,U.FIELDSET,U.FIGCAPTION,U.FIGURE,U.FOOTER,U.FORM,U.FRAME,U.FRAMESET,U.H1,U.H2,U.H3,U.H4,U.H5,U.H6,U.HEAD,U.HEADER,U.HGROUP,U.HR,U.HTML,U.IFRAME,U.IMG,U.INPUT,U.LI,U.LINK,U.LISTING,U.MAIN,U.MARQUEE,U.MENU,U.META,U.NAV,U.NOEMBED,U.NOFRAMES,U.NOSCRIPT,U.OBJECT,U.OL,U.P,U.PARAM,U.PLAINTEXT,U.PRE,U.SCRIPT,U.SECTION,U.SELECT,U.SOURCE,U.STYLE,U.SUMMARY,U.TABLE,U.TBODY,U.TD,U.TEMPLATE,U.TEXTAREA,U.TFOOT,U.TH,U.THEAD,U.TITLE,U.TR,U.TRACK,U.UL,U.WBR,U.XMP]),[M.MATHML]:new Set([U.MI,U.MO,U.MN,U.MS,U.MTEXT,U.ANNOTATION_XML]),[M.SVG]:new Set([U.TITLE,U.FOREIGN_OBJECT,U.DESC]),[M.XLINK]:new Set,[M.XML]:new Set,[M.XMLNS]:new Set},Ui=new Set([U.H1,U.H2,U.H3,U.H4,U.H5,U.H6]);w.STYLE,w.SCRIPT,w.XMP,w.IFRAME,w.NOEMBED,w.NOFRAMES,w.PLAINTEXT;var x;(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"})(x||(x={}));const Re={DATA:x.DATA,RCDATA:x.RCDATA,RAWTEXT:x.RAWTEXT,SCRIPT_DATA:x.SCRIPT_DATA,PLAINTEXT:x.PLAINTEXT,CDATA_SECTION:x.CDATA_SECTION};function eE(t){return t>=b.DIGIT_0&&t<=b.DIGIT_9}function Ln(t){return t>=b.LATIN_CAPITAL_A&&t<=b.LATIN_CAPITAL_Z}function tE(t){return t>=b.LATIN_SMALL_A&&t<=b.LATIN_SMALL_Z}function St(t){return tE(t)||Ln(t)}function Ws(t){return St(t)||eE(t)}function fr(t){return t+32}function hl(t){return t===b.SPACE||t===b.LINE_FEED||t===b.TABULATION||t===b.FORM_FEED}function Qs(t){return hl(t)||t===b.SOLIDUS||t===b.GREATER_THAN_SIGN}function nE(t){return t===b.NULL?L.nullCharacterReference:t>1114111?L.characterReferenceOutsideUnicodeRange:ll(t)?L.surrogateCharacterReference:dl(t)?L.noncharacterCharacterReference:cl(t)||t===b.CARRIAGE_RETURN?L.controlCharacterReference:null}class rE{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=x.DATA,this.returnState=x.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new zg(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new Xg($g,(r,i)=>{this.preprocessor.pos=this.entityStartPos+i-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(L.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(L.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const i=nE(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:re.START_TAG,tagName:"",tagID:c.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:re.END_TAG,tagName:"",tagID:c.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:re.COMMENT,data:"",location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:re.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(fl(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(L.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=En(e.tagName),e.type===re.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(L.endTagWithAttributes),e.selfClosing&&this._err(L.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 re.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case re.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case re.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:re.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=hl(e)?re.WHITESPACE_CHARACTER:e===b.NULL?re.NULL_CHARACTER:re.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(re.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=x.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?bt.Attribute:bt.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===x.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===x.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===x.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case x.DATA:{this._stateData(e);break}case x.RCDATA:{this._stateRcdata(e);break}case x.RAWTEXT:{this._stateRawtext(e);break}case x.SCRIPT_DATA:{this._stateScriptData(e);break}case x.PLAINTEXT:{this._statePlaintext(e);break}case x.TAG_OPEN:{this._stateTagOpen(e);break}case x.END_TAG_OPEN:{this._stateEndTagOpen(e);break}case x.TAG_NAME:{this._stateTagName(e);break}case x.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(e);break}case x.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(e);break}case x.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(e);break}case x.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(e);break}case x.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(e);break}case x.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(e);break}case x.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(e);break}case x.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(e);break}case x.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(e);break}case x.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(e);break}case x.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(e);break}case x.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(e);break}case x.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(e);break}case x.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(e);break}case x.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(e);break}case x.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(e);break}case x.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(e);break}case x.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(e);break}case x.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(e);break}case x.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(e);break}case x.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(e);break}case x.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(e);break}case x.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(e);break}case x.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(e);break}case x.ATTRIBUTE_NAME:{this._stateAttributeName(e);break}case x.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(e);break}case x.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(e);break}case x.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(e);break}case x.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(e);break}case x.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(e);break}case x.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(e);break}case x.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(e);break}case x.BOGUS_COMMENT:{this._stateBogusComment(e);break}case x.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(e);break}case x.COMMENT_START:{this._stateCommentStart(e);break}case x.COMMENT_START_DASH:{this._stateCommentStartDash(e);break}case x.COMMENT:{this._stateComment(e);break}case x.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(e);break}case x.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(e);break}case x.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(e);break}case x.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(e);break}case x.COMMENT_END_DASH:{this._stateCommentEndDash(e);break}case x.COMMENT_END:{this._stateCommentEnd(e);break}case x.COMMENT_END_BANG:{this._stateCommentEndBang(e);break}case x.DOCTYPE:{this._stateDoctype(e);break}case x.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(e);break}case x.DOCTYPE_NAME:{this._stateDoctypeName(e);break}case x.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(e);break}case x.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(e);break}case x.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(e);break}case x.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(e);break}case x.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(e);break}case x.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(e);break}case x.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break}case x.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(e);break}case x.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(e);break}case x.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(e);break}case x.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(e);break}case x.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(e);break}case x.BOGUS_DOCTYPE:{this._stateBogusDoctype(e);break}case x.CDATA_SECTION:{this._stateCdataSection(e);break}case x.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(e);break}case x.CDATA_SECTION_END:{this._stateCdataSectionEnd(e);break}case x.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case x.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(e);break}default:throw new Error("Unknown state")}}_stateData(e){switch(e){case b.LESS_THAN_SIGN:{this.state=x.TAG_OPEN;break}case b.AMPERSAND:{this._startCharacterReference();break}case b.NULL:{this._err(L.unexpectedNullCharacter),this._emitCodePoint(e);break}case b.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case b.AMPERSAND:{this._startCharacterReference();break}case b.LESS_THAN_SIGN:{this.state=x.RCDATA_LESS_THAN_SIGN;break}case b.NULL:{this._err(L.unexpectedNullCharacter),this._emitChars(Ce);break}case b.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case b.LESS_THAN_SIGN:{this.state=x.RAWTEXT_LESS_THAN_SIGN;break}case b.NULL:{this._err(L.unexpectedNullCharacter),this._emitChars(Ce);break}case b.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case b.LESS_THAN_SIGN:{this.state=x.SCRIPT_DATA_LESS_THAN_SIGN;break}case b.NULL:{this._err(L.unexpectedNullCharacter),this._emitChars(Ce);break}case b.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case b.NULL:{this._err(L.unexpectedNullCharacter),this._emitChars(Ce);break}case b.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateTagOpen(e){if(St(e))this._createStartTagToken(),this.state=x.TAG_NAME,this._stateTagName(e);else switch(e){case b.EXCLAMATION_MARK:{this.state=x.MARKUP_DECLARATION_OPEN;break}case b.SOLIDUS:{this.state=x.END_TAG_OPEN;break}case b.QUESTION_MARK:{this._err(L.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=x.BOGUS_COMMENT,this._stateBogusComment(e);break}case b.EOF:{this._err(L.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(L.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=x.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(St(e))this._createEndTagToken(),this.state=x.TAG_NAME,this._stateTagName(e);else switch(e){case b.GREATER_THAN_SIGN:{this._err(L.missingEndTagName),this.state=x.DATA;break}case b.EOF:{this._err(L.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(L.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=x.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){const n=this.currentToken;switch(e){case b.SPACE:case b.LINE_FEED:case b.TABULATION:case b.FORM_FEED:{this.state=x.BEFORE_ATTRIBUTE_NAME;break}case b.SOLIDUS:{this.state=x.SELF_CLOSING_START_TAG;break}case b.GREATER_THAN_SIGN:{this.state=x.DATA,this.emitCurrentTagToken();break}case b.NULL:{this._err(L.unexpectedNullCharacter),n.tagName+=Ce;break}case b.EOF:{this._err(L.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(Ln(e)?fr(e):e)}}_stateRcdataLessThanSign(e){e===b.SOLIDUS?this.state=x.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=x.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){St(e)?(this.state=x.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars("</"),this.state=x.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 b.SPACE:case b.LINE_FEED:case b.TABULATION:case b.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=x.BEFORE_ATTRIBUTE_NAME,!1;case b.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=x.SELF_CLOSING_START_TAG,!1;case b.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=x.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=x.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===b.SOLIDUS?this.state=x.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=x.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){St(e)?(this.state=x.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars("</"),this.state=x.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=x.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case b.SOLIDUS:{this.state=x.SCRIPT_DATA_END_TAG_OPEN;break}case b.EXCLAMATION_MARK:{this.state=x.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=x.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){St(e)?(this.state=x.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars("</"),this.state=x.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=x.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===b.HYPHEN_MINUS?(this.state=x.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=x.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===b.HYPHEN_MINUS?(this.state=x.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=x.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case b.HYPHEN_MINUS:{this.state=x.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case b.LESS_THAN_SIGN:{this.state=x.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case b.NULL:{this._err(L.unexpectedNullCharacter),this._emitChars(Ce);break}case b.EOF:{this._err(L.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case b.HYPHEN_MINUS:{this.state=x.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case b.LESS_THAN_SIGN:{this.state=x.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case b.NULL:{this._err(L.unexpectedNullCharacter),this.state=x.SCRIPT_DATA_ESCAPED,this._emitChars(Ce);break}case b.EOF:{this._err(L.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=x.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case b.HYPHEN_MINUS:{this._emitChars("-");break}case b.LESS_THAN_SIGN:{this.state=x.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case b.GREATER_THAN_SIGN:{this.state=x.SCRIPT_DATA,this._emitChars(">");break}case b.NULL:{this._err(L.unexpectedNullCharacter),this.state=x.SCRIPT_DATA_ESCAPED,this._emitChars(Ce);break}case b.EOF:{this._err(L.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=x.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===b.SOLIDUS?this.state=x.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:St(e)?(this._emitChars("<"),this.state=x.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars("<"),this.state=x.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){St(e)?(this.state=x.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars("</"),this.state=x.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=x.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(Ye.SCRIPT,!1)&&Qs(this.preprocessor.peek(Ye.SCRIPT.length))){this._emitCodePoint(e);for(let n=0;n<Ye.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=x.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case b.HYPHEN_MINUS:{this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case b.LESS_THAN_SIGN:{this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case b.NULL:{this._err(L.unexpectedNullCharacter),this._emitChars(Ce);break}case b.EOF:{this._err(L.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case b.HYPHEN_MINUS:{this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case b.LESS_THAN_SIGN:{this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case b.NULL:{this._err(L.unexpectedNullCharacter),this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Ce);break}case b.EOF:{this._err(L.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case b.HYPHEN_MINUS:{this._emitChars("-");break}case b.LESS_THAN_SIGN:{this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case b.GREATER_THAN_SIGN:{this.state=x.SCRIPT_DATA,this._emitChars(">");break}case b.NULL:{this._err(L.unexpectedNullCharacter),this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Ce);break}case b.EOF:{this._err(L.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===b.SOLIDUS?(this.state=x.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(Ye.SCRIPT,!1)&&Qs(this.preprocessor.peek(Ye.SCRIPT.length))){this._emitCodePoint(e);for(let n=0;n<Ye.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=x.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case b.SPACE:case b.LINE_FEED:case b.TABULATION:case b.FORM_FEED:break;case b.SOLIDUS:case b.GREATER_THAN_SIGN:case b.EOF:{this.state=x.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case b.EQUALS_SIGN:{this._err(L.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=x.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=x.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case b.SPACE:case b.LINE_FEED:case b.TABULATION:case b.FORM_FEED:case b.SOLIDUS:case b.GREATER_THAN_SIGN:case b.EOF:{this._leaveAttrName(),this.state=x.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case b.EQUALS_SIGN:{this._leaveAttrName(),this.state=x.BEFORE_ATTRIBUTE_VALUE;break}case b.QUOTATION_MARK:case b.APOSTROPHE:case b.LESS_THAN_SIGN:{this._err(L.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break}case b.NULL:{this._err(L.unexpectedNullCharacter),this.currentAttr.name+=Ce;break}default:this.currentAttr.name+=String.fromCodePoint(Ln(e)?fr(e):e)}}_stateAfterAttributeName(e){switch(e){case b.SPACE:case b.LINE_FEED:case b.TABULATION:case b.FORM_FEED:break;case b.SOLIDUS:{this.state=x.SELF_CLOSING_START_TAG;break}case b.EQUALS_SIGN:{this.state=x.BEFORE_ATTRIBUTE_VALUE;break}case b.GREATER_THAN_SIGN:{this.state=x.DATA,this.emitCurrentTagToken();break}case b.EOF:{this._err(L.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=x.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case b.SPACE:case b.LINE_FEED:case b.TABULATION:case b.FORM_FEED:break;case b.QUOTATION_MARK:{this.state=x.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case b.APOSTROPHE:{this.state=x.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case b.GREATER_THAN_SIGN:{this._err(L.missingAttributeValue),this.state=x.DATA,this.emitCurrentTagToken();break}default:this.state=x.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case b.QUOTATION_MARK:{this.state=x.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case b.AMPERSAND:{this._startCharacterReference();break}case b.NULL:{this._err(L.unexpectedNullCharacter),this.currentAttr.value+=Ce;break}case b.EOF:{this._err(L.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case b.APOSTROPHE:{this.state=x.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case b.AMPERSAND:{this._startCharacterReference();break}case b.NULL:{this._err(L.unexpectedNullCharacter),this.currentAttr.value+=Ce;break}case b.EOF:{this._err(L.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case b.SPACE:case b.LINE_FEED:case b.TABULATION:case b.FORM_FEED:{this._leaveAttrValue(),this.state=x.BEFORE_ATTRIBUTE_NAME;break}case b.AMPERSAND:{this._startCharacterReference();break}case b.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=x.DATA,this.emitCurrentTagToken();break}case b.NULL:{this._err(L.unexpectedNullCharacter),this.currentAttr.value+=Ce;break}case b.QUOTATION_MARK:case b.APOSTROPHE:case b.LESS_THAN_SIGN:case b.EQUALS_SIGN:case b.GRAVE_ACCENT:{this._err(L.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break}case b.EOF:{this._err(L.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case b.SPACE:case b.LINE_FEED:case b.TABULATION:case b.FORM_FEED:{this._leaveAttrValue(),this.state=x.BEFORE_ATTRIBUTE_NAME;break}case b.SOLIDUS:{this._leaveAttrValue(),this.state=x.SELF_CLOSING_START_TAG;break}case b.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=x.DATA,this.emitCurrentTagToken();break}case b.EOF:{this._err(L.eofInTag),this._emitEOFToken();break}default:this._err(L.missingWhitespaceBetweenAttributes),this.state=x.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case b.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=x.DATA,this.emitCurrentTagToken();break}case b.EOF:{this._err(L.eofInTag),this._emitEOFToken();break}default:this._err(L.unexpectedSolidusInTag),this.state=x.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){const n=this.currentToken;switch(e){case b.GREATER_THAN_SIGN:{this.state=x.DATA,this.emitCurrentComment(n);break}case b.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case b.NULL:{this._err(L.unexpectedNullCharacter),n.data+=Ce;break}default:n.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(Ye.DASH_DASH,!0)?(this._createCommentToken(Ye.DASH_DASH.length+1),this.state=x.COMMENT_START):this._consumeSequenceIfMatch(Ye.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Ye.DOCTYPE.length+1),this.state=x.DOCTYPE):this._consumeSequenceIfMatch(Ye.CDATA_START,!0)?this.inForeignNode?this.state=x.CDATA_SECTION:(this._err(L.cdataInHtmlContent),this._createCommentToken(Ye.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=x.BOGUS_COMMENT):this._ensureHibernation()||(this._err(L.incorrectlyOpenedComment),this._createCommentToken(2),this.state=x.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case b.HYPHEN_MINUS:{this.state=x.COMMENT_START_DASH;break}case b.GREATER_THAN_SIGN:{this._err(L.abruptClosingOfEmptyComment),this.state=x.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=x.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){const n=this.currentToken;switch(e){case b.HYPHEN_MINUS:{this.state=x.COMMENT_END;break}case b.GREATER_THAN_SIGN:{this._err(L.abruptClosingOfEmptyComment),this.state=x.DATA,this.emitCurrentComment(n);break}case b.EOF:{this._err(L.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=x.COMMENT,this._stateComment(e)}}_stateComment(e){const n=this.currentToken;switch(e){case b.HYPHEN_MINUS:{this.state=x.COMMENT_END_DASH;break}case b.LESS_THAN_SIGN:{n.data+="<",this.state=x.COMMENT_LESS_THAN_SIGN;break}case b.NULL:{this._err(L.unexpectedNullCharacter),n.data+=Ce;break}case b.EOF:{this._err(L.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){const n=this.currentToken;switch(e){case b.EXCLAMATION_MARK:{n.data+="!",this.state=x.COMMENT_LESS_THAN_SIGN_BANG;break}case b.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=x.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===b.HYPHEN_MINUS?this.state=x.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=x.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===b.HYPHEN_MINUS?this.state=x.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=x.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==b.GREATER_THAN_SIGN&&e!==b.EOF&&this._err(L.nestedComment),this.state=x.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){const n=this.currentToken;switch(e){case b.HYPHEN_MINUS:{this.state=x.COMMENT_END;break}case b.EOF:{this._err(L.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=x.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){const n=this.currentToken;switch(e){case b.GREATER_THAN_SIGN:{this.state=x.DATA,this.emitCurrentComment(n);break}case b.EXCLAMATION_MARK:{this.state=x.COMMENT_END_BANG;break}case b.HYPHEN_MINUS:{n.data+="-";break}case b.EOF:{this._err(L.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=x.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){const n=this.currentToken;switch(e){case b.HYPHEN_MINUS:{n.data+="--!",this.state=x.COMMENT_END_DASH;break}case b.GREATER_THAN_SIGN:{this._err(L.incorrectlyClosedComment),this.state=x.DATA,this.emitCurrentComment(n);break}case b.EOF:{this._err(L.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=x.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case b.SPACE:case b.LINE_FEED:case b.TABULATION:case b.FORM_FEED:{this.state=x.BEFORE_DOCTYPE_NAME;break}case b.GREATER_THAN_SIGN:{this.state=x.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break}case b.EOF:{this._err(L.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(L.missingWhitespaceBeforeDoctypeName),this.state=x.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(Ln(e))this._createDoctypeToken(String.fromCharCode(fr(e))),this.state=x.DOCTYPE_NAME;else switch(e){case b.SPACE:case b.LINE_FEED:case b.TABULATION:case b.FORM_FEED:break;case b.NULL:{this._err(L.unexpectedNullCharacter),this._createDoctypeToken(Ce),this.state=x.DOCTYPE_NAME;break}case b.GREATER_THAN_SIGN:{this._err(L.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=x.DATA;break}case b.EOF:{this._err(L.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=x.DOCTYPE_NAME}}_stateDoctypeName(e){const n=this.currentToken;switch(e){case b.SPACE:case b.LINE_FEED:case b.TABULATION:case b.FORM_FEED:{this.state=x.AFTER_DOCTYPE_NAME;break}case b.GREATER_THAN_SIGN:{this.state=x.DATA,this.emitCurrentDoctype(n);break}case b.NULL:{this._err(L.unexpectedNullCharacter),n.name+=Ce;break}case b.EOF:{this._err(L.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(Ln(e)?fr(e):e)}}_stateAfterDoctypeName(e){const n=this.currentToken;switch(e){case b.SPACE:case b.LINE_FEED:case b.TABULATION:case b.FORM_FEED:break;case b.GREATER_THAN_SIGN:{this.state=x.DATA,this.emitCurrentDoctype(n);break}case b.EOF:{this._err(L.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(Ye.PUBLIC,!1)?this.state=x.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Ye.SYSTEM,!1)?this.state=x.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(L.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=x.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){const n=this.currentToken;switch(e){case b.SPACE:case b.LINE_FEED:case b.TABULATION:case b.FORM_FEED:{this.state=x.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case b.QUOTATION_MARK:{this._err(L.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=x.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case b.APOSTROPHE:{this._err(L.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=x.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case b.GREATER_THAN_SIGN:{this._err(L.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=x.DATA,this.emitCurrentDoctype(n);break}case b.EOF:{this._err(L.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(L.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=x.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){const n=this.currentToken;switch(e){case b.SPACE:case b.LINE_FEED:case b.TABULATION:case b.FORM_FEED:break;case b.QUOTATION_MARK:{n.publicId="",this.state=x.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case b.APOSTROPHE:{n.publicId="",this.state=x.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case b.GREATER_THAN_SIGN:{this._err(L.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=x.DATA,this.emitCurrentDoctype(n);break}case b.EOF:{this._err(L.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(L.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=x.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){const n=this.currentToken;switch(e){case b.QUOTATION_MARK:{this.state=x.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case b.NULL:{this._err(L.unexpectedNullCharacter),n.publicId+=Ce;break}case b.GREATER_THAN_SIGN:{this._err(L.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=x.DATA;break}case b.EOF:{this._err(L.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 b.APOSTROPHE:{this.state=x.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case b.NULL:{this._err(L.unexpectedNullCharacter),n.publicId+=Ce;break}case b.GREATER_THAN_SIGN:{this._err(L.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=x.DATA;break}case b.EOF:{this._err(L.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 b.SPACE:case b.LINE_FEED:case b.TABULATION:case b.FORM_FEED:{this.state=x.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case b.GREATER_THAN_SIGN:{this.state=x.DATA,this.emitCurrentDoctype(n);break}case b.QUOTATION_MARK:{this._err(L.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=x.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case b.APOSTROPHE:{this._err(L.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=x.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case b.EOF:{this._err(L.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(L.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=x.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){const n=this.currentToken;switch(e){case b.SPACE:case b.LINE_FEED:case b.TABULATION:case b.FORM_FEED:break;case b.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=x.DATA;break}case b.QUOTATION_MARK:{n.systemId="",this.state=x.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case b.APOSTROPHE:{n.systemId="",this.state=x.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case b.EOF:{this._err(L.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(L.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=x.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){const n=this.currentToken;switch(e){case b.SPACE:case b.LINE_FEED:case b.TABULATION:case b.FORM_FEED:{this.state=x.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case b.QUOTATION_MARK:{this._err(L.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=x.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case b.APOSTROPHE:{this._err(L.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=x.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case b.GREATER_THAN_SIGN:{this._err(L.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=x.DATA,this.emitCurrentDoctype(n);break}case b.EOF:{this._err(L.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(L.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=x.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){const n=this.currentToken;switch(e){case b.SPACE:case b.LINE_FEED:case b.TABULATION:case b.FORM_FEED:break;case b.QUOTATION_MARK:{n.systemId="",this.state=x.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case b.APOSTROPHE:{n.systemId="",this.state=x.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case b.GREATER_THAN_SIGN:{this._err(L.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=x.DATA,this.emitCurrentDoctype(n);break}case b.EOF:{this._err(L.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(L.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=x.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){const n=this.currentToken;switch(e){case b.QUOTATION_MARK:{this.state=x.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case b.NULL:{this._err(L.unexpectedNullCharacter),n.systemId+=Ce;break}case b.GREATER_THAN_SIGN:{this._err(L.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=x.DATA;break}case b.EOF:{this._err(L.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 b.APOSTROPHE:{this.state=x.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case b.NULL:{this._err(L.unexpectedNullCharacter),n.systemId+=Ce;break}case b.GREATER_THAN_SIGN:{this._err(L.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=x.DATA;break}case b.EOF:{this._err(L.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 b.SPACE:case b.LINE_FEED:case b.TABULATION:case b.FORM_FEED:break;case b.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=x.DATA;break}case b.EOF:{this._err(L.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(L.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=x.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){const n=this.currentToken;switch(e){case b.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=x.DATA;break}case b.NULL:{this._err(L.unexpectedNullCharacter);break}case b.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(e){switch(e){case b.RIGHT_SQUARE_BRACKET:{this.state=x.CDATA_SECTION_BRACKET;break}case b.EOF:{this._err(L.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===b.RIGHT_SQUARE_BRACKET?this.state=x.CDATA_SECTION_END:(this._emitChars("]"),this.state=x.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case b.GREATER_THAN_SIGN:{this.state=x.DATA;break}case b.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=x.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(b.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&Ws(this.preprocessor.peek(1))?x.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(e){Ws(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===b.SEMICOLON&&this._err(L.unknownNamedCharacterReference),this.state=this.returnState,this._callState(e))}}const pl=new Set([c.DD,c.DT,c.LI,c.OPTGROUP,c.OPTION,c.P,c.RB,c.RP,c.RT,c.RTC]),Gs=new Set([...pl,c.CAPTION,c.COLGROUP,c.TBODY,c.TD,c.TFOOT,c.TH,c.THEAD,c.TR]),Sr=new Set([c.APPLET,c.CAPTION,c.HTML,c.MARQUEE,c.OBJECT,c.TABLE,c.TD,c.TEMPLATE,c.TH]),iE=new Set([...Sr,c.OL,c.UL]),aE=new Set([...Sr,c.BUTTON]),Xs=new Set([c.ANNOTATION_XML,c.MI,c.MN,c.MO,c.MS,c.MTEXT]),Zs=new Set([c.DESC,c.FOREIGN_OBJECT,c.TITLE]),sE=new Set([c.TR,c.TEMPLATE,c.HTML]),uE=new Set([c.TBODY,c.TFOOT,c.THEAD,c.TEMPLATE,c.HTML]),oE=new Set([c.TABLE,c.TEMPLATE,c.HTML]),lE=new Set([c.TD,c.TH]);class cE{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=c.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===c.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===M.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])!==M.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(Ui,M.HTML)}popUntilTableCellPopped(){this.popUntilPopped(lE,M.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(oE,M.HTML)}clearBackToTableBodyContext(){this.clearBackTo(uE,M.HTML)}clearBackToTableRowContext(){this.clearBackTo(sE,M.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]===c.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]===c.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 M.HTML:{if(i===e)return!0;if(n.has(i))return!1;break}case M.SVG:{if(Zs.has(i))return!1;break}case M.MATHML:{if(Xs.has(i))return!1;break}}}return!0}hasInScope(e){return this.hasInDynamicScope(e,Sr)}hasInListItemScope(e){return this.hasInDynamicScope(e,iE)}hasInButtonScope(e){return this.hasInDynamicScope(e,aE)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){const n=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case M.HTML:{if(Ui.has(n))return!0;if(Sr.has(n))return!1;break}case M.SVG:{if(Zs.has(n))return!1;break}case M.MATHML:{if(Xs.has(n))return!1;break}}}return!0}hasInTableScope(e){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===M.HTML)switch(this.tagIDs[n]){case e:return!0;case c.TABLE:case c.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===M.HTML)switch(this.tagIDs[e]){case c.TBODY:case c.THEAD:case c.TFOOT:return!0;case c.TABLE:case c.HTML:return!1}return!0}hasInSelectScope(e){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===M.HTML)switch(this.tagIDs[n]){case e:return!0;case c.OPTION:case c.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&pl.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&Gs.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&Gs.has(this.currentTagId);)this.pop()}}const di=3;var ft;(function(t){t[t.Marker=0]="Marker",t[t.Element=1]="Element"})(ft||(ft={}));const Ks={type:ft.Marker};class dE{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,n){const r=[],i=n.length,a=this.treeAdapter.getTagName(e),s=this.treeAdapter.getNamespaceURI(e);for(let u=0;u<this.entries.length;u++){const o=this.entries[u];if(o.type===ft.Marker)break;const{element:l}=o;if(this.treeAdapter.getTagName(l)===a&&this.treeAdapter.getNamespaceURI(l)===s){const d=this.treeAdapter.getAttrList(l);d.length===i&&r.push({idx:u,attrs:d})}}return r}_ensureNoahArkCondition(e){if(this.entries.length<di)return;const n=this.treeAdapter.getAttrList(e),r=this._getNoahArkConditionCandidates(e,n);if(r.length<di)return;const i=new Map(n.map(s=>[s.name,s.value]));let a=0;for(let s=0;s<r.length;s++){const u=r[s];u.attrs.every(o=>i.get(o.name)===o.value)&&(a+=1,a>=di&&this.entries.splice(u.idx,1))}}insertMarker(){this.entries.unshift(Ks)}pushElement(e,n){this._ensureNoahArkCondition(e),this.entries.unshift({type:ft.Element,element:e,token:n})}insertElementAfterBookmark(e,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:ft.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(Ks);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){const n=this.entries.find(r=>r.type===ft.Marker||this.treeAdapter.getTagName(r.element)===e);return n&&n.type===ft.Element?n:null}getElementEntry(e){return this.entries.find(n=>n.type===ft.Element&&n.element===e)}}const Nt={createDocument(){return{nodeName:"#document",mode:nt.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(a=>a.nodeName==="#documentType");if(i)i.name=e,i.publicId=n,i.systemId=r;else{const a={nodeName:"#documentType",name:e,publicId:n,systemId:r,parentNode:null};Nt.appendChild(t,a)}},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(Nt.isTextNode(n)){n.value+=e;return}}Nt.appendChild(t,Nt.createTextNode(e))},insertTextBefore(t,e,n){const r=t.childNodes[t.childNodes.indexOf(n)-1];r&&Nt.isTextNode(r)?r.value+=e:Nt.insertBefore(t,Nt.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}}},ml="html",fE="about:legacy-compat",hE="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",gl=["+//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//"],pE=[...gl,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],mE=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),El=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],gE=[...El,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function Js(t,e){return e.some(n=>t.startsWith(n))}function EE(t){return t.name===ml&&t.publicId===null&&(t.systemId===null||t.systemId===fE)}function bE(t){if(t.name!==ml)return nt.QUIRKS;const{systemId:e}=t;if(e&&e.toLowerCase()===hE)return nt.QUIRKS;let{publicId:n}=t;if(n!==null){if(n=n.toLowerCase(),mE.has(n))return nt.QUIRKS;let r=e===null?pE:gl;if(Js(n,r))return nt.QUIRKS;if(r=e===null?El:gE,Js(n,r))return nt.LIMITED_QUIRKS}return nt.NO_QUIRKS}const eu={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},TE="definitionurl",xE="definitionURL",_E=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])),yE=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:M.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:M.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:M.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:M.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:M.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:M.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:M.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:M.XML}],["xml:space",{prefix:"xml",name:"space",namespace:M.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:M.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:M.XMLNS}]]),AE=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])),kE=new Set([c.B,c.BIG,c.BLOCKQUOTE,c.BODY,c.BR,c.CENTER,c.CODE,c.DD,c.DIV,c.DL,c.DT,c.EM,c.EMBED,c.H1,c.H2,c.H3,c.H4,c.H5,c.H6,c.HEAD,c.HR,c.I,c.IMG,c.LI,c.LISTING,c.MENU,c.META,c.NOBR,c.OL,c.P,c.PRE,c.RUBY,c.S,c.SMALL,c.SPAN,c.STRONG,c.STRIKE,c.SUB,c.SUP,c.TABLE,c.TT,c.U,c.UL,c.VAR]);function CE(t){const e=t.tagID;return e===c.FONT&&t.attrs.some(({name:r})=>r===$t.COLOR||r===$t.SIZE||r===$t.FACE)||kE.has(e)}function bl(t){for(let e=0;e<t.attrs.length;e++)if(t.attrs[e].name===TE){t.attrs[e].name=xE;break}}function Tl(t){for(let e=0;e<t.attrs.length;e++){const n=_E.get(t.attrs[e].name);n!=null&&(t.attrs[e].name=n)}}function xa(t){for(let e=0;e<t.attrs.length;e++){const n=yE.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 IE(t){const e=AE.get(t.tagName);e!=null&&(t.tagName=e,t.tagID=En(t.tagName))}function SE(t,e){return e===M.MATHML&&(t===c.MI||t===c.MO||t===c.MN||t===c.MS||t===c.MTEXT)}function NE(t,e,n){if(e===M.MATHML&&t===c.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===$t.ENCODING){const i=n[r].value.toLowerCase();return i===eu.TEXT_HTML||i===eu.APPLICATION_XML}}return e===M.SVG&&(t===c.FOREIGN_OBJECT||t===c.DESC||t===c.TITLE)}function wE(t,e,n,r){return(!r||r===M.HTML)&&NE(t,e,n)||(!r||r===M.MATHML)&&SE(t,e)}const RE="hidden",OE=8,LE=3;var A;(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"})(A||(A={}));const DE={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},xl=new Set([c.TABLE,c.TBODY,c.TFOOT,c.THEAD,c.TR]),tu={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:Nt,onParseError:null};class nu{constructor(e,n,r=null,i=null){this.fragmentContext=r,this.scriptHandler=i,this.currentToken=null,this.stopped=!1,this.insertionMode=A.INITIAL,this.originalInsertionMode=A.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={...tu,...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 rE(this.options,this),this.activeFormattingElements=new dE(this.treeAdapter),this.fragmentContextID=r?En(this.treeAdapter.getTagName(r)):c.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new cE(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={...tu,...n};e??(e=r.treeAdapter.createElement(w.TEMPLATE,M.HTML,[]));const i=r.treeAdapter.createElement("documentmock",M.HTML,[]),a=new this(r,i,e);return a.fragmentContextID===c.TEMPLATE&&a.tmplInsertionModeStack.unshift(A.IN_TEMPLATE),a._initTokenizerForFragmentParsing(),a._insertFakeRootElement(),a._resetInsertionMode(),a._findFormInFragmentContext(),a}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 a=(i=e.location)!==null&&i!==void 0?i:DE,s={code:n,startLine:a.startLine,startCol:a.startCol,startOffset:a.startOffset,endLine:r?a.startLine:a.endLine,endCol:r?a.startCol:a.endCol,endOffset:r?a.startOffset:a.endOffset};this.onParseError(s)}onItemPush(e,n,r){var i,a;(a=(i=this.treeAdapter).onItemPush)===null||a===void 0||a.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 a,s;this.openElements.stackTop===0&&this.fragmentContext?(a=this.fragmentContext,s=this.fragmentContextID):{current:a,currentTagId:s}=this.openElements,this._setContextModes(a,s)}}_setContextModes(e,n){const r=e===this.document||e&&this.treeAdapter.getNamespaceURI(e)===M.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&e!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,e)}_switchToTextParsing(e,n){this._insertElement(e,M.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=A.TEXT}switchToPlaintextParsing(){this.insertionMode=A.TEXT,this.originalInsertionMode=A.IN_BODY,this.tokenizer.state=Re.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)===w.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==M.HTML))switch(this.fragmentContextID){case c.TITLE:case c.TEXTAREA:{this.tokenizer.state=Re.RCDATA;break}case c.STYLE:case c.XMP:case c.IFRAME:case c.NOEMBED:case c.NOFRAMES:case c.NOSCRIPT:{this.tokenizer.state=Re.RAWTEXT;break}case c.SCRIPT:{this.tokenizer.state=Re.SCRIPT_DATA;break}case c.PLAINTEXT:{this.tokenizer.state=Re.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 s=this.treeAdapter.getChildNodes(this.document).find(u=>this.treeAdapter.isDocumentTypeNode(u));s&&this.treeAdapter.setNodeSourceCodeLocation(s,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,M.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(e){const n=this.treeAdapter.createElement(e.tagName,M.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(w.HTML,M.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,c.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),a=r?i.lastIndexOf(r):i.length,s=i[a-1];if(this.treeAdapter.getNodeSourceCodeLocation(s)){const{endLine:o,endCol:l,endOffset:d}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(s,{endLine:o,endCol:l,endOffset:d})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(s,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),a=n.type===re.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,a)}}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===c.SVG&&this.treeAdapter.getTagName(n)===w.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===M.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===c.MGLYPH||e.tagID===c.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,M.HTML)}_processToken(e){switch(e.type){case re.CHARACTER:{this.onCharacter(e);break}case re.NULL_CHARACTER:{this.onNullCharacter(e);break}case re.COMMENT:{this.onComment(e);break}case re.DOCTYPE:{this.onDoctype(e);break}case re.START_TAG:{this._processStartTag(e);break}case re.END_TAG:{this.onEndTag(e);break}case re.EOF:{this.onEof(e);break}case re.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(e);break}}}_isIntegrationPoint(e,n,r){const i=this.treeAdapter.getNamespaceURI(n),a=this.treeAdapter.getAttrList(n);return wE(e,i,a,r)}_reconstructActiveFormattingElements(){const e=this.activeFormattingElements.entries.length;if(e){const n=this.activeFormattingElements.entries.findIndex(i=>i.type===ft.Marker||this.openElements.contains(i.element)),r=n===-1?e-1:n-1;for(let i=r;i>=0;i--){const a=this.activeFormattingElements.entries[i];this._insertElement(a.token,this.treeAdapter.getNamespaceURI(a.element)),a.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=A.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(c.P),this.openElements.popUntilTagNamePopped(c.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case c.TR:{this.insertionMode=A.IN_ROW;return}case c.TBODY:case c.THEAD:case c.TFOOT:{this.insertionMode=A.IN_TABLE_BODY;return}case c.CAPTION:{this.insertionMode=A.IN_CAPTION;return}case c.COLGROUP:{this.insertionMode=A.IN_COLUMN_GROUP;return}case c.TABLE:{this.insertionMode=A.IN_TABLE;return}case c.BODY:{this.insertionMode=A.IN_BODY;return}case c.FRAMESET:{this.insertionMode=A.IN_FRAMESET;return}case c.SELECT:{this._resetInsertionModeForSelect(e);return}case c.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case c.HTML:{this.insertionMode=this.headElement?A.AFTER_HEAD:A.BEFORE_HEAD;return}case c.TD:case c.TH:{if(e>0){this.insertionMode=A.IN_CELL;return}break}case c.HEAD:{if(e>0){this.insertionMode=A.IN_HEAD;return}break}}this.insertionMode=A.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let n=e-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===c.TEMPLATE)break;if(r===c.TABLE){this.insertionMode=A.IN_SELECT_IN_TABLE;return}}this.insertionMode=A.IN_SELECT}_isElementCausesFosterParenting(e){return xl.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 c.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===M.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case c.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 Jg[r].has(n)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){l2(this,e);return}switch(this.insertionMode){case A.INITIAL:{Sn(this,e);break}case A.BEFORE_HTML:{Fn(this,e);break}case A.BEFORE_HEAD:{Un(this,e);break}case A.IN_HEAD:{Hn(this,e);break}case A.IN_HEAD_NO_SCRIPT:{jn(this,e);break}case A.AFTER_HEAD:{zn(this,e);break}case A.IN_BODY:case A.IN_CAPTION:case A.IN_CELL:case A.IN_TEMPLATE:{yl(this,e);break}case A.TEXT:case A.IN_SELECT:case A.IN_SELECT_IN_TABLE:{this._insertCharacters(e);break}case A.IN_TABLE:case A.IN_TABLE_BODY:case A.IN_ROW:{fi(this,e);break}case A.IN_TABLE_TEXT:{Nl(this,e);break}case A.IN_COLUMN_GROUP:{Nr(this,e);break}case A.AFTER_BODY:{wr(this,e);break}case A.AFTER_AFTER_BODY:{Tr(this,e);break}}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){o2(this,e);return}switch(this.insertionMode){case A.INITIAL:{Sn(this,e);break}case A.BEFORE_HTML:{Fn(this,e);break}case A.BEFORE_HEAD:{Un(this,e);break}case A.IN_HEAD:{Hn(this,e);break}case A.IN_HEAD_NO_SCRIPT:{jn(this,e);break}case A.AFTER_HEAD:{zn(this,e);break}case A.TEXT:{this._insertCharacters(e);break}case A.IN_TABLE:case A.IN_TABLE_BODY:case A.IN_ROW:{fi(this,e);break}case A.IN_COLUMN_GROUP:{Nr(this,e);break}case A.AFTER_BODY:{wr(this,e);break}case A.AFTER_AFTER_BODY:{Tr(this,e);break}}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){Hi(this,e);return}switch(this.insertionMode){case A.INITIAL:case A.BEFORE_HTML:case A.BEFORE_HEAD:case A.IN_HEAD:case A.IN_HEAD_NO_SCRIPT:case A.AFTER_HEAD:case A.IN_BODY:case A.IN_TABLE:case A.IN_CAPTION:case A.IN_COLUMN_GROUP:case A.IN_TABLE_BODY:case A.IN_ROW:case A.IN_CELL:case A.IN_SELECT:case A.IN_SELECT_IN_TABLE:case A.IN_TEMPLATE:case A.IN_FRAMESET:case A.AFTER_FRAMESET:{Hi(this,e);break}case A.IN_TABLE_TEXT:{Nn(this,e);break}case A.AFTER_BODY:{HE(this,e);break}case A.AFTER_AFTER_BODY:case A.AFTER_AFTER_FRAMESET:{jE(this,e);break}}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case A.INITIAL:{zE(this,e);break}case A.BEFORE_HEAD:case A.IN_HEAD:case A.IN_HEAD_NO_SCRIPT:case A.AFTER_HEAD:{this._err(e,L.misplacedDoctype);break}case A.IN_TABLE_TEXT:{Nn(this,e);break}}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,L.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?c2(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case A.INITIAL:{Sn(this,e);break}case A.BEFORE_HTML:{$E(this,e);break}case A.BEFORE_HEAD:{qE(this,e);break}case A.IN_HEAD:{ut(this,e);break}case A.IN_HEAD_NO_SCRIPT:{QE(this,e);break}case A.AFTER_HEAD:{XE(this,e);break}case A.IN_BODY:{Ue(this,e);break}case A.IN_TABLE:{cn(this,e);break}case A.IN_TABLE_TEXT:{Nn(this,e);break}case A.IN_CAPTION:{Vb(this,e);break}case A.IN_COLUMN_GROUP:{Aa(this,e);break}case A.IN_TABLE_BODY:{Vr(this,e);break}case A.IN_ROW:{Wr(this,e);break}case A.IN_CELL:{Gb(this,e);break}case A.IN_SELECT:{Ol(this,e);break}case A.IN_SELECT_IN_TABLE:{Zb(this,e);break}case A.IN_TEMPLATE:{Jb(this,e);break}case A.AFTER_BODY:{t2(this,e);break}case A.IN_FRAMESET:{n2(this,e);break}case A.AFTER_FRAMESET:{i2(this,e);break}case A.AFTER_AFTER_BODY:{s2(this,e);break}case A.AFTER_AFTER_FRAMESET:{u2(this,e);break}}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?d2(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case A.INITIAL:{Sn(this,e);break}case A.BEFORE_HTML:{YE(this,e);break}case A.BEFORE_HEAD:{VE(this,e);break}case A.IN_HEAD:{WE(this,e);break}case A.IN_HEAD_NO_SCRIPT:{GE(this,e);break}case A.AFTER_HEAD:{ZE(this,e);break}case A.IN_BODY:{qr(this,e);break}case A.TEXT:{Mb(this,e);break}case A.IN_TABLE:{Gn(this,e);break}case A.IN_TABLE_TEXT:{Nn(this,e);break}case A.IN_CAPTION:{Wb(this,e);break}case A.IN_COLUMN_GROUP:{Qb(this,e);break}case A.IN_TABLE_BODY:{ji(this,e);break}case A.IN_ROW:{Rl(this,e);break}case A.IN_CELL:{Xb(this,e);break}case A.IN_SELECT:{Ll(this,e);break}case A.IN_SELECT_IN_TABLE:{Kb(this,e);break}case A.IN_TEMPLATE:{e2(this,e);break}case A.AFTER_BODY:{vl(this,e);break}case A.IN_FRAMESET:{r2(this,e);break}case A.AFTER_FRAMESET:{a2(this,e);break}case A.AFTER_AFTER_BODY:{Tr(this,e);break}}}onEof(e){switch(this.insertionMode){case A.INITIAL:{Sn(this,e);break}case A.BEFORE_HTML:{Fn(this,e);break}case A.BEFORE_HEAD:{Un(this,e);break}case A.IN_HEAD:{Hn(this,e);break}case A.IN_HEAD_NO_SCRIPT:{jn(this,e);break}case A.AFTER_HEAD:{zn(this,e);break}case A.IN_BODY:case A.IN_TABLE:case A.IN_CAPTION:case A.IN_COLUMN_GROUP:case A.IN_TABLE_BODY:case A.IN_ROW:case A.IN_CELL:case A.IN_SELECT:case A.IN_SELECT_IN_TABLE:{Il(this,e);break}case A.TEXT:{Bb(this,e);break}case A.IN_TABLE_TEXT:{Nn(this,e);break}case A.IN_TEMPLATE:{Dl(this,e);break}case A.AFTER_BODY:case A.IN_FRAMESET:case A.AFTER_FRAMESET:case A.AFTER_AFTER_BODY:case A.AFTER_AFTER_FRAMESET:{ya(this,e);break}}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===b.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 A.IN_HEAD:case A.IN_HEAD_NO_SCRIPT:case A.AFTER_HEAD:case A.TEXT:case A.IN_COLUMN_GROUP:case A.IN_SELECT:case A.IN_SELECT_IN_TABLE:case A.IN_FRAMESET:case A.AFTER_FRAMESET:{this._insertCharacters(e);break}case A.IN_BODY:case A.IN_CAPTION:case A.IN_CELL:case A.IN_TEMPLATE:case A.AFTER_BODY:case A.AFTER_AFTER_BODY:case A.AFTER_AFTER_FRAMESET:{_l(this,e);break}case A.IN_TABLE:case A.IN_TABLE_BODY:case A.IN_ROW:{fi(this,e);break}case A.IN_TABLE_TEXT:{Sl(this,e);break}}}}function vE(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):Cl(t,e),n}function PE(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 ME(t,e,n){let r=e,i=t.openElements.getCommonAncestor(e);for(let a=0,s=i;s!==n;a++,s=i){i=t.openElements.getCommonAncestor(s);const u=t.activeFormattingElements.getElementEntry(s),o=u&&a>=LE;!u||o?(o&&t.activeFormattingElements.removeEntry(u),t.openElements.remove(s)):(s=BE(t,u),r===e&&(t.activeFormattingElements.bookmark=u),t.treeAdapter.detachNode(r),t.treeAdapter.appendChild(s,r),r=s)}return r}function BE(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 FE(t,e,n){const r=t.treeAdapter.getTagName(e),i=En(r);if(t._isElementCausesFosterParenting(i))t._fosterParentElement(n);else{const a=t.treeAdapter.getNamespaceURI(e);i===c.TEMPLATE&&a===M.HTML&&(e=t.treeAdapter.getTemplateContent(e)),t.treeAdapter.appendChild(e,n)}}function UE(t,e,n){const r=t.treeAdapter.getNamespaceURI(n.element),{token:i}=n,a=t.treeAdapter.createElement(i.tagName,r,i.attrs);t._adoptNodes(e,a),t.treeAdapter.appendChild(e,a),t.activeFormattingElements.insertElementAfterBookmark(a,i),t.activeFormattingElements.removeEntry(n),t.openElements.remove(n.element),t.openElements.insertAfter(e,a,i.tagID)}function _a(t,e){for(let n=0;n<OE;n++){const r=vE(t,e);if(!r)break;const i=PE(t,r);if(!i)break;t.activeFormattingElements.bookmark=r;const a=ME(t,i,r.element),s=t.openElements.getCommonAncestor(r.element);t.treeAdapter.detachNode(a),s&&FE(t,s,a),UE(t,i,r)}}function Hi(t,e){t._appendCommentNode(e,t.openElements.currentTmplContentOrNode)}function HE(t,e){t._appendCommentNode(e,t.openElements.items[0])}function jE(t,e){t._appendCommentNode(e,t.document)}function ya(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 a=t.openElements.items[1],s=t.treeAdapter.getNodeSourceCodeLocation(a);s&&!s.endTag&&t._setEndLocation(a,e)}}}}function zE(t,e){t._setDocumentType(e);const n=e.forceQuirks?nt.QUIRKS:bE(e);EE(e)||t._err(e,L.nonConformingDoctype),t.treeAdapter.setDocumentMode(t.document,n),t.insertionMode=A.BEFORE_HTML}function Sn(t,e){t._err(e,L.missingDoctype,!0),t.treeAdapter.setDocumentMode(t.document,nt.QUIRKS),t.insertionMode=A.BEFORE_HTML,t._processToken(e)}function $E(t,e){e.tagID===c.HTML?(t._insertElement(e,M.HTML),t.insertionMode=A.BEFORE_HEAD):Fn(t,e)}function YE(t,e){const n=e.tagID;(n===c.HTML||n===c.HEAD||n===c.BODY||n===c.BR)&&Fn(t,e)}function Fn(t,e){t._insertFakeRootElement(),t.insertionMode=A.BEFORE_HEAD,t._processToken(e)}function qE(t,e){switch(e.tagID){case c.HTML:{Ue(t,e);break}case c.HEAD:{t._insertElement(e,M.HTML),t.headElement=t.openElements.current,t.insertionMode=A.IN_HEAD;break}default:Un(t,e)}}function VE(t,e){const n=e.tagID;n===c.HEAD||n===c.BODY||n===c.HTML||n===c.BR?Un(t,e):t._err(e,L.endTagWithoutMatchingOpenElement)}function Un(t,e){t._insertFakeElement(w.HEAD,c.HEAD),t.headElement=t.openElements.current,t.insertionMode=A.IN_HEAD,t._processToken(e)}function ut(t,e){switch(e.tagID){case c.HTML:{Ue(t,e);break}case c.BASE:case c.BASEFONT:case c.BGSOUND:case c.LINK:case c.META:{t._appendElement(e,M.HTML),e.ackSelfClosing=!0;break}case c.TITLE:{t._switchToTextParsing(e,Re.RCDATA);break}case c.NOSCRIPT:{t.options.scriptingEnabled?t._switchToTextParsing(e,Re.RAWTEXT):(t._insertElement(e,M.HTML),t.insertionMode=A.IN_HEAD_NO_SCRIPT);break}case c.NOFRAMES:case c.STYLE:{t._switchToTextParsing(e,Re.RAWTEXT);break}case c.SCRIPT:{t._switchToTextParsing(e,Re.SCRIPT_DATA);break}case c.TEMPLATE:{t._insertTemplate(e),t.activeFormattingElements.insertMarker(),t.framesetOk=!1,t.insertionMode=A.IN_TEMPLATE,t.tmplInsertionModeStack.unshift(A.IN_TEMPLATE);break}case c.HEAD:{t._err(e,L.misplacedStartTagForHeadElement);break}default:Hn(t,e)}}function WE(t,e){switch(e.tagID){case c.HEAD:{t.openElements.pop(),t.insertionMode=A.AFTER_HEAD;break}case c.BODY:case c.BR:case c.HTML:{Hn(t,e);break}case c.TEMPLATE:{Xt(t,e);break}default:t._err(e,L.endTagWithoutMatchingOpenElement)}}function Xt(t,e){t.openElements.tmplCount>0?(t.openElements.generateImpliedEndTagsThoroughly(),t.openElements.currentTagId!==c.TEMPLATE&&t._err(e,L.closingOfElementWithOpenChildElements),t.openElements.popUntilTagNamePopped(c.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode()):t._err(e,L.endTagWithoutMatchingOpenElement)}function Hn(t,e){t.openElements.pop(),t.insertionMode=A.AFTER_HEAD,t._processToken(e)}function QE(t,e){switch(e.tagID){case c.HTML:{Ue(t,e);break}case c.BASEFONT:case c.BGSOUND:case c.HEAD:case c.LINK:case c.META:case c.NOFRAMES:case c.STYLE:{ut(t,e);break}case c.NOSCRIPT:{t._err(e,L.nestedNoscriptInHead);break}default:jn(t,e)}}function GE(t,e){switch(e.tagID){case c.NOSCRIPT:{t.openElements.pop(),t.insertionMode=A.IN_HEAD;break}case c.BR:{jn(t,e);break}default:t._err(e,L.endTagWithoutMatchingOpenElement)}}function jn(t,e){const n=e.type===re.EOF?L.openElementsLeftAfterEof:L.disallowedContentInNoscriptInHead;t._err(e,n),t.openElements.pop(),t.insertionMode=A.IN_HEAD,t._processToken(e)}function XE(t,e){switch(e.tagID){case c.HTML:{Ue(t,e);break}case c.BODY:{t._insertElement(e,M.HTML),t.framesetOk=!1,t.insertionMode=A.IN_BODY;break}case c.FRAMESET:{t._insertElement(e,M.HTML),t.insertionMode=A.IN_FRAMESET;break}case c.BASE:case c.BASEFONT:case c.BGSOUND:case c.LINK:case c.META:case c.NOFRAMES:case c.SCRIPT:case c.STYLE:case c.TEMPLATE:case c.TITLE:{t._err(e,L.abandonedHeadElementChild),t.openElements.push(t.headElement,c.HEAD),ut(t,e),t.openElements.remove(t.headElement);break}case c.HEAD:{t._err(e,L.misplacedStartTagForHeadElement);break}default:zn(t,e)}}function ZE(t,e){switch(e.tagID){case c.BODY:case c.HTML:case c.BR:{zn(t,e);break}case c.TEMPLATE:{Xt(t,e);break}default:t._err(e,L.endTagWithoutMatchingOpenElement)}}function zn(t,e){t._insertFakeElement(w.BODY,c.BODY),t.insertionMode=A.IN_BODY,Yr(t,e)}function Yr(t,e){switch(e.type){case re.CHARACTER:{yl(t,e);break}case re.WHITESPACE_CHARACTER:{_l(t,e);break}case re.COMMENT:{Hi(t,e);break}case re.START_TAG:{Ue(t,e);break}case re.END_TAG:{qr(t,e);break}case re.EOF:{Il(t,e);break}}}function _l(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e)}function yl(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e),t.framesetOk=!1}function KE(t,e){t.openElements.tmplCount===0&&t.treeAdapter.adoptAttributes(t.openElements.items[0],e.attrs)}function JE(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t.openElements.tmplCount===0&&(t.framesetOk=!1,t.treeAdapter.adoptAttributes(n,e.attrs))}function eb(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();t.framesetOk&&n&&(t.treeAdapter.detachNode(n),t.openElements.popAllUpToHtmlElement(),t._insertElement(e,M.HTML),t.insertionMode=A.IN_FRAMESET)}function tb(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,M.HTML)}function nb(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t.openElements.currentTagId!==void 0&&Ui.has(t.openElements.currentTagId)&&t.openElements.pop(),t._insertElement(e,M.HTML)}function rb(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,M.HTML),t.skipNextNewLine=!0,t.framesetOk=!1}function ib(t,e){const n=t.openElements.tmplCount>0;(!t.formElement||n)&&(t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,M.HTML),n||(t.formElement=t.openElements.current))}function ab(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===c.LI&&i===c.LI||(n===c.DD||n===c.DT)&&(i===c.DD||i===c.DT)){t.openElements.generateImpliedEndTagsWithExclusion(i),t.openElements.popUntilTagNamePopped(i);break}if(i!==c.ADDRESS&&i!==c.DIV&&i!==c.P&&t._isSpecialElement(t.openElements.items[r],i))break}t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,M.HTML)}function sb(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,M.HTML),t.tokenizer.state=Re.PLAINTEXT}function ub(t,e){t.openElements.hasInScope(c.BUTTON)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(c.BUTTON)),t._reconstructActiveFormattingElements(),t._insertElement(e,M.HTML),t.framesetOk=!1}function ob(t,e){const n=t.activeFormattingElements.getElementEntryInScopeWithTagName(w.A);n&&(_a(t,e),t.openElements.remove(n.element),t.activeFormattingElements.removeEntry(n)),t._reconstructActiveFormattingElements(),t._insertElement(e,M.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function lb(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,M.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function cb(t,e){t._reconstructActiveFormattingElements(),t.openElements.hasInScope(c.NOBR)&&(_a(t,e),t._reconstructActiveFormattingElements()),t._insertElement(e,M.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function db(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,M.HTML),t.activeFormattingElements.insertMarker(),t.framesetOk=!1}function fb(t,e){t.treeAdapter.getDocumentMode(t.document)!==nt.QUIRKS&&t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,M.HTML),t.framesetOk=!1,t.insertionMode=A.IN_TABLE}function Al(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,M.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function kl(t){const e=fl(t,$t.TYPE);return e!=null&&e.toLowerCase()===RE}function hb(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,M.HTML),kl(e)||(t.framesetOk=!1),e.ackSelfClosing=!0}function pb(t,e){t._appendElement(e,M.HTML),e.ackSelfClosing=!0}function mb(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._appendElement(e,M.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function gb(t,e){e.tagName=w.IMG,e.tagID=c.IMG,Al(t,e)}function Eb(t,e){t._insertElement(e,M.HTML),t.skipNextNewLine=!0,t.tokenizer.state=Re.RCDATA,t.originalInsertionMode=t.insertionMode,t.framesetOk=!1,t.insertionMode=A.TEXT}function bb(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._reconstructActiveFormattingElements(),t.framesetOk=!1,t._switchToTextParsing(e,Re.RAWTEXT)}function Tb(t,e){t.framesetOk=!1,t._switchToTextParsing(e,Re.RAWTEXT)}function ru(t,e){t._switchToTextParsing(e,Re.RAWTEXT)}function xb(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,M.HTML),t.framesetOk=!1,t.insertionMode=t.insertionMode===A.IN_TABLE||t.insertionMode===A.IN_CAPTION||t.insertionMode===A.IN_TABLE_BODY||t.insertionMode===A.IN_ROW||t.insertionMode===A.IN_CELL?A.IN_SELECT_IN_TABLE:A.IN_SELECT}function _b(t,e){t.openElements.currentTagId===c.OPTION&&t.openElements.pop(),t._reconstructActiveFormattingElements(),t._insertElement(e,M.HTML)}function yb(t,e){t.openElements.hasInScope(c.RUBY)&&t.openElements.generateImpliedEndTags(),t._insertElement(e,M.HTML)}function Ab(t,e){t.openElements.hasInScope(c.RUBY)&&t.openElements.generateImpliedEndTagsWithExclusion(c.RTC),t._insertElement(e,M.HTML)}function kb(t,e){t._reconstructActiveFormattingElements(),bl(e),xa(e),e.selfClosing?t._appendElement(e,M.MATHML):t._insertElement(e,M.MATHML),e.ackSelfClosing=!0}function Cb(t,e){t._reconstructActiveFormattingElements(),Tl(e),xa(e),e.selfClosing?t._appendElement(e,M.SVG):t._insertElement(e,M.SVG),e.ackSelfClosing=!0}function iu(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,M.HTML)}function Ue(t,e){switch(e.tagID){case c.I:case c.S:case c.B:case c.U:case c.EM:case c.TT:case c.BIG:case c.CODE:case c.FONT:case c.SMALL:case c.STRIKE:case c.STRONG:{lb(t,e);break}case c.A:{ob(t,e);break}case c.H1:case c.H2:case c.H3:case c.H4:case c.H5:case c.H6:{nb(t,e);break}case c.P:case c.DL:case c.OL:case c.UL:case c.DIV:case c.DIR:case c.NAV:case c.MAIN:case c.MENU:case c.ASIDE:case c.CENTER:case c.FIGURE:case c.FOOTER:case c.HEADER:case c.HGROUP:case c.DIALOG:case c.DETAILS:case c.ADDRESS:case c.ARTICLE:case c.SEARCH:case c.SECTION:case c.SUMMARY:case c.FIELDSET:case c.BLOCKQUOTE:case c.FIGCAPTION:{tb(t,e);break}case c.LI:case c.DD:case c.DT:{ab(t,e);break}case c.BR:case c.IMG:case c.WBR:case c.AREA:case c.EMBED:case c.KEYGEN:{Al(t,e);break}case c.HR:{mb(t,e);break}case c.RB:case c.RTC:{yb(t,e);break}case c.RT:case c.RP:{Ab(t,e);break}case c.PRE:case c.LISTING:{rb(t,e);break}case c.XMP:{bb(t,e);break}case c.SVG:{Cb(t,e);break}case c.HTML:{KE(t,e);break}case c.BASE:case c.LINK:case c.META:case c.STYLE:case c.TITLE:case c.SCRIPT:case c.BGSOUND:case c.BASEFONT:case c.TEMPLATE:{ut(t,e);break}case c.BODY:{JE(t,e);break}case c.FORM:{ib(t,e);break}case c.NOBR:{cb(t,e);break}case c.MATH:{kb(t,e);break}case c.TABLE:{fb(t,e);break}case c.INPUT:{hb(t,e);break}case c.PARAM:case c.TRACK:case c.SOURCE:{pb(t,e);break}case c.IMAGE:{gb(t,e);break}case c.BUTTON:{ub(t,e);break}case c.APPLET:case c.OBJECT:case c.MARQUEE:{db(t,e);break}case c.IFRAME:{Tb(t,e);break}case c.SELECT:{xb(t,e);break}case c.OPTION:case c.OPTGROUP:{_b(t,e);break}case c.NOEMBED:case c.NOFRAMES:{ru(t,e);break}case c.FRAMESET:{eb(t,e);break}case c.TEXTAREA:{Eb(t,e);break}case c.NOSCRIPT:{t.options.scriptingEnabled?ru(t,e):iu(t,e);break}case c.PLAINTEXT:{sb(t,e);break}case c.COL:case c.TH:case c.TD:case c.TR:case c.HEAD:case c.FRAME:case c.TBODY:case c.TFOOT:case c.THEAD:case c.CAPTION:case c.COLGROUP:break;default:iu(t,e)}}function Ib(t,e){if(t.openElements.hasInScope(c.BODY)&&(t.insertionMode=A.AFTER_BODY,t.options.sourceCodeLocationInfo)){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t._setEndLocation(n,e)}}function Sb(t,e){t.openElements.hasInScope(c.BODY)&&(t.insertionMode=A.AFTER_BODY,vl(t,e))}function Nb(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n))}function wb(t){const e=t.openElements.tmplCount>0,{formElement:n}=t;e||(t.formElement=null),(n||e)&&t.openElements.hasInScope(c.FORM)&&(t.openElements.generateImpliedEndTags(),e?t.openElements.popUntilTagNamePopped(c.FORM):n&&t.openElements.remove(n))}function Rb(t){t.openElements.hasInButtonScope(c.P)||t._insertFakeElement(w.P,c.P),t._closePElement()}function Ob(t){t.openElements.hasInListItemScope(c.LI)&&(t.openElements.generateImpliedEndTagsWithExclusion(c.LI),t.openElements.popUntilTagNamePopped(c.LI))}function Lb(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTagsWithExclusion(n),t.openElements.popUntilTagNamePopped(n))}function Db(t){t.openElements.hasNumberedHeaderInScope()&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilNumberedHeaderPopped())}function vb(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker())}function Pb(t){t._reconstructActiveFormattingElements(),t._insertFakeElement(w.BR,c.BR),t.openElements.pop(),t.framesetOk=!1}function Cl(t,e){const n=e.tagName,r=e.tagID;for(let i=t.openElements.stackTop;i>0;i--){const a=t.openElements.items[i],s=t.openElements.tagIDs[i];if(r===s&&(r!==c.UNKNOWN||t.treeAdapter.getTagName(a)===n)){t.openElements.generateImpliedEndTagsWithExclusion(r),t.openElements.stackTop>=i&&t.openElements.shortenToLength(i);break}if(t._isSpecialElement(a,s))break}}function qr(t,e){switch(e.tagID){case c.A:case c.B:case c.I:case c.S:case c.U:case c.EM:case c.TT:case c.BIG:case c.CODE:case c.FONT:case c.NOBR:case c.SMALL:case c.STRIKE:case c.STRONG:{_a(t,e);break}case c.P:{Rb(t);break}case c.DL:case c.UL:case c.OL:case c.DIR:case c.DIV:case c.NAV:case c.PRE:case c.MAIN:case c.MENU:case c.ASIDE:case c.BUTTON:case c.CENTER:case c.FIGURE:case c.FOOTER:case c.HEADER:case c.HGROUP:case c.DIALOG:case c.ADDRESS:case c.ARTICLE:case c.DETAILS:case c.SEARCH:case c.SECTION:case c.SUMMARY:case c.LISTING:case c.FIELDSET:case c.BLOCKQUOTE:case c.FIGCAPTION:{Nb(t,e);break}case c.LI:{Ob(t);break}case c.DD:case c.DT:{Lb(t,e);break}case c.H1:case c.H2:case c.H3:case c.H4:case c.H5:case c.H6:{Db(t);break}case c.BR:{Pb(t);break}case c.BODY:{Ib(t,e);break}case c.HTML:{Sb(t,e);break}case c.FORM:{wb(t);break}case c.APPLET:case c.OBJECT:case c.MARQUEE:{vb(t,e);break}case c.TEMPLATE:{Xt(t,e);break}default:Cl(t,e)}}function Il(t,e){t.tmplInsertionModeStack.length>0?Dl(t,e):ya(t,e)}function Mb(t,e){var n;e.tagID===c.SCRIPT&&((n=t.scriptHandler)===null||n===void 0||n.call(t,t.openElements.current)),t.openElements.pop(),t.insertionMode=t.originalInsertionMode}function Bb(t,e){t._err(e,L.eofInElementThatCanContainOnlyText),t.openElements.pop(),t.insertionMode=t.originalInsertionMode,t.onEof(e)}function fi(t,e){if(t.openElements.currentTagId!==void 0&&xl.has(t.openElements.currentTagId))switch(t.pendingCharacterTokens.length=0,t.hasNonWhitespacePendingCharacterToken=!1,t.originalInsertionMode=t.insertionMode,t.insertionMode=A.IN_TABLE_TEXT,e.type){case re.CHARACTER:{Nl(t,e);break}case re.WHITESPACE_CHARACTER:{Sl(t,e);break}}else ar(t,e)}function Fb(t,e){t.openElements.clearBackToTableContext(),t.activeFormattingElements.insertMarker(),t._insertElement(e,M.HTML),t.insertionMode=A.IN_CAPTION}function Ub(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,M.HTML),t.insertionMode=A.IN_COLUMN_GROUP}function Hb(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(w.COLGROUP,c.COLGROUP),t.insertionMode=A.IN_COLUMN_GROUP,Aa(t,e)}function jb(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,M.HTML),t.insertionMode=A.IN_TABLE_BODY}function zb(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(w.TBODY,c.TBODY),t.insertionMode=A.IN_TABLE_BODY,Vr(t,e)}function $b(t,e){t.openElements.hasInTableScope(c.TABLE)&&(t.openElements.popUntilTagNamePopped(c.TABLE),t._resetInsertionMode(),t._processStartTag(e))}function Yb(t,e){kl(e)?t._appendElement(e,M.HTML):ar(t,e),e.ackSelfClosing=!0}function qb(t,e){!t.formElement&&t.openElements.tmplCount===0&&(t._insertElement(e,M.HTML),t.formElement=t.openElements.current,t.openElements.pop())}function cn(t,e){switch(e.tagID){case c.TD:case c.TH:case c.TR:{zb(t,e);break}case c.STYLE:case c.SCRIPT:case c.TEMPLATE:{ut(t,e);break}case c.COL:{Hb(t,e);break}case c.FORM:{qb(t,e);break}case c.TABLE:{$b(t,e);break}case c.TBODY:case c.TFOOT:case c.THEAD:{jb(t,e);break}case c.INPUT:{Yb(t,e);break}case c.CAPTION:{Fb(t,e);break}case c.COLGROUP:{Ub(t,e);break}default:ar(t,e)}}function Gn(t,e){switch(e.tagID){case c.TABLE:{t.openElements.hasInTableScope(c.TABLE)&&(t.openElements.popUntilTagNamePopped(c.TABLE),t._resetInsertionMode());break}case c.TEMPLATE:{Xt(t,e);break}case c.BODY:case c.CAPTION:case c.COL:case c.COLGROUP:case c.HTML:case c.TBODY:case c.TD:case c.TFOOT:case c.TH:case c.THEAD:case c.TR:break;default:ar(t,e)}}function ar(t,e){const n=t.fosterParentingEnabled;t.fosterParentingEnabled=!0,Yr(t,e),t.fosterParentingEnabled=n}function Sl(t,e){t.pendingCharacterTokens.push(e)}function Nl(t,e){t.pendingCharacterTokens.push(e),t.hasNonWhitespacePendingCharacterToken=!0}function Nn(t,e){let n=0;if(t.hasNonWhitespacePendingCharacterToken)for(;n<t.pendingCharacterTokens.length;n++)ar(t,t.pendingCharacterTokens[n]);else for(;n<t.pendingCharacterTokens.length;n++)t._insertCharacters(t.pendingCharacterTokens[n]);t.insertionMode=t.originalInsertionMode,t._processToken(e)}const wl=new Set([c.CAPTION,c.COL,c.COLGROUP,c.TBODY,c.TD,c.TFOOT,c.TH,c.THEAD,c.TR]);function Vb(t,e){const n=e.tagID;wl.has(n)?t.openElements.hasInTableScope(c.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(c.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=A.IN_TABLE,cn(t,e)):Ue(t,e)}function Wb(t,e){const n=e.tagID;switch(n){case c.CAPTION:case c.TABLE:{t.openElements.hasInTableScope(c.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(c.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=A.IN_TABLE,n===c.TABLE&&Gn(t,e));break}case c.BODY:case c.COL:case c.COLGROUP:case c.HTML:case c.TBODY:case c.TD:case c.TFOOT:case c.TH:case c.THEAD:case c.TR:break;default:qr(t,e)}}function Aa(t,e){switch(e.tagID){case c.HTML:{Ue(t,e);break}case c.COL:{t._appendElement(e,M.HTML),e.ackSelfClosing=!0;break}case c.TEMPLATE:{ut(t,e);break}default:Nr(t,e)}}function Qb(t,e){switch(e.tagID){case c.COLGROUP:{t.openElements.currentTagId===c.COLGROUP&&(t.openElements.pop(),t.insertionMode=A.IN_TABLE);break}case c.TEMPLATE:{Xt(t,e);break}case c.COL:break;default:Nr(t,e)}}function Nr(t,e){t.openElements.currentTagId===c.COLGROUP&&(t.openElements.pop(),t.insertionMode=A.IN_TABLE,t._processToken(e))}function Vr(t,e){switch(e.tagID){case c.TR:{t.openElements.clearBackToTableBodyContext(),t._insertElement(e,M.HTML),t.insertionMode=A.IN_ROW;break}case c.TH:case c.TD:{t.openElements.clearBackToTableBodyContext(),t._insertFakeElement(w.TR,c.TR),t.insertionMode=A.IN_ROW,Wr(t,e);break}case c.CAPTION:case c.COL:case c.COLGROUP:case c.TBODY:case c.TFOOT:case c.THEAD:{t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=A.IN_TABLE,cn(t,e));break}default:cn(t,e)}}function ji(t,e){const n=e.tagID;switch(e.tagID){case c.TBODY:case c.TFOOT:case c.THEAD:{t.openElements.hasInTableScope(n)&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=A.IN_TABLE);break}case c.TABLE:{t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=A.IN_TABLE,Gn(t,e));break}case c.BODY:case c.CAPTION:case c.COL:case c.COLGROUP:case c.HTML:case c.TD:case c.TH:case c.TR:break;default:Gn(t,e)}}function Wr(t,e){switch(e.tagID){case c.TH:case c.TD:{t.openElements.clearBackToTableRowContext(),t._insertElement(e,M.HTML),t.insertionMode=A.IN_CELL,t.activeFormattingElements.insertMarker();break}case c.CAPTION:case c.COL:case c.COLGROUP:case c.TBODY:case c.TFOOT:case c.THEAD:case c.TR:{t.openElements.hasInTableScope(c.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=A.IN_TABLE_BODY,Vr(t,e));break}default:cn(t,e)}}function Rl(t,e){switch(e.tagID){case c.TR:{t.openElements.hasInTableScope(c.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=A.IN_TABLE_BODY);break}case c.TABLE:{t.openElements.hasInTableScope(c.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=A.IN_TABLE_BODY,ji(t,e));break}case c.TBODY:case c.TFOOT:case c.THEAD:{(t.openElements.hasInTableScope(e.tagID)||t.openElements.hasInTableScope(c.TR))&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=A.IN_TABLE_BODY,ji(t,e));break}case c.BODY:case c.CAPTION:case c.COL:case c.COLGROUP:case c.HTML:case c.TD:case c.TH:break;default:Gn(t,e)}}function Gb(t,e){const n=e.tagID;wl.has(n)?(t.openElements.hasInTableScope(c.TD)||t.openElements.hasInTableScope(c.TH))&&(t._closeTableCell(),Wr(t,e)):Ue(t,e)}function Xb(t,e){const n=e.tagID;switch(n){case c.TD:case c.TH:{t.openElements.hasInTableScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=A.IN_ROW);break}case c.TABLE:case c.TBODY:case c.TFOOT:case c.THEAD:case c.TR:{t.openElements.hasInTableScope(n)&&(t._closeTableCell(),Rl(t,e));break}case c.BODY:case c.CAPTION:case c.COL:case c.COLGROUP:case c.HTML:break;default:qr(t,e)}}function Ol(t,e){switch(e.tagID){case c.HTML:{Ue(t,e);break}case c.OPTION:{t.openElements.currentTagId===c.OPTION&&t.openElements.pop(),t._insertElement(e,M.HTML);break}case c.OPTGROUP:{t.openElements.currentTagId===c.OPTION&&t.openElements.pop(),t.openElements.currentTagId===c.OPTGROUP&&t.openElements.pop(),t._insertElement(e,M.HTML);break}case c.HR:{t.openElements.currentTagId===c.OPTION&&t.openElements.pop(),t.openElements.currentTagId===c.OPTGROUP&&t.openElements.pop(),t._appendElement(e,M.HTML),e.ackSelfClosing=!0;break}case c.INPUT:case c.KEYGEN:case c.TEXTAREA:case c.SELECT:{t.openElements.hasInSelectScope(c.SELECT)&&(t.openElements.popUntilTagNamePopped(c.SELECT),t._resetInsertionMode(),e.tagID!==c.SELECT&&t._processStartTag(e));break}case c.SCRIPT:case c.TEMPLATE:{ut(t,e);break}}}function Ll(t,e){switch(e.tagID){case c.OPTGROUP:{t.openElements.stackTop>0&&t.openElements.currentTagId===c.OPTION&&t.openElements.tagIDs[t.openElements.stackTop-1]===c.OPTGROUP&&t.openElements.pop(),t.openElements.currentTagId===c.OPTGROUP&&t.openElements.pop();break}case c.OPTION:{t.openElements.currentTagId===c.OPTION&&t.openElements.pop();break}case c.SELECT:{t.openElements.hasInSelectScope(c.SELECT)&&(t.openElements.popUntilTagNamePopped(c.SELECT),t._resetInsertionMode());break}case c.TEMPLATE:{Xt(t,e);break}}}function Zb(t,e){const n=e.tagID;n===c.CAPTION||n===c.TABLE||n===c.TBODY||n===c.TFOOT||n===c.THEAD||n===c.TR||n===c.TD||n===c.TH?(t.openElements.popUntilTagNamePopped(c.SELECT),t._resetInsertionMode(),t._processStartTag(e)):Ol(t,e)}function Kb(t,e){const n=e.tagID;n===c.CAPTION||n===c.TABLE||n===c.TBODY||n===c.TFOOT||n===c.THEAD||n===c.TR||n===c.TD||n===c.TH?t.openElements.hasInTableScope(n)&&(t.openElements.popUntilTagNamePopped(c.SELECT),t._resetInsertionMode(),t.onEndTag(e)):Ll(t,e)}function Jb(t,e){switch(e.tagID){case c.BASE:case c.BASEFONT:case c.BGSOUND:case c.LINK:case c.META:case c.NOFRAMES:case c.SCRIPT:case c.STYLE:case c.TEMPLATE:case c.TITLE:{ut(t,e);break}case c.CAPTION:case c.COLGROUP:case c.TBODY:case c.TFOOT:case c.THEAD:{t.tmplInsertionModeStack[0]=A.IN_TABLE,t.insertionMode=A.IN_TABLE,cn(t,e);break}case c.COL:{t.tmplInsertionModeStack[0]=A.IN_COLUMN_GROUP,t.insertionMode=A.IN_COLUMN_GROUP,Aa(t,e);break}case c.TR:{t.tmplInsertionModeStack[0]=A.IN_TABLE_BODY,t.insertionMode=A.IN_TABLE_BODY,Vr(t,e);break}case c.TD:case c.TH:{t.tmplInsertionModeStack[0]=A.IN_ROW,t.insertionMode=A.IN_ROW,Wr(t,e);break}default:t.tmplInsertionModeStack[0]=A.IN_BODY,t.insertionMode=A.IN_BODY,Ue(t,e)}}function e2(t,e){e.tagID===c.TEMPLATE&&Xt(t,e)}function Dl(t,e){t.openElements.tmplCount>0?(t.openElements.popUntilTagNamePopped(c.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode(),t.onEof(e)):ya(t,e)}function t2(t,e){e.tagID===c.HTML?Ue(t,e):wr(t,e)}function vl(t,e){var n;if(e.tagID===c.HTML){if(t.fragmentContext||(t.insertionMode=A.AFTER_AFTER_BODY),t.options.sourceCodeLocationInfo&&t.openElements.tagIDs[0]===c.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 wr(t,e)}function wr(t,e){t.insertionMode=A.IN_BODY,Yr(t,e)}function n2(t,e){switch(e.tagID){case c.HTML:{Ue(t,e);break}case c.FRAMESET:{t._insertElement(e,M.HTML);break}case c.FRAME:{t._appendElement(e,M.HTML),e.ackSelfClosing=!0;break}case c.NOFRAMES:{ut(t,e);break}}}function r2(t,e){e.tagID===c.FRAMESET&&!t.openElements.isRootHtmlElementCurrent()&&(t.openElements.pop(),!t.fragmentContext&&t.openElements.currentTagId!==c.FRAMESET&&(t.insertionMode=A.AFTER_FRAMESET))}function i2(t,e){switch(e.tagID){case c.HTML:{Ue(t,e);break}case c.NOFRAMES:{ut(t,e);break}}}function a2(t,e){e.tagID===c.HTML&&(t.insertionMode=A.AFTER_AFTER_FRAMESET)}function s2(t,e){e.tagID===c.HTML?Ue(t,e):Tr(t,e)}function Tr(t,e){t.insertionMode=A.IN_BODY,Yr(t,e)}function u2(t,e){switch(e.tagID){case c.HTML:{Ue(t,e);break}case c.NOFRAMES:{ut(t,e);break}}}function o2(t,e){e.chars=Ce,t._insertCharacters(e)}function l2(t,e){t._insertCharacters(e),t.framesetOk=!1}function Pl(t){for(;t.treeAdapter.getNamespaceURI(t.openElements.current)!==M.HTML&&t.openElements.currentTagId!==void 0&&!t._isIntegrationPoint(t.openElements.currentTagId,t.openElements.current);)t.openElements.pop()}function c2(t,e){if(CE(e))Pl(t),t._startTagOutsideForeignContent(e);else{const n=t._getAdjustedCurrentElement(),r=t.treeAdapter.getNamespaceURI(n);r===M.MATHML?bl(e):r===M.SVG&&(IE(e),Tl(e)),xa(e),e.selfClosing?t._appendElement(e,r):t._insertElement(e,r),e.ackSelfClosing=!0}}function d2(t,e){if(e.tagID===c.P||e.tagID===c.BR){Pl(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)===M.HTML){t._endTagOutsideForeignContent(e);break}const i=t.treeAdapter.getTagName(r);if(i.toLowerCase()===e.tagName){e.tagName=i,t.openElements.shortenToLength(n);break}}}w.AREA,w.BASE,w.BASEFONT,w.BGSOUND,w.BR,w.COL,w.EMBED,w.FRAME,w.HR,w.IMG,w.INPUT,w.KEYGEN,w.LINK,w.META,w.PARAM,w.SOURCE,w.TRACK,w.WBR;const f2=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,h2=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),au={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function Ml(t,e){const n=A2(t),r=ul("type",{handlers:{root:p2,element:m2,text:g2,comment:Fl,doctype:E2,raw:T2},unknown:x2}),i={parser:n?new nu(au):nu.getFragmentParser(void 0,au),handle(u){r(u,i)},stitches:!1,options:e||{}};r(t,i),bn(i,ht());const a=n?i.parser.document:i.parser.getFragment(),s=kg(a,{file:i.options.file});return i.stitches&&$r(s,"comment",function(u,o,l){const d=u;if(d.value.stitch&&l&&o!==void 0){const f=l.children;return f[o]=d.value.stitch,o}}),s.type==="root"&&s.children.length===1&&s.children[0].type===t.type?s.children[0]:s}function Bl(t,e){let n=-1;if(t)for(;++n<t.length;)e.handle(t[n])}function p2(t,e){Bl(t.children,e)}function m2(t,e){_2(t,e),Bl(t.children,e),y2(t,e)}function g2(t,e){e.parser.tokenizer.state>4&&(e.parser.tokenizer.state=0);const n={type:re.CHARACTER,chars:t.value,location:sr(t)};bn(e,ht(t)),e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)}function E2(t,e){const n={type:re.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:sr(t)};bn(e,ht(t)),e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)}function b2(t,e){e.stitches=!0;const n=k2(t);if("children"in t&&"children"in n){const r=Ml({type:"root",children:t.children},e.options);n.children=r.children}Fl({type:"comment",value:{stitch:n}},e)}function Fl(t,e){const n=t.value,r={type:re.COMMENT,data:n,location:sr(t)};bn(e,ht(t)),e.parser.currentToken=r,e.parser._processToken(e.parser.currentToken)}function T2(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,Ul(e,ht(t)),e.parser.tokenizer.write(e.options.tagfilter?t.value.replace(f2,"<$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 x2(t,e){const n=t;if(e.options.passThrough&&e.options.passThrough.includes(n.type))b2(n,e);else{let r="";throw h2.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 bn(t,e){Ul(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=Re.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 Ul(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 _2(t,e){const n=t.tagName.toLowerCase();if(e.parser.tokenizer.state===Re.PLAINTEXT)return;bn(e,ht(t));const r=e.parser.openElements.current;let i="namespaceURI"in r?r.namespaceURI:zt.html;i===zt.html&&n==="svg"&&(i=zt.svg);const a=wg({...t,children:[]},{space:i===zt.svg?"svg":"html"}),s={type:re.START_TAG,tagName:n,tagID:En(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in a?a.attrs:[],location:sr(t)};e.parser.currentToken=s,e.parser._processToken(e.parser.currentToken),e.parser.tokenizer.lastStartTagName=n}function y2(t,e){const n=t.tagName.toLowerCase();if(!e.parser.tokenizer.inForeignNode&&Bg.includes(n)||e.parser.tokenizer.state===Re.PLAINTEXT)return;bn(e,Br(t));const r={type:re.END_TAG,tagName:n,tagID:En(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:sr(t)};e.parser.currentToken=r,e.parser._processToken(e.parser.currentToken),n===e.parser.tokenizer.lastStartTagName&&(e.parser.tokenizer.state===Re.RCDATA||e.parser.tokenizer.state===Re.RAWTEXT||e.parser.tokenizer.state===Re.SCRIPT_DATA)&&(e.parser.tokenizer.state=Re.DATA)}function A2(t){const e=t.type==="root"?t.children[0]:t;return!!(e&&(e.type==="doctype"||e.type==="element"&&e.tagName.toLowerCase()==="html"))}function sr(t){const e=ht(t)||{line:void 0,column:void 0,offset:void 0},n=Br(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 k2(t){return"children"in t?ln({...t,children:[]}):ln(t)}function C2(t){return function(e,n){return Ml(e,{...t,file:n})}}function su(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 I2(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function S2(t,e,n){const i=jr((n||{}).ignore||[]),a=N2(e);let s=-1;for(;++s<a.length;)nl(t,"text",u);function u(l,d){let f=-1,p;for(;++f<d.length;){const h=d[f],g=p?p.children:void 0;if(i(h,g?g.indexOf(h):void 0,p))return;p=h}if(p)return o(l,d)}function o(l,d){const f=d[d.length-1],p=a[s][0],h=a[s][1];let g=0;const y=f.children.indexOf(l);let T=!1,I=[];p.lastIndex=0;let E=p.exec(l.value);for(;E;){const R=E.index,O={index:E.index,input:E.input,stack:[...d,l]};let S=h(...E,O);if(typeof S=="string"&&(S=S.length>0?{type:"text",value:S}:void 0),S===!1?p.lastIndex=R+1:(g!==R&&I.push({type:"text",value:l.value.slice(g,R)}),Array.isArray(S)?I.push(...S):S&&I.push(S),g=R+E[0].length,T=!0),!p.global)break;E=p.exec(l.value)}return T?(g<l.value.length&&I.push({type:"text",value:l.value.slice(g)}),f.children.splice(y,1,...I)):I=[l],y+I.length}}function N2(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([w2(i[0]),R2(i[1])])}return e}function w2(t){return typeof t=="string"?new RegExp(I2(t),"g"):t}function R2(t){return typeof t=="function"?t:function(){return t}}const hi="phrasing",pi=["autolink","link","image","label"];function O2(){return{transforms:[F2],enter:{literalAutolink:D2,literalAutolinkEmail:mi,literalAutolinkHttp:mi,literalAutolinkWww:mi},exit:{literalAutolink:B2,literalAutolinkEmail:M2,literalAutolinkHttp:v2,literalAutolinkWww:P2}}}function L2(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:hi,notInConstruct:pi},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:hi,notInConstruct:pi},{character:":",before:"[ps]",after:"\\/",inConstruct:hi,notInConstruct:pi}]}}function D2(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function mi(t){this.config.enter.autolinkProtocol.call(this,t)}function v2(t){this.config.exit.autolinkProtocol.call(this,t)}function P2(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 M2(t){this.config.exit.autolinkEmail.call(this,t)}function B2(t){this.exit(t)}function F2(t){S2(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,U2],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),H2]],{ignore:["link","linkReference"]})}function U2(t,e,n,r,i){let a="";if(!Hl(i)||(/^w/i.test(e)&&(n=e+n,e="",a="http://"),!j2(n)))return!1;const s=z2(n+r);if(!s[0])return!1;const u={type:"link",title:null,url:a+e+s[0],children:[{type:"text",value:e+s[0]}]};return s[1]?[u,{type:"text",value:s[1]}]:u}function H2(t,e,n,r){return!Hl(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+e+"@"+n,children:[{type:"text",value:e+"@"+n}]}}function j2(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 z2(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=su(t,"(");let a=su(t,")");for(;r!==-1&&i>a;)t+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[t,n]}function Hl(t,e){const n=t.input.charCodeAt(t.index-1);return(t.index===0||Wt(n)||Fr(n))&&(!e||n!==47)}jl.peek=Z2;function $2(){this.buffer()}function Y2(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function q2(){this.buffer()}function V2(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function W2(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=st(this.sliceSerialize(t)).toLowerCase(),n.label=e}function Q2(t){this.exit(t)}function G2(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=st(this.sliceSerialize(t)).toLowerCase(),n.label=e}function X2(t){this.exit(t)}function Z2(){return"["}function jl(t,e,n,r){const i=n.createTracker(r);let a=i.move("[^");const s=n.enter("footnoteReference"),u=n.enter("reference");return a+=i.move(n.safe(n.associationId(t),{after:"]",before:a})),u(),s(),a+=i.move("]"),a}function K2(){return{enter:{gfmFootnoteCallString:$2,gfmFootnoteCall:Y2,gfmFootnoteDefinitionLabelString:q2,gfmFootnoteDefinition:V2},exit:{gfmFootnoteCallString:W2,gfmFootnoteCall:Q2,gfmFootnoteDefinitionLabelString:G2,gfmFootnoteDefinition:X2}}}function J2(t){let e=!1;return t&&t.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:n,footnoteReference:jl},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,a,s){const u=a.createTracker(s);let o=u.move("[^");const l=a.enter("footnoteDefinition"),d=a.enter("label");return o+=u.move(a.safe(a.associationId(r),{before:o,after:"]"})),d(),o+=u.move("]:"),r.children&&r.children.length>0&&(u.shift(4),o+=u.move((e?`
|
|
82
|
+
`:" ")+a.indentLines(a.containerFlow(r,u.current()),e?zl:eT))),l(),o}}function eT(t,e,n){return e===0?t:zl(t,e,n)}function zl(t,e,n){return(n?"":" ")+t}const tT=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];$l.peek=sT;function nT(){return{canContainEols:["delete"],enter:{strikethrough:iT},exit:{strikethrough:aT}}}function rT(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:tT}],handlers:{delete:$l}}}function iT(t){this.enter({type:"delete",children:[]},t)}function aT(t){this.exit(t)}function $l(t,e,n,r){const i=n.createTracker(r),a=n.enter("strikethrough");let s=i.move("~~");return s+=n.containerPhrasing(t,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),a(),s}function sT(){return"~"}function uT(t){return t.length}function oT(t,e){const n=e||{},r=(n.align||[]).concat(),i=n.stringLength||uT,a=[],s=[],u=[],o=[];let l=0,d=-1;for(;++d<t.length;){const _=[],y=[];let T=-1;for(t[d].length>l&&(l=t[d].length);++T<t[d].length;){const I=lT(t[d][T]);if(n.alignDelimiters!==!1){const E=i(I);y[T]=E,(o[T]===void 0||E>o[T])&&(o[T]=E)}_.push(I)}s[d]=_,u[d]=y}let f=-1;if(typeof r=="object"&&"length"in r)for(;++f<l;)a[f]=uu(r[f]);else{const _=uu(r);for(;++f<l;)a[f]=_}f=-1;const p=[],h=[];for(;++f<l;){const _=a[f];let y="",T="";_===99?(y=":",T=":"):_===108?y=":":_===114&&(T=":");let I=n.alignDelimiters===!1?1:Math.max(1,o[f]-y.length-T.length);const E=y+"-".repeat(I)+T;n.alignDelimiters!==!1&&(I=y.length+I+T.length,I>o[f]&&(o[f]=I),h[f]=I),p[f]=E}s.splice(1,0,p),u.splice(1,0,h),d=-1;const g=[];for(;++d<s.length;){const _=s[d],y=u[d];f=-1;const T=[];for(;++f<l;){const I=_[f]||"";let E="",R="";if(n.alignDelimiters!==!1){const O=o[f]-(y[f]||0),S=a[f];S===114?E=" ".repeat(O):S===99?O%2?(E=" ".repeat(O/2+.5),R=" ".repeat(O/2-.5)):(E=" ".repeat(O/2),R=E):R=" ".repeat(O)}n.delimiterStart!==!1&&!f&&T.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&I==="")&&(n.delimiterStart!==!1||f)&&T.push(" "),n.alignDelimiters!==!1&&T.push(E),T.push(I),n.alignDelimiters!==!1&&T.push(R),n.padding!==!1&&T.push(" "),(n.delimiterEnd!==!1||f!==l-1)&&T.push("|")}g.push(n.delimiterEnd===!1?T.join("").replace(/ +$/,""):T.join(""))}return g.join(`
|
|
83
|
+
`)}function lT(t){return t==null?"":String(t)}function uu(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 cT(t,e,n,r){const i=n.enter("blockquote"),a=n.createTracker(r);a.move("> "),a.shift(2);const s=n.indentLines(n.containerFlow(t,a.current()),dT);return i(),s}function dT(t,e,n){return">"+(n?"":" ")+t}function fT(t,e){return ou(t,e.inConstruct,!0)&&!ou(t,e.notInConstruct,!1)}function ou(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 lu(t,e,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
84
|
+
`&&fT(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
85
|
+
`}function hT(t,e){const n=String(t);let r=n.indexOf(e),i=r,a=0,s=0;if(typeof e!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++a>s&&(s=a):a=1,i=r+e.length,r=n.indexOf(e,i);return s}function pT(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 mT(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 gT(t,e,n,r){const i=mT(n),a=t.value||"",s=i==="`"?"GraveAccent":"Tilde";if(pT(t,n)){const f=n.enter("codeIndented"),p=n.indentLines(a,ET);return f(),p}const u=n.createTracker(r),o=i.repeat(Math.max(hT(a,i)+1,3)),l=n.enter("codeFenced");let d=u.move(o);if(t.lang){const f=n.enter(`codeFencedLang${s}`);d+=u.move(n.safe(t.lang,{before:d,after:" ",encode:["`"],...u.current()})),f()}if(t.lang&&t.meta){const f=n.enter(`codeFencedMeta${s}`);d+=u.move(" "),d+=u.move(n.safe(t.meta,{before:d,after:`
|
|
86
86
|
`,encode:["`"],...u.current()})),f()}return d+=u.move(`
|
|
87
87
|
`),a&&(d+=u.move(a+`
|
|
88
|
-
`)),d+=u.move(o),l(),d}function
|
|
89
|
-
`,...o.current()}))),u(),t.title&&(u=n.enter(`title${a}`),l+=o.move(" "+i),l+=o.move(n.safe(t.title,{before:l,after:i,...o.current()})),l+=o.move(i),u()),s(),l}function
|
|
88
|
+
`)),d+=u.move(o),l(),d}function ET(t,e,n){return(n?"":" ")+t}function ka(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 bT(t,e,n,r){const i=ka(n),a=i==='"'?"Quote":"Apostrophe",s=n.enter("definition");let u=n.enter("label");const o=n.createTracker(r);let l=o.move("[");return l+=o.move(n.safe(n.associationId(t),{before:l,after:"]",...o.current()})),l+=o.move("]: "),u(),!t.url||/[\0- \u007F]/.test(t.url)?(u=n.enter("destinationLiteral"),l+=o.move("<"),l+=o.move(n.safe(t.url,{before:l,after:">",...o.current()})),l+=o.move(">")):(u=n.enter("destinationRaw"),l+=o.move(n.safe(t.url,{before:l,after:t.title?" ":`
|
|
89
|
+
`,...o.current()}))),u(),t.title&&(u=n.enter(`title${a}`),l+=o.move(" "+i),l+=o.move(n.safe(t.title,{before:l,after:i,...o.current()})),l+=o.move(i),u()),s(),l}function TT(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 Xn(t){return"&#x"+t.toString(16).toUpperCase()+";"}function Rr(t,e,n){const r=on(t),i=on(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}}Yl.peek=xT;function Yl(t,e,n,r){const i=TT(n),a=n.enter("emphasis"),s=n.createTracker(r),u=s.move(i);let o=s.move(n.containerPhrasing(t,{after:i,before:u,...s.current()}));const l=o.charCodeAt(0),d=Rr(r.before.charCodeAt(r.before.length-1),l,i);d.inside&&(o=Xn(l)+o.slice(1));const f=o.charCodeAt(o.length-1),p=Rr(r.after.charCodeAt(0),f,i);p.inside&&(o=o.slice(0,-1)+Xn(f));const h=s.move(i);return a(),n.attentionEncodeSurroundingInfo={after:p.outside,before:d.outside},u+o+h}function xT(t,e,n){return n.options.emphasis||"*"}function _T(t,e){let n=!1;return $r(t,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Di}),!!((!t.depth||t.depth<3)&&ca(t)&&(e.options.setext||n))}function yT(t,e,n,r){const i=Math.max(Math.min(6,t.depth||1),1),a=n.createTracker(r);if(_T(t,n)){const d=n.enter("headingSetext"),f=n.enter("phrasing"),p=n.containerPhrasing(t,{...a.current(),before:`
|
|
90
90
|
`,after:`
|
|
91
91
|
`});return f(),d(),p+`
|
|
92
92
|
`+(i===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(`
|
|
93
93
|
`))+1))}const s="#".repeat(i),u=n.enter("headingAtx"),o=n.enter("phrasing");a.move(s+" ");let l=n.containerPhrasing(t,{before:"# ",after:`
|
|
94
|
-
`,...a.current()});return/^[\t ]/.test(l)&&(l=
|
|
95
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:s,tableCell:o,tableRow:u}};function s(h,g,_,y){return l(d(h,_,y),h.align)}function u(h,g,_,y){const T=f(h,_,y),
|
|
96
|
-
`))}function o(h,g,_,y){const T=_.enter("tableCell"),S=_.enter("phrasing"),E=_.containerPhrasing(h,{...y,before:a,after:a});return S(),T(),E}function l(h,g){return uT(h,{align:g,alignDelimiters:r,padding:n,stringLength:i})}function d(h,g,_){const y=h.children;let T=-1;const S=[],E=g.enter("table");for(;++T<y.length;)S[T]=f(y[T],g,_);return E(),S}function f(h,g,_){const y=h.children;let T=-1;const S=[],E=g.enter("tableRow");for(;++T<y.length;)S[T]=o(y[T],h,g,_);return E(),S}function p(h,g,_){let y=Kl.inlineCode(h,g,_);return _.stack.includes("tableCell")&&(y=y.replace(/\|/g,"\\$&")),y}}function QT(){return{exit:{taskListCheckValueChecked:ou,taskListCheckValueUnchecked:ou,paragraph:XT}}}function GT(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:ZT}}}function ou(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function XT(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 a=-1,s;for(;++a<i.length;){const u=i[a];if(u.type==="paragraph"){s=u;break}}s===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 ZT(t,e,n,r){const i=t.children[0],a=typeof t.checked=="boolean"&&i&&i.type==="paragraph",s="["+(t.checked?"x":" ")+"] ",u=n.createTracker(r);a&&u.move(s);let o=Kl.listItem(t,e,n,{...r,...u.current()});return a&&(o=o.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),o;function l(d){return d+s}}function KT(){return[R2(),Z2(),tT(),jT(),QT()]}function JT(t){return{extensions:[O2(),K2(t),nT(),WT(t),GT()]}}const ex={tokenize:sx,partial:!0},Jl={tokenize:ux,partial:!0},ec={tokenize:ox,partial:!0},tc={tokenize:lx,partial:!0},tx={tokenize:cx,partial:!0},nc={name:"wwwAutolink",tokenize:ix,previous:ic},rc={name:"protocolAutolink",tokenize:ax,previous:ac},Et={name:"emailAutolink",tokenize:rx,previous:sc},dt={};function nx(){return{text:dt}}let Lt=48;for(;Lt<123;)dt[Lt]=Et,Lt++,Lt===58?Lt=65:Lt===91&&(Lt=97);dt[43]=Et;dt[45]=Et;dt[46]=Et;dt[95]=Et;dt[72]=[Et,rc];dt[104]=[Et,rc];dt[87]=[Et,nc];dt[119]=[Et,nc];function rx(t,e,n){const r=this;let i,a;return s;function s(f){return!Mi(f)||!sc.call(r,r.previous)||Ta(r.events)?n(f):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),u(f))}function u(f){return Mi(f)?(t.consume(f),u):f===64?(t.consume(f),o):n(f)}function o(f){return f===46?t.check(tx,d,l)(f):f===45||f===95||De(f)?(a=!0,t.consume(f),o):d(f)}function l(f){return t.consume(f),i=!0,o}function d(f){return a&&i&&Fe(r.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(f)):n(f)}}function ix(t,e,n){const r=this;return i;function i(s){return s!==87&&s!==119||!ic.call(r,r.previous)||Ta(r.events)?n(s):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(ex,t.attempt(Jl,t.attempt(ec,a),n),n)(s))}function a(s){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(s)}}function ax(t,e,n){const r=this;let i="",a=!1;return s;function s(f){return(f===72||f===104)&&ac.call(r,r.previous)&&!Ta(r.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),i+=String.fromCodePoint(f),t.consume(f),u):n(f)}function u(f){if(Fe(f)&&i.length<5)return i+=String.fromCodePoint(f),t.consume(f),u;if(f===58){const p=i.toLowerCase();if(p==="http"||p==="https")return t.consume(f),o}return n(f)}function o(f){return f===47?(t.consume(f),a?l:(a=!0,o)):n(f)}function l(f){return f===null||Tr(f)||Te(f)||Ht(f)||Lr(f)?n(f):t.attempt(Jl,t.attempt(ec,d),n)(f)}function d(f){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(f)}}function sx(t,e,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,t.consume(s),i):s===46&&r===3?(t.consume(s),a):n(s)}function a(s){return s===null?n(s):e(s)}}function ux(t,e,n){let r,i,a;return s;function s(l){return l===46||l===95?t.check(tc,o,u)(l):l===null||Te(l)||Ht(l)||l!==45&&Lr(l)?o(l):(a=!0,t.consume(l),s)}function u(l){return l===95?r=!0:(i=r,r=void 0),t.consume(l),s}function o(l){return i||r||!a?n(l):e(l)}}function ox(t,e){let n=0,r=0;return i;function i(s){return s===40?(n++,t.consume(s),i):s===41&&r<n?a(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?t.check(tc,e,a)(s):s===null||Te(s)||Ht(s)?e(s):(t.consume(s),i)}function a(s){return s===41&&r++,t.consume(s),i}}function lx(t,e,n){return r;function r(u){return u===33||u===34||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===63||u===95||u===126?(t.consume(u),r):u===38?(t.consume(u),a):u===93?(t.consume(u),i):u===60||u===null||Te(u)||Ht(u)?e(u):n(u)}function i(u){return u===null||u===40||u===91||Te(u)||Ht(u)?e(u):r(u)}function a(u){return Fe(u)?s(u):n(u)}function s(u){return u===59?(t.consume(u),r):Fe(u)?(t.consume(u),s):n(u)}}function cx(t,e,n){return r;function r(a){return t.consume(a),i}function i(a){return De(a)?n(a):e(a)}}function ic(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||Te(t)}function ac(t){return!Fe(t)}function sc(t){return!(t===47||Mi(t))}function Mi(t){return t===43||t===45||t===46||t===95||De(t)}function Ta(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 dx={tokenize:Tx,partial:!0};function fx(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:gx,continuation:{tokenize:Ex},exit:bx}},text:{91:{name:"gfmFootnoteCall",tokenize:mx},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:hx,resolveTo:px}}}}function hx(t,e,n){const r=this;let i=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const o=r.events[i][1];if(o.type==="labelImage"){s=o;break}if(o.type==="gfmFootnoteCall"||o.type==="labelLink"||o.type==="label"||o.type==="image"||o.type==="link")break}return u;function u(o){if(!s||!s._balanced)return n(o);const l=it(r.sliceSerialize({start:s.end,end:r.now()}));return l.codePointAt(0)!==94||!a.includes(l.slice(1))?n(o):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(o),t.exit("gfmFootnoteCallLabelMarker"),e(o))}}function px(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 a={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},t[t.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},u=[t[n+1],t[n+2],["enter",r,e],t[n+3],t[n+4],["enter",i,e],["exit",i,e],["enter",a,e],["enter",s,e],["exit",s,e],["exit",a,e],t[t.length-2],t[t.length-1],["exit",r,e]];return t.splice(n,t.length-n+1,...u),t}function mx(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,s;return u;function u(f){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(f),t.exit("gfmFootnoteCallLabelMarker"),o}function o(f){return f!==94?n(f):(t.enter("gfmFootnoteCallMarker"),t.consume(f),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",l)}function l(f){if(a>999||f===93&&!s||f===null||f===91||Te(f))return n(f);if(f===93){t.exit("chunkString");const p=t.exit("gfmFootnoteCallString");return i.includes(it(r.sliceSerialize(p)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(f),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(f)}return Te(f)||(s=!0),a++,t.consume(f),f===92?d:l}function d(f){return f===91||f===92||f===93?(t.consume(f),a++,l):l(f)}}function gx(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,s=0,u;return o;function o(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(s>999||g===93&&!u||g===null||g===91||Te(g))return n(g);if(g===93){t.exit("chunkString");const _=t.exit("gfmFootnoteDefinitionLabelString");return a=it(r.sliceSerialize(_)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),p}return Te(g)||(u=!0),s++,t.consume(g),g===92?f:d}function f(g){return g===91||g===92||g===93?(t.consume(g),s++,d):d(g)}function p(g){return g===58?(t.enter("definitionMarker"),t.consume(g),t.exit("definitionMarker"),i.includes(a)||i.push(a),oe(t,h,"gfmFootnoteDefinitionWhitespace")):n(g)}function h(g){return e(g)}}function Ex(t,e,n){return t.check(Zn,e,t.attempt(dx,e,n))}function bx(t){t.exit("gfmFootnoteDefinition")}function Tx(t,e,n){const r=this;return oe(t,i,"gfmFootnoteDefinitionIndent",5);function i(a){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?e(a):n(a)}}function xx(t){let n=(t||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,u){let o=-1;for(;++o<s.length;)if(s[o][0]==="enter"&&s[o][1].type==="strikethroughSequenceTemporary"&&s[o][1]._close){let l=o;for(;l--;)if(s[l][0]==="exit"&&s[l][1].type==="strikethroughSequenceTemporary"&&s[l][1]._open&&s[o][1].end.offset-s[o][1].start.offset===s[l][1].end.offset-s[l][1].start.offset){s[o][1].type="strikethroughSequence",s[l][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},s[l][1].start),end:Object.assign({},s[o][1].end)},f={type:"strikethroughText",start:Object.assign({},s[l][1].end),end:Object.assign({},s[o][1].start)},p=[["enter",d,u],["enter",s[l][1],u],["exit",s[l][1],u],["enter",f,u]],h=u.parser.constructs.insideSpan.null;h&&Ge(p,p.length,0,Dr(h,s.slice(l+1,o),u)),Ge(p,p.length,0,[["exit",f,u],["enter",s[o][1],u],["exit",s[o][1],u],["exit",d,u]]),Ge(s,l-1,o-l+3,p),o=l+p.length-2;break}}for(o=-1;++o<s.length;)s[o][1].type==="strikethroughSequenceTemporary"&&(s[o][1].type="data");return s}function a(s,u,o){const l=this.previous,d=this.events;let f=0;return p;function p(g){return l===126&&d[d.length-1][1].type!=="characterEscape"?o(g):(s.enter("strikethroughSequenceTemporary"),h(g))}function h(g){const _=tn(l);if(g===126)return f>1?o(g):(s.consume(g),f++,h);if(f<2&&!n)return o(g);const y=s.exit("strikethroughSequenceTemporary"),T=tn(g);return y._open=!T||T===2&&!!_,y._close=!_||_===2&&!!T,u(g)}}}class _x{constructor(){this.map=[]}add(e,n,r){yx(this,e,n,r)}consume(e){if(this.map.sort(function(a,s){return a[0]-s[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 a of i)e.push(a);i=r.pop()}this.map.length=0}}function yx(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 Ax(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 a=r.length-1;r[a]=r[a]==="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 kx(){return{flow:{null:{name:"table",tokenize:Cx,resolveAll:Ix}}}}function Cx(t,e,n){const r=this;let i=0,a=0,s;return u;function u(N){let F=r.events.length-1;for(;F>-1;){const $=r.events[F][1].type;if($==="lineEnding"||$==="linePrefix")F--;else break}const P=F>-1?r.events[F][1].type:null,Z=P==="tableHead"||P==="tableRow"?I:o;return Z===I&&r.parser.lazy[r.now().line]?n(N):Z(N)}function o(N){return t.enter("tableHead"),t.enter("tableRow"),l(N)}function l(N){return N===124||(s=!0,a+=1),d(N)}function d(N){return N===null?n(N):G(N)?a>1?(a=0,r.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(N),t.exit("lineEnding"),h):n(N):ie(N)?oe(t,d,"whitespace")(N):(a+=1,s&&(s=!1,i+=1),N===124?(t.enter("tableCellDivider"),t.consume(N),t.exit("tableCellDivider"),s=!0,d):(t.enter("data"),f(N)))}function f(N){return N===null||N===124||Te(N)?(t.exit("data"),d(N)):(t.consume(N),N===92?p:f)}function p(N){return N===92||N===124?(t.consume(N),f):f(N)}function h(N){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(N):(t.enter("tableDelimiterRow"),s=!1,ie(N)?oe(t,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):g(N))}function g(N){return N===45||N===58?y(N):N===124?(s=!0,t.enter("tableCellDivider"),t.consume(N),t.exit("tableCellDivider"),_):O(N)}function _(N){return ie(N)?oe(t,y,"whitespace")(N):y(N)}function y(N){return N===58?(a+=1,s=!0,t.enter("tableDelimiterMarker"),t.consume(N),t.exit("tableDelimiterMarker"),T):N===45?(a+=1,T(N)):N===null||G(N)?R(N):O(N)}function T(N){return N===45?(t.enter("tableDelimiterFiller"),S(N)):O(N)}function S(N){return N===45?(t.consume(N),S):N===58?(s=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(N),t.exit("tableDelimiterMarker"),E):(t.exit("tableDelimiterFiller"),E(N))}function E(N){return ie(N)?oe(t,R,"whitespace")(N):R(N)}function R(N){return N===124?g(N):N===null||G(N)?!s||i!==a?O(N):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(N)):O(N)}function O(N){return n(N)}function I(N){return t.enter("tableRow"),v(N)}function v(N){return N===124?(t.enter("tableCellDivider"),t.consume(N),t.exit("tableCellDivider"),v):N===null||G(N)?(t.exit("tableRow"),e(N)):ie(N)?oe(t,v,"whitespace")(N):(t.enter("data"),B(N))}function B(N){return N===null||N===124||Te(N)?(t.exit("data"),v(N)):(t.consume(N),N===92?z:B)}function z(N){return N===92||N===124?(t.consume(N),B):B(N)}}function Ix(t,e){let n=-1,r=!0,i=0,a=[0,0,0,0],s=[0,0,0,0],u=!1,o=0,l,d,f;const p=new _x;for(;++n<t.length;){const h=t[n],g=h[1];h[0]==="enter"?g.type==="tableHead"?(u=!1,o!==0&&(lu(p,e,o,l,d),d=void 0,o=0),l={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},p.add(n,0,[["enter",l,e]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,f=void 0,a=[0,0,0,0],s=[0,n+1,0,0],u&&(u=!1,d={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},p.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,s[2]===0&&(a[1]!==0&&(s[0]=s[1],f=ur(p,e,a,i,void 0,f),a=[0,0,0,0]),s[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(s[0]=s[1],f=ur(p,e,a,i,void 0,f)),a=s,s=[a[1],n,0,0])):g.type==="tableHead"?(u=!0,o=n):g.type==="tableRow"||g.type==="tableDelimiterRow"?(o=n,a[1]!==0?(s[0]=s[1],f=ur(p,e,a,i,n,f)):s[1]!==0&&(f=ur(p,e,s,i,n,f)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(s[3]=n)}for(o!==0&&lu(p,e,o,l,d),p.consume(e.events),n=-1;++n<e.events.length;){const h=e.events[n];h[0]==="enter"&&h[1].type==="table"&&(h[1]._align=Ax(e.events,n))}return t}function ur(t,e,n,r,i,a){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",u="tableContent";n[0]!==0&&(a.end=Object.assign({},Xt(e.events,n[0])),t.add(n[0],0,[["exit",a,e]]));const o=Xt(e.events,n[1]);if(a={type:s,start:Object.assign({},o),end:Object.assign({},o)},t.add(n[1],0,[["enter",a,e]]),n[2]!==0){const l=Xt(e.events,n[2]),d=Xt(e.events,n[3]),f={type:u,start:Object.assign({},l),end:Object.assign({},d)};if(t.add(n[2],0,[["enter",f,e]]),r!==2){const p=e.events[n[2]],h=e.events[n[3]];if(p[1].end=Object.assign({},h[1].end),p[1].type="chunkText",p[1].contentType="text",n[3]>n[2]+1){const g=n[2]+1,_=n[3]-n[2]-1;t.add(g,_,[])}}t.add(n[3]+1,0,[["exit",f,e]])}return i!==void 0&&(a.end=Object.assign({},Xt(e.events,i)),t.add(i,0,[["exit",a,e]]),a=void 0),a}function lu(t,e,n,r,i){const a=[],s=Xt(e.events,n);i&&(i.end=Object.assign({},s),a.push(["exit",i,e])),r.end=Object.assign({},s),a.push(["exit",r,e]),t.add(n+1,0,a)}function Xt(t,e){const n=t[e],r=n[0]==="enter"?"start":"end";return n[1][r]}const Sx={name:"tasklistCheck",tokenize:wx};function Nx(){return{text:{91:Sx}}}function wx(t,e,n){const r=this;return i;function i(o){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(o):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(o),t.exit("taskListCheckMarker"),a)}function a(o){return Te(o)?(t.enter("taskListCheckValueUnchecked"),t.consume(o),t.exit("taskListCheckValueUnchecked"),s):o===88||o===120?(t.enter("taskListCheckValueChecked"),t.consume(o),t.exit("taskListCheckValueChecked"),s):n(o)}function s(o){return o===93?(t.enter("taskListCheckMarker"),t.consume(o),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),u):n(o)}function u(o){return G(o)?e(o):ie(o)?t.check({tokenize:Rx},e,n)(o):n(o)}}function Rx(t,e,n){return oe(t,r,"whitespace");function r(i){return i===null?n(i):e(i)}}function Ox(t){return Po([nx(),fx(),xx(t),kx(),Nx()])}const Lx={};function Dx(t){const e=this,n=t||Lx,r=e.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(Ox(n)),a.push(KT()),s.push(JT(n))}const vx=V.lazy(()=>Rc(()=>import("./lazy-highlighter-rbKuYd4Y.js"),__vite__mapDeps([0,1,2])));function uc(){const t=W.c(3),[e,n]=V.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=async s=>{await navigator.clipboard.writeText(s),n(!0),setTimeout(()=>n(!1),2e3)},t[0]=r):r=t[0];const i=r;let a;return t[1]!==e?(a={handleCopy:i,copied:e},t[1]=e,t[2]=a):a=t[2],a}function Px(){const t=W.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(Mx)}),t[1]=r):r=t[1],r}function Mx(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 Bx(t){const e=W.c(12),n=V.useRef(null),{handleCopy:r,copied:i}=uc(),a=Fx;let s;e[0]!==r?(s=async()=>{const p=a(n.current);await r(p)},e[0]=r,e[1]=s):s=e[1];const u=s;let o;e[2]!==i?(o=i?m.jsx(Jt,{size:12}):m.jsx(Hi,{size:12}),e[2]=i,e[3]=o):o=e[3];let l;e[4]!==u||e[5]!==o?(l=m.jsx("div",{className:"flex justify-end items-center",children:m.jsxs(Ye,{variant:"ghost",onClick:u,"aria-label":"Copy as CSV",className:"text-muted-foreground hover:text-foreground h-6 text-[10px]",type:"button",children:["Copy as CSV",o]})}),e[4]=u,e[5]=o,e[6]=l):l=e[6];let d;e[7]!==t?(d=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]=d):d=e[8];let f;return e[9]!==l||e[10]!==d?(f=m.jsxs(m.Fragment,{children:[l,d]}),e[9]=l,e[10]=d,e[11]=f):f=e[11],f}function Fx(t){return t?Array.from(t.querySelectorAll("tr")).map(Ux).join(`
|
|
97
|
-
`):""}function Ux(t){return Array.from(t.querySelectorAll("th,td")).map(Hx).join(",")}function Hx(t){let e=t.textContent||"";return e=e.replace(/"/g,'""'),e.search(/([",\n])/g)>=0&&(e=`"${e}"`),e}const jx=[Dx],zx=[k2],$x={p:t=>m.jsx("p",{...t,className:"leading-relaxed text-sm mb-2 last:mb-0"}),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-sm"}),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(Bx,{...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"})},oc=V.memo(t=>{const e=W.c(2),{content:n}=t;let r;return e[0]!==n?(r=m.jsx(og,{remarkPlugins:jx,rehypePlugins:zx,components:$x,children:n}),e[0]=n,e[1]=r):r=e[1],r},(t,e)=>t.content===e.content);function Yx(t){const e=W.c(20),{language:n,content:r}=t,{handleCopy:i,copied:a}=uc(),s=n||"text";let u;e[0]!==s?(u=m.jsx("span",{className:"text-xs font-mono uppercase text-muted-foreground tracking-widest select-none",children:s}),e[0]=s,e[1]=u):u=e[1];let o;e[2]!==r||e[3]!==i?(o=()=>i(r),e[2]=r,e[3]=i,e[4]=o):o=e[4];let l;e[5]!==a?(l=a?m.jsx(Jt,{size:14}):m.jsx(Hi,{size:14}),e[5]=a,e[6]=l):l=e[6];let d;e[7]!==o||e[8]!==l?(d=m.jsx(Ye,{size:"icon",variant:"ghost",onClick:o,"aria-label":"Copy code",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:l}),e[7]=o,e[8]=l,e[9]=d):d=e[9];let f;e[10]!==u||e[11]!==d?(f=m.jsxs("div",{className:"flex items-center justify-between p-1 pl-4 bg-muted border-b border-border",children:[u,d]}),e[10]=u,e[11]=d,e[12]=f):f=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=m.jsx(Px,{}),e[13]=p):p=e[13];let h;e[14]!==r||e[15]!==n?(h=m.jsx(V.Suspense,{fallback:p,children:m.jsx(vx,{language:n,content:r})}),e[14]=r,e[15]=n,e[16]=h):h=e[16];let g;return e[17]!==f||e[18]!==h?(g=m.jsxs("div",{className:"my-4 rounded-lg bg-muted overflow-hidden border border-border grid min-w-0",children:[f,h]}),e[17]=f,e[18]=h,e[19]=g):g=e[19],g}oc.displayName="MemoizedMarkdownBlock";const xa=t=>{const e=W.c(7),{id:n,text:r}=t;let i;e[0]!==r?(i=he.lexer(r),e[0]=r,e[1]=i):i=e[1];const a=i;let s;if(e[2]!==a||e[3]!==n){let u;e[5]!==n?(u=(o,l)=>o.type==="code"?m.jsx(Yx,{language:o.lang,content:o.text},`${n}-block_${l}`):m.jsx(oc,{content:o.raw},`${n}-block_${l}`),e[5]=n,e[6]=u):u=e[6],s=a.map(u),e[2]=a,e[3]=n,e[4]=s}else s=e[4];return s};xa.displayName="MemoizedMarkdown";function lc(t){const e=W.c(18),{id:n,part:r,copyable:i,extraActions:a,hasToolCallAfter:s}=t,u=i===void 0?!1:i,o=s===void 0?!1:s,{handleCopy:l}=Th(),[d,f]=V.useState(!1);let p;e[0]!==l||e[1]!==r.text?(p=async()=>{await l(r.text),f(!0),setTimeout(()=>f(!1),2e3)},e[0]=l,e[1]=r.text,e[2]=p):p=e[2];const h=p,g=u&&a,_=g||a,y=!o&&"mb-2";let T;e[3]!==y?(T=ce("group/part relative",y),e[3]=y,e[4]=T):T=e[4];let S;e[5]!==n||e[6]!==r.text?(S=m.jsx(xa,{id:n,text:r.text}),e[5]=n,e[6]=r.text,e[7]=S):S=e[7];let E;e[8]!==a||e[9]!==h||e[10]!==d||e[11]!==_||e[12]!==g?(E=_&&m.jsx("div",{className:"flex w-full items-center 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 mt-2",children:m.jsxs("div",{className:"flex items-center gap-1",children:[g&&m.jsx(Ye,{onClick:h,variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-foreground size-6 whitespace-nowrap",children:d?m.jsx(Jt,{size:12}):m.jsx(Hi,{size:12})}),a]})}),e[8]=a,e[9]=h,e[10]=d,e[11]=_,e[12]=g,e[13]=E):E=e[13];let R;return e[14]!==T||e[15]!==S||e[16]!==E?(R=m.jsxs("div",{className:T,children:[S,E]}),e[14]=T,e[15]=S,e[16]=E,e[17]=R):R=e[17],R}function qx(t){const e=W.c(4),{output:n}=t;let r;if(e[0]!==n){const s=JSON.stringify(n,null,2);r=s.length>2e3?s.slice(0,2e3)+"...[TRUNCATED]":s,e[0]=n,e[1]=r}else r=e[1];const i=r;let a;return e[2]!==i?(a=m.jsx("div",{className:"h-full",children:m.jsx(xu,{code:i,language:"json",height:"100%",readOnly:!0})}),e[2]=i,e[3]=a):a=e[3],a}function cu(t){const e=W.c(35),{part:n}=t,{state:r}=n;let i;e[0]!==n?(i="toolName"in n?n.toolName:n.type.replace("tool-",""),e[0]=n,e[1]=i):i=e[1];const a=i,[s,u]=V.useState(!1),o=(r==="input-streaming"||r==="input-available"||r==="output-available")&&!!n.input,l=r==="output-available",d=r==="output-error";let f;e[2]!==s?(f=()=>u(!s),e[2]=s,e[3]=f):f=e[3];let p;e[4]!==r?(p=r==="output-error"?m.jsx(bu,{className:"size-4 text-destructive shrink-0"}):m.jsx(Vc,{className:ce("size-4 text-muted-foreground shrink-0",(r==="input-streaming"||r==="input-available")&&"shimmer")}),e[4]=r,e[5]=p):p=e[5];const h=r==="output-error"&&"text-destructive/90",g=(r==="input-streaming"||r==="input-available")&&"shimmer";let _;e[6]!==h||e[7]!==g?(_=ce("text-xs font-medium text-muted-foreground truncate",h,g),e[6]=h,e[7]=g,e[8]=_):_=e[8];const y=r==="input-streaming"&&`Streaming ${a} arguments`,T=r==="input-available"&&`Calling ${a}`,S=r==="output-available"&&`Called ${a}`,E=r==="output-error"&&`Error calling ${a}`;let R;e[9]!==E||e[10]!==_||e[11]!==y||e[12]!==T||e[13]!==S?(R=m.jsxs("span",{className:_,children:[y,T,S,E]}),e[9]=E,e[10]=_,e[11]=y,e[12]=T,e[13]=S,e[14]=R):R=e[14];let O;e[15]!==R||e[16]!==p?(O=m.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[p,R]}),e[15]=R,e[16]=p,e[17]=O):O=e[17];const I=s&&"rotate-90";let v;e[18]!==I?(v=ce("size-4 text-muted-foreground transition-transform",I),e[18]=I,e[19]=v):v=e[19];let B;e[20]!==v?(B=m.jsx("div",{className:"flex items-center gap-2 shrink-0",children:m.jsx(Tu,{className:v})}),e[20]=v,e[21]=B):B=e[21];let z;e[22]!==O||e[23]!==B||e[24]!==f?(z=m.jsxs("button",{type:"button",onClick:f,className:"flex items-center gap-2 w-full cursor-pointer p-3",children:[O,B]}),e[22]=O,e[23]=B,e[24]=f,e[25]=z):z=e[25];let N;e[26]!==s||e[27]!==n||e[28]!==d||e[29]!==o||e[30]!==l?(N=s&&m.jsxs("div",{className:"flex ml-[7px] px-3 pb-3",children:[m.jsx("div",{className:"w-4 relative shrink-0",children:m.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-0.25 bg-border"})}),m.jsxs("div",{className:"flex flex-col gap-4 flex-1 min-w-0 pt-2",children:[o&&m.jsxs("div",{className:"flex flex-col gap-0.5",children:[m.jsx("div",{className:"px-1 h-5 flex items-center",children:m.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Input"})}),m.jsx("div",{className:"border border-border rounded-lg p-2 h-full max-h-[200px]",children:m.jsx(xu,{code:JSON.stringify(n.input,null,2),language:"json",foldOnMount:!0,height:"100%",readOnly:!0})})]}),l&&m.jsxs("div",{className:"flex flex-col gap-0.5",children:[m.jsx("div",{className:"px-1 h-5 flex items-center",children:m.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Output"})}),m.jsx("div",{className:"border border-border rounded-lg max-h-[200px] overflow-auto p-2 h-full",children:m.jsx(qx,{output:n.output})})]}),d&&m.jsxs("div",{className:"flex flex-col gap-0.5",children:[m.jsx("div",{className:"px-1 h-5 flex items-center",children:m.jsx("span",{className:"text-xs font-medium text-destructive/90",children:"Error"})}),m.jsx("div",{className:"border border-destructive/20 rounded-lg max-h-[200px] overflow-auto p-2 bg-destructive/10",children:m.jsx("pre",{className:"text-xs font-mono text-destructive whitespace-pre-wrap wrap-break-word",children:"errorText"in n&&typeof n.errorText=="string"?n.errorText:"An unknown error occurred"})})]})]})]}),e[26]=s,e[27]=n,e[28]=d,e[29]=o,e[30]=l,e[31]=N):N=e[31];let F;return e[32]!==z||e[33]!==N?(F=m.jsx("div",{className:"flex flex-col my-4 w-full min-w-0",children:m.jsxs("div",{className:"border border-border/75 rounded-lg flex flex-col bg-background w-full min-w-0 overflow-hidden",children:[z,N]})}),e[32]=z,e[33]=N,e[34]=F):F=e[34],F}const Vx={openrouter:t=>{const e=t?.openrouter;return typeof e=="object"&&e!==null&&"usage"in e&&typeof e.usage=="object"&&e.usage!==null&&"cost"in e.usage&&typeof e.usage.cost=="number"?e.usage.cost:null}};function Wx(t){if(!t?.providerMetadata)return null;for(const e of Object.values(Vx)){const n=e(t.providerMetadata);if(n!==null)return n}return null}function Qx(t){return t.reduce((e,n)=>{const r=n.metadata?.usage;return r?{inputTokens:e.inputTokens+(r.inputTokens??0),outputTokens:e.outputTokens+(r.outputTokens??0),totalTokens:e.totalTokens+(r.totalTokens??0),cost:e.cost+(Wx(r)??0)}:e},{inputTokens:0,outputTokens:0,totalTokens:0,cost:0})}function Gx(t){const e=W.c(38),{messages:n}=t;let r,i,a,s,u,o,l,d,f,p,h,g;if(e[0]!==n){g=Symbol.for("react.early_return_sentinel");e:{const R=Qx(n);if(!R){g=null;break e}const{totalTokens:O,inputTokens:I,outputTokens:v,cost:B}=R;if(a=B,!O&&!I&&!v){g=null;break e}i=an;let z;e[13]===Symbol.for("react.memo_cache_sentinel")?(z=m.jsx(yu,{size:12}),e[13]=z):z=e[13];const N=m.jsxs(Ye,{variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-foreground pl-1! h-6 gap-1 whitespace-nowrap",children:[z,m.jsx("span",{className:"text-[10px] font-mono tabular-nums",children:O.toLocaleString()})]});e[14]!==N?(h=m.jsx(sn,{asChild:!0,children:N}),e[14]=N,e[15]=h):h=e[15],r=un,f="top",p="font-mono text-[11px]",u="grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",e[16]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsx("span",{className:"text-muted",children:"in"}),e[16]=o):o=e[16],l=m.jsx("span",{children:I.toLocaleString()}),e[17]===Symbol.for("react.memo_cache_sentinel")?(d=m.jsx("span",{className:"text-muted",children:"out"}),e[17]=d):d=e[17],s=v.toLocaleString()}e[0]=n,e[1]=r,e[2]=i,e[3]=a,e[4]=s,e[5]=u,e[6]=o,e[7]=l,e[8]=d,e[9]=f,e[10]=p,e[11]=h,e[12]=g}else r=e[1],i=e[2],a=e[3],s=e[4],u=e[5],o=e[6],l=e[7],d=e[8],f=e[9],p=e[10],h=e[11],g=e[12];if(g!==Symbol.for("react.early_return_sentinel"))return g;let _;e[18]!==s?(_=m.jsx("span",{children:s}),e[18]=s,e[19]=_):_=e[19];let y;e[20]!==a?(y=a>0&&m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"text-muted",children:"cost"}),m.jsxs("span",{children:["$",a.toFixed(4)]})]}),e[20]=a,e[21]=y):y=e[21];let T;e[22]!==_||e[23]!==y||e[24]!==u||e[25]!==o||e[26]!==l||e[27]!==d?(T=m.jsxs("div",{className:u,children:[o,l,d,_,y]}),e[22]=_,e[23]=y,e[24]=u,e[25]=o,e[26]=l,e[27]=d,e[28]=T):T=e[28];let S;e[29]!==r||e[30]!==T||e[31]!==f||e[32]!==p?(S=m.jsx(r,{side:f,className:p,children:T}),e[29]=r,e[30]=T,e[31]=f,e[32]=p,e[33]=S):S=e[33];let E;return e[34]!==i||e[35]!==S||e[36]!==h?(E=m.jsxs(i,{children:[h,S]}),e[34]=i,e[35]=S,e[36]=h,e[37]=E):E=e[37],E}const Xx={planning:{icon:m.jsx(wu,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),label:"Planning next moves"},thinking:{icon:m.jsx(Cr,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),label:"Thinking"}},Zx=1200;function Kx(){const t=W.c(7),[e,n]=V.useState("planning");let r,i;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=()=>{const o=setTimeout(()=>{n("thinking")},Zx);return()=>{clearTimeout(o)}},i=[],t[0]=r,t[1]=i):(r=t[0],i=t[1]),V.useEffect(r,i);const a=Xx[e];let s;t[2]!==a.label?(s=m.jsxs("span",{className:"text-xs text-muted-foreground shimmer",children:[a.label,"..."]}),t[2]=a.label,t[3]=s):s=t[3];let u;return t[4]!==a.icon||t[5]!==s?(u=m.jsx("div",{className:"flex items-center gap-1.5 py-2 opacity-60",children:m.jsxs("span",{className:"flex items-center gap-1.5",children:[a.icon,s]})}),t[4]=a.icon,t[5]=s,t[6]=u):u=t[6],u}function Jx(t){const e=W.c(10),{duration:n,parts:r,id:i}=t,a=n/1e3;let s;e[0]!==a?(s=a.toFixed(1),e[0]=a,e[1]=s):s=e[1];const u=s,[o,l]=V.useState(!1),[d,f]=V.useState(!1);let p;if(e[2]!==i||e[3]!==d||e[4]!==o||e[5]!==r||e[6]!==u){const h=r.filter(t3),g=h.some(e3),_=g||d;let y,T;e[8]===Symbol.for("react.memo_cache_sentinel")?(y=()=>l(!0),T=()=>l(!1),e[8]=y,e[9]=T):(y=e[8],T=e[9]),p=m.jsxs("div",{className:"flex flex-col mb-2",children:[m.jsx("button",{type:"button",onClick:()=>!g&&f(!d),onMouseEnter:y,onMouseLeave:T,className:ce("flex items-center gap-1.5 py-2 opacity-60 transition-opacity",!g&&"cursor-pointer hover:opacity-100",g&&"cursor-default"),children:m.jsxs("span",{className:"flex items-center gap-1.5",children:[g?m.jsx(Cr,{className:"text-muted-foreground shrink-0 shimmer",size:14}):o?m.jsx(Tu,{className:ce("text-muted-foreground transition-transform shrink-0",d&&"rotate-90"),size:14}):m.jsx(Su,{className:"text-muted-foreground shrink-0",size:14}),m.jsx("span",{className:ce("text-xs text-muted-foreground",g&&"shimmer"),children:g?"Thinking...":`Thought for ${u}s`})]})}),_&&m.jsx("div",{className:"ml-[6px] border-l-2 pl-4 mt-1 mb-2 max-h-[300px] overflow-y-auto",children:h.map((S,E)=>m.jsx("div",{className:"text-muted-foreground markdown-sm pb-2",children:m.jsx(xa,{id:`${i}-reasoning-${E}`,text:S.text})},`${i}-reasoning-${E}`))})]}),e[2]=i,e[3]=d,e[4]=o,e[5]=r,e[6]=u,e[7]=p}else p=e[7];return p}function e3(t){return t.state==="streaming"}function t3(t){return t.type==="reasoning"}function n3(t){const e=W.c(11),{part:n,id:r,usageStats:i,isFollowedByToolCall:a}=t;switch(n.type){case"dynamic-tool":{let s;return e[0]!==r||e[1]!==n?(s=m.jsx(cu,{part:n,id:r}),e[0]=r,e[1]=n,e[2]=s):s=e[2],s}case"text":{let s;return e[3]!==r||e[4]!==a||e[5]!==n||e[6]!==i?(s=m.jsx(lc,{id:r,part:n,extraActions:i,copyable:!0,hasToolCallAfter:a}),e[3]=r,e[4]=a,e[5]=n,e[6]=i,e[7]=s):s=e[7],s}case"reasoning":return null;case"step-start":case"file":case"source-url":case"source-document":return null;default:if(n.type.startsWith("tool-")){const s=n;let u;return e[8]!==r||e[9]!==s?(u=m.jsx(cu,{part:s,id:r}),e[8]=r,e[9]=s,e[10]=u):u=e[10],u}}throw new Error(`Unknown part type: ${n.type}`)}function r3(t){const e=W.c(32),{message:n,status:r,className:i}=t,{id:a,parts:s}=n,l=r==="streaming"||r==="submitted",d=V.useRef(null);let f;e[0]!==a?(f=()=>{const $=localStorage.getItem(`msg-duration-${a}`);return $?Number($):null},e[0]=a,e[1]=f):f=e[1];const[p,h]=V.useState(f);let g,_;e[2]!==l?(g=()=>{l&&d.current===null&&(d.current=Date.now())},_=[l],e[2]=l,e[3]=g,e[4]=_):(g=e[3],_=e[4]),V.useEffect(g,_);let y,T;e[5]!==p||e[6]!==a||e[7]!==s.length?(y=()=>{if(s.length>0&&p===null&&d.current!==null){const $=Date.now()-d.current;h($),localStorage.setItem(`msg-duration-${a}`,$.toString())}},T=[s.length,p,a],e[5]=p,e[6]=a,e[7]=s.length,e[8]=y,e[9]=T):(y=e[8],T=e[9]),V.useEffect(y,T);const S=s.length>0;let E;e[10]!==s?(E=s.some(a3),e[10]=s,e[11]=E):E=e[11];const R=E;let O;e[12]!==l||e[13]!==s?(O=l&&s.some(i3),e[12]=l,e[13]=s,e[14]=O):O=e[14];const v=S&&(R||O)&&p!==null;let B;e[15]!==n?(B=m.jsx(Gx,{messages:[n]}),e[15]=n,e[16]=B):B=e[16];const z=B;let N;e[17]!==i?(N=ce("w-full min-w-0 group relative flex items-start gap-4 px-4 z-20 text-foreground flex-row",i),e[17]=i,e[18]=N):N=e[18];let F;e[19]!==p||e[20]!==S||e[21]!==a||e[22]!==l||e[23]!==s||e[24]!==v||e[25]!==z?(F=S?m.jsxs(m.Fragment,{children:[v&&m.jsx(Jx,{duration:p,parts:s,id:a}),s.map(($,H)=>{const Q=s[H+1],te=Q&&(Q.type==="dynamic-tool"||Q.type.startsWith("tool-"));return m.jsx(n3,{part:$,id:a,usageStats:H===s.length-1?z:void 0,isFollowedByToolCall:te},`${a}-${H}`)})]}):l?m.jsx(Kx,{}):null,e[19]=p,e[20]=S,e[21]=a,e[22]=l,e[23]=s,e[24]=v,e[25]=z,e[26]=F):F=e[26];let P;e[27]!==F?(P=m.jsx("div",{className:"flex flex-col min-w-0 w-full items-start",children:m.jsx("div",{className:"w-full min-w-0 not-only:rounded-2xl text-sm wrap-break-word overflow-wrap-anywhere bg-transparent",children:F})}),e[27]=F,e[28]=P):P=e[28];let Z;return e[29]!==P||e[30]!==N?(Z=m.jsx("div",{className:N,children:P}),e[29]=P,e[30]=N,e[31]=Z):Z=e[31],Z}function i3(t){return t.type==="reasoning"&&t.state==="streaming"}function a3(t){return t.type==="reasoning"}const cc=V.createContext(null);function dc(t){const e=W.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 s3(t){const e=[];for(let n=0;n<t.length;n++){const r=t[n];if(!V.isValidElement(r))continue;if(r.props?.message?.role==="assistant"){const a=t[n-1],s=V.isValidElement(a)&&a.props?.message?.role,u=a&&V.isValidElement(a)&&s==="user"?a:null;e.push({user:u,assistant:r})}}return e}function u3(t){const e=W.c(27),{children:n,className:r,minHeightOffset:i}=t,a=V.useRef(null);let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=[],e[0]=s):s=e[0];const u=V.useRef(s);let o,l,d,f,p,h,g;if(e[1]!==n||e[2]!==r||e[3]!==i){const S=V.Children.toArray(n),E=S[S.length-1];l=E&&V.isValidElement(E)&&E.type===dc?E:null;const R=l?S.slice(0,-1):S,O=s3(R);let I;e[11]===Symbol.for("react.memo_cache_sentinel")?(I=B=>{const z=u.current[B];if(z&&a.current){const N=a.current.offsetTop,F=z.offsetTop;a.current.scrollTo({top:F-N,behavior:"smooth"})}},e[11]=I):I=e[11];const v=I;o=cc.Provider,e[12]===Symbol.for("react.memo_cache_sentinel")?(g={scrollToPair:v},e[12]=g):g=e[12],p=a,e[13]!==r?(h=ce("w-full min-w-0 max-w-full overflow-y-auto h-full overflow-x-hidden",r),e[13]=r,e[14]=h):h=e[14],d="flex flex-col min-w-0 max-w-2xl mx-auto w-full",f=O.map((B,z)=>{const N=z===O.length-1;return m.jsxs("div",{ref:F=>{u.current[z]=F},className:"flex flex-col pb-2",style:N&&i?{minHeight:`calc(100vh - ${i}px)`}:void 0,children:[m.jsx("div",{className:"sticky top-0 z-50 bg-background w-full h-4"}),m.jsx("div",{className:"sticky mb-3 top-4 z-50",children:B.user&&V.isValidElement(B.user)?V.cloneElement(B.user,{pairIndex:z}):B.user}),B.assistant]},z)}),e[1]=n,e[2]=r,e[3]=i,e[4]=o,e[5]=l,e[6]=d,e[7]=f,e[8]=p,e[9]=h,e[10]=g}else o=e[4],l=e[5],d=e[6],f=e[7],p=e[8],h=e[9],g=e[10];let _;e[15]!==l||e[16]!==d||e[17]!==f?(_=m.jsxs("div",{className:d,children:[f,l]}),e[15]=l,e[16]=d,e[17]=f,e[18]=_):_=e[18];let y;e[19]!==p||e[20]!==h||e[21]!==_?(y=m.jsx("div",{ref:p,className:h,children:_}),e[19]=p,e[20]=h,e[21]=_,e[22]=y):y=e[22];let T;return e[23]!==o||e[24]!==g||e[25]!==y?(T=m.jsx(o,{value:g,children:y}),e[23]=o,e[24]=g,e[25]=y,e[26]=T):T=e[26],T}function o3(t){const e=W.c(5),{locator:n}=St(),r=Du(),i=zi();let a;return e[0]!==n||e[1]!==r||e[2]!==t||e[3]!==i?(a=async(u,o,l)=>{const d=await Lu(n,l),f=d.findIndex(y=>y.id===u);if(f===-1){console.warn(`[branch] Message ${u} not found in thread ${l}`);return}const p=d.slice(0,f).filter(l3),h=crypto.randomUUID(),g=new Date().toISOString(),_={id:h,title:"",created_at:g,updated_at:g,hidden:!1};if(await i.insert.mutateAsync(_),p.length>0){const y=p.map(T=>({...T,id:crypto.randomUUID(),metadata:{...T.metadata,thread_id:h,created_at:T.metadata?.created_at||g}}));await r.insertMany.mutateAsync(y)}t(h)},e[0]=n,e[1]=r,e[2]=t,e[3]=i,e[4]=a):a=e[4],a}function l3(t){return t.role!=="system"}function c3(t){const e=W.c(18),{messageId:n,parts:r}=t,[i,a]=V.useState(!1),{setInputValue:s,startBranch:u,setActiveThreadId:o,activeThreadId:l}=hh(),d=o3(o);let f;e[0]!==r?(f=r.filter(f3).map(d3).join(`
|
|
98
|
-
`),e[0]=r,e[1]=f):f=e[1];const p=f;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=I=>{I.stopPropagation(),a(!0)},e[2]=h):h=e[2];const g=h;let _;e[3]!==l||e[4]!==d||e[5]!==n||e[6]!==p||e[7]!==s||e[8]!==u?(_=async()=>{await d(n,p,l),s(p),u({originalThreadId:l,originalMessageId:n,originalMessageText:p}),a(!1)},e[3]=l,e[4]=d,e[5]=n,e[6]=p,e[7]=s,e[8]=u,e[9]=_):_=e[9];const y=_;let T;e[10]===Symbol.for("react.memo_cache_sentinel")?(T=m.jsx("div",{className:"flex justify-center items-end px-2 pb-1",children:m.jsxs(an,{children:[m.jsx(sn,{asChild:!0,children:m.jsx(Ye,{onClick:g,variant:"ghost",size:"xs",className:"opacity-0 group-hover:opacity-100 hover:bg-gray-200/70 rounded-md transition-opacity text-muted-foreground hover:text-foreground aspect-square w-6 h-6 p-0",children:m.jsx(Cu,{size:16,className:"p-0.5"})})}),m.jsx(un,{side:"bottom",children:"Edit message"})]})}),e[10]=T):T=e[10];let S;e[11]===Symbol.for("react.memo_cache_sentinel")?(S=m.jsxs(Wc,{children:[m.jsx(Qc,{children:"Edit message?"}),m.jsx(Gc,{children:"This will create a new conversation branch from this point. The original conversation will remain unchanged."})]}),e[11]=S):S=e[11];let E;e[12]===Symbol.for("react.memo_cache_sentinel")?(E=m.jsx(Xc,{children:"Cancel"}),e[12]=E):E=e[12];let R;e[13]!==y?(R=m.jsxs(Zc,{children:[S,m.jsxs(Kc,{children:[E,m.jsx(Jc,{onClick:y,children:"Confirm"})]})]}),e[13]=y,e[14]=R):R=e[14];let O;return e[15]!==i||e[16]!==R?(O=m.jsxs(m.Fragment,{children:[T,m.jsx(ed,{open:i,onOpenChange:a,children:R})]}),e[15]=i,e[16]=R,e[17]=O):O=e[17],O}function d3(t){return t.text}function f3(t){return t.type==="text"}function h3(t){const e=W.c(29),{message:n,className:r,pairIndex:i}=t,{id:a,parts:s}=n,u=V.useContext(cc),[o,l]=V.useState(!1);if(!s||s.length===0)return null;let d;e[0]!==u||e[1]!==i?(d=()=>{l(!0),i!==void 0&&u?.scrollToPair(i)},e[0]=u,e[1]=i,e[2]=d):d=e[2];const f=d;let p;e[3]!==r?(p=ce("message-block w-full min-w-0 group relative flex items-start gap-4 px-2.5 text-foreground flex-row-reverse",r),e[3]=r,e[4]=p):p=e[4];let h,g;e[5]===Symbol.for("react.memo_cache_sentinel")?(h=()=>l(!0),g=()=>l(!1),e[5]=h,e[6]=g):(h=e[5],g=e[6]);const _=o?"overflow-auto opacity-100":"overflow-hidden opacity-99 mask-b-from-1%";let y;e[7]!==_?(y=ce("z-10 px-4 py-2 transition-opacity max-h-[120px] flex-1",_),e[7]=_,e[8]=y):y=e[8];let T;if(e[9]!==a||e[10]!==s){let v;e[12]!==a?(v=(B,z)=>B.type==="text"?m.jsx(lc,{id:a,part:B},`${a}-${z}`):null,e[12]=a,e[13]=v):v=e[13],T=s.map(v),e[9]=a,e[10]=s,e[11]=T}else T=e[11];let S;e[14]!==T?(S=m.jsx("div",{children:T}),e[14]=T,e[15]=S):S=e[15];let E;e[16]!==y||e[17]!==S?(E=m.jsx("div",{className:y,children:S}),e[16]=y,e[17]=S,e[18]=E):E=e[18];let R;e[19]!==a||e[20]!==s?(R=m.jsx(c3,{messageId:a,parts:s}),e[19]=a,e[20]=s,e[21]=R):R=e[21];let O;e[22]!==f||e[23]!==R||e[24]!==E?(O=m.jsxs("div",{tabIndex:0,onClick:f,onFocus:h,onBlur:g,className:"w-full border min-w-0 shadow-xs rounded-lg text-[0.9375rem] wrap-break-word overflow-wrap-anywhere bg-background cursor-pointer transition-colors relative flex outline-none",children:[E,R]}),e[22]=f,e[23]=R,e[24]=E,e[25]=O):O=e[25];let I;return e[26]!==O||e[27]!==p?(I=m.jsx(m.Fragment,{children:m.jsx("div",{className:p,children:O})}),e[26]=O,e[27]=p,e[28]=I):I=e[28],I}function p3(t,e){const n=W.c(4);let r;n[0]!==e?(r={},n[0]=e,n[1]=r):r=n[1];const i=r,a=t??rd;let s;return n[2]!==a?(s=ad(a),n[2]=a,n[3]=s):s=n[3],id(a,"LLM",s,i)}function m3(){const t=W.c(8),e=sd();let n;t[0]!==e?(n={connections:e,binding:"LLMS"},t[0]=e,t[1]=n):n=t[1];const[r]=Dc(n),i=p3(r?.id);if(!i||!r){let s;return t[2]===Symbol.for("react.memo_cache_sentinel")?(s=[],t[2]=s):s=t[2],s}let a;if(t[3]!==r||t[4]!==i){let s;t[6]!==r?(s=u=>({...u,name:u.title,contextWindow:u.limits?.contextWindow,outputLimit:u.limits?.maxOutputTokens,inputCost:u.costs?.input,outputCost:u.costs?.output,provider:u.provider,connectionId:r.id,connectionName:r.title}),t[6]=r,t[7]=s):s=t[7],a=i.map(s).sort(g3),t[3]=r,t[4]=i,t[5]=a}else a=t[5];return a}function g3(t,e){return t.name.localeCompare(e.name)}const E3={reasoning:{icon:m.jsx(Cr,{className:"size-4"}),bg:"bg-purple-100",text:"text-purple-700",label:"Reasoning"},"image-upload":{icon:m.jsx(Iu,{className:"size-4"}),bg:"bg-teal-100",text:"text-teal-700",label:"Can analyze images"},"file-upload":{icon:m.jsx(td,{className:"size-4"}),bg:"bg-blue-100",text:"text-blue-700",label:"Can analyze files"},"web-search":{icon:m.jsx(_u,{className:"size-4"}),bg:"bg-amber-100",text:"text-amber-700",label:"Can search the web to answer questions"}},fc=V.memo(function(e){const n=W.c(11),{capability:r}=e,i=E3[r];let a;n[0]!==r||n[1]!==i?(a=i||{icon:m.jsx(Jt,{className:"size-4"}),bg:"bg-slate-200",text:"text-slate-700",label:r},n[0]=r,n[1]=i,n[2]=a):a=n[2];const s=a,u=`flex items-center justify-center h-6 w-6 rounded-sm ${s.bg} ${s.text}`;let o;n[3]!==s.icon||n[4]!==u?(o=m.jsx(sn,{asChild:!0,children:m.jsx("div",{className:u,children:s.icon})}),n[3]=s.icon,n[4]=u,n[5]=o):o=n[5];let l;n[6]!==s.label?(l=m.jsx(un,{children:m.jsx("p",{children:s.label})}),n[6]=s.label,n[7]=l):l=n[7];let d;return n[8]!==o||n[9]!==l?(d=m.jsxs(an,{children:[o,l]}),n[8]=o,n[9]=l,n[10]=d):d=n[10],d}),du=V.memo(function(e){const n=W.c(54),{model:r,compact:i}=e,a=i===void 0?!1:i;if(!r){let T;return n[0]===Symbol.for("react.memo_cache_sentinel")?(T=m.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"Hover to preview"}),n[0]=T):T=n[0],T}const s=r.contextWindow||r.inputCost||r.outputCost||r.outputLimit;if(!s&&!a){let T;n[1]!==r.logo||n[2]!==r.name?(T=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]=T):T=n[3];let S;n[4]!==r.name?(S=m.jsx("p",{className:"text-lg font-medium leading-7",children:r.name}),n[4]=r.name,n[5]=S):S=n[5];let E;n[6]!==T||n[7]!==S?(E=m.jsxs("div",{className:"flex items-center gap-3 py-2 px-0",children:[T,S]}),n[6]=T,n[7]=S,n[8]=E):E=n[8];let R;n[9]!==r.description?(R=r.description&&m.jsx("p",{className:"text-sm text-muted-foreground",children:r.description}),n[9]=r.description,n[10]=R):R=n[10];let O;return n[11]!==E||n[12]!==R?(O=m.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[E,R]}),n[11]=E,n[12]=R,n[13]=O):O=n[13],O}if(!s&&a)return null;if(a){let T;n[14]!==r.contextWindow?(T=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]=T):T=n[15];let S;n[16]!==r.inputCost?(S=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]=S):S=n[17];let E;n[18]!==r.outputCost?(E=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]=E):E=n[19];let R;n[20]!==r.outputLimit?(R=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]=R):R=n[21];let O;return n[22]!==T||n[23]!==S||n[24]!==E||n[25]!==R?(O=m.jsxs("div",{className:"flex flex-col gap-2.5 pt-3 pb-3 px-3 rounded-b-lg text-xs",children:[T,S,E,R]}),n[22]=T,n[23]=S,n[24]=E,n[25]=R,n[26]=O):O=n[26],O}let u;n[27]!==r.logo||n[28]!==r.name?(u=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]=u):u=n[29];let o;n[30]!==r.name?(o=m.jsx("p",{className:"text-lg font-medium leading-7",children:r.name}),n[30]=r.name,n[31]=o):o=n[31];let l;n[32]!==u||n[33]!==o?(l=m.jsxs("div",{className:"flex items-center gap-3",children:[u,o]}),n[32]=u,n[33]=o,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(x3)}),n[35]=r.capabilities,n[36]=d):d=n[36];let f;n[37]!==l||n[38]!==d?(f=m.jsxs("div",{className:"flex flex-col gap-3 py-2 px-0",children:[l,d]}),n[37]=l,n[38]=d,n[39]=f):f=n[39];let p;n[40]!==r.contextWindow?(p=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(Bc,{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]=p):p=n[41];let h;n[42]!==r.inputCost||n[43]!==r.outputCost?(h=(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(ku,{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]=h):h=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(Nu,{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 _;n[47]!==p||n[48]!==h||n[49]!==g?(_=m.jsxs("div",{className:"flex flex-col gap-4",children:[p,h,g]}),n[47]=p,n[48]=h,n[49]=g,n[50]=_):_=n[50];let y;return n[51]!==_||n[52]!==f?(y=m.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[f,_]}),n[51]=_,n[52]=f,n[53]=y):y=n[53],y}),b3=V.memo(function(e){const n=W.c(27),{model:r,onHover:i,isSelected:a,hasExpandedInfo:s}=e,u=s?"rounded-t-lg":"rounded-lg";let o;n[0]!==u?(o=ce("flex items-center gap-2 h-10 py-4 px-3 hover:bg-accent cursor-pointer",u),n[0]=u,n[1]=o):o=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 f;n[8]!==r.name?(f=m.jsx("span",{className:"text-sm text-foreground",children:r.name}),n[8]=r.name,n[9]=f):f=n[9];let p;n[10]!==s||n[11]!==r.capabilities?(p=s&&r.capabilities&&r.capabilities.length>0&&m.jsx("div",{className:"md:hidden flex items-center gap-1.5 ml-auto",children:r.capabilities.map(_3)}),n[10]=s,n[11]=r.capabilities,n[12]=p):p=n[12];let h;n[13]!==s||n[14]!==a?(h=a&&!s&&m.jsx(Jt,{className:"w-4 h-4 text-foreground ml-auto"}),n[13]=s,n[14]=a,n[15]=h):h=n[15];let g;n[16]!==s||n[17]!==a?(g=a&&s&&m.jsx(Jt,{className:"w-4 h-4 text-foreground ml-2 shrink-0"}),n[16]=s,n[17]=a,n[18]=g):g=n[18];let _;return n[19]!==o||n[20]!==l||n[21]!==d||n[22]!==f||n[23]!==p||n[24]!==h||n[25]!==g?(_=m.jsxs("div",{className:o,onMouseEnter:l,children:[d,f,p,h,g]}),n[19]=o,n[20]=l,n[21]=d,n[22]=f,n[23]=p,n[24]=h,n[25]=g,n[26]=_):_=n[26],_});function T3(t){const e=W.c(9),{model:n}=t;if(!n){let s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(s=m.jsx("span",{className:"text-sm text-muted-foreground",children:"Select model"}),e[0]=s):s=e[0],s}let r;e[1]!==n.logo||e[2]!==n.name?(r=n.logo&&m.jsx("img",{src:n.logo,className:"w-5 h-5 shrink-0 rounded-sm",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 truncate min-w-0 max-w-[200px] hidden sm:inline-block",children:n.name}),e[4]=n.name,e[5]=i):i=e[5];let a;return e[6]!==r||e[7]!==i?(a=m.jsxs("div",{className:"flex items-center gap-2 min-w-0 max-w-full",children:[r,i]}),e[6]=r,e[7]=i,e[8]=a):a=e[8],a}function c_(t){const e=W.c(57),{selectedModel:n,onModelChange:r,variant:i,className:a,placeholder:s}=t,u=i===void 0?"borderless":i,o=s===void 0?"Select model":s,[l,d]=V.useState(!1),[f,p]=V.useState(null),[h,g]=V.useState(!1),_=m3();let y;e[0]!==_||e[1]!==n?(y=n?_.find(le=>le.id===n.id&&le.connectionId===n.connectionId)?.id:void 0,e[0]=_,e[1]=n,e[2]=y):y=e[2];const T=y;let S;if(e[3]!==_||e[4]!==T){let le;e[6]!==T?(le=de=>de.id===T,e[6]=T,e[7]=le):le=e[7],S=_.find(le),e[3]=_,e[4]=T,e[5]=S}else S=e[5];const E=S;let R;e[8]!==_||e[9]!==r?(R=le=>{const de=_.find(_e=>_e.id===le);de&&(r({id:de.id,connectionId:de.connectionId,provider:de.provider??void 0}),d(!1))},e[8]=_,e[9]=r,e[10]=R):R=e[10];const O=R;if(_.length===0)return null;const I=T||"",v=u==="borderless"&&"md:border-none";let B;e[11]!==a||e[12]!==v?(B=ce("text-sm hover:bg-accent rounded-lg py-0.5 px-1 gap-1 shadow-none cursor-pointer border-0 group focus-visible:ring-0 focus-visible:ring-offset-0 min-w-0 max-w-full",v,a),e[11]=a,e[12]=v,e[13]=B):B=e[13];let z;e[14]!==E?(z=m.jsx(T3,{model:E}),e[14]=E,e[15]=z):z=e[15];let N;e[16]!==o||e[17]!==z?(N=m.jsx(Uc,{placeholder:o,className:"min-w-0 max-w-full",children:z}),e[16]=o,e[17]=z,e[18]=N):N=e[18];let F;e[19]!==N||e[20]!==B?(F=m.jsx(Hc,{size:"sm",className:B,children:N}),e[19]=N,e[20]=B,e[21]=F):F=e[21];let P;e[22]!==h?(P=()=>g(!h),e[22]=h,e[23]=P):P=e[23];const Z=h?"text-foreground":"text-muted-foreground";let $;e[24]!==Z?($=ce("w-5 h-5 transition-colors",Z),e[24]=Z,e[25]=$):$=e[25];let H;e[26]!==$?(H=m.jsx(nd,{className:$}),e[26]=$,e[27]=H):H=e[27];let Q;e[28]!==P||e[29]!==H?(Q=m.jsx("button",{type:"button",onClick:P,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:H}),e[28]=P,e[29]=H,e[30]=Q):Q=e[30];let te;if(e[31]!==O||e[32]!==_||e[33]!==T||e[34]!==h){let le;e[36]!==O||e[37]!==T||e[38]!==h?(le=de=>m.jsxs("div",{onClick:()=>O(de.id),className:ce("rounded-lg mb-1",de.id===T&&"bg-accent"),children:[m.jsx(b3,{model:de,onHover:p,isSelected:de.id===T,hasExpandedInfo:h}),h&&m.jsx("div",{className:"md:hidden",children:m.jsx(du,{model:de,compact:!0})})]},de.id),e[36]=O,e[37]=T,e[38]=h,e[39]=le):le=e[39],te=_.map(le),e[31]=O,e[32]=_,e[33]=T,e[34]=h,e[35]=te}else te=e[35];let K;e[40]!==te?(K=m.jsx("div",{className:"flex-1 overflow-y-auto px-0.5 md:border-r",children:te}),e[40]=te,e[41]=K):K=e[41];const ge=f||E||null;let k;e[42]!==ge?(k=m.jsx("div",{className:"hidden md:block md:w-[300px] p-3",children:m.jsx(du,{model:ge})}),e[42]=ge,e[43]=k):k=e[43];let ae;e[44]!==K||e[45]!==k?(ae=m.jsxs("div",{className:"flex flex-col md:flex-row h-[350px]",children:[K,k]}),e[44]=K,e[45]=k,e[46]=ae):ae=e[46];let me;e[47]!==o||e[48]!==Q||e[49]!==ae?(me=m.jsx(jc,{title:o,className:"w-full md:w-auto md:min-w-[600px] [&_button[aria-label='Scroll down']]:!hidden [&_button[aria-label='Scroll up']]:!hidden",headerActions:Q,children:ae}),e[47]=o,e[48]=Q,e[49]=ae,e[50]=me):me=e[50];let C;return e[51]!==O||e[52]!==l||e[53]!==F||e[54]!==me||e[55]!==I?(C=m.jsxs(zc,{open:l,onOpenChange:d,value:I,onValueChange:O,children:[F,me]}),e[51]=O,e[52]=l,e[53]=F,e[54]=me,e[55]=I,e[56]=C):C=e[56],C}function x3(t){return m.jsx(fc,{capability:t},t)}function _3(t){return m.jsx(fc,{capability:t},t)}function y3({messageCount:t,sentinelRef:e}){const n=V.useRef(t),r=V.useRef(0);t>n.current&&r.current!==t&&queueMicrotask(()=>{e.current?.scrollIntoView({behavior:"smooth",block:"start"}),r.current=t}),n.current=t}function fu(t,e){const n=V.Children.toArray(t);for(const r of n)if(V.isValidElement(r)&&r.type===e)return r;return null}function A3(t){const e=W.c(5),{className:n,children:r}=t;let i;e[0]!==n?(i=ce("flex flex-col h-full w-full bg-sidebar transform-[translateZ(0)]",n),e[0]=n,e[1]=i):i=e[1];let a;return e[2]!==r||e[3]!==i?(a=m.jsx("div",{className:i,children:r}),e[2]=r,e[3]=i,e[4]=a):a=e[4],a}function k3(t){const e=W.c(11),{children:n}=t;let r;e[0]!==n?(r=fu(n,hc),e[0]=n,e[1]=r):r=e[1];const i=r;let a;e[2]!==n?(a=fu(n,pc),e[2]=n,e[3]=a):a=e[3];const s=a,u=i?.props.children;let o;e[4]!==u?(o=m.jsx("div",{className:"flex items-center gap-2",children:u}),e[4]=u,e[5]=o):o=e[5];const l=s?.props.children;let d;e[6]!==l?(d=m.jsx("div",{className:"flex items-center gap-1",children:l}),e[6]=l,e[7]=d):d=e[7];let f;return e[8]!==o||e[9]!==d?(f=m.jsxs("div",{className:"flex h-12 items-center justify-between border-b border-border px-4 flex-none",children:[o,d]}),e[8]=o,e[9]=d,e[10]=f):f=e[10],f}function hc(t){const e=W.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 pc(t){const e=W.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 C3(t){const e=W.c(5),{children:n,className:r}=t;let i;e[0]!==r?(i=ce("flex-1 min-h-0 overflow-y-auto",r),e[0]=r,e[1]=i):i=e[1];let a;return e[2]!==n||e[3]!==i?(a=m.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=a):a=e[4],a}function I3(t){const e=W.c(2),{children:n}=t;let r;return e[0]!==n?(r=m.jsx("div",{className:"h-full w-full flex items-center justify-center max-w-2xl mx-auto",children:n}),e[0]=n,e[1]=r):r=e[1],r}function S3(t){const e=W.c(12),{messages:n,status:r,minHeightOffset:i}=t,a=i===void 0?240:i,s=V.useRef(null);let u;e[0]!==n.length?(u={messageCount:n.length,sentinelRef:s},e[0]=n.length,e[1]=u):u=e[1],y3(u);let o;if(e[2]!==n||e[3]!==r){let f;e[5]!==n.length||e[6]!==r?(f=(p,h)=>p.role==="user"?m.jsx(h3,{message:p},p.id):p.role==="assistant"?m.jsx(r3,{message:p,status:h===n.length-1?r:void 0},p.id):null,e[5]=n.length,e[6]=r,e[7]=f):f=e[7],o=n.map(f),e[2]=n,e[3]=r,e[4]=o}else o=e[4];let l;e[8]===Symbol.for("react.memo_cache_sentinel")?(l=m.jsx(dc,{children:m.jsx("div",{ref:s,className:"h-0"})}),e[8]=l):l=e[8];let d;return e[9]!==a||e[10]!==o?(d=m.jsxs(u3,{minHeightOffset:a,children:[o,l]}),e[9]=a,e[10]=o,e[11]=d):d=e[11],d}function N3(t){const e=W.c(5),{children:n,className:r}=t;let i;e[0]!==r?(i=ce("flex-none w-full mx-auto p-2","max-w-2xl min-w-0",r),e[0]=r,e[1]=i):i=e[1];let a;return e[2]!==n||e[3]!==i?(a=m.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=a):a=e[4],a}function _a(t){const e=W.c(24),{title:n,description:r,icon:i,variant:a,onDismiss:s,children:u}=t,o=a===void 0?"default":a;let l,d,f,p,h;if(e[0]!==u||e[1]!==r||e[2]!==i||e[3]!==n||e[4]!==o){const E={default:{container:"border-muted-foreground/30 bg-muted/50 hover:bg-muted transition-colors",icon:"text-muted-foreground",title:"text-muted-foreground",description:"text-muted-foreground/70"},danger:{container:"border-destructive/30 bg-destructive/5",icon:"text-destructive",title:"text-destructive font-medium",description:"text-muted-foreground"},warning:{container:"border-amber-500/30 bg-amber-500/5",icon:"text-amber-600 dark:text-amber-500",title:"text-amber-600 dark:text-amber-500 font-medium",description:"text-muted-foreground"}}[o];p=ce("flex items-start gap-2 px-3 py-2.5 rounded-lg border border-dashed text-sm w-full",E.container),h=i&&m.jsx("div",{className:ce("mt-0.5 shrink-0",E.icon),children:i}),l="flex-1 min-w-0",d=n&&m.jsx("div",{className:ce("text-xs mb-1",E.title),children:n}),f=r&&m.jsx("div",{className:ce("text-xs line-clamp-2",E.description,u?"mb-2":""),children:r}),e[0]=u,e[1]=r,e[2]=i,e[3]=n,e[4]=o,e[5]=l,e[6]=d,e[7]=f,e[8]=p,e[9]=h}else l=e[5],d=e[6],f=e[7],p=e[8],h=e[9];let g;e[10]!==u?(g=u&&m.jsx("div",{className:"flex gap-2",children:u}),e[10]=u,e[11]=g):g=e[11];let _;e[12]!==l||e[13]!==d||e[14]!==f||e[15]!==g?(_=m.jsxs("div",{className:l,children:[d,f,g]}),e[12]=l,e[13]=d,e[14]=f,e[15]=g,e[16]=_):_=e[16];let y;e[17]!==s?(y=s&&m.jsx("button",{type:"button",onClick:s,className:"text-muted-foreground hover:text-foreground transition-colors shrink-0",title:"Dismiss",children:m.jsx(Pc,{size:14})}),e[17]=s,e[18]=y):y=e[18];let T;return e[19]!==p||e[20]!==h||e[21]!==_||e[22]!==y?(T=m.jsxs("div",{className:p,children:[h,_,y]}),e[19]=p,e[20]=h,e[21]=_,e[22]=y,e[23]=T):T=e[23],T}function w3(t){const e=W.c(10),{branchContext:n,clearBranchContext:r,onGoToOriginalMessage:i,setInputValue:a}=t;if(!n)return null;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=m.jsx(Au,{size:14}),e[0]=s):s=e[0];let u;e[1]!==r||e[2]!==a?(u=()=>{r(),a("")},e[1]=r,e[2]=a,e[3]=u):u=e[3];let o;e[4]!==i?(o=m.jsx(Ye,{size:"sm",variant:"outline",onClick:i,className:"h-7 text-xs",children:"View original"}),e[4]=i,e[5]=o):o=e[5];let l;return e[6]!==n.originalMessageText||e[7]!==u||e[8]!==o?(l=m.jsx(_a,{variant:"default",title:"Editing message (click to view original)",description:n.originalMessageText,icon:s,onDismiss:u,children:o}),e[6]=n.originalMessageText,e[7]=u,e[8]=o,e[9]=l):l=e[9],l}function R3(t){const e=W.c(8),{error:n,onFixInChat:r,onDismiss:i}=t;if(!n)return null;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsx(bu,{size:16}),e[0]=a):a=e[0];let s;e[1]!==r?(s=m.jsx(Ye,{size:"sm",variant:"outline",onClick:r,className:"h-7 text-xs",children:"Fix in chat"}),e[1]=r,e[2]=s):s=e[2];let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsx(Ye,{size:"sm",variant:"outline",disabled:!0,className:"h-7 text-xs",children:"Report"}),e[3]=u):u=e[3];let o;return e[4]!==n.message||e[5]!==i||e[6]!==s?(o=m.jsxs(_a,{variant:"danger",title:"Error occurred",description:n.message,icon:a,onDismiss:i,children:[s,u]}),e[4]=n.message,e[5]=i,e[6]=s,e[7]=o):o=e[7],o}function O3(t){const e=W.c(7),{finishReason:n,onContinue:r,onDismiss:i}=t;if(!n||n==="stop")return null;const s=L3(n);let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsx(vc,{size:16}),e[0]=u):u=e[0];let o;e[1]!==r?(o=m.jsx(Ye,{size:"sm",variant:"outline",onClick:r,className:"h-7 text-xs",children:"Continue"}),e[1]=r,e[2]=o):o=e[2];let l;return e[3]!==i||e[4]!==s||e[5]!==o?(l=m.jsx(_a,{variant:"warning",title:"Response incomplete",description:s,icon:u,onDismiss:i,children:o}),e[3]=i,e[4]=s,e[5]=o,e[6]=l):l=e[6],l}function L3(t){switch(t){case"length":return"Response reached the model's output limit. Different models have different limits. Try switching models or asking it to continue.";case"content-filter":return"Response was filtered due to content policy.";case"tool-calls":return"Response paused after tool execution to prevent infinite loops and save costs. Click continue to keep working.";default:return`Response stopped unexpectedly: ${t}`}}const d_=Object.assign(A3,{Header:Object.assign(k3,{Left:hc,Right:pc}),Main:C3,Messages:S3,EmptyState:I3,Footer:N3,Input:bh,BranchPreview:w3,ErrorBanner:R3,FinishReasonWarning:O3,Provider:dh});function f_({title:t="No model provider connected",description:e="Connect to a model provider to unlock AI-powered features.",orgSlug:n,orgId:r,userId:i,allConnections:a,onInstallMcpServer:s}){const[u,o]=V.useState(!1),l=ud(),d=Oc(),f=async()=>{if(!r||!i){di.error("Not authenticated");return}o(!0);try{const p=a?.find(_=>_.connection_url===cd);if(p){d({to:"/$org/mcps/$connectionId",params:{org:n,connectionId:p.id}});return}const h=dd({id:fd("conn")}),g=await l.create.mutateAsync(h);d({to:"/$org/mcps/$connectionId",params:{org:n,connectionId:g.id}})}catch(p){di.error(`Failed to connect OpenRouter: ${p instanceof Error?p.message:String(p)}`)}finally{o(!1)}};return m.jsx(od,{image:m.jsx("img",{src:"/empty-state-openrouter.svg",alt:"",width:336,height:320,"aria-hidden":"true",className:"w-xs h-auto mask-radial-[100%_100%] mask-radial-from-20% mask-radial-to-50% mask-radial-at-center"}),title:t,description:e,actions:m.jsxs(m.Fragment,{children:[m.jsxs(Ye,{variant:"outline",onClick:f,disabled:u,children:[m.jsx("img",{src:ld,alt:"OpenRouter",className:"size-4"}),u?"Installing...":"Install OpenRouter"]}),m.jsx(Ye,{variant:"outline",onClick:s,children:"Install Connection"})]})})}function D3(t){const e=new Date(t),r=new Date().getTime()-e.getTime(),i=Math.floor(r/6e4),a=Math.floor(r/36e5);return i<1?"now":i<60?`${i}m`:`${a}h`}function v3(t){const e=new Date,n=new Date(e.getFullYear(),e.getMonth(),e.getDate()),r=new Date(n.getTime()-864e5),i=new Date(n.getTime()-7*864e5),a=new Date(n.getTime()-30*864e5),s=[],u=[],o=[],l=[],d=[];for(const p of t){const h=new Date(p.updated_at);h>=n?s.push(p):h>=r?u.push(p):h>=i?o.push(p):h>=a?l.push(p):d.push(p)}const f=[];return s.length>0&&f.push({label:"Today",threads:s,showRelativeTime:!0}),u.length>0&&f.push({label:"Yesterday",threads:u,showRelativeTime:!1}),o.length>0&&f.push({label:"7 days ago",threads:o,showRelativeTime:!1}),l.length>0&&f.push({label:"30 days ago",threads:l,showRelativeTime:!1}),d.length>0&&f.push({label:"Older",threads:d,showRelativeTime:!1}),f}function h_(t){const e=W.c(49),{threads:n,activeThreadId:r,onSelectThread:i,onRemoveThread:a,onOpen:s,variant:u}=t,o=u===void 0?"icon":u,[l,d]=V.useState("");let f,p,h,g,_,y,T,S,E,R,O,I;if(e[0]!==r||e[1]!==s||e[2]!==a||e[3]!==i||e[4]!==l||e[5]!==n||e[6]!==o){const P=l.trim()?n.filter(K=>(K.title||"New chat").toLowerCase().includes(l.toLowerCase())):n,Z=v3(P);let $;e[19]!==s?($=K=>{K?s?.():d("")},e[19]=s,e[20]=$):$=e[20];const H=$;g=pu,h=an,p=mu,R=H,e[21]!==o?(O=m.jsx(sn,{asChild:!0,children:m.jsx(gu,{asChild:!0,children:o==="outline"?m.jsx(Ye,{type:"button",variant:"outline",size:"icon",className:"size-7 border border-input","aria-label":"Chat history",children:m.jsx(Sa,{size:16})}):m.jsx(Ye,{type:"button",variant:"ghost",size:"icon",className:"size-6 p-1 hover:bg-transparent","aria-label":"Chat history",children:m.jsx(Sa,{size:16,className:"text-muted-foreground hover:text-foreground transition-colors"})})})}),e[21]=o,e[22]=O):O=e[22],e[23]===Symbol.for("react.memo_cache_sentinel")?(I=m.jsx(un,{children:"Chat history"}),e[23]=I):I=e[23],f=Eu,T="end",S="w-80 p-0";let Q;e[24]===Symbol.for("react.memo_cache_sentinel")?(Q=m.jsx(_u,{size:16,className:"text-muted-foreground shrink-0"}),e[24]=Q):Q=e[24];let te;e[25]===Symbol.for("react.memo_cache_sentinel")?(te=K=>d(K.target.value),e[25]=te):te=e[25],e[26]!==l?(E=m.jsx("div",{className:"border-b",children:m.jsxs("label",{className:"flex items-center gap-2.5 h-12 px-4 cursor-text",children:[Q,m.jsx("input",{type:"text",placeholder:"Search chats...",value:l,onChange:te,className:"flex-1 border-0 shadow-none focus:outline-none px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"})]})}),e[26]=l,e[27]=E):E=e[27],_="max-h-[300px] overflow-y-auto",y=P.length===0?m.jsx("div",{className:"p-4 text-center text-sm text-muted-foreground",children:l.trim()?"No chats found":"No chats yet"}):Z.map((K,ge)=>m.jsxs("div",{children:[ge>0&&m.jsx("div",{className:"border-t mx-3"}),m.jsx("div",{className:"px-3 py-1",children:m.jsx("span",{className:"text-xs font-medium text-muted-foreground tracking-wide",children:K.label})}),K.threads.map(k=>{const ae=k.id===r;return m.jsxs("div",{className:`flex items-center gap-2 px-3 py-2 hover:bg-accent cursor-pointer group ${ae?"bg-accent/50":""}`,onClick:()=>i(k.id),children:[m.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[m.jsx("span",{className:"text-sm truncate",children:k.title||"New chat"}),m.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:ae?"current":K.showRelativeTime?D3(k.updated_at):null})]}),m.jsx("button",{type:"button",onClick:me=>{me.stopPropagation(),a(k.id)},className:"opacity-0 cursor-pointer group/trash group-hover:opacity-100 p-1 hover:bg-destructive/10 rounded transition-opacity",title:"Remove chat",children:m.jsx(hd,{size:14,className:"text-muted-foreground group-hover/trash:text-destructive"})})]},k.id)})]},K.label)),e[0]=r,e[1]=s,e[2]=a,e[3]=i,e[4]=l,e[5]=n,e[6]=o,e[7]=f,e[8]=p,e[9]=h,e[10]=g,e[11]=_,e[12]=y,e[13]=T,e[14]=S,e[15]=E,e[16]=R,e[17]=O,e[18]=I}else f=e[7],p=e[8],h=e[9],g=e[10],_=e[11],y=e[12],T=e[13],S=e[14],E=e[15],R=e[16],O=e[17],I=e[18];let v;e[28]!==_||e[29]!==y?(v=m.jsx("div",{className:_,children:y}),e[28]=_,e[29]=y,e[30]=v):v=e[30];let B;e[31]!==f||e[32]!==v||e[33]!==T||e[34]!==S||e[35]!==E?(B=m.jsxs(f,{align:T,className:S,children:[E,v]}),e[31]=f,e[32]=v,e[33]=T,e[34]=S,e[35]=E,e[36]=B):B=e[36];let z;e[37]!==p||e[38]!==B||e[39]!==R||e[40]!==O||e[41]!==I?(z=m.jsxs(p,{onOpenChange:R,children:[O,I,B]}),e[37]=p,e[38]=B,e[39]=R,e[40]=O,e[41]=I,e[42]=z):z=e[42];let N;e[43]!==h||e[44]!==z?(N=m.jsx(h,{children:z}),e[43]=h,e[44]=z,e[45]=N):N=e[45];let F;return e[46]!==g||e[47]!==N?(F=m.jsx(g,{children:N}),e[46]=g,e[47]=N,e[48]=F):F=e[48],F}export{d_ as C,i_ as D,l_ as G,c_ as M,f_ as N,h_ as T,Gx as U,a_ as a,m3 as b,s_ as c,o_ as d,dh as e,bh as f,hh as u};
|
|
94
|
+
`,...a.current()});return/^[\t ]/.test(l)&&(l=Xn(l.charCodeAt(0))+l.slice(1)),l=l?s+" "+l:s,n.options.closeAtx&&(l+=" "+s),o(),u(),l}ql.peek=AT;function ql(t){return t.value||""}function AT(){return"<"}Vl.peek=kT;function Vl(t,e,n,r){const i=ka(n),a=i==='"'?"Quote":"Apostrophe",s=n.enter("image");let u=n.enter("label");const o=n.createTracker(r);let l=o.move("![");return l+=o.move(n.safe(t.alt,{before:l,after:"]",...o.current()})),l+=o.move("]("),u(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(u=n.enter("destinationLiteral"),l+=o.move("<"),l+=o.move(n.safe(t.url,{before:l,after:">",...o.current()})),l+=o.move(">")):(u=n.enter("destinationRaw"),l+=o.move(n.safe(t.url,{before:l,after:t.title?" ":")",...o.current()}))),u(),t.title&&(u=n.enter(`title${a}`),l+=o.move(" "+i),l+=o.move(n.safe(t.title,{before:l,after:i,...o.current()})),l+=o.move(i),u()),l+=o.move(")"),s(),l}function kT(){return"!"}Wl.peek=CT;function Wl(t,e,n,r){const i=t.referenceType,a=n.enter("imageReference");let s=n.enter("label");const u=n.createTracker(r);let o=u.move("![");const l=n.safe(t.alt,{before:o,after:"]",...u.current()});o+=u.move(l+"]["),s();const d=n.stack;n.stack=[],s=n.enter("reference");const f=n.safe(n.associationId(t),{before:o,after:"]",...u.current()});return s(),n.stack=d,a(),i==="full"||!l||l!==f?o+=u.move(f+"]"):i==="shortcut"?o=o.slice(0,-1):o+=u.move("]"),o}function CT(){return"!"}Ql.peek=IT;function Ql(t,e,n){let r=t.value||"",i="`",a=-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+" ");++a<n.unsafe.length;){const s=n.unsafe[a],u=n.compilePattern(s);let o;if(s.atBreak)for(;o=u.exec(r);){let l=o.index;r.charCodeAt(l)===10&&r.charCodeAt(l-1)===13&&l--,r=r.slice(0,l)+" "+r.slice(o.index+1)}}return i+r+i}function IT(){return"`"}function Gl(t,e){const n=ca(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))}Xl.peek=ST;function Xl(t,e,n,r){const i=ka(n),a=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r);let u,o;if(Gl(t,n)){const d=n.stack;n.stack=[],u=n.enter("autolink");let f=s.move("<");return f+=s.move(n.containerPhrasing(t,{before:f,after:">",...s.current()})),f+=s.move(">"),u(),n.stack=d,f}u=n.enter("link"),o=n.enter("label");let l=s.move("[");return l+=s.move(n.containerPhrasing(t,{before:l,after:"](",...s.current()})),l+=s.move("]("),o(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(o=n.enter("destinationLiteral"),l+=s.move("<"),l+=s.move(n.safe(t.url,{before:l,after:">",...s.current()})),l+=s.move(">")):(o=n.enter("destinationRaw"),l+=s.move(n.safe(t.url,{before:l,after:t.title?" ":")",...s.current()}))),o(),t.title&&(o=n.enter(`title${a}`),l+=s.move(" "+i),l+=s.move(n.safe(t.title,{before:l,after:i,...s.current()})),l+=s.move(i),o()),l+=s.move(")"),u(),l}function ST(t,e,n){return Gl(t,n)?"<":"["}Zl.peek=NT;function Zl(t,e,n,r){const i=t.referenceType,a=n.enter("linkReference");let s=n.enter("label");const u=n.createTracker(r);let o=u.move("[");const l=n.containerPhrasing(t,{before:o,after:"]",...u.current()});o+=u.move(l+"]["),s();const d=n.stack;n.stack=[],s=n.enter("reference");const f=n.safe(n.associationId(t),{before:o,after:"]",...u.current()});return s(),n.stack=d,a(),i==="full"||!l||l!==f?o+=u.move(f+"]"):i==="shortcut"?o=o.slice(0,-1):o+=u.move("]"),o}function NT(){return"["}function Ca(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 wT(t){const e=Ca(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 RT(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 Kl(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 OT(t,e,n,r){const i=n.enter("list"),a=n.bulletCurrent;let s=t.ordered?RT(n):Ca(n);const u=t.ordered?s==="."?")":".":wT(n);let o=e&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!t.ordered){const d=t.children?t.children[0]:void 0;if((s==="*"||s==="-")&&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&&(o=!0),Kl(n)===s&&d){let f=-1;for(;++f<t.children.length;){const p=t.children[f];if(p&&p.type==="listItem"&&p.children&&p.children[0]&&p.children[0].type==="thematicBreak"){o=!0;break}}}}o&&(s=u),n.bulletCurrent=s;const l=n.containerFlow(t,r);return n.bulletLastUsed=s,n.bulletCurrent=a,i(),l}function LT(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 DT(t,e,n,r){const i=LT(n);let a=n.bulletCurrent||Ca(n);e&&e.type==="list"&&e.ordered&&(a=(typeof e.start=="number"&&e.start>-1?e.start:1)+(n.options.incrementListMarker===!1?0:e.children.indexOf(t))+a);let s=a.length+1;(i==="tab"||i==="mixed"&&(e&&e.type==="list"&&e.spread||t.spread))&&(s=Math.ceil(s/4)*4);const u=n.createTracker(r);u.move(a+" ".repeat(s-a.length)),u.shift(s);const o=n.enter("listItem"),l=n.indentLines(n.containerFlow(t,u.current()),d);return o(),l;function d(f,p,h){return p?(h?"":" ".repeat(s))+f:(h?a:a+" ".repeat(s-a.length))+f}}function vT(t,e,n,r){const i=n.enter("paragraph"),a=n.enter("phrasing"),s=n.containerPhrasing(t,r);return a(),i(),s}const PT=jr(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function MT(t,e,n,r){return(t.children.some(function(s){return PT(s)})?n.containerPhrasing:n.containerFlow).call(n,t,r)}function BT(t){const e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}Jl.peek=FT;function Jl(t,e,n,r){const i=BT(n),a=n.enter("strong"),s=n.createTracker(r),u=s.move(i+i);let o=s.move(n.containerPhrasing(t,{after:i,before:u,...s.current()}));const l=o.charCodeAt(0),d=Rr(r.before.charCodeAt(r.before.length-1),l,i);d.inside&&(o=Xn(l)+o.slice(1));const f=o.charCodeAt(o.length-1),p=Rr(r.after.charCodeAt(0),f,i);p.inside&&(o=o.slice(0,-1)+Xn(f));const h=s.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:p.outside,before:d.outside},u+o+h}function FT(t,e,n){return n.options.strong||"*"}function UT(t,e,n,r){return n.safe(t.value,r)}function HT(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 jT(t,e,n){const r=(Kl(n)+(n.options.ruleSpaces?" ":"")).repeat(HT(n));return n.options.ruleSpaces?r.slice(0,-1):r}const ec={blockquote:cT,break:lu,code:gT,definition:bT,emphasis:Yl,hardBreak:lu,heading:yT,html:ql,image:Vl,imageReference:Wl,inlineCode:Ql,link:Xl,linkReference:Zl,list:OT,listItem:DT,paragraph:vT,root:MT,strong:Jl,text:UT,thematicBreak:jT};function zT(){return{enter:{table:$T,tableData:cu,tableHeader:cu,tableRow:qT},exit:{codeText:VT,table:YT,tableData:gi,tableHeader:gi,tableRow:gi}}}function $T(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 YT(t){this.exit(t),this.data.inTable=void 0}function qT(t){this.enter({type:"tableRow",children:[]},t)}function gi(t){this.exit(t)}function cu(t){this.enter({type:"tableCell",children:[]},t)}function VT(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,WT));const n=this.stack[this.stack.length-1];n.type,n.value=e,this.exit(t)}function WT(t,e){return e==="|"?e:t}function QT(t){const e=t||{},n=e.tableCellPadding,r=e.tablePipeAlign,i=e.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
95
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:s,tableCell:o,tableRow:u}};function s(h,g,_,y){return l(d(h,_,y),h.align)}function u(h,g,_,y){const T=f(h,_,y),I=l([T]);return I.slice(0,I.indexOf(`
|
|
96
|
+
`))}function o(h,g,_,y){const T=_.enter("tableCell"),I=_.enter("phrasing"),E=_.containerPhrasing(h,{...y,before:a,after:a});return I(),T(),E}function l(h,g){return oT(h,{align:g,alignDelimiters:r,padding:n,stringLength:i})}function d(h,g,_){const y=h.children;let T=-1;const I=[],E=g.enter("table");for(;++T<y.length;)I[T]=f(y[T],g,_);return E(),I}function f(h,g,_){const y=h.children;let T=-1;const I=[],E=g.enter("tableRow");for(;++T<y.length;)I[T]=o(y[T],h,g,_);return E(),I}function p(h,g,_){let y=ec.inlineCode(h,g,_);return _.stack.includes("tableCell")&&(y=y.replace(/\|/g,"\\$&")),y}}function GT(){return{exit:{taskListCheckValueChecked:du,taskListCheckValueUnchecked:du,paragraph:ZT}}}function XT(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:KT}}}function du(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function ZT(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 a=-1,s;for(;++a<i.length;){const u=i[a];if(u.type==="paragraph"){s=u;break}}s===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 KT(t,e,n,r){const i=t.children[0],a=typeof t.checked=="boolean"&&i&&i.type==="paragraph",s="["+(t.checked?"x":" ")+"] ",u=n.createTracker(r);a&&u.move(s);let o=ec.listItem(t,e,n,{...r,...u.current()});return a&&(o=o.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),o;function l(d){return d+s}}function JT(){return[O2(),K2(),nT(),zT(),GT()]}function ex(t){return{extensions:[L2(),J2(t),rT(),QT(t),XT()]}}const tx={tokenize:ux,partial:!0},tc={tokenize:ox,partial:!0},nc={tokenize:lx,partial:!0},rc={tokenize:cx,partial:!0},nx={tokenize:dx,partial:!0},ic={name:"wwwAutolink",tokenize:ax,previous:sc},ac={name:"protocolAutolink",tokenize:sx,previous:uc},_t={name:"emailAutolink",tokenize:ix,previous:oc},pt={};function rx(){return{text:pt}}let Ut=48;for(;Ut<123;)pt[Ut]=_t,Ut++,Ut===58?Ut=65:Ut===91&&(Ut=97);pt[43]=_t;pt[45]=_t;pt[46]=_t;pt[95]=_t;pt[72]=[_t,ac];pt[104]=[_t,ac];pt[87]=[_t,ic];pt[119]=[_t,ic];function ix(t,e,n){const r=this;let i,a;return s;function s(f){return!zi(f)||!oc.call(r,r.previous)||Ia(r.events)?n(f):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),u(f))}function u(f){return zi(f)?(t.consume(f),u):f===64?(t.consume(f),o):n(f)}function o(f){return f===46?t.check(nx,d,l)(f):f===45||f===95||Be(f)?(a=!0,t.consume(f),o):d(f)}function l(f){return t.consume(f),i=!0,o}function d(f){return a&&i&&ze(r.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(f)):n(f)}}function ax(t,e,n){const r=this;return i;function i(s){return s!==87&&s!==119||!sc.call(r,r.previous)||Ia(r.events)?n(s):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(tx,t.attempt(tc,t.attempt(nc,a),n),n)(s))}function a(s){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(s)}}function sx(t,e,n){const r=this;let i="",a=!1;return s;function s(f){return(f===72||f===104)&&uc.call(r,r.previous)&&!Ia(r.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),i+=String.fromCodePoint(f),t.consume(f),u):n(f)}function u(f){if(ze(f)&&i.length<5)return i+=String.fromCodePoint(f),t.consume(f),u;if(f===58){const p=i.toLowerCase();if(p==="http"||p==="https")return t.consume(f),o}return n(f)}function o(f){return f===47?(t.consume(f),a?l:(a=!0,o)):n(f)}function l(f){return f===null||Cr(f)||be(f)||Wt(f)||Fr(f)?n(f):t.attempt(tc,t.attempt(nc,d),n)(f)}function d(f){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(f)}}function ux(t,e,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,t.consume(s),i):s===46&&r===3?(t.consume(s),a):n(s)}function a(s){return s===null?n(s):e(s)}}function ox(t,e,n){let r,i,a;return s;function s(l){return l===46||l===95?t.check(rc,o,u)(l):l===null||be(l)||Wt(l)||l!==45&&Fr(l)?o(l):(a=!0,t.consume(l),s)}function u(l){return l===95?r=!0:(i=r,r=void 0),t.consume(l),s}function o(l){return i||r||!a?n(l):e(l)}}function lx(t,e){let n=0,r=0;return i;function i(s){return s===40?(n++,t.consume(s),i):s===41&&r<n?a(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?t.check(rc,e,a)(s):s===null||be(s)||Wt(s)?e(s):(t.consume(s),i)}function a(s){return s===41&&r++,t.consume(s),i}}function cx(t,e,n){return r;function r(u){return u===33||u===34||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===63||u===95||u===126?(t.consume(u),r):u===38?(t.consume(u),a):u===93?(t.consume(u),i):u===60||u===null||be(u)||Wt(u)?e(u):n(u)}function i(u){return u===null||u===40||u===91||be(u)||Wt(u)?e(u):r(u)}function a(u){return ze(u)?s(u):n(u)}function s(u){return u===59?(t.consume(u),r):ze(u)?(t.consume(u),s):n(u)}}function dx(t,e,n){return r;function r(a){return t.consume(a),i}function i(a){return Be(a)?n(a):e(a)}}function sc(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||be(t)}function uc(t){return!ze(t)}function oc(t){return!(t===47||zi(t))}function zi(t){return t===43||t===45||t===46||t===95||Be(t)}function Ia(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 fx={tokenize:xx,partial:!0};function hx(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Ex,continuation:{tokenize:bx},exit:Tx}},text:{91:{name:"gfmFootnoteCall",tokenize:gx},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:px,resolveTo:mx}}}}function px(t,e,n){const r=this;let i=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const o=r.events[i][1];if(o.type==="labelImage"){s=o;break}if(o.type==="gfmFootnoteCall"||o.type==="labelLink"||o.type==="label"||o.type==="image"||o.type==="link")break}return u;function u(o){if(!s||!s._balanced)return n(o);const l=st(r.sliceSerialize({start:s.end,end:r.now()}));return l.codePointAt(0)!==94||!a.includes(l.slice(1))?n(o):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(o),t.exit("gfmFootnoteCallLabelMarker"),e(o))}}function mx(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 a={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},t[t.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},u=[t[n+1],t[n+2],["enter",r,e],t[n+3],t[n+4],["enter",i,e],["exit",i,e],["enter",a,e],["enter",s,e],["exit",s,e],["exit",a,e],t[t.length-2],t[t.length-1],["exit",r,e]];return t.splice(n,t.length-n+1,...u),t}function gx(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,s;return u;function u(f){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(f),t.exit("gfmFootnoteCallLabelMarker"),o}function o(f){return f!==94?n(f):(t.enter("gfmFootnoteCallMarker"),t.consume(f),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",l)}function l(f){if(a>999||f===93&&!s||f===null||f===91||be(f))return n(f);if(f===93){t.exit("chunkString");const p=t.exit("gfmFootnoteCallString");return i.includes(st(r.sliceSerialize(p)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(f),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(f)}return be(f)||(s=!0),a++,t.consume(f),f===92?d:l}function d(f){return f===91||f===92||f===93?(t.consume(f),a++,l):l(f)}}function Ex(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,s=0,u;return o;function o(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(s>999||g===93&&!u||g===null||g===91||be(g))return n(g);if(g===93){t.exit("chunkString");const _=t.exit("gfmFootnoteDefinitionLabelString");return a=st(r.sliceSerialize(_)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),p}return be(g)||(u=!0),s++,t.consume(g),g===92?f:d}function f(g){return g===91||g===92||g===93?(t.consume(g),s++,d):d(g)}function p(g){return g===58?(t.enter("definitionMarker"),t.consume(g),t.exit("definitionMarker"),i.includes(a)||i.push(a),oe(t,h,"gfmFootnoteDefinitionWhitespace")):n(g)}function h(g){return e(g)}}function bx(t,e,n){return t.check(rr,e,t.attempt(fx,e,n))}function Tx(t){t.exit("gfmFootnoteDefinition")}function xx(t,e,n){const r=this;return oe(t,i,"gfmFootnoteDefinitionIndent",5);function i(a){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?e(a):n(a)}}function _x(t){let n=(t||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,u){let o=-1;for(;++o<s.length;)if(s[o][0]==="enter"&&s[o][1].type==="strikethroughSequenceTemporary"&&s[o][1]._close){let l=o;for(;l--;)if(s[l][0]==="exit"&&s[l][1].type==="strikethroughSequenceTemporary"&&s[l][1]._open&&s[o][1].end.offset-s[o][1].start.offset===s[l][1].end.offset-s[l][1].start.offset){s[o][1].type="strikethroughSequence",s[l][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},s[l][1].start),end:Object.assign({},s[o][1].end)},f={type:"strikethroughText",start:Object.assign({},s[l][1].end),end:Object.assign({},s[o][1].start)},p=[["enter",d,u],["enter",s[l][1],u],["exit",s[l][1],u],["enter",f,u]],h=u.parser.constructs.insideSpan.null;h&&Ze(p,p.length,0,Ur(h,s.slice(l+1,o),u)),Ze(p,p.length,0,[["exit",f,u],["enter",s[o][1],u],["exit",s[o][1],u],["exit",d,u]]),Ze(s,l-1,o-l+3,p),o=l+p.length-2;break}}for(o=-1;++o<s.length;)s[o][1].type==="strikethroughSequenceTemporary"&&(s[o][1].type="data");return s}function a(s,u,o){const l=this.previous,d=this.events;let f=0;return p;function p(g){return l===126&&d[d.length-1][1].type!=="characterEscape"?o(g):(s.enter("strikethroughSequenceTemporary"),h(g))}function h(g){const _=on(l);if(g===126)return f>1?o(g):(s.consume(g),f++,h);if(f<2&&!n)return o(g);const y=s.exit("strikethroughSequenceTemporary"),T=on(g);return y._open=!T||T===2&&!!_,y._close=!_||_===2&&!!T,u(g)}}}class yx{constructor(){this.map=[]}add(e,n,r){Ax(this,e,n,r)}consume(e){if(this.map.sort(function(a,s){return a[0]-s[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 a of i)e.push(a);i=r.pop()}this.map.length=0}}function Ax(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 kx(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 a=r.length-1;r[a]=r[a]==="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 Cx(){return{flow:{null:{name:"table",tokenize:Ix,resolveAll:Sx}}}}function Ix(t,e,n){const r=this;let i=0,a=0,s;return u;function u(N){let F=r.events.length-1;for(;F>-1;){const q=r.events[F][1].type;if(q==="lineEnding"||q==="linePrefix")F--;else break}const P=F>-1?r.events[F][1].type:null,X=P==="tableHead"||P==="tableRow"?S:o;return X===S&&r.parser.lazy[r.now().line]?n(N):X(N)}function o(N){return t.enter("tableHead"),t.enter("tableRow"),l(N)}function l(N){return N===124||(s=!0,a+=1),d(N)}function d(N){return N===null?n(N):Q(N)?a>1?(a=0,r.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(N),t.exit("lineEnding"),h):n(N):ie(N)?oe(t,d,"whitespace")(N):(a+=1,s&&(s=!1,i+=1),N===124?(t.enter("tableCellDivider"),t.consume(N),t.exit("tableCellDivider"),s=!0,d):(t.enter("data"),f(N)))}function f(N){return N===null||N===124||be(N)?(t.exit("data"),d(N)):(t.consume(N),N===92?p:f)}function p(N){return N===92||N===124?(t.consume(N),f):f(N)}function h(N){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(N):(t.enter("tableDelimiterRow"),s=!1,ie(N)?oe(t,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):g(N))}function g(N){return N===45||N===58?y(N):N===124?(s=!0,t.enter("tableCellDivider"),t.consume(N),t.exit("tableCellDivider"),_):O(N)}function _(N){return ie(N)?oe(t,y,"whitespace")(N):y(N)}function y(N){return N===58?(a+=1,s=!0,t.enter("tableDelimiterMarker"),t.consume(N),t.exit("tableDelimiterMarker"),T):N===45?(a+=1,T(N)):N===null||Q(N)?R(N):O(N)}function T(N){return N===45?(t.enter("tableDelimiterFiller"),I(N)):O(N)}function I(N){return N===45?(t.consume(N),I):N===58?(s=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(N),t.exit("tableDelimiterMarker"),E):(t.exit("tableDelimiterFiller"),E(N))}function E(N){return ie(N)?oe(t,R,"whitespace")(N):R(N)}function R(N){return N===124?g(N):N===null||Q(N)?!s||i!==a?O(N):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(N)):O(N)}function O(N){return n(N)}function S(N){return t.enter("tableRow"),v(N)}function v(N){return N===124?(t.enter("tableCellDivider"),t.consume(N),t.exit("tableCellDivider"),v):N===null||Q(N)?(t.exit("tableRow"),e(N)):ie(N)?oe(t,v,"whitespace")(N):(t.enter("data"),B(N))}function B(N){return N===null||N===124||be(N)?(t.exit("data"),v(N)):(t.consume(N),N===92?z:B)}function z(N){return N===92||N===124?(t.consume(N),B):B(N)}}function Sx(t,e){let n=-1,r=!0,i=0,a=[0,0,0,0],s=[0,0,0,0],u=!1,o=0,l,d,f;const p=new yx;for(;++n<t.length;){const h=t[n],g=h[1];h[0]==="enter"?g.type==="tableHead"?(u=!1,o!==0&&(fu(p,e,o,l,d),d=void 0,o=0),l={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},p.add(n,0,[["enter",l,e]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,f=void 0,a=[0,0,0,0],s=[0,n+1,0,0],u&&(u=!1,d={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},p.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,s[2]===0&&(a[1]!==0&&(s[0]=s[1],f=hr(p,e,a,i,void 0,f),a=[0,0,0,0]),s[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(s[0]=s[1],f=hr(p,e,a,i,void 0,f)),a=s,s=[a[1],n,0,0])):g.type==="tableHead"?(u=!0,o=n):g.type==="tableRow"||g.type==="tableDelimiterRow"?(o=n,a[1]!==0?(s[0]=s[1],f=hr(p,e,a,i,n,f)):s[1]!==0&&(f=hr(p,e,s,i,n,f)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(s[3]=n)}for(o!==0&&fu(p,e,o,l,d),p.consume(e.events),n=-1;++n<e.events.length;){const h=e.events[n];h[0]==="enter"&&h[1].type==="table"&&(h[1]._align=kx(e.events,n))}return t}function hr(t,e,n,r,i,a){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",u="tableContent";n[0]!==0&&(a.end=Object.assign({},nn(e.events,n[0])),t.add(n[0],0,[["exit",a,e]]));const o=nn(e.events,n[1]);if(a={type:s,start:Object.assign({},o),end:Object.assign({},o)},t.add(n[1],0,[["enter",a,e]]),n[2]!==0){const l=nn(e.events,n[2]),d=nn(e.events,n[3]),f={type:u,start:Object.assign({},l),end:Object.assign({},d)};if(t.add(n[2],0,[["enter",f,e]]),r!==2){const p=e.events[n[2]],h=e.events[n[3]];if(p[1].end=Object.assign({},h[1].end),p[1].type="chunkText",p[1].contentType="text",n[3]>n[2]+1){const g=n[2]+1,_=n[3]-n[2]-1;t.add(g,_,[])}}t.add(n[3]+1,0,[["exit",f,e]])}return i!==void 0&&(a.end=Object.assign({},nn(e.events,i)),t.add(i,0,[["exit",a,e]]),a=void 0),a}function fu(t,e,n,r,i){const a=[],s=nn(e.events,n);i&&(i.end=Object.assign({},s),a.push(["exit",i,e])),r.end=Object.assign({},s),a.push(["exit",r,e]),t.add(n+1,0,a)}function nn(t,e){const n=t[e],r=n[0]==="enter"?"start":"end";return n[1][r]}const Nx={name:"tasklistCheck",tokenize:Rx};function wx(){return{text:{91:Nx}}}function Rx(t,e,n){const r=this;return i;function i(o){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(o):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(o),t.exit("taskListCheckMarker"),a)}function a(o){return be(o)?(t.enter("taskListCheckValueUnchecked"),t.consume(o),t.exit("taskListCheckValueUnchecked"),s):o===88||o===120?(t.enter("taskListCheckValueChecked"),t.consume(o),t.exit("taskListCheckValueChecked"),s):n(o)}function s(o){return o===93?(t.enter("taskListCheckMarker"),t.consume(o),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),u):n(o)}function u(o){return Q(o)?e(o):ie(o)?t.check({tokenize:Ox},e,n)(o):n(o)}}function Ox(t,e,n){return oe(t,r,"whitespace");function r(i){return i===null?n(i):e(i)}}function Lx(t){return Bo([rx(),hx(),_x(t),Cx(),wx()])}const Dx={};function vx(t){const e=this,n=t||Dx,r=e.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(Lx(n)),a.push(JT()),s.push(ex(n))}const Px=V.lazy(()=>Rc(()=>import("./lazy-highlighter-QHCwZ7Bv.js"),__vite__mapDeps([0,1,2])));function lc(){const t=W.c(3),[e,n]=V.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=async s=>{await navigator.clipboard.writeText(s),n(!0),setTimeout(()=>n(!1),2e3)},t[0]=r):r=t[0];const i=r;let a;return t[1]!==e?(a={handleCopy:i,copied:e},t[1]=e,t[2]=a):a=t[2],a}function Mx(){const t=W.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(Bx)}),t[1]=r):r=t[1],r}function Bx(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 Fx(t){const e=W.c(12),n=V.useRef(null),{handleCopy:r,copied:i}=lc(),a=Ux;let s;e[0]!==r?(s=async()=>{const p=a(n.current);await r(p)},e[0]=r,e[1]=s):s=e[1];const u=s;let o;e[2]!==i?(o=i?m.jsx(sn,{size:12}):m.jsx(Vi,{size:12}),e[2]=i,e[3]=o):o=e[3];let l;e[4]!==u||e[5]!==o?(l=m.jsx("div",{className:"flex justify-end items-center",children:m.jsxs(We,{variant:"ghost",onClick:u,"aria-label":"Copy as CSV",className:"text-muted-foreground hover:text-foreground h-6 text-[10px]",type:"button",children:["Copy as CSV",o]})}),e[4]=u,e[5]=o,e[6]=l):l=e[6];let d;e[7]!==t?(d=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]=d):d=e[8];let f;return e[9]!==l||e[10]!==d?(f=m.jsxs(m.Fragment,{children:[l,d]}),e[9]=l,e[10]=d,e[11]=f):f=e[11],f}function Ux(t){return t?Array.from(t.querySelectorAll("tr")).map(Hx).join(`
|
|
97
|
+
`):""}function Hx(t){return Array.from(t.querySelectorAll("th,td")).map(jx).join(",")}function jx(t){let e=t.textContent||"";return e=e.replace(/"/g,'""'),e.search(/([",\n])/g)>=0&&(e=`"${e}"`),e}const zx=[vx],$x=[C2],Yx={p:t=>m.jsx("p",{...t,className:"leading-relaxed text-sm mb-2 last:mb-0"}),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-sm"}),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(Fx,{...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"})},cc=V.memo(t=>{const e=W.c(2),{content:n}=t;let r;return e[0]!==n?(r=m.jsx(lg,{remarkPlugins:zx,rehypePlugins:$x,components:Yx,children:n}),e[0]=n,e[1]=r):r=e[1],r},(t,e)=>t.content===e.content);function qx(t){const e=W.c(20),{language:n,content:r}=t,{handleCopy:i,copied:a}=lc(),s=n||"text";let u;e[0]!==s?(u=m.jsx("span",{className:"text-xs font-mono uppercase text-muted-foreground tracking-widest select-none",children:s}),e[0]=s,e[1]=u):u=e[1];let o;e[2]!==r||e[3]!==i?(o=()=>i(r),e[2]=r,e[3]=i,e[4]=o):o=e[4];let l;e[5]!==a?(l=a?m.jsx(sn,{size:14}):m.jsx(Vi,{size:14}),e[5]=a,e[6]=l):l=e[6];let d;e[7]!==o||e[8]!==l?(d=m.jsx(We,{size:"icon",variant:"ghost",onClick:o,"aria-label":"Copy code",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:l}),e[7]=o,e[8]=l,e[9]=d):d=e[9];let f;e[10]!==u||e[11]!==d?(f=m.jsxs("div",{className:"flex items-center justify-between p-1 pl-4 bg-muted border-b border-border",children:[u,d]}),e[10]=u,e[11]=d,e[12]=f):f=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=m.jsx(Mx,{}),e[13]=p):p=e[13];let h;e[14]!==r||e[15]!==n?(h=m.jsx(V.Suspense,{fallback:p,children:m.jsx(Px,{language:n,content:r})}),e[14]=r,e[15]=n,e[16]=h):h=e[16];let g;return e[17]!==f||e[18]!==h?(g=m.jsxs("div",{className:"my-4 rounded-lg bg-muted overflow-hidden border border-border grid min-w-0",children:[f,h]}),e[17]=f,e[18]=h,e[19]=g):g=e[19],g}cc.displayName="MemoizedMarkdownBlock";const Sa=t=>{const e=W.c(7),{id:n,text:r}=t;let i;e[0]!==r?(i=he.lexer(r),e[0]=r,e[1]=i):i=e[1];const a=i;let s;if(e[2]!==a||e[3]!==n){let u;e[5]!==n?(u=(o,l)=>o.type==="code"?m.jsx(qx,{language:o.lang,content:o.text},`${n}-block_${l}`):m.jsx(cc,{content:o.raw},`${n}-block_${l}`),e[5]=n,e[6]=u):u=e[6],s=a.map(u),e[2]=a,e[3]=n,e[4]=s}else s=e[4];return s};Sa.displayName="MemoizedMarkdown";function dc(t){const e=W.c(18),{id:n,part:r,copyable:i,extraActions:a,hasToolCallAfter:s}=t,u=i===void 0?!1:i,o=s===void 0?!1:s,{handleCopy:l}=xh(),[d,f]=V.useState(!1);let p;e[0]!==l||e[1]!==r.text?(p=async()=>{await l(r.text),f(!0),setTimeout(()=>f(!1),2e3)},e[0]=l,e[1]=r.text,e[2]=p):p=e[2];const h=p,g=u&&a,_=g||a,y=!o&&"mb-2";let T;e[3]!==y?(T=le("group/part relative",y),e[3]=y,e[4]=T):T=e[4];let I;e[5]!==n||e[6]!==r.text?(I=m.jsx(Sa,{id:n,text:r.text}),e[5]=n,e[6]=r.text,e[7]=I):I=e[7];let E;e[8]!==a||e[9]!==h||e[10]!==d||e[11]!==_||e[12]!==g?(E=_&&m.jsx("div",{className:"flex w-full items-center 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 mt-2",children:m.jsxs("div",{className:"flex items-center gap-1",children:[g&&m.jsx(We,{onClick:h,variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-foreground size-6 whitespace-nowrap",children:d?m.jsx(sn,{size:12}):m.jsx(Vi,{size:12})}),a]})}),e[8]=a,e[9]=h,e[10]=d,e[11]=_,e[12]=g,e[13]=E):E=e[13];let R;return e[14]!==T||e[15]!==I||e[16]!==E?(R=m.jsxs("div",{className:T,children:[I,E]}),e[14]=T,e[15]=I,e[16]=E,e[17]=R):R=e[17],R}function Vx(t){const e=W.c(4),{output:n}=t;let r;if(e[0]!==n){const s=JSON.stringify(n,null,2);r=s.length>2e3?s.slice(0,2e3)+"...[TRUNCATED]":s,e[0]=n,e[1]=r}else r=e[1];const i=r;let a;return e[2]!==i?(a=m.jsx("div",{className:"h-full",children:m.jsx(Au,{code:i,language:"json",height:"100%",readOnly:!0})}),e[2]=i,e[3]=a):a=e[3],a}function hu(t){const e=W.c(35),{part:n}=t,{state:r}=n;let i;e[0]!==n?(i="toolName"in n?n.toolName:n.type.replace("tool-",""),e[0]=n,e[1]=i):i=e[1];const a=i,[s,u]=V.useState(!1),o=(r==="input-streaming"||r==="input-available"||r==="output-available")&&!!n.input,l=r==="output-available",d=r==="output-error";let f;e[2]!==s?(f=()=>u(!s),e[2]=s,e[3]=f):f=e[3];let p;e[4]!==r?(p=r==="output-error"?m.jsx(_u,{className:"size-4 text-destructive shrink-0"}):m.jsx(Wc,{className:le("size-4 text-muted-foreground shrink-0",(r==="input-streaming"||r==="input-available")&&"shimmer")}),e[4]=r,e[5]=p):p=e[5];const h=r==="output-error"&&"text-destructive/90",g=(r==="input-streaming"||r==="input-available")&&"shimmer";let _;e[6]!==h||e[7]!==g?(_=le("text-xs font-medium text-muted-foreground truncate",h,g),e[6]=h,e[7]=g,e[8]=_):_=e[8];const y=r==="input-streaming"&&`Streaming ${a} arguments`,T=r==="input-available"&&`Calling ${a}`,I=r==="output-available"&&`Called ${a}`,E=r==="output-error"&&`Error calling ${a}`;let R;e[9]!==E||e[10]!==_||e[11]!==y||e[12]!==T||e[13]!==I?(R=m.jsxs("span",{className:_,children:[y,T,I,E]}),e[9]=E,e[10]=_,e[11]=y,e[12]=T,e[13]=I,e[14]=R):R=e[14];let O;e[15]!==R||e[16]!==p?(O=m.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[p,R]}),e[15]=R,e[16]=p,e[17]=O):O=e[17];const S=s&&"rotate-90";let v;e[18]!==S?(v=le("size-4 text-muted-foreground transition-transform",S),e[18]=S,e[19]=v):v=e[19];let B;e[20]!==v?(B=m.jsx("div",{className:"flex items-center gap-2 shrink-0",children:m.jsx(yu,{className:v})}),e[20]=v,e[21]=B):B=e[21];let z;e[22]!==O||e[23]!==B||e[24]!==f?(z=m.jsxs("button",{type:"button",onClick:f,className:"flex items-center gap-2 w-full cursor-pointer p-3",children:[O,B]}),e[22]=O,e[23]=B,e[24]=f,e[25]=z):z=e[25];let N;e[26]!==s||e[27]!==n||e[28]!==d||e[29]!==o||e[30]!==l?(N=s&&m.jsxs("div",{className:"flex ml-[7px] px-3 pb-3",children:[m.jsx("div",{className:"w-4 relative shrink-0",children:m.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-0.25 bg-border"})}),m.jsxs("div",{className:"flex flex-col gap-4 flex-1 min-w-0 pt-2",children:[o&&m.jsxs("div",{className:"flex flex-col gap-0.5",children:[m.jsx("div",{className:"px-1 h-5 flex items-center",children:m.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Input"})}),m.jsx("div",{className:"border border-border rounded-lg p-2 h-full max-h-[200px]",children:m.jsx(Au,{code:JSON.stringify(n.input,null,2),language:"json",foldOnMount:!0,height:"100%",readOnly:!0})})]}),l&&m.jsxs("div",{className:"flex flex-col gap-0.5",children:[m.jsx("div",{className:"px-1 h-5 flex items-center",children:m.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Output"})}),m.jsx("div",{className:"border border-border rounded-lg max-h-[200px] overflow-auto p-2 h-full",children:m.jsx(Vx,{output:n.output})})]}),d&&m.jsxs("div",{className:"flex flex-col gap-0.5",children:[m.jsx("div",{className:"px-1 h-5 flex items-center",children:m.jsx("span",{className:"text-xs font-medium text-destructive/90",children:"Error"})}),m.jsx("div",{className:"border border-destructive/20 rounded-lg max-h-[200px] overflow-auto p-2 bg-destructive/10",children:m.jsx("pre",{className:"text-xs font-mono text-destructive whitespace-pre-wrap wrap-break-word",children:"errorText"in n&&typeof n.errorText=="string"?n.errorText:"An unknown error occurred"})})]})]})]}),e[26]=s,e[27]=n,e[28]=d,e[29]=o,e[30]=l,e[31]=N):N=e[31];let F;return e[32]!==z||e[33]!==N?(F=m.jsx("div",{className:"flex flex-col my-4 w-full min-w-0",children:m.jsxs("div",{className:"border border-border/75 rounded-lg flex flex-col bg-background w-full min-w-0 overflow-hidden",children:[z,N]})}),e[32]=z,e[33]=N,e[34]=F):F=e[34],F}const Wx={openrouter:t=>{const e=t?.openrouter;return typeof e=="object"&&e!==null&&"usage"in e&&typeof e.usage=="object"&&e.usage!==null&&"cost"in e.usage&&typeof e.usage.cost=="number"?e.usage.cost:null}};function Qx(t){if(!t?.providerMetadata)return null;for(const e of Object.values(Wx)){const n=e(t.providerMetadata);if(n!==null)return n}return null}function Gx(t){return t.reduce((e,n)=>{const r=n.metadata?.usage;return r?{inputTokens:e.inputTokens+(r.inputTokens??0),outputTokens:e.outputTokens+(r.outputTokens??0),totalTokens:e.totalTokens+(r.totalTokens??0),cost:e.cost+(Qx(r)??0)}:e},{inputTokens:0,outputTokens:0,totalTokens:0,cost:0})}function Xx(t){const e=W.c(38),{messages:n}=t;let r,i,a,s,u,o,l,d,f,p,h,g;if(e[0]!==n){g=Symbol.for("react.early_return_sentinel");e:{const R=Gx(n);if(!R){g=null;break e}const{totalTokens:O,inputTokens:S,outputTokens:v,cost:B}=R;if(a=B,!O&&!S&&!v){g=null;break e}i=dn;let z;e[13]===Symbol.for("react.memo_cache_sentinel")?(z=m.jsx(ku,{size:12}),e[13]=z):z=e[13];const N=m.jsxs(We,{variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-foreground pl-1! h-6 gap-1 whitespace-nowrap",children:[z,m.jsx("span",{className:"text-[10px] font-mono tabular-nums",children:O.toLocaleString()})]});e[14]!==N?(h=m.jsx(fn,{asChild:!0,children:N}),e[14]=N,e[15]=h):h=e[15],r=hn,f="top",p="font-mono text-[11px]",u="grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",e[16]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsx("span",{className:"text-muted",children:"in"}),e[16]=o):o=e[16],l=m.jsx("span",{children:S.toLocaleString()}),e[17]===Symbol.for("react.memo_cache_sentinel")?(d=m.jsx("span",{className:"text-muted",children:"out"}),e[17]=d):d=e[17],s=v.toLocaleString()}e[0]=n,e[1]=r,e[2]=i,e[3]=a,e[4]=s,e[5]=u,e[6]=o,e[7]=l,e[8]=d,e[9]=f,e[10]=p,e[11]=h,e[12]=g}else r=e[1],i=e[2],a=e[3],s=e[4],u=e[5],o=e[6],l=e[7],d=e[8],f=e[9],p=e[10],h=e[11],g=e[12];if(g!==Symbol.for("react.early_return_sentinel"))return g;let _;e[18]!==s?(_=m.jsx("span",{children:s}),e[18]=s,e[19]=_):_=e[19];let y;e[20]!==a?(y=a>0&&m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"text-muted",children:"cost"}),m.jsxs("span",{children:["$",a.toFixed(4)]})]}),e[20]=a,e[21]=y):y=e[21];let T;e[22]!==_||e[23]!==y||e[24]!==u||e[25]!==o||e[26]!==l||e[27]!==d?(T=m.jsxs("div",{className:u,children:[o,l,d,_,y]}),e[22]=_,e[23]=y,e[24]=u,e[25]=o,e[26]=l,e[27]=d,e[28]=T):T=e[28];let I;e[29]!==r||e[30]!==T||e[31]!==f||e[32]!==p?(I=m.jsx(r,{side:f,className:p,children:T}),e[29]=r,e[30]=T,e[31]=f,e[32]=p,e[33]=I):I=e[33];let E;return e[34]!==i||e[35]!==I||e[36]!==h?(E=m.jsxs(i,{children:[h,I]}),e[34]=i,e[35]=I,e[36]=h,e[37]=E):E=e[37],E}const Zx={planning:{icon:m.jsx(Ou,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),label:"Planning next moves"},thinking:{icon:m.jsx(Or,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),label:"Thinking"}},Kx=1200;function Jx(){const t=W.c(7),[e,n]=V.useState("planning");let r,i;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=()=>{const o=setTimeout(()=>{n("thinking")},Kx);return()=>{clearTimeout(o)}},i=[],t[0]=r,t[1]=i):(r=t[0],i=t[1]),V.useEffect(r,i);const a=Zx[e];let s;t[2]!==a.label?(s=m.jsxs("span",{className:"text-xs text-muted-foreground shimmer",children:[a.label,"..."]}),t[2]=a.label,t[3]=s):s=t[3];let u;return t[4]!==a.icon||t[5]!==s?(u=m.jsx("div",{className:"flex items-center gap-1.5 py-2 opacity-60",children:m.jsxs("span",{className:"flex items-center gap-1.5",children:[a.icon,s]})}),t[4]=a.icon,t[5]=s,t[6]=u):u=t[6],u}function e3(t){const e=W.c(10),{duration:n,parts:r,id:i}=t,a=n/1e3;let s;e[0]!==a?(s=a.toFixed(1),e[0]=a,e[1]=s):s=e[1];const u=s,[o,l]=V.useState(!1),[d,f]=V.useState(!1);let p;if(e[2]!==i||e[3]!==d||e[4]!==o||e[5]!==r||e[6]!==u){const h=r.filter(n3),g=h.some(t3),_=g||d;let y,T;e[8]===Symbol.for("react.memo_cache_sentinel")?(y=()=>l(!0),T=()=>l(!1),e[8]=y,e[9]=T):(y=e[8],T=e[9]),p=m.jsxs("div",{className:"flex flex-col mb-2",children:[m.jsx("button",{type:"button",onClick:()=>!g&&f(!d),onMouseEnter:y,onMouseLeave:T,className:le("flex items-center gap-1.5 py-2 opacity-60 transition-opacity",!g&&"cursor-pointer hover:opacity-100",g&&"cursor-default"),children:m.jsxs("span",{className:"flex items-center gap-1.5",children:[g?m.jsx(Or,{className:"text-muted-foreground shrink-0 shimmer",size:14}):o?m.jsx(yu,{className:le("text-muted-foreground transition-transform shrink-0",d&&"rotate-90"),size:14}):m.jsx(wu,{className:"text-muted-foreground shrink-0",size:14}),m.jsx("span",{className:le("text-xs text-muted-foreground",g&&"shimmer"),children:g?"Thinking...":`Thought for ${u}s`})]})}),_&&m.jsx("div",{className:"ml-[6px] border-l-2 pl-4 mt-1 mb-2 max-h-[300px] overflow-y-auto",children:h.map((I,E)=>m.jsx("div",{className:"text-muted-foreground markdown-sm pb-2",children:m.jsx(Sa,{id:`${i}-reasoning-${E}`,text:I.text})},`${i}-reasoning-${E}`))})]}),e[2]=i,e[3]=d,e[4]=o,e[5]=r,e[6]=u,e[7]=p}else p=e[7];return p}function t3(t){return t.state==="streaming"}function n3(t){return t.type==="reasoning"}function r3(t){const e=W.c(11),{part:n,id:r,usageStats:i,isFollowedByToolCall:a}=t;switch(n.type){case"dynamic-tool":{let s;return e[0]!==r||e[1]!==n?(s=m.jsx(hu,{part:n,id:r}),e[0]=r,e[1]=n,e[2]=s):s=e[2],s}case"text":{let s;return e[3]!==r||e[4]!==a||e[5]!==n||e[6]!==i?(s=m.jsx(dc,{id:r,part:n,extraActions:i,copyable:!0,hasToolCallAfter:a}),e[3]=r,e[4]=a,e[5]=n,e[6]=i,e[7]=s):s=e[7],s}case"reasoning":return null;case"step-start":case"file":case"source-url":case"source-document":return null;default:if(n.type.startsWith("tool-")){const s=n;let u;return e[8]!==r||e[9]!==s?(u=m.jsx(hu,{part:s,id:r}),e[8]=r,e[9]=s,e[10]=u):u=e[10],u}}throw new Error(`Unknown part type: ${n.type}`)}function i3(t){const e=W.c(32),{message:n,status:r,className:i}=t,{id:a,parts:s}=n,l=r==="streaming"||r==="submitted",d=V.useRef(null);let f;e[0]!==a?(f=()=>{const q=localStorage.getItem(`msg-duration-${a}`);return q?Number(q):null},e[0]=a,e[1]=f):f=e[1];const[p,h]=V.useState(f);let g,_;e[2]!==l?(g=()=>{l&&d.current===null&&(d.current=Date.now())},_=[l],e[2]=l,e[3]=g,e[4]=_):(g=e[3],_=e[4]),V.useEffect(g,_);let y,T;e[5]!==p||e[6]!==a||e[7]!==s.length?(y=()=>{if(s.length>0&&p===null&&d.current!==null){const q=Date.now()-d.current;h(q),localStorage.setItem(`msg-duration-${a}`,q.toString())}},T=[s.length,p,a],e[5]=p,e[6]=a,e[7]=s.length,e[8]=y,e[9]=T):(y=e[8],T=e[9]),V.useEffect(y,T);const I=s.length>0;let E;e[10]!==s?(E=s.some(s3),e[10]=s,e[11]=E):E=e[11];const R=E;let O;e[12]!==l||e[13]!==s?(O=l&&s.some(a3),e[12]=l,e[13]=s,e[14]=O):O=e[14];const v=I&&(R||O)&&p!==null;let B;e[15]!==n?(B=m.jsx(Xx,{messages:[n]}),e[15]=n,e[16]=B):B=e[16];const z=B;let N;e[17]!==i?(N=le("w-full min-w-0 group relative flex items-start gap-4 px-4 z-20 text-foreground flex-row",i),e[17]=i,e[18]=N):N=e[18];let F;e[19]!==p||e[20]!==I||e[21]!==a||e[22]!==l||e[23]!==s||e[24]!==v||e[25]!==z?(F=I?m.jsxs(m.Fragment,{children:[v&&m.jsx(e3,{duration:p,parts:s,id:a}),s.map((q,j)=>{const Z=s[j+1],te=Z&&(Z.type==="dynamic-tool"||Z.type.startsWith("tool-"));return m.jsx(r3,{part:q,id:a,usageStats:j===s.length-1?z:void 0,isFollowedByToolCall:te},`${a}-${j}`)})]}):l?m.jsx(Jx,{}):null,e[19]=p,e[20]=I,e[21]=a,e[22]=l,e[23]=s,e[24]=v,e[25]=z,e[26]=F):F=e[26];let P;e[27]!==F?(P=m.jsx("div",{className:"flex flex-col min-w-0 w-full items-start",children:m.jsx("div",{className:"w-full min-w-0 not-only:rounded-2xl text-sm wrap-break-word overflow-wrap-anywhere bg-transparent",children:F})}),e[27]=F,e[28]=P):P=e[28];let X;return e[29]!==P||e[30]!==N?(X=m.jsx("div",{className:N,children:P}),e[29]=P,e[30]=N,e[31]=X):X=e[31],X}function a3(t){return t.type==="reasoning"&&t.state==="streaming"}function s3(t){return t.type==="reasoning"}const fc=V.createContext(null);function hc(t){const e=W.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 u3(t){const e=[];for(let n=0;n<t.length;n++){const r=t[n];if(!V.isValidElement(r))continue;if(r.props?.message?.role==="assistant"){const a=t[n-1],s=V.isValidElement(a)&&a.props?.message?.role,u=a&&V.isValidElement(a)&&s==="user"?a:null;e.push({user:u,assistant:r})}}return e}function o3(t){const e=W.c(27),{children:n,className:r,minHeightOffset:i}=t,a=V.useRef(null);let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=[],e[0]=s):s=e[0];const u=V.useRef(s);let o,l,d,f,p,h,g;if(e[1]!==n||e[2]!==r||e[3]!==i){const I=V.Children.toArray(n),E=I[I.length-1];l=E&&V.isValidElement(E)&&E.type===hc?E:null;const R=l?I.slice(0,-1):I,O=u3(R);let S;e[11]===Symbol.for("react.memo_cache_sentinel")?(S=B=>{const z=u.current[B];if(z&&a.current){const N=a.current.offsetTop,F=z.offsetTop;a.current.scrollTo({top:F-N,behavior:"smooth"})}},e[11]=S):S=e[11];const v=S;o=fc.Provider,e[12]===Symbol.for("react.memo_cache_sentinel")?(g={scrollToPair:v},e[12]=g):g=e[12],p=a,e[13]!==r?(h=le("w-full min-w-0 max-w-full overflow-y-auto h-full overflow-x-hidden",r),e[13]=r,e[14]=h):h=e[14],d="flex flex-col min-w-0 max-w-2xl mx-auto w-full",f=O.map((B,z)=>{const N=z===O.length-1;return m.jsxs("div",{ref:F=>{u.current[z]=F},className:"flex flex-col pb-2",style:N&&i?{minHeight:`calc(100vh - ${i}px)`}:void 0,children:[m.jsx("div",{className:"sticky top-0 z-50 bg-background w-full h-4"}),m.jsx("div",{className:"sticky mb-3 top-4 z-50",children:B.user&&V.isValidElement(B.user)?V.cloneElement(B.user,{pairIndex:z}):B.user}),B.assistant]},z)}),e[1]=n,e[2]=r,e[3]=i,e[4]=o,e[5]=l,e[6]=d,e[7]=f,e[8]=p,e[9]=h,e[10]=g}else o=e[4],l=e[5],d=e[6],f=e[7],p=e[8],h=e[9],g=e[10];let _;e[15]!==l||e[16]!==d||e[17]!==f?(_=m.jsxs("div",{className:d,children:[f,l]}),e[15]=l,e[16]=d,e[17]=f,e[18]=_):_=e[18];let y;e[19]!==p||e[20]!==h||e[21]!==_?(y=m.jsx("div",{ref:p,className:h,children:_}),e[19]=p,e[20]=h,e[21]=_,e[22]=y):y=e[22];let T;return e[23]!==o||e[24]!==g||e[25]!==y?(T=m.jsx(o,{value:g,children:y}),e[23]=o,e[24]=g,e[25]=y,e[26]=T):T=e[26],T}function l3(t){const e=W.c(5),{locator:n}=Dt(),r=Pu(),i=Gi();let a;return e[0]!==n||e[1]!==r||e[2]!==t||e[3]!==i?(a=async(u,o,l)=>{const d=await vu(n,l),f=d.findIndex(y=>y.id===u);if(f===-1){console.warn(`[branch] Message ${u} not found in thread ${l}`);return}const p=d.slice(0,f).filter(c3),h=crypto.randomUUID(),g=new Date().toISOString(),_={id:h,title:"",created_at:g,updated_at:g,hidden:!1};if(await i.insert.mutateAsync(_),p.length>0){const y=p.map(T=>({...T,id:crypto.randomUUID(),metadata:{...T.metadata,thread_id:h,created_at:T.metadata?.created_at||g}}));await r.insertMany.mutateAsync(y)}t(h)},e[0]=n,e[1]=r,e[2]=t,e[3]=i,e[4]=a):a=e[4],a}function c3(t){return t.role!=="system"}function d3(t){const e=W.c(18),{messageId:n,parts:r}=t,[i,a]=V.useState(!1),{setInputValue:s,startBranch:u,setActiveThreadId:o,activeThreadId:l}=ph(),d=l3(o);let f;e[0]!==r?(f=r.filter(h3).map(f3).join(`
|
|
98
|
+
`),e[0]=r,e[1]=f):f=e[1];const p=f;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=S=>{S.stopPropagation(),a(!0)},e[2]=h):h=e[2];const g=h;let _;e[3]!==l||e[4]!==d||e[5]!==n||e[6]!==p||e[7]!==s||e[8]!==u?(_=async()=>{await d(n,p,l),s(p),u({originalThreadId:l,originalMessageId:n,originalMessageText:p}),a(!1)},e[3]=l,e[4]=d,e[5]=n,e[6]=p,e[7]=s,e[8]=u,e[9]=_):_=e[9];const y=_;let T;e[10]===Symbol.for("react.memo_cache_sentinel")?(T=m.jsx("div",{className:"flex justify-center items-end px-2 pb-1",children:m.jsxs(dn,{children:[m.jsx(fn,{asChild:!0,children:m.jsx(We,{onClick:g,variant:"ghost",size:"xs",className:"opacity-0 group-hover:opacity-100 hover:bg-gray-200/70 rounded-md transition-opacity text-muted-foreground hover:text-foreground aspect-square w-6 h-6 p-0",children:m.jsx(Su,{size:16,className:"p-0.5"})})}),m.jsx(hn,{side:"bottom",children:"Edit message"})]})}),e[10]=T):T=e[10];let I;e[11]===Symbol.for("react.memo_cache_sentinel")?(I=m.jsxs(Qc,{children:[m.jsx(Gc,{children:"Edit message?"}),m.jsx(Xc,{children:"This will create a new conversation branch from this point. The original conversation will remain unchanged."})]}),e[11]=I):I=e[11];let E;e[12]===Symbol.for("react.memo_cache_sentinel")?(E=m.jsx(Zc,{children:"Cancel"}),e[12]=E):E=e[12];let R;e[13]!==y?(R=m.jsxs(Kc,{children:[I,m.jsxs(Jc,{children:[E,m.jsx(ed,{onClick:y,children:"Confirm"})]})]}),e[13]=y,e[14]=R):R=e[14];let O;return e[15]!==i||e[16]!==R?(O=m.jsxs(m.Fragment,{children:[T,m.jsx(td,{open:i,onOpenChange:a,children:R})]}),e[15]=i,e[16]=R,e[17]=O):O=e[17],O}function f3(t){return t.text}function h3(t){return t.type==="text"}function p3(t){const e=W.c(29),{message:n,className:r,pairIndex:i}=t,{id:a,parts:s}=n,u=V.useContext(fc),[o,l]=V.useState(!1);if(!s||s.length===0)return null;let d;e[0]!==u||e[1]!==i?(d=()=>{l(!0),i!==void 0&&u?.scrollToPair(i)},e[0]=u,e[1]=i,e[2]=d):d=e[2];const f=d;let p;e[3]!==r?(p=le("message-block w-full min-w-0 group relative flex items-start gap-4 px-2.5 text-foreground flex-row-reverse",r),e[3]=r,e[4]=p):p=e[4];let h,g;e[5]===Symbol.for("react.memo_cache_sentinel")?(h=()=>l(!0),g=()=>l(!1),e[5]=h,e[6]=g):(h=e[5],g=e[6]);const _=o?"overflow-auto opacity-100":"overflow-hidden opacity-99 mask-b-from-1%";let y;e[7]!==_?(y=le("z-10 px-4 py-2 transition-opacity max-h-[120px] flex-1",_),e[7]=_,e[8]=y):y=e[8];let T;if(e[9]!==a||e[10]!==s){let v;e[12]!==a?(v=(B,z)=>B.type==="text"?m.jsx(dc,{id:a,part:B},`${a}-${z}`):null,e[12]=a,e[13]=v):v=e[13],T=s.map(v),e[9]=a,e[10]=s,e[11]=T}else T=e[11];let I;e[14]!==T?(I=m.jsx("div",{children:T}),e[14]=T,e[15]=I):I=e[15];let E;e[16]!==y||e[17]!==I?(E=m.jsx("div",{className:y,children:I}),e[16]=y,e[17]=I,e[18]=E):E=e[18];let R;e[19]!==a||e[20]!==s?(R=m.jsx(d3,{messageId:a,parts:s}),e[19]=a,e[20]=s,e[21]=R):R=e[21];let O;e[22]!==f||e[23]!==R||e[24]!==E?(O=m.jsxs("div",{tabIndex:0,onClick:f,onFocus:h,onBlur:g,className:"w-full border min-w-0 shadow-xs rounded-lg text-[0.9375rem] wrap-break-word overflow-wrap-anywhere bg-background cursor-pointer transition-colors relative flex outline-none",children:[E,R]}),e[22]=f,e[23]=R,e[24]=E,e[25]=O):O=e[25];let S;return e[26]!==O||e[27]!==p?(S=m.jsx(m.Fragment,{children:m.jsx("div",{className:p,children:O})}),e[26]=O,e[27]=p,e[28]=S):S=e[28],S}function m3(t,e){const n=W.c(4);let r;n[0]!==e?(r=e===void 0?{}:e,n[0]=e,n[1]=r):r=n[1];const i=r,a=t??id;let s;return n[2]!==a?(s=sd(a),n[2]=a,n[3]=s):s=n[3],ad(a,"LLM",s,i)}function g3(){const t=W.c(9),e=ud();let n;t[0]!==e?(n={connections:e,binding:"LLMS"},t[0]=e,t[1]=n):n=t[1];const[r]=vc(n);let i;t[2]===Symbol.for("react.memo_cache_sentinel")?(i={pageSize:999},t[2]=i):i=t[2];const a=m3(r?.id,i);if(!a||!r){let u;return t[3]===Symbol.for("react.memo_cache_sentinel")?(u=[],t[3]=u):u=t[3],u}let s;if(t[4]!==r||t[5]!==a){let u;t[7]!==r?(u=o=>({...o,name:o.title,contextWindow:o.limits?.contextWindow,outputLimit:o.limits?.maxOutputTokens,inputCost:o.costs?.input,outputCost:o.costs?.output,provider:o.provider,connectionId:r.id,connectionName:r.title}),t[7]=r,t[8]=u):u=t[8],s=a.map(u).sort(E3),t[4]=r,t[5]=a,t[6]=s}else s=t[6];return s}function E3(t,e){return t.name.localeCompare(e.name)}const b3={reasoning:{icon:m.jsx(Or,{className:"size-4"}),bg:"bg-purple-100",text:"text-purple-700",label:"Reasoning"},"image-upload":{icon:m.jsx(Nu,{className:"size-4"}),bg:"bg-teal-100",text:"text-teal-700",label:"Can analyze images"},"file-upload":{icon:m.jsx(nd,{className:"size-4"}),bg:"bg-blue-100",text:"text-blue-700",label:"Can analyze files"},"web-search":{icon:m.jsx(Wi,{className:"size-4"}),bg:"bg-amber-100",text:"text-amber-700",label:"Can search the web to answer questions"}},pc=V.memo(function(e){const n=W.c(11),{capability:r}=e,i=b3[r];let a;n[0]!==r||n[1]!==i?(a=i||{icon:m.jsx(sn,{className:"size-4"}),bg:"bg-slate-200",text:"text-slate-700",label:r},n[0]=r,n[1]=i,n[2]=a):a=n[2];const s=a,u=`flex items-center justify-center h-6 w-6 rounded-sm ${s.bg} ${s.text}`;let o;n[3]!==s.icon||n[4]!==u?(o=m.jsx(fn,{asChild:!0,children:m.jsx("div",{className:u,children:s.icon})}),n[3]=s.icon,n[4]=u,n[5]=o):o=n[5];let l;n[6]!==s.label?(l=m.jsx(hn,{children:m.jsx("p",{children:s.label})}),n[6]=s.label,n[7]=l):l=n[7];let d;return n[8]!==o||n[9]!==l?(d=m.jsxs(dn,{children:[o,l]}),n[8]=o,n[9]=l,n[10]=d):d=n[10],d}),pu=V.memo(function(e){const n=W.c(54),{model:r,compact:i}=e,a=i===void 0?!1:i;if(!r){let T;return n[0]===Symbol.for("react.memo_cache_sentinel")?(T=m.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"Hover to preview"}),n[0]=T):T=n[0],T}const s=r.contextWindow||r.inputCost||r.outputCost||r.outputLimit;if(!s&&!a){let T;n[1]!==r.logo||n[2]!==r.name?(T=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]=T):T=n[3];let I;n[4]!==r.name?(I=m.jsx("p",{className:"text-lg font-medium leading-7",children:r.name}),n[4]=r.name,n[5]=I):I=n[5];let E;n[6]!==T||n[7]!==I?(E=m.jsxs("div",{className:"flex items-center gap-3 py-2 px-0",children:[T,I]}),n[6]=T,n[7]=I,n[8]=E):E=n[8];let R;n[9]!==r.description?(R=r.description&&m.jsx("p",{className:"text-sm text-muted-foreground",children:r.description}),n[9]=r.description,n[10]=R):R=n[10];let O;return n[11]!==E||n[12]!==R?(O=m.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[E,R]}),n[11]=E,n[12]=R,n[13]=O):O=n[13],O}if(!s&&a)return null;if(a){let T;n[14]!==r.contextWindow?(T=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]=T):T=n[15];let I;n[16]!==r.inputCost?(I=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]=I):I=n[17];let E;n[18]!==r.outputCost?(E=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]=E):E=n[19];let R;n[20]!==r.outputLimit?(R=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]=R):R=n[21];let O;return n[22]!==T||n[23]!==I||n[24]!==E||n[25]!==R?(O=m.jsxs("div",{className:"flex flex-col gap-2.5 pt-3 pb-3 px-3 rounded-b-lg text-xs",children:[T,I,E,R]}),n[22]=T,n[23]=I,n[24]=E,n[25]=R,n[26]=O):O=n[26],O}let u;n[27]!==r.logo||n[28]!==r.name?(u=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]=u):u=n[29];let o;n[30]!==r.name?(o=m.jsx("p",{className:"text-lg font-medium leading-7",children:r.name}),n[30]=r.name,n[31]=o):o=n[31];let l;n[32]!==u||n[33]!==o?(l=m.jsxs("div",{className:"flex items-center gap-3",children:[u,o]}),n[32]=u,n[33]=o,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(_3)}),n[35]=r.capabilities,n[36]=d):d=n[36];let f;n[37]!==l||n[38]!==d?(f=m.jsxs("div",{className:"flex flex-col gap-3 py-2 px-0",children:[l,d]}),n[37]=l,n[38]=d,n[39]=f):f=n[39];let p;n[40]!==r.contextWindow?(p=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(Fc,{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]=p):p=n[41];let h;n[42]!==r.inputCost||n[43]!==r.outputCost?(h=(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(Iu,{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]=h):h=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(Ru,{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 _;n[47]!==p||n[48]!==h||n[49]!==g?(_=m.jsxs("div",{className:"flex flex-col gap-4",children:[p,h,g]}),n[47]=p,n[48]=h,n[49]=g,n[50]=_):_=n[50];let y;return n[51]!==_||n[52]!==f?(y=m.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[f,_]}),n[51]=_,n[52]=f,n[53]=y):y=n[53],y}),T3=V.memo(function(e){const n=W.c(27),{model:r,onHover:i,isSelected:a,hasExpandedInfo:s}=e,u=s?"rounded-t-lg":"rounded-lg";let o;n[0]!==u?(o=le("flex items-center gap-2 h-10 py-4 px-3 hover:bg-accent cursor-pointer",u),n[0]=u,n[1]=o):o=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 f;n[8]!==r.name?(f=m.jsx("span",{className:"text-sm text-foreground",children:r.name}),n[8]=r.name,n[9]=f):f=n[9];let p;n[10]!==s||n[11]!==r.capabilities?(p=s&&r.capabilities&&r.capabilities.length>0&&m.jsx("div",{className:"md:hidden flex items-center gap-1.5 ml-auto",children:r.capabilities.map(y3)}),n[10]=s,n[11]=r.capabilities,n[12]=p):p=n[12];let h;n[13]!==s||n[14]!==a?(h=a&&!s&&m.jsx(sn,{className:"w-4 h-4 text-foreground ml-auto"}),n[13]=s,n[14]=a,n[15]=h):h=n[15];let g;n[16]!==s||n[17]!==a?(g=a&&s&&m.jsx(sn,{className:"w-4 h-4 text-foreground ml-2 shrink-0"}),n[16]=s,n[17]=a,n[18]=g):g=n[18];let _;return n[19]!==o||n[20]!==l||n[21]!==d||n[22]!==f||n[23]!==p||n[24]!==h||n[25]!==g?(_=m.jsxs("div",{className:o,onMouseEnter:l,children:[d,f,p,h,g]}),n[19]=o,n[20]=l,n[21]=d,n[22]=f,n[23]=p,n[24]=h,n[25]=g,n[26]=_):_=n[26],_});function x3(t){const e=W.c(9),{model:n}=t;if(!n){let s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(s=m.jsx("span",{className:"text-sm text-muted-foreground",children:"Select model"}),e[0]=s):s=e[0],s}let r;e[1]!==n.logo||e[2]!==n.name?(r=n.logo&&m.jsx("img",{src:n.logo,className:"w-5 h-5 shrink-0 rounded-sm",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 truncate min-w-0 max-w-[200px] hidden sm:inline-block",children:n.name}),e[4]=n.name,e[5]=i):i=e[5];let a;return e[6]!==r||e[7]!==i?(a=m.jsxs("div",{className:"flex items-center gap-2 min-w-0 max-w-full",children:[r,i]}),e[6]=r,e[7]=i,e[8]=a):a=e[8],a}function d_(t){const e=W.c(67),{selectedModel:n,onModelChange:r,variant:i,className:a,placeholder:s}=t,u=i===void 0?"borderless":i,o=s===void 0?"Select model":s,[l,d]=V.useState(!1),[f,p]=V.useState(null),[h,g]=V.useState(!1),[_,y]=V.useState(""),T=V.useRef(null),I=g3();let E,R;e[0]!==l?(E=()=>{l&&setTimeout(()=>{T.current?.focus()},0)},R=[l],e[0]=l,e[1]=E,e[2]=R):(E=e[1],R=e[2]),V.useEffect(E,R);let O;e[3]!==I||e[4]!==n?(O=n?I.find(fe=>fe.id===n.id&&fe.connectionId===n.connectionId)?.id:void 0,e[3]=I,e[4]=n,e[5]=O):O=e[5];const S=O;let v;if(e[6]!==I||e[7]!==S){let fe;e[9]!==S?(fe=Je=>Je.id===S,e[9]=S,e[10]=fe):fe=e[10],v=I.find(fe),e[6]=I,e[7]=S,e[8]=v}else v=e[8];const B=v;let z;e:{if(!_.trim()){z=I;break e}let fe;if(e[11]!==I||e[12]!==_){const Je=_.toLowerCase();fe=I.filter(At=>At.name.toLowerCase().includes(Je)||At.provider?.toLowerCase().includes(Je)||At.description?.toLowerCase().includes(Je)),e[11]=I,e[12]=_,e[13]=fe}else fe=e[13];z=fe}const N=z;let F;e[14]!==I||e[15]!==r?(F=fe=>{const Je=I.find(At=>At.id===fe);Je&&(r({id:Je.id,connectionId:Je.connectionId,provider:Je.provider??void 0}),y(""),d(!1))},e[14]=I,e[15]=r,e[16]=F):F=e[16];const P=F;let X;e[17]===Symbol.for("react.memo_cache_sentinel")?(X=fe=>{d(fe),fe||y("")},e[17]=X):X=e[17];const q=X;if(I.length===0)return null;const j=S||"",Z=u==="borderless"&&"md:border-none";let te;e[18]!==a||e[19]!==Z?(te=le("text-sm hover:bg-accent rounded-lg py-0.5 px-1 gap-1 shadow-none cursor-pointer border-0 group focus-visible:ring-0 focus-visible:ring-offset-0 min-w-0 max-w-full",Z,a),e[18]=a,e[19]=Z,e[20]=te):te=e[20];let K;e[21]!==B?(K=m.jsx(x3,{model:B}),e[21]=B,e[22]=K):K=e[22];let ce;e[23]!==o||e[24]!==K?(ce=m.jsx(Hc,{placeholder:o,className:"min-w-0 max-w-full",children:K}),e[23]=o,e[24]=K,e[25]=ce):ce=e[25];let k;e[26]!==te||e[27]!==ce?(k=m.jsx(jc,{size:"sm",className:te,children:ce}),e[26]=te,e[27]=ce,e[28]=k):k=e[28];let ae;e[29]!==h?(ae=()=>g(!h),e[29]=h,e[30]=ae):ae=e[30];const xe=h?"text-foreground":"text-muted-foreground";let C;e[31]!==xe?(C=le("w-5 h-5 transition-colors",xe),e[31]=xe,e[32]=C):C=e[32];let ke;e[33]!==C?(ke=m.jsx(rd,{className:C}),e[33]=C,e[34]=ke):ke=e[34];let Ie;e[35]!==ae||e[36]!==ke?(Ie=m.jsx("button",{type:"button",onClick:ae,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:ke}),e[35]=ae,e[36]=ke,e[37]=Ie):Ie=e[37];let me;e[38]===Symbol.for("react.memo_cache_sentinel")?(me=m.jsx(Wi,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none"}),e[38]=me):me=e[38];let Ne;e[39]===Symbol.for("react.memo_cache_sentinel")?(Ne=fe=>y(fe.target.value),e[39]=Ne):Ne=e[39];let _e;e[40]!==_?(_e=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:"relative",children:[me,m.jsx(Lc,{ref:T,type:"text",placeholder:"Search for a model...",value:_,onChange:Ne,className:"pl-9 h-9 text-sm border-0 focus-visible:ring-0 focus-visible:ring-offset-0 shadow-none"})]})}),e[40]=_,e[41]=_e):_e=e[41];let we;e[42]!==N||e[43]!==P||e[44]!==S||e[45]!==h?(we=N.length>0?N.map(fe=>m.jsxs("div",{onClick:()=>P(fe.id),className:le("rounded-lg mb-1",fe.id===S&&"bg-accent"),children:[m.jsx(T3,{model:fe,onHover:p,isSelected:fe.id===S,hasExpandedInfo:h}),h&&m.jsx("div",{className:"md:hidden",children:m.jsx(pu,{model:fe,compact:!0})})]},fe.id)):m.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"No models found"}),e[42]=N,e[43]=P,e[44]=S,e[45]=h,e[46]=we):we=e[46];let Se;e[47]!==we?(Se=m.jsx("div",{className:"flex-1 overflow-y-auto px-0.5",children:we}),e[47]=we,e[48]=Se):Se=e[48];let Oe;e[49]!==_e||e[50]!==Se?(Oe=m.jsxs("div",{className:"flex-1 flex flex-col md:border-r",children:[_e,Se]}),e[49]=_e,e[50]=Se,e[51]=Oe):Oe=e[51];const ot=f||B||null;let De;e[52]!==ot?(De=m.jsx("div",{className:"hidden md:block md:w-[300px] p-3",children:m.jsx(pu,{model:ot})}),e[52]=ot,e[53]=De):De=e[53];let yt;e[54]!==Oe||e[55]!==De?(yt=m.jsxs("div",{className:"flex flex-col md:flex-row h-[350px]",children:[Oe,De]}),e[54]=Oe,e[55]=De,e[56]=yt):yt=e[56];let mt;e[57]!==o||e[58]!==Ie||e[59]!==yt?(mt=m.jsx(zc,{title:o,className:"w-full md:w-auto md:min-w-[600px] [&_button[aria-label='Scroll down']]:!hidden [&_button[aria-label='Scroll up']]:!hidden",headerActions:Ie,children:yt}),e[57]=o,e[58]=Ie,e[59]=yt,e[60]=mt):mt=e[60];let Mt;return e[61]!==P||e[62]!==l||e[63]!==j||e[64]!==k||e[65]!==mt?(Mt=m.jsxs($c,{open:l,onOpenChange:q,value:j,onValueChange:P,children:[k,mt]}),e[61]=P,e[62]=l,e[63]=j,e[64]=k,e[65]=mt,e[66]=Mt):Mt=e[66],Mt}function _3(t){return m.jsx(pc,{capability:t},t)}function y3(t){return m.jsx(pc,{capability:t},t)}function A3({messageCount:t,sentinelRef:e}){const n=V.useRef(t),r=V.useRef(0);t>n.current&&r.current!==t&&queueMicrotask(()=>{e.current?.scrollIntoView({behavior:"smooth",block:"start"}),r.current=t}),n.current=t}function mu(t,e){const n=V.Children.toArray(t);for(const r of n)if(V.isValidElement(r)&&r.type===e)return r;return null}function k3(t){const e=W.c(5),{className:n,children:r}=t;let i;e[0]!==n?(i=le("flex flex-col h-full w-full bg-sidebar transform-[translateZ(0)]",n),e[0]=n,e[1]=i):i=e[1];let a;return e[2]!==r||e[3]!==i?(a=m.jsx("div",{className:i,children:r}),e[2]=r,e[3]=i,e[4]=a):a=e[4],a}function C3(t){const e=W.c(11),{children:n}=t;let r;e[0]!==n?(r=mu(n,mc),e[0]=n,e[1]=r):r=e[1];const i=r;let a;e[2]!==n?(a=mu(n,gc),e[2]=n,e[3]=a):a=e[3];const s=a,u=i?.props.children;let o;e[4]!==u?(o=m.jsx("div",{className:"flex items-center gap-2",children:u}),e[4]=u,e[5]=o):o=e[5];const l=s?.props.children;let d;e[6]!==l?(d=m.jsx("div",{className:"flex items-center gap-1",children:l}),e[6]=l,e[7]=d):d=e[7];let f;return e[8]!==o||e[9]!==d?(f=m.jsxs("div",{className:"flex h-12 items-center justify-between border-b border-border px-4 flex-none",children:[o,d]}),e[8]=o,e[9]=d,e[10]=f):f=e[10],f}function mc(t){const e=W.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 gc(t){const e=W.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 I3(t){const e=W.c(5),{children:n,className:r}=t;let i;e[0]!==r?(i=le("flex-1 min-h-0 overflow-y-auto",r),e[0]=r,e[1]=i):i=e[1];let a;return e[2]!==n||e[3]!==i?(a=m.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=a):a=e[4],a}function S3(t){const e=W.c(2),{children:n}=t;let r;return e[0]!==n?(r=m.jsx("div",{className:"h-full w-full flex items-center justify-center max-w-2xl mx-auto",children:n}),e[0]=n,e[1]=r):r=e[1],r}function N3(t){const e=W.c(12),{messages:n,status:r,minHeightOffset:i}=t,a=i===void 0?240:i,s=V.useRef(null);let u;e[0]!==n.length?(u={messageCount:n.length,sentinelRef:s},e[0]=n.length,e[1]=u):u=e[1],A3(u);let o;if(e[2]!==n||e[3]!==r){let f;e[5]!==n.length||e[6]!==r?(f=(p,h)=>p.role==="user"?m.jsx(p3,{message:p},p.id):p.role==="assistant"?m.jsx(i3,{message:p,status:h===n.length-1?r:void 0},p.id):null,e[5]=n.length,e[6]=r,e[7]=f):f=e[7],o=n.map(f),e[2]=n,e[3]=r,e[4]=o}else o=e[4];let l;e[8]===Symbol.for("react.memo_cache_sentinel")?(l=m.jsx(hc,{children:m.jsx("div",{ref:s,className:"h-0"})}),e[8]=l):l=e[8];let d;return e[9]!==a||e[10]!==o?(d=m.jsxs(o3,{minHeightOffset:a,children:[o,l]}),e[9]=a,e[10]=o,e[11]=d):d=e[11],d}function w3(t){const e=W.c(5),{children:n,className:r}=t;let i;e[0]!==r?(i=le("flex-none w-full mx-auto p-2","max-w-2xl min-w-0",r),e[0]=r,e[1]=i):i=e[1];let a;return e[2]!==n||e[3]!==i?(a=m.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=a):a=e[4],a}function Na(t){const e=W.c(24),{title:n,description:r,icon:i,variant:a,onDismiss:s,children:u}=t,o=a===void 0?"default":a;let l,d,f,p,h;if(e[0]!==u||e[1]!==r||e[2]!==i||e[3]!==n||e[4]!==o){const E={default:{container:"border-muted-foreground/30 bg-muted/50 hover:bg-muted transition-colors",icon:"text-muted-foreground",title:"text-muted-foreground",description:"text-muted-foreground/70"},danger:{container:"border-destructive/30 bg-destructive/5",icon:"text-destructive",title:"text-destructive font-medium",description:"text-muted-foreground"},warning:{container:"border-amber-500/30 bg-amber-500/5",icon:"text-amber-600 dark:text-amber-500",title:"text-amber-600 dark:text-amber-500 font-medium",description:"text-muted-foreground"}}[o];p=le("flex items-start gap-2 px-3 py-2.5 rounded-lg border border-dashed text-sm w-full",E.container),h=i&&m.jsx("div",{className:le("mt-0.5 shrink-0",E.icon),children:i}),l="flex-1 min-w-0",d=n&&m.jsx("div",{className:le("text-xs mb-1",E.title),children:n}),f=r&&m.jsx("div",{className:le("text-xs line-clamp-2",E.description,u?"mb-2":""),children:r}),e[0]=u,e[1]=r,e[2]=i,e[3]=n,e[4]=o,e[5]=l,e[6]=d,e[7]=f,e[8]=p,e[9]=h}else l=e[5],d=e[6],f=e[7],p=e[8],h=e[9];let g;e[10]!==u?(g=u&&m.jsx("div",{className:"flex gap-2",children:u}),e[10]=u,e[11]=g):g=e[11];let _;e[12]!==l||e[13]!==d||e[14]!==f||e[15]!==g?(_=m.jsxs("div",{className:l,children:[d,f,g]}),e[12]=l,e[13]=d,e[14]=f,e[15]=g,e[16]=_):_=e[16];let y;e[17]!==s?(y=s&&m.jsx("button",{type:"button",onClick:s,className:"text-muted-foreground hover:text-foreground transition-colors shrink-0",title:"Dismiss",children:m.jsx(Mc,{size:14})}),e[17]=s,e[18]=y):y=e[18];let T;return e[19]!==p||e[20]!==h||e[21]!==_||e[22]!==y?(T=m.jsxs("div",{className:p,children:[h,_,y]}),e[19]=p,e[20]=h,e[21]=_,e[22]=y,e[23]=T):T=e[23],T}function R3(t){const e=W.c(10),{branchContext:n,clearBranchContext:r,onGoToOriginalMessage:i,setInputValue:a}=t;if(!n)return null;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=m.jsx(Cu,{size:14}),e[0]=s):s=e[0];let u;e[1]!==r||e[2]!==a?(u=()=>{r(),a("")},e[1]=r,e[2]=a,e[3]=u):u=e[3];let o;e[4]!==i?(o=m.jsx(We,{size:"sm",variant:"outline",onClick:i,className:"h-7 text-xs",children:"View original"}),e[4]=i,e[5]=o):o=e[5];let l;return e[6]!==n.originalMessageText||e[7]!==u||e[8]!==o?(l=m.jsx(Na,{variant:"default",title:"Editing message (click to view original)",description:n.originalMessageText,icon:s,onDismiss:u,children:o}),e[6]=n.originalMessageText,e[7]=u,e[8]=o,e[9]=l):l=e[9],l}function O3(t){const e=W.c(8),{error:n,onFixInChat:r,onDismiss:i}=t;if(!n)return null;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsx(_u,{size:16}),e[0]=a):a=e[0];let s;e[1]!==r?(s=m.jsx(We,{size:"sm",variant:"outline",onClick:r,className:"h-7 text-xs",children:"Fix in chat"}),e[1]=r,e[2]=s):s=e[2];let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsx(We,{size:"sm",variant:"outline",disabled:!0,className:"h-7 text-xs",children:"Report"}),e[3]=u):u=e[3];let o;return e[4]!==n.message||e[5]!==i||e[6]!==s?(o=m.jsxs(Na,{variant:"danger",title:"Error occurred",description:n.message,icon:a,onDismiss:i,children:[s,u]}),e[4]=n.message,e[5]=i,e[6]=s,e[7]=o):o=e[7],o}function L3(t){const e=W.c(7),{finishReason:n,onContinue:r,onDismiss:i}=t;if(!n||n==="stop")return null;const s=D3(n);let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsx(Pc,{size:16}),e[0]=u):u=e[0];let o;e[1]!==r?(o=m.jsx(We,{size:"sm",variant:"outline",onClick:r,className:"h-7 text-xs",children:"Continue"}),e[1]=r,e[2]=o):o=e[2];let l;return e[3]!==i||e[4]!==s||e[5]!==o?(l=m.jsx(Na,{variant:"warning",title:"Response incomplete",description:s,icon:u,onDismiss:i,children:o}),e[3]=i,e[4]=s,e[5]=o,e[6]=l):l=e[6],l}function D3(t){switch(t){case"length":return"Response reached the model's output limit. Different models have different limits. Try switching models or asking it to continue.";case"content-filter":return"Response was filtered due to content policy.";case"tool-calls":return"Response paused after tool execution to prevent infinite loops and save costs. Click continue to keep working.";default:return`Response stopped unexpectedly: ${t}`}}const f_=Object.assign(k3,{Header:Object.assign(C3,{Left:mc,Right:gc}),Main:I3,Messages:N3,EmptyState:S3,Footer:w3,Input:Th,BranchPreview:R3,ErrorBanner:O3,FinishReasonWarning:L3,Provider:fh});function h_({title:t="No model provider connected",description:e="Connect to a model provider to unlock AI-powered features.",orgSlug:n,orgId:r,userId:i,allConnections:a,onInstallMcpServer:s}){const[u,o]=V.useState(!1),l=od(),d=Oc(),f=async()=>{if(!r||!i){Ei.error("Not authenticated");return}o(!0);try{const p=a?.find(_=>_.connection_url===dd);if(p){d({to:"/$org/mcps/$connectionId",params:{org:n,connectionId:p.id}});return}const h=fd({id:hd("conn")}),g=await l.create.mutateAsync(h);d({to:"/$org/mcps/$connectionId",params:{org:n,connectionId:g.id}})}catch(p){Ei.error(`Failed to connect OpenRouter: ${p instanceof Error?p.message:String(p)}`)}finally{o(!1)}};return m.jsx(ld,{image:m.jsx("img",{src:"/empty-state-openrouter.svg",alt:"",width:336,height:320,"aria-hidden":"true",className:"w-xs h-auto mask-radial-[100%_100%] mask-radial-from-20% mask-radial-to-50% mask-radial-at-center"}),title:t,description:e,actions:m.jsxs(m.Fragment,{children:[m.jsxs(We,{variant:"outline",onClick:f,disabled:u,children:[m.jsx("img",{src:cd,alt:"OpenRouter",className:"size-4"}),u?"Installing...":"Install OpenRouter"]}),m.jsx(We,{variant:"outline",onClick:s,children:"Install Connection"})]})})}function v3(t){const e=new Date(t),r=new Date().getTime()-e.getTime(),i=Math.floor(r/6e4),a=Math.floor(r/36e5);return i<1?"now":i<60?`${i}m`:`${a}h`}function P3(t){const e=new Date,n=new Date(e.getFullYear(),e.getMonth(),e.getDate()),r=new Date(n.getTime()-864e5),i=new Date(n.getTime()-7*864e5),a=new Date(n.getTime()-30*864e5),s=[],u=[],o=[],l=[],d=[];for(const p of t){const h=new Date(p.updated_at);h>=n?s.push(p):h>=r?u.push(p):h>=i?o.push(p):h>=a?l.push(p):d.push(p)}const f=[];return s.length>0&&f.push({label:"Today",threads:s,showRelativeTime:!0}),u.length>0&&f.push({label:"Yesterday",threads:u,showRelativeTime:!1}),o.length>0&&f.push({label:"7 days ago",threads:o,showRelativeTime:!1}),l.length>0&&f.push({label:"30 days ago",threads:l,showRelativeTime:!1}),d.length>0&&f.push({label:"Older",threads:d,showRelativeTime:!1}),f}function p_(t){const e=W.c(49),{threads:n,activeThreadId:r,onSelectThread:i,onRemoveThread:a,onOpen:s,variant:u}=t,o=u===void 0?"icon":u,[l,d]=V.useState("");let f,p,h,g,_,y,T,I,E,R,O,S;if(e[0]!==r||e[1]!==s||e[2]!==a||e[3]!==i||e[4]!==l||e[5]!==n||e[6]!==o){const P=l.trim()?n.filter(K=>(K.title||"New chat").toLowerCase().includes(l.toLowerCase())):n,X=P3(P);let q;e[19]!==s?(q=K=>{K?s?.():d("")},e[19]=s,e[20]=q):q=e[20];const j=q;g=Eu,h=dn,p=bu,R=j,e[21]!==o?(O=m.jsx(fn,{asChild:!0,children:m.jsx(Tu,{asChild:!0,children:o==="outline"?m.jsx(We,{type:"button",variant:"outline",size:"icon",className:"size-7 border border-input","aria-label":"Chat history",children:m.jsx(Ra,{size:16})}):m.jsx(We,{type:"button",variant:"ghost",size:"icon",className:"size-6 p-1 hover:bg-transparent","aria-label":"Chat history",children:m.jsx(Ra,{size:16,className:"text-muted-foreground hover:text-foreground transition-colors"})})})}),e[21]=o,e[22]=O):O=e[22],e[23]===Symbol.for("react.memo_cache_sentinel")?(S=m.jsx(hn,{children:"Chat history"}),e[23]=S):S=e[23],f=xu,T="end",I="w-80 p-0";let Z;e[24]===Symbol.for("react.memo_cache_sentinel")?(Z=m.jsx(Wi,{size:16,className:"text-muted-foreground shrink-0"}),e[24]=Z):Z=e[24];let te;e[25]===Symbol.for("react.memo_cache_sentinel")?(te=K=>d(K.target.value),e[25]=te):te=e[25],e[26]!==l?(E=m.jsx("div",{className:"border-b",children:m.jsxs("label",{className:"flex items-center gap-2.5 h-12 px-4 cursor-text",children:[Z,m.jsx("input",{type:"text",placeholder:"Search chats...",value:l,onChange:te,className:"flex-1 border-0 shadow-none focus:outline-none px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"})]})}),e[26]=l,e[27]=E):E=e[27],_="max-h-[300px] overflow-y-auto",y=P.length===0?m.jsx("div",{className:"p-4 text-center text-sm text-muted-foreground",children:l.trim()?"No chats found":"No chats yet"}):X.map((K,ce)=>m.jsxs("div",{children:[ce>0&&m.jsx("div",{className:"border-t mx-3"}),m.jsx("div",{className:"px-3 py-1",children:m.jsx("span",{className:"text-xs font-medium text-muted-foreground tracking-wide",children:K.label})}),K.threads.map(k=>{const ae=k.id===r;return m.jsxs("div",{className:`flex items-center gap-2 px-3 py-2 hover:bg-accent cursor-pointer group ${ae?"bg-accent/50":""}`,onClick:()=>i(k.id),children:[m.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[m.jsx("span",{className:"text-sm truncate",children:k.title||"New chat"}),m.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:ae?"current":K.showRelativeTime?v3(k.updated_at):null})]}),m.jsx("button",{type:"button",onClick:xe=>{xe.stopPropagation(),a(k.id)},className:"opacity-0 cursor-pointer group/trash group-hover:opacity-100 p-1 hover:bg-destructive/10 rounded transition-opacity",title:"Remove chat",children:m.jsx(pd,{size:14,className:"text-muted-foreground group-hover/trash:text-destructive"})})]},k.id)})]},K.label)),e[0]=r,e[1]=s,e[2]=a,e[3]=i,e[4]=l,e[5]=n,e[6]=o,e[7]=f,e[8]=p,e[9]=h,e[10]=g,e[11]=_,e[12]=y,e[13]=T,e[14]=I,e[15]=E,e[16]=R,e[17]=O,e[18]=S}else f=e[7],p=e[8],h=e[9],g=e[10],_=e[11],y=e[12],T=e[13],I=e[14],E=e[15],R=e[16],O=e[17],S=e[18];let v;e[28]!==_||e[29]!==y?(v=m.jsx("div",{className:_,children:y}),e[28]=_,e[29]=y,e[30]=v):v=e[30];let B;e[31]!==f||e[32]!==v||e[33]!==T||e[34]!==I||e[35]!==E?(B=m.jsxs(f,{align:T,className:I,children:[E,v]}),e[31]=f,e[32]=v,e[33]=T,e[34]=I,e[35]=E,e[36]=B):B=e[36];let z;e[37]!==p||e[38]!==B||e[39]!==R||e[40]!==O||e[41]!==S?(z=m.jsxs(p,{onOpenChange:R,children:[O,S,B]}),e[37]=p,e[38]=B,e[39]=R,e[40]=O,e[41]=S,e[42]=z):z=e[42];let N;e[43]!==h||e[44]!==z?(N=m.jsx(h,{children:z}),e[43]=h,e[44]=z,e[45]=N):N=e[45];let F;return e[46]!==g||e[47]!==N?(F=m.jsx(g,{children:N}),e[46]=g,e[47]=N,e[48]=F):F=e[48],F}export{f_ as C,a_ as D,c_ as G,d_ as M,h_ as N,p_ as T,Xx as U,s_ as a,g3 as b,u_ as c,l_ as d,fh as e,Th as f,ph as u};
|