@inkeep/open-knowledge 0.89.1-beta.0 → 0.89.1-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{cli-BJKFRq8q.mjs → cli-hrqP4h40.mjs} +6 -6
- package/dist/cli.mjs +1 -1
- package/dist/constants-Ctl7_9xt.mjs +1 -0
- package/dist/{dist-Bi-hqCKx.mjs → dist-Bjkn1RDc.mjs} +1 -1
- package/dist/{dist-8R56vWE-.mjs → dist-CFnRgnNU.mjs} +1 -1
- package/dist/index.mjs +198 -198
- package/dist/init-CVv8JJj8.mjs +1 -0
- package/dist/{init-O1DiQtaI.mjs → init-Cx9Rxf7N.mjs} +2 -2
- package/dist/{launch-json-removal-TP1Yz9FJ.mjs → launch-json-removal-CYWS0JND.mjs} +1 -1
- package/dist/{loader-BNFA7yiJ.mjs → loader-CRzZ3bL9.mjs} +1 -1
- package/dist/loader-CljrifDX.mjs +1 -0
- package/dist/{md-manager-BGnqyqi1-BW5Abi4P.mjs → md-manager-BGnqyqi1-k6vY_bE4.mjs} +153 -153
- package/dist/{open-browser-zFYM6iXO.mjs → open-browser-DXHuWSGK.mjs} +1 -1
- package/dist/parse-worker.mjs +1 -1
- package/dist/preview-CVpqLSkj.mjs +1 -0
- package/dist/{preview-CIZOpyLN.mjs → preview-D7EfH4h5.mjs} +1 -1
- package/dist/public/assets/{AccountSection-CjfH7U4r.js → AccountSection-CERERS6j.js} +1 -1
- package/dist/public/assets/{ActivityModeContent-C6yrSIW_.js → ActivityModeContent-DsgyoCAB.js} +1 -1
- package/dist/public/assets/{AddPropertiesButton-BXz7FdCC.js → AddPropertiesButton-_zrUbf4N.js} +2 -2
- package/dist/public/assets/{AgentConnectionsSection-t6Fpnhjm.js → AgentConnectionsSection-CQ49GpCE.js} +1 -1
- package/dist/public/assets/{AgentDiffPane-BuA0qrhe.js → AgentDiffPane-Daq416te.js} +1 -1
- package/dist/public/assets/{AttachmentsSection-BJHhhBx0.js → AttachmentsSection-C8yIqGgR.js} +1 -1
- package/dist/public/assets/{AuthModal-CEKKOx6U.js → AuthModal-shp17yMo.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-GUpCwcMl.js → CodeMirrorPropInput-B-R29uWw.js} +1 -1
- package/dist/public/assets/{ContentRulesSection-C3vQM-Rf.js → ContentRulesSection-C4jtLWxn.js} +1 -1
- package/dist/public/assets/{DiffViewBoundary-CS5Pw4WQ.js → DiffViewBoundary-H4_pqUgM.js} +1 -1
- package/dist/public/assets/{DocumentContext-D1hZMYYZ.js → DocumentContext-Bz1OROnW.js} +1 -1
- package/dist/public/assets/{EditorModeToggle-D7Vsb2HL.js → EditorModeToggle-dMBJ7uvp.js} +1 -1
- package/dist/public/assets/{ExcalidrawDocEditor-COIentW7.js → ExcalidrawDocEditor-s16H6agQ.js} +1 -1
- package/dist/public/assets/FeedbackForm-HXxtaDLX.js +1 -0
- package/dist/public/assets/{GraphPanel-DGKZ04lM.js → GraphPanel-DRGSNs9N.js} +1 -1
- package/dist/public/assets/{ImportSkillDialog-C89n1Eez.js → ImportSkillDialog-DfWdbonc.js} +1 -1
- package/dist/public/assets/{LinkPreviewsSection-5eQBE3z2.js → LinkPreviewsSection-vhHB3jqD.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-BGgBsEWq.js → LintConfigEditor-KrTSqaDB.js} +1 -1
- package/dist/public/assets/{LintingSection-CQeFSRZs.js → LintingSection-CKZ3P8VS.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-7-hqZaM9.js +1 -0
- package/dist/public/assets/ManagedArtifactProperties-BIXkL5qN.js +1 -0
- package/dist/public/assets/{MermaidDocEditor-lyGwo627.js → MermaidDocEditor-Bsw-oIqc.js} +1 -1
- package/dist/public/assets/{NetworkAccessSection-G8TFYLiY.js → NetworkAccessSection-SJS-J4JQ.js} +1 -1
- package/dist/public/assets/{ProjectTemplatesSection-Vt0-ODLw.js → ProjectTemplatesSection-BtbNNop0.js} +1 -1
- package/dist/public/assets/{PropertyDisplayRow-wgeDut3G.js → PropertyDisplayRow-gRWBu_Kg.js} +1 -1
- package/dist/public/assets/{PublishToGitHubDialog-BEwmQUAV.js → PublishToGitHubDialog-CX7tkKOb.js} +1 -1
- package/dist/public/assets/{RegisteredAgentIcon-uXi2oPSE.js → RegisteredAgentIcon-_iMx9Az2.js} +1 -1
- package/dist/public/assets/{SchemaConfigEditor-Biug_m3P.js → SchemaConfigEditor-CJVq58QC.js} +1 -1
- package/dist/public/assets/{SearchSection-weEXWdYD.js → SearchSection-CAZXZVs_.js} +1 -1
- package/dist/public/assets/{SessionsHost-CPZXRLpe.js → SessionsHost-DLBNm1gB.js} +2 -2
- package/dist/public/assets/{SettingsDialogBody-C1r5Z8cW.js → SettingsDialogBody-BxqtBG99.js} +2 -2
- package/dist/public/assets/{ShareReceiveMissDialog-yYfzZbu2.js → ShareReceiveMissDialog-Bdve40Xh.js} +1 -1
- package/dist/public/assets/{SkillCostValue-D-VQUaZz.js → SkillCostValue-DNnKBu48.js} +1 -1
- package/dist/public/assets/{SkillForkDialog-DcanSYND.js → SkillForkDialog-t2ZNulFL.js} +1 -1
- package/dist/public/assets/{SkillInstallMenu-DHtst-Z3.js → SkillInstallMenu-DahqFJUv.js} +1 -1
- package/dist/public/assets/{SkillOriginInline-icYzVwfl.js → SkillOriginInline-DKy_SaSe.js} +1 -1
- package/dist/public/assets/{SkillPluginBundleDialog-fDl9XkF_.js → SkillPluginBundleDialog-cTIzGDgu.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-G5eWXOmA.js → SkillToolbarControls-CnGzFcPo.js} +1 -1
- package/dist/public/assets/{SkillsManagerSection-B0O776zf.js → SkillsManagerSection-DiiHZBGr.js} +1 -1
- package/dist/public/assets/{SlidesToolbarControls-CvurVze_.js → SlidesToolbarControls-B_Dhwngm.js} +1 -1
- package/dist/public/assets/{SourceEditor-CxYDmNie.js → SourceEditor-Cv8ZrrkC.js} +1 -1
- package/dist/public/assets/{SpellingSettings-Dd69GxTK.js → SpellingSettings-D6-fXq3W.js} +1 -1
- package/dist/public/assets/{SyncSection-CtZQEJlp.js → SyncSection-BspMrZD7.js} +1 -1
- package/dist/public/assets/{SyncStatusBadge-CL1pVLOe.js → SyncStatusBadge-Bx2KarKA.js} +1 -1
- package/dist/public/assets/{TemplateRow-DGghua5F.js → TemplateRow-XFA6UCGx.js} +1 -1
- package/dist/public/assets/{TerminalLaunchContext-yfig3-dd.js → TerminalLaunchContext-BAhOMkGh.js} +1 -1
- package/dist/public/assets/{TerminalPanel-LjBUjgpU.js → TerminalPanel-DtZKl5jl.js} +1 -1
- package/dist/public/assets/{TerminalSection-d7ViHElr.js → TerminalSection-DxNqZbKr.js} +1 -1
- package/dist/public/assets/{TerminalWindowApp-rjaPEqgx.js → TerminalWindowApp-DHk1oWfn.js} +1 -1
- package/dist/public/assets/{TextDocEditor-_lsofMyi.js → TextDocEditor-BoLk6UF6.js} +1 -1
- package/dist/public/assets/{ThemePluginSection-BvzKQgAy.js → ThemePluginSection-DlR5YwFJ.js} +2 -2
- package/dist/public/assets/{ThreadView-Dl2A2jYG.js → ThreadView-BvW_Y71B.js} +1 -1
- package/dist/public/assets/{TimelineDiffPane-A6vWborK.js → TimelineDiffPane-D3NayLjV.js} +1 -1
- package/dist/public/assets/{agent-connections-7HpNzYjL.js → agent-connections-A_hhtqiR.js} +1 -1
- package/dist/public/assets/{agent-registry-UV4Vx43J.js → agent-registry-C8nA2jGj.js} +1 -1
- package/dist/public/assets/{bridge-B2_zG6bo.js → bridge-D_Rj4MRC.js} +2 -2
- package/dist/public/assets/{catalog-C1Qnqxzu.js → catalog-DBWj7XRF.js} +1 -1
- package/dist/public/assets/{client-version-CSRUm7UD.js → client-version-Bc6-pPZH.js} +1 -1
- package/dist/public/assets/{comment-chips-DAb7AzqN.js → comment-chips-Cd4-qRSd.js} +5 -5
- package/dist/public/assets/{config-provider-BsVNDQRf.js → config-provider-DWypxu7o.js} +2 -2
- package/dist/public/assets/config-schema-D2jSQFMM.js +1 -0
- package/dist/public/assets/css-color-to-hex-CBqBwe8H.js +1 -0
- package/dist/public/assets/{doc-undo-manager-ezF_YLPp.js → doc-undo-manager-Dq7MEh0L.js} +1 -1
- package/dist/public/assets/field-controls--PQCqQDj.js +1 -0
- package/dist/public/assets/{field-controls-lpcOn5ho.js → field-controls-BLyaKOIe.js} +1 -1
- package/dist/public/assets/globals-BgIL5v2b.css +1 -0
- package/dist/public/assets/{ime-composition-CNKa_WNE.js → ime-composition-Ddcsd_YR.js} +1 -1
- package/dist/public/assets/{index-DQAlPp5D.js → index-CWC_qSFs.js} +8 -8
- package/dist/public/assets/{lint-config-client-B7GJyltx.js → lint-config-client-Z9sBKSEv.js} +1 -1
- package/dist/public/assets/{lint-plugins-aHWRIW7O.js → lint-plugins-DgSC9Hv9.js} +1 -1
- package/dist/public/assets/{markdown-lint-DYkBgJHq.js → markdown-lint-DFVEIaWA.js} +3 -3
- package/dist/public/assets/{markdownlint-rule-browser-DwBeBBtP.js → markdownlint-rule-browser-BtgtXrJR.js} +1 -1
- package/dist/public/assets/{pending-receive-nav-store-BkV2wFAV.js → pending-receive-nav-store-D3jGzX3B.js} +1 -1
- package/dist/public/assets/{preferred-session-events-BMONFEGJ.js → preferred-session-events-CTqivfdw.js} +1 -1
- package/dist/public/assets/{progress-CJ5xSWEU.js → progress-DXOKC1pm.js} +1 -1
- package/dist/public/assets/{saved-themes-client-BNonffrJ.js → saved-themes-client-kxsT1xkU.js} +1 -1
- package/dist/public/assets/{schema-section-BaTjzAhd.js → schema-section-vZpCCiqz.js} +1 -1
- package/dist/public/assets/schemas-api-GCpzPElr.js +112 -0
- package/dist/public/assets/{selection-context-DHrx8Vet.js → selection-context-BtD-1e1A.js} +1 -1
- package/dist/public/assets/{skills-api-D9_3ttAz.js → skills-api-CVU5BFea.js} +1 -1
- package/dist/public/assets/{src-BvSrrcu3.js → src-Cns8pcXR.js} +1 -1
- package/dist/public/assets/storage-scope-BlKX94ye.js +1 -0
- package/dist/public/assets/{tag-pill-input-DFLCUQhM.js → tag-pill-input-DvxgZAy7.js} +1 -1
- package/dist/public/assets/{telemetry-impl-BvGXK7Sb.js → telemetry-impl-CTRjXhrU.js} +1 -1
- package/dist/public/assets/{telemetry-startup-BUMMGL55.js → telemetry-startup-BGY04k1y.js} +1 -1
- package/dist/public/assets/{terminal-launch-events-CJnkcylC.js → terminal-launch-events-UxbfDwWi.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-COzCipml.js → typing-burst-detector-BCKiPmgE.js} +1 -1
- package/dist/public/assets/{uninstall-Cai55NwL.js → uninstall-CNTtZHbH.js} +1 -1
- package/dist/public/assets/{use-activity-panel-coLFk8EH.js → use-activity-panel-BCatF3V2.js} +1 -1
- package/dist/public/assets/{use-apply-config-color-theme-UYP8FtjI.js → use-apply-config-color-theme-BHhf55f_.js} +2 -2
- package/dist/public/assets/{use-conflicts-DBMds-hY.js → use-conflicts-Cjhz5bOW.js} +1 -1
- package/dist/public/assets/{use-live-xterm-theme-BEAKdQrK.js → use-live-xterm-theme-DG6GUzYC.js} +1 -1
- package/dist/public/assets/{use-open-skill-DyowdYuP.js → use-open-skill-CmjcCu7y.js} +1 -1
- package/dist/public/assets/{use-semantic-search-status-Dd4pXwms.js → use-semantic-search-status-DlI1OyTd.js} +1 -1
- package/dist/public/assets/{use-skill-origin-Aw9Y3_sH.js → use-skill-origin-BcCOnd8W.js} +1 -1
- package/dist/public/assets/{use-skill-targets--mN_luk9.js → use-skill-targets-6us5Gawv.js} +1 -1
- package/dist/public/assets/{use-skills-CHU2m8ND.js → use-skills-Bd0z2p-y.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-CJOb_gCQ.js → use-terminal-enabled-DnXMHuVl.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-OY1cdtje.js → use-timeline-entry-diff-i74pejmy.js} +1 -1
- package/dist/public/assets/{use-workspace-BTtr5NT8.js → use-workspace-CaZ8F0je.js} +1 -1
- package/dist/public/index.html +49 -49
- package/dist/public/uninstall.html +3 -3
- package/dist/{registry-probes-DJzPV21f.mjs → registry-probes-DqhiJA72.mjs} +1 -1
- package/dist/{removal-file-path-CBJw_2D_.mjs → removal-file-path-tM0-bc0E.mjs} +1 -1
- package/dist/{repair-launch-json-D6VmmqTF.mjs → repair-launch-json-NWK_VIUK.mjs} +1 -1
- package/dist/{repair-mcp-configs-UL3O5C7j.mjs → repair-mcp-configs-DoaRPP36.mjs} +1 -1
- package/dist/src-B-cOKkJj.mjs +1 -0
- package/dist/{src-BQpq6uPC.mjs → src-BYrd3rNT.mjs} +1 -1
- package/dist/start-B5mowFnR.mjs +1 -0
- package/dist/{start-DiS4vLnG.mjs → start-DNoQwNnQ.mjs} +3 -3
- package/package.json +4 -4
- package/dist/constants-CQAf3dMS.mjs +0 -1
- package/dist/init-Cl3xQKi3.mjs +0 -1
- package/dist/loader-DP7X3Yq9.mjs +0 -1
- package/dist/preview-oDjkIcX_.mjs +0 -1
- package/dist/public/assets/FeedbackForm-CYCpSclE.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-DodNLLCQ.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-vrALBlQV.js +0 -1
- package/dist/public/assets/config-schema-DVLRpubh.js +0 -1
- package/dist/public/assets/css-color-to-hex-CWNe6sew.js +0 -1
- package/dist/public/assets/field-controls-CijrX0Ja.js +0 -1
- package/dist/public/assets/globals-Bi6COlpi.css +0 -1
- package/dist/public/assets/schemas-api-CqmliOdH.js +0 -112
- package/dist/public/assets/storage-scope-BDcuM4d_.js +0 -1
- package/dist/src-0M3w5Pk6.mjs +0 -1
- package/dist/start-yrDQvgXW.mjs +0 -1
- /package/dist/public/assets/{globals-CgDmYm_R.js → globals-BTW-fzbN.js} +0 -0
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import{a as e,b as t,f as n,g as r,h as i,i as a,l as o,p as s,r as c,s as l,t as u,u as d,v as f,y as p}from"./schemas-CxFhJLAM.js";import{o as m}from"./constants-cc1-Bt4QPTUe.js";import"./share-D-LUU2aX-rZ2lBHef.js";import{c as h,d as g,f as _,i as v,l as y,s as b,u as x}from"./_envelope-DuFpUEag-Beu481Zb.js";import{t as S}from"./doc-extensions-CcO7K8uD-DG9uHV54.js";import{n as ee}from"./constants-github-B7yhDvQc.js";import{r as te}from"./logging-renderer-log-CqIZVUIQ.js";import{n as ne,t as re}from"./skill-targets-schema-DIfTaAkM.js";var ie=`frontmatter`,ae=[`text`,`number`,`boolean`,`date`,`list`,`object`];u(ae);var oe=p([f(),n(),e()]);function se(e){if(Array.isArray(e)){for(let[t,n]of e.entries()){let e=se(n);if(e!==null)return[t,...e]}return null}if(typeof e==`object`&&e){if(Object.hasOwn(e,`__proto__`))return[`__proto__`];for(let[t,n]of Object.entries(e)){let e=se(n);if(e!==null)return[t,...e]}}return null}function ce(e){return typeof e==`object`&&e&&Object.hasOwn(e,`__proto__`)?[`__proto__`]:null}function le(e,t){return i((e,n)=>{let r=t(e);return r!==null&&n.addIssue({code:`custom`,path:r,message:`Unsupported frontmatter key: __proto__`}),e},r(f(),e)).nonoptional()}function ue(e){return le(e,se)}function de(e){return le(e,ce)}var fe=o(()=>p([oe.transform(e=>String(e)),de(C),a(fe)])),C=o(()=>p([f(),n(),e(),a(fe),de(C)])),pe=/^\d{4}-\d{2}-\d{2}$/;function me(e){return typeof e==`string`&&pe.test(e)}function he(e){return Array.isArray(e)?`list`:typeof e==`object`&&e?`object`:typeof e==`boolean`?`boolean`:typeof e==`number`?`number`:me(e)?`date`:`text`}function ge(e){if(Array.isArray(e)){let t=[];for(let n of e)n!==null&&t.push(ge(n));return t}if(typeof e==`object`&&e){let t={};for(let[n,r]of Object.entries(e))t[n]=r===null?``:ge(r);return t}return e}var _e=i(ge,r(f(),C)),ve=ue(p([C,c()]));function ye(e){return!!(e===null||typeof e==`string`&&e===``||Array.isArray(e)&&e.length===0)}function be(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!be(e[n],t[n]))return!1;return!0}if(e!==null&&t!==null&&typeof e==`object`&&typeof t==`object`&&!Array.isArray(e)&&!Array.isArray(t)){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.hasOwn(t,r)||!be(e[r],t[r]))return!1;return!0}return!1}var w={outcome:f().optional(),saved:e().optional(),nextStep:f().optional()};s({docName:g,summary:_,content:b.optional(),...h}).loose(),s({docName:g,summary:_,markdown:b,position:u([`append`,`prepend`,`replace`]).optional(),extension:u(S).optional(),...h}).loose(),s({docName:g,summary:_,find:f().min(1),replace:b,offset:n().int().nonnegative().optional(),...h}).loose(),s({docName:g,connectionId:f().min(1),scope:u([`last`,`session`,`file`,`count`]).optional(),count:n().int().positive().optional(),...h}).loose().refine(e=>e.scope!==`count`||e.count!==void 0,{message:`count is required when scope is 'count'`,path:[`count`]});var xe=s({value:f(),truncatedFrom:n().int().nonnegative().optional(),hint:f().optional()}).loose(),Se=l(`kind`,[s({kind:d(`inline`),content:f()}),s({kind:d(`truncated`),byteLength:n().int().nonnegative(),hint:f()})]),Ce=s({kind:d(`content-divergence`),intendedBytes:n().int().nonnegative(),actualBytes:n().int().nonnegative(),byteDelta:n().int(),divergenceType:f().optional(),currentState:Se.optional(),hint:f().optional()}).loose(),we=s({type:d(`orphan`),parentCandidates:a(f()),message:f()}).loose(),Te=s({kind:d(`disk-edit-reconciled`),intendedBytes:n().int().nonnegative(),actualBytes:n().int().nonnegative(),byteDelta:n().int(),mergeOutcome:f().optional(),duplicatedBlocks:n().int().nonnegative().optional(),restoredDeletedHere:n().int().nonnegative().optional(),restoredDeletedOutside:n().int().nonnegative().optional(),nextStep:f().optional().meta({deprecated:!0}),hint:f().optional()}).loose();l(`kind`,[Ce,Te]);var Ee=s({kind:d(`mermaid-parse-error`),fenceIndex:n().int().positive(),fenceFirstLine:f(),message:f(),line:n().int().positive().optional()}).loose(),De=s({href:f(),targetKind:f(),role:f(),sourceForm:f(),resolvedTarget:f().nullable(),reason:f(),resolutionMethod:f(),fallbackTarget:f().nullable().optional(),definition:s({line:n().int().nonnegative(),label:f()}).loose().optional()}).loose(),Oe=a(l(`kind`,[Ce,Te,Ee,s({kind:d(`lint-violation`),source:f(),code:f(),message:f(),severity:u([`error`,`warning`,`info`,`hint`]),line:n().int().positive(),column:n().int().positive(),linkTarget:f().optional(),localTarget:De.optional()}).loose(),s({kind:d(`link-check-deferred`),message:f()}).loose()])).min(1),ke=a(s({href:f(),resolvedTo:f().nullable(),reason:u([`no-such-doc`,`no-such-file`,`unresolvable`,`excluded`]),localTarget:De.optional()}).loose()),Ae=s({reason:f().min(1),count:n().int().positive()}).loose();s({...w,timestamp:f().min(1),summary:xe.optional(),warnings:Oe.optional()}).loose(),s({...w,timestamp:f().min(1),subscriberCount:n().int().nonnegative(),systemSubscriberCount:n().int().nonnegative(),hints:a(we).optional(),summary:xe.optional(),warnings:Oe.optional(),brokenLinks:ke,brokenLinkSuppression:Ae.optional()}).loose(),s({...w,timestamp:f().min(1),subscriberCount:n().int().nonnegative(),systemSubscriberCount:n().int().nonnegative(),summary:xe.optional(),warnings:Oe.optional(),brokenLinks:ke,brokenLinkSuppression:Ae.optional()}).loose(),s({...w,docName:f().min(1),scope:u([`last`,`session`,`count`]),undone:e()}).loose(),s({docs:a(s({docName:x,markdown:b,position:u([`append`,`prepend`,`replace`]).optional(),extension:u(S).optional(),summary:_}).loose()).min(1).max(100),...h}).loose();var je=s({type:v,title:f(),detail:f().optional()}).loose(),Me=l(`status`,[s({status:d(`written`),docName:f().min(1),...w,summary:xe.optional(),warnings:Oe.optional(),brokenLinks:ke,brokenLinkSuppression:Ae.optional()}).loose(),s({status:d(`error`),docName:f().min(1),...w,error:je}).loose()]);s({timestamp:f().min(1),results:a(Me),written:n().int().nonnegative(),failed:n().int().nonnegative()}).loose(),s({docName:g,patch:ve,types:r(f(),u(ae)).optional(),summary:_,...h}).loose(),s({...w,timestamp:f().min(1),subscriberCount:n().int().nonnegative(),systemSubscriberCount:n().int().nonnegative(),appliedKeys:a(f()),summary:xe.optional(),warnings:Oe.optional(),brokenLinks:ke,brokenLinkSuppression:Ae.optional()}).loose();var Ne=[`config-entry`,`managed-file`,`skill-bundle-copy`,`central-store-copy`,`session-injection`],Pe=u(Ne),Fe=Ne.filter(e=>e!==`session-injection`),Ie=[`satisfied`,`present-consent-unknown`,`absent`,`foreign`,`foreign-replaceable`,`drifted`,`excluded`,`structural-na`,`undetected`,`unprobeable`,`unprobed`];p([u(Ie),f()]);function Le(e){return Ie.includes(e)}var Re=[`reclaim-permissive`,`pre-approval-exact`,`injection-functional`],ze=u(Re),Be=u([`none`,`approve-once`,`enable-manually`,`trust-gated`]),Ve=[`enable-manually`],He=[`written`,`overwritten`,`skipped-unsupported`,`skipped-prerequisite`,`declined`,`failed`,`removed`,`excluded`,`unchanged`,`handed-off`,`skipped-foreign`,`skipped-missing`,`no-op`];u(He),u([`info`,`warning`,`error`]);var Ue=u([`required`,`recommended`]),We=Symbol.for(`yaml.alias`),Ge=Symbol.for(`yaml.document`),T=Symbol.for(`yaml.map`),Ke=Symbol.for(`yaml.pair`),E=Symbol.for(`yaml.scalar`),qe=Symbol.for(`yaml.seq`),D=Symbol.for(`yaml.node.type`),Je=e=>!!e&&typeof e==`object`&&e[D]===We,Ye=e=>!!e&&typeof e==`object`&&e[D]===Ge,O=e=>!!e&&typeof e==`object`&&e[D]===T,k=e=>!!e&&typeof e==`object`&&e[D]===Ke,A=e=>!!e&&typeof e==`object`&&e[D]===E,Xe=e=>!!e&&typeof e==`object`&&e[D]===qe;function j(e){if(e&&typeof e==`object`)switch(e[D]){case T:case qe:return!0}return!1}function M(e){if(e&&typeof e==`object`)switch(e[D]){case We:case T:case E:case qe:return!0}return!1}var Ze=e=>(A(e)||j(e))&&!!e.anchor,N=Symbol(`break visit`),Qe=Symbol(`skip children`),P=Symbol(`remove node`);function $e(e,t){let n=rt(t);Ye(e)?et(null,e.contents,n,Object.freeze([e]))===P&&(e.contents=null):et(null,e,n,Object.freeze([]))}$e.BREAK=N,$e.SKIP=Qe,$e.REMOVE=P;function et(e,t,n,r){let i=it(e,t,n,r);if(M(i)||k(i))return at(e,r,i),et(e,i,n,r);if(typeof i!=`symbol`){if(j(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=et(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===N)return N;else i===P&&(t.items.splice(e,1),--e)}}else if(k(t)){r=Object.freeze(r.concat(t));let e=et(`key`,t.key,n,r);if(e===N)return N;e===P&&(t.key=null);let i=et(`value`,t.value,n,r);if(i===N)return N;i===P&&(t.value=null)}}return i}async function tt(e,t){let n=rt(t);Ye(e)?await nt(null,e.contents,n,Object.freeze([e]))===P&&(e.contents=null):await nt(null,e,n,Object.freeze([]))}tt.BREAK=N,tt.SKIP=Qe,tt.REMOVE=P;async function nt(e,t,n,r){let i=await it(e,t,n,r);if(M(i)||k(i))return at(e,r,i),nt(e,i,n,r);if(typeof i!=`symbol`){if(j(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=await nt(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===N)return N;else i===P&&(t.items.splice(e,1),--e)}}else if(k(t)){r=Object.freeze(r.concat(t));let e=await nt(`key`,t.key,n,r);if(e===N)return N;e===P&&(t.key=null);let i=await nt(`value`,t.value,n,r);if(i===N)return N;i===P&&(t.value=null)}}return i}function rt(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 it(e,t,n,r){if(typeof n==`function`)return n(e,t,r);if(O(t))return n.Map?.(e,t,r);if(Xe(t))return n.Seq?.(e,t,r);if(k(t))return n.Pair?.(e,t,r);if(A(t))return n.Scalar?.(e,t,r);if(Je(t))return n.Alias?.(e,t,r)}function at(e,t,n){let r=t[t.length-1];if(j(r))r.items[e]=n;else if(k(r))e===`key`?r.key=n:r.value=n;else if(Ye(r))r.contents=n;else{let e=Je(r)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}var ot={"!":`%21`,",":`%2C`,"[":`%5B`,"]":`%5D`,"{":`%7B`,"}":`%7D`},st=e=>e.replace(/[!,[\]{}]/g,e=>ot[e]),ct=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+st(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&&M(e.contents)){let t={};$e(e.contents,(e,n)=>{M(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(`
|
|
2
|
+
`)}};ct.defaultYaml={explicit:!1,version:`1.2`},ct.defaultTags={"!!":`tag:yaml.org,2002:`};function lt(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 ut(e){let t=new Set;return $e(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function dt(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function ft(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=ut(e);let a=dt(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(A(t.node)||j(t.node)))t.node.anchor=t.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:r}}function pt(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=pt(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=pt(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=pt(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=pt(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}return e.call(t,n,r)}function F(e,t,n){if(Array.isArray(e))return e.map((e,t)=>F(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!Ze(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 mt=class{constructor(e){Object.defineProperty(this,D,{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(!Ye(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=F(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?pt(i,{"":o},``,o):o}},ht=class extends mt{constructor(e){super(We),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=[],$e(e,{Node:(e,t)=>{(Je(t)||Ze(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||=(F(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=gt(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(lt(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 gt(e,t,n){if(Je(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(j(t)){let r=0;for(let i of t.items){let t=gt(e,i,n);t>r&&(r=t)}return r}else if(k(t)){let r=gt(e,t.key,n),i=gt(e,t.value,n);return Math.max(r,i)}return 1}var _t=e=>!e||typeof e!=`function`&&typeof e!=`object`,I=class extends mt{constructor(e){super(E),this.value=e}toJSON(e,t){return t?.keep?this.value:F(this.value,e,t)}toString(){return String(this.value)}};I.BLOCK_FOLDED=`BLOCK_FOLDED`,I.BLOCK_LITERAL=`BLOCK_LITERAL`,I.PLAIN=`PLAIN`,I.QUOTE_DOUBLE=`QUOTE_DOUBLE`,I.QUOTE_SINGLE=`QUOTE_SINGLE`;var vt=`tag:yaml.org,2002:`;function yt(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 bt(e,t,n){if(Ye(e)&&(e=e.contents),M(e))return e;if(k(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 ht(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=vt+t.slice(2));let l=yt(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new I(e);return c&&(c.node=t),t}l=e instanceof Map?o[T]:Symbol.iterator in Object(e)?o[qe]: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 I(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}function xt(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 bt(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}var St=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done,Ct=class extends mt{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=>M(t)||k(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(St(e))this.add(t);else{let[n,...r]=e,i=this.get(n,!0);if(j(i))i.addIn(r,t);else if(i===void 0&&this.schema)this.set(n,xt(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(j(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&&A(i)?i.value:i:j(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!k(t))return!1;let n=t.value;return n==null||e&&A(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 j(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(j(e))e.setIn(r,t);else if(e===void 0&&this.schema)this.set(n,xt(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}},wt=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function L(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var R=(e,t,n)=>e.endsWith(`
|
|
3
|
+
`)?L(n,t):n.includes(`
|
|
4
|
+
`)?`
|
|
5
|
+
`+L(n,t):(e.endsWith(` `)?``:` `)+n,Tt=`flow`,Et=`block`,Dt=`quoted`;function Ot(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=kt(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===`
|
|
6
|
+
`)n===`block`&&(h=kt(e,h,t.length)),d=h+t.length+c,f=void 0;else{if(r===` `&&p&&p!==` `&&p!==`
|
|
7
|
+
`&&p!==` `){let t=e[h+1];t&&t!==` `&&t!==`
|
|
8
|
+
`&&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 kt(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!==`
|
|
9
|
+
`);r=t,i=t+1,a=e[i]}return r}var At=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),jt=e=>/^(%|---|\.\.\.)/m.test(e);function Mt(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]===`
|
|
10
|
+
`){if(t-n>r)return!0;if(n=t+1,i-n<=r)return!1}return!0}function Nt(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(jt(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)+`
|
|
11
|
+
|
|
12
|
+
`;n[e+2]===`\\`&&n[e+3]===`n`&&n[e+4]!==`"`;)o+=`
|
|
13
|
+
`,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:Ot(o,a,Dt,At(t,!1))}function Pt(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
14
|
+
`)||/[ \t]\n|\n[ \t]/.test(e))return Nt(e,t);let n=t.indent||(jt(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:Ot(r,n,Tt,At(t,!1))}function Ft(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=Nt;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?Pt:i&&!t?Nt:n?Pt:Nt}return r(e,t)}var It;try{It=RegExp(`(^|(?<!
|
|
15
|
+
))
|
|
16
|
+
+(?!
|
|
17
|
+
|$)`,`g`)}catch{It=/\n+(?!\n|$)/g}function Lt({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 Ft(n,r);let l=r.indent||(r.forceBlockIndent||jt(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===I.BLOCK_FOLDED?!1:t===I.BLOCK_LITERAL?!0:!Mt(n,c,l.length);if(!n)return u?`|
|
|
18
|
+
`:`>
|
|
19
|
+
`;let d,f;for(f=n.length;f>0;--f){let e=n[f-1];if(e!==`
|
|
20
|
+
`&&e!==` `&&e!==` `)break}let p=n.substring(f),m=p.indexOf(`
|
|
21
|
+
`);m===-1?d=`-`:n===p||m!==p.length-1?(d=`+`,a&&a()):d=``,p&&=(n=n.slice(0,-p.length),p[p.length-1]===`
|
|
22
|
+
`&&(p=p.slice(0,-1)),p.replace(It,`$&${l}`));let h=!1,g,_=-1;for(g=0;g<n.length;++g){let e=n[g];if(e===` `)h=!0;else if(e===`
|
|
23
|
+
`)_=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,`
|
|
24
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\n+/g,`$&${l}`),i=!1,a=At(r,!0);o!==`folded`&&t!==I.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=Ot(`${v}${e}${p}`,l,Et,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function Rt(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(`
|
|
25
|
+
`)||u&&/[[\]{},]/.test(a))return Ft(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
|
|
26
|
+
`)?Ft(a,t):Lt(e,t,n,r);if(!s&&!u&&i!==I.PLAIN&&a.includes(`
|
|
27
|
+
`))return Lt(e,t,n,r);if(jt(a)){if(c===``)return t.forceBlockIndent=!0,Lt(e,t,n,r);if(s&&c===l)return Ft(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 Ft(a,t)}return s?d:Ot(d,c,Tt,At(t,!1))}function zt(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!==I.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=I.QUOTE_DOUBLE);let c=e=>{switch(e){case I.BLOCK_FOLDED:case I.BLOCK_LITERAL:return i||a?Ft(o.value,t):Lt(o,t,n,r);case I.QUOTE_DOUBLE:return Nt(o.value,t);case I.QUOTE_SINGLE:return Pt(o.value,t);case I.PLAIN:return Rt(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 Bt(e,t){let n=Object.assign({blockQuote:!0,commentString:wt,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 Vt(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(A(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 Ht(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(A(e)||j(e))&&e.anchor;a&<(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 Ut(e,t,n,r){if(k(e))return e.toString(t,n,r);if(Je(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=M(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=Vt(t.doc.schema.tags,a);let o=Ht(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):A(a)?zt(a,t,n,r):a.toString(t,n,r);return o?A(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function Wt({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=M(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(j(e)||!M(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||j(e)||(A(e)?e.type===I.BLOCK_FOLDED||e.type===I.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=Ut(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;M(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&&A(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&Xe(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=Ut(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?`
|
|
28
|
+
`:``,v){let e=l(v);S+=`\n${L(e,n.indent)}`}x===``&&!n.inFlow?S===`
|
|
29
|
+
`&&y&&(S=`
|
|
30
|
+
|
|
31
|
+
`):S+=`\n${n.indent}`}else if(!p&&j(t)){let e=x[0],r=x.indexOf(`
|
|
32
|
+
`),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]===`
|
|
33
|
+
`)&&(S=``);return g+=S+x,n.inFlow?b&&r&&r():y&&!b?g+=R(g,n.indent,l(y)):h&&i&&i(),g}function Gt(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var Kt=`<<`,z={identify:e=>e===Kt||typeof e==`symbol`&&e.description===Kt,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new I(Symbol(Kt)),{addToJSMap:Jt}),stringify:()=>Kt},qt=(e,t)=>(z.identify(t)||A(t)&&(!t.type||t.type===I.PLAIN)&&z.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===z.tag&&e.default);function Jt(e,t,n){let r=Xt(e,n);if(Xe(r))for(let n of r.items)Yt(e,t,n);else if(Array.isArray(r))for(let n of r)Yt(e,t,n);else Yt(e,t,r)}function Yt(e,t,n){let r=Xt(e,n);if(!O(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 Xt(e,t){return e&&Je(t)?t.resolve(e.doc,e):t}function Zt(e,t,{key:n,value:r}){if(M(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(qt(e,n))Jt(e,t,r);else{let i=F(n,``,e);if(t instanceof Map)t.set(i,F(r,i,e));else if(t instanceof Set)t.add(i);else{let a=Qt(n,i,e),o=F(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function Qt(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(M(e)&&n?.doc){let t=Bt(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)+`..."`),Gt(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 $t(e,t,n){return new B(bt(e,void 0,n),bt(t,void 0,n))}var B=class e{constructor(e,t=null){Object.defineProperty(this,D,{value:Ke}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return M(n)&&(n=n.clone(t)),M(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return Zt(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?Wt(this,e,t,n):JSON.stringify(this)}};function en(e,t,n){return(t.inFlow??e.flow?nn:tn)(e,t,n)}function tn({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(M(i))!d&&i.spaceBefore&&f.push(``),rn(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(k(i)){let e=M(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),rn(n,f,e.commentBefore,d))}d=!1;let s=Ut(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}`:`
|
|
34
|
+
`}}return e?(p+=`
|
|
35
|
+
`+L(l(e),c),s&&s()):d&&o&&o(),p}function nn({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(M(i))i.spaceBefore&&d.push(``),rn(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(k(i)){let e=M(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),rn(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=M(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=Ut(i,c,()=>a=null);l||=d.length>u||o.includes(`
|
|
36
|
+
`),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}`:`
|
|
37
|
+
`;return`${e}\n${i}${p}`}else return`${f}${o}${d.join(` `)}${o}${p}`}function rn({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=L(t(r),e);n.push(i.trimStart())}}function an(e,t){let n=A(t)?t.value:t;for(let r of e)if(k(r)&&(r.key===t||r.key===n||A(r.key)&&r.key.value===n))return r}var V=class extends Ct{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($t(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=k(e)?e:!e||typeof e!=`object`||!(`key`in e)?new B(e,e?.value):new B(e.key,e.value);let r=an(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);A(r.value)&&_t(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=an(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=an(this.items,e)?.value;return(!t&&A(n)?n.value:n)??void 0}has(e){return!!an(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)Zt(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!k(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})),en(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},on={collection:`map`,default:!0,nodeClass:V,tag:`tag:yaml.org,2002:map`,resolve(e,t){return O(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>V.from(e,t,n)},sn=class extends Ct{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(qe,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=cn(e);return typeof t==`number`?this.items.splice(t,1).length>0:!1}get(e,t){let n=cn(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&A(r)?r.value:r}has(e){let t=cn(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=cn(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];A(r)&&_t(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(F(e,String(r++),t));return n}toString(e,t,n){return e?en(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(bt(a,void 0,n))}}return i}};function cn(e){let t=A(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var ln={collection:`seq`,default:!0,nodeClass:sn,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return Xe(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>sn.from(e,t,n)},un={identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),zt(e,t,n,r)}},dn={identify:e=>e==null,createNode:()=>new I(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new I(null),stringify:({source:e},t)=>typeof e==`string`&&dn.test.test(e)?e:t.options.nullStr},fn={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new I(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},n){return e&&fn.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?n.options.trueStr:n.options.falseStr}};function H({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r==`bigint`)return String(r);let i=typeof r==`number`?r:Number(r);if(!isFinite(i))return isNaN(i)?`.nan`:i<0?`-.inf`:`.inf`;let a=Object.is(r,-0)?`-0`:JSON.stringify(r);if(!e&&t&&(!n||n===`tag:yaml.org,2002:float`)&&/^-?\d/.test(a)&&!a.includes(`e`)){let e=a.indexOf(`.`);e<0&&(e=a.length,a+=`.`);let n=t-(a.length-e-1);for(;n-- >0;)a+=`0`}return a}var pn={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:H},mn={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():H(e)}},hn={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let t=new I(parseFloat(e)),n=e.indexOf(`.`);return n!==-1&&e[e.length-1]===`0`&&(t.minFractionDigits=e.length-n-1),t},stringify:H},gn=e=>typeof e==`bigint`||Number.isInteger(e),_n=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function vn(e,t,n){let{value:r}=e;return gn(r)&&r>=0?n+r.toString(t):H(e)}var yn={identify:e=>gn(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^0o[0-7]+$/,resolve:(e,t,n)=>_n(e,2,8,n),stringify:e=>vn(e,8,`0o`)},bn={identify:gn,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>_n(e,0,10,n),stringify:H},xn={identify:e=>gn(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>_n(e,2,16,n),stringify:e=>vn(e,16,`0x`)},Sn=[on,ln,un,dn,fn,yn,bn,xn,pn,mn,hn];function Cn(e){return typeof e==`bigint`||Number.isInteger(e)}var wn=({value:e})=>JSON.stringify(e),Tn=[{identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify:wn},{identify:e=>e==null,createNode:()=>new I(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^null$/,resolve:()=>null,stringify:wn},{identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^true$|^false$/,resolve:e=>e===`true`,stringify:wn},{identify:Cn,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})=>Cn(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:wn}],En=[on,ln].concat(Tn,{default:!0,tag:``,test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}}),Dn={identify:e=>e instanceof Uint8Array,default:!1,tag:`tag:yaml.org,2002:binary`,resolve(e,t){if(typeof atob==`function`){let t=atob(e.replace(/[\n\r]/g,``)),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}else return t(`This environment does not support reading binary tags; either Buffer or atob is required`),e},stringify({comment:e,type:t,value:n},r,i,a){if(!n)return``;let o=n,s;if(typeof btoa==`function`){let e=``;for(let t=0;t<o.length;++t)e+=String.fromCharCode(o[t]);s=btoa(e)}else throw Error(`This environment does not support writing binary tags; either Buffer or btoa is required`);if(t??=I.BLOCK_LITERAL,t!==I.QUOTE_DOUBLE){let e=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),n=Math.ceil(s.length/e),i=Array(n);for(let t=0,r=0;t<n;++t,r+=e)i[t]=s.substr(r,e);s=i.join(t===I.BLOCK_LITERAL?`
|
|
38
|
+
`:` `)}return zt({comment:e,type:t,value:s},r,i,a)}};function On(e,t){if(Xe(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!k(r)){if(O(r)){r.items.length>1&&t(`Each pair must have its own sequence indicator`);let e=r.items[0]||new B(new I(null));if(r.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${r.commentBefore}\n${e.key.commentBefore}`:r.commentBefore),r.comment){let t=e.value??e.key;t.comment=t.comment?`${r.comment}\n${t.comment}`:r.comment}r=e}e.items[n]=k(r)?r:new B(r)}}else t(`Expected a sequence for this tag`);return e}function kn(e,t,n){let{replacer:r}=n,i=new sn(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($t(o,s,n))}return i}var An={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:On,createNode:kn},jn=class e extends sn{constructor(){super(),this.add=V.prototype.add.bind(this),this.delete=V.prototype.delete.bind(this),this.get=V.prototype.get.bind(this),this.has=V.prototype.has.bind(this),this.set=V.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(k(e)?(r=F(e.key,``,t),i=F(e.value,r,t)):r=F(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=kn(e,t,n),i=new this;return i.items=r.items,i}};jn.tag=`tag:yaml.org,2002:omap`;var Mn={collection:`seq`,identify:e=>e instanceof Map,nodeClass:jn,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,t){let n=On(e,t),r=[];for(let{key:e}of n.items)A(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new jn,n)},createNode:(e,t,n)=>jn.from(e,t,n)};function Nn({value:e,source:t},n){return t&&(e?Pn:Fn).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var Pn={identify:e=>e===!0,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new I(!0),stringify:Nn},Fn={identify:e=>e===!1,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new I(!1),stringify:Nn},In={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:H},Ln={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,``)),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():H(e)}},Rn={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new I(parseFloat(e.replace(/_/g,``))),n=e.indexOf(`.`);if(n!==-1){let r=e.substring(n+1).replace(/_/g,``);r[r.length-1]===`0`&&(t.minFractionDigits=r.length)}return t},stringify:H},zn=e=>typeof e==`bigint`||Number.isInteger(e);function Bn(e,t,n,{intAsBigInt:r}){let i=e[0];if((i===`-`||i===`+`)&&(t+=1),e=e.substring(t).replace(/_/g,``),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}let t=BigInt(e);return i===`-`?BigInt(-1)*t:t}let a=parseInt(e,n);return i===`-`?-1*a:a}function Vn(e,t,n){let{value:r}=e;if(zn(r)){let e=r.toString(t);return r<0?`-`+n+e.substr(1):n+e}return H(e)}var Hn={identify:zn,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Bn(e,2,2,n),stringify:e=>Vn(e,2,`0b`)},Un={identify:zn,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Bn(e,1,8,n),stringify:e=>Vn(e,8,`0`)},Wn={identify:zn,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Bn(e,0,10,n),stringify:H},Gn={identify:zn,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Bn(e,2,16,n),stringify:e=>Vn(e,16,`0x`)},Kn=class e extends V{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=k(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new B(e.key,null):new B(e,null),an(this.items,t.key)||this.items.push(t)}get(e,t){let n=an(this.items,e);return!t&&k(n)?A(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=an(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($t(e,null,n));return i}};Kn.tag=`tag:yaml.org,2002:set`;var qn={collection:`map`,identify:e=>e instanceof Set,nodeClass:Kn,default:!1,tag:`tag:yaml.org,2002:set`,createNode:(e,t,n)=>Kn.from(e,t,n),resolve(e,t){if(O(e)){if(e.hasAllNullValues(!0))return Object.assign(new Kn,e);t(`Set items must all have null values`)}else t(`Expected a mapping for this tag`);return e}};function Jn(e,t){let n=e[0],r=n===`-`||n===`+`?e.substring(1):e,i=e=>t?BigInt(e):Number(e),a=r.replace(/_/g,``).split(`:`).reduce((e,t)=>e*i(60)+i(t),i(0));return n===`-`?i(-1)*a:a}function Yn(e){let{value:t}=e,n=e=>e;if(typeof t==`bigint`)n=e=>BigInt(e);else if(isNaN(t)||!isFinite(t))return H(e);let r=``;t<0&&(r=`-`,t*=n(-1));let i=n(60),a=[t%i];return t<60?a.unshift(0):(t=(t-a[0])/i,a.unshift(t%i),t>=60&&(t=(t-a[0])/i,a.unshift(t))),r+a.map(e=>String(e).padStart(2,`0`)).join(`:`).replace(/000000\d*$/,``)}var Xn={identify:e=>typeof e==`bigint`||Number.isInteger(e),default:!0,tag:`tag:yaml.org,2002:int`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>Jn(e,n),stringify:Yn},Zn={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>Jn(e,!1),stringify:Yn},Qn={identify:e=>e instanceof Date,default:!0,tag:`tag:yaml.org,2002:timestamp`,test:RegExp(`^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$`),resolve(e){let t=e.match(Qn.test);if(!t)throw Error(`!!timestamp expects a date, starting with yyyy-mm-dd`);let[,n,r,i,a,o,s]=t.map(Number),c=t[7]?Number((t[7]+`00`).substr(1,3)):0,l=Date.UTC(n,r-1,i,a||0,o||0,s||0,c),u=t[8];if(u&&u!==`Z`){let e=Jn(u,!1);Math.abs(e)<30&&(e*=60),l-=6e4*e}return new Date(l)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,``)??``},$n=[on,ln,un,dn,Pn,Fn,Hn,Un,Wn,Gn,In,Ln,Rn,Dn,z,Mn,An,qn,Xn,Zn,Qn],er=new Map([[`core`,Sn],[`failsafe`,[on,ln,un]],[`json`,En],[`yaml11`,$n],[`yaml-1.1`,$n]]),tr={binary:Dn,bool:fn,float:hn,floatExp:mn,floatNaN:pn,floatTime:Zn,int:bn,intHex:xn,intOct:yn,intTime:Xn,map:on,merge:z,null:dn,omap:Mn,pairs:An,seq:ln,set:qn,timestamp:Qn},nr={"tag:yaml.org,2002:binary":Dn,"tag:yaml.org,2002:merge":z,"tag:yaml.org,2002:omap":Mn,"tag:yaml.org,2002:pairs":An,"tag:yaml.org,2002:set":qn,"tag:yaml.org,2002:timestamp":Qn};function rr(e,t,n){let r=er.get(t);if(r&&!e)return n&&!r.includes(z)?r.concat(z):r.slice();let i=r;if(!i)if(Array.isArray(e))i=[];else{let e=Array.from(er.keys()).filter(e=>e!==`yaml11`).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}if(Array.isArray(e))for(let t of e)i=i.concat(t);else typeof e==`function`&&(i=e(i.slice()));return n&&(i=i.concat(z)),i.reduce((e,t)=>{let n=typeof t==`string`?tr[t]:t;if(!n){let e=JSON.stringify(t),n=Object.keys(tr).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown custom tag ${e}; use one of ${n}`)}return e.includes(n)||e.push(n),e},[])}var ir=(e,t)=>e.key<t.key?-1:+(e.key>t.key),ar=class e{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:r,schema:i,sortMapEntries:a,toStringDefaults:o}){this.compat=Array.isArray(e)?rr(e,`compat`):e?rr(null,e):null,this.name=typeof i==`string`&&i||`core`,this.knownTags=r?nr:{},this.tags=rr(t,this.name,n),this.toStringOptions=o??null,Object.defineProperty(this,T,{value:on}),Object.defineProperty(this,E,{value:un}),Object.defineProperty(this,qe,{value:ln}),this.sortMapEntries=typeof a==`function`?a:a===!0?ir:null}clone(){let t=Object.create(e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};function or(e,t){let n=[],r=t.directives===!0;if(t.directives!==!1&&e.directives){let t=e.directives.toString(e);t?(n.push(t),r=!0):e.directives.docStart&&(r=!0)}r&&n.push(`---`);let i=Bt(e,t),{commentString:a}=i.options;if(e.commentBefore){n.length!==1&&n.unshift(``);let t=a(e.commentBefore);n.unshift(L(t,``))}let o=!1,s=null;if(e.contents){if(M(e.contents)){if(e.contents.spaceBefore&&r&&n.push(``),e.contents.commentBefore){let t=a(e.contents.commentBefore);n.push(L(t,``))}i.forceBlockIndent=!!e.comment,s=e.contents.comment}let t=s?void 0:()=>o=!0,c=Ut(e.contents,i,()=>s=null,t);s&&(c+=R(c,``,a(s))),(c[0]===`|`||c[0]===`>`)&&n[n.length-1]===`---`?n[n.length-1]=`--- ${c}`:n.push(c)}else n.push(Ut(e.contents,i));if(e.directives?.docEnd)if(e.comment){let t=a(e.comment);t.includes(`
|
|
39
|
+
`)?(n.push(`...`),n.push(L(t,``))):n.push(`... ${t}`)}else n.push(`...`);else{let t=e.comment;t&&o&&(t=t.replace(/^\n+/,``)),t&&((!o||s)&&n[n.length-1]!==``&&n.push(``),n.push(L(a(t),``)))}return n.join(`
|
|
40
|
+
`)+`
|
|
41
|
+
`}var sr=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,D,{value:Ge});let r=null;typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t,t=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:`warn`,prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:`1.2`},n);this.options=i;let{version:a}=i;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new ct({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[D]:{value:Ge}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=M(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){cr(this.contents)&&this.contents.add(e)}addIn(e,t){cr(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=ut(this);e.anchor=!t||n.has(t)?dt(t||`a`,n):t}return new ht(e.anchor)}createNode(e,t,n){let r;if(typeof t==`function`)e=t.call({"":e},``,e),r=t;else if(Array.isArray(t)){let e=t.filter(e=>typeof e==`number`||e instanceof String||e instanceof Number).map(String);e.length>0&&(t=t.concat(e)),r=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:i,anchorPrefix:a,flow:o,keepUndefined:s,onTagObj:c,tag:l}=n??{},{onAnchor:u,setAnchors:d,sourceObjects:f}=ft(this,a||`a`),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=bt(e,l,p);return o&&j(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new B(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return cr(this.contents)?this.contents.delete(e):!1}deleteIn(e){return St(e)?this.contents==null?!1:(this.contents=null,!0):cr(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return j(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return St(e)?!t&&A(this.contents)?this.contents.value:this.contents:j(this.contents)?this.contents.getIn(e,t):void 0}has(e){return j(this.contents)?this.contents.has(e):!1}hasIn(e){return St(e)?this.contents!==void 0:j(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=xt(this.schema,[e],t):cr(this.contents)&&this.contents.set(e,t)}setIn(e,t){St(e)?this.contents=t:this.contents==null?this.contents=xt(this.schema,Array.from(e),t):cr(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e==`number`&&(e=String(e));let n;switch(e){case`1.1`:this.directives?this.directives.yaml.version=`1.1`:this.directives=new ct({version:`1.1`}),n={resolveKnownTags:!1,schema:`yaml-1.1`};break;case`1.2`:case`next`:this.directives?this.directives.yaml.version=e:this.directives=new ct({version:e}),n={resolveKnownTags:!0,schema:`core`};break;case null:this.directives&&delete this.directives,n=null;break;default:{let t=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new ar(Object.assign(n,t));else throw Error(`With a null YAML version, the { schema: Schema } option is required`)}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:a}={}){let o={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r==`number`?r:100},s=F(this.contents,t??``,o);if(typeof i==`function`)for(let{count:e,res:t}of o.anchors.values())i(t,e);return typeof a==`function`?pt(a,{"":s},``,s):s}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw Error(`Document with errors cannot be stringified`);if(`indent`in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return or(this,e)}};function cr(e){if(j(e))return!0;throw Error(`Expected a YAML collection as document contents`)}var lr=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},ur=class extends lr{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},dr=class extends lr{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}},fr=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(e=>t.linePos(e));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let a=i-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,``);if(a>=60&&o.length>80){let e=Math.min(a-39,o.length-79);o=`…`+o.substring(e),a-=e-1}if(o.length>80&&(o=o.substring(0,79)+`…`),r>1&&/^ *$/.test(o.substring(0,a))){let n=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+`…
|
|
42
|
+
`),o=n+o}if(/[^ ]/.test(o)){let e=1,t=n.linePos[1];t?.line===r&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-a)));let s=` `.repeat(a)+`^`.repeat(e);n.message+=`:\n\n${o}\n${s}\n`}};function pr(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:o,startOnNewline:s}){let c=!1,l=s,u=s,d=``,f=``,p=!1,m=!1,h=null,g=null,_=null,v=null,y=null,b=null,x=null;for(let i of e)switch(m&&=(i.type!==`space`&&i.type!==`newline`&&i.type!==`comma`&&a(i.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),!1),h&&=(l&&i.type!==`comment`&&i.type!==`newline`&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),null),i.type){case`space`:!t&&(n!==`doc-start`||r?.type!==`flow-collection`)&&i.source.includes(` `)&&(h=i),u=!0;break;case`comment`:{u||a(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let e=i.source.substring(1)||` `;d?d+=f+e:d=e,f=``,l=!1;break}case`newline`:l?d?d+=i.source:(!b||n!==`seq-item-ind`)&&(c=!0):f+=i.source,l=!0,p=!0,(g||_)&&(v=i),u=!0;break;case`anchor`:g&&a(i,`MULTIPLE_ANCHORS`,`A node can have at most one anchor`),i.source.endsWith(`:`)&&a(i.offset+i.source.length-1,`BAD_ALIAS`,`Anchor ending in : is ambiguous`,!0),g=i,x??=i.offset,l=!1,u=!1,m=!0;break;case`tag`:_&&a(i,`MULTIPLE_TAGS`,`A node can have at most one tag`),_=i,x??=i.offset,l=!1,u=!1,m=!0;break;case n:(g||_)&&a(i,`BAD_PROP_ORDER`,`Anchors and tags must be after the ${i.source} indicator`),b&&a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.source} in ${t??`collection`}`),b=i,l=n===`seq-item-ind`||n===`explicit-key-ind`,u=!1;break;case`comma`:if(t){y&&a(i,`UNEXPECTED_TOKEN`,`Unexpected , in ${t}`),y=i,l=!1,u=!1;break}default:a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.type} token`),l=!1,u=!1}let S=e[e.length-1],ee=S?S.offset+S.source.length:i;return m&&r&&r.type!==`space`&&r.type!==`newline`&&r.type!==`comma`&&(r.type!==`scalar`||r.source!==``)&&a(r.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),h&&(l&&h.indent<=o||r?.type===`block-map`||r?.type===`block-seq`)&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),{comma:y,found:b,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:_,newlineAfterProp:v,end:ee,start:x??ee}}function mr(e){if(!e)return null;switch(e.type){case`alias`:case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:if(e.source.includes(`
|
|
43
|
+
`))return!0;if(e.end){for(let t of e.end)if(t.type===`newline`)return!0}return!1;case`flow-collection`:for(let t of e.items){for(let e of t.start)if(e.type===`newline`)return!0;if(t.sep){for(let e of t.sep)if(e.type===`newline`)return!0}if(mr(t.key)||mr(t.value))return!0}return!1;default:return!0}}function hr(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&mr(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function gr(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||A(e)&&A(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var _r=`All mapping items must start at the same column`;function vr({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new(a?.nodeClass??V)(n.schema);n.atRoot&&=!1;let s=r.offset,c=null;for(let a of r.items){let{start:l,key:u,sep:d,value:f}=a,p=pr(l,{indicator:`explicit-key-ind`,next:u??d?.[0],offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0}),m=!p.found;if(m){if(u&&(u.type===`block-seq`?i(s,`BLOCK_AS_IMPLICIT_KEY`,`A block sequence may not be used as an implicit map key`):`indent`in u&&u.indent!==r.indent&&i(s,`BAD_INDENT`,_r)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+=`
|
|
44
|
+
`+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||mr(u))&&i(u??l[l.length-1],`MULTILINE_IMPLICIT_KEY`,`Implicit keys need to be on a single line`)}else p.found?.indent!==r.indent&&i(s,`BAD_INDENT`,_r);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&hr(r.indent,u,i),n.atKey=!1,gr(n,o.items,g)&&i(h,`DUPLICATE_KEY`,`Map keys must be unique`);let _=pr(d??[],{indicator:`map-value-ind`,next:f,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!u||u.type===`block-scalar`});if(s=_.end,_.found){m&&(f?.type===`block-map`&&!_.hasNewline&&i(s,`BLOCK_AS_IMPLICIT_KEY`,`Nested mappings are not allowed in compact mappings`),n.options.strict&&p.start<_.found.offset-1024&&i(g.range,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit block mapping key`));let c=f?e(n,f,_,i):t(n,s,d,null,_,i);n.schema.compat&&hr(r.indent,f,i),s=c.range[2];let l=new B(g,c);n.options.keepSourceTokens&&(l.srcToken=a),o.items.push(l)}else{m&&i(g.range,`MISSING_CHAR`,`Implicit map keys need to be followed by map values`),_.comment&&(g.comment?g.comment+=`
|
|
45
|
+
`+_.comment:g.comment=_.comment);let e=new B(g);n.options.keepSourceTokens&&(e.srcToken=a),o.items.push(e)}}return c&&c<s&&i(c,`IMPOSSIBLE`,`Map comment with trailing content`),o.range=[r.offset,s,c??s],o}function yr({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new(a?.nodeClass??sn)(n.schema);n.atRoot&&=!1,n.atKey&&=!1;let s=r.offset,c=null;for(let{start:a,value:l}of r.items){let u=pr(a,{indicator:`seq-item-ind`,next:l,offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!u.found)if(u.anchor||u.tag||l)l?.type===`block-seq`?i(u.end,`BAD_INDENT`,`All sequence items must start at the same column`):i(s,`MISSING_CHAR`,`Sequence item without - indicator`);else{c=u.end,u.comment&&(o.comment=u.comment);continue}let d=l?e(n,l,u,i):t(n,u.end,a,null,u,i);n.schema.compat&&hr(r.indent,l,i),s=d.range[2],o.items.push(d)}return o.range=[r.offset,s,c??s],o}function br(e,t,n,r){let i=``;if(e){let a=!1,o=``;for(let s of e){let{source:e,type:c}=s;switch(c){case`space`:a=!0;break;case`comment`:{n&&!a&&r(s,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let t=e.substring(1)||` `;i?i+=o+t:i=t,o=``;break}case`newline`:i&&(o+=e),a=!0;break;default:r(s,`UNEXPECTED_TOKEN`,`Unexpected ${c} at node end`)}t+=e.length}}return{comment:i,offset:t}}var xr=`Block collections are not allowed within flow collections`,Sr=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function Cr({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source===`{`,s=o?`flow map`:`flow sequence`,c=new(a?.nodeClass??(o?V:sn))(n.schema);c.flow=!0;let l=n.atRoot;l&&(n.atRoot=!1),n.atKey&&=!1;let u=r.offset+r.start.source.length;for(let a=0;a<r.items.length;++a){let l=r.items[a],{start:d,key:f,sep:p,value:m}=l,h=pr(d,{flow:s,indicator:`explicit-key-ind`,next:f??p?.[0],offset:u,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!h.found){if(!h.anchor&&!h.tag&&!p&&!m){a===0&&h.comma?i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`):a<r.items.length-1&&i(h.start,`UNEXPECTED_TOKEN`,`Unexpected empty item in ${s}`),h.comment&&(c.comment?c.comment+=`
|
|
46
|
+
`+h.comment:c.comment=h.comment),u=h.end;continue}!o&&n.options.strict&&mr(f)&&i(f,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`)}if(a===0)h.comma&&i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`);else if(h.comma||i(h.start,`MISSING_CHAR`,`Missing , between ${s} items`),h.comment){let e=``;loop:for(let t of d)switch(t.type){case`comma`:case`space`:break;case`comment`:e=t.source.substring(1);break loop;default:break loop}if(e){let t=c.items[c.items.length-1];k(t)&&(t=t.value??t.key),t.comment?t.comment+=`
|
|
47
|
+
`+e:t.comment=e,h.comment=h.comment.substring(e.length+1)}}if(!o&&!p&&!h.found){let r=m?e(n,m,h,i):t(n,h.end,p,null,h,i);c.items.push(r),u=r.range[2],Sr(m)&&i(r.range,`BLOCK_IN_FLOW`,xr)}else{n.atKey=!0;let a=h.end,g=f?e(n,f,h,i):t(n,a,d,null,h,i);Sr(f)&&i(g.range,`BLOCK_IN_FLOW`,xr),n.atKey=!1;let _=pr(p??[],{flow:s,indicator:`map-value-ind`,next:m,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(_.found){if(!o&&!h.found&&n.options.strict){if(p)for(let e of p){if(e===_.found)break;if(e.type===`newline`){i(e,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`);break}}h.start<_.found.offset-1024&&i(_.found,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit flow sequence key`)}}else m&&(`source`in m&&m.source?.[0]===`:`?i(m,`MISSING_CHAR`,`Missing space after : in ${s}`):i(_.start,`MISSING_CHAR`,`Missing , or : between ${s} items`));let v=m?e(n,m,_,i):_.found?t(n,_.end,p,null,_,i):null;v?Sr(m)&&i(v.range,`BLOCK_IN_FLOW`,xr):_.comment&&(g.comment?g.comment+=`
|
|
48
|
+
`+_.comment:g.comment=_.comment);let y=new B(g,v);if(n.options.keepSourceTokens&&(y.srcToken=l),o){let e=c;gr(n,e.items,g)&&i(a,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(y)}else{let e=new V(n.schema);e.flow=!0,e.items.push(y);let t=(v??g).range;e.range=[g.range[0],t[1],t[2]],c.items.push(e)}u=v?v.range[2]:_.end}}let d=o?`}`:`]`,[f,...p]=r.end,m=u;if(f?.source===d)m=f.offset+f.source.length;else{let e=s[0].toUpperCase()+s.substring(1),t=l?`${e} must end with a ${d}`:`${e} in block collection must be sufficiently indented and end with a ${d}`;i(u,l?`MISSING_CHAR`:`BAD_INDENT`,t),f&&f.source.length!==1&&p.unshift(f)}if(p.length>0){let e=br(p,m,n.options.strict,i);e.comment&&(c.comment?c.comment+=`
|
|
49
|
+
`+e.comment:c.comment=e.comment),c.range=[r.offset,m,e.offset]}else c.range=[r.offset,m,m];return c}function wr(e,t,n,r,i,a){let o=n.type===`block-map`?vr(e,t,n,r,a):n.type===`block-seq`?yr(e,t,n,r,a):Cr(e,t,n,r,a),s=o.constructor;return i===`!`||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function Tr(e,t,n,r,i){let a=r.tag,o=a?t.directives.tagName(a.source,e=>i(a,`TAG_RESOLVE_FAILED`,e)):null;if(n.type===`block-seq`){let{anchor:e,newlineAfterProp:t}=r,n=e&&a?e.offset>a.offset?e:a:e??a;n&&(!t||t.offset<n.offset)&&i(n,`MISSING_CHAR`,`Missing newline after block sequence props`)}let s=n.type===`block-map`?`map`:n.type===`block-seq`?`seq`:n.start.source===`{`?`map`:`seq`;if(!a||!o||o===`!`||o===V.tagName&&s===`map`||o===sn.tagName&&s===`seq`)return wr(e,t,n,i,o);let c=t.schema.tags.find(e=>e.tag===o&&e.collection===s);if(!c){let r=t.schema.knownTags[o];if(r?.collection===s)t.schema.tags.push(Object.assign({},r,{default:!1})),c=r;else return r?i(a,`BAD_COLLECTION_TYPE`,`${r.tag} used for ${s} collection, but expects ${r.collection??`scalar`}`,!0):i(a,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${o}`,!0),wr(e,t,n,i,o)}let l=wr(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a,`TAG_RESOLVE_FAILED`,e),t.options)??l,d=M(u)?u:new I(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function Er(e,t,n){let r=t.offset,i=Dr(t,e.options.strict,n);if(!i)return{value:``,type:null,comment:``,range:[r,r,r]};let a=i.mode===`>`?I.BLOCK_FOLDED:I.BLOCK_LITERAL,o=t.source?Or(t.source):[],s=o.length;for(let e=o.length-1;e>=0;--e){let t=o[e][1];if(t===``||t===`\r`)s=e;else break}if(s===0){let e=i.chomp===`+`&&o.length>0?`
|
|
50
|
+
`.repeat(Math.max(1,o.length-1)):``,n=r+i.length;return t.source&&(n+=t.source.length),{value:e,type:a,comment:i.comment,range:[r,n,n]}}let c=t.indent+i.indent,l=t.offset+i.length,u=0;for(let t=0;t<s;++t){let[r,a]=o[t];if(a===``||a===`\r`)i.indent===0&&r.length>c&&(c=r.length);else{r.length<c&&n(l+r.length,`MISSING_CHAR`,`Block scalars with more-indented leading empty lines must use an explicit indentation indicator`),i.indent===0&&(c=r.length),u=t,c===0&&!e.atRoot&&n(l,`BAD_INDENT`,`Block scalar values in collections must be indented`);break}l+=r.length+a.length+1}for(let e=o.length-1;e>=s;--e)o[e][0].length>c&&(s=e+1);let d=``,f=``,p=!1;for(let e=0;e<u;++e)d+=o[e][0].slice(c)+`
|
|
51
|
+
`;for(let e=u;e<s;++e){let[t,r]=o[e];l+=t.length+r.length+1;let s=r[r.length-1]===`\r`;if(s&&(r=r.slice(0,-1)),r&&t.length<c){let e=`Block scalar lines must not be less indented than their ${i.indent?`explicit indentation indicator`:`first line`}`;n(l-r.length-(s?2:1),`BAD_INDENT`,e),t=``}a===I.BLOCK_LITERAL?(d+=f+t.slice(c)+r,f=`
|
|
52
|
+
`):t.length>c||r[0]===` `?(f===` `?f=`
|
|
53
|
+
`:!p&&f===`
|
|
54
|
+
`&&(f=`
|
|
55
|
+
|
|
56
|
+
`),d+=f+t.slice(c)+r,f=`
|
|
57
|
+
`,p=!0):r===``?f===`
|
|
58
|
+
`?d+=`
|
|
59
|
+
`:f=`
|
|
60
|
+
`:(d+=f+r,f=` `,p=!1)}switch(i.chomp){case`-`:break;case`+`:for(let e=s;e<o.length;++e)d+=`
|
|
61
|
+
`+o[e][0].slice(c);d[d.length-1]!==`
|
|
62
|
+
`&&(d+=`
|
|
63
|
+
`);break;default:d+=`
|
|
64
|
+
`}let m=r+i.length+t.source.length;return{value:d,type:a,comment:i.comment,range:[r,m,m]}}function Dr({offset:e,props:t},n,r){if(t[0].type!==`block-scalar-header`)return r(t[0],`IMPOSSIBLE`,`Block scalar header not found`),null;let{source:i}=t[0],a=i[0],o=0,s=``,c=-1;for(let t=1;t<i.length;++t){let n=i[t];if(!s&&(n===`-`||n===`+`))s=n;else{let r=Number(n);!o&&r?o=r:c===-1&&(c=e+t)}}c!==-1&&r(c,`UNEXPECTED_TOKEN`,`Block scalar header includes extra characters: ${i}`);let l=!1,u=``,d=i.length;for(let e=1;e<t.length;++e){let i=t[e];switch(i.type){case`space`:l=!0;case`newline`:d+=i.source.length;break;case`comment`:n&&!l&&r(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`),d+=i.source.length,u=i.source.substring(1);break;case`error`:r(i,`UNEXPECTED_TOKEN`,i.message),d+=i.source.length;break;default:{r(i,`UNEXPECTED_TOKEN`,`Unexpected token in block scalar header: ${i.type}`);let e=i.source;e&&typeof e==`string`&&(d+=e.length)}}}return{mode:a,indent:o,chomp:s,comment:u,length:d}}function Or(e){let t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),i=[r?.[1]?[r[1],n.slice(r[1].length)]:[``,n]];for(let e=1;e<t.length;e+=2)i.push([t[e],t[e+1]]);return i}function kr(e,t,n){let{offset:r,type:i,source:a,end:o}=e,s,c,l=(e,t,i)=>n(r+e,t,i);switch(i){case`scalar`:s=I.PLAIN,c=Ar(a,l);break;case`single-quoted-scalar`:s=I.QUOTE_SINGLE,c=jr(a,l);break;case`double-quoted-scalar`:s=I.QUOTE_DOUBLE,c=Nr(a,l);break;default:return n(e,`UNEXPECTED_TOKEN`,`Expected a flow scalar value, but found: ${i}`),{value:``,type:null,comment:``,range:[r,r+a.length,r+a.length]}}let u=r+a.length,d=br(o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function Ar(e,t){let n=``;switch(e[0]){case` `:n=`a tab character`;break;case`,`:n=`flow indicator character ,`;break;case`%`:n=`directive indicator character %`;break;case`|`:case`>`:n=`block scalar indicator ${e[0]}`;break;case`@`:case"`":n=`reserved character ${e[0]}`;break}return n&&t(0,`BAD_SCALAR_START`,`Plain value cannot start with ${n}`),Mr(e)}function jr(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),Mr(e.slice(1,-1)).replace(/''/g,`'`)}function Mr(e){let t,n;try{t=RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
65
|
+
`,`sy`),n=RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
66
|
+
`,`sy`)}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=t.exec(e);if(!r)return e;let i=r[1],a=` `,o=t.lastIndex;for(n.lastIndex=o;r=n.exec(e);)r[1]===``?a===`
|
|
67
|
+
`?i+=a:a=`
|
|
68
|
+
`:(i+=a+r[1],a=` `),o=n.lastIndex;let s=/[ \t]*(.*)/sy;return s.lastIndex=o,r=s.exec(e),i+a+(r?.[1]??``)}function Nr(e,t){let n=``;for(let r=1;r<e.length-1;++r){let i=e[r];if(!(i===`\r`&&e[r+1]===`
|
|
69
|
+
`))if(i===`
|
|
70
|
+
`){let{fold:t,offset:i}=Pr(e,r);n+=t,r=i}else if(i===`\\`){let i=e[++r],a=Fr[i];if(a)n+=a;else if(i===`
|
|
71
|
+
`)for(i=e[r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`\r`&&e[r+1]===`
|
|
72
|
+
`)for(i=e[++r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`x`||i===`u`||i===`U`){let a=i===`x`?2:i===`u`?4:8;n+=Ir(e,r+1,a,t),r+=a}else{let i=e.substr(r-1,2);t(r-1,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),n+=i}}else if(i===` `||i===` `){let t=r,a=e[r+1];for(;a===` `||a===` `;)a=e[++r+1];a!==`
|
|
73
|
+
`&&!(a===`\r`&&e[r+2]===`
|
|
74
|
+
`)&&(n+=r>t?e.slice(t,r+1):i)}else n+=i}return(e[e.length-1]!==`"`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing "quote`),n}function Pr(e,t){let n=``,r=e[t+1];for(;(r===` `||r===` `||r===`
|
|
75
|
+
`||r===`\r`)&&!(r===`\r`&&e[t+2]!==`
|
|
76
|
+
`);)r===`
|
|
77
|
+
`&&(n+=`
|
|
78
|
+
`),t+=1,r=e[t+1];return n||=` `,{fold:n,offset:t}}var Fr={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
|
|
79
|
+
`,r:`\r`,t:` `,v:`\v`,N:`
`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function Ir(e,t,n,r){let i=e.substr(t,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(a)}catch{let i=e.substr(t-2,n+2);return r(t-2,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),i}}function Lr(e,t,n,r){let{value:i,type:a,comment:o,range:s}=t.type===`block-scalar`?Er(e,t,r):kr(t,e.options.strict,r),c=n?e.directives.tagName(n.source,e=>r(n,`TAG_RESOLVE_FAILED`,e)):null,l;l=e.options.stringKeys&&e.atKey?e.schema[E]:c?Rr(e.schema,i,c,n,r):t.type===`scalar`?zr(e,i,t,r):e.schema[E];let u;try{let a=l.resolve(i,e=>r(n??t,`TAG_RESOLVE_FAILED`,e),e.options);u=A(a)?a:new I(a)}catch(e){let a=e instanceof Error?e.message:String(e);r(n??t,`TAG_RESOLVE_FAILED`,a),u=new I(i)}return u.range=s,u.source=i,a&&(u.type=a),c&&(u.tag=c),l.format&&(u.format=l.format),o&&(u.comment=o),u}function Rr(e,t,n,r,i){if(n===`!`)return e[E];let a=[];for(let t of e.tags)if(!t.collection&&t.tag===n)if(t.default&&t.test)a.push(t);else return t;for(let e of a)if(e.test?.test(t))return e;let o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(r,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${n}`,n!==`tag:yaml.org,2002:str`),e[E])}function zr({atKey:e,directives:t,schema:n},r,i,a){let o=n.tags.find(t=>(t.default===!0||e&&t.default===`key`)&&t.test?.test(r))||n[E];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[E];o.tag!==e.tag&&a(i,`TAG_RESOLVE_FAILED`,`Value may be parsed as either ${t.tagString(o.tag)} or ${t.tagString(e.tag)}`,!0)}return o}function Br(e,t,n){if(t){n??=t.length;for(let r=n-1;r>=0;--r){let n=t[r];switch(n.type){case`space`:case`comment`:case`newline`:e-=n.source.length;continue}for(n=t[++r];n?.type===`space`;)e+=n.source.length,n=t[++r];break}}return e}var Vr={composeNode:Hr,composeEmptyNode:Ur};function Hr(e,t,n,r){let i=e.atKey,{spaceBefore:a,comment:o,anchor:s,tag:c}=n,l,u=!0;switch(t.type){case`alias`:l=Wr(e,t,r),(s||c)&&r(t,`ALIAS_PROPS`,`An alias node must not specify any properties`);break;case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`block-scalar`:l=Lr(e,t,c,r),s&&(l.anchor=s.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{l=Tr(Vr,e,t,n,r),s&&(l.anchor=s.source.substring(1))}catch(e){r(t,`RESOURCE_EXHAUSTION`,e instanceof Error?e.message:String(e))}break;default:r(t,`UNEXPECTED_TOKEN`,t.type===`error`?t.message:`Unsupported token (type: ${t.type})`),u=!1}return l??=Ur(e,t.offset,void 0,null,n,r),s&&l.anchor===``&&r(s,`BAD_ALIAS`,`Anchor cannot be an empty string`),i&&e.options.stringKeys&&(!A(l)||typeof l.value!=`string`||l.tag&&l.tag!==`tag:yaml.org,2002:str`)&&r(c??t,`NON_STRING_KEY`,`With stringKeys, all keys must be strings`),a&&(l.spaceBefore=!0),o&&(t.type===`scalar`&&t.source===``?l.comment=o:l.commentBefore=o),e.options.keepSourceTokens&&u&&(l.srcToken=t),l}function Ur(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:c},l){let u=Lr(e,{type:`scalar`,offset:Br(t,n,r),indent:-1,source:``},s,l);return o&&(u.anchor=o.source.substring(1),u.anchor===``&&l(o,`BAD_ALIAS`,`Anchor cannot be an empty string`)),i&&(u.spaceBefore=!0),a&&(u.comment=a,u.range[2]=c),u}function Wr({options:e},{offset:t,source:n,end:r},i){let a=new ht(n.substring(1));a.source===``&&i(t,`BAD_ALIAS`,`Alias cannot be an empty string`),a.source.endsWith(`:`)&&i(t+n.length-1,`BAD_ALIAS`,`Alias ending in : is ambiguous`,!0);let o=t+n.length,s=br(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function Gr(e,t,{offset:n,start:r,value:i,end:a},o){let s=new sr(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:s.directives,options:s.options,schema:s.schema},l=pr(r,{indicator:`doc-start`,next:i??a?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});l.found&&(s.directives.docStart=!0,i&&(i.type===`block-map`||i.type===`block-seq`)&&!l.hasNewline&&o(l.end,`MISSING_CHAR`,`Block collection cannot start on same line with directives-end marker`)),s.contents=i?Hr(c,i,l,o):Ur(c,l.end,r,null,l,o);let u=s.contents.range[2],d=br(a,u,!1,o);return d.comment&&(s.comment=d.comment),s.range=[n,u,d.offset],s}function Kr(e){if(typeof e==`number`)return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n==`string`?n.length:1)]}function qr(e){let t=``,n=!1,r=!1;for(let i=0;i<e.length;++i){let a=e[i];switch(a[0]){case`#`:t+=(t===``?``:r?`
|
|
80
|
+
|
|
81
|
+
`:`
|
|
82
|
+
`)+(a.substring(1)||` `),n=!0,r=!1;break;case`%`:e[i+1]?.[0]!==`#`&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}var Jr=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=Kr(e);r?this.warnings.push(new dr(i,t,n)):this.errors.push(new ur(i,t,n))},this.directives=new ct({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=qr(this.prelude);if(n){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(j(i)&&!i.flow&&i.items.length>0){let e=i.items[0];k(e)&&(e=e.key);let t=e.commentBefore;e.commentBefore=t?`${n}\n${t}`:n}else{let e=i.commentBefore;i.commentBefore=e?`${n}\n${e}`:n}}if(t){for(let t=0;t<this.errors.length;++t)e.errors.push(this.errors[t]);for(let t=0;t<this.warnings.length;++t)e.warnings.push(this.warnings[t])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:qr(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let t of e)yield*this.next(t);yield*this.end(t,n)}*next(e){switch(e.type){case`directive`:this.directives.add(e.source,(t,n,r)=>{let i=Kr(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=Gr(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,`MISSING_CHAR`,`Missing directives-end/doc-start indicator line`),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case`byte-order-mark`:case`space`:break;case`comment`:case`newline`:this.prelude.push(e.source);break;case`error`:{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new ur(Kr(e),`UNEXPECTED_TOKEN`,t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case`doc-end`:{if(!this.doc){this.errors.push(new ur(Kr(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=br(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new ur(Kr(e),`UNEXPECTED_TOKEN`,`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let e=new sr(void 0,Object.assign({_directives:this.directives},this.options));this.atDirectives&&this.onError(t,`MISSING_CHAR`,`Missing directives-end indicator line`),e.range=[0,t,t],this.decorate(e,!1),yield e}}},Yr=Symbol(`break visit`),Xr=Symbol(`skip children`),Zr=Symbol(`remove item`);function Qr(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),$r(Object.freeze([]),e,t)}Qr.BREAK=Yr,Qr.SKIP=Xr,Qr.REMOVE=Zr,Qr.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},Qr.parentCollection=(e,t)=>{let n=Qr.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 $r(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=$r(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===Yr)return Yr;else r===Zr&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}function ei(e){switch(e){case``:return`byte-order-mark`;case``:return`doc-mode`;case``:return`flow-error-end`;case``:return`scalar`;case`---`:return`doc-start`;case`...`:return`doc-end`;case``:case`
|
|
83
|
+
`:case`\r
|
|
84
|
+
`:return`newline`;case`-`:return`seq-item-ind`;case`?`:return`explicit-key-ind`;case`:`:return`map-value-ind`;case`{`:return`flow-map-start`;case`}`:return`flow-map-end`;case`[`:return`flow-seq-start`;case`]`:return`flow-seq-end`;case`,`:return`comma`}switch(e[0]){case` `:case` `:return`space`;case`#`:return`comment`;case`%`:return`directive-line`;case`*`:return`alias`;case`&`:return`anchor`;case`!`:return`tag`;case`'`:return`single-quoted-scalar`;case`"`:return`double-quoted-scalar`;case`|`:case`>`:return`block-scalar-header`}return null}function U(e){switch(e){case void 0:case` `:case`
|
|
85
|
+
`:case`\r`:case` `:return!0;default:return!1}}var ti=new Set(`0123456789ABCDEFabcdef`),ni=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),ri=new Set(`,[]{}`),ii=new Set(` ,[]{}
|
|
86
|
+
\r `),ai=e=>!e||ii.has(e),oi=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer=``,this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!=`string`)throw TypeError(`source is not a string`);this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??`stream`;for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===` `||t===` `;)t=this.buffer[++e];return!t||t===`#`||t===`
|
|
87
|
+
`?!0:t===`\r`?this.buffer[e+1]===`
|
|
88
|
+
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;t===` `;)t=this.buffer[++n+e];if(t===`\r`){let t=this.buffer[n+e+1];if(t===`
|
|
89
|
+
`||!t&&!this.atEnd)return e+n+1}return t===`
|
|
90
|
+
`||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t===`-`||t===`.`){let t=this.buffer.substr(e,3);if((t===`---`||t===`...`)&&U(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!=`number`||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
|
|
91
|
+
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]===`\r`&&--e,this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case`stream`:return yield*this.parseStream();case`line-start`:return yield*this.parseLineStart();case`block-start`:return yield*this.parseBlockStart();case`doc`:return yield*this.parseDocument();case`flow`:return yield*this.parseFlowCollection();case`quoted-scalar`:return yield*this.parseQuotedScalar();case`block-scalar`:return yield*this.parseBlockScalar();case`plain-scalar`:return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext(`stream`);if(e[0]===``&&(yield*this.pushCount(1),e=e.substring(1)),e[0]===`%`){let t=e.length,n=e.indexOf(`#`);for(;n!==-1;){let r=e[n-1];if(r===` `||r===` `){t=n-1;break}else n=e.indexOf(`#`,n+1)}for(;;){let n=e[t-1];if(n===` `||n===` `)--t;else break}let r=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),this.pushNewline(),`stream`}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),`stream`}return yield``,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext(`line-start`);if(e===`-`||e===`.`){if(!this.atEnd&&!this.hasChars(4))return this.setNext(`line-start`);let e=this.peek(3);if((e===`---`||e===`...`)&&U(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,e===`---`?`doc`:`stream`}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!U(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext(`block-start`);if((e===`-`||e===`?`||e===`:`)&&U(t)){let e=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,`block-start`}return`doc`}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext(`doc`);let t=yield*this.pushIndicators();switch(e[t]){case`#`:yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),`doc`;case`*`:return yield*this.pushUntil(ai),`doc`;case`"`:case`'`:return yield*this.parseQuotedScalar();case`|`:case`>`:return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,n=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let r=this.getLine();if(r===null)return this.setNext(`flow`);if((n!==-1&&n<this.indentNext&&r[0]!==`#`||n===0&&(r.startsWith(`---`)||r.startsWith(`...`))&&U(r[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(r[0]===`]`||r[0]===`}`)))return this.flowLevel=0,yield``,yield*this.parseLineStart();let i=0;for(;r[i]===`,`;)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),r[i]){case void 0:return`flow`;case`#`:return yield*this.pushCount(r.length-i),`flow`;case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),this.flowKey=!0,--this.flowLevel,this.flowLevel?`flow`:`doc`;case`*`:return yield*this.pushUntil(ai),`flow`;case`"`:case`'`:return this.flowKey=!0,yield*this.parseQuotedScalar();case`:`:{let e=this.charAt(1);if(this.flowKey||U(e)||e===`,`)return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),`flow`}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if(e===`'`)for(;t!==-1&&this.buffer[t+1]===`'`;)t=this.buffer.indexOf(`'`,t+2);else for(;t!==-1;){let e=0;for(;this.buffer[t-1-e]===`\\`;)e+=1;if(e%2==0)break;t=this.buffer.indexOf(`"`,t+1)}let n=this.buffer.substring(0,t),r=n.indexOf(`
|
|
92
|
+
`,this.pos);if(r!==-1){for(;r!==-1;){let e=this.continueScalar(r+1);if(e===-1)break;r=n.indexOf(`
|
|
93
|
+
`,e)}r!==-1&&(t=r-(n[r-1]===`\r`?2:1))}if(t===-1){if(!this.atEnd)return this.setNext(`quoted-scalar`);t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?`flow`:`doc`}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if(t===`+`)this.blockScalarKeep=!0;else if(t>`0`&&t<=`9`)this.blockScalarIndent=Number(t)-1;else if(t!==`-`)break}return yield*this.pushUntil(e=>U(e)||e===`#`)}*parseBlockScalar(){let e=this.pos-1,t=0,n;loop:for(let r=this.pos;n=this.buffer[r];++r)switch(n){case` `:t+=1;break;case`
|
|
94
|
+
`:e=r,t=0;break;case`\r`:{let e=this.buffer[r+1];if(!e&&!this.atEnd)return this.setNext(`block-scalar`);if(e===`
|
|
95
|
+
`)break}default:break loop}if(!n&&!this.atEnd)return this.setNext(`block-scalar`);if(t>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=t:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let t=this.continueScalar(e+1);if(t===-1)break;e=this.buffer.indexOf(`
|
|
96
|
+
`,t)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext(`block-scalar`);e=this.buffer.length}}let r=e+1;for(n=this.buffer[r];n===` `;)n=this.buffer[++r];if(n===` `){for(;n===` `||n===` `||n===`\r`||n===`
|
|
97
|
+
`;)n=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)do{let n=e-1,r=this.buffer[n];r===`\r`&&(r=this.buffer[--n]);let i=n;for(;r===` `;)r=this.buffer[--n];if(r===`
|
|
98
|
+
`&&n>=this.pos&&n+1+t>i)e=n;else break}while(!0);return yield``,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,n=this.pos-1,r;for(;r=this.buffer[++n];)if(r===`:`){let r=this.buffer[n+1];if(U(r)||e&&ri.has(r))break;t=n}else if(U(r)){let i=this.buffer[n+1];if(r===`\r`&&(i===`
|
|
99
|
+
`?(n+=1,r=`
|
|
100
|
+
`,i=this.buffer[n+1]):t=n),i===`#`||e&&ri.has(i))break;if(r===`
|
|
101
|
+
`){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&ri.has(r))break;t=n}return!r&&!this.atEnd?this.setNext(`plain-scalar`):(yield``,yield*this.pushToIndex(t+1,!0),e?`flow`:`doc`)}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield``),0)}*pushIndicators(){let e=0;loop:for(;;){switch(this.charAt(0)){case`!`:e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue loop;case`&`:e+=yield*this.pushUntil(ai),e+=yield*this.pushSpaces(!0);continue loop;case`-`:case`?`:case`:`:{let t=this.flowLevel>0,n=this.charAt(1);if(U(n)||t&&ri.has(n)){t?this.flowKey&&=!1:this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue loop}}}break loop}return e}*pushTag(){if(this.charAt(1)===`<`){let e=this.pos+2,t=this.buffer[e];for(;!U(t)&&t!==`>`;)t=this.buffer[++e];return yield*this.pushToIndex(t===`>`?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(ni.has(t))t=this.buffer[++e];else if(t===`%`&&ti.has(this.buffer[e+1])&&ti.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
|
|
102
|
+
`?yield*this.pushCount(1):e===`\r`&&this.charAt(1)===`
|
|
103
|
+
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===` `||e&&n===` `);let r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}},si=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){let r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}};function W(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function ci(e){for(let t=0;t<e.length;++t)switch(e[t].type){case`space`:case`comment`:case`newline`:break;default:return t}return-1}function li(e){switch(e?.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`flow-collection`:return!0;default:return!1}}function ui(e){switch(e.type){case`document`:return e.start;case`block-map`:{let t=e.items[e.items.length-1];return t.sep??t.start}case`block-seq`:return e.items[e.items.length-1].start;default:return[]}}function di(e){if(e.length===0)return[];let t=e.length;loop:for(;--t>=0;)switch(e[t].type){case`doc-start`:case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:case`newline`:break loop}for(;e[++t]?.type===`space`;);return e.splice(t,e.length)}function fi(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n<t.length;++n)e.push(t[n])}function pi(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!W(t.start,`explicit-key-ind`)&&!W(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,li(t.value)?t.value.end?fi(t.value.end,t.sep):t.value.end=t.sep:fi(t.start,t.sep),delete t.sep)}var mi=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source=``,this.type=``,this.lexer=new oi,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=ei(e);if(!t){let t=`Not a YAML token: ${e}`;yield*this.pop({type:`error`,offset:this.offset,message:t,source:e}),this.offset+=e.length}else if(t===`scalar`)this.atNewLine=!1,this.atScalar=!0,this.type=`scalar`;else{switch(this.type=t,yield*this.step(),t){case`newline`:this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case`space`:this.atNewLine&&e[0]===` `&&(this.indent+=e.length);break;case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:this.atNewLine&&(this.indent+=e.length);break;case`doc-mode`:case`flow-error-end`:return;default:this.atNewLine=!1}this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type===`doc-end`&&e?.type!==`doc-end`){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:`doc-end`,offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case`document`:return yield*this.document(e);case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return yield*this.scalar(e);case`block-scalar`:return yield*this.blockScalar(e);case`block-map`:return yield*this.blockMap(e);case`block-seq`:return yield*this.blockSequence(e);case`flow-collection`:return yield*this.flowCollection(e);case`doc-end`:return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:`error`,offset:this.offset,source:``,message:`Tried to pop an empty stack`};else if(this.stack.length===0)yield t;else{let e=this.peek(1);switch(t.type===`block-scalar`?t.indent=`indent`in e?e.indent:0:t.type===`flow-collection`&&e.type===`document`&&(t.indent=0),t.type===`flow-collection`&&pi(t),e.type){case`document`:e.value=t;break;case`block-scalar`:e.props.push(t);break;case`block-map`:{let n=e.items[e.items.length-1];if(n.value){e.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(n.sep)n.value=t;else{Object.assign(n,{key:t,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case`block-seq`:{let n=e.items[e.items.length-1];n.value?e.items.push({start:[],value:t}):n.value=t;break}case`flow-collection`:{let n=e.items[e.items.length-1];!n||n.value?e.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((e.type===`document`||e.type===`block-map`||e.type===`block-seq`)&&(t.type===`block-map`||t.type===`block-seq`)){let n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&ci(n.start)===-1&&(t.indent===0||n.start.every(e=>e.type!==`comment`||e.indent<t.indent))&&(e.type===`document`?e.end=n.start:e.items.push({start:n.start}),t.items.splice(-1,1))}}}*stream(){switch(this.type){case`directive-line`:yield{type:`directive`,offset:this.offset,source:this.source};return;case`byte-order-mark`:case`space`:case`comment`:case`newline`:yield this.sourceToken;return;case`doc-mode`:case`doc-start`:{let e={type:`document`,offset:this.offset,start:[]};this.type===`doc-start`&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:`error`,offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case`doc-start`:ci(e.start)===-1?e.start.push(this.sourceToken):(yield*this.pop(),yield*this.step());return;case`anchor`:case`tag`:case`space`:case`comment`:case`newline`:e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);t?this.stack.push(t):yield{type:`error`,offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type===`map-value-ind`){let t=di(ui(this.peek(2))),n;e.end?(n=e.end,n.push(this.sourceToken),delete e.end):n=[this.sourceToken];let r={type:`block-map`,offset:e.offset,indent:e.indent,items:[{start:t,key:e,sep:n}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case`space`:case`comment`:case`newline`:e.props.push(this.sourceToken);return;case`scalar`:if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let e=this.source.indexOf(`
|
|
104
|
+
`)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
|
|
105
|
+
`,e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(this.onKeyLine=!1,t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){fi(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,r=n&&(t.sep||t.explicitKey)&&this.type!==`seq-item-ind`,i=[];if(r&&t.sep&&!t.value){let n=[];for(let r=0;r<t.sep.length;++r){let i=t.sep[r];switch(i.type){case`newline`:n.push(r);break;case`space`:break;case`comment`:i.indent>e.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(i=t.sep.splice(n[1]))}switch(this.type){case`anchor`:case`tag`:r||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`explicit-key-ind`:!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case`map-value-ind`:if(t.explicitKey)if(!t.sep)if(W(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=di(t.start);this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}else if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(W(t.sep,`map-value-ind`))this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(li(t.key)&&!W(t.sep,`newline`)){let e=di(t.start),n=t.key,r=t.sep;r.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:n,sep:r}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken);else t.sep?t.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):W(t.sep,`map-value-ind`)?this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);r||t.value?(e.items.push({start:i,key:n,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=!0);return}default:{let r=this.startBlockValue(e);if(r){if(r.type===`block-seq`){if(!t.explicitKey&&t.sep&&!W(t.sep,`newline`)){yield*this.pop({type:`error`,offset:this.offset,message:`Unexpected block-seq-ind on same line with key`,source:this.source});return}}else n&&e.items.push({start:i});this.stack.push(r);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){fi(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case`anchor`:case`tag`:if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case`seq-item-ind`:if(this.indent!==e.indent)break;t.value||W(t.start,`seq-item-ind`)?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let t=this.startBlockValue(e);if(t){this.stack.push(t);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type===`flow-error-end`){let e;do yield*this.pop(),e=this.peek(1);while(e?.type===`flow-collection`)}else if(e.end.length===0){switch(this.type){case`comma`:case`explicit-key-ind`:!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case`map-value-ind`:!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case`space`:case`comment`:case`newline`:case`anchor`:case`tag`:!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:n,sep:[]}):t.sep?this.stack.push(n):Object.assign(t,{key:n,sep:[]});return}case`flow-map-end`:case`flow-seq-end`:e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let t=this.peek(2);if(t.type===`block-map`&&(this.type===`map-value-ind`&&t.indent===e.indent||this.type===`newline`&&!t.items[t.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type===`map-value-ind`&&t.type!==`flow-collection`){let n=di(ui(t));pi(e);let r=e.end.splice(1,e.end.length);r.push(this.sourceToken);let i={type:`block-map`,offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf(`
|
|
106
|
+
`)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
|
|
107
|
+
`,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=di(ui(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=di(ui(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.type===`space`)}*documentEnd(e){this.type!==`doc-mode`&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case`comma`:case`doc-start`:case`doc-end`:case`flow-seq-end`:case`flow-map-end`:case`map-value-ind`:yield*this.pop(),yield*this.step();break;case`newline`:this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}};function hi(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new si||null,prettyErrors:t}}function gi(e,t={}){let{lineCounter:n,prettyErrors:r}=hi(t),i=new mi(n?.addNewLine),a=new Jr(t),o=null;for(let t of a.compose(i.parse(e),!0,e.length))if(!o)o=t;else if(o.options.logLevel!==`silent`){o.errors.push(new ur(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(fr(e,n)),o.warnings.forEach(fr(e,n))),o}function _i(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let i=gi(e,n);if(!i)return null;if(i.warnings.forEach(e=>Gt(i.options.logLevel,e)),i.errors.length>0){if(i.options.logLevel!==`silent`)throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}var vi=[`base00`,`base01`,`base02`,`base03`,`base04`,`base05`,`base06`,`base07`,`base08`,`base09`,`base0A`,`base0B`,`base0C`,`base0D`,`base0E`,`base0F`],yi={base00:`default background`,base01:`alt background — cards, popovers, sidebar`,base02:`selection background, borders`,base03:`comments, invisibles`,base04:`secondary text`,base05:`default foreground`,base06:`light foreground`,base07:`lightest foreground`,base08:`red — variables, tags, diff deleted`,base09:`orange — numbers, constants`,base0A:`yellow — classes, search highlight`,base0B:`green — strings, diff inserted`,base0C:`cyan — support, escapes, quotes`,base0D:`blue — functions, headings, accent`,base0E:`magenta — keywords, storage`,base0F:`deprecated markers, embedded tags`},bi=/^#[0-9a-fA-F]{6}$/,xi=/\P{White_Space}/u,G={graphical:3,text:4.5};function Si(e){return xi.test(e)}function Ci(e){return typeof e==`string`&&bi.test(e)}function K(e,t){let n=J(e),r=J(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function wi(e,t){return t.reduce((t,n)=>K(e,n)>K(e,t)?n:t)}function Ti(e,t){let n=wi(e,t);return K(e,n)>=G.text?n:wi(e,[`#000000`,`#ffffff`])}function Ei(e,t,n){for(let r=0;r<=255;r+=1){let i=r===0?e:q(e,t,r/255);if(n(i))return i}return null}var Di=new Set,Oi=16;function ki(e,t,n){return e===null?(Di.size<Oi&&!Di.has(n)&&(Di.add(n),console.warn(`[base16] ${n}; using the highest-contrast endpoint`)),t):e}function Ai(e,t,n,r=0){let i=wi(e[0]??`#ffffff`,[`#000000`,`#ffffff`]),a=t=>e.every(e=>K(e,t)>=n),o=t=>e.every(e=>K(q(e,t,r),t)>=n);return ki(Ei(t,i,e=>a(e)&&o(e))??Ei(t,i,a),i,`No foreground reaches a ${n}:1 contrast ratio against ${e.join(`, `)}`)}var ji=.25,Mi=.5,Ni=.3,Pi=.1,Fi=.85,Ii=.28,Li=.34,Ri=.3,zi=.06,Bi=.7;function Vi(e,t){let n=wi(e,[`#000000`,`#ffffff`]);return ki(Ei(t,n,t=>K(e,q(e,t,Bi))>=G.graphical),n,`No comment hue keeps a ${G.graphical}:1 resting underline against ${e}`)}function Hi(e,t,n,r){let i=wi(t,[`#000000`,`#ffffff`]),a=t=>q(e,t,r);return ki(Ei(n,i,e=>K(a(e),a(t))>=G.text),i,`No foreground faded to ${r} reaches a ${G.text}:1 contrast ratio against ${t} over ${e}`)}function Ui(e,t,n,r){let i=J(e)>J(t)?`#ffffff`:`#000000`;return ki(Ei(n,i,n=>r.every(r=>K(t,q(e,n,r))>=G.text)),i,`No highlight keeps ${t} text at a ${G.text}:1 contrast ratio over ${e} at ${r.map(e=>`${Math.round(e*100)}%`).join(`, `)}`)}function Wi(e){let t=e.palette,n=q(t.base02,e.variant===`dark`?`#ffffff`:`#000000`,.04),r=e=>Ai([t.base00,t.base01],e,G.text,ji),i={"callout-note-color":t.base0D,"callout-info-color":t.base0D,"callout-todo-color":t.base0D,"callout-abstract-color":t.base0C,"callout-tip-color":t.base0B,"callout-success-color":t.base0B,"callout-important-color":t.base0E,"callout-example-color":t.base0E,"callout-question-color":t.base0E,"callout-warning-color":t.base0A,"callout-caution-color":t.base09,"callout-danger-color":t.base09,"callout-failure-color":t.base08,"callout-bug-color":t.base08,"callout-quote-color":t.base03},a=Object.values(i).map(e=>q(t.base00,e,zi)),o=Ai([t.base00,t.base01,...new Set(a)],t.base08,G.text),s=q(t.base01,t.base02,Mi),c=q(t.base00,t.base08,Pi),l=e=>Ui(t.base00,t.base05,t.base0A,e);return{background:t.base00,foreground:t.base05,card:t.base01,"card-foreground":t.base05,popover:t.base01,"popover-foreground":t.base05,primary:t.base0D,"primary-foreground":t.base00,secondary:t.base01,"secondary-foreground":t.base05,muted:t.base01,"muted-foreground":t.base04,accent:t.base02,"accent-foreground":t.base05,destructive:r(t.base08),success:r(t.base0B),warning:r(t.base0A),info:r(t.base0D),border:t.base02,input:t.base02,ring:t.base0D,"selection-soft":t.base02,"chart-1":t.base0D,"chart-2":t.base0B,"chart-3":t.base0A,"chart-4":t.base0E,"chart-5":t.base08,"identity-1":t.base0E,"identity-2":t.base0C,"identity-3":t.base09,"identity-4":t.base0F,sidebar:t.base01,"sidebar-foreground":t.base05,"sidebar-primary":t.base0D,"sidebar-primary-foreground":t.base00,"sidebar-accent":t.base02,"sidebar-accent-foreground":t.base0D,"sidebar-hover":t.base02,"sidebar-hover-foreground":Ti(t.base02,[t.base00,t.base05,t.base07]),"sidebar-hover-muted-foreground":Ai([t.base02],t.base04,G.text),"sidebar-hover-destructive-foreground":Ai([t.base02],t.base08,G.graphical),"sidebar-selected":n,"sidebar-selected-foreground":Ti(n,[t.base00,t.base05,t.base07]),"sidebar-selected-muted-foreground":Ai([n],t.base04,G.text),"sidebar-selected-destructive-foreground":Ai([n],t.base08,G.graphical),"sidebar-border":t.base02,"sidebar-ring":t.base0D,"syntax-keyword":t.base0E,"syntax-tag":t.base08,"syntax-attr":t.base0D,"syntax-string":t.base0B,"syntax-number":t.base09,"syntax-atom":t.base0C,"syntax-comment":t.base03,"syntax-func":t.base0D,"syntax-var":t.base08,"syntax-type":t.base0A,"syntax-operator":t.base05,"syntax-meta":t.base0F,"syntax-bg":t.base01,"link-color":t.base0D,"broken-link-color":o,"lint-warning-color":t.base0A,"lint-error-color":t.base08,"diff-added":t.base0B,"diff-removed":t.base08,"diff-modified":t.base0D,"ok-editor-text":t.base05,"ok-codeblock-title-bg":s,"ok-codeblock-title-foreground":Ai([s],t.base04,G.text),"ok-comment-hue":Vi(t.base00,t.base0D),"ok-find-match":l([Ii]),"ok-find-match-active":Ui(t.base00,t.base05,t.base0D,[Li]),"ok-viewer-find-match":l([Ri,1-.7*.4]),"ok-unresolved-link":o,"ok-table-cell-selected":q(t.base00,t.base0D,Ni),"ok-table-resize-handle":t.base0D,"ok-diff-ins":t.base0B,"ok-diff-del":t.base08,"ok-diff-del-foreground":Hi(t.base00,c,t.base08,Fi),...i,...qi(t)}}var Gi={black:`base00`,red:`base08`,green:`base0B`,yellow:`base0A`,blue:`base0D`,magenta:`base0E`,cyan:`base0C`,white:`base05`,brightBlack:`base03`,brightRed:`base08`,brightGreen:`base0B`,brightYellow:`base0A`,brightBlue:`base0D`,brightMagenta:`base0E`,brightCyan:`base0C`,brightWhite:`base07`},Ki=Object.keys(Gi);function qi(e){let t={};for(let n of Ki)t[`ansi-${Ji(n)}`]=e[Gi[n]];return t}function Ji(e){return e.replace(/([a-z])([A-Z])/g,`$1-$2`).toLowerCase()}function Yi(e){return JSON.stringify(e).replace(/[\u007f-\u009f\u2028\u2029\ufffe\uffff]/g,e=>`\\u${e.charCodeAt(0).toString(16).padStart(4,`0`)}`)}function Xi(e){return`${[`system: "base16"`,`name: ${Yi(e.name)}`,...e.author?[`author: ${Yi(e.author)}`]:[],`variant: ${Yi(e.variant)}`,`palette:`,...vi.map(t=>` ${t}: ${Yi(e.palette[t])}`)].join(`
|
|
108
|
+
`)}\n`}function Zi(e){let t;try{t=_i(e,{schema:`failsafe`})}catch(e){let t=e?.linePos;return{ok:!1,error:{kind:`unparseable`,line:typeof t?.[0]?.line==`number`?t[0].line:void 0}}}if(!t||typeof t!=`object`||Array.isArray(t))return{ok:!1,error:{kind:`not-a-scheme`}};let n=t,r=n.palette,i=r&&typeof r==`object`&&!Array.isArray(r)?r:n,a={},o=[],s=[];for(let e of vi){let t=i[e]??i[e.toLowerCase()];if(t==null){o.push(e);continue}let n=Qi(t);if(!n){s.push(e);continue}a[e]=n}return o.length?{ok:!1,error:{kind:`missing-slots`,slots:o}}:s.length?{ok:!1,error:{kind:`bad-hex`,slots:s}}:typeof n.name==`string`&&!Si(n.name)||typeof n.author==`string`&&!Si(n.author)?{ok:!1,error:{kind:`not-a-scheme`}}:{ok:!0,scheme:{name:typeof n.name==`string`?n.name:`Imported`,author:typeof n.author==`string`?n.author:void 0,variant:n.variant===`light`||n.variant===`dark`?n.variant:$i(a),palette:a}}}function Qi(e){if(typeof e!=`string`)return null;let t=e.trim();return t.startsWith(`#`)||(t=`#${t}`),/^#[0-9a-fA-F]{3}$/.test(t)&&(t=`#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}`),bi.test(t)?t.toLowerCase():null}function q(e,t,n){let r=Ci(e)?e:`#000000`,i=Ci(t)?t:`#000000`,a=Math.min(1,Math.max(0,n)),o=`#`;for(let e=0;e<3;e++){let t=Number.parseInt(r.slice(1+e*2,3+e*2),16),n=Number.parseInt(i.slice(1+e*2,3+e*2),16);o+=Math.round(t+(n-t)*a).toString(16).padStart(2,`0`)}return o}function J(e){let t=Ci(e)?e:`#000000`,n=e=>{let n=Number.parseInt(t.slice(1+e*2,3+e*2),16)/255;return n<=.03928?n/12.92:((n+.055)/1.055)**2.4};return .2126*n(0)+.7152*n(1)+.0722*n(2)}function $i(e){return J(e.base00)<J(e.base05)?`dark`:`light`}var ea={defaultKeyType:`PLAIN`,defaultStringType:`PLAIN`,lineWidth:0};function ta(e){if(e.trim()===``)return{doc:new sr({}),map:{}};let t;try{t=gi(e)}catch(e){let t=e instanceof Error?e.message:String(e);return{doc:new sr({}),map:null,parseError:`parse threw: ${t}`}}if(t.errors.length>0)return{doc:t,map:null,parseError:t.errors[0]?.message??`yaml parse errors`};let n;try{n=t.toJS()}catch(e){let n=e instanceof Error?e.message:String(e);return{doc:t,map:null,parseError:`toJS threw: ${n}`}}if(typeof n!=`object`||!n||Array.isArray(n))return{doc:t,map:null,parseError:`top-level value is not a mapping`};let r=_e.safeParse(n);if(!r.success){let e=r.error.issues[0],n=e&&Array.isArray(e.path)?e.path.join(`.`):``,i=e?.message??`unknown`;return{doc:t,map:null,parseError:n?`value at "${n}" failed schema: ${i}`:`schema validation failed: ${i}`}}return{doc:t,map:r.data}}function na(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ra(e,t,n){if(Array.isArray(n)){let r=e.createNode(n),i=Xe(t)?t.flow:void 0;return i!==void 0&&(r.flow=i),r}if(na(n)){let r=e.createNode(n),i=O(t)?t.flow:void 0;return i!==void 0&&(r.flow=i),r}return n}function ia(e){return e===``?``:`---\n${e.endsWith(`
|
|
109
|
+
`)?e.slice(0,-1):e}\n---\n`}function aa(e){let t=e.contents;return typeof t!=`object`||!t||!(`items`in t)?[]:t.items.map(e=>{let t=e.key;return typeof t==`string`?t:t&&typeof t==`object`&&`value`in t&&typeof t.value==`string`?t.value:null}).filter(e=>e!==null)}var oa=/^---[ \t]*\r?\n([\s\S]*?\r?\n)?---[ \t]*(\r?\n|$)/,sa=/^---[ \t]*$/;function ca(e){let t=e.match(oa);return t?{frontmatter:t[0],body:e.slice(t[0].length)}:{frontmatter:``,body:e}}function la(e,t){return e?t===``||/\r?\n$/.test(e)?e+t:e+(e.includes(`\r
|
|
110
|
+
`)?`\r
|
|
111
|
+
`:`
|
|
112
|
+
`)+t:t}function ua(e){if(e===``)return``;let t=e.match(oa);return t?(t[1]??``).replace(/\r?\n$/,``):e}var da=65536;function fa(e){let t=e.match(oa);return t?{fenced:t[0],body:e.slice(t[0].length)}:{fenced:``,body:e}}function pa(e){if(e.trim()===``)return{doc:new sr({}),map:{}};let t;try{t=gi(e,{uniqueKeys:!1})}catch(e){let t=e instanceof Error?e.message:String(e);return{doc:new sr({}),map:null,parseError:`parse threw: ${t}`}}if(t.errors.length>0)return{doc:t,map:null,parseError:t.errors[0]?.message??`yaml parse errors`};let n;try{n=t.toJS()}catch(e){let n=e instanceof Error?e.message:String(e);return{doc:t,map:null,parseError:`toJS threw: ${n}`}}if(typeof n!=`object`||!n||Array.isArray(n))return{doc:t,map:null,parseError:`top-level value is not a mapping`};let r=_e.safeParse(n);if(!r.success){let e=r.error.issues[0],n=e&&Array.isArray(e.path)?e.path.join(`.`):``,i=e?.message??`unknown`;return{doc:t,map:null,parseError:n?`value at "${n}" failed schema: ${i}`:`schema validation failed: ${i}`}}return{doc:t,map:r.data}}function Y(e){return e===``?{doc:new sr({}),map:{}}:pa(ua(e))}function ma(e){let{fenced:t}=fa(e),{map:n,parseError:r}=Y(t);return{map:n??{},parseError:r}}function ha(e){let{fenced:t}=fa(e);if(t===``)return[];let{doc:n,map:r}=Y(t);return r===null?[]:_a(n)}function X(e){return typeof e==`object`&&!!e&&`key`in e}function Z(e){let t=e.key;return typeof t==`string`?t:t&&typeof t==`object`&&`value`in t&&typeof t.value==`string`?t.value:null}function ga(e,t){let n=e.key;if(typeof n==`string`){e.key=t;return}if(n&&typeof n==`object`){n.value=t;return}e.key=t}function _a(e){let t=e.contents;if(!t||!(`items`in t)||!Array.isArray(t.items))return[];let n=[];for(let e of t.items){if(!X(e))continue;let t=Z(e);t!==null&&n.push(t)}return n}function va(e){if(e.contents==null||!(`items`in e.contents)){let t=e.createNode({});return e.contents=t,t}return e.contents}function ya(e){let t=e.contents;return!t||!(`items`in t)||(t.items?.length??0)===0?``:ia(e.toString(ea))}function ba(e){let t=new TextEncoder().encode(e).byteLength;return t>65536?{kind:`region_too_large`,bytes:t,limit:da}:null}function Q(e){let t=ya(e),n=ba(t);return n?{ok:!1,error:n}:{ok:!0,nextFenced:t}}function xa(e,t){if(Object.hasOwn(t,`frontmatter`))return{ok:!1,error:{kind:`reserved_key`,key:ie}};let{doc:n,map:r}=Y(e);if(r===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let i=ve.safeParse(t);if(!i.success)return{ok:!1,error:{kind:`invalid_value`,key:String(i.error.issues[0]?.path[0]??``),reason:i.error.issues[0]?.message??`invalid value`}};try{va(n);for(let[e,t]of Object.entries(i.data)){if(t===null){n.delete(e);continue}n.set(e,ra(n,n.get(e,!0),t))}return Q(n)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function Sa(e,t,n,r={}){if(t===`frontmatter`||n===`frontmatter`)return{ok:!1,error:{kind:`reserved_key`,key:ie}};let{doc:i,map:a}=Y(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};if(t===n)return{ok:!0,nextFenced:e};let o=i.contents;if(!o||!(`items`in o)||!Array.isArray(o.items))return{ok:!1,error:{kind:`unknown_key`,key:t}};let s=o.items.find(e=>X(e)&&Z(e)===t);if(!s)return{ok:!1,error:{kind:`unknown_key`,key:t}};if(!r.allowDuplicate&&o.items.some(e=>X(e)&&e!==s&&Z(e)===n))return{ok:!1,error:{kind:`duplicate_target`,key:n}};try{return ga(s,n),Q(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function Ca(e,t){let{doc:n,map:r}=Y(e);if(r===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let i=n.contents;if(!i||!(`items`in i)||!Array.isArray(i.items))return{ok:!0,nextFenced:e};let a=_a(n);if(a.length!==t.length||!wa(a,t))return{ok:!1,error:{kind:`reorder_mismatch`,expected:a,got:[...t]}};try{let e=i.items.filter(X),r=[];for(let n of t){let i=e.findIndex(e=>Z(e)===n);if(i===-1)return{ok:!1,error:{kind:`reorder_mismatch`,expected:a,got:[...t]}};let[o]=e.splice(i,1);o&&r.push(o)}return i.items=r,Q(n)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function wa(e,t){let n=new Map;for(let t of e)n.set(t,(n.get(t)??0)+1);for(let e of t){let t=(n.get(e)??0)-1;if(t<0)return!1;n.set(e,t)}for(let e of n.values())if(e!==0)return!1;return!0}function Ta(e){if(e.length===0)return{kind:`invalid_path`,path:[...e],reason:`path must have at least one segment`};for(let t=0;t<e.length;t++){let n=e[t];if(typeof n!=`string`&&typeof n!=`number`)return{kind:`invalid_path`,path:[...e],reason:`path segment at index ${t} must be string or number`};if(typeof n==`number`&&(!Number.isInteger(n)||n<0))return{kind:`invalid_path`,path:[...e],reason:`numeric path segment at index ${t} must be a non-negative integer`}}return e[0]===`frontmatter`?{kind:`reserved_key`,key:ie}:null}function Ea(e,t,n){let r=Ta(t);if(r)return{ok:!1,error:r};let{doc:i,map:a}=Y(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let o=C.safeParse(n);if(!o.success)return{ok:!1,error:{kind:`invalid_value`,key:String(t[t.length-1]),reason:o.error.issues[0]?.message??`invalid value`}};try{return va(i),i.setIn(t,ra(i,i.getIn(t,!0),o.data)),Q(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function Da(e,t){let n=Ta(t);if(n)return{ok:!1,error:n};let{doc:r,map:i}=Y(e);if(i===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};try{return r.getIn(t,!0)===void 0?{ok:!0,nextFenced:e}:(r.deleteIn(t),Q(r))}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function Oa(e,t){if(t.length===0){let t=e.contents;return O(t)?t:null}let n=e.getIn(t,!0);return O(n)?n:null}function ka(e,t,n,r={}){let i=Ta(t);if(i)return{ok:!1,error:i};let a=t[t.length-1];if(typeof a!=`string`)return{ok:!1,error:{kind:`invalid_path`,path:[...t],reason:`cannot rename: last path segment must be a string (map key)`}};if(t.length===1&&n===`frontmatter`)return{ok:!1,error:{kind:`reserved_key`,key:ie}};let{doc:o,map:s}=Y(e);if(s===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};if(a===n)return{ok:!0,nextFenced:e};let c=Oa(o,t.slice(0,-1));if(!c)return{ok:!1,error:{kind:`unknown_key`,key:a}};let l=c.items.find(e=>X(e)&&Z(e)===a);if(!l)return{ok:!1,error:{kind:`unknown_key`,key:a}};if(!r.allowDuplicate&&c.items.some(e=>X(e)&&e!==l&&Z(e)===n))return{ok:!1,error:{kind:`duplicate_target`,key:n}};try{return ga(l,n),Q(o)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function Aa(e,t,n){if(t.length===0)return Ca(e,n);let r=Ta(t);if(r)return{ok:!1,error:r};let{doc:i,map:a}=Y(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let o=i.getIn(t,!0);if(!O(o))return{ok:!1,error:{kind:`invalid_path`,path:[...t],reason:`cannot reorder: target is not a map`}};let s=[];for(let e of o.items){if(!X(e))continue;let t=Z(e);t!==null&&s.push(t)}if(s.length!==n.length||!wa(s,n))return{ok:!1,error:{kind:`reorder_mismatch`,expected:s,got:[...n]}};try{let e=o.items.filter(X),t=[];for(let r of n){let i=e.findIndex(e=>Z(e)===r);if(i===-1)return{ok:!1,error:{kind:`reorder_mismatch`,expected:s,got:[...n]}};let[a]=e.splice(i,1);a&&t.push(a)}return o.items=t,Q(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function ja(e,t,n){let r=Ta(t);if(r)return{ok:!1,error:r};let{doc:i,map:a}=Y(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let o=i.getIn(t,!0);if(!Xe(o))return{ok:!1,error:{kind:`invalid_path`,path:[...t],reason:`cannot reorder: target is not a sequence`}};let s=o,c=s.items.length,l=Array.from({length:c},(e,t)=>t),u=[...n];if(!Ma(u,c))return{ok:!1,error:{kind:`reorder_mismatch`,expected:l.map(String),got:u.map(String)}};try{let e=s.items.slice();return s.items=u.map(t=>e[t]),Q(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function Ma(e,t){if(e.length!==t)return!1;let n=Array(t).fill(!1);for(let r of e){if(!Number.isInteger(r)||r<0||r>=t||n[r])return!1;n[r]=!0}return!0}var Na=s({changes:a(l(`kind`,[s({key:f(),kind:d(`added`),after:C}).loose(),s({key:f(),kind:d(`removed`),before:C}).loose(),s({key:f(),kind:d(`changed`),before:C,after:C}).loose()])),unparseable:s({before:f(),after:f()}).loose().nullable()}).loose();function Pa(e){let{fenced:t}=fa(e),n=Y(t);if(n.map===null)return{fenced:t,map:{},keys:[],parseError:n.parseError};let r=aa(n.doc);return{fenced:t,map:n.map,keys:r.length>0?r:Object.keys(n.map),parseError:void 0}}function Fa(e,t){let n=Pa(e),r=Pa(t);if(n.parseError!==void 0||r.parseError!==void 0)return{changes:[],unparseable:{before:n.fenced,after:r.fenced}};let i=[],a=new Set;for(let e of r.keys){if(a.has(e))continue;a.add(e);let t=r.map[e];if(t===void 0)continue;let o=n.map[e];if(o===void 0){i.push({key:e,kind:`added`,after:t});continue}be(o,t)||i.push({key:e,kind:`changed`,before:o,after:t})}for(let e of n.keys){if(a.has(e))continue;a.add(e);let t=n.map[e];t!==void 0&&i.push({key:e,kind:`removed`,before:t})}return{changes:i,unparseable:null}}var Ia=s({alwaysOn:n().int().nonnegative(),onTrigger:n().int().nonnegative(),onDemand:n().int().nonnegative()}).strict(),La=[`.md`,`.mdx`,`.txt`],Ra=5e3,za=4;function Ba(e){return Math.round(e/za)}function Va(e){let t=e.lastIndexOf(`.`);return t===-1?!1:La.includes(e.slice(t).toLowerCase())}function Ha(e){let t=Ba((e.name??``).length+(e.description??``).length),n=Ba(ca(e.skillMd).body.length),r=e.files.some(e=>e.relPath===`overlay.yaml`),i=0;for(let t of e.files)t.content!==null&&t.relPath!==`SKILL.md`&&(r&&t.relPath.startsWith(`upstream/`)||Va(t.relPath)&&(i+=t.content.length));return{alwaysOn:t,onTrigger:n,onDemand:Ba(i)}}s({intents:a(s({satisfierId:f().min(1),desired:u([`present`,`absent`])}).loose()),...h,summary:_}).loose();var Ua=s({satisfierId:f(),agentId:f(),piece:f(),scope:f(),kind:f(),pathId:f().optional(),desired:u([`present`,`absent`]),action:u(He),errorId:f().optional()}).loose(),Wa=s({kind:f(),satisfierIds:a(f()),agentIds:a(f()),pathId:f().optional(),blockedReason:f().optional()}).loose(),Ga=s({state:f(),strictness:a(u(Re)).optional()}).loose(),Ka=s({probes:s({env:u([`desktop`,`local-web`,`remote-web`]),satisfiers:r(f(),Ga)}).loose(),detection:s({detected:a(f()),probed:e()}).loose()}).loose(),qa=s({actions:a(Ua),conflicts:a(Wa),withheld:a(f()),snapshot:Ka}).loose();s({entries:a(s({level:u([`info`,`warn`,`error`]),message:f().max(te),event:f().optional(),fields:r(f(),t()).optional(),ts:n().optional(),sourceId:f().optional(),lineNumber:n().optional()}).loose()).max(100),droppedSinceLastFlush:n().int().min(0).optional()}).loose(),s({accepted:n().int().min(0)}).loose();var Ja=s({exact:f().min(1),prefix:f(),suffix:f(),start:n().int().nonnegative(),end:n().int().nonnegative()}),Ya=a(p([f(),n().int().nonnegative()])),Xa=l(`kind`,[s({kind:d(`body`)}),s({kind:d(`property`),key:f().min(1),path:Ya.default([])})]).default({kind:`body`}),Za=u([`anchored`,`orphaned`,`resolved`]),Qa=s({threadId:f().min(1),docName:f().min(1),target:Xa,anchor:Ja.nullable(),state:Za,queued:e(),latestComment:f(),createdBy:f().min(1),createdAt:n(),updatedAt:n().optional()}),$a=s({docName:f(),instruction:f(),property:f().nullable(),passage:s({exact:f(),prefix:f(),suffix:f()}).nullable(),anchorLost:e(),passageRepeats:e()}).loose(),eo=s({threadId:f(),ok:d(!0)}),to=s({threadId:f(),ok:d(!1),error:d(`not-found`)});s({threads:a(Qa)}).loose();var no=s({meta:Qa,orphaned:e()}).loose(),ro=s({threadId:f()}).loose();s({meta:Qa,payload:$a}).loose();var io=s({results:a(p([eo.extend({meta:Qa,payload:$a}),to]))}).loose(),ao=s({results:a(p([eo.extend({meta:Qa}),to]))}).loose(),oo=[`ours`,`theirs`],so=[`check-failed`,`too-large`,`conflict-markers`,`no-base`,`no-merge-engine`,`outside-settings-applied`,`outside-settings-invalid`],co=[`no-history-or-backup`,`keeps-changing`,`not-utf8`,`unreadable`],lo=s({duplicated:n().int().nonnegative(),restoredDeletedHere:n().int().nonnegative(),restoredDeletedOutside:n().int().nonnegative()}),uo={id:f().min(1),docName:f().min(1),file:f().min(1),firstAt:f().min(1),lastAt:f().min(1),events:n().int().positive(),entries:a(f().min(1))},fo=s({notices:a(l(`kind`,[s({...uo,kind:d(`both-kept`),kept:lo}).loose(),s({...uo,kind:d(`moved-to-history`),side:u(oo),reason:u(so)}).loose(),s({...uo,kind:d(`moved-to-backup`),side:u(oo),reason:u(so),backup:f().min(1)}).loose(),s({...uo,kind:d(`save-held`),cause:u(co)}).loose()]))}).loose();s({docName:f().min(1),id:f().min(1)}).loose();var po=s({dismissed:e()}).loose(),mo=s({status:f().min(1),reason:f()}).loose(),ho=s({docName:f().min(1),content:f(),lifecycle:mo.nullable()}).loose(),go=s({kind:u([`document`,`asset`,`folder`,`file`]).default(`document`),docName:f().min(1).optional(),docExt:f().min(1).default(`.md`),size:n().int().nonnegative(),modified:f().min(1),isSymlink:e().default(!1),canonicalDocName:f().nullable().default(null),targetPath:f().nullable().default(null),path:f().min(1).optional(),assetExt:f().min(1).optional(),mediaKind:u([`image`,`video`,`audio`,`pdf`,`text`,`mermaid`,`excalidraw`]).nullable().optional(),referencedBy:a(f().min(1)).optional(),hasChildren:e().optional()}).loose().refine(e=>e.kind===`document`?e.docName!==void 0&&e.path===void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0&&e.hasChildren===void 0:e.kind===`folder`?e.docName===void 0&&e.path!==void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0:e.kind===`file`?e.path!==void 0&&e.mediaKind===void 0&&e.referencedBy===void 0&&e.hasChildren===void 0:e.path!==void 0&&e.assetExt!==void 0&&e.referencedBy!==void 0&&e.hasChildren===void 0,{message:`document/asset/folder/file kind must match its required fields (document → docName; asset → path+assetExt+referencedBy; folder → path only, no docName; file → path, no mediaKind/referencedBy/hasChildren)`}),_o=s({documents:a(go),truncated:e().optional()}).loose(),vo=s({source:f().min(1),anchor:f().nullable(),title:f(),snippet:f().nullable()}).loose(),yo=s({docName:f().min(1),backlinks:a(vo)}).loose(),bo=s({counts:r(f().min(1),n().int().nonnegative())}).loose();s({counts:r(f().min(1),n().int().nonnegative())}).loose();var xo=l(`kind`,[s({kind:d(`doc`),docName:f().min(1),anchor:f().nullable(),title:f(),snippet:f().nullable()}).loose(),s({kind:d(`external`),url:f().min(1),title:f(),snippet:f().nullable()}).loose()]),So=s({role:f().min(1),sourceForm:f().min(1),targetKind:f().min(1),href:f(),resolvedTarget:f().nullable(),status:f().min(1),reason:f().nullable(),resolutionMethod:f().min(1),fallbackTarget:f().nullable().default(null),range:s({start:n().int().nonnegative(),end:n().int().nonnegative()}),line:n().int().nonnegative(),column:n().int().nonnegative(),definition:s({label:f(),line:n().int().nonnegative()}).nullable().default(null)}).loose(),Co=s({docName:f().min(1),forwardLinks:a(xo),localTargets:a(So).optional()}).loose(),wo=l(`kind`,[s({id:f().min(1),kind:d(`doc`),docName:f().min(1),anchor:f().nullable(),label:f(),cluster:f().nullable(),category:f().nullable(),tags:a(f()).nullable(),managed:e().optional()}).loose(),s({id:f().min(1),kind:d(`external`),url:f().min(1),label:f()}).loose()]),To=s({source:f().min(1),target:f().min(1)}).loose(),Eo=s({nodes:a(wo),links:a(To)}).loose();s({docNames:a(f().min(1).max(1024)).min(1).max(64)}).loose(),s({checked:n().int().nonnegative(),found:n().int().nonnegative()}).loose();var Do=s({ts:n().int().min(0),url:f(),method:f(),ua:f().optional(),origin:f().optional(),referer:f().optional(),host:f().optional(),remote:f().optional(),secChUa:f().optional(),secChUaMobile:f().optional(),secChUaPlatform:f().optional(),secFetchSite:f().optional(),secFetchDest:f().optional(),secFetchMode:f().optional(),secFetchUser:f().optional()}).loose(),Oo=s({app:p([d(`cursor`),d(`codex`),d(`claude`),c()]),signals_fired:a(f())}).loose();s({entries:a(Do),count:n().int().min(0),detection:Oo}).loose();var ko=s({path:f().min(1),code:u([`M`,`A`,`D`,`R`,`C`,`U`,`T`,`?`,`!`,` `]),origPath:f().min(1).optional(),syncScoped:e(),open:l(`kind`,[s({kind:d(`doc`),docName:f().min(1)}),s({kind:d(`asset`),path:f().min(1)})]).optional()}).loose();s({branch:f().nullable(),detached:e(),upstream:f().nullable(),staged:a(ko),notStaged:a(ko),untracked:a(ko),incoming:a(ko),truncated:e(),readable:e().default(!0)}).loose();var Ao=u([`AWAITING_CHECKS`,`LOCKED`,`MERGEABLE`,`QUEUED`,`UNMERGEABLE`]),jo=u([`BEHIND`,`BLOCKED`,`CLEAN`,`DIRTY`,`DRAFT`,`HAS_HOOKS`,`UNKNOWN`,`UNSTABLE`]),Mo=u([`APPROVED`,`CHANGES_REQUESTED`,`REVIEW_REQUIRED`]),No=u([`ERROR`,`EXPECTED`,`FAILURE`,`PENDING`,`SUCCESS`]),Po=s({mergeQueue:s({position:n().int().nonnegative(),state:Ao.nullable().catch(null)}).nullable().catch(null),autoMerge:e(),mergeState:jo.nullable().catch(null),reviewDecision:Mo.nullable().catch(null),checks:No.nullable().catch(null)}).loose(),Fo=s({kind:u([`pull`,`issue`]),repo:f().min(1),number:n().int().positive(),title:f(),author:f().nullable(),createdAt:f(),lifecycle:u([`open`,`draft`,`merged`,`closed`,`completed`,`not-planned`]),additions:n().int().nonnegative().optional(),deletions:n().int().nonnegative().optional(),status:Po.optional()}).loose();s({url:f()}).loose();var Io=l(`ok`,[s({ok:d(!0),preview:Fo}).loose(),s({ok:d(!1),reason:f()}).loose()]);s({writers:a(s({id:f().min(1),name:f().optional(),email:f().optional()}).loose()).optional(),summary:_,...h}).loose(),s({checkpointRef:f().min(1)}).loose();var Lo=s({v:n().int().optional(),id:f().min(1),name:f().min(1),colorSeed:f().optional(),docs:a(f()),summaries:a(f()).optional()}).loose();s({entries:a(s({sha:f().min(1),timestamp:f().min(1),author:f(),authorEmail:f(),type:u([`checkpoint`,`wip`,`upstream`,`park`]),message:f(),contributors:a(Lo),checkpoint:t().nullable(),parentSha:f().nullable().optional()}).loose()),total:n().int().nonnegative().optional(),truncated:e().optional(),hasMore:e().optional()}).loose(),s({sha:f().regex(/^[0-9a-f]{40}$/i),content:f(),timestamp:f(),author:f()}).loose();var Ro=s({contentDir:f().min(1),pathSeparator:u([`/`,`\\`]),symlinkResolved:e()}).loose();a(l(`source`,[s({docName:f().min(1),timestamp:f().min(1),size:n().int().nonnegative(),source:d(`flat`)}).loose(),s({docName:f().min(1),timestamp:f().min(1),source:d(`timeline`),sha:f().min(1)}).loose()])).meta({description:"Flat array of rescue buffer entries; discriminated via `source`."});var zo=s({domain:f().min(1),title:f().optional(),description:f().optional(),siteName:f().optional(),faviconDataUri:f().optional()}).loose();s({url:f()}).loose();var Bo=l(`ok`,[s({ok:d(!0),metadata:zo}).loose(),s({ok:d(!1),reason:f()}).loose()]),Vo=s({orphans:a(s({docName:f().min(1),title:f()}).loose())}).loose(),Ho=s({hubs:a(s({docName:f().min(1),title:f(),count:n().int().nonnegative()}).loose())}).loose(),Uo=s({source:f().min(1),title:f(),snippet:f().nullable()}).loose();s({deadLinks:a(s({target:f().min(1),sources:a(Uo)}).loose())}).loose(),s({target:s({docName:f().min(1),title:f(),aliases:a(f())}).loose(),mentions:a(s({source:f().min(1),excerpt:f(),offset:n().int().nonnegative()}).loose()),truncated:e()}).loose(),s({projectPath:f().min(1)}).loose();var Wo=u([`not-a-git-worktree`,`init-failed`]);l(`ok`,[s({ok:d(!0),projectPath:f().min(1)}).loose(),s({ok:d(!1),reason:Wo,message:f().min(1)}).loose()]),s({host:f().min(1).optional()}).loose(),s({host:f().min(1).optional(),token:f().min(1)}).loose(),s({host:f(),login:f()}).loose(),s({host:f().refine(ee,{message:`Host must be a hostname with an optional :port, with no scheme or path`}),username:f().min(1),token:f().min(1)}).loose(),s({host:f(),login:f()}).loose(),s({key:f().min(1)}).loose(),s({keyPresent:e()}).loose();var Go=u([`index_invalid`,`migration_conflict`,`native_access`,`lock_timeout`,`file_access`,`timeout`]),Ko=u([`no_key`,`credential_store`,`invalid_endpoint`,`rate_limit`,`timeout`,`http_error`,`network`,`dims_mismatch`,`malformed_response`]),qo=l(`ok`,[s({ok:d(!0),endpoint:f().min(1),model:f().min(1),dimensions:n().int().positive()}).loose(),s({ok:d(!1),endpoint:f().min(1),model:f().min(1),reason:Ko,keyStoreError:Go.optional().catch(void 0),status:n().int().optional()}).loose()]);s({name:f().refine(e=>e.trim().length>0,{message:`name must be non-empty`}),email:f().refine(e=>e.trim().length>0,{message:`email must be non-empty`})}).loose(),s({authenticated:e()}).loose(),s({channel:u([`login`,`gh-login`]).default(`login`)}).loose(),s({}).loose();var Jo=s({stackIndex:n().int().min(0),ts:n().int().min(0),additions:n().int().min(0),deletions:n().int().min(0)}).loose(),Yo=s({docName:f().min(1),additionsTotal:n().int().min(0),deletionsTotal:n().int().min(0),lastTs:n().int().min(0),bursts:a(Jo)}).loose(),Xo=s({displayName:f().min(1),color:f().min(1),icon:f().optional(),connectionId:f().min(1)}).loose(),Zo=s({sessionAlive:e(),agent:Xo.nullable(),files:a(Yo)}).loose(),Qo=s({diff:f(),before:f(),after:f(),properties:Na,generatedAt:n().int().min(0)}).loose();s({}).loose(),s({}).loose(),s({}).loose(),s({}).loose(),s({}).loose(),s({}).loose();var $o=s({displayName:f().min(1),icon:f(),color:f().min(1),currentDoc:f().nullable(),mode:u([`idle`,`writing`]),ts:n().int().min(0)}).loose();s({presence:r(f().min(1),$o)}).loose();var es=s({sessionId:f().min(1),agentType:f().min(1),ts:n().int().min(0),insertedChars:n().int().min(0),deletedChars:n().int().min(0)}).loose();s({effects:a(s({"doc.name":f().min(1),entries:a(es)}).loose())}).loose(),s({decisions:a(s({ts:n().int().min(0),decision:f().min(1),kind:f().min(1),"doc.name":f().min(1),pathRole:f().min(1)}).loose())}).loose(),r(f().min(1),e()).meta({description:`Flat boolean record keyed by agent-scheme name (claude / codex / cursor). True = installed.`}),s({path:f().min(1,`path must be non-empty`)}).loose(),s({}).loose();var ts=s({fromDocName:f().min(1),toDocName:f().min(1)}).loose(),ns=s({fromPath:f().min(1),toPath:f().min(1)}).loose();s({}).loose(),s({path:f().min(1),...h,summary:_}).loose();var rs=s({docName:f().min(1)}).loose();s({path:f().min(1),...h,summary:_}).loose();var is=s({path:f().min(1)}).loose();s({kind:u([`file`,`folder`]),path:f().min(1),...h,summary:_}).loose();var as=s({kind:u([`file`,`folder`]),path:f().min(1),duplicatedDocNames:a(f().min(1))}).loose(),os=s({pages:a(s({docName:f().min(1),title:f(),docExt:f().min(1),size:n().int().nonnegative(),modified:f().min(1),icon:f().min(1).max(2048).optional()}).loose())}).loose(),ss=s({level:n().int().min(1).max(6),text:f(),slug:f()}).loose(),cs=s({docName:f().min(1),headings:a(ss)}).loose(),ls=s({docName:f().min(1),rewrites:n().int().nonnegative()}).loose();s({kind:u([`file`,`folder`,`asset`]),fromPath:f().min(1),toPath:f().min(1),...h,summary:_}).loose();var us=s({renamed:a(ts),renamedAssets:a(ns),rewrittenDocs:a(ls).optional(),summary:xe.optional()}).loose();s({kind:u([`file`,`folder`,`asset`]),path:f().min(1),...h}).loose();var ds=s({deletedDocNames:a(f().min(1))}).loose();s({kind:u([`file`,`folder`,`asset`]),path:f().min(1),...h,summary:_}).loose();var fs=s({deletedDocNames:a(f().min(1))}).loose();s({docName:f().min(1),commitSha:f().regex(/^[0-9a-f]{40}$/i,{message:`commitSha must be a 40-char git SHA`}),summary:_,...h}).loose(),s({...w,restoredFrom:f().min(1),timestamp:f().min(1),summary:xe.optional(),warnings:Oe.optional()}).loose();var ps=/^#[0-9a-fA-F]{6}$/,ms=s(Object.fromEntries(vi.map(e=>[e,f().regex(ps,`must be a #rrggbb hex color`)]))),hs=f().min(1).refine(Si,{message:`must contain a non-whitespace character`}),gs=s({name:hs,author:hs.optional(),variant:u([`dark`,`light`]),palette:ms}).loose(),_s=s({name:f().min(1),scheme:gs,stem:f().min(1).optional(),extension:u([`.yaml`,`.yml`]).optional()}).loose(),vs=s({id:f().min(1),filename:f().min(1)}).loose(),ys=s({id:f().min(1),scheme:gs}).loose(),bs=s({id:f().min(1),filename:f().min(1)}).loose(),xs=l(`existed`,[s({existed:d(!1)}).loose(),s({existed:d(!0),filename:f().min(1),scheme:gs}).loose()]),Ss=s({themes:a(l(`ok`,[s({ok:d(!0),id:f().min(1),filename:f().min(1),scheme:gs}),s({ok:d(!1),filename:f().min(1),id:f().min(1).optional(),code:f().min(1),conflictingFilenames:a(f().min(1)).min(2).optional()})])),truncated:e()}).loose();function Cs(e){return e.replace(/\\/g,`/`).split(`/`).filter(e=>e!==``&&e!==`.`)}function ws(e){let t=Cs(e).at(-1);return t!==void 0&&S.some(e=>t.toLowerCase().endsWith(e))}s({tags:a(s({name:f().min(1),count:n().int().nonnegative(),isLeaf:e()}).loose())}).loose();var Ts=s({docName:f().min(1),title:f(),matchingTags:a(f().min(1)),snippet:f().nullable()}).loose();s({name:f().min(1),docs:a(Ts)}).loose(),s({folder:t(),frontmatter_local:r(f(),t()).nullable(),warnings:a(f()).optional().meta({description:"Non-fatal degradations of this response, one per entry; the field each affects is absent, null, or incomplete — the aligned `warningCodes` entry names which field and how."}),warningCodes:a(u([`symlink-refused`,`malformed-yaml`,`unverifiable`,`templates-symlink-refused`,`templates-unverifiable`])).optional().meta({description:"Machine-readable codes aligned 1:1 with `warnings`; switch on these, never on the English. `symlink-refused` / `malformed-yaml` / `unverifiable`: this folder's own `.ok/frontmatter.yml` (a symlink, malformed YAML, or an lstat failure) — `frontmatter_local` is null. `templates-symlink-refused` / `templates-unverifiable`: the `.ok/templates` directory on this folder, or a `.ok` or `.ok/templates` directory on an ancestor it inherits from — a symlink (wherever it points, dangling included), or a non-ENOTDIR `lstat` failure — `folder.templates_available` omits that directory's templates and may still list others. A non-directory `.ok` / `.ok/templates` (ENOTDIR) is treated as empty and yields no `templates-*` code. This folder's own symlinked `.ok` is a 400, never a warning."})}).loose(),s({path:f(),frontmatter:de(t()).optional()}).loose(),s({applied:t()}).loose();var Es=r(f(),t()).meta({description:`Free-form frontmatter map embedded in template payloads.`});s({template:s({name:f().min(1),folder:f(),scope:u([`local`,`inherited`]),path:f().min(1),frontmatter:Es,body:f()}).strict()}).strict();var Ds=s({templates:a(s({name:f().min(1),title:f().optional(),description:f().optional(),path:f().min(1),source_folder:f()}).strict()),truncated:e()}).strict();s({folder:f(),name:f(),body:b.optional(),frontmatter:Es.optional(),...h,summary:_}).strict(),s({...w,path:f().min(1),created:e(),warnings:a(f())}).strict(),s({sourcePath:f().min(1),targetFolder:f(),name:f().optional(),title:f().optional(),deleteSource:e().optional(),...h,summary:_}).strict(),s({...w,path:f().min(1),created:e(),warnings:a(f())}).strict(),s({existed:e(),path:f().min(1)}).strict(),s({fromFolder:f(),fromName:f(),toFolder:f(),toName:f(),body:b.optional(),frontmatter:Es.optional(),...h,summary:_}).strict(),s({from:f().min(1),to:f().min(1),committed:e()}).strict();var $=u(m),Os=/^[a-z0-9-]+$/,ks=/^(?:(?!\p{DI})[\p{L}\p{M}\p{N}_-])+$/u;function As(e){return e.normalize(`NFC`)}function js(e,t){let n=t.trim();if(n===e)return null;let r=As(n);return r===e?null:r}var Ms=s({name:f(),description:f(),metadata:s({pack:f()}).strict().optional()}).strict();s({skill:s({name:f().min(1),scope:$,path:f().min(1),frontmatter:Ms,body:f(),files:a(s({path:f().min(1),text:f().nullable()})).optional(),managed:e().optional()}).strict()}).strict();var Ns=s({source:f().min(1),publisher:f().optional(),skill:f().optional(),marketplaceUrl:f().optional(),importedAt:f().min(1),autoUpdate:e().optional()}).strict(),Ps=s({name:f().min(1),description:f().optional(),scope:$,path:f().min(1),canonicalPath:f().min(1).optional(),filePaths:a(f()).optional(),absolutePath:f().min(1).optional(),installed:e(),hosts:a(f()),hostQualifier:f().optional().meta({description:"Set on a GLOBAL entry that shares its name with a distinct-content bundle in another host dir AND is not the by-name default: the host id whose root holds THIS bundle. Doc-name builders append it (`__skill__/global/<name>@<host>`) so each same-named bundle keeps its own tab and its own write-back path; the default bundle keeps the stable unqualified name."}),driftPaths:a(f()).optional().meta({description:`Recorded locations whose on-disk form (copy vs symlink) no longer matches what OK last wrote there — evidence another tool rewrote the path.`}),hostAliases:r(f(),f()).optional().meta({description:`Host skills roots that are symlink ALIASES of another location (host id → base-relative target root). An aliased folder is a derived view — no menu row, never a write target; the host's icon rides the target root's row.`}),conflictHosts:a(f()).optional().meta({description:`Hosts whose dir holds a DIFFERENT same-name skill (fork/conflict) — occupied, not this skill.`}),symlinkedHosts:a(f()).optional(),installableEditors:a(f()).optional(),hubOffered:e().optional().meta({description:"Whether the vendor-neutral `.agents/skills` hub is a live destination at this scope on THIS machine — server-computed via the same predicate that filters the Folders surface, so the install menu and Settings cannot disagree. True when the project already uses the hub OR a host that reads it is installed (`HUB_READER_EDITORS`)."}),linkMode:e().optional(),customPlacements:a(s({path:f(),mode:u([`copy`,`link`])}).strict()).optional(),plugin:s({name:f().min(1),marketplace:f().min(1),provider:f().min(1),url:f().optional()}).strict().optional(),managed:e().optional(),origin:Ns.optional(),pack:f().optional(),modified:e().optional(),revertable:e().optional(),ignored:e().optional(),size:Ia.optional()}).strict();s({name:f().min(1),scope:$,apply:e().optional()}).strict(),s({line:f().min(1),gitignorePath:f().min(1),applied:e(),alreadyTracked:e().optional()}).strict();var Fs=s({skills:a(Ps),truncated:e()}).strict();s({scope:$.default(`project`),name:f().meta({description:`Managed skill name to create or update.`}),body:b.optional(),frontmatter:Ms,...h,summary:_}).strict();var Is=a(u([`skill-name-vendor-word`,`skill-body-too-long`])).meta({description:"Machine-readable codes aligned 1:1 with `warnings` (`warnings[i]` is the display text for `warningCodes[i]`)."});s({...w,path:f().min(1),created:e(),warnings:a(f()),warningCodes:Is}).strict(),s({scope:$.default(`project`),name:f(),dryRun:e().optional(),setAutoUpdate:e().optional(),...h,summary:_}).strict(),s({name:f().min(1),updated:e(),source:f().min(1),localBody:f().optional(),upstreamBody:f().optional(),gitTracked:e().optional(),warnings:a(f()),warningCodes:Is}).strict(),s({scope:$.default(`project`),name:f(),...h,summary:_}).strict(),s({name:f().min(1),baselineRef:f().min(1),restoredFiles:a(f()),warnings:a(f())}).strict();var Ls=`This member also carries the one bookkeeping failure that does not undo the operation: the content change landed, but a state file this server keeps beside it refused to be rewritten because it could not be read, so the install or import records still describe the old state until an operator repairs that file. Absent when there is nothing to report; a server that predates this member omits it, so treat its absence as no warning rather than as an error.`;s({existed:e(),path:f().min(1),warnings:a(f()).optional().meta({description:`Present when this delete removed a directory a retention record ties to a recovery copy an earlier failed move kept, whose source was never verified unchanged — either because this server verified the deleted directory against the copy that record describes, or because it could not read the directory and so could not confirm either way. Each entry says which of the two it is; neither claims more than the check established. ${Ls}`})}).strict(),s({scope:$.default(`project`),fromName:f(),toName:f(),body:b.optional(),frontmatter:Ms.optional(),...h,summary:_}).strict(),s({from:f().min(1),to:f().min(1),committed:e(),warnings:a(f()).optional().meta({description:`Present when the rename itself completed but something beside it did not. ${Ls}`})}).strict(),s({name:f(),toName:f().optional().meta({description:"Name for the skill at the destination scope; defaults to `name`. The SKILL.md `name` frontmatter is rewritten to match."}),fromScope:$,toScope:$,...h,summary:_}).strict();var Rs=[`nothing-written`,`destination-removed`,`destination-stray`,`destination-retained`,`destination-retained-blocking`,`destination-unreadable`,`partially-applied`];function zs(e){return typeof e==`string`&&Rs.includes(e)}var Bs=[`intact`,`lossy`,`unknown`];function Vs(e){return typeof e==`string`&&Bs.includes(e)}var Hs=[`unreadable`,`occupant-unverifiable`];function Us(e){return typeof e==`string`&&Hs.includes(e)}var Ws={"nothing-written":!1,"destination-removed":!1,"destination-stray":!1,"destination-retained":!0,"destination-retained-blocking":!0,"destination-unreadable":!1,"partially-applied":!1};function Gs(e){return Ws[e]}function Ks(e){let t=typeof e==`object`&&e?e:{},n=t.moveState,r=t.sourceState,i=t.retentionLedger;if(n===void 0&&r===void 0&&i===void 0)return{kind:`coherent`};let a=zs(n)?n:void 0,o=Vs(r)?r:void 0,s=Us(i)?i:void 0,c={...a===void 0?{}:{moveState:a},...o===void 0?{}:{sourceState:o},...s===void 0?{}:{retentionLedger:s}};return n!==void 0&&a===void 0||r!==void 0&&o===void 0||i!==void 0&&s===void 0||a===void 0?{kind:`unverified`,...c}:(Gs(a)?o!==void 0&&s===void 0:a===`nothing-written`?o===void 0:o===void 0&&s===void 0)?{kind:`coherent`,...c}:{kind:`unverified`,...c}}var qs=`The server reported warnings in a shape this build does not recognise; treat this result as unverified.`;function Js(e){if(e===void 0)return[];let t=qs;if(!Array.isArray(e))return[t];let n=e.filter(e=>typeof e==`string`);return n.length===e.length?n:[...n,t]}s({scope:$,path:f().optional(),droppedLocations:a(f()).default([]).meta({description:"Locations the skill occupied at the source that were removed and not re-created at the destination: the `agents` hub and custom roots, which projection does not cover. Entries are install location ids, so they can be passed straight back as an install `add` list with `scope` set to the destination scope; custom roots resolve against that scope's base."}),warnings:a(f()).optional().meta({description:`Present when the move itself completed but something beside it did not. ${Ls}`})}).strict().meta({description:"Scope-move result. Rename paths deliberately do not emit authoring warnings, consistent with same-scope rename and duplicate. Content-authoring and import responses carry those warnings and their codes. The Skills Studio client parses `droppedLocations` off the wire but deliberately does not render it yet; how a human is told what was removed is an open product decision."}),s({scope:$,name:f(),toName:f(),...h,summary:_}).strict(),s({name:f().min(1)}).strict(),s({name:f(),home:f().min(1)}).strict(),s({docName:f().min(1)}).strict();var Ys=u([`reference`,`script`,`file`]);s({scope:$.default(`project`),name:f(),path:f().min(1),content:f(),...h,summary:_}).strict().superRefine((e,t)=>{ws(e.path)&&y(e.content,t,[`content`])}),s({...w,path:f().min(1),created:e(),kind:Ys,content:e()}).strict(),s({scope:$.default(`project`),name:f(),from:f().min(1),to:f().min(1),...h,summary:_}).strict(),s({from:f().min(1),to:f().min(1),fromDocName:f().optional(),toDocName:f().optional()}).strict(),s({path:f().min(1),kind:Ys,text:f()}).strict(),s({path:f().min(1),existed:e(),kind:Ys}).strict();var Xs=p([ne,d(`agents`)]),Zs=f().min(1).refine(e=>!e.startsWith(`/`)&&!e.startsWith(`~`)&&!/^[A-Za-z]:/.test(e),{error:`a custom root is base-relative (e.g. ".tim/skills"), not absolute or ~-prefixed`}).refine(e=>e.split(`/`).every(e=>e!==``&&e!==`.`&&e!==`..`),{error:`a custom root may not contain "..", "." or empty path segments`}).refine(e=>e.includes(`/`),{error:`a custom root is a path (e.g. ".tim/skills") — bare editor names are host ids`}),Qs=p([Xs,Zs]);s({scope:$.default(`project`),name:f(),targets:a(Xs).optional().meta({description:'SET-EXACT install targets (editor ids, plus "agents" for the .agents hub — in-place skills only): the COMPLETE resulting host set. Omit to use project-configured editors; pass [] to uninstall everywhere. Stateless callers should prefer `add`/`remove`.'}),add:a(Qs).optional().meta({description:`Locations to ADD the skill to (everything else untouched). Editor ids fan out a managed copy/symlink; a custom root path (".tim/skills") places the bundle there.`}),remove:a(Qs).optional().meta({description:"Locations to REMOVE the skill from (lossless only — a hand-edited fork is refused, never deleted). The source cannot be removed; move it first with `source`."}),mode:u([`copy`,`link`]).optional().meta({description:`"link": one real folder (the source); every other location becomes a symlink to it. "copy": independent real folders, refreshed from the source until hand-edited (a hand-edit forks that copy). Converts existing locations losslessly. Omit to follow the form the skill already uses.`}),source:Qs.optional().meta({description:`Move the skill's REAL folder to this location (the old source becomes a symlink to it — never a removal). Sticky across rescans.`}),linkMode:e().optional(),setSource:f().min(1).optional(),place:s({dir:f().min(1).meta({description:`Project-relative directory the bundle dir is created under (e.g. ".windsurf/skills").`}),mode:u([`copy`,`link`])}).strict().optional(),convert:s({target:Qs.meta({description:`The installed location to convert — an editor id, "agents", or a recorded custom placement path.`}),mode:u([`copy`,`link`]).meta({description:`"link": replace this location with a symlink to the source. "copy": replace it with an independent real folder.`})}).strict().optional(),unplace:s({path:f().min(1).meta({description:`The recorded placement bundle path (e.g. ".windsurf/skills/my-skill").`})}).strict().optional(),...h,summary:_,fork:s({editor:f().min(1),action:u([`align`,`make-source`,`rename`]),toName:f().optional()}).strict().optional()}).strict().refine(e=>!(e.targets!==void 0&&(e.add!==void 0||e.remove!==void 0)),{error:"`targets` is set-exact; `add`/`remove` are additive — use one style per call"}).refine(e=>e.fork===void 0||e.targets===void 0&&e.add===void 0&&e.remove===void 0&&e.source===void 0&&e.setSource===void 0,{error:"`fork` is its own operation — run it in a separate call"}).refine(e=>e.fork?.action!==`rename`||e.fork.toName!==void 0,{error:"`fork.rename` requires `toName`"}).refine(e=>!(e.source!==void 0&&(e.add!==void 0||e.remove!==void 0)),{error:"a `source` move is its own operation — run it in a separate call from `add`/`remove`"}).refine(e=>[e.targets!==void 0||e.add!==void 0||e.remove!==void 0,e.place!==void 0,e.unplace!==void 0,e.convert!==void 0,e.source!==void 0||e.setSource!==void 0,e.fork!==void 0].filter(Boolean).length<=1,{error:"one operation per call — membership (`targets`/`add`/`remove`), `place`, `unplace`, `convert`, `source`, and `fork` are mutually exclusive"}),s({name:f().min(1).meta({description:`Managed skill name installed or uninstalled.`}),hosts:a(f()).meta({description:`Editor ids the skill is projected into after the operation; [] is expected after uninstall.`}),scripts:e().meta({description:`True when the skill ships executable scripts, projected but never run.`}),warnings:a(f()).meta({description:`Non-fatal install/uninstall warnings from target projection.`}),warningCodes:a(u([`no-targets`,`scripts-present`,`name-conflict`,`no-description`,`skill-fork-name-unpatched`,`place-path-invalid`,`place-fork-refused`,`links-not-permitted`])).meta({description:"Machine-readable warning codes aligned with `warnings`."}),placedAt:f().optional(),sourceMovedTo:f().optional()}).strict(),s({scope:$.default(`project`),name:f().meta({description:`Managed skill name to uninstall without deleting source.`})}).strict(),s({name:f().min(1).meta({description:`Managed skill name requested for uninstall.`}),uninstalled:e().meta({description:`True when an install marker existed and was removed; false for an idempotent no-op.`})}).strict();var $s=s({targets:a(re),configured:e(),folders:a(s({scope:$,host:f(),root:f(),state:u([`own`,`linked`,`linked-parent`,`absent`]),target:f().optional(),drift:d(!0).optional(),expected:f().optional()}).strict()).optional()}).strict(),ec=s({action:d(`link`),scope:$,root:f().min(1).meta({description:`The folder to link (e.g. ".codex/skills").`}),target:f().min(1).meta({description:`The root it merges into (e.g. ".agents/skills"). Required.`})}),tc=s({action:d(`unlink`),scope:$,root:f().min(1).meta({description:`The linked folder to materialize back.`}),exclude:a(f().min(1)).optional().meta({description:`Skill names to LEAVE OUT when materializing — the folder keeps every other skill it currently sees (as per-skill links) and stops auto-following the target root.`})}).strict(),nc=s({action:d(`add-root`),scope:$,root:Zs.meta({description:`New custom skills root to declare (base-relative, e.g. ".team/skills").`})}).strict(),rc=l(`action`,[ec.extend({preview:e().optional().meta({description:`Return the merge plan only (moves, drops, removes, conflicts, strays) — nothing is written.`})}).strict(),tc,nc]);l(`action`,[ec.strict(),tc,nc]),s({folderAction:rc}).strict();var ic=s({moves:a(f()),drops:a(f()),removes:a(f()),replaces:a(f()),conflicts:a(f()),strays:a(f())}).strict();s({targets:a(re),reprojected:a(s({name:f(),hosts:a(f())}).strict()),bundleHosts:a(f()),removedFrom:a(f()),folder:s({moved:a(f()),dropped:a(f()),linked:a(f())}).strict().optional(),preview:ic.optional()}).strict(),s({scope:$.default(`project`),name:f(),version:f().regex(/^[0-9a-f]{40}$/i),...h,summary:_}).strict(),s({name:f().min(1),version:f(),restoredFiles:a(f()),warnings:a(f())}).strict(),s({query:f().optional(),intent:u([`autocomplete`,`full_text`,`omnibar`]).optional(),ranking:u([`navigation`,`relevance`]).optional(),scopes:a(u([`page`,`folder`,`content`,`file`])).optional(),scope:f().optional(),limit:n().int().nonnegative().optional(),semantic:e().optional(),source:u([`omnibar`,`mcp`,`http`]).optional()}).loose();var ac=s({kind:u([`page`,`folder`,`content`,`file`]),path:f().min(1),title:f(),score:n(),signals:r(f(),t()),snippet:f().optional()}).loose(),oc=u([`applied`,`no_match`,`warming`,`incapable`,`provider_error`,`restart_required`,`query_too_short`]),sc=u([`warm`,`corpus`,`query`,`dimensions`,`configured_dimensions`]);function cc(e){return e?.providerErrorReason===`dimensions`?`restart_required`:e?.providerErrorReason===`configured_dimensions`?`incapable`:e?.providerError||e?.providerErrorReason?`provider_error`:null}function lc(e){throw Error(`Unhandled SemanticProviderErrorReason variant: ${JSON.stringify(e)}`)}function uc(e,t){let n=e?.providerErrorReason;switch(n){case null:case void 0:return e?.providerError===!0;case`corpus`:return!1;case`query`:return t===`query`;case`warm`:case`dimensions`:case`configured_dimensions`:return!0;default:return lc(n)}}function dc(e){throw Error(`Unhandled SemanticQueryOutcome variant: ${JSON.stringify(e)}`)}var fc=s({capable:e(),applied:e(),outcome:oc,providerErrorReason:sc.nullable().optional().catch(null),coverage:s({embedded:n().int().nonnegative(),total:n().int().nonnegative()})}).loose(),pc=s({enabled:e(),keyPresent:e(),keyStoreUnavailable:e().optional(),keyStoreError:Go.optional().catch(void 0),keyStoredInFile:e().optional(),keyNotRequired:e(),keySource:u([`project`,`file`,`env`]).nullable(),keyHint:f().nullable(),ready:e(),capable:e(),providerError:e().optional(),providerErrorReason:sc.nullable().optional().catch(null),embedded:n().int().nonnegative(),total:n().int().nonnegative()}).loose();function mc(e){return!!(e?.enabled&&(e.keyPresent||e.keyNotRequired))}s({query:f(),intent:u([`autocomplete`,`full_text`,`omnibar`]),results:a(ac),elapsedMs:n().nonnegative(),semantic:fc.optional(),truncated:e().optional(),ready:e().optional()}).loose();var hc=s({version:f().min(1),recordedAt:f().min(1)}).loose();s({currentVersion:f().min(1),targets:r(f(),hc.nullable())}).loose(),s({scope:$.default(`project`),source:f().min(1).meta({description:`External skill source: full skills.sh skill-page URL (https://www.skills.sh/<owner>/<repo>/<skill>, or https://www.skills.sh/site/<hostname>/<skill> for a website catalog), GitHub owner/repo[/subpath], git URL, or local/file path.`}),skill:f().min(1).optional().meta({description:`Specific skill name to import from a multi-skill source.`}),install:e().optional().meta({description:`Pass false to import WITHOUT the default-editor auto-projection (the caller installs explicitly afterwards). Default true.`}),marketplace:e().optional().meta({description:"The source came from a skills.sh listing the user chose (the Explore tab), so the install is reported to skills.sh and counts toward that listing. Off by default: a hand-typed repo must not be announced to skills.sh. Honors the `telemetry.skillInstallReports.enabled` setting and DO_NOT_TRACK."}),...h,summary:_}).strict(),s({scope:$.default(`project`),source:f().min(1).meta({description:`External skill source: full skills.sh skill-page URL, GitHub owner/repo[/subpath], git URL, or local/file path.`}),skills:a(f().min(1)).min(1).max(100).meta({description:`Skill names to import from the source.`}),install:e().optional().meta({description:`Pass false to import WITHOUT the default-editor auto-projection. Default true.`}),marketplace:e().optional().meta({description:"The source came from a skills.sh listing the user chose (a marketplace plugin bundle), so the import is reported to skills.sh as one batched install event and counts toward that listing. Off by default: a hand-typed repo must not be announced to skills.sh. Honors the `telemetry.skillInstallReports.enabled` setting and DO_NOT_TRACK."}),...h,summary:_}).strict(),s({results:a(s({requested:f(),status:u([`imported`,`already-imported`,`not-found`,`failed`]),name:f().optional(),collisionRenamedFrom:f().optional(),warnings:a(f()),warningCodes:Is,error:f().optional()}).loose()),imported:n(),alreadyImported:n(),failed:n()}).loose(),s({scope:$.default(`project`),names:a(f().min(1)).min(1).max(100).meta({description:`Managed skill names to refresh from their recorded upstreams.`}),...h,summary:_}).strict(),s({results:a(s({requested:f(),status:u([`updated`,`up-to-date`,`not-found`,`failed`]),source:f().optional(),warnings:a(f()),warningCodes:Is,error:f().optional()}).loose()),updated:n(),upToDate:n(),failed:n()}).loose();var gc=s({source:f(),ref:f().optional(),contentHash:f(),publisher:f().optional()}).loose();s({name:f().min(1).meta({description:`Managed skill name created or matched.`}),path:f().min(1).meta({description:`Store-relative path to the imported skill source.`}),created:e().meta({description:`True when this request created new source files.`}),alreadyImported:e().meta({description:`True when identical content was already present and no files changed.`}),collisionRenamedFrom:f().optional().meta({description:`Original source name when collision handling renamed the import.`}),provenance:gc,warnings:a(f()).meta({description:`Non-fatal import warnings, such as skipped unsupported files.`}),warningCodes:Is}).loose();export{Js as $,Os as A,Zi as At,ic as B,ze as Bt,qo as C,vi as Ct,io as D,Xi as Dt,os as E,Wi as Et,ys as F,A as Ft,fs as G,De as Gt,Fs as H,Pe as Ht,bs as I,He as It,As as J,ie as Jt,Ro as K,w as Kt,Ss as L,Be as Lt,_s as M,gi as Mt,vs as N,j as Nt,no as O,Ci as Ot,gs as P,O as Pt,Gs as Q,fc as R,Fe as Rt,Bo as S,ta as St,cs as T,Bi as Tt,ks as U,Le as Ut,$s as V,Ue as Vt,Ds as W,Ae as Wt,Ks as X,he as Xt,cc as Y,be as Yt,mc as Z,ye as Zt,as as _,sa as _t,yo as a,da as at,Ho as b,ca as bt,is as c,ka as ct,ro as d,Ea as dt,uc as et,po as f,Sa as ft,ho as g,ma as gt,_o as h,ha as ht,bo as i,Fa as it,xs as j,J as jt,us as k,q as kt,rs as l,ja as lt,go as m,fa as mt,Qo as n,Ra as nt,Qa as o,xa as ot,fo as p,Ca as pt,dc as q,ve as qt,qa as r,Ha as rt,ao as s,Da as st,Zo as t,js as tt,ds as u,Aa as ut,Co as v,oa as vt,Vo as w,yi as wt,Eo as x,ua as xt,Io as y,la as yt,pc as z,Ve as zt};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jt as e}from"./DocumentContext-
|
|
1
|
+
import{jt as e}from"./DocumentContext-Bz1OROnW.js";import{ut as t}from"./CodeMirrorPropInput-B-R29uWw.js";function n(n){let r=e(n.state.selection.content(),n.state.schema);return t().serialize(r).trim()}function r(e){return e.lineCount===1&&e.charLen<100?{kind:`inline`,markdown:e.markdown}:e.surface===`source`&&e.sourceLineStart!==void 0&&e.sourceLineEnd!==void 0?{kind:`lines`,startLine:e.sourceLineStart,endLine:e.sourceLineEnd}:{kind:`anchor`,markdown:e.markdown}}function i(e,t){return e.sourceLineStart!==void 0&&e.sourceLineEnd!==void 0?`${t} (${e.sourceLineStart===e.sourceLineEnd?`${e.sourceLineStart}`:`${e.sourceLineStart}-${e.sourceLineEnd}`})`:e.lineCount>1?`${t} (${e.lineCount} lines)`:`${t} (selection)`}function a(e){let t=e.replace(/\r\n/g,`
|
|
2
2
|
`).split(`
|
|
3
3
|
`),n=[],r=!1;for(let e of t){let t=e.trim();if(/^(```|~~~)/.test(t)){r||n.push(`code`),r=!r;continue}if(r||t===``)continue;if(/^\|.*\|?$/.test(t)&&t.includes(`|`)){n[n.length-1]!==`table`&&n.push(`table`);continue}if(/^<\/?[A-Za-z]/.test(t)){n[n.length-1]!==`component`&&n.push(`component`);continue}let i=t.match(/^#{1,6}\s+(.*)$/);if(i){n.push(i[1]??``);continue}let a=t.match(/^[-*+]\s+(.*)$/);if(a){n.push(`• ${a[1]??``}`);continue}let o=t.match(/^\d+\.\s+(.*)$/);if(o){n.push(`• ${o[1]??``}`);continue}let s=t.match(/^>\s?(.*)$/);if(s){n.push(s[1]??``);continue}n.push(t)}return n.join(` `).replace(/\s+/g,` `).trim()}var o=new Map,s=new Set,c=(e,t)=>`${t}:${e}`;function l(){for(let e of s)e()}function u(e,t){return e.markdown===t.markdown&&e.sourceLineStart===t.sourceLineStart&&e.sourceLineEnd===t.sourceLineEnd}function d(e,t,n){let r=c(e,t);if(n===null){o.delete(r)&&l();return}let i=o.get(r);i&&u(i,n)||(o.set(r,n),l())}function f(e,t){return e===null?null:o.get(c(e,t))??null}function p(e){return s.add(e),()=>{s.delete(e)}}function m(e,t){if(e.state.selection.empty)return null;let r=n(e);return r.trim()?{surface:`wysiwyg`,docName:t,markdown:r,charLen:r.trim().length,lineCount:(r.match(/\n/g)?.length??0)+1}:null}function h(e,t){return e.trim()?{surface:`frontmatter`,docName:t,markdown:e,charLen:e.trim().length,lineCount:(e.match(/\n/g)?.length??0)+1}:null}function g(e,t){let n=[],r=1/0,i=-1;for(let t of e.state.selection.ranges)t.empty||(n.push(e.state.sliceDoc(t.from,t.to)),r=Math.min(r,t.from),i=Math.max(i,t.to));if(n.length===0)return null;let a=n.join(`
|
|
4
4
|
`);if(!a.trim())return null;let o=e.state.doc.lineAt(r).number,s=e.state.doc.lineAt(i).number;return{surface:`source`,docName:t,markdown:a,charLen:a.trim().length,lineCount:s-o+1,sourceLineStart:o,sourceLineEnd:s}}export{h as a,r as c,i,p as l,a as n,g as o,d as r,m as s,f as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./dist-BGzUo_18.js";import{t}from"./dist-C_FzPxEX2.js";import{c as n,s as r}from"./documents-events-C1uYbecE.js";import{$ as i,B as a,H as o,Q as s,X as c}from"./schemas-api-CqmliOdH.js";import{t as l}from"./parse-api-error-CeEVOj25.js";async function u(e){return l(await e.json().catch(()=>null))??`HTTP ${e.status}`}async function d(e,t){try{let n=await fetch(e,t?{signal:t}:void 0);return n.ok?{ok:!0,...await n.json()}:{ok:!1,error:await u(n)}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function f(e,t,n){try{let r=await fetch(e,{method:t,...n===void 0?{}:{headers:{"Content-Type":`application/json`},body:JSON.stringify(n)}});return r.ok?{ok:!0,...await r.json().catch(()=>null)??{}}:{ok:!1,error:await u(r)}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function p(e){let t=e.trim();return t.length<2?{ok:!0,results:[],backend:`skills.sh`,degraded:!1}:d(`/api/skills/search?q=${encodeURIComponent(t)}`)}async function m(e){let t=await f(`/api/seed/install-pack-skill`,`POST`,{packId:e});return t.ok&&n(),t}async function h(){return d(`/api/skills/popular?limit=24`)}async function g(e,n){let r=await d(e?`/api/skills?scope=${e}`:`/api/skills`,n);if(!r.ok)return r;let{ok:i,...a}=r,s=o.safeParse(a);return s.success?{ok:!0,skills:s.data.skills}:{ok:!1,error:t._({id:`iXs0kt`})}}async function _(e){return d(`/api/skills/detail?${new URLSearchParams({source:e.source,name:e.name}).toString()}`)}async function v(e,t){return d(`/api/skills/preview?${new URLSearchParams({source:e.source,name:e.name}).toString()}`,t)}async function y(e,t){return d(`/api/skills/resolve-ref?${new URLSearchParams({ref:e.ref,scope:e.scope,from:e.from}).toString()}`,t)}async function b(e){return d(`/api/skills/publisher?source=${encodeURIComponent(e)}`)}async function x(e,t){return d(`/api/skills/discover?source=${encodeURIComponent(e)}`,t)}async function S(){return d(`/api/skills/installed`)}async function C(e){try{let n=await fetch(`/api/skill/edit-external`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!n.ok)return{ok:!1,error:await u(n)};let r=await n.json().catch(()=>null);return!r||typeof r.docName!=`string`?{ok:!1,error:t._({id:`iBVgIQ`})}:{ok:!0,docName:r.docName}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function w(e){try{let t=await fetch(`/api/skill`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await u(t)};let r=await t.json().catch(()=>null);return n(),{ok:!0,created:r?.created??!1,warnings:r?.warnings??[],...typeof r?.path==`string`?{path:r.path}:{}}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function T(e){try{let r=await fetch(`/api/skill/import`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!r.ok){let e=await r.json().catch(()=>null),t=l(e)??`HTTP ${r.status}`,n=typeof e?.detail==`string`&&/multiple skills/i.test(String(e?.title??``))?String(e.detail).split(`, `).map(e=>e.trim()).filter(Boolean):void 0;return n?{ok:!1,error:t,skills:n}:{ok:!1,error:t}}let i=await r.json().catch(()=>null);return!i||typeof i.name!=`string`?{ok:!1,error:t._({id:`HLoO-Z`})}:(n(),{ok:!0,name:i.name,...typeof i.path==`string`&&i.alreadyImported!==!0?{path:i.path}:{},alreadyImported:i?.alreadyImported??!1,collisionRenamedFrom:i?.collisionRenamedFrom,warnings:i?.warnings??[]})}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function E(e){try{let r=await fetch(`/api/skills/import-bulk`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!r.ok)return{ok:!1,error:await u(r)};let i=await r.json().catch(()=>null);return!i||!Array.isArray(i.results)?{ok:!1,error:t._({id:`HLoO-Z`})}:(n(),{ok:!0,...i})}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function D(e,r){try{let i=await fetch(`/api/skill-upload?scope=${encodeURIComponent(r)}`,{method:`POST`,body:e});if(!i.ok)return{ok:!1,error:await u(i)};let a=await i.json().catch(()=>null);return!a||typeof a.name!=`string`?{ok:!1,error:t._({id:`iodl3p`})}:(n(),{ok:!0,name:a.name,alreadyImported:a?.alreadyImported??!1,collisionRenamedFrom:a?.collisionRenamedFrom,warnings:a?.warnings??[]})}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}function O(e,t){let n=`${e}-copy`;if(!t.has(n))return n;for(let n=2;n<1e3;n+=1){let r=`${e}-copy-${n}`;if(!t.has(r))return r}return`${e}-copy-${t.size+1}`}async function k(e){try{let r=O(e.name,e.existingNames),i=await fetch(`/api/skill/duplicate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({scope:e.scope,name:e.name,toName:r})});if(!i.ok)return{ok:!1,error:await u(i)};let a=await i.json().catch(()=>null);return typeof a?.name==`string`?(n(),{ok:!0,name:a.name}):{ok:!1,error:t._({id:`emMrXQ`})}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}function A(e,t){return`skill-move-retained:${e}:${t}`}function j(e){return`skill-move-retained-batch:${e}`}var M=new Map;function N(t,n){e.dismiss(A(t,n));let r=M.get(t);r===void 0||!r.delete(n)||r.size>0||(M.delete(t),e.dismiss(j(t)))}function P(e){return e.kind===`unverified`?`uncertain`:!(e.moveState!==void 0&&s(e.moveState))&&e.retentionLedger===void 0?`none`:e.retentionLedger===void 0&&e.sourceState===`intact`?`redundant`:`uncertain`}function F(e){let{outcome:n,name:r,toScope:i,scopeLabel:a}=e,o=P(n);if(o===`none`)return;let s=A(i,r);if(n.kind===`unverified`){let e=r;return{description:t._({id:`_HlScO`,values:{scopeLabel:a,names:e}}),id:s,duration:1/0}}return n.retentionLedger===void 0?{description:o===`redundant`?t._({id:`Raayoq`,values:{name:r,scopeLabel:a}}):t._({id:`OMS7Xp`,values:{name:r,scopeLabel:a}}),id:s,duration:1/0}:{description:t._({id:`xW7KK3`,values:{name:r,scopeLabel:a}}),id:s,duration:1/0}}var I=3;function L(e){if(e.length<=I)return e.join(`, `);let n=e.slice(0,I).join(`, `),r=e.length-I;return t._({id:`GesfyX`,values:{shown:n,more:r}})}function ee(e){let{failures:n,moved:r,total:i,toScope:a,scopeLabel:o}=e,s=n.map(e=>({name:e.name,retention:P(e.outcome)})).filter(e=>e.retention!==`none`);if(s.length===0)return;M.set(a,new Set(s.map(e=>e.name)));let c=L(s.map(e=>e.name)),l=s.some(e=>e.retention===`uncertain`)?t._({id:`_HlScO`,values:{scopeLabel:o,names:c}}):t._({id:`eGkfGQ`,values:{scopeLabel:o,names:c}});return{title:t._({id:`RDzxes`,values:{moved:r,total:i,scopeLabel:o}}),description:l,id:j(a),duration:1/0}}function R(e,t){return typeof e!=`object`||!e?void 0:e[t]}function z(e){let t=R(e,`droppedLocations`);return Array.isArray(t)?t.filter(e=>typeof e==`string`):[]}async function B(e){let{name:t,fromScope:i,toScope:a}=e;if(i===a)return{ok:!0,scope:a,droppedLocations:[]};try{let e=await fetch(`/api/skill/move-scope`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({name:t,fromScope:i,toScope:a})}),n=await e.json().catch(()=>null);if(!e.ok)return{ok:!1,error:l(n)??`HTTP ${e.status}`,outcome:c(n),droppedLocations:z(n)};let o=R(n,`path`);return r({name:t,fromScope:i,toScope:a}),N(a,t),{ok:!0,scope:a,...typeof o==`string`?{path:o}:{},droppedLocations:z(n)}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e),outcome:{kind:`coherent`},droppedLocations:[]}}finally{n()}}async function V(e){try{let t=await fetch(`/api/skill/track-in-git`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await u(t)};let r=await t.json().catch(()=>null);return e.apply===!0&&n(),{ok:!0,line:r?.line??``,gitignorePath:r?.gitignorePath??`.gitignore`,applied:r?.applied===!0}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function H(e){try{let t=await fetch(`/api/skill`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await u(t)};let r=await t.json().catch(()=>null);return n(),{ok:!0,committed:r?.committed??!1,...typeof r?.to==`string`?{to:r.to}:{}}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function U(e,t){try{let n=new URLSearchParams({name:t,scope:e}),r=await fetch(`/api/skill?${n.toString()}`);if(!r.ok)return null;let i=await r.json().catch(()=>null);return typeof i?.skill?.path==`string`?i.skill.path:null}catch{return null}}async function W(e,t,r){try{let a=`?name=${encodeURIComponent(t)}&scope=${encodeURIComponent(e)}${r?`&host=${encodeURIComponent(r)}`:``}`,o=await fetch(`/api/skill${a}`,{method:`DELETE`});if(!o.ok)return{ok:!1,error:await u(o)};let s=await o.json().catch(()=>null);return n(),r===void 0&&N(e,t),{ok:!0,existed:s?.existed??!1,warnings:i(R(s,`warnings`))}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function G(e){let t=await f(`/api/skill/install`,`POST`,{scope:e.scope,name:e.name,fork:{editor:e.editor,action:e.action,...e.toName===void 0?{}:{toName:e.toName}}});return t.ok?(n(),{ok:!0}):t}async function K(e){try{let t=await fetch(`/api/skill-file`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await u(t)};let r=await t.json().catch(()=>null);return n(),{ok:!0,path:r?.path??e.path}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function q(e){try{let t=await fetch(`/api/skill-file/rename`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await u(t)};let r=await t.json().catch(()=>null);return n(),{ok:!0,from:r?.from??e.from,to:r?.to??e.to,...r?.fromDocName===void 0?{}:{fromDocName:r.fromDocName},...r?.toDocName===void 0?{}:{toDocName:r.toDocName}}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function J(e){try{let t=new URLSearchParams({scope:e.scope,name:e.name,path:e.path}),r=await fetch(`/api/skill-file?${t.toString()}`,{method:`DELETE`});if(!r.ok)return{ok:!1,error:await u(r)};let i=await r.json().catch(()=>null);return n(),{ok:!0,existed:i?.existed??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function Y(e){try{let t=new URLSearchParams({name:e.name,scope:e.scope,path:e.path,...e.host?{host:e.host}:{}}),n=await fetch(`/api/skill-file?${t.toString()}`,{signal:e.signal});if(!n.ok)return{ok:!1,status:n.status,error:await u(n)};let r=await n.json().catch(()=>null);return typeof r?.text==`string`?{ok:!0,text:r.text}:{ok:!1,status:n.status,error:`HTTP ${n.status}`}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}function X(e,t){return Y({...e,signal:t}).then(e=>e.ok?{ok:!0,text:e.text}:{ok:!1,status:e.status})}async function Z(e){try{let t=await fetch(`/api/skill/install`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await u(t)};let r=await t.json().catch(()=>null);return n(),{ok:!0,hosts:r?.hosts??[],scripts:r?.scripts??!1,warnings:r?.warnings??[],warningCodes:r?.warningCodes??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function Q(e){try{let t=await fetch(`/api/skill/install`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({scope:e.scope,name:e.name,place:{dir:e.dir,mode:e.mode}})});if(!t.ok)return{ok:!1,error:await u(t)};let r=await t.json().catch(()=>null);return n(),{ok:!0,placedAt:r?.placedAt??e.dir}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function $(e){let t=await f(`/api/skill/install`,`POST`,{scope:e.scope,name:e.name,unplace:{path:e.path}});return t.ok?(n(),{ok:!0}):t}async function te(e){let t=await f(`/api/skill/install`,`POST`,{scope:e.scope,name:e.name,setSource:e.target});return t.ok?(n(),{ok:!0}):t}async function ne(e){let t=await f(`/api/skill/install`,`POST`,{scope:e.scope,name:e.name,convert:{target:e.target,mode:e.mode}});return t.ok?(n(),{ok:!0}):t}async function re(e){try{let n=await fetch(`/api/skill-targets`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({folderAction:e})});if(!n.ok)return{ok:!1,error:await u(n)};if(!e.preview)return{ok:!0};let r=await n.json().catch(()=>null),i=typeof r==`object`&&r&&`preview`in r?r.preview:void 0,o=a.safeParse(i);return o.success?{ok:!0,preview:o.data}:{ok:!1,error:t._({id:`iBVgIQ`})}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function ie(e){try{let t=await fetch(`/api/skill/reimport`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await u(t)};let r=await t.json().catch(()=>null);return e.dryRun||n(),{ok:!0,updated:r?.updated??!1,source:r?.source??``,localBody:r?.localBody,upstreamBody:r?.upstreamBody,...r?.gitTracked===void 0?{}:{gitTracked:r.gitTracked},warnings:r?.warnings??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function ae(e){try{let r=await fetch(`/api/skills/reimport-bulk`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!r.ok)return{ok:!1,error:await u(r)};let i=await r.json().catch(()=>null);return!i||!Array.isArray(i.results)?{ok:!1,error:t._({id:`kmPvKZ`})}:(n(),{ok:!0,...i})}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function oe(e){try{let t=await fetch(`/api/skill/revert`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await u(t)};let r=await t.json().catch(()=>null);return n(),{ok:!0,warnings:r?.warnings??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}export{p as A,ie as C,y as D,G as E,$ as F,D as I,K as L,ee as M,F as N,oe as O,V as P,re as S,q as T,g as _,k as a,B as b,b as c,U as d,T as f,S as g,Z as h,x as i,te as j,w as k,_ as l,m,W as n,C as o,E as p,J as r,h as s,ne as t,v as u,X as v,ae as w,Q as x,H as y};
|
|
1
|
+
import{n as e}from"./dist-BGzUo_18.js";import{t}from"./dist-C_FzPxEX2.js";import{c as n,s as r}from"./documents-events-C1uYbecE.js";import{$ as i,B as a,H as o,Q as s,X as c}from"./schemas-api-GCpzPElr.js";import{t as l}from"./parse-api-error-CeEVOj25.js";async function u(e){return l(await e.json().catch(()=>null))??`HTTP ${e.status}`}async function d(e,t){try{let n=await fetch(e,t?{signal:t}:void 0);return n.ok?{ok:!0,...await n.json()}:{ok:!1,error:await u(n)}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function f(e,t,n){try{let r=await fetch(e,{method:t,...n===void 0?{}:{headers:{"Content-Type":`application/json`},body:JSON.stringify(n)}});return r.ok?{ok:!0,...await r.json().catch(()=>null)??{}}:{ok:!1,error:await u(r)}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function p(e){let t=e.trim();return t.length<2?{ok:!0,results:[],backend:`skills.sh`,degraded:!1}:d(`/api/skills/search?q=${encodeURIComponent(t)}`)}async function m(e){let t=await f(`/api/seed/install-pack-skill`,`POST`,{packId:e});return t.ok&&n(),t}async function h(){return d(`/api/skills/popular?limit=24`)}async function g(e,n){let r=await d(e?`/api/skills?scope=${e}`:`/api/skills`,n);if(!r.ok)return r;let{ok:i,...a}=r,s=o.safeParse(a);return s.success?{ok:!0,skills:s.data.skills}:{ok:!1,error:t._({id:`iXs0kt`})}}async function _(e){return d(`/api/skills/detail?${new URLSearchParams({source:e.source,name:e.name}).toString()}`)}async function v(e,t){return d(`/api/skills/preview?${new URLSearchParams({source:e.source,name:e.name}).toString()}`,t)}async function y(e,t){return d(`/api/skills/resolve-ref?${new URLSearchParams({ref:e.ref,scope:e.scope,from:e.from}).toString()}`,t)}async function b(e){return d(`/api/skills/publisher?source=${encodeURIComponent(e)}`)}async function x(e,t){return d(`/api/skills/discover?source=${encodeURIComponent(e)}`,t)}async function S(){return d(`/api/skills/installed`)}async function C(e){try{let n=await fetch(`/api/skill/edit-external`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!n.ok)return{ok:!1,error:await u(n)};let r=await n.json().catch(()=>null);return!r||typeof r.docName!=`string`?{ok:!1,error:t._({id:`iBVgIQ`})}:{ok:!0,docName:r.docName}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function w(e){try{let t=await fetch(`/api/skill`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await u(t)};let r=await t.json().catch(()=>null);return n(),{ok:!0,created:r?.created??!1,warnings:r?.warnings??[],...typeof r?.path==`string`?{path:r.path}:{}}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function T(e){try{let r=await fetch(`/api/skill/import`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!r.ok){let e=await r.json().catch(()=>null),t=l(e)??`HTTP ${r.status}`,n=typeof e?.detail==`string`&&/multiple skills/i.test(String(e?.title??``))?String(e.detail).split(`, `).map(e=>e.trim()).filter(Boolean):void 0;return n?{ok:!1,error:t,skills:n}:{ok:!1,error:t}}let i=await r.json().catch(()=>null);return!i||typeof i.name!=`string`?{ok:!1,error:t._({id:`HLoO-Z`})}:(n(),{ok:!0,name:i.name,...typeof i.path==`string`&&i.alreadyImported!==!0?{path:i.path}:{},alreadyImported:i?.alreadyImported??!1,collisionRenamedFrom:i?.collisionRenamedFrom,warnings:i?.warnings??[]})}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function E(e){try{let r=await fetch(`/api/skills/import-bulk`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!r.ok)return{ok:!1,error:await u(r)};let i=await r.json().catch(()=>null);return!i||!Array.isArray(i.results)?{ok:!1,error:t._({id:`HLoO-Z`})}:(n(),{ok:!0,...i})}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function D(e,r){try{let i=await fetch(`/api/skill-upload?scope=${encodeURIComponent(r)}`,{method:`POST`,body:e});if(!i.ok)return{ok:!1,error:await u(i)};let a=await i.json().catch(()=>null);return!a||typeof a.name!=`string`?{ok:!1,error:t._({id:`iodl3p`})}:(n(),{ok:!0,name:a.name,alreadyImported:a?.alreadyImported??!1,collisionRenamedFrom:a?.collisionRenamedFrom,warnings:a?.warnings??[]})}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}function O(e,t){let n=`${e}-copy`;if(!t.has(n))return n;for(let n=2;n<1e3;n+=1){let r=`${e}-copy-${n}`;if(!t.has(r))return r}return`${e}-copy-${t.size+1}`}async function k(e){try{let r=O(e.name,e.existingNames),i=await fetch(`/api/skill/duplicate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({scope:e.scope,name:e.name,toName:r})});if(!i.ok)return{ok:!1,error:await u(i)};let a=await i.json().catch(()=>null);return typeof a?.name==`string`?(n(),{ok:!0,name:a.name}):{ok:!1,error:t._({id:`emMrXQ`})}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}function A(e,t){return`skill-move-retained:${e}:${t}`}function j(e){return`skill-move-retained-batch:${e}`}var M=new Map;function N(t,n){e.dismiss(A(t,n));let r=M.get(t);r===void 0||!r.delete(n)||r.size>0||(M.delete(t),e.dismiss(j(t)))}function P(e){return e.kind===`unverified`?`uncertain`:!(e.moveState!==void 0&&s(e.moveState))&&e.retentionLedger===void 0?`none`:e.retentionLedger===void 0&&e.sourceState===`intact`?`redundant`:`uncertain`}function F(e){let{outcome:n,name:r,toScope:i,scopeLabel:a}=e,o=P(n);if(o===`none`)return;let s=A(i,r);if(n.kind===`unverified`){let e=r;return{description:t._({id:`_HlScO`,values:{scopeLabel:a,names:e}}),id:s,duration:1/0}}return n.retentionLedger===void 0?{description:o===`redundant`?t._({id:`Raayoq`,values:{name:r,scopeLabel:a}}):t._({id:`OMS7Xp`,values:{name:r,scopeLabel:a}}),id:s,duration:1/0}:{description:t._({id:`xW7KK3`,values:{name:r,scopeLabel:a}}),id:s,duration:1/0}}var I=3;function L(e){if(e.length<=I)return e.join(`, `);let n=e.slice(0,I).join(`, `),r=e.length-I;return t._({id:`GesfyX`,values:{shown:n,more:r}})}function ee(e){let{failures:n,moved:r,total:i,toScope:a,scopeLabel:o}=e,s=n.map(e=>({name:e.name,retention:P(e.outcome)})).filter(e=>e.retention!==`none`);if(s.length===0)return;M.set(a,new Set(s.map(e=>e.name)));let c=L(s.map(e=>e.name)),l=s.some(e=>e.retention===`uncertain`)?t._({id:`_HlScO`,values:{scopeLabel:o,names:c}}):t._({id:`eGkfGQ`,values:{scopeLabel:o,names:c}});return{title:t._({id:`RDzxes`,values:{moved:r,total:i,scopeLabel:o}}),description:l,id:j(a),duration:1/0}}function R(e,t){return typeof e!=`object`||!e?void 0:e[t]}function z(e){let t=R(e,`droppedLocations`);return Array.isArray(t)?t.filter(e=>typeof e==`string`):[]}async function B(e){let{name:t,fromScope:i,toScope:a}=e;if(i===a)return{ok:!0,scope:a,droppedLocations:[]};try{let e=await fetch(`/api/skill/move-scope`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({name:t,fromScope:i,toScope:a})}),n=await e.json().catch(()=>null);if(!e.ok)return{ok:!1,error:l(n)??`HTTP ${e.status}`,outcome:c(n),droppedLocations:z(n)};let o=R(n,`path`);return r({name:t,fromScope:i,toScope:a}),N(a,t),{ok:!0,scope:a,...typeof o==`string`?{path:o}:{},droppedLocations:z(n)}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e),outcome:{kind:`coherent`},droppedLocations:[]}}finally{n()}}async function V(e){try{let t=await fetch(`/api/skill/track-in-git`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await u(t)};let r=await t.json().catch(()=>null);return e.apply===!0&&n(),{ok:!0,line:r?.line??``,gitignorePath:r?.gitignorePath??`.gitignore`,applied:r?.applied===!0}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function H(e){try{let t=await fetch(`/api/skill`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await u(t)};let r=await t.json().catch(()=>null);return n(),{ok:!0,committed:r?.committed??!1,...typeof r?.to==`string`?{to:r.to}:{}}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function U(e,t){try{let n=new URLSearchParams({name:t,scope:e}),r=await fetch(`/api/skill?${n.toString()}`);if(!r.ok)return null;let i=await r.json().catch(()=>null);return typeof i?.skill?.path==`string`?i.skill.path:null}catch{return null}}async function W(e,t,r){try{let a=`?name=${encodeURIComponent(t)}&scope=${encodeURIComponent(e)}${r?`&host=${encodeURIComponent(r)}`:``}`,o=await fetch(`/api/skill${a}`,{method:`DELETE`});if(!o.ok)return{ok:!1,error:await u(o)};let s=await o.json().catch(()=>null);return n(),r===void 0&&N(e,t),{ok:!0,existed:s?.existed??!1,warnings:i(R(s,`warnings`))}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function G(e){let t=await f(`/api/skill/install`,`POST`,{scope:e.scope,name:e.name,fork:{editor:e.editor,action:e.action,...e.toName===void 0?{}:{toName:e.toName}}});return t.ok?(n(),{ok:!0}):t}async function K(e){try{let t=await fetch(`/api/skill-file`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await u(t)};let r=await t.json().catch(()=>null);return n(),{ok:!0,path:r?.path??e.path}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function q(e){try{let t=await fetch(`/api/skill-file/rename`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await u(t)};let r=await t.json().catch(()=>null);return n(),{ok:!0,from:r?.from??e.from,to:r?.to??e.to,...r?.fromDocName===void 0?{}:{fromDocName:r.fromDocName},...r?.toDocName===void 0?{}:{toDocName:r.toDocName}}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function J(e){try{let t=new URLSearchParams({scope:e.scope,name:e.name,path:e.path}),r=await fetch(`/api/skill-file?${t.toString()}`,{method:`DELETE`});if(!r.ok)return{ok:!1,error:await u(r)};let i=await r.json().catch(()=>null);return n(),{ok:!0,existed:i?.existed??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function Y(e){try{let t=new URLSearchParams({name:e.name,scope:e.scope,path:e.path,...e.host?{host:e.host}:{}}),n=await fetch(`/api/skill-file?${t.toString()}`,{signal:e.signal});if(!n.ok)return{ok:!1,status:n.status,error:await u(n)};let r=await n.json().catch(()=>null);return typeof r?.text==`string`?{ok:!0,text:r.text}:{ok:!1,status:n.status,error:`HTTP ${n.status}`}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}function X(e,t){return Y({...e,signal:t}).then(e=>e.ok?{ok:!0,text:e.text}:{ok:!1,status:e.status})}async function Z(e){try{let t=await fetch(`/api/skill/install`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await u(t)};let r=await t.json().catch(()=>null);return n(),{ok:!0,hosts:r?.hosts??[],scripts:r?.scripts??!1,warnings:r?.warnings??[],warningCodes:r?.warningCodes??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function Q(e){try{let t=await fetch(`/api/skill/install`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({scope:e.scope,name:e.name,place:{dir:e.dir,mode:e.mode}})});if(!t.ok)return{ok:!1,error:await u(t)};let r=await t.json().catch(()=>null);return n(),{ok:!0,placedAt:r?.placedAt??e.dir}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function $(e){let t=await f(`/api/skill/install`,`POST`,{scope:e.scope,name:e.name,unplace:{path:e.path}});return t.ok?(n(),{ok:!0}):t}async function te(e){let t=await f(`/api/skill/install`,`POST`,{scope:e.scope,name:e.name,setSource:e.target});return t.ok?(n(),{ok:!0}):t}async function ne(e){let t=await f(`/api/skill/install`,`POST`,{scope:e.scope,name:e.name,convert:{target:e.target,mode:e.mode}});return t.ok?(n(),{ok:!0}):t}async function re(e){try{let n=await fetch(`/api/skill-targets`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({folderAction:e})});if(!n.ok)return{ok:!1,error:await u(n)};if(!e.preview)return{ok:!0};let r=await n.json().catch(()=>null),i=typeof r==`object`&&r&&`preview`in r?r.preview:void 0,o=a.safeParse(i);return o.success?{ok:!0,preview:o.data}:{ok:!1,error:t._({id:`iBVgIQ`})}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function ie(e){try{let t=await fetch(`/api/skill/reimport`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await u(t)};let r=await t.json().catch(()=>null);return e.dryRun||n(),{ok:!0,updated:r?.updated??!1,source:r?.source??``,localBody:r?.localBody,upstreamBody:r?.upstreamBody,...r?.gitTracked===void 0?{}:{gitTracked:r.gitTracked},warnings:r?.warnings??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function ae(e){try{let r=await fetch(`/api/skills/reimport-bulk`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!r.ok)return{ok:!1,error:await u(r)};let i=await r.json().catch(()=>null);return!i||!Array.isArray(i.results)?{ok:!1,error:t._({id:`kmPvKZ`})}:(n(),{ok:!0,...i})}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function oe(e){try{let t=await fetch(`/api/skill/revert`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await u(t)};let r=await t.json().catch(()=>null);return n(),{ok:!0,warnings:r?.warnings??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}export{p as A,ie as C,y as D,G as E,$ as F,D as I,K as L,ee as M,F as N,oe as O,V as P,re as S,q as T,g as _,k as a,B as b,b as c,U as d,T as f,S as g,Z as h,x as i,te as j,w as k,_ as l,m,W as n,C as o,E as p,J as r,h as s,ne as t,v as u,X as v,ae as w,Q as x,H as y};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{er as e}from"./CodeMirrorPropInput-
|
|
1
|
+
import{er as e}from"./CodeMirrorPropInput-B-R29uWw.js";import{F as t,H as n,T as r,U as i,V as a,at as o,b as s,m as c,ot as l,w as u,x as d}from"./config-provider-DWypxu7o.js";import{Et as f,J as p,K as m,X as h,Z as g,kt as _,wt as v,yt as y}from"./dist-CoJBCixp.js";var b=class e{constructor(e,t){this.yanchor=e,this.yhead=t}toJSON(){return{yanchor:t(this.yanchor),yhead:t(this.yhead)}}static fromJSON(t){return new e(u(t.yanchor),u(t.yhead))}},x=class{constructor(e,t){this.ytext=e,this.awareness=t,this.undoManager=new c(e)}toYPos(e,t=0){return r(this.ytext,e,t)}fromYPos(e){let t=d(u(e),this.ytext.doc);if(t==null||t.type!==this.ytext)throw Error(`[y-codemirror] The position you want to retrieve was created by a different document`);return{pos:t.index,assoc:t.assoc}}toYRange(e){let t=e.assoc;return new b(this.toYPos(e.anchor,t),this.toYPos(e.head,t))}fromYRange(e){let t=this.fromYPos(e.yanchor),n=this.fromYPos(e.yhead);return t.pos===n.pos?v.cursor(n.pos,n.assoc):v.range(t.pos,n.pos)}},S=f.define({combine(e){return e[e.length-1]}}),C=y.define(),w=class{constructor(e){this.view=e,this.conf=e.state.facet(S),this._observer=(t,n)=>{if(n.origin!==this.conf){let n=t.delta,r=[],i=0;for(let e=0;e<n.length;e++){let t=n[e];t.insert==null?t.delete==null?i+=t.retain:(r.push({from:i,to:i+t.delete,insert:``}),i+=t.delete):r.push({from:i,to:i,insert:t.insert})}e.dispatch({changes:r,annotations:[C.of(this.conf)]})}},this._ytext=this.conf.ytext,this._ytext.observe(this._observer)}update(e){if(!e.docChanged||e.transactions.length>0&&e.transactions[0].annotation(C)===this.conf)return;let t=this.conf.ytext;t.doc.transact(()=>{let n=0;e.changes.iterChanges((e,r,i,a,o)=>{let s=o.sliceString(0,o.length,`
|
|
2
2
|
`);e!==r&&t.delete(e+n,r-e),s.length>0&&t.insert(e+n,s),n+=s.length-(r-e)})},this.conf)}destroy(){this._ytext.unobserve(this._observer)}},T=h.fromClass(w),E=p.baseTheme({".cm-ySelection":{},".cm-yLineSelection":{padding:0,margin:`0px 2px 0px 4px`},".cm-ySelectionCaret":{position:`relative`,borderLeft:`1px solid black`,borderRight:`1px solid black`,marginLeft:`-1px`,marginRight:`-1px`,boxSizing:`border-box`,display:`inline`},".cm-ySelectionCaretDot":{borderRadius:`50%`,position:`absolute`,width:`.4em`,height:`.4em`,top:`-.2em`,left:`-.2em`,backgroundColor:`inherit`,transition:`transform .3s ease-in-out`,boxSizing:`border-box`},".cm-ySelectionCaret:hover > .cm-ySelectionCaretDot":{transformOrigin:`bottom center`,transform:`scale(0)`},".cm-ySelectionInfo":{position:`absolute`,top:`-1.05em`,left:`-1px`,fontSize:`.75em`,fontFamily:`serif`,fontStyle:`normal`,fontWeight:`normal`,lineHeight:`normal`,userSelect:`none`,color:`white`,paddingLeft:`2px`,paddingRight:`2px`,zIndex:101,transition:`opacity .3s ease-in-out`,backgroundColor:`inherit`,opacity:0,transitionDelay:`0s`,whiteSpace:`nowrap`},".cm-ySelectionCaret:hover > .cm-ySelectionInfo":{opacity:1,transitionDelay:`0s`}}),D=y.define(),O=class extends g{constructor(e,t){super(),this.color=e,this.name=t}toDOM(){return a(`span`,[i(`class`,`cm-ySelectionCaret`),i(`style`,`background-color: ${this.color}; border-color: ${this.color}`)],[n(``),a(`div`,[i(`class`,`cm-ySelectionCaretDot`)]),n(``),a(`div`,[i(`class`,`cm-ySelectionInfo`)],[n(this.name)]),n(``)])}eq(e){return e.color===this.color}compare(e){return e.color===this.color}updateDOM(){return!1}get estimatedHeight(){return-1}ignoreEvent(){return!0}},k=class{constructor(e){this.conf=e.state.facet(S),this._listener=({added:t,updated:n,removed:r},i,a)=>{t.concat(n).concat(r).findIndex(e=>e!==this.conf.awareness.doc.clientID)>=0&&e.dispatch({annotations:[D.of([])]})},this._awareness=this.conf.awareness,this._awareness.on(`change`,this._listener),this.decorations=_.of([])}destroy(){this._awareness.off(`change`,this._listener)}update(e){let t=this.conf.ytext,n=t.doc,i=this.conf.awareness,a=[],c=this.conf.awareness.getLocalState();if(c!=null){let n=e.view.hasFocus&&e.view.dom.ownerDocument.hasFocus(),a=n?e.state.selection.main:null,o=c.cursor==null?null:u(c.cursor.anchor),l=c.cursor==null?null:u(c.cursor.head);if(a!=null){let e=r(t,a.anchor),n=r(t,a.head);(c.cursor==null||!s(o,e)||!s(l,n))&&i.setLocalStateField(`cursor`,{anchor:e,head:n})}else c.cursor!=null&&n&&i.setLocalStateField(`cursor`,null)}i.getStates().forEach((r,s)=>{if(s===i.doc.clientID)return;let c=r.cursor;if(c==null||c.anchor==null||c.head==null)return;let u=d(c.anchor,n),f=d(c.head,n);if(u==null||f==null||u.type!==t||f.type!==t)return;let{color:p=`#30bced`,name:h=`Anonymous`}=r.user||{},g=r.user&&r.user.colorLight||p+`33`,_=l(u.index,f.index),v=o(u.index,f.index),y=e.view.state.doc.lineAt(_),b=e.view.state.doc.lineAt(v);if(y.number===b.number)a.push({from:_,to:v,value:m.mark({attributes:{style:`background-color: ${g}`},class:`cm-ySelection`})});else{a.push({from:_,to:y.from+y.length,value:m.mark({attributes:{style:`background-color: ${g}`},class:`cm-ySelection`})}),a.push({from:b.from,to:v,value:m.mark({attributes:{style:`background-color: ${g}`},class:`cm-ySelection`})});for(let t=y.number+1;t<b.number;t++){let n=e.view.state.doc.line(t).from;a.push({from:n,to:n,value:m.line({attributes:{style:`background-color: ${g}`,class:`cm-yLineSelection`}})})}}a.push({from:f.index,to:f.index,value:m.widget({side:f.index-u.index>0?-1:1,block:!1,widget:new O(p,h)})})}),this.decorations=m.set(a,!0)}},A=h.fromClass(k,{decorations:e=>e.decorations}),j=class{constructor(e){this.undoManager=e}addTrackedOrigin(e){this.undoManager.addTrackedOrigin(e)}removeTrackedOrigin(e){this.undoManager.removeTrackedOrigin(e)}undo(){return this.undoManager.undo()!=null}redo(){return this.undoManager.redo()!=null}},M=f.define({combine(e){return e[e.length-1]}});y.define();var N=class{constructor(t){this.view=t,this.conf=t.state.facet(M),this._undoManager=this.conf.undoManager,this.syncConf=t.state.facet(S),this._beforeChangeSelection=null,this._mux=e(),this._onStackItemAdded=({stackItem:e,changedParentTypes:t})=>{t.has(this.syncConf.ytext)&&this._beforeChangeSelection&&!e.meta.has(this)&&e.meta.set(this,this._beforeChangeSelection)},this._onStackItemPopped=({stackItem:e})=>{let n=e.meta.get(this);if(n){let e=this.syncConf.fromYRange(n);t.dispatch(t.state.update({selection:e,effects:[p.scrollIntoView(e)]})),this._storeSelection()}},this._storeSelection=()=>{this._beforeChangeSelection=this.syncConf.toYRange(this.view.state.selection.main)},this._undoManager.on(`stack-item-added`,this._onStackItemAdded),this._undoManager.on(`stack-item-popped`,this._onStackItemPopped),this._undoManager.addTrackedOrigin(this.syncConf)}update(e){e.selectionSet&&(e.transactions.length===0||e.transactions[0].annotation(C)!==this.syncConf)&&this._storeSelection()}destroy(){this._undoManager.off(`stack-item-added`,this._onStackItemAdded),this._undoManager.off(`stack-item-popped`,this._onStackItemPopped),this._undoManager.removeTrackedOrigin(this.syncConf)}},P=h.fromClass(N),F=({state:e,dispatch:t})=>e.facet(M).undo()||!0,I=({state:e,dispatch:t})=>e.facet(M).redo()||!0,L=[{key:`Mod-z`,run:F,preventDefault:!0},{key:`Mod-y`,mac:`Mod-Shift-z`,run:I,preventDefault:!0},{key:`Mod-Shift-z`,run:I,preventDefault:!0}],R=(e,t,{undoManager:n=new c(e)}={})=>{let r=new x(e,t),i=[S.of(r),T];return t&&i.push(E,A),n!==!1&&i.push(M.of(new j(n)),P,p.domEventHandlers({beforeinput(e,t){return e.inputType===`historyUndo`?F(t):e.inputType===`historyRedo`?I(t):!1}})),i};export{L as n,R as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./bridge-D_Rj4MRC.js";function t(e,t){return t===null?e:`${e}:${n(t)}`}function n(t){return e(t)}export{t as n,n as t};
|