@inkeep/open-knowledge 0.6.0-beta.22 → 0.6.0-beta.24

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.
Files changed (36) hide show
  1. package/dist/assets/skills/discovery/SKILL.md +1 -1
  2. package/dist/assets/skills/project/SKILL.md +1 -1
  3. package/dist/cli.mjs +4 -4
  4. package/dist/constants-BviKwYhr.mjs +2 -0
  5. package/dist/{dist-Dg6O3Q9A.mjs → dist-CabLlUBg.mjs} +4 -4
  6. package/dist/{dist-wHpPmyBq.mjs → dist-DJIHw74T.mjs} +1 -1
  7. package/dist/index.mjs +1 -1
  8. package/dist/init-BbZzm08f.mjs +1 -0
  9. package/dist/{init-zVplvoPG.mjs → init-rGTs2ynj.mjs} +4 -4
  10. package/dist/{loader-BZGdcbd-.mjs → loader-CaROLCY8.mjs} +2 -2
  11. package/dist/loader-Doy01kbo.mjs +1 -0
  12. package/dist/preview-BwB3j46R.mjs +1 -0
  13. package/dist/{preview-Czwk2dja.mjs → preview-D0raeoP2.mjs} +2 -2
  14. package/dist/public/assets/{ActivityModeContent-CgPfEhMS.js → ActivityModeContent-DzEaZdqg.js} +1 -1
  15. package/dist/public/assets/{DocumentContext-DCEXS67b.js → DocumentContext-B4gtDF6X.js} +1 -1
  16. package/dist/public/assets/{GraphPanel-mQmRhod_.js → GraphPanel-DxBhsg4w.js} +1 -1
  17. package/dist/public/assets/{SettingsDialogBody-25y-yVAm.js → SettingsDialogBody-BoZisfq6.js} +1 -1
  18. package/dist/public/assets/{SourceEditor-D4uMes9S.js → SourceEditor-CDJFJxI-.js} +1 -1
  19. package/dist/public/assets/{config-validation-events-BinSH1WI.js → config-validation-events-DmqxGzO4.js} +1 -1
  20. package/dist/public/assets/{index-D20xlk9K.js → index-DfAuPL4O.js} +4 -4
  21. package/dist/public/assets/{prop-types-BEbeSvI1.js → prop-types-CesXwSs1.js} +2 -2
  22. package/dist/public/assets/{target-navigation-intent-B6yRgiCk.js → target-navigation-intent-C2Y4hErJ.js} +1 -1
  23. package/dist/public/assets/{toggle-group-Llc9I0Vm.js → toggle-group-C5-7zOwD.js} +1 -1
  24. package/dist/public/assets/{typing-burst-detector-DbcZJAdl.js → typing-burst-detector-DEP4IMRH.js} +1 -1
  25. package/dist/public/index.html +7 -7
  26. package/dist/{repair-launch-json-BHgVOnqI.mjs → repair-launch-json-BDU2YBJu.mjs} +2 -2
  27. package/dist/{repair-mcp-configs-D1O4kw7y.mjs → repair-mcp-configs-KPtVANur.mjs} +2 -2
  28. package/dist/{src-CfuREFd9.mjs → src-CsQDTjaa.mjs} +2 -2
  29. package/dist/start-CS7OCZr2.mjs +1 -0
  30. package/dist/{start-B61qdwvT.mjs → start-iV83gH57.mjs} +2 -2
  31. package/package.json +1 -1
  32. package/dist/constants-D-G-Sg9K.mjs +0 -2
  33. package/dist/init-3sq3de7t.mjs +0 -1
  34. package/dist/loader-CaFjlmB7.mjs +0 -1
  35. package/dist/preview-BvtZ3joj.mjs +0 -1
  36. package/dist/start-CbUZfK0T.mjs +0 -1
@@ -391,7 +391,7 @@ Read more at https://docs.orama.com/docs/orama-js/plugins/plugin-secure-proxy#pl
391
391
  `)].join(`
392
392
  `);case`REMOVED_KEY`:{let t=e.path.join(`.`),n=[`${e.source?`Removed key at ${e.source.file}:${e.source.line}:${e.source.column}`:`Removed key in configuration`}: ${t}`,e.redirect];if(e.source?.snippet&&e.source.snippet.length>0)for(let t of e.source.snippet.split(`
393
393
  `))n.push(` ${t}`);return n.join(`
394
- `)}case`WRITE_ERROR`:return`Failed to write config file: ${e.detail}`;case`OKIGNORE_INVALID`:return e.lineNumber===void 0?`.okignore: ${e.detail}`:`.okignore line ${e.lineNumber}: ${e.detail}`;case`UNKNOWN`:return e.message??`Unknown error.`}}function i$(e,t,n){return a$([e,t,n],[])}function a$(e,t){if(t.length>0){let n=Tu(yu,t);if(n?.scope===`user`)return e[0];if(n?.scope===`project`)return e[1]??e[0];if(n?.scope===`project-local`)return e[2]??e[1]??e[0]}let n=o$(e);if(n===void 0)return;if(n===null)return null;if(Array.isArray(n)||typeof n!=`object`)return n;let r=e.map(e=>s$(e)?e:void 0),i=new Set;for(let e of r)if(e!==void 0)for(let t of Object.keys(e))i.add(t);let a={};for(let e of i)a[e]=a$(r.map(t=>t===void 0?void 0:t[e]),[...t,e]);return a}function o$(e){for(let t=e.length-1;t>=0;t--)if(e[t]!==void 0)return e[t]}function s$(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var c$=2e3;function l$(e){let t=Date.now();for(let[n,r]of e.entries()){let i=r;i.timestamp&&t-i.timestamp>3e4&&e.delete(n)}}function u$(e,t){for(let[,n]of e.entries()){let e=n;if(e.timestamp&&e.timestamp>t)return!0}return!1}var d$=`__system__`,f$=`__config__/project`,p$=`__user__/config.yml`,m$=`__local__/project`,h$=`__config__/okignore`;Object.freeze([f$,m$,p$,h$]);var g$=[`invalid-args`,`nested-project`,`target-not-empty`,`mkdir-failed`,`git-init-failed`,`init-failed`,`discovery-failed`],_$=[`claude`,`claude-desktop`,`cursor`,`codex`],v$={claude:`Claude`,"claude-desktop":`Claude Desktop`,cursor:`Cursor`,codex:`Codex`},y$=[`incoming`,`outgoing`,`both`];function b$(e){return y$.includes(e)}var x$=[`image/jpeg`,`image/png`,`image/gif`,`image/webp`,`image/svg+xml`],S$=[`video/mp4`,`video/webm`,`video/ogg`],C$=[`audio/mpeg`,`audio/wav`,`audio/ogg`],w$=[`application/pdf`],T$=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`avif`,`svg`]),E$=new Set([`mp4`,`webm`,`mov`,`m4v`,`mkv`]),D$=new Set([`pdf`]),O$=new Set([`mp3`,`wav`,`ogg`,`m4a`,`flac`,`aac`,`opus`]),k$=new Set(`pdf.docx.xlsx.pptx.doc.xls.ppt.zip.7z.tar.gz.rar.csv.tsv.rtf.json.yaml.yml.xml.txt.pages.numbers.key.odt.ods.odp.epub.mobi`.split(`.`)),A$=new Set(`png.jpg.jpeg.gif.webp.avif.apng.heic.heif.tiff.bmp.ico.svg.pdf.mp4.webm.mov.m4v.mkv.mp3.wav.ogg.m4a.flac.aac.opus.json.toml`.split(`.`)),j$=`wikiembed`,M$=`toast`,N$=new Set(`png.jpg.jpeg.gif.webp.avif.svg.pdf.mp4.webm.mov.m4v.mkv.mp3.wav.ogg.m4a.flac.aac.opus.docx.xlsx.pptx.doc.xls.ppt.zip.7z.tar.gz.rar.csv.tsv.rtf.json.yaml.yml.xml.txt.pages.numbers.key.odt.ods.odp.epub.mobi`.split(`.`)),P$=[`png`,`jpg`,`jpeg`,`gif`,`webp`,`avif`],F$=[`mp4`,`webm`,`mov`,`m4v`],I$=[`mp3`,`wav`,`ogg`,`m4a`,`flac`,`aac`,`opus`],L$=[`pdf`],R$=[`json`,`toml`];function z$(e,t,n){for(let r of t)if(!n.has(r))throw Error(`${e}: ${r} is not present in canonical upload constants`)}z$(`SIDEBAR_IMAGE_ASSET_EXTENSIONS`,P$,T$),z$(`SIDEBAR_VIDEO_ASSET_EXTENSIONS`,F$,E$),z$(`SIDEBAR_AUDIO_ASSET_EXTENSIONS`,I$,O$),z$(`SIDEBAR_PDF_ASSET_EXTENSIONS`,L$,D$),z$(`FILE_ATTACHMENT_EXTENSIONS`,[...k$],N$);var B$=new Set(P$),V$=new Set(F$),H$=new Set(I$),U$=new Set(L$),W$=new Set(R$);z$(`SIDEBAR_RENDERABLE_ASSET_EXTENSIONS`,[...new Set([...P$,...F$,...I$,...L$,...R$])],A$);function G$(e){let t=e.toLowerCase().replace(/^\./,``);return B$.has(t)?`image`:V$.has(t)?`video`:H$.has(t)?`audio`:U$.has(t)?`pdf`:W$.has(t)?`text`:null}var K$=sS.extend({priority:60,addAttributes(){return{...this.parent?.(),fenceDelimiter:{default:"`"},fenceLength:{default:3},meta:{default:null},sourceStyle:{default:`fenced`}}}}),q$=bS.extend({name:`emphasis`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`*`}}},addInputRules(){return[Mx({find:hS,type:this.type,getAttributes:{sourceDelimiter:`*`}}),Mx({find:_S,type:this.type,getAttributes:{sourceDelimiter:`_`}})]}}),J$=mS.extend({name:`strong`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`**`}}},addInputRules(){return[Mx({find:lS,type:this.type,getAttributes:{sourceDelimiter:`**`}}),Mx({find:dS,type:this.type,getAttributes:{sourceDelimiter:`__`}})]}}),Y$=sx.create({name:`escapeMark`,priority:10,excludes:``,inclusive:!1,parseHTML(){return[{tag:`span[data-escape-mark]`}]},renderHTML(){return[`span`,{"data-escape-mark":``},0]}}),X$=SS.extend({priority:60,addAttributes(){return{...this.parent?.(),hardBreakStyle:{default:`backslash`}}}}),Z$=wS.extend({priority:60,addAttributes(){return{...this.parent?.(),headingStyle:{default:`atx`},sourceTrailingHashes:{default:null},sourceUnderlineLength:{default:null},sourceContiguousNext:{default:!1}}}}),Q$=eS.create({name:`htmlBlock`,group:`block`,atom:!0,priority:60,addAttributes(){return{content:{default:``}}},parseHTML(){return[{tag:`div[data-html-block]`}]},renderHTML({node:e}){return[`div`,{"data-html-block":``,class:`html-block`},e.attrs.content]}}),$$=eS.create({name:`jsxComponent`,group:`block`,atom:!1,content:`block*`,isolating:!0,selectable:!0,defining:!0,priority:60,addAttributes(){return{componentName:{default:``},kind:{default:`element`},attributes:{default:[]},sourceRaw:{default:``},sourceDirty:{default:!1},props:{default:{}}}},parseHTML(){return[{tag:`div[data-jsx-component]`,getAttrs:e=>typeof e==`string`?!1:{componentName:e.getAttribute(`data-component-name`)||``,sourceRaw:e.getAttribute(`data-source-raw`)||``}}]},renderHTML({HTMLAttributes:e}){return[`div`,{"data-jsx-component":``,"data-component-name":e.componentName,"data-source-raw":e.sourceRaw},0]},addCommands(){return{insertJsxComponent:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{sourceRaw:e}})}}}),e1=eS.create({name:`jsxInline`,group:`inline`,inline:!0,atom:!1,content:`text*`,isolating:!1,selectable:!0,priority:60,addAttributes(){return{}},parseHTML(){return[{tag:`span[data-jsx-inline]`}]},renderHTML(){return[`span`,{"data-jsx-inline":``},0]}}),t1=[`https`,`http`,`mailto`,`tel`,`ftp`,`sms`],n1=t1.map(e=>`${e}:`).join(`|`),r1=RegExp(`^(?:${n1}|\\/|#|\\?|\\.\\/|\\.\\.\\/)`,`i`);function i1(e){let t=e.trim();return t===``?!0:r1.test(t)}function a1(e){let t=e.trim();if(t===``)return!0;let n=t.indexOf(`:`);if(n===-1)return!0;let r=t.indexOf(`/`),i=t.indexOf(`?`),a=t.indexOf(`#`);return n>Math.min(r===-1?1/0:r,i===-1?1/0:i,a===-1?1/0:a)}var o1=new Set(t1.map(e=>`${e}:`)),s1=`https://placeholder.invalid`;function c1(e){try{let t=new URL(e,s1);return o1.has(t.protocol.toLowerCase())}catch{return!1}}var l1=Bw.extend({priority:60,addOptions(){return{openOnClick:!1,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer`},isAllowedUri:c1,validate:c1,shouldAutoLink:()=>!0}},addAttributes(){return{...this.parent?.(),linkStyle:{default:`inline`,rendered:!1},refLabel:{default:null,rendered:!1},sourceForm:{default:null,rendered:!1},target:{default:null,rendered:!1},anchor:{default:null,rendered:!1},alias:{default:null,rendered:!1},sourceUrlForm:{default:null,rendered:!1},sourceTitleMarker:{default:null,rendered:!1}}}}),u1=eS.create({name:`linkRefDef`,group:`block`,atom:!0,priority:60,addAttributes(){return{label:{default:``},href:{default:``},title:{default:null},sourceLayout:{default:null},sourceTitleMarker:{default:null}}},parseHTML(){return[{tag:`div[data-link-ref-def]`}]},renderHTML({node:e}){let{label:t,href:n,title:r}=e.attrs;return[`div`,{"data-link-ref-def":``,class:`link-ref-def`},r?`[${t}]: ${n} "${r}"`:`[${t}]: ${n}`]}});function d1(e){return e.type.name===`list`&&!e.attrs.ordered}function f1(e){return e.type.name===`list`&&!!e.attrs.ordered}function p1(e){let t=!1;return e.forEach(e=>{e.type.name===`listItem`&&e.attrs.checked!==null&&(t=!0)}),t}function m1(e,t,n,r,i,a,o){let s=Iy(e=>e.type.name===`list`)(e.selection);if(s&&i(s.node)){let{$from:n,$to:i}=e.selection;return n.blockRange(i)?Tm(r)(e,t):!1}if(s){if(!t)return!0;let{tr:n}=e;return n.setNodeMarkup(s.pos,void 0,{...s.node.attrs,...a}),o!==void 0&&s.node.forEach((e,t)=>{if(e.type.name===`listItem`){let r=s.pos+1+t;n.setNodeMarkup(r,void 0,{...e.attrs,...o})}}),t(n),!0}return wm(n,a)(e,void 0)?t?wm(n,a)(e,n=>{if(o){let t=n.mapping.map(e.selection.$from.pos),r=n.doc.resolve(t);for(let e=r.depth;e>0;e--){let t=r.node(e);if(t.type.name===`listItem`){n.setNodeMarkup(r.before(e),void 0,{...t.attrs,...o});break}}}t(n)}):!0:!1}var h1=eS.create({name:`list`,group:`block list`,content:`listItem+`,priority:60,addAttributes(){return{ordered:{default:!1},start:{default:1},spread:{default:!1},bulletMarker:{default:null},listMarkerDelimiter:{default:null}}},parseHTML(){return[{tag:`ul`,getAttrs:()=>({ordered:!1})},{tag:`ol`,getAttrs:e=>({ordered:!0,start:e.getAttribute(`start`)?Number(e.getAttribute(`start`)):1})}]},renderHTML({node:e,HTMLAttributes:t}){let n=e.attrs.ordered?`ol`:`ul`,r={};return e.attrs.ordered&&e.attrs.start!==1&&(r.start=e.attrs.start),[n,Gy(t,r),0]},addCommands(){return{toggleBulletList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:m1(e,t,n,r,e=>d1(e)&&!p1(e),{ordered:!1},{checked:null})},toggleOrderedList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:m1(e,t,n,r,e=>f1(e),{ordered:!0},{checked:null})},toggleTaskList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:m1(e,t,n,r,e=>d1(e)&&p1(e),{ordered:!1},{checked:!1})}}},addInputRules(){return[Fx({find:/^\s*([-+*])(?!\s*\[[ xX]\])\s$/,type:this.type,getAttributes:e=>({ordered:!1,bulletMarker:e[1]})}),Fx({find:/^\s*(\d+)([.)])\s$/,type:this.type,getAttributes:e=>({ordered:!0,start:Number(e[1]),listMarkerDelimiter:e[2]})}),new $b({find:/^\s*[-*+]\s\[([ xX])\]\s$/,handler:({state:e,range:t,match:n})=>{let r=e.schema.nodes.list;if(!r)return null;let i=n[1]!==` `,a=e.tr.delete(t.from,t.to),o=a.doc.resolve(t.from).blockRange();if(!o)return null;let s=Ff(o,r,{ordered:!1});if(!s)return null;a.wrap(o,s);let c=a.doc.resolve(a.mapping.map(t.from));for(let e=c.depth;e>0;e--){let t=c.node(e);if(t.type.name===`listItem`){a.setNodeMarkup(c.before(e),void 0,{...t.attrs,checked:i});break}}}})]},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList(),"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList(),"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),g1=eS.create({name:`listItem`,content:`paragraph block*`,defining:!0,addAttributes(){return{checked:{default:null},spread:{default:!1}}},parseHTML(){return[{tag:`li`,getAttrs:e=>{let t=e.querySelector(`input[type="checkbox"]`);return{checked:t?t.checked:null}}}]},renderHTML({node:e,HTMLAttributes:t}){return e.attrs.checked===null?[`li`,Gy(t),0]:[`li`,Gy(t,{"data-type":`taskItem`,"data-checked":e.attrs.checked?`true`:`false`}),[`label`,{contenteditable:`false`},[`input`,{type:`checkbox`,...e.attrs.checked?{checked:`checked`}:{}}]],[`div`,0]]},addNodeView(){return({node:e,getPos:t,editor:n,HTMLAttributes:r})=>{let i=document.createElement(`li`);Object.entries(Gy(r,e.attrs.checked===null?{}:{"data-type":`taskItem`,"data-checked":String(!!e.attrs.checked)})).forEach(([e,t])=>{t!=null&&i.setAttribute(e,String(t))});let a=null,o=null,s=document.createElement(`div`);return e.attrs.checked!==null&&(a=document.createElement(`label`),a.contentEditable=`false`,o=document.createElement(`input`),o.type=`checkbox`,o.checked=!!e.attrs.checked,n.isEditable||(o.disabled=!0),o.addEventListener(`change`,()=>{let r=t();r===void 0||typeof r!=`number`||n.view.dispatch(n.view.state.tr.setNodeMarkup(r,void 0,{...e.attrs,checked:o?.checked??!1}))}),a.appendChild(o),i.appendChild(a)),i.appendChild(s),{dom:i,contentDOM:s,update(t){return t.type!==e.type||t.attrs.checked!==null!=(e.attrs.checked!==null)?!1:(o&&t.attrs.checked!==null&&(o.checked=!!t.attrs.checked,i.setAttribute(`data-checked`,String(!!t.attrs.checked))),e=t,!0)}}}},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>{let{$from:e}=this.editor.state.selection;for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return this.editor.commands.sinkListItem(this.name);return!1},"Shift-Tab":()=>{let{$from:e}=this.editor.state.selection;for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return this.editor.commands.liftListItem(this.name);return!1}}}}),_1=h1,v1=g1,y1=eS.create({name:`mathInline`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,addAttributes(){return{formula:{default:``},id:{default:null},language:{default:`latex`}}},parseHTML(){return[{tag:`span[data-math-inline]`,getAttrs:e=>typeof e==`string`?!1:{formula:e.getAttribute(`data-formula`)||``,id:e.getAttribute(`id`)||null,language:e.getAttribute(`data-language`)||`latex`}}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-math-inline":``,"data-formula":e.formula,"data-language":e.language,...e.id?{id:e.id}:{}}]},addCommands(){return{insertMathInline:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{formula:e}})}}}),b1=eS.create({name:`rawMdxFallback`,group:`block`,atom:!1,content:`text*`,isolating:!0,selectable:!0,defining:!0,priority:60,addAttributes(){return{reason:{default:``},originalSpan:{default:{start:0,end:0}}}},parseHTML(){let e=e=>typeof e==`string`?!1:{reason:e.getAttribute(`data-reason`)||``};return[{tag:`div[data-raw-mdx-fallback]`,getAttrs:e},{tag:`pre[data-raw-mdx-fallback]`,getAttrs:e}]},renderHTML({HTMLAttributes:e}){return[`div`,{"data-raw-mdx-fallback":``,"data-raw-badge":`raw`,"data-reason":e.reason,contenteditable:`false`,class:`raw-mdx-fallback`},0]},addNodeView(){return({HTMLAttributes:e})=>{let t=document.createElement(`div`);t.setAttribute(`data-raw-mdx-fallback`,``),t.setAttribute(`data-raw-badge`,`raw`),t.setAttribute(`contenteditable`,`false`),t.classList.add(`raw-mdx-fallback`),e.reason&&t.setAttribute(`data-reason`,e.reason);let n=document.createElement(`pre`);return n.classList.add(`raw-mdx-fallback-content`),n.setAttribute(`contenteditable`,`false`),t.appendChild(n),{dom:t,contentDOM:n,ignoreMutation:()=>!0}}}}),x1=ZE.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceMarkerSpacings:{default:null}}}}),S1=tD.extend({excludes:``,addAttributes(){return{...this.parent?.(),sourceFenceChar:{default:"`"},sourceFenceLength:{default:1}}}}),C1=eS.create({name:`commentBlock`,group:`block`,content:`block+`,defining:!0,priority:60,addAttributes(){return{sourceForm:{default:`percent`,parseHTML:e=>e.getAttribute(`data-source-form`)===`html`?`html`:`percent`,renderHTML:e=>e.sourceForm===`html`?{"data-source-form":`html`}:{}},sourceLayout:{default:`block`,parseHTML:e=>e.getAttribute(`data-source-layout`)===`inline`?`inline`:`block`,renderHTML:e=>e.sourceLayout===`inline`?{"data-source-layout":`inline`}:{}}}},parseHTML(){return[{tag:`aside[data-comment-block]`},{tag:`aside.comment-block`}]},renderHTML({HTMLAttributes:e}){return[`aside`,{"data-comment-block":``,"data-clipboard-omit":`true`,class:`comment-block`,style:`display: none;`,...e},0]},addCommands(){return{setCommentBlock:()=>({commands:e})=>e.wrapIn(this.name),toggleCommentBlock:()=>({commands:e})=>e.toggleWrap(this.name),unsetCommentBlock:()=>({commands:e})=>e.lift(this.name)}}}),w1=sx.create({name:`comment`,priority:10,excludes:``,inclusive:!1,addAttributes(){return{sourceForm:{default:`percent`,parseHTML:e=>e.getAttribute(`data-source-form`)===`html`?`html`:`percent`,renderHTML:e=>e.sourceForm===`html`?{"data-source-form":`html`}:{}}}},parseHTML(){return[{tag:`span[data-comment-mark]`}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-comment-mark":``,"data-clipboard-omit":`true`,class:`comment-mark`,style:`display: none;`,...e},0]},addCommands(){return{setComment:()=>({commands:e})=>e.setMark(this.name),toggleComment:()=>({commands:e})=>e.toggleMark(this.name),unsetComment:()=>({commands:e})=>e.unsetMark(this.name)}}}),T1=eS.create({name:`footnoteDefinition`,group:`block`,content:`block+`,defining:!0,priority:60,addAttributes(){return{identifier:{default:``},label:{default:null}}},parseHTML(){let e=e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-footnote-id`)||``;return{identifier:t,label:t||null}};return[{tag:`aside[data-footnote-def]`,getAttrs:e},{tag:`aside.footnote-def`,getAttrs:e}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.identifier??``);return[`aside`,{...t,"data-footnote-def":``,"data-footnote-id":n,id:`fn-${n}`,class:`footnote-def`},[`div`,{class:`footnote-body`},0],[`a`,{href:`#fnref-${n}`,class:`footnote-backref`,contentEditable:`false`,"aria-label":`Back to reference`},`↩`]]},addCommands(){return{insertFootnoteDefinition:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{identifier:e,label:e},content:[{type:`paragraph`}]})}}}),E1=eS.create({name:`footnoteReference`,group:`inline`,inline:!0,atom:!0,selectable:!0,draggable:!1,priority:60,addAttributes(){return{identifier:{default:``},label:{default:null}}},parseHTML(){return[{tag:`sup[data-footnote-ref]`,getAttrs:e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-footnote-id`)||``;return{identifier:t,label:t||null}}}]},renderHTML({node:e}){let t=String(e.attrs.identifier??``);return[`sup`,{id:`fnref-${t}`,"data-footnote-ref":``,"data-footnote-id":t,class:`footnote-ref`},[`a`,{href:`#fn-${t}`,class:`footnote-ref-link`},`[${t}]`]]},addCommands(){return{insertFootnoteReference:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{identifier:e,label:e}})}}}),D1=eS.create({name:`imageReference`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{alt:{default:``},label:{default:``},identifier:{default:``},referenceType:{default:`shortcut`}}},parseHTML(){return[{tag:`img[data-image-reference]`}]},renderHTML({node:e}){let{alt:t,label:n,referenceType:r}=e.attrs;return[`img`,{"data-image-reference":``,"data-reference-type":r,"data-label":n,alt:t||n}]}});function O1(e){if(typeof e!=`string`||!e.startsWith(`/`))return e;let t=globalThis.window?.okDesktop?.config?.apiOrigin;return typeof t==`string`&&t?t+e:e}var k1=lne.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceUrl:{default:null,rendered:!1}}},renderHTML({HTMLAttributes:e}){let t=Gy(this.options.HTMLAttributes,e);return typeof t.src==`string`&&(t.src=O1(t.src)),[`img`,t]}}),A1=sx.create({name:`sourceLiteral`,priority:10,excludes:``,inclusive:!1,addAttributes(){return{sourceRaw:{default:``}}},parseHTML(){return[{tag:`span[data-source-literal]`}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-source-literal":``,...e},0]}});function j1(e,t){if(typeof e!=`string`||typeof t!=`string`||/[\x00-\x1F\x7F]/.test(e))return!1;let n=e.replaceAll(`\xA0`,` `),r=t.replaceAll(`\xA0`,` `);return n===r?!0:M1(n)===r}function M1(e){return e.replace(/\\([!-/:-@[-`{-~])/g,`$1`)}var N1=JE.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDashCounts:{default:null}}}}),P1=NE.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),F1=PE.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),I1=eS.create({name:`tag`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,addAttributes(){return{value:{default:``}}},parseHTML(){return[{tag:`a[data-tag]`,getAttrs:e=>typeof e==`string`?!1:{value:e.getAttribute(`data-tag`)||``}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.value??``);return[`a`,{...t,"data-tag":n,href:`#tag/${n}`,class:`tag`},`#${n}`]},addCommands(){return{insertTag:e=>({chain:t})=>t().insertContent({type:`tag`,attrs:{value:e}}).run()}}}),L1=/^(?:---|—-|___\s|\*\*\*\s)$/;function R1(e){let t=String(e[0]??``).replace(/\s+$/,``);return t===`—-`?`---`:t}var z1=iD.extend({name:`thematicBreak`,priority:60,addAttributes(){return{...this.parent?.(),sourceRaw:{default:`---`}}},addInputRules(){return[Nx({find:L1,type:this.type,getAttributes:e=>({sourceRaw:R1(e)})})]}});function B1(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function V1(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}var H1=eS.create({name:`wikiLink`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{target:{default:``},alias:{default:null},anchor:{default:null},resolved:{default:!1}}},parseHTML(){return[{tag:`span[data-wiki-link]`,getAttrs:e=>typeof e==`string`?!1:{target:e.getAttribute(`data-target`)||``,alias:B1(e.getAttribute(`data-alias`)),anchor:B1(e.getAttribute(`data-anchor`)),resolved:e.getAttribute(`data-resolved`)===`true`}},{tag:`a.wiki-link[data-target]`,priority:100,getAttrs:e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-target`)??``;return t?{target:t,alias:B1(e.getAttribute(`data-alias`)),anchor:B1(e.getAttribute(`data-anchor`)),resolved:!1}:!1}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=B1(e.attrs.alias),i=B1(e.attrs.anchor),a=e.attrs.resolved===!0;return[`span`,{...t,"data-wiki-link":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,"data-resolved":a?`true`:`false`},V1({target:n,alias:r,anchor:i})]}});function U1(e){let t=e.split(`/`).pop()??e,n=t.lastIndexOf(`.`);return n<=0||n===t.length-1?``:t.slice(n+1).toLowerCase()}function W1(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}var G1=eS.create({name:`wikiLinkEmbed`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{target:{default:``},alias:{default:null},anchor:{default:null},resolvedSrc:{default:null,rendered:!1,parseHTML:()=>null}}},parseHTML(){let e=e=>typeof e==`string`||!e.hasAttribute(`data-wiki-embed`)?!1:{target:e.getAttribute(`data-target`)||``,alias:B1(e.getAttribute(`data-alias`)),anchor:B1(e.getAttribute(`data-anchor`))};return[{tag:`img[data-wiki-embed]`,getAttrs:e,priority:100},{tag:`a[data-wiki-embed]`,getAttrs:e,priority:100}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=B1(e.attrs.alias),i=B1(e.attrs.anchor),a=B1(e.attrs.resolvedSrc),o=U1(n);if(T$.has(o))return[`img`,{...t,"data-wiki-embed":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,src:a??n,alt:r??n}];let s=a??n;return[`a`,{...t,"data-wiki-embed":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,href:i?`${s}#${i}`:s,target:`_blank`,rel:`noopener noreferrer`},W1({target:n,alias:r,anchor:i})]}}),K1=[$$,b1,e1,y1,H1,G1,I1,_1,v1,q$,J$,S1,K$,x1,Z$,z1,l1,Q$,u1,X$,Y$,A1,sne.configure({undoRedo:!1,bulletList:!1,orderedList:!1,listItem:!1,italic:!1,bold:!1,code:!1,codeBlock:!1,heading:!1,horizontalRule:!1,hardBreak:!1,link:!1,blockquote:!1,dropcursor:{color:`color-mix(in oklch, var(--primary) 50%, transparent)`,width:2}}),N1.configure({resizable:!0}),FE,F1,P1,k1.configure({inline:!0}),D1,Uw,w1,C1,E1,T1],q1=/^[a-zA-Z][\w/-]*$/;function J1(e,t){let n=encodeURIComponent(t.projectDir);if(t.prompt===``)return`claude://${e.mode}/new?folder=${n}`;let r=encodeURIComponent(t.prompt);return`claude://${e.mode}/new?q=${r}&folder=${n}`}function Y1(e){let t=encodeURIComponent(e.projectDir);return e.prompt===``?`codex://new?path=${t}`:`codex://new?prompt=${encodeURIComponent(e.prompt)}&path=${t}`}function X1(e){let t=Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`));return t<0?e:e.substring(t+1)}function Z1(e){let t=encodeURIComponent(X1(e.projectDir));return e.prompt===``?`cursor://anysphere.cursor-deeplink/prompt?workspace=${t}&mode=agent`:`cursor://anysphere.cursor-deeplink/prompt?text=${encodeURIComponent(encodeURIComponent(e.prompt))}&workspace=${t}&mode=agent`}var Q1=RegExp("[\\u0000-\\u001f\\u007f-\\u009f\\u200b-\\u200f\\u2028-\\u202e\\u2060-\\u2069\\ufeff`]+",`g`);function $1(e){return e.replace(Q1,`_`)}function e0(e){return`Can you open \`${$1(e)}\` in web view with open knowledge editor.`}function t0(e){return`Let's work on \`${$1(e)}\` folder using Open Knowledge. Open the OK editor in web view.`}function n0(){return`Let's work on this project using Open Knowledge. Open the OK editor in web view.`}var r0=j().refine(e=>!e.includes(`..`)&&!e.startsWith(`/`)&&!e.includes(`\0`)&&!e.includes(`\\`),{message:`docName contains unsafe path characters`}).optional(),i0={agentId:j().optional(),agentName:j().optional(),colorSeed:j().optional(),clientName:j().optional(),clientVersion:j().optional(),label:j().optional()},a0=j().optional(),o0=/^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;P({docPath:j().min(1)}).loose();var s0=to([`no-remote`,`detached-head`,`branch-not-on-origin`,`non-github-remote`,`invalid-path`]),c0=Qa(`ok`,[P({ok:F(!0),shareUrl:j().min(1),blobUrl:j().min(1),branch:j().min(1)}).loose(),P({ok:F(!1),error:s0,branch:j().min(1).optional()}).loose()]),l0=to([`user`,`org`]),u0=P({login:j().min(1),kind:l0,avatarUrl:j().optional()}).loose(),d0=to([`auth-required`,`network`]),f0=Qa(`ok`,[P({ok:F(!0),owners:N(u0)}).loose(),P({ok:F(!1),error:d0}).loose()]),p0=Qa(`ok`,[P({ok:F(!0),available:Ba()}).loose(),P({ok:F(!1),error:d0}).loose()]),m0=to([`public`,`private`]);P({owner:j().min(1),name:j().min(1),visibility:m0,description:j().optional()}).loose();var h0=to([`name-conflict`,`saml-sso`,`auth-required`,`push-failed`,`init-failed`,`network`,`no-project`]),g0=Qa(`ok`,[P({ok:F(!0),ownerLogin:j().min(1),repoName:j().min(1),cloneUrl:j().min(1),defaultBranch:j().min(1)}).loose(),P({ok:F(!1),error:h0}).loose()]);function _0(e){return!(typeof e!=`string`||e.length===0||e.startsWith(`-`)||/[\x00-\x1F\x7F]/.test(e)||/\s/.test(e)||e.includes(`:`)||e.split(`/`).includes(`..`))}var v0=e=>e.refine(_0,`invalid branch name`),y0={shareFileExists:Ba(),dirtyConflicts:P({conflicts:Ba(),files:N(j().min(1))}).loose(),branchIsLocal:Ba()};Qa(`detached`,[P({detached:F(!1),currentBranch:j().min(1).nullable(),currentHeadSha:Ha(),...y0}).loose(),P({detached:F(!0),currentBranch:Ha(),currentHeadSha:j().min(1),...y0}).loose()]),P({branch:v0(j().min(1)),principalId:j().optional()}).loose();var b0=to([`dirty-conflict`,`branch-not-found`,`fetch-failed`,`checkout-failed`]);Qa(`ok`,[P({ok:F(!0)}).loose(),P({ok:F(!1),reason:b0,files:N(j().min(1)).optional()}).loose()]);var x0=P({serverInstanceId:j().min(1),currentBranch:j().min(1).optional(),currentDiskAckSVs:$a(j().min(1),j().min(1)).optional()}).loose(),S0=P({id:j().min(1),display_name:j().min(1),display_email:j(),source:to([`git-config`,`synthesized`]),created_at:j().min(1)}).loose(),C0=P({type:to(`urn:ok:error:malformed-upload.urn:ok:error:collision-exhaustion.urn:ok:error:storage-full.urn:ok:error:storage-readonly.urn:ok:error:storage-error.urn:ok:error:no-file-received.urn:ok:error:path-escape.urn:ok:error:method-not-allowed.urn:ok:error:invalid-request.urn:ok:error:payload-too-large.urn:ok:error:request-timeout.urn:ok:error:internal-server-error.urn:ok:error:loopback-required.urn:ok:error:invalid-origin.urn:ok:error:url-not-allowed.urn:ok:error:dir-outside-home.urn:ok:error:concurrent-operation.urn:ok:error:clone-failed.urn:ok:error:clone-timeout.urn:ok:error:server-start-failed.urn:ok:error:reserved-doc-name.urn:ok:error:target-not-found.urn:ok:error:stale-target.urn:ok:error:frontmatter-edit-not-supported.urn:ok:error:invalid-frontmatter-patch.urn:ok:error:no-active-session.urn:ok:error:too-many-agent-sessions.urn:ok:error:doc-not-found.urn:ok:error:doc-already-exists.urn:ok:error:doc-not-open.urn:ok:error:rollback-not-configured.urn:ok:error:doc-not-available.urn:ok:error:backlink-index-not-configured.urn:ok:error:file-rescan-not-configured.urn:ok:error:shadow-not-configured.urn:ok:error:host-not-allowed.urn:ok:error:principal-not-available.urn:ok:error:not-found.urn:ok:error:auth-failed.urn:ok:error:no-project-dir.urn:ok:error:server-open-failed.urn:ok:error:doc-in-conflict.urn:ok:error:no-conflict-tracked.urn:ok:error:sync-not-active.urn:ok:error:project-repo-not-configured.urn:ok:error:seed-prerequisite-missing.urn:ok:error:seed-invalid-root.urn:ok:error:tag-index-not-configured.urn:ok:error:template-not-found.urn:ok:error:unsupported-asset-type.urn:ok:error:asset-not-found.urn:ok:error:collab-server-not-running.urn:ok:error:gateway-timeout.urn:ok:error:cursor-not-installed.urn:ok:error:cursor-spawn-timeout.urn:ok:error:cursor-spawn-failed.urn:ok:error:handoff-target-not-installed.urn:ok:error:handoff-spawn-timeout.urn:ok:error:handoff-spawn-failed`.split(`.`)),title:j().min(1),status:M().int().min(400).max(599),instance:j().regex(o0,`instance must be urn:uuid:<uuid>`).optional(),detail:j().optional()}).loose();P({parentDocName:j().min(1),agentId:j().min(1).optional(),agentName:j().min(1).optional()}).loose();var w0=P({src:j().min(1),path:j().min(1).optional(),deduped:Ba().optional()}).loose();P({url:j().min(1),dir:j().min(1),branch:j().min(1).refine(_0,`invalid branch name`).optional()}).loose(),P({type:F(`error`),problem:C0}).loose();function T0(e){return`https://claude.ai/new?q=${encodeURIComponent(e)}`}var E0=/notionvc:/i,D0=()=>e=>{O0(e)&&(k0(e),A0(e))};function O0(e){if(!(`children`in e)||!Array.isArray(e.children))return!1;for(let t of e.children){if(t.type===`comment`){let e=String(t.value??``);if(E0.test(e))return!0}if(t.type===`element`&&O0(t))return!0}return!1}function k0(e){if(!(`children`in e)||!Array.isArray(e.children))return;for(let t of e.children)t.type===`element`&&k0(t);let t=[];for(let n of e.children){if(n.type!==`text`){t.push(n);continue}let e=String(n.value??``);if(!e.includes(`
394
+ `)}case`WRITE_ERROR`:return`Failed to write config file: ${e.detail}`;case`OKIGNORE_INVALID`:return e.lineNumber===void 0?`.okignore: ${e.detail}`:`.okignore line ${e.lineNumber}: ${e.detail}`;case`UNKNOWN`:return e.message??`Unknown error.`}}function i$(e,t,n){return a$([e,t,n],[])}function a$(e,t){if(t.length>0){let n=Tu(yu,t);if(n?.scope===`user`)return e[0];if(n?.scope===`project`)return e[1]??e[0];if(n?.scope===`project-local`)return e[2]??e[1]??e[0]}let n=o$(e);if(n===void 0)return;if(n===null)return null;if(Array.isArray(n)||typeof n!=`object`)return n;let r=e.map(e=>s$(e)?e:void 0),i=new Set;for(let e of r)if(e!==void 0)for(let t of Object.keys(e))i.add(t);let a={};for(let e of i)a[e]=a$(r.map(t=>t===void 0?void 0:t[e]),[...t,e]);return a}function o$(e){for(let t=e.length-1;t>=0;t--)if(e[t]!==void 0)return e[t]}function s$(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var c$=2e3;function l$(e){let t=Date.now();for(let[n,r]of e.entries()){let i=r;i.timestamp&&t-i.timestamp>3e4&&e.delete(n)}}function u$(e,t){for(let[,n]of e.entries()){let e=n;if(e.timestamp&&e.timestamp>t)return!0}return!1}var d$=`__system__`,f$=`__config__/project`,p$=`__user__/config.yml`,m$=`__local__/project`,h$=`__config__/okignore`;Object.freeze([f$,m$,p$,h$]);var g$=[`invalid-args`,`nested-project`,`target-not-empty`,`mkdir-failed`,`git-init-failed`,`init-failed`,`discovery-failed`],_$=[`claude`,`claude-desktop`,`cursor`,`codex`],v$={claude:`Claude`,"claude-desktop":`Claude Desktop`,cursor:`Cursor`,codex:`Codex`},y$=[`incoming`,`outgoing`,`both`];function b$(e){return y$.includes(e)}var x$=[`image/jpeg`,`image/png`,`image/gif`,`image/webp`,`image/svg+xml`],S$=[`video/mp4`,`video/webm`,`video/ogg`],C$=[`audio/mpeg`,`audio/wav`,`audio/ogg`],w$=[`application/pdf`],T$=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`avif`,`svg`]),E$=new Set([`mp4`,`webm`,`mov`,`m4v`,`mkv`]),D$=new Set([`pdf`]),O$=new Set([`mp3`,`wav`,`ogg`,`m4a`,`flac`,`aac`,`opus`]),k$=new Set(`pdf.docx.xlsx.pptx.doc.xls.ppt.zip.7z.tar.gz.rar.csv.tsv.rtf.json.yaml.yml.xml.txt.pages.numbers.key.odt.ods.odp.epub.mobi`.split(`.`)),A$=new Set(`png.jpg.jpeg.gif.webp.avif.apng.heic.heif.tiff.bmp.ico.svg.pdf.mp4.webm.mov.m4v.mkv.mp3.wav.ogg.m4a.flac.aac.opus.json.toml`.split(`.`)),j$=`wikiembed`,M$=`toast`,N$=new Set(`png.jpg.jpeg.gif.webp.avif.svg.pdf.mp4.webm.mov.m4v.mkv.mp3.wav.ogg.m4a.flac.aac.opus.docx.xlsx.pptx.doc.xls.ppt.zip.7z.tar.gz.rar.csv.tsv.rtf.json.yaml.yml.xml.txt.pages.numbers.key.odt.ods.odp.epub.mobi`.split(`.`)),P$=[`png`,`jpg`,`jpeg`,`gif`,`webp`,`avif`],F$=[`mp4`,`webm`,`mov`,`m4v`],I$=[`mp3`,`wav`,`ogg`,`m4a`,`flac`,`aac`,`opus`],L$=[`pdf`],R$=[`json`,`toml`];function z$(e,t,n){for(let r of t)if(!n.has(r))throw Error(`${e}: ${r} is not present in canonical upload constants`)}z$(`SIDEBAR_IMAGE_ASSET_EXTENSIONS`,P$,T$),z$(`SIDEBAR_VIDEO_ASSET_EXTENSIONS`,F$,E$),z$(`SIDEBAR_AUDIO_ASSET_EXTENSIONS`,I$,O$),z$(`SIDEBAR_PDF_ASSET_EXTENSIONS`,L$,D$),z$(`FILE_ATTACHMENT_EXTENSIONS`,[...k$],N$);var B$=new Set(P$),V$=new Set(F$),H$=new Set(I$),U$=new Set(L$),W$=new Set(R$);z$(`SIDEBAR_RENDERABLE_ASSET_EXTENSIONS`,[...new Set([...P$,...F$,...I$,...L$,...R$])],A$);function G$(e){let t=e.toLowerCase().replace(/^\./,``);return B$.has(t)?`image`:V$.has(t)?`video`:H$.has(t)?`audio`:U$.has(t)?`pdf`:W$.has(t)?`text`:null}var K$=sS.extend({priority:60,addAttributes(){return{...this.parent?.(),fenceDelimiter:{default:"`"},fenceLength:{default:3},meta:{default:null},sourceStyle:{default:`fenced`}}}}),q$=bS.extend({name:`emphasis`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`*`}}},addInputRules(){return[Mx({find:hS,type:this.type,getAttributes:{sourceDelimiter:`*`}}),Mx({find:_S,type:this.type,getAttributes:{sourceDelimiter:`_`}})]}}),J$=mS.extend({name:`strong`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`**`}}},addInputRules(){return[Mx({find:lS,type:this.type,getAttributes:{sourceDelimiter:`**`}}),Mx({find:dS,type:this.type,getAttributes:{sourceDelimiter:`__`}})]}}),Y$=sx.create({name:`escapeMark`,priority:10,excludes:``,inclusive:!1,parseHTML(){return[{tag:`span[data-escape-mark]`}]},renderHTML(){return[`span`,{"data-escape-mark":``},0]}}),X$=SS.extend({priority:60,addAttributes(){return{...this.parent?.(),hardBreakStyle:{default:`backslash`}}}}),Z$=wS.extend({priority:60,addAttributes(){return{...this.parent?.(),headingStyle:{default:`atx`},sourceTrailingHashes:{default:null},sourceUnderlineLength:{default:null},sourceContiguousNext:{default:!1}}}}),Q$=eS.create({name:`htmlBlock`,group:`block`,atom:!0,priority:60,addAttributes(){return{content:{default:``}}},parseHTML(){return[{tag:`div[data-html-block]`}]},renderHTML({node:e}){return[`div`,{"data-html-block":``,class:`html-block`},e.attrs.content]}}),$$=eS.create({name:`jsxComponent`,group:`block`,atom:!1,content:`block*`,isolating:!0,selectable:!0,defining:!0,priority:60,addAttributes(){return{componentName:{default:``},kind:{default:`element`},attributes:{default:[]},sourceRaw:{default:``},sourceDirty:{default:!1},props:{default:{}}}},parseHTML(){return[{tag:`div[data-jsx-component]`,getAttrs:e=>typeof e==`string`?!1:{componentName:e.getAttribute(`data-component-name`)||``,sourceRaw:e.getAttribute(`data-source-raw`)||``}}]},renderHTML({HTMLAttributes:e}){return[`div`,{"data-jsx-component":``,"data-component-name":e.componentName,"data-source-raw":e.sourceRaw},0]},addCommands(){return{insertJsxComponent:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{sourceRaw:e}})}}}),e1=eS.create({name:`jsxInline`,group:`inline`,inline:!0,atom:!1,content:`text*`,isolating:!1,selectable:!0,priority:60,addAttributes(){return{}},parseHTML(){return[{tag:`span[data-jsx-inline]`}]},renderHTML(){return[`span`,{"data-jsx-inline":``},0]}}),t1=[`https`,`http`,`mailto`,`tel`,`ftp`,`sms`],n1=t1.map(e=>`${e}:`).join(`|`),r1=RegExp(`^(?:${n1}|\\/|#|\\?|\\.\\/|\\.\\.\\/)`,`i`);function i1(e){let t=e.trim();return t===``?!0:r1.test(t)}function a1(e){let t=e.trim();if(t===``)return!0;let n=t.indexOf(`:`);if(n===-1)return!0;let r=t.indexOf(`/`),i=t.indexOf(`?`),a=t.indexOf(`#`);return n>Math.min(r===-1?1/0:r,i===-1?1/0:i,a===-1?1/0:a)}var o1=new Set(t1.map(e=>`${e}:`)),s1=`https://placeholder.invalid`;function c1(e){try{let t=new URL(e,s1);return o1.has(t.protocol.toLowerCase())}catch{return!1}}var l1=Bw.extend({priority:60,addOptions(){return{openOnClick:!1,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer`},isAllowedUri:c1,validate:c1,shouldAutoLink:()=>!0}},addAttributes(){return{...this.parent?.(),linkStyle:{default:`inline`,rendered:!1},refLabel:{default:null,rendered:!1},sourceForm:{default:null,rendered:!1},target:{default:null,rendered:!1},anchor:{default:null,rendered:!1},alias:{default:null,rendered:!1},sourceUrlForm:{default:null,rendered:!1},sourceTitleMarker:{default:null,rendered:!1}}}}),u1=eS.create({name:`linkRefDef`,group:`block`,atom:!0,priority:60,addAttributes(){return{label:{default:``},href:{default:``},title:{default:null},sourceLayout:{default:null},sourceTitleMarker:{default:null}}},parseHTML(){return[{tag:`div[data-link-ref-def]`}]},renderHTML({node:e}){let{label:t,href:n,title:r}=e.attrs;return[`div`,{"data-link-ref-def":``,class:`link-ref-def`},r?`[${t}]: ${n} "${r}"`:`[${t}]: ${n}`]}});function d1(e){return e.type.name===`list`&&!e.attrs.ordered}function f1(e){return e.type.name===`list`&&!!e.attrs.ordered}function p1(e){let t=!1;return e.forEach(e=>{e.type.name===`listItem`&&e.attrs.checked!==null&&(t=!0)}),t}function m1(e,t,n,r,i,a,o){let s=Iy(e=>e.type.name===`list`)(e.selection);if(s&&i(s.node)){let{$from:n,$to:i}=e.selection;return n.blockRange(i)?Tm(r)(e,t):!1}if(s){if(!t)return!0;let{tr:n}=e;return n.setNodeMarkup(s.pos,void 0,{...s.node.attrs,...a}),o!==void 0&&s.node.forEach((e,t)=>{if(e.type.name===`listItem`){let r=s.pos+1+t;n.setNodeMarkup(r,void 0,{...e.attrs,...o})}}),t(n),!0}return wm(n,a)(e,void 0)?t?wm(n,a)(e,n=>{if(o){let t=n.mapping.map(e.selection.$from.pos),r=n.doc.resolve(t);for(let e=r.depth;e>0;e--){let t=r.node(e);if(t.type.name===`listItem`){n.setNodeMarkup(r.before(e),void 0,{...t.attrs,...o});break}}}t(n)}):!0:!1}var h1=eS.create({name:`list`,group:`block list`,content:`listItem+`,priority:60,addAttributes(){return{ordered:{default:!1},start:{default:1},spread:{default:!1},bulletMarker:{default:null},listMarkerDelimiter:{default:null}}},parseHTML(){return[{tag:`ul`,getAttrs:()=>({ordered:!1})},{tag:`ol`,getAttrs:e=>({ordered:!0,start:e.getAttribute(`start`)?Number(e.getAttribute(`start`)):1})}]},renderHTML({node:e,HTMLAttributes:t}){let n=e.attrs.ordered?`ol`:`ul`,r={};return e.attrs.ordered&&e.attrs.start!==1&&(r.start=e.attrs.start),[n,Gy(t,r),0]},addCommands(){return{toggleBulletList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:m1(e,t,n,r,e=>d1(e)&&!p1(e),{ordered:!1},{checked:null})},toggleOrderedList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:m1(e,t,n,r,e=>f1(e),{ordered:!0},{checked:null})},toggleTaskList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:m1(e,t,n,r,e=>d1(e)&&p1(e),{ordered:!1},{checked:!1})}}},addInputRules(){return[Fx({find:/^\s*([-+*])(?!\s*\[[ xX]\])\s$/,type:this.type,getAttributes:e=>({ordered:!1,bulletMarker:e[1]})}),Fx({find:/^\s*(\d+)([.)])\s$/,type:this.type,getAttributes:e=>({ordered:!0,start:Number(e[1]),listMarkerDelimiter:e[2]})}),new $b({find:/^\s*[-*+]\s\[([ xX])\]\s$/,handler:({state:e,range:t,match:n})=>{let r=e.schema.nodes.list;if(!r)return null;let i=n[1]!==` `,a=e.tr.delete(t.from,t.to),o=a.doc.resolve(t.from).blockRange();if(!o)return null;let s=Ff(o,r,{ordered:!1});if(!s)return null;a.wrap(o,s);let c=a.doc.resolve(a.mapping.map(t.from));for(let e=c.depth;e>0;e--){let t=c.node(e);if(t.type.name===`listItem`){a.setNodeMarkup(c.before(e),void 0,{...t.attrs,checked:i});break}}}})]},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList(),"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList(),"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),g1=eS.create({name:`listItem`,content:`paragraph block*`,defining:!0,addAttributes(){return{checked:{default:null},spread:{default:!1}}},parseHTML(){return[{tag:`li`,getAttrs:e=>{let t=e.querySelector(`input[type="checkbox"]`);return{checked:t?t.checked:null}}}]},renderHTML({node:e,HTMLAttributes:t}){return e.attrs.checked===null?[`li`,Gy(t),0]:[`li`,Gy(t,{"data-type":`taskItem`,"data-checked":e.attrs.checked?`true`:`false`}),[`label`,{contenteditable:`false`},[`input`,{type:`checkbox`,...e.attrs.checked?{checked:`checked`}:{}}]],[`div`,0]]},addNodeView(){return({node:e,getPos:t,editor:n,HTMLAttributes:r})=>{let i=document.createElement(`li`);Object.entries(Gy(r,e.attrs.checked===null?{}:{"data-type":`taskItem`,"data-checked":String(!!e.attrs.checked)})).forEach(([e,t])=>{t!=null&&i.setAttribute(e,String(t))});let a=null,o=null,s=document.createElement(`div`);return e.attrs.checked!==null&&(a=document.createElement(`label`),a.contentEditable=`false`,o=document.createElement(`input`),o.type=`checkbox`,o.checked=!!e.attrs.checked,n.isEditable||(o.disabled=!0),o.addEventListener(`change`,()=>{let r=t();r===void 0||typeof r!=`number`||n.view.dispatch(n.view.state.tr.setNodeMarkup(r,void 0,{...e.attrs,checked:o?.checked??!1}))}),a.appendChild(o),i.appendChild(a)),i.appendChild(s),{dom:i,contentDOM:s,update(t){return t.type!==e.type||t.attrs.checked!==null!=(e.attrs.checked!==null)?!1:(o&&t.attrs.checked!==null&&(o.checked=!!t.attrs.checked,i.setAttribute(`data-checked`,String(!!t.attrs.checked))),e=t,!0)}}}},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>{let{$from:e}=this.editor.state.selection;for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return this.editor.commands.sinkListItem(this.name);return!1},"Shift-Tab":()=>{let{$from:e}=this.editor.state.selection;for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return this.editor.commands.liftListItem(this.name);return!1}}}}),_1=h1,v1=g1,y1=eS.create({name:`mathInline`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,addAttributes(){return{formula:{default:``},id:{default:null},language:{default:`latex`}}},parseHTML(){return[{tag:`span[data-math-inline]`,getAttrs:e=>typeof e==`string`?!1:{formula:e.getAttribute(`data-formula`)||``,id:e.getAttribute(`id`)||null,language:e.getAttribute(`data-language`)||`latex`}}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-math-inline":``,"data-formula":e.formula,"data-language":e.language,...e.id?{id:e.id}:{}}]},addCommands(){return{insertMathInline:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{formula:e}})}}}),b1=eS.create({name:`rawMdxFallback`,group:`block`,atom:!1,content:`text*`,isolating:!0,selectable:!0,defining:!0,priority:60,addAttributes(){return{reason:{default:``},originalSpan:{default:{start:0,end:0}}}},parseHTML(){let e=e=>typeof e==`string`?!1:{reason:e.getAttribute(`data-reason`)||``};return[{tag:`div[data-raw-mdx-fallback]`,getAttrs:e},{tag:`pre[data-raw-mdx-fallback]`,getAttrs:e}]},renderHTML({HTMLAttributes:e}){return[`div`,{"data-raw-mdx-fallback":``,"data-raw-badge":`raw`,"data-reason":e.reason,contenteditable:`false`,class:`raw-mdx-fallback`},0]},addNodeView(){return({HTMLAttributes:e})=>{let t=document.createElement(`div`);t.setAttribute(`data-raw-mdx-fallback`,``),t.setAttribute(`data-raw-badge`,`raw`),t.setAttribute(`contenteditable`,`false`),t.classList.add(`raw-mdx-fallback`),e.reason&&t.setAttribute(`data-reason`,e.reason);let n=document.createElement(`pre`);return n.classList.add(`raw-mdx-fallback-content`),n.setAttribute(`contenteditable`,`false`),t.appendChild(n),{dom:t,contentDOM:n,ignoreMutation:()=>!0}}}}),x1=ZE.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceMarkerSpacings:{default:null}}}}),S1=tD.extend({excludes:``,addAttributes(){return{...this.parent?.(),sourceFenceChar:{default:"`"},sourceFenceLength:{default:1}}}}),C1=eS.create({name:`commentBlock`,group:`block`,content:`block+`,defining:!0,priority:60,addAttributes(){return{sourceForm:{default:`percent`,parseHTML:e=>e.getAttribute(`data-source-form`)===`html`?`html`:`percent`,renderHTML:e=>e.sourceForm===`html`?{"data-source-form":`html`}:{}},sourceLayout:{default:`block`,parseHTML:e=>e.getAttribute(`data-source-layout`)===`inline`?`inline`:`block`,renderHTML:e=>e.sourceLayout===`inline`?{"data-source-layout":`inline`}:{}}}},parseHTML(){return[{tag:`aside[data-comment-block]`},{tag:`aside.comment-block`}]},renderHTML({HTMLAttributes:e}){return[`aside`,{"data-comment-block":``,"data-clipboard-omit":`true`,class:`comment-block`,style:`display: none;`,...e},0]},addCommands(){return{setCommentBlock:()=>({commands:e})=>e.wrapIn(this.name),toggleCommentBlock:()=>({commands:e})=>e.toggleWrap(this.name),unsetCommentBlock:()=>({commands:e})=>e.lift(this.name)}}}),w1=sx.create({name:`comment`,priority:10,excludes:``,inclusive:!1,addAttributes(){return{sourceForm:{default:`percent`,parseHTML:e=>e.getAttribute(`data-source-form`)===`html`?`html`:`percent`,renderHTML:e=>e.sourceForm===`html`?{"data-source-form":`html`}:{}}}},parseHTML(){return[{tag:`span[data-comment-mark]`}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-comment-mark":``,"data-clipboard-omit":`true`,class:`comment-mark`,style:`display: none;`,...e},0]},addCommands(){return{setComment:()=>({commands:e})=>e.setMark(this.name),toggleComment:()=>({commands:e})=>e.toggleMark(this.name),unsetComment:()=>({commands:e})=>e.unsetMark(this.name)}}}),T1=eS.create({name:`footnoteDefinition`,group:`block`,content:`block+`,defining:!0,priority:60,addAttributes(){return{identifier:{default:``},label:{default:null}}},parseHTML(){let e=e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-footnote-id`)||``;return{identifier:t,label:t||null}};return[{tag:`aside[data-footnote-def]`,getAttrs:e},{tag:`aside.footnote-def`,getAttrs:e}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.identifier??``);return[`aside`,{...t,"data-footnote-def":``,"data-footnote-id":n,id:`fn-${n}`,class:`footnote-def`},[`div`,{class:`footnote-body`},0],[`a`,{href:`#fnref-${n}`,class:`footnote-backref`,contentEditable:`false`,"aria-label":`Back to reference`},`↩`]]},addCommands(){return{insertFootnoteDefinition:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{identifier:e,label:e},content:[{type:`paragraph`}]})}}}),E1=eS.create({name:`footnoteReference`,group:`inline`,inline:!0,atom:!0,selectable:!0,draggable:!1,priority:60,addAttributes(){return{identifier:{default:``},label:{default:null}}},parseHTML(){return[{tag:`sup[data-footnote-ref]`,getAttrs:e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-footnote-id`)||``;return{identifier:t,label:t||null}}}]},renderHTML({node:e}){let t=String(e.attrs.identifier??``);return[`sup`,{id:`fnref-${t}`,"data-footnote-ref":``,"data-footnote-id":t,class:`footnote-ref`},[`a`,{href:`#fn-${t}`,class:`footnote-ref-link`},`[${t}]`]]},addCommands(){return{insertFootnoteReference:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{identifier:e,label:e}})}}}),D1=eS.create({name:`imageReference`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{alt:{default:``},label:{default:``},identifier:{default:``},referenceType:{default:`shortcut`}}},parseHTML(){return[{tag:`img[data-image-reference]`}]},renderHTML({node:e}){let{alt:t,label:n,referenceType:r}=e.attrs;return[`img`,{"data-image-reference":``,"data-reference-type":r,"data-label":n,alt:t||n}]}});function O1(e){if(typeof e!=`string`||!e.startsWith(`/`))return e;let t=globalThis.window?.okDesktop?.config?.apiOrigin;return typeof t==`string`&&t?t+e:e}var k1=lne.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceUrl:{default:null,rendered:!1}}},renderHTML({HTMLAttributes:e}){let t=Gy(this.options.HTMLAttributes,e);return typeof t.src==`string`&&(t.src=O1(t.src)),[`img`,t]}}),A1=sx.create({name:`sourceLiteral`,priority:10,excludes:``,inclusive:!1,addAttributes(){return{sourceRaw:{default:``}}},parseHTML(){return[{tag:`span[data-source-literal]`}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-source-literal":``,...e},0]}});function j1(e,t){if(typeof e!=`string`||typeof t!=`string`||/[\x00-\x1F\x7F]/.test(e))return!1;let n=e.replaceAll(`\xA0`,` `),r=t.replaceAll(`\xA0`,` `);return n===r?!0:M1(n)===r}function M1(e){return e.replace(/\\([!-/:-@[-`{-~])/g,`$1`)}var N1=JE.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDashCounts:{default:null}}}}),P1=NE.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),F1=PE.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),I1=eS.create({name:`tag`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,addAttributes(){return{value:{default:``}}},parseHTML(){return[{tag:`a[data-tag]`,getAttrs:e=>typeof e==`string`?!1:{value:e.getAttribute(`data-tag`)||``}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.value??``);return[`a`,{...t,"data-tag":n,href:`#tag/${n}`,class:`tag`},`#${n}`]},addCommands(){return{insertTag:e=>({chain:t})=>t().insertContent({type:`tag`,attrs:{value:e}}).run()}}}),L1=/^(?:---|—-|___\s|\*\*\*\s)$/;function R1(e){let t=String(e[0]??``).replace(/\s+$/,``);return t===`—-`?`---`:t}var z1=iD.extend({name:`thematicBreak`,priority:60,addAttributes(){return{...this.parent?.(),sourceRaw:{default:`---`}}},addInputRules(){return[Nx({find:L1,type:this.type,getAttributes:e=>({sourceRaw:R1(e)})})]}});function B1(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function V1(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}var H1=eS.create({name:`wikiLink`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{target:{default:``},alias:{default:null},anchor:{default:null},resolved:{default:!1}}},parseHTML(){return[{tag:`span[data-wiki-link]`,getAttrs:e=>typeof e==`string`?!1:{target:e.getAttribute(`data-target`)||``,alias:B1(e.getAttribute(`data-alias`)),anchor:B1(e.getAttribute(`data-anchor`)),resolved:e.getAttribute(`data-resolved`)===`true`}},{tag:`a.wiki-link[data-target]`,priority:100,getAttrs:e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-target`)??``;return t?{target:t,alias:B1(e.getAttribute(`data-alias`)),anchor:B1(e.getAttribute(`data-anchor`)),resolved:!1}:!1}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=B1(e.attrs.alias),i=B1(e.attrs.anchor),a=e.attrs.resolved===!0;return[`span`,{...t,"data-wiki-link":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,"data-resolved":a?`true`:`false`},V1({target:n,alias:r,anchor:i})]}});function U1(e){let t=e.split(`/`).pop()??e,n=t.lastIndexOf(`.`);return n<=0||n===t.length-1?``:t.slice(n+1).toLowerCase()}function W1(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}var G1=eS.create({name:`wikiLinkEmbed`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{target:{default:``},alias:{default:null},anchor:{default:null},resolvedSrc:{default:null,rendered:!1,parseHTML:()=>null}}},parseHTML(){let e=e=>typeof e==`string`||!e.hasAttribute(`data-wiki-embed`)?!1:{target:e.getAttribute(`data-target`)||``,alias:B1(e.getAttribute(`data-alias`)),anchor:B1(e.getAttribute(`data-anchor`))};return[{tag:`img[data-wiki-embed]`,getAttrs:e,priority:100},{tag:`a[data-wiki-embed]`,getAttrs:e,priority:100}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=B1(e.attrs.alias),i=B1(e.attrs.anchor),a=B1(e.attrs.resolvedSrc),o=U1(n);if(T$.has(o))return[`img`,{...t,"data-wiki-embed":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,src:a??n,alt:r??n}];let s=a??n;return[`a`,{...t,"data-wiki-embed":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,href:i?`${s}#${i}`:s,target:`_blank`,rel:`noopener noreferrer`},W1({target:n,alias:r,anchor:i})]}}),K1=[$$,b1,e1,y1,H1,G1,I1,_1,v1,q$,J$,S1,K$,x1,Z$,z1,l1,Q$,u1,X$,Y$,A1,sne.configure({undoRedo:!1,bulletList:!1,orderedList:!1,listItem:!1,italic:!1,bold:!1,code:!1,codeBlock:!1,heading:!1,horizontalRule:!1,hardBreak:!1,link:!1,blockquote:!1,dropcursor:{color:`color-mix(in oklch, var(--primary) 50%, transparent)`,width:2}}),N1.configure({resizable:!0}),FE,F1,P1,k1.configure({inline:!0}),D1,Uw,w1,C1,E1,T1],q1=/^[a-zA-Z][\w/-]*$/;function J1(e,t){let n=encodeURIComponent(t.projectDir);if(t.prompt===``)return`claude://${e.mode}/new?folder=${n}`;let r=encodeURIComponent(t.prompt);return`claude://${e.mode}/new?q=${r}&folder=${n}`}function Y1(e){let t=encodeURIComponent(e.projectDir);return e.prompt===``?`codex://new?path=${t}`:`codex://new?prompt=${encodeURIComponent(e.prompt)}&path=${t}`}function X1(e){let t=Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`));return t<0?e:e.substring(t+1)}function Z1(e){let t=encodeURIComponent(X1(e.projectDir));return e.prompt===``?`cursor://anysphere.cursor-deeplink/prompt?workspace=${t}&mode=agent`:`cursor://anysphere.cursor-deeplink/prompt?text=${encodeURIComponent(encodeURIComponent(e.prompt))}&workspace=${t}&mode=agent`}var Q1=RegExp("[\\u0000-\\u001f\\u007f-\\u009f\\u200b-\\u200f\\u2028-\\u202e\\u2060-\\u2069\\ufeff`]+",`g`);function $1(e){return e.replace(Q1,`_`)}function e0(e){return`Let's work on \`${$1(e)}\` using Open Knowledge. Open the OK editor in web view.`}function t0(e){return`Let's work on the \`${$1(e)}\` folder using Open Knowledge. Open the OK editor in web view.`}function n0(){return`Let's work on this project using Open Knowledge. Open the OK editor in web view.`}var r0=j().refine(e=>!e.includes(`..`)&&!e.startsWith(`/`)&&!e.includes(`\0`)&&!e.includes(`\\`),{message:`docName contains unsafe path characters`}).optional(),i0={agentId:j().optional(),agentName:j().optional(),colorSeed:j().optional(),clientName:j().optional(),clientVersion:j().optional(),label:j().optional()},a0=j().optional(),o0=/^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;P({docPath:j().min(1)}).loose();var s0=to([`no-remote`,`detached-head`,`branch-not-on-origin`,`non-github-remote`,`invalid-path`]),c0=Qa(`ok`,[P({ok:F(!0),shareUrl:j().min(1),blobUrl:j().min(1),branch:j().min(1)}).loose(),P({ok:F(!1),error:s0,branch:j().min(1).optional()}).loose()]),l0=to([`user`,`org`]),u0=P({login:j().min(1),kind:l0,avatarUrl:j().optional()}).loose(),d0=to([`auth-required`,`network`]),f0=Qa(`ok`,[P({ok:F(!0),owners:N(u0)}).loose(),P({ok:F(!1),error:d0}).loose()]),p0=Qa(`ok`,[P({ok:F(!0),available:Ba()}).loose(),P({ok:F(!1),error:d0}).loose()]),m0=to([`public`,`private`]);P({owner:j().min(1),name:j().min(1),visibility:m0,description:j().optional()}).loose();var h0=to([`name-conflict`,`saml-sso`,`auth-required`,`push-failed`,`init-failed`,`network`,`no-project`]),g0=Qa(`ok`,[P({ok:F(!0),ownerLogin:j().min(1),repoName:j().min(1),cloneUrl:j().min(1),defaultBranch:j().min(1)}).loose(),P({ok:F(!1),error:h0}).loose()]);function _0(e){return!(typeof e!=`string`||e.length===0||e.startsWith(`-`)||/[\x00-\x1F\x7F]/.test(e)||/\s/.test(e)||e.includes(`:`)||e.split(`/`).includes(`..`))}var v0=e=>e.refine(_0,`invalid branch name`),y0={shareFileExists:Ba(),dirtyConflicts:P({conflicts:Ba(),files:N(j().min(1))}).loose(),branchIsLocal:Ba()};Qa(`detached`,[P({detached:F(!1),currentBranch:j().min(1).nullable(),currentHeadSha:Ha(),...y0}).loose(),P({detached:F(!0),currentBranch:Ha(),currentHeadSha:j().min(1),...y0}).loose()]),P({branch:v0(j().min(1)),principalId:j().optional()}).loose();var b0=to([`dirty-conflict`,`branch-not-found`,`fetch-failed`,`checkout-failed`]);Qa(`ok`,[P({ok:F(!0)}).loose(),P({ok:F(!1),reason:b0,files:N(j().min(1)).optional()}).loose()]);var x0=P({serverInstanceId:j().min(1),currentBranch:j().min(1).optional(),currentDiskAckSVs:$a(j().min(1),j().min(1)).optional()}).loose(),S0=P({id:j().min(1),display_name:j().min(1),display_email:j(),source:to([`git-config`,`synthesized`]),created_at:j().min(1)}).loose(),C0=P({type:to(`urn:ok:error:malformed-upload.urn:ok:error:collision-exhaustion.urn:ok:error:storage-full.urn:ok:error:storage-readonly.urn:ok:error:storage-error.urn:ok:error:no-file-received.urn:ok:error:path-escape.urn:ok:error:method-not-allowed.urn:ok:error:invalid-request.urn:ok:error:payload-too-large.urn:ok:error:request-timeout.urn:ok:error:internal-server-error.urn:ok:error:loopback-required.urn:ok:error:invalid-origin.urn:ok:error:url-not-allowed.urn:ok:error:dir-outside-home.urn:ok:error:concurrent-operation.urn:ok:error:clone-failed.urn:ok:error:clone-timeout.urn:ok:error:server-start-failed.urn:ok:error:reserved-doc-name.urn:ok:error:target-not-found.urn:ok:error:stale-target.urn:ok:error:frontmatter-edit-not-supported.urn:ok:error:invalid-frontmatter-patch.urn:ok:error:no-active-session.urn:ok:error:too-many-agent-sessions.urn:ok:error:doc-not-found.urn:ok:error:doc-already-exists.urn:ok:error:doc-not-open.urn:ok:error:rollback-not-configured.urn:ok:error:doc-not-available.urn:ok:error:backlink-index-not-configured.urn:ok:error:file-rescan-not-configured.urn:ok:error:shadow-not-configured.urn:ok:error:host-not-allowed.urn:ok:error:principal-not-available.urn:ok:error:not-found.urn:ok:error:auth-failed.urn:ok:error:no-project-dir.urn:ok:error:server-open-failed.urn:ok:error:doc-in-conflict.urn:ok:error:no-conflict-tracked.urn:ok:error:sync-not-active.urn:ok:error:project-repo-not-configured.urn:ok:error:seed-prerequisite-missing.urn:ok:error:seed-invalid-root.urn:ok:error:tag-index-not-configured.urn:ok:error:template-not-found.urn:ok:error:unsupported-asset-type.urn:ok:error:asset-not-found.urn:ok:error:collab-server-not-running.urn:ok:error:gateway-timeout.urn:ok:error:cursor-not-installed.urn:ok:error:cursor-spawn-timeout.urn:ok:error:cursor-spawn-failed.urn:ok:error:handoff-target-not-installed.urn:ok:error:handoff-spawn-timeout.urn:ok:error:handoff-spawn-failed`.split(`.`)),title:j().min(1),status:M().int().min(400).max(599),instance:j().regex(o0,`instance must be urn:uuid:<uuid>`).optional(),detail:j().optional()}).loose();P({parentDocName:j().min(1),agentId:j().min(1).optional(),agentName:j().min(1).optional()}).loose();var w0=P({src:j().min(1),path:j().min(1).optional(),deduped:Ba().optional()}).loose();P({url:j().min(1),dir:j().min(1),branch:j().min(1).refine(_0,`invalid branch name`).optional()}).loose(),P({type:F(`error`),problem:C0}).loose();function T0(e){return`https://claude.ai/new?q=${encodeURIComponent(e)}`}var E0=/notionvc:/i,D0=()=>e=>{O0(e)&&(k0(e),A0(e))};function O0(e){if(!(`children`in e)||!Array.isArray(e.children))return!1;for(let t of e.children){if(t.type===`comment`){let e=String(t.value??``);if(E0.test(e))return!0}if(t.type===`element`&&O0(t))return!0}return!1}function k0(e){if(!(`children`in e)||!Array.isArray(e.children))return;for(let t of e.children)t.type===`element`&&k0(t);let t=[];for(let n of e.children){if(n.type!==`text`){t.push(n);continue}let e=String(n.value??``);if(!e.includes(`
395
395
  `)){t.push(n);continue}let r=e.split(`
396
396
  `);for(let e=0;e<r.length;e++)r[e]&&t.push({type:`text`,value:r[e]??``}),e<r.length-1&&t.push({type:`element`,tagName:`br`,properties:{},children:[]})}e.children=t}function A0(e){if(!(!(`children`in e)||!Array.isArray(e.children))){e.children=e.children.filter(e=>e.type===`comment`?!E0.test(String(e.value??``)):!0);for(let t of e.children)t.type===`element`&&A0(t)}}var j0=new Set([`Apple-tab-span`,`Apple-converted-space`,`Apple-style-span`]),M0=()=>e=>{N0(e)};function N0(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&N0(t);e.children=e.children.flatMap(e=>{if(e.type!==`element`)return[e];let t=e;return P0(t)?[]:F0(t)?t.children:[t]})}}function P0(e){if(e.tagName!==`meta`)return!1;let t=e.properties?.name,n=e.properties?.content;return t===`Generator`&&typeof n==`string`&&/Cocoa/i.test(n)}function F0(e){if(e.tagName!==`span`)return!1;let t=e.properties?.className;return Array.isArray(t)?t.length>0&&t.every(e=>j0.has(String(e))):!1}var I0=`docs-internal-guid-`;function L0(e,t){let n=e.children[t];!n||n.type!==`element`||e.children.splice(t,1,...n.children)}var R0=()=>e=>{z0(e)};function z0(e){if(!(`children`in e)||!Array.isArray(e.children))return;for(let t of e.children)t.type===`element`&&z0(t);let t=0;for(;t<e.children.length;){let n=e.children[t];if(!n||n.type!==`element`){t++;continue}let r=n;if(B0(r)||V0(r)){L0(e,t);continue}t++}}function B0(e){if(e.tagName!==`b`)return!1;let t=e.properties?.id;return typeof t==`string`&&t.startsWith(I0)}function V0(e){if(e.tagName!==`div`||e.properties?.dir!==`ltr`)return!1;let t=e.children.filter(e=>e.type===`element`);return t.length===1?t[0]?.tagName===`table`:!1}var H0=new Set([`commit-link`,`user-mention`,`team-mention`,`issue-link`]),U0=()=>e=>{W0(e)};function W0(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&W0(t);for(let t of e.children)t.type===`element`&&G0(t)}}function G0(e){if(!e.properties)return;for(let t of Object.keys(e.properties))t.startsWith(`dataHovercard`)&&delete e.properties[t];let t=e.properties.className;if(Array.isArray(t)){let n=t.filter(e=>!H0.has(String(e)));n.length===0?delete e.properties.className:e.properties.className=n}}var K0=/^gmail_/,q0=()=>e=>{J0(e)};function J0(e){if(!(`children`in e)||!Array.isArray(e.children))return;for(let t of e.children)t.type===`element`&&J0(t);let t=0;for(;t<e.children.length;){let n=e.children[t];if(n.type!==`element`){t++;continue}let r=n;if(r.tagName===`div`&&Y0(r,`gmail_quote`)&&(r.tagName=`blockquote`),X0(r),Z0(r)){e.children.splice(t,1,...r.children);continue}t++}}function Y0(e,t){let n=e.properties?.className;return Array.isArray(n)?n.some(e=>String(e)===t):!1}function X0(e){let t=e.properties?.className;if(!Array.isArray(t))return;let n=t.filter(e=>!K0.test(String(e)));n.length===0?delete e.properties?.className:e.properties&&(e.properties.className=n)}function Z0(e){if(e.tagName!==`div`||e.properties?.dir!==`ltr`)return!1;let t=e.properties?.className;return t!=null&&!(Array.isArray(t)&&t.length===0)?!1:e.children.filter(e=>e.type===`element`).length<=1}var Q0=()=>e=>{$0(e)};function $0(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&$0(t);e.children=e.children.flatMap(e=>{if(e.type!==`element`)return[e];let t=e;return t.tagName===`google-sheets-html-origin`?t.children:t.tagName===`style`?[]:(e2(t),[t])})}}function e2(e){if(e.properties)for(let t of Object.keys(e.properties))t.startsWith(`dataSheets`)&&delete e.properties[t]}var t2=[`o:`,`w:`,`m:`,`v:`,`u1:`],n2=/^Mso[A-Z]/,r2=/^\s*\[if\s+[^\]]*\]/,i2=()=>e=>{a2(e)};function a2(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&a2(t);e.children=e.children.flatMap(e=>{if(e.type===`comment`){let t=String(e.value??``);return r2.test(t)?[]:[e]}if(e.type!==`element`)return[e];let t=e;return o2(t)?[]:(s2(t),[t])})}}function o2(e){return t2.some(t=>e.tagName.startsWith(t))}function s2(e){let t=e.properties;if(!t)return;let n=t.className;if(Array.isArray(n)){let e=n.filter(e=>typeof e==`string`&&!n2.test(e));e.length===0?delete t.className:t.className=e}else typeof n==`string`&&n2.test(n)&&delete t.className;let r=t.style;typeof r==`string`&&/mso-/i.test(r)&&delete t.style;for(let e of Object.keys(t))if(e.startsWith(`xmlns:`)){let n=e.slice(6);t2.some(e=>e===`${n}:`)&&delete t[e]}}var c2=/^c-(message_kit__|message__|compose|timestamp)/,l2=()=>e=>{u2(e)};function u2(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&u2(t);e.children=e.children.flatMap(e=>{if(e.type!==`element`)return[e];let t=e;return d2(t)?[]:(f2(t),[t])})}}function d2(e){let t=e.properties?.className;return Array.isArray(t)?t.some(e=>String(e)===`c-timestamp`||String(e).startsWith(`c-timestamp`)):!1}function f2(e){let t=e.properties?.className;if(!Array.isArray(t))return;let n=t.filter(e=>!c2.test(String(e)));n.length===0?delete e.properties?.className:e.properties&&(e.properties.className=n)}var p2=()=>e=>{m2(e)};function m2(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&m2(t);for(let t=0;t<e.children.length;t++){let n=e.children[t];if(n.type!==`element`)continue;let r=n;h2(r)&&(e.children[t]=_2(r))}}}function h2(e){if(e.tagName!==`div`)return!1;let t=e.children.filter(e=>e.type===`element`&&e.tagName===`div`);return t.length<2?!1:t.some(e=>g2(e))}function g2(e){for(let t of e.children){if(t.type!==`element`)continue;let e=t,n=e.properties?.style;if(typeof n==`string`&&/color\s*:/i.test(n)||g2(e))return!0}return!1}function _2(e){return{type:`element`,tagName:`pre`,properties:{},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:e.children.filter(e=>e.type===`element`&&e.tagName===`div`).map(e=>v2(e)).join(`
397
397
  `)}]}]}}function v2(e){let t=``;for(let n of e.children)n.type===`text`?t+=n.value??``:n.type===`element`&&(t+=v2(n));return t}var y2=class extends Error{htmlBytes;maxBytes;constructor(e,t){super(`HTML payload (${e} bytes) exceeds htmlToMdast ceiling (${t} bytes); falling through to plain text`),this.name=`HtmlPayloadTooLargeError`,this.htmlBytes=e,this.maxBytes=t}},b2=[R0,i2,M0,q0,D0,p2,Q0,l2,U0];function x2(e){VP(e,e=>{e.type===`strong`?(e.data??={},e.data.sourceDelimiter=`**`):e.type===`emphasis`?(e.data??={},e.data.sourceDelimiter=`*`):e.type===`inlineCode`?(e.data??={},e.data.sourceFenceChar="`",e.data.sourceFenceLength=1):e.type===`code`&&(e.data??={},e.data.sourceFenceChar="`",e.data.sourceFenceLength=3)})}function S2(e,t){let n=t?.maxBytes??5242880;if(e.length>n)throw new y2(e.length,n);let r=MH().use(zN,{fragment:!0});for(let e of b2)r.use(e);for(let e of t?.additionalCleanupPlugins??[])r.use(e);r.use(BI);let i=r.parse(e),a=r.runSync(i);return x2(a),a}function C2(e){return String(MH().use(CH).use(wH).stringify(e))}function w2(e,t){let n=Array.isArray(e.attrs.attributes)?e.attrs.attributes.filter(e=>typeof e==`object`&&!!e&&`type`in e):[],r=e.attrs.props??{},i=new Map,a=new Set;if(t)for(let e of t)e.omitOnDefault===!0&&`defaultValue`in e&&e.defaultValue!==void 0&&i.set(e.name,e.defaultValue),e.type===`string`&&e.required===!1&&e.defaultValue===void 0&&a.add(e.name);for(let[e,t]of Object.entries(r)){let r=n.findIndex(t=>t.type===`mdxJsxAttribute`&&t.name===e);if(i.has(e)&&Object.is(i.get(e),t)){r>=0&&n.splice(r,1);continue}if(a.has(e)&&t===``){r>=0&&n.splice(r,1);continue}let o=T2(e,t);r>=0?n[r]=o:n.push(o)}return n}function T2(e,t){if(t===!0)return{type:`mdxJsxAttribute`,name:e,value:null};if(t===!1)return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:`false`}};if(t==null)return{type:`mdxJsxAttribute`,name:e,value:null};if(typeof t==`string`)return{type:`mdxJsxAttribute`,name:e,value:t};if(typeof t==`number`)return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:JSON.stringify(t)}};if(typeof t==`object`){let n;try{n=JSON.stringify(t)}catch{n=String(t)}return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:n}}}return{type:`mdxJsxAttribute`,name:e,value:String(t)}}function E2(e,t,n,r){return{type:`mdxJsxFlowElement`,name:e,attributes:w2(t,r),children:n.all(t),data:{}}}var D2=/^[A-Za-z0-9]{20,}$/,O2=/^(?:\d+s?|(?:\d+h)?(?:\d+m)?(?:\d+s)?)$/;function k2(e){let t=e.toLowerCase();return t===`loom.com`||t===`www.loom.com`}function A2(e){let t=e.pathname.match(/^\/(?:share|embed)\/([A-Za-z0-9]+)\/?$/);if(!t)return null;let n=t[1]??``;return D2.test(n)?n:null}function j2(e){if(typeof e!=`string`||e.length===0)return null;let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`http:`&&t.protocol!==`https:`||!k2(t.hostname))return null;let n=A2(t);if(!n)return null;let r=t.searchParams.get(`t`);return{id:n,startRaw:r&&r.length>0&&O2.test(r)?r:null}}function M2(e){return j2(e)!==null}function N2(e){let t=e.toLowerCase();return t===`vimeo.com`||t===`www.vimeo.com`||t===`player.vimeo.com`}function P2(e){if(typeof e!=`string`||e.length===0)return!1;let t;try{t=new URL(e)}catch{return!1}return t.protocol!==`http:`&&t.protocol!==`https:`?!1:N2(t.hostname)}var F2=/^[A-Za-z0-9_-]{11}$/;function I2(e){let t=e.toLowerCase();return t===`youtube.com`||t===`www.youtube.com`||t===`m.youtube.com`||t===`music.youtube.com`||t===`youtu.be`||t===`youtube-nocookie.com`||t===`www.youtube-nocookie.com`}function L2(e){if(e.length===0)return null;if(/^[0-9]+$/.test(e)){let t=Number.parseInt(e,10);return t>0?t:null}let t=e.match(/^(?:([0-9]+)h)?(?:([0-9]+)m)?(?:([0-9]+)s?)?$/);if(!t)return null;let n=t[1]?Number.parseInt(t[1],10):0,r=t[2]?Number.parseInt(t[2],10):0,i=t[3]?Number.parseInt(t[3],10):0,a=n*3600+r*60+i;return a>0?a:null}function R2(e){if(e.hostname.toLowerCase()===`youtu.be`){let t=e.pathname.replace(/^\//,``).split(`/`)[0]??``;return F2.test(t)?t:null}if(e.pathname===`/watch`){let t=e.searchParams.get(`v`)??``;return F2.test(t)?t:null}let t=e.pathname.match(/^\/(?:embed|shorts|v)\/([A-Za-z0-9_-]{11})\/?$/);return t?t[1]??null:null}function z2(e){if(typeof e!=`string`||e.length===0)return null;let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`http:`&&t.protocol!==`https:`||!I2(t.hostname))return null;let n=R2(t);if(!n)return null;let r=t.searchParams.get(`t`)??t.searchParams.get(`start`)??``;return{id:n,startSeconds:r.length>0?L2(r):null,noCookie:t.hostname.toLowerCase().endsWith(`youtube-nocookie.com`)}}var B2=[{name:`type`,type:`enum`,enumValues:[`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`],defaultValue:`note`,required:!1,description:`Callout variant`},{name:`title`,type:`string`,required:!1,description:`Optional heading shown above the body`},{name:`icon`,type:`string`,required:!1,advanced:!0,description:"Custom lucide icon override (e.g. `lucide:Lightbulb`)"},{name:`color`,type:`string`,required:!1,advanced:!0,description:"Optional accent color override (hex — e.g. `#F05032`)"},{name:`collapsible`,type:`boolean`,required:!1,defaultValue:!1,advanced:!0,description:"Render as a foldable `<details>` (Obsidian `[!TYPE]+/-`)"},{name:`defaultOpen`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,description:`When collapsible, start in the open state`},{name:`children`,type:`reactnode`,required:!0,description:`Callout content`}],V2=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Image source URL`,accept:x$,autoFocus:!0},{name:`alt`,type:`string`,required:!0,description:`Alt text`},{name:`width`,type:`number`,required:!1,advanced:!0,description:`Image width`},{name:`height`,type:`number`,required:!1,advanced:!0,description:`Image height`},{name:`srcset`,type:`string`,required:!1,advanced:!0,description:`Responsive image candidate set (e.g. "x.png 1x, y.png 2x")`},{name:`sizes`,type:`string`,required:!1,advanced:!0,description:`Responsive image sizes hint paired with srcset`},{name:`loading`,type:`enum`,enumValues:[`eager`,`lazy`],defaultValue:`lazy`,required:!1,advanced:!0,omitOnDefault:!0,description:`Native img loading strategy (defaults to lazy)`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`decoding`,type:`enum`,enumValues:[`sync`,`async`,`auto`],defaultValue:`auto`,required:!1,advanced:!0,omitOnDefault:!0,description:`Hint for how the browser should decode the image`},{name:`fetchpriority`,type:`enum`,enumValues:[`high`,`low`,`auto`],defaultValue:`auto`,required:!1,advanced:!0,omitOnDefault:!0,description:`Resource fetch priority hint`},{name:`crossorigin`,type:`enum`,enumValues:[`anonymous`,`use-credentials`],required:!1,advanced:!0,description:`CORS mode for the image fetch`},{name:`referrerpolicy`,type:`string`,required:!1,advanced:!0,description:`Referrer policy for the image fetch (HTML referrerpolicy values)`},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`}],H2=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Embedded page URL (must start with http:// or https://)`,autoFocus:!0},{name:`title`,type:`string`,required:!1,description:`Iframe title (accessible label for screen readers)`},{name:`width`,type:`string`,required:!1,advanced:!0,description:`Embed width as a CSS length (e.g. "100%", "640px")`},{name:`height`,type:`string`,required:!1,advanced:!0,description:`Embed height as a CSS length (e.g. "26rem", "480px")`},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`}],U2=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Video source URL`,accept:S$,autoFocus:!0},{name:`controls`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,omitOnDefault:!0,description:`Show native HTML5 video controls (defaults to true)`,hideWhen:e=>typeof e.src==`string`&&(P2(e.src)||M2(e.src))},{name:`autoplay`,type:`boolean`,required:!1,advanced:!0,description:`Begin playback as soon as possible (usually requires muted)`},{name:`poster`,type:`string`,required:!1,advanced:!0,description:`Poster image URL shown before playback`,accept:x$,hideWhen:e=>typeof e.src==`string`&&(P2(e.src)||M2(e.src))},{name:`width`,type:`number`,required:!1,advanced:!0,description:`Video width`},{name:`height`,type:`number`,required:!1,advanced:!0,description:`Video height`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`muted`,type:`boolean`,required:!1,advanced:!0,description:`Mute audio on load`},{name:`loop`,type:`boolean`,required:!1,advanced:!0,description:`Restart from the beginning when playback ends`,hideWhen:e=>typeof e.src==`string`&&M2(e.src)},{name:`playsinline`,type:`boolean`,required:!1,advanced:!0,description:`Play inline on iOS rather than entering fullscreen`,hideWhen:e=>typeof e.src==`string`&&(P2(e.src)||M2(e.src))},{name:`preload`,type:`enum`,enumValues:[`none`,`metadata`,`auto`],required:!1,advanced:!0,description:`Hint for how much of the video to preload`,hideWhen:e=>typeof e.src==`string`&&(z2(e.src)!==null||P2(e.src)||M2(e.src))}],W2=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Audio source URL`,accept:C$,autoFocus:!0},{name:`controls`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,omitOnDefault:!0,description:`Show native HTML5 audio controls (defaults to true)`},{name:`autoplay`,type:`boolean`,required:!1,advanced:!0,description:`Begin playback as soon as possible (usually requires muted)`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`muted`,type:`boolean`,required:!1,advanced:!0,description:`Mute audio on load`},{name:`loop`,type:`boolean`,required:!1,advanced:!0,description:`Restart from the beginning when playback ends`},{name:`preload`,type:`enum`,enumValues:[`none`,`metadata`,`auto`],required:!1,advanced:!0,description:`Hint for how much of the audio to preload`}],G2=[{name:`title`,type:`string`,required:!0,description:`Accordion heading shown inside the <summary>`},{name:`defaultOpen`,type:`boolean`,required:!1,defaultValue:!1,description:`When true, the accordion renders expanded on initial load`},{name:`icon`,type:`string`,required:!1,advanced:!0,description:"Custom lucide icon override (e.g. `lucide:Rocket`)"},{name:`description`,type:`string`,required:!1,advanced:!0,description:`Optional subtitle rendered below the title inside <summary>`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#advanced-options`)"},{name:`name`,type:`string`,required:!1,advanced:!0,description:`HTML5 <details name=> group — siblings with the same name are mutually exclusive`}],K2=[B2[0],B2[1],B2[4],B2[5],B2[6]],q2=[V2[0],V2[1],V2[7]],J2=[G2[0],G2[1],G2[4],G2[5]],Y2=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Alt text (Obsidian alias syntax: `![[file.png|alt text]]`)"}],X2=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[clip.mp4|title]]`)"}],Z2=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[song.mp3|title]]`)"}],Q2=[{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#install-tabs`)"}],$2=[{name:`label`,type:`string`,required:!0,autoFocus:!0,defaultValue:`Tab`,description:`Tab strip label — shown in the clickable pill at the top`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#tab-npm`)"}],e4=[{name:`formula`,type:`string`,required:!0,autoFocus:!0,language:`latex`,description:`LaTeX math source (rendered with KaTeX in the browser)`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#eq-pythagoras`)"},{name:`language`,type:`string`,required:!1,advanced:!0,description:"Forward-compat hint for the math source language (default `latex`). Reserved for future MathJax / Typst / AsciiMath substrates."}],t4=[e4[0]],n4=[e4[0]],r4=[{name:`chart`,type:`string`,required:!0,autoFocus:!0,language:`mermaid`,description:`Mermaid chart source (graph / flowchart / sequenceDiagram / class / state / etc.)`}],i4=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Display name override (Obsidian alias syntax: `![[file.zip|label]]`)"}],a4=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`File URL`,accept:[`*/*`],autoFocus:!0}],o4=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`PDF source URL`,accept:w$,autoFocus:!0},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Accessible label for the embedded PDF viewer`},{name:`anchor`,type:`string`,required:!1,advanced:!0,description:"PDF viewer parameters as a single URL-fragment string (e.g. `page=3&height=600`)"}],s4=[{name:`src`,type:`string`,required:!0,description:"Path of the source doc, extension-less (e.g. `api-spec`).",autoFocus:!0},{name:`anchor`,type:`string`,required:!0,description:"Id of the `<MirrorSource>` block within the source doc."}],c4=[{name:`id`,type:`string`,required:!0,description:"Stable id agents and authors use to reference this block from `<Mirror>` elsewhere.",autoFocus:!0},{name:`children`,type:`reactnode`,required:!0,description:`Block content this MirrorSource owns — paragraphs, callouts, code, nested JSX, anything.`}];function l4(e){return e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function u4(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function d4(e){let t=e.attrs.props,n=t?.target??``,r=typeof t?.alias==`string`&&t.alias.length>0?t.alias:null,i=typeof t?.anchor==`string`&&t.anchor.length>0?t.anchor:null,a=r??(i?`${n}#${i}`:n);return{type:`wikiLinkEmbed`,value:a,data:{target:n,anchor:i,alias:r},children:[{type:`text`,value:a}]}}var f4=[{name:`Callout`,surface:`canonical`,hasChildren:!0,props:B2,icon:`MessageSquareWarning`,category:`content`,displayName:`Callout`,description:`Alert / admonition with 15 type variants — 5 GFM (note, tip, important, warning, caution) plus 10 Obsidian-parity (abstract, info, todo, success, question, failure, danger, bug, example, quote)`,searchTerms:[`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`,`alert`,`admonition`,`callout`],serialize:(e,t)=>E2(`Callout`,e,t,B2)},{name:`img`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:V2,icon:`Image`,category:`media`,displayName:`Image`,description:`Image with click-to-zoom and HTML-native attributes`,searchTerms:[`image`,`zoom`,`picture`,`photo`],placeholder:{label:`Add an image`},serialize:(e,t)=>E2(`img`,e,t,V2)},{name:`video`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:U2,icon:`SquarePlay`,category:`media`,displayName:`Video`,description:`HTML5 video player with native controls`,searchTerms:[`video`,`media`,`player`,`mp4`,`webm`,`movie`],placeholder:{label:`Add a video`},serialize:(e,t)=>E2(`video`,e,t,U2)},{name:`audio`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:W2,icon:`Volume2`,category:`media`,displayName:`Audio`,description:`HTML5 audio player with native controls`,searchTerms:[`audio`,`sound`,`music`,`mp3`,`podcast`,`player`],placeholder:{label:`Add audio`},serialize:(e,t)=>E2(`audio`,e,t,W2)},{name:`Pdf`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:o4,icon:`FileText`,category:`media`,displayName:`PDF`,description:"Embedded PDF viewer (`#page=N` to open at page N, `#height=N` for viewer height)",searchTerms:[`pdf`,`document`,`embed`,`pdfjs`],placeholder:{label:`Add a PDF`},serialize:(e,t)=>E2(`Pdf`,e,t,o4)},{name:`File`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:a4,icon:`Paperclip`,category:`media`,displayName:`File`,description:`Downloadable file attachment — inline row with name + size + download link`,searchTerms:[`file`,`attachment`,`download`,`document`,`zip`,`docx`,`doc`],placeholder:{label:`Add a file`},serialize:(e,t)=>E2(`File`,e,t,a4)},{name:`Embed`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:H2,icon:`AppWindow`,category:`media`,displayName:`Embed`,description:`Inline web embed (iframe) — drop a URL, get a resizable preview pane`,searchTerms:[`embed`,`iframe`,`website`,`page`,`inline`,`frame`,`preview`],placeholder:{label:`Embed a URL`},serialize:(e,t)=>E2(`Embed`,e,t,H2)},{name:`Accordion`,surface:`canonical`,hasChildren:!0,props:G2,icon:`ChevronRight`,category:`content`,displayName:`Accordion`,description:"Standalone expand/collapse via native HTML5 <details>/<summary>. Group siblings with the `name` prop for exclusive-accordion UX.",searchTerms:[`toggle`,`accordion`,`expandable`,`details`,`disclosure`,`collapse`,`fold`],exampleBody:`Body content revealed when the accordion is expanded.`,serialize:(e,t)=>E2(`Accordion`,e,t,G2)},{name:`Tabs`,surface:`canonical`,hasChildren:!0,emptyChildName:`Tab`,props:Q2,icon:`LayoutPanelTop`,category:`content`,displayName:`Tabs`,description:"Horizontal tab strip + active panel below. Each `<Tab>` child is one panel; clickable pills at the top switch the active one. Active selection is ephemeral (resets on reload).",searchTerms:[`tabs`,`tabbed`,`panels`,`tabgroup`,`switcher`],exampleBody:`<Tab label="One">Body of the first tab panel.</Tab>
@@ -430,4 +430,4 @@ Read more at https://docs.orama.com/docs/orama-js/plugins/plugin-secure-proxy#pl
430
430
 
431
431
  `:`
432
432
  `;return l.join(f)},table(e,t,n,r){let i=n.enter(`table`),a=[],o=[],s=e.children??[];for(let e of s){let t=e.children??[],i=[],s=[];for(let e of t){let t=n.enter(`tableCell`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,{...r,before:` `,after:` `});a(),t(),i.push(o);let c=e.data?.sourcePadding;s.push(c&&typeof c.left==`number`&&typeof c.right==`number`?{left:c.left,right:c.right}:null)}a.push(i),o.push(s)}i();let c=e.align??[],l=e.data?.sourceDashCounts,u=a[0]?.length??0,d=a.slice(1).reduce((e,t)=>Math.max(e,t.length),0),f=Math.max(u,d,c.length),p=[];for(let e=0;e<f;e++){let t=c[e],n=``,r=``;t===`center`?(n=`:`,r=`:`):t===`left`?n=`:`:t===`right`&&(r=`:`);let i=l?.[e],a=typeof i==`number`&&i>=1?i:1;p.push(n+`-`.repeat(a)+r)}let m=(e,t)=>{let n=[];for(let r=0;r<f;r++){let i=e[r]??``,a=t[r]??{left:1,right:1};n.push(` `.repeat(a.left)+i+` `.repeat(a.right))}return`|${n.join(`|`)}|`},h=Array.from({length:f},()=>null);if(a.length===0)return m(p,h);let g=[];g.push(m(a[0],o[0]??[])),g.push(m(p,h));for(let e=1;e<a.length;e++)g.push(m(a[e],o[e]??[]));return g.join(`
433
- `)},mdxJsxFlowElement(e,t,n,r){let i=e,a=i.data?.sourceRaw;if(typeof a==`string`)return a;let o=i.data?.htmlBoundary;if(o&&typeof o.opener==`string`&&typeof o.closer==`string`){let e=n.containerFlow({type:`root`,children:i.children??[]},r);return`${o.opener}\n\n${e}\n\n${o.closer}`}let s=i.name??``,c=P8(i.attributes??[]);if(!i.children||i.children.length===0)return s?c?`<${s} ${c} />`:`<${s} />`:``;let l=c?`<${s} ${c}>`:`<${s}>`,u=`</${s}>`;return`${l}\n\n${n.containerFlow({type:`root`,children:i.children},r)}\n\n${u}`},mark(e,t,n,r){let i=n.createTracker(r),a=n.enter(`mark`),o=i.move(`==`);return o+=n.containerPhrasing(e,{before:o,after:`==`,...i.current()}),o+=i.move(`==`),a(),o},comment(e,t,n,r){let i=e.data?.sourceForm,a=i===`html`?`<!-- `:`%%`,o=i===`html`?` -->`:`%%`,s=n.createTracker(r),c=n.enter(`comment`),l=s.move(a);return l+=n.containerPhrasing(e,{before:l,after:o,...s.current()}),l+=s.move(o),c(),l},commentBlock(e,t,n,r){let i=n.createTracker(r),a=n.enter(`commentBlock`),o=e.children??[],s=e.data?.sourceForm,c=e.data?.sourceLayout,l=o.length===1&&o[0]?.type===`paragraph`;if(s===`html`&&l){let e=o[0],t=n.containerPhrasing(e,{before:`<!-- `,after:` -->`,...i.current()});return a(),`<!-- ${t} -->`}if(c===`inline`&&l){let e=o[0],t=n.containerPhrasing(e,{before:`%% `,after:` %%`,...i.current()});return a(),`%% ${t} %%`}let u=n.containerFlow(e,i.current());return a(),`%%\n\n${u}\n\n%%`},mdxJsxTextElement(e){let t=e.data?.sourceRaw;if(typeof t==`string`)return t;let n=e.name??``,r=P8(e.attributes??[]);return r?`<${n} ${r} />`:`<${n}/>`},rawMdxFallback(e){return e.value??``},blockquote(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.containerFlow(e,a.current());i();let s=e.data?.sourceMarkerSpacings,c=0;return n.indentLines(o,(e,t,n)=>n?`>`:s?.[c++]===`none`?`>${e}`:`> ${e}`)}};function P8(e){let t=[];for(let n of e){if(n.type===`mdxJsxExpressionAttribute`){t.push(`{${n.value}}`);continue}let e=n.name;if(n.value===null||n.value===void 0){t.push(e);continue}if(typeof n.value==`string`){if(n.value.includes(`"`)){let r=n.value.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`);t.push(`${e}={"${r}"}`)}else t.push(`${e}="${n.value}"`);continue}t.push(`${e}={${n.value.value}}`)}return t.join(` `)}function F8(e,t,n=` `){return t===`single`?`${n}'${e.replace(/'/g,`\\'`)}'`:t===`paren`?`${n}(${e.replace(/[()]/g,`\\$&`)})`:`${n}"${e.replace(/"/g,`\\"`)}"`}function I8(e){if(!e)return``;let t=0,n=!0;for(let r of e)r===`(`?t++:r===`)`&&(t--,t<0&&(n=!1));return t!==0&&(n=!1),n?e:e.replace(/[\\()]/g,`\\$&`)}function L8(e){return e.replace(/(?<!\\)&(?=[A-Za-z][A-Za-z0-9]*;|#[0-9]+;|#[xX][0-9A-Fa-f]+;)/g,`\\&`)}function R8(e,t,n){let r=e.unsafe;e.unsafe=r.filter(e=>!(e.character===`&`&&e.after===`[#A-Za-z]`||e.character===`<`||e.character===`[`||e.character===`(`||e.character==="`"));let i;try{i=e.safe(t,n)}finally{e.unsafe=r}return L8(i)}function z8(e){if(!Number.isFinite(e)||e<0)return``;if(e<1024)return`${e} B`;let t=[`KiB`,`MiB`,`GiB`,`TiB`],n=e/1024,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return`${n.toFixed(1).replace(/\.0$/,``)} ${t[r]}`}var B8=class{schema;handlers;pmNodeHandlers;pmMarkHandlers;parseProcessor;serializeProcessor;parseCtx={current:{}};constructor(e){this.schema=tb(e.extensions),this.handlers=X8(this.schema,this.parseCtx);let{nodeHandlers:t,markHandlers:n}=Z8(this.schema);this.pmNodeHandlers=t,this.pmMarkHandlers=n,this.parseProcessor=w8({schema:this.schema,handlers:this.handlers,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers}),this.serializeProcessor=T8({schema:this.schema,handlers:this.handlers,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers,toMarkdownHandlers:N8})}parse(e,t){if(!e.trim())return{type:`doc`,content:[{type:`paragraph`,content:[]}]};this.parseCtx.current=t??{};try{return E8(e,this.parseProcessor).toJSON()}finally{this.parseCtx.current={}}}parseToMdast(e){return e.trim()?D8(e,this.parseProcessor):{type:`root`,children:[]}}parseWithFallback(e,t){return e.trim()?I4(e,{parse:e=>this.parse(e,t)}):{type:`doc`,content:[{type:`paragraph`,content:[]}]}}serialize(e){let t;try{t=this.schema.nodeFromJSON(e)}catch(t){let n=`MarkdownManager.serialize() failed: schema rejected JSONContent (type=${e.type}, childCount=${e.content?.length??0})`;throw Error(n,{cause:t})}return O8(t,this.serializeProcessor,{schema:this.schema,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers})}},V8=m4();function H8(e,t){let n=new Map;for(let e of t)n.set(e.name,e);let r={};for(let t of e){if(t.type===`mdxJsxExpressionAttribute`)continue;let e=t.name,i=n.get(e);if(t.value===null||t.value===void 0){r[e]=!0;continue}if(typeof t.value==`string`){if(i?.type===`number`){let n=Number(t.value);r[e]=Number.isNaN(n)?t.value:n}else i?.type===`boolean`?r[e]=t.value===`true`:r[e]=t.value;continue}let a=t.value.value;try{r[e]=JSON.parse(a)}catch{r[e]=a}}return r}function U8(e){let t=!1;return e.descendants(e=>t||e.type.name===`jsxInline`?!1:e.type.name===`jsxComponent`&&e.attrs.sourceDirty?(t=!0,!1):!0),t}function W8(e){return e.attrs.sourceDirty||U8(e)}function G8(e){if(e.type!==`paragraph`)return!1;let t=e.children??[];return t.length===0?!0:t.every(e=>e.type===`text`&&e.value===``)}function K8(e,t){if(!t)return e;let n={};return t.sourceFenceChar&&(n.sourceFenceChar=t.sourceFenceChar),typeof t.sourceFenceLength==`number`&&(n.sourceFenceLength=t.sourceFenceLength),Object.keys(n).length===0?e:{...e,data:n}}function q8(e,t){if(e.length===0)return K8({type:`inlineCode`,value:``},t);if(e.every(e=>e.type===`text`))return K8({type:`inlineCode`,value:e.map(e=>e.value).join(``)},t);if(e.length===1&&`children`in e[0]){let n=e[0];return{...n,children:[q8(n.children,t)]}}return K8({type:`inlineCode`,value:J8(e)},t)}function J8(e){let t=``;for(let n of e)n.type===`text`?t+=n.value:`children`in n&&Array.isArray(n.children)?t+=J8(n.children):`value`in n&&typeof n.value==`string`&&(t+=n.value);return t}var Y8=T$;function X8(e,t){let n=e.nodes,r=e.marks,i={};n.paragraph&&(i.paragraph=(e,t,r)=>{let i=r.all(e).flat(),a=i.some(e=>e?.isBlock&&!e?.isInline),o=i.some(e=>e?.isInline||e?.isText||e?.isTextblock);if(a&&!o)return i.length===1?i[0]:i;if(a&&o){let e=i.filter(e=>!e?.isBlock||e?.isInline),t=i.filter(e=>e?.isBlock&&!e?.isInline),r=[],a=n.paragraph.createAndFill(null,e.length>0?e:null);return a&&r.push(a),r.push(...t),r.length===1?r[0]:r}return n.paragraph.createAndFill(null,i.length>0?i:null)}),n.blockquote&&(i.blockquote=tU(n.blockquote,e=>({sourceMarkerSpacings:e.data?.sourceMarkerSpacings??null}))),n.tableCell&&(i.tableCell=(e=>(t,r,i)=>{let a=i.all(t).flat();if(a.length>0&&n.paragraph){let t=n.paragraph.create(null,a);return e.createAndFill(null,[t])}return e.createAndFill(null,null)})(n.tableCell)),n.tableRow&&(i.tableRow=tU(n.tableRow)),n.table&&n.tableRow&&n.tableCell&&(i.table=(e,t,r)=>{let i=e.align??[],a=e.children??[],o=[];for(let e=0;e<a.length;e++){let t=a[e];if(t.type!==`tableRow`)continue;let s=t.children??[],c=[];for(let t=0;t<s.length;t++){let a=s[t];if(a.type!==`tableCell`)continue;let o=r.all(a).flat(),l=o.length>0&&n.paragraph?[n.paragraph.create(null,o)]:null,u=i[t]??null,d=e===0&&n.tableHeader?n.tableHeader:n.tableCell,f=a.data?.sourcePadding??null,p=d.createAndFill({align:u,sourcePadding:f},l);p&&c.push(p)}let l=n.tableRow.createAndFill(null,c.length>0?c:null);l&&o.push(l)}let s=e.data?.sourceDashCounts??null;return n.table.createAndFill({sourceDashCounts:s},o.length>0?o:null)}),n.image&&(i.image=e=>{let r=e.url??``,i=M8(r,t.current.sourcePath);return n.image.createAndFill({src:i,alt:e.alt??null,title:e.title??null,sourceUrl:i===r?null:r})},n.imageReference?i.imageReference=e=>n.imageReference.createAndFill({alt:e.alt??``,label:e.label??e.identifier??``,identifier:e.identifier??``,referenceType:e.referenceType??`shortcut`}):i.imageReference=e=>n.image.createAndFill({src:``,alt:e.alt??null,title:null})),r.escapeMark&&(i.text=t=>{let n=t.value??``,i=typeof t.data?.sourceRaw==`string`?t.data.sourceRaw:null;if(!n&&!i)return null;if(i){let t=n.replaceAll(`\xA0`,` `);return r.sourceLiteral?e.text(t,[r.sourceLiteral.create({sourceRaw:i})]):e.text(t)}let a=t.data?.escapedChars,o=t.data?.entityRefSpans;if(!a?.length&&!o?.length)return e.text(n.replaceAll(`\xA0`,` `));let s=[...(a??[]).map(e=>({kind:`escape`,offset:e.offset,length:1})),...(o??[]).map(e=>({kind:`entity`,offset:e.offset,length:e.length,raw:e.raw}))];s.sort((e,t)=>e.offset-t.offset);let c=[],l=0;for(let t of s){if(t.offset>l){let r=n.slice(l,t.offset).replaceAll(`\xA0`,` `);r&&c.push(e.text(r))}if(t.offset<n.length){let i=n.slice(t.offset,t.offset+t.length).replaceAll(`\xA0`,` `);i&&(t.kind===`escape`?c.push(e.text(i,[r.escapeMark.create()])):r.sourceLiteral?c.push(e.text(i,[r.sourceLiteral.create({sourceRaw:t.raw})])):c.push(e.text(i))),l=t.offset+t.length}}if(l<n.length){let t=n.slice(l).replaceAll(`\xA0`,` `);t&&c.push(e.text(t))}return c.length===1?c[0]:c}),r.code&&(i.inlineCode=t=>e.text(t.value,[r.code.create({sourceFenceChar:t.data?.sourceFenceChar??"`",sourceFenceLength:typeof t.data?.sourceFenceLength==`number`?t.data.sourceFenceLength:1})]));let a=r.strike??r.delete;if(a&&(i.delete=nU(a)),r.highlight&&(i.mark=nU(r.highlight)),r.comment&&(i.comment=nU(r.comment,e=>({sourceForm:e.data?.sourceForm??`percent`}))),n.commentBlock&&(i.commentBlock=tU(n.commentBlock,e=>({sourceForm:e.data?.sourceForm??`percent`,sourceLayout:e.data?.sourceLayout??`block`}))),r.emphasis&&(i.emphasis=nU(r.emphasis,e=>({sourceDelimiter:e.data?.sourceDelimiter??`*`}))),r.strong&&(i.strong=nU(r.strong,e=>({sourceDelimiter:e.data?.sourceDelimiter??`**`}))),n.heading&&(i.heading=tU(n.heading,e=>({level:e.depth,headingStyle:e.data?.sourceStyle??`atx`,sourceTrailingHashes:e.data?.sourceTrailingHashes??null,sourceUnderlineLength:e.data?.sourceUnderlineLength??null,sourceContiguousNext:e.data?.sourceContiguousNext??!1}))),n.codeBlock&&(i.code=t=>{let r=t.value?[e.text(t.value)]:[];return n.codeBlock.createAndFill({language:t.lang??null,meta:t.meta??null,fenceDelimiter:t.data?.sourceFenceChar??"`",fenceLength:t.data?.sourceFenceLength??3,sourceStyle:t.data?.sourceStyle??`fenced`},r)}),n.thematicBreak&&(i.thematicBreak=e=>n.thematicBreak.createAndFill({sourceRaw:e.data?.sourceRaw??`---`})),n.hardBreak&&(i.break=e=>n.hardBreak.createAndFill({hardBreakStyle:e.data?.sourceStyle??`spaces`})),n.list&&(i.list=tU(n.list,e=>({ordered:!!e.ordered,start:e.start??1,spread:!!e.spread,bulletMarker:e.data?.bulletMarker??null,listMarkerDelimiter:e.data?.listMarkerDelimiter??null}))),n.listItem&&(i.listItem=tU(n.listItem,e=>({checked:e.checked??null,spread:!!e.spread}))),r.link){let t=r.sourceLiteral;i.link=(n,i,a)=>{if((n.children??[]).length===0){let r=typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:`[](${n.url??``})`;return r?t?e.text(r,[t.create({sourceRaw:r})]):e.text(r):null}let o=a.all(n).flat(),s=r.link.create({href:n.url??``,title:n.title??null,linkStyle:n.data?.sourceStyle??`inline`,refLabel:null,sourceUrlForm:n.data?.sourceUrlForm??null,sourceTitleMarker:n.data?.sourceTitleMarker??null});return o.map(e=>e.mark(s.addToSet(e.marks)))},i.linkReference=(n,i,a)=>{if((n.children??[]).length===0){let r=typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:`[${n.label??``}][${n.identifier??``}]`;return r?t?e.text(r,[t.create({sourceRaw:r})]):e.text(r):null}let o=a.all(n).flat(),s=r.link.create({href:``,title:null,linkStyle:n.referenceType??`shortcut`,refLabel:n.label??n.identifier??null});return o.map(e=>e.mark(s.addToSet(e.marks)))}}n.htmlBlock&&(i.html=e=>n.htmlBlock.createAndFill({content:e.value??``}));let o=n.linkDefinition??n.linkRefDef;if(o){let e=!!o.spec.attrs?.url,t=!!o.spec.attrs?.href,n=!!o.spec.attrs?.identifier,r=!!o.spec.attrs?.sourceLayout,a=!!o.spec.attrs?.sourceTitleMarker;i.definition=i=>{let s={title:i.title??null};return n&&(s.identifier=i.identifier??``),s.label=i.label??i.identifier??``,e?s.url=i.url??``:t&&(s.href=i.url??``),r&&(s.sourceLayout=i.data?.sourceLayout??null),a&&(s.sourceTitleMarker=i.data?.sourceTitleMarker??null),o.createAndFill(s)}}if(n.jsxComponent){let r=e=>{if(e&&typeof e==`object`&&`sourceRaw`in e){let t=e.sourceRaw;if(typeof t==`string`)return t}};i.mdxJsxFlowElement=(e,i,a)=>{let o=e.name??``,s=V8.getOrWildcard(o),c=H8(e.attributes,s.props);if(o===`CommonMarkImage`&&typeof c.src==`string`){let e=c.src,n=M8(e,t.current.sourcePath);n!==e&&(c.src=n,c.sourceUrl=e)}let l=a.all(e).flat();return n.jsxComponent.createAndFill({componentName:o,kind:`element`,attributes:e.attributes,sourceRaw:r(e.data)??``,sourceDirty:!1,props:c},l.length?l:void 0)};let a=(e,t)=>{let n=e.attributes?.find(e=>e.type===`mdxJsxAttribute`&&e.name===t);return n&&typeof n.value==`string`?n.value:null};i.mdxJsxTextElement=t=>{if(t.name===`InlineMath`&&n.mathInline){let e=a(t,`formula`)??``,r=a(t,`id`);return n.mathInline.create({formula:e,id:r??null})}if(t.name===`Tag`&&n.tag){let e=a(t,`value`)??``;return n.tag.create({value:e})}if(n.jsxInline){let i=r(t.data)??``;return n.jsxInline.createAndFill({},i?[e.text(i)]:null)}return n.jsxComponent.createAndFill({sourceRaw:r(t.data)??``})},i.mdxFlowExpression=e=>{let t=r(e.data)??`{${e.value??``}}`;return n.jsxComponent.createAndFill({kind:`expression`,sourceRaw:t,sourceDirty:!1})},i.mdxTextExpression=t=>{let n=r(t.data)??`{${t.value??``}}`;return e.text(n)}}return n.wikiLink&&(i.wikiLink=e=>n.wikiLink.createAndFill({target:e.data?.target??``,alias:e.data?.alias??null,anchor:e.data?.anchor??null})),n.tag&&(i.tag=e=>n.tag.createAndFill({value:e.value})),n.wikiLinkEmbed&&(i.wikiLinkEmbed=(i,a)=>{let o=i.data?.target??``,s=i.data?.alias??null,c=i.data?.anchor??null,l=U1(o),{resolveEmbed:u,sourcePath:d}=t.current,f=u&&d?u(o,d)??null:null,p=f?`/${f}`:o,m=a?.type===`paragraph`&&Array.isArray(a.children)&&a.children.length===1;if(m&&Y8.has(l)&&n.jsxComponent&&V8.has(`WikiEmbedImage`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedImage`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,alt:s??o,target:o,anchor:c,alias:s}});if(m&&E$.has(l)&&n.jsxComponent&&V8.has(`WikiEmbedVideo`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedVideo`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,title:s??o,target:o,anchor:c,alias:s}});if(m&&O$.has(l)&&n.jsxComponent&&V8.has(`WikiEmbedAudio`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedAudio`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,title:s??o,target:o,anchor:c,alias:s}});if(m&&k$.has(l)&&n.jsxComponent&&V8.has(`WikiEmbedFile`)){let{resolveSize:e}=t.current,r=e&&d?e(o,d)??null:null,i=r===null?null:z8(r);return n.jsxComponent.createAndFill({componentName:`WikiEmbedFile`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,target:o,anchor:c,alias:s,size:i}})}let h=s||(c?`${o}#${c}`:o);if(N$.has(l)&&r.link){let t=r.link.create({href:p,title:null,linkStyle:`inline`,refLabel:null,sourceForm:`wikiembed`,target:o,anchor:c,alias:s});return e.text(h,[t])}if(r.link){let t=r.link.create({href:o,title:null,linkStyle:`inline`,refLabel:null});return e.text(h,[t])}throw Error("[wikiLinkEmbed handler] schema lacks `link` mark — cannot dispatch without violating the STOP rule against emitting PM wikiLinkEmbed server-side")}),n.mathInline&&(i.inlineMath=e=>n.mathInline.create({formula:e.value??``})),i.math||=t=>{let r=t.value==null?`«unknown:${t.type}»`:t.value;return n.rawMdxFallback?(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.type,reason:`Unhandled block mdast: ${t.type}`})),n.rawMdxFallback.createAndFill({reason:`Unhandled block mdast: ${t.type}`},r?[e.text(r)]:null)):null},i.inlineMath||=t=>(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.type,reason:`Unhandled inline mdast: ${t.type}`})),t.value==null?e.text(`«unknown:${t.type}»`):e.text(t.value)),n.footnoteReference?i.footnoteReference=e=>n.footnoteReference.create({identifier:e.identifier,label:e.label??e.identifier}):i.footnoteReference||=t=>(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:`footnoteReference`,reason:`FootnoteReference extension missing — recovering [^id] source`})),e.text(`[^${t.label??t.identifier}]`)),n.footnoteDefinition?i.footnoteDefinition=tU(n.footnoteDefinition,e=>{let t=e;return{identifier:t.identifier,label:t.label??t.identifier}}):i.footnoteDefinition||=t=>{console.warn(JSON.stringify({event:`unknown-mdast-type`,type:`footnoteDefinition`,reason:`FootnoteDefinition extension missing — recovering [^id]: marker`}));let r=`[^${t.label??t.identifier}]: `;return n.paragraph?n.paragraph.create(null,e.text(r)):null},i.rawMdxFallbackMdast=t=>{if(!n.rawMdxFallback)return null;let r=t.position?{start:t.position.start?.offset??0,end:t.position.end?.offset??0}:{start:0,end:0};return console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.originalType,reason:`Unhandled mdast: ${t.originalType}`})),n.rawMdxFallback.createAndFill({reason:`Unhandled mdast: ${t.originalType}`,originalSpan:r},t.value?[e.text(t.value)]:null)},i}function Z8(e){let t={},n={},r=e.nodes,i=e.marks;r.paragraph&&(t.paragraph=sU(`paragraph`)),r.blockquote&&(t.blockquote=sU(`blockquote`,e=>{let t=e.attrs.sourceMarkerSpacings,n={};return Array.isArray(t)&&t.length>0&&(n.sourceMarkerSpacings=t),Object.keys(n).length>0?{data:n}:{}})),r.heading&&(t.heading=sU(`heading`,e=>({depth:e.attrs.level,data:{sourceStyle:e.attrs.headingStyle,sourceTrailingHashes:e.attrs.sourceTrailingHashes??void 0,sourceUnderlineLength:e.attrs.sourceUnderlineLength??void 0,sourceContiguousNext:e.attrs.sourceContiguousNext===!0?!0:void 0}}))),r.codeBlock&&(t.codeBlock=e=>{let t=e.attrs.sourceStyle===`indented`?`indented`:`fenced`;return{type:`code`,lang:t===`indented`?null:e.attrs.language??null,meta:t===`indented`?null:e.attrs.meta??null,value:e.textContent??``,data:{sourceFenceChar:e.attrs.fenceDelimiter,sourceFenceLength:e.attrs.fenceLength,sourceStyle:t}}}),r.thematicBreak&&(t.thematicBreak=e=>({type:`thematicBreak`,data:{sourceRaw:e.attrs.sourceRaw}})),r.hardBreak&&(t.hardBreak=e=>({type:`break`,data:{sourceStyle:e.attrs.hardBreakStyle}})),r.list&&(t.list=sU(`list`,e=>({ordered:e.attrs.ordered??!1,start:e.attrs.ordered?e.attrs.start??1:null,spread:e.attrs.spread??!1,data:{bulletMarker:e.attrs.bulletMarker,listMarkerDelimiter:e.attrs.listMarkerDelimiter}}))),r.listItem&&(t.listItem=(e,t,n)=>{let r=n.all(e),i=r.length>1&&G8(r[0])?r.slice(1):r;return{type:`listItem`,checked:e.attrs.checked??null,spread:e.attrs.spread??!1,children:i}}),r.table&&(t.table=(e,t,n)=>{let r=n.all(e),i=[],a=e.firstChild;a&&a.forEach(e=>{let t=e.attrs.align;i.push(t===`left`||t===`right`||t===`center`?t:null)});let o=r.filter(e=>e.type===`tableRow`),s=e.attrs.sourceDashCounts,c=Array.isArray(s)&&s.length>0?{sourceDashCounts:s}:void 0,l={type:`table`,align:i,children:o};return c&&(l.data=c),l}),r.tableRow&&(t.tableRow=sU(`tableRow`));let a=e=>{let t=e.attrs.sourcePadding,n={};return typeof t==`object`&&t&&typeof t.left==`number`&&typeof t.right==`number`&&(n.sourcePadding=t),Object.keys(n).length>0?{data:n}:{}};if(r.tableCell&&(t.tableCell=sU(`tableCell`,a)),r.tableHeader&&(t.tableHeader=sU(`tableCell`,a)),r.image&&(t.image=e=>({type:`image`,url:e.attrs.sourceUrl??e.attrs.src,alt:e.attrs.alt,title:e.attrs.title})),r.imageReference&&(t.imageReference=e=>{let t=e.attrs.label??``,n=e.attrs.identifier??t;return{type:`imageReference`,alt:e.attrs.alt??``,identifier:n,label:t||n,referenceType:e.attrs.referenceType??`shortcut`}}),r.htmlBlock&&(t.htmlBlock=e=>({type:`html`,value:e.attrs.content})),r.linkDefinition??r.linkRefDef){let e=r.linkDefinition?`linkDefinition`:`linkRefDef`;t[e]=e=>{let t={},n=e.attrs.sourceLayout;(n===`multiline`||n===`inline`)&&(t.sourceLayout=n);let r=e.attrs.sourceTitleMarker;(r===`single`||r===`double`||r===`paren`)&&(t.sourceTitleMarker=r);let i={type:`definition`,identifier:e.attrs.identifier??e.attrs.label??``,label:e.attrs.label??e.attrs.identifier??``,url:e.attrs.url??e.attrs.href??``,title:e.attrs.title};return Object.keys(t).length>0&&(i.data=t),i}}if(r.jsxComponent&&(t.jsxComponent=(e,t,n)=>{if(e.attrs.kind===`expression`)return{type:`html`,value:e.attrs.sourceRaw??``};let r=e.attrs.componentName||null,i=Array.isArray(e.attrs.attributes)?e.attrs.attributes:[];return!W8(e)&&e.attrs.sourceRaw?{type:`mdxJsxFlowElement`,name:r,attributes:i,children:[],data:{sourceRaw:String(e.attrs.sourceRaw)}}:V8.getOrWildcard(r??`*`).serialize(e,{all:e=>n.all(e),registry:V8,serializeChildren:()=>{throw Error(`SerializeContext.serializeChildren is not available in the PM→mdast handler. Compat descriptors that need markdown-byte body rendering must emit a marker mdast node and let the to-markdown handler render the body via state.containerFlow.`)}})}),r.rawMdxFallback&&(t.rawMdxFallback=e=>{let t=e.textContent??``,n=typeof e.attrs.reason==`string`?e.attrs.reason:``,r=e.attrs.originalSpan;return{type:`rawMdxFallback`,value:t,data:{reason:n,originalSpan:r&&typeof r==`object`&&`start`in r&&`end`in r?{start:Number(r.start)||0,end:Number(r.end)||0}:{start:0,end:0}}}}),r.jsxInline&&(t.jsxInline=e=>{let t=e.attrs.sourceRaw||e.textContent||``;return{type:`mdxJsxTextElement`,name:null,attributes:[],children:[],data:{sourceRaw:String(t)}}}),r.mathInline&&(t.mathInline=e=>{let t=e.attrs.formula??``,n=e.attrs.id;return typeof n==`string`&&n.length>0?{type:`mdxJsxTextElement`,name:`InlineMath`,attributes:[{type:`mdxJsxAttribute`,name:`formula`,value:t},{type:`mdxJsxAttribute`,name:`id`,value:n}],children:[]}:{type:`inlineMath`,value:t}}),r.wikiLink&&(t.wikiLink=e=>{let t=e.attrs.target??``,n=e.attrs.anchor??null,r=e.attrs.alias??null,i=r||(n?`${t}#${n}`:t);return{type:`wikiLink`,value:i,data:{target:t,anchor:n,alias:r},children:[{type:`text`,value:i}]}}),r.tag&&(t.tag=e=>({type:`tag`,value:String(e.attrs.value??``)})),r.wikiLinkEmbed&&(t.wikiLinkEmbed=e=>{let t=e.attrs.target??``,n=e.attrs.anchor??null,r=e.attrs.alias??null,i=r||(n?`${t}#${n}`:t);return{type:`wikiLinkEmbed`,value:i,data:{target:t,anchor:n,alias:r},children:[{type:`text`,value:i}]}}),i.emphasis&&(n.emphasis=cU(`emphasis`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),i.strong&&(n.strong=cU(`strong`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),i.code&&(n.code=(e,t,n)=>{let r=e.attrs.sourceFenceChar,i=e.attrs.sourceFenceLength;return q8(n,{sourceFenceChar:r,sourceFenceLength:i})}),i.strike??i.delete){let e=i.strike?`strike`:`delete`;n[e]=cU(`delete`)}return i.highlight&&(n.highlight=cU(`mark`)),i.comment&&(n.comment=cU(`comment`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`}}))),r.commentBlock&&(t.commentBlock=sU(`commentBlock`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`,sourceLayout:e.attrs.sourceLayout===`inline`?`inline`:`block`}}))),r.footnoteReference&&(t.footnoteReference=e=>{let t=String(e.attrs.identifier??``);return{type:`footnoteReference`,identifier:t,label:e.attrs.label?String(e.attrs.label):t}}),r.footnoteDefinition&&(t.footnoteDefinition=sU(`footnoteDefinition`,e=>({identifier:String(e.attrs.identifier??``),label:e.attrs.label?String(e.attrs.label):String(e.attrs.identifier??``)}))),i.link&&(n.link=(e,t,n)=>{if(e.attrs.sourceForm===`wikiembed`){let t=typeof e.attrs.target==`string`&&e.attrs.target.length>0?e.attrs.target:e.attrs.href??``,n=typeof e.attrs.anchor==`string`&&e.attrs.anchor.length>0?e.attrs.anchor:null,r=typeof e.attrs.alias==`string`&&e.attrs.alias.length>0?e.attrs.alias:null,i=r||(n?`${t}#${n}`:t);return{type:`wikiLinkEmbed`,value:i,data:{target:t,anchor:n,alias:r},children:[{type:`text`,value:i}]}}let r=e.attrs.linkStyle;if(r===`autolink`)return{type:`link`,url:e.attrs.href??``,title:null,children:n,data:{sourceStyle:`autolink`}};if(r===`gfm-autolink`)return{type:`link`,url:e.attrs.href??``,title:null,children:n,data:{sourceStyle:`gfm-autolink`}};if(r===`inline`||!r){let t={};e.attrs.sourceUrlForm===`angle-bracketed`&&(t.sourceUrlForm=`angle-bracketed`);let r=e.attrs.sourceTitleMarker;return(r===`single`||r===`double`||r===`paren`)&&(t.sourceTitleMarker=r),{type:`link`,url:e.attrs.href??``,title:e.attrs.title??null,children:n,...Object.keys(t).length>0?{data:t}:{}}}return{type:`linkReference`,identifier:(e.attrs.refLabel??``).toLowerCase(),label:e.attrs.refLabel,referenceType:r,children:n}}),i.escapeMark&&(n.escapeMark=(e,t,n)=>{for(let e of n)if(e.type===`text`&&e.value){let t=e;t.data=t.data??{},t.data.escapedChars=t.data.escapedChars??[];for(let e=0;e<t.value.length;e++)t.data.escapedChars.push({offset:e,char:t.value[e]})}return n.length===1?n[0]:n}),i.sourceLiteral&&(n.sourceLiteral=(e,t,n)=>{let r=typeof e.attrs.sourceRaw==`string`?e.attrs.sourceRaw:``;if(n.length===1&&n[0]?.type===`text`){let e=n[0],t=r||e.value;return j1(t,e.value)&&(e.data=e.data??{},e.data.sourceRaw=t),e}return{type:`text`,value:n.filter(e=>e.type===`text`).map(e=>e.value??``).join(``)||r}}),{nodeHandlers:t,markHandlers:n}}var Q8=/\p{M}+/gu,$8=/[^\p{L}\p{N}]+/gu,e5=/^-+|-+$/g;function t5(e){return e.trim().normalize(`NFKD`).replace(Q8,``).toLowerCase().replace($8,`-`).replace(e5,``)}function n5(e,t){let n=t.get(e)??0;return t.set(e,n+1),n===0?e:`${e}-${n}`}function r5(e,t){let n=t5(e);return n?n5(n,t):``}function i5(e,t){let n=t5(e);return t?`#${n}-${t5(t)}`:`#${n}`}var a5=new Set([`img`,`video`,`audio`,`mark`]);function o5(e){let t=e.name;if(!t||!a5.has(t))return null;let n={};for(let t of e.attributes){if(t.type!==`mdxJsxAttribute`)return null;let e=t.name.toLowerCase();if(!(e.length>=3&&e.startsWith(`on`)))if(t.value===null)n[t.name]=!0;else if(typeof t.value==`string`)n[t.name]=t.value;else return null}return{type:`element`,tagName:t,properties:n,children:[]}}var Yne=(e,t)=>{let n=t,{target:r,anchor:i,alias:a}=n.data,o={type:`element`,tagName:`a`,properties:{className:[`wiki-link`],dataTarget:r,dataAnchor:i??``,dataAlias:a??``,href:i5(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},Xne=(e,t)=>{let n=t,{target:r,anchor:i,alias:a}=n.data,o={type:`element`,tagName:`a`,properties:{className:[`wiki-embed`],dataTarget:r,dataAnchor:i??``,dataAlias:a??``,href:i5(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},Zne=(e,t)=>{let n=t,r=o5(n);if(r)return n.children.length>0&&(r.children=e.all(n)),e.patch(t,r),e.applyData(t,r);let i={type:`element`,tagName:`pre`,properties:{className:[`mdx-component`]},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:``}]}]};return e.patch(t,i),e.applyData(t,i)},Qne=(e,t)=>{let n=t,r=o5(n);if(r)return n.children.length>0&&(r.children=e.all(n)),e.patch(t,r),e.applyData(t,r);let i={type:`element`,tagName:`span`,properties:{className:[`mdx-inline`],dataJsxInline:``},children:[{type:`text`,value:typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:``}]};return e.patch(t,i),e.applyData(t,i)},$ne=(e,t)=>{let n=t,r=n.data.reason||`unknown`,i=n.value||``,a=r.replace(/--/g,`—`),o={type:`comment`,value:` Parse error: ${a} `},s={type:`element`,tagName:`pre`,properties:{className:[`mdx-fallback`],dataRawMdxFallback:``,dataReason:a},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:i}]}]};return e.patch(t,s),[o,e.applyData(t,s)]},ere=(e,t)=>{let n={type:`element`,tagName:`mark`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)};function s5(e){if(typeof e!=`object`||!e)return``;let t=e;return typeof t.value==`string`?t.value:Array.isArray(t.children)?t.children.map(s5).join(``):``}var c5={wikiLink:Yne,wikiLinkEmbed:Xne,mdxJsxFlowElement:Zne,mdxJsxTextElement:Qne,rawMdxFallback:$ne,mark:ere,tag:(e,t)=>{let n=t.value,r={type:`element`,tagName:`a`,properties:{className:[`tag`],dataTag:n,href:`#tag/${n}`},children:[{type:`text`,value:`#${n}`}]};return e.patch(t,r),e.applyData(t,r)},comment:(e,t)=>{let n={type:`comment`,value:s5(t).replace(/--/g,`—`)};return e.patch(t,n),e.applyData(t,n)},commentBlock:(e,t)=>{let n={type:`comment`,value:s5(t).replace(/--/g,`—`)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:(e,t)=>{let n=t.identifier,r={type:`element`,tagName:`sup`,properties:{id:`fnref-${n}`,dataFootnoteRef:``,dataFootnoteId:n,className:[`footnote-ref`]},children:[{type:`element`,tagName:`a`,properties:{href:`#fn-${n}`,className:[`footnote-ref-link`]},children:[{type:`text`,value:`[${n}]`}]}]};return e.patch(t,r),e.applyData(t,r)},footnoteDefinition:(e,t)=>{let n=t.identifier,r={type:`element`,tagName:`aside`,properties:{id:`fn-${n}`,dataFootnoteDef:``,dataFootnoteId:n,className:[`footnote-def`]},children:[{type:`element`,tagName:`div`,properties:{className:[`footnote-body`]},children:e.all(t)},{type:`element`,tagName:`a`,properties:{href:`#fnref-${n}`,className:[`footnote-backref`],ariaLabel:`Back to reference`},children:[{type:`text`,value:`↩`}]}]};return e.patch(t,r),e.applyData(t,r)}},tre=/url\s*\(\s*['"]?\s*(?:javascript|vbscript|data)\s*:/i,nre=/\bexpression\s*\(/i,rre=1e4;function ire(e){return!(e.length>rre||tre.test(e)||nre.test(e))}function l5(e){for(let t of e.split(`,`)){let e=t.trim();if(e!==``&&!i1(e.split(/\s+/)[0]??``))return!1}return!0}var u5=()=>e=>{VP(e,`element`,e=>{let t=e.tagName.toLowerCase(),n=e.properties;if(!n)return;if(t===`a`||t===`area`||t===`link`||t===`base`){let e=n.href;typeof e==`string`&&!i1(e)&&delete n.href}if(t===`img`||t===`iframe`||t===`script`||t===`embed`||t===`source`||t===`audio`||t===`video`||t===`track`){let e=n.src;typeof e==`string`&&!i1(e)&&delete n.src}if(t===`form`){let e=n.action;typeof e==`string`&&!i1(e)&&delete n.action}if(t===`img`||t===`source`){let e=n.srcSet;typeof e==`string`&&!l5(e)&&delete n.srcSet;let t=n.srcset;typeof t==`string`&&!l5(t)&&delete n.srcset}if(t===`video`){let e=n.poster;typeof e==`string`&&!i1(e)&&delete n.poster}let r=n.style;typeof r==`string`&&!ire(r)&&delete n.style})};function are(e){let t=MH().use(nJ,{handlers:c5}).use(u5).use(hq),n=t.runSync(e);return String(t.stringify(n))}function ore(e){let t=MH().use(AW).use(kU,[`yaml`]).use(X6).use(CH).use(x8).use(nJ,{handlers:c5}).use(u5).use(hq);return String(t.processSync(e))}_K(),AG(),jG(),P({docName:r0,summary:a0,content:j().optional(),...i0}).loose(),P({docName:r0,summary:a0,markdown:j().min(1),position:to([`append`,`prepend`,`replace`]).optional(),...i0}).loose(),P({docName:r0,summary:a0,find:j().min(1),replace:j(),offset:M().int().nonnegative().optional(),...i0}).loose(),P({docName:r0,connectionId:j().min(1),scope:to([`last`,`session`,`file`]).optional(),...i0}).loose();var d5=P({value:j(),truncatedFrom:M().int().nonnegative().optional(),hint:j().optional()}).loose(),sre=P({type:F(`orphan`),parentCandidates:N(j()),message:j()}).loose();P({timestamp:j().min(1),summary:d5.optional()}).loose(),P({timestamp:j().min(1),subscriberCount:M().int().nonnegative(),systemSubscriberCount:M().int().nonnegative(),hints:N(sre).optional(),summary:d5.optional()}).loose(),P({timestamp:j().min(1),subscriberCount:M().int().nonnegative(),systemSubscriberCount:M().int().nonnegative(),summary:d5.optional()}).loose(),P({docName:j().min(1),scope:to([`last`,`session`]),undone:Ba()}).loose(),P({docName:r0,patch:$a(j(),Za([KZ,Ha()])),types:$a(j(),to(GZ)).optional(),summary:a0,...i0}).loose(),P({timestamp:j().min(1),subscriberCount:M().int().nonnegative(),systemSubscriberCount:M().int().nonnegative(),appliedKeys:N(j()),summary:d5.optional()}).loose();var cre=P({status:j().min(1),reason:j()}).loose();P({docName:j().min(1),content:j(),lifecycle:cre.nullable()}).loose();var lre=P({documents:N(P({kind:to([`document`,`asset`,`folder`]).default(`document`),docName:j().min(1).optional(),docExt:j().min(1).default(`.md`),size:M().int().nonnegative(),modified:j().min(1),isSymlink:Ba().default(!1),canonicalDocName:j().nullable().default(null),targetPath:j().nullable().default(null),path:j().min(1).optional(),assetExt:j().min(1).optional(),mediaKind:to([`image`,`video`,`audio`,`pdf`,`text`]).nullable().optional(),referencedBy:N(j().min(1)).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.kind===`folder`?e.docName===void 0&&e.path!==void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0:e.path!==void 0&&e.assetExt!==void 0&&e.referencedBy!==void 0,{message:`document/asset/folder kind must match its required fields (document → docName; asset → path+assetExt+referencedBy; folder → path only, no docName)`}))}).loose(),ure=P({source:j().min(1),anchor:j().nullable(),title:j(),snippet:j().nullable()}).loose(),dre=P({docName:j().min(1),backlinks:N(ure)}).loose();P({counts:$a(j().min(1),M().int().nonnegative())}).loose();var fre=Qa(`kind`,[P({kind:F(`doc`),docName:j().min(1),anchor:j().nullable(),title:j(),snippet:j().nullable()}).loose(),P({kind:F(`external`),url:j().min(1),title:j(),snippet:j().nullable()}).loose()]),pre=P({docName:j().min(1),forwardLinks:N(fre)}).loose(),mre=Qa(`kind`,[P({id:j().min(1),kind:F(`doc`),docName:j().min(1),anchor:j().nullable(),label:j(),cluster:j().nullable(),category:j().nullable(),tags:N(j()).nullable()}).loose(),P({id:j().min(1),kind:F(`external`),url:j().min(1),label:j()}).loose()]),hre=P({source:j().min(1),target:j().min(1)}).loose(),gre=P({nodes:N(mre),links:N(hre)}).loose();P({writers:N(P({id:j().min(1),name:j().optional(),email:j().optional()}).loose()).optional(),...i0}).loose(),P({checkpointRef:j().min(1)}).loose();var _re=P({v:M().int().optional(),id:j().min(1),name:j().min(1),colorSeed:j().optional(),docs:N(j()),summaries:N(j()).optional()}).loose();P({entries:N(P({sha:j().min(1),timestamp:j().min(1),author:j(),authorEmail:j(),type:to([`checkpoint`,`wip`,`upstream`,`park`]),message:j(),contributors:N(_re),checkpoint:Wa().nullable()}).loose()),total:M().int().nonnegative().optional(),truncated:Ba().optional()}).loose(),P({sha:j().regex(/^[0-9a-f]{40}$/i),content:j(),timestamp:j(),author:j()}).loose(),P({lines:N(P({type:to([`added`,`removed`,`unchanged`]),text:j()}).loose()),additions:M().int().nonnegative(),deletions:M().int().nonnegative()}).loose();var vre=P({contentDir:j().min(1),pathSeparator:to([`/`,`\\`]),symlinkResolved:Ba()}).loose();N(Qa(`source`,[P({docName:j().min(1),timestamp:j().min(1),size:M().int().nonnegative(),source:F(`flat`)}).loose(),P({docName:j().min(1),timestamp:j().min(1),source:F(`timeline`),sha:j().min(1)}).loose()])).meta({description:"Flat array of rescue buffer entries; discriminated via `source`."});var yre=P({orphans:N(P({docName:j().min(1),title:j()}).loose())}).loose(),bre=P({hubs:N(P({docName:j().min(1),title:j(),count:M().int().nonnegative()}).loose())}).loose(),xre=P({source:j().min(1),title:j(),snippet:j().nullable()}).loose();P({deadLinks:N(P({target:j().min(1),sources:N(xre)}).loose())}).loose(),P({target:P({docName:j().min(1),title:j(),aliases:N(j())}).loose(),mentions:N(P({source:j().min(1),excerpt:j(),offset:M().int().nonnegative()}).loose()),truncated:Ba()}).loose(),P({dir:j().min(1)}).loose(),P({port:M().int().positive()}).loose(),P({host:j().min(1).optional()}).loose(),P({pat:j().min(1),host:j().min(1).optional()}).loose(),P({name:j().refine(e=>e.trim().length>0,{message:`name must be non-empty`}),email:j().refine(e=>e.trim().length>0,{message:`email must be non-empty`})}).loose(),P({identity:P({name:j().min(1),email:j().min(1)}).loose().nullable()}).loose(),P({authenticated:Ba()}).loose(),P({type:F(`complete`).optional(),login:j().min(1).optional()}).loose(),P({}).loose();var Sre=P({stackIndex:M().int().min(0),ts:M().int().min(0),additions:M().int().min(0),deletions:M().int().min(0)}).loose(),Cre=P({docName:j().min(1),additionsTotal:M().int().min(0),deletionsTotal:M().int().min(0),lastTs:M().int().min(0),bursts:N(Sre)}).loose(),wre=P({displayName:j().min(1),color:j().min(1),icon:j().optional(),connectionId:j().min(1)}).loose(),Tre=P({sessionAlive:Ba(),agent:wre.nullable(),files:N(Cre)}).loose(),Ere=P({diff:j(),generatedAt:M().int().min(0)}).loose();P({}).loose(),P({}).loose(),P({}).loose(),P({}).loose(),P({}).loose();var Dre=P({displayName:j().min(1),icon:j(),color:j().min(1),currentDoc:j().nullable(),mode:to([`idle`,`writing`]),ts:M().int().min(0)}).loose();P({presence:$a(j().min(1),Dre)}).loose(),$a(j().min(1),Ba()).meta({description:`Flat boolean record keyed by agent-scheme name (claude / codex / cursor). True = installed.`}),P({path:j().min(1,`path must be non-empty`)}).loose(),P({}).loose();var f5=P({fromDocName:j().min(1),toDocName:j().min(1)}).loose();P({}).loose(),P({path:j().min(1),...i0,summary:a0}).loose();var Ore=P({docName:j().min(1)}).loose();P({path:j().min(1),...i0,summary:a0}).loose();var kre=P({path:j().min(1)}).loose();P({kind:to([`file`,`folder`]),path:j().min(1),...i0,summary:a0}).loose();var Are=P({kind:to([`file`,`folder`]),path:j().min(1),duplicatedDocNames:N(j().min(1))}).loose(),jre=P({pages:N(P({docName:j().min(1),title:j(),docExt:j().min(1),size:M().int().nonnegative(),modified:j().min(1)}).loose())}).loose(),Mre=P({level:M().int().min(1).max(6),text:j(),slug:j()}).loose(),Nre=P({docName:j().min(1),headings:N(Mre)}).loose();P({docName:j().min(1),newDocName:j().min(1),summary:a0,...i0}).loose();var p5=P({docName:j().min(1),rewrites:M().int().nonnegative()}).loose();P({renamed:N(f5),rewrittenDocs:N(p5),summary:d5.optional()}).loose(),P({kind:to([`file`,`folder`]),fromPath:j().min(1),toPath:j().min(1),...i0,summary:a0}).loose();var Pre=P({renamed:N(f5),rewrittenDocs:N(p5).optional(),summary:d5.optional()}).loose();P({kind:to([`file`,`folder`]),path:j().min(1),...i0}).loose();var Fre=P({deletedDocNames:N(j().min(1))}).loose();P({kind:to([`file`,`folder`]),path:j().min(1),...i0,summary:a0}).loose();var Ire=P({deletedDocNames:N(j().min(1))}).loose();P({docName:j().min(1),commitSha:j().regex(/^[0-9a-f]{40}$/i,{message:`commitSha must be a 40-char git SHA`}),summary:a0,...i0}).loose(),P({restoredFrom:j().min(1),timestamp:j().min(1),summary:d5.optional()}).loose();var Lre=to([`dormant`,`idle`,`fetching`,`pulling`,`pushing`,`conflict`,`offline`,`auth-error`,`disabled`]),Rre=P({label:j().min(1),webUrl:ba().nullable()}).loose();P({state:Lre,lastSyncUtc:j().nullable(),lastFetchUtc:j().nullable(),lastPushedSha:j().nullable(),ahead:M().int().min(0),behind:M().int().min(0),consecutiveFailures:M().int().min(0),conflictCount:M().int().min(0),hasRemote:Ba(),syncEnabled:Ba(),identityUnresolved:Ba(),remote:Rre.nullable().optional(),error:j().optional(),pausedReason:j().optional()}).loose(),P({op:to([`sync`,`push`,`pull`]).optional()}).loose(),P({op:to([`sync`,`push`,`pull`])}).loose(),P({conflicts:N(P({file:j().min(1),detectedAt:j().min(1),oursSha:j().optional(),theirsSha:j().optional(),baseSha:j().optional()}).loose())}).loose(),P({file:j().min(1),strategy:to([`mine`,`theirs`,`content`]),content:j().optional()}).loose().refine(e=>e.strategy!==`content`||e.content!==void 0,{message:`content is required when strategy is 'content'`,path:[`content`]}),P({}).loose(),P({file:j().min(1),base:j(),ours:j(),theirs:j(),lifecycleStatus:j().nullable()}).loose(),P({}).loose(),P({plan:To(e=>e!==void 0,{message:`plan is required`})}).loose(),P({plan:To(e=>e!==void 0,{message:`plan is required`})}).loose(),P({result:To(e=>e!==void 0,{message:`result is required`})}).loose();var zre=P({path:j().min(1),summary:j().min(1)}).loose(),Bre=P({files:M().int().nonnegative(),folders:M().int().nonnegative()}).loose();P({packs:N(P({id:j().min(1),name:j().min(1),description:j().min(1),defaultSubfolder:j().optional(),folders:N(zre),entryCounts:Bre}).loose())}).loose(),P({noOpen:Ba().optional(),out:j().min(1).optional()}).loose();var Vre=P({reason:to([`unsupported-platform`,`spawn-error`]),message:j()}).loose();Qa(`status`,[P({status:F(`installed`),outputPath:j(),size:M().int().nonnegative(),sha256:j(),skillVersion:j()}).loose(),P({status:F(`built`),outputPath:j(),size:M().int().nonnegative(),sha256:j(),skillVersion:j(),handoffError:Vre.optional()}).loose(),P({status:F(`failed`),buildError:j()}).loose(),P({status:F(`skip-current`),skillVersion:j(),recordedAt:j().optional()}).loose()]),P({tags:N(P({name:j().min(1),count:M().int().nonnegative(),isLeaf:Ba()}).loose())}).loose();var Hre=P({docName:j().min(1),title:j(),matchingTags:N(j().min(1)),snippet:j().nullable()}).loose();P({name:j().min(1),docs:N(Hre)}).loose(),P({folder:Wa(),frontmatter_local:$a(j(),Wa()).nullable()}).loose(),P({path:j(),frontmatter:$a(j(),Wa()).optional()}).loose(),P({applied:Wa()}).loose();var m5=$a(j(),Wa()).meta({description:`Free-form frontmatter map embedded in template payloads.`});P({template:P({name:j().min(1),folder:j(),scope:to([`local`,`inherited`]),path:j().min(1),frontmatter:m5,body:j()}).strict()}).strict(),P({folder:j(),name:j(),body:j().optional(),frontmatter:m5.optional()}).strict(),P({path:j().min(1),created:Ba(),warnings:N(j())}).strict(),P({existed:Ba(),path:j().min(1)}).strict(),P({query:j().optional(),intent:to([`autocomplete`,`full_text`,`omnibar`]).optional(),scopes:N(to([`page`,`folder`,`content`])).optional(),scope:j().optional(),limit:M().int().nonnegative().optional()}).loose();var Ure=P({kind:to([`page`,`folder`,`content`]),path:j().min(1),title:j(),score:M(),signals:$a(j(),Wa()),snippet:j().optional()}).loose();P({query:j(),intent:to([`autocomplete`,`full_text`,`omnibar`]),results:N(Ure),elapsedMs:M().nonnegative()}).loose();var Wre=P({version:j().min(1),recordedAt:j().min(1)}).loose();P({currentVersion:j().min(1),targets:$a(j(),Wre.nullable())}).loose();var Gre=`server-info`,Kre=`branch-switched`,qre=`disk-ack`,Jre=`config-validation-rejected`,Yre=`config-ignore-nested-error`,h5=to([`files`,`backlinks`,`graph`,`sync-status`,`session-activity`,`tags`]),Xre=P({v:F(1),ch:F(Gre),seq:M(),serverInstanceId:j().min(1),currentBranch:j().min(1).optional()}).loose(),Zre=P({v:F(1),ch:F(Kre),seq:M(),branch:j().min(1)}).loose(),Qre=P({v:F(1),ch:h5,seq:M()}).loose(),$re=P({v:F(1),ch:F(qre),seq:M(),docName:j().min(1),sv:j().min(1)}).loose(),eie=P({v:F(1),ch:F(Jre),seq:M(),docName:j().min(1),error:t$}).loose(),tie=P({v:F(1),ch:F(Yre),seq:M(),path:j().min(1),error:j().min(1)}).loose(),nie={id:`string`,kind:`enum`,path:`string`,title:`string`,name:`string`,pathSegments:`string`,content:`string`,modifiedTs:`number`},g5=new WeakMap;function rie(e){return e===void 0||!Number.isFinite(e)?20:Math.max(1,Math.min(100,Math.trunc(e)))}function _5(e){return e.trim().toLowerCase()}function v5(e){let t=e.split(`/`).filter(Boolean);return t[t.length-1]??e}function iie(e){return e.split(`/`).filter(Boolean).join(` `)}function aie(e){let t=v5(e.path),n=e.title?.trim()||t,r=e.modifiedTs??0;return{id:`${e.kind}:${e.path}`,kind:e.kind,path:e.path,title:n,name:t,pathSegments:iie(e.path),content:e.content??``,modifiedTs:Number.isFinite(r)?r:0}}function y5(e){let t=QX({schema:nie});return e.length>0&&lZ(t,e),t}function oie(e){let t={documents:e};return g5.set(t,y5(e)),t}function sie(e){let t=g5.get(e);if(t)return t;let n=y5(e.documents);return g5.set(e,n),n}function cie(e){return e===`autocomplete`?[`page`]:e===`full_text`?[`page`,`content`]:[`page`,`folder`]}function b5(e,t){return t.has(e.kind)?!0:e.kind===`page`&&t.has(`content`)}function x5(e,t){let n=_5(t);if(!n)return 0;let r=_5(e.title),i=_5(e.name),a=_5(e.path),o=a.split(`/`);return r===n||i===n?700:a===n?650:r.startsWith(n)||i.startsWith(n)?600:o.some(e=>e.startsWith(n))?550:r.includes(n)||i.includes(n)?500:a.includes(n)?450:-1}function lie(e){let t=e.map(e=>e.modifiedTs).filter(e=>Number.isFinite(e)&&e>0);if(t.length===0)return new Map;let n=1/0,r=-1/0;for(let e of t)e<n&&(n=e),e>r&&(r=e);let i=Math.max(1,r-n);return new Map(e.map(e=>[e.id,e.modifiedTs>0?(e.modifiedTs-n)/i*50:0]))}function uie(e){return e===`full_text`?[`title`,`name`,`path`,`pathSegments`,`content`]:[`title`,`name`,`path`,`pathSegments`]}function die(e){return e===`full_text`?{title:8,name:7,path:5,pathSegments:4,content:1}:e===`autocomplete`?{title:10,name:9,path:5,pathSegments:4}:{title:8,name:7,path:5,pathSegments:4}}function fie(e,t){return _5(t).length<4?0:+(e===`full_text`)}function pie(e,t,n={}){let r=n.intent??`omnibar`,i=rie(n.limit),a=new Set(n.scopes??cie(r)),o=e.documents.filter(e=>b5(e,a)),s=_5(t);if(!s)return o.slice().sort((e,t)=>e.path.localeCompare(t.path)).slice(0,i).map(e=>({document:e,score:0,signals:{lexical:0,fullText:0,recency:0}}));let c=RZ(sie(e),{term:s,properties:uie(r),boost:die(r),tolerance:fie(r,s),limit:Math.max(i*4,40)}),l=new Map(c.hits.filter(e=>b5(e.document,a)).map(e=>[e.document.id,e.score])),u=lie(o),d=new Map;for(let e of o)x5(e,s)>=0&&d.set(e.id,e);for(let e of c.hits)b5(e.document,a)&&d.set(e.document.id,e.document);return[...d.values()].map(e=>{let t=Math.max(0,x5(e,s)),n=l.get(e.id)??0,r=u.get(e.id)??0;return{document:e,score:t+n*20+r,signals:{lexical:t,fullText:n,recency:r}}}).sort((e,t)=>e.score===t.score?e.document.path.localeCompare(t.document.path):t.score-e.score).slice(0,i)}var S5=Symbol.for(`@inkeep/open-knowledge/skill-state-field-registry`),C5=globalThis;C5[S5]===void 0&&(C5[S5]=Lr());var w5=C5[S5],T5=Ya({version:j().regex(/^\d+\.\d+\.\d+(?:[-+][\w.-]+)?$/,`version must match /^\\d+\\.\\d+\\.\\d+(?:[-+][\\w.-]+)?$/`).register(w5,{description:`Recorded skill version for this target.`}),recordedAt:Ji().register(w5,{description:`ISO 8601 timestamp of the most recent successful write. Updated on every write, including reinstalls of the same version.`}),surface:to([`server-build-and-open`,`electron-build-and-open`,`cli-npx-skills-add`,`desktop-direct`]).register(w5,{description:`Install-source surface that recorded this entry.`}).optional()});Ya({schema:F(1).register(w5,{description:`Schema major version. Bumped only on breaking shape changes.`}),targets:Ya({"claude-cowork":T5.optional(),"cli-hosts":T5.optional()}).register(w5,{description:`Per-target install-state entries. Absent target = no recorded install.`}).default({})});var E5=class extends Error{chunksCompleted;totalChunks;bytesWritten;bytesRemaining;cause;constructor(e,t){let n=e instanceof Error?e.message:typeof e==`string`?e:`unknown error`;super(`chunked insert failed after ${t.chunksCompleted}/${t.totalChunks} chunks (${t.bytesWritten} bytes written, ${t.bytesRemaining} bytes lost): ${n}`),this.name=`ChunkedInsertError`,this.chunksCompleted=t.chunksCompleted,this.totalChunks=t.totalChunks,this.bytesWritten=t.bytesWritten,this.bytesRemaining=t.bytesRemaining,this.cause=e}};async function mie(e,t,n,r,i={}){let a=i.thresholdBytes??512e3,o=i.chunkSizeBytes??51200,s=i.origin,c=i.yieldFn??hie,l=i.resolveOffset??(e=>e);if(r.length<=a){e.transact(()=>{t.insert(n,r)},s);return}let u=Math.ceil(r.length/o),d=0,f=n,p=0,m=0;for(;d<r.length;){let n=Math.min(d+o,r.length),i=r.slice(d,n);try{let n=l(f);e.transact(()=>{t.insert(n,i)},s)}catch(e){throw new E5(e,{chunksCompleted:p,totalChunks:u,bytesWritten:m,bytesRemaining:r.length-d})}p++,m+=i.length,f+=i.length,d=n,d<r.length&&await c()}}function hie(){return new Promise(e=>{let t=globalThis;t.document?.hidden!==!0&&typeof t.requestAnimationFrame==`function`?t.requestAnimationFrame(()=>e()):setTimeout(()=>e(),0)})}function gie(){let e=!1,t=``,n=0;return r=>{let i=_ie(r);return e?(i&&i.char===t&&i.len>=n&&!i.hasInfo&&(e=!1,t=``,n=0),!0):i?(e=!0,t=i.char,n=i.len,!0):!1}}function _ie(e){let t=(e.endsWith(`\r`)?e.slice(0,-1):e).match(/^ {0,3}([`~])(\1{2,})(.*)$/);return t?{char:t[1],len:1+t[2].length,hasInfo:t[3].trim()!==``}:null}var vie=[`#D97757`,`#1B1912`,`#F9F3E9`,`#7A9DFF`,`#8534F3`,`#9663F0`,`#727CF3`],yie={claude:`#D97757`,cursor:`#1B1912`,windsurf:`#0B100F`,openai:`#7A9DFF`,github:`#8534F3`,cline:`#9663F0`,bot:`#727CF3`},bie={cursor:`#FFFFFF`,windsurf:`#FFFFFF`},D5=[`#f0ece3`,`#fff5e1`,`#f9e1db`,`#f5def7`,`#ece2fb`,`#dce8fa`,`#DBF3FB`];function xie(e,t=vie){let n=0;for(let t of e)n=(n<<5)-n+t.charCodeAt(0)|0;return t[Math.abs(n)%t.length]}function Sie(e){let t=e.trim();if(!t)return`?`;let n=t.split(/[-\s]+/).filter(Boolean);if(!n.length)return`?`;if(n.length>=2)return n.slice(0,2).map(e=>e[0]??``).join(``).toUpperCase();let r=n[0],i=[r[0]];for(let e=1;e<r.length&&i.length<2;e++){let t=r[e-1],n=r[e];t===t.toLowerCase()&&n===n.toUpperCase()&&n!==n.toLowerCase()&&i.push(n)}return i.length>=2?i.join(``).toUpperCase():r.slice(0,2).toUpperCase()}function Cie(e){let t=e.trim();if(!t)return e;if(t.includes(` `)||!/[-_]/.test(t))return t;let n=t.split(/[-_]+/).filter(Boolean);return n.length?n.map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(` `):t}var wie={"claude-code":`claude`,"claude-ai":`claude`,cursor:`cursor`,"cursor-vscode":`cursor`,cascade:`windsurf`,codex:`openai`,"codex-mcp-client":`openai`,copilot:`github`,cline:`cline`};function Tie(e){return e?wie[e]??`bot`:`bot`}function Eie(e){let t=parseInt(e.slice(1,3),16)/255,n=parseInt(e.slice(3,5),16)/255,r=parseInt(e.slice(5,7),16)/255,i=Math.max(t,n,r),a=Math.min(t,n,r),o=(i+a)/2;if(i===a)return[0,0,o*100];let s=i-a,c=o>.5?s/(2-i-a):s/(i+a),l;return l=i===t?((n-r)/s+(n<r?6:0))/6:i===n?((r-t)/s+2)/6:((t-n)/s+4)/6,[l*360,c*100,o*100]}function Die(e,t,n){let r=t/100,i=n/100,a=r*Math.min(i,1-i),o=t=>{let n=(t+e/30)%12,r=i-a*Math.max(Math.min(n-3,9-n,1),-1);return Math.round(255*r).toString(16).padStart(2,`0`)};return`#${o(0)}${o(8)}${o(4)}`}function Oie(e){let[t]=Eie(e);return Die(t,45,32)}var kie=[`Curious`,`Brave`,`Clever`,`Swift`,`Gentle`,`Bright`,`Wise`,`Bold`,`Calm`,`Keen`],Aie=[`Bird`,`Cat`,`Dog`,`Fish`,`Mouse`,`Rabbit`,`Shrimp`,`Snail`,`Squirrel`,`Turtle`],O5=`ok-user-name-v3`,k5=`ok-user-color-v3`;function A5(e){return e[Math.floor(Math.random()*e.length)]}function jie(){return`${A5(kie)} ${A5(Aie)}`}function Mie(){return A5(D5)}function j5(e){try{return localStorage.getItem(e)}catch{return null}}function M5(e,t){try{localStorage.setItem(e,t)}catch{}}function Nie(){let e=new URLSearchParams(window.location.search).get(`coeditor`)||`standalone`,t=crypto.randomUUID(),n=j5(O5),r=j5(k5);return n||(n=jie(),M5(O5,n)),r||(r=Mie(),M5(k5,r)),{name:n,color:r,coeditor:e,tabId:t}}function Pie(e,t){let n=e.trim();if(!n||/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n)||n.startsWith(`//`)||n.startsWith(`/`)||n.startsWith(`#`))return null;let r=n.indexOf(`#`),i=r>=0?n.slice(0,r):n,a=r>=0?n.slice(r+1):null,o=(i.split(`?`)[0]??``).trim();if(!o)return null;let s=(o.split(`/`).pop()??``).match(/\.([a-z0-9]+)$/i);if(s){let e=(s[1]??``).toLowerCase();if(e!==`md`&&e!==`mdx`)return null}let c=o.toLowerCase(),l=c.endsWith(`.mdx`)?o.slice(0,-4):c.endsWith(`.md`)?o.slice(0,-3):o,u=t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of l.split(`/`))if(e===`..`){if(u.length===0)return null;u.pop()}else e!==`.`&&e!==``&&u.push(e);return u.length===0?null:{docName:u.join(`/`),anchor:a||null}}function Fie(e){throw Error(`Unhandled ClassifiedLinkTarget variant: ${JSON.stringify(e)}`)}var N5=/^[a-zA-Z][a-zA-Z\d+\-.]*:/;function P5(e){let t=(e.split(/[?#]/)[0]??e).match(/\.([a-z0-9]+)$/i);return t?(t[1]??``).toLowerCase():null}function F5(e){return e.split(`/`).filter(Boolean)}function I5(e){let t=e.trim();return N5.test(t)||t.startsWith(`//`)}function Iie(e,t){let n=e.trim();if(!n)return null;if(n.startsWith(`#`)){let e=n.slice(1).trim();return e?{kind:`anchor`,anchor:e}:null}let r=Pie(n,t);if(r)return{kind:`doc`,docName:r.docName,anchor:r.anchor};if(I5(n)||n.startsWith(`/`))return{kind:`external`,url:n};let i=P5(n);return i&&i!==`md`&&i!==`mdx`?{kind:`asset`,url:n,ext:i}:null}function Lie(e,t){let n=e.trim();if(!n)return null;if(I5(n))return{kind:`external`,url:t?`${n}#${t}`:n};let r=P5(n);return r&&r!==`md`&&r!==`mdx`?{kind:`asset`,url:n,ext:r}:{kind:`doc`,docName:n,anchor:t?.trim()||null}}function Rie(e,t){let n=e.trim();if(!n||N5.test(n)||n.startsWith(`//`)||n.startsWith(`#`))return null;let r=n.indexOf(`#`),i=((r>=0?n.slice(0,r):n).split(`?`)[0]??``).trim();if(!i)return null;let a=i.startsWith(`/`),o=a?i.slice(1):i,s=a?[]:t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of o.split(`/`))if(e===`..`){if(s.length===0)return null;s.pop()}else e!==`.`&&e!==``&&s.push(e);return s.length===0?null:s.join(`/`)}function zie(e,t,n=null){let r=F5(e);r.pop();let i=F5(t),a=0;for(;a<r.length&&a<i.length&&r[a]===i[a];)a+=1;let o=r.slice(a).map(()=>`..`),s=i.slice(a),c=[...o,...s].join(`/`);return c||=i.at(-1)??t,!c.startsWith(`./`)&&!c.startsWith(`../`)&&(c=`./${c}`),`${c}.md${n?`#${n}`:``}`}function Bie(e){if(!e)return{height:null,viewerFragment:``};let t=e.split(`&`).filter(e=>e.length>0),n=null,r=[];for(let e of t){let t=e.indexOf(`=`);if(t===-1){r.push(e);continue}let i=e.slice(0,t),a=e.slice(t+1);if(i===`height`){let e=Number.parseInt(a,10);!Number.isNaN(e)&&e>0&&(n=e);continue}r.push(e)}return{height:n,viewerFragment:r.join(`&`)}}function Vie(e){return e.replace(/[/\\:*?"<>|\0]/g,`-`).replace(/\s+/g,` `).replace(/-+/g,`-`).trim().replace(/^[-.\s]+|[-.\s]+$/g,``)}var L5=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),Hie=`VisuallyHidden`,R5=D.forwardRef((e,t)=>(0,Oo.jsx)(h.span,{...e,ref:t,style:{...L5,...e.style}}));R5.displayName=Hie;var Uie=R5;function Wie(e){let t=e+`CollectionProvider`,[n,r]=_(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=D.useRef(null),a=D.useRef(new Map).current;return(0,Oo.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,l=c(s),d=D.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,Oo.jsx)(l,{ref:u(t,a(s,n).collectionRef),children:r})});d.displayName=s;let f=e+`CollectionItemSlot`,p=`data-radix-collection-item`,m=c(f),h=D.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=D.useRef(null),s=u(t,o),c=a(f,n);return D.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,Oo.jsx)(m,{[p]:``,ref:s,children:r})});h.displayName=f;function g(t){let n=a(e+`CollectionConsumer`,t);return D.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${p}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:d,ItemSlot:h},g,r]}var Gie=D.createContext(void 0);function Kie(e){let t=D.useContext(Gie);return e||t||`ltr`}var z5=[`top`,`right`,`bottom`,`left`],B5=[`start`,`end`],V5=z5.reduce((e,t)=>e.concat(t,t+`-`+B5[0],t+`-`+B5[1]),[]),H5=Math.min,U5=Math.max,W5=Math.round,G5=Math.floor,K5=e=>({x:e,y:e}),qie={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function q5(e,t,n){return U5(e,H5(t,n))}function J5(e,t){return typeof e==`function`?e(t):e}function Y5(e){return e.split(`-`)[0]}function X5(e){return e.split(`-`)[1]}function Z5(e){return e===`x`?`y`:`x`}function Q5(e){return e===`y`?`height`:`width`}function $5(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function e7(e){return Z5($5(e))}function t7(e,t,n){n===void 0&&(n=!1);let r=X5(e),i=e7(e),a=Q5(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=a7(o)),[o,a7(o)]}function Jie(e){let t=a7(e);return[n7(e),t,n7(t)]}function n7(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var r7=[`left`,`right`],i7=[`right`,`left`],Yie=[`top`,`bottom`],Xie=[`bottom`,`top`];function Zie(e,t,n){switch(e){case`top`:case`bottom`:return n?t?i7:r7:t?r7:i7;case`left`:case`right`:return t?Yie:Xie;default:return[]}}function Qie(e,t,n,r){let i=X5(e),a=Zie(Y5(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(n7)))),a}function a7(e){let t=Y5(e);return qie[t]+e.slice(t.length)}function $ie(e){return{top:0,right:0,bottom:0,left:0,...e}}function o7(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:$ie(e)}function s7(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function c7(e,t,n){let{reference:r,floating:i}=e,a=$5(t),o=e7(t),s=Q5(o),c=Y5(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(X5(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function eae(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=J5(t,e),p=o7(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=s7(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=s7(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var tae=50,nae=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:eae},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=c7(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<tae&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=c7(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},rae=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=J5(e,t)||{};if(l==null)return{};let d=o7(u),f={x:n,y:r},p=e7(i),m=Q5(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=H5(d[_],T),D=H5(d[v],T),ee=E,te=C-h[m]-D,ne=C/2-h[m]/2+w,re=q5(ee,ne,te),ie=!c.arrow&&X5(i)!=null&&ne!==re&&a.reference[m]/2-(ne<ee?E:D)-h[m]/2<0,O=ie?ne<ee?ne-ee:ne-te:0;return{[p]:f[p]+O,data:{[p]:re,centerOffset:ne-re-O,...ie&&{alignmentOffset:O}},reset:ie}}});function iae(e,t,n){return(e?[...n.filter(t=>X5(t)===e),...n.filter(t=>X5(t)!==e)]:n.filter(e=>Y5(e)===e)).filter(n=>e?X5(n)===e||(t?n7(n)!==n:!1):!0)}var aae=function(e){return e===void 0&&(e={}),{name:`autoPlacement`,options:e,async fn(t){let{rects:n,middlewareData:r,placement:i,platform:a,elements:o}=t,{crossAxis:s=!1,alignment:c,allowedPlacements:l=V5,autoAlignment:u=!0,...d}=J5(e,t),f=c!==void 0||l===V5?iae(c||null,u,l):l,p=await a.detectOverflow(t,d),m=r.autoPlacement?.index||0,h=f[m];if(h==null)return{};let g=t7(h,n,await(a.isRTL==null?void 0:a.isRTL(o.floating)));if(i!==h)return{reset:{placement:f[0]}};let _=[p[Y5(h)],p[g[0]],p[g[1]]],v=[...r.autoPlacement?.overflows||[],{placement:h,overflows:_}],y=f[m+1];if(y)return{data:{index:m+1,overflows:v},reset:{placement:y}};let b=v.map(e=>{let t=X5(e.placement);return[e.placement,t&&s?e.overflows.slice(0,2).reduce((e,t)=>e+t,0):e.overflows[0],e.overflows]}).sort((e,t)=>e[1]-t[1]),x=b.filter(e=>e[2].slice(0,X5(e[0])?2:3).every(e=>e<=0))[0]?.[0]||b[0][0];return x===i?{}:{data:{index:m+1,overflows:v},reset:{placement:x}}}}},oae=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=J5(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Y5(r),_=$5(o),v=Y5(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[a7(o)]:Jie(o)),x=p!==`none`;!d&&x&&b.push(...Qie(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=t7(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==$5(t))||T.every(e=>$5(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=$5(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function l7(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function u7(e){return z5.some(t=>e[t]>=0)}var sae=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=J5(e,t);switch(i){case`referenceHidden`:{let e=l7(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:u7(e)}}}case`escaped`:{let e=l7(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:u7(e)}}}default:return{}}}}};function d7(e){let t=H5(...e.map(e=>e.left)),n=H5(...e.map(e=>e.top)),r=U5(...e.map(e=>e.right)),i=U5(...e.map(e=>e.bottom));return{x:t,y:n,width:r-t,height:i-n}}function cae(e){let t=e.slice().sort((e,t)=>e.y-t.y),n=[],r=null;for(let e=0;e<t.length;e++){let i=t[e];!r||i.y-r.y>r.height/2?n.push([i]):n[n.length-1].push(i),r=i}return n.map(e=>s7(d7(e)))}var lae=function(e){return e===void 0&&(e={}),{name:`inline`,options:e,async fn(t){let{placement:n,elements:r,rects:i,platform:a,strategy:o}=t,{padding:s=2,x:c,y:l}=J5(e,t),u=Array.from(await(a.getClientRects==null?void 0:a.getClientRects(r.reference))||[]),d=cae(u),f=s7(d7(u)),p=o7(s);function m(){if(d.length===2&&d[0].left>d[1].right&&c!=null&&l!=null)return d.find(e=>c>e.left-p.left&&c<e.right+p.right&&l>e.top-p.top&&l<e.bottom+p.bottom)||f;if(d.length>=2){if($5(n)===`y`){let e=d[0],t=d[d.length-1],r=Y5(n)===`top`,i=e.top,a=t.bottom,o=r?e.left:t.left,s=r?e.right:t.right;return{top:i,bottom:a,left:o,right:s,width:s-o,height:a-i,x:o,y:i}}let e=Y5(n)===`left`,t=U5(...d.map(e=>e.right)),r=H5(...d.map(e=>e.left)),i=d.filter(n=>e?n.left===r:n.right===t),a=i[0].top,o=i[i.length-1].bottom,s=r,c=t;return{top:a,bottom:o,left:s,right:c,width:c-s,height:o-a,x:s,y:a}}return f}let h=await a.getElementRects({reference:{getBoundingClientRect:m},floating:r.floating,strategy:o});return i.reference.x!==h.reference.x||i.reference.y!==h.reference.y||i.reference.width!==h.reference.width||i.reference.height!==h.reference.height?{reset:{rects:h}}:{}}}},f7=new Set([`left`,`top`]);async function uae(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Y5(n),s=X5(n),c=$5(n)===`y`,l=f7.has(o)?-1:1,u=a&&c?-1:1,d=J5(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var dae=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await uae(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},fae=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=J5(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=$5(Y5(i)),p=Z5(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=q5(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=q5(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},pae=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=J5(e,t),u={x:n,y:r},d=$5(i),f=Z5(d),p=u[f],m=u[d],h=J5(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=f7.has(Y5(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},mae=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=J5(e,t),u=await o.detectOverflow(t,l),d=Y5(i),f=X5(i),p=$5(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=H5(h-u[g],v),x=H5(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=U5(u.left,0),t=U5(u.right,0),n=U5(u.top,0),r=U5(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:U5(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:U5(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function p7(){return typeof window<`u`}function m7(e){return _7(e)?(e.nodeName||``).toLowerCase():`#document`}function h7(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function g7(e){return((_7(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function _7(e){return p7()?e instanceof Node||e instanceof h7(e).Node:!1}function v7(e){return p7()?e instanceof Element||e instanceof h7(e).Element:!1}function y7(e){return p7()?e instanceof HTMLElement||e instanceof h7(e).HTMLElement:!1}function b7(e){return!p7()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof h7(e).ShadowRoot}function x7(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=O7(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function hae(e){return/^(table|td|th)$/.test(m7(e))}function S7(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var gae=/transform|translate|scale|rotate|perspective|filter/,_ae=/paint|layout|strict|content/,C7=e=>!!e&&e!==`none`,w7;function T7(e){let t=v7(e)?O7(e):e;return C7(t.transform)||C7(t.translate)||C7(t.scale)||C7(t.rotate)||C7(t.perspective)||!E7()&&(C7(t.backdropFilter)||C7(t.filter))||gae.test(t.willChange||``)||_ae.test(t.contain||``)}function vae(e){let t=A7(e);for(;y7(t)&&!D7(t);){if(T7(t))return t;if(S7(t))return null;t=A7(t)}return null}function E7(){return w7??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),w7}function D7(e){return/^(html|body|#document)$/.test(m7(e))}function O7(e){return h7(e).getComputedStyle(e)}function k7(e){return v7(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function A7(e){if(m7(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||b7(e)&&e.host||g7(e);return b7(t)?t.host:t}function j7(e){let t=A7(e);return D7(t)?e.ownerDocument?e.ownerDocument.body:e.body:y7(t)&&x7(t)?t:j7(t)}function M7(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=j7(e),i=r===e.ownerDocument?.body,a=h7(r);if(i){let e=N7(a);return t.concat(a,a.visualViewport||[],x7(r)?r:[],e&&n?M7(e):[])}else return t.concat(r,M7(r,[],n))}function N7(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function P7(e){let t=O7(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=y7(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=W5(n)!==a||W5(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function F7(e){return v7(e)?e:e.contextElement}function I7(e){let t=F7(e);if(!y7(t))return K5(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=P7(t),o=(a?W5(n.width):n.width)/r,s=(a?W5(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var yae=K5(0);function L7(e){let t=h7(e);return!E7()||!t.visualViewport?yae:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function bae(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==h7(e)?!1:t}function R7(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=F7(e),o=K5(1);t&&(r?v7(r)&&(o=I7(r)):o=I7(e));let s=bae(a,n,r)?L7(a):K5(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=h7(a),t=r&&v7(r)?h7(r):r,n=e,i=N7(n);for(;i&&r&&t!==n;){let e=I7(i),t=i.getBoundingClientRect(),r=O7(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=h7(i),i=N7(n)}}return s7({width:u,height:d,x:c,y:l})}function z7(e,t){let n=k7(e).scrollLeft;return t?t.left+n:R7(g7(e)).left+n}function B7(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-z7(e,n),y:n.top+t.scrollTop}}function xae(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=g7(r),s=t?S7(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=K5(1),u=K5(0),d=y7(r);if((d||!d&&!a)&&((m7(r)!==`body`||x7(o))&&(c=k7(r)),d)){let e=R7(r);l=I7(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?B7(o,c):K5(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Sae(e){return Array.from(e.getClientRects())}function Cae(e){let t=g7(e),n=k7(e),r=e.ownerDocument.body,i=U5(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=U5(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+z7(e),s=-n.scrollTop;return O7(r).direction===`rtl`&&(o+=U5(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var V7=25;function wae(e,t){let n=h7(e),r=g7(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=E7();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=z7(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=V7&&(a-=o)}else l<=V7&&(a+=l);return{width:a,height:o,x:s,y:c}}function Tae(e,t){let n=R7(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=y7(e)?I7(e):K5(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function H7(e,t,n){let r;if(t===`viewport`)r=wae(e,n);else if(t===`document`)r=Cae(g7(e));else if(v7(t))r=Tae(t,n);else{let n=L7(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return s7(r)}function U7(e,t){let n=A7(e);return n===t||!v7(n)||D7(n)?!1:O7(n).position===`fixed`||U7(n,t)}function Eae(e,t){let n=t.get(e);if(n)return n;let r=M7(e,[],!1).filter(e=>v7(e)&&m7(e)!==`body`),i=null,a=O7(e).position===`fixed`,o=a?A7(e):e;for(;v7(o)&&!D7(o);){let t=O7(o),n=T7(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||x7(o)&&!n&&U7(e,o))?r=r.filter(e=>e!==o):i=t,o=A7(o)}return t.set(e,r),r}function Dae(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?S7(t)?[]:Eae(t,this._c):[].concat(n),r],o=H7(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=H7(t,a[e],i);s=U5(n.top,s),c=H5(n.right,c),l=H5(n.bottom,l),u=U5(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Oae(e){let{width:t,height:n}=P7(e);return{width:t,height:n}}function kae(e,t,n){let r=y7(t),i=g7(t),a=n===`fixed`,o=R7(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=K5(0);function l(){c.x=z7(i)}if(r||!r&&!a)if((m7(t)!==`body`||x7(i))&&(s=k7(t)),r){let e=R7(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?B7(i,s):K5(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function W7(e){return O7(e).position===`static`}function G7(e,t){if(!y7(e)||O7(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return g7(e)===n&&(n=n.ownerDocument.body),n}function K7(e,t){let n=h7(e);if(S7(e))return n;if(!y7(e)){let t=A7(e);for(;t&&!D7(t);){if(v7(t)&&!W7(t))return t;t=A7(t)}return n}let r=G7(e,t);for(;r&&hae(r)&&W7(r);)r=G7(r,t);return r&&D7(r)&&W7(r)&&!T7(r)?n:r||vae(e)||n}var Aae=async function(e){let t=this.getOffsetParent||K7,n=this.getDimensions,r=await n(e.floating);return{reference:kae(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function jae(e){return O7(e).direction===`rtl`}var Mae={convertOffsetParentRelativeRectToViewportRelativeRect:xae,getDocumentElement:g7,getClippingRect:Dae,getOffsetParent:K7,getElementRects:Aae,getClientRects:Sae,getDimensions:Oae,getScale:I7,isElement:v7,isRTL:jae};function q7(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Nae(e,t){let n=null,r,i=g7(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=G5(d),h=G5(i.clientWidth-(u+f)),g=G5(i.clientHeight-(d+p)),_=G5(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:U5(0,H5(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!q7(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function J7(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=F7(e),u=i||a?[...l?M7(l):[],...t?M7(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Nae(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?R7(e):null;c&&g();function g(){let t=R7(e);h&&!q7(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Y7=dae,Pae=aae,X7=fae,Z7=oae,Q7=mae,$7=sae,e9=rae,Fae=lae,Iae=pae,t9=(e,t,n)=>{let r=new Map,i={platform:Mae,...n},a={...i.platform,_c:r};return nae(e,t,{...i,platform:a})},n9=typeof document<`u`?D.useLayoutEffect:function(){};function r9(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!r9(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!r9(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function i9(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function a9(e,t){let n=i9(e);return Math.round(t*n)/n}function o9(e){let t=D.useRef(e);return n9(()=>{t.current=e}),t}function Lae(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=D.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=D.useState(r);r9(f,r)||p(r);let[m,h]=D.useState(null),[g,_]=D.useState(null),v=D.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=D.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=D.useRef(null),C=D.useRef(null),w=D.useRef(u),T=c!=null,E=o9(c),ee=o9(i),te=o9(l),ne=D.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};ee.current&&(e.platform=ee.current),t9(S.current,C.current,e).then(e=>{let t={...e,isPositioned:te.current!==!1};re.current&&!r9(w.current,t)&&(w.current=t,ko.flushSync(()=>{d(t)}))})},[f,t,n,ee,te]);n9(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let re=D.useRef(!1);n9(()=>(re.current=!0,()=>{re.current=!1}),[]),n9(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,ne);ne()}},[b,x,ne,E,T]);let ie=D.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),O=D.useMemo(()=>({reference:b,floating:x}),[b,x]),ae=D.useMemo(()=>{let e={position:n,left:0,top:0};if(!O.floating)return e;let t=a9(O.floating,u.x),r=a9(O.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...i9(O.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,O.floating,u.x,u.y]);return D.useMemo(()=>({...u,update:ne,refs:ie,elements:O,floatingStyles:ae}),[u,ne,ie,O,ae])}var Rae=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:e9({element:r.current,padding:i}).fn(n):r?e9({element:r,padding:i}).fn(n):{}}}},zae=(e,t)=>{let n=Y7(e);return{name:n.name,fn:n.fn,options:[e,t]}},Bae=(e,t)=>{let n=X7(e);return{name:n.name,fn:n.fn,options:[e,t]}},Vae=(e,t)=>({fn:Iae(e).fn,options:[e,t]}),Hae=(e,t)=>{let n=Z7(e);return{name:n.name,fn:n.fn,options:[e,t]}},Uae=(e,t)=>{let n=Q7(e);return{name:n.name,fn:n.fn,options:[e,t]}},Wae=(e,t)=>{let n=$7(e);return{name:n.name,fn:n.fn,options:[e,t]}},Gae=(e,t)=>{let n=Rae(e);return{name:n.name,fn:n.fn,options:[e,t]}},Kae=`Arrow`,s9=D.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,Oo.jsx)(h.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,Oo.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});s9.displayName=Kae;var qae=s9,c9=`Popper`,[l9,u9]=_(c9),[Jae,d9]=l9(c9),f9=e=>{let{__scopePopper:t,children:n}=e,[r,i]=D.useState(null);return(0,Oo.jsx)(Jae,{scope:t,anchor:r,onAnchorChange:i,children:n})};f9.displayName=c9;var p9=`PopperAnchor`,m9=D.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=d9(p9,n),o=D.useRef(null),s=u(t,o),c=D.useRef(null);return D.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&a.onAnchorChange(c.current)}),r?null:(0,Oo.jsx)(h.div,{...i,ref:s})});m9.displayName=p9;var h9=`PopperContent`,[Yae,Xae]=l9(h9),g9=D.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:d=0,sticky:f=`partial`,hideWhenDetached:p=!1,updatePositionStrategy:m=`optimized`,onPlaced:_,...y}=e,x=d9(h9,n),[S,C]=D.useState(null),w=u(t,e=>C(e)),[T,E]=D.useState(null),ee=v(T),te=ee?.width??0,ne=ee?.height??0,re=r+(a===`center`?``:`-`+a),ie=typeof d==`number`?d:{top:0,right:0,bottom:0,left:0,...d},O=Array.isArray(l)?l:[l],ae=O.length>0,oe={padding:ie,boundary:O.filter(Qae),altBoundary:ae},{refs:se,floatingStyles:ce,placement:le,isPositioned:ue,middlewareData:de}=Lae({strategy:`fixed`,placement:re,whileElementsMounted:(...e)=>J7(...e,{animationFrame:m===`always`}),elements:{reference:x.anchor},middleware:[zae({mainAxis:i+ne,alignmentAxis:o}),c&&Bae({mainAxis:!0,crossAxis:!1,limiter:f===`partial`?Vae():void 0,...oe}),c&&Hae({...oe}),Uae({...oe,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),T&&Gae({element:T,padding:s}),$ae({arrowWidth:te,arrowHeight:ne}),p&&Wae({strategy:`referenceHidden`,...oe})]}),[fe,pe]=y9(le),me=g(_);b(()=>{ue&&me?.()},[ue,me]);let he=de.arrow?.x,ge=de.arrow?.y,_e=de.arrow?.centerOffset!==0,[ve,ye]=D.useState();return b(()=>{S&&ye(window.getComputedStyle(S).zIndex)},[S]),(0,Oo.jsx)(`div`,{ref:se.setFloating,"data-radix-popper-content-wrapper":``,style:{...ce,transform:ue?ce.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ve,"--radix-popper-transform-origin":[de.transformOrigin?.x,de.transformOrigin?.y].join(` `),...de.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,Oo.jsx)(Yae,{scope:n,placedSide:fe,onArrowChange:E,arrowX:he,arrowY:ge,shouldHideArrow:_e,children:(0,Oo.jsx)(h.div,{"data-side":fe,"data-align":pe,...y,ref:w,style:{...y.style,animation:ue?void 0:`none`}})})})});g9.displayName=h9;var _9=`PopperArrow`,Zae={top:`bottom`,right:`left`,bottom:`top`,left:`right`},v9=D.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Xae(_9,n),a=Zae[i.placedSide];return(0,Oo.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,Oo.jsx)(qae,{...r,ref:t,style:{...r.style,display:`block`}})})});v9.displayName=_9;function Qae(e){return e!==null}var $ae=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=y9(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function y9(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var b9=f9,x9=m9,S9=g9,C9=v9,[w9,eoe]=_(`Tooltip`,[u9]),T9=u9(),E9=`TooltipProvider`,toe=700,D9=`tooltip.open`,[noe,O9]=w9(E9),k9=e=>{let{__scopeTooltip:t,delayDuration:n=toe,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=D.useRef(!0),s=D.useRef(!1),c=D.useRef(0);return D.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,Oo.jsx)(noe,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:D.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:D.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:D.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};k9.displayName=E9;var A9=`Tooltip`,[roe,j9]=w9(A9),M9=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=O9(A9,e.__scopeTooltip),l=T9(t),[u,d]=D.useState(null),f=y(),p=D.useRef(0),h=o??c.disableHoverableContent,g=s??c.delayDuration,_=D.useRef(!1),[v,b]=m({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(D9))):c.onClose(),a?.(e)},caller:A9}),x=D.useMemo(()=>v?_.current?`delayed-open`:`instant-open`:`closed`,[v]),S=D.useCallback(()=>{window.clearTimeout(p.current),p.current=0,_.current=!1,b(!0)},[b]),C=D.useCallback(()=>{window.clearTimeout(p.current),p.current=0,b(!1)},[b]),w=D.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{_.current=!0,b(!0),p.current=0},g)},[g,b]);return D.useEffect(()=>()=>{p.current&&=(window.clearTimeout(p.current),0)},[]),(0,Oo.jsx)(b9,{...l,children:(0,Oo.jsx)(roe,{scope:t,contentId:f,open:v,stateAttribute:x,trigger:u,onTriggerChange:d,onTriggerEnter:D.useCallback(()=>{c.isOpenDelayedRef.current?w():S()},[c.isOpenDelayedRef,w,S]),onTriggerLeave:D.useCallback(()=>{h?C():(window.clearTimeout(p.current),p.current=0)},[C,h]),onOpen:S,onClose:C,disableHoverableContent:h,children:n})})};M9.displayName=A9;var N9=`TooltipTrigger`,P9=D.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=j9(N9,n),a=O9(N9,n),o=T9(n),s=u(t,D.useRef(null),i.onTriggerChange),c=D.useRef(!1),l=D.useRef(!1),d=D.useCallback(()=>c.current=!1,[]);return D.useEffect(()=>()=>document.removeEventListener(`pointerup`,d),[d]),(0,Oo.jsx)(x9,{asChild:!0,...o,children:(0,Oo.jsx)(h.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:f(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:f(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:f(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,d,{once:!0})}),onFocus:f(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:f(e.onBlur,i.onClose),onClick:f(e.onClick,i.onClose)})})});P9.displayName=N9;var F9=`TooltipPortal`,[ioe,aoe]=w9(F9,{forceMount:void 0}),I9=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=j9(F9,t);return(0,Oo.jsx)(ioe,{scope:t,forceMount:n,children:(0,Oo.jsx)(d,{present:n||a.open,children:(0,Oo.jsx)(p,{asChild:!0,container:i,children:r})})})};I9.displayName=F9;var L9=`TooltipContent`,R9=D.forwardRef((e,t)=>{let n=aoe(L9,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=j9(L9,e.__scopeTooltip);return(0,Oo.jsx)(d,{present:r||o.open,children:o.disableHoverableContent?(0,Oo.jsx)(z9,{side:i,...a,ref:t}):(0,Oo.jsx)(ooe,{side:i,...a,ref:t})})}),ooe=D.forwardRef((e,t)=>{let n=j9(L9,e.__scopeTooltip),r=O9(L9,e.__scopeTooltip),i=D.useRef(null),a=u(t,i),[o,s]=D.useState(null),{trigger:c,onClose:l}=n,d=i.current,{onPointerInTransitChange:f}=r,p=D.useCallback(()=>{s(null),f(!1)},[f]),m=D.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=doe(r,uoe(r,n.getBoundingClientRect())),a=foe(t.getBoundingClientRect());s(moe([...i,...a])),f(!0)},[f]);return D.useEffect(()=>()=>p(),[p]),D.useEffect(()=>{if(c&&d){let e=e=>m(e,d),t=e=>m(e,c);return c.addEventListener(`pointerleave`,e),d.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),d.removeEventListener(`pointerleave`,t)}}},[c,d,m,p]),D.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||d?.contains(t),i=!poe(n,o);r?p():i&&(p(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,d,o,l,p]),(0,Oo.jsx)(z9,{...e,ref:a})}),[soe,coe]=w9(A9,{isInside:!1}),loe=x(`TooltipContent`),z9=D.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=j9(L9,n),u=T9(n),{onClose:d}=c;return D.useEffect(()=>(document.addEventListener(D9,d),()=>document.removeEventListener(D9,d)),[d]),D.useEffect(()=>{if(c.trigger){let e=e=>{e.target?.contains(c.trigger)&&d()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,d]),(0,Oo.jsx)(l,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,Oo.jsxs)(S9,{"data-state":c.stateAttribute,...u,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,Oo.jsx)(loe,{children:r}),(0,Oo.jsx)(soe,{scope:n,isInside:!0,children:(0,Oo.jsx)(Uie,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});R9.displayName=L9;var B9=`TooltipArrow`,V9=D.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=T9(n);return coe(B9,n).isInside?null:(0,Oo.jsx)(C9,{...i,...r,ref:t})});V9.displayName=B9;function uoe(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function doe(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function foe(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function poe(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function moe(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),hoe(t)}function hoe(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var goe=k9,_oe=M9,voe=P9,yoe=I9,boe=R9,xoe=V9;function Soe(e){let t=(0,Ao.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({delayDuration:r,...n}=e,t[0]=e,t[1]=n,t[2]=r);let i=r===void 0?0:r,a;return t[3]!==i||t[4]!==n?(a=(0,Oo.jsx)(goe,{"data-slot":`tooltip-provider`,delayDuration:i,...n}),t[3]=i,t[4]=n,t[5]=a):a=t[5],a}function Coe(e){let t=(0,Ao.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Oo.jsx)(_oe,{"data-slot":`tooltip`,...n}),t[2]=n,t[3]=r),r}function woe(e){let t=(0,Ao.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Oo.jsx)(voe,{"data-slot":`tooltip-trigger`,...n}),t[2]=n,t[3]=r),r}function Toe(e){let t=(0,Ao.c)(13),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,sideOffset:a,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?0:a,c;t[5]===r?c=t[6]:(c=s(`z-50 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none motion-reduce:data-[state=delayed-open]:animate-none motion-reduce:duration-0`,r),t[5]=r,t[6]=c);let l;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Oo.jsx)(xoe,{className:`z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground`}),t[7]=l):l=t[7];let u;return t[8]!==n||t[9]!==i||t[10]!==o||t[11]!==c?(u=(0,Oo.jsx)(yoe,{children:(0,Oo.jsxs)(boe,{"data-slot":`tooltip-content`,sideOffset:o,className:c,...i,children:[n,l]})}),t[8]=n,t[9]=i,t[10]=o,t[11]=c,t[12]=u):u=t[12],u}function H9(e){if(typeof e!=`object`||!e)return;let t=e;if(typeof t.title==`string`&&t.title.length>0)return t.title}function Eoe(e){return e.kind===`asset`}function Doe(e){return e.kind===`document`}function Ooe(e){return e.kind===`folder`}function koe(e){if(!e)return[];let t=e.split(`/`).filter(Boolean),n=[];for(let e=1;e<t.length;e++)n.push(t.slice(0,e).join(`/`));return n}function Aoe(e){if(!e)return``;let t=e.lastIndexOf(`/`);return t>0?e.slice(0,t):``}function joe(e,t=!1){return e.filter(e=>{let n=e.docName??e.path??``;return n===``?!1:t?!0:!n.split(`/`).some(e=>e.startsWith(`.`))})}var U9=null,W9=new Set;function G9(e,t){if(e===t)return!0;if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Moe(e,t){return e===null?!1:e===t?!0:G9(e.pages,t.pages)&&G9(e.folderPaths,t.folderPaths)&&G9(e.assetPaths??new Set,t.assetPaths??new Set)}function Noe(e,t){let n=new Map;for(let r of e){let e=t(r);e&&!n.has(e)&&n.set(e,r)}return n}function Poe(){return U9}function Foe(e){if(!Moe(U9,e)){U9=e;for(let t of[...W9])try{t(e)}catch(e){console.error(`[page-list-cache] subscriber threw:`,e)}}}function Ioe(e){if(W9.add(e),U9!==null)try{e(U9)}catch(e){console.error(`[page-list-cache] subscriber threw on replay:`,e)}return()=>{W9.delete(e)}}var K9=`open-knowledge:documents-changed`,Loe=new Set(h5.options);function q9(e){return e===void 0||!Array.isArray(e)?[`files`]:[...new Set(e.filter(e=>Loe.has(e)))]}function Roe(e=[`files`]){window.dispatchEvent(new CustomEvent(K9,{detail:{channels:q9(e)}}))}function J9(e){let t=t=>{e(q9(t instanceof CustomEvent?t.detail?.channels:void 0))};return window.addEventListener(K9,t),()=>window.removeEventListener(K9,t)}var Y9=`open-knowledge:templates-changed`;function zoe(){window.dispatchEvent(new CustomEvent(Y9))}function Boe(e){let t=()=>e();return window.addEventListener(Y9,t),()=>window.removeEventListener(Y9,t)}function X9(e){return e.trim().replace(/^\.\/+/,``).replace(/^\/+/,``).replace(/\.mdx?$/i,``)}function Voe(e){let t=X9(e);return t?`${t}.md`:`untitled.md`}function Hoe(e){let t=X9(e),n=t.lastIndexOf(`/`);return{initialDir:n>0?t.slice(0,n):``,suggestedName:`${n>=0?t.slice(n+1):t||`untitled`}.md`}}function Uoe(e){let t=e.trim();return{normalizedTarget:X9(t).replace(/\/+$/g,``),expectsFolder:/\/+$/.test(t)}}function Z9(e){let t=new Set;for(let n of e)for(let e of koe(n))t.add(e);return t}function Woe(e,t){if(!t)return;let n=t5(e);if(n)return t.get(n)}function Goe(e,t){let{normalizedTarget:n,expectsFolder:r}=Uoe(e);if(!n)return{kind:`missing`,target:n};if(!r&&t.pages.has(n))return{kind:`doc`,target:n,docName:n};if(!r){let e=Woe(n,t.pagesBySlug);if(e)return{kind:`doc`,target:e,docName:e}}let i=`${n}/index`;if(t.pages.has(i))return{kind:`folder-index`,target:n,folderPath:n,docName:i,noteKind:`canonical-index`};let a=n.split(`/`).pop(),o=a?`${n}/${a}`:null;return o&&t.pages.has(o)?{kind:`folder-index`,target:n,folderPath:n,docName:o,noteKind:`legacy-folder-note`}:(t.folderPaths??Z9(t.pages)).has(n)?{kind:`folder`,target:n,folderPath:n}:{kind:`missing`,target:n}}function Koe(e){return e.kind===`folder-index`?{kind:`folder`,target:e.folderPath,folderPath:e.folderPath}:e}function qoe(e){switch(e.kind){case`doc`:case`folder-index`:return e.docName;case`missing`:return e.target;case`asset`:case`folder`:return null}}var Q9=(0,D.createContext)(null);function Joe(e,t){if(t.size===0)return new Set(e);let n=new Set(e);for(let e of t)n.add(e);return n}function Yoe(e,t){if(e.size===0)return new Set;let n=new Set;for(let r of e)t.has(r)||n.add(r);return n}function Xoe(e,t){let n=new Map(e);for(let e of t)n.has(e)||n.set(e,e);return n}async function Zoe(){let e=await fetch(`/api/pages`);if(!e.ok){let t=await e.json().catch(()=>null);throw Error(H9(t)??`/api/pages responded with ${e.status}`)}let t=await e.json();return Array.isArray(t.pages)?t.pages:[]}async function Qoe(){let e=await fetch(`/api/documents`);if(!e.ok){let t=await e.json().catch(()=>null);throw Error(H9(t)??`/api/documents responded with ${e.status}`)}let t=await e.json();return Array.isArray(t.documents)?{assetPaths:t.documents.filter(e=>e.kind===`asset`&&typeof e.path==`string`&&e.path.length>0).map(e=>e.path),folderPaths:t.documents.filter(e=>e.kind===`folder`&&typeof e.path==`string`&&e.path.length>0).map(e=>e.path)}:{assetPaths:[],folderPaths:[]}}function $oe(e){console.error(`[PageListContext] Failed to load pages:`,e)}function ese(e){console.warn(`[PageListContext] Failed to load referenced assets:`,e)}function tse(e){let t=(0,Ao.c)(43),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=new Set,t[0]=r):r=t[0];let[i,a]=(0,D.useState)(r),o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=new Map,t[1]=o):o=t[1];let[s,c]=(0,D.useState)(o),l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=new Map,t[2]=l):l=t[2];let[u,d]=(0,D.useState)(l),f;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(f=new Set,t[3]=f):f=t[3];let[p,m]=(0,D.useState)(f),h;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(h=new Set,t[4]=h):h=t[4];let[g,_]=(0,D.useState)(h),v;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(v=new Set,t[5]=v):v=t[5];let[y,b]=(0,D.useState)(v),[x,S]=(0,D.useState)(!0),[C,w]=(0,D.useState)(null),T=(0,D.useRef)(0),E;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(E=function(){let e=T.current+=1;Promise.all([Zoe(),Qoe().catch(ase)]).then(t=>{let[n,r]=t;if(e!==T.current)return;let i=new Set(n.map(ise));a(i),c(new Map(n.map(rse))),d(new Map(n.map(nse))),m(new Set(r.assetPaths)),_(new Set(r.folderPaths)),b(e=>Yoe(e,i)),w(null)}).catch(t=>{e===T.current&&($oe(t),w(t instanceof Error?t.message:`Failed to load pages`))}).finally(()=>{e===T.current&&S(!1)})},t[6]=E):E=t[6];let ee=E,te;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(te=function(e){b(t=>{if(t.has(e))return t;let n=new Set(t);return n.add(e),n}),w(null)},t[7]=te):te=t[7];let ne=te,re,ie;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(ie=()=>{ee();let e=()=>{document.visibilityState===`visible`&&ee()};window.addEventListener(`focus`,e),window.addEventListener(`visibilitychange`,e);let t=J9(e=>{e.includes(`files`)&&ee()});return()=>{window.removeEventListener(`focus`,e),window.removeEventListener(`visibilitychange`,e),t()}},re=[],t[8]=re,t[9]=ie):(re=t[8],ie=t[9]),(0,D.useEffect)(ie,re);let O,ae,oe,se,ce,le;if(t[10]!==y||t[11]!==p||t[12]!==g||t[13]!==u||t[14]!==s||t[15]!==i){ce=Joe(i,y);let e;t[22]!==y||t[23]!==s?(e=Xoe(s,y),t[22]=y,t[23]=s,t[24]=e):e=t[24],se=e,oe=u,O=p,ae=new Set([...Z9(ce),...g]),le=Noe(ce,t5),t[10]=y,t[11]=p,t[12]=g,t[13]=u,t[14]=s,t[15]=i,t[16]=O,t[17]=ae,t[18]=oe,t[19]=se,t[20]=ce,t[21]=le}else O=t[16],ae=t[17],oe=t[18],se=t[19],ce=t[20],le=t[21];let ue=le,de,fe;t[25]!==O||t[26]!==ae||t[27]!==ce||t[28]!==ue?(de=()=>{Foe({pages:ce,folderPaths:ae,pagesBySlug:ue,assetPaths:O})},fe=[ce,ae,ue,O],t[25]=O,t[26]=ae,t[27]=ce,t[28]=ue,t[29]=de,t[30]=fe):(de=t[29],fe=t[30]),(0,D.useEffect)(de,fe);let pe;t[31]!==O||t[32]!==C||t[33]!==ae||t[34]!==x||t[35]!==oe||t[36]!==se||t[37]!==ce||t[38]!==ue?(pe={pages:ce,pagesBySlug:ue,pageTitles:se,pageMeta:oe,folderPaths:ae,assetPaths:O,loading:x,error:C,refetch:ee,addPage:ne},t[31]=O,t[32]=C,t[33]=ae,t[34]=x,t[35]=oe,t[36]=se,t[37]=ce,t[38]=ue,t[39]=pe):pe=t[39];let me;return t[40]!==n||t[41]!==pe?(me=(0,Oo.jsx)(Q9,{value:pe,children:n}),t[40]=n,t[41]=pe,t[42]=me):me=t[42],me}function nse(e){return[e.docName,{size:e.size,modified:e.modified,docExt:e.docExt}]}function rse(e){return[e.docName,e.title]}function ise(e){return e.docName}function ase(e){return ese(e),{assetPaths:[],folderPaths:[]}}function ose(){let e=(0,D.use)(Q9);if(!e)throw Error(`usePageList must be used within <PageListProvider />`);return e}function sse(e){if(e.startsWith($9)||!e.startsWith(`#/`))return null;let t=e.slice(2),n=fse(t),r=n>=0?t.slice(0,n):t;if(!r)return null;try{return r.split(`/`).map(decodeURIComponent).join(`/`)}catch{return r}}function cse(e){if(e.startsWith($9)||!e.startsWith(`#/`))return null;let t=e.slice(2),n=t.indexOf(`?`),r=t.indexOf(`#`);if(n>=0&&(r<0||n<r)){let e=r>=0?r:t.length,i=new URLSearchParams(t.slice(n+1,e)).get(`anchor`);if(i)return i}if(r<0)return null;let i=t.slice(r+1);if(!i)return null;try{return decodeURIComponent(i)}catch{return i}}function lse(e,t){let n=`#/${e}`;return t?`${n}?anchor=${encodeURIComponent(t)}`:n}function use(e){return e.endsWith(`.mdx`)?e.slice(0,-4):e.endsWith(`.md`)?e.slice(0,-3):e}function dse(e,t){let n=e.replace(/^\/+|\/+$/g,``),r=n?`#/${n}/`:`#/`;return t?`${r}?anchor=${encodeURIComponent(t)}`:r}var $9=`#/__asset__/`;function fse(e){let t=e.indexOf(`?`),n=e.indexOf(`#`);return t<0?n:n<0?t:Math.min(t,n)}function pse(e){if(!e.startsWith($9))return null;let t=e.slice(12);if(!t)return null;try{return t.split(`/`).map(decodeURIComponent).join(`/`)}catch{return t}}function mse(e){return`${$9}${e.split(`/`).map(encodeURIComponent).join(`/`)}`}var hse=n(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),gse=n(((e,t)=>{var n=hse();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),_se=n(((e,t)=>{t.exports=gse()()}));export{_$ as $,w4 as $n,B as $r,g0 as $t,Toe as A,l$ as An,dT as Ar,y2 as At,J7 as B,S2 as Bn,rb as Br,Nre as Bt,Aoe as C,t0 as Cn,$Z as Cr,Are as Ct,Ooe as D,oie as Dn,v5 as Dr,q1 as Dt,Doe as E,m4 as En,i5 as Er,c$ as Et,S9 as F,Cie as Fn,Qx as Fr,gre as Ft,Y7 as G,y4 as Gn,oy as Gr,Pre as Gt,Z7 as H,Tie as Hn,wb as Hr,S0 as Ht,b9 as I,r5 as In,zx as Ir,B8 as It,Kie as J,S4 as Jn,Zx as Jr,d$ as Jt,X7 as K,b4 as Kn,Gy as Kr,t1 as Kt,u9 as L,Nie as Ln,ene as Lr,y1 as Lt,woe as M,P5 as Mn,gx as Mr,T$ as Mt,x9 as N,WZ as Nn,Cb as Nr,$$ as Nt,H9 as O,aie as On,une as Or,pre as Ot,C9 as P,z8 as Pn,tS as Pr,l1 as Pt,bie as Q,C4 as Qn,Tp as Qr,f0 as Qt,e9 as R,V1 as Rn,Ky as Rr,y$ as Rt,Ioe as S,e0 as Sn,K1 as Sr,lre as St,Eoe as T,gie as Tn,t5 as Tr,k$ as Tt,$7 as U,D4 as Un,Bx as Ur,C0 as Ut,t9 as V,r$ as Vn,ib as Vr,jre as Vt,Fae as W,O4 as Wn,Oy as Wr,b1 as Wt,L5 as X,x4 as Xn,R_ as Xr,c0 as Xt,Wie as Y,T4 as Yn,F_ as Yr,x0 as Yt,yie as Z,v4 as Zn,vv as Zr,p0 as Zt,Roe as _,he as _i,mie as _n,cQ as _r,kre as _t,use as a,_f as ai,H1 as an,a1 as ar,tie as at,Boe as b,oe as bi,xie as bn,Vie as br,j$ as bt,dse as c,sd as ci,Fie as cn,are as cr,$re as ct,qoe as d,gu as di,JQ as dn,i$ as dr,f$ as dt,zp as ei,I1 as en,YZ as er,O$ as et,Koe as f,wu as fi,T0 as fn,M8 as fr,m$ as ft,X9 as g,Ie as gi,zie as gn,z2 as gr,K$ as gt,Voe as h,j as hi,Z1 as hn,Bie as hr,E5 as ht,sse as i,z as ii,N$ as in,b$ as ir,Zre as it,Soe as j,U1 as jn,jx as jr,bre as jt,Coe as k,Oie as kn,ine as kr,D5 as kt,tse as l,L as li,HQ as ln,C2 as lr,Xre as lt,Hoe as m,P as mi,Y1 as mn,j2 as mr,g$ as mt,cse as n,R as ni,w0 as nn,n$ as nr,Ere as nt,mse as o,Qd as oi,G1 as on,P2 as or,eie as ot,Goe as p,F as pi,J1 as pn,B1 as pr,p$ as pt,Q7 as q,E4 as qn,Eb as qr,r1 as qt,pse as r,bp as ri,E$ as rn,M2 as rr,dre as rt,lse as s,I as si,vre as sn,ore as sr,Qre as st,_se as t,Hp as ti,Ire as tn,I5 as tr,Tre as tt,ose as u,yu as ui,PQ as un,G$ as ur,h$ as ut,zoe as v,me as vi,Iie as vn,sQ as vr,Ore as vt,joe as w,Sie as wn,O1 as wr,v$ as wt,Poe as x,ae as xi,n0 as xn,pie as xr,Fre as xt,J9 as y,pe as yi,Lie as yn,Rie as yr,M$ as yt,Pae as z,u$ as zn,tb as zr,yre as zt};
433
+ `)},mdxJsxFlowElement(e,t,n,r){let i=e,a=i.data?.sourceRaw;if(typeof a==`string`)return a;let o=i.data?.htmlBoundary;if(o&&typeof o.opener==`string`&&typeof o.closer==`string`){let e=n.containerFlow({type:`root`,children:i.children??[]},r);return`${o.opener}\n\n${e}\n\n${o.closer}`}let s=i.name??``,c=P8(i.attributes??[]);if(!i.children||i.children.length===0)return s?c?`<${s} ${c} />`:`<${s} />`:``;let l=c?`<${s} ${c}>`:`<${s}>`,u=`</${s}>`;return`${l}\n\n${n.containerFlow({type:`root`,children:i.children},r)}\n\n${u}`},mark(e,t,n,r){let i=n.createTracker(r),a=n.enter(`mark`),o=i.move(`==`);return o+=n.containerPhrasing(e,{before:o,after:`==`,...i.current()}),o+=i.move(`==`),a(),o},comment(e,t,n,r){let i=e.data?.sourceForm,a=i===`html`?`<!-- `:`%%`,o=i===`html`?` -->`:`%%`,s=n.createTracker(r),c=n.enter(`comment`),l=s.move(a);return l+=n.containerPhrasing(e,{before:l,after:o,...s.current()}),l+=s.move(o),c(),l},commentBlock(e,t,n,r){let i=n.createTracker(r),a=n.enter(`commentBlock`),o=e.children??[],s=e.data?.sourceForm,c=e.data?.sourceLayout,l=o.length===1&&o[0]?.type===`paragraph`;if(s===`html`&&l){let e=o[0],t=n.containerPhrasing(e,{before:`<!-- `,after:` -->`,...i.current()});return a(),`<!-- ${t} -->`}if(c===`inline`&&l){let e=o[0],t=n.containerPhrasing(e,{before:`%% `,after:` %%`,...i.current()});return a(),`%% ${t} %%`}let u=n.containerFlow(e,i.current());return a(),`%%\n\n${u}\n\n%%`},mdxJsxTextElement(e){let t=e.data?.sourceRaw;if(typeof t==`string`)return t;let n=e.name??``,r=P8(e.attributes??[]);return r?`<${n} ${r} />`:`<${n}/>`},rawMdxFallback(e){return e.value??``},blockquote(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.containerFlow(e,a.current());i();let s=e.data?.sourceMarkerSpacings,c=0;return n.indentLines(o,(e,t,n)=>n?`>`:s?.[c++]===`none`?`>${e}`:`> ${e}`)}};function P8(e){let t=[];for(let n of e){if(n.type===`mdxJsxExpressionAttribute`){t.push(`{${n.value}}`);continue}let e=n.name;if(n.value===null||n.value===void 0){t.push(e);continue}if(typeof n.value==`string`){if(n.value.includes(`"`)){let r=n.value.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`);t.push(`${e}={"${r}"}`)}else t.push(`${e}="${n.value}"`);continue}t.push(`${e}={${n.value.value}}`)}return t.join(` `)}function F8(e,t,n=` `){return t===`single`?`${n}'${e.replace(/'/g,`\\'`)}'`:t===`paren`?`${n}(${e.replace(/[()]/g,`\\$&`)})`:`${n}"${e.replace(/"/g,`\\"`)}"`}function I8(e){if(!e)return``;let t=0,n=!0;for(let r of e)r===`(`?t++:r===`)`&&(t--,t<0&&(n=!1));return t!==0&&(n=!1),n?e:e.replace(/[\\()]/g,`\\$&`)}function L8(e){return e.replace(/(?<!\\)&(?=[A-Za-z][A-Za-z0-9]*;|#[0-9]+;|#[xX][0-9A-Fa-f]+;)/g,`\\&`)}function R8(e,t,n){let r=e.unsafe;e.unsafe=r.filter(e=>!(e.character===`&`&&e.after===`[#A-Za-z]`||e.character===`<`||e.character===`[`||e.character===`(`||e.character==="`"));let i;try{i=e.safe(t,n)}finally{e.unsafe=r}return L8(i)}function z8(e){if(!Number.isFinite(e)||e<0)return``;if(e<1024)return`${e} B`;let t=[`KiB`,`MiB`,`GiB`,`TiB`],n=e/1024,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return`${n.toFixed(1).replace(/\.0$/,``)} ${t[r]}`}var B8=class{schema;handlers;pmNodeHandlers;pmMarkHandlers;parseProcessor;serializeProcessor;parseCtx={current:{}};constructor(e){this.schema=tb(e.extensions),this.handlers=X8(this.schema,this.parseCtx);let{nodeHandlers:t,markHandlers:n}=Z8(this.schema);this.pmNodeHandlers=t,this.pmMarkHandlers=n,this.parseProcessor=w8({schema:this.schema,handlers:this.handlers,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers}),this.serializeProcessor=T8({schema:this.schema,handlers:this.handlers,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers,toMarkdownHandlers:N8})}parse(e,t){if(!e.trim())return{type:`doc`,content:[{type:`paragraph`,content:[]}]};this.parseCtx.current=t??{};try{return E8(e,this.parseProcessor).toJSON()}finally{this.parseCtx.current={}}}parseToMdast(e){return e.trim()?D8(e,this.parseProcessor):{type:`root`,children:[]}}parseWithFallback(e,t){return e.trim()?I4(e,{parse:e=>this.parse(e,t)}):{type:`doc`,content:[{type:`paragraph`,content:[]}]}}serialize(e){let t;try{t=this.schema.nodeFromJSON(e)}catch(t){let n=`MarkdownManager.serialize() failed: schema rejected JSONContent (type=${e.type}, childCount=${e.content?.length??0})`;throw Error(n,{cause:t})}return O8(t,this.serializeProcessor,{schema:this.schema,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers})}},V8=m4();function H8(e,t){let n=new Map;for(let e of t)n.set(e.name,e);let r={};for(let t of e){if(t.type===`mdxJsxExpressionAttribute`)continue;let e=t.name,i=n.get(e);if(t.value===null||t.value===void 0){r[e]=!0;continue}if(typeof t.value==`string`){if(i?.type===`number`){let n=Number(t.value);r[e]=Number.isNaN(n)?t.value:n}else i?.type===`boolean`?r[e]=t.value===`true`:r[e]=t.value;continue}let a=t.value.value;try{r[e]=JSON.parse(a)}catch{r[e]=a}}return r}function U8(e){let t=!1;return e.descendants(e=>t||e.type.name===`jsxInline`?!1:e.type.name===`jsxComponent`&&e.attrs.sourceDirty?(t=!0,!1):!0),t}function W8(e){return e.attrs.sourceDirty||U8(e)}function G8(e){if(e.type!==`paragraph`)return!1;let t=e.children??[];return t.length===0?!0:t.every(e=>e.type===`text`&&e.value===``)}function K8(e,t){if(!t)return e;let n={};return t.sourceFenceChar&&(n.sourceFenceChar=t.sourceFenceChar),typeof t.sourceFenceLength==`number`&&(n.sourceFenceLength=t.sourceFenceLength),Object.keys(n).length===0?e:{...e,data:n}}function q8(e,t){if(e.length===0)return K8({type:`inlineCode`,value:``},t);if(e.every(e=>e.type===`text`))return K8({type:`inlineCode`,value:e.map(e=>e.value).join(``)},t);if(e.length===1&&`children`in e[0]){let n=e[0];return{...n,children:[q8(n.children,t)]}}return K8({type:`inlineCode`,value:J8(e)},t)}function J8(e){let t=``;for(let n of e)n.type===`text`?t+=n.value:`children`in n&&Array.isArray(n.children)?t+=J8(n.children):`value`in n&&typeof n.value==`string`&&(t+=n.value);return t}var Y8=T$;function X8(e,t){let n=e.nodes,r=e.marks,i={};n.paragraph&&(i.paragraph=(e,t,r)=>{let i=r.all(e).flat(),a=i.some(e=>e?.isBlock&&!e?.isInline),o=i.some(e=>e?.isInline||e?.isText||e?.isTextblock);if(a&&!o)return i.length===1?i[0]:i;if(a&&o){let e=i.filter(e=>!e?.isBlock||e?.isInline),t=i.filter(e=>e?.isBlock&&!e?.isInline),r=[],a=n.paragraph.createAndFill(null,e.length>0?e:null);return a&&r.push(a),r.push(...t),r.length===1?r[0]:r}return n.paragraph.createAndFill(null,i.length>0?i:null)}),n.blockquote&&(i.blockquote=tU(n.blockquote,e=>({sourceMarkerSpacings:e.data?.sourceMarkerSpacings??null}))),n.tableCell&&(i.tableCell=(e=>(t,r,i)=>{let a=i.all(t).flat();if(a.length>0&&n.paragraph){let t=n.paragraph.create(null,a);return e.createAndFill(null,[t])}return e.createAndFill(null,null)})(n.tableCell)),n.tableRow&&(i.tableRow=tU(n.tableRow)),n.table&&n.tableRow&&n.tableCell&&(i.table=(e,t,r)=>{let i=e.align??[],a=e.children??[],o=[];for(let e=0;e<a.length;e++){let t=a[e];if(t.type!==`tableRow`)continue;let s=t.children??[],c=[];for(let t=0;t<s.length;t++){let a=s[t];if(a.type!==`tableCell`)continue;let o=r.all(a).flat(),l=o.length>0&&n.paragraph?[n.paragraph.create(null,o)]:null,u=i[t]??null,d=e===0&&n.tableHeader?n.tableHeader:n.tableCell,f=a.data?.sourcePadding??null,p=d.createAndFill({align:u,sourcePadding:f},l);p&&c.push(p)}let l=n.tableRow.createAndFill(null,c.length>0?c:null);l&&o.push(l)}let s=e.data?.sourceDashCounts??null;return n.table.createAndFill({sourceDashCounts:s},o.length>0?o:null)}),n.image&&(i.image=e=>{let r=e.url??``,i=M8(r,t.current.sourcePath);return n.image.createAndFill({src:i,alt:e.alt??null,title:e.title??null,sourceUrl:i===r?null:r})},n.imageReference?i.imageReference=e=>n.imageReference.createAndFill({alt:e.alt??``,label:e.label??e.identifier??``,identifier:e.identifier??``,referenceType:e.referenceType??`shortcut`}):i.imageReference=e=>n.image.createAndFill({src:``,alt:e.alt??null,title:null})),r.escapeMark&&(i.text=t=>{let n=t.value??``,i=typeof t.data?.sourceRaw==`string`?t.data.sourceRaw:null;if(!n&&!i)return null;if(i){let t=n.replaceAll(`\xA0`,` `);return r.sourceLiteral?e.text(t,[r.sourceLiteral.create({sourceRaw:i})]):e.text(t)}let a=t.data?.escapedChars,o=t.data?.entityRefSpans;if(!a?.length&&!o?.length)return e.text(n.replaceAll(`\xA0`,` `));let s=[...(a??[]).map(e=>({kind:`escape`,offset:e.offset,length:1})),...(o??[]).map(e=>({kind:`entity`,offset:e.offset,length:e.length,raw:e.raw}))];s.sort((e,t)=>e.offset-t.offset);let c=[],l=0;for(let t of s){if(t.offset>l){let r=n.slice(l,t.offset).replaceAll(`\xA0`,` `);r&&c.push(e.text(r))}if(t.offset<n.length){let i=n.slice(t.offset,t.offset+t.length).replaceAll(`\xA0`,` `);i&&(t.kind===`escape`?c.push(e.text(i,[r.escapeMark.create()])):r.sourceLiteral?c.push(e.text(i,[r.sourceLiteral.create({sourceRaw:t.raw})])):c.push(e.text(i))),l=t.offset+t.length}}if(l<n.length){let t=n.slice(l).replaceAll(`\xA0`,` `);t&&c.push(e.text(t))}return c.length===1?c[0]:c}),r.code&&(i.inlineCode=t=>e.text(t.value,[r.code.create({sourceFenceChar:t.data?.sourceFenceChar??"`",sourceFenceLength:typeof t.data?.sourceFenceLength==`number`?t.data.sourceFenceLength:1})]));let a=r.strike??r.delete;if(a&&(i.delete=nU(a)),r.highlight&&(i.mark=nU(r.highlight)),r.comment&&(i.comment=nU(r.comment,e=>({sourceForm:e.data?.sourceForm??`percent`}))),n.commentBlock&&(i.commentBlock=tU(n.commentBlock,e=>({sourceForm:e.data?.sourceForm??`percent`,sourceLayout:e.data?.sourceLayout??`block`}))),r.emphasis&&(i.emphasis=nU(r.emphasis,e=>({sourceDelimiter:e.data?.sourceDelimiter??`*`}))),r.strong&&(i.strong=nU(r.strong,e=>({sourceDelimiter:e.data?.sourceDelimiter??`**`}))),n.heading&&(i.heading=tU(n.heading,e=>({level:e.depth,headingStyle:e.data?.sourceStyle??`atx`,sourceTrailingHashes:e.data?.sourceTrailingHashes??null,sourceUnderlineLength:e.data?.sourceUnderlineLength??null,sourceContiguousNext:e.data?.sourceContiguousNext??!1}))),n.codeBlock&&(i.code=t=>{let r=t.value?[e.text(t.value)]:[];return n.codeBlock.createAndFill({language:t.lang??null,meta:t.meta??null,fenceDelimiter:t.data?.sourceFenceChar??"`",fenceLength:t.data?.sourceFenceLength??3,sourceStyle:t.data?.sourceStyle??`fenced`},r)}),n.thematicBreak&&(i.thematicBreak=e=>n.thematicBreak.createAndFill({sourceRaw:e.data?.sourceRaw??`---`})),n.hardBreak&&(i.break=e=>n.hardBreak.createAndFill({hardBreakStyle:e.data?.sourceStyle??`spaces`})),n.list&&(i.list=tU(n.list,e=>({ordered:!!e.ordered,start:e.start??1,spread:!!e.spread,bulletMarker:e.data?.bulletMarker??null,listMarkerDelimiter:e.data?.listMarkerDelimiter??null}))),n.listItem&&(i.listItem=tU(n.listItem,e=>({checked:e.checked??null,spread:!!e.spread}))),r.link){let t=r.sourceLiteral;i.link=(n,i,a)=>{if((n.children??[]).length===0){let r=typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:`[](${n.url??``})`;return r?t?e.text(r,[t.create({sourceRaw:r})]):e.text(r):null}let o=a.all(n).flat(),s=r.link.create({href:n.url??``,title:n.title??null,linkStyle:n.data?.sourceStyle??`inline`,refLabel:null,sourceUrlForm:n.data?.sourceUrlForm??null,sourceTitleMarker:n.data?.sourceTitleMarker??null});return o.map(e=>e.mark(s.addToSet(e.marks)))},i.linkReference=(n,i,a)=>{if((n.children??[]).length===0){let r=typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:`[${n.label??``}][${n.identifier??``}]`;return r?t?e.text(r,[t.create({sourceRaw:r})]):e.text(r):null}let o=a.all(n).flat(),s=r.link.create({href:``,title:null,linkStyle:n.referenceType??`shortcut`,refLabel:n.label??n.identifier??null});return o.map(e=>e.mark(s.addToSet(e.marks)))}}n.htmlBlock&&(i.html=e=>n.htmlBlock.createAndFill({content:e.value??``}));let o=n.linkDefinition??n.linkRefDef;if(o){let e=!!o.spec.attrs?.url,t=!!o.spec.attrs?.href,n=!!o.spec.attrs?.identifier,r=!!o.spec.attrs?.sourceLayout,a=!!o.spec.attrs?.sourceTitleMarker;i.definition=i=>{let s={title:i.title??null};return n&&(s.identifier=i.identifier??``),s.label=i.label??i.identifier??``,e?s.url=i.url??``:t&&(s.href=i.url??``),r&&(s.sourceLayout=i.data?.sourceLayout??null),a&&(s.sourceTitleMarker=i.data?.sourceTitleMarker??null),o.createAndFill(s)}}if(n.jsxComponent){let r=e=>{if(e&&typeof e==`object`&&`sourceRaw`in e){let t=e.sourceRaw;if(typeof t==`string`)return t}};i.mdxJsxFlowElement=(e,i,a)=>{let o=e.name??``,s=V8.getOrWildcard(o),c=H8(e.attributes,s.props);if(o===`CommonMarkImage`&&typeof c.src==`string`){let e=c.src,n=M8(e,t.current.sourcePath);n!==e&&(c.src=n,c.sourceUrl=e)}let l=a.all(e).flat();return n.jsxComponent.createAndFill({componentName:o,kind:`element`,attributes:e.attributes,sourceRaw:r(e.data)??``,sourceDirty:!1,props:c},l.length?l:void 0)};let a=(e,t)=>{let n=e.attributes?.find(e=>e.type===`mdxJsxAttribute`&&e.name===t);return n&&typeof n.value==`string`?n.value:null};i.mdxJsxTextElement=t=>{if(t.name===`InlineMath`&&n.mathInline){let e=a(t,`formula`)??``,r=a(t,`id`);return n.mathInline.create({formula:e,id:r??null})}if(t.name===`Tag`&&n.tag){let e=a(t,`value`)??``;return n.tag.create({value:e})}if(n.jsxInline){let i=r(t.data)??``;return n.jsxInline.createAndFill({},i?[e.text(i)]:null)}return n.jsxComponent.createAndFill({sourceRaw:r(t.data)??``})},i.mdxFlowExpression=e=>{let t=r(e.data)??`{${e.value??``}}`;return n.jsxComponent.createAndFill({kind:`expression`,sourceRaw:t,sourceDirty:!1})},i.mdxTextExpression=t=>{let n=r(t.data)??`{${t.value??``}}`;return e.text(n)}}return n.wikiLink&&(i.wikiLink=e=>n.wikiLink.createAndFill({target:e.data?.target??``,alias:e.data?.alias??null,anchor:e.data?.anchor??null})),n.tag&&(i.tag=e=>n.tag.createAndFill({value:e.value})),n.wikiLinkEmbed&&(i.wikiLinkEmbed=(i,a)=>{let o=i.data?.target??``,s=i.data?.alias??null,c=i.data?.anchor??null,l=U1(o),{resolveEmbed:u,sourcePath:d}=t.current,f=u&&d?u(o,d)??null:null,p=f?`/${f}`:o,m=a?.type===`paragraph`&&Array.isArray(a.children)&&a.children.length===1;if(m&&Y8.has(l)&&n.jsxComponent&&V8.has(`WikiEmbedImage`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedImage`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,alt:s??o,target:o,anchor:c,alias:s}});if(m&&E$.has(l)&&n.jsxComponent&&V8.has(`WikiEmbedVideo`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedVideo`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,title:s??o,target:o,anchor:c,alias:s}});if(m&&O$.has(l)&&n.jsxComponent&&V8.has(`WikiEmbedAudio`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedAudio`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,title:s??o,target:o,anchor:c,alias:s}});if(m&&k$.has(l)&&n.jsxComponent&&V8.has(`WikiEmbedFile`)){let{resolveSize:e}=t.current,r=e&&d?e(o,d)??null:null,i=r===null?null:z8(r);return n.jsxComponent.createAndFill({componentName:`WikiEmbedFile`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,target:o,anchor:c,alias:s,size:i}})}let h=s||(c?`${o}#${c}`:o);if(N$.has(l)&&r.link){let t=r.link.create({href:p,title:null,linkStyle:`inline`,refLabel:null,sourceForm:`wikiembed`,target:o,anchor:c,alias:s});return e.text(h,[t])}if(r.link){let t=r.link.create({href:o,title:null,linkStyle:`inline`,refLabel:null});return e.text(h,[t])}throw Error("[wikiLinkEmbed handler] schema lacks `link` mark — cannot dispatch without violating the STOP rule against emitting PM wikiLinkEmbed server-side")}),n.mathInline&&(i.inlineMath=e=>n.mathInline.create({formula:e.value??``})),i.math||=t=>{let r=t.value==null?`«unknown:${t.type}»`:t.value;return n.rawMdxFallback?(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.type,reason:`Unhandled block mdast: ${t.type}`})),n.rawMdxFallback.createAndFill({reason:`Unhandled block mdast: ${t.type}`},r?[e.text(r)]:null)):null},i.inlineMath||=t=>(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.type,reason:`Unhandled inline mdast: ${t.type}`})),t.value==null?e.text(`«unknown:${t.type}»`):e.text(t.value)),n.footnoteReference?i.footnoteReference=e=>n.footnoteReference.create({identifier:e.identifier,label:e.label??e.identifier}):i.footnoteReference||=t=>(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:`footnoteReference`,reason:`FootnoteReference extension missing — recovering [^id] source`})),e.text(`[^${t.label??t.identifier}]`)),n.footnoteDefinition?i.footnoteDefinition=tU(n.footnoteDefinition,e=>{let t=e;return{identifier:t.identifier,label:t.label??t.identifier}}):i.footnoteDefinition||=t=>{console.warn(JSON.stringify({event:`unknown-mdast-type`,type:`footnoteDefinition`,reason:`FootnoteDefinition extension missing — recovering [^id]: marker`}));let r=`[^${t.label??t.identifier}]: `;return n.paragraph?n.paragraph.create(null,e.text(r)):null},i.rawMdxFallbackMdast=t=>{if(!n.rawMdxFallback)return null;let r=t.position?{start:t.position.start?.offset??0,end:t.position.end?.offset??0}:{start:0,end:0};return console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.originalType,reason:`Unhandled mdast: ${t.originalType}`})),n.rawMdxFallback.createAndFill({reason:`Unhandled mdast: ${t.originalType}`,originalSpan:r},t.value?[e.text(t.value)]:null)},i}function Z8(e){let t={},n={},r=e.nodes,i=e.marks;r.paragraph&&(t.paragraph=sU(`paragraph`)),r.blockquote&&(t.blockquote=sU(`blockquote`,e=>{let t=e.attrs.sourceMarkerSpacings,n={};return Array.isArray(t)&&t.length>0&&(n.sourceMarkerSpacings=t),Object.keys(n).length>0?{data:n}:{}})),r.heading&&(t.heading=sU(`heading`,e=>({depth:e.attrs.level,data:{sourceStyle:e.attrs.headingStyle,sourceTrailingHashes:e.attrs.sourceTrailingHashes??void 0,sourceUnderlineLength:e.attrs.sourceUnderlineLength??void 0,sourceContiguousNext:e.attrs.sourceContiguousNext===!0?!0:void 0}}))),r.codeBlock&&(t.codeBlock=e=>{let t=e.attrs.sourceStyle===`indented`?`indented`:`fenced`;return{type:`code`,lang:t===`indented`?null:e.attrs.language??null,meta:t===`indented`?null:e.attrs.meta??null,value:e.textContent??``,data:{sourceFenceChar:e.attrs.fenceDelimiter,sourceFenceLength:e.attrs.fenceLength,sourceStyle:t}}}),r.thematicBreak&&(t.thematicBreak=e=>({type:`thematicBreak`,data:{sourceRaw:e.attrs.sourceRaw}})),r.hardBreak&&(t.hardBreak=e=>({type:`break`,data:{sourceStyle:e.attrs.hardBreakStyle}})),r.list&&(t.list=sU(`list`,e=>({ordered:e.attrs.ordered??!1,start:e.attrs.ordered?e.attrs.start??1:null,spread:e.attrs.spread??!1,data:{bulletMarker:e.attrs.bulletMarker,listMarkerDelimiter:e.attrs.listMarkerDelimiter}}))),r.listItem&&(t.listItem=(e,t,n)=>{let r=n.all(e),i=r.length>1&&G8(r[0])?r.slice(1):r;return{type:`listItem`,checked:e.attrs.checked??null,spread:e.attrs.spread??!1,children:i}}),r.table&&(t.table=(e,t,n)=>{let r=n.all(e),i=[],a=e.firstChild;a&&a.forEach(e=>{let t=e.attrs.align;i.push(t===`left`||t===`right`||t===`center`?t:null)});let o=r.filter(e=>e.type===`tableRow`),s=e.attrs.sourceDashCounts,c=Array.isArray(s)&&s.length>0?{sourceDashCounts:s}:void 0,l={type:`table`,align:i,children:o};return c&&(l.data=c),l}),r.tableRow&&(t.tableRow=sU(`tableRow`));let a=e=>{let t=e.attrs.sourcePadding,n={};return typeof t==`object`&&t&&typeof t.left==`number`&&typeof t.right==`number`&&(n.sourcePadding=t),Object.keys(n).length>0?{data:n}:{}};if(r.tableCell&&(t.tableCell=sU(`tableCell`,a)),r.tableHeader&&(t.tableHeader=sU(`tableCell`,a)),r.image&&(t.image=e=>({type:`image`,url:e.attrs.sourceUrl??e.attrs.src,alt:e.attrs.alt,title:e.attrs.title})),r.imageReference&&(t.imageReference=e=>{let t=e.attrs.label??``,n=e.attrs.identifier??t;return{type:`imageReference`,alt:e.attrs.alt??``,identifier:n,label:t||n,referenceType:e.attrs.referenceType??`shortcut`}}),r.htmlBlock&&(t.htmlBlock=e=>({type:`html`,value:e.attrs.content})),r.linkDefinition??r.linkRefDef){let e=r.linkDefinition?`linkDefinition`:`linkRefDef`;t[e]=e=>{let t={},n=e.attrs.sourceLayout;(n===`multiline`||n===`inline`)&&(t.sourceLayout=n);let r=e.attrs.sourceTitleMarker;(r===`single`||r===`double`||r===`paren`)&&(t.sourceTitleMarker=r);let i={type:`definition`,identifier:e.attrs.identifier??e.attrs.label??``,label:e.attrs.label??e.attrs.identifier??``,url:e.attrs.url??e.attrs.href??``,title:e.attrs.title};return Object.keys(t).length>0&&(i.data=t),i}}if(r.jsxComponent&&(t.jsxComponent=(e,t,n)=>{if(e.attrs.kind===`expression`)return{type:`html`,value:e.attrs.sourceRaw??``};let r=e.attrs.componentName||null,i=Array.isArray(e.attrs.attributes)?e.attrs.attributes:[];return!W8(e)&&e.attrs.sourceRaw?{type:`mdxJsxFlowElement`,name:r,attributes:i,children:[],data:{sourceRaw:String(e.attrs.sourceRaw)}}:V8.getOrWildcard(r??`*`).serialize(e,{all:e=>n.all(e),registry:V8,serializeChildren:()=>{throw Error(`SerializeContext.serializeChildren is not available in the PM→mdast handler. Compat descriptors that need markdown-byte body rendering must emit a marker mdast node and let the to-markdown handler render the body via state.containerFlow.`)}})}),r.rawMdxFallback&&(t.rawMdxFallback=e=>{let t=e.textContent??``,n=typeof e.attrs.reason==`string`?e.attrs.reason:``,r=e.attrs.originalSpan;return{type:`rawMdxFallback`,value:t,data:{reason:n,originalSpan:r&&typeof r==`object`&&`start`in r&&`end`in r?{start:Number(r.start)||0,end:Number(r.end)||0}:{start:0,end:0}}}}),r.jsxInline&&(t.jsxInline=e=>{let t=e.attrs.sourceRaw||e.textContent||``;return{type:`mdxJsxTextElement`,name:null,attributes:[],children:[],data:{sourceRaw:String(t)}}}),r.mathInline&&(t.mathInline=e=>{let t=e.attrs.formula??``,n=e.attrs.id;return typeof n==`string`&&n.length>0?{type:`mdxJsxTextElement`,name:`InlineMath`,attributes:[{type:`mdxJsxAttribute`,name:`formula`,value:t},{type:`mdxJsxAttribute`,name:`id`,value:n}],children:[]}:{type:`inlineMath`,value:t}}),r.wikiLink&&(t.wikiLink=e=>{let t=e.attrs.target??``,n=e.attrs.anchor??null,r=e.attrs.alias??null,i=r||(n?`${t}#${n}`:t);return{type:`wikiLink`,value:i,data:{target:t,anchor:n,alias:r},children:[{type:`text`,value:i}]}}),r.tag&&(t.tag=e=>({type:`tag`,value:String(e.attrs.value??``)})),r.wikiLinkEmbed&&(t.wikiLinkEmbed=e=>{let t=e.attrs.target??``,n=e.attrs.anchor??null,r=e.attrs.alias??null,i=r||(n?`${t}#${n}`:t);return{type:`wikiLinkEmbed`,value:i,data:{target:t,anchor:n,alias:r},children:[{type:`text`,value:i}]}}),i.emphasis&&(n.emphasis=cU(`emphasis`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),i.strong&&(n.strong=cU(`strong`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),i.code&&(n.code=(e,t,n)=>{let r=e.attrs.sourceFenceChar,i=e.attrs.sourceFenceLength;return q8(n,{sourceFenceChar:r,sourceFenceLength:i})}),i.strike??i.delete){let e=i.strike?`strike`:`delete`;n[e]=cU(`delete`)}return i.highlight&&(n.highlight=cU(`mark`)),i.comment&&(n.comment=cU(`comment`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`}}))),r.commentBlock&&(t.commentBlock=sU(`commentBlock`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`,sourceLayout:e.attrs.sourceLayout===`inline`?`inline`:`block`}}))),r.footnoteReference&&(t.footnoteReference=e=>{let t=String(e.attrs.identifier??``);return{type:`footnoteReference`,identifier:t,label:e.attrs.label?String(e.attrs.label):t}}),r.footnoteDefinition&&(t.footnoteDefinition=sU(`footnoteDefinition`,e=>({identifier:String(e.attrs.identifier??``),label:e.attrs.label?String(e.attrs.label):String(e.attrs.identifier??``)}))),i.link&&(n.link=(e,t,n)=>{if(e.attrs.sourceForm===`wikiembed`){let t=typeof e.attrs.target==`string`&&e.attrs.target.length>0?e.attrs.target:e.attrs.href??``,n=typeof e.attrs.anchor==`string`&&e.attrs.anchor.length>0?e.attrs.anchor:null,r=typeof e.attrs.alias==`string`&&e.attrs.alias.length>0?e.attrs.alias:null,i=r||(n?`${t}#${n}`:t);return{type:`wikiLinkEmbed`,value:i,data:{target:t,anchor:n,alias:r},children:[{type:`text`,value:i}]}}let r=e.attrs.linkStyle;if(r===`autolink`)return{type:`link`,url:e.attrs.href??``,title:null,children:n,data:{sourceStyle:`autolink`}};if(r===`gfm-autolink`)return{type:`link`,url:e.attrs.href??``,title:null,children:n,data:{sourceStyle:`gfm-autolink`}};if(r===`inline`||!r){let t={};e.attrs.sourceUrlForm===`angle-bracketed`&&(t.sourceUrlForm=`angle-bracketed`);let r=e.attrs.sourceTitleMarker;return(r===`single`||r===`double`||r===`paren`)&&(t.sourceTitleMarker=r),{type:`link`,url:e.attrs.href??``,title:e.attrs.title??null,children:n,...Object.keys(t).length>0?{data:t}:{}}}return{type:`linkReference`,identifier:(e.attrs.refLabel??``).toLowerCase(),label:e.attrs.refLabel,referenceType:r,children:n}}),i.escapeMark&&(n.escapeMark=(e,t,n)=>{for(let e of n)if(e.type===`text`&&e.value){let t=e;t.data=t.data??{},t.data.escapedChars=t.data.escapedChars??[];for(let e=0;e<t.value.length;e++)t.data.escapedChars.push({offset:e,char:t.value[e]})}return n.length===1?n[0]:n}),i.sourceLiteral&&(n.sourceLiteral=(e,t,n)=>{let r=typeof e.attrs.sourceRaw==`string`?e.attrs.sourceRaw:``;if(n.length===1&&n[0]?.type===`text`){let e=n[0],t=r||e.value;return j1(t,e.value)&&(e.data=e.data??{},e.data.sourceRaw=t),e}return{type:`text`,value:n.filter(e=>e.type===`text`).map(e=>e.value??``).join(``)||r}}),{nodeHandlers:t,markHandlers:n}}var Q8=/\p{M}+/gu,$8=/[^\p{L}\p{N}]+/gu,e5=/^-+|-+$/g;function t5(e){return e.trim().normalize(`NFKD`).replace(Q8,``).toLowerCase().replace($8,`-`).replace(e5,``)}function n5(e,t){let n=t.get(e)??0;return t.set(e,n+1),n===0?e:`${e}-${n}`}function r5(e,t){let n=t5(e);return n?n5(n,t):``}function i5(e,t){let n=t5(e);return t?`#${n}-${t5(t)}`:`#${n}`}var a5=new Set([`img`,`video`,`audio`,`mark`]);function o5(e){let t=e.name;if(!t||!a5.has(t))return null;let n={};for(let t of e.attributes){if(t.type!==`mdxJsxAttribute`)return null;let e=t.name.toLowerCase();if(!(e.length>=3&&e.startsWith(`on`)))if(t.value===null)n[t.name]=!0;else if(typeof t.value==`string`)n[t.name]=t.value;else return null}return{type:`element`,tagName:t,properties:n,children:[]}}var Yne=(e,t)=>{let n=t,{target:r,anchor:i,alias:a}=n.data,o={type:`element`,tagName:`a`,properties:{className:[`wiki-link`],dataTarget:r,dataAnchor:i??``,dataAlias:a??``,href:i5(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},Xne=(e,t)=>{let n=t,{target:r,anchor:i,alias:a}=n.data,o={type:`element`,tagName:`a`,properties:{className:[`wiki-embed`],dataTarget:r,dataAnchor:i??``,dataAlias:a??``,href:i5(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},Zne=(e,t)=>{let n=t,r=o5(n);if(r)return n.children.length>0&&(r.children=e.all(n)),e.patch(t,r),e.applyData(t,r);let i={type:`element`,tagName:`pre`,properties:{className:[`mdx-component`]},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:``}]}]};return e.patch(t,i),e.applyData(t,i)},Qne=(e,t)=>{let n=t,r=o5(n);if(r)return n.children.length>0&&(r.children=e.all(n)),e.patch(t,r),e.applyData(t,r);let i={type:`element`,tagName:`span`,properties:{className:[`mdx-inline`],dataJsxInline:``},children:[{type:`text`,value:typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:``}]};return e.patch(t,i),e.applyData(t,i)},$ne=(e,t)=>{let n=t,r=n.data.reason||`unknown`,i=n.value||``,a=r.replace(/--/g,`—`),o={type:`comment`,value:` Parse error: ${a} `},s={type:`element`,tagName:`pre`,properties:{className:[`mdx-fallback`],dataRawMdxFallback:``,dataReason:a},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:i}]}]};return e.patch(t,s),[o,e.applyData(t,s)]},ere=(e,t)=>{let n={type:`element`,tagName:`mark`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)};function s5(e){if(typeof e!=`object`||!e)return``;let t=e;return typeof t.value==`string`?t.value:Array.isArray(t.children)?t.children.map(s5).join(``):``}var c5={wikiLink:Yne,wikiLinkEmbed:Xne,mdxJsxFlowElement:Zne,mdxJsxTextElement:Qne,rawMdxFallback:$ne,mark:ere,tag:(e,t)=>{let n=t.value,r={type:`element`,tagName:`a`,properties:{className:[`tag`],dataTag:n,href:`#tag/${n}`},children:[{type:`text`,value:`#${n}`}]};return e.patch(t,r),e.applyData(t,r)},comment:(e,t)=>{let n={type:`comment`,value:s5(t).replace(/--/g,`—`)};return e.patch(t,n),e.applyData(t,n)},commentBlock:(e,t)=>{let n={type:`comment`,value:s5(t).replace(/--/g,`—`)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:(e,t)=>{let n=t.identifier,r={type:`element`,tagName:`sup`,properties:{id:`fnref-${n}`,dataFootnoteRef:``,dataFootnoteId:n,className:[`footnote-ref`]},children:[{type:`element`,tagName:`a`,properties:{href:`#fn-${n}`,className:[`footnote-ref-link`]},children:[{type:`text`,value:`[${n}]`}]}]};return e.patch(t,r),e.applyData(t,r)},footnoteDefinition:(e,t)=>{let n=t.identifier,r={type:`element`,tagName:`aside`,properties:{id:`fn-${n}`,dataFootnoteDef:``,dataFootnoteId:n,className:[`footnote-def`]},children:[{type:`element`,tagName:`div`,properties:{className:[`footnote-body`]},children:e.all(t)},{type:`element`,tagName:`a`,properties:{href:`#fnref-${n}`,className:[`footnote-backref`],ariaLabel:`Back to reference`},children:[{type:`text`,value:`↩`}]}]};return e.patch(t,r),e.applyData(t,r)}},tre=/url\s*\(\s*['"]?\s*(?:javascript|vbscript|data)\s*:/i,nre=/\bexpression\s*\(/i,rre=1e4;function ire(e){return!(e.length>rre||tre.test(e)||nre.test(e))}function l5(e){for(let t of e.split(`,`)){let e=t.trim();if(e!==``&&!i1(e.split(/\s+/)[0]??``))return!1}return!0}var u5=()=>e=>{VP(e,`element`,e=>{let t=e.tagName.toLowerCase(),n=e.properties;if(!n)return;if(t===`a`||t===`area`||t===`link`||t===`base`){let e=n.href;typeof e==`string`&&!i1(e)&&delete n.href}if(t===`img`||t===`iframe`||t===`script`||t===`embed`||t===`source`||t===`audio`||t===`video`||t===`track`){let e=n.src;typeof e==`string`&&!i1(e)&&delete n.src}if(t===`form`){let e=n.action;typeof e==`string`&&!i1(e)&&delete n.action}if(t===`img`||t===`source`){let e=n.srcSet;typeof e==`string`&&!l5(e)&&delete n.srcSet;let t=n.srcset;typeof t==`string`&&!l5(t)&&delete n.srcset}if(t===`video`){let e=n.poster;typeof e==`string`&&!i1(e)&&delete n.poster}let r=n.style;typeof r==`string`&&!ire(r)&&delete n.style})};function are(e){let t=MH().use(nJ,{handlers:c5}).use(u5).use(hq),n=t.runSync(e);return String(t.stringify(n))}function ore(e){let t=MH().use(AW).use(kU,[`yaml`]).use(X6).use(CH).use(x8).use(nJ,{handlers:c5}).use(u5).use(hq);return String(t.processSync(e))}_K(),AG(),jG(),P({docName:r0,summary:a0,content:j().optional(),...i0}).loose(),P({docName:r0,summary:a0,markdown:j().min(1),position:to([`append`,`prepend`,`replace`]).optional(),...i0}).loose(),P({docName:r0,summary:a0,find:j().min(1),replace:j(),offset:M().int().nonnegative().optional(),...i0}).loose(),P({docName:r0,connectionId:j().min(1),scope:to([`last`,`session`,`file`]).optional(),...i0}).loose();var d5=P({value:j(),truncatedFrom:M().int().nonnegative().optional(),hint:j().optional()}).loose(),sre=P({type:F(`orphan`),parentCandidates:N(j()),message:j()}).loose();P({timestamp:j().min(1),summary:d5.optional()}).loose(),P({timestamp:j().min(1),subscriberCount:M().int().nonnegative(),systemSubscriberCount:M().int().nonnegative(),hints:N(sre).optional(),summary:d5.optional()}).loose(),P({timestamp:j().min(1),subscriberCount:M().int().nonnegative(),systemSubscriberCount:M().int().nonnegative(),summary:d5.optional()}).loose(),P({docName:j().min(1),scope:to([`last`,`session`]),undone:Ba()}).loose(),P({docName:r0,patch:$a(j(),Za([KZ,Ha()])),types:$a(j(),to(GZ)).optional(),summary:a0,...i0}).loose(),P({timestamp:j().min(1),subscriberCount:M().int().nonnegative(),systemSubscriberCount:M().int().nonnegative(),appliedKeys:N(j()),summary:d5.optional()}).loose();var cre=P({status:j().min(1),reason:j()}).loose();P({docName:j().min(1),content:j(),lifecycle:cre.nullable()}).loose();var lre=P({documents:N(P({kind:to([`document`,`asset`,`folder`]).default(`document`),docName:j().min(1).optional(),docExt:j().min(1).default(`.md`),size:M().int().nonnegative(),modified:j().min(1),isSymlink:Ba().default(!1),canonicalDocName:j().nullable().default(null),targetPath:j().nullable().default(null),path:j().min(1).optional(),assetExt:j().min(1).optional(),mediaKind:to([`image`,`video`,`audio`,`pdf`,`text`]).nullable().optional(),referencedBy:N(j().min(1)).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.kind===`folder`?e.docName===void 0&&e.path!==void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0:e.path!==void 0&&e.assetExt!==void 0&&e.referencedBy!==void 0,{message:`document/asset/folder kind must match its required fields (document → docName; asset → path+assetExt+referencedBy; folder → path only, no docName)`}))}).loose(),ure=P({source:j().min(1),anchor:j().nullable(),title:j(),snippet:j().nullable()}).loose(),dre=P({docName:j().min(1),backlinks:N(ure)}).loose();P({counts:$a(j().min(1),M().int().nonnegative())}).loose();var fre=Qa(`kind`,[P({kind:F(`doc`),docName:j().min(1),anchor:j().nullable(),title:j(),snippet:j().nullable()}).loose(),P({kind:F(`external`),url:j().min(1),title:j(),snippet:j().nullable()}).loose()]),pre=P({docName:j().min(1),forwardLinks:N(fre)}).loose(),mre=Qa(`kind`,[P({id:j().min(1),kind:F(`doc`),docName:j().min(1),anchor:j().nullable(),label:j(),cluster:j().nullable(),category:j().nullable(),tags:N(j()).nullable()}).loose(),P({id:j().min(1),kind:F(`external`),url:j().min(1),label:j()}).loose()]),hre=P({source:j().min(1),target:j().min(1)}).loose(),gre=P({nodes:N(mre),links:N(hre)}).loose();P({writers:N(P({id:j().min(1),name:j().optional(),email:j().optional()}).loose()).optional(),...i0}).loose(),P({checkpointRef:j().min(1)}).loose();var _re=P({v:M().int().optional(),id:j().min(1),name:j().min(1),colorSeed:j().optional(),docs:N(j()),summaries:N(j()).optional()}).loose();P({entries:N(P({sha:j().min(1),timestamp:j().min(1),author:j(),authorEmail:j(),type:to([`checkpoint`,`wip`,`upstream`,`park`]),message:j(),contributors:N(_re),checkpoint:Wa().nullable()}).loose()),total:M().int().nonnegative().optional(),truncated:Ba().optional()}).loose(),P({sha:j().regex(/^[0-9a-f]{40}$/i),content:j(),timestamp:j(),author:j()}).loose(),P({lines:N(P({type:to([`added`,`removed`,`unchanged`]),text:j()}).loose()),additions:M().int().nonnegative(),deletions:M().int().nonnegative()}).loose();var vre=P({contentDir:j().min(1),pathSeparator:to([`/`,`\\`]),symlinkResolved:Ba()}).loose();N(Qa(`source`,[P({docName:j().min(1),timestamp:j().min(1),size:M().int().nonnegative(),source:F(`flat`)}).loose(),P({docName:j().min(1),timestamp:j().min(1),source:F(`timeline`),sha:j().min(1)}).loose()])).meta({description:"Flat array of rescue buffer entries; discriminated via `source`."});var yre=P({orphans:N(P({docName:j().min(1),title:j()}).loose())}).loose(),bre=P({hubs:N(P({docName:j().min(1),title:j(),count:M().int().nonnegative()}).loose())}).loose(),xre=P({source:j().min(1),title:j(),snippet:j().nullable()}).loose();P({deadLinks:N(P({target:j().min(1),sources:N(xre)}).loose())}).loose(),P({target:P({docName:j().min(1),title:j(),aliases:N(j())}).loose(),mentions:N(P({source:j().min(1),excerpt:j(),offset:M().int().nonnegative()}).loose()),truncated:Ba()}).loose(),P({dir:j().min(1)}).loose(),P({port:M().int().positive()}).loose(),P({host:j().min(1).optional()}).loose(),P({pat:j().min(1),host:j().min(1).optional()}).loose(),P({name:j().refine(e=>e.trim().length>0,{message:`name must be non-empty`}),email:j().refine(e=>e.trim().length>0,{message:`email must be non-empty`})}).loose(),P({identity:P({name:j().min(1),email:j().min(1)}).loose().nullable()}).loose(),P({authenticated:Ba()}).loose(),P({type:F(`complete`).optional(),login:j().min(1).optional()}).loose(),P({}).loose();var Sre=P({stackIndex:M().int().min(0),ts:M().int().min(0),additions:M().int().min(0),deletions:M().int().min(0)}).loose(),Cre=P({docName:j().min(1),additionsTotal:M().int().min(0),deletionsTotal:M().int().min(0),lastTs:M().int().min(0),bursts:N(Sre)}).loose(),wre=P({displayName:j().min(1),color:j().min(1),icon:j().optional(),connectionId:j().min(1)}).loose(),Tre=P({sessionAlive:Ba(),agent:wre.nullable(),files:N(Cre)}).loose(),Ere=P({diff:j(),generatedAt:M().int().min(0)}).loose();P({}).loose(),P({}).loose(),P({}).loose(),P({}).loose(),P({}).loose();var Dre=P({displayName:j().min(1),icon:j(),color:j().min(1),currentDoc:j().nullable(),mode:to([`idle`,`writing`]),ts:M().int().min(0)}).loose();P({presence:$a(j().min(1),Dre)}).loose(),$a(j().min(1),Ba()).meta({description:`Flat boolean record keyed by agent-scheme name (claude / codex / cursor). True = installed.`}),P({path:j().min(1,`path must be non-empty`)}).loose(),P({}).loose();var f5=P({fromDocName:j().min(1),toDocName:j().min(1)}).loose();P({}).loose(),P({path:j().min(1),...i0,summary:a0}).loose();var Ore=P({docName:j().min(1)}).loose();P({path:j().min(1),...i0,summary:a0}).loose();var kre=P({path:j().min(1)}).loose();P({kind:to([`file`,`folder`]),path:j().min(1),...i0,summary:a0}).loose();var Are=P({kind:to([`file`,`folder`]),path:j().min(1),duplicatedDocNames:N(j().min(1))}).loose(),jre=P({pages:N(P({docName:j().min(1),title:j(),docExt:j().min(1),size:M().int().nonnegative(),modified:j().min(1)}).loose())}).loose(),Mre=P({level:M().int().min(1).max(6),text:j(),slug:j()}).loose(),Nre=P({docName:j().min(1),headings:N(Mre)}).loose();P({docName:j().min(1),newDocName:j().min(1),summary:a0,...i0}).loose();var p5=P({docName:j().min(1),rewrites:M().int().nonnegative()}).loose();P({renamed:N(f5),rewrittenDocs:N(p5),summary:d5.optional()}).loose(),P({kind:to([`file`,`folder`]),fromPath:j().min(1),toPath:j().min(1),...i0,summary:a0}).loose();var Pre=P({renamed:N(f5),rewrittenDocs:N(p5).optional(),summary:d5.optional()}).loose();P({kind:to([`file`,`folder`]),path:j().min(1),...i0}).loose();var Fre=P({deletedDocNames:N(j().min(1))}).loose();P({kind:to([`file`,`folder`]),path:j().min(1),...i0,summary:a0}).loose();var Ire=P({deletedDocNames:N(j().min(1))}).loose();P({docName:j().min(1),commitSha:j().regex(/^[0-9a-f]{40}$/i,{message:`commitSha must be a 40-char git SHA`}),summary:a0,...i0}).loose(),P({restoredFrom:j().min(1),timestamp:j().min(1),summary:d5.optional()}).loose();var Lre=to([`dormant`,`idle`,`fetching`,`pulling`,`pushing`,`conflict`,`offline`,`auth-error`,`disabled`]),Rre=P({label:j().min(1),webUrl:ba().nullable()}).loose();P({state:Lre,lastSyncUtc:j().nullable(),lastFetchUtc:j().nullable(),lastPushedSha:j().nullable(),ahead:M().int().min(0),behind:M().int().min(0),consecutiveFailures:M().int().min(0),conflictCount:M().int().min(0),hasRemote:Ba(),syncEnabled:Ba(),identityUnresolved:Ba(),remote:Rre.nullable().optional(),error:j().optional(),pausedReason:j().optional()}).loose(),P({op:to([`sync`,`push`,`pull`]).optional()}).loose(),P({op:to([`sync`,`push`,`pull`])}).loose(),P({conflicts:N(P({file:j().min(1),detectedAt:j().min(1),oursSha:j().optional(),theirsSha:j().optional(),baseSha:j().optional()}).loose())}).loose(),P({file:j().min(1),strategy:to([`mine`,`theirs`,`content`]),content:j().optional()}).loose().refine(e=>e.strategy!==`content`||e.content!==void 0,{message:`content is required when strategy is 'content'`,path:[`content`]}),P({}).loose(),P({file:j().min(1),base:j(),ours:j(),theirs:j(),lifecycleStatus:j().nullable()}).loose(),P({}).loose(),P({plan:To(e=>e!==void 0,{message:`plan is required`})}).loose(),P({plan:To(e=>e!==void 0,{message:`plan is required`})}).loose(),P({result:To(e=>e!==void 0,{message:`result is required`})}).loose();var zre=P({path:j().min(1),summary:j().min(1)}).loose(),Bre=P({files:M().int().nonnegative(),folders:M().int().nonnegative()}).loose();P({packs:N(P({id:j().min(1),name:j().min(1),description:j().min(1),defaultSubfolder:j().optional(),folders:N(zre),entryCounts:Bre}).loose())}).loose(),P({noOpen:Ba().optional(),out:j().min(1).optional()}).loose();var Vre=P({reason:to([`unsupported-platform`,`spawn-error`]),message:j()}).loose();Qa(`status`,[P({status:F(`installed`),outputPath:j(),size:M().int().nonnegative(),sha256:j(),skillVersion:j()}).loose(),P({status:F(`built`),outputPath:j(),size:M().int().nonnegative(),sha256:j(),skillVersion:j(),handoffError:Vre.optional()}).loose(),P({status:F(`failed`),buildError:j()}).loose(),P({status:F(`skip-current`),skillVersion:j(),recordedAt:j().optional()}).loose()]),P({tags:N(P({name:j().min(1),count:M().int().nonnegative(),isLeaf:Ba()}).loose())}).loose();var Hre=P({docName:j().min(1),title:j(),matchingTags:N(j().min(1)),snippet:j().nullable()}).loose();P({name:j().min(1),docs:N(Hre)}).loose(),P({folder:Wa(),frontmatter_local:$a(j(),Wa()).nullable()}).loose(),P({path:j(),frontmatter:$a(j(),Wa()).optional()}).loose(),P({applied:Wa()}).loose();var m5=$a(j(),Wa()).meta({description:`Free-form frontmatter map embedded in template payloads.`});P({template:P({name:j().min(1),folder:j(),scope:to([`local`,`inherited`]),path:j().min(1),frontmatter:m5,body:j()}).strict()}).strict(),P({folder:j(),name:j(),body:j().optional(),frontmatter:m5.optional()}).strict(),P({path:j().min(1),created:Ba(),warnings:N(j())}).strict(),P({existed:Ba(),path:j().min(1)}).strict(),P({query:j().optional(),intent:to([`autocomplete`,`full_text`,`omnibar`]).optional(),scopes:N(to([`page`,`folder`,`content`])).optional(),scope:j().optional(),limit:M().int().nonnegative().optional()}).loose();var Ure=P({kind:to([`page`,`folder`,`content`]),path:j().min(1),title:j(),score:M(),signals:$a(j(),Wa()),snippet:j().optional()}).loose();P({query:j(),intent:to([`autocomplete`,`full_text`,`omnibar`]),results:N(Ure),elapsedMs:M().nonnegative()}).loose();var Wre=P({version:j().min(1),recordedAt:j().min(1)}).loose();P({currentVersion:j().min(1),targets:$a(j(),Wre.nullable())}).loose();var Gre=`server-info`,Kre=`branch-switched`,qre=`disk-ack`,Jre=`config-validation-rejected`,Yre=`config-ignore-nested-error`,h5=to([`files`,`backlinks`,`graph`,`sync-status`,`session-activity`,`tags`]),Xre=P({v:F(1),ch:F(Gre),seq:M(),serverInstanceId:j().min(1),currentBranch:j().min(1).optional()}).loose(),Zre=P({v:F(1),ch:F(Kre),seq:M(),branch:j().min(1)}).loose(),Qre=P({v:F(1),ch:h5,seq:M()}).loose(),$re=P({v:F(1),ch:F(qre),seq:M(),docName:j().min(1),sv:j().min(1)}).loose(),eie=P({v:F(1),ch:F(Jre),seq:M(),docName:j().min(1),error:t$}).loose(),tie=P({v:F(1),ch:F(Yre),seq:M(),path:j().min(1),error:j().min(1)}).loose(),nie={id:`string`,kind:`enum`,path:`string`,title:`string`,name:`string`,pathSegments:`string`,content:`string`,modifiedTs:`number`},g5=new WeakMap;function rie(e){return e===void 0||!Number.isFinite(e)?20:Math.max(1,Math.min(100,Math.trunc(e)))}function _5(e){return e.trim().toLowerCase()}function v5(e){let t=e.split(`/`).filter(Boolean);return t[t.length-1]??e}function iie(e){return e.split(`/`).filter(Boolean).join(` `)}function aie(e){let t=v5(e.path),n=e.title?.trim()||t,r=e.modifiedTs??0;return{id:`${e.kind}:${e.path}`,kind:e.kind,path:e.path,title:n,name:t,pathSegments:iie(e.path),content:e.content??``,modifiedTs:Number.isFinite(r)?r:0}}function y5(e){let t=QX({schema:nie});return e.length>0&&lZ(t,e),t}function oie(e){let t={documents:e};return g5.set(t,y5(e)),t}function sie(e){let t=g5.get(e);if(t)return t;let n=y5(e.documents);return g5.set(e,n),n}function cie(e){return e===`autocomplete`?[`page`]:e===`full_text`?[`page`,`content`]:[`page`,`folder`]}function b5(e,t){return t.has(e.kind)?!0:e.kind===`page`&&t.has(`content`)}function x5(e,t){let n=_5(t);if(!n)return 0;let r=_5(e.title),i=_5(e.name),a=_5(e.path),o=a.split(`/`);return r===n||i===n?700:a===n?650:r.startsWith(n)||i.startsWith(n)?600:o.some(e=>e.startsWith(n))?550:r.includes(n)||i.includes(n)?500:a.includes(n)?450:-1}function lie(e){let t=e.map(e=>e.modifiedTs).filter(e=>Number.isFinite(e)&&e>0);if(t.length===0)return new Map;let n=1/0,r=-1/0;for(let e of t)e<n&&(n=e),e>r&&(r=e);let i=Math.max(1,r-n);return new Map(e.map(e=>[e.id,e.modifiedTs>0?(e.modifiedTs-n)/i*50:0]))}function uie(e){return e===`full_text`?[`title`,`name`,`path`,`pathSegments`,`content`]:[`title`,`name`,`path`,`pathSegments`]}function die(e){return e===`full_text`?{title:8,name:7,path:5,pathSegments:4,content:1}:e===`autocomplete`?{title:10,name:9,path:5,pathSegments:4}:{title:8,name:7,path:5,pathSegments:4}}function fie(e,t){return _5(t).length<4?0:+(e===`full_text`)}function pie(e,t,n={}){let r=n.intent??`omnibar`,i=rie(n.limit),a=new Set(n.scopes??cie(r)),o=e.documents.filter(e=>b5(e,a)),s=_5(t);if(!s)return o.slice().sort((e,t)=>e.path.localeCompare(t.path)).slice(0,i).map(e=>({document:e,score:0,signals:{lexical:0,fullText:0,recency:0}}));let c=RZ(sie(e),{term:s,properties:uie(r),boost:die(r),tolerance:fie(r,s),limit:Math.max(i*4,40)}),l=new Map(c.hits.filter(e=>b5(e.document,a)).map(e=>[e.document.id,e.score])),u=lie(o),d=new Map;for(let e of o)x5(e,s)>=0&&d.set(e.id,e);for(let e of c.hits)b5(e.document,a)&&d.set(e.document.id,e.document);return[...d.values()].map(e=>{let t=Math.max(0,x5(e,s)),n=l.get(e.id)??0,r=u.get(e.id)??0;return{document:e,score:t+n*20+r,signals:{lexical:t,fullText:n,recency:r}}}).sort((e,t)=>e.score===t.score?e.document.path.localeCompare(t.document.path):t.score-e.score).slice(0,i)}var S5=Symbol.for(`@inkeep/open-knowledge/skill-state-field-registry`),C5=globalThis;C5[S5]===void 0&&(C5[S5]=Lr());var w5=C5[S5],T5=Ya({version:j().regex(/^\d+\.\d+\.\d+(?:[-+][\w.-]+)?$/,`version must match /^\\d+\\.\\d+\\.\\d+(?:[-+][\\w.-]+)?$/`).register(w5,{description:`Recorded skill version for this target.`}),recordedAt:Ji().register(w5,{description:`ISO 8601 timestamp of the most recent successful write. Updated on every write, including reinstalls of the same version.`}),surface:to([`server-build-and-open`,`electron-build-and-open`,`cli-npx-skills-add`,`desktop-direct`]).register(w5,{description:`Install-source surface that recorded this entry.`}).optional()});Ya({schema:F(1).register(w5,{description:`Schema major version. Bumped only on breaking shape changes.`}),targets:Ya({"claude-cowork":T5.optional(),"cli-hosts":T5.optional()}).register(w5,{description:`Per-target install-state entries. Absent target = no recorded install.`}).default({})});var E5=class extends Error{chunksCompleted;totalChunks;bytesWritten;bytesRemaining;cause;constructor(e,t){let n=e instanceof Error?e.message:typeof e==`string`?e:`unknown error`;super(`chunked insert failed after ${t.chunksCompleted}/${t.totalChunks} chunks (${t.bytesWritten} bytes written, ${t.bytesRemaining} bytes lost): ${n}`),this.name=`ChunkedInsertError`,this.chunksCompleted=t.chunksCompleted,this.totalChunks=t.totalChunks,this.bytesWritten=t.bytesWritten,this.bytesRemaining=t.bytesRemaining,this.cause=e}};async function mie(e,t,n,r,i={}){let a=i.thresholdBytes??512e3,o=i.chunkSizeBytes??51200,s=i.origin,c=i.yieldFn??hie,l=i.resolveOffset??(e=>e);if(r.length<=a){e.transact(()=>{t.insert(n,r)},s);return}let u=Math.ceil(r.length/o),d=0,f=n,p=0,m=0;for(;d<r.length;){let n=Math.min(d+o,r.length),i=r.slice(d,n);try{let n=l(f);e.transact(()=>{t.insert(n,i)},s)}catch(e){throw new E5(e,{chunksCompleted:p,totalChunks:u,bytesWritten:m,bytesRemaining:r.length-d})}p++,m+=i.length,f+=i.length,d=n,d<r.length&&await c()}}function hie(){return new Promise(e=>{let t=globalThis;t.document?.hidden!==!0&&typeof t.requestAnimationFrame==`function`?t.requestAnimationFrame(()=>e()):setTimeout(()=>e(),0)})}function gie(){let e=!1,t=``,n=0;return r=>{let i=_ie(r);return e?(i&&i.char===t&&i.len>=n&&!i.hasInfo&&(e=!1,t=``,n=0),!0):i?(e=!0,t=i.char,n=i.len,!0):!1}}function _ie(e){let t=(e.endsWith(`\r`)?e.slice(0,-1):e).match(/^ {0,3}([`~])(\1{2,})(.*)$/);return t?{char:t[1],len:1+t[2].length,hasInfo:t[3].trim()!==``}:null}var vie=[`#D97757`,`#1B1912`,`#F9F3E9`,`#7A9DFF`,`#8534F3`,`#9663F0`,`#727CF3`],yie={claude:`#D97757`,cursor:`#1B1912`,windsurf:`#0B100F`,openai:`#7A9DFF`,github:`#8534F3`,cline:`#9663F0`,bot:`#727CF3`},bie={cursor:`#FFFFFF`,windsurf:`#FFFFFF`},D5=[`#f0ece3`,`#fff5e1`,`#f9e1db`,`#f5def7`,`#ece2fb`,`#dce8fa`,`#DBF3FB`];function xie(e,t=vie){let n=0;for(let t of e)n=(n<<5)-n+t.charCodeAt(0)|0;return t[Math.abs(n)%t.length]}function Sie(e){let t=e.trim();if(!t)return`?`;let n=t.split(/[-\s]+/).filter(Boolean);if(!n.length)return`?`;if(n.length>=2)return n.slice(0,2).map(e=>e[0]??``).join(``).toUpperCase();let r=n[0],i=[r[0]];for(let e=1;e<r.length&&i.length<2;e++){let t=r[e-1],n=r[e];t===t.toLowerCase()&&n===n.toUpperCase()&&n!==n.toLowerCase()&&i.push(n)}return i.length>=2?i.join(``).toUpperCase():r.slice(0,2).toUpperCase()}function Cie(e){let t=e.trim();if(!t)return e;if(t.includes(` `)||!/[-_]/.test(t))return t;let n=t.split(/[-_]+/).filter(Boolean);return n.length?n.map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(` `):t}var wie={"claude-code":`claude`,"claude-ai":`claude`,cursor:`cursor`,"cursor-vscode":`cursor`,cascade:`windsurf`,codex:`openai`,"codex-mcp-client":`openai`,copilot:`github`,cline:`cline`};function Tie(e){return e?wie[e]||(e.startsWith(`local-agent-mode-`)?`claude`:`bot`):`bot`}function Eie(e){let t=parseInt(e.slice(1,3),16)/255,n=parseInt(e.slice(3,5),16)/255,r=parseInt(e.slice(5,7),16)/255,i=Math.max(t,n,r),a=Math.min(t,n,r),o=(i+a)/2;if(i===a)return[0,0,o*100];let s=i-a,c=o>.5?s/(2-i-a):s/(i+a),l;return l=i===t?((n-r)/s+(n<r?6:0))/6:i===n?((r-t)/s+2)/6:((t-n)/s+4)/6,[l*360,c*100,o*100]}function Die(e,t,n){let r=t/100,i=n/100,a=r*Math.min(i,1-i),o=t=>{let n=(t+e/30)%12,r=i-a*Math.max(Math.min(n-3,9-n,1),-1);return Math.round(255*r).toString(16).padStart(2,`0`)};return`#${o(0)}${o(8)}${o(4)}`}function Oie(e){let[t]=Eie(e);return Die(t,45,32)}var kie=[`Curious`,`Brave`,`Clever`,`Swift`,`Gentle`,`Bright`,`Wise`,`Bold`,`Calm`,`Keen`],Aie=[`Bird`,`Cat`,`Dog`,`Fish`,`Mouse`,`Rabbit`,`Shrimp`,`Snail`,`Squirrel`,`Turtle`],O5=`ok-user-name-v3`,k5=`ok-user-color-v3`;function A5(e){return e[Math.floor(Math.random()*e.length)]}function jie(){return`${A5(kie)} ${A5(Aie)}`}function Mie(){return A5(D5)}function j5(e){try{return localStorage.getItem(e)}catch{return null}}function M5(e,t){try{localStorage.setItem(e,t)}catch{}}function Nie(){let e=new URLSearchParams(window.location.search).get(`coeditor`)||`standalone`,t=crypto.randomUUID(),n=j5(O5),r=j5(k5);return n||(n=jie(),M5(O5,n)),r||(r=Mie(),M5(k5,r)),{name:n,color:r,coeditor:e,tabId:t}}function Pie(e,t){let n=e.trim();if(!n||/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n)||n.startsWith(`//`)||n.startsWith(`/`)||n.startsWith(`#`))return null;let r=n.indexOf(`#`),i=r>=0?n.slice(0,r):n,a=r>=0?n.slice(r+1):null,o=(i.split(`?`)[0]??``).trim();if(!o)return null;let s=(o.split(`/`).pop()??``).match(/\.([a-z0-9]+)$/i);if(s){let e=(s[1]??``).toLowerCase();if(e!==`md`&&e!==`mdx`)return null}let c=o.toLowerCase(),l=c.endsWith(`.mdx`)?o.slice(0,-4):c.endsWith(`.md`)?o.slice(0,-3):o,u=t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of l.split(`/`))if(e===`..`){if(u.length===0)return null;u.pop()}else e!==`.`&&e!==``&&u.push(e);return u.length===0?null:{docName:u.join(`/`),anchor:a||null}}function Fie(e){throw Error(`Unhandled ClassifiedLinkTarget variant: ${JSON.stringify(e)}`)}var N5=/^[a-zA-Z][a-zA-Z\d+\-.]*:/;function P5(e){let t=(e.split(/[?#]/)[0]??e).match(/\.([a-z0-9]+)$/i);return t?(t[1]??``).toLowerCase():null}function F5(e){return e.split(`/`).filter(Boolean)}function I5(e){let t=e.trim();return N5.test(t)||t.startsWith(`//`)}function Iie(e,t){let n=e.trim();if(!n)return null;if(n.startsWith(`#`)){let e=n.slice(1).trim();return e?{kind:`anchor`,anchor:e}:null}let r=Pie(n,t);if(r)return{kind:`doc`,docName:r.docName,anchor:r.anchor};if(I5(n)||n.startsWith(`/`))return{kind:`external`,url:n};let i=P5(n);return i&&i!==`md`&&i!==`mdx`?{kind:`asset`,url:n,ext:i}:null}function Lie(e,t){let n=e.trim();if(!n)return null;if(I5(n))return{kind:`external`,url:t?`${n}#${t}`:n};let r=P5(n);return r&&r!==`md`&&r!==`mdx`?{kind:`asset`,url:n,ext:r}:{kind:`doc`,docName:n,anchor:t?.trim()||null}}function Rie(e,t){let n=e.trim();if(!n||N5.test(n)||n.startsWith(`//`)||n.startsWith(`#`))return null;let r=n.indexOf(`#`),i=((r>=0?n.slice(0,r):n).split(`?`)[0]??``).trim();if(!i)return null;let a=i.startsWith(`/`),o=a?i.slice(1):i,s=a?[]:t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of o.split(`/`))if(e===`..`){if(s.length===0)return null;s.pop()}else e!==`.`&&e!==``&&s.push(e);return s.length===0?null:s.join(`/`)}function zie(e,t,n=null){let r=F5(e);r.pop();let i=F5(t),a=0;for(;a<r.length&&a<i.length&&r[a]===i[a];)a+=1;let o=r.slice(a).map(()=>`..`),s=i.slice(a),c=[...o,...s].join(`/`);return c||=i.at(-1)??t,!c.startsWith(`./`)&&!c.startsWith(`../`)&&(c=`./${c}`),`${c}.md${n?`#${n}`:``}`}function Bie(e){if(!e)return{height:null,viewerFragment:``};let t=e.split(`&`).filter(e=>e.length>0),n=null,r=[];for(let e of t){let t=e.indexOf(`=`);if(t===-1){r.push(e);continue}let i=e.slice(0,t),a=e.slice(t+1);if(i===`height`){let e=Number.parseInt(a,10);!Number.isNaN(e)&&e>0&&(n=e);continue}r.push(e)}return{height:n,viewerFragment:r.join(`&`)}}function Vie(e){return e.replace(/[/\\:*?"<>|\0]/g,`-`).replace(/\s+/g,` `).replace(/-+/g,`-`).trim().replace(/^[-.\s]+|[-.\s]+$/g,``)}var L5=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),Hie=`VisuallyHidden`,R5=D.forwardRef((e,t)=>(0,Oo.jsx)(h.span,{...e,ref:t,style:{...L5,...e.style}}));R5.displayName=Hie;var Uie=R5;function Wie(e){let t=e+`CollectionProvider`,[n,r]=_(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=D.useRef(null),a=D.useRef(new Map).current;return(0,Oo.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,l=c(s),d=D.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,Oo.jsx)(l,{ref:u(t,a(s,n).collectionRef),children:r})});d.displayName=s;let f=e+`CollectionItemSlot`,p=`data-radix-collection-item`,m=c(f),h=D.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=D.useRef(null),s=u(t,o),c=a(f,n);return D.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,Oo.jsx)(m,{[p]:``,ref:s,children:r})});h.displayName=f;function g(t){let n=a(e+`CollectionConsumer`,t);return D.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${p}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:d,ItemSlot:h},g,r]}var Gie=D.createContext(void 0);function Kie(e){let t=D.useContext(Gie);return e||t||`ltr`}var z5=[`top`,`right`,`bottom`,`left`],B5=[`start`,`end`],V5=z5.reduce((e,t)=>e.concat(t,t+`-`+B5[0],t+`-`+B5[1]),[]),H5=Math.min,U5=Math.max,W5=Math.round,G5=Math.floor,K5=e=>({x:e,y:e}),qie={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function q5(e,t,n){return U5(e,H5(t,n))}function J5(e,t){return typeof e==`function`?e(t):e}function Y5(e){return e.split(`-`)[0]}function X5(e){return e.split(`-`)[1]}function Z5(e){return e===`x`?`y`:`x`}function Q5(e){return e===`y`?`height`:`width`}function $5(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function e7(e){return Z5($5(e))}function t7(e,t,n){n===void 0&&(n=!1);let r=X5(e),i=e7(e),a=Q5(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=a7(o)),[o,a7(o)]}function Jie(e){let t=a7(e);return[n7(e),t,n7(t)]}function n7(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var r7=[`left`,`right`],i7=[`right`,`left`],Yie=[`top`,`bottom`],Xie=[`bottom`,`top`];function Zie(e,t,n){switch(e){case`top`:case`bottom`:return n?t?i7:r7:t?r7:i7;case`left`:case`right`:return t?Yie:Xie;default:return[]}}function Qie(e,t,n,r){let i=X5(e),a=Zie(Y5(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(n7)))),a}function a7(e){let t=Y5(e);return qie[t]+e.slice(t.length)}function $ie(e){return{top:0,right:0,bottom:0,left:0,...e}}function o7(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:$ie(e)}function s7(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function c7(e,t,n){let{reference:r,floating:i}=e,a=$5(t),o=e7(t),s=Q5(o),c=Y5(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(X5(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function eae(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=J5(t,e),p=o7(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=s7(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=s7(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var tae=50,nae=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:eae},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=c7(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<tae&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=c7(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},rae=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=J5(e,t)||{};if(l==null)return{};let d=o7(u),f={x:n,y:r},p=e7(i),m=Q5(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=H5(d[_],T),D=H5(d[v],T),ee=E,te=C-h[m]-D,ne=C/2-h[m]/2+w,re=q5(ee,ne,te),ie=!c.arrow&&X5(i)!=null&&ne!==re&&a.reference[m]/2-(ne<ee?E:D)-h[m]/2<0,O=ie?ne<ee?ne-ee:ne-te:0;return{[p]:f[p]+O,data:{[p]:re,centerOffset:ne-re-O,...ie&&{alignmentOffset:O}},reset:ie}}});function iae(e,t,n){return(e?[...n.filter(t=>X5(t)===e),...n.filter(t=>X5(t)!==e)]:n.filter(e=>Y5(e)===e)).filter(n=>e?X5(n)===e||(t?n7(n)!==n:!1):!0)}var aae=function(e){return e===void 0&&(e={}),{name:`autoPlacement`,options:e,async fn(t){let{rects:n,middlewareData:r,placement:i,platform:a,elements:o}=t,{crossAxis:s=!1,alignment:c,allowedPlacements:l=V5,autoAlignment:u=!0,...d}=J5(e,t),f=c!==void 0||l===V5?iae(c||null,u,l):l,p=await a.detectOverflow(t,d),m=r.autoPlacement?.index||0,h=f[m];if(h==null)return{};let g=t7(h,n,await(a.isRTL==null?void 0:a.isRTL(o.floating)));if(i!==h)return{reset:{placement:f[0]}};let _=[p[Y5(h)],p[g[0]],p[g[1]]],v=[...r.autoPlacement?.overflows||[],{placement:h,overflows:_}],y=f[m+1];if(y)return{data:{index:m+1,overflows:v},reset:{placement:y}};let b=v.map(e=>{let t=X5(e.placement);return[e.placement,t&&s?e.overflows.slice(0,2).reduce((e,t)=>e+t,0):e.overflows[0],e.overflows]}).sort((e,t)=>e[1]-t[1]),x=b.filter(e=>e[2].slice(0,X5(e[0])?2:3).every(e=>e<=0))[0]?.[0]||b[0][0];return x===i?{}:{data:{index:m+1,overflows:v},reset:{placement:x}}}}},oae=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=J5(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Y5(r),_=$5(o),v=Y5(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[a7(o)]:Jie(o)),x=p!==`none`;!d&&x&&b.push(...Qie(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=t7(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==$5(t))||T.every(e=>$5(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=$5(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function l7(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function u7(e){return z5.some(t=>e[t]>=0)}var sae=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=J5(e,t);switch(i){case`referenceHidden`:{let e=l7(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:u7(e)}}}case`escaped`:{let e=l7(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:u7(e)}}}default:return{}}}}};function d7(e){let t=H5(...e.map(e=>e.left)),n=H5(...e.map(e=>e.top)),r=U5(...e.map(e=>e.right)),i=U5(...e.map(e=>e.bottom));return{x:t,y:n,width:r-t,height:i-n}}function cae(e){let t=e.slice().sort((e,t)=>e.y-t.y),n=[],r=null;for(let e=0;e<t.length;e++){let i=t[e];!r||i.y-r.y>r.height/2?n.push([i]):n[n.length-1].push(i),r=i}return n.map(e=>s7(d7(e)))}var lae=function(e){return e===void 0&&(e={}),{name:`inline`,options:e,async fn(t){let{placement:n,elements:r,rects:i,platform:a,strategy:o}=t,{padding:s=2,x:c,y:l}=J5(e,t),u=Array.from(await(a.getClientRects==null?void 0:a.getClientRects(r.reference))||[]),d=cae(u),f=s7(d7(u)),p=o7(s);function m(){if(d.length===2&&d[0].left>d[1].right&&c!=null&&l!=null)return d.find(e=>c>e.left-p.left&&c<e.right+p.right&&l>e.top-p.top&&l<e.bottom+p.bottom)||f;if(d.length>=2){if($5(n)===`y`){let e=d[0],t=d[d.length-1],r=Y5(n)===`top`,i=e.top,a=t.bottom,o=r?e.left:t.left,s=r?e.right:t.right;return{top:i,bottom:a,left:o,right:s,width:s-o,height:a-i,x:o,y:i}}let e=Y5(n)===`left`,t=U5(...d.map(e=>e.right)),r=H5(...d.map(e=>e.left)),i=d.filter(n=>e?n.left===r:n.right===t),a=i[0].top,o=i[i.length-1].bottom,s=r,c=t;return{top:a,bottom:o,left:s,right:c,width:c-s,height:o-a,x:s,y:a}}return f}let h=await a.getElementRects({reference:{getBoundingClientRect:m},floating:r.floating,strategy:o});return i.reference.x!==h.reference.x||i.reference.y!==h.reference.y||i.reference.width!==h.reference.width||i.reference.height!==h.reference.height?{reset:{rects:h}}:{}}}},f7=new Set([`left`,`top`]);async function uae(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Y5(n),s=X5(n),c=$5(n)===`y`,l=f7.has(o)?-1:1,u=a&&c?-1:1,d=J5(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var dae=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await uae(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},fae=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=J5(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=$5(Y5(i)),p=Z5(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=q5(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=q5(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},pae=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=J5(e,t),u={x:n,y:r},d=$5(i),f=Z5(d),p=u[f],m=u[d],h=J5(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=f7.has(Y5(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},mae=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=J5(e,t),u=await o.detectOverflow(t,l),d=Y5(i),f=X5(i),p=$5(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=H5(h-u[g],v),x=H5(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=U5(u.left,0),t=U5(u.right,0),n=U5(u.top,0),r=U5(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:U5(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:U5(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function p7(){return typeof window<`u`}function m7(e){return _7(e)?(e.nodeName||``).toLowerCase():`#document`}function h7(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function g7(e){return((_7(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function _7(e){return p7()?e instanceof Node||e instanceof h7(e).Node:!1}function v7(e){return p7()?e instanceof Element||e instanceof h7(e).Element:!1}function y7(e){return p7()?e instanceof HTMLElement||e instanceof h7(e).HTMLElement:!1}function b7(e){return!p7()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof h7(e).ShadowRoot}function x7(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=O7(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function hae(e){return/^(table|td|th)$/.test(m7(e))}function S7(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var gae=/transform|translate|scale|rotate|perspective|filter/,_ae=/paint|layout|strict|content/,C7=e=>!!e&&e!==`none`,w7;function T7(e){let t=v7(e)?O7(e):e;return C7(t.transform)||C7(t.translate)||C7(t.scale)||C7(t.rotate)||C7(t.perspective)||!E7()&&(C7(t.backdropFilter)||C7(t.filter))||gae.test(t.willChange||``)||_ae.test(t.contain||``)}function vae(e){let t=A7(e);for(;y7(t)&&!D7(t);){if(T7(t))return t;if(S7(t))return null;t=A7(t)}return null}function E7(){return w7??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),w7}function D7(e){return/^(html|body|#document)$/.test(m7(e))}function O7(e){return h7(e).getComputedStyle(e)}function k7(e){return v7(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function A7(e){if(m7(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||b7(e)&&e.host||g7(e);return b7(t)?t.host:t}function j7(e){let t=A7(e);return D7(t)?e.ownerDocument?e.ownerDocument.body:e.body:y7(t)&&x7(t)?t:j7(t)}function M7(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=j7(e),i=r===e.ownerDocument?.body,a=h7(r);if(i){let e=N7(a);return t.concat(a,a.visualViewport||[],x7(r)?r:[],e&&n?M7(e):[])}else return t.concat(r,M7(r,[],n))}function N7(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function P7(e){let t=O7(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=y7(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=W5(n)!==a||W5(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function F7(e){return v7(e)?e:e.contextElement}function I7(e){let t=F7(e);if(!y7(t))return K5(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=P7(t),o=(a?W5(n.width):n.width)/r,s=(a?W5(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var yae=K5(0);function L7(e){let t=h7(e);return!E7()||!t.visualViewport?yae:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function bae(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==h7(e)?!1:t}function R7(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=F7(e),o=K5(1);t&&(r?v7(r)&&(o=I7(r)):o=I7(e));let s=bae(a,n,r)?L7(a):K5(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=h7(a),t=r&&v7(r)?h7(r):r,n=e,i=N7(n);for(;i&&r&&t!==n;){let e=I7(i),t=i.getBoundingClientRect(),r=O7(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=h7(i),i=N7(n)}}return s7({width:u,height:d,x:c,y:l})}function z7(e,t){let n=k7(e).scrollLeft;return t?t.left+n:R7(g7(e)).left+n}function B7(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-z7(e,n),y:n.top+t.scrollTop}}function xae(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=g7(r),s=t?S7(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=K5(1),u=K5(0),d=y7(r);if((d||!d&&!a)&&((m7(r)!==`body`||x7(o))&&(c=k7(r)),d)){let e=R7(r);l=I7(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?B7(o,c):K5(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Sae(e){return Array.from(e.getClientRects())}function Cae(e){let t=g7(e),n=k7(e),r=e.ownerDocument.body,i=U5(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=U5(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+z7(e),s=-n.scrollTop;return O7(r).direction===`rtl`&&(o+=U5(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var V7=25;function wae(e,t){let n=h7(e),r=g7(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=E7();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=z7(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=V7&&(a-=o)}else l<=V7&&(a+=l);return{width:a,height:o,x:s,y:c}}function Tae(e,t){let n=R7(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=y7(e)?I7(e):K5(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function H7(e,t,n){let r;if(t===`viewport`)r=wae(e,n);else if(t===`document`)r=Cae(g7(e));else if(v7(t))r=Tae(t,n);else{let n=L7(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return s7(r)}function U7(e,t){let n=A7(e);return n===t||!v7(n)||D7(n)?!1:O7(n).position===`fixed`||U7(n,t)}function Eae(e,t){let n=t.get(e);if(n)return n;let r=M7(e,[],!1).filter(e=>v7(e)&&m7(e)!==`body`),i=null,a=O7(e).position===`fixed`,o=a?A7(e):e;for(;v7(o)&&!D7(o);){let t=O7(o),n=T7(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||x7(o)&&!n&&U7(e,o))?r=r.filter(e=>e!==o):i=t,o=A7(o)}return t.set(e,r),r}function Dae(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?S7(t)?[]:Eae(t,this._c):[].concat(n),r],o=H7(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=H7(t,a[e],i);s=U5(n.top,s),c=H5(n.right,c),l=H5(n.bottom,l),u=U5(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Oae(e){let{width:t,height:n}=P7(e);return{width:t,height:n}}function kae(e,t,n){let r=y7(t),i=g7(t),a=n===`fixed`,o=R7(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=K5(0);function l(){c.x=z7(i)}if(r||!r&&!a)if((m7(t)!==`body`||x7(i))&&(s=k7(t)),r){let e=R7(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?B7(i,s):K5(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function W7(e){return O7(e).position===`static`}function G7(e,t){if(!y7(e)||O7(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return g7(e)===n&&(n=n.ownerDocument.body),n}function K7(e,t){let n=h7(e);if(S7(e))return n;if(!y7(e)){let t=A7(e);for(;t&&!D7(t);){if(v7(t)&&!W7(t))return t;t=A7(t)}return n}let r=G7(e,t);for(;r&&hae(r)&&W7(r);)r=G7(r,t);return r&&D7(r)&&W7(r)&&!T7(r)?n:r||vae(e)||n}var Aae=async function(e){let t=this.getOffsetParent||K7,n=this.getDimensions,r=await n(e.floating);return{reference:kae(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function jae(e){return O7(e).direction===`rtl`}var Mae={convertOffsetParentRelativeRectToViewportRelativeRect:xae,getDocumentElement:g7,getClippingRect:Dae,getOffsetParent:K7,getElementRects:Aae,getClientRects:Sae,getDimensions:Oae,getScale:I7,isElement:v7,isRTL:jae};function q7(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Nae(e,t){let n=null,r,i=g7(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=G5(d),h=G5(i.clientWidth-(u+f)),g=G5(i.clientHeight-(d+p)),_=G5(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:U5(0,H5(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!q7(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function J7(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=F7(e),u=i||a?[...l?M7(l):[],...t?M7(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Nae(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?R7(e):null;c&&g();function g(){let t=R7(e);h&&!q7(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Y7=dae,Pae=aae,X7=fae,Z7=oae,Q7=mae,$7=sae,e9=rae,Fae=lae,Iae=pae,t9=(e,t,n)=>{let r=new Map,i={platform:Mae,...n},a={...i.platform,_c:r};return nae(e,t,{...i,platform:a})},n9=typeof document<`u`?D.useLayoutEffect:function(){};function r9(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!r9(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!r9(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function i9(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function a9(e,t){let n=i9(e);return Math.round(t*n)/n}function o9(e){let t=D.useRef(e);return n9(()=>{t.current=e}),t}function Lae(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=D.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=D.useState(r);r9(f,r)||p(r);let[m,h]=D.useState(null),[g,_]=D.useState(null),v=D.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=D.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=D.useRef(null),C=D.useRef(null),w=D.useRef(u),T=c!=null,E=o9(c),ee=o9(i),te=o9(l),ne=D.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};ee.current&&(e.platform=ee.current),t9(S.current,C.current,e).then(e=>{let t={...e,isPositioned:te.current!==!1};re.current&&!r9(w.current,t)&&(w.current=t,ko.flushSync(()=>{d(t)}))})},[f,t,n,ee,te]);n9(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let re=D.useRef(!1);n9(()=>(re.current=!0,()=>{re.current=!1}),[]),n9(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,ne);ne()}},[b,x,ne,E,T]);let ie=D.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),O=D.useMemo(()=>({reference:b,floating:x}),[b,x]),ae=D.useMemo(()=>{let e={position:n,left:0,top:0};if(!O.floating)return e;let t=a9(O.floating,u.x),r=a9(O.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...i9(O.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,O.floating,u.x,u.y]);return D.useMemo(()=>({...u,update:ne,refs:ie,elements:O,floatingStyles:ae}),[u,ne,ie,O,ae])}var Rae=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:e9({element:r.current,padding:i}).fn(n):r?e9({element:r,padding:i}).fn(n):{}}}},zae=(e,t)=>{let n=Y7(e);return{name:n.name,fn:n.fn,options:[e,t]}},Bae=(e,t)=>{let n=X7(e);return{name:n.name,fn:n.fn,options:[e,t]}},Vae=(e,t)=>({fn:Iae(e).fn,options:[e,t]}),Hae=(e,t)=>{let n=Z7(e);return{name:n.name,fn:n.fn,options:[e,t]}},Uae=(e,t)=>{let n=Q7(e);return{name:n.name,fn:n.fn,options:[e,t]}},Wae=(e,t)=>{let n=$7(e);return{name:n.name,fn:n.fn,options:[e,t]}},Gae=(e,t)=>{let n=Rae(e);return{name:n.name,fn:n.fn,options:[e,t]}},Kae=`Arrow`,s9=D.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,Oo.jsx)(h.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,Oo.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});s9.displayName=Kae;var qae=s9,c9=`Popper`,[l9,u9]=_(c9),[Jae,d9]=l9(c9),f9=e=>{let{__scopePopper:t,children:n}=e,[r,i]=D.useState(null);return(0,Oo.jsx)(Jae,{scope:t,anchor:r,onAnchorChange:i,children:n})};f9.displayName=c9;var p9=`PopperAnchor`,m9=D.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=d9(p9,n),o=D.useRef(null),s=u(t,o),c=D.useRef(null);return D.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&a.onAnchorChange(c.current)}),r?null:(0,Oo.jsx)(h.div,{...i,ref:s})});m9.displayName=p9;var h9=`PopperContent`,[Yae,Xae]=l9(h9),g9=D.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:d=0,sticky:f=`partial`,hideWhenDetached:p=!1,updatePositionStrategy:m=`optimized`,onPlaced:_,...y}=e,x=d9(h9,n),[S,C]=D.useState(null),w=u(t,e=>C(e)),[T,E]=D.useState(null),ee=v(T),te=ee?.width??0,ne=ee?.height??0,re=r+(a===`center`?``:`-`+a),ie=typeof d==`number`?d:{top:0,right:0,bottom:0,left:0,...d},O=Array.isArray(l)?l:[l],ae=O.length>0,oe={padding:ie,boundary:O.filter(Qae),altBoundary:ae},{refs:se,floatingStyles:ce,placement:le,isPositioned:ue,middlewareData:de}=Lae({strategy:`fixed`,placement:re,whileElementsMounted:(...e)=>J7(...e,{animationFrame:m===`always`}),elements:{reference:x.anchor},middleware:[zae({mainAxis:i+ne,alignmentAxis:o}),c&&Bae({mainAxis:!0,crossAxis:!1,limiter:f===`partial`?Vae():void 0,...oe}),c&&Hae({...oe}),Uae({...oe,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),T&&Gae({element:T,padding:s}),$ae({arrowWidth:te,arrowHeight:ne}),p&&Wae({strategy:`referenceHidden`,...oe})]}),[fe,pe]=y9(le),me=g(_);b(()=>{ue&&me?.()},[ue,me]);let he=de.arrow?.x,ge=de.arrow?.y,_e=de.arrow?.centerOffset!==0,[ve,ye]=D.useState();return b(()=>{S&&ye(window.getComputedStyle(S).zIndex)},[S]),(0,Oo.jsx)(`div`,{ref:se.setFloating,"data-radix-popper-content-wrapper":``,style:{...ce,transform:ue?ce.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ve,"--radix-popper-transform-origin":[de.transformOrigin?.x,de.transformOrigin?.y].join(` `),...de.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,Oo.jsx)(Yae,{scope:n,placedSide:fe,onArrowChange:E,arrowX:he,arrowY:ge,shouldHideArrow:_e,children:(0,Oo.jsx)(h.div,{"data-side":fe,"data-align":pe,...y,ref:w,style:{...y.style,animation:ue?void 0:`none`}})})})});g9.displayName=h9;var _9=`PopperArrow`,Zae={top:`bottom`,right:`left`,bottom:`top`,left:`right`},v9=D.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Xae(_9,n),a=Zae[i.placedSide];return(0,Oo.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,Oo.jsx)(qae,{...r,ref:t,style:{...r.style,display:`block`}})})});v9.displayName=_9;function Qae(e){return e!==null}var $ae=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=y9(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function y9(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var b9=f9,x9=m9,S9=g9,C9=v9,[w9,eoe]=_(`Tooltip`,[u9]),T9=u9(),E9=`TooltipProvider`,toe=700,D9=`tooltip.open`,[noe,O9]=w9(E9),k9=e=>{let{__scopeTooltip:t,delayDuration:n=toe,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=D.useRef(!0),s=D.useRef(!1),c=D.useRef(0);return D.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,Oo.jsx)(noe,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:D.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:D.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:D.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};k9.displayName=E9;var A9=`Tooltip`,[roe,j9]=w9(A9),M9=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=O9(A9,e.__scopeTooltip),l=T9(t),[u,d]=D.useState(null),f=y(),p=D.useRef(0),h=o??c.disableHoverableContent,g=s??c.delayDuration,_=D.useRef(!1),[v,b]=m({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(D9))):c.onClose(),a?.(e)},caller:A9}),x=D.useMemo(()=>v?_.current?`delayed-open`:`instant-open`:`closed`,[v]),S=D.useCallback(()=>{window.clearTimeout(p.current),p.current=0,_.current=!1,b(!0)},[b]),C=D.useCallback(()=>{window.clearTimeout(p.current),p.current=0,b(!1)},[b]),w=D.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{_.current=!0,b(!0),p.current=0},g)},[g,b]);return D.useEffect(()=>()=>{p.current&&=(window.clearTimeout(p.current),0)},[]),(0,Oo.jsx)(b9,{...l,children:(0,Oo.jsx)(roe,{scope:t,contentId:f,open:v,stateAttribute:x,trigger:u,onTriggerChange:d,onTriggerEnter:D.useCallback(()=>{c.isOpenDelayedRef.current?w():S()},[c.isOpenDelayedRef,w,S]),onTriggerLeave:D.useCallback(()=>{h?C():(window.clearTimeout(p.current),p.current=0)},[C,h]),onOpen:S,onClose:C,disableHoverableContent:h,children:n})})};M9.displayName=A9;var N9=`TooltipTrigger`,P9=D.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=j9(N9,n),a=O9(N9,n),o=T9(n),s=u(t,D.useRef(null),i.onTriggerChange),c=D.useRef(!1),l=D.useRef(!1),d=D.useCallback(()=>c.current=!1,[]);return D.useEffect(()=>()=>document.removeEventListener(`pointerup`,d),[d]),(0,Oo.jsx)(x9,{asChild:!0,...o,children:(0,Oo.jsx)(h.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:f(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:f(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:f(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,d,{once:!0})}),onFocus:f(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:f(e.onBlur,i.onClose),onClick:f(e.onClick,i.onClose)})})});P9.displayName=N9;var F9=`TooltipPortal`,[ioe,aoe]=w9(F9,{forceMount:void 0}),I9=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=j9(F9,t);return(0,Oo.jsx)(ioe,{scope:t,forceMount:n,children:(0,Oo.jsx)(d,{present:n||a.open,children:(0,Oo.jsx)(p,{asChild:!0,container:i,children:r})})})};I9.displayName=F9;var L9=`TooltipContent`,R9=D.forwardRef((e,t)=>{let n=aoe(L9,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=j9(L9,e.__scopeTooltip);return(0,Oo.jsx)(d,{present:r||o.open,children:o.disableHoverableContent?(0,Oo.jsx)(z9,{side:i,...a,ref:t}):(0,Oo.jsx)(ooe,{side:i,...a,ref:t})})}),ooe=D.forwardRef((e,t)=>{let n=j9(L9,e.__scopeTooltip),r=O9(L9,e.__scopeTooltip),i=D.useRef(null),a=u(t,i),[o,s]=D.useState(null),{trigger:c,onClose:l}=n,d=i.current,{onPointerInTransitChange:f}=r,p=D.useCallback(()=>{s(null),f(!1)},[f]),m=D.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=doe(r,uoe(r,n.getBoundingClientRect())),a=foe(t.getBoundingClientRect());s(moe([...i,...a])),f(!0)},[f]);return D.useEffect(()=>()=>p(),[p]),D.useEffect(()=>{if(c&&d){let e=e=>m(e,d),t=e=>m(e,c);return c.addEventListener(`pointerleave`,e),d.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),d.removeEventListener(`pointerleave`,t)}}},[c,d,m,p]),D.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||d?.contains(t),i=!poe(n,o);r?p():i&&(p(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,d,o,l,p]),(0,Oo.jsx)(z9,{...e,ref:a})}),[soe,coe]=w9(A9,{isInside:!1}),loe=x(`TooltipContent`),z9=D.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=j9(L9,n),u=T9(n),{onClose:d}=c;return D.useEffect(()=>(document.addEventListener(D9,d),()=>document.removeEventListener(D9,d)),[d]),D.useEffect(()=>{if(c.trigger){let e=e=>{e.target?.contains(c.trigger)&&d()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,d]),(0,Oo.jsx)(l,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,Oo.jsxs)(S9,{"data-state":c.stateAttribute,...u,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,Oo.jsx)(loe,{children:r}),(0,Oo.jsx)(soe,{scope:n,isInside:!0,children:(0,Oo.jsx)(Uie,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});R9.displayName=L9;var B9=`TooltipArrow`,V9=D.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=T9(n);return coe(B9,n).isInside?null:(0,Oo.jsx)(C9,{...i,...r,ref:t})});V9.displayName=B9;function uoe(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function doe(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function foe(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function poe(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function moe(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),hoe(t)}function hoe(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var goe=k9,_oe=M9,voe=P9,yoe=I9,boe=R9,xoe=V9;function Soe(e){let t=(0,Ao.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({delayDuration:r,...n}=e,t[0]=e,t[1]=n,t[2]=r);let i=r===void 0?0:r,a;return t[3]!==i||t[4]!==n?(a=(0,Oo.jsx)(goe,{"data-slot":`tooltip-provider`,delayDuration:i,...n}),t[3]=i,t[4]=n,t[5]=a):a=t[5],a}function Coe(e){let t=(0,Ao.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Oo.jsx)(_oe,{"data-slot":`tooltip`,...n}),t[2]=n,t[3]=r),r}function woe(e){let t=(0,Ao.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Oo.jsx)(voe,{"data-slot":`tooltip-trigger`,...n}),t[2]=n,t[3]=r),r}function Toe(e){let t=(0,Ao.c)(13),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,sideOffset:a,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?0:a,c;t[5]===r?c=t[6]:(c=s(`z-50 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none motion-reduce:data-[state=delayed-open]:animate-none motion-reduce:duration-0`,r),t[5]=r,t[6]=c);let l;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Oo.jsx)(xoe,{className:`z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground`}),t[7]=l):l=t[7];let u;return t[8]!==n||t[9]!==i||t[10]!==o||t[11]!==c?(u=(0,Oo.jsx)(yoe,{children:(0,Oo.jsxs)(boe,{"data-slot":`tooltip-content`,sideOffset:o,className:c,...i,children:[n,l]})}),t[8]=n,t[9]=i,t[10]=o,t[11]=c,t[12]=u):u=t[12],u}function H9(e){if(typeof e!=`object`||!e)return;let t=e;if(typeof t.title==`string`&&t.title.length>0)return t.title}function Eoe(e){return e.kind===`asset`}function Doe(e){return e.kind===`document`}function Ooe(e){return e.kind===`folder`}function koe(e){if(!e)return[];let t=e.split(`/`).filter(Boolean),n=[];for(let e=1;e<t.length;e++)n.push(t.slice(0,e).join(`/`));return n}function Aoe(e){if(!e)return``;let t=e.lastIndexOf(`/`);return t>0?e.slice(0,t):``}function joe(e,t=!1){return e.filter(e=>{let n=e.docName??e.path??``;return n===``?!1:t?!0:!n.split(`/`).some(e=>e.startsWith(`.`))})}var U9=null,W9=new Set;function G9(e,t){if(e===t)return!0;if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Moe(e,t){return e===null?!1:e===t?!0:G9(e.pages,t.pages)&&G9(e.folderPaths,t.folderPaths)&&G9(e.assetPaths??new Set,t.assetPaths??new Set)}function Noe(e,t){let n=new Map;for(let r of e){let e=t(r);e&&!n.has(e)&&n.set(e,r)}return n}function Poe(){return U9}function Foe(e){if(!Moe(U9,e)){U9=e;for(let t of[...W9])try{t(e)}catch(e){console.error(`[page-list-cache] subscriber threw:`,e)}}}function Ioe(e){if(W9.add(e),U9!==null)try{e(U9)}catch(e){console.error(`[page-list-cache] subscriber threw on replay:`,e)}return()=>{W9.delete(e)}}var K9=`open-knowledge:documents-changed`,Loe=new Set(h5.options);function q9(e){return e===void 0||!Array.isArray(e)?[`files`]:[...new Set(e.filter(e=>Loe.has(e)))]}function Roe(e=[`files`]){window.dispatchEvent(new CustomEvent(K9,{detail:{channels:q9(e)}}))}function J9(e){let t=t=>{e(q9(t instanceof CustomEvent?t.detail?.channels:void 0))};return window.addEventListener(K9,t),()=>window.removeEventListener(K9,t)}var Y9=`open-knowledge:templates-changed`;function zoe(){window.dispatchEvent(new CustomEvent(Y9))}function Boe(e){let t=()=>e();return window.addEventListener(Y9,t),()=>window.removeEventListener(Y9,t)}function X9(e){return e.trim().replace(/^\.\/+/,``).replace(/^\/+/,``).replace(/\.mdx?$/i,``)}function Voe(e){let t=X9(e);return t?`${t}.md`:`untitled.md`}function Hoe(e){let t=X9(e),n=t.lastIndexOf(`/`);return{initialDir:n>0?t.slice(0,n):``,suggestedName:`${n>=0?t.slice(n+1):t||`untitled`}.md`}}function Uoe(e){let t=e.trim();return{normalizedTarget:X9(t).replace(/\/+$/g,``),expectsFolder:/\/+$/.test(t)}}function Z9(e){let t=new Set;for(let n of e)for(let e of koe(n))t.add(e);return t}function Woe(e,t){if(!t)return;let n=t5(e);if(n)return t.get(n)}function Goe(e,t){let{normalizedTarget:n,expectsFolder:r}=Uoe(e);if(!n)return{kind:`missing`,target:n};if(!r&&t.pages.has(n))return{kind:`doc`,target:n,docName:n};if(!r){let e=Woe(n,t.pagesBySlug);if(e)return{kind:`doc`,target:e,docName:e}}let i=`${n}/index`;if(t.pages.has(i))return{kind:`folder-index`,target:n,folderPath:n,docName:i,noteKind:`canonical-index`};let a=n.split(`/`).pop(),o=a?`${n}/${a}`:null;return o&&t.pages.has(o)?{kind:`folder-index`,target:n,folderPath:n,docName:o,noteKind:`legacy-folder-note`}:(t.folderPaths??Z9(t.pages)).has(n)?{kind:`folder`,target:n,folderPath:n}:{kind:`missing`,target:n}}function Koe(e){return e.kind===`folder-index`?{kind:`folder`,target:e.folderPath,folderPath:e.folderPath}:e}function qoe(e){switch(e.kind){case`doc`:case`folder-index`:return e.docName;case`missing`:return e.target;case`asset`:case`folder`:return null}}var Q9=(0,D.createContext)(null);function Joe(e,t){if(t.size===0)return new Set(e);let n=new Set(e);for(let e of t)n.add(e);return n}function Yoe(e,t){if(e.size===0)return new Set;let n=new Set;for(let r of e)t.has(r)||n.add(r);return n}function Xoe(e,t){let n=new Map(e);for(let e of t)n.has(e)||n.set(e,e);return n}async function Zoe(){let e=await fetch(`/api/pages`);if(!e.ok){let t=await e.json().catch(()=>null);throw Error(H9(t)??`/api/pages responded with ${e.status}`)}let t=await e.json();return Array.isArray(t.pages)?t.pages:[]}async function Qoe(){let e=await fetch(`/api/documents`);if(!e.ok){let t=await e.json().catch(()=>null);throw Error(H9(t)??`/api/documents responded with ${e.status}`)}let t=await e.json();return Array.isArray(t.documents)?{assetPaths:t.documents.filter(e=>e.kind===`asset`&&typeof e.path==`string`&&e.path.length>0).map(e=>e.path),folderPaths:t.documents.filter(e=>e.kind===`folder`&&typeof e.path==`string`&&e.path.length>0).map(e=>e.path)}:{assetPaths:[],folderPaths:[]}}function $oe(e){console.error(`[PageListContext] Failed to load pages:`,e)}function ese(e){console.warn(`[PageListContext] Failed to load referenced assets:`,e)}function tse(e){let t=(0,Ao.c)(43),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=new Set,t[0]=r):r=t[0];let[i,a]=(0,D.useState)(r),o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=new Map,t[1]=o):o=t[1];let[s,c]=(0,D.useState)(o),l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=new Map,t[2]=l):l=t[2];let[u,d]=(0,D.useState)(l),f;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(f=new Set,t[3]=f):f=t[3];let[p,m]=(0,D.useState)(f),h;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(h=new Set,t[4]=h):h=t[4];let[g,_]=(0,D.useState)(h),v;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(v=new Set,t[5]=v):v=t[5];let[y,b]=(0,D.useState)(v),[x,S]=(0,D.useState)(!0),[C,w]=(0,D.useState)(null),T=(0,D.useRef)(0),E;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(E=function(){let e=T.current+=1;Promise.all([Zoe(),Qoe().catch(ase)]).then(t=>{let[n,r]=t;if(e!==T.current)return;let i=new Set(n.map(ise));a(i),c(new Map(n.map(rse))),d(new Map(n.map(nse))),m(new Set(r.assetPaths)),_(new Set(r.folderPaths)),b(e=>Yoe(e,i)),w(null)}).catch(t=>{e===T.current&&($oe(t),w(t instanceof Error?t.message:`Failed to load pages`))}).finally(()=>{e===T.current&&S(!1)})},t[6]=E):E=t[6];let ee=E,te;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(te=function(e){b(t=>{if(t.has(e))return t;let n=new Set(t);return n.add(e),n}),w(null)},t[7]=te):te=t[7];let ne=te,re,ie;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(ie=()=>{ee();let e=()=>{document.visibilityState===`visible`&&ee()};window.addEventListener(`focus`,e),window.addEventListener(`visibilitychange`,e);let t=J9(e=>{e.includes(`files`)&&ee()});return()=>{window.removeEventListener(`focus`,e),window.removeEventListener(`visibilitychange`,e),t()}},re=[],t[8]=re,t[9]=ie):(re=t[8],ie=t[9]),(0,D.useEffect)(ie,re);let O,ae,oe,se,ce,le;if(t[10]!==y||t[11]!==p||t[12]!==g||t[13]!==u||t[14]!==s||t[15]!==i){ce=Joe(i,y);let e;t[22]!==y||t[23]!==s?(e=Xoe(s,y),t[22]=y,t[23]=s,t[24]=e):e=t[24],se=e,oe=u,O=p,ae=new Set([...Z9(ce),...g]),le=Noe(ce,t5),t[10]=y,t[11]=p,t[12]=g,t[13]=u,t[14]=s,t[15]=i,t[16]=O,t[17]=ae,t[18]=oe,t[19]=se,t[20]=ce,t[21]=le}else O=t[16],ae=t[17],oe=t[18],se=t[19],ce=t[20],le=t[21];let ue=le,de,fe;t[25]!==O||t[26]!==ae||t[27]!==ce||t[28]!==ue?(de=()=>{Foe({pages:ce,folderPaths:ae,pagesBySlug:ue,assetPaths:O})},fe=[ce,ae,ue,O],t[25]=O,t[26]=ae,t[27]=ce,t[28]=ue,t[29]=de,t[30]=fe):(de=t[29],fe=t[30]),(0,D.useEffect)(de,fe);let pe;t[31]!==O||t[32]!==C||t[33]!==ae||t[34]!==x||t[35]!==oe||t[36]!==se||t[37]!==ce||t[38]!==ue?(pe={pages:ce,pagesBySlug:ue,pageTitles:se,pageMeta:oe,folderPaths:ae,assetPaths:O,loading:x,error:C,refetch:ee,addPage:ne},t[31]=O,t[32]=C,t[33]=ae,t[34]=x,t[35]=oe,t[36]=se,t[37]=ce,t[38]=ue,t[39]=pe):pe=t[39];let me;return t[40]!==n||t[41]!==pe?(me=(0,Oo.jsx)(Q9,{value:pe,children:n}),t[40]=n,t[41]=pe,t[42]=me):me=t[42],me}function nse(e){return[e.docName,{size:e.size,modified:e.modified,docExt:e.docExt}]}function rse(e){return[e.docName,e.title]}function ise(e){return e.docName}function ase(e){return ese(e),{assetPaths:[],folderPaths:[]}}function ose(){let e=(0,D.use)(Q9);if(!e)throw Error(`usePageList must be used within <PageListProvider />`);return e}function sse(e){if(e.startsWith($9)||!e.startsWith(`#/`))return null;let t=e.slice(2),n=fse(t),r=n>=0?t.slice(0,n):t;if(!r)return null;try{return r.split(`/`).map(decodeURIComponent).join(`/`)}catch{return r}}function cse(e){if(e.startsWith($9)||!e.startsWith(`#/`))return null;let t=e.slice(2),n=t.indexOf(`?`),r=t.indexOf(`#`);if(n>=0&&(r<0||n<r)){let e=r>=0?r:t.length,i=new URLSearchParams(t.slice(n+1,e)).get(`anchor`);if(i)return i}if(r<0)return null;let i=t.slice(r+1);if(!i)return null;try{return decodeURIComponent(i)}catch{return i}}function lse(e,t){let n=`#/${e}`;return t?`${n}?anchor=${encodeURIComponent(t)}`:n}function use(e){return e.endsWith(`.mdx`)?e.slice(0,-4):e.endsWith(`.md`)?e.slice(0,-3):e}function dse(e,t){let n=e.replace(/^\/+|\/+$/g,``),r=n?`#/${n}/`:`#/`;return t?`${r}?anchor=${encodeURIComponent(t)}`:r}var $9=`#/__asset__/`;function fse(e){let t=e.indexOf(`?`),n=e.indexOf(`#`);return t<0?n:n<0?t:Math.min(t,n)}function pse(e){if(!e.startsWith($9))return null;let t=e.slice(12);if(!t)return null;try{return t.split(`/`).map(decodeURIComponent).join(`/`)}catch{return t}}function mse(e){return`${$9}${e.split(`/`).map(encodeURIComponent).join(`/`)}`}var hse=n(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),gse=n(((e,t)=>{var n=hse();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),_se=n(((e,t)=>{t.exports=gse()()}));export{_$ as $,w4 as $n,B as $r,g0 as $t,Toe as A,l$ as An,dT as Ar,y2 as At,J7 as B,S2 as Bn,rb as Br,Nre as Bt,Aoe as C,t0 as Cn,$Z as Cr,Are as Ct,Ooe as D,oie as Dn,v5 as Dr,q1 as Dt,Doe as E,m4 as En,i5 as Er,c$ as Et,S9 as F,Cie as Fn,Qx as Fr,gre as Ft,Y7 as G,y4 as Gn,oy as Gr,Pre as Gt,Z7 as H,Tie as Hn,wb as Hr,S0 as Ht,b9 as I,r5 as In,zx as Ir,B8 as It,Kie as J,S4 as Jn,Zx as Jr,d$ as Jt,X7 as K,b4 as Kn,Gy as Kr,t1 as Kt,u9 as L,Nie as Ln,ene as Lr,y1 as Lt,woe as M,P5 as Mn,gx as Mr,T$ as Mt,x9 as N,WZ as Nn,Cb as Nr,$$ as Nt,H9 as O,aie as On,une as Or,pre as Ot,C9 as P,z8 as Pn,tS as Pr,l1 as Pt,bie as Q,C4 as Qn,Tp as Qr,f0 as Qt,e9 as R,V1 as Rn,Ky as Rr,y$ as Rt,Ioe as S,e0 as Sn,K1 as Sr,lre as St,Eoe as T,gie as Tn,t5 as Tr,k$ as Tt,$7 as U,D4 as Un,Bx as Ur,C0 as Ut,t9 as V,r$ as Vn,ib as Vr,jre as Vt,Fae as W,O4 as Wn,Oy as Wr,b1 as Wt,L5 as X,x4 as Xn,R_ as Xr,c0 as Xt,Wie as Y,T4 as Yn,F_ as Yr,x0 as Yt,yie as Z,v4 as Zn,vv as Zr,p0 as Zt,Roe as _,he as _i,mie as _n,cQ as _r,kre as _t,use as a,_f as ai,H1 as an,a1 as ar,tie as at,Boe as b,oe as bi,xie as bn,Vie as br,j$ as bt,dse as c,sd as ci,Fie as cn,are as cr,$re as ct,qoe as d,gu as di,JQ as dn,i$ as dr,f$ as dt,zp as ei,I1 as en,YZ as er,O$ as et,Koe as f,wu as fi,T0 as fn,M8 as fr,m$ as ft,X9 as g,Ie as gi,zie as gn,z2 as gr,K$ as gt,Voe as h,j as hi,Z1 as hn,Bie as hr,E5 as ht,sse as i,z as ii,N$ as in,b$ as ir,Zre as it,Soe as j,U1 as jn,jx as jr,bre as jt,Coe as k,Oie as kn,ine as kr,D5 as kt,tse as l,L as li,HQ as ln,C2 as lr,Xre as lt,Hoe as m,P as mi,Y1 as mn,j2 as mr,g$ as mt,cse as n,R as ni,w0 as nn,n$ as nr,Ere as nt,mse as o,Qd as oi,G1 as on,P2 as or,eie as ot,Goe as p,F as pi,J1 as pn,B1 as pr,p$ as pt,Q7 as q,E4 as qn,Eb as qr,r1 as qt,pse as r,bp as ri,E$ as rn,M2 as rr,dre as rt,lse as s,I as si,vre as sn,ore as sr,Qre as st,_se as t,Hp as ti,Ire as tn,I5 as tr,Tre as tt,ose as u,yu as ui,PQ as un,G$ as ur,h$ as ut,zoe as v,me as vi,Iie as vn,sQ as vr,Ore as vt,joe as w,Sie as wn,O1 as wr,v$ as wt,Poe as x,ae as xi,n0 as xn,pie as xr,Fre as xt,J9 as y,pe as yi,Lie as yn,Rie as yr,M$ as yt,Pae as z,u$ as zn,tb as zr,yre as zt};