sliccy 6.167.0 → 6.169.0
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/README.md +6 -5
- package/dist/node-server/_shared/agent-wire-types.d.ts +9 -1
- package/dist/node-server/_shared/agent-wire-types.d.ts.map +1 -1
- package/dist/node-server/_shared/computer-protocol.d.ts +2 -0
- package/dist/node-server/_shared/computer-protocol.d.ts.map +1 -1
- package/dist/node-server/_shared/tray-sync-protocol.d.ts +119 -3
- package/dist/node-server/_shared/tray-sync-protocol.d.ts.map +1 -1
- package/dist/node-server/_shared/tray-sync-protocol.js +132 -2
- package/dist/node-server/_shared/tray-sync-protocol.js.map +1 -1
- package/dist/node-server/computer-demo.d.ts +36 -0
- package/dist/node-server/computer-demo.js +126 -0
- package/dist/node-server/index.js +13 -3
- package/dist/node-server/runtime-flags.d.ts +2 -0
- package/dist/node-server/runtime-flags.js +5 -0
- package/dist/ui/.vite/manifest.json +275 -260
- package/dist/ui/assets/{SKILL-BGEZa-y0.js → SKILL-BTHo2BzY.js} +1 -1
- package/dist/ui/assets/{SKILL-Bpepfqq0.js → SKILL-BULOq3ys.js} +1 -1
- package/dist/ui/assets/{SKILL-DEFDsScb.js → SKILL-CLL4Q13w.js} +1 -1
- package/dist/ui/assets/SKILL-maxwOcxi.js +1 -0
- package/dist/ui/assets/{account-store-B05_LKnj.js → account-store-C0smCH0b.js} +1 -1
- package/dist/ui/assets/{account-store-CNTI4kr_.js → account-store-_oWY-N-g.js} +2 -2
- package/dist/ui/assets/{adobe-nu3irXcy.js → adobe-D8bfhWFa.js} +1 -1
- package/dist/ui/assets/{adobe-CRRWEbtf.js → adobe-i2veKh2G.js} +2 -2
- package/dist/ui/assets/{agent-panels-DvH_qfTh.js → agent-panels-Bt83ejkl.js} +1 -1
- package/dist/ui/assets/{almost-bash-shell-headless-BA5r_r61.js → almost-bash-shell-headless-CXYALRet.js} +521 -582
- package/dist/ui/assets/{apply-layout-CASSSWEy.js → apply-layout-C4DuaXQ1.js} +1 -1
- package/dist/ui/assets/approval-timeout-BQ29Z0gf.js +1 -0
- package/dist/ui/assets/{apps-BGe9_zJ7.js → apps-DpExQYs8.js} +1 -1
- package/dist/ui/assets/{azure-openai-C-Iw82HZ.js → azure-openai-CGgFuiTh.js} +1 -1
- package/dist/ui/assets/{azure-openai-DuJciOKd.js → azure-openai-Cm0dqkf0.js} +1 -1
- package/dist/ui/assets/{backend-hostfs-DdAVlPMP.js → backend-hostfs-BZXs8PNk.js} +1 -1
- package/dist/ui/assets/browser-DuyhpHbR.js +1 -0
- package/dist/ui/assets/{capability-C2eJ1wdx.js → capability-SIitRcq_.js} +2 -2
- package/dist/ui/assets/{cdp-DG8TVjf3.js → cdp-UL1FYYjc.js} +2 -2
- package/dist/ui/assets/{cerebras-Xadzrxfp.js → cerebras-BEKAS5HH.js} +1 -1
- package/dist/ui/assets/{cerebras-BXwtUxTj.js → cerebras-nQZqQsKF.js} +1 -1
- package/dist/ui/assets/{client-BDN4zG90.js → client-_vVqanZy.js} +1 -1
- package/dist/ui/assets/{composer-speech-_uq5e0Bo.js → composer-speech-BPb0h67H.js} +1 -1
- package/dist/ui/assets/{connect-surface-odDz37TJ.js → connect-surface-EJ0FRStY.js} +1 -1
- package/dist/ui/assets/context-compaction-Dpr7xgBZ.js +58 -0
- package/dist/ui/assets/core-DWdpOAZd.js +62 -0
- package/dist/ui/assets/core-w0-0FXns.js +36 -0
- package/dist/ui/assets/{directed-approval-D_AXAvuz.js → directed-approval-CPSbebEZ.js} +1 -1
- package/dist/ui/assets/{discovery-preference-TziZ7Yxu.js → discovery-preference-G3mw_EUO.js} +1 -1
- package/dist/ui/assets/encode-frame-30wbFN-H.js +1 -0
- package/dist/ui/assets/engine-CzMNXd8U.js +1 -0
- package/dist/ui/assets/{ensure-speech-assets-DTj236n-.js → ensure-speech-assets-DPjgwmlG.js} +1 -1
- package/dist/ui/assets/es-DJTRBqjm.js +52 -0
- package/dist/ui/assets/{extension-ops-DNPAsYbK.js → extension-ops-B2RMipFn.js} +1 -1
- package/dist/ui/assets/{float-topology-CurCyQFy.js → float-topology-CyZCUfkj.js} +1 -1
- package/dist/ui/assets/{follower-navigate-watcher-C98XMw_C.js → follower-navigate-watcher-BAstHBQ5.js} +1 -1
- package/dist/ui/assets/frames-7E6RloFP.js +1 -0
- package/dist/ui/assets/{frozen-archive-writer-BIzZxx8R.js → frozen-archive-writer-rq_r_D3R.js} +2 -2
- package/dist/ui/assets/{fs-CJs9n90Q.js → fs-B9TgYyVA.js} +2 -2
- package/dist/ui/assets/{fs-Bq8bUwe2.js → fs-KJBUdRz_.js} +1 -1
- package/dist/ui/assets/{gelatiere-store-BY0hZvSS.js → gelatiere-store-DIE4b-Va.js} +1 -1
- package/dist/ui/assets/gelatiere-unit-wx8F8dnF.js +1 -0
- package/dist/ui/assets/{github-D1gd3q6u.js → github-CgEE40ok.js} +2 -2
- package/dist/ui/assets/{github-uDwUwz5H.js → github-_GgWC1Vq.js} +1 -1
- package/dist/ui/assets/{github-auth-CzzE1eDf.js → github-auth-Ba7C_Kly.js} +1 -1
- package/dist/ui/assets/{github-copilot-Bx2lXrwK.js → github-copilot-jobL3_Cf.js} +1 -1
- package/dist/ui/assets/{github-copilot-DidNEEe_.js → github-copilot-rsfkYfvK.js} +1 -1
- package/dist/ui/assets/{github-install--_xp8s-S.js → github-install-DtlYn56m.js} +1 -1
- package/dist/ui/assets/{github-zip-Bs35nBig.js → github-zip-BanSb9qW.js} +1 -1
- package/dist/ui/assets/{guest-tool-gate-B-lZT9hl.js → guest-tool-gate-C6sp1l3H.js} +1 -1
- package/dist/ui/assets/{hear-BNmJphKg.js → hear-zSghqsv6.js} +1 -1
- package/dist/ui/assets/{help-C7Nq107k.js → help-BkjaKwT1.js} +1 -1
- package/dist/ui/assets/{host-iTtS0MRF.js → host-BjOvrhMS.js} +1 -1
- package/dist/ui/assets/host-command-XUdketMY.js +28 -0
- package/dist/ui/assets/icons-BMNa26vG.js +1 -0
- package/dist/ui/assets/idle-compaction-CwYw083A.js +1 -0
- package/dist/ui/assets/{installer-C0xiAs69.js → installer-CYXMipeW.js} +1 -1
- package/dist/ui/assets/interrupted-work-recovery-p8rpTJ6o.js +1 -0
- package/dist/ui/assets/{isomorphic-git-B7et_8Xe.js → isomorphic-git-B9eVtfwq.js} +10 -10
- package/dist/ui/assets/{isomorphic-git-D2fV6xS-.js → isomorphic-git-DXMEKpHT.js} +7 -7
- package/dist/ui/assets/{js-realm-worker-B9Rz0g1p.js → js-realm-worker-B9VuUz7Q.js} +2 -2
- package/dist/ui/assets/{jsh-executor-C7QPZ2Qr.js → jsh-executor-BhNH2E0v.js} +4 -4
- package/dist/ui/assets/{jsh-runtime-extensions-ddeGEOUw.js → jsh-runtime-extensions-CmdnQhXG.js} +1 -1
- package/dist/ui/assets/kernel-worker-CBI5EKGn.js +1186 -0
- package/dist/ui/assets/keys-Bluq5eTH.js +1 -0
- package/dist/ui/assets/lick-urls-CgPiVwD-.js +1 -0
- package/dist/ui/assets/{lick-ws-bridge-BcAhlead.js → lick-ws-bridge-BFrcBnVV.js} +1 -1
- package/dist/ui/assets/lick-ws-bridge-DVoxwaqS.js +1 -0
- package/dist/ui/assets/{live-session-snapshot-COMr2v0o.js → live-session-snapshot-Cw5xb5EQ.js} +1 -1
- package/dist/ui/assets/{local-llm-DdGb9WMG.js → local-llm-BRe_Kttg.js} +1 -1
- package/dist/ui/assets/{local-llm-DqeU7kV3.js → local-llm-C7T1M_NI.js} +1 -1
- package/dist/ui/assets/{main-jc6OS8lz.js → main-BfonTdzP.js} +3 -3
- package/dist/ui/assets/{main-cherry-BGZmJFd_.js → main-cherry-Cty_ShgD.js} +1 -1
- package/dist/ui/assets/{memory-curation-seam-B8pprlUo.js → memory-curation-seam-dmTVk3Ov.js} +1 -1
- package/dist/ui/assets/{memory-health-CGkpyA7o.js → memory-health-9iNdh0Ac.js} +1 -1
- package/dist/ui/assets/memory-v2-flag-D4biUAiV.js +1 -0
- package/dist/ui/assets/{memory-write-execute-B-ahXjaO.js → memory-write-execute-C9xS6Q1z.js} +1 -1
- package/dist/ui/assets/{mount-FkNAB0be.js → mount-B_VZbcPY.js} +1 -1
- package/dist/ui/assets/{mount-BzdPNQoA.js → mount-Bq4ov4Wg.js} +3 -3
- package/dist/ui/assets/{mount-bridge-client-BO0N4wwP.js → mount-bridge-client-BOZDQLbT.js} +1 -1
- package/dist/ui/assets/{mount-bridge-client-CRnohfom.js → mount-bridge-client-BRywSH1d.js} +1 -1
- package/dist/ui/assets/{mv-DRuZuDHt.js → mv-BE_lEtyG.js} +1 -1
- package/dist/ui/assets/{new-session-B8iOhaK0.js → new-session-BJqFQPRu.js} +2 -2
- package/dist/ui/assets/{oauth-bootstrap-B9PwK4-d.js → oauth-bootstrap-CFXmccC5.js} +2 -2
- package/dist/ui/assets/{oauth-service-UTPOqIwj.js → oauth-service-CRmx6zI1.js} +1 -1
- package/dist/ui/assets/{oauth-service-Bkaz0Dt4.js → oauth-service-WTeDvR5m.js} +1 -1
- package/dist/ui/assets/{onboarding-orchestrator-Cc8Glrem.js → onboarding-orchestrator-M3HJvymL.js} +1 -1
- package/dist/ui/assets/{openai-codex-BrQ1tsgu.js → openai-codex-BWGWiycb.js} +1 -1
- package/dist/ui/assets/{openai-codex-DmHr_2RR.js → openai-codex-NAo35j43.js} +1 -1
- package/dist/ui/assets/{openrouter-BvM36eS5.js → openrouter-Bhxgi8JW.js} +1 -1
- package/dist/ui/assets/{openrouter-free-CFBzPY5J.js → openrouter-free-DersFAEc.js} +1 -1
- package/dist/ui/assets/{openrouter-free-CUKlyrhq.js → openrouter-free-Dl2pScMt.js} +1 -1
- package/dist/ui/assets/{openrouter-oauth-DOdpRMfw.js → openrouter-oauth-C3bVnGt2.js} +1 -1
- package/dist/ui/assets/{openrouter-oauth-RC0CxY4X.js → openrouter-oauth-DW4_wGaN.js} +1 -1
- package/dist/ui/assets/{openrouter-C6WDBJvB.js → openrouter-sloSkMqY.js} +1 -1
- package/dist/ui/assets/{opfs-mount-B78yj9gx.js → opfs-mount-FspqzE40.js} +1 -1
- package/dist/ui/assets/{page-approval-service-Dy-UA1aK.js → page-approval-service-BkqDCbBQ.js} +1 -1
- package/dist/ui/assets/panel-rpc-handlers-CwCdqXzk.js +2 -0
- package/dist/ui/assets/{panelize-shell-CFPiIneK.js → panelize-shell-c-tVlGNY.js} +1 -1
- package/dist/ui/assets/{pi-edit-execution-BDl_Xp_M.js → pi-edit-execution-Brw1YFDp.js} +1 -1
- package/dist/ui/assets/{port-bridge-client-ff8DctEN.js → port-bridge-client-CZFX4fUT.js} +1 -1
- package/dist/ui/assets/{port-bridge-client-H03Pohgj.js → port-bridge-client-CkkC3v5w.js} +1 -1
- package/dist/ui/assets/{provider-1ByYSphI.js → provider-C7zRpxoe.js} +2 -2
- package/dist/ui/assets/{provider-Df8LFEZ7.js → provider-DsHcYBTa.js} +1 -1
- package/dist/ui/assets/{provider-settings-Bk-fk9dp.js → provider-settings-BKCma-Jb.js} +1 -1
- package/dist/ui/assets/provider-store-access-BfDZO7Ly.js +1 -0
- package/dist/ui/assets/provider-store-access-CYticOn7.js +1 -0
- package/dist/ui/assets/{providers-T_FH_8cU.js → providers-DDnH2Ikl.js} +1 -1
- package/dist/ui/assets/{providers-Q92pCQ8h.js → providers-DEiO6D-5.js} +2 -2
- package/dist/ui/assets/{proxied-fetch-DARKNygr.js → proxied-fetch-CPL8wJM2.js} +1 -1
- package/dist/ui/assets/{proxied-fetch-Bl8AeYdt.js → proxied-fetch-CnCvBaGV.js} +1 -1
- package/dist/ui/assets/{quick-llm-CbGHjrhX.js → quick-llm-tSDpCXxR.js} +1 -1
- package/dist/ui/assets/{realm-inprocess-CWMnXeN3.js → realm-inprocess-BKygqrOz.js} +6 -6
- package/dist/ui/assets/{recovery-screen-DhUqOdby.js → recovery-screen-D6-sXNj7.js} +1 -1
- package/dist/ui/assets/{redirect-uri-Dd0j1fSp.js → redirect-uri-D2aDPCyB.js} +1 -1
- package/dist/ui/assets/{remote-terminal-view-D4Ah4AQY.js → remote-terminal-view-CA-SfvvZ.js} +2 -2
- package/dist/ui/assets/{rest-ops-CQOwDiTR.js → rest-ops-Yu_dXm4T.js} +1 -1
- package/dist/ui/assets/{rest-ops-DkUeDpiM.js → rest-ops-aP40ni1y.js} +1 -1
- package/dist/ui/assets/{restore-CVkulBmU.js → restore-C-ey_KSq.js} +1 -1
- package/dist/ui/assets/{run-B-t7kWH3.js → run-BEs473Sp.js} +1 -1
- package/dist/ui/assets/{run-COfTem8j.js → run-BSBxWJ5B.js} +1 -1
- package/dist/ui/assets/{run-ZmpHaamT.js → run-C3DRjgOJ.js} +2 -2
- package/dist/ui/assets/run-C_dx5nR2.js +91 -0
- package/dist/ui/assets/{run-IexPmM2B.js → run-CeJrX6mR.js} +2 -2
- package/dist/ui/assets/{run-DuW-7oJj.js → run-CfS1uOdY.js} +4 -4
- package/dist/ui/assets/{run-BX9uHbIi.js → run-DZtlriWZ.js} +1 -1
- package/dist/ui/assets/{run-CUCg2cJM.js → run-TEAp1X-0.js} +2 -2
- package/dist/ui/assets/run-ywBpFa_c.js +77 -0
- package/dist/ui/assets/{run-DgVV_DFr.js → run-zO91KPbj.js} +3 -3
- package/dist/ui/assets/screen-s6LdF1JP.js +1 -0
- package/dist/ui/assets/screen-share-approval-live-D388fVD9.js +1 -0
- package/dist/ui/assets/screencapture-media-BjmoKpyn.js +1 -0
- package/dist/ui/assets/screencapture-media-CM5E2g6c.js +1 -0
- package/dist/ui/assets/screencapture-media-shared-DlK1Wqh8.js +1 -0
- package/dist/ui/assets/{screencapture-run-yMA5c_HS.js → screencapture-run-zmx5QKf_.js} +2 -2
- package/dist/ui/assets/{secret-env-BhWGz7yx.js → secret-env-DgrZZVFU.js} +1 -1
- package/dist/ui/assets/secret-topology-BrobAGSV.js +1 -0
- package/dist/ui/assets/{secrets-bridge-client-C0tvQeuX.js → secrets-bridge-client-BJqZCK6Q.js} +1 -1
- package/dist/ui/assets/{secrets-bridge-client-BS3V1JBF.js → secrets-bridge-client-CeK7HpDf.js} +1 -1
- package/dist/ui/assets/{session-command-memory-DzuRy-nC.js → session-command-memory-B0lDqCR9.js} +2 -2
- package/dist/ui/assets/{session-jsonl-iOOR_32X.js → session-jsonl-C8ClVNxB.js} +1 -1
- package/dist/ui/assets/{session-jsonl-D01HYAS2.js → session-jsonl-DQNfKRsT.js} +1 -1
- package/dist/ui/assets/{session-search-index-CABvtt-r.js → session-search-index-BT4ZJZt7.js} +2 -2
- package/dist/ui/assets/{setup-feature-flags-remote-CvstKwBW.js → setup-feature-flags-remote-BGRjwc3Y.js} +1 -1
- package/dist/ui/assets/{signed-fetch-7NwdVmf1.js → signed-fetch-CNiA3vB6.js} +1 -1
- package/dist/ui/assets/{silent-renew-backoff-CXHqSiPb.js → silent-renew-backoff-DrQ0_tES.js} +1 -1
- package/dist/ui/assets/slicc-version-nVz--RAg.js +1 -0
- package/dist/ui/assets/{snapshot-BcYaw9Ip.js → snapshot-DXOlM8V_.js} +1 -1
- package/dist/ui/assets/{snapshot-features-3xslkGtL.js → snapshot-features-D_DeQAxH.js} +1 -1
- package/dist/ui/assets/{soundscape-TygolFwj.js → soundscape-CYcg-DKm.js} +1 -1
- package/dist/ui/assets/{speak-BCLm04Z2.js → speak-Br_kDtG8.js} +1 -1
- package/dist/ui/assets/{sprinkle-manager-DDzNanda.js → sprinkle-manager-DpsA1UkN.js} +1 -1
- package/dist/ui/assets/{sprinkle-renderer-B-CADNjq.js → sprinkle-renderer-q0STe7tk.js} +5 -2
- package/dist/ui/assets/ssh-CrZ29b93.js +6 -0
- package/dist/ui/assets/{state-BCTAzK_L.js → state-edQbuMHp.js} +1 -1
- package/dist/ui/assets/{store-C-AW4ogv.js → store-BJb3HsiM.js} +1 -1
- package/dist/ui/assets/{store-CzlK9KIc.js → store-BYzp8NI8.js} +1 -1
- package/dist/ui/assets/{sudo-BtkDnUA_.js → sudo-DaUFGZ5z.js} +1 -1
- package/dist/ui/assets/sudo-fs-C6r_MIIY.js +3 -0
- package/dist/ui/assets/{supervisor-B6-QPxI3.js → supervisor-BGSiMwrr.js} +1 -1
- package/dist/ui/assets/{sync-dialog-B4G7kCwj.js → sync-dialog-D72P64lv.js} +1 -1
- package/dist/ui/assets/tab-CgwpvlHH.js +1 -0
- package/dist/ui/assets/tool-ui-DRnUkp2g.js +1 -0
- package/dist/ui/assets/{transformers-env-1TbBNkOp.js → transformers-env-BKCNBfWr.js} +1 -1
- package/dist/ui/assets/{tray-leader-_KISvFyF.js → tray-leader-DEBMxUkS.js} +1 -1
- package/dist/ui/assets/{lick-urls-DdKPDlgq.js → tray-leader-status-CpkFr6n7.js} +1 -1
- package/dist/ui/assets/{tray-leave-runtime-CRsRkPHc.js → tray-leave-runtime-D3LaARDy.js} +1 -1
- package/dist/ui/assets/{tray-runtime-config-BVgVR3H2.js → tray-runtime-config-dyxCfUex.js} +1 -1
- package/dist/ui/assets/{tray-sidecar-BRvCb-i7.js → tray-sidecar-Bfcy9pO0.js} +1 -1
- package/dist/ui/assets/turn-journal-CyInnakf.js +1 -0
- package/dist/ui/assets/{upgrade-detection-C5daiUbn.js → upgrade-detection-BZooMFxg.js} +1 -1
- package/dist/ui/assets/{upskill-lick-skip-C2ZQ0c2-.js → upskill-lick-skip-H5RyeNIq.js} +1 -1
- package/dist/ui/assets/url-SK-_tyJs.js +1 -0
- package/dist/ui/assets/v86-BinbB-8j.js +1 -0
- package/dist/ui/assets/{voice-reply-Dk4ztuZL.js → voice-reply-ClwwZfjh.js} +1 -1
- package/dist/ui/assets/{wc-attach-CFj2ZF5_.js → wc-attach-DpNELhNG.js} +2 -2
- package/dist/ui/assets/{wc-browser-BFL2Tl8W.js → wc-browser-6X1_NRym.js} +1 -1
- package/dist/ui/assets/wc-computers-2bCwocOU.js +3 -0
- package/dist/ui/assets/{wc-detached-ncc8KuL1.js → wc-detached-sDWnNsaX.js} +1 -1
- package/dist/ui/assets/{wc-extension-DppNe2VK.js → wc-extension-CF_DQHCJ.js} +2 -2
- package/dist/ui/assets/{wc-follower-CcxFCW-y.js → wc-follower-BlgNQHR9.js} +3 -3
- package/dist/ui/assets/wc-follower-oauth-BBtoYPP3.js +5 -0
- package/dist/ui/assets/{wc-gelatiere-CANPh9TU.js → wc-gelatiere-Pgs78krZ.js} +1 -1
- package/dist/ui/assets/wc-live-D3BfBbnn.js +427 -0
- package/dist/ui/assets/{wc-nav-BlLpBAJG.js → wc-nav-CDV8ylGr.js} +2 -2
- package/dist/ui/assets/{wc-onboarding-OKaUOQ3X.js → wc-onboarding-CpKS7u3d.js} +2 -2
- package/dist/ui/assets/{wc-permissions-BsGMi4OQ.js → wc-permissions-CCA-0PP4.js} +2 -2
- package/dist/ui/assets/{wc-placeholder-BrX9-mPv.js → wc-placeholder-BwY4p0ld.js} +3 -3
- package/dist/ui/assets/{wc-secret-request-QPmTs_eW.js → wc-secret-request-HU2msCsY.js} +1 -1
- package/dist/ui/assets/{wc-settings-BFgFDtTk.js → wc-settings-OTZDaEtj.js} +3 -3
- package/dist/ui/assets/{wc-shell-CCKjmASt.js → wc-shell-M1btJNO6.js} +9 -5
- package/dist/ui/assets/{wc-shortcut-config-CeUoljrV.js → wc-shortcut-config-BgTHSt0X.js} +1 -1
- package/dist/ui/assets/{wc-sprinkles-BNp18_jW.js → wc-sprinkles-DoKzhGCE.js} +2 -2
- package/dist/ui/assets/{wc-transcript-export-DJnnZ8L-.js → wc-transcript-export-CxB6cd8_.js} +2 -2
- package/dist/ui/assets/wc-tray-BTgAee3m.js +5 -0
- package/dist/ui/assets/welcome-detection-Bvx3sh1_.js +1 -0
- package/dist/ui/assets/{whisper-session-CMiImrJg.js → whisper-session-Bjyp9kUa.js} +2 -2
- package/dist/ui/assets/{xai-grok-BMr5udF6.js → xai-grok-BSR4EP1b.js} +1 -1
- package/dist/ui/assets/{xai-grok-Dzeo18XM.js → xai-grok-Drl4j3ci.js} +1 -1
- package/dist/ui/index.html +9 -9
- package/dist/ui/lucide-icons.js +261 -247
- package/dist/ui/packages/webapp/index.html +9 -9
- package/package.json +8 -1
- package/dist/ui/assets/SKILL-CWR-bsvH.js +0 -1
- package/dist/ui/assets/browser-2rCVqcqy.js +0 -1
- package/dist/ui/assets/context-compaction-DRymamfD.js +0 -58
- package/dist/ui/assets/core-BoFWHLIW.js +0 -62
- package/dist/ui/assets/core-Bvc89tkf.js +0 -36
- package/dist/ui/assets/encode-frame-B8GkHc2t.js +0 -1
- package/dist/ui/assets/engine-D531XNHE.js +0 -1
- package/dist/ui/assets/es-DwGGEZle.js +0 -51
- package/dist/ui/assets/gelatiere-unit-DrQwRL3O.js +0 -1
- package/dist/ui/assets/icons-BM2l-_K7.js +0 -1
- package/dist/ui/assets/idle-compaction-B9i1duyd.js +0 -1
- package/dist/ui/assets/kernel-worker-4aPSVJ1C.js +0 -1185
- package/dist/ui/assets/keys-Dexx8cLD.js +0 -1
- package/dist/ui/assets/lick-ws-bridge-DZ0vVYNF.js +0 -1
- package/dist/ui/assets/memory-v2-flag-DVbOtPFF.js +0 -1
- package/dist/ui/assets/panel-rpc-handlers-CQ_iaU6N.js +0 -2
- package/dist/ui/assets/provider-store-access-BJPbOUku.js +0 -1
- package/dist/ui/assets/provider-store-access-BrjCBzpb.js +0 -1
- package/dist/ui/assets/run-1aYSFTwj.js +0 -91
- package/dist/ui/assets/run-DvD576xV.js +0 -53
- package/dist/ui/assets/screencapture-media-DL5YxrlG.js +0 -1
- package/dist/ui/assets/screencapture-media-YBE2VnLF.js +0 -1
- package/dist/ui/assets/secret-topology-CVneCnID.js +0 -1
- package/dist/ui/assets/slicc-version-CN6V2aMa.js +0 -1
- package/dist/ui/assets/sudo-fs-D620mZry.js +0 -3
- package/dist/ui/assets/tab-ToMhjbM4.js +0 -1
- package/dist/ui/assets/v86-BfdTUFBK.js +0 -1
- package/dist/ui/assets/wc-computers-CcJuQUyG.js +0 -3
- package/dist/ui/assets/wc-follower-oauth-DQ-JPxl6.js +0 -5
- package/dist/ui/assets/wc-live-BLozTZsg.js +0 -427
- package/dist/ui/assets/wc-tray-f1LxbB98.js +0 -5
- package/dist/ui/assets/welcome-detection-Dg9THpkh.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./__vite-browser-external-5eBdwsFd.js";import{r as n,t as r}from"./multipart-form-data-DopbgwRR.js";import{n as i}from"./slicc-version-CN6V2aMa.js";import{t as a}from"./buffer-polyfill-BccMjOKj.js";import{t as o}from"./buffer-B5d1xHaH.js";import{F as s,I as c,N as l,P as u}from"./shared-C_68vn79.js";import{I as d,M as f,R as p,T as m,_ as h,c as g,g as _,i as v,j as y,l as b,n as x,r as S,s as C,w}from"./sync-sab-wire-CC30v4TL.js";import{t as T}from"./tmpdir-env-ate4iNcK.js";import{t as E}from"./realm-browser-fetch-V3uggGbM.js";function D(e){if(!e||e===`/`)return`/`;e.startsWith(`/`)||(e=`/`+e);let t=e.split(`/`),n=[];for(let e of t)e!==``&&e!==`.`&&(e===`..`?n.pop():n.push(e));return`/`+n.join(`/`)}function O(e){let t=D(e);if(t===`/`)return`/`;let n=t.lastIndexOf(`/`);return n===0?`/`:t.slice(0,n)}function k(e){return Object.assign(Error(`ENOENT: no such file or directory, '${e}'`),{code:`ENOENT`})}function A(e){return Object.assign(Error(`ENOSYNC: file too large for sync access, '${e}' — use async readFile() instead`),{code:`ENOSYNC`})}function ee(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}var te=class{tree=new Map;initialPaths=new Set;initialContent=new Map;initialKind=new Map;mkdtempCounter=0;tombstones=new Set;removedDirs=new Set;touched=!1;constructor(e){this.loadSnapshot(e)}loadSnapshot(e){this.tree=new Map,this.tombstones=new Set,this.removedDirs=new Set,this.initialPaths=new Set,this.initialContent=new Map,this.initialKind=new Map,this.tree.set(`/`,{content:new Uint8Array,isDirectory:!0}),this.initialPaths.add(`/`),this.initialKind.set(`/`,`directory`);for(let t of e.entries){let e=D(t.path);this.tree.set(e,{content:t.content,isDirectory:t.isDirectory,isSymbolicLink:t.isSymbolicLink,symlinkTarget:t.symlinkTarget,truncated:t.truncated,size:t.size}),this.initialPaths.add(e),this.initialKind.set(e,this.entryKind(t)),!t.isDirectory&&!t.isSymbolicLink&&this.initialContent.set(e,t.content)}for(let t of e.entries){let e=O(D(t.path));for(;e!==`/`&&!this.tree.has(e);)this.tree.set(e,{content:new Uint8Array,isDirectory:!0}),this.initialPaths.add(e),this.initialKind.set(e,`directory`),e=O(e)}}wasUsed(){return this.touched}applySnapshot(e){this.loadSnapshot(e)}applySnapshotPreservingMutations(e){let t=this.getMutations();this.loadSnapshot(e);for(let e of t.deleted){if(this.tree.get(e)?.isDirectory){let t=e===`/`?`/`:e+`/`;for(let n of Array.from(this.tree.keys()))n!==e&&n.startsWith(t)&&this.tree.delete(n)}this.tree.delete(e)}for(let e of t.created)this.ensureParentDirs(e.path),this.tree.set(e.path,{content:e.content,isDirectory:e.isDirectory,isSymbolicLink:e.isSymbolicLink,symlinkTarget:e.symlinkTarget});for(let e of t.modified)this.ensureParentDirs(e.path),this.tree.set(e.path,{content:e.content,isDirectory:!1})}invalidate(){this.loadSnapshot({entries:[]})}resetBaseline(){this.initialPaths=new Set,this.initialContent=new Map,this.initialKind=new Map;for(let[e,t]of this.tree.entries())this.initialPaths.add(e),this.initialKind.set(e,this.entryKind(t)),!t.isDirectory&&!t.isSymbolicLink&&this.initialContent.set(e,t.content)}entryKind(e){return e.isSymbolicLink?`symlink`:e.isDirectory?`directory`:`file`}resolveEntry(e,t=!1){let n=D(e),r=n.split(`/`).filter(Boolean),i=[],a=new Set,o=0;if(r.length===0){let e=this.tree.get(`/`);return e?{path:`/`,entry:e}:void 0}for(;r.length>0;){let e=r.shift(),s=`/${[...i,e].join(`/`)}`,c=this.tree.get(s);if(!c)return;let l=r.length===0;if(c.isSymbolicLink&&!(t&&l)){if(a.has(s)||o++===40)throw Object.assign(Error(`ELOOP: too many symbolic links, '${n}'`),{code:`ELOOP`});a.add(s);let e=c.symlinkTarget??``;r=[...D(e.startsWith(`/`)?e:`${O(s)}/${e}`).split(`/`).filter(Boolean),...r],i=[];continue}if(!l&&!c.isDirectory)return;if(i.push(e),l)return{path:s,entry:c}}}ensureParentDirs(e){let t=O(e);t!==`/`&&(this.tree.has(t)||this.mkdir(t,!0,!0))}isPartial(e){return this.tree.get(D(e))?.partial===!0}commitWrite(e,t){this.writeFile(e,t);let n=D(e);for(this.initialContent.set(n,t);n!==`/`;){let e=this.tree.get(n);e&&(this.initialPaths.add(n),this.initialKind.set(n,this.entryKind(e))),n=O(n)}}readFile(e){this.touched=!0;let t=D(e),n=this.resolveEntry(t)?.entry;if(!n||n.isDirectory)throw k(t);if(n.truncated)throw A(t);return n.content}writeFile(e,t){this.touched=!0;let n=D(e);this.ensureParentDirs(n),this.tree.set(n,{content:t,isDirectory:!1}),this.tombstones.delete(n),this.removedDirs.delete(n)}exists(e){this.touched=!0;let t=D(e);return this.tree.has(t)}stat(e){this.touched=!0;let t=D(e),n=this.resolveEntry(t);if(!n)throw k(t);return this.toStat(n.entry)}lstat(e){this.touched=!0;let t=D(e),n=this.resolveEntry(t,!0);if(!n)throw k(t);return this.toStat(n.entry)}toStat(e){return{isFile:!e.isDirectory&&!e.isSymbolicLink,isDirectory:e.isDirectory,isSymbolicLink:e.isSymbolicLink===!0,size:e.isDirectory?0:e.size??e.content.byteLength}}readdir(e){this.touched=!0;let t=D(e),n=this.resolveEntry(t);if(!n?.entry.isDirectory)throw k(t);let r=n.path===`/`?`/`:n.path+`/`,i=new Set;for(let e of this.tree.keys()){if(e===t||e===`/`||!e.startsWith(r))continue;let n=e.slice(r.length).split(`/`)[0];n&&i.add(n)}return Array.from(i)}mkdir(e,t,n=!1){this.touched=!0;let r=D(e);if(this.tree.has(r)){if(this.tree.get(r).isDirectory)return;throw Object.assign(Error(`EEXIST: file already exists, '${r}'`),{code:`EEXIST`})}let i=O(r);if(i!==`/`&&!this.tree.has(i)){if(!t)throw k(r);this.mkdir(i,!0,n)}this.tree.set(r,{content:new Uint8Array,isDirectory:!0,...n?{partial:!0}:{}}),this.tombstones.delete(r),this.removedDirs.delete(r)}rm(e,t){this.touched=!0;let n=D(e),r=this.tree.get(n);if(!r)throw k(n);if(r.isDirectory&&!r.isSymbolicLink){let e=n===`/`?`/`:n+`/`,r=Array.from(this.tree.keys()).filter(t=>t!==n&&t.startsWith(e));if(r.length>0&&!t)throw Object.assign(Error(`ENOTEMPTY: directory not empty, '${n}'`),{code:`ENOTEMPTY`});for(let e of r)this.tree.delete(e),this.tombstones.add(e);t&&this.removedDirs.add(n)}this.tree.delete(n),this.tombstones.add(n)}copyFile(e,t){this.touched=!0;let n=D(e),r=this.tree.get(n);if(!r||r.isDirectory)throw k(n);if(r.truncated)throw A(n);let i=D(t);this.ensureParentDirs(i),this.tree.set(i,{content:r.content.slice(),isDirectory:!1}),this.tombstones.delete(i),this.removedDirs.delete(i)}rename(e,t){this.touched=!0;let n=D(e),r=this.tree.get(n);if(!r)throw k(n);let i=D(t);if(r.isDirectory){let e=n===`/`?`/`:n+`/`,t=Array.from(this.tree.keys()).filter(t=>t!==n&&t.startsWith(e));this.ensureParentDirs(i),this.tree.set(i,r),this.tree.delete(n);for(let e of t){let t=this.tree.get(e),r=i+e.slice(n.length);this.tree.set(r,t),this.tree.delete(e)}this.tombstones.add(n),this.removedDirs.add(n),this.tombstones.delete(i),this.removedDirs.delete(i);return}this.ensureParentDirs(i),this.tree.set(i,r),this.tree.delete(n),this.tombstones.add(n),this.tombstones.delete(i),this.removedDirs.delete(i)}unlink(e){this.touched=!0;let t=D(e),n=this.tree.get(t);if(!n)throw k(t);if(n.isDirectory&&!n.isSymbolicLink)throw Object.assign(Error(`EISDIR: illegal operation on a directory, unlink '${t}'`),{code:`EISDIR`});this.tree.delete(t),this.tombstones.add(t)}markRemoved(e,t=!1){this.touched=!0;let n=D(e);this.tombstones.add(n),t&&this.removedDirs.add(n)}isTombstoned(e){let t=D(e);if(this.tombstones.has(t))return!0;for(let e of this.removedDirs)if(t===e||t.startsWith(`${e}/`))return!0;return!1}mkdtemp(e){this.touched=!0;for(let t=0;t<100;t++){let t=`_${String(this.mkdtempCounter).padStart(6,`0`)}`;this.mkdtempCounter++;let n=D(e+t);if(!this.tree.has(n))return this.mkdir(n,!0),n}throw Error(`mkdtemp: failed to create unique directory after 100 attempts`)}getMutations(){let e=[],t=[],n=[];for(let[r,i]of this.tree.entries()){if(r===`/`)continue;if(!this.initialPaths.has(r)){e.push({path:r,content:i.content,isDirectory:i.isDirectory,isSymbolicLink:i.isSymbolicLink,symlinkTarget:i.symlinkTarget});continue}let a=this.initialKind.get(r);if(a!==void 0&&a!==this.entryKind(i)){n.push(r),e.push({path:r,content:i.content,isDirectory:i.isDirectory,isSymbolicLink:i.isSymbolicLink,symlinkTarget:i.symlinkTarget});continue}if(!i.isDirectory&&!i.isSymbolicLink){let e=this.initialContent.get(r);e&&!ee(e,i.content)&&t.push({path:r,content:i.content})}}for(let e of this.initialPaths)e!==`/`&&(this.tree.has(e)||n.push(e));return{created:e,modified:t,deleted:n}}};function ne(){return globalThis.Buffer}function re(e){let t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n)&255;return t}function ie(e){let t=``;for(let n=0;n<e.length;n+=32768)t+=String.fromCharCode(...e.subarray(n,n+32768));return t}function ae(e,t){return Object.assign(Error(`EBADF: bad file descriptor, ${e} ${String(t)}`),{code:`EBADF`})}function oe(e){return e===`/dev/stdin`||e===`/dev/stdout`||e===`/dev/stderr`}function se(e){if(e===0||e===`/dev/stdin`)return 0;if(e===1||e===`/dev/stdout`)return 1;if(e===2||e===`/dev/stderr`)return 2}function ce(e,t){let n=se(e);if(n===0)return!0;if(n!==void 0||typeof e==`number`)throw ae(t,e);return!1}function le(e,t,n){let r=se(t);if(r===1)return e.writeStdout;if(r===2)return e.writeStderr;if(r!==void 0||typeof t==`number`)throw ae(n,t)}function ue(e){return typeof e==`string`?e:ie(xe(e))}function de(e,t){if(t===`utf8`||t===`utf-8`)return new TextDecoder().decode(e);let n=ne();return n?n.from(e):e}function fe(e){return typeof e==`string`?e:e?.encoding}function pe(){return{isFile:()=>!0,isDirectory:()=>!1,isSymbolicLink:()=>!1,isCharacterDevice:()=>!0,size:0}}function me(e,t){if(!t)return;let n={readFile:e.readFile,readFileBinary:e.readFileBinary,writeFile:e.writeFile,writeFileBinary:e.writeFileBinary,appendFile:e.appendFile,access:e.access,exists:e.exists,stat:e.stat};e.readFile=async(e,r)=>{if(!ce(e,`read`))return n.readFile(e,r);let i=fe(r);if(i===null||i===`buffer`){let e=ne(),n=t.readStdinBytes();return e?e.from(n):n}return new TextDecoder().decode(t.readStdinBytes())},e.readFileBinary=async e=>ce(e,`read`)?t.readStdinBytes():n.readFileBinary(e),e.writeFile=async(e,r)=>{let i=le(t,e,`write`);return i?(i(ue(r)),!0):n.writeFile(e,r)},e.writeFileBinary=async(e,r)=>{let i=le(t,e,`write`);return i?(i(ie(r)),!0):n.writeFileBinary(e,r)},e.appendFile=async(e,r)=>{let i=le(t,e,`append`);if(!i)return n.appendFile(e,r);i(ue(r))},e.access=async e=>{if(!oe(e))return n.access(e)},e.exists=async e=>oe(e)||n.exists(e),e.stat=async e=>oe(e)?{isFile:!0,isDirectory:!1,size:0}:n.stat(e)}function he(e,t,n){function r(e){if(e instanceof Uint8Array)return e;if(ArrayBuffer.isView(e)){let t=e;return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}return e instanceof ArrayBuffer?new Uint8Array(e):new TextEncoder().encode(typeof e==`string`?e:String(e))}async function i(t,n){let r=typeof n==`string`?n:n?.encoding;if(r===null||r===`buffer`){let n=await e.call(`vfs`,`readFileBinary`,[t]),r=ne();return r?r.from(n instanceof Uint8Array?n:new Uint8Array(n)):n}return e.call(`vfs`,`readFile`,[t])}async function a(t,n){return typeof n==`string`?e.call(`vfs`,`writeFile`,[t,n]):e.call(`vfs`,`writeFileBinary`,[t,r(n)])}async function o(t,n){if(typeof n==`string`){await e.call(`vfs`,`appendFile`,[t,n]);return}await e.call(`vfs`,`appendFile`,[t,r(n)])}async function s(t,n,r){let i=await e.call(`vfs`,`stat`,[t]);if(i.isFile){let r=await e.call(`vfs`,`readFileBinary`,[t]);await e.call(`vfs`,`writeFileBinary`,[n,r]);return}if(!i.isDirectory||!r?.recursive)throw Error(`cp: '${t}' is a directory (use {recursive: true})`);await l(n);let a=await e.call(`vfs`,`readDir`,[t]);for(let e of a)await s(`${t}/${e}`,`${n}/${e}`,r)}async function c(t,n){if(n?.force&&!await e.call(`vfs`,`exists`,[t]))return!0;if((await e.call(`vfs`,`stat`,[t])).isFile)return e.call(`vfs`,`rm`,[t]);if(!n?.recursive)throw Error(`rm: '${t}' is a directory (use {recursive: true})`);let r=await e.call(`vfs`,`readDir`,[t]);for(let e of r)await c(`${t}/${e}`,n);return e.call(`vfs`,`rm`,[t])}async function l(t){await e.call(`vfs`,`mkdir`,[t])}async function u(t){for(let n=0;n<5;n++){let n=`${t}${Math.random().toString(36).slice(2,10)+Math.random().toString(36).slice(2,6)}`;if(!await e.call(`vfs`,`exists`,[n]))return await e.call(`vfs`,`mkdir`,[n]),n}throw Error(`mkdtemp: failed to create unique directory after 5 attempts`)}async function d(t,n){try{await e.call(`vfs`,`rename`,[t,n])}catch{let r=await e.call(`vfs`,`readFileBinary`,[t]);await e.call(`vfs`,`writeFileBinary`,[n,r]),await e.call(`vfs`,`rm`,[t])}}async function f(t){if(!await e.call(`vfs`,`exists`,[t]))throw Object.assign(Error(`ENOENT: no such file or directory, access '${t}'`),{code:`ENOENT`})}let p={readFile:i,readFileBinary:t=>e.call(`vfs`,`readFileBinary`,[t]),writeFile:a,writeFileBinary:(t,n)=>e.call(`vfs`,`writeFileBinary`,[t,n]),appendFile:o,cp:s,rm:c,readDir:t=>e.call(`vfs`,`readDir`,[t]),readdir:t=>e.call(`vfs`,`readDir`,[t]),exists:t=>e.call(`vfs`,`exists`,[t]),stat:t=>e.call(`vfs`,`stat`,[t]),mkdir:(t,n)=>e.call(`vfs`,`mkdir`,[t]),mkdtemp:u,rename:d,access:f,unlink:t=>e.call(`vfs`,`rm`,[t]),rmdir:t=>e.call(`vfs`,`rm`,[t]),copyFile:async(t,n)=>{let r=await e.call(`vfs`,`readFileBinary`,[t]);await e.call(`vfs`,`writeFileBinary`,[n,r])},fetchToFile:async(n,r)=>{let i=await t(n);if(!i.ok)throw Error(`fetch ${i.status} ${i.statusText}`);let a=new Uint8Array(await i.arrayBuffer());return await e.call(`vfs`,`writeFileBinary`,[r,a]),a.byteLength},promises:null};return me(p,n),p.promises=p,p}function j(e,t,n=``){return Object.assign(Error(`${e}: sync-fs, ${n?`${n} `:``}'${t}'`),{code:e})}function ge(e,t,n,r={},i){let a=r.recursive===!0;try{return r.requireFile?e.unlink(n):e.rm(n,a),i?.(n),!0}catch(e){if(e?.code!==`ENOENT`)throw e}let o=t;if(!o?.rm||e.isTombstoned(n))return!1;try{if(!o.exists(n))return!1}catch{return!1}return o.rm(n),e.markRemoved(n,a),!0}function _e(e){let{syncFs:t,bridge:n,resolve:r,existsResolved:i,lstatResolved:a,statResolved:o,readBytes:s,writeThrough:c,persistDelete:l}=e,u=(e,r)=>ge(t,n,e,r,l);return{rmSync(e,t){let n=r(e);if(!(t?.force&&!i(n))&&!u(n,{recursive:t?.recursive===!0})&&!t?.force)throw j(`ENOENT`,n,`rm`)},rmdirSync(e,t){let n=r(e);if(i(n)&&!a(n).isDirectory)throw j(`ENOTDIR`,n,`rmdir`);if(!u(n,{recursive:t?.recursive===!0}))throw j(`ENOENT`,n,`rmdir`)},unlinkSync(e){let t=r(e);if(!u(t,{requireFile:!0}))throw j(`ENOENT`,t,`unlink`)},renameSync(e,i){let a=r(e),l=r(i);try{t.rename(a,l);return}catch(e){if(e?.code!==`ENOENT`)throw e}if(!n||t.isTombstoned(a))throw j(`ENOENT`,a,`rename`);if(o(a).isDirectory)throw j(`EISDIR`,a,`rename`);if(c(l,s(a)),!u(a,{requireFile:!0}))throw j(`ENOENT`,a,`rename`)}}}function ve(e,t){if(!t)return;let n={readFileSync:e.readFileSync,writeFileSync:e.writeFileSync,appendFileSync:e.appendFileSync,existsSync:e.existsSync,accessSync:e.accessSync,statSync:e.statSync,lstatSync:e.lstatSync};e.readFileSync=(e,r)=>ce(e,`read`)?de(t.readStdinBytes(),fe(r)):n.readFileSync(e,r),e.writeFileSync=(e,r)=>{let i=le(t,e,`write`);i?i(ue(r)):n.writeFileSync(e,r)},e.appendFileSync=(e,r)=>{let i=le(t,e,`append`);i?i(ue(r)):n.appendFileSync(e,r)},e.existsSync=e=>oe(e)||n.existsSync(e),e.accessSync=e=>{oe(e)||n.accessSync(e)},e.statSync=e=>oe(e)?pe():n.statSync(e),e.lstatSync=e=>oe(e)?pe():n.lstatSync(e)}function ye(e,t,n,r){let i=t=>e===`/`?`/${t}`:`${e}/${t}`,a=new Set(n);for(let e of t)a.add(e);for(let e of a)r(i(e))&&a.delete(e);return[...a]}function be(e,t,n){let r=t=>e.isTombstoned(t);try{let i=e.readdir(n);if(!t||!e.isPartial(n)||r(n))return i;try{return ye(n,i,t.readdir(n),r)}catch(e){if(e?.code===`ENOENT`)return i;throw e}}catch(e){let i=e?.code;if(!t||r(n)||i!==`ENOENT`)throw e;return ye(n,[],t.readdir(n),r)}}function xe(e){if(typeof e==`string`)return new TextEncoder().encode(e);if(e instanceof Uint8Array)return e;if(ArrayBuffer.isView(e)){let t=e;return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}return new TextEncoder().encode(String(e))}function Se(e,t,n,r,i){t?(t.writeFile(r,i),e.commitWrite(r,i)):(e.writeFile(r,i),n?.write?.(r,i))}function Ce(e,t,n,r,i){function a(e){return D(e.startsWith(`/`)?e:t+(t.endsWith(`/`)?``:`/`)+e)}function o(t){try{return e.readFile(t)}catch(r){let i=r?.code;if(n&&!e.isTombstoned(t)&&(i===`ENOENT`||i===`ENOSYNC`))return n.readFile(t);throw r}}let s=(t,r)=>Se(e,n,i,t,r);function c(t){if(e.exists(t))return!0;if(!n||e.isTombstoned(t))return!1;try{return n.exists(t)}catch{return!1}}function l(t){try{return e.stat(t)}catch(r){let i=r?.code;if(!n||e.isTombstoned(t)||i!==`ENOENT`)throw r;return n.stat(t)}}function u(t){try{return e.lstat(t)}catch(r){let i=r?.code;if(!n||e.isTombstoned(t)||i!==`ENOENT`)throw r;return n.lstat(t)}}let d=e=>({isFile:()=>e.isFile,isDirectory:()=>e.isDirectory,isSymbolicLink:()=>e.isSymbolicLink===!0,isCharacterDevice:()=>!1,size:e.size}),f=(e,t)=>e===`/`?`/${t}`:`${e}/${t}`;function p(t,r){if(!l(t).isDirectory){s(r,o(t));return}e.mkdir(r,!0);for(let i of be(e,n,t))p(f(t,i),f(r,i))}let m={..._e({syncFs:e,bridge:n,persistDelete:i?.delete,resolve:a,existsResolved:c,statResolved:l,lstatResolved:u,readBytes:o,writeThrough:s}),readFileSync(e,t){return de(o(a(e)),fe(t))},writeFileSync(e,t){s(a(e),xe(t))},appendFileSync(e,t){let n=a(e),r=new Uint8Array;try{r=o(n)}catch(e){if(e?.code!==`ENOENT`)throw e}let i=xe(t),c=new Uint8Array(r.byteLength+i.byteLength);c.set(r),c.set(i,r.byteLength),s(n,c)},truncateSync(e,t=0){let n=a(e),r=o(n),i=new Uint8Array(t);i.set(r.subarray(0,Math.min(t,r.byteLength))),s(n,i)},existsSync(e){return c(a(e))},accessSync(e){let t=a(e);if(!c(t))throw j(`ENOENT`,t,`access`)},mkdirSync(t,n){e.mkdir(a(t),n?.recursive)},statSync:e=>d(l(a(e))),lstatSync:e=>d(u(a(e))),realpathSync(e){let t=a(e);if(!c(t))throw j(`ENOENT`,t,`realpath`);return t},readdirSync(t){return be(e,n,a(t))},copyFileSync(e,t){s(a(t),o(a(e)))},cpSync(e,t){p(a(e),a(t))},chmodSync(e){let t=a(e);if(!c(t))throw j(`ENOENT`,t,`chmod`)},mkdtempSync(t){return e.mkdtemp(a(t))}};return ve(m,r),m}function we(e){let t=e=>{if(typeof e==`string`)return e;if(e instanceof Error)return e.message;if(e==null)return String(e);try{return JSON.stringify(e)}catch{return String(e)}},n=(e,t,n)=>t===void 0?`${e(`Error:`)} ${n}\n`:t===``?`${e(n)}\n`:`${e(`${t}:`)} ${n}\n`,r=(t,n)=>t===void 0?`${e.color.yellow(`Warning:`)} ${n}\n`:t===``?`${e.color.yellow(n)}\n`:`${e.color.yellow(`${t}:`)} ${n}\n`;return{die(r,i){let a=typeof i==`number`?i:i?.exitCode??1,o=typeof i==`object`&&i&&`prefix`in i?i.prefix:void 0,s=t(r);throw e.writeStderr(n(e.color.red,o,s)),e.exit(a),Error(`unreachable`)},out(t){if(typeof t==`string`){e.writeStdout(t.endsWith(`
|
|
1
|
+
import{t as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./__vite-browser-external-5eBdwsFd.js";import{r as n,t as r}from"./multipart-form-data-DopbgwRR.js";import{n as i}from"./slicc-version-nVz--RAg.js";import{t as a}from"./buffer-polyfill-BccMjOKj.js";import{t as o}from"./buffer-B5d1xHaH.js";import{F as s,I as c,N as l,P as u}from"./shared-C_68vn79.js";import{I as d,M as f,R as p,T as m,_ as h,c as g,g as _,i as v,j as y,l as b,n as x,r as S,s as C,w}from"./sync-sab-wire-CC30v4TL.js";import{t as T}from"./tmpdir-env-ate4iNcK.js";import{t as E}from"./realm-browser-fetch-V3uggGbM.js";function D(e){if(!e||e===`/`)return`/`;e.startsWith(`/`)||(e=`/`+e);let t=e.split(`/`),n=[];for(let e of t)e!==``&&e!==`.`&&(e===`..`?n.pop():n.push(e));return`/`+n.join(`/`)}function O(e){let t=D(e);if(t===`/`)return`/`;let n=t.lastIndexOf(`/`);return n===0?`/`:t.slice(0,n)}function k(e){return Object.assign(Error(`ENOENT: no such file or directory, '${e}'`),{code:`ENOENT`})}function A(e){return Object.assign(Error(`ENOSYNC: file too large for sync access, '${e}' — use async readFile() instead`),{code:`ENOSYNC`})}function ee(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}var te=class{tree=new Map;initialPaths=new Set;initialContent=new Map;initialKind=new Map;mkdtempCounter=0;tombstones=new Set;removedDirs=new Set;touched=!1;constructor(e){this.loadSnapshot(e)}loadSnapshot(e){this.tree=new Map,this.tombstones=new Set,this.removedDirs=new Set,this.initialPaths=new Set,this.initialContent=new Map,this.initialKind=new Map,this.tree.set(`/`,{content:new Uint8Array,isDirectory:!0}),this.initialPaths.add(`/`),this.initialKind.set(`/`,`directory`);for(let t of e.entries){let e=D(t.path);this.tree.set(e,{content:t.content,isDirectory:t.isDirectory,isSymbolicLink:t.isSymbolicLink,symlinkTarget:t.symlinkTarget,truncated:t.truncated,size:t.size}),this.initialPaths.add(e),this.initialKind.set(e,this.entryKind(t)),!t.isDirectory&&!t.isSymbolicLink&&this.initialContent.set(e,t.content)}for(let t of e.entries){let e=O(D(t.path));for(;e!==`/`&&!this.tree.has(e);)this.tree.set(e,{content:new Uint8Array,isDirectory:!0}),this.initialPaths.add(e),this.initialKind.set(e,`directory`),e=O(e)}}wasUsed(){return this.touched}applySnapshot(e){this.loadSnapshot(e)}applySnapshotPreservingMutations(e){let t=this.getMutations();this.loadSnapshot(e);for(let e of t.deleted){if(this.tree.get(e)?.isDirectory){let t=e===`/`?`/`:e+`/`;for(let n of Array.from(this.tree.keys()))n!==e&&n.startsWith(t)&&this.tree.delete(n)}this.tree.delete(e)}for(let e of t.created)this.ensureParentDirs(e.path),this.tree.set(e.path,{content:e.content,isDirectory:e.isDirectory,isSymbolicLink:e.isSymbolicLink,symlinkTarget:e.symlinkTarget});for(let e of t.modified)this.ensureParentDirs(e.path),this.tree.set(e.path,{content:e.content,isDirectory:!1})}invalidate(){this.loadSnapshot({entries:[]})}resetBaseline(){this.initialPaths=new Set,this.initialContent=new Map,this.initialKind=new Map;for(let[e,t]of this.tree.entries())this.initialPaths.add(e),this.initialKind.set(e,this.entryKind(t)),!t.isDirectory&&!t.isSymbolicLink&&this.initialContent.set(e,t.content)}entryKind(e){return e.isSymbolicLink?`symlink`:e.isDirectory?`directory`:`file`}resolveEntry(e,t=!1){let n=D(e),r=n.split(`/`).filter(Boolean),i=[],a=new Set,o=0;if(r.length===0){let e=this.tree.get(`/`);return e?{path:`/`,entry:e}:void 0}for(;r.length>0;){let e=r.shift(),s=`/${[...i,e].join(`/`)}`,c=this.tree.get(s);if(!c)return;let l=r.length===0;if(c.isSymbolicLink&&!(t&&l)){if(a.has(s)||o++===40)throw Object.assign(Error(`ELOOP: too many symbolic links, '${n}'`),{code:`ELOOP`});a.add(s);let e=c.symlinkTarget??``;r=[...D(e.startsWith(`/`)?e:`${O(s)}/${e}`).split(`/`).filter(Boolean),...r],i=[];continue}if(!l&&!c.isDirectory)return;if(i.push(e),l)return{path:s,entry:c}}}ensureParentDirs(e){let t=O(e);t!==`/`&&(this.tree.has(t)||this.mkdir(t,!0,!0))}isPartial(e){return this.tree.get(D(e))?.partial===!0}commitWrite(e,t){this.writeFile(e,t);let n=D(e);for(this.initialContent.set(n,t);n!==`/`;){let e=this.tree.get(n);e&&(this.initialPaths.add(n),this.initialKind.set(n,this.entryKind(e))),n=O(n)}}readFile(e){this.touched=!0;let t=D(e),n=this.resolveEntry(t)?.entry;if(!n||n.isDirectory)throw k(t);if(n.truncated)throw A(t);return n.content}writeFile(e,t){this.touched=!0;let n=D(e);this.ensureParentDirs(n),this.tree.set(n,{content:t,isDirectory:!1}),this.tombstones.delete(n),this.removedDirs.delete(n)}exists(e){this.touched=!0;let t=D(e);return this.tree.has(t)}stat(e){this.touched=!0;let t=D(e),n=this.resolveEntry(t);if(!n)throw k(t);return this.toStat(n.entry)}lstat(e){this.touched=!0;let t=D(e),n=this.resolveEntry(t,!0);if(!n)throw k(t);return this.toStat(n.entry)}toStat(e){return{isFile:!e.isDirectory&&!e.isSymbolicLink,isDirectory:e.isDirectory,isSymbolicLink:e.isSymbolicLink===!0,size:e.isDirectory?0:e.size??e.content.byteLength}}readdir(e){this.touched=!0;let t=D(e),n=this.resolveEntry(t);if(!n?.entry.isDirectory)throw k(t);let r=n.path===`/`?`/`:n.path+`/`,i=new Set;for(let e of this.tree.keys()){if(e===t||e===`/`||!e.startsWith(r))continue;let n=e.slice(r.length).split(`/`)[0];n&&i.add(n)}return Array.from(i)}mkdir(e,t,n=!1){this.touched=!0;let r=D(e);if(this.tree.has(r)){if(this.tree.get(r).isDirectory)return;throw Object.assign(Error(`EEXIST: file already exists, '${r}'`),{code:`EEXIST`})}let i=O(r);if(i!==`/`&&!this.tree.has(i)){if(!t)throw k(r);this.mkdir(i,!0,n)}this.tree.set(r,{content:new Uint8Array,isDirectory:!0,...n?{partial:!0}:{}}),this.tombstones.delete(r),this.removedDirs.delete(r)}rm(e,t){this.touched=!0;let n=D(e),r=this.tree.get(n);if(!r)throw k(n);if(r.isDirectory&&!r.isSymbolicLink){let e=n===`/`?`/`:n+`/`,r=Array.from(this.tree.keys()).filter(t=>t!==n&&t.startsWith(e));if(r.length>0&&!t)throw Object.assign(Error(`ENOTEMPTY: directory not empty, '${n}'`),{code:`ENOTEMPTY`});for(let e of r)this.tree.delete(e),this.tombstones.add(e);t&&this.removedDirs.add(n)}this.tree.delete(n),this.tombstones.add(n)}copyFile(e,t){this.touched=!0;let n=D(e),r=this.tree.get(n);if(!r||r.isDirectory)throw k(n);if(r.truncated)throw A(n);let i=D(t);this.ensureParentDirs(i),this.tree.set(i,{content:r.content.slice(),isDirectory:!1}),this.tombstones.delete(i),this.removedDirs.delete(i)}rename(e,t){this.touched=!0;let n=D(e),r=this.tree.get(n);if(!r)throw k(n);let i=D(t);if(r.isDirectory){let e=n===`/`?`/`:n+`/`,t=Array.from(this.tree.keys()).filter(t=>t!==n&&t.startsWith(e));this.ensureParentDirs(i),this.tree.set(i,r),this.tree.delete(n);for(let e of t){let t=this.tree.get(e),r=i+e.slice(n.length);this.tree.set(r,t),this.tree.delete(e)}this.tombstones.add(n),this.removedDirs.add(n),this.tombstones.delete(i),this.removedDirs.delete(i);return}this.ensureParentDirs(i),this.tree.set(i,r),this.tree.delete(n),this.tombstones.add(n),this.tombstones.delete(i),this.removedDirs.delete(i)}unlink(e){this.touched=!0;let t=D(e),n=this.tree.get(t);if(!n)throw k(t);if(n.isDirectory&&!n.isSymbolicLink)throw Object.assign(Error(`EISDIR: illegal operation on a directory, unlink '${t}'`),{code:`EISDIR`});this.tree.delete(t),this.tombstones.add(t)}markRemoved(e,t=!1){this.touched=!0;let n=D(e);this.tombstones.add(n),t&&this.removedDirs.add(n)}isTombstoned(e){let t=D(e);if(this.tombstones.has(t))return!0;for(let e of this.removedDirs)if(t===e||t.startsWith(`${e}/`))return!0;return!1}mkdtemp(e){this.touched=!0;for(let t=0;t<100;t++){let t=`_${String(this.mkdtempCounter).padStart(6,`0`)}`;this.mkdtempCounter++;let n=D(e+t);if(!this.tree.has(n))return this.mkdir(n,!0),n}throw Error(`mkdtemp: failed to create unique directory after 100 attempts`)}getMutations(){let e=[],t=[],n=[];for(let[r,i]of this.tree.entries()){if(r===`/`)continue;if(!this.initialPaths.has(r)){e.push({path:r,content:i.content,isDirectory:i.isDirectory,isSymbolicLink:i.isSymbolicLink,symlinkTarget:i.symlinkTarget});continue}let a=this.initialKind.get(r);if(a!==void 0&&a!==this.entryKind(i)){n.push(r),e.push({path:r,content:i.content,isDirectory:i.isDirectory,isSymbolicLink:i.isSymbolicLink,symlinkTarget:i.symlinkTarget});continue}if(!i.isDirectory&&!i.isSymbolicLink){let e=this.initialContent.get(r);e&&!ee(e,i.content)&&t.push({path:r,content:i.content})}}for(let e of this.initialPaths)e!==`/`&&(this.tree.has(e)||n.push(e));return{created:e,modified:t,deleted:n}}};function ne(){return globalThis.Buffer}function re(e){let t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n)&255;return t}function ie(e){let t=``;for(let n=0;n<e.length;n+=32768)t+=String.fromCharCode(...e.subarray(n,n+32768));return t}function ae(e,t){return Object.assign(Error(`EBADF: bad file descriptor, ${e} ${String(t)}`),{code:`EBADF`})}function oe(e){return e===`/dev/stdin`||e===`/dev/stdout`||e===`/dev/stderr`}function se(e){if(e===0||e===`/dev/stdin`)return 0;if(e===1||e===`/dev/stdout`)return 1;if(e===2||e===`/dev/stderr`)return 2}function ce(e,t){let n=se(e);if(n===0)return!0;if(n!==void 0||typeof e==`number`)throw ae(t,e);return!1}function le(e,t,n){let r=se(t);if(r===1)return e.writeStdout;if(r===2)return e.writeStderr;if(r!==void 0||typeof t==`number`)throw ae(n,t)}function ue(e){return typeof e==`string`?e:ie(xe(e))}function de(e,t){if(t===`utf8`||t===`utf-8`)return new TextDecoder().decode(e);let n=ne();return n?n.from(e):e}function fe(e){return typeof e==`string`?e:e?.encoding}function pe(){return{isFile:()=>!0,isDirectory:()=>!1,isSymbolicLink:()=>!1,isCharacterDevice:()=>!0,size:0}}function me(e,t){if(!t)return;let n={readFile:e.readFile,readFileBinary:e.readFileBinary,writeFile:e.writeFile,writeFileBinary:e.writeFileBinary,appendFile:e.appendFile,access:e.access,exists:e.exists,stat:e.stat};e.readFile=async(e,r)=>{if(!ce(e,`read`))return n.readFile(e,r);let i=fe(r);if(i===null||i===`buffer`){let e=ne(),n=t.readStdinBytes();return e?e.from(n):n}return new TextDecoder().decode(t.readStdinBytes())},e.readFileBinary=async e=>ce(e,`read`)?t.readStdinBytes():n.readFileBinary(e),e.writeFile=async(e,r)=>{let i=le(t,e,`write`);return i?(i(ue(r)),!0):n.writeFile(e,r)},e.writeFileBinary=async(e,r)=>{let i=le(t,e,`write`);return i?(i(ie(r)),!0):n.writeFileBinary(e,r)},e.appendFile=async(e,r)=>{let i=le(t,e,`append`);if(!i)return n.appendFile(e,r);i(ue(r))},e.access=async e=>{if(!oe(e))return n.access(e)},e.exists=async e=>oe(e)||n.exists(e),e.stat=async e=>oe(e)?{isFile:!0,isDirectory:!1,size:0}:n.stat(e)}function he(e,t,n){function r(e){if(e instanceof Uint8Array)return e;if(ArrayBuffer.isView(e)){let t=e;return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}return e instanceof ArrayBuffer?new Uint8Array(e):new TextEncoder().encode(typeof e==`string`?e:String(e))}async function i(t,n){let r=typeof n==`string`?n:n?.encoding;if(r===null||r===`buffer`){let n=await e.call(`vfs`,`readFileBinary`,[t]),r=ne();return r?r.from(n instanceof Uint8Array?n:new Uint8Array(n)):n}return e.call(`vfs`,`readFile`,[t])}async function a(t,n){return typeof n==`string`?e.call(`vfs`,`writeFile`,[t,n]):e.call(`vfs`,`writeFileBinary`,[t,r(n)])}async function o(t,n){if(typeof n==`string`){await e.call(`vfs`,`appendFile`,[t,n]);return}await e.call(`vfs`,`appendFile`,[t,r(n)])}async function s(t,n,r){let i=await e.call(`vfs`,`stat`,[t]);if(i.isFile){let r=await e.call(`vfs`,`readFileBinary`,[t]);await e.call(`vfs`,`writeFileBinary`,[n,r]);return}if(!i.isDirectory||!r?.recursive)throw Error(`cp: '${t}' is a directory (use {recursive: true})`);await l(n);let a=await e.call(`vfs`,`readDir`,[t]);for(let e of a)await s(`${t}/${e}`,`${n}/${e}`,r)}async function c(t,n){if(n?.force&&!await e.call(`vfs`,`exists`,[t]))return!0;if((await e.call(`vfs`,`stat`,[t])).isFile)return e.call(`vfs`,`rm`,[t]);if(!n?.recursive)throw Error(`rm: '${t}' is a directory (use {recursive: true})`);let r=await e.call(`vfs`,`readDir`,[t]);for(let e of r)await c(`${t}/${e}`,n);return e.call(`vfs`,`rm`,[t])}async function l(t){await e.call(`vfs`,`mkdir`,[t])}async function u(t){for(let n=0;n<5;n++){let n=`${t}${Math.random().toString(36).slice(2,10)+Math.random().toString(36).slice(2,6)}`;if(!await e.call(`vfs`,`exists`,[n]))return await e.call(`vfs`,`mkdir`,[n]),n}throw Error(`mkdtemp: failed to create unique directory after 5 attempts`)}async function d(t,n){try{await e.call(`vfs`,`rename`,[t,n])}catch{let r=await e.call(`vfs`,`readFileBinary`,[t]);await e.call(`vfs`,`writeFileBinary`,[n,r]),await e.call(`vfs`,`rm`,[t])}}async function f(t){if(!await e.call(`vfs`,`exists`,[t]))throw Object.assign(Error(`ENOENT: no such file or directory, access '${t}'`),{code:`ENOENT`})}let p={readFile:i,readFileBinary:t=>e.call(`vfs`,`readFileBinary`,[t]),writeFile:a,writeFileBinary:(t,n)=>e.call(`vfs`,`writeFileBinary`,[t,n]),appendFile:o,cp:s,rm:c,readDir:t=>e.call(`vfs`,`readDir`,[t]),readdir:t=>e.call(`vfs`,`readDir`,[t]),exists:t=>e.call(`vfs`,`exists`,[t]),stat:t=>e.call(`vfs`,`stat`,[t]),mkdir:(t,n)=>e.call(`vfs`,`mkdir`,[t]),mkdtemp:u,rename:d,access:f,unlink:t=>e.call(`vfs`,`rm`,[t]),rmdir:t=>e.call(`vfs`,`rm`,[t]),copyFile:async(t,n)=>{let r=await e.call(`vfs`,`readFileBinary`,[t]);await e.call(`vfs`,`writeFileBinary`,[n,r])},fetchToFile:async(n,r)=>{let i=await t(n);if(!i.ok)throw Error(`fetch ${i.status} ${i.statusText}`);let a=new Uint8Array(await i.arrayBuffer());return await e.call(`vfs`,`writeFileBinary`,[r,a]),a.byteLength},promises:null};return me(p,n),p.promises=p,p}function j(e,t,n=``){return Object.assign(Error(`${e}: sync-fs, ${n?`${n} `:``}'${t}'`),{code:e})}function ge(e,t,n,r={},i){let a=r.recursive===!0;try{return r.requireFile?e.unlink(n):e.rm(n,a),i?.(n),!0}catch(e){if(e?.code!==`ENOENT`)throw e}let o=t;if(!o?.rm||e.isTombstoned(n))return!1;try{if(!o.exists(n))return!1}catch{return!1}return o.rm(n),e.markRemoved(n,a),!0}function _e(e){let{syncFs:t,bridge:n,resolve:r,existsResolved:i,lstatResolved:a,statResolved:o,readBytes:s,writeThrough:c,persistDelete:l}=e,u=(e,r)=>ge(t,n,e,r,l);return{rmSync(e,t){let n=r(e);if(!(t?.force&&!i(n))&&!u(n,{recursive:t?.recursive===!0})&&!t?.force)throw j(`ENOENT`,n,`rm`)},rmdirSync(e,t){let n=r(e);if(i(n)&&!a(n).isDirectory)throw j(`ENOTDIR`,n,`rmdir`);if(!u(n,{recursive:t?.recursive===!0}))throw j(`ENOENT`,n,`rmdir`)},unlinkSync(e){let t=r(e);if(!u(t,{requireFile:!0}))throw j(`ENOENT`,t,`unlink`)},renameSync(e,i){let a=r(e),l=r(i);try{t.rename(a,l);return}catch(e){if(e?.code!==`ENOENT`)throw e}if(!n||t.isTombstoned(a))throw j(`ENOENT`,a,`rename`);if(o(a).isDirectory)throw j(`EISDIR`,a,`rename`);if(c(l,s(a)),!u(a,{requireFile:!0}))throw j(`ENOENT`,a,`rename`)}}}function ve(e,t){if(!t)return;let n={readFileSync:e.readFileSync,writeFileSync:e.writeFileSync,appendFileSync:e.appendFileSync,existsSync:e.existsSync,accessSync:e.accessSync,statSync:e.statSync,lstatSync:e.lstatSync};e.readFileSync=(e,r)=>ce(e,`read`)?de(t.readStdinBytes(),fe(r)):n.readFileSync(e,r),e.writeFileSync=(e,r)=>{let i=le(t,e,`write`);i?i(ue(r)):n.writeFileSync(e,r)},e.appendFileSync=(e,r)=>{let i=le(t,e,`append`);i?i(ue(r)):n.appendFileSync(e,r)},e.existsSync=e=>oe(e)||n.existsSync(e),e.accessSync=e=>{oe(e)||n.accessSync(e)},e.statSync=e=>oe(e)?pe():n.statSync(e),e.lstatSync=e=>oe(e)?pe():n.lstatSync(e)}function ye(e,t,n,r){let i=t=>e===`/`?`/${t}`:`${e}/${t}`,a=new Set(n);for(let e of t)a.add(e);for(let e of a)r(i(e))&&a.delete(e);return[...a]}function be(e,t,n){let r=t=>e.isTombstoned(t);try{let i=e.readdir(n);if(!t||!e.isPartial(n)||r(n))return i;try{return ye(n,i,t.readdir(n),r)}catch(e){if(e?.code===`ENOENT`)return i;throw e}}catch(e){let i=e?.code;if(!t||r(n)||i!==`ENOENT`)throw e;return ye(n,[],t.readdir(n),r)}}function xe(e){if(typeof e==`string`)return new TextEncoder().encode(e);if(e instanceof Uint8Array)return e;if(ArrayBuffer.isView(e)){let t=e;return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}return new TextEncoder().encode(String(e))}function Se(e,t,n,r,i){t?(t.writeFile(r,i),e.commitWrite(r,i)):(e.writeFile(r,i),n?.write?.(r,i))}function Ce(e,t,n,r,i){function a(e){return D(e.startsWith(`/`)?e:t+(t.endsWith(`/`)?``:`/`)+e)}function o(t){try{return e.readFile(t)}catch(r){let i=r?.code;if(n&&!e.isTombstoned(t)&&(i===`ENOENT`||i===`ENOSYNC`))return n.readFile(t);throw r}}let s=(t,r)=>Se(e,n,i,t,r);function c(t){if(e.exists(t))return!0;if(!n||e.isTombstoned(t))return!1;try{return n.exists(t)}catch{return!1}}function l(t){try{return e.stat(t)}catch(r){let i=r?.code;if(!n||e.isTombstoned(t)||i!==`ENOENT`)throw r;return n.stat(t)}}function u(t){try{return e.lstat(t)}catch(r){let i=r?.code;if(!n||e.isTombstoned(t)||i!==`ENOENT`)throw r;return n.lstat(t)}}let d=e=>({isFile:()=>e.isFile,isDirectory:()=>e.isDirectory,isSymbolicLink:()=>e.isSymbolicLink===!0,isCharacterDevice:()=>!1,size:e.size}),f=(e,t)=>e===`/`?`/${t}`:`${e}/${t}`;function p(t,r){if(!l(t).isDirectory){s(r,o(t));return}e.mkdir(r,!0);for(let i of be(e,n,t))p(f(t,i),f(r,i))}let m={..._e({syncFs:e,bridge:n,persistDelete:i?.delete,resolve:a,existsResolved:c,statResolved:l,lstatResolved:u,readBytes:o,writeThrough:s}),readFileSync(e,t){return de(o(a(e)),fe(t))},writeFileSync(e,t){s(a(e),xe(t))},appendFileSync(e,t){let n=a(e),r=new Uint8Array;try{r=o(n)}catch(e){if(e?.code!==`ENOENT`)throw e}let i=xe(t),c=new Uint8Array(r.byteLength+i.byteLength);c.set(r),c.set(i,r.byteLength),s(n,c)},truncateSync(e,t=0){let n=a(e),r=o(n),i=new Uint8Array(t);i.set(r.subarray(0,Math.min(t,r.byteLength))),s(n,i)},existsSync(e){return c(a(e))},accessSync(e){let t=a(e);if(!c(t))throw j(`ENOENT`,t,`access`)},mkdirSync(t,n){e.mkdir(a(t),n?.recursive)},statSync:e=>d(l(a(e))),lstatSync:e=>d(u(a(e))),realpathSync(e){let t=a(e);if(!c(t))throw j(`ENOENT`,t,`realpath`);return t},readdirSync(t){return be(e,n,a(t))},copyFileSync(e,t){s(a(t),o(a(e)))},cpSync(e,t){p(a(e),a(t))},chmodSync(e){let t=a(e);if(!c(t))throw j(`ENOENT`,t,`chmod`)},mkdtempSync(t){return e.mkdtemp(a(t))}};return ve(m,r),m}function we(e){let t=e=>{if(typeof e==`string`)return e;if(e instanceof Error)return e.message;if(e==null)return String(e);try{return JSON.stringify(e)}catch{return String(e)}},n=(e,t,n)=>t===void 0?`${e(`Error:`)} ${n}\n`:t===``?`${e(n)}\n`:`${e(`${t}:`)} ${n}\n`,r=(t,n)=>t===void 0?`${e.color.yellow(`Warning:`)} ${n}\n`:t===``?`${e.color.yellow(n)}\n`:`${e.color.yellow(`${t}:`)} ${n}\n`;return{die(r,i){let a=typeof i==`number`?i:i?.exitCode??1,o=typeof i==`object`&&i&&`prefix`in i?i.prefix:void 0,s=t(r);throw e.writeStderr(n(e.color.red,o,s)),e.exit(a),Error(`unreachable`)},out(t){if(typeof t==`string`){e.writeStdout(t.endsWith(`
|
|
2
2
|
`)?t:`${t}\n`);return}try{e.writeStdout(`${JSON.stringify(t,null,2)}\n`)}catch{e.writeStdout(`${String(t)}\n`)}},warn(n,i){let a=typeof i==`object`&&i&&`prefix`in i?i.prefix:void 0;e.writeStderr(r(a,t(n)))},help(t){throw e.writeStdout(t.endsWith(`
|
|
3
3
|
`)?t:`${t}\n`),e.exit(0),Error(`unreachable`)}}}const M={reset:`\x1B[0m`,green:`\x1B[32m`,red:`\x1B[31m`,yellow:`\x1B[33m`,gray:`\x1B[90m`,bold:`\x1B[1m`,cyan:`\x1B[36m`,dim:`\x1B[2m`};function Te(e){let t=e.isTTY&&!e.noColor,n=e=>n=>t?`${e}${n}${M.reset}`:String(n);return{enabled:t,green:n(M.green),red:n(M.red),yellow:n(M.yellow),gray:n(M.gray),bold:n(M.bold),cyan:n(M.cyan),dim:n(M.dim)}}const Ee=/\u001b\[[0-9;]*m/g;function De(e){return e.replace(Ee,``)}function Oe(e){return De(e).length}function ke(e,t){let n=String(e??``);return t<=0?``:Oe(n)<=t?n:t<=1?n.slice(0,t):`${De(n).slice(0,t-1)}…`}function Ae(e,t){let n=String(e??``),r=Oe(n);return r===t?n:r>t?ke(n,t):n+` `.repeat(t-r)}function je(e,t){if(!e.length)return``;let n=Math.max(...e.map(e=>e.length)),r=[];for(let i=0;i<n;i++)if(t&&t[i]!==void 0)r[i]=t[i];else{let t=0;for(let n of e){let e=i<n.length?String(n[i]??``):``;t=Math.max(t,Oe(e))}r[i]=t}return e.map(e=>r.map((t,n)=>Ae(n<e.length?String(e[n]??``):``,t)).join(` `).replace(/\s+$/,``)).join(`
|
|
4
4
|
`)}function Me(e){return e instanceof Date?e:new Date(e)}function Ne(e){return e<10?`0${e}`:String(e)}function Pe(e,t=`short`){let n=Me(e);if(Number.isNaN(n.getTime()))return String(e);if(t===`iso`)return n.toISOString();if(t===`locale`)return new Intl.DateTimeFormat(void 0,{dateStyle:`medium`}).format(n);if(t===`human`){let e=Date.now()-n.getTime(),t=Math.abs(e);if(t<6e4)return e>=0?`just now`:`in a moment`;let r=(t,n)=>e>=0?`${t} ${n}${t===1?``:`s`} ago`:`in ${t} ${n}${t===1?``:`s`}`;return t<36e5?r(Math.round(t/6e4),`minute`):t<864e5?r(Math.round(t/36e5),`hour`):t<26298e5?r(Math.round(t/864e5),`day`):t<315576e5?r(Math.round(t/26298e5),`month`):r(Math.round(t/315576e5),`year`)}return`${n.getFullYear()}-${Ne(n.getMonth()+1)}-${Ne(n.getDate())}`}const Fe={trunc:ke,col:Ae,table:je,date:Pe};var N=class extends Error{actual;expected;operator;generatedMessage;code;constructor(e={}){let t=!e.message;super(e.message||`${Ie(e.actual)} ${e.operator||`!=`} ${Ie(e.expected)}`),this.name=`AssertionError`,this.actual=e.actual,this.expected=e.expected,this.operator=e.operator||``,this.generatedMessage=t,this.code=`ERR_ASSERTION`}};function Ie(e){if(typeof e==`string`)return JSON.stringify(e);if(e==null)return String(e);if(typeof e==`object`)try{return JSON.stringify(e)}catch{return String(e)}return String(e)}function P(e,t){return e instanceof Error?e:typeof e==`string`?new N({message:e}):t()}function Le(e,t,n,r){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!ze(e[i],t[i],n,r))return!1;return!0}function Re(e,t,n,r){let i=Object.keys(e);if(i.length!==Object.keys(t).length)return!1;for(let a of i)if(!Object.prototype.hasOwnProperty.call(t,a)||!ze(Reflect.get(e,a),Reflect.get(t,a),n,r))return!1;return!0}function ze(e,t,n,r){if((n?Object.is(e,t):e===t)||!n&&e==t)return!0;if(typeof e!=`object`||typeof t!=`object`||e===null||t===null)return!1;let i=e,a=t;return n&&Object.getPrototypeOf(i)!==Object.getPrototypeOf(a)?!1:r.get(i)===a||(r.set(i,a),Array.isArray(e)===Array.isArray(t)?Array.isArray(e)&&Array.isArray(t)?Le(e,t,n,r):Re(i,a,n,r):!1)}function Be(e,t){try{if(e instanceof t)return!0}catch{}try{return!!t(e)}catch{return!1}}function Ve(e,t){for(let[n,r]of Object.entries(t)){let t=Reflect.get(e,n);if(r instanceof RegExp){if(typeof t!=`string`||!r.test(t))return!1}else if(t!==r)return!1}return!0}function He(e,t){if(t===void 0)return!0;if(t instanceof RegExp){let n=e instanceof Error?e.message:String(e);return t.test(n)}return typeof t==`function`?Be(e,t):t&&typeof t==`object`?!e||typeof e!=`object`?!1:Ve(e,t):!1}function Ue(e){let t=(e,t)=>{if(!e)throw P(t,()=>new N({message:`The expression evaluated to a falsy value`,actual:e,expected:!0,operator:`==`}))},n=((e,n)=>t(e,n)),r=(e,t,n)=>{if(!Object.is(e,t))throw P(n,()=>new N({actual:e,expected:t,operator:`strictEqual`}))},i=(t,n,i)=>{if(e){r(t,n,i);return}if(t!=n)throw P(i,()=>new N({actual:t,expected:n,operator:`==`}))},a=(e,t,n)=>{if(Object.is(e,t))throw P(n,()=>new N({actual:e,expected:t,operator:`notStrictEqual`}))},o=(t,n,r)=>{if(e){a(t,n,r);return}if(t==n)throw P(r,()=>new N({actual:t,expected:n,operator:`!=`}))},s=(e,t,n)=>{if(!ze(e,t,!0,new WeakMap))throw P(n,()=>new N({actual:e,expected:t,operator:`deepStrictEqual`}))},c=(t,n,r)=>{if(e){s(t,n,r);return}if(!ze(t,n,!1,new WeakMap))throw P(r,()=>new N({actual:t,expected:n,operator:`deepEqual`}))},l=(e,t,n)=>{if(ze(e,t,!0,new WeakMap))throw P(n,()=>new N({actual:e,expected:t,operator:`notDeepStrictEqual`}))};return n.ok=t,n.equal=i,n.notEqual=o,n.strictEqual=r,n.notStrictEqual=a,n.deepEqual=c,n.deepStrictEqual=s,n.notDeepEqual=(t,n,r)=>{if(e){l(t,n,r);return}if(ze(t,n,!1,new WeakMap))throw P(r,()=>new N({actual:t,expected:n,operator:`notDeepEqual`}))},n.notDeepStrictEqual=l,n.throws=(e,t,n)=>{let r,i=!1;try{e()}catch(e){r=e,i=!0}if(!i)throw P(typeof t==`string`?t:n,()=>new N({message:`Missing expected exception`,operator:`throws`}));if(!(typeof t==`string`||t instanceof Error)&&!He(r,t))throw P(n,()=>new N({message:`Got unwanted exception`,actual:r,operator:`throws`}))},n.doesNotThrow=(e,t)=>{try{e()}catch(e){throw P(t,()=>new N({message:`Got unwanted exception`,actual:e,operator:`doesNotThrow`}))}},n.fail=e=>{throw P(e,()=>new N({message:`Failed`,operator:`fail`}))},n.AssertionError=N,n}const We=Ue(!0);We.strict=We;const Ge=Ue(!1);Ge.strict=We;function Ke(e,t){let n=globalThis.Buffer;if(!n)throw Error(`crypto.createHash: Buffer is unavailable in this environment`);return t?n.from(e,t):n.from(e)}var qe=class{_events=new Map;on(e,t){let n=this._events.get(e);return n?n.push(t):this._events.set(e,[t]),this}addListener(e,t){return this.on(e,t)}off(e,t){let n=this._events.get(e);if(n){let r=n.indexOf(t);r!==-1&&n.splice(r,1),n.length===0&&this._events.delete(e)}return this}removeListener(e,t){return this.off(e,t)}once(e,t){let n=(...r)=>{this.off(e,n),t(...r)};return this.on(e,n)}emit(e,...t){let n=this._events.get(e);if(!n||n.length===0)return!1;for(let e of[...n])e(...t);return!0}removeAllListeners(e){return e===void 0?this._events.clear():this._events.delete(e),this}listenerCount(e){return this._events.get(e)?.length??0}listeners(e){return[...this._events.get(e)??[]]}};const Je=Object.assign(qe,{EventEmitter:qe,default:qe});var Ye=class{_events=new Map;closeScheduled=!1;writable=!0;readable=!0;on(e,t){let n=this._events.get(e);return n?n.push(t):this._events.set(e,[t]),this}once(e,t){let n=(...r)=>{this.off(e,n),t(...r)};return this.on(e,n)}off(e,t){let n=this._events.get(e);if(n){let e=n.indexOf(t);e!==-1&&n.splice(e,1)}return this}emit(e,...t){let n=this._events.get(e);if(!n||n.length===0)return!1;for(let e of[...n])e(...t);return!0}pipe(e){return this.on(`data`,t=>e.write(t)),this.once(`end`,()=>e.end()),e}closeOnDestroy(){return this.closeScheduled?this:(this.closeScheduled=!0,queueMicrotask(()=>this.emit(`close`)),this)}removeListener(e,t){return this.off(e,t)}removeAllListeners(){return this._events.clear(),this}},Xe=class extends Ye{read(){return null}destroy(){return this.closeOnDestroy()}},Ze=class extends Ye{write(e,t,n){return n&&queueMicrotask(n),!0}end(e){return e&&queueMicrotask(e),this}destroy(){return this.closeOnDestroy()}},Qe=class extends Ye{write(e,t,n){return n&&queueMicrotask(n),!0}end(e){return e&&queueMicrotask(e),this}read(){return null}destroy(){return this.closeOnDestroy()}};const $e={Readable:Xe,Writable:Ze,Transform:Qe,PassThrough:class extends Qe{},Stream:Ye},et=Symbol.for(`nodejs.util.inspect.custom`),tt=Symbol.for(`nodejs.util.promisify.custom`);function nt(e){return`'${e.replace(/\\/g,`\\\\`).replace(/'/g,`\\'`).replace(/\n/g,`\\n`)}'`}function rt(e){if(e===null)return`null`;let t=typeof e;if(t===`string`)return nt(e);if(t===`number`)return Object.is(e,-0)?`-0`:String(e);if(t===`bigint`)return`${String(e)}n`;if(t===`boolean`||t===`undefined`)return String(e);if(t===`symbol`)return e.toString();if(t===`function`){let t=e.name;return t?`[Function: ${t}]`:`[Function (anonymous)]`}return null}function it(e){return e instanceof RegExp?e.toString():e instanceof Date?Number.isNaN(e.getTime())?`Invalid Date`:e.toISOString():e instanceof Error?e.stack||`${e.name}: ${e.message}`:null}function at(e,t,n){if(Array.isArray(e))return e.length===0?`[]`:`[ ${e.map(e=>ot(e,t+1,n)).join(`, `)} ]`;if(e instanceof Map){let r=[...e].map(([e,r])=>`${ot(e,t+1,n)} => ${ot(r,t+1,n)}`);return`Map(${e.size}) {${r.length?` ${r.join(`, `)} `:``}}`}if(e instanceof Set){let r=[...e].map(e=>ot(e,t+1,n));return`Set(${e.size}) {${r.length?` ${r.join(`, `)} `:``}}`}let r=Object.keys(e),i=e.constructor?e.constructor.name:``,a=i&&i!==`Object`?`${i} `:``;return r.length===0?`${a}{}`:`${a}{ ${r.map(r=>`${/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(r)?r:nt(r)}: ${ot(e[r],t+1,n)}`).join(`, `)} }`}function ot(e,t,n){let r=rt(e);if(r!==null)return r;let i=e,a=it(i);if(a!==null)return a;let o=i[et];if(typeof o==`function`)try{return String(o.call(i,n.maxDepth,n.opts))}catch{}if(n.seen.has(e))return`[Circular *1]`;if(n.maxDepth!==null&&t>n.maxDepth)return Array.isArray(e)?`[Array]`:`[Object]`;n.seen.add(e);try{return at(i,t,n)}finally{n.seen.delete(e)}}function st(e,t={}){let n=t.depth===void 0?2:t.depth;return ot(e,0,{seen:new Set,maxDepth:n,opts:t})}function ct(e,t,n,r){if(e===`%%`)return`%`;if(n.i>=t.length)return e;let i=t[n.i];switch(e){case`%s`:return n.i++,typeof i==`string`?i:typeof i==`bigint`?`${String(i)}n`:i==null||typeof i==`number`||typeof i==`boolean`?String(i):st(i,{depth:r.depth===void 0?2:r.depth});case`%d`:return n.i++,typeof i==`bigint`?`${String(i)}n`:Number.isNaN(Number(i))?`NaN`:String(Number(i));case`%i`:return n.i++,typeof i==`bigint`?`${String(i)}n`:String(Number.parseInt(i,10));case`%f`:return n.i++,String(typeof i==`bigint`?i:Number.parseFloat(i));case`%j`:n.i++;try{return JSON.stringify(i)??`undefined`}catch{return`[Circular]`}case`%o`:return n.i++,st(i,{depth:4});case`%O`:return n.i++,st(i,{depth:null});case`%c`:return n.i++,``;default:return e}}function lt(e,...t){let n=t[0];if(typeof n!=`string`)return t.map(e=>typeof e==`string`?e:st(e)).join(` `);let r={i:1},i=n.replace(/%[sdifjoOc%]/g,n=>ct(n,t,r,e));for(;r.i<t.length;r.i++){let e=t[r.i];i+=` ${typeof e==`string`?e:st(e)}`}return i}function ut(...e){return lt({},...e)}function dt(e,t){if(e==null)throw TypeError(`The constructor to "inherits" must not be null or undefined`);if(t==null)throw TypeError(`The super constructor to "inherits" must not be null or undefined`);if(t.prototype===void 0)throw TypeError(`The super constructor to "inherits" must have a prototype`);e.super_=t,Object.setPrototypeOf(e.prototype,t.prototype)}function ft(e){if(typeof e!=`function`)throw TypeError(`The "original" argument must be of type function`);let t=e[tt];if(t){if(typeof t!=`function`)throw TypeError(`The [util.promisify.custom] property must be of type function`);return t}function n(...t){return new Promise((n,r)=>{e.call(this,...t,(e,...t)=>{if(e){r(e);return}n(t.length>1?t:t[0])})})}return Object.setPrototypeOf(n,Object.getPrototypeOf(e)),Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)),n}function pt(e){return function(t,n,r){if(typeof t!=`function`)throw TypeError(`The "fn" argument must be of type function`);let i=!1;function a(...a){return i||(i=!0,e(r?`[${r}] DeprecationWarning: ${n}`:`DeprecationWarning: ${n}`)),new.target?Reflect.construct(t,a,new.target):t.apply(this,a)}return Object.setPrototypeOf(a,Object.getPrototypeOf(t)),t.prototype&&(a.prototype=t.prototype),a}}const mt=st;mt.custom=et;const ht=ft;ht.custom=tt;function gt(e){return{format:ut,formatWithOptions:lt,inspect:mt,inherits:dt,promisify:ht,deprecate:pt(e)}}const _t=gt(()=>{});let vt=1;function yt(e){if(typeof e==`string`)return e;if(ArrayBuffer.isView(e)){let t=e;return new TextDecoder().decode(new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}return e==null?``:String(e)}function bt(e,t,n){return Object.assign(TypeError(`The "${e}" argument must be of type ${t}. Received ${n===null?`null`:Array.isArray(n)?`array`:typeof n}`),{code:`ERR_INVALID_ARG_TYPE`})}function xt(e){if(e===void 0)return;if(typeof e!=`object`||!e||Array.isArray(e))throw bt(`options.env`,`object`,e);let t={};for(let[n,r]of Object.entries(e))if(r!==void 0){if(typeof r!=`string`)throw bt(`options.env[${n}]`,`string`,r);t[n]=r}return t}function St(e){if(e!==void 0){if(typeof e!=`string`)throw bt(`options.cwd`,`string`,e);return e}}function Ct(e,t){return t===void 0||t===`utf8`||t===`utf-8`?e:t===`buffer`||t===null?Ke(e):Ke(e).toString(t)}function wt(e,t){if(e.length===0)return Ct(``,t);if(typeof e[0]==`string`)return e.join(``);let n=globalThis.Buffer;return n?n.concat(e):e[0]}function Tt(e,t,n){t.length>0&&e.emit(`data`,Ct(t,n)),e.readable=!1,e.emit(`end`)}function Et(e){let t=e=>{typeof e==`function`&&queueMicrotask(e)};return{writable:!0,write(n,r,i){return e.stdin.write(yt(n)),t(typeof r==`function`?r:i),!0},end(n,r,i){n!==void 0&&typeof n!=`function`&&e.stdin.write(yt(n)),e.stdin.end(),this.writable=!1,t(typeof n==`function`?n:typeof r==`function`?r:i)}}}var Dt=class extends qe{stdout;stderr;stdin;pid;exitCode=null;signalCode=null;killed=!1;spawnfile;spawnargs;handle;constructor(e,t,n,r){super(),this.handle=e,this.pid=vt++,this.spawnfile=n,this.spawnargs=r,this.stdout=new Xe,this.stderr=new Xe,this.stdin=Et(e),e.done.then(e=>this.finish(e,t),e=>this.emit(`error`,e instanceof Error?e:Error(String(e))))}finish(e,t){Tt(this.stdout,e.stdout,t),Tt(this.stderr,e.stderr,t),this.exitCode=e.exitCode;let n=this.killed?null:e.exitCode,r=this.killed?this.signalCode:null;this.emit(`exit`,n,r),this.emit(`close`,n,r)}kill(e=`SIGTERM`){return this.killed=!0,this.signalCode=e,this.handle.kill(e).catch(()=>{}),!0}};function Ot(e){let t=(t,n,r)=>{if(!e)throw Error(`child_process.${t} is not available in this browser realm (no synchronous bridge — the page has no controlling Service Worker). Use the async form instead: await promisify(${t.replace(/Sync$/,``)})(…).`);return e.run(n,r)},n=e=>{let t=St(e.cwd),n=xt(e.env);return{...e.input===void 0?{}:{input:yt(e.input)},...e.timeout===void 0?{}:{timeout:e.timeout},...t===void 0?{}:{cwd:t},...n===void 0?{}:{env:n}}},r=(e,r,i,a)=>{let o=a.encoding===void 0?`buffer`:a.encoding,s=t(e,r,n(a)),c=Ct(s.stdout,o),l=Ct(s.stderr,o);if(s.exitCode===0)return c;throw Object.assign(Error(`Command failed: ${i}\n${s.stderr}`),{status:s.exitCode,signal:null,stdout:c,stderr:l,output:[null,c,l],pid:vt++})},i=(e,t)=>({args:Array.isArray(e)?e:[],options:(Array.isArray(e)?t:e)??{}});return{execSync:(e,t={})=>r(`execSync`,e,e,t),execFileSync:(e,t,n)=>{let{args:a,options:o}=i(t,n),s=[e,...a];return r(`execFileSync`,s,s.join(` `),o)},spawnSync:(e,r,a)=>{let{args:o,options:s}=i(r,a),c=s.encoding===void 0?`buffer`:s.encoding,l=vt++,u=s.shell?`${e}${o.length?` ${o.join(` `)}`:``}`:[e,...o],d;try{d=t(`spawnSync`,u,n(s))}catch(e){if(e instanceof TypeError)throw e;let t=Ct(``,c);return{pid:l,status:null,signal:null,stdout:t,stderr:t,output:[null,t,t],error:e instanceof Error?e:Error(String(e))}}let f=Ct(d.stdout,c),p=Ct(d.stderr,c);return{pid:l,status:d.exitCode,signal:null,stdout:f,stderr:p,output:[null,f,p]}}}}function kt(e,t){let n=(t,n,r,i,a)=>{let o=St(n.cwd),s=xt(n.env),c={...o===void 0?{}:{cwd:o},...s===void 0?{}:{env:s}},l=e.start(t,c),u=new Dt(l,r,i,a);return n.input!==void 0&&u.stdin.write(yt(n.input)),queueMicrotask(()=>l.stdin.end()),u},r=(e,t,n,r)=>{if(typeof r!=`function`)return;let i=[],a=[];e.stdout.on(`data`,e=>i.push(e)),e.stderr.on(`data`,e=>a.push(e)),e.once(`error`,e=>r(e,wt(i,t),wt(a,t))),e.once(`close`,(o,s)=>{let c=wt(i,t),l=wt(a,t);if(o===0){r(null,c,l);return}r(Object.assign(Error(`Command failed: ${n}\n${yt(l)}`),{code:o===null?void 0:o,killed:e.killed,signal:s??null,cmd:n}),c,l)})},i=(e,t,i)=>{let a=typeof t==`function`?t:i,o=t&&typeof t==`object`?t:{},s=o.encoding===void 0?`utf8`:o.encoding,c=n(e,o,s,e,[]);return r(c,s,e,a),c},a=(e,t,i,a)=>{let o=[],s={},c;Array.isArray(t)?(o=t,typeof i==`function`?c=i:(s=i??{},c=typeof a==`function`?a:void 0)):typeof t==`function`?c=t:t&&typeof t==`object`&&(s=t,c=typeof i==`function`?i:void 0);let l=s.encoding===void 0?`utf8`:s.encoding,u=[e,...o],d=n(u,s,l,e,o);return r(d,l,u.join(` `),c),d},o=(e,t,r)=>{let i=[],a={};Array.isArray(t)?(i=t,a=r??{}):t&&typeof t==`object`&&(a=t);let o=a.encoding===void 0?`buffer`:a.encoding,s=a.shell?`${e}${i.length?` ${i.join(` `)}`:``}`:[e,...i];return n(s,a,o,e,i)},s=(e,t)=>new Promise((n,r)=>{i(e,t,(e,t,i)=>{if(e){r(Object.assign(e,{stdout:t,stderr:i}));return}n({stdout:t,stderr:i})})}),c=(e,t,n)=>new Promise((r,i)=>{a(e,Array.isArray(t)?t:[],Array.isArray(t)?n:t,(e,t,n)=>{if(e){i(Object.assign(e,{stdout:t,stderr:n}));return}r({stdout:t,stderr:n})})}),l=e=>()=>{throw Error(`child_process.${e} is not available in the browser realm`)},u=Ot(t),d=(e,t)=>{Object.defineProperty(e,tt,{value:t,enumerable:!1,configurable:!0})};return d(i,s),d(a,c),{exec:i,execFile:a,spawn:o,execSync:u.execSync,spawnSync:u.spawnSync,execFileSync:u.execFileSync,fork:l(`fork`),ChildProcess:Dt}}function At(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var jt={exports:{}};
|
|
@@ -21,10 +21,10 @@ import{t as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./__vite-browse
|
|
|
21
21
|
* @license MIT
|
|
22
22
|
*/
|
|
23
23
|
(function(){var e=`input is invalid type`,r=typeof window==`object`,i=r?window:{};i.JS_SHA1_NO_WINDOW&&(r=!1);var a=!r&&typeof self==`object`,s=!i.JS_SHA1_NO_NODE_JS&&typeof process==`object`&&process.versions&&process.versions.node;s?i=globalThis:a&&(i=self);var c=!i.JS_SHA1_NO_COMMON_JS&&typeof n==`object`&&n.exports,l=typeof define==`function`&&define.amd,u=!i.JS_SHA1_NO_ARRAY_BUFFER&&typeof ArrayBuffer<`u`,d=`0123456789abcdef`.split(``),f=[-2147483648,8388608,32768,128],p=[24,16,8,0],m=[`hex`,`array`,`digest`,`arrayBuffer`],h=[],g=Array.isArray;(i.JS_SHA1_NO_NODE_JS||!g)&&(g=function(e){return Object.prototype.toString.call(e)===`[object Array]`});var _=ArrayBuffer.isView;u&&(i.JS_SHA1_NO_ARRAY_BUFFER_IS_VIEW||!_)&&(_=function(e){return typeof e==`object`&&e.buffer&&e.buffer.constructor===ArrayBuffer});var v=function(t){var n=typeof t;if(n===`string`)return[t,!0];if(n!==`object`||t===null)throw Error(e);if(u&&t.constructor===ArrayBuffer)return[new Uint8Array(t),!1];if(!g(t)&&!_(t))throw Error(e);return[t,!1]},y=function(e){return function(t){return new w(!0).update(t)[e]()}},b=function(){var e=y(`hex`);s&&(e=x(e)),e.create=function(){return new w},e.update=function(t){return e.create().update(t)};for(var t=0;t<m.length;++t){var n=m[t];e[n]=y(n)}return e},x=function(n){var r=t(),a=o().Buffer,s=a.from&&!i.JS_SHA1_NO_BUFFER_FROM?a.from:function(e){return new a(e)};return function(t){if(typeof t==`string`)return r.createHash(`sha1`).update(t,`utf8`).digest(`hex`);if(t==null)throw Error(e);return t.constructor===ArrayBuffer&&(t=new Uint8Array(t)),g(t)||_(t)||t.constructor===a?r.createHash(`sha1`).update(s(t)).digest(`hex`):n(t)}},S=function(e){return function(t,n){return new T(t,!0).update(n)[e]()}},C=function(){var e=S(`hex`);e.create=function(e){return new T(e)},e.update=function(t,n){return e.create(t).update(n)};for(var t=0;t<m.length;++t){var n=m[t];e[n]=S(n)}return e};function w(e){e?(h[0]=h[16]=h[1]=h[2]=h[3]=h[4]=h[5]=h[6]=h[7]=h[8]=h[9]=h[10]=h[11]=h[12]=h[13]=h[14]=h[15]=0,this.blocks=h):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.h0=1732584193,this.h1=4023233417,this.h2=2562383102,this.h3=271733878,this.h4=3285377520,this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}w.prototype.update=function(e){if(this.finalized)throw Error(`finalize already called`);var t=v(e);e=t[0];for(var n=t[1],r,i=0,a,o=e.length||0,s=this.blocks;i<o;){if(this.hashed&&(this.hashed=!1,s[0]=this.block,this.block=s[16]=s[1]=s[2]=s[3]=s[4]=s[5]=s[6]=s[7]=s[8]=s[9]=s[10]=s[11]=s[12]=s[13]=s[14]=s[15]=0),n)for(a=this.start;i<o&&a<64;++i)r=e.charCodeAt(i),r<128?s[a>>>2]|=r<<p[a++&3]:r<2048?(s[a>>>2]|=(192|r>>>6)<<p[a++&3],s[a>>>2]|=(128|r&63)<<p[a++&3]):r<55296||r>=57344?(s[a>>>2]|=(224|r>>>12)<<p[a++&3],s[a>>>2]|=(128|r>>>6&63)<<p[a++&3],s[a>>>2]|=(128|r&63)<<p[a++&3]):(r=65536+((r&1023)<<10|e.charCodeAt(++i)&1023),s[a>>>2]|=(240|r>>>18)<<p[a++&3],s[a>>>2]|=(128|r>>>12&63)<<p[a++&3],s[a>>>2]|=(128|r>>>6&63)<<p[a++&3],s[a>>>2]|=(128|r&63)<<p[a++&3]);else for(a=this.start;i<o&&a<64;++i)s[a>>>2]|=e[i]<<p[a++&3];this.lastByteIndex=a,this.bytes+=a-this.start,a>=64?(this.block=s[16],this.start=a-64,this.hash(),this.hashed=!0):this.start=a}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes%=4294967296),this},w.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[16]=this.block,e[t>>>2]|=f[t&3],this.block=e[16],t>=56&&(this.hashed||this.hash(),e[0]=this.block,e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.hBytes<<3|this.bytes>>>29,e[15]=this.bytes<<3,this.hash()}},w.prototype.hash=function(){var e=this.h0,t=this.h1,n=this.h2,r=this.h3,i=this.h4,a,o,s,c=this.blocks;for(o=16;o<80;++o)s=c[o-3]^c[o-8]^c[o-14]^c[o-16],c[o]=s<<1|s>>>31;for(o=0;o<20;o+=5)a=t&n|~t&r,s=e<<5|e>>>27,i=s+a+i+1518500249+c[o]<<0,t=t<<30|t>>>2,a=e&t|~e&n,s=i<<5|i>>>27,r=s+a+r+1518500249+c[o+1]<<0,e=e<<30|e>>>2,a=i&e|~i&t,s=r<<5|r>>>27,n=s+a+n+1518500249+c[o+2]<<0,i=i<<30|i>>>2,a=r&i|~r&e,s=n<<5|n>>>27,t=s+a+t+1518500249+c[o+3]<<0,r=r<<30|r>>>2,a=n&r|~n&i,s=t<<5|t>>>27,e=s+a+e+1518500249+c[o+4]<<0,n=n<<30|n>>>2;for(;o<40;o+=5)a=t^n^r,s=e<<5|e>>>27,i=s+a+i+1859775393+c[o]<<0,t=t<<30|t>>>2,a=e^t^n,s=i<<5|i>>>27,r=s+a+r+1859775393+c[o+1]<<0,e=e<<30|e>>>2,a=i^e^t,s=r<<5|r>>>27,n=s+a+n+1859775393+c[o+2]<<0,i=i<<30|i>>>2,a=r^i^e,s=n<<5|n>>>27,t=s+a+t+1859775393+c[o+3]<<0,r=r<<30|r>>>2,a=n^r^i,s=t<<5|t>>>27,e=s+a+e+1859775393+c[o+4]<<0,n=n<<30|n>>>2;for(;o<60;o+=5)a=t&n|t&r|n&r,s=e<<5|e>>>27,i=s+a+i-1894007588+c[o]<<0,t=t<<30|t>>>2,a=e&t|e&n|t&n,s=i<<5|i>>>27,r=s+a+r-1894007588+c[o+1]<<0,e=e<<30|e>>>2,a=i&e|i&t|e&t,s=r<<5|r>>>27,n=s+a+n-1894007588+c[o+2]<<0,i=i<<30|i>>>2,a=r&i|r&e|i&e,s=n<<5|n>>>27,t=s+a+t-1894007588+c[o+3]<<0,r=r<<30|r>>>2,a=n&r|n&i|r&i,s=t<<5|t>>>27,e=s+a+e-1894007588+c[o+4]<<0,n=n<<30|n>>>2;for(;o<80;o+=5)a=t^n^r,s=e<<5|e>>>27,i=s+a+i-899497514+c[o]<<0,t=t<<30|t>>>2,a=e^t^n,s=i<<5|i>>>27,r=s+a+r-899497514+c[o+1]<<0,e=e<<30|e>>>2,a=i^e^t,s=r<<5|r>>>27,n=s+a+n-899497514+c[o+2]<<0,i=i<<30|i>>>2,a=r^i^e,s=n<<5|n>>>27,t=s+a+t-899497514+c[o+3]<<0,r=r<<30|r>>>2,a=n^r^i,s=t<<5|t>>>27,e=s+a+e-899497514+c[o+4]<<0,n=n<<30|n>>>2;this.h0=this.h0+e<<0,this.h1=this.h1+t<<0,this.h2=this.h2+n<<0,this.h3=this.h3+r<<0,this.h4=this.h4+i<<0},w.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,r=this.h3,i=this.h4;return d[e>>>28&15]+d[e>>>24&15]+d[e>>>20&15]+d[e>>>16&15]+d[e>>>12&15]+d[e>>>8&15]+d[e>>>4&15]+d[e&15]+d[t>>>28&15]+d[t>>>24&15]+d[t>>>20&15]+d[t>>>16&15]+d[t>>>12&15]+d[t>>>8&15]+d[t>>>4&15]+d[t&15]+d[n>>>28&15]+d[n>>>24&15]+d[n>>>20&15]+d[n>>>16&15]+d[n>>>12&15]+d[n>>>8&15]+d[n>>>4&15]+d[n&15]+d[r>>>28&15]+d[r>>>24&15]+d[r>>>20&15]+d[r>>>16&15]+d[r>>>12&15]+d[r>>>8&15]+d[r>>>4&15]+d[r&15]+d[i>>>28&15]+d[i>>>24&15]+d[i>>>20&15]+d[i>>>16&15]+d[i>>>12&15]+d[i>>>8&15]+d[i>>>4&15]+d[i&15]},w.prototype.toString=w.prototype.hex,w.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,r=this.h3,i=this.h4;return[e>>>24&255,e>>>16&255,e>>>8&255,e&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255,n>>>24&255,n>>>16&255,n>>>8&255,n&255,r>>>24&255,r>>>16&255,r>>>8&255,r&255,i>>>24&255,i>>>16&255,i>>>8&255,i&255]},w.prototype.array=w.prototype.digest,w.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(20),t=new DataView(e);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),e};function T(e,t){var n,r=v(e);if(e=r[0],r[1]){var i=[],a=e.length,o=0,s;for(n=0;n<a;++n)s=e.charCodeAt(n),s<128?i[o++]=s:s<2048?(i[o++]=192|s>>>6,i[o++]=128|s&63):s<55296||s>=57344?(i[o++]=224|s>>>12,i[o++]=128|s>>>6&63,i[o++]=128|s&63):(s=65536+((s&1023)<<10|e.charCodeAt(++n)&1023),i[o++]=240|s>>>18,i[o++]=128|s>>>12&63,i[o++]=128|s>>>6&63,i[o++]=128|s&63);e=i}e.length>64&&(e=new w(!0).update(e).array());var c=[],l=[];for(n=0;n<64;++n){var u=e[n]||0;c[n]=92^u,l[n]=54^u}w.call(this,t),this.update(l),this.oKeyPad=c,this.inner=!0,this.sharedMemory=t}T.prototype=new w,T.prototype.finalize=function(){if(w.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();w.call(this,this.sharedMemory),this.update(this.oKeyPad),this.update(e),w.prototype.finalize.call(this)}};var E=b();E.sha1=E,E.sha1.hmac=C(),c?n.exports=E:(i.sha1=E,l&&define(function(){return E}))})()}))();const Ft=65536,It={md5:Nt,sha1:Pt.sha1,sha256:a};function Lt(e,t){return typeof e==`string`?t===`hex`||t===`base64`||t===`base64url`||t===`latin1`||t===`binary`?new Uint8Array(Ke(e,t===`binary`?`latin1`:t)):e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function Rt(e){let t=String(e).toLowerCase().replace(`-`,``),n=It[t];if(!n)throw Error(`Digest method not supported: ${e}`);let r=n.create(),i=!1,a={update(e,t){if(i)throw Error(`Digest already called`);return r.update(Lt(e,t)),a},digest(e){i=!0;let t=Ke(r.array());return e?t.toString(e):t}};return a}function zt(){let e=globalThis.crypto;if(!e||typeof e.getRandomValues!=`function`)throw Error(`crypto: globalThis.crypto is unavailable in this environment`);return e}function Bt(e){return zt().getRandomValues(e)}function Vt(e){for(let t=0;t<e.length;t+=Ft){let n=Math.min(t+Ft,e.length);Bt(e.subarray(t,n))}}function Ht(e){return e instanceof Uint8Array?e:new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}const F=Array.from({length:256},(e,t)=>(t+256).toString(16).slice(1));function Ut(){let e=zt();if(typeof e.randomUUID==`function`)return e.randomUUID();let t=Bt(new Uint8Array(16));return t[6]=t[6]&15|64,t[8]=t[8]&63|128,`${F[t[0]]}${F[t[1]]}${F[t[2]]}${F[t[3]]}-${F[t[4]]}${F[t[5]]}-${F[t[6]]}${F[t[7]]}-${F[t[8]]}${F[t[9]]}-${F[t[10]]}${F[t[11]]}${F[t[12]]}${F[t[13]]}${F[t[14]]}${F[t[15]]}`}const Wt={randomFillSync(e,t=0,n){let r=Ht(e),i=t,a=n===void 0?r.length:i+n;return Vt(r.subarray(i,a)),e},randomBytes(e){let t=globalThis.Buffer,n=t&&typeof t.allocUnsafe==`function`?t.allocUnsafe(e):new Uint8Array(e);return Vt(Ht(n)),n},randomUUID:Ut,getRandomValues(e){return Bt(e)},createHash:Rt,get webcrypto(){return zt()},get subtle(){return zt().subtle}};function Gt(e,t){let n=[];for(let r of e)r!==``&&r!==`.`&&(r===`..`?n.length>0&&n[n.length-1]!==`..`?n.pop():t&&n.push(`..`):n.push(r));return n}function Kt(e){if(e.length===0)return`.`;let t=e.charCodeAt(0)===47,n=e.charCodeAt(e.length-1)===47,r=Gt(e.split(`/`),!t).join(`/`);return r.length===0&&!t&&(r=`.`),r.length>0&&n&&(r+=`/`),(t?`/`:``)+r}function qt(...e){let t=e.filter(e=>typeof e==`string`&&e.length>0).join(`/`);return t.length===0?`.`:Kt(t)}function Jt(e){if(e.length===0)return`.`;let t=e.charCodeAt(0)===47,n=-1,r=!0;for(let t=e.length-1;t>=1;t--)if(e.charCodeAt(t)===47){if(!r){n=t;break}}else r=!1;return n===-1?t?`/`:`.`:t&&n===1?`//`:e.slice(0,n)}function Yt(e,t){let n=0,r=-1,i=!0;for(let t=e.length-1;t>=0;t--)if(e.charCodeAt(t)===47){if(!i){n=t+1;break}}else r===-1&&(i=!1,r=t+1);let a=r===-1?``:e.slice(n,r);return t&&a.endsWith(t)&&a!==t?a.slice(0,a.length-t.length):a}function Xt(e){let t=Yt(e),n=t.lastIndexOf(`.`);return n<=0?``:t.slice(n)}function Zt(){let e=globalThis.process?.cwd?.();return typeof e==`string`&&e.length>0?e:`/`}function Qt(e,t){let n=``,r=!1;for(let i=t.length-1;i>=-1&&!r;i--){let a=i>=0?t[i]:e();typeof a==`string`&&a.length!==0&&(n=n.length>0?`${a}/${n}`:a,r=a.charCodeAt(0)===47)}let i=Gt(n.split(`/`),!r).join(`/`);return r?i.length>0?`/${i}`:`/`:i.length>0?i:`.`}function $t(e,t,n){let r=Qt(e,[t]),i=Qt(e,[n]);if(r===i)return``;let a=r.split(`/`).filter(Boolean),o=i.split(`/`).filter(Boolean),s=0;for(;s<a.length&&s<o.length&&a[s]===o[s];)s++;return[...a.slice(s).map(()=>`..`),...o.slice(s)].join(`/`)}function en(e){let t=e.charCodeAt(0)===47?`/`:``,n=Yt(e),r=Xt(e),i=r?n.slice(0,n.length-r.length):n,a=Jt(e);return a===`.`&&t===``&&(a=``),{root:t,dir:a,base:n,ext:r,name:i}}function tn(e){let t=e.dir||e.root||``,n=e.base||`${e.name||``}${e.ext||``}`;return t?t===e.root?`${t}${n}`:`${t}/${n}`:n}function nn(e=Zt){return{sep:`/`,delimiter:`:`,basename:Yt,dirname:Jt,extname:Xt,isAbsolute:e=>e.length>0&&e.charCodeAt(0)===47,join:qt,normalize:Kt,resolve:(...t)=>Qt(e,t),relative:(t,n)=>$t(e,t,n),parse:en,format:tn}}const rn=nn();function an(e){let t=typeof e==`string`?e:e.href;if(!t.startsWith(`file://`))throw TypeError(`fileURLToPath: not a file URL`);let n=t.slice(7);return decodeURIComponent(n)}function on(e){let t=e.split(`/`).map(e=>encodeURIComponent(e)).join(`/`);return new URL(`file://${t}`)}const sn={URL:globalThis.URL,URLSearchParams:globalThis.URLSearchParams,fileURLToPath:an,pathToFileURL:on},cn=Object.freeze([...l]);function ln(e){return typeof e==`string`&&c(e)}function un(e){let t=[],n=e;for(;(n===`/`?``:n.slice(n.lastIndexOf(`/`)+1))!==`node_modules`&&t.push(n===`/`||n===``?`/node_modules`:`${n}/node_modules`),n!==`/`&&n!==``;){let e=n.lastIndexOf(`/`);n=e<=0?e===0?`/`:``:n.slice(0,e)}return t}function dn(e){if(e instanceof URL)return sn.fileURLToPath(e);if(typeof e==`string`){if(e.startsWith(`file:`))return sn.fileURLToPath(e);if(e.startsWith(`/`))return e}throw TypeError(`The argument 'filename' must be a file URL object, file URL string, or absolute path string. Received ${String(e)}`)}function fn(e,t){let n=t.startsWith(`/`)?rn.normalize(t):rn.resolve(e,t);return/\.(?:js|json|cjs|mjs)$/.test(n)?[n]:[n,`${n}.js`,`${n}.json`,`${n}.cjs`,`${n}/index.js`,`${n}/index.json`]}function pn(e,t,n){for(let r of fn(e,t))if(n(r))return r}function mn(e,t,n){for(let r of un(e)){let e=pn(r,t,n);if(e)return e}}function hn(e){return e.startsWith(`.`)||e.startsWith(`/`)}function gn(e){function t(e){return{exports:{},id:e??``,filename:e??``,loaded:!1}}let n=t;return n.createRequire=t=>_n(e,t),n.builtinModules=cn,n.isBuiltin=ln,n._nodeModulePaths=un,n.Module=n,n}function _n(e,t){let n=dn(t),r=(t=>e.requireFrom(n,t));return r.resolve=(t,r)=>{if(r?.paths&&r.paths.length>0){let n;for(let i of r.paths)try{return e.resolveFrom(vn(i),t)}catch(e){n=e}throw n instanceof Error?n:Error(`Cannot find module '${t}'`)}return e.resolveFrom(n,t)},r}function vn(e){return`${e.endsWith(`/`)&&e!==`/`?e.slice(0,-1):e}/noop.js`}const yn={platform:()=>`linux`,arch:()=>`x64`,EOL:`
|
|
24
|
-
`,cpus:()=>[{model:`virtual`,speed:0}],hostname:()=>`slicc`,type:()=>`Linux`,release:()=>`0.0.0`};function bn(e){return{...yn,tmpdir:()=>T(e),homedir:()=>e?.HOME?.trim()?e.HOME:`/home/user`}}const xn=bn(),Sn={isatty:e=>!1,ReadStream:class{},WriteStream:class{}};var Cn=4,wn=0,Tn=1,En=2;function Dn(e){let t=e.length;for(;--t>=0;)e[t]=0}var On=29,kn=256,An=286,jn=30,Mn=19,Nn=573,Pn=15,Fn=16,In=7,Ln=256,Rn=16,zn=17,Bn=18,Vn=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),Hn=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),Un=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Wn=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Gn=512,I=Array(576);Dn(I);var Kn=Array(jn*2);Dn(Kn);var qn=Array(Gn);Dn(qn);var Jn=Array(256);Dn(Jn);var Yn=Array(On);Dn(Yn);var Xn=Array(jn);Dn(Xn);var Zn=class{constructor(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}},Qn,$n,er,tr=class{constructor(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}},nr=e=>e<256?qn[e]:qn[256+(e>>>7)],rr=(e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},L=(e,t,n)=>{e.bi_valid>Fn-n?(e.bi_buf|=t<<e.bi_valid&65535,rr(e,e.bi_buf),e.bi_buf=t>>Fn-e.bi_valid,e.bi_valid+=n-Fn):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)},R=(e,t,n)=>{L(e,n[t*2],n[t*2+1])},ir=(e,t)=>{let n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1},ar=e=>{e.bi_valid===16?(rr(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},or=(e,t)=>{let n=t.dyn_tree,r=t.max_code,i=t.stat_desc.static_tree,a=t.stat_desc.has_stree,o=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,c=t.stat_desc.max_length,l,u,d,f,p,m,h=0;for(f=0;f<=Pn;f++)e.bl_count[f]=0;for(n[e.heap[e.heap_max]*2+1]=0,l=e.heap_max+1;l<Nn;l++)u=e.heap[l],f=n[n[u*2+1]*2+1]+1,f>c&&(f=c,h++),n[u*2+1]=f,!(u>r)&&(e.bl_count[f]++,p=0,u>=s&&(p=o[u-s]),m=n[u*2],e.opt_len+=m*(f+p),a&&(e.static_len+=m*(i[u*2+1]+p)));if(h!==0){do{for(f=c-1;e.bl_count[f]===0;)f--;e.bl_count[f]--,e.bl_count[f+1]+=2,e.bl_count[c]--,h-=2}while(h>0);for(f=c;f!==0;f--)for(u=e.bl_count[f];u!==0;)d=e.heap[--l],!(d>r)&&(n[d*2+1]!==f&&(e.opt_len+=(f-n[d*2+1])*n[d*2],n[d*2+1]=f),u--)}},sr=(e,t,n)=>{let r=Array(16),i=0,a,o;for(a=1;a<=Pn;a++)i=i+n[a-1]<<1,r[a]=i;for(o=0;o<=t;o++){let t=e[o*2+1];t!==0&&(e[o*2]=ir(r[t]++,t))}},cr=()=>{let e,t,n,r,i,a=Array(16);for(n=0,r=0;r<On-1;r++)for(Yn[r]=n,e=0;e<1<<Vn[r];e++)Jn[n++]=r;for(Jn[n-1]=r,i=0,r=0;r<16;r++)for(Xn[r]=i,e=0;e<1<<Hn[r];e++)qn[i++]=r;for(i>>=7;r<jn;r++)for(Xn[r]=i<<7,e=0;e<1<<Hn[r]-7;e++)qn[256+i++]=r;for(t=0;t<=Pn;t++)a[t]=0;for(e=0;e<=143;)I[e*2+1]=8,e++,a[8]++;for(;e<=255;)I[e*2+1]=9,e++,a[9]++;for(;e<=279;)I[e*2+1]=7,e++,a[7]++;for(;e<=287;)I[e*2+1]=8,e++,a[8]++;for(sr(I,287,a),e=0;e<jn;e++)Kn[e*2+1]=5,Kn[e*2]=ir(e,5);Qn=new Zn(I,Vn,257,An,Pn),$n=new Zn(Kn,Hn,0,jn,Pn),er=new Zn([],Un,0,Mn,In)},lr=e=>{let t;for(t=0;t<An;t++)e.dyn_ltree[t*2]=0;for(t=0;t<jn;t++)e.dyn_dtree[t*2]=0;for(t=0;t<Mn;t++)e.bl_tree[t*2]=0;e.dyn_ltree[Ln*2]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},ur=e=>{e.bi_valid>8?rr(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},dr=(e,t,n,r)=>{let i=t*2,a=n*2;return e[i]<e[a]||e[i]===e[a]&&r[t]<=r[n]},fr=(e,t,n)=>{let r=e.heap[n],i=n<<1;for(;i<=e.heap_len&&(i<e.heap_len&&dr(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!dr(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r},pr=(e,t,n)=>{let r,i,a=0,o,s;if(e.sym_next!==0)do r=e.pending_buf[e.sym_buf+a++]&255,r+=(e.pending_buf[e.sym_buf+a++]&255)<<8,i=e.pending_buf[e.sym_buf+a++],r===0?R(e,i,t):(o=Jn[i],R(e,o+kn+1,t),s=Vn[o],s!==0&&(i-=Yn[o],L(e,i,s)),r--,o=nr(r),R(e,o,n),s=Hn[o],s!==0&&(r-=Xn[o],L(e,r,s)));while(a<e.sym_next);R(e,Ln,t)},mr=(e,t)=>{let n=t.dyn_tree,r=t.stat_desc.static_tree,i=t.stat_desc.has_stree,a=t.stat_desc.elems,o,s,c=-1,l;for(e.heap_len=0,e.heap_max=Nn,o=0;o<a;o++)n[o*2]===0?n[o*2+1]=0:(e.heap[++e.heap_len]=c=o,e.depth[o]=0);for(;e.heap_len<2;)l=e.heap[++e.heap_len]=c<2?++c:0,n[l*2]=1,e.depth[l]=0,e.opt_len--,i&&(e.static_len-=r[l*2+1]);for(t.max_code=c,o=e.heap_len>>1;o>=1;o--)fr(e,n,o);l=a;do o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],fr(e,n,1),s=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=s,n[l*2]=n[o*2]+n[s*2],e.depth[l]=(e.depth[o]>=e.depth[s]?e.depth[o]:e.depth[s])+1,n[o*2+1]=n[s*2+1]=l,e.heap[1]=l++,fr(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],or(e,t),sr(n,c,e.bl_count)},hr=(e,t,n)=>{let r,i=-1,a,o=t[1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),t[(n+1)*2+1]=65535,r=0;r<=n;r++)a=o,o=t[(r+1)*2+1],!(++s<c&&a===o)&&(s<l?e.bl_tree[a*2]+=s:a===0?s<=10?e.bl_tree[34]++:e.bl_tree[36]++:(a!==i&&e.bl_tree[a*2]++,e.bl_tree[32]++),s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4))},gr=(e,t,n)=>{let r,i=-1,a,o=t[1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),r=0;r<=n;r++)if(a=o,o=t[(r+1)*2+1],!(++s<c&&a===o)){if(s<l)do R(e,a,e.bl_tree);while(--s!==0);else a===0?s<=10?(R(e,zn,e.bl_tree),L(e,s-3,3)):(R(e,Bn,e.bl_tree),L(e,s-11,7)):(a!==i&&(R(e,a,e.bl_tree),s--),R(e,Rn,e.bl_tree),L(e,s-3,2));s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4)}},_r=e=>{let t;for(hr(e,e.dyn_ltree,e.l_desc.max_code),hr(e,e.dyn_dtree,e.d_desc.max_code),mr(e,e.bl_desc),t=18;t>=3&&e.bl_tree[Wn[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},vr=(e,t,n,r)=>{let i;for(L(e,t-257,5),L(e,n-1,5),L(e,r-4,4),i=0;i<r;i++)L(e,e.bl_tree[Wn[i]*2+1],3);gr(e,e.dyn_ltree,t-1),gr(e,e.dyn_dtree,n-1)},yr=e=>{let t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return wn;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return Tn;for(n=32;n<kn;n++)if(e.dyn_ltree[n*2]!==0)return Tn;return wn},br=!1,xr=e=>{br||=(cr(),!0),e.l_desc=new tr(e.dyn_ltree,Qn),e.d_desc=new tr(e.dyn_dtree,$n),e.bl_desc=new tr(e.bl_tree,er),e.bi_buf=0,e.bi_valid=0,lr(e)},Sr=(e,t,n,r)=>{L(e,0+ +!!r,3),ur(e),rr(e,n),rr(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n},Cr=e=>{L(e,2,3),R(e,Ln,I),ar(e)},wr=(e,t,n,r)=>{let i,a,o=0;e.level>0?(e.strm.data_type===En&&(e.strm.data_type=yr(e)),mr(e,e.l_desc),mr(e,e.d_desc),o=_r(e),i=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=i&&(i=a)):i=a=n+5,n+4<=i&&t!==-1?Sr(e,t,n,r):e.strategy===Cn||a===i?(L(e,2+ +!!r,3),pr(e,I,Kn)):(L(e,4+ +!!r,3),vr(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),pr(e,e.dyn_ltree,e.dyn_dtree)),lr(e),r&&ur(e)},z=(e,t,n)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=n,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(Jn[n]+kn+1)*2]++,e.dyn_dtree[nr(t)*2]++),e.sym_next===e.sym_end),Tr=(e,t,n,r)=>{let i=e&65535|0,a=e>>>16&65535|0,o=0;for(;n!==0;){o=n>2e3?2e3:n,n-=o;do i=i+t[r++]|0,a=a+i|0;while(--o);i%=65521,a%=65521}return i|a<<16|0},Er=new Uint32Array((()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t})()),B=(e,t,n,r)=>{let i=Er,a=r+n;e^=-1;for(let n=r;n<a;n++)e=e>>>8^i[(e^t[n])&255];return e^-1},Dr={2:`need dictionary`,1:`stream end`,0:``,"-1":`file error`,"-2":`stream error`,"-3":`data error`,"-4":`insufficient memory`,"-5":`buffer error`,"-6":`incompatible version`},Or=9,kr=573,V=3,Ar=258,H=262,jr=32,Mr=42,Nr=57,Pr=69,Fr=73,Ir=91,Lr=103,U=113,Rr=666,W=1,zr=2,Br=3,Vr=4,Hr=3,G=(e,t)=>(e.msg=Dr[t],t),Ur=e=>e*2-(e>4?9:0),K=e=>{let t=e.length;for(;--t>=0;)e[t]=0},Wr=e=>{let t,n,r,i=e.w_size;t=e.hash_size,r=t;do n=e.head[--r],e.head[r]=n>=i?n-i:0;while(--t);t=i,r=t;do n=e.prev[--r],e.prev[r]=n>=i?n-i:0;while(--t)},Gr=(e,t,n)=>(t<<e.hash_shift^n)&e.hash_mask,Kr=(e,t)=>{let n;if(e.legacy_hash)n=e.ins_h=Gr(e,e.ins_h,e.window[t+V-1]);else{let r=e.window,i=r[t]|r[t+1]<<8|r[t+2]<<16|r[t+3]<<24;n=e.ins_h=Math.imul(i,66521)+66521>>>16&e.hash_mask}let r=e.prev[t&e.w_mask]=e.head[n];return e.head[n]=t,r},q=e=>{let t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))},J=(e,t)=>{wr(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,q(e.strm)},Y=(e,t)=>{e.pending_buf[e.pending++]=t},qr=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255},Jr=(e,t,n,r)=>{let i=e.avail_in;return i>r&&(i=r),i===0?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),n),e.state.wrap===1?e.adler=Tr(e.adler,t,i,n):e.state.wrap===2&&(e.adler=B(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)},Yr=(e,t)=>{let n=e.max_chain_length,r=e.strstart,i,a,o=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-H?e.strstart-(e.w_size-H):0,l=e.window,u=e.w_mask,d=e.prev,f=e.strstart+Ar,p=l[r+o-1],m=l[r+o];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do if(i=t,l[i+o]===m&&l[i+o-1]===p&&l[i]===l[r]&&l[++i]===l[r+1]){r+=2,i++;do;while(l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&r<f);if(a=Ar-(f-r),r=f-Ar,a>o){if(e.match_start=t,o=a,a>=s)break;p=l[r+o-1],m=l[r+o]}}while((t=d[t&u])>c&&--n!==0);return o<=e.lookahead?o:e.lookahead},Xr=e=>{let t=e.w_size,n,r,i;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-H)&&(e.window.set(e.window.subarray(t,t+t-r),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),Wr(e),r+=t),e.strm.avail_in===0)break;if(n=Jr(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=n,!e.legacy_hash){if(e.lookahead+e.insert>V)for(i=e.strstart-e.insert;e.insert&&(Kr(e,i),i++,e.insert--,!(e.lookahead+e.insert<=V)););}else if(e.lookahead+e.insert>=V)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=Gr(e,e.ins_h,e.window[i+1]);e.insert&&(Kr(e,i),i++,e.insert--,!(e.lookahead+e.insert<V)););}while(e.lookahead<H&&e.strm.avail_in!==0)},Zr=(e,t)=>{let n=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,r,i,a,o=0,s=e.strm.avail_in;do{if(r=65535,a=e.bi_valid+42>>3,e.strm.avail_out<a||(a=e.strm.avail_out-a,i=e.strstart-e.block_start,r>i+e.strm.avail_in&&(r=i+e.strm.avail_in),r>a&&(r=a),r<n&&(r===0&&t!==4||t===0||r!==i+e.strm.avail_in)))break;o=+(t===4&&r===i+e.strm.avail_in),Sr(e,0,0,o),e.pending_buf[e.pending-4]=r,e.pending_buf[e.pending-3]=r>>8,e.pending_buf[e.pending-2]=~r,e.pending_buf[e.pending-1]=~r>>8,q(e.strm),i&&(i>r&&(i=r),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+i),e.strm.next_out),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i,e.block_start+=i,r-=i),r&&(Jr(e.strm,e.strm.output,e.strm.next_out,r),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r)}while(o===0);return s-=e.strm.avail_in,s&&(s>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=s&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-s,e.strm.next_in),e.strstart),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),o?Vr:t!==0&&t!==4&&e.strm.avail_in===0&&e.strstart===e.block_start?zr:(a=e.window_size-e.strstart,e.strm.avail_in>a&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,a+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),a>e.strm.avail_in&&(a=e.strm.avail_in),a&&(Jr(e.strm,e.window,e.strstart,a),e.strstart+=a,e.insert+=a>e.w_size-e.insert?e.w_size-e.insert:a),e.high_water<e.strstart&&(e.high_water=e.strstart),a=e.bi_valid+42>>3,a=e.pending_buf_size-a>65535?65535:e.pending_buf_size-a,n=a>e.w_size?e.w_size:a,i=e.strstart-e.block_start,(i>=n||(i||t===4)&&t!==0&&e.strm.avail_in===0&&i<=a)&&(r=i>a?a:i,o=+(t===4&&e.strm.avail_in===0&&r===i),Sr(e,e.block_start,r,o),e.block_start+=r,q(e.strm)),o?Br:W)},Qr=(e,t)=>{let n,r;for(;;){if(e.lookahead<H){if(Xr(e),e.lookahead<H&&t===0)return W;if(e.lookahead===0)break}if(n=0,e.lookahead>=V&&(n=Kr(e,e.strstart)),n!==0&&e.strstart-n<=e.w_size-H&&(e.match_length=Yr(e,n)),e.match_length>=V){if(r=z(e,e.strstart-e.match_start,e.match_length-V),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=V){e.match_length--;do e.strstart++,n=Kr(e,e.strstart);while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.legacy_hash&&(e.ins_h=e.window[e.strstart],e.ins_h=Gr(e,e.ins_h,e.window[e.strstart+1]))}else r=z(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(J(e,!1),e.strm.avail_out===0))return W}return e.insert=e.strstart<V-1?e.strstart:V-1,t===4?(J(e,!0),e.strm.avail_out===0?Br:Vr):e.sym_next&&(J(e,!1),e.strm.avail_out===0)?W:zr},$r=(e,t)=>{let n,r,i;for(;;){if(e.lookahead<H){if(Xr(e),e.lookahead<H&&t===0)return W;if(e.lookahead===0)break}if(n=0,e.lookahead>=V&&(n=Kr(e,e.strstart)),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=V-1,n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-H&&(e.match_length=Yr(e,n),e.match_length<=5&&(e.strategy===1||e.match_length===V&&e.strstart-e.match_start>4096)&&(e.match_length=V-1)),e.prev_length>=V&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-V,r=z(e,e.strstart-1-e.prev_match,e.prev_length-V),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(n=Kr(e,e.strstart));while(--e.prev_length!==0);if(e.match_available=0,e.match_length=V-1,e.strstart++,r&&(J(e,!1),e.strm.avail_out===0))return W}else if(e.match_available){if(r=z(e,0,e.window[e.strstart-1]),r&&J(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return W}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&=(r=z(e,0,e.window[e.strstart-1]),0),e.insert=e.strstart<V-1?e.strstart:V-1,t===4?(J(e,!0),e.strm.avail_out===0?Br:Vr):e.sym_next&&(J(e,!1),e.strm.avail_out===0)?W:zr},ei=(e,t)=>{let n,r,i,a,o=e.window;for(;;){if(e.lookahead<=Ar){if(Xr(e),e.lookahead<=Ar&&t===0)return W;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=V&&e.strstart>0&&(i=e.strstart-1,r=o[i],r===o[++i]&&r===o[++i]&&r===o[++i])){a=e.strstart+Ar;do;while(r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&i<a);e.match_length=Ar-(a-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=V?(n=z(e,1,e.match_length-V),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=z(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(J(e,!1),e.strm.avail_out===0))return W}return e.insert=0,t===4?(J(e,!0),e.strm.avail_out===0?Br:Vr):e.sym_next&&(J(e,!1),e.strm.avail_out===0)?W:zr},ti=(e,t)=>{let n;for(;;){if(e.lookahead===0&&(Xr(e),e.lookahead===0)){if(t===0)return W;break}if(e.match_length=0,n=z(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(J(e,!1),e.strm.avail_out===0))return W}return e.insert=0,t===4?(J(e,!0),e.strm.avail_out===0?Br:Vr):e.sym_next&&(J(e,!1),e.strm.avail_out===0)?W:zr},X=class{constructor(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}},ni=[new X(0,0,0,0,Zr),new X(4,4,8,4,Qr),new X(4,5,16,8,Qr),new X(4,6,32,32,Qr),new X(4,4,16,16,$r),new X(8,16,32,32,$r),new X(8,16,128,128,$r),new X(8,32,128,256,$r),new X(32,128,258,1024,$r),new X(32,258,258,4096,$r)],ri=e=>{e.window_size=2*e.w_size,K(e.head),e.max_lazy_match=ni[e.level].max_lazy,e.good_match=ni[e.level].good_length,e.nice_match=ni[e.level].nice_length,e.max_chain_length=ni[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=V-1,e.match_available=0,e.ins_h=0},ii=class{constructor(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.legacy_hash=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(kr*2),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),K(this.dyn_ltree),K(this.dyn_dtree),K(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),K(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),K(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}},ai=e=>{if(!e)return 1;let t=e.state;return+(!t||t.strm!==e||t.status!==Mr&&t.status!==Nr&&t.status!==Pr&&t.status!==Fr&&t.status!==Ir&&t.status!==Lr&&t.status!==U&&t.status!==Rr)},oi=e=>{if(ai(e))return G(e,-2);e.total_in=e.total_out=0,e.data_type=2;let t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?Nr:t.wrap?Mr:U,e.adler=t.wrap===2?0:1,t.last_flush=-2,xr(t),0},si=e=>{let t=oi(e);return t===0&&ri(e.state),t},ci=(e,t,n,r,i,a,o)=>{if(!e)return-2;let s=1;if(t===-1&&(t=6),r<0?(s=0,r=-r):r>15&&(s=2,r-=16),i<1||i>Or||n!==8||r<8||r>15||t<0||t>9||a<0||a>4||r===8&&s!==1)return G(e,-2);r===8&&(r=9);let c=new ii;return e.state=c,c.strm=e,c.status=Mr,c.wrap=s,c.gzhead=null,c.w_bits=r,c.w_size=1<<c.w_bits,c.w_mask=c.w_size-1,c.legacy_hash=+!!o,c.hash_bits=i+7,!c.legacy_hash&&c.hash_bits<15&&(c.hash_bits=15),c.hash_size=1<<c.hash_bits,c.hash_mask=c.hash_size-1,c.hash_shift=~~((c.hash_bits+V-1)/V),c.window=new Uint8Array(c.w_size*2),c.head=new Uint16Array(c.hash_size),c.prev=new Uint16Array(c.w_size),c.lit_bufsize=1<<i+6,c.pending_buf_size=c.lit_bufsize*4,c.pending_buf=new Uint8Array(c.pending_buf_size),c.sym_buf=c.lit_bufsize,c.sym_end=(c.lit_bufsize-1)*3,c.level=t,c.strategy=a,c.method=n,si(e)},li=(e,t)=>{if(ai(e)||t>5||t<0)return e?G(e,-2):-2;let n=e.state;if(!e.output||e.avail_in!==0&&!e.input||n.status===Rr&&t!==4)return G(e,e.avail_out===0?-5:-2);let r=n.last_flush;if(n.last_flush=t,n.pending!==0){if(q(e),e.avail_out===0)return n.last_flush=-1,0}else if(e.avail_in===0&&Ur(t)<=Ur(r)&&t!==4)return G(e,-5);if(n.status===Rr&&e.avail_in!==0)return G(e,-5);if(n.status===Mr&&n.wrap===0&&(n.status=U),n.status===Mr){let t=8+(n.w_bits-8<<4)<<8,r=-1;if(r=n.strategy>=2||n.level<2?0:n.level<6?1:n.level===6?2:3,t|=r<<6,n.strstart!==0&&(t|=jr),t+=31-t%31,qr(n,t),n.strstart!==0&&(qr(n,e.adler>>>16),qr(n,e.adler&65535)),e.adler=1,n.status=U,q(e),n.pending!==0)return n.last_flush=-1,0}if(n.status===Nr){if(e.adler=0,Y(n,31),Y(n,139),Y(n,8),n.gzhead)Y(n,+!!n.gzhead.text+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),Y(n,n.gzhead.time&255),Y(n,n.gzhead.time>>8&255),Y(n,n.gzhead.time>>16&255),Y(n,n.gzhead.time>>24&255),Y(n,n.level===9?2:n.strategy>=2||n.level<2?4:0),Y(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(Y(n,n.gzhead.extra.length&255),Y(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=B(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=Pr;else if(Y(n,0),Y(n,0),Y(n,0),Y(n,0),Y(n,0),Y(n,n.level===9?2:n.strategy>=2||n.level<2?4:0),Y(n,Hr),n.status=U,q(e),n.pending!==0)return n.last_flush=-1,0}if(n.status===Pr){if(n.gzhead.extra){let t=n.pending,r=(n.gzhead.extra.length&65535)-n.gzindex;for(;n.pending+r>n.pending_buf_size;){let i=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+i),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>t&&(e.adler=B(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex+=i,q(e),n.pending!==0)return n.last_flush=-1,0;t=0,r-=i}let i=new Uint8Array(n.gzhead.extra);n.pending_buf.set(i.subarray(n.gzindex,n.gzindex+r),n.pending),n.pending+=r,n.gzhead.hcrc&&n.pending>t&&(e.adler=B(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex=0}n.status=Fr}if(n.status===Fr){if(n.gzhead.name){let t=n.pending,r;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>t&&(e.adler=B(e.adler,n.pending_buf,n.pending-t,t)),q(e),n.pending!==0)return n.last_flush=-1,0;t=0}r=n.gzindex<n.gzhead.name.length?n.gzhead.name.charCodeAt(n.gzindex++)&255:0,Y(n,r)}while(r!==0);n.gzhead.hcrc&&n.pending>t&&(e.adler=B(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex=0}n.status=Ir}if(n.status===Ir){if(n.gzhead.comment){let t=n.pending,r;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>t&&(e.adler=B(e.adler,n.pending_buf,n.pending-t,t)),q(e),n.pending!==0)return n.last_flush=-1,0;t=0}r=n.gzindex<n.gzhead.comment.length?n.gzhead.comment.charCodeAt(n.gzindex++)&255:0,Y(n,r)}while(r!==0);n.gzhead.hcrc&&n.pending>t&&(e.adler=B(e.adler,n.pending_buf,n.pending-t,t))}n.status=Lr}if(n.status===Lr){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(q(e),n.pending!==0))return n.last_flush=-1,0;Y(n,e.adler&255),Y(n,e.adler>>8&255),e.adler=0}if(n.status=U,q(e),n.pending!==0)return n.last_flush=-1,0}if(e.avail_in!==0||n.lookahead!==0||t!==0&&n.status!==Rr){let r=n.level===0?Zr(n,t):n.strategy===2?ti(n,t):n.strategy===3?ei(n,t):ni[n.level].func(n,t);if((r===Br||r===Vr)&&(n.status=Rr),r===W||r===Br)return e.avail_out===0&&(n.last_flush=-1),0;if(r===zr&&(t===1?Cr(n):t!==5&&(Sr(n,0,0,!1),t===3&&(K(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),q(e),e.avail_out===0))return n.last_flush=-1,0}return t===4?n.wrap<=0?1:(n.wrap===2?(Y(n,e.adler&255),Y(n,e.adler>>8&255),Y(n,e.adler>>16&255),Y(n,e.adler>>24&255),Y(n,e.total_in&255),Y(n,e.total_in>>8&255),Y(n,e.total_in>>16&255),Y(n,e.total_in>>24&255)):(qr(n,e.adler>>>16),qr(n,e.adler&65535)),q(e),n.wrap>0&&(n.wrap=-n.wrap),+(n.pending===0)):0},ui=e=>{if(ai(e))return-2;let t=e.state.status;return e.state=null,t===U?G(e,-3):0},di=(e,t)=>{let n=t.length;if(ai(e))return-2;let r=e.state,i=r.wrap;if(i===2||i===1&&r.status!==Mr||r.lookahead)return-2;if(i===1&&(e.adler=Tr(e.adler,t,n,0)),r.wrap=0,n>=r.w_size){i===0&&(K(r.head),r.strstart=0,r.block_start=0,r.insert=0);let e=new Uint8Array(r.w_size);e.set(t.subarray(n-r.w_size,n),0),t=e,n=r.w_size}let a=e.avail_in,o=e.next_in,s=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,Xr(r);r.lookahead>=V;){let e=r.strstart,t=r.lookahead-(V-1);do Kr(r,e),e++;while(--t);r.strstart=e,r.lookahead=V-1,Xr(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=V-1,r.match_available=0,e.next_in=o,e.input=s,e.avail_in=a,r.wrap=i,0},fi=16209,pi=16191;function mi(e,t){let n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E=e.state;n=e.next_in,w=e.input,r=n+(e.avail_in-5),i=e.next_out,T=e.output,a=i-(t-e.avail_out),o=i+(e.avail_out-257),s=E.dmax,c=E.wsize,l=E.whave,u=E.wnext,d=E.window,f=E.hold,p=E.bits,m=E.lencode,h=E.distcode,g=(1<<E.lenbits)-1,_=(1<<E.distbits)-1;top:do{p<15&&(f+=w[n++]<<p,p+=8,f+=w[n++]<<p,p+=8),v=m[f&g];dolen:for(;;){if(y=v>>>24,f>>>=y,p-=y,y=v>>>16&255,y===0)T[i++]=v&65535;else if(y&16){b=v&65535,y&=15,y&&(p<y&&(f+=w[n++]<<p,p+=8),b+=f&(1<<y)-1,f>>>=y,p-=y),p<15&&(f+=w[n++]<<p,p+=8,f+=w[n++]<<p,p+=8),v=h[f&_];dodist:for(;;){if(y=v>>>24,f>>>=y,p-=y,y=v>>>16&255,y&16){if(x=v&65535,y&=15,p<y&&(f+=w[n++]<<p,p+=8,p<y&&(f+=w[n++]<<p,p+=8)),x+=f&(1<<y)-1,x>s){e.msg=`invalid distance too far back`,E.mode=fi;break top}if(f>>>=y,p-=y,y=i-a,x>y){if(y=x-y,y>l&&E.sane){e.msg=`invalid distance too far back`,E.mode=fi;break top}if(S=0,C=d,u===0){if(S+=c-y,y<b){b-=y;do T[i++]=d[S++];while(--y);S=i-x,C=T}}else if(u<y){if(S+=c+u-y,y-=u,y<b){b-=y;do T[i++]=d[S++];while(--y);if(S=0,u<b){y=u,b-=y;do T[i++]=d[S++];while(--y);S=i-x,C=T}}}else if(S+=u-y,y<b){b-=y;do T[i++]=d[S++];while(--y);S=i-x,C=T}for(;b>2;)T[i++]=C[S++],T[i++]=C[S++],T[i++]=C[S++],b-=3;b&&(T[i++]=C[S++],b>1&&(T[i++]=C[S++]))}else{S=i-x;do T[i++]=T[S++],T[i++]=T[S++],T[i++]=T[S++],b-=3;while(b>2);b&&(T[i++]=T[S++],b>1&&(T[i++]=T[S++]))}}else if(y&64){e.msg=`invalid distance code`,E.mode=fi;break top}else{v=h[(v&65535)+(f&(1<<y)-1)];continue dodist}break}}else if(!(y&64)){v=m[(v&65535)+(f&(1<<y)-1)];continue dolen}else if(y&32){E.mode=pi;break top}else{e.msg=`invalid literal/length code`,E.mode=fi;break top}break}}while(n<r&&i<o);b=p>>3,n-=b,p-=b<<3,f&=(1<<p)-1,e.next_in=n,e.next_out=i,e.avail_in=n<r?5+(r-n):5-(n-r),e.avail_out=i<o?257+(o-i):257-(i-o),E.hold=f,E.bits=p}var hi=15,gi=852,_i=592,vi=0,yi=1,bi=2,xi=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),Si=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,199,75]),Ci=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),wi=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),Ti=(e,t,n,r,i,a,o,s)=>{let c=s.bits,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0,y,b,x,S,C,w=null,T,E=new Uint16Array(16),D=new Uint16Array(16),O=null,k,A,ee;for(l=0;l<=hi;l++)E[l]=0;for(u=0;u<r;u++)E[t[n+u]]++;for(p=c,f=hi;f>=1&&E[f]===0;f--);if(p>f&&(p=f),f===0)return i[a++]=20971520,i[a++]=20971520,s.bits=1,0;for(d=1;d<f&&E[d]===0;d++);for(p<d&&(p=d),g=1,l=1;l<=hi;l++)if(g<<=1,g-=E[l],g<0)return-1;if(g>0&&(e===vi||f!==1))return-1;for(D[1]=0,l=1;l<hi;l++)D[l+1]=D[l]+E[l];for(u=0;u<r;u++)t[n+u]!==0&&(o[D[t[n+u]]++]=u);if(e===vi?(w=O=o,T=20):e===yi?(w=xi,O=Si,T=257):(w=Ci,O=wi,T=0),v=0,u=0,l=d,C=a,m=p,h=0,x=-1,_=1<<p,S=_-1,e===yi&&_>gi||e===bi&&_>_i)return 1;for(;;){k=l-h,o[u]+1<T?(A=0,ee=o[u]):o[u]>=T?(A=O[o[u]-T],ee=w[o[u]-T]):(A=96,ee=0),y=1<<l-h,b=1<<m,d=b;do b-=y,i[C+(v>>h)+b]=k<<24|A<<16|ee|0;while(b!==0);for(y=1<<l-1;v&y;)y>>=1;if(y===0?v=0:(v&=y-1,v+=y),u++,--E[l]===0){if(l===f)break;l=t[n+o[u]]}if(l>p&&(v&S)!==x){for(h===0&&(h=p),C+=d,m=l-h,g=1<<m;m+h<f&&(g-=E[m+h],!(g<=0));)m++,g<<=1;if(_+=1<<m,e===yi&&_>gi||e===bi&&_>_i)return 1;x=v&S,i[x]=p<<24|m<<16|C-a|0}}return v!==0&&(i[C+v]=l-h<<24|4194304),s.bits=p,0},Ei=0,Di=1,Oi=2,ki=16180,Ai=16181,ji=16182,Mi=16183,Ni=16184,Pi=16185,Fi=16186,Ii=16187,Li=16188,Ri=16189,zi=16190,Z=16191,Bi=16192,Vi=16193,Hi=16194,Ui=16195,Wi=16196,Gi=16197,Ki=16198,qi=16199,Ji=16200,Yi=16201,Xi=16202,Zi=16203,Qi=16204,$i=16205,ea=16206,ta=16207,na=16208,Q=16209,ra=16210,ia=16211,aa=852,oa=592,sa=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24),ca=class{constructor(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}},la=e=>{if(!e)return 1;let t=e.state;return+(!t||t.strm!==e||t.mode<ki||t.mode>ia)},ua=e=>{if(la(e))return-2;let t=e.state;return e.total_in=e.total_out=t.total=0,e.msg=``,t.wrap&&(e.adler=t.wrap&1),t.mode=ki,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(aa),t.distcode=t.distdyn=new Int32Array(oa),t.sane=1,t.back=-1,0},da=e=>{if(la(e))return-2;let t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,ua(e)},fa=(e,t)=>{let n;if(la(e))return-2;let r=e.state;return t<0?(n=0,t=-t):(n=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?-2:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,da(e))},pa=(e,t)=>{if(!e)return-2;let n=new ca;e.state=n,n.strm=e,n.window=null,n.mode=ki;let r=fa(e,t);return r!==0&&(e.state=null),r},ma=!0,ha,ga,_a=e=>{if(ma){ha=new Int32Array(512),ga=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(Ti(Di,e.lens,0,288,ha,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Ti(Oi,e.lens,0,32,ga,0,e.work,{bits:5}),ma=!1}e.lencode=ha,e.lenbits=9,e.distcode=ga,e.distbits=5},va=(e,t,n,r)=>{let i,a=e.state;return a.window===null&&(a.window=new Uint8Array(1<<a.wbits)),a.wsize===0&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0),r>=a.wsize?(a.window.set(t.subarray(n-a.wsize,n),0),a.wnext=0,a.whave=a.wsize):(i=a.wsize-a.wnext,i>r&&(i=r),a.window.set(t.subarray(n-r,n-r+i),a.wnext),r-=i,r?(a.window.set(t.subarray(n-r,n),0),a.wnext=r,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=i))),0},ya=(e,t)=>{let n,r,i,a,o,s,c,l,u,d,f,p,m,h,g=0,_,v,y,b,x,S,C,w,T=new Uint8Array(4),E,D,O=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(la(e)||!e.output||!e.input&&e.avail_in!==0)return-2;n=e.state,n.mode===Z&&(n.mode=Bi),o=e.next_out,i=e.output,c=e.avail_out,a=e.next_in,r=e.input,s=e.avail_in,l=n.hold,u=n.bits,d=s,f=c,w=0;inf_leave:for(;;)switch(n.mode){case ki:if(n.wrap===0){n.mode=Bi;break}for(;u<16;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(n.wrap&2&&l===35615){n.wbits===0&&(n.wbits=15),n.check=0,T[0]=l&255,T[1]=l>>>8&255,n.check=B(n.check,T,2,0),l=0,u=0,n.mode=Ai;break}if(n.head&&(n.head.done=!1),!(n.wrap&1)||(((l&255)<<8)+(l>>8))%31){e.msg=`incorrect header check`,n.mode=Q;break}if((l&15)!=8){e.msg=`unknown compression method`,n.mode=Q;break}if(l>>>=4,u-=4,C=(l&15)+8,n.wbits===0&&(n.wbits=C),C>15||C>n.wbits){e.msg=`invalid window size`,n.mode=Q;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=l&512?Ri:Z,l=0,u=0;break;case Ai:for(;u<16;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(n.flags=l,(n.flags&255)!=8){e.msg=`unknown compression method`,n.mode=Q;break}if(n.flags&57344){e.msg=`unknown header flags set`,n.mode=Q;break}n.head&&(n.head.text=l>>8&1),n.flags&512&&n.wrap&4&&(T[0]=l&255,T[1]=l>>>8&255,n.check=B(n.check,T,2,0)),l=0,u=0,n.mode=ji;case ji:for(;u<32;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.head&&(n.head.time=l),n.flags&512&&n.wrap&4&&(T[0]=l&255,T[1]=l>>>8&255,T[2]=l>>>16&255,T[3]=l>>>24&255,n.check=B(n.check,T,4,0)),l=0,u=0,n.mode=Mi;case Mi:for(;u<16;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.head&&(n.head.xflags=l&255,n.head.os=l>>8),n.flags&512&&n.wrap&4&&(T[0]=l&255,T[1]=l>>>8&255,n.check=B(n.check,T,2,0)),l=0,u=0,n.mode=Ni;case Ni:if(n.flags&1024){for(;u<16;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.length=l,n.head&&(n.head.extra_len=l),n.flags&512&&n.wrap&4&&(T[0]=l&255,T[1]=l>>>8&255,n.check=B(n.check,T,2,0)),l=0,u=0}else n.head&&(n.head.extra=null);n.mode=Pi;case Pi:if(n.flags&1024&&(p=n.length,p>s&&(p=s),p&&(n.head&&(C=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(a,a+p),C)),n.flags&512&&n.wrap&4&&(n.check=B(n.check,r,p,a)),s-=p,a+=p,n.length-=p),n.length))break inf_leave;n.length=0,n.mode=Fi;case Fi:if(n.flags&2048){if(s===0)break inf_leave;p=0;do C=r[a+p++],n.head&&C&&n.length<65536&&(n.head.name+=String.fromCharCode(C));while(C&&p<s);if(n.flags&512&&n.wrap&4&&(n.check=B(n.check,r,p,a)),s-=p,a+=p,C)break inf_leave}else n.head&&(n.head.name=null);n.length=0,n.mode=Ii;case Ii:if(n.flags&4096){if(s===0)break inf_leave;p=0;do C=r[a+p++],n.head&&C&&n.length<65536&&(n.head.comment+=String.fromCharCode(C));while(C&&p<s);if(n.flags&512&&n.wrap&4&&(n.check=B(n.check,r,p,a)),s-=p,a+=p,C)break inf_leave}else n.head&&(n.head.comment=null);n.mode=Li;case Li:if(n.flags&512){for(;u<16;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(n.wrap&4&&l!==(n.check&65535)){e.msg=`header crc mismatch`,n.mode=Q;break}l=0,u=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=Z;break;case Ri:for(;u<32;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}e.adler=n.check=sa(l),l=0,u=0,n.mode=zi;case zi:if(n.havedict===0)return e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,n.hold=l,n.bits=u,2;e.adler=n.check=1,n.mode=Z;case Z:if(t===5||t===6)break inf_leave;case Bi:if(n.last){l>>>=u&7,u-=u&7,n.mode=ea;break}for(;u<3;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}switch(n.last=l&1,l>>>=1,--u,l&3){case 0:n.mode=Vi;break;case 1:if(_a(n),n.mode=qi,t===6){l>>>=2,u-=2;break inf_leave}break;case 2:n.mode=Wi;break;case 3:e.msg=`invalid block type`,n.mode=Q}l>>>=2,u-=2;break;case Vi:for(l>>>=u&7,u-=u&7;u<32;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if((l&65535)!=(l>>>16^65535)){e.msg=`invalid stored block lengths`,n.mode=Q;break}if(n.length=l&65535,l=0,u=0,n.mode=Hi,t===6)break inf_leave;case Hi:n.mode=Ui;case Ui:if(p=n.length,p){if(p>s&&(p=s),p>c&&(p=c),p===0)break inf_leave;i.set(r.subarray(a,a+p),o),s-=p,a+=p,c-=p,o+=p,n.length-=p;break}n.mode=Z;break;case Wi:for(;u<14;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(n.nlen=(l&31)+257,l>>>=5,u-=5,n.ndist=(l&31)+1,l>>>=5,u-=5,n.ncode=(l&15)+4,l>>>=4,u-=4,n.nlen>286||n.ndist>30){e.msg=`too many length or distance symbols`,n.mode=Q;break}n.have=0,n.mode=Gi;case Gi:for(;n.have<n.ncode;){for(;u<3;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.lens[O[n.have++]]=l&7,l>>>=3,u-=3}for(;n.have<19;)n.lens[O[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,E={bits:n.lenbits},w=Ti(Ei,n.lens,0,19,n.lencode,0,n.work,E),n.lenbits=E.bits,w){e.msg=`invalid code lengths set`,n.mode=Q;break}n.have=0,n.mode=Ki;case Ki:for(;n.have<n.nlen+n.ndist;){for(;g=n.lencode[l&(1<<n.lenbits)-1],_=g>>>24,v=g>>>16&255,y=g&65535,!(_<=u);){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(y<16)l>>>=_,u-=_,n.lens[n.have++]=y;else{if(y===16){for(D=_+2;u<D;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(l>>>=_,u-=_,n.have===0){e.msg=`invalid bit length repeat`,n.mode=Q;break}C=n.lens[n.have-1],p=3+(l&3),l>>>=2,u-=2}else if(y===17){for(D=_+3;u<D;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}l>>>=_,u-=_,C=0,p=3+(l&7),l>>>=3,u-=3}else{for(D=_+7;u<D;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}l>>>=_,u-=_,C=0,p=11+(l&127),l>>>=7,u-=7}if(n.have+p>n.nlen+n.ndist){e.msg=`invalid bit length repeat`,n.mode=Q;break}for(;p--;)n.lens[n.have++]=C}}if(n.mode===Q)break;if(n.lens[256]===0){e.msg=`invalid code -- missing end-of-block`,n.mode=Q;break}if(n.lenbits=9,E={bits:n.lenbits},w=Ti(Di,n.lens,0,n.nlen,n.lencode,0,n.work,E),n.lenbits=E.bits,w){e.msg=`invalid literal/lengths set`,n.mode=Q;break}if(n.distbits=6,n.distcode=n.distdyn,E={bits:n.distbits},w=Ti(Oi,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,E),n.distbits=E.bits,w){e.msg=`invalid distances set`,n.mode=Q;break}if(n.mode=qi,t===6)break inf_leave;case qi:n.mode=Ji;case Ji:if(s>=6&&c>=258){e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,n.hold=l,n.bits=u,mi(e,f),o=e.next_out,i=e.output,c=e.avail_out,a=e.next_in,r=e.input,s=e.avail_in,l=n.hold,u=n.bits,n.mode===Z&&(n.back=-1);break}for(n.back=0;g=n.lencode[l&(1<<n.lenbits)-1],_=g>>>24,v=g>>>16&255,y=g&65535,!(_<=u);){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(v&&!(v&240)){for(b=_,x=v,S=y;g=n.lencode[S+((l&(1<<b+x)-1)>>b)],_=g>>>24,v=g>>>16&255,y=g&65535,!(b+_<=u);){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}l>>>=b,u-=b,n.back+=b}if(l>>>=_,u-=_,n.back+=_,n.length=y,v===0){n.mode=$i;break}if(v&32){n.back=-1,n.mode=Z;break}if(v&64){e.msg=`invalid literal/length code`,n.mode=Q;break}n.extra=v&15,n.mode=Yi;case Yi:if(n.extra){for(D=n.extra;u<D;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.length+=l&(1<<n.extra)-1,l>>>=n.extra,u-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=Xi;case Xi:for(;g=n.distcode[l&(1<<n.distbits)-1],_=g>>>24,v=g>>>16&255,y=g&65535,!(_<=u);){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(!(v&240)){for(b=_,x=v,S=y;g=n.distcode[S+((l&(1<<b+x)-1)>>b)],_=g>>>24,v=g>>>16&255,y=g&65535,!(b+_<=u);){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}l>>>=b,u-=b,n.back+=b}if(l>>>=_,u-=_,n.back+=_,v&64){e.msg=`invalid distance code`,n.mode=Q;break}n.offset=y,n.extra=v&15,n.mode=Zi;case Zi:if(n.extra){for(D=n.extra;u<D;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.offset+=l&(1<<n.extra)-1,l>>>=n.extra,u-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg=`invalid distance too far back`,n.mode=Q;break}n.mode=Qi;case Qi:if(c===0)break inf_leave;if(p=f-c,n.offset>p){if(p=n.offset-p,p>n.whave&&n.sane){e.msg=`invalid distance too far back`,n.mode=Q;break}p>n.wnext?(p-=n.wnext,m=n.wsize-p):m=n.wnext-p,p>n.length&&(p=n.length),h=n.window}else h=i,m=o-n.offset,p=n.length;p>c&&(p=c),c-=p,n.length-=p;do i[o++]=h[m++];while(--p);n.length===0&&(n.mode=Ji);break;case $i:if(c===0)break inf_leave;i[o++]=n.length,c--,n.mode=Ji;break;case ea:if(n.wrap){for(;u<32;){if(s===0)break inf_leave;s--,l|=r[a++]<<u,u+=8}if(f-=c,e.total_out+=f,n.total+=f,n.wrap&4&&f&&(e.adler=n.check=n.flags?B(n.check,i,f,o-f):Tr(n.check,i,f,o-f)),f=c,n.wrap&4&&(n.flags?l:sa(l))!==n.check){e.msg=`incorrect data check`,n.mode=Q;break}l=0,u=0}n.mode=ta;case ta:if(n.wrap&&n.flags){for(;u<32;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(n.wrap&4&&l!==(n.total&4294967295)){e.msg=`incorrect length check`,n.mode=Q;break}l=0,u=0}n.mode=na;case na:w=1;break inf_leave;case Q:w=-3;break inf_leave;case ra:return-4;case ia:default:return-2}return e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,n.hold=l,n.bits=u,(n.wsize||f!==e.avail_out&&n.mode<Q&&(n.mode<ea||t!==4))&&va(e,e.output,e.next_out,f-e.avail_out)?(n.mode=ra,-4):(d-=e.avail_in,f-=e.avail_out,e.total_in+=d,e.total_out+=f,n.total+=f,n.wrap&4&&f&&(e.adler=n.check=n.flags?B(n.check,i,f,e.next_out-f):Tr(n.check,i,f,e.next_out-f)),e.data_type=n.bits+(n.last?64:0)+(n.mode===Z?128:0)+(n.mode===qi||n.mode===Hi?256:0),(d===0&&f===0||t===4)&&w===0&&(w=-5),w)},ba=e=>{if(la(e))return-2;let t=e.state;return t.window&&=null,e.state=null,0},xa=(e,t)=>{let n=t.length,r,i,a;return la(e)||(r=e.state,r.wrap!==0&&r.mode!==zi)?-2:r.mode===zi&&(i=1,i=Tr(i,t,n,0),i!==r.check)?-3:(a=va(e,t,n,n),a?(r.mode=ra,-4):(r.havedict=1,0))},Sa=class{constructor(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=``,this.state=null,this.data_type=2,this.adler=0}},Ca=e=>{let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),n=0;for(let r of e)t.set(r,n),n+=r.length;return t},wa=Object.prototype.toString,Ta={level:-1,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,raw:!1,gzip:!1,legacyHash:!1,dictionary:new Uint8Array},Ea=class{options;err;msg;ended;started;chunks;strm;result;constructor(e={}){this.options=Object.assign({},Ta,e);let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg=``,this.ended=!1,this.started=!1,this.chunks=[],this.result=new Uint8Array,this.strm=new Sa,this.strm.avail_out=0;let n=ci(this.strm,t.level,8,t.windowBits,t.memLevel,t.strategy,t.legacyHash);if(n!==0)throw Error(Dr[n]);wa.call(t.dictionary)===`[object ArrayBuffer]`&&(t.dictionary=new Uint8Array(t.dictionary));let r=t.dictionary;if(r.length){if(t.gzip)throw Error(`dictionary is not supported with gzip`);if(n=di(this.strm,r),n!==0)throw Error(Dr[n])}}push(e,t=!1){let n=this.strm,r=this.options.chunkSize,i,a;if(this.ended)return!1;for(a=typeof t==`number`?t:t===!0?4:0,n.input=typeof e==`string`?new TextEncoder().encode(e):wa.call(e)===`[object ArrayBuffer]`?new Uint8Array(e):e,n.next_in=0,n.avail_in=n.input.length,this.started||(this.started=!0,this.onStart(n));;){if(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),(a===2||a===3)&&n.avail_out<=6){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(i=li(n,a),i===-2)break;if(i===1){n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),i=ui(this.strm);break}if(n.avail_out===0){this.onData(n.output);continue}if(a>0&&n.next_out>0){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(n.avail_in===0)return!0}return this.err=i,this.msg=n.msg||Dr[i],this.ended=!0,this.onEnd(i),i===0}onStart(e){}onData(e){this.chunks.push(e)}onEnd(e){e===0&&(this.result=Ca(this.chunks)),this.chunks=[]}};function Da(e,t={}){let n=new Ea(t);if(n.push(e,!0),n.err)throw Error(n.msg);return n.result}function Oa(e,t={}){return Da(e,Object.assign({},t,{raw:!0}))}function ka(e,t={}){return Da(e,Object.assign({},t,{gzip:!0}))}var Aa=Object.prototype.toString,ja={chunkSize:65536,windowBits:15,raw:!1,dictionary:new Uint8Array},Ma=class{options;err;msg;ended;started;chunks;strm;result;constructor(e={}){this.options=Object.assign({},ja,e);let t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!e.windowBits&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg=``,this.ended=!1,this.started=!1,this.chunks=[],this.result=new Uint8Array,this.strm=new Sa,this.strm.avail_out=0;let n=pa(this.strm,t.windowBits);if(n!==0)throw Error(Dr[n]);Aa.call(t.dictionary)===`[object ArrayBuffer]`&&(t.dictionary=new Uint8Array(t.dictionary));let r=t.dictionary;if(t.raw&&r.length&&(n=xa(this.strm,r),n!==0))throw Error(Dr[n])}push(e,t=!1){let n=this.strm,r=this.options.chunkSize,i,a,o;if(this.ended)return this.err===0;for(a=typeof t==`number`?t:t===!0?4:0,n.input=Aa.call(e)===`[object ArrayBuffer]`?new Uint8Array(e):e,n.next_in=0,n.avail_in=n.input.length,this.started||(this.started=!0,this.onStart(n));;){if(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),i=ya(n,a),i===2){let e=this.options.dictionary;e.length&&(i=xa(n,e),i===0?i=ya(n,a):i===-3&&(i=2))}for(;n.avail_in>0&&i===1&&n.state.wrap&2&&n.state.flags!==0&&n.input[n.next_in]!==0;)da(n),i=ya(n,a);if(i===-2||i===-3||i===2||i===-4)break;if(o=n.avail_out,n.next_out&&(n.avail_out===0||i===1||a>0)&&(this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out)),n.avail_out=0,n.next_out=0),i!==0&&i!==-5||o!==0){if(i===1){i=ba(this.strm);break}if(n.avail_in===0){if(a===4){i=ba(this.strm),i===0&&(i=-5);break}return!0}}}return this.err=i,this.msg=n.msg||Dr[i],this.ended=!0,this.onEnd(i),i===0}onStart(e){}onData(e){this.chunks.push(e)}onEnd(e){e===0&&(this.result=Ca(this.chunks)),this.chunks=[]}};function Na(e,t={}){let n=new Ma(t);if(n.push(e,!0),n.err)throw Error(n.msg);let r=n.result;return t.toText?new TextDecoder().decode(r):r}function Pa(e,t={}){return Na(e,{...t,raw:!0})}function Fa(e){return typeof e==`string`?new Uint8Array(Ke(e,`utf8`)):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}function Ia(e){let t={};return e&&(typeof e.level==`number`&&(t.level=e.level),typeof e.windowBits==`number`&&(t.windowBits=e.windowBits),typeof e.memLevel==`number`&&(t.memLevel=e.memLevel),typeof e.strategy==`number`&&(t.strategy=e.strategy)),t}function La(e,t,n){return Ke(e(Fa(t),Ia(n)))}function Ra(e,t,n,r){let i=typeof n==`function`?n:r,a=typeof n==`function`?void 0:n;if(typeof i!=`function`)throw TypeError(`zlib: callback is required`);let o;try{o=La(e,t,a)}catch(e){queueMicrotask(()=>i(e instanceof Error?e:Error(String(e))));return}queueMicrotask(()=>i(null,o))}const za={gzipSync:(e,t)=>La(ka,e,t),gunzipSync:(e,t)=>La(Na,e,t),deflateSync:(e,t)=>La(Da,e,t),inflateSync:(e,t)=>La(Na,e,t),deflateRawSync:(e,t)=>La(Oa,e,t),inflateRawSync:(e,t)=>La(Pa,e,t),gzip:(e,t,n)=>Ra(ka,e,t,n),gunzip:(e,t,n)=>Ra(Na,e,t,n),deflate:(e,t,n)=>Ra(Da,e,t,n),inflate:(e,t,n)=>Ra(Na,e,t,n),deflateRaw:(e,t,n)=>Ra(Oa,e,t,n),inflateRaw:(e,t,n)=>Ra(Pa,e,t,n),constants:{Z_NO_FLUSH:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1}};function Ba(e){let t=[],n={},r=[],i=(e,t)=>{if(e in n){let r=n[e];Array.isArray(r)?r.push(String(t)):n[e]=[String(r),String(t)]}else n[e]=t},a=2;for(;a<e.length;){let n=e[a];if(n===`--`){r.push(...e.slice(a+1));break}if(n.startsWith(`--`)){let t=n.slice(2),r=t.indexOf(`=`);if(r!==-1){i(t.slice(0,r),t.slice(r+1)),a++;continue}let o=e[a+1];if(o!==void 0&&!o.startsWith(`-`)){i(t,o),a+=2;continue}i(t,!0),a++;continue}if(n.startsWith(`-`)&&n.length>1){for(let e of n.slice(1))i(e,!0);a++;continue}t.push(n),a++}return{positional:t,flags:n,subcommand:t.length>0&&/^[a-z][\w-]*$/i.test(t[0])?t[0]:null,passthrough:r}}function Va(e){let t=[...e];return Object.defineProperty(t,"parseFlags",{value:()=>Ba(t),enumerable:!1,writable:!1,configurable:!1}),t}const Ha=async(e,t,n)=>{let r=Math.max(1,Math.trunc(e)||1),i=Array(t.length),a=0,o=[],s=async()=>{for(;;){let e=a++;if(e>=t.length)return;i[e]=await n(t[e],e)}};for(let e=0;e<Math.min(r,t.length);e++)o.push(s());return await Promise.all(o),i},Ua={ms:1,s:1e3,m:6e4,h:36e5,d:864e5,w:6048e5,M:26298e5,y:315576e5};function Wa(e){if(typeof e==`number`&&Number.isFinite(e))return Math.trunc(e);if(typeof e!=`string`)throw TypeError(`time.parseDuration: spec must be string or number`);let t=e.trim(),n=/^([0-9]+(?:\.[0-9]+)?)\s*(ms|s|m|h|d|w|M|y)?$/.exec(t);if(!n)throw RangeError(`time.parseDuration: unrecognized spec "${e}"`);let r=Number(n[1]),i=n[2]??`ms`;return Math.trunc(r*Ua[i])}function Ga(e){return e<10?`0${e}`:String(e)}const Ka={parseDuration:Wa,ago(e,t=new Date){return new Date(t.getTime()-Wa(e))},range(e,t=new Date){let n=new Date(t.getTime());return{start:new Date(n.getTime()-Wa(e)),end:n}},future(e,t=new Date){let n=new Date(t.getTime());return{start:n,end:new Date(n.getTime()+Wa(e))}},gmailDate(e,t=new Date){let n=new Date(t.getTime()-Wa(e));return`${n.getFullYear()}/${Ga(n.getMonth()+1)}/${Ga(n.getDate())}`}};function qa(e){if(!e)return``;let t=e.lastIndexOf(`/`);return t<0?``:t===0?`/`:e.substring(0,t)}var Ja=class extends Error{code;constructor(e){super(`Process exited with code ${e}`),this.code=e,this.name=`NodeExitError`}};function Ya(e){let t=Number(e);return Number.isFinite(t)?t:0}function Xa(e){return typeof e==`string`?`type string ('${e}')`:typeof e==`boolean`?`type boolean (${e})`:typeof e==`bigint`?`type bigint (${e}n)`:Array.isArray(e)?`an instance of Array`:typeof e==`object`&&e?`an instance of Object`:`type ${typeof e}`}function Za(e){let t=TypeError(`The "code" argument must be of type number. Received ${Xa(e)}`);return t.code=`ERR_INVALID_ARG_TYPE`,t}function Qa(e){let t=RangeError(`The value of "code" is out of range. It must be an integer. Received ${String(e)}`);return t.code=`ERR_OUT_OF_RANGE`,t}function $a(e){if(e!=null){if(typeof e==`string`){let t=Number(e);if(e!==``&&Number.isInteger(t))return t===0?0:t;throw Za(e)}if(typeof e==`number`){if(Number.isInteger(e))return e===0?0:e;throw Qa(e)}throw Za(e)}}function eo(e){if(typeof e==`string`)return e;if(e==null)return String(e);try{return JSON.stringify(e)}catch{return String(e)}}function to(e){return`${e.map(eo).join(` `)}\n`}function no(e){return e===void 0?`default`:String(e)}function ro(){return typeof performance<`u`?performance.now():Date.now()}function io(e){return`${e.toFixed(3)}ms`}function ao(e,t,n){let r=to(n);e(t>0?`${` `.repeat(t)}${r}`:r)}function oo(e,t,n){if(t)return;if(n.length===0){e(`Assertion failed`);return}let[r,...i]=n;e(`Assertion failed: ${eo(r)}`,...i)}function so(e,t,n,r){e(r.length>0?`Trace: ${r.map(eo).join(` `)}`:`Trace:`);let i=Error().stack;if(!i)return;let a=i.split(`
|
|
24
|
+
`,cpus:()=>[{model:`virtual`,speed:0}],hostname:()=>`slicc`,type:()=>`Linux`,release:()=>`0.0.0`};function bn(e){return{...yn,tmpdir:()=>T(e),homedir:()=>e?.HOME?.trim()?e.HOME:`/home/user`}}const xn=bn(),Sn={isatty:e=>!1,ReadStream:class{},WriteStream:class{}};var Cn=4,wn=0,Tn=1,En=2;function Dn(e){let t=e.length;for(;--t>=0;)e[t]=0}var On=29,kn=256,An=286,jn=30,Mn=19,Nn=573,Pn=15,Fn=16,In=7,Ln=256,Rn=16,zn=17,Bn=18,Vn=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),Hn=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),Un=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Wn=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Gn=512,I=Array(576);Dn(I);var Kn=Array(jn*2);Dn(Kn);var qn=Array(Gn);Dn(qn);var Jn=Array(256);Dn(Jn);var Yn=Array(On);Dn(Yn);var Xn=Array(jn);Dn(Xn);var Zn=class{constructor(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}},Qn,$n,er,tr=class{constructor(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}},nr=e=>e<256?qn[e]:qn[256+(e>>>7)],rr=(e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},L=(e,t,n)=>{e.bi_valid>Fn-n?(e.bi_buf|=t<<e.bi_valid&65535,rr(e,e.bi_buf),e.bi_buf=t>>Fn-e.bi_valid,e.bi_valid+=n-Fn):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)},R=(e,t,n)=>{L(e,n[t*2],n[t*2+1])},ir=(e,t)=>{let n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1},ar=e=>{e.bi_valid===16?(rr(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},or=(e,t)=>{let n=t.dyn_tree,r=t.max_code,i=t.stat_desc.static_tree,a=t.stat_desc.has_stree,o=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,c=t.stat_desc.max_length,l,u,d,f,p,m,h=0;for(f=0;f<=Pn;f++)e.bl_count[f]=0;for(n[e.heap[e.heap_max]*2+1]=0,l=e.heap_max+1;l<Nn;l++)u=e.heap[l],f=n[n[u*2+1]*2+1]+1,f>c&&(f=c,h++),n[u*2+1]=f,!(u>r)&&(e.bl_count[f]++,p=0,u>=s&&(p=o[u-s]),m=n[u*2],e.opt_len+=m*(f+p),a&&(e.static_len+=m*(i[u*2+1]+p)));if(h!==0){do{for(f=c-1;e.bl_count[f]===0;)f--;e.bl_count[f]--,e.bl_count[f+1]+=2,e.bl_count[c]--,h-=2}while(h>0);for(f=c;f!==0;f--)for(u=e.bl_count[f];u!==0;)d=e.heap[--l],!(d>r)&&(n[d*2+1]!==f&&(e.opt_len+=(f-n[d*2+1])*n[d*2],n[d*2+1]=f),u--)}},sr=(e,t,n)=>{let r=Array(16),i=0,a,o;for(a=1;a<=Pn;a++)i=i+n[a-1]<<1,r[a]=i;for(o=0;o<=t;o++){let t=e[o*2+1];t!==0&&(e[o*2]=ir(r[t]++,t))}},cr=()=>{let e,t,n,r,i,a=Array(16);for(n=0,r=0;r<On-1;r++)for(Yn[r]=n,e=0;e<1<<Vn[r];e++)Jn[n++]=r;for(Jn[n-1]=r,i=0,r=0;r<16;r++)for(Xn[r]=i,e=0;e<1<<Hn[r];e++)qn[i++]=r;for(i>>=7;r<jn;r++)for(Xn[r]=i<<7,e=0;e<1<<Hn[r]-7;e++)qn[256+i++]=r;for(t=0;t<=Pn;t++)a[t]=0;for(e=0;e<=143;)I[e*2+1]=8,e++,a[8]++;for(;e<=255;)I[e*2+1]=9,e++,a[9]++;for(;e<=279;)I[e*2+1]=7,e++,a[7]++;for(;e<=287;)I[e*2+1]=8,e++,a[8]++;for(sr(I,287,a),e=0;e<jn;e++)Kn[e*2+1]=5,Kn[e*2]=ir(e,5);Qn=new Zn(I,Vn,257,An,Pn),$n=new Zn(Kn,Hn,0,jn,Pn),er=new Zn([],Un,0,Mn,In)},lr=e=>{let t;for(t=0;t<An;t++)e.dyn_ltree[t*2]=0;for(t=0;t<jn;t++)e.dyn_dtree[t*2]=0;for(t=0;t<Mn;t++)e.bl_tree[t*2]=0;e.dyn_ltree[Ln*2]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},ur=e=>{e.bi_valid>8?rr(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},dr=(e,t,n,r)=>{let i=t*2,a=n*2;return e[i]<e[a]||e[i]===e[a]&&r[t]<=r[n]},fr=(e,t,n)=>{let r=e.heap[n],i=n<<1;for(;i<=e.heap_len&&(i<e.heap_len&&dr(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!dr(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r},pr=(e,t,n)=>{let r,i,a=0,o,s;if(e.sym_next!==0)do r=e.pending_buf[e.sym_buf+a++]&255,r+=(e.pending_buf[e.sym_buf+a++]&255)<<8,i=e.pending_buf[e.sym_buf+a++],r===0?R(e,i,t):(o=Jn[i],R(e,o+kn+1,t),s=Vn[o],s!==0&&(i-=Yn[o],L(e,i,s)),r--,o=nr(r),R(e,o,n),s=Hn[o],s!==0&&(r-=Xn[o],L(e,r,s)));while(a<e.sym_next);R(e,Ln,t)},mr=(e,t)=>{let n=t.dyn_tree,r=t.stat_desc.static_tree,i=t.stat_desc.has_stree,a=t.stat_desc.elems,o,s,c=-1,l;for(e.heap_len=0,e.heap_max=Nn,o=0;o<a;o++)n[o*2]===0?n[o*2+1]=0:(e.heap[++e.heap_len]=c=o,e.depth[o]=0);for(;e.heap_len<2;)l=e.heap[++e.heap_len]=c<2?++c:0,n[l*2]=1,e.depth[l]=0,e.opt_len--,i&&(e.static_len-=r[l*2+1]);for(t.max_code=c,o=e.heap_len>>1;o>=1;o--)fr(e,n,o);l=a;do o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],fr(e,n,1),s=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=s,n[l*2]=n[o*2]+n[s*2],e.depth[l]=(e.depth[o]>=e.depth[s]?e.depth[o]:e.depth[s])+1,n[o*2+1]=n[s*2+1]=l,e.heap[1]=l++,fr(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],or(e,t),sr(n,c,e.bl_count)},hr=(e,t,n)=>{let r,i=-1,a,o=t[1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),t[(n+1)*2+1]=65535,r=0;r<=n;r++)a=o,o=t[(r+1)*2+1],!(++s<c&&a===o)&&(s<l?e.bl_tree[a*2]+=s:a===0?s<=10?e.bl_tree[34]++:e.bl_tree[36]++:(a!==i&&e.bl_tree[a*2]++,e.bl_tree[32]++),s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4))},gr=(e,t,n)=>{let r,i=-1,a,o=t[1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),r=0;r<=n;r++)if(a=o,o=t[(r+1)*2+1],!(++s<c&&a===o)){if(s<l)do R(e,a,e.bl_tree);while(--s!==0);else a===0?s<=10?(R(e,zn,e.bl_tree),L(e,s-3,3)):(R(e,Bn,e.bl_tree),L(e,s-11,7)):(a!==i&&(R(e,a,e.bl_tree),s--),R(e,Rn,e.bl_tree),L(e,s-3,2));s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4)}},_r=e=>{let t;for(hr(e,e.dyn_ltree,e.l_desc.max_code),hr(e,e.dyn_dtree,e.d_desc.max_code),mr(e,e.bl_desc),t=18;t>=3&&e.bl_tree[Wn[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},vr=(e,t,n,r)=>{let i;for(L(e,t-257,5),L(e,n-1,5),L(e,r-4,4),i=0;i<r;i++)L(e,e.bl_tree[Wn[i]*2+1],3);gr(e,e.dyn_ltree,t-1),gr(e,e.dyn_dtree,n-1)},yr=e=>{let t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return wn;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return Tn;for(n=32;n<kn;n++)if(e.dyn_ltree[n*2]!==0)return Tn;return wn},br=!1,xr=e=>{br||=(cr(),!0),e.l_desc=new tr(e.dyn_ltree,Qn),e.d_desc=new tr(e.dyn_dtree,$n),e.bl_desc=new tr(e.bl_tree,er),e.bi_buf=0,e.bi_valid=0,lr(e)},Sr=(e,t,n,r)=>{L(e,0+ +!!r,3),ur(e),rr(e,n),rr(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n},Cr=e=>{L(e,2,3),R(e,Ln,I),ar(e)},wr=(e,t,n,r)=>{let i,a,o=0;e.level>0?(e.strm.data_type===En&&(e.strm.data_type=yr(e)),mr(e,e.l_desc),mr(e,e.d_desc),o=_r(e),i=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=i&&(i=a)):i=a=n+5,n+4<=i&&t!==-1?Sr(e,t,n,r):e.strategy===Cn||a===i?(L(e,2+ +!!r,3),pr(e,I,Kn)):(L(e,4+ +!!r,3),vr(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),pr(e,e.dyn_ltree,e.dyn_dtree)),lr(e),r&&ur(e)},z=(e,t,n)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=n,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(Jn[n]+kn+1)*2]++,e.dyn_dtree[nr(t)*2]++),e.sym_next===e.sym_end),Tr=(e,t,n,r)=>{let i=e&65535|0,a=e>>>16&65535|0,o=0;for(;n!==0;){o=n>2e3?2e3:n,n-=o;do i=i+t[r++]|0,a=a+i|0;while(--o);i%=65521,a%=65521}return i|a<<16|0},Er=new Uint32Array((()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t})()),B=(e,t,n,r)=>{let i=Er,a=r+n;e^=-1;for(let n=r;n<a;n++)e=e>>>8^i[(e^t[n])&255];return e^-1},Dr={2:`need dictionary`,1:`stream end`,0:``,"-1":`file error`,"-2":`stream error`,"-3":`data error`,"-4":`insufficient memory`,"-5":`buffer error`,"-6":`incompatible version`},Or=9,kr=573,V=3,Ar=258,H=262,jr=32,Mr=42,Nr=57,Pr=69,Fr=73,Ir=91,Lr=103,Rr=113,zr=666,U=1,Br=2,Vr=3,Hr=4,Ur=3,W=(e,t)=>(e.msg=Dr[t],t),Wr=e=>e*2-(e>4?9:0),G=e=>{let t=e.length;for(;--t>=0;)e[t]=0},Gr=e=>{let t,n,r,i=e.w_size;t=e.hash_size,r=t;do n=e.head[--r],e.head[r]=n>=i?n-i:0;while(--t);t=i,r=t;do n=e.prev[--r],e.prev[r]=n>=i?n-i:0;while(--t)},Kr=(e,t,n)=>(t<<e.hash_shift^n)&e.hash_mask,qr=(e,t)=>{let n;if(e.legacy_hash)n=e.ins_h=Kr(e,e.ins_h,e.window[t+V-1]);else{let r=e.window,i=r[t]|r[t+1]<<8|r[t+2]<<16|r[t+3]<<24;n=e.ins_h=Math.imul(i,66521)+66521>>>16&e.hash_mask}let r=e.prev[t&e.w_mask]=e.head[n];return e.head[n]=t,r},K=e=>{let t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))},q=(e,t)=>{wr(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,K(e.strm)},J=(e,t)=>{e.pending_buf[e.pending++]=t},Jr=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255},Yr=(e,t,n,r)=>{let i=e.avail_in;return i>r&&(i=r),i===0?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),n),e.state.wrap===1?e.adler=Tr(e.adler,t,i,n):e.state.wrap===2&&(e.adler=B(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)},Xr=(e,t)=>{let n=e.max_chain_length,r=e.strstart,i,a,o=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-H?e.strstart-(e.w_size-H):0,l=e.window,u=e.w_mask,d=e.prev,f=e.strstart+Ar,p=l[r+o-1],m=l[r+o];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do if(i=t,l[i+o]===m&&l[i+o-1]===p&&l[i]===l[r]&&l[++i]===l[r+1]){r+=2,i++;do;while(l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&r<f);if(a=Ar-(f-r),r=f-Ar,a>o){if(e.match_start=t,o=a,a>=s)break;p=l[r+o-1],m=l[r+o]}}while((t=d[t&u])>c&&--n!==0);return o<=e.lookahead?o:e.lookahead},Zr=e=>{let t=e.w_size,n,r,i;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-H)&&(e.window.set(e.window.subarray(t,t+t-r),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),Gr(e),r+=t),e.strm.avail_in===0)break;if(n=Yr(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=n,!e.legacy_hash){if(e.lookahead+e.insert>V)for(i=e.strstart-e.insert;e.insert&&(qr(e,i),i++,e.insert--,!(e.lookahead+e.insert<=V)););}else if(e.lookahead+e.insert>=V)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=Kr(e,e.ins_h,e.window[i+1]);e.insert&&(qr(e,i),i++,e.insert--,!(e.lookahead+e.insert<V)););}while(e.lookahead<H&&e.strm.avail_in!==0)},Qr=(e,t)=>{let n=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,r,i,a,o=0,s=e.strm.avail_in;do{if(r=65535,a=e.bi_valid+42>>3,e.strm.avail_out<a||(a=e.strm.avail_out-a,i=e.strstart-e.block_start,r>i+e.strm.avail_in&&(r=i+e.strm.avail_in),r>a&&(r=a),r<n&&(r===0&&t!==4||t===0||r!==i+e.strm.avail_in)))break;o=+(t===4&&r===i+e.strm.avail_in),Sr(e,0,0,o),e.pending_buf[e.pending-4]=r,e.pending_buf[e.pending-3]=r>>8,e.pending_buf[e.pending-2]=~r,e.pending_buf[e.pending-1]=~r>>8,K(e.strm),i&&(i>r&&(i=r),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+i),e.strm.next_out),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i,e.block_start+=i,r-=i),r&&(Yr(e.strm,e.strm.output,e.strm.next_out,r),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r)}while(o===0);return s-=e.strm.avail_in,s&&(s>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=s&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-s,e.strm.next_in),e.strstart),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),o?Hr:t!==0&&t!==4&&e.strm.avail_in===0&&e.strstart===e.block_start?Br:(a=e.window_size-e.strstart,e.strm.avail_in>a&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,a+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),a>e.strm.avail_in&&(a=e.strm.avail_in),a&&(Yr(e.strm,e.window,e.strstart,a),e.strstart+=a,e.insert+=a>e.w_size-e.insert?e.w_size-e.insert:a),e.high_water<e.strstart&&(e.high_water=e.strstart),a=e.bi_valid+42>>3,a=e.pending_buf_size-a>65535?65535:e.pending_buf_size-a,n=a>e.w_size?e.w_size:a,i=e.strstart-e.block_start,(i>=n||(i||t===4)&&t!==0&&e.strm.avail_in===0&&i<=a)&&(r=i>a?a:i,o=+(t===4&&e.strm.avail_in===0&&r===i),Sr(e,e.block_start,r,o),e.block_start+=r,K(e.strm)),o?Vr:U)},$r=(e,t)=>{let n,r;for(;;){if(e.lookahead<H){if(Zr(e),e.lookahead<H&&t===0)return U;if(e.lookahead===0)break}if(n=0,e.lookahead>=V&&(n=qr(e,e.strstart)),n!==0&&e.strstart-n<=e.w_size-H&&(e.match_length=Xr(e,n)),e.match_length>=V){if(r=z(e,e.strstart-e.match_start,e.match_length-V),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=V){e.match_length--;do e.strstart++,n=qr(e,e.strstart);while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.legacy_hash&&(e.ins_h=e.window[e.strstart],e.ins_h=Kr(e,e.ins_h,e.window[e.strstart+1]))}else r=z(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(q(e,!1),e.strm.avail_out===0))return U}return e.insert=e.strstart<V-1?e.strstart:V-1,t===4?(q(e,!0),e.strm.avail_out===0?Vr:Hr):e.sym_next&&(q(e,!1),e.strm.avail_out===0)?U:Br},ei=(e,t)=>{let n,r,i;for(;;){if(e.lookahead<H){if(Zr(e),e.lookahead<H&&t===0)return U;if(e.lookahead===0)break}if(n=0,e.lookahead>=V&&(n=qr(e,e.strstart)),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=V-1,n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-H&&(e.match_length=Xr(e,n),e.match_length<=5&&(e.strategy===1||e.match_length===V&&e.strstart-e.match_start>4096)&&(e.match_length=V-1)),e.prev_length>=V&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-V,r=z(e,e.strstart-1-e.prev_match,e.prev_length-V),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(n=qr(e,e.strstart));while(--e.prev_length!==0);if(e.match_available=0,e.match_length=V-1,e.strstart++,r&&(q(e,!1),e.strm.avail_out===0))return U}else if(e.match_available){if(r=z(e,0,e.window[e.strstart-1]),r&&q(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return U}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&=(r=z(e,0,e.window[e.strstart-1]),0),e.insert=e.strstart<V-1?e.strstart:V-1,t===4?(q(e,!0),e.strm.avail_out===0?Vr:Hr):e.sym_next&&(q(e,!1),e.strm.avail_out===0)?U:Br},ti=(e,t)=>{let n,r,i,a,o=e.window;for(;;){if(e.lookahead<=Ar){if(Zr(e),e.lookahead<=Ar&&t===0)return U;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=V&&e.strstart>0&&(i=e.strstart-1,r=o[i],r===o[++i]&&r===o[++i]&&r===o[++i])){a=e.strstart+Ar;do;while(r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&i<a);e.match_length=Ar-(a-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=V?(n=z(e,1,e.match_length-V),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=z(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(q(e,!1),e.strm.avail_out===0))return U}return e.insert=0,t===4?(q(e,!0),e.strm.avail_out===0?Vr:Hr):e.sym_next&&(q(e,!1),e.strm.avail_out===0)?U:Br},ni=(e,t)=>{let n;for(;;){if(e.lookahead===0&&(Zr(e),e.lookahead===0)){if(t===0)return U;break}if(e.match_length=0,n=z(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(q(e,!1),e.strm.avail_out===0))return U}return e.insert=0,t===4?(q(e,!0),e.strm.avail_out===0?Vr:Hr):e.sym_next&&(q(e,!1),e.strm.avail_out===0)?U:Br},Y=class{constructor(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}},ri=[new Y(0,0,0,0,Qr),new Y(4,4,8,4,$r),new Y(4,5,16,8,$r),new Y(4,6,32,32,$r),new Y(4,4,16,16,ei),new Y(8,16,32,32,ei),new Y(8,16,128,128,ei),new Y(8,32,128,256,ei),new Y(32,128,258,1024,ei),new Y(32,258,258,4096,ei)],ii=e=>{e.window_size=2*e.w_size,G(e.head),e.max_lazy_match=ri[e.level].max_lazy,e.good_match=ri[e.level].good_length,e.nice_match=ri[e.level].nice_length,e.max_chain_length=ri[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=V-1,e.match_available=0,e.ins_h=0},ai=class{constructor(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.legacy_hash=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(kr*2),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),G(this.dyn_ltree),G(this.dyn_dtree),G(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),G(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),G(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}},oi=e=>{if(!e)return 1;let t=e.state;return+(!t||t.strm!==e||t.status!==Mr&&t.status!==Nr&&t.status!==Pr&&t.status!==Fr&&t.status!==Ir&&t.status!==Lr&&t.status!==Rr&&t.status!==zr)},si=e=>{if(oi(e))return W(e,-2);e.total_in=e.total_out=0,e.data_type=2;let t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?Nr:t.wrap?Mr:Rr,e.adler=t.wrap===2?0:1,t.last_flush=-2,xr(t),0},ci=e=>{let t=si(e);return t===0&&ii(e.state),t},li=(e,t,n,r,i,a,o)=>{if(!e)return-2;let s=1;if(t===-1&&(t=6),r<0?(s=0,r=-r):r>15&&(s=2,r-=16),i<1||i>Or||n!==8||r<8||r>15||t<0||t>9||a<0||a>4||r===8&&s!==1)return W(e,-2);r===8&&(r=9);let c=new ai;return e.state=c,c.strm=e,c.status=Mr,c.wrap=s,c.gzhead=null,c.w_bits=r,c.w_size=1<<c.w_bits,c.w_mask=c.w_size-1,c.legacy_hash=+!!o,c.hash_bits=i+7,!c.legacy_hash&&c.hash_bits<15&&(c.hash_bits=15),c.hash_size=1<<c.hash_bits,c.hash_mask=c.hash_size-1,c.hash_shift=~~((c.hash_bits+V-1)/V),c.window=new Uint8Array(c.w_size*2),c.head=new Uint16Array(c.hash_size),c.prev=new Uint16Array(c.w_size),c.lit_bufsize=1<<i+6,c.pending_buf_size=c.lit_bufsize*4,c.pending_buf=new Uint8Array(c.pending_buf_size),c.sym_buf=c.lit_bufsize,c.sym_end=(c.lit_bufsize-1)*3,c.level=t,c.strategy=a,c.method=n,ci(e)},ui=(e,t)=>{if(oi(e)||t>5||t<0)return e?W(e,-2):-2;let n=e.state;if(!e.output||e.avail_in!==0&&!e.input||n.status===zr&&t!==4)return W(e,e.avail_out===0?-5:-2);let r=n.last_flush;if(n.last_flush=t,n.pending!==0){if(K(e),e.avail_out===0)return n.last_flush=-1,0}else if(e.avail_in===0&&Wr(t)<=Wr(r)&&t!==4)return W(e,-5);if(n.status===zr&&e.avail_in!==0)return W(e,-5);if(n.status===Mr&&n.wrap===0&&(n.status=Rr),n.status===Mr){let t=8+(n.w_bits-8<<4)<<8,r=-1;if(r=n.strategy>=2||n.level<2?0:n.level<6?1:n.level===6?2:3,t|=r<<6,n.strstart!==0&&(t|=jr),t+=31-t%31,Jr(n,t),n.strstart!==0&&(Jr(n,e.adler>>>16),Jr(n,e.adler&65535)),e.adler=1,n.status=Rr,K(e),n.pending!==0)return n.last_flush=-1,0}if(n.status===Nr){if(e.adler=0,J(n,31),J(n,139),J(n,8),n.gzhead)J(n,+!!n.gzhead.text+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),J(n,n.gzhead.time&255),J(n,n.gzhead.time>>8&255),J(n,n.gzhead.time>>16&255),J(n,n.gzhead.time>>24&255),J(n,n.level===9?2:n.strategy>=2||n.level<2?4:0),J(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(J(n,n.gzhead.extra.length&255),J(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=B(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=Pr;else if(J(n,0),J(n,0),J(n,0),J(n,0),J(n,0),J(n,n.level===9?2:n.strategy>=2||n.level<2?4:0),J(n,Ur),n.status=Rr,K(e),n.pending!==0)return n.last_flush=-1,0}if(n.status===Pr){if(n.gzhead.extra){let t=n.pending,r=(n.gzhead.extra.length&65535)-n.gzindex;for(;n.pending+r>n.pending_buf_size;){let i=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+i),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>t&&(e.adler=B(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex+=i,K(e),n.pending!==0)return n.last_flush=-1,0;t=0,r-=i}let i=new Uint8Array(n.gzhead.extra);n.pending_buf.set(i.subarray(n.gzindex,n.gzindex+r),n.pending),n.pending+=r,n.gzhead.hcrc&&n.pending>t&&(e.adler=B(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex=0}n.status=Fr}if(n.status===Fr){if(n.gzhead.name){let t=n.pending,r;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>t&&(e.adler=B(e.adler,n.pending_buf,n.pending-t,t)),K(e),n.pending!==0)return n.last_flush=-1,0;t=0}r=n.gzindex<n.gzhead.name.length?n.gzhead.name.charCodeAt(n.gzindex++)&255:0,J(n,r)}while(r!==0);n.gzhead.hcrc&&n.pending>t&&(e.adler=B(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex=0}n.status=Ir}if(n.status===Ir){if(n.gzhead.comment){let t=n.pending,r;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>t&&(e.adler=B(e.adler,n.pending_buf,n.pending-t,t)),K(e),n.pending!==0)return n.last_flush=-1,0;t=0}r=n.gzindex<n.gzhead.comment.length?n.gzhead.comment.charCodeAt(n.gzindex++)&255:0,J(n,r)}while(r!==0);n.gzhead.hcrc&&n.pending>t&&(e.adler=B(e.adler,n.pending_buf,n.pending-t,t))}n.status=Lr}if(n.status===Lr){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(K(e),n.pending!==0))return n.last_flush=-1,0;J(n,e.adler&255),J(n,e.adler>>8&255),e.adler=0}if(n.status=Rr,K(e),n.pending!==0)return n.last_flush=-1,0}if(e.avail_in!==0||n.lookahead!==0||t!==0&&n.status!==zr){let r=n.level===0?Qr(n,t):n.strategy===2?ni(n,t):n.strategy===3?ti(n,t):ri[n.level].func(n,t);if((r===Vr||r===Hr)&&(n.status=zr),r===U||r===Vr)return e.avail_out===0&&(n.last_flush=-1),0;if(r===Br&&(t===1?Cr(n):t!==5&&(Sr(n,0,0,!1),t===3&&(G(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),K(e),e.avail_out===0))return n.last_flush=-1,0}return t===4?n.wrap<=0?1:(n.wrap===2?(J(n,e.adler&255),J(n,e.adler>>8&255),J(n,e.adler>>16&255),J(n,e.adler>>24&255),J(n,e.total_in&255),J(n,e.total_in>>8&255),J(n,e.total_in>>16&255),J(n,e.total_in>>24&255)):(Jr(n,e.adler>>>16),Jr(n,e.adler&65535)),K(e),n.wrap>0&&(n.wrap=-n.wrap),+(n.pending===0)):0},di=e=>{if(oi(e))return-2;let t=e.state.status;return e.state=null,t===Rr?W(e,-3):0},fi=(e,t)=>{let n=t.length;if(oi(e))return-2;let r=e.state,i=r.wrap;if(i===2||i===1&&r.status!==Mr||r.lookahead)return-2;if(i===1&&(e.adler=Tr(e.adler,t,n,0)),r.wrap=0,n>=r.w_size){i===0&&(G(r.head),r.strstart=0,r.block_start=0,r.insert=0);let e=new Uint8Array(r.w_size);e.set(t.subarray(n-r.w_size,n),0),t=e,n=r.w_size}let a=e.avail_in,o=e.next_in,s=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,Zr(r);r.lookahead>=V;){let e=r.strstart,t=r.lookahead-(V-1);do qr(r,e),e++;while(--t);r.strstart=e,r.lookahead=V-1,Zr(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=V-1,r.match_available=0,e.next_in=o,e.input=s,e.avail_in=a,r.wrap=i,0},pi=16209,mi=16191;function hi(e,t){let n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E=e.state;n=e.next_in,w=e.input,r=n+(e.avail_in-5),i=e.next_out,T=e.output,a=i-(t-e.avail_out),o=i+(e.avail_out-257),s=E.dmax,c=E.wsize,l=E.whave,u=E.wnext,d=E.window,f=E.hold,p=E.bits,m=E.lencode,h=E.distcode,g=(1<<E.lenbits)-1,_=(1<<E.distbits)-1;top:do{p<15&&(f+=w[n++]<<p,p+=8,f+=w[n++]<<p,p+=8),v=m[f&g];dolen:for(;;){if(y=v>>>24,f>>>=y,p-=y,y=v>>>16&255,y===0)T[i++]=v&65535;else if(y&16){b=v&65535,y&=15,y&&(p<y&&(f+=w[n++]<<p,p+=8),b+=f&(1<<y)-1,f>>>=y,p-=y),p<15&&(f+=w[n++]<<p,p+=8,f+=w[n++]<<p,p+=8),v=h[f&_];dodist:for(;;){if(y=v>>>24,f>>>=y,p-=y,y=v>>>16&255,y&16){if(x=v&65535,y&=15,p<y&&(f+=w[n++]<<p,p+=8,p<y&&(f+=w[n++]<<p,p+=8)),x+=f&(1<<y)-1,x>s){e.msg=`invalid distance too far back`,E.mode=pi;break top}if(f>>>=y,p-=y,y=i-a,x>y){if(y=x-y,y>l&&E.sane){e.msg=`invalid distance too far back`,E.mode=pi;break top}if(S=0,C=d,u===0){if(S+=c-y,y<b){b-=y;do T[i++]=d[S++];while(--y);S=i-x,C=T}}else if(u<y){if(S+=c+u-y,y-=u,y<b){b-=y;do T[i++]=d[S++];while(--y);if(S=0,u<b){y=u,b-=y;do T[i++]=d[S++];while(--y);S=i-x,C=T}}}else if(S+=u-y,y<b){b-=y;do T[i++]=d[S++];while(--y);S=i-x,C=T}for(;b>2;)T[i++]=C[S++],T[i++]=C[S++],T[i++]=C[S++],b-=3;b&&(T[i++]=C[S++],b>1&&(T[i++]=C[S++]))}else{S=i-x;do T[i++]=T[S++],T[i++]=T[S++],T[i++]=T[S++],b-=3;while(b>2);b&&(T[i++]=T[S++],b>1&&(T[i++]=T[S++]))}}else if(y&64){e.msg=`invalid distance code`,E.mode=pi;break top}else{v=h[(v&65535)+(f&(1<<y)-1)];continue dodist}break}}else if(!(y&64)){v=m[(v&65535)+(f&(1<<y)-1)];continue dolen}else if(y&32){E.mode=mi;break top}else{e.msg=`invalid literal/length code`,E.mode=pi;break top}break}}while(n<r&&i<o);b=p>>3,n-=b,p-=b<<3,f&=(1<<p)-1,e.next_in=n,e.next_out=i,e.avail_in=n<r?5+(r-n):5-(n-r),e.avail_out=i<o?257+(o-i):257-(i-o),E.hold=f,E.bits=p}var gi=15,_i=852,vi=592,yi=0,bi=1,xi=2,Si=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),Ci=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,199,75]),wi=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),Ti=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),Ei=(e,t,n,r,i,a,o,s)=>{let c=s.bits,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0,y,b,x,S,C,w=null,T,E=new Uint16Array(16),D=new Uint16Array(16),O=null,k,A,ee;for(l=0;l<=gi;l++)E[l]=0;for(u=0;u<r;u++)E[t[n+u]]++;for(p=c,f=gi;f>=1&&E[f]===0;f--);if(p>f&&(p=f),f===0)return i[a++]=20971520,i[a++]=20971520,s.bits=1,0;for(d=1;d<f&&E[d]===0;d++);for(p<d&&(p=d),g=1,l=1;l<=gi;l++)if(g<<=1,g-=E[l],g<0)return-1;if(g>0&&(e===yi||f!==1))return-1;for(D[1]=0,l=1;l<gi;l++)D[l+1]=D[l]+E[l];for(u=0;u<r;u++)t[n+u]!==0&&(o[D[t[n+u]]++]=u);if(e===yi?(w=O=o,T=20):e===bi?(w=Si,O=Ci,T=257):(w=wi,O=Ti,T=0),v=0,u=0,l=d,C=a,m=p,h=0,x=-1,_=1<<p,S=_-1,e===bi&&_>_i||e===xi&&_>vi)return 1;for(;;){k=l-h,o[u]+1<T?(A=0,ee=o[u]):o[u]>=T?(A=O[o[u]-T],ee=w[o[u]-T]):(A=96,ee=0),y=1<<l-h,b=1<<m,d=b;do b-=y,i[C+(v>>h)+b]=k<<24|A<<16|ee|0;while(b!==0);for(y=1<<l-1;v&y;)y>>=1;if(y===0?v=0:(v&=y-1,v+=y),u++,--E[l]===0){if(l===f)break;l=t[n+o[u]]}if(l>p&&(v&S)!==x){for(h===0&&(h=p),C+=d,m=l-h,g=1<<m;m+h<f&&(g-=E[m+h],!(g<=0));)m++,g<<=1;if(_+=1<<m,e===bi&&_>_i||e===xi&&_>vi)return 1;x=v&S,i[x]=p<<24|m<<16|C-a|0}}return v!==0&&(i[C+v]=l-h<<24|4194304),s.bits=p,0},Di=0,Oi=1,ki=2,Ai=16180,ji=16181,Mi=16182,Ni=16183,Pi=16184,Fi=16185,Ii=16186,Li=16187,Ri=16188,zi=16189,Bi=16190,X=16191,Vi=16192,Hi=16193,Ui=16194,Wi=16195,Gi=16196,Ki=16197,qi=16198,Ji=16199,Yi=16200,Xi=16201,Zi=16202,Qi=16203,$i=16204,ea=16205,ta=16206,na=16207,ra=16208,Z=16209,ia=16210,aa=16211,oa=852,sa=592,ca=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24),la=class{constructor(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}},ua=e=>{if(!e)return 1;let t=e.state;return+(!t||t.strm!==e||t.mode<Ai||t.mode>aa)},da=e=>{if(ua(e))return-2;let t=e.state;return e.total_in=e.total_out=t.total=0,e.msg=``,t.wrap&&(e.adler=t.wrap&1),t.mode=Ai,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(oa),t.distcode=t.distdyn=new Int32Array(sa),t.sane=1,t.back=-1,0},fa=e=>{if(ua(e))return-2;let t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,da(e)},pa=(e,t)=>{let n;if(ua(e))return-2;let r=e.state;return t<0?(n=0,t=-t):(n=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?-2:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,fa(e))},ma=(e,t)=>{if(!e)return-2;let n=new la;e.state=n,n.strm=e,n.window=null,n.mode=Ai;let r=pa(e,t);return r!==0&&(e.state=null),r},ha=!0,ga,_a,va=e=>{if(ha){ga=new Int32Array(512),_a=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(Ei(Oi,e.lens,0,288,ga,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Ei(ki,e.lens,0,32,_a,0,e.work,{bits:5}),ha=!1}e.lencode=ga,e.lenbits=9,e.distcode=_a,e.distbits=5},ya=(e,t,n,r)=>{let i,a=e.state;return a.window===null&&(a.window=new Uint8Array(1<<a.wbits)),a.wsize===0&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0),r>=a.wsize?(a.window.set(t.subarray(n-a.wsize,n),0),a.wnext=0,a.whave=a.wsize):(i=a.wsize-a.wnext,i>r&&(i=r),a.window.set(t.subarray(n-r,n-r+i),a.wnext),r-=i,r?(a.window.set(t.subarray(n-r,n),0),a.wnext=r,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=i))),0},ba=(e,t)=>{let n,r,i,a,o,s,c,l,u,d,f,p,m,h,g=0,_,v,y,b,x,S,C,w,T=new Uint8Array(4),E,D,O=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(ua(e)||!e.output||!e.input&&e.avail_in!==0)return-2;n=e.state,n.mode===X&&(n.mode=Vi),o=e.next_out,i=e.output,c=e.avail_out,a=e.next_in,r=e.input,s=e.avail_in,l=n.hold,u=n.bits,d=s,f=c,w=0;inf_leave:for(;;)switch(n.mode){case Ai:if(n.wrap===0){n.mode=Vi;break}for(;u<16;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(n.wrap&2&&l===35615){n.wbits===0&&(n.wbits=15),n.check=0,T[0]=l&255,T[1]=l>>>8&255,n.check=B(n.check,T,2,0),l=0,u=0,n.mode=ji;break}if(n.head&&(n.head.done=!1),!(n.wrap&1)||(((l&255)<<8)+(l>>8))%31){e.msg=`incorrect header check`,n.mode=Z;break}if((l&15)!=8){e.msg=`unknown compression method`,n.mode=Z;break}if(l>>>=4,u-=4,C=(l&15)+8,n.wbits===0&&(n.wbits=C),C>15||C>n.wbits){e.msg=`invalid window size`,n.mode=Z;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=l&512?zi:X,l=0,u=0;break;case ji:for(;u<16;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(n.flags=l,(n.flags&255)!=8){e.msg=`unknown compression method`,n.mode=Z;break}if(n.flags&57344){e.msg=`unknown header flags set`,n.mode=Z;break}n.head&&(n.head.text=l>>8&1),n.flags&512&&n.wrap&4&&(T[0]=l&255,T[1]=l>>>8&255,n.check=B(n.check,T,2,0)),l=0,u=0,n.mode=Mi;case Mi:for(;u<32;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.head&&(n.head.time=l),n.flags&512&&n.wrap&4&&(T[0]=l&255,T[1]=l>>>8&255,T[2]=l>>>16&255,T[3]=l>>>24&255,n.check=B(n.check,T,4,0)),l=0,u=0,n.mode=Ni;case Ni:for(;u<16;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.head&&(n.head.xflags=l&255,n.head.os=l>>8),n.flags&512&&n.wrap&4&&(T[0]=l&255,T[1]=l>>>8&255,n.check=B(n.check,T,2,0)),l=0,u=0,n.mode=Pi;case Pi:if(n.flags&1024){for(;u<16;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.length=l,n.head&&(n.head.extra_len=l),n.flags&512&&n.wrap&4&&(T[0]=l&255,T[1]=l>>>8&255,n.check=B(n.check,T,2,0)),l=0,u=0}else n.head&&(n.head.extra=null);n.mode=Fi;case Fi:if(n.flags&1024&&(p=n.length,p>s&&(p=s),p&&(n.head&&(C=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(a,a+p),C)),n.flags&512&&n.wrap&4&&(n.check=B(n.check,r,p,a)),s-=p,a+=p,n.length-=p),n.length))break inf_leave;n.length=0,n.mode=Ii;case Ii:if(n.flags&2048){if(s===0)break inf_leave;p=0;do C=r[a+p++],n.head&&C&&n.length<65536&&(n.head.name+=String.fromCharCode(C));while(C&&p<s);if(n.flags&512&&n.wrap&4&&(n.check=B(n.check,r,p,a)),s-=p,a+=p,C)break inf_leave}else n.head&&(n.head.name=null);n.length=0,n.mode=Li;case Li:if(n.flags&4096){if(s===0)break inf_leave;p=0;do C=r[a+p++],n.head&&C&&n.length<65536&&(n.head.comment+=String.fromCharCode(C));while(C&&p<s);if(n.flags&512&&n.wrap&4&&(n.check=B(n.check,r,p,a)),s-=p,a+=p,C)break inf_leave}else n.head&&(n.head.comment=null);n.mode=Ri;case Ri:if(n.flags&512){for(;u<16;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(n.wrap&4&&l!==(n.check&65535)){e.msg=`header crc mismatch`,n.mode=Z;break}l=0,u=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=X;break;case zi:for(;u<32;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}e.adler=n.check=ca(l),l=0,u=0,n.mode=Bi;case Bi:if(n.havedict===0)return e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,n.hold=l,n.bits=u,2;e.adler=n.check=1,n.mode=X;case X:if(t===5||t===6)break inf_leave;case Vi:if(n.last){l>>>=u&7,u-=u&7,n.mode=ta;break}for(;u<3;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}switch(n.last=l&1,l>>>=1,--u,l&3){case 0:n.mode=Hi;break;case 1:if(va(n),n.mode=Ji,t===6){l>>>=2,u-=2;break inf_leave}break;case 2:n.mode=Gi;break;case 3:e.msg=`invalid block type`,n.mode=Z}l>>>=2,u-=2;break;case Hi:for(l>>>=u&7,u-=u&7;u<32;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if((l&65535)!=(l>>>16^65535)){e.msg=`invalid stored block lengths`,n.mode=Z;break}if(n.length=l&65535,l=0,u=0,n.mode=Ui,t===6)break inf_leave;case Ui:n.mode=Wi;case Wi:if(p=n.length,p){if(p>s&&(p=s),p>c&&(p=c),p===0)break inf_leave;i.set(r.subarray(a,a+p),o),s-=p,a+=p,c-=p,o+=p,n.length-=p;break}n.mode=X;break;case Gi:for(;u<14;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(n.nlen=(l&31)+257,l>>>=5,u-=5,n.ndist=(l&31)+1,l>>>=5,u-=5,n.ncode=(l&15)+4,l>>>=4,u-=4,n.nlen>286||n.ndist>30){e.msg=`too many length or distance symbols`,n.mode=Z;break}n.have=0,n.mode=Ki;case Ki:for(;n.have<n.ncode;){for(;u<3;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.lens[O[n.have++]]=l&7,l>>>=3,u-=3}for(;n.have<19;)n.lens[O[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,E={bits:n.lenbits},w=Ei(Di,n.lens,0,19,n.lencode,0,n.work,E),n.lenbits=E.bits,w){e.msg=`invalid code lengths set`,n.mode=Z;break}n.have=0,n.mode=qi;case qi:for(;n.have<n.nlen+n.ndist;){for(;g=n.lencode[l&(1<<n.lenbits)-1],_=g>>>24,v=g>>>16&255,y=g&65535,!(_<=u);){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(y<16)l>>>=_,u-=_,n.lens[n.have++]=y;else{if(y===16){for(D=_+2;u<D;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(l>>>=_,u-=_,n.have===0){e.msg=`invalid bit length repeat`,n.mode=Z;break}C=n.lens[n.have-1],p=3+(l&3),l>>>=2,u-=2}else if(y===17){for(D=_+3;u<D;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}l>>>=_,u-=_,C=0,p=3+(l&7),l>>>=3,u-=3}else{for(D=_+7;u<D;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}l>>>=_,u-=_,C=0,p=11+(l&127),l>>>=7,u-=7}if(n.have+p>n.nlen+n.ndist){e.msg=`invalid bit length repeat`,n.mode=Z;break}for(;p--;)n.lens[n.have++]=C}}if(n.mode===Z)break;if(n.lens[256]===0){e.msg=`invalid code -- missing end-of-block`,n.mode=Z;break}if(n.lenbits=9,E={bits:n.lenbits},w=Ei(Oi,n.lens,0,n.nlen,n.lencode,0,n.work,E),n.lenbits=E.bits,w){e.msg=`invalid literal/lengths set`,n.mode=Z;break}if(n.distbits=6,n.distcode=n.distdyn,E={bits:n.distbits},w=Ei(ki,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,E),n.distbits=E.bits,w){e.msg=`invalid distances set`,n.mode=Z;break}if(n.mode=Ji,t===6)break inf_leave;case Ji:n.mode=Yi;case Yi:if(s>=6&&c>=258){e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,n.hold=l,n.bits=u,hi(e,f),o=e.next_out,i=e.output,c=e.avail_out,a=e.next_in,r=e.input,s=e.avail_in,l=n.hold,u=n.bits,n.mode===X&&(n.back=-1);break}for(n.back=0;g=n.lencode[l&(1<<n.lenbits)-1],_=g>>>24,v=g>>>16&255,y=g&65535,!(_<=u);){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(v&&!(v&240)){for(b=_,x=v,S=y;g=n.lencode[S+((l&(1<<b+x)-1)>>b)],_=g>>>24,v=g>>>16&255,y=g&65535,!(b+_<=u);){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}l>>>=b,u-=b,n.back+=b}if(l>>>=_,u-=_,n.back+=_,n.length=y,v===0){n.mode=ea;break}if(v&32){n.back=-1,n.mode=X;break}if(v&64){e.msg=`invalid literal/length code`,n.mode=Z;break}n.extra=v&15,n.mode=Xi;case Xi:if(n.extra){for(D=n.extra;u<D;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.length+=l&(1<<n.extra)-1,l>>>=n.extra,u-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=Zi;case Zi:for(;g=n.distcode[l&(1<<n.distbits)-1],_=g>>>24,v=g>>>16&255,y=g&65535,!(_<=u);){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(!(v&240)){for(b=_,x=v,S=y;g=n.distcode[S+((l&(1<<b+x)-1)>>b)],_=g>>>24,v=g>>>16&255,y=g&65535,!(b+_<=u);){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}l>>>=b,u-=b,n.back+=b}if(l>>>=_,u-=_,n.back+=_,v&64){e.msg=`invalid distance code`,n.mode=Z;break}n.offset=y,n.extra=v&15,n.mode=Qi;case Qi:if(n.extra){for(D=n.extra;u<D;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.offset+=l&(1<<n.extra)-1,l>>>=n.extra,u-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg=`invalid distance too far back`,n.mode=Z;break}n.mode=$i;case $i:if(c===0)break inf_leave;if(p=f-c,n.offset>p){if(p=n.offset-p,p>n.whave&&n.sane){e.msg=`invalid distance too far back`,n.mode=Z;break}p>n.wnext?(p-=n.wnext,m=n.wsize-p):m=n.wnext-p,p>n.length&&(p=n.length),h=n.window}else h=i,m=o-n.offset,p=n.length;p>c&&(p=c),c-=p,n.length-=p;do i[o++]=h[m++];while(--p);n.length===0&&(n.mode=Yi);break;case ea:if(c===0)break inf_leave;i[o++]=n.length,c--,n.mode=Yi;break;case ta:if(n.wrap){for(;u<32;){if(s===0)break inf_leave;s--,l|=r[a++]<<u,u+=8}if(f-=c,e.total_out+=f,n.total+=f,n.wrap&4&&f&&(e.adler=n.check=n.flags?B(n.check,i,f,o-f):Tr(n.check,i,f,o-f)),f=c,n.wrap&4&&(n.flags?l:ca(l))!==n.check){e.msg=`incorrect data check`,n.mode=Z;break}l=0,u=0}n.mode=na;case na:if(n.wrap&&n.flags){for(;u<32;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(n.wrap&4&&l!==(n.total&4294967295)){e.msg=`incorrect length check`,n.mode=Z;break}l=0,u=0}n.mode=ra;case ra:w=1;break inf_leave;case Z:w=-3;break inf_leave;case ia:return-4;case aa:default:return-2}return e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,n.hold=l,n.bits=u,(n.wsize||f!==e.avail_out&&n.mode<Z&&(n.mode<ta||t!==4))&&ya(e,e.output,e.next_out,f-e.avail_out)?(n.mode=ia,-4):(d-=e.avail_in,f-=e.avail_out,e.total_in+=d,e.total_out+=f,n.total+=f,n.wrap&4&&f&&(e.adler=n.check=n.flags?B(n.check,i,f,e.next_out-f):Tr(n.check,i,f,e.next_out-f)),e.data_type=n.bits+(n.last?64:0)+(n.mode===X?128:0)+(n.mode===Ji||n.mode===Ui?256:0),(d===0&&f===0||t===4)&&w===0&&(w=-5),w)},xa=e=>{if(ua(e))return-2;let t=e.state;return t.window&&=null,e.state=null,0},Sa=(e,t)=>{let n=t.length,r,i,a;return ua(e)||(r=e.state,r.wrap!==0&&r.mode!==Bi)?-2:r.mode===Bi&&(i=1,i=Tr(i,t,n,0),i!==r.check)?-3:(a=ya(e,t,n,n),a?(r.mode=ia,-4):(r.havedict=1,0))},Ca=class{constructor(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=``,this.state=null,this.data_type=2,this.adler=0}},wa=e=>{let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),n=0;for(let r of e)t.set(r,n),n+=r.length;return t},Ta=Object.prototype.toString,Ea={level:-1,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,raw:!1,gzip:!1,legacyHash:!1,dictionary:new Uint8Array},Da=class{options;err;msg;ended;started;chunks;strm;result;constructor(e={}){this.options=Object.assign({},Ea,e);let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg=``,this.ended=!1,this.started=!1,this.chunks=[],this.result=new Uint8Array,this.strm=new Ca,this.strm.avail_out=0;let n=li(this.strm,t.level,8,t.windowBits,t.memLevel,t.strategy,t.legacyHash);if(n!==0)throw Error(Dr[n]);Ta.call(t.dictionary)===`[object ArrayBuffer]`&&(t.dictionary=new Uint8Array(t.dictionary));let r=t.dictionary;if(r.length){if(t.gzip)throw Error(`dictionary is not supported with gzip`);if(n=fi(this.strm,r),n!==0)throw Error(Dr[n])}}push(e,t=!1){let n=this.strm,r=this.options.chunkSize,i,a;if(this.ended)return!1;for(a=typeof t==`number`?t:t===!0?4:0,n.input=typeof e==`string`?new TextEncoder().encode(e):Ta.call(e)===`[object ArrayBuffer]`?new Uint8Array(e):e,n.next_in=0,n.avail_in=n.input.length,this.started||(this.started=!0,this.onStart(n));;){if(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),(a===2||a===3)&&n.avail_out<=6){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(i=ui(n,a),i===-2)break;if(i===1){n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),i=di(this.strm);break}if(n.avail_out===0){this.onData(n.output);continue}if(a>0&&n.next_out>0){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(n.avail_in===0)return!0}return this.err=i,this.msg=n.msg||Dr[i],this.ended=!0,this.onEnd(i),i===0}onStart(e){}onData(e){this.chunks.push(e)}onEnd(e){e===0&&(this.result=wa(this.chunks)),this.chunks=[]}};function Oa(e,t={}){let n=new Da(t);if(n.push(e,!0),n.err)throw Error(n.msg);return n.result}function ka(e,t={}){return Oa(e,Object.assign({},t,{raw:!0}))}function Aa(e,t={}){return Oa(e,Object.assign({},t,{gzip:!0}))}var ja=Object.prototype.toString,Ma={chunkSize:65536,windowBits:15,raw:!1,dictionary:new Uint8Array},Na=class{options;err;msg;ended;started;chunks;strm;result;constructor(e={}){this.options=Object.assign({},Ma,e);let t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!e.windowBits&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg=``,this.ended=!1,this.started=!1,this.chunks=[],this.result=new Uint8Array,this.strm=new Ca,this.strm.avail_out=0;let n=ma(this.strm,t.windowBits);if(n!==0)throw Error(Dr[n]);ja.call(t.dictionary)===`[object ArrayBuffer]`&&(t.dictionary=new Uint8Array(t.dictionary));let r=t.dictionary;if(t.raw&&r.length&&(n=Sa(this.strm,r),n!==0))throw Error(Dr[n])}push(e,t=!1){let n=this.strm,r=this.options.chunkSize,i,a,o;if(this.ended)return this.err===0;for(a=typeof t==`number`?t:t===!0?4:0,n.input=ja.call(e)===`[object ArrayBuffer]`?new Uint8Array(e):e,n.next_in=0,n.avail_in=n.input.length,this.started||(this.started=!0,this.onStart(n));;){if(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),i=ba(n,a),i===2){let e=this.options.dictionary;e.length&&(i=Sa(n,e),i===0?i=ba(n,a):i===-3&&(i=2))}for(;n.avail_in>0&&i===1&&n.state.wrap&2&&n.state.flags!==0&&n.input[n.next_in]!==0;)fa(n),i=ba(n,a);if(i===-2||i===-3||i===2||i===-4)break;if(o=n.avail_out,n.next_out&&(n.avail_out===0||i===1||a>0)&&(this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out)),n.avail_out=0,n.next_out=0),i!==0&&i!==-5||o!==0){if(i===1){i=xa(this.strm);break}if(n.avail_in===0){if(a===4){i=xa(this.strm),i===0&&(i=-5);break}return!0}}}return this.err=i,this.msg=n.msg||Dr[i],this.ended=!0,this.onEnd(i),i===0}onStart(e){}onData(e){this.chunks.push(e)}onEnd(e){e===0&&(this.result=wa(this.chunks)),this.chunks=[]}};function Pa(e,t={}){let n=new Na(t);if(n.push(e,!0),n.err)throw Error(n.msg);let r=n.result;return t.toText?new TextDecoder().decode(r):r}function Fa(e,t={}){return Pa(e,{...t,raw:!0})}function Ia(e){return typeof e==`string`?new Uint8Array(Ke(e,`utf8`)):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}function La(e){let t={};return e&&(typeof e.level==`number`&&(t.level=e.level),typeof e.windowBits==`number`&&(t.windowBits=e.windowBits),typeof e.memLevel==`number`&&(t.memLevel=e.memLevel),typeof e.strategy==`number`&&(t.strategy=e.strategy)),t}function Ra(e,t,n){return Ke(e(Ia(t),La(n)))}function za(e,t,n,r){let i=typeof n==`function`?n:r,a=typeof n==`function`?void 0:n;if(typeof i!=`function`)throw TypeError(`zlib: callback is required`);let o;try{o=Ra(e,t,a)}catch(e){queueMicrotask(()=>i(e instanceof Error?e:Error(String(e))));return}queueMicrotask(()=>i(null,o))}const Ba={gzipSync:(e,t)=>Ra(Aa,e,t),gunzipSync:(e,t)=>Ra(Pa,e,t),deflateSync:(e,t)=>Ra(Oa,e,t),inflateSync:(e,t)=>Ra(Pa,e,t),deflateRawSync:(e,t)=>Ra(ka,e,t),inflateRawSync:(e,t)=>Ra(Fa,e,t),gzip:(e,t,n)=>za(Aa,e,t,n),gunzip:(e,t,n)=>za(Pa,e,t,n),deflate:(e,t,n)=>za(Oa,e,t,n),inflate:(e,t,n)=>za(Pa,e,t,n),deflateRaw:(e,t,n)=>za(ka,e,t,n),inflateRaw:(e,t,n)=>za(Fa,e,t,n),constants:{Z_NO_FLUSH:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1}};function Va(e){let t=[],n={},r=[],i=(e,t)=>{if(e in n){let r=n[e];Array.isArray(r)?r.push(String(t)):n[e]=[String(r),String(t)]}else n[e]=t},a=2;for(;a<e.length;){let n=e[a];if(n===`--`){r.push(...e.slice(a+1));break}if(n.startsWith(`--`)){let t=n.slice(2),r=t.indexOf(`=`);if(r!==-1){i(t.slice(0,r),t.slice(r+1)),a++;continue}let o=e[a+1];if(o!==void 0&&!o.startsWith(`-`)){i(t,o),a+=2;continue}i(t,!0),a++;continue}if(n.startsWith(`-`)&&n.length>1){for(let e of n.slice(1))i(e,!0);a++;continue}t.push(n),a++}return{positional:t,flags:n,subcommand:t.length>0&&/^[a-z][\w-]*$/i.test(t[0])?t[0]:null,passthrough:r}}function Ha(e){let t=[...e];return Object.defineProperty(t,"parseFlags",{value:()=>Va(t),enumerable:!1,writable:!1,configurable:!1}),t}const Ua=async(e,t,n)=>{let r=Math.max(1,Math.trunc(e)||1),i=Array(t.length),a=0,o=[],s=async()=>{for(;;){let e=a++;if(e>=t.length)return;i[e]=await n(t[e],e)}};for(let e=0;e<Math.min(r,t.length);e++)o.push(s());return await Promise.all(o),i},Wa={ms:1,s:1e3,m:6e4,h:36e5,d:864e5,w:6048e5,M:26298e5,y:315576e5};function Ga(e){if(typeof e==`number`&&Number.isFinite(e))return Math.trunc(e);if(typeof e!=`string`)throw TypeError(`time.parseDuration: spec must be string or number`);let t=e.trim(),n=/^([0-9]+(?:\.[0-9]+)?)\s*(ms|s|m|h|d|w|M|y)?$/.exec(t);if(!n)throw RangeError(`time.parseDuration: unrecognized spec "${e}"`);let r=Number(n[1]),i=n[2]??`ms`;return Math.trunc(r*Wa[i])}function Ka(e){return e<10?`0${e}`:String(e)}const qa={parseDuration:Ga,ago(e,t=new Date){return new Date(t.getTime()-Ga(e))},range(e,t=new Date){let n=new Date(t.getTime());return{start:new Date(n.getTime()-Ga(e)),end:n}},future(e,t=new Date){let n=new Date(t.getTime());return{start:n,end:new Date(n.getTime()+Ga(e))}},gmailDate(e,t=new Date){let n=new Date(t.getTime()-Ga(e));return`${n.getFullYear()}/${Ka(n.getMonth()+1)}/${Ka(n.getDate())}`}};function Ja(e){if(!e)return``;let t=e.lastIndexOf(`/`);return t<0?``:t===0?`/`:e.substring(0,t)}var Ya=class extends Error{code;constructor(e){super(`Process exited with code ${e}`),this.code=e,this.name=`NodeExitError`}};function Xa(e){let t=Number(e);return Number.isFinite(t)?t:0}function Za(e){return typeof e==`string`?`type string ('${e}')`:typeof e==`boolean`?`type boolean (${e})`:typeof e==`bigint`?`type bigint (${e}n)`:Array.isArray(e)?`an instance of Array`:typeof e==`object`&&e?`an instance of Object`:`type ${typeof e}`}function Qa(e){let t=TypeError(`The "code" argument must be of type number. Received ${Za(e)}`);return t.code=`ERR_INVALID_ARG_TYPE`,t}function $a(e){let t=RangeError(`The value of "code" is out of range. It must be an integer. Received ${String(e)}`);return t.code=`ERR_OUT_OF_RANGE`,t}function eo(e){if(e!=null){if(typeof e==`string`){let t=Number(e);if(e!==``&&Number.isInteger(t))return t===0?0:t;throw Qa(e)}if(typeof e==`number`){if(Number.isInteger(e))return e===0?0:e;throw $a(e)}throw Qa(e)}}function to(e){if(typeof e==`string`)return e;if(e==null)return String(e);try{return JSON.stringify(e)}catch{return String(e)}}function no(e){return`${e.map(to).join(` `)}\n`}function ro(e){return e===void 0?`default`:String(e)}function io(){return typeof performance<`u`?performance.now():Date.now()}function ao(e){return`${e.toFixed(3)}ms`}function oo(e,t,n){let r=no(n);e(t>0?`${` `.repeat(t)}${r}`:r)}function so(e,t,n){if(t)return;if(n.length===0){e(`Assertion failed`);return}let[r,...i]=n;e(`Assertion failed: ${to(r)}`,...i)}function co(e,t,n,r){e(r.length>0?`Trace: ${r.map(to).join(` `)}`:`Trace:`);let i=Error().stack;if(!i)return;let a=i.split(`
|
|
25
25
|
`).slice(3).join(`
|
|
26
26
|
`);if(!a)return;let o=a.endsWith(`
|
|
27
|
-
`)?a:`${a}\n`;t(n>0?`${` `.repeat(n)}${o}`:o)}function
|
|
28
|
-
`);return t[t.length-1]===``&&t.pop(),t.map(e=>e.endsWith(`\r`)?e.slice(0,-1):e)}function xo(e){if(typeof e==`string`)return e;if(e&&typeof e.read==`function`){let t=e.read();return typeof t==`string`?t:``}return``}function So(e){return new TextDecoder(`utf-8`).decode(re(e))}function Co(e){if(e&&typeof e.write==`function`)return e}var wo=class extends qe{terminal=!1;lines;cursor=0;closed=!1;flushScheduled=!1;output;onExit;constructor(e,t,n){super(),this.lines=bo(So(xo(e))),this.output=t??n.output,this.onExit=n.onExit}on(e,t){return super.on(e,t),e===`line`&&this.scheduleFlush(),this}once(e,t){return super.once(e,t),e===`line`&&this.scheduleFlush(),this}pause(){return this}resume(){return this}close(){this.closed||(this.closed=!0,this.emit(`close`))}question(e,t,n){let r=typeof t==`function`?t:typeof n==`function`?n:void 0;this.output?.write(String(e));let i=this.cursor<this.lines.length?this.lines[this.cursor++]:``;if(r){queueMicrotask(()=>this.runHandler(()=>r(i)));return}return Promise.resolve(i)}[Symbol.asyncIterator](){return{next:async()=>!this.closed&&this.cursor<this.lines.length?{value:this.lines[this.cursor++],done:!1}:(this.close(),{value:void 0,done:!0})}}scheduleFlush(){this.flushScheduled||this.closed||(this.flushScheduled=!0,queueMicrotask(()=>this.flush()))}flush(){this.flushScheduled=!1,this.runHandler(()=>{for(;!this.closed&&this.cursor<this.lines.length;)this.emit(`line`,this.lines[this.cursor++]);this.close()})}runHandler(e){try{e()}catch(e){if(e instanceof Ja&&this.onExit){this.closed=!0,this.onExit(e.code);return}throw e}}};function To(e){let t=(t,n)=>{let r,i;if(t&&typeof t==`object`&&`input`in t){let e=t;r=e.input,i=Co(e.output)}else r=t,i=Co(n);if(r==null)throw TypeError(`readline.createInterface: an 'input' stream is required`);return new wo(r,i,e)},n=(...e)=>{let t=e[e.length-1];return typeof t==`function`&&queueMicrotask(()=>t()),!0},r={createInterface:t,Interface:wo,emitKeypressEvents:()=>void 0,cursorTo:n,moveCursor:n,clearLine:n,clearScreenDown:n};return{...r,promises:r}}var Eo=class extends Error{status;statusText;url;body;constructor(e,t,n,r){let i=typeof r==`string`&&r?`: ${r.slice(0,200)}`:r&&typeof r==`object`?`: ${Do(r).slice(0,200)}`:``;super(`HTTP ${e} ${t} ${n}${i}`),this.status=e,this.statusText=t,this.url=n,this.body=r,this.name=`HttpError`}};function Do(e){try{return JSON.stringify(e)}catch{return String(e)}}function Oo(e){return new Promise(t=>setTimeout(t,e))}function ko(e,t){let n=[];for(let[e,r]of Object.entries(t))if(r!=null){if(Array.isArray(r))for(let t of r)t!=null&&n.push(`${encodeURIComponent(e)}=${encodeURIComponent(String(t))}`);else n.push(`${encodeURIComponent(e)}=${encodeURIComponent(String(r))}`)}return n.length===0?e:e+(e.includes(`?`)?`&`:`?`)+n.join(`&`)}function Ao(e,t,n){let r;return r=/^[a-z][a-z0-9+.-]*:\/\//i.test(t)?t:e?`${e.endsWith(`/`)?e.slice(0,-1):e}${t.startsWith(`/`)?t:`/${t}`}`:t,n?ko(r,n):r}function jo(e,t){let n={};if(e)for(let[t,r]of Object.entries(e))n[t]=r;if(t)for(let[e,r]of Object.entries(t))n[e]=r;return n}function Mo(e){if(!e)return!1;let t=e.toLowerCase();return t.startsWith(`application/json`)||/[+/]json(;|$|\s)/.test(t)}function No(e){if(!e)return null;let t=e.trim();if(!t)return null;if(/^\d+(\.\d+)?$/.test(t)){let e=Number(t);if(Number.isFinite(e)&&e>=0)return Math.round(e*1e3)}let n=Date.parse(t);if(Number.isFinite(n)){let e=n-Date.now();return e>0?e:0}return null}async function Po(e){if(Mo(e.headers.get(`content-type`))){let t=await e.text();if(!t)return null;try{return JSON.parse(t)}catch{return t}}return e.text()}function Fo(e,t){if(e!=null)return typeof e==`string`||e instanceof ArrayBuffer||ArrayBuffer.isView(e)||typeof Blob<`u`&&e instanceof Blob||typeof FormData<`u`&&e instanceof FormData||typeof URLSearchParams<`u`&&e instanceof URLSearchParams||typeof ReadableStream<`u`&&e instanceof ReadableStream?e:typeof e==`object`?(Object.keys(t).some(e=>e.toLowerCase()===`content-type`)||(t[`Content-Type`]=`application/json`),JSON.stringify(e)):String(e)}function Io(e,t){return Object.keys(e).some(e=>e.toLowerCase()===t.toLowerCase())}async function Lo(e,t,n){let r=await t(n);r&&!Io(e,`authorization`)&&(e.Authorization=`Bearer ${r}`)}function Ro(e,t){if(!t)return{signal:e,clearTimeout:null};let n=new AbortController,r=setTimeout(()=>n.abort(Error(`timeout`)),t),i=()=>clearTimeout(r);return e?{signal:AbortSignal.any([e,n.signal]),clearTimeout:i}:{signal:n.signal,clearTimeout:i}}function zo(e,t){return{body:t,headers:Object.fromEntries(e.headers.entries()),status:e.status}}async function Bo(e,t){let n=await Po(e);return t?zo(e,n):n}async function Vo(e,t){let n=await Po(e).catch(()=>null);throw new Eo(e.status,e.statusText,t,n)}function Ho(e,t){let n=No(e.headers.get(`retry-after`));return n===null?500*2**t:n}async function Uo(e,t,n,r){let i=null;for(let a=0;a<e.maxAttempts;a++){let{signal:o,clearTimeout:s}=Ro(r.signal,e.timeoutMs),c=o?{...n,signal:o}:n,l;try{l=await e.fetch(t,c)}finally{s?.()}if(i=l,l.ok)return Bo(l,r.raw);if(!(a+1<e.maxAttempts&&e.retryOn.has(l.status)))return Vo(l,t);await e.sleep(Ho(l,a))}if(i)return Vo(i,t);throw Error(`http: no attempts made for ${n.method??`GET`} ${t}`)}function Wo(e){let t=e.sleep??Oo;function n(n){let r=new Set(n.retry?.on??[]),i=Math.max(1,Math.trunc(n.retry?.maxAttempts??1));async function a(a,o,s={}){let c=Ao(n.baseUrl,o,s.params),l=jo(n.headers,s.headers);n.token&&await Lo(l,n.token,{method:a,path:o,url:c});let u=Fo(s.body,l),d={method:a,headers:l};return u!==void 0&&(d.body=u),Uo({fetch:e.fetch,sleep:t,maxAttempts:i,retryOn:r,timeoutMs:n.timeoutMs},c,d,s)}return Object.freeze({get:((e,t)=>a(`GET`,e,t)),post:((e,t)=>a(`POST`,e,t)),put:((e,t)=>a(`PUT`,e,t)),patch:((e,t)=>a(`PATCH`,e,t)),delete:((e,t)=>a(`DELETE`,e,t))})}return Object.freeze({client:n})}function Go(e){let t=new TextEncoder().encode(e),n=``;for(let e=0;e<t.length;e++)n+=String.fromCharCode(t[e]);return btoa(n)}function Ko(e,t,n){let r=[];t.model&&r.push(`--model`,String(t.model)),t.thinking&&r.push(`--thinking`,String(t.thinking)),t.schema&&r.push(`--schema-b64`,Go(JSON.stringify(t.schema))),t.readOnly!==void 0&&r.push(`--read-only`,Array.isArray(t.readOnly)?t.readOnly.join(`,`):String(t.readOnly));let i=t.cwd===void 0?n||`.`:String(t.cwd),a=t.allowedCommands===void 0?`*`:String(t.allowedCommands);return[`agent`,...r,i,a,String(e)]}function qo(e,t){let n=t.cwd,r=async(t,r)=>{let i=r??{},a=await e.spawn(Ko(t,i,n)),o=typeof a.exitCode==`number`?a.exitCode:0;return{finalText:String(a.stdout??``).replace(/\n+$/,``),exitCode:o,stderr:String(a.stderr??``).replace(/\n+$/,``)}},i=(async(e,t)=>{let n=t??{},i=await r(e,n);if(i.exitCode!==0)throw Error(`agent: exited with code ${i.exitCode}${i.stderr?`: ${i.stderr}`:``}`);if(n.schema)try{return JSON.parse(i.finalText)}catch{throw Error(`agent: schema response was not valid JSON (exit ${i.exitCode}): ${i.finalText.slice(0,200)}`)}return i.finalText});return i.spawn=r,i}function Jo(e){if(typeof e==`string`)return e;if(e&&typeof e==`object`&&typeof e.targetId==`string`)return e.targetId;throw TypeError(`browser: expected a tab handle or targetId string`)}function Yo(e){function t(t){return{...t,async update(n){let r={};return n.urlMatch!==void 0&&(r.urlMatch=n.urlMatch===null?null:n.urlMatch instanceof RegExp?n.urlMatch.source:n.urlMatch),n.filter!==void 0&&(r.filter=n.filter),e.call(`browser`,`wsUpdate`,[t.id,r])},async close(){return e.call(`browser`,`wsClose`,[t.id])}}}return{on(n,r={}){let i=Jo(n),a=r.urlMatch===void 0?void 0:r.urlMatch instanceof RegExp?r.urlMatch.source:r.urlMatch,o,s={filter(e){if(typeof e==`function`||typeof e==`string`)throw TypeError(`browser.websocket: filter must be a declarative JSON object, not a function or string`);return o=e,s},async forward(n){return t(await e.call(`browser`,`wsObserve`,[{targetId:i,urlMatch:a,filter:o,forward:n}]))}};return s},async list(){return e.call(`browser`,`wsList`,[])}}}async function Xo(e,t){if(!e&&!(t instanceof Request))return;let n=t instanceof Request?t:null,r=(e?.method??n?.method??`GET`).toUpperCase(),i={};if(e?.headers){if(e.headers instanceof Headers)e.headers.forEach((e,t)=>{i[t]=e});else if(Array.isArray(e.headers))for(let[t,n]of e.headers)i[t]=n;else Object.assign(i,e.headers)}else n&&n.headers.forEach((e,t)=>{i[t]=e});let a,o;if(r!==`GET`&&r!==`HEAD`&&e?.body!==void 0&&e?.body!==null&&e?.body!==``){let t=await Zo(e.body);a=t.body,o=t.defaultContentType}return o&&!Object.keys(i).some(e=>e.toLowerCase()===`content-type`)&&(i[`Content-Type`]=o),{method:r,headers:i,body:a}}async function Zo(e){if(typeof e==`string`)return{body:e};if(e instanceof URLSearchParams)return{body:e.toString(),defaultContentType:`application/x-www-form-urlencoded;charset=UTF-8`};if(e instanceof Blob)return{body:new Uint8Array(await e.arrayBuffer()),defaultContentType:e.type||`application/octet-stream`};if(e instanceof ArrayBuffer)return{body:new Uint8Array(e).slice(),defaultContentType:`application/octet-stream`};if(ArrayBuffer.isView(e))return{body:new Uint8Array(e.buffer,e.byteOffset,e.byteLength).slice(),defaultContentType:`application/octet-stream`};if(n(e)){let t=await r(e);return{body:t.bytes,defaultContentType:t.contentType}}throw typeof ReadableStream<`u`&&e instanceof ReadableStream?Error(`node fetch shim: ReadableStream request bodies are not supported (collect into a Uint8Array or string before calling fetch)`):Error(`node fetch shim: unsupported request body type (${Object.prototype.toString.call(e)}); use a string, Uint8Array, ArrayBuffer, Blob, FormData, or URLSearchParams`)}function Qo(e){return{findTab:t=>e.call(`browser`,`findTab`,[es(t)]),ensureTab:(t,n={})=>e.call(`browser`,`ensureTab`,[t,ts(n)]),eval:(t,n)=>e.call(`browser`,`eval`,[Jo(t),$o(n,!1)]),evalAsync:(t,n)=>e.call(`browser`,`evalAsync`,[Jo(t),$o(n,!0)]),cookie:(t,n)=>e.call(`browser`,`cookie`,[Jo(t),n]),localStorage:(t,n)=>e.call(`browser`,`localStorage`,[Jo(t),n]),fetch:(t,n,r={})=>E(n,r).then(n=>e.call(`browser`,`evalAsync`,[Jo(t),n])),websocket:Yo(e)}}function $o(e,t){if(typeof e==`function`)return`(${e.toString()})()`;if(typeof e==`string`)return e;throw TypeError(`browser.eval/evalAsync: source must be a function or string`)}function es(e){let t={};return e.domain!==void 0&&(t.domain=e.domain),e.urlMatch!==void 0&&(t.urlMatch=e.urlMatch instanceof RegExp?e.urlMatch.source:e.urlMatch),t}function ts(e){return e.matchUrl===void 0?{}:{matchUrl:e.matchUrl instanceof RegExp?e.matchUrl.source:e.matchUrl}}function ns(e){return{register(t){let n=null,r=e.onEvent(`computer-call`,r=>{let i=r;i.id===t.id&&is(e,t,i,{getStop:()=>n,setStop:e=>{n=e}})}),i=rs(t);return e.call(`computer`,`register`,[i]).catch(()=>{}),()=>{n?.(),n=null,r(),e.call(`computer`,`unregister`,[t.id]).catch(()=>{})}}}}function rs(e){return{id:e.id,kind:`jsh`,title:e.title??e.id,size:e.size??null,state:`live`,capabilities:e.capabilities,pid:null,...e.softKeys?{softKeys:e.softKeys}:{}}}async function is(e,t,n,r){let i;try{i=await as(e,t,n,r)}catch(e){i={error:e instanceof Error?e.message:String(e)}}try{await e.call(`computer`,`reply`,[n.requestId,i])}catch{}}async function as(e,t,n,r){switch(n.op){case`screenshot`:return t.screenshot(n.args[0]??{format:`jpeg`});case`text`:return t.text?t.text():null;case`input`:return await t.input(n.args[0]??[]),{ok:!0};case`exec`:if(!t.exec)throw Error(`exec is not supported`);return t.exec(String(n.args[0]??``));case`subscribe`:return os(e,t,Number(n.args[0])||2,Number(n.args[1])||void 0,r);case`unsubscribe`:return r.getStop()?.(),r.setStop(null),{ok:!0};default:{let e=n.op;throw Error(`unknown computer op '${String(e)}'`)}}}function os(e,t,n,r,i){if(i.getStop()?.(),!t.subscribe)throw Error(`subscribe is not supported`);let a=t.subscribe(n,n=>{e.call(`computer`,`frame`,[t.id,n]).catch(()=>{})},r);return i.setStop(()=>{try{a()}catch{}}),{ok:!0}}function ss(e){return e===`SIGKILL`?137:e===`SIGINT`?130:143}function cs(e,t,n,r){let i=async()=>{if(!t?.wasUsed())return;let n=t.getMutations();if(n.created.length||n.modified.length||n.deleted.length)try{await e.call(`vfs`,`flushWrites`,[n])}catch(e){let t=e instanceof Error?e.message:String(e);console.error(`[realm-exec] pre-exec sync-fs flush failed (will retry at exit): ${t}`);return}t.resetBaseline()},a=async(i=!1)=>{if(t?.wasUsed())try{let r=await e.call(`vfs`,`snapshot`,[n]);i?t.applySnapshotPreservingMutations(r):t.applySnapshot(r)}catch(e){let t=e instanceof Error?e.message:String(e);r?.(`[sync-fs] re-snapshot after exec failed: ${t}\n`)}},o=async t=>{await i();try{return await e.call(`exec`,`run`,[t])}finally{await a()}},s=async t=>{await i();try{return await e.call(`exec`,`spawn`,[t])}finally{await a()}},c=1,l=Object.assign(o,{spawn:s,start:(t,n)=>{let r=c++,o=[],s=!1,l=!1,u=!1,d,f,p=new Promise((e,t)=>{d=e,f=t}),m=()=>{if(s||u||l)return;l=!0;let c=o.length>0?o.join(``):n?.stdin,p={};c!==void 0&&(p.stdin=c),n?.stdinKind!==void 0&&(p.stdinKind=n.stdinKind),n?.args!==void 0&&(p.args=n.args),n?.cwd!==void 0&&(p.cwd=n.cwd),n?.env!==void 0&&(p.env=n.env),(async()=>{try{if(await i(),u){await a(!0);return}s=!0;let n=await e.call(`exec`,`start`,[r,t,p]);await a(!0),d(n)}catch(e){await a(!0),f(e)}})()};return{kill:t=>s?e.call(`exec`,`kill`,[r,t]):(u=!0,d({stdout:``,stderr:``,exitCode:ss(t)}),Promise.resolve(!0)),stdin:{write:e=>{!s&&!u&&o.push(e)},end:()=>m()},done:p}}});return l.exec=l,l}const ls=new Set([204,205,304]),us=new Set([`content-encoding`,`transfer-encoding`,`content-length`]);function ds(e,t){let n=fs(e.body),r=ps(e.headers),i=ls.has(e.status)||n.byteLength===0,a=new Response(i?null:n,{status:e.status,statusText:e.statusText,headers:r});try{Object.defineProperty(a,"url",{value:e.url||t,writable:!1,configurable:!0,enumerable:!1})}catch{}return hs(a,n),a}function fs(e){return e.byteLength===0?new Uint8Array:e.slice()}function ps(e){let t=new Headers;for(let[n,r]of Object.entries(e))if(!us.has(n.toLowerCase()))try{t.set(n,r)}catch{}return t}const ms=Symbol(`slicc.realmBufferedBody`);function hs(e,t){if(ms in e)return;Object.defineProperty(e,ms,{value:!0,configurable:!0});let n=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),`bodyUsed`),r=!1,i=()=>{if(r)throw TypeError(`Failed to read response body: body already used`);return r=!0,gs(e),t},a=async()=>new TextDecoder().decode(i()),o=e=>e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);Object.defineProperties(e,{bodyUsed:{configurable:!0,enumerable:!1,get(){return r?!0:n?.get?!!n.get.call(e):!1}},text:{value:a,configurable:!0},json:{value:async()=>JSON.parse(await a()),configurable:!0},arrayBuffer:{value:async()=>o(i()),configurable:!0},blob:{value:async()=>new Blob([o(i())]),configurable:!0},bytes:{value:async()=>i(),configurable:!0}})}function gs(e){try{let t=e.body;t&&!t.locked&&t.getReader()}catch{}}function _s(e){if(e instanceof Uint8Array)return e;if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(e instanceof ArrayBuffer)return new Uint8Array(e);throw TypeError(`expected an ArrayBuffer or typed array`)}function vs(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function ys(e){return e==null?[]:Array.isArray(e)?e:[e]}function bs(e,t){let n=t.handle,r=new Set,i=new Set,a=!1,o=null,s=e=>{let t=e;if(!t||t.handle!==n)return;let i={reportId:t.reportId,data:vs(t.bytes)};for(let e of[...r])try{e(i)}catch{}},c=()=>{a||(a=!0,o=e.onEvent?e.onEvent(`hid-input-report`,s):null,e.call(`hid`,`subscribeInputReports`,[n]).catch(()=>{a=!1,o?.(),o=null}))},l=()=>{!a||r.size>0||(a=!1,o?.(),o=null,e.call(`hid`,`unsubscribeInputReports`,[n]).catch(()=>{}))};return{...t,open:()=>e.call(`hid`,`open`,[n]),close:()=>e.call(`hid`,`close`,[n]),sendReport:(t,r)=>e.call(`hid`,`sendReport`,[n,t,_s(r)]),sendFeatureReport:(t,r)=>e.call(`hid`,`sendFeatureReport`,[n,t,_s(r)]),receiveFeatureReport:async t=>vs((await e.call(`hid`,`receiveFeatureReport`,[n,t])).bytes),addEventListener(e,t){if(e===`inputreport`)r.add(t),c();else if(e===`disconnect`)i.add(t);else throw TypeError(`hid device: unknown event type '${String(e)}'`)},removeEventListener(e,t){e===`inputreport`?(r.delete(t),l()):e===`disconnect`&&i.delete(t)},onInputReport(e){r.add(e),c()}}}function xs(e){return{list:async()=>(await e.call(`hid`,`list`,[])).map(t=>bs(e,t)),request:async t=>{let n=(await e.call(`hid`,`request`,[ys(t)]))[0];if(!n)throw Error(`No device selected.`);return bs(e,n)}}}function Ss(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}var Cs=class{rpc;targetId;selector;index;constructor(e,t,n,r){this.rpc=e,this.targetId=t,this.selector=n,this.index=r}evalOnElement(e){let t=`(() => { const els = document.querySelectorAll(${JSON.stringify(this.selector)}); const el = els[${this.index}]; ${e} })()`;return this.rpc.call(`browser`,`evalAsync`,[this.targetId,t])}async textContent(){return this.evalOnElement(`return el ? el.textContent : null;`)}async getAttribute(e){return this.evalOnElement(`return el ? el.getAttribute(${JSON.stringify(e)}) : null;`)}async isVisible(){return this.evalOnElement(`if (!el) return false; const s = getComputedStyle(el); if (s.display === 'none' || s.visibility === 'hidden' || s.opacity === '0') return false; const r = el.getBoundingClientRect(); return r.width > 0 && r.height > 0;`)}async boundingBox(){return this.evalOnElement(`if (!el) return null; const r = el.getBoundingClientRect(); return { x: r.x, y: r.y, width: r.width, height: r.height };`)}},ws=class{rpc;targetId;onClose;closed=!1;constructor(e,t,n){this.rpc=e,this.targetId=t,this.onClose=n}async goto(e,t){await this.rpc.call(`browser`,`navigateTab`,[this.targetId,e])}async waitForLoadState(e){await this.rpc.call(`browser`,`waitForLoadState`,[this.targetId,e??`load`])}async waitForTimeout(e){await new Promise(t=>setTimeout(t,e))}async evaluate(e,...t){let n=typeof e==`string`?e:`(${e.toString()}).apply(null, JSON.parse(${JSON.stringify(JSON.stringify(t))}))`;return this.rpc.call(`browser`,`evalAsync`,[this.targetId,n])}async screenshot(e){let t={};e?.fullPage!==void 0&&(t.fullPage=e.fullPage);let n=Ss(await this.rpc.call(`browser`,`screenshotTab`,[this.targetId,t]));return e?.path&&await this.rpc.call(`vfs`,`writeFileBinary`,[e.path,n]),n}async $(e){return await this.rpc.call(`browser`,`evalAsync`,[this.targetId,`!!document.querySelector(${JSON.stringify(e)})`])?new Cs(this.rpc,this.targetId,e,0):null}async $$(e){let t=await this.rpc.call(`browser`,`evalAsync`,[this.targetId,`document.querySelectorAll(${JSON.stringify(e)}).length`]),n=[];for(let r=0;r<t;r++)n.push(new Cs(this.rpc,this.targetId,e,r));return n}async $$eval(e,t,...n){if(typeof t==`string`)return this.rpc.call(`browser`,`evalAsync`,[this.targetId,t]);let r=`(${t.toString()}).apply(null, [Array.from(document.querySelectorAll(${JSON.stringify(e)}))].concat(JSON.parse(${JSON.stringify(JSON.stringify(n))})))`;return this.rpc.call(`browser`,`evalAsync`,[this.targetId,r])}async content(){return this.rpc.call(`browser`,`evalAsync`,[this.targetId,`document.documentElement.outerHTML`])}async setViewportSize(e){await this.rpc.call(`browser`,`setViewport`,[this.targetId,e.width,e.height])}async close(){this.closed||(this.closed=!0,await this.rpc.call(`browser`,`closeTab`,[this.targetId]),this.onClose?.())}},Ts=class{rpc;openPages=[];constructor(e){this.rpc=e}async newPage(e){let t=await this.rpc.call(`browser`,`createTab`,[`about:blank`]);e?.viewport&&await this.rpc.call(`browser`,`setViewport`,[t,e.viewport.width,e.viewport.height]);let n=new ws(this.rpc,t,()=>{let e=this.openPages.indexOf(n);e!==-1&&this.openPages.splice(e,1)});return this.openPages.push(n),n}pages(){return[...this.openPages]}async close(){let e=this.openPages.splice(0,this.openPages.length);for(let t of e)await t.close()}},Es=class{rpc;openPages=[];openContexts=[];constructor(e){this.rpc=e}async newPage(e){let t=await this.rpc.call(`browser`,`createTab`,[`about:blank`]);e?.viewport&&await this.rpc.call(`browser`,`setViewport`,[t,e.viewport.width,e.viewport.height]);let n=new ws(this.rpc,t,()=>{let e=this.openPages.indexOf(n);e!==-1&&this.openPages.splice(e,1)});return this.openPages.push(n),n}async newContext(e){let t=new Ts(this.rpc);return this.openContexts.push(t),t}contexts(){return[...this.openContexts]}async close(){let e=this.openPages.splice(0,this.openPages.length);for(let t of e)await t.close();let t=this.openContexts.splice(0,this.openContexts.length);for(let e of t)await e.close()}};function Ds(e){let t=async t=>new Es(e),n=async(t,n)=>new Es(e);return{chromium:{launch:t,connect:n,connectOverCDP:n},firefox:{launch:t,connect:n},webkit:{launch:t,connect:n}}}function Os(e){return{...e,time:Ka,fmt:Fe,pool:Ha}}function ks(e,t){return e?.startsWith(`/`)?qa(e):t}function As(e){return e.includes(`require`)||e.includes(`import`)||/(?:^|[;\n}])\s*export\b/.test(e)}async function js(e,t,n,r){return As(t)?e.call(`module`,`buildGraph`,[t,ks(r,n),r]):{files:[],entryMap:{},edges:{},edgeErrors:{},errors:{}}}function Ms(e){if(typeof e!=`object`||!e)return;let t=e;if(t.__esModule&&!Object.prototype.hasOwnProperty.call(t,`default`)&&Object.isExtensible(t))try{Object.defineProperty(t,"default",{value:t,enumerable:!1,configurable:!0})}catch{}}function Ns(e){return{playwright:Ds(e)}}function Ps(e){let{graph:t,fsBridge:n,processShim:r,childProcess:i,nodeConsole:a,sliccyModules:o,shimmedPackages:s={},nodeReadline:l,nodeOsModule:d=xn,nodeUtilModule:p=_t}=e,m=new Map(t.files.map(e=>[e.path,e.cjsSource])),h=new Map(t.files.map(e=>[e.path,e.kind])),g=new Map,_=gn({requireFrom:(e,t)=>T(e,t),resolveFrom:(e,t)=>w(e,t)}),v=nn(()=>{let e=r?.cwd?.();return typeof e==`string`&&e.length>0?e:`/`}),b=e=>{if(typeof e==`string`&&e.startsWith(`sliccy:`))return{hit:!0,value:Ls(e,o)};let t=e.startsWith(`node:`)?e.slice(5):e,a=Fs(t,{fsBridge:n,processShim:r,childProcess:i,nodeOsModule:d,nodeUtilModule:p,nodePathModule:v,nodeReadline:l,nodeModule:_});if(a.hit)return a;if(y.has(t))throw f(e,t);if(u.has(t))throw zs(e,t);return t in s?{hit:!0,value:s[t]}:{hit:!1}},x=(e,n,r)=>{let i=b(n);if(i.hit)return i.value;let a=e?.[n];if(a)return S(a);let o=r===null?t.errors[n]:t.edgeErrors?.[r]?.[n];throw o?Error(o):Is(n)};function S(e){let n=g.get(e);if(n)return n.exports;let i=m.get(e);if(i===void 0)throw Error(`Cannot find module '${e}'`);let o={exports:{}};g.set(e,o);let s=n=>x(t.edges[e],n,e),c=qa(e);return Function(`module`,`exports`,`require`,`__dirname`,`__filename`,`process`,`console`,`Buffer`,`global`,i)(o,o.exports,s,c,e,r,a,globalThis.Buffer,globalThis),h.get(e)===`cjs`&&Ms(o.exports),o.exports}function C(e){return m.has(e)}function w(e,n){if(c(n))return n;let r=t.edges[e]?.[n];if(r)return r;let i=qa(e);if(hn(n)){let e=pn(i,n,C);if(e)return e}else{let e=mn(i,n,C);if(e)return e}let a=t.edgeErrors?.[e]?.[n];throw a?Error(a):Is(n)}function T(e,t){let n=b(t);return n.hit?n.value:S(w(e,t))}return{require:e=>x(t.entryMap,e,null)}}function Fs(e,t){let{fsBridge:n,processShim:r,childProcess:i,nodeOsModule:a,nodeUtilModule:o,nodePathModule:s,nodeReadline:c,nodeModule:l}=t;return e===`fs`||e===`fs/promises`?{hit:!0,value:n}:e===`path`?{hit:!0,value:s}:e===`crypto`?{hit:!0,value:Wt}:e===`child_process`?{hit:!0,value:i}:e===`process`?{hit:!0,value:r}:e===`buffer`?{hit:!0,value:{Buffer:globalThis.Buffer}}:e===`assert`?{hit:!0,value:Ge}:e===`assert/strict`?{hit:!0,value:We}:e===`util`?{hit:!0,value:o}:e===`events`?{hit:!0,value:Je}:e===`os`?{hit:!0,value:a}:e===`tty`?{hit:!0,value:Sn}:e===`stream`?{hit:!0,value:$e}:e===`url`?{hit:!0,value:sn}:e===`zlib`?{hit:!0,value:za}:e===`readline`&&c?{hit:!0,value:c}:e===`readline/promises`&&c?{hit:!0,value:c.promises}:e===`module`&&l?{hit:!0,value:l}:{hit:!1}}function Is(e){if(e.startsWith(`.`)||e.startsWith(`/`)||e.startsWith(`node:`))return Error(`Cannot find module '${e}'`);let t=e.startsWith(`@`)?e.split(`/`).slice(0,2).join(`/`):e.split(`/`)[0];return Error(`Cannot find module '${e}' (run: ipk install ${t})`)}function Ls(e,t){let n=e.slice(7);if(n===``)throw Error(`require('sliccy:'): empty sliccy: module name`);if(!Object.prototype.hasOwnProperty.call(t,n))throw Error(`require('${e}'): unknown sliccy: module '${n}'. Known names: ${Object.keys(t).sort().join(`, `)}`);return t[n]}const Rs={http:` Use fetch() instead.`,https:` Use fetch() instead.`,crypto:` Use globalThis.crypto (Web Crypto API) instead.`};function zs(e,t){return Error(`require('${e}'): Node built-in '${t}' is not available in the browser environment.${Rs[t]||``}`)}async function Bs(e,t,n,r){let i=Object.keys(t),a=i.map(e=>t[e]),o=Object.getPrototypeOf(async function(){}).constructor,s=new o(...i,`${r?`"use strict";
|
|
29
|
-
`:``}${e}`);try{return await s(...a),0}catch(e){return e instanceof
|
|
30
|
-
`),r}async function c(t){if(typeof t!=`string`||!t.trim())throw TypeError(`skill.token(providerId): providerId must be a non-empty string`);let n=`oauth-token ${Js(t)}`,{stdout:r,stderr:i,exitCode:a}=await e.exec(n);if(a!==0){let e=i.trim()||`oauth-token exited with code ${a}`;throw Error(`skill.token('${t}'): ${e}`)}return r.replace(/\r?\n+$/,``)}return Object.freeze({dir:t,root:n,refs:r,assets:i,config:s,token:c})}function $(e,t){return Object.assign(Error(`${e}: ${t}`),{code:e})}function Zs(e){let t=$s(e);if(ec(t))return new Uint8Array(t.response);if(t.status>=200&&t.status<300)throw $(`EIO`,e.label);tc(t,e.label)}function Qs(e){let t=Zs(e);try{return JSON.parse(new TextDecoder().decode(t))}catch{throw $(`EIO`,e.label)}}function $s(e){let t=new XMLHttpRequest;try{t.open(e.method,e.url,!1),t.responseType=`arraybuffer`,t.timeout=e.timeoutMs,t.setRequestHeader(m,e.token),e.body?t.send(new Uint8Array(e.body)):t.send()}catch{throw $(`EIO`,e.label)}return t}function ec(e){return e.status>=200&&e.status<300&&e.getResponseHeader(`x-slicc-fs`)===`1`}function tc(e,t){throw $(e.getResponseHeader(`x-slicc-fs`)===`1`&&e.getResponseHeader(`x-slicc-fs-errno`)||`EIO`,t)}function nc(e){return(t,n,r)=>{let i=Qs({method:`POST`,url:_,token:e,body:new TextEncoder().encode(JSON.stringify({...t,channel:g})),timeoutMs:n+h,label:r});if(!i||typeof i.stdout!=`string`||typeof i.stderr!=`string`||typeof i.exitCode!=`number`)throw $(`EIO`,r);return{stdout:i.stdout,stderr:i.stderr,exitCode:i.exitCode}}}function rc(e,t){let n=e.getMutations();for(let e of n.deleted)t.rm(e);for(let e of n.created)e.isDirectory?t.mkdir(e.path):t.writeFile(e.path,e.content);for(let e of n.modified)t.writeFile(e.path,e.content);e.resetBaseline()}function ic(e,t={}){let n=t.timeoutMs??12e4,{syncFs:r,fsBridge:i}=t,a=t.transport??nc(e);return{run(e,t={}){let o=r?.wasUsed()===!0&&i!==void 0;o&&rc(r,i);let s=`sync-exec bridge, '${Array.isArray(e)?e.join(` `):e}'`,c=b(t.timeout,n),l={command:e,...t.args===void 0?{}:{args:t.args},...t.input===void 0?{}:{stdin:t.input},...t.cwd===void 0?{}:{cwd:t.cwd},...t.env===void 0?{}:{env:t.env},timeoutMs:c};try{return a(l,c,s)}finally{o&&r.invalidate()}}}}function ac(e,t){return $(e,`sync-fs bridge, '${t}'`)}function oc(e,t){let n=e.startsWith(`/`)?e:`/${e}`,r=w+n.split(`/`).map(encodeURIComponent).join(`/`);return t?`${r}?op=${t}`:r}function sc(e,t={}){let n=t.timeoutMs??3e4;function r(t,r,i,a){return{method:t,url:oc(r,a),token:e,...i?{body:i}:{},timeoutMs:n,label:`sync-fs bridge, '${r}'`}}return{readFile(e){return Zs(r(`GET`,e))},writeFile(e,t){Zs(r(`POST`,e,t))},stat(e){let t=Qs(r(`GET`,e,void 0,`stat`));if(!t||typeof t.isFile!=`boolean`||typeof t.isDirectory!=`boolean`||typeof t.size!=`number`)throw ac(`EIO`,e);return{isFile:t.isFile,isDirectory:t.isDirectory,isSymbolicLink:t.isSymbolicLink,size:t.size}},lstat(e){let t=Qs(r(`GET`,e,void 0,`lstat`));if(!t||typeof t.isFile!=`boolean`||typeof t.isDirectory!=`boolean`||typeof t.size!=`number`)throw ac(`EIO`,e);return{isFile:t.isFile,isDirectory:t.isDirectory,isSymbolicLink:t.isSymbolicLink,size:t.size}},readdir(e){let t=Qs(r(`GET`,e,void 0,`readdir`));if(!Array.isArray(t)||!t.every(e=>typeof e==`string`))throw ac(`EIO`,e);return t},exists(e){let t=Qs(r(`GET`,e,void 0,`exists`));if(typeof t!=`boolean`)throw ac(`EIO`,e);return t},mkdir(e){Zs(r(`POST`,e,void 0,`mkdir`))},rm(e){Zs(r(`POST`,e,void 0,`rm`))}}}function cc(e,t,n={}){let{header:r,window:i}=C(e),a=n.wait??((e,t,n,r)=>Atomics.wait(e,t,n,r)),o=n.now??(()=>performance.now()),s=0;function c(e,t,n){for(;;){let i=t-o();if(i<=0)throw $(`ETIMEDOUT`,n);if(a(r,0,1,i),Atomics.load(r,0)===2&&Atomics.load(r,1)===e)return;Atomics.load(r,0)===2&&Atomics.store(r,0,1)}}return{call(e,n,a){let l=++s,u=o()+n,d=null,f=0,p=0;try{for(;;){Atomics.store(r,0,1);let n=p===0?{type:S,id:l,req:e}:{type:x,id:l,offset:p};try{t.postMessage(n)}catch{throw $(`EIO`,a)}c(l,u,a);let o=Atomics.load(r,3),s=Atomics.load(r,4);if(Atomics.load(r,5)!==p||s<0||o<0||p+s>o)throw $(`EIO`,a);if(d===null&&(f=Atomics.load(r,2),d=new Uint8Array(o)),d.set(i.subarray(0,s),p),p+=s,p>=o)break;if(s===0)throw $(`EIO`,a)}}finally{Atomics.store(r,0,0)}return v(f,d)}}}function lc(e,t){return $(e,`sync-sab bridge, '${t}'`)}function uc(e){let t=e;return!!t&&typeof t.isFile==`boolean`&&typeof t.isDirectory==`boolean`&&typeof t.size==`number`}function dc(e,t={}){let n=t.timeoutMs??25e3;function r(t,r){let i=e.call(t,n,`sync-sab bridge, '${r}'`);if(!i.ok)throw lc(i.errno,r);return i}function i(e,t){let n=r(e,t);if(n.ok&&n.kind===`bytes`)return n.bytes;throw lc(`EIO`,t)}function a(e,t){let n=r(e,t);if(n.ok&&n.kind===`json`)return n.json;throw lc(`EIO`,t)}return{readFile:e=>i({op:`read`,path:e},e),writeFile:(e,t)=>{r({op:`write`,path:e,body:t},e)},stat:e=>{let t=a({op:`stat`,path:e},e);if(!uc(t))throw lc(`EIO`,e);return t},lstat:e=>{let t=a({op:`lstat`,path:e},e);if(!uc(t))throw lc(`EIO`,e);return t},readdir:e=>{let t=a({op:`readdir`,path:e},e);if(!Array.isArray(t)||!t.every(e=>typeof e==`string`))throw lc(`EIO`,e);return t},exists:e=>{let t=a({op:`exists`,path:e},e);if(typeof t!=`boolean`)throw lc(`EIO`,e);return t},mkdir:e=>{r({op:`mkdir`,path:e},e)},rm:e=>{r({op:`rm`,path:e},e)}}}function fc(e){return(t,n,r)=>{let i=e.call({...t,channel:g},n+h,r);if(!i.ok)throw $(i.errno,r);let a=i.kind===`json`?i.json:null;if(!a||typeof a.stdout!=`string`||typeof a.stderr!=`string`||typeof a.exitCode!=`number`)throw $(`EIO`,r);return{stdout:a.stdout,stderr:a.stderr,exitCode:a.exitCode}}}const pc=65536;function mc(e,t){if(!t)return e;let n=e+t;return n.length<=pc?n:n.slice(n.length-pc)}async function hc(e,t,n){let r;try{r=await e.call(`vfs`,`snapshot`,[t])}catch(e){n?.(e instanceof Error?e.message:String(e)),r={entries:[]}}return new te(r)}function gc(e,t){if(e.syncFsToken)return e=>t(`[sync-fs] snapshot failed, sync metadata will be incomplete: ${e}\n`)}function _c(e,t){return t?dc(t):e.syncFsToken?sc(e.syncFsToken):void 0}function vc(e,t){if(!(!e.syncSab||typeof Atomics>`u`||typeof Atomics.wait!=`function`))return cc(e.syncSab,t)}function yc(e,t,n,r,i){let a=vc(e,t),o=_c(e,a);if(Object.assign(r,Ce(n,e.cwd,o,i,{write:(e,n)=>{t.postMessage({type:`realm-fs-write`,path:e,bytes:n})},delete:e=>{t.postMessage({type:`realm-fs-delete`,path:e})}})),e.syncFsToken)return ic(e.syncFsToken,{syncFs:n,...o?{fsBridge:o}:{},...a?{transport:fc(a)}:{}})}function bc(e=globalThis){Object.prototype.hasOwnProperty.call(e,`SLICC_VERSION`)||Object.defineProperty(e,"SLICC_VERSION",{value:i().version,writable:!1,enumerable:!1,configurable:!1})}function xc(e,t,n){let r=Te({isTTY:!e,noColor:e});return{colorApi:r,cliApi:we({writeStdout:t,writeStderr:n,exit:e=>{throw new Ja(e)},color:r})}}function Sc(e,t,n){return{readStdinBytes:()=>re(e.stdin??``),writeStdout:t,writeStderr:n}}function Cc(e){return{usbBridge:Gs(e),serialBridge:Hs(e),hidBridge:xs(e),computerBridge:ns(e)}}async function wc(e,t){let n=e.captureOutput!==!1,r={stdout:``,stderr:``},i=(e,i)=>{let a=typeof i==`string`?i:String(i);e===`stdout`?r.stdout=n?r.stdout+a:mc(r.stdout,a):r.stderr=n?r.stderr+a:mc(r.stderr,a),t.postMessage({type:`realm-output`,stream:e,chunk:a})},a=e=>{i(`stdout`,e)},o=e=>{i(`stderr`,e)},s=go(a,o),c=_o(e,a,o),{colorApi:l,cliApi:u}=xc(!!e.env?.NO_COLOR,a,o),d=new p(t),f=Sc(e,a,o),m=he(d,E,f),h=await hc(d,e.cwd,gc(e,o)),g=yc(e,t,h,m,f),_=cs(d,h,e.cwd,o),v=qo(_,{cwd:e.cwd}),y=Xs({argv:e.argv,fs:m,exec:_}),b=Qo(d),{usbBridge:x,serialBridge:S,hidBridge:C,computerBridge:w}=Cc(d),T=Wo({fetch:E});async function E(e,t){let n=e instanceof Request?e.url:e instanceof URL?e.toString():String(e);return ds(await d.call(`fetch`,`request`,[n,await Xo(t,e)]),n)}let D=Os({exec:_,agent:v,skill:y,http:T,browser:b,usb:x,serial:S,hid:C,computer:w,cli:u,color:l}),O=e.filename,k=qa(O),A=await js(d,e.code,e.cwd,O),ee=Ps({graph:A,fsBridge:m,processShim:c.processShim,childProcess:kt(_,g),nodeConsole:s,sliccyModules:D,shimmedPackages:Ns(d),nodeReadline:To({output:{write:a},onExit:c.recordExit}),nodeOsModule:bn(e.env),nodeUtilModule:gt(e=>o(`${e}\n`))}).require,te={exports:{},filename:e.filename},ne=A.entrySource!==void 0;await Tc({entryCode:A.entrySource??e.code,isEsmEntry:ne,filename:O,dirname:k,proc:c,nodeConsole:s,requireShim:ee,moduleShim:te,realmFetch:E,writeStderr:o,rpc:d,syncFs:h,output:r,port:t})}async function Tc(e){let t=globalThis;bc(),t.__slicc_compileWasm=t=>e.rpc.call(`wasm`,`compile`,[t]);let n=Us(globalThis,{onCallbackError(e){if(!(e instanceof Ja))throw e}}),{createBodyReadHandleTracker:r}=await import(`./realm-body-handles-DtLxL_rB.js`),i=r(globalThis);n.install(),i.install();try{let r=await Ec({entryCode:e.entryCode,bridges:{process:e.proc.processShim,console:e.nodeConsole,require:e.requireShim,module:e.moduleShim,exports:e.moduleShim.exports,fetch:e.realmFetch,__dirname:e.dirname,__filename:e.filename},writeStderr:e.writeStderr,isEsmEntry:e.isEsmEntry,rpc:e.rpc,syncFs:e.syncFs,proc:e.proc,timers:n,bodyReads:i});delete t.__slicc_compileWasm,e.rpc.dispose(),e.port.postMessage({type:`realm-done`,stdout:e.output.stdout,stderr:e.output.stderr,exitCode:r})}finally{n.clearPending(),n.restore(),i.restore()}}async function Ec(e){let t=await Bs(e.entryCode,e.bridges,e.writeStderr,e.isEsmEntry);return await Dc(e.rpc,e.syncFs,e.writeStderr),e.proc.getDidCallProcessExit()?(e.timers.clearPending(),e.proc.getExitCode()):(await Oc(e.rpc,e.timers,e.bodyReads,e.proc),e.proc.getDidCallProcessExit()&&e.timers.clearPending(),await Dc(e.rpc,e.syncFs,e.writeStderr),e.proc.getDidCallProcessExit()||t===0?e.proc.getExitCode():t)}async function Dc(e,t,n){let r=t.getMutations();if(r.created.length||r.modified.length||r.deleted.length)try{await e.call(`vfs`,`flushWrites`,[r]),t.resetBaseline()}catch(e){let t=e instanceof Error?e.message:String(e);n(`[sync-fs] ERROR: flush failed — ${r.created.length+r.modified.length} write(s) + ${r.deleted.length} delete(s) were NOT persisted: ${t}\n`)}}async function Oc(e,t,n,r){for(await t.tick();!r.getDidCallProcessExit()&&(e.pendingCount>0||t.pendingCount>0||n.pendingCount>0);){let i=[];if(e.pendingCount>0&&i.push(e.waitForProgress()),t.pendingCount>0&&i.push(t.waitForProgress()),n.pendingCount>0&&i.push(n.waitForProgress()),i.length===0)break;await Promise.race(i),r.getDidCallProcessExit()||await t.tick()}}function kc(){let e=new Set,t=new Set;return{realmSide:{postMessage:e=>{queueMicrotask(()=>{for(let n of[...t])n({data:e})})},addEventListener:(t,n)=>{e.add(n)},removeEventListener:(t,n)=>{e.delete(n)}},hostSide:{postMessage:t=>{queueMicrotask(()=>{for(let n of[...e])n({data:t})})},addEventListener:(e,n)=>{t.add(n)},removeEventListener:(e,n)=>{t.delete(n)}}}}function Ac(){return async({kind:e})=>{if(e!==`js`)throw Error(`createInProcessJsRealmFactory: only kind:js is supported`);let{realmSide:t,hostSide:n}=kc(),r=e=>{if(e.data?.type!==`realm-init`)return;t.removeEventListener(`message`,r);let n=e.data;n.kind===`js`&&wc(n,t).catch(e=>{let n={type:`realm-error`,message:e instanceof Error?e.message:String(e)};t.postMessage(n)})};return t.addEventListener(`message`,r),{controlPort:n,terminate(){t.removeEventListener(`message`,r)}}}}function jc(){return async({kind:e})=>{if(e!==`py`)throw Error(`createInProcessPyRealmFactory: only kind:py is supported`);let{realmSide:t,hostSide:n}=kc(),r=e=>{if(e.data?.type!==`realm-init`)return;t.removeEventListener(`message`,r);let n=e.data;n.kind===`py`&&d(n,t).catch(e=>{let n={type:`realm-error`,message:e instanceof Error?e.message:String(e)};t.postMessage(n)})};return t.addEventListener(`message`,r),{controlPort:n,terminate(){t.removeEventListener(`message`,r)}}}}export{Ac as createInProcessJsRealmFactory,jc as createInProcessPyRealmFactory};
|
|
27
|
+
`)?a:`${a}\n`;t(n>0?`${` `.repeat(n)}${o}`:o)}function lo(e,t,n){let r=ro(n);if(e.has(r)){t(`Label '${r}' already exists for console.time()`);return}e.set(r,io())}function uo(e,t,n,r){let i=ro(r),a=e.get(i);if(a===void 0){t(`No such label '${i}' for console.timeEnd()`);return}e.delete(i),n(`${i}: ${ao(io()-a)}`)}function fo(e,t,n,r,i){let a=ro(r),o=e.get(a);if(o===void 0){t(`No such label '${a}' for console.timeLog()`);return}let s=`${a}: ${ao(io()-o)}`;i.length===0?n(s):n(s,...i)}function po(e,t,n){let r=ro(n),i=(e.get(r)??0)+1;e.set(r,i),t(`${r}: ${i}`)}function mo(e,t,n){let r=ro(n);if(!e.has(r)){t(`Count for '${r}' does not exist`);return}e.set(r,0)}function ho(e,t,n){n.length>0&&t(...n),e.depth+=1}function go(e){e.depth>0&&--e.depth}function _o(e,t){let n=new Map,r=new Map,i={depth:0},a=(...t)=>oo(e,i.depth,t),o=(...e)=>oo(t,i.depth,e),s=(...e)=>ho(i,a,e);return{log:a,info:a,debug:a,dirxml:a,table:a,warn:o,error:o,dir:(e,t)=>a(e),clear:()=>void 0,group:s,groupCollapsed:s,groupEnd:()=>go(i),assert:(e,...t)=>so(o,e,t),trace:(...e)=>co(o,t,i.depth,e),time:e=>lo(r,o,e),timeEnd:e=>uo(r,o,a,e),timeLog:(e,...t)=>fo(r,o,a,e,t),count:e=>po(n,a,e),countReset:e=>mo(n,o,e)}}function vo(e,t,n){let r=!!e.env?.NO_COLOR,i=!1,a,o,c=e=>{i=!0,o=e,a=e},l=bo(e.stdin??``,c),u=Ha(e.argv),d={write:t,end:()=>void 0,isTTY:!r},f={write:n,end:()=>void 0,isTTY:!r};return{processShim:{argv:u,env:e.env,versions:{node:s},version:`v${s}`,platform:`linux`,arch:`x64`,cwd:()=>e.cwd,get exitCode(){return a},set exitCode(e){a=eo(e)},exit:(...e)=>{if(e.length===0){let e=Xa(a);throw c(e),new Ya(e)}a=eo(e[0]);let t=Xa(a);throw c(t),new Ya(t)},stdin:l,stdout:d,stderr:f},getDidCallProcessExit:()=>i,getExitCode:()=>Xa(i?o:a),recordExit:c}}var yo=class extends $e.Stream{isTTY=!1;consumed=!1;flowScheduled=!1;paused=!1;buffer;onExit;constructor(e,t){super(),this.buffer=e,this.onExit=t}read(){return this.consumed?null:(this.consumed=!0,this.buffer.length>0?this.buffer:null)}toString(){return this.buffer}setEncoding(e){return this}pause(){return this.paused=!0,this}resume(){return this.paused=!1,this.scheduleFlow(),this}on(e,t){return super.on(e,t),e===`data`&&this.scheduleFlow(),this}addListener(e,t){return this.on(e,t)}once(e,t){return super.once(e,t),e===`data`&&this.scheduleFlow(),this}scheduleFlow(){this.flowScheduled||(this.flowScheduled=!0,queueMicrotask(()=>this.flush()))}flush(){if(this.paused){this.flowScheduled=!1;return}try{this.consumed||(this.consumed=!0,this.buffer.length>0&&this.emit(`data`,this.buffer)),this.readable=!1,this.emit(`end`),this.emit(`close`)}catch(e){if(e instanceof Ya){this.onExit(e.code);return}throw e}}[Symbol.asyncIterator](){return{next:async()=>this.consumed?{value:void 0,done:!0}:(this.consumed=!0,{value:this.buffer,done:!1})}}};function bo(e,t){return new yo(e,t)}function xo(e){if(e===``)return[];let t=e.split(`
|
|
28
|
+
`);return t[t.length-1]===``&&t.pop(),t.map(e=>e.endsWith(`\r`)?e.slice(0,-1):e)}function So(e){if(typeof e==`string`)return e;if(e&&typeof e.read==`function`){let t=e.read();return typeof t==`string`?t:``}return``}function Co(e){return new TextDecoder(`utf-8`).decode(re(e))}function wo(e){if(e&&typeof e.write==`function`)return e}var To=class extends qe{terminal=!1;lines;cursor=0;closed=!1;flushScheduled=!1;output;onExit;constructor(e,t,n){super(),this.lines=xo(Co(So(e))),this.output=t??n.output,this.onExit=n.onExit}on(e,t){return super.on(e,t),e===`line`&&this.scheduleFlush(),this}once(e,t){return super.once(e,t),e===`line`&&this.scheduleFlush(),this}pause(){return this}resume(){return this}close(){this.closed||(this.closed=!0,this.emit(`close`))}question(e,t,n){let r=typeof t==`function`?t:typeof n==`function`?n:void 0;this.output?.write(String(e));let i=this.cursor<this.lines.length?this.lines[this.cursor++]:``;if(r){queueMicrotask(()=>this.runHandler(()=>r(i)));return}return Promise.resolve(i)}[Symbol.asyncIterator](){return{next:async()=>!this.closed&&this.cursor<this.lines.length?{value:this.lines[this.cursor++],done:!1}:(this.close(),{value:void 0,done:!0})}}scheduleFlush(){this.flushScheduled||this.closed||(this.flushScheduled=!0,queueMicrotask(()=>this.flush()))}flush(){this.flushScheduled=!1,this.runHandler(()=>{for(;!this.closed&&this.cursor<this.lines.length;)this.emit(`line`,this.lines[this.cursor++]);this.close()})}runHandler(e){try{e()}catch(e){if(e instanceof Ya&&this.onExit){this.closed=!0,this.onExit(e.code);return}throw e}}};function Eo(e){let t=(t,n)=>{let r,i;if(t&&typeof t==`object`&&`input`in t){let e=t;r=e.input,i=wo(e.output)}else r=t,i=wo(n);if(r==null)throw TypeError(`readline.createInterface: an 'input' stream is required`);return new To(r,i,e)},n=(...e)=>{let t=e[e.length-1];return typeof t==`function`&&queueMicrotask(()=>t()),!0},r={createInterface:t,Interface:To,emitKeypressEvents:()=>void 0,cursorTo:n,moveCursor:n,clearLine:n,clearScreenDown:n};return{...r,promises:r}}var Do=class extends Error{status;statusText;url;body;constructor(e,t,n,r){let i=typeof r==`string`&&r?`: ${r.slice(0,200)}`:r&&typeof r==`object`?`: ${Oo(r).slice(0,200)}`:``;super(`HTTP ${e} ${t} ${n}${i}`),this.status=e,this.statusText=t,this.url=n,this.body=r,this.name=`HttpError`}};function Oo(e){try{return JSON.stringify(e)}catch{return String(e)}}function ko(e){return new Promise(t=>setTimeout(t,e))}function Ao(e,t){let n=[];for(let[e,r]of Object.entries(t))if(r!=null){if(Array.isArray(r))for(let t of r)t!=null&&n.push(`${encodeURIComponent(e)}=${encodeURIComponent(String(t))}`);else n.push(`${encodeURIComponent(e)}=${encodeURIComponent(String(r))}`)}return n.length===0?e:e+(e.includes(`?`)?`&`:`?`)+n.join(`&`)}function jo(e,t,n){let r;return r=/^[a-z][a-z0-9+.-]*:\/\//i.test(t)?t:e?`${e.endsWith(`/`)?e.slice(0,-1):e}${t.startsWith(`/`)?t:`/${t}`}`:t,n?Ao(r,n):r}function Mo(e,t){let n={};if(e)for(let[t,r]of Object.entries(e))n[t]=r;if(t)for(let[e,r]of Object.entries(t))n[e]=r;return n}function No(e){if(!e)return!1;let t=e.toLowerCase();return t.startsWith(`application/json`)||/[+/]json(;|$|\s)/.test(t)}function Po(e){if(!e)return null;let t=e.trim();if(!t)return null;if(/^\d+(\.\d+)?$/.test(t)){let e=Number(t);if(Number.isFinite(e)&&e>=0)return Math.round(e*1e3)}let n=Date.parse(t);if(Number.isFinite(n)){let e=n-Date.now();return e>0?e:0}return null}async function Fo(e){if(No(e.headers.get(`content-type`))){let t=await e.text();if(!t)return null;try{return JSON.parse(t)}catch{return t}}return e.text()}function Io(e,t){if(e!=null)return typeof e==`string`||e instanceof ArrayBuffer||ArrayBuffer.isView(e)||typeof Blob<`u`&&e instanceof Blob||typeof FormData<`u`&&e instanceof FormData||typeof URLSearchParams<`u`&&e instanceof URLSearchParams||typeof ReadableStream<`u`&&e instanceof ReadableStream?e:typeof e==`object`?(Object.keys(t).some(e=>e.toLowerCase()===`content-type`)||(t[`Content-Type`]=`application/json`),JSON.stringify(e)):String(e)}function Lo(e,t){return Object.keys(e).some(e=>e.toLowerCase()===t.toLowerCase())}async function Ro(e,t,n){let r=await t(n);r&&!Lo(e,`authorization`)&&(e.Authorization=`Bearer ${r}`)}function zo(e,t){if(!t)return{signal:e,clearTimeout:null};let n=new AbortController,r=setTimeout(()=>n.abort(Error(`timeout`)),t),i=()=>clearTimeout(r);return e?{signal:AbortSignal.any([e,n.signal]),clearTimeout:i}:{signal:n.signal,clearTimeout:i}}function Bo(e,t){return{body:t,headers:Object.fromEntries(e.headers.entries()),status:e.status}}async function Vo(e,t){let n=await Fo(e);return t?Bo(e,n):n}async function Ho(e,t){let n=await Fo(e).catch(()=>null);throw new Do(e.status,e.statusText,t,n)}function Uo(e,t){let n=Po(e.headers.get(`retry-after`));return n===null?500*2**t:n}async function Wo(e,t,n,r){let i=null;for(let a=0;a<e.maxAttempts;a++){let{signal:o,clearTimeout:s}=zo(r.signal,e.timeoutMs),c=o?{...n,signal:o}:n,l;try{l=await e.fetch(t,c)}finally{s?.()}if(i=l,l.ok)return Vo(l,r.raw);if(!(a+1<e.maxAttempts&&e.retryOn.has(l.status)))return Ho(l,t);await e.sleep(Uo(l,a))}if(i)return Ho(i,t);throw Error(`http: no attempts made for ${n.method??`GET`} ${t}`)}function Go(e){let t=e.sleep??ko;function n(n){let r=new Set(n.retry?.on??[]),i=Math.max(1,Math.trunc(n.retry?.maxAttempts??1));async function a(a,o,s={}){let c=jo(n.baseUrl,o,s.params),l=Mo(n.headers,s.headers);n.token&&await Ro(l,n.token,{method:a,path:o,url:c});let u=Io(s.body,l),d={method:a,headers:l};return u!==void 0&&(d.body=u),Wo({fetch:e.fetch,sleep:t,maxAttempts:i,retryOn:r,timeoutMs:n.timeoutMs},c,d,s)}return Object.freeze({get:((e,t)=>a(`GET`,e,t)),post:((e,t)=>a(`POST`,e,t)),put:((e,t)=>a(`PUT`,e,t)),patch:((e,t)=>a(`PATCH`,e,t)),delete:((e,t)=>a(`DELETE`,e,t))})}return Object.freeze({client:n})}function Ko(e){let t=new TextEncoder().encode(e),n=``;for(let e=0;e<t.length;e++)n+=String.fromCharCode(t[e]);return btoa(n)}function qo(e,t,n){let r=[];t.model&&r.push(`--model`,String(t.model)),t.thinking&&r.push(`--thinking`,String(t.thinking)),t.schema&&r.push(`--schema-b64`,Ko(JSON.stringify(t.schema))),t.readOnly!==void 0&&r.push(`--read-only`,Array.isArray(t.readOnly)?t.readOnly.join(`,`):String(t.readOnly));let i=t.cwd===void 0?n||`.`:String(t.cwd),a=t.allowedCommands===void 0?`*`:String(t.allowedCommands);return[`agent`,...r,i,a,String(e)]}function Jo(e,t){let n=t.cwd,r=async(t,r)=>{let i=r??{},a=await e.spawn(qo(t,i,n)),o=typeof a.exitCode==`number`?a.exitCode:0;return{finalText:String(a.stdout??``).replace(/\n+$/,``),exitCode:o,stderr:String(a.stderr??``).replace(/\n+$/,``)}},i=(async(e,t)=>{let n=t??{},i=await r(e,n);if(i.exitCode!==0)throw Error(`agent: exited with code ${i.exitCode}${i.stderr?`: ${i.stderr}`:``}`);if(n.schema)try{return JSON.parse(i.finalText)}catch{throw Error(`agent: schema response was not valid JSON (exit ${i.exitCode}): ${i.finalText.slice(0,200)}`)}return i.finalText});return i.spawn=r,i}function Q(e){if(typeof e==`string`)return e;if(e&&typeof e==`object`&&typeof e.targetId==`string`)return e.targetId;throw TypeError(`browser: expected a tab handle or targetId string`)}function Yo(e){function t(t){return{...t,async update(n){let r={};return n.urlMatch!==void 0&&(r.urlMatch=n.urlMatch===null?null:n.urlMatch instanceof RegExp?n.urlMatch.source:n.urlMatch),n.filter!==void 0&&(r.filter=n.filter),e.call(`browser`,`wsUpdate`,[t.id,r])},async close(){return e.call(`browser`,`wsClose`,[t.id])}}}return{on(n,r={}){let i=Q(n),a=r.urlMatch===void 0?void 0:r.urlMatch instanceof RegExp?r.urlMatch.source:r.urlMatch,o,s={filter(e){if(typeof e==`function`||typeof e==`string`)throw TypeError(`browser.websocket: filter must be a declarative JSON object, not a function or string`);return o=e,s},async forward(n){return t(await e.call(`browser`,`wsObserve`,[{targetId:i,urlMatch:a,filter:o,forward:n}]))}};return s},async list(){return e.call(`browser`,`wsList`,[])}}}async function Xo(e,t){if(!e&&!(t instanceof Request))return;let n=t instanceof Request?t:null,r=(e?.method??n?.method??`GET`).toUpperCase(),i={};if(e?.headers){if(e.headers instanceof Headers)e.headers.forEach((e,t)=>{i[t]=e});else if(Array.isArray(e.headers))for(let[t,n]of e.headers)i[t]=n;else Object.assign(i,e.headers)}else n&&n.headers.forEach((e,t)=>{i[t]=e});let a,o;if(r!==`GET`&&r!==`HEAD`&&e?.body!==void 0&&e?.body!==null&&e?.body!==``){let t=await Zo(e.body);a=t.body,o=t.defaultContentType}return o&&!Object.keys(i).some(e=>e.toLowerCase()===`content-type`)&&(i[`Content-Type`]=o),{method:r,headers:i,body:a}}async function Zo(e){if(typeof e==`string`)return{body:e};if(e instanceof URLSearchParams)return{body:e.toString(),defaultContentType:`application/x-www-form-urlencoded;charset=UTF-8`};if(e instanceof Blob)return{body:new Uint8Array(await e.arrayBuffer()),defaultContentType:e.type||`application/octet-stream`};if(e instanceof ArrayBuffer)return{body:new Uint8Array(e).slice(),defaultContentType:`application/octet-stream`};if(ArrayBuffer.isView(e))return{body:new Uint8Array(e.buffer,e.byteOffset,e.byteLength).slice(),defaultContentType:`application/octet-stream`};if(n(e)){let t=await r(e);return{body:t.bytes,defaultContentType:t.contentType}}throw typeof ReadableStream<`u`&&e instanceof ReadableStream?Error(`node fetch shim: ReadableStream request bodies are not supported (collect into a Uint8Array or string before calling fetch)`):Error(`node fetch shim: unsupported request body type (${Object.prototype.toString.call(e)}); use a string, Uint8Array, ArrayBuffer, Blob, FormData, or URLSearchParams`)}function Qo(e){return{findTab:t=>e.call(`browser`,`findTab`,[es(t)]),ensureTab:(t,n={})=>e.call(`browser`,`ensureTab`,[t,ts(n)]),openWindow:(t,n={})=>e.call(`browser`,`openWindow`,[t,n]),windowBounds:t=>e.call(`browser`,`windowBounds`,[Q(t)]),setWindowBounds:(t,n)=>e.call(`browser`,`setWindowBounds`,[Q(t),n]),eval:(t,n)=>e.call(`browser`,`eval`,[Q(t),$o(n,!1)]),evalAsync:(t,n)=>e.call(`browser`,`evalAsync`,[Q(t),$o(n,!0)]),cookie:(t,n)=>e.call(`browser`,`cookie`,[Q(t),n]),localStorage:(t,n)=>e.call(`browser`,`localStorage`,[Q(t),n]),fetch:(t,n,r={})=>E(n,r).then(n=>e.call(`browser`,`evalAsync`,[Q(t),n])),websocket:Yo(e)}}function $o(e,t){if(typeof e==`function`)return`(${e.toString()})()`;if(typeof e==`string`)return e;throw TypeError(`browser.eval/evalAsync: source must be a function or string`)}function es(e){let t={};return e.domain!==void 0&&(t.domain=e.domain),e.urlMatch!==void 0&&(t.urlMatch=e.urlMatch instanceof RegExp?e.urlMatch.source:e.urlMatch),t}function ts(e){return e.matchUrl===void 0?{}:{matchUrl:e.matchUrl instanceof RegExp?e.matchUrl.source:e.matchUrl}}function ns(e){return{register(t){let n=null,r=e.onEvent(`computer-call`,r=>{let i=r;i.id===t.id&&is(e,t,i,{getStop:()=>n,setStop:e=>{n=e}})}),i=rs(t);return e.call(`computer`,`register`,[i]).catch(()=>{}),()=>{n?.(),n=null,r(),e.call(`computer`,`unregister`,[t.id]).catch(()=>{})}}}}function rs(e){return{id:e.id,kind:`jsh`,title:e.title??e.id,size:e.size??null,state:`live`,capabilities:e.capabilities,pid:null,...e.softKeys?{softKeys:e.softKeys}:{}}}async function is(e,t,n,r){let i;try{i=await as(e,t,n,r)}catch(e){i={error:e instanceof Error?e.message:String(e)}}try{await e.call(`computer`,`reply`,[n.requestId,i])}catch{}}async function as(e,t,n,r){switch(n.op){case`screenshot`:return t.screenshot(n.args[0]??{format:`jpeg`});case`text`:return t.text?t.text():null;case`input`:return await t.input(n.args[0]??[]),{ok:!0};case`exec`:if(!t.exec)throw Error(`exec is not supported`);return t.exec(String(n.args[0]??``));case`subscribe`:return os(e,t,Number(n.args[0])||2,Number(n.args[1])||void 0,r);case`unsubscribe`:return r.getStop()?.(),r.setStop(null),{ok:!0};default:{let e=n.op;throw Error(`unknown computer op '${String(e)}'`)}}}function os(e,t,n,r,i){if(i.getStop()?.(),!t.subscribe)throw Error(`subscribe is not supported`);let a=t.subscribe(n,n=>{e.call(`computer`,`frame`,[t.id,n]).catch(()=>{})},r);return i.setStop(()=>{try{a()}catch{}}),{ok:!0}}function ss(e){return e===`SIGKILL`?137:e===`SIGINT`?130:143}function cs(e,t,n,r){let i=async()=>{if(!t?.wasUsed())return;let n=t.getMutations();if(n.created.length||n.modified.length||n.deleted.length)try{await e.call(`vfs`,`flushWrites`,[n])}catch(e){let t=e instanceof Error?e.message:String(e);console.error(`[realm-exec] pre-exec sync-fs flush failed (will retry at exit): ${t}`);return}t.resetBaseline()},a=async(i=!1)=>{if(t?.wasUsed())try{let r=await e.call(`vfs`,`snapshot`,[n]);i?t.applySnapshotPreservingMutations(r):t.applySnapshot(r)}catch(e){let t=e instanceof Error?e.message:String(e);r?.(`[sync-fs] re-snapshot after exec failed: ${t}\n`)}},o=async t=>{await i();try{return await e.call(`exec`,`run`,[t])}finally{await a()}},s=async t=>{await i();try{return await e.call(`exec`,`spawn`,[t])}finally{await a()}},c=1,l=Object.assign(o,{spawn:s,start:(t,n)=>{let r=c++,o=[],s=!1,l=!1,u=!1,d,f,p=new Promise((e,t)=>{d=e,f=t}),m=()=>{if(s||u||l)return;l=!0;let c=o.length>0?o.join(``):n?.stdin,p={};c!==void 0&&(p.stdin=c),n?.stdinKind!==void 0&&(p.stdinKind=n.stdinKind),n?.args!==void 0&&(p.args=n.args),n?.cwd!==void 0&&(p.cwd=n.cwd),n?.env!==void 0&&(p.env=n.env),(async()=>{try{if(await i(),u){await a(!0);return}s=!0;let n=await e.call(`exec`,`start`,[r,t,p]);await a(!0),d(n)}catch(e){await a(!0),f(e)}})()};return{kill:t=>s?e.call(`exec`,`kill`,[r,t]):(u=!0,d({stdout:``,stderr:``,exitCode:ss(t)}),Promise.resolve(!0)),stdin:{write:e=>{!s&&!u&&o.push(e)},end:()=>m()},done:p}}});return l.exec=l,l}const ls=new Set([204,205,304]),us=new Set([`content-encoding`,`transfer-encoding`,`content-length`]);function ds(e,t){let n=fs(e.body),r=ps(e.headers),i=ls.has(e.status)||n.byteLength===0,a=new Response(i?null:n,{status:e.status,statusText:e.statusText,headers:r});try{Object.defineProperty(a,"url",{value:e.url||t,writable:!1,configurable:!0,enumerable:!1})}catch{}return hs(a,n),a}function fs(e){return e.byteLength===0?new Uint8Array:e.slice()}function ps(e){let t=new Headers;for(let[n,r]of Object.entries(e))if(!us.has(n.toLowerCase()))try{t.set(n,r)}catch{}return t}const ms=Symbol(`slicc.realmBufferedBody`);function hs(e,t){if(ms in e)return;Object.defineProperty(e,ms,{value:!0,configurable:!0});let n=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),`bodyUsed`),r=!1,i=()=>{if(r)throw TypeError(`Failed to read response body: body already used`);return r=!0,gs(e),t},a=async()=>new TextDecoder().decode(i()),o=e=>e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);Object.defineProperties(e,{bodyUsed:{configurable:!0,enumerable:!1,get(){return r?!0:n?.get?!!n.get.call(e):!1}},text:{value:a,configurable:!0},json:{value:async()=>JSON.parse(await a()),configurable:!0},arrayBuffer:{value:async()=>o(i()),configurable:!0},blob:{value:async()=>new Blob([o(i())]),configurable:!0},bytes:{value:async()=>i(),configurable:!0}})}function gs(e){try{let t=e.body;t&&!t.locked&&t.getReader()}catch{}}function _s(e){if(e instanceof Uint8Array)return e;if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(e instanceof ArrayBuffer)return new Uint8Array(e);throw TypeError(`expected an ArrayBuffer or typed array`)}function vs(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function ys(e){return e==null?[]:Array.isArray(e)?e:[e]}function bs(e,t){let n=t.handle,r=new Set,i=new Set,a=!1,o=null,s=e=>{let t=e;if(!t||t.handle!==n)return;let i={reportId:t.reportId,data:vs(t.bytes)};for(let e of[...r])try{e(i)}catch{}},c=()=>{a||(a=!0,o=e.onEvent?e.onEvent(`hid-input-report`,s):null,e.call(`hid`,`subscribeInputReports`,[n]).catch(()=>{a=!1,o?.(),o=null}))},l=()=>{!a||r.size>0||(a=!1,o?.(),o=null,e.call(`hid`,`unsubscribeInputReports`,[n]).catch(()=>{}))};return{...t,open:()=>e.call(`hid`,`open`,[n]),close:()=>e.call(`hid`,`close`,[n]),sendReport:(t,r)=>e.call(`hid`,`sendReport`,[n,t,_s(r)]),sendFeatureReport:(t,r)=>e.call(`hid`,`sendFeatureReport`,[n,t,_s(r)]),receiveFeatureReport:async t=>vs((await e.call(`hid`,`receiveFeatureReport`,[n,t])).bytes),addEventListener(e,t){if(e===`inputreport`)r.add(t),c();else if(e===`disconnect`)i.add(t);else throw TypeError(`hid device: unknown event type '${String(e)}'`)},removeEventListener(e,t){e===`inputreport`?(r.delete(t),l()):e===`disconnect`&&i.delete(t)},onInputReport(e){r.add(e),c()}}}function xs(e){return{list:async()=>(await e.call(`hid`,`list`,[])).map(t=>bs(e,t)),request:async t=>{let n=(await e.call(`hid`,`request`,[ys(t)]))[0];if(!n)throw Error(`No device selected.`);return bs(e,n)}}}function Ss(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}var Cs=class{rpc;targetId;selector;index;constructor(e,t,n,r){this.rpc=e,this.targetId=t,this.selector=n,this.index=r}evalOnElement(e){let t=`(() => { const els = document.querySelectorAll(${JSON.stringify(this.selector)}); const el = els[${this.index}]; ${e} })()`;return this.rpc.call(`browser`,`evalAsync`,[this.targetId,t])}async textContent(){return this.evalOnElement(`return el ? el.textContent : null;`)}async getAttribute(e){return this.evalOnElement(`return el ? el.getAttribute(${JSON.stringify(e)}) : null;`)}async isVisible(){return this.evalOnElement(`if (!el) return false; const s = getComputedStyle(el); if (s.display === 'none' || s.visibility === 'hidden' || s.opacity === '0') return false; const r = el.getBoundingClientRect(); return r.width > 0 && r.height > 0;`)}async boundingBox(){return this.evalOnElement(`if (!el) return null; const r = el.getBoundingClientRect(); return { x: r.x, y: r.y, width: r.width, height: r.height };`)}},ws=class{rpc;targetId;onClose;closed=!1;constructor(e,t,n){this.rpc=e,this.targetId=t,this.onClose=n}async goto(e,t){await this.rpc.call(`browser`,`navigateTab`,[this.targetId,e])}async waitForLoadState(e){await this.rpc.call(`browser`,`waitForLoadState`,[this.targetId,e??`load`])}async waitForTimeout(e){await new Promise(t=>setTimeout(t,e))}async evaluate(e,...t){let n=typeof e==`string`?e:`(${e.toString()}).apply(null, JSON.parse(${JSON.stringify(JSON.stringify(t))}))`;return this.rpc.call(`browser`,`evalAsync`,[this.targetId,n])}async screenshot(e){let t={};e?.fullPage!==void 0&&(t.fullPage=e.fullPage);let n=Ss(await this.rpc.call(`browser`,`screenshotTab`,[this.targetId,t]));return e?.path&&await this.rpc.call(`vfs`,`writeFileBinary`,[e.path,n]),n}async $(e){return await this.rpc.call(`browser`,`evalAsync`,[this.targetId,`!!document.querySelector(${JSON.stringify(e)})`])?new Cs(this.rpc,this.targetId,e,0):null}async $$(e){let t=await this.rpc.call(`browser`,`evalAsync`,[this.targetId,`document.querySelectorAll(${JSON.stringify(e)}).length`]),n=[];for(let r=0;r<t;r++)n.push(new Cs(this.rpc,this.targetId,e,r));return n}async $$eval(e,t,...n){if(typeof t==`string`)return this.rpc.call(`browser`,`evalAsync`,[this.targetId,t]);let r=`(${t.toString()}).apply(null, [Array.from(document.querySelectorAll(${JSON.stringify(e)}))].concat(JSON.parse(${JSON.stringify(JSON.stringify(n))})))`;return this.rpc.call(`browser`,`evalAsync`,[this.targetId,r])}async content(){return this.rpc.call(`browser`,`evalAsync`,[this.targetId,`document.documentElement.outerHTML`])}async setViewportSize(e){await this.rpc.call(`browser`,`setViewport`,[this.targetId,e.width,e.height])}async close(){this.closed||(this.closed=!0,await this.rpc.call(`browser`,`closeTab`,[this.targetId]),this.onClose?.())}},Ts=class{rpc;openPages=[];constructor(e){this.rpc=e}async newPage(e){let t=await this.rpc.call(`browser`,`createTab`,[`about:blank`]);e?.viewport&&await this.rpc.call(`browser`,`setViewport`,[t,e.viewport.width,e.viewport.height]);let n=new ws(this.rpc,t,()=>{let e=this.openPages.indexOf(n);e!==-1&&this.openPages.splice(e,1)});return this.openPages.push(n),n}pages(){return[...this.openPages]}async close(){let e=this.openPages.splice(0,this.openPages.length);for(let t of e)await t.close()}},Es=class{rpc;openPages=[];openContexts=[];constructor(e){this.rpc=e}async newPage(e){let t=await this.rpc.call(`browser`,`createTab`,[`about:blank`]);e?.viewport&&await this.rpc.call(`browser`,`setViewport`,[t,e.viewport.width,e.viewport.height]);let n=new ws(this.rpc,t,()=>{let e=this.openPages.indexOf(n);e!==-1&&this.openPages.splice(e,1)});return this.openPages.push(n),n}async newContext(e){let t=new Ts(this.rpc);return this.openContexts.push(t),t}contexts(){return[...this.openContexts]}async close(){let e=this.openPages.splice(0,this.openPages.length);for(let t of e)await t.close();let t=this.openContexts.splice(0,this.openContexts.length);for(let e of t)await e.close()}};function Ds(e){let t=async t=>new Es(e),n=async(t,n)=>new Es(e);return{chromium:{launch:t,connect:n,connectOverCDP:n},firefox:{launch:t,connect:n},webkit:{launch:t,connect:n}}}function Os(e){return{...e,time:qa,fmt:Fe,pool:Ua}}function ks(e,t){return e?.startsWith(`/`)?Ja(e):t}function As(e){return e.includes(`require`)||e.includes(`import`)||/(?:^|[;\n}])\s*export\b/.test(e)}async function js(e,t,n,r){return As(t)?e.call(`module`,`buildGraph`,[t,ks(r,n),r]):{files:[],entryMap:{},edges:{},edgeErrors:{},errors:{}}}function Ms(e){if(typeof e!=`object`||!e)return;let t=e;if(t.__esModule&&!Object.prototype.hasOwnProperty.call(t,`default`)&&Object.isExtensible(t))try{Object.defineProperty(t,"default",{value:t,enumerable:!1,configurable:!0})}catch{}}function Ns(e){return{playwright:Ds(e)}}function Ps(e){let{graph:t,fsBridge:n,processShim:r,childProcess:i,nodeConsole:a,sliccyModules:o,shimmedPackages:s={},nodeReadline:l,nodeOsModule:d=xn,nodeUtilModule:p=_t}=e,m=new Map(t.files.map(e=>[e.path,e.cjsSource])),h=new Map(t.files.map(e=>[e.path,e.kind])),g=new Map,_=gn({requireFrom:(e,t)=>T(e,t),resolveFrom:(e,t)=>w(e,t)}),v=nn(()=>{let e=r?.cwd?.();return typeof e==`string`&&e.length>0?e:`/`}),b=e=>{if(typeof e==`string`&&e.startsWith(`sliccy:`))return{hit:!0,value:Ls(e,o)};let t=e.startsWith(`node:`)?e.slice(5):e,a=Fs(t,{fsBridge:n,processShim:r,childProcess:i,nodeOsModule:d,nodeUtilModule:p,nodePathModule:v,nodeReadline:l,nodeModule:_});if(a.hit)return a;if(y.has(t))throw f(e,t);if(u.has(t))throw zs(e,t);return t in s?{hit:!0,value:s[t]}:{hit:!1}},x=(e,n,r)=>{let i=b(n);if(i.hit)return i.value;let a=e?.[n];if(a)return S(a);let o=r===null?t.errors[n]:t.edgeErrors?.[r]?.[n];throw o?Error(o):Is(n)};function S(e){let n=g.get(e);if(n)return n.exports;let i=m.get(e);if(i===void 0)throw Error(`Cannot find module '${e}'`);let o={exports:{}};g.set(e,o);let s=n=>x(t.edges[e],n,e),c=Ja(e);return Function(`module`,`exports`,`require`,`__dirname`,`__filename`,`process`,`console`,`Buffer`,`global`,i)(o,o.exports,s,c,e,r,a,globalThis.Buffer,globalThis),h.get(e)===`cjs`&&Ms(o.exports),o.exports}function C(e){return m.has(e)}function w(e,n){if(c(n))return n;let r=t.edges[e]?.[n];if(r)return r;let i=Ja(e);if(hn(n)){let e=pn(i,n,C);if(e)return e}else{let e=mn(i,n,C);if(e)return e}let a=t.edgeErrors?.[e]?.[n];throw a?Error(a):Is(n)}function T(e,t){let n=b(t);return n.hit?n.value:S(w(e,t))}return{require:e=>x(t.entryMap,e,null)}}function Fs(e,t){let{fsBridge:n,processShim:r,childProcess:i,nodeOsModule:a,nodeUtilModule:o,nodePathModule:s,nodeReadline:c,nodeModule:l}=t;return e===`fs`||e===`fs/promises`?{hit:!0,value:n}:e===`path`?{hit:!0,value:s}:e===`crypto`?{hit:!0,value:Wt}:e===`child_process`?{hit:!0,value:i}:e===`process`?{hit:!0,value:r}:e===`buffer`?{hit:!0,value:{Buffer:globalThis.Buffer}}:e===`assert`?{hit:!0,value:Ge}:e===`assert/strict`?{hit:!0,value:We}:e===`util`?{hit:!0,value:o}:e===`events`?{hit:!0,value:Je}:e===`os`?{hit:!0,value:a}:e===`tty`?{hit:!0,value:Sn}:e===`stream`?{hit:!0,value:$e}:e===`url`?{hit:!0,value:sn}:e===`zlib`?{hit:!0,value:Ba}:e===`readline`&&c?{hit:!0,value:c}:e===`readline/promises`&&c?{hit:!0,value:c.promises}:e===`module`&&l?{hit:!0,value:l}:{hit:!1}}function Is(e){if(e.startsWith(`.`)||e.startsWith(`/`)||e.startsWith(`node:`))return Error(`Cannot find module '${e}'`);let t=e.startsWith(`@`)?e.split(`/`).slice(0,2).join(`/`):e.split(`/`)[0];return Error(`Cannot find module '${e}' (run: ipk install ${t})`)}function Ls(e,t){let n=e.slice(7);if(n===``)throw Error(`require('sliccy:'): empty sliccy: module name`);if(!Object.prototype.hasOwnProperty.call(t,n))throw Error(`require('${e}'): unknown sliccy: module '${n}'. Known names: ${Object.keys(t).sort().join(`, `)}`);return t[n]}const Rs={http:` Use fetch() instead.`,https:` Use fetch() instead.`,crypto:` Use globalThis.crypto (Web Crypto API) instead.`};function zs(e,t){return Error(`require('${e}'): Node built-in '${t}' is not available in the browser environment.${Rs[t]||``}`)}async function Bs(e,t,n,r){let i=Object.keys(t),a=i.map(e=>t[e]),o=Object.getPrototypeOf(async function(){}).constructor,s=new o(...i,`${r?`"use strict";
|
|
29
|
+
`:``}${e}`);try{return await s(...a),0}catch(e){return e instanceof Ya?e.code:(n(`${e instanceof Error?e.stack??e.message:String(e)}\n`),1)}}function Vs(e,t){let n=t.handle;return{...t,open:t=>e.call(`serial`,`open`,[n,t]),close:()=>e.call(`serial`,`close`,[n]),read:(t={})=>e.call(`serial`,`read`,[n,{maxBytes:t.maxBytes??t.bytes,until:t.until?_s(t.until):void 0,timeoutMs:t.timeoutMs}]),write:t=>e.call(`serial`,`write`,[n,_s(t)]),getSignals:()=>e.call(`serial`,`getSignals`,[n]),setSignals:t=>e.call(`serial`,`setSignals`,[n,t])}}function Hs(e){return{list:async()=>(await e.call(`serial`,`list`,[])).map(t=>Vs(e,t)),request:async t=>Vs(e,await e.call(`serial`,`request`,[ys(t)]))}}function Us(e=globalThis,t){let n=e.setTimeout,r=e.clearTimeout,i=e.setInterval,a=e.clearInterval,o=n.bind(e),s=r.bind(e),c=i.bind(e),l=a.bind(e),u=new Set,d=new Set,f=new Set,p=!1,m=()=>{if(f.size===0)return;let e=[...f];f.clear();for(let t of e)t()},h=e=>{if(e==null)return!1;let t=u.delete(e),n=d.delete(e);return t||n},g=(e,n)=>{try{e(...n)}catch(e){if(t?.onCallbackError?.(e),!t?.onCallbackError)throw e}finally{m()}};return{get pendingCount(){return u.size+d.size},install(){p||(p=!0,e.setTimeout=((e,t,...n)=>{if(typeof e!=`function`)return o(e,t,...n);let r=o(()=>{u.delete(r),g(e,n)},t);return u.add(r),r}),e.clearTimeout=(e=>{let t=h(e);s(e),t&&m()}),e.setInterval=((e,t,...n)=>{if(typeof e!=`function`)return c(e,t,...n);let r=c(()=>{g(e,n)},t);return d.add(r),r}),e.clearInterval=(e=>{let t=h(e);l(e),t&&m()}))},restore(){p&&(p=!1,e.setTimeout=n,e.clearTimeout=r,e.setInterval=i,e.clearInterval=a)},clearPending(){for(let e of u)s(e);u.clear();for(let e of d)l(e);d.clear(),m()},tick(){return new Promise(e=>{o(e,0)})},waitForProgress(){return u.size+d.size===0?Promise.resolve():new Promise(e=>{f.add(e)})}}}function Ws(e,t){let n=t.handle,r=e=>({status:e.status,data:vs(e.bytes)}),i=new Set,a=new Set,o=!1,s=null,c=e=>{let t=e;if(!t||t.handle!==n)return;let r=t.type===`disconnect`?i:a;for(let e of[...r])try{e(t)}catch{}},l=()=>{o||(o=!0,s=e.onEvent?e.onEvent(`usb-claim-event`,c):null,e.call(`usb`,`subscribeClaimEvents`,[n]).catch(()=>{o=!1,s?.(),s=null}))},u=()=>{!o||i.size>0||a.size>0||(o=!1,s?.(),s=null,e.call(`usb`,`unsubscribeClaimEvents`,[n]).catch(()=>{}))};return{...t,open:()=>e.call(`usb`,`open`,[n]),close:t=>e.call(`usb`,`close`,t?.force?[n,{force:!0}]:[n]),reset:t=>e.call(`usb`,`reset`,t?.force?[n,{force:!0}]:[n]),clearHalt:(t,r)=>e.call(`usb`,`clearHalt`,[n,t,r]),selectConfiguration:t=>e.call(`usb`,`selectConfig`,[n,t]),claimInterface:(t,r)=>e.call(`usb`,`claim`,r?.wait?[n,t,{wait:!0}]:[n,t]),releaseInterface:t=>e.call(`usb`,`release`,[n,t]),controlTransferIn:async(t,i)=>r(await e.call(`usb`,`controlIn`,[n,t,i])),controlTransferOut:(t,r)=>e.call(`usb`,`controlOut`,[n,t,_s(r)]),transferIn:async(t,i)=>r(await e.call(`usb`,`transferIn`,[n,t,i])),transferOut:(t,r)=>e.call(`usb`,`transferOut`,[n,t,_s(r)]),addEventListener(e,t){if(e===`disconnect`)i.add(t);else if(e===`claim-lost`)a.add(t);else throw TypeError(`usb device: unknown event type '${String(e)}'`);l()},removeEventListener(e,t){e===`disconnect`?i.delete(t):e===`claim-lost`&&a.delete(t),u()}}}function Gs(e){return{list:async()=>(await e.call(`usb`,`list`,[])).map(t=>Ws(e,t)),request:async t=>Ws(e,await e.call(`usb`,`request`,[ys(t)]))}}function Ks(e){if(!e)return``;let t=e.lastIndexOf(`/`);return t<0?``:t===0?`/`:e.substring(0,t)}function qs(e){if(!e)return e;let t=e.startsWith(`/`),n=e.split(`/`).filter(e=>e.length>0),r=n.indexOf(`scripts`);if(r<0)return e;let i=n.slice(0,r);return i.length===0?t?`/`:``:(t?`/`:``)+i.join(`/`)}function Js(e){return/^[A-Za-z0-9_\-./:@]+$/.test(e)?e:`'`+e.replace(/'/g,`'\\''`)+`'`}function Ys(e,t){return e===``?t:e===`/`?`/${t}`:`${e}/${t}`}function Xs(e){let t=Ks(e.argv[1]??``),n=qs(t),r=Ys(n,`references`),i=Ys(n,`assets`),a=Ys(t,`.config`);async function o(){let t;try{t=await e.fs.exists(a)}catch{return null}if(!t)return null;let n;try{n=await e.fs.readFile(a)}catch{return null}let r=typeof n==`string`?n:String(n);if(!r.trim())return null;let i;try{i=JSON.parse(r)}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`skill.config(): failed to parse ${a}: ${t}`)}if(i&&typeof i==`object`&&!Array.isArray(i))return i;throw Error(`skill.config(): ${a} must contain a JSON object`)}async function s(t){let n=await o();if(t===void 0)return n;if(typeof t!=`object`||!t||Array.isArray(t))throw TypeError(`skill.config(updates): updates must be a plain object`);let r={...n??{},...t};return await e.fs.writeFile(a,JSON.stringify(r,null,2)+`
|
|
30
|
+
`),r}async function c(t){if(typeof t!=`string`||!t.trim())throw TypeError(`skill.token(providerId): providerId must be a non-empty string`);let n=`oauth-token ${Js(t)}`,{stdout:r,stderr:i,exitCode:a}=await e.exec(n);if(a!==0){let e=i.trim()||`oauth-token exited with code ${a}`;throw Error(`skill.token('${t}'): ${e}`)}return r.replace(/\r?\n+$/,``)}return Object.freeze({dir:t,root:n,refs:r,assets:i,config:s,token:c})}function $(e,t){return Object.assign(Error(`${e}: ${t}`),{code:e})}function Zs(e){let t=$s(e);if(ec(t))return new Uint8Array(t.response);if(t.status>=200&&t.status<300)throw $(`EIO`,e.label);tc(t,e.label)}function Qs(e){let t=Zs(e);try{return JSON.parse(new TextDecoder().decode(t))}catch{throw $(`EIO`,e.label)}}function $s(e){let t=new XMLHttpRequest;try{t.open(e.method,e.url,!1),t.responseType=`arraybuffer`,t.timeout=e.timeoutMs,t.setRequestHeader(m,e.token),e.body?t.send(new Uint8Array(e.body)):t.send()}catch{throw $(`EIO`,e.label)}return t}function ec(e){return e.status>=200&&e.status<300&&e.getResponseHeader(`x-slicc-fs`)===`1`}function tc(e,t){throw $(e.getResponseHeader(`x-slicc-fs`)===`1`&&e.getResponseHeader(`x-slicc-fs-errno`)||`EIO`,t)}function nc(e){return(t,n,r)=>{let i=Qs({method:`POST`,url:_,token:e,body:new TextEncoder().encode(JSON.stringify({...t,channel:g})),timeoutMs:n+h,label:r});if(!i||typeof i.stdout!=`string`||typeof i.stderr!=`string`||typeof i.exitCode!=`number`)throw $(`EIO`,r);return{stdout:i.stdout,stderr:i.stderr,exitCode:i.exitCode}}}function rc(e,t){let n=e.getMutations();for(let e of n.deleted)t.rm(e);for(let e of n.created)e.isDirectory?t.mkdir(e.path):t.writeFile(e.path,e.content);for(let e of n.modified)t.writeFile(e.path,e.content);e.resetBaseline()}function ic(e,t={}){let n=t.timeoutMs??12e4,{syncFs:r,fsBridge:i}=t,a=t.transport??nc(e);return{run(e,t={}){let o=r?.wasUsed()===!0&&i!==void 0;o&&rc(r,i);let s=`sync-exec bridge, '${Array.isArray(e)?e.join(` `):e}'`,c=b(t.timeout,n),l={command:e,...t.args===void 0?{}:{args:t.args},...t.input===void 0?{}:{stdin:t.input},...t.cwd===void 0?{}:{cwd:t.cwd},...t.env===void 0?{}:{env:t.env},timeoutMs:c};try{return a(l,c,s)}finally{o&&r.invalidate()}}}}function ac(e,t){return $(e,`sync-fs bridge, '${t}'`)}function oc(e,t){let n=e.startsWith(`/`)?e:`/${e}`,r=w+n.split(`/`).map(encodeURIComponent).join(`/`);return t?`${r}?op=${t}`:r}function sc(e,t={}){let n=t.timeoutMs??3e4;function r(t,r,i,a){return{method:t,url:oc(r,a),token:e,...i?{body:i}:{},timeoutMs:n,label:`sync-fs bridge, '${r}'`}}return{readFile(e){return Zs(r(`GET`,e))},writeFile(e,t){Zs(r(`POST`,e,t))},stat(e){let t=Qs(r(`GET`,e,void 0,`stat`));if(!t||typeof t.isFile!=`boolean`||typeof t.isDirectory!=`boolean`||typeof t.size!=`number`)throw ac(`EIO`,e);return{isFile:t.isFile,isDirectory:t.isDirectory,isSymbolicLink:t.isSymbolicLink,size:t.size}},lstat(e){let t=Qs(r(`GET`,e,void 0,`lstat`));if(!t||typeof t.isFile!=`boolean`||typeof t.isDirectory!=`boolean`||typeof t.size!=`number`)throw ac(`EIO`,e);return{isFile:t.isFile,isDirectory:t.isDirectory,isSymbolicLink:t.isSymbolicLink,size:t.size}},readdir(e){let t=Qs(r(`GET`,e,void 0,`readdir`));if(!Array.isArray(t)||!t.every(e=>typeof e==`string`))throw ac(`EIO`,e);return t},exists(e){let t=Qs(r(`GET`,e,void 0,`exists`));if(typeof t!=`boolean`)throw ac(`EIO`,e);return t},mkdir(e){Zs(r(`POST`,e,void 0,`mkdir`))},rm(e){Zs(r(`POST`,e,void 0,`rm`))}}}function cc(e,t,n={}){let{header:r,window:i}=C(e),a=n.wait??((e,t,n,r)=>Atomics.wait(e,t,n,r)),o=n.now??(()=>performance.now()),s=0;function c(e,t,n){for(;;){let i=t-o();if(i<=0)throw $(`ETIMEDOUT`,n);if(a(r,0,1,i),Atomics.load(r,0)===2&&Atomics.load(r,1)===e)return;Atomics.load(r,0)===2&&Atomics.store(r,0,1)}}return{call(e,n,a){let l=++s,u=o()+n,d=null,f=0,p=0;try{for(;;){Atomics.store(r,0,1);let n=p===0?{type:S,id:l,req:e}:{type:x,id:l,offset:p};try{t.postMessage(n)}catch{throw $(`EIO`,a)}c(l,u,a);let o=Atomics.load(r,3),s=Atomics.load(r,4);if(Atomics.load(r,5)!==p||s<0||o<0||p+s>o)throw $(`EIO`,a);if(d===null&&(f=Atomics.load(r,2),d=new Uint8Array(o)),d.set(i.subarray(0,s),p),p+=s,p>=o)break;if(s===0)throw $(`EIO`,a)}}finally{Atomics.store(r,0,0)}return v(f,d)}}}function lc(e,t){return $(e,`sync-sab bridge, '${t}'`)}function uc(e){let t=e;return!!t&&typeof t.isFile==`boolean`&&typeof t.isDirectory==`boolean`&&typeof t.size==`number`}function dc(e,t={}){let n=t.timeoutMs??25e3;function r(t,r){let i=e.call(t,n,`sync-sab bridge, '${r}'`);if(!i.ok)throw lc(i.errno,r);return i}function i(e,t){let n=r(e,t);if(n.ok&&n.kind===`bytes`)return n.bytes;throw lc(`EIO`,t)}function a(e,t){let n=r(e,t);if(n.ok&&n.kind===`json`)return n.json;throw lc(`EIO`,t)}return{readFile:e=>i({op:`read`,path:e},e),writeFile:(e,t)=>{r({op:`write`,path:e,body:t},e)},stat:e=>{let t=a({op:`stat`,path:e},e);if(!uc(t))throw lc(`EIO`,e);return t},lstat:e=>{let t=a({op:`lstat`,path:e},e);if(!uc(t))throw lc(`EIO`,e);return t},readdir:e=>{let t=a({op:`readdir`,path:e},e);if(!Array.isArray(t)||!t.every(e=>typeof e==`string`))throw lc(`EIO`,e);return t},exists:e=>{let t=a({op:`exists`,path:e},e);if(typeof t!=`boolean`)throw lc(`EIO`,e);return t},mkdir:e=>{r({op:`mkdir`,path:e},e)},rm:e=>{r({op:`rm`,path:e},e)}}}function fc(e){return(t,n,r)=>{let i=e.call({...t,channel:g},n+h,r);if(!i.ok)throw $(i.errno,r);let a=i.kind===`json`?i.json:null;if(!a||typeof a.stdout!=`string`||typeof a.stderr!=`string`||typeof a.exitCode!=`number`)throw $(`EIO`,r);return{stdout:a.stdout,stderr:a.stderr,exitCode:a.exitCode}}}const pc=65536;function mc(e,t){if(!t)return e;let n=e+t;return n.length<=pc?n:n.slice(n.length-pc)}async function hc(e,t,n){let r;try{r=await e.call(`vfs`,`snapshot`,[t])}catch(e){n?.(e instanceof Error?e.message:String(e)),r={entries:[]}}return new te(r)}function gc(e,t){if(e.syncFsToken)return e=>t(`[sync-fs] snapshot failed, sync metadata will be incomplete: ${e}\n`)}function _c(e,t){return t?dc(t):e.syncFsToken?sc(e.syncFsToken):void 0}function vc(e,t){if(!(!e.syncSab||typeof Atomics>`u`||typeof Atomics.wait!=`function`))return cc(e.syncSab,t)}function yc(e,t,n,r,i){let a=vc(e,t),o=_c(e,a);if(Object.assign(r,Ce(n,e.cwd,o,i,{write:(e,n)=>{t.postMessage({type:`realm-fs-write`,path:e,bytes:n})},delete:e=>{t.postMessage({type:`realm-fs-delete`,path:e})}})),e.syncFsToken)return ic(e.syncFsToken,{syncFs:n,...o?{fsBridge:o}:{},...a?{transport:fc(a)}:{}})}function bc(e=globalThis){Object.prototype.hasOwnProperty.call(e,`SLICC_VERSION`)||Object.defineProperty(e,"SLICC_VERSION",{value:i().version,writable:!1,enumerable:!1,configurable:!1})}function xc(e,t,n){let r=Te({isTTY:!e,noColor:e});return{colorApi:r,cliApi:we({writeStdout:t,writeStderr:n,exit:e=>{throw new Ya(e)},color:r})}}function Sc(e,t,n){return{readStdinBytes:()=>re(e.stdin??``),writeStdout:t,writeStderr:n}}function Cc(e){return{usbBridge:Gs(e),serialBridge:Hs(e),hidBridge:xs(e),computerBridge:ns(e)}}async function wc(e,t){let n=e.captureOutput!==!1,r={stdout:``,stderr:``},i=(e,i)=>{let a=typeof i==`string`?i:String(i);e===`stdout`?r.stdout=n?r.stdout+a:mc(r.stdout,a):r.stderr=n?r.stderr+a:mc(r.stderr,a),t.postMessage({type:`realm-output`,stream:e,chunk:a})},a=e=>{i(`stdout`,e)},o=e=>{i(`stderr`,e)},s=_o(a,o),c=vo(e,a,o),{colorApi:l,cliApi:u}=xc(!!e.env?.NO_COLOR,a,o),d=new p(t),f=Sc(e,a,o),m=he(d,E,f),h=await hc(d,e.cwd,gc(e,o)),g=yc(e,t,h,m,f),_=cs(d,h,e.cwd,o),v=Jo(_,{cwd:e.cwd}),y=Xs({argv:e.argv,fs:m,exec:_}),b=Qo(d),{usbBridge:x,serialBridge:S,hidBridge:C,computerBridge:w}=Cc(d),T=Go({fetch:E});async function E(e,t){let n=e instanceof Request?e.url:e instanceof URL?e.toString():String(e);return ds(await d.call(`fetch`,`request`,[n,await Xo(t,e)]),n)}let D=Os({exec:_,agent:v,skill:y,http:T,browser:b,usb:x,serial:S,hid:C,computer:w,cli:u,color:l}),O=e.filename,k=Ja(O),A=await js(d,e.code,e.cwd,O),ee=Ps({graph:A,fsBridge:m,processShim:c.processShim,childProcess:kt(_,g),nodeConsole:s,sliccyModules:D,shimmedPackages:Ns(d),nodeReadline:Eo({output:{write:a},onExit:c.recordExit}),nodeOsModule:bn(e.env),nodeUtilModule:gt(e=>o(`${e}\n`))}).require,te={exports:{},filename:e.filename},ne=A.entrySource!==void 0;await Tc({entryCode:A.entrySource??e.code,isEsmEntry:ne,filename:O,dirname:k,proc:c,nodeConsole:s,requireShim:ee,moduleShim:te,realmFetch:E,writeStderr:o,rpc:d,syncFs:h,output:r,port:t})}async function Tc(e){let t=globalThis;bc(),t.__slicc_compileWasm=t=>e.rpc.call(`wasm`,`compile`,[t]);let n=Us(globalThis,{onCallbackError(e){if(!(e instanceof Ya))throw e}}),{createBodyReadHandleTracker:r}=await import(`./realm-body-handles-DtLxL_rB.js`),i=r(globalThis);n.install(),i.install();try{let r=await Ec({entryCode:e.entryCode,bridges:{process:e.proc.processShim,console:e.nodeConsole,require:e.requireShim,module:e.moduleShim,exports:e.moduleShim.exports,fetch:e.realmFetch,__dirname:e.dirname,__filename:e.filename},writeStderr:e.writeStderr,isEsmEntry:e.isEsmEntry,rpc:e.rpc,syncFs:e.syncFs,proc:e.proc,timers:n,bodyReads:i});delete t.__slicc_compileWasm,e.rpc.dispose(),e.port.postMessage({type:`realm-done`,stdout:e.output.stdout,stderr:e.output.stderr,exitCode:r})}finally{n.clearPending(),n.restore(),i.restore()}}async function Ec(e){let t=await Bs(e.entryCode,e.bridges,e.writeStderr,e.isEsmEntry);return await Dc(e.rpc,e.syncFs,e.writeStderr),e.proc.getDidCallProcessExit()?(e.timers.clearPending(),e.proc.getExitCode()):(await Oc(e.rpc,e.timers,e.bodyReads,e.proc),e.proc.getDidCallProcessExit()&&e.timers.clearPending(),await Dc(e.rpc,e.syncFs,e.writeStderr),e.proc.getDidCallProcessExit()||t===0?e.proc.getExitCode():t)}async function Dc(e,t,n){let r=t.getMutations();if(r.created.length||r.modified.length||r.deleted.length)try{await e.call(`vfs`,`flushWrites`,[r]),t.resetBaseline()}catch(e){let t=e instanceof Error?e.message:String(e);n(`[sync-fs] ERROR: flush failed — ${r.created.length+r.modified.length} write(s) + ${r.deleted.length} delete(s) were NOT persisted: ${t}\n`)}}async function Oc(e,t,n,r){for(await t.tick();!r.getDidCallProcessExit()&&(e.pendingCount>0||t.pendingCount>0||n.pendingCount>0);){let i=[];if(e.pendingCount>0&&i.push(e.waitForProgress()),t.pendingCount>0&&i.push(t.waitForProgress()),n.pendingCount>0&&i.push(n.waitForProgress()),i.length===0)break;await Promise.race(i),r.getDidCallProcessExit()||await t.tick()}}function kc(){let e=new Set,t=new Set;return{realmSide:{postMessage:e=>{queueMicrotask(()=>{for(let n of[...t])n({data:e})})},addEventListener:(t,n)=>{e.add(n)},removeEventListener:(t,n)=>{e.delete(n)}},hostSide:{postMessage:t=>{queueMicrotask(()=>{for(let n of[...e])n({data:t})})},addEventListener:(e,n)=>{t.add(n)},removeEventListener:(e,n)=>{t.delete(n)}}}}function Ac(){return async({kind:e})=>{if(e!==`js`)throw Error(`createInProcessJsRealmFactory: only kind:js is supported`);let{realmSide:t,hostSide:n}=kc(),r=e=>{if(e.data?.type!==`realm-init`)return;t.removeEventListener(`message`,r);let n=e.data;n.kind===`js`&&wc(n,t).catch(e=>{let n={type:`realm-error`,message:e instanceof Error?e.message:String(e)};t.postMessage(n)})};return t.addEventListener(`message`,r),{controlPort:n,terminate(){t.removeEventListener(`message`,r)}}}}function jc(){return async({kind:e})=>{if(e!==`py`)throw Error(`createInProcessPyRealmFactory: only kind:py is supported`);let{realmSide:t,hostSide:n}=kc(),r=e=>{if(e.data?.type!==`realm-init`)return;t.removeEventListener(`message`,r);let n=e.data;n.kind===`py`&&d(n,t).catch(e=>{let n={type:`realm-error`,message:e instanceof Error?e.message:String(e)};t.postMessage(n)})};return t.addEventListener(`message`,r),{controlPort:n,terminate(){t.removeEventListener(`message`,r)}}}}export{Ac as createInProcessJsRealmFactory,jc as createInProcessPyRealmFactory};
|