@inkeep/open-knowledge 0.89.10-beta.1 → 0.89.10-beta.2
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/{cli-C03YMRUU.mjs → cli-BnM1FTDH.mjs} +39 -39
- package/dist/cli.mjs +1 -1
- package/dist/constants-naktyCmW.mjs +1 -0
- package/dist/{dist-B-QQMMgD.mjs → dist-B8fZrH3f.mjs} +521 -521
- package/dist/dist-SdORgRtG.mjs +1 -0
- package/dist/index.mjs +12 -12
- package/dist/{init-BvIbEDs4.mjs → init-DJpguwtL.mjs} +14 -14
- package/dist/init-Dczju_5i.mjs +1 -0
- package/dist/{launch-json-removal-CiHdhK1s.mjs → launch-json-removal-CIZKpvKa.mjs} +1 -1
- package/dist/{loader-7-Yt62LP.mjs → loader-Bmw0zjIb.mjs} +1 -1
- package/dist/loader-Cdc5oVnE.mjs +1 -0
- package/dist/{open-browser-Dst9YzFG.mjs → open-browser-shNCq6Jg.mjs} +1 -1
- package/dist/preview-BUx9kg8i.mjs +1 -0
- package/dist/{preview-5yFLE8l9.mjs → preview-Blybr0dr.mjs} +1 -1
- package/dist/public/assets/{AboutSection-Wga6ljal.js → AboutSection-PYOotN54.js} +1 -1
- package/dist/public/assets/{AccountSection-GhpA_vE7.js → AccountSection-BRDw6CDt.js} +1 -1
- package/dist/public/assets/{ActivityModeContent-CiqMEKKl.js → ActivityModeContent-CKsbEQva.js} +1 -1
- package/dist/public/assets/{ActivityPanelDiffView-Btj__TNB.js → ActivityPanelDiffView-Drnt3eYg.js} +1 -1
- package/dist/public/assets/{AddPropertiesButton-2HTeEJ0n.js → AddPropertiesButton-DZRrywnM.js} +2 -2
- package/dist/public/assets/{AgentConnectionsSection-DL5G9vDr.js → AgentConnectionsSection-CHHCm3U2.js} +1 -1
- package/dist/public/assets/{AgentDiffPane-CJKHGDSw.js → AgentDiffPane-Bye03tzm.js} +2 -2
- package/dist/public/assets/{AttachmentsSection-D9gkolej.js → AttachmentsSection-CaDpV2y1.js} +1 -1
- package/dist/public/assets/{AuthModal-BqAFZ5VD.js → AuthModal-DK7kzx8-.js} +1 -1
- package/dist/public/assets/{CodeMirrorEditor-UCMRAMCV-BjEQv2x_.js → CodeMirrorEditor-UCMRAMCV-JkGHBVVc.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-DBHubbES.js → CodeMirrorPropInput-Cmp5Nj4G.js} +75 -75
- package/dist/public/assets/{ConsentDialogBody-B20jtW8L.js → ConsentDialogBody-CvSKtIAi.js} +1 -1
- package/dist/public/assets/{ContentRulesSection-r73qZOuv.js → ContentRulesSection-XkfMUBZh.js} +1 -1
- package/dist/public/assets/{DiffViewBoundary-BCb7uBFd.js → DiffViewBoundary-Bpy3dZ0r.js} +1 -1
- package/dist/public/assets/DocumentContext-Wb9BCFqj.js +110 -0
- package/dist/public/assets/{EditorModeToggle-gXRKkWXq.js → EditorModeToggle-DR-niAdL.js} +1 -1
- package/dist/public/assets/{ExcalidrawDocEditor-Db9ulKie.js → ExcalidrawDocEditor-DJY9eTS-.js} +1 -1
- package/dist/public/assets/FeedbackForm-DeDUOHCF.js +1 -0
- package/dist/public/assets/{GraphPanel-epDsGADf.js → GraphPanel-an3G7Esa.js} +1 -1
- package/dist/public/assets/{HotkeysSection-DrZRSXKK.js → HotkeysSection-o4i2U9Lo.js} +1 -1
- package/dist/public/assets/{ImportSkillDialog-C8AmQHA7.js → ImportSkillDialog-CR2KplKg.js} +1 -1
- package/dist/public/assets/{InstallInClaudeDesktopDialog-C_RQYp3V.js → InstallInClaudeDesktopDialog-D4VEpFPf.js} +1 -1
- package/dist/public/assets/{IntegrationsSection-gn7Gi9_7.js → IntegrationsSection-DCIbejNW.js} +1 -1
- package/dist/public/assets/{LinkPreviewsSection-B13jMLRF.js → LinkPreviewsSection-lEWtD5nf.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-BCzH0dq8.js → LintConfigEditor-Cn47RFTz.js} +1 -1
- package/dist/public/assets/{LintingSection-CTa17foR.js → LintingSection-72S0YZjO.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-BRgU2Iry.js +1 -0
- package/dist/public/assets/{ManagedArtifactProperties-CTxkYZP6.js → ManagedArtifactProperties-Gc49zvuT.js} +1 -1
- package/dist/public/assets/{Mermaid-DBaeo_-B.js → Mermaid-BiYl2hf6.js} +1 -1
- package/dist/public/assets/{MermaidDocEditor-BzxgQ4MO.js → MermaidDocEditor-DbtN9U8A.js} +1 -1
- package/dist/public/assets/{MultiFileDiff-BsuBGl7q.js → MultiFileDiff-B2a-fkjz.js} +1 -1
- package/dist/public/assets/{NetworkAccessSection-Dl6Qv49M.js → NetworkAccessSection-DLKSkggc.js} +1 -1
- package/dist/public/assets/{OkignoreSection-BfbduXqI.js → OkignoreSection-BsF3GbXc.js} +1 -1
- package/dist/public/assets/{PageListContext-DpKyZSYI.js → PageListContext-DG07q00l.js} +1 -1
- package/dist/public/assets/{ProjectTemplatesSection-D7kiwJKw.js → ProjectTemplatesSection-B6gvHBKM.js} +1 -1
- package/dist/public/assets/{PropertyDisplayRow-BtTHsGAK.js → PropertyDisplayRow-DZZE9YrT.js} +1 -1
- package/dist/public/assets/{PublishToGitHubDialog-Bb4ijH4p.js → PublishToGitHubDialog-CSba5_xA.js} +1 -1
- package/dist/public/assets/{SchemaConfigEditor-DXmO0CbK.js → SchemaConfigEditor-Bf9lTi_e.js} +1 -1
- package/dist/public/assets/{SearchSection-DXG3LSbk.js → SearchSection-CXVxOouf.js} +1 -1
- package/dist/public/assets/{SessionsHost-BDttGwT4.js → SessionsHost-BZm5V5lI.js} +2 -2
- package/dist/public/assets/{SettingsDialogBody-BAqJ12wn.js → SettingsDialogBody-sklRpbsm.js} +2 -2
- package/dist/public/assets/{SettingsSectionHeader-DoDCqZE9.js → SettingsSectionHeader-EhpZ2oo5.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-D5NDn5r5.js → ShareReceiveMissDialog-BIFE0grG.js} +1 -1
- package/dist/public/assets/{SharingSection-CmvBaP1e.js → SharingSection-DDRWca95.js} +1 -1
- package/dist/public/assets/{SkillForkDialog-3Q4qiLGp.js → SkillForkDialog-rG4DERkO.js} +1 -1
- package/dist/public/assets/{SkillInstallMenu-CgZ6TUtX.js → SkillInstallMenu-BNaUPGis.js} +1 -1
- package/dist/public/assets/{SkillOriginInline-XucbICfa.js → SkillOriginInline-ezRE9UzK.js} +2 -2
- package/dist/public/assets/{SkillPluginBundleDialog-9gvF1DrZ.js → SkillPluginBundleDialog-CQB8MF78.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-CmaCgQYO.js → SkillToolbarControls-B_fHbGu4.js} +1 -1
- package/dist/public/assets/{SkillUpdateConflictDialog-BRuajj8h.js → SkillUpdateConflictDialog-CtyW6wPA.js} +1 -1
- package/dist/public/assets/{SkillsManagerSection-BKfHEWsE.js → SkillsManagerSection-DBEG1i7w.js} +1 -1
- package/dist/public/assets/{SlidesPluginSection-BpeI6naA.js → SlidesPluginSection-DqdmgP6_.js} +1 -1
- package/dist/public/assets/{SourceEditor-CJ8-JXTZ.js → SourceEditor-Vu66CETo.js} +1 -1
- package/dist/public/assets/{SyncSection-C6IXtWzM.js → SyncSection-Coa6lFiE.js} +1 -1
- package/dist/public/assets/{SyncStatusBadge-C6xvIMos.js → SyncStatusBadge-BW0YVl2z.js} +1 -1
- package/dist/public/assets/{TerminalPanel-CZqgzugj.js → TerminalPanel-CYqHKI2E.js} +3 -3
- package/dist/public/assets/{TerminalSection-XUg9zrYh.js → TerminalSection-DaO8owbQ.js} +1 -1
- package/dist/public/assets/{TerminalWindowApp-DjaOaIzB.js → TerminalWindowApp-BkoTZoiV.js} +1 -1
- package/dist/public/assets/{TextDocEditor-pSMZm_5Q.js → TextDocEditor-C1S2Awhi.js} +1 -1
- package/dist/public/assets/{ThemePluginSection-CwqUh1BX.js → ThemePluginSection-CCAFe0bO.js} +1 -1
- package/dist/public/assets/{ThreadView-myKHFoPr.js → ThreadView-BXAVZ8nY.js} +4 -4
- package/dist/public/assets/{TimelineDiffPane-B1OKpBFc.js → TimelineDiffPane-VOZs0FvZ.js} +2 -2
- package/dist/public/assets/{chunk-BO2N2NFS-Dl8M8LuR.js → chunk-BO2N2NFS-BEuwRDxJ.js} +4 -4
- package/dist/public/assets/{client-version-CpekaFGz.js → client-version-bdpMlJIw.js} +1 -1
- package/dist/public/assets/cm-theme-Cfku0s0U.js +3 -0
- package/dist/public/assets/{code-highlighter-impl-DAaUGe7G.js → code-highlighter-impl-B8pGTITV.js} +1 -1
- package/dist/public/assets/{comment-chips-BDzvjQ4K.js → comment-chips-B_y1sjFe.js} +1 -1
- package/dist/public/assets/{config-provider-Df28Kak3.js → config-provider-CIXp9Q30.js} +1 -1
- package/dist/public/assets/{dist-CUgGmlsn.js → dist-BLBhO77H.js} +1 -1
- package/dist/public/assets/{dist-DQuOA3vR.js → dist-Bz0NdQrJ.js} +1 -1
- package/dist/public/assets/{dist-CitzgyZk.js → dist-C8wn7WIc.js} +1 -1
- package/dist/public/assets/{dist-XOMICCBT.js → dist-Cqrno4UK.js} +1 -1
- package/dist/public/assets/{dist-R7QC_kjf.js → dist-D4SA-mVq.js} +1 -1
- package/dist/public/assets/{dist-CDI_AHNY2.js → dist-DkkpJ2aw.js} +1 -1
- package/dist/public/assets/{dist-DlTJY48Q.js → dist-dtIrts84.js} +1 -1
- package/dist/public/assets/{dist-LtbcyjB7.js → dist-wKKrgsd0.js} +1 -1
- package/dist/public/assets/{dist-oYievw6e.js → dist-yM-JiFXV2.js} +1 -1
- package/dist/public/assets/{doc-undo-manager-BCMSQDX5.js → doc-undo-manager-CmjnLvcY.js} +1 -1
- package/dist/public/assets/{engine-compile-BKhUOp9O.js → engine-compile-DCXqaKj1.js} +1 -1
- package/dist/public/assets/external-link-CV9ONfls.js +1 -0
- package/dist/public/assets/{highlighted-body-OFNGDK62-DsFROhgi.js → highlighted-body-OFNGDK62-BQg91IZ5.js} +1 -1
- package/dist/public/assets/{ime-composition-4cqEjrpI.js → ime-composition-B8fpGInz.js} +1 -1
- package/dist/public/assets/{index-DRgcv88i.js → index-BusCRx2S.js} +8 -8
- package/dist/public/assets/{lib-CNBaznYe.js → lib-BFwLNStM.js} +1 -1
- package/dist/public/assets/{lint-plugins-dBnVRuSg.js → lint-plugins-CD7RVi0l.js} +1 -1
- package/dist/public/assets/{markdownlint-rule-browser-Ccvw_f-J.js → markdownlint-rule-browser-BH2pUfXz.js} +1 -1
- package/dist/public/assets/mermaid-GHXKKRXX-CTQTYtGv.js +1 -0
- package/dist/public/assets/{pending-receive-nav-store-CdyRiJN-.js → pending-receive-nav-store-4BSbHH4p.js} +1 -1
- package/dist/public/assets/{pierre-theme-Og_zQBPD.js → pierre-theme-bTg6dZWN.js} +1 -1
- package/dist/public/assets/{preferred-session-events-DBfdnf0j.js → preferred-session-events-ohIKavc3.js} +1 -1
- package/dist/public/assets/{prod-CxmLlnTC.js → prod-BYmgqcPA.js} +2 -2
- package/dist/public/assets/{progress-9gaUiKfZ.js → progress-lvv6PjMw.js} +1 -1
- package/dist/public/assets/{project-paths-DjS_hY_q.js → project-paths-BVP8z0Qv.js} +1 -1
- package/dist/public/assets/{schema-section-DDYszxnQ.js → schema-section-7rwc4iOl.js} +1 -1
- package/dist/public/assets/{selection-context-DUSCI80-.js → selection-context-Ckxz0S9i.js} +1 -1
- package/dist/public/assets/{src-BbEXTHkl.js → src-CRiK-e1l.js} +1 -1
- package/dist/public/assets/{tag-pill-input-C6vxVbIh.js → tag-pill-input-CAQxdwNs.js} +1 -1
- package/dist/public/assets/{telemetry-impl-z0X9sR1X.js → telemetry-impl-D8FtB48W.js} +1 -1
- package/dist/public/assets/{telemetry-startup-B1BH1LrL.js → telemetry-startup-ROFmei1a.js} +1 -1
- package/dist/public/assets/{text-viewer-languages-5aC_46ro.js → text-viewer-languages-B5vCLX2f.js} +2 -2
- package/dist/public/assets/{typing-burst-detector-CzFzN6q0.js → typing-burst-detector-DPuYxxMx.js} +1 -1
- package/dist/public/assets/{use-activity-panel-B3D1e4pV.js → use-activity-panel-Dyahk3Lt.js} +1 -1
- package/dist/public/assets/{use-open-skill-DoMflE0-.js → use-open-skill-BhvW1NOZ.js} +1 -1
- package/dist/public/assets/{use-skill-origin-NWSdADZr.js → use-skill-origin-BsQ6pqNb.js} +1 -1
- package/dist/public/assets/{use-skill-targets-UEhNy--n.js → use-skill-targets-DdhJK0_S.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-DF6JNU1j.js → use-terminal-enabled-DDfs8VwB.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-DzUebDea.js → use-timeline-entry-diff-BMLS3VzF.js} +1 -1
- package/dist/public/index.html +50 -50
- package/dist/{registry-probes-BYcJ_XTR.mjs → registry-probes-D2Fcqx88.mjs} +7 -7
- package/dist/{removal-file-path-DDK0L6F5.mjs → removal-file-path-Dteeix7c.mjs} +1 -1
- package/dist/{repair-launch-json-Bw89DSMn.mjs → repair-launch-json-CsiQ-Oie.mjs} +1 -1
- package/dist/{repair-mcp-configs-CI3XggBz.mjs → repair-mcp-configs-BsZ99LDP.mjs} +1 -1
- package/dist/src-22rYneLM.mjs +1 -0
- package/dist/src-CW3RhKEZ.mjs +16 -0
- package/dist/start-C1ERNfPu.mjs +5 -0
- package/dist/start-D90bHzUZ.mjs +1 -0
- package/package.json +4 -4
- package/dist/constants-DNfL8lwk.mjs +0 -1
- package/dist/dist-D8yGS418.mjs +0 -1
- package/dist/init-D4v4GLkU.mjs +0 -1
- package/dist/loader-kjUsg68e.mjs +0 -1
- package/dist/preview-CKtA1q7r.mjs +0 -1
- package/dist/public/assets/DocumentContext-x8kJBlfU.js +0 -110
- package/dist/public/assets/FeedbackForm-DVShKkg2.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-CB9-uy7m.js +0 -1
- package/dist/public/assets/cm-theme-DHJ4FCK8.js +0 -3
- package/dist/public/assets/external-link-C6hldklD.js +0 -1
- package/dist/public/assets/mermaid-GHXKKRXX-CTq-e8f7.js +0 -1
- package/dist/src-08vaMIJd.mjs +0 -1
- package/dist/src-DQJ0Rzwf.mjs +0 -16
- package/dist/start-DrSKWujU.mjs +0 -5
- package/dist/start-Gt6j5VXl.mjs +0 -1
- /package/dist/public/assets/{desktop-bridge-Btg3qpKV.js → desktop-bridge-bSzKDe_w.js} +0 -0
- /package/dist/public/assets/{dist-qfZ4Zkay.js → dist-BFBWje6D.js} +0 -0
- /package/dist/public/assets/{dist-B3l4eYse.js → dist-DJ9i_e8X.js} +0 -0
- /package/dist/public/assets/{dist-McVxqaQr.js → dist-yBmUFswj.js} +0 -0
- /package/dist/public/assets/{documents-fetch-aXwpCEvh.js → documents-fetch-BNA2S_EX.js} +0 -0
- /package/dist/public/assets/{lib-AgCVC0Wn.js → lib-C_jEl4A5.js} +0 -0
- /package/dist/public/assets/{page-list-cache-tOaID4O4.js → page-list-cache-BJpuIApf.js} +0 -0
- /package/dist/public/assets/{skills-api-MxDmjydw.js → skills-api-CcgOY0Iy.js} +0 -0
- /package/dist/public/assets/{startup-marks-iW0WPaQZ.js → startup-marks-D6zprGWE.js} +0 -0
- /package/dist/public/assets/{stex-BzLRGzOW.js → stex-7eUHyf61.js} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ActivityPanelDiffView-
|
|
2
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./preload-helper-Chd9yIcd.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{t as r}from"./react-f2sANaYj.js";import{n as i,r as ee}from"./dist-Nvb76hAm.js";import{t as te}from"./compiler-runtime-BfE3aGVn.js";import{t as ne}from"./overlay-layers-CKMAjef3.js";import{i as re,n as ie,t as ae}from"./tooltip-BjuCvy5N.js";import{c as oe}from"./select-BELkoEB6.js";import{n as se,t as ce}from"./toggle-group-aEGkM0EG.js";import{t as a}from"./button-DzgjsZzC.js";import{n as le}from"./dist-Bs8bPT30.js";import{r as ue}from"./_envelope-DuFpUEag-DIV0rnvM.js";import"./schemas-api-C0HskKob.js";import{t as de}from"./chevron-down-COI0lQ_Z.js";import{t as fe}from"./spinner-CeYJkImG.js";import{t as pe}from"./panel-right-close-D50eEzbs.js";import{t as me}from"./panel-right-open-Bf2A8riD.js";import{t as he}from"./undo-2-DFO1_Si-.js";import{t as ge}from"./x-B-DmMnJT.js";import{a as _e,c as ve,i as ye,o as be,s as xe,t as Se}from"./dialog-BPbtQmOL.js";import{t as Ce}from"./timeline-diff-store-pL8c82kU.js";import{t as we}from"./lru-string-cache-DGM1SkID.js";import{a as Te,c as Ee,d as De,i as Oe,l as ke,n as Ae,o as je,r as Me,s as Ne,u as Pe}from"./use-timeline-entry-diff-DzUebDea.js";var Fe=te(),o=e(r(),1),s=n(),Ie=(0,o.lazy)(async()=>({default:(await t(()=>import(`./ActivityPanelDiffView-Btj__TNB.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]),import.meta.url)).ActivityPanelDiffView}));function Le(e){let t=(0,Fe.c)(183),{view:n,isPanelCollapsed:r,onTogglePanel:te,onDestinationComplete:we,onDestinationFailed:Le}=e,{_:c}=ee(),{docName:l,sha:u,parentSha:Be,laterEdits:d,authorName:Ve,relativeTime:He}=n,[Ue]=(0,o.useState)(ze),[f,We]=(0,o.useState)(`rendered`),[p,Ge]=(0,o.useState)(!1),[m,Ke]=(0,o.useState)(!1),qe=(0,o.useRef)(null),Je=(0,o.useRef)(null),Ye=(0,o.useRef)(null),[Xe,Ze]=(0,o.useState)(0),[Qe,$e]=(0,o.useState)(0),[h,et]=(0,o.useState)(!1),[tt,nt]=(0,o.useState)(!0),g=Me(u,l,Ue,`vs-parent`,Be),rt;t[0]===we?rt=t[1]:(rt=()=>{we?.(Je.current??void 0)},t[0]=we,t[1]=rt);let it=(0,o.useEffectEvent)(rt),at;t[2]===Le?at=t[3]:(at=()=>Le?.(),t[2]=Le,t[3]=at);let ot=(0,o.useEffectEvent)(at),st=(0,o.useRef)(null),ct;t[4]!==it||t[5]!==l||t[6]!==ot||t[7]!==g.key||t[8]!==g.status||t[9]!==u||t[10]!==n?(ct=()=>{st.current!==n&&(g.status!==`ready`&&g.status!==`error`||g.key===Ae(l,u)&&(g.status===`ready`?(st.current=n,it()):(st.current=n,ot())))},t[4]=it,t[5]=l,t[6]=ot,t[7]=g.key,t[8]=g.status,t[9]=u,t[10]=n,t[11]=ct):ct=t[11];let lt;t[12]!==l||t[13]!==g||t[14]!==u||t[15]!==n?(lt=[g,l,u,n],t[12]=l,t[13]=g,t[14]=u,t[15]=n,t[16]=lt):lt=t[16],(0,o.useEffect)(ct,lt);let _,v,y,b,ut,x;t[17]!==Qe||t[18]!==h||t[19]!==f||t[20]!==g.after||t[21]!==g.before||t[22]!==g.properties||t[23]!==g.status?(b=g.status===`ready`?Ee(g.before,g.after):null,x=f===`rendered`&&b?.ok===!0,v=g.status===`ready`?g.properties:null,y=v?.changes.length??0,_=v!==null&&(v.changes.length>0||v.unparseable!==null),ut=g.status===`ready`?x&&b?.ok?Pe(b):h?Qe:0:0,t[17]=Qe,t[18]=h,t[19]=f,t[20]=g.after,t[21]=g.before,t[22]=g.properties,t[23]=g.status,t[24]=_,t[25]=v,t[26]=y,t[27]=b,t[28]=ut,t[29]=x):(_=t[24],v=t[25],y=t[26],b=t[27],ut=t[28],x=t[29]);let dt=ut+(v===null?0:v.unparseable===null?tt?Math.min(y,50):0:1),ft;t[30]!==h||t[31]!==x?(ft=function(e){let t=Ye.current;if(!t)return;let n=[...t.querySelectorAll(Oe),...x?Array.from(t.querySelectorAll(ke)):h?Te(t):[]];if(n.length===0)return;let r=(e+n.length)%n.length;Ze(r),n[r]?.scrollIntoView({block:`center`,behavior:`smooth`})},t[30]=h,t[31]=x,t[32]=ft):ft=t[32];let pt=ft,mt,ht;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(mt=()=>()=>qe.current?.abort(),ht=[],t[33]=mt,t[34]=ht):(mt=t[33],ht=t[34]),(0,o.useEffect)(mt,ht);let gt=g.status===`ready`?`${f}:${g.diff}`:``,_t,vt;t[35]===gt?(_t=t[36],vt=t[37]):(vt=()=>{let e=Ye.current;if(gt===``||!e)return;Ze(0),$e(0),et(!1);let t=!1,n=null,r,i,ee=()=>{re.sync();let t=Te(e);return $e(t.length),et(!0),t},te=()=>{let n=ee();if(t)return;let r=e.querySelector(`[data-property-change]`)??e.querySelector(`.ok-diff-ins, .ok-diff-ins-block, [data-diff-deleted]`)??n[0];if(!r)return;t=!0;let i=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;r.scrollIntoView({block:`center`,behavior:i?`auto`:`smooth`})},ne=()=>{r!==void 0&&clearTimeout(r),r=setTimeout(()=>{i!==void 0&&cancelAnimationFrame(i),i=requestAnimationFrame(()=>{i=requestAnimationFrame(te)})},120)},re=je(e,ne);n=new MutationObserver(ne),n.observe(e,{childList:!0,subtree:!0}),ne();let ie=setTimeout(()=>{ee(),n?.disconnect(),re.disconnect()},5e3);return()=>{n?.disconnect(),re.disconnect(),r!==void 0&&clearTimeout(r),i!==void 0&&cancelAnimationFrame(i),clearTimeout(ie)}},_t=[gt],t[35]=gt,t[36]=_t,t[37]=vt),(0,o.useEffect)(vt,_t);let yt,bt;t[38]===p?(yt=t[39],bt=t[40]):(yt=()=>{let e=e=>{e.key===`Escape`&&(p||ne()||Ce())};return window.addEventListener(`keydown`,e,{capture:!0}),()=>window.removeEventListener(`keydown`,e,{capture:!0})},bt=[p],t[38]=p,t[39]=yt,t[40]=bt),(0,o.useEffect)(yt,bt);let xt;t[41]!==c||t[42]!==l||t[43]!==u?(xt=async function(){Ke(!0);let e=new AbortController;qe.current=e;let t=function(){e.signal.aborted||Ke(!1),qe.current===e&&(qe.current=null)},n;try{n=await fetch(`/api/rollback`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({docName:l,commitSha:u}),signal:e.signal})}catch(n){let r=n;!e.signal.aborted&&!(r instanceof DOMException&&r.name===`AbortError`)&&le.error(c({id:`NkXEFS`}),{duration:4e3}),t();return}if(e.signal.aborted){t();return}if(n.ok){t(),Ge(!1),Ce();return}let r=`HTTP ${n.status}`;try{let e=ue.safeParse(await n.json());e.success&&(r=e.data.title)}catch{}le.error(c({id:`uM6jnS`}),{description:r,duration:6e3}),t()},t[41]=c,t[42]=l,t[43]=u,t[44]=xt):xt=t[44];let S=xt,St=g.status===`ready`&&(g.additions>0||g.deletions>0),C;t[45]===c?C=t[46]:(C=c({id:`b18t0_`}),t[45]=c,t[46]=C);let Ct;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(Ct=(0,s.jsx)(ge,{className:`size-4`}),t[47]=Ct):Ct=t[47];let w;t[48]===C?w=t[49]:(w=(0,s.jsx)(re,{asChild:!0,children:(0,s.jsx)(a,{ref:Je,variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,"data-testid":`timeline-diff-close`,"aria-label":C,onClick:Re,children:Ct})}),t[48]=C,t[49]=w);let T;t[50]===c?T=t[51]:(T=c({id:`b18t0_`}),t[50]=c,t[51]=T);let E;t[52]===T?E=t[53]:(E=(0,s.jsx)(ie,{side:`bottom`,children:T}),t[52]=T,t[53]=E);let D;t[54]!==w||t[55]!==E?(D=(0,s.jsxs)(ae,{children:[w,E]}),t[54]=w,t[55]=E,t[56]=D):D=t[56];let O;t[57]===l?O=t[58]:(O=(0,s.jsx)(`div`,{className:`truncate text-sm font-medium text-foreground`,children:l}),t[57]=l,t[58]=O);let k;t[59]!==Ve||t[60]!==He?(k=(0,s.jsxs)(`div`,{className:`truncate text-xs text-muted-foreground`,children:[Ve,` · `,He]}),t[59]=Ve,t[60]=He,t[61]=k):k=t[61];let A;t[62]!==O||t[63]!==k?(A=(0,s.jsxs)(`div`,{className:`min-w-[8rem] flex-1`,children:[O,k]}),t[62]=O,t[63]=k,t[64]=A):A=t[64];let j;t[65]===y?j=t[66]:(j=y>0&&(0,s.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground tabular-nums`,"data-testid":`timeline-diff-property-stat`,children:(0,s.jsx)(i,{id:`UI0WPT`,values:{propertyCount:y}})}),t[65]=y,t[66]=j);let M;t[67]!==c||t[68]!==g.additions||t[69]!==g.deletions||t[70]!==g.status||t[71]!==St?(M=St&&g.status===`ready`&&(0,s.jsxs)(`span`,{role:`img`,className:`shrink-0 text-xs tabular-nums`,"data-testid":`timeline-diff-stat`,"aria-label":c({id:`8lwQlE`,values:{0:g.additions,1:g.deletions}}),children:[(0,s.jsxs)(`span`,{"aria-hidden":`true`,className:`text-success`,children:[`+`,g.additions]}),` `,(0,s.jsxs)(`span`,{"aria-hidden":`true`,className:`text-destructive`,children:[`−`,g.deletions]})]}),t[67]=c,t[68]=g.additions,t[69]=g.deletions,t[70]=g.status,t[71]=St,t[72]=M):M=t[72];let wt;t[73]===Symbol.for(`react.memo_cache_sentinel`)?(wt=e=>{(e===`rendered`||e===`source`)&&We(e)},t[73]=wt):wt=t[73];let N;t[74]===c?N=t[75]:(N=c({id:`ZW3mlR`}),t[74]=c,t[75]=N);let Tt;t[76]===Symbol.for(`react.memo_cache_sentinel`)?(Tt=(0,s.jsx)(se,{value:`rendered`,className:`h-6 px-2 text-xs`,"data-testid":`timeline-diff-render-rendered`,children:(0,s.jsx)(i,{id:`4z_1j2`})}),t[76]=Tt):Tt=t[76];let Et;t[77]===Symbol.for(`react.memo_cache_sentinel`)?(Et=(0,s.jsx)(se,{value:`source`,className:`h-6 px-2 text-xs`,"data-testid":`timeline-diff-render-source`,children:(0,s.jsx)(i,{id:`wdxz7K`})}),t[77]=Et):Et=t[77];let Dt;t[78]!==f||t[79]!==N?(Dt=(0,s.jsxs)(ce,{type:`single`,value:f,onValueChange:wt,"aria-label":N,variant:`segmented`,size:`sm`,spacing:1,className:`shrink-0 rounded-md bg-muted p-0.5 dark:bg-background`,children:[Tt,Et]}),t[78]=f,t[79]=N,t[80]=Dt):Dt=t[80];let P;t[81]!==c||t[82]!==dt||t[83]!==Xe||t[84]!==pt?(P=dt>1&&(0,s.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5 rounded-md border border-border bg-muted/40 p-0.5 dark:bg-background`,children:[(0,s.jsx)(a,{variant:`ghost`,size:`icon`,className:`size-6`,"aria-label":c({id:`_azghp`}),"data-testid":`timeline-diff-prev`,onClick:()=>pt(Xe-1),children:(0,s.jsx)(oe,{className:`size-3.5`})}),(0,s.jsxs)(`span`,{className:`px-0.5 text-xs tabular-nums text-muted-foreground`,"aria-live":`polite`,children:[Xe+1,` / `,dt]}),(0,s.jsx)(a,{variant:`ghost`,size:`icon`,className:`size-6`,"aria-label":c({id:`-bFGPF`}),"data-testid":`timeline-diff-next`,onClick:()=>pt(Xe+1),children:(0,s.jsx)(de,{className:`size-3.5`})})]}),t[81]=c,t[82]=dt,t[83]=Xe,t[84]=pt,t[85]=P):P=t[85];let F;t[86]!==S||t[87]!==d?(F=()=>d>0?Ge(!0):S(),t[86]=S,t[87]=d,t[88]=F):F=t[88];let I;t[89]===m?I=t[90]:(I=m?(0,s.jsx)(fe,{"aria-hidden":`true`,className:`mr-1.5 size-3.5`}):(0,s.jsx)(he,{className:`mr-1.5 size-3.5`}),t[89]=m,t[90]=I);let Ot;t[91]===Symbol.for(`react.memo_cache_sentinel`)?(Ot=(0,s.jsx)(i,{id:`yKu_3Y`}),t[91]=Ot):Ot=t[91];let L;t[92]!==m||t[93]!==F||t[94]!==I?(L=(0,s.jsxs)(a,{variant:`outline`,size:`sm`,className:`h-7 shrink-0`,"data-testid":`timeline-diff-restore`,disabled:m,onClick:F,children:[I,Ot]}),t[92]=m,t[93]=F,t[94]=I,t[95]=L):L=t[95];let R;t[96]!==c||t[97]!==r?(R=c(r?{id:`6iDEWA`}:{id:`170Js2`}),t[96]=c,t[97]=r,t[98]=R):R=t[98];let kt=!r,z;t[99]===r?z=t[100]:(z=r?(0,s.jsx)(me,{className:`size-4`}):(0,s.jsx)(pe,{className:`size-4`}),t[99]=r,t[100]=z);let B;t[101]!==te||t[102]!==R||t[103]!==kt||t[104]!==z?(B=(0,s.jsx)(re,{asChild:!0,children:(0,s.jsx)(a,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,"data-testid":`timeline-diff-toggle-panel`,"aria-label":R,"aria-expanded":kt,onClick:te,children:z})}),t[101]=te,t[102]=R,t[103]=kt,t[104]=z,t[105]=B):B=t[105];let V;t[106]!==c||t[107]!==r?(V=c(r?{id:`6iDEWA`}:{id:`170Js2`}),t[106]=c,t[107]=r,t[108]=V):V=t[108];let H;t[109]===V?H=t[110]:(H=(0,s.jsx)(ie,{side:`bottom`,children:V}),t[109]=V,t[110]=H);let U;t[111]!==B||t[112]!==H?(U=(0,s.jsxs)(ae,{children:[B,H]}),t[111]=B,t[112]=H,t[113]=U):U=t[113];let W;t[114]!==j||t[115]!==M||t[116]!==Dt||t[117]!==P||t[118]!==L||t[119]!==U?(W=(0,s.jsxs)(`div`,{className:`ml-auto flex flex-wrap items-center justify-end gap-2`,children:[j,M,Dt,P,L,U]}),t[114]=j,t[115]=M,t[116]=Dt,t[117]=P,t[118]=L,t[119]=U,t[120]=W):W=t[120];let G;t[121]!==D||t[122]!==A||t[123]!==W?(G=(0,s.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1.5 border-b border-border px-3 py-2`,children:[D,A,W]}),t[121]=D,t[122]=A,t[123]=W,t[124]=G):G=t[124];let K;t[125]===g.status?K=t[126]:(K=g.status===`loading`&&(0,s.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-3 text-xs text-muted-foreground`,children:[(0,s.jsx)(fe,{"aria-hidden":`true`,className:`size-3`}),(0,s.jsx)(i,{id:`38foVZ`})]}),t[125]=g.status,t[126]=K);let q;t[127]===g.status?q=t[128]:(q=g.status===`error`&&(0,s.jsx)(`p`,{className:`px-4 py-3 text-xs text-destructive`,children:(0,s.jsx)(i,{id:`vvWZnu`})}),t[127]=g.status,t[128]=q);let J;t[129]!==v||t[130]!==tt||t[131]!==g.status?(J=g.status===`ready`&&v!==null&&(0,s.jsx)(De,{delta:v,open:tt,onOpenChange:e=>{nt(e),Ze(0)}}),t[129]=v,t[130]=tt,t[131]=g.status,t[132]=J):J=t[132];let Y;t[133]!==l||t[134]!==_||t[135]!==f||t[136]!==b||t[137]!==g.after||t[138]!==g.before||t[139]!==g.diff||t[140]!==g.status||t[141]!==u?(Y=g.status===`ready`&&(f===`rendered`&&b?.ok?(0,s.jsx)(Ne,{diff:b,docName:l}):g.diff===``?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(`p`,{className:`border-b border-border px-4 py-2 text-xs text-muted-foreground italic`,children:_?(0,s.jsx)(i,{id:`oCO0pe`}):(0,s.jsx)(i,{id:`3YWddZ`})}),(0,s.jsx)(`pre`,{className:`whitespace-pre-wrap px-4 py-3 font-mono text-xs text-foreground/90`,children:g.after})]}):(0,s.jsx)(o.Suspense,{fallback:(0,s.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-3 text-xs text-muted-foreground`,children:[(0,s.jsx)(fe,{"aria-hidden":`true`,className:`size-3`}),(0,s.jsx)(i,{id:`EDm3wJ`})]}),children:(0,s.jsx)(Ie,{before:g.before,after:g.after,cacheKey:`${l}@${u}`})})),t[133]=l,t[134]=_,t[135]=f,t[136]=b,t[137]=g.after,t[138]=g.before,t[139]=g.diff,t[140]=g.status,t[141]=u,t[142]=Y):Y=t[142];let X;t[143]!==K||t[144]!==q||t[145]!==J||t[146]!==Y?(X=(0,s.jsxs)(`div`,{ref:Ye,className:`min-h-0 flex-1 overflow-auto subtle-scrollbar`,children:[K,q,J,Y]}),t[143]=K,t[144]=q,t[145]=J,t[146]=Y,t[147]=X):X=t[147];let Z;t[148]===m?Z=t[149]:(Z=e=>{!e&&!m?Ge(!1):e&&Ge(!0)},t[148]=m,t[149]=Z);let At;t[150]===c?At=t[151]:(At=c({id:`n3wx1q`}),t[150]=c,t[151]=At);let jt;t[152]===At?jt=t[153]:(jt=(0,s.jsx)(ve,{children:At}),t[152]=At,t[153]=jt);let Mt;t[154]===d?Mt=t[155]:(Mt=(0,s.jsx)(i,{id:`nfPccR`,values:{laterEdits:d}}),t[154]=d,t[155]=Mt);let Nt;t[156]===Symbol.for(`react.memo_cache_sentinel`)?(Nt=(0,s.jsx)(i,{id:`5ZbJFS`}),t[156]=Nt):Nt=t[156];let Pt;t[157]===Mt?Pt=t[158]:(Pt=(0,s.jsxs)(_e,{children:[Mt,` `,Nt]}),t[157]=Mt,t[158]=Pt);let Ft;t[159]!==jt||t[160]!==Pt?(Ft=(0,s.jsxs)(xe,{children:[jt,Pt]}),t[159]=jt,t[160]=Pt,t[161]=Ft):Ft=t[161];let It;t[162]===Symbol.for(`react.memo_cache_sentinel`)?(It=(0,s.jsx)(a,{variant:`outline`,"data-testid":`timeline-diff-restore-cancel`,onClick:()=>Ge(!1),children:(0,s.jsx)(i,{id:`dEgA5A`})}),t[162]=It):It=t[162];let Lt;t[163]===S?Lt=t[164]:(Lt=()=>S(),t[163]=S,t[164]=Lt);let Rt;t[165]===m?Rt=t[166]:(Rt=m?(0,s.jsx)(fe,{"aria-hidden":`true`,className:`mr-2 size-4`}):null,t[165]=m,t[166]=Rt);let zt;t[167]===Symbol.for(`react.memo_cache_sentinel`)?(zt=(0,s.jsx)(i,{id:`yKu_3Y`}),t[167]=zt):zt=t[167];let Bt;t[168]!==m||t[169]!==Lt||t[170]!==Rt?(Bt=(0,s.jsxs)(be,{children:[It,(0,s.jsxs)(a,{variant:`destructive`,"data-testid":`timeline-diff-restore-confirm`,disabled:m,onClick:Lt,children:[Rt,zt]})]}),t[168]=m,t[169]=Lt,t[170]=Rt,t[171]=Bt):Bt=t[171];let Q;t[172]!==Ft||t[173]!==Bt?(Q=(0,s.jsxs)(ye,{children:[Ft,Bt]}),t[172]=Ft,t[173]=Bt,t[174]=Q):Q=t[174];let $;t[175]!==p||t[176]!==Z||t[177]!==Q?($=(0,s.jsx)(Se,{open:p,onOpenChange:Z,children:Q}),t[175]=p,t[176]=Z,t[177]=Q,t[178]=$):$=t[178];let Vt;return t[179]!==G||t[180]!==X||t[181]!==$?(Vt=(0,s.jsxs)(`div`,{className:`absolute inset-0 z-20 flex flex-col bg-background`,"data-testid":`timeline-diff-pane`,children:[G,X,$]}),t[179]=G,t[180]=X,t[181]=$,t[182]=Vt):Vt=t[182],Vt}function Re(){return Ce()}function ze(){return new we(32)}export{Le as TimelineDiffPane};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ActivityPanelDiffView-Drnt3eYg.js","./dist-Nvb76hAm.js","./chunk-CYidjpOJ.js","./jsx-runtime-BUgB2tll.js","./react-f2sANaYj.js","./pierre-theme-bTg6dZWN.js","./preload-helper-Chd9yIcd.js","./engine-compile-DCXqaKj1.js","./lib-BFwLNStM.js","./ccount-Bpl7p-di.js","./lib-BdDWWJXX.js","./space-separated-tokens-Db5y9Cue.js","./lib-C_jEl4A5.js","./ok-syntax-theme-8liHuuQb.js","./MultiFileDiff-B2a-fkjz.js","./react-error-boundary-6ac6QM6R.js","./compiler-runtime-BfE3aGVn.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./preload-helper-Chd9yIcd.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{t as r}from"./react-f2sANaYj.js";import{n as i,r as ee}from"./dist-Nvb76hAm.js";import{t as te}from"./compiler-runtime-BfE3aGVn.js";import{t as ne}from"./overlay-layers-CKMAjef3.js";import{i as re,n as ie,t as ae}from"./tooltip-BjuCvy5N.js";import{c as oe}from"./select-BELkoEB6.js";import{n as se,t as ce}from"./toggle-group-aEGkM0EG.js";import{t as a}from"./button-DzgjsZzC.js";import{n as le}from"./dist-Bs8bPT30.js";import{r as ue}from"./_envelope-DuFpUEag-DIV0rnvM.js";import"./schemas-api-C0HskKob.js";import{t as de}from"./chevron-down-COI0lQ_Z.js";import{t as fe}from"./spinner-CeYJkImG.js";import{t as pe}from"./panel-right-close-D50eEzbs.js";import{t as me}from"./panel-right-open-Bf2A8riD.js";import{t as he}from"./undo-2-DFO1_Si-.js";import{t as ge}from"./x-B-DmMnJT.js";import{a as _e,c as ve,i as ye,o as be,s as xe,t as Se}from"./dialog-BPbtQmOL.js";import{t as Ce}from"./timeline-diff-store-pL8c82kU.js";import{t as we}from"./lru-string-cache-DGM1SkID.js";import{a as Te,c as Ee,d as De,i as Oe,l as ke,n as Ae,o as je,r as Me,s as Ne,u as Pe}from"./use-timeline-entry-diff-BMLS3VzF.js";var Fe=te(),o=e(r(),1),s=n(),Ie=(0,o.lazy)(async()=>({default:(await t(()=>import(`./ActivityPanelDiffView-Drnt3eYg.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]),import.meta.url)).ActivityPanelDiffView}));function Le(e){let t=(0,Fe.c)(183),{view:n,isPanelCollapsed:r,onTogglePanel:te,onDestinationComplete:we,onDestinationFailed:Le}=e,{_:c}=ee(),{docName:l,sha:u,parentSha:Be,laterEdits:d,authorName:Ve,relativeTime:He}=n,[Ue]=(0,o.useState)(ze),[f,We]=(0,o.useState)(`rendered`),[p,Ge]=(0,o.useState)(!1),[m,Ke]=(0,o.useState)(!1),qe=(0,o.useRef)(null),Je=(0,o.useRef)(null),Ye=(0,o.useRef)(null),[Xe,Ze]=(0,o.useState)(0),[Qe,$e]=(0,o.useState)(0),[h,et]=(0,o.useState)(!1),[tt,nt]=(0,o.useState)(!0),g=Me(u,l,Ue,`vs-parent`,Be),rt;t[0]===we?rt=t[1]:(rt=()=>{we?.(Je.current??void 0)},t[0]=we,t[1]=rt);let it=(0,o.useEffectEvent)(rt),at;t[2]===Le?at=t[3]:(at=()=>Le?.(),t[2]=Le,t[3]=at);let ot=(0,o.useEffectEvent)(at),st=(0,o.useRef)(null),ct;t[4]!==it||t[5]!==l||t[6]!==ot||t[7]!==g.key||t[8]!==g.status||t[9]!==u||t[10]!==n?(ct=()=>{st.current!==n&&(g.status!==`ready`&&g.status!==`error`||g.key===Ae(l,u)&&(g.status===`ready`?(st.current=n,it()):(st.current=n,ot())))},t[4]=it,t[5]=l,t[6]=ot,t[7]=g.key,t[8]=g.status,t[9]=u,t[10]=n,t[11]=ct):ct=t[11];let lt;t[12]!==l||t[13]!==g||t[14]!==u||t[15]!==n?(lt=[g,l,u,n],t[12]=l,t[13]=g,t[14]=u,t[15]=n,t[16]=lt):lt=t[16],(0,o.useEffect)(ct,lt);let _,v,y,b,ut,x;t[17]!==Qe||t[18]!==h||t[19]!==f||t[20]!==g.after||t[21]!==g.before||t[22]!==g.properties||t[23]!==g.status?(b=g.status===`ready`?Ee(g.before,g.after):null,x=f===`rendered`&&b?.ok===!0,v=g.status===`ready`?g.properties:null,y=v?.changes.length??0,_=v!==null&&(v.changes.length>0||v.unparseable!==null),ut=g.status===`ready`?x&&b?.ok?Pe(b):h?Qe:0:0,t[17]=Qe,t[18]=h,t[19]=f,t[20]=g.after,t[21]=g.before,t[22]=g.properties,t[23]=g.status,t[24]=_,t[25]=v,t[26]=y,t[27]=b,t[28]=ut,t[29]=x):(_=t[24],v=t[25],y=t[26],b=t[27],ut=t[28],x=t[29]);let dt=ut+(v===null?0:v.unparseable===null?tt?Math.min(y,50):0:1),ft;t[30]!==h||t[31]!==x?(ft=function(e){let t=Ye.current;if(!t)return;let n=[...t.querySelectorAll(Oe),...x?Array.from(t.querySelectorAll(ke)):h?Te(t):[]];if(n.length===0)return;let r=(e+n.length)%n.length;Ze(r),n[r]?.scrollIntoView({block:`center`,behavior:`smooth`})},t[30]=h,t[31]=x,t[32]=ft):ft=t[32];let pt=ft,mt,ht;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(mt=()=>()=>qe.current?.abort(),ht=[],t[33]=mt,t[34]=ht):(mt=t[33],ht=t[34]),(0,o.useEffect)(mt,ht);let gt=g.status===`ready`?`${f}:${g.diff}`:``,_t,vt;t[35]===gt?(_t=t[36],vt=t[37]):(vt=()=>{let e=Ye.current;if(gt===``||!e)return;Ze(0),$e(0),et(!1);let t=!1,n=null,r,i,ee=()=>{re.sync();let t=Te(e);return $e(t.length),et(!0),t},te=()=>{let n=ee();if(t)return;let r=e.querySelector(`[data-property-change]`)??e.querySelector(`.ok-diff-ins, .ok-diff-ins-block, [data-diff-deleted]`)??n[0];if(!r)return;t=!0;let i=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;r.scrollIntoView({block:`center`,behavior:i?`auto`:`smooth`})},ne=()=>{r!==void 0&&clearTimeout(r),r=setTimeout(()=>{i!==void 0&&cancelAnimationFrame(i),i=requestAnimationFrame(()=>{i=requestAnimationFrame(te)})},120)},re=je(e,ne);n=new MutationObserver(ne),n.observe(e,{childList:!0,subtree:!0}),ne();let ie=setTimeout(()=>{ee(),n?.disconnect(),re.disconnect()},5e3);return()=>{n?.disconnect(),re.disconnect(),r!==void 0&&clearTimeout(r),i!==void 0&&cancelAnimationFrame(i),clearTimeout(ie)}},_t=[gt],t[35]=gt,t[36]=_t,t[37]=vt),(0,o.useEffect)(vt,_t);let yt,bt;t[38]===p?(yt=t[39],bt=t[40]):(yt=()=>{let e=e=>{e.key===`Escape`&&(p||ne()||Ce())};return window.addEventListener(`keydown`,e,{capture:!0}),()=>window.removeEventListener(`keydown`,e,{capture:!0})},bt=[p],t[38]=p,t[39]=yt,t[40]=bt),(0,o.useEffect)(yt,bt);let xt;t[41]!==c||t[42]!==l||t[43]!==u?(xt=async function(){Ke(!0);let e=new AbortController;qe.current=e;let t=function(){e.signal.aborted||Ke(!1),qe.current===e&&(qe.current=null)},n;try{n=await fetch(`/api/rollback`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({docName:l,commitSha:u}),signal:e.signal})}catch(n){let r=n;!e.signal.aborted&&!(r instanceof DOMException&&r.name===`AbortError`)&&le.error(c({id:`NkXEFS`}),{duration:4e3}),t();return}if(e.signal.aborted){t();return}if(n.ok){t(),Ge(!1),Ce();return}let r=`HTTP ${n.status}`;try{let e=ue.safeParse(await n.json());e.success&&(r=e.data.title)}catch{}le.error(c({id:`uM6jnS`}),{description:r,duration:6e3}),t()},t[41]=c,t[42]=l,t[43]=u,t[44]=xt):xt=t[44];let S=xt,St=g.status===`ready`&&(g.additions>0||g.deletions>0),C;t[45]===c?C=t[46]:(C=c({id:`b18t0_`}),t[45]=c,t[46]=C);let Ct;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(Ct=(0,s.jsx)(ge,{className:`size-4`}),t[47]=Ct):Ct=t[47];let w;t[48]===C?w=t[49]:(w=(0,s.jsx)(re,{asChild:!0,children:(0,s.jsx)(a,{ref:Je,variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,"data-testid":`timeline-diff-close`,"aria-label":C,onClick:Re,children:Ct})}),t[48]=C,t[49]=w);let T;t[50]===c?T=t[51]:(T=c({id:`b18t0_`}),t[50]=c,t[51]=T);let E;t[52]===T?E=t[53]:(E=(0,s.jsx)(ie,{side:`bottom`,children:T}),t[52]=T,t[53]=E);let D;t[54]!==w||t[55]!==E?(D=(0,s.jsxs)(ae,{children:[w,E]}),t[54]=w,t[55]=E,t[56]=D):D=t[56];let O;t[57]===l?O=t[58]:(O=(0,s.jsx)(`div`,{className:`truncate text-sm font-medium text-foreground`,children:l}),t[57]=l,t[58]=O);let k;t[59]!==Ve||t[60]!==He?(k=(0,s.jsxs)(`div`,{className:`truncate text-xs text-muted-foreground`,children:[Ve,` · `,He]}),t[59]=Ve,t[60]=He,t[61]=k):k=t[61];let A;t[62]!==O||t[63]!==k?(A=(0,s.jsxs)(`div`,{className:`min-w-[8rem] flex-1`,children:[O,k]}),t[62]=O,t[63]=k,t[64]=A):A=t[64];let j;t[65]===y?j=t[66]:(j=y>0&&(0,s.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground tabular-nums`,"data-testid":`timeline-diff-property-stat`,children:(0,s.jsx)(i,{id:`UI0WPT`,values:{propertyCount:y}})}),t[65]=y,t[66]=j);let M;t[67]!==c||t[68]!==g.additions||t[69]!==g.deletions||t[70]!==g.status||t[71]!==St?(M=St&&g.status===`ready`&&(0,s.jsxs)(`span`,{role:`img`,className:`shrink-0 text-xs tabular-nums`,"data-testid":`timeline-diff-stat`,"aria-label":c({id:`8lwQlE`,values:{0:g.additions,1:g.deletions}}),children:[(0,s.jsxs)(`span`,{"aria-hidden":`true`,className:`text-success`,children:[`+`,g.additions]}),` `,(0,s.jsxs)(`span`,{"aria-hidden":`true`,className:`text-destructive`,children:[`−`,g.deletions]})]}),t[67]=c,t[68]=g.additions,t[69]=g.deletions,t[70]=g.status,t[71]=St,t[72]=M):M=t[72];let wt;t[73]===Symbol.for(`react.memo_cache_sentinel`)?(wt=e=>{(e===`rendered`||e===`source`)&&We(e)},t[73]=wt):wt=t[73];let N;t[74]===c?N=t[75]:(N=c({id:`ZW3mlR`}),t[74]=c,t[75]=N);let Tt;t[76]===Symbol.for(`react.memo_cache_sentinel`)?(Tt=(0,s.jsx)(se,{value:`rendered`,className:`h-6 px-2 text-xs`,"data-testid":`timeline-diff-render-rendered`,children:(0,s.jsx)(i,{id:`4z_1j2`})}),t[76]=Tt):Tt=t[76];let Et;t[77]===Symbol.for(`react.memo_cache_sentinel`)?(Et=(0,s.jsx)(se,{value:`source`,className:`h-6 px-2 text-xs`,"data-testid":`timeline-diff-render-source`,children:(0,s.jsx)(i,{id:`wdxz7K`})}),t[77]=Et):Et=t[77];let Dt;t[78]!==f||t[79]!==N?(Dt=(0,s.jsxs)(ce,{type:`single`,value:f,onValueChange:wt,"aria-label":N,variant:`segmented`,size:`sm`,spacing:1,className:`shrink-0 rounded-md bg-muted p-0.5 dark:bg-background`,children:[Tt,Et]}),t[78]=f,t[79]=N,t[80]=Dt):Dt=t[80];let P;t[81]!==c||t[82]!==dt||t[83]!==Xe||t[84]!==pt?(P=dt>1&&(0,s.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5 rounded-md border border-border bg-muted/40 p-0.5 dark:bg-background`,children:[(0,s.jsx)(a,{variant:`ghost`,size:`icon`,className:`size-6`,"aria-label":c({id:`_azghp`}),"data-testid":`timeline-diff-prev`,onClick:()=>pt(Xe-1),children:(0,s.jsx)(oe,{className:`size-3.5`})}),(0,s.jsxs)(`span`,{className:`px-0.5 text-xs tabular-nums text-muted-foreground`,"aria-live":`polite`,children:[Xe+1,` / `,dt]}),(0,s.jsx)(a,{variant:`ghost`,size:`icon`,className:`size-6`,"aria-label":c({id:`-bFGPF`}),"data-testid":`timeline-diff-next`,onClick:()=>pt(Xe+1),children:(0,s.jsx)(de,{className:`size-3.5`})})]}),t[81]=c,t[82]=dt,t[83]=Xe,t[84]=pt,t[85]=P):P=t[85];let F;t[86]!==S||t[87]!==d?(F=()=>d>0?Ge(!0):S(),t[86]=S,t[87]=d,t[88]=F):F=t[88];let I;t[89]===m?I=t[90]:(I=m?(0,s.jsx)(fe,{"aria-hidden":`true`,className:`mr-1.5 size-3.5`}):(0,s.jsx)(he,{className:`mr-1.5 size-3.5`}),t[89]=m,t[90]=I);let Ot;t[91]===Symbol.for(`react.memo_cache_sentinel`)?(Ot=(0,s.jsx)(i,{id:`yKu_3Y`}),t[91]=Ot):Ot=t[91];let L;t[92]!==m||t[93]!==F||t[94]!==I?(L=(0,s.jsxs)(a,{variant:`outline`,size:`sm`,className:`h-7 shrink-0`,"data-testid":`timeline-diff-restore`,disabled:m,onClick:F,children:[I,Ot]}),t[92]=m,t[93]=F,t[94]=I,t[95]=L):L=t[95];let R;t[96]!==c||t[97]!==r?(R=c(r?{id:`6iDEWA`}:{id:`170Js2`}),t[96]=c,t[97]=r,t[98]=R):R=t[98];let kt=!r,z;t[99]===r?z=t[100]:(z=r?(0,s.jsx)(me,{className:`size-4`}):(0,s.jsx)(pe,{className:`size-4`}),t[99]=r,t[100]=z);let B;t[101]!==te||t[102]!==R||t[103]!==kt||t[104]!==z?(B=(0,s.jsx)(re,{asChild:!0,children:(0,s.jsx)(a,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,"data-testid":`timeline-diff-toggle-panel`,"aria-label":R,"aria-expanded":kt,onClick:te,children:z})}),t[101]=te,t[102]=R,t[103]=kt,t[104]=z,t[105]=B):B=t[105];let V;t[106]!==c||t[107]!==r?(V=c(r?{id:`6iDEWA`}:{id:`170Js2`}),t[106]=c,t[107]=r,t[108]=V):V=t[108];let H;t[109]===V?H=t[110]:(H=(0,s.jsx)(ie,{side:`bottom`,children:V}),t[109]=V,t[110]=H);let U;t[111]!==B||t[112]!==H?(U=(0,s.jsxs)(ae,{children:[B,H]}),t[111]=B,t[112]=H,t[113]=U):U=t[113];let W;t[114]!==j||t[115]!==M||t[116]!==Dt||t[117]!==P||t[118]!==L||t[119]!==U?(W=(0,s.jsxs)(`div`,{className:`ml-auto flex flex-wrap items-center justify-end gap-2`,children:[j,M,Dt,P,L,U]}),t[114]=j,t[115]=M,t[116]=Dt,t[117]=P,t[118]=L,t[119]=U,t[120]=W):W=t[120];let G;t[121]!==D||t[122]!==A||t[123]!==W?(G=(0,s.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1.5 border-b border-border px-3 py-2`,children:[D,A,W]}),t[121]=D,t[122]=A,t[123]=W,t[124]=G):G=t[124];let K;t[125]===g.status?K=t[126]:(K=g.status===`loading`&&(0,s.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-3 text-xs text-muted-foreground`,children:[(0,s.jsx)(fe,{"aria-hidden":`true`,className:`size-3`}),(0,s.jsx)(i,{id:`38foVZ`})]}),t[125]=g.status,t[126]=K);let q;t[127]===g.status?q=t[128]:(q=g.status===`error`&&(0,s.jsx)(`p`,{className:`px-4 py-3 text-xs text-destructive`,children:(0,s.jsx)(i,{id:`vvWZnu`})}),t[127]=g.status,t[128]=q);let J;t[129]!==v||t[130]!==tt||t[131]!==g.status?(J=g.status===`ready`&&v!==null&&(0,s.jsx)(De,{delta:v,open:tt,onOpenChange:e=>{nt(e),Ze(0)}}),t[129]=v,t[130]=tt,t[131]=g.status,t[132]=J):J=t[132];let Y;t[133]!==l||t[134]!==_||t[135]!==f||t[136]!==b||t[137]!==g.after||t[138]!==g.before||t[139]!==g.diff||t[140]!==g.status||t[141]!==u?(Y=g.status===`ready`&&(f===`rendered`&&b?.ok?(0,s.jsx)(Ne,{diff:b,docName:l}):g.diff===``?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(`p`,{className:`border-b border-border px-4 py-2 text-xs text-muted-foreground italic`,children:_?(0,s.jsx)(i,{id:`oCO0pe`}):(0,s.jsx)(i,{id:`3YWddZ`})}),(0,s.jsx)(`pre`,{className:`whitespace-pre-wrap px-4 py-3 font-mono text-xs text-foreground/90`,children:g.after})]}):(0,s.jsx)(o.Suspense,{fallback:(0,s.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-3 text-xs text-muted-foreground`,children:[(0,s.jsx)(fe,{"aria-hidden":`true`,className:`size-3`}),(0,s.jsx)(i,{id:`EDm3wJ`})]}),children:(0,s.jsx)(Ie,{before:g.before,after:g.after,cacheKey:`${l}@${u}`})})),t[133]=l,t[134]=_,t[135]=f,t[136]=b,t[137]=g.after,t[138]=g.before,t[139]=g.diff,t[140]=g.status,t[141]=u,t[142]=Y):Y=t[142];let X;t[143]!==K||t[144]!==q||t[145]!==J||t[146]!==Y?(X=(0,s.jsxs)(`div`,{ref:Ye,className:`min-h-0 flex-1 overflow-auto subtle-scrollbar`,children:[K,q,J,Y]}),t[143]=K,t[144]=q,t[145]=J,t[146]=Y,t[147]=X):X=t[147];let Z;t[148]===m?Z=t[149]:(Z=e=>{!e&&!m?Ge(!1):e&&Ge(!0)},t[148]=m,t[149]=Z);let At;t[150]===c?At=t[151]:(At=c({id:`n3wx1q`}),t[150]=c,t[151]=At);let jt;t[152]===At?jt=t[153]:(jt=(0,s.jsx)(ve,{children:At}),t[152]=At,t[153]=jt);let Mt;t[154]===d?Mt=t[155]:(Mt=(0,s.jsx)(i,{id:`nfPccR`,values:{laterEdits:d}}),t[154]=d,t[155]=Mt);let Nt;t[156]===Symbol.for(`react.memo_cache_sentinel`)?(Nt=(0,s.jsx)(i,{id:`5ZbJFS`}),t[156]=Nt):Nt=t[156];let Pt;t[157]===Mt?Pt=t[158]:(Pt=(0,s.jsxs)(_e,{children:[Mt,` `,Nt]}),t[157]=Mt,t[158]=Pt);let Ft;t[159]!==jt||t[160]!==Pt?(Ft=(0,s.jsxs)(xe,{children:[jt,Pt]}),t[159]=jt,t[160]=Pt,t[161]=Ft):Ft=t[161];let It;t[162]===Symbol.for(`react.memo_cache_sentinel`)?(It=(0,s.jsx)(a,{variant:`outline`,"data-testid":`timeline-diff-restore-cancel`,onClick:()=>Ge(!1),children:(0,s.jsx)(i,{id:`dEgA5A`})}),t[162]=It):It=t[162];let Lt;t[163]===S?Lt=t[164]:(Lt=()=>S(),t[163]=S,t[164]=Lt);let Rt;t[165]===m?Rt=t[166]:(Rt=m?(0,s.jsx)(fe,{"aria-hidden":`true`,className:`mr-2 size-4`}):null,t[165]=m,t[166]=Rt);let zt;t[167]===Symbol.for(`react.memo_cache_sentinel`)?(zt=(0,s.jsx)(i,{id:`yKu_3Y`}),t[167]=zt):zt=t[167];let Bt;t[168]!==m||t[169]!==Lt||t[170]!==Rt?(Bt=(0,s.jsxs)(be,{children:[It,(0,s.jsxs)(a,{variant:`destructive`,"data-testid":`timeline-diff-restore-confirm`,disabled:m,onClick:Lt,children:[Rt,zt]})]}),t[168]=m,t[169]=Lt,t[170]=Rt,t[171]=Bt):Bt=t[171];let Q;t[172]!==Ft||t[173]!==Bt?(Q=(0,s.jsxs)(ye,{children:[Ft,Bt]}),t[172]=Ft,t[173]=Bt,t[174]=Q):Q=t[174];let $;t[175]!==p||t[176]!==Z||t[177]!==Q?($=(0,s.jsx)(Se,{open:p,onOpenChange:Z,children:Q}),t[175]=p,t[176]=Z,t[177]=Q,t[178]=$):$=t[178];let Vt;return t[179]!==G||t[180]!==X||t[181]!==$?(Vt=(0,s.jsxs)(`div`,{className:`absolute inset-0 z-20 flex flex-col bg-background`,"data-testid":`timeline-diff-pane`,children:[G,X,$]}),t[179]=G,t[180]=X,t[181]=$,t[182]=Vt):Vt=t[182],Vt}function Re(){return Ce()}function ze(){return new we(32)}export{Le as TimelineDiffPane};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./highlighted-body-OFNGDK62-
|
|
2
|
-
import{o as e,t}from"./chunk-CYidjpOJ.js";import{t as n}from"./preload-helper-Chd9yIcd.js";import{t as r}from"./jsx-runtime-BUgB2tll.js";import{t as i}from"./react-f2sANaYj.js";import{t as a}from"./react-dom-DPxgxlDT.js";import{n as o,t as s}from"./bundle-mjs-SHeFpKGC.js";import{B as c,N as l,R as u,a as d,c as f,t as p,z as m}from"./lib-Bq-Hw4OM.js";import{a as h,c as g,d as _,i as v,l as y,o as b,s as x}from"./trim-lines-34TPYcWX.js";import{a as S,c as C,i as w,n as ee,o as T,s as te,u as E}from"./space-separated-tokens-Db5y9Cue.js";import{a as ne,i as D,n as O,r as re,t as ie}from"./lib-dxiLvrQN.js";import{n as ae,t as oe}from"./lib-AgCVC0Wn.js";var k=e(i(),1),A={indicator:`indicator`,textOnly:`text-only`,remove:`remove`};function se({defaultOrigin:e=``,allowedLinkPrefixes:t=[],allowedImagePrefixes:n=[],allowDataImages:r=!1,allowedProtocols:i=[],blockedImageClass:a=`inline-block bg-gray-200 dark:bg-gray-700 text-gray-600 dark:text-gray-400 px-3 py-1 rounded text-sm`,blockedLinkClass:o=`text-gray-500`,linkBlockPolicy:s=A.indicator,imageBlockPolicy:c=A.indicator}){let l=t.length&&!t.every(e=>e===`*`),d=n.length&&!n.every(e=>e===`*`);if(!e&&(l||d))throw Error(`defaultOrigin is required when allowedLinkPrefixes or allowedImagePrefixes are provided`);return l=>{let d=he(e,t,n,r,i,a,o,s,c);de(l),u(l,d)}}function j(e,t){if(typeof e!=`string`)return null;try{return new URL(e)}catch{if(t)try{return new URL(e,t)}catch{return null}if(e.startsWith(`/`)||e.startsWith(`./`)||e.startsWith(`../`))try{return new URL(e,`http://example.com`)}catch{return null}return null}}function ce(e){return typeof e==`string`?e.startsWith(`/`)||e.startsWith(`./`)||e.startsWith(`../`):!1}var le=new Set([`https:`,`http:`,`irc:`,`ircs:`,`mailto:`,`xmpp:`,`blob:`]),M=new Set([`javascript:`,`data:`,`file:`,`vbscript:`]);function ue(e,t,n,r=!1,i=!1,a=[]){if(!e)return null;if(typeof e==`string`&&e.startsWith(`#`)&&!i)try{if(new URL(e,`http://example.com`).hash===e)return e}catch{}if(typeof e==`string`&&e.startsWith(`data:`))return i&&r&&e.startsWith(`data:image/`)?e:null;if(typeof e==`string`&&e.startsWith(`blob:`)){try{if(new URL(e).protocol===`blob:`&&e.length>5){let t=e.substring(5);if(t&&t.length>0&&t!==`invalid`)return e}}catch{return null}return null}let o=j(e,n);if(!o||M.has(o.protocol)||!(le.has(o.protocol)||a.includes(o.protocol)||a.includes(`*`)))return null;if(o.protocol===`mailto:`||!o.protocol.match(/^https?:$/))return o.href;let s=ce(e);return o&&t.some(e=>{let t=j(e,n);return!t||t.origin!==o.origin?!1:o.href.startsWith(t.href)})?s?o.pathname+o.search+o.hash:o.href:t.includes(`*`)?o.protocol!==`https:`&&o.protocol!==`http:`?null:s?o.pathname+o.search+o.hash:o.href:null}function de(e){if(`children`in e&&Array.isArray(e.children)){e.children=e.children.filter(e=>e!=null);for(let t of e.children)de(t)}}var fe=Symbol(`node-seen`);function pe(e,t,n){return t===A.remove?{type:`remove`}:t===A.textOnly?{type:`replace`,element:{type:`element`,tagName:`span`,properties:{},children:[...e.children]}}:{type:`replace`,element:{type:`element`,tagName:`span`,properties:{title:`Blocked URL: `+String(e.properties.href),class:n},children:[...e.children,{type:`text`,value:` [blocked]`}]}}}function me(e,t,n){if(t===A.remove)return{type:`remove`};if(t===A.textOnly){let t=String(e.properties.alt||``);return t?{type:`replace`,element:{type:`element`,tagName:`span`,properties:{},children:[{type:`text`,value:t}]}}:{type:`remove`}}return{type:`replace`,element:{type:`element`,tagName:`span`,properties:{class:n},children:[{type:`text`,value:`[Image blocked: `+String(e.properties.alt||`No description`)+`]`}]}}}var he=(e,t,n,r,i,a,o,s,c)=>{let l=(d,f,p)=>{if(d.type!==`element`||d[fe])return!0;if(d.tagName===`a`){let n=ue(d.properties.href,t,e,!1,!1,i);if(n===null){if(d[fe]=!0,u(d,l),p&&typeof f==`number`){let e=pe(d,s,o);if(e.type===`remove`)return p.children.splice(f,1),[m,f];p.children[f]=e.element}return m}else return d.properties.href=n,d.properties.target=`_blank`,d.properties.rel=`noopener noreferrer`,!0}if(d.tagName===`img`){let t=ue(d.properties.src,n,e,r,!0,i);if(t===null){if(d[fe]=!0,u(d,l),p&&typeof f==`number`){let e=me(d,c,a);if(e.type===`remove`)return p.children.splice(f,1),[m,f];p.children[f]=e.element}return m}else return d.properties.src=t,!0}return!0};return l},ge={},_e={}.hasOwnProperty,ve=E(`type`,{handlers:{root:be,element:Te,text:Ce,comment:we,doctype:Se}});function ye(e,t){let n=(t||ge).space;return ve(e,n===`svg`?T:S)}function be(e,t){let n={nodeName:`#document`,mode:(e.data||{}).quirksMode?`quirks`:`no-quirks`,childNodes:[]};return n.childNodes=De(e.children,n,t),Oe(e,n),n}function xe(e,t){let n={nodeName:`#document-fragment`,childNodes:[]};return n.childNodes=De(e.children,n,t),Oe(e,n),n}function Se(e){let t={nodeName:`#documentType`,name:`html`,publicId:``,systemId:``,parentNode:null};return Oe(e,t),t}function Ce(e){let t={nodeName:`#text`,value:e.value,parentNode:null};return Oe(e,t),t}function we(e){let t={nodeName:`#comment`,data:e.value,parentNode:null};return Oe(e,t),t}function Te(e,t){let n=t,r=n;e.type===`element`&&e.tagName.toLowerCase()===`svg`&&n.space===`html`&&(r=T);let i=[],a;if(e.properties){for(a in e.properties)if(a!==`children`&&_e.call(e.properties,a)){let t=Ee(r,a,e.properties[a]);t&&i.push(t)}}let o=r.space,s={nodeName:e.tagName,tagName:e.tagName,attrs:i,namespaceURI:y[o],childNodes:[],parentNode:null};return s.childNodes=De(e.children,s,r),Oe(e,s),e.tagName===`template`&&e.content&&(s.content=xe(e.content,r)),s}function Ee(e,t,n){let r=te(e,t);if(n===!1||n==null||typeof n==`number`&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?w(n):ee(n));let i={name:r.attribute,value:n===!0?``:String(n)};if(r.space&&r.space!==`html`&&r.space!==`svg`){let e=i.name.indexOf(`:`);e<0?i.prefix=``:(i.name=i.name.slice(e+1),i.prefix=r.attribute.slice(0,e)),i.namespace=y[r.space]}return i}function De(e,t,n){let r=-1,i=[];if(e)for(;++r<e.length;){let a=ve(e[r],n);a.parentNode=t,i.push(a)}return i}function Oe(e,t){let n=e.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,t.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})}var ke=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,Ae=new Set([`mdxFlowExpression`,`mdxJsxFlowElement`,`mdxJsxTextElement`,`mdxTextExpression`,`mdxjsEsm`]),je={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function Me(e,t){let n=Ke(e),r=E(`type`,{handlers:{root:Pe,element:Fe,text:Ie,comment:ze,doctype:Le,raw:Be},unknown:Ve}),i={parser:n?new v(je):v.getFragmentParser(void 0,je),handle(e){r(e,i)},stitches:!1,options:t||{}};r(e,i),He(i,D());let a=g(n?i.parser.document:i.parser.getFragment(),{file:i.options.file});return i.stitches&&u(a,`comment`,function(e,t,n){let r=e;if(r.value.stitch&&n&&t!==void 0){let e=n.children;return e[t]=r.value.stitch,t}}),a.type===`root`&&a.children.length===1&&a.children[0].type===e.type?a.children[0]:a}function Ne(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function Pe(e,t){Ne(e.children,t)}function Fe(e,t){We(e,t),Ne(e.children,t),Ge(e,t)}function Ie(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);let n={type:x.CHARACTER,chars:e.value,location:qe(e)};He(t,D(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function Le(e,t){let n={type:x.DOCTYPE,name:`html`,forceQuirks:!1,publicId:``,systemId:``,location:qe(e)};He(t,D(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function Re(e,t){t.stitches=!0;let n=Je(e);`children`in e&&`children`in n&&(n.children=Me({type:`root`,children:e.children},t.options).children),ze({type:`comment`,value:{stitch:n}},t)}function ze(e,t){let n=e.value,r={type:x.COMMENT,data:n,location:qe(e)};He(t,D(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function Be(e,t){if(t.parser.tokenizer.preprocessor.html=``,t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,Ue(t,D(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(ke,`<$1$2`):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;let e=t.parser.tokenizer._consume();t.parser.tokenizer._callState(e)}}function Ve(e,t){let n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))Re(n,t);else{let e=``;throw Ae.has(n.type)&&(e=". 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"),Error("Cannot compile `"+n.type+"` node"+e)}}function He(e,t){Ue(e,t);let n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=h.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:``,value:``}}function Ue(e,t){if(t&&t.offset!==void 0){let n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function We(e,t){let n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===h.PLAINTEXT)return;He(t,D(e));let r=t.parser.openElements.current,i=`namespaceURI`in r?r.namespaceURI:y.html;i===y.html&&n===`svg`&&(i=y.svg);let a=ye({...e,children:[]},{space:i===y.svg?`svg`:`html`}),o={type:x.START_TAG,tagName:n,tagID:b(n),selfClosing:!1,ackSelfClosing:!1,attrs:`attrs`in a?a.attrs:[],location:qe(e)};t.parser.currentToken=o,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function Ge(e,t){let n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&ae.includes(n)||t.parser.tokenizer.state===h.PLAINTEXT)return;He(t,re(e));let r={type:x.END_TAG,tagName:n,tagID:b(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:qe(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===h.RCDATA||t.parser.tokenizer.state===h.RAWTEXT||t.parser.tokenizer.state===h.SCRIPT_DATA)&&(t.parser.tokenizer.state=h.DATA)}function Ke(e){let t=e.type===`root`?e.children[0]:e;return!!(t&&(t.type===`doctype`||t.type===`element`&&t.tagName.toLowerCase()===`html`))}function qe(e){let t=D(e)||{line:void 0,column:void 0,offset:void 0},n=re(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function Je(e){return`children`in e?O({...e,children:[]}):O(e)}function Ye(e){return function(t,n){return Me(t,{...e,file:n})}}var N=[`ariaDescribedBy`,`ariaLabel`,`ariaLabelledBy`],P={ancestors:{tbody:[`table`],td:[`table`],th:[`table`],thead:[`table`],tfoot:[`table`],tr:[`table`]},attributes:{a:[...N,`dataFootnoteBackref`,`dataFootnoteRef`,[`className`,`data-footnote-backref`],`href`],blockquote:[`cite`],code:[[`className`,/^language-./]],del:[`cite`],div:[`itemScope`,`itemType`],dl:[...N],h2:[[`className`,`sr-only`]],img:[...N,`longDesc`,`src`],input:[[`disabled`,!0],[`type`,`checkbox`]],ins:[`cite`],li:[[`className`,`task-list-item`]],ol:[...N,[`className`,`contains-task-list`]],q:[`cite`],section:[`dataFootnotes`,[`className`,`footnotes`]],source:[`srcSet`],summary:[...N],table:[...N],ul:[...N,[`className`,`contains-task-list`]],"*":`abbr.accept.acceptCharset.accessKey.action.align.alt.axis.border.cellPadding.cellSpacing.char.charOff.charSet.checked.clear.colSpan.color.cols.compact.coords.dateTime.dir.encType.frame.hSpace.headers.height.hrefLang.htmlFor.id.isMap.itemProp.label.lang.maxLength.media.method.multiple.name.noHref.noShade.noWrap.open.prompt.readOnly.rev.rowSpan.rows.rules.scope.selected.shape.size.span.start.summary.tabIndex.title.useMap.vAlign.value.width`.split(`.`)},clobber:[`ariaDescribedBy`,`ariaLabelledBy`,`id`,`name`],clobberPrefix:`user-content-`,protocols:{cite:[`http`,`https`],href:[`http`,`https`,`irc`,`ircs`,`mailto`,`xmpp`],longDesc:[`http`,`https`],src:[`http`,`https`]},required:{input:{disabled:!0,type:`checkbox`}},strip:[`script`],tagNames:`a.b.blockquote.br.code.dd.del.details.div.dl.dt.em.h1.h2.h3.h4.h5.h6.hr.i.img.input.ins.kbd.li.ol.p.picture.pre.q.rp.rt.ruby.s.samp.section.source.span.strike.strong.sub.summary.sup.table.tbody.td.tfoot.th.thead.tr.tt.ul.var`.split(`.`)},F={}.hasOwnProperty;function Xe(e,t){let n={type:`root`,children:[]},r=Ze({schema:t?{...P,...t}:P,stack:[]},e);return r&&(Array.isArray(r)?r.length===1?n=r[0]:n.children=r:n=r),n}function Ze(e,t){if(t&&typeof t==`object`){let n=t;switch(typeof n.type==`string`?n.type:``){case`comment`:return Qe(e,n);case`doctype`:return $e(e,n);case`element`:return et(e,n);case`root`:return tt(e,n);case`text`:return nt(e,n);default:}}}function Qe(e,t){if(e.schema.allowComments){let e=typeof t.value==`string`?t.value:``,n=e.indexOf(`-->`),r={type:`comment`,value:n<0?e:e.slice(0,n)};return lt(r,t),r}}function $e(e,t){if(e.schema.allowDoctypes){let e={type:`doctype`};return lt(e,t),e}}function et(e,t){let n=typeof t.tagName==`string`?t.tagName:``;e.stack.push(n);let r=rt(e,t.children),i=it(e,t.properties);e.stack.pop();let a=!1;if(n&&n!==`*`&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(a=!0,e.schema.ancestors&&F.call(e.schema.ancestors,n))){let t=e.schema.ancestors[n],r=-1;for(a=!1;++r<t.length;)e.stack.includes(t[r])&&(a=!0)}if(!a)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;let o={type:`element`,tagName:n,properties:i,children:r};return lt(o,t),o}function tt(e,t){let n={type:`root`,children:rt(e,t.children)};return lt(n,t),n}function nt(e,t){let n={type:`text`,value:typeof t.value==`string`?t.value:``};return lt(n,t),n}function rt(e,t){let n=[];if(Array.isArray(t)){let r=t,i=-1;for(;++i<r.length;){let t=Ze(e,r[i]);t&&(Array.isArray(t)?n.push(...t):n.push(t))}}return n}function it(e,t){let n=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,a=r&&F.call(r,n)?r[n]:void 0,o=r&&F.call(r,`*`)?r[`*`]:void 0,s=t&&typeof t==`object`?t:{},c={},l;for(l in s)if(F.call(s,l)){let t=s[l],n=at(e,ut(a,l),l,t);n??=at(e,ut(o,l),l,t),n!=null&&(c[l]=n)}if(i&&F.call(i,n)){let e=i[n];for(l in e)F.call(e,l)&&!F.call(c,l)&&(c[l]=e[l])}return c}function at(e,t,n,r){return t?Array.isArray(r)?ot(e,t,n,r):st(e,t,n,r):void 0}function ot(e,t,n,r){let i=-1,a=[];for(;++i<r.length;){let o=st(e,t,n,r[i]);(typeof o==`number`||typeof o==`string`)&&a.push(o)}return a}function st(e,t,n,r){if(!(typeof r!=`boolean`&&typeof r!=`number`&&typeof r!=`string`)&&ct(e,n,r)){if(typeof t==`object`&&t.length>1){let e=!1,n=0;for(;++n<t.length;){let i=t[n];if(i&&typeof i==`object`&&`flags`in i){if(i.test(String(r))){e=!0;break}}else if(i===r){e=!0;break}}if(!e)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function ct(e,t,n){let r=e.schema.protocols&&F.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;let i=String(n),a=i.indexOf(`:`),o=i.indexOf(`?`),s=i.indexOf(`#`),c=i.indexOf(`/`);if(a<0||c>-1&&a>c||o>-1&&a>o||s>-1&&a>s)return!0;let l=-1;for(;++l<r.length;){let e=r[l];if(a===e.length&&i.slice(0,e.length)===e)return!0}return!1}function lt(e,t){let n=ne(t);t.data&&(e.data=O(t.data)),n&&(e.position=n)}function ut(e,t){let n,r=-1;if(e)for(;++r<e.length;){let i=e[r],a=typeof i==`string`?i:i[0];if(a===t)return i;a===`data*`&&(n=i)}if(t.length>4&&t.slice(0,4).toLowerCase()===`data`)return n}function dt(e){return function(t){return Xe(t,e)}}var ft=Object.defineProperty,pt=Object.defineProperties,mt=Object.getOwnPropertyDescriptors,ht=Object.getOwnPropertySymbols,gt=Object.prototype.hasOwnProperty,_t=Object.prototype.propertyIsEnumerable,vt=(e,t,n)=>t in e?ft(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yt=(e,t)=>{for(var n in t||={})gt.call(t,n)&&vt(e,n,t[n]);if(ht)for(var n of ht(t))_t.call(t,n)&&vt(e,n,t[n]);return e},bt=(e,t)=>pt(e,mt(t)),I=(e,t)=>{let n=!1,r=!1;for(let i=0;i<t;i+=1){if(e[i]===`\\`&&i+1<e.length&&e[i+1]==="`"){i+=1;continue}if(e.substring(i,i+3)==="```"){r=!r,i+=2;continue}!r&&e[i]==="`"&&(n=!n)}return n||r},xt=(e,t)=>{let n=e.substring(t,t+3)==="```",r=t>0&&e.substring(t-1,t+2)==="```",i=t>1&&e.substring(t-2,t+1)==="```";return n||r||i},St=e=>{let t=0;for(let n=0;n<e.length;n+=1){if(e[n]===`\\`&&n+1<e.length&&e[n+1]==="`"){n+=1;continue}e[n]==="`"&&!xt(e,n)&&(t+=1)}return t},L=(e,t)=>{let n=!1,r=!1,i=-1;for(let a=0;a<e.length;a+=1){if(e[a]===`\\`&&a+1<e.length&&e[a+1]==="`"){a+=1;continue}if(e.substring(a,a+3)==="```"){r=!r,a+=2;continue}if(!r&&e[a]==="`")if(n){if(i<t&&t<a)return!0;n=!1,i=-1}else n=!0,i=a}return!1},Ct=/^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm,wt=e=>!e||typeof e!=`string`||!e.includes(`>`)?e:e.replace(Ct,(t,n,r,i)=>I(e,i)?t:`${n}\\>${r}`),Tt=/(\*\*)([^*]*\*?)$/,Et=/(__)([^_]*?)$/,Dt=/(\*\*\*)([^*]*?)$/,Ot=/(\*)([^*]*?)$/,kt=/(_)([^_]*?)$/,At=/(`)([^`]*?)$/,jt=/(~~)([^~]*?)$/,Mt=/^[\s_~*`]*$/,Nt=/^[\s]*[-*+][\s]+$/,Pt=/[\p{L}\p{N}_]/u,Ft=/^```[^`\n]*```?$/,It=/^\*{4,}$/,Lt=/(__)([^_]+)_$/,Rt=/(~~)([^~]+)~$/,zt=/~~/g,R=e=>{if(!e)return!1;let t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||t===95?!0:Pt.test(e)},Bt=(e,t)=>{let n=1;for(let r=t-1;r>=0;--r)if(e[r]===`]`)n+=1;else if(e[r]===`[`&&(--n,n===0))return r;return-1},Vt=(e,t)=>{let n=1;for(let r=t+1;r<e.length;r+=1)if(e[r]===`[`)n+=1;else if(e[r]===`]`&&(--n,n===0))return r;return-1},Ht=(e,t)=>{let n=!1,r=!1;for(let i=0;i<e.length&&i<t;i+=1){if(e[i]===`\\`&&e[i+1]===`$`){i+=1;continue}e[i]===`$`&&(e[i+1]===`$`?(r=!r,i+=1,n=!1):r||(n=!n))}return n||r},Ut=(e,t)=>{for(let n=t;n<e.length;n+=1){if(e[n]===`)`)return!0;if(e[n]===`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./highlighted-body-OFNGDK62-BQg91IZ5.js","./chunk-CYidjpOJ.js","./jsx-runtime-BUgB2tll.js","./react-f2sANaYj.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{o as e,t}from"./chunk-CYidjpOJ.js";import{t as n}from"./preload-helper-Chd9yIcd.js";import{t as r}from"./jsx-runtime-BUgB2tll.js";import{t as i}from"./react-f2sANaYj.js";import{t as a}from"./react-dom-DPxgxlDT.js";import{n as o,t as s}from"./bundle-mjs-SHeFpKGC.js";import{B as c,N as l,R as u,a as d,c as f,t as p,z as m}from"./lib-Bq-Hw4OM.js";import{a as h,c as g,d as _,i as v,l as y,o as b,s as x}from"./trim-lines-34TPYcWX.js";import{a as S,c as C,i as w,n as ee,o as T,s as te,u as E}from"./space-separated-tokens-Db5y9Cue.js";import{a as ne,i as D,n as O,r as re,t as ie}from"./lib-dxiLvrQN.js";import{n as ae,t as oe}from"./lib-C_jEl4A5.js";var k=e(i(),1),A={indicator:`indicator`,textOnly:`text-only`,remove:`remove`};function se({defaultOrigin:e=``,allowedLinkPrefixes:t=[],allowedImagePrefixes:n=[],allowDataImages:r=!1,allowedProtocols:i=[],blockedImageClass:a=`inline-block bg-gray-200 dark:bg-gray-700 text-gray-600 dark:text-gray-400 px-3 py-1 rounded text-sm`,blockedLinkClass:o=`text-gray-500`,linkBlockPolicy:s=A.indicator,imageBlockPolicy:c=A.indicator}){let l=t.length&&!t.every(e=>e===`*`),d=n.length&&!n.every(e=>e===`*`);if(!e&&(l||d))throw Error(`defaultOrigin is required when allowedLinkPrefixes or allowedImagePrefixes are provided`);return l=>{let d=he(e,t,n,r,i,a,o,s,c);de(l),u(l,d)}}function j(e,t){if(typeof e!=`string`)return null;try{return new URL(e)}catch{if(t)try{return new URL(e,t)}catch{return null}if(e.startsWith(`/`)||e.startsWith(`./`)||e.startsWith(`../`))try{return new URL(e,`http://example.com`)}catch{return null}return null}}function ce(e){return typeof e==`string`?e.startsWith(`/`)||e.startsWith(`./`)||e.startsWith(`../`):!1}var le=new Set([`https:`,`http:`,`irc:`,`ircs:`,`mailto:`,`xmpp:`,`blob:`]),M=new Set([`javascript:`,`data:`,`file:`,`vbscript:`]);function ue(e,t,n,r=!1,i=!1,a=[]){if(!e)return null;if(typeof e==`string`&&e.startsWith(`#`)&&!i)try{if(new URL(e,`http://example.com`).hash===e)return e}catch{}if(typeof e==`string`&&e.startsWith(`data:`))return i&&r&&e.startsWith(`data:image/`)?e:null;if(typeof e==`string`&&e.startsWith(`blob:`)){try{if(new URL(e).protocol===`blob:`&&e.length>5){let t=e.substring(5);if(t&&t.length>0&&t!==`invalid`)return e}}catch{return null}return null}let o=j(e,n);if(!o||M.has(o.protocol)||!(le.has(o.protocol)||a.includes(o.protocol)||a.includes(`*`)))return null;if(o.protocol===`mailto:`||!o.protocol.match(/^https?:$/))return o.href;let s=ce(e);return o&&t.some(e=>{let t=j(e,n);return!t||t.origin!==o.origin?!1:o.href.startsWith(t.href)})?s?o.pathname+o.search+o.hash:o.href:t.includes(`*`)?o.protocol!==`https:`&&o.protocol!==`http:`?null:s?o.pathname+o.search+o.hash:o.href:null}function de(e){if(`children`in e&&Array.isArray(e.children)){e.children=e.children.filter(e=>e!=null);for(let t of e.children)de(t)}}var fe=Symbol(`node-seen`);function pe(e,t,n){return t===A.remove?{type:`remove`}:t===A.textOnly?{type:`replace`,element:{type:`element`,tagName:`span`,properties:{},children:[...e.children]}}:{type:`replace`,element:{type:`element`,tagName:`span`,properties:{title:`Blocked URL: `+String(e.properties.href),class:n},children:[...e.children,{type:`text`,value:` [blocked]`}]}}}function me(e,t,n){if(t===A.remove)return{type:`remove`};if(t===A.textOnly){let t=String(e.properties.alt||``);return t?{type:`replace`,element:{type:`element`,tagName:`span`,properties:{},children:[{type:`text`,value:t}]}}:{type:`remove`}}return{type:`replace`,element:{type:`element`,tagName:`span`,properties:{class:n},children:[{type:`text`,value:`[Image blocked: `+String(e.properties.alt||`No description`)+`]`}]}}}var he=(e,t,n,r,i,a,o,s,c)=>{let l=(d,f,p)=>{if(d.type!==`element`||d[fe])return!0;if(d.tagName===`a`){let n=ue(d.properties.href,t,e,!1,!1,i);if(n===null){if(d[fe]=!0,u(d,l),p&&typeof f==`number`){let e=pe(d,s,o);if(e.type===`remove`)return p.children.splice(f,1),[m,f];p.children[f]=e.element}return m}else return d.properties.href=n,d.properties.target=`_blank`,d.properties.rel=`noopener noreferrer`,!0}if(d.tagName===`img`){let t=ue(d.properties.src,n,e,r,!0,i);if(t===null){if(d[fe]=!0,u(d,l),p&&typeof f==`number`){let e=me(d,c,a);if(e.type===`remove`)return p.children.splice(f,1),[m,f];p.children[f]=e.element}return m}else return d.properties.src=t,!0}return!0};return l},ge={},_e={}.hasOwnProperty,ve=E(`type`,{handlers:{root:be,element:Te,text:Ce,comment:we,doctype:Se}});function ye(e,t){let n=(t||ge).space;return ve(e,n===`svg`?T:S)}function be(e,t){let n={nodeName:`#document`,mode:(e.data||{}).quirksMode?`quirks`:`no-quirks`,childNodes:[]};return n.childNodes=De(e.children,n,t),Oe(e,n),n}function xe(e,t){let n={nodeName:`#document-fragment`,childNodes:[]};return n.childNodes=De(e.children,n,t),Oe(e,n),n}function Se(e){let t={nodeName:`#documentType`,name:`html`,publicId:``,systemId:``,parentNode:null};return Oe(e,t),t}function Ce(e){let t={nodeName:`#text`,value:e.value,parentNode:null};return Oe(e,t),t}function we(e){let t={nodeName:`#comment`,data:e.value,parentNode:null};return Oe(e,t),t}function Te(e,t){let n=t,r=n;e.type===`element`&&e.tagName.toLowerCase()===`svg`&&n.space===`html`&&(r=T);let i=[],a;if(e.properties){for(a in e.properties)if(a!==`children`&&_e.call(e.properties,a)){let t=Ee(r,a,e.properties[a]);t&&i.push(t)}}let o=r.space,s={nodeName:e.tagName,tagName:e.tagName,attrs:i,namespaceURI:y[o],childNodes:[],parentNode:null};return s.childNodes=De(e.children,s,r),Oe(e,s),e.tagName===`template`&&e.content&&(s.content=xe(e.content,r)),s}function Ee(e,t,n){let r=te(e,t);if(n===!1||n==null||typeof n==`number`&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?w(n):ee(n));let i={name:r.attribute,value:n===!0?``:String(n)};if(r.space&&r.space!==`html`&&r.space!==`svg`){let e=i.name.indexOf(`:`);e<0?i.prefix=``:(i.name=i.name.slice(e+1),i.prefix=r.attribute.slice(0,e)),i.namespace=y[r.space]}return i}function De(e,t,n){let r=-1,i=[];if(e)for(;++r<e.length;){let a=ve(e[r],n);a.parentNode=t,i.push(a)}return i}function Oe(e,t){let n=e.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,t.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})}var ke=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,Ae=new Set([`mdxFlowExpression`,`mdxJsxFlowElement`,`mdxJsxTextElement`,`mdxTextExpression`,`mdxjsEsm`]),je={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function Me(e,t){let n=Ke(e),r=E(`type`,{handlers:{root:Pe,element:Fe,text:Ie,comment:ze,doctype:Le,raw:Be},unknown:Ve}),i={parser:n?new v(je):v.getFragmentParser(void 0,je),handle(e){r(e,i)},stitches:!1,options:t||{}};r(e,i),He(i,D());let a=g(n?i.parser.document:i.parser.getFragment(),{file:i.options.file});return i.stitches&&u(a,`comment`,function(e,t,n){let r=e;if(r.value.stitch&&n&&t!==void 0){let e=n.children;return e[t]=r.value.stitch,t}}),a.type===`root`&&a.children.length===1&&a.children[0].type===e.type?a.children[0]:a}function Ne(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function Pe(e,t){Ne(e.children,t)}function Fe(e,t){We(e,t),Ne(e.children,t),Ge(e,t)}function Ie(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);let n={type:x.CHARACTER,chars:e.value,location:qe(e)};He(t,D(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function Le(e,t){let n={type:x.DOCTYPE,name:`html`,forceQuirks:!1,publicId:``,systemId:``,location:qe(e)};He(t,D(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function Re(e,t){t.stitches=!0;let n=Je(e);`children`in e&&`children`in n&&(n.children=Me({type:`root`,children:e.children},t.options).children),ze({type:`comment`,value:{stitch:n}},t)}function ze(e,t){let n=e.value,r={type:x.COMMENT,data:n,location:qe(e)};He(t,D(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function Be(e,t){if(t.parser.tokenizer.preprocessor.html=``,t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,Ue(t,D(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(ke,`<$1$2`):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;let e=t.parser.tokenizer._consume();t.parser.tokenizer._callState(e)}}function Ve(e,t){let n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))Re(n,t);else{let e=``;throw Ae.has(n.type)&&(e=". 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"),Error("Cannot compile `"+n.type+"` node"+e)}}function He(e,t){Ue(e,t);let n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=h.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:``,value:``}}function Ue(e,t){if(t&&t.offset!==void 0){let n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function We(e,t){let n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===h.PLAINTEXT)return;He(t,D(e));let r=t.parser.openElements.current,i=`namespaceURI`in r?r.namespaceURI:y.html;i===y.html&&n===`svg`&&(i=y.svg);let a=ye({...e,children:[]},{space:i===y.svg?`svg`:`html`}),o={type:x.START_TAG,tagName:n,tagID:b(n),selfClosing:!1,ackSelfClosing:!1,attrs:`attrs`in a?a.attrs:[],location:qe(e)};t.parser.currentToken=o,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function Ge(e,t){let n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&ae.includes(n)||t.parser.tokenizer.state===h.PLAINTEXT)return;He(t,re(e));let r={type:x.END_TAG,tagName:n,tagID:b(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:qe(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===h.RCDATA||t.parser.tokenizer.state===h.RAWTEXT||t.parser.tokenizer.state===h.SCRIPT_DATA)&&(t.parser.tokenizer.state=h.DATA)}function Ke(e){let t=e.type===`root`?e.children[0]:e;return!!(t&&(t.type===`doctype`||t.type===`element`&&t.tagName.toLowerCase()===`html`))}function qe(e){let t=D(e)||{line:void 0,column:void 0,offset:void 0},n=re(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function Je(e){return`children`in e?O({...e,children:[]}):O(e)}function Ye(e){return function(t,n){return Me(t,{...e,file:n})}}var N=[`ariaDescribedBy`,`ariaLabel`,`ariaLabelledBy`],P={ancestors:{tbody:[`table`],td:[`table`],th:[`table`],thead:[`table`],tfoot:[`table`],tr:[`table`]},attributes:{a:[...N,`dataFootnoteBackref`,`dataFootnoteRef`,[`className`,`data-footnote-backref`],`href`],blockquote:[`cite`],code:[[`className`,/^language-./]],del:[`cite`],div:[`itemScope`,`itemType`],dl:[...N],h2:[[`className`,`sr-only`]],img:[...N,`longDesc`,`src`],input:[[`disabled`,!0],[`type`,`checkbox`]],ins:[`cite`],li:[[`className`,`task-list-item`]],ol:[...N,[`className`,`contains-task-list`]],q:[`cite`],section:[`dataFootnotes`,[`className`,`footnotes`]],source:[`srcSet`],summary:[...N],table:[...N],ul:[...N,[`className`,`contains-task-list`]],"*":`abbr.accept.acceptCharset.accessKey.action.align.alt.axis.border.cellPadding.cellSpacing.char.charOff.charSet.checked.clear.colSpan.color.cols.compact.coords.dateTime.dir.encType.frame.hSpace.headers.height.hrefLang.htmlFor.id.isMap.itemProp.label.lang.maxLength.media.method.multiple.name.noHref.noShade.noWrap.open.prompt.readOnly.rev.rowSpan.rows.rules.scope.selected.shape.size.span.start.summary.tabIndex.title.useMap.vAlign.value.width`.split(`.`)},clobber:[`ariaDescribedBy`,`ariaLabelledBy`,`id`,`name`],clobberPrefix:`user-content-`,protocols:{cite:[`http`,`https`],href:[`http`,`https`,`irc`,`ircs`,`mailto`,`xmpp`],longDesc:[`http`,`https`],src:[`http`,`https`]},required:{input:{disabled:!0,type:`checkbox`}},strip:[`script`],tagNames:`a.b.blockquote.br.code.dd.del.details.div.dl.dt.em.h1.h2.h3.h4.h5.h6.hr.i.img.input.ins.kbd.li.ol.p.picture.pre.q.rp.rt.ruby.s.samp.section.source.span.strike.strong.sub.summary.sup.table.tbody.td.tfoot.th.thead.tr.tt.ul.var`.split(`.`)},F={}.hasOwnProperty;function Xe(e,t){let n={type:`root`,children:[]},r=Ze({schema:t?{...P,...t}:P,stack:[]},e);return r&&(Array.isArray(r)?r.length===1?n=r[0]:n.children=r:n=r),n}function Ze(e,t){if(t&&typeof t==`object`){let n=t;switch(typeof n.type==`string`?n.type:``){case`comment`:return Qe(e,n);case`doctype`:return $e(e,n);case`element`:return et(e,n);case`root`:return tt(e,n);case`text`:return nt(e,n);default:}}}function Qe(e,t){if(e.schema.allowComments){let e=typeof t.value==`string`?t.value:``,n=e.indexOf(`-->`),r={type:`comment`,value:n<0?e:e.slice(0,n)};return lt(r,t),r}}function $e(e,t){if(e.schema.allowDoctypes){let e={type:`doctype`};return lt(e,t),e}}function et(e,t){let n=typeof t.tagName==`string`?t.tagName:``;e.stack.push(n);let r=rt(e,t.children),i=it(e,t.properties);e.stack.pop();let a=!1;if(n&&n!==`*`&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(a=!0,e.schema.ancestors&&F.call(e.schema.ancestors,n))){let t=e.schema.ancestors[n],r=-1;for(a=!1;++r<t.length;)e.stack.includes(t[r])&&(a=!0)}if(!a)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;let o={type:`element`,tagName:n,properties:i,children:r};return lt(o,t),o}function tt(e,t){let n={type:`root`,children:rt(e,t.children)};return lt(n,t),n}function nt(e,t){let n={type:`text`,value:typeof t.value==`string`?t.value:``};return lt(n,t),n}function rt(e,t){let n=[];if(Array.isArray(t)){let r=t,i=-1;for(;++i<r.length;){let t=Ze(e,r[i]);t&&(Array.isArray(t)?n.push(...t):n.push(t))}}return n}function it(e,t){let n=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,a=r&&F.call(r,n)?r[n]:void 0,o=r&&F.call(r,`*`)?r[`*`]:void 0,s=t&&typeof t==`object`?t:{},c={},l;for(l in s)if(F.call(s,l)){let t=s[l],n=at(e,ut(a,l),l,t);n??=at(e,ut(o,l),l,t),n!=null&&(c[l]=n)}if(i&&F.call(i,n)){let e=i[n];for(l in e)F.call(e,l)&&!F.call(c,l)&&(c[l]=e[l])}return c}function at(e,t,n,r){return t?Array.isArray(r)?ot(e,t,n,r):st(e,t,n,r):void 0}function ot(e,t,n,r){let i=-1,a=[];for(;++i<r.length;){let o=st(e,t,n,r[i]);(typeof o==`number`||typeof o==`string`)&&a.push(o)}return a}function st(e,t,n,r){if(!(typeof r!=`boolean`&&typeof r!=`number`&&typeof r!=`string`)&&ct(e,n,r)){if(typeof t==`object`&&t.length>1){let e=!1,n=0;for(;++n<t.length;){let i=t[n];if(i&&typeof i==`object`&&`flags`in i){if(i.test(String(r))){e=!0;break}}else if(i===r){e=!0;break}}if(!e)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function ct(e,t,n){let r=e.schema.protocols&&F.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;let i=String(n),a=i.indexOf(`:`),o=i.indexOf(`?`),s=i.indexOf(`#`),c=i.indexOf(`/`);if(a<0||c>-1&&a>c||o>-1&&a>o||s>-1&&a>s)return!0;let l=-1;for(;++l<r.length;){let e=r[l];if(a===e.length&&i.slice(0,e.length)===e)return!0}return!1}function lt(e,t){let n=ne(t);t.data&&(e.data=O(t.data)),n&&(e.position=n)}function ut(e,t){let n,r=-1;if(e)for(;++r<e.length;){let i=e[r],a=typeof i==`string`?i:i[0];if(a===t)return i;a===`data*`&&(n=i)}if(t.length>4&&t.slice(0,4).toLowerCase()===`data`)return n}function dt(e){return function(t){return Xe(t,e)}}var ft=Object.defineProperty,pt=Object.defineProperties,mt=Object.getOwnPropertyDescriptors,ht=Object.getOwnPropertySymbols,gt=Object.prototype.hasOwnProperty,_t=Object.prototype.propertyIsEnumerable,vt=(e,t,n)=>t in e?ft(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yt=(e,t)=>{for(var n in t||={})gt.call(t,n)&&vt(e,n,t[n]);if(ht)for(var n of ht(t))_t.call(t,n)&&vt(e,n,t[n]);return e},bt=(e,t)=>pt(e,mt(t)),I=(e,t)=>{let n=!1,r=!1;for(let i=0;i<t;i+=1){if(e[i]===`\\`&&i+1<e.length&&e[i+1]==="`"){i+=1;continue}if(e.substring(i,i+3)==="```"){r=!r,i+=2;continue}!r&&e[i]==="`"&&(n=!n)}return n||r},xt=(e,t)=>{let n=e.substring(t,t+3)==="```",r=t>0&&e.substring(t-1,t+2)==="```",i=t>1&&e.substring(t-2,t+1)==="```";return n||r||i},St=e=>{let t=0;for(let n=0;n<e.length;n+=1){if(e[n]===`\\`&&n+1<e.length&&e[n+1]==="`"){n+=1;continue}e[n]==="`"&&!xt(e,n)&&(t+=1)}return t},L=(e,t)=>{let n=!1,r=!1,i=-1;for(let a=0;a<e.length;a+=1){if(e[a]===`\\`&&a+1<e.length&&e[a+1]==="`"){a+=1;continue}if(e.substring(a,a+3)==="```"){r=!r,a+=2;continue}if(!r&&e[a]==="`")if(n){if(i<t&&t<a)return!0;n=!1,i=-1}else n=!0,i=a}return!1},Ct=/^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm,wt=e=>!e||typeof e!=`string`||!e.includes(`>`)?e:e.replace(Ct,(t,n,r,i)=>I(e,i)?t:`${n}\\>${r}`),Tt=/(\*\*)([^*]*\*?)$/,Et=/(__)([^_]*?)$/,Dt=/(\*\*\*)([^*]*?)$/,Ot=/(\*)([^*]*?)$/,kt=/(_)([^_]*?)$/,At=/(`)([^`]*?)$/,jt=/(~~)([^~]*?)$/,Mt=/^[\s_~*`]*$/,Nt=/^[\s]*[-*+][\s]+$/,Pt=/[\p{L}\p{N}_]/u,Ft=/^```[^`\n]*```?$/,It=/^\*{4,}$/,Lt=/(__)([^_]+)_$/,Rt=/(~~)([^~]+)~$/,zt=/~~/g,R=e=>{if(!e)return!1;let t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||t===95?!0:Pt.test(e)},Bt=(e,t)=>{let n=1;for(let r=t-1;r>=0;--r)if(e[r]===`]`)n+=1;else if(e[r]===`[`&&(--n,n===0))return r;return-1},Vt=(e,t)=>{let n=1;for(let r=t+1;r<e.length;r+=1)if(e[r]===`[`)n+=1;else if(e[r]===`]`&&(--n,n===0))return r;return-1},Ht=(e,t)=>{let n=!1,r=!1;for(let i=0;i<e.length&&i<t;i+=1){if(e[i]===`\\`&&e[i+1]===`$`){i+=1;continue}e[i]===`$`&&(e[i+1]===`$`?(r=!r,i+=1,n=!1):r||(n=!n))}return n||r},Ut=(e,t)=>{for(let n=t;n<e.length;n+=1){if(e[n]===`)`)return!0;if(e[n]===`
|
|
3
3
|
`)return!1}return!1},Wt=(e,t)=>{for(let n=t-1;n>=0;--n){if(e[n]===`)`)return!1;if(e[n]===`(`)return n>0&&e[n-1]===`]`?Ut(e,t):!1;if(e[n]===`
|
|
4
4
|
`)return!1}return!1},Gt=(e,t)=>{for(let n=t-1;n>=0;--n){if(e[n]===`>`)return!1;if(e[n]===`<`){let t=n+1<e.length?e[n+1]:``;return t>=`a`&&t<=`z`||t>=`A`&&t<=`Z`||t===`/`}if(e[n]===`
|
|
5
5
|
`)return!1}return!1},Kt=(e,t,n)=>{let r=0;for(let n=t-1;n>=0;--n)if(e[n]===`
|
|
@@ -81,14 +81,14 @@ ${e}</tr>
|
|
|
81
81
|
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${G(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=Mi(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+G(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=Mi(e);if(i===null)return G(n);e=i;let a=`<img src="${e}" alt="${G(n)}"`;return t&&(a+=` title="${G(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:G(e.text)}},Vi=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},q=class e{options;renderer;textRenderer;constructor(e){this.options=e||V,this.options.renderer=this.options.renderer||new Bi,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Vi}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},Hi=class{options;block;constructor(e){this.options=e||V}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?K.lex:K.lexInline}provideParser(e=this.block){return e?q.parse:q.parseInline}},Ui=new class{defaults=Sr();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=q;Renderer=Bi;TextRenderer=Vi;Lexer=K;Tokenizer=zi;Hooks=Hi;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new Bi(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new zi(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new Hi;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];Hi.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async&&Hi.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:t[r]=(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return K.lex(e,t??this.defaults)}parser(e,t){return q.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(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 t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?K.lex:K.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?q.parse:q.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?K.lex:K.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?q.parse:q.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
|
|
82
82
|
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+G(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function J(e,t){return Ui.parse(e,t)}J.options=J.setOptions=function(e){return Ui.setOptions(e),J.defaults=Ui.defaults,Cr(J.defaults),J},J.getDefaults=Sr,J.defaults=V,J.use=function(...e){return Ui.use(...e),J.defaults=Ui.defaults,Cr(J.defaults),J},J.walkTokens=function(e,t){return Ui.walkTokens(e,t)},J.parseInline=Ui.parseInline,J.Parser=q,J.parser=q.parse,J.Renderer=Bi,J.TextRenderer=Vi,J.Lexer=K,J.lexer=K.lex,J.Tokenizer=zi,J.Hooks=Hi,J.parse=J,J.options,J.setOptions,J.use,J.walkTokens,J.parseInline,q.parse,K.lex;var Wi=300,Gi=`300px`,Ki=500;function qi(e={}){let{immediate:t=!1,debounceDelay:n=Wi,rootMargin:r=Gi,idleTimeout:i=Ki}=e,[a,o]=(0,k.useState)(!1),s=(0,k.useRef)(null),c=(0,k.useRef)(null),l=(0,k.useRef)(null),u=(0,k.useMemo)(()=>e=>{let t=Date.now();return window.setTimeout(()=>{e({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-t))})},1)},[]),d=(0,k.useMemo)(()=>typeof window<`u`&&window.requestIdleCallback?(e,t)=>window.requestIdleCallback(e,t):u,[u]),f=(0,k.useMemo)(()=>typeof window<`u`&&window.cancelIdleCallback?e=>window.cancelIdleCallback(e):e=>{clearTimeout(e)},[]);return(0,k.useEffect)(()=>{if(t){o(!0);return}let e=s.current;if(!e)return;c.current&&=(clearTimeout(c.current),null),l.current&&=(f(l.current),null);let a=()=>{c.current&&=(clearTimeout(c.current),null),l.current&&=(f(l.current),null)},u=e=>{l.current=d(t=>{t.timeRemaining()>0||t.didTimeout?(o(!0),e.disconnect()):l.current=d(()=>{o(!0),e.disconnect()},{timeout:i/2})},{timeout:i})},p=e=>{a(),c.current=window.setTimeout(()=>{var t;let n=e.takeRecords();(n.length===0||(t=n.at(-1)?.isIntersecting)!=null&&t)&&u(e)},n)},m=(e,t)=>{e.isIntersecting?p(t):a()},h=new IntersectionObserver(e=>{for(let t of e)m(t,h)},{rootMargin:r,threshold:0});return h.observe(e),()=>{c.current&&clearTimeout(c.current),l.current&&f(l.current),h.disconnect()}},[t,n,r,i,f,d]),{shouldRender:a,containerRef:s}}var Ji=/\s/,Yi=/^\s+$/,Xi=new Set([`code`,`pre`,`svg`,`math`,`annotation`]),Zi=e=>typeof e==`object`&&!!e&&`type`in e&&e.type===`element`,Qi=e=>e.some(e=>Zi(e)&&Xi.has(e.tagName)),$i=e=>{let t=[],n=``,r=!1;for(let i of e){let e=Ji.test(i);e!==r&&n&&(t.push(n),n=``),n+=i,r=e}return n&&t.push(n),t},ea=e=>{let t=[],n=``;for(let r of e)Ji.test(r)?n+=r:(n&&=(t.push(n),``),t.push(r));return n&&t.push(n),t},ta=(e,t,n,r,i,a)=>{let o=`--sd-animation:sd-${t};--sd-duration:${i?0:n}ms;--sd-easing:${r}`;return a&&(o+=`;--sd-delay:${a}ms`),{type:`element`,tagName:`span`,properties:{"data-sd-animate":!0,style:o},children:[{type:`text`,value:e}]}},na=(e,t,n,r,i)=>{let a=t.at(-1);if(!(a&&`children`in a))return;if(Qi(t))return m;let o=a,s=o.children.indexOf(e);if(s===-1)return;let c=e.value;if(!c.trim()){i.count+=c.length;return}let l=n.sep===`char`?ea(c):$i(c),u=r.prevContentLength,d=l.map(e=>{let t=i.count;if(i.count+=e.length,Yi.test(e))return{type:`text`,value:e};let r=u>0&&t<u,a=r?0:i.newIndex++*n.stagger;return ta(e,n.animation,n.duration,n.easing,r,a)});return o.children.splice(s,1,...d),s+d.length},ra=0;function ia(e){let t={animation:e?.animation??`fadeIn`,duration:e?.duration??150,easing:e?.easing??`ease`,sep:e?.sep??`word`,stagger:e?.stagger??40},n={prevContentLength:0,lastRenderCharCount:0},r=ra++,i=()=>e=>{let r={count:0,newIndex:0};c(e,`text`,(e,i)=>na(e,i,t,n,r)),n.lastRenderCharCount=r.count,n.prevContentLength=0};return Object.defineProperty(i,`name`,{value:`rehypeAnimate$${r}`}),{name:`animate`,type:`animate`,rehypePlugin:i,setPrevContentLength(e){n.prevContentLength=e},getLastRenderCharCount(){let e=n.lastRenderCharCount;return n.lastRenderCharCount=0,e}}}ia();var aa=(0,k.createContext)(!1),oa=()=>(0,k.useContext)(aa),sa=(...e)=>s(o(e)),ca=(e,t)=>{if(!e||!t)return t;let n=`${e}:`;return t.split(/\s+/).filter(Boolean).map(t=>t.startsWith(n)?t:`${e}:${t}`).join(` `)},la=e=>e?(...t)=>ca(e,s(o(t))):sa,ua=(e,t,n)=>{let r=typeof t==`string`&&n.startsWith(`text/csv`)?``:``,i=typeof t==`string`?new Blob([r+t],{type:n}):t,a=URL.createObjectURL(i),o=document.createElement(`a`);o.href=a,o.download=e,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(a)},da=(0,k.createContext)(sa),Y=()=>(0,k.useContext)(da),fa=sa(`block`,`before:content-[counter(line)]`,`before:inline-block`,`before:[counter-increment:line]`,`before:w-6`,`before:mr-4`,`before:text-[13px]`,`before:text-right`,`before:text-muted-foreground/50`,`before:font-mono`,`before:select-none`),pa=e=>{let t={};for(let n of e.split(`;`)){let e=n.indexOf(`:`);if(e>0){let r=n.slice(0,e).trim(),i=n.slice(e+1).trim();r&&i&&(t[r]=i)}}return t},ma=(0,k.memo)(({children:e,result:t,language:n,className:r,startLine:i,lineNumbers:a=!0,...o})=>{let s=Y(),c=(0,k.useMemo)(()=>s(fa),[s]),l=(0,k.useMemo)(()=>{let e={};return t.bg&&(e[`--sdm-bg`]=t.bg),t.fg&&(e[`--sdm-fg`]=t.fg),t.rootStyle&&Object.assign(e,pa(t.rootStyle)),e},[t.bg,t.fg,t.rootStyle]);return(0,B.jsx)(`div`,{className:s(r,`overflow-x-auto rounded-md border border-border bg-background p-4 text-sm`),"data-language":n,"data-streamdown":`code-block-body`,...o,children:(0,B.jsx)(`pre`,{className:s(r,`bg-[var(--sdm-bg,inherit]`,`dark:bg-[var(--shiki-dark-bg,var(--sdm-bg,inherit)]`),style:l,children:(0,B.jsx)(`code`,{className:a?s(`[counter-increment:line_0] [counter-reset:line]`):void 0,style:a&&i&&i>1?{counterReset:`line ${i-1}`}:void 0,children:t.tokens.map((e,t)=>(0,B.jsx)(`span`,{className:a?c:void 0,children:e.length===0||e.length===1&&e[0].content===``?`
|
|
83
83
|
`:e.map((e,t)=>{let n={},r=!!e.bgColor;if(e.color&&(n[`--sdm-c`]=e.color),e.bgColor&&(n[`--sdm-tbg`]=e.bgColor),e.htmlStyle)for(let[t,i]of Object.entries(e.htmlStyle))t===`color`?n[`--sdm-c`]=i:t===`background-color`?(n[`--sdm-tbg`]=i,r=!0):n[t]=i;return(0,B.jsx)(`span`,{className:s(`text-[var(--sdm-c,inherit)]`,`dark:text-[var(--shiki-dark,var(--sdm-c,inherit))]`,r&&`bg-[var(--sdm-tbg)]`,r&&`dark:bg-[var(--shiki-dark-bg,var(--sdm-tbg))]`),style:n,...e.htmlAttrs,children:e.content},t)})},t))})})})},(e,t)=>e.result===t.result&&e.language===t.language&&e.className===t.className&&e.startLine===t.startLine&&e.lineNumbers===t.lineNumbers),ha=({className:e,language:t,style:n,isIncomplete:r,...i})=>(0,B.jsx)(`div`,{className:Y()(`my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2`,e),"data-incomplete":r||void 0,"data-language":t,"data-streamdown":`code-block`,style:{contentVisibility:`auto`,containIntrinsicSize:`auto 200px`,...n},...i}),ga=(0,k.createContext)({code:``}),_a=()=>(0,k.useContext)(ga),va=({language:e})=>{let t=Y();return(0,B.jsx)(`div`,{className:t(`flex h-8 items-center text-muted-foreground text-xs`),"data-language":e,"data-streamdown":`code-block-header`,children:(0,B.jsx)(`span`,{className:t(`ml-1 font-mono lowercase`),children:e})})},ya=e=>{let t=e.length;for(;t>0&&e[t-1]===`
|
|
84
|
-
`;)t--;return e.slice(0,t)},ba=(0,k.lazy)(()=>n(()=>import(`./highlighted-body-OFNGDK62-
|
|
84
|
+
`;)t--;return e.slice(0,t)},ba=(0,k.lazy)(()=>n(()=>import(`./highlighted-body-OFNGDK62-BQg91IZ5.js`).then(e=>({default:e.HighlightedCodeBlockBody})),__vite__mapDeps([0,1,2,3]),import.meta.url)),xa=({code:e,language:t,className:n,children:r,isIncomplete:i=!1,startLine:a,lineNumbers:o,...s})=>{let c=Y(),l=(0,k.useMemo)(()=>ya(e),[e]),u=(0,k.useMemo)(()=>({bg:`transparent`,fg:`inherit`,tokens:l.split(`
|
|
85
85
|
`).map(e=>[{content:e,color:`inherit`,bgColor:`transparent`,htmlStyle:{},offset:0}])}),[l]);return(0,B.jsx)(ga.Provider,{value:{code:e},children:(0,B.jsxs)(ha,{isIncomplete:i,language:t,children:[(0,B.jsx)(va,{language:t}),r?(0,B.jsx)(`div`,{className:c(`pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end`),children:(0,B.jsx)(`div`,{className:c(`pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur`),"data-streamdown":`code-block-actions`,children:r})}):null,(0,B.jsx)(k.Suspense,{fallback:(0,B.jsx)(ma,{className:n,language:t,lineNumbers:o,result:u,startLine:a,...s}),children:(0,B.jsx)(ba,{className:n,code:l,language:t,lineNumbers:o,raw:u,startLine:a,...s})})]})})},Sa={CheckIcon:e=>(0,B.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,B.jsx)(`path`,{clipRule:`evenodd`,d:`M15.5607 3.99999L15.0303 4.53032L6.23744 13.3232C5.55403 14.0066 4.44599 14.0066 3.76257 13.3232L4.2929 12.7929L3.76257 13.3232L0.969676 10.5303L0.439346 9.99999L1.50001 8.93933L2.03034 9.46966L4.82323 12.2626C4.92086 12.3602 5.07915 12.3602 5.17678 12.2626L13.9697 3.46966L14.5 2.93933L15.5607 3.99999Z`,fill:`currentColor`,fillRule:`evenodd`})}),CopyIcon:e=>(0,B.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,B.jsx)(`path`,{clipRule:`evenodd`,d:`M2.75 0.5C1.7835 0.5 1 1.2835 1 2.25V9.75C1 10.7165 1.7835 11.5 2.75 11.5H3.75H4.5V10H3.75H2.75C2.61193 10 2.5 9.88807 2.5 9.75V2.25C2.5 2.11193 2.61193 2 2.75 2H8.25C8.38807 2 8.5 2.11193 8.5 2.25V3H10V2.25C10 1.2835 9.2165 0.5 8.25 0.5H2.75ZM7.75 4.5C6.7835 4.5 6 5.2835 6 6.25V13.75C6 14.7165 6.7835 15.5 7.75 15.5H13.25C14.2165 15.5 15 14.7165 15 13.75V6.25C15 5.2835 14.2165 4.5 13.25 4.5H7.75ZM7.5 6.25C7.5 6.11193 7.61193 6 7.75 6H13.25C13.3881 6 13.5 6.11193 13.5 6.25V13.75C13.5 13.8881 13.3881 14 13.25 14H7.75C7.61193 14 7.5 13.8881 7.5 13.75V6.25Z`,fill:`currentColor`,fillRule:`evenodd`})}),DownloadIcon:e=>(0,B.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,B.jsx)(`path`,{clipRule:`evenodd`,d:`M8.75 1V1.75V8.68934L10.7197 6.71967L11.25 6.18934L12.3107 7.25L11.7803 7.78033L8.70711 10.8536C8.31658 11.2441 7.68342 11.2441 7.29289 10.8536L4.21967 7.78033L3.68934 7.25L4.75 6.18934L5.28033 6.71967L7.25 8.68934V1.75V1H8.75ZM13.5 9.25V13.5H2.5V9.25V8.5H1V9.25V14C1 14.5523 1.44771 15 2 15H14C14.5523 15 15 14.5523 15 14V9.25V8.5H13.5V9.25Z`,fill:`currentColor`,fillRule:`evenodd`})}),ExternalLinkIcon:e=>(0,B.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,B.jsx)(`path`,{clipRule:`evenodd`,d:`M13.5 10.25V13.25C13.5 13.3881 13.3881 13.5 13.25 13.5H2.75C2.61193 13.5 2.5 13.3881 2.5 13.25L2.5 2.75C2.5 2.61193 2.61193 2.5 2.75 2.5H5.75H6.5V1H5.75H2.75C1.7835 1 1 1.7835 1 2.75V13.25C1 14.2165 1.7835 15 2.75 15H13.25C14.2165 15 15 14.2165 15 13.25V10.25V9.5H13.5V10.25ZM9 1H9.75H14.2495C14.6637 1 14.9995 1.33579 14.9995 1.75V6.25V7H13.4995V6.25V3.56066L8.53033 8.52978L8 9.06011L6.93934 7.99945L7.46967 7.46912L12.4388 2.5H9.75H9V1Z`,fill:`currentColor`,fillRule:`evenodd`})}),Loader2Icon:e=>(0,B.jsxs)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:[(0,B.jsx)(`path`,{d:`M8 0V4`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,B.jsx)(`path`,{d:`M8 16V12`,opacity:`0.5`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,B.jsx)(`path`,{d:`M3.29773 1.52783L5.64887 4.7639`,opacity:`0.9`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,B.jsx)(`path`,{d:`M12.7023 1.52783L10.3511 4.7639`,opacity:`0.1`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,B.jsx)(`path`,{d:`M12.7023 14.472L10.3511 11.236`,opacity:`0.4`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,B.jsx)(`path`,{d:`M3.29773 14.472L5.64887 11.236`,opacity:`0.6`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,B.jsx)(`path`,{d:`M15.6085 5.52783L11.8043 6.7639`,opacity:`0.2`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,B.jsx)(`path`,{d:`M0.391602 10.472L4.19583 9.23598`,opacity:`0.7`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,B.jsx)(`path`,{d:`M15.6085 10.4722L11.8043 9.2361`,opacity:`0.3`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,B.jsx)(`path`,{d:`M0.391602 5.52783L4.19583 6.7639`,opacity:`0.8`,stroke:`currentColor`,strokeWidth:`1.5`})]}),Maximize2Icon:e=>(0,B.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,B.jsx)(`path`,{clipRule:`evenodd`,d:`M1 5.25V6H2.5V5.25V2.5H5.25H6V1H5.25H2C1.44772 1 1 1.44772 1 2V5.25ZM5.25 14.9994H6V13.4994H5.25H2.5V10.7494V9.99939H1V10.7494V13.9994C1 14.5517 1.44772 14.9994 2 14.9994H5.25ZM15 10V10.75V14C15 14.5523 14.5523 15 14 15H10.75H10V13.5H10.75H13.5V10.75V10H15ZM10.75 1H10V2.5H10.75H13.5V5.25V6H15V5.25V2C15 1.44772 14.5523 1 14 1H10.75Z`,fill:`currentColor`,fillRule:`evenodd`})}),RotateCcwIcon:e=>(0,B.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,B.jsx)(`path`,{clipRule:`evenodd`,d:`M13.5 8C13.5 4.96643 11.0257 2.5 7.96452 2.5C5.42843 2.5 3.29365 4.19393 2.63724 6.5H5.25H6V8H5.25H0.75C0.335787 8 0 7.66421 0 7.25V2.75V2H1.5V2.75V5.23347C2.57851 2.74164 5.06835 1 7.96452 1C11.8461 1 15 4.13001 15 8C15 11.87 11.8461 15 7.96452 15C5.62368 15 3.54872 13.8617 2.27046 12.1122L1.828 11.5066L3.03915 10.6217L3.48161 11.2273C4.48831 12.6051 6.12055 13.5 7.96452 13.5C11.0257 13.5 13.5 11.0336 13.5 8Z`,fill:`currentColor`,fillRule:`evenodd`})}),XIcon:e=>(0,B.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,B.jsx)(`path`,{clipRule:`evenodd`,d:`M12.4697 13.5303L13 14.0607L14.0607 13L13.5303 12.4697L9.06065 7.99999L13.5303 3.53032L14.0607 2.99999L13 1.93933L12.4697 2.46966L7.99999 6.93933L3.53032 2.46966L2.99999 1.93933L1.93933 2.99999L2.46966 3.53032L6.93933 7.99999L2.46966 12.4697L1.93933 13L2.99999 14.0607L3.53032 13.5303L7.99999 9.06065L12.4697 13.5303Z`,fill:`currentColor`,fillRule:`evenodd`})}),ZoomInIcon:e=>(0,B.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,B.jsx)(`path`,{clipRule:`evenodd`,d:`M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H5.875V4.75V4.125H7.125V4.75V5.875H8.25H8.875V7.125H8.25H7.125V8.25V8.875H5.875V8.25V7.125H4.75H4.125V5.875Z`,fill:`currentColor`,fillRule:`evenodd`})}),ZoomOutIcon:e=>(0,B.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,B.jsx)(`path`,{clipRule:`evenodd`,d:`M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H8.25H8.875V7.125H8.25H4.75H4.125V5.875Z`,fill:`currentColor`,fillRule:`evenodd`})})},Ca=(0,k.createContext)(Sa),wa=(e,t)=>{if(e===t)return!0;if(!(e&&t))return e===t;let n=Object.keys(e),r=Object.keys(t);return n.length===r.length?n.every(n=>e[n]===t[n]):!1},Ta=({icons:e,children:t})=>{let n=(0,k.useRef)(e),r=(0,k.useRef)(e?{...Sa,...e}:Sa);wa(n.current,e)||(n.current=e,r.current=e?{...Sa,...e}:Sa);let i=r.current;return(0,B.jsx)(Ca.Provider,{value:i,children:t})},X=()=>(0,k.useContext)(Ca),Ea={copyCode:`Copy Code`,downloadFile:`Download file`,downloadDiagram:`Download diagram`,downloadDiagramAsSvg:`Download diagram as SVG`,downloadDiagramAsPng:`Download diagram as PNG`,downloadDiagramAsMmd:`Download diagram as MMD`,viewFullscreen:`View fullscreen`,exitFullscreen:`Exit fullscreen`,mermaidFormatSvg:`SVG`,mermaidFormatPng:`PNG`,mermaidFormatMmd:`MMD`,copyTable:`Copy table`,copyTableAsMarkdown:`Copy table as Markdown`,copyTableAsCsv:`Copy table as CSV`,copyTableAsTsv:`Copy table as TSV`,downloadTable:`Download table`,downloadTableAsCsv:`Download table as CSV`,downloadTableAsMarkdown:`Download table as Markdown`,tableFormatMarkdown:`Markdown`,tableFormatCsv:`CSV`,tableFormatTsv:`TSV`,imageNotAvailable:`Image not available`,downloadImage:`Download image`,openExternalLink:`Open external link?`,externalLinkWarning:`You're about to visit an external website.`,close:`Close`,copyLink:`Copy link`,copied:`Copied`,openLink:`Open link`},Da=(0,k.createContext)(Ea),Z=()=>(0,k.useContext)(Da),Oa=({onCopy:e,onError:t,timeout:n=2e3,children:r,className:i,code:a,...o})=>{let s=Y(),[c,l]=(0,k.useState)(!1),u=(0,k.useRef)(0),{code:d}=_a(),{isAnimating:f}=(0,k.useContext)($),p=Z(),m=a??d,h=async()=>{var r;if(typeof window>`u`||!((r=navigator==null?void 0:navigator.clipboard)!=null&&r.writeText)){t?.(Error(`Clipboard API not available`));return}try{c||(await navigator.clipboard.writeText(m),l(!0),e?.(),u.current=window.setTimeout(()=>l(!1),n))}catch(e){t?.(e)}};(0,k.useEffect)(()=>()=>{window.clearTimeout(u.current)},[]);let g=X(),_=c?g.CheckIcon:g.CopyIcon;return(0,B.jsx)(`button`,{className:s(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),"data-streamdown":`code-block-copy-button`,disabled:f,onClick:h,title:p.copyCode,type:`button`,...o,children:r??(0,B.jsx)(_,{size:14})})},ka={"1c":`1c`,"1c-query":`1cq`,abap:`abap`,"actionscript-3":`as`,ada:`ada`,adoc:`adoc`,"angular-html":`html`,"angular-ts":`ts`,apache:`conf`,apex:`cls`,apl:`apl`,applescript:`applescript`,ara:`ara`,asciidoc:`adoc`,asm:`asm`,astro:`astro`,awk:`awk`,ballerina:`bal`,bash:`sh`,bat:`bat`,batch:`bat`,be:`be`,beancount:`beancount`,berry:`berry`,bibtex:`bib`,bicep:`bicep`,blade:`blade.php`,bsl:`bsl`,c:`c`,"c#":`cs`,"c++":`cpp`,cadence:`cdc`,cairo:`cairo`,cdc:`cdc`,clarity:`clar`,clj:`clj`,clojure:`clj`,"closure-templates":`soy`,cmake:`cmake`,cmd:`cmd`,cobol:`cob`,codeowners:`CODEOWNERS`,codeql:`ql`,coffee:`coffee`,coffeescript:`coffee`,"common-lisp":`lisp`,console:`sh`,coq:`v`,cpp:`cpp`,cql:`cql`,crystal:`cr`,cs:`cs`,csharp:`cs`,css:`css`,csv:`csv`,cue:`cue`,cypher:`cql`,d:`d`,dart:`dart`,dax:`dax`,desktop:`desktop`,diff:`diff`,docker:`dockerfile`,dockerfile:`dockerfile`,dotenv:`env`,"dream-maker":`dm`,edge:`edge`,elisp:`el`,elixir:`ex`,elm:`elm`,"emacs-lisp":`el`,erb:`erb`,erl:`erl`,erlang:`erl`,f:`f`,"f#":`fs`,f03:`f03`,f08:`f08`,f18:`f18`,f77:`f77`,f90:`f90`,f95:`f95`,fennel:`fnl`,fish:`fish`,fluent:`ftl`,for:`for`,"fortran-fixed-form":`f`,"fortran-free-form":`f90`,fs:`fs`,fsharp:`fs`,fsl:`fsl`,ftl:`ftl`,gdresource:`tres`,gdscript:`gd`,gdshader:`gdshader`,genie:`gs`,gherkin:`feature`,"git-commit":`gitcommit`,"git-rebase":`gitrebase`,gjs:`js`,gleam:`gleam`,"glimmer-js":`js`,"glimmer-ts":`ts`,glsl:`glsl`,gnuplot:`plt`,go:`go`,gql:`gql`,graphql:`graphql`,groovy:`groovy`,gts:`gts`,hack:`hack`,haml:`haml`,handlebars:`hbs`,haskell:`hs`,haxe:`hx`,hbs:`hbs`,hcl:`hcl`,hjson:`hjson`,hlsl:`hlsl`,hs:`hs`,html:`html`,"html-derivative":`html`,http:`http`,hxml:`hxml`,hy:`hy`,imba:`imba`,ini:`ini`,jade:`jade`,java:`java`,javascript:`js`,jinja:`jinja`,jison:`jison`,jl:`jl`,js:`js`,json:`json`,json5:`json5`,jsonc:`jsonc`,jsonl:`jsonl`,jsonnet:`jsonnet`,jssm:`jssm`,jsx:`jsx`,julia:`jl`,kotlin:`kt`,kql:`kql`,kt:`kt`,kts:`kts`,kusto:`kql`,latex:`tex`,lean:`lean`,lean4:`lean`,less:`less`,liquid:`liquid`,lisp:`lisp`,lit:`lit`,llvm:`ll`,log:`log`,logo:`logo`,lua:`lua`,luau:`luau`,make:`mak`,makefile:`mak`,markdown:`md`,marko:`marko`,matlab:`m`,md:`md`,mdc:`mdc`,mdx:`mdx`,mediawiki:`wiki`,mermaid:`mmd`,mips:`s`,mipsasm:`s`,mmd:`mmd`,mojo:`mojo`,move:`move`,nar:`nar`,narrat:`narrat`,nextflow:`nf`,nf:`nf`,nginx:`conf`,nim:`nim`,nix:`nix`,nu:`nu`,nushell:`nu`,objc:`m`,"objective-c":`m`,"objective-cpp":`mm`,ocaml:`ml`,pascal:`pas`,perl:`pl`,perl6:`p6`,php:`php`,plsql:`pls`,po:`po`,polar:`polar`,postcss:`pcss`,pot:`pot`,potx:`potx`,powerquery:`pq`,powershell:`ps1`,prisma:`prisma`,prolog:`pl`,properties:`properties`,proto:`proto`,protobuf:`proto`,ps:`ps`,ps1:`ps1`,pug:`pug`,puppet:`pp`,purescript:`purs`,py:`py`,python:`py`,ql:`ql`,qml:`qml`,qmldir:`qmldir`,qss:`qss`,r:`r`,racket:`rkt`,raku:`raku`,razor:`cshtml`,rb:`rb`,reg:`reg`,regex:`regex`,regexp:`regexp`,rel:`rel`,riscv:`s`,rs:`rs`,rst:`rst`,ruby:`rb`,rust:`rs`,sas:`sas`,sass:`sass`,scala:`scala`,scheme:`scm`,scss:`scss`,sdbl:`sdbl`,sh:`sh`,shader:`shader`,shaderlab:`shader`,shell:`sh`,shellscript:`sh`,shellsession:`sh`,smalltalk:`st`,solidity:`sol`,soy:`soy`,sparql:`rq`,spl:`spl`,splunk:`spl`,sql:`sql`,"ssh-config":`config`,stata:`do`,styl:`styl`,stylus:`styl`,svelte:`svelte`,swift:`swift`,"system-verilog":`sv`,systemd:`service`,talon:`talon`,talonscript:`talon`,tasl:`tasl`,tcl:`tcl`,templ:`templ`,terraform:`tf`,tex:`tex`,tf:`tf`,tfvars:`tfvars`,toml:`toml`,ts:`ts`,"ts-tags":`ts`,tsp:`tsp`,tsv:`tsv`,tsx:`tsx`,turtle:`ttl`,twig:`twig`,typ:`typ`,typescript:`ts`,typespec:`tsp`,typst:`typ`,v:`v`,vala:`vala`,vb:`vb`,verilog:`v`,vhdl:`vhdl`,vim:`vim`,viml:`vim`,vimscript:`vim`,vue:`vue`,"vue-html":`html`,"vue-vine":`vine`,vy:`vy`,vyper:`vy`,wasm:`wasm`,wenyan:`wy`,wgsl:`wgsl`,wiki:`wiki`,wikitext:`wiki`,wit:`wit`,wl:`wl`,wolfram:`wl`,xml:`xml`,xsl:`xsl`,yaml:`yaml`,yml:`yml`,zenscript:`zs`,zig:`zig`,zsh:`zsh`,文言:`wy`},Aa=({onDownload:e,onError:t,language:n,children:r,className:i,code:a,...o})=>{let s=Y(),{code:c}=_a(),{isAnimating:l}=(0,k.useContext)($),u=Z(),d=X(),f=a??c,p=`file.${n&&n in ka?ka[n]:`txt`}`;return(0,B.jsx)(`button`,{className:s(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),"data-streamdown":`code-block-download-button`,disabled:l,onClick:()=>{try{ua(p,f,`text/plain`),e?.()}catch(e){t?.(e)}},title:u.downloadFile,type:`button`,...o,children:r??(0,B.jsx)(d.DownloadIcon,{size:14})})},ja=()=>{let{Loader2Icon:e}=X(),t=Y();return(0,B.jsxs)(`div`,{className:t(`w-full divide-y divide-border overflow-hidden rounded-xl border border-border`),children:[(0,B.jsx)(`div`,{className:t(`h-[46px] w-full bg-muted/80`)}),(0,B.jsx)(`div`,{className:t(`flex w-full items-center justify-center p-4`),children:(0,B.jsx)(e,{className:t(`size-4 animate-spin`)})})]})},Ma=/\.[^/.]+$/,Na=({node:e,className:t,src:n,alt:r,onLoad:i,onError:a,...o})=>{let{DownloadIcon:s}=X(),c=Y(),l=(0,k.useRef)(null),[u,d]=(0,k.useState)(!1),[f,p]=(0,k.useState)(!1),m=Z(),h=o.width!=null||o.height!=null,g=(u||h)&&!f,_=f&&!h;(0,k.useEffect)(()=>{let e=l.current;if(e!=null&&e.complete){let t=e.naturalWidth>0;d(t),p(!t)}},[]);let v=(0,k.useCallback)(e=>{d(!0),p(!1),i?.(e)},[i]),y=(0,k.useCallback)(e=>{d(!1),p(!0),a?.(e)},[a]),b=async()=>{if(n)try{let e=await(await fetch(n)).blob(),t=new URL(n,window.location.origin).pathname.split(`/`).pop()||``,i=t.split(`.`).pop(),a=t.includes(`.`)&&i!==void 0&&i.length<=4,o=``;if(a)o=t;else{let n=e.type,i=`png`;n.includes(`jpeg`)||n.includes(`jpg`)?i=`jpg`:n.includes(`png`)?i=`png`:n.includes(`svg`)?i=`svg`:n.includes(`gif`)?i=`gif`:n.includes(`webp`)&&(i=`webp`),o=`${(r||t||`image`).replace(Ma,``)}.${i}`}ua(o,e,e.type)}catch{window.open(n,`_blank`)}};return n?(0,B.jsxs)(`div`,{className:c(`group relative my-4 inline-block`),"data-streamdown":`image-wrapper`,children:[(0,B.jsx)(`img`,{alt:r,className:c(`max-w-full rounded-lg`,_&&`hidden`,t),"data-streamdown":`image`,onError:y,onLoad:v,ref:l,src:n,...o}),_&&(0,B.jsx)(`span`,{className:c(`text-muted-foreground text-xs italic`),"data-streamdown":`image-fallback`,children:m.imageNotAvailable}),(0,B.jsx)(`div`,{className:c(`pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block`)}),g&&(0,B.jsx)(`button`,{className:c(`absolute right-2 bottom-2 flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-border bg-background/90 shadow-sm backdrop-blur-sm transition-all duration-200 hover:bg-background`,`opacity-0 group-hover:opacity-100`),onClick:b,title:m.downloadImage,type:`button`,children:(0,B.jsx)(s,{size:14})})]}):null},Pa=0,Fa=()=>{Pa+=1,Pa===1&&(document.body.style.overflow=`hidden`)},Ia=()=>{Pa=Math.max(0,Pa-1),Pa===0&&(document.body.style.overflow=``)},La=({url:e,isOpen:t,onClose:n,onConfirm:r})=>{let{CheckIcon:i,CopyIcon:a,ExternalLinkIcon:o,XIcon:s}=X(),c=Y(),[l,u]=(0,k.useState)(!1),d=Z(),f=(0,k.useCallback)(async()=>{try{await navigator.clipboard.writeText(e),u(!0),setTimeout(()=>u(!1),2e3)}catch{}},[e]),p=(0,k.useCallback)(()=>{r(),n()},[r,n]);return(0,k.useEffect)(()=>{if(t){Fa();let e=e=>{e.key===`Escape`&&n()};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),Ia()}}},[t,n]),t?(0,B.jsx)(`div`,{className:c(`fixed inset-0 z-50 flex items-center justify-center bg-background/50 backdrop-blur-sm`),"data-streamdown":`link-safety-modal`,onClick:n,onKeyDown:e=>{e.key===`Escape`&&n()},role:`button`,tabIndex:0,children:(0,B.jsxs)(`div`,{className:c(`relative mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border bg-background p-6 shadow-lg`),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:[(0,B.jsx)(`button`,{className:c(`absolute top-4 right-4 rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`),onClick:n,title:d.close,type:`button`,children:(0,B.jsx)(s,{size:16})}),(0,B.jsxs)(`div`,{className:c(`flex flex-col gap-2`),children:[(0,B.jsxs)(`div`,{className:c(`flex items-center gap-2 font-semibold text-lg`),children:[(0,B.jsx)(o,{size:20}),(0,B.jsx)(`span`,{children:d.openExternalLink})]}),(0,B.jsx)(`p`,{className:c(`text-muted-foreground text-sm`),children:d.externalLinkWarning})]}),(0,B.jsx)(`div`,{className:c(`break-all rounded-md bg-muted p-3 font-mono text-sm`,e.length>100&&`max-h-32 overflow-y-auto`),children:e}),(0,B.jsxs)(`div`,{className:c(`flex gap-2`),children:[(0,B.jsx)(`button`,{className:c(`flex flex-1 items-center justify-center gap-2 rounded-md border bg-background px-4 py-2 font-medium text-sm transition-all hover:bg-muted`),onClick:f,type:`button`,children:l?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(i,{size:14}),(0,B.jsx)(`span`,{children:d.copied})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(a,{size:14}),(0,B.jsx)(`span`,{children:d.copyLink})]})}),(0,B.jsxs)(`button`,{className:c(`flex flex-1 items-center justify-center gap-2 rounded-md bg-primary px-4 py-2 font-medium text-primary-foreground text-sm transition-all hover:bg-primary/90`),onClick:p,type:`button`,children:[(0,B.jsx)(o,{size:14}),(0,B.jsx)(`span`,{children:d.openLink})]})]})]})}):null},Ra=(0,k.createContext)(null),za=()=>(0,k.useContext)(Ra),Ba=()=>za()?.code??null,Va=()=>za()?.mermaid??null,Ha=e=>{var t;let n=za();return n!=null&&n.renderers&&e&&(t=n.renderers.find(t=>Array.isArray(t.language)?t.language.includes(e):t.language===e))!=null?t:null},Ua=(e,t)=>new Promise((t,n)=>{let r=`data:image/svg+xml;base64,`+btoa(unescape(encodeURIComponent(e))),i=new Image;i.crossOrigin=`anonymous`,i.onload=()=>{let e=document.createElement(`canvas`),r=i.width*5,a=i.height*5;e.width=r,e.height=a;let o=e.getContext(`2d`);if(!o){n(Error(`Failed to create 2D canvas context for PNG export`));return}o.drawImage(i,0,0,r,a),e.toBlob(e=>{if(!e){n(Error(`Failed to create PNG blob`));return}t(e)},`image/png`)},i.onerror=()=>n(Error(`Failed to load SVG image`)),i.src=r}),Wa=({chart:e,children:t,className:n,onDownload:r,config:i,onError:a})=>{let o=Y(),[s,c]=(0,k.useState)(!1),l=(0,k.useRef)(null),{isAnimating:u}=(0,k.useContext)($),d=X(),f=Va(),p=Z(),m=async t=>{try{if(t===`mmd`){ua(`diagram.mmd`,e,`text/plain`),c(!1),r?.(t);return}if(!f){a?.(Error(`Mermaid plugin not available`));return}let n=f.getMermaid(i),o=e.split(``).reduce((e,t)=>(e<<5)-e+t.charCodeAt(0)|0,0),s=`mermaid-${Math.abs(o)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:l}=await n.render(s,e);if(!l){a?.(Error(`SVG not found. Please wait for the diagram to render.`));return}if(t===`svg`){ua(`diagram.svg`,l,`image/svg+xml`),c(!1),r?.(t);return}if(t===`png`){ua(`diagram.png`,await Ua(l),`image/png`),r?.(t),c(!1);return}}catch(e){a?.(e)}};return(0,k.useEffect)(()=>{let e=e=>{let t=e.composedPath();l.current&&!t.includes(l.current)&&c(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),(0,B.jsxs)(`div`,{className:o(`relative`),ref:l,children:[(0,B.jsx)(`button`,{className:o(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,n),disabled:u,onClick:()=>c(!s),title:p.downloadDiagram,type:`button`,children:t??(0,B.jsx)(d.DownloadIcon,{size:14})}),s?(0,B.jsxs)(`div`,{className:o(`absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,B.jsx)(`button`,{className:o(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`svg`),title:p.downloadDiagramAsSvg,type:`button`,children:p.mermaidFormatSvg}),(0,B.jsx)(`button`,{className:o(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`png`),title:p.downloadDiagramAsPng,type:`button`,children:p.mermaidFormatPng}),(0,B.jsx)(`button`,{className:o(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`mmd`),title:p.downloadDiagramAsMmd,type:`button`,children:p.mermaidFormatMmd})]}):null]})},Ga=({chart:e,config:t,onFullscreen:n,onExit:r,className:i,...a})=>{let{Maximize2Icon:o,XIcon:s}=X(),c=Y(),[l,u]=(0,k.useState)(!1),{isAnimating:d,controls:f}=(0,k.useContext)($),p=Z(),m=(()=>{if(typeof f==`boolean`)return f;let e=f.mermaid;return e===!1?!1:e===!0||e===void 0?!0:e.panZoom!==!1})(),h=()=>{u(!l)};return(0,k.useEffect)(()=>{if(l){Fa();let e=e=>{e.key===`Escape`&&u(!1)};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),Ia()}}},[l]),(0,k.useEffect)(()=>{l?n?.():r&&r()},[l,n,r]),(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`button`,{className:c(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),disabled:d,onClick:h,title:p.viewFullscreen,type:`button`,...a,children:(0,B.jsx)(o,{size:14})}),l?(0,xr.createPortal)((0,B.jsxs)(`div`,{className:c(`fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm`),onClick:h,onKeyDown:e=>{e.key===`Escape`&&h()},role:`button`,tabIndex:0,children:[(0,B.jsx)(`button`,{className:c(`absolute top-4 right-4 z-10 rounded-md p-2 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`),onClick:h,title:p.exitFullscreen,type:`button`,children:(0,B.jsx)(s,{size:20})}),(0,B.jsx)(`div`,{className:c(`flex size-full items-center justify-center p-4`),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:(0,B.jsx)(Ls,{chart:e,className:c(`size-full [&_svg]:h-auto [&_svg]:w-auto`),config:t,fullscreen:!0,showControls:m})})]}),document.body):null]})},Ka=e=>{let t=[],n=[],r=e.querySelectorAll(`thead th`);for(let e of r)t.push(e.textContent?.trim()||``);let i=e.querySelectorAll(`tbody tr`);for(let e of i){let t=[],r=e.querySelectorAll(`td`);for(let e of r)t.push(e.textContent?.trim()||``);n.push(t)}return{headers:t,rows:n}},qa=e=>{let{headers:t,rows:n}=e,r=e=>{let t=!1,n=!1;for(let r of e){if(r===`"`){t=!0,n=!0;break}(r===`,`||r===`
|
|
86
86
|
`)&&(t=!0)}return t?n?`"${e.replace(/"/g,`""`)}"`:`"${e}"`:e},i=t.length>0?n.length+1:n.length,a=Array(i),o=0;t.length>0&&(a[o]=t.map(r).join(`,`),o+=1);for(let e of n)a[o]=e.map(r).join(`,`),o+=1;return a.join(`
|
|
87
87
|
`)},Ja=e=>{let{headers:t,rows:n}=e,r=e=>{let t=!1;for(let n of e)if(n===` `||n===`
|
|
88
88
|
`||n===`\r`){t=!0;break}if(!t)return e;let n=[];for(let t of e)t===` `?n.push(`\\t`):t===`
|
|
89
89
|
`?n.push(`\\n`):t===`\r`?n.push(`\\r`):n.push(t);return n.join(``)},i=t.length>0?n.length+1:n.length,a=Array(i),o=0;t.length>0&&(a[o]=t.map(r).join(` `),o+=1);for(let e of n)a[o]=e.map(r).join(` `),o+=1;return a.join(`
|
|
90
90
|
`)},Ya=e=>{let t=!1;for(let n of e)if(n===`\\`||n===`|`){t=!0;break}if(!t)return e;let n=[];for(let t of e)t===`\\`?n.push(`\\\\`):t===`|`?n.push(`\\|`):n.push(t);return n.join(``)},Xa=e=>{let{headers:t,rows:n}=e;if(t.length===0)return``;let r=Array(n.length+2),i=0;r[i]=`| ${t.map(e=>Ya(e)).join(` | `)} |`,i+=1;let a=Array(t.length);for(let e=0;e<t.length;e+=1)a[e]=`---`;r[i]=`| ${a.join(` | `)} |`,i+=1;for(let e of n)if(e.length<t.length){let n=Array(t.length);for(let r=0;r<t.length;r+=1)n[r]=r<e.length?Ya(e[r]):``;r[i]=`| ${n.join(` | `)} |`,i+=1}else r[i]=`| ${e.map(e=>Ya(e)).join(` | `)} |`,i+=1;return r.join(`
|
|
91
|
-
`)},Za=({children:e,className:t,onCopy:n,onError:r,timeout:i=2e3})=>{let a=Y(),[o,s]=(0,k.useState)(!1),[c,l]=(0,k.useState)(!1),u=(0,k.useRef)(null),d=(0,k.useRef)(0),{isAnimating:f}=(0,k.useContext)($),p=Z(),m=async e=>{var t;if(typeof window>`u`||!((t=navigator==null?void 0:navigator.clipboard)!=null&&t.write)){r?.(Error(`Clipboard API not available`));return}try{let t=(u.current?.closest(`[data-streamdown="table-wrapper"]`))?.querySelector(`table`);if(!t){r?.(Error(`Table not found`));return}let a=Ka(t),o=({csv:qa,tsv:Ja,md:Xa}[e]||Xa)(a),c=new ClipboardItem({"text/plain":new Blob([o],{type:`text/plain`}),"text/html":new Blob([t.outerHTML],{type:`text/html`})});await navigator.clipboard.write([c]),l(!0),s(!1),n?.(e),d.current=window.setTimeout(()=>l(!1),i)}catch(e){r?.(e)}};(0,k.useEffect)(()=>{let e=e=>{let t=e.composedPath();u.current&&!t.includes(u.current)&&s(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e),window.clearTimeout(d.current)}},[]);let h=X(),g=c?h.CheckIcon:h.CopyIcon;return(0,B.jsxs)(`div`,{className:a(`relative`),ref:u,children:[(0,B.jsx)(`button`,{className:a(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:f,onClick:()=>s(!o),title:p.copyTable,type:`button`,children:e??(0,B.jsx)(g,{height:14,width:14})}),o?(0,B.jsxs)(`div`,{className:a(`absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,B.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`md`),title:p.copyTableAsMarkdown,type:`button`,children:p.tableFormatMarkdown}),(0,B.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`csv`),title:p.copyTableAsCsv,type:`button`,children:p.tableFormatCsv}),(0,B.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`tsv`),title:p.copyTableAsTsv,type:`button`,children:p.tableFormatTsv})]}):null]})},Qa=({children:e,className:t,onDownload:n,onError:r})=>{let i=Y(),[a,o]=(0,k.useState)(!1),s=(0,k.useRef)(null),{isAnimating:c}=(0,k.useContext)($),l=Z(),u=X(),d=e=>{try{let t=(s.current?.closest(`[data-streamdown="table-wrapper"]`))?.querySelector(`table`);if(!t){r?.(Error(`Table not found`));return}let i=Ka(t),a=e===`csv`?qa(i):Xa(i);ua(`table.${e===`csv`?`csv`:`md`}`,a,e===`csv`?`text/csv`:`text/markdown`),o(!1),n?.(e)}catch(e){r?.(e)}};return(0,k.useEffect)(()=>{let e=e=>{let t=e.composedPath();s.current&&!t.includes(s.current)&&o(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),(0,B.jsxs)(`div`,{className:i(`relative`),ref:s,children:[(0,B.jsx)(`button`,{className:i(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:c,onClick:()=>o(!a),title:l.downloadTable,type:`button`,children:e??(0,B.jsx)(u.DownloadIcon,{size:14})}),a?(0,B.jsxs)(`div`,{className:i(`absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,B.jsx)(`button`,{className:i(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>d(`csv`),title:l.downloadTableAsCsv,type:`button`,children:l.tableFormatCsv}),(0,B.jsx)(`button`,{className:i(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>d(`markdown`),title:l.downloadTableAsMarkdown,type:`button`,children:l.tableFormatMarkdown})]}):null]})},$a=({children:e,className:t,showCopy:n=!0,showDownload:r=!0})=>{let{Maximize2Icon:i,XIcon:a}=X(),o=Y(),[s,c]=(0,k.useState)(!1),{isAnimating:l}=(0,k.useContext)($),u=Z(),d=()=>{c(!0)},f=()=>{c(!1)};return(0,k.useEffect)(()=>{if(s){Fa();let e=e=>{e.key===`Escape`&&c(!1)};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),Ia()}}},[s]),(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`button`,{className:o(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:l,onClick:d,title:u.viewFullscreen,type:`button`,children:(0,B.jsx)(i,{size:14})}),s?(0,xr.createPortal)((0,B.jsx)(`div`,{"aria-label":u.viewFullscreen,"aria-modal":`true`,className:o(`fixed inset-0 z-50 flex flex-col bg-background`),"data-streamdown":`table-fullscreen`,onClick:f,onKeyDown:e=>{e.key===`Escape`&&f()},role:`dialog`,children:(0,B.jsxs)(`div`,{className:o(`flex h-full flex-col`),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:[(0,B.jsxs)(`div`,{className:o(`flex items-center justify-end gap-1 p-4`),children:[n?(0,B.jsx)(Za,{}):null,r?(0,B.jsx)(Qa,{}):null,(0,B.jsx)(`button`,{className:o(`rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`),onClick:f,title:u.exitFullscreen,type:`button`,children:(0,B.jsx)(a,{size:20})})]}),(0,B.jsx)(`div`,{className:o(`flex-1 overflow-auto p-4 pt-0 [&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10`),children:(0,B.jsx)(`table`,{className:o(`w-full border-collapse border border-border`),"data-streamdown":`table`,children:e})})]})}),document.body):null]})},eo=({children:e,className:t,showControls:n,showCopy:r=!0,showDownload:i=!0,showFullscreen:a=!0,...o})=>{let s=Y(),c=n&&r,l=n&&i,u=n&&a,d=c||l||u;return(0,B.jsxs)(`div`,{className:s(`my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2`),"data-streamdown":`table-wrapper`,children:[d?(0,B.jsxs)(`div`,{className:s(`flex items-center justify-end gap-1`),children:[c?(0,B.jsx)(Za,{}):null,l?(0,B.jsx)(Qa,{}):null,u?(0,B.jsx)($a,{showCopy:c,showDownload:l,children:e}):null]}):null,(0,B.jsx)(`div`,{className:s(`border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background`),children:(0,B.jsx)(`table`,{className:s(`w-full divide-y divide-border`,t),"data-streamdown":`table`,...o,children:e})})]})},to=/startLine=(\d+)/,no=/\bnoLineNumbers\b/,ro=(0,k.lazy)(()=>n(()=>import(`./mermaid-GHXKKRXX-CTq-e8f7.js`).then(e=>({default:e.Mermaid})),[],import.meta.url)),io=/language-([^\s]+)/;function ao(e,t){if(!(e!=null&&e.position||t!=null&&t.position))return!0;if(!(e!=null&&e.position&&t!=null&&t.position))return!1;let n=e.position.start,r=t.position.start,i=e.position.end,a=t.position.end;return n?.line===r?.line&&n?.column===r?.column&&i?.line===a?.line&&i?.column===a?.column}function Q(e,t){return e.className===t.className&&ao(e.node,t.node)}var oo=(e,t)=>typeof e==`boolean`?e:e[t]!==!1,so=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.table;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},co=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.code;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},lo=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.mermaid;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},uo=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,B.jsx)(`ol`,{className:Y()(`list-inside list-decimal whitespace-normal [li_&]:pl-6`,t),"data-streamdown":`ordered-list`,...r,children:e}),(e,t)=>Q(e,t));uo.displayName=`MarkdownOl`;var fo=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,B.jsx)(`li`,{className:Y()(`py-1 [&>p]:inline`,t),"data-streamdown":`list-item`,...r,children:e}),(e,t)=>e.className===t.className&&ao(e.node,t.node));fo.displayName=`MarkdownLi`;var po=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,B.jsx)(`ul`,{className:Y()(`list-inside list-disc whitespace-normal [li_&]:pl-6`,t),"data-streamdown":`unordered-list`,...r,children:e}),(e,t)=>Q(e,t));po.displayName=`MarkdownUl`;var mo=(0,k.memo)(({className:e,node:t,...n})=>(0,B.jsx)(`hr`,{className:Y()(`my-6 border-border`,e),"data-streamdown":`horizontal-rule`,...n}),(e,t)=>Q(e,t));mo.displayName=`MarkdownHr`;var ho=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,B.jsx)(`span`,{className:Y()(`font-semibold`,t),"data-streamdown":`strong`,...r,children:e}),(e,t)=>Q(e,t));ho.displayName=`MarkdownStrong`;var go=(0,k.memo)(({children:e,className:t,href:n,node:r,...i})=>{let a=Y(),{linkSafety:o}=(0,k.useContext)($),[s,c]=(0,k.useState)(!1),l=n===`streamdown:incomplete-link`,u=(0,k.useCallback)(async e=>{if(!(!(o!=null&&o.enabled&&n)||l)){if(e.preventDefault(),o.onLinkCheck&&await o.onLinkCheck(n)){window.open(n,`_blank`,`noreferrer`);return}c(!0)}},[o,n,l]),d=(0,k.useCallback)(()=>{n&&window.open(n,`_blank`,`noreferrer`)},[n]),f=(0,k.useCallback)(()=>{c(!1)},[]),p={url:n??``,isOpen:s,onClose:f,onConfirm:d};return o!=null&&o.enabled&&n?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`button`,{className:a(`wrap-anywhere appearance-none text-left font-medium text-primary underline`,t),"data-incomplete":l,"data-streamdown":`link`,onClick:u,type:`button`,children:e}),o.renderModal?o.renderModal(p):(0,B.jsx)(La,{...p})]}):(0,B.jsx)(`a`,{className:a(`wrap-anywhere font-medium text-primary underline`,t),"data-incomplete":l,"data-streamdown":`link`,href:n,rel:`noreferrer`,target:`_blank`,...i,children:e})},(e,t)=>Q(e,t)&&e.href===t.href);go.displayName=`MarkdownA`;var _o=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,B.jsx)(`h1`,{className:Y()(`mt-6 mb-2 font-semibold text-3xl`,t),"data-streamdown":`heading-1`,...r,children:e}),(e,t)=>Q(e,t));_o.displayName=`MarkdownH1`;var vo=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,B.jsx)(`h2`,{className:Y()(`mt-6 mb-2 font-semibold text-2xl`,t),"data-streamdown":`heading-2`,...r,children:e}),(e,t)=>Q(e,t));vo.displayName=`MarkdownH2`;var yo=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,B.jsx)(`h3`,{className:Y()(`mt-6 mb-2 font-semibold text-xl`,t),"data-streamdown":`heading-3`,...r,children:e}),(e,t)=>Q(e,t));yo.displayName=`MarkdownH3`;var bo=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,B.jsx)(`h4`,{className:Y()(`mt-6 mb-2 font-semibold text-lg`,t),"data-streamdown":`heading-4`,...r,children:e}),(e,t)=>Q(e,t));bo.displayName=`MarkdownH4`;var xo=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,B.jsx)(`h5`,{className:Y()(`mt-6 mb-2 font-semibold text-base`,t),"data-streamdown":`heading-5`,...r,children:e}),(e,t)=>Q(e,t));xo.displayName=`MarkdownH5`;var So=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,B.jsx)(`h6`,{className:Y()(`mt-6 mb-2 font-semibold text-sm`,t),"data-streamdown":`heading-6`,...r,children:e}),(e,t)=>Q(e,t));So.displayName=`MarkdownH6`;var Co=(0,k.memo)(({children:e,className:t,node:n,...r})=>{let{controls:i}=(0,k.useContext)($);return(0,B.jsx)(eo,{className:t,showControls:oo(i,`table`),showCopy:so(i,`copy`),showDownload:so(i,`download`),showFullscreen:so(i,`fullscreen`),...r,children:e})},(e,t)=>Q(e,t));Co.displayName=`MarkdownTable`;var wo=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,B.jsx)(`thead`,{className:Y()(`bg-muted/80`,t),"data-streamdown":`table-header`,...r,children:e}),(e,t)=>Q(e,t));wo.displayName=`MarkdownThead`;var To=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,B.jsx)(`tbody`,{className:Y()(`divide-y divide-border`,t),"data-streamdown":`table-body`,...r,children:e}),(e,t)=>Q(e,t));To.displayName=`MarkdownTbody`;var Eo=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,B.jsx)(`tr`,{className:Y()(`border-border`,t),"data-streamdown":`table-row`,...r,children:e}),(e,t)=>Q(e,t));Eo.displayName=`MarkdownTr`;var Do=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,B.jsx)(`th`,{className:Y()(`whitespace-nowrap px-4 py-2 text-left font-semibold text-sm`,t),"data-streamdown":`table-header-cell`,...r,children:e}),(e,t)=>Q(e,t));Do.displayName=`MarkdownTh`;var Oo=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,B.jsx)(`td`,{className:Y()(`px-4 py-2 text-sm`,t),"data-streamdown":`table-cell`,...r,children:e}),(e,t)=>Q(e,t));Oo.displayName=`MarkdownTd`;var ko=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,B.jsx)(`blockquote`,{className:Y()(`my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic`,t),"data-streamdown":`blockquote`,...r,children:e}),(e,t)=>Q(e,t));ko.displayName=`MarkdownBlockquote`;var Ao=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,B.jsx)(`sup`,{className:Y()(`text-sm`,t),"data-streamdown":`superscript`,...r,children:e}),(e,t)=>Q(e,t));Ao.displayName=`MarkdownSup`;var jo=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,B.jsx)(`sub`,{className:Y()(`text-sm`,t),"data-streamdown":`subscript`,...r,children:e}),(e,t)=>Q(e,t));jo.displayName=`MarkdownSub`;var Mo=(0,k.memo)(({children:e,className:t,node:n,...r})=>{if(`data-footnotes`in r){let n=e=>{if(!(0,k.isValidElement)(e))return!1;let t=Array.isArray(e.props.children)?e.props.children:[e.props.children],n=!1,r=!1;for(let e of t)if(e){if(typeof e==`string`)e.trim()!==``&&(n=!0);else if((0,k.isValidElement)(e))if(e.props?.[`data-footnote-backref`]!==void 0)r=!0;else{let t=Array.isArray(e.props.children)?e.props.children:[e.props.children];for(let e of t){if(typeof e==`string`&&e.trim()!==``){n=!0;break}if((0,k.isValidElement)(e)&&e.props?.[`data-footnote-backref`]===void 0){n=!0;break}}}}return r&&!n},i=Array.isArray(e)?e.map(e=>{if(!(0,k.isValidElement)(e))return e;if(e.type===uo){let t=(Array.isArray(e.props.children)?e.props.children:[e.props.children]).filter(e=>!n(e));return t.length===0?null:{...e,props:{...e.props,children:t}}}return e}):e;return(Array.isArray(i)?i.some(e=>e!==null):i!==null)?(0,B.jsx)(`section`,{className:t,...r,children:i}):null}return(0,B.jsx)(`section`,{className:t,...r,children:e})},(e,t)=>Q(e,t));Mo.displayName=`MarkdownSection`;var No=(0,k.memo)(({node:e,className:t,children:n,...r})=>{let i=Y(),a=!(`data-block`in r),{mermaid:o,controls:s,lineNumbers:c}=(0,k.useContext)($),l=Va(),u=oa(),d=(t?.match(io))?.at(1)??``,f=Ha(d);if(a)return(0,B.jsx)(`code`,{className:i(`rounded bg-muted px-1.5 py-0.5 font-mono text-sm`,t),"data-streamdown":`inline-code`,...r,children:n});let p=e?.properties?.metastring,m=p?.match(to),h=m?Number.parseInt(m[1],10):void 0,g=h!==void 0&&h>=1?h:void 0,_=!(p&&no.test(p))&&c!==!1,v=``;if((0,k.isValidElement)(n)&&n.props&&typeof n.props==`object`&&`children`in n.props&&typeof n.props.children==`string`?v=n.props.children:typeof n==`string`&&(v=n),f){let e=f.component;return(0,B.jsx)(k.Suspense,{fallback:(0,B.jsx)(ja,{}),children:(0,B.jsx)(e,{code:v,isIncomplete:u,language:d,meta:p})})}if(d===`mermaid`&&l){let e=oo(s,`mermaid`),n=lo(s,`download`),r=lo(s,`copy`),a=lo(s,`fullscreen`),c=lo(s,`panZoom`),l=e&&(n||r||a);return(0,B.jsx)(k.Suspense,{fallback:(0,B.jsx)(ja,{}),children:(0,B.jsxs)(`div`,{className:i(`group relative my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2`,t),"data-streamdown":`mermaid-block`,children:[(0,B.jsx)(`div`,{className:i(`flex h-8 items-center text-muted-foreground text-xs`),children:(0,B.jsx)(`span`,{className:i(`ml-1 font-mono lowercase`),children:`mermaid`})}),l?(0,B.jsx)(`div`,{className:i(`pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end`),children:(0,B.jsxs)(`div`,{className:i(`pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur`),"data-streamdown":`mermaid-block-actions`,children:[n?(0,B.jsx)(Wa,{chart:v,config:o?.config}):null,r?(0,B.jsx)(Oa,{code:v}):null,a?(0,B.jsx)(Ga,{chart:v,config:o?.config}):null]})}):null,(0,B.jsx)(`div`,{className:i(`rounded-md border border-border bg-background`),children:(0,B.jsx)(ro,{chart:v,config:o?.config,showControls:c})})]})})}let y=oo(s,`code`),b=co(s,`download`),x=co(s,`copy`);return(0,B.jsx)(xa,{className:t,code:v,isIncomplete:u,language:d,lineNumbers:_,startLine:g,children:y?(0,B.jsxs)(B.Fragment,{children:[b?(0,B.jsx)(Aa,{code:v,language:d}):null,x?(0,B.jsx)(Oa,{}):null]}):null})},(e,t)=>e.className===t.className&&ao(e.node,t.node));No.displayName=`MarkdownCode`;var Po=(0,k.memo)(Na,(e,t)=>e.className===t.className&&ao(e.node,t.node));Po.displayName=`MarkdownImg`;var Fo=(0,k.memo)(({children:e,node:t,...n})=>{let r=(Array.isArray(e)?e:[e]).filter(e=>e!=null&&e!==``);if(r.length===1&&(0,k.isValidElement)(r[0])){let t=r[0].props.node?.tagName;if(t===`img`||t===`code`&&`data-block`in r[0].props)return(0,B.jsx)(B.Fragment,{children:e})}return(0,B.jsx)(`p`,{...n,children:e})},(e,t)=>Q(e,t));Fo.displayName=`MarkdownParagraph`;var Io={ol:uo,li:fo,ul:po,hr:mo,strong:ho,a:go,h1:_o,h2:vo,h3:yo,h4:bo,h5:xo,h6:So,table:Co,thead:wo,tbody:To,tr:Eo,th:Do,td:Oo,blockquote:ko,code:No,img:Po,pre:({children:e})=>(0,k.isValidElement)(e)?(0,k.cloneElement)(e,{"data-block":`true`}):e,sup:Ao,sub:jo,p:Fo,section:Mo},Lo=/[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/,Ro=/\p{L}/u;function zo(e){let t=e.replace(/^#{1,6}\s+/gm,``).replace(/(\*{1,3}|_{1,3})/g,``).replace(/`[^`]*`/g,``).replace(/\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/^[\s>*\-+\d.]+/gm,``);for(let e of t){if(Lo.test(e))return`rtl`;if(Ro.test(e))return`ltr`}return`ltr`}var Bo=/^[ \t]{0,3}(`{3,}|~{3,})/,Vo=/^\|?[ \t]*:?-{1,}:?[ \t]*(\|[ \t]*:?-{1,}:?[ \t]*)*\|?$/,Ho=e=>{let t=e.split(`
|
|
91
|
+
`)},Za=({children:e,className:t,onCopy:n,onError:r,timeout:i=2e3})=>{let a=Y(),[o,s]=(0,k.useState)(!1),[c,l]=(0,k.useState)(!1),u=(0,k.useRef)(null),d=(0,k.useRef)(0),{isAnimating:f}=(0,k.useContext)($),p=Z(),m=async e=>{var t;if(typeof window>`u`||!((t=navigator==null?void 0:navigator.clipboard)!=null&&t.write)){r?.(Error(`Clipboard API not available`));return}try{let t=(u.current?.closest(`[data-streamdown="table-wrapper"]`))?.querySelector(`table`);if(!t){r?.(Error(`Table not found`));return}let a=Ka(t),o=({csv:qa,tsv:Ja,md:Xa}[e]||Xa)(a),c=new ClipboardItem({"text/plain":new Blob([o],{type:`text/plain`}),"text/html":new Blob([t.outerHTML],{type:`text/html`})});await navigator.clipboard.write([c]),l(!0),s(!1),n?.(e),d.current=window.setTimeout(()=>l(!1),i)}catch(e){r?.(e)}};(0,k.useEffect)(()=>{let e=e=>{let t=e.composedPath();u.current&&!t.includes(u.current)&&s(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e),window.clearTimeout(d.current)}},[]);let h=X(),g=c?h.CheckIcon:h.CopyIcon;return(0,B.jsxs)(`div`,{className:a(`relative`),ref:u,children:[(0,B.jsx)(`button`,{className:a(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:f,onClick:()=>s(!o),title:p.copyTable,type:`button`,children:e??(0,B.jsx)(g,{height:14,width:14})}),o?(0,B.jsxs)(`div`,{className:a(`absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,B.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`md`),title:p.copyTableAsMarkdown,type:`button`,children:p.tableFormatMarkdown}),(0,B.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`csv`),title:p.copyTableAsCsv,type:`button`,children:p.tableFormatCsv}),(0,B.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`tsv`),title:p.copyTableAsTsv,type:`button`,children:p.tableFormatTsv})]}):null]})},Qa=({children:e,className:t,onDownload:n,onError:r})=>{let i=Y(),[a,o]=(0,k.useState)(!1),s=(0,k.useRef)(null),{isAnimating:c}=(0,k.useContext)($),l=Z(),u=X(),d=e=>{try{let t=(s.current?.closest(`[data-streamdown="table-wrapper"]`))?.querySelector(`table`);if(!t){r?.(Error(`Table not found`));return}let i=Ka(t),a=e===`csv`?qa(i):Xa(i);ua(`table.${e===`csv`?`csv`:`md`}`,a,e===`csv`?`text/csv`:`text/markdown`),o(!1),n?.(e)}catch(e){r?.(e)}};return(0,k.useEffect)(()=>{let e=e=>{let t=e.composedPath();s.current&&!t.includes(s.current)&&o(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),(0,B.jsxs)(`div`,{className:i(`relative`),ref:s,children:[(0,B.jsx)(`button`,{className:i(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:c,onClick:()=>o(!a),title:l.downloadTable,type:`button`,children:e??(0,B.jsx)(u.DownloadIcon,{size:14})}),a?(0,B.jsxs)(`div`,{className:i(`absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,B.jsx)(`button`,{className:i(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>d(`csv`),title:l.downloadTableAsCsv,type:`button`,children:l.tableFormatCsv}),(0,B.jsx)(`button`,{className:i(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>d(`markdown`),title:l.downloadTableAsMarkdown,type:`button`,children:l.tableFormatMarkdown})]}):null]})},$a=({children:e,className:t,showCopy:n=!0,showDownload:r=!0})=>{let{Maximize2Icon:i,XIcon:a}=X(),o=Y(),[s,c]=(0,k.useState)(!1),{isAnimating:l}=(0,k.useContext)($),u=Z(),d=()=>{c(!0)},f=()=>{c(!1)};return(0,k.useEffect)(()=>{if(s){Fa();let e=e=>{e.key===`Escape`&&c(!1)};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),Ia()}}},[s]),(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`button`,{className:o(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:l,onClick:d,title:u.viewFullscreen,type:`button`,children:(0,B.jsx)(i,{size:14})}),s?(0,xr.createPortal)((0,B.jsx)(`div`,{"aria-label":u.viewFullscreen,"aria-modal":`true`,className:o(`fixed inset-0 z-50 flex flex-col bg-background`),"data-streamdown":`table-fullscreen`,onClick:f,onKeyDown:e=>{e.key===`Escape`&&f()},role:`dialog`,children:(0,B.jsxs)(`div`,{className:o(`flex h-full flex-col`),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:[(0,B.jsxs)(`div`,{className:o(`flex items-center justify-end gap-1 p-4`),children:[n?(0,B.jsx)(Za,{}):null,r?(0,B.jsx)(Qa,{}):null,(0,B.jsx)(`button`,{className:o(`rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`),onClick:f,title:u.exitFullscreen,type:`button`,children:(0,B.jsx)(a,{size:20})})]}),(0,B.jsx)(`div`,{className:o(`flex-1 overflow-auto p-4 pt-0 [&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10`),children:(0,B.jsx)(`table`,{className:o(`w-full border-collapse border border-border`),"data-streamdown":`table`,children:e})})]})}),document.body):null]})},eo=({children:e,className:t,showControls:n,showCopy:r=!0,showDownload:i=!0,showFullscreen:a=!0,...o})=>{let s=Y(),c=n&&r,l=n&&i,u=n&&a,d=c||l||u;return(0,B.jsxs)(`div`,{className:s(`my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2`),"data-streamdown":`table-wrapper`,children:[d?(0,B.jsxs)(`div`,{className:s(`flex items-center justify-end gap-1`),children:[c?(0,B.jsx)(Za,{}):null,l?(0,B.jsx)(Qa,{}):null,u?(0,B.jsx)($a,{showCopy:c,showDownload:l,children:e}):null]}):null,(0,B.jsx)(`div`,{className:s(`border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background`),children:(0,B.jsx)(`table`,{className:s(`w-full divide-y divide-border`,t),"data-streamdown":`table`,...o,children:e})})]})},to=/startLine=(\d+)/,no=/\bnoLineNumbers\b/,ro=(0,k.lazy)(()=>n(()=>import(`./mermaid-GHXKKRXX-CTQTYtGv.js`).then(e=>({default:e.Mermaid})),[],import.meta.url)),io=/language-([^\s]+)/;function ao(e,t){if(!(e!=null&&e.position||t!=null&&t.position))return!0;if(!(e!=null&&e.position&&t!=null&&t.position))return!1;let n=e.position.start,r=t.position.start,i=e.position.end,a=t.position.end;return n?.line===r?.line&&n?.column===r?.column&&i?.line===a?.line&&i?.column===a?.column}function Q(e,t){return e.className===t.className&&ao(e.node,t.node)}var oo=(e,t)=>typeof e==`boolean`?e:e[t]!==!1,so=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.table;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},co=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.code;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},lo=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.mermaid;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},uo=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,B.jsx)(`ol`,{className:Y()(`list-inside list-decimal whitespace-normal [li_&]:pl-6`,t),"data-streamdown":`ordered-list`,...r,children:e}),(e,t)=>Q(e,t));uo.displayName=`MarkdownOl`;var fo=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,B.jsx)(`li`,{className:Y()(`py-1 [&>p]:inline`,t),"data-streamdown":`list-item`,...r,children:e}),(e,t)=>e.className===t.className&&ao(e.node,t.node));fo.displayName=`MarkdownLi`;var po=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,B.jsx)(`ul`,{className:Y()(`list-inside list-disc whitespace-normal [li_&]:pl-6`,t),"data-streamdown":`unordered-list`,...r,children:e}),(e,t)=>Q(e,t));po.displayName=`MarkdownUl`;var mo=(0,k.memo)(({className:e,node:t,...n})=>(0,B.jsx)(`hr`,{className:Y()(`my-6 border-border`,e),"data-streamdown":`horizontal-rule`,...n}),(e,t)=>Q(e,t));mo.displayName=`MarkdownHr`;var ho=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,B.jsx)(`span`,{className:Y()(`font-semibold`,t),"data-streamdown":`strong`,...r,children:e}),(e,t)=>Q(e,t));ho.displayName=`MarkdownStrong`;var go=(0,k.memo)(({children:e,className:t,href:n,node:r,...i})=>{let a=Y(),{linkSafety:o}=(0,k.useContext)($),[s,c]=(0,k.useState)(!1),l=n===`streamdown:incomplete-link`,u=(0,k.useCallback)(async e=>{if(!(!(o!=null&&o.enabled&&n)||l)){if(e.preventDefault(),o.onLinkCheck&&await o.onLinkCheck(n)){window.open(n,`_blank`,`noreferrer`);return}c(!0)}},[o,n,l]),d=(0,k.useCallback)(()=>{n&&window.open(n,`_blank`,`noreferrer`)},[n]),f=(0,k.useCallback)(()=>{c(!1)},[]),p={url:n??``,isOpen:s,onClose:f,onConfirm:d};return o!=null&&o.enabled&&n?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`button`,{className:a(`wrap-anywhere appearance-none text-left font-medium text-primary underline`,t),"data-incomplete":l,"data-streamdown":`link`,onClick:u,type:`button`,children:e}),o.renderModal?o.renderModal(p):(0,B.jsx)(La,{...p})]}):(0,B.jsx)(`a`,{className:a(`wrap-anywhere font-medium text-primary underline`,t),"data-incomplete":l,"data-streamdown":`link`,href:n,rel:`noreferrer`,target:`_blank`,...i,children:e})},(e,t)=>Q(e,t)&&e.href===t.href);go.displayName=`MarkdownA`;var _o=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,B.jsx)(`h1`,{className:Y()(`mt-6 mb-2 font-semibold text-3xl`,t),"data-streamdown":`heading-1`,...r,children:e}),(e,t)=>Q(e,t));_o.displayName=`MarkdownH1`;var vo=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,B.jsx)(`h2`,{className:Y()(`mt-6 mb-2 font-semibold text-2xl`,t),"data-streamdown":`heading-2`,...r,children:e}),(e,t)=>Q(e,t));vo.displayName=`MarkdownH2`;var yo=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,B.jsx)(`h3`,{className:Y()(`mt-6 mb-2 font-semibold text-xl`,t),"data-streamdown":`heading-3`,...r,children:e}),(e,t)=>Q(e,t));yo.displayName=`MarkdownH3`;var bo=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,B.jsx)(`h4`,{className:Y()(`mt-6 mb-2 font-semibold text-lg`,t),"data-streamdown":`heading-4`,...r,children:e}),(e,t)=>Q(e,t));bo.displayName=`MarkdownH4`;var xo=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,B.jsx)(`h5`,{className:Y()(`mt-6 mb-2 font-semibold text-base`,t),"data-streamdown":`heading-5`,...r,children:e}),(e,t)=>Q(e,t));xo.displayName=`MarkdownH5`;var So=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,B.jsx)(`h6`,{className:Y()(`mt-6 mb-2 font-semibold text-sm`,t),"data-streamdown":`heading-6`,...r,children:e}),(e,t)=>Q(e,t));So.displayName=`MarkdownH6`;var Co=(0,k.memo)(({children:e,className:t,node:n,...r})=>{let{controls:i}=(0,k.useContext)($);return(0,B.jsx)(eo,{className:t,showControls:oo(i,`table`),showCopy:so(i,`copy`),showDownload:so(i,`download`),showFullscreen:so(i,`fullscreen`),...r,children:e})},(e,t)=>Q(e,t));Co.displayName=`MarkdownTable`;var wo=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,B.jsx)(`thead`,{className:Y()(`bg-muted/80`,t),"data-streamdown":`table-header`,...r,children:e}),(e,t)=>Q(e,t));wo.displayName=`MarkdownThead`;var To=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,B.jsx)(`tbody`,{className:Y()(`divide-y divide-border`,t),"data-streamdown":`table-body`,...r,children:e}),(e,t)=>Q(e,t));To.displayName=`MarkdownTbody`;var Eo=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,B.jsx)(`tr`,{className:Y()(`border-border`,t),"data-streamdown":`table-row`,...r,children:e}),(e,t)=>Q(e,t));Eo.displayName=`MarkdownTr`;var Do=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,B.jsx)(`th`,{className:Y()(`whitespace-nowrap px-4 py-2 text-left font-semibold text-sm`,t),"data-streamdown":`table-header-cell`,...r,children:e}),(e,t)=>Q(e,t));Do.displayName=`MarkdownTh`;var Oo=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,B.jsx)(`td`,{className:Y()(`px-4 py-2 text-sm`,t),"data-streamdown":`table-cell`,...r,children:e}),(e,t)=>Q(e,t));Oo.displayName=`MarkdownTd`;var ko=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,B.jsx)(`blockquote`,{className:Y()(`my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic`,t),"data-streamdown":`blockquote`,...r,children:e}),(e,t)=>Q(e,t));ko.displayName=`MarkdownBlockquote`;var Ao=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,B.jsx)(`sup`,{className:Y()(`text-sm`,t),"data-streamdown":`superscript`,...r,children:e}),(e,t)=>Q(e,t));Ao.displayName=`MarkdownSup`;var jo=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,B.jsx)(`sub`,{className:Y()(`text-sm`,t),"data-streamdown":`subscript`,...r,children:e}),(e,t)=>Q(e,t));jo.displayName=`MarkdownSub`;var Mo=(0,k.memo)(({children:e,className:t,node:n,...r})=>{if(`data-footnotes`in r){let n=e=>{if(!(0,k.isValidElement)(e))return!1;let t=Array.isArray(e.props.children)?e.props.children:[e.props.children],n=!1,r=!1;for(let e of t)if(e){if(typeof e==`string`)e.trim()!==``&&(n=!0);else if((0,k.isValidElement)(e))if(e.props?.[`data-footnote-backref`]!==void 0)r=!0;else{let t=Array.isArray(e.props.children)?e.props.children:[e.props.children];for(let e of t){if(typeof e==`string`&&e.trim()!==``){n=!0;break}if((0,k.isValidElement)(e)&&e.props?.[`data-footnote-backref`]===void 0){n=!0;break}}}}return r&&!n},i=Array.isArray(e)?e.map(e=>{if(!(0,k.isValidElement)(e))return e;if(e.type===uo){let t=(Array.isArray(e.props.children)?e.props.children:[e.props.children]).filter(e=>!n(e));return t.length===0?null:{...e,props:{...e.props,children:t}}}return e}):e;return(Array.isArray(i)?i.some(e=>e!==null):i!==null)?(0,B.jsx)(`section`,{className:t,...r,children:i}):null}return(0,B.jsx)(`section`,{className:t,...r,children:e})},(e,t)=>Q(e,t));Mo.displayName=`MarkdownSection`;var No=(0,k.memo)(({node:e,className:t,children:n,...r})=>{let i=Y(),a=!(`data-block`in r),{mermaid:o,controls:s,lineNumbers:c}=(0,k.useContext)($),l=Va(),u=oa(),d=(t?.match(io))?.at(1)??``,f=Ha(d);if(a)return(0,B.jsx)(`code`,{className:i(`rounded bg-muted px-1.5 py-0.5 font-mono text-sm`,t),"data-streamdown":`inline-code`,...r,children:n});let p=e?.properties?.metastring,m=p?.match(to),h=m?Number.parseInt(m[1],10):void 0,g=h!==void 0&&h>=1?h:void 0,_=!(p&&no.test(p))&&c!==!1,v=``;if((0,k.isValidElement)(n)&&n.props&&typeof n.props==`object`&&`children`in n.props&&typeof n.props.children==`string`?v=n.props.children:typeof n==`string`&&(v=n),f){let e=f.component;return(0,B.jsx)(k.Suspense,{fallback:(0,B.jsx)(ja,{}),children:(0,B.jsx)(e,{code:v,isIncomplete:u,language:d,meta:p})})}if(d===`mermaid`&&l){let e=oo(s,`mermaid`),n=lo(s,`download`),r=lo(s,`copy`),a=lo(s,`fullscreen`),c=lo(s,`panZoom`),l=e&&(n||r||a);return(0,B.jsx)(k.Suspense,{fallback:(0,B.jsx)(ja,{}),children:(0,B.jsxs)(`div`,{className:i(`group relative my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2`,t),"data-streamdown":`mermaid-block`,children:[(0,B.jsx)(`div`,{className:i(`flex h-8 items-center text-muted-foreground text-xs`),children:(0,B.jsx)(`span`,{className:i(`ml-1 font-mono lowercase`),children:`mermaid`})}),l?(0,B.jsx)(`div`,{className:i(`pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end`),children:(0,B.jsxs)(`div`,{className:i(`pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur`),"data-streamdown":`mermaid-block-actions`,children:[n?(0,B.jsx)(Wa,{chart:v,config:o?.config}):null,r?(0,B.jsx)(Oa,{code:v}):null,a?(0,B.jsx)(Ga,{chart:v,config:o?.config}):null]})}):null,(0,B.jsx)(`div`,{className:i(`rounded-md border border-border bg-background`),children:(0,B.jsx)(ro,{chart:v,config:o?.config,showControls:c})})]})})}let y=oo(s,`code`),b=co(s,`download`),x=co(s,`copy`);return(0,B.jsx)(xa,{className:t,code:v,isIncomplete:u,language:d,lineNumbers:_,startLine:g,children:y?(0,B.jsxs)(B.Fragment,{children:[b?(0,B.jsx)(Aa,{code:v,language:d}):null,x?(0,B.jsx)(Oa,{}):null]}):null})},(e,t)=>e.className===t.className&&ao(e.node,t.node));No.displayName=`MarkdownCode`;var Po=(0,k.memo)(Na,(e,t)=>e.className===t.className&&ao(e.node,t.node));Po.displayName=`MarkdownImg`;var Fo=(0,k.memo)(({children:e,node:t,...n})=>{let r=(Array.isArray(e)?e:[e]).filter(e=>e!=null&&e!==``);if(r.length===1&&(0,k.isValidElement)(r[0])){let t=r[0].props.node?.tagName;if(t===`img`||t===`code`&&`data-block`in r[0].props)return(0,B.jsx)(B.Fragment,{children:e})}return(0,B.jsx)(`p`,{...n,children:e})},(e,t)=>Q(e,t));Fo.displayName=`MarkdownParagraph`;var Io={ol:uo,li:fo,ul:po,hr:mo,strong:ho,a:go,h1:_o,h2:vo,h3:yo,h4:bo,h5:xo,h6:So,table:Co,thead:wo,tbody:To,tr:Eo,th:Do,td:Oo,blockquote:ko,code:No,img:Po,pre:({children:e})=>(0,k.isValidElement)(e)?(0,k.cloneElement)(e,{"data-block":`true`}):e,sup:Ao,sub:jo,p:Fo,section:Mo},Lo=/[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/,Ro=/\p{L}/u;function zo(e){let t=e.replace(/^#{1,6}\s+/gm,``).replace(/(\*{1,3}|_{1,3})/g,``).replace(/`[^`]*`/g,``).replace(/\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/^[\s>*\-+\d.]+/gm,``);for(let e of t){if(Lo.test(e))return`rtl`;if(Ro.test(e))return`ltr`}return`ltr`}var Bo=/^[ \t]{0,3}(`{3,}|~{3,})/,Vo=/^\|?[ \t]*:?-{1,}:?[ \t]*(\|[ \t]*:?-{1,}:?[ \t]*)*\|?$/,Ho=e=>{let t=e.split(`
|
|
92
92
|
`),n=null,r=0;for(let e of t){let t=Bo.exec(e);if(n===null){if(t){let e=t[1];n=e[0],r=e.length}}else if(t){let e=t[1],i=e[0],a=e.length;i===n&&a>=r&&(n=null,r=0)}}return n!==null},Uo=e=>{let t=e.split(`
|
|
93
93
|
`);for(let e of t){let t=e.trim();if(t.length>0&&t.includes(`|`)&&Vo.test(t))return!0}return!1},Wo=()=>e=>{u(e,`html`,(e,t,n)=>{!n||typeof t!=`number`||(n.children[t]={type:`text`,value:e.value})})},Go=[],Ko={allowDangerousHtml:!0},qo=new WeakMap,Jo=new class{constructor(){this.cache=new Map,this.keyCache=new WeakMap,this.maxSize=100}generateCacheKey(e){let t=this.keyCache.get(e);if(t)return t;let n=e.rehypePlugins,r=e.remarkPlugins,i=e.remarkRehypeOptions;if(!(n||r||i)){let t=`default`;return this.keyCache.set(e,t),t}let a=e=>{if(!e||e.length===0)return``;let t=``;for(let n=0;n<e.length;n+=1){let r=e[n];if(n>0&&(t+=`,`),Array.isArray(r)){let[e,n]=r;if(typeof e==`function`){let n=qo.get(e);n||(n=e.name,qo.set(e,n)),t+=n}else t+=String(e);t+=`:`,t+=JSON.stringify(n)}else if(typeof r==`function`){let e=qo.get(r);e||(e=r.name,qo.set(r,e)),t+=e}else t+=String(r)}return t},o=a(n),s=`${a(r)}::${o}::${i?JSON.stringify(i):``}`;return this.keyCache.set(e,s),s}get(e){let t=this.generateCacheKey(e),n=this.cache.get(t);return n&&(this.cache.delete(t),this.cache.set(t,n)),n}set(e,t){let n=this.generateCacheKey(e);if(this.cache.size>=this.maxSize){let e=this.cache.keys().next().value;e&&this.cache.delete(e)}this.cache.set(n,t)}clear(){this.cache.clear()}},Yo=e=>{let t=Xo(e),n=e.children||``;return rs(t.runSync(t.parse(n),n),e)},Xo=e=>{let t=Jo.get(e);if(t)return t;let n=Qo(e);return Jo.set(e,n),n},Zo=e=>e.some(e=>Array.isArray(e)?e[0]===Ye:e===Ye),Qo=e=>{let t=e.rehypePlugins||Go,n=e.remarkPlugins||Go,r=Zo(t)?n:[...n,Wo],i=e.remarkRehypeOptions?{...Ko,...e.remarkRehypeOptions}:Ko;return d().use(p).use(r).use(ie,i).use(t)},$o=e=>e,es=(e,t,n,r)=>{n?e.children.splice(t,1):e.children[t]={type:`text`,value:r}},ts=(e,t)=>{for(let n in br)if(Object.hasOwn(br,n)&&Object.hasOwn(e.properties,n)){let r=e.properties[n],i=br[n];(i===null||i.includes(e.tagName))&&(e.properties[n]=t(String(r||``),n,e)??void 0)}},ns=(e,t,n,r,i,a)=>{let o=!1;return r?o=!r.includes(e.tagName):i&&(o=i.includes(e.tagName)),!o&&a&&typeof t==`number`&&(o=!a(e,t,n)),o},rs=(e,t)=>{let{allowElement:n,allowedElements:r,disallowedElements:i,skipHtml:a,unwrapDisallowed:o,urlTransform:s}=t;if(n||r||i||a||s){let t=s||$o;u(e,(e,s,c)=>{if(e.type===`raw`&&c&&typeof s==`number`)return es(c,s,a,e.value),s;if(e.type===`element`&&(ts(e,t),ns(e,s,c,r,i,n)&&c&&typeof s==`number`))return o&&e.children?c.children.splice(s,1,...e.children):c.children.splice(s,1),s})}return Qn(e,{Fragment:B.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:B.jsx,jsxs:B.jsxs,passKeys:!0,passNode:!0})},is=/\[\^[\w-]{1,200}\](?!:)/,as=/\[\^[\w-]{1,200}\]:/,os=/<(\w+)[\s>]/,ss=new Set([`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`]),cs=new Map,ls=new Map,us=e=>{let t=e.toLowerCase(),n=cs.get(t);if(n)return n;let r=RegExp(`<${t}(?=[\\s>/])[^>]*>`,`gi`);return cs.set(t,r),r},ds=e=>{let t=e.toLowerCase(),n=ls.get(t);if(n)return n;let r=RegExp(`</${t}(?=[\\s>])[^>]*>`,`gi`);return ls.set(t,r),r},fs=(e,t)=>{if(ss.has(t.toLowerCase()))return 0;let n=e.match(us(t));if(!n)return 0;let r=0;for(let e of n)e.trimEnd().endsWith(`/>`)||(r+=1);return r},ps=(e,t)=>{let n=e.match(ds(t));return n?n.length:0},ms=e=>{let t=0;for(let n=0;n<e.length-1;n+=1)e[n]===`$`&&e[n+1]===`$`&&(t+=1,n+=1);return t},hs=e=>{let t=is.test(e),n=as.test(e);if(t||n)return[e];let r=K.lex(e,{gfm:!0}),i=[],a=[],o=!1;for(let e of r){let t=e.raw,n=i.length;if(a.length>0){i[n-1]+=t;let e=a.at(-1),r=fs(t,e),o=ps(t,e);for(let t=0;t<r;t+=1)a.push(e);for(let t=0;t<o;t+=1)a.length>0&&a.at(-1)===e&&a.pop();continue}if(e.type===`html`&&e.block){let e=t.match(os);if(e){let n=e[1];fs(t,n)>ps(t,n)&&a.push(n)}}if(n>0&&!o){let e=i[n-1];if(ms(e)%2==1){i[n-1]=e+t;continue}}i.push(t),e.type!==`space`&&(o=e.type===`code`)}return i},gs=(e,t)=>{if(!t.length)return e;let n=e;for(let e of t){let t=RegExp(`(<${e}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${e}\\s*>)`,`gi`);n=n.replace(t,(e,t,n,r)=>{if(!n.includes(`
|
|
94
94
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=`ok.client.surface`,t={protocol:`x-ok-client-protocol`,runtime:`x-ok-client-runtime`,kind:`x-ok-client-kind`};function n({hasDesktopBridge:e,embeddedHost:t}){return e?`desktop`:t===null?`browser`:`embedded:${t}`}function r({kind:e,runtimeVersion:n}){return{[t.protocol]:`2`,[t.runtime]:n,[t.kind]:e}}function i({kind:e,runtimeVersion:t}){return{clientProtocolVersion:2,clientRuntimeVersion:t,clientKind:e}}var a={cursor:/\bCursor(?:\([^)]+\))?\/\d/,codex:/\bCodex(?:\([^)]+\))?\/\d/,"claude-desktop":/\bClaude(?:\([^)]+\))?\/\d/};function o(){if(typeof navigator>`u`)return null;let e=navigator.userAgent;for(let[t,n]of Object.entries(a))if(n.test(e))return t;return null}var s={BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_APP_VERSION:`0.89.10-beta.
|
|
1
|
+
var e=`ok.client.surface`,t={protocol:`x-ok-client-protocol`,runtime:`x-ok-client-runtime`,kind:`x-ok-client-kind`};function n({hasDesktopBridge:e,embeddedHost:t}){return e?`desktop`:t===null?`browser`:`embedded:${t}`}function r({kind:e,runtimeVersion:n}){return{[t.protocol]:`2`,[t.runtime]:n,[t.kind]:e}}function i({kind:e,runtimeVersion:t}){return{clientProtocolVersion:2,clientRuntimeVersion:t,clientKind:e}}var a={cursor:/\bCursor(?:\([^)]+\))?\/\d/,codex:/\bCodex(?:\([^)]+\))?\/\d/,"claude-desktop":/\bClaude(?:\([^)]+\))?\/\d/};function o(){if(typeof navigator>`u`)return null;let e=navigator.userAgent;for(let[t,n]of Object.entries(a))if(n.test(e))return t;return null}var s={BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_APP_VERSION:`0.89.10-beta.2`}?.VITE_APP_VERSION??`0.0.0-unknown`,c=n({hasDesktopBridge:typeof window<`u`&&window.okDesktop!==void 0,embeddedHost:o()});function l(){return r({kind:c,runtimeVersion:s})}function u(){return i({kind:c,runtimeVersion:s})}export{o as a,u as i,c as n,e as o,l as r,s as t};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as e}from"./constants-upload-kkBkFBty.js";import{Ct as t,I as n,J as r,M as i,t as a}from"./dist-DPg4Sze-.js";import{r as o}from"./desktop-bridge-bSzKDe_w.js";function s(e){if(typeof e!=`object`||!e||!Object.hasOwn(e,`escapedChars`))return{kind:`absent`};let t=e.escapedChars;return Array.isArray(t)&&t.every(e=>{if(typeof e!=`object`||!e)return!1;let t=e.offset;return typeof t==`number`&&Number.isInteger(t)&&t>=0&&typeof e.char==`string`})?{kind:`valid`,data:{escapedChars:t}}:{kind:`malformed`}}function c(e){return s(e).kind===`valid`}function l(e,t,n){return e[t]===`\\`&&t+1<e.length&&e[t+1]===n}function u(e,t,n,r){let i=t,a=0;for(;a<r&&i<e.length;){let t=a>0&&n[a-1]===`
|
|
2
|
+
`?f(e,i,n[a]):null;t!==null&&(i=t),i+=l(e,i,n[a])?2:1,a+=1}return i}function d(e,t,n){return e[t]===n||l(e,t,n)}function f(e,t,n){let r=t,i=!1;for(;;){let t=r;for(;r<e.length&&(e[r]===` `||e[r]===` `);)r+=1;if(e[r]===`>`){r+=1,(e[r]===` `||e[r]===` `)&&(r+=1),i=!0;continue}r>t&&(i=!0);break}return i&&d(e,r,n)?r:null}function p(e){return c(e.data)?new Set(e.data.escapedChars.map(e=>e.offset)):null}function m(e,t,n){return e.filter(e=>e.offset>=t&&e.offset<n).map(e=>({...e,offset:e.offset-t}))}function h(e,t,n){return e.filter(e=>e.offset>=t&&e.offset+e.length<=n).map(e=>({...e,offset:e.offset-t}))}function g(e,t,n,r){let i={type:`text`,value:t.value.slice(n,r)},a=b(e,t,n,r);a&&(i.position=a);let o;if(c(t.data)&&(o={escapedChars:m(t.data.escapedChars,n,r)}),t.data?.entityRefSpans?.length){let e=h(t.data.entityRefSpans,n,r);e.length>0&&(o={...o,entityRefSpans:e})}return o&&(i.data=o),i}function _(e,t,n){if(e===null||e.size===0)return!1;for(let r=0;r<n;r++)if(e.has(t+r))return!0;return!1}function v(e,t){let n=1,r=1;for(let i=0;i<t&&i<e.length;i++)e[i]===`
|
|
3
|
+
`?(n+=1,r=1):r+=1;return{line:n,column:r,offset:t}}function y(e,t,n){return{start:v(e,t),end:v(e,n)}}function b(e,t,n,r){if(!e||!t.position||typeof t.position.start?.offset!=`number`)return;let i=t.position.start.offset;return y(e,u(e,i,t.value,n),u(e,i,t.value,r))}var x=`[\\p{L}\\p{M}\\p{N}_/-]`,S=`(?:(?!\\p{DI})${x})`,C=`(?!\\p{DI})\\p{L}${S}*`,w=`(^|\\s)#(${C})(?!\\p{DI}*${x})`;function T(){return new RegExp(w,`gu`)}var E=T(),D=RegExp(`^${C}$`,`u`);function O(e,t=``){let n=[],r=!1;for(let i of e.children){if(i.type!==`text`){n.push(i);continue}let e=i.value,a=p(i);E.lastIndex=0;let o=[],s=0;for(;;){let n=E.exec(e);if(n===null)break;let c=n[1]??``,l=n[2]??``,u=n.index+c.length;if(_(a,u,1))continue;u>s&&o.push(g(t,i,s,u));let d={type:`tag`,value:l},f=b(t,i,u,u+1+l.length);f&&(d.position=f),o.push(d),s=u+1+l.length,r=!0}o.length===0?n.push(i):(s<e.length&&o.push(g(t,i,s,e.length)),n.push(...o))}r&&(e.children=n)}function k(e){if(typeof e!=`string`||!e.startsWith(`/`))return e;let t=globalThis.window?.okDesktop?.config?.apiOrigin;return typeof t==`string`&&t?t+e:e}function A(t,n){let r;try{r=new URL(t)}catch{return null}if(r.origin!==n)return null;let i=r.pathname.startsWith(`/`)?r.pathname.slice(1):r.pathname,a;try{a=decodeURIComponent(i)}catch{return null}if(!a)return null;let o=(a.split(`/`).pop()??``).match(/\.([a-z0-9]+)$/i);if(!o)return null;let s=(o[1]??``).toLowerCase();return s===`html`||s===`htm`||!e.has(s)?null:a}var j=new class{byExt=new Map;viewerUnregisterFns=new WeakMap;register(e){let t=this.viewerUnregisterFns.get(e);if(t)return t;for(let t of e.exts){let n=t.toLowerCase(),r=this.byExt.get(n);r&&r!==e&&console.warn(JSON.stringify({event:`asset-viewer-collision`,ext:n,priorExts:r.exts,newExts:e.exts})),this.byExt.set(n,e)}let n=!1,r=()=>{if(!n){n=!0;for(let t of e.exts){let n=t.toLowerCase();this.byExt.get(n)===e&&this.byExt.delete(n)}this.viewerUnregisterFns.delete(e)}};return this.viewerUnregisterFns.set(e,r),r}lookup(e){let t=this.byExt.get(e.toLowerCase());return t?{ok:!0,viewer:t}:{ok:!1}}clearForTests(){this.byExt.clear(),this.viewerUnregisterFns=new WeakMap}get size(){return this.byExt.size}};function M(e){globalThis.window?.open(e,`_blank`,`noopener,noreferrer`)}async function N(e,t={}){let n=t.registry??j,r=`desktopBridge`in t?t.desktopBridge:globalThis.window?.okDesktop,i=t.openUrl??M;if(!e.forceOsDelegation){let t=n.lookup(e.ext);if(t.ok){t.viewer.render(e);return}}if(r){let t=await r.shell.openAsset(e.projectRelPath);if(!t.ok){if(o(t.reason)){let t=await r.shell.revealAsset(e.projectRelPath);t.ok||console.warn(`[asset-dispatch] revealAsset failed:`,t.reason,{projectRelPath:e.projectRelPath,ext:e.ext});return}console.warn(`[asset-dispatch] openAsset refused:`,t.reason,{projectRelPath:e.projectRelPath,ext:e.ext})}return}i(e.url)}var P=new t;function F(e){return r.contentAttributes.of({"aria-label":e})}function I(e){return P.of(F(e))}function L(e,t){e.dispatch({effects:P.reconfigure(F(t))})}var R=a.define([{tag:[n.heading,n.heading1,n.heading2,n.heading3],color:`var(--syntax-func)`,fontWeight:`bold`},{tag:[n.heading4,n.heading5,n.heading6],color:`var(--syntax-func)`},{tag:n.strong,fontWeight:`bold`,color:`var(--foreground)`},{tag:n.emphasis,fontStyle:`italic`,color:`var(--foreground)`},{tag:n.strikethrough,textDecoration:`line-through`},{tag:n.link,color:`var(--link-color)`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:n.url,color:`var(--syntax-attr)`},{tag:n.monospace,color:`var(--syntax-string)`},{tag:n.quote,color:`var(--syntax-comment)`,fontStyle:`italic`},{tag:n.list,color:`var(--syntax-keyword)`},{tag:n.contentSeparator,color:`var(--syntax-comment)`},{tag:n.processingInstruction,color:`var(--muted-foreground)`},{tag:[n.comment,n.lineComment,n.blockComment],color:`var(--syntax-comment)`,fontStyle:`italic`},{tag:[n.meta,n.annotation,n.namespace],color:`var(--syntax-meta)`},{tag:n.docComment,color:`var(--syntax-comment)`,fontStyle:`italic`},{tag:[n.keyword,n.controlKeyword,n.moduleKeyword,n.operatorKeyword],color:`var(--syntax-keyword)`,fontWeight:`600`},{tag:[n.modifier,n.self],color:`var(--syntax-keyword)`},{tag:n.tagName,color:`var(--syntax-tag)`},{tag:[n.typeName,n.className],color:`var(--syntax-type)`},{tag:[n.attributeName,n.propertyName],color:`var(--syntax-attr)`},{tag:[n.variableName,n.macroName],color:`var(--syntax-var)`},{tag:[n.function(n.variableName),n.definition(n.name),n.labelName],color:`var(--syntax-func)`},{tag:[n.string,n.character,n.special(n.string)],color:`var(--syntax-string)`},{tag:[n.number,n.integer,n.float,n.literal],color:`var(--syntax-number)`},{tag:[n.bool,n.null,n.atom,n.constant(n.name),n.standard(n.name)],color:`var(--syntax-atom)`},{tag:[n.regexp,n.escape],color:`var(--syntax-atom)`},{tag:n.color,color:`var(--syntax-atom)`},{tag:[n.operator,n.punctuation,n.separator,n.bracket,n.brace,n.paren,n.squareBracket,n.angleBracket],color:`var(--syntax-operator)`},{tag:n.inserted,color:`var(--diff-added)`},{tag:n.deleted,color:`var(--diff-removed)`},{tag:n.changed,color:`var(--syntax-number)`},{tag:n.invalid,color:`var(--destructive)`}]);function z(e){let t=e.background??`transparent`,n=e.gutterBackground??`transparent`;return r.theme({"&":{color:`var(--foreground)`,backgroundColor:t},".cm-content":{caretColor:`var(--foreground)`},".cm-cursor, .cm-dropCursor":{borderLeftColor:`var(--foreground)`},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:`var(--selection-soft)`},".cm-selectionMatch":{backgroundColor:`color-mix(in oklab, var(--syntax-type) 30%, transparent)`},".cm-gutters":{backgroundColor:n,color:`var(--muted-foreground)`,border:`none`},".cm-activeLine":{backgroundColor:`color-mix(in oklab, var(--foreground) 4%, transparent)`},".cm-activeLineGutter":{backgroundColor:`transparent`,color:`var(--foreground)`},".cm-foldPlaceholder":{backgroundColor:`var(--muted)`,color:`var(--muted-foreground)`,border:`none`},".cm-panels":{backgroundColor:`var(--popover)`,color:`var(--popover-foreground)`},".cm-searchMatch":{backgroundColor:`color-mix(in oklab, var(--syntax-type) 30%, transparent)`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:`color-mix(in oklab, var(--primary) 40%, transparent)`}},{dark:e.dark})}function B(e){return[z(e),i(R,{fallback:!0})]}export{s as _,N as a,C as c,O as d,b as f,g,_ as h,L as i,D as l,c as m,R as n,A as o,p,I as r,k as s,B as t,S as u};
|
package/dist/public/assets/{code-highlighter-impl-DAaUGe7G.js → code-highlighter-impl-B8pGTITV.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./javascript-3_t04LfW.js";import{t}from"./css-1GA9sewS.js";import{t as n}from"./html-B5umRcfp.js";import{t as r}from"./json-vyNcbgn3.js";import{t as i}from"./tsx-Dsg_3XHP.js";import{t as a}from"./sql-qyIX8k-y.js";import o from"./python-BryqnXmh.js";import{t as s}from"./shellscript-DuS0zF19.js";import c from"./diff-BZHrrlix.js";import{t as l}from"./docker-2mLFFUe5.js";import{t as u}from"./yaml-BQ3IebHW.js";import d from"./markdown-DuSbcbH1.js";import f from"./go-DpvXpI72.js";import p from"./rust-lJ_OhiY8.js";import m from"./toml-BpEaDYlW.js";import{r as h,t as g}from"./engine-compile-
|
|
1
|
+
import{t as e}from"./javascript-3_t04LfW.js";import{t}from"./css-1GA9sewS.js";import{t as n}from"./html-B5umRcfp.js";import{t as r}from"./json-vyNcbgn3.js";import{t as i}from"./tsx-Dsg_3XHP.js";import{t as a}from"./sql-qyIX8k-y.js";import o from"./python-BryqnXmh.js";import{t as s}from"./shellscript-DuS0zF19.js";import c from"./diff-BZHrrlix.js";import{t as l}from"./docker-2mLFFUe5.js";import{t as u}from"./yaml-BQ3IebHW.js";import d from"./markdown-DuSbcbH1.js";import f from"./go-DpvXpI72.js";import p from"./rust-lJ_OhiY8.js";import m from"./toml-BpEaDYlW.js";import{r as h,t as g}from"./engine-compile-DCXqaKj1.js";import{n as _,t as v}from"./ok-syntax-theme-8liHuuQb.js";var y=null;function b(){return y??=h({themes:[_],langs:[t,c,l,f,n,e,r,d,o,p,s,a,m,i,u],engine:g({forgiving:!0})}).catch(e=>{throw y=null,e}),y}async function x(e,t){let n=await b(),r=n.getLoadedLanguages().includes(t)?t:`text`;return n.codeToTokens(e,{lang:r,theme:v})}export{x as tokenize};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{L as n}from"./Mermaid-
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{L as n}from"./Mermaid-BiYl2hf6.js";import{t as r}from"./react-f2sANaYj.js";import{n as i,r as a}from"./dist-Nvb76hAm.js";import{t as o}from"./compiler-runtime-BfE3aGVn.js";import{t as s}from"./utils-CPqDy6Hr.js";import{i as c,n as l,t as u}from"./tooltip-BjuCvy5N.js";import{t as d}from"./button-DzgjsZzC.js";import{Fr as f,Jn as p,Pr as m,Qn as h,Vr as g,Xn as _,di as v,er as y,ii as b,qn as x,si as S,tr as C}from"./DocumentContext-Wb9BCFqj.js";import{n as w}from"./dist-Bs8bPT30.js";import{t as T}from"./dist-XgwTV-oh2.js";import{Tt as ee}from"./schemas-api-C0HskKob.js";import{t as te}from"./createLucideIcon-CB3nKwwz.js";import{hr as E,mr as ne}from"./CodeMirrorPropInput-Cmp5Nj4G.js";import{t as re}from"./x-B-DmMnJT.js";import{u as D}from"./doc-hash-BDtDlqpM.js";var ie=te(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),O=o(),ae=e(r(),1),k=`ok-properties-collapsed-v1`,A=!1;function j(){if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}var M=null,N=new Set;function oe(){let e=j();if(!e)return A;try{let t=e.getItem(k);return t===`true`?!0:t===`false`?!1:A}catch{return A}}function P(){return M===null&&(M=oe()),M}function se(e){let t=j();if(t)try{t.setItem(k,e?`true`:`false`)}catch{}}function ce(){for(let e of N)e()}function F(){return P()}function le(e){P()!==e&&(M=e,se(e),ce())}function ue(e){return N.add(e),()=>{N.delete(e)}}function de(){let e=(0,O.c)(2),t=(0,ae.useSyncExternalStore)(ue,F,fe),n;return e[0]===t?n=e[1]:(n=[t,le],e[0]=t,e[1]=n),n}function fe(){return A}var pe=`var(--ok-comment-hue, rgb(37 99 235))`,me={fill:.22,line:ee},he={fill:.45,line:1},ge=.45;function I(e){return`color-mix(in srgb,${pe} ${e*100}%,transparent)`}function _e(e,t){let{fill:n,line:r}=t?he:me;return[`border-radius:2px`,`padding-bottom:1px`,...e.id===null?[]:[`cursor:pointer`],`background-color:${I(n)}`,`box-shadow:inset 0 -2px 0 ${I(r)}`,``].join(`;`)}function ve(e){return e.map(e=>e.id??`·`).join(`|`)}function ye(e){let t=null;for(let n of e)n.id!==null&&(t===null||n.to-n.from<t.to-t.from)&&(t=n);return t?.id??null}function be(e,t){return e.id===null||e.id===t}function xe(e,t=null){let n=[...e].filter(e=>e.from<e.to).sort((e,t)=>e.from-t.from||e.to-t.to||(e.id??``).localeCompare(t.id??``));if(n.length===0)return[];let r=[...new Set(n.flatMap(e=>[e.from,e.to]))].sort((e,t)=>e-t),i=[],a=null,o=()=>{if(a===null)return;let e=a.covering.find(e=>be(e,t));i.push({from:a.from,to:a.to,style:_e(e??a.covering[0],e!==void 0),threadId:ye(a.covering)}),a=null};for(let e=0;e<r.length-1;e++){let t=r[e],i=r[e+1],s=n.filter(e=>e.from<=t&&e.to>=i);if(s.length===0){o();continue}if(a!==null&&a.to===t&&ve(a.covering)===ve(s)){a.to=i;continue}o(),a={from:t,to:i,covering:s}}return o(),i}var Se=`data-comment-reveal`;function Ce(e){return typeof CSS<`u`&&CSS.escape?CSS.escape(e):e}function we(e){return e===``?null:document.querySelector(`[data-testid="property-row"][data-key="${Ce(e)}"]`)}function Te(e){let t=we(e);if(t===null)return null;let n=t.getBoundingClientRect();return n.height===0&&n.width===0?null:n}function Ee(e){we(e)?.scrollIntoView({block:`center`,behavior:`smooth`})}function De(e){if(e.quote===``)return null;let t=e.path.length===0?e.key:e.path[e.path.length-1],n=Array.from(document.querySelectorAll(`[data-testid="property-row"][data-key="${Ce(String(t))}"]`)),r=Array.from(document.querySelectorAll(`[data-testid="property-row"]`));for(let t of[...n,...r]){let n=t.querySelector(`textarea, input`);if(n===null)continue;let r=L(n.value,e.quote,e.start,e.end);if(r!==null)return t.scrollIntoView({block:`center`,behavior:`smooth`}),n.focus(),n.setSelectionRange(r.start,r.end),Oe(n),n}return null}function L(e,t,n,r){if(n!==void 0&&r!==void 0&&e.slice(n,r)===t)return{start:n,end:r};let i=e.indexOf(t);return i<0?null:{start:i,end:i+t.length}}function Oe(e){e.style.setProperty(`--comment-reveal-fill`,I(ge)),e.setAttribute(Se,`true`);let t=()=>{e.removeAttribute(Se),e.style.removeProperty(`--comment-reveal-fill`)};e.addEventListener(`blur`,t,{once:!0}),e.addEventListener(`pointerdown`,t,{once:!0}),e.addEventListener(`keydown`,t,{once:!0})}var ke=new Set([`*`,`_`,"`",`~`,`\\`,`$`]),Ae=/^={2,}/,R=/^<(?:[A-Za-z][A-Za-z0-9+.-]*:[^<>\s]*|[^\s<>@]+@[^\s<>]+)>/,z=512;function je(e,t){return R.test(e.slice(t,t+z))}function Me(e,t){let n=e.lastIndexOf(`<`,t);return n<0||t-n>z?!1:R.exec(e.slice(n,t+1))?.[0].length===t+1-n}var Ne=/^<\/?[A-Za-z][A-Za-z0-9-]*(?:\s[^>]*?)?\/?>/,Pe=512,Fe=/^!(?=\[)/,Ie=/^\[\^/,Le=/^\]\[[^\]]*\]/,Re=/^\[\[[^\][|]*\|/,ze=/^#[^\][|]*(?=\]\])/,B=512,Be=/^\]\([^)]*\)/,Ve=512,He=/^(?:#{1,6}[ \t]+|>[ \t]?|(?:[-*+]|\d{1,9}[.)])[ \t]+(?:\[[ xX]\][ \t]+)?)/,Ue=32,We=`|`,Ge=/^(?:`{3,}[^`\n]*|~{3,}[^\n]*)$/,Ke=/^(?:(?:[-*_][ \t]*){3,}|=+[ \t]*|[|\-: \t]*-[|\-: \t]*)$/,qe=1024;function Je(e,t){let n=e.indexOf(`
|
|
2
2
|
`,t),r=n===-1?e.length:n;if(r>t&&e[r-1]===`\r`&&--r,r-t>qe)return 0;let i=e.slice(t,r);return i.length===0||!Ge.test(i)&&!Ke.test(i)?0:i.length}var V=/&#(?:x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);/y;function H(e,t){if(e[t]!==`&`)return null;let n=t,r=``;for(;;){V.lastIndex=n;let t=V.exec(e)?.[0];if(t===void 0)break;let i=ne(t);if(i===null)break;r+=i,n+=t.length}return n===t?null:{length:n-t,rendered:r}}function U(e){return e===` `||e===` `||e===`
|
|
3
3
|
`||e===`\r`||e===`\f`||e===`\v`}function W(e,t){for(let n=t-1;n>=0;--n){let t=e[n];if(t===`
|
|
4
4
|
`)return!0;if(t!==` `&&t!==` `)return!1}return!0}function G(e,t){let n=e[t];if(n===void 0)return 0;if(W(e,t)){let n=Je(e,t);if(n>0)return n}if(n===We)return 1;if(n===`<`){let n=Ne.exec(e.slice(t,t+Pe))?.[0].length;return n===void 0?+!!je(e,t):n}if(n===`>`&&Me(e,t))return 1;if(n===`=`){let n=Ae.exec(e.slice(t,t+3))?.[0].length;if(n!==void 0)return n}if(n===`!`)return+!!Fe.test(e.slice(t,t+2));if(ke.has(n))return 1;if(n===`[`){let n=e.slice(t,t+B),r=Re.exec(n)?.[0].length;return r===void 0?Ie.test(n)?2:1:r}if(n===`#`){let n=ze.exec(e.slice(t,t+B))?.[0].length;if(n!==void 0)return n}if(n===`]`){if(e[t+1]===`]`)return 2;let n=e.slice(t,t+Math.max(Ve,B)),r=Be.exec(n)?.[0].length;if(r!==void 0)return r;let i=Le.exec(n)?.[0].length;return i===void 0?1:i}return W(e,t)?He.exec(e.slice(t,t+Ue))?.[0].length??0:0}function K(e,t,{syntaxIn:n}){let r=[];if(t.length===0)return r;let i=n===`haystack`;for(let n=0;n<e.length;n+=1){let a=e[n];if(a===void 0||U(a)||i&&a!==t[0]&&(G(e,n)>0||H(e,n)!==null))continue;let o=n,s=0;for(;o<e.length&&s<t.length;){let n=e[o],r=t[s];if(n===r){o+=1,s+=1;continue}if(U(r)){s+=1;continue}if(U(n)){o+=1;continue}let a=i?G(e,o):G(t,s);if(a>0){i?o+=a:s+=a;continue}let c=i?H(e,o):H(t,s);if(c!==null){let n=i?t:e,r=i?s:o,a=!0;for(let e of c.rendered)if(!U(e)){for(;r<n.length&&U(n[r]);)r+=1;if(n[r]!==e){a=!1;break}r+=1}if(!a)break;i?(o+=c.length,s=r):(s+=c.length,o=r);continue}break}for(;s<t.length&&U(t[s]);)s+=1;s===t.length&&r.push({start:n,end:o})}return r}var q=8,Ye=64;function J(e,t,n,r){let i=``,a=Math.max(0,t),o=Math.min(e.length,n);for(;a<o;){let t=e[a];if(U(t)){a+=1;continue}if(r){let t=G(e,a);if(t>0){a+=t;continue}let n=H(e,a);if(n!==null){for(let e of n.rendered)U(e)||(i+=e);a+=n.length;continue}}i+=t,a+=1}return i}function Xe(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e[e.length-1-r]===t[t.length-1-r];)r+=1;return r}function Ze(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e[r]===t[r];)r+=1;return r}function Qe(e,t,n,{syntaxIn:r,syntaxInContext:i=!1}){let a=n.prefix??``,o=n.suffix??``,s=r===`haystack`,c=0;if(a.length>0){let n=a.length*q+Ye;c+=Xe(J(a,0,a.length,i),J(e,t.start-n,t.start,s))}if(o.length>0){let n=o.length*q+Ye;c+=Ze(J(o,0,o.length,i),J(e,t.end,t.end+n,s))}return c}function $e(e,{syntaxInContext:t=!1}={}){let n=J(e.prefix??``,0,1/0,t).length+J(e.suffix??``,0,1/0,t).length;return Math.min(8,n)}function et(e){return Math.max(e*4,e+64)}function tt(e,{includeBlockComponents:t=!1}={}){let n=``,r=[];return e.descendants((e,i)=>{if(e.isText&&e.text){for(let t=0;t<e.text.length;t++)n+=e.text[t],r.push(i+t);return!0}if(e.isBlock&&!t)return!0;let a=x(e);if(a.length>0){let t=i+e.nodeSize-1;for(let e=0;e<a.length;e++)n+=a[e],r.push(e===a.length-1?t:i)}return!0}),{text:n,positions:r}}function nt(e,t){let n=[];if(t===``)return n;let r=e.indexOf(t);for(;r!==-1;)n.push(r),r=e.indexOf(t,r+1);return n}function Y(e,t,n){let r=n?.prefix??``,i=n?.suffix??``;if(r===``&&i===``)return null;let a=r===``?[0]:K(e,r,{syntaxIn:`needle`}).map(e=>e.end),o=i===``?[e.length]:K(e,i,{syntaxIn:`needle`}).map(e=>e.start);if(a.length!==1||o.length!==1)return null;let s=a[0],c=o[0];for(;s<c&&/\s/.test(e[s]??``);)s+=1;for(;c>s&&/\s/.test(e[c-1]??``);)--c;if(c<=s)return null;let l=et(t.length);return c-s>l?null:{start:s,end:c}}function X(e,t){let n=e.positions[t.start],r=e.positions[t.end-1];return n==null||r==null?null:{from:n,to:r+1}}function rt(e,t,n){if(t.length===0)return null;let r=nt(e.text,t).map(e=>({start:e,end:e+t.length}));if(r.length===0&&(r=K(e.text,t,{syntaxIn:`needle`})),r.length===0){let r=Y(e.text,t,n);return r===null?null:X(e,r)}let i=n?.prefix??``,a=n?.suffix??``,o=t=>e.text.includes(t)||K(e.text,t,{syntaxIn:`needle`}).length>0;if(i!==``&&a!==``&&!o(i+t+a)&&o(i+a))return null;let s=$e({prefix:i,suffix:a},{syntaxInContext:!0}),c=t=>s===0||Qe(e.text,t,{prefix:i,suffix:a},{syntaxIn:`none`,syntaxInContext:!0})>=s;if(r.length===1){if(!c(r[0])){let r=Y(e.text,t,n);return r===null?null:X(e,r)}return X(e,r[0])}let l=[],u=-1;for(let t of r){let n=Qe(e.text,t,{prefix:i,suffix:a},{syntaxIn:`none`,syntaxInContext:!0});n>u?(u=n,l=[t]):n===u&&l.push(t)}if(!c(l[0])){let r=Y(e.text,t,n);return r===null?null:X(e,r)}return X(e,l[0])}var it=64;function at(e,t,n){return{prefix:p(e,Math.max(0,t-it),t),suffix:p(e,n,Math.min(e.content.size,n+it))}}function ot(e,t,n){return st(e)(t,n)}function st(e){let t=tt(e),n=null;return(r,i)=>{let a=rt(t,r,i);return a===null?(n??=tt(e,{includeBlockComponents:!0}),rt(n,r,i)):a}}var ct=220,lt=24;function ut(e){let t=e.viewTop+e.insetTop,n=e.viewBottom-ct;return e.anchorTop>=t&&e.anchorBottom<=n?0:e.anchorTop-(t+lt)}function dt(e){let t=e?.parentElement??null;for(;t;){let e=getComputedStyle(t).overflowY;if(e===`auto`||e===`scroll`)return t;t=t.parentElement}return null}function ft(e){let t=Number.parseFloat(getComputedStyle(e).scrollPaddingTop);return Number.isFinite(t)?t:0}function pt(e,t,r,i){let a=E(e);if(!a)return!1;let o=dt(a.dom);if(!o)return n(r,`comment-reveal`,()=>e.commands.scrollIntoView());let s,c;try{s=a.coordsAtPos(t.from),c=a.coordsAtPos(t.to)}catch{return!1}let l=o.getBoundingClientRect(),u=ut({anchorTop:s.top,anchorBottom:Math.max(s.bottom,c.bottom),viewTop:l.top,viewBottom:l.bottom,insetTop:ft(o)});if(u===0)return!0;let d=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;return n(r,`comment-reveal`,()=>o.scrollTo({top:o.scrollTop+u,behavior:i?.instant||d?`auto`:`smooth`}))}var mt=1e4,ht=80,gt=1500,Z=[`wheel`,`touchstart`,`mousedown`,`keydown`];function _t(e){let t=!1,n=!1,r=null,i=null,a=-1,o=()=>{let o=_(e.docName);if(!o||o.isDestroyed)return!1;if(t||(t=!0,m(e.threadId)),e.quote===``){if(r!==null)return!0;let t=e.resolveTarget?e.resolveTarget():E(o)?.dom;return e.resolveTarget&&!t?!1:(r=Date.now(),f(e.threadId),t&&e.onDestinationComplete?.(t),!0)}let s=o.state.doc.content.size;if((i===null||s!==a)&&(i=ot(o.state.doc,e.quote,e.context),a=s),n=i!==null,!i||!pt(o,i,e.docName,{instant:!0}))return!1;if(r===null){r=Date.now(),f(e.threadId);let t=E(o)?.dom;t&&e.onDestinationComplete?.(t)}return!0};v(`comments`),o(),_(e.docName)===null&&(e.resolveTarget||e.onDestinationComplete?window.location.hash=D(e.docName):window.location.assign(D(e.docName)));let s=!1,c=()=>{if(!s){s=!0,d(),window.clearInterval(p),window.clearTimeout(g);for(let e of Z)window.removeEventListener(e,l,!0)}},l=()=>c(),u=()=>{o()&&r!==null&&Date.now()-r>=gt&&c()},d=h(u),p=window.setInterval(u,ht),g=window.setTimeout(()=>{r===null&&w.error(t?n?T._({id:`VBtCdv`}):T._({id:`KeXgA-`}):T._({id:`JDQ5I5`})),c()},mt);for(let e of Z)window.addEventListener(e,l,!0);u()}var Q=t();function vt(){return b().length}function yt(){let e=(0,O.c)(4),t=b(),n;if(e[0]!==t){n=new Map;for(let e of t){let t=g(e)?.docName;t!==void 0&&n.set(t,(n.get(t)??0)+1)}e[0]=t,e[1]=n}else n=e[1];let r;return e[2]===n?r=e[3]:(r=[...n].map(bt),e[2]=n,e[3]=r),r}function bt(e){let[t,n]=e;return{docName:t,count:n}}function xt(e){let t=(0,O.c)(26),{count:n,docs:r,onDismiss:o}=e,f;t[0]===r?f=t[1]:(f=r===void 0?[]:r,t[0]=r,t[1]=f);let p=f,{_:m}=a();if(n===0)return null;let h;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(h=s(`inline-flex items-center gap-1 rounded-md border bg-muted/60 py-0.5 pr-0.5 pl-1.5`,`text-xs text-muted-foreground`),t[2]=h):h=t[2];let g;t[3]===m?g=t[4]:(g=m({id:`2zvUIK`}),t[3]=m,t[4]=g);let _;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Q.jsx)(ie,{className:`size-3`}),t[5]=_):_=t[5];let v;t[6]!==n||t[7]!==p.length?(v=p.length>1?(0,Q.jsx)(i,{id:`5TmrYN`,values:{0:p.length,count:n}}):(0,Q.jsx)(i,{id:`eiUA4k`,values:{count:n}}),t[6]=n,t[7]=p.length,t[8]=v):v=t[8];let y;t[9]!==g||t[10]!==v?(y=(0,Q.jsx)(c,{asChild:!0,children:(0,Q.jsxs)(d,{type:`button`,size:`sm`,variant:`ghost`,"aria-label":g,onClick:Ct,"data-testid":`composer-comments-open-panel`,className:`h-auto min-h-0 gap-1 px-0.5 py-0 text-xs font-normal text-muted-foreground hover:text-foreground`,children:[_,v]})}),t[9]=g,t[10]=v,t[11]=y):y=t[11];let b;t[12]===p?b=t[13]:(b=(0,Q.jsx)(l,{className:`max-w-64`,children:p.length>1?(0,Q.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:p.map(St)}):(0,Q.jsx)(i,{id:`2zvUIK`})}),t[12]=p,t[13]=b);let x;t[14]!==y||t[15]!==b?(x=(0,Q.jsxs)(u,{children:[y,b]}),t[14]=y,t[15]=b,t[16]=x):x=t[16];let S;t[17]===m?S=t[18]:(S=m({id:`pFRz_E`}),t[17]=m,t[18]=S);let C;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Q.jsx)(re,{className:`size-3`}),t[19]=C):C=t[19];let w;t[20]!==o||t[21]!==S?(w=(0,Q.jsx)(d,{type:`button`,size:`sm`,variant:`ghost`,"aria-label":S,onClick:o,className:`size-4 p-0 text-muted-foreground hover:text-foreground`,children:C}),t[20]=o,t[21]=S,t[22]=w):w=t[22];let T;return t[23]!==w||t[24]!==x?(T=(0,Q.jsxs)(`span`,{"data-testid":`composer-context-chip-comments`,className:h,children:[x,w]}),t[23]=w,t[24]=x,t[25]=T):T=t[25],T}function St(e){return(0,Q.jsxs)(`li`,{className:`flex items-baseline gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`tabular-nums`,children:e.count}),(0,Q.jsx)(`span`,{className:`truncate`,children:wt(e.docName)})]},e.docName)}function Ct(){return S()}function wt(e){let t=e.lastIndexOf(`/`);return t>=0?e.slice(t+1):e}function Tt(e,t){let n=e;for(let e of t)n+=typeof e==`number`?`[${e}]`:`.${e}`;return n}function Et(e,t){let{target:n,anchor:r}=e;n.kind===`property`&&le(!1);let i=n.kind===`property`&&r!==null?()=>De({key:n.key,path:n.path,quote:r.quote,start:r.start,end:r.end}):void 0;_t({docName:e.docName,quote:n.kind===`property`?``:r?.quote??``,threadId:e.id,context:r??void 0,onDestinationComplete:t,resolveTarget:i})}function Dt(e){return{docName:e.docName,body:e.instruction,propertyKey:e.property,quote:e.passage?.exact??``,anchorLost:e.anchorLost,prefix:e.passage?.prefix??``,suffix:e.passage?.suffix??``,repeats:e.passageRepeats}}var $=48;function Ot(e){let t=e.replace(/\s+/g,` `).trimStart();return t.length>$?`…${C(t,$)}`:t}function kt(e){let t=e.replace(/\s+/g,` `).trimEnd();return t.length>$?`${y(t,$)}…`:t}function At(e){if(!e.repeats)return null;let t=Ot(e.prefix),n=kt(e.suffix);return t===``&&n===``?null:`(This text appears more than once in the file. The one meant is ${t===``?`at the start of the file, followed by "${n}"`:n===``?`at the end of the file, preceded by "${t}"`:`between "${t}" and "${n}"`} — match that context rather than the first occurrence.)`}function jt(e,t,n){let r=t.trim(),i=[];if(i.push(r.length>0?r:`Address the following review comments by editing the documents directly.`),i.push(``),i.push(e.length===1?`The comment:`:`The ${e.length} comments:`),e.forEach((e,t)=>{if(i.push(``),e.propertyKey){let n=e.quote.trim();if(n===``)i.push(`${t+1}. In \`${e.docName}\`, on the \`${e.propertyKey}\` property (frontmatter):`),i.push(``),i.push(` ${e.body.trim()}`);else{i.push(`${t+1}. In \`${e.docName}\`, on this text within the \`${e.propertyKey}\` property (frontmatter):`),i.push(``);for(let e of n.split(`
|