sliccy 5.73.3 → 5.74.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 +1 -0
- package/dist/node-server/_shared/index.d.ts +2 -0
- package/dist/node-server/_shared/index.d.ts.map +1 -1
- package/dist/node-server/_shared/index.js +2 -0
- package/dist/node-server/_shared/index.js.map +1 -1
- package/dist/node-server/_shared/secrets-pipeline.d.ts +22 -0
- package/dist/node-server/_shared/secrets-pipeline.d.ts.map +1 -1
- package/dist/node-server/_shared/secrets-pipeline.js +50 -0
- package/dist/node-server/_shared/secrets-pipeline.js.map +1 -1
- package/dist/node-server/_shared/transcript-export.d.ts +161 -0
- package/dist/node-server/_shared/transcript-export.d.ts.map +1 -0
- package/dist/node-server/_shared/transcript-export.js +804 -0
- package/dist/node-server/_shared/transcript-export.js.map +1 -0
- package/dist/node-server/_shared/transcript-redaction.d.ts +25 -0
- package/dist/node-server/_shared/transcript-redaction.d.ts.map +1 -0
- package/dist/node-server/_shared/transcript-redaction.js +107 -0
- package/dist/node-server/_shared/transcript-redaction.js.map +1 -0
- package/dist/node-server/_shared/tray-sync-protocol.d.ts +56 -1
- package/dist/node-server/_shared/tray-sync-protocol.d.ts.map +1 -1
- package/dist/node-server/_shared/tray-sync-protocol.js +1 -1
- package/dist/node-server/_shared/tray-sync-protocol.js.map +1 -1
- package/dist/node-server/routes/secrets.js +52 -22
- package/dist/ui/assets/account-store-CJqBAm1f.js +43 -0
- package/dist/ui/assets/account-store-CxSwSaS8.js +101 -0
- package/dist/ui/assets/{adobe-lCsH7Lwq.js → adobe-j3AP8U12.js} +2 -2
- package/dist/ui/assets/{adobe-ufabHIuG.js → adobe-lvezht3s.js} +1 -1
- package/dist/ui/assets/anthropic-messages-BFic5zKY.js +39 -0
- package/dist/ui/assets/anthropic-messages-C8dDJE2X.js +39 -0
- package/dist/ui/assets/{apps-Cz0oexXD.js → apps-D8IGKFP6.js} +1 -1
- package/dist/ui/assets/{azure-openai-DjIwn0QF.js → azure-openai-BD60xdeq.js} +1 -1
- package/dist/ui/assets/{azure-openai-CMEdXGgc.js → azure-openai-DyqeeHYG.js} +1 -1
- package/dist/ui/assets/azure-openai-responses-B_twhN44.js +1 -0
- package/dist/ui/assets/azure-openai-responses-CzG7X9qb.js +1 -0
- package/dist/ui/assets/bedrock-camp-BO4bvAKs.js +1 -0
- package/dist/ui/assets/{bedrock-camp-PMQ4Iu6f.js → bedrock-camp-CVignIdH.js} +1 -1
- package/dist/ui/assets/{bridge-launch-params-jegYRGJ6.js → bridge-launch-params-QY3l_LbM.js} +1 -1
- package/dist/ui/assets/{cdp-7evcrxxP.js → cdp-D9eDDEuA.js} +1 -1
- package/dist/ui/assets/{cerebras-VrdMK4Tc.js → cerebras-B0L70LLb.js} +1 -1
- package/dist/ui/assets/{cerebras-BvFtCskg.js → cerebras-Di6jTcHx.js} +1 -1
- package/dist/ui/assets/{client-BliYDaDA.js → client-BxYB_ioq.js} +1 -1
- package/dist/ui/assets/compat-aVSWLlYQ.js +2 -0
- package/dist/ui/assets/{composer-speech-BSy_wbJC.js → composer-speech-FeteaFpi.js} +1 -1
- package/dist/ui/assets/{connect-surface-ETqeSANr.js → connect-surface-CAwJVqDK.js} +1 -1
- package/dist/ui/assets/constrained-sampling-DafcjXU6.js +1 -0
- package/dist/ui/assets/{context-compaction-CW5AQ9bv.js → context-compaction-_UkD06XB.js} +1 -1
- package/dist/ui/assets/{discovery-preference-CUhsI-AU.js → discovery-preference-C0L_79z7.js} +1 -1
- package/dist/ui/assets/{ensure-speech-assets-8cWrra0n.js → ensure-speech-assets-DGq5bX3t.js} +1 -1
- package/dist/ui/assets/export-provider-B6K_eHX_.js +1 -0
- package/dist/ui/assets/export-spool-DCxGPg43.js +1 -0
- package/dist/ui/assets/{follower-navigate-watcher-UN0jo7Ge.js → follower-navigate-watcher-DgusZOpY.js} +1 -1
- package/dist/ui/assets/{fs-CgX9Ebib.js → fs-BI3-y-dt.js} +2 -2
- package/dist/ui/assets/{fs-C5GhaBCZ.js → fs-DUi6CyVs.js} +1 -1
- package/dist/ui/assets/{github-DMFLbpJz.js → github-CsLyOpIY.js} +1 -1
- package/dist/ui/assets/{github-B85TuvhV.js → github-DdtaZi7X.js} +2 -2
- package/dist/ui/assets/{github-copilot-kOORCU_n.js → github-copilot-B3YCnypU.js} +1 -1
- package/dist/ui/assets/{github-copilot-CXnNPGCI.js → github-copilot-CLH7n3QY.js} +1 -1
- package/dist/ui/assets/google-generative-ai-4YtIu_sJ.js +1 -0
- package/dist/ui/assets/google-generative-ai-DzD1vsXe.js +1 -0
- package/dist/ui/assets/google-shared-BAKd3aSn.js +371 -0
- package/dist/ui/assets/google-shared-CCLlnqMF.js +11 -0
- package/dist/ui/assets/google-vertex-8lUayXF0.js +1 -0
- package/dist/ui/assets/google-vertex-oQOD3HKr.js +1 -0
- package/dist/ui/assets/{handoff-link-CfgH86mb.js → handoff-link-Dmaaww5x.js} +1 -1
- package/dist/ui/assets/{hear-B5lURJtR.js → hear-CRBq5mEX.js} +1 -1
- package/dist/ui/assets/{hear-DI5vlKdf.js → hear-v5qXSZw8.js} +1 -1
- package/dist/ui/assets/{kernel-worker-HuBcjkoV.js → kernel-worker-BL7ADt6y.js} +727 -599
- package/dist/ui/assets/{kokoro-engine-DX7VicqD.js → kokoro-engine-CogHLlSk.js} +1 -1
- package/dist/ui/assets/{legacy-api-aliases-CRTuRAqQ.js → legacy-api-aliases-IllWZ-uu.js} +1 -1
- package/dist/ui/assets/{legacy-api-aliases-CdGTJw-r.js → legacy-api-aliases-sqlB2uHc.js} +1 -1
- package/dist/ui/assets/{lick-manager-Ct3WOtut.js → lick-manager-wU1FKkH8.js} +1 -1
- package/dist/ui/assets/{lick-ws-bridge-D5zKuunw.js → lick-ws-bridge-CFKIh9aE.js} +1 -1
- package/dist/ui/assets/lick-ws-bridge-yMljNHwr.js +1 -0
- package/dist/ui/assets/{local-llm-DuNuGkgI.js → local-llm-BdGGSRtU.js} +2 -2
- package/dist/ui/assets/{local-llm-qHC_HYck.js → local-llm-Cys4QAHg.js} +1 -1
- package/dist/ui/assets/main-BZzNeGKC.js +22 -0
- package/dist/ui/assets/main-cherry-D_hgi0by.js +1 -0
- package/dist/ui/assets/mistral-conversations-C57IiFrP.js +8 -0
- package/dist/ui/assets/mistral-conversations-CzEm7KNl.js +7 -0
- package/dist/ui/assets/{mount-Dh0O4orp.js → mount-Dk-I5R7K.js} +1 -1
- package/dist/ui/assets/{mount-CpyDRxP6.js → mount-GBkZgZPI.js} +2 -2
- package/dist/ui/assets/{mount-bridge-client-DHGevTQu.js → mount-bridge-client-BWPRzAQ5.js} +1 -1
- package/dist/ui/assets/{mount-recovery-D687TLZv.js → mount-recovery-DO04oIYN.js} +1 -1
- package/dist/ui/assets/{navigation-watcher-BoJS9hdc.js → navigation-watcher-DkN9hU8i.js} +1 -1
- package/dist/ui/assets/new-session-DDu0IRGc.js +2 -0
- package/dist/ui/assets/oauth-bootstrap-DfSYlub_.js +2 -0
- package/dist/ui/assets/{oauth-service-foejPYvF.js → oauth-service-BuEH8BXq.js} +1 -1
- package/dist/ui/assets/{oauth-service-lE9AyywH.js → oauth-service-Dk3L2UWh.js} +1 -1
- package/dist/ui/assets/{openai-codex-jK5ybbFx.js → openai-codex-DuyyDpZA.js} +1 -1
- package/dist/ui/assets/openai-codex-responses-DRR6raXn.js +7 -0
- package/dist/ui/assets/openai-codex-responses-DU5CHdDQ.js +7 -0
- package/dist/ui/assets/openai-codex-rpYkFAL8.js +1 -0
- package/dist/ui/assets/openai-completions-B9S6450Q.js +5 -0
- package/dist/ui/assets/openai-completions-DhKgaAgM.js +5 -0
- package/dist/ui/assets/openai-responses-C4_jiYtu.js +1 -0
- package/dist/ui/assets/openai-responses-DmKhLxzV.js +1 -0
- package/dist/ui/assets/openai-responses-shared-CiIL52L-.js +10 -0
- package/dist/ui/assets/openai-responses-shared-IJFiSqdz.js +10 -0
- package/dist/ui/assets/{openrouter-C_pGnoz1.js → openrouter-BcPlZu_G.js} +1 -1
- package/dist/ui/assets/{openrouter-DVFBhELg.js → openrouter-DHTAGWtd.js} +1 -1
- package/dist/ui/assets/openrouter-images-6_MxZkJZ.js +1 -0
- package/dist/ui/assets/openrouter-images-BixC5B6a.js +1 -0
- package/dist/ui/assets/{openrouter-models-DM9v24kQ.js → openrouter-models-Bu1Cy5AD.js} +1 -1
- package/dist/ui/assets/{openrouter-models-B8MWxzTa.js → openrouter-models-CfnkMx5-.js} +1 -1
- package/dist/ui/assets/{openrouter-oauth-CukjxICV.js → openrouter-oauth-CTIG_xj5.js} +1 -1
- package/dist/ui/assets/{openrouter-oauth-DdKdfU0P.js → openrouter-oauth-iVwMGpbk.js} +1 -1
- package/dist/ui/assets/openrouter.models-DS1_VkCm.js +1 -0
- package/dist/ui/assets/openrouter.models-HnnH-abS.js +1 -0
- package/dist/ui/assets/page-follower-tray-M061L6UY.js +5 -0
- package/dist/ui/assets/{panel-rpc-handlers-UyWgyt3z.js → panel-rpc-handlers-CkC-CpDZ.js} +2 -2
- package/dist/ui/assets/{port-bridge-client-CoFZLSYm.js → port-bridge-client-DdolH4cw.js} +1 -1
- package/dist/ui/assets/{port-bridge-client-BC810skI.js → port-bridge-client-f_6YKEkm.js} +1 -1
- package/dist/ui/assets/{provider-B4WqwJf8.js → provider-Db5o_XYj.js} +2 -2
- package/dist/ui/assets/{provider-C-y-cI9Y.js → provider-DiWogq8f.js} +1 -1
- package/dist/ui/assets/provider-retry-C8PJzY_l.js +1 -0
- package/dist/ui/assets/{provider-settings-C5o54NBg.js → provider-settings-CSt8YEx4.js} +1 -1
- package/dist/ui/assets/provider-settings-DnRChWz9.js +2 -0
- package/dist/ui/assets/provider-store-access-Bo--BwLf.js +1 -0
- package/dist/ui/assets/{provider-store-access-B-0tnW1p.js → provider-store-access-DQypuwRG.js} +2 -2
- package/dist/ui/assets/{providers-BVNM94x0.js → providers-Bchg39l1.js} +1 -1
- package/dist/ui/assets/providers-DpzUvgPJ.js +2 -0
- package/dist/ui/assets/{proxied-fetch-D5h5REZy.js → proxied-fetch-CfcFb0B0.js} +1 -1
- package/dist/ui/assets/{proxied-fetch-ldIfAeIb.js → proxied-fetch-D8ebvbVd.js} +1 -1
- package/dist/ui/assets/quick-llm-CuKruUki.js +1 -0
- package/dist/ui/assets/{remote-cdp-transport-DOoXIxy3.js → remote-cdp-transport-Dmg2NdTA.js} +1 -1
- package/dist/ui/assets/{runtime-mode-BVHOImD_.js → runtime-mode-B8Tqab3Z.js} +1 -1
- package/dist/ui/assets/runtime-mode-BweZnYql.js +1 -0
- package/dist/ui/assets/{secret-env-dQA8rL_1.js → secret-env-Cn-GSA1R.js} +1 -1
- package/dist/ui/assets/{secret-topology-CptRwAX3.js → secret-topology-Baeul5rD.js} +1 -1
- package/dist/ui/assets/{secrets-bridge-client-D6nwnBvr.js → secrets-bridge-client-CLRo0NLf.js} +1 -1
- package/dist/ui/assets/session-freezer-DGs88nTW.js +21 -0
- package/dist/ui/assets/session-store-DQztDoVa.js +1 -0
- package/dist/ui/assets/setup-standalone-prelude-DJUR-Jx-.js +2 -0
- package/dist/ui/assets/setup-sudo-Cc-d6eO1.js +2 -0
- package/dist/ui/assets/sha256-DmK25X5D.js +1 -0
- package/dist/ui/assets/{silent-renew-backoff-DyzFsWYC.js → silent-renew-backoff-Chq7fPuc.js} +1 -1
- package/dist/ui/assets/{silent-renew-backoff-Dzkpjjro.js → silent-renew-backoff-CqD4WRin.js} +1 -1
- package/dist/ui/assets/{skills-XOQZdId1.js → skills-gGjRrQeq.js} +1 -1
- package/dist/ui/assets/{speak-aEIq7SEP.js → speak-DZhfxcQp.js} +1 -1
- package/dist/ui/assets/{speak-B4wyr-p6.js → speak-wEvzUJ_4.js} +1 -1
- package/dist/ui/assets/{sprinkle-manager-354rS3Fe.js → sprinkle-manager-BYlc7AHg.js} +1 -1
- package/dist/ui/assets/src-BcePBv4G.js +1 -0
- package/dist/ui/assets/src-C9oNvq2b2.js +2 -0
- package/dist/ui/assets/src-DoFhVmQT.js +1 -0
- package/dist/ui/assets/{store-BifrdU3S.js → store-ByY8CO32.js} +1 -1
- package/dist/ui/assets/{sudo-CdCTvp3_.js → sudo-DsN_KTcg.js} +1 -1
- package/dist/ui/assets/{telemetry-C8rZr13D.js → telemetry-Dxrv_mDE.js} +1 -1
- package/dist/ui/assets/{transformers-env-DZtq7i0I.js → transformers-env-Cr03eE3X.js} +1 -1
- package/dist/ui/assets/{transformers-env-CeJN6XlP.js → transformers-env-DKadceXA.js} +1 -1
- package/dist/ui/assets/{tray-leader-DicSB8Dn.js → tray-leader-BDMuV-1a.js} +1 -1
- package/dist/ui/assets/{tray-leave-runtime-BI5IM82V.js → tray-leave-runtime-DuZ41JQ-.js} +1 -1
- package/dist/ui/assets/{tray-runtime-config-DquE2Rx9.js → tray-runtime-config-9kTxza5l.js} +1 -1
- package/dist/ui/assets/{tray-runtime-config-8-BCHO27.js → tray-runtime-config-GgP0BHji.js} +1 -1
- package/dist/ui/assets/{tray-sync-protocol-CVdiCvfU.js → tray-sync-protocol-CxWJ329c.js} +1 -1
- package/dist/ui/assets/{upgrade-detection-B3uBpES8.js → upgrade-detection-BjD6M6tx.js} +1 -1
- package/dist/ui/assets/{voice-reply-6cMxpz9H.js → voice-reply-CkYr1oSF.js} +1 -1
- package/dist/ui/assets/{wc-attach-DU0svqb7.js → wc-attach-CYMk5mBA.js} +1 -1
- package/dist/ui/assets/wc-extension-WOxllVQv.js +2 -0
- package/dist/ui/assets/{wc-float-label-2tniyRvt.js → wc-float-label-yV3hzRXJ.js} +1 -1
- package/dist/ui/assets/wc-follower-CqNUhals.js +17 -0
- package/dist/ui/assets/wc-live-DN4iNS1F.js +8 -0
- package/dist/ui/assets/wc-nav-DdL1jc0a.js +2 -0
- package/dist/ui/assets/{wc-onboarding-DMsV9vuN.js → wc-onboarding-Bzxu5Ii4.js} +2 -2
- package/dist/ui/assets/{wc-placeholder-CNOsszW8.js → wc-placeholder-5zeCfEVA.js} +2 -2
- package/dist/ui/assets/{wc-settings-QlugO7SB.js → wc-settings-CrG7sAlG.js} +3 -3
- package/dist/ui/assets/{wc-shell-DZD-3K-u.js → wc-shell-DL44I68b.js} +3 -3
- package/dist/ui/assets/{wc-sprinkles-D38PuO87.js → wc-sprinkles-D52GEpi0.js} +2 -2
- package/dist/ui/assets/wc-transcript-export-5Pmfejur.js +2 -0
- package/dist/ui/assets/wc-tray-jp0YtxQG.js +2 -0
- package/dist/ui/assets/{whisper-engine-G1YfvaDM.js → whisper-engine-CHKYCaAu.js} +1 -1
- package/dist/ui/assets/{whisper-session-Ds5v74N9.js → whisper-session-W-6_Qa-h.js} +2 -2
- package/dist/ui/assets/{xai-grok-BujeRcN4.js → xai-grok-BuiKJ83J.js} +1 -1
- package/dist/ui/assets/xai-grok-BxZVhpe_.js +1 -0
- package/dist/ui/index.html +20 -18
- package/dist/ui/llm-proxy-sw.js +1 -1
- package/dist/ui/packages/webapp/index.html +20 -18
- package/package.json +1 -1
- package/dist/ui/assets/account-store-Dz-pna2J.js +0 -38
- package/dist/ui/assets/account-store-yyyfGfoQ.js +0 -94
- package/dist/ui/assets/amazon-bedrock-Cg62P8pR.json +0 -1
- package/dist/ui/assets/anthropic-4_qTN2Mu.json +0 -1
- package/dist/ui/assets/anthropic-messages-6XWFkWWy.js +0 -39
- package/dist/ui/assets/anthropic-messages-D42B1WVl.js +0 -39
- package/dist/ui/assets/azure-openai-responses-BvEv9lZE.js +0 -1
- package/dist/ui/assets/azure-openai-responses-DE9sINqp.json +0 -1
- package/dist/ui/assets/azure-openai-responses-DRSA640t.js +0 -1
- package/dist/ui/assets/bedrock-camp-D_7EbOFH.js +0 -1
- package/dist/ui/assets/cloudflare-ai-gateway-DDb7hKDm.json +0 -1
- package/dist/ui/assets/cloudflare-workers-ai-hYVOS3es.json +0 -1
- package/dist/ui/assets/compat-Spvv5tCW.js +0 -2
- package/dist/ui/assets/fireworks-B7kEGNCU.json +0 -1
- package/dist/ui/assets/github-copilot-K9C_HNHm.json +0 -1
- package/dist/ui/assets/google-F4XgvJ1y.json +0 -1
- package/dist/ui/assets/google-generative-ai-BqEHWDKc.js +0 -1
- package/dist/ui/assets/google-generative-ai-DOAY2Bef.js +0 -1
- package/dist/ui/assets/google-shared-2WQG4pNx.js +0 -11
- package/dist/ui/assets/google-shared-CGD-JGZx.js +0 -371
- package/dist/ui/assets/google-vertex-C-dQj0iH.js +0 -1
- package/dist/ui/assets/google-vertex-CiTExP0E.js +0 -1
- package/dist/ui/assets/huggingface-BjNadu0v.json +0 -1
- package/dist/ui/assets/lick-ws-bridge-BX-cBxCM.js +0 -1
- package/dist/ui/assets/main-BwSf9XOe.js +0 -22
- package/dist/ui/assets/main-cherry-9qp2ecC4.js +0 -1
- package/dist/ui/assets/mistral-CLEcIOtP.json +0 -1
- package/dist/ui/assets/mistral-conversations-BIHTMTfL.js +0 -7
- package/dist/ui/assets/mistral-conversations-CFKNSaPt.js +0 -8
- package/dist/ui/assets/moonshotai-8QShYhhE.json +0 -1
- package/dist/ui/assets/moonshotai-cn-7hHZff5z.json +0 -1
- package/dist/ui/assets/new-session-EfIhjpHZ.js +0 -2
- package/dist/ui/assets/nvidia-dA6GzUPm.json +0 -1
- package/dist/ui/assets/oauth-bootstrap-DFYztLmR.js +0 -2
- package/dist/ui/assets/openai-BehvdaXx.json +0 -1
- package/dist/ui/assets/openai-codex-XS4icMCX.js +0 -1
- package/dist/ui/assets/openai-codex-responses-B7cFMjWk.js +0 -7
- package/dist/ui/assets/openai-codex-responses-DqxoDEwc.js +0 -7
- package/dist/ui/assets/openai-completions-Z1aRkqWe.js +0 -5
- package/dist/ui/assets/openai-completions-o78dOizF.js +0 -5
- package/dist/ui/assets/openai-responses-SPfzkTJm.js +0 -1
- package/dist/ui/assets/openai-responses-shared-BHsJFKuB.js +0 -10
- package/dist/ui/assets/openai-responses-shared-Dg5Ojqlw.js +0 -10
- package/dist/ui/assets/openai-responses-xSdsW9lw.js +0 -1
- package/dist/ui/assets/opencode-4chvZrBR.json +0 -1
- package/dist/ui/assets/opencode-go-Chp1OOUx.json +0 -1
- package/dist/ui/assets/openrouter-ZLTwKIjA.json +0 -1
- package/dist/ui/assets/openrouter-images-BrQDTa3_.js +0 -1
- package/dist/ui/assets/openrouter-images-DtvjLeGK.js +0 -1
- package/dist/ui/assets/openrouter.models-Bi9GV7Zn.js +0 -1
- package/dist/ui/assets/openrouter.models-D41M1z_D.js +0 -1
- package/dist/ui/assets/page-follower-tray-Cm9cuA-m.js +0 -5
- package/dist/ui/assets/provider-settings-Bf4riFFt.js +0 -2
- package/dist/ui/assets/provider-store-access-DQ3Xz22u.js +0 -1
- package/dist/ui/assets/providers-BZHUuJkX.js +0 -2
- package/dist/ui/assets/quick-llm-CTddYx3-.js +0 -1
- package/dist/ui/assets/qwen-token-plan-BpxmzamU.json +0 -1
- package/dist/ui/assets/qwen-token-plan-cn-CPhDR0u_.json +0 -1
- package/dist/ui/assets/session-freezer-CVXiE5lj.js +0 -21
- package/dist/ui/assets/session-store-DAM8GRJ0.js +0 -1
- package/dist/ui/assets/setup-sudo-C8hl5UHa.js +0 -2
- package/dist/ui/assets/src-CS5gSDhT.js +0 -1
- package/dist/ui/assets/src-Dk1QVJRd.js +0 -1
- package/dist/ui/assets/together-CYZ-lBBF.json +0 -1
- package/dist/ui/assets/vercel-ai-gateway-ZtkcQH_C.json +0 -1
- package/dist/ui/assets/wc-extension-Dnbc6pqX.js +0 -2
- package/dist/ui/assets/wc-follower-DgOR4hQ4.js +0 -17
- package/dist/ui/assets/wc-live-DZ6Z4ggE.js +0 -8
- package/dist/ui/assets/wc-nav-CpXNlZRT.js +0 -2
- package/dist/ui/assets/wc-tray-MAH8ntv2.js +0 -2
- package/dist/ui/assets/xai-grok-CgCHECRn.js +0 -1
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/oauth-service-Dk3L2UWh.js","assets/preload-helper-Czpn1I53.js","assets/proxied-fetch-CfcFb0B0.js","assets/rolldown-runtime-aKtaBQYM.js","assets/base64-DpPqYZJF.js","assets/src-DoFhVmQT.js","assets/runtime-env-DH4NDw4t.js","assets/fetch-body-D2PwksUW.js","assets/panel-rpc-DmJSNs0I.js","assets/wc-permissions-registry-Blyunq37.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{n as e,t}from"./rolldown-runtime-aKtaBQYM.js";import{t as n}from"./preload-helper-Czpn1I53.js";import{i as r,n as i,r as a}from"./compat-aVSWLlYQ.js";import"./context-compaction-_UkD06XB.js";import{t as o}from"./logger-DDBAeTLF.js";import"./src-DoFhVmQT.js";import{o as s,t as c}from"./proxied-fetch-CfcFb0B0.js";import{t as l}from"./secret-topology-Baeul5rD.js";import{t as u}from"./secrets-bridge-client-CLRo0NLf.js";import"./tool-ui-DfXu6quJ.js";import{n as d,o as f,t as p}from"./providers-DpzUvgPJ.js";import{n as m,t as h}from"./panel-rpc-DmJSNs0I.js";import{r as g,t as _}from"./bedrock-camp-CVignIdH.js";var v={assign:0,create:0,clone:0,discard:0,update:0};function y(e){return Array.isArray(e)}function b(e){return S(e,null)}function x(e){return S(typeof e,`object`)&&!b(e)}function S(e,t){return e===t}function ee(e){return S(e,`__proto__`)||S(e,`constructor`)||S(e,`prototype`)}function te(e,t){return ee(t)?Object.prototype.hasOwnProperty.call(e,t):t in e}function ne(e){return Object.getOwnPropertyNames(e)}function re(e){return x(e)&&te(e,`~guard`)}function ie(e){return e}function ae(e){return e.map(e=>ce(e))}function oe(e){let t={},n=Object.getOwnPropertyDescriptors(e);for(let e of Object.keys(n)){let r=n[e];te(r,`value`)&&Object.defineProperty(t,e,{...r,value:ce(r.value)})}return t}function C(e){return new RegExp(e.source,e.flags)}function se(e){return e}function ce(e){return e instanceof RegExp?C(e):re(e)?ie(e):y(e)?ae(e):x(e)?oe(e):se(e)}function le(e){return v.clone+=1,ce(e)}var ue={immutableTypes:!1,maxErrors:8,useAcceleration:!0,exactOptionalPropertyTypes:!1,enumerableKind:!1,correctiveParse:!1};function de(){return ue}function fe(e,t){for(let n of Object.keys(t))Object.defineProperty(e,n,{configurable:!0,writable:!0,enumerable:!1,value:t[n]});return e}function pe(e,t){return{...e,...t}}function me(e,t,n={}){v.create+=1;let r=de(),i=pe(t,n),a=r.enumerableKind?pe(i,e):fe(i,e);return r.immutableTypes?Object.freeze(a):a}function he(e,t,n){v.update+=1;let r=de(),i=le(e);for(let e of Object.keys(t))Object.defineProperty(i,e,{configurable:!0,writable:!0,enumerable:r.enumerableKind,value:t[e]});for(let e of Object.keys(n))Object.defineProperty(i,e,{configurable:!0,enumerable:!0,writable:!0,value:n[e]});return i}function ge(e){return x(e)}function _e(e){return he(e,{"~optional":!0},{})}function ve(e){return _e(e)}function ye(e){return ge(e)&&te(e,`~optional`)}function be(e,t){return me({"~kind":`Array`},{type:`array`,items:e},t)}function xe(e){return ne(e).filter(t=>!ye(e[t]))}function Se(e,t={}){let n=xe(e);return me({"~kind":`Object`},{type:`object`,...n.length>0?{required:n}:{},properties:e},t)}var Ce;(function(e){e[e.Array=0]=`Array`,e[e.BigInt=1]=`BigInt`,e[e.Boolean=2]=`Boolean`,e[e.Date=3]=`Date`,e[e.Constructor=4]=`Constructor`,e[e.Function=5]=`Function`,e[e.Null=6]=`Null`,e[e.Number=7]=`Number`,e[e.Object=8]=`Object`,e[e.RegExp=9]=`RegExp`,e[e.String=10]=`String`,e[e.Symbol=11]=`Symbol`,e[e.TypeArray=12]=`TypeArray`,e[e.Undefined=13]=`Undefined`})(Ce||={}),Array.from({length:256}).map((e,t)=>BigInt(t));var we=new Float64Array(1);new DataView(we.buffer),new Uint8Array(we.buffer),new TextEncoder;var Te=`-?(?:0|[1-9][0-9]*)`,Ee=`-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?`;function De(e){return me({"~kind":`Number`},{type:`number`},e)}function w(e){return me({"~kind":`String`},{type:`string`},e)}var Oe=`^${Te}$`;`${Ee}`;function ke(e,t){return Array.from({length:t-e+1},(t,n)=>String.fromCharCode(e+n))}var Ae=[...ke(97,122),...ke(65,90)],je=[`0`,...ke(49,57)];[...je],[...Ae,...je],[...je],new RegExp(Oe);var Me=Symbol.for(`yaml.alias`),Ne=Symbol.for(`yaml.document`),T=Symbol.for(`yaml.map`),Pe=Symbol.for(`yaml.pair`),Fe=Symbol.for(`yaml.scalar`),Ie=Symbol.for(`yaml.seq`),E=Symbol.for(`yaml.node.type`),D=e=>!!e&&typeof e==`object`&&e[E]===Me,Le=e=>!!e&&typeof e==`object`&&e[E]===Ne,Re=e=>!!e&&typeof e==`object`&&e[E]===T,O=e=>!!e&&typeof e==`object`&&e[E]===Pe,k=e=>!!e&&typeof e==`object`&&e[E]===Fe,ze=e=>!!e&&typeof e==`object`&&e[E]===Ie;function A(e){if(e&&typeof e==`object`)switch(e[E]){case T:case Ie:return!0}return!1}function j(e){if(e&&typeof e==`object`)switch(e[E]){case Me:case T:case Fe:case Ie:return!0}return!1}var Be=e=>(k(e)||A(e))&&!!e.anchor,M=Symbol(`break visit`),Ve=Symbol(`skip children`),N=Symbol(`remove node`);function He(e,t){let n=We(t);Le(e)?P(null,e.contents,n,Object.freeze([e]))===N&&(e.contents=null):P(null,e,n,Object.freeze([]))}He.BREAK=M,He.SKIP=Ve,He.REMOVE=N;function P(e,t,n,r){let i=Ge(e,t,n,r);if(j(i)||O(i))return Ke(e,r,i),P(e,i,n,r);if(typeof i!=`symbol`){if(A(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=P(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===M)return M;else i===N&&(t.items.splice(e,1),--e)}}else if(O(t)){r=Object.freeze(r.concat(t));let e=P(`key`,t.key,n,r);if(e===M)return M;e===N&&(t.key=null);let i=P(`value`,t.value,n,r);if(i===M)return M;i===N&&(t.value=null)}}return i}async function Ue(e,t){let n=We(t);Le(e)?await F(null,e.contents,n,Object.freeze([e]))===N&&(e.contents=null):await F(null,e,n,Object.freeze([]))}Ue.BREAK=M,Ue.SKIP=Ve,Ue.REMOVE=N;async function F(e,t,n,r){let i=await Ge(e,t,n,r);if(j(i)||O(i))return Ke(e,r,i),F(e,i,n,r);if(typeof i!=`symbol`){if(A(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=await F(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===M)return M;else i===N&&(t.items.splice(e,1),--e)}}else if(O(t)){r=Object.freeze(r.concat(t));let e=await F(`key`,t.key,n,r);if(e===M)return M;e===N&&(t.key=null);let i=await F(`value`,t.value,n,r);if(i===M)return M;i===N&&(t.value=null)}}return i}function We(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function Ge(e,t,n,r){if(typeof n==`function`)return n(e,t,r);if(Re(t))return n.Map?.(e,t,r);if(ze(t))return n.Seq?.(e,t,r);if(O(t))return n.Pair?.(e,t,r);if(k(t))return n.Scalar?.(e,t,r);if(D(t))return n.Alias?.(e,t,r)}function Ke(e,t,n){let r=t[t.length-1];if(A(r))r.items[e]=n;else if(O(r))e===`key`?r.key=n:r.value=n;else if(Le(r))r.contents=n;else{let e=D(r)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}var qe={"!":`%21`,",":`%2C`,"[":`%5B`,"]":`%5D`,"{":`%7B`,"}":`%7D`},Je=e=>e.replace(/[!,[\]{}]/g,e=>qe[e]),Ye=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case`1.1`:this.atNextDocument=!0;break;case`1.2`:this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:`1.2`},this.tags=Object.assign({},e.defaultTags);break}return t}add(t,n){this.atNextDocument&&=(this.yaml={explicit:e.defaultYaml.explicit,version:`1.1`},this.tags=Object.assign({},e.defaultTags),!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case`%TAG`:{if(r.length!==2&&(n(0,`%TAG directive should contain exactly two parts`),r.length<2))return!1;let[e,t]=r;return this.tags[e]=t,!0}case`%YAML`:{if(this.yaml.explicit=!0,r.length!==1)return n(0,`%YAML directive should contain exactly one part`),!1;let[e]=r;if(e===`1.1`||e===`1.2`)return this.yaml.version=e,!0;{let t=/^\d+\.\d+$/.test(e);return n(6,`Unsupported YAML version ${e}`,t),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e===`!`)return`!`;if(e[0]!==`!`)return t(`Not a valid tag: ${e}`),null;if(e[1]===`<`){let n=e.slice(2,-1);return n===`!`||n===`!!`?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==`>`&&t(`Verbatim tags must end with a >`),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return n===`!`?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+Je(e.substring(n.length));return e[0]===`!`?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||`1.2`}`]:[],n=Object.entries(this.tags),r;if(e&&n.length>0&&j(e.contents)){let t={};He(e.contents,(e,n)=>{j(n)&&n.tag&&(t[n.tag]=!0)}),r=Object.keys(t)}else r=[];for(let[i,a]of n)i===`!!`&&a===`tag:yaml.org,2002:`||(!e||r.some(e=>e.startsWith(a)))&&t.push(`%TAG ${i} ${a}`);return t.join(`
|
|
3
|
+
`)}};Ye.defaultYaml={explicit:!1,version:`1.2`},Ye.defaultTags={"!!":`tag:yaml.org,2002:`};function Xe(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function Ze(e,t,n,r){if(r&&typeof r==`object`)if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=Ze(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=Ze(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=Ze(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=Ze(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}return e.call(t,n,r)}function I(e,t,n){if(Array.isArray(e))return e.map((e,t)=>I(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!Be(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var Qe=class{constructor(e){Object.defineProperty(this,E,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!Le(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=I(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?Ze(i,{"":o},``,o):o}},$e=class extends Qe{constructor(e){super(Me),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],He(e,{Node:(e,t)=>{(D(t)||Be(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}return r}toJSON(e,t){if(!t)return{source:this.source};let{anchors:n,doc:r,maxAliasCount:i}=t,a=this.resolve(r,t);if(!a){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}let o=n.get(a);if(o||=(I(a,null,t),n.get(a)),o?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=et(r,a,n)),o.count*o.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`);return o.res}toString(e,t,n){let r=`*${this.source}`;if(e){if(Xe(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function et(e,t,n){if(D(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(A(t)){let r=0;for(let i of t.items){let t=et(e,i,n);t>r&&(r=t)}return r}else if(O(t)){let r=et(e,t.key,n),i=et(e,t.value,n);return Math.max(r,i)}return 1}var tt=e=>!e||typeof e!=`function`&&typeof e!=`object`,L=class extends Qe{constructor(e){super(Fe),this.value=e}toJSON(e,t){return t?.keep?this.value:I(this.value,e,t)}toString(){return String(this.value)}};L.BLOCK_FOLDED=`BLOCK_FOLDED`,L.BLOCK_LITERAL=`BLOCK_LITERAL`,L.PLAIN=`PLAIN`,L.QUOTE_DOUBLE=`QUOTE_DOUBLE`,L.QUOTE_SINGLE=`QUOTE_SINGLE`;var nt=`tag:yaml.org,2002:`;function rt(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function it(e,t,n){if(Le(e)&&(e=e.contents),j(e))return e;if(O(e)){let t=n.schema[T].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??=i(e),new $e(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=nt+t.slice(2));let l=rt(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new L(e);return c&&(c.node=t),t}l=e instanceof Map?o[T]:Symbol.iterator in Object(e)?o[Ie]:o[T]}a&&(a(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,e,n):typeof l?.nodeClass?.from==`function`?l.nodeClass.from(n.schema,e,n):new L(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}function at(e,t,n){let r=n;for(let e=t.length-1;e>=0;--e){let n=t[e];if(typeof n==`number`&&Number.isInteger(n)&&n>=0){let e=[];e[n]=r,r=e}else r=new Map([[n,r]])}return it(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}var ot=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done,st=class extends Qe{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>j(t)||O(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(ot(e))this.add(t);else{let[n,...r]=e,i=this.get(n,!0);if(A(i))i.addIn(r,t);else if(i===void 0&&this.schema)this.set(n,at(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let r=this.get(t,!0);if(A(r))return r.deleteIn(n);throw Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...r]=e,i=this.get(n,!0);return r.length===0?!t&&k(i)?i.value:i:A(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!O(t))return!1;let n=t.value;return n==null||e&&k(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let r=this.get(t,!0);return A(r)?r.hasIn(n):!1}setIn(e,t){let[n,...r]=e;if(r.length===0)this.set(n,t);else{let e=this.get(n,!0);if(A(e))e.setIn(r,t);else if(e===void 0&&this.schema)this.set(n,at(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}},ct=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function lt(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var R=(e,t,n)=>e.endsWith(`
|
|
4
|
+
`)?lt(n,t):n.includes(`
|
|
5
|
+
`)?`
|
|
6
|
+
`+lt(n,t):(e.endsWith(` `)?``:` `)+n,ut=`flow`,dt=`block`,ft=`quoted`;function pt(e,t,n=`flow`,{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!i||i<0)return e;i<a&&(a=0);let c=Math.max(1+a,1+i-t.length);if(e.length<=c)return e;let l=[],u={},d=i-t.length;typeof r==`number`&&(r>i-Math.max(2,a)?l.push(0):d=i-r);let f,p,m=!1,h=-1,g=-1,_=-1;n===`block`&&(h=mt(e,h,t.length),h!==-1&&(d=h+c));for(let r;r=e[h+=1];){if(n===`quoted`&&r===`\\`){switch(g=h,e[h+1]){case`x`:h+=3;break;case`u`:h+=5;break;case`U`:h+=9;break;default:h+=1}_=h}if(r===`
|
|
7
|
+
`)n===`block`&&(h=mt(e,h,t.length)),d=h+t.length+c,f=void 0;else{if(r===` `&&p&&p!==` `&&p!==`
|
|
8
|
+
`&&p!==` `){let t=e[h+1];t&&t!==` `&&t!==`
|
|
9
|
+
`&&t!==` `&&(f=h)}if(h>=d)if(f)l.push(f),d=f+c,f=void 0;else if(n===`quoted`){for(;p===` `||p===` `;)p=r,r=e[h+=1],m=!0;let t=h>_+1?h-2:g-1;if(u[t])return e;l.push(t),u[t]=!0,d=t+c,f=void 0}else m=!0}p=r}if(m&&s&&s(),l.length===0)return e;o&&o();let v=e.slice(0,l[0]);for(let r=0;r<l.length;++r){let i=l[r],a=l[r+1]||e.length;i===0?v=`\n${t}${e.slice(0,a)}`:(n===`quoted`&&u[i]&&(v+=`${e[i]}\\`),v+=`\n${t}${e.slice(i+1,a)}`)}return v}function mt(e,t,n){let r=t,i=t+1,a=e[i];for(;a===` `||a===` `;)if(t<i+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
|
|
10
|
+
`);r=t,i=t+1,a=e[i]}return r}var ht=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),gt=e=>/^(%|---|\.\.\.)/m.test(e);function _t(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let t=0,n=0;t<i;++t)if(e[t]===`
|
|
11
|
+
`){if(t-n>r)return!0;if(n=t+1,i-n<=r)return!1}return!0}function vt(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(gt(e)?` `:``),o=``,s=0;for(let e=0,t=n[e];t;t=n[++e])if(t===` `&&n[e+1]===`\\`&&n[e+2]===`n`&&(o+=n.slice(s,e)+`\\ `,e+=1,s=e,t=`\\`),t===`\\`)switch(n[e+1]){case`u`:{o+=n.slice(s,e);let t=n.substr(e+2,4);switch(t){case`0000`:o+=`\\0`;break;case`0007`:o+=`\\a`;break;case`000b`:o+=`\\v`;break;case`001b`:o+=`\\e`;break;case`0085`:o+=`\\N`;break;case`00a0`:o+=`\\_`;break;case`2028`:o+=`\\L`;break;case`2029`:o+=`\\P`;break;default:t.substr(0,2)===`00`?o+=`\\x`+t.substr(2):o+=n.substr(e,6)}e+=5,s=e+1}break;case`n`:if(r||n[e+2]===`"`||n.length<i)e+=1;else{for(o+=n.slice(s,e)+`
|
|
12
|
+
|
|
13
|
+
`;n[e+2]===`\\`&&n[e+3]===`n`&&n[e+4]!==`"`;)o+=`
|
|
14
|
+
`,e+=2;o+=a,n[e+2]===` `&&(o+=`\\`),e+=1,s=e+1}break;default:e+=1}return o=s?o+n.slice(s):n,r?o:pt(o,a,ft,ht(t,!1))}function yt(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
15
|
+
`)||/[ \t]\n|\n[ \t]/.test(e))return vt(e,t);let n=t.indent||(gt(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:pt(r,n,ut,ht(t,!1))}function z(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=vt;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?yt:i&&!t?vt:n?yt:vt}return r(e,t)}var bt;try{bt=RegExp(`(^|(?<!
|
|
16
|
+
))
|
|
17
|
+
+(?!
|
|
18
|
+
|$)`,`g`)}catch{bt=/\n+(?!\n|$)/g}function xt({comment:e,type:t,value:n},r,i,a){let{blockQuote:o,commentString:s,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(n))return z(n,r);let l=r.indent||(r.forceBlockIndent||gt(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===L.BLOCK_FOLDED?!1:t===L.BLOCK_LITERAL||!_t(n,c,l.length);if(!n)return u?`|
|
|
19
|
+
`:`>
|
|
20
|
+
`;let d,f;for(f=n.length;f>0;--f){let e=n[f-1];if(e!==`
|
|
21
|
+
`&&e!==` `&&e!==` `)break}let p=n.substring(f),m=p.indexOf(`
|
|
22
|
+
`);m===-1?d=`-`:n===p||m!==p.length-1?(d=`+`,a&&a()):d=``,p&&=(n=n.slice(0,-p.length),p[p.length-1]===`
|
|
23
|
+
`&&(p=p.slice(0,-1)),p.replace(bt,`$&${l}`));let h=!1,g,_=-1;for(g=0;g<n.length;++g){let e=n[g];if(e===` `)h=!0;else if(e===`
|
|
24
|
+
`)_=g;else break}let v=n.substring(0,_<g?_+1:g);v&&=(n=n.substring(v.length),v.replace(/\n+/g,`$&${l}`));let y=(h?l?`2`:`1`:``)+d;if(e&&(y+=` `+s(e.replace(/ ?[\r\n]+/g,` `)),i&&i()),!u){let e=n.replace(/\n+/g,`
|
|
25
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\n+/g,`$&${l}`),i=!1,a=ht(r,!0);o!==`folded`&&t!==L.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=pt(`${v}${e}${p}`,l,dt,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function St(e,t,n,r){let{type:i,value:a}=e,{actualString:o,implicitKey:s,indent:c,indentStep:l,inFlow:u}=t;if(s&&a.includes(`
|
|
26
|
+
`)||u&&/[[\]{},]/.test(a))return z(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
|
|
27
|
+
`)?z(a,t):xt(e,t,n,r);if(!s&&!u&&i!==L.PLAIN&&a.includes(`
|
|
28
|
+
`))return xt(e,t,n,r);if(gt(a)){if(c===``)return t.forceBlockIndent=!0,xt(e,t,n,r);if(s&&c===l)return z(a,t)}let d=a.replace(/\n+/g,`$&\n${c}`);if(o){let e=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(d),{compat:n,tags:r}=t.doc.schema;if(r.some(e)||n?.some(e))return z(a,t)}return s?d:pt(d,c,ut,ht(t,!1))}function Ct(e,t,n,r){let{implicitKey:i,inFlow:a}=t,o=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:s}=e;s!==L.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=L.QUOTE_DOUBLE);let c=e=>{switch(e){case L.BLOCK_FOLDED:case L.BLOCK_LITERAL:return i||a?z(o.value,t):xt(o,t,n,r);case L.QUOTE_DOUBLE:return vt(o.value,t);case L.QUOTE_SINGLE:return yt(o.value,t);case L.PLAIN:return St(o,t,n,r);default:return null}},l=c(s);if(l===null){let{defaultKeyType:e,defaultStringType:n}=t.options,r=i&&e||n;if(l=c(r),l===null)throw Error(`Unsupported default string type ${r}`)}return l}function wt(e,t){let n=Object.assign({blockQuote:!0,commentString:ct,defaultKeyType:null,defaultStringType:`PLAIN`,directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:`false`,flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:`null`,simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:`true`,verifyAliasOrder:!0},e.schema.toStringOptions,t),r;switch(n.collectionStyle){case`block`:r=!1;break;case`flow`:r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:r,options:n}}function Tt(e,t){if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let n,r;if(k(t)){r=t.value;let i=e.filter(e=>e.identify?.(r));if(i.length>1){let e=i.filter(e=>e.test);e.length>0&&(i=e)}n=i.find(e=>e.format===t.format)??i.find(e=>!e.format)}else r=t,n=e.find(e=>e.nodeClass&&r instanceof e.nodeClass);if(!n){let e=r?.constructor?.name??(r===null?`null`:typeof r);throw Error(`Tag not resolved for ${e} value`)}return n}function Et(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(k(e)||A(e))&&e.anchor;a&&Xe(a)&&(n.add(a),i.push(`&${a}`));let o=e.tag??(t.default?null:t.tag);return o&&i.push(r.directives.tagString(o)),i.join(` `)}function Dt(e,t,n,r){if(O(e))return e.toString(t,n,r);if(D(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError(`Cannot stringify circular structure without alias nodes`);t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i,a=j(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=Tt(t.doc.schema.tags,a);let o=Et(a,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);let s=typeof i.stringify==`function`?i.stringify(a,t,n,r):k(a)?Ct(a,t,n,r):a.toString(t,n,r);return o?k(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function Ot({key:e,value:t},n,r,i){let{allNullValues:a,doc:o,indent:s,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,f=j(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(A(e)||!j(e)&&typeof e==`object`)throw Error(`With simple keys, collection cannot be used as a key value`)}let p=!d&&(!e||f&&t==null&&!n.inFlow||A(e)||(k(e)?e.type===L.BLOCK_FOLDED||e.type===L.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=Dt(e,n,()=>m=!0,()=>h=!0);if(!p&&!n.inFlow&&g.length>1024){if(d)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);p=!0}if(n.inFlow){if(a||t==null)return m&&r&&r(),g===``?`?`:p?`? ${g}`:g}else if(a&&!d||t==null&&p)return g=`? ${g}`,f&&!m?g+=R(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=R(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=R(g,n.indent,l(f))));let _,v,y;j(t)?(_=!!t.spaceBefore,v=t.commentBefore,y=t.comment):(_=!1,v=null,y=null,t&&typeof t==`object`&&(t=o.createNode(t))),n.implicitKey=!1,!p&&!f&&k(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&ze(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=Dt(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?`
|
|
29
|
+
`:``,v){let e=l(v);S+=`\n${lt(e,n.indent)}`}x===``&&!n.inFlow?S===`
|
|
30
|
+
`&&y&&(S=`
|
|
31
|
+
|
|
32
|
+
`):S+=`\n${n.indent}`}else if(!p&&A(t)){let e=x[0],r=x.indexOf(`
|
|
33
|
+
`),i=r!==-1,a=n.inFlow??t.flow??t.items.length===0;if(i||!a){let t=!1;if(i&&(e===`&`||e===`!`)){let n=x.indexOf(` `);e===`&`&&n!==-1&&n<r&&x[n+1]===`!`&&(n=x.indexOf(` `,n+1)),(n===-1||r<n)&&(t=!0)}t||(S=`\n${n.indent}`)}}else(x===``||x[0]===`
|
|
34
|
+
`)&&(S=``);return g+=S+x,n.inFlow?b&&r&&r():y&&!b?g+=R(g,n.indent,l(y)):h&&i&&i(),g}function kt(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var At=`<<`,jt={identify:e=>e===At||typeof e==`symbol`&&e.description===At,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new L(Symbol(At)),{addToJSMap:Nt}),stringify:()=>At},Mt=(e,t)=>(jt.identify(t)||k(t)&&(!t.type||t.type===L.PLAIN)&&jt.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===jt.tag&&e.default);function Nt(e,t,n){let r=Ft(e,n);if(ze(r))for(let n of r.items)Pt(e,t,n);else if(Array.isArray(r))for(let n of r)Pt(e,t,n);else Pt(e,t,r)}function Pt(e,t,n){let r=Ft(e,n);if(!Re(r))throw Error(`Merge sources must be maps or map aliases`);let i=r.toJSON(null,e,Map);for(let[e,n]of i)t instanceof Map?t.has(e)||t.set(e,n):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0});return t}function Ft(e,t){return e&&D(t)?t.resolve(e.doc,e):t}function It(e,t,{key:n,value:r}){if(j(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(Mt(e,n))Nt(e,t,r);else{let i=I(n,``,e);if(t instanceof Map)t.set(i,I(r,i,e));else if(t instanceof Set)t.add(i);else{let a=Lt(n,i,e),o=I(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function Lt(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(j(e)&&n?.doc){let t=wt(n.doc,{});t.anchors=new Set;for(let e of n.anchors.keys())t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;let r=e.toString(t);if(!n.mapKeyWarned){let e=JSON.stringify(r);e.length>40&&(e=e.substring(0,36)+`..."`),kt(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function Rt(e,t,n){return new B(it(e,void 0,n),it(t,void 0,n))}var B=class e{constructor(e,t=null){Object.defineProperty(this,E,{value:Pe}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return j(n)&&(n=n.clone(t)),j(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return It(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?Ot(this,e,t,n):JSON.stringify(this)}};function zt(e,t,n){return(t.inFlow??e.flow?Vt:Bt)(e,t,n)}function Bt({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:o,onComment:s}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:a,type:null}),d=!1,f=[];for(let e=0;e<t.length;++e){let i=t[e],o=null;if(j(i))!d&&i.spaceBefore&&f.push(``),Ht(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(O(i)){let e=j(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),Ht(n,f,e.commentBefore,d))}d=!1;let s=Dt(i,u,()=>o=null,()=>d=!0);o&&(s+=R(s,a,l(o))),d&&o&&(d=!1),f.push(r+s)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let e=1;e<f.length;++e){let t=f[e];p+=t?`\n${c}${t}`:`
|
|
35
|
+
`}}return e?(p+=`
|
|
36
|
+
`+lt(l(e),c),s&&s()):d&&o&&o(),p}function Vt({items:e},t,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:a,flowCollectionPadding:o,options:{commentString:s}}=t;r+=a;let c=Object.assign({},t,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let n=0;n<e.length;++n){let i=e[n],a=null;if(j(i))i.spaceBefore&&d.push(``),Ht(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(O(i)){let e=j(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),Ht(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=j(i.value)?i.value:null;n?(n.comment&&(a=n.comment),n.commentBefore&&(l=!0)):i.value==null&&e?.comment&&(a=e.comment)}a&&(l=!0);let o=Dt(i,c,()=>a=null);l||=d.length>u||o.includes(`
|
|
37
|
+
`),n<e.length-1?o+=`,`:t.options.trailingComma&&(t.options.lineWidth>0&&(l||=d.reduce((e,t)=>e+t.length+2,2)+(o.length+2)>t.options.lineWidth),l&&(o+=`,`)),a&&(o+=R(o,r,s(a))),d.push(o),u=d.length}let{start:f,end:p}=n;if(d.length===0)return f+p;if(!l){let e=d.reduce((e,t)=>e+t.length+2,2);l=t.options.lineWidth>0&&e>t.options.lineWidth}if(l){let e=f;for(let t of d)e+=t?`\n${a}${i}${t}`:`
|
|
38
|
+
`;return`${e}\n${i}${p}`}else return`${f}${o}${d.join(` `)}${o}${p}`}function Ht({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=lt(t(r),e);n.push(i.trimStart())}}function V(e,t){let n=k(t)?t.value:t;for(let r of e)if(O(r)&&(r.key===t||r.key===n||k(r.key)&&r.key.value===n))return r}var H=class extends st{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(T,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,a=new this(e),o=(e,o)=>{if(typeof i==`function`)o=i.call(t,e,o);else if(Array.isArray(i)&&!i.includes(e))return;(o!==void 0||r)&&a.items.push(Rt(e,o,n))};if(t instanceof Map)for(let[e,n]of t)o(e,n);else if(t&&typeof t==`object`)for(let e of Object.keys(t))o(e,t[e]);return typeof e.sortMapEntries==`function`&&a.items.sort(e.sortMapEntries),a}add(e,t){let n;n=O(e)?e:!e||typeof e!=`object`||!(`key`in e)?new B(e,e?.value):new B(e.key,e.value);let r=V(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);k(r.value)&&tt(n.value)?r.value.value=n.value:r.value=n.value}else if(i){let e=this.items.findIndex(e=>i(n,e)<0);e===-1?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){let t=V(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=V(this.items,e)?.value;return(!t&&k(n)?n.value:n)??void 0}has(e){return!!V(this.items,e)}set(e,t){this.add(new B(e,t),!0)}toJSON(e,t,n){let r=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(let e of this.items)It(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!O(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),zt(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},Ut={collection:`map`,default:!0,nodeClass:H,tag:`tag:yaml.org,2002:map`,resolve(e,t){return Re(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>H.from(e,t,n)},Wt=class extends st{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(Ie,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=Gt(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=Gt(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&k(r)?r.value:r}has(e){let t=Gt(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=Gt(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];k(r)&&tt(t)?r.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let r=0;for(let e of this.items)n.push(I(e,String(r++),t));return n}toString(e,t,n){return e?zt(this,e,{blockItemPrefix:`- `,flowChars:{start:`[`,end:`]`},itemIndent:(e.indent||``)+` `,onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let a of t){if(typeof r==`function`){let n=t instanceof Set?a:String(e++);a=r.call(t,n,a)}i.items.push(it(a,void 0,n))}}return i}};function Gt(e){let t=k(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var Kt={collection:`seq`,default:!0,nodeClass:Wt,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return ze(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>Wt.from(e,t,n)};function qt(e){return typeof e==`bigint`||Number.isInteger(e)}var Jt=({value:e})=>JSON.stringify(e),Yt=[{identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify:Jt},{identify:e=>e==null,createNode:()=>new L(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^null$/,resolve:()=>null,stringify:Jt},{identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^true$|^false$/,resolve:e=>e===`true`,stringify:Jt},{identify:qt,default:!0,tag:`tag:yaml.org,2002:int`,test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>qt(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:Jt}];[Ut,Kt].concat(Yt,{default:!0,tag:``,test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}});function Xt(e,t,n){let{replacer:r}=n,i=new Wt(e);i.tag=`tag:yaml.org,2002:pairs`;let a=0;if(t&&Symbol.iterator in Object(t))for(let e of t){typeof r==`function`&&(e=r.call(t,String(a++),e));let o,s;if(Array.isArray(e))if(e.length===2)o=e[0],s=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`);else if(e&&e instanceof Object){let t=Object.keys(e);if(t.length===1)o=t[0],s=e[o];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else o=e;i.items.push(Rt(o,s,n))}return i}var Zt=class e extends Wt{constructor(){super(),this.add=H.prototype.add.bind(this),this.delete=H.prototype.delete.bind(this),this.get=H.prototype.get.bind(this),this.has=H.prototype.has.bind(this),this.set=H.prototype.set.bind(this),this.tag=e.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let e of this.items){let r,i;if(O(e)?(r=I(e.key,``,t),i=I(e.value,r,t)):r=I(e,``,t),n.has(r))throw Error(`Ordered maps must not include duplicate keys`);n.set(r,i)}return n}static from(e,t,n){let r=Xt(e,t,n),i=new this;return i.items=r.items,i}};Zt.tag=`tag:yaml.org,2002:omap`;var Qt=class e extends H{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=O(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new B(e.key,null):new B(e,null),V(this.items,t.key)||this.items.push(t)}get(e,t){let n=V(this.items,e);return!t&&O(n)?k(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=V(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new B(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw Error(`Set items must all have null values`)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t)typeof r==`function`&&(e=r.call(t,e,e)),i.items.push(Rt(e,null,n));return i}};Qt.tag=`tag:yaml.org,2002:set`;var $t=Symbol(`break visit`),en=Symbol(`skip children`),tn=Symbol(`remove item`);function U(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),nn(Object.freeze([]),e,t)}U.BREAK=$t,U.SKIP=en,U.REMOVE=tn,U.itemAtPath=(e,t)=>{let n=e;for(let[e,r]of t){let t=n?.[e];if(t&&`items`in t)n=t.items[r];else return}return n},U.parentCollection=(e,t)=>{let n=U.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&`items`in i)return i;throw Error(`Parent collection not found`)};function nn(e,t,n){let r=n(t,e);if(typeof r==`symbol`)return r;for(let i of[`key`,`value`]){let a=t[i];if(a&&`items`in a){for(let t=0;t<a.items.length;++t){let r=nn(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===$t)return $t;else r===tn&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}t(((e,t)=>{function n(e){return Array.isArray(e)?e:[e]}var r=/^\s+$/,i=/(?:[^\\]|^)\\$/,a=/^\\!/,o=/^\\#/,s=/\r?\n/g,c=/^\.{0,2}\/|^\.{1,2}$/,l=/\/$/,u=`node-ignore`;typeof Symbol<`u`&&(u=Symbol.for(`node-ignore`));var d=u,f=(e,t,n)=>(Object.defineProperty(e,t,{value:n}),n),p=/([0-z])-([0-z])/g,m=()=>!1,h=e=>e.replace(p,(e,t,n)=>t.charCodeAt(0)<=n.charCodeAt(0)?e:``),g=e=>{let{length:t}=e;return e.slice(0,t-t%2)},_=[[/^\uFEFF/,()=>``],[/((?:\\\\)*?)(\\?\s+)$/,(e,t,n)=>t+(n.indexOf(`\\`)===0?` `:``)],[/(\\+?)\s/g,(e,t)=>{let{length:n}=t;return t.slice(0,n-n%2)+` `}],[/[\\$.|*+(){^]/g,e=>`\\${e}`],[/(?!\\)\?/g,()=>`[^/]`],[/^\//,()=>`^`],[/\//g,()=>`\\/`],[/^\^*\\\*\\\*\\\//,()=>`^(?:.*\\/)?`],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?`^`:`(?:^|\\/)`}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(e,t,n)=>t+6<n.length?`(?:\\/[^\\/]+)*`:`\\/.+`],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(e,t,n)=>t+n.replace(/\\\*/g,`[^\\/]*`)],[/\\\\\\(?=[$.|*+(){^])/g,()=>`\\`],[/\\\\/g,()=>`\\`],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,n,r,i)=>t===`\\`?`\\[${n}${g(r)}${i}`:i===`]`&&r.length%2==0?`[${h(n)}${r}]`:`[]`],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`]],v=/(^|\\\/)?\\\*$/,y=`regex`,b=`checkRegex`,x={[y](e,t){return`${t?`${t}[^/]+`:`[^/]*`}(?=$|\\/$)`},[b](e,t){return`${t?`${t}[^/]*`:`[^/]*`}(?=$|\\/$)`}},S=e=>_.reduce((t,[n,r])=>t.replace(n,r.bind(e)),e),ee=e=>typeof e==`string`,te=e=>e&&ee(e)&&!r.test(e)&&!i.test(e)&&e.indexOf(`#`)!==0,ne=e=>e.split(s).filter(Boolean),re=class{constructor(e,t,n,r,i,a){this.pattern=e,this.mark=t,this.negative=i,f(this,`body`,n),f(this,`ignoreCase`,r),f(this,`regexPrefix`,a)}get regex(){let e=`_regex`;return this[e]?this[e]:this._make(y,e)}get checkRegex(){let e=`_checkRegex`;return this[e]?this[e]:this._make(b,e)}_make(e,t){let n=this.regexPrefix.replace(v,x[e]),r=this.ignoreCase?new RegExp(n,`i`):new RegExp(n);return f(this,t,r)}},ie=({pattern:e,mark:t},n)=>{let r=!1,i=e;i.indexOf(`!`)===0&&(r=!0,i=i.substr(1)),i=i.replace(a,`!`).replace(o,`#`);let s=S(i);return new re(e,t,i,n,r,s)},ae=class{constructor(e){this._ignoreCase=e,this._rules=[]}_add(e){if(e&&e[d]){this._rules=this._rules.concat(e._rules._rules),this._added=!0;return}if(ee(e)&&(e={pattern:e}),te(e.pattern)){let t=ie(e,this._ignoreCase);this._added=!0,this._rules.push(t)}}add(e){return this._added=!1,n(ee(e)?ne(e):e).forEach(this._add,this),this._added}test(e,t,n){let r=!1,i=!1,a;this._rules.forEach(o=>{let{negative:s}=o;i===s&&r!==i||s&&!r&&!i&&!t||o[n].test(e)&&(r=!s,i=s,a=s?void 0:o)});let o={ignored:r,unignored:i};return a&&(o.rule=a),o}},oe=(e,t)=>{throw new t(e)},C=(e,t,n)=>ee(e)?e?!C.isNotRelative(e)||n(`path should be a \`path.relative()\`d string, but got "${t}"`,RangeError):n(`path must not be empty`,TypeError):n(`path must be a string, but got \`${t}\``,TypeError),se=e=>c.test(e);C.isNotRelative=se,C.convert=e=>e;var ce=class{constructor({ignorecase:e=!0,ignoreCase:t=e,allowRelativePaths:n=!1}={}){f(this,d,!0),this._rules=new ae(t),this._strictPathCheck=!n,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add(e){return this._rules.add(e)&&this._initCache(),this}addPattern(e){return this.add(e)}_test(e,t,n,r){let i=e&&C.convert(e);return C(i,e,this._strictPathCheck?oe:m),this._t(i,t,n,r)}checkIgnore(e){if(!l.test(e))return this.test(e);let t=e.split(`/`).filter(Boolean);if(t.pop(),t.length){let e=this._t(t.join(`/`)+`/`,this._testCache,!0,t);if(e.ignored)return e}return this._rules.test(e,!1,b)}_t(e,t,n,r){if(e in t)return t[e];if(r||=e.split(`/`).filter(Boolean),r.pop(),!r.length)return t[e]=this._rules.test(e,n,y);let i=this._t(r.join(`/`)+`/`,t,n,r);return t[e]=i.ignored?i:this._rules.test(e,n,y)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return n(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}},le=e=>new ce(e),ue=e=>C(e&&C.convert(e),e,m),de=()=>{C.convert=e=>/^\\\\\?\\/.test(e)||/["<>|\u0000-\u001F]+/u.test(e)?e:e.replace(/\\/g,`/`);let e=/^[a-z]:\//i;C.isNotRelative=t=>e.test(t)||se(t)};typeof process<`u`&&process.platform===`win32`&&de(),t.exports=le,le.default=le,t.exports.isPathValid=ue,f(t.exports,Symbol.for(`setupWindows`),de)}))(),globalThis.Buffer,Se({command:w({description:`Bash command to execute`}),timeout:ve(De({description:`Timeout in seconds (optional, no default timeout)`}))});var W=class{diff(e,t,n={}){let r;typeof n==`function`?(r=n,n={}):`callback`in n&&(r=n.callback);let i=this.castInput(e,n),a=this.castInput(t,n),o=this.removeEmpty(this.tokenize(i,n)),s=this.removeEmpty(this.tokenize(a,n));return this.diffWithOptionsObj(o,s,n,r)}diffWithOptionsObj(e,t,n,r){let i=e=>{if(e=this.postProcess(e,n),r){setTimeout(function(){r(e)},0);return}else return e},a=t.length,o=e.length,s=1,c=a+o;n.maxEditLength!=null&&(c=Math.min(c,n.maxEditLength));let l=n.timeout??1/0,u=Date.now()+l,d=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(d[0],t,e,0,n);if(d[0].oldPos+1>=o&&f+1>=a)return i(this.buildValues(d[0].lastComponent,t,e));let p=-1/0,m=1/0,h=()=>{for(let r=Math.max(p,-s);r<=Math.min(m,s);r+=2){let s,c=d[r-1],l=d[r+1];c&&(d[r-1]=void 0);let u=!1;if(l){let e=l.oldPos-r;u=l&&0<=e&&e<a}let h=c&&c.oldPos+1<o;if(!u&&!h){d[r]=void 0;continue}if(s=!h||u&&c.oldPos<l.oldPos?this.addToPath(l,!0,!1,0,n):this.addToPath(c,!1,!0,1,n),f=this.extractCommon(s,t,e,r,n),s.oldPos+1>=o&&f+1>=a)return i(this.buildValues(s.lastComponent,t,e))||!0;d[r]=s,s.oldPos+1>=o&&(m=Math.min(m,r-1)),f+1>=a&&(p=Math.max(p,r+1))}s++};if(r)(function e(){setTimeout(function(){if(s>c||Date.now()>u)return r(void 0);h()||e()},0)})();else for(;s<=c&&Date.now()<=u;){let e=h();if(e)return e}}addToPath(e,t,n,r,i){let a=e.lastComponent;return a&&!i.oneChangePerToken&&a.added===t&&a.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:a.count+1,added:t,removed:n,previousComponent:a.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:a}}}extractCommon(e,t,n,r,i){let a=t.length,o=n.length,s=e.oldPos,c=s-r,l=0;for(;c+1<a&&s+1<o&&this.equals(n[s+1],t[c+1],i);)c++,s++,l++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return l&&!i.oneChangePerToken&&(e.lastComponent={count:l,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=s,c}equals(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){let t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join(``)}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,n){let r=[],i;for(;e;)r.push(e),i=e.previousComponent,delete e.previousComponent,e=i;r.reverse();let a=r.length,o=0,s=0,c=0;for(;o<a;o++){let e=r[o];if(e.removed)e.value=this.join(n.slice(c,c+e.count)),c+=e.count;else{if(!e.added&&this.useLongestToken){let r=t.slice(s,s+e.count);r=r.map(function(e,t){let r=n[c+t];return r.length>e.length?r:e}),e.value=this.join(r)}else e.value=this.join(t.slice(s,s+e.count));s+=e.count,e.added||(c+=e.count)}}return r}};new class extends W{};function rn(e,t){let n;for(n=0;n<e.length&&n<t.length;n++)if(e[n]!=t[n])return e.slice(0,n);return e.slice(0,n)}function an(e,t){let n;if(!e||!t||e[e.length-1]!=t[t.length-1])return``;for(n=0;n<e.length&&n<t.length;n++)if(e[e.length-(n+1)]!=t[t.length-(n+1)])return e.slice(-n);return e.slice(-n)}function on(e,t,n){if(e.slice(0,t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't start with prefix ${JSON.stringify(t)}; this is a bug`);return n+e.slice(t.length)}function sn(e,t,n){if(!t)return e+n;if(e.slice(-t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't end with suffix ${JSON.stringify(t)}; this is a bug`);return e.slice(0,-t.length)+n}function cn(e,t){return on(e,t,``)}function ln(e,t){return sn(e,t,``)}function un(e,t){return t.slice(0,dn(e,t))}function dn(e,t){let n=0;e.length>t.length&&(n=e.length-t.length);let r=t.length;e.length<t.length&&(r=e.length);let i=Array(r),a=0;i[0]=0;for(let e=1;e<r;e++){for(t[e]==t[a]?i[e]=i[a]:i[e]=a;a>0&&t[e]!=t[a];)a=i[a];t[e]==t[a]&&a++}a=0;for(let r=n;r<e.length;r++){for(;a>0&&e[r]!=t[a];)a=i[a];e[r]==t[a]&&a++}return a}function fn(e,t){let n=[];for(let r of Array.from(t.segment(e))){let e=r.segment;n.length&&/\s/.test(n[n.length-1])&&/\s/.test(e)?n[n.length-1]+=e:n.push(e)}return n}function pn(e,t){if(t)return hn(e,t)[1];let n;for(n=e.length-1;n>=0&&e[n].match(/\s/);n--);return e.substring(n+1)}function mn(e,t){if(t)return hn(e,t)[0];let n=e.match(/^\s*/);return n?n[0]:``}function hn(e,t){if(!t)return[mn(e),pn(e)];if(t.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);let n=fn(e,t),r=n[0],i=n[n.length-1];return[/\s/.test(r)?r:``,/\s/.test(i)?i:``]}var gn=`a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}`,_n=RegExp(`[${gn}]+|\\s+|[^${gn}]`,`ug`);new class extends W{equals(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()}tokenize(e,t={}){let n;if(t.intlSegmenter){let r=t.intlSegmenter;if(r.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);n=fn(e,r)}else n=e.match(_n)||[];let r=[],i=null;return n.forEach(e=>{/\s/.test(e)?i==null?r.push(e):r.push(r.pop()+e):i!=null&&/\s/.test(i)?r[r.length-1]==i?r.push(r.pop()+e):r.push(i+e):r.push(e),i=e}),r}join(e){return e.map((e,t)=>t==0?e:e.replace(/^\s+/,``)).join(``)}postProcess(e,t){if(!e||t.oneChangePerToken)return e;let n=null,r=null,i=null;return e.forEach(e=>{e.added?r=e:e.removed?i=e:((r||i)&&vn(n,i,r,e,t.intlSegmenter),n=e,r=null,i=null)}),(r||i)&&vn(n,i,r,null,t.intlSegmenter),e}};function vn(e,t,n,r,i){if(t&&n){let[a,o]=hn(t.value,i),[s,c]=hn(n.value,i);if(e){let r=rn(a,s);e.value=sn(e.value,s,r),t.value=cn(t.value,r),n.value=cn(n.value,r)}if(r){let e=an(o,c);r.value=on(r.value,c,e),t.value=ln(t.value,e),n.value=ln(n.value,e)}}else if(n){if(e){let e=mn(n.value,i);n.value=n.value.substring(e.length)}if(r){let e=mn(r.value,i);r.value=r.value.substring(e.length)}}else if(e&&r){let n=mn(r.value,i),[a,o]=hn(t.value,i),s=rn(n,a);t.value=cn(t.value,s);let c=an(cn(n,s),o);t.value=ln(t.value,c),r.value=on(r.value,n,c),e.value=sn(e.value,n,n.slice(0,n.length-c.length))}else if(r){let e=mn(r.value,i),n=un(pn(t.value,i),e);t.value=ln(t.value,n)}else if(e){let n=un(pn(e.value,i),mn(t.value,i));t.value=cn(t.value,n)}}new class extends W{tokenize(e){let t=RegExp(`(\\r?\\n)|[${gn}]+|[^\\S\\n\\r]+|[^${gn}]`,`ug`);return e.match(t)||[]}},new class extends W{constructor(){super(...arguments),this.tokenize=yn}equals(e,t,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
|
|
39
|
+
`))&&(e=e.trim()),(!n.newlineIsToken||!t.includes(`
|
|
40
|
+
`))&&(t=t.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith(`
|
|
41
|
+
`)&&(e=e.slice(0,-1)),t.endsWith(`
|
|
42
|
+
`)&&(t=t.slice(0,-1))),super.equals(e,t,n)}};function yn(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
43
|
+
`));let n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let e=0;e<r.length;e++){let i=r[e];e%2&&!t.newlineIsToken?n[n.length-1]+=i:n.push(i)}return n}function bn(e){return e==`.`||e==`!`||e==`?`}new class extends W{tokenize(e){let t=[],n=0;for(let r=0;r<e.length;r++){if(r==e.length-1){t.push(e.slice(n));break}if(bn(e[r])&&e[r+1].match(/\s/)){for(t.push(e.slice(n,r+1)),r=n=r+1;e[r+1]?.match(/\s/);)r++;t.push(e.slice(n,r+1)),n=r+1}}return t}},new class extends W{tokenize(e){return e.split(/([{}:;,]|\s+)/)}},new class extends W{constructor(){super(...arguments),this.tokenize=yn}get useLongestToken(){return!0}castInput(e,t){let{undefinedReplacement:n,stringifyReplacer:r=(e,t)=>t===void 0?n:t}=t;return typeof e==`string`?e:JSON.stringify(xn(e,null,null,r),null,` `)}equals(e,t,n){return super.equals(e.replace(/,([\r\n])/g,`$1`),t.replace(/,([\r\n])/g,`$1`),n)}};function xn(e,t,n,r,i){t||=[],n||=[],r&&(e=r(i===void 0?``:i,e));let a;for(a=0;a<t.length;a+=1)if(t[a]===e)return n[a];let o;if(Object.prototype.toString.call(e)===`[object Array]`){for(t.push(e),o=Array(e.length),n.push(o),a=0;a<e.length;a+=1)o[a]=xn(e[a],t,n,r,String(a));return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),typeof e==`object`&&e){t.push(e),o={},n.push(o);let i=[],s;for(s in e)Object.prototype.hasOwnProperty.call(e,s)&&i.push(s);for(i.sort(),a=0;a<i.length;a+=1)s=i[a],o[s]=xn(e[s],t,n,r,s);t.pop(),n.pop()}else o=e;return o}new class extends W{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}};var Sn=Se({oldText:w({description:`Exact text for one targeted replacement. It must be unique in the original file and must not overlap with any other edits[].oldText in the same call.`}),newText:w({description:`Replacement text for this targeted edit.`})},{});Se({path:w({description:`Path to the file to edit (relative or absolute)`}),edits:be(Sn,{description:`One or more targeted replacements. Each edit is matched against the original file, not incrementally. Do not include overlapping or nested edits. If two changes touch the same block or nearby lines, merge them into one edit instead.`})},{}),Se({path:w({description:`Path to the file to read (relative or absolute)`}),offset:ve(De({description:`Line number to start reading from (1-indexed)`})),limit:ve(De({description:`Maximum number of lines to read`}))}),Se({path:w({description:`Path to the file to write (relative or absolute)`}),content:w({description:`Content to write to the file`})});var Cn=`slicc_oauth_extra_domains`;function wn(e){try{let t=e.getItem(Cn);if(!t)return{};let n=JSON.parse(t);if(typeof n!=`object`||!n||Array.isArray(n))return{};let r={};for(let[e,t]of Object.entries(n)){if(typeof e!=`string`||!Array.isArray(t))continue;let n=t.filter(e=>typeof e==`string`&&e.length>0);n.length>0&&(r[e]=n)}return r}catch{return{}}}function Tn(e,t){try{e.setItem(Cn,JSON.stringify(t))}catch(e){throw Error(`Failed to persist OAuth extras (localStorage quota exceeded?): ${e instanceof Error?e.message:String(e)}`)}}o(`secret-scrub`),o(`image-processor`),o(`tool-adapter`);var En=e({ACCOUNTS_KEY:()=>G,__test__:()=>In,addAccount:()=>er,applyProviderDefaults:()=>Un,clearAllSettings:()=>Cr,clearApiKey:()=>vr,clearBaseUrl:()=>xr,clearSelectedProvider:()=>hr,exportProviders:()=>Sr,getAccounts:()=>X,getAllAvailableModels:()=>qn,getAllExtraOAuthDomains:()=>Zn,getApiKey:()=>gr,getApiKeyForProvider:()=>lr,getApiVersionForProvider:()=>dr,getAvailableProviders:()=>Ln,getBaseUrl:()=>yr,getBaseUrlForProvider:()=>Z,getDeploymentForProvider:()=>ur,getExtraOAuthDomains:()=>Jn,getOAuthAccountInfo:()=>Vn,getProviderConfig:()=>q,getProviderModels:()=>J,getRawApiKeyForProvider:()=>cr,getSelectedModelId:()=>Q,getSelectedProvider:()=>$,isModelHiddenFromPicker:()=>Gn,logoutOAuthAccount:()=>rr,maskOAuthTokenWithRetry:()=>ir,migrateLegacyAuthOnlySelection:()=>Pn,persistOAuthMaskViaServiceWorker:()=>ar,providerOffersLlmModels:()=>Rn,removeAccount:()=>nr,resolveCurrentModel:()=>Or,resolveModelById:()=>Dr,resolveModelByShorthand:()=>kr,saveOAuthAccount:()=>or,setApiKey:()=>_r,setBaseUrl:()=>br,setExtraOAuthDomains:()=>Yn,setExtraOAuthDomainsAsync:()=>Xn,setSelectedModelId:()=>fr,setSelectedProvider:()=>mr}),Dn=i,On=a,G=`slicc_accounts`,K=`selected-model`,kn=[`slicc_provider`,`slicc_api_key`,`slicc_base_url`,`anthropic_api_key`,`api_provider`,`azure_resource`,`bedrock_region`],An=new Set([`github`]);function jn(e){let t;try{t=r()}catch{return!1}return t.includes(e)&&!f(e)}var Mn=!1;function Nn(){if(!Mn){Mn=!0;for(let e of kn)try{localStorage.removeItem(e)}catch{}Pn()}}function Pn(){try{let e=localStorage.getItem(K);if(e){let t=e.indexOf(`:`);if(t>0){let n=e.slice(0,t);(An.has(n)||jn(n))&&localStorage.removeItem(K)}}}catch{}try{let e=localStorage.getItem(G);if(!e)return;let t=JSON.parse(e);if(!Array.isArray(t))return;let n=t.filter(e=>!(typeof e==`object`&&e&&typeof e.providerId==`string`&&jn(e.providerId)));n.length!==t.length&&localStorage.setItem(G,JSON.stringify(n))}catch{}}function Fn(){Mn=!1}var In={_resetLegacyCleanup:Fn};function Ln(){let e=r().filter(f),t=d();return[...new Set([...e,...t])].filter(e=>!p(e)?.hidden)}function Rn(e){try{if(J(e).length>0)return!0}catch{}try{if(a(e).length>0)return!0}catch{}let t=p(e);return!!(t?.modelOverrides&&Object.keys(t.modelOverrides).length>0)}function zn(e,t){try{if(J(e).some(e=>e.id===t))return!0}catch{}try{if(a(e).some(e=>e.id===t))return!0}catch{}let n=p(e);return!!(n?.modelOverrides&&Object.hasOwn(n.modelOverrides,t))}function q(e){return p(e)||{id:e,name:e.split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `),description:`${e} provider`,requiresApiKey:!0,requiresBaseUrl:!1}}function Bn(e,t){t.context_window!==void 0&&(e.contextWindow=t.context_window),t.max_tokens!==void 0&&(e.maxTokens=t.max_tokens),t.reasoning!==void 0&&(e.reasoning=t.reasoning),t.input!==void 0&&(e.input=t.input),t.compat!==void 0&&(e.compat={...e.compat??{},...t.compat}),t.thinkingLevelMap!==void 0&&(e.thinkingLevelMap={...e.thinkingLevelMap??{},...t.thinkingLevelMap})}function J(e){try{if(e===`bedrock-camp`){let e=_(Z(`bedrock-camp`));return On(`amazon-bedrock`).filter(t=>g(t,e)).map(e=>({...e,api:`bedrock-camp-converse`,provider:`bedrock-camp`}))}let t=q(e);if(t.getModelIds){let n;try{n=t.getModelIds()}catch(t){return Y.error(`Provider getModelIds callback failed`,{providerId:e,error:t instanceof Error?t.message:String(t)}),[]}let i=new Map;for(let e of r())try{for(let t of On(e))i.set(t.id,t)}catch{}return n.map(n=>{let r=`${e}-${n.api===`openai`?`openai`:`anthropic`}`,a=i.get(n.id),o;a?o={...a,api:r,provider:e}:(o=Tr(e,n.id,``,r),n.name&&(o.name=n.name));let s=t.modelOverrides?.[n.id];return s&&Bn(o,s),Bn(o,n),o})}if(t.isOAuth){let n=On(`anthropic`),r=`${e}-anthropic`;return n.map(n=>{let i={...n,api:r,provider:e},a=t.modelOverrides?.[n.id];return a&&Bn(i,a),i})}return On(e===`azure-ai-foundry`?`anthropic`:e)}catch(t){return Y.error(`Failed to load models`,{providerId:e,error:t instanceof Error?t.message:String(t)}),[]}}function Vn(e){let t=X().find(t=>t.providerId===e);if(!t?.accessToken)return null;let n=!!t.tokenExpiresAt&&Date.now()>t.tokenExpiresAt-6e4;return{token:t.accessToken,maskedValue:t.maskedValue,expiresAt:t.tokenExpiresAt,userName:t.userName,userAvatar:t.userAvatar,expired:n}}var Hn=Object.assign({})[`/packages/webapp/providers.json`]??[],Y=o(`provider-settings`);function Un(e=Hn){if(e.length===0||X().length>0)return;let t=new Set(Ln());for(let n of e)if(!(!n.providerId||!n.apiKey)){if(!t.has(n.providerId)){Y.warn(`Unknown provider "${n.providerId}" in providers.json — skipping`);continue}er(n.providerId,n.apiKey,n.baseUrl)}let n=e.find(e=>e.providerId&&e.apiKey&&t.has(e.providerId));n?.model&&!localStorage.getItem(K)&&localStorage.setItem(K,`${n.providerId}:${n.model}`)}var Wn=[/haiku/i];function Gn(e){return Wn.some(t=>t.test(e))}function Kn(e){return e.filter(e=>!Gn(e.id))}function qn(){let e=X();if(e.length===0)return[];let t=new Map;for(let n of e){if(t.has(n.providerId))continue;let e=q(n.providerId);if(e.hidden||jn(n.providerId))continue;let r=Kn(J(n.providerId));if(r.length===0)continue;let i={providerId:n.providerId,providerName:e.name,models:r};t.set(n.providerId,i)}return[...t.values()]}function X(){Nn();let e=localStorage.getItem(G);if(!e)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>typeof e==`object`&&!!e&&typeof e.providerId==`string`&&typeof e.apiKey==`string`):[]}catch{return[]}}function Jn(e){return wn(localStorage)[e]??[]}function Yn(e,t){let n=wn(localStorage),r=t.map(e=>e.trim()).filter(e=>e.length>0);r.length===0?delete n[e]:n[e]=r,Tn(localStorage,n)}async function Xn(e,t){if(m()){Yn(e,t);return}let n=h();if(!n)throw Error(`setExtraOAuthDomainsAsync: no DOM and no panel-rpc client — cannot persist to page localStorage`);let{storeAfter:r}=await n.call(`oauth-extras-set`,{providerId:e,domains:t});try{Tn(localStorage,r)}catch(t){Y.warn(`worker-shim mirror failed after successful page write — reload to refresh`,{providerId:e,error:t instanceof Error?t.message:String(t)})}}function Zn(){return wn(localStorage)}function Qn(e){localStorage.setItem(G,JSON.stringify(e))}async function $n(e){if(m()){Qn(e);return}let t=h();if(!t)throw Error(`saveAccountsAsync: no DOM and no panel-rpc client — cannot persist to page localStorage`);let n=JSON.stringify(e),{storedJson:r}=await t.call(`save-oauth-accounts`,{accountsJson:n});try{localStorage.setItem(G,r)}catch(e){Y.warn(`worker-shim mirror failed after successful page write — reload to refresh`,{error:e instanceof Error?e.message:String(e)})}}function er(e,t,n,r,i){let a=X().filter(t=>t.providerId!==e),o={providerId:e,apiKey:t};n&&(o.baseUrl=n),r&&(o.deployment=r),i&&(o.apiVersion=i),a.push(o),Qn(a)}async function tr(e){let t=l();try{if(t===`extension-direct`){let t=await new Promise(t=>{chrome.runtime.sendMessage({type:`secrets.delete`,name:`oauth.${e}.token`},n=>{chrome.runtime.lastError&&Y.error(`SW secrets.delete transport failed`,{providerId:e,error:chrome.runtime.lastError.message}),t(n??{})})});t.error&&Y.error(`SW secrets.delete returned error`,{providerId:e,error:t.error})}else if(t===`extension-delegate`){let t=await u(`secrets.delete`,{name:`oauth.${e}.token`});t?.error&&Y.error(`Bridge secrets.delete returned error`,{providerId:e,error:t.error})}else if(t!==`connect`){let t=await fetch(s(`/api/secrets/oauth/${e}`),{method:`DELETE`,headers:c()});!t.ok&&t.status!==404&&Y.warn(`OAuth replica DELETE non-ok`,{providerId:e,status:t.status})}}catch(n){Y.error(`OAuth replica removal failed`,{providerId:e,topology:t,error:n instanceof Error?n.message:String(n)})}}async function nr(e){let t=X().find(t=>t.providerId===e),n=q(e);t&&n?.isOAuth&&await rr(e),await tr(e),await $n(X().filter(t=>t.providerId!==e));let r=localStorage.getItem(K)??``,i=r.indexOf(`:`);i>0&&r.slice(0,i)===e&&localStorage.removeItem(K)}async function rr(e){let t=X().find(t=>t.providerId===e);if(!t)return;let r=q(e);if(r?.isOAuth){if(r.onOAuthLogout)try{await r.onOAuthLogout()}catch(t){Y.warn(`onOAuthLogout failed`,{providerId:e,error:t instanceof Error?t.message:String(t)})}if(r.getOAuthLogoutUrl){let i=r.getOAuthLogoutUrl(t);if(i){let{openIdpLogoutUrl:t}=await n(async()=>{let{openIdpLogoutUrl:e}=await import(`./oauth-service-Dk3L2UWh.js`);return{openIdpLogoutUrl:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]));await t(i).catch(t=>{Y.warn(`IdP logout popup failed`,{providerId:e,error:t instanceof Error?t.message:String(t)})})}}await $n(X().map(t=>t.providerId===e?{providerId:t.providerId,apiKey:``,baseUrl:t.baseUrl,userName:t.userName,userAvatar:t.userAvatar,loggedOut:!0}:t)),await tr(e)}}async function ir(e,t={}){let n=Math.max(1,t.attempts??3),r=t.delayMs??150,i=t.sleep??(e=>new Promise(t=>setTimeout(t,e))),a;for(let t=0;t<n;t++){let o=await e();if(o.maskedValue)return{maskedValue:o.maskedValue};o.error&&(a=o.error),t<n-1&&await i(r)}return{lastError:a}}async function ar(e,t,n){let r={providerId:e.providerId,accessToken:e.accessToken,domains:e.domains.join(`,`)},{maskedValue:i,lastError:a}=await ir(()=>t.sendMaskRequest(r),n);if(!i){Y.error(`OAuth mask give-up: no masked value after retries`,{providerId:e.providerId,reason:a??`no error reported (cold SW or empty reply)`});return}let o=t.getAccounts(),s=o.find(t=>t.providerId===e.providerId);s&&(s.maskedValue=i,await t.saveAccounts(o))}async function or(e){let t=X().find(t=>t.providerId===e.providerId),n=X().filter(t=>t.providerId!==e.providerId);n.push({providerId:e.providerId,apiKey:``,accessToken:e.accessToken,refreshToken:e.refreshToken,tokenExpiresAt:e.tokenExpiresAt,userName:e.userName,userAvatar:e.userAvatar,baseUrl:e.baseUrl??t?.baseUrl}),await $n(n);let r=q(e.providerId)?.oauthTokenDomains??[],i=Jn(e.providerId),a=new Set,o=[];for(let e of[...r,...i]){let t=e.toLowerCase();a.has(t)||(a.add(t),o.push(e))}if(o.length===0)return;let d=l();try{if(d===`extension-direct`)await ar({providerId:e.providerId,accessToken:e.accessToken,domains:o},{sendMaskRequest:t=>new Promise(n=>{chrome.runtime.sendMessage({type:`secrets.mask-oauth-token`,...t},t=>{chrome.runtime.lastError&&Y.error(`SW mask-oauth-token transport failed`,{providerId:e.providerId,error:chrome.runtime.lastError.message});let r=typeof t==`object`&&t?t:void 0;r?.error&&Y.warn(`SW mask-oauth-token returned error`,{providerId:e.providerId,error:r.error}),n(r??{})})}),getAccounts:X,saveAccounts:$n});else if(d===`extension-delegate`)await ar({providerId:e.providerId,accessToken:e.accessToken,domains:o},{sendMaskRequest:t=>u(`secrets.mask-oauth-token`,t).then(t=>(t?.error&&Y.warn(`Bridge mask-oauth-token returned error`,{providerId:e.providerId,error:t.error}),t??{})).catch(t=>(Y.error(`Bridge mask-oauth-token transport failed`,{providerId:e.providerId,error:t instanceof Error?t.message:String(t)}),{})),getAccounts:X,saveAccounts:$n});else if(d!==`connect`){let t=await fetch(s(`/api/secrets/oauth-update`),{method:`POST`,headers:c({"Content-Type":`application/json`}),body:JSON.stringify({providerId:e.providerId,accessToken:e.accessToken,domains:o})});if(t.ok){let n=await t.json();if(typeof n.maskedValue==`string`){let t=X(),r=t.find(t=>t.providerId===e.providerId);r&&(r.maskedValue=n.maskedValue,await $n(t))}else Y.warn(`OAuth replica POST ok but missing maskedValue`,{providerId:e.providerId})}else Y.warn(`OAuth replica POST non-ok`,{providerId:e.providerId,status:t.status})}}catch(t){Y.error(`OAuth replica sync failed`,{providerId:e.providerId,topology:d,error:t instanceof Error?t.message:String(t)})}}var sr=`local`;function cr(e){let t=X().find(t=>t.providerId===e);return t&&(t.accessToken||t.apiKey)||null}function lr(e){let t=X().find(t=>t.providerId===e);return t?t.accessToken||t.apiKey||(q(e).optionalApiKey?sr:null):null}function Z(e){return X().find(t=>t.providerId===e)?.baseUrl??null}function ur(e){return X().find(t=>t.providerId===e)?.deployment??null}function dr(e){return X().find(t=>t.providerId===e)?.apiVersion??null}function Q(){let e=localStorage.getItem(K)||``,t=e.indexOf(`:`);return t>=0?e.slice(t+1):e}function fr(e){let t=e.indexOf(`:`);if(t>0){let n=e.slice(0,t),r=new Set([...d(),...Ln()]),i=n.includes(`.`);if(r.has(n)||!i){localStorage.setItem(K,e);return}}let n=$();localStorage.setItem(K,`${n}:${e}`)}function pr(){return localStorage.getItem(K)||``}function $(){let e=pr(),t=e.indexOf(`:`);if(t>0)return e.slice(0,t);let n=X(),r=Q();if(r){let e=n.find(e=>Rn(e.providerId)&&zn(e.providerId,r));if(e)return e.providerId}let i=n.find(e=>Rn(e.providerId));return i?i.providerId:n.length>0?n[0].providerId:`anthropic`}function mr(e){let t=Q();localStorage.setItem(K,`${e}:${t}`)}function hr(){let e=Q();localStorage.setItem(K,e)}function gr(){return lr($())}function _r(e){let t=$();er(t,e,Z(t)??void 0)}async function vr(){await nr($())}function yr(){return Z($())}function br(e){let t=$(),n=cr(t);n&&er(t,n,e||void 0)}function xr(){let e=$(),t=cr(e);t&&er(e,t)}function Sr(){let e=X(),t=$(),n=Q();return e.map(e=>{let r={providerId:e.providerId,apiKey:e.apiKey};return e.baseUrl&&(r.baseUrl=e.baseUrl),e.providerId===t&&n&&(r.model=n),r})}async function Cr(){let e=X();await Promise.allSettled(e.map(e=>nr(e.providerId))),localStorage.removeItem(G),localStorage.removeItem(K);for(let e of kn)localStorage.removeItem(e)}function wr(e){return/^(?:gpt[-.]?|o[0-9]|chatgpt)/i.test(e)?`openai`:`anthropic`}function Tr(e,t,n,r){return{id:t,name:t,provider:e,api:r??`${e}-${wr(t)}`,baseUrl:n??``,contextWindow:2e5,maxTokens:16384,input:[`text`,`image`],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},reasoning:!0}}function Er(e,t){return t.isOAuth||e===`azure-ai-foundry`?`anthropic`:e===`bedrock-camp`?`amazon-bedrock`:e}function Dr(e){if(!e)return Or();let t=$(),n=Z(t),r=q(t);try{let i=Dn(Er(t,r),e);if(!i?.id)throw Error(`Model ${e} not found`);let a=i;return r.isOAuth?a=J(t).find(t=>t.id===e)||{...a,api:`${t}-anthropic`,provider:t}:t===`bedrock-camp`&&(a={...a,api:`bedrock-camp-converse`,provider:`bedrock-camp`}),n&&(a={...a,baseUrl:n}),a}catch(i){if(Y.debug(`resolveModelById: pi-ai lookup miss, using provider fallback`,{providerId:t,modelId:e,error:i instanceof Error?i.message:String(i)}),r.isOAuth){let r=J(t).find(t=>t.id===e);return r?n?{...r,baseUrl:n}:r:Tr(t,e,n)}return Or()}}function Or(){let e=$(),t=Q(),n=Z(e),r=J(e),i=q(e),a=i.defaultModelId?r.find(e=>e.id.toLowerCase().includes(i.defaultModelId.toLowerCase()))?.id:void 0,o=t||a||r[0]?.id||`claude-sonnet-4-6`;try{let t=Er(e,i),a=Dn(t,o);if(!a?.id)throw Error(`Model ${o} not found in ${t} registry`);let s=a;return i.isOAuth?s=r.find(e=>e.id===o)||{...s,api:`${e}-anthropic`,provider:e}:e===`bedrock-camp`&&(s={...s,api:`bedrock-camp-converse`,provider:`bedrock-camp`}),n&&(s={...s,baseUrl:n}),s}catch(t){Y.debug(`resolveCurrentModel: pi-ai lookup miss, using provider fallback`,{providerId:e,effectiveModelId:o,error:t instanceof Error?t.message:String(t)});let a=r.find(e=>e.id===o);return a?n?{...a,baseUrl:n}:a:i.isOAuth?Tr(e,o,n):Dn(`anthropic`,`claude-sonnet-4-0`)}}function kr(e){let t=e.toLowerCase();if(!t)return null;let n=null,r=-1;for(let e of X())for(let i of J(e.providerId)){let e=i.id.toLowerCase(),a=(i.name??``).toLowerCase();if(!e.includes(t)&&!a.includes(t))continue;let o=i.contextWindow??0;(o>r||o===r&&Ar(i.id,n??``)>0)&&(r=o,n=i.id)}return n}function Ar(e,t){let n=e.match(/\d+/g)?.map(Number)??[],r=t.match(/\d+/g)?.map(Number)??[],i=Math.max(n.length,r.length);for(let e=0;e<i;e++){let t=(n[e]??0)-(r[e]??0);if(t!==0)return t}return 0}export{ir as A,br as B,q as C,$ as D,Q as E,Or as F,Xn as H,Dr as I,kr as L,ar as M,Rn as N,Gn as O,nr as P,or as R,Vn as S,cr as T,fr as U,Yn as V,mr as W,Ln as _,Un as a,ur as b,xr as c,X as d,qn as f,dr as g,lr as h,er as i,Pn as j,rr as k,hr as l,gr as m,In as n,Cr as o,Zn as p,En as r,vr as s,G as t,Sr as u,yr as v,J as w,Jn as x,Z as y,_r as z};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import{n as e,t}from"./rolldown-runtime-aKtaBQYM.js";import{t as n}from"./logger-LESFN7Hj.js";import{n as r,r as i}from"./panel-rpc-CjFVE0nK.js";import{n as a,o,t as s}from"./providers-Bchg39l1.js";import{r as c,s as l,t as u}from"./proxied-fetch-D8ebvbVd.js";import"./src-BcePBv4G.js";import{t as d}from"./runtime-env-byAg9ij-.js";import{i as f,r as p}from"./tool-ui-t6ocn6AG.js";import{t as m}from"./port-bridge-client-f_6YKEkm.js";import{d as h,f as g,l as ee,r as _,t as te,u as ne}from"./bedrock-camp-BO4bvAKs.js";const re=`slicc_oauth_extra_domains`;function ie(e){try{let t=e.getItem(re);if(!t)return{};let n=JSON.parse(t);if(typeof n!=`object`||!n||Array.isArray(n))return{};let r={};for(let[e,t]of Object.entries(n)){if(typeof e!=`string`||!Array.isArray(t))continue;let n=t.filter(e=>typeof e==`string`&&e.length>0);n.length>0&&(r[e]=n)}return r}catch{return{}}}function ae(e,t){try{e.setItem(re,JSON.stringify(t))}catch(e){throw Error(`Failed to persist OAuth extras (localStorage quota exceeded?): ${e instanceof Error?e.message:String(e)}`)}}function oe(){return d()?`extension-direct`:c()?`extension-delegate`:globalThis.__slicc_connect_mode?`connect`:`node-rest`}function se(){return oe()===`node-rest`}const ce={assign:0,create:0,clone:0,discard:0,update:0};function v(e,t){return ce.assign+=1,{...e,...t}}function le(e,t,n){return e>=t&&e<=n}function ue(e){return le(e,127462,127487)}function de(e){return le(e,65024,65039)}function fe(e){return le(e,768,879)||le(e,6832,6911)||le(e,7616,7679)||le(e,65056,65071)}function pe(e){return e>65535?2:1}function me(e,t){for(;t<e.length;){let n=e.codePointAt(t);if(fe(n)||de(n))t+=pe(n);else break}return t}function he(e,t){let n=e.codePointAt(t),r=t+pe(n);for(r=me(e,r);r<e.length-1&&e[r]===``;){let t=e.codePointAt(r+1);r+=1+pe(t),r=me(e,r)}return ue(n)&&r<e.length&&ue(e.codePointAt(r))&&(r+=pe(e.codePointAt(r))),r}function ge(e){return le(e,55296,56319)||le(e,768,879)||e===8205}function _e(e){let t=0,n=0;for(;n<e.length;)n=he(e,n),t++;return t}function ve(e,t){if(t===0)return!0;let n=0,r=0;for(;r<e.length;)if(r=he(e,r),n++,n>=t)return!0;return!1}function ye(e,t){let n=0,r=0;for(;r<e.length;)if(r=he(e,r),n++,n>t)return!1;return!0}function be(e,t){if(t===0)return!0;let n=0;for(;n<e.length;){if(ge(e.charCodeAt(n)))return ve(e,t);if(n++,n>=t)return!0}return!1}function xe(e,t){let n=0;for(;n<e.length;){if(ge(e.charCodeAt(n)))return ye(e,t);if(n++,n>t)return!1}return!0}var Se=e({Entries:()=>Xe,EntriesRegExp:()=>Ye,Every:()=>Ke,EveryAll:()=>qe,GraphemeCount:()=>Ue,HasPropertyKey:()=>C,IsArray:()=>Ce,IsAsyncIterator:()=>we,IsBigInt:()=>Te,IsBoolean:()=>Ee,IsClassInstance:()=>Ve,IsConstructor:()=>De,IsDeepEqual:()=>tt,IsEqual:()=>x,IsFunction:()=>Oe,IsGreaterEqualThan:()=>ze,IsGreaterThan:()=>Ie,IsInteger:()=>ke,IsIterator:()=>Ae,IsLessEqualThan:()=>Re,IsLessThan:()=>Le,IsMaxLength:()=>We,IsMinLength:()=>Ge,IsMultipleOf:()=>Be,IsNull:()=>je,IsNumber:()=>Me,IsObject:()=>y,IsObjectNotArray:()=>Ne,IsString:()=>b,IsSymbol:()=>Pe,IsUndefined:()=>Fe,IsUnsafePropertyKey:()=>Je,IsValueLike:()=>He,Keys:()=>w,Symbols:()=>Ze,TakeLeft:()=>S,Values:()=>Qe});function Ce(e){return Array.isArray(e)}function we(e){return y(e)&&Symbol.asyncIterator in e}function Te(e){return x(typeof e,`bigint`)}function Ee(e){return x(typeof e,`boolean`)}function De(e){if(Fe(e)||!Oe(e))return!1;let t=Function.prototype.toString.call(e);return!!(/^class\s/.test(t)||/\[native code\]/.test(t))}function Oe(e){return x(typeof e,`function`)}function ke(e){return Number.isInteger(e)}function Ae(e){return y(e)&&Symbol.iterator in e}function je(e){return x(e,null)}function Me(e){return Number.isFinite(e)}function Ne(e){return y(e)&&!Ce(e)}function y(e){return x(typeof e,`object`)&&!je(e)}function b(e){return x(typeof e,`string`)}function Pe(e){return x(typeof e,`symbol`)}function Fe(e){return x(e,void 0)}function x(e,t){return e===t}function Ie(e,t){return e>t}function Le(e,t){return e<t}function Re(e,t){return e<=t}function ze(e,t){return e>=t}function Be(e,t){if(Te(e)||Te(t))return BigInt(e)%BigInt(t)===0n;if(!Me(e)||ke(e)&&1/t%1==0)return!0;let n=e%t;return Math.min(Math.abs(n),Math.abs(n-t))<1e-10}function Ve(e){if(!y(e))return!1;let t=globalThis.Object.getPrototypeOf(e);return!je(t)&&x(typeof t.constructor,`function`)&&!(x(t.constructor,globalThis.Object)||x(t.constructor.name,`Object`))}function He(e){return Te(e)||Ee(e)||je(e)||Me(e)||b(e)||Fe(e)}function Ue(e){return _e(e)}function We(e,t){return xe(e,t)}function Ge(e,t){return be(e,t)}function Ke(e,t,n){for(let r=t;r<e.length;r++)if(!n(e[r],r))return!1;return!0}function qe(e,t,n){let r=!0;for(let i=t;i<e.length;i++)n(e[i],i)||(r=!1);return r}function S(e,t,n){return x(e.length,0)?n():t(e[0],e.slice(1))}function Je(e){return x(e,`__proto__`)||x(e,`constructor`)||x(e,`prototype`)}function C(e,t){return Je(t)?Object.prototype.hasOwnProperty.call(e,t):t in e}function Ye(e){return w(e).map(t=>[RegExp(`^${t}$`),e[t]])}function Xe(e){return Object.entries(e)}function w(e){return Object.getOwnPropertyNames(e)}function Ze(e){return Object.getOwnPropertySymbols(e)}function Qe(e){return Object.values(e)}function $e(e,t){if(!y(t))return!1;let n=w(e);return x(n.length,w(t).length)&&n.every(n=>tt(e[n],t[n]))}function et(e,t){return Ce(t)&&x(e.length,t.length)&&e.every((n,r)=>tt(e[r],t[r]))}function tt(e,t){return Ce(e)?et(e,t):y(e)?$e(e,t):x(e,t)}function nt(e){return e instanceof Boolean}function rt(e){return e instanceof Number}function it(e){return e instanceof String}function at(e){return globalThis.ArrayBuffer.isView(e)}function ot(e){return e instanceof globalThis.RegExp}function st(e){return e instanceof globalThis.Date}function ct(e){return e instanceof globalThis.Set}function lt(e){return e instanceof globalThis.Map}function ut(e){return y(e)&&C(e,`~guard`)}function dt(e){return e}function ft(e){return e.map(e=>gt(e))}function pt(e){let t={},n=Object.getOwnPropertyDescriptors(e);for(let e of Object.keys(n)){let r=n[e];C(r,`value`)&&Object.defineProperty(t,e,{...r,value:gt(r.value)})}return t}function mt(e){return new RegExp(e.source,e.flags)}function ht(e){return e}function gt(e){return e instanceof RegExp?mt(e):ut(e)?dt(e):Ce(e)?ft(e):y(e)?pt(e):ht(e)}function _t(e){return ce.clone+=1,gt(e)}const vt={immutableTypes:!1,maxErrors:8,useAcceleration:!0,exactOptionalPropertyTypes:!1,enumerableKind:!1,correctiveParse:!1};function yt(){return vt}function bt(e,t){for(let n of Object.keys(t))Object.defineProperty(e,n,{configurable:!0,writable:!0,enumerable:!1,value:t[n]});return e}function xt(e,t){return{...e,...t}}function T(e,t,n={}){ce.create+=1;let r=yt(),i=xt(t,n),a=r.enumerableKind?xt(i,e):bt(i,e);return r.immutableTypes?Object.freeze(a):a}function St(e,t){ce.discard+=1;let n={},r=Object.getOwnPropertyDescriptors(_t(e)),i=new Set(t);for(let e of Object.keys(r))i.has(e)||Object.defineProperty(n,e,r[e]);return n}function E(e,t,n){ce.update+=1;let r=yt(),i=_t(e);for(let e of Object.keys(t))Object.defineProperty(i,e,{configurable:!0,writable:!0,enumerable:r.enumerableKind,value:t[e]});for(let e of Object.keys(n))Object.defineProperty(i,e,{configurable:!0,enumerable:!0,writable:!0,value:n[e]});return i}function D(e,t){return y(e)&&C(e,`~kind`)&&x(e[`~kind`],t)}function Ct(e){return y(e)}function wt(e){return y(e)&&C(e,`~kind`)&&C(e,`type`)&&x(e[`~kind`],`OptionalAddAction`)&&Ct(e.type)}function Tt(e){return y(e)&&C(e,`~kind`)&&C(e,`type`)&&x(e[`~kind`],`OptionalRemoveAction`)&&Ct(e.type)}function Et(e){return y(e)&&C(e,`~kind`)&&C(e,`type`)&&x(e[`~kind`],`ReadonlyAddAction`)&&Ct(e.type)}function Dt(e){return y(e)&&C(e,`~kind`)&&C(e,`type`)&&x(e[`~kind`],`ReadonlyRemoveAction`)&&Ct(e.type)}function O(e,t,n){return T({"~kind":`Deferred`},{action:e,parameters:t,options:n},{})}function Ot(e){return D(e,`Deferred`)}function kt(e,t){return T({"~kind":`Promise`},{type:`promise`,item:e},t)}function At(e){return D(e,`Promise`)}function jt(e){return St(e,[`~kind`,`type`,`item`])}function Mt(e){return E(e,{"~immutable":!0},{})}function Nt(e){return Mt(e)}function Pt(e){return Ct(e)&&C(e,`~immutable`)}function Ft(e){return St(e,[`~optional`])}function It(e){return E(e,{"~optional":!0},{})}function Lt(e){return It(e)}function Rt(e){return Ct(e)&&C(e,`~optional`)}function zt(e){return St(e,[`~readonly`])}function Bt(e){return E(e,{"~readonly":!0},{})}function Vt(e){return Bt(e)}function Ht(e){return Ct(e)&&C(e,`~readonly`)}function Ut(e){return{enumerable:yt().enumerableKind,writable:!1,configurable:!1,value:e}}var Wt=class{constructor(){globalThis.Object.defineProperty(this,`~kind`,Ut(`Base`)),globalThis.Object.defineProperty(this,`~guard`,Ut({check:e=>this.Check(e),errors:e=>this.Errors(e)}))}Check(e){return!0}Errors(e){return[]}Convert(e){return e}Clean(e){return e}Default(e){return e}Create(){throw Error(`Create not implemented`)}Clone(){throw Error(`Clone not implemented`)}};function Gt(e){return D(e,`Base`)}function Kt(e,t){return T({"~kind":`Array`},{type:`array`,items:e},t)}function qt(e){return D(e,`Array`)}function Jt(e){return St(e,[`~kind`,`type`,`items`])}function Yt(e,t){return T({"~kind":`AsyncIterator`},{type:`asyncIterator`,iteratorItems:e},t)}function Xt(e){return D(e,`AsyncIterator`)}function Zt(e){return St(e,[`~kind`,`type`,`iteratorItems`])}function Qt(e,t,n={}){return T({"~kind":`Constructor`},{type:`constructor`,parameters:e,instanceType:t},n)}function $t(e){return D(e,`Constructor`)}function en(e){return St(e,[`~kind`,`type`,`parameters`,`instanceType`])}function tn(e,t,n={}){return T({"~kind":`Function`},{type:`function`,parameters:e,returnType:t},n)}function nn(e){return D(e,`Function`)}function rn(e){return St(e,[`~kind`,`type`,`parameters`,`returnType`])}function an(e,t){return T({"~kind":`Ref`},{$ref:e},t)}function on(e){return D(e,`Ref`)}function sn(e,t){return T({"~kind":`Generic`},{type:`generic`,parameters:e,expression:t})}function cn(e){return D(e,`Generic`)}function ln(e){return T({"~kind":`Any`},{},e)}function un(e){return D(e,`Any`)}function k(e){return T({"~kind":`Never`},{not:{}},e)}function dn(e){return D(e,`Never`)}function fn(e){return w(e).filter(t=>!Rt(e[t]))}function pn(e){return w(e)}function mn(e){return Qe(e)}function A(e,t={}){let n=fn(e);return T({"~kind":`Object`},{type:`object`,...n.length>0?{required:n}:{},properties:e},t)}function j(e){return D(e,`Object`)}function hn(e){return St(e,[`~kind`,`type`,`properties`,`required`])}function M(e,t={}){return T({"~kind":`Union`},{anyOf:e},t)}function N(e){return D(e,`Union`)}function gn(e){return St(e,[`~kind`,`anyOf`])}function _n(e){return T({"~kind":`Unknown`},{},e)}function vn(e){return D(e,`Unknown`)}function yn(e,t,n){return T({"~kind":`Cyclic`},{$defs:w(e).reduce((t,n)=>({...t,[n]:E(e[n],{},{$id:n})}),{}),$ref:t},n)}function bn(e){return D(e,`Cyclic`)}function xn(e){return Ne(e)&&C(e,`~unsafe`)&&je(e[`~unsafe`])}function Sn(e){return D(e,`Infer`)}function Cn(e){return D(e,`Enum`)}function wn(e,t={}){return T({"~kind":`Intersect`},{allOf:e},t)}function P(e){return D(e,`Intersect`)}function Tn(e){return St(e,[`~kind`,`allOf`])}function En(){throw Error(`Unreachable`)}var Dn=e({Hash:()=>er,HashCode:()=>$n});function On(e){let t=new Set,n=e;for(;n&&n!==Object.prototype;){for(let e of Reflect.ownKeys(n))e!==`constructor`&&typeof e!=`symbol`&&t.add(e);n=Object.getPrototypeOf(n)}return[...t]}function kn(e){return typeof e==`number`}var F;(function(e){e[e.Array=0]=`Array`,e[e.BigInt=1]=`BigInt`,e[e.Boolean=2]=`Boolean`,e[e.Date=3]=`Date`,e[e.Constructor=4]=`Constructor`,e[e.Function=5]=`Function`,e[e.Null=6]=`Null`,e[e.Number=7]=`Number`,e[e.Object=8]=`Object`,e[e.RegExp=9]=`RegExp`,e[e.String=10]=`String`,e[e.Symbol=11]=`Symbol`,e[e.TypeArray=12]=`TypeArray`,e[e.Undefined=13]=`Undefined`})(F||={});let An=BigInt(`14695981039346656037`);const[jn,Mn]=[BigInt(`1099511628211`),BigInt(`18446744073709551616`)],Nn=Array.from({length:256}).map((e,t)=>BigInt(t)),Pn=new Float64Array(1),Fn=new DataView(Pn.buffer),In=new Uint8Array(Pn.buffer);function I(e){An^=Nn[e],An=An*jn%Mn}function Ln(e){I(F.Array);for(let t of e)Qn(t)}function Rn(e){I(F.BigInt),Fn.setBigInt64(0,e);for(let e of In)I(e)}function zn(e){I(F.Boolean),I(+!!e)}function Bn(e){I(F.Constructor),Qn(e.toString())}function Vn(e){I(F.Date),Qn(e.getTime())}function Hn(e){I(F.Function),Qn(e.toString())}function Un(e){I(F.Null)}function Wn(e){I(F.Number),Fn.setFloat64(0,e,!0);for(let e of In)I(e)}function Gn(e){I(F.Object);for(let t of On(e).sort())Qn(t),Qn(e[t])}function Kn(e){I(F.RegExp),Jn(e.toString())}const qn=new TextEncoder;function Jn(e){I(F.String);for(let t of qn.encode(e))I(t)}function Yn(e){I(F.Symbol),Qn(e.toString())}function Xn(e){I(F.TypeArray);let t=new Uint8Array(e.buffer);for(let e=0;e<t.length;e++)I(t[e])}function Zn(e){return I(F.Undefined)}function Qn(e){return at(e)?Xn(e):st(e)?Vn(e):ot(e)?Kn(e):nt(e)?zn(e.valueOf()):it(e)?Jn(e.valueOf()):rt(e)?Wn(e.valueOf()):kn(e)?Wn(e):Ce(e)?Ln(e):Ee(e)?zn(e):Te(e)?Rn(e):De(e)?Bn(e):je(e)?Un(e):y(e)?Gn(e):b(e)?Jn(e):Pe(e)?Yn(e):Fe(e)?Zn(e):Oe(e)?Hn(e):En()}function $n(e){return An=BigInt(`14695981039346656037`),Qn(e),An}function er(e){return $n(e).toString(16).padStart(16,`0`)}function tr(e){return Ct(e)&&C(e,`~codec`)&&y(e[`~codec`])&&C(e[`~codec`],`encode`)&&C(e[`~codec`],`decode`)}function nr(e){return T({"~kind":`BigInt`},{type:`bigint`},e)}function rr(e){return D(e,`BigInt`)}function ir(e){return D(e,`Boolean`)}const ar=`-?(?:0|[1-9][0-9]*)`;function or(e){return T({"~kind":`Integer`},{type:`integer`},e)}function sr(e){return D(e,`Integer`)}function cr(e,t){return T({"~kind":`Iterator`},{type:`iterator`,iteratorItems:e},t)}function lr(e){return D(e,`Iterator`)}function ur(e){return St(e,[`~kind`,`type`,`iteratorItems`])}var dr=class extends Error{constructor(e){super(`Invalid Literal value`),Object.defineProperty(this,"cause",{value:{value:e},writable:!1,configurable:!1,enumerable:!1})}};function fr(e){return Te(e)?`bigint`:Ee(e)?`boolean`:Me(e)?`number`:b(e)?`string`:(()=>{throw new dr(e)})()}function L(e,t){return T({"~kind":`Literal`},{type:fr(e),const:e},t)}function pr(e){return Te(e)||Ee(e)||Me(e)||b(e)}function mr(e){return R(e)&&Te(e.const)}function hr(e){return R(e)&&Ee(e.const)}function gr(e){return R(e)&&Me(e.const)}function _r(e){return R(e)&&b(e.const)}function R(e){return D(e,`Literal`)}function vr(e){return T({"~kind":`Null`},{type:`null`},e)}function yr(e){return D(e,`Null`)}const br=`-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?`;function xr(e){return T({"~kind":`Number`},{type:`number`},e)}function Sr(e){return D(e,`Number`)}function Cr(e){return T({"~kind":`Symbol`},{type:`symbol`},e)}function wr(e){return D(e,`Symbol`)}function Tr(e){return T({"~kind":`String`},{type:`string`},e)}function Er(e){return D(e,`String`)}function Dr(e){let t=za(e);return x(t.length,2)?t[0]:[]}function Or(e){return!0}function kr(e){return S(e,(e,t)=>jr(e)?kr(t):!1,()=>!0)}function Ar(e){return!x(e.length,0)&&kr(e)}function jr(e){return N(e)?Ar(e.anyOf):R(e)?Or(e.const):!1}function Mr(e){return Ar(e)}function Nr(e){return T({"~kind":`TemplateLiteral`},{type:`string`,pattern:e},{})}function Pr(e,t,n=[]){return S(e,(e,r)=>Pr(r,t,[...n,`${e}${t}`]),()=>n)}function Fr(e,t){return x(e.length,0)?[`${t}`]:Pr(e,t)}function Ir(e,t,n=[]){return S(t,(t,r)=>Ir(e,r,[...n,...Lr(e,t)]),()=>n)}function Lr(e,t){return N(t)?Ir(e,t.anyOf):R(t)?Fr(e,t.const):En()}function Rr(e,t){return S(t,(t,n)=>Rr(Lr(e,t),n),()=>e)}function zr(e){return e.map(e=>L(e))}function Br(e){return M(zr(Rr([],e)))}function Vr(e){return x(e.length,0)?En():x(e.length,1)&&R(e[0])?e[0]:Br(e)}function Hr(e){let t=Dr(e);return x(t.length,0)?Tr():Mr(t)?Vr(t):Nr(e)}function Ur(e){let t=Hr(e);return oo(t)?Tr():t}function Wr(e,t){return T({"~kind":`Record`},{type:`object`,patternProperties:{[e]:t}})}function Gr(e){return Wr(Ri,e)}function Kr(e){return A({true:e,false:e})}function qr(e){return b(e)||Me(e)?L(e):je(e)?vr():k()}function Jr(e){return e.map(e=>qr(e))}function Yr(e){return M(Jr(e))}function Xr(e){return Yr(e.enum)}function Zr(e,t){return Ni(Yr(e),t)}function Qr(e,t){return Wr(Ii,t)}function $r(e,t={}){let[n,r,i]=[e,e.length,!1];return T({"~kind":`Tuple`},{type:`array`,additionalItems:i,items:n,minItems:r},t)}function z(e){return D(e,`Tuple`)}function ei(e){return St(e,[`~kind`,`type`,`items`,`minItems`,`additionalItems`])}function ti(e){return e.reduceRight((e,t,n)=>({[n]:t,...e}),{})}function ni(e){return A(ti(e.items))}function ri(e,t){return Ht(e)?!!Ht(t):!1}function ii(e,t){return Rt(e)?!!Rt(t):!1}function ai(e,t){let n=ri(e,t),r=ii(e,t),i=zt(Ft(_i([e,t])));return n&&r?Bt(It(i)):n&&!r?Bt(i):!n&&r?It(i):i}function oi(e,t,n){return n in e?n in t?ai(e[n],t[n]):e[n]:n in t?t[n]:k()}function si(e,t){return[...new Set([...w(t),...w(e)])].reduce((n,r)=>({...n,[r]:oi(e,t,r)}),{})}function ci(e){return j(e)?e.properties:z(e)?ti(e.items):En()}function li(e,t){return A(si(ci(e),ci(t)))}function ui(e,t){let n=nc(e,t);return x(n,`left-inside`)?e:x(n,`right-inside`)||x(n,`equal`)?t:k()}function di(e){return j(e)||z(e)}function fi(e,t){let n=N(e),r=N(t);return n||r}function pi(e,t){let n=yi(e),r=yi(t),i=fi(n,r),a=di(n),o=di(r);return i?_i([n,r]):a&&o?li(n,r):a&&!o?n:!a&&o?r:ui(n,r)}function mi(e,t,n=[]){return S(t,(t,r)=>mi(e,r,[...n,pi(e,t)]),()=>x(n.length,0)?[e]:n)}function hi(e,t,n=[]){return S(e,(e,r)=>hi(r,t,[...n,...gi([e],t)]),()=>n)}function gi(e,t=[]){return S(e,(e,n)=>N(e)?gi(n,hi(e.anyOf,t)):gi(n,mi(e,t)),()=>t)}function _i(e){return sc(gi(e))}function vi(e){return sc(e)}function yi(e){return P(e)?_i(e.allOf):N(e)?vi(e.anyOf):e}function bi(e){return x(e.length,1)?e[0]:x(e.length,0)?k():M(e)}function xi(e,t){return Ni(_i(e),t)}function Si(e,t){return b(e)||Me(e)?A({[e]:t}):x(e,!1)?A({false:t}):x(e,!0)?A({true:t}):A({})}function Ci(e,t){return Wr(Li,t)}function wi(e,t){return C(e,`pattern`)&&(b(e.pattern)||e.pattern instanceof RegExp)?Wr(e.pattern.toString(),t):Wr(Ri,t)}function Ti(e,t){return Mr(Dr(e))?Ni(Ur(e),t):Wr(e,t)}function Ei(e){return N(e)?Di(e.anyOf):[e]}function Di(e){return e.reduce((e,t)=>[...e,...Ei(t)],[])}function Oi(e){return e.some(e=>Er(e)||Sr(e)||sr(e))}function ki(e,t){return x(Oi(e),!0)?Wr(Ri,t):void 0}function Ai(e,t){return e.reduce((e,n)=>R(n)&&(b(n.const)||Me(n.const))?{...e,[n.const]:t}:e,{})}function ji(e,t){return A(Ai(e,t))}function Mi(e,t){let n=Di(e),r=ki(n,t);return Ct(r)?r:ji(n,t)}function Ni(e,t){return un(e)?Gr(t):ir(e)?Kr(t):Cn(e)?Zr(e.enum,t):sr(e)?Qr(e,t):P(e)?xi(e.allOf,t):R(e)?Si(e.const,t):Sr(e)?Ci(e,t):N(e)?Mi(e.anyOf,t):Er(e)?wi(e,t):oo(e)?Ti(e.pattern,t):A({})}function Pi(e,t,n){return G([e])?E(Ni(e,t),{},n):zi(e,t,n)}function Fi(e,t,n,r,i){return Pi(K(e,t,n),K(e,t,r),i)}const Ii=`^${ar}$`,Li=`^${br}$`,Ri=`^.*$`;function zi(e,t,n={}){return O(`Record`,[e,t],n)}function Bi(e,t,n={}){return Pi(e,t,n)}function Vi(e,t){return Wr(e,t)}function Hi(e){return w(e.patternProperties)[0]}function Ui(e){let t=Hi(e);return x(t,Ri)?Tr():x(t,Ii)?or():x(t,Li)?xr():Hr(t)}function Wi(e){return e.patternProperties[Hi(e)]}function Gi(e){return D(e,`Record`)}function Ki(e){return T({"~kind":`Rest`},{type:`rest`,items:e},{})}function qi(e){return D(e,`Rest`)}function Ji(e){return D(e,`This`)}function Yi(e){return T({"~kind":`Undefined`},{type:`undefined`},e)}function Xi(e){return D(e,`Undefined`)}function Zi(e){return D(e,`Void`)}function Qi(e){return nr()}function $i(e){return Tr()}function ea(e){return xr()}function ta(e){return or()}function na(e){return k()}function ra(e){return L(e)}function ia(e){return e}function aa(e){return M(e[1])}function oa(e){return e.length===3?[...e[0],...e[2]]:e.length===1?[...e[0]]:[]}function sa(e){return[e[0],...e[1]]}function ca(e){return e}function la(e){return e[1]}function ua(e){return x(e.length,2)}function da(e,t,n){return ua(e)?t(e[0],e[1]):n()}function fa(e,t){return x(t.indexOf(e),0)?[e,t.slice(e.length)]:[]}function pa(e,t){for(let n=0;n<e.length;n++){let r=fa(e[n],t);if(ua(r))return r}return[]}function ma(e,t){return Array.from({length:t-e+1},(t,n)=>String.fromCharCode(e+n))}const ha=[...ma(97,122),...ma(65,90)],ga=[`0`,...ma(49,57)];function _a(e){let t=e.indexOf(`*/`);return x(t,-1)?``:e.slice(t+2)}function va(e){let t=e.indexOf(`
|
|
2
|
+
`);return x(t,-1)?``:e.slice(t)}function ya(e){return e.replace(/^[ \t\r\f\v]+/,``)}function ba(e){let t=ya(e);return t.startsWith(`/*`)?ba(_a(t.slice(2))):t.startsWith(`//`)?ba(va(t.slice(2))):t}function xa(e){let t=e.trimStart();return t.startsWith(`/*`)?xa(_a(t.slice(2))):t.startsWith(`//`)?xa(va(t.slice(2))):t}[...ga];function Sa(e,t){return pa([e],t)}function Ca(e,t){return x(e,``)?[``,t]:e.startsWith(`
|
|
3
|
+
`)?Sa(e,ba(t)):e.startsWith(` `)?Sa(e,t):Sa(e,xa(t))}[...ha,...ga],[...ga];function wa(e){return x(e,``)?[]:[e.slice(0,1),e.slice(1)]}function Ta(e,t){return S(e,(e,n)=>t.startsWith(e)?!0:Ta(n,t),()=>!1)}function Ea(e,t,n=``){return da(wa(t),(r,i)=>Ta(e,t)?[n,t]:Ea(e,i,`${n}${r}`),()=>[])}function Da(e,t){return da(Ea(e,t),(e,t)=>x(e,``)?[]:[e,t],()=>[])}const B=(e,t,n=()=>[])=>e.length===2?t(e):n(),Oa=e=>B(Ca(`-?(?:0|[1-9][0-9]*)n`,e),([e,t])=>[Qi(e),t]),ka=e=>B(Ca(`.*`,e),([e,t])=>[$i(e),t]),Aa=e=>B(Ca(`-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?`,e),([e,t])=>[ea(e),t]),ja=e=>B(Ca(`-?(?:0|[1-9][0-9]*)`,e),([e,t])=>[ta(e),t]),Ma=e=>B(Ca(`(?!)`,e),([e,t])=>[na(e),t]),Na=e=>B(Da([`-?(?:0|[1-9][0-9]*)n`,`.*`,`-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?`,`-?(?:0|[1-9][0-9]*)`,`(?!)`,`(`,`)`,`$`,`|`],e),([e,t])=>[ra(e),t]),Pa=e=>B(B(Oa(e),([e,t])=>[e,t],()=>B(ka(e),([e,t])=>[e,t],()=>B(Aa(e),([e,t])=>[e,t],()=>B(ja(e),([e,t])=>[e,t],()=>B(Ma(e),([e,t])=>[e,t],()=>B(Fa(e),([e,t])=>[e,t],()=>B(Na(e),([e,t])=>[e,t],()=>[]))))))),([e,t])=>[ia(e),t]),Fa=e=>B(B(Ca(`(`,e),([e,t])=>B(Ra(t),([t,n])=>B(Ca(`)`,n),([n,r])=>[[e,t,n],r]))),([e,t])=>[aa(e),t]),Ia=e=>B(B(B(La(e),([e,t])=>B(Ca(`|`,t),([t,n])=>B(Ia(n),([n,r])=>[[e,t,n],r]))),([e,t])=>[e,t],()=>B(B(La(e),([e,t])=>[[e],t]),([e,t])=>[e,t],()=>B([[],e],([e,t])=>[e,t],()=>[]))),([e,t])=>[oa(e),t]),La=e=>B(B(Pa(e),([e,t])=>B(Ra(t),([t,n])=>[[e,t],n])),([e,t])=>[sa(e),t]),Ra=e=>B(B(Ia(e),([e,t])=>[e,t],()=>B(La(e),([e,t])=>[e,t],()=>[])),([e,t])=>[ca(e),t]),za=e=>B(B(Ca(`^`,e),([e,t])=>B(Ra(t),([t,n])=>B(Ca(`$`,n),([n,r])=>[[e,t,n],r]))),([e,t])=>[la(e),t]);function Ba(e){return e.join(`|`)}function Va(e){return e.slice(1,e.length-1)}function Ha(e,t,n){return $a(t,`${n}${e}`)}function Ua(e,t){return $a(e,`${t}-?(?:0|[1-9][0-9]*)n`)}function Wa(e,t){return $a(e,`${t}${ar}`)}function Ga(e,t){return $a(e,`${t}${br}`)}function Ka(e,t){return Qa(M([L(`false`),L(`true`)]),e,t)}function qa(e,t){return $a(e,`${t}.*`)}function Ja(e,t,n){return $a(t,`${n}${Va(e)}`)}function Ya(e,t,n){return Qa(no(e,{}),t,n)}function Xa(e,t,n){return Za(Jr(e),t,n)}function Za(e,t,n,r=[]){return S(e,(e,i)=>Za(i,t,n,[...r,Qa(e,[],``)]),()=>$a(t,`${n}(${Ba(r)})`))}function Qa(e,t,n){return Cn(e)?Xa(e.enum,t,n):sr(e)?Wa(t,n):R(e)?Ha(e.const,t,n):rr(e)?Ua(t,n):ir(e)?Ka(t,n):Sr(e)?Ga(t,n):Er(e)?qa(t,n):oo(e)?Ja(e.pattern,t,n):ao(e)?Ya(e.parameters[0],t,n):N(e)?Za(e.anyOf,t,n):`(?!)`}function $a(e,t){return S(e,(e,n)=>Qa(e,n,t),()=>t)}function eo(e){return`^${$a(e,``)}$`}function to(e){return Nr(eo(e))}function no(e,t){return G(e)?E(to(e),{},t):io(e,t)}function ro(e,t,n,r){return no(tf(e,t,n),r)}function io(e,t={}){return O(`TemplateLiteral`,[e],t)}function ao(e){return Ct(e)&&C(e,`action`)&&x(e.action,`TemplateLiteral`)}function oo(e){return D(e,`TemplateLiteral`)}function so(e){return T({"~kind":`ExtendsUnion`},{inferred:e})}function co(e){return y(e)&&C(e,`~kind`)&&C(e,`inferred`)&&x(e[`~kind`],`ExtendsUnion`)&&y(e.inferred)}function V(e){return T({"~kind":`ExtendsTrue`},{inferred:e})}function lo(e){return y(e)&&C(e,`~kind`)&&C(e,`inferred`)&&x(e[`~kind`],`ExtendsTrue`)&&y(e.inferred)}function H(){return T({"~kind":`ExtendsFalse`},{})}function uo(e){return y(e)&&C(e,`~kind`)&&x(e[`~kind`],`ExtendsFalse`)}function fo(e){return co(e)||lo(e)}function po(e,t,n){return fo(e)?t(e.inferred):n()}function mo(e,t,n,r){return po(W(e,n,r),r=>V(v(v(e,r),{[t]:n})),()=>H())}function ho(e,t){return V(e)}function go(e,t,n){return W(e,t,Yr(n))}function _o(e,t,n){return S(n,(n,r)=>po(W(e,t,n),e=>_o(e,t,r),()=>H()),()=>V(e))}function vo(e,t,n){return W(e,t,Ur(n))}function yo(e,t,n){return S(n,(n,r)=>po(W(e,t,n),e=>V(e),()=>yo(e,t,r)),()=>H())}function U(e,t,n){return un(n)?ho(e,t):Cn(n)?go(e,t,n.enum):Sn(n)?mo(e,n.name,t,n.extends):P(n)?_o(e,t,n.allOf):oo(n)?vo(e,t,n.pattern):N(n)?yo(e,t,n.anyOf):vn(n)?V(e):H()}function bo(e,t,n){return Sn(n)?U(e,t,n):un(n)||vn(n)?V(e):so(e)}function xo(e,t){let n=Pt(e),r=Pt(t);return n&&r||!n&&r?!0:!(n&&!r)}function So(e,t,n,r){return qt(r)?xo(t,r)?W(e,n,r.items):H():U(e,t,r)}function Co(e,t,n){return Xt(n)?W(e,t,n.iteratorItems):U(e,Yt(t),n)}function wo(e,t,n){return rr(n)?V(e):U(e,t,n)}function To(e,t,n){return ir(n)?V(e):U(e,t,n)}function Eo(e,t,n,r,i){let a=Sn(r)?t:r,o=Sn(r)?r:t,s=Rt(t),c=Rt(r);return!s&&c?H():po(W(e,a,o),e=>ko(e,n,i),()=>H())}function Do(e,t,n,r){return S(r,(r,i)=>Eo(e,t,n,r,i),()=>Rt(t)?V(e):H())}function Oo(e,t,n){return S(t,(t,r)=>Do(e,t,r,n),()=>V(e))}function ko(e,t,n){return Oo(e,t,n)}function Ao(e,t,n){return Zi(n)?V(e):W(e,t,n)}function jo(e,t,n,r){return un(r)||vn(r)?V(e):$t(r)?po(ko(e,t,r.parameters),e=>Ao(e,n,r.instanceType),()=>H()):H()}function Mo(e,t,n){return W(e,Xr(t),n)}function No(e,t,n,r){return un(r)||vn(r)?V(e):nn(r)?po(ko(e,t,r.parameters),e=>Ao(e,n,r.returnType),()=>H()):H()}function Po(e,t,n){return sr(n)||Sr(n)?V(e):U(e,t,n)}function Fo(e,t,n){return W(e,_i(t),n)}function Io(e,t,n){return lr(n)?W(e,t,n.iteratorItems):U(e,cr(t),n)}function Lo(e,t,n){return t===n?V(e):H()}function Ro(e,t,n){return R(n)?Lo(e,t,n.const):rr(n)?V(e):U(e,L(t),n)}function zo(e,t,n){return R(n)?Lo(e,t,n.const):ir(n)?V(e):U(e,L(t),n)}function Bo(e,t,n){return R(n)?Lo(e,t,n.const):Sr(n)?V(e):U(e,L(t),n)}function Vo(e,t,n){return R(n)?Lo(e,t,n.const):Er(n)?V(e):U(e,L(t),n)}function Ho(e,t,n){return Te(t.const)?Ro(e,t.const,n):Ee(t.const)?zo(e,t.const,n):Me(t.const)?Bo(e,t.const,n):b(t.const)?Vo(e,t.const,n):En()}function Uo(e,t,n){return Sn(n)?U(e,t,n):V(e)}function Wo(e,t,n){return yr(n)?V(e):U(e,t,n)}function Go(e,t,n){return Sr(n)?V(e):U(e,t,n)}function Ko(e,t,n){return Rt(t)?Rt(n)?V(e):H():V(e)}function qo(e,t,n){return Sn(n)&&dn(n.extends)?H():po(W(e,t,n),e=>Ko(e,t,n),()=>H())}function Jo(e,t){return e.reduce((e,n)=>n in t&&fo(t[n])?{...e,...t[n].inferred}:En(),{})}function Yo(e,t,n){let r={};for(let i of w(n))r[i]=i in t?qo({},t[i],n[i]):Rt(n[i])?Sn(n[i])?V(v(e,{[n[i].name]:n[i].extends})):V(e):H();let i=Qe(r).every(e=>fo(e)),a=i?Jo(w(r),r):{};return i?V(a):H()}function Xo(e,t,n){let r=Yo(e,t,n);return fo(r)?V(v(e,r.inferred)):H()}function Zo(e,t,n){return Xo(e,t,n)}function Qo(e,t,n){return j(n)?Zo(e,t,n.properties):U(e,A(t),n)}function $o(e,t,n){return At(n)?W(e,t,n.item):U(e,kt(t),n)}function es(e,t,n){return Er(n)?V(e):U(e,t,n)}function ts(e,t,n){return wr(n)?V(e):U(e,t,n)}function ns(e,t,n){return W(e,Ur(t),n)}function rs(e,t){return T({"~kind":`Inferrable`},{name:e,type:t},{})}function is(e){return y(e)&&C(e,`~kind`)&&C(e,`name`)&&C(e,`type`)&&x(e[`~kind`],`Inferrable`)&&b(e.name)&&y(e.type)}function as(e){return qi(e)?Sn(e.items)?qt(e.items.extends)?rs(e.items.name,e.items.extends.items):vn(e.items.extends)?rs(e.items.name,e.items.extends):void 0:En():void 0}function os(e){return Sn(e)?rs(e.name,e.extends):void 0}function ss(e,t,n=[]){return S(e,(e,r)=>po(W({},e,t),()=>ss(r,t,[...n,e]),()=>void 0),()=>n)}function cs(e,t,n,r){let i=ss(n,r);return Ce(i)?V(v(e,{[t]:$r(i)})):H()}function ls(e,t,n,r){let i=ss(n,r);return Ce(i)?V(v(e,{[t]:M(i)})):H()}function us(e){return[...e].reverse()}function ds(e,t){return t?us(e):e}function fs(e){let t=e.length>0?e[0]:void 0;return Ct(Ct(t)?as(t):void 0)}function ps(e,t,n,r,i,a){return po(W(e,n,i),e=>gs(e,t,r,a),()=>H())}function ms(e,t,n,r,i){let a=as(r);return is(a)?cs(e,a.name,ds(n,t),a.type):S(n,(n,a)=>ps(e,t,n,a,r,i),()=>H())}function hs(e,t,n,r){return S(r,(r,i)=>ms(e,t,n,r,i),()=>x(n.length,0)?V(e):H())}function gs(e,t,n,r){return hs(e,t,n,r)}function _s(e,t,n){let r=ef(e,{callstack:[]},n),i=fs(r);return gs(e,i,ds(t,i),ds(r,i))}function vs(e,t,n){let r=os(n);return is(r)?ls(e,r.name,t,r.type):S(t,(t,r)=>po(W(e,t,n),e=>vs(e,r,n),()=>H()),()=>V(e))}function ys(e,t,n){let r=ef(e,{callstack:[]},t);return z(n)?_s(e,r,n.items):qt(n)?vs(e,r,n.items):U(e,$r(r),n)}function bs(e,t,n){return Zi(n)||Xi(n)?V(e):U(e,t,n)}function xs(e,t,n){return S(n,(n,r)=>po(W(e,t,n),e=>V(e),()=>xs(e,t,r)),()=>H())}function Ss(e,t,n){return S(t,(t,r)=>po(xs(e,t,n),e=>Ss(e,r,n),()=>H()),()=>V(e))}function Cs(e,t,n){let r=os(n);return is(r)?ls(e,r.name,t,r.type):N(n)?Ss(e,t,n.anyOf):Ss(e,t,[n])}function ws(e,t,n){return Sn(n)?U(e,t,n):un(n)||vn(n)?V(e):H()}function Ts(e,t,n){return Zi(n)?V(e):U(e,t,n)}function W(e,t,n){return un(t)?bo(e,t,n):qt(t)?So(e,t,t.items,n):Xt(t)?Co(e,t.iteratorItems,n):rr(t)?wo(e,t,n):ir(t)?To(e,t,n):$t(t)?jo(e,t.parameters,t.instanceType,n):Cn(t)?Mo(e,t,n):nn(t)?No(e,t.parameters,t.returnType,n):sr(t)?Po(e,t,n):P(t)?Fo(e,t.allOf,n):lr(t)?Io(e,t.iteratorItems,n):R(t)?Ho(e,t,n):dn(t)?Uo(e,t,n):yr(t)?Wo(e,t,n):Sr(t)?Go(e,t,n):j(t)?Qo(e,t.properties,n):At(t)?$o(e,t.item,n):Er(t)?es(e,t,n):wr(t)?ts(e,t,n):oo(t)?ns(e,t.pattern,n):z(t)?ys(e,t.items,n):Xi(t)?bs(e,t,n):N(t)?Cs(e,t.anyOf,n):vn(t)?ws(e,t,n):Zi(t)?Ts(e,t,n):H()}function Es(e,t){return _i([...e,A(t)])}function Ds(e,t,n){return G(e)?E(Es(e,t),{},n):ks(e,t,n)}function Os(e,t,n,r,i){return Ds(tf(e,t,n),$d(e,t,r),i)}function ks(e,t,n={}){return O(`Interface`,[e,t],n)}function As(e){return Ct(e)&&C(e,`action`)&&x(e.action,`Interface`)}function js(e,t,n){return e.includes(n)?!0:Ps([...e,n],t,t[n])}function Ms(e,t,n){return Ns(e,t,mn(n))}function Ns(e,t,n){return S(n,(n,r)=>Ps(e,t,n)?!0:Ns(e,t,r),()=>!1)}function Ps(e,t,n){return on(n)?js(e,t,n.$ref):qt(n)?Ps(e,t,n.items):Xt(n)?Ps(e,t,n.iteratorItems):$t(n)?Ns(e,t,[...n.parameters,n.instanceType]):nn(n)?Ns(e,t,[...n.parameters,n.returnType]):As(n)?Ms(e,t,n.parameters[1]):P(n)?Ns(e,t,n.allOf):lr(n)?Ps(e,t,n.iteratorItems):j(n)?Ms(e,t,n.properties):At(n)?Ps(e,t,n.item):N(n)?Ns(e,t,n.anyOf):z(n)?Ns(e,t,n.items):Gi(n)?Ps(e,t,Wi(n)):!1}function Fs(e,t,n){return Ps(e,t,n)}function Is(e,t){return t.reduce((t,n)=>n in e?Fs([n],e,e[n])?[...t,n]:t:En(),[])}function Ls(e){return Is(e,pn(e))}function Rs(e,t,n){return n.includes(t)?n:t in e?Vs(e,e[t],[...n,t]):En()}function zs(e,t,n){return Bs(e,mn(t),n)}function Bs(e,t,n){return t.reduce((t,n)=>Vs(e,n,t),n)}function Vs(e,t,n){return on(t)?Rs(e,t.$ref,n):qt(t)?Vs(e,t.items,n):Xt(t)?Vs(e,t.iteratorItems,n):$t(t)?Bs(e,[...t.parameters,t.instanceType],n):nn(t)?Bs(e,[...t.parameters,t.returnType],n):As(t)?zs(e,t.parameters[1],n):P(t)?Bs(e,t.allOf,n):lr(t)?Vs(e,t.iteratorItems,n):j(t)?zs(e,t.properties,n):At(t)?Vs(e,t.item,n):N(t)?Bs(e,t.anyOf,n):z(t)?Bs(e,t.items,n):Gi(t)?Vs(e,Wi(t),n):n}function Hs(e,t,n){return Vs(e,n,[t])}function Us(e){return ln()}function Ws(e){return w(e).reduce((t,n)=>({...t,[n]:Ks(e[n])}),{})}function Gs(e){return e.reduce((e,t)=>[...e,Ks(t)],[])}function Ks(e){return on(e)?Us(e.$ref):qt(e)?Kt(Ks(e.items),Jt(e)):Xt(e)?Yt(Ks(e.iteratorItems)):$t(e)?Qt(Gs(e.parameters),Ks(e.instanceType)):nn(e)?tn(Gs(e.parameters),Ks(e.returnType)):P(e)?wn(Gs(e.allOf)):lr(e)?cr(Ks(e.iteratorItems)):j(e)?A(Ws(e.properties)):At(e)?kt(Ks(e.item)):Gi(e)?Bi(Ui(e),Ks(Wi(e))):N(e)?M(Gs(e.anyOf)):z(e)?$r(Gs(e.items)):e}function qs(e,t){return t in e?Ks(e[t]):_n()}function Js(e){return qs(e.$defs,e.$ref)}function Ys(e,t,n){let r=tf(e,{callstack:[]},t),i=$d({},{callstack:[]},n);return _i([...r,A(i)])}function Xs(e,t){return w(e).filter(e=>t.includes(e)).reduce((t,n)=>{let r=e[n],i=As(r)?Ys(e,r.parameters[0],r.parameters[1]):r;return{...t,[n]:i}},{})}function Zs(e,t,n){return yn(Xs(e,Hs(e,t,n)),t)}function Qs(e,t){return t in e?on(e[t])?Qs(e,e[t].$ref):e[t]:k()}function $s(e,t){return Qs(e,t)}function ec(e){return bn(e)?Js(e):xn(e)?_n():e}function tc(e,t,n){return W(e,ec(t),ec(n))}function nc(e,t){let n=[vn(e)?H():tc({},e,t),vn(e)?V({}):tc({},t,e)];return fo(n[0])&&fo(n[1])?`equal`:fo(n[0])&&uo(n[1])?`left-inside`:uo(n[0])&&fo(n[1])?`right-inside`:`disjoint`}function rc(e,t){return t.filter(t=>nc(e,t)!==`right-inside`)}function ic(e,t){return x(t.some(t=>{let n=nc(e,t);return x(n,`left-inside`)||x(n,`equal`)}),!1)}function ac(e,t){let n=yi(e);return un(n)?[n]:ic(n,t)?[...rc(n,t),n]:t}function oc(e){return e.reduce((e,t)=>j(t)?[...e,t]:dn(t)?e:ac(t,e),[])}function sc(e){let t=Di(oc(e));return t.length===0?k():t.length===1?t[0]:M(t)}function cc(e,t){return E(yi(e),{},t)}function lc(e,t,n,r){return cc(K(e,t,n),r)}function uc(e,t=[]){return Ot(e)&&x(e.action,`Conditional`)?on(e.parameters[0])?uc(e.parameters[2],uc(e.parameters[3],[...t,e.parameters[0].$ref])):uc(e.parameters[2],uc(e.parameters[3],t)):Ot(e)&&x(e.action,`Mapped`)&&Ot(e.parameters[1])&&x(e.parameters[1].action,`KeyOf`)&&on(e.parameters[1].parameters[0])?[...t,e.parameters[1].parameters[0].$ref]:t}function dc(e,t){return e.reduce((e,n)=>[...e,t.includes(n.name)],[])}function fc(e,t,n=[]){return S(e,(e,r)=>S(t,(t,i)=>fc(r,i,[...n,[t,e]]),()=>n),()=>n)}function pc(e){return N(e)?[...e.anyOf]:[e]}function mc(e,t){return e.reduce((e,n)=>[...e,[...n,t]],[])}function hc(e,t){return t.reduce((t,n)=>[...t,...mc(e,n)],[])}function gc(e){return e.reduce((e,t)=>x(t[0],!0)?hc(e,pc(t[1])):hc(e,[t[1]]),[[]])}function _c(e,t,n){let r=fc(t,dc(e,uc(n)));return Ot(n)&&x(n.action,`Conditional`)||Ot(n)&&x(n.action,`Mapped`)?gc(r):[t]}function vc(){return[`(not-resolvable)`,k()]}function yc(){return[`(not-generic)`,k()]}function bc(e,t,n){return[e,sn(t,n)]}function xc(e,t,n){return t in e?Sc(e,t,e[t],n):vc()}function Sc(e,t,n,r){return cn(n)?bc(t,n.parameters,n.expression):on(n)?xc(e,n.$ref,r):yc()}function Cc(e,t,n){return Sc(e,`(anonymous)`,t,n)}function wc(e,t,n){if(Sn(t)||Ic(t)||fo(tc({},t,n)))return;let r={parameter:e,expect:n,actual:t};throw Error(`Argument for parameter ${e} does not satisfy constraint`,{cause:r})}function Tc(e,t,n,r,i){let a=K(e,t,i);return wc(n,a,r),v(e,{[n]:a})}function Ec(e,t,n,r,i){let a=K(e,t,n.extends),o=K(e,t,n.equals);return S(i,(i,o)=>Dc(Tc(e,t,n.name,a,i),t,r,o),()=>Dc(Tc(e,t,n.name,a,o),t,r,[]))}function Dc(e,t,n,r){return S(n,(n,i)=>Ec(e,t,n,i,r),()=>e)}function Oc(e,t,n,r){return Dc(e,t,n,r)}function kc(e){return Ie(e.callstack.length,0)?e.callstack[e.callstack.length-1]:``}function Ac(e,t){return x(kc(e),t)}function jc(e,t,n,r,i,a){return K(e,t,K(Oc(e,t,r,a),{callstack:[...t.callstack,n.$ref]},i))}function Mc(e,t,n,r,i,a){return a.reduce((a,o)=>[...a,jc(e,t,n,r,i,o)],[])}function Nc(e,t,n,r,i,a){let o=Mc(e,t,n,r,i,_c(r,a,i));return x(o.length,1)?o[0]:vi(o)}function Pc(e,t,n,r){let i=tf(e,t,r),a=Cc(e,n,r),o=a[0],s=a[1];return cn(s)?Ac(t,o)?Fc(an(o),i):Nc(e,t,an(o),s.parameters,s.expression,i):Fc(n,i)}function Fc(e,t){return T({"~kind":`Call`},{target:e,arguments:t},{})}function Ic(e){return D(e,`Call`)}function Lc(e,t){return e(t)}function Rc(e,t){return b(t)?L(Lc(e,t)):L(t)}function zc(e,t){return Vc(e,Ur(t))}function Bc(e,t){return M(t.map(t=>Vc(e,t)))}function Vc(e,t){return R(t)?Rc(e,t.const):oo(t)?zc(e,t.pattern):N(t)?Bc(e,t.anyOf):t}function Hc(e,t={}){return O(`Capitalize`,[e],t)}function Uc(e,t={}){return O(`Lowercase`,[e],t)}function Wc(e,t={}){return O(`Uncapitalize`,[e],t)}function Gc(e,t={}){return O(`Uppercase`,[e],t)}const Kc=e=>e[0].toUpperCase()+e.slice(1),qc=e=>e.toLowerCase(),Jc=e=>e[0].toLowerCase()+e.slice(1),Yc=e=>e.toUpperCase();function Xc(e,t){return G([e])?E(Vc(Kc,e),{},t):Hc(e,t)}function Zc(e,t){return G([e])?E(Vc(qc,e),{},t):Uc(e,t)}function Qc(e,t){return G([e])?E(Vc(Jc,e),{},t):Wc(e,t)}function $c(e,t){return G([e])?E(Vc(Yc,e),{},t):Gc(e,t)}function el(e,t,n,r){return Xc(K(e,t,n),r)}function tl(e,t,n,r){return Zc(K(e,t,n),r)}function nl(e,t,n,r){return Qc(K(e,t,n),r)}function rl(e,t,n,r){return $c(K(e,t,n),r)}function il(e,t,n,r,i={}){return O(`Conditional`,[e,t,n,r],i)}function al(e,t,n,r,i,a){let o=tc(e,n,r);return co(o)?M([K(o.inferred,t,i),K(e,t,a)]):lo(o)?K(o.inferred,t,i):K(e,t,a)}function ol(e,t,n,r,i,a,o){return G([n,r])?E(al(e,t,n,r,i,a),{},o):il(n,r,i,a,o)}function sl(e,t,n,r,i,a,o){return ol(e,t,K(e,t,n),K(e,t,r),i,a,o)}function cl(e,t={}){return O(`ConstructorParameters`,[e],t)}function ll(e){return $r(ef({},{callstack:[]},$t(e)?e.parameters:[]))}function ul(e,t){return G([e])?E(ll(e),{},t):cl(e,t)}function dl(e,t,n,r){return ul(K(e,t,n),r)}function fl(e,t,n={}){return O(`Exclude`,[e,t],n)}function pl(e,t){return e.reduce((e,n)=>[...e,...ml(n,t)],[])}function ml(e,t){return fo(tc({},e,t))?[]:[e]}function hl(e,t){return vi(Cn(e)?pl(Jr(e.enum),t):N(e)?pl(Di(e.anyOf),t):ml(e,t))}function gl(e,t,n){return G([e,t])?E(hl(e,t),{},n):fl(e,t,n)}function _l(e,t,n,r,i){return gl(K(e,t,n),K(e,t,r),i)}function vl(e,t,n={}){return O(`Extract`,[e,t],n)}function yl(e,t){return e.reduce((e,n)=>[...e,...bl(n,t)],[])}function bl(e,t){return fo(tc({},e,t))?[e]:[]}function xl(e,t){return vi(Cn(e)?yl(Jr(e.enum),t):N(e)?yl(Di(e.anyOf),t):bl(e,t))}function Sl(e,t,n){return G([e,t])?E(xl(e,t),{},n):vl(e,t,n)}function Cl(e,t,n,r,i){return Sl(K(e,t,n),K(e,t,r),i)}function wl(e,t,n={}){return O(`Index`,[e,t],n)}function Tl(e,t){return Nl($s(e,t))}function El(e,t){let n=w(e).filter(e=>!C(t,e)),r=w(t).filter(t=>!C(e,t)),i=w(e).filter(e=>C(t,e)),a=n.reduce((t,n)=>({...t,[n]:e[n]}),{}),o=r.reduce((e,n)=>({...e,[n]:t[n]}),{}),s=i.reduce((n,r)=>({...n,[r]:_i([e[r],t[r]])}),{});return v(v(a,o),s)}function Dl(e){return e.reduce((e,t)=>El(e,Nl(t)),{})}function Ol(e){return e}function kl(e){return Nl(ni($r(e)))}function Al(e,t){return w(e).filter(e=>e in t).reduce((n,r)=>({...n,[r]:vi([e[r],t[r]])}),{})}function jl(e,t){return S(e,(e,n)=>jl(n,Al(t,Nl(e))),()=>t)}function Ml(e){return S(e,(e,t)=>jl(t,Nl(e)),()=>En())}function Nl(e){return bn(e)?Tl(e.$defs,e.$ref):P(e)?Dl(e.allOf):N(e)?Ml(e.anyOf):z(e)?kl(e.items):j(e)?Ol(e.properties):{}}function Pl(e){return A(Nl(e))}const Fl=RegExp(`^(?:0|[1-9][0-9]*)$`);function Il(e){let t=`${e}`;return Fl.test(t)?parseInt(t):e}function Ll(e){return L(Il(e))}function Rl(e){return e.map(e=>zl(e))}function zl(e){return P(e)?wn(Rl(e.allOf)):N(e)?M(Rl(e.anyOf)):R(e)?Ll(e.const):e}function Bl(e,t){return fo(tc({},zl(t),xr()))?e:R(t)&&x(t.const,`length`)?xr():k()}function Vl(e,t){return ql($s(e,t))}function Hl(e){return e.reduce((e,t)=>[...e,...ql(t)],[])}function Ul(e){return Hl(Jr(e))}function Wl(e){return ql(_i(e))}function Gl(e){return[`${e}`]}function Kl(e){return ql(Ur(e))}function ql(e){return bn(e)?Vl(e.$defs,e.$ref):Cn(e)?Ul(e.enum):P(e)?Wl(e.allOf):R(e)?Gl(e.const):oo(e)?Kl(e.pattern):N(e)?Hl(e.anyOf):[]}function Jl(e){return ql(e)}function Yl(e,t){return t.map(t=>Xl(e,t))}function Xl(e,t){return qt(t)?Kt(Xl(e,t.items)):Xt(t)?Yt(Xl(e,t.iteratorItems)):$t(t)?Qt(Yl(e,t.parameters),Xl(e,t.instanceType)):nn(t)?tn(Yl(e,t.parameters),Xl(e,t.returnType)):lr(t)?cr(Xl(e,t.iteratorItems)):At(t)?kt(Xl(e,t.item)):z(t)?$r(Yl(e,t.items)):N(t)?M(Yl(e,t.anyOf)):P(t)?wn(Yl(e,t.allOf)):Ji(t)?A(e):t}function Zl(e,t){return Xl(e,t)}function Ql(e,t){return Zl(e,t in e?e[t]:k())}function $l(e,t){return t.reduce((t,n)=>[...t,Ql(e,n)],[])}function eu(e,t){return vi($l(e,Jl(t)))}const tu=new RegExp(Ii);function nu(e){return e.filter(e=>tu.test(e))}function ru(e){return vi($l(e,nu(pn(e))))}function iu(e,t){return Sr(t)?ru(e):eu(e,t)}function au(e){return L(Il(e))}function ou(e){return e.map(e=>su(e))}function su(e){return P(e)?wn(ou(e.allOf)):N(e)?M(ou(e.anyOf)):R(e)?au(e.const):e}function cu(e,t){return e.reduceRight((e,n,r)=>fo(tc({},L(r),t))?[n,...e]:e,[])}function lu(e,t){return bi(cu(e,su(t)))}function uu(e){return bi(e)}function du(e,t){return R(t)&&x(t.const,`length`)?L(e.length):Sr(t)||sr(t)?uu(e):lu(e,t)}function fu(e,t){return qt(e)?Bl(e.items,t):j(e)?iu(e.properties,t):z(e)?du(e.items,t):k()}function pu(e){return bn(e)||P(e)||N(e)?Pl(e):e}function mu(e,t,n){return G([e,t])?E(fu(pu(e),t),{},n):wl(e,t,n)}function hu(e,t,n,r,i){return mu(K(e,t,n),K(e,t,r),i)}function gu(e,t={}){return O(`InstanceType`,[e],t)}function _u(e){return $t(e)?e.instanceType:k()}function vu(e,t){return G([e])?E(_u(e),{},t):gu(e,t)}function yu(e,t,n,r={}){return vu(K(e,t,n),r)}function bu(e,t={}){return O(`KeyOf`,[e],t)}function xu(){return M([xr(),Tr(),Cr()])}function Su(e){return xr()}function Cu(e){return e.reduce((e,t)=>pr(t)?[...e,L(Il(t))]:En(),[])}function wu(e){return bi(Cu(w(e)))}function Tu(e){return Ui(e)}function Eu(e){return bi(e.map((e,t)=>L(t)))}function Du(e){return un(e)?xu():qt(e)?Su(e.items):j(e)?wu(e.properties):Gi(e)?Tu(e):z(e)?Eu(e.items):k()}function Ou(e){return bn(e)||P(e)||N(e)?Pl(e):e}function ku(e,t){return G([e])?E(Du(Ou(e)),{},t):bu(e,t)}function Au(e,t,n,r){return ku(K(e,t,n),r)}function ju(e,t,n,r,i={}){return O(`Mapped`,[e,t,n,r],i)}function Mu(e){return Fu(Ur(e))}function Nu(e){return e.reduce((e,t)=>[...e,...Fu(t)],[])}function Pu(e){return Me(e)?[L(`${e}`)]:[L(e)]}function Fu(e){return Cn(e)?Nu(Jr(e.enum)):R(e)?Pu(e.const):oo(e)?Mu(e.pattern):N(e)?Nu(e.anyOf):[e]}function Iu(e){return Fu(e)}function Lu(e){return oo(e)?Ur(e.pattern):e}function Ru(e,t,n,r,i,a){let o=v(e,{[n.name]:r}),s=Lu(K(o,t,i)),c=K(o,t,a);return gr(s)||_r(s)?{[s.const]:c}:{}}function zu(e,t,n,r,i,a){return r.reduce((r,o)=>[...r,Ru(e,t,n,o,i,a)],[])}function Bu(e){return e.reduce((e,t)=>[...e,A(t)],[])}function Vu(e,t,n,r,i,a){return _i(Bu(zu(e,t,n,Iu(r),i,a)))}function Hu(e,t,n,r,i,a,o){return G([r])?E(Vu(e,t,n,r,i,a),{},o):ju(n,r,i,a,o)}function Uu(e,t,n,r,i,a,o){return Hu(e,t,n,K(e,t,r),i,a,o)}function Wu(e,t){return w(e).filter(e=>t.includes(e)).reduce((t,n)=>({...t,[n]:Zs(e,n,e[n])}),{})}function Gu(e,t){return w(e).filter(e=>!t.includes(e)).reduce((t,n)=>({...t,[n]:K(e,{callstack:[]},e[n])}),{})}function Ku(e,t){let n=Ls(e),r=Wu(e,n),i=Gu(e,n);return E({...r,...i},{},t)}function qu(e,t,n,r){return Ku(v(e,n),r)}function Ju(e,t={}){return O(`NonNullable`,[e],t)}function Yu(e){return gl(e,M([vr(),Yi()]),{})}function Xu(e,t){return G([e])?E(Yu(e),{},t):Ju(e,t)}function Zu(e,t,n,r){return Xu(K(e,t,n),r)}function Qu(e,t,n={}){return O(`Omit`,[e,t],n)}function $u(e){let t=Pl(e);return j(t)?t.properties:En()}function ed(e,t){return w(e).reduce((n,r)=>t.includes(r)?n:{...n,[r]:e[r]},{})}function td(e,t){return A(ed($u(e),Jl(t)))}function nd(e,t,n){return G([e,t])?E(td(e,t),{},n):Qu(e,t,n)}function rd(e,t,n,r,i){return nd(K(e,t,n),K(e,t,r),i)}function id(e,t){return O(`Options`,[e,t],{})}function ad(e,t){return od(e,t)}function od(e,t){return G([e])?E(e,{},t):id(e,t)}function sd(e,t,n,r){return od(K(e,t,n),r)}function cd(e,t={}){return O(`Parameters`,[e],t)}function ld(e){return $r(ef({},{callstack:[]},nn(e)?e.parameters:[]))}function ud(e,t){return G([e])?E(ld(e),{},t):cd(e,t)}function dd(e,t,n,r){return ud(K(e,t,n),r)}function fd(e,t={}){return O(`Partial`,[e],t)}function pd(e,t){let n=_d($s(e,t));return yn(v(e,{[t]:n}),t)}function md(e){return _i(e.map(e=>_d(e)))}function hd(e){return M(e.map(e=>_d(e)))}function gd(e){return A(w(e).reduce((t,n)=>({...t,[n]:Lt(e[n])}),{}))}function _d(e){return bn(e)?pd(e.$defs,e.$ref):P(e)?md(e.allOf):N(e)?hd(e.anyOf):j(e)?gd(e.properties):A({})}function vd(e,t){return G([e])?E(_d(e),{},t):fd(e,t)}function yd(e,t,n,r){return vd(K(e,t,n),r)}function bd(e,t,n={}){return O(`Pick`,[e,t],n)}function xd(e,t){return w(e).reduce((n,r)=>t.includes(r)?v(n,{[r]:e[r]}):n,{})}function Sd(e,t){return A(xd($u(e),Jl(t)))}function Cd(e,t,n){return G([e,t])?E(Sd(e,t),{},n):bd(e,t,n)}function wd(e,t,n,r,i){return Cd(K(e,t,n),K(e,t,r),i)}function Td(e,t={}){return O(`ReadonlyObject`,[e],t)}function Ed(e){return Nt(Kt(e))}function Dd(e,t){let n=Md($s(e,t));return yn(v(e,{[t]:n}),t)}function Od(e){return _i(e.map(e=>Md(e)))}function kd(e){return A(w(e).reduce((t,n)=>({...t,[n]:Vt(e[n])}),{}))}function Ad(e){return Nt($r(e))}function jd(e){return M(e.map(e=>Md(e)))}function Md(e){return qt(e)?Ed(e.items):bn(e)?Dd(e.$defs,e.$ref):P(e)?Od(e.allOf):j(e)?kd(e.properties):z(e)?Ad(e.items):N(e)?jd(e.anyOf):e}function Nd(e,t){return G([e])?E(Md(e),{},t):Td(e)}function Pd(e,t,n,r){return Nd(K(e,t,n),r)}function Fd(e,t,n,r){return r in e?Fs([r],e,e[r])?n:K(e,t,e[r]):n}function Id(e,t){let n=Bd($s(e,t));return yn(v(e,{[t]:n}),t)}function Ld(e){return _i(e.map(e=>Bd(e)))}function Rd(e){return M(e.map(e=>Bd(e)))}function zd(e){return A(w(e).reduce((t,n)=>({...t,[n]:Ft(e[n])}),{}))}function Bd(e){return bn(e)?Id(e.$defs,e.$ref):P(e)?Ld(e.allOf):N(e)?Rd(e.anyOf):j(e)?zd(e.properties):A({})}function Vd(e,t={}){return O(`Required`,[e],t)}function Hd(e,t){return G([e])?E(Bd(e),{},t):Vd(e,t)}function Ud(e,t,n,r){return Hd(K(e,t,n),r)}function Wd(e,t={}){return O(`ReturnType`,[e],t)}function Gd(e){return nn(e)?e.returnType:k()}function Kd(e,t){return G([e])?E(Gd(e),{},t):Wd(e,t)}function qd(e,t,n,r={}){return Kd(K(e,t,n),r)}function Jd(e){return qi(e)?z(e.items)?Yd(e.items.items):Sn(e.items)||on(e.items)?[e]:[k()]:[e]}function Yd(e){return e.reduce((e,t)=>[...e,...Jd(t)],[])}function G(e){return S(e,(e,t)=>!on(e)&&G(t),()=>!0)}function Xd(e,t,n){return Dt(e)?Xd(e.type,`remove`,n):Tt(e)?Xd(e.type,t,`remove`):Et(e)?Xd(e.type,`add`,n):wt(e)?Xd(e.type,t,`add`):[e,t,n]}function Zd(e,t){return x(e,`remove`)?zt(t):x(e,`add`)?Bt(t):t}function Qd(e,t){return x(e,`remove`)?Ft(t):x(e,`add`)?It(t):t}function $d(e,t,n){return w(n).reduce((r,i)=>({...r,[i]:K(e,t,n[i])}),{})}function ef(e,t,n){return Yd(tf(e,t,n))}function tf(e,t,n){return n.map(n=>K(e,t,n))}function nf(e,t,n,r,i){return x(n,`Awaited`)?sf(e,t,r[0],i):x(n,`Capitalize`)?el(e,t,r[0],i):x(n,`Conditional`)?sl(e,t,r[0],r[1],r[2],r[3],i):x(n,`ConstructorParameters`)?dl(e,t,r[0],i):x(n,`Evaluate`)?lc(e,t,r[0],i):x(n,`Exclude`)?_l(e,t,r[0],r[1],i):x(n,`Extract`)?Cl(e,t,r[0],r[1],i):x(n,`Index`)?hu(e,t,r[0],r[1],i):x(n,`InstanceType`)?yu(e,t,r[0],i):x(n,`Interface`)?Os(e,t,r[0],r[1],i):x(n,`KeyOf`)?Au(e,t,r[0],i):x(n,`Lowercase`)?tl(e,t,r[0],i):x(n,`Mapped`)?Uu(e,t,r[0],r[1],r[2],r[3],i):x(n,`Module`)?qu(e,t,r[0],i):x(n,`NonNullable`)?Zu(e,t,r[0],i):x(n,`Pick`)?wd(e,t,r[0],r[1],i):x(n,`Options`)?sd(e,t,r[0],r[1]):x(n,`Parameters`)?dd(e,t,r[0],i):x(n,`Partial`)?yd(e,t,r[0],i):x(n,`Omit`)?rd(e,t,r[0],r[1],i):x(n,`ReadonlyObject`)?Pd(e,t,r[0],i):x(n,`Record`)?Fi(e,t,r[0],r[1],i):x(n,`Required`)?Ud(e,t,r[0],i):x(n,`ReturnType`)?qd(e,t,r[0],i):x(n,`TemplateLiteral`)?ro(e,t,r[0],i):x(n,`Uncapitalize`)?nl(e,t,r[0],i):x(n,`Uppercase`)?rl(e,t,r[0],i):O(n,r,i)}function K(e,t,n){let r=Pt(n),i=Xd(n,Ht(n)?`add`:`none`,Rt(n)?`add`:`none`),a=Gt(i[0])?i[0].Clone():i[0],o=on(a)?Fd(e,t,a,a.$ref):qt(a)?Kt(K(e,t,a.items),Jt(a)):Xt(a)?Yt(K(e,t,a.iteratorItems),Zt(a)):Ic(a)?Pc(e,t,a.target,a.arguments):$t(a)?Qt(tf(e,t,a.parameters),K(e,t,a.instanceType),en(a)):Ot(a)?nf(e,t,a.action,a.parameters,a.options):nn(a)?tn(tf(e,t,a.parameters),K(e,t,a.returnType),rn(a)):P(a)?wn(tf(e,t,a.allOf),Tn(a)):lr(a)?cr(K(e,t,a.iteratorItems),ur(a)):j(a)?A($d(e,t,a.properties),hn(a)):At(a)?kt(K(e,t,a.item),jt(a)):Gi(a)?Vi(Hi(a),K(e,t,Wi(a))):qi(a)?Ki(K(e,t,a.items)):z(a)?$r(ef(e,t,a.items),ei(a)):N(a)?M(tf(e,t,a.anyOf),gn(a)):a,s=r?Nt(o):o;return Zd(i[1],Qd(i[2],s))}function rf(e,t){return K(e,{callstack:[]},t)}function af(e){return At(e)?af(e.item):e}function of(e,t){return G([e])?E(af(e),{},t):cf(e,t)}function sf(e,t,n,r){return of(K(e,t,n),r)}function cf(e,t={}){return O(`Awaited`,[e],t)}function lf(e,t={}){return cc(e,t)}const uf=Symbol.for(`yaml.alias`),df=Symbol.for(`yaml.document`),ff=Symbol.for(`yaml.map`),pf=Symbol.for(`yaml.pair`),mf=Symbol.for(`yaml.scalar`),hf=Symbol.for(`yaml.seq`),gf=Symbol.for(`yaml.node.type`),_f=e=>!!e&&typeof e==`object`&&e[gf]===uf,vf=e=>!!e&&typeof e==`object`&&e[gf]===df,yf=e=>!!e&&typeof e==`object`&&e[gf]===ff,q=e=>!!e&&typeof e==`object`&&e[gf]===pf,J=e=>!!e&&typeof e==`object`&&e[gf]===mf,bf=e=>!!e&&typeof e==`object`&&e[gf]===hf;function Y(e){if(e&&typeof e==`object`)switch(e[gf]){case ff:case hf:return!0}return!1}function X(e){if(e&&typeof e==`object`)switch(e[gf]){case uf:case ff:case mf:case hf:return!0}return!1}const xf=e=>(J(e)||Y(e))&&!!e.anchor,Sf=Symbol(`break visit`),Cf=Symbol(`skip children`),wf=Symbol(`remove node`);function Tf(e,t){let n=kf(t);vf(e)?Ef(null,e.contents,n,Object.freeze([e]))===wf&&(e.contents=null):Ef(null,e,n,Object.freeze([]))}Tf.BREAK=Sf,Tf.SKIP=Cf,Tf.REMOVE=wf;function Ef(e,t,n,r){let i=Af(e,t,n,r);if(X(i)||q(i))return jf(e,r,i),Ef(e,i,n,r);if(typeof i!=`symbol`){if(Y(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=Ef(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===Sf)return Sf;else i===wf&&(t.items.splice(e,1),--e)}}else if(q(t)){r=Object.freeze(r.concat(t));let e=Ef(`key`,t.key,n,r);if(e===Sf)return Sf;e===wf&&(t.key=null);let i=Ef(`value`,t.value,n,r);if(i===Sf)return Sf;i===wf&&(t.value=null)}}return i}async function Df(e,t){let n=kf(t);vf(e)?await Of(null,e.contents,n,Object.freeze([e]))===wf&&(e.contents=null):await Of(null,e,n,Object.freeze([]))}Df.BREAK=Sf,Df.SKIP=Cf,Df.REMOVE=wf;async function Of(e,t,n,r){let i=await Af(e,t,n,r);if(X(i)||q(i))return jf(e,r,i),Of(e,i,n,r);if(typeof i!=`symbol`){if(Y(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=await Of(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===Sf)return Sf;else i===wf&&(t.items.splice(e,1),--e)}}else if(q(t)){r=Object.freeze(r.concat(t));let e=await Of(`key`,t.key,n,r);if(e===Sf)return Sf;e===wf&&(t.key=null);let i=await Of(`value`,t.value,n,r);if(i===Sf)return Sf;i===wf&&(t.value=null)}}return i}function kf(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function Af(e,t,n,r){if(typeof n==`function`)return n(e,t,r);if(yf(t))return n.Map?.(e,t,r);if(bf(t))return n.Seq?.(e,t,r);if(q(t))return n.Pair?.(e,t,r);if(J(t))return n.Scalar?.(e,t,r);if(_f(t))return n.Alias?.(e,t,r)}function jf(e,t,n){let r=t[t.length-1];if(Y(r))r.items[e]=n;else if(q(r))e===`key`?r.key=n:r.value=n;else if(vf(r))r.contents=n;else{let e=_f(r)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}const Mf={"!":`%21`,",":`%2C`,"[":`%5B`,"]":`%5D`,"{":`%7B`,"}":`%7D`},Nf=e=>e.replace(/[!,[\]{}]/g,e=>Mf[e]);var Pf=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case`1.1`:this.atNextDocument=!0;break;case`1.2`:this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:`1.2`},this.tags=Object.assign({},e.defaultTags);break}return t}add(t,n){this.atNextDocument&&=(this.yaml={explicit:e.defaultYaml.explicit,version:`1.1`},this.tags=Object.assign({},e.defaultTags),!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case`%TAG`:{if(r.length!==2&&(n(0,`%TAG directive should contain exactly two parts`),r.length<2))return!1;let[e,t]=r;return this.tags[e]=t,!0}case`%YAML`:{if(this.yaml.explicit=!0,r.length!==1)return n(0,`%YAML directive should contain exactly one part`),!1;let[e]=r;if(e===`1.1`||e===`1.2`)return this.yaml.version=e,!0;{let t=/^\d+\.\d+$/.test(e);return n(6,`Unsupported YAML version ${e}`,t),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e===`!`)return`!`;if(e[0]!==`!`)return t(`Not a valid tag: ${e}`),null;if(e[1]===`<`){let n=e.slice(2,-1);return n===`!`||n===`!!`?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==`>`&&t(`Verbatim tags must end with a >`),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return n===`!`?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+Nf(e.substring(n.length));return e[0]===`!`?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||`1.2`}`]:[],n=Object.entries(this.tags),r;if(e&&n.length>0&&X(e.contents)){let t={};Tf(e.contents,(e,n)=>{X(n)&&n.tag&&(t[n.tag]=!0)}),r=Object.keys(t)}else r=[];for(let[i,a]of n)i===`!!`&&a===`tag:yaml.org,2002:`||(!e||r.some(e=>e.startsWith(a)))&&t.push(`%TAG ${i} ${a}`);return t.join(`
|
|
4
|
+
`)}};Pf.defaultYaml={explicit:!1,version:`1.2`},Pf.defaultTags={"!!":`tag:yaml.org,2002:`};function Ff(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function If(e,t,n,r){if(r&&typeof r==`object`)if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=If(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=If(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=If(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=If(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}return e.call(t,n,r)}function Lf(e,t,n){if(Array.isArray(e))return e.map((e,t)=>Lf(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!xf(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var Rf=class{constructor(e){Object.defineProperty(this,gf,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!vf(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=Lf(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?If(i,{"":o},``,o):o}},zf=class extends Rf{constructor(e){super(uf),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],Tf(e,{Node:(e,t)=>{(_f(t)||xf(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}return r}toJSON(e,t){if(!t)return{source:this.source};let{anchors:n,doc:r,maxAliasCount:i}=t,a=this.resolve(r,t);if(!a){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}let o=n.get(a);if(o||=(Lf(a,null,t),n.get(a)),o?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=Bf(r,a,n)),o.count*o.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`);return o.res}toString(e,t,n){let r=`*${this.source}`;if(e){if(Ff(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function Bf(e,t,n){if(_f(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(Y(t)){let r=0;for(let i of t.items){let t=Bf(e,i,n);t>r&&(r=t)}return r}else if(q(t)){let r=Bf(e,t.key,n),i=Bf(e,t.value,n);return Math.max(r,i)}return 1}const Vf=e=>!e||typeof e!=`function`&&typeof e!=`object`;var Z=class extends Rf{constructor(e){super(mf),this.value=e}toJSON(e,t){return t?.keep?this.value:Lf(this.value,e,t)}toString(){return String(this.value)}};Z.BLOCK_FOLDED=`BLOCK_FOLDED`,Z.BLOCK_LITERAL=`BLOCK_LITERAL`,Z.PLAIN=`PLAIN`,Z.QUOTE_DOUBLE=`QUOTE_DOUBLE`,Z.QUOTE_SINGLE=`QUOTE_SINGLE`;function Hf(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function Uf(e,t,n){if(vf(e)&&(e=e.contents),X(e))return e;if(q(e)){let t=n.schema[ff].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??=i(e),new zf(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=`tag:yaml.org,2002:`+t.slice(2));let l=Hf(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new Z(e);return c&&(c.node=t),t}l=e instanceof Map?o[ff]:Symbol.iterator in Object(e)?o[hf]:o[ff]}a&&(a(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,e,n):typeof l?.nodeClass?.from==`function`?l.nodeClass.from(n.schema,e,n):new Z(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}function Wf(e,t,n){let r=n;for(let e=t.length-1;e>=0;--e){let n=t[e];if(typeof n==`number`&&Number.isInteger(n)&&n>=0){let e=[];e[n]=r,r=e}else r=new Map([[n,r]])}return Uf(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}const Gf=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done;var Kf=class extends Rf{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>X(t)||q(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Gf(e))this.add(t);else{let[n,...r]=e,i=this.get(n,!0);if(Y(i))i.addIn(r,t);else if(i===void 0&&this.schema)this.set(n,Wf(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let r=this.get(t,!0);if(Y(r))return r.deleteIn(n);throw Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...r]=e,i=this.get(n,!0);return r.length===0?!t&&J(i)?i.value:i:Y(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!q(t))return!1;let n=t.value;return n==null||e&&J(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let r=this.get(t,!0);return Y(r)?r.hasIn(n):!1}setIn(e,t){let[n,...r]=e;if(r.length===0)this.set(n,t);else{let e=this.get(n,!0);if(Y(e))e.setIn(r,t);else if(e===void 0&&this.schema)this.set(n,Wf(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}};const qf=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function Jf(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Yf=(e,t,n)=>e.endsWith(`
|
|
5
|
+
`)?Jf(n,t):n.includes(`
|
|
6
|
+
`)?`
|
|
7
|
+
`+Jf(n,t):(e.endsWith(` `)?``:` `)+n,Xf=`flow`;function Zf(e,t,n=`flow`,{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!i||i<0)return e;i<a&&(a=0);let c=Math.max(1+a,1+i-t.length);if(e.length<=c)return e;let l=[],u={},d=i-t.length;typeof r==`number`&&(r>i-Math.max(2,a)?l.push(0):d=i-r);let f,p,m=!1,h=-1,g=-1,ee=-1;n===`block`&&(h=Qf(e,h,t.length),h!==-1&&(d=h+c));for(let r;r=e[h+=1];){if(n===`quoted`&&r===`\\`){switch(g=h,e[h+1]){case`x`:h+=3;break;case`u`:h+=5;break;case`U`:h+=9;break;default:h+=1}ee=h}if(r===`
|
|
8
|
+
`)n===`block`&&(h=Qf(e,h,t.length)),d=h+t.length+c,f=void 0;else{if(r===` `&&p&&p!==` `&&p!==`
|
|
9
|
+
`&&p!==` `){let t=e[h+1];t&&t!==` `&&t!==`
|
|
10
|
+
`&&t!==` `&&(f=h)}if(h>=d)if(f)l.push(f),d=f+c,f=void 0;else if(n===`quoted`){for(;p===` `||p===` `;)p=r,r=e[h+=1],m=!0;let t=h>ee+1?h-2:g-1;if(u[t])return e;l.push(t),u[t]=!0,d=t+c,f=void 0}else m=!0}p=r}if(m&&s&&s(),l.length===0)return e;o&&o();let _=e.slice(0,l[0]);for(let r=0;r<l.length;++r){let i=l[r],a=l[r+1]||e.length;i===0?_=`\n${t}${e.slice(0,a)}`:(n===`quoted`&&u[i]&&(_+=`${e[i]}\\`),_+=`\n${t}${e.slice(i+1,a)}`)}return _}function Qf(e,t,n){let r=t,i=t+1,a=e[i];for(;a===` `||a===` `;)if(t<i+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
|
|
11
|
+
`);r=t,i=t+1,a=e[i]}return r}const $f=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),ep=e=>/^(%|---|\.\.\.)/m.test(e);function tp(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let t=0,n=0;t<i;++t)if(e[t]===`
|
|
12
|
+
`){if(t-n>r)return!0;if(n=t+1,i-n<=r)return!1}return!0}function np(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(ep(e)?` `:``),o=``,s=0;for(let e=0,t=n[e];t;t=n[++e])if(t===` `&&n[e+1]===`\\`&&n[e+2]===`n`&&(o+=n.slice(s,e)+`\\ `,e+=1,s=e,t=`\\`),t===`\\`)switch(n[e+1]){case`u`:{o+=n.slice(s,e);let t=n.substr(e+2,4);switch(t){case`0000`:o+=`\\0`;break;case`0007`:o+=`\\a`;break;case`000b`:o+=`\\v`;break;case`001b`:o+=`\\e`;break;case`0085`:o+=`\\N`;break;case`00a0`:o+=`\\_`;break;case`2028`:o+=`\\L`;break;case`2029`:o+=`\\P`;break;default:t.substr(0,2)===`00`?o+=`\\x`+t.substr(2):o+=n.substr(e,6)}e+=5,s=e+1}break;case`n`:if(r||n[e+2]===`"`||n.length<i)e+=1;else{for(o+=n.slice(s,e)+`
|
|
13
|
+
|
|
14
|
+
`;n[e+2]===`\\`&&n[e+3]===`n`&&n[e+4]!==`"`;)o+=`
|
|
15
|
+
`,e+=2;o+=a,n[e+2]===` `&&(o+=`\\`),e+=1,s=e+1}break;default:e+=1}return o=s?o+n.slice(s):n,r?o:Zf(o,a,`quoted`,$f(t,!1))}function rp(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
16
|
+
`)||/[ \t]\n|\n[ \t]/.test(e))return np(e,t);let n=t.indent||(ep(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:Zf(r,n,Xf,$f(t,!1))}function ip(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=np;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?rp:i&&!t?np:n?rp:np}return r(e,t)}let ap;try{ap=RegExp(`(^|(?<!
|
|
17
|
+
))
|
|
18
|
+
+(?!
|
|
19
|
+
|$)`,`g`)}catch{ap=/\n+(?!\n|$)/g}function op({comment:e,type:t,value:n},r,i,a){let{blockQuote:o,commentString:s,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(n))return ip(n,r);let l=r.indent||(r.forceBlockIndent||ep(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===Z.BLOCK_FOLDED?!1:t===Z.BLOCK_LITERAL||!tp(n,c,l.length);if(!n)return u?`|
|
|
20
|
+
`:`>
|
|
21
|
+
`;let d,f;for(f=n.length;f>0;--f){let e=n[f-1];if(e!==`
|
|
22
|
+
`&&e!==` `&&e!==` `)break}let p=n.substring(f),m=p.indexOf(`
|
|
23
|
+
`);m===-1?d=`-`:n===p||m!==p.length-1?(d=`+`,a&&a()):d=``,p&&=(n=n.slice(0,-p.length),p[p.length-1]===`
|
|
24
|
+
`&&(p=p.slice(0,-1)),p.replace(ap,`$&${l}`));let h=!1,g,ee=-1;for(g=0;g<n.length;++g){let e=n[g];if(e===` `)h=!0;else if(e===`
|
|
25
|
+
`)ee=g;else break}let _=n.substring(0,ee<g?ee+1:g);_&&=(n=n.substring(_.length),_.replace(/\n+/g,`$&${l}`));let te=(h?l?`2`:`1`:``)+d;if(e&&(te+=` `+s(e.replace(/ ?[\r\n]+/g,` `)),i&&i()),!u){let e=n.replace(/\n+/g,`
|
|
26
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\n+/g,`$&${l}`),i=!1,a=$f(r,!0);o!==`folded`&&t!==Z.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=Zf(`${_}${e}${p}`,l,`block`,a);if(!i)return`>${te}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${te}\n${l}${_}${n}${p}`}function sp(e,t,n,r){let{type:i,value:a}=e,{actualString:o,implicitKey:s,indent:c,indentStep:l,inFlow:u}=t;if(s&&a.includes(`
|
|
27
|
+
`)||u&&/[[\]{},]/.test(a))return ip(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
|
|
28
|
+
`)?ip(a,t):op(e,t,n,r);if(!s&&!u&&i!==Z.PLAIN&&a.includes(`
|
|
29
|
+
`))return op(e,t,n,r);if(ep(a)){if(c===``)return t.forceBlockIndent=!0,op(e,t,n,r);if(s&&c===l)return ip(a,t)}let d=a.replace(/\n+/g,`$&\n${c}`);if(o){let e=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(d),{compat:n,tags:r}=t.doc.schema;if(r.some(e)||n?.some(e))return ip(a,t)}return s?d:Zf(d,c,Xf,$f(t,!1))}function cp(e,t,n,r){let{implicitKey:i,inFlow:a}=t,o=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:s}=e;s!==Z.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=Z.QUOTE_DOUBLE);let c=e=>{switch(e){case Z.BLOCK_FOLDED:case Z.BLOCK_LITERAL:return i||a?ip(o.value,t):op(o,t,n,r);case Z.QUOTE_DOUBLE:return np(o.value,t);case Z.QUOTE_SINGLE:return rp(o.value,t);case Z.PLAIN:return sp(o,t,n,r);default:return null}},l=c(s);if(l===null){let{defaultKeyType:e,defaultStringType:n}=t.options,r=i&&e||n;if(l=c(r),l===null)throw Error(`Unsupported default string type ${r}`)}return l}function lp(e,t){let n=Object.assign({blockQuote:!0,commentString:qf,defaultKeyType:null,defaultStringType:`PLAIN`,directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:`false`,flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:`null`,simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:`true`,verifyAliasOrder:!0},e.schema.toStringOptions,t),r;switch(n.collectionStyle){case`block`:r=!1;break;case`flow`:r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:r,options:n}}function up(e,t){if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let n,r;if(J(t)){r=t.value;let i=e.filter(e=>e.identify?.(r));if(i.length>1){let e=i.filter(e=>e.test);e.length>0&&(i=e)}n=i.find(e=>e.format===t.format)??i.find(e=>!e.format)}else r=t,n=e.find(e=>e.nodeClass&&r instanceof e.nodeClass);if(!n){let e=r?.constructor?.name??(r===null?`null`:typeof r);throw Error(`Tag not resolved for ${e} value`)}return n}function dp(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(J(e)||Y(e))&&e.anchor;a&&Ff(a)&&(n.add(a),i.push(`&${a}`));let o=e.tag??(t.default?null:t.tag);return o&&i.push(r.directives.tagString(o)),i.join(` `)}function fp(e,t,n,r){if(q(e))return e.toString(t,n,r);if(_f(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError(`Cannot stringify circular structure without alias nodes`);t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i,a=X(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=up(t.doc.schema.tags,a);let o=dp(a,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);let s=typeof i.stringify==`function`?i.stringify(a,t,n,r):J(a)?cp(a,t,n,r):a.toString(t,n,r);return o?J(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function pp({key:e,value:t},n,r,i){let{allNullValues:a,doc:o,indent:s,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,f=X(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(Y(e)||!X(e)&&typeof e==`object`)throw Error(`With simple keys, collection cannot be used as a key value`)}let p=!d&&(!e||f&&t==null&&!n.inFlow||Y(e)||(J(e)?e.type===Z.BLOCK_FOLDED||e.type===Z.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=fp(e,n,()=>m=!0,()=>h=!0);if(!p&&!n.inFlow&&g.length>1024){if(d)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);p=!0}if(n.inFlow){if(a||t==null)return m&&r&&r(),g===``?`?`:p?`? ${g}`:g}else if(a&&!d||t==null&&p)return g=`? ${g}`,f&&!m?g+=Yf(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=Yf(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=Yf(g,n.indent,l(f))));let ee,_,te;X(t)?(ee=!!t.spaceBefore,_=t.commentBefore,te=t.comment):(ee=!1,_=null,te=null,t&&typeof t==`object`&&(t=o.createNode(t))),n.implicitKey=!1,!p&&!f&&J(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&bf(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let ne=!1,re=fp(t,n,()=>ne=!0,()=>h=!0),ie=` `;if(f||ee||_){if(ie=ee?`
|
|
30
|
+
`:``,_){let e=l(_);ie+=`\n${Jf(e,n.indent)}`}re===``&&!n.inFlow?ie===`
|
|
31
|
+
`&&te&&(ie=`
|
|
32
|
+
|
|
33
|
+
`):ie+=`\n${n.indent}`}else if(!p&&Y(t)){let e=re[0],r=re.indexOf(`
|
|
34
|
+
`),i=r!==-1,a=n.inFlow??t.flow??t.items.length===0;if(i||!a){let t=!1;if(i&&(e===`&`||e===`!`)){let n=re.indexOf(` `);e===`&`&&n!==-1&&n<r&&re[n+1]===`!`&&(n=re.indexOf(` `,n+1)),(n===-1||r<n)&&(t=!0)}t||(ie=`\n${n.indent}`)}}else(re===``||re[0]===`
|
|
35
|
+
`)&&(ie=``);return g+=ie+re,n.inFlow?ne&&r&&r():te&&!ne?g+=Yf(g,n.indent,l(te)):h&&i&&i(),g}function mp(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}const hp={identify:e=>e===`<<`||typeof e==`symbol`&&e.description===`<<`,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new Z(Symbol(`<<`)),{addToJSMap:_p}),stringify:()=>`<<`},gp=(e,t)=>(hp.identify(t)||J(t)&&(!t.type||t.type===Z.PLAIN)&&hp.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===hp.tag&&e.default);function _p(e,t,n){let r=yp(e,n);if(bf(r))for(let n of r.items)vp(e,t,n);else if(Array.isArray(r))for(let n of r)vp(e,t,n);else vp(e,t,r)}function vp(e,t,n){let r=yp(e,n);if(!yf(r))throw Error(`Merge sources must be maps or map aliases`);let i=r.toJSON(null,e,Map);for(let[e,n]of i)t instanceof Map?t.has(e)||t.set(e,n):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0});return t}function yp(e,t){return e&&_f(t)?t.resolve(e.doc,e):t}function bp(e,t,{key:n,value:r}){if(X(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(gp(e,n))_p(e,t,r);else{let i=Lf(n,``,e);if(t instanceof Map)t.set(i,Lf(r,i,e));else if(t instanceof Set)t.add(i);else{let a=xp(n,i,e),o=Lf(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function xp(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(X(e)&&n?.doc){let t=lp(n.doc,{});t.anchors=new Set;for(let e of n.anchors.keys())t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;let r=e.toString(t);if(!n.mapKeyWarned){let e=JSON.stringify(r);e.length>40&&(e=e.substring(0,36)+`..."`),mp(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function Sp(e,t,n){return new Cp(Uf(e,void 0,n),Uf(t,void 0,n))}var Cp=class e{constructor(e,t=null){Object.defineProperty(this,gf,{value:pf}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return X(n)&&(n=n.clone(t)),X(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return bp(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?pp(this,e,t,n):JSON.stringify(this)}};function wp(e,t,n){return(t.inFlow??e.flow?Ep:Tp)(e,t,n)}function Tp({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:o,onComment:s}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:a,type:null}),d=!1,f=[];for(let e=0;e<t.length;++e){let i=t[e],o=null;if(X(i))!d&&i.spaceBefore&&f.push(``),Dp(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(q(i)){let e=X(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),Dp(n,f,e.commentBefore,d))}d=!1;let s=fp(i,u,()=>o=null,()=>d=!0);o&&(s+=Yf(s,a,l(o))),d&&o&&(d=!1),f.push(r+s)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let e=1;e<f.length;++e){let t=f[e];p+=t?`\n${c}${t}`:`
|
|
36
|
+
`}}return e?(p+=`
|
|
37
|
+
`+Jf(l(e),c),s&&s()):d&&o&&o(),p}function Ep({items:e},t,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:a,flowCollectionPadding:o,options:{commentString:s}}=t;r+=a;let c=Object.assign({},t,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let n=0;n<e.length;++n){let i=e[n],a=null;if(X(i))i.spaceBefore&&d.push(``),Dp(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(q(i)){let e=X(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),Dp(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=X(i.value)?i.value:null;n?(n.comment&&(a=n.comment),n.commentBefore&&(l=!0)):i.value==null&&e?.comment&&(a=e.comment)}a&&(l=!0);let o=fp(i,c,()=>a=null);l||=d.length>u||o.includes(`
|
|
38
|
+
`),n<e.length-1?o+=`,`:t.options.trailingComma&&(t.options.lineWidth>0&&(l||=d.reduce((e,t)=>e+t.length+2,2)+(o.length+2)>t.options.lineWidth),l&&(o+=`,`)),a&&(o+=Yf(o,r,s(a))),d.push(o),u=d.length}let{start:f,end:p}=n;if(d.length===0)return f+p;if(!l){let e=d.reduce((e,t)=>e+t.length+2,2);l=t.options.lineWidth>0&&e>t.options.lineWidth}if(l){let e=f;for(let t of d)e+=t?`\n${a}${i}${t}`:`
|
|
39
|
+
`;return`${e}\n${i}${p}`}else return`${f}${o}${d.join(` `)}${o}${p}`}function Dp({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=Jf(t(r),e);n.push(i.trimStart())}}function Op(e,t){let n=J(t)?t.value:t;for(let r of e)if(q(r)&&(r.key===t||r.key===n||J(r.key)&&r.key.value===n))return r}var kp=class extends Kf{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(ff,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,a=new this(e),o=(e,o)=>{if(typeof i==`function`)o=i.call(t,e,o);else if(Array.isArray(i)&&!i.includes(e))return;(o!==void 0||r)&&a.items.push(Sp(e,o,n))};if(t instanceof Map)for(let[e,n]of t)o(e,n);else if(t&&typeof t==`object`)for(let e of Object.keys(t))o(e,t[e]);return typeof e.sortMapEntries==`function`&&a.items.sort(e.sortMapEntries),a}add(e,t){let n;n=q(e)?e:!e||typeof e!=`object`||!(`key`in e)?new Cp(e,e?.value):new Cp(e.key,e.value);let r=Op(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);J(r.value)&&Vf(n.value)?r.value.value=n.value:r.value=n.value}else if(i){let e=this.items.findIndex(e=>i(n,e)<0);e===-1?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){let t=Op(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=Op(this.items,e)?.value;return(!t&&J(n)?n.value:n)??void 0}has(e){return!!Op(this.items,e)}set(e,t){this.add(new Cp(e,t),!0)}toJSON(e,t,n){let r=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(let e of this.items)bp(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!q(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),wp(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}};const Ap={collection:`map`,default:!0,nodeClass:kp,tag:`tag:yaml.org,2002:map`,resolve(e,t){return yf(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>kp.from(e,t,n)};var jp=class extends Kf{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(hf,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=Mp(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=Mp(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&J(r)?r.value:r}has(e){let t=Mp(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=Mp(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];J(r)&&Vf(t)?r.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let r=0;for(let e of this.items)n.push(Lf(e,String(r++),t));return n}toString(e,t,n){return e?wp(this,e,{blockItemPrefix:`- `,flowChars:{start:`[`,end:`]`},itemIndent:(e.indent||``)+` `,onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let a of t){if(typeof r==`function`){let n=t instanceof Set?a:String(e++);a=r.call(t,n,a)}i.items.push(Uf(a,void 0,n))}}return i}};function Mp(e){let t=J(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}const Np={collection:`seq`,default:!0,nodeClass:jp,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return bf(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>jp.from(e,t,n)};function Pp(e){return typeof e==`bigint`||Number.isInteger(e)}const Fp=({value:e})=>JSON.stringify(e),Ip=[{identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify:Fp},{identify:e=>e==null,createNode:()=>new Z(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^null$/,resolve:()=>null,stringify:Fp},{identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^true$|^false$/,resolve:e=>e===`true`,stringify:Fp},{identify:Pp,default:!0,tag:`tag:yaml.org,2002:int`,test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>Pp(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:Fp}];[Ap,Np].concat(Ip,{default:!0,tag:``,test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}});function Lp(e,t,n){let{replacer:r}=n,i=new jp(e);i.tag=`tag:yaml.org,2002:pairs`;let a=0;if(t&&Symbol.iterator in Object(t))for(let e of t){typeof r==`function`&&(e=r.call(t,String(a++),e));let o,s;if(Array.isArray(e))if(e.length===2)o=e[0],s=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`);else if(e&&e instanceof Object){let t=Object.keys(e);if(t.length===1)o=t[0],s=e[o];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else o=e;i.items.push(Sp(o,s,n))}return i}var Rp=class e extends jp{constructor(){super(),this.add=kp.prototype.add.bind(this),this.delete=kp.prototype.delete.bind(this),this.get=kp.prototype.get.bind(this),this.has=kp.prototype.has.bind(this),this.set=kp.prototype.set.bind(this),this.tag=e.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let e of this.items){let r,i;if(q(e)?(r=Lf(e.key,``,t),i=Lf(e.value,r,t)):r=Lf(e,``,t),n.has(r))throw Error(`Ordered maps must not include duplicate keys`);n.set(r,i)}return n}static from(e,t,n){let r=Lp(e,t,n),i=new this;return i.items=r.items,i}};Rp.tag=`tag:yaml.org,2002:omap`;var zp=class e extends kp{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=q(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new Cp(e.key,null):new Cp(e,null),Op(this.items,t.key)||this.items.push(t)}get(e,t){let n=Op(this.items,e);return!t&&q(n)?J(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=Op(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new Cp(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw Error(`Set items must all have null values`)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t)typeof r==`function`&&(e=r.call(t,e,e)),i.items.push(Sp(e,null,n));return i}};zp.tag=`tag:yaml.org,2002:set`;const Bp=Symbol(`break visit`),Vp=Symbol(`skip children`),Hp=Symbol(`remove item`);function Up(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),Wp(Object.freeze([]),e,t)}Up.BREAK=Bp,Up.SKIP=Vp,Up.REMOVE=Hp,Up.itemAtPath=(e,t)=>{let n=e;for(let[e,r]of t){let t=n?.[e];if(t&&`items`in t)n=t.items[r];else return}return n},Up.parentCollection=(e,t)=>{let n=Up.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&`items`in i)return i;throw Error(`Parent collection not found`)};function Wp(e,t,n){let r=n(t,e);if(typeof r==`symbol`)return r;for(let i of[`key`,`value`]){let a=t[i];if(a&&`items`in a){for(let t=0;t<a.items.length;++t){let r=Wp(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===Bp)return Bp;else r===Hp&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}t(((e,t)=>{function n(e){return Array.isArray(e)?e:[e]}let r=/^\s+$/,i=/(?:[^\\]|^)\\$/,a=/^\\!/,o=/^\\#/,s=/\r?\n/g,c=/^\.{0,2}\/|^\.{1,2}$/,l=/\/$/,u=`node-ignore`;typeof Symbol<`u`&&(u=Symbol.for(`node-ignore`));let d=u,f=(e,t,n)=>(Object.defineProperty(e,t,{value:n}),n),p=/([0-z])-([0-z])/g,m=()=>!1,h=e=>e.replace(p,(e,t,n)=>t.charCodeAt(0)<=n.charCodeAt(0)?e:``),g=e=>{let{length:t}=e;return e.slice(0,t-t%2)},ee=[[/^\uFEFF/,()=>``],[/((?:\\\\)*?)(\\?\s+)$/,(e,t,n)=>t+(n.indexOf(`\\`)===0?` `:``)],[/(\\+?)\s/g,(e,t)=>{let{length:n}=t;return t.slice(0,n-n%2)+` `}],[/[\\$.|*+(){^]/g,e=>`\\${e}`],[/(?!\\)\?/g,()=>`[^/]`],[/^\//,()=>`^`],[/\//g,()=>`\\/`],[/^\^*\\\*\\\*\\\//,()=>`^(?:.*\\/)?`],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?`^`:`(?:^|\\/)`}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(e,t,n)=>t+6<n.length?`(?:\\/[^\\/]+)*`:`\\/.+`],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(e,t,n)=>t+n.replace(/\\\*/g,`[^\\/]*`)],[/\\\\\\(?=[$.|*+(){^])/g,()=>`\\`],[/\\\\/g,()=>`\\`],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,n,r,i)=>t===`\\`?`\\[${n}${g(r)}${i}`:i===`]`&&r.length%2==0?`[${h(n)}${r}]`:`[]`],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`]],_=/(^|\\\/)?\\\*$/,te=`regex`,ne=`checkRegex`,re={[te](e,t){return`${t?`${t}[^/]+`:`[^/]*`}(?=$|\\/$)`},[ne](e,t){return`${t?`${t}[^/]*`:`[^/]*`}(?=$|\\/$)`}},ie=e=>ee.reduce((t,[n,r])=>t.replace(n,r.bind(e)),e),ae=e=>typeof e==`string`,oe=e=>e&&ae(e)&&!r.test(e)&&!i.test(e)&&e.indexOf(`#`)!==0,se=e=>e.split(s).filter(Boolean);var ce=class{constructor(e,t,n,r,i,a){this.pattern=e,this.mark=t,this.negative=i,f(this,`body`,n),f(this,`ignoreCase`,r),f(this,`regexPrefix`,a)}get regex(){let e=`_regex`;return this[e]?this[e]:this._make(te,e)}get checkRegex(){let e=`_checkRegex`;return this[e]?this[e]:this._make(ne,e)}_make(e,t){let n=this.regexPrefix.replace(_,re[e]),r=this.ignoreCase?new RegExp(n,`i`):new RegExp(n);return f(this,t,r)}};let v=({pattern:e,mark:t},n)=>{let r=!1,i=e;i.indexOf(`!`)===0&&(r=!0,i=i.substr(1)),i=i.replace(a,`!`).replace(o,`#`);let s=ie(i);return new ce(e,t,i,n,r,s)};var le=class{constructor(e){this._ignoreCase=e,this._rules=[]}_add(e){if(e&&e[d]){this._rules=this._rules.concat(e._rules._rules),this._added=!0;return}if(ae(e)&&(e={pattern:e}),oe(e.pattern)){let t=v(e,this._ignoreCase);this._added=!0,this._rules.push(t)}}add(e){return this._added=!1,n(ae(e)?se(e):e).forEach(this._add,this),this._added}test(e,t,n){let r=!1,i=!1,a;this._rules.forEach(o=>{let{negative:s}=o;i===s&&r!==i||s&&!r&&!i&&!t||o[n].test(e)&&(r=!s,i=s,a=s?void 0:o)});let o={ignored:r,unignored:i};return a&&(o.rule=a),o}};let ue=(e,t)=>{throw new t(e)},de=(e,t,n)=>ae(e)?e?!de.isNotRelative(e)||n(`path should be a \`path.relative()\`d string, but got "${t}"`,RangeError):n(`path must not be empty`,TypeError):n(`path must be a string, but got \`${t}\``,TypeError),fe=e=>c.test(e);de.isNotRelative=fe,de.convert=e=>e;var pe=class{constructor({ignorecase:e=!0,ignoreCase:t=e,allowRelativePaths:n=!1}={}){f(this,d,!0),this._rules=new le(t),this._strictPathCheck=!n,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add(e){return this._rules.add(e)&&this._initCache(),this}addPattern(e){return this.add(e)}_test(e,t,n,r){let i=e&&de.convert(e);return de(i,e,this._strictPathCheck?ue:m),this._t(i,t,n,r)}checkIgnore(e){if(!l.test(e))return this.test(e);let t=e.split(`/`).filter(Boolean);if(t.pop(),t.length){let e=this._t(t.join(`/`)+`/`,this._testCache,!0,t);if(e.ignored)return e}return this._rules.test(e,!1,ne)}_t(e,t,n,r){if(e in t)return t[e];if(r||=e.split(`/`).filter(Boolean),r.pop(),!r.length)return t[e]=this._rules.test(e,n,te);let i=this._t(r.join(`/`)+`/`,t,n,r);return t[e]=i.ignored?i:this._rules.test(e,n,te)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return n(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}};let me=e=>new pe(e),he=e=>de(e&&de.convert(e),e,m),ge=()=>{de.convert=e=>/^\\\\\?\\/.test(e)||/["<>|\u0000-\u001F]+/u.test(e)?e:e.replace(/\\/g,`/`);let e=/^[a-z]:\//i;de.isNotRelative=t=>e.test(t)||fe(t)};typeof process<`u`&&process.platform===`win32`&&ge(),t.exports=me,me.default=me,t.exports.isPathValid=he,f(t.exports,Symbol.for(`setupWindows`),ge)}))(),globalThis.Buffer,A({command:Tr({description:`Bash command to execute`}),timeout:Lt(xr({description:`Timeout in seconds (optional, no default timeout)`}))});var Gp=class{diff(e,t,n={}){let r;typeof n==`function`?(r=n,n={}):`callback`in n&&(r=n.callback);let i=this.castInput(e,n),a=this.castInput(t,n),o=this.removeEmpty(this.tokenize(i,n)),s=this.removeEmpty(this.tokenize(a,n));return this.diffWithOptionsObj(o,s,n,r)}diffWithOptionsObj(e,t,n,r){let i=e=>{if(e=this.postProcess(e,n),r){setTimeout(function(){r(e)},0);return}else return e},a=t.length,o=e.length,s=1,c=a+o;n.maxEditLength!=null&&(c=Math.min(c,n.maxEditLength));let l=n.timeout??1/0,u=Date.now()+l,d=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(d[0],t,e,0,n);if(d[0].oldPos+1>=o&&f+1>=a)return i(this.buildValues(d[0].lastComponent,t,e));let p=-1/0,m=1/0,h=()=>{for(let r=Math.max(p,-s);r<=Math.min(m,s);r+=2){let s,c=d[r-1],l=d[r+1];c&&(d[r-1]=void 0);let u=!1;if(l){let e=l.oldPos-r;u=l&&0<=e&&e<a}let h=c&&c.oldPos+1<o;if(!u&&!h){d[r]=void 0;continue}if(s=!h||u&&c.oldPos<l.oldPos?this.addToPath(l,!0,!1,0,n):this.addToPath(c,!1,!0,1,n),f=this.extractCommon(s,t,e,r,n),s.oldPos+1>=o&&f+1>=a)return i(this.buildValues(s.lastComponent,t,e))||!0;d[r]=s,s.oldPos+1>=o&&(m=Math.min(m,r-1)),f+1>=a&&(p=Math.max(p,r+1))}s++};if(r)(function e(){setTimeout(function(){if(s>c||Date.now()>u)return r(void 0);h()||e()},0)})();else for(;s<=c&&Date.now()<=u;){let e=h();if(e)return e}}addToPath(e,t,n,r,i){let a=e.lastComponent;return a&&!i.oneChangePerToken&&a.added===t&&a.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:a.count+1,added:t,removed:n,previousComponent:a.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:a}}}extractCommon(e,t,n,r,i){let a=t.length,o=n.length,s=e.oldPos,c=s-r,l=0;for(;c+1<a&&s+1<o&&this.equals(n[s+1],t[c+1],i);)c++,s++,l++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return l&&!i.oneChangePerToken&&(e.lastComponent={count:l,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=s,c}equals(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){let t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join(``)}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,n){let r=[],i;for(;e;)r.push(e),i=e.previousComponent,delete e.previousComponent,e=i;r.reverse();let a=r.length,o=0,s=0,c=0;for(;o<a;o++){let e=r[o];if(e.removed)e.value=this.join(n.slice(c,c+e.count)),c+=e.count;else{if(!e.added&&this.useLongestToken){let r=t.slice(s,s+e.count);r=r.map(function(e,t){let r=n[c+t];return r.length>e.length?r:e}),e.value=this.join(r)}else e.value=this.join(t.slice(s,s+e.count));s+=e.count,e.added||(c+=e.count)}}return r}};new class extends Gp{};function Kp(e,t){let n;for(n=0;n<e.length&&n<t.length;n++)if(e[n]!=t[n])return e.slice(0,n);return e.slice(0,n)}function qp(e,t){let n;if(!e||!t||e[e.length-1]!=t[t.length-1])return``;for(n=0;n<e.length&&n<t.length;n++)if(e[e.length-(n+1)]!=t[t.length-(n+1)])return e.slice(-n);return e.slice(-n)}function Jp(e,t,n){if(e.slice(0,t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't start with prefix ${JSON.stringify(t)}; this is a bug`);return n+e.slice(t.length)}function Yp(e,t,n){if(!t)return e+n;if(e.slice(-t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't end with suffix ${JSON.stringify(t)}; this is a bug`);return e.slice(0,-t.length)+n}function Xp(e,t){return Jp(e,t,``)}function Zp(e,t){return Yp(e,t,``)}function Qp(e,t){return t.slice(0,$p(e,t))}function $p(e,t){let n=0;e.length>t.length&&(n=e.length-t.length);let r=t.length;e.length<t.length&&(r=e.length);let i=Array(r),a=0;i[0]=0;for(let e=1;e<r;e++){for(t[e]==t[a]?i[e]=i[a]:i[e]=a;a>0&&t[e]!=t[a];)a=i[a];t[e]==t[a]&&a++}a=0;for(let r=n;r<e.length;r++){for(;a>0&&e[r]!=t[a];)a=i[a];e[r]==t[a]&&a++}return a}function em(e,t){let n=[];for(let r of Array.from(t.segment(e))){let e=r.segment;n.length&&/\s/.test(n[n.length-1])&&/\s/.test(e)?n[n.length-1]+=e:n.push(e)}return n}function tm(e,t){if(t)return rm(e,t)[1];let n;for(n=e.length-1;n>=0&&e[n].match(/\s/);n--);return e.substring(n+1)}function nm(e,t){if(t)return rm(e,t)[0];let n=e.match(/^\s*/);return n?n[0]:``}function rm(e,t){if(!t)return[nm(e),tm(e)];if(t.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);let n=em(e,t),r=n[0],i=n[n.length-1];return[/\s/.test(r)?r:``,/\s/.test(i)?i:``]}const im=`a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}`,am=RegExp(`[${im}]+|\\s+|[^${im}]`,`ug`);new class extends Gp{equals(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()}tokenize(e,t={}){let n;if(t.intlSegmenter){let r=t.intlSegmenter;if(r.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);n=em(e,r)}else n=e.match(am)||[];let r=[],i=null;return n.forEach(e=>{/\s/.test(e)?i==null?r.push(e):r.push(r.pop()+e):i!=null&&/\s/.test(i)?r[r.length-1]==i?r.push(r.pop()+e):r.push(i+e):r.push(e),i=e}),r}join(e){return e.map((e,t)=>t==0?e:e.replace(/^\s+/,``)).join(``)}postProcess(e,t){if(!e||t.oneChangePerToken)return e;let n=null,r=null,i=null;return e.forEach(e=>{e.added?r=e:e.removed?i=e:((r||i)&&om(n,i,r,e,t.intlSegmenter),n=e,r=null,i=null)}),(r||i)&&om(n,i,r,null,t.intlSegmenter),e}};function om(e,t,n,r,i){if(t&&n){let[a,o]=rm(t.value,i),[s,c]=rm(n.value,i);if(e){let r=Kp(a,s);e.value=Yp(e.value,s,r),t.value=Xp(t.value,r),n.value=Xp(n.value,r)}if(r){let e=qp(o,c);r.value=Jp(r.value,c,e),t.value=Zp(t.value,e),n.value=Zp(n.value,e)}}else if(n){if(e){let e=nm(n.value,i);n.value=n.value.substring(e.length)}if(r){let e=nm(r.value,i);r.value=r.value.substring(e.length)}}else if(e&&r){let n=nm(r.value,i),[a,o]=rm(t.value,i),s=Kp(n,a);t.value=Xp(t.value,s);let c=qp(Xp(n,s),o);t.value=Zp(t.value,c),r.value=Jp(r.value,n,c),e.value=Yp(e.value,n,n.slice(0,n.length-c.length))}else if(r){let e=nm(r.value,i),n=Qp(tm(t.value,i),e);t.value=Zp(t.value,n)}else if(e){let n=Qp(tm(e.value,i),nm(t.value,i));t.value=Xp(t.value,n)}}new class extends Gp{tokenize(e){let t=RegExp(`(\\r?\\n)|[${im}]+|[^\\S\\n\\r]+|[^${im}]`,`ug`);return e.match(t)||[]}},new class extends Gp{constructor(){super(...arguments),this.tokenize=sm}equals(e,t,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
|
|
40
|
+
`))&&(e=e.trim()),(!n.newlineIsToken||!t.includes(`
|
|
41
|
+
`))&&(t=t.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith(`
|
|
42
|
+
`)&&(e=e.slice(0,-1)),t.endsWith(`
|
|
43
|
+
`)&&(t=t.slice(0,-1))),super.equals(e,t,n)}};function sm(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
44
|
+
`));let n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let e=0;e<r.length;e++){let i=r[e];e%2&&!t.newlineIsToken?n[n.length-1]+=i:n.push(i)}return n}function cm(e){return e==`.`||e==`!`||e==`?`}new class extends Gp{tokenize(e){let t=[],n=0;for(let r=0;r<e.length;r++){if(r==e.length-1){t.push(e.slice(n));break}if(cm(e[r])&&e[r+1].match(/\s/)){for(t.push(e.slice(n,r+1)),r=n=r+1;e[r+1]?.match(/\s/);)r++;t.push(e.slice(n,r+1)),n=r+1}}return t}},new class extends Gp{tokenize(e){return e.split(/([{}:;,]|\s+)/)}},new class extends Gp{constructor(){super(...arguments),this.tokenize=sm}get useLongestToken(){return!0}castInput(e,t){let{undefinedReplacement:n,stringifyReplacer:r=(e,t)=>t===void 0?n:t}=t;return typeof e==`string`?e:JSON.stringify(lm(e,null,null,r),null,` `)}equals(e,t,n){return super.equals(e.replace(/,([\r\n])/g,`$1`),t.replace(/,([\r\n])/g,`$1`),n)}};function lm(e,t,n,r,i){t||=[],n||=[],r&&(e=r(i===void 0?``:i,e));let a;for(a=0;a<t.length;a+=1)if(t[a]===e)return n[a];let o;if(Object.prototype.toString.call(e)===`[object Array]`){for(t.push(e),o=Array(e.length),n.push(o),a=0;a<e.length;a+=1)o[a]=lm(e[a],t,n,r,String(a));return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),typeof e==`object`&&e){t.push(e),o={},n.push(o);let i=[],s;for(s in e)Object.prototype.hasOwnProperty.call(e,s)&&i.push(s);for(i.sort(),a=0;a<i.length;a+=1)s=i[a],o[s]=lm(e[s],t,n,r,s);t.pop(),n.pop()}else o=e;return o}new class extends Gp{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}};const um=A({oldText:Tr({description:`Exact text for one targeted replacement. It must be unique in the original file and must not overlap with any other edits[].oldText in the same call.`}),newText:Tr({description:`Replacement text for this targeted edit.`})},{});A({path:Tr({description:`Path to the file to edit (relative or absolute)`}),edits:Kt(um,{description:`One or more targeted replacements. Each edit is matched against the original file, not incrementally. Do not include overlapping or nested edits. If two changes touch the same block or nearby lines, merge them into one edit instead.`})},{}),A({path:Tr({description:`Path to the file to read (relative or absolute)`}),offset:Lt(xr({description:`Line number to start reading from (1-indexed)`})),limit:Lt(xr({description:`Maximum number of lines to read`}))}),A({path:Tr({description:`Path to the file to write (relative or absolute)`}),content:Tr({description:`Content to write to the file`})});const dm={enabled:!0,reserveTokens:16384,keepRecentTokens:2e4};function fm(e,t,n){return n.enabled?e>t-n.reserveTokens:!1}function pm(e){if(typeof e==`string`)return e.length;let t=0;for(let n of e)n.type===`text`&&n.text?t+=n.text.length:n.type===`image`&&(t+=4800);return t}function mm(e){let t=0;switch(e.role){case`user`:return t=pm(e.content),Math.ceil(t/4);case`assistant`:{let n=e;for(let e of n.content)e.type===`text`?t+=e.text.length:e.type===`thinking`?t+=e.thinking.length:e.type===`toolCall`&&(t+=e.name.length+JSON.stringify(e.arguments).length);return Math.ceil(t/4)}case`custom`:case`toolResult`:return t=pm(e.content),Math.ceil(t/4);case`bashExecution`:return t=e.command.length+e.output.length,Math.ceil(t/4);case`branchSummary`:case`compactionSummary`:return t=e.summary.length,Math.ceil(t/4)}return 0}const hm=n(`context-compaction`);function gm(e,t){return e.role===t}function _m(e){let t=0;for(;t<e.length&&gm(e[t],`toolResult`);){let n=e[t];hm.warn(`Dropping orphaned toolResult (no preceding assistant message)`,{toolCallId:n.toolCallId}),t++}return t>0?e.slice(t):e}function vm(e){let t=[];for(let n of e){let e=n;switch(e.role){case`user`:t.push(`<user>\n${ym(e.content)}\n</user>`);break;case`assistant`:t.push(`<assistant>\n${ym(e.content)}\n</assistant>`);break;case`toolResult`:{let n=e.toolName??`tool`;t.push(`<tool-result name="${n}">\n${ym(e.content)}\n</tool-result>`);break}case`bashExecution`:t.push(`<bash>\n$ ${e.command??``}\n${e.output??``}\n</bash>`);break;case`branchSummary`:case`compactionSummary`:t.push(`<prior-summary>\n${e.summary??``}\n</prior-summary>`);break;default:t.push(`<${e.role}>\n${ym(e.content)}\n</${e.role}>`)}}return t.join(`
|
|
45
|
+
|
|
46
|
+
`)}function ym(e){if(typeof e==`string`)return e;if(!Array.isArray(e))return``;let t=[];for(let n of e){let e=n;e.type===`text`&&e.text?t.push(e.text):e.type===`thinking`&&e.thinking?t.push(`[thinking] ${e.thinking}`):e.type===`toolCall`?t.push(`[tool-call ${e.name??`?`}] ${JSON.stringify(e.arguments??{})}`):e.type===`image`&&t.push(`[image]`)}return t.join(`
|
|
47
|
+
`)}function bm(e){return`You are a context compaction assistant. You are shown the prefix of a conversation between a user and an AI coding assistant, and asked to produce either a structured summary, durable memory bullets, or a short title — depending on the user's instruction.
|
|
48
|
+
|
|
49
|
+
Do NOT continue the conversation. Do NOT answer questions inside the conversation. Output ONLY what the user asks for in the format specified.
|
|
50
|
+
|
|
51
|
+
<conversation>
|
|
52
|
+
${e}
|
|
53
|
+
</conversation>`}async function xm(e,t,n,r,i,a,o){let s=await ee(e,{systemPrompt:n,messages:[{role:`user`,content:[{type:`text`,text:r}],timestamp:Date.now()}]},{maxTokens:i,apiKey:t,headers:a,signal:o});if(s.stopReason===`error`)throw Error(`Compaction call failed: ${s.errorMessage||`Unknown error`}`);return s.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
54
|
+
`).trim()}function Sm(e){if(typeof e==`string`)return e.length;if(!Array.isArray(e))return 0;let t=0;for(let n of e){let e=n;if(e.type===`text`&&e.text)t+=e.text.length;else if(e.type===`thinking`&&e.thinking)t+=e.thinking.length;else if(e.type===`toolCall`&&e.arguments!==void 0)try{t+=JSON.stringify(e.arguments).length}catch{}else e.type===`image`&&e.source?.data&&(t+=e.source.data.length)}return t}function Cm(e,t){let n=Math.max(1,Math.round(e/1024));return`[${t===`assistant`?`Assistant message elided`:`Tool result elided`}: ${n} KB, exceeds half the context window. Re-run with smaller arguments — e.g. open --view --size low.]`}function wm(e,t,n){let r=(t-n)/2,i=0,a=0;return{messages:e.map(e=>{if(mm(e)<=r)return e;let t=e.role;if(t!==`toolResult`&&t!==`assistant`)return e;let n=e,o=Sm(n.content);if(t===`toolResult`)return i++,a+=o,{...e,content:[{type:`text`,text:Cm(o,`toolResult`)}]};let s=(Array.isArray(n.content)?n.content:[]).filter(e=>e.type===`toolCall`);if(s.length===0)return e;let c=s.map(e=>{let t=0;if(e.arguments!==void 0)try{t=JSON.stringify(e.arguments).length}catch{}return{type:e.type,id:e.id,name:e.name,arguments:{elided:!0,originalBytes:t}}});return i++,a+=o,{...e,content:[{type:`text`,text:Cm(o,`assistant`)},...c]}}),elidedCount:i,elidedBytes:a}}function Tm(e){let t=0;for(let n of e)t+=mm(n);return t}function Em(e,t){try{e.onCompactionStateChange?.(t)}catch(e){hm.warn(`onCompactionStateChange listener threw`,{error:e instanceof Error?e.message:String(e)})}}function Dm(e,t,n,r,i,a){if(t<=n*i)return{messages:e,isHopeless:!1,earlyReturn:null};let o=wm(e,n,r),s=o.messages;return hm.warn(`Compaction hopeless branch`,{totalTokens:t,contextWindow:n,multiplier:i,elidedCount:o.elidedCount,elidedBytes:o.elidedBytes}),{messages:s,isHopeless:!0,earlyReturn:fm(Tm(s),n,a)?null:s}}function Om(e,t){let n=0,r=e.length;for(let i=e.length-1;i>=0;i--){let a=mm(e[i]);if(n+a>t&&r<e.length)break;n+=a,r=i}for(;r>0&&gm(e[r],`toolResult`);)r--;return r<=0||r>=e.length?(hm.warn(`Cannot find valid cut point for compaction`),null):{messagesToSummarize:e.slice(0,r),messagesToKeep:_m(e.slice(r))}}async function km(e,t,n,r){if(e.onMemoryUpdates)try{Em(e,`extracting-memory`);let i=await xm(e.model,t,n,`From the conversation above, extract durable memories worth persisting to a global memory file shared across future sessions.
|
|
55
|
+
|
|
56
|
+
Focus on:
|
|
57
|
+
- User preferences, working style, opinions stated explicitly.
|
|
58
|
+
- Stable project facts (architecture decisions, conventions, constraints).
|
|
59
|
+
- Validated approaches the user accepted ("yes, exactly", "perfect"), not just corrections.
|
|
60
|
+
- External resources/links the user named.
|
|
61
|
+
|
|
62
|
+
DO NOT include:
|
|
63
|
+
- Ephemeral state (current task, in-progress work).
|
|
64
|
+
- Information already obvious from the codebase (file paths, function names, framework conventions).
|
|
65
|
+
- Generic restatements of what the conversation was about.
|
|
66
|
+
|
|
67
|
+
If nothing in the conversation is worth persisting, return exactly the single line:
|
|
68
|
+
NONE
|
|
69
|
+
|
|
70
|
+
Otherwise, output ONLY a markdown bullet list (one bullet per memory), no headers, no preamble, no follow-up. Each bullet is one line. Be specific. Prefer one fact per bullet over multi-clause sentences.`,2048,e.headers,r);if(i?.trim()&&i.trim()!==`NONE`)try{await e.onMemoryUpdates(i.trim()),hm.info(`Memory extraction applied`,{bulletsLength:i.length})}catch(e){hm.warn(`onMemoryUpdates callback threw`,{error:e instanceof Error?e.message:String(e)})}else hm.info(`Memory extraction returned no durable memories`)}catch(e){hm.warn(`Memory extraction call failed (compaction still applied)`,{error:e instanceof Error?e.message:String(e)})}}async function Am(e,t,n,r,i,a,o){try{let s=bm(vm(n)),c=Math.floor(.8*i);Em(e,`summarizing`);let l=await xm(e.model,t,s,`Produce a structured context checkpoint summary of the conversation above that another LLM can use to continue the work.
|
|
71
|
+
|
|
72
|
+
Use this EXACT format:
|
|
73
|
+
|
|
74
|
+
## Goal
|
|
75
|
+
[What is the user trying to accomplish? Can be multiple items if the session covers different tasks.]
|
|
76
|
+
|
|
77
|
+
## Constraints & Preferences
|
|
78
|
+
- [Any constraints, preferences, or requirements mentioned by user]
|
|
79
|
+
- [Or "(none)" if none were mentioned]
|
|
80
|
+
|
|
81
|
+
## Progress
|
|
82
|
+
### Done
|
|
83
|
+
- [x] [Completed tasks/changes]
|
|
84
|
+
|
|
85
|
+
### In Progress
|
|
86
|
+
- [ ] [Current work]
|
|
87
|
+
|
|
88
|
+
### Blocked
|
|
89
|
+
- [Issues preventing progress, if any]
|
|
90
|
+
|
|
91
|
+
## Key Decisions
|
|
92
|
+
- **[Decision]**: [Brief rationale]
|
|
93
|
+
|
|
94
|
+
## Next Steps
|
|
95
|
+
1. [Ordered list of what should happen next]
|
|
96
|
+
|
|
97
|
+
## Critical Context
|
|
98
|
+
- [Any data, examples, or references needed to continue]
|
|
99
|
+
- [Or "(none)" if not applicable]
|
|
100
|
+
|
|
101
|
+
Keep each section concise. Preserve exact file paths, function names, and error messages. Output ONLY the summary, with no preamble or follow-up.`,c,e.headers,o),u={role:`user`,content:[{type:`text`,text:`<context-summary>\n${l}\n</context-summary>`}],timestamp:Date.now()};return hm.info(`LLM summarization successful`,{originalMessages:a,compactedMessages:1+r.length,summaryLength:l.length}),await km(e,t,s,o),Em(e,`idle`),[u,...r]}catch(e){return hm.warn(`LLM summarization failed, falling back to naive drop`,{error:e instanceof Error?e.message:String(e)}),null}}function jm(e){let t=e.contextWindow??2e5,n=e.reserveTokens??dm.reserveTokens,r=e.keepRecentTokens??dm.keepRecentTokens,i=e.hopelessMultiplier??4,a={enabled:!0,reserveTokens:n,keepRecentTokens:r};return async(o,s)=>{if(o.length===0)return o;let c=Tm(o);if(!fm(c,t,a))return o;let l=Dm(o,c,t,n,i,a);if(l.earlyReturn)return l.earlyReturn;let u=l.messages,d=l.isHopeless;hm.info(`Context compaction triggered`,{totalTokens:c,contextWindow:t,threshold:t-n,messageCount:u.length});let f=Om(u,r);if(!f)return u;let{messagesToSummarize:p,messagesToKeep:m}=f;hm.info(`Compaction cut point`,{summarizing:p.length,keeping:m.length});let h=d?void 0:e.getApiKey();if(h){let t=await Am(e,h,p,m,n,o.length,s);if(t)return t}else d||hm.warn(`No API key available for LLM summarization, falling back to naive drop`);Em(e,`idle`);let g={role:`user`,content:[{type:`text`,text:`[Earlier conversation messages were compacted to save context space]`}],timestamp:Date.now()};return hm.info(`Naive compaction applied`,{originalMessages:o.length,compactedMessages:1+m.length}),[g,...m]}}const Mm=m({portName:`secrets.crud`,panelRpcOp:`secrets-bridge`,timeoutMs:1e4,onUnavailable:`resolve-undefined`,makeError:e=>Error(e),logNamespace:`secrets-bridge`,toPortMessage:({type:e,payload:t})=>({type:e,...t}),toPanelRpcPayload:({type:e,payload:t})=>({type:e,payload:t})});function Nm(e,t){return Mm({type:e,payload:t})}const Pm=n(`secret-scrub`),Fm=async e=>e;function Im(){let e=oe();return e===`extension-direct`?async e=>{if(!e)return e;try{let t=await new Promise(t=>{chrome.runtime.sendMessage({type:`secrets.scrub-tool-result`,text:e},e=>t(e??{}))});return t.error?(Pm.debug(`SW scrub-tool-result returned error`,{error:t.error}),e):typeof t.text==`string`?t.text:e}catch(t){return Pm.debug(`SW scrub-tool-result failed`,{error:t instanceof Error?t.message:String(t)}),e}}:e===`extension-delegate`?async e=>{if(!e)return e;try{let t=await Nm(`secrets.scrub-tool-result`,{text:e});return t?.error?(Pm.debug(`Bridge scrub-tool-result returned error`,{error:t.error}),e):typeof t?.text==`string`?t.text:e}catch(t){return Pm.debug(`Bridge scrub-tool-result failed`,{error:t instanceof Error?t.message:String(t)}),e}}:e===`connect`?Fm:async e=>{if(!e)return e;try{let t=await fetch(l(`/api/secrets/scrub`),{method:`POST`,headers:u({"content-type":`application/json`}),body:JSON.stringify({text:e})});if(!t.ok)return Pm.debug(`Server scrub-tool-result returned non-ok`,{status:t.status}),e;let n=await t.json();return typeof n.text==`string`?n.text:e}catch(t){return Pm.debug(`Server scrub-tool-result failed`,{error:t instanceof Error?t.message:String(t)}),e}}}const Lm=n(`image-processor`),Rm=3932160,zm=new Set([`image/jpeg`,`image/png`,`image/gif`,`image/webp`]);function Bm(e){return zm.has(e)}function Vm(e,t){try{if(t===`image/png`){if(e.length<32)return null;let t=atob(e.slice(0,32)),n=t.charCodeAt(16)<<24|t.charCodeAt(17)<<16|t.charCodeAt(18)<<8|t.charCodeAt(19),r=t.charCodeAt(20)<<24|t.charCodeAt(21)<<16|t.charCodeAt(22)<<8|t.charCodeAt(23);return n>0&&r>0?{width:n,height:r}:null}if(t===`image/gif`){if(e.length<16)return null;let t=atob(e.slice(0,16)),n=t.charCodeAt(6)|t.charCodeAt(7)<<8,r=t.charCodeAt(8)|t.charCodeAt(9)<<8;return n>0&&r>0?{width:n,height:r}:null}if(t===`image/jpeg`){let t=Math.min(21846*4,e.length),n=atob(e.slice(0,t));for(let e=0;e<n.length-8;e++)if(n.charCodeAt(e)===255){let t=n.charCodeAt(e+1);if(t===192||t===194){let t=n.charCodeAt(e+5)<<8|n.charCodeAt(e+6),r=n.charCodeAt(e+7)<<8|n.charCodeAt(e+8);return r>0&&t>0?{width:r,height:t}:null}}}}catch{}return null}async function Hm(e){if(!Bm(e.mimeType))return Lm.warn(`Unsupported image format`,{mimeType:e.mimeType}),{type:`text`,text:`[Image removed: unsupported format "${e.mimeType}". Supported: JPEG, PNG, GIF, WebP]`};let t=e.data.length,n=Vm(e.data,e.mimeType);if(!(t>5242880||n!==null&&(n.width>8e3||n.height>8e3)||n!==null&&Math.max(n.width,n.height)>1568))return e;Lm.info(`Image needs processing`,{base64Size:t,dimensions:n?`${n.width}x${n.height}`:`unknown`,reason:t>5242880?`size`:`dimensions`});let r,i;try{let e=await import(`./magick-wasm-Daq1kpb4.js`).then(e=>e.n);r=e.getMagick,i=e.MIME_TO_MAGICK_FORMAT}catch(e){return Lm.error(`ImageMagick WASM module unavailable`,{error:e instanceof Error?e.message:String(e)}),{type:`text`,text:`[Image removed: resize service unavailable (ImageMagick WASM could not be loaded)]`}}let a;try{a=await r()}catch(e){return Lm.error(`ImageMagick WASM initialization failed`,{error:e instanceof Error?e.message:String(e)}),{type:`text`,text:`[Image removed: resize service unavailable (WASM init failed)]`}}try{let n=atob(e.data),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);let o={data:null,mime:e.mimeType};if(await a.ImageMagick.read(r,async t=>{let n=t.width,r=t.height,a=Math.max(n,r);if(a>1568){let e=1568/a,i=Math.round(n*e),o=Math.round(r*e);t.resize(i,o),Lm.info(`Resized image`,{from:`${n}x${r}`,to:`${i}x${o}`})}let s=i[e.mimeType]||`JPEG`;t.write(s,e=>{o.data=new Uint8Array(e)}),o.data&&o.data.length>Rm&&s!==`JPEG`?(Lm.info(`Still over 5MB, compressing to JPEG q80`),t.quality=80,t.write(`JPEG`,e=>{o.data=new Uint8Array(e)}),o.mime=`image/jpeg`):o.data&&o.data.length>Rm&&(Lm.info(`Still over 5MB as JPEG, reducing quality to 60`),t.quality=60,t.write(`JPEG`,e=>{o.data=new Uint8Array(e)}))}),!o.data)return Lm.warn(`ImageMagick produced no output`),{type:`text`,text:`[Image removed: could not be processed (empty output from resize)]`};if(o.data.length>Rm)return Lm.warn(`Image still over 5MB after resize+compress`,{size:o.data.length}),{type:`text`,text:`[Image removed: still ${Math.round(o.data.length/1024/1024*10)/10}MB after resize and compression, exceeds 5MB API limit]`};let s=``;for(let e=0;e<o.data.length;e++)s+=String.fromCharCode(o.data[e]);let c=btoa(s);return Lm.info(`Image processed successfully`,{originalBase64:t,newBase64:c.length,mimeType:o.mime}),{type:`image`,data:c,mimeType:o.mime}}catch(n){return Lm.error(`Image data processing failed (corrupt or unreadable)`,{mimeType:e.mimeType,estimatedBytes:t,error:n instanceof Error?n.message:String(n)}),{type:`text`,text:`[Image removed: image data could not be processed (${n instanceof Error?n.message:`corrupt or unreadable`})]`}}}const Um=n(`tool-adapter`),Wm=/<img:(data:(image\/[^;]+);base64,([^>]+))>/g;function Gm(e){let t=[],n=0;for(let r of e.matchAll(Wm)){let i=e.slice(n,r.index);i.trim()&&t.push({type:`text`,text:i.trimEnd()}),t.push({type:`image`,mimeType:r[2],data:r[3]}),n=r.index+r[0].length}let r=e.slice(n);return(r.trim()||t.length===0)&&t.push({type:`text`,text:r||e}),t}async function Km(e){let t=Gm(e),n=[];for(let e of t)e.type===`image`?n.push(await Hm(e)):n.push(e);return n}function qm(e,t,n){return{name:e.name,label:e.name,description:e.description,parameters:e.inputSchema,async execute(r,i,a,o){let s;o&&(s=f({onUpdate:o,toolName:e.name,toolCallId:r}));let c=t?t.processManager.spawn({kind:`tool`,argv:[e.name,...Ym(i)],owner:t.owner,ppid:t.getParentPid?.()}):null,l=null;c&&t&&a&&(a.aborted?t.processManager.signal(c.pid,`SIGINT`):a.addEventListener(`abort`,()=>t.processManager.signal(c.pid,`SIGINT`),{once:!0})),c&&t&&(l=t.processManager.onSignal((e,n)=>{e.pid!==c.pid||n!==`SIGKILL`||t.processManager.exit(c.pid,null)}));let u=c?c.abort.signal:a;try{let r=await e.execute(i??{},u),a=r.content;if(n&&typeof a==`string`&&a.length>0)try{a=await n.scrubToolResult(a)}catch(t){Um.warn(`Tool-result scrub failed, falling back to unscrubbed content`,{tool:e.name,error:t instanceof Error?t.message:String(t)}),a=r.content}let o;try{o=await Km(a)}catch(t){Um.warn(`Image processing failed, falling back to raw content`,{tool:e.name,error:t instanceof Error?t.message:String(t)}),o=Gm(a)}return c&&t&&t.processManager.exit(c.pid,+!!r.isError),{content:o,details:{isError:r.isError}}}catch(e){throw c&&t&&t.processManager.exit(c.pid,c.abort.signal.aborted?null:1),e}finally{s&&p(s),l?.()}}}}function Jm(e,t,n){return e.map(e=>qm(e,t,n))}function Ym(e){if(typeof e!=`object`||!e)return[];let t=e;for(let e of[`command`,`file_path`,`path`,`pattern`,`url`,`key`,`name`,`query`,`message`]){let n=t[e];if(typeof n==`string`&&n.length>0)return[n]}for(let e of Object.values(t))if(typeof e==`string`&&e.length>0)return[e];return[]}var Xm=e({ACCOUNTS_KEY:()=>$m,__test__:()=>ch,addAccount:()=>Oh,applyProviderDefaults:()=>_h,clearAllSettings:()=>$h,clearApiKey:()=>Jh,clearBaseUrl:()=>Zh,clearSelectedProvider:()=>Gh,exportProviders:()=>Qh,getAccounts:()=>$,getAllAvailableModels:()=>xh,getAllExtraOAuthDomains:()=>Th,getApiKey:()=>Kh,getApiKeyForProvider:()=>Ih,getApiVersionForProvider:()=>zh,getAvailableProviders:()=>lh,getBaseUrl:()=>Yh,getBaseUrlForProvider:()=>Lh,getDeploymentForProvider:()=>Rh,getExtraOAuthDomains:()=>Sh,getOAuthAccountInfo:()=>hh,getProviderConfig:()=>fh,getProviderModels:()=>mh,getRawApiKeyForProvider:()=>Fh,getSelectedModelId:()=>Bh,getSelectedProvider:()=>Uh,isModelHiddenFromPicker:()=>yh,logoutOAuthAccount:()=>jh,maskOAuthTokenWithRetry:()=>Mh,migrateLegacyAuthOnlySelection:()=>oh,persistOAuthMaskViaServiceWorker:()=>Nh,providerOffersLlmModels:()=>uh,removeAccount:()=>Ah,resolveCurrentModel:()=>ig,resolveModelById:()=>rg,resolveModelByShorthand:()=>ag,saveOAuthAccount:()=>Ph,setApiKey:()=>qh,setBaseUrl:()=>Xh,setExtraOAuthDomains:()=>Ch,setExtraOAuthDomainsAsync:()=>wh,setSelectedModelId:()=>Vh,setSelectedProvider:()=>Wh});const Zm=ne,Qm=h,$m=`slicc_accounts`,eh=`selected-model`,th=[`slicc_provider`,`slicc_api_key`,`slicc_base_url`,`anthropic_api_key`,`api_provider`,`azure_resource`,`bedrock_region`],nh=new Set([`github`]);function rh(e){let t;try{t=g()}catch{return!1}return t.includes(e)&&!o(e)}let ih=!1;function ah(){if(!ih){ih=!0;for(let e of th)try{localStorage.removeItem(e)}catch{}oh()}}function oh(){try{let e=localStorage.getItem(eh);if(e){let t=e.indexOf(`:`);if(t>0){let n=e.slice(0,t);(nh.has(n)||rh(n))&&localStorage.removeItem(eh)}}}catch{}try{let e=localStorage.getItem($m);if(!e)return;let t=JSON.parse(e);if(!Array.isArray(t))return;let n=t.filter(e=>!(typeof e==`object`&&e&&typeof e.providerId==`string`&&rh(e.providerId)));n.length!==t.length&&localStorage.setItem($m,JSON.stringify(n))}catch{}}function sh(){ih=!1}const ch={_resetLegacyCleanup:sh};function lh(){let e=g().filter(o),t=a();return[...new Set([...e,...t])].filter(e=>!s(e)?.hidden)}function uh(e){try{if(mh(e).length>0)return!0}catch{}try{if(h(e).length>0)return!0}catch{}let t=s(e);return!!(t?.modelOverrides&&Object.keys(t.modelOverrides).length>0)}function dh(e,t){try{if(mh(e).some(e=>e.id===t))return!0}catch{}try{if(h(e).some(e=>e.id===t))return!0}catch{}let n=s(e);return!!(n?.modelOverrides&&Object.hasOwn(n.modelOverrides,t))}function fh(e){return s(e)||{id:e,name:e.split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `),description:`${e} provider`,requiresApiKey:!0,requiresBaseUrl:!1}}function ph(e,t){t.context_window!==void 0&&(e.contextWindow=t.context_window),t.max_tokens!==void 0&&(e.maxTokens=t.max_tokens),t.reasoning!==void 0&&(e.reasoning=t.reasoning),t.input!==void 0&&(e.input=t.input),t.compat!==void 0&&(e.compat={...e.compat??{},...t.compat}),t.thinkingLevelMap!==void 0&&(e.thinkingLevelMap={...e.thinkingLevelMap??{},...t.thinkingLevelMap})}function mh(e){try{if(e===`bedrock-camp`){let e=te(Lh(`bedrock-camp`));return Qm(`amazon-bedrock`).filter(t=>_(t,e)).map(e=>({...e,api:`bedrock-camp-converse`,provider:`bedrock-camp`}))}let t=fh(e);if(t.getModelIds){let n;try{n=t.getModelIds()}catch(t){return Q.error(`Provider getModelIds callback failed`,{providerId:e,error:t instanceof Error?t.message:String(t)}),[]}let r=new Map;for(let e of g())try{for(let t of Qm(e))r.set(t.id,t)}catch{}return n.map(n=>{let i=`${e}-${n.api===`openai`?`openai`:`anthropic`}`,a=r.get(n.id),o;a?o={...a,api:i,provider:e}:(o=tg(e,n.id,``,i),n.name&&(o.name=n.name));let s=t.modelOverrides?.[n.id];return s&&ph(o,s),ph(o,n),o})}if(t.isOAuth){let n=Qm(`anthropic`),r=`${e}-anthropic`;return n.map(n=>{let i={...n,api:r,provider:e},a=t.modelOverrides?.[n.id];return a&&ph(i,a),i})}return Qm(e===`azure-ai-foundry`?`anthropic`:e)}catch(t){return Q.error(`Failed to load models`,{providerId:e,error:t instanceof Error?t.message:String(t)}),[]}}function hh(e){let t=$().find(t=>t.providerId===e);if(!t?.accessToken)return null;let n=!!t.tokenExpiresAt&&Date.now()>t.tokenExpiresAt-6e4;return{token:t.accessToken,maskedValue:t.maskedValue,expiresAt:t.tokenExpiresAt,userName:t.userName,userAvatar:t.userAvatar,expired:n}}const gh=Object.assign({})[`/packages/webapp/providers.json`]??[],Q=n(`provider-settings`);function _h(e=gh){if(e.length===0||$().length>0)return;let t=new Set(lh());for(let n of e)if(!(!n.providerId||!n.apiKey)){if(!t.has(n.providerId)){Q.warn(`Unknown provider "${n.providerId}" in providers.json — skipping`);continue}Oh(n.providerId,n.apiKey,n.baseUrl)}let n=e.find(e=>e.providerId&&e.apiKey&&t.has(e.providerId));n?.model&&!localStorage.getItem(eh)&&localStorage.setItem(eh,`${n.providerId}:${n.model}`)}const vh=[/haiku/i];function yh(e){return vh.some(t=>t.test(e))}function bh(e){return e.filter(e=>!yh(e.id))}function xh(){let e=$();if(e.length===0)return[];let t=new Map;for(let n of e){if(t.has(n.providerId))continue;let e=fh(n.providerId);if(e.hidden||rh(n.providerId))continue;let r=bh(mh(n.providerId));if(r.length===0)continue;let i={providerId:n.providerId,providerName:e.name,models:r};t.set(n.providerId,i)}return[...t.values()]}function $(){ah();let e=localStorage.getItem($m);if(!e)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>typeof e==`object`&&!!e&&typeof e.providerId==`string`&&typeof e.apiKey==`string`):[]}catch{return[]}}function Sh(e){return ie(localStorage)[e]??[]}function Ch(e,t){let n=ie(localStorage),r=t.map(e=>e.trim()).filter(e=>e.length>0);r.length===0?delete n[e]:n[e]=r,ae(localStorage,n)}async function wh(e,t){if(i()){Ch(e,t);return}let n=r();if(!n)throw Error(`setExtraOAuthDomainsAsync: no DOM and no panel-rpc client — cannot persist to page localStorage`);let{storeAfter:a}=await n.call(`oauth-extras-set`,{providerId:e,domains:t});try{ae(localStorage,a)}catch(t){Q.warn(`worker-shim mirror failed after successful page write — reload to refresh`,{providerId:e,error:t instanceof Error?t.message:String(t)})}}function Th(){return ie(localStorage)}function Eh(e){localStorage.setItem($m,JSON.stringify(e))}async function Dh(e){if(i()){Eh(e);return}let t=r();if(!t)throw Error(`saveAccountsAsync: no DOM and no panel-rpc client — cannot persist to page localStorage`);let n=JSON.stringify(e),{storedJson:a}=await t.call(`save-oauth-accounts`,{accountsJson:n});try{localStorage.setItem($m,a)}catch(e){Q.warn(`worker-shim mirror failed after successful page write — reload to refresh`,{error:e instanceof Error?e.message:String(e)})}}function Oh(e,t,n,r,i){let a=$().filter(t=>t.providerId!==e),o={providerId:e,apiKey:t};n&&(o.baseUrl=n),r&&(o.deployment=r),i&&(o.apiVersion=i),a.push(o),Eh(a)}async function kh(e){let t=oe();try{if(t===`extension-direct`){let t=await new Promise(t=>{chrome.runtime.sendMessage({type:`secrets.delete`,name:`oauth.${e}.token`},n=>{chrome.runtime.lastError&&Q.error(`SW secrets.delete transport failed`,{providerId:e,error:chrome.runtime.lastError.message}),t(n??{})})});t.error&&Q.error(`SW secrets.delete returned error`,{providerId:e,error:t.error})}else if(t===`extension-delegate`){let t=await Nm(`secrets.delete`,{name:`oauth.${e}.token`});t?.error&&Q.error(`Bridge secrets.delete returned error`,{providerId:e,error:t.error})}else if(t!==`connect`){let t=await fetch(l(`/api/secrets/oauth/${e}`),{method:`DELETE`,headers:u()});!t.ok&&t.status!==404&&Q.warn(`OAuth replica DELETE non-ok`,{providerId:e,status:t.status})}}catch(n){Q.error(`OAuth replica removal failed`,{providerId:e,topology:t,error:n instanceof Error?n.message:String(n)})}}async function Ah(e){let t=$().find(t=>t.providerId===e),n=fh(e);t&&n?.isOAuth&&await jh(e),await kh(e),await Dh($().filter(t=>t.providerId!==e));let r=localStorage.getItem(eh)??``,i=r.indexOf(`:`);i>0&&r.slice(0,i)===e&&localStorage.removeItem(eh)}async function jh(e){let t=$().find(t=>t.providerId===e);if(!t)return;let n=fh(e);if(n?.isOAuth){if(n.onOAuthLogout)try{await n.onOAuthLogout()}catch(t){Q.warn(`onOAuthLogout failed`,{providerId:e,error:t instanceof Error?t.message:String(t)})}if(n.getOAuthLogoutUrl){let r=n.getOAuthLogoutUrl(t);if(r){let{openIdpLogoutUrl:t}=await import(`./oauth-service-BuEH8BXq.js`);await t(r).catch(t=>{Q.warn(`IdP logout popup failed`,{providerId:e,error:t instanceof Error?t.message:String(t)})})}}await Dh($().map(t=>t.providerId===e?{providerId:t.providerId,apiKey:``,baseUrl:t.baseUrl,userName:t.userName,userAvatar:t.userAvatar,loggedOut:!0}:t)),await kh(e)}}async function Mh(e,t={}){let n=Math.max(1,t.attempts??3),r=t.delayMs??150,i=t.sleep??(e=>new Promise(t=>setTimeout(t,e))),a;for(let t=0;t<n;t++){let o=await e();if(o.maskedValue)return{maskedValue:o.maskedValue};o.error&&(a=o.error),t<n-1&&await i(r)}return{lastError:a}}async function Nh(e,t,n){let r={providerId:e.providerId,accessToken:e.accessToken,domains:e.domains.join(`,`)},{maskedValue:i,lastError:a}=await Mh(()=>t.sendMaskRequest(r),n);if(!i){Q.error(`OAuth mask give-up: no masked value after retries`,{providerId:e.providerId,reason:a??`no error reported (cold SW or empty reply)`});return}let o=t.getAccounts(),s=o.find(t=>t.providerId===e.providerId);s&&(s.maskedValue=i,await t.saveAccounts(o))}async function Ph(e){let t=$().find(t=>t.providerId===e.providerId),n=$().filter(t=>t.providerId!==e.providerId);n.push({providerId:e.providerId,apiKey:``,accessToken:e.accessToken,refreshToken:e.refreshToken,tokenExpiresAt:e.tokenExpiresAt,userName:e.userName,userAvatar:e.userAvatar,baseUrl:e.baseUrl??t?.baseUrl}),await Dh(n);let r=fh(e.providerId)?.oauthTokenDomains??[],i=Sh(e.providerId),a=new Set,o=[];for(let e of[...r,...i]){let t=e.toLowerCase();a.has(t)||(a.add(t),o.push(e))}if(o.length===0)return;let s=oe();try{if(s===`extension-direct`)await Nh({providerId:e.providerId,accessToken:e.accessToken,domains:o},{sendMaskRequest:t=>new Promise(n=>{chrome.runtime.sendMessage({type:`secrets.mask-oauth-token`,...t},t=>{chrome.runtime.lastError&&Q.error(`SW mask-oauth-token transport failed`,{providerId:e.providerId,error:chrome.runtime.lastError.message});let r=typeof t==`object`&&t?t:void 0;r?.error&&Q.warn(`SW mask-oauth-token returned error`,{providerId:e.providerId,error:r.error}),n(r??{})})}),getAccounts:$,saveAccounts:Dh});else if(s===`extension-delegate`)await Nh({providerId:e.providerId,accessToken:e.accessToken,domains:o},{sendMaskRequest:t=>Nm(`secrets.mask-oauth-token`,t).then(t=>(t?.error&&Q.warn(`Bridge mask-oauth-token returned error`,{providerId:e.providerId,error:t.error}),t??{})).catch(t=>(Q.error(`Bridge mask-oauth-token transport failed`,{providerId:e.providerId,error:t instanceof Error?t.message:String(t)}),{})),getAccounts:$,saveAccounts:Dh});else if(s!==`connect`){let t=await fetch(l(`/api/secrets/oauth-update`),{method:`POST`,headers:u({"Content-Type":`application/json`}),body:JSON.stringify({providerId:e.providerId,accessToken:e.accessToken,domains:o})});if(t.ok){let n=await t.json();if(typeof n.maskedValue==`string`){let t=$(),r=t.find(t=>t.providerId===e.providerId);r&&(r.maskedValue=n.maskedValue,await Dh(t))}else Q.warn(`OAuth replica POST ok but missing maskedValue`,{providerId:e.providerId})}else Q.warn(`OAuth replica POST non-ok`,{providerId:e.providerId,status:t.status})}}catch(t){Q.error(`OAuth replica sync failed`,{providerId:e.providerId,topology:s,error:t instanceof Error?t.message:String(t)})}}function Fh(e){let t=$().find(t=>t.providerId===e);return t&&(t.accessToken||t.apiKey)||null}function Ih(e){let t=$().find(t=>t.providerId===e);return t?t.accessToken||t.apiKey||(fh(e).optionalApiKey?`local`:null):null}function Lh(e){return $().find(t=>t.providerId===e)?.baseUrl??null}function Rh(e){return $().find(t=>t.providerId===e)?.deployment??null}function zh(e){return $().find(t=>t.providerId===e)?.apiVersion??null}function Bh(){let e=localStorage.getItem(eh)||``,t=e.indexOf(`:`);return t>=0?e.slice(t+1):e}function Vh(e){let t=e.indexOf(`:`);if(t>0){let n=e.slice(0,t),r=new Set([...a(),...lh()]),i=n.includes(`.`);if(r.has(n)||!i){localStorage.setItem(eh,e);return}}let n=Uh();localStorage.setItem(eh,`${n}:${e}`)}function Hh(){return localStorage.getItem(eh)||``}function Uh(){let e=Hh(),t=e.indexOf(`:`);if(t>0)return e.slice(0,t);let n=$(),r=Bh();if(r){let e=n.find(e=>uh(e.providerId)&&dh(e.providerId,r));if(e)return e.providerId}let i=n.find(e=>uh(e.providerId));return i?i.providerId:n.length>0?n[0].providerId:`anthropic`}function Wh(e){let t=Bh();localStorage.setItem(eh,`${e}:${t}`)}function Gh(){let e=Bh();localStorage.setItem(eh,e)}function Kh(){return Ih(Uh())}function qh(e){let t=Uh();Oh(t,e,Lh(t)??void 0)}async function Jh(){await Ah(Uh())}function Yh(){return Lh(Uh())}function Xh(e){let t=Uh(),n=Fh(t);n&&Oh(t,n,e||void 0)}function Zh(){let e=Uh(),t=Fh(e);t&&Oh(e,t)}function Qh(){let e=$(),t=Uh(),n=Bh();return e.map(e=>{let r={providerId:e.providerId,apiKey:e.apiKey};return e.baseUrl&&(r.baseUrl=e.baseUrl),e.providerId===t&&n&&(r.model=n),r})}async function $h(){let e=$();await Promise.allSettled(e.map(e=>Ah(e.providerId))),localStorage.removeItem($m),localStorage.removeItem(eh);for(let e of th)localStorage.removeItem(e)}function eg(e){return/^(?:gpt[-.]?|o[0-9]|chatgpt)/i.test(e)?`openai`:`anthropic`}function tg(e,t,n,r){return{id:t,name:t,provider:e,api:r??`${e}-${eg(t)}`,baseUrl:n??``,contextWindow:2e5,maxTokens:16384,input:[`text`,`image`],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},reasoning:!0}}function ng(e,t){return t.isOAuth||e===`azure-ai-foundry`?`anthropic`:e===`bedrock-camp`?`amazon-bedrock`:e}function rg(e){if(!e)return ig();let t=Uh(),n=Lh(t),r=fh(t);try{let i=ng(t,r),a=Zm(i,e);if(!a?.id)throw Error(`Model ${e} not found`);let o=a;return r.isOAuth?o=mh(t).find(t=>t.id===e)||{...o,api:`${t}-anthropic`,provider:t}:t===`bedrock-camp`&&(o={...o,api:`bedrock-camp-converse`,provider:`bedrock-camp`}),n&&(o={...o,baseUrl:n}),o}catch(i){if(Q.debug(`resolveModelById: pi-ai lookup miss, using provider fallback`,{providerId:t,modelId:e,error:i instanceof Error?i.message:String(i)}),r.isOAuth){let r=mh(t).find(t=>t.id===e);return r?n?{...r,baseUrl:n}:r:tg(t,e,n)}return ig()}}function ig(){let e=Uh(),t=Bh(),n=Lh(e),r=mh(e),i=fh(e),a=i.defaultModelId?r.find(e=>e.id.toLowerCase().includes(i.defaultModelId.toLowerCase()))?.id:void 0,o=t||a||r[0]?.id||`claude-sonnet-4-6`;try{let t=ng(e,i),a=Zm(t,o);if(!a?.id)throw Error(`Model ${o} not found in ${t} registry`);let s=a;return i.isOAuth?s=r.find(e=>e.id===o)||{...s,api:`${e}-anthropic`,provider:e}:e===`bedrock-camp`&&(s={...s,api:`bedrock-camp-converse`,provider:`bedrock-camp`}),n&&(s={...s,baseUrl:n}),s}catch(t){Q.debug(`resolveCurrentModel: pi-ai lookup miss, using provider fallback`,{providerId:e,effectiveModelId:o,error:t instanceof Error?t.message:String(t)});let a=r.find(e=>e.id===o);return a?n?{...a,baseUrl:n}:a:i.isOAuth?tg(e,o,n):Zm(`anthropic`,`claude-sonnet-4-0`)}}function ag(e){let t=e.toLowerCase();if(!t)return null;let n=null,r=-1;for(let e of $())for(let i of mh(e.providerId)){let e=i.id.toLowerCase(),a=(i.name??``).toLowerCase();if(!e.includes(t)&&!a.includes(t))continue;let o=i.contextWindow??0;(o>r||o===r&&og(i.id,n??``)>0)&&(r=o,n=i.id)}return n}function og(e,t){let n=e.match(/\d+/g)?.map(Number)??[],r=t.match(/\d+/g)?.map(Number)??[],i=Math.max(n.length,r.length);for(let e=0;e<i;e++){let t=(n[e]??0)-(r[e]??0);if(t!==0)return t}return 0}export{nc as $,Ye as $t,Mh as A,w as An,bn as At,Xh as B,$t as Bt,fh as C,y as Cn,rr as Ct,Uh as D,Fe as Dn,En as Dt,Bh as E,Pe as En,Dn as Et,ig as F,A as Ft,Jm as G,Rt as Gt,wh as H,qt as Ht,rg as I,dn as It,jm as J,yt as Jt,Im as K,At as Kt,ag as L,on as Lt,Nh as M,Se as Mn,N as Mt,uh as N,se as Nn,M as Nt,yh as O,Je as On,P as Ot,Ah as P,oe as Pn,j as Pt,ad as Q,Xe as Qt,Ph as R,an as Rt,hh as S,Me as Sn,ir as St,Fh as T,b as Tn,er as Tt,Vh as U,Wt as Ut,Ch as V,Xt as Vt,Wh as W,Gt as Wt,lf as X,ct as Xt,_m as Y,lt as Yt,rf as Z,at as Zt,lh as _,Le as _n,gr as _t,_h as a,Te as an,Wi as at,Rh as b,Be as bn,lr as bt,Zh as c,De as cn,Ur as ct,$ as d,Oe as dn,wr as dt,Ke as en,oo as et,xh as f,ze as fn,Sr as ft,zh as g,Re as gn,hr as gt,Ih as h,Ae as hn,mr as ht,Oh as i,we as in,Hi as it,oh as j,Ze as jn,_n as jt,jh as k,He as kn,Cn as kt,Gh as l,tt as ln,Er as lt,Kh as m,ke as mn,R as mt,ch as n,C as nn,Xi as nt,$h as o,Ee as on,z as ot,Th as p,Ie as pn,yr as pt,Nm as q,Ct as qt,Xm as r,Ce as rn,Gi as rt,Jh as s,Ve as sn,Xr as st,$m as t,qe as tn,Zi as tt,Qh as u,x as un,Tr as ut,Yh as v,We as vn,_r as vt,mh as w,Ne as wn,tr as wt,Sh as x,je as xn,sr as xt,Lh as y,Ge as yn,L as yt,qh as z,nn as zt};
|