@inkeep/open-knowledge 0.13.0-beta.11 → 0.13.0-beta.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/skills/discovery/SKILL.md +1 -1
- package/dist/assets/skills/project/SKILL.md +1 -1
- package/dist/cli.mjs +5 -5
- package/dist/constants-DaxobvWT.mjs +2 -0
- package/dist/index.mjs +1 -1
- package/dist/{init-BKuDXd3s.mjs → init-X3zS-LSz.mjs} +3 -3
- package/dist/init-kKxW4vK1.mjs +1 -0
- package/dist/{loader-DF331xWj.mjs → loader-C0nSQVha.mjs} +2 -2
- package/dist/loader-DCLI2vr3.mjs +1 -0
- package/dist/{preview-BznBXGWp.mjs → preview-CF8pqogh.mjs} +2 -2
- package/dist/preview-DyWK2oKW.mjs +1 -0
- package/dist/public/assets/{ActivityModeContent-Djverb3S.js → ActivityModeContent-DO5LDVyf.js} +1 -1
- package/dist/public/assets/DocumentContext-DxmsoC1X.js +61 -0
- package/dist/public/assets/{GraphPanel-DwpNmS_e.js → GraphPanel-Bng0yRaW.js} +9 -9
- package/dist/public/assets/{OpenInAgentMenuRequestContext-DwZfpNZF.js → OpenInAgentMenuRequestContext-CQRaqNp4.js} +2 -2
- package/dist/public/assets/{SettingsDialogBody-mm1QmNbe.js → SettingsDialogBody-Dw73fnd6.js} +2 -2
- package/dist/public/assets/{SourceEditor-Bk9e_K7d.js → SourceEditor-Biti-1q2.js} +1 -1
- package/dist/public/assets/{config-validation-events-zDfc6Vzc.js → config-validation-events-Y0A5AYDJ.js} +5 -5
- package/dist/public/assets/{index-BaoCi7fB.js → index-DpxWNen4.js} +88 -88
- package/dist/public/assets/{keyboard-shortcuts-4fdlkFqU.js → keyboard-shortcuts-DcYQJAQc.js} +1 -1
- package/dist/public/assets/{prop-types-BpGPkTBF.js → prop-types-53f-gng4.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-BYBMImP3.js → target-navigation-intent-CzE7iSpB.js} +1 -1
- package/dist/public/index.html +7 -7
- package/dist/{repair-launch-json-BJa1oHkk.mjs → repair-launch-json--4u2Ipva.mjs} +2 -2
- package/dist/{repair-mcp-configs-BKSHIS07.mjs → repair-mcp-configs-CvQuxovR.mjs} +2 -2
- package/dist/{src-Btl1Jv_P.mjs → src-9Hh_YzWj.mjs} +2 -2
- package/dist/{start-DbZ-e5iL.mjs → start-C5LoXHia.mjs} +2 -2
- package/dist/start-CmxwKIEJ.mjs +1 -0
- package/package.json +1 -1
- package/dist/constants-xYEQTpUf.mjs +0 -2
- package/dist/init-Cu_knmY0.mjs +0 -1
- package/dist/loader-CmlFSn82.mjs +0 -1
- package/dist/preview-DGZIVG2r.mjs +0 -1
- package/dist/public/assets/DocumentContext-CTvQa4i9.js +0 -61
- package/dist/start-CMrKUcc_.mjs +0 -1
|
@@ -513,4 +513,4 @@ Read more at https://docs.orama.com/docs/orama-js/plugins/plugin-secure-proxy#pl
|
|
|
513
513
|
`:`
|
|
514
514
|
`;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))}let r=v&&!v.leading?``:`|`,i=v&&!v.trailing?``:`|`;return`${r}${n.join(`|`)}${i}`},h=e.data?.sourceAlignmentPadding,g=Array.from({length:f},(e,t)=>{let n=h?.[t];return n&&typeof n.left==`number`&&typeof n.right==`number`?n:null}),_=e.data?.sourceOuterPipes,v=_&&f>=2&&a.every(e=>{let t=(e[0]??``).trim(),n=(e[f-1]??``).trim();return(_.leading||t.length>0)&&(_.trailing||n.length>0&&!n.endsWith(`\\`))})?_:null;if(a.length===0)return m(p,g);let y=[];y.push(m(a[0],o[0]??[])),y.push(m(p,g));for(let e=1;e<a.length;e++)y.push(m(a[e],o[e]??[]));return y.join(`
|
|
515
515
|
`)},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=M8(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=M8(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)=>{if(n)return`>`;let r=s?.[c++];return r===`none`||r===0?`>${e}`:typeof r==`number`&&r>=2&&!e.startsWith(` `)?`>${` `.repeat(r)}${e}`:`> ${e}`})}};function M8(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 N8(e,t,n=` `){return t===`single`?`${n}'${e.replace(/'/g,`\\'`)}'`:t===`paren`?`${n}(${e.replace(/[()]/g,`\\$&`)})`:`${n}"${e.replace(/"/g,`\\"`)}"`}function P8(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 Hie(e){return e.replace(/(?<!\\)&(?=(#[0-9]+|#[xX][0-9A-Fa-f]+|[A-Za-z][A-Za-z0-9]*);)/g,(e,t)=>Uie(t)?e:`\\${e}`)}function Uie(e){if(e.charCodeAt(0)!==35)return!1;let t=e[1]===`x`||e[1]===`X`?Number.parseInt(e.slice(2),16):Number.parseInt(e.slice(1),10);return t===9||t===10||t===11||t===12||t===13||t===32}function F8(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==="`"||(e.character===`*`||e.character===`_`||e.character===`~`)&&e.inConstruct===`phrasing`||e.character===`=`&&e.atBreak===!0));let i;try{i=e.safe(t,n)}finally{e.unsafe=r}return Hie(qie(i,n))}var I8=1,Wie=2;function L8(e){if(Number.isNaN(e))return`ws`;let t=AL(e);return t===I8?`ws`:t===Wie?`punct`:`other`}function Gie(e,t,n){let r=L8(t),i=L8(n),a=i!==`ws`&&(i===`other`||r!==`other`),o=r!==`ws`&&(r===`other`||i!==`other`);return e===`_`?a&&(!o||r===`punct`)||o&&(!a||i===`punct`):a||o}function Kie(e,t,n){let r=t;for(;r<e.length&&(e[r]===` `||e[r]===` `);)r++;if(r<e.length)return e[r]===`
|
|
516
|
-
`||e[r]===`\r`;let i=n.after.charCodeAt(0);return Number.isNaN(i)||i===10||i===13}function qie(e,t){let n=``,r=0;for(;r<e.length;){let i=e.charAt(r);if(i===`\\`){n+=e.slice(r,r+2),r+=2;continue}if(i===`*`||i===`_`||i===`~`||i===`=`){let a=r+1;for(;a<e.length&&e.charAt(a)===i;)a++;let o=r===0?t.before.charCodeAt(t.before.length-1):e.charCodeAt(r-1);if(i===`=`)n+=(Number.isNaN(o)||o===10||o===13)&&Kie(e,a,t)?`\\${e.slice(r,a)}`:e.slice(r,a);else{let s=a<e.length?e.charCodeAt(a):t.after.charCodeAt(0);n+=Gie(i,o,s)?`\\${i}`.repeat(a-r):e.slice(r,a)}r=a;continue}n+=i,r+=1}return n}function R8(e,t,n){let r=n.startsWith(`_`)?`_`:`*`,i=e,a=i.charCodeAt(0);z8(t.before.charCodeAt(t.before.length-1),a,r)&&(i=B8(a)+i.slice(1));let o=i.charCodeAt(i.length-1);return z8(t.after.charCodeAt(0),o,r)&&(i=i.slice(0,-1)+B8(o)),i}function z8(e,t,n){return!(AL(t)!==I8||n===`_`&&AL(e)===void 0)}function B8(e){return`&#x${e.toString(16).toUpperCase()};`}function Jie(e,t,n,r){let i=e.value??``,a=e.data?.sourceDelimiter,o=typeof a==`string`&&/^\$+$/.test(a)?a.length:2;for(o===1&&!Xie(i,r)&&(o=2);RegExp(`(^|[^$])${`\\$`.repeat(o)}([^$]|$)`).test(i);)o++;let s=`$`.repeat(o);/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^\$|\$$/.test(i))&&(i=` ${i} `);let c=-1;for(;++c<n.unsafe.length;){let e=n.unsafe[c];if(!e.atBreak)continue;let t=n.compilePattern(e),r;for(;(r=t.exec(i))!==null;){let e=r.index;i.codePointAt(e)===10&&i.codePointAt(e-1)===13&&e--,i=`${i.slice(0,e)} ${i.slice(r.index+1)}`}}return s+i+s}function Yie(e,t,n,r){let i=e.data?.sourceDelimiter===`~`?`~`:`~~`,a=n.createTracker(r),o=n.enter(`strikethrough`),s=a.move(i);return s+=n.containerPhrasing(e,{...a.current(),before:s,after:`~`}),s+=a.move(i),o(),s}function Xie(e,t){return!(e.length===0||!/^\S/.test(e)||!/\S$/.test(e)||/[$\r\n]/.test(e)||e.endsWith(`\\`)||/\\[!-/:-@[-`{-~]/.test(e)||/^\d/.test(t.after)||t.before.endsWith(`\\`))}function V8(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 Zie=class{schema;handlers;pmNodeHandlers;pmMarkHandlers;parseProcessor;serializeProcessor;parseCtx={current:{}};constructor(e){this.schema=Vy(e.extensions),this.handlers=rae(this.schema,this.parseCtx);let{nodeHandlers:t,markHandlers:n}=iae(this.schema);this.pmNodeHandlers=t,this.pmMarkHandlers=n,this.parseProcessor=Mie({schema:this.schema,handlers:this.handlers,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers}),this.serializeProcessor=Nie({toMarkdownHandlers:Vie})}parse(e,t){if(!e.trim())return{type:`doc`,content:[{type:`paragraph`,content:[]}]};this.parseCtx.current=t??{};try{return Fie(e,this.parseProcessor).toJSON()}finally{this.parseCtx.current={}}}parseToMdast(e){return e.trim()?Iie(e,this.parseProcessor):{type:`root`,children:[]}}parseWithFallback(e,t){return e.trim()?r3(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 Lie(t,this.serializeProcessor,{schema:this.schema,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers})}},H8=P4();function Qie(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 $ie(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 eae(e){return e.attrs.sourceDirty||$ie(e)}function tae(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 U8(e,t){if(!t)return e;let n={};return t.sourceFenceChar&&(n.sourceFenceChar=t.sourceFenceChar),typeof t.sourceFenceLength==`number`&&(n.sourceFenceLength=t.sourceFenceLength),t.sourcePadded===!0&&(n.sourcePadded=!0),Object.keys(n).length===0?e:{...e,data:n}}function W8(e,t){if(e.length===0)return U8({type:`inlineCode`,value:``},t);if(e.every(e=>e.type===`text`))return U8({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:[W8(n.children,t)]}}return U8({type:`inlineCode`,value:G8(e)},t)}function G8(e){let t=``;for(let n of e)n.type===`text`?t+=n.value:`children`in n&&Array.isArray(n.children)?t+=G8(n.children):`value`in n&&typeof n.value==`string`&&(t+=n.value);return t}var nae=s$;function rae(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=yH(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=yH(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,c=e.data?.sourceOuterPipes??null,l=e.data?.sourceAlignmentPadding??null;return n.table.createAndFill({sourceDashCounts:s,sourceOuterPipes:c,sourceAlignmentPadding:l},o.length>0?o:null)}),n.image&&(i.image=e=>{let r=e.url??``,i=j8(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=[];for(let e of s){let t=c[c.length-1];e.kind===`entity`&&t?.kind===`entity`&&t.offset+t.length===e.offset&&C1(t.raw)!==null&&b1(e.raw)?c[c.length-1]={kind:`entity`,offset:t.offset,length:t.length+e.length,raw:t.raw+e.raw}:c.push(e)}let l=[],u=0;for(let t of c){if(t.offset>u){let r=n.slice(u,t.offset).replaceAll(`\xA0`,` `);r&&l.push(e.text(r))}if(t.offset<n.length){let i=n.slice(t.offset,t.offset+t.length).replaceAll(`\xA0`,` `);if(i)if(t.kind===`escape`)l.push(e.text(i,[r.escapeMark.create()]));else if(r.sourceLiteral){let n=C1(t.raw);l.push(e.text(n??i,[r.sourceLiteral.create({sourceRaw:t.raw})]))}else l.push(e.text(i));u=t.offset+t.length}}if(u<n.length){let t=n.slice(u).replaceAll(`\xA0`,` `);t&&l.push(e.text(t))}return l.length===1?l[0]:l}),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,sourcePadded:t.data?.sourcePadded===!0})]));let a=r.strike??r.delete;if(a&&(i.delete=bH(a,e=>({sourceDelimiter:e.data?.sourceDelimiter===`~`?`~`:`~~`}))),r.highlight&&(i.mark=bH(r.highlight)),r.comment&&(i.comment=bH(r.comment,e=>({sourceForm:e.data?.sourceForm??`percent`}))),n.commentBlock&&(i.commentBlock=yH(n.commentBlock,e=>({sourceForm:e.data?.sourceForm??`percent`,sourceLayout:e.data?.sourceLayout??`block`}))),r.emphasis&&(i.emphasis=bH(r.emphasis,e=>({sourceDelimiter:e.data?.sourceDelimiter??`*`}))),r.strong&&(i.strong=bH(r.strong,e=>({sourceDelimiter:e.data?.sourceDelimiter??`**`}))),n.heading&&(i.heading=yH(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,sourceLeadingIndent:e.data?.sourceLeadingIndent??null,sourceInteriorSpacing:e.data?.sourceInteriorSpacing??null}))),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`,sourceClosingFenceLength:t.data?.sourceClosingFenceLength??null,sourceFenceIndent:t.data?.sourceFenceIndent??null,sourceInfoPadding:t.data?.sourceInfoPadding??null,sourceIndents:t.data?.sourceIndents??null},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=yH(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=yH(n.listItem,e=>({checked:e.checked??null,spread:!!e.spread,sourceMarkerSpacing:e.data?.sourceMarkerSpacing??null,sourceOrdinal:e.data?.sourceOrdinal??null,sourceCheckboxChar:e.data?.sourceCheckboxChar??null,sourceContinuationIndent:e.data?.sourceContinuationIndent??null}))),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=H8.getOrWildcard(o),c=Qie(e.attributes,s.props);if(o===`CommonMarkImage`&&typeof c.src==`string`){let e=c.src,n=j8(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,sourceTarget:e.data?.sourceTarget??null,sourceAnchor:e.data?.sourceAnchor??null,sourceAlias:e.data?.sourceAlias??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=R1(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&&nae.has(l)&&n.jsxComponent&&H8.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&&c$.has(l)&&n.jsxComponent&&H8.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&&u$.has(l)&&n.jsxComponent&&H8.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&&d$.has(l)&&n.jsxComponent&&H8.has(`WikiEmbedFile`)){let{resolveSize:e}=t.current,r=e&&d?e(o,d)??null:null,i=r===null?null:V8(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(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])}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??``,sourceDelimiter:e.data?.sourceDelimiter??null})),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=yH(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}`,unresolvedPosition:t.unresolvedPosition??!1})),n.rawMdxFallback.createAndFill({reason:`Unhandled mdast: ${t.originalType}`,originalSpan:r},t.value?[e.text(t.value)]:null)},i}function iae(e){let t={},n={},r=e.nodes,i=e.marks;r.paragraph&&(t.paragraph=TH(`paragraph`)),r.blockquote&&(t.blockquote=TH(`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=TH(`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,sourceLeadingIndent:e.attrs.sourceLeadingIndent??void 0,sourceInteriorSpacing:e.attrs.sourceInteriorSpacing??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,sourceClosingFenceLength:e.attrs.sourceClosingFenceLength??void 0,sourceFenceIndent:e.attrs.sourceFenceIndent??void 0,sourceInfoPadding:e.attrs.sourceInfoPadding??void 0,sourceIndents:e.attrs.sourceIndents??void 0}}}),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=TH(`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&&tae(r[0])?r.slice(1):r,a={};return typeof e.attrs.sourceMarkerSpacing==`number`&&(a.sourceMarkerSpacing=e.attrs.sourceMarkerSpacing),typeof e.attrs.sourceOrdinal==`number`&&(a.sourceOrdinal=e.attrs.sourceOrdinal),e.attrs.sourceCheckboxChar===`X`&&(a.sourceCheckboxChar=`X`),typeof e.attrs.sourceContinuationIndent==`number`&&(a.sourceContinuationIndent=e.attrs.sourceContinuationIndent),{type:`listItem`,checked:e.attrs.checked??null,spread:e.attrs.spread??!1,...Object.keys(a).length>0?{data:a}:{},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&&(c.sourceDashCounts=s);let l=e.attrs.sourceOuterPipes;typeof l==`object`&&l&&typeof l.leading==`boolean`&&typeof l.trailing==`boolean`&&(c.sourceOuterPipes=l);let u=e.attrs.sourceAlignmentPadding;Array.isArray(u)&&u.length>0&&(c.sourceAlignmentPadding=u);let d=Object.keys(c).length>0?c:void 0,f={type:`table`,align:i,children:o};return d&&(f.data=d),f}),r.tableRow&&(t.tableRow=TH(`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=TH(`tableCell`,a)),r.tableHeader&&(t.tableHeader=TH(`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!eae(e)&&e.attrs.sourceRaw?{type:`mdxJsxFlowElement`,name:r,attributes:i,children:[],data:{sourceRaw:String(e.attrs.sourceRaw)}}:H8.getOrWildcard(r??`*`).serialize(e,{all:e=>n.all(e),registry:H8,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;if(typeof n==`string`&&n.length>0)return{type:`mdxJsxTextElement`,name:`InlineMath`,attributes:[{type:`mdxJsxAttribute`,name:`formula`,value:t},{type:`mdxJsxAttribute`,name:`id`,value:n}],children:[]};let r=e.attrs.sourceDelimiter;return{type:`inlineMath`,value:t,...typeof r==`string`&&r.length>0?{data:{sourceDelimiter:r}}:{}}}),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,sourceTarget:typeof e.attrs.sourceTarget==`string`?e.attrs.sourceTarget:null,sourceAnchor:typeof e.attrs.sourceAnchor==`string`?e.attrs.sourceAnchor:null,sourceAlias:typeof e.attrs.sourceAlias==`string`?e.attrs.sourceAlias:null},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=EH(`emphasis`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),i.strong&&(n.strong=EH(`strong`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),i.code&&(n.code=(e,t,n)=>{let r=e.attrs.sourceFenceChar,i=e.attrs.sourceFenceLength;return W8(n,{sourceFenceChar:r,sourceFenceLength:i,sourcePadded:e.attrs.sourcePadded===!0?!0:void 0})}),i.strike??i.delete){let e=i.strike?`strike`:`delete`;n[e]=EH(`delete`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter===`~`?`~`:`~~`}}))}return i.highlight&&(n.highlight=EH(`mark`)),i.comment&&(n.comment=EH(`comment`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`}}))),r.commentBlock&&(t.commentBlock=TH(`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=TH(`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??``,r=typeof e.attrs.anchor==`string`&&e.attrs.anchor.length>0?e.attrs.anchor:null,i=typeof e.attrs.alias==`string`&&e.attrs.alias.length>0?e.attrs.alias:null,a=i||(r?`${t}#${r}`:t),o=n.map(e=>`value`in e&&typeof e.value==`string`?e.value:``).join(``);return o!==a&&o.trim().length>0&&!o.includes(`]]`)&&(i=o,a=o),{type:`wikiLinkEmbed`,value:a,data:{target:t,anchor:r,alias:i},children:[{type:`text`,value:a}]}}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.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 T1(t,e.value)&&(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 aae=/\p{M}+/gu,oae=/[^\p{L}\p{N}]+/gu,sae=/^-+|-+$/g;function K8(e){return e.trim().normalize(`NFKD`).replace(aae,``).toLowerCase().replace(oae,`-`).replace(sae,``)}function cae(e,t){let n=t.get(e)??0;return t.set(e,n+1),n===0?e:`${e}-${n}`}function lae(e,t){let n=K8(e);return n?cae(n,t):``}function q8(e,t){let n=K8(e);return t?`#${n}-${K8(t)}`:`#${n}`}var J8=new Set([`img`,`video`,`audio`,`mark`]),uae=new Map(M4.flatMap(e=>e.surface===`compat`&&J8.has(e.rendersAs)?[[e.name,e]]:[]));function Y8(e){let t={};for(let n of e.attributes){if(n.type!==`mdxJsxAttribute`)return null;let e=n.name.toLowerCase();if(!(e.length>=3&&e.startsWith(`on`)))if(n.value===null)t[n.name]=!0;else if(typeof n.value==`string`)t[n.name]=n.value;else return null}return t}function X8(e){let t=e.name;if(!t||!J8.has(t))return null;let n=Y8(e);return n===null?null:{type:`element`,tagName:t,properties:n,children:[]}}function Z8(e){let t=e.name;if(!t)return null;let n=uae.get(t);if(!n)return null;let r=Y8(e);if(r===null)return null;let i=n.translateProps(r),a={};for(let[e,t]of Object.entries(i))(typeof t==`string`||typeof t==`boolean`)&&(a[e]=t);return{type:`element`,tagName:n.rendersAs,properties:a,children:[]}}var dae=(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:q8(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},fae=(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:q8(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},pae=(e,t)=>{let n=t,r=X8(n);if(r)return n.children.length>0&&(r.children=e.all(n)),e.patch(t,r),e.applyData(t,r);let i=Z8(n);if(i){e.patch(t,i);let n=e.applyData(t,i);return n.tagName===`img`?{type:`element`,tagName:`p`,properties:{},children:[n]}:n}let a={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,a),e.applyData(t,a)},mae=(e,t)=>{let n=t,r=X8(n);if(r)return n.children.length>0&&(r.children=e.all(n)),e.patch(t,r),e.applyData(t,r);let i=Z8(n);if(i)return e.patch(t,i),e.applyData(t,i);let a={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,a),e.applyData(t,a)},hae=(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)]},gae=(e,t)=>{let n={type:`element`,tagName:`mark`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)};function Q8(e){if(typeof e!=`object`||!e)return``;let t=e;return typeof t.value==`string`?t.value:Array.isArray(t.children)?t.children.map(Q8).join(``):``}var $8={wikiLink:dae,wikiLinkEmbed:fae,mdxJsxFlowElement:pae,mdxJsxTextElement:mae,rawMdxFallback:hae,mark:gae,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:Q8(t).replace(/--/g,`—`)};return e.patch(t,n),e.applyData(t,n)},commentBlock:(e,t)=>{let n={type:`comment`,value:Q8(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)}},_ae=/url\s*\(\s*['"]?\s*(?:javascript|vbscript|data)\s*:/i,vae=/\bexpression\s*\(/i,yae=1e4;function bae(e){return!(e.length>yae||_ae.test(e)||vae.test(e))}function e5(e){for(let t of e.split(`,`)){let e=t.trim();if(e!==``&&!Y$(e.split(/\s+/)[0]??``))return!1}return!0}var xae={a:[`href`,`title`],img:[`src`,`alt`,`title`],video:[`src`,`title`],audio:[`src`,`title`],code:[`className`]},Sae=new Set([`href`,`src`]),Cae=jz(`<>`),t5=()=>e=>{aP(e,`element`,e=>{let t=xae[e.tagName.toLowerCase()],n=e.properties;if(!(!t||!n))for(let e of t){let t=n[e];if(Array.isArray(t)){let r=t.map(e=>typeof e==`string`?X3(e):e);r.some((e,n)=>e!==t[n])&&(n[e]=r);continue}if(typeof t!=`string`)continue;let r;if(Sae.has(e))if(t===`<>`||t===Cae)r=``;else{let e=X3(t);r=e===t?t:jz(e)}else r=X3(t);r!==t&&(n[e]=r)}})},n5=()=>e=>{aP(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`&&!Y$(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`&&!Y$(e)&&delete n.src}if(t===`form`){let e=n.action;typeof e==`string`&&!Y$(e)&&delete n.action}if(t===`img`||t===`source`){let e=n.srcSet;typeof e==`string`&&!e5(e)&&delete n.srcSet;let t=n.srcset;typeof t==`string`&&!e5(t)&&delete n.srcset}if(t===`video`){let e=n.poster;typeof e==`string`&&!Y$(e)&&delete n.poster}let r=n.style;typeof r==`string`&&!bae(r)&&delete n.style})};function wae(e){let t=XV().use(bq,{handlers:$8}).use(t5).use(n5).use(NK),n=t.runSync(e);return String(t.stringify(n))}function Tae(e){let t=XV().use(JU).use(qH,[`yaml`]).use(d8).use(VV).use(T8).use(bq,{handlers:$8}).use(t5).use(n5).use(NK);return String(t.processSync(e))}FG(),JW(),YW(),N({docName:v0,summary:b0,content:A().optional(),...y0}).loose(),N({docName:v0,summary:b0,markdown:A(),position:P([`append`,`prepend`,`replace`]).optional(),extension:P([`.md`,`.mdx`]).optional(),...y0}).loose(),N({docName:v0,summary:b0,find:A().min(1),replace:A(),offset:j().int().nonnegative().optional(),...y0}).loose(),N({docName:v0,connectionId:A().min(1),scope:P([`last`,`session`,`file`]).optional(),...y0}).loose();var r5=N({value:A(),truncatedFrom:j().int().nonnegative().optional(),hint:A().optional()}).loose(),Eae=Za(`kind`,[N({kind:F(`inline`),content:A()}),N({kind:F(`truncated`),byteLength:j().int().nonnegative(),hint:A()})]),i5=N({kind:F(`content-divergence`),intendedBytes:j().int().nonnegative(),actualBytes:j().int().nonnegative(),byteDelta:j().int(),divergenceType:A().optional(),currentState:Eae.optional(),hint:A().optional()}).loose(),Dae=N({type:F(`orphan`),parentCandidates:M(A()),message:A()}).loose(),a5=N({kind:F(`disk-edit-reconciled`),intendedBytes:j().int().nonnegative(),actualBytes:j().int().nonnegative(),byteDelta:j().int(),mergeOutcome:A().optional(),hint:A().optional()}).loose(),o5=Za(`kind`,[i5,a5]),s5=M(Za(`kind`,[i5,a5,N({kind:F(`mermaid-parse-error`),fenceIndex:j().int().positive(),fenceFirstLine:A(),message:A(),line:j().int().positive().optional()}).loose()])).min(1);N({timestamp:A().min(1),summary:r5.optional(),warning:o5.optional(),warnings:s5.optional()}).loose(),N({timestamp:A().min(1),subscriberCount:j().int().nonnegative(),systemSubscriberCount:j().int().nonnegative(),hints:M(Dae).optional(),summary:r5.optional(),warning:o5.optional(),warnings:s5.optional()}).loose(),N({timestamp:A().min(1),subscriberCount:j().int().nonnegative(),systemSubscriberCount:j().int().nonnegative(),summary:r5.optional(),warning:o5.optional(),warnings:s5.optional()}).loose(),N({docName:A().min(1),scope:P([`last`,`session`]),undone:Ra()}).loose(),N({docName:v0,patch:eo(A(),Ya([mZ,Ba()])),types:eo(A(),P(dZ)).optional(),summary:b0,...y0}).loose(),N({timestamp:A().min(1),subscriberCount:j().int().nonnegative(),systemSubscriberCount:j().int().nonnegative(),appliedKeys:M(A()),summary:r5.optional(),warning:o5.optional(),warnings:s5.optional()}).loose(),N({entries:M(N({level:P([`info`,`warn`,`error`]),message:A().max(V0),event:A().optional(),fields:eo(A(),Ha()).optional(),ts:j().optional(),sourceId:A().optional(),lineNumber:j().optional()}).loose()).max(100)}).loose(),N({accepted:j().int().min(0)}).loose();var Oae=N({status:A().min(1),reason:A()}).loose();N({docName:A().min(1),content:A(),lifecycle:Oae.nullable()}).loose();var c5=N({kind:P([`document`,`asset`,`folder`]).default(`document`),docName:A().min(1).optional(),docExt:A().min(1).default(`.md`),size:j().int().nonnegative(),modified:A().min(1),isSymlink:Ra().default(!1),canonicalDocName:A().nullable().default(null),targetPath:A().nullable().default(null),path:A().min(1).optional(),assetExt:A().min(1).optional(),mediaKind:P([`image`,`video`,`audio`,`pdf`,`text`]).nullable().optional(),referencedBy:M(A().min(1)).optional(),hasChildren:Ra().optional()}).loose().refine(e=>e.kind===`document`?e.docName!==void 0&&e.path===void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0&&e.hasChildren===void 0:e.kind===`folder`?e.docName===void 0&&e.path!==void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0:e.path!==void 0&&e.assetExt!==void 0&&e.referencedBy!==void 0&&e.hasChildren===void 0,{message:`document/asset/folder kind must match its required fields (document → docName; asset → path+assetExt+referencedBy; folder → path only, no docName)`}),kae=N({documents:M(c5),truncated:Ra().optional()}).loose(),Aae=N({source:A().min(1),anchor:A().nullable(),title:A(),snippet:A().nullable()}).loose(),jae=N({docName:A().min(1),backlinks:M(Aae)}).loose();N({counts:eo(A().min(1),j().int().nonnegative())}).loose();var Mae=Za(`kind`,[N({kind:F(`doc`),docName:A().min(1),anchor:A().nullable(),title:A(),snippet:A().nullable()}).loose(),N({kind:F(`external`),url:A().min(1),title:A(),snippet:A().nullable()}).loose()]),Nae=N({docName:A().min(1),forwardLinks:M(Mae)}).loose(),Pae=Za(`kind`,[N({id:A().min(1),kind:F(`doc`),docName:A().min(1),anchor:A().nullable(),label:A(),cluster:A().nullable(),category:A().nullable(),tags:M(A()).nullable()}).loose(),N({id:A().min(1),kind:F(`external`),url:A().min(1),label:A()}).loose()]),Fae=N({source:A().min(1),target:A().min(1)}).loose(),Iae=N({nodes:M(Pae),links:M(Fae)}).loose(),Lae=N({ts:j().int().min(0),url:A(),method:A(),ua:A().optional(),origin:A().optional(),referer:A().optional(),host:A().optional(),remote:A().optional(),secChUa:A().optional(),secChUaMobile:A().optional(),secChUaPlatform:A().optional(),secFetchSite:A().optional(),secFetchDest:A().optional(),secFetchMode:A().optional(),secFetchUser:A().optional()}).loose(),Rae=N({app:Ya([F(`cursor`),F(`codex`),F(`claude`),Ba()]),signals_fired:M(A())}).loose();N({entries:M(Lae),count:j().int().min(0),detection:Rae}).loose(),N({writers:M(N({id:A().min(1),name:A().optional(),email:A().optional()}).loose()).optional(),summary:b0,...y0}).loose(),N({checkpointRef:A().min(1)}).loose();var zae=N({v:j().int().optional(),id:A().min(1),name:A().min(1),colorSeed:A().optional(),docs:M(A()),summaries:M(A()).optional()}).loose();N({entries:M(N({sha:A().min(1),timestamp:A().min(1),author:A(),authorEmail:A(),type:P([`checkpoint`,`wip`,`upstream`,`park`]),message:A(),contributors:M(zae),checkpoint:Ha().nullable()}).loose()),total:j().int().nonnegative().optional(),truncated:Ra().optional(),hasMore:Ra().optional()}).loose(),N({sha:A().regex(/^[0-9a-f]{40}$/i),content:A(),timestamp:A(),author:A()}).loose();var Bae=N({contentDir:A().min(1),pathSeparator:P([`/`,`\\`]),symlinkResolved:Ra()}).loose();M(Za(`source`,[N({docName:A().min(1),timestamp:A().min(1),size:j().int().nonnegative(),source:F(`flat`)}).loose(),N({docName:A().min(1),timestamp:A().min(1),source:F(`timeline`),sha:A().min(1)}).loose()])).meta({description:"Flat array of rescue buffer entries; discriminated via `source`."});var Vae=N({orphans:M(N({docName:A().min(1),title:A()}).loose())}).loose(),Hae=N({hubs:M(N({docName:A().min(1),title:A(),count:j().int().nonnegative()}).loose())}).loose(),Uae=N({source:A().min(1),title:A(),snippet:A().nullable()}).loose();N({deadLinks:M(N({target:A().min(1),sources:M(Uae)}).loose())}).loose(),N({target:N({docName:A().min(1),title:A(),aliases:M(A())}).loose(),mentions:M(N({source:A().min(1),excerpt:A(),offset:j().int().nonnegative()}).loose()),truncated:Ra()}).loose(),N({projectPath:A().min(1)}).loose();var Wae=P([`not-a-git-worktree`,`init-failed`]);Za(`ok`,[N({ok:F(!0),projectPath:A().min(1)}).loose(),N({ok:F(!1),reason:Wae,message:A().min(1)}).loose()]),N({host:A().min(1).optional()}).loose(),N({key:A().min(1)}).loose(),N({keyPresent:Ra()}).loose(),N({name:A().refine(e=>e.trim().length>0,{message:`name must be non-empty`}),email:A().refine(e=>e.trim().length>0,{message:`email must be non-empty`})}).loose(),N({authenticated:Ra()}).loose(),N({}).loose();var Gae=N({stackIndex:j().int().min(0),ts:j().int().min(0),additions:j().int().min(0),deletions:j().int().min(0)}).loose(),Kae=N({docName:A().min(1),additionsTotal:j().int().min(0),deletionsTotal:j().int().min(0),lastTs:j().int().min(0),bursts:M(Gae)}).loose(),qae=N({displayName:A().min(1),color:A().min(1),icon:A().optional(),connectionId:A().min(1)}).loose(),Jae=N({sessionAlive:Ra(),agent:qae.nullable(),files:M(Kae)}).loose(),Yae=N({diff:A(),generatedAt:j().int().min(0)}).loose();N({}).loose(),N({}).loose(),N({}).loose(),N({}).loose(),N({}).loose(),N({}).loose();var Xae=N({displayName:A().min(1),icon:A(),color:A().min(1),currentDoc:A().nullable(),mode:P([`idle`,`writing`]),ts:j().int().min(0)}).loose();N({presence:eo(A().min(1),Xae)}).loose(),eo(A().min(1),Ra()).meta({description:`Flat boolean record keyed by agent-scheme name (claude / codex / cursor). True = installed.`}),N({path:A().min(1,`path must be non-empty`)}).loose(),N({}).loose();var Zae=N({fromDocName:A().min(1),toDocName:A().min(1)}).loose(),Qae=N({fromPath:A().min(1),toPath:A().min(1)}).loose();N({}).loose(),N({path:A().min(1),...y0,summary:b0}).loose();var $ae=N({docName:A().min(1)}).loose();N({path:A().min(1),...y0,summary:b0}).loose();var eoe=N({path:A().min(1)}).loose();N({kind:P([`file`,`folder`]),path:A().min(1),...y0,summary:b0}).loose();var toe=N({kind:P([`file`,`folder`]),path:A().min(1),duplicatedDocNames:M(A().min(1))}).loose(),noe=N({pages:M(N({docName:A().min(1),title:A(),docExt:A().min(1),size:j().int().nonnegative(),modified:A().min(1),icon:A().min(1).max(2048).optional()}).loose())}).loose(),roe=N({level:j().int().min(1).max(6),text:A(),slug:A()}).loose(),ioe=N({docName:A().min(1),headings:M(roe)}).loose(),aoe=N({docName:A().min(1),rewrites:j().int().nonnegative()}).loose();N({kind:P([`file`,`folder`,`asset`]),fromPath:A().min(1),toPath:A().min(1),...y0,summary:b0}).loose();var ooe=N({renamed:M(Zae),renamedAssets:M(Qae),rewrittenDocs:M(aoe).optional(),summary:r5.optional()}).loose();N({kind:P([`file`,`folder`,`asset`]),path:A().min(1),...y0}).loose();var soe=N({deletedDocNames:M(A().min(1))}).loose();N({kind:P([`file`,`folder`,`asset`]),path:A().min(1),...y0,summary:b0}).loose();var coe=N({deletedDocNames:M(A().min(1))}).loose();N({docName:A().min(1),commitSha:A().regex(/^[0-9a-f]{40}$/i,{message:`commitSha must be a 40-char git SHA`}),summary:b0,...y0}).loose(),N({restoredFrom:A().min(1),timestamp:A().min(1),summary:r5.optional(),warning:i5.optional(),warnings:s5.optional()}).loose();var loe=P([`dormant`,`idle`,`fetching`,`pulling`,`pushing`,`conflict`,`offline`,`auth-error`,`disabled`]),uoe=N({label:A().min(1),webUrl:Yee().nullable()}).loose(),doe=Za(`checkStatus`,[N({checkStatus:F(`allowed`)}).loose(),N({checkStatus:F(`denied`),deniedReason:P([`no-collaborator`,`private-no-access`,`repo-not-found`])}).loose(),N({checkStatus:F(`unknown`),unknownError:P([`network`,`timeout`,`rate-limit`,`token-invalid`,`malformed-response`]).optional()}).loose()]),l5=P([`auth-403`,`auth-401`,`auth-scope-mismatch`,`auth-no-credential`,`semantic-protected-branch`]);N({state:loe,lastSyncUtc:A().nullable(),lastFetchUtc:A().nullable(),lastPushedSha:A().nullable(),ahead:j().int().min(0),behind:j().int().min(0),consecutiveFailures:j().int().min(0),conflictCount:j().int().min(0),hasRemote:Ra(),syncEnabled:Ra(),identityUnresolved:Ra(),remote:uoe.nullable().optional(),pushError:A().optional(),pushErrorCode:l5.optional(),pullError:A().optional(),pullErrorCode:l5.optional(),pausedReason:A().optional(),pushPermission:doe.optional()}).loose(),N({op:P([`sync`,`push`,`pull`]).optional()}).loose(),N({op:P([`sync`,`push`,`pull`])}).loose(),N({conflicts:M(N({file:A().min(1),detectedAt:A().min(1),oursSha:A().optional(),theirsSha:A().optional(),baseSha:A().optional()}).loose())}).loose(),N({file:A().min(1),strategy:P([`mine`,`theirs`,`content`,`delete`]),content:A().optional()}).loose().refine(e=>e.strategy!==`content`||e.content!==void 0&&e.content!==``,{message:`content must be a non-empty string when strategy is 'content'`,path:[`content`]}),N({}).loose(),N({file:A().min(1),base:A(),ours:A(),theirs:A(),kind:P([`both-modified`,`delete-modify`,`modify-delete`]),lifecycleStatus:A().nullable()}).loose(),N({plan:xo(e=>e!==void 0,{message:`plan is required`})}).loose(),N({plan:xo(e=>e!==void 0,{message:`plan is required`})}).loose(),N({result:xo(e=>e!==void 0,{message:`result is required`})}).loose();var foe=N({path:A().min(1),summary:A().min(1)}).loose(),poe=N({files:j().int().nonnegative(),folders:j().int().nonnegative()}).loose();N({packs:M(N({id:A().min(1),name:A().min(1),description:A().min(1),defaultSubfolder:A().optional(),folders:M(foe),entryCounts:poe}).loose())}).loose(),N({noOpen:Ra().optional(),out:A().min(1).optional()}).loose();var moe=N({reason:P([`unsupported-platform`,`spawn-error`]),message:A()}).loose();Za(`status`,[N({status:F(`installed`),outputPath:A(),size:j().int().nonnegative(),sha256:A(),skillVersion:A()}).loose(),N({status:F(`built`),outputPath:A(),size:j().int().nonnegative(),sha256:A(),skillVersion:A(),handoffError:moe.optional()}).loose(),N({status:F(`failed`),buildError:A()}).loose(),N({status:F(`skip-current`),skillVersion:A(),recordedAt:A().optional()}).loose()]),N({tags:M(N({name:A().min(1),count:j().int().nonnegative(),isLeaf:Ra()}).loose())}).loose();var hoe=N({docName:A().min(1),title:A(),matchingTags:M(A().min(1)),snippet:A().nullable()}).loose();N({name:A().min(1),docs:M(hoe)}).loose(),N({folder:Ha(),frontmatter_local:eo(A(),Ha()).nullable()}).loose(),N({path:A(),frontmatter:eo(A(),Ha()).optional()}).loose(),N({applied:Ha()}).loose();var u5=eo(A(),Ha()).meta({description:`Free-form frontmatter map embedded in template payloads.`});N({template:N({name:A().min(1),folder:A(),scope:P([`local`,`inherited`]),path:A().min(1),frontmatter:u5,body:A()}).strict()}).strict();var goe=N({templates:M(N({name:A().min(1),title:A().optional(),description:A().optional(),path:A().min(1),source_folder:A()}).strict()),truncated:Ra()}).strict();N({folder:A(),name:A(),body:A().optional(),frontmatter:u5.optional(),...y0,summary:b0}).strict(),N({path:A().min(1),created:Ra(),warnings:M(A())}).strict(),N({existed:Ra(),path:A().min(1)}).strict(),N({fromFolder:A(),fromName:A(),toFolder:A(),toName:A(),body:A().optional(),frontmatter:u5.optional(),...y0,summary:b0}).strict(),N({from:A().min(1),to:A().min(1),committed:Ra()}).strict(),N({query:A().optional(),intent:P([`autocomplete`,`full_text`,`omnibar`]).optional(),scopes:M(P([`page`,`folder`,`content`])).optional(),scope:A().optional(),limit:j().int().nonnegative().optional(),semantic:Ra().optional(),source:P([`omnibar`,`mcp`,`http`]).optional()}).loose();var _oe=N({kind:P([`page`,`folder`,`content`]),path:A().min(1),title:A(),score:j(),signals:eo(A(),Ha()),snippet:A().optional()}).loose(),voe=N({capable:Ra(),applied:Ra(),coverage:N({embedded:j().int().nonnegative(),total:j().int().nonnegative()})}).loose();N({enabled:Ra(),keyPresent:Ra(),keySource:P([`file`,`env`]).nullable(),keyHint:A().nullable(),ready:Ra(),capable:Ra(),embedded:j().int().nonnegative(),total:j().int().nonnegative()}).loose(),N({query:A(),intent:P([`autocomplete`,`full_text`,`omnibar`]),results:M(_oe),elapsedMs:j().nonnegative(),semantic:voe.optional()}).loose();var yoe=N({version:A().min(1),recordedAt:A().min(1)}).loose();N({currentVersion:A().min(1),targets:eo(A(),yoe.nullable())}).loose();var boe=`server-info`,xoe=`branch-switched`,Soe=`disk-ack`,Coe=`config-validation-rejected`,woe=`config-ignore-nested-error`,d5=P([`files`,`backlinks`,`graph`,`sync-status`,`session-activity`,`tags`]),Toe=N({v:F(1),ch:F(boe),seq:j(),serverInstanceId:A().min(1),currentBranch:A().min(1).optional()}).loose(),Eoe=N({v:F(1),ch:F(xoe),seq:j(),branch:A().min(1)}).loose(),Doe=N({v:F(1),ch:d5,seq:j()}).loose(),Ooe=N({v:F(1),ch:F(Soe),seq:j(),docName:A().min(1),sv:A().min(1)}).loose(),koe=N({v:F(1),ch:F(Coe),seq:j(),docName:A().min(1),error:Cu}).loose(),Aoe=N({v:F(1),ch:F(woe),seq:j(),path:A().min(1),error:A().min(1)}).loose(),joe={id:`string`,kind:`enum`,path:`string`,title:`string`,name:`string`,pathSegments:`string`,content:`string`,modifiedTs:`number`},f5=new WeakMap;function Moe(e){return e===void 0||!Number.isFinite(e)?20:Math.max(1,Math.min(100,Math.trunc(e)))}function p5(e){return e.trim().toLowerCase()}function m5(e){let t=e.split(`/`).filter(Boolean);return t[t.length-1]??e}function Noe(e){return e.split(`/`).filter(Boolean).join(` `)}function Poe(e){let t=m5(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:Noe(e.path),content:e.content??``,modifiedTs:Number.isFinite(r)?r:0}}function h5(e){let t=gX({schema:joe});return e.length>0&&DX(t,e),t}function Foe(e){let t={documents:e};return f5.set(t,h5(e)),t}function Ioe(e){let t=f5.get(e);if(t)return t;let n=h5(e.documents);return f5.set(e,n),n}function Loe(e){return e===`autocomplete`?[`page`]:e===`full_text`?[`page`,`content`]:[`page`,`folder`]}function g5(e,t){return t.has(e.kind)?!0:e.kind===`page`&&t.has(`content`)}function _5(e,t){let n=p5(t);if(!n)return 0;let r=p5(e.title),i=p5(e.name),a=p5(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 Roe(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 zoe(e){return e===`full_text`?[`title`,`name`,`path`,`pathSegments`,`content`]:[`title`,`name`,`path`,`pathSegments`]}function Boe(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 Voe(e,t){return p5(t).length<4?0:+(e===`full_text`)}function Hoe(e,t,n={}){let r=n.intent??`omnibar`,i=Moe(n.limit),a=new Set(n.scopes??Loe(r)),o=e.documents.filter(e=>g5(e,a)),s=p5(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(Ioe(e),{term:s,properties:zoe(r),boost:Boe(r),tolerance:Voe(r,s),limit:Math.max(i*4,40)}),l=new Map(c.hits.filter(e=>g5(e.document,a)).map(e=>[e.document.id,e.score])),u=Roe(o),d=new Map;for(let e of o)_5(e,s)>=0&&d.set(e.id,e);for(let e of c.hits)g5(e.document,a)&&d.set(e.document.id,e.document);return n.semantic?Uoe({scopedDocuments:o,candidates:d,fullTextScores:l,recency:u,normalizedQuery:s,semantic:n.semantic,limit:i}):[...d.values()].map(e=>{let t=Math.max(0,_5(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)}function v5(e){let t=new Map;return e.forEach((e,n)=>{t.set(e,n+1)}),t}function Uoe(e){let{scopedDocuments:t,candidates:n,fullTextScores:r,recency:i,normalizedQuery:a,semantic:o,limit:s}=e,c=o.rrfK??60,l=o.candidateLimit??64,u=o.similarityFloor??0,d=o.scores,f=new Map(t.map(e=>[e.id,e])),p=[...d.entries()].filter(([e,t])=>t>=u&&f.has(e)).sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0])).slice(0,l);for(let[e]of p)if(!n.has(e)){let t=f.get(e);t&&n.set(e,t)}let m=[...n.values()].map(e=>{let t=Math.max(0,_5(e,a)),n=r.get(e.id)??0,o=i.get(e.id)??0,s=d.get(e.id),c=s!==void 0&&s>=u;return{document:e,score:t+n*20+o,signals:c?{lexical:t,fullText:n,recency:o,vector:s}:{lexical:t,fullText:n,recency:o},lexical:t,fullText:n,recency:o,cosine:s}}),h=v5(m.filter(e=>e.fullText>0).sort((e,t)=>t.fullText-e.fullText||e.document.path.localeCompare(t.document.path)).map(e=>e.document.id)),g=v5(m.filter(e=>e.cosine!==void 0&&e.cosine>=u).sort((e,t)=>t.cosine-e.cosine||e.document.path.localeCompare(t.document.path)).map(e=>e.document.id)),_=e=>{let t=0,n=h.get(e);n!==void 0&&(t+=1/(c+n));let r=g.get(e);return r!==void 0&&(t+=1/(c+r)),t};return m.sort((e,t)=>{let n=+(e.lexical>0),r=+(t.lexical>0);if(n!==r)return r-n;if(n===1)return e.score===t.score?e.document.path.localeCompare(t.document.path):t.score-e.score;let i=_(e.document.id),a=_(t.document.id);return i===a?e.recency===t.recency?e.document.path.localeCompare(t.document.path):t.recency-e.recency:a-i}).map(({document:e,score:t,signals:n})=>({document:e,score:t,signals:n})).slice(0,s)}function Woe(e){return`https://github.com/${e.owner}/${e.repo}.git`}var y5=Symbol.for(`@inkeep/open-knowledge/skill-state-field-registry`),b5=globalThis;b5[y5]===void 0&&(b5[y5]=Lr());var x5=b5[y5],S5=qa({version:A().regex(/^\d+\.\d+\.\d+(?:[-+][\w.-]+)?$/,`version must match /^\\d+\\.\\d+\\.\\d+(?:[-+][\\w.-]+)?$/`).register(x5,{description:`Recorded skill version for this target.`}),recordedAt:Xi().register(x5,{description:`ISO 8601 timestamp of the most recent successful write. Updated on every write, including reinstalls of the same version.`}),surface:P([`server-build-and-open`,`electron-build-and-open`,`cli-npx-skills-add`,`desktop-direct`,`cli-start`]).register(x5,{description:`Install-source surface that recorded this entry.`}).optional()});qa({schema:F(1).register(x5,{description:`Schema major version. Bumped only on breaking shape changes.`}),targets:qa({"claude-cowork":S5.optional(),"cli-hosts":S5.optional()}).register(x5,{description:`Per-target install-state entries. Absent target = no recorded install.`}).default({})});var C5=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 Goe(e,t,n,r,i={}){let a=i.thresholdBytes??512e3,o=i.chunkSizeBytes??51200,s=i.origin,c=i.yieldFn??Koe,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 C5(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 Koe(){return new Promise(e=>{let t=globalThis;t.document?.hidden!==!0&&typeof t.requestAnimationFrame==`function`?t.requestAnimationFrame(()=>e()):setTimeout(()=>e(),0)})}function qoe(){let e=!1,t=``,n=0;return r=>{let i=Joe(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 Joe(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 Yoe=[`#D97757`,`#1B1912`,`#F9F3E9`,`#7A9DFF`,`#8534F3`,`#9663F0`,`#727CF3`],Xoe={claude:`#D97757`,cursor:`#1B1912`,windsurf:`#0B100F`,openai:`#7A9DFF`,github:`#8534F3`,cline:`#9663F0`,bot:`#727CF3`},Zoe={cursor:`#FFFFFF`,windsurf:`#FFFFFF`},w5=[`#f0ece3`,`#fff5e1`,`#f9e1db`,`#f5def7`,`#ece2fb`,`#dce8fa`,`#DBF3FB`];function Qoe(e,t=Yoe){let n=0;for(let t of e)n=(n<<5)-n+t.charCodeAt(0)|0;return t[Math.abs(n)%t.length]}function $oe(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 ese(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 tse={"claude-code":`claude`,"claude-ai":`claude`,cursor:`cursor`,"cursor-vscode":`cursor`,cascade:`windsurf`,codex:`openai`,"codex-mcp-client":`openai`,copilot:`github`,cline:`cline`};function nse(e){return e?tse[e]||(e.startsWith(`local-agent-mode-`)?`claude`:`bot`):`bot`}function rse(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 ise(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 ase(e){let[t]=rse(e);return ise(t,45,32)}var ose=[`Curious`,`Brave`,`Clever`,`Swift`,`Gentle`,`Bright`,`Wise`,`Bold`,`Calm`,`Keen`],sse=[`Bird`,`Cat`,`Dog`,`Fish`,`Mouse`,`Rabbit`,`Shrimp`,`Snail`,`Squirrel`,`Turtle`],T5=`ok-user-name-v3`,E5=`ok-user-color-v3`;function D5(e){return e[Math.floor(Math.random()*e.length)]}function cse(){return`${D5(ose)} ${D5(sse)}`}function lse(){return D5(w5)}function O5(e){try{return localStorage.getItem(e)}catch{return null}}function k5(e,t){try{localStorage.setItem(e,t)}catch{}}function use(){let e=new URLSearchParams(window.location.search).get(`coeditor`)||`standalone`,t=crypto.randomUUID(),n=O5(T5),r=O5(E5);return n||(n=cse(),k5(T5,n)),r||(r=lse(),k5(E5,r)),{name:n,color:r,coeditor:e,tabId:t}}function dse(e,t){let n=e.trim();if(!n||/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n)||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=l.startsWith(`/`),d=u?l.slice(1):l,f=u?[]:t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of d.split(`/`))if(e===`..`){if(f.length===0)return null;f.pop()}else e!==`.`&&e!==``&&f.push(e);return f.length===0?null:{docName:f.join(`/`),anchor:a||null}}function fse(e){throw Error(`Unhandled ClassifiedLinkTarget variant: ${JSON.stringify(e)}`)}var A5=/^[a-zA-Z][a-zA-Z\d+\-.]*:/;function j5(e){let t=(e.split(/[?#]/)[0]??e).match(/\.([a-z0-9]+)$/i);return t?(t[1]??``).toLowerCase():null}function M5(e){return e.split(`/`).filter(Boolean)}function N5(e){let t=e.trim();return A5.test(t)||t.startsWith(`//`)}function pse(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}if(N5(n))return{kind:`external`,url:n};let r=dse(n,t);if(r)return{kind:`doc`,docName:r.docName,anchor:r.anchor};let i=j5(n);return i&&i!==`md`&&i!==`mdx`?{kind:`asset`,url:n,ext:i}:null}function mse(e,t){let n=e.trim();if(!n)return null;if(N5(n))return{kind:`external`,url:t?`${n}#${t}`:n};let r=j5(n);return r&&r!==`md`&&r!==`mdx`?{kind:`asset`,url:n,ext:r}:{kind:`doc`,docName:n,anchor:t?.trim()||null}}function hse(e,t){let n=e.trim();if(!n||A5.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 gse(e,t,n=null){let r=M5(e);r.pop();let i=M5(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 _se(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 vse(e){return e.replace(/[/\\:*?"<>|\0]/g,`-`).replace(/\s+/g,` `).replace(/-+/g,`-`).trim().replace(/^[-.\s]+|[-.\s]+$/g,``)}var P5=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`}),yse=`VisuallyHidden`,F5=E.forwardRef((e,t)=>(0,wo.jsx)(m.span,{...e,ref:t,style:{...P5,...e.style}}));F5.displayName=yse;var bse=F5,I5=[`top`,`right`,`bottom`,`left`],L5=[`start`,`end`],R5=I5.reduce((e,t)=>e.concat(t,t+`-`+L5[0],t+`-`+L5[1]),[]),z5=Math.min,B5=Math.max,V5=Math.round,H5=Math.floor,U5=e=>({x:e,y:e}),xse={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function W5(e,t,n){return B5(e,z5(t,n))}function G5(e,t){return typeof e==`function`?e(t):e}function K5(e){return e.split(`-`)[0]}function q5(e){return e.split(`-`)[1]}function J5(e){return e===`x`?`y`:`x`}function Y5(e){return e===`y`?`height`:`width`}function X5(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Z5(e){return J5(X5(e))}function Q5(e,t,n){n===void 0&&(n=!1);let r=q5(e),i=Z5(e),a=Y5(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=n7(o)),[o,n7(o)]}function Sse(e){let t=n7(e);return[$5(e),t,$5(t)]}function $5(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var e7=[`left`,`right`],t7=[`right`,`left`],Cse=[`top`,`bottom`],wse=[`bottom`,`top`];function Tse(e,t,n){switch(e){case`top`:case`bottom`:return n?t?t7:e7:t?e7:t7;case`left`:case`right`:return t?Cse:wse;default:return[]}}function Ese(e,t,n,r){let i=q5(e),a=Tse(K5(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map($5)))),a}function n7(e){let t=K5(e);return xse[t]+e.slice(t.length)}function Dse(e){return{top:0,right:0,bottom:0,left:0,...e}}function r7(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Dse(e)}function i7(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 a7(e,t,n){let{reference:r,floating:i}=e,a=X5(t),o=Z5(t),s=Y5(o),c=K5(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(q5(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 Ose(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}=G5(t,e),p=r7(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=i7(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=i7(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 kse=50,Ase=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Ose},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=a7(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<kse&&(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}=a7(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},jse=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}=G5(e,t)||{};if(l==null)return{};let d=r7(u),f={x:n,y:r},p=Z5(i),m=Y5(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=z5(d[_],T),ee=z5(d[v],T),te=E,ne=C-h[m]-ee,re=C/2-h[m]/2+w,ie=W5(te,re,ne),ae=!c.arrow&&q5(i)!=null&&re!==ie&&a.reference[m]/2-(re<te?E:ee)-h[m]/2<0,D=ae?re<te?re-te:re-ne:0;return{[p]:f[p]+D,data:{[p]:ie,centerOffset:re-ie-D,...ae&&{alignmentOffset:D}},reset:ae}}});function Mse(e,t,n){return(e?[...n.filter(t=>q5(t)===e),...n.filter(t=>q5(t)!==e)]:n.filter(e=>K5(e)===e)).filter(n=>e?q5(n)===e||(t?$5(n)!==n:!1):!0)}var Nse=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=R5,autoAlignment:u=!0,...d}=G5(e,t),f=c!==void 0||l===R5?Mse(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=Q5(h,n,await(a.isRTL==null?void 0:a.isRTL(o.floating)));if(i!==h)return{reset:{placement:f[0]}};let _=[p[K5(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=q5(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,q5(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}}}}},Pse=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}=G5(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=K5(r),_=X5(o),v=K5(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[n7(o)]:Sse(o)),x=p!==`none`;!d&&x&&b.push(...Ese(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=Q5(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`&&_!==X5(t))||T.every(e=>X5(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=X5(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 o7(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function s7(e){return I5.some(t=>e[t]>=0)}var Fse=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=G5(e,t);switch(i){case`referenceHidden`:{let e=o7(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:s7(e)}}}case`escaped`:{let e=o7(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:s7(e)}}}default:return{}}}}};function c7(e){let t=z5(...e.map(e=>e.left)),n=z5(...e.map(e=>e.top)),r=B5(...e.map(e=>e.right)),i=B5(...e.map(e=>e.bottom));return{x:t,y:n,width:r-t,height:i-n}}function Ise(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=>i7(c7(e)))}var Lse=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}=G5(e,t),u=Array.from(await(a.getClientRects==null?void 0:a.getClientRects(r.reference))||[]),d=Ise(u),f=i7(c7(u)),p=r7(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(X5(n)===`y`){let e=d[0],t=d[d.length-1],r=K5(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=K5(n)===`left`,t=B5(...d.map(e=>e.right)),r=z5(...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}}:{}}}},l7=new Set([`left`,`top`]);async function Rse(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=K5(n),s=q5(n),c=X5(n)===`y`,l=l7.has(o)?-1:1,u=a&&c?-1:1,d=G5(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 zse=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 Rse(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}}}}},Bse=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}=G5(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=X5(K5(i)),p=J5(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=W5(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=W5(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}}}}}},Vse=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}=G5(e,t),u={x:n,y:r},d=X5(i),f=J5(d),p=u[f],m=u[d],h=G5(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=l7.has(K5(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}}}},Hse=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}=G5(e,t),u=await o.detectOverflow(t,l),d=K5(i),f=q5(i),p=X5(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=z5(h-u[g],v),x=z5(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=B5(u.left,0),t=B5(u.right,0),n=B5(u.top,0),r=B5(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:B5(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:B5(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 u7(){return typeof window<`u`}function d7(e){return m7(e)?(e.nodeName||``).toLowerCase():`#document`}function f7(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function p7(e){return((m7(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function m7(e){return u7()?e instanceof Node||e instanceof f7(e).Node:!1}function h7(e){return u7()?e instanceof Element||e instanceof f7(e).Element:!1}function g7(e){return u7()?e instanceof HTMLElement||e instanceof f7(e).HTMLElement:!1}function _7(e){return!u7()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof f7(e).ShadowRoot}function v7(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=T7(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Use(e){return/^(table|td|th)$/.test(d7(e))}function y7(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Wse=/transform|translate|scale|rotate|perspective|filter/,Gse=/paint|layout|strict|content/,b7=e=>!!e&&e!==`none`,x7;function S7(e){let t=h7(e)?T7(e):e;return b7(t.transform)||b7(t.translate)||b7(t.scale)||b7(t.rotate)||b7(t.perspective)||!C7()&&(b7(t.backdropFilter)||b7(t.filter))||Wse.test(t.willChange||``)||Gse.test(t.contain||``)}function Kse(e){let t=D7(e);for(;g7(t)&&!w7(t);){if(S7(t))return t;if(y7(t))return null;t=D7(t)}return null}function C7(){return x7??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),x7}function w7(e){return/^(html|body|#document)$/.test(d7(e))}function T7(e){return f7(e).getComputedStyle(e)}function E7(e){return h7(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function D7(e){if(d7(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||_7(e)&&e.host||p7(e);return _7(t)?t.host:t}function O7(e){let t=D7(e);return w7(t)?e.ownerDocument?e.ownerDocument.body:e.body:g7(t)&&v7(t)?t:O7(t)}function k7(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=O7(e),i=r===e.ownerDocument?.body,a=f7(r);if(i){let e=A7(a);return t.concat(a,a.visualViewport||[],v7(r)?r:[],e&&n?k7(e):[])}else return t.concat(r,k7(r,[],n))}function A7(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function j7(e){let t=T7(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=g7(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=V5(n)!==a||V5(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function M7(e){return h7(e)?e:e.contextElement}function N7(e){let t=M7(e);if(!g7(t))return U5(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=j7(t),o=(a?V5(n.width):n.width)/r,s=(a?V5(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var qse=U5(0);function P7(e){let t=f7(e);return!C7()||!t.visualViewport?qse:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Jse(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==f7(e)?!1:t}function F7(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=M7(e),o=U5(1);t&&(r?h7(r)&&(o=N7(r)):o=N7(e));let s=Jse(a,n,r)?P7(a):U5(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=f7(a),t=r&&h7(r)?f7(r):r,n=e,i=A7(n);for(;i&&r&&t!==n;){let e=N7(i),t=i.getBoundingClientRect(),r=T7(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=f7(i),i=A7(n)}}return i7({width:u,height:d,x:c,y:l})}function I7(e,t){let n=E7(e).scrollLeft;return t?t.left+n:F7(p7(e)).left+n}function L7(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-I7(e,n),y:n.top+t.scrollTop}}function Yse(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=p7(r),s=t?y7(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=U5(1),u=U5(0),d=g7(r);if((d||!d&&!a)&&((d7(r)!==`body`||v7(o))&&(c=E7(r)),d)){let e=F7(r);l=N7(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?L7(o,c):U5(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 Xse(e){return Array.from(e.getClientRects())}function Zse(e){let t=p7(e),n=E7(e),r=e.ownerDocument.body,i=B5(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=B5(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+I7(e),s=-n.scrollTop;return T7(r).direction===`rtl`&&(o+=B5(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var R7=25;function Qse(e,t){let n=f7(e),r=p7(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=C7();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=I7(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<=R7&&(a-=o)}else l<=R7&&(a+=l);return{width:a,height:o,x:s,y:c}}function $se(e,t){let n=F7(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=g7(e)?N7(e):U5(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function z7(e,t,n){let r;if(t===`viewport`)r=Qse(e,n);else if(t===`document`)r=Zse(p7(e));else if(h7(t))r=$se(t,n);else{let n=P7(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return i7(r)}function B7(e,t){let n=D7(e);return n===t||!h7(n)||w7(n)?!1:T7(n).position===`fixed`||B7(n,t)}function ece(e,t){let n=t.get(e);if(n)return n;let r=k7(e,[],!1).filter(e=>h7(e)&&d7(e)!==`body`),i=null,a=T7(e).position===`fixed`,o=a?D7(e):e;for(;h7(o)&&!w7(o);){let t=T7(o),n=S7(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||v7(o)&&!n&&B7(e,o))?r=r.filter(e=>e!==o):i=t,o=D7(o)}return t.set(e,r),r}function tce(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?y7(t)?[]:ece(t,this._c):[].concat(n),r],o=z7(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=z7(t,a[e],i);s=B5(n.top,s),c=z5(n.right,c),l=z5(n.bottom,l),u=B5(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function nce(e){let{width:t,height:n}=j7(e);return{width:t,height:n}}function rce(e,t,n){let r=g7(t),i=p7(t),a=n===`fixed`,o=F7(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=U5(0);function l(){c.x=I7(i)}if(r||!r&&!a)if((d7(t)!==`body`||v7(i))&&(s=E7(t)),r){let e=F7(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?L7(i,s):U5(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 V7(e){return T7(e).position===`static`}function H7(e,t){if(!g7(e)||T7(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return p7(e)===n&&(n=n.ownerDocument.body),n}function U7(e,t){let n=f7(e);if(y7(e))return n;if(!g7(e)){let t=D7(e);for(;t&&!w7(t);){if(h7(t)&&!V7(t))return t;t=D7(t)}return n}let r=H7(e,t);for(;r&&Use(r)&&V7(r);)r=H7(r,t);return r&&w7(r)&&V7(r)&&!S7(r)?n:r||Kse(e)||n}var ice=async function(e){let t=this.getOffsetParent||U7,n=this.getDimensions,r=await n(e.floating);return{reference:rce(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ace(e){return T7(e).direction===`rtl`}var oce={convertOffsetParentRelativeRectToViewportRelativeRect:Yse,getDocumentElement:p7,getClippingRect:tce,getOffsetParent:U7,getElementRects:ice,getClientRects:Xse,getDimensions:nce,getScale:N7,isElement:h7,isRTL:ace};function W7(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function sce(e,t){let n=null,r,i=p7(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=H5(d),h=H5(i.clientWidth-(u+f)),g=H5(i.clientHeight-(d+p)),_=H5(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:B5(0,z5(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&&!W7(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 G7(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=M7(e),u=i||a?[...l?k7(l):[],...t?k7(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?sce(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?F7(e):null;c&&g();function g(){let t=F7(e);h&&!W7(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 K7=zse,cce=Nse,q7=Bse,J7=Pse,Y7=Hse,X7=Fse,Z7=jse,lce=Lse,uce=Vse,Q7=(e,t,n)=>{let r=new Map,i={platform:oce,...n},a={...i.platform,_c:r};return Ase(e,t,{...i,platform:a})},$7=typeof document<`u`?E.useLayoutEffect:function(){};function e9(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(!e9(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)&&!e9(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function t9(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function n9(e,t){let n=t9(e);return Math.round(t*n)/n}function r9(e){let t=E.useRef(e);return $7(()=>{t.current=e}),t}function dce(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]=E.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=E.useState(r);e9(f,r)||p(r);let[m,h]=E.useState(null),[g,_]=E.useState(null),v=E.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=E.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=E.useRef(null),C=E.useRef(null),w=E.useRef(u),T=c!=null,ee=r9(c),te=r9(i),ne=r9(l),re=E.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};te.current&&(e.platform=te.current),Q7(S.current,C.current,e).then(e=>{let t={...e,isPositioned:ne.current!==!1};ie.current&&!e9(w.current,t)&&(w.current=t,To.flushSync(()=>{d(t)}))})},[f,t,n,te,ne]);$7(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let ie=E.useRef(!1);$7(()=>(ie.current=!0,()=>{ie.current=!1}),[]),$7(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(ee.current)return ee.current(b,x,re);re()}},[b,x,re,ee,T]);let ae=E.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),D=E.useMemo(()=>({reference:b,floating:x}),[b,x]),oe=E.useMemo(()=>{let e={position:n,left:0,top:0};if(!D.floating)return e;let t=n9(D.floating,u.x),r=n9(D.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...t9(D.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,D.floating,u.x,u.y]);return E.useMemo(()=>({...u,update:re,refs:ae,elements:D,floatingStyles:oe}),[u,re,ae,D,oe])}var fce=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?{}:Z7({element:r.current,padding:i}).fn(n):r?Z7({element:r,padding:i}).fn(n):{}}}},pce=(e,t)=>{let n=K7(e);return{name:n.name,fn:n.fn,options:[e,t]}},mce=(e,t)=>{let n=q7(e);return{name:n.name,fn:n.fn,options:[e,t]}},hce=(e,t)=>({fn:uce(e).fn,options:[e,t]}),gce=(e,t)=>{let n=J7(e);return{name:n.name,fn:n.fn,options:[e,t]}},_ce=(e,t)=>{let n=Y7(e);return{name:n.name,fn:n.fn,options:[e,t]}},vce=(e,t)=>{let n=X7(e);return{name:n.name,fn:n.fn,options:[e,t]}},yce=(e,t)=>{let n=fce(e);return{name:n.name,fn:n.fn,options:[e,t]}},bce=`Arrow`,i9=E.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,wo.jsx)(m.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,wo.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});i9.displayName=bce;var xce=i9,a9=`Popper`,[o9,s9]=g(a9),[Sce,c9]=o9(a9),l9=e=>{let{__scopePopper:t,children:n}=e,[r,i]=E.useState(null);return(0,wo.jsx)(Sce,{scope:t,anchor:r,onAnchorChange:i,children:n})};l9.displayName=a9;var u9=`PopperAnchor`,d9=E.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=c9(u9,n),o=E.useRef(null),s=l(t,o),c=E.useRef(null);return E.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&a.onAnchorChange(c.current)}),r?null:(0,wo.jsx)(m.div,{...i,ref:s})});d9.displayName=u9;var f9=`PopperContent`,[Cce,wce]=o9(f9),p9=E.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:u=[],collisionPadding:d=0,sticky:f=`partial`,hideWhenDetached:p=!1,updatePositionStrategy:g=`optimized`,onPlaced:v,...b}=e,x=c9(f9,n),[S,C]=E.useState(null),w=l(t,e=>C(e)),[T,ee]=E.useState(null),te=_(T),ne=te?.width??0,re=te?.height??0,ie=r+(a===`center`?``:`-`+a),ae=typeof d==`number`?d:{top:0,right:0,bottom:0,left:0,...d},D=Array.isArray(u)?u:[u],oe=D.length>0,se={padding:ae,boundary:D.filter(Ece),altBoundary:oe},{refs:ce,floatingStyles:le,placement:ue,isPositioned:de,middlewareData:fe}=dce({strategy:`fixed`,placement:ie,whileElementsMounted:(...e)=>G7(...e,{animationFrame:g===`always`}),elements:{reference:x.anchor},middleware:[pce({mainAxis:i+re,alignmentAxis:o}),c&&mce({mainAxis:!0,crossAxis:!1,limiter:f===`partial`?hce():void 0,...se}),c&&gce({...se}),_ce({...se,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&&yce({element:T,padding:s}),Dce({arrowWidth:ne,arrowHeight:re}),p&&vce({strategy:`referenceHidden`,...se})]}),[pe,me]=g9(ue),he=h(v);y(()=>{de&&he?.()},[de,he]);let ge=fe.arrow?.x,_e=fe.arrow?.y,ve=fe.arrow?.centerOffset!==0,[ye,be]=E.useState();return y(()=>{S&&be(window.getComputedStyle(S).zIndex)},[S]),(0,wo.jsx)(`div`,{ref:ce.setFloating,"data-radix-popper-content-wrapper":``,style:{...le,transform:de?le.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ye,"--radix-popper-transform-origin":[fe.transformOrigin?.x,fe.transformOrigin?.y].join(` `),...fe.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,wo.jsx)(Cce,{scope:n,placedSide:pe,onArrowChange:ee,arrowX:ge,arrowY:_e,shouldHideArrow:ve,children:(0,wo.jsx)(m.div,{"data-side":pe,"data-align":me,...b,ref:w,style:{...b.style,animation:de?void 0:`none`}})})})});p9.displayName=f9;var m9=`PopperArrow`,Tce={top:`bottom`,right:`left`,bottom:`top`,left:`right`},h9=E.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=wce(m9,n),a=Tce[i.placedSide];return(0,wo.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,wo.jsx)(xce,{...r,ref:t,style:{...r.style,display:`block`}})})});h9.displayName=m9;function Ece(e){return e!==null}var Dce=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]=g9(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 g9(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var _9=l9,v9=d9,y9=p9,b9=h9,[x9,Oce]=g(`Tooltip`,[s9]),S9=s9(),C9=`TooltipProvider`,kce=700,w9=`tooltip.open`,[Ace,T9]=x9(C9),E9=e=>{let{__scopeTooltip:t,delayDuration:n=kce,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=E.useRef(!0),s=E.useRef(!1),c=E.useRef(0);return E.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,wo.jsx)(Ace,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:E.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:E.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:E.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};E9.displayName=C9;var D9=`Tooltip`,[jce,O9]=x9(D9),k9=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=T9(D9,e.__scopeTooltip),l=S9(t),[u,d]=E.useState(null),f=v(),m=E.useRef(0),h=o??c.disableHoverableContent,g=s??c.delayDuration,_=E.useRef(!1),[y,b]=p({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(w9))):c.onClose(),a?.(e)},caller:D9}),x=E.useMemo(()=>y?_.current?`delayed-open`:`instant-open`:`closed`,[y]),S=E.useCallback(()=>{window.clearTimeout(m.current),m.current=0,_.current=!1,b(!0)},[b]),C=E.useCallback(()=>{window.clearTimeout(m.current),m.current=0,b(!1)},[b]),w=E.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{_.current=!0,b(!0),m.current=0},g)},[g,b]);return E.useEffect(()=>()=>{m.current&&=(window.clearTimeout(m.current),0)},[]),(0,wo.jsx)(_9,{...l,children:(0,wo.jsx)(jce,{scope:t,contentId:f,open:y,stateAttribute:x,trigger:u,onTriggerChange:d,onTriggerEnter:E.useCallback(()=>{c.isOpenDelayedRef.current?w():S()},[c.isOpenDelayedRef,w,S]),onTriggerLeave:E.useCallback(()=>{h?C():(window.clearTimeout(m.current),m.current=0)},[C,h]),onOpen:S,onClose:C,disableHoverableContent:h,children:n})})};k9.displayName=D9;var A9=`TooltipTrigger`,j9=E.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=O9(A9,n),a=T9(A9,n),o=S9(n),s=l(t,E.useRef(null),i.onTriggerChange),c=E.useRef(!1),u=E.useRef(!1),f=E.useCallback(()=>c.current=!1,[]);return E.useEffect(()=>()=>document.removeEventListener(`pointerup`,f),[f]),(0,wo.jsx)(v9,{asChild:!0,...o,children:(0,wo.jsx)(m.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:d(e.onPointerMove,e=>{e.pointerType!==`touch`&&!u.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),u.current=!0)}),onPointerLeave:d(e.onPointerLeave,()=>{i.onTriggerLeave(),u.current=!1}),onPointerDown:d(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,f,{once:!0})}),onFocus:d(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:d(e.onBlur,i.onClose),onClick:d(e.onClick,i.onClose)})})});j9.displayName=A9;var M9=`TooltipPortal`,[Mce,Nce]=x9(M9,{forceMount:void 0}),N9=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=O9(M9,t);return(0,wo.jsx)(Mce,{scope:t,forceMount:n,children:(0,wo.jsx)(u,{present:n||a.open,children:(0,wo.jsx)(f,{asChild:!0,container:i,children:r})})})};N9.displayName=M9;var P9=`TooltipContent`,F9=E.forwardRef((e,t)=>{let n=Nce(P9,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=O9(P9,e.__scopeTooltip);return(0,wo.jsx)(u,{present:r||o.open,children:o.disableHoverableContent?(0,wo.jsx)(I9,{side:i,...a,ref:t}):(0,wo.jsx)(Pce,{side:i,...a,ref:t})})}),Pce=E.forwardRef((e,t)=>{let n=O9(P9,e.__scopeTooltip),r=T9(P9,e.__scopeTooltip),i=E.useRef(null),a=l(t,i),[o,s]=E.useState(null),{trigger:c,onClose:u}=n,d=i.current,{onPointerInTransitChange:f}=r,p=E.useCallback(()=>{s(null),f(!1)},[f]),m=E.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=zce(r,Rce(r,n.getBoundingClientRect())),a=Bce(t.getBoundingClientRect());s(Hce([...i,...a])),f(!0)},[f]);return E.useEffect(()=>()=>p(),[p]),E.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]),E.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=!Vce(n,o);r?p():i&&(p(),u())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,d,o,u,p]),(0,wo.jsx)(I9,{...e,ref:a})}),[Fce,Ice]=x9(D9,{isInside:!1}),Lce=b(`TooltipContent`),I9=E.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,l=O9(P9,n),u=S9(n),{onClose:d}=l;return E.useEffect(()=>(document.addEventListener(w9,d),()=>document.removeEventListener(w9,d)),[d]),E.useEffect(()=>{if(l.trigger){let e=e=>{e.target?.contains(l.trigger)&&d()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]),(0,wo.jsx)(c,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,wo.jsxs)(y9,{"data-state":l.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,wo.jsx)(Lce,{children:r}),(0,wo.jsx)(Fce,{scope:n,isInside:!0,children:(0,wo.jsx)(bse,{id:l.contentId,role:`tooltip`,children:i||r})})]})})});F9.displayName=P9;var L9=`TooltipArrow`,R9=E.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=S9(n);return Ice(L9,n).isInside?null:(0,wo.jsx)(b9,{...i,...r,ref:t})});R9.displayName=L9;function Rce(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 zce(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 Bce(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 Vce(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 Hce(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)),Uce(t)}function Uce(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 Wce=E9,Gce=k9,Kce=j9,qce=N9,Jce=F9,Yce=R9;function Xce(e){let t=(0,Eo.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,wo.jsx)(Wce,{"data-slot":`tooltip-provider`,delayDuration:i,...n}),t[3]=i,t[4]=n,t[5]=a):a=t[5],a}function Zce(e){let t=(0,Eo.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,wo.jsx)(Gce,{"data-slot":`tooltip`,...n}),t[2]=n,t[3]=r),r}function Qce(e){let t=(0,Eo.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,wo.jsx)(Kce,{"data-slot":`tooltip-trigger`,...n}),t[2]=n,t[3]=r),r}function $ce(e){let t=(0,Eo.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,wo.jsx)(Yce,{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,wo.jsx)(qce,{children:(0,wo.jsxs)(Jce,{"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 ele(e){if(e.startsWith(B9)||!e.startsWith(`#/`))return null;let t=e.slice(2),n=sle(t),r=n>=0?t.slice(0,n):t;if(!r)return null;try{return r.split(`/`).map(decodeURIComponent).join(`/`)}catch{return r}}function tle(e){if(e.startsWith(B9)||!e.startsWith(`#/`))return null;let t=e.slice(2),n=t.indexOf(`#`);if(n<0)return null;let r=t.slice(n+1);if(!r)return null;try{return decodeURIComponent(r)}catch{return r}}function nle(e,t){let n=`#/${e}`;return t?`${n}#${encodeURIComponent(t)}`:n}function rle(e){if(window.location.hash===e)return;let{pathname:t,search:n}=window.location;window.history.replaceState(null,``,`${t}${n}${e}`)}function ile(e){return e.endsWith(`.mdx`)?e.slice(0,-4):e.endsWith(`.md`)?e.slice(0,-3):e}function z9(e,t){let n=e.replace(/^\/+|\/+$/g,``),r=n?`#/${n}/`:`#/`;return t?`${r}#${encodeURIComponent(t)}`:r}function ale(e,t,n){if(e===`folder`)return z9(t);let r=`#/${encodeURIComponent(t)}`;return n==null||n===``?r:`${r}?branch=${encodeURIComponent(n)}`}function ole(e){if(e===`#/`)return!0;if(!e.startsWith(`#/`))return!1;let t=e.slice(2);return t.length>0&&t[0]===`?`}var B9=`#/__asset__/`;function sle(e){let t=e.indexOf(`?`),n=e.indexOf(`#`);return t<0?n:n<0?t:Math.min(t,n)}function cle(e){if(!e.startsWith(B9))return null;let t=e.slice(12);if(!t)return null;try{return t.split(`/`).map(decodeURIComponent).join(`/`)}catch{return t}}function lle(e){return`${B9}${e.split(`/`).map(encodeURIComponent).join(`/`)}`}function V9(e){if(typeof e!=`object`||!e)return;let t=e;if(typeof t.title==`string`&&t.title.length>0)return t.title}function ule(e){return e.kind===`asset`}function dle(e){return e.kind===`document`}function fle(e){return e.kind===`folder`}function ple(e){let t=[],n=0;for(let r of e)switch(r.kind){case`document`:if(r.docName===void 0){n+=1;break}t.push({kind:`document`,docName:r.docName,docExt:r.docExt,size:r.size,modified:r.modified,isSymlink:r.isSymlink,canonicalDocName:r.canonicalDocName,targetPath:r.targetPath});break;case`asset`:if(r.path===void 0||r.assetExt===void 0){n+=1;break}t.push({kind:`asset`,path:r.path,assetExt:r.assetExt,mediaKind:r.mediaKind??null,size:r.size,modified:r.modified,referencedBy:r.referencedBy});break;case`folder`:if(r.path===void 0){n+=1;break}t.push({kind:`folder`,path:r.path,size:r.size,modified:r.modified,hasChildren:r.hasChildren});break;default:r.kind;break}return n>0&&console.warn(`[file-tree-utils] dropped ${n} listing entries missing variant identity fields`),t}function mle(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 hle(e){if(!e)return``;let t=e.lastIndexOf(`/`);return t>0?e.slice(0,t):``}function gle(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 H9=null,U9=new Set;function W9(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 _le(e,t){return e===null?!1:e===t?!0:W9(e.pages,t.pages)&&W9(e.folderPaths,t.folderPaths)&&W9(e.assetPaths??new Set,t.assetPaths??new Set)&&vle(e.pageIcons,t.pageIcons)}function vle(e,t){if(e===t)return!0;let n=e?.size??0;if(n!==(t?.size??0))return!1;if(n===0)return!0;for(let[n,r]of e)if(t.get(n)!==r)return!1;return!0}function yle(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 ble(e,t){let n=new Map,r=[...e].sort((e,t)=>e.localeCompare(t));for(let e of r){let r=e.lastIndexOf(`/`),i=t(r===-1?e:e.slice(r+1));i&&!n.has(i)&&n.set(i,e)}return n}function xle(e){let t=new Map;for(let[n,r]of e){let e=r.icon;typeof e==`string`&&e.trim()!==``&&t.set(n,e)}return t}function Sle(){return H9}function Cle(e){if(!_le(H9,e)){H9=e;for(let t of Array.from(U9))try{t(e)}catch(e){console.error(`[page-list-cache] subscriber threw:`,e)}}}function wle(e){if(U9.add(e),H9!==null)try{e(H9)}catch(e){console.error(`[page-list-cache] subscriber threw on replay:`,e)}return()=>{U9.delete(e)}}var G9=`open-knowledge:documents-changed`,Tle=new Set(d5.options);function K9(e){return e===void 0||!Array.isArray(e)?[`files`]:[...new Set(e.filter(e=>Tle.has(e)))]}function Ele(e=[`files`]){window.dispatchEvent(new CustomEvent(G9,{detail:{channels:K9(e)}}))}function q9(e){let t=t=>{e(K9(t instanceof CustomEvent?t.detail?.channels:void 0))};return window.addEventListener(G9,t),()=>window.removeEventListener(G9,t)}var J9=`open-knowledge:branch-changed`;function Dle(e){window.dispatchEvent(new CustomEvent(J9,{detail:{branch:e}}))}function Ole(e){let t=t=>{if(!(t instanceof CustomEvent))return;let n=t.detail;e(n?.branch??null)};return window.addEventListener(J9,t),()=>window.removeEventListener(J9,t)}var Y9=`open-knowledge:templates-changed`;function kle(){window.dispatchEvent(new CustomEvent(Y9))}function Ale(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 jle(e){let t=X9(e);return t?`${t}.md`:`untitled.md`}function Mle(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 Nle(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 mle(n))t.add(e);return t}function Ple(e,t){if(!t)return;let n=K8(e);if(n)return t.get(n)}function Fle(e,t){if(!t||e.includes(`/`))return;let n=K8(e);if(n)return t.get(n)}function Ile(e,t){let{normalizedTarget:n,expectsFolder:r}=Nle(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=Ple(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;if(o&&t.pages.has(o))return{kind:`folder-index`,target:n,folderPath:n,docName:o,noteKind:`legacy-folder-note`};if(!r){let e=Fle(n,t.pagesByBasename);if(e)return{kind:`doc`,target:e,docName:e}}return(t.folderPaths??Z9(t.pages)).has(n)?{kind:`folder`,target:n,folderPath:n}:{kind:`missing`,target:n}}function Lle(e){return e.kind===`folder-index`?{kind:`folder`,target:e.folderPath,folderPath:e.folderPath}:e}function Q9(e,t,n=qQ){return typeof t!=`number`||!JQ(t,n)?null:{kind:`large-file`,target:e,docName:e,size:t,limit:n}}function Rle(e,t,n=qQ){return e.kind!==`doc`&&e.kind!==`folder-index`?e:Q9(e.docName,t.get(e.docName)?.size,n)??e}function zle(e){switch(e.kind){case`doc`:case`folder-index`:case`large-file`:return e.docName;case`missing`:return e.target;case`asset`:case`folder`:return null}}var $9=(0,E.createContext)(null);function Ble(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 Vle(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 Hle(e,t){let n=new Map(e);for(let e of t)n.has(e)||n.set(e,e);return n}async function Ule(){let e=await fetch(`/api/pages`);if(!e.ok){let t=await e.json().catch(()=>null);throw Error(V9(t)??`/api/pages responded with ${e.status}`)}let t=await e.json();return Array.isArray(t.pages)?t.pages:[]}async function Wle(){let e=await fetch(`/api/documents`);if(!e.ok){let t=await e.json().catch(()=>null);throw Error(V9(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 Gle(e){console.error(`[PageListContext] Failed to load pages:`,e)}function Kle(e){console.warn(`[PageListContext] Failed to load referenced assets:`,e)}function qle(e){let t=(0,Eo.c)(49),{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,E.useState)(r),o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=new Map,t[1]=o):o=t[1];let[s,c]=(0,E.useState)(o),l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=new Map,t[2]=l):l=t[2];let[u,d]=(0,E.useState)(l),f;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(f=new Set,t[3]=f):f=t[3];let[p,m]=(0,E.useState)(f),h;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(h=new Set,t[4]=h):h=t[4];let[g,_]=(0,E.useState)(h),v;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(v=new Set,t[5]=v):v=t[5];let[y,b]=(0,E.useState)(v),[x,S]=(0,E.useState)(!0),[C,w]=(0,E.useState)(null),T=(0,E.useRef)(0),ee;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(ee=function(){let e=T.current+=1;Promise.all([Ule(),Wle().catch(Zle)]).then(t=>{let[n,r]=t;if(e!==T.current)return;let i=new Set(n.map(Xle));a(i),c(new Map(n.map(Yle))),d(new Map(n.map(Jle))),m(new Set(r.assetPaths)),_(new Set(r.folderPaths)),b(e=>Vle(e,i)),w(null)}).catch(t=>{e===T.current&&(Gle(t),w(t instanceof Error?t.message:`Failed to load pages`))}).finally(()=>{e===T.current&&S(!1)})},t[6]=ee):ee=t[6];let te=ee,ne;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(ne=function(e){b(t=>{if(t.has(e))return t;let n=new Set(t);return n.add(e),n}),w(null)},t[7]=ne):ne=t[7];let re=ne,ie,ae;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(ae=()=>{te();let e=()=>{document.visibilityState===`visible`&&te()};window.addEventListener(`focus`,e),window.addEventListener(`visibilitychange`,e);let t=q9(e=>{e.includes(`files`)&&te()});return()=>{window.removeEventListener(`focus`,e),window.removeEventListener(`visibilitychange`,e),t()}},ie=[],t[8]=ie,t[9]=ae):(ie=t[8],ae=t[9]),(0,E.useEffect)(ae,ie);let D,oe,se,ce,le,ue,de;if(t[10]!==y||t[11]!==p||t[12]!==g||t[13]!==u||t[14]!==s||t[15]!==i){le=Ble(i,y);let e;t[23]!==y||t[24]!==s?(e=Hle(s,y),t[23]=y,t[24]=s,t[25]=e):e=t[25],ce=e,se=u,D=p,oe=new Set([...Z9(le),...g]),ue=yle(le,K8),de=ble(le,K8),t[10]=y,t[11]=p,t[12]=g,t[13]=u,t[14]=s,t[15]=i,t[16]=D,t[17]=oe,t[18]=se,t[19]=ce,t[20]=le,t[21]=ue,t[22]=de}else D=t[16],oe=t[17],se=t[18],ce=t[19],le=t[20],ue=t[21],de=t[22];let fe=de,pe;t[26]===u?pe=t[27]:(pe=xle(u),t[26]=u,t[27]=pe);let me=pe,he,ge;t[28]!==D||t[29]!==oe||t[30]!==me||t[31]!==le||t[32]!==fe||t[33]!==ue?(he=()=>{Cle({pages:le,folderPaths:oe,pagesBySlug:ue,pagesByBasename:fe,assetPaths:D,pageIcons:me})},ge=[le,oe,ue,fe,D,me],t[28]=D,t[29]=oe,t[30]=me,t[31]=le,t[32]=fe,t[33]=ue,t[34]=he,t[35]=ge):(he=t[34],ge=t[35]),(0,E.useEffect)(he,ge);let _e;t[36]!==D||t[37]!==C||t[38]!==oe||t[39]!==x||t[40]!==se||t[41]!==ce||t[42]!==le||t[43]!==fe||t[44]!==ue?(_e={pages:le,pagesBySlug:ue,pagesByBasename:fe,pageTitles:ce,pageMeta:se,folderPaths:oe,assetPaths:D,loading:x,error:C,refetch:te,addPage:re},t[36]=D,t[37]=C,t[38]=oe,t[39]=x,t[40]=se,t[41]=ce,t[42]=le,t[43]=fe,t[44]=ue,t[45]=_e):_e=t[45];let ve;return t[46]!==n||t[47]!==_e?(ve=(0,wo.jsx)($9,{value:_e,children:n}),t[46]=n,t[47]=_e,t[48]=ve):ve=t[48],ve}function Jle(e){return[e.docName,{size:e.size,modified:e.modified,docExt:e.docExt,icon:e.icon}]}function Yle(e){return[e.docName,e.title]}function Xle(e){return e.docName}function Zle(e){return Kle(e),{assetPaths:[],folderPaths:[]}}function Qle(){let e=(0,E.use)($9);if(!e)throw Error(`usePageList must be used within <PageListProvider />`);return e}function $le(){return(0,E.use)($9)}var eue=n(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),tue=n(((e,t)=>{var n=eue();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}})),nue=n(((e,t)=>{t.exports=tue()()}));export{lce as $,uu as $i,Foe as $n,vse as $r,$Q as $t,ele as A,Ny as Ai,EQ as An,N5 as Ar,soe as At,Xce as B,Bp as Bi,pse as Bn,U2 as Br,Nae as Bt,ule as C,Vy as Ci,z0 as Cn,K4 as Cr,GQ as Ct,V9 as D,Sx as Di,B1 as Dn,G4 as Dr,$ae as Dt,ple as E,ob as Ei,L1 as En,W4 as Er,eoe as Et,z9 as F,b_ as Fi,K1 as Fn,Y$ as Fr,d$ as Ft,_9 as G,Xd as Gi,Qoe as Gn,F1 as Gr,sie as Gt,v9 as H,vp as Hi,yQ as Hn,NQ as Hr,z2 as Ht,ole as I,ev as Ii,J1 as In,U1 as Ir,LQ as It,cce as J,L as Ji,e0 as Jn,W0 as Jr,KQ as Jt,s9 as K,I as Ki,t0 as Kn,Z2 as Kr,U$ as Kt,rle as L,Cp as Li,gse as Ln,e4 as Lr,CZ as Lt,ile as M,Nx as Mi,MQ as Mn,Q2 as Mr,kae as Mt,lle as N,gx as Ni,B0 as Nn,e$ as Nr,toe as Nt,tle as O,dy as Oi,Bae as On,_Z as Or,h$ as Ot,nle as P,__ as Pi,G1 as Pn,X$ as Pr,XQ as Pt,X7 as Q,wu as Qi,P4 as Qn,hse as Qr,u1 as Qt,Zce as R,B as Ri,Woe as Rn,Tae as Rr,W1 as Rt,gle as S,Py as Si,coe as Sn,U4 as Sr,HQ as St,fle as T,Wy as Ti,g$ as Tn,z4 as Tr,A$ as Tt,b9 as U,z as Ui,bQ as Un,F$ as Ur,Hae as Ut,Qce as V,R as Vi,mse as Vn,k$ as Vr,w5 as Vt,y9 as W,hf as Wi,I$ as Wn,j8 as Wr,s$ as Wt,Q7 as X,Ql as Xi,$oe as Xn,FZ as Xr,Iae as Xt,G7 as Y,au as Yi,h0 as Yn,a4 as Yr,e1 as Yt,J7 as Z,Du as Zi,qoe as Zn,PZ as Zr,Zie as Zt,q9 as _,ab as _i,O0 as _n,J4 as _r,Toe as _t,zle as a,me as aa,G0 as ai,L0 as an,j5 as ar,Zoe as at,wle as b,xx as bi,j1 as bn,V4 as br,VQ as bt,Ile as c,D as ca,qne as ci,V0 as cn,V8 as cr,u$ as ct,jle as d,Aw as di,ooe as dn,lae as dr,jae as dt,F as ea,Hoe as ei,Vae as en,Poe as er,K7 as et,X9 as f,cT as fi,K$ as fn,use as fr,Eoe as ft,Ole as g,Qb as gi,C0 as gn,nse as gr,Ooe as gt,kle as h,px as hi,I0 as hn,H2 as hr,Doe as ht,Qle as i,he as ia,K8 as ii,noe as in,R1 as ir,Xoe as it,ale as j,cb as ji,mQ as jn,bZ as jr,c5 as jt,cle as k,Hv as ki,fse as kn,JQ as kr,m$ as kt,Rle as l,Une as li,uZ as ln,ese as lr,Jae as lt,Ele as m,aT as mi,BQ as mn,zQ as mr,koe as mt,qle as n,A as na,wZ as ni,n$ as nn,QQ as nr,Y7 as nt,Lle as o,pe as oa,q8 as oi,R0 as on,lZ as or,r$ as ot,Dle as p,mT as pi,J$ as pn,I1 as pr,Aoe as pt,Z7 as q,ad as qi,$1 as qn,_se as qr,W$ as qt,$le as r,Ie as ra,H$ as ri,ioe as rn,RQ as rr,P5 as rt,Q9 as s,oe as sa,m5 as si,H0 as sn,L$ as sr,YQ as st,nue as t,N as ta,V1 as ti,t$ as tn,ase as tr,q7 as tt,Mle as u,Yw as ui,d1 as un,xZ as ur,Yae as ut,Ale as v,Lx as vi,D0 as vn,Y4 as vr,_Q as vt,dle as w,Uy as wi,c$ as wn,H4 as wr,C5 as wt,hle as x,Ane as xi,goe as xn,q4 as xr,UQ as xt,Sle as y,Px as yi,j0 as yn,B4 as yr,WQ as yt,$ce as z,Lp as zi,Goe as zn,wae as zr,H1 as zt};
|
|
516
|
+
`||e[r]===`\r`;let i=n.after.charCodeAt(0);return Number.isNaN(i)||i===10||i===13}function qie(e,t){let n=``,r=0;for(;r<e.length;){let i=e.charAt(r);if(i===`\\`){n+=e.slice(r,r+2),r+=2;continue}if(i===`*`||i===`_`||i===`~`||i===`=`){let a=r+1;for(;a<e.length&&e.charAt(a)===i;)a++;let o=r===0?t.before.charCodeAt(t.before.length-1):e.charCodeAt(r-1);if(i===`=`)n+=(Number.isNaN(o)||o===10||o===13)&&Kie(e,a,t)?`\\${e.slice(r,a)}`:e.slice(r,a);else{let s=a<e.length?e.charCodeAt(a):t.after.charCodeAt(0);n+=Gie(i,o,s)?`\\${i}`.repeat(a-r):e.slice(r,a)}r=a;continue}n+=i,r+=1}return n}function R8(e,t,n){let r=n.startsWith(`_`)?`_`:`*`,i=e,a=i.charCodeAt(0);z8(t.before.charCodeAt(t.before.length-1),a,r)&&(i=B8(a)+i.slice(1));let o=i.charCodeAt(i.length-1);return z8(t.after.charCodeAt(0),o,r)&&(i=i.slice(0,-1)+B8(o)),i}function z8(e,t,n){return!(AL(t)!==I8||n===`_`&&AL(e)===void 0)}function B8(e){return`&#x${e.toString(16).toUpperCase()};`}function Jie(e,t,n,r){let i=e.value??``,a=e.data?.sourceDelimiter,o=typeof a==`string`&&/^\$+$/.test(a)?a.length:2;for(o===1&&!Xie(i,r)&&(o=2);RegExp(`(^|[^$])${`\\$`.repeat(o)}([^$]|$)`).test(i);)o++;let s=`$`.repeat(o);/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^\$|\$$/.test(i))&&(i=` ${i} `);let c=-1;for(;++c<n.unsafe.length;){let e=n.unsafe[c];if(!e.atBreak)continue;let t=n.compilePattern(e),r;for(;(r=t.exec(i))!==null;){let e=r.index;i.codePointAt(e)===10&&i.codePointAt(e-1)===13&&e--,i=`${i.slice(0,e)} ${i.slice(r.index+1)}`}}return s+i+s}function Yie(e,t,n,r){let i=e.data?.sourceDelimiter===`~`?`~`:`~~`,a=n.createTracker(r),o=n.enter(`strikethrough`),s=a.move(i);return s+=n.containerPhrasing(e,{...a.current(),before:s,after:`~`}),s+=a.move(i),o(),s}function Xie(e,t){return!(e.length===0||!/^\S/.test(e)||!/\S$/.test(e)||/[$\r\n]/.test(e)||e.endsWith(`\\`)||/\\[!-/:-@[-`{-~]/.test(e)||/^\d/.test(t.after)||t.before.endsWith(`\\`))}function V8(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 Zie=class{schema;handlers;pmNodeHandlers;pmMarkHandlers;parseProcessor;serializeProcessor;parseCtx={current:{}};constructor(e){this.schema=Vy(e.extensions),this.handlers=rae(this.schema,this.parseCtx);let{nodeHandlers:t,markHandlers:n}=iae(this.schema);this.pmNodeHandlers=t,this.pmMarkHandlers=n,this.parseProcessor=Mie({schema:this.schema,handlers:this.handlers,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers}),this.serializeProcessor=Nie({toMarkdownHandlers:Vie})}parse(e,t){if(!e.trim())return{type:`doc`,content:[{type:`paragraph`,content:[]}]};this.parseCtx.current=t??{};try{return Fie(e,this.parseProcessor).toJSON()}finally{this.parseCtx.current={}}}parseToMdast(e){return e.trim()?Iie(e,this.parseProcessor):{type:`root`,children:[]}}parseWithFallback(e,t){return e.trim()?r3(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 Lie(t,this.serializeProcessor,{schema:this.schema,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers})}},H8=P4();function Qie(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 $ie(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 eae(e){return e.attrs.sourceDirty||$ie(e)}function tae(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 U8(e,t){if(!t)return e;let n={};return t.sourceFenceChar&&(n.sourceFenceChar=t.sourceFenceChar),typeof t.sourceFenceLength==`number`&&(n.sourceFenceLength=t.sourceFenceLength),t.sourcePadded===!0&&(n.sourcePadded=!0),Object.keys(n).length===0?e:{...e,data:n}}function W8(e,t){if(e.length===0)return U8({type:`inlineCode`,value:``},t);if(e.every(e=>e.type===`text`))return U8({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:[W8(n.children,t)]}}return U8({type:`inlineCode`,value:G8(e)},t)}function G8(e){let t=``;for(let n of e)n.type===`text`?t+=n.value:`children`in n&&Array.isArray(n.children)?t+=G8(n.children):`value`in n&&typeof n.value==`string`&&(t+=n.value);return t}var nae=s$;function rae(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=yH(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=yH(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,c=e.data?.sourceOuterPipes??null,l=e.data?.sourceAlignmentPadding??null;return n.table.createAndFill({sourceDashCounts:s,sourceOuterPipes:c,sourceAlignmentPadding:l},o.length>0?o:null)}),n.image&&(i.image=e=>{let r=e.url??``,i=j8(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=[];for(let e of s){let t=c[c.length-1];e.kind===`entity`&&t?.kind===`entity`&&t.offset+t.length===e.offset&&C1(t.raw)!==null&&b1(e.raw)?c[c.length-1]={kind:`entity`,offset:t.offset,length:t.length+e.length,raw:t.raw+e.raw}:c.push(e)}let l=[],u=0;for(let t of c){if(t.offset>u){let r=n.slice(u,t.offset).replaceAll(`\xA0`,` `);r&&l.push(e.text(r))}if(t.offset<n.length){let i=n.slice(t.offset,t.offset+t.length).replaceAll(`\xA0`,` `);if(i)if(t.kind===`escape`)l.push(e.text(i,[r.escapeMark.create()]));else if(r.sourceLiteral){let n=C1(t.raw);l.push(e.text(n??i,[r.sourceLiteral.create({sourceRaw:t.raw})]))}else l.push(e.text(i));u=t.offset+t.length}}if(u<n.length){let t=n.slice(u).replaceAll(`\xA0`,` `);t&&l.push(e.text(t))}return l.length===1?l[0]:l}),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,sourcePadded:t.data?.sourcePadded===!0})]));let a=r.strike??r.delete;if(a&&(i.delete=bH(a,e=>({sourceDelimiter:e.data?.sourceDelimiter===`~`?`~`:`~~`}))),r.highlight&&(i.mark=bH(r.highlight)),r.comment&&(i.comment=bH(r.comment,e=>({sourceForm:e.data?.sourceForm??`percent`}))),n.commentBlock&&(i.commentBlock=yH(n.commentBlock,e=>({sourceForm:e.data?.sourceForm??`percent`,sourceLayout:e.data?.sourceLayout??`block`}))),r.emphasis&&(i.emphasis=bH(r.emphasis,e=>({sourceDelimiter:e.data?.sourceDelimiter??`*`}))),r.strong&&(i.strong=bH(r.strong,e=>({sourceDelimiter:e.data?.sourceDelimiter??`**`}))),n.heading&&(i.heading=yH(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,sourceLeadingIndent:e.data?.sourceLeadingIndent??null,sourceInteriorSpacing:e.data?.sourceInteriorSpacing??null}))),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`,sourceClosingFenceLength:t.data?.sourceClosingFenceLength??null,sourceFenceIndent:t.data?.sourceFenceIndent??null,sourceInfoPadding:t.data?.sourceInfoPadding??null,sourceIndents:t.data?.sourceIndents??null},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=yH(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=yH(n.listItem,e=>({checked:e.checked??null,spread:!!e.spread,sourceMarkerSpacing:e.data?.sourceMarkerSpacing??null,sourceOrdinal:e.data?.sourceOrdinal??null,sourceCheckboxChar:e.data?.sourceCheckboxChar??null,sourceContinuationIndent:e.data?.sourceContinuationIndent??null}))),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=H8.getOrWildcard(o),c=Qie(e.attributes,s.props);if(o===`CommonMarkImage`&&typeof c.src==`string`){let e=c.src,n=j8(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,sourceTarget:e.data?.sourceTarget??null,sourceAnchor:e.data?.sourceAnchor??null,sourceAlias:e.data?.sourceAlias??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=R1(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&&nae.has(l)&&n.jsxComponent&&H8.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&&c$.has(l)&&n.jsxComponent&&H8.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&&u$.has(l)&&n.jsxComponent&&H8.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&&d$.has(l)&&n.jsxComponent&&H8.has(`WikiEmbedFile`)){let{resolveSize:e}=t.current,r=e&&d?e(o,d)??null:null,i=r===null?null:V8(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(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])}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??``,sourceDelimiter:e.data?.sourceDelimiter??null})),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=yH(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}`,unresolvedPosition:t.unresolvedPosition??!1})),n.rawMdxFallback.createAndFill({reason:`Unhandled mdast: ${t.originalType}`,originalSpan:r},t.value?[e.text(t.value)]:null)},i}function iae(e){let t={},n={},r=e.nodes,i=e.marks;r.paragraph&&(t.paragraph=TH(`paragraph`)),r.blockquote&&(t.blockquote=TH(`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=TH(`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,sourceLeadingIndent:e.attrs.sourceLeadingIndent??void 0,sourceInteriorSpacing:e.attrs.sourceInteriorSpacing??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,sourceClosingFenceLength:e.attrs.sourceClosingFenceLength??void 0,sourceFenceIndent:e.attrs.sourceFenceIndent??void 0,sourceInfoPadding:e.attrs.sourceInfoPadding??void 0,sourceIndents:e.attrs.sourceIndents??void 0}}}),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=TH(`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&&tae(r[0])?r.slice(1):r,a={};return typeof e.attrs.sourceMarkerSpacing==`number`&&(a.sourceMarkerSpacing=e.attrs.sourceMarkerSpacing),typeof e.attrs.sourceOrdinal==`number`&&(a.sourceOrdinal=e.attrs.sourceOrdinal),e.attrs.sourceCheckboxChar===`X`&&(a.sourceCheckboxChar=`X`),typeof e.attrs.sourceContinuationIndent==`number`&&(a.sourceContinuationIndent=e.attrs.sourceContinuationIndent),{type:`listItem`,checked:e.attrs.checked??null,spread:e.attrs.spread??!1,...Object.keys(a).length>0?{data:a}:{},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&&(c.sourceDashCounts=s);let l=e.attrs.sourceOuterPipes;typeof l==`object`&&l&&typeof l.leading==`boolean`&&typeof l.trailing==`boolean`&&(c.sourceOuterPipes=l);let u=e.attrs.sourceAlignmentPadding;Array.isArray(u)&&u.length>0&&(c.sourceAlignmentPadding=u);let d=Object.keys(c).length>0?c:void 0,f={type:`table`,align:i,children:o};return d&&(f.data=d),f}),r.tableRow&&(t.tableRow=TH(`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=TH(`tableCell`,a)),r.tableHeader&&(t.tableHeader=TH(`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!eae(e)&&e.attrs.sourceRaw?{type:`mdxJsxFlowElement`,name:r,attributes:i,children:[],data:{sourceRaw:String(e.attrs.sourceRaw)}}:H8.getOrWildcard(r??`*`).serialize(e,{all:e=>n.all(e),registry:H8,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;if(typeof n==`string`&&n.length>0)return{type:`mdxJsxTextElement`,name:`InlineMath`,attributes:[{type:`mdxJsxAttribute`,name:`formula`,value:t},{type:`mdxJsxAttribute`,name:`id`,value:n}],children:[]};let r=e.attrs.sourceDelimiter;return{type:`inlineMath`,value:t,...typeof r==`string`&&r.length>0?{data:{sourceDelimiter:r}}:{}}}),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,sourceTarget:typeof e.attrs.sourceTarget==`string`?e.attrs.sourceTarget:null,sourceAnchor:typeof e.attrs.sourceAnchor==`string`?e.attrs.sourceAnchor:null,sourceAlias:typeof e.attrs.sourceAlias==`string`?e.attrs.sourceAlias:null},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=EH(`emphasis`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),i.strong&&(n.strong=EH(`strong`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),i.code&&(n.code=(e,t,n)=>{let r=e.attrs.sourceFenceChar,i=e.attrs.sourceFenceLength;return W8(n,{sourceFenceChar:r,sourceFenceLength:i,sourcePadded:e.attrs.sourcePadded===!0?!0:void 0})}),i.strike??i.delete){let e=i.strike?`strike`:`delete`;n[e]=EH(`delete`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter===`~`?`~`:`~~`}}))}return i.highlight&&(n.highlight=EH(`mark`)),i.comment&&(n.comment=EH(`comment`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`}}))),r.commentBlock&&(t.commentBlock=TH(`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=TH(`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??``,r=typeof e.attrs.anchor==`string`&&e.attrs.anchor.length>0?e.attrs.anchor:null,i=typeof e.attrs.alias==`string`&&e.attrs.alias.length>0?e.attrs.alias:null,a=i||(r?`${t}#${r}`:t),o=n.map(e=>`value`in e&&typeof e.value==`string`?e.value:``).join(``);return o!==a&&o.trim().length>0&&!o.includes(`]]`)&&(i=o,a=o),{type:`wikiLinkEmbed`,value:a,data:{target:t,anchor:r,alias:i},children:[{type:`text`,value:a}]}}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.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 T1(t,e.value)&&(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 aae=/\p{M}+/gu,oae=/[^\p{L}\p{N}]+/gu,sae=/^-+|-+$/g;function K8(e){return e.trim().normalize(`NFKD`).replace(aae,``).toLowerCase().replace(oae,`-`).replace(sae,``)}function cae(e,t){let n=t.get(e)??0;return t.set(e,n+1),n===0?e:`${e}-${n}`}function lae(e,t){let n=K8(e);return n?cae(n,t):``}function q8(e,t){let n=K8(e);return t?`#${n}-${K8(t)}`:`#${n}`}var J8=new Set([`img`,`video`,`audio`,`mark`]),uae=new Map(M4.flatMap(e=>e.surface===`compat`&&J8.has(e.rendersAs)?[[e.name,e]]:[]));function Y8(e){let t={};for(let n of e.attributes){if(n.type!==`mdxJsxAttribute`)return null;let e=n.name.toLowerCase();if(!(e.length>=3&&e.startsWith(`on`)))if(n.value===null)t[n.name]=!0;else if(typeof n.value==`string`)t[n.name]=n.value;else return null}return t}function X8(e){let t=e.name;if(!t||!J8.has(t))return null;let n=Y8(e);return n===null?null:{type:`element`,tagName:t,properties:n,children:[]}}function Z8(e){let t=e.name;if(!t)return null;let n=uae.get(t);if(!n)return null;let r=Y8(e);if(r===null)return null;let i=n.translateProps(r),a={};for(let[e,t]of Object.entries(i))(typeof t==`string`||typeof t==`boolean`)&&(a[e]=t);return{type:`element`,tagName:n.rendersAs,properties:a,children:[]}}var dae=(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:q8(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},fae=(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:q8(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},pae=(e,t)=>{let n=t,r=X8(n);if(r)return n.children.length>0&&(r.children=e.all(n)),e.patch(t,r),e.applyData(t,r);let i=Z8(n);if(i){e.patch(t,i);let n=e.applyData(t,i);return n.tagName===`img`?{type:`element`,tagName:`p`,properties:{},children:[n]}:n}let a={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,a),e.applyData(t,a)},mae=(e,t)=>{let n=t,r=X8(n);if(r)return n.children.length>0&&(r.children=e.all(n)),e.patch(t,r),e.applyData(t,r);let i=Z8(n);if(i)return e.patch(t,i),e.applyData(t,i);let a={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,a),e.applyData(t,a)},hae=(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)]},gae=(e,t)=>{let n={type:`element`,tagName:`mark`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)};function Q8(e){if(typeof e!=`object`||!e)return``;let t=e;return typeof t.value==`string`?t.value:Array.isArray(t.children)?t.children.map(Q8).join(``):``}var $8={wikiLink:dae,wikiLinkEmbed:fae,mdxJsxFlowElement:pae,mdxJsxTextElement:mae,rawMdxFallback:hae,mark:gae,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:Q8(t).replace(/--/g,`—`)};return e.patch(t,n),e.applyData(t,n)},commentBlock:(e,t)=>{let n={type:`comment`,value:Q8(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)}},_ae=/url\s*\(\s*['"]?\s*(?:javascript|vbscript|data)\s*:/i,vae=/\bexpression\s*\(/i,yae=1e4;function bae(e){return!(e.length>yae||_ae.test(e)||vae.test(e))}function e5(e){for(let t of e.split(`,`)){let e=t.trim();if(e!==``&&!Y$(e.split(/\s+/)[0]??``))return!1}return!0}var xae={a:[`href`,`title`],img:[`src`,`alt`,`title`],video:[`src`,`title`],audio:[`src`,`title`],code:[`className`]},Sae=new Set([`href`,`src`]),Cae=jz(`<>`),t5=()=>e=>{aP(e,`element`,e=>{let t=xae[e.tagName.toLowerCase()],n=e.properties;if(!(!t||!n))for(let e of t){let t=n[e];if(Array.isArray(t)){let r=t.map(e=>typeof e==`string`?X3(e):e);r.some((e,n)=>e!==t[n])&&(n[e]=r);continue}if(typeof t!=`string`)continue;let r;if(Sae.has(e))if(t===`<>`||t===Cae)r=``;else{let e=X3(t);r=e===t?t:jz(e)}else r=X3(t);r!==t&&(n[e]=r)}})},n5=()=>e=>{aP(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`&&!Y$(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`&&!Y$(e)&&delete n.src}if(t===`form`){let e=n.action;typeof e==`string`&&!Y$(e)&&delete n.action}if(t===`img`||t===`source`){let e=n.srcSet;typeof e==`string`&&!e5(e)&&delete n.srcSet;let t=n.srcset;typeof t==`string`&&!e5(t)&&delete n.srcset}if(t===`video`){let e=n.poster;typeof e==`string`&&!Y$(e)&&delete n.poster}let r=n.style;typeof r==`string`&&!bae(r)&&delete n.style})};function wae(e){let t=XV().use(bq,{handlers:$8}).use(t5).use(n5).use(NK),n=t.runSync(e);return String(t.stringify(n))}function Tae(e){let t=XV().use(JU).use(qH,[`yaml`]).use(d8).use(VV).use(T8).use(bq,{handlers:$8}).use(t5).use(n5).use(NK);return String(t.processSync(e))}FG(),JW(),YW(),N({docName:v0,summary:b0,content:A().optional(),...y0}).loose(),N({docName:v0,summary:b0,markdown:A(),position:P([`append`,`prepend`,`replace`]).optional(),extension:P([`.md`,`.mdx`]).optional(),...y0}).loose(),N({docName:v0,summary:b0,find:A().min(1),replace:A(),offset:j().int().nonnegative().optional(),...y0}).loose(),N({docName:v0,connectionId:A().min(1),scope:P([`last`,`session`,`file`]).optional(),...y0}).loose();var r5=N({value:A(),truncatedFrom:j().int().nonnegative().optional(),hint:A().optional()}).loose(),Eae=Za(`kind`,[N({kind:F(`inline`),content:A()}),N({kind:F(`truncated`),byteLength:j().int().nonnegative(),hint:A()})]),i5=N({kind:F(`content-divergence`),intendedBytes:j().int().nonnegative(),actualBytes:j().int().nonnegative(),byteDelta:j().int(),divergenceType:A().optional(),currentState:Eae.optional(),hint:A().optional()}).loose(),Dae=N({type:F(`orphan`),parentCandidates:M(A()),message:A()}).loose(),a5=N({kind:F(`disk-edit-reconciled`),intendedBytes:j().int().nonnegative(),actualBytes:j().int().nonnegative(),byteDelta:j().int(),mergeOutcome:A().optional(),hint:A().optional()}).loose(),o5=Za(`kind`,[i5,a5]),s5=M(Za(`kind`,[i5,a5,N({kind:F(`mermaid-parse-error`),fenceIndex:j().int().positive(),fenceFirstLine:A(),message:A(),line:j().int().positive().optional()}).loose()])).min(1);N({timestamp:A().min(1),summary:r5.optional(),warning:o5.optional(),warnings:s5.optional()}).loose(),N({timestamp:A().min(1),subscriberCount:j().int().nonnegative(),systemSubscriberCount:j().int().nonnegative(),hints:M(Dae).optional(),summary:r5.optional(),warning:o5.optional(),warnings:s5.optional()}).loose(),N({timestamp:A().min(1),subscriberCount:j().int().nonnegative(),systemSubscriberCount:j().int().nonnegative(),summary:r5.optional(),warning:o5.optional(),warnings:s5.optional()}).loose(),N({docName:A().min(1),scope:P([`last`,`session`]),undone:Ra()}).loose(),N({docName:v0,patch:eo(A(),Ya([mZ,Ba()])),types:eo(A(),P(dZ)).optional(),summary:b0,...y0}).loose(),N({timestamp:A().min(1),subscriberCount:j().int().nonnegative(),systemSubscriberCount:j().int().nonnegative(),appliedKeys:M(A()),summary:r5.optional(),warning:o5.optional(),warnings:s5.optional()}).loose(),N({entries:M(N({level:P([`info`,`warn`,`error`]),message:A().max(V0),event:A().optional(),fields:eo(A(),Ha()).optional(),ts:j().optional(),sourceId:A().optional(),lineNumber:j().optional()}).loose()).max(100)}).loose(),N({accepted:j().int().min(0)}).loose();var Oae=N({status:A().min(1),reason:A()}).loose();N({docName:A().min(1),content:A(),lifecycle:Oae.nullable()}).loose();var c5=N({kind:P([`document`,`asset`,`folder`]).default(`document`),docName:A().min(1).optional(),docExt:A().min(1).default(`.md`),size:j().int().nonnegative(),modified:A().min(1),isSymlink:Ra().default(!1),canonicalDocName:A().nullable().default(null),targetPath:A().nullable().default(null),path:A().min(1).optional(),assetExt:A().min(1).optional(),mediaKind:P([`image`,`video`,`audio`,`pdf`,`text`]).nullable().optional(),referencedBy:M(A().min(1)).optional(),hasChildren:Ra().optional()}).loose().refine(e=>e.kind===`document`?e.docName!==void 0&&e.path===void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0&&e.hasChildren===void 0:e.kind===`folder`?e.docName===void 0&&e.path!==void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0:e.path!==void 0&&e.assetExt!==void 0&&e.referencedBy!==void 0&&e.hasChildren===void 0,{message:`document/asset/folder kind must match its required fields (document → docName; asset → path+assetExt+referencedBy; folder → path only, no docName)`}),kae=N({documents:M(c5),truncated:Ra().optional()}).loose(),Aae=N({source:A().min(1),anchor:A().nullable(),title:A(),snippet:A().nullable()}).loose(),jae=N({docName:A().min(1),backlinks:M(Aae)}).loose();N({counts:eo(A().min(1),j().int().nonnegative())}).loose();var Mae=Za(`kind`,[N({kind:F(`doc`),docName:A().min(1),anchor:A().nullable(),title:A(),snippet:A().nullable()}).loose(),N({kind:F(`external`),url:A().min(1),title:A(),snippet:A().nullable()}).loose()]),Nae=N({docName:A().min(1),forwardLinks:M(Mae)}).loose(),Pae=Za(`kind`,[N({id:A().min(1),kind:F(`doc`),docName:A().min(1),anchor:A().nullable(),label:A(),cluster:A().nullable(),category:A().nullable(),tags:M(A()).nullable()}).loose(),N({id:A().min(1),kind:F(`external`),url:A().min(1),label:A()}).loose()]),Fae=N({source:A().min(1),target:A().min(1)}).loose(),Iae=N({nodes:M(Pae),links:M(Fae)}).loose(),Lae=N({ts:j().int().min(0),url:A(),method:A(),ua:A().optional(),origin:A().optional(),referer:A().optional(),host:A().optional(),remote:A().optional(),secChUa:A().optional(),secChUaMobile:A().optional(),secChUaPlatform:A().optional(),secFetchSite:A().optional(),secFetchDest:A().optional(),secFetchMode:A().optional(),secFetchUser:A().optional()}).loose(),Rae=N({app:Ya([F(`cursor`),F(`codex`),F(`claude`),Ba()]),signals_fired:M(A())}).loose();N({entries:M(Lae),count:j().int().min(0),detection:Rae}).loose(),N({writers:M(N({id:A().min(1),name:A().optional(),email:A().optional()}).loose()).optional(),summary:b0,...y0}).loose(),N({checkpointRef:A().min(1)}).loose();var zae=N({v:j().int().optional(),id:A().min(1),name:A().min(1),colorSeed:A().optional(),docs:M(A()),summaries:M(A()).optional()}).loose();N({entries:M(N({sha:A().min(1),timestamp:A().min(1),author:A(),authorEmail:A(),type:P([`checkpoint`,`wip`,`upstream`,`park`]),message:A(),contributors:M(zae),checkpoint:Ha().nullable()}).loose()),total:j().int().nonnegative().optional(),truncated:Ra().optional(),hasMore:Ra().optional()}).loose(),N({sha:A().regex(/^[0-9a-f]{40}$/i),content:A(),timestamp:A(),author:A()}).loose();var Bae=N({contentDir:A().min(1),pathSeparator:P([`/`,`\\`]),symlinkResolved:Ra()}).loose();M(Za(`source`,[N({docName:A().min(1),timestamp:A().min(1),size:j().int().nonnegative(),source:F(`flat`)}).loose(),N({docName:A().min(1),timestamp:A().min(1),source:F(`timeline`),sha:A().min(1)}).loose()])).meta({description:"Flat array of rescue buffer entries; discriminated via `source`."});var Vae=N({orphans:M(N({docName:A().min(1),title:A()}).loose())}).loose(),Hae=N({hubs:M(N({docName:A().min(1),title:A(),count:j().int().nonnegative()}).loose())}).loose(),Uae=N({source:A().min(1),title:A(),snippet:A().nullable()}).loose();N({deadLinks:M(N({target:A().min(1),sources:M(Uae)}).loose())}).loose(),N({target:N({docName:A().min(1),title:A(),aliases:M(A())}).loose(),mentions:M(N({source:A().min(1),excerpt:A(),offset:j().int().nonnegative()}).loose()),truncated:Ra()}).loose(),N({projectPath:A().min(1)}).loose();var Wae=P([`not-a-git-worktree`,`init-failed`]);Za(`ok`,[N({ok:F(!0),projectPath:A().min(1)}).loose(),N({ok:F(!1),reason:Wae,message:A().min(1)}).loose()]),N({host:A().min(1).optional()}).loose(),N({key:A().min(1)}).loose(),N({keyPresent:Ra()}).loose(),N({name:A().refine(e=>e.trim().length>0,{message:`name must be non-empty`}),email:A().refine(e=>e.trim().length>0,{message:`email must be non-empty`})}).loose(),N({authenticated:Ra()}).loose(),N({}).loose();var Gae=N({stackIndex:j().int().min(0),ts:j().int().min(0),additions:j().int().min(0),deletions:j().int().min(0)}).loose(),Kae=N({docName:A().min(1),additionsTotal:j().int().min(0),deletionsTotal:j().int().min(0),lastTs:j().int().min(0),bursts:M(Gae)}).loose(),qae=N({displayName:A().min(1),color:A().min(1),icon:A().optional(),connectionId:A().min(1)}).loose(),Jae=N({sessionAlive:Ra(),agent:qae.nullable(),files:M(Kae)}).loose(),Yae=N({diff:A(),generatedAt:j().int().min(0)}).loose();N({}).loose(),N({}).loose(),N({}).loose(),N({}).loose(),N({}).loose(),N({}).loose();var Xae=N({displayName:A().min(1),icon:A(),color:A().min(1),currentDoc:A().nullable(),mode:P([`idle`,`writing`]),ts:j().int().min(0)}).loose();N({presence:eo(A().min(1),Xae)}).loose(),eo(A().min(1),Ra()).meta({description:`Flat boolean record keyed by agent-scheme name (claude / codex / cursor). True = installed.`}),N({path:A().min(1,`path must be non-empty`)}).loose(),N({}).loose();var Zae=N({fromDocName:A().min(1),toDocName:A().min(1)}).loose(),Qae=N({fromPath:A().min(1),toPath:A().min(1)}).loose();N({}).loose(),N({path:A().min(1),...y0,summary:b0}).loose();var $ae=N({docName:A().min(1)}).loose();N({path:A().min(1),...y0,summary:b0}).loose();var eoe=N({path:A().min(1)}).loose();N({kind:P([`file`,`folder`]),path:A().min(1),...y0,summary:b0}).loose();var toe=N({kind:P([`file`,`folder`]),path:A().min(1),duplicatedDocNames:M(A().min(1))}).loose(),noe=N({pages:M(N({docName:A().min(1),title:A(),docExt:A().min(1),size:j().int().nonnegative(),modified:A().min(1),icon:A().min(1).max(2048).optional()}).loose())}).loose(),roe=N({level:j().int().min(1).max(6),text:A(),slug:A()}).loose(),ioe=N({docName:A().min(1),headings:M(roe)}).loose(),aoe=N({docName:A().min(1),rewrites:j().int().nonnegative()}).loose();N({kind:P([`file`,`folder`,`asset`]),fromPath:A().min(1),toPath:A().min(1),...y0,summary:b0}).loose();var ooe=N({renamed:M(Zae),renamedAssets:M(Qae),rewrittenDocs:M(aoe).optional(),summary:r5.optional()}).loose();N({kind:P([`file`,`folder`,`asset`]),path:A().min(1),...y0}).loose();var soe=N({deletedDocNames:M(A().min(1))}).loose();N({kind:P([`file`,`folder`,`asset`]),path:A().min(1),...y0,summary:b0}).loose();var coe=N({deletedDocNames:M(A().min(1))}).loose();N({docName:A().min(1),commitSha:A().regex(/^[0-9a-f]{40}$/i,{message:`commitSha must be a 40-char git SHA`}),summary:b0,...y0}).loose(),N({restoredFrom:A().min(1),timestamp:A().min(1),summary:r5.optional(),warning:i5.optional(),warnings:s5.optional()}).loose();var loe=P([`dormant`,`idle`,`fetching`,`pulling`,`pushing`,`conflict`,`offline`,`auth-error`,`disabled`]),uoe=N({label:A().min(1),webUrl:Yee().nullable()}).loose(),doe=Za(`checkStatus`,[N({checkStatus:F(`allowed`)}).loose(),N({checkStatus:F(`denied`),deniedReason:P([`no-collaborator`,`private-no-access`,`repo-not-found`])}).loose(),N({checkStatus:F(`unknown`),unknownError:P([`network`,`timeout`,`rate-limit`,`token-invalid`,`malformed-response`]).optional()}).loose()]),l5=P([`auth-403`,`auth-401`,`auth-scope-mismatch`,`auth-no-credential`,`semantic-protected-branch`]);N({state:loe,lastSyncUtc:A().nullable(),lastFetchUtc:A().nullable(),lastPushedSha:A().nullable(),ahead:j().int().min(0),behind:j().int().min(0),consecutiveFailures:j().int().min(0),conflictCount:j().int().min(0),hasRemote:Ra(),syncEnabled:Ra(),identityUnresolved:Ra(),remote:uoe.nullable().optional(),pushError:A().optional(),pushErrorCode:l5.optional(),pullError:A().optional(),pullErrorCode:l5.optional(),pausedReason:A().optional(),pushPermission:doe.optional()}).loose(),N({op:P([`sync`,`push`,`pull`]).optional()}).loose(),N({op:P([`sync`,`push`,`pull`])}).loose(),N({conflicts:M(N({file:A().min(1),detectedAt:A().min(1),oursSha:A().optional(),theirsSha:A().optional(),baseSha:A().optional()}).loose())}).loose(),N({file:A().min(1),strategy:P([`mine`,`theirs`,`content`,`delete`]),content:A().optional()}).loose().refine(e=>e.strategy!==`content`||e.content!==void 0&&e.content!==``,{message:`content must be a non-empty string when strategy is 'content'`,path:[`content`]}),N({}).loose(),N({file:A().min(1),base:A(),ours:A(),theirs:A(),kind:P([`both-modified`,`delete-modify`,`modify-delete`]),lifecycleStatus:A().nullable()}).loose(),N({plan:xo(e=>e!==void 0,{message:`plan is required`})}).loose(),N({plan:xo(e=>e!==void 0,{message:`plan is required`})}).loose(),N({result:xo(e=>e!==void 0,{message:`result is required`})}).loose();var foe=N({path:A().min(1),summary:A().min(1)}).loose(),poe=N({files:j().int().nonnegative(),folders:j().int().nonnegative()}).loose();N({packs:M(N({id:A().min(1),name:A().min(1),description:A().min(1),defaultSubfolder:A().optional(),folders:M(foe),entryCounts:poe}).loose())}).loose(),N({noOpen:Ra().optional(),out:A().min(1).optional()}).loose();var moe=N({reason:P([`unsupported-platform`,`spawn-error`]),message:A()}).loose();Za(`status`,[N({status:F(`installed`),outputPath:A(),size:j().int().nonnegative(),sha256:A(),skillVersion:A()}).loose(),N({status:F(`built`),outputPath:A(),size:j().int().nonnegative(),sha256:A(),skillVersion:A(),handoffError:moe.optional()}).loose(),N({status:F(`failed`),buildError:A()}).loose(),N({status:F(`skip-current`),skillVersion:A(),recordedAt:A().optional()}).loose()]),N({tags:M(N({name:A().min(1),count:j().int().nonnegative(),isLeaf:Ra()}).loose())}).loose();var hoe=N({docName:A().min(1),title:A(),matchingTags:M(A().min(1)),snippet:A().nullable()}).loose();N({name:A().min(1),docs:M(hoe)}).loose(),N({folder:Ha(),frontmatter_local:eo(A(),Ha()).nullable()}).loose(),N({path:A(),frontmatter:eo(A(),Ha()).optional()}).loose(),N({applied:Ha()}).loose();var u5=eo(A(),Ha()).meta({description:`Free-form frontmatter map embedded in template payloads.`});N({template:N({name:A().min(1),folder:A(),scope:P([`local`,`inherited`]),path:A().min(1),frontmatter:u5,body:A()}).strict()}).strict();var goe=N({templates:M(N({name:A().min(1),title:A().optional(),description:A().optional(),path:A().min(1),source_folder:A()}).strict()),truncated:Ra()}).strict();N({folder:A(),name:A(),body:A().optional(),frontmatter:u5.optional(),...y0,summary:b0}).strict(),N({path:A().min(1),created:Ra(),warnings:M(A())}).strict(),N({existed:Ra(),path:A().min(1)}).strict(),N({fromFolder:A(),fromName:A(),toFolder:A(),toName:A(),body:A().optional(),frontmatter:u5.optional(),...y0,summary:b0}).strict(),N({from:A().min(1),to:A().min(1),committed:Ra()}).strict(),N({query:A().optional(),intent:P([`autocomplete`,`full_text`,`omnibar`]).optional(),scopes:M(P([`page`,`folder`,`content`])).optional(),scope:A().optional(),limit:j().int().nonnegative().optional(),semantic:Ra().optional(),source:P([`omnibar`,`mcp`,`http`]).optional()}).loose();var _oe=N({kind:P([`page`,`folder`,`content`]),path:A().min(1),title:A(),score:j(),signals:eo(A(),Ha()),snippet:A().optional()}).loose(),voe=N({capable:Ra(),applied:Ra(),coverage:N({embedded:j().int().nonnegative(),total:j().int().nonnegative()})}).loose();N({enabled:Ra(),keyPresent:Ra(),keySource:P([`file`,`env`]).nullable(),keyHint:A().nullable(),ready:Ra(),capable:Ra(),embedded:j().int().nonnegative(),total:j().int().nonnegative()}).loose(),N({query:A(),intent:P([`autocomplete`,`full_text`,`omnibar`]),results:M(_oe),elapsedMs:j().nonnegative(),semantic:voe.optional()}).loose();var yoe=N({version:A().min(1),recordedAt:A().min(1)}).loose();N({currentVersion:A().min(1),targets:eo(A(),yoe.nullable())}).loose();var boe=`server-info`,xoe=`branch-switched`,Soe=`disk-ack`,Coe=`config-validation-rejected`,woe=`config-ignore-nested-error`,d5=P([`files`,`backlinks`,`graph`,`sync-status`,`session-activity`,`tags`]),Toe=N({v:F(1),ch:F(boe),seq:j(),serverInstanceId:A().min(1),currentBranch:A().min(1).optional()}).loose(),Eoe=N({v:F(1),ch:F(xoe),seq:j(),branch:A().min(1)}).loose(),Doe=N({v:F(1),ch:d5,seq:j()}).loose(),Ooe=N({v:F(1),ch:F(Soe),seq:j(),docName:A().min(1),sv:A().min(1)}).loose(),koe=N({v:F(1),ch:F(Coe),seq:j(),docName:A().min(1),error:Cu}).loose(),Aoe=N({v:F(1),ch:F(woe),seq:j(),path:A().min(1),error:A().min(1)}).loose(),joe={id:`string`,kind:`enum`,path:`string`,title:`string`,name:`string`,pathSegments:`string`,content:`string`,modifiedTs:`number`},f5=new WeakMap;function Moe(e){return e===void 0||!Number.isFinite(e)?20:Math.max(1,Math.min(100,Math.trunc(e)))}function p5(e){return e.trim().toLowerCase()}function m5(e){let t=e.split(`/`).filter(Boolean);return t[t.length-1]??e}function Noe(e){return e.split(`/`).filter(Boolean).join(` `)}function Poe(e){let t=m5(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:Noe(e.path),content:e.content??``,modifiedTs:Number.isFinite(r)?r:0}}function h5(e){let t=gX({schema:joe});return e.length>0&&DX(t,e),t}function Foe(e){let t={documents:e};return f5.set(t,h5(e)),t}function Ioe(e){let t=f5.get(e);if(t)return t;let n=h5(e.documents);return f5.set(e,n),n}function Loe(e){return e===`autocomplete`?[`page`]:e===`full_text`?[`page`,`content`]:[`page`,`folder`]}function g5(e,t){return t.has(e.kind)?!0:e.kind===`page`&&t.has(`content`)}function _5(e,t){let n=p5(t);if(!n)return 0;let r=p5(e.title),i=p5(e.name),a=p5(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 Roe(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 zoe(e){return e===`full_text`?[`title`,`name`,`path`,`pathSegments`,`content`]:[`title`,`name`,`path`,`pathSegments`]}function Boe(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 Voe(e,t){return p5(t).length<4?0:+(e===`full_text`)}function Hoe(e,t,n={}){let r=n.intent??`omnibar`,i=Moe(n.limit),a=new Set(n.scopes??Loe(r)),o=e.documents.filter(e=>g5(e,a)),s=p5(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(Ioe(e),{term:s,properties:zoe(r),boost:Boe(r),tolerance:Voe(r,s),limit:Math.max(i*4,40)}),l=new Map(c.hits.filter(e=>g5(e.document,a)).map(e=>[e.document.id,e.score])),u=Roe(o),d=new Map;for(let e of o)_5(e,s)>=0&&d.set(e.id,e);for(let e of c.hits)g5(e.document,a)&&d.set(e.document.id,e.document);return n.semantic?Uoe({scopedDocuments:o,candidates:d,fullTextScores:l,recency:u,normalizedQuery:s,semantic:n.semantic,limit:i}):[...d.values()].map(e=>{let t=Math.max(0,_5(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)}function v5(e){let t=new Map;return e.forEach((e,n)=>{t.set(e,n+1)}),t}function Uoe(e){let{scopedDocuments:t,candidates:n,fullTextScores:r,recency:i,normalizedQuery:a,semantic:o,limit:s}=e,c=o.rrfK??60,l=o.candidateLimit??64,u=o.similarityFloor??0,d=o.scores,f=new Map(t.map(e=>[e.id,e])),p=[...d.entries()].filter(([e,t])=>t>=u&&f.has(e)).sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0])).slice(0,l);for(let[e]of p)if(!n.has(e)){let t=f.get(e);t&&n.set(e,t)}let m=[...n.values()].map(e=>{let t=Math.max(0,_5(e,a)),n=r.get(e.id)??0,o=i.get(e.id)??0,s=d.get(e.id),c=s!==void 0&&s>=u;return{document:e,score:t+n*20+o,signals:c?{lexical:t,fullText:n,recency:o,vector:s}:{lexical:t,fullText:n,recency:o},lexical:t,fullText:n,recency:o,cosine:s}}),h=v5(m.filter(e=>e.fullText>0).sort((e,t)=>t.fullText-e.fullText||e.document.path.localeCompare(t.document.path)).map(e=>e.document.id)),g=v5(m.filter(e=>e.cosine!==void 0&&e.cosine>=u).sort((e,t)=>t.cosine-e.cosine||e.document.path.localeCompare(t.document.path)).map(e=>e.document.id)),_=e=>{let t=0,n=h.get(e);n!==void 0&&(t+=1/(c+n));let r=g.get(e);return r!==void 0&&(t+=1/(c+r)),t};return m.sort((e,t)=>{let n=+(e.lexical>0),r=+(t.lexical>0);if(n!==r)return r-n;if(n===1)return e.score===t.score?e.document.path.localeCompare(t.document.path):t.score-e.score;let i=_(e.document.id),a=_(t.document.id);return i===a?e.recency===t.recency?e.document.path.localeCompare(t.document.path):t.recency-e.recency:a-i}).map(({document:e,score:t,signals:n})=>({document:e,score:t,signals:n})).slice(0,s)}function Woe(e){return`https://github.com/${e.owner}/${e.repo}.git`}function Goe(e,t){return!e||e.length===0?`true`:t.detached?`detached`:t.currentBranch===null||t.currentBranch===e?`true`:`false`}var y5=Symbol.for(`@inkeep/open-knowledge/skill-state-field-registry`),b5=globalThis;b5[y5]===void 0&&(b5[y5]=Lr());var x5=b5[y5],S5=qa({version:A().regex(/^\d+\.\d+\.\d+(?:[-+][\w.-]+)?$/,`version must match /^\\d+\\.\\d+\\.\\d+(?:[-+][\\w.-]+)?$/`).register(x5,{description:`Recorded skill version for this target.`}),recordedAt:Xi().register(x5,{description:`ISO 8601 timestamp of the most recent successful write. Updated on every write, including reinstalls of the same version.`}),surface:P([`server-build-and-open`,`electron-build-and-open`,`cli-npx-skills-add`,`desktop-direct`,`cli-start`]).register(x5,{description:`Install-source surface that recorded this entry.`}).optional()});qa({schema:F(1).register(x5,{description:`Schema major version. Bumped only on breaking shape changes.`}),targets:qa({"claude-cowork":S5.optional(),"cli-hosts":S5.optional()}).register(x5,{description:`Per-target install-state entries. Absent target = no recorded install.`}).default({})});var C5=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 Koe(e,t,n,r,i={}){let a=i.thresholdBytes??512e3,o=i.chunkSizeBytes??51200,s=i.origin,c=i.yieldFn??qoe,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 C5(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 qoe(){return new Promise(e=>{let t=globalThis;t.document?.hidden!==!0&&typeof t.requestAnimationFrame==`function`?t.requestAnimationFrame(()=>e()):setTimeout(()=>e(),0)})}function Joe(){let e=!1,t=``,n=0;return r=>{let i=Yoe(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 Yoe(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 Xoe=[`#D97757`,`#1B1912`,`#F9F3E9`,`#7A9DFF`,`#8534F3`,`#9663F0`,`#727CF3`],Zoe={claude:`#D97757`,cursor:`#1B1912`,windsurf:`#0B100F`,openai:`#7A9DFF`,github:`#8534F3`,cline:`#9663F0`,bot:`#727CF3`},Qoe={cursor:`#FFFFFF`,windsurf:`#FFFFFF`},w5=[`#f0ece3`,`#fff5e1`,`#f9e1db`,`#f5def7`,`#ece2fb`,`#dce8fa`,`#DBF3FB`];function $oe(e,t=Xoe){let n=0;for(let t of e)n=(n<<5)-n+t.charCodeAt(0)|0;return t[Math.abs(n)%t.length]}function ese(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 tse(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 nse={"claude-code":`claude`,"claude-ai":`claude`,cursor:`cursor`,"cursor-vscode":`cursor`,cascade:`windsurf`,codex:`openai`,"codex-mcp-client":`openai`,copilot:`github`,cline:`cline`};function rse(e){return e?nse[e]||(e.startsWith(`local-agent-mode-`)?`claude`:`bot`):`bot`}function ise(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 ase(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 ose(e){let[t]=ise(e);return ase(t,45,32)}var sse=[`Curious`,`Brave`,`Clever`,`Swift`,`Gentle`,`Bright`,`Wise`,`Bold`,`Calm`,`Keen`],cse=[`Bird`,`Cat`,`Dog`,`Fish`,`Mouse`,`Rabbit`,`Shrimp`,`Snail`,`Squirrel`,`Turtle`],T5=`ok-user-name-v3`,E5=`ok-user-color-v3`;function D5(e){return e[Math.floor(Math.random()*e.length)]}function lse(){return`${D5(sse)} ${D5(cse)}`}function use(){return D5(w5)}function O5(e){try{return localStorage.getItem(e)}catch{return null}}function k5(e,t){try{localStorage.setItem(e,t)}catch{}}function dse(){let e=new URLSearchParams(window.location.search).get(`coeditor`)||`standalone`,t=crypto.randomUUID(),n=O5(T5),r=O5(E5);return n||(n=lse(),k5(T5,n)),r||(r=use(),k5(E5,r)),{name:n,color:r,coeditor:e,tabId:t}}function fse(e,t){let n=e.trim();if(!n||/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n)||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=l.startsWith(`/`),d=u?l.slice(1):l,f=u?[]:t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of d.split(`/`))if(e===`..`){if(f.length===0)return null;f.pop()}else e!==`.`&&e!==``&&f.push(e);return f.length===0?null:{docName:f.join(`/`),anchor:a||null}}function pse(e){throw Error(`Unhandled ClassifiedLinkTarget variant: ${JSON.stringify(e)}`)}var A5=/^[a-zA-Z][a-zA-Z\d+\-.]*:/;function j5(e){let t=(e.split(/[?#]/)[0]??e).match(/\.([a-z0-9]+)$/i);return t?(t[1]??``).toLowerCase():null}function M5(e){return e.split(`/`).filter(Boolean)}function N5(e){let t=e.trim();return A5.test(t)||t.startsWith(`//`)}function mse(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}if(N5(n))return{kind:`external`,url:n};let r=fse(n,t);if(r)return{kind:`doc`,docName:r.docName,anchor:r.anchor};let i=j5(n);return i&&i!==`md`&&i!==`mdx`?{kind:`asset`,url:n,ext:i}:null}function hse(e,t){let n=e.trim();if(!n)return null;if(N5(n))return{kind:`external`,url:t?`${n}#${t}`:n};let r=j5(n);return r&&r!==`md`&&r!==`mdx`?{kind:`asset`,url:n,ext:r}:{kind:`doc`,docName:n,anchor:t?.trim()||null}}function gse(e,t){let n=e.trim();if(!n||A5.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 _se(e,t,n=null){let r=M5(e);r.pop();let i=M5(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 vse(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 yse(e){return e.replace(/[/\\:*?"<>|\0]/g,`-`).replace(/\s+/g,` `).replace(/-+/g,`-`).trim().replace(/^[-.\s]+|[-.\s]+$/g,``)}var P5=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`}),bse=`VisuallyHidden`,F5=E.forwardRef((e,t)=>(0,wo.jsx)(m.span,{...e,ref:t,style:{...P5,...e.style}}));F5.displayName=bse;var xse=F5,I5=[`top`,`right`,`bottom`,`left`],L5=[`start`,`end`],R5=I5.reduce((e,t)=>e.concat(t,t+`-`+L5[0],t+`-`+L5[1]),[]),z5=Math.min,B5=Math.max,V5=Math.round,H5=Math.floor,U5=e=>({x:e,y:e}),Sse={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function W5(e,t,n){return B5(e,z5(t,n))}function G5(e,t){return typeof e==`function`?e(t):e}function K5(e){return e.split(`-`)[0]}function q5(e){return e.split(`-`)[1]}function J5(e){return e===`x`?`y`:`x`}function Y5(e){return e===`y`?`height`:`width`}function X5(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Z5(e){return J5(X5(e))}function Q5(e,t,n){n===void 0&&(n=!1);let r=q5(e),i=Z5(e),a=Y5(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=n7(o)),[o,n7(o)]}function Cse(e){let t=n7(e);return[$5(e),t,$5(t)]}function $5(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var e7=[`left`,`right`],t7=[`right`,`left`],wse=[`top`,`bottom`],Tse=[`bottom`,`top`];function Ese(e,t,n){switch(e){case`top`:case`bottom`:return n?t?t7:e7:t?e7:t7;case`left`:case`right`:return t?wse:Tse;default:return[]}}function Dse(e,t,n,r){let i=q5(e),a=Ese(K5(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map($5)))),a}function n7(e){let t=K5(e);return Sse[t]+e.slice(t.length)}function Ose(e){return{top:0,right:0,bottom:0,left:0,...e}}function r7(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Ose(e)}function i7(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 a7(e,t,n){let{reference:r,floating:i}=e,a=X5(t),o=Z5(t),s=Y5(o),c=K5(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(q5(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 kse(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}=G5(t,e),p=r7(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=i7(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=i7(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 Ase=50,jse=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:kse},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=a7(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<Ase&&(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}=a7(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Mse=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}=G5(e,t)||{};if(l==null)return{};let d=r7(u),f={x:n,y:r},p=Z5(i),m=Y5(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=z5(d[_],T),ee=z5(d[v],T),te=E,ne=C-h[m]-ee,re=C/2-h[m]/2+w,ie=W5(te,re,ne),ae=!c.arrow&&q5(i)!=null&&re!==ie&&a.reference[m]/2-(re<te?E:ee)-h[m]/2<0,D=ae?re<te?re-te:re-ne:0;return{[p]:f[p]+D,data:{[p]:ie,centerOffset:re-ie-D,...ae&&{alignmentOffset:D}},reset:ae}}});function Nse(e,t,n){return(e?[...n.filter(t=>q5(t)===e),...n.filter(t=>q5(t)!==e)]:n.filter(e=>K5(e)===e)).filter(n=>e?q5(n)===e||(t?$5(n)!==n:!1):!0)}var Pse=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=R5,autoAlignment:u=!0,...d}=G5(e,t),f=c!==void 0||l===R5?Nse(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=Q5(h,n,await(a.isRTL==null?void 0:a.isRTL(o.floating)));if(i!==h)return{reset:{placement:f[0]}};let _=[p[K5(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=q5(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,q5(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}}}}},Fse=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}=G5(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=K5(r),_=X5(o),v=K5(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[n7(o)]:Cse(o)),x=p!==`none`;!d&&x&&b.push(...Dse(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=Q5(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`&&_!==X5(t))||T.every(e=>X5(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=X5(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 o7(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function s7(e){return I5.some(t=>e[t]>=0)}var Ise=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=G5(e,t);switch(i){case`referenceHidden`:{let e=o7(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:s7(e)}}}case`escaped`:{let e=o7(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:s7(e)}}}default:return{}}}}};function c7(e){let t=z5(...e.map(e=>e.left)),n=z5(...e.map(e=>e.top)),r=B5(...e.map(e=>e.right)),i=B5(...e.map(e=>e.bottom));return{x:t,y:n,width:r-t,height:i-n}}function Lse(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=>i7(c7(e)))}var Rse=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}=G5(e,t),u=Array.from(await(a.getClientRects==null?void 0:a.getClientRects(r.reference))||[]),d=Lse(u),f=i7(c7(u)),p=r7(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(X5(n)===`y`){let e=d[0],t=d[d.length-1],r=K5(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=K5(n)===`left`,t=B5(...d.map(e=>e.right)),r=z5(...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}}:{}}}},l7=new Set([`left`,`top`]);async function zse(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=K5(n),s=q5(n),c=X5(n)===`y`,l=l7.has(o)?-1:1,u=a&&c?-1:1,d=G5(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 Bse=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 zse(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}}}}},Vse=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}=G5(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=X5(K5(i)),p=J5(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=W5(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=W5(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}}}}}},Hse=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}=G5(e,t),u={x:n,y:r},d=X5(i),f=J5(d),p=u[f],m=u[d],h=G5(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=l7.has(K5(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}}}},Use=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}=G5(e,t),u=await o.detectOverflow(t,l),d=K5(i),f=q5(i),p=X5(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=z5(h-u[g],v),x=z5(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=B5(u.left,0),t=B5(u.right,0),n=B5(u.top,0),r=B5(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:B5(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:B5(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 u7(){return typeof window<`u`}function d7(e){return m7(e)?(e.nodeName||``).toLowerCase():`#document`}function f7(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function p7(e){return((m7(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function m7(e){return u7()?e instanceof Node||e instanceof f7(e).Node:!1}function h7(e){return u7()?e instanceof Element||e instanceof f7(e).Element:!1}function g7(e){return u7()?e instanceof HTMLElement||e instanceof f7(e).HTMLElement:!1}function _7(e){return!u7()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof f7(e).ShadowRoot}function v7(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=T7(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Wse(e){return/^(table|td|th)$/.test(d7(e))}function y7(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Gse=/transform|translate|scale|rotate|perspective|filter/,Kse=/paint|layout|strict|content/,b7=e=>!!e&&e!==`none`,x7;function S7(e){let t=h7(e)?T7(e):e;return b7(t.transform)||b7(t.translate)||b7(t.scale)||b7(t.rotate)||b7(t.perspective)||!C7()&&(b7(t.backdropFilter)||b7(t.filter))||Gse.test(t.willChange||``)||Kse.test(t.contain||``)}function qse(e){let t=D7(e);for(;g7(t)&&!w7(t);){if(S7(t))return t;if(y7(t))return null;t=D7(t)}return null}function C7(){return x7??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),x7}function w7(e){return/^(html|body|#document)$/.test(d7(e))}function T7(e){return f7(e).getComputedStyle(e)}function E7(e){return h7(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function D7(e){if(d7(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||_7(e)&&e.host||p7(e);return _7(t)?t.host:t}function O7(e){let t=D7(e);return w7(t)?e.ownerDocument?e.ownerDocument.body:e.body:g7(t)&&v7(t)?t:O7(t)}function k7(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=O7(e),i=r===e.ownerDocument?.body,a=f7(r);if(i){let e=A7(a);return t.concat(a,a.visualViewport||[],v7(r)?r:[],e&&n?k7(e):[])}else return t.concat(r,k7(r,[],n))}function A7(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function j7(e){let t=T7(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=g7(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=V5(n)!==a||V5(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function M7(e){return h7(e)?e:e.contextElement}function N7(e){let t=M7(e);if(!g7(t))return U5(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=j7(t),o=(a?V5(n.width):n.width)/r,s=(a?V5(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Jse=U5(0);function P7(e){let t=f7(e);return!C7()||!t.visualViewport?Jse:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Yse(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==f7(e)?!1:t}function F7(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=M7(e),o=U5(1);t&&(r?h7(r)&&(o=N7(r)):o=N7(e));let s=Yse(a,n,r)?P7(a):U5(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=f7(a),t=r&&h7(r)?f7(r):r,n=e,i=A7(n);for(;i&&r&&t!==n;){let e=N7(i),t=i.getBoundingClientRect(),r=T7(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=f7(i),i=A7(n)}}return i7({width:u,height:d,x:c,y:l})}function I7(e,t){let n=E7(e).scrollLeft;return t?t.left+n:F7(p7(e)).left+n}function L7(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-I7(e,n),y:n.top+t.scrollTop}}function Xse(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=p7(r),s=t?y7(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=U5(1),u=U5(0),d=g7(r);if((d||!d&&!a)&&((d7(r)!==`body`||v7(o))&&(c=E7(r)),d)){let e=F7(r);l=N7(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?L7(o,c):U5(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 Zse(e){return Array.from(e.getClientRects())}function Qse(e){let t=p7(e),n=E7(e),r=e.ownerDocument.body,i=B5(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=B5(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+I7(e),s=-n.scrollTop;return T7(r).direction===`rtl`&&(o+=B5(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var R7=25;function $se(e,t){let n=f7(e),r=p7(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=C7();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=I7(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<=R7&&(a-=o)}else l<=R7&&(a+=l);return{width:a,height:o,x:s,y:c}}function ece(e,t){let n=F7(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=g7(e)?N7(e):U5(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function z7(e,t,n){let r;if(t===`viewport`)r=$se(e,n);else if(t===`document`)r=Qse(p7(e));else if(h7(t))r=ece(t,n);else{let n=P7(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return i7(r)}function B7(e,t){let n=D7(e);return n===t||!h7(n)||w7(n)?!1:T7(n).position===`fixed`||B7(n,t)}function tce(e,t){let n=t.get(e);if(n)return n;let r=k7(e,[],!1).filter(e=>h7(e)&&d7(e)!==`body`),i=null,a=T7(e).position===`fixed`,o=a?D7(e):e;for(;h7(o)&&!w7(o);){let t=T7(o),n=S7(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||v7(o)&&!n&&B7(e,o))?r=r.filter(e=>e!==o):i=t,o=D7(o)}return t.set(e,r),r}function nce(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?y7(t)?[]:tce(t,this._c):[].concat(n),r],o=z7(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=z7(t,a[e],i);s=B5(n.top,s),c=z5(n.right,c),l=z5(n.bottom,l),u=B5(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function rce(e){let{width:t,height:n}=j7(e);return{width:t,height:n}}function ice(e,t,n){let r=g7(t),i=p7(t),a=n===`fixed`,o=F7(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=U5(0);function l(){c.x=I7(i)}if(r||!r&&!a)if((d7(t)!==`body`||v7(i))&&(s=E7(t)),r){let e=F7(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?L7(i,s):U5(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 V7(e){return T7(e).position===`static`}function H7(e,t){if(!g7(e)||T7(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return p7(e)===n&&(n=n.ownerDocument.body),n}function U7(e,t){let n=f7(e);if(y7(e))return n;if(!g7(e)){let t=D7(e);for(;t&&!w7(t);){if(h7(t)&&!V7(t))return t;t=D7(t)}return n}let r=H7(e,t);for(;r&&Wse(r)&&V7(r);)r=H7(r,t);return r&&w7(r)&&V7(r)&&!S7(r)?n:r||qse(e)||n}var ace=async function(e){let t=this.getOffsetParent||U7,n=this.getDimensions,r=await n(e.floating);return{reference:ice(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function oce(e){return T7(e).direction===`rtl`}var sce={convertOffsetParentRelativeRectToViewportRelativeRect:Xse,getDocumentElement:p7,getClippingRect:nce,getOffsetParent:U7,getElementRects:ace,getClientRects:Zse,getDimensions:rce,getScale:N7,isElement:h7,isRTL:oce};function W7(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function cce(e,t){let n=null,r,i=p7(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=H5(d),h=H5(i.clientWidth-(u+f)),g=H5(i.clientHeight-(d+p)),_=H5(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:B5(0,z5(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&&!W7(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 G7(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=M7(e),u=i||a?[...l?k7(l):[],...t?k7(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?cce(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?F7(e):null;c&&g();function g(){let t=F7(e);h&&!W7(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 K7=Bse,lce=Pse,q7=Vse,J7=Fse,Y7=Use,X7=Ise,Z7=Mse,uce=Rse,dce=Hse,Q7=(e,t,n)=>{let r=new Map,i={platform:sce,...n},a={...i.platform,_c:r};return jse(e,t,{...i,platform:a})},$7=typeof document<`u`?E.useLayoutEffect:function(){};function e9(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(!e9(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)&&!e9(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function t9(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function n9(e,t){let n=t9(e);return Math.round(t*n)/n}function r9(e){let t=E.useRef(e);return $7(()=>{t.current=e}),t}function fce(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]=E.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=E.useState(r);e9(f,r)||p(r);let[m,h]=E.useState(null),[g,_]=E.useState(null),v=E.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=E.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=E.useRef(null),C=E.useRef(null),w=E.useRef(u),T=c!=null,ee=r9(c),te=r9(i),ne=r9(l),re=E.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};te.current&&(e.platform=te.current),Q7(S.current,C.current,e).then(e=>{let t={...e,isPositioned:ne.current!==!1};ie.current&&!e9(w.current,t)&&(w.current=t,To.flushSync(()=>{d(t)}))})},[f,t,n,te,ne]);$7(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let ie=E.useRef(!1);$7(()=>(ie.current=!0,()=>{ie.current=!1}),[]),$7(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(ee.current)return ee.current(b,x,re);re()}},[b,x,re,ee,T]);let ae=E.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),D=E.useMemo(()=>({reference:b,floating:x}),[b,x]),oe=E.useMemo(()=>{let e={position:n,left:0,top:0};if(!D.floating)return e;let t=n9(D.floating,u.x),r=n9(D.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...t9(D.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,D.floating,u.x,u.y]);return E.useMemo(()=>({...u,update:re,refs:ae,elements:D,floatingStyles:oe}),[u,re,ae,D,oe])}var pce=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?{}:Z7({element:r.current,padding:i}).fn(n):r?Z7({element:r,padding:i}).fn(n):{}}}},mce=(e,t)=>{let n=K7(e);return{name:n.name,fn:n.fn,options:[e,t]}},hce=(e,t)=>{let n=q7(e);return{name:n.name,fn:n.fn,options:[e,t]}},gce=(e,t)=>({fn:dce(e).fn,options:[e,t]}),_ce=(e,t)=>{let n=J7(e);return{name:n.name,fn:n.fn,options:[e,t]}},vce=(e,t)=>{let n=Y7(e);return{name:n.name,fn:n.fn,options:[e,t]}},yce=(e,t)=>{let n=X7(e);return{name:n.name,fn:n.fn,options:[e,t]}},bce=(e,t)=>{let n=pce(e);return{name:n.name,fn:n.fn,options:[e,t]}},xce=`Arrow`,i9=E.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,wo.jsx)(m.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,wo.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});i9.displayName=xce;var Sce=i9,a9=`Popper`,[o9,s9]=g(a9),[Cce,c9]=o9(a9),l9=e=>{let{__scopePopper:t,children:n}=e,[r,i]=E.useState(null);return(0,wo.jsx)(Cce,{scope:t,anchor:r,onAnchorChange:i,children:n})};l9.displayName=a9;var u9=`PopperAnchor`,d9=E.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=c9(u9,n),o=E.useRef(null),s=l(t,o),c=E.useRef(null);return E.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&a.onAnchorChange(c.current)}),r?null:(0,wo.jsx)(m.div,{...i,ref:s})});d9.displayName=u9;var f9=`PopperContent`,[wce,Tce]=o9(f9),p9=E.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:u=[],collisionPadding:d=0,sticky:f=`partial`,hideWhenDetached:p=!1,updatePositionStrategy:g=`optimized`,onPlaced:v,...b}=e,x=c9(f9,n),[S,C]=E.useState(null),w=l(t,e=>C(e)),[T,ee]=E.useState(null),te=_(T),ne=te?.width??0,re=te?.height??0,ie=r+(a===`center`?``:`-`+a),ae=typeof d==`number`?d:{top:0,right:0,bottom:0,left:0,...d},D=Array.isArray(u)?u:[u],oe=D.length>0,se={padding:ae,boundary:D.filter(Dce),altBoundary:oe},{refs:ce,floatingStyles:le,placement:ue,isPositioned:de,middlewareData:fe}=fce({strategy:`fixed`,placement:ie,whileElementsMounted:(...e)=>G7(...e,{animationFrame:g===`always`}),elements:{reference:x.anchor},middleware:[mce({mainAxis:i+re,alignmentAxis:o}),c&&hce({mainAxis:!0,crossAxis:!1,limiter:f===`partial`?gce():void 0,...se}),c&&_ce({...se}),vce({...se,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&&bce({element:T,padding:s}),Oce({arrowWidth:ne,arrowHeight:re}),p&&yce({strategy:`referenceHidden`,...se})]}),[pe,me]=g9(ue),he=h(v);y(()=>{de&&he?.()},[de,he]);let ge=fe.arrow?.x,_e=fe.arrow?.y,ve=fe.arrow?.centerOffset!==0,[ye,be]=E.useState();return y(()=>{S&&be(window.getComputedStyle(S).zIndex)},[S]),(0,wo.jsx)(`div`,{ref:ce.setFloating,"data-radix-popper-content-wrapper":``,style:{...le,transform:de?le.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ye,"--radix-popper-transform-origin":[fe.transformOrigin?.x,fe.transformOrigin?.y].join(` `),...fe.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,wo.jsx)(wce,{scope:n,placedSide:pe,onArrowChange:ee,arrowX:ge,arrowY:_e,shouldHideArrow:ve,children:(0,wo.jsx)(m.div,{"data-side":pe,"data-align":me,...b,ref:w,style:{...b.style,animation:de?void 0:`none`}})})})});p9.displayName=f9;var m9=`PopperArrow`,Ece={top:`bottom`,right:`left`,bottom:`top`,left:`right`},h9=E.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Tce(m9,n),a=Ece[i.placedSide];return(0,wo.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,wo.jsx)(Sce,{...r,ref:t,style:{...r.style,display:`block`}})})});h9.displayName=m9;function Dce(e){return e!==null}var Oce=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]=g9(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 g9(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var _9=l9,v9=d9,y9=p9,b9=h9,[x9,kce]=g(`Tooltip`,[s9]),S9=s9(),C9=`TooltipProvider`,Ace=700,w9=`tooltip.open`,[jce,T9]=x9(C9),E9=e=>{let{__scopeTooltip:t,delayDuration:n=Ace,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=E.useRef(!0),s=E.useRef(!1),c=E.useRef(0);return E.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,wo.jsx)(jce,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:E.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:E.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:E.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};E9.displayName=C9;var D9=`Tooltip`,[Mce,O9]=x9(D9),k9=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=T9(D9,e.__scopeTooltip),l=S9(t),[u,d]=E.useState(null),f=v(),m=E.useRef(0),h=o??c.disableHoverableContent,g=s??c.delayDuration,_=E.useRef(!1),[y,b]=p({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(w9))):c.onClose(),a?.(e)},caller:D9}),x=E.useMemo(()=>y?_.current?`delayed-open`:`instant-open`:`closed`,[y]),S=E.useCallback(()=>{window.clearTimeout(m.current),m.current=0,_.current=!1,b(!0)},[b]),C=E.useCallback(()=>{window.clearTimeout(m.current),m.current=0,b(!1)},[b]),w=E.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{_.current=!0,b(!0),m.current=0},g)},[g,b]);return E.useEffect(()=>()=>{m.current&&=(window.clearTimeout(m.current),0)},[]),(0,wo.jsx)(_9,{...l,children:(0,wo.jsx)(Mce,{scope:t,contentId:f,open:y,stateAttribute:x,trigger:u,onTriggerChange:d,onTriggerEnter:E.useCallback(()=>{c.isOpenDelayedRef.current?w():S()},[c.isOpenDelayedRef,w,S]),onTriggerLeave:E.useCallback(()=>{h?C():(window.clearTimeout(m.current),m.current=0)},[C,h]),onOpen:S,onClose:C,disableHoverableContent:h,children:n})})};k9.displayName=D9;var A9=`TooltipTrigger`,j9=E.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=O9(A9,n),a=T9(A9,n),o=S9(n),s=l(t,E.useRef(null),i.onTriggerChange),c=E.useRef(!1),u=E.useRef(!1),f=E.useCallback(()=>c.current=!1,[]);return E.useEffect(()=>()=>document.removeEventListener(`pointerup`,f),[f]),(0,wo.jsx)(v9,{asChild:!0,...o,children:(0,wo.jsx)(m.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:d(e.onPointerMove,e=>{e.pointerType!==`touch`&&!u.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),u.current=!0)}),onPointerLeave:d(e.onPointerLeave,()=>{i.onTriggerLeave(),u.current=!1}),onPointerDown:d(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,f,{once:!0})}),onFocus:d(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:d(e.onBlur,i.onClose),onClick:d(e.onClick,i.onClose)})})});j9.displayName=A9;var M9=`TooltipPortal`,[Nce,Pce]=x9(M9,{forceMount:void 0}),N9=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=O9(M9,t);return(0,wo.jsx)(Nce,{scope:t,forceMount:n,children:(0,wo.jsx)(u,{present:n||a.open,children:(0,wo.jsx)(f,{asChild:!0,container:i,children:r})})})};N9.displayName=M9;var P9=`TooltipContent`,F9=E.forwardRef((e,t)=>{let n=Pce(P9,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=O9(P9,e.__scopeTooltip);return(0,wo.jsx)(u,{present:r||o.open,children:o.disableHoverableContent?(0,wo.jsx)(I9,{side:i,...a,ref:t}):(0,wo.jsx)(Fce,{side:i,...a,ref:t})})}),Fce=E.forwardRef((e,t)=>{let n=O9(P9,e.__scopeTooltip),r=T9(P9,e.__scopeTooltip),i=E.useRef(null),a=l(t,i),[o,s]=E.useState(null),{trigger:c,onClose:u}=n,d=i.current,{onPointerInTransitChange:f}=r,p=E.useCallback(()=>{s(null),f(!1)},[f]),m=E.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=Bce(r,zce(r,n.getBoundingClientRect())),a=Vce(t.getBoundingClientRect());s(Uce([...i,...a])),f(!0)},[f]);return E.useEffect(()=>()=>p(),[p]),E.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]),E.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=!Hce(n,o);r?p():i&&(p(),u())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,d,o,u,p]),(0,wo.jsx)(I9,{...e,ref:a})}),[Ice,Lce]=x9(D9,{isInside:!1}),Rce=b(`TooltipContent`),I9=E.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,l=O9(P9,n),u=S9(n),{onClose:d}=l;return E.useEffect(()=>(document.addEventListener(w9,d),()=>document.removeEventListener(w9,d)),[d]),E.useEffect(()=>{if(l.trigger){let e=e=>{e.target?.contains(l.trigger)&&d()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]),(0,wo.jsx)(c,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,wo.jsxs)(y9,{"data-state":l.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,wo.jsx)(Rce,{children:r}),(0,wo.jsx)(Ice,{scope:n,isInside:!0,children:(0,wo.jsx)(xse,{id:l.contentId,role:`tooltip`,children:i||r})})]})})});F9.displayName=P9;var L9=`TooltipArrow`,R9=E.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=S9(n);return Lce(L9,n).isInside?null:(0,wo.jsx)(b9,{...i,...r,ref:t})});R9.displayName=L9;function zce(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 Bce(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 Vce(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 Hce(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 Uce(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)),Wce(t)}function Wce(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 Gce=E9,Kce=k9,qce=j9,Jce=N9,Yce=F9,Xce=R9;function Zce(e){let t=(0,Eo.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,wo.jsx)(Gce,{"data-slot":`tooltip-provider`,delayDuration:i,...n}),t[3]=i,t[4]=n,t[5]=a):a=t[5],a}function Qce(e){let t=(0,Eo.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,wo.jsx)(Kce,{"data-slot":`tooltip`,...n}),t[2]=n,t[3]=r),r}function $ce(e){let t=(0,Eo.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,wo.jsx)(qce,{"data-slot":`tooltip-trigger`,...n}),t[2]=n,t[3]=r),r}function ele(e){let t=(0,Eo.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,wo.jsx)(Xce,{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,wo.jsx)(Jce,{children:(0,wo.jsxs)(Yce,{"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 tle(e){if(e.startsWith(B9)||!e.startsWith(`#/`))return null;let t=e.slice(2),n=cle(t),r=n>=0?t.slice(0,n):t;if(!r)return null;try{return r.split(`/`).map(decodeURIComponent).join(`/`)}catch{return r}}function nle(e){if(e.startsWith(B9)||!e.startsWith(`#/`))return null;let t=e.slice(2),n=t.indexOf(`#`);if(n<0)return null;let r=t.slice(n+1);if(!r)return null;try{return decodeURIComponent(r)}catch{return r}}function rle(e,t){let n=`#/${e}`;return t?`${n}#${encodeURIComponent(t)}`:n}function ile(e){if(window.location.hash===e)return;let{pathname:t,search:n}=window.location;window.history.replaceState(null,``,`${t}${n}${e}`)}function ale(e){return e.endsWith(`.mdx`)?e.slice(0,-4):e.endsWith(`.md`)?e.slice(0,-3):e}function z9(e,t){let n=e.replace(/^\/+|\/+$/g,``),r=n?`#/${n}/`:`#/`;return t?`${r}#${encodeURIComponent(t)}`:r}function ole(e,t,n){if(e===`folder`)return z9(t);let r=`#/${encodeURIComponent(t)}`;return n==null||n===``?r:`${r}?branch=${encodeURIComponent(n)}`}function sle(e){if(e===`#/`)return!0;if(!e.startsWith(`#/`))return!1;let t=e.slice(2);return t.length>0&&t[0]===`?`}var B9=`#/__asset__/`;function cle(e){let t=e.indexOf(`?`),n=e.indexOf(`#`);return t<0?n:n<0?t:Math.min(t,n)}function lle(e){if(!e.startsWith(B9))return null;let t=e.slice(12);if(!t)return null;try{return t.split(`/`).map(decodeURIComponent).join(`/`)}catch{return t}}function ule(e){return`${B9}${e.split(`/`).map(encodeURIComponent).join(`/`)}`}function V9(e){if(typeof e!=`object`||!e)return;let t=e;if(typeof t.title==`string`&&t.title.length>0)return t.title}function dle(e){return e.kind===`asset`}function fle(e){return e.kind===`document`}function ple(e){return e.kind===`folder`}function mle(e){let t=[],n=0;for(let r of e)switch(r.kind){case`document`:if(r.docName===void 0){n+=1;break}t.push({kind:`document`,docName:r.docName,docExt:r.docExt,size:r.size,modified:r.modified,isSymlink:r.isSymlink,canonicalDocName:r.canonicalDocName,targetPath:r.targetPath});break;case`asset`:if(r.path===void 0||r.assetExt===void 0){n+=1;break}t.push({kind:`asset`,path:r.path,assetExt:r.assetExt,mediaKind:r.mediaKind??null,size:r.size,modified:r.modified,referencedBy:r.referencedBy});break;case`folder`:if(r.path===void 0){n+=1;break}t.push({kind:`folder`,path:r.path,size:r.size,modified:r.modified,hasChildren:r.hasChildren});break;default:r.kind;break}return n>0&&console.warn(`[file-tree-utils] dropped ${n} listing entries missing variant identity fields`),t}function hle(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 gle(e){if(!e)return``;let t=e.lastIndexOf(`/`);return t>0?e.slice(0,t):``}function _le(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 H9=null,U9=new Set;function W9(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 vle(e,t){return e===null?!1:e===t?!0:W9(e.pages,t.pages)&&W9(e.folderPaths,t.folderPaths)&&W9(e.assetPaths??new Set,t.assetPaths??new Set)&&yle(e.pageIcons,t.pageIcons)}function yle(e,t){if(e===t)return!0;let n=e?.size??0;if(n!==(t?.size??0))return!1;if(n===0)return!0;for(let[n,r]of e)if(t.get(n)!==r)return!1;return!0}function ble(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 xle(e,t){let n=new Map,r=[...e].sort((e,t)=>e.localeCompare(t));for(let e of r){let r=e.lastIndexOf(`/`),i=t(r===-1?e:e.slice(r+1));i&&!n.has(i)&&n.set(i,e)}return n}function Sle(e){let t=new Map;for(let[n,r]of e){let e=r.icon;typeof e==`string`&&e.trim()!==``&&t.set(n,e)}return t}function Cle(){return H9}function wle(e){if(!vle(H9,e)){H9=e;for(let t of Array.from(U9))try{t(e)}catch(e){console.error(`[page-list-cache] subscriber threw:`,e)}}}function Tle(e){if(U9.add(e),H9!==null)try{e(H9)}catch(e){console.error(`[page-list-cache] subscriber threw on replay:`,e)}return()=>{U9.delete(e)}}var G9=`open-knowledge:documents-changed`,Ele=new Set(d5.options);function K9(e){return e===void 0||!Array.isArray(e)?[`files`]:[...new Set(e.filter(e=>Ele.has(e)))]}function Dle(e=[`files`]){window.dispatchEvent(new CustomEvent(G9,{detail:{channels:K9(e)}}))}function q9(e){let t=t=>{e(K9(t instanceof CustomEvent?t.detail?.channels:void 0))};return window.addEventListener(G9,t),()=>window.removeEventListener(G9,t)}var J9=`open-knowledge:branch-changed`;function Ole(e){window.dispatchEvent(new CustomEvent(J9,{detail:{branch:e}}))}function kle(e){let t=t=>{if(!(t instanceof CustomEvent))return;let n=t.detail;e(n?.branch??null)};return window.addEventListener(J9,t),()=>window.removeEventListener(J9,t)}var Y9=`open-knowledge:templates-changed`;function Ale(){window.dispatchEvent(new CustomEvent(Y9))}function jle(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 Mle(e){let t=X9(e);return t?`${t}.md`:`untitled.md`}function Nle(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 Ple(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 hle(n))t.add(e);return t}function Fle(e,t){if(!t)return;let n=K8(e);if(n)return t.get(n)}function Ile(e,t){if(!t||e.includes(`/`))return;let n=K8(e);if(n)return t.get(n)}function Lle(e,t){let{normalizedTarget:n,expectsFolder:r}=Ple(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=Fle(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;if(o&&t.pages.has(o))return{kind:`folder-index`,target:n,folderPath:n,docName:o,noteKind:`legacy-folder-note`};if(!r){let e=Ile(n,t.pagesByBasename);if(e)return{kind:`doc`,target:e,docName:e}}return(t.folderPaths??Z9(t.pages)).has(n)?{kind:`folder`,target:n,folderPath:n}:{kind:`missing`,target:n}}function Rle(e){return e.kind===`folder-index`?{kind:`folder`,target:e.folderPath,folderPath:e.folderPath}:e}function Q9(e,t,n=qQ){return typeof t!=`number`||!JQ(t,n)?null:{kind:`large-file`,target:e,docName:e,size:t,limit:n}}function zle(e,t,n=qQ){return e.kind!==`doc`&&e.kind!==`folder-index`?e:Q9(e.docName,t.get(e.docName)?.size,n)??e}function Ble(e){switch(e.kind){case`doc`:case`folder-index`:case`large-file`:return e.docName;case`missing`:return e.target;case`asset`:case`folder`:return null}}var $9=(0,E.createContext)(null);function Vle(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 Hle(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 Ule(e,t){let n=new Map(e);for(let e of t)n.has(e)||n.set(e,e);return n}async function Wle(){let e=await fetch(`/api/pages`);if(!e.ok){let t=await e.json().catch(()=>null);throw Error(V9(t)??`/api/pages responded with ${e.status}`)}let t=await e.json();return Array.isArray(t.pages)?t.pages:[]}async function Gle(){let e=await fetch(`/api/documents`);if(!e.ok){let t=await e.json().catch(()=>null);throw Error(V9(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 Kle(e){console.error(`[PageListContext] Failed to load pages:`,e)}function qle(e){console.warn(`[PageListContext] Failed to load referenced assets:`,e)}function Jle(e){let t=(0,Eo.c)(49),{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,E.useState)(r),o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=new Map,t[1]=o):o=t[1];let[s,c]=(0,E.useState)(o),l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=new Map,t[2]=l):l=t[2];let[u,d]=(0,E.useState)(l),f;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(f=new Set,t[3]=f):f=t[3];let[p,m]=(0,E.useState)(f),h;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(h=new Set,t[4]=h):h=t[4];let[g,_]=(0,E.useState)(h),v;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(v=new Set,t[5]=v):v=t[5];let[y,b]=(0,E.useState)(v),[x,S]=(0,E.useState)(!0),[C,w]=(0,E.useState)(null),T=(0,E.useRef)(0),ee;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(ee=function(){let e=T.current+=1;Promise.all([Wle(),Gle().catch(Qle)]).then(t=>{let[n,r]=t;if(e!==T.current)return;let i=new Set(n.map(Zle));a(i),c(new Map(n.map(Xle))),d(new Map(n.map(Yle))),m(new Set(r.assetPaths)),_(new Set(r.folderPaths)),b(e=>Hle(e,i)),w(null)}).catch(t=>{e===T.current&&(Kle(t),w(t instanceof Error?t.message:`Failed to load pages`))}).finally(()=>{e===T.current&&S(!1)})},t[6]=ee):ee=t[6];let te=ee,ne;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(ne=function(e){b(t=>{if(t.has(e))return t;let n=new Set(t);return n.add(e),n}),w(null)},t[7]=ne):ne=t[7];let re=ne,ie,ae;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(ae=()=>{te();let e=()=>{document.visibilityState===`visible`&&te()};window.addEventListener(`focus`,e),window.addEventListener(`visibilitychange`,e);let t=q9(e=>{e.includes(`files`)&&te()});return()=>{window.removeEventListener(`focus`,e),window.removeEventListener(`visibilitychange`,e),t()}},ie=[],t[8]=ie,t[9]=ae):(ie=t[8],ae=t[9]),(0,E.useEffect)(ae,ie);let D,oe,se,ce,le,ue,de;if(t[10]!==y||t[11]!==p||t[12]!==g||t[13]!==u||t[14]!==s||t[15]!==i){le=Vle(i,y);let e;t[23]!==y||t[24]!==s?(e=Ule(s,y),t[23]=y,t[24]=s,t[25]=e):e=t[25],ce=e,se=u,D=p,oe=new Set([...Z9(le),...g]),ue=ble(le,K8),de=xle(le,K8),t[10]=y,t[11]=p,t[12]=g,t[13]=u,t[14]=s,t[15]=i,t[16]=D,t[17]=oe,t[18]=se,t[19]=ce,t[20]=le,t[21]=ue,t[22]=de}else D=t[16],oe=t[17],se=t[18],ce=t[19],le=t[20],ue=t[21],de=t[22];let fe=de,pe;t[26]===u?pe=t[27]:(pe=Sle(u),t[26]=u,t[27]=pe);let me=pe,he,ge;t[28]!==D||t[29]!==oe||t[30]!==me||t[31]!==le||t[32]!==fe||t[33]!==ue?(he=()=>{wle({pages:le,folderPaths:oe,pagesBySlug:ue,pagesByBasename:fe,assetPaths:D,pageIcons:me})},ge=[le,oe,ue,fe,D,me],t[28]=D,t[29]=oe,t[30]=me,t[31]=le,t[32]=fe,t[33]=ue,t[34]=he,t[35]=ge):(he=t[34],ge=t[35]),(0,E.useEffect)(he,ge);let _e;t[36]!==D||t[37]!==C||t[38]!==oe||t[39]!==x||t[40]!==se||t[41]!==ce||t[42]!==le||t[43]!==fe||t[44]!==ue?(_e={pages:le,pagesBySlug:ue,pagesByBasename:fe,pageTitles:ce,pageMeta:se,folderPaths:oe,assetPaths:D,loading:x,error:C,refetch:te,addPage:re},t[36]=D,t[37]=C,t[38]=oe,t[39]=x,t[40]=se,t[41]=ce,t[42]=le,t[43]=fe,t[44]=ue,t[45]=_e):_e=t[45];let ve;return t[46]!==n||t[47]!==_e?(ve=(0,wo.jsx)($9,{value:_e,children:n}),t[46]=n,t[47]=_e,t[48]=ve):ve=t[48],ve}function Yle(e){return[e.docName,{size:e.size,modified:e.modified,docExt:e.docExt,icon:e.icon}]}function Xle(e){return[e.docName,e.title]}function Zle(e){return e.docName}function Qle(e){return qle(e),{assetPaths:[],folderPaths:[]}}function $le(){let e=(0,E.use)($9);if(!e)throw Error(`usePageList must be used within <PageListProvider />`);return e}function eue(){return(0,E.use)($9)}var tue=n(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),nue=n(((e,t)=>{var n=tue();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}})),rue=n(((e,t)=>{t.exports=nue()()}));export{uce as $,wu as $i,P4 as $n,gse as $r,$Q as $t,tle as A,Hv as Ai,EQ as An,JQ as Ar,soe as At,Zce as B,Lp as Bi,Goe as Bn,wae as Br,Nae as Bt,dle as C,Py as Ci,z0 as Cn,U4 as Cr,GQ as Ct,V9 as D,ob as Di,B1 as Dn,W4 as Dr,$ae as Dt,mle as E,Wy as Ei,L1 as En,z4 as Er,eoe as Et,z9 as F,__ as Fi,K1 as Fn,X$ as Fr,d$ as Ft,_9 as G,hf as Gi,I$ as Gn,j8 as Gr,sie as Gt,v9 as H,R as Hi,hse as Hn,k$ as Hr,z2 as Ht,sle as I,b_ as Ii,J1 as In,Y$ as Ir,LQ as It,lce as J,ad as Ji,$1 as Jn,vse as Jr,KQ as Jt,s9 as K,Xd as Ki,$oe as Kn,F1 as Kr,U$ as Kt,ile as L,ev as Li,_se as Ln,U1 as Lr,CZ as Lt,ale as M,cb as Mi,MQ as Mn,bZ as Mr,kae as Mt,ule as N,Nx as Ni,B0 as Nn,Q2 as Nr,toe as Nt,nle as O,Sx as Oi,Bae as On,G4 as Or,h$ as Ot,rle as P,gx as Pi,G1 as Pn,e$ as Pr,XQ as Pt,X7 as Q,Du as Qi,Joe as Qn,PZ as Qr,u1 as Qt,Qce as R,Cp as Ri,Woe as Rn,e4 as Rr,W1 as Rt,_le as S,Ane as Si,coe as Sn,q4 as Sr,HQ as St,ple as T,Uy as Ti,g$ as Tn,H4 as Tr,A$ as Tt,b9 as U,vp as Ui,yQ as Un,NQ as Ur,Hae as Ut,$ce as V,Bp as Vi,mse as Vn,U2 as Vr,w5 as Vt,y9 as W,z as Wi,bQ as Wn,F$ as Wr,s$ as Wt,Q7 as X,au as Xi,h0 as Xn,a4 as Xr,Iae as Xt,G7 as Y,L as Yi,e0 as Yn,W0 as Yr,e1 as Yt,J7 as Z,Ql as Zi,ese as Zn,FZ as Zr,Zie as Zt,q9 as _,Qb as _i,O0 as _n,rse as _r,Toe as _t,Ble as a,he as aa,K8 as ai,L0 as an,R1 as ar,Qoe as at,Tle as b,Px as bi,j1 as bn,B4 as br,VQ as bt,Lle as c,oe as ca,m5 as ci,V0 as cn,L$ as cr,u$ as ct,Mle as d,Yw as di,ooe as dn,xZ as dr,jae as dt,uu as ea,yse as ei,Vae as en,Foe as er,K7 as et,X9 as f,Aw as fi,K$ as fn,lae as fr,Eoe as ft,kle as g,px as gi,C0 as gn,H2 as gr,Ooe as gt,Ale as h,aT as hi,I0 as hn,zQ as hr,Doe as ht,$le as i,Ie as ia,H$ as ii,noe as in,RQ as ir,Zoe as it,ole as j,Ny as ji,mQ as jn,N5 as jr,c5 as jt,lle as k,dy as ki,pse as kn,_Z as kr,m$ as kt,zle as l,D as la,qne as li,uZ as ln,V8 as lr,Jae as lt,Dle as m,mT as mi,BQ as mn,I1 as mr,koe as mt,Jle as n,N as na,V1 as ni,n$ as nn,ose as nr,Y7 as nt,Rle as o,me as oa,G0 as oi,R0 as on,j5 as or,r$ as ot,Ole as p,cT as pi,J$ as pn,dse as pr,Aoe as pt,Z7 as q,I as qi,t0 as qn,Z2 as qr,W$ as qt,eue as r,A as ra,wZ as ri,ioe as rn,QQ as rr,P5 as rt,Q9 as s,pe as sa,q8 as si,H0 as sn,lZ as sr,YQ as st,rue as t,F as ta,Hoe as ti,t$ as tn,Poe as tr,q7 as tt,Nle as u,Une as ui,d1 as un,tse as ur,Yae as ut,jle as v,ab as vi,D0 as vn,J4 as vr,_Q as vt,fle as w,Vy as wi,c$ as wn,K4 as wr,C5 as wt,gle as x,xx as xi,goe as xn,V4 as xr,UQ as xt,Cle as y,Lx as yi,j0 as yn,Y4 as yr,WQ as yt,ele as z,B as zi,Koe as zn,Tae as zr,H1 as zt};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e}from"./prop-types-
|
|
1
|
+
import{c as e}from"./prop-types-53f-gng4.js";function t(e){switch(e.kind){case`doc`:case`large-file`:return`doc`;case`folder`:case`folder-index`:return`folder`;case`missing`:case`asset`:return`missing`}}function n(n,r){let i=e(n,r);return{resolvedTarget:i,hashDocName:i.target,displayState:t(i)}}export{n as t};
|