@puddle-code/cli 0.3.2 → 0.3.3
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/CHANGELOG.md +5 -4
- package/dist/host-control.mjs +11 -4
- package/dist/index.js +134 -29
- package/dist/public/assets/App-CkunCEjY.js +2 -0
- package/dist/public/assets/Dashboard-3XQN7EWB.js +1 -0
- package/dist/public/assets/EditorTabClose-CCYbaxcQ.js +1 -0
- package/dist/public/assets/FindWidget-BsFwo-Vf.js +1 -0
- package/dist/public/assets/LazyTerminal-CRonN-zb.js +2 -0
- package/dist/public/assets/{ModelRefcount-Dkp1avzM.js → ModelRefcount-BdmA-Mgb.js} +1 -1
- package/dist/public/assets/NewProjectDialog-Bsp8NGgY.js +1 -0
- package/dist/public/assets/PaneEditorBody-MSWyifa9.js +299 -0
- package/dist/public/assets/PdfViewer-C3kK31fw.js +2 -0
- package/dist/public/assets/SettingsDialog-CGT3gjKB.js +8 -0
- package/dist/public/assets/Terminal-_KJe85Cp.js +66 -0
- package/dist/public/assets/Workspace-ZdFFHXHa.js +20 -0
- package/dist/public/assets/abnfDiagram-VCTEODGH-CIbaiPRK.js +1 -0
- package/dist/public/assets/architecture-7GRP2DOG-C37y6gLW.js +1 -0
- package/dist/public/assets/architectureDiagram-5GKGNRK7-OE8n13hC.js +36 -0
- package/dist/public/assets/auth-C3Hg0pRq.js +73 -0
- package/dist/public/assets/{blockDiagram-I7D4REHJ-NHlOsaCN.js → blockDiagram-I7D4REHJ-TUFuv4qI.js} +1 -1
- package/dist/public/assets/buffer-store-De6oYRzb.js +16 -0
- package/dist/public/assets/button-DkCgQgIz.js +1 -0
- package/dist/public/assets/{c4Diagram-7LVT6UL2-ZLfrwKT4.js → c4Diagram-7LVT6UL2-Cwvhq15S.js} +1 -1
- package/dist/public/assets/channel-Bl1m0NKH.js +1 -0
- package/dist/public/assets/chunk-2E4U76K2-3abpRZU5.js +2 -0
- package/dist/public/assets/chunk-2ZTRR5NV-NvRGlFrK.js +2 -0
- package/dist/public/assets/chunk-3Z5EZCMW-DiR4QWP9.js +1 -0
- package/dist/public/assets/{chunk-4HAMMTFA-Brp_wxZT.js → chunk-4HAMMTFA-eolw8o4c.js} +1 -1
- package/dist/public/assets/chunk-5V3GS4D5-C1iY134n.js +1 -0
- package/dist/public/assets/chunk-6AZGARVD-_0gi5QUW.js +1 -0
- package/dist/public/assets/chunk-6EIED4P4-BxkNo1Kd.js +1 -0
- package/dist/public/assets/chunk-6K3QC6MW-3E45BuBF.js +1 -0
- package/dist/public/assets/chunk-6TQVIW2G-CakkaKNk.js +1 -0
- package/dist/public/assets/chunk-747NJXEK-pfB9pTl1.js +2 -0
- package/dist/public/assets/{chunk-75Z2AOVW-9vLeKuoB.js → chunk-75Z2AOVW-CYC6lmPG.js} +1 -1
- package/dist/public/assets/{chunk-CLGD4ZFX-B8Oa13vy.js → chunk-CLGD4ZFX-85mvsF4F.js} +1 -1
- package/dist/public/assets/chunk-DU6HZSFF-1ZoT19aa.js +125 -0
- package/dist/public/assets/{chunk-F27PBJKO-I29_mrbz.js → chunk-F27PBJKO-DM71futS.js} +1 -1
- package/dist/public/assets/{chunk-GMAD6QVW-ZzqGXNRY.js → chunk-GMAD6QVW-BzDEhlK8.js} +1 -1
- package/dist/public/assets/{chunk-GVQU2GXP-DiJctosx.js → chunk-GVQU2GXP-CZrUjjq3.js} +1 -1
- package/dist/public/assets/chunk-I5DQTOEV-Dcwirj_w.js +1 -0
- package/dist/public/assets/chunk-ICYGCRZG-BJAGKQA9.js +1 -0
- package/dist/public/assets/chunk-IH6LHLGP-BN2I9ljI.js +1 -0
- package/dist/public/assets/{chunk-IMKFNOWR-yuPnJltA.js → chunk-IMKFNOWR-CLsPi8Op.js} +1 -1
- package/dist/public/assets/chunk-KI3K4JFJ-v5_17D28.js +1 -0
- package/dist/public/assets/{chunk-L3NEJ4N5-DB3LOw2c.js → chunk-L3NEJ4N5-BW3s5_r9.js} +1 -1
- package/dist/public/assets/{chunk-OSK3NFVY-ygO9ccvX.js → chunk-OSK3NFVY-Cs_K17E_.js} +1 -1
- package/dist/public/assets/chunk-OUJLGHUK-FHDQe81Z.js +2 -0
- package/dist/public/assets/{chunk-P2QGCYS3-CaO30dnF.js → chunk-P2QGCYS3-C5-f0Lvg.js} +1 -1
- package/dist/public/assets/{chunk-POPQ4Y6H-BS_wlBQ7.js → chunk-POPQ4Y6H-gkafJx1Z.js} +1 -1
- package/dist/public/assets/{chunk-PWAF6VOD-BYtVJDwT.js → chunk-PWAF6VOD-CTSTb7zN.js} +1 -1
- package/dist/public/assets/{chunk-SHT3W25Y-DbWwFCez.js → chunk-SHT3W25Y-Cg6sVFNA.js} +1 -1
- package/dist/public/assets/{chunk-SVP7TREG-DLDU3lFF.js → chunk-SVP7TREG-DRUnItYx.js} +1 -1
- package/dist/public/assets/{chunk-TICWLB2K-Bo_jKuAY.js → chunk-TICWLB2K-HtG8ibWH.js} +1 -1
- package/dist/public/assets/chunk-TLUHSLCS-CcE5HWjm.js +2 -0
- package/dist/public/assets/chunk-UY3FDG6J-DHD-4eXF.js +1 -0
- package/dist/public/assets/chunk-XHIXRSVI-DRL0dwtI.js +1 -0
- package/dist/public/assets/classDiagram-ZZMXUADV-AgT8hWlv.js +1 -0
- package/dist/public/assets/classDiagram-v2-VYDZK3BY-AgT8hWlv.js +1 -0
- package/dist/public/assets/client-settings-CwqpIric.js +1 -0
- package/dist/public/assets/context-menu-0Tb8cG9E.js +1 -0
- package/dist/public/assets/copy-CKvSfzPk.js +1 -0
- package/dist/public/assets/cssMode-CSjHtANE.js +1 -0
- package/dist/public/assets/cynefin-OW5HDTMX-Dy2ZNO0g.js +1 -0
- package/dist/public/assets/cynefinDiagram-5FMLGOSQ-C2miE5p0.js +62 -0
- package/dist/public/assets/{dagre-GXQ25YYZ-DJ40uVpF.js → dagre-GXQ25YYZ-BjnR_o63.js} +1 -1
- package/dist/public/assets/{diagram-S7CK7UJ4-CakLFIEW.js → diagram-S7CK7UJ4-CBYedG6v.js} +3 -3
- package/dist/public/assets/diagram-UQ7AKVKN-CUL346-t.js +41 -0
- package/dist/public/assets/diagram-VSXAHHWV-1DKb_UJ5.js +3 -0
- package/dist/public/assets/{diagram-VX7I27RA-VJip2Tpi.js → diagram-VX7I27RA-DYP31PbY.js} +2 -2
- package/dist/public/assets/{diagram-Z3DM3KII-CPQuWy39.js → diagram-Z3DM3KII-C-mC8cmq.js} +1 -1
- package/dist/public/assets/dialog-UpZ_vNTE.js +41 -0
- package/dist/public/assets/disclosure-D7vpyXdR.js +1 -0
- package/dist/public/assets/dist-C2WZA469.js +1 -0
- package/dist/public/assets/dist-v3Pwgb3Q.js +1 -0
- package/dist/public/assets/ebnfDiagram-PWID7BFC-CnSa44Tb.js +1 -0
- package/dist/public/assets/{erDiagram-RLTQ6QDP-DqwnnH7t.js → erDiagram-RLTQ6QDP-ZmDlrO9k.js} +1 -1
- package/dist/public/assets/{errors-BkbAF9Bu.js → errors-BH_S68Hd.js} +1 -1
- package/dist/public/assets/eventmodeling-NTZA5JFV-uFnlWNGc.js +1 -0
- package/dist/public/assets/flowDiagram-HODETNUW-CW47qpBT.js +1 -0
- package/dist/public/assets/{ganttDiagram-EL5Y4UJY-BvWbPqg4.js → ganttDiagram-EL5Y4UJY-raM_gefY.js} +1 -1
- package/dist/public/assets/gitGraph-4MIJSDKK-1PxNX92k.js +1 -0
- package/dist/public/assets/gitGraphDiagram-WWUBYQGX-DnLrgk4s.js +106 -0
- package/dist/public/assets/htmlMode-CIHMS93l.js +1 -0
- package/dist/public/assets/index-xDhpMZgv.js +10 -0
- package/dist/public/assets/info-A6RAGUB7-BZV44TW1.js +1 -0
- package/dist/public/assets/infoDiagram-27XIBGKW-eCv-Vsx8.js +2 -0
- package/dist/public/assets/{ishikawaDiagram-5VMMS53U-Bq13tOFJ.js → ishikawaDiagram-5VMMS53U-DCFnvrdr.js} +1 -1
- package/dist/public/assets/{journeyDiagram-3NMN7TZE-7GJvjukT.js → journeyDiagram-3NMN7TZE-6o4KvbhJ.js} +1 -1
- package/dist/public/assets/{jsonMode-C6jAdn8r.js → jsonMode-BijgXT6I.js} +1 -1
- package/dist/public/assets/jsx-runtime-ffCh33zF.js +1 -0
- package/dist/public/assets/{kanban-definition-UXKFOSKX-BIFvSwV9.js → kanban-definition-UXKFOSKX-CQKuhkFV.js} +1 -1
- package/dist/public/assets/{line-BjlS8UJs.js → line-D4r_bmlv.js} +1 -1
- package/dist/public/assets/markdown-mermaid-D0nzztEz.js +2 -0
- package/dist/public/assets/{math-BNNuKpUP.js → math-CSw6sgCC.js} +2 -2
- package/dist/public/assets/math-delimiters-BCnTi7Ii.js +1 -0
- package/dist/public/assets/media-refresh-store-Ddvr6wz1.js +1 -0
- package/dist/public/assets/mermaid-parser.core-CICMKhjq.js +4 -0
- package/dist/public/assets/mermaid.core-D2QzpYEE.js +11 -0
- package/dist/public/assets/{mindmap-definition-YA3MSWOX-Cy4SIHHe.js → mindmap-definition-YA3MSWOX-DAB8mHOv.js} +1 -1
- package/dist/public/assets/monaco.contribution-C0TYpF88.js +2 -0
- package/dist/public/assets/notification-delivery-CDu_5PS7.js +1 -0
- package/dist/public/assets/packet-AYTQ26CC-Cw5JteoC.js +1 -0
- package/dist/public/assets/{pdf-Cnp8bCq1.js → pdf-EQHMWEbX.js} +1 -1
- package/dist/public/assets/pegDiagram-XKGWAZYB-BE_LYTdh.js +1 -0
- package/dist/public/assets/pie-WAS4IAKB-CnPKaBaN.js +1 -0
- package/dist/public/assets/pieDiagram-E7YTZNPT-BRffiJ1a.js +39 -0
- package/dist/public/assets/preload-helper-Czpn1I53.js +1 -0
- package/dist/public/assets/project-abbrev-Br6sQqPh.js +1 -0
- package/dist/public/assets/protocol-support-CLMCHX8i.js +1 -0
- package/dist/public/assets/{quadrantDiagram-AXDQQJYC-2BigfRRK.js → quadrantDiagram-AXDQQJYC-DYWp1Jjq.js} +1 -1
- package/dist/public/assets/radar-RG4KPBEZ-Dqx79rlE.js +1 -0
- package/dist/public/assets/railroad-74A4TZTK-BkDQqaz7.js +1 -0
- package/dist/public/assets/railroad-abnf-HS5TGJTU-kgqWL-Ba.js +1 -0
- package/dist/public/assets/railroad-ebnf-LZEXJU2U-GspfOzjs.js +1 -0
- package/dist/public/assets/railroad-peg-WCYAUIDC-qO23KZap.js +1 -0
- package/dist/public/assets/railroadDiagram-O6MQD6OU-wuPYUWJ2.js +1 -0
- package/dist/public/assets/{requirementDiagram-BXWQKSXE-BfBBVeo_.js → requirementDiagram-BXWQKSXE-BtGNZ92J.js} +1 -1
- package/dist/public/assets/{sankeyDiagram-P5KCCOFB-BHy22mhl.js → sankeyDiagram-P5KCCOFB-XgIIrsbe.js} +1 -1
- package/dist/public/assets/{scroll-restoration-rhyw8Ck0.js → scroll-restoration-hNqYmCAE.js} +1 -1
- package/dist/public/assets/selection-actions-Bh9Fkkqv.js +1 -0
- package/dist/public/assets/{sequenceDiagram-WJ2MYXX4-Dhgnxvrt.js → sequenceDiagram-WJ2MYXX4-CVIIE7ze.js} +1 -1
- package/dist/public/assets/{stateDiagram-D77RDMKH-CPWwa5Aj.js → stateDiagram-D77RDMKH-0kIDexDQ.js} +1 -1
- package/dist/public/assets/stateDiagram-v2-MP3YSRHH-DdU6a-zG.js +1 -0
- package/dist/public/assets/{swimlanes-42K2YHIH-DsqTASlp.js → swimlanes-42K2YHIH-BY2JV_Jb.js} +1 -1
- package/dist/public/assets/swimlanesDiagram-VR7AAH4N-BCiIa4tX.js +8 -0
- package/dist/public/assets/switch-SW6BMps1.js +1 -0
- package/dist/public/assets/{timeline-definition-24CTP7MA-B7hjD0KJ.js → timeline-definition-24CTP7MA-CPRUSXUS.js} +1 -1
- package/dist/public/assets/treeView-Q6P3EWNA-CiZNqz_z.js +1 -0
- package/dist/public/assets/treemap-WGGIJYW6-5hDYDC6e.js +1 -0
- package/dist/public/assets/{tsMode-CillYPbz.js → tsMode-B7q3gz7a.js} +1 -1
- package/dist/public/assets/use-ui-state-BiAROr3D.js +1 -0
- package/dist/public/assets/{vennDiagram-4TSXK5OY-BvS0i65j.js → vennDiagram-4TSXK5OY-CU1Q7iGV.js} +1 -1
- package/dist/public/assets/view-state-store-C6OmciCC.js +1 -0
- package/dist/public/assets/wardley-WFR3VGLG-CWb_ROLo.js +1 -0
- package/dist/public/assets/{wardleyDiagram-VM6X3IG4-CxconmGB.js → wardleyDiagram-VM6X3IG4-B2Pn7CDF.js} +3 -3
- package/dist/public/assets/whole-word-2m2pmAFT.js +1 -0
- package/dist/public/assets/workers-Ck67TJT4.js +1 -0
- package/dist/public/assets/ws-DNNH0sEH.js +1 -0
- package/dist/public/assets/{xychartDiagram-S5SC5T6Z-DSJMW0r7.js → xychartDiagram-S5SC5T6Z-xhQ4tT_S.js} +1 -1
- package/dist/public/index.html +5 -1
- package/dist/pudl.js +12 -5
- package/package.json +1 -1
- package/dist/public/assets/App-D_YTB3jH.js +0 -2
- package/dist/public/assets/Dashboard-Djw9nPV_.js +0 -1
- package/dist/public/assets/EditorTabClose-BCunnuEj.js +0 -1
- package/dist/public/assets/FindWidget-Ch-y_4eH.js +0 -1
- package/dist/public/assets/LazyTerminal-BN3rEDcD.js +0 -2
- package/dist/public/assets/NewProjectDialog-BK_gfWmL.js +0 -1
- package/dist/public/assets/PaneEditorBody-ClWRSuGV.js +0 -299
- package/dist/public/assets/PdfViewer-CbC1KAkq.js +0 -2
- package/dist/public/assets/SettingsDialog-DsmyHhQB.js +0 -8
- package/dist/public/assets/Terminal-CDnGRsgd.js +0 -66
- package/dist/public/assets/Workspace-CmclLFK3.js +0 -20
- package/dist/public/assets/abnfDiagram-VCTEODGH-Aa5uAdnV.js +0 -1
- package/dist/public/assets/architecture-7GRP2DOG-D3814jvH.js +0 -1
- package/dist/public/assets/architectureDiagram-5GKGNRK7-B0d475xG.js +0 -36
- package/dist/public/assets/buffer-store-BtRP7zZm.js +0 -16
- package/dist/public/assets/button-D3DTuFk3.js +0 -1
- package/dist/public/assets/channel-C6g1aWXR.js +0 -1
- package/dist/public/assets/chunk-2E4U76K2-DyVxGuz5.js +0 -2
- package/dist/public/assets/chunk-DU6HZSFF-ziCxw8j9.js +0 -125
- package/dist/public/assets/chunk-TLUHSLCS-BGFLoTUj.js +0 -2
- package/dist/public/assets/classDiagram-ZZMXUADV-BiQrxRCS.js +0 -1
- package/dist/public/assets/classDiagram-v2-VYDZK3BY-BiQrxRCS.js +0 -1
- package/dist/public/assets/context-menu-CwR-PGrS.js +0 -1
- package/dist/public/assets/copy-ZzKoF5dj.js +0 -1
- package/dist/public/assets/cssMode-DBrJeag9.js +0 -1
- package/dist/public/assets/cynefin-OW5HDTMX-DsXo9hDP.js +0 -1
- package/dist/public/assets/cynefinDiagram-5FMLGOSQ-CNr5UISm.js +0 -62
- package/dist/public/assets/diagram-UQ7AKVKN-Blm9jWHJ.js +0 -41
- package/dist/public/assets/diagram-VSXAHHWV-BzXCydDQ.js +0 -3
- package/dist/public/assets/dialog-BoaHxScl.js +0 -41
- package/dist/public/assets/disclosure-DNbP2Rp4.js +0 -1
- package/dist/public/assets/dist-CQZ_zg-s.js +0 -1
- package/dist/public/assets/dist-DUfD4S2p.js +0 -1
- package/dist/public/assets/ebnfDiagram-PWID7BFC-x8Hm-8FP.js +0 -1
- package/dist/public/assets/eventmodeling-NTZA5JFV-DE-zSV6F.js +0 -1
- package/dist/public/assets/flowDiagram-HODETNUW-Cn9XuALP.js +0 -1
- package/dist/public/assets/gitGraph-4MIJSDKK-DKeR8Wjx.js +0 -1
- package/dist/public/assets/gitGraphDiagram-WWUBYQGX-CPJ482wi.js +0 -106
- package/dist/public/assets/htmlMode-CKCaIwmL.js +0 -1
- package/dist/public/assets/index-CPKHBs7z.js +0 -82
- package/dist/public/assets/info-A6RAGUB7-CYKUxPau.js +0 -1
- package/dist/public/assets/infoDiagram-27XIBGKW-5qHuu76B.js +0 -2
- package/dist/public/assets/markdown-mermaid-B_y_6yBe.js +0 -2
- package/dist/public/assets/media-refresh-store-BnZNW8xS.js +0 -1
- package/dist/public/assets/mermaid-parser.core-BwJKOdFv.js +0 -7
- package/dist/public/assets/mermaid.core-Cii531li.js +0 -11
- package/dist/public/assets/notification-delivery-Cn-YcMec.js +0 -1
- package/dist/public/assets/packet-AYTQ26CC-y8aHtpCT.js +0 -1
- package/dist/public/assets/pegDiagram-XKGWAZYB-yIL7Oty_.js +0 -1
- package/dist/public/assets/pie-WAS4IAKB-DNZ4gYKN.js +0 -1
- package/dist/public/assets/pieDiagram-E7YTZNPT-CUwYqrWF.js +0 -39
- package/dist/public/assets/project-abbrev-B5CMO00I.js +0 -1
- package/dist/public/assets/protocol-support-hVrRUHAd.js +0 -1
- package/dist/public/assets/radar-RG4KPBEZ-DCE8-Z-G.js +0 -1
- package/dist/public/assets/railroad-74A4TZTK-BfnC2It7.js +0 -1
- package/dist/public/assets/railroad-abnf-HS5TGJTU-C8QChwRk.js +0 -1
- package/dist/public/assets/railroad-ebnf-LZEXJU2U-DN6nLE-f.js +0 -1
- package/dist/public/assets/railroad-peg-WCYAUIDC-emPIg_g-.js +0 -1
- package/dist/public/assets/railroadDiagram-O6MQD6OU-DpX2WbJ5.js +0 -1
- package/dist/public/assets/selection-actions-BDJnKwuj.js +0 -1
- package/dist/public/assets/stateDiagram-v2-MP3YSRHH-CmGYleZg.js +0 -1
- package/dist/public/assets/swimlanesDiagram-VR7AAH4N-CUahIPDv.js +0 -8
- package/dist/public/assets/switch-DGZtVofo.js +0 -1
- package/dist/public/assets/treeView-Q6P3EWNA-WU6eWUi6.js +0 -1
- package/dist/public/assets/treemap-WGGIJYW6-BNZcLwqI.js +0 -1
- package/dist/public/assets/use-ui-state-BZeOd2de.js +0 -1
- package/dist/public/assets/view-state-store-BEl9Q1Jm.js +0 -1
- package/dist/public/assets/wardley-WFR3VGLG-ChvHhLGz.js +0 -1
- package/dist/public/assets/ws-B6RLTvWI.js +0 -1
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
var e;function t(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var n=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},r=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(e=globalThis).__zod_globalConfig??(e.__zod_globalConfig={});var i=globalThis.__zod_globalConfig;function a(e){return e&&Object.assign(i,e),i}function o(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function s(e,t){return typeof t==`bigint`?t.toString():t}function c(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw Error(`cached value already set`)}}}function l(e){return e==null}function u(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function d(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}var ee=Symbol(`evaluating`);function f(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==ee)return r===void 0&&(r=ee,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function p(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function m(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function te(e){return JSON.stringify(e)}function ne(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var re=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function ie(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var ae=c(()=>{if(i.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function oe(e){if(ie(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(ie(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function se(e){return oe(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var ce=new Set([`string`,`number`,`symbol`]);function h(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function g(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function _(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function le(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var ue={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function de(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return g(e,m(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return p(this,`shape`,e),e},checks:[]}))}function fe(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return g(e,m(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return p(this,`shape`,r),r},checks:[]}))}function pe(e,t){if(!oe(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return g(e,m(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return p(this,`shape`,n),n}}))}function me(e,t){if(!oe(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return g(e,m(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return p(this,`shape`,n),n}}))}function he(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return g(e,m(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return p(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function ge(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return g(t,m(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return p(this,`shape`,i),i},checks:[]}))}function _e(e,t,n){return g(t,m(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return p(this,`shape`,i),i}}))}function v(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function ve(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function y(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function ye(e){return typeof e==`string`?e:e?.message}function b(e,t,n){let r=e.message?e.message:ye(e.inst?._zod.def?.error?.(e))??ye(t?.error?.(e))??ye(n.customError?.(e))??ye(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function be(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function xe(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var Se=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,s,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ce=t(`$ZodError`,Se),we=t(`$ZodError`,Se,{Parent:Error});function Te(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Ee(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}var De=e=>(t,r,i,o)=>{let s=i?{...i,async:!1}:{async:!1},c=t._zod.run({value:r,issues:[]},s);if(c instanceof Promise)throw new n;if(c.issues.length){let t=new((o?.Err)??e)(c.issues.map(e=>b(e,s,a())));throw re(t,o?.callee),t}return c.value},Oe=e=>async(t,n,r,i)=>{let o=r?{...r,async:!0}:{async:!0},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let t=new((i?.Err)??e)(s.issues.map(e=>b(e,o,a())));throw re(t,i?.callee),t}return s.value},ke=e=>(t,r,i)=>{let o=i?{...i,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new n;return s.issues.length?{success:!1,error:new(e??Ce)(s.issues.map(e=>b(e,o,a())))}:{success:!0,data:s.value}},Ae=ke(we),je=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},i);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(e=>b(e,i,a())))}:{success:!0,data:o.value}},Me=je(we),Ne=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return De(e)(t,n,i)},Pe=e=>(t,n,r)=>De(e)(t,n,r),Fe=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Oe(e)(t,n,i)},Ie=e=>async(t,n,r)=>Oe(e)(t,n,r),Le=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return ke(e)(t,n,i)},Re=e=>(t,n,r)=>ke(e)(t,n,r),ze=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return je(e)(t,n,i)},Be=e=>async(t,n,r)=>je(e)(t,n,r),Ve=/^[cC][0-9a-z]{6,}$/,He=/^[0-9a-z]+$/,Ue=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,We=/^[0-9a-vA-V]{20}$/,Ge=/^[A-Za-z0-9]{27}$/,Ke=/^[a-zA-Z0-9_-]{21}$/,qe=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Je=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Ye=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Xe=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Ze=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function Qe(){return new RegExp(Ze,`u`)}var $e=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,et=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,tt=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,nt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,rt=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,it=/^[A-Za-z0-9_-]*$/,at=/^https?$/,ot=/^\+[1-9]\d{6,14}$/,st=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,ct=RegExp(`^${st}$`);function lt(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function ut(e){return RegExp(`^${lt(e)}$`)}function dt(e){let t=lt({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${st}T(?:${r})$`)}var ft=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},pt=/^-?\d+$/,mt=/^-?\d+(?:\.\d+)?$/,ht=/^(?:true|false)$/i,gt=/^[^A-Z]*$/,_t=/^[^a-z]*$/,x=t(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),vt={number:`number`,bigint:`bigint`,object:`date`},yt=t(`$ZodCheckLessThan`,(e,t)=>{x.init(e,t);let n=vt[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),bt=t(`$ZodCheckGreaterThan`,(e,t)=>{x.init(e,t);let n=vt[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),xt=t(`$ZodCheckMultipleOf`,(e,t)=>{x.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):d(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),St=t(`$ZodCheckNumberFormat`,(e,t)=>{x.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=ue[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=pt)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),Ct=t(`$ZodCheckMaxLength`,(e,t)=>{var n;x.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!l(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=be(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),wt=t(`$ZodCheckMinLength`,(e,t)=>{var n;x.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!l(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=be(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Tt=t(`$ZodCheckLengthEquals`,(e,t)=>{var n;x.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!l(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=be(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Et=t(`$ZodCheckStringFormat`,(e,t)=>{var n,r;x.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Dt=t(`$ZodCheckRegex`,(e,t)=>{Et.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Ot=t(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=gt,Et.init(e,t)}),kt=t(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=_t,Et.init(e,t)}),At=t(`$ZodCheckIncludes`,(e,t)=>{x.init(e,t);let n=h(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),jt=t(`$ZodCheckStartsWith`,(e,t)=>{x.init(e,t);let n=RegExp(`^${h(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Mt=t(`$ZodCheckEndsWith`,(e,t)=>{x.init(e,t);let n=RegExp(`.*${h(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Nt=t(`$ZodCheckOverwrite`,(e,t)=>{x.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),Pt=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
2
|
+
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
|
|
3
|
+
`))}},Ft={major:4,minor:4,patch:3},S=t(`$ZodType`,(e,t)=>{var r;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ft;let i=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&i.unshift(e);for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,r)=>{let i=v(e),a;for(let o of t){if(o._zod.def.when){if(ve(e)||!o._zod.def.when(e))continue}else if(i)continue;let t=e.issues.length,s=o._zod.check(e);if(s instanceof Promise&&r?.async===!1)throw new n;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,e.issues.length!==t&&(i||=v(e,t))});else{if(e.issues.length===t)continue;i||=v(e,t)}}return a?a.then(()=>e):e},r=(r,a,o)=>{if(v(r))return r.aborted=!0,r;let s=t(a,i,o);if(s instanceof Promise){if(o.async===!1)throw new n;return s.then(t=>e._zod.parse(t,o))}return e._zod.parse(s,o)};e._zod.run=(a,o)=>{if(o.skipChecks)return e._zod.parse(a,o);if(o.direction===`backward`){let t=e._zod.parse({value:a.value,issues:[]},{...o,skipChecks:!0});return t instanceof Promise?t.then(e=>r(e,a,o)):r(t,a,o)}let s=e._zod.parse(a,o);if(s instanceof Promise){if(o.async===!1)throw new n;return s.then(e=>t(e,i,o))}return t(s,i,o)}}f(e,`~standard`,()=>({validate:t=>{try{let n=Ae(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return Me(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),It=t(`$ZodString`,(e,t)=>{S.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??ft(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),C=t(`$ZodStringFormat`,(e,t)=>{Et.init(e,t),It.init(e,t)}),Lt=t(`$ZodGUID`,(e,t)=>{t.pattern??=Je,C.init(e,t)}),Rt=t(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=Ye(e)}else t.pattern??=Ye();C.init(e,t)}),zt=t(`$ZodEmail`,(e,t)=>{t.pattern??=Xe,C.init(e,t)}),Bt=t(`$ZodURL`,(e,t)=>{C.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===at.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}let i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Vt=t(`$ZodEmoji`,(e,t)=>{t.pattern??=Qe(),C.init(e,t)}),Ht=t(`$ZodNanoID`,(e,t)=>{t.pattern??=Ke,C.init(e,t)}),Ut=t(`$ZodCUID`,(e,t)=>{t.pattern??=Ve,C.init(e,t)}),Wt=t(`$ZodCUID2`,(e,t)=>{t.pattern??=He,C.init(e,t)}),Gt=t(`$ZodULID`,(e,t)=>{t.pattern??=Ue,C.init(e,t)}),Kt=t(`$ZodXID`,(e,t)=>{t.pattern??=We,C.init(e,t)}),qt=t(`$ZodKSUID`,(e,t)=>{t.pattern??=Ge,C.init(e,t)}),Jt=t(`$ZodISODateTime`,(e,t)=>{t.pattern??=dt(t),C.init(e,t)}),Yt=t(`$ZodISODate`,(e,t)=>{t.pattern??=ct,C.init(e,t)}),Xt=t(`$ZodISOTime`,(e,t)=>{t.pattern??=ut(t),C.init(e,t)}),Zt=t(`$ZodISODuration`,(e,t)=>{t.pattern??=qe,C.init(e,t)}),Qt=t(`$ZodIPv4`,(e,t)=>{t.pattern??=$e,C.init(e,t),e._zod.bag.format=`ipv4`}),$t=t(`$ZodIPv6`,(e,t)=>{t.pattern??=et,C.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),en=t(`$ZodCIDRv4`,(e,t)=>{t.pattern??=tt,C.init(e,t)}),tn=t(`$ZodCIDRv6`,(e,t)=>{t.pattern??=nt,C.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function nn(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var rn=t(`$ZodBase64`,(e,t)=>{t.pattern??=rt,C.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{nn(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function an(e){if(!it.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return nn(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var on=t(`$ZodBase64URL`,(e,t)=>{t.pattern??=it,C.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{an(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),sn=t(`$ZodE164`,(e,t)=>{t.pattern??=ot,C.init(e,t)});function cn(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var ln=t(`$ZodJWT`,(e,t)=>{C.init(e,t),e._zod.check=n=>{cn(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),un=t(`$ZodNumber`,(e,t)=>{S.init(e,t),e._zod.pattern=e._zod.bag.pattern??mt,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),dn=t(`$ZodNumberFormat`,(e,t)=>{St.init(e,t),un.init(e,t)}),fn=t(`$ZodBoolean`,(e,t)=>{S.init(e,t),e._zod.pattern=ht,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),pn=t(`$ZodUnknown`,(e,t)=>{S.init(e,t),e._zod.parse=e=>e}),mn=t(`$ZodNever`,(e,t)=>{S.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function hn(e,t,n){e.issues.length&&t.issues.push(...y(n,e.issues)),t.value[n]=e.value}var gn=t(`$ZodArray`,(e,t)=>{S.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>hn(t,n,e))):hn(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function _n(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...y(n,e.issues))}if(!o&&!i){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function vn(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=le(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function yn(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin===`optional`,d=c.optout===`optional`;for(let i in t){if(i===`__proto__`||s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>_n(e,n,i,t,u,d))):_n(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var bn=t(`$ZodObject`,(e,t)=>{if(S.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}let n=c(()=>vn(t));f(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=ie,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optin===`optional`,i=n._zod.optout===`optional`,a=n._zod.run({value:s[e],issues:[]},o);a instanceof Promise?c.push(a.then(n=>_n(n,t,e,s,r,i))):_n(a,t,e,s,r,i)}return i?yn(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),xn=t(`$ZodObjectJIT`,(e,t)=>{bn.init(e,t);let n=e._zod.parse,r=c(()=>vn(t)),a=e=>{let t=new Pt([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=te(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=te(r),s=e[r],c=s?._zod?.optin===`optional`,l=s?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),c&&l?t.write(`
|
|
4
|
+
if (${n}.issues.length) {
|
|
5
|
+
if (${o} in input) {
|
|
6
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
7
|
+
...iss,
|
|
8
|
+
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
9
|
+
})));
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
if (${n}.value === undefined) {
|
|
14
|
+
if (${o} in input) {
|
|
15
|
+
newResult[${o}] = undefined;
|
|
16
|
+
}
|
|
17
|
+
} else {
|
|
18
|
+
newResult[${o}] = ${n}.value;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
`):c?t.write(`
|
|
22
|
+
if (${n}.issues.length) {
|
|
23
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
24
|
+
...iss,
|
|
25
|
+
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
26
|
+
})));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (${n}.value === undefined) {
|
|
30
|
+
if (${o} in input) {
|
|
31
|
+
newResult[${o}] = undefined;
|
|
32
|
+
}
|
|
33
|
+
} else {
|
|
34
|
+
newResult[${o}] = ${n}.value;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
`):t.write(`
|
|
38
|
+
const ${n}_present = ${o} in input;
|
|
39
|
+
if (${n}.issues.length) {
|
|
40
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
41
|
+
...iss,
|
|
42
|
+
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
43
|
+
})));
|
|
44
|
+
}
|
|
45
|
+
if (!${n}_present && !${n}.issues.length) {
|
|
46
|
+
payload.issues.push({
|
|
47
|
+
code: "invalid_type",
|
|
48
|
+
expected: "nonoptional",
|
|
49
|
+
input: undefined,
|
|
50
|
+
path: [${o}]
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (${n}_present) {
|
|
55
|
+
if (${n}.value === undefined) {
|
|
56
|
+
newResult[${o}] = undefined;
|
|
57
|
+
} else {
|
|
58
|
+
newResult[${o}] = ${n}.value;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},o,s=ie,l=!i.jitless,u=l&&ae.value,d=t.catchall,ee;e._zod.parse=(i,c)=>{ee??=r.value;let f=i.value;return s(f)?l&&u&&c?.async===!1&&c.jitless!==!0?(o||=a(t.shape),i=o(i,c),d?yn([],f,i,c,ee,e):i):n(i,c):(i.issues.push({expected:`object`,code:`invalid_type`,input:f,inst:e}),i)}});function Sn(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!v(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>b(e,r,a())))}),t)}var Cn=t(`$ZodUnion`,(e,t)=>{S.init(e,t),f(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),f(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),f(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),f(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>u(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>Sn(t,r,e,i)):Sn(o,r,e,i)}}),wn=t(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,Cn.init(e,t);let n=e._zod.parse;f(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=c(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!ie(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()),input:o,path:[t.discriminator],inst:e}),i)}}),Tn=t(`$ZodIntersection`,(e,t)=>{S.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Dn(e,t,n)):Dn(e,i,a)}});function En(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(oe(e)&&oe(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=En(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=En(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Dn(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),v(e))return e;let o=En(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var On=t(`$ZodRecord`,(e,t)=>{S.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!oe(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let o=[],s=t.keyType._zod.values;if(s){n.value={};let c=new Set;for(let l of s)if(typeof l==`string`||typeof l==`number`||typeof l==`symbol`){c.add(typeof l==`number`?l.toString():l);let s=t.keyType._zod.run({value:l,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>b(e,r,a())),input:l,path:[l],inst:e});continue}let u=s.value,d=t.valueType._zod.run({value:i[l],issues:[]},r);d instanceof Promise?o.push(d.then(e=>{e.issues.length&&n.issues.push(...y(l,e.issues)),n.value[u]=e.value})):(d.issues.length&&n.issues.push(...y(l,d.issues)),n.value[u]=d.value)}let l;for(let e in i)c.has(e)||(l??=[],l.push(e));l&&l.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:l})}else{n.value={};for(let s of Reflect.ownKeys(i)){if(s===`__proto__`||!Object.prototype.propertyIsEnumerable.call(i,s))continue;let c=t.keyType._zod.run({value:s,issues:[]},r);if(c instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof s==`string`&&mt.test(s)&&c.issues.length){let e=t.keyType._zod.run({value:Number(s),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(c=e)}if(c.issues.length){t.mode===`loose`?n.value[s]=i[s]:n.issues.push({code:`invalid_key`,origin:`record`,issues:c.issues.map(e=>b(e,r,a())),input:s,path:[s],inst:e});continue}let l=t.valueType._zod.run({value:i[s],issues:[]},r);l instanceof Promise?o.push(l.then(e=>{e.issues.length&&n.issues.push(...y(s,e.issues)),n.value[c.value]=e.value})):(l.issues.length&&n.issues.push(...y(s,l.issues)),n.value[c.value]=l.value)}}return o.length?Promise.all(o).then(()=>n):n}}),kn=t(`$ZodEnum`,(e,t)=>{S.init(e,t);let n=o(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>ce.has(typeof e)).map(e=>typeof e==`string`?h(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),An=t(`$ZodLiteral`,(e,t)=>{if(S.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?h(e):e?h(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),jn=t(`$ZodTransform`,(e,t)=>{S.init(e,t),e._zod.optin=`optional`,e._zod.parse=(i,a)=>{if(a.direction===`backward`)throw new r(e.constructor.name);let o=t.transform(i.value,i);if(a.async)return(o instanceof Promise?o:Promise.resolve(o)).then(e=>(i.value=e,i.fallback=!0,i));if(o instanceof Promise)throw new n;return i.value=o,i.fallback=!0,i}});function Mn(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var Nn=t(`$ZodOptional`,(e,t)=>{S.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,f(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),f(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${u(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>Mn(e,r)):Mn(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Pn=t(`$ZodExactOptional`,(e,t)=>{Nn.init(e,t),f(e._zod,`values`,()=>t.innerType._zod.values),f(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Fn=t(`$ZodNullable`,(e,t)=>{S.init(e,t),f(e._zod,`optin`,()=>t.innerType._zod.optin),f(e._zod,`optout`,()=>t.innerType._zod.optout),f(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${u(e.source)}|null)$`):void 0}),f(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),In=t(`$ZodDefault`,(e,t)=>{S.init(e,t),e._zod.optin=`optional`,f(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Ln(e,t)):Ln(r,t)}});function Ln(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Rn=t(`$ZodPrefault`,(e,t)=>{S.init(e,t),e._zod.optin=`optional`,f(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),zn=t(`$ZodNonOptional`,(e,t)=>{S.init(e,t),f(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Bn(t,e)):Bn(i,e)}});function Bn(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var Vn=t(`$ZodCatch`,(e,t)=>{S.init(e,t),e._zod.optin=`optional`,f(e._zod,`optout`,()=>t.innerType._zod.optout),f(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>b(e,n,a()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>b(e,n,a()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),Hn=t(`$ZodPipe`,(e,t)=>{S.init(e,t),f(e._zod,`values`,()=>t.in._zod.values),f(e._zod,`optin`,()=>t.in._zod.optin),f(e._zod,`optout`,()=>t.out._zod.optout),f(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Un(e,t.in,n)):Un(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Un(e,t.out,n)):Un(r,t.out,n)}});function Un(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}var Wn=t(`$ZodReadonly`,(e,t)=>{S.init(e,t),f(e._zod,`propValues`,()=>t.innerType._zod.propValues),f(e._zod,`values`,()=>t.innerType._zod.values),f(e._zod,`optin`,()=>t.innerType?._zod?.optin),f(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Gn):Gn(r)}});function Gn(e){return e.value=Object.freeze(e.value),e}var Kn=t(`$ZodLazy`,(e,t)=>{S.init(e,t),f(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),f(e._zod,`pattern`,()=>e._zod.innerType?._zod?.pattern),f(e._zod,`propValues`,()=>e._zod.innerType?._zod?.propValues),f(e._zod,`optin`,()=>e._zod.innerType?._zod?.optin??void 0),f(e._zod,`optout`,()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),qn=t(`$ZodCustom`,(e,t)=>{x.init(e,t),S.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Jn(t,n,r,e));Jn(i,n,r,e)}});function Jn(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(xe(e))}}var Yn,Xn=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Zn(){return new Xn}(Yn=globalThis).__zod_globalRegistry??(Yn.__zod_globalRegistry=Zn());var Qn=globalThis.__zod_globalRegistry;function $n(e,t){return new e({type:`string`,..._(t)})}function er(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,..._(t)})}function tr(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,..._(t)})}function nr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,..._(t)})}function rr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,..._(t)})}function ir(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,..._(t)})}function ar(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,..._(t)})}function or(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,..._(t)})}function sr(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,..._(t)})}function cr(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,..._(t)})}function lr(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,..._(t)})}function ur(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,..._(t)})}function dr(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,..._(t)})}function fr(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,..._(t)})}function pr(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,..._(t)})}function mr(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,..._(t)})}function hr(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,..._(t)})}function gr(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,..._(t)})}function _r(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,..._(t)})}function vr(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,..._(t)})}function yr(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,..._(t)})}function br(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,..._(t)})}function xr(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,..._(t)})}function Sr(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,..._(t)})}function Cr(e,t){return new e({type:`string`,format:`date`,check:`string_format`,..._(t)})}function wr(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,..._(t)})}function Tr(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,..._(t)})}function Er(e,t){return new e({type:`number`,checks:[],..._(t)})}function Dr(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,..._(t)})}function Or(e,t){return new e({type:`boolean`,..._(t)})}function kr(e){return new e({type:`unknown`})}function Ar(e,t){return new e({type:`never`,..._(t)})}function jr(e,t){return new yt({check:`less_than`,..._(t),value:e,inclusive:!1})}function Mr(e,t){return new yt({check:`less_than`,..._(t),value:e,inclusive:!0})}function Nr(e,t){return new bt({check:`greater_than`,..._(t),value:e,inclusive:!1})}function Pr(e,t){return new bt({check:`greater_than`,..._(t),value:e,inclusive:!0})}function Fr(e,t){return new xt({check:`multiple_of`,..._(t),value:e})}function Ir(e,t){return new Ct({check:`max_length`,..._(t),maximum:e})}function Lr(e,t){return new wt({check:`min_length`,..._(t),minimum:e})}function Rr(e,t){return new Tt({check:`length_equals`,..._(t),length:e})}function zr(e,t){return new Dt({check:`string_format`,format:`regex`,..._(t),pattern:e})}function Br(e){return new Ot({check:`string_format`,format:`lowercase`,..._(e)})}function Vr(e){return new kt({check:`string_format`,format:`uppercase`,..._(e)})}function Hr(e,t){return new At({check:`string_format`,format:`includes`,..._(t),includes:e})}function Ur(e,t){return new jt({check:`string_format`,format:`starts_with`,..._(t),prefix:e})}function Wr(e,t){return new Mt({check:`string_format`,format:`ends_with`,..._(t),suffix:e})}function Gr(e){return new Nt({check:`overwrite`,tx:e})}function Kr(e){return Gr(t=>t.normalize(e))}function qr(){return Gr(e=>e.trim())}function Jr(){return Gr(e=>e.toLowerCase())}function Yr(){return Gr(e=>e.toUpperCase())}function Xr(){return Gr(e=>ne(e))}function Zr(e,t,n){return new e({type:`array`,element:t,..._(n)})}function Qr(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,..._(n)})}function $r(e,t){let n=ei(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(xe(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(xe(r))}},e(t.value,t)),t);return n}function ei(e,t){let n=new x({check:`custom`,..._(t)});return n._zod.check=e,n}function ti(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??Qn,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function w(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,w(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&T(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function ni(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
63
|
+
|
|
64
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function ri(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:ai(t,`input`,e.processors),output:ai(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function T(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return T(r.element,n);if(r.type===`set`)return T(r.valueType,n);if(r.type===`lazy`)return T(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`)return T(r.innerType,n);if(r.type===`intersection`)return T(r.left,n)||T(r.right,n);if(r.type===`record`||r.type===`map`)return T(r.keyType,n)||T(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:T(r.in,n)||T(r.out,n);if(r.type===`object`){for(let e in r.shape)if(T(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(T(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(T(e,n))return!0;return!!(r.rest&&T(r.rest,n))}return!1}var ii=(e,t={})=>n=>{let r=ti({...n,processors:t});return w(e,r),ni(r,e),ri(r,e)},ai=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=ti({...i??{},target:a,io:t,processors:n});return w(e,o),ni(o,e),ri(o,e)},oi={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},si=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=oi[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},ci=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`;let d=typeof u==`number`&&u>=(a??-1/0),ee=typeof l==`number`&&l<=(o??1/0),f=t.target===`draft-04`||t.target===`openapi-3.0`;d?f?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),ee?f?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},li=(e,t,n,r)=>{n.type=`boolean`},ui=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`BigInt cannot be represented in JSON Schema`)},di=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Symbols cannot be represented in JSON Schema`)},fi=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},pi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Undefined cannot be represented in JSON Schema`)},mi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`)},hi=(e,t,n,r)=>{n.not={}},gi=(e,t,n,r)=>{},_i=(e,t,n,r)=>{},vi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Date cannot be represented in JSON Schema`)},yi=(e,t,n,r)=>{let i=e._zod.def,a=o(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},bi=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},xi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`NaN cannot be represented in JSON Schema`)},Si=(e,t,n,r)=>{let i=n,a=e._zod.pattern;if(!a)throw Error(`Pattern not found in template literal`);i.type=`string`,i.pattern=a.source},Ci=(e,t,n,r)=>{let i=n,a={type:`string`,format:`binary`,contentEncoding:`binary`},{minimum:o,maximum:s,mime:c}=e._zod.bag;o!==void 0&&(a.minLength=o),s!==void 0&&(a.maxLength=s),c?c.length===1?(a.contentMediaType=c[0],Object.assign(i,a)):(Object.assign(i,a),i.anyOf=c.map(e=>({contentMediaType:e}))):Object.assign(i,a)},wi=(e,t,n,r)=>{n.type=`boolean`},Ti=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},Ei=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Function types cannot be represented in JSON Schema`)},Di=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},Oi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Map cannot be represented in JSON Schema`)},ki=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Set cannot be represented in JSON Schema`)},Ai=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=w(a.element,t,{...r,path:[...r.path,`items`]})},ji=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=w(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=w(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Mi=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>w(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Ni=(e,t,n,r)=>{let i=e._zod.def,a=w(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=w(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},Pi=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>w(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?w(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null;t.target===`draft-2020-12`?(i.prefixItems=c,l&&(i.items=l)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),i.minItems=c.length,l||(i.maxItems=c.length)):(i.items=c,l&&(i.additionalItems=l));let{minimum:u,maximum:d}=e._zod.bag;typeof u==`number`&&(i.minItems=u),typeof d==`number`&&(i.maxItems=d)},Fi=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=w(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else(t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=w(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=w(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},Ii=(e,t,n,r)=>{let i=e._zod.def,a=w(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Li=(e,t,n,r)=>{let i=e._zod.def;w(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Ri=(e,t,n,r)=>{let i=e._zod.def;w(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},zi=(e,t,n,r)=>{let i=e._zod.def;w(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Bi=(e,t,n,r)=>{let i=e._zod.def;w(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},Vi=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;w(o,t,r);let s=t.seen.get(e);s.ref=o},Hi=(e,t,n,r)=>{let i=e._zod.def;w(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Ui=(e,t,n,r)=>{let i=e._zod.def;w(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Wi=(e,t,n,r)=>{let i=e._zod.def;w(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Gi=(e,t,n,r)=>{let i=e._zod.innerType;w(i,t,r);let a=t.seen.get(e);a.ref=i},Ki={string:si,number:ci,boolean:li,bigint:ui,symbol:di,null:fi,undefined:pi,void:mi,never:hi,any:gi,unknown:_i,date:vi,enum:yi,literal:bi,nan:xi,template_literal:Si,file:Ci,success:wi,custom:Ti,function:Ei,transform:Di,map:Oi,set:ki,array:Ai,object:ji,union:Mi,intersection:Ni,tuple:Pi,record:Fi,nullable:Ii,nonoptional:Li,default:Ri,prefault:zi,catch:Bi,pipe:Vi,readonly:Hi,promise:Ui,optional:Wi,lazy:Gi};function qi(e,t){if(`_idmap`in e){let n=e,r=ti({...t,processors:Ki}),i={};for(let e of n._idmap.entries()){let[t,n]=e;w(n,r)}let a={};r.external={registry:n,uri:t?.uri,defs:i};for(let e of n._idmap.entries()){let[t,n]=e;ni(r,n),a[t]=ri(r,n)}return Object.keys(i).length>0&&(a.__shared={[r.target===`draft-2020-12`?`$defs`:`definitions`]:i}),{schemas:a}}let n=ti({...t,processors:Ki});return w(e,n),ni(n,e),ri(n,e)}var Ji=t(`ZodISODateTime`,(e,t)=>{Jt.init(e,t),k.init(e,t)});function Yi(e){return Sr(Ji,e)}var Xi=t(`ZodISODate`,(e,t)=>{Yt.init(e,t),k.init(e,t)});function Zi(e){return Cr(Xi,e)}var Qi=t(`ZodISOTime`,(e,t)=>{Xt.init(e,t),k.init(e,t)});function $i(e){return wr(Qi,e)}var ea=t(`ZodISODuration`,(e,t)=>{Zt.init(e,t),k.init(e,t)});function ta(e){return Tr(ea,e)}var E=t(`ZodError`,(e,t)=>{Ce.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Ee(e,t)},flatten:{value:t=>Te(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,s,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,s,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),na=De(E),ra=Oe(E),ia=ke(E),aa=je(E),oa=Ne(E),sa=Pe(E),ca=Fe(E),la=Ie(E),ua=Le(E),da=Re(E),fa=ze(E),pa=Be(E),ma=new WeakMap;function ha(e,t,n){let r=Object.getPrototypeOf(e),i=ma.get(r);if(i||(i=new Set,ma.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var D=t(`ZodType`,(e,t)=>(S.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:ai(e,`input`),output:ai(e,`output`)}}),e.toJSONSchema=ii(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>na(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>ia(e,t,n),e.parseAsync=async(t,n)=>ra(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>aa(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>oa(e,t,n),e.decode=(t,n)=>sa(e,t,n),e.encodeAsync=async(t,n)=>ca(e,t,n),e.decodeAsync=async(t,n)=>la(e,t,n),e.safeEncode=(t,n)=>ua(e,t,n),e.safeDecode=(t,n)=>da(e,t,n),e.safeEncodeAsync=async(t,n)=>fa(e,t,n),e.safeDecodeAsync=async(t,n)=>pa(e,t,n),ha(e,`ZodType`,{check(...e){let t=this.def;return this.clone(m(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return g(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(wo(e,t))},superRefine(e,t){return this.check(To(e,t))},overwrite(e){return this.check(Gr(e))},optional(){return ro(this)},exactOptional(){return ao(this)},nullable(){return so(this)},nullish(){return ro(so(this))},nonoptional(e){return mo(this,e)},array(){return N(this)},or(e){return I([this,e])},and(e){return Xa(this,e)},transform(e){return vo(this,to(e))},default(e){return lo(this,e)},prefault(e){return fo(this,e)},catch(e){return go(this,e)},pipe(e){return vo(this,e)},readonly(){return bo(this)},describe(e){let t=this.clone();return Qn.add(t,{description:e}),t},meta(...e){if(e.length===0)return Qn.get(this);let t=this.clone();return Qn.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return Qn.get(e)?.description},configurable:!0}),e)),ga=t(`_ZodString`,(e,t)=>{It.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>si(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,ha(e,`_ZodString`,{regex(...e){return this.check(zr(...e))},includes(...e){return this.check(Hr(...e))},startsWith(...e){return this.check(Ur(...e))},endsWith(...e){return this.check(Wr(...e))},min(...e){return this.check(Lr(...e))},max(...e){return this.check(Ir(...e))},length(...e){return this.check(Rr(...e))},nonempty(...e){return this.check(Lr(1,...e))},lowercase(e){return this.check(Br(e))},uppercase(e){return this.check(Vr(e))},trim(){return this.check(qr())},normalize(...e){return this.check(Kr(...e))},toLowerCase(){return this.check(Jr())},toUpperCase(){return this.check(Yr())},slugify(){return this.check(Xr())}})}),_a=t(`ZodString`,(e,t)=>{It.init(e,t),ga.init(e,t),e.email=t=>e.check(er(va,t)),e.url=t=>e.check(or(Sa,t)),e.jwt=t=>e.check(xr(La,t)),e.emoji=t=>e.check(sr(Ca,t)),e.guid=t=>e.check(tr(ya,t)),e.uuid=t=>e.check(nr(ba,t)),e.uuidv4=t=>e.check(rr(ba,t)),e.uuidv6=t=>e.check(ir(ba,t)),e.uuidv7=t=>e.check(ar(ba,t)),e.nanoid=t=>e.check(cr(wa,t)),e.guid=t=>e.check(tr(ya,t)),e.cuid=t=>e.check(lr(Ta,t)),e.cuid2=t=>e.check(ur(Ea,t)),e.ulid=t=>e.check(dr(Da,t)),e.base64=t=>e.check(vr(Pa,t)),e.base64url=t=>e.check(yr(Fa,t)),e.xid=t=>e.check(fr(Oa,t)),e.ksuid=t=>e.check(pr(ka,t)),e.ipv4=t=>e.check(mr(Aa,t)),e.ipv6=t=>e.check(hr(ja,t)),e.cidrv4=t=>e.check(gr(Ma,t)),e.cidrv6=t=>e.check(_r(Na,t)),e.e164=t=>e.check(br(Ia,t)),e.datetime=t=>e.check(Yi(t)),e.date=t=>e.check(Zi(t)),e.time=t=>e.check($i(t)),e.duration=t=>e.check(ta(t))});function O(e){return $n(_a,e)}var k=t(`ZodStringFormat`,(e,t)=>{C.init(e,t),ga.init(e,t)}),va=t(`ZodEmail`,(e,t)=>{zt.init(e,t),k.init(e,t)}),ya=t(`ZodGUID`,(e,t)=>{Lt.init(e,t),k.init(e,t)}),ba=t(`ZodUUID`,(e,t)=>{Rt.init(e,t),k.init(e,t)});function xa(e){return nr(ba,e)}var Sa=t(`ZodURL`,(e,t)=>{Bt.init(e,t),k.init(e,t)}),Ca=t(`ZodEmoji`,(e,t)=>{Vt.init(e,t),k.init(e,t)}),wa=t(`ZodNanoID`,(e,t)=>{Ht.init(e,t),k.init(e,t)}),Ta=t(`ZodCUID`,(e,t)=>{Ut.init(e,t),k.init(e,t)}),Ea=t(`ZodCUID2`,(e,t)=>{Wt.init(e,t),k.init(e,t)}),Da=t(`ZodULID`,(e,t)=>{Gt.init(e,t),k.init(e,t)}),Oa=t(`ZodXID`,(e,t)=>{Kt.init(e,t),k.init(e,t)}),ka=t(`ZodKSUID`,(e,t)=>{qt.init(e,t),k.init(e,t)}),Aa=t(`ZodIPv4`,(e,t)=>{Qt.init(e,t),k.init(e,t)}),ja=t(`ZodIPv6`,(e,t)=>{$t.init(e,t),k.init(e,t)}),Ma=t(`ZodCIDRv4`,(e,t)=>{en.init(e,t),k.init(e,t)}),Na=t(`ZodCIDRv6`,(e,t)=>{tn.init(e,t),k.init(e,t)}),Pa=t(`ZodBase64`,(e,t)=>{rn.init(e,t),k.init(e,t)}),Fa=t(`ZodBase64URL`,(e,t)=>{on.init(e,t),k.init(e,t)}),Ia=t(`ZodE164`,(e,t)=>{sn.init(e,t),k.init(e,t)}),La=t(`ZodJWT`,(e,t)=>{ln.init(e,t),k.init(e,t)}),Ra=t(`ZodNumber`,(e,t)=>{un.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ci(e,t,n,r),ha(e,`ZodNumber`,{gt(e,t){return this.check(Nr(e,t))},gte(e,t){return this.check(Pr(e,t))},min(e,t){return this.check(Pr(e,t))},lt(e,t){return this.check(jr(e,t))},lte(e,t){return this.check(Mr(e,t))},max(e,t){return this.check(Mr(e,t))},int(e){return this.check(Ba(e))},safe(e){return this.check(Ba(e))},positive(e){return this.check(Nr(0,e))},nonnegative(e){return this.check(Pr(0,e))},negative(e){return this.check(jr(0,e))},nonpositive(e){return this.check(Mr(0,e))},multipleOf(e,t){return this.check(Fr(e,t))},step(e,t){return this.check(Fr(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function A(e){return Er(Ra,e)}var za=t(`ZodNumberFormat`,(e,t)=>{dn.init(e,t),Ra.init(e,t)});function Ba(e){return Dr(za,e)}var Va=t(`ZodBoolean`,(e,t)=>{fn.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>li(e,t,n,r)});function j(e){return Or(Va,e)}var Ha=t(`ZodUnknown`,(e,t)=>{pn.init(e,t),D.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function M(){return kr(Ha)}var Ua=t(`ZodNever`,(e,t)=>{mn.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hi(e,t,n,r)});function Wa(e){return Ar(Ua,e)}var Ga=t(`ZodArray`,(e,t)=>{gn.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ai(e,t,n,r),e.element=t.element,ha(e,`ZodArray`,{min(e,t){return this.check(Lr(e,t))},nonempty(e){return this.check(Lr(1,e))},max(e,t){return this.check(Ir(e,t))},length(e,t){return this.check(Rr(e,t))},unwrap(){return this.element}})});function N(e,t){return Zr(Ga,e,t)}var Ka=t(`ZodObject`,(e,t)=>{xn.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ji(e,t,n,r),f(e,`shape`,()=>t.shape),ha(e,`ZodObject`,{keyof(){return z(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:M()})},loose(){return this.clone({...this._zod.def,catchall:M()})},strict(){return this.clone({...this._zod.def,catchall:Wa()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return pe(this,e)},safeExtend(e){return me(this,e)},merge(e){return he(this,e)},pick(e){return de(this,e)},omit(e){return fe(this,e)},partial(...e){return ge(no,this,e[0])},required(...e){return _e(po,this,e[0])}})});function P(e,t){return new Ka({type:`object`,shape:e??{},..._(t)})}function F(e,t){return new Ka({type:`object`,shape:e,catchall:M(),..._(t)})}var qa=t(`ZodUnion`,(e,t)=>{Cn.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mi(e,t,n,r),e.options=t.options});function I(e,t){return new qa({type:`union`,options:e,..._(t)})}var Ja=t(`ZodDiscriminatedUnion`,(e,t)=>{qa.init(e,t),wn.init(e,t)});function L(e,t,n){return new Ja({type:`union`,options:t,discriminator:e,..._(n)})}var Ya=t(`ZodIntersection`,(e,t)=>{Tn.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ni(e,t,n,r)});function Xa(e,t){return new Ya({type:`intersection`,left:e,right:t})}var Za=t(`ZodRecord`,(e,t)=>{On.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fi(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function R(e,t,n){return!t||!t._zod?new Za({type:`record`,keyType:O(),valueType:e,..._(t)}):new Za({type:`record`,keyType:e,valueType:t,..._(n)})}var Qa=t(`ZodEnum`,(e,t)=>{kn.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yi(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Qa({...t,checks:[],..._(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Qa({...t,checks:[],..._(r),entries:i})}});function z(e,t){return new Qa({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,..._(t)})}var $a=t(`ZodLiteral`,(e,t)=>{An.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bi(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function B(e,t){return new $a({type:`literal`,values:Array.isArray(e)?e:[e],..._(t)})}var eo=t(`ZodTransform`,(e,t)=>{jn.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Di(e,t,n,r),e._zod.parse=(n,i)=>{if(i.direction===`backward`)throw new r(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(xe(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(xe(t))}};let a=t.transform(n.value,n);return a instanceof Promise?a.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=a,n.fallback=!0,n)}});function to(e){return new eo({type:`transform`,transform:e})}var no=t(`ZodOptional`,(e,t)=>{Nn.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ro(e){return new no({type:`optional`,innerType:e})}var io=t(`ZodExactOptional`,(e,t)=>{Pn.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ao(e){return new io({type:`optional`,innerType:e})}var oo=t(`ZodNullable`,(e,t)=>{Fn.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ii(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function so(e){return new oo({type:`nullable`,innerType:e})}var co=t(`ZodDefault`,(e,t)=>{In.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ri(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function lo(e,t){return new co({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():se(t)}})}var uo=t(`ZodPrefault`,(e,t)=>{Rn.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function fo(e,t){return new uo({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():se(t)}})}var po=t(`ZodNonOptional`,(e,t)=>{zn.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Li(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function mo(e,t){return new po({type:`nonoptional`,innerType:e,..._(t)})}var ho=t(`ZodCatch`,(e,t)=>{Vn.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function go(e,t){return new ho({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var _o=t(`ZodPipe`,(e,t)=>{Hn.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vi(e,t,n,r),e.in=t.in,e.out=t.out});function vo(e,t){return new _o({type:`pipe`,in:e,out:t})}var yo=t(`ZodReadonly`,(e,t)=>{Wn.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function bo(e){return new yo({type:`readonly`,innerType:e})}var xo=t(`ZodLazy`,(e,t)=>{Kn.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gi(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function So(e){return new xo({type:`lazy`,getter:e})}var Co=t(`ZodCustom`,(e,t)=>{qn.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ti(e,t,n,r)});function wo(e,t={}){return Qr(Co,e,t)}function To(e,t){return $r(e,t)}var Eo=P({error:P({code:O(),message:O(),details:R(O(),M()).optional()})}),V=Yi({offset:!0}),H=A().int().positive(),U=xa(),W=O().regex(/^[0-9a-f]{10}$/),G=O().regex(/^[0-9a-f]{10}$/),Do=P({desktop:j().default(!0),sound:j().default(!1),when_focused:j().default(!0),muted_projects:N(O()).default([])}),Oo=P({project:W,session:U,host:O().uuid().optional()}).strict(),ko=P({title:O().min(1).max(160),body:O().min(1).max(256),project:W,session:U}).strict();P({id:O().min(1).max(128),title:O().min(1).max(160),subtitle:O().min(1).max(160).optional(),body:O().min(1).max(256),target:Oo.optional()}).strict();var Ao=P({state:z([`unverified`,`shown`,`failed`,`unsupported`]),message:O().max(512).nullable()}),jo=P({t:B(`agent-notification`),id:O().uuid(),session:O().uuid(),reason:z([`waiting_input`,`exited`]),content:ko.optional()}),Mo=P({version:O(),remote_notifications:j().optional(),remote_notification_previews:j().optional(),remote_image_uploads:j().optional(),protocol:P({major:A().int().nonnegative(),minor:A().int().nonnegative()})});I([P({nonce:O().min(16),state:z([`working`,`waiting_input`])}),P({nonce:O().min(16),event:z([`session_start`,`session_end`]),agent_session_ref:O().min(1).optional(),cwd:O().min(1),source:z([`startup`,`resume`,`clear`,`fork`,`compact`,`exit`,`other`]),parent_agent_session_ref:O().min(1).optional(),native_title:O().optional(),native_created_at:Yi({offset:!0}).optional(),native_updated_at:Yi({offset:!0}).optional()}),P({nonce:O().min(16).max(200),event:z([`turn_start`,`turn_complete`,`turn_failed`]),agent_session_ref:O().min(1).max(200),turn_id:O().min(1).max(200),prompt_hash:O().regex(/^[a-f0-9]{64}$/).optional(),reply:O().max(256*1024).refine(e=>new TextEncoder().encode(e).length<=256*1024).optional(),error:O().max(4096).optional()})]);var K={port:A().int().min(1).max(65535),autoResume:j(),fetchIntervalMinutes:A().int().min(1),logMaxBytes:A().int().min(64*1024),replayBytes:A().int().min(1024),uiStateRetentionDays:A().int().min(1),agentPath:O(),displayName:O().max(64)};P({port:K.port.default(7434),autoResume:K.autoResume.default(!0),fetchIntervalMinutes:K.fetchIntervalMinutes.default(15),logMaxBytes:K.logMaxBytes.default(10*1024*1024),replayBytes:K.replayBytes.default(256*1024),uiStateRetentionDays:K.uiStateRetentionDays.default(90),agentPath:K.agentPath.default(`~/.local/bin:~/bin:/opt/homebrew/bin:/usr/local/bin`),displayName:K.displayName.default(``)}),P(K).partial(),P({entries:N(P({path:O(),name:O(),is_git:j()}))}),P({username:O(),hostname:O(),home:O(),displayName:O().optional()});var No=O().min(1).max(64).regex(/^[A-Za-z0-9][A-Za-z0-9._-]*$/,`letters, digits, dot, underscore and hyphen only`),Po=`puddle/`,Fo=`[puddle onboarding] This is a freshly created git worktree for this task. Before starting, set up the environment:
|
|
65
|
+
|
|
66
|
+
1. Standing setup rules for this repository (user-authored):
|
|
67
|
+
{{rules}}
|
|
68
|
+
|
|
69
|
+
2. Inspect the codebase for setup requirements (README, CONTRIBUTING, lockfiles, .tool-versions, pyproject.toml, package.json, …).
|
|
70
|
+
3. Apply what the rules above settle without asking. Ask the user about anything they leave open, stating trade-offs where relevant (e.g. a symlinked .venv saves gigabytes per worktree, but parallel sessions then share mutable dependency state).
|
|
71
|
+
4. If the user states a standing rule for all future worktrees ("always…", "never…", "from now on…"), write the complete updated rules to \`.puddle/onboarding-notes.md\` in this worktree — full replacement, user-owned prose; record their decision, don't invent policy.
|
|
72
|
+
|
|
73
|
+
Then proceed with the task below (or await instructions if none is given).`,Io=`[puddle] You are joining an existing branch and worktree that other agents may be working in concurrently. Files can change underneath you, so re-check the working tree before you act, and avoid disruptive git operations (resetting, force-pushing, or deleting the branch) that would disrupt work already in progress by others.`,Lo=`This session was interrupted (daemon or machine restart). Processes you started are gone; re-verify your environment before continuing.`,Ro=[[`name`,`the resolved display name: user rename, else agent name, else sequence, else id`],[`title`,`the user rename override only (empty when unset)`],[`agentName`,`the agent's own session name (empty when the agent has not named it)`],[`sequence`,`the terminal-title name the process set (empty when it set none)`],[`branch`,`the git branch`],[`cwd`,`the worktree directory's name`],[`id`,`the first 8 characters of the session id`],[`status`,`the session status (running, waiting_input, …)`],[`agent`,`the agent type (empty for terminal sessions)`],[`separator`,`an em dash that appears only between two non-empty neighbours`]],zo="${name}",Bo=[`navy`,`gold`,`blue`,`green`,`red`,`violet`,`cyan`];P({id:G,name:No,branch_prefix:O(),icon:O().nullable().default(null),icon_colour:O().nullable().default(null),created_at:V}),P({name:No,branch_prefix:O().max(64).optional()}),P({name:No.optional(),branch_prefix:O().max(64).optional(),icon:O().max(64).nullable().optional(),icon_colour:O().max(32).nullable().optional()});var Vo=F({baseBranch:O().optional(),separateBranch:j().optional(),separateWorktree:j().optional()}),Ho=F({agent:Vo.optional(),terminal:Vo.optional()});F({allowSkipPermissions:j().default(!1),captureSessionEnv:j().default(!0),terminalAppShortcuts:j().default(!0),onboardingTemplate:O().optional(),concurrentTemplate:O().optional(),restartTemplate:O().optional(),tabTitleTemplate:O().optional(),projectOrder:N(O()).optional(),sessionDefaults:Ho.optional(),hotkeys:R(O(),O()).optional()}),R(O(),M());var Uo=O().regex(/^untitled-\d+\.md$/);P({name:Uo}),P({name:Uo,content:O(),mtime_ms:A()}),P({content:O()}),P({mtime_ms:A()}),P({id:H,profile_id:G,agent_type:O(),label:O(),config_dir:O(),skip_permissions_default:j(),logged_in:j(),created_at:V}),P({profile_id:G,agent_type:O().min(1),label:No,skip_permissions_default:j().optional(),import_dir:O().min(1).optional()}),P({label:No.optional(),skip_permissions_default:j().optional()}),P({stream:O(),term:O(),hint:O().optional()}),F({account_id:H,logged_in:j(),session_count:A().int().nonnegative(),active_session_count:A().int().nonnegative(),last_activity_at:V.nullable(),agent_usage:P({input_tokens:A().int().nonnegative(),output_tokens:A().int().nonnegative(),cache_read_input_tokens:A().int().nonnegative(),cache_creation_input_tokens:A().int().nonnegative(),message_count:A().int().nonnegative()}).nullable(),live_usage:P({captured_at:V,context_used_percentage:A().nullable(),total_cost_usd:A().nullable(),model:O().nullable()}).nullable(),subscription:P({windows:N(P({key:O(),label:O(),used_percentage:A(),resets:O().nullable()}))}).nullable()}),P({id:O(),display_name:O(),capabilities:P({resume:j(),skip_permissions:j()}),binary:O().optional(),available:j().optional()}),P({id:H,path:O(),default_base_branch:O(),onboarding_notes:O().nullable(),fetch_enabled:j(),last_fetched_at:V.nullable()}).extend({orphan_worktrees:N(O())}),P({path:O().min(1),default_base_branch:O().optional(),onboarding_notes:O().nullable().optional(),fetch_enabled:j().optional()}),P({branches:N(P({name:O(),is_session:j(),session_title:O().nullable()}))});var Wo=P({path:O(),branch:O().nullable(),is_primary:j(),dirty:j().optional(),local_only:j().optional()}),Go=P({name:O(),local_only:j()});P({worktrees:N(Wo),orphan_branches:N(Go)}),P({default_base_branch:O().optional(),onboarding_notes:O().nullable().optional(),fetch_enabled:j().optional()});var Ko=z([`starting`,`running`,`waiting_input`,`exited`,`interrupted`,`archived`]),qo=z([`agent`,`terminal`]),Jo=z([`interactive`,`headless`]),Yo=P({id:U,project_id:W,account_id:H.nullable(),worktree_path:O(),base_branch:O(),branch:O(),separate_branch:j(),kind:qo,agent_type:O().nullable(),agent_mode:Jo.optional(),detected_agent_type:O().nullable().optional(),agent_session_ref:O().nullable(),conversation_id:H.nullable().optional(),parent_conversation_id:H.nullable().optional(),title:O().nullable(),agent_title:O().nullable().optional(),conversation_missing:j().optional(),branch_owner:j().optional(),native_sync:z([`pending`,`full`,`fallback`]).optional(),osc_title:O().nullable().optional(),status:Ko,cwd:O().nullable().optional(),skip_permissions:j(),created_at:V,updated_at:V,last_activity_at:V.nullable(),worktree_missing:j().optional(),stale_running:j().optional(),git_summary:P({ahead:A().int().nonnegative(),behind:A().int().nonnegative(),dirty_files:A().int().nonnegative()}).nullable().optional()});P({project_id:W,account_id:H.optional(),kind:qo.optional(),base_branch:O().min(1).optional(),branch:O().min(1).max(200).optional(),separate_branch:j().optional(),separate_worktree:j().optional(),join_worktree:O().optional(),cwd:O().optional(),title:O().min(1).max(200).optional(),prompt:O().optional(),skip_permissions:j().optional()}),P({title:O().max(200)}),P({account_id:H}),P({account_id:H}),P({vars:N(P({name:O(),bytes:A().int().nonnegative(),value:O().optional()}))}),P({cleared:A().int().nonnegative()}),P({force:j().default(!1),delete_branch:j().default(!1)});var Xo=O().min(1).max(5),Zo=P({id:W,profile_id:G,repo_id:H,name:O(),abbrev:Xo.nullable().default(null),archived:j().default(!1),created_at:V,updated_at:V});P({profile_id:G,repo_id:H,name:O().min(1).max(100),abbrev:Xo.optional()}),P({name:O().min(1).max(100).optional(),abbrev:Xo.optional(),archived:j().optional()}),P({project:Zo,sessions:N(Yo)});var Qo=z([`project`,`profile`]);P({id:H,profile_id:G,scope:Qo,project_id:W.nullable(),title:O().nullable(),body:O(),tags:N(O()),agent_type:O().nullable(),position:A(),created_at:V,updated_at:V}),P({profile_id:G,scope:Qo,project_id:W.optional(),title:O().max(200).optional(),body:O().min(1),tags:N(O()).optional(),agent_type:O().optional()}),P({scope:Qo.optional(),project_id:W.nullable().optional(),title:O().max(200).nullable().optional(),body:O().min(1).optional(),tags:N(O()).optional(),agent_type:O().nullable().optional(),position:A().optional()});var $o=z([`on_demand`,`eager`]),q=P({session:U,path:O().min(1),root:O().min(1).optional()}),J=O().regex(/^[a-z][a-z0-9_-]*$/);P({providers:N(P({id:J,display_name:O().min(1),extensions:N(O().regex(/^[a-z0-9]+$/)).min(1),input_extensions:N(O().regex(/^[a-z0-9]+$/)).min(1),available:j(),executor:O().min(1).nullable(),eager:j()}))});var es=P({source:q,provider:J.optional(),profile_id:G.optional(),project_id:W.optional()}),ts=P({role:O().min(1),media_type:O().min(1),file:q}),ns=P({source:q,severity:z([`error`,`warning`,`info`]),message:O().min(1),line:A().int().positive(),column:A().int().positive().optional(),end_line:A().int().positive().optional(),end_column:A().int().positive().optional()}),rs=P({source:q.optional(),output:O().optional(),diagnostics:N(ns).optional()}),is=rs.extend({message:O().min(1)}),as=P({provider:J,executor:O().min(1),revision:A().int().nonnegative(),source:q,artifacts:N(ts),navigation:P({kind:O().min(1)}).optional()});es.extend({mode:$o}),P({provider:J,mode:$o,state:z([`idle`,`running`,`succeeded`,`failed`]),revision:A().int().nonnegative(),result:as.nullable(),error:is.nullable()});var os=P({placeholder:O().regex(/^\{\{[a-z][a-z0-9_]*\}\}$/),description:O().min(1)}),ss=P({mode:$o,run_when:z([`when_clicked`,`upon_file_change`]),default_command:O().min(1).nullable(),override_command:O().min(1).nullable()}),cs=es.extend({profile_id:G,project_id:W});P({provider:J,display_name:O().min(1),file_type:O().regex(/^[a-z0-9][a-z0-9_-]*$/),file_path:O().min(1),variables:N(os),commands:N(ss).min(1)}),cs.extend({mode:$o,command:O().trim().min(1).max(16384).nullable()});var ls=`00000000-0000-0000-0000-000000000000`,us=P({session:U,path:O(),kind:z([`file`,`diff`,`commit`,`external`,`untitled`]).optional(),sha:O().optional(),git_area:z([`staged`,`unstaged`]).optional(),root:O().optional(),view:z([`source`,`preview`,`linked`,`locked`]).optional(),compile_mode:$o.optional(),generated_by:J.optional()}),ds=L(`type`,[P({type:B(`editor`),tab:us}),P({type:B(`terminal`),session:U})]),fs=P({kind:B(`leaf`),id:O(),tabs:N(ds).default([]),activeKey:O().nullable().default(null),previewKey:O().nullable().default(null)}),ps=So(()=>L(`kind`,[fs,P({kind:B(`split`),id:O(),direction:z([`row`,`col`]),children:N(ps),sizes:N(A())})])),ms=F({layout_tree:ps.nullable().default(null),active_session:U.nullable().default(null),layout_ref:H.nullable().default(null)}),hs=F({session_tabs:N(U).default([]),active_session:U.nullable().default(null),editor_tabs:N(us).default([]),layout:F({}).default({}),explorer_pin:U.nullable().default(null),active_editor_tab:us.nullable().default(null),explorer_open:j().default(!0),sidebar_mode:z([`files`,`diff`,`history`,`changes`,`search`,`worktrees`]).default(`files`),sidebar_collapsed:j().default(!1),sessions_collapsed:j().default(!1),right_panel:z([`sessions`,`scratchpad`]).optional(),session_order:N(U).default([]),layout_tree:ps.nullable().default(null),layout_mode:z([`profile`,`project`]).optional(),project_layouts:R(O(),ms).default({}),layout_ref:H.nullable().default(null)});P({ui_state:hs}),P({ui_state:hs,updated_at:V});var gs=z([`project`,`profile`]);P({id:H,profile_id:G,scope:gs,project_id:W.nullable(),name:O(),layout_tree:ps.nullable(),active_session:U.nullable(),created_at:V,updated_at:V}),P({profile_id:G,scope:gs,project_id:W.optional(),name:O().min(1).max(200),layout_tree:ps.nullable(),active_session:U.nullable().optional()}),P({name:O().min(1).max(200).optional(),layout_tree:ps.nullable().optional(),active_session:U.nullable().optional()}),q.extend({root:O().min(1),page:A().int().positive(),x:A().finite().nonnegative(),y:A().finite().nonnegative()});var _s=q.extend({line:A().int().positive(),column:A().int().nonnegative().optional()}),vs=z([`image/png`,`image/jpeg`,`image/gif`,`image/webp`]);P({mime:vs,data:O().min(1)});var ys=P({path:O()});P({path:O(),line:A().int().nullable(),kind:z([`file`,`dir`]).optional(),relative_path:O().optional(),root:O().optional()});var bs=P({name:O(),type:z([`file`,`dir`,`symlink`]),size:A().int().nonnegative().nullable(),symlink:j().default(!1)});P({path:O(),entries:N(bs)});var xs=P({path:O(),content:O().nullable(),binary:j(),size:A().int().nonnegative(),mtime_ms:A()}),Ss=P({mime:O().min(1).max(128),data:O().max(4*2796203)});P({content:O(),expected_mtime_ms:A().optional()}),P({path:O(),mtime_ms:A(),size:A().int().nonnegative()}),P({files:N(P({path:O(),size:A().int().nonnegative()}))}),P({path:O().min(1),kind:z([`file`,`dir`])}),P({from:O().min(1),to:O().min(1)}),P({from:O().min(1),to:O().min(1)}),P({operation:z([`copy`,`move`]),source:P({session_id:U,root:O().optional()}),from:O().min(1),to:O().min(1)}),P({path:O().min(1)}),P({ok:B(!0),path:O()});var Cs=z([`added`,`modified`,`deleted`,`renamed`]),ws=z([`staged`,`unstaged`]),Ts=P({path:O(),status:Cs,old_path:O().nullable()}),Es=P({against:O(),base_ref:O().nullable(),entries:N(Ts),area:ws.optional()}),Ds=z([`untracked`,`modified`,`added`,`deleted`,`renamed`,`conflicted`,`ignored`]),Os=P({path:O(),status:Ds});P({entries:N(Os)});var ks=P({path:O(),status:Ds.exclude([`ignored`]),old_path:O().nullable()});P({repositories:N(P({root:O(),relative_path:O(),name:O(),owning:j(),submodule:j(),initialised:j(),head:O().nullable(),branch:O().nullable(),detached:j(),upstream:O().nullable(),ahead:A().int().nonnegative(),behind:A().int().nonnegative(),has_remote:j(),staged:N(ks),unstaged:N(ks),conflicts:N(ks)})),entries:N(Os)});var As=P({repository:O().min(1)});As.extend({paths:N(O().min(1)).min(1)}),As.extend({message:O().trim().min(1),stage_all:j().optional()}),As.extend({set_upstream:j().optional()}),P({ok:B(!0),sha:O().optional()}),P({path:O(),content:O().nullable(),binary:j(),exists:j()}),P({path:O(),repository:O().nullable(),repository_path:O().nullable(),head:O().nullable(),content:O().nullable(),binary:j(),exists:j(),tracked:j(),ignored:j()});var js=P({path:O(),ref:O(),content:O().nullable(),binary:j()}),Ms=P({sha:O(),subject:O(),author_name:O(),author_email:O(),authored_at:V,parents:N(O()).optional()});P({commits:N(Ms),has_more:j()}),P({commit:Ms.extend({body:O()}),parents:N(O()),files:N(Ts)});var Ns=P({line:A().int().positive(),text:O()}),Ps=P({path:O(),matches:N(Ns)});P({query:O(),files:N(O()),content:N(Ps),truncated:j()}),P({ports:N(P({port:A().int().min(1).max(65535),pid:A().int(),command:O(),address:O()})),scanned_at:V}),P({refreshId:O().uuid()}).strict();var Fs=P({status:B(`refreshing`),refreshId:O().uuid(),instance:O().uuid()}),Is=P({name:z([`Finder`,`File Explorer`,`File Manager`]).nullable()});P({path:O().min(1).max(4096).refine(e=>!e.includes(`\0`))}).strict();var Ls=O().regex(/^(agent|shell-[0-9]+)$/),Rs=`home`,zs={cols:A().int().min(2).max(1e3),rows:A().int().min(2).max(500)},Bs=L(`t`,[P({t:B(`auth`),token:O().max(128),resource:O().regex(/^[a-f0-9]{64}$/).optional()}),P({t:B(`attach`),session:O(),term:Ls,...zs}),P({t:B(`stdin`),session:O(),term:Ls,data:O()}),P({t:B(`resize`),session:O(),term:Ls,...zs}),P({t:B(`detach`),session:O(),term:Ls}),P({t:B(`spawn-shell`),session:O()}),P({t:B(`kill-shell`),session:O(),term:Ls}),P({t:B(`subscribe-status`)}),P({t:B(`theme`),fg:O().regex(/^#[0-9a-fA-F]{6}$/),bg:O().regex(/^#[0-9a-fA-F]{6}$/)})]),Vs=L(`t`,[jo,P({t:B(`authenticated`)}),P({t:B(`shell-spawned`),session:O(),term:O()}),P({t:B(`replay`),session:O(),term:O(),data:O()}),P({t:B(`output`),session:O(),term:O(),data:O()}),P({t:B(`status`),session:O(),status:Ko,last_activity_at:O().nullable()}),P({t:B(`renamed`),session:O(),title:O().nullable(),agent_title:O().nullable().optional(),osc_title:O().nullable().optional()}),P({t:B(`exit`),session:O(),term:O(),code:A()}),P({t:B(`notice`),level:z([`error`,`warning`]),title:O(),detail:O().optional(),session:O().optional(),term:O().optional()}),P({t:B(`account`),account_id:A(),profile_id:O(),logged_in:j()}),P({t:B(`session-switched`),source_session:O(),target_session:O(),target_project:O(),cause:z([`clear`,`resume`,`fork`]),outcome:z([`rebound`,`focused-existing`])}),P({t:B(`sessions-changed`),project_ids:N(O())}),P({t:B(`error`),message:O()})]),Hs={chunkBytes:32*1024,frameBytes:48*1024,requestBytes:256*1024,responseBytes:16*1024*1024,queueBytes:1024*1024,relayQueueBytes:64*1024*1024,requests:8,connectionsPerHost:8,connectionsPerAccount:16,connections:128,handshakeMs:1e4,invitationMs:3e5,idleMs:720*60*60*1e3,absoluteMs:2160*60*60*1e3},Y=O().uuid(),X=O().regex(/^[a-f0-9]{64}$/),Us=O().min(20).max(128),Z=O().min(1).max(128),Ws=O().trim().min(1).max(80).regex(/^[^\u0000-\u001f\u007f]+$/),Q=O().url().refine(e=>{try{let t=new URL(e);return t.protocol===`https:`&&t.origin===e&&!t.username&&!t.password}catch{return!1}},`An exact HTTPS origin is required`),Gs=P({version:B(4),service:Q,host:Y,peer:Us,invitation:X,expires:A().int().positive()}).strict();P({t:B(`connect`),host:Y}).strict(),L(`t`,[P({t:B(`registered`),host:Y}).strict(),P({t:B(`open`),connection:Y,account:Z}).strict(),P({t:B(`ready`),connection:Y,account:Z}).strict()]);var Ks=P({id:Y,peer:Us,account:Z,label:Ws,created:A(),lastUsed:A(),expires:A(),status:z([`pending`,`approved`,`revoked`])}),qs=L(`t`,[P({t:B(`status`)}).strict(),P({t:B(`pair`)}).strict(),P({t:B(`devices`)}).strict(),P({t:B(`approve`),id:Y}).strict(),P({t:B(`revoke`),id:Y}).strict(),P({t:B(`disable`)}).strict()]),Js=P({enabled:j().optional(),connected:j().optional(),host:Y.optional(),peer:Us.optional(),invitation:Gs.optional(),url:O().url().optional(),devices:N(Ks).optional(),error:O().max(256).optional()}).strict();L(`t`,[P({t:B(`hello`),account:Z,label:Ws,invitation:X.optional()}).strict(),P({t:B(`pending`),device:Ks}).strict(),P({t:B(`admitted`),generation:Y,device:Y}).strict(),P({t:B(`challenge`),nonce:X,generation:Y}).strict(),P({t:B(`participate`),nonce:X,generation:Y,resources:N(Y).max(Hs.requests+1)}).strict(),P({t:B(`request`),id:Y,method:z([`GET`,`POST`,`PATCH`]),path:O().max(8192),body:M().optional()}).strict(),P({t:B(`response`),id:Y,status:A().int().min(100).max(599),body:M()}).strict(),P({t:B(`cancel`),id:Y}).strict(),P({t:B(`stream`),id:Y}).strict(),P({t:B(`terminal`),id:Y,message:Bs}).strict(),P({t:B(`event`),message:Vs}).strict(),P({t:B(`sent`),id:Y}).strict(),P({t:B(`admin`),id:Y,request:qs}).strict(),P({t:B(`admin-result`),id:Y,result:Js}).strict(),P({t:B(`error`),code:z([`rejected`,`expired`,`unavailable`,`protocol_mismatch`]),message:O().max(256)}).strict()]),P({id:Y,index:A().int().min(0).max(8192),end:j(),data:O().max(Hs.chunkBytes)}).strict(),P({id:Y,label:Ws,online:j()}),P({push_public_key:O().max(100).optional(),push_encrypted_previews:j().optional(),providers:N(z([`google`,`github`])),protocol:B(4)}),P({user:P({id:Z,name:O(),email:O(),emailVerified:j(),twoFactorEnabled:j()}).nullable(),mfaRequired:j()}),P({label:Ws}).strict(),P({host:Y,code:X,expires:A()}).strict(),P({code:X}).strict(),P({credential:X}).strict();var Ys=P({challenge:X,label:Ws,service:Q,app:Q,expires:A().int().positive()}).strict(),Xs=P({ready:j()}).strict();P({host:Y,account:Z,credential:X}).strict().extend({service:Q,app:Q,enabled:j()}).strict();var Zs=P({service:Q.optional(),app:Q.optional(),code:X.optional(),managed:j().default(!0)}).strict(),Qs=N(A().int().min(0).max(255)).min(32).max(256);P({host:Y,peer:Us,account:Z,service:Q,label:O(),privateKey:Qs}).strict();var $s=I([qs,P({t:B(`delete_registration`)}).strict()]);I([$s,P({t:B(`enable`),registration:P({service:Q,app:Q,code:X}).strict().optional()}).strict(),P({t:B(`reset`)}).strict()]),P({service:Q,code:X}).strict();var ec=P({availability:z([`ready`,`not_installed`,`upgrade_required`]),configured:j(),enabled:j(),connected:j(),canDeleteRegistration:j().optional(),supervisor:z([`systemd`,`launchd`]).nullable(),host:Y.optional(),peer:Us.optional(),service:Q.optional(),app:Q.optional(),devices:N(Ks)});P({profile:G}).strict(),P({profile:G,request:$s}).strict(),P({profile:G,setup:Zs}).strict();var tc=O().regex(/^[a-f0-9]{64}$/),nc=O().regex(/^cn_[a-f0-9]{64}$/),rc=O().regex(/^br_[a-f0-9]{64}$/),ic=O().regex(/^iv_[a-f0-9]{64}$/);z([`browser_rejected`,`upstream_expired`,`upstream_unavailable`,`protocol_mismatch`]),L(`t`,[P({t:B(`open`),profile:G.optional()}).strict(),P({t:B(`renew`),resources:N(tc).max(2048)}).strict(),P({t:B(`close`)}).strict()]);var ac=P({t:B(`inspection`),port:A().int().min(1).max(65535),version:Mo,liveSessions:A().int().nonnegative()});L(`t`,[P({t:B(`authority`),generation:O().uuid(),token:nc.optional(),validForMs:A().int().positive().max(45e3),port:A().int().min(1).max(65535),version:Mo}).strict(),ac,P({t:B(`error`),code:z([`unavailable`,`rejected`,`invalid_control`])}).strict()]),P({invitation:ic}).strict();var oc=P({credential:rc});P({status:B(`revoked`)}),P({session:O().uuid(),port:A().int().min(1).max(65535)}).extend({path:O().max(8192).default(`/`)});var sc=P({url:O().url()});P({invitation:ic}).strict(),P({t:B(`invite`),secret:O().max(128).optional()}).strict(),P({url:O().url()}).strict();var cc=P({instance:O().uuid(),refreshId:O().uuid().nullable(),upstream:z([`ready`,`upstream_expired`,`upstream_unavailable`,`protocol_mismatch`])}),lc=P({id:O(),hash:O(),lastUsed:A()}),uc=P({hash:O(),browser:O(),prefix:O()});P({version:B(1),origin:O(),target:O(),browsers:N(lc),proxies:N(uc)});var $={imageBytes:4*1024*1024,chunkBytes:64*1024,idleMs:6e4,lifetimeMs:5*6e4};L(`action`,[P({action:B(`start`),upload:O().uuid(),mime:vs,size:A().int().positive().max($.imageBytes)}).strict(),P({action:B(`chunk`),upload:O().uuid(),offset:A().int().nonnegative().max($.imageBytes),data:O().min(4).max(4*Math.ceil($.chunkBytes/3)).regex(/^[A-Za-z0-9+/]+={0,2}$/).refine(e=>{let t=e.endsWith(`==`)?2:+!!e.endsWith(`=`);return e.length%4==0&&e.length/4*3-t<=$.chunkBytes},`Image chunk is too large or malformed`)}).strict(),P({action:B(`finish`),upload:O().uuid()}).strict(),P({action:B(`cancel`),upload:O().uuid()}).strict()]);var dc=P({received:A().int().nonnegative().max($.imageBytes)}),fc=P({id:Y,secret:X}).strict(),pc=P({key:Y,iv:O().regex(/^[a-f0-9]{24}$/),ciphertext:O().min(32).max(3072).regex(/^(?:[a-f0-9]{2})+$/)}).strict();P({subscription:P({endpoint:O().max(2048).url().refine(e=>{let t;try{t=new URL(e)}catch{return!1}let n=t.hostname;return t.protocol===`https:`&&!t.username&&!t.password&&!t.port&&!t.hash&&(n===`fcm.googleapis.com`||n===`updates.push.services.mozilla.com`||n===`web.push.apple.com`||n.endsWith(`.notify.windows.com`))},`Unsupported push service`),expirationTime:A().positive().nullable().optional(),keys:P({p256dh:O().regex(/^[A-Za-z0-9_-]{87}={0,1}$/),auth:O().regex(/^[A-Za-z0-9_-]{22}={0,2}$/)}).strict()}).strict().nullable(),preview_key:fc.optional()}).strict().omit({preview_key:!0}).extend({credential:X,device:Y}).strict(),P({credential:X,devices:N(Y).min(1).max(64),id:Y,preview:pc.optional()}).strict(),P({id:Y,host:Y,preview:pc.optional()}).strict(),P({t:B(`notify`),id:Y,content:ko.optional()}).strict(),P({accepted:A().int().nonnegative(),failed:A().int().nonnegative()}).strict(),P({enabled:j()}).strict();var mc=256*1024,hc=O().min(1).max(mc).refine(e=>new TextEncoder().encode(e).length<=mc,`Source exceeds 256 KiB`),gc=P({agent:O().min(1).max(100),mode:Jo.optional(),account:I([O().min(1).max(100),A().int().positive()]).optional(),project:O().min(1).max(200).optional(),worktree:O().min(1).max(4096).optional(),path:O().min(1).max(4096).optional(),title:O().min(1).max(200).optional()}).refine(e=>!!e.path!=!!e.project,`Choose path or project`).refine(e=>!e.path||!e.worktree,`worktree requires project`),_c=P({runtime_id:xa(),session_id:U}),vc=P({prompt:O().min(1).max(128*1024),output_schema:R(O(),M()).optional()}),yc=P({id:xa(),source:hc,input:M().optional(),accounts:R(O(),I([O(),A().int().positive()])).default({}),max_turns:A().int().min(1).max(1e3).default(50),max_agents:A().int().min(1).max(32).default(8),timeout_ms:A().int().min(1e3).max(1440*60*1e3).default(3600*1e3)});P({id:xa(),profile_id:G,source_hash:O(),status:z([`running`,`completed`,`failed`,`cancelled`,`interrupted`]),result:M().nullable(),error:O().nullable(),created_at:O(),updated_at:O()}),P({events:N(P({sequence:A().int(),run_id:xa(),type:O(),data:M(),created_at:O()}))});var bc=L(`op`,[P({op:B(`spawn`),options:gc}),P({op:B(`attach`),reference:O().min(1).max(100)}),P({op:B(`ask`),handle:_c,request:vc}),P({op:B(`stop`),handle:_c})]);L(`type`,[P({type:B(`operation`),id:A().int(),operation:bc}),P({type:B(`finished`),result:M().optional(),error:O().max(8192).optional()})]),L(`type`,[P({type:B(`start`),source:hc,input:M().optional()}),P({type:B(`reply`),id:A().int(),value:M().optional(),error:O().optional()})]),P({profile:P({id:G,name:O()}),projects:N(P({id:O(),name:O(),path:O()})),accounts:N(P({id:A(),label:O(),agent:O(),logged_in:j()})),agents:N(P({id:O(),scripted_turns:j(),modes:N(Jo).optional()}))}),P({jsonrpc:B(`2.0`),id:I([O(),A()]).optional(),method:O(),params:R(O(),M()).optional()}),P({name:O(),arguments:M().optional()});var xc=yc,Sc=P({id:xa()}),Cc=Sc.extend({after:A().int().nonnegative().default(0)});[[`puddlang_context`,`List this host profile, projects, accounts and supported agents.`,P({}).strict(),!0],[`puddlang_run`,`Execute a trusted single-file TypeScript programme on the host. Imports: puddlang (spawn, attach, input, z), zod, node: built-ins. Returns immediately with a durable run id; use status/events. Supply a fresh UUID id, or reuse it with identical input to recover an uncertain submission. spawn({agent:"codex",project:"name",account:"label"}); await agent.ask("task"); export default result. Supports structured ask({prompt,input,schema:z.object(...)}) and agent.stop().`,xc,!1],[`puddlang_status`,`Read a run and its final default export, if finished.`,Sc,!0],[`puddlang_events`,`Read up to 100 events after a sequence; paginate until empty.`,Cc,!0],[`puddlang_cancel`,`Cancel a run, interrupt its pending asks, and stop agents it created. Attached agents are retained.`,Sc,!1]].map(([e,t,n,r])=>({name:e,description:t,inputSchema:qi(n,{io:`input`}),annotations:{readOnlyHint:r,destructiveHint:!r,idempotentHint:!0,openWorldHint:!r}}));var wc=null;function Tc(){return wc}function Ec(e){return e}function Dc(e){let t=new Set;return{get:()=>localStorage.getItem(Ec(e)),set(n){n===null?localStorage.removeItem(Ec(e)):localStorage.setItem(Ec(e),n);for(let e of t)e()},subscribe(e){return t.add(e),()=>t.delete(e)}}}var Oc=Dc(`puddle.browser-authorisation`);async function kc(){localStorage.removeItem(`puddle.token`);let e=new URLSearchParams(window.location.hash.slice(1)),t=e.get(`invite`);if(e.has(`invite`)||e.has(`token`)){let e=new URL(window.location.href);e.hash=``,history.replaceState(null,``,e)}if(t)try{let e=await fetch(`/cockpit/bootstrap`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({invitation:t})});if(!e.ok)return;Oc.set(oc.parse(await e.json()).credential)}catch{}}function Ac(){Oc.set(null)}export{is as A,Do as B,vs as C,ds as D,ls as E,zo as F,Eo as H,Bo as I,Ro as L,Io as M,Fo as N,hs as O,Lo as P,Mo as R,Ss as S,_s as T,N as U,Oo as V,O as W,Is as _,Ec as a,js as b,dc as c,ec as d,Ys as f,Rs as g,Js as h,Dc as i,Po as j,rs as k,cc as l,Hs as m,Ac as n,Tc as o,Xs as p,Oc as r,$ as s,kc as t,sc as u,Fs as v,ys as w,xs as x,Es as y,Ao as z};
|
package/dist/public/assets/{blockDiagram-I7D4REHJ-NHlOsaCN.js → blockDiagram-I7D4REHJ-TUFuv4qI.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t,p as n}from"./src-_wZywoZs.js";import{a as r,b as i,c as a,rt as o,s,x as c}from"./chunk-DU6HZSFF-ziCxw8j9.js";import{t as l}from"./channel-C6g1aWXR.js";import{A as u,B as d,C as f,D as p,E as m,F as h,G as g,H as _,I as v,L as y,M as b,N as x,O as S,P as C,R as w,T,U as E,V as D,W as O,b as k,j as A,k as j,l as M,v as ee,w as te,z as ne}from"./chunk-75Z2AOVW-9vLeKuoB.js";import"./chunk-PWAF6VOD-BYtVJDwT.js";import"./chunk-GMAD6QVW-ZzqGXNRY.js";import{t as re}from"./chunk-5VM5RSS4-ZNzvKenW.js";import"./chunk-P2QGCYS3-CaO30dnF.js";import"./chunk-4HAMMTFA-Brp_wxZT.js";import{i as ie,r as N}from"./chunk-GVQU2GXP-DiJctosx.js";import{a as ae,c as oe,i as se,s as ce}from"./chunk-OSK3NFVY-ygO9ccvX.js";import{t as le}from"./graphlib-DS17s2tU.js";function ue(e){return Array.isArray(e)}function de(e){if(k(e))return e;let t=g(e);if(!fe(e))return{};if(ue(e)){let t=Array.from(e);return e.length>0&&typeof e[0]==`string`&&Object.hasOwn(e,`index`)&&(t.index=e.index,t.input=e.input),t}if(ee(e)){let t=e,n=t.constructor;return new n(t.buffer,t.byteOffset,t.length)}if(t===`[object ArrayBuffer]`)return new ArrayBuffer(e.byteLength);if(t===`[object DataView]`){let t=e,n=t.buffer,r=t.byteOffset,i=t.byteLength,a=new ArrayBuffer(i),o=new Uint8Array(n,r,i);return new Uint8Array(a).set(o),new DataView(a)}if(t===`[object Boolean]`||t===`[object Number]`||t===`[object String]`){let n=e.constructor,r=new n(e.valueOf());return t===`[object String]`?me(r,e):P(r,e),r}if(t===`[object Date]`)return new Date(Number(e));if(t===`[object RegExp]`){let t=e,n=new RegExp(t.source,t.flags);return n.lastIndex=t.lastIndex,n}if(t===`[object Symbol]`)return Object(Symbol.prototype.valueOf.call(e));if(t===`[object Map]`){let t=e,n=new Map;return t.forEach((e,t)=>{n.set(t,e)}),n}if(t===`[object Set]`){let t=e,n=new Set;return t.forEach(e=>{n.add(e)}),n}if(t===`[object Arguments]`){let t=e,n={};return P(n,t),n.length=t.length,n[Symbol.iterator]=t[Symbol.iterator],n}let n={};return he(n,e),P(n,e),pe(n,e),n}function fe(e){switch(g(e)){case f:case T:case te:case p:case m:case S:case j:case u:case x:case A:case b:case C:case h:case v:case y:case w:case ne:case d:case E:case O:case D:case _:return!0;default:return!1}}function P(e,t){for(let n in t)Object.hasOwn(t,n)&&(e[n]=t[n])}function pe(e,t){let n=Object.getOwnPropertySymbols(t);for(let r=0;r<n.length;r++){let i=n[r];Object.prototype.propertyIsEnumerable.call(t,i)&&(e[i]=t[i])}}function me(e,t){let n=t.valueOf().length;for(let r in t)Object.hasOwn(t,r)&&(Number.isNaN(Number(r))||Number(r)>=n)&&(e[r]=t[r])}function he(e,t){let n=Object.getPrototypeOf(t);n!==null&&typeof t.constructor==`function`&&Object.setPrototypeOf(e,n)}var F=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,15],r=[1,7],i=[1,13],a=[1,14],o=[1,19],s=[1,16],c=[1,17],l=[1,18],u=[8,30],d=[8,10,21,28,29,30,31,39,43,46],f=[1,23],p=[1,24],m=[8,10,15,16,21,28,29,30,31,39,43,46],h=[8,10,15,16,21,27,28,29,30,31,39,43,46],g=[1,49],_={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:`error`,4:`SPACELINE`,5:`NL`,7:`SPACE`,8:`EOF`,10:`BLOCK_DIAGRAM_KEY`,15:`LINK`,16:`START_LINK`,17:`LINK_LABEL`,18:`STR`,21:`SPACE_BLOCK`,27:`SIZE`,28:`COLUMNS`,29:`id-block`,30:`end`,31:`NODE_ID`,34:`DIR`,35:`NODE_DSTART`,36:`NODE_DEND`,37:`BLOCK_ARROW_START`,38:`BLOCK_ARROW_END`,39:`classDef`,40:`CLASSDEF_ID`,41:`CLASSDEF_STYLEOPTS`,42:`DEFAULT`,43:`class`,44:`CLASSENTITY_IDS`,45:`STYLECLASS`,46:`style`,47:`STYLE_ENTITY_IDS`,48:`STYLE_DEFINITION_DATA`},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 4:r.getLogger().debug(`Rule: separator (NL) `);break;case 5:r.getLogger().debug(`Rule: separator (Space) `);break;case 6:r.getLogger().debug(`Rule: separator (EOF) `);break;case 7:r.getLogger().debug(`Rule: hierarchy: `,a[s-1]),r.setHierarchy(a[s-1]);break;case 8:r.getLogger().debug(`Stop NL `);break;case 9:r.getLogger().debug(`Stop EOF `);break;case 10:r.getLogger().debug(`Stop NL2 `);break;case 11:r.getLogger().debug(`Stop EOF2 `);break;case 12:r.getLogger().debug(`Rule: statement: `,a[s]),typeof a[s].length==`number`?this.$=a[s]:this.$=[a[s]];break;case 13:r.getLogger().debug(`Rule: statement #2: `,a[s-1]),this.$=[a[s-1]].concat(a[s]);break;case 14:r.getLogger().debug(`Rule: link: `,a[s],e),this.$={edgeTypeStr:a[s],label:``};break;case 15:r.getLogger().debug(`Rule: LABEL link: `,a[s-3],a[s-1],a[s]),this.$={edgeTypeStr:a[s],label:a[s-1]};break;case 18:let t=parseInt(a[s]),n=r.generateId();this.$={id:n,type:`space`,label:``,width:t,children:[]};break;case 23:r.getLogger().debug(`Rule: (nodeStatement link node) `,a[s-2],a[s-1],a[s],` typestr: `,a[s-1].edgeTypeStr);let i=r.edgeStrToEdgeData(a[s-1].edgeTypeStr),o=r.edgeStrToEdgeStartData(a[s-1].edgeTypeStr),c=r.edgeStrToThickness(a[s-1].edgeTypeStr),l=r.edgeStrToPattern(a[s-1].edgeTypeStr);this.$=[{id:a[s-2].id,label:a[s-2].label,type:a[s-2].type,directions:a[s-2].directions},{id:a[s-2].id+`-`+a[s].id,start:a[s-2].id,end:a[s].id,label:a[s-1].label,type:`edge`,thickness:c,pattern:l,directions:a[s].directions,arrowTypeEnd:i,arrowTypeStart:o},{id:a[s].id,label:a[s].label,type:r.typeStr2Type(a[s].typeStr),directions:a[s].directions}];break;case 24:r.getLogger().debug(`Rule: nodeStatement (abc88 node size) `,a[s-1],a[s]),this.$={id:a[s-1].id,label:a[s-1].label,type:r.typeStr2Type(a[s-1].typeStr),directions:a[s-1].directions,widthInColumns:parseInt(a[s],10)};break;case 25:r.getLogger().debug(`Rule: nodeStatement (node) `,a[s]),this.$={id:a[s].id,label:a[s].label,type:r.typeStr2Type(a[s].typeStr),directions:a[s].directions,widthInColumns:1};break;case 26:r.getLogger().debug(`APA123`,this?this:`na`),r.getLogger().debug(`COLUMNS: `,a[s]),this.$={type:`column-setting`,columns:a[s]===`auto`?-1:parseInt(a[s])};break;case 27:r.getLogger().debug(`Rule: id-block statement : `,a[s-2],a[s-1]),r.generateId(),this.$={...a[s-2],type:`composite`,children:a[s-1]};break;case 28:r.getLogger().debug(`Rule: blockStatement : `,a[s-2],a[s-1],a[s]);let u=r.generateId();this.$={id:u,type:`composite`,label:``,children:a[s-1]};break;case 29:r.getLogger().debug(`Rule: node (NODE_ID separator): `,a[s]),this.$={id:a[s]};break;case 30:r.getLogger().debug(`Rule: node (NODE_ID nodeShapeNLabel separator): `,a[s-1],a[s]),this.$={id:a[s-1],label:a[s].label,typeStr:a[s].typeStr,directions:a[s].directions};break;case 31:r.getLogger().debug(`Rule: dirList: `,a[s]),this.$=[a[s]];break;case 32:r.getLogger().debug(`Rule: dirList: `,a[s-1],a[s]),this.$=[a[s-1]].concat(a[s]);break;case 33:r.getLogger().debug(`Rule: nodeShapeNLabel: `,a[s-2],a[s-1],a[s]),this.$={typeStr:a[s-2]+a[s],label:a[s-1]};break;case 34:r.getLogger().debug(`Rule: BLOCK_ARROW nodeShapeNLabel: `,a[s-3],a[s-2],` #3:`,a[s-1],a[s]),this.$={typeStr:a[s-3]+a[s],label:a[s-2],directions:a[s-1]};break;case 35:case 36:this.$={type:`classDef`,id:a[s-1].trim(),css:a[s].trim()};break;case 37:this.$={type:`applyClass`,id:a[s-1].trim(),styleClass:a[s].trim()};break;case 38:this.$={type:`applyStyles`,id:a[s-1].trim(),stylesStr:a[s].trim()};break}},`anonymous`),table:[{9:1,10:[1,2]},{1:[3]},{10:n,11:3,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:i,29:a,31:o,39:s,43:c,46:l},{8:[1,20]},t(u,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:n,21:r,28:i,29:a,31:o,39:s,43:c,46:l}),t(d,[2,16],{14:22,15:f,16:p}),t(d,[2,17]),t(d,[2,18]),t(d,[2,19]),t(d,[2,20]),t(d,[2,21]),t(d,[2,22]),t(m,[2,25],{27:[1,25]}),t(d,[2,26]),{19:26,26:12,31:o},{10:n,11:27,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:i,29:a,31:o,39:s,43:c,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},t(h,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},t(u,[2,13]),{26:35,31:o},{31:[2,14]},{17:[1,36]},t(m,[2,24]),{10:n,11:37,13:4,14:22,15:f,16:p,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:i,29:a,31:o,39:s,43:c,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},t(h,[2,30]),{18:[1,43]},{18:[1,44]},t(m,[2,23]),{18:[1,45]},{30:[1,46]},t(d,[2,28]),t(d,[2,35]),t(d,[2,36]),t(d,[2,37]),t(d,[2,38]),{36:[1,47]},{33:48,34:g},{15:[1,50]},t(d,[2,27]),t(h,[2,33]),{38:[1,51]},{33:52,34:g,38:[2,31]},{31:[2,15]},t(h,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
|
|
1
|
+
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t,p as n}from"./src-_wZywoZs.js";import{a as r,b as i,c as a,rt as o,s,x as c}from"./chunk-DU6HZSFF-1ZoT19aa.js";import{t as l}from"./channel-Bl1m0NKH.js";import{A as u,B as d,C as f,D as p,E as m,F as h,G as g,H as _,I as v,L as y,M as b,N as x,O as S,P as C,R as w,T,U as E,V as D,W as O,b as k,j as A,k as j,l as M,v as ee,w as te,z as ne}from"./chunk-75Z2AOVW-CYC6lmPG.js";import"./chunk-PWAF6VOD-CTSTb7zN.js";import"./chunk-GMAD6QVW-BzDEhlK8.js";import{t as re}from"./chunk-5VM5RSS4-ZNzvKenW.js";import"./chunk-P2QGCYS3-C5-f0Lvg.js";import"./chunk-4HAMMTFA-eolw8o4c.js";import{i as ie,r as N}from"./chunk-GVQU2GXP-CZrUjjq3.js";import{a as ae,c as oe,i as se,s as ce}from"./chunk-OSK3NFVY-Cs_K17E_.js";import{t as le}from"./graphlib-DS17s2tU.js";function ue(e){return Array.isArray(e)}function de(e){if(k(e))return e;let t=g(e);if(!fe(e))return{};if(ue(e)){let t=Array.from(e);return e.length>0&&typeof e[0]==`string`&&Object.hasOwn(e,`index`)&&(t.index=e.index,t.input=e.input),t}if(ee(e)){let t=e,n=t.constructor;return new n(t.buffer,t.byteOffset,t.length)}if(t===`[object ArrayBuffer]`)return new ArrayBuffer(e.byteLength);if(t===`[object DataView]`){let t=e,n=t.buffer,r=t.byteOffset,i=t.byteLength,a=new ArrayBuffer(i),o=new Uint8Array(n,r,i);return new Uint8Array(a).set(o),new DataView(a)}if(t===`[object Boolean]`||t===`[object Number]`||t===`[object String]`){let n=e.constructor,r=new n(e.valueOf());return t===`[object String]`?me(r,e):P(r,e),r}if(t===`[object Date]`)return new Date(Number(e));if(t===`[object RegExp]`){let t=e,n=new RegExp(t.source,t.flags);return n.lastIndex=t.lastIndex,n}if(t===`[object Symbol]`)return Object(Symbol.prototype.valueOf.call(e));if(t===`[object Map]`){let t=e,n=new Map;return t.forEach((e,t)=>{n.set(t,e)}),n}if(t===`[object Set]`){let t=e,n=new Set;return t.forEach(e=>{n.add(e)}),n}if(t===`[object Arguments]`){let t=e,n={};return P(n,t),n.length=t.length,n[Symbol.iterator]=t[Symbol.iterator],n}let n={};return he(n,e),P(n,e),pe(n,e),n}function fe(e){switch(g(e)){case f:case T:case te:case p:case m:case S:case j:case u:case x:case A:case b:case C:case h:case v:case y:case w:case ne:case d:case E:case O:case D:case _:return!0;default:return!1}}function P(e,t){for(let n in t)Object.hasOwn(t,n)&&(e[n]=t[n])}function pe(e,t){let n=Object.getOwnPropertySymbols(t);for(let r=0;r<n.length;r++){let i=n[r];Object.prototype.propertyIsEnumerable.call(t,i)&&(e[i]=t[i])}}function me(e,t){let n=t.valueOf().length;for(let r in t)Object.hasOwn(t,r)&&(Number.isNaN(Number(r))||Number(r)>=n)&&(e[r]=t[r])}function he(e,t){let n=Object.getPrototypeOf(t);n!==null&&typeof t.constructor==`function`&&Object.setPrototypeOf(e,n)}var F=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,15],r=[1,7],i=[1,13],a=[1,14],o=[1,19],s=[1,16],c=[1,17],l=[1,18],u=[8,30],d=[8,10,21,28,29,30,31,39,43,46],f=[1,23],p=[1,24],m=[8,10,15,16,21,28,29,30,31,39,43,46],h=[8,10,15,16,21,27,28,29,30,31,39,43,46],g=[1,49],_={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:`error`,4:`SPACELINE`,5:`NL`,7:`SPACE`,8:`EOF`,10:`BLOCK_DIAGRAM_KEY`,15:`LINK`,16:`START_LINK`,17:`LINK_LABEL`,18:`STR`,21:`SPACE_BLOCK`,27:`SIZE`,28:`COLUMNS`,29:`id-block`,30:`end`,31:`NODE_ID`,34:`DIR`,35:`NODE_DSTART`,36:`NODE_DEND`,37:`BLOCK_ARROW_START`,38:`BLOCK_ARROW_END`,39:`classDef`,40:`CLASSDEF_ID`,41:`CLASSDEF_STYLEOPTS`,42:`DEFAULT`,43:`class`,44:`CLASSENTITY_IDS`,45:`STYLECLASS`,46:`style`,47:`STYLE_ENTITY_IDS`,48:`STYLE_DEFINITION_DATA`},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 4:r.getLogger().debug(`Rule: separator (NL) `);break;case 5:r.getLogger().debug(`Rule: separator (Space) `);break;case 6:r.getLogger().debug(`Rule: separator (EOF) `);break;case 7:r.getLogger().debug(`Rule: hierarchy: `,a[s-1]),r.setHierarchy(a[s-1]);break;case 8:r.getLogger().debug(`Stop NL `);break;case 9:r.getLogger().debug(`Stop EOF `);break;case 10:r.getLogger().debug(`Stop NL2 `);break;case 11:r.getLogger().debug(`Stop EOF2 `);break;case 12:r.getLogger().debug(`Rule: statement: `,a[s]),typeof a[s].length==`number`?this.$=a[s]:this.$=[a[s]];break;case 13:r.getLogger().debug(`Rule: statement #2: `,a[s-1]),this.$=[a[s-1]].concat(a[s]);break;case 14:r.getLogger().debug(`Rule: link: `,a[s],e),this.$={edgeTypeStr:a[s],label:``};break;case 15:r.getLogger().debug(`Rule: LABEL link: `,a[s-3],a[s-1],a[s]),this.$={edgeTypeStr:a[s],label:a[s-1]};break;case 18:let t=parseInt(a[s]),n=r.generateId();this.$={id:n,type:`space`,label:``,width:t,children:[]};break;case 23:r.getLogger().debug(`Rule: (nodeStatement link node) `,a[s-2],a[s-1],a[s],` typestr: `,a[s-1].edgeTypeStr);let i=r.edgeStrToEdgeData(a[s-1].edgeTypeStr),o=r.edgeStrToEdgeStartData(a[s-1].edgeTypeStr),c=r.edgeStrToThickness(a[s-1].edgeTypeStr),l=r.edgeStrToPattern(a[s-1].edgeTypeStr);this.$=[{id:a[s-2].id,label:a[s-2].label,type:a[s-2].type,directions:a[s-2].directions},{id:a[s-2].id+`-`+a[s].id,start:a[s-2].id,end:a[s].id,label:a[s-1].label,type:`edge`,thickness:c,pattern:l,directions:a[s].directions,arrowTypeEnd:i,arrowTypeStart:o},{id:a[s].id,label:a[s].label,type:r.typeStr2Type(a[s].typeStr),directions:a[s].directions}];break;case 24:r.getLogger().debug(`Rule: nodeStatement (abc88 node size) `,a[s-1],a[s]),this.$={id:a[s-1].id,label:a[s-1].label,type:r.typeStr2Type(a[s-1].typeStr),directions:a[s-1].directions,widthInColumns:parseInt(a[s],10)};break;case 25:r.getLogger().debug(`Rule: nodeStatement (node) `,a[s]),this.$={id:a[s].id,label:a[s].label,type:r.typeStr2Type(a[s].typeStr),directions:a[s].directions,widthInColumns:1};break;case 26:r.getLogger().debug(`APA123`,this?this:`na`),r.getLogger().debug(`COLUMNS: `,a[s]),this.$={type:`column-setting`,columns:a[s]===`auto`?-1:parseInt(a[s])};break;case 27:r.getLogger().debug(`Rule: id-block statement : `,a[s-2],a[s-1]),r.generateId(),this.$={...a[s-2],type:`composite`,children:a[s-1]};break;case 28:r.getLogger().debug(`Rule: blockStatement : `,a[s-2],a[s-1],a[s]);let u=r.generateId();this.$={id:u,type:`composite`,label:``,children:a[s-1]};break;case 29:r.getLogger().debug(`Rule: node (NODE_ID separator): `,a[s]),this.$={id:a[s]};break;case 30:r.getLogger().debug(`Rule: node (NODE_ID nodeShapeNLabel separator): `,a[s-1],a[s]),this.$={id:a[s-1],label:a[s].label,typeStr:a[s].typeStr,directions:a[s].directions};break;case 31:r.getLogger().debug(`Rule: dirList: `,a[s]),this.$=[a[s]];break;case 32:r.getLogger().debug(`Rule: dirList: `,a[s-1],a[s]),this.$=[a[s-1]].concat(a[s]);break;case 33:r.getLogger().debug(`Rule: nodeShapeNLabel: `,a[s-2],a[s-1],a[s]),this.$={typeStr:a[s-2]+a[s],label:a[s-1]};break;case 34:r.getLogger().debug(`Rule: BLOCK_ARROW nodeShapeNLabel: `,a[s-3],a[s-2],` #3:`,a[s-1],a[s]),this.$={typeStr:a[s-3]+a[s],label:a[s-2],directions:a[s-1]};break;case 35:case 36:this.$={type:`classDef`,id:a[s-1].trim(),css:a[s].trim()};break;case 37:this.$={type:`applyClass`,id:a[s-1].trim(),styleClass:a[s].trim()};break;case 38:this.$={type:`applyStyles`,id:a[s-1].trim(),stylesStr:a[s].trim()};break}},`anonymous`),table:[{9:1,10:[1,2]},{1:[3]},{10:n,11:3,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:i,29:a,31:o,39:s,43:c,46:l},{8:[1,20]},t(u,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:n,21:r,28:i,29:a,31:o,39:s,43:c,46:l}),t(d,[2,16],{14:22,15:f,16:p}),t(d,[2,17]),t(d,[2,18]),t(d,[2,19]),t(d,[2,20]),t(d,[2,21]),t(d,[2,22]),t(m,[2,25],{27:[1,25]}),t(d,[2,26]),{19:26,26:12,31:o},{10:n,11:27,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:i,29:a,31:o,39:s,43:c,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},t(h,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},t(u,[2,13]),{26:35,31:o},{31:[2,14]},{17:[1,36]},t(m,[2,24]),{10:n,11:37,13:4,14:22,15:f,16:p,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:i,29:a,31:o,39:s,43:c,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},t(h,[2,30]),{18:[1,43]},{18:[1,44]},t(m,[2,23]),{18:[1,45]},{30:[1,46]},t(d,[2,28]),t(d,[2,35]),t(d,[2,36]),t(d,[2,37]),t(d,[2,38]),{36:[1,47]},{33:48,34:g},{15:[1,50]},t(d,[2,27]),t(h,[2,33]),{38:[1,51]},{33:52,34:g,38:[2,31]},{31:[2,15]},t(h,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
|
|
2
2
|
`+h.showPosition()+`
|
|
3
3
|
Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};_.lexer=(function(){return{EOF:1,parseError:e(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:e(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:e(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:e(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:e(function(){return this._more=!0,this},`more`),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:e(function(e){this.unput(this.match.slice(e))},`less`),pastInput:e(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:e(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:e(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
|