PageSourceSearch

https://www.underworldcode.org/build/root-3VHQT63W.js

js underworldcode.org collected 2026-09-29 05:09:19 UTC 34,214 bytes, 11 lines download raw bytes

1import{Aa as Ue,Ja as Me,L as v,a as lt,d as K,ea as je,f as ve,k as ye,ma as ke,na as ze,q as xe,ta as Te,ua as _e,xa as Ce,za as Re}from"/build/_shared/chunk-RUUCG5OS.js";import"/build/_shared/chunk-C4DFGG5C.js";import"/build/_shared/chunk-J7TUH54J.js";import"/build/_shared/chunk-FZ2S7OYD.js";import"/build/_shared/chunk-JEM6JXYA.js";import"/build/_shared/chunk-34XIY2DH.js";import"/build/_shared/chunk-KQM5FBHR.js";import"/build/_shared/chunk-OCWQY3HK.js";import"/build/_shared/chunk-7HNKBP4B.js";import"/build/_shared/chunk-CUKUDK3R.js";import{a as oe}from"/build/_shared/chunk-3EBOCCHJ.js";import"/build/_shared/chunk-O4VQNZ62.js";import{r as D,s as _,t as P}from"/build/_shared/chunk-4OEDG4JQ.js";import{a as ue}from"/build/_shared/chunk-GUCIBHGO.js";import{f as we,l as fe}from"/build/_shared/chunk-AQ2CODAG.js";import{a as O,d as B}from"/build/_shared/chunk-JJXTQVMA.js";import{f as u}from"/build/_shared/chunk-OZE3FFNP.js";var Be="/build/_assets/app-TIOB6ZNY.css";var Le="/build/_assets/thebe-core-VKVHG5VY.css";var Mt=u(lt());var ct="ENTRIES",Ne="KEYS",De="VALUES",j="",J=class{constructor(e,t){let r=e._tree,o=Array.from(r.keys());this.set=e,this._type=t,this._path=o.length>0?[{node:r,keys:o}]:[]}next(){let e=this.dive();return this.backtrack(),e}dive(){if(this._path.length===0)return{done:!0,value:void 0};let{node:e,keys:t}=V(this._path);if(V(t)===j)return{done:!1,value:this.result()};let r=e.get(V(t));return this._path.push({node:r,keys:Array.from(r.keys())}),this.dive()}backtrack(){if(this._path.length===0)return;let e=V(this._path).keys;e.pop(),!(e.length>0)&&(this._path.pop(),this.backtrack())}key(){return this.set._prefix+this._path.map(({keys:e})=>V(e)).filter(e=>e!==j).join("")}value(){return V(this._path).node.get(j)}result(){switch(this._type){case De:return this.value();case Ne:return this.key();default:return[this.key(),this.value()]}}[Symbol.iterator](){return this}},V=a=>a[a.length-1],gt=(a,e,t)=>{let r=new Map;if(e===void 0)return r;let o=e.length+1,i=o+t,n=new Uint8Array(i*o).fill(t+1);for(let s=0;s<o;++s)n[s]=s;for(let s=1;s<i;++s)n[s*o]=s;return Pe(a,e,t,r,n,1,o,""),r},Pe=(a,e,t,r,o,i,n,s)=>{let l=i*n;e:for(let d of a.keys())if(d===j){let p=o[l-1];p<=t&&r.set(s,[a.get(d),p])}else{let p=i;for(let g=0;g<d.length;++g,++p){let c=d[g],m=n*p,b=m-n,w=o[m],h=Math.max(0,p-t-1),x=Math.min(n-1,p+t);for(let k=h;k<x;++k){let R=c!==e[k],E=o[b+k]+ +R,Q=o[b+k+1]+1,F=o[m+k]+1,G=o[m+k+1]=Math.min(E,Q,F);G<w&&(w=G)}if(w>t)continue e}Pe(a.get(d),e,t,r,o,p,n,s+d)}},L=class{constructor(e=new Map,t=""){this._size=void 0,this._tree=e,this._prefix=t}atPrefix(e){if(!e.startsWith(this._prefix))throw new Error("Mismatched prefix");let[t,r]=re(this._tree,e.slice(this._prefix.length));if(t===void 0){let[o,i]=ge(r);for(let n of o.keys())if(n!==j&&n.startsWith(i)){let s=new Map;return s.set(n.slice(i.length),o.get(n)),new L(s,e)}}return new L(t,e)}clear(){this._size=void 0,this._tree.clear()}delete(e){return this._size=void 0,mt(this._tree,e)}entries(){return new J(this,ct)}forEach(e){for(let[t,r]of this)e(t,r,this)}fuzzyGet(e,t){return gt(this._tree,e,t)}get(e){let t=de(this._tree,e);return t!==void 0?t.get(j):void 0}has(e){let t=de(this._tree,e);return t!==void 0&&t.has(j)}keys(){return new J(this,Ne)}set(e,t){if(typeof e!="string")throw new Error("key must be a string");return this._size=void 0,ie(this._tree,e).set(j,t),this}get size(){if(this._size)return this._size;this._size=0;let e=this.entries();for(;!e.next().done;)this._size+=1;return this._size}update(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;let r=ie(this._tree,e);return r.set(j,t(r.get(j))),this}fetch(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;let r=ie(this._tree,e),o=r.get(j);return o===void 0&&r.set(j,o=t()),o}values(){return new J(this,De)}[Symbol.iterator](){return this.entries()}static from(e){let t=new L;for(let[r,o]of e)t.set(r,o);return t}static fromObject(e){return L.from(Object.entries(e))}},re=(a,e,t=[])=>{if(e.length===0||a==null)return[a,t];for(let r of a.keys())if(r!==j&&e.startsWith(r))return t.push([a,r]),re(a.get(r),e.slice(r.length),t);return t.push([a,e]),re(void 0,"",t)},de=(a,e)=>{if(e.length===0||a==null)return a;for(let t of a.keys())if(t!==j&&e.startsWith(t))return de(a.get(t),e.slice(t.length))},ie=(a,e)=>{let t=e.length;e:for(let r=0;a&&r<t;){for(let i of a.keys())if(i!==j&&e[r]===i[0]){let n=Math.min(t-r,i.length),s=1;for(;s<n&&e[r+s]===i[s];)++s;let l=a.get(i);if(s===i.length)a=l;else{let d=new Map;d.set(i.slice(s),l),a.set(e.slice(r,r+s),d),a.delete(i),a=d}r+=s;continue e}let o=new Map;return a.set(e.slice(r),o),o}return a},mt=(a,e)=>{let[t,r]=re(a,e);if(t!==void 0){if(t.delete(j),t.size===0)He(r);else if(t.size===1){let[o,i]=t.entries().next().value;Fe(r,o,i)}}},He=a=>{if(a.length===0)return;let[e,t]=ge(a);if(e.delete(t),e.size===0)He(a.slice(0,-1));else if(e.size===1){let[r,o]=e.entries().next().value;r!==j&&Fe(a.slice(0,-1),r,o)}},Fe=(a,e,t)=>{if(a.length===0)return;let[r,o]=ge(a);r.set(o+e,t),r.delete(o)},ge=a=>
1a[a.length-1],me="or",Oe="and",bt="and_not",U=class{constructor(e){if(e?.fields==null)throw new Error('MiniSearch: option "fields" must be provided');let t=e.autoVacuum==null||e.autoVacuum===!0?le:e.autoVacuum;this._options={...se,...e,autoVacuum:t,searchOptions:{...Se,...e.searchOptions||{}},autoSuggestOptions:{...vt,...e.autoSuggestOptions||{}}},this._index=new L,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldIds={},this._fieldLength=new Map,this._avgFieldLength=[],this._nextId=0,this._storedFields=new Map,this._dirtCount=0,this._currentVacuum=null,this._enqueuedVacuum=null,this._enqueuedVacuumConditions=ce,this.addFields(this._options.fields)}add(e){let{extractField:t,stringifyField:r,tokenize:o,processTerm:i,fields:n,idField:s}=this._options,l=t(e,s);if(l==null)throw new Error(`MiniSearch: document does not have ID field "${s}"`);if(this._idToShortId.has(l))throw new Error(`MiniSearch: duplicate ID ${l}`);let d=this.addDocumentId(l);this.saveStoredFields(d,e);for(let p of n){let g=t(e,p);if(g==null)continue;let c=o(r(g,p),p),m=this._fieldIds[p],b=new Set(c).size;this.addFieldLength(d,m,this._documentCount-1,b);for(let w of c){let h=i(w,p);if(Array.isArray(h))for(let x of h)this.addTerm(m,d,x);else h&&this.addTerm(m,d,h)}}}addAll(e){for(let t of e)this.add(t)}addAllAsync(e,t={}){let{chunkSize:r=10}=t,o={chunk:[],promise:Promise.resolve()},{chunk:i,promise:n}=e.reduce(({chunk:s,promise:l},d,p)=>(s.push(d),(p+1)%r===0?{chunk:[],promise:l.then(()=>new Promise(g=>setTimeout(g,0))).then(()=>this.addAll(s))}:{chunk:s,promise:l}),o);return n.then(()=>this.addAll(i))}remove(e){let{tokenize:t,processTerm:r,extractField:o,stringifyField:i,fields:n,idField:s}=this._options,l=o(e,s);if(l==null)throw new Error(`MiniSearch: document does not have ID field "${s}"`);let d=this._idToShortId.get(l);if(d==null)throw new Error(`MiniSearch: cannot remove document with ID ${l}: it is not in the index`);for(let p of n){let g=o(e,p);if(g==null)continue;let c=t(i(g,p),p),m=this._fieldIds[p],b=new Set(c).size;this.removeFieldLength(d,m,this._documentCount,b);for(let w of c){let h=r(w,p);if(Array.isArray(h))for(let x of h)this.removeTerm(m,d,x);else h&&this.removeTerm(m,d,h)}}this._storedFields.delete(d),this._documentIds.delete(d),this._idToShortId.delete(l),this._fieldLength.delete(d),this._documentCount-=1}removeAll(e){if(e)for(let t of e)this.remove(t);else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new L,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}}discard(e){let t=this._idToShortId.get(e);if(t==null)throw new Error(`MiniSearch: cannot discard document with ID ${e}: it is not in the index`);this._idToShortId.delete(e),this._documentIds.delete(t),this._storedFields.delete(t),(this._fieldLength.get(t)||[]).forEach((r,o)=>{this.removeFieldLength(t,o,this._documentCount,r)}),this._fieldLength.delete(t),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()}maybeAutoVacuum(){if(this._options.autoVacuum===!1)return;let{minDirtFactor:e,minDirtCount:t,batchSize:r,batchWait:o}=this._options.autoVacuum;this.conditionalVacuum({batchSize:r,batchWait:o},{minDirtCount:t,minDirtFactor:e})}discardAll(e){let t=this._options.autoVacuum;try{this._options.autoVacuum=!1;for(let r of e)this.discard(r)}finally{this._options.autoVacuum=t}this.maybeAutoVacuum()}replace(e){let{idField:t,extractField:r}=this._options,o=r(e,t);this.discard(o),this.add(e)}vacuum(e={}){return this.conditionalVacuum(e)}conditionalVacuum(e,t){return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&t,this._enqueuedVacuum!=null?this._enqueuedVacuum:(this._enqueuedVacuum=this._currentVacuum.then(()=>{let r=this._enqueuedVacuumConditions;return this._enqueuedVacuumConditions=ce,this.performVacuuming(e,r)}),this._enqueuedVacuum)):this.vacuumConditionsMet(t)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(e),this._currentVacuum)}async performVacuuming(e,t){let r=this._dirtCount;if(this.vacuumConditionsMet(t)){let o=e.batchSize||pe.batchSize,i=e.batchWait||pe.batchWait,n=1;for(let[s,l]of this._index){for(let[d,p]of l)for(let[g]of p)this._documentIds.has(g)||(p.size<=1?l.delete(d):p.delete(g));this._index.get(s).size===0&&this._index.delete(s),n%o===0&&await new Promise(d=>setTimeout(d,i)),n+=1}this._dirtCount-=r}await null,this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null}vacuumConditionsMet(e){if(e==null)return!0;let{minDirtCount:t,minDirtFactor:r}=e;return t=t||le.minDirtCount,r=r||le.minDirtFactor,this.dirtCount>=t&&this.dirtFactor>=r}get isVacuuming(){return this._currentVacuum!=null}get dirtCount(){return this._dirtCount}get dirtFactor(){return this._dirtCount/(1+this._documentCount+this._dirtCount)}has(e){return this._idToShortId.has(e)}getStoredFields(e){let t=this._idToShortId.get(e);if(t!=null)return this._storedFields.get(t)}search(e,t={}){let{searchOptions:r}=this._options,o={...r,...t},i=this.executeQuery(e,t),n=[];for(let[s,{score:l,terms:d,match:p}]of i){let g=d.length||1,c={id:this._documentIds.get(s),score:l*g,terms:Object.keys(p),queryTerms:d,match:p};Object.assign(c,this._storedFields.get(s)),(o.filter==null||o.filter(c))&&n.push(c)}return e===U.wildcard&&o.boostDocument==null||n.sort(Ae),n}autoSuggest(e,t={}){t={...this._options.autoSuggestOptions,...t};let r=new Map;for(let{score:i,terms:n}of this.search(e,t)){let s=n.join(" "),l=r.get(s);l!=null?(l.score+=i,l.count+=1):r.set(s,{score:i,terms:n,count:1})}let o=[];for(let[i,{score:n,terms:s,count:l}]of r)o.push({suggestion:i,terms:s,score:n/l});return o.sort(Ae),o}get documentCount(){return this._documentCount}get termCount(){return this._index.size}static loadJSON(e,t){if(t==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJS(JSON.parse(e),t)}static async loadJSONAsync(e,t){if(t==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJSAsync(JSON.parse(e),t)}static getDefault(e){if(se.hasOwnProperty(e))return ne(se,e);throw new Error(`MiniSearch: unknown option "${e}"`)}static loadJS(e,t){let{index:r,documentIds:o,fieldLength:i,storedFields:n,serializationVersion:s}=e,l=this.instantiateMiniSearch(e,t);l._documentIds=ee(o),l._fieldLength=ee(i),l._storedFields=ee(n);for(let[d,p]of l._documentIds)l._idToShortId.set(p,d);for(let[d,p]of r){let g=new Map;for(let c of Object.keys(p)){let m=p[c];s===1&&(m=m.ds),g.set(parseInt(c,10),ee(m))}l._index.set(d,g)}return l}static async loadJSAsync(e,t){let{index:r,documentIds:o,fieldLength:i,storedFields:n,serializationVersion:s}=e,l=this.instantiateMiniSearch(e,t);l._documentIds=await te(o),l._fieldLength=await te(i),l._storedFields=await te(n);for(let[p,g]of l._documentIds)l._idToShortId.set(g,p);let d=0;for(let[p,g]of r){let c=new Map;for(let m of Object.keys(g)){let b=g[m];s===1&&(b=b.ds),c.set(parseInt(m,10),await te(b))}++d%1e3===0&&await Ve(0),l._index.set(p,c)}return l}static instantiateMiniSearch(e,t){let{documentCount:r,nextId:o,fieldIds:i,averageFieldLength:n,dirtCount:s,serializationVersion:l}=e;if(l!==1&&l!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");let d=new U(t);return d._documentCount=r,d._nextId=o,d._idToShortId=new Map,d._fieldIds=i,d._avgFieldLength=n,d._dirtCount=s||0,d._index=new L,d}executeQuery(e,t={}){if(e===U.wildcard)return this.executeWildcardQuery(t);if(typeof e!="string"){let c={...t,...e,queries:void 0},m=e.queries.map(b=>this.executeQuery(b,c));return this.combineResults(m,c.combineWith)}let{tokenize:r,processTerm:o,searchOptions:i}=this._options,n={tokenize:r,processTerm:o,...i,...t},{tokenize:s,processTerm:l}=n,g=s(e).flatMap(c=>l(c)).filter(c=>!!c).map(ut(n)).map(c=>this.executeQuerySpec(c,n));return this.combineResults(g,n.combineWith)}executeQuerySpec(e,t){let r={...this._options.searchOptions,...t},o=(r.fields||this._options.fields).reduce((w,h)=>({...w,[h]:ne(r.boost,h)||1}),{}),{boostDocument:i,weights:n,maxFuzzy:s,bm25:l}=r,{fuzzy:d,prefix:p}={...Se.weights,...n},g=this._index.get(e.term),c=this.termResults(e.term,e.term,1,e.termBoost,g,o,i,l),m,b;if(e.prefix&&(m=this._index.atPrefix(e.term)),e.fuzzy){let w=e.fuzzy===!0?.2:e.fuzzy,h=w<1?Math.min(s,Math.round(e.term.length*w)):w;h&&(b=this._index.fuzzyGet(e.term,h))}if(m)for(let[w,h]of m){let x=w.length-e.term.length;if(!x)continue;b?.delete(w);let k=p*w.length/(w.length+.3*x);this.termResults(e.term,w,k,e.termBoost,h,o,i,l,c)}if(b)for(let w of b.keys()){let[h,x]=b.get(w);if(!x)continue;let k=d*w.length/(w.length+x);this.termResults(e.term,w,k,e.termBoost,h,o,i,l,c)}return c}executeWildcardQuery(e){let t=new Map,r={...this._options.searchOptions,...e};for(let[o,i]of this._documentIds){let n=r.boostDocument?r.boostDocument(i,"",this._storedFields.get(o)):1;t.set(o,{score:n,terms:[],match:{}})}return t}combineResults(e,t=me){if(e.length===0)return new Map;let r=t.toLowerCase(),o=ht[r];if(!o)throw new Error(`Invalid combination operator: ${t}`);return e.reduce(o)||new Map}toJSON(){let e=[];for(let[t,r]of this._index){let o={};for(let[i,n]of r)o[i]=Object.fromEntries(n);e.push([t,o])}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),dirtCount:this._dirtCount,index:e,serializationVersion:2}}termResults(e,t,r,o,i,n,s,l,d=new Map){if(i==null)return d;for(let p of Object.keys(n)){let g=n[p],c=this._fieldIds[p],m=i.get(c);if(m==null)continue;let b=m.size,w=this._avgFieldLength[c];
1for(let h of m.keys()){if(!this._documentIds.has(h)){this.removeTerm(c,h,t),b-=1;continue}let x=s?s(this._documentIds.get(h),t,this._storedFields.get(h)):1;if(!x)continue;let k=m.get(h),R=this._fieldLength.get(h)[c],E=ft(k,b,this._documentCount,R,w,l),Q=r*o*g*x*E,F=d.get(h);if(F){F.score+=Q,yt(F.terms,e);let G=ne(F.match,t);G?G.push(p):F.match[t]=[p]}else d.set(h,{score:Q,terms:[e],match:{[t]:[p]}})}}return d}addTerm(e,t,r){let o=this._index.fetch(r,Ee),i=o.get(e);if(i==null)i=new Map,i.set(t,1),o.set(e,i);else{let n=i.get(t);i.set(t,(n||0)+1)}}removeTerm(e,t,r){if(!this._index.has(r)){this.warnDocumentChanged(t,e,r);return}let o=this._index.fetch(r,Ee),i=o.get(e);i==null||i.get(t)==null?this.warnDocumentChanged(t,e,r):i.get(t)<=1?i.size<=1?o.delete(e):i.delete(t):i.set(t,i.get(t)-1),this._index.get(r).size===0&&this._index.delete(r)}warnDocumentChanged(e,t,r){for(let o of Object.keys(this._fieldIds))if(this._fieldIds[o]===t){this._options.logger("warn",`MiniSearch: document with ID ${this._documentIds.get(e)} has changed before removal: term "${r}" was not present in field "${o}". Removing a document after it has changed can corrupt the index!`,"version_conflict");return}}addDocumentId(e){let t=this._nextId;return this._idToShortId.set(e,t),this._documentIds.set(t,e),this._documentCount+=1,this._nextId+=1,t}addFields(e){for(let t=0;t<e.length;t++)this._fieldIds[e[t]]=t}addFieldLength(e,t,r,o){let i=this._fieldLength.get(e);i==null&&this._fieldLength.set(e,i=[]),i[t]=o;let s=(this._avgFieldLength[t]||0)*r+o;this._avgFieldLength[t]=s/(r+1)}removeFieldLength(e,t,r,o){if(r===1){this._avgFieldLength[t]=0;return}let i=this._avgFieldLength[t]*r-o;this._avgFieldLength[t]=i/(r-1)}saveStoredFields(e,t){let{storeFields:r,extractField:o}=this._options;if(r==null||r.length===0)return;let i=this._storedFields.get(e);i==null&&this._storedFields.set(e,i={});for(let n of r){let s=o(t,n);s!==void 0&&(i[n]=s)}}};U.wildcard=Symbol("*");var ne=(a,e)=>Object.prototype.hasOwnProperty.call(a,e)?a[e]:void 0,ht={[me]:(a,e)=>{for(let t of e.keys()){let r=a.get(t);if(r==null)a.set(t,e.get(t));else{let{score:o,terms:i,match:n}=e.get(t);r.score=r.score+o,r.match=Object.assign(r.match,n),Ie(r.terms,i)}}return a},[Oe]:(a,e)=>{let t=new Map;for(let r of e.keys()){let o=a.get(r);if(o==null)continue;let{score:i,terms:n,match:s}=e.get(r);Ie(o.terms,n),t.set(r,{score:o.score+i,terms:o.terms,match:Object.assign(o.match,s)})}return t},[bt]:(a,e)=>{for(let t of e.keys())a.delete(t);return a}},wt={k:1.2,b:.7,d:.5},ft=(a,e,t,r,o,i)=>{let{k:n,b:s,d:l}=i;return Math.log(1+(t-e+.5)/(e+.5))*(l+a*(n+1)/(a+n*(1-s+s*r/o)))},ut=a=>(e,t,r)=>{let o=typeof a.fuzzy=="function"?a.fuzzy(e,t,r):a.fuzzy||!1,i=typeof a.prefix=="function"?a.prefix(e,t,r):a.prefix===!0,n=typeof a.boostTerm=="function"?a.boostTerm(e,t,r):1;return{term:e,fuzzy:o,prefix:i,termBoost:n}},se={idField:"id",extractField:(a,e)=>a[e],stringifyField:(a,e)=>a.toString(),tokenize:a=>a.split(xt),processTerm:a=>a.toLowerCase(),fields:void 0,searchOptions:void 0,storeFields:[],logger:(a,e)=>{typeof console?.[a]=="function"&&console[a](e)},autoVacuum:!0},Se={combineWith:me,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:wt},vt={combineWith:Oe,prefix:(a,e,t)=>e===t.length-1},pe={batchSize:1e3,batchWait:10},ce={minDirtFactor:.1,minDirtCount:20},le={...pe,...ce},yt=(a,e)=>{a.includes(e)||a.push(e)},Ie=(a,e)=>{for(let t of e)a.includes(t)||a.push(t)},Ae=({score:a},{score:e})=>e-a,Ee=()=>new Map,ee=a=>{let e=new Map;for(let t of Object.keys(a))e.set(parseInt(t,10),a[t]);return e},te=async a=>{let e=new Map,t=0;for(let r of Object.keys(a))e.set(parseInt(r,10),a[r]),++t%1e3===0&&await Ve(0);return e},Ve=a=>new Promise(e=>setTimeout(e,a)),xt=/[\n\r\p{Z}\p{P}]+/u;function jt(a){return{...a,tokenize:U.getDefault("tokenize"),processTerm:U.getDefault("processTerm"),extractField:ze}}function kt(a){let[e,...t]=a.entries();if(e===void 0)return[];let r=e[1],o=new Map(Array.from(r.entries(),([n,s])=>{let{id:l,score:d,terms:p,queryTerms:g,match:c,...m}=s;return[n,{id:n,queries:[{term:g[0],matches:c}],...m}]}
1)),i=t.reduce((n,s)=>{let l=new Map;return s[1].forEach((p,g)=>{let c=n.get(g);if(c==null)return;let{queryTerms:m,match:b}=p;c.queries.push({term:m[0],matches:b}),l.set(g,c)}),l},o);return Array.from(i.values())}function qe(a,e){let t=jt(e),r=new U(t);return r.addAll(a.map((o,i)=>({...o,id:i}))),async o=>{let i=t.tokenize(o).filter(n=>!!n);if(i.length){let n=new Map(i.map(s=>[s,new Map(r.search(s).map(l=>[l.id,l]))]));return kt(n)}else return}}var z=u(B(),1),Je=u(O(),1);var zt={}.hasOwnProperty,S=function(a,e,t){let r=ue(t||e),o=e&&typeof e=="object"&&"cascade"in e?e.cascade:void 0,i=o??!0;return n(a);function n(s,l,d){let p=[];if(!r(s,l,d))return null;if(s.children){let m=-1;for(;++m<s.children.length;){let b=n(s.children[m],m,s);b&&p.push(b)}if(i&&s.children.length>0&&p.length===0)return null}let g={},c;for(c in s)zt.call(s,c)&&(g[c]=c==="children"?p:s[c]);return g}};var M=u(B(),1);var We=u(B(),1);var be=u(oe(),1);function I({node:a,className:e,children:t}){let r=ve(),{key:o}=a,i=(0,be.default)(e,a.class),n=a.visibility==="hide"?"":`${r} subgrid-gap col-page [&>*]:col-page`;return(0,We.jsx)("div",{id:o,className:(0,be.default)("myst-landing-block relative group/block py-6",i,{[n]:!(i&&i.includes("col-")),hidden:a.visibility==="remove"}),children:t},`block-${o}`)}function H(a){let{node:e,blockName:t}=a;return(0,M.jsx)(I,Object.assign({},a,{children:(0,M.jsxs)("div",{className:"myst-landing-invalid relative",role:"alert",children:[(0,M.jsxs)("div",{className:"myst-landing-invalid-header px-4 py-2 font-bold text-white bg-red-500 rounded-t",children:["Invalid block ",(0,M.jsx)("span",{className:"font-mono",children:t})]}),(0,M.jsxs)("div",{className:"myst-landing-invalid-border border border-t-0 border-red-400 rounded-b ",children:[(0,M.jsx)("div",{className:"myst-landing-invalid-message px-4 py-3 text-red-700 bg-red-100",children:(0,M.jsxs)("p",{children:["This '",t,"' block does not conform to the expected AST structure."]})}),(0,M.jsx)("div",{className:"myst-landing-invalid-content px-4 py-3",children:(0,M.jsx)(v,{ast:e.children})})]})]})}))}var N=u(B(),1),Ye=u(O(),1);var Ge=u(oe(),1);function q({node:a,className:e}){let{enumerator:t,depth:r,key:o,identifier:i,html_id:n}=a,s=n||i||o;return(0,Ye.createElement)(`h${r}`,{className:(0,Ge.default)("myst-landing-heading",a.class,e,"group"),id:s},(0,N.jsxs)(N.Fragment,{children:[t&&(0,N.jsx)("span",{className:"myst-landing-enumerator mr-3 select-none",children:t}),(0,N.jsx)("span",{className:"myst-landing-text heading-text",children:(0,N.jsx)(v,{ast:a.children})}),(0,N.jsx)(xe,{className:"myst-landing-link font-normal",id:s,kind:"Section",hover:!0,hideInPopup:!0,noWidth:!0})]}))}function W(a,e){let t;for(t=0;t<a.children.length;t++){let r=a.children[t];if(r.type==="heading"&&(e===void 0||r.depth===e))break}return t===a.children.length?{head:void 0,body:{type:"block",children:a.children}}:{head:{type:"block",children:a.children.slice(0,t+1)},body:{type:"block",children:a.children.slice(t+1)}}}function Tt(a){let{node:e}=a,{image:t,body:r,links:o,subtitle:i,heading:n}=(0,Je.useMemo)(()=>{var s,l;let{head:d,body:p}=W(e),g=P("link,crossReference",p),c=_("paragraph",d),m=_("heading",d),b=_("image",p);return{body:(l=(s=S(p,h=>
1!D("link[class*=button], crossReference[class*=button], image",h)))===null||s===void 0?void 0:s.children)!==null&&l!==void 0?l:[],image:b,links:g,subtitle:c,heading:m}},[e]);return!t||!r?(0,z.jsx)(H,Object.assign({},a,{blockName:"split-image"})):(0,z.jsx)(I,Object.assign({},a,{children:(0,z.jsxs)("div",{className:"myst-landing-split-img relative rounded-md bg-stone-900 dark:bg-stone-800",children:[(0,z.jsx)("div",{className:"myst-landing-split-img-image lg:absolute lg:h-full lg:w-[calc(50%)] md:absolute md:h-full md:w-[calc(100%/3)] h-80 relative [&_img]:h-full [&_img]:w-full [&_img]:object-cover [&_img]:m-0 [&_picture]:m-0 [&_picture]:inline",children:(0,z.jsx)(v,{ast:t})}),(0,z.jsx)("div",{className:"myst-landing-split-img-content-wrapper relative py-24",children:(0,z.jsxs)("div",{className:"myst-landing-split-img-content lg:ml-auto lg:w-[calc(50%)] lg:p-8 lg:pl-24 md:ml-auto md:w-[calc(2*100%/3)] md:pl-16 md:p-8 px-6",children:[i&&(0,z.jsx)("p",{className:"myst-landing-split-img-subtitle my-0 font-semibold prose text-indigo-400 uppercase  prose-invert",children:(0,z.jsx)(v,{ast:i.children})}),n&&(0,z.jsx)(q,{node:n,className:"myst-landing-split-img-heading mt-2 mb-0 text-5xl font-semibold tracking-tight text-white"}),(0,z.jsx)("div",{className:"myst-landing-split-img-body mt-6",children:(0,z.jsx)(v,{ast:r,className:"prose prose-invert"})}),o&&(0,z.jsx)("div",{className:"myst-landing-split-img-links flex flex-row flex-wrap items-center gap-4 mt-8",children:(0,z.jsx)(v,{ast:o,className:"prose prose-invert"})})]})})]})}))}var Ze={block:{"block[kind=split-image]":Tt}};var T=u(B(),1),$e=u(O(),1);function _t(a){let{node:e}=a,{body:t,links:r,subtitle:o,heading:i}=(0,$e.useMemo)(()=>{var n,s;let{head:l,body:d}=W(e),p=P("link[class*=button], crossReference[class*=button]",d),g=_("paragraph",l),c=_("heading",l);return{body:(s=(n=S(d,b=>!D("link[class*=button], crossReference[class*=button]",b)))===null||n===void 0?void 0:n.children)!==null&&s!==void 0?s:[],links:p,subtitle:g,heading:c}},[e]);return t?(0,T.jsx)(I,Object.assign({},a,{children:(0,T.jsx)("div",{className:"myst-landing-centered relative text-center",children:(0,T.jsxs)("div",{className:"myst-landing-centered-inner py-20 sm:py-28",children:[o&&(0,T.jsx)("p",{className:"myst-landing-centered-subtitle my-0 font-semibold text-indigo-400 uppercase",children:(0,T.jsx)(v,{ast:o.children})}),i&&(0,T.jsx)(q,{node:i,className:"myst-landing-centered-heading mt-2 mb-0 text-5xl font-semibold tracking-tight"}),t&&(0,T.jsx)("div",{className:"myst-landing-centered-body mt-6",children:(0,T.jsx)(v,{ast:t})}),r&&(0,T.jsx)("div",{className:"myst-landing-centered-links flex flex-row flex-wrap items-center justify-center gap-4 mt-8",children:(0,T.jsx)(v,{ast:r})})]})})})):(0,T.jsx)(H,Object.assign({},a,{blockName:"centered"}))}var Xe={block:{"block[kind=centered]":_t}};var C=u(B(),1),Qe=u(O(),1);function Ct(a){let{node:e}=a,{body:t,links:r,subtitle:o,heading:i}=(0,Qe.useMemo)(()=>{var n,s;let{head:l,body:d}=W(e),p=P("link[class*=button], crossReference[class*=button]",d),g=_("paragraph",l),c=_("heading",l);return{body:(s=(n=S(d,b=>!D("link[class*=button], crossReference[class*=button]",b)))===null||n===void 0?void 0:n.children)!==null&&s!==void 0?s:[],links:p,subtitle:g,heading:c}},[e]);return t?(0,C.jsx)(I,Object.assign({},a,{children:(0,C.jsxs)("div",{className:"myst-landing-justified grid-areas-just-narrow md:grid-areas-just-wide grid grid-cols-[auto_1fr_auto] justify-between gap-2 py-20 sm:py-28 lg:px-8",children:[o&&(0,C.jsx)("p",{className:"myst-landing-justified-subtitle grid-area-subtitle my-0 font-semibold text-indigo-400 uppercase",children:(0,C.jsx)(v,{ast:o.children})}),i&&(0,C.jsx)(q,{node:i,className:"myst-landing-justified-heading grid-area-title mt-2 mb-0 text-5xl font-semibold tracking-tight"}),t&&(0,C.jsx)("div",{className:"myst-landing-justified-body grid-area-body mt-6",children:(0,C.jsx)(v,{ast:t})}),r&&(0,C.jsx)("div",{className:"myst-landing-justified-links grid-area-links flex flex-row flex-wrap items-center gap-4",children:(0,C.jsx)(v,{ast:r})})]})})):(0,C.jsx)(H,Object.assign({},a,{blockName:"justified"}))}var Ke={block:{"block[kind=justified]":Ct}};var A=u(B(),1),et=u(O(),1);function Rt(a){let{node:e}=a,{grid:t,body:r,links:o}=(0,et.useMemo)(()=>{var i,n;let s=_("grid",e),l=S(e,g=>g.type!=="grid"),d=P("link[class*=button], crossReference[class*=button]",l);return{body:(n=(i=S(l,g=>!D("link[class*=button], crossReference[class*=button]",g)))===null||i===void 0?void 0:i.children)!==null&&n!==void 0?n:[],grid:s,links:d}},[e]);return t?(0,A.jsx)(I,Object.assign({},a,{children:(0,A.jsxs)("div",{className:"myst-landing-logo-cloud py-20 text-center sm:py-28",children:[(0,A.jsx)("div",{className:"myst-landing-logo-cloud-body font-semibold",children:(0,A.jsx)(v,{ast:r})}),t&&(0,A.jsx)(v,{ast:t}),o&&(0,A.jsx)("div",{className:"myst-landing-logo-cloud-links flex flex-row flex-wrap items-center justify-center gap-4 mt-8",children:(0,A.jsx)(v,{ast:o})})]})})):(0,A.jsx)(H,Object.assign({},a,{blockName:"logo-cloud"}))}var tt={block:{"block[kind=logo-cloud]":Rt}};var rt=K([Ze,Xe,Ke,tt]);var f=u(B(),1),Y=u(O(),1),he=u(oe(),1);var Ut=function(a,e,t,r,o){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?a!==e||!o:!e.has(a))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?o.call(a,t):o?o.value=t:e.set(a,t),t},Z=function(a,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?a!==e||!r:!e.has(a))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(a):r?r.value:e.get(a)},$,X,ae=class{constructor(e){$.set(this,void 0),X.set(this,new EventTarget),Ut(this,$,e,"f")}get(e){return Z(this,$,"f")[e]}set(e,t){Z(this,$,"f")[e]=t,Z(this,X,"f").dispatchEvent(new CustomEvent(`change:${e}`,{detail:t})),Z(this,X,"f").dispatchEvent(new CustomEvent("change",{detail:t}))}on(e,t){Z(this,X,"f").addEventListener(e,t)}off(e,t){throw new Error("MystAnyModel.off not implemented yet.")}save_changes(){throw new Error("MystAnyModel.save_changes not implemented yet.")}send(e,t,r){throw new Error("MystAnyModel.send not implemented yet.")}get widget_manager(){throw new Error("MystAnyModel.widget_manager does not exist.")}};$=new WeakMap,X=new WeakMap;var at=function(a,e,t,r){function o(i){return i instanceof t?i:new t(function(n){n(i)})}return new(t||(t=Promise))(function(i,n){function s(p){try{d(r.next(p))}catch(g){n(g)}}function l(p){try{d(r.throw(p))}catch(g){n(g)}}function d(p){p.done?i(p.value):o(p.value).then(s,l)}d((r=r.apply(a,e||[])).next())})};function ot({node:a}){var e;let t=a.esm,r=t&&typeof t=="string",o=a.model&&typeof a.model=="object",i=Y.useRef(null),[n,s]=Y.useState(null);return Y.useEffect(()=>{s(null);let l=new AbortController;if(l.signal.aborted)return;let d,p;l.signal.addEventListener("abort",()=>at(this,void 0,void 0,function*(){yield p==null?void 0:p(),yield d==null?void 0:d()}));let g=!0;return console.debug("AnyRenderer importing:",t),import(t).then(c=>at(this,void 0,void 0,function*(){var m,b,w;let h=i.current;if(!h)return;console.debug("AnyRenderer imported",c);let x=c.default,k=new ae(a.model);d=yield(m=x.initialize)===null||m===void 0?void 0:m.call(x,{model:k}),h.className=(0,he.default)("myst-anywidget",a.class);let R;if(g){let E=(b=h.shadowRoot)!==null&&b!==void 0?b:h.attachShadow({mode:"open"});R=document.createElement("div"),R.className=(0,he.default)("myst-anywidget",a.class),R.style.position="relative",E.replaceChildren(R)}else R=h;if(a.css){let E=document.createElement("link");E.rel="stylesheet",E.href=a.css,R.appendChild(E)}p=yield(w=x.render)===null||w===void 0?void 0:w.call(x,{model:k,el:R})})).catch(c=>{console.error("AnyRenderer failed to import module:",c),s(c instanceof Error?c:new Error(String(c)))}),()=>{l==null||l.abort()}},[a]),n?(0,f.jsxs)("details",{className:"p-3 bg-gray-100 rounded border border-gray-300 cursor-pointer",children:[(0,f.jsxs)("summary",{className:"text-sm text-gray-600 select-none",children:["Failed to load ",(0,f.jsx)("code",{className:"text-xs",children:"anywidget"})," module."]}),(0,f.jsxs)("div",{className:"pt-2 mt-2 space-y-1 text-xs border-t border-gray-200",children:[(0,f.jsxs)("div",{className:"text-gray-500",children:[(0,f.jsx)("span",{className:"font-medium",children:"Widget Module URL:"})," ",t]}),(0,f.jsxs)("div",{className:"text-gray-700",children:[(0,f.jsx)("span",{className:"font-medium",children:"Error:"})," ",n.message]}),(0,f.jsxs)("div",{className:"text-gray-700",children:[(0,f.jsx)("span",{className:"font-medium",children:"Stack:"})," ",n.stack]})]})]}):!r||!o?(0,f.jsxs)("div",{className:"p-3 space-y-2 rounded-md border border-red-500",children:[(0,f.jsxs)("div",{children:["Invalid ",(0,f.jsx)("code",{children:"anywidget"})," directive."]}),!r&&(0,f.jsxs)("div",{className:"px-1",children:[(0,f.jsx)("div",{children:"Invalid import URL"}),(0,f.jsx)("div",{className:"text-sm text-gray-500",children:a.esm})]}),!o&&(0,f.jsxs)("div",{className:"px-1",children:[(0,f.jsx)("div",{children:"Invalid JSON data"}),(0,f.jsx)("div",{className:"text-sm text-gray-500",children:(e=a.model)===null||e===void 0?void 0:e.toString()})]})]}):(0,f.jsx)("div",{className:"relative w-full",ref:i})}var it={anywidget:ot};var nt=u(O()),y=u(B()),Bt=K([Te,Me,rt,it]),Lt=({data:a})=>{var e,t,r,o;return Ce({title:(e=a==null?void 0:a.config)==null?void 0:e.title,de
1scription:(t=a==null?void 0:a.config)==null?void 0:t.description,twitter:(o=(r=a==null?void 0:a.config)==null?void 0:r.options)==null?void 0:o.twitter})},St=()=>[{rel:"stylesheet",href:Be},{rel:"stylesheet",href:Le},{rel:"stylesheet",href:"https://cdn.jsdelivr.net/npm/[email protected]/css/mpl_widget.css"},{rel:"stylesheet",href:"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.css"}];function It(a){let e={fields:ke,storeFields:["hierarchy","content","url","type","id","position"],idField:"id",searchOptions:{fuzzy:.2,prefix:!0}};return qe(a.records,e)}function At(){return(0,y.jsx)(y.Fragment,{children:(0,y.jsxs)("dialog",{id:"myst-no-css",style:{position:"fixed",left:"0px",top:"0px",width:"100%",height:"100vh",fontSize:"4rem",padding:"1rem",color:"black",background:"white"},suppressHydrationWarning:!0,children:[(0,y.jsx)("strong",{children:"Site not loading correctly?"}),(0,y.jsxs)("p",{children:["This may be due to an incorrect ",(0,y.jsx)("code",{children:"BASE_URL"})," configuration. See"," ",(0,y.jsx)("a",{href:"https://mystmd.org/guide/deployment#deploy-base-url",children:"the MyST Documentation"})," ","for reference."]}),(0,y.jsx)("script",{dangerouslySetInnerHTML:{__html:`
2    (() => {
3            // Test for has-styling variable set by the MyST stylesheet
4            const node = document.currentScript.parentNode;
5            const hasCSS = window.getComputedStyle(node).getPropertyValue("--has-styling");
6            if (hasCSS === ""){
7                    node.showModal();
8            }
9
10    })()
11`}})]})})}function st(){let{theme:a,config:e,CONTENT_CDN_PORT:t,MODE:r,BASE_URL:o}=fe(),i=(0,nt.useCallback)(n=>It(n),[]);return(0,y.jsx)(ye,{factory:i,children:(0,y.jsxs)(Re,{theme:a,config:e,scripts:r==="static"?void 0:(0,y.jsx)(je,{port:t}),staticBuild:r==="static",baseurl:o,renderers:Bt,head:(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("link",{rel:"icon",href:`${o||""}/favicon.ico`}),(0,y.jsx)("link",{rel:"stylesheet",href:`${o||""}/myst-theme.css`})]}),children:[(0,y.jsx)(_e,{targets:[{id:"skip-to-frontmatter",title:"Skip to article frontmatter"},{id:"skip-to-article",title:"Skip to article content"}]}),(0,y.jsx)(At,{}),(0,y.jsx)(we,{})]})})}export{Ue as ErrorBoundary,st as default,St as links,Lt as meta};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.