import{o as e,t}from"./chunk-CFjPhJqf.js";import{a as n,o as r,t as i}from"./compiler-runtime-Cs91PcD2.js";import{D as a,Nn as o,k as s,ur as c}from"./dist-BOw5J5xw.js";import{u as l}from"./button-CmLxDlCv.js";var u=l(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),d=l(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),ee=l(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),f=e=>typeof e==`string`,p=e=>typeof e==`function`,m=new Map,h=`en`;function g(e){return[...Array.isArray(e)?e:[e],h]}function _(e,t,n){let r=g(e);n||=`default`;let i;if(typeof n==`string`)switch(i={day:`numeric`,month:`short`,year:`numeric`},n){case`full`:i.weekday=`long`;case`long`:i.month=`long`;break;case`short`:i.month=`numeric`;break}else i=n;return x(()=>S(`date`,r,n),()=>new Intl.DateTimeFormat(r,i)).format(f(t)?new Date(t):t)}function v(e,t,n){let r;if(n||=`default`,typeof n==`string`)switch(r={second:`numeric`,minute:`numeric`,hour:`numeric`},n){case`full`:case`long`:r.timeZoneName=`short`;break;case`short`:delete r.second}else r=n;return _(e,t,r)}function y(e,t,n){let r=g(e);return x(()=>S(`number`,r,n),()=>new Intl.NumberFormat(r,n)).format(t)}function b(e,t,n,{offset:r=0,...i}){let a=g(e),o=t?x(()=>S(`plural-ordinal`,a),()=>new Intl.PluralRules(a,{type:`ordinal`})):x(()=>S(`plural-cardinal`,a),()=>new Intl.PluralRules(a,{type:`cardinal`}));return i[n]??i[o.select(n-r)]??i.other}function x(e,t){let n=e(),r=m.get(n);return r||(r=t(),m.set(n,r)),r}function S(e,t,n){return`${e}-${t.join(`-`)}-${JSON.stringify(n)}`}var C=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/,w=e=>e.replace(/\\u([a-fA-F0-9]{4})|\\x([a-fA-F0-9]{2})/g,(e,t,n)=>{if(t){let e=parseInt(t,16);return String.fromCharCode(e)}else{let e=parseInt(n,16);return String.fromCharCode(e)}}),T=`%__lingui_octothorpe__%`,E=(e,t,n={})=>{let r=t||e,i=e=>typeof e==`object`?e:n[e],a=(e,t)=>{let a=y(r,e,Object.keys(n).length?i(`number`):void 0);return t.replace(new RegExp(T,`g`),a)};return{plural:(e,t)=>{let{offset:n=0}=t,i=b(r,!1,e,t);return a(e-n,i)},selectordinal:(e,t)=>{let{offset:n=0}=t,i=b(r,!0,e,t);return a(e-n,i)},select:D,number:(e,t)=>y(r,e,i(t)||{style:t}),date:(e,t)=>_(r,e,i(t)||t),time:(e,t)=>v(r,e,i(t)||t)}},D=(e,t)=>t[e]??t.other;function O(e,t,n){return(r={},i)=>{let a=E(t,n,i),o=(e,t=!1)=>Array.isArray(e)?e.reduce((e,n)=>{if(n===`#`&&t)return e+T;if(f(n))return e+n;let[i,s,c]=n,l={};s===`plural`||s===`selectordinal`||s===`select`?Object.entries(c).forEach(([e,t])=>{l[e]=o(t,s===`plural`||s===`selectordinal`)}):l=c;let u;if(s){let e=a[s];u=e(r[i],l)}else u=r[i];return u==null?e:e+u},``):e,s=o(e);return f(s)&&C.test(s)?w(s):f(s)?s:s?String(s):``}}var k=class{_events={};on(e,t){return this._events[e]??=new Set,this._events[e].add(t),()=>this.removeListener(e,t)}removeListener(e,t){let n=this._events[e];n?.delete(t),n?.size===0&&delete this._events[e]}emit(e,...t){let n=this._events[e];if(n)for(let e of[...n])e.apply(this,t)}},A=class extends k{_locale=``;_locales;_messages={};_missing;_messageCompiler;constructor(e){super(),e.missing!=null&&(this._missing=e.missing),e.messages!=null&&this.load(e.messages),(typeof e.locale==`string`||e.locales)&&this.activate(e.locale??h,e.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){return this._messages[this._locale]??{}}setMessagesCompiler(e){return this._messageCompiler=e,this}_load(e,t){let n=this._messages[e];n?Object.assign(n,t):this._messages[e]=t}load(e,t){typeof e==`string`&&typeof t==`object`?this._load(e,t):Object.entries(e).forEach(([e,t])=>this._load(e,t)),this.emit(`change`)}loadAndActivate({locale:e,locales:t,messages:n}){this._locale=e,this._locales=t||void 0,this._messages[this._locale]=n,this.emit(`change`)}activate(e,t){this._locale=e,this._locales=t,this.emit(`change`)}_(e,t,n){if(!this.locale)throw Error(`Lingui: Attempted to call a translation function without setting a locale.
Make sure to call \`i18n.activate(locale)\` before using Lingui functions.
This issue may also occur due to a race condition in your initialization logic.`);let r=n?.message;e||=``,f(e)||(t=e.values||t,r=e.message,e=e.id);let i=this.messages[e],a=i===void 0,o=this._missing;if(o&&a)return p(o)?o(this._locale,e):o;a&&this.emit(`missing`,{id:e,locale:this._locale});let s=i||r||e;return f(s)&&(this._messageCompiler?s=this._messageCompiler(s):console.warn(`Uncompiled message detected! Message:

> ${s}

That means you use raw catalog or your catalog doesn't have a translation for the message and fallback was used.
ICU features such as interpolation and plurals will not work properly for that message. 

Please compile your catalog first. 
`)),f(s)&&C.test(s)?w(s):f(s)?s:O(s,this._locale,this._locales)(t,n?.formats)}t=this._.bind(this);date(e,t){return _(this._locales||this._locale,e,t)}number(e,t){return y(this._locales||this._locale,e,t)}};function j(e={}){return new A(e)}var te=j();function M(e){if(e.startsWith(B)||!e.startsWith(`#/`))return null;let t=e.slice(2),n=V(t),r=n>=0?t.slice(0,n):t;if(!r)return null;try{return r.split(`/`).map(decodeURIComponent).join(`/`)}catch{return r}}function N(e){if(e.startsWith(B)||!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 P(e,t){let n=`#/${e}`;return t?`${n}#${encodeURIComponent(t)}`:n}function F(e){if(window.location.hash===e)return;let{pathname:t,search:n}=window.location;window.history.replaceState(null,``,`${t}${n}${e}`)}function I(e){return e.endsWith(`.mdx`)?e.slice(0,-4):e.endsWith(`.md`)?e.slice(0,-3):e}function L(e,t){let n=e.replace(/^\/+|\/+$/g,``),r=n?`#/${n}/`:`#/`;return t?`${r}#${encodeURIComponent(t)}`:r}function R(e,t,n){if(e===`folder`)return L(t);let r=`#/${encodeURIComponent(t)}`;return n==null||n===``?r:`${r}?branch=${encodeURIComponent(n)}`}function z(e){if(e===`#/`)return!0;if(!e.startsWith(`#/`))return!1;let t=e.slice(2);return t.length>0&&t[0]===`?`}var B=`#/__asset__/`;function V(e){let t=e.indexOf(`?`),n=e.indexOf(`#`);return t<0?n:n<0?t:Math.min(t,n)}function H(e){if(!e.startsWith(B))return null;let t=e.slice(12);if(!t)return null;try{return t.split(`/`).map(decodeURIComponent).join(`/`)}catch{return t}}function U(e){return`${B}${e.split(`/`).map(encodeURIComponent).join(`/`)}`}var W=e(n(),1),ne=i();function G(e){if(typeof e!=`object`||!e)return;let t=e;if(typeof t.title==`string`&&t.title.length>0)return t.title}function K(e){return e.kind===`asset`}function q(e){return e.kind===`document`}function J(e){return e.kind===`folder`}function Y(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`file`:if(r.path===void 0){n+=1;break}t.push({kind:`asset`,path:r.path,assetExt:r.assetExt??re(r.path),mediaKind:null,size:r.size,modified:r.modified,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,isSymlink:r.isSymlink,targetPath:r.targetPath});break;default:r.kind;break}return n>0&&console.warn(`[file-tree-utils] dropped ${n} listing entries missing variant identity fields`),t}function re(e){let t=e.includes(`/`)?e.split(`/`).pop()??e:e,n=t.lastIndexOf(`.`);return n>0&&n<t.length-1?t.slice(n+1).toLowerCase():t.startsWith(`.`)&&t.length>1?t.slice(1).toLowerCase():`file`}function ie(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 ae(e){if(!e)return``;let t=e.lastIndexOf(`/`);return t>0?e.slice(0,t):``}function oe(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 X=null,Z=new Set;function Q(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 se(e,t){return e===null?!1:e===t?!0:Q(e.pages,t.pages)&&Q(e.folderPaths,t.folderPaths)&&Q(e.assetPaths??new Set,t.assetPaths??new Set)&&Q(e.filePaths??new Set,t.filePaths??new Set)&&ce(e.pageIcons,t.pageIcons)}function ce(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 le(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 ue(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 de(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 fe(){return X}function pe(e){if(!se(X,e)){X=e;for(let t of Array.from(Z))try{t(e)}catch(e){console.error(`[page-list-cache] subscriber threw:`,e)}}}function me(e){if(Z.add(e),X!==null)try{e(X)}catch(e){console.error(`[page-list-cache] subscriber threw on replay:`,e)}return()=>{Z.delete(e)}}var he=`open-knowledge:documents-changed`,ge=new Set(s.options);function _e(e){return e===void 0||!Array.isArray(e)?[`files`]:[...new Set(e.filter(e=>ge.has(e)))]}function ve(e=[`files`]){window.dispatchEvent(new CustomEvent(he,{detail:{channels:_e(e)}}))}function ye(e){let t=t=>{e(_e(t instanceof CustomEvent?t.detail?.channels:void 0))};return window.addEventListener(he,t),()=>window.removeEventListener(he,t)}var be=`open-knowledge:branch-changed`;function xe(e){window.dispatchEvent(new CustomEvent(be,{detail:{branch:e}}))}function Se(e){let t=t=>{if(!(t instanceof CustomEvent))return;let n=t.detail;e(n?.branch??null)};return window.addEventListener(be,t),()=>window.removeEventListener(be,t)}var Ce=`open-knowledge:templates-changed`;function we(){window.dispatchEvent(new CustomEvent(Ce))}function Te(e){let t=()=>e();return window.addEventListener(Ce,t),()=>window.removeEventListener(Ce,t)}function $(e){return e.trim().replace(/^\.\/+/,``).replace(/^\/+/,``).replace(/\.mdx?$/i,``)}function Ee(e){let t=$(e);return t?`${t}.md`:`untitled.md`}function De(e){let t=$(e),n=t.lastIndexOf(`/`);return{initialDir:n>0?t.slice(0,n):``,suggestedName:`${n>=0?t.slice(n+1):t||`untitled`}.md`}}function Oe(e){let t=e.trim();return{normalizedTarget:$(t).replace(/\/+$/g,``),expectsFolder:/\/+$/.test(t)}}function ke(e){let t=new Set;for(let n of e)for(let e of ie(n))t.add(e);return t}function Ae(e,t){if(!t)return;let n=c(e);if(n)return t.get(n)}function je(e,t){if(!t||e.includes(`/`))return;let n=c(e);if(n)return t.get(n)}function Me(e,t){let{normalizedTarget:n,expectsFolder:r}=Oe(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=Ae(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=je(n,t.pagesByBasename);if(e)return{kind:`doc`,target:e,docName:e}}return(t.folderPaths??ke(t.pages)).has(n)?{kind:`folder`,target:n,folderPath:n}:{kind:`missing`,target:n}}function Ne(e){return e.kind===`folder-index`?{kind:`folder`,target:e.folderPath,folderPath:e.folderPath}:e}function Pe(e,t,n=a){return typeof t!=`number`||!o(t,n)?null:{kind:`large-file`,target:e,docName:e,size:t,limit:n}}function Fe(e,t,n=a){return e.kind!==`doc`&&e.kind!==`folder-index`?e:Pe(e.docName,t.get(e.docName)?.size,n)??e}function Ie(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 Le=r(),Re=(0,W.createContext)(null);function ze(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 Be(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 Ve(e,t){let n=new Map(e);for(let e of t)n.has(e)||n.set(e,e);return n}async function He(){let e=await fetch(`/api/pages`);if(!e.ok){let t=await e.json().catch(()=>null);throw Error(G(t)??`/api/pages responded with ${e.status}`)}let t=await e.json();return Array.isArray(t.pages)?t.pages:[]}async function Ue(){let e=await fetch(`/api/documents`);if(!e.ok){let t=await e.json().catch(()=>null);throw Error(G(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),filePaths:t.documents.filter(e=>e.kind===`file`&&typeof e.path==`string`&&e.path.length>0).map(e=>e.path)}:{assetPaths:[],folderPaths:[],filePaths:[]}}function We(e){console.error(`[PageListContext] Failed to load pages:`,e)}function Ge(e){console.warn(`[PageListContext] Failed to load referenced assets:`,e)}function Ke(e){let t=(0,ne.c)(54),{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,W.useState)(r),o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=new Map,t[1]=o):o=t[1];let[s,l]=(0,W.useState)(o),u;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(u=new Map,t[2]=u):u=t[2];let[d,ee]=(0,W.useState)(u),f;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(f=new Set,t[3]=f):f=t[3];let[p,m]=(0,W.useState)(f),h;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(h=new Set,t[4]=h):h=t[4];let[g,_]=(0,W.useState)(h),v;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(v=new Set,t[5]=v):v=t[5];let[y,b]=(0,W.useState)(v),x;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(x=new Set,t[6]=x):x=t[6];let[S,C]=(0,W.useState)(x),[w,T]=(0,W.useState)(!0),[E,D]=(0,W.useState)(null),O=(0,W.useRef)(0),k;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(k=function(){let e=O.current+=1;Promise.all([He(),Ue().catch(Xe)]).then(t=>{let[n,r]=t;if(e!==O.current)return;let i=new Set(n.map(Ye));a(i),l(new Map(n.map(Je))),ee(new Map(n.map(qe))),m(new Set(r.assetPaths)),_(new Set(r.folderPaths)),b(new Set(r.filePaths)),C(e=>Be(e,i)),D(null)}).catch(t=>{e===O.current&&(We(t),D(t instanceof Error?t.message:`Failed to load pages`))}).finally(()=>{e===O.current&&T(!1)})},t[7]=k):k=t[7];let A=k,j;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(j=function(e){C(t=>{if(t.has(e))return t;let n=new Set(t);return n.add(e),n}),D(null)},t[8]=j):j=t[8];let te=j,M,N;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(M=()=>{A();let e=()=>{document.visibilityState===`visible`&&A()};window.addEventListener(`focus`,e),window.addEventListener(`visibilitychange`,e);let t=ye(e=>{e.includes(`files`)&&A()});return()=>{window.removeEventListener(`focus`,e),window.removeEventListener(`visibilitychange`,e),t()}},N=[],t[9]=M,t[10]=N):(M=t[9],N=t[10]),(0,W.useEffect)(M,N);let P,F,I,L,R,z,B,V;if(t[11]!==S||t[12]!==p||t[13]!==y||t[14]!==g||t[15]!==d||t[16]!==s||t[17]!==i){z=ze(i,S);let e;t[26]!==S||t[27]!==s?(e=Ve(s,S),t[26]=S,t[27]=s,t[28]=e):e=t[28],R=e,L=d,P=p,F=y,I=new Set([...ke(z),...g]),B=le(z,c),V=ue(z,c),t[11]=S,t[12]=p,t[13]=y,t[14]=g,t[15]=d,t[16]=s,t[17]=i,t[18]=P,t[19]=F,t[20]=I,t[21]=L,t[22]=R,t[23]=z,t[24]=B,t[25]=V}else P=t[18],F=t[19],I=t[20],L=t[21],R=t[22],z=t[23],B=t[24],V=t[25];let H=V,U;t[29]===d?U=t[30]:(U=de(d),t[29]=d,t[30]=U);let G=U,K,q;t[31]!==P||t[32]!==F||t[33]!==I||t[34]!==G||t[35]!==z||t[36]!==H||t[37]!==B?(K=()=>{pe({pages:z,folderPaths:I,pagesBySlug:B,pagesByBasename:H,assetPaths:P,filePaths:F,pageIcons:G})},q=[z,I,B,H,P,F,G],t[31]=P,t[32]=F,t[33]=I,t[34]=G,t[35]=z,t[36]=H,t[37]=B,t[38]=K,t[39]=q):(K=t[38],q=t[39]),(0,W.useEffect)(K,q);let J;t[40]!==P||t[41]!==E||t[42]!==F||t[43]!==I||t[44]!==w||t[45]!==L||t[46]!==R||t[47]!==z||t[48]!==H||t[49]!==B?(J={pages:z,pagesBySlug:B,pagesByBasename:H,pageTitles:R,pageMeta:L,folderPaths:I,assetPaths:P,filePaths:F,loading:w,error:E,refetch:A,addPage:te},t[40]=P,t[41]=E,t[42]=F,t[43]=I,t[44]=w,t[45]=L,t[46]=R,t[47]=z,t[48]=H,t[49]=B,t[50]=J):J=t[50];let Y;return t[51]!==n||t[52]!==J?(Y=(0,Le.jsx)(Re,{value:J,children:n}),t[51]=n,t[52]=J,t[53]=Y):Y=t[53],Y}function qe(e){return[e.docName,{size:e.size,modified:e.modified,docExt:e.docExt,icon:e.icon}]}function Je(e){return[e.docName,e.title]}function Ye(e){return e.docName}function Xe(e){return Ge(e),{assetPaths:[],folderPaths:[],filePaths:[]}}function Ze(){let e=(0,W.use)(Re);if(!e)throw Error(`usePageList must be used within <PageListProvider />`);return e}function Qe(){return(0,W.use)(Re)}var $e=t(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),et=t(((e,t)=>{var n=$e();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}})),tt=t(((e,t)=>{t.exports=et()()}));export{H as A,ee as B,K as C,Y as D,re as E,P as F,u as H,L as I,z as L,R as M,I as N,G as O,U as P,F as R,oe as S,J as T,d as V,ye as _,Ie as a,me as b,Me as c,Ee as d,$ as f,Se as g,we as h,Ze as i,M as j,N as k,Fe as l,ve as m,Ke as n,Ne as o,xe as p,Qe as r,Pe as s,tt as t,De as u,Te as v,q as w,ae as x,fe as y,te as z};